@themarioga/grid-editor 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTO_SAVE.md +2 -2
- package/BUILDING.md +45 -29
- package/CHANGELOG.md +47 -0
- package/README.md +137 -85
- package/UPGRADING.md +119 -0
- package/dist/grideditor.bundle.min.js +14 -0
- package/dist/grideditor.d.ts +335 -0
- package/dist/grideditor.esm.js +3977 -0
- package/dist/grideditor.jquery.js +253 -0
- package/dist/grideditor.jquery.min.js +1 -0
- package/dist/grideditor.jquery.min.js.map +7 -0
- package/dist/grideditor.js +3983 -0
- package/dist/grideditor.min.js +6 -0
- package/dist/grideditor.min.js.map +7 -0
- package/dist/locales/grideditor.es.esm.js +158 -0
- package/dist/locales/grideditor.es.js +164 -168
- package/dist/locales/grideditor.es.min.js +6 -2
- package/dist/locales/grideditor.es.min.js.map +7 -1
- package/dist/plugins/grideditor.accordion.esm.js +294 -0
- package/dist/plugins/grideditor.accordion.js +286 -180
- package/dist/plugins/grideditor.accordion.min.js +1 -2
- package/dist/plugins/grideditor.accordion.min.js.map +7 -1
- package/dist/plugins/grideditor.alignment.esm.js +55 -0
- package/dist/plugins/grideditor.alignment.js +58 -77
- package/dist/plugins/grideditor.alignment.min.js +1 -2
- package/dist/plugins/grideditor.alignment.min.js.map +7 -1
- package/dist/plugins/grideditor.card.esm.js +73 -0
- package/dist/plugins/grideditor.card.js +74 -64
- package/dist/plugins/grideditor.card.min.js +1 -2
- package/dist/plugins/grideditor.card.min.js.map +7 -1
- package/dist/plugins/grideditor.ckeditor.esm.js +500 -0
- package/dist/plugins/grideditor.ckeditor.js +484 -449
- package/dist/plugins/grideditor.ckeditor.min.js +1 -2
- package/dist/plugins/grideditor.ckeditor.min.js.map +7 -1
- package/dist/plugins/grideditor.clipboard.esm.js +326 -0
- package/dist/plugins/grideditor.clipboard.js +298 -235
- package/dist/plugins/grideditor.clipboard.min.js +1 -2
- package/dist/plugins/grideditor.clipboard.min.js.map +7 -1
- package/dist/plugins/grideditor.codemirror-inline.esm.js +205 -0
- package/dist/plugins/grideditor.codemirror-inline.js +188 -168
- package/dist/plugins/grideditor.codemirror-inline.min.js +1 -2
- package/dist/plugins/grideditor.codemirror-inline.min.js.map +7 -1
- package/dist/plugins/grideditor.codemirror.esm.js +63 -0
- package/dist/plugins/grideditor.codemirror.js +60 -71
- package/dist/plugins/grideditor.codemirror.min.js +1 -2
- package/dist/plugins/grideditor.codemirror.min.js.map +7 -1
- package/dist/plugins/grideditor.elements.esm.js +271 -0
- package/dist/plugins/grideditor.elements.js +256 -149
- package/dist/plugins/grideditor.elements.min.js +1 -2
- package/dist/plugins/grideditor.elements.min.js.map +7 -1
- package/dist/plugins/grideditor.float.esm.js +34 -0
- package/dist/plugins/grideditor.float.js +37 -52
- package/dist/plugins/grideditor.float.min.js +1 -2
- package/dist/plugins/grideditor.float.min.js.map +7 -1
- package/dist/plugins/grideditor.gutters.esm.js +143 -0
- package/dist/plugins/grideditor.gutters.js +134 -131
- package/dist/plugins/grideditor.gutters.min.js +1 -2
- package/dist/plugins/grideditor.gutters.min.js.map +7 -1
- package/dist/plugins/grideditor.order.esm.js +189 -0
- package/dist/plugins/grideditor.order.js +170 -182
- package/dist/plugins/grideditor.order.min.js +1 -2
- package/dist/plugins/grideditor.order.min.js.map +7 -1
- package/dist/plugins/grideditor.popup.esm.js +187 -0
- package/dist/plugins/grideditor.popup.js +183 -134
- package/dist/plugins/grideditor.popup.min.js +1 -2
- package/dist/plugins/grideditor.popup.min.js.map +7 -1
- package/dist/plugins/grideditor.sections.esm.js +271 -0
- package/dist/plugins/grideditor.sections.js +250 -173
- package/dist/plugins/grideditor.sections.min.js +1 -2
- package/dist/plugins/grideditor.sections.min.js.map +7 -1
- package/dist/plugins/grideditor.spacing.esm.js +318 -0
- package/dist/plugins/grideditor.spacing.js +296 -272
- package/dist/plugins/grideditor.spacing.min.js +1 -2
- package/dist/plugins/grideditor.spacing.min.js.map +7 -1
- package/dist/plugins/grideditor.summernote.esm.js +509 -0
- package/dist/plugins/grideditor.summernote.js +493 -427
- package/dist/plugins/grideditor.summernote.min.js +1 -2
- package/dist/plugins/grideditor.summernote.min.js.map +7 -1
- package/dist/plugins/grideditor.tabs.esm.js +237 -0
- package/dist/plugins/grideditor.tabs.js +233 -139
- package/dist/plugins/grideditor.tabs.min.js +1 -2
- package/dist/plugins/grideditor.tabs.min.js.map +7 -1
- package/dist/plugins/grideditor.textalign.esm.js +40 -0
- package/dist/plugins/grideditor.textalign.js +43 -56
- package/dist/plugins/grideditor.textalign.min.js +1 -2
- package/dist/plugins/grideditor.textalign.min.js.map +7 -1
- package/dist/plugins/grideditor.tinymce.esm.js +519 -0
- package/dist/plugins/grideditor.tinymce.js +502 -490
- package/dist/plugins/grideditor.tinymce.min.js +1 -2
- package/dist/plugins/grideditor.tinymce.min.js.map +7 -1
- package/dist/plugins/grideditor.visibility.esm.js +158 -0
- package/dist/plugins/grideditor.visibility.js +140 -149
- package/dist/plugins/grideditor.visibility.min.js +1 -2
- package/dist/plugins/grideditor.visibility.min.js.map +7 -1
- package/docs/events.md +47 -21
- package/docs/locale-keys.md +6 -0
- package/docs/plugins.md +47 -25
- package/example/adapter.html +112 -0
- package/example/attributes.html +85 -61
- package/example/autocols.html +9 -9
- package/example/autosave.html +13 -14
- package/example/basic.html +4 -5
- package/example/breakpoints.html +5 -6
- package/example/ckeditor.html +4 -5
- package/example/clipboard.html +11 -10
- package/example/codemirror.html +9 -7
- package/example/containers.html +7 -8
- package/example/custom_editor.html +53 -34
- package/example/elements.html +10 -11
- package/example/index.html +16 -2
- package/example/locale.html +6 -7
- package/example/plugins.html +44 -29
- package/example/summernote.html +6 -5
- package/example/utilities.html +17 -13
- package/example/wrap_content.html +9 -9
- package/package.json +43 -12
- package/src/js/dom.js +401 -0
- package/src/js/grideditor.classic.js +16 -0
- package/src/js/grideditor.jquery.js +325 -0
- package/src/js/{jquery.grideditor.js → grideditor.js} +1284 -1124
- package/src/js/locales/grideditor.es.js +163 -156
- package/src/js/plugins/grideditor.accordion.js +97 -77
- package/src/js/plugins/grideditor.alignment.js +5 -7
- package/src/js/plugins/grideditor.card.js +23 -23
- package/src/js/plugins/grideditor.ckeditor.js +107 -106
- package/src/js/plugins/grideditor.clipboard.js +49 -37
- package/src/js/plugins/grideditor.codemirror-inline.js +50 -37
- package/src/js/plugins/grideditor.codemirror.js +9 -10
- package/src/js/plugins/grideditor.elements.js +57 -33
- package/src/js/plugins/grideditor.float.js +4 -6
- package/src/js/plugins/grideditor.gutters.js +20 -15
- package/src/js/plugins/grideditor.order.js +28 -25
- package/src/js/plugins/grideditor.popup.js +63 -51
- package/src/js/plugins/grideditor.sections.js +39 -32
- package/src/js/plugins/grideditor.spacing.js +42 -45
- package/src/js/plugins/grideditor.summernote.js +112 -76
- package/src/js/plugins/grideditor.tabs.js +65 -57
- package/src/js/plugins/grideditor.textalign.js +4 -6
- package/src/js/plugins/grideditor.tinymce.js +147 -139
- package/src/js/plugins/grideditor.visibility.js +24 -25
- package/src/js/register.js +18 -0
- package/src/js/text/grideditor.text.js +77 -56
- package/types/grideditor.d.ts +335 -0
- package/dist/jquery.grideditor.bundle.min.js +0 -10
- package/dist/jquery.grideditor.js +0 -4927
- package/dist/jquery.grideditor.min.js +0 -2
- package/dist/jquery.grideditor.min.js.map +0 -1
|
@@ -1,469 +1,504 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* of its own, as example/custom_editor.html shows.
|
|
19
|
-
*/
|
|
20
|
-
(function($) {
|
|
21
|
-
|
|
22
|
-
if ($.fn.gridEditor.features.text) { return; }
|
|
23
|
-
|
|
24
|
-
$.extend($.fn.gridEditor.locales.en, {
|
|
25
|
-
'text.add': 'Text',
|
|
26
|
-
'text.add_type': 'Text ({editor})',
|
|
27
|
-
'panel.editor': 'Editor',
|
|
28
|
-
'panel.kind_text': 'Text',
|
|
1
|
+
(() => {
|
|
2
|
+
// src/js/register.js
|
|
3
|
+
var GridEditor = window.GridEditor;
|
|
4
|
+
if (!GridEditor || typeof GridEditor.get !== "function") {
|
|
5
|
+
throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// src/js/dom.js
|
|
9
|
+
function all(root, selector) {
|
|
10
|
+
return root ? Array.prototype.slice.call(root.querySelectorAll(selector)) : [];
|
|
11
|
+
}
|
|
12
|
+
function children(node, selector) {
|
|
13
|
+
if (!node) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
return Array.prototype.filter.call(node.children, function(each) {
|
|
17
|
+
return !selector || each.matches(selector);
|
|
29
18
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
function attributesOf(element) {
|
|
39
|
-
var found = {};
|
|
40
|
-
$.each($.makeArray(element.attributes), function(i, attribute) {
|
|
41
|
-
found[attribute.name] = attribute.value;
|
|
42
|
-
});
|
|
43
|
-
return found;
|
|
19
|
+
}
|
|
20
|
+
function child(node, selector) {
|
|
21
|
+
return children(node, selector)[0] || null;
|
|
22
|
+
}
|
|
23
|
+
function closest(node, selector, stopAt) {
|
|
24
|
+
var found = node && node.nodeType === 1 ? node.closest(selector) : null;
|
|
25
|
+
if (found && stopAt && found !== stopAt && !stopAt.contains(found)) {
|
|
26
|
+
return null;
|
|
44
27
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
28
|
+
return found;
|
|
29
|
+
}
|
|
30
|
+
function element(tag, attributes, text) {
|
|
31
|
+
var node = document.createElement(tag);
|
|
32
|
+
Object.keys(attributes || {}).forEach(function(name) {
|
|
33
|
+
var value = attributes[name];
|
|
34
|
+
if (value !== null && value !== void 0 && value !== false) {
|
|
35
|
+
node.setAttribute(name, value);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
if (text !== void 0 && text !== null) {
|
|
39
|
+
node.textContent = text;
|
|
50
40
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
41
|
+
return node;
|
|
42
|
+
}
|
|
43
|
+
function setHtml(node, html) {
|
|
44
|
+
node.innerHTML = html === void 0 || html === null ? "" : String(html);
|
|
45
|
+
return node;
|
|
46
|
+
}
|
|
47
|
+
function addClass(node, names) {
|
|
48
|
+
split(names).forEach(function(name) {
|
|
49
|
+
node.classList.add(name);
|
|
50
|
+
});
|
|
51
|
+
return node;
|
|
52
|
+
}
|
|
53
|
+
function removeClass(node, names) {
|
|
54
|
+
split(names).forEach(function(name) {
|
|
55
|
+
node.classList.remove(name);
|
|
56
|
+
});
|
|
57
|
+
return node;
|
|
58
|
+
}
|
|
59
|
+
function hasClass(node, name) {
|
|
60
|
+
return !!node && node.nodeType === 1 && node.classList.contains(name);
|
|
61
|
+
}
|
|
62
|
+
function split(names) {
|
|
63
|
+
return String(names || "").split(/\s+/).filter(Boolean);
|
|
64
|
+
}
|
|
65
|
+
function hide(node) {
|
|
66
|
+
node.style.display = "none";
|
|
67
|
+
return node;
|
|
68
|
+
}
|
|
69
|
+
function visible(node) {
|
|
70
|
+
return !!(node.offsetWidth || node.offsetHeight || node.getClientRects().length);
|
|
71
|
+
}
|
|
72
|
+
function delegate(root, types, selector, handler, options) {
|
|
73
|
+
var listener = function(event) {
|
|
74
|
+
var match = closest(event.target, selector, root);
|
|
75
|
+
if (match && root.contains(match)) {
|
|
76
|
+
return handler.call(match, event);
|
|
77
|
+
}
|
|
78
|
+
return void 0;
|
|
79
|
+
};
|
|
80
|
+
split(types).forEach(function(type) {
|
|
81
|
+
root.addEventListener(type, listener, options);
|
|
82
|
+
});
|
|
83
|
+
return listener;
|
|
84
|
+
}
|
|
85
|
+
var DEFAULT_DURATION = 400;
|
|
86
|
+
function animateAway(node, frames, duration, done) {
|
|
87
|
+
duration = duration === void 0 ? DEFAULT_DURATION : duration;
|
|
88
|
+
var finish = function() {
|
|
89
|
+
hide(node);
|
|
90
|
+
if (done) {
|
|
91
|
+
done();
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
if (!visible(node) || !node.animate || duration <= 0) {
|
|
95
|
+
window.setTimeout(finish, 0);
|
|
96
|
+
return;
|
|
81
97
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
var animation = node.animate(frames(getComputedStyle(node)), {
|
|
99
|
+
duration,
|
|
100
|
+
easing: "ease-in-out"
|
|
101
|
+
});
|
|
102
|
+
var called = false;
|
|
103
|
+
var once = function() {
|
|
104
|
+
if (called) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
called = true;
|
|
108
|
+
finish();
|
|
109
|
+
};
|
|
110
|
+
animation.onfinish = once;
|
|
111
|
+
animation.oncancel = once;
|
|
112
|
+
}
|
|
113
|
+
function slideUp(node, duration, done) {
|
|
114
|
+
if (typeof duration === "function") {
|
|
115
|
+
done = duration;
|
|
116
|
+
duration = void 0;
|
|
117
|
+
}
|
|
118
|
+
node.style.overflow = "hidden";
|
|
119
|
+
animateAway(node, function(style) {
|
|
120
|
+
return [
|
|
121
|
+
{
|
|
122
|
+
height: style.height,
|
|
123
|
+
paddingTop: style.paddingTop,
|
|
124
|
+
paddingBottom: style.paddingBottom,
|
|
125
|
+
marginTop: style.marginTop,
|
|
126
|
+
marginBottom: style.marginBottom
|
|
127
|
+
},
|
|
128
|
+
{ height: "0px", paddingTop: "0px", paddingBottom: "0px", marginTop: "0px", marginBottom: "0px" }
|
|
129
|
+
];
|
|
130
|
+
}, duration, function() {
|
|
131
|
+
node.style.removeProperty("overflow");
|
|
132
|
+
if (done) {
|
|
133
|
+
done();
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// src/js/text/grideditor.text.js
|
|
139
|
+
if (!GridEditor.features.text) {
|
|
140
|
+
let attributesOf = function(element2) {
|
|
141
|
+
var found = {};
|
|
142
|
+
Array.prototype.slice.call(element2.attributes).forEach(function(attribute) {
|
|
143
|
+
found[attribute.name] = attribute.value;
|
|
144
|
+
});
|
|
145
|
+
return found;
|
|
146
|
+
}, classesIn = function(value) {
|
|
147
|
+
return (value || "").split(/\s+/).filter(function(name) {
|
|
148
|
+
return name !== "" && !EDITOR_CLASS.test(name);
|
|
149
|
+
});
|
|
150
|
+
}, restoreAttributes = function(block, before, ready, open) {
|
|
151
|
+
var result = Object.assign({}, before);
|
|
152
|
+
Object.keys(Object.assign({}, ready, open)).forEach(function(name) {
|
|
153
|
+
if (name === "class" || EDITOR_ATTRIBUTE.test(name) || ready[name] === open[name]) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (open[name] === void 0) {
|
|
157
|
+
delete result[name];
|
|
158
|
+
} else {
|
|
159
|
+
result[name] = open[name];
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
var readyClasses = classesIn(ready["class"]);
|
|
163
|
+
var openClasses = classesIn(open["class"]);
|
|
164
|
+
var classes = classesIn(before["class"]).filter(function(name) {
|
|
165
|
+
return openClasses.indexOf(name) !== -1 || readyClasses.indexOf(name) === -1;
|
|
166
|
+
});
|
|
167
|
+
openClasses.forEach(function(name) {
|
|
168
|
+
if (readyClasses.indexOf(name) === -1 && classes.indexOf(name) === -1) {
|
|
169
|
+
classes.push(name);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
if (classes.length) {
|
|
173
|
+
result["class"] = classes.join(" ");
|
|
174
|
+
} else {
|
|
175
|
+
delete result["class"];
|
|
176
|
+
}
|
|
177
|
+
Object.keys(attributesOf(block)).forEach(function(name) {
|
|
178
|
+
block.removeAttribute(name);
|
|
179
|
+
});
|
|
180
|
+
Object.keys(result).forEach(function(name) {
|
|
181
|
+
block.setAttribute(name, result[name]);
|
|
182
|
+
});
|
|
183
|
+
}, textFeature = function(ge) {
|
|
184
|
+
var settings = ge.settings;
|
|
185
|
+
var TEXTS = {};
|
|
186
|
+
var warned = {};
|
|
187
|
+
Object.keys(GridEditor.texts).forEach(function(type) {
|
|
188
|
+
TEXTS[type] = GridEditor.texts[type](ge);
|
|
189
|
+
});
|
|
190
|
+
if (!Array.isArray(settings.content_types)) {
|
|
191
|
+
settings.content_types = Object.keys(TEXTS);
|
|
192
|
+
}
|
|
193
|
+
if (!Array.isArray(settings.text_tools)) {
|
|
194
|
+
settings.text_tools = [];
|
|
195
|
+
}
|
|
196
|
+
if (!Array.isArray(settings.text_classes)) {
|
|
197
|
+
settings.text_classes = [];
|
|
198
|
+
}
|
|
199
|
+
function offeredTexts() {
|
|
200
|
+
return settings.content_types.filter(function(type) {
|
|
201
|
+
return !!TEXTS[type];
|
|
91
202
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
203
|
+
}
|
|
204
|
+
function textLabel(type) {
|
|
205
|
+
var text = TEXTS[type];
|
|
206
|
+
return text && text.labelKey ? ge.t(text.labelKey) : type;
|
|
207
|
+
}
|
|
208
|
+
function makeText(type, content) {
|
|
209
|
+
var text = TEXTS[type];
|
|
210
|
+
var block = element("div", {
|
|
211
|
+
"class": "ge-content ge-content-type-" + type,
|
|
212
|
+
"data-ge-content-type": type
|
|
213
|
+
});
|
|
214
|
+
if (content && content.nodeType) {
|
|
215
|
+
block.appendChild(content);
|
|
216
|
+
} else {
|
|
217
|
+
setHtml(block, content !== void 0 ? content : text && text.initialContent || "");
|
|
102
218
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
219
|
+
return block;
|
|
220
|
+
}
|
|
221
|
+
function apiCreateText(type, options) {
|
|
222
|
+
if (type && typeof type === "object") {
|
|
223
|
+
options = type;
|
|
224
|
+
type = void 0;
|
|
108
225
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
.html(content !== undefined ? content : (text && text.initialContent) || '');
|
|
226
|
+
options = options || {};
|
|
227
|
+
type = type || offeredTexts()[0];
|
|
228
|
+
if (!type || !TEXTS[type]) {
|
|
229
|
+
if (!warned["createText:" + type]) {
|
|
230
|
+
warned["createText:" + type] = true;
|
|
231
|
+
ge.warn('createText: no text editor "' + type + '" is loaded; load its plugin and name it in content_types');
|
|
232
|
+
}
|
|
233
|
+
return null;
|
|
118
234
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
options = type;
|
|
128
|
-
type = undefined;
|
|
129
|
-
}
|
|
130
|
-
options = options || {};
|
|
131
|
-
type = type || offeredTexts()[0];
|
|
132
|
-
|
|
133
|
-
if (!type || !TEXTS[type]) {
|
|
134
|
-
if (!warned['createText:' + type]) {
|
|
135
|
-
warned['createText:' + type] = true;
|
|
136
|
-
ge.warn('createText: no text editor "' + type + '" is loaded; ' +
|
|
137
|
-
'load its plugin and name it in content_types');
|
|
138
|
-
}
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return ge.place(makeText(type, options.content), 'text', options);
|
|
235
|
+
return ge.place(makeText(type, options.content), "text", options);
|
|
236
|
+
}
|
|
237
|
+
function isOurs(block) {
|
|
238
|
+
return !!TEXTS[block.getAttribute("data-ge-content-type")];
|
|
239
|
+
}
|
|
240
|
+
function startText(block) {
|
|
241
|
+
if (hasClass(block, "ge-rte-active")) {
|
|
242
|
+
return;
|
|
143
243
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
function isOurs(block) {
|
|
147
|
-
return !!TEXTS[block.attr('data-ge-content-type')];
|
|
244
|
+
if (!visible(block)) {
|
|
245
|
+
return;
|
|
148
246
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (block.hasClass('ge-rte-active')) { return; }
|
|
153
|
-
|
|
154
|
-
// A content area nobody can see - a tab that is not the open one,
|
|
155
|
-
// a closed accordion item - has no geometry for an editor to lay
|
|
156
|
-
// its toolbar out against, and nothing anyone can type into
|
|
157
|
-
if (!block.is(':visible')) { return; }
|
|
158
|
-
|
|
159
|
-
// The attribute, not jQuery's cached copy of it: it is markup, and
|
|
160
|
-
// the drawer reads it the same way
|
|
161
|
-
var text = TEXTS[block.attr('data-ge-content-type')];
|
|
162
|
-
if (!text) { return; }
|
|
163
|
-
|
|
164
|
-
// Not marked active, so the next click tries again: the library
|
|
165
|
-
// may be loaded by then
|
|
166
|
-
if (text.available && !text.available()) {
|
|
167
|
-
if (text.missingKey) { console.error(ge.t(text.missingKey)); }
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
block.data('ge-text-before', attributesOf(block[0])).removeData('ge-text-ready');
|
|
172
|
-
block.addClass('ge-rte-active');
|
|
173
|
-
text.start(block);
|
|
247
|
+
var text = TEXTS[block.getAttribute("data-ge-content-type")];
|
|
248
|
+
if (!text) {
|
|
249
|
+
return;
|
|
174
250
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
251
|
+
if (text.available && !text.available()) {
|
|
252
|
+
if (text.missingKey) {
|
|
253
|
+
console.error(ge.t(text.missingKey));
|
|
254
|
+
}
|
|
255
|
+
return;
|
|
178
256
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
*/
|
|
194
|
-
function closeText(block) {
|
|
195
|
-
var text = TEXTS[block.attr('data-ge-content-type')];
|
|
196
|
-
var before = block.data('ge-text-before');
|
|
197
|
-
var open = before ? attributesOf(block[0]) : null;
|
|
198
|
-
|
|
199
|
-
// Every content area is told, as in 5.x: one whose editor never
|
|
200
|
-
// started is the plugin's to ignore
|
|
201
|
-
if (text) { text.stop(block); }
|
|
202
|
-
|
|
203
|
-
// After stop, not before: an editor that restores the class
|
|
204
|
-
// attribute it snapshotted would put ge-rte-active back
|
|
205
|
-
block.removeClass('ge-rte-active');
|
|
206
|
-
|
|
207
|
-
if (before) {
|
|
208
|
-
restoreAttributes(block, before, block.data('ge-text-ready') || before, open);
|
|
209
|
-
block.removeData('ge-text-before').removeData('ge-text-ready');
|
|
210
|
-
}
|
|
257
|
+
readBefore.set(block, attributesOf(block));
|
|
258
|
+
readReady.delete(block);
|
|
259
|
+
addClass(block, "ge-rte-active");
|
|
260
|
+
text.start([block]);
|
|
261
|
+
}
|
|
262
|
+
function onClick() {
|
|
263
|
+
startText(this);
|
|
264
|
+
}
|
|
265
|
+
function closeText(block) {
|
|
266
|
+
var text = TEXTS[block.getAttribute("data-ge-content-type")];
|
|
267
|
+
var before = readBefore.get(block);
|
|
268
|
+
var open = before ? attributesOf(block) : null;
|
|
269
|
+
if (text) {
|
|
270
|
+
text.stop([block]);
|
|
211
271
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
ge.createMoveTool(drawer);
|
|
219
|
-
|
|
220
|
-
var details = ge.addSettingsTool(drawer, block, settings.text_classes);
|
|
221
|
-
|
|
222
|
-
// Which editor edits it, first in its settings: something to
|
|
223
|
-
// know about it, not something to do with it
|
|
224
|
-
$('<div class="ge-field ge-text-editor" />')
|
|
225
|
-
.append($('<span class="ge-field-label" />').text(ge.t('panel.editor')))
|
|
226
|
-
.append($('<span class="ge-field-value" />').text(textLabel(type)))
|
|
227
|
-
.prependTo(details.children('.ge-details-general'));
|
|
228
|
-
|
|
229
|
-
settings.text_tools.forEach(function(hostTool) {
|
|
230
|
-
ge.createTool(drawer, hostTool.title || '', hostTool.className || '',
|
|
231
|
-
hostTool.iconClass || 'bi bi-wrench', hostTool.on);
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
ge.createTool(drawer, ge.t('tool.delete_text'), 'ge-delete-text', 'bi bi-trash', function() {
|
|
235
|
-
ge.deleteNode('text', block, ge.t('confirm.delete_text'), function(removed) {
|
|
236
|
-
// Its editor lets go first: removed while open, it would
|
|
237
|
-
// be left behind, attached to nothing
|
|
238
|
-
closeText(block);
|
|
239
|
-
textBlock.slideUp(function() {
|
|
240
|
-
textBlock.remove();
|
|
241
|
-
removed();
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
});
|
|
272
|
+
removeClass(block, "ge-rte-active");
|
|
273
|
+
if (before) {
|
|
274
|
+
restoreAttributes(block, before, readReady.get(block) || before, open);
|
|
275
|
+
readBefore.delete(block);
|
|
276
|
+
readReady.delete(block);
|
|
245
277
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
278
|
+
}
|
|
279
|
+
function createTextControls(textBlock) {
|
|
280
|
+
var block = child(textBlock, ".ge-content");
|
|
281
|
+
var type = block.getAttribute("data-ge-content-type");
|
|
282
|
+
var drawer = element("div", { "class": "ge-tools-drawer ge-text-drawer" });
|
|
283
|
+
textBlock.insertBefore(drawer, textBlock.firstChild);
|
|
284
|
+
ge.createMoveTool(drawer);
|
|
285
|
+
var details = ge.addSettingsTool(drawer, block, settings.text_classes);
|
|
286
|
+
var general = child(details, ".ge-details-general");
|
|
287
|
+
var editor = element("div", { "class": "ge-field ge-text-editor" });
|
|
288
|
+
editor.appendChild(element("span", { "class": "ge-field-label" }, ge.t("panel.editor")));
|
|
289
|
+
editor.appendChild(element("span", { "class": "ge-field-value" }, textLabel(type)));
|
|
290
|
+
general.insertBefore(editor, general.firstChild);
|
|
291
|
+
settings.text_tools.forEach(function(hostTool) {
|
|
292
|
+
ge.createTool(
|
|
293
|
+
drawer,
|
|
294
|
+
hostTool.title || "",
|
|
295
|
+
hostTool.className || "",
|
|
296
|
+
hostTool.iconClass || "bi bi-wrench",
|
|
297
|
+
hostTool.on
|
|
298
|
+
);
|
|
299
|
+
});
|
|
300
|
+
ge.createTool(drawer, ge.t("tool.delete_text"), "ge-delete-text", "bi bi-trash", function() {
|
|
301
|
+
ge.deleteNode("text", block, ge.t("confirm.delete_text"), function(removed) {
|
|
302
|
+
closeText(block);
|
|
303
|
+
slideUp(textBlock, function() {
|
|
304
|
+
textBlock.remove();
|
|
305
|
+
removed();
|
|
255
306
|
});
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
},
|
|
302
|
-
iconClass: TEXTS[type].iconClass,
|
|
303
|
-
className: 'ge-add-text-button',
|
|
304
|
-
kind: 'text',
|
|
305
|
-
inColumn: true,
|
|
306
|
-
create: function() { return makeText(type); },
|
|
307
|
-
};
|
|
308
|
-
}),
|
|
309
|
-
|
|
310
|
-
onInit: function() {
|
|
311
|
-
markTexts();
|
|
312
|
-
|
|
313
|
-
ge.canvas.off('click.ge-text').on('click.ge-text', '.ge-content', onClick);
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
// While the drawers and the text blocks are still there, as the
|
|
317
|
-
// editors left them
|
|
318
|
-
onBeforeDeinit: function() {
|
|
319
|
-
ge.canvas.find('.ge-content').each(function() {
|
|
320
|
-
if (isOurs($(this))) { closeText($(this)); }
|
|
321
|
-
});
|
|
322
|
-
},
|
|
323
|
-
|
|
324
|
-
onDeinit: function() {
|
|
325
|
-
ge.canvas.off('click.ge-text');
|
|
326
|
-
},
|
|
327
|
-
|
|
328
|
-
// The first time only: an undo says ready again, and by then the
|
|
329
|
-
// host may have changed the content area itself
|
|
330
|
-
onContentReady: function(area) {
|
|
331
|
-
if (area.data('ge-text-before') && !area.data('ge-text-ready')) {
|
|
332
|
-
area.data('ge-text-ready', attributesOf(area[0]));
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
function markTexts() {
|
|
311
|
+
all(ge.canvas, ".ge-text-block").forEach(function(textBlock) {
|
|
312
|
+
if (child(textBlock, ".ge-tools-drawer")) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
var block = child(textBlock, ".ge-content");
|
|
316
|
+
if (!block || !isOurs(block)) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
createTextControls(textBlock);
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
var texts = offeredTexts();
|
|
323
|
+
var clicks = null;
|
|
324
|
+
return {
|
|
325
|
+
methods: {
|
|
326
|
+
createText: apiCreateText
|
|
327
|
+
},
|
|
328
|
+
/**
|
|
329
|
+
* The types this plugin edits, for the core: every editor loaded
|
|
330
|
+
* is the owner of its texts, and the ones offered are what the
|
|
331
|
+
* host's plain content can be made.
|
|
332
|
+
*/
|
|
333
|
+
textTypes: function() {
|
|
334
|
+
var offered = offeredTexts();
|
|
335
|
+
var others = Object.keys(TEXTS).filter(function(type) {
|
|
336
|
+
return offered.indexOf(type) === -1;
|
|
337
|
+
});
|
|
338
|
+
return offered.concat(others).map(function(type) {
|
|
339
|
+
var text = TEXTS[type];
|
|
340
|
+
return {
|
|
341
|
+
type,
|
|
342
|
+
label: textLabel(type),
|
|
343
|
+
offered: offered.indexOf(type) !== -1,
|
|
344
|
+
available: text.available ? function() {
|
|
345
|
+
return text.available();
|
|
346
|
+
} : null,
|
|
347
|
+
missingKey: text.missingKey,
|
|
348
|
+
edit: function(block) {
|
|
349
|
+
var textBlock = block.parentElement;
|
|
350
|
+
if (hasClass(textBlock, "ge-text-block") && !child(textBlock, ".ge-tools-drawer")) {
|
|
351
|
+
createTextControls(textBlock);
|
|
333
352
|
}
|
|
353
|
+
startText(block);
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
});
|
|
357
|
+
},
|
|
358
|
+
// A text block of each editor offered. Like a container, it goes
|
|
359
|
+
// into a row of its own when clicked, or where it is dropped
|
|
360
|
+
toolbar: texts.map(function(type) {
|
|
361
|
+
return {
|
|
362
|
+
label: function() {
|
|
363
|
+
return texts.length > 1 ? ge.t("text.add_type", { editor: textLabel(type) }) : ge.t("text.add");
|
|
334
364
|
},
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
})
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
365
|
+
iconClass: TEXTS[type].iconClass,
|
|
366
|
+
className: "ge-add-text-button",
|
|
367
|
+
kind: "text",
|
|
368
|
+
inColumn: true,
|
|
369
|
+
create: function() {
|
|
370
|
+
return makeText(type);
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
}),
|
|
374
|
+
onInit: function() {
|
|
375
|
+
markTexts();
|
|
376
|
+
if (clicks) {
|
|
377
|
+
ge.canvas.removeEventListener("click", clicks);
|
|
378
|
+
}
|
|
379
|
+
clicks = delegate(ge.canvas, "click", ".ge-content", onClick);
|
|
380
|
+
},
|
|
381
|
+
// While the drawers and the text blocks are still there, as the
|
|
382
|
+
// editors left them
|
|
383
|
+
onBeforeDeinit: function() {
|
|
384
|
+
all(ge.canvas, ".ge-content").forEach(function(block) {
|
|
385
|
+
if (isOurs(block)) {
|
|
386
|
+
closeText(block);
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
},
|
|
390
|
+
onDeinit: function() {
|
|
391
|
+
if (clicks) {
|
|
392
|
+
ge.canvas.removeEventListener("click", clicks);
|
|
393
|
+
}
|
|
394
|
+
clicks = null;
|
|
395
|
+
},
|
|
396
|
+
// The first time only: an undo says ready again, and by then the
|
|
397
|
+
// host may have changed the content area itself
|
|
398
|
+
onContentReady: function(area) {
|
|
399
|
+
if (readBefore.has(area) && !readReady.has(area)) {
|
|
400
|
+
readReady.set(area, attributesOf(area));
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
Object.assign(GridEditor.locales.en, {
|
|
406
|
+
"text.add": "Text",
|
|
407
|
+
"text.add_type": "Text ({editor})",
|
|
408
|
+
"panel.editor": "Editor",
|
|
409
|
+
"panel.kind_text": "Text"
|
|
368
410
|
});
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
411
|
+
readBefore = /* @__PURE__ */ new WeakMap();
|
|
412
|
+
readReady = /* @__PURE__ */ new WeakMap();
|
|
413
|
+
EDITOR_CLASS = /^(mce-|cke|note-)|^(active|ge-rte-active)$/;
|
|
414
|
+
EDITOR_ATTRIBUTE = /^(data-mce-|contenteditable$|spellcheck$)/;
|
|
415
|
+
textFeature.always = true;
|
|
416
|
+
GridEditor.features.text = textFeature;
|
|
417
|
+
}
|
|
418
|
+
var readBefore;
|
|
419
|
+
var readReady;
|
|
420
|
+
var EDITOR_CLASS;
|
|
421
|
+
var EDITOR_ATTRIBUTE;
|
|
422
|
+
|
|
423
|
+
// src/js/plugins/grideditor.ckeditor.js
|
|
424
|
+
Object.assign(GridEditor.locales.en, {
|
|
425
|
+
"text.ckeditor": "CKEditor"
|
|
426
|
+
});
|
|
427
|
+
var INITIAL_CONTENT = "<p>Lorem initius... </p>";
|
|
428
|
+
var instances = /* @__PURE__ */ new WeakMap();
|
|
429
|
+
GridEditor.texts.ckeditor = function(ge) {
|
|
430
|
+
function instanceOf(contentArea) {
|
|
431
|
+
var kept = instances.get(contentArea);
|
|
432
|
+
if (kept) {
|
|
433
|
+
return kept;
|
|
434
|
+
}
|
|
435
|
+
var found = null;
|
|
436
|
+
Object.keys(window.CKEDITOR.instances).forEach(function(name) {
|
|
437
|
+
var instance = window.CKEDITOR.instances[name];
|
|
438
|
+
if (instance.element && instance.element.$ === contentArea) {
|
|
439
|
+
found = instance;
|
|
389
440
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
// closing one content area destroyed every CKEditor on
|
|
452
|
-
// the page, other editors' and the host's own included
|
|
453
|
-
var instance = window.CKEDITOR ? instanceOf(contentArea) : null;
|
|
454
|
-
if (instance) { instance.destroy(); }
|
|
455
|
-
contentArea.removeData('ge-ckeditor');
|
|
456
|
-
|
|
457
|
-
// Cleanup
|
|
458
|
-
contentArea
|
|
459
|
-
.removeClass('active cke_focus')
|
|
460
|
-
.removeAttr('id')
|
|
461
|
-
.removeAttr('style')
|
|
462
|
-
.removeAttr('spellcheck')
|
|
463
|
-
.removeAttr('contenteditable')
|
|
464
|
-
;
|
|
465
|
-
});
|
|
466
|
-
},
|
|
467
|
-
};
|
|
441
|
+
});
|
|
442
|
+
return found;
|
|
443
|
+
}
|
|
444
|
+
return {
|
|
445
|
+
labelKey: "text.ckeditor",
|
|
446
|
+
initialContent: INITIAL_CONTENT,
|
|
447
|
+
missingKey: "error.ckeditor_missing",
|
|
448
|
+
available: function() {
|
|
449
|
+
return !!window.CKEDITOR;
|
|
450
|
+
},
|
|
451
|
+
start: function(contentAreas) {
|
|
452
|
+
var settings = ge.settings;
|
|
453
|
+
contentAreas.forEach(function(contentArea) {
|
|
454
|
+
if (hasClass(contentArea, "active")) {
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
if (contentArea.innerHTML == INITIAL_CONTENT) {
|
|
458
|
+
contentArea.innerHTML = " ";
|
|
459
|
+
}
|
|
460
|
+
addClass(contentArea, "active");
|
|
461
|
+
contentArea.setAttribute("contenteditable", "true");
|
|
462
|
+
var configuration = Object.assign(
|
|
463
|
+
{},
|
|
464
|
+
settings.ckeditor && settings.ckeditor.config ? settings.ckeditor.config : {},
|
|
465
|
+
{
|
|
466
|
+
// Focus editor on creation
|
|
467
|
+
on: {
|
|
468
|
+
instanceReady: function(evt) {
|
|
469
|
+
var callback;
|
|
470
|
+
try {
|
|
471
|
+
callback = settings.ckeditor.config.on.instanceReady;
|
|
472
|
+
} catch (err) {
|
|
473
|
+
}
|
|
474
|
+
if (callback) {
|
|
475
|
+
callback.call(this, evt);
|
|
476
|
+
}
|
|
477
|
+
ge.textReady(contentArea);
|
|
478
|
+
instance.focus();
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
var instance = window.CKEDITOR.inline(contentArea, configuration);
|
|
484
|
+
instances.set(contentArea, instance);
|
|
485
|
+
});
|
|
486
|
+
},
|
|
487
|
+
stop: function(contentAreas) {
|
|
488
|
+
contentAreas.filter(function(contentArea) {
|
|
489
|
+
return hasClass(contentArea, "active");
|
|
490
|
+
}).forEach(function(contentArea) {
|
|
491
|
+
var instance = window.CKEDITOR ? instanceOf(contentArea) : null;
|
|
492
|
+
if (instance) {
|
|
493
|
+
instance.destroy();
|
|
494
|
+
}
|
|
495
|
+
instances.delete(contentArea);
|
|
496
|
+
removeClass(contentArea, "active cke_focus");
|
|
497
|
+
["id", "style", "spellcheck", "contenteditable"].forEach(function(name) {
|
|
498
|
+
contentArea.removeAttribute(name);
|
|
499
|
+
});
|
|
500
|
+
});
|
|
501
|
+
}
|
|
468
502
|
};
|
|
469
|
-
}
|
|
503
|
+
};
|
|
504
|
+
})();
|