Skip to content

Commit

Permalink
Merge pull request #18 from germanbisurgi/master
Browse files Browse the repository at this point in the history
make sure divarea plugin is always present in case another version of the ckeditor is intalled
  • Loading branch information
schmunk42 authored May 8, 2020
2 parents cc2b8b4 + a19c834 commit dc270bf
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 dc270bf

Please sign in to comment.