biso24-editor 1.3.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/CKEditor4/.eslintrc.json +4 -0
- package/CKEditor4/CHANGES.md +2182 -0
- package/CKEditor4/LICENSE.md +1436 -0
- package/CKEditor4/README.md +39 -0
- package/CKEditor4/SECURITY.md +10 -0
- package/CKEditor4/adapters/jquery.js +158 -0
- package/CKEditor4/bender-runner.config.json +16 -0
- package/CKEditor4/build-config.js +100 -0
- package/CKEditor4/ckeditor.js +30065 -0
- package/CKEditor4/config.js +39 -0
- package/CKEditor4/contents.css +161 -0
- package/CKEditor4/lang/vi.js +475 -0
- package/CKEditor4/plugins/a11yhelp/dialogs/a11yhelp.js +143 -0
- package/CKEditor4/plugins/a11yhelp/dialogs/lang/vi.js +122 -0
- package/CKEditor4/plugins/ajax/plugin.js +241 -0
- package/CKEditor4/plugins/autocomplete/plugin.js +1655 -0
- package/CKEditor4/plugins/autocomplete/skins/default.css +38 -0
- package/CKEditor4/plugins/custompaste/plugin.js +57 -0
- package/CKEditor4/plugins/dialog/dialogDefinition.js +4 -0
- package/CKEditor4/plugins/dialog/styles/dialog.css +18 -0
- package/CKEditor4/plugins/font/lang/vi.js +14 -0
- package/CKEditor4/plugins/font/plugin.js +535 -0
- package/CKEditor4/plugins/icons.png +0 -0
- package/CKEditor4/plugins/icons_hidpi.png +0 -0
- package/CKEditor4/plugins/image2/dialogs/image2.js +558 -0
- package/CKEditor4/plugins/image2/icons/hidpi/image.png +0 -0
- package/CKEditor4/plugins/image2/icons/image.png +0 -0
- package/CKEditor4/plugins/image2/lang/vi.js +21 -0
- package/CKEditor4/plugins/image2/plugin.js +1708 -0
- package/CKEditor4/plugins/justify/icons/hidpi/justifyblock.png +0 -0
- package/CKEditor4/plugins/justify/icons/hidpi/justifycenter.png +0 -0
- package/CKEditor4/plugins/justify/icons/hidpi/justifyleft.png +0 -0
- package/CKEditor4/plugins/justify/icons/hidpi/justifyright.png +0 -0
- package/CKEditor4/plugins/justify/icons/justifyblock.png +0 -0
- package/CKEditor4/plugins/justify/icons/justifycenter.png +0 -0
- package/CKEditor4/plugins/justify/icons/justifyleft.png +0 -0
- package/CKEditor4/plugins/justify/icons/justifyright.png +0 -0
- package/CKEditor4/plugins/justify/plugin.js +266 -0
- package/CKEditor4/plugins/justify_group/icons/hidpi/justifycenter.png +0 -0
- package/CKEditor4/plugins/justify_group/icons/justifycenter.png +0 -0
- package/CKEditor4/plugins/justify_group/plugin.js +64 -0
- package/CKEditor4/plugins/lineheight/LICENSE +22 -0
- package/CKEditor4/plugins/lineheight/README.md +2 -0
- package/CKEditor4/plugins/lineheight/lang/vi.js +3 -0
- package/CKEditor4/plugins/lineheight/plugin.js +99 -0
- package/CKEditor4/plugins/lineheight/readme.txt +30 -0
- package/CKEditor4/plugins/link/dialogs/anchor.js +82 -0
- package/CKEditor4/plugins/link/dialogs/link.js +777 -0
- package/CKEditor4/plugins/link/images/anchor.png +0 -0
- package/CKEditor4/plugins/link/images/hidpi/anchor.png +0 -0
- package/CKEditor4/plugins/magicline/images/hidpi/icon-rtl.png +0 -0
- package/CKEditor4/plugins/magicline/images/hidpi/icon.png +0 -0
- package/CKEditor4/plugins/magicline/images/icon-rtl.png +0 -0
- package/CKEditor4/plugins/magicline/images/icon.png +0 -0
- package/CKEditor4/plugins/mentions/plugin.js +471 -0
- package/CKEditor4/plugins/menubutton/plugin.js +99 -0
- package/CKEditor4/plugins/pastefromword/filter/default.js +849 -0
- package/CKEditor4/plugins/pastetools/filter/common.js +445 -0
- package/CKEditor4/plugins/pastetools/filter/image.js +163 -0
- package/CKEditor4/plugins/pdffile/icons/exporttopdf.png +0 -0
- package/CKEditor4/plugins/pdffile/icons/hidpi/exporttopdf.png +0 -0
- package/CKEditor4/plugins/pdffile/plugin.js +36 -0
- package/CKEditor4/plugins/placeholder_button/plugin.js +31 -0
- package/CKEditor4/plugins/sourcedialog/dialogs/sourcedialog.js +88 -0
- package/CKEditor4/plugins/sourcedialog/icons/hidpi/sourcedialog-rtl.png +0 -0
- package/CKEditor4/plugins/sourcedialog/icons/hidpi/sourcedialog.png +0 -0
- package/CKEditor4/plugins/sourcedialog/icons/sourcedialog-rtl.png +0 -0
- package/CKEditor4/plugins/sourcedialog/icons/sourcedialog.png +0 -0
- package/CKEditor4/plugins/sourcedialog/lang/vi.js +9 -0
- package/CKEditor4/plugins/sourcedialog/plugin.js +30 -0
- package/CKEditor4/plugins/textmatch/plugin.js +331 -0
- package/CKEditor4/plugins/textwatcher/plugin.js +295 -0
- package/CKEditor4/plugins/widget/images/handle.png +0 -0
- package/CKEditor4/plugins/wordfile/icons/exporttoword.png +0 -0
- package/CKEditor4/plugins/wordfile/icons/hidpi/exporttoword.png +0 -0
- package/CKEditor4/plugins/wordfile/icons/hidpi/importfromword.png +0 -0
- package/CKEditor4/plugins/wordfile/icons/importfromword.png +0 -0
- package/CKEditor4/plugins/wordfile/plugin.js +161 -0
- package/CKEditor4/skins/moono-lisa/dialog.css +685 -0
- package/CKEditor4/skins/moono-lisa/dialog_ie.css +721 -0
- package/CKEditor4/skins/moono-lisa/dialog_ie8.css +746 -0
- package/CKEditor4/skins/moono-lisa/dialog_iequirks.css +724 -0
- package/CKEditor4/skins/moono-lisa/editor.css +1551 -0
- package/CKEditor4/skins/moono-lisa/editor_gecko.css +1556 -0
- package/CKEditor4/skins/moono-lisa/editor_ie.css +1588 -0
- package/CKEditor4/skins/moono-lisa/editor_ie8.css +1639 -0
- package/CKEditor4/skins/moono-lisa/editor_iequirks.css +1632 -0
- package/CKEditor4/skins/moono-lisa/icons.png +0 -0
- package/CKEditor4/skins/moono-lisa/icons_hidpi.png +0 -0
- package/CKEditor4/skins/moono-lisa/images/arrow.png +0 -0
- package/CKEditor4/skins/moono-lisa/images/close.png +0 -0
- package/CKEditor4/skins/moono-lisa/images/hidpi/close.png +0 -0
- package/CKEditor4/skins/moono-lisa/images/hidpi/lock-open.png +0 -0
- package/CKEditor4/skins/moono-lisa/images/hidpi/lock.png +0 -0
- package/CKEditor4/skins/moono-lisa/images/hidpi/refresh.png +0 -0
- package/CKEditor4/skins/moono-lisa/images/lock-open.png +0 -0
- package/CKEditor4/skins/moono-lisa/images/lock.png +0 -0
- package/CKEditor4/skins/moono-lisa/images/refresh.png +0 -0
- package/CKEditor4/skins/moono-lisa/images/spinner.gif +0 -0
- package/CKEditor4/skins/moono-lisa/readme.md +46 -0
- package/CKEditor4/styles.js +136 -0
- package/CKEditor4/vendor/promise.js +385 -0
- package/README.md +3 -0
- package/package.json +9 -0
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
(function () {
|
|
6
|
+
function q(a, b, c) {
|
|
7
|
+
b += c;
|
|
8
|
+
for (var d = a[b], e = /[\s]/; d && e.test(d); ) (b += c), (d = a[b]);
|
|
9
|
+
return d;
|
|
10
|
+
}
|
|
11
|
+
function r(a) {
|
|
12
|
+
return /%$/.test(a) ? a : a + 'px';
|
|
13
|
+
}
|
|
14
|
+
function t(a) {
|
|
15
|
+
var b = a.margin ? 'margin' : a.MARGIN ? 'MARGIN' : !1,
|
|
16
|
+
c,
|
|
17
|
+
d;
|
|
18
|
+
if (b) {
|
|
19
|
+
d = CKEDITOR.tools.style.parse.margin(a[b]);
|
|
20
|
+
for (c in d) a['margin-' + c] = d[c];
|
|
21
|
+
delete a[b];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function u(a) {
|
|
25
|
+
var b =
|
|
26
|
+
'background-color:transparent;background:transparent;background-color:none;background:none;background-position:initial initial;background-repeat:initial initial;caret-color;font-family:-webkit-standard;font-variant-caps;letter-spacing:normal;orphans;widows;text-transform:none;word-spacing:0px;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;text-indent:0px;margin-bottom:0in'.split(
|
|
27
|
+
';',
|
|
28
|
+
),
|
|
29
|
+
c = CKEDITOR.tools.parseCssText(a.attributes.style),
|
|
30
|
+
d,
|
|
31
|
+
e;
|
|
32
|
+
for (d in c)
|
|
33
|
+
(e = d + ':' + c[d]),
|
|
34
|
+
CKEDITOR.tools.array.some(b, function (a) {
|
|
35
|
+
return e.substring(0, a.length).toLowerCase() === a;
|
|
36
|
+
}) && delete c[d];
|
|
37
|
+
c = CKEDITOR.tools.writeCssText(c);
|
|
38
|
+
'' !== c ? (a.attributes.style = c) : delete a.attributes.style;
|
|
39
|
+
}
|
|
40
|
+
function v(a) {
|
|
41
|
+
a = a.config.font_names;
|
|
42
|
+
var b = [];
|
|
43
|
+
if (!a || !a.length) return !1;
|
|
44
|
+
b = CKEDITOR.tools.array.map(a.split(';'), function (a) {
|
|
45
|
+
return -1 === a.indexOf('/') ? a : a.split('/')[1];
|
|
46
|
+
});
|
|
47
|
+
return b.length ? b : !1;
|
|
48
|
+
}
|
|
49
|
+
function w(a, b) {
|
|
50
|
+
var c = a.split(',');
|
|
51
|
+
return (
|
|
52
|
+
CKEDITOR.tools.array.find(b, function (a) {
|
|
53
|
+
for (var e = 0; e < c.length; e++) if (-1 === a.indexOf(CKEDITOR.tools.trim(c[e]))) return !1;
|
|
54
|
+
return !0;
|
|
55
|
+
}) || a
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
var g,
|
|
59
|
+
m = CKEDITOR.tools,
|
|
60
|
+
p = {};
|
|
61
|
+
CKEDITOR.plugins.pastetools.filters.common = p;
|
|
62
|
+
p.rules = function (a, b, c) {
|
|
63
|
+
var d = v(b);
|
|
64
|
+
return {
|
|
65
|
+
elements: {
|
|
66
|
+
'^': function (a) {
|
|
67
|
+
u(a);
|
|
68
|
+
if (a.attributes.bgcolor) {
|
|
69
|
+
var b = CKEDITOR.tools.parseCssText(a.attributes.style);
|
|
70
|
+
b['background-color'] ||
|
|
71
|
+
((b['background-color'] = a.attributes.bgcolor), (a.attributes.style = CKEDITOR.tools.writeCssText(b)));
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
span: function (a) {
|
|
75
|
+
if (a.hasClass('Apple-converted-space')) return new CKEDITOR.htmlParser.text(' ');
|
|
76
|
+
},
|
|
77
|
+
table: function (a) {
|
|
78
|
+
a.filterChildren(c);
|
|
79
|
+
var b = a.parent,
|
|
80
|
+
f = b && b.parent,
|
|
81
|
+
d,
|
|
82
|
+
h;
|
|
83
|
+
if (
|
|
84
|
+
b.name &&
|
|
85
|
+
'div' === b.name &&
|
|
86
|
+
b.attributes.align &&
|
|
87
|
+
1 === m.object.keys(b.attributes).length &&
|
|
88
|
+
1 === b.children.length
|
|
89
|
+
) {
|
|
90
|
+
a.attributes.align = b.attributes.align;
|
|
91
|
+
d = b.children.splice(0);
|
|
92
|
+
a.remove();
|
|
93
|
+
for (h = d.length - 1; 0 <= h; h--) f.add(d[h], b.getIndex());
|
|
94
|
+
b.remove();
|
|
95
|
+
}
|
|
96
|
+
g.convertStyleToPx(a);
|
|
97
|
+
},
|
|
98
|
+
tr: function (a) {
|
|
99
|
+
a.attributes = {};
|
|
100
|
+
},
|
|
101
|
+
td: function (a) {
|
|
102
|
+
var d = a.getAscendant('table'),
|
|
103
|
+
d = m.parseCssText(d.attributes.style, !0),
|
|
104
|
+
f = d.background;
|
|
105
|
+
f && g.setStyle(a, 'background', f, !0);
|
|
106
|
+
(d = d['background-color']) && g.setStyle(a, 'background-color', d, !0);
|
|
107
|
+
var d = m.parseCssText(a.attributes.style, !0),
|
|
108
|
+
f = d.border ? CKEDITOR.tools.style.border.fromCssRule(d.border) : {},
|
|
109
|
+
f = m.style.border.splitCssValues(d, f),
|
|
110
|
+
l = CKEDITOR.tools.clone(d),
|
|
111
|
+
h;
|
|
112
|
+
for (h in l) 0 == h.indexOf('border') && delete l[h];
|
|
113
|
+
a.attributes.style = CKEDITOR.tools.writeCssText(l);
|
|
114
|
+
d.background &&
|
|
115
|
+
((h = CKEDITOR.tools.style.parse.background(d.background)),
|
|
116
|
+
h.color && (g.setStyle(a, 'background-color', h.color, !0), g.setStyle(a, 'background', '')));
|
|
117
|
+
for (var n in f)
|
|
118
|
+
(h = d[n] ? CKEDITOR.tools.style.border.fromCssRule(d[n]) : f[n]),
|
|
119
|
+
'none' === h.style ? g.setStyle(a, n, 'none') : g.setStyle(a, n, h.toString());
|
|
120
|
+
g.mapCommonStyles(a);
|
|
121
|
+
g.convertStyleToPx(a);
|
|
122
|
+
g.createStyleStack(
|
|
123
|
+
a,
|
|
124
|
+
c,
|
|
125
|
+
b,
|
|
126
|
+
/margin|text\-align|padding|list\-style\-type|width|height|border|white\-space|vertical\-align|background/i,
|
|
127
|
+
);
|
|
128
|
+
},
|
|
129
|
+
font: function (a) {
|
|
130
|
+
a.attributes.face && d && (a.attributes.face = w(a.attributes.face, d));
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
p.styles = {
|
|
136
|
+
setStyle: function (a, b, c, d) {
|
|
137
|
+
var e = m.parseCssText(a.attributes.style);
|
|
138
|
+
(d && e[b]) || ('' === c ? delete e[b] : (e[b] = c), (a.attributes.style = CKEDITOR.tools.writeCssText(e)));
|
|
139
|
+
},
|
|
140
|
+
convertStyleToPx: function (a) {
|
|
141
|
+
var b = a.attributes.style;
|
|
142
|
+
b &&
|
|
143
|
+
(a.attributes.style = b.replace(/\d+(\.\d+)?pt/g, function (a) {
|
|
144
|
+
return CKEDITOR.tools.convertToPx(a) + 'px';
|
|
145
|
+
}));
|
|
146
|
+
},
|
|
147
|
+
mapStyles: function (a, b) {
|
|
148
|
+
for (var c in b)
|
|
149
|
+
if (a.attributes[c]) {
|
|
150
|
+
if ('function' === typeof b[c]) b[c](a.attributes[c]);
|
|
151
|
+
else g.setStyle(a, b[c], a.attributes[c]);
|
|
152
|
+
delete a.attributes[c];
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
mapCommonStyles: function (a) {
|
|
156
|
+
return g.mapStyles(a, {
|
|
157
|
+
vAlign: function (b) {
|
|
158
|
+
g.setStyle(a, 'vertical-align', b);
|
|
159
|
+
},
|
|
160
|
+
width: function (b) {
|
|
161
|
+
g.setStyle(a, 'width', r(b));
|
|
162
|
+
},
|
|
163
|
+
height: function (b) {
|
|
164
|
+
g.setStyle(a, 'height', r(b));
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
},
|
|
168
|
+
normalizedStyles: function (a, b) {
|
|
169
|
+
var c =
|
|
170
|
+
'background-color:transparent border-image:none color:windowtext direction:ltr mso- visibility:visible div:border:none'.split(
|
|
171
|
+
' ',
|
|
172
|
+
),
|
|
173
|
+
d = 'font-family font font-size color background-color line-height text-decoration'.split(' '),
|
|
174
|
+
e = function () {
|
|
175
|
+
for (var a = [], b = 0; b < arguments.length; b++) arguments[b] && a.push(arguments[b]);
|
|
176
|
+
return -1 !== m.indexOf(c, a.join(':'));
|
|
177
|
+
},
|
|
178
|
+
k = !0 === CKEDITOR.plugins.pastetools.getConfigValue(b, 'removeFontStyles'),
|
|
179
|
+
f = m.parseCssText(a.attributes.style);
|
|
180
|
+
'cke:li' == a.name &&
|
|
181
|
+
(f['TEXT-INDENT'] && f.MARGIN
|
|
182
|
+
? ((a.attributes['cke-indentation'] = p.lists.getElementIndentation(a)),
|
|
183
|
+
(f.MARGIN = f.MARGIN.replace(/(([\w\.]+ ){3,3})[\d\.]+(\w+$)/, '$10$3')))
|
|
184
|
+
: delete f['TEXT-INDENT'],
|
|
185
|
+
delete f['text-indent']);
|
|
186
|
+
for (var l = m.object.keys(f), h = 0; h < l.length; h++) {
|
|
187
|
+
var n = l[h].toLowerCase(),
|
|
188
|
+
g = f[l[h]],
|
|
189
|
+
q = CKEDITOR.tools.indexOf;
|
|
190
|
+
((k && -1 !== q(d, n.toLowerCase())) ||
|
|
191
|
+
e(null, n, g) ||
|
|
192
|
+
e(null, n.replace(/\-.*$/, '-')) ||
|
|
193
|
+
e(null, n) ||
|
|
194
|
+
e(a.name, n, g) ||
|
|
195
|
+
e(a.name, n.replace(/\-.*$/, '-')) ||
|
|
196
|
+
e(a.name, n) ||
|
|
197
|
+
e(g)) &&
|
|
198
|
+
delete f[l[h]];
|
|
199
|
+
}
|
|
200
|
+
var r = CKEDITOR.plugins.pastetools.getConfigValue(b, 'keepZeroMargins');
|
|
201
|
+
t(f);
|
|
202
|
+
(function () {
|
|
203
|
+
CKEDITOR.tools.array.forEach(['top', 'right', 'bottom', 'left'], function (a) {
|
|
204
|
+
a = 'margin-' + a;
|
|
205
|
+
if (a in f) {
|
|
206
|
+
var b = CKEDITOR.tools.convertToPx(f[a]);
|
|
207
|
+
b || r ? (f[a] = b ? b + 'px' : 0) : delete f[a];
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
})();
|
|
211
|
+
return CKEDITOR.tools.writeCssText(f);
|
|
212
|
+
},
|
|
213
|
+
createStyleStack: function (a, b, c, d) {
|
|
214
|
+
var e = [];
|
|
215
|
+
a.filterChildren(b);
|
|
216
|
+
for (b = a.children.length - 1; 0 <= b; b--) e.unshift(a.children[b]), a.children[b].remove();
|
|
217
|
+
g.sortStyles(a);
|
|
218
|
+
b = m.parseCssText(g.normalizedStyles(a, c));
|
|
219
|
+
c = a;
|
|
220
|
+
var k = 'span' === a.name,
|
|
221
|
+
f;
|
|
222
|
+
for (f in b)
|
|
223
|
+
if (!f.match(d || /margin((?!-)|-left|-top|-bottom|-right)|text-indent|text-align|width|border|padding/i))
|
|
224
|
+
if (k) k = !1;
|
|
225
|
+
else {
|
|
226
|
+
var l = new CKEDITOR.htmlParser.element('span');
|
|
227
|
+
l.attributes.style = f + ':' + b[f];
|
|
228
|
+
c.add(l);
|
|
229
|
+
c = l;
|
|
230
|
+
delete b[f];
|
|
231
|
+
}
|
|
232
|
+
CKEDITOR.tools.isEmpty(b) ? delete a.attributes.style : (a.attributes.style = CKEDITOR.tools.writeCssText(b));
|
|
233
|
+
for (b = 0; b < e.length; b++) c.add(e[b]);
|
|
234
|
+
},
|
|
235
|
+
sortStyles: function (a) {
|
|
236
|
+
for (
|
|
237
|
+
var b = ['border', 'border-bottom', 'font-size', 'background'],
|
|
238
|
+
c = m.parseCssText(a.attributes.style),
|
|
239
|
+
d = m.object.keys(c),
|
|
240
|
+
e = [],
|
|
241
|
+
k = [],
|
|
242
|
+
f = 0;
|
|
243
|
+
f < d.length;
|
|
244
|
+
f++
|
|
245
|
+
)
|
|
246
|
+
-1 !== m.indexOf(b, d[f].toLowerCase()) ? e.push(d[f]) : k.push(d[f]);
|
|
247
|
+
e.sort(function (a, c) {
|
|
248
|
+
var d = m.indexOf(b, a.toLowerCase()),
|
|
249
|
+
e = m.indexOf(b, c.toLowerCase());
|
|
250
|
+
return d - e;
|
|
251
|
+
});
|
|
252
|
+
d = [].concat(e, k);
|
|
253
|
+
e = {};
|
|
254
|
+
for (f = 0; f < d.length; f++) e[d[f]] = c[d[f]];
|
|
255
|
+
a.attributes.style = CKEDITOR.tools.writeCssText(e);
|
|
256
|
+
},
|
|
257
|
+
pushStylesLower: function (a, b, c) {
|
|
258
|
+
if (!a.attributes.style || 0 === a.children.length) return !1;
|
|
259
|
+
b = b || {};
|
|
260
|
+
var d = { 'list-style-type': !0, width: !0, height: !0, border: !0, 'border-': !0 },
|
|
261
|
+
e = m.parseCssText(a.attributes.style),
|
|
262
|
+
k;
|
|
263
|
+
for (k in e)
|
|
264
|
+
if (!(k.toLowerCase() in d || d[k.toLowerCase().replace(/\-.*$/, '-')] || k.toLowerCase() in b)) {
|
|
265
|
+
for (var f = !1, l = 0; l < a.children.length; l++) {
|
|
266
|
+
var h = a.children[l];
|
|
267
|
+
if (h.type === CKEDITOR.NODE_TEXT && c) {
|
|
268
|
+
var n = new CKEDITOR.htmlParser.element('span');
|
|
269
|
+
n.setHtml(h.value);
|
|
270
|
+
h.replaceWith(n);
|
|
271
|
+
h = n;
|
|
272
|
+
}
|
|
273
|
+
h.type === CKEDITOR.NODE_ELEMENT && ((f = !0), g.setStyle(h, k, e[k]));
|
|
274
|
+
}
|
|
275
|
+
f && delete e[k];
|
|
276
|
+
}
|
|
277
|
+
a.attributes.style = CKEDITOR.tools.writeCssText(e);
|
|
278
|
+
return !0;
|
|
279
|
+
},
|
|
280
|
+
inliner: {
|
|
281
|
+
filtered:
|
|
282
|
+
'break-before break-after break-inside page-break page-break-before page-break-after page-break-inside'.split(
|
|
283
|
+
' ',
|
|
284
|
+
),
|
|
285
|
+
parse: function (a) {
|
|
286
|
+
function b(a) {
|
|
287
|
+
var b = new CKEDITOR.dom.element('style'),
|
|
288
|
+
c = new CKEDITOR.dom.element('iframe');
|
|
289
|
+
c.hide();
|
|
290
|
+
CKEDITOR.document.getBody().append(c);
|
|
291
|
+
c.$.contentDocument.documentElement.appendChild(b.$);
|
|
292
|
+
b.$.textContent = a;
|
|
293
|
+
c.remove();
|
|
294
|
+
return b.$.sheet;
|
|
295
|
+
}
|
|
296
|
+
function c(a) {
|
|
297
|
+
var b = a.indexOf('{'),
|
|
298
|
+
c = a.indexOf('}');
|
|
299
|
+
return d(a.substring(b + 1, c), !0);
|
|
300
|
+
}
|
|
301
|
+
var d = CKEDITOR.tools.parseCssText,
|
|
302
|
+
e = g.inliner.filter,
|
|
303
|
+
k = a.is ? a.$.sheet : b(a);
|
|
304
|
+
a = [];
|
|
305
|
+
var f;
|
|
306
|
+
if (k)
|
|
307
|
+
for (k = k.cssRules, f = 0; f < k.length; f++)
|
|
308
|
+
k[f].type === window.CSSRule.STYLE_RULE &&
|
|
309
|
+
a.push({ selector: k[f].selectorText, styles: e(c(k[f].cssText)) });
|
|
310
|
+
return a;
|
|
311
|
+
},
|
|
312
|
+
filter: function (a) {
|
|
313
|
+
var b = g.inliner.filtered,
|
|
314
|
+
c = m.array.indexOf,
|
|
315
|
+
d = {},
|
|
316
|
+
e;
|
|
317
|
+
for (e in a) -1 === c(b, e) && (d[e] = a[e]);
|
|
318
|
+
return d;
|
|
319
|
+
},
|
|
320
|
+
sort: function (a) {
|
|
321
|
+
return a.sort(
|
|
322
|
+
(function (a) {
|
|
323
|
+
var c = CKEDITOR.tools.array.map(a, function (a) {
|
|
324
|
+
return a.selector;
|
|
325
|
+
});
|
|
326
|
+
return function (a, b) {
|
|
327
|
+
var k = -1 !== ('' + a.selector).indexOf('.') ? 1 : 0,
|
|
328
|
+
k = (-1 !== ('' + b.selector).indexOf('.') ? 1 : 0) - k;
|
|
329
|
+
return 0 !== k ? k : c.indexOf(b.selector) - c.indexOf(a.selector);
|
|
330
|
+
};
|
|
331
|
+
})(a),
|
|
332
|
+
);
|
|
333
|
+
},
|
|
334
|
+
inline: function (a) {
|
|
335
|
+
var b = g.inliner.parse,
|
|
336
|
+
c = g.inliner.sort,
|
|
337
|
+
d = (function (a) {
|
|
338
|
+
a = new DOMParser().parseFromString(a, 'text/html');
|
|
339
|
+
return new CKEDITOR.dom.document(a);
|
|
340
|
+
})(a);
|
|
341
|
+
a = d.find('style');
|
|
342
|
+
c = c(
|
|
343
|
+
(function (a) {
|
|
344
|
+
var c = [],
|
|
345
|
+
d;
|
|
346
|
+
for (d = 0; d < a.count(); d++) c = c.concat(b(a.getItem(d)));
|
|
347
|
+
return c;
|
|
348
|
+
})(a),
|
|
349
|
+
);
|
|
350
|
+
CKEDITOR.tools.array.forEach(c, function (a) {
|
|
351
|
+
var b = a.styles;
|
|
352
|
+
a = d.find(a.selector);
|
|
353
|
+
var c, g, h;
|
|
354
|
+
t(b);
|
|
355
|
+
for (h = 0; h < a.count(); h++)
|
|
356
|
+
(c = a.getItem(h)),
|
|
357
|
+
(g = CKEDITOR.tools.parseCssText(c.getAttribute('style'))),
|
|
358
|
+
t(g),
|
|
359
|
+
(g = CKEDITOR.tools.extend({}, g, b)),
|
|
360
|
+
c.setAttribute('style', CKEDITOR.tools.writeCssText(g));
|
|
361
|
+
});
|
|
362
|
+
return d;
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
};
|
|
366
|
+
g = p.styles;
|
|
367
|
+
p.lists = {
|
|
368
|
+
getElementIndentation: function (a) {
|
|
369
|
+
a = m.parseCssText(a.attributes.style);
|
|
370
|
+
if (a.margin || a.MARGIN) {
|
|
371
|
+
a.margin = a.margin || a.MARGIN;
|
|
372
|
+
var b = { styles: { margin: a.margin } };
|
|
373
|
+
CKEDITOR.filter.transformationsTools.splitMarginShorthand(b);
|
|
374
|
+
a['margin-left'] = b.styles['margin-left'];
|
|
375
|
+
}
|
|
376
|
+
return parseInt(m.convertToPx(a['margin-left'] || '0px'), 10);
|
|
377
|
+
},
|
|
378
|
+
};
|
|
379
|
+
p.elements = {
|
|
380
|
+
replaceWithChildren: function (a) {
|
|
381
|
+
for (var b = a.children.length - 1; 0 <= b; b--) a.children[b].insertAfter(a);
|
|
382
|
+
},
|
|
383
|
+
};
|
|
384
|
+
p.createAttributeStack = function (a, b) {
|
|
385
|
+
var c,
|
|
386
|
+
d = [];
|
|
387
|
+
a.filterChildren(b);
|
|
388
|
+
for (c = a.children.length - 1; 0 <= c; c--) d.unshift(a.children[c]), a.children[c].remove();
|
|
389
|
+
c = a.attributes;
|
|
390
|
+
var e = a,
|
|
391
|
+
g = !0,
|
|
392
|
+
f;
|
|
393
|
+
for (f in c)
|
|
394
|
+
if (g) g = !1;
|
|
395
|
+
else {
|
|
396
|
+
var l = new CKEDITOR.htmlParser.element(a.name);
|
|
397
|
+
l.attributes[f] = c[f];
|
|
398
|
+
e.add(l);
|
|
399
|
+
e = l;
|
|
400
|
+
delete c[f];
|
|
401
|
+
}
|
|
402
|
+
for (c = 0; c < d.length; c++) e.add(d[c]);
|
|
403
|
+
};
|
|
404
|
+
p.parseShorthandMargins = t;
|
|
405
|
+
p.rtf = {
|
|
406
|
+
getGroups: function (a, b) {
|
|
407
|
+
for (var c = [], d, e = 0; (d = p.rtf.getGroup(a, b, { start: e })); ) (e = d.end), c.push(d);
|
|
408
|
+
return c;
|
|
409
|
+
},
|
|
410
|
+
removeGroups: function (a, b) {
|
|
411
|
+
for (var c; (c = p.rtf.getGroup(a, b)); ) {
|
|
412
|
+
var d = a.substring(0, c.start);
|
|
413
|
+
c = a.substring(c.end);
|
|
414
|
+
a = d + c;
|
|
415
|
+
}
|
|
416
|
+
return a;
|
|
417
|
+
},
|
|
418
|
+
getGroup: function (a, b, c) {
|
|
419
|
+
var d = 0;
|
|
420
|
+
b = new RegExp('\\{\\\\' + b, 'g');
|
|
421
|
+
var e;
|
|
422
|
+
c = CKEDITOR.tools.object.merge({ start: 0 }, c || {});
|
|
423
|
+
b.lastIndex = c.start;
|
|
424
|
+
c = b.exec(a);
|
|
425
|
+
if (!c) return null;
|
|
426
|
+
b = c.index;
|
|
427
|
+
e = a[b];
|
|
428
|
+
do {
|
|
429
|
+
var g = '{' === e && '\\' !== q(a, b, -1) && '\\' === q(a, b, 1);
|
|
430
|
+
e = '}' === e && '\\' !== q(a, b, -1) && 0 < d;
|
|
431
|
+
g ? d++ : e && d--;
|
|
432
|
+
e = a[++b];
|
|
433
|
+
} while (e && 0 < d);
|
|
434
|
+
return { start: c.index, end: b, content: a.substring(c.index, b) };
|
|
435
|
+
},
|
|
436
|
+
extractGroupContent: function (a) {
|
|
437
|
+
var b;
|
|
438
|
+
b = (b = a.match(/^\{\\(\w+)/)) ? b[1] : null;
|
|
439
|
+
a = a.replace(/\}([^{\s]+)/g, '} $1');
|
|
440
|
+
a = p.rtf.removeGroups(a, '(?!' + b + ')');
|
|
441
|
+
a = CKEDITOR.tools.trim(a.replace(/^\{(\\[\w-]+\s*)+/g, ''));
|
|
442
|
+
return a.replace(/}$/, '');
|
|
443
|
+
},
|
|
444
|
+
};
|
|
445
|
+
})();
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
(function () {
|
|
6
|
+
function u(a, c, b) {
|
|
7
|
+
c = l(c);
|
|
8
|
+
var e, d;
|
|
9
|
+
if (0 === c.length) return a;
|
|
10
|
+
e = CKEDITOR.tools.array.map(
|
|
11
|
+
c,
|
|
12
|
+
function (a) {
|
|
13
|
+
return h(a);
|
|
14
|
+
},
|
|
15
|
+
this,
|
|
16
|
+
);
|
|
17
|
+
if (b.length !== e.length)
|
|
18
|
+
return CKEDITOR.error('pastetools-failed-image-extraction', { rtf: c.length, html: b.length }), a;
|
|
19
|
+
for (d = 0; d < b.length; d++)
|
|
20
|
+
if (0 === b[d].indexOf('file://'))
|
|
21
|
+
if (e[d]) {
|
|
22
|
+
var k = b[d].replace(/\\/g, '\\\\');
|
|
23
|
+
a = a.replace(new RegExp('(\x3cimg [^\x3e]*src\x3d["\']?)' + k), '$1' + e[d]);
|
|
24
|
+
} else CKEDITOR.error('pastetools-unsupported-image', { type: c[d].type, index: d });
|
|
25
|
+
return a;
|
|
26
|
+
}
|
|
27
|
+
function v(a, c, b) {
|
|
28
|
+
var e = CKEDITOR.tools.array.unique(
|
|
29
|
+
CKEDITOR.tools.array.filter(b, function (a) {
|
|
30
|
+
return a.match(/^blob:/i);
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
b = CKEDITOR.tools.array.map(e, m);
|
|
34
|
+
CKEDITOR.tools.promise.all(b).then(function (b) {
|
|
35
|
+
CKEDITOR.tools.array.forEach(b, function (b, c) {
|
|
36
|
+
if (b) {
|
|
37
|
+
var d = e[c],
|
|
38
|
+
d = a
|
|
39
|
+
.editable()
|
|
40
|
+
.find('img[src\x3d"' + d + '"]')
|
|
41
|
+
.toArray();
|
|
42
|
+
CKEDITOR.tools.array.forEach(
|
|
43
|
+
d,
|
|
44
|
+
function (a) {
|
|
45
|
+
a.setAttribute('src', b);
|
|
46
|
+
a.setAttribute('data-cke-saved-src', b);
|
|
47
|
+
},
|
|
48
|
+
this,
|
|
49
|
+
);
|
|
50
|
+
} else CKEDITOR.error('pastetools-unsupported-image', { type: 'blob', index: c });
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
return c;
|
|
54
|
+
}
|
|
55
|
+
function l(a) {
|
|
56
|
+
function c(a) {
|
|
57
|
+
return 'string' !== typeof a
|
|
58
|
+
? -1
|
|
59
|
+
: CKEDITOR.tools.array.indexOf(d, function (b) {
|
|
60
|
+
return b.id === a;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function b(a) {
|
|
64
|
+
var b = a.match(/\\blipuid (\w+)\}/);
|
|
65
|
+
a = a.match(/\\bliptag(-?\d+)/);
|
|
66
|
+
return b ? b[1] : a ? a[1] : null;
|
|
67
|
+
}
|
|
68
|
+
var e = CKEDITOR.plugins.pastetools.filters.common.rtf,
|
|
69
|
+
d = [];
|
|
70
|
+
a = e.removeGroups(a, '(?:(?:header|footer)[lrf]?|nonshppict|shprslt)');
|
|
71
|
+
a = e.getGroups(a, 'pict');
|
|
72
|
+
if (!a) return d;
|
|
73
|
+
for (var k = 0; k < a.length; k++) {
|
|
74
|
+
var f = a[k].content,
|
|
75
|
+
h = b(f),
|
|
76
|
+
n = t(f),
|
|
77
|
+
g = c(h),
|
|
78
|
+
p = -1 !== g && d[g].hex,
|
|
79
|
+
l = p && d[g].type === n,
|
|
80
|
+
p = p && d[g].type !== n && g === d.length - 1,
|
|
81
|
+
m = -1 !== f.indexOf('\\defshp'),
|
|
82
|
+
q = -1 !== CKEDITOR.tools.array.indexOf(CKEDITOR.pasteFilters.image.supportedImageTypes, n),
|
|
83
|
+
r = -1 !== CKEDITOR.tools.indexOf(f, 'fHorizRule');
|
|
84
|
+
l
|
|
85
|
+
? d.push(d[g])
|
|
86
|
+
: p ||
|
|
87
|
+
m ||
|
|
88
|
+
r ||
|
|
89
|
+
((f = { id: h, hex: q ? e.extractGroupContent(f).replace(/\s/g, '') : null, type: n }),
|
|
90
|
+
-1 !== g ? d.splice(g, 1, f) : d.push(f));
|
|
91
|
+
}
|
|
92
|
+
return d;
|
|
93
|
+
}
|
|
94
|
+
function q(a) {
|
|
95
|
+
for (var c = /<img[^>]+src="([^"]+)[^>]+/g, b = [], e; (e = c.exec(a)); ) b.push(e[1]);
|
|
96
|
+
return b;
|
|
97
|
+
}
|
|
98
|
+
function t(a) {
|
|
99
|
+
var c = CKEDITOR.tools.array.find(CKEDITOR.pasteFilters.image.recognizableImageTypes, function (b) {
|
|
100
|
+
return b.marker.test(a);
|
|
101
|
+
});
|
|
102
|
+
return c ? c.type : 'unknown';
|
|
103
|
+
}
|
|
104
|
+
function h(a) {
|
|
105
|
+
var c = -1 !== CKEDITOR.tools.array.indexOf(CKEDITOR.pasteFilters.image.supportedImageTypes, a.type),
|
|
106
|
+
b = a.hex;
|
|
107
|
+
if (!c) return null;
|
|
108
|
+
'string' === typeof b && (b = CKEDITOR.tools.convertHexStringToBytes(a.hex));
|
|
109
|
+
return a.type ? 'data:' + a.type + ';base64,' + CKEDITOR.tools.convertBytesToBase64(b) : null;
|
|
110
|
+
}
|
|
111
|
+
function m(a) {
|
|
112
|
+
return new CKEDITOR.tools.promise(function (c) {
|
|
113
|
+
CKEDITOR.ajax.load(
|
|
114
|
+
a,
|
|
115
|
+
function (a) {
|
|
116
|
+
a = new Uint8Array(a);
|
|
117
|
+
var e = r(a);
|
|
118
|
+
a = h({ type: e, hex: a });
|
|
119
|
+
c(a);
|
|
120
|
+
},
|
|
121
|
+
'arraybuffer',
|
|
122
|
+
);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function r(a) {
|
|
126
|
+
a = a.subarray(0, 4);
|
|
127
|
+
var c = CKEDITOR.tools.array
|
|
128
|
+
.map(a, function (a) {
|
|
129
|
+
return a.toString(16);
|
|
130
|
+
})
|
|
131
|
+
.join('');
|
|
132
|
+
return (a = CKEDITOR.tools.array.find(CKEDITOR.pasteFilters.image.recognizableImageSignatures, function (a) {
|
|
133
|
+
return 0 === c.indexOf(a.signature);
|
|
134
|
+
}))
|
|
135
|
+
? a.type
|
|
136
|
+
: null;
|
|
137
|
+
}
|
|
138
|
+
CKEDITOR.pasteFilters.image = function (a, c, b) {
|
|
139
|
+
if (c.activeFilter && !c.activeFilter.check('img[src]')) return a;
|
|
140
|
+
e = q(a);
|
|
141
|
+
return 0 === e.length ? a : b ? u(a, b, e) : v(c, a, e);
|
|
142
|
+
};
|
|
143
|
+
CKEDITOR.pasteFilters.image.format = u;
|
|
144
|
+
CKEDITOR.pasteFilters.image.formatBlob = v;
|
|
145
|
+
CKEDITOR.pasteFilters.image.extractFromRtf = l;
|
|
146
|
+
CKEDITOR.pasteFilters.image.extractTagsFromHtml = q;
|
|
147
|
+
CKEDITOR.pasteFilters.image.getImageType = t;
|
|
148
|
+
CKEDITOR.pasteFilters.image.createSrcWithBase64 = h;
|
|
149
|
+
CKEDITOR.pasteFilters.image.convertBlobUrlToBase64 = m;
|
|
150
|
+
CKEDITOR.pasteFilters.image.getImageTypeFromSignature = r;
|
|
151
|
+
CKEDITOR.pasteFilters.image.supportedImageTypes = ['image/png', 'image/jpeg', 'image/gif'];
|
|
152
|
+
CKEDITOR.pasteFilters.image.recognizableImageTypes = [
|
|
153
|
+
{ marker: /\\pngblip/, type: 'image/png' },
|
|
154
|
+
{ marker: /\\jpegblip/, type: 'image/jpeg' },
|
|
155
|
+
{ marker: /\\emfblip/, type: 'image/emf' },
|
|
156
|
+
{ marker: /\\wmetafile\d/, type: 'image/wmf' },
|
|
157
|
+
];
|
|
158
|
+
CKEDITOR.pasteFilters.image.recognizableImageSignatures = [
|
|
159
|
+
{ signature: 'ffd8ff', type: 'image/jpeg' },
|
|
160
|
+
{ signature: '47494638', type: 'image/gif' },
|
|
161
|
+
{ signature: '89504e47', type: 'image/png' },
|
|
162
|
+
];
|
|
163
|
+
})();
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plugin to enable placeholder tokens to be inserted into the CKEditor message. Use on its own or with teh placeholder plugin.
|
|
3
|
+
* The default format is compatible with the placeholders syntex
|
|
4
|
+
*
|
|
5
|
+
* @version 0.1
|
|
6
|
+
* @Author Troy Lutton
|
|
7
|
+
* @license MIT
|
|
8
|
+
*
|
|
9
|
+
* This is a pure modification for the placeholders plugin. All credit goes to Stuart Sillitoe for creating the original (stuartsillitoe.co.uk)
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
CKEDITOR.plugins.add('pdffile', {
|
|
14
|
+
icons: 'exporttopdf',
|
|
15
|
+
hidpi: true,
|
|
16
|
+
init: function (editor) {
|
|
17
|
+
// add the menu to the editor
|
|
18
|
+
|
|
19
|
+
editor.addCommand('exporttopdf', {
|
|
20
|
+
exec: function (editor) {
|
|
21
|
+
const html2pdf = editor.getCommand('html2pdf');
|
|
22
|
+
html2pdf
|
|
23
|
+
.Worker()
|
|
24
|
+
.from(editor.document.$.documentElement.outerHTML || '')
|
|
25
|
+
.save();
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
editor.ui.addButton('exporttopdf', {
|
|
30
|
+
label: 'Xuất tệp PDF',
|
|
31
|
+
command: 'exporttopdf',
|
|
32
|
+
className: 'pdffile',
|
|
33
|
+
toolbar: 'others',
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plugin to enable placeholder tokens to be inserted into the CKEditor message. Use on its own or with teh placeholder plugin.
|
|
3
|
+
* The default format is compatible with the placeholders syntex
|
|
4
|
+
*
|
|
5
|
+
* @version 0.1
|
|
6
|
+
* @Author Troy Lutton
|
|
7
|
+
* @license MIT
|
|
8
|
+
*
|
|
9
|
+
* This is a pure modification for the placeholders plugin. All credit goes to Stuart Sillitoe for creating the original (stuartsillitoe.co.uk)
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
CKEDITOR.plugins.add('placeholder_button', {
|
|
14
|
+
init: function (editor) {
|
|
15
|
+
// add the menu to the editor
|
|
16
|
+
|
|
17
|
+
editor.addCommand('placeholder_button', {
|
|
18
|
+
exec: function (editor) {
|
|
19
|
+
const openkeywordmodal = editor.getCommand('openkeywordmodal');
|
|
20
|
+
openkeywordmodal.handleOpen();
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
editor.ui.addButton('placeholder_button', {
|
|
25
|
+
label: 'Từ khóa',
|
|
26
|
+
command: 'placeholder_button',
|
|
27
|
+
className: 'placeholder_button',
|
|
28
|
+
toolbar: 'placeholder',
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
});
|