diff --git a/src/JsonEditorPluginsAsset.php b/src/JsonEditorPluginsAsset.php index bd7a132..17a651b 100755 --- a/src/JsonEditorPluginsAsset.php +++ b/src/JsonEditorPluginsAsset.php @@ -21,6 +21,7 @@ class JsonEditorPluginsAsset extends AssetBundle public $js = [ 'editors/filefly.js', 'editors/ckeditor.js', + 'editors/ckplugins/divarea.js', ]; public $depends = [ @@ -29,4 +30,4 @@ class JsonEditorPluginsAsset extends AssetBundle JqueryAsset::class ]; -} \ No newline at end of file +} diff --git a/src/assets/editors/ckplugins/divarea.js b/src/assets/editors/ckplugins/divarea.js new file mode 100644 index 0000000..5bbe1dc --- /dev/null +++ b/src/assets/editors/ckplugins/divarea.js @@ -0,0 +1,17 @@ +CKEDITOR.plugins.add("divarea", { + afterInit: function(a) { + a.addMode("wysiwyg", function(c) { + var b = CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_wysiwyg_div cke_reset cke_enable_context_menu" hidefocus\x3d"true"\x3e\x3c/div\x3e'); + a.ui.space("contents").append(b); + b = a.editable(b); + b.detach = CKEDITOR.tools.override(b.detach, function(a) { + return function() { + a.apply(this, arguments); + this.remove() + } + }); + a.setData(a.getData(1), c); + a.fire("contentDom") + }) + } +});