Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cms/djangoapps/contentstore/views/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ def component_handler(request, usage_key_string, handler, suffix=''):
"""
usage_key = UsageKey.from_string(usage_key_string)


# Addendum:
# TNL 101-62 studio write permission is also checked for editing content.

Expand Down
2 changes: 2 additions & 0 deletions cms/djangoapps/contentstore/views/tests/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,9 @@ def test_create_nicely(self):
# check against the template
template = ProblemBlock.get_template(template_id)
self.assertEqual(problem.data, template['data'])
# pylint: disable=unsubscriptable-object
self.assertEqual(problem.display_name, template['metadata']['display_name'])
# pylint: disable=unsubscriptable-object
self.assertEqual(problem.markdown, template['metadata']['markdown'])

def test_create_item_negative(self):
Expand Down
2 changes: 2 additions & 0 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,8 @@
##### custom vendor plugin variables #####
# JavaScript code can access this data using `process.env.JS_ENV_EXTRA_CONFIG`
# One of the current use cases for this is enabling custom TinyMCE plugins
# (TINYMCE_ADDITIONAL_PLUGINS) and overriding the TinyMCE configuration
# (TINYMCE_CONFIG_OVERRIDES).
JS_ENV_EXTRA_CONFIG = {}

############################### PIPELINE #######################################
Expand Down
6 changes: 6 additions & 0 deletions common/lib/xmodule/xmodule/js/src/html/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@
}
});
}

// apply configuration overrides if have been defined
var tinyMceConfigOverrides = process.env.JS_ENV_EXTRA_CONFIG.TINYMCE_CONFIG_OVERRIDES;
if (tinyMceConfigOverrides) {
Object.assign(tinyMceConfig, tinyMceConfigOverrides);
}
}

this.tiny_mce_textarea = $(".tiny-mce", this.element).tinymce(tinyMceConfig);
Expand Down