Skip to content

Commit dc270bf

Browse files
authored
Merge pull request #18 from germanbisurgi/master
make sure divarea plugin is always present in case another version of the ckeditor is intalled
2 parents cc2b8b4 + a19c834 commit dc270bf

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/JsonEditorPluginsAsset.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class JsonEditorPluginsAsset extends AssetBundle
2121
public $js = [
2222
'editors/filefly.js',
2323
'editors/ckeditor.js',
24+
'editors/ckplugins/divarea.js',
2425
];
2526

2627
public $depends = [
@@ -29,4 +30,4 @@ class JsonEditorPluginsAsset extends AssetBundle
2930
JqueryAsset::class
3031
];
3132

32-
}
33+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CKEDITOR.plugins.add("divarea", {
2+
afterInit: function(a) {
3+
a.addMode("wysiwyg", function(c) {
4+
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');
5+
a.ui.space("contents").append(b);
6+
b = a.editable(b);
7+
b.detach = CKEDITOR.tools.override(b.detach, function(a) {
8+
return function() {
9+
a.apply(this, arguments);
10+
this.remove()
11+
}
12+
});
13+
a.setData(a.getData(1), c);
14+
a.fire("contentDom")
15+
})
16+
}
17+
});

0 commit comments

Comments
 (0)