From ac0eaa8a44ed4336c7405c737675cc8d5cb11252 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 20 Dec 2020 02:16:19 +0100 Subject: [PATCH] edit/head: ckeditor script url in data attribute --- edit/head.inc.php | 3 +-- edit/page.js | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/edit/head.inc.php b/edit/head.inc.php index a12c54b..76d9ea4 100644 --- a/edit/head.inc.php +++ b/edit/head.inc.php @@ -30,7 +30,6 @@ if (!file_exists(DOCROOT . $ckesrc)) { $ckesrc = '//cdn.ckeditor.com/4.15.1/full-all'; # remote fallback } ob_start(); -printf("\n", "$ckesrc/ckeditor.js"); -print ''."\n"; +printf(''."\n", "$ckesrc/ckeditor.js"); $Page->head = ob_get_clean(); diff --git a/edit/page.js b/edit/page.js index 7d20c65..1896c05 100644 --- a/edit/page.js +++ b/edit/page.js @@ -206,6 +206,7 @@ if (pagebody) { } +var ckesrc = document.currentScript.getAttribute('data-ckesrc'); document.addEventListener('DOMContentLoaded', function (e) { pagebody = editorcontents().cloneNode(true); var editorinc = document.createElement('script'); -- 2.30.0