X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/3bfd26bf86ebf2d325bbb90b2a2879aa5d33f95b..refs/pull/2257/head:/resources/js/components/wysiwyg-editor.js diff --git a/resources/js/components/wysiwyg-editor.js b/resources/js/components/wysiwyg-editor.js index 5e3ce8d96..a32e78161 100644 --- a/resources/js/components/wysiwyg-editor.js +++ b/resources/js/components/wysiwyg-editor.js @@ -401,6 +401,11 @@ function listenForBookStackEditorEvents(editor) { editor.setContent(content); }); + // Insert editor content at the current location + window.$events.listen('editor::insert', ({html}) => { + editor.insertContent(html); + }); + // Focus on the editor window.$events.listen('editor::focus', () => { editor.focus(); @@ -417,7 +422,7 @@ class WysiwygEditor { this.textDirection = this.$opts.textDirection; this.isDarkMode = document.documentElement.classList.contains('dark-mode'); - this.plugins = "image table textcolor paste link autolink fullscreen imagetools code customhr autosave lists codeeditor media"; + this.plugins = "image table textcolor paste link autolink fullscreen code customhr autosave lists codeeditor media"; this.loadPlugins(); this.tinyMceConfig = this.getTinyMceConfig(); @@ -638,6 +643,7 @@ class WysiwygEditor { }); + // Custom drop event handling editor.on('drop', function (event) { let dom = editor.dom, rng = tinymce.dom.RangeUtils.getCaretRangeFromPoint(event.clientX, event.clientY, editor.getDoc());