tinymce-rails 5.9.0 → 5.10.1
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 +752 -1078
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.shadowdom.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +2 -2
- data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -2
- data/vendor/assets/javascripts/tinymce/tinymce.d.ts +16 -9
- data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
- metadata +2 -2
@@ -4,7 +4,7 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.
|
7
|
+
* Version: 5.10.1 (2021-11-03)
|
8
8
|
*/
|
9
9
|
(function () {
|
10
10
|
'use strict';
|
@@ -1681,7 +1681,11 @@
|
|
1681
1681
|
|
1682
1682
|
var get$7 = function (_win) {
|
1683
1683
|
var win = _win === undefined ? window : _win;
|
1684
|
-
|
1684
|
+
if (detect().browser.isFirefox()) {
|
1685
|
+
return Optional.none();
|
1686
|
+
} else {
|
1687
|
+
return Optional.from(win['visualViewport']);
|
1688
|
+
}
|
1685
1689
|
};
|
1686
1690
|
var bounds = function (x, y, width, height) {
|
1687
1691
|
return {
|
@@ -1974,499 +1978,217 @@
|
|
1974
1978
|
|
1975
1979
|
var exports$1 = {}, module$1 = { exports: exports$1 };
|
1976
1980
|
(function (define, exports, module, require) {
|
1977
|
-
(function (
|
1978
|
-
|
1979
|
-
|
1980
|
-
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
1985
|
-
|
1986
|
-
|
1987
|
-
|
1988
|
-
|
1989
|
-
|
1990
|
-
|
1991
|
-
g = this;
|
1992
|
-
}
|
1993
|
-
g.EphoxContactWrapper = f();
|
1994
|
-
}
|
1995
|
-
}(function () {
|
1996
|
-
return function () {
|
1997
|
-
function r(e, n, t) {
|
1998
|
-
function o(i, f) {
|
1999
|
-
if (!n[i]) {
|
2000
|
-
if (!e[i]) {
|
2001
|
-
var c = 'function' == typeof require && require;
|
2002
|
-
if (!f && c)
|
2003
|
-
return c(i, !0);
|
2004
|
-
if (u)
|
2005
|
-
return u(i, !0);
|
2006
|
-
var a = new Error('Cannot find module \'' + i + '\'');
|
2007
|
-
throw a.code = 'MODULE_NOT_FOUND', a;
|
2008
|
-
}
|
2009
|
-
var p = n[i] = { exports: {} };
|
2010
|
-
e[i][0].call(p.exports, function (r) {
|
2011
|
-
var n = e[i][1][r];
|
2012
|
-
return o(n || r);
|
2013
|
-
}, p, p.exports, r, e, n, t);
|
2014
|
-
}
|
2015
|
-
return n[i].exports;
|
1981
|
+
(function (global, factory) {
|
1982
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EphoxContactWrapper = factory());
|
1983
|
+
}(this, function () {
|
1984
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
1985
|
+
var promise = { exports: {} };
|
1986
|
+
(function (module) {
|
1987
|
+
(function (root) {
|
1988
|
+
var setTimeoutFunc = setTimeout;
|
1989
|
+
function noop() {
|
1990
|
+
}
|
1991
|
+
function bind(fn, thisArg) {
|
1992
|
+
return function () {
|
1993
|
+
fn.apply(thisArg, arguments);
|
1994
|
+
};
|
2016
1995
|
}
|
2017
|
-
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
2029
|
-
|
1996
|
+
function Promise(fn) {
|
1997
|
+
if (typeof this !== 'object')
|
1998
|
+
throw new TypeError('Promises must be constructed via new');
|
1999
|
+
if (typeof fn !== 'function')
|
2000
|
+
throw new TypeError('not a function');
|
2001
|
+
this._state = 0;
|
2002
|
+
this._handled = false;
|
2003
|
+
this._value = undefined;
|
2004
|
+
this._deferreds = [];
|
2005
|
+
doResolve(fn, this);
|
2006
|
+
}
|
2007
|
+
function handle(self, deferred) {
|
2008
|
+
while (self._state === 3) {
|
2009
|
+
self = self._value;
|
2030
2010
|
}
|
2031
|
-
|
2032
|
-
|
2011
|
+
if (self._state === 0) {
|
2012
|
+
self._deferreds.push(deferred);
|
2013
|
+
return;
|
2033
2014
|
}
|
2034
|
-
|
2035
|
-
|
2036
|
-
|
2037
|
-
|
2038
|
-
|
2039
|
-
|
2040
|
-
}
|
2041
|
-
} catch (e) {
|
2042
|
-
cachedSetTimeout = defaultSetTimout;
|
2015
|
+
self._handled = true;
|
2016
|
+
Promise._immediateFn(function () {
|
2017
|
+
var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
|
2018
|
+
if (cb === null) {
|
2019
|
+
(self._state === 1 ? resolve : reject)(deferred.promise, self._value);
|
2020
|
+
return;
|
2043
2021
|
}
|
2022
|
+
var ret;
|
2044
2023
|
try {
|
2045
|
-
|
2046
|
-
cachedClearTimeout = clearTimeout;
|
2047
|
-
} else {
|
2048
|
-
cachedClearTimeout = defaultClearTimeout;
|
2049
|
-
}
|
2024
|
+
ret = cb(self._value);
|
2050
2025
|
} catch (e) {
|
2051
|
-
|
2052
|
-
|
2053
|
-
}());
|
2054
|
-
function runTimeout(fun) {
|
2055
|
-
if (cachedSetTimeout === setTimeout) {
|
2056
|
-
return setTimeout(fun, 0);
|
2057
|
-
}
|
2058
|
-
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
2059
|
-
cachedSetTimeout = setTimeout;
|
2060
|
-
return setTimeout(fun, 0);
|
2026
|
+
reject(deferred.promise, e);
|
2027
|
+
return;
|
2061
2028
|
}
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2065
|
-
|
2066
|
-
|
2067
|
-
|
2068
|
-
|
2029
|
+
resolve(deferred.promise, ret);
|
2030
|
+
});
|
2031
|
+
}
|
2032
|
+
function resolve(self, newValue) {
|
2033
|
+
try {
|
2034
|
+
if (newValue === self)
|
2035
|
+
throw new TypeError('A promise cannot be resolved with itself.');
|
2036
|
+
if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
|
2037
|
+
var then = newValue.then;
|
2038
|
+
if (newValue instanceof Promise) {
|
2039
|
+
self._state = 3;
|
2040
|
+
self._value = newValue;
|
2041
|
+
finale(self);
|
2042
|
+
return;
|
2043
|
+
} else if (typeof then === 'function') {
|
2044
|
+
doResolve(bind(then, newValue), self);
|
2045
|
+
return;
|
2069
2046
|
}
|
2070
2047
|
}
|
2048
|
+
self._state = 1;
|
2049
|
+
self._value = newValue;
|
2050
|
+
finale(self);
|
2051
|
+
} catch (e) {
|
2052
|
+
reject(self, e);
|
2071
2053
|
}
|
2072
|
-
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2083
|
-
try {
|
2084
|
-
return cachedClearTimeout.call(null, marker);
|
2085
|
-
} catch (e) {
|
2086
|
-
return cachedClearTimeout.call(this, marker);
|
2054
|
+
}
|
2055
|
+
function reject(self, newValue) {
|
2056
|
+
self._state = 2;
|
2057
|
+
self._value = newValue;
|
2058
|
+
finale(self);
|
2059
|
+
}
|
2060
|
+
function finale(self) {
|
2061
|
+
if (self._state === 2 && self._deferreds.length === 0) {
|
2062
|
+
Promise._immediateFn(function () {
|
2063
|
+
if (!self._handled) {
|
2064
|
+
Promise._unhandledRejectionFn(self._value);
|
2087
2065
|
}
|
2088
|
-
}
|
2066
|
+
});
|
2089
2067
|
}
|
2090
|
-
var
|
2091
|
-
|
2092
|
-
var currentQueue;
|
2093
|
-
var queueIndex = -1;
|
2094
|
-
function cleanUpNextTick() {
|
2095
|
-
if (!draining || !currentQueue) {
|
2096
|
-
return;
|
2097
|
-
}
|
2098
|
-
draining = false;
|
2099
|
-
if (currentQueue.length) {
|
2100
|
-
queue = currentQueue.concat(queue);
|
2101
|
-
} else {
|
2102
|
-
queueIndex = -1;
|
2103
|
-
}
|
2104
|
-
if (queue.length) {
|
2105
|
-
drainQueue();
|
2106
|
-
}
|
2068
|
+
for (var i = 0, len = self._deferreds.length; i < len; i++) {
|
2069
|
+
handle(self, self._deferreds[i]);
|
2107
2070
|
}
|
2108
|
-
|
2109
|
-
|
2071
|
+
self._deferreds = null;
|
2072
|
+
}
|
2073
|
+
function Handler(onFulfilled, onRejected, promise) {
|
2074
|
+
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
|
2075
|
+
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
|
2076
|
+
this.promise = promise;
|
2077
|
+
}
|
2078
|
+
function doResolve(fn, self) {
|
2079
|
+
var done = false;
|
2080
|
+
try {
|
2081
|
+
fn(function (value) {
|
2082
|
+
if (done)
|
2083
|
+
return;
|
2084
|
+
done = true;
|
2085
|
+
resolve(self, value);
|
2086
|
+
}, function (reason) {
|
2087
|
+
if (done)
|
2088
|
+
return;
|
2089
|
+
done = true;
|
2090
|
+
reject(self, reason);
|
2091
|
+
});
|
2092
|
+
} catch (ex) {
|
2093
|
+
if (done)
|
2110
2094
|
return;
|
2111
|
-
|
2112
|
-
|
2113
|
-
draining = true;
|
2114
|
-
var len = queue.length;
|
2115
|
-
while (len) {
|
2116
|
-
currentQueue = queue;
|
2117
|
-
queue = [];
|
2118
|
-
while (++queueIndex < len) {
|
2119
|
-
if (currentQueue) {
|
2120
|
-
currentQueue[queueIndex].run();
|
2121
|
-
}
|
2122
|
-
}
|
2123
|
-
queueIndex = -1;
|
2124
|
-
len = queue.length;
|
2125
|
-
}
|
2126
|
-
currentQueue = null;
|
2127
|
-
draining = false;
|
2128
|
-
runClearTimeout(timeout);
|
2095
|
+
done = true;
|
2096
|
+
reject(self, ex);
|
2129
2097
|
}
|
2130
|
-
|
2131
|
-
|
2132
|
-
|
2133
|
-
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
|
2140
|
-
|
2141
|
-
|
2142
|
-
|
2143
|
-
|
2144
|
-
|
2145
|
-
|
2146
|
-
|
2147
|
-
|
2148
|
-
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2152
|
-
|
2153
|
-
process.version = '';
|
2154
|
-
process.versions = {};
|
2155
|
-
function noop() {
|
2156
|
-
}
|
2157
|
-
process.on = noop;
|
2158
|
-
process.addListener = noop;
|
2159
|
-
process.once = noop;
|
2160
|
-
process.off = noop;
|
2161
|
-
process.removeListener = noop;
|
2162
|
-
process.removeAllListeners = noop;
|
2163
|
-
process.emit = noop;
|
2164
|
-
process.prependListener = noop;
|
2165
|
-
process.prependOnceListener = noop;
|
2166
|
-
process.listeners = function (name) {
|
2167
|
-
return [];
|
2168
|
-
};
|
2169
|
-
process.binding = function (name) {
|
2170
|
-
throw new Error('process.binding is not supported');
|
2171
|
-
};
|
2172
|
-
process.cwd = function () {
|
2173
|
-
return '/';
|
2174
|
-
};
|
2175
|
-
process.chdir = function (dir) {
|
2176
|
-
throw new Error('process.chdir is not supported');
|
2177
|
-
};
|
2178
|
-
process.umask = function () {
|
2179
|
-
return 0;
|
2180
|
-
};
|
2181
|
-
},
|
2182
|
-
{}
|
2183
|
-
],
|
2184
|
-
2: [
|
2185
|
-
function (require, module, exports) {
|
2186
|
-
(function (setImmediate) {
|
2187
|
-
(function (root) {
|
2188
|
-
var setTimeoutFunc = setTimeout;
|
2189
|
-
function noop() {
|
2190
|
-
}
|
2191
|
-
function bind(fn, thisArg) {
|
2192
|
-
return function () {
|
2193
|
-
fn.apply(thisArg, arguments);
|
2194
|
-
};
|
2195
|
-
}
|
2196
|
-
function Promise(fn) {
|
2197
|
-
if (typeof this !== 'object')
|
2198
|
-
throw new TypeError('Promises must be constructed via new');
|
2199
|
-
if (typeof fn !== 'function')
|
2200
|
-
throw new TypeError('not a function');
|
2201
|
-
this._state = 0;
|
2202
|
-
this._handled = false;
|
2203
|
-
this._value = undefined;
|
2204
|
-
this._deferreds = [];
|
2205
|
-
doResolve(fn, this);
|
2206
|
-
}
|
2207
|
-
function handle(self, deferred) {
|
2208
|
-
while (self._state === 3) {
|
2209
|
-
self = self._value;
|
2210
|
-
}
|
2211
|
-
if (self._state === 0) {
|
2212
|
-
self._deferreds.push(deferred);
|
2213
|
-
return;
|
2214
|
-
}
|
2215
|
-
self._handled = true;
|
2216
|
-
Promise._immediateFn(function () {
|
2217
|
-
var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
|
2218
|
-
if (cb === null) {
|
2219
|
-
(self._state === 1 ? resolve : reject)(deferred.promise, self._value);
|
2220
|
-
return;
|
2221
|
-
}
|
2222
|
-
var ret;
|
2223
|
-
try {
|
2224
|
-
ret = cb(self._value);
|
2225
|
-
} catch (e) {
|
2226
|
-
reject(deferred.promise, e);
|
2227
|
-
return;
|
2228
|
-
}
|
2229
|
-
resolve(deferred.promise, ret);
|
2230
|
-
});
|
2231
|
-
}
|
2232
|
-
function resolve(self, newValue) {
|
2233
|
-
try {
|
2234
|
-
if (newValue === self)
|
2235
|
-
throw new TypeError('A promise cannot be resolved with itself.');
|
2236
|
-
if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
|
2237
|
-
var then = newValue.then;
|
2238
|
-
if (newValue instanceof Promise) {
|
2239
|
-
self._state = 3;
|
2240
|
-
self._value = newValue;
|
2241
|
-
finale(self);
|
2242
|
-
return;
|
2243
|
-
} else if (typeof then === 'function') {
|
2244
|
-
doResolve(bind(then, newValue), self);
|
2245
|
-
return;
|
2246
|
-
}
|
2247
|
-
}
|
2248
|
-
self._state = 1;
|
2249
|
-
self._value = newValue;
|
2250
|
-
finale(self);
|
2251
|
-
} catch (e) {
|
2252
|
-
reject(self, e);
|
2253
|
-
}
|
2254
|
-
}
|
2255
|
-
function reject(self, newValue) {
|
2256
|
-
self._state = 2;
|
2257
|
-
self._value = newValue;
|
2258
|
-
finale(self);
|
2259
|
-
}
|
2260
|
-
function finale(self) {
|
2261
|
-
if (self._state === 2 && self._deferreds.length === 0) {
|
2262
|
-
Promise._immediateFn(function () {
|
2263
|
-
if (!self._handled) {
|
2264
|
-
Promise._unhandledRejectionFn(self._value);
|
2265
|
-
}
|
2266
|
-
});
|
2267
|
-
}
|
2268
|
-
for (var i = 0, len = self._deferreds.length; i < len; i++) {
|
2269
|
-
handle(self, self._deferreds[i]);
|
2270
|
-
}
|
2271
|
-
self._deferreds = null;
|
2272
|
-
}
|
2273
|
-
function Handler(onFulfilled, onRejected, promise) {
|
2274
|
-
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
|
2275
|
-
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
|
2276
|
-
this.promise = promise;
|
2277
|
-
}
|
2278
|
-
function doResolve(fn, self) {
|
2279
|
-
var done = false;
|
2280
|
-
try {
|
2281
|
-
fn(function (value) {
|
2282
|
-
if (done)
|
2283
|
-
return;
|
2284
|
-
done = true;
|
2285
|
-
resolve(self, value);
|
2286
|
-
}, function (reason) {
|
2287
|
-
if (done)
|
2288
|
-
return;
|
2289
|
-
done = true;
|
2290
|
-
reject(self, reason);
|
2291
|
-
});
|
2292
|
-
} catch (ex) {
|
2293
|
-
if (done)
|
2098
|
+
}
|
2099
|
+
Promise.prototype['catch'] = function (onRejected) {
|
2100
|
+
return this.then(null, onRejected);
|
2101
|
+
};
|
2102
|
+
Promise.prototype.then = function (onFulfilled, onRejected) {
|
2103
|
+
var prom = new this.constructor(noop);
|
2104
|
+
handle(this, new Handler(onFulfilled, onRejected, prom));
|
2105
|
+
return prom;
|
2106
|
+
};
|
2107
|
+
Promise.all = function (arr) {
|
2108
|
+
var args = Array.prototype.slice.call(arr);
|
2109
|
+
return new Promise(function (resolve, reject) {
|
2110
|
+
if (args.length === 0)
|
2111
|
+
return resolve([]);
|
2112
|
+
var remaining = args.length;
|
2113
|
+
function res(i, val) {
|
2114
|
+
try {
|
2115
|
+
if (val && (typeof val === 'object' || typeof val === 'function')) {
|
2116
|
+
var then = val.then;
|
2117
|
+
if (typeof then === 'function') {
|
2118
|
+
then.call(val, function (val) {
|
2119
|
+
res(i, val);
|
2120
|
+
}, reject);
|
2294
2121
|
return;
|
2295
|
-
done = true;
|
2296
|
-
reject(self, ex);
|
2297
|
-
}
|
2298
|
-
}
|
2299
|
-
Promise.prototype['catch'] = function (onRejected) {
|
2300
|
-
return this.then(null, onRejected);
|
2301
|
-
};
|
2302
|
-
Promise.prototype.then = function (onFulfilled, onRejected) {
|
2303
|
-
var prom = new this.constructor(noop);
|
2304
|
-
handle(this, new Handler(onFulfilled, onRejected, prom));
|
2305
|
-
return prom;
|
2306
|
-
};
|
2307
|
-
Promise.all = function (arr) {
|
2308
|
-
var args = Array.prototype.slice.call(arr);
|
2309
|
-
return new Promise(function (resolve, reject) {
|
2310
|
-
if (args.length === 0)
|
2311
|
-
return resolve([]);
|
2312
|
-
var remaining = args.length;
|
2313
|
-
function res(i, val) {
|
2314
|
-
try {
|
2315
|
-
if (val && (typeof val === 'object' || typeof val === 'function')) {
|
2316
|
-
var then = val.then;
|
2317
|
-
if (typeof then === 'function') {
|
2318
|
-
then.call(val, function (val) {
|
2319
|
-
res(i, val);
|
2320
|
-
}, reject);
|
2321
|
-
return;
|
2322
|
-
}
|
2323
|
-
}
|
2324
|
-
args[i] = val;
|
2325
|
-
if (--remaining === 0) {
|
2326
|
-
resolve(args);
|
2327
|
-
}
|
2328
|
-
} catch (ex) {
|
2329
|
-
reject(ex);
|
2330
|
-
}
|
2331
|
-
}
|
2332
|
-
for (var i = 0; i < args.length; i++) {
|
2333
|
-
res(i, args[i]);
|
2334
2122
|
}
|
2335
|
-
});
|
2336
|
-
};
|
2337
|
-
Promise.resolve = function (value) {
|
2338
|
-
if (value && typeof value === 'object' && value.constructor === Promise) {
|
2339
|
-
return value;
|
2340
2123
|
}
|
2341
|
-
|
2342
|
-
|
2343
|
-
|
2344
|
-
};
|
2345
|
-
Promise.reject = function (value) {
|
2346
|
-
return new Promise(function (resolve, reject) {
|
2347
|
-
reject(value);
|
2348
|
-
});
|
2349
|
-
};
|
2350
|
-
Promise.race = function (values) {
|
2351
|
-
return new Promise(function (resolve, reject) {
|
2352
|
-
for (var i = 0, len = values.length; i < len; i++) {
|
2353
|
-
values[i].then(resolve, reject);
|
2354
|
-
}
|
2355
|
-
});
|
2356
|
-
};
|
2357
|
-
Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) {
|
2358
|
-
setImmediate(fn);
|
2359
|
-
} : function (fn) {
|
2360
|
-
setTimeoutFunc(fn, 0);
|
2361
|
-
};
|
2362
|
-
Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
|
2363
|
-
if (typeof console !== 'undefined' && console) {
|
2364
|
-
console.warn('Possible Unhandled Promise Rejection:', err);
|
2124
|
+
args[i] = val;
|
2125
|
+
if (--remaining === 0) {
|
2126
|
+
resolve(args);
|
2365
2127
|
}
|
2366
|
-
}
|
2367
|
-
|
2368
|
-
Promise._immediateFn = fn;
|
2369
|
-
};
|
2370
|
-
Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
|
2371
|
-
Promise._unhandledRejectionFn = fn;
|
2372
|
-
};
|
2373
|
-
if (typeof module !== 'undefined' && module.exports) {
|
2374
|
-
module.exports = Promise;
|
2375
|
-
} else if (!root.Promise) {
|
2376
|
-
root.Promise = Promise;
|
2128
|
+
} catch (ex) {
|
2129
|
+
reject(ex);
|
2377
2130
|
}
|
2378
|
-
}(this));
|
2379
|
-
}.call(this, require('timers').setImmediate));
|
2380
|
-
},
|
2381
|
-
{ 'timers': 3 }
|
2382
|
-
],
|
2383
|
-
3: [
|
2384
|
-
function (require, module, exports) {
|
2385
|
-
(function (setImmediate, clearImmediate) {
|
2386
|
-
var nextTick = require('process/browser.js').nextTick;
|
2387
|
-
var apply = Function.prototype.apply;
|
2388
|
-
var slice = Array.prototype.slice;
|
2389
|
-
var immediateIds = {};
|
2390
|
-
var nextImmediateId = 0;
|
2391
|
-
exports.setTimeout = function () {
|
2392
|
-
return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
|
2393
|
-
};
|
2394
|
-
exports.setInterval = function () {
|
2395
|
-
return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
|
2396
|
-
};
|
2397
|
-
exports.clearTimeout = exports.clearInterval = function (timeout) {
|
2398
|
-
timeout.close();
|
2399
|
-
};
|
2400
|
-
function Timeout(id, clearFn) {
|
2401
|
-
this._id = id;
|
2402
|
-
this._clearFn = clearFn;
|
2403
2131
|
}
|
2404
|
-
|
2405
|
-
|
2406
|
-
Timeout.prototype.close = function () {
|
2407
|
-
this._clearFn.call(window, this._id);
|
2408
|
-
};
|
2409
|
-
exports.enroll = function (item, msecs) {
|
2410
|
-
clearTimeout(item._idleTimeoutId);
|
2411
|
-
item._idleTimeout = msecs;
|
2412
|
-
};
|
2413
|
-
exports.unenroll = function (item) {
|
2414
|
-
clearTimeout(item._idleTimeoutId);
|
2415
|
-
item._idleTimeout = -1;
|
2416
|
-
};
|
2417
|
-
exports._unrefActive = exports.active = function (item) {
|
2418
|
-
clearTimeout(item._idleTimeoutId);
|
2419
|
-
var msecs = item._idleTimeout;
|
2420
|
-
if (msecs >= 0) {
|
2421
|
-
item._idleTimeoutId = setTimeout(function onTimeout() {
|
2422
|
-
if (item._onTimeout)
|
2423
|
-
item._onTimeout();
|
2424
|
-
}, msecs);
|
2425
|
-
}
|
2426
|
-
};
|
2427
|
-
exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) {
|
2428
|
-
var id = nextImmediateId++;
|
2429
|
-
var args = arguments.length < 2 ? false : slice.call(arguments, 1);
|
2430
|
-
immediateIds[id] = true;
|
2431
|
-
nextTick(function onNextTick() {
|
2432
|
-
if (immediateIds[id]) {
|
2433
|
-
if (args) {
|
2434
|
-
fn.apply(null, args);
|
2435
|
-
} else {
|
2436
|
-
fn.call(null);
|
2437
|
-
}
|
2438
|
-
exports.clearImmediate(id);
|
2439
|
-
}
|
2440
|
-
});
|
2441
|
-
return id;
|
2442
|
-
};
|
2443
|
-
exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) {
|
2444
|
-
delete immediateIds[id];
|
2445
|
-
};
|
2446
|
-
}.call(this, require('timers').setImmediate, require('timers').clearImmediate));
|
2447
|
-
},
|
2448
|
-
{
|
2449
|
-
'process/browser.js': 1,
|
2450
|
-
'timers': 3
|
2451
|
-
}
|
2452
|
-
],
|
2453
|
-
4: [
|
2454
|
-
function (require, module, exports) {
|
2455
|
-
var promisePolyfill = require('promise-polyfill');
|
2456
|
-
var Global = function () {
|
2457
|
-
if (typeof window !== 'undefined') {
|
2458
|
-
return window;
|
2459
|
-
} else {
|
2460
|
-
return Function('return this;')();
|
2132
|
+
for (var i = 0; i < args.length; i++) {
|
2133
|
+
res(i, args[i]);
|
2461
2134
|
}
|
2462
|
-
}
|
2463
|
-
|
2464
|
-
|
2465
|
-
|
2466
|
-
|
2467
|
-
|
2135
|
+
});
|
2136
|
+
};
|
2137
|
+
Promise.resolve = function (value) {
|
2138
|
+
if (value && typeof value === 'object' && value.constructor === Promise) {
|
2139
|
+
return value;
|
2140
|
+
}
|
2141
|
+
return new Promise(function (resolve) {
|
2142
|
+
resolve(value);
|
2143
|
+
});
|
2144
|
+
};
|
2145
|
+
Promise.reject = function (value) {
|
2146
|
+
return new Promise(function (resolve, reject) {
|
2147
|
+
reject(value);
|
2148
|
+
});
|
2149
|
+
};
|
2150
|
+
Promise.race = function (values) {
|
2151
|
+
return new Promise(function (resolve, reject) {
|
2152
|
+
for (var i = 0, len = values.length; i < len; i++) {
|
2153
|
+
values[i].then(resolve, reject);
|
2154
|
+
}
|
2155
|
+
});
|
2156
|
+
};
|
2157
|
+
Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) {
|
2158
|
+
setImmediate(fn);
|
2159
|
+
} : function (fn) {
|
2160
|
+
setTimeoutFunc(fn, 0);
|
2161
|
+
};
|
2162
|
+
Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
|
2163
|
+
if (typeof console !== 'undefined' && console) {
|
2164
|
+
console.warn('Possible Unhandled Promise Rejection:', err);
|
2165
|
+
}
|
2166
|
+
};
|
2167
|
+
Promise._setImmediateFn = function _setImmediateFn(fn) {
|
2168
|
+
Promise._immediateFn = fn;
|
2169
|
+
};
|
2170
|
+
Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
|
2171
|
+
Promise._unhandledRejectionFn = fn;
|
2172
|
+
};
|
2173
|
+
if (module.exports) {
|
2174
|
+
module.exports = Promise;
|
2175
|
+
} else if (!root.Promise) {
|
2176
|
+
root.Promise = Promise;
|
2177
|
+
}
|
2178
|
+
}(commonjsGlobal));
|
2179
|
+
}(promise));
|
2180
|
+
var promisePolyfill = promise.exports;
|
2181
|
+
var Global = function () {
|
2182
|
+
if (typeof window !== 'undefined') {
|
2183
|
+
return window;
|
2184
|
+
} else {
|
2185
|
+
return Function('return this;')();
|
2186
|
+
}
|
2187
|
+
}();
|
2188
|
+
var promisePolyfill_1 = { boltExport: Global.Promise || promisePolyfill };
|
2189
|
+
return promisePolyfill_1;
|
2468
2190
|
}));
|
2469
|
-
}(undefined, exports$1, module$1
|
2191
|
+
}(undefined, exports$1, module$1));
|
2470
2192
|
var Promise$1 = module$1.exports.boltExport;
|
2471
2193
|
|
2472
2194
|
var nu$1 = function (baseFn) {
|
@@ -2882,183 +2604,7 @@
|
|
2882
2604
|
return ClosestOrAncestor(is, ancestor$2, scope, selector, isRoot);
|
2883
2605
|
};
|
2884
2606
|
|
2885
|
-
var
|
2886
|
-
var bind = function (fn, thisArg) {
|
2887
|
-
return function () {
|
2888
|
-
var args = [];
|
2889
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
2890
|
-
args[_i] = arguments[_i];
|
2891
|
-
}
|
2892
|
-
fn.apply(thisArg, args);
|
2893
|
-
};
|
2894
|
-
};
|
2895
|
-
var isArray = Array.isArray || function (value) {
|
2896
|
-
return Object.prototype.toString.call(value) === '[object Array]';
|
2897
|
-
};
|
2898
|
-
var Promise = function (fn) {
|
2899
|
-
if (typeof this !== 'object') {
|
2900
|
-
throw new TypeError('Promises must be constructed via new');
|
2901
|
-
}
|
2902
|
-
if (typeof fn !== 'function') {
|
2903
|
-
throw new TypeError('not a function');
|
2904
|
-
}
|
2905
|
-
this._state = null;
|
2906
|
-
this._value = null;
|
2907
|
-
this._deferreds = [];
|
2908
|
-
doResolve(fn, bind(resolve, this), bind(reject, this));
|
2909
|
-
};
|
2910
|
-
var asap = Promise.immediateFn || typeof setImmediate === 'function' && setImmediate || function (fn) {
|
2911
|
-
return setTimeout(fn, 1);
|
2912
|
-
};
|
2913
|
-
function handle(deferred) {
|
2914
|
-
var me = this;
|
2915
|
-
if (this._state === null) {
|
2916
|
-
this._deferreds.push(deferred);
|
2917
|
-
return;
|
2918
|
-
}
|
2919
|
-
asap(function () {
|
2920
|
-
var cb = me._state ? deferred.onFulfilled : deferred.onRejected;
|
2921
|
-
if (cb === null) {
|
2922
|
-
(me._state ? deferred.resolve : deferred.reject)(me._value);
|
2923
|
-
return;
|
2924
|
-
}
|
2925
|
-
var ret;
|
2926
|
-
try {
|
2927
|
-
ret = cb(me._value);
|
2928
|
-
} catch (e) {
|
2929
|
-
deferred.reject(e);
|
2930
|
-
return;
|
2931
|
-
}
|
2932
|
-
deferred.resolve(ret);
|
2933
|
-
});
|
2934
|
-
}
|
2935
|
-
function resolve(newValue) {
|
2936
|
-
try {
|
2937
|
-
if (newValue === this) {
|
2938
|
-
throw new TypeError('A promise cannot be resolved with itself.');
|
2939
|
-
}
|
2940
|
-
if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
|
2941
|
-
var then = newValue.then;
|
2942
|
-
if (typeof then === 'function') {
|
2943
|
-
doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this));
|
2944
|
-
return;
|
2945
|
-
}
|
2946
|
-
}
|
2947
|
-
this._state = true;
|
2948
|
-
this._value = newValue;
|
2949
|
-
finale.call(this);
|
2950
|
-
} catch (e) {
|
2951
|
-
reject.call(this, e);
|
2952
|
-
}
|
2953
|
-
}
|
2954
|
-
function reject(newValue) {
|
2955
|
-
this._state = false;
|
2956
|
-
this._value = newValue;
|
2957
|
-
finale.call(this);
|
2958
|
-
}
|
2959
|
-
function finale() {
|
2960
|
-
for (var i = 0, len = this._deferreds.length; i < len; i++) {
|
2961
|
-
handle.call(this, this._deferreds[i]);
|
2962
|
-
}
|
2963
|
-
this._deferreds = null;
|
2964
|
-
}
|
2965
|
-
function Handler(onFulfilled, onRejected, resolve, reject) {
|
2966
|
-
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
|
2967
|
-
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
|
2968
|
-
this.resolve = resolve;
|
2969
|
-
this.reject = reject;
|
2970
|
-
}
|
2971
|
-
var doResolve = function (fn, onFulfilled, onRejected) {
|
2972
|
-
var done = false;
|
2973
|
-
try {
|
2974
|
-
fn(function (value) {
|
2975
|
-
if (done) {
|
2976
|
-
return;
|
2977
|
-
}
|
2978
|
-
done = true;
|
2979
|
-
onFulfilled(value);
|
2980
|
-
}, function (reason) {
|
2981
|
-
if (done) {
|
2982
|
-
return;
|
2983
|
-
}
|
2984
|
-
done = true;
|
2985
|
-
onRejected(reason);
|
2986
|
-
});
|
2987
|
-
} catch (ex) {
|
2988
|
-
if (done) {
|
2989
|
-
return;
|
2990
|
-
}
|
2991
|
-
done = true;
|
2992
|
-
onRejected(ex);
|
2993
|
-
}
|
2994
|
-
};
|
2995
|
-
Promise.prototype.catch = function (onRejected) {
|
2996
|
-
return this.then(null, onRejected);
|
2997
|
-
};
|
2998
|
-
Promise.prototype.then = function (onFulfilled, onRejected) {
|
2999
|
-
var me = this;
|
3000
|
-
return new Promise(function (resolve, reject) {
|
3001
|
-
handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject));
|
3002
|
-
});
|
3003
|
-
};
|
3004
|
-
Promise.all = function () {
|
3005
|
-
var values = [];
|
3006
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
3007
|
-
values[_i] = arguments[_i];
|
3008
|
-
}
|
3009
|
-
var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values);
|
3010
|
-
return new Promise(function (resolve, reject) {
|
3011
|
-
if (args.length === 0) {
|
3012
|
-
return resolve([]);
|
3013
|
-
}
|
3014
|
-
var remaining = args.length;
|
3015
|
-
var res = function (i, val) {
|
3016
|
-
try {
|
3017
|
-
if (val && (typeof val === 'object' || typeof val === 'function')) {
|
3018
|
-
var then = val.then;
|
3019
|
-
if (typeof then === 'function') {
|
3020
|
-
then.call(val, function (val) {
|
3021
|
-
res(i, val);
|
3022
|
-
}, reject);
|
3023
|
-
return;
|
3024
|
-
}
|
3025
|
-
}
|
3026
|
-
args[i] = val;
|
3027
|
-
if (--remaining === 0) {
|
3028
|
-
resolve(args);
|
3029
|
-
}
|
3030
|
-
} catch (ex) {
|
3031
|
-
reject(ex);
|
3032
|
-
}
|
3033
|
-
};
|
3034
|
-
for (var i = 0; i < args.length; i++) {
|
3035
|
-
res(i, args[i]);
|
3036
|
-
}
|
3037
|
-
});
|
3038
|
-
};
|
3039
|
-
Promise.resolve = function (value) {
|
3040
|
-
if (value && typeof value === 'object' && value.constructor === Promise) {
|
3041
|
-
return value;
|
3042
|
-
}
|
3043
|
-
return new Promise(function (resolve) {
|
3044
|
-
resolve(value);
|
3045
|
-
});
|
3046
|
-
};
|
3047
|
-
Promise.reject = function (value) {
|
3048
|
-
return new Promise(function (resolve, reject) {
|
3049
|
-
reject(value);
|
3050
|
-
});
|
3051
|
-
};
|
3052
|
-
Promise.race = function (values) {
|
3053
|
-
return new Promise(function (resolve, reject) {
|
3054
|
-
for (var i = 0, len = values.length; i < len; i++) {
|
3055
|
-
values[i].then(resolve, reject);
|
3056
|
-
}
|
3057
|
-
});
|
3058
|
-
};
|
3059
|
-
return Promise;
|
3060
|
-
};
|
3061
|
-
var promiseObj = window.Promise ? window.Promise : promise();
|
2607
|
+
var promiseObj = window.Promise ? window.Promise : Promise$1;
|
3062
2608
|
|
3063
2609
|
var requestAnimationFramePromise;
|
3064
2610
|
var requestAnimationFrame = function (callback, element) {
|
@@ -7010,7 +6556,7 @@
|
|
7010
6556
|
var keepValues = settings.keep_values;
|
7011
6557
|
var keepUrlHook = {
|
7012
6558
|
set: function ($elm, value, name) {
|
7013
|
-
if (settings.url_converter) {
|
6559
|
+
if (settings.url_converter && value !== null) {
|
7014
6560
|
value = settings.url_converter.call(settings.url_converter_scope || getContext(), value, name, $elm[0]);
|
7015
6561
|
}
|
7016
6562
|
$elm.attr('data-mce-' + name, value).attr(name, value);
|
@@ -9669,7 +9215,7 @@
|
|
9669
9215
|
var getVisualAidsAnchorClass = function (editor) {
|
9670
9216
|
return editor.getParam('visual_anchor_class', 'mce-item-anchor', 'string');
|
9671
9217
|
};
|
9672
|
-
var
|
9218
|
+
var getIframeAriaText = function (editor) {
|
9673
9219
|
return editor.getParam('iframe_aria_text', 'Rich Text Area. Press ALT-0 for help.', 'string');
|
9674
9220
|
};
|
9675
9221
|
|
@@ -10851,8 +10397,8 @@
|
|
10851
10397
|
var dom = editor.dom;
|
10852
10398
|
var root = dom.getRoot();
|
10853
10399
|
var format = formatList[0];
|
10854
|
-
if (isBlockFormat(format)
|
10855
|
-
node = dom.getParent(container, format.block, root);
|
10400
|
+
if (isBlockFormat(format)) {
|
10401
|
+
node = format.wrapper ? null : dom.getParent(container, format.block, root);
|
10856
10402
|
}
|
10857
10403
|
if (!node) {
|
10858
10404
|
var scopeRoot = dom.getParent(container, 'LI,TD,TH');
|
@@ -11478,6 +11024,7 @@
|
|
11478
11024
|
DELETE: 46,
|
11479
11025
|
DOWN: 40,
|
11480
11026
|
ENTER: 13,
|
11027
|
+
ESC: 27,
|
11481
11028
|
LEFT: 37,
|
11482
11029
|
RIGHT: 39,
|
11483
11030
|
SPACEBAR: 32,
|
@@ -11712,7 +11259,10 @@
|
|
11712
11259
|
};
|
11713
11260
|
startScrollWidth = rootElement.scrollWidth;
|
11714
11261
|
startScrollHeight = rootElement.scrollHeight;
|
11715
|
-
resizeBackdrop = dom.add(rootElement, 'div', {
|
11262
|
+
resizeBackdrop = dom.add(rootElement, 'div', {
|
11263
|
+
'class': 'mce-resize-backdrop',
|
11264
|
+
'data-mce-bogus': 'all'
|
11265
|
+
});
|
11716
11266
|
dom.setStyles(resizeBackdrop, {
|
11717
11267
|
position: 'fixed',
|
11718
11268
|
left: '0',
|
@@ -12378,7 +11928,7 @@
|
|
12378
11928
|
};
|
12379
11929
|
var createMarker = function (element, offset) {
|
12380
11930
|
var startPoint = descend(element, offset);
|
12381
|
-
var span = SugarElement.fromHtml('<span data-mce-bogus="all">' + ZWSP$1 + '</span>');
|
11931
|
+
var span = SugarElement.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">' + ZWSP$1 + '</span>');
|
12382
11932
|
before$4(startPoint.element, span);
|
12383
11933
|
return markerInfo(span, function () {
|
12384
11934
|
return remove$7(span);
|
@@ -13378,17 +12928,24 @@
|
|
13378
12928
|
}
|
13379
12929
|
};
|
13380
12930
|
|
12931
|
+
var each$d = Tools.each, trim = Tools.trim;
|
12932
|
+
var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' ');
|
12933
|
+
var DEFAULT_PORTS = {
|
12934
|
+
ftp: 21,
|
12935
|
+
http: 80,
|
12936
|
+
https: 443,
|
12937
|
+
mailto: 25
|
12938
|
+
};
|
13381
12939
|
var safeSvgDataUrlElements = [
|
13382
12940
|
'img',
|
13383
12941
|
'video'
|
13384
12942
|
];
|
13385
|
-
var filteredClobberElements = Tools.makeMap('button,fieldset,form,iframe,img,image,input,object,output,select,textarea');
|
13386
|
-
var isValidPrefixAttrName = function (name) {
|
13387
|
-
return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0;
|
13388
|
-
};
|
13389
12943
|
var blockSvgDataUris = function (allowSvgDataUrls, tagName) {
|
13390
|
-
|
13391
|
-
|
12944
|
+
if (isNonNullable(allowSvgDataUrls)) {
|
12945
|
+
return !allowSvgDataUrls;
|
12946
|
+
} else {
|
12947
|
+
return isNonNullable(tagName) ? !contains$3(safeSvgDataUrlElements, tagName) : true;
|
12948
|
+
}
|
13392
12949
|
};
|
13393
12950
|
var isInvalidUri = function (settings, uri, tagName) {
|
13394
12951
|
if (settings.allow_html_data_urls) {
|
@@ -13399,29 +12956,289 @@
|
|
13399
12956
|
return /^data:/i.test(uri);
|
13400
12957
|
}
|
13401
12958
|
};
|
13402
|
-
var
|
13403
|
-
|
13404
|
-
|
13405
|
-
|
13406
|
-
|
13407
|
-
|
13408
|
-
|
13409
|
-
|
13410
|
-
|
13411
|
-
|
13412
|
-
|
13413
|
-
|
13414
|
-
|
13415
|
-
|
13416
|
-
|
13417
|
-
|
13418
|
-
|
13419
|
-
|
13420
|
-
} else {
|
13421
|
-
|
13422
|
-
|
13423
|
-
|
13424
|
-
|
12959
|
+
var URI = function () {
|
12960
|
+
function URI(url, settings) {
|
12961
|
+
url = trim(url);
|
12962
|
+
this.settings = settings || {};
|
12963
|
+
var baseUri = this.settings.base_uri;
|
12964
|
+
var self = this;
|
12965
|
+
if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
|
12966
|
+
self.source = url;
|
12967
|
+
return;
|
12968
|
+
}
|
12969
|
+
var isProtocolRelative = url.indexOf('//') === 0;
|
12970
|
+
if (url.indexOf('/') === 0 && !isProtocolRelative) {
|
12971
|
+
url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
|
12972
|
+
}
|
12973
|
+
if (!/^[\w\-]*:?\/\//.test(url)) {
|
12974
|
+
var baseUrl = this.settings.base_uri ? this.settings.base_uri.path : new URI(document.location.href).directory;
|
12975
|
+
if (this.settings.base_uri && this.settings.base_uri.protocol == '') {
|
12976
|
+
url = '//mce_host' + self.toAbsPath(baseUrl, url);
|
12977
|
+
} else {
|
12978
|
+
var match = /([^#?]*)([#?]?.*)/.exec(url);
|
12979
|
+
url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self.toAbsPath(baseUrl, match[1]) + match[2];
|
12980
|
+
}
|
12981
|
+
}
|
12982
|
+
url = url.replace(/@@/g, '(mce_at)');
|
12983
|
+
var urlMatch = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
|
12984
|
+
each$d(queryParts, function (v, i) {
|
12985
|
+
var part = urlMatch[i];
|
12986
|
+
if (part) {
|
12987
|
+
part = part.replace(/\(mce_at\)/g, '@@');
|
12988
|
+
}
|
12989
|
+
self[v] = part;
|
12990
|
+
});
|
12991
|
+
if (baseUri) {
|
12992
|
+
if (!self.protocol) {
|
12993
|
+
self.protocol = baseUri.protocol;
|
12994
|
+
}
|
12995
|
+
if (!self.userInfo) {
|
12996
|
+
self.userInfo = baseUri.userInfo;
|
12997
|
+
}
|
12998
|
+
if (!self.port && self.host === 'mce_host') {
|
12999
|
+
self.port = baseUri.port;
|
13000
|
+
}
|
13001
|
+
if (!self.host || self.host === 'mce_host') {
|
13002
|
+
self.host = baseUri.host;
|
13003
|
+
}
|
13004
|
+
self.source = '';
|
13005
|
+
}
|
13006
|
+
if (isProtocolRelative) {
|
13007
|
+
self.protocol = '';
|
13008
|
+
}
|
13009
|
+
}
|
13010
|
+
URI.parseDataUri = function (uri) {
|
13011
|
+
var type;
|
13012
|
+
var uriComponents = decodeURIComponent(uri).split(',');
|
13013
|
+
var matches = /data:([^;]+)/.exec(uriComponents[0]);
|
13014
|
+
if (matches) {
|
13015
|
+
type = matches[1];
|
13016
|
+
}
|
13017
|
+
return {
|
13018
|
+
type: type,
|
13019
|
+
data: uriComponents[1]
|
13020
|
+
};
|
13021
|
+
};
|
13022
|
+
URI.isDomSafe = function (uri, context, options) {
|
13023
|
+
if (options === void 0) {
|
13024
|
+
options = {};
|
13025
|
+
}
|
13026
|
+
if (options.allow_script_urls) {
|
13027
|
+
return true;
|
13028
|
+
} else {
|
13029
|
+
var decodedUri = Entities.decode(uri).replace(/[\s\u0000-\u001F]+/g, '');
|
13030
|
+
try {
|
13031
|
+
decodedUri = decodeURIComponent(decodedUri);
|
13032
|
+
} catch (ex) {
|
13033
|
+
decodedUri = unescape(decodedUri);
|
13034
|
+
}
|
13035
|
+
if (/((java|vb)script|mhtml):/i.test(decodedUri)) {
|
13036
|
+
return false;
|
13037
|
+
}
|
13038
|
+
return !isInvalidUri(options, decodedUri, context);
|
13039
|
+
}
|
13040
|
+
};
|
13041
|
+
URI.getDocumentBaseUrl = function (loc) {
|
13042
|
+
var baseUrl;
|
13043
|
+
if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') {
|
13044
|
+
baseUrl = loc.href;
|
13045
|
+
} else {
|
13046
|
+
baseUrl = loc.protocol + '//' + loc.host + loc.pathname;
|
13047
|
+
}
|
13048
|
+
if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) {
|
13049
|
+
baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
|
13050
|
+
if (!/[\/\\]$/.test(baseUrl)) {
|
13051
|
+
baseUrl += '/';
|
13052
|
+
}
|
13053
|
+
}
|
13054
|
+
return baseUrl;
|
13055
|
+
};
|
13056
|
+
URI.prototype.setPath = function (path) {
|
13057
|
+
var pathMatch = /^(.*?)\/?(\w+)?$/.exec(path);
|
13058
|
+
this.path = pathMatch[0];
|
13059
|
+
this.directory = pathMatch[1];
|
13060
|
+
this.file = pathMatch[2];
|
13061
|
+
this.source = '';
|
13062
|
+
this.getURI();
|
13063
|
+
};
|
13064
|
+
URI.prototype.toRelative = function (uri) {
|
13065
|
+
var output;
|
13066
|
+
if (uri === './') {
|
13067
|
+
return uri;
|
13068
|
+
}
|
13069
|
+
var relativeUri = new URI(uri, { base_uri: this });
|
13070
|
+
if (relativeUri.host !== 'mce_host' && this.host !== relativeUri.host && relativeUri.host || this.port !== relativeUri.port || this.protocol !== relativeUri.protocol && relativeUri.protocol !== '') {
|
13071
|
+
return relativeUri.getURI();
|
13072
|
+
}
|
13073
|
+
var tu = this.getURI(), uu = relativeUri.getURI();
|
13074
|
+
if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) {
|
13075
|
+
return tu;
|
13076
|
+
}
|
13077
|
+
output = this.toRelPath(this.path, relativeUri.path);
|
13078
|
+
if (relativeUri.query) {
|
13079
|
+
output += '?' + relativeUri.query;
|
13080
|
+
}
|
13081
|
+
if (relativeUri.anchor) {
|
13082
|
+
output += '#' + relativeUri.anchor;
|
13083
|
+
}
|
13084
|
+
return output;
|
13085
|
+
};
|
13086
|
+
URI.prototype.toAbsolute = function (uri, noHost) {
|
13087
|
+
var absoluteUri = new URI(uri, { base_uri: this });
|
13088
|
+
return absoluteUri.getURI(noHost && this.isSameOrigin(absoluteUri));
|
13089
|
+
};
|
13090
|
+
URI.prototype.isSameOrigin = function (uri) {
|
13091
|
+
if (this.host == uri.host && this.protocol == uri.protocol) {
|
13092
|
+
if (this.port == uri.port) {
|
13093
|
+
return true;
|
13094
|
+
}
|
13095
|
+
var defaultPort = DEFAULT_PORTS[this.protocol];
|
13096
|
+
if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) {
|
13097
|
+
return true;
|
13098
|
+
}
|
13099
|
+
}
|
13100
|
+
return false;
|
13101
|
+
};
|
13102
|
+
URI.prototype.toRelPath = function (base, path) {
|
13103
|
+
var breakPoint = 0, out = '', i, l;
|
13104
|
+
var normalizedBase = base.substring(0, base.lastIndexOf('/')).split('/');
|
13105
|
+
var items = path.split('/');
|
13106
|
+
if (normalizedBase.length >= items.length) {
|
13107
|
+
for (i = 0, l = normalizedBase.length; i < l; i++) {
|
13108
|
+
if (i >= items.length || normalizedBase[i] !== items[i]) {
|
13109
|
+
breakPoint = i + 1;
|
13110
|
+
break;
|
13111
|
+
}
|
13112
|
+
}
|
13113
|
+
}
|
13114
|
+
if (normalizedBase.length < items.length) {
|
13115
|
+
for (i = 0, l = items.length; i < l; i++) {
|
13116
|
+
if (i >= normalizedBase.length || normalizedBase[i] !== items[i]) {
|
13117
|
+
breakPoint = i + 1;
|
13118
|
+
break;
|
13119
|
+
}
|
13120
|
+
}
|
13121
|
+
}
|
13122
|
+
if (breakPoint === 1) {
|
13123
|
+
return path;
|
13124
|
+
}
|
13125
|
+
for (i = 0, l = normalizedBase.length - (breakPoint - 1); i < l; i++) {
|
13126
|
+
out += '../';
|
13127
|
+
}
|
13128
|
+
for (i = breakPoint - 1, l = items.length; i < l; i++) {
|
13129
|
+
if (i !== breakPoint - 1) {
|
13130
|
+
out += '/' + items[i];
|
13131
|
+
} else {
|
13132
|
+
out += items[i];
|
13133
|
+
}
|
13134
|
+
}
|
13135
|
+
return out;
|
13136
|
+
};
|
13137
|
+
URI.prototype.toAbsPath = function (base, path) {
|
13138
|
+
var i, nb = 0, o = [], outPath;
|
13139
|
+
var tr = /\/$/.test(path) ? '/' : '';
|
13140
|
+
var normalizedBase = base.split('/');
|
13141
|
+
var normalizedPath = path.split('/');
|
13142
|
+
each$d(normalizedBase, function (k) {
|
13143
|
+
if (k) {
|
13144
|
+
o.push(k);
|
13145
|
+
}
|
13146
|
+
});
|
13147
|
+
normalizedBase = o;
|
13148
|
+
for (i = normalizedPath.length - 1, o = []; i >= 0; i--) {
|
13149
|
+
if (normalizedPath[i].length === 0 || normalizedPath[i] === '.') {
|
13150
|
+
continue;
|
13151
|
+
}
|
13152
|
+
if (normalizedPath[i] === '..') {
|
13153
|
+
nb++;
|
13154
|
+
continue;
|
13155
|
+
}
|
13156
|
+
if (nb > 0) {
|
13157
|
+
nb--;
|
13158
|
+
continue;
|
13159
|
+
}
|
13160
|
+
o.push(normalizedPath[i]);
|
13161
|
+
}
|
13162
|
+
i = normalizedBase.length - nb;
|
13163
|
+
if (i <= 0) {
|
13164
|
+
outPath = reverse(o).join('/');
|
13165
|
+
} else {
|
13166
|
+
outPath = normalizedBase.slice(0, i).join('/') + '/' + reverse(o).join('/');
|
13167
|
+
}
|
13168
|
+
if (outPath.indexOf('/') !== 0) {
|
13169
|
+
outPath = '/' + outPath;
|
13170
|
+
}
|
13171
|
+
if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
|
13172
|
+
outPath += tr;
|
13173
|
+
}
|
13174
|
+
return outPath;
|
13175
|
+
};
|
13176
|
+
URI.prototype.getURI = function (noProtoHost) {
|
13177
|
+
if (noProtoHost === void 0) {
|
13178
|
+
noProtoHost = false;
|
13179
|
+
}
|
13180
|
+
var s;
|
13181
|
+
if (!this.source || noProtoHost) {
|
13182
|
+
s = '';
|
13183
|
+
if (!noProtoHost) {
|
13184
|
+
if (this.protocol) {
|
13185
|
+
s += this.protocol + '://';
|
13186
|
+
} else {
|
13187
|
+
s += '//';
|
13188
|
+
}
|
13189
|
+
if (this.userInfo) {
|
13190
|
+
s += this.userInfo + '@';
|
13191
|
+
}
|
13192
|
+
if (this.host) {
|
13193
|
+
s += this.host;
|
13194
|
+
}
|
13195
|
+
if (this.port) {
|
13196
|
+
s += ':' + this.port;
|
13197
|
+
}
|
13198
|
+
}
|
13199
|
+
if (this.path) {
|
13200
|
+
s += this.path;
|
13201
|
+
}
|
13202
|
+
if (this.query) {
|
13203
|
+
s += '?' + this.query;
|
13204
|
+
}
|
13205
|
+
if (this.anchor) {
|
13206
|
+
s += '#' + this.anchor;
|
13207
|
+
}
|
13208
|
+
this.source = s;
|
13209
|
+
}
|
13210
|
+
return this.source;
|
13211
|
+
};
|
13212
|
+
return URI;
|
13213
|
+
}();
|
13214
|
+
|
13215
|
+
var filteredClobberElements = Tools.makeMap('button,fieldset,form,iframe,img,image,input,object,output,select,textarea');
|
13216
|
+
var isValidPrefixAttrName = function (name) {
|
13217
|
+
return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0;
|
13218
|
+
};
|
13219
|
+
var findMatchingEndTagIndex = function (schema, html, startIndex) {
|
13220
|
+
var startTagRegExp = /<([!?\/])?([A-Za-z0-9\-_:.]+)/g;
|
13221
|
+
var endTagRegExp = /(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g;
|
13222
|
+
var shortEndedElements = schema.getShortEndedElements();
|
13223
|
+
var count = 1, index = startIndex;
|
13224
|
+
while (count !== 0) {
|
13225
|
+
startTagRegExp.lastIndex = index;
|
13226
|
+
while (true) {
|
13227
|
+
var startMatch = startTagRegExp.exec(html);
|
13228
|
+
if (startMatch === null) {
|
13229
|
+
return index;
|
13230
|
+
} else if (startMatch[1] === '!') {
|
13231
|
+
if (startsWith(startMatch[2], '--')) {
|
13232
|
+
index = findCommentEndIndex(html, false, startMatch.index + '!--'.length);
|
13233
|
+
} else {
|
13234
|
+
index = findCommentEndIndex(html, true, startMatch.index + 1);
|
13235
|
+
}
|
13236
|
+
break;
|
13237
|
+
} else {
|
13238
|
+
endTagRegExp.lastIndex = startTagRegExp.lastIndex;
|
13239
|
+
var endMatch = endTagRegExp.exec(html);
|
13240
|
+
if (isNull(endMatch) || endMatch.index !== startTagRegExp.lastIndex) {
|
13241
|
+
continue;
|
13425
13242
|
}
|
13426
13243
|
if (startMatch[1] === '/') {
|
13427
13244
|
count -= 1;
|
@@ -13500,7 +13317,6 @@
|
|
13500
13317
|
var anyAttributesRequired, attrValue, idCount = 0;
|
13501
13318
|
var decode = Entities.decode;
|
13502
13319
|
var filteredUrlAttrs = Tools.makeMap('src,href,data,background,action,formaction,poster,xlink:href');
|
13503
|
-
var scriptUriRegExp = /((java|vb)script|mhtml):/i;
|
13504
13320
|
var parsingMode = format === 'html' ? 0 : 1;
|
13505
13321
|
var processEndTag = function (name) {
|
13506
13322
|
var pos, i;
|
@@ -13547,21 +13363,19 @@
|
|
13547
13363
|
return endIndex + 1;
|
13548
13364
|
};
|
13549
13365
|
var parseAttribute = function (tagName, name, value, val2, val3) {
|
13550
|
-
var attrRule, i;
|
13551
|
-
var trimRegExp = /[\s\u0000-\u001F]+/g;
|
13552
13366
|
name = name.toLowerCase();
|
13553
13367
|
value = processAttr(name in fillAttrsMap ? name : decode(value || val2 || val3 || ''));
|
13554
13368
|
if (validate && !isInternalElement && isValidPrefixAttrName(name) === false) {
|
13555
|
-
attrRule = validAttributesMap[name];
|
13369
|
+
var attrRule = validAttributesMap[name];
|
13556
13370
|
if (!attrRule && validAttributePatterns) {
|
13557
|
-
|
13558
|
-
while (
|
13559
|
-
attrRule = validAttributePatterns[
|
13371
|
+
var i_1 = validAttributePatterns.length;
|
13372
|
+
while (i_1--) {
|
13373
|
+
attrRule = validAttributePatterns[i_1];
|
13560
13374
|
if (attrRule.pattern.test(name)) {
|
13561
13375
|
break;
|
13562
13376
|
}
|
13563
13377
|
}
|
13564
|
-
if (
|
13378
|
+
if (i_1 === -1) {
|
13565
13379
|
attrRule = null;
|
13566
13380
|
}
|
13567
13381
|
}
|
@@ -13576,19 +13390,8 @@
|
|
13576
13390
|
if (isNameOrId && tagName in filteredClobberElements && (value in doc || value in form)) {
|
13577
13391
|
return;
|
13578
13392
|
}
|
13579
|
-
if (filteredUrlAttrs[name] && !settings
|
13580
|
-
|
13581
|
-
try {
|
13582
|
-
uri = decodeURIComponent(uri);
|
13583
|
-
} catch (ex) {
|
13584
|
-
uri = unescape(uri);
|
13585
|
-
}
|
13586
|
-
if (scriptUriRegExp.test(uri)) {
|
13587
|
-
return;
|
13588
|
-
}
|
13589
|
-
if (isInvalidUri(settings, uri, tagName)) {
|
13590
|
-
return;
|
13591
|
-
}
|
13393
|
+
if (filteredUrlAttrs[name] && !URI.isDomSafe(value, tagName, settings)) {
|
13394
|
+
return;
|
13592
13395
|
}
|
13593
13396
|
if (isInternalElement && (name in filteredUrlAttrs || name.indexOf('on') === 0)) {
|
13594
13397
|
return;
|
@@ -13841,12 +13644,16 @@
|
|
13841
13644
|
var emptyRegExp = new RegExp('^(<' + blockName + '[^>]*>( | |\\s|\xA0|<br \\/>|)<\\/' + blockName + '>[\r\n]*|<br \\/>[\r\n]*)$');
|
13842
13645
|
return html.replace(emptyRegExp, '');
|
13843
13646
|
};
|
13844
|
-
var
|
13845
|
-
|
13647
|
+
var setupArgs$3 = function (args, format) {
|
13648
|
+
return __assign(__assign({}, args), {
|
13846
13649
|
format: format,
|
13847
13650
|
get: true,
|
13848
13651
|
getInner: true
|
13849
|
-
})
|
13652
|
+
});
|
13653
|
+
};
|
13654
|
+
var getContentFromBody = function (editor, args, format, body) {
|
13655
|
+
var defaultedArgs = setupArgs$3(args, format);
|
13656
|
+
var updatedArgs = args.no_events ? defaultedArgs : editor.fire('BeforeGetContent', defaultedArgs);
|
13850
13657
|
var content;
|
13851
13658
|
if (updatedArgs.format === 'raw') {
|
13852
13659
|
content = Tools.trim(trimExternal(editor.serializer, body.innerHTML));
|
@@ -13877,7 +13684,7 @@
|
|
13877
13684
|
});
|
13878
13685
|
};
|
13879
13686
|
|
13880
|
-
var each$
|
13687
|
+
var each$c = Tools.each;
|
13881
13688
|
var ElementUtils = function (dom) {
|
13882
13689
|
var compare = function (node1, node2) {
|
13883
13690
|
if (node1.nodeName !== node2.nodeName) {
|
@@ -13885,7 +13692,7 @@
|
|
13885
13692
|
}
|
13886
13693
|
var getAttribs = function (node) {
|
13887
13694
|
var attribs = {};
|
13888
|
-
each$
|
13695
|
+
each$c(dom.getAttribs(node), function (attr) {
|
13889
13696
|
var name = attr.nodeName.toLowerCase();
|
13890
13697
|
if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) {
|
13891
13698
|
attribs[name] = dom.getAttrib(node, name);
|
@@ -14895,48 +14702,80 @@
|
|
14895
14702
|
}
|
14896
14703
|
});
|
14897
14704
|
};
|
14898
|
-
var
|
14705
|
+
var deleteContentInsideCell = function (editor, cell, rng, isFirstCellInSelection) {
|
14706
|
+
var insideTableRng = rng.cloneRange();
|
14707
|
+
if (isFirstCellInSelection) {
|
14708
|
+
insideTableRng.setStart(rng.startContainer, rng.startOffset);
|
14709
|
+
insideTableRng.setEndAfter(cell.dom.lastChild);
|
14710
|
+
} else {
|
14711
|
+
insideTableRng.setStartBefore(cell.dom.firstChild);
|
14712
|
+
insideTableRng.setEnd(rng.endContainer, rng.endOffset);
|
14713
|
+
}
|
14714
|
+
deleteCellContents(editor, insideTableRng, cell, false);
|
14715
|
+
};
|
14716
|
+
var collapseAndRestoreCellSelection = function (editor) {
|
14899
14717
|
var selectedCells = getCellsFromEditor(editor);
|
14900
|
-
editor.selection.
|
14901
|
-
if (
|
14902
|
-
|
14718
|
+
var selectedNode = SugarElement.fromDom(editor.selection.getNode());
|
14719
|
+
if (isTableCell$5(selectedNode.dom) && isEmpty$2(selectedNode)) {
|
14720
|
+
editor.selection.setCursorLocation(selectedNode.dom, 0);
|
14721
|
+
} else {
|
14722
|
+
editor.selection.collapse(true);
|
14723
|
+
}
|
14724
|
+
if (selectedCells.length > 1 && exists(selectedCells, function (cell) {
|
14725
|
+
return eq(cell, selectedNode);
|
14726
|
+
})) {
|
14727
|
+
set$1(selectedNode, 'data-mce-selected', '1');
|
14903
14728
|
}
|
14904
14729
|
};
|
14905
14730
|
var emptySingleTableCells = function (editor, cells, outsideDetails) {
|
14906
|
-
|
14907
|
-
outsideDetails.
|
14731
|
+
var editorRng = editor.selection.getRng();
|
14732
|
+
var cellsToClean = outsideDetails.bind(function (_a) {
|
14908
14733
|
var rng = _a.rng, isStartInTable = _a.isStartInTable;
|
14909
14734
|
var outsideBlock = getOutsideBlock(editor, isStartInTable ? rng.endContainer : rng.startContainer);
|
14910
14735
|
rng.deleteContents();
|
14911
14736
|
handleEmptyBlock(editor, isStartInTable, outsideBlock.filter(isEmpty$2));
|
14912
|
-
|
14913
|
-
|
14914
|
-
|
14915
|
-
|
14916
|
-
|
14917
|
-
|
14918
|
-
|
14919
|
-
}
|
14737
|
+
var endPointCell = isStartInTable ? cells[0] : cells[cells.length - 1];
|
14738
|
+
deleteContentInsideCell(editor, endPointCell, editorRng, isStartInTable);
|
14739
|
+
if (!isEmpty$2(endPointCell)) {
|
14740
|
+
return Optional.some(isStartInTable ? cells.slice(1) : cells.slice(0, -1));
|
14741
|
+
} else {
|
14742
|
+
return Optional.none();
|
14743
|
+
}
|
14744
|
+
}).getOr(cells);
|
14745
|
+
cleanCells(cellsToClean);
|
14746
|
+
collapseAndRestoreCellSelection(editor);
|
14920
14747
|
return true;
|
14921
14748
|
};
|
14922
14749
|
var emptyMultiTableCells = function (editor, startTableCells, endTableCells, betweenRng) {
|
14923
|
-
|
14750
|
+
var rng = editor.selection.getRng();
|
14751
|
+
var startCell = startTableCells[0];
|
14752
|
+
var endCell = endTableCells[endTableCells.length - 1];
|
14753
|
+
deleteContentInsideCell(editor, startCell, rng, true);
|
14754
|
+
deleteContentInsideCell(editor, endCell, rng, false);
|
14755
|
+
var startTableCellsToClean = isEmpty$2(startCell) ? startTableCells : startTableCells.slice(1);
|
14756
|
+
var endTableCellsToClean = isEmpty$2(endCell) ? endTableCells : endTableCells.slice(0, -1);
|
14757
|
+
cleanCells(startTableCellsToClean.concat(endTableCellsToClean));
|
14924
14758
|
betweenRng.deleteContents();
|
14925
|
-
|
14759
|
+
collapseAndRestoreCellSelection(editor);
|
14926
14760
|
return true;
|
14927
14761
|
};
|
14928
|
-
var deleteCellContents = function (editor, rng, cell) {
|
14762
|
+
var deleteCellContents = function (editor, rng, cell, moveSelection) {
|
14763
|
+
if (moveSelection === void 0) {
|
14764
|
+
moveSelection = true;
|
14765
|
+
}
|
14929
14766
|
rng.deleteContents();
|
14930
14767
|
var lastNode = freefallRtl(cell).getOr(cell);
|
14931
14768
|
var lastBlock = SugarElement.fromDom(editor.dom.getParent(lastNode.dom, editor.dom.isBlock));
|
14932
14769
|
if (isEmpty$2(lastBlock)) {
|
14933
14770
|
fillWithPaddingBr(lastBlock);
|
14934
|
-
|
14771
|
+
if (moveSelection) {
|
14772
|
+
editor.selection.setCursorLocation(lastBlock.dom, 0);
|
14773
|
+
}
|
14935
14774
|
}
|
14936
14775
|
if (!eq(cell, lastBlock)) {
|
14937
14776
|
var additionalCleanupNodes = is$1(parent(lastBlock), cell) ? [] : siblings(lastBlock);
|
14938
14777
|
each$k(additionalCleanupNodes.concat(children(cell)), function (node) {
|
14939
|
-
if (!eq(node, lastBlock) && !contains$1(node, lastBlock)) {
|
14778
|
+
if (!eq(node, lastBlock) && !contains$1(node, lastBlock) && isEmpty$2(node)) {
|
14940
14779
|
remove$7(node);
|
14941
14780
|
}
|
14942
14781
|
});
|
@@ -15281,23 +15120,14 @@
|
|
15281
15120
|
var nextRng;
|
15282
15121
|
var dom = editor.dom;
|
15283
15122
|
var selection = editor.selection;
|
15284
|
-
var getContentEditableFalseParent = function (node) {
|
15285
|
-
var root = editor.getBody();
|
15286
|
-
for (; node && node !== root; node = node.parentNode) {
|
15287
|
-
if (dom.getContentEditable(node) === 'false') {
|
15288
|
-
return node;
|
15289
|
-
}
|
15290
|
-
}
|
15291
|
-
return null;
|
15292
|
-
};
|
15293
15123
|
if (!marker) {
|
15294
15124
|
return;
|
15295
15125
|
}
|
15296
15126
|
selection.scrollIntoView(marker);
|
15297
|
-
var
|
15298
|
-
if (
|
15127
|
+
var parentEditableElm = getContentEditableRoot$1(editor.getBody(), marker);
|
15128
|
+
if (dom.getContentEditable(parentEditableElm) === 'false') {
|
15299
15129
|
dom.remove(marker);
|
15300
|
-
selection.select(
|
15130
|
+
selection.select(parentEditableElm);
|
15301
15131
|
return;
|
15302
15132
|
}
|
15303
15133
|
var rng = dom.createRng();
|
@@ -15579,11 +15409,15 @@
|
|
15579
15409
|
}
|
15580
15410
|
return content;
|
15581
15411
|
};
|
15582
|
-
var
|
15583
|
-
|
15412
|
+
var setupArgs$2 = function (args, content) {
|
15413
|
+
return __assign(__assign({ format: defaultFormat$1 }, args), {
|
15584
15414
|
set: true,
|
15585
15415
|
content: isTreeNode(content) ? '' : content
|
15586
|
-
})
|
15416
|
+
});
|
15417
|
+
};
|
15418
|
+
var setContentInternal = function (editor, content, args) {
|
15419
|
+
var defaultedArgs = setupArgs$2(args, content);
|
15420
|
+
var updatedArgs = args.no_events ? defaultedArgs : editor.fire('BeforeSetContent', defaultedArgs);
|
15587
15421
|
if (!isTreeNode(content)) {
|
15588
15422
|
content = updatedArgs.content;
|
15589
15423
|
}
|
@@ -16039,7 +15873,7 @@
|
|
16039
15873
|
|
16040
15874
|
var postProcessHooks = {};
|
16041
15875
|
var filter = filter$2;
|
16042
|
-
var each$
|
15876
|
+
var each$b = each$i;
|
16043
15877
|
var addPostProcessHook = function (name, hook) {
|
16044
15878
|
var hooks = postProcessHooks[name];
|
16045
15879
|
if (!hooks) {
|
@@ -16048,7 +15882,7 @@
|
|
16048
15882
|
postProcessHooks[name].push(hook);
|
16049
15883
|
};
|
16050
15884
|
var postProcess$1 = function (name, editor) {
|
16051
|
-
each$
|
15885
|
+
each$b(postProcessHooks[name], function (hook) {
|
16052
15886
|
hook(editor);
|
16053
15887
|
});
|
16054
15888
|
};
|
@@ -16065,13 +15899,13 @@
|
|
16065
15899
|
var isPre = matchNodeNames(['pre']);
|
16066
15900
|
if (!rng.collapsed) {
|
16067
15901
|
blocks = editor.selection.getSelectedBlocks();
|
16068
|
-
each$
|
15902
|
+
each$b(filter(filter(blocks, isPre), hasPreSibling), function (pre) {
|
16069
15903
|
joinPre(pre.previousSibling, pre);
|
16070
15904
|
});
|
16071
15905
|
}
|
16072
15906
|
});
|
16073
15907
|
|
16074
|
-
var each$
|
15908
|
+
var each$a = Tools.each;
|
16075
15909
|
var isElementNode$1 = function (node) {
|
16076
15910
|
return isElement$5(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus$2(node);
|
16077
15911
|
};
|
@@ -16115,9 +15949,9 @@
|
|
16115
15949
|
var clearChildStyles = function (dom, format, node) {
|
16116
15950
|
if (format.clear_child_styles) {
|
16117
15951
|
var selector = format.links ? '*:not(a)' : '*';
|
16118
|
-
each$
|
15952
|
+
each$a(dom.select(selector, node), function (node) {
|
16119
15953
|
if (isElementNode$1(node)) {
|
16120
|
-
each$
|
15954
|
+
each$a(format.styles, function (value, name) {
|
16121
15955
|
dom.setStyle(node, name, '');
|
16122
15956
|
});
|
16123
15957
|
}
|
@@ -16125,7 +15959,7 @@
|
|
16125
15959
|
}
|
16126
15960
|
};
|
16127
15961
|
var processChildElements = function (node, filter, process) {
|
16128
|
-
each$
|
15962
|
+
each$a(node.childNodes, function (node) {
|
16129
15963
|
if (isElementNode$1(node)) {
|
16130
15964
|
if (filter(node)) {
|
16131
15965
|
process(node);
|
@@ -16162,7 +15996,7 @@
|
|
16162
15996
|
{ removed: [] }
|
16163
15997
|
]);
|
16164
15998
|
var MCE_ATTR_RE = /^(src|href|style)$/;
|
16165
|
-
var each$
|
15999
|
+
var each$9 = Tools.each;
|
16166
16000
|
var isEq$2 = isEq$5;
|
16167
16001
|
var isTableCellOrRow = function (node) {
|
16168
16002
|
return /^(TR|TH|TD)$/.test(node.nodeName);
|
@@ -16296,7 +16130,7 @@
|
|
16296
16130
|
}
|
16297
16131
|
}
|
16298
16132
|
if (format.remove !== 'all') {
|
16299
|
-
each$
|
16133
|
+
each$9(format.styles, function (value, name) {
|
16300
16134
|
value = normalizeStyleValue(dom, replaceVars(value, vars), name + '');
|
16301
16135
|
if (isNumber(name)) {
|
16302
16136
|
name = value;
|
@@ -16311,7 +16145,7 @@
|
|
16311
16145
|
elm.removeAttribute('style');
|
16312
16146
|
elm.removeAttribute('data-mce-style');
|
16313
16147
|
}
|
16314
|
-
each$
|
16148
|
+
each$9(format.attributes, function (value, name) {
|
16315
16149
|
var valueOut;
|
16316
16150
|
value = replaceVars(value, vars);
|
16317
16151
|
if (isNumber(name)) {
|
@@ -16348,7 +16182,7 @@
|
|
16348
16182
|
elm.removeAttribute(name);
|
16349
16183
|
}
|
16350
16184
|
});
|
16351
|
-
each$
|
16185
|
+
each$9(format.classes, function (value) {
|
16352
16186
|
value = replaceVars(value, vars);
|
16353
16187
|
if (!compareNode || dom.hasClass(compareNode, value)) {
|
16354
16188
|
dom.removeClass(elm, value);
|
@@ -16601,7 +16435,7 @@
|
|
16601
16435
|
fireFormatRemove(ed, name, node, vars);
|
16602
16436
|
};
|
16603
16437
|
|
16604
|
-
var each$
|
16438
|
+
var each$8 = Tools.each;
|
16605
16439
|
var mergeTextDecorationsAndColor = function (dom, format, vars, node) {
|
16606
16440
|
var processTextDecorationsAndColor = function (n) {
|
16607
16441
|
if (n.nodeType === 1 && n.parentNode && n.parentNode.nodeType === 1) {
|
@@ -16630,9 +16464,9 @@
|
|
16630
16464
|
}
|
16631
16465
|
};
|
16632
16466
|
var mergeWithChildren = function (editor, formatList, vars, node) {
|
16633
|
-
each$
|
16467
|
+
each$8(formatList, function (format) {
|
16634
16468
|
if (isInlineFormat(format)) {
|
16635
|
-
each$
|
16469
|
+
each$8(editor.dom.select(format.inline, node), function (child) {
|
16636
16470
|
if (!isElementNode$1(child)) {
|
16637
16471
|
return;
|
16638
16472
|
}
|
@@ -16658,7 +16492,7 @@
|
|
16658
16492
|
}
|
16659
16493
|
};
|
16660
16494
|
|
16661
|
-
var each$
|
16495
|
+
var each$7 = Tools.each;
|
16662
16496
|
var isElementNode = function (node) {
|
16663
16497
|
return isElement$5(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus$2(node);
|
16664
16498
|
};
|
@@ -16696,7 +16530,7 @@
|
|
16696
16530
|
if (isFunction(fmt.onformat)) {
|
16697
16531
|
fmt.onformat(elm, fmt, vars, node);
|
16698
16532
|
}
|
16699
|
-
each$
|
16533
|
+
each$7(fmt.styles, function (value, name) {
|
16700
16534
|
dom.setStyle(elm, name, replaceVars(value, vars));
|
16701
16535
|
});
|
16702
16536
|
if (fmt.styles) {
|
@@ -16705,10 +16539,10 @@
|
|
16705
16539
|
dom.setAttrib(elm, 'data-mce-style', styleVal);
|
16706
16540
|
}
|
16707
16541
|
}
|
16708
|
-
each$
|
16542
|
+
each$7(fmt.attributes, function (value, name) {
|
16709
16543
|
dom.setAttrib(elm, name, replaceVars(value, vars));
|
16710
16544
|
});
|
16711
|
-
each$
|
16545
|
+
each$7(fmt.classes, function (value) {
|
16712
16546
|
value = replaceVars(value, vars);
|
16713
16547
|
if (!dom.hasClass(elm, value)) {
|
16714
16548
|
dom.addClass(elm, value);
|
@@ -16717,7 +16551,7 @@
|
|
16717
16551
|
};
|
16718
16552
|
var applyNodeStyle = function (formatList, node) {
|
16719
16553
|
var found = false;
|
16720
|
-
each$
|
16554
|
+
each$7(formatList, function (format) {
|
16721
16555
|
if (!isSelectorFormat(format)) {
|
16722
16556
|
return false;
|
16723
16557
|
}
|
@@ -17331,15 +17165,19 @@
|
|
17331
17165
|
}
|
17332
17166
|
return editor.selection.serializer.serialize(tmpElm, args);
|
17333
17167
|
};
|
17168
|
+
var setupArgs$1 = function (args, format) {
|
17169
|
+
return __assign(__assign({}, args), {
|
17170
|
+
format: format,
|
17171
|
+
get: true,
|
17172
|
+
selection: true
|
17173
|
+
});
|
17174
|
+
};
|
17334
17175
|
var getSelectedContentInternal = function (editor, format, args) {
|
17335
17176
|
if (args === void 0) {
|
17336
17177
|
args = {};
|
17337
17178
|
}
|
17338
|
-
var
|
17339
|
-
|
17340
|
-
get: true,
|
17341
|
-
selection: true
|
17342
|
-
}));
|
17179
|
+
var defaultedArgs = setupArgs$1(args, format);
|
17180
|
+
var updatedArgs = editor.fire('BeforeGetContent', defaultedArgs);
|
17343
17181
|
if (updatedArgs.isDefaultPrevented()) {
|
17344
17182
|
editor.fire('GetContent', updatedArgs);
|
17345
17183
|
return updatedArgs.content;
|
@@ -18198,10 +18036,10 @@
|
|
18198
18036
|
if (args === void 0) {
|
18199
18037
|
args = {};
|
18200
18038
|
}
|
18201
|
-
var
|
18202
|
-
var updatedArgs =
|
18203
|
-
if (!
|
18204
|
-
var eventArgs = editor.fire('BeforeSetContent',
|
18039
|
+
var defaultedArgs = setupArgs(args, content);
|
18040
|
+
var updatedArgs = defaultedArgs;
|
18041
|
+
if (!defaultedArgs.no_events) {
|
18042
|
+
var eventArgs = editor.fire('BeforeSetContent', defaultedArgs);
|
18205
18043
|
if (eventArgs.isDefaultPrevented()) {
|
18206
18044
|
editor.fire('SetContent', eventArgs);
|
18207
18045
|
return;
|
@@ -18234,29 +18072,36 @@
|
|
18234
18072
|
function SelectorChanged (dom, editor) {
|
18235
18073
|
var selectorChangedData;
|
18236
18074
|
var currentSelectors;
|
18075
|
+
var findMatchingNode = function (selector, nodes) {
|
18076
|
+
return find$3(nodes, function (node) {
|
18077
|
+
return dom.is(node, selector);
|
18078
|
+
});
|
18079
|
+
};
|
18080
|
+
var getParents = function (elem) {
|
18081
|
+
return dom.getParents(elem, null, dom.getRoot());
|
18082
|
+
};
|
18237
18083
|
return {
|
18238
18084
|
selectorChangedWithUnbind: function (selector, callback) {
|
18239
18085
|
if (!selectorChangedData) {
|
18240
18086
|
selectorChangedData = {};
|
18241
18087
|
currentSelectors = {};
|
18242
18088
|
editor.on('NodeChange', function (e) {
|
18243
|
-
var node = e.element
|
18089
|
+
var node = e.element;
|
18090
|
+
var parents = getParents(node);
|
18091
|
+
var matchedSelectors = {};
|
18244
18092
|
Tools.each(selectorChangedData, function (callbacks, selector) {
|
18245
|
-
|
18246
|
-
if (
|
18247
|
-
|
18248
|
-
|
18249
|
-
|
18250
|
-
|
18251
|
-
|
18252
|
-
parents: parents
|
18253
|
-
});
|
18093
|
+
findMatchingNode(selector, parents).each(function (node) {
|
18094
|
+
if (!currentSelectors[selector]) {
|
18095
|
+
each$k(callbacks, function (callback) {
|
18096
|
+
callback(true, {
|
18097
|
+
node: node,
|
18098
|
+
selector: selector,
|
18099
|
+
parents: parents
|
18254
18100
|
});
|
18255
|
-
|
18256
|
-
|
18257
|
-
matchedSelectors[selector] = callbacks;
|
18258
|
-
return false;
|
18101
|
+
});
|
18102
|
+
currentSelectors[selector] = callbacks;
|
18259
18103
|
}
|
18104
|
+
matchedSelectors[selector] = callbacks;
|
18260
18105
|
});
|
18261
18106
|
});
|
18262
18107
|
Tools.each(currentSelectors, function (callbacks, selector) {
|
@@ -18277,6 +18122,9 @@
|
|
18277
18122
|
selectorChangedData[selector] = [];
|
18278
18123
|
}
|
18279
18124
|
selectorChangedData[selector].push(callback);
|
18125
|
+
findMatchingNode(selector, getParents(editor.selection.getStart())).each(function () {
|
18126
|
+
currentSelectors[selector] = selectorChangedData[selector];
|
18127
|
+
});
|
18280
18128
|
return {
|
18281
18129
|
unbind: function () {
|
18282
18130
|
deleteFromCallbackMap(selectorChangedData, selector, callback);
|
@@ -18510,7 +18358,11 @@
|
|
18510
18358
|
return scrollContainer;
|
18511
18359
|
};
|
18512
18360
|
var scrollIntoView = function (elm, alignToTop) {
|
18513
|
-
|
18361
|
+
if (isNonNullable(elm)) {
|
18362
|
+
scrollElementIntoView(editor, elm, alignToTop);
|
18363
|
+
} else {
|
18364
|
+
scrollRangeIntoView(editor, getRng$1(), alignToTop);
|
18365
|
+
}
|
18514
18366
|
};
|
18515
18367
|
var placeCaretAt = function (clientX, clientY) {
|
18516
18368
|
return setRng(fromPoint(clientX, clientY, editor.getDoc()));
|
@@ -19033,7 +18885,7 @@
|
|
19033
18885
|
registerBase64ImageFilter(parser, settings);
|
19034
18886
|
};
|
19035
18887
|
|
19036
|
-
var makeMap = Tools.makeMap, each$
|
18888
|
+
var makeMap = Tools.makeMap, each$6 = Tools.each, explode$2 = Tools.explode, extend$4 = Tools.extend;
|
19037
18889
|
var DomParser = function (settings, schema) {
|
19038
18890
|
if (schema === void 0) {
|
19039
18891
|
schema = Schema();
|
@@ -19173,7 +19025,7 @@
|
|
19173
19025
|
return node;
|
19174
19026
|
};
|
19175
19027
|
var addNodeFilter = function (name, callback) {
|
19176
|
-
each$
|
19028
|
+
each$6(explode$2(name), function (name) {
|
19177
19029
|
var list = nodeFilters[name];
|
19178
19030
|
if (!list) {
|
19179
19031
|
nodeFilters[name] = list = [];
|
@@ -19194,7 +19046,7 @@
|
|
19194
19046
|
return out;
|
19195
19047
|
};
|
19196
19048
|
var addAttributeFilter = function (name, callback) {
|
19197
|
-
each$
|
19049
|
+
each$6(explode$2(name), function (name) {
|
19198
19050
|
var i;
|
19199
19051
|
for (i = 0; i < attributeFilters.length; i++) {
|
19200
19052
|
if (attributeFilters[i].name === name) {
|
@@ -19908,6 +19760,44 @@
|
|
19908
19760
|
};
|
19909
19761
|
var deepMerge = baseMerge(deep);
|
19910
19762
|
|
19763
|
+
var deprecatedSettings = ('autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,' + 'boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,' + 'force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,' + 'non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,' + 'tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,' + 'paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists').split(',');
|
19764
|
+
var deprecatedPlugins = 'bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor'.split(',');
|
19765
|
+
var movedToPremiumPlugins = 'imagetools,toc'.split(',');
|
19766
|
+
var getDeprecatedSettings = function (settings) {
|
19767
|
+
var settingNames = filter$4(deprecatedSettings, function (setting) {
|
19768
|
+
return has$2(settings, setting);
|
19769
|
+
});
|
19770
|
+
var forcedRootBlock = settings.forced_root_block;
|
19771
|
+
if (forcedRootBlock === false || forcedRootBlock === '') {
|
19772
|
+
settingNames.push('forced_root_block (false only)');
|
19773
|
+
}
|
19774
|
+
return sort(settingNames);
|
19775
|
+
};
|
19776
|
+
var getDeprecatedPlugins = function (settings) {
|
19777
|
+
var plugins = Tools.makeMap(settings.plugins, ' ');
|
19778
|
+
var hasPlugin = function (plugin) {
|
19779
|
+
return has$2(plugins, plugin);
|
19780
|
+
};
|
19781
|
+
var pluginNames = __spreadArray(__spreadArray([], filter$4(deprecatedPlugins, hasPlugin), true), bind(movedToPremiumPlugins, function (plugin) {
|
19782
|
+
return hasPlugin(plugin) ? [plugin + ' (moving to premium)'] : [];
|
19783
|
+
}), true);
|
19784
|
+
return sort(pluginNames);
|
19785
|
+
};
|
19786
|
+
var logDeprecationsWarning = function (rawSettings, finalSettings) {
|
19787
|
+
var deprecatedSettings = getDeprecatedSettings(rawSettings);
|
19788
|
+
var deprecatedPlugins = getDeprecatedPlugins(finalSettings);
|
19789
|
+
var hasDeprecatedPlugins = deprecatedPlugins.length > 0;
|
19790
|
+
var hasDeprecatedSettings = deprecatedSettings.length > 0;
|
19791
|
+
var isLegacyMobileTheme = finalSettings.theme === 'mobile';
|
19792
|
+
if (hasDeprecatedPlugins || hasDeprecatedSettings || isLegacyMobileTheme) {
|
19793
|
+
var listJoiner = '\n- ';
|
19794
|
+
var themesMessage = isLegacyMobileTheme ? '\n\nThemes:' + listJoiner + 'mobile' : '';
|
19795
|
+
var pluginsMessage = hasDeprecatedPlugins ? '\n\nPlugins:' + listJoiner + deprecatedPlugins.join(listJoiner) : '';
|
19796
|
+
var settingsMessage = hasDeprecatedSettings ? '\n\nSettings:' + listJoiner + deprecatedSettings.join(listJoiner) : '';
|
19797
|
+
console.warn('The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. ' + 'See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information.' + themesMessage + pluginsMessage + settingsMessage);
|
19798
|
+
}
|
19799
|
+
};
|
19800
|
+
|
19911
19801
|
var sectionResult = function (sections, settings) {
|
19912
19802
|
return {
|
19913
19803
|
sections: constant(sections),
|
@@ -20054,7 +19944,11 @@
|
|
20054
19944
|
};
|
20055
19945
|
var getEditorSettings = function (editor, id, documentBaseUrl, defaultOverrideSettings, settings) {
|
20056
19946
|
var defaultSettings = getDefaultSettings(settings, id, documentBaseUrl, isTouch, editor);
|
20057
|
-
|
19947
|
+
var finalSettings = combineSettings(isPhone || isTablet, isPhone, defaultSettings, defaultOverrideSettings, settings);
|
19948
|
+
if (finalSettings.deprecation_warnings !== false) {
|
19949
|
+
logDeprecationsWarning(settings, finalSettings);
|
19950
|
+
}
|
19951
|
+
return finalSettings;
|
20058
19952
|
};
|
20059
19953
|
var getFiltered = function (predicate, editor, name) {
|
20060
19954
|
return Optional.from(editor.settings[name]).filter(predicate);
|
@@ -20255,8 +20149,9 @@
|
|
20255
20149
|
timeout: 0
|
20256
20150
|
}, false);
|
20257
20151
|
}
|
20152
|
+
reposition();
|
20258
20153
|
});
|
20259
|
-
editor.on('ResizeEditor ResizeWindow NodeChange', function () {
|
20154
|
+
editor.on('show ResizeEditor ResizeWindow NodeChange', function () {
|
20260
20155
|
Delay.requestAnimationFrame(reposition);
|
20261
20156
|
});
|
20262
20157
|
editor.on('remove', function () {
|
@@ -20428,9 +20323,9 @@
|
|
20428
20323
|
var console = window.console;
|
20429
20324
|
if (console) {
|
20430
20325
|
if (console.error) {
|
20431
|
-
console.error.apply(console, __spreadArray([message], x));
|
20326
|
+
console.error.apply(console, __spreadArray([message], x, false));
|
20432
20327
|
} else {
|
20433
|
-
console.log.apply(console, __spreadArray([message], x));
|
20328
|
+
console.log.apply(console, __spreadArray([message], x, false));
|
20434
20329
|
}
|
20435
20330
|
}
|
20436
20331
|
};
|
@@ -21362,7 +21257,7 @@
|
|
21362
21257
|
};
|
21363
21258
|
};
|
21364
21259
|
|
21365
|
-
var each$
|
21260
|
+
var each$5 = Tools.each;
|
21366
21261
|
var dom = DOMUtils.DOM;
|
21367
21262
|
var parsedSelectorToHtml = function (ancestry, editor) {
|
21368
21263
|
var elm, item, fragment;
|
@@ -21523,19 +21418,19 @@
|
|
21523
21418
|
previewFrag = parsedSelectorToHtml([name], editor);
|
21524
21419
|
}
|
21525
21420
|
var previewElm = dom.select(name, previewFrag)[0] || previewFrag.firstChild;
|
21526
|
-
each$
|
21421
|
+
each$5(format.styles, function (value, name) {
|
21527
21422
|
var newValue = removeVars(value);
|
21528
21423
|
if (newValue) {
|
21529
21424
|
dom.setStyle(previewElm, name, newValue);
|
21530
21425
|
}
|
21531
21426
|
});
|
21532
|
-
each$
|
21427
|
+
each$5(format.attributes, function (value, name) {
|
21533
21428
|
var newValue = removeVars(value);
|
21534
21429
|
if (newValue) {
|
21535
21430
|
dom.setAttrib(previewElm, name, newValue);
|
21536
21431
|
}
|
21537
21432
|
});
|
21538
|
-
each$
|
21433
|
+
each$5(format.classes, function (value) {
|
21539
21434
|
var newValue = removeVars(value);
|
21540
21435
|
if (!dom.hasClass(previewElm, newValue)) {
|
21541
21436
|
dom.addClass(previewElm, newValue);
|
@@ -21549,7 +21444,7 @@
|
|
21549
21444
|
editor.getBody().appendChild(previewFrag);
|
21550
21445
|
parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true);
|
21551
21446
|
parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0;
|
21552
|
-
each$
|
21447
|
+
each$5(previewStyles.split(' '), function (name) {
|
21553
21448
|
var value = dom.getStyle(previewElm, name, true);
|
21554
21449
|
if (name === 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {
|
21555
21450
|
value = dom.getStyle(editor.getBody(), name, true);
|
@@ -22988,17 +22883,23 @@
|
|
22988
22883
|
var isInsideY = function (clientY, clientRect) {
|
22989
22884
|
return clientY >= clientRect.top && clientY <= clientRect.bottom;
|
22990
22885
|
};
|
22991
|
-
var
|
22886
|
+
var isNodeClientRect = function (rect) {
|
22887
|
+
return hasNonNullableKey(rect, 'node');
|
22888
|
+
};
|
22889
|
+
var findClosestClientRect = function (clientRects, clientX, allowInside) {
|
22890
|
+
if (allowInside === void 0) {
|
22891
|
+
allowInside = always;
|
22892
|
+
}
|
22992
22893
|
return reduce(clientRects, function (oldClientRect, clientRect) {
|
22993
|
-
var oldDistance = Math.min(distanceToRectLeft(oldClientRect, clientX), distanceToRectRight(oldClientRect, clientX));
|
22994
|
-
var newDistance = Math.min(distanceToRectLeft(clientRect, clientX), distanceToRectRight(clientRect, clientX));
|
22995
22894
|
if (isInsideX(clientX, clientRect)) {
|
22996
|
-
return clientRect;
|
22895
|
+
return allowInside(clientRect) ? clientRect : oldClientRect;
|
22997
22896
|
}
|
22998
22897
|
if (isInsideX(clientX, oldClientRect)) {
|
22999
|
-
return oldClientRect;
|
22898
|
+
return allowInside(oldClientRect) ? oldClientRect : clientRect;
|
23000
22899
|
}
|
23001
|
-
|
22900
|
+
var oldDistance = Math.min(distanceToRectLeft(oldClientRect, clientX), distanceToRectRight(oldClientRect, clientX));
|
22901
|
+
var newDistance = Math.min(distanceToRectLeft(clientRect, clientX), distanceToRectRight(clientRect, clientX));
|
22902
|
+
if (newDistance === oldDistance && isNodeClientRect(clientRect) && isContentEditableFalse$3(clientRect.node)) {
|
23002
22903
|
return clientRect;
|
23003
22904
|
}
|
23004
22905
|
if (newDistance < oldDistance) {
|
@@ -23044,10 +22945,13 @@
|
|
23044
22945
|
var closestFakeCaret = function (root, clientX, clientY) {
|
23045
22946
|
var fakeTargetNodeRects = getClientRects(getFakeCaretTargets(root));
|
23046
22947
|
var targetNodeRects = filter$4(fakeTargetNodeRects, curry(isInsideY, clientY));
|
23047
|
-
var
|
22948
|
+
var checkInside = function (clientRect) {
|
22949
|
+
return !isTable$3(clientRect.node) && !isMedia$2(clientRect.node);
|
22950
|
+
};
|
22951
|
+
var closestNodeRect = findClosestClientRect(targetNodeRects, clientX, checkInside);
|
23048
22952
|
if (closestNodeRect) {
|
23049
|
-
var includeChildren =
|
23050
|
-
closestNodeRect = findClosestClientRect(findLineNodeRects(root, closestNodeRect, includeChildren), clientX);
|
22953
|
+
var includeChildren = checkInside(closestNodeRect);
|
22954
|
+
closestNodeRect = findClosestClientRect(findLineNodeRects(root, closestNodeRect, includeChildren), clientX, checkInside);
|
23051
22955
|
if (closestNodeRect && isFakeCaretTarget(closestNodeRect.node)) {
|
23052
22956
|
return caretInfo(closestNodeRect, clientX);
|
23053
22957
|
}
|
@@ -24590,7 +24494,7 @@
|
|
24590
24494
|
var filteredClasses = filter$4(currentClasses, function (clazz) {
|
24591
24495
|
return !contains$3(attrClasses, clazz);
|
24592
24496
|
});
|
24593
|
-
var newClasses = __spreadArray(__spreadArray([], attrClasses), filteredClasses);
|
24497
|
+
var newClasses = __spreadArray(__spreadArray([], attrClasses, true), filteredClasses, true);
|
24594
24498
|
dom.setAttrib(node, 'class', newClasses.join(' '));
|
24595
24499
|
});
|
24596
24500
|
var appliedAttrs = [
|
@@ -25657,6 +25561,7 @@
|
|
25657
25561
|
});
|
25658
25562
|
}
|
25659
25563
|
}
|
25564
|
+
editor.fire('dragend');
|
25660
25565
|
}
|
25661
25566
|
});
|
25662
25567
|
removeDragState(state);
|
@@ -25695,6 +25600,11 @@
|
|
25695
25600
|
pageDom.unbind(rootDocument, 'mousemove', dragHandler);
|
25696
25601
|
pageDom.unbind(rootDocument, 'mouseup', dragEndHandler);
|
25697
25602
|
});
|
25603
|
+
editor.on('keydown', function (e) {
|
25604
|
+
if (e.keyCode === VK.ESC) {
|
25605
|
+
dragEndHandler();
|
25606
|
+
}
|
25607
|
+
});
|
25698
25608
|
};
|
25699
25609
|
var blockIeDrop = function (editor) {
|
25700
25610
|
editor.on('drop', function (e) {
|
@@ -25870,13 +25780,18 @@
|
|
25870
25780
|
editor.on('blur NewBlock', removeElementSelection);
|
25871
25781
|
editor.on('ResizeWindow FullscreenStateChanged', fakeCaret.reposition);
|
25872
25782
|
var hasNormalCaretPosition = function (elm) {
|
25873
|
-
var
|
25874
|
-
if (
|
25783
|
+
var start = elm.firstChild;
|
25784
|
+
if (isNullable(start)) {
|
25875
25785
|
return false;
|
25876
25786
|
}
|
25877
|
-
var startPos = CaretPosition.before(
|
25878
|
-
|
25879
|
-
|
25787
|
+
var startPos = CaretPosition.before(start);
|
25788
|
+
if (isBr$5(startPos.getNode()) && elm.childNodes.length === 1) {
|
25789
|
+
return !isNearFakeSelectionElement(startPos);
|
25790
|
+
} else {
|
25791
|
+
var caretWalker = CaretWalker(elm);
|
25792
|
+
var newPos = caretWalker.next(startPos);
|
25793
|
+
return newPos && !isNearFakeSelectionElement(newPos);
|
25794
|
+
}
|
25880
25795
|
};
|
25881
25796
|
var isInSameBlock = function (node1, node2) {
|
25882
25797
|
var block1 = dom.getParent(node1, isBlock);
|
@@ -25886,10 +25801,13 @@
|
|
25886
25801
|
var hasBetterMouseTarget = function (targetNode, caretNode) {
|
25887
25802
|
var targetBlock = dom.getParent(targetNode, isBlock);
|
25888
25803
|
var caretBlock = dom.getParent(caretNode, isBlock);
|
25889
|
-
if (
|
25804
|
+
if (isNullable(targetBlock)) {
|
25805
|
+
return false;
|
25806
|
+
}
|
25807
|
+
if (targetNode !== caretBlock && dom.isChildOf(targetBlock, caretBlock) && isContentEditableFalse(getContentEditableRoot(editor, targetBlock)) === false) {
|
25890
25808
|
return true;
|
25891
25809
|
}
|
25892
|
-
return targetBlock && !isInSameBlock(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock);
|
25810
|
+
return !dom.isChildOf(caretBlock, targetBlock) && !isInSameBlock(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock);
|
25893
25811
|
};
|
25894
25812
|
editor.on('tap', function (e) {
|
25895
25813
|
var targetElm = e.target;
|
@@ -25931,8 +25849,8 @@
|
|
25931
25849
|
if (!hasBetterMouseTarget(targetElm, fakeCaretInfo.node)) {
|
25932
25850
|
e.preventDefault();
|
25933
25851
|
var range = showCaret(1, fakeCaretInfo.node, fakeCaretInfo.before, false);
|
25934
|
-
editor.getBody().focus();
|
25935
25852
|
setRange(range);
|
25853
|
+
editor.getBody().focus();
|
25936
25854
|
}
|
25937
25855
|
}
|
25938
25856
|
}
|
@@ -26982,15 +26900,16 @@
|
|
26982
26900
|
iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
|
26983
26901
|
var bodyId = getBodyId(editor);
|
26984
26902
|
var bodyClass = getBodyClass(editor);
|
26903
|
+
var translatedAriaText = editor.translate(getIframeAriaText(editor));
|
26985
26904
|
if (getContentSecurityPolicy(editor)) {
|
26986
26905
|
iframeHTML += '<meta http-equiv="Content-Security-Policy" content="' + getContentSecurityPolicy(editor) + '" />';
|
26987
26906
|
}
|
26988
|
-
iframeHTML += '</head
|
26907
|
+
iframeHTML += '</head>' + ('<body id="' + bodyId + '" class="mce-content-body ' + bodyClass + '" data-id="' + editor.id + '" aria-label="' + translatedAriaText + '">') + '<br>' + '</body></html>';
|
26989
26908
|
return iframeHTML;
|
26990
26909
|
};
|
26991
26910
|
var createIframe = function (editor, o) {
|
26992
|
-
var
|
26993
|
-
var ifr = createIframeElement(editor.id,
|
26911
|
+
var iframeTitle = editor.translate('Rich Text Area');
|
26912
|
+
var ifr = createIframeElement(editor.id, iframeTitle, o.height, getIframeAttrs(editor)).dom;
|
26994
26913
|
ifr.onload = function () {
|
26995
26914
|
ifr.onload = null;
|
26996
26915
|
editor.fire('load');
|
@@ -27515,7 +27434,7 @@
|
|
27515
27434
|
insertContent(editor, result.content, result.details);
|
27516
27435
|
};
|
27517
27436
|
|
27518
|
-
var each$
|
27437
|
+
var each$4 = Tools.each;
|
27519
27438
|
var map = Tools.map, inArray = Tools.inArray;
|
27520
27439
|
var EditorCommands = function () {
|
27521
27440
|
function EditorCommands(editor) {
|
@@ -27558,7 +27477,7 @@
|
|
27558
27477
|
});
|
27559
27478
|
return true;
|
27560
27479
|
}
|
27561
|
-
each$
|
27480
|
+
each$4(this.editor.plugins, function (p) {
|
27562
27481
|
if (p.execCommand && p.execCommand(command, ui, value)) {
|
27563
27482
|
self.editor.fire('ExecCommand', {
|
27564
27483
|
command: command,
|
@@ -27628,8 +27547,8 @@
|
|
27628
27547
|
type = 'exec';
|
27629
27548
|
}
|
27630
27549
|
var self = this;
|
27631
|
-
each$
|
27632
|
-
each$
|
27550
|
+
each$4(commandList, function (callback, command) {
|
27551
|
+
each$4(command.toLowerCase().split(','), function (command) {
|
27633
27552
|
self.commands[type][command] = callback;
|
27634
27553
|
});
|
27635
27554
|
});
|
@@ -27739,7 +27658,7 @@
|
|
27739
27658
|
if (align === 'full') {
|
27740
27659
|
align = 'justify';
|
27741
27660
|
}
|
27742
|
-
each$
|
27661
|
+
each$4('left,center,right,justify'.split(','), function (name) {
|
27743
27662
|
if (align !== name) {
|
27744
27663
|
editor.formatter.remove('align' + name);
|
27745
27664
|
}
|
@@ -28119,9 +28038,9 @@
|
|
28119
28038
|
this.toggleEvent(currentName, true);
|
28120
28039
|
}
|
28121
28040
|
if (prepend) {
|
28122
|
-
handlers = __spreadArray([wrappedCallback], handlers);
|
28041
|
+
handlers = __spreadArray([wrappedCallback], handlers, true);
|
28123
28042
|
} else {
|
28124
|
-
handlers = __spreadArray(__spreadArray([], handlers), [wrappedCallback]);
|
28043
|
+
handlers = __spreadArray(__spreadArray([], handlers, true), [wrappedCallback], false);
|
28125
28044
|
}
|
28126
28045
|
this.bindings[currentName] = handlers;
|
28127
28046
|
}
|
@@ -28432,7 +28351,7 @@
|
|
28432
28351
|
};
|
28433
28352
|
};
|
28434
28353
|
|
28435
|
-
var each$
|
28354
|
+
var each$3 = Tools.each, explode$1 = Tools.explode;
|
28436
28355
|
var keyCodeLookup = {
|
28437
28356
|
f1: 112,
|
28438
28357
|
f2: 113,
|
@@ -28451,7 +28370,7 @@
|
|
28451
28370
|
var parseShortcut = function (pattern) {
|
28452
28371
|
var key;
|
28453
28372
|
var shortcut = {};
|
28454
|
-
each$
|
28373
|
+
each$3(explode$1(pattern.toLowerCase(), '+'), function (value) {
|
28455
28374
|
if (value in modifierNames) {
|
28456
28375
|
shortcut[value] = true;
|
28457
28376
|
} else {
|
@@ -28498,7 +28417,7 @@
|
|
28498
28417
|
var self = this;
|
28499
28418
|
editor.on('keyup keypress keydown', function (e) {
|
28500
28419
|
if ((self.hasModifier(e) || self.isFunctionKey(e)) && !e.isDefaultPrevented()) {
|
28501
|
-
each$
|
28420
|
+
each$3(self.shortcuts, function (shortcut) {
|
28502
28421
|
if (self.matchShortcut(e, shortcut)) {
|
28503
28422
|
self.pendingPatterns = shortcut.subpatterns.slice(0);
|
28504
28423
|
if (e.type === 'keydown') {
|
@@ -28521,7 +28440,7 @@
|
|
28521
28440
|
Shortcuts.prototype.add = function (pattern, desc, cmdFunc, scope) {
|
28522
28441
|
var self = this;
|
28523
28442
|
var func = self.normalizeCommandFunc(cmdFunc);
|
28524
|
-
each$
|
28443
|
+
each$3(explode$1(Tools.trim(pattern)), function (pattern) {
|
28525
28444
|
var shortcut = self.createShortcut(pattern, desc, func, scope);
|
28526
28445
|
self.shortcuts[shortcut.id] = shortcut;
|
28527
28446
|
});
|
@@ -28655,251 +28574,6 @@
|
|
28655
28574
|
};
|
28656
28575
|
};
|
28657
28576
|
|
28658
|
-
var each$3 = Tools.each, trim = Tools.trim;
|
28659
|
-
var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' ');
|
28660
|
-
var DEFAULT_PORTS = {
|
28661
|
-
ftp: 21,
|
28662
|
-
http: 80,
|
28663
|
-
https: 443,
|
28664
|
-
mailto: 25
|
28665
|
-
};
|
28666
|
-
var URI = function () {
|
28667
|
-
function URI(url, settings) {
|
28668
|
-
url = trim(url);
|
28669
|
-
this.settings = settings || {};
|
28670
|
-
var baseUri = this.settings.base_uri;
|
28671
|
-
var self = this;
|
28672
|
-
if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
|
28673
|
-
self.source = url;
|
28674
|
-
return;
|
28675
|
-
}
|
28676
|
-
var isProtocolRelative = url.indexOf('//') === 0;
|
28677
|
-
if (url.indexOf('/') === 0 && !isProtocolRelative) {
|
28678
|
-
url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
|
28679
|
-
}
|
28680
|
-
if (!/^[\w\-]*:?\/\//.test(url)) {
|
28681
|
-
var baseUrl = this.settings.base_uri ? this.settings.base_uri.path : new URI(document.location.href).directory;
|
28682
|
-
if (this.settings.base_uri && this.settings.base_uri.protocol == '') {
|
28683
|
-
url = '//mce_host' + self.toAbsPath(baseUrl, url);
|
28684
|
-
} else {
|
28685
|
-
var match = /([^#?]*)([#?]?.*)/.exec(url);
|
28686
|
-
url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self.toAbsPath(baseUrl, match[1]) + match[2];
|
28687
|
-
}
|
28688
|
-
}
|
28689
|
-
url = url.replace(/@@/g, '(mce_at)');
|
28690
|
-
var urlMatch = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
|
28691
|
-
each$3(queryParts, function (v, i) {
|
28692
|
-
var part = urlMatch[i];
|
28693
|
-
if (part) {
|
28694
|
-
part = part.replace(/\(mce_at\)/g, '@@');
|
28695
|
-
}
|
28696
|
-
self[v] = part;
|
28697
|
-
});
|
28698
|
-
if (baseUri) {
|
28699
|
-
if (!self.protocol) {
|
28700
|
-
self.protocol = baseUri.protocol;
|
28701
|
-
}
|
28702
|
-
if (!self.userInfo) {
|
28703
|
-
self.userInfo = baseUri.userInfo;
|
28704
|
-
}
|
28705
|
-
if (!self.port && self.host === 'mce_host') {
|
28706
|
-
self.port = baseUri.port;
|
28707
|
-
}
|
28708
|
-
if (!self.host || self.host === 'mce_host') {
|
28709
|
-
self.host = baseUri.host;
|
28710
|
-
}
|
28711
|
-
self.source = '';
|
28712
|
-
}
|
28713
|
-
if (isProtocolRelative) {
|
28714
|
-
self.protocol = '';
|
28715
|
-
}
|
28716
|
-
}
|
28717
|
-
URI.parseDataUri = function (uri) {
|
28718
|
-
var type;
|
28719
|
-
var uriComponents = decodeURIComponent(uri).split(',');
|
28720
|
-
var matches = /data:([^;]+)/.exec(uriComponents[0]);
|
28721
|
-
if (matches) {
|
28722
|
-
type = matches[1];
|
28723
|
-
}
|
28724
|
-
return {
|
28725
|
-
type: type,
|
28726
|
-
data: uriComponents[1]
|
28727
|
-
};
|
28728
|
-
};
|
28729
|
-
URI.getDocumentBaseUrl = function (loc) {
|
28730
|
-
var baseUrl;
|
28731
|
-
if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') {
|
28732
|
-
baseUrl = loc.href;
|
28733
|
-
} else {
|
28734
|
-
baseUrl = loc.protocol + '//' + loc.host + loc.pathname;
|
28735
|
-
}
|
28736
|
-
if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) {
|
28737
|
-
baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
|
28738
|
-
if (!/[\/\\]$/.test(baseUrl)) {
|
28739
|
-
baseUrl += '/';
|
28740
|
-
}
|
28741
|
-
}
|
28742
|
-
return baseUrl;
|
28743
|
-
};
|
28744
|
-
URI.prototype.setPath = function (path) {
|
28745
|
-
var pathMatch = /^(.*?)\/?(\w+)?$/.exec(path);
|
28746
|
-
this.path = pathMatch[0];
|
28747
|
-
this.directory = pathMatch[1];
|
28748
|
-
this.file = pathMatch[2];
|
28749
|
-
this.source = '';
|
28750
|
-
this.getURI();
|
28751
|
-
};
|
28752
|
-
URI.prototype.toRelative = function (uri) {
|
28753
|
-
var output;
|
28754
|
-
if (uri === './') {
|
28755
|
-
return uri;
|
28756
|
-
}
|
28757
|
-
var relativeUri = new URI(uri, { base_uri: this });
|
28758
|
-
if (relativeUri.host !== 'mce_host' && this.host !== relativeUri.host && relativeUri.host || this.port !== relativeUri.port || this.protocol !== relativeUri.protocol && relativeUri.protocol !== '') {
|
28759
|
-
return relativeUri.getURI();
|
28760
|
-
}
|
28761
|
-
var tu = this.getURI(), uu = relativeUri.getURI();
|
28762
|
-
if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) {
|
28763
|
-
return tu;
|
28764
|
-
}
|
28765
|
-
output = this.toRelPath(this.path, relativeUri.path);
|
28766
|
-
if (relativeUri.query) {
|
28767
|
-
output += '?' + relativeUri.query;
|
28768
|
-
}
|
28769
|
-
if (relativeUri.anchor) {
|
28770
|
-
output += '#' + relativeUri.anchor;
|
28771
|
-
}
|
28772
|
-
return output;
|
28773
|
-
};
|
28774
|
-
URI.prototype.toAbsolute = function (uri, noHost) {
|
28775
|
-
var absoluteUri = new URI(uri, { base_uri: this });
|
28776
|
-
return absoluteUri.getURI(noHost && this.isSameOrigin(absoluteUri));
|
28777
|
-
};
|
28778
|
-
URI.prototype.isSameOrigin = function (uri) {
|
28779
|
-
if (this.host == uri.host && this.protocol == uri.protocol) {
|
28780
|
-
if (this.port == uri.port) {
|
28781
|
-
return true;
|
28782
|
-
}
|
28783
|
-
var defaultPort = DEFAULT_PORTS[this.protocol];
|
28784
|
-
if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) {
|
28785
|
-
return true;
|
28786
|
-
}
|
28787
|
-
}
|
28788
|
-
return false;
|
28789
|
-
};
|
28790
|
-
URI.prototype.toRelPath = function (base, path) {
|
28791
|
-
var breakPoint = 0, out = '', i, l;
|
28792
|
-
var normalizedBase = base.substring(0, base.lastIndexOf('/')).split('/');
|
28793
|
-
var items = path.split('/');
|
28794
|
-
if (normalizedBase.length >= items.length) {
|
28795
|
-
for (i = 0, l = normalizedBase.length; i < l; i++) {
|
28796
|
-
if (i >= items.length || normalizedBase[i] !== items[i]) {
|
28797
|
-
breakPoint = i + 1;
|
28798
|
-
break;
|
28799
|
-
}
|
28800
|
-
}
|
28801
|
-
}
|
28802
|
-
if (normalizedBase.length < items.length) {
|
28803
|
-
for (i = 0, l = items.length; i < l; i++) {
|
28804
|
-
if (i >= normalizedBase.length || normalizedBase[i] !== items[i]) {
|
28805
|
-
breakPoint = i + 1;
|
28806
|
-
break;
|
28807
|
-
}
|
28808
|
-
}
|
28809
|
-
}
|
28810
|
-
if (breakPoint === 1) {
|
28811
|
-
return path;
|
28812
|
-
}
|
28813
|
-
for (i = 0, l = normalizedBase.length - (breakPoint - 1); i < l; i++) {
|
28814
|
-
out += '../';
|
28815
|
-
}
|
28816
|
-
for (i = breakPoint - 1, l = items.length; i < l; i++) {
|
28817
|
-
if (i !== breakPoint - 1) {
|
28818
|
-
out += '/' + items[i];
|
28819
|
-
} else {
|
28820
|
-
out += items[i];
|
28821
|
-
}
|
28822
|
-
}
|
28823
|
-
return out;
|
28824
|
-
};
|
28825
|
-
URI.prototype.toAbsPath = function (base, path) {
|
28826
|
-
var i, nb = 0, o = [], outPath;
|
28827
|
-
var tr = /\/$/.test(path) ? '/' : '';
|
28828
|
-
var normalizedBase = base.split('/');
|
28829
|
-
var normalizedPath = path.split('/');
|
28830
|
-
each$3(normalizedBase, function (k) {
|
28831
|
-
if (k) {
|
28832
|
-
o.push(k);
|
28833
|
-
}
|
28834
|
-
});
|
28835
|
-
normalizedBase = o;
|
28836
|
-
for (i = normalizedPath.length - 1, o = []; i >= 0; i--) {
|
28837
|
-
if (normalizedPath[i].length === 0 || normalizedPath[i] === '.') {
|
28838
|
-
continue;
|
28839
|
-
}
|
28840
|
-
if (normalizedPath[i] === '..') {
|
28841
|
-
nb++;
|
28842
|
-
continue;
|
28843
|
-
}
|
28844
|
-
if (nb > 0) {
|
28845
|
-
nb--;
|
28846
|
-
continue;
|
28847
|
-
}
|
28848
|
-
o.push(normalizedPath[i]);
|
28849
|
-
}
|
28850
|
-
i = normalizedBase.length - nb;
|
28851
|
-
if (i <= 0) {
|
28852
|
-
outPath = reverse(o).join('/');
|
28853
|
-
} else {
|
28854
|
-
outPath = normalizedBase.slice(0, i).join('/') + '/' + reverse(o).join('/');
|
28855
|
-
}
|
28856
|
-
if (outPath.indexOf('/') !== 0) {
|
28857
|
-
outPath = '/' + outPath;
|
28858
|
-
}
|
28859
|
-
if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
|
28860
|
-
outPath += tr;
|
28861
|
-
}
|
28862
|
-
return outPath;
|
28863
|
-
};
|
28864
|
-
URI.prototype.getURI = function (noProtoHost) {
|
28865
|
-
if (noProtoHost === void 0) {
|
28866
|
-
noProtoHost = false;
|
28867
|
-
}
|
28868
|
-
var s;
|
28869
|
-
if (!this.source || noProtoHost) {
|
28870
|
-
s = '';
|
28871
|
-
if (!noProtoHost) {
|
28872
|
-
if (this.protocol) {
|
28873
|
-
s += this.protocol + '://';
|
28874
|
-
} else {
|
28875
|
-
s += '//';
|
28876
|
-
}
|
28877
|
-
if (this.userInfo) {
|
28878
|
-
s += this.userInfo + '@';
|
28879
|
-
}
|
28880
|
-
if (this.host) {
|
28881
|
-
s += this.host;
|
28882
|
-
}
|
28883
|
-
if (this.port) {
|
28884
|
-
s += ':' + this.port;
|
28885
|
-
}
|
28886
|
-
}
|
28887
|
-
if (this.path) {
|
28888
|
-
s += this.path;
|
28889
|
-
}
|
28890
|
-
if (this.query) {
|
28891
|
-
s += '?' + this.query;
|
28892
|
-
}
|
28893
|
-
if (this.anchor) {
|
28894
|
-
s += '#' + this.anchor;
|
28895
|
-
}
|
28896
|
-
this.source = s;
|
28897
|
-
}
|
28898
|
-
return this.source;
|
28899
|
-
};
|
28900
|
-
return URI;
|
28901
|
-
}();
|
28902
|
-
|
28903
28577
|
var DOM$1 = DOMUtils.DOM;
|
28904
28578
|
var extend$3 = Tools.extend, each$2 = Tools.each;
|
28905
28579
|
var resolve = Tools.resolve;
|
@@ -29327,8 +29001,8 @@
|
|
29327
29001
|
suffix: null,
|
29328
29002
|
$: DomQuery,
|
29329
29003
|
majorVersion: '5',
|
29330
|
-
minorVersion: '
|
29331
|
-
releaseDate: '2021-
|
29004
|
+
minorVersion: '10.1',
|
29005
|
+
releaseDate: '2021-11-03',
|
29332
29006
|
editors: legacyEditors,
|
29333
29007
|
i18n: I18n,
|
29334
29008
|
activeEditor: null,
|