Commit 022a016b authored by Stefan Galinski's avatar Stefan Galinski 🎮

Merge branch 'master' into 'master'

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



See merge request !5
parents 6fb938c8 a049d3ae
......@@ -280,6 +280,29 @@ class Loader {
$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
*
......
......@@ -182,6 +182,7 @@ SG.TinyMceLoader.prototype = {
if (hasMatches) {
this.tinyMceOptions.selector = this.tinyMceOptions.selector.slice(1);
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