tinymce-rails 4.9.4 → 4.9.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/source/tinymce/tinymce.js +1700 -1089
- data/lib/tinymce/rails/configuration.rb +1 -1
- data/lib/tinymce/rails/engine.rb +5 -1
- data/lib/tinymce/rails/helper.rb +1 -1
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/config/tinymce-rails.manifest.js +8 -0
- data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/content.inline.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/content.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/themes/inlite/theme.js +1 -1
- data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +1 -1
- data/vendor/assets/javascripts/tinymce/themes/modern/theme.js +1 -1
- data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
- metadata +4 -3
@@ -1,13 +1,9 @@
|
|
1
|
-
// 4.9.
|
1
|
+
// 4.9.11 (2020-07-13)
|
2
2
|
(function () {
|
3
3
|
(function (domGlobals) {
|
4
4
|
'use strict';
|
5
5
|
|
6
6
|
var noop = function () {
|
7
|
-
var args = [];
|
8
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
9
|
-
args[_i] = arguments[_i];
|
10
|
-
}
|
11
7
|
};
|
12
8
|
var compose = function (fa, fb) {
|
13
9
|
return function () {
|
@@ -57,8 +53,6 @@
|
|
57
53
|
var never = constant(false);
|
58
54
|
var always = constant(true);
|
59
55
|
|
60
|
-
var never$1 = never;
|
61
|
-
var always$1 = always;
|
62
56
|
var none = function () {
|
63
57
|
return NONE;
|
64
58
|
};
|
@@ -72,37 +66,27 @@
|
|
72
66
|
var id = function (n) {
|
73
67
|
return n;
|
74
68
|
};
|
75
|
-
var noop = function () {
|
76
|
-
};
|
77
|
-
var nul = function () {
|
78
|
-
return null;
|
79
|
-
};
|
80
|
-
var undef = function () {
|
81
|
-
return undefined;
|
82
|
-
};
|
83
69
|
var me = {
|
84
70
|
fold: function (n, s) {
|
85
71
|
return n();
|
86
72
|
},
|
87
|
-
is: never
|
88
|
-
isSome: never
|
89
|
-
isNone: always
|
73
|
+
is: never,
|
74
|
+
isSome: never,
|
75
|
+
isNone: always,
|
90
76
|
getOr: id,
|
91
77
|
getOrThunk: call,
|
92
78
|
getOrDie: function (msg) {
|
93
79
|
throw new Error(msg || 'error: getOrDie called on none.');
|
94
80
|
},
|
95
|
-
getOrNull:
|
96
|
-
getOrUndefined:
|
81
|
+
getOrNull: constant(null),
|
82
|
+
getOrUndefined: constant(undefined),
|
97
83
|
or: id,
|
98
84
|
orThunk: call,
|
99
85
|
map: none,
|
100
|
-
ap: none,
|
101
86
|
each: noop,
|
102
87
|
bind: none,
|
103
|
-
|
104
|
-
|
105
|
-
forall: always$1,
|
88
|
+
exists: never,
|
89
|
+
forall: always,
|
106
90
|
filter: none,
|
107
91
|
equals: eq,
|
108
92
|
equals_: eq,
|
@@ -111,20 +95,16 @@
|
|
111
95
|
},
|
112
96
|
toString: constant('none()')
|
113
97
|
};
|
114
|
-
if (Object.freeze)
|
98
|
+
if (Object.freeze) {
|
115
99
|
Object.freeze(me);
|
100
|
+
}
|
116
101
|
return me;
|
117
102
|
}();
|
118
103
|
var some = function (a) {
|
119
|
-
var constant_a =
|
120
|
-
return a;
|
121
|
-
};
|
104
|
+
var constant_a = constant(a);
|
122
105
|
var self = function () {
|
123
106
|
return me;
|
124
107
|
};
|
125
|
-
var map = function (f) {
|
126
|
-
return some(f(a));
|
127
|
-
};
|
128
108
|
var bind = function (f) {
|
129
109
|
return f(a);
|
130
110
|
};
|
@@ -135,8 +115,8 @@
|
|
135
115
|
is: function (v) {
|
136
116
|
return a === v;
|
137
117
|
},
|
138
|
-
isSome: always
|
139
|
-
isNone: never
|
118
|
+
isSome: always,
|
119
|
+
isNone: never,
|
140
120
|
getOr: constant_a,
|
141
121
|
getOrThunk: constant_a,
|
142
122
|
getOrDie: constant_a,
|
@@ -144,35 +124,31 @@
|
|
144
124
|
getOrUndefined: constant_a,
|
145
125
|
or: self,
|
146
126
|
orThunk: self,
|
147
|
-
map:
|
148
|
-
|
149
|
-
return optfab.fold(none, function (fab) {
|
150
|
-
return some(fab(a));
|
151
|
-
});
|
127
|
+
map: function (f) {
|
128
|
+
return some(f(a));
|
152
129
|
},
|
153
130
|
each: function (f) {
|
154
131
|
f(a);
|
155
132
|
},
|
156
133
|
bind: bind,
|
157
|
-
flatten: constant_a,
|
158
134
|
exists: bind,
|
159
135
|
forall: bind,
|
160
136
|
filter: function (f) {
|
161
137
|
return f(a) ? me : NONE;
|
162
138
|
},
|
139
|
+
toArray: function () {
|
140
|
+
return [a];
|
141
|
+
},
|
142
|
+
toString: function () {
|
143
|
+
return 'some(' + a + ')';
|
144
|
+
},
|
163
145
|
equals: function (o) {
|
164
146
|
return o.is(a);
|
165
147
|
},
|
166
148
|
equals_: function (o, elementEq) {
|
167
|
-
return o.fold(never
|
149
|
+
return o.fold(never, function (b) {
|
168
150
|
return elementEq(a, b);
|
169
151
|
});
|
170
|
-
},
|
171
|
-
toArray: function () {
|
172
|
-
return [a];
|
173
|
-
},
|
174
|
-
toString: function () {
|
175
|
-
return 'some(' + a + ')';
|
176
152
|
}
|
177
153
|
};
|
178
154
|
return me;
|
@@ -187,13 +163,16 @@
|
|
187
163
|
};
|
188
164
|
|
189
165
|
var typeOf = function (x) {
|
190
|
-
if (x === null)
|
166
|
+
if (x === null) {
|
191
167
|
return 'null';
|
168
|
+
}
|
192
169
|
var t = typeof x;
|
193
|
-
if (t === 'object' && Array.prototype.isPrototypeOf(x))
|
170
|
+
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
194
171
|
return 'array';
|
195
|
-
|
172
|
+
}
|
173
|
+
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
196
174
|
return 'string';
|
175
|
+
}
|
197
176
|
return t;
|
198
177
|
};
|
199
178
|
var isType = function (type) {
|
@@ -209,16 +188,12 @@
|
|
209
188
|
var isFunction = isType('function');
|
210
189
|
var isNumber = isType('number');
|
211
190
|
|
212
|
-
var
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
return slowIndexOf(xs, x);
|
219
|
-
};
|
220
|
-
return pIndexOf === undefined ? slowIndex : fastIndex;
|
221
|
-
}();
|
191
|
+
var nativeSlice = Array.prototype.slice;
|
192
|
+
var nativeIndexOf = Array.prototype.indexOf;
|
193
|
+
var nativePush = Array.prototype.push;
|
194
|
+
var rawIndexOf = function (ts, t) {
|
195
|
+
return nativeIndexOf.call(ts, t);
|
196
|
+
};
|
222
197
|
var indexOf = function (xs, x) {
|
223
198
|
var r = rawIndexOf(xs, x);
|
224
199
|
return r === -1 ? Option.none() : Option.some(r);
|
@@ -227,27 +202,33 @@
|
|
227
202
|
return rawIndexOf(xs, x) > -1;
|
228
203
|
};
|
229
204
|
var exists = function (xs, pred) {
|
230
|
-
|
205
|
+
for (var i = 0, len = xs.length; i < len; i++) {
|
206
|
+
var x = xs[i];
|
207
|
+
if (pred(x, i)) {
|
208
|
+
return true;
|
209
|
+
}
|
210
|
+
}
|
211
|
+
return false;
|
231
212
|
};
|
232
213
|
var map = function (xs, f) {
|
233
214
|
var len = xs.length;
|
234
215
|
var r = new Array(len);
|
235
216
|
for (var i = 0; i < len; i++) {
|
236
217
|
var x = xs[i];
|
237
|
-
r[i] = f(x, i
|
218
|
+
r[i] = f(x, i);
|
238
219
|
}
|
239
220
|
return r;
|
240
221
|
};
|
241
222
|
var each = function (xs, f) {
|
242
223
|
for (var i = 0, len = xs.length; i < len; i++) {
|
243
224
|
var x = xs[i];
|
244
|
-
f(x, i
|
225
|
+
f(x, i);
|
245
226
|
}
|
246
227
|
};
|
247
228
|
var eachr = function (xs, f) {
|
248
229
|
for (var i = xs.length - 1; i >= 0; i--) {
|
249
230
|
var x = xs[i];
|
250
|
-
f(x, i
|
231
|
+
f(x, i);
|
251
232
|
}
|
252
233
|
};
|
253
234
|
var partition = function (xs, pred) {
|
@@ -255,7 +236,7 @@
|
|
255
236
|
var fail = [];
|
256
237
|
for (var i = 0, len = xs.length; i < len; i++) {
|
257
238
|
var x = xs[i];
|
258
|
-
var arr = pred(x, i
|
239
|
+
var arr = pred(x, i) ? pass : fail;
|
259
240
|
arr.push(x);
|
260
241
|
}
|
261
242
|
return {
|
@@ -267,7 +248,7 @@
|
|
267
248
|
var r = [];
|
268
249
|
for (var i = 0, len = xs.length; i < len; i++) {
|
269
250
|
var x = xs[i];
|
270
|
-
if (pred(x, i
|
251
|
+
if (pred(x, i)) {
|
271
252
|
r.push(x);
|
272
253
|
}
|
273
254
|
}
|
@@ -288,7 +269,7 @@
|
|
288
269
|
var find = function (xs, pred) {
|
289
270
|
for (var i = 0, len = xs.length; i < len; i++) {
|
290
271
|
var x = xs[i];
|
291
|
-
if (pred(x, i
|
272
|
+
if (pred(x, i)) {
|
292
273
|
return Option.some(x);
|
293
274
|
}
|
294
275
|
}
|
@@ -297,27 +278,19 @@
|
|
297
278
|
var findIndex = function (xs, pred) {
|
298
279
|
for (var i = 0, len = xs.length; i < len; i++) {
|
299
280
|
var x = xs[i];
|
300
|
-
if (pred(x, i
|
281
|
+
if (pred(x, i)) {
|
301
282
|
return Option.some(i);
|
302
283
|
}
|
303
284
|
}
|
304
285
|
return Option.none();
|
305
286
|
};
|
306
|
-
var slowIndexOf = function (xs, x) {
|
307
|
-
for (var i = 0, len = xs.length; i < len; ++i) {
|
308
|
-
if (xs[i] === x) {
|
309
|
-
return i;
|
310
|
-
}
|
311
|
-
}
|
312
|
-
return -1;
|
313
|
-
};
|
314
|
-
var push = Array.prototype.push;
|
315
287
|
var flatten = function (xs) {
|
316
288
|
var r = [];
|
317
289
|
for (var i = 0, len = xs.length; i < len; ++i) {
|
318
|
-
if (!
|
290
|
+
if (!isArray(xs[i])) {
|
319
291
|
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
|
320
|
-
|
292
|
+
}
|
293
|
+
nativePush.apply(r, xs[i]);
|
321
294
|
}
|
322
295
|
return r;
|
323
296
|
};
|
@@ -328,15 +301,14 @@
|
|
328
301
|
var forall = function (xs, pred) {
|
329
302
|
for (var i = 0, len = xs.length; i < len; ++i) {
|
330
303
|
var x = xs[i];
|
331
|
-
if (pred(x, i
|
304
|
+
if (pred(x, i) !== true) {
|
332
305
|
return false;
|
333
306
|
}
|
334
307
|
}
|
335
308
|
return true;
|
336
309
|
};
|
337
|
-
var slice = Array.prototype.slice;
|
338
310
|
var reverse = function (xs) {
|
339
|
-
var r =
|
311
|
+
var r = nativeSlice.call(xs, 0);
|
340
312
|
r.reverse();
|
341
313
|
return r;
|
342
314
|
};
|
@@ -354,7 +326,7 @@
|
|
354
326
|
return r;
|
355
327
|
};
|
356
328
|
var sort = function (xs, comparator) {
|
357
|
-
var copy =
|
329
|
+
var copy = nativeSlice.call(xs, 0);
|
358
330
|
copy.sort(comparator);
|
359
331
|
return copy;
|
360
332
|
};
|
@@ -365,15 +337,16 @@
|
|
365
337
|
return xs.length === 0 ? Option.none() : Option.some(xs[xs.length - 1]);
|
366
338
|
};
|
367
339
|
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
368
|
-
return
|
340
|
+
return nativeSlice.call(x);
|
369
341
|
};
|
370
342
|
|
371
343
|
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
|
372
344
|
|
373
345
|
var path = function (parts, scope) {
|
374
346
|
var o = scope !== undefined && scope !== null ? scope : Global;
|
375
|
-
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
|
347
|
+
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
|
376
348
|
o = o[parts[i]];
|
349
|
+
}
|
377
350
|
return o;
|
378
351
|
};
|
379
352
|
var resolve = function (p, scope) {
|
@@ -386,8 +359,9 @@
|
|
386
359
|
};
|
387
360
|
var getOrDie = function (name, scope) {
|
388
361
|
var actual = unsafe(name, scope);
|
389
|
-
if (actual === undefined || actual === null)
|
390
|
-
throw name + ' not available on this browser';
|
362
|
+
if (actual === undefined || actual === null) {
|
363
|
+
throw new Error(name + ' not available on this browser');
|
364
|
+
}
|
391
365
|
return actual;
|
392
366
|
};
|
393
367
|
var Global$1 = { getOrDie: getOrDie };
|
@@ -1091,7 +1065,7 @@
|
|
1091
1065
|
hasDuplicate = true;
|
1092
1066
|
}
|
1093
1067
|
return 0;
|
1094
|
-
}, strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, hasOwn = {}.hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push
|
1068
|
+
}, strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, hasOwn = {}.hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, indexOf$1 = arr.indexOf || function (elem) {
|
1095
1069
|
var i = 0, len = this.length;
|
1096
1070
|
for (; i < len; i++) {
|
1097
1071
|
if (this[i] === elem) {
|
@@ -1113,12 +1087,12 @@
|
|
1113
1087
|
return high !== high || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
|
1114
1088
|
};
|
1115
1089
|
try {
|
1116
|
-
push
|
1090
|
+
push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes);
|
1117
1091
|
arr[preferredDoc.childNodes.length].nodeType;
|
1118
1092
|
} catch (e) {
|
1119
|
-
push
|
1093
|
+
push = {
|
1120
1094
|
apply: arr.length ? function (target, els) {
|
1121
|
-
push_native.apply(target, slice
|
1095
|
+
push_native.apply(target, slice.call(els));
|
1122
1096
|
} : function (target, els) {
|
1123
1097
|
var j = target.length, i = 0;
|
1124
1098
|
while (target[j++] = els[i++]) {
|
@@ -1160,10 +1134,10 @@
|
|
1160
1134
|
}
|
1161
1135
|
}
|
1162
1136
|
} else if (match[2]) {
|
1163
|
-
push
|
1137
|
+
push.apply(results, context.getElementsByTagName(selector));
|
1164
1138
|
return results;
|
1165
1139
|
} else if ((m = match[3]) && support.getElementsByClassName) {
|
1166
|
-
push
|
1140
|
+
push.apply(results, context.getElementsByClassName(m));
|
1167
1141
|
return results;
|
1168
1142
|
}
|
1169
1143
|
}
|
@@ -1188,7 +1162,7 @@
|
|
1188
1162
|
}
|
1189
1163
|
if (newSelector) {
|
1190
1164
|
try {
|
1191
|
-
push
|
1165
|
+
push.apply(results, newContext.querySelectorAll(newSelector));
|
1192
1166
|
return results;
|
1193
1167
|
} catch (qsaError) {
|
1194
1168
|
} finally {
|
@@ -1944,7 +1918,7 @@
|
|
1944
1918
|
if (postFinder) {
|
1945
1919
|
postFinder(null, results, matcherOut, xml);
|
1946
1920
|
} else {
|
1947
|
-
push
|
1921
|
+
push.apply(results, matcherOut);
|
1948
1922
|
}
|
1949
1923
|
}
|
1950
1924
|
});
|
@@ -2020,7 +1994,7 @@
|
|
2020
1994
|
}
|
2021
1995
|
setMatched = condense(setMatched);
|
2022
1996
|
}
|
2023
|
-
push
|
1997
|
+
push.apply(results, setMatched);
|
2024
1998
|
if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
|
2025
1999
|
Sizzle.uniqueSort(results);
|
2026
2000
|
}
|
@@ -2078,7 +2052,7 @@
|
|
2078
2052
|
tokens.splice(i, 1);
|
2079
2053
|
selector = seed.length && toSelector(tokens);
|
2080
2054
|
if (!selector) {
|
2081
|
-
push
|
2055
|
+
push.apply(results, seed);
|
2082
2056
|
return results;
|
2083
2057
|
}
|
2084
2058
|
break;
|
@@ -2378,7 +2352,7 @@
|
|
2378
2352
|
_addCacheSuffix: _addCacheSuffix
|
2379
2353
|
};
|
2380
2354
|
|
2381
|
-
var doc = domGlobals.document, push$
|
2355
|
+
var doc = domGlobals.document, push$1 = Array.prototype.push, slice$1 = Array.prototype.slice;
|
2382
2356
|
var rquickExpr$1 = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;
|
2383
2357
|
var Event = EventUtils.Event;
|
2384
2358
|
var skipUniques = Tools.makeMap('children,contents,next,prev');
|
@@ -2556,7 +2530,7 @@
|
|
2556
2530
|
if (match[1]) {
|
2557
2531
|
node = createFragment(selector, getElementDocument(context)).firstChild;
|
2558
2532
|
while (node) {
|
2559
|
-
push$
|
2533
|
+
push$1.call(self, node);
|
2560
2534
|
node = node.nextSibling;
|
2561
2535
|
}
|
2562
2536
|
} else {
|
@@ -2594,7 +2568,7 @@
|
|
2594
2568
|
self[i] = nodes[i];
|
2595
2569
|
}
|
2596
2570
|
} else {
|
2597
|
-
push$
|
2571
|
+
push$1.apply(self, DomQuery.makeArray(items));
|
2598
2572
|
}
|
2599
2573
|
return self;
|
2600
2574
|
},
|
@@ -2911,7 +2885,7 @@
|
|
2911
2885
|
return this.css('display', 'none');
|
2912
2886
|
},
|
2913
2887
|
slice: function () {
|
2914
|
-
return new DomQuery(slice$
|
2888
|
+
return new DomQuery(slice$1.apply(this, arguments));
|
2915
2889
|
},
|
2916
2890
|
eq: function (index) {
|
2917
2891
|
return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
|
@@ -2978,7 +2952,7 @@
|
|
2978
2952
|
}
|
2979
2953
|
return this.css(offset);
|
2980
2954
|
},
|
2981
|
-
push: push$
|
2955
|
+
push: push$1,
|
2982
2956
|
sort: [].sort,
|
2983
2957
|
splice: [].splice
|
2984
2958
|
};
|
@@ -3252,18 +3226,20 @@
|
|
3252
3226
|
var firstMatch = function (regexes, s) {
|
3253
3227
|
for (var i = 0; i < regexes.length; i++) {
|
3254
3228
|
var x = regexes[i];
|
3255
|
-
if (x.test(s))
|
3229
|
+
if (x.test(s)) {
|
3256
3230
|
return x;
|
3231
|
+
}
|
3257
3232
|
}
|
3258
3233
|
return undefined;
|
3259
3234
|
};
|
3260
3235
|
var find$2 = function (regexes, agent) {
|
3261
3236
|
var r = firstMatch(regexes, agent);
|
3262
|
-
if (!r)
|
3237
|
+
if (!r) {
|
3263
3238
|
return {
|
3264
3239
|
major: 0,
|
3265
3240
|
minor: 0
|
3266
3241
|
};
|
3242
|
+
}
|
3267
3243
|
var group = function (i) {
|
3268
3244
|
return Number(agent.replace(r, '$' + i));
|
3269
3245
|
};
|
@@ -3271,8 +3247,9 @@
|
|
3271
3247
|
};
|
3272
3248
|
var detect = function (versionRegexes, agent) {
|
3273
3249
|
var cleanedAgent = String(agent).toLowerCase();
|
3274
|
-
if (versionRegexes.length === 0)
|
3250
|
+
if (versionRegexes.length === 0) {
|
3275
3251
|
return unknown();
|
3252
|
+
}
|
3276
3253
|
return find$2(versionRegexes, cleanedAgent);
|
3277
3254
|
};
|
3278
3255
|
var unknown = function () {
|
@@ -3451,8 +3428,7 @@
|
|
3451
3428
|
name: 'Edge',
|
3452
3429
|
versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
|
3453
3430
|
search: function (uastring) {
|
3454
|
-
|
3455
|
-
return monstrosity;
|
3431
|
+
return contains$2(uastring, 'edge/') && contains$2(uastring, 'chrome') && contains$2(uastring, 'safari') && contains$2(uastring, 'applewebkit');
|
3456
3432
|
}
|
3457
3433
|
},
|
3458
3434
|
{
|
@@ -3640,21 +3616,21 @@
|
|
3640
3616
|
for (var k = 0, len = props.length; k < len; k++) {
|
3641
3617
|
var i = props[k];
|
3642
3618
|
var x = obj[i];
|
3643
|
-
f(x, i
|
3619
|
+
f(x, i);
|
3644
3620
|
}
|
3645
3621
|
};
|
3646
3622
|
var map$2 = function (obj, f) {
|
3647
|
-
return tupleMap(obj, function (x, i
|
3623
|
+
return tupleMap(obj, function (x, i) {
|
3648
3624
|
return {
|
3649
3625
|
k: i,
|
3650
|
-
v: f(x, i
|
3626
|
+
v: f(x, i)
|
3651
3627
|
};
|
3652
3628
|
});
|
3653
3629
|
};
|
3654
3630
|
var tupleMap = function (obj, f) {
|
3655
3631
|
var r = {};
|
3656
3632
|
each$3(obj, function (x, i) {
|
3657
|
-
var tuple = f(x, i
|
3633
|
+
var tuple = f(x, i);
|
3658
3634
|
r[tuple.k] = tuple.v;
|
3659
3635
|
});
|
3660
3636
|
return r;
|
@@ -3676,7 +3652,7 @@
|
|
3676
3652
|
};
|
3677
3653
|
|
3678
3654
|
var isSupported = function (dom) {
|
3679
|
-
return dom.style !== undefined;
|
3655
|
+
return dom.style !== undefined && isFunction(dom.style.getPropertyValue);
|
3680
3656
|
};
|
3681
3657
|
|
3682
3658
|
var inBody = function (element) {
|
@@ -3745,6 +3721,17 @@
|
|
3745
3721
|
return r.length > 0;
|
3746
3722
|
});
|
3747
3723
|
};
|
3724
|
+
var getAllRaw = function (element) {
|
3725
|
+
var css = {};
|
3726
|
+
var dom = element.dom();
|
3727
|
+
if (isSupported(dom)) {
|
3728
|
+
for (var i = 0; i < dom.style.length; i++) {
|
3729
|
+
var ruleName = dom.style.item(i);
|
3730
|
+
css[ruleName] = dom.style[ruleName];
|
3731
|
+
}
|
3732
|
+
}
|
3733
|
+
return css;
|
3734
|
+
};
|
3748
3735
|
|
3749
3736
|
var Immutable = function () {
|
3750
3737
|
var fields = [];
|
@@ -3802,19 +3789,22 @@
|
|
3802
3789
|
var ELEMENT$1 = ELEMENT;
|
3803
3790
|
var DOCUMENT$1 = DOCUMENT;
|
3804
3791
|
var is$1 = function (element, selector) {
|
3805
|
-
var
|
3806
|
-
if (
|
3792
|
+
var dom = element.dom();
|
3793
|
+
if (dom.nodeType !== ELEMENT$1) {
|
3807
3794
|
return false;
|
3808
|
-
} else if (elem.matches !== undefined) {
|
3809
|
-
return elem.matches(selector);
|
3810
|
-
} else if (elem.msMatchesSelector !== undefined) {
|
3811
|
-
return elem.msMatchesSelector(selector);
|
3812
|
-
} else if (elem.webkitMatchesSelector !== undefined) {
|
3813
|
-
return elem.webkitMatchesSelector(selector);
|
3814
|
-
} else if (elem.mozMatchesSelector !== undefined) {
|
3815
|
-
return elem.mozMatchesSelector(selector);
|
3816
3795
|
} else {
|
3817
|
-
|
3796
|
+
var elem = dom;
|
3797
|
+
if (elem.matches !== undefined) {
|
3798
|
+
return elem.matches(selector);
|
3799
|
+
} else if (elem.msMatchesSelector !== undefined) {
|
3800
|
+
return elem.msMatchesSelector(selector);
|
3801
|
+
} else if (elem.webkitMatchesSelector !== undefined) {
|
3802
|
+
return elem.webkitMatchesSelector(selector);
|
3803
|
+
} else if (elem.mozMatchesSelector !== undefined) {
|
3804
|
+
return elem.mozMatchesSelector(selector);
|
3805
|
+
} else {
|
3806
|
+
throw new Error('Browser lacks native selectors');
|
3807
|
+
}
|
3818
3808
|
}
|
3819
3809
|
};
|
3820
3810
|
var bypassSelector = function (dom) {
|
@@ -3850,16 +3840,13 @@
|
|
3850
3840
|
return Element.fromDom(element.dom().ownerDocument.documentElement);
|
3851
3841
|
};
|
3852
3842
|
var defaultView = function (element) {
|
3853
|
-
|
3854
|
-
var defView = el.ownerDocument.defaultView;
|
3855
|
-
return Element.fromDom(defView);
|
3843
|
+
return Element.fromDom(element.dom().ownerDocument.defaultView);
|
3856
3844
|
};
|
3857
3845
|
var parent = function (element) {
|
3858
|
-
|
3859
|
-
return Option.from(dom.parentNode).map(Element.fromDom);
|
3846
|
+
return Option.from(element.dom().parentNode).map(Element.fromDom);
|
3860
3847
|
};
|
3861
3848
|
var parents = function (element, isRoot) {
|
3862
|
-
var stop = isFunction(isRoot) ? isRoot :
|
3849
|
+
var stop = isFunction(isRoot) ? isRoot : never;
|
3863
3850
|
var dom = element.dom();
|
3864
3851
|
var ret = [];
|
3865
3852
|
while (dom.parentNode !== null && dom.parentNode !== undefined) {
|
@@ -3875,12 +3862,10 @@
|
|
3875
3862
|
return ret;
|
3876
3863
|
};
|
3877
3864
|
var prevSibling = function (element) {
|
3878
|
-
|
3879
|
-
return Option.from(dom.previousSibling).map(Element.fromDom);
|
3865
|
+
return Option.from(element.dom().previousSibling).map(Element.fromDom);
|
3880
3866
|
};
|
3881
3867
|
var nextSibling = function (element) {
|
3882
|
-
|
3883
|
-
return Option.from(dom.nextSibling).map(Element.fromDom);
|
3868
|
+
return Option.from(element.dom().nextSibling).map(Element.fromDom);
|
3884
3869
|
};
|
3885
3870
|
var prevSiblings = function (element) {
|
3886
3871
|
return reverse(Recurse.toArray(element, prevSibling));
|
@@ -3889,8 +3874,7 @@
|
|
3889
3874
|
return Recurse.toArray(element, nextSibling);
|
3890
3875
|
};
|
3891
3876
|
var children = function (element) {
|
3892
|
-
|
3893
|
-
return map(dom.childNodes, Element.fromDom);
|
3877
|
+
return map(element.dom().childNodes, Element.fromDom);
|
3894
3878
|
};
|
3895
3879
|
var child = function (element, index) {
|
3896
3880
|
var cs = element.dom().childNodes;
|
@@ -3963,6 +3947,503 @@
|
|
3963
3947
|
};
|
3964
3948
|
var Position = { getPos: getPos };
|
3965
3949
|
|
3950
|
+
var exports$1 = {}, module$1 = { exports: exports$1 };
|
3951
|
+
(function (define, exports, module, require) {
|
3952
|
+
(function (f) {
|
3953
|
+
if (typeof exports === 'object' && typeof module !== 'undefined') {
|
3954
|
+
module.exports = f();
|
3955
|
+
} else if (typeof define === 'function' && define.amd) {
|
3956
|
+
define([], f);
|
3957
|
+
} else {
|
3958
|
+
var g;
|
3959
|
+
if (typeof window !== 'undefined') {
|
3960
|
+
g = window;
|
3961
|
+
} else if (typeof global !== 'undefined') {
|
3962
|
+
g = global;
|
3963
|
+
} else if (typeof self !== 'undefined') {
|
3964
|
+
g = self;
|
3965
|
+
} else {
|
3966
|
+
g = this;
|
3967
|
+
}
|
3968
|
+
g.EphoxContactWrapper = f();
|
3969
|
+
}
|
3970
|
+
}(function () {
|
3971
|
+
return function () {
|
3972
|
+
function r(e, n, t) {
|
3973
|
+
function o(i, f) {
|
3974
|
+
if (!n[i]) {
|
3975
|
+
if (!e[i]) {
|
3976
|
+
var c = 'function' == typeof require && require;
|
3977
|
+
if (!f && c)
|
3978
|
+
return c(i, !0);
|
3979
|
+
if (u)
|
3980
|
+
return u(i, !0);
|
3981
|
+
var a = new Error('Cannot find module \'' + i + '\'');
|
3982
|
+
throw a.code = 'MODULE_NOT_FOUND', a;
|
3983
|
+
}
|
3984
|
+
var p = n[i] = { exports: {} };
|
3985
|
+
e[i][0].call(p.exports, function (r) {
|
3986
|
+
var n = e[i][1][r];
|
3987
|
+
return o(n || r);
|
3988
|
+
}, p, p.exports, r, e, n, t);
|
3989
|
+
}
|
3990
|
+
return n[i].exports;
|
3991
|
+
}
|
3992
|
+
for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++)
|
3993
|
+
o(t[i]);
|
3994
|
+
return o;
|
3995
|
+
}
|
3996
|
+
return r;
|
3997
|
+
}()({
|
3998
|
+
1: [
|
3999
|
+
function (require, module, exports) {
|
4000
|
+
var process = module.exports = {};
|
4001
|
+
var cachedSetTimeout;
|
4002
|
+
var cachedClearTimeout;
|
4003
|
+
function defaultSetTimout() {
|
4004
|
+
throw new Error('setTimeout has not been defined');
|
4005
|
+
}
|
4006
|
+
function defaultClearTimeout() {
|
4007
|
+
throw new Error('clearTimeout has not been defined');
|
4008
|
+
}
|
4009
|
+
(function () {
|
4010
|
+
try {
|
4011
|
+
if (typeof setTimeout === 'function') {
|
4012
|
+
cachedSetTimeout = setTimeout;
|
4013
|
+
} else {
|
4014
|
+
cachedSetTimeout = defaultSetTimout;
|
4015
|
+
}
|
4016
|
+
} catch (e) {
|
4017
|
+
cachedSetTimeout = defaultSetTimout;
|
4018
|
+
}
|
4019
|
+
try {
|
4020
|
+
if (typeof clearTimeout === 'function') {
|
4021
|
+
cachedClearTimeout = clearTimeout;
|
4022
|
+
} else {
|
4023
|
+
cachedClearTimeout = defaultClearTimeout;
|
4024
|
+
}
|
4025
|
+
} catch (e) {
|
4026
|
+
cachedClearTimeout = defaultClearTimeout;
|
4027
|
+
}
|
4028
|
+
}());
|
4029
|
+
function runTimeout(fun) {
|
4030
|
+
if (cachedSetTimeout === setTimeout) {
|
4031
|
+
return setTimeout(fun, 0);
|
4032
|
+
}
|
4033
|
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
4034
|
+
cachedSetTimeout = setTimeout;
|
4035
|
+
return setTimeout(fun, 0);
|
4036
|
+
}
|
4037
|
+
try {
|
4038
|
+
return cachedSetTimeout(fun, 0);
|
4039
|
+
} catch (e) {
|
4040
|
+
try {
|
4041
|
+
return cachedSetTimeout.call(null, fun, 0);
|
4042
|
+
} catch (e) {
|
4043
|
+
return cachedSetTimeout.call(this, fun, 0);
|
4044
|
+
}
|
4045
|
+
}
|
4046
|
+
}
|
4047
|
+
function runClearTimeout(marker) {
|
4048
|
+
if (cachedClearTimeout === clearTimeout) {
|
4049
|
+
return clearTimeout(marker);
|
4050
|
+
}
|
4051
|
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
4052
|
+
cachedClearTimeout = clearTimeout;
|
4053
|
+
return clearTimeout(marker);
|
4054
|
+
}
|
4055
|
+
try {
|
4056
|
+
return cachedClearTimeout(marker);
|
4057
|
+
} catch (e) {
|
4058
|
+
try {
|
4059
|
+
return cachedClearTimeout.call(null, marker);
|
4060
|
+
} catch (e) {
|
4061
|
+
return cachedClearTimeout.call(this, marker);
|
4062
|
+
}
|
4063
|
+
}
|
4064
|
+
}
|
4065
|
+
var queue = [];
|
4066
|
+
var draining = false;
|
4067
|
+
var currentQueue;
|
4068
|
+
var queueIndex = -1;
|
4069
|
+
function cleanUpNextTick() {
|
4070
|
+
if (!draining || !currentQueue) {
|
4071
|
+
return;
|
4072
|
+
}
|
4073
|
+
draining = false;
|
4074
|
+
if (currentQueue.length) {
|
4075
|
+
queue = currentQueue.concat(queue);
|
4076
|
+
} else {
|
4077
|
+
queueIndex = -1;
|
4078
|
+
}
|
4079
|
+
if (queue.length) {
|
4080
|
+
drainQueue();
|
4081
|
+
}
|
4082
|
+
}
|
4083
|
+
function drainQueue() {
|
4084
|
+
if (draining) {
|
4085
|
+
return;
|
4086
|
+
}
|
4087
|
+
var timeout = runTimeout(cleanUpNextTick);
|
4088
|
+
draining = true;
|
4089
|
+
var len = queue.length;
|
4090
|
+
while (len) {
|
4091
|
+
currentQueue = queue;
|
4092
|
+
queue = [];
|
4093
|
+
while (++queueIndex < len) {
|
4094
|
+
if (currentQueue) {
|
4095
|
+
currentQueue[queueIndex].run();
|
4096
|
+
}
|
4097
|
+
}
|
4098
|
+
queueIndex = -1;
|
4099
|
+
len = queue.length;
|
4100
|
+
}
|
4101
|
+
currentQueue = null;
|
4102
|
+
draining = false;
|
4103
|
+
runClearTimeout(timeout);
|
4104
|
+
}
|
4105
|
+
process.nextTick = function (fun) {
|
4106
|
+
var args = new Array(arguments.length - 1);
|
4107
|
+
if (arguments.length > 1) {
|
4108
|
+
for (var i = 1; i < arguments.length; i++) {
|
4109
|
+
args[i - 1] = arguments[i];
|
4110
|
+
}
|
4111
|
+
}
|
4112
|
+
queue.push(new Item(fun, args));
|
4113
|
+
if (queue.length === 1 && !draining) {
|
4114
|
+
runTimeout(drainQueue);
|
4115
|
+
}
|
4116
|
+
};
|
4117
|
+
function Item(fun, array) {
|
4118
|
+
this.fun = fun;
|
4119
|
+
this.array = array;
|
4120
|
+
}
|
4121
|
+
Item.prototype.run = function () {
|
4122
|
+
this.fun.apply(null, this.array);
|
4123
|
+
};
|
4124
|
+
process.title = 'browser';
|
4125
|
+
process.browser = true;
|
4126
|
+
process.env = {};
|
4127
|
+
process.argv = [];
|
4128
|
+
process.version = '';
|
4129
|
+
process.versions = {};
|
4130
|
+
function noop() {
|
4131
|
+
}
|
4132
|
+
process.on = noop;
|
4133
|
+
process.addListener = noop;
|
4134
|
+
process.once = noop;
|
4135
|
+
process.off = noop;
|
4136
|
+
process.removeListener = noop;
|
4137
|
+
process.removeAllListeners = noop;
|
4138
|
+
process.emit = noop;
|
4139
|
+
process.prependListener = noop;
|
4140
|
+
process.prependOnceListener = noop;
|
4141
|
+
process.listeners = function (name) {
|
4142
|
+
return [];
|
4143
|
+
};
|
4144
|
+
process.binding = function (name) {
|
4145
|
+
throw new Error('process.binding is not supported');
|
4146
|
+
};
|
4147
|
+
process.cwd = function () {
|
4148
|
+
return '/';
|
4149
|
+
};
|
4150
|
+
process.chdir = function (dir) {
|
4151
|
+
throw new Error('process.chdir is not supported');
|
4152
|
+
};
|
4153
|
+
process.umask = function () {
|
4154
|
+
return 0;
|
4155
|
+
};
|
4156
|
+
},
|
4157
|
+
{}
|
4158
|
+
],
|
4159
|
+
2: [
|
4160
|
+
function (require, module, exports) {
|
4161
|
+
(function (setImmediate) {
|
4162
|
+
(function (root) {
|
4163
|
+
var setTimeoutFunc = setTimeout;
|
4164
|
+
function noop() {
|
4165
|
+
}
|
4166
|
+
function bind(fn, thisArg) {
|
4167
|
+
return function () {
|
4168
|
+
fn.apply(thisArg, arguments);
|
4169
|
+
};
|
4170
|
+
}
|
4171
|
+
function Promise(fn) {
|
4172
|
+
if (typeof this !== 'object')
|
4173
|
+
throw new TypeError('Promises must be constructed via new');
|
4174
|
+
if (typeof fn !== 'function')
|
4175
|
+
throw new TypeError('not a function');
|
4176
|
+
this._state = 0;
|
4177
|
+
this._handled = false;
|
4178
|
+
this._value = undefined;
|
4179
|
+
this._deferreds = [];
|
4180
|
+
doResolve(fn, this);
|
4181
|
+
}
|
4182
|
+
function handle(self, deferred) {
|
4183
|
+
while (self._state === 3) {
|
4184
|
+
self = self._value;
|
4185
|
+
}
|
4186
|
+
if (self._state === 0) {
|
4187
|
+
self._deferreds.push(deferred);
|
4188
|
+
return;
|
4189
|
+
}
|
4190
|
+
self._handled = true;
|
4191
|
+
Promise._immediateFn(function () {
|
4192
|
+
var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
|
4193
|
+
if (cb === null) {
|
4194
|
+
(self._state === 1 ? resolve : reject)(deferred.promise, self._value);
|
4195
|
+
return;
|
4196
|
+
}
|
4197
|
+
var ret;
|
4198
|
+
try {
|
4199
|
+
ret = cb(self._value);
|
4200
|
+
} catch (e) {
|
4201
|
+
reject(deferred.promise, e);
|
4202
|
+
return;
|
4203
|
+
}
|
4204
|
+
resolve(deferred.promise, ret);
|
4205
|
+
});
|
4206
|
+
}
|
4207
|
+
function resolve(self, newValue) {
|
4208
|
+
try {
|
4209
|
+
if (newValue === self)
|
4210
|
+
throw new TypeError('A promise cannot be resolved with itself.');
|
4211
|
+
if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
|
4212
|
+
var then = newValue.then;
|
4213
|
+
if (newValue instanceof Promise) {
|
4214
|
+
self._state = 3;
|
4215
|
+
self._value = newValue;
|
4216
|
+
finale(self);
|
4217
|
+
return;
|
4218
|
+
} else if (typeof then === 'function') {
|
4219
|
+
doResolve(bind(then, newValue), self);
|
4220
|
+
return;
|
4221
|
+
}
|
4222
|
+
}
|
4223
|
+
self._state = 1;
|
4224
|
+
self._value = newValue;
|
4225
|
+
finale(self);
|
4226
|
+
} catch (e) {
|
4227
|
+
reject(self, e);
|
4228
|
+
}
|
4229
|
+
}
|
4230
|
+
function reject(self, newValue) {
|
4231
|
+
self._state = 2;
|
4232
|
+
self._value = newValue;
|
4233
|
+
finale(self);
|
4234
|
+
}
|
4235
|
+
function finale(self) {
|
4236
|
+
if (self._state === 2 && self._deferreds.length === 0) {
|
4237
|
+
Promise._immediateFn(function () {
|
4238
|
+
if (!self._handled) {
|
4239
|
+
Promise._unhandledRejectionFn(self._value);
|
4240
|
+
}
|
4241
|
+
});
|
4242
|
+
}
|
4243
|
+
for (var i = 0, len = self._deferreds.length; i < len; i++) {
|
4244
|
+
handle(self, self._deferreds[i]);
|
4245
|
+
}
|
4246
|
+
self._deferreds = null;
|
4247
|
+
}
|
4248
|
+
function Handler(onFulfilled, onRejected, promise) {
|
4249
|
+
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
|
4250
|
+
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
|
4251
|
+
this.promise = promise;
|
4252
|
+
}
|
4253
|
+
function doResolve(fn, self) {
|
4254
|
+
var done = false;
|
4255
|
+
try {
|
4256
|
+
fn(function (value) {
|
4257
|
+
if (done)
|
4258
|
+
return;
|
4259
|
+
done = true;
|
4260
|
+
resolve(self, value);
|
4261
|
+
}, function (reason) {
|
4262
|
+
if (done)
|
4263
|
+
return;
|
4264
|
+
done = true;
|
4265
|
+
reject(self, reason);
|
4266
|
+
});
|
4267
|
+
} catch (ex) {
|
4268
|
+
if (done)
|
4269
|
+
return;
|
4270
|
+
done = true;
|
4271
|
+
reject(self, ex);
|
4272
|
+
}
|
4273
|
+
}
|
4274
|
+
Promise.prototype['catch'] = function (onRejected) {
|
4275
|
+
return this.then(null, onRejected);
|
4276
|
+
};
|
4277
|
+
Promise.prototype.then = function (onFulfilled, onRejected) {
|
4278
|
+
var prom = new this.constructor(noop);
|
4279
|
+
handle(this, new Handler(onFulfilled, onRejected, prom));
|
4280
|
+
return prom;
|
4281
|
+
};
|
4282
|
+
Promise.all = function (arr) {
|
4283
|
+
var args = Array.prototype.slice.call(arr);
|
4284
|
+
return new Promise(function (resolve, reject) {
|
4285
|
+
if (args.length === 0)
|
4286
|
+
return resolve([]);
|
4287
|
+
var remaining = args.length;
|
4288
|
+
function res(i, val) {
|
4289
|
+
try {
|
4290
|
+
if (val && (typeof val === 'object' || typeof val === 'function')) {
|
4291
|
+
var then = val.then;
|
4292
|
+
if (typeof then === 'function') {
|
4293
|
+
then.call(val, function (val) {
|
4294
|
+
res(i, val);
|
4295
|
+
}, reject);
|
4296
|
+
return;
|
4297
|
+
}
|
4298
|
+
}
|
4299
|
+
args[i] = val;
|
4300
|
+
if (--remaining === 0) {
|
4301
|
+
resolve(args);
|
4302
|
+
}
|
4303
|
+
} catch (ex) {
|
4304
|
+
reject(ex);
|
4305
|
+
}
|
4306
|
+
}
|
4307
|
+
for (var i = 0; i < args.length; i++) {
|
4308
|
+
res(i, args[i]);
|
4309
|
+
}
|
4310
|
+
});
|
4311
|
+
};
|
4312
|
+
Promise.resolve = function (value) {
|
4313
|
+
if (value && typeof value === 'object' && value.constructor === Promise) {
|
4314
|
+
return value;
|
4315
|
+
}
|
4316
|
+
return new Promise(function (resolve) {
|
4317
|
+
resolve(value);
|
4318
|
+
});
|
4319
|
+
};
|
4320
|
+
Promise.reject = function (value) {
|
4321
|
+
return new Promise(function (resolve, reject) {
|
4322
|
+
reject(value);
|
4323
|
+
});
|
4324
|
+
};
|
4325
|
+
Promise.race = function (values) {
|
4326
|
+
return new Promise(function (resolve, reject) {
|
4327
|
+
for (var i = 0, len = values.length; i < len; i++) {
|
4328
|
+
values[i].then(resolve, reject);
|
4329
|
+
}
|
4330
|
+
});
|
4331
|
+
};
|
4332
|
+
Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) {
|
4333
|
+
setImmediate(fn);
|
4334
|
+
} : function (fn) {
|
4335
|
+
setTimeoutFunc(fn, 0);
|
4336
|
+
};
|
4337
|
+
Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
|
4338
|
+
if (typeof console !== 'undefined' && console) {
|
4339
|
+
console.warn('Possible Unhandled Promise Rejection:', err);
|
4340
|
+
}
|
4341
|
+
};
|
4342
|
+
Promise._setImmediateFn = function _setImmediateFn(fn) {
|
4343
|
+
Promise._immediateFn = fn;
|
4344
|
+
};
|
4345
|
+
Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
|
4346
|
+
Promise._unhandledRejectionFn = fn;
|
4347
|
+
};
|
4348
|
+
if (typeof module !== 'undefined' && module.exports) {
|
4349
|
+
module.exports = Promise;
|
4350
|
+
} else if (!root.Promise) {
|
4351
|
+
root.Promise = Promise;
|
4352
|
+
}
|
4353
|
+
}(this));
|
4354
|
+
}.call(this, require('timers').setImmediate));
|
4355
|
+
},
|
4356
|
+
{ 'timers': 3 }
|
4357
|
+
],
|
4358
|
+
3: [
|
4359
|
+
function (require, module, exports) {
|
4360
|
+
(function (setImmediate, clearImmediate) {
|
4361
|
+
var nextTick = require('process/browser.js').nextTick;
|
4362
|
+
var apply = Function.prototype.apply;
|
4363
|
+
var slice = Array.prototype.slice;
|
4364
|
+
var immediateIds = {};
|
4365
|
+
var nextImmediateId = 0;
|
4366
|
+
exports.setTimeout = function () {
|
4367
|
+
return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
|
4368
|
+
};
|
4369
|
+
exports.setInterval = function () {
|
4370
|
+
return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
|
4371
|
+
};
|
4372
|
+
exports.clearTimeout = exports.clearInterval = function (timeout) {
|
4373
|
+
timeout.close();
|
4374
|
+
};
|
4375
|
+
function Timeout(id, clearFn) {
|
4376
|
+
this._id = id;
|
4377
|
+
this._clearFn = clearFn;
|
4378
|
+
}
|
4379
|
+
Timeout.prototype.unref = Timeout.prototype.ref = function () {
|
4380
|
+
};
|
4381
|
+
Timeout.prototype.close = function () {
|
4382
|
+
this._clearFn.call(window, this._id);
|
4383
|
+
};
|
4384
|
+
exports.enroll = function (item, msecs) {
|
4385
|
+
clearTimeout(item._idleTimeoutId);
|
4386
|
+
item._idleTimeout = msecs;
|
4387
|
+
};
|
4388
|
+
exports.unenroll = function (item) {
|
4389
|
+
clearTimeout(item._idleTimeoutId);
|
4390
|
+
item._idleTimeout = -1;
|
4391
|
+
};
|
4392
|
+
exports._unrefActive = exports.active = function (item) {
|
4393
|
+
clearTimeout(item._idleTimeoutId);
|
4394
|
+
var msecs = item._idleTimeout;
|
4395
|
+
if (msecs >= 0) {
|
4396
|
+
item._idleTimeoutId = setTimeout(function onTimeout() {
|
4397
|
+
if (item._onTimeout)
|
4398
|
+
item._onTimeout();
|
4399
|
+
}, msecs);
|
4400
|
+
}
|
4401
|
+
};
|
4402
|
+
exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) {
|
4403
|
+
var id = nextImmediateId++;
|
4404
|
+
var args = arguments.length < 2 ? false : slice.call(arguments, 1);
|
4405
|
+
immediateIds[id] = true;
|
4406
|
+
nextTick(function onNextTick() {
|
4407
|
+
if (immediateIds[id]) {
|
4408
|
+
if (args) {
|
4409
|
+
fn.apply(null, args);
|
4410
|
+
} else {
|
4411
|
+
fn.call(null);
|
4412
|
+
}
|
4413
|
+
exports.clearImmediate(id);
|
4414
|
+
}
|
4415
|
+
});
|
4416
|
+
return id;
|
4417
|
+
};
|
4418
|
+
exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) {
|
4419
|
+
delete immediateIds[id];
|
4420
|
+
};
|
4421
|
+
}.call(this, require('timers').setImmediate, require('timers').clearImmediate));
|
4422
|
+
},
|
4423
|
+
{
|
4424
|
+
'process/browser.js': 1,
|
4425
|
+
'timers': 3
|
4426
|
+
}
|
4427
|
+
],
|
4428
|
+
4: [
|
4429
|
+
function (require, module, exports) {
|
4430
|
+
var promisePolyfill = require('promise-polyfill');
|
4431
|
+
var Global = function () {
|
4432
|
+
if (typeof window !== 'undefined') {
|
4433
|
+
return window;
|
4434
|
+
} else {
|
4435
|
+
return Function('return this;')();
|
4436
|
+
}
|
4437
|
+
}();
|
4438
|
+
module.exports = { boltExport: Global.Promise || promisePolyfill };
|
4439
|
+
},
|
4440
|
+
{ 'promise-polyfill': 2 }
|
4441
|
+
]
|
4442
|
+
}, {}, [4])(4);
|
4443
|
+
}));
|
4444
|
+
}(undefined, exports$1, module$1, undefined));
|
4445
|
+
var Promise = module$1.exports.boltExport;
|
4446
|
+
|
3966
4447
|
var nu$3 = function (baseFn) {
|
3967
4448
|
var data = Option.none();
|
3968
4449
|
var callbacks = [];
|
@@ -3974,10 +4455,11 @@
|
|
3974
4455
|
});
|
3975
4456
|
};
|
3976
4457
|
var get = function (nCallback) {
|
3977
|
-
if (isReady())
|
4458
|
+
if (isReady()) {
|
3978
4459
|
call(nCallback);
|
3979
|
-
else
|
4460
|
+
} else {
|
3980
4461
|
callbacks.push(nCallback);
|
4462
|
+
}
|
3981
4463
|
};
|
3982
4464
|
var set = function (x) {
|
3983
4465
|
data = Option.some(x);
|
@@ -4014,42 +4496,31 @@
|
|
4014
4496
|
pure: pure
|
4015
4497
|
};
|
4016
4498
|
|
4017
|
-
var
|
4018
|
-
|
4019
|
-
|
4020
|
-
|
4021
|
-
args[_i] = arguments[_i];
|
4022
|
-
}
|
4023
|
-
var me = this;
|
4024
|
-
domGlobals.setTimeout(function () {
|
4025
|
-
f.apply(me, args);
|
4026
|
-
}, 0);
|
4027
|
-
};
|
4499
|
+
var errorReporter = function (err) {
|
4500
|
+
domGlobals.setTimeout(function () {
|
4501
|
+
throw err;
|
4502
|
+
}, 0);
|
4028
4503
|
};
|
4029
|
-
|
4030
|
-
var nu$4 = function (baseFn) {
|
4504
|
+
var make = function (run) {
|
4031
4505
|
var get = function (callback) {
|
4032
|
-
|
4506
|
+
run().then(callback, errorReporter);
|
4033
4507
|
};
|
4034
4508
|
var map = function (fab) {
|
4035
|
-
return
|
4036
|
-
|
4037
|
-
var value = fab(a);
|
4038
|
-
callback(value);
|
4039
|
-
});
|
4509
|
+
return make(function () {
|
4510
|
+
return run().then(fab);
|
4040
4511
|
});
|
4041
4512
|
};
|
4042
4513
|
var bind = function (aFutureB) {
|
4043
|
-
return
|
4044
|
-
|
4045
|
-
aFutureB(
|
4514
|
+
return make(function () {
|
4515
|
+
return run().then(function (v) {
|
4516
|
+
return aFutureB(v).toPromise();
|
4046
4517
|
});
|
4047
4518
|
});
|
4048
4519
|
};
|
4049
4520
|
var anonBind = function (futureB) {
|
4050
|
-
return
|
4051
|
-
|
4052
|
-
futureB.
|
4521
|
+
return make(function () {
|
4522
|
+
return run().then(function () {
|
4523
|
+
return futureB.toPromise();
|
4053
4524
|
});
|
4054
4525
|
});
|
4055
4526
|
};
|
@@ -4058,25 +4529,32 @@
|
|
4058
4529
|
};
|
4059
4530
|
var toCached = function () {
|
4060
4531
|
var cache = null;
|
4061
|
-
return
|
4532
|
+
return make(function () {
|
4062
4533
|
if (cache === null) {
|
4063
|
-
cache =
|
4534
|
+
cache = run();
|
4064
4535
|
}
|
4065
|
-
cache
|
4536
|
+
return cache;
|
4066
4537
|
});
|
4067
4538
|
};
|
4539
|
+
var toPromise = run;
|
4068
4540
|
return {
|
4069
4541
|
map: map,
|
4070
4542
|
bind: bind,
|
4071
4543
|
anonBind: anonBind,
|
4072
4544
|
toLazy: toLazy,
|
4073
4545
|
toCached: toCached,
|
4546
|
+
toPromise: toPromise,
|
4074
4547
|
get: get
|
4075
4548
|
};
|
4076
4549
|
};
|
4550
|
+
var nu$4 = function (baseFn) {
|
4551
|
+
return make(function () {
|
4552
|
+
return new Promise(baseFn);
|
4553
|
+
});
|
4554
|
+
};
|
4077
4555
|
var pure$1 = function (a) {
|
4078
|
-
return
|
4079
|
-
|
4556
|
+
return make(function () {
|
4557
|
+
return Promise.resolve(a);
|
4080
4558
|
});
|
4081
4559
|
};
|
4082
4560
|
var Future = {
|
@@ -4208,9 +4686,15 @@
|
|
4208
4686
|
toOption: Option.none
|
4209
4687
|
};
|
4210
4688
|
};
|
4689
|
+
var fromOption = function (opt, err) {
|
4690
|
+
return opt.fold(function () {
|
4691
|
+
return error(err);
|
4692
|
+
}, value);
|
4693
|
+
};
|
4211
4694
|
var Result = {
|
4212
4695
|
value: value,
|
4213
|
-
error: error
|
4696
|
+
error: error,
|
4697
|
+
fromOption: fromOption
|
4214
4698
|
};
|
4215
4699
|
|
4216
4700
|
function StyleSheetLoader(document, settings) {
|
@@ -4581,6 +5065,9 @@
|
|
4581
5065
|
return !!node && node.nodeType === type;
|
4582
5066
|
};
|
4583
5067
|
};
|
5068
|
+
var isRestrictedNode = function (node) {
|
5069
|
+
return !!node && !Object.getPrototypeOf(node);
|
5070
|
+
};
|
4584
5071
|
var isElement$1 = isNodeType(1);
|
4585
5072
|
var matchNodeNames = function (names) {
|
4586
5073
|
var items = names.toLowerCase().split(' ');
|
@@ -4666,6 +5153,7 @@
|
|
4666
5153
|
isBr: isBr$1,
|
4667
5154
|
isContentEditableTrue: isContentEditableTrue,
|
4668
5155
|
isContentEditableFalse: isContentEditableFalse,
|
5156
|
+
isRestrictedNode: isRestrictedNode,
|
4669
5157
|
matchNodeNames: matchNodeNames,
|
4670
5158
|
hasPropValue: hasPropValue,
|
4671
5159
|
hasAttribute: hasAttribute,
|
@@ -5169,7 +5657,7 @@
|
|
5169
5657
|
textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + 'blockquote center dir fieldset header footer article section hgroup aside main nav figure');
|
5170
5658
|
blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + 'th tr td li ol ul caption dl dt dd noscript menu isindex option ' + 'datalist select optgroup figcaption details summary', textBlockElementsMap);
|
5171
5659
|
textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font strike u var cite ' + 'dfn code mark q sup sub samp');
|
5172
|
-
each$4((settings.special || 'script noscript noframes noembed title style textarea xmp').split(' '), function (name) {
|
5660
|
+
each$4((settings.special || 'script noscript iframe noframes noembed title style textarea xmp').split(' '), function (name) {
|
5173
5661
|
specialElements[name] = new RegExp('</' + name + '[^>]*>', 'gi');
|
5174
5662
|
});
|
5175
5663
|
var patternToRegExp = function (str) {
|
@@ -5938,7 +6426,7 @@
|
|
5938
6426
|
var getViewPort = function (argWin) {
|
5939
6427
|
var actWin = !argWin ? win : argWin;
|
5940
6428
|
var doc = actWin.document;
|
5941
|
-
var rootElm =
|
6429
|
+
var rootElm = doc.documentElement ;
|
5942
6430
|
return {
|
5943
6431
|
x: actWin.pageXOffset || rootElm.scrollLeft,
|
5944
6432
|
y: actWin.pageYOffset || rootElm.scrollTop,
|
@@ -6176,12 +6664,14 @@
|
|
6176
6664
|
var node;
|
6177
6665
|
var container = doc.createElement('div');
|
6178
6666
|
var frag = doc.createDocumentFragment();
|
6667
|
+
frag.appendChild(container);
|
6179
6668
|
if (html) {
|
6180
6669
|
container.innerHTML = html;
|
6181
6670
|
}
|
6182
6671
|
while (node = container.firstChild) {
|
6183
6672
|
frag.appendChild(node);
|
6184
6673
|
}
|
6674
|
+
frag.removeChild(container);
|
6185
6675
|
return frag;
|
6186
6676
|
};
|
6187
6677
|
var remove = function (node, keepChildren) {
|
@@ -6993,8 +7483,9 @@
|
|
6993
7483
|
for (var _i = 0; _i < arguments.length; _i++) {
|
6994
7484
|
args[_i] = arguments[_i];
|
6995
7485
|
}
|
6996
|
-
if (timer !== null)
|
7486
|
+
if (timer !== null) {
|
6997
7487
|
domGlobals.clearTimeout(timer);
|
7488
|
+
}
|
6998
7489
|
timer = domGlobals.setTimeout(function () {
|
6999
7490
|
fn.apply(null, args);
|
7000
7491
|
timer = null;
|
@@ -7119,8 +7610,8 @@
|
|
7119
7610
|
return Option.none();
|
7120
7611
|
};
|
7121
7612
|
var closest = function (scope, predicate, isRoot) {
|
7122
|
-
var is = function (s) {
|
7123
|
-
return
|
7613
|
+
var is = function (s, test) {
|
7614
|
+
return test(s);
|
7124
7615
|
};
|
7125
7616
|
return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot);
|
7126
7617
|
};
|
@@ -7312,17 +7803,38 @@
|
|
7312
7803
|
};
|
7313
7804
|
};
|
7314
7805
|
|
7806
|
+
var __assign = function () {
|
7807
|
+
__assign = Object.assign || function __assign(t) {
|
7808
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
7809
|
+
s = arguments[i];
|
7810
|
+
for (var p in s)
|
7811
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
7812
|
+
t[p] = s[p];
|
7813
|
+
}
|
7814
|
+
return t;
|
7815
|
+
};
|
7816
|
+
return __assign.apply(this, arguments);
|
7817
|
+
};
|
7315
7818
|
function __rest(s, e) {
|
7316
7819
|
var t = {};
|
7317
7820
|
for (var p in s)
|
7318
7821
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
7319
7822
|
t[p] = s[p];
|
7320
7823
|
if (s != null && typeof Object.getOwnPropertySymbols === 'function')
|
7321
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
7322
|
-
if (e.indexOf(p[i]) < 0)
|
7824
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7825
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
7323
7826
|
t[p[i]] = s[p[i]];
|
7827
|
+
}
|
7324
7828
|
return t;
|
7325
7829
|
}
|
7830
|
+
function __spreadArrays() {
|
7831
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
7832
|
+
s += arguments[i].length;
|
7833
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
7834
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
7835
|
+
r[k] = a[j];
|
7836
|
+
return r;
|
7837
|
+
}
|
7326
7838
|
|
7327
7839
|
var unique = 0;
|
7328
7840
|
var generate = function (prefix) {
|
@@ -7591,7 +8103,8 @@
|
|
7591
8103
|
return overflowY >= 0 && overflowY <= Math.min(rect1.height, rect2.height) / 2;
|
7592
8104
|
};
|
7593
8105
|
var isAbove = function (rect1, rect2) {
|
7594
|
-
|
8106
|
+
var halfHeight = Math.min(rect2.height / 2, rect1.height / 2);
|
8107
|
+
if (rect1.bottom - halfHeight < rect2.top) {
|
7595
8108
|
return true;
|
7596
8109
|
}
|
7597
8110
|
if (rect1.top > rect2.bottom) {
|
@@ -7649,31 +8162,25 @@
|
|
7649
8162
|
return container;
|
7650
8163
|
};
|
7651
8164
|
|
7652
|
-
var extendingChars = new RegExp('[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a' + '\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0' + '\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\
|
8165
|
+
var extendingChars = new RegExp('[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a' + '\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0' + '\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c' + '\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3' + '\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc' + '\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57' + '\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56' + '\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44' + '\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9' + '\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97' + '\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074' + '\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5' + '\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18' + '\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1ABE\u1b00-\u1b03\u1b34' + '\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9' + '\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9' + '\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20DD-\u20E0\u20e1\u20E2-\u20E4\u20e5-\u20f0\u2cef-\u2cf1' + '\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\uA670-\uA672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1' + '\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc' + '\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1' + '\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]');
|
7653
8166
|
var isExtendingChar = function (ch) {
|
7654
8167
|
return typeof ch === 'string' && ch.charCodeAt(0) >= 768 && extendingChars.test(ch);
|
7655
8168
|
};
|
7656
8169
|
|
7657
|
-
var
|
7658
|
-
|
7659
|
-
|
7660
|
-
|
7661
|
-
|
7662
|
-
r.push(x.getOrDie());
|
7663
|
-
} else {
|
7664
|
-
return Option.none();
|
7665
|
-
}
|
7666
|
-
}
|
7667
|
-
return Option.some(f.apply(null, r));
|
8170
|
+
var lift2 = function (oa, ob, f) {
|
8171
|
+
return oa.isSome() && ob.isSome() ? Option.some(f(oa.getOrDie(), ob.getOrDie())) : Option.none();
|
8172
|
+
};
|
8173
|
+
var lift3 = function (oa, ob, oc, f) {
|
8174
|
+
return oa.isSome() && ob.isSome() && oc.isSome() ? Option.some(f(oa.getOrDie(), ob.getOrDie(), oc.getOrDie())) : Option.none();
|
7668
8175
|
};
|
7669
8176
|
|
7670
|
-
var slice$
|
8177
|
+
var slice$2 = [].slice;
|
7671
8178
|
var or = function () {
|
7672
8179
|
var x = [];
|
7673
8180
|
for (var _i = 0; _i < arguments.length; _i++) {
|
7674
8181
|
x[_i] = arguments[_i];
|
7675
8182
|
}
|
7676
|
-
var args = slice$
|
8183
|
+
var args = slice$2.call(arguments);
|
7677
8184
|
return function (x) {
|
7678
8185
|
for (var i = 0; i < args.length; i++) {
|
7679
8186
|
if (args[i](x)) {
|
@@ -7688,7 +8195,7 @@
|
|
7688
8195
|
for (var _i = 0; _i < arguments.length; _i++) {
|
7689
8196
|
x[_i] = arguments[_i];
|
7690
8197
|
}
|
7691
|
-
var args = slice$
|
8198
|
+
var args = slice$2.call(arguments);
|
7692
8199
|
return function (x) {
|
7693
8200
|
for (var i = 0; i < args.length; i++) {
|
7694
8201
|
if (!args[i](x)) {
|
@@ -7925,16 +8432,10 @@
|
|
7925
8432
|
return CaretPosition(node.parentNode, nodeIndex(node));
|
7926
8433
|
};
|
7927
8434
|
CaretPosition.isAbove = function (pos1, pos2) {
|
7928
|
-
return
|
7929
|
-
head(pos2.getClientRects()),
|
7930
|
-
last(pos1.getClientRects())
|
7931
|
-
], isAbove).getOr(false);
|
8435
|
+
return lift2(head(pos2.getClientRects()), last(pos1.getClientRects()), isAbove).getOr(false);
|
7932
8436
|
};
|
7933
8437
|
CaretPosition.isBelow = function (pos1, pos2) {
|
7934
|
-
return
|
7935
|
-
last(pos2.getClientRects()),
|
7936
|
-
head(pos1.getClientRects())
|
7937
|
-
], isBelow).getOr(false);
|
8438
|
+
return lift2(last(pos2.getClientRects()), head(pos1.getClientRects()), isBelow).getOr(false);
|
7938
8439
|
};
|
7939
8440
|
CaretPosition.isAtStart = function (pos) {
|
7940
8441
|
return pos ? pos.isAtStart() : false;
|
@@ -9048,7 +9549,7 @@
|
|
9048
9549
|
};
|
9049
9550
|
|
9050
9551
|
var addBogus = function (dom, node) {
|
9051
|
-
if (dom.isBlock(node) && !node.innerHTML && !Env.ie) {
|
9552
|
+
if (NodeType.isElement(node) && dom.isBlock(node) && !node.innerHTML && !Env.ie) {
|
9052
9553
|
node.innerHTML = '<br data-mce-bogus="1" />';
|
9053
9554
|
}
|
9054
9555
|
return node;
|
@@ -9211,10 +9712,7 @@
|
|
9211
9712
|
var resolveId = function (dom, bookmark) {
|
9212
9713
|
var startPos = restoreEndPoint(dom, 'start', bookmark);
|
9213
9714
|
var endPos = restoreEndPoint(dom, 'end', bookmark);
|
9214
|
-
return
|
9215
|
-
startPos,
|
9216
|
-
alt(endPos, startPos)
|
9217
|
-
], function (spos, epos) {
|
9715
|
+
return lift2(startPos, alt(endPos, startPos), function (spos, epos) {
|
9218
9716
|
var rng = dom.createRng();
|
9219
9717
|
rng.setStart(addBogus(dom, spos.container()), spos.offset());
|
9220
9718
|
rng.setEnd(addBogus(dom, epos.container()), epos.offset());
|
@@ -9764,18 +10262,9 @@
|
|
9764
10262
|
}
|
9765
10263
|
return getOption(element).getOr('');
|
9766
10264
|
};
|
9767
|
-
var
|
9768
|
-
try {
|
9769
|
-
return getOptionSafe(element);
|
9770
|
-
} catch (e) {
|
9771
|
-
return Option.none();
|
9772
|
-
}
|
9773
|
-
};
|
9774
|
-
var getOptionSafe = function (element) {
|
10265
|
+
var getOption = function (element) {
|
9775
10266
|
return is(element) ? Option.from(element.dom().nodeValue) : Option.none();
|
9776
10267
|
};
|
9777
|
-
var browser = PlatformDetection$1.detect().browser;
|
9778
|
-
var getOption = browser.isIE() && browser.version.major === 10 ? getOptionIE10 : getOptionSafe;
|
9779
10268
|
var set = function (element, value) {
|
9780
10269
|
if (!is(element)) {
|
9781
10270
|
throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');
|
@@ -9906,7 +10395,7 @@
|
|
9906
10395
|
function Annotator (editor) {
|
9907
10396
|
var registry = create$1();
|
9908
10397
|
setup$1(editor, registry);
|
9909
|
-
var changes = setup(editor
|
10398
|
+
var changes = setup(editor);
|
9910
10399
|
return {
|
9911
10400
|
register: function (name, settings) {
|
9912
10401
|
registry.register(name, settings);
|
@@ -10665,165 +11154,129 @@
|
|
10665
11154
|
};
|
10666
11155
|
var InsertContent = { insertAtCaret: insertAtCaret$1 };
|
10667
11156
|
|
10668
|
-
var
|
10669
|
-
var
|
10670
|
-
|
10671
|
-
var mobilePlugins = [
|
10672
|
-
'lists',
|
10673
|
-
'autolink',
|
10674
|
-
'autosave'
|
10675
|
-
];
|
10676
|
-
var defaultMobileSettings = { theme: 'mobile' };
|
10677
|
-
var normalizePlugins = function (plugins) {
|
10678
|
-
var pluginNames = isArray(plugins) ? plugins.join(' ') : plugins;
|
10679
|
-
var trimmedPlugins = map(isString(pluginNames) ? pluginNames.split(' ') : [], trim$2);
|
10680
|
-
return filter(trimmedPlugins, function (item) {
|
10681
|
-
return item.length > 0;
|
10682
|
-
});
|
11157
|
+
var strongRtl = /[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/;
|
11158
|
+
var hasStrongRtl = function (text) {
|
11159
|
+
return strongRtl.test(text);
|
10683
11160
|
};
|
10684
|
-
|
10685
|
-
|
11161
|
+
|
11162
|
+
var getBodySetting = function (editor, name, defaultValue) {
|
11163
|
+
var value = editor.getParam(name, defaultValue);
|
11164
|
+
if (value.indexOf('=') !== -1) {
|
11165
|
+
var bodyObj = editor.getParam(name, '', 'hash');
|
11166
|
+
return bodyObj.hasOwnProperty(editor.id) ? bodyObj[editor.id] : defaultValue;
|
11167
|
+
} else {
|
11168
|
+
return value;
|
11169
|
+
}
|
10686
11170
|
};
|
10687
|
-
var
|
10688
|
-
|
10689
|
-
return contains(keys, key);
|
10690
|
-
});
|
10691
|
-
return sectionResult(result.t, result.f);
|
11171
|
+
var getIframeAttrs = function (editor) {
|
11172
|
+
return editor.getParam('iframe_attrs', {});
|
10692
11173
|
};
|
10693
|
-
var
|
10694
|
-
|
10695
|
-
var sectionSettings = sections.hasOwnProperty(name) ? sections[name] : {};
|
10696
|
-
return Tools.extend({}, defaults, sectionSettings);
|
11174
|
+
var getDocType = function (editor) {
|
11175
|
+
return editor.getParam('doctype', '<!DOCTYPE html>');
|
10697
11176
|
};
|
10698
|
-
var
|
10699
|
-
return
|
11177
|
+
var getDocumentBaseUrl = function (editor) {
|
11178
|
+
return editor.getParam('document_base_url', '');
|
10700
11179
|
};
|
10701
|
-
var
|
10702
|
-
return
|
10703
|
-
id: id,
|
10704
|
-
theme: 'modern',
|
10705
|
-
delta_width: 0,
|
10706
|
-
delta_height: 0,
|
10707
|
-
popup_css: '',
|
10708
|
-
plugins: '',
|
10709
|
-
document_base_url: documentBaseUrl,
|
10710
|
-
add_form_submit_trigger: true,
|
10711
|
-
submit_patch: true,
|
10712
|
-
add_unload_trigger: true,
|
10713
|
-
convert_urls: true,
|
10714
|
-
relative_urls: true,
|
10715
|
-
remove_script_host: true,
|
10716
|
-
object_resizing: true,
|
10717
|
-
doctype: '<!DOCTYPE html>',
|
10718
|
-
visual: true,
|
10719
|
-
font_size_style_values: 'xx-small,x-small,small,medium,large,x-large,xx-large',
|
10720
|
-
font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%',
|
10721
|
-
forced_root_block: 'p',
|
10722
|
-
hidden_input: true,
|
10723
|
-
render_ui: true,
|
10724
|
-
indentation: '40px',
|
10725
|
-
inline_styles: true,
|
10726
|
-
convert_fonts_to_spans: true,
|
10727
|
-
indent: 'simple',
|
10728
|
-
indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
|
10729
|
-
indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
|
10730
|
-
entity_encoding: 'named',
|
10731
|
-
url_converter: editor.convertURL,
|
10732
|
-
url_converter_scope: editor,
|
10733
|
-
ie7_compat: true
|
10734
|
-
};
|
11180
|
+
var getBodyId = function (editor) {
|
11181
|
+
return getBodySetting(editor, 'body_id', 'tinymce');
|
10735
11182
|
};
|
10736
|
-
var
|
10737
|
-
|
10738
|
-
|
10739
|
-
|
10740
|
-
|
10741
|
-
|
11183
|
+
var getBodyClass = function (editor) {
|
11184
|
+
return getBodySetting(editor, 'body_class', '');
|
11185
|
+
};
|
11186
|
+
var getContentSecurityPolicy = function (editor) {
|
11187
|
+
return editor.getParam('content_security_policy', '');
|
11188
|
+
};
|
11189
|
+
var shouldPutBrInPre = function (editor) {
|
11190
|
+
return editor.getParam('br_in_pre', true);
|
11191
|
+
};
|
11192
|
+
var getForcedRootBlock = function (editor) {
|
11193
|
+
if (editor.getParam('force_p_newlines', false)) {
|
11194
|
+
return 'p';
|
10742
11195
|
}
|
11196
|
+
var block = editor.getParam('forced_root_block', 'p');
|
11197
|
+
return block === false ? '' : block;
|
10743
11198
|
};
|
10744
|
-
var
|
10745
|
-
return
|
11199
|
+
var getForcedRootBlockAttrs = function (editor) {
|
11200
|
+
return editor.getParam('forced_root_block_attrs', {});
|
10746
11201
|
};
|
10747
|
-
var
|
10748
|
-
|
10749
|
-
var plugins = normalizePlugins(settings.plugins);
|
10750
|
-
var platformPlugins = isTouchDevice && hasSection(sectionResult, 'mobile') ? filterMobilePlugins(plugins) : plugins;
|
10751
|
-
var combinedPlugins = combinePlugins(forcedPlugins, platformPlugins);
|
10752
|
-
return Tools.extend(settings, { plugins: combinedPlugins.join(' ') });
|
11202
|
+
var getBrNewLineSelector = function (editor) {
|
11203
|
+
return editor.getParam('br_newline_selector', '.mce-toc h2,figcaption,caption');
|
10753
11204
|
};
|
10754
|
-
var
|
10755
|
-
|
10756
|
-
return isTouchDevice && hasSection(sectionResult, 'mobile') && !isInline;
|
11205
|
+
var getNoNewLineSelector = function (editor) {
|
11206
|
+
return editor.getParam('no_newline_selector', '');
|
10757
11207
|
};
|
10758
|
-
var
|
10759
|
-
|
10760
|
-
var extendedSettings = Tools.extend(defaultSettings, defaultOverrideSettings, sectionResult.settings(), isOnMobile(isTouchDevice, sectionResult) ? getSection(sectionResult, 'mobile', defaultMobileSettings) : {}, {
|
10761
|
-
validate: true,
|
10762
|
-
content_editable: sectionResult.settings().inline,
|
10763
|
-
external_plugins: getExternalPlugins(defaultOverrideSettings, sectionResult.settings())
|
10764
|
-
});
|
10765
|
-
return processPlugins(isTouchDevice, sectionResult, defaultOverrideSettings, extendedSettings);
|
11208
|
+
var shouldKeepStyles = function (editor) {
|
11209
|
+
return editor.getParam('keep_styles', true);
|
10766
11210
|
};
|
10767
|
-
var
|
10768
|
-
|
10769
|
-
return combineSettings(isTouch, defaultSettings, defaultOverrideSettings, settings);
|
11211
|
+
var shouldEndContainerOnEmptyBlock = function (editor) {
|
11212
|
+
return editor.getParam('end_container_on_empty_block', false);
|
10770
11213
|
};
|
10771
|
-
var
|
10772
|
-
return
|
11214
|
+
var getFontStyleValues = function (editor) {
|
11215
|
+
return Tools.explode(editor.getParam('font_size_style_values', ''));
|
10773
11216
|
};
|
10774
|
-
var
|
10775
|
-
|
10776
|
-
var output = {};
|
10777
|
-
if (typeof value === 'string') {
|
10778
|
-
each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function (val) {
|
10779
|
-
var arr = val.split('=');
|
10780
|
-
if (arr.length > 1) {
|
10781
|
-
output[Tools.trim(arr[0])] = Tools.trim(arr[1]);
|
10782
|
-
} else {
|
10783
|
-
output[Tools.trim(arr[0])] = Tools.trim(arr);
|
10784
|
-
}
|
10785
|
-
});
|
10786
|
-
} else {
|
10787
|
-
output = value;
|
10788
|
-
}
|
10789
|
-
return output;
|
11217
|
+
var getFontSizeClasses = function (editor) {
|
11218
|
+
return Tools.explode(editor.getParam('font_size_classes', ''));
|
10790
11219
|
};
|
10791
|
-
var
|
10792
|
-
return
|
10793
|
-
return isArray(a) && forall(a, p);
|
10794
|
-
};
|
11220
|
+
var getImagesDataImgFilter = function (editor) {
|
11221
|
+
return editor.getParam('images_dataimg_filter', constant(true), 'function');
|
10795
11222
|
};
|
10796
|
-
var
|
10797
|
-
|
10798
|
-
if (type === 'hash') {
|
10799
|
-
return getParamObject(value);
|
10800
|
-
} else if (type === 'string') {
|
10801
|
-
return getFiltered(isString, editor, name).getOr(defaultVal);
|
10802
|
-
} else if (type === 'number') {
|
10803
|
-
return getFiltered(isNumber, editor, name).getOr(defaultVal);
|
10804
|
-
} else if (type === 'boolean') {
|
10805
|
-
return getFiltered(isBoolean, editor, name).getOr(defaultVal);
|
10806
|
-
} else if (type === 'object') {
|
10807
|
-
return getFiltered(isObject, editor, name).getOr(defaultVal);
|
10808
|
-
} else if (type === 'array') {
|
10809
|
-
return getFiltered(isArray, editor, name).getOr(defaultVal);
|
10810
|
-
} else if (type === 'string[]') {
|
10811
|
-
return getFiltered(isArrayOf(isString), editor, name).getOr(defaultVal);
|
10812
|
-
} else if (type === 'function') {
|
10813
|
-
return getFiltered(isFunction, editor, name).getOr(defaultVal);
|
10814
|
-
} else {
|
10815
|
-
return value;
|
10816
|
-
}
|
11223
|
+
var isAutomaticUploadsEnabled = function (editor) {
|
11224
|
+
return editor.getParam('automatic_uploads', true, 'boolean');
|
10817
11225
|
};
|
10818
|
-
|
10819
|
-
|
10820
|
-
|
10821
|
-
|
11226
|
+
var shouldReuseFileName = function (editor) {
|
11227
|
+
return editor.getParam('images_reuse_filename', false, 'boolean');
|
11228
|
+
};
|
11229
|
+
var shouldReplaceBlobUris = function (editor) {
|
11230
|
+
return editor.getParam('images_replace_blob_uris', true, 'boolean');
|
11231
|
+
};
|
11232
|
+
var getImageUploadUrl = function (editor) {
|
11233
|
+
return editor.getParam('images_upload_url', '', 'string');
|
11234
|
+
};
|
11235
|
+
var getImageUploadBasePath = function (editor) {
|
11236
|
+
return editor.getParam('images_upload_base_path', '', 'string');
|
11237
|
+
};
|
11238
|
+
var getImagesUploadCredentials = function (editor) {
|
11239
|
+
return editor.getParam('images_upload_credentials', false, 'boolean');
|
11240
|
+
};
|
11241
|
+
var getImagesUploadHandler = function (editor) {
|
11242
|
+
return editor.getParam('images_upload_handler', null, 'function');
|
11243
|
+
};
|
11244
|
+
var shouldUseContentCssCors = function (editor) {
|
11245
|
+
return editor.getParam('content_css_cors', false, 'boolean');
|
11246
|
+
};
|
11247
|
+
var getInlineBoundarySelector = function (editor) {
|
11248
|
+
return editor.getParam('inline_boundaries_selector', 'a[href],code,.mce-annotation', 'string');
|
11249
|
+
};
|
11250
|
+
var Settings = {
|
11251
|
+
getIframeAttrs: getIframeAttrs,
|
11252
|
+
getDocType: getDocType,
|
11253
|
+
getDocumentBaseUrl: getDocumentBaseUrl,
|
11254
|
+
getBodyId: getBodyId,
|
11255
|
+
getBodyClass: getBodyClass,
|
11256
|
+
getContentSecurityPolicy: getContentSecurityPolicy,
|
11257
|
+
shouldPutBrInPre: shouldPutBrInPre,
|
11258
|
+
getForcedRootBlock: getForcedRootBlock,
|
11259
|
+
getForcedRootBlockAttrs: getForcedRootBlockAttrs,
|
11260
|
+
getBrNewLineSelector: getBrNewLineSelector,
|
11261
|
+
getNoNewLineSelector: getNoNewLineSelector,
|
11262
|
+
shouldKeepStyles: shouldKeepStyles,
|
11263
|
+
shouldEndContainerOnEmptyBlock: shouldEndContainerOnEmptyBlock,
|
11264
|
+
getFontStyleValues: getFontStyleValues,
|
11265
|
+
getFontSizeClasses: getFontSizeClasses,
|
11266
|
+
getImagesDataImgFilter: getImagesDataImgFilter,
|
11267
|
+
isAutomaticUploadsEnabled: isAutomaticUploadsEnabled,
|
11268
|
+
shouldReuseFileName: shouldReuseFileName,
|
11269
|
+
shouldReplaceBlobUris: shouldReplaceBlobUris,
|
11270
|
+
getImageUploadUrl: getImageUploadUrl,
|
11271
|
+
getImageUploadBasePath: getImageUploadBasePath,
|
11272
|
+
getImagesUploadCredentials: getImagesUploadCredentials,
|
11273
|
+
getImagesUploadHandler: getImagesUploadHandler,
|
11274
|
+
shouldUseContentCssCors: shouldUseContentCssCors,
|
11275
|
+
getInlineBoundarySelector: getInlineBoundarySelector
|
10822
11276
|
};
|
10823
11277
|
|
10824
11278
|
var isInlineTarget = function (editor, elm) {
|
10825
|
-
|
10826
|
-
return is$1(Element.fromDom(elm), selector);
|
11279
|
+
return is$1(Element.fromDom(elm), Settings.getInlineBoundarySelector(editor));
|
10827
11280
|
};
|
10828
11281
|
var isRtl = function (element) {
|
10829
11282
|
return DOMUtils$1.DOM.getStyle(element, 'direction', true) === 'rtl' || hasStrongRtl(element.textContent);
|
@@ -10905,10 +11358,7 @@
|
|
10905
11358
|
}
|
10906
11359
|
};
|
10907
11360
|
var willDeleteLastPositionInElement = function (forward, fromPos, elm) {
|
10908
|
-
return
|
10909
|
-
CaretFinder.firstPositionIn(elm),
|
10910
|
-
CaretFinder.lastPositionIn(elm)
|
10911
|
-
], function (firstPos, lastPos) {
|
11361
|
+
return lift2(CaretFinder.firstPositionIn(elm), CaretFinder.lastPositionIn(elm), function (firstPos, lastPos) {
|
10912
11362
|
var normalizedFirstPos = InlineUtils.normalizePosition(true, firstPos);
|
10913
11363
|
var normalizedLastPos = InlineUtils.normalizePosition(false, lastPos);
|
10914
11364
|
var normalizedFromPos = InlineUtils.normalizePosition(false, fromPos);
|
@@ -11007,7 +11457,7 @@
|
|
11007
11457
|
}).isSome();
|
11008
11458
|
};
|
11009
11459
|
var isEditable = function (blockBoundary) {
|
11010
|
-
return NodeType.isContentEditableFalse(blockBoundary.from().block()) === false && NodeType.isContentEditableFalse(blockBoundary.to().block()) === false;
|
11460
|
+
return NodeType.isContentEditableFalse(blockBoundary.from().block().dom()) === false && NodeType.isContentEditableFalse(blockBoundary.to().block().dom()) === false;
|
11011
11461
|
};
|
11012
11462
|
var skipLastBr = function (rootNode, forward, blockPosition) {
|
11013
11463
|
if (NodeType.isBr(blockPosition.position().getNode()) && Empty.isEmpty(blockPosition.block()) === false) {
|
@@ -11033,10 +11483,7 @@
|
|
11033
11483
|
});
|
11034
11484
|
});
|
11035
11485
|
});
|
11036
|
-
return
|
11037
|
-
fromBlockPos,
|
11038
|
-
toBlockPos
|
11039
|
-
], BlockBoundary).filter(function (blockBoundary) {
|
11486
|
+
return lift2(fromBlockPos, toBlockPos, BlockBoundary).filter(function (blockBoundary) {
|
11040
11487
|
return isDifferentBlocks(blockBoundary) && hasSameParent(blockBoundary) && isEditable(blockBoundary);
|
11041
11488
|
});
|
11042
11489
|
};
|
@@ -11158,10 +11605,7 @@
|
|
11158
11605
|
|
11159
11606
|
var deleteRangeMergeBlocks = function (rootNode, selection) {
|
11160
11607
|
var rng = selection.getRng();
|
11161
|
-
return
|
11162
|
-
DeleteUtils.getParentBlock(rootNode, Element.fromDom(rng.startContainer)),
|
11163
|
-
DeleteUtils.getParentBlock(rootNode, Element.fromDom(rng.endContainer))
|
11164
|
-
], function (block1, block2) {
|
11608
|
+
return lift2(DeleteUtils.getParentBlock(rootNode, Element.fromDom(rng.startContainer)), DeleteUtils.getParentBlock(rootNode, Element.fromDom(rng.endContainer)), function (block1, block2) {
|
11165
11609
|
if (eq(block1, block2) === false) {
|
11166
11610
|
rng.deleteContents();
|
11167
11611
|
MergeBlocks.mergeBlocks(rootNode, true, block1, block2).each(function (pos) {
|
@@ -11231,8 +11675,9 @@
|
|
11231
11675
|
throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength);
|
11232
11676
|
}
|
11233
11677
|
var args = new Array(argLength);
|
11234
|
-
for (var i = 0; i < args.length; i++)
|
11678
|
+
for (var i = 0; i < args.length; i++) {
|
11235
11679
|
args[i] = arguments[i];
|
11680
|
+
}
|
11236
11681
|
var match = function (branches) {
|
11237
11682
|
var branchKeys = keys(branches);
|
11238
11683
|
if (constructors.length !== branchKeys.length) {
|
@@ -11241,8 +11686,9 @@
|
|
11241
11686
|
var allReqd = forall(constructors, function (reqKey) {
|
11242
11687
|
return contains(branchKeys, reqKey);
|
11243
11688
|
});
|
11244
|
-
if (!allReqd)
|
11689
|
+
if (!allReqd) {
|
11245
11690
|
throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', '));
|
11691
|
+
}
|
11246
11692
|
return branches[key].apply(null, args);
|
11247
11693
|
};
|
11248
11694
|
return {
|
@@ -11567,18 +12013,10 @@
|
|
11567
12013
|
}
|
11568
12014
|
};
|
11569
12015
|
var deleteNormalized = function (elm, afterDeletePosOpt, normalizeWhitespace) {
|
11570
|
-
var prevTextOpt = prevSibling(elm).filter(
|
11571
|
-
|
11572
|
-
});
|
11573
|
-
var nextTextOpt = nextSibling(elm).filter(function (e) {
|
11574
|
-
return NodeType.isText(e.dom());
|
11575
|
-
});
|
12016
|
+
var prevTextOpt = prevSibling(elm).filter(isText);
|
12017
|
+
var nextTextOpt = nextSibling(elm).filter(isText);
|
11576
12018
|
remove$1(elm);
|
11577
|
-
return
|
11578
|
-
prevTextOpt,
|
11579
|
-
nextTextOpt,
|
11580
|
-
afterDeletePosOpt
|
11581
|
-
], function (prev, next, pos) {
|
12019
|
+
return lift3(prevTextOpt, nextTextOpt, afterDeletePosOpt, function (prev, next, pos) {
|
11582
12020
|
var prevNode = prev.dom(), nextNode = next.dom();
|
11583
12021
|
var offset = prevNode.data.length;
|
11584
12022
|
mergeTextNodes(prevNode, nextNode, normalizeWhitespace);
|
@@ -11895,10 +12333,7 @@
|
|
11895
12333
|
return getName(location1) === getName(location2) && getElement(location1) === getElement(location2);
|
11896
12334
|
};
|
11897
12335
|
var betweenInlines = function (forward, isInlineTarget, rootNode, from, to, location) {
|
11898
|
-
return
|
11899
|
-
InlineUtils.findRootInline(isInlineTarget, rootNode, from),
|
11900
|
-
InlineUtils.findRootInline(isInlineTarget, rootNode, to)
|
11901
|
-
], function (fromInline, toInline) {
|
12336
|
+
return lift2(InlineUtils.findRootInline(isInlineTarget, rootNode, from), InlineUtils.findRootInline(isInlineTarget, rootNode, to), function (fromInline, toInline) {
|
11902
12337
|
if (fromInline !== toInline && InlineUtils.hasSameParentBlock(rootNode, fromInline, toInline)) {
|
11903
12338
|
return Location.after(forward ? fromInline : toInline);
|
11904
12339
|
} else {
|
@@ -12071,10 +12506,7 @@
|
|
12071
12506
|
return range;
|
12072
12507
|
};
|
12073
12508
|
var hasOnlyTwoOrLessPositionsLeft = function (elm) {
|
12074
|
-
return
|
12075
|
-
CaretFinder.firstPositionIn(elm),
|
12076
|
-
CaretFinder.lastPositionIn(elm)
|
12077
|
-
], function (firstPos, lastPos) {
|
12509
|
+
return lift2(CaretFinder.firstPositionIn(elm), CaretFinder.lastPositionIn(elm), function (firstPos, lastPos) {
|
12078
12510
|
var normalizedFirstPos = InlineUtils.normalizePosition(true, firstPos);
|
12079
12511
|
var normalizedLastPos = InlineUtils.normalizePosition(false, lastPos);
|
12080
12512
|
return CaretFinder.nextPosition(elm, normalizedFirstPos).map(function (pos) {
|
@@ -12189,10 +12621,7 @@
|
|
12189
12621
|
var partialSelection = function (isRoot, rng) {
|
12190
12622
|
var startCell = getClosestCell(rng.startContainer, isRoot);
|
12191
12623
|
var endCell = getClosestCell(rng.endContainer, isRoot);
|
12192
|
-
return rng.collapsed ? Option.none() :
|
12193
|
-
startCell,
|
12194
|
-
endCell
|
12195
|
-
], tableCellRng).fold(function () {
|
12624
|
+
return rng.collapsed ? Option.none() : lift2(startCell, endCell, tableCellRng).fold(function () {
|
12196
12625
|
return startCell.fold(function () {
|
12197
12626
|
return endCell.bind(function (endCell) {
|
12198
12627
|
return getClosestTable(endCell, isRoot).bind(function (table) {
|
@@ -12218,10 +12647,7 @@
|
|
12218
12647
|
var getCellRng = function (rng, isRoot) {
|
12219
12648
|
var startCell = getClosestCell(rng.startContainer, isRoot);
|
12220
12649
|
var endCell = getClosestCell(rng.endContainer, isRoot);
|
12221
|
-
return
|
12222
|
-
startCell,
|
12223
|
-
endCell
|
12224
|
-
], tableCellRng).filter(isExpandedCellRng).filter(function (cellRng) {
|
12650
|
+
return lift2(startCell, endCell, tableCellRng).filter(isExpandedCellRng).filter(function (cellRng) {
|
12225
12651
|
return isWithinSameTable(isRoot, cellRng);
|
12226
12652
|
}).orThunk(function () {
|
12227
12653
|
return partialSelection(isRoot, rng);
|
@@ -12244,10 +12670,7 @@
|
|
12244
12670
|
});
|
12245
12671
|
};
|
12246
12672
|
var getSelectedCells = function (tableSelection) {
|
12247
|
-
return
|
12248
|
-
getCellIndex(tableSelection.cells(), tableSelection.rng().start()),
|
12249
|
-
getCellIndex(tableSelection.cells(), tableSelection.rng().end())
|
12250
|
-
], function (startIndex, endIndex) {
|
12673
|
+
return lift2(getCellIndex(tableSelection.cells(), tableSelection.rng().start()), getCellIndex(tableSelection.cells(), tableSelection.rng().end()), function (startIndex, endIndex) {
|
12251
12674
|
return tableSelection.cells().slice(startIndex, endIndex + 1);
|
12252
12675
|
});
|
12253
12676
|
};
|
@@ -12868,42 +13291,135 @@
|
|
12868
13291
|
};
|
12869
13292
|
var InlineFormatDelete = { backspaceDelete: backspaceDelete$5 };
|
12870
13293
|
|
12871
|
-
var
|
12872
|
-
|
12873
|
-
|
12874
|
-
|
12875
|
-
|
12876
|
-
|
12877
|
-
|
12878
|
-
rng.selectNode(node);
|
12879
|
-
return rng;
|
12880
|
-
};
|
12881
|
-
var selectNode = function (editor, node) {
|
12882
|
-
var e = editor.fire('BeforeObjectSelected', { target: node });
|
12883
|
-
if (e.isDefaultPrevented()) {
|
12884
|
-
return null;
|
13294
|
+
var getPos$1 = function (elm) {
|
13295
|
+
var x = 0, y = 0;
|
13296
|
+
var offsetParent = elm;
|
13297
|
+
while (offsetParent && offsetParent.nodeType) {
|
13298
|
+
x += offsetParent.offsetLeft || 0;
|
13299
|
+
y += offsetParent.offsetTop || 0;
|
13300
|
+
offsetParent = offsetParent.offsetParent;
|
12885
13301
|
}
|
12886
|
-
return
|
13302
|
+
return {
|
13303
|
+
x: x,
|
13304
|
+
y: y
|
13305
|
+
};
|
12887
13306
|
};
|
12888
|
-
var
|
12889
|
-
var
|
12890
|
-
|
12891
|
-
|
12892
|
-
|
12893
|
-
|
13307
|
+
var fireScrollIntoViewEvent = function (editor, elm, alignToTop) {
|
13308
|
+
var scrollEvent = {
|
13309
|
+
elm: elm,
|
13310
|
+
alignToTop: alignToTop
|
13311
|
+
};
|
13312
|
+
editor.fire('scrollIntoView', scrollEvent);
|
13313
|
+
return scrollEvent.isDefaultPrevented();
|
13314
|
+
};
|
13315
|
+
var scrollElementIntoView = function (editor, elm, alignToTop) {
|
13316
|
+
var y, viewPort;
|
13317
|
+
var dom = editor.dom;
|
13318
|
+
var root = dom.getRoot();
|
13319
|
+
var viewPortY, viewPortH, offsetY = 0;
|
13320
|
+
if (fireScrollIntoViewEvent(editor, elm, alignToTop)) {
|
13321
|
+
return;
|
12894
13322
|
}
|
12895
|
-
|
12896
|
-
|
12897
|
-
return showCaret(1, editor, caretPositionBeforeNode, false, false);
|
13323
|
+
if (!NodeType.isElement(elm)) {
|
13324
|
+
return;
|
12898
13325
|
}
|
12899
|
-
|
12900
|
-
|
12901
|
-
});
|
12902
|
-
if (isContentEditableFalse$6(ceRoot)) {
|
12903
|
-
return showCaret(1, editor, ceRoot, false, scrollIntoView);
|
13326
|
+
if (alignToTop === false) {
|
13327
|
+
offsetY = elm.offsetHeight;
|
12904
13328
|
}
|
12905
|
-
|
12906
|
-
|
13329
|
+
if (root.nodeName !== 'BODY') {
|
13330
|
+
var scrollContainer = editor.selection.getScrollContainer();
|
13331
|
+
if (scrollContainer) {
|
13332
|
+
y = getPos$1(elm).y - getPos$1(scrollContainer).y + offsetY;
|
13333
|
+
viewPortH = scrollContainer.clientHeight;
|
13334
|
+
viewPortY = scrollContainer.scrollTop;
|
13335
|
+
if (y < viewPortY || y + 25 > viewPortY + viewPortH) {
|
13336
|
+
scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25;
|
13337
|
+
}
|
13338
|
+
return;
|
13339
|
+
}
|
13340
|
+
}
|
13341
|
+
viewPort = dom.getViewPort(editor.getWin());
|
13342
|
+
y = dom.getPos(elm).y + offsetY;
|
13343
|
+
viewPortY = viewPort.y;
|
13344
|
+
viewPortH = viewPort.h;
|
13345
|
+
if (y < viewPort.y || y + 25 > viewPortY + viewPortH) {
|
13346
|
+
editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25);
|
13347
|
+
}
|
13348
|
+
};
|
13349
|
+
var getViewPortRect = function (editor) {
|
13350
|
+
if (editor.inline) {
|
13351
|
+
return editor.getBody().getBoundingClientRect();
|
13352
|
+
} else {
|
13353
|
+
var win = editor.getWin();
|
13354
|
+
return {
|
13355
|
+
left: 0,
|
13356
|
+
right: win.innerWidth,
|
13357
|
+
top: 0,
|
13358
|
+
bottom: win.innerHeight,
|
13359
|
+
width: win.innerWidth,
|
13360
|
+
height: win.innerHeight
|
13361
|
+
};
|
13362
|
+
}
|
13363
|
+
};
|
13364
|
+
var scrollBy = function (editor, dx, dy) {
|
13365
|
+
if (editor.inline) {
|
13366
|
+
editor.getBody().scrollLeft += dx;
|
13367
|
+
editor.getBody().scrollTop += dy;
|
13368
|
+
} else {
|
13369
|
+
editor.getWin().scrollBy(dx, dy);
|
13370
|
+
}
|
13371
|
+
};
|
13372
|
+
var scrollRangeIntoView = function (editor, rng) {
|
13373
|
+
head(CaretPosition.fromRangeStart(rng).getClientRects()).each(function (rngRect) {
|
13374
|
+
var bodyRect = getViewPortRect(editor);
|
13375
|
+
var overflow = getOverflow(bodyRect, rngRect);
|
13376
|
+
var margin = 4;
|
13377
|
+
var dx = overflow.x > 0 ? overflow.x + margin : overflow.x - margin;
|
13378
|
+
var dy = overflow.y > 0 ? overflow.y + margin : overflow.y - margin;
|
13379
|
+
scrollBy(editor, overflow.x !== 0 ? dx : 0, overflow.y !== 0 ? dy : 0);
|
13380
|
+
});
|
13381
|
+
};
|
13382
|
+
var ScrollIntoView = {
|
13383
|
+
scrollElementIntoView: scrollElementIntoView,
|
13384
|
+
scrollRangeIntoView: scrollRangeIntoView
|
13385
|
+
};
|
13386
|
+
|
13387
|
+
var isContentEditableTrue$2 = NodeType.isContentEditableTrue;
|
13388
|
+
var isContentEditableFalse$6 = NodeType.isContentEditableFalse;
|
13389
|
+
var showCaret = function (direction, editor, node, before, scrollIntoView) {
|
13390
|
+
return editor._selectionOverrides.showCaret(direction, node, before, scrollIntoView);
|
13391
|
+
};
|
13392
|
+
var getNodeRange = function (node) {
|
13393
|
+
var rng = node.ownerDocument.createRange();
|
13394
|
+
rng.selectNode(node);
|
13395
|
+
return rng;
|
13396
|
+
};
|
13397
|
+
var selectNode = function (editor, node) {
|
13398
|
+
var e = editor.fire('BeforeObjectSelected', { target: node });
|
13399
|
+
if (e.isDefaultPrevented()) {
|
13400
|
+
return null;
|
13401
|
+
}
|
13402
|
+
return getNodeRange(node);
|
13403
|
+
};
|
13404
|
+
var renderCaretAtRange = function (editor, range, scrollIntoView) {
|
13405
|
+
var normalizedRange = normalizeRange(1, editor.getBody(), range);
|
13406
|
+
var caretPosition = CaretPosition$1.fromRangeStart(normalizedRange);
|
13407
|
+
var caretPositionNode = caretPosition.getNode();
|
13408
|
+
if (isContentEditableFalse$6(caretPositionNode)) {
|
13409
|
+
return showCaret(1, editor, caretPositionNode, !caretPosition.isAtEnd(), false);
|
13410
|
+
}
|
13411
|
+
var caretPositionBeforeNode = caretPosition.getNode(true);
|
13412
|
+
if (isContentEditableFalse$6(caretPositionBeforeNode)) {
|
13413
|
+
return showCaret(1, editor, caretPositionBeforeNode, false, false);
|
13414
|
+
}
|
13415
|
+
var ceRoot = editor.dom.getParent(caretPosition.getNode(), function (node) {
|
13416
|
+
return isContentEditableFalse$6(node) || isContentEditableTrue$2(node);
|
13417
|
+
});
|
13418
|
+
if (isContentEditableFalse$6(ceRoot)) {
|
13419
|
+
return showCaret(1, editor, ceRoot, false, scrollIntoView);
|
13420
|
+
}
|
13421
|
+
return null;
|
13422
|
+
};
|
12907
13423
|
var renderRangeCaret = function (editor, range, scrollIntoView) {
|
12908
13424
|
if (!range || !range.collapsed) {
|
12909
13425
|
return range;
|
@@ -12914,6 +13430,10 @@
|
|
12914
13430
|
}
|
12915
13431
|
return range;
|
12916
13432
|
};
|
13433
|
+
var moveToRange = function (editor, rng) {
|
13434
|
+
editor.selection.setRng(rng);
|
13435
|
+
ScrollIntoView.scrollRangeIntoView(editor, editor.selection.getRng());
|
13436
|
+
};
|
12917
13437
|
|
12918
13438
|
var trimEmptyTextNode$1 = function (dom, node) {
|
12919
13439
|
if (NodeType.isText(node) && node.data.length === 0) {
|
@@ -13015,118 +13535,6 @@
|
|
13015
13535
|
forwardDeleteCommand: forwardDeleteCommand
|
13016
13536
|
};
|
13017
13537
|
|
13018
|
-
var getBodySetting = function (editor, name, defaultValue) {
|
13019
|
-
var value = editor.getParam(name, defaultValue);
|
13020
|
-
if (value.indexOf('=') !== -1) {
|
13021
|
-
var bodyObj = editor.getParam(name, '', 'hash');
|
13022
|
-
return bodyObj.hasOwnProperty(editor.id) ? bodyObj[editor.id] : defaultValue;
|
13023
|
-
} else {
|
13024
|
-
return value;
|
13025
|
-
}
|
13026
|
-
};
|
13027
|
-
var getIframeAttrs = function (editor) {
|
13028
|
-
return editor.getParam('iframe_attrs', {});
|
13029
|
-
};
|
13030
|
-
var getDocType = function (editor) {
|
13031
|
-
return editor.getParam('doctype', '<!DOCTYPE html>');
|
13032
|
-
};
|
13033
|
-
var getDocumentBaseUrl = function (editor) {
|
13034
|
-
return editor.getParam('document_base_url', '');
|
13035
|
-
};
|
13036
|
-
var getBodyId = function (editor) {
|
13037
|
-
return getBodySetting(editor, 'body_id', 'tinymce');
|
13038
|
-
};
|
13039
|
-
var getBodyClass = function (editor) {
|
13040
|
-
return getBodySetting(editor, 'body_class', '');
|
13041
|
-
};
|
13042
|
-
var getContentSecurityPolicy = function (editor) {
|
13043
|
-
return editor.getParam('content_security_policy', '');
|
13044
|
-
};
|
13045
|
-
var shouldPutBrInPre = function (editor) {
|
13046
|
-
return editor.getParam('br_in_pre', true);
|
13047
|
-
};
|
13048
|
-
var getForcedRootBlock = function (editor) {
|
13049
|
-
if (editor.getParam('force_p_newlines', false)) {
|
13050
|
-
return 'p';
|
13051
|
-
}
|
13052
|
-
var block = editor.getParam('forced_root_block', 'p');
|
13053
|
-
return block === false ? '' : block;
|
13054
|
-
};
|
13055
|
-
var getForcedRootBlockAttrs = function (editor) {
|
13056
|
-
return editor.getParam('forced_root_block_attrs', {});
|
13057
|
-
};
|
13058
|
-
var getBrNewLineSelector = function (editor) {
|
13059
|
-
return editor.getParam('br_newline_selector', '.mce-toc h2,figcaption,caption');
|
13060
|
-
};
|
13061
|
-
var getNoNewLineSelector = function (editor) {
|
13062
|
-
return editor.getParam('no_newline_selector', '');
|
13063
|
-
};
|
13064
|
-
var shouldKeepStyles = function (editor) {
|
13065
|
-
return editor.getParam('keep_styles', true);
|
13066
|
-
};
|
13067
|
-
var shouldEndContainerOnEmptyBlock = function (editor) {
|
13068
|
-
return editor.getParam('end_container_on_empty_block', false);
|
13069
|
-
};
|
13070
|
-
var getFontStyleValues = function (editor) {
|
13071
|
-
return Tools.explode(editor.getParam('font_size_style_values', ''));
|
13072
|
-
};
|
13073
|
-
var getFontSizeClasses = function (editor) {
|
13074
|
-
return Tools.explode(editor.getParam('font_size_classes', ''));
|
13075
|
-
};
|
13076
|
-
var getImagesDataImgFilter = function (editor) {
|
13077
|
-
return editor.getParam('images_dataimg_filter', constant(true), 'function');
|
13078
|
-
};
|
13079
|
-
var isAutomaticUploadsEnabled = function (editor) {
|
13080
|
-
return editor.getParam('automatic_uploads', true, 'boolean');
|
13081
|
-
};
|
13082
|
-
var shouldReuseFileName = function (editor) {
|
13083
|
-
return editor.getParam('images_reuse_filename', false, 'boolean');
|
13084
|
-
};
|
13085
|
-
var shouldReplaceBlobUris = function (editor) {
|
13086
|
-
return editor.getParam('images_replace_blob_uris', true, 'boolean');
|
13087
|
-
};
|
13088
|
-
var getImageUploadUrl = function (editor) {
|
13089
|
-
return editor.getParam('images_upload_url', '', 'string');
|
13090
|
-
};
|
13091
|
-
var getImageUploadBasePath = function (editor) {
|
13092
|
-
return editor.getParam('images_upload_base_path', '', 'string');
|
13093
|
-
};
|
13094
|
-
var getImagesUploadCredentials = function (editor) {
|
13095
|
-
return editor.getParam('images_upload_credentials', false, 'boolean');
|
13096
|
-
};
|
13097
|
-
var getImagesUploadHandler = function (editor) {
|
13098
|
-
return editor.getParam('images_upload_handler', null, 'function');
|
13099
|
-
};
|
13100
|
-
var shouldUseContentCssCors = function (editor) {
|
13101
|
-
return editor.getParam('content_css_cors', false, 'boolean');
|
13102
|
-
};
|
13103
|
-
var Settings = {
|
13104
|
-
getIframeAttrs: getIframeAttrs,
|
13105
|
-
getDocType: getDocType,
|
13106
|
-
getDocumentBaseUrl: getDocumentBaseUrl,
|
13107
|
-
getBodyId: getBodyId,
|
13108
|
-
getBodyClass: getBodyClass,
|
13109
|
-
getContentSecurityPolicy: getContentSecurityPolicy,
|
13110
|
-
shouldPutBrInPre: shouldPutBrInPre,
|
13111
|
-
getForcedRootBlock: getForcedRootBlock,
|
13112
|
-
getForcedRootBlockAttrs: getForcedRootBlockAttrs,
|
13113
|
-
getBrNewLineSelector: getBrNewLineSelector,
|
13114
|
-
getNoNewLineSelector: getNoNewLineSelector,
|
13115
|
-
shouldKeepStyles: shouldKeepStyles,
|
13116
|
-
shouldEndContainerOnEmptyBlock: shouldEndContainerOnEmptyBlock,
|
13117
|
-
getFontStyleValues: getFontStyleValues,
|
13118
|
-
getFontSizeClasses: getFontSizeClasses,
|
13119
|
-
getImagesDataImgFilter: getImagesDataImgFilter,
|
13120
|
-
isAutomaticUploadsEnabled: isAutomaticUploadsEnabled,
|
13121
|
-
shouldReuseFileName: shouldReuseFileName,
|
13122
|
-
shouldReplaceBlobUris: shouldReplaceBlobUris,
|
13123
|
-
getImageUploadUrl: getImageUploadUrl,
|
13124
|
-
getImageUploadBasePath: getImageUploadBasePath,
|
13125
|
-
getImagesUploadCredentials: getImagesUploadCredentials,
|
13126
|
-
getImagesUploadHandler: getImagesUploadHandler,
|
13127
|
-
shouldUseContentCssCors: shouldUseContentCssCors
|
13128
|
-
};
|
13129
|
-
|
13130
13538
|
var getSpecifiedFontProp = function (propName, rootElm, elm) {
|
13131
13539
|
var getProperty = function (elm) {
|
13132
13540
|
return getRaw(elm, propName);
|
@@ -13549,6 +13957,9 @@
|
|
13549
13957
|
};
|
13550
13958
|
var InsertBr = { insert: insert };
|
13551
13959
|
|
13960
|
+
var create$3 = Immutable('start', 'soffset', 'finish', 'foffset');
|
13961
|
+
var SimRange = { create: create$3 };
|
13962
|
+
|
13552
13963
|
var adt = Adt.generate([
|
13553
13964
|
{ before: ['element'] },
|
13554
13965
|
{
|
@@ -13559,8 +13970,24 @@
|
|
13559
13970
|
},
|
13560
13971
|
{ after: ['element'] }
|
13561
13972
|
]);
|
13973
|
+
var cata = function (subject, onBefore, onOn, onAfter) {
|
13974
|
+
return subject.fold(onBefore, onOn, onAfter);
|
13975
|
+
};
|
13976
|
+
var getStart = function (situ) {
|
13977
|
+
return situ.fold(identity, identity, identity);
|
13978
|
+
};
|
13979
|
+
var before$4 = adt.before;
|
13980
|
+
var on = adt.on;
|
13981
|
+
var after$3 = adt.after;
|
13982
|
+
var Situ = {
|
13983
|
+
before: before$4,
|
13984
|
+
on: on,
|
13985
|
+
after: after$3,
|
13986
|
+
cata: cata,
|
13987
|
+
getStart: getStart
|
13988
|
+
};
|
13562
13989
|
|
13563
|
-
var
|
13990
|
+
var adt$1 = Adt.generate([
|
13564
13991
|
{ domRange: ['rng'] },
|
13565
13992
|
{
|
13566
13993
|
relative: [
|
@@ -13577,7 +14004,38 @@
|
|
13577
14004
|
]
|
13578
14005
|
}
|
13579
14006
|
]);
|
13580
|
-
var
|
14007
|
+
var exactFromRange = function (simRange) {
|
14008
|
+
return adt$1.exact(simRange.start(), simRange.soffset(), simRange.finish(), simRange.foffset());
|
14009
|
+
};
|
14010
|
+
var getStart$1 = function (selection) {
|
14011
|
+
return selection.match({
|
14012
|
+
domRange: function (rng) {
|
14013
|
+
return Element.fromDom(rng.startContainer);
|
14014
|
+
},
|
14015
|
+
relative: function (startSitu, finishSitu) {
|
14016
|
+
return Situ.getStart(startSitu);
|
14017
|
+
},
|
14018
|
+
exact: function (start, soffset, finish, foffset) {
|
14019
|
+
return start;
|
14020
|
+
}
|
14021
|
+
});
|
14022
|
+
};
|
14023
|
+
var domRange = adt$1.domRange;
|
14024
|
+
var relative = adt$1.relative;
|
14025
|
+
var exact = adt$1.exact;
|
14026
|
+
var getWin = function (selection) {
|
14027
|
+
var start = getStart$1(selection);
|
14028
|
+
return defaultView(start);
|
14029
|
+
};
|
14030
|
+
var range = SimRange.create;
|
14031
|
+
var Selection = {
|
14032
|
+
domRange: domRange,
|
14033
|
+
relative: relative,
|
14034
|
+
exact: exact,
|
14035
|
+
exactFromRange: exactFromRange,
|
14036
|
+
getWin: getWin,
|
14037
|
+
range: range
|
14038
|
+
};
|
13581
14039
|
|
13582
14040
|
var browser$3 = PlatformDetection$1.detect().browser;
|
13583
14041
|
var clamp = function (offset, element) {
|
@@ -13590,10 +14048,10 @@
|
|
13590
14048
|
return offset;
|
13591
14049
|
};
|
13592
14050
|
var normalizeRng = function (rng) {
|
13593
|
-
return range(rng.start(), clamp(rng.soffset(), rng.start()), rng.finish(), clamp(rng.foffset(), rng.finish()));
|
14051
|
+
return Selection.range(rng.start(), clamp(rng.soffset(), rng.start()), rng.finish(), clamp(rng.foffset(), rng.finish()));
|
13594
14052
|
};
|
13595
14053
|
var isOrContains = function (root, elm) {
|
13596
|
-
return contains$3(root, elm) || eq(root, elm);
|
14054
|
+
return !NodeType.isRestrictedNode(elm.dom()) && (contains$3(root, elm) || eq(root, elm));
|
13597
14055
|
};
|
13598
14056
|
var isRngInRoot = function (root) {
|
13599
14057
|
return function (rng) {
|
@@ -13604,7 +14062,7 @@
|
|
13604
14062
|
return editor.inline === true || browser$3.isIE();
|
13605
14063
|
};
|
13606
14064
|
var nativeRangeToSelectionRange = function (r) {
|
13607
|
-
return range(Element.fromDom(r.startContainer), r.startOffset, Element.fromDom(r.endContainer), r.endOffset);
|
14065
|
+
return Selection.range(Element.fromDom(r.startContainer), r.startOffset, Element.fromDom(r.endContainer), r.endOffset);
|
13608
14066
|
};
|
13609
14067
|
var readRange = function (win) {
|
13610
14068
|
var selection = win.getSelection();
|
@@ -14513,28 +14971,178 @@
|
|
14513
14971
|
EditorObservable = Tools.extend({}, Observable, EditorObservable);
|
14514
14972
|
var EditorObservable$1 = EditorObservable;
|
14515
14973
|
|
14516
|
-
var
|
14517
|
-
var
|
14518
|
-
|
14519
|
-
|
14520
|
-
|
14521
|
-
|
14522
|
-
|
14523
|
-
|
14524
|
-
|
14525
|
-
|
14526
|
-
|
14527
|
-
|
14528
|
-
|
14529
|
-
|
14974
|
+
var sectionResult = Immutable('sections', 'settings');
|
14975
|
+
var detection = PlatformDetection$1.detect();
|
14976
|
+
var isTouch = detection.deviceType.isTouch();
|
14977
|
+
var mobilePlugins = [
|
14978
|
+
'lists',
|
14979
|
+
'autolink',
|
14980
|
+
'autosave'
|
14981
|
+
];
|
14982
|
+
var defaultMobileSettings = { theme: 'mobile' };
|
14983
|
+
var normalizePlugins = function (plugins) {
|
14984
|
+
var pluginNames = isArray(plugins) ? plugins.join(' ') : plugins;
|
14985
|
+
var trimmedPlugins = map(isString(pluginNames) ? pluginNames.split(' ') : [], trim$2);
|
14986
|
+
return filter(trimmedPlugins, function (item) {
|
14987
|
+
return item.length > 0;
|
14988
|
+
});
|
14530
14989
|
};
|
14531
|
-
var
|
14532
|
-
|
14533
|
-
|
14534
|
-
|
14535
|
-
var
|
14536
|
-
|
14537
|
-
|
14990
|
+
var filterMobilePlugins = function (plugins) {
|
14991
|
+
return filter(plugins, curry(contains, mobilePlugins));
|
14992
|
+
};
|
14993
|
+
var extractSections = function (keys, settings) {
|
14994
|
+
var result = bifilter(settings, function (value, key) {
|
14995
|
+
return contains(keys, key);
|
14996
|
+
});
|
14997
|
+
return sectionResult(result.t, result.f);
|
14998
|
+
};
|
14999
|
+
var getSection = function (sectionResult, name, defaults) {
|
15000
|
+
var sections = sectionResult.sections();
|
15001
|
+
var sectionSettings = sections.hasOwnProperty(name) ? sections[name] : {};
|
15002
|
+
return Tools.extend({}, defaults, sectionSettings);
|
15003
|
+
};
|
15004
|
+
var hasSection = function (sectionResult, name) {
|
15005
|
+
return sectionResult.sections().hasOwnProperty(name);
|
15006
|
+
};
|
15007
|
+
var getDefaultSettings = function (id, documentBaseUrl, editor) {
|
15008
|
+
return {
|
15009
|
+
id: id,
|
15010
|
+
theme: 'modern',
|
15011
|
+
delta_width: 0,
|
15012
|
+
delta_height: 0,
|
15013
|
+
popup_css: '',
|
15014
|
+
plugins: '',
|
15015
|
+
document_base_url: documentBaseUrl,
|
15016
|
+
add_form_submit_trigger: true,
|
15017
|
+
submit_patch: true,
|
15018
|
+
add_unload_trigger: true,
|
15019
|
+
convert_urls: true,
|
15020
|
+
relative_urls: true,
|
15021
|
+
remove_script_host: true,
|
15022
|
+
object_resizing: true,
|
15023
|
+
doctype: '<!DOCTYPE html>',
|
15024
|
+
visual: true,
|
15025
|
+
font_size_style_values: 'xx-small,x-small,small,medium,large,x-large,xx-large',
|
15026
|
+
font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%',
|
15027
|
+
forced_root_block: 'p',
|
15028
|
+
hidden_input: true,
|
15029
|
+
render_ui: true,
|
15030
|
+
indentation: '40px',
|
15031
|
+
inline_styles: true,
|
15032
|
+
convert_fonts_to_spans: true,
|
15033
|
+
indent: 'simple',
|
15034
|
+
indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
|
15035
|
+
indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
|
15036
|
+
entity_encoding: 'named',
|
15037
|
+
url_converter: editor.convertURL,
|
15038
|
+
url_converter_scope: editor,
|
15039
|
+
ie7_compat: true
|
15040
|
+
};
|
15041
|
+
};
|
15042
|
+
var getExternalPlugins = function (overrideSettings, settings) {
|
15043
|
+
var userDefinedExternalPlugins = settings.external_plugins ? settings.external_plugins : {};
|
15044
|
+
if (overrideSettings && overrideSettings.external_plugins) {
|
15045
|
+
return Tools.extend({}, overrideSettings.external_plugins, userDefinedExternalPlugins);
|
15046
|
+
} else {
|
15047
|
+
return userDefinedExternalPlugins;
|
15048
|
+
}
|
15049
|
+
};
|
15050
|
+
var combinePlugins = function (forcedPlugins, plugins) {
|
15051
|
+
return [].concat(normalizePlugins(forcedPlugins)).concat(normalizePlugins(plugins));
|
15052
|
+
};
|
15053
|
+
var processPlugins = function (isTouchDevice, sectionResult, defaultOverrideSettings, settings) {
|
15054
|
+
var forcedPlugins = normalizePlugins(defaultOverrideSettings.forced_plugins);
|
15055
|
+
var plugins = normalizePlugins(settings.plugins);
|
15056
|
+
var platformPlugins = isTouchDevice && hasSection(sectionResult, 'mobile') ? filterMobilePlugins(plugins) : plugins;
|
15057
|
+
var combinedPlugins = combinePlugins(forcedPlugins, platformPlugins);
|
15058
|
+
return Tools.extend(settings, { plugins: combinedPlugins.join(' ') });
|
15059
|
+
};
|
15060
|
+
var isOnMobile = function (isTouchDevice, sectionResult) {
|
15061
|
+
var isInline = sectionResult.settings().inline;
|
15062
|
+
return isTouchDevice && hasSection(sectionResult, 'mobile') && !isInline;
|
15063
|
+
};
|
15064
|
+
var combineSettings = function (isTouchDevice, defaultSettings, defaultOverrideSettings, settings) {
|
15065
|
+
var sectionResult = extractSections(['mobile'], settings);
|
15066
|
+
var extendedSettings = Tools.extend(defaultSettings, defaultOverrideSettings, sectionResult.settings(), isOnMobile(isTouchDevice, sectionResult) ? getSection(sectionResult, 'mobile', defaultMobileSettings) : {}, {
|
15067
|
+
validate: true,
|
15068
|
+
content_editable: sectionResult.settings().inline,
|
15069
|
+
external_plugins: getExternalPlugins(defaultOverrideSettings, sectionResult.settings())
|
15070
|
+
});
|
15071
|
+
return processPlugins(isTouchDevice, sectionResult, defaultOverrideSettings, extendedSettings);
|
15072
|
+
};
|
15073
|
+
var getEditorSettings = function (editor, id, documentBaseUrl, defaultOverrideSettings, settings) {
|
15074
|
+
var defaultSettings = getDefaultSettings(id, documentBaseUrl, editor);
|
15075
|
+
return combineSettings(isTouch, defaultSettings, defaultOverrideSettings, settings);
|
15076
|
+
};
|
15077
|
+
var getFiltered = function (predicate, editor, name) {
|
15078
|
+
return Option.from(editor.settings[name]).filter(predicate);
|
15079
|
+
};
|
15080
|
+
var getParamObject = function (value) {
|
15081
|
+
var output = {};
|
15082
|
+
if (typeof value === 'string') {
|
15083
|
+
each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function (val) {
|
15084
|
+
var arr = val.split('=');
|
15085
|
+
if (arr.length > 1) {
|
15086
|
+
output[Tools.trim(arr[0])] = Tools.trim(arr[1]);
|
15087
|
+
} else {
|
15088
|
+
output[Tools.trim(arr[0])] = Tools.trim(arr);
|
15089
|
+
}
|
15090
|
+
});
|
15091
|
+
} else {
|
15092
|
+
output = value;
|
15093
|
+
}
|
15094
|
+
return output;
|
15095
|
+
};
|
15096
|
+
var isArrayOf = function (p) {
|
15097
|
+
return function (a) {
|
15098
|
+
return isArray(a) && forall(a, p);
|
15099
|
+
};
|
15100
|
+
};
|
15101
|
+
var getParam = function (editor, name, defaultVal, type) {
|
15102
|
+
var value = name in editor.settings ? editor.settings[name] : defaultVal;
|
15103
|
+
if (type === 'hash') {
|
15104
|
+
return getParamObject(value);
|
15105
|
+
} else if (type === 'string') {
|
15106
|
+
return getFiltered(isString, editor, name).getOr(defaultVal);
|
15107
|
+
} else if (type === 'number') {
|
15108
|
+
return getFiltered(isNumber, editor, name).getOr(defaultVal);
|
15109
|
+
} else if (type === 'boolean') {
|
15110
|
+
return getFiltered(isBoolean, editor, name).getOr(defaultVal);
|
15111
|
+
} else if (type === 'object') {
|
15112
|
+
return getFiltered(isObject, editor, name).getOr(defaultVal);
|
15113
|
+
} else if (type === 'array') {
|
15114
|
+
return getFiltered(isArray, editor, name).getOr(defaultVal);
|
15115
|
+
} else if (type === 'string[]') {
|
15116
|
+
return getFiltered(isArrayOf(isString), editor, name).getOr(defaultVal);
|
15117
|
+
} else if (type === 'function') {
|
15118
|
+
return getFiltered(isFunction, editor, name).getOr(defaultVal);
|
15119
|
+
} else {
|
15120
|
+
return value;
|
15121
|
+
}
|
15122
|
+
};
|
15123
|
+
|
15124
|
+
var each$b = Tools.each, explode$2 = Tools.explode;
|
15125
|
+
var keyCodeLookup = {
|
15126
|
+
f1: 112,
|
15127
|
+
f2: 113,
|
15128
|
+
f3: 114,
|
15129
|
+
f4: 115,
|
15130
|
+
f5: 116,
|
15131
|
+
f6: 117,
|
15132
|
+
f7: 118,
|
15133
|
+
f8: 119,
|
15134
|
+
f9: 120,
|
15135
|
+
f10: 121,
|
15136
|
+
f11: 122,
|
15137
|
+
f12: 123
|
15138
|
+
};
|
15139
|
+
var modifierNames = Tools.makeMap('alt,ctrl,shift,meta,access');
|
15140
|
+
function Shortcuts (editor) {
|
15141
|
+
var self = this;
|
15142
|
+
var shortcuts = {};
|
15143
|
+
var pendingPatterns = [];
|
15144
|
+
var parseShortcut = function (pattern) {
|
15145
|
+
var id, key;
|
14538
15146
|
var shortcut = {};
|
14539
15147
|
each$b(explode$2(pattern, '+'), function (value) {
|
14540
15148
|
if (value in modifierNames) {
|
@@ -14665,8 +15273,8 @@
|
|
14665
15273
|
var doc = owner(element).dom();
|
14666
15274
|
return element.dom() === doc.activeElement;
|
14667
15275
|
};
|
14668
|
-
var active = function (
|
14669
|
-
var doc =
|
15276
|
+
var active = function (_doc) {
|
15277
|
+
var doc = _doc !== undefined ? _doc.dom() : domGlobals.document;
|
14670
15278
|
return Option.from(doc.activeElement).map(Element.fromDom);
|
14671
15279
|
};
|
14672
15280
|
var search = function (element) {
|
@@ -15959,10 +16567,7 @@
|
|
15959
16567
|
});
|
15960
16568
|
};
|
15961
16569
|
var hasAllContentsSelected = function (elm, rng) {
|
15962
|
-
return
|
15963
|
-
getStartNode(rng),
|
15964
|
-
getEndNode(rng)
|
15965
|
-
], function (startNode, endNode) {
|
16570
|
+
return lift2(getStartNode(rng), getEndNode(rng), function (startNode, endNode) {
|
15966
16571
|
var start = find(getFirstChildren(elm), curry(eq, startNode));
|
15967
16572
|
var end = find(getLastChildren$1(elm), curry(eq, endNode));
|
15968
16573
|
return start.isSome() && end.isSome();
|
@@ -16096,288 +16701,42 @@
|
|
16096
16701
|
};
|
16097
16702
|
}
|
16098
16703
|
|
16099
|
-
var
|
16100
|
-
|
16101
|
-
|
16102
|
-
|
16103
|
-
|
16104
|
-
|
16105
|
-
|
16106
|
-
|
16107
|
-
|
16108
|
-
|
16109
|
-
|
16110
|
-
|
16111
|
-
|
16112
|
-
|
16113
|
-
|
16114
|
-
|
16115
|
-
|
16116
|
-
var getScrollPosition = function (editor) {
|
16117
|
-
var body = editor.getBody();
|
16118
|
-
return editor.inline ? {
|
16119
|
-
left: body.scrollLeft,
|
16120
|
-
top: body.scrollTop
|
16121
|
-
} : {
|
16122
|
-
left: 0,
|
16123
|
-
top: 0
|
16124
|
-
};
|
16125
|
-
};
|
16126
|
-
var getBodyScroll = function (editor) {
|
16127
|
-
var body = editor.getBody(), docElm = editor.getDoc().documentElement;
|
16128
|
-
var inlineScroll = {
|
16129
|
-
left: body.scrollLeft,
|
16130
|
-
top: body.scrollTop
|
16131
|
-
};
|
16132
|
-
var iframeScroll = {
|
16133
|
-
left: body.scrollLeft || docElm.scrollLeft,
|
16134
|
-
top: body.scrollTop || docElm.scrollTop
|
16135
|
-
};
|
16136
|
-
return editor.inline ? inlineScroll : iframeScroll;
|
16137
|
-
};
|
16138
|
-
var getMousePosition = function (editor, event) {
|
16139
|
-
if (event.target.ownerDocument !== editor.getDoc()) {
|
16140
|
-
var iframePosition = getAbsolutePosition(editor.getContentAreaContainer());
|
16141
|
-
var scrollPosition = getBodyScroll(editor);
|
16142
|
-
return {
|
16143
|
-
left: event.pageX - iframePosition.left + scrollPosition.left,
|
16144
|
-
top: event.pageY - iframePosition.top + scrollPosition.top
|
16145
|
-
};
|
16704
|
+
var VK = {
|
16705
|
+
BACKSPACE: 8,
|
16706
|
+
DELETE: 46,
|
16707
|
+
DOWN: 40,
|
16708
|
+
ENTER: 13,
|
16709
|
+
LEFT: 37,
|
16710
|
+
RIGHT: 39,
|
16711
|
+
SPACEBAR: 32,
|
16712
|
+
TAB: 9,
|
16713
|
+
UP: 38,
|
16714
|
+
END: 35,
|
16715
|
+
HOME: 36,
|
16716
|
+
modifierPressed: function (e) {
|
16717
|
+
return e.shiftKey || e.ctrlKey || e.altKey || this.metaKeyPressed(e);
|
16718
|
+
},
|
16719
|
+
metaKeyPressed: function (e) {
|
16720
|
+
return Env.mac ? e.metaKey : e.ctrlKey && !e.altKey;
|
16146
16721
|
}
|
16147
|
-
return {
|
16148
|
-
left: event.pageX,
|
16149
|
-
top: event.pageY
|
16150
|
-
};
|
16151
16722
|
};
|
16152
|
-
var calculatePosition = function (bodyPosition, scrollPosition, mousePosition) {
|
16153
|
-
return {
|
16154
|
-
pageX: mousePosition.left - bodyPosition.left + scrollPosition.left,
|
16155
|
-
pageY: mousePosition.top - bodyPosition.top + scrollPosition.top
|
16156
|
-
};
|
16157
|
-
};
|
16158
|
-
var calc = function (editor, event) {
|
16159
|
-
return calculatePosition(getBodyPosition(editor), getScrollPosition(editor), getMousePosition(editor, event));
|
16160
|
-
};
|
16161
|
-
var MousePosition = { calc: calc };
|
16162
16723
|
|
16163
|
-
var
|
16164
|
-
|
16165
|
-
|
16166
|
-
|
16167
|
-
|
16168
|
-
|
16169
|
-
|
16724
|
+
var getNodeClientRects = function (node) {
|
16725
|
+
var toArrayWithNode = function (clientRects) {
|
16726
|
+
return map(clientRects, function (clientRect) {
|
16727
|
+
clientRect = clone$1(clientRect);
|
16728
|
+
clientRect.node = node;
|
16729
|
+
return clientRect;
|
16730
|
+
});
|
16731
|
+
};
|
16732
|
+
if (NodeType.isElement(node)) {
|
16733
|
+
return toArrayWithNode(node.getClientRects());
|
16170
16734
|
}
|
16171
|
-
if (
|
16172
|
-
|
16173
|
-
|
16174
|
-
|
16175
|
-
|
16176
|
-
var cloneElement = function (elm) {
|
16177
|
-
var cloneElm = elm.cloneNode(true);
|
16178
|
-
cloneElm.removeAttribute('data-mce-selected');
|
16179
|
-
return cloneElm;
|
16180
|
-
};
|
16181
|
-
var createGhost = function (editor, elm, width, height) {
|
16182
|
-
var clonedElm = elm.cloneNode(true);
|
16183
|
-
editor.dom.setStyles(clonedElm, {
|
16184
|
-
width: width,
|
16185
|
-
height: height
|
16186
|
-
});
|
16187
|
-
editor.dom.setAttrib(clonedElm, 'data-mce-selected', null);
|
16188
|
-
var ghostElm = editor.dom.create('div', {
|
16189
|
-
'class': 'mce-drag-container',
|
16190
|
-
'data-mce-bogus': 'all',
|
16191
|
-
'unselectable': 'on',
|
16192
|
-
'contenteditable': 'false'
|
16193
|
-
});
|
16194
|
-
editor.dom.setStyles(ghostElm, {
|
16195
|
-
position: 'absolute',
|
16196
|
-
opacity: 0.5,
|
16197
|
-
overflow: 'hidden',
|
16198
|
-
border: 0,
|
16199
|
-
padding: 0,
|
16200
|
-
margin: 0,
|
16201
|
-
width: width,
|
16202
|
-
height: height
|
16203
|
-
});
|
16204
|
-
editor.dom.setStyles(clonedElm, {
|
16205
|
-
margin: 0,
|
16206
|
-
boxSizing: 'border-box'
|
16207
|
-
});
|
16208
|
-
ghostElm.appendChild(clonedElm);
|
16209
|
-
return ghostElm;
|
16210
|
-
};
|
16211
|
-
var appendGhostToBody = function (ghostElm, bodyElm) {
|
16212
|
-
if (ghostElm.parentNode !== bodyElm) {
|
16213
|
-
bodyElm.appendChild(ghostElm);
|
16214
|
-
}
|
16215
|
-
};
|
16216
|
-
var moveGhost = function (ghostElm, position, width, height, maxX, maxY) {
|
16217
|
-
var overflowX = 0, overflowY = 0;
|
16218
|
-
ghostElm.style.left = position.pageX + 'px';
|
16219
|
-
ghostElm.style.top = position.pageY + 'px';
|
16220
|
-
if (position.pageX + width > maxX) {
|
16221
|
-
overflowX = position.pageX + width - maxX;
|
16222
|
-
}
|
16223
|
-
if (position.pageY + height > maxY) {
|
16224
|
-
overflowY = position.pageY + height - maxY;
|
16225
|
-
}
|
16226
|
-
ghostElm.style.width = width - overflowX + 'px';
|
16227
|
-
ghostElm.style.height = height - overflowY + 'px';
|
16228
|
-
};
|
16229
|
-
var removeElement = function (elm) {
|
16230
|
-
if (elm && elm.parentNode) {
|
16231
|
-
elm.parentNode.removeChild(elm);
|
16232
|
-
}
|
16233
|
-
};
|
16234
|
-
var isLeftMouseButtonPressed = function (e) {
|
16235
|
-
return e.button === 0;
|
16236
|
-
};
|
16237
|
-
var hasDraggableElement = function (state) {
|
16238
|
-
return state.element;
|
16239
|
-
};
|
16240
|
-
var applyRelPos = function (state, position) {
|
16241
|
-
return {
|
16242
|
-
pageX: position.pageX - state.relX,
|
16243
|
-
pageY: position.pageY + 5
|
16244
|
-
};
|
16245
|
-
};
|
16246
|
-
var start$1 = function (state, editor) {
|
16247
|
-
return function (e) {
|
16248
|
-
if (isLeftMouseButtonPressed(e)) {
|
16249
|
-
var ceElm = find(editor.dom.getParents(e.target), Predicate.or(isContentEditableFalse$7, isContentEditableTrue$3)).getOr(null);
|
16250
|
-
if (isDraggable(editor.getBody(), ceElm)) {
|
16251
|
-
var elmPos = editor.dom.getPos(ceElm);
|
16252
|
-
var bodyElm = editor.getBody();
|
16253
|
-
var docElm = editor.getDoc().documentElement;
|
16254
|
-
state.element = ceElm;
|
16255
|
-
state.screenX = e.screenX;
|
16256
|
-
state.screenY = e.screenY;
|
16257
|
-
state.maxX = (editor.inline ? bodyElm.scrollWidth : docElm.offsetWidth) - 2;
|
16258
|
-
state.maxY = (editor.inline ? bodyElm.scrollHeight : docElm.offsetHeight) - 2;
|
16259
|
-
state.relX = e.pageX - elmPos.x;
|
16260
|
-
state.relY = e.pageY - elmPos.y;
|
16261
|
-
state.width = ceElm.offsetWidth;
|
16262
|
-
state.height = ceElm.offsetHeight;
|
16263
|
-
state.ghost = createGhost(editor, ceElm, state.width, state.height);
|
16264
|
-
}
|
16265
|
-
}
|
16266
|
-
};
|
16267
|
-
};
|
16268
|
-
var move$1 = function (state, editor) {
|
16269
|
-
var throttledPlaceCaretAt = Delay.throttle(function (clientX, clientY) {
|
16270
|
-
editor._selectionOverrides.hideFakeCaret();
|
16271
|
-
editor.selection.placeCaretAt(clientX, clientY);
|
16272
|
-
}, 0);
|
16273
|
-
return function (e) {
|
16274
|
-
var movement = Math.max(Math.abs(e.screenX - state.screenX), Math.abs(e.screenY - state.screenY));
|
16275
|
-
if (hasDraggableElement(state) && !state.dragging && movement > 10) {
|
16276
|
-
var args = editor.fire('dragstart', { target: state.element });
|
16277
|
-
if (args.isDefaultPrevented()) {
|
16278
|
-
return;
|
16279
|
-
}
|
16280
|
-
state.dragging = true;
|
16281
|
-
editor.focus();
|
16282
|
-
}
|
16283
|
-
if (state.dragging) {
|
16284
|
-
var targetPos = applyRelPos(state, MousePosition.calc(editor, e));
|
16285
|
-
appendGhostToBody(state.ghost, editor.getBody());
|
16286
|
-
moveGhost(state.ghost, targetPos, state.width, state.height, state.maxX, state.maxY);
|
16287
|
-
throttledPlaceCaretAt(e.clientX, e.clientY);
|
16288
|
-
}
|
16289
|
-
};
|
16290
|
-
};
|
16291
|
-
var getRawTarget = function (selection) {
|
16292
|
-
var rng = selection.getSel().getRangeAt(0);
|
16293
|
-
var startContainer = rng.startContainer;
|
16294
|
-
return startContainer.nodeType === 3 ? startContainer.parentNode : startContainer;
|
16295
|
-
};
|
16296
|
-
var drop = function (state, editor) {
|
16297
|
-
return function (e) {
|
16298
|
-
if (state.dragging) {
|
16299
|
-
if (isValidDropTarget(editor, getRawTarget(editor.selection), state.element)) {
|
16300
|
-
var targetClone_1 = cloneElement(state.element);
|
16301
|
-
var args = editor.fire('drop', {
|
16302
|
-
targetClone: targetClone_1,
|
16303
|
-
clientX: e.clientX,
|
16304
|
-
clientY: e.clientY
|
16305
|
-
});
|
16306
|
-
if (!args.isDefaultPrevented()) {
|
16307
|
-
targetClone_1 = args.targetClone;
|
16308
|
-
editor.undoManager.transact(function () {
|
16309
|
-
removeElement(state.element);
|
16310
|
-
editor.insertContent(editor.dom.getOuterHTML(targetClone_1));
|
16311
|
-
editor._selectionOverrides.hideFakeCaret();
|
16312
|
-
});
|
16313
|
-
}
|
16314
|
-
}
|
16315
|
-
}
|
16316
|
-
removeDragState(state);
|
16317
|
-
};
|
16318
|
-
};
|
16319
|
-
var stop = function (state, editor) {
|
16320
|
-
return function () {
|
16321
|
-
if (state.dragging) {
|
16322
|
-
editor.fire('dragend');
|
16323
|
-
}
|
16324
|
-
removeDragState(state);
|
16325
|
-
};
|
16326
|
-
};
|
16327
|
-
var removeDragState = function (state) {
|
16328
|
-
state.dragging = false;
|
16329
|
-
state.element = null;
|
16330
|
-
removeElement(state.ghost);
|
16331
|
-
};
|
16332
|
-
var bindFakeDragEvents = function (editor) {
|
16333
|
-
var state = {};
|
16334
|
-
var pageDom, dragStartHandler, dragHandler, dropHandler, dragEndHandler, rootDocument;
|
16335
|
-
pageDom = DOMUtils$1.DOM;
|
16336
|
-
rootDocument = domGlobals.document;
|
16337
|
-
dragStartHandler = start$1(state, editor);
|
16338
|
-
dragHandler = move$1(state, editor);
|
16339
|
-
dropHandler = drop(state, editor);
|
16340
|
-
dragEndHandler = stop(state, editor);
|
16341
|
-
editor.on('mousedown', dragStartHandler);
|
16342
|
-
editor.on('mousemove', dragHandler);
|
16343
|
-
editor.on('mouseup', dropHandler);
|
16344
|
-
pageDom.bind(rootDocument, 'mousemove', dragHandler);
|
16345
|
-
pageDom.bind(rootDocument, 'mouseup', dragEndHandler);
|
16346
|
-
editor.on('remove', function () {
|
16347
|
-
pageDom.unbind(rootDocument, 'mousemove', dragHandler);
|
16348
|
-
pageDom.unbind(rootDocument, 'mouseup', dragEndHandler);
|
16349
|
-
});
|
16350
|
-
};
|
16351
|
-
var blockIeDrop = function (editor) {
|
16352
|
-
editor.on('drop', function (e) {
|
16353
|
-
var realTarget = typeof e.clientX !== 'undefined' ? editor.getDoc().elementFromPoint(e.clientX, e.clientY) : null;
|
16354
|
-
if (isContentEditableFalse$7(realTarget) || isContentEditableFalse$7(editor.dom.getContentEditableParent(realTarget))) {
|
16355
|
-
e.preventDefault();
|
16356
|
-
}
|
16357
|
-
});
|
16358
|
-
};
|
16359
|
-
var init = function (editor) {
|
16360
|
-
bindFakeDragEvents(editor);
|
16361
|
-
blockIeDrop(editor);
|
16362
|
-
};
|
16363
|
-
var DragDropOverrides = { init: init };
|
16364
|
-
|
16365
|
-
var getNodeClientRects = function (node) {
|
16366
|
-
var toArrayWithNode = function (clientRects) {
|
16367
|
-
return map(clientRects, function (clientRect) {
|
16368
|
-
clientRect = clone$1(clientRect);
|
16369
|
-
clientRect.node = node;
|
16370
|
-
return clientRect;
|
16371
|
-
});
|
16372
|
-
};
|
16373
|
-
if (NodeType.isElement(node)) {
|
16374
|
-
return toArrayWithNode(node.getClientRects());
|
16375
|
-
}
|
16376
|
-
if (NodeType.isText(node)) {
|
16377
|
-
var rng = node.ownerDocument.createRange();
|
16378
|
-
rng.setStart(node, 0);
|
16379
|
-
rng.setEnd(node, node.data.length);
|
16380
|
-
return toArrayWithNode(rng.getClientRects());
|
16735
|
+
if (NodeType.isText(node)) {
|
16736
|
+
var rng = node.ownerDocument.createRange();
|
16737
|
+
rng.setStart(node, 0);
|
16738
|
+
rng.setEnd(node, node.data.length);
|
16739
|
+
return toArrayWithNode(rng.getClientRects());
|
16381
16740
|
}
|
16382
16741
|
};
|
16383
16742
|
var getClientRects = function (node) {
|
@@ -16495,7 +16854,7 @@
|
|
16495
16854
|
};
|
16496
16855
|
};
|
16497
16856
|
|
16498
|
-
var isContentEditableFalse$
|
16857
|
+
var isContentEditableFalse$7 = NodeType.isContentEditableFalse;
|
16499
16858
|
var findNode$1 = findNode;
|
16500
16859
|
var distanceToRectLeft = function (clientRect, clientX) {
|
16501
16860
|
return Math.abs(clientRect.left - clientX);
|
@@ -16517,71 +16876,345 @@
|
|
16517
16876
|
if (isInside(clientX, oldClientRect)) {
|
16518
16877
|
return oldClientRect;
|
16519
16878
|
}
|
16520
|
-
if (newDistance === oldDistance && isContentEditableFalse$
|
16879
|
+
if (newDistance === oldDistance && isContentEditableFalse$7(clientRect.node)) {
|
16521
16880
|
return clientRect;
|
16522
16881
|
}
|
16523
16882
|
if (newDistance < oldDistance) {
|
16524
16883
|
return clientRect;
|
16525
16884
|
}
|
16526
|
-
return oldClientRect;
|
16527
|
-
});
|
16885
|
+
return oldClientRect;
|
16886
|
+
});
|
16887
|
+
};
|
16888
|
+
var walkUntil$1 = function (direction, root, predicateFn, node) {
|
16889
|
+
while (node = findNode$1(node, direction, isEditableCaretCandidate, root)) {
|
16890
|
+
if (predicateFn(node)) {
|
16891
|
+
return;
|
16892
|
+
}
|
16893
|
+
}
|
16894
|
+
};
|
16895
|
+
var findLineNodeRects = function (root, targetNodeRect) {
|
16896
|
+
var clientRects = [];
|
16897
|
+
var collect = function (checkPosFn, node) {
|
16898
|
+
var lineRects;
|
16899
|
+
lineRects = filter(getClientRects([node]), function (clientRect) {
|
16900
|
+
return !checkPosFn(clientRect, targetNodeRect);
|
16901
|
+
});
|
16902
|
+
clientRects = clientRects.concat(lineRects);
|
16903
|
+
return lineRects.length === 0;
|
16904
|
+
};
|
16905
|
+
clientRects.push(targetNodeRect);
|
16906
|
+
walkUntil$1(VDirection.Up, root, curry(collect, isAbove), targetNodeRect.node);
|
16907
|
+
walkUntil$1(VDirection.Down, root, curry(collect, isBelow), targetNodeRect.node);
|
16908
|
+
return clientRects;
|
16909
|
+
};
|
16910
|
+
var getFakeCaretTargets = function (root) {
|
16911
|
+
return filter(from$1(root.getElementsByTagName('*')), isFakeCaretTarget);
|
16912
|
+
};
|
16913
|
+
var caretInfo = function (clientRect, clientX) {
|
16914
|
+
return {
|
16915
|
+
node: clientRect.node,
|
16916
|
+
before: distanceToRectLeft(clientRect, clientX) < distanceToRectRight(clientRect, clientX)
|
16917
|
+
};
|
16918
|
+
};
|
16919
|
+
var closestCaret = function (root, clientX, clientY) {
|
16920
|
+
var closestNodeRect;
|
16921
|
+
var contentEditableFalseNodeRects = getClientRects(getFakeCaretTargets(root));
|
16922
|
+
var targetNodeRects = filter(contentEditableFalseNodeRects, function (rect) {
|
16923
|
+
return clientY >= rect.top && clientY <= rect.bottom;
|
16924
|
+
});
|
16925
|
+
closestNodeRect = findClosestClientRect(targetNodeRects, clientX);
|
16926
|
+
if (closestNodeRect) {
|
16927
|
+
closestNodeRect = findClosestClientRect(findLineNodeRects(root, closestNodeRect), clientX);
|
16928
|
+
if (closestNodeRect && isFakeCaretTarget(closestNodeRect.node)) {
|
16929
|
+
return caretInfo(closestNodeRect, clientX);
|
16930
|
+
}
|
16931
|
+
}
|
16932
|
+
return null;
|
16933
|
+
};
|
16934
|
+
|
16935
|
+
var isXYWithinRange = function (clientX, clientY, range) {
|
16936
|
+
if (range.collapsed) {
|
16937
|
+
return false;
|
16938
|
+
}
|
16939
|
+
if (Env.ie && Env.ie <= 11 && range.startOffset === range.endOffset - 1 && range.startContainer === range.endContainer) {
|
16940
|
+
var elm = range.startContainer.childNodes[range.startOffset];
|
16941
|
+
if (NodeType.isElement(elm)) {
|
16942
|
+
return exists(elm.getClientRects(), function (rect) {
|
16943
|
+
return containsXY(rect, clientX, clientY);
|
16944
|
+
});
|
16945
|
+
}
|
16946
|
+
}
|
16947
|
+
return exists(range.getClientRects(), function (rect) {
|
16948
|
+
return containsXY(rect, clientX, clientY);
|
16949
|
+
});
|
16950
|
+
};
|
16951
|
+
var RangePoint = { isXYWithinRange: isXYWithinRange };
|
16952
|
+
|
16953
|
+
var getAbsolutePosition = function (elm) {
|
16954
|
+
var doc, docElem, win, clientRect;
|
16955
|
+
clientRect = elm.getBoundingClientRect();
|
16956
|
+
doc = elm.ownerDocument;
|
16957
|
+
docElem = doc.documentElement;
|
16958
|
+
win = doc.defaultView;
|
16959
|
+
return {
|
16960
|
+
top: clientRect.top + win.pageYOffset - docElem.clientTop,
|
16961
|
+
left: clientRect.left + win.pageXOffset - docElem.clientLeft
|
16962
|
+
};
|
16963
|
+
};
|
16964
|
+
var getBodyPosition = function (editor) {
|
16965
|
+
return editor.inline ? getAbsolutePosition(editor.getBody()) : {
|
16966
|
+
left: 0,
|
16967
|
+
top: 0
|
16968
|
+
};
|
16969
|
+
};
|
16970
|
+
var getScrollPosition = function (editor) {
|
16971
|
+
var body = editor.getBody();
|
16972
|
+
return editor.inline ? {
|
16973
|
+
left: body.scrollLeft,
|
16974
|
+
top: body.scrollTop
|
16975
|
+
} : {
|
16976
|
+
left: 0,
|
16977
|
+
top: 0
|
16978
|
+
};
|
16979
|
+
};
|
16980
|
+
var getBodyScroll = function (editor) {
|
16981
|
+
var body = editor.getBody(), docElm = editor.getDoc().documentElement;
|
16982
|
+
var inlineScroll = {
|
16983
|
+
left: body.scrollLeft,
|
16984
|
+
top: body.scrollTop
|
16985
|
+
};
|
16986
|
+
var iframeScroll = {
|
16987
|
+
left: body.scrollLeft || docElm.scrollLeft,
|
16988
|
+
top: body.scrollTop || docElm.scrollTop
|
16989
|
+
};
|
16990
|
+
return editor.inline ? inlineScroll : iframeScroll;
|
16991
|
+
};
|
16992
|
+
var getMousePosition = function (editor, event) {
|
16993
|
+
if (event.target.ownerDocument !== editor.getDoc()) {
|
16994
|
+
var iframePosition = getAbsolutePosition(editor.getContentAreaContainer());
|
16995
|
+
var scrollPosition = getBodyScroll(editor);
|
16996
|
+
return {
|
16997
|
+
left: event.pageX - iframePosition.left + scrollPosition.left,
|
16998
|
+
top: event.pageY - iframePosition.top + scrollPosition.top
|
16999
|
+
};
|
17000
|
+
}
|
17001
|
+
return {
|
17002
|
+
left: event.pageX,
|
17003
|
+
top: event.pageY
|
17004
|
+
};
|
17005
|
+
};
|
17006
|
+
var calculatePosition = function (bodyPosition, scrollPosition, mousePosition) {
|
17007
|
+
return {
|
17008
|
+
pageX: mousePosition.left - bodyPosition.left + scrollPosition.left,
|
17009
|
+
pageY: mousePosition.top - bodyPosition.top + scrollPosition.top
|
17010
|
+
};
|
17011
|
+
};
|
17012
|
+
var calc = function (editor, event) {
|
17013
|
+
return calculatePosition(getBodyPosition(editor), getScrollPosition(editor), getMousePosition(editor, event));
|
17014
|
+
};
|
17015
|
+
var MousePosition = { calc: calc };
|
17016
|
+
|
17017
|
+
var isContentEditableFalse$8 = NodeType.isContentEditableFalse, isContentEditableTrue$3 = NodeType.isContentEditableTrue;
|
17018
|
+
var isDraggable = function (rootElm, elm) {
|
17019
|
+
return isContentEditableFalse$8(elm) && elm !== rootElm;
|
17020
|
+
};
|
17021
|
+
var isValidDropTarget = function (editor, targetElement, dragElement) {
|
17022
|
+
if (targetElement === dragElement || editor.dom.isChildOf(targetElement, dragElement)) {
|
17023
|
+
return false;
|
17024
|
+
}
|
17025
|
+
if (isContentEditableFalse$8(targetElement)) {
|
17026
|
+
return false;
|
17027
|
+
}
|
17028
|
+
return true;
|
17029
|
+
};
|
17030
|
+
var cloneElement = function (elm) {
|
17031
|
+
var cloneElm = elm.cloneNode(true);
|
17032
|
+
cloneElm.removeAttribute('data-mce-selected');
|
17033
|
+
return cloneElm;
|
17034
|
+
};
|
17035
|
+
var createGhost = function (editor, elm, width, height) {
|
17036
|
+
var clonedElm = elm.cloneNode(true);
|
17037
|
+
editor.dom.setStyles(clonedElm, {
|
17038
|
+
width: width,
|
17039
|
+
height: height
|
17040
|
+
});
|
17041
|
+
editor.dom.setAttrib(clonedElm, 'data-mce-selected', null);
|
17042
|
+
var ghostElm = editor.dom.create('div', {
|
17043
|
+
'class': 'mce-drag-container',
|
17044
|
+
'data-mce-bogus': 'all',
|
17045
|
+
'unselectable': 'on',
|
17046
|
+
'contenteditable': 'false'
|
17047
|
+
});
|
17048
|
+
editor.dom.setStyles(ghostElm, {
|
17049
|
+
position: 'absolute',
|
17050
|
+
opacity: 0.5,
|
17051
|
+
overflow: 'hidden',
|
17052
|
+
border: 0,
|
17053
|
+
padding: 0,
|
17054
|
+
margin: 0,
|
17055
|
+
width: width,
|
17056
|
+
height: height
|
17057
|
+
});
|
17058
|
+
editor.dom.setStyles(clonedElm, {
|
17059
|
+
margin: 0,
|
17060
|
+
boxSizing: 'border-box'
|
17061
|
+
});
|
17062
|
+
ghostElm.appendChild(clonedElm);
|
17063
|
+
return ghostElm;
|
17064
|
+
};
|
17065
|
+
var appendGhostToBody = function (ghostElm, bodyElm) {
|
17066
|
+
if (ghostElm.parentNode !== bodyElm) {
|
17067
|
+
bodyElm.appendChild(ghostElm);
|
17068
|
+
}
|
17069
|
+
};
|
17070
|
+
var moveGhost = function (ghostElm, position, width, height, maxX, maxY) {
|
17071
|
+
var overflowX = 0, overflowY = 0;
|
17072
|
+
ghostElm.style.left = position.pageX + 'px';
|
17073
|
+
ghostElm.style.top = position.pageY + 'px';
|
17074
|
+
if (position.pageX + width > maxX) {
|
17075
|
+
overflowX = position.pageX + width - maxX;
|
17076
|
+
}
|
17077
|
+
if (position.pageY + height > maxY) {
|
17078
|
+
overflowY = position.pageY + height - maxY;
|
17079
|
+
}
|
17080
|
+
ghostElm.style.width = width - overflowX + 'px';
|
17081
|
+
ghostElm.style.height = height - overflowY + 'px';
|
17082
|
+
};
|
17083
|
+
var removeElement = function (elm) {
|
17084
|
+
if (elm && elm.parentNode) {
|
17085
|
+
elm.parentNode.removeChild(elm);
|
17086
|
+
}
|
17087
|
+
};
|
17088
|
+
var isLeftMouseButtonPressed = function (e) {
|
17089
|
+
return e.button === 0;
|
17090
|
+
};
|
17091
|
+
var hasDraggableElement = function (state) {
|
17092
|
+
return state.element;
|
17093
|
+
};
|
17094
|
+
var applyRelPos = function (state, position) {
|
17095
|
+
return {
|
17096
|
+
pageX: position.pageX - state.relX,
|
17097
|
+
pageY: position.pageY + 5
|
17098
|
+
};
|
17099
|
+
};
|
17100
|
+
var start$1 = function (state, editor) {
|
17101
|
+
return function (e) {
|
17102
|
+
if (isLeftMouseButtonPressed(e)) {
|
17103
|
+
var ceElm = find(editor.dom.getParents(e.target), Predicate.or(isContentEditableFalse$8, isContentEditableTrue$3)).getOr(null);
|
17104
|
+
if (isDraggable(editor.getBody(), ceElm)) {
|
17105
|
+
var elmPos = editor.dom.getPos(ceElm);
|
17106
|
+
var bodyElm = editor.getBody();
|
17107
|
+
var docElm = editor.getDoc().documentElement;
|
17108
|
+
state.element = ceElm;
|
17109
|
+
state.screenX = e.screenX;
|
17110
|
+
state.screenY = e.screenY;
|
17111
|
+
state.maxX = (editor.inline ? bodyElm.scrollWidth : docElm.offsetWidth) - 2;
|
17112
|
+
state.maxY = (editor.inline ? bodyElm.scrollHeight : docElm.offsetHeight) - 2;
|
17113
|
+
state.relX = e.pageX - elmPos.x;
|
17114
|
+
state.relY = e.pageY - elmPos.y;
|
17115
|
+
state.width = ceElm.offsetWidth;
|
17116
|
+
state.height = ceElm.offsetHeight;
|
17117
|
+
state.ghost = createGhost(editor, ceElm, state.width, state.height);
|
17118
|
+
}
|
17119
|
+
}
|
17120
|
+
};
|
17121
|
+
};
|
17122
|
+
var move$1 = function (state, editor) {
|
17123
|
+
var throttledPlaceCaretAt = Delay.throttle(function (clientX, clientY) {
|
17124
|
+
editor._selectionOverrides.hideFakeCaret();
|
17125
|
+
editor.selection.placeCaretAt(clientX, clientY);
|
17126
|
+
}, 0);
|
17127
|
+
return function (e) {
|
17128
|
+
var movement = Math.max(Math.abs(e.screenX - state.screenX), Math.abs(e.screenY - state.screenY));
|
17129
|
+
if (hasDraggableElement(state) && !state.dragging && movement > 10) {
|
17130
|
+
var args = editor.fire('dragstart', { target: state.element });
|
17131
|
+
if (args.isDefaultPrevented()) {
|
17132
|
+
return;
|
17133
|
+
}
|
17134
|
+
state.dragging = true;
|
17135
|
+
editor.focus();
|
17136
|
+
}
|
17137
|
+
if (state.dragging) {
|
17138
|
+
var targetPos = applyRelPos(state, MousePosition.calc(editor, e));
|
17139
|
+
appendGhostToBody(state.ghost, editor.getBody());
|
17140
|
+
moveGhost(state.ghost, targetPos, state.width, state.height, state.maxX, state.maxY);
|
17141
|
+
throttledPlaceCaretAt(e.clientX, e.clientY);
|
17142
|
+
}
|
17143
|
+
};
|
17144
|
+
};
|
17145
|
+
var getRawTarget = function (selection) {
|
17146
|
+
var rng = selection.getSel().getRangeAt(0);
|
17147
|
+
var startContainer = rng.startContainer;
|
17148
|
+
return startContainer.nodeType === 3 ? startContainer.parentNode : startContainer;
|
17149
|
+
};
|
17150
|
+
var drop = function (state, editor) {
|
17151
|
+
return function (e) {
|
17152
|
+
if (state.dragging) {
|
17153
|
+
if (isValidDropTarget(editor, getRawTarget(editor.selection), state.element)) {
|
17154
|
+
var targetClone_1 = cloneElement(state.element);
|
17155
|
+
var args = editor.fire('drop', {
|
17156
|
+
targetClone: targetClone_1,
|
17157
|
+
clientX: e.clientX,
|
17158
|
+
clientY: e.clientY
|
17159
|
+
});
|
17160
|
+
if (!args.isDefaultPrevented()) {
|
17161
|
+
targetClone_1 = args.targetClone;
|
17162
|
+
editor.undoManager.transact(function () {
|
17163
|
+
removeElement(state.element);
|
17164
|
+
editor.insertContent(editor.dom.getOuterHTML(targetClone_1));
|
17165
|
+
editor._selectionOverrides.hideFakeCaret();
|
17166
|
+
});
|
17167
|
+
}
|
17168
|
+
}
|
17169
|
+
}
|
17170
|
+
removeDragState(state);
|
17171
|
+
};
|
16528
17172
|
};
|
16529
|
-
var
|
16530
|
-
|
16531
|
-
if (
|
16532
|
-
|
17173
|
+
var stop = function (state, editor) {
|
17174
|
+
return function () {
|
17175
|
+
if (state.dragging) {
|
17176
|
+
editor.fire('dragend');
|
16533
17177
|
}
|
16534
|
-
|
16535
|
-
};
|
16536
|
-
var findLineNodeRects = function (root, targetNodeRect) {
|
16537
|
-
var clientRects = [];
|
16538
|
-
var collect = function (checkPosFn, node) {
|
16539
|
-
var lineRects;
|
16540
|
-
lineRects = filter(getClientRects([node]), function (clientRect) {
|
16541
|
-
return !checkPosFn(clientRect, targetNodeRect);
|
16542
|
-
});
|
16543
|
-
clientRects = clientRects.concat(lineRects);
|
16544
|
-
return lineRects.length === 0;
|
17178
|
+
removeDragState(state);
|
16545
17179
|
};
|
16546
|
-
clientRects.push(targetNodeRect);
|
16547
|
-
walkUntil$1(VDirection.Up, root, curry(collect, isAbove), targetNodeRect.node);
|
16548
|
-
walkUntil$1(VDirection.Down, root, curry(collect, isBelow), targetNodeRect.node);
|
16549
|
-
return clientRects;
|
16550
17180
|
};
|
16551
|
-
var
|
16552
|
-
|
16553
|
-
|
16554
|
-
|
16555
|
-
return {
|
16556
|
-
node: clientRect.node,
|
16557
|
-
before: distanceToRectLeft(clientRect, clientX) < distanceToRectRight(clientRect, clientX)
|
16558
|
-
};
|
17181
|
+
var removeDragState = function (state) {
|
17182
|
+
state.dragging = false;
|
17183
|
+
state.element = null;
|
17184
|
+
removeElement(state.ghost);
|
16559
17185
|
};
|
16560
|
-
var
|
16561
|
-
var
|
16562
|
-
var
|
16563
|
-
|
16564
|
-
|
17186
|
+
var bindFakeDragEvents = function (editor) {
|
17187
|
+
var state = {};
|
17188
|
+
var pageDom, dragStartHandler, dragHandler, dropHandler, dragEndHandler, rootDocument;
|
17189
|
+
pageDom = DOMUtils$1.DOM;
|
17190
|
+
rootDocument = domGlobals.document;
|
17191
|
+
dragStartHandler = start$1(state, editor);
|
17192
|
+
dragHandler = move$1(state, editor);
|
17193
|
+
dropHandler = drop(state, editor);
|
17194
|
+
dragEndHandler = stop(state, editor);
|
17195
|
+
editor.on('mousedown', dragStartHandler);
|
17196
|
+
editor.on('mousemove', dragHandler);
|
17197
|
+
editor.on('mouseup', dropHandler);
|
17198
|
+
pageDom.bind(rootDocument, 'mousemove', dragHandler);
|
17199
|
+
pageDom.bind(rootDocument, 'mouseup', dragEndHandler);
|
17200
|
+
editor.on('remove', function () {
|
17201
|
+
pageDom.unbind(rootDocument, 'mousemove', dragHandler);
|
17202
|
+
pageDom.unbind(rootDocument, 'mouseup', dragEndHandler);
|
16565
17203
|
});
|
16566
|
-
|
16567
|
-
|
16568
|
-
|
16569
|
-
|
16570
|
-
|
17204
|
+
};
|
17205
|
+
var blockIeDrop = function (editor) {
|
17206
|
+
editor.on('drop', function (e) {
|
17207
|
+
var realTarget = typeof e.clientX !== 'undefined' ? editor.getDoc().elementFromPoint(e.clientX, e.clientY) : null;
|
17208
|
+
if (isContentEditableFalse$8(realTarget) || isContentEditableFalse$8(editor.dom.getContentEditableParent(realTarget))) {
|
17209
|
+
e.preventDefault();
|
16571
17210
|
}
|
16572
|
-
}
|
16573
|
-
return null;
|
17211
|
+
});
|
16574
17212
|
};
|
16575
|
-
|
16576
|
-
|
16577
|
-
|
16578
|
-
return false;
|
16579
|
-
}
|
16580
|
-
return foldl(range.getClientRects(), function (state, rect) {
|
16581
|
-
return state || containsXY(rect, clientX, clientY);
|
16582
|
-
}, false);
|
17213
|
+
var init = function (editor) {
|
17214
|
+
bindFakeDragEvents(editor);
|
17215
|
+
blockIeDrop(editor);
|
16583
17216
|
};
|
16584
|
-
var
|
17217
|
+
var DragDropOverrides = { init: init };
|
16585
17218
|
|
16586
17219
|
var setup$4 = function (editor) {
|
16587
17220
|
var renderFocusCaret = first(function () {
|
@@ -16602,26 +17235,6 @@
|
|
16602
17235
|
};
|
16603
17236
|
var CefFocus = { setup: setup$4 };
|
16604
17237
|
|
16605
|
-
var VK = {
|
16606
|
-
BACKSPACE: 8,
|
16607
|
-
DELETE: 46,
|
16608
|
-
DOWN: 40,
|
16609
|
-
ENTER: 13,
|
16610
|
-
LEFT: 37,
|
16611
|
-
RIGHT: 39,
|
16612
|
-
SPACEBAR: 32,
|
16613
|
-
TAB: 9,
|
16614
|
-
UP: 38,
|
16615
|
-
END: 35,
|
16616
|
-
HOME: 36,
|
16617
|
-
modifierPressed: function (e) {
|
16618
|
-
return e.shiftKey || e.ctrlKey || e.altKey || this.metaKeyPressed(e);
|
16619
|
-
},
|
16620
|
-
metaKeyPressed: function (e) {
|
16621
|
-
return Env.mac ? e.metaKey : e.ctrlKey && !e.altKey;
|
16622
|
-
}
|
16623
|
-
};
|
16624
|
-
|
16625
17238
|
var isContentEditableTrue$4 = NodeType.isContentEditableTrue;
|
16626
17239
|
var isContentEditableFalse$9 = NodeType.isContentEditableFalse;
|
16627
17240
|
var getContentEditableRoot$1 = function (editor, node) {
|
@@ -16820,8 +17433,8 @@
|
|
16820
17433
|
}
|
16821
17434
|
});
|
16822
17435
|
editor.on('setSelectionRange', function (e) {
|
16823
|
-
|
16824
|
-
rng = setContentEditableSelection(e.range, e.forward);
|
17436
|
+
e.range = normalizeShortEndedElementSelection(e.range);
|
17437
|
+
var rng = setContentEditableSelection(e.range, e.forward);
|
16825
17438
|
if (rng) {
|
16826
17439
|
e.range = rng;
|
16827
17440
|
}
|
@@ -16864,6 +17477,33 @@
|
|
16864
17477
|
var isRangeInCaretContainer = function (rng) {
|
16865
17478
|
return isWithinCaretContainer(rng.startContainer) || isWithinCaretContainer(rng.endContainer);
|
16866
17479
|
};
|
17480
|
+
var normalizeShortEndedElementSelection = function (rng) {
|
17481
|
+
var shortEndedElements = editor.schema.getShortEndedElements();
|
17482
|
+
var newRng = editor.dom.createRng();
|
17483
|
+
var startContainer = rng.startContainer;
|
17484
|
+
var startOffset = rng.startOffset;
|
17485
|
+
var endContainer = rng.endContainer;
|
17486
|
+
var endOffset = rng.endOffset;
|
17487
|
+
if (has(shortEndedElements, startContainer.nodeName.toLowerCase())) {
|
17488
|
+
if (startOffset === 0) {
|
17489
|
+
newRng.setStartBefore(startContainer);
|
17490
|
+
} else {
|
17491
|
+
newRng.setStartAfter(startContainer);
|
17492
|
+
}
|
17493
|
+
} else {
|
17494
|
+
newRng.setStart(startContainer, startOffset);
|
17495
|
+
}
|
17496
|
+
if (has(shortEndedElements, endContainer.nodeName.toLowerCase())) {
|
17497
|
+
if (endOffset === 0) {
|
17498
|
+
newRng.setEndBefore(endContainer);
|
17499
|
+
} else {
|
17500
|
+
newRng.setEndAfter(endContainer);
|
17501
|
+
}
|
17502
|
+
} else {
|
17503
|
+
newRng.setEnd(endContainer, endOffset);
|
17504
|
+
}
|
17505
|
+
return newRng;
|
17506
|
+
};
|
16867
17507
|
var setContentEditableSelection = function (range, forward) {
|
16868
17508
|
var node;
|
16869
17509
|
var $ = editor.$;
|
@@ -16905,7 +17545,7 @@
|
|
16905
17545
|
if (startContainer.nodeType !== 1) {
|
16906
17546
|
return null;
|
16907
17547
|
}
|
16908
|
-
if (endOffset === startOffset + 1) {
|
17548
|
+
if (endOffset === startOffset + 1 && startContainer === range.endContainer) {
|
16909
17549
|
node = startContainer.childNodes[startOffset];
|
16910
17550
|
}
|
16911
17551
|
if (!isContentEditableFalse$9(node)) {
|
@@ -16984,7 +17624,11 @@
|
|
16984
17624
|
return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0;
|
16985
17625
|
};
|
16986
17626
|
var trimComments = function (text) {
|
16987
|
-
|
17627
|
+
var sanitizedText = text;
|
17628
|
+
while (/<!--|--!?>/g.test(sanitizedText)) {
|
17629
|
+
sanitizedText = sanitizedText.replace(/<!--|--!?>/g, '');
|
17630
|
+
}
|
17631
|
+
return sanitizedText;
|
16988
17632
|
};
|
16989
17633
|
var isInvalidUri = function (settings, uri) {
|
16990
17634
|
if (settings.allow_html_data_urls) {
|
@@ -17122,7 +17766,7 @@
|
|
17122
17766
|
value: value
|
17123
17767
|
});
|
17124
17768
|
};
|
17125
|
-
tokenRegExp = new RegExp('<(?:' + '(?:!--([\\w\\W]*?)
|
17769
|
+
tokenRegExp = new RegExp('<(?:' + '(?:!--([\\w\\W]*?)--!?>)|' + '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + '(?:!DOCTYPE([\\w\\W]*?)>)|' + '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + '(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|' + '(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + ')', 'g');
|
17126
17770
|
attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
|
17127
17771
|
shortEndedElements = schema.getShortEndedElements();
|
17128
17772
|
selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
|
@@ -18618,7 +19262,7 @@
|
|
18618
19262
|
}
|
18619
19263
|
ed.selection.setRng(RangeNormalizer.normalize(ed.selection.getRng()));
|
18620
19264
|
bookmark = GetBookmark.getPersistentBookmark(ed.selection, true);
|
18621
|
-
applyRngStyle(dom, ExpandRange.expandRng(ed, selection.getRng(), formatList)
|
19265
|
+
applyRngStyle(dom, ExpandRange.expandRng(ed, selection.getRng(), formatList));
|
18622
19266
|
if (format.styles) {
|
18623
19267
|
MergeFormats.mergeUnderlineAndColor(dom, format, vars, curSelNode);
|
18624
19268
|
}
|
@@ -19289,17 +19933,20 @@
|
|
19289
19933
|
var baseMerge = function (merger) {
|
19290
19934
|
return function () {
|
19291
19935
|
var objects = new Array(arguments.length);
|
19292
|
-
for (var i = 0; i < objects.length; i++)
|
19936
|
+
for (var i = 0; i < objects.length; i++) {
|
19293
19937
|
objects[i] = arguments[i];
|
19294
|
-
|
19938
|
+
}
|
19939
|
+
if (objects.length === 0) {
|
19295
19940
|
throw new Error('Can\'t merge zero objects');
|
19941
|
+
}
|
19296
19942
|
var ret = {};
|
19297
19943
|
for (var j = 0; j < objects.length; j++) {
|
19298
19944
|
var curObject = objects[j];
|
19299
|
-
for (var key in curObject)
|
19945
|
+
for (var key in curObject) {
|
19300
19946
|
if (hasOwnProperty$2.call(curObject, key)) {
|
19301
19947
|
ret[key] = merger(ret[key], curObject[key]);
|
19302
19948
|
}
|
19949
|
+
}
|
19303
19950
|
}
|
19304
19951
|
return ret;
|
19305
19952
|
};
|
@@ -19866,7 +20513,7 @@
|
|
19866
20513
|
var blockElements = Tools.extend({}, schema.getBlockElements());
|
19867
20514
|
var nonEmptyElements = schema.getNonEmptyElements();
|
19868
20515
|
var parent, lastParent, prev, prevName;
|
19869
|
-
var whiteSpaceElements = schema.
|
20516
|
+
var whiteSpaceElements = schema.getWhiteSpaceElements();
|
19870
20517
|
var elementRule, textNode;
|
19871
20518
|
blockElements.body = 1;
|
19872
20519
|
for (i = 0; i < l; i++) {
|
@@ -20632,7 +21279,6 @@
|
|
20632
21279
|
var contextMenuSelectImage = function (evt) {
|
20633
21280
|
var target = evt.target;
|
20634
21281
|
if (isEventOnImageOutsideRange(evt, editor.selection.getRng()) && !evt.isDefaultPrevented()) {
|
20635
|
-
evt.preventDefault();
|
20636
21282
|
editor.selection.select(target);
|
20637
21283
|
}
|
20638
21284
|
};
|
@@ -20942,99 +21588,6 @@
|
|
20942
21588
|
};
|
20943
21589
|
};
|
20944
21590
|
|
20945
|
-
var getPos$1 = function (elm) {
|
20946
|
-
var x = 0, y = 0;
|
20947
|
-
var offsetParent = elm;
|
20948
|
-
while (offsetParent && offsetParent.nodeType) {
|
20949
|
-
x += offsetParent.offsetLeft || 0;
|
20950
|
-
y += offsetParent.offsetTop || 0;
|
20951
|
-
offsetParent = offsetParent.offsetParent;
|
20952
|
-
}
|
20953
|
-
return {
|
20954
|
-
x: x,
|
20955
|
-
y: y
|
20956
|
-
};
|
20957
|
-
};
|
20958
|
-
var fireScrollIntoViewEvent = function (editor, elm, alignToTop) {
|
20959
|
-
var scrollEvent = {
|
20960
|
-
elm: elm,
|
20961
|
-
alignToTop: alignToTop
|
20962
|
-
};
|
20963
|
-
editor.fire('scrollIntoView', scrollEvent);
|
20964
|
-
return scrollEvent.isDefaultPrevented();
|
20965
|
-
};
|
20966
|
-
var scrollElementIntoView = function (editor, elm, alignToTop) {
|
20967
|
-
var y, viewPort;
|
20968
|
-
var dom = editor.dom;
|
20969
|
-
var root = dom.getRoot();
|
20970
|
-
var viewPortY, viewPortH, offsetY = 0;
|
20971
|
-
if (fireScrollIntoViewEvent(editor, elm, alignToTop)) {
|
20972
|
-
return;
|
20973
|
-
}
|
20974
|
-
if (!NodeType.isElement(elm)) {
|
20975
|
-
return;
|
20976
|
-
}
|
20977
|
-
if (alignToTop === false) {
|
20978
|
-
offsetY = elm.offsetHeight;
|
20979
|
-
}
|
20980
|
-
if (root.nodeName !== 'BODY') {
|
20981
|
-
var scrollContainer = editor.selection.getScrollContainer();
|
20982
|
-
if (scrollContainer) {
|
20983
|
-
y = getPos$1(elm).y - getPos$1(scrollContainer).y + offsetY;
|
20984
|
-
viewPortH = scrollContainer.clientHeight;
|
20985
|
-
viewPortY = scrollContainer.scrollTop;
|
20986
|
-
if (y < viewPortY || y + 25 > viewPortY + viewPortH) {
|
20987
|
-
scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25;
|
20988
|
-
}
|
20989
|
-
return;
|
20990
|
-
}
|
20991
|
-
}
|
20992
|
-
viewPort = dom.getViewPort(editor.getWin());
|
20993
|
-
y = dom.getPos(elm).y + offsetY;
|
20994
|
-
viewPortY = viewPort.y;
|
20995
|
-
viewPortH = viewPort.h;
|
20996
|
-
if (y < viewPort.y || y + 25 > viewPortY + viewPortH) {
|
20997
|
-
editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25);
|
20998
|
-
}
|
20999
|
-
};
|
21000
|
-
var getViewPortRect = function (editor) {
|
21001
|
-
if (editor.inline) {
|
21002
|
-
return editor.getBody().getBoundingClientRect();
|
21003
|
-
} else {
|
21004
|
-
var win = editor.getWin();
|
21005
|
-
return {
|
21006
|
-
left: 0,
|
21007
|
-
right: win.innerWidth,
|
21008
|
-
top: 0,
|
21009
|
-
bottom: win.innerHeight,
|
21010
|
-
width: win.innerWidth,
|
21011
|
-
height: win.innerHeight
|
21012
|
-
};
|
21013
|
-
}
|
21014
|
-
};
|
21015
|
-
var scrollBy = function (editor, dx, dy) {
|
21016
|
-
if (editor.inline) {
|
21017
|
-
editor.getBody().scrollLeft += dx;
|
21018
|
-
editor.getBody().scrollTop += dy;
|
21019
|
-
} else {
|
21020
|
-
editor.getWin().scrollBy(dx, dy);
|
21021
|
-
}
|
21022
|
-
};
|
21023
|
-
var scrollRangeIntoView = function (editor, rng) {
|
21024
|
-
head(CaretPosition.fromRangeStart(rng).getClientRects()).each(function (rngRect) {
|
21025
|
-
var bodyRect = getViewPortRect(editor);
|
21026
|
-
var overflow = getOverflow(bodyRect, rngRect);
|
21027
|
-
var margin = 4;
|
21028
|
-
var dx = overflow.x > 0 ? overflow.x + margin : overflow.x - margin;
|
21029
|
-
var dy = overflow.y > 0 ? overflow.y + margin : overflow.y - margin;
|
21030
|
-
scrollBy(editor, overflow.x !== 0 ? dx : 0, overflow.y !== 0 ? dy : 0);
|
21031
|
-
});
|
21032
|
-
};
|
21033
|
-
var ScrollIntoView = {
|
21034
|
-
scrollElementIntoView: scrollElementIntoView,
|
21035
|
-
scrollRangeIntoView: scrollRangeIntoView
|
21036
|
-
};
|
21037
|
-
|
21038
21591
|
var hasCeProperty = function (node) {
|
21039
21592
|
return NodeType.isContentEditableTrue(node) || NodeType.isContentEditableFalse(node);
|
21040
21593
|
};
|
@@ -21353,22 +21906,37 @@
|
|
21353
21906
|
};
|
21354
21907
|
var GetSelectionContent = { getContent: getContent };
|
21355
21908
|
|
21909
|
+
var setupArgs = function (args, content) {
|
21910
|
+
return __assign(__assign({ format: 'html' }, args), {
|
21911
|
+
set: true,
|
21912
|
+
selection: true,
|
21913
|
+
content: content
|
21914
|
+
});
|
21915
|
+
};
|
21916
|
+
var cleanContent = function (editor, args) {
|
21917
|
+
if (args.format !== 'raw') {
|
21918
|
+
var node = editor.parser.parse(args.content, __assign({
|
21919
|
+
isRootContent: true,
|
21920
|
+
forced_root_block: false
|
21921
|
+
}, args));
|
21922
|
+
return HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(node);
|
21923
|
+
} else {
|
21924
|
+
return args.content;
|
21925
|
+
}
|
21926
|
+
};
|
21356
21927
|
var setContent = function (editor, content, args) {
|
21928
|
+
var contentArgs = setupArgs(args, content);
|
21357
21929
|
var rng = editor.selection.getRng(), caretNode;
|
21358
21930
|
var doc = editor.getDoc();
|
21359
21931
|
var frag, temp;
|
21360
|
-
|
21361
|
-
|
21362
|
-
|
21363
|
-
|
21364
|
-
if (!args.no_events) {
|
21365
|
-
args = editor.fire('BeforeSetContent', args);
|
21366
|
-
if (args.isDefaultPrevented()) {
|
21367
|
-
editor.fire('SetContent', args);
|
21932
|
+
if (!contentArgs.no_events) {
|
21933
|
+
contentArgs = editor.fire('BeforeSetContent', contentArgs);
|
21934
|
+
if (contentArgs.isDefaultPrevented()) {
|
21935
|
+
editor.fire('SetContent', contentArgs);
|
21368
21936
|
return;
|
21369
21937
|
}
|
21370
21938
|
}
|
21371
|
-
content =
|
21939
|
+
content = cleanContent(editor, contentArgs);
|
21372
21940
|
if (rng.insertNode) {
|
21373
21941
|
content += '<span id="__caret">_</span>';
|
21374
21942
|
if (rng.startContainer === doc && rng.endContainer === doc) {
|
@@ -21400,19 +21968,20 @@
|
|
21400
21968
|
} catch (ex) {
|
21401
21969
|
}
|
21402
21970
|
} else {
|
21403
|
-
|
21971
|
+
var anyRng = rng;
|
21972
|
+
if (anyRng.item) {
|
21404
21973
|
doc.execCommand('Delete', false, null);
|
21405
|
-
|
21974
|
+
anyRng = editor.selection.getRng();
|
21406
21975
|
}
|
21407
21976
|
if (/^\s+/.test(content)) {
|
21408
|
-
|
21977
|
+
anyRng.pasteHTML('<span id="__mce_tmp">_</span>' + content);
|
21409
21978
|
editor.dom.remove('__mce_tmp');
|
21410
21979
|
} else {
|
21411
|
-
|
21980
|
+
anyRng.pasteHTML(content);
|
21412
21981
|
}
|
21413
21982
|
}
|
21414
|
-
if (!
|
21415
|
-
editor.fire('SetContent',
|
21983
|
+
if (!contentArgs.no_events) {
|
21984
|
+
editor.fire('SetContent', contentArgs);
|
21416
21985
|
}
|
21417
21986
|
};
|
21418
21987
|
var SetSelectionContent = { setContent: setContent };
|
@@ -21428,7 +21997,7 @@
|
|
21428
21997
|
return elm.dom();
|
21429
21998
|
}).getOr(root);
|
21430
21999
|
};
|
21431
|
-
var getStart = function (root, rng, real) {
|
22000
|
+
var getStart$2 = function (root, rng, real) {
|
21432
22001
|
return getEndpointElement(root, rng, true, real, function (elm, offset) {
|
21433
22002
|
return Math.min(childNodesCount(elm), offset);
|
21434
22003
|
});
|
@@ -21488,7 +22057,7 @@
|
|
21488
22057
|
var node, root;
|
21489
22058
|
var selectedBlocks = [];
|
21490
22059
|
root = dom.getRoot();
|
21491
|
-
startElm = dom.getParent(startElm || getStart(root, rng, rng.collapsed), dom.isBlock);
|
22060
|
+
startElm = dom.getParent(startElm || getStart$2(root, rng, rng.collapsed), dom.isBlock);
|
21492
22061
|
endElm = dom.getParent(endElm || getEnd(root, rng, rng.collapsed), dom.isBlock);
|
21493
22062
|
if (startElm && startElm !== root) {
|
21494
22063
|
selectedBlocks.push(startElm);
|
@@ -21537,7 +22106,7 @@
|
|
21537
22106
|
return isAttachedToDom(rng.startContainer) && isAttachedToDom(rng.endContainer);
|
21538
22107
|
}
|
21539
22108
|
};
|
21540
|
-
var Selection = function (dom, win, serializer, editor) {
|
22109
|
+
var Selection$1 = function (dom, win, serializer, editor) {
|
21541
22110
|
var bookmarkManager, controlSelection;
|
21542
22111
|
var selectedRange, explicitRange, selectorChangedData;
|
21543
22112
|
var setCursorLocation = function (node, offset) {
|
@@ -21558,8 +22127,8 @@
|
|
21558
22127
|
var setContent = function (content, args) {
|
21559
22128
|
return SetSelectionContent.setContent(editor, content, args);
|
21560
22129
|
};
|
21561
|
-
var getStart
|
21562
|
-
return getStart(editor.getBody(), getRng(), real);
|
22130
|
+
var getStart = function (real) {
|
22131
|
+
return getStart$2(editor.getBody(), getRng(), real);
|
21563
22132
|
};
|
21564
22133
|
var getEnd$1 = function (real) {
|
21565
22134
|
return getEnd(editor.getBody(), getRng(), real);
|
@@ -21617,7 +22186,7 @@
|
|
21617
22186
|
}
|
21618
22187
|
}
|
21619
22188
|
try {
|
21620
|
-
if (selection = getSel()) {
|
22189
|
+
if ((selection = getSel()) && !NodeType.isRestrictedNode(selection.anchorNode)) {
|
21621
22190
|
if (selection.rangeCount > 0) {
|
21622
22191
|
rng = selection.getRangeAt(0);
|
21623
22192
|
} else {
|
@@ -21824,7 +22393,7 @@
|
|
21824
22393
|
getSel: getSel,
|
21825
22394
|
setRng: setRng,
|
21826
22395
|
getRng: getRng,
|
21827
|
-
getStart: getStart
|
22396
|
+
getStart: getStart,
|
21828
22397
|
getEnd: getEnd$1,
|
21829
22398
|
getSelectedBlocks: getSelectedBlocks$1,
|
21830
22399
|
normalize: normalize,
|
@@ -21920,10 +22489,7 @@
|
|
21920
22489
|
return acc.fold(function () {
|
21921
22490
|
return Option.some(newPos);
|
21922
22491
|
}, function (lastPos) {
|
21923
|
-
return
|
21924
|
-
head(lastPos.getClientRects()),
|
21925
|
-
head(newPos.getClientRects())
|
21926
|
-
], function (lastRect, newRect) {
|
22492
|
+
return lift2(head(lastPos.getClientRects()), head(newPos.getClientRects()), function (lastRect, newRect) {
|
21927
22493
|
var lastDist = Math.abs(x - lastRect.left);
|
21928
22494
|
var newDist = Math.abs(x - newRect.left);
|
21929
22495
|
return newDist <= lastDist ? newPos : lastPos;
|
@@ -22104,7 +22670,7 @@
|
|
22104
22670
|
return function () {
|
22105
22671
|
var newRng = getHorizontalRange(editor, forward);
|
22106
22672
|
if (newRng) {
|
22107
|
-
editor
|
22673
|
+
moveToRange(editor, newRng);
|
22108
22674
|
return true;
|
22109
22675
|
} else {
|
22110
22676
|
return false;
|
@@ -22115,7 +22681,7 @@
|
|
22115
22681
|
return function () {
|
22116
22682
|
var newRng = getVerticalRange(editor, down);
|
22117
22683
|
if (newRng) {
|
22118
|
-
editor
|
22684
|
+
moveToRange(editor, newRng);
|
22119
22685
|
return true;
|
22120
22686
|
} else {
|
22121
22687
|
return false;
|
@@ -22217,10 +22783,6 @@
|
|
22217
22783
|
});
|
22218
22784
|
};
|
22219
22785
|
|
22220
|
-
var moveToRange = function (editor, rng) {
|
22221
|
-
editor.selection.setRng(rng);
|
22222
|
-
ScrollIntoView.scrollRangeIntoView(editor, rng);
|
22223
|
-
};
|
22224
22786
|
var hasNextBreak = function (getPositionsUntil, scope, lineInfo) {
|
22225
22787
|
return lineInfo.breakAt.map(function (breakPos) {
|
22226
22788
|
return getPositionsUntil(scope, breakPos).breakAt.isSome();
|
@@ -22332,7 +22894,7 @@
|
|
22332
22894
|
return function () {
|
22333
22895
|
return Option.from(editor.dom.getParent(editor.selection.getNode(), 'td,th')).bind(function (td) {
|
22334
22896
|
return Option.from(editor.dom.getParent(td, 'table')).map(function (table) {
|
22335
|
-
return navigateHorizontally(editor, forward, table
|
22897
|
+
return navigateHorizontally(editor, forward, table);
|
22336
22898
|
});
|
22337
22899
|
}).getOr(false);
|
22338
22900
|
};
|
@@ -22871,10 +23433,41 @@
|
|
22871
23433
|
}
|
22872
23434
|
return parent !== root ? editableRoot : root;
|
22873
23435
|
};
|
23436
|
+
var applyAttributes = function (editor, node, forcedRootBlockAttrs) {
|
23437
|
+
Option.from(forcedRootBlockAttrs.style).map(editor.dom.parseStyle).each(function (attrStyles) {
|
23438
|
+
var currentStyles = getAllRaw(Element.fromDom(node));
|
23439
|
+
var newStyles = __assign(__assign({}, currentStyles), attrStyles);
|
23440
|
+
editor.dom.setStyles(node, newStyles);
|
23441
|
+
});
|
23442
|
+
var attrClassesOpt = Option.from(forcedRootBlockAttrs.class).map(function (attrClasses) {
|
23443
|
+
return attrClasses.split(/\s+/);
|
23444
|
+
});
|
23445
|
+
var currentClassesOpt = Option.from(node.className).map(function (currentClasses) {
|
23446
|
+
return filter(currentClasses.split(/\s+/), function (clazz) {
|
23447
|
+
return clazz !== '';
|
23448
|
+
});
|
23449
|
+
});
|
23450
|
+
lift2(attrClassesOpt, currentClassesOpt, function (attrClasses, currentClasses) {
|
23451
|
+
var filteredClasses = filter(currentClasses, function (clazz) {
|
23452
|
+
return !contains(attrClasses, clazz);
|
23453
|
+
});
|
23454
|
+
var newClasses = __spreadArrays(attrClasses, filteredClasses);
|
23455
|
+
editor.dom.setAttrib(node, 'class', newClasses.join(' '));
|
23456
|
+
});
|
23457
|
+
var appliedAttrs = [
|
23458
|
+
'style',
|
23459
|
+
'class'
|
23460
|
+
];
|
23461
|
+
var remainingAttrs = bifilter(forcedRootBlockAttrs, function (_, attrs) {
|
23462
|
+
return !contains(appliedAttrs, attrs);
|
23463
|
+
}).t;
|
23464
|
+
editor.dom.setAttribs(node, remainingAttrs);
|
23465
|
+
};
|
22874
23466
|
var setForcedBlockAttrs = function (editor, node) {
|
22875
23467
|
var forcedRootBlockName = Settings.getForcedRootBlock(editor);
|
22876
23468
|
if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) {
|
22877
|
-
|
23469
|
+
var forcedRootBlockAttrs = Settings.getForcedRootBlockAttrs(editor);
|
23470
|
+
applyAttributes(editor, node, forcedRootBlockAttrs);
|
22878
23471
|
}
|
22879
23472
|
};
|
22880
23473
|
var wrapSelfAndSiblingsInDefaultBlock = function (editor, newBlockName, rng, container, offset) {
|
@@ -22940,7 +23533,6 @@
|
|
22940
23533
|
var textInlineElements = schema.getTextInlineElements();
|
22941
23534
|
if (name || parentBlockName === 'TABLE' || parentBlockName === 'HR') {
|
22942
23535
|
block = dom.create(name || newBlockName);
|
22943
|
-
setForcedBlockAttrs(editor, block);
|
22944
23536
|
} else {
|
22945
23537
|
block = parentBlock.cloneNode(false);
|
22946
23538
|
}
|
@@ -22966,6 +23558,7 @@
|
|
22966
23558
|
}
|
22967
23559
|
} while ((node = node.parentNode) && node !== editableRoot);
|
22968
23560
|
}
|
23561
|
+
setForcedBlockAttrs(editor, block);
|
22969
23562
|
emptyBlock(caretNode);
|
22970
23563
|
return block;
|
22971
23564
|
};
|
@@ -23072,6 +23665,7 @@
|
|
23072
23665
|
if (dom.isEmpty(parentBlock)) {
|
23073
23666
|
emptyBlock(parentBlock);
|
23074
23667
|
}
|
23668
|
+
setForcedBlockAttrs(editor, newBlock);
|
23075
23669
|
NewLineUtils.moveToCaretPosition(editor, newBlock);
|
23076
23670
|
} else if (isCaretAtStartOrEndOfBlock()) {
|
23077
23671
|
insertNewBlockAfter();
|
@@ -23096,6 +23690,7 @@
|
|
23096
23690
|
dom.remove(newBlock);
|
23097
23691
|
insertNewBlockAfter();
|
23098
23692
|
} else {
|
23693
|
+
setForcedBlockAttrs(editor, newBlock);
|
23099
23694
|
NewLineUtils.moveToCaretPosition(editor, newBlock);
|
23100
23695
|
}
|
23101
23696
|
}
|
@@ -23282,9 +23877,20 @@
|
|
23282
23877
|
var navigateIgnoreEmptyTextNodes = function (forward, root, from) {
|
23283
23878
|
return CaretFinder.navigateIgnore(forward, root, from, isEmptyText);
|
23284
23879
|
};
|
23880
|
+
var getClosestBlock = function (root, pos) {
|
23881
|
+
return find(Parents.parentsAndSelf(Element.fromDom(pos.container()), root), isBlock);
|
23882
|
+
};
|
23883
|
+
var isAtBeforeAfterBlockBoundary = function (forward, root, pos) {
|
23884
|
+
return navigateIgnoreEmptyTextNodes(forward, root.dom(), pos).forall(function (newPos) {
|
23885
|
+
return getClosestBlock(root, pos).fold(function () {
|
23886
|
+
return isInSameBlock(newPos, pos, root.dom()) === false;
|
23887
|
+
}, function (fromBlock) {
|
23888
|
+
return isInSameBlock(newPos, pos, root.dom()) === false && contains$3(fromBlock, Element.fromDom(newPos.container()));
|
23889
|
+
});
|
23890
|
+
});
|
23891
|
+
};
|
23285
23892
|
var isAtBlockBoundary = function (forward, root, pos) {
|
23286
|
-
|
23287
|
-
return head(parentBlocks).fold(function () {
|
23893
|
+
return getClosestBlock(root, pos).fold(function () {
|
23288
23894
|
return navigateIgnoreEmptyTextNodes(forward, root.dom(), pos).forall(function (newPos) {
|
23289
23895
|
return isInSameBlock(newPos, pos, root.dom()) === false;
|
23290
23896
|
});
|
@@ -23294,12 +23900,14 @@
|
|
23294
23900
|
};
|
23295
23901
|
var isAtStartOfBlock = curry(isAtBlockBoundary, false);
|
23296
23902
|
var isAtEndOfBlock = curry(isAtBlockBoundary, true);
|
23903
|
+
var isBeforeBlock = curry(isAtBeforeAfterBlockBoundary, false);
|
23904
|
+
var isAfterBlock = curry(isAtBeforeAfterBlockBoundary, true);
|
23297
23905
|
|
23298
23906
|
var nbsp = '\xA0';
|
23299
23907
|
var isInMiddleOfText = function (pos) {
|
23300
23908
|
return CaretPosition.isTextPosition(pos) && !pos.isAtStart() && !pos.isAtEnd();
|
23301
23909
|
};
|
23302
|
-
var getClosestBlock = function (root, pos) {
|
23910
|
+
var getClosestBlock$1 = function (root, pos) {
|
23303
23911
|
var parentBlocks = filter(Parents.parentsAndSelf(Element.fromDom(pos.container()), root), isBlock);
|
23304
23912
|
return head(parentBlocks).getOr(root);
|
23305
23913
|
};
|
@@ -23307,20 +23915,19 @@
|
|
23307
23915
|
if (isInMiddleOfText(pos)) {
|
23308
23916
|
return isAfterSpace(pos);
|
23309
23917
|
} else {
|
23310
|
-
return isAfterSpace(pos) || CaretFinder.prevPosition(getClosestBlock(root, pos).dom(), pos).exists(isAfterSpace);
|
23918
|
+
return isAfterSpace(pos) || CaretFinder.prevPosition(getClosestBlock$1(root, pos).dom(), pos).exists(isAfterSpace);
|
23311
23919
|
}
|
23312
23920
|
};
|
23313
23921
|
var hasSpaceAfter = function (root, pos) {
|
23314
23922
|
if (isInMiddleOfText(pos)) {
|
23315
23923
|
return isBeforeSpace(pos);
|
23316
23924
|
} else {
|
23317
|
-
return isBeforeSpace(pos) || CaretFinder.nextPosition(getClosestBlock(root, pos).dom(), pos).exists(isBeforeSpace);
|
23925
|
+
return isBeforeSpace(pos) || CaretFinder.nextPosition(getClosestBlock$1(root, pos).dom(), pos).exists(isBeforeSpace);
|
23318
23926
|
}
|
23319
23927
|
};
|
23320
23928
|
var isPreValue = function (value) {
|
23321
23929
|
return contains([
|
23322
23930
|
'pre',
|
23323
|
-
'pre-line',
|
23324
23931
|
'pre-wrap'
|
23325
23932
|
], value);
|
23326
23933
|
};
|
@@ -23351,7 +23958,7 @@
|
|
23351
23958
|
if (isInPre(pos)) {
|
23352
23959
|
return false;
|
23353
23960
|
} else {
|
23354
|
-
return isAtStartOfBlock(root, pos) || isAfterBr(root, pos) || hasSpaceBefore(root, pos);
|
23961
|
+
return isAtStartOfBlock(root, pos) || isBeforeBlock(root, pos) || isAfterBr(root, pos) || hasSpaceBefore(root, pos);
|
23355
23962
|
}
|
23356
23963
|
};
|
23357
23964
|
var leanRight = function (pos) {
|
@@ -23368,7 +23975,7 @@
|
|
23368
23975
|
if (isInPre(afterPos)) {
|
23369
23976
|
return false;
|
23370
23977
|
} else {
|
23371
|
-
return isAtEndOfBlock(root, afterPos) || isBeforeBr(root, afterPos) || hasSpaceAfter(root, afterPos);
|
23978
|
+
return isAtEndOfBlock(root, afterPos) || isAfterBlock(root, afterPos) || isBeforeBr(root, afterPos) || hasSpaceAfter(root, afterPos);
|
23372
23979
|
}
|
23373
23980
|
};
|
23374
23981
|
var needsToBeNbsp = function (root, pos) {
|
@@ -23382,7 +23989,8 @@
|
|
23382
23989
|
return NodeType.isText(container) && contains$2(container.data, nbsp);
|
23383
23990
|
};
|
23384
23991
|
var normalizeNbspMiddle = function (text) {
|
23385
|
-
|
23992
|
+
var chars = text.split('');
|
23993
|
+
return map(chars, function (chr, i) {
|
23386
23994
|
if (isNbsp(chr) && i > 0 && i < chars.length - 1 && isContent$1(chars[i - 1]) && isContent$1(chars[i + 1])) {
|
23387
23995
|
return ' ';
|
23388
23996
|
} else {
|
@@ -24224,7 +24832,7 @@
|
|
24224
24832
|
});
|
24225
24833
|
editor.parser = createParser(editor);
|
24226
24834
|
editor.serializer = DomSerializer$1(settings, editor);
|
24227
|
-
editor.selection = Selection(editor.dom, editor.getWin(), editor.serializer, editor);
|
24835
|
+
editor.selection = Selection$1(editor.dom, editor.getWin(), editor.serializer, editor);
|
24228
24836
|
editor.annotator = Annotator(editor);
|
24229
24837
|
editor.formatter = Formatter(editor);
|
24230
24838
|
editor.undoManager = UndoManager(editor);
|
@@ -25773,15 +26381,15 @@
|
|
25773
26381
|
defaultSettings: {},
|
25774
26382
|
$: DomQuery,
|
25775
26383
|
majorVersion: '4',
|
25776
|
-
minorVersion: '9.
|
25777
|
-
releaseDate: '
|
26384
|
+
minorVersion: '9.11',
|
26385
|
+
releaseDate: '2020-07-13',
|
25778
26386
|
editors: legacyEditors,
|
25779
26387
|
i18n: I18n,
|
25780
26388
|
activeEditor: null,
|
25781
26389
|
settings: {},
|
25782
26390
|
setup: function () {
|
25783
26391
|
var self = this;
|
25784
|
-
var baseURL, documentBaseURL, suffix = ''
|
26392
|
+
var baseURL, documentBaseURL, suffix = '';
|
25785
26393
|
documentBaseURL = URI.getDocumentBaseUrl(domGlobals.document.location);
|
25786
26394
|
if (/^[^:]+:\/\/\/?[^\/]+\//.test(documentBaseURL)) {
|
25787
26395
|
documentBaseURL = documentBaseURL.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
|
@@ -25789,14 +26397,17 @@
|
|
25789
26397
|
documentBaseURL += '/';
|
25790
26398
|
}
|
25791
26399
|
}
|
25792
|
-
preInit = window.tinymce || window.tinyMCEPreInit;
|
26400
|
+
var preInit = window.tinymce || window.tinyMCEPreInit;
|
25793
26401
|
if (preInit) {
|
25794
26402
|
baseURL = preInit.base || preInit.baseURL;
|
25795
26403
|
suffix = preInit.suffix;
|
25796
26404
|
} else {
|
25797
26405
|
var scripts = domGlobals.document.getElementsByTagName('script');
|
25798
26406
|
for (var i = 0; i < scripts.length; i++) {
|
25799
|
-
src = scripts[i].src;
|
26407
|
+
var src = scripts[i].src || '';
|
26408
|
+
if (src === '') {
|
26409
|
+
continue;
|
26410
|
+
}
|
25800
26411
|
var srcScript = src.substring(src.lastIndexOf('/'));
|
25801
26412
|
if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) {
|
25802
26413
|
if (srcScript.indexOf('.min') !== -1) {
|
@@ -25807,7 +26418,7 @@
|
|
25807
26418
|
}
|
25808
26419
|
}
|
25809
26420
|
if (!baseURL && domGlobals.document.currentScript) {
|
25810
|
-
src = domGlobals.document.currentScript.src;
|
26421
|
+
var src = domGlobals.document.currentScript.src;
|
25811
26422
|
if (src.indexOf('.min') !== -1) {
|
25812
26423
|
suffix = '.min';
|
25813
26424
|
}
|
@@ -26171,7 +26782,7 @@
|
|
26171
26782
|
if (rel[4] === 'c') {
|
26172
26783
|
x -= round$2(w / 2);
|
26173
26784
|
}
|
26174
|
-
return create$
|
26785
|
+
return create$4(x, y, w, h);
|
26175
26786
|
};
|
26176
26787
|
var findBestRelativePosition = function (rect, targetRect, constrainRect, rels) {
|
26177
26788
|
var pos, i;
|
@@ -26184,7 +26795,7 @@
|
|
26184
26795
|
return null;
|
26185
26796
|
};
|
26186
26797
|
var inflate = function (rect, w, h) {
|
26187
|
-
return create$
|
26798
|
+
return create$4(rect.x - w, rect.y - h, rect.w + w * 2, rect.h + h * 2);
|
26188
26799
|
};
|
26189
26800
|
var intersect = function (rect, cropRect) {
|
26190
26801
|
var x1, y1, x2, y2;
|
@@ -26195,7 +26806,7 @@
|
|
26195
26806
|
if (x2 - x1 < 0 || y2 - y1 < 0) {
|
26196
26807
|
return null;
|
26197
26808
|
}
|
26198
|
-
return create$
|
26809
|
+
return create$4(x1, y1, x2 - x1, y2 - y1);
|
26199
26810
|
};
|
26200
26811
|
var clamp$1 = function (rect, clampRect, fixedSize) {
|
26201
26812
|
var underflowX1, underflowY1, overflowX2, overflowY2, x1, y1, x2, y2, cx2, cy2;
|
@@ -26219,9 +26830,9 @@
|
|
26219
26830
|
}
|
26220
26831
|
x2 -= overflowX2;
|
26221
26832
|
y2 -= overflowY2;
|
26222
|
-
return create$
|
26833
|
+
return create$4(x1, y1, x2 - x1, y2 - y1);
|
26223
26834
|
};
|
26224
|
-
var create$
|
26835
|
+
var create$4 = function (x, y, w, h) {
|
26225
26836
|
return {
|
26226
26837
|
x: x,
|
26227
26838
|
y: y,
|
@@ -26230,7 +26841,7 @@
|
|
26230
26841
|
};
|
26231
26842
|
};
|
26232
26843
|
var fromClientRect = function (clientRect) {
|
26233
|
-
return create$
|
26844
|
+
return create$4(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
|
26234
26845
|
};
|
26235
26846
|
var Rect = {
|
26236
26847
|
inflate: inflate,
|
@@ -26238,7 +26849,7 @@
|
|
26238
26849
|
findBestRelativePosition: findBestRelativePosition,
|
26239
26850
|
intersect: intersect,
|
26240
26851
|
clamp: clamp$1,
|
26241
|
-
create: create$
|
26852
|
+
create: create$4,
|
26242
26853
|
fromClientRect: fromClientRect
|
26243
26854
|
};
|
26244
26855
|
|
@@ -26676,7 +27287,7 @@
|
|
26676
27287
|
}
|
26677
27288
|
};
|
26678
27289
|
|
26679
|
-
var create$
|
27290
|
+
var create$5 = function () {
|
26680
27291
|
return function () {
|
26681
27292
|
var data = {};
|
26682
27293
|
var keys = [];
|
@@ -26719,7 +27330,7 @@
|
|
26719
27330
|
try {
|
26720
27331
|
localStorage = domGlobals.window.localStorage;
|
26721
27332
|
} catch (e) {
|
26722
|
-
localStorage = create$
|
27333
|
+
localStorage = create$5();
|
26723
27334
|
}
|
26724
27335
|
var LocalStorage = localStorage;
|
26725
27336
|
|
@@ -26754,7 +27365,7 @@
|
|
26754
27365
|
Serializer: DomSerializer$1,
|
26755
27366
|
ControlSelection: ControlSelection,
|
26756
27367
|
BookmarkManager: BookmarkManager$1,
|
26757
|
-
Selection: Selection,
|
27368
|
+
Selection: Selection$1,
|
26758
27369
|
Event: EventUtils.Event
|
26759
27370
|
},
|
26760
27371
|
html: {
|