Commit 667e63f2 authored by Stefan Galinski's avatar Stefan Galinski 🎮

[TASK] Move tinymce to a contrib directory

parent d8cb4ed9
......@@ -102,7 +102,7 @@ class Loader {
}
$languageFile = PATH_site . ExtensionManagementUtility::siteRelPath('tinymce') .
'tinymce/langs/' . $languageKey . '.js';
'Contrib/tinymce/langs/' . $languageKey . '.js';
if (!is_file($languageFile)) {
$languageKey = 'en';
}
......@@ -148,7 +148,7 @@ class Loader {
/**
* Returns the needed javascript inclusion code
*
* Note: This function can only be called once for each loaded configuration.
* Note: This function can only be called once.
*
* @param bool $loadConfigurationWithTimer
* @return string
......@@ -157,11 +157,18 @@ class Loader {
$output = '';
if (!self::$init) {
self::$init = TRUE;
$script = $GLOBALS['BACK_PATH'] . ExtensionManagementUtility::extRelPath('tinymce') .
'tinymce/tinymce.min.js';
$pathToTinyMceExtension = ExtensionManagementUtility::extRelPath('tinymce');
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/tinymce/tinymce.min.js';
$output = '<script type="text/javascript" src="' . $script . '"></script>';
$script = $this->getConfiguration($loadConfigurationWithTimer);
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/MutationObserver/MutationObserver.js';
$output .= '<script type="text/javascript" src="' . $script . '"></script>';
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Resources/Public/JavaScript/Loader.js';
$output .= '<script type="text/javascript" src="' . $script . '"></script>';
$script = $this->getConfiguration();
$output .= '<script type="text/javascript" src="' . $script . '"></script>';
}
......@@ -171,6 +178,8 @@ class Loader {
/**
* Loads the required javascript via the given page renderer instance
*
* Note: This function can only be called once.
*
* @param PageRenderer $pageRenderer
* @param bool $loadConfigurationWithTimer
* @return void
......@@ -181,8 +190,15 @@ class Loader {
}
self::$init = TRUE;
$script = $GLOBALS['BACK_PATH'] . ExtensionManagementUtility::extRelPath('tinymce') . 'tinymce/tinymce.min.js';
$pageRenderer->addJsLibrary('tinymce', $script, 'text/javascript', FALSE, TRUE, '', TRUE);
$pathToTinyMceExtension = ExtensionManagementUtility::extRelPath('tinymce');
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/tinymce/tinymce.min.js';
$pageRenderer->addJsLibrary('tinymce', $script);
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/MutationObserver/MutationObserver.js';
$pageRenderer->addJsLibrary('MutationObserver', $script);
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Resources/Public/JavaScript/Loader.js';
$pageRenderer->addJsFile($script);
$script = $this->getConfiguration($loadConfigurationWithTimer);
$pageRenderer->addJsFile($script, 'text/javascript', FALSE, TRUE, '', TRUE);
......
This diff is collapsed.
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