From 86708e4108ae8f822aa4a7d7344d2a1806994ce2 Mon Sep 17 00:00:00 2001 From: Alex <55833027+PubliAlex@users.noreply.github.com> Date: Thu, 1 Sep 2022 14:26:13 +0200 Subject: [PATCH 1/5] Compatibility with OCMS3 --- updates/version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updates/version.yaml b/updates/version.yaml index afe8626..32ebb81 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -42,7 +42,7 @@ 1.2.7: - Fix issue with undefined tools 1.3.0: - - !!! Added content editor own permissions and remove old permission handling that depended on system permissions + - Added content editor own permissions and remove old permission handling that depended on system permissions - Use separate route for rendering additional css - Fix discarding of CSS class when defined in file but saved via CMS - Use image path as relative path From 1465d27609cd82d024a2e6b648b3857af512c3f1 Mon Sep 17 00:00:00 2001 From: Alex <55833027+PubliAlex@users.noreply.github.com> Date: Tue, 3 Jan 2023 20:23:11 +0100 Subject: [PATCH 2/5] Update ContentEditor.php Add defer to JS script --- components/ContentEditor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ContentEditor.php b/components/ContentEditor.php index e0b91f2..64a6f08 100644 --- a/components/ContentEditor.php +++ b/components/ContentEditor.php @@ -74,8 +74,8 @@ public function onRun() // put content tools js + css $this->addCss('assets/content-tools.min.css'); $this->addCss('assets/contenteditor.css'); - $this->addJs('assets/content-tools.min.js'); - $this->addJs('assets/contenteditor.js'); + $this->addJs('assets/content-tools.min.js', ['defer' => true]); + $this->addJs('assets/contenteditor.js', ['defer' => true]); // Add scripts only once $this->renderPartial('@scripts.htm'); From 191113df7bb9ec1daee2d27ec228ba2823883c04 Mon Sep 17 00:00:00 2001 From: Alex <55833027+PubliAlex@users.noreply.github.com> Date: Tue, 3 Jan 2023 20:25:01 +0100 Subject: [PATCH 3/5] Update scripts.htm Make sure DOM is loaded before executing script --- components/contenteditor/scripts.htm | 40 +++++++++++++++------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/components/contenteditor/scripts.htm b/components/contenteditor/scripts.htm index 087dff8..f19f2f7 100644 --- a/components/contenteditor/scripts.htm +++ b/components/contenteditor/scripts.htm @@ -1,24 +1,26 @@ {% put scripts %} {% endput %} {% put styles %} From 4b4fb4044f655809ec5a90613b071a671a27b690 Mon Sep 17 00:00:00 2001 From: Alex <55833027+PubliAlex@users.noreply.github.com> Date: Wed, 4 Jan 2023 23:03:55 +0100 Subject: [PATCH 4/5] Update contenteditor.js Update to vanilla JS + october 3 javascript api --- assets/contenteditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/contenteditor.js b/assets/contenteditor.js index 0ea5ff1..1cb4eea 100644 --- a/assets/contenteditor.js +++ b/assets/contenteditor.js @@ -28,8 +28,8 @@ editor.addEventListener('saved', function (ev) { for (name in regions) { if (regions.hasOwnProperty(name)) { - var component = $('*[data-file="' + name + '"]').data('component'); // check for component name - $.request(component, { + var component = document.querySelector('*[data-file="' + name + '"]').dataset.component; // check for component name + oc.ajax(component, { data: { file: name, content: regions[name] From 22b5ae007801677335d38ad52133e822d1327747 Mon Sep 17 00:00:00 2001 From: Samuell Date: Fri, 15 Sep 2023 16:20:22 +0200 Subject: [PATCH 5/5] Update scripts.htm --- components/contenteditor/scripts.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/contenteditor/scripts.htm b/components/contenteditor/scripts.htm index f19f2f7..23cedda 100644 --- a/components/contenteditor/scripts.htm +++ b/components/contenteditor/scripts.htm @@ -1,7 +1,7 @@ {% put scripts %}