biso24-editor 1.3.0 → 1.3.2

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.
Files changed (53) hide show
  1. package/CKEditor4/CHANGES.md +2182 -2182
  2. package/CKEditor4/LICENSE.md +1436 -1436
  3. package/CKEditor4/README.md +39 -39
  4. package/CKEditor4/SECURITY.md +10 -10
  5. package/CKEditor4/adapters/jquery.js +158 -158
  6. package/CKEditor4/bender-runner.config.json +16 -16
  7. package/CKEditor4/build-config.js +100 -100
  8. package/CKEditor4/ckeditor.js +30065 -30065
  9. package/CKEditor4/config.js +39 -39
  10. package/CKEditor4/contents.css +161 -161
  11. package/CKEditor4/lang/vi.js +475 -475
  12. package/CKEditor4/plugins/a11yhelp/dialogs/a11yhelp.js +143 -143
  13. package/CKEditor4/plugins/a11yhelp/dialogs/lang/vi.js +122 -122
  14. package/CKEditor4/plugins/custompaste/plugin.js +57 -57
  15. package/CKEditor4/plugins/dialog/dialogDefinition.js +4 -4
  16. package/CKEditor4/plugins/dialog/styles/dialog.css +18 -18
  17. package/CKEditor4/plugins/font/lang/vi.js +14 -14
  18. package/CKEditor4/plugins/font/plugin.js +535 -535
  19. package/CKEditor4/plugins/image2/dialogs/image2.js +558 -558
  20. package/CKEditor4/plugins/image2/lang/vi.js +21 -21
  21. package/CKEditor4/plugins/image2/plugin.js +1716 -1708
  22. package/CKEditor4/plugins/justify/plugin.js +266 -266
  23. package/CKEditor4/plugins/justify_group/plugin.js +64 -64
  24. package/CKEditor4/plugins/lineheight/LICENSE +22 -22
  25. package/CKEditor4/plugins/lineheight/README.md +2 -2
  26. package/CKEditor4/plugins/lineheight/lang/vi.js +3 -3
  27. package/CKEditor4/plugins/lineheight/plugin.js +99 -99
  28. package/CKEditor4/plugins/lineheight/readme.txt +30 -30
  29. package/CKEditor4/plugins/link/dialogs/anchor.js +82 -82
  30. package/CKEditor4/plugins/link/dialogs/link.js +777 -777
  31. package/CKEditor4/plugins/menubutton/plugin.js +99 -99
  32. package/CKEditor4/plugins/pastefromword/filter/default.js +849 -849
  33. package/CKEditor4/plugins/pastetools/filter/common.js +445 -445
  34. package/CKEditor4/plugins/pastetools/filter/image.js +163 -163
  35. package/CKEditor4/plugins/pdffile/plugin.js +36 -36
  36. package/CKEditor4/plugins/placeholder_button/plugin.js +31 -31
  37. package/CKEditor4/plugins/sourcedialog/dialogs/sourcedialog.js +88 -88
  38. package/CKEditor4/plugins/sourcedialog/lang/vi.js +9 -9
  39. package/CKEditor4/plugins/sourcedialog/plugin.js +30 -30
  40. package/CKEditor4/plugins/wordfile/plugin.js +161 -161
  41. package/CKEditor4/skins/moono-lisa/dialog.css +685 -685
  42. package/CKEditor4/skins/moono-lisa/dialog_ie.css +721 -721
  43. package/CKEditor4/skins/moono-lisa/dialog_ie8.css +746 -746
  44. package/CKEditor4/skins/moono-lisa/dialog_iequirks.css +724 -724
  45. package/CKEditor4/skins/moono-lisa/editor.css +1551 -1551
  46. package/CKEditor4/skins/moono-lisa/editor_gecko.css +1556 -1556
  47. package/CKEditor4/skins/moono-lisa/editor_ie.css +1588 -1588
  48. package/CKEditor4/skins/moono-lisa/editor_ie8.css +1639 -1639
  49. package/CKEditor4/skins/moono-lisa/editor_iequirks.css +1632 -1632
  50. package/CKEditor4/skins/moono-lisa/readme.md +46 -46
  51. package/CKEditor4/styles.js +136 -136
  52. package/CKEditor4/vendor/promise.js +385 -385
  53. package/package.json +1 -1
@@ -1,445 +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
- })();
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
+ })();