Skip to content
Snippets Groups Projects
Commit d17eb30e authored by Marius Dumitru Florea's avatar Marius Dumitru Florea
Browse files

XWIKI-22781: Load JavaScript skin extensions in standalone WYSIWYG editor by default

* Only for JavaScript modules that are marked as safe.
parent 88e3e7d2
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,7 @@
allowedContent = $.extend(true, {}, config.allowedContentBySyntax[config.sourceSyntax]);
// Forbid script tags if JavaScript skin extensions are not loaded.
if (!config.loadJavaScriptSkinExtensions && '$1' in allowedContent && 'elements' in allowedContent.$1) {
if (config.loadJavaScriptSkinExtensions === 0 && '$1' in allowedContent && 'elements' in allowedContent.$1) {
delete allowedContent.$1.elements.script;
}
......
......@@ -79,7 +79,7 @@
var dataFilter = editor.dataProcessor && editor.dataProcessor.dataFilter;
if (dataFilter) {
dataFilter.addRules(replaceEmptyLinesWithEmptyParagraphs, {priority: 5});
if (editor.config.loadJavaScriptSkinExtensions) {
if (editor.config.loadJavaScriptSkinExtensions !== 0) {
dataFilter.addRules(unprotectAllowedScripts, {priority: 5});
}
}
......
......@@ -148,7 +148,7 @@
<linkShowTargetTab>0</linkShowTargetTab>
</property>
<property>
<loadJavaScriptSkinExtensions>0</loadJavaScriptSkinExtensions>
<loadJavaScriptSkinExtensions>1</loadJavaScriptSkinExtensions>
</property>
<property>
<removeButtons/>
......
......@@ -73,7 +73,7 @@
#set ($discard = $xwiki.ssx.use('CKEditor.ContentSheet'))
## Include the stylesheets that affect the content in view mode.
#ckeditor_templateWithoutEmptyLines("stylesheets.vm")
#if ($xwiki.getDocument('CKEditor.Config').getValue('loadJavaScriptSkinExtensions') == 1)
#if ($xwiki.getDocument('CKEditor.Config').getValue('loadJavaScriptSkinExtensions') != 0)
#ckeditor_templateWithoutEmptyLines("javascript.vm")
#end
&lt;/head&gt;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment