Commit a049d3ae authored by Marco Huber's avatar Marco Huber

[BUGFIX] Load TinyMCE via require.js to fix problems with IRRE and update some more core changes

parent 6fb938c8
...@@ -280,6 +280,29 @@ class Loader { ...@@ -280,6 +280,29 @@ class Loader {
$pageRenderer->addJsFile($script, 'text/javascript', FALSE, TRUE, '', TRUE); $pageRenderer->addJsFile($script, 'text/javascript', FALSE, TRUE, '', TRUE);
} }
/**
* Loads the required javascript via the require.js
*
* @return void
* @see \SGalinski\Tinymce4Rte\Form\Element\RichTextElement->loadRequireModulesForRTE
*/
public function loadJsViaRequireJS() {
if (self::$init) {
return;
}
self::$init = TRUE;
$scripts = array();
$pathToTinyMceExtension = ExtensionManagementUtility::extRelPath('tinymce');
$scripts[] = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/tinymce/tinymce.min.js';
$scripts[] = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/MutationObserver/MutationObserver.js';
$scripts[] = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/WeakMap/WeakMap.js';
$scripts[] = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Resources/Public/JavaScript/Loader.js';
$scripts[] = $this->getConfiguration();
return $scripts;
}
/** /**
* Parses and processes the tinyMCE configuration * Parses and processes the tinyMCE configuration
* *
......
...@@ -182,6 +182,7 @@ SG.TinyMceLoader.prototype = { ...@@ -182,6 +182,7 @@ SG.TinyMceLoader.prototype = {
if (hasMatches) { if (hasMatches) {
this.tinyMceOptions.selector = this.tinyMceOptions.selector.slice(1); this.tinyMceOptions.selector = this.tinyMceOptions.selector.slice(1);
this.originalInit.call(tinymce, this.getTinyMceOptionsAsNewObject()); this.originalInit.call(tinymce, this.getTinyMceOptionsAsNewObject());
document.getElementById('pleasewait' + this.tinyMceOptions.editornumber).style.display = 'none';
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment