From de5f47d43eb68238b98c4e6a05c9635ea99fa1e0 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 10 Sep 2021 11:52:57 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03685=20-=20UIBlock=20resources:=20Add=20?= =?UTF-8?q?CKEditor=20resources=20to=20RichText?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Base/Component/Input/RichText/RichText.php | 9 +++++++++ sources/application/WebPage/iTopWebPage.php | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sources/application/UI/Base/Component/Input/RichText/RichText.php b/sources/application/UI/Base/Component/Input/RichText/RichText.php index a05c4e5b3..e8edcbdbc 100644 --- a/sources/application/UI/Base/Component/Input/RichText/RichText.php +++ b/sources/application/UI/Base/Component/Input/RichText/RichText.php @@ -18,6 +18,15 @@ class RichText extends UIBlock public const BLOCK_CODE = 'ibo-richtext'; public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/input/richtext/layout'; public const DEFAULT_JS_TEMPLATE_REL_PATH = 'base/components/input/richtext/layout'; + public const DEFAULT_JS_FILES_REL_PATH = [ + 'js/ckeditor/ckeditor.js', + 'js/ckeditor/adapters/jquery.js', + 'js/ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js', + ]; + public const DEFAULT_CSS_FILES_REL_PATH = [ + 'js/ckeditor/plugins/codesnippet/lib/highlight/styles/obsidian.css', + ]; + /** @var string */ protected $aConfig; diff --git a/sources/application/WebPage/iTopWebPage.php b/sources/application/WebPage/iTopWebPage.php index 758508de9..f2800b07b 100644 --- a/sources/application/WebPage/iTopWebPage.php +++ b/sources/application/WebPage/iTopWebPage.php @@ -38,8 +38,9 @@ class iTopWebPage extends NiceWebPage implements iTabbedPage /** @inheritDoc */ protected const COMPATIBILITY_LINKED_SCRIPTS_REL_PATH = [ // Moved files + // - TabContainer 'js/jquery.ba-bbq.min.js', - + // - DashletGroupBy & other specific places 'js/d3.js', 'js/c3.js', @@ -50,6 +51,8 @@ class iTopWebPage extends NiceWebPage implements iTabbedPage ]; /** @inheritDoc */ protected const COMPATIBILITY_LINKED_STYLESHEETS_REL_PATH = [ + // Moved files + // - DashletGroupBy & other specific places 'css/c3.min.css', ]; @@ -148,9 +151,12 @@ class iTopWebPage extends NiceWebPage implements iTabbedPage $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-ui-timepicker-addon.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-ui-timepicker-addon-i18n.min.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/utils.js'); + + // Note: CKEditor files can't be moved easily as we need to find a way to init the "disabler" plugin, {@see js/toolbox.js} $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/ckeditor/ckeditor.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/ckeditor/adapters/jquery.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js'); + $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/@popperjs/core/dist/umd/popper.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/tippy.js/dist/tippy-bundle.umd.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/property_field.js');