diff --git a/Controller.js b/Controller.js index 1b2b02f..0ae8b82 100644 --- a/Controller.js +++ b/Controller.js @@ -2,6 +2,8 @@ { "use strict"; + jsOMS.Autoloader.defineNamespace('jsOMS.Modules'); + jsOMS.Modules.Editor = function(app) { this.app = app; @@ -10,7 +12,7 @@ jsOMS.Modules.Editor.prototype.bind = function(id) { - const e = typeof id === 'undefined' ? document.getElementsByClassName('editor') : [document.getElementById(id)], + const e = typeof id === 'undefined' ? document.getElementsByClassName('m-editor') : [document.getElementById(id)], length = e.length; for(let i = 0; i < length; i++) { @@ -26,7 +28,7 @@ return; } - this.editors[editor.id] = new jsOMS.Modules.Editor.Editor(this.app); + this.editors[editor.id] = new jsOMS.Modules.Models.Editor.Editor(editor.id); this.editors[editor.id].bind(); }; }(window.jsOMS = window.jsOMS || {})); diff --git a/Controller.php b/Controller.php index a9d3093..5afd02b 100644 --- a/Controller.php +++ b/Controller.php @@ -93,8 +93,8 @@ class Controller extends ModuleAbstract implements WebInterface public function setUpEditorEditor(RequestAbstract $request, ResponseAbstract $response, $data = null) { $head = $response->get('Content')->getData('head'); - $head->addAsset(AssetType::JS, $request->getUri()->getBase() . 'Modules/Editor/Models/Editor.js'); - $head->addAsset(AssetType::JS, $request->getUri()->getBase() . 'Modules/Editor/Controller.js'); + $head->addAsset(AssetType::JSLATE, $request->getUri()->getBase() . 'Modules/Editor/Models/Editor.js'); + $head->addAsset(AssetType::JSLATE, $request->getUri()->getBase() . 'Modules/Editor/Controller.js'); } /** diff --git a/Models/Editor.js b/Models/Editor.js index 79a00ad..b3faf1f 100644 --- a/Models/Editor.js +++ b/Models/Editor.js @@ -2,12 +2,14 @@ { "use strict"; - jsOMS.Modules.Editor.Editor = function (editor) + jsOMS.Autoloader.defineNamespace('jsOMS.Modules.Models.Editor'); + + jsOMS.Modules.Models.Editor.Editor = function (id) { - this.editor = editor; + this.editor = document.getElementById(id); }; - jsOMS.Modules.Editor.prototype.bind = function() + jsOMS.Modules.Models.Editor.Editor.prototype.bind = function() { const editorButtons = this.editor.getElementsByClassName('editor-button'), editorTitle = this.editor.getElementsByClassName('editor-title')[0], @@ -24,7 +26,7 @@ } }; - jsOMS.Modules.Editor.prototype.getSelectedText = function() + jsOMS.Modules.Models.Editor.Editor.prototype.getSelectedText = function() { var text = ''; var activeEl = document.activeElement; diff --git a/Theme/Backend/editor.tpl.php b/Theme/Backend/editor.tpl.php index 6092476..5a4b63f 100644 --- a/Theme/Backend/editor.tpl.php +++ b/Theme/Backend/editor.tpl.php @@ -17,18 +17,20 @@ $doc = $this->getData('doc') ?? null; ?> -
-
- -
-
+
+
+
+ +
+
-
-
- -
-
+
+
+ +
+
-
- +
+ +
\ No newline at end of file diff --git a/Theme/Backend/inline-editor-tools.tpl.php b/Theme/Backend/inline-editor-tools.tpl.php index 86b9785..760891d 100644 --- a/Theme/Backend/inline-editor-tools.tpl.php +++ b/Theme/Backend/inline-editor-tools.tpl.php @@ -1,40 +1,40 @@
\ No newline at end of file