diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/Controller/BaseController.php | 22 | ||||
| -rw-r--r-- | app/Module/CkeditorModule.php | 29 |
2 files changed, 0 insertions, 51 deletions
diff --git a/app/Controller/BaseController.php b/app/Controller/BaseController.php index 8f1d973838..3b5d9aa3d4 100644 --- a/app/Controller/BaseController.php +++ b/app/Controller/BaseController.php @@ -33,9 +33,6 @@ class BaseController { self::JS_PRIORITY_LOW => [], ]; - /** @var string[] Exteral JavaScript files to load. */ - private $external_javascript = []; - /** @var Tree Create a page for which tree */ private $tree; @@ -58,19 +55,6 @@ class BaseController { } /** - * Make a list of external Javascript, so we can render them in the footer - * - * @param string $script_name - * - * @return $this - */ - public function addExternalJavascript($script_name) { - $this->external_javascript[$script_name] = true; - - return $this; - } - - /** * Make a list of inline Javascript, so we can render them in the footer * NOTE: there is no need to use "$(document).ready(function(){...})", etc. * as this Javascript won’t be inserted until the very end of the page. @@ -103,11 +87,6 @@ class BaseController { $javascript1 .= $script; } - // External javascript - foreach (array_keys($this->external_javascript) as $script_name) { - $javascript2 .= '<script src="' . $script_name . '"></script>'; - } - // Inline (lower priority) javascript foreach ($this->inline_javascript as $priority => $scripts) { if ($priority !== self::JS_PRIORITY_HIGH) { @@ -123,7 +102,6 @@ class BaseController { self::JS_PRIORITY_NORMAL => [], self::JS_PRIORITY_LOW => [], ]; - $this->external_javascript = []; return '<script>' . $javascript1 . '</script>' . $javascript2 . '<script>' . $javascript3 . '</script>'; } diff --git a/app/Module/CkeditorModule.php b/app/Module/CkeditorModule.php index e819f203c2..14287a8c7c 100644 --- a/app/Module/CkeditorModule.php +++ b/app/Module/CkeditorModule.php @@ -31,33 +31,4 @@ class CkeditorModule extends AbstractModule { public function getDescription() { return /* I18N: Description of the “CKEditor” module. WYSIWYG = “what you see is what you get” */ I18N::translate('Allow other modules to edit text using a “WYSIWYG” editor, instead of using HTML codes.'); } - - /** - * Convert <textarea class="html-edit"> fields to CKEditor fields - * - * This function needs to be called *after* we have sent the page header and - * before we have sent the page footer. - * - * @param BaseController $controller - */ - public static function enableEditor($controller) { - $controller - ->addExternalJavascript(WT_CKEDITOR_BASE_URL . 'ckeditor.js') - ->addExternalJavascript(WT_CKEDITOR_BASE_URL . 'adapters/jquery.js') - // Need to specify the path before we load the libary - ->addInlineJavascript( - 'var CKEDITOR_BASEPATH="' . WT_CKEDITOR_BASE_URL . '";', - BaseController::JS_PRIORITY_HIGH - ) - // Enable for all browsers - ->addInlineJavascript('CKEDITOR.env.isCompatible = true;') - // Disable toolbars - ->addInlineJavascript('CKEDITOR.config.removePlugins = "forms,newpage,preview,print,save,templates";') - ->addInlineJavascript('CKEDITOR.config.extraAllowedContent = - "area[shape,coords,href,target,alt,title];map[name];img[usemap];*[class,style]";') - // Activate the editor - ->addInlineJavascript('$(".html-edit").ckeditor(function(config){config.removePlugins = "forms";}, { - language: "' . strtolower(WT_LOCALE) . '" - });'); - } } |
