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.
- package/CKEditor4/CHANGES.md +2182 -2182
- package/CKEditor4/LICENSE.md +1436 -1436
- package/CKEditor4/README.md +39 -39
- package/CKEditor4/SECURITY.md +10 -10
- package/CKEditor4/adapters/jquery.js +158 -158
- package/CKEditor4/bender-runner.config.json +16 -16
- package/CKEditor4/build-config.js +100 -100
- package/CKEditor4/ckeditor.js +30065 -30065
- package/CKEditor4/config.js +39 -39
- package/CKEditor4/contents.css +161 -161
- package/CKEditor4/lang/vi.js +475 -475
- package/CKEditor4/plugins/a11yhelp/dialogs/a11yhelp.js +143 -143
- package/CKEditor4/plugins/a11yhelp/dialogs/lang/vi.js +122 -122
- package/CKEditor4/plugins/custompaste/plugin.js +57 -57
- package/CKEditor4/plugins/dialog/dialogDefinition.js +4 -4
- package/CKEditor4/plugins/dialog/styles/dialog.css +18 -18
- package/CKEditor4/plugins/font/lang/vi.js +14 -14
- package/CKEditor4/plugins/font/plugin.js +535 -535
- package/CKEditor4/plugins/image2/dialogs/image2.js +558 -558
- package/CKEditor4/plugins/image2/lang/vi.js +21 -21
- package/CKEditor4/plugins/image2/plugin.js +1716 -1708
- package/CKEditor4/plugins/justify/plugin.js +266 -266
- package/CKEditor4/plugins/justify_group/plugin.js +64 -64
- package/CKEditor4/plugins/lineheight/LICENSE +22 -22
- package/CKEditor4/plugins/lineheight/README.md +2 -2
- package/CKEditor4/plugins/lineheight/lang/vi.js +3 -3
- package/CKEditor4/plugins/lineheight/plugin.js +99 -99
- package/CKEditor4/plugins/lineheight/readme.txt +30 -30
- package/CKEditor4/plugins/link/dialogs/anchor.js +82 -82
- package/CKEditor4/plugins/link/dialogs/link.js +777 -777
- package/CKEditor4/plugins/menubutton/plugin.js +99 -99
- package/CKEditor4/plugins/pastefromword/filter/default.js +849 -849
- package/CKEditor4/plugins/pastetools/filter/common.js +445 -445
- package/CKEditor4/plugins/pastetools/filter/image.js +163 -163
- package/CKEditor4/plugins/pdffile/plugin.js +36 -36
- package/CKEditor4/plugins/placeholder_button/plugin.js +31 -31
- package/CKEditor4/plugins/sourcedialog/dialogs/sourcedialog.js +88 -88
- package/CKEditor4/plugins/sourcedialog/lang/vi.js +9 -9
- package/CKEditor4/plugins/sourcedialog/plugin.js +30 -30
- package/CKEditor4/plugins/wordfile/plugin.js +161 -161
- package/CKEditor4/skins/moono-lisa/dialog.css +685 -685
- package/CKEditor4/skins/moono-lisa/dialog_ie.css +721 -721
- package/CKEditor4/skins/moono-lisa/dialog_ie8.css +746 -746
- package/CKEditor4/skins/moono-lisa/dialog_iequirks.css +724 -724
- package/CKEditor4/skins/moono-lisa/editor.css +1551 -1551
- package/CKEditor4/skins/moono-lisa/editor_gecko.css +1556 -1556
- package/CKEditor4/skins/moono-lisa/editor_ie.css +1588 -1588
- package/CKEditor4/skins/moono-lisa/editor_ie8.css +1639 -1639
- package/CKEditor4/skins/moono-lisa/editor_iequirks.css +1632 -1632
- package/CKEditor4/skins/moono-lisa/readme.md +46 -46
- package/CKEditor4/styles.js +136 -136
- package/CKEditor4/vendor/promise.js +385 -385
- package/package.json +1 -1
|
@@ -1,849 +1,849 @@
|
|
|
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 r() {
|
|
7
|
-
return !1;
|
|
8
|
-
}
|
|
9
|
-
var n = CKEDITOR.tools,
|
|
10
|
-
B = CKEDITOR.plugins.pastetools,
|
|
11
|
-
t = B.filters.common,
|
|
12
|
-
k = t.styles,
|
|
13
|
-
C = t.createAttributeStack,
|
|
14
|
-
z = t.lists.getElementIndentation,
|
|
15
|
-
D = ['o:p', 'xml', 'script', 'meta', 'link'],
|
|
16
|
-
E = 'v:arc v:curve v:line v:oval v:polyline v:rect v:roundrect v:group'.split(' '),
|
|
17
|
-
A = {},
|
|
18
|
-
y = 0,
|
|
19
|
-
q = {},
|
|
20
|
-
g,
|
|
21
|
-
p;
|
|
22
|
-
CKEDITOR.plugins.pastetools.filters.word = q;
|
|
23
|
-
CKEDITOR.plugins.pastefromword = q;
|
|
24
|
-
q.rules = function (c, b, d) {
|
|
25
|
-
function e(a) {
|
|
26
|
-
(a.attributes['o:gfxdata'] || 'v:group' === a.parent.name) && l.push(a.attributes.id);
|
|
27
|
-
}
|
|
28
|
-
var f = Boolean(c.match(/mso-list:\s*l\d+\s+level\d+\s+lfo\d+/)),
|
|
29
|
-
l = [],
|
|
30
|
-
w = {
|
|
31
|
-
root: function (a) {
|
|
32
|
-
a.filterChildren(d);
|
|
33
|
-
CKEDITOR.plugins.pastefromword.lists.cleanup(g.createLists(a));
|
|
34
|
-
},
|
|
35
|
-
elementNames: [
|
|
36
|
-
[/^\?xml:namespace$/, ''],
|
|
37
|
-
[/^v:shapetype/, ''],
|
|
38
|
-
[new RegExp(D.join('|')), ''],
|
|
39
|
-
],
|
|
40
|
-
elements: {
|
|
41
|
-
a: function (a) {
|
|
42
|
-
if (a.attributes.name) {
|
|
43
|
-
if ('_GoBack' == a.attributes.name) {
|
|
44
|
-
delete a.name;
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (a.attributes.name.match(/^OLE_LINK\d+$/)) {
|
|
48
|
-
delete a.name;
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (a.attributes.href && a.attributes.href.match(/#.+$/)) {
|
|
53
|
-
var b = a.attributes.href.match(/#(.+)$/)[1];
|
|
54
|
-
A[b] = a;
|
|
55
|
-
}
|
|
56
|
-
a.attributes.name &&
|
|
57
|
-
A[a.attributes.name] &&
|
|
58
|
-
((a = A[a.attributes.name]), (a.attributes.href = a.attributes.href.replace(/.*#(.*)$/, '#$1')));
|
|
59
|
-
},
|
|
60
|
-
div: function (a) {
|
|
61
|
-
if (b.plugins.pagebreak && a.attributes['data-cke-pagebreak']) return a;
|
|
62
|
-
k.createStyleStack(a, d, b);
|
|
63
|
-
},
|
|
64
|
-
img: function (a) {
|
|
65
|
-
if (a.parent && a.parent.attributes) {
|
|
66
|
-
var b = a.parent.attributes;
|
|
67
|
-
(b = b.style || b.STYLE) && b.match(/mso\-list:\s?Ignore/) && (a.attributes['cke-ignored'] = !0);
|
|
68
|
-
}
|
|
69
|
-
k.mapCommonStyles(a);
|
|
70
|
-
a.attributes.src &&
|
|
71
|
-
a.attributes.src.match(/^file:\/\//) &&
|
|
72
|
-
a.attributes.alt &&
|
|
73
|
-
a.attributes.alt.match(/^https?:\/\//) &&
|
|
74
|
-
(a.attributes.src = a.attributes.alt);
|
|
75
|
-
a = a.attributes['v:shapes'] ? a.attributes['v:shapes'].split(' ') : [];
|
|
76
|
-
b = CKEDITOR.tools.array.every(a, function (a) {
|
|
77
|
-
return -1 < l.indexOf(a);
|
|
78
|
-
});
|
|
79
|
-
if (a.length && b) return !1;
|
|
80
|
-
},
|
|
81
|
-
p: function (a) {
|
|
82
|
-
a.filterChildren(d);
|
|
83
|
-
if (a.attributes.style && a.attributes.style.match(/display:\s*none/i)) return !1;
|
|
84
|
-
if (g.thisIsAListItem(b, a))
|
|
85
|
-
p.isEdgeListItem(b, a) && p.cleanupEdgeListItem(a),
|
|
86
|
-
g.convertToFakeListItem(b, a),
|
|
87
|
-
n.array.reduce(
|
|
88
|
-
a.children,
|
|
89
|
-
function (a, b) {
|
|
90
|
-
'p' === b.name &&
|
|
91
|
-
(0 < a && new CKEDITOR.htmlParser.element('br').insertBefore(b),
|
|
92
|
-
b.replaceWithChildren(),
|
|
93
|
-
(a += 1));
|
|
94
|
-
return a;
|
|
95
|
-
},
|
|
96
|
-
0,
|
|
97
|
-
);
|
|
98
|
-
else {
|
|
99
|
-
var c = a.getAscendant(function (a) {
|
|
100
|
-
return 'ul' == a.name || 'ol' == a.name;
|
|
101
|
-
}),
|
|
102
|
-
f = n.parseCssText(a.attributes.style);
|
|
103
|
-
c &&
|
|
104
|
-
!c.attributes['cke-list-level'] &&
|
|
105
|
-
f['mso-list'] &&
|
|
106
|
-
f['mso-list'].match(/level/) &&
|
|
107
|
-
(c.attributes['cke-list-level'] = f['mso-list'].match(/level(\d+)/)[1]);
|
|
108
|
-
b.config.enterMode == CKEDITOR.ENTER_BR && (delete a.name, a.add(new CKEDITOR.htmlParser.element('br')));
|
|
109
|
-
}
|
|
110
|
-
k.createStyleStack(a, d, b);
|
|
111
|
-
},
|
|
112
|
-
pre: function (a) {
|
|
113
|
-
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
114
|
-
k.createStyleStack(a, d, b);
|
|
115
|
-
},
|
|
116
|
-
h1: function (a) {
|
|
117
|
-
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
118
|
-
k.createStyleStack(a, d, b);
|
|
119
|
-
},
|
|
120
|
-
h2: function (a) {
|
|
121
|
-
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
122
|
-
k.createStyleStack(a, d, b);
|
|
123
|
-
},
|
|
124
|
-
h3: function (a) {
|
|
125
|
-
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
126
|
-
k.createStyleStack(a, d, b);
|
|
127
|
-
},
|
|
128
|
-
h4: function (a) {
|
|
129
|
-
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
130
|
-
k.createStyleStack(a, d, b);
|
|
131
|
-
},
|
|
132
|
-
h5: function (a) {
|
|
133
|
-
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
134
|
-
k.createStyleStack(a, d, b);
|
|
135
|
-
},
|
|
136
|
-
h6: function (a) {
|
|
137
|
-
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
138
|
-
k.createStyleStack(a, d, b);
|
|
139
|
-
},
|
|
140
|
-
font: function (a) {
|
|
141
|
-
if (a.getHtml().match(/^\s*$/))
|
|
142
|
-
return a.parent.type === CKEDITOR.NODE_ELEMENT && new CKEDITOR.htmlParser.text(' ').insertAfter(a), !1;
|
|
143
|
-
b && !0 === b.config.pasteFromWordRemoveFontStyles && a.attributes.size && delete a.attributes.size;
|
|
144
|
-
CKEDITOR.dtd.tr[a.parent.name] &&
|
|
145
|
-
CKEDITOR.tools.arrayCompare(CKEDITOR.tools.object.keys(a.attributes), ['class', 'style'])
|
|
146
|
-
? k.createStyleStack(a, d, b)
|
|
147
|
-
: C(a, d);
|
|
148
|
-
},
|
|
149
|
-
ul: function (a) {
|
|
150
|
-
if (f)
|
|
151
|
-
return (
|
|
152
|
-
'li' == a.parent.name &&
|
|
153
|
-
0 === n.indexOf(a.parent.children, a) &&
|
|
154
|
-
k.setStyle(a.parent, 'list-style-type', 'none'),
|
|
155
|
-
g.dissolveList(a),
|
|
156
|
-
!1
|
|
157
|
-
);
|
|
158
|
-
},
|
|
159
|
-
li: function (a) {
|
|
160
|
-
p.correctLevelShift(a);
|
|
161
|
-
f && ((a.attributes.style = k.normalizedStyles(a, b)), k.pushStylesLower(a));
|
|
162
|
-
},
|
|
163
|
-
ol: function (a) {
|
|
164
|
-
if (f)
|
|
165
|
-
return (
|
|
166
|
-
'li' == a.parent.name &&
|
|
167
|
-
0 === n.indexOf(a.parent.children, a) &&
|
|
168
|
-
k.setStyle(a.parent, 'list-style-type', 'none'),
|
|
169
|
-
g.dissolveList(a),
|
|
170
|
-
!1
|
|
171
|
-
);
|
|
172
|
-
},
|
|
173
|
-
span: function (a) {
|
|
174
|
-
a.filterChildren(d);
|
|
175
|
-
a.attributes.style = k.normalizedStyles(a, b);
|
|
176
|
-
if (
|
|
177
|
-
!a.attributes.style ||
|
|
178
|
-
a.attributes.style.match(/^mso\-bookmark:OLE_LINK\d+$/) ||
|
|
179
|
-
a.getHtml().match(/^(\s| )+$/)
|
|
180
|
-
)
|
|
181
|
-
return t.elements.replaceWithChildren(a), !1;
|
|
182
|
-
a.attributes.style.match(/FONT-FAMILY:\s*Symbol/i) &&
|
|
183
|
-
a.forEach(
|
|
184
|
-
function (a) {
|
|
185
|
-
a.value = a.value.replace(/ /g, '');
|
|
186
|
-
},
|
|
187
|
-
CKEDITOR.NODE_TEXT,
|
|
188
|
-
!0,
|
|
189
|
-
);
|
|
190
|
-
k.createStyleStack(a, d, b);
|
|
191
|
-
},
|
|
192
|
-
'v:imagedata': r,
|
|
193
|
-
'v:shape': function (a) {
|
|
194
|
-
var b = !1;
|
|
195
|
-
if (null === a.getFirst('v:imagedata')) e(a);
|
|
196
|
-
else {
|
|
197
|
-
a.parent.find(function (c) {
|
|
198
|
-
'img' == c.name && c.attributes && c.attributes['v:shapes'] == a.attributes.id && (b = !0);
|
|
199
|
-
}, !0);
|
|
200
|
-
if (b) return !1;
|
|
201
|
-
var c = '';
|
|
202
|
-
'v:group' === a.parent.name
|
|
203
|
-
? e(a)
|
|
204
|
-
: (a.forEach(
|
|
205
|
-
function (a) {
|
|
206
|
-
a.attributes && a.attributes.src && (c = a.attributes.src);
|
|
207
|
-
},
|
|
208
|
-
CKEDITOR.NODE_ELEMENT,
|
|
209
|
-
!0,
|
|
210
|
-
),
|
|
211
|
-
a.filterChildren(d),
|
|
212
|
-
(a.name = 'img'),
|
|
213
|
-
(a.attributes.src = a.attributes.src || c),
|
|
214
|
-
delete a.attributes.type);
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
style: function () {
|
|
218
|
-
return !1;
|
|
219
|
-
},
|
|
220
|
-
object: function (a) {
|
|
221
|
-
return !(!a.attributes || !a.attributes.data);
|
|
222
|
-
},
|
|
223
|
-
br: function (a) {
|
|
224
|
-
if (
|
|
225
|
-
b.plugins.pagebreak &&
|
|
226
|
-
((a = n.parseCssText(a.attributes.style, !0)),
|
|
227
|
-
'always' === a['page-break-before'] || 'page' === a['break-before'])
|
|
228
|
-
)
|
|
229
|
-
return (
|
|
230
|
-
(a = CKEDITOR.plugins.pagebreak.createElement(b)),
|
|
231
|
-
CKEDITOR.htmlParser.fragment.fromHtml(a.getOuterHtml()).children[0]
|
|
232
|
-
);
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
attributes: {
|
|
236
|
-
style: function (a, c) {
|
|
237
|
-
return k.normalizedStyles(c, b) || !1;
|
|
238
|
-
},
|
|
239
|
-
class: function (a) {
|
|
240
|
-
a = a.replace(/(el\d+)|(font\d+)|msonormal|msolistparagraph\w*/gi, '');
|
|
241
|
-
return '' === a ? !1 : a;
|
|
242
|
-
},
|
|
243
|
-
cellspacing: r,
|
|
244
|
-
cellpadding: r,
|
|
245
|
-
border: r,
|
|
246
|
-
'v:shapes': r,
|
|
247
|
-
'o:spid': r,
|
|
248
|
-
},
|
|
249
|
-
comment: function (a) {
|
|
250
|
-
a.match(/\[if.* supportFields.*\]/) && y++;
|
|
251
|
-
'[endif]' == a && (y = 0 < y ? y - 1 : 0);
|
|
252
|
-
return !1;
|
|
253
|
-
},
|
|
254
|
-
text: function (a, b) {
|
|
255
|
-
if (y) return '';
|
|
256
|
-
var c = b.parent && b.parent.parent;
|
|
257
|
-
return c && c.attributes && c.attributes.style && c.attributes.style.match(/mso-list:\s*ignore/i)
|
|
258
|
-
? a.replace(/ /g, ' ')
|
|
259
|
-
: a;
|
|
260
|
-
},
|
|
261
|
-
};
|
|
262
|
-
n.array.forEach(E, function (a) {
|
|
263
|
-
w.elements[a] = e;
|
|
264
|
-
});
|
|
265
|
-
return w;
|
|
266
|
-
};
|
|
267
|
-
q.lists = {
|
|
268
|
-
thisIsAListItem: function (c, b) {
|
|
269
|
-
return p.isEdgeListItem(c, b) ||
|
|
270
|
-
(b.attributes.style && b.attributes.style.match(/mso\-list:\s?l\d/) && 'li' !== b.parent.name) ||
|
|
271
|
-
b.attributes['cke-dissolved'] ||
|
|
272
|
-
b.getHtml().match(/<!\-\-\[if !supportLists]\-\->/)
|
|
273
|
-
? !0
|
|
274
|
-
: !1;
|
|
275
|
-
},
|
|
276
|
-
convertToFakeListItem: function (c, b) {
|
|
277
|
-
p.isDegenerateListItem(c, b) && p.assignListLevels(c, b);
|
|
278
|
-
this.getListItemInfo(b);
|
|
279
|
-
if (!b.attributes['cke-dissolved']) {
|
|
280
|
-
var d;
|
|
281
|
-
b.forEach(function (b) {
|
|
282
|
-
!d && 'img' == b.name && b.attributes['cke-ignored'] && '*' == b.attributes.alt && ((d = '·'), b.remove());
|
|
283
|
-
}, CKEDITOR.NODE_ELEMENT);
|
|
284
|
-
b.forEach(function (b) {
|
|
285
|
-
d || b.value.match(/^ /) || (d = b.value);
|
|
286
|
-
}, CKEDITOR.NODE_TEXT);
|
|
287
|
-
if ('undefined' == typeof d) return;
|
|
288
|
-
b.attributes['cke-symbol'] = d.replace(/(?: | ).*$/, '');
|
|
289
|
-
g.removeSymbolText(b);
|
|
290
|
-
}
|
|
291
|
-
var e = b.attributes && n.parseCssText(b.attributes.style);
|
|
292
|
-
if (e['margin-left']) {
|
|
293
|
-
var f = e['margin-left'],
|
|
294
|
-
l = b.attributes['cke-list-level'];
|
|
295
|
-
(f = Math.max(CKEDITOR.tools.convertToPx(f) - 40 * l, 0))
|
|
296
|
-
? (e['margin-left'] = f + 'px')
|
|
297
|
-
: delete e['margin-left'];
|
|
298
|
-
b.attributes.style = CKEDITOR.tools.writeCssText(e);
|
|
299
|
-
}
|
|
300
|
-
b.name = 'cke:li';
|
|
301
|
-
},
|
|
302
|
-
convertToRealListItems: function (c) {
|
|
303
|
-
var b = [];
|
|
304
|
-
c.forEach(
|
|
305
|
-
function (c) {
|
|
306
|
-
'cke:li' == c.name && ((c.name = 'li'), b.push(c));
|
|
307
|
-
},
|
|
308
|
-
CKEDITOR.NODE_ELEMENT,
|
|
309
|
-
!1,
|
|
310
|
-
);
|
|
311
|
-
return b;
|
|
312
|
-
},
|
|
313
|
-
removeSymbolText: function (c) {
|
|
314
|
-
var b = c.attributes['cke-symbol'],
|
|
315
|
-
d = c.findOne(function (c) {
|
|
316
|
-
return c.value && -1 < c.value.indexOf(b);
|
|
317
|
-
}, !0),
|
|
318
|
-
e;
|
|
319
|
-
d &&
|
|
320
|
-
((d.value = d.value.replace(b, '')),
|
|
321
|
-
(e = d.parent),
|
|
322
|
-
e.getHtml().match(/^(\s| )*$/) && e !== c ? e.remove() : d.value || d.remove());
|
|
323
|
-
},
|
|
324
|
-
setListSymbol: function (c, b, d) {
|
|
325
|
-
d = d || 1;
|
|
326
|
-
var e = n.parseCssText(c.attributes.style);
|
|
327
|
-
if ('ol' == c.name) {
|
|
328
|
-
if (c.attributes.type || e['list-style-type']) return;
|
|
329
|
-
var f = {
|
|
330
|
-
'[ivx]': 'lower-roman',
|
|
331
|
-
'[IVX]': 'upper-roman',
|
|
332
|
-
'[a-z]': 'lower-alpha',
|
|
333
|
-
'[A-Z]': 'upper-alpha',
|
|
334
|
-
'\\d': 'decimal',
|
|
335
|
-
},
|
|
336
|
-
l;
|
|
337
|
-
for (l in f)
|
|
338
|
-
if (g.getSubsectionSymbol(b).match(new RegExp(l))) {
|
|
339
|
-
e['list-style-type'] = f[l];
|
|
340
|
-
break;
|
|
341
|
-
}
|
|
342
|
-
c.attributes['cke-list-style-type'] = e['list-style-type'];
|
|
343
|
-
} else
|
|
344
|
-
(f = { '·': 'disc', o: 'circle', '§': 'square' }),
|
|
345
|
-
!e['list-style-type'] && f[b] && (e['list-style-type'] = f[b]);
|
|
346
|
-
g.setListSymbol.removeRedundancies(e, d);
|
|
347
|
-
(c.attributes.style = CKEDITOR.tools.writeCssText(e)) || delete c.attributes.style;
|
|
348
|
-
},
|
|
349
|
-
setListStart: function (c) {
|
|
350
|
-
for (var b = [], d = 0, e = 0; e < c.children.length; e++) b.push(c.children[e].attributes['cke-symbol'] || '');
|
|
351
|
-
b[0] || d++;
|
|
352
|
-
switch (c.attributes['cke-list-style-type']) {
|
|
353
|
-
case 'lower-roman':
|
|
354
|
-
case 'upper-roman':
|
|
355
|
-
c.attributes.start = g.toArabic(g.getSubsectionSymbol(b[d])) - d;
|
|
356
|
-
break;
|
|
357
|
-
case 'lower-alpha':
|
|
358
|
-
case 'upper-alpha':
|
|
359
|
-
c.attributes.start = g.getSubsectionSymbol(b[d]).replace(/\W/g, '').toLowerCase().charCodeAt(0) - 96 - d;
|
|
360
|
-
break;
|
|
361
|
-
case 'decimal':
|
|
362
|
-
c.attributes.start = parseInt(g.getSubsectionSymbol(b[d]), 10) - d || 1;
|
|
363
|
-
}
|
|
364
|
-
'1' == c.attributes.start && delete c.attributes.start;
|
|
365
|
-
delete c.attributes['cke-list-style-type'];
|
|
366
|
-
},
|
|
367
|
-
numbering: {
|
|
368
|
-
toNumber: function (c, b) {
|
|
369
|
-
function d(b) {
|
|
370
|
-
b = b.toUpperCase();
|
|
371
|
-
for (var c = 1, d = 1; 0 < b.length; d *= 26)
|
|
372
|
-
(c += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.indexOf(b.charAt(b.length - 1)) * d), (b = b.substr(0, b.length - 1));
|
|
373
|
-
return c;
|
|
374
|
-
}
|
|
375
|
-
function e(b) {
|
|
376
|
-
var c = [
|
|
377
|
-
[1e3, 'M'],
|
|
378
|
-
[900, 'CM'],
|
|
379
|
-
[500, 'D'],
|
|
380
|
-
[400, 'CD'],
|
|
381
|
-
[100, 'C'],
|
|
382
|
-
[90, 'XC'],
|
|
383
|
-
[50, 'L'],
|
|
384
|
-
[40, 'XL'],
|
|
385
|
-
[10, 'X'],
|
|
386
|
-
[9, 'IX'],
|
|
387
|
-
[5, 'V'],
|
|
388
|
-
[4, 'IV'],
|
|
389
|
-
[1, 'I'],
|
|
390
|
-
];
|
|
391
|
-
b = b.toUpperCase();
|
|
392
|
-
for (var d = c.length, a = 0, e = 0; e < d; ++e)
|
|
393
|
-
for (var g = c[e], u = g[1].length; b.substr(0, u) == g[1]; b = b.substr(u)) a += g[0];
|
|
394
|
-
return a;
|
|
395
|
-
}
|
|
396
|
-
return 'decimal' == b
|
|
397
|
-
? Number(c)
|
|
398
|
-
: 'upper-roman' == b || 'lower-roman' == b
|
|
399
|
-
? e(c.toUpperCase())
|
|
400
|
-
: 'lower-alpha' == b || 'upper-alpha' == b
|
|
401
|
-
? d(c)
|
|
402
|
-
: 1;
|
|
403
|
-
},
|
|
404
|
-
getStyle: function (c) {
|
|
405
|
-
c = c.slice(0, 1);
|
|
406
|
-
var b = {
|
|
407
|
-
i: 'lower-roman',
|
|
408
|
-
v: 'lower-roman',
|
|
409
|
-
x: 'lower-roman',
|
|
410
|
-
l: 'lower-roman',
|
|
411
|
-
m: 'lower-roman',
|
|
412
|
-
I: 'upper-roman',
|
|
413
|
-
V: 'upper-roman',
|
|
414
|
-
X: 'upper-roman',
|
|
415
|
-
L: 'upper-roman',
|
|
416
|
-
M: 'upper-roman',
|
|
417
|
-
}[c];
|
|
418
|
-
b || ((b = 'decimal'), c.match(/[a-z]/) && (b = 'lower-alpha'), c.match(/[A-Z]/) && (b = 'upper-alpha'));
|
|
419
|
-
return b;
|
|
420
|
-
},
|
|
421
|
-
},
|
|
422
|
-
getSubsectionSymbol: function (c) {
|
|
423
|
-
return (c.match(/([\da-zA-Z]+).?$/) || ['placeholder', '1'])[1];
|
|
424
|
-
},
|
|
425
|
-
setListDir: function (c) {
|
|
426
|
-
var b = 0,
|
|
427
|
-
d = 0;
|
|
428
|
-
c.forEach(function (c) {
|
|
429
|
-
'li' == c.name && ('rtl' == (c.attributes.dir || c.attributes.DIR || '').toLowerCase() ? d++ : b++);
|
|
430
|
-
}, CKEDITOR.ELEMENT_NODE);
|
|
431
|
-
d > b && (c.attributes.dir = 'rtl');
|
|
432
|
-
},
|
|
433
|
-
createList: function (c) {
|
|
434
|
-
return (c.attributes['cke-symbol'].match(/([\da-np-zA-NP-Z]).?/) || [])[1]
|
|
435
|
-
? new CKEDITOR.htmlParser.element('ol')
|
|
436
|
-
: new CKEDITOR.htmlParser.element('ul');
|
|
437
|
-
},
|
|
438
|
-
createLists: function (c) {
|
|
439
|
-
function b(b) {
|
|
440
|
-
return CKEDITOR.tools.array.reduce(
|
|
441
|
-
b,
|
|
442
|
-
function (b, a) {
|
|
443
|
-
if (a.attributes && a.attributes.style)
|
|
444
|
-
var c = CKEDITOR.tools.parseCssText(a.attributes.style)['margin-left'];
|
|
445
|
-
return c ? b + parseInt(c, 10) : b;
|
|
446
|
-
},
|
|
447
|
-
0,
|
|
448
|
-
);
|
|
449
|
-
}
|
|
450
|
-
var d,
|
|
451
|
-
e,
|
|
452
|
-
f,
|
|
453
|
-
l = g.convertToRealListItems(c);
|
|
454
|
-
if (0 === l.length) return [];
|
|
455
|
-
var k = g.groupLists(l);
|
|
456
|
-
for (c = 0; c < k.length; c++) {
|
|
457
|
-
var a = k[c],
|
|
458
|
-
h = a[0];
|
|
459
|
-
for (f = 0; f < a.length; f++)
|
|
460
|
-
if (1 == a[f].attributes['cke-list-level']) {
|
|
461
|
-
h = a[f];
|
|
462
|
-
break;
|
|
463
|
-
}
|
|
464
|
-
var h = [g.createList(h)],
|
|
465
|
-
m = h[0],
|
|
466
|
-
u = [h[0]];
|
|
467
|
-
m.insertBefore(a[0]);
|
|
468
|
-
for (f = 0; f < a.length; f++) {
|
|
469
|
-
d = a[f];
|
|
470
|
-
for (e = d.attributes['cke-list-level']; e > h.length; ) {
|
|
471
|
-
var v = g.createList(d),
|
|
472
|
-
x = m.children;
|
|
473
|
-
0 < x.length
|
|
474
|
-
? x[x.length - 1].add(v)
|
|
475
|
-
: ((x = new CKEDITOR.htmlParser.element('li', { style: 'list-style-type:none' })), x.add(v), m.add(x));
|
|
476
|
-
h.push(v);
|
|
477
|
-
u.push(v);
|
|
478
|
-
m = v;
|
|
479
|
-
e == h.length && g.setListSymbol(v, d.attributes['cke-symbol'], e);
|
|
480
|
-
}
|
|
481
|
-
for (; e < h.length; )
|
|
482
|
-
h.pop(), (m = h[h.length - 1]), e == h.length && g.setListSymbol(m, d.attributes['cke-symbol'], e);
|
|
483
|
-
d.remove();
|
|
484
|
-
m.add(d);
|
|
485
|
-
}
|
|
486
|
-
h[0].children.length &&
|
|
487
|
-
((f = h[0].children[0].attributes['cke-symbol']),
|
|
488
|
-
!f && 1 < h[0].children.length && (f = h[0].children[1].attributes['cke-symbol']),
|
|
489
|
-
f && g.setListSymbol(h[0], f));
|
|
490
|
-
for (f = 0; f < u.length; f++) g.setListStart(u[f]);
|
|
491
|
-
for (f = 0; f < a.length; f++) this.determineListItemValue(a[f]);
|
|
492
|
-
}
|
|
493
|
-
CKEDITOR.tools.array.forEach(l, function (a) {
|
|
494
|
-
for (var c = [], d = a.parent; d; ) 'li' === d.name && c.push(d), (d = d.parent);
|
|
495
|
-
var c = b(c),
|
|
496
|
-
e;
|
|
497
|
-
c &&
|
|
498
|
-
((a.attributes = a.attributes || {}),
|
|
499
|
-
(d = CKEDITOR.tools.parseCssText(a.attributes.style)),
|
|
500
|
-
(e = d['margin-left'] || 0),
|
|
501
|
-
(e = Math.max(parseInt(e, 10) - c, 0)) ? (d['margin-left'] = e + 'px') : delete d['margin-left'],
|
|
502
|
-
(a.attributes.style = CKEDITOR.tools.writeCssText(d)));
|
|
503
|
-
});
|
|
504
|
-
return l;
|
|
505
|
-
},
|
|
506
|
-
cleanup: function (c) {
|
|
507
|
-
var b = ['cke-list-level', 'cke-symbol', 'cke-list-id', 'cke-indentation', 'cke-dissolved'],
|
|
508
|
-
d,
|
|
509
|
-
e;
|
|
510
|
-
for (d = 0; d < c.length; d++) for (e = 0; e < b.length; e++) delete c[d].attributes[b[e]];
|
|
511
|
-
},
|
|
512
|
-
determineListItemValue: function (c) {
|
|
513
|
-
if ('ol' === c.parent.name) {
|
|
514
|
-
var b = this.calculateValue(c),
|
|
515
|
-
d = c.attributes['cke-symbol'].match(/[a-z0-9]+/gi),
|
|
516
|
-
e;
|
|
517
|
-
d &&
|
|
518
|
-
((d = d[d.length - 1]),
|
|
519
|
-
(e = c.parent.attributes['cke-list-style-type'] || this.numbering.getStyle(d)),
|
|
520
|
-
(d = this.numbering.toNumber(d, e)),
|
|
521
|
-
d !== b && (c.attributes.value = d));
|
|
522
|
-
}
|
|
523
|
-
},
|
|
524
|
-
calculateValue: function (c) {
|
|
525
|
-
if (!c.parent) return 1;
|
|
526
|
-
var b = c.parent;
|
|
527
|
-
c = c.getIndex();
|
|
528
|
-
var d = null,
|
|
529
|
-
e,
|
|
530
|
-
f,
|
|
531
|
-
g;
|
|
532
|
-
for (g = c; 0 <= g && null === d; g--)
|
|
533
|
-
(f = b.children[g]),
|
|
534
|
-
f.attributes && void 0 !== f.attributes.value && ((e = g), (d = parseInt(f.attributes.value, 10)));
|
|
535
|
-
null === d && ((d = void 0 !== b.attributes.start ? parseInt(b.attributes.start, 10) : 1), (e = 0));
|
|
536
|
-
return d + (c - e);
|
|
537
|
-
},
|
|
538
|
-
dissolveList: function (c) {
|
|
539
|
-
function b(a) {
|
|
540
|
-
return 50 <= a
|
|
541
|
-
? 'l' + b(a - 50)
|
|
542
|
-
: 40 <= a
|
|
543
|
-
? 'xl' + b(a - 40)
|
|
544
|
-
: 10 <= a
|
|
545
|
-
? 'x' + b(a - 10)
|
|
546
|
-
: 9 == a
|
|
547
|
-
? 'ix'
|
|
548
|
-
: 5 <= a
|
|
549
|
-
? 'v' + b(a - 5)
|
|
550
|
-
: 4 == a
|
|
551
|
-
? 'iv'
|
|
552
|
-
: 1 <= a
|
|
553
|
-
? 'i' + b(a - 1)
|
|
554
|
-
: '';
|
|
555
|
-
}
|
|
556
|
-
function d(a, b) {
|
|
557
|
-
function c(b, d) {
|
|
558
|
-
return b && b.parent ? (a(b.parent) ? c(b.parent, d + 1) : c(b.parent, d)) : d;
|
|
559
|
-
}
|
|
560
|
-
return c(b, 0);
|
|
561
|
-
}
|
|
562
|
-
var e = function (b) {
|
|
563
|
-
return function (a) {
|
|
564
|
-
return a.name == b;
|
|
565
|
-
};
|
|
566
|
-
},
|
|
567
|
-
f = function (b) {
|
|
568
|
-
return e('ul')(b) || e('ol')(b);
|
|
569
|
-
},
|
|
570
|
-
g = CKEDITOR.tools.array,
|
|
571
|
-
w = [],
|
|
572
|
-
a,
|
|
573
|
-
h;
|
|
574
|
-
c.forEach(
|
|
575
|
-
function (b) {
|
|
576
|
-
w.push(b);
|
|
577
|
-
},
|
|
578
|
-
CKEDITOR.NODE_ELEMENT,
|
|
579
|
-
!1,
|
|
580
|
-
);
|
|
581
|
-
a = g.filter(w, e('li'));
|
|
582
|
-
var m = g.filter(w, f);
|
|
583
|
-
g.forEach(m, function (a) {
|
|
584
|
-
var c = a.attributes.type,
|
|
585
|
-
h = parseInt(a.attributes.start, 10) || 1,
|
|
586
|
-
m = d(f, a) + 1;
|
|
587
|
-
c || (c = n.parseCssText(a.attributes.style)['list-style-type']);
|
|
588
|
-
g.forEach(g.filter(a.children, e('li')), function (d, e) {
|
|
589
|
-
var f;
|
|
590
|
-
switch (c) {
|
|
591
|
-
case 'disc':
|
|
592
|
-
f = '·';
|
|
593
|
-
break;
|
|
594
|
-
case 'circle':
|
|
595
|
-
f = 'o';
|
|
596
|
-
break;
|
|
597
|
-
case 'square':
|
|
598
|
-
f = '§';
|
|
599
|
-
break;
|
|
600
|
-
case '1':
|
|
601
|
-
case 'decimal':
|
|
602
|
-
f = h + e + '.';
|
|
603
|
-
break;
|
|
604
|
-
case 'a':
|
|
605
|
-
case 'lower-alpha':
|
|
606
|
-
f = String.fromCharCode(97 + h - 1 + e) + '.';
|
|
607
|
-
break;
|
|
608
|
-
case 'A':
|
|
609
|
-
case 'upper-alpha':
|
|
610
|
-
f = String.fromCharCode(65 + h - 1 + e) + '.';
|
|
611
|
-
break;
|
|
612
|
-
case 'i':
|
|
613
|
-
case 'lower-roman':
|
|
614
|
-
f = b(h + e) + '.';
|
|
615
|
-
break;
|
|
616
|
-
case 'I':
|
|
617
|
-
case 'upper-roman':
|
|
618
|
-
f = b(h + e).toUpperCase() + '.';
|
|
619
|
-
break;
|
|
620
|
-
default:
|
|
621
|
-
f = 'ul' == a.name ? '·' : h + e + '.';
|
|
622
|
-
}
|
|
623
|
-
d.attributes['cke-symbol'] = f;
|
|
624
|
-
d.attributes['cke-list-level'] = m;
|
|
625
|
-
});
|
|
626
|
-
});
|
|
627
|
-
a = g.reduce(
|
|
628
|
-
a,
|
|
629
|
-
function (b, a) {
|
|
630
|
-
var c = a.children[0];
|
|
631
|
-
if (c && c.name && c.attributes.style && c.attributes.style.match(/mso-list:/i)) {
|
|
632
|
-
k.pushStylesLower(a, { 'list-style-type': !0, display: !0 });
|
|
633
|
-
var d = n.parseCssText(c.attributes.style, !0);
|
|
634
|
-
k.setStyle(a, 'mso-list', d['mso-list'], !0);
|
|
635
|
-
k.setStyle(c, 'mso-list', '');
|
|
636
|
-
delete a['cke-list-level'];
|
|
637
|
-
(c = d.display ? 'display' : d.DISPLAY ? 'DISPLAY' : '') && k.setStyle(a, 'display', d[c], !0);
|
|
638
|
-
}
|
|
639
|
-
if (1 === a.children.length && f(a.children[0])) return b;
|
|
640
|
-
a.name = 'p';
|
|
641
|
-
a.attributes['cke-dissolved'] = !0;
|
|
642
|
-
b.push(a);
|
|
643
|
-
return b;
|
|
644
|
-
},
|
|
645
|
-
[],
|
|
646
|
-
);
|
|
647
|
-
for (h = a.length - 1; 0 <= h; h--) a[h].insertAfter(c);
|
|
648
|
-
for (h = m.length - 1; 0 <= h; h--) delete m[h].name;
|
|
649
|
-
},
|
|
650
|
-
groupLists: function (c) {
|
|
651
|
-
var b,
|
|
652
|
-
d,
|
|
653
|
-
e = [[c[0]]],
|
|
654
|
-
f = e[0];
|
|
655
|
-
d = c[0];
|
|
656
|
-
d.attributes['cke-indentation'] = d.attributes['cke-indentation'] || z(d);
|
|
657
|
-
for (b = 1; b < c.length; b++) {
|
|
658
|
-
d = c[b];
|
|
659
|
-
var l = c[b - 1];
|
|
660
|
-
d.attributes['cke-indentation'] = d.attributes['cke-indentation'] || z(d);
|
|
661
|
-
d.previous !== l && (g.chopDiscontinuousLists(f, e), e.push((f = [])));
|
|
662
|
-
f.push(d);
|
|
663
|
-
}
|
|
664
|
-
g.chopDiscontinuousLists(f, e);
|
|
665
|
-
return e;
|
|
666
|
-
},
|
|
667
|
-
chopDiscontinuousLists: function (c, b) {
|
|
668
|
-
for (var d = {}, e = [[]], f, l = 0; l < c.length; l++) {
|
|
669
|
-
var k = d[c[l].attributes['cke-list-level']],
|
|
670
|
-
a = this.getListItemInfo(c[l]),
|
|
671
|
-
h,
|
|
672
|
-
m;
|
|
673
|
-
k
|
|
674
|
-
? ((m = k.type.match(/alpha/) && 7 == k.index ? 'alpha' : m),
|
|
675
|
-
(m = 'o' == c[l].attributes['cke-symbol'] && 14 == k.index ? 'alpha' : m),
|
|
676
|
-
(h = g.getSymbolInfo(c[l].attributes['cke-symbol'], m)),
|
|
677
|
-
(a = this.getListItemInfo(c[l])),
|
|
678
|
-
(k.type != h.type || (f && a.id != f.id && !this.isAListContinuation(c[l]))) && e.push([]))
|
|
679
|
-
: (h = g.getSymbolInfo(c[l].attributes['cke-symbol']));
|
|
680
|
-
for (f = parseInt(c[l].attributes['cke-list-level'], 10) + 1; 20 > f; f++) d[f] && delete d[f];
|
|
681
|
-
d[c[l].attributes['cke-list-level']] = h;
|
|
682
|
-
e[e.length - 1].push(c[l]);
|
|
683
|
-
f = a;
|
|
684
|
-
}
|
|
685
|
-
[].splice.apply(b, [].concat([n.indexOf(b, c), 1], e));
|
|
686
|
-
},
|
|
687
|
-
isAListContinuation: function (c) {
|
|
688
|
-
var b = c;
|
|
689
|
-
do
|
|
690
|
-
if ((b = b.previous) && b.type === CKEDITOR.NODE_ELEMENT) {
|
|
691
|
-
if (void 0 === b.attributes['cke-list-level']) break;
|
|
692
|
-
if (b.attributes['cke-list-level'] === c.attributes['cke-list-level'])
|
|
693
|
-
return b.attributes['cke-list-id'] === c.attributes['cke-list-id'];
|
|
694
|
-
}
|
|
695
|
-
while (b);
|
|
696
|
-
return !1;
|
|
697
|
-
},
|
|
698
|
-
toArabic: function (c) {
|
|
699
|
-
return c.match(/[ivxl]/i)
|
|
700
|
-
? c.match(/^l/i)
|
|
701
|
-
? 50 + g.toArabic(c.slice(1))
|
|
702
|
-
: c.match(/^lx/i)
|
|
703
|
-
? 40 + g.toArabic(c.slice(1))
|
|
704
|
-
: c.match(/^x/i)
|
|
705
|
-
? 10 + g.toArabic(c.slice(1))
|
|
706
|
-
: c.match(/^ix/i)
|
|
707
|
-
? 9 + g.toArabic(c.slice(2))
|
|
708
|
-
: c.match(/^v/i)
|
|
709
|
-
? 5 + g.toArabic(c.slice(1))
|
|
710
|
-
: c.match(/^iv/i)
|
|
711
|
-
? 4 + g.toArabic(c.slice(2))
|
|
712
|
-
: c.match(/^i/i)
|
|
713
|
-
? 1 + g.toArabic(c.slice(1))
|
|
714
|
-
: g.toArabic(c.slice(1))
|
|
715
|
-
: 0;
|
|
716
|
-
},
|
|
717
|
-
getSymbolInfo: function (c, b) {
|
|
718
|
-
var d = c.toUpperCase() == c ? 'upper-' : 'lower-',
|
|
719
|
-
e = { '·': ['disc', -1], o: ['circle', -2], '§': ['square', -3] };
|
|
720
|
-
if (c in e || (b && b.match(/(disc|circle|square)/))) return { index: e[c][1], type: e[c][0] };
|
|
721
|
-
if (c.match(/\d/)) return { index: c ? parseInt(g.getSubsectionSymbol(c), 10) : 0, type: 'decimal' };
|
|
722
|
-
c = c.replace(/\W/g, '').toLowerCase();
|
|
723
|
-
return (!b && c.match(/[ivxl]+/i)) || (b && 'alpha' != b) || 'roman' == b
|
|
724
|
-
? { index: g.toArabic(c), type: d + 'roman' }
|
|
725
|
-
: c.match(/[a-z]/i)
|
|
726
|
-
? { index: c.charCodeAt(0) - 97, type: d + 'alpha' }
|
|
727
|
-
: { index: -1, type: 'disc' };
|
|
728
|
-
},
|
|
729
|
-
getListItemInfo: function (c) {
|
|
730
|
-
if (void 0 !== c.attributes['cke-list-id'])
|
|
731
|
-
return { id: c.attributes['cke-list-id'], level: c.attributes['cke-list-level'] };
|
|
732
|
-
var b = n.parseCssText(c.attributes.style)['mso-list'],
|
|
733
|
-
d = { id: '0', level: '1' };
|
|
734
|
-
b && ((b += ' '), (d.level = b.match(/level(.+?)\s+/)[1]), (d.id = b.match(/l(\d+?)\s+/)[1]));
|
|
735
|
-
c.attributes['cke-list-level'] =
|
|
736
|
-
void 0 !== c.attributes['cke-list-level'] ? c.attributes['cke-list-level'] : d.level;
|
|
737
|
-
c.attributes['cke-list-id'] = d.id;
|
|
738
|
-
return d;
|
|
739
|
-
},
|
|
740
|
-
};
|
|
741
|
-
g = q.lists;
|
|
742
|
-
q.heuristics = {
|
|
743
|
-
isEdgeListItem: function (c, b) {
|
|
744
|
-
if (!CKEDITOR.env.edge || !c.config.pasteFromWord_heuristicsEdgeList) return !1;
|
|
745
|
-
var d = '';
|
|
746
|
-
b.forEach &&
|
|
747
|
-
b.forEach(function (b) {
|
|
748
|
-
d += b.value;
|
|
749
|
-
}, CKEDITOR.NODE_TEXT);
|
|
750
|
-
return d.match(/^(?: | )*\(?[a-zA-Z0-9]+?[\.\)](?: | ){2,}/) ? !0 : p.isDegenerateListItem(c, b);
|
|
751
|
-
},
|
|
752
|
-
cleanupEdgeListItem: function (c) {
|
|
753
|
-
var b = !1;
|
|
754
|
-
c.forEach(function (c) {
|
|
755
|
-
b || ((c.value = c.value.replace(/^(?: |[\s])+/, '')), c.value.length && (b = !0));
|
|
756
|
-
}, CKEDITOR.NODE_TEXT);
|
|
757
|
-
},
|
|
758
|
-
isDegenerateListItem: function (c, b) {
|
|
759
|
-
return (
|
|
760
|
-
!!b.attributes['cke-list-level'] ||
|
|
761
|
-
(b.attributes.style &&
|
|
762
|
-
!b.attributes.style.match(/mso\-list/) &&
|
|
763
|
-
!!b.find(function (c) {
|
|
764
|
-
if (c.type == CKEDITOR.NODE_ELEMENT && b.name.match(/h\d/i) && c.getHtml().match(/^[a-zA-Z0-9]+?[\.\)]$/))
|
|
765
|
-
return !0;
|
|
766
|
-
var e = n.parseCssText(c.attributes && c.attributes.style, !0);
|
|
767
|
-
if (!e) return !1;
|
|
768
|
-
var f = e['font-family'] || '';
|
|
769
|
-
return ((e.font || e['font-size'] || '').match(/7pt/i) && !!c.previous) || f.match(/symbol/i);
|
|
770
|
-
}, !0).length)
|
|
771
|
-
);
|
|
772
|
-
},
|
|
773
|
-
assignListLevels: function (c, b) {
|
|
774
|
-
if (!b.attributes || void 0 === b.attributes['cke-list-level']) {
|
|
775
|
-
for (
|
|
776
|
-
var d = [z(b)], e = [b], f = [], g = CKEDITOR.tools.array, k = g.map;
|
|
777
|
-
b.next && b.next.attributes && !b.next.attributes['cke-list-level'] && p.isDegenerateListItem(c, b.next);
|
|
778
|
-
|
|
779
|
-
)
|
|
780
|
-
(b = b.next), d.push(z(b)), e.push(b);
|
|
781
|
-
var a = k(d, function (a, b) {
|
|
782
|
-
return 0 === b ? 0 : a - d[b - 1];
|
|
783
|
-
}),
|
|
784
|
-
h = this.guessIndentationStep(
|
|
785
|
-
g.filter(d, function (a) {
|
|
786
|
-
return 0 !== a;
|
|
787
|
-
}),
|
|
788
|
-
),
|
|
789
|
-
f = k(d, function (a) {
|
|
790
|
-
return Math.round(a / h);
|
|
791
|
-
});
|
|
792
|
-
-1 !== g.indexOf(f, 0) &&
|
|
793
|
-
(f = k(f, function (a) {
|
|
794
|
-
return a + 1;
|
|
795
|
-
}));
|
|
796
|
-
g.forEach(e, function (a, b) {
|
|
797
|
-
a.attributes['cke-list-level'] = f[b];
|
|
798
|
-
});
|
|
799
|
-
return { indents: d, levels: f, diffs: a };
|
|
800
|
-
}
|
|
801
|
-
},
|
|
802
|
-
guessIndentationStep: function (c) {
|
|
803
|
-
return c.length ? Math.min.apply(null, c) : null;
|
|
804
|
-
},
|
|
805
|
-
correctLevelShift: function (c) {
|
|
806
|
-
if (this.isShifted(c)) {
|
|
807
|
-
var b = CKEDITOR.tools.array.filter(c.children, function (b) {
|
|
808
|
-
return 'ul' == b.name || 'ol' == b.name;
|
|
809
|
-
}),
|
|
810
|
-
d = CKEDITOR.tools.array.reduce(
|
|
811
|
-
b,
|
|
812
|
-
function (b, c) {
|
|
813
|
-
return (c.children && 1 == c.children.length && p.isShifted(c.children[0]) ? [c] : c.children).concat(b);
|
|
814
|
-
},
|
|
815
|
-
[],
|
|
816
|
-
);
|
|
817
|
-
CKEDITOR.tools.array.forEach(b, function (b) {
|
|
818
|
-
b.remove();
|
|
819
|
-
});
|
|
820
|
-
CKEDITOR.tools.array.forEach(d, function (b) {
|
|
821
|
-
c.add(b);
|
|
822
|
-
});
|
|
823
|
-
delete c.name;
|
|
824
|
-
}
|
|
825
|
-
},
|
|
826
|
-
isShifted: function (c) {
|
|
827
|
-
return 'li' !== c.name
|
|
828
|
-
? !1
|
|
829
|
-
: 0 ===
|
|
830
|
-
CKEDITOR.tools.array.filter(c.children, function (b) {
|
|
831
|
-
return b.name && ('ul' == b.name || 'ol' == b.name || ('p' == b.name && 0 === b.children.length))
|
|
832
|
-
? !1
|
|
833
|
-
: !0;
|
|
834
|
-
}).length;
|
|
835
|
-
},
|
|
836
|
-
};
|
|
837
|
-
p = q.heuristics;
|
|
838
|
-
g.setListSymbol.removeRedundancies = function (c, b) {
|
|
839
|
-
((1 === b && 'disc' === c['list-style-type']) || 'decimal' === c['list-style-type']) && delete c['list-style-type'];
|
|
840
|
-
};
|
|
841
|
-
CKEDITOR.cleanWord = CKEDITOR.pasteFilters.word = B.createFilter({
|
|
842
|
-
rules: [t.rules, q.rules],
|
|
843
|
-
additionalTransforms: function (c) {
|
|
844
|
-
CKEDITOR.plugins.clipboard.isCustomDataTypesSupported && (c = t.styles.inliner.inline(c).getBody().getHtml());
|
|
845
|
-
return c.replace(/<!\[/g, '\x3c!--[').replace(/\]>/g, ']--\x3e');
|
|
846
|
-
},
|
|
847
|
-
});
|
|
848
|
-
CKEDITOR.config.pasteFromWord_heuristicsEdgeList = !0;
|
|
849
|
-
})();
|
|
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 r() {
|
|
7
|
+
return !1;
|
|
8
|
+
}
|
|
9
|
+
var n = CKEDITOR.tools,
|
|
10
|
+
B = CKEDITOR.plugins.pastetools,
|
|
11
|
+
t = B.filters.common,
|
|
12
|
+
k = t.styles,
|
|
13
|
+
C = t.createAttributeStack,
|
|
14
|
+
z = t.lists.getElementIndentation,
|
|
15
|
+
D = ['o:p', 'xml', 'script', 'meta', 'link'],
|
|
16
|
+
E = 'v:arc v:curve v:line v:oval v:polyline v:rect v:roundrect v:group'.split(' '),
|
|
17
|
+
A = {},
|
|
18
|
+
y = 0,
|
|
19
|
+
q = {},
|
|
20
|
+
g,
|
|
21
|
+
p;
|
|
22
|
+
CKEDITOR.plugins.pastetools.filters.word = q;
|
|
23
|
+
CKEDITOR.plugins.pastefromword = q;
|
|
24
|
+
q.rules = function (c, b, d) {
|
|
25
|
+
function e(a) {
|
|
26
|
+
(a.attributes['o:gfxdata'] || 'v:group' === a.parent.name) && l.push(a.attributes.id);
|
|
27
|
+
}
|
|
28
|
+
var f = Boolean(c.match(/mso-list:\s*l\d+\s+level\d+\s+lfo\d+/)),
|
|
29
|
+
l = [],
|
|
30
|
+
w = {
|
|
31
|
+
root: function (a) {
|
|
32
|
+
a.filterChildren(d);
|
|
33
|
+
CKEDITOR.plugins.pastefromword.lists.cleanup(g.createLists(a));
|
|
34
|
+
},
|
|
35
|
+
elementNames: [
|
|
36
|
+
[/^\?xml:namespace$/, ''],
|
|
37
|
+
[/^v:shapetype/, ''],
|
|
38
|
+
[new RegExp(D.join('|')), ''],
|
|
39
|
+
],
|
|
40
|
+
elements: {
|
|
41
|
+
a: function (a) {
|
|
42
|
+
if (a.attributes.name) {
|
|
43
|
+
if ('_GoBack' == a.attributes.name) {
|
|
44
|
+
delete a.name;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (a.attributes.name.match(/^OLE_LINK\d+$/)) {
|
|
48
|
+
delete a.name;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (a.attributes.href && a.attributes.href.match(/#.+$/)) {
|
|
53
|
+
var b = a.attributes.href.match(/#(.+)$/)[1];
|
|
54
|
+
A[b] = a;
|
|
55
|
+
}
|
|
56
|
+
a.attributes.name &&
|
|
57
|
+
A[a.attributes.name] &&
|
|
58
|
+
((a = A[a.attributes.name]), (a.attributes.href = a.attributes.href.replace(/.*#(.*)$/, '#$1')));
|
|
59
|
+
},
|
|
60
|
+
div: function (a) {
|
|
61
|
+
if (b.plugins.pagebreak && a.attributes['data-cke-pagebreak']) return a;
|
|
62
|
+
k.createStyleStack(a, d, b);
|
|
63
|
+
},
|
|
64
|
+
img: function (a) {
|
|
65
|
+
if (a.parent && a.parent.attributes) {
|
|
66
|
+
var b = a.parent.attributes;
|
|
67
|
+
(b = b.style || b.STYLE) && b.match(/mso\-list:\s?Ignore/) && (a.attributes['cke-ignored'] = !0);
|
|
68
|
+
}
|
|
69
|
+
k.mapCommonStyles(a);
|
|
70
|
+
a.attributes.src &&
|
|
71
|
+
a.attributes.src.match(/^file:\/\//) &&
|
|
72
|
+
a.attributes.alt &&
|
|
73
|
+
a.attributes.alt.match(/^https?:\/\//) &&
|
|
74
|
+
(a.attributes.src = a.attributes.alt);
|
|
75
|
+
a = a.attributes['v:shapes'] ? a.attributes['v:shapes'].split(' ') : [];
|
|
76
|
+
b = CKEDITOR.tools.array.every(a, function (a) {
|
|
77
|
+
return -1 < l.indexOf(a);
|
|
78
|
+
});
|
|
79
|
+
if (a.length && b) return !1;
|
|
80
|
+
},
|
|
81
|
+
p: function (a) {
|
|
82
|
+
a.filterChildren(d);
|
|
83
|
+
if (a.attributes.style && a.attributes.style.match(/display:\s*none/i)) return !1;
|
|
84
|
+
if (g.thisIsAListItem(b, a))
|
|
85
|
+
p.isEdgeListItem(b, a) && p.cleanupEdgeListItem(a),
|
|
86
|
+
g.convertToFakeListItem(b, a),
|
|
87
|
+
n.array.reduce(
|
|
88
|
+
a.children,
|
|
89
|
+
function (a, b) {
|
|
90
|
+
'p' === b.name &&
|
|
91
|
+
(0 < a && new CKEDITOR.htmlParser.element('br').insertBefore(b),
|
|
92
|
+
b.replaceWithChildren(),
|
|
93
|
+
(a += 1));
|
|
94
|
+
return a;
|
|
95
|
+
},
|
|
96
|
+
0,
|
|
97
|
+
);
|
|
98
|
+
else {
|
|
99
|
+
var c = a.getAscendant(function (a) {
|
|
100
|
+
return 'ul' == a.name || 'ol' == a.name;
|
|
101
|
+
}),
|
|
102
|
+
f = n.parseCssText(a.attributes.style);
|
|
103
|
+
c &&
|
|
104
|
+
!c.attributes['cke-list-level'] &&
|
|
105
|
+
f['mso-list'] &&
|
|
106
|
+
f['mso-list'].match(/level/) &&
|
|
107
|
+
(c.attributes['cke-list-level'] = f['mso-list'].match(/level(\d+)/)[1]);
|
|
108
|
+
b.config.enterMode == CKEDITOR.ENTER_BR && (delete a.name, a.add(new CKEDITOR.htmlParser.element('br')));
|
|
109
|
+
}
|
|
110
|
+
k.createStyleStack(a, d, b);
|
|
111
|
+
},
|
|
112
|
+
pre: function (a) {
|
|
113
|
+
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
114
|
+
k.createStyleStack(a, d, b);
|
|
115
|
+
},
|
|
116
|
+
h1: function (a) {
|
|
117
|
+
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
118
|
+
k.createStyleStack(a, d, b);
|
|
119
|
+
},
|
|
120
|
+
h2: function (a) {
|
|
121
|
+
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
122
|
+
k.createStyleStack(a, d, b);
|
|
123
|
+
},
|
|
124
|
+
h3: function (a) {
|
|
125
|
+
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
126
|
+
k.createStyleStack(a, d, b);
|
|
127
|
+
},
|
|
128
|
+
h4: function (a) {
|
|
129
|
+
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
130
|
+
k.createStyleStack(a, d, b);
|
|
131
|
+
},
|
|
132
|
+
h5: function (a) {
|
|
133
|
+
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
134
|
+
k.createStyleStack(a, d, b);
|
|
135
|
+
},
|
|
136
|
+
h6: function (a) {
|
|
137
|
+
g.thisIsAListItem(b, a) && g.convertToFakeListItem(b, a);
|
|
138
|
+
k.createStyleStack(a, d, b);
|
|
139
|
+
},
|
|
140
|
+
font: function (a) {
|
|
141
|
+
if (a.getHtml().match(/^\s*$/))
|
|
142
|
+
return a.parent.type === CKEDITOR.NODE_ELEMENT && new CKEDITOR.htmlParser.text(' ').insertAfter(a), !1;
|
|
143
|
+
b && !0 === b.config.pasteFromWordRemoveFontStyles && a.attributes.size && delete a.attributes.size;
|
|
144
|
+
CKEDITOR.dtd.tr[a.parent.name] &&
|
|
145
|
+
CKEDITOR.tools.arrayCompare(CKEDITOR.tools.object.keys(a.attributes), ['class', 'style'])
|
|
146
|
+
? k.createStyleStack(a, d, b)
|
|
147
|
+
: C(a, d);
|
|
148
|
+
},
|
|
149
|
+
ul: function (a) {
|
|
150
|
+
if (f)
|
|
151
|
+
return (
|
|
152
|
+
'li' == a.parent.name &&
|
|
153
|
+
0 === n.indexOf(a.parent.children, a) &&
|
|
154
|
+
k.setStyle(a.parent, 'list-style-type', 'none'),
|
|
155
|
+
g.dissolveList(a),
|
|
156
|
+
!1
|
|
157
|
+
);
|
|
158
|
+
},
|
|
159
|
+
li: function (a) {
|
|
160
|
+
p.correctLevelShift(a);
|
|
161
|
+
f && ((a.attributes.style = k.normalizedStyles(a, b)), k.pushStylesLower(a));
|
|
162
|
+
},
|
|
163
|
+
ol: function (a) {
|
|
164
|
+
if (f)
|
|
165
|
+
return (
|
|
166
|
+
'li' == a.parent.name &&
|
|
167
|
+
0 === n.indexOf(a.parent.children, a) &&
|
|
168
|
+
k.setStyle(a.parent, 'list-style-type', 'none'),
|
|
169
|
+
g.dissolveList(a),
|
|
170
|
+
!1
|
|
171
|
+
);
|
|
172
|
+
},
|
|
173
|
+
span: function (a) {
|
|
174
|
+
a.filterChildren(d);
|
|
175
|
+
a.attributes.style = k.normalizedStyles(a, b);
|
|
176
|
+
if (
|
|
177
|
+
!a.attributes.style ||
|
|
178
|
+
a.attributes.style.match(/^mso\-bookmark:OLE_LINK\d+$/) ||
|
|
179
|
+
a.getHtml().match(/^(\s| )+$/)
|
|
180
|
+
)
|
|
181
|
+
return t.elements.replaceWithChildren(a), !1;
|
|
182
|
+
a.attributes.style.match(/FONT-FAMILY:\s*Symbol/i) &&
|
|
183
|
+
a.forEach(
|
|
184
|
+
function (a) {
|
|
185
|
+
a.value = a.value.replace(/ /g, '');
|
|
186
|
+
},
|
|
187
|
+
CKEDITOR.NODE_TEXT,
|
|
188
|
+
!0,
|
|
189
|
+
);
|
|
190
|
+
k.createStyleStack(a, d, b);
|
|
191
|
+
},
|
|
192
|
+
'v:imagedata': r,
|
|
193
|
+
'v:shape': function (a) {
|
|
194
|
+
var b = !1;
|
|
195
|
+
if (null === a.getFirst('v:imagedata')) e(a);
|
|
196
|
+
else {
|
|
197
|
+
a.parent.find(function (c) {
|
|
198
|
+
'img' == c.name && c.attributes && c.attributes['v:shapes'] == a.attributes.id && (b = !0);
|
|
199
|
+
}, !0);
|
|
200
|
+
if (b) return !1;
|
|
201
|
+
var c = '';
|
|
202
|
+
'v:group' === a.parent.name
|
|
203
|
+
? e(a)
|
|
204
|
+
: (a.forEach(
|
|
205
|
+
function (a) {
|
|
206
|
+
a.attributes && a.attributes.src && (c = a.attributes.src);
|
|
207
|
+
},
|
|
208
|
+
CKEDITOR.NODE_ELEMENT,
|
|
209
|
+
!0,
|
|
210
|
+
),
|
|
211
|
+
a.filterChildren(d),
|
|
212
|
+
(a.name = 'img'),
|
|
213
|
+
(a.attributes.src = a.attributes.src || c),
|
|
214
|
+
delete a.attributes.type);
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
style: function () {
|
|
218
|
+
return !1;
|
|
219
|
+
},
|
|
220
|
+
object: function (a) {
|
|
221
|
+
return !(!a.attributes || !a.attributes.data);
|
|
222
|
+
},
|
|
223
|
+
br: function (a) {
|
|
224
|
+
if (
|
|
225
|
+
b.plugins.pagebreak &&
|
|
226
|
+
((a = n.parseCssText(a.attributes.style, !0)),
|
|
227
|
+
'always' === a['page-break-before'] || 'page' === a['break-before'])
|
|
228
|
+
)
|
|
229
|
+
return (
|
|
230
|
+
(a = CKEDITOR.plugins.pagebreak.createElement(b)),
|
|
231
|
+
CKEDITOR.htmlParser.fragment.fromHtml(a.getOuterHtml()).children[0]
|
|
232
|
+
);
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
attributes: {
|
|
236
|
+
style: function (a, c) {
|
|
237
|
+
return k.normalizedStyles(c, b) || !1;
|
|
238
|
+
},
|
|
239
|
+
class: function (a) {
|
|
240
|
+
a = a.replace(/(el\d+)|(font\d+)|msonormal|msolistparagraph\w*/gi, '');
|
|
241
|
+
return '' === a ? !1 : a;
|
|
242
|
+
},
|
|
243
|
+
cellspacing: r,
|
|
244
|
+
cellpadding: r,
|
|
245
|
+
border: r,
|
|
246
|
+
'v:shapes': r,
|
|
247
|
+
'o:spid': r,
|
|
248
|
+
},
|
|
249
|
+
comment: function (a) {
|
|
250
|
+
a.match(/\[if.* supportFields.*\]/) && y++;
|
|
251
|
+
'[endif]' == a && (y = 0 < y ? y - 1 : 0);
|
|
252
|
+
return !1;
|
|
253
|
+
},
|
|
254
|
+
text: function (a, b) {
|
|
255
|
+
if (y) return '';
|
|
256
|
+
var c = b.parent && b.parent.parent;
|
|
257
|
+
return c && c.attributes && c.attributes.style && c.attributes.style.match(/mso-list:\s*ignore/i)
|
|
258
|
+
? a.replace(/ /g, ' ')
|
|
259
|
+
: a;
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
n.array.forEach(E, function (a) {
|
|
263
|
+
w.elements[a] = e;
|
|
264
|
+
});
|
|
265
|
+
return w;
|
|
266
|
+
};
|
|
267
|
+
q.lists = {
|
|
268
|
+
thisIsAListItem: function (c, b) {
|
|
269
|
+
return p.isEdgeListItem(c, b) ||
|
|
270
|
+
(b.attributes.style && b.attributes.style.match(/mso\-list:\s?l\d/) && 'li' !== b.parent.name) ||
|
|
271
|
+
b.attributes['cke-dissolved'] ||
|
|
272
|
+
b.getHtml().match(/<!\-\-\[if !supportLists]\-\->/)
|
|
273
|
+
? !0
|
|
274
|
+
: !1;
|
|
275
|
+
},
|
|
276
|
+
convertToFakeListItem: function (c, b) {
|
|
277
|
+
p.isDegenerateListItem(c, b) && p.assignListLevels(c, b);
|
|
278
|
+
this.getListItemInfo(b);
|
|
279
|
+
if (!b.attributes['cke-dissolved']) {
|
|
280
|
+
var d;
|
|
281
|
+
b.forEach(function (b) {
|
|
282
|
+
!d && 'img' == b.name && b.attributes['cke-ignored'] && '*' == b.attributes.alt && ((d = '·'), b.remove());
|
|
283
|
+
}, CKEDITOR.NODE_ELEMENT);
|
|
284
|
+
b.forEach(function (b) {
|
|
285
|
+
d || b.value.match(/^ /) || (d = b.value);
|
|
286
|
+
}, CKEDITOR.NODE_TEXT);
|
|
287
|
+
if ('undefined' == typeof d) return;
|
|
288
|
+
b.attributes['cke-symbol'] = d.replace(/(?: | ).*$/, '');
|
|
289
|
+
g.removeSymbolText(b);
|
|
290
|
+
}
|
|
291
|
+
var e = b.attributes && n.parseCssText(b.attributes.style);
|
|
292
|
+
if (e['margin-left']) {
|
|
293
|
+
var f = e['margin-left'],
|
|
294
|
+
l = b.attributes['cke-list-level'];
|
|
295
|
+
(f = Math.max(CKEDITOR.tools.convertToPx(f) - 40 * l, 0))
|
|
296
|
+
? (e['margin-left'] = f + 'px')
|
|
297
|
+
: delete e['margin-left'];
|
|
298
|
+
b.attributes.style = CKEDITOR.tools.writeCssText(e);
|
|
299
|
+
}
|
|
300
|
+
b.name = 'cke:li';
|
|
301
|
+
},
|
|
302
|
+
convertToRealListItems: function (c) {
|
|
303
|
+
var b = [];
|
|
304
|
+
c.forEach(
|
|
305
|
+
function (c) {
|
|
306
|
+
'cke:li' == c.name && ((c.name = 'li'), b.push(c));
|
|
307
|
+
},
|
|
308
|
+
CKEDITOR.NODE_ELEMENT,
|
|
309
|
+
!1,
|
|
310
|
+
);
|
|
311
|
+
return b;
|
|
312
|
+
},
|
|
313
|
+
removeSymbolText: function (c) {
|
|
314
|
+
var b = c.attributes['cke-symbol'],
|
|
315
|
+
d = c.findOne(function (c) {
|
|
316
|
+
return c.value && -1 < c.value.indexOf(b);
|
|
317
|
+
}, !0),
|
|
318
|
+
e;
|
|
319
|
+
d &&
|
|
320
|
+
((d.value = d.value.replace(b, '')),
|
|
321
|
+
(e = d.parent),
|
|
322
|
+
e.getHtml().match(/^(\s| )*$/) && e !== c ? e.remove() : d.value || d.remove());
|
|
323
|
+
},
|
|
324
|
+
setListSymbol: function (c, b, d) {
|
|
325
|
+
d = d || 1;
|
|
326
|
+
var e = n.parseCssText(c.attributes.style);
|
|
327
|
+
if ('ol' == c.name) {
|
|
328
|
+
if (c.attributes.type || e['list-style-type']) return;
|
|
329
|
+
var f = {
|
|
330
|
+
'[ivx]': 'lower-roman',
|
|
331
|
+
'[IVX]': 'upper-roman',
|
|
332
|
+
'[a-z]': 'lower-alpha',
|
|
333
|
+
'[A-Z]': 'upper-alpha',
|
|
334
|
+
'\\d': 'decimal',
|
|
335
|
+
},
|
|
336
|
+
l;
|
|
337
|
+
for (l in f)
|
|
338
|
+
if (g.getSubsectionSymbol(b).match(new RegExp(l))) {
|
|
339
|
+
e['list-style-type'] = f[l];
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
c.attributes['cke-list-style-type'] = e['list-style-type'];
|
|
343
|
+
} else
|
|
344
|
+
(f = { '·': 'disc', o: 'circle', '§': 'square' }),
|
|
345
|
+
!e['list-style-type'] && f[b] && (e['list-style-type'] = f[b]);
|
|
346
|
+
g.setListSymbol.removeRedundancies(e, d);
|
|
347
|
+
(c.attributes.style = CKEDITOR.tools.writeCssText(e)) || delete c.attributes.style;
|
|
348
|
+
},
|
|
349
|
+
setListStart: function (c) {
|
|
350
|
+
for (var b = [], d = 0, e = 0; e < c.children.length; e++) b.push(c.children[e].attributes['cke-symbol'] || '');
|
|
351
|
+
b[0] || d++;
|
|
352
|
+
switch (c.attributes['cke-list-style-type']) {
|
|
353
|
+
case 'lower-roman':
|
|
354
|
+
case 'upper-roman':
|
|
355
|
+
c.attributes.start = g.toArabic(g.getSubsectionSymbol(b[d])) - d;
|
|
356
|
+
break;
|
|
357
|
+
case 'lower-alpha':
|
|
358
|
+
case 'upper-alpha':
|
|
359
|
+
c.attributes.start = g.getSubsectionSymbol(b[d]).replace(/\W/g, '').toLowerCase().charCodeAt(0) - 96 - d;
|
|
360
|
+
break;
|
|
361
|
+
case 'decimal':
|
|
362
|
+
c.attributes.start = parseInt(g.getSubsectionSymbol(b[d]), 10) - d || 1;
|
|
363
|
+
}
|
|
364
|
+
'1' == c.attributes.start && delete c.attributes.start;
|
|
365
|
+
delete c.attributes['cke-list-style-type'];
|
|
366
|
+
},
|
|
367
|
+
numbering: {
|
|
368
|
+
toNumber: function (c, b) {
|
|
369
|
+
function d(b) {
|
|
370
|
+
b = b.toUpperCase();
|
|
371
|
+
for (var c = 1, d = 1; 0 < b.length; d *= 26)
|
|
372
|
+
(c += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.indexOf(b.charAt(b.length - 1)) * d), (b = b.substr(0, b.length - 1));
|
|
373
|
+
return c;
|
|
374
|
+
}
|
|
375
|
+
function e(b) {
|
|
376
|
+
var c = [
|
|
377
|
+
[1e3, 'M'],
|
|
378
|
+
[900, 'CM'],
|
|
379
|
+
[500, 'D'],
|
|
380
|
+
[400, 'CD'],
|
|
381
|
+
[100, 'C'],
|
|
382
|
+
[90, 'XC'],
|
|
383
|
+
[50, 'L'],
|
|
384
|
+
[40, 'XL'],
|
|
385
|
+
[10, 'X'],
|
|
386
|
+
[9, 'IX'],
|
|
387
|
+
[5, 'V'],
|
|
388
|
+
[4, 'IV'],
|
|
389
|
+
[1, 'I'],
|
|
390
|
+
];
|
|
391
|
+
b = b.toUpperCase();
|
|
392
|
+
for (var d = c.length, a = 0, e = 0; e < d; ++e)
|
|
393
|
+
for (var g = c[e], u = g[1].length; b.substr(0, u) == g[1]; b = b.substr(u)) a += g[0];
|
|
394
|
+
return a;
|
|
395
|
+
}
|
|
396
|
+
return 'decimal' == b
|
|
397
|
+
? Number(c)
|
|
398
|
+
: 'upper-roman' == b || 'lower-roman' == b
|
|
399
|
+
? e(c.toUpperCase())
|
|
400
|
+
: 'lower-alpha' == b || 'upper-alpha' == b
|
|
401
|
+
? d(c)
|
|
402
|
+
: 1;
|
|
403
|
+
},
|
|
404
|
+
getStyle: function (c) {
|
|
405
|
+
c = c.slice(0, 1);
|
|
406
|
+
var b = {
|
|
407
|
+
i: 'lower-roman',
|
|
408
|
+
v: 'lower-roman',
|
|
409
|
+
x: 'lower-roman',
|
|
410
|
+
l: 'lower-roman',
|
|
411
|
+
m: 'lower-roman',
|
|
412
|
+
I: 'upper-roman',
|
|
413
|
+
V: 'upper-roman',
|
|
414
|
+
X: 'upper-roman',
|
|
415
|
+
L: 'upper-roman',
|
|
416
|
+
M: 'upper-roman',
|
|
417
|
+
}[c];
|
|
418
|
+
b || ((b = 'decimal'), c.match(/[a-z]/) && (b = 'lower-alpha'), c.match(/[A-Z]/) && (b = 'upper-alpha'));
|
|
419
|
+
return b;
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
getSubsectionSymbol: function (c) {
|
|
423
|
+
return (c.match(/([\da-zA-Z]+).?$/) || ['placeholder', '1'])[1];
|
|
424
|
+
},
|
|
425
|
+
setListDir: function (c) {
|
|
426
|
+
var b = 0,
|
|
427
|
+
d = 0;
|
|
428
|
+
c.forEach(function (c) {
|
|
429
|
+
'li' == c.name && ('rtl' == (c.attributes.dir || c.attributes.DIR || '').toLowerCase() ? d++ : b++);
|
|
430
|
+
}, CKEDITOR.ELEMENT_NODE);
|
|
431
|
+
d > b && (c.attributes.dir = 'rtl');
|
|
432
|
+
},
|
|
433
|
+
createList: function (c) {
|
|
434
|
+
return (c.attributes['cke-symbol'].match(/([\da-np-zA-NP-Z]).?/) || [])[1]
|
|
435
|
+
? new CKEDITOR.htmlParser.element('ol')
|
|
436
|
+
: new CKEDITOR.htmlParser.element('ul');
|
|
437
|
+
},
|
|
438
|
+
createLists: function (c) {
|
|
439
|
+
function b(b) {
|
|
440
|
+
return CKEDITOR.tools.array.reduce(
|
|
441
|
+
b,
|
|
442
|
+
function (b, a) {
|
|
443
|
+
if (a.attributes && a.attributes.style)
|
|
444
|
+
var c = CKEDITOR.tools.parseCssText(a.attributes.style)['margin-left'];
|
|
445
|
+
return c ? b + parseInt(c, 10) : b;
|
|
446
|
+
},
|
|
447
|
+
0,
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
var d,
|
|
451
|
+
e,
|
|
452
|
+
f,
|
|
453
|
+
l = g.convertToRealListItems(c);
|
|
454
|
+
if (0 === l.length) return [];
|
|
455
|
+
var k = g.groupLists(l);
|
|
456
|
+
for (c = 0; c < k.length; c++) {
|
|
457
|
+
var a = k[c],
|
|
458
|
+
h = a[0];
|
|
459
|
+
for (f = 0; f < a.length; f++)
|
|
460
|
+
if (1 == a[f].attributes['cke-list-level']) {
|
|
461
|
+
h = a[f];
|
|
462
|
+
break;
|
|
463
|
+
}
|
|
464
|
+
var h = [g.createList(h)],
|
|
465
|
+
m = h[0],
|
|
466
|
+
u = [h[0]];
|
|
467
|
+
m.insertBefore(a[0]);
|
|
468
|
+
for (f = 0; f < a.length; f++) {
|
|
469
|
+
d = a[f];
|
|
470
|
+
for (e = d.attributes['cke-list-level']; e > h.length; ) {
|
|
471
|
+
var v = g.createList(d),
|
|
472
|
+
x = m.children;
|
|
473
|
+
0 < x.length
|
|
474
|
+
? x[x.length - 1].add(v)
|
|
475
|
+
: ((x = new CKEDITOR.htmlParser.element('li', { style: 'list-style-type:none' })), x.add(v), m.add(x));
|
|
476
|
+
h.push(v);
|
|
477
|
+
u.push(v);
|
|
478
|
+
m = v;
|
|
479
|
+
e == h.length && g.setListSymbol(v, d.attributes['cke-symbol'], e);
|
|
480
|
+
}
|
|
481
|
+
for (; e < h.length; )
|
|
482
|
+
h.pop(), (m = h[h.length - 1]), e == h.length && g.setListSymbol(m, d.attributes['cke-symbol'], e);
|
|
483
|
+
d.remove();
|
|
484
|
+
m.add(d);
|
|
485
|
+
}
|
|
486
|
+
h[0].children.length &&
|
|
487
|
+
((f = h[0].children[0].attributes['cke-symbol']),
|
|
488
|
+
!f && 1 < h[0].children.length && (f = h[0].children[1].attributes['cke-symbol']),
|
|
489
|
+
f && g.setListSymbol(h[0], f));
|
|
490
|
+
for (f = 0; f < u.length; f++) g.setListStart(u[f]);
|
|
491
|
+
for (f = 0; f < a.length; f++) this.determineListItemValue(a[f]);
|
|
492
|
+
}
|
|
493
|
+
CKEDITOR.tools.array.forEach(l, function (a) {
|
|
494
|
+
for (var c = [], d = a.parent; d; ) 'li' === d.name && c.push(d), (d = d.parent);
|
|
495
|
+
var c = b(c),
|
|
496
|
+
e;
|
|
497
|
+
c &&
|
|
498
|
+
((a.attributes = a.attributes || {}),
|
|
499
|
+
(d = CKEDITOR.tools.parseCssText(a.attributes.style)),
|
|
500
|
+
(e = d['margin-left'] || 0),
|
|
501
|
+
(e = Math.max(parseInt(e, 10) - c, 0)) ? (d['margin-left'] = e + 'px') : delete d['margin-left'],
|
|
502
|
+
(a.attributes.style = CKEDITOR.tools.writeCssText(d)));
|
|
503
|
+
});
|
|
504
|
+
return l;
|
|
505
|
+
},
|
|
506
|
+
cleanup: function (c) {
|
|
507
|
+
var b = ['cke-list-level', 'cke-symbol', 'cke-list-id', 'cke-indentation', 'cke-dissolved'],
|
|
508
|
+
d,
|
|
509
|
+
e;
|
|
510
|
+
for (d = 0; d < c.length; d++) for (e = 0; e < b.length; e++) delete c[d].attributes[b[e]];
|
|
511
|
+
},
|
|
512
|
+
determineListItemValue: function (c) {
|
|
513
|
+
if ('ol' === c.parent.name) {
|
|
514
|
+
var b = this.calculateValue(c),
|
|
515
|
+
d = c.attributes['cke-symbol'].match(/[a-z0-9]+/gi),
|
|
516
|
+
e;
|
|
517
|
+
d &&
|
|
518
|
+
((d = d[d.length - 1]),
|
|
519
|
+
(e = c.parent.attributes['cke-list-style-type'] || this.numbering.getStyle(d)),
|
|
520
|
+
(d = this.numbering.toNumber(d, e)),
|
|
521
|
+
d !== b && (c.attributes.value = d));
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
calculateValue: function (c) {
|
|
525
|
+
if (!c.parent) return 1;
|
|
526
|
+
var b = c.parent;
|
|
527
|
+
c = c.getIndex();
|
|
528
|
+
var d = null,
|
|
529
|
+
e,
|
|
530
|
+
f,
|
|
531
|
+
g;
|
|
532
|
+
for (g = c; 0 <= g && null === d; g--)
|
|
533
|
+
(f = b.children[g]),
|
|
534
|
+
f.attributes && void 0 !== f.attributes.value && ((e = g), (d = parseInt(f.attributes.value, 10)));
|
|
535
|
+
null === d && ((d = void 0 !== b.attributes.start ? parseInt(b.attributes.start, 10) : 1), (e = 0));
|
|
536
|
+
return d + (c - e);
|
|
537
|
+
},
|
|
538
|
+
dissolveList: function (c) {
|
|
539
|
+
function b(a) {
|
|
540
|
+
return 50 <= a
|
|
541
|
+
? 'l' + b(a - 50)
|
|
542
|
+
: 40 <= a
|
|
543
|
+
? 'xl' + b(a - 40)
|
|
544
|
+
: 10 <= a
|
|
545
|
+
? 'x' + b(a - 10)
|
|
546
|
+
: 9 == a
|
|
547
|
+
? 'ix'
|
|
548
|
+
: 5 <= a
|
|
549
|
+
? 'v' + b(a - 5)
|
|
550
|
+
: 4 == a
|
|
551
|
+
? 'iv'
|
|
552
|
+
: 1 <= a
|
|
553
|
+
? 'i' + b(a - 1)
|
|
554
|
+
: '';
|
|
555
|
+
}
|
|
556
|
+
function d(a, b) {
|
|
557
|
+
function c(b, d) {
|
|
558
|
+
return b && b.parent ? (a(b.parent) ? c(b.parent, d + 1) : c(b.parent, d)) : d;
|
|
559
|
+
}
|
|
560
|
+
return c(b, 0);
|
|
561
|
+
}
|
|
562
|
+
var e = function (b) {
|
|
563
|
+
return function (a) {
|
|
564
|
+
return a.name == b;
|
|
565
|
+
};
|
|
566
|
+
},
|
|
567
|
+
f = function (b) {
|
|
568
|
+
return e('ul')(b) || e('ol')(b);
|
|
569
|
+
},
|
|
570
|
+
g = CKEDITOR.tools.array,
|
|
571
|
+
w = [],
|
|
572
|
+
a,
|
|
573
|
+
h;
|
|
574
|
+
c.forEach(
|
|
575
|
+
function (b) {
|
|
576
|
+
w.push(b);
|
|
577
|
+
},
|
|
578
|
+
CKEDITOR.NODE_ELEMENT,
|
|
579
|
+
!1,
|
|
580
|
+
);
|
|
581
|
+
a = g.filter(w, e('li'));
|
|
582
|
+
var m = g.filter(w, f);
|
|
583
|
+
g.forEach(m, function (a) {
|
|
584
|
+
var c = a.attributes.type,
|
|
585
|
+
h = parseInt(a.attributes.start, 10) || 1,
|
|
586
|
+
m = d(f, a) + 1;
|
|
587
|
+
c || (c = n.parseCssText(a.attributes.style)['list-style-type']);
|
|
588
|
+
g.forEach(g.filter(a.children, e('li')), function (d, e) {
|
|
589
|
+
var f;
|
|
590
|
+
switch (c) {
|
|
591
|
+
case 'disc':
|
|
592
|
+
f = '·';
|
|
593
|
+
break;
|
|
594
|
+
case 'circle':
|
|
595
|
+
f = 'o';
|
|
596
|
+
break;
|
|
597
|
+
case 'square':
|
|
598
|
+
f = '§';
|
|
599
|
+
break;
|
|
600
|
+
case '1':
|
|
601
|
+
case 'decimal':
|
|
602
|
+
f = h + e + '.';
|
|
603
|
+
break;
|
|
604
|
+
case 'a':
|
|
605
|
+
case 'lower-alpha':
|
|
606
|
+
f = String.fromCharCode(97 + h - 1 + e) + '.';
|
|
607
|
+
break;
|
|
608
|
+
case 'A':
|
|
609
|
+
case 'upper-alpha':
|
|
610
|
+
f = String.fromCharCode(65 + h - 1 + e) + '.';
|
|
611
|
+
break;
|
|
612
|
+
case 'i':
|
|
613
|
+
case 'lower-roman':
|
|
614
|
+
f = b(h + e) + '.';
|
|
615
|
+
break;
|
|
616
|
+
case 'I':
|
|
617
|
+
case 'upper-roman':
|
|
618
|
+
f = b(h + e).toUpperCase() + '.';
|
|
619
|
+
break;
|
|
620
|
+
default:
|
|
621
|
+
f = 'ul' == a.name ? '·' : h + e + '.';
|
|
622
|
+
}
|
|
623
|
+
d.attributes['cke-symbol'] = f;
|
|
624
|
+
d.attributes['cke-list-level'] = m;
|
|
625
|
+
});
|
|
626
|
+
});
|
|
627
|
+
a = g.reduce(
|
|
628
|
+
a,
|
|
629
|
+
function (b, a) {
|
|
630
|
+
var c = a.children[0];
|
|
631
|
+
if (c && c.name && c.attributes.style && c.attributes.style.match(/mso-list:/i)) {
|
|
632
|
+
k.pushStylesLower(a, { 'list-style-type': !0, display: !0 });
|
|
633
|
+
var d = n.parseCssText(c.attributes.style, !0);
|
|
634
|
+
k.setStyle(a, 'mso-list', d['mso-list'], !0);
|
|
635
|
+
k.setStyle(c, 'mso-list', '');
|
|
636
|
+
delete a['cke-list-level'];
|
|
637
|
+
(c = d.display ? 'display' : d.DISPLAY ? 'DISPLAY' : '') && k.setStyle(a, 'display', d[c], !0);
|
|
638
|
+
}
|
|
639
|
+
if (1 === a.children.length && f(a.children[0])) return b;
|
|
640
|
+
a.name = 'p';
|
|
641
|
+
a.attributes['cke-dissolved'] = !0;
|
|
642
|
+
b.push(a);
|
|
643
|
+
return b;
|
|
644
|
+
},
|
|
645
|
+
[],
|
|
646
|
+
);
|
|
647
|
+
for (h = a.length - 1; 0 <= h; h--) a[h].insertAfter(c);
|
|
648
|
+
for (h = m.length - 1; 0 <= h; h--) delete m[h].name;
|
|
649
|
+
},
|
|
650
|
+
groupLists: function (c) {
|
|
651
|
+
var b,
|
|
652
|
+
d,
|
|
653
|
+
e = [[c[0]]],
|
|
654
|
+
f = e[0];
|
|
655
|
+
d = c[0];
|
|
656
|
+
d.attributes['cke-indentation'] = d.attributes['cke-indentation'] || z(d);
|
|
657
|
+
for (b = 1; b < c.length; b++) {
|
|
658
|
+
d = c[b];
|
|
659
|
+
var l = c[b - 1];
|
|
660
|
+
d.attributes['cke-indentation'] = d.attributes['cke-indentation'] || z(d);
|
|
661
|
+
d.previous !== l && (g.chopDiscontinuousLists(f, e), e.push((f = [])));
|
|
662
|
+
f.push(d);
|
|
663
|
+
}
|
|
664
|
+
g.chopDiscontinuousLists(f, e);
|
|
665
|
+
return e;
|
|
666
|
+
},
|
|
667
|
+
chopDiscontinuousLists: function (c, b) {
|
|
668
|
+
for (var d = {}, e = [[]], f, l = 0; l < c.length; l++) {
|
|
669
|
+
var k = d[c[l].attributes['cke-list-level']],
|
|
670
|
+
a = this.getListItemInfo(c[l]),
|
|
671
|
+
h,
|
|
672
|
+
m;
|
|
673
|
+
k
|
|
674
|
+
? ((m = k.type.match(/alpha/) && 7 == k.index ? 'alpha' : m),
|
|
675
|
+
(m = 'o' == c[l].attributes['cke-symbol'] && 14 == k.index ? 'alpha' : m),
|
|
676
|
+
(h = g.getSymbolInfo(c[l].attributes['cke-symbol'], m)),
|
|
677
|
+
(a = this.getListItemInfo(c[l])),
|
|
678
|
+
(k.type != h.type || (f && a.id != f.id && !this.isAListContinuation(c[l]))) && e.push([]))
|
|
679
|
+
: (h = g.getSymbolInfo(c[l].attributes['cke-symbol']));
|
|
680
|
+
for (f = parseInt(c[l].attributes['cke-list-level'], 10) + 1; 20 > f; f++) d[f] && delete d[f];
|
|
681
|
+
d[c[l].attributes['cke-list-level']] = h;
|
|
682
|
+
e[e.length - 1].push(c[l]);
|
|
683
|
+
f = a;
|
|
684
|
+
}
|
|
685
|
+
[].splice.apply(b, [].concat([n.indexOf(b, c), 1], e));
|
|
686
|
+
},
|
|
687
|
+
isAListContinuation: function (c) {
|
|
688
|
+
var b = c;
|
|
689
|
+
do
|
|
690
|
+
if ((b = b.previous) && b.type === CKEDITOR.NODE_ELEMENT) {
|
|
691
|
+
if (void 0 === b.attributes['cke-list-level']) break;
|
|
692
|
+
if (b.attributes['cke-list-level'] === c.attributes['cke-list-level'])
|
|
693
|
+
return b.attributes['cke-list-id'] === c.attributes['cke-list-id'];
|
|
694
|
+
}
|
|
695
|
+
while (b);
|
|
696
|
+
return !1;
|
|
697
|
+
},
|
|
698
|
+
toArabic: function (c) {
|
|
699
|
+
return c.match(/[ivxl]/i)
|
|
700
|
+
? c.match(/^l/i)
|
|
701
|
+
? 50 + g.toArabic(c.slice(1))
|
|
702
|
+
: c.match(/^lx/i)
|
|
703
|
+
? 40 + g.toArabic(c.slice(1))
|
|
704
|
+
: c.match(/^x/i)
|
|
705
|
+
? 10 + g.toArabic(c.slice(1))
|
|
706
|
+
: c.match(/^ix/i)
|
|
707
|
+
? 9 + g.toArabic(c.slice(2))
|
|
708
|
+
: c.match(/^v/i)
|
|
709
|
+
? 5 + g.toArabic(c.slice(1))
|
|
710
|
+
: c.match(/^iv/i)
|
|
711
|
+
? 4 + g.toArabic(c.slice(2))
|
|
712
|
+
: c.match(/^i/i)
|
|
713
|
+
? 1 + g.toArabic(c.slice(1))
|
|
714
|
+
: g.toArabic(c.slice(1))
|
|
715
|
+
: 0;
|
|
716
|
+
},
|
|
717
|
+
getSymbolInfo: function (c, b) {
|
|
718
|
+
var d = c.toUpperCase() == c ? 'upper-' : 'lower-',
|
|
719
|
+
e = { '·': ['disc', -1], o: ['circle', -2], '§': ['square', -3] };
|
|
720
|
+
if (c in e || (b && b.match(/(disc|circle|square)/))) return { index: e[c][1], type: e[c][0] };
|
|
721
|
+
if (c.match(/\d/)) return { index: c ? parseInt(g.getSubsectionSymbol(c), 10) : 0, type: 'decimal' };
|
|
722
|
+
c = c.replace(/\W/g, '').toLowerCase();
|
|
723
|
+
return (!b && c.match(/[ivxl]+/i)) || (b && 'alpha' != b) || 'roman' == b
|
|
724
|
+
? { index: g.toArabic(c), type: d + 'roman' }
|
|
725
|
+
: c.match(/[a-z]/i)
|
|
726
|
+
? { index: c.charCodeAt(0) - 97, type: d + 'alpha' }
|
|
727
|
+
: { index: -1, type: 'disc' };
|
|
728
|
+
},
|
|
729
|
+
getListItemInfo: function (c) {
|
|
730
|
+
if (void 0 !== c.attributes['cke-list-id'])
|
|
731
|
+
return { id: c.attributes['cke-list-id'], level: c.attributes['cke-list-level'] };
|
|
732
|
+
var b = n.parseCssText(c.attributes.style)['mso-list'],
|
|
733
|
+
d = { id: '0', level: '1' };
|
|
734
|
+
b && ((b += ' '), (d.level = b.match(/level(.+?)\s+/)[1]), (d.id = b.match(/l(\d+?)\s+/)[1]));
|
|
735
|
+
c.attributes['cke-list-level'] =
|
|
736
|
+
void 0 !== c.attributes['cke-list-level'] ? c.attributes['cke-list-level'] : d.level;
|
|
737
|
+
c.attributes['cke-list-id'] = d.id;
|
|
738
|
+
return d;
|
|
739
|
+
},
|
|
740
|
+
};
|
|
741
|
+
g = q.lists;
|
|
742
|
+
q.heuristics = {
|
|
743
|
+
isEdgeListItem: function (c, b) {
|
|
744
|
+
if (!CKEDITOR.env.edge || !c.config.pasteFromWord_heuristicsEdgeList) return !1;
|
|
745
|
+
var d = '';
|
|
746
|
+
b.forEach &&
|
|
747
|
+
b.forEach(function (b) {
|
|
748
|
+
d += b.value;
|
|
749
|
+
}, CKEDITOR.NODE_TEXT);
|
|
750
|
+
return d.match(/^(?: | )*\(?[a-zA-Z0-9]+?[\.\)](?: | ){2,}/) ? !0 : p.isDegenerateListItem(c, b);
|
|
751
|
+
},
|
|
752
|
+
cleanupEdgeListItem: function (c) {
|
|
753
|
+
var b = !1;
|
|
754
|
+
c.forEach(function (c) {
|
|
755
|
+
b || ((c.value = c.value.replace(/^(?: |[\s])+/, '')), c.value.length && (b = !0));
|
|
756
|
+
}, CKEDITOR.NODE_TEXT);
|
|
757
|
+
},
|
|
758
|
+
isDegenerateListItem: function (c, b) {
|
|
759
|
+
return (
|
|
760
|
+
!!b.attributes['cke-list-level'] ||
|
|
761
|
+
(b.attributes.style &&
|
|
762
|
+
!b.attributes.style.match(/mso\-list/) &&
|
|
763
|
+
!!b.find(function (c) {
|
|
764
|
+
if (c.type == CKEDITOR.NODE_ELEMENT && b.name.match(/h\d/i) && c.getHtml().match(/^[a-zA-Z0-9]+?[\.\)]$/))
|
|
765
|
+
return !0;
|
|
766
|
+
var e = n.parseCssText(c.attributes && c.attributes.style, !0);
|
|
767
|
+
if (!e) return !1;
|
|
768
|
+
var f = e['font-family'] || '';
|
|
769
|
+
return ((e.font || e['font-size'] || '').match(/7pt/i) && !!c.previous) || f.match(/symbol/i);
|
|
770
|
+
}, !0).length)
|
|
771
|
+
);
|
|
772
|
+
},
|
|
773
|
+
assignListLevels: function (c, b) {
|
|
774
|
+
if (!b.attributes || void 0 === b.attributes['cke-list-level']) {
|
|
775
|
+
for (
|
|
776
|
+
var d = [z(b)], e = [b], f = [], g = CKEDITOR.tools.array, k = g.map;
|
|
777
|
+
b.next && b.next.attributes && !b.next.attributes['cke-list-level'] && p.isDegenerateListItem(c, b.next);
|
|
778
|
+
|
|
779
|
+
)
|
|
780
|
+
(b = b.next), d.push(z(b)), e.push(b);
|
|
781
|
+
var a = k(d, function (a, b) {
|
|
782
|
+
return 0 === b ? 0 : a - d[b - 1];
|
|
783
|
+
}),
|
|
784
|
+
h = this.guessIndentationStep(
|
|
785
|
+
g.filter(d, function (a) {
|
|
786
|
+
return 0 !== a;
|
|
787
|
+
}),
|
|
788
|
+
),
|
|
789
|
+
f = k(d, function (a) {
|
|
790
|
+
return Math.round(a / h);
|
|
791
|
+
});
|
|
792
|
+
-1 !== g.indexOf(f, 0) &&
|
|
793
|
+
(f = k(f, function (a) {
|
|
794
|
+
return a + 1;
|
|
795
|
+
}));
|
|
796
|
+
g.forEach(e, function (a, b) {
|
|
797
|
+
a.attributes['cke-list-level'] = f[b];
|
|
798
|
+
});
|
|
799
|
+
return { indents: d, levels: f, diffs: a };
|
|
800
|
+
}
|
|
801
|
+
},
|
|
802
|
+
guessIndentationStep: function (c) {
|
|
803
|
+
return c.length ? Math.min.apply(null, c) : null;
|
|
804
|
+
},
|
|
805
|
+
correctLevelShift: function (c) {
|
|
806
|
+
if (this.isShifted(c)) {
|
|
807
|
+
var b = CKEDITOR.tools.array.filter(c.children, function (b) {
|
|
808
|
+
return 'ul' == b.name || 'ol' == b.name;
|
|
809
|
+
}),
|
|
810
|
+
d = CKEDITOR.tools.array.reduce(
|
|
811
|
+
b,
|
|
812
|
+
function (b, c) {
|
|
813
|
+
return (c.children && 1 == c.children.length && p.isShifted(c.children[0]) ? [c] : c.children).concat(b);
|
|
814
|
+
},
|
|
815
|
+
[],
|
|
816
|
+
);
|
|
817
|
+
CKEDITOR.tools.array.forEach(b, function (b) {
|
|
818
|
+
b.remove();
|
|
819
|
+
});
|
|
820
|
+
CKEDITOR.tools.array.forEach(d, function (b) {
|
|
821
|
+
c.add(b);
|
|
822
|
+
});
|
|
823
|
+
delete c.name;
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
isShifted: function (c) {
|
|
827
|
+
return 'li' !== c.name
|
|
828
|
+
? !1
|
|
829
|
+
: 0 ===
|
|
830
|
+
CKEDITOR.tools.array.filter(c.children, function (b) {
|
|
831
|
+
return b.name && ('ul' == b.name || 'ol' == b.name || ('p' == b.name && 0 === b.children.length))
|
|
832
|
+
? !1
|
|
833
|
+
: !0;
|
|
834
|
+
}).length;
|
|
835
|
+
},
|
|
836
|
+
};
|
|
837
|
+
p = q.heuristics;
|
|
838
|
+
g.setListSymbol.removeRedundancies = function (c, b) {
|
|
839
|
+
((1 === b && 'disc' === c['list-style-type']) || 'decimal' === c['list-style-type']) && delete c['list-style-type'];
|
|
840
|
+
};
|
|
841
|
+
CKEDITOR.cleanWord = CKEDITOR.pasteFilters.word = B.createFilter({
|
|
842
|
+
rules: [t.rules, q.rules],
|
|
843
|
+
additionalTransforms: function (c) {
|
|
844
|
+
CKEDITOR.plugins.clipboard.isCustomDataTypesSupported && (c = t.styles.inliner.inline(c).getBody().getHtml());
|
|
845
|
+
return c.replace(/<!\[/g, '\x3c!--[').replace(/\]>/g, ']--\x3e');
|
|
846
|
+
},
|
|
847
|
+
});
|
|
848
|
+
CKEDITOR.config.pasteFromWord_heuristicsEdgeList = !0;
|
|
849
|
+
})();
|