Skip to content

Commit

Permalink
make sure divarea is always present in case another version of the ck…
Browse files Browse the repository at this point in the history
…editor is intalled
  • Loading branch information
gbisurgi committed May 8, 2020
1 parent cc2b8b4 commit a19c834
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/JsonEditorPluginsAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class JsonEditorPluginsAsset extends AssetBundle
public $js = [
'editors/filefly.js',
'editors/ckeditor.js',
'editors/ckplugins/divarea.js',
];

public $depends = [
Expand All @@ -29,4 +30,4 @@ class JsonEditorPluginsAsset extends AssetBundle
JqueryAsset::class
];

}
}
17 changes: 17 additions & 0 deletions src/assets/editors/ckplugins/divarea.js
Original file line number Diff line number Diff line change
@@ -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")
})
}
});

0 comments on commit a19c834

Please sign in to comment.