Skip to content
Snippets Groups Projects
Commit 667e63f2 authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[TASK] Move tinymce to a contrib directory

parent d8cb4ed9
No related branches found
No related tags found
No related merge requests found
Showing
with 23 additions and 7 deletions
...@@ -102,7 +102,7 @@ class Loader { ...@@ -102,7 +102,7 @@ class Loader {
} }
$languageFile = PATH_site . ExtensionManagementUtility::siteRelPath('tinymce') . $languageFile = PATH_site . ExtensionManagementUtility::siteRelPath('tinymce') .
'tinymce/langs/' . $languageKey . '.js'; 'Contrib/tinymce/langs/' . $languageKey . '.js';
if (!is_file($languageFile)) { if (!is_file($languageFile)) {
$languageKey = 'en'; $languageKey = 'en';
} }
...@@ -148,7 +148,7 @@ class Loader { ...@@ -148,7 +148,7 @@ class Loader {
/** /**
* Returns the needed javascript inclusion code * 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 * @param bool $loadConfigurationWithTimer
* @return string * @return string
...@@ -157,11 +157,18 @@ class Loader { ...@@ -157,11 +157,18 @@ class Loader {
$output = ''; $output = '';
if (!self::$init) { if (!self::$init) {
self::$init = TRUE; self::$init = TRUE;
$script = $GLOBALS['BACK_PATH'] . ExtensionManagementUtility::extRelPath('tinymce') . $pathToTinyMceExtension = ExtensionManagementUtility::extRelPath('tinymce');
'tinymce/tinymce.min.js';
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/tinymce/tinymce.min.js';
$output = '<script type="text/javascript" src="' . $script . '"></script>'; $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>'; $output .= '<script type="text/javascript" src="' . $script . '"></script>';
} }
...@@ -171,6 +178,8 @@ class Loader { ...@@ -171,6 +178,8 @@ class Loader {
/** /**
* Loads the required javascript via the given page renderer instance * Loads the required javascript via the given page renderer instance
* *
* Note: This function can only be called once.
*
* @param PageRenderer $pageRenderer * @param PageRenderer $pageRenderer
* @param bool $loadConfigurationWithTimer * @param bool $loadConfigurationWithTimer
* @return void * @return void
...@@ -181,8 +190,15 @@ class Loader { ...@@ -181,8 +190,15 @@ class Loader {
} }
self::$init = TRUE; self::$init = TRUE;
$script = $GLOBALS['BACK_PATH'] . ExtensionManagementUtility::extRelPath('tinymce') . 'tinymce/tinymce.min.js'; $pathToTinyMceExtension = ExtensionManagementUtility::extRelPath('tinymce');
$pageRenderer->addJsLibrary('tinymce', $script, 'text/javascript', FALSE, TRUE, '', TRUE); $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); $script = $this->getConfiguration($loadConfigurationWithTimer);
$pageRenderer->addJsFile($script, 'text/javascript', FALSE, TRUE, '', TRUE); $pageRenderer->addJsFile($script, 'text/javascript', FALSE, TRUE, '', TRUE);
......
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
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