@dangl/angular-material-shared 1.2.1-beta0003 → 1.2.1-beta0013
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tinymce-assets/plugins/advlist/plugin.js +1 -1
- package/tinymce-assets/plugins/advlist/plugin.min.js +1 -1
- package/tinymce-assets/plugins/anchor/plugin.js +1 -1
- package/tinymce-assets/plugins/anchor/plugin.min.js +1 -1
- package/tinymce-assets/plugins/autolink/plugin.js +1 -1
- package/tinymce-assets/plugins/autolink/plugin.min.js +1 -1
- package/tinymce-assets/plugins/autoresize/plugin.js +15 -7
- package/tinymce-assets/plugins/autoresize/plugin.min.js +2 -2
- package/tinymce-assets/plugins/autosave/plugin.js +1 -1
- package/tinymce-assets/plugins/autosave/plugin.min.js +1 -1
- package/tinymce-assets/plugins/bbcode/plugin.js +1 -2
- package/tinymce-assets/plugins/bbcode/plugin.min.js +2 -2
- package/tinymce-assets/plugins/charmap/plugin.js +1 -1
- package/tinymce-assets/plugins/charmap/plugin.min.js +1 -1
- package/tinymce-assets/plugins/code/plugin.js +1 -1
- package/tinymce-assets/plugins/code/plugin.min.js +1 -1
- package/tinymce-assets/plugins/codesample/plugin.js +1887 -2006
- package/tinymce-assets/plugins/codesample/plugin.min.js +2 -2
- package/tinymce-assets/plugins/colorpicker/plugin.js +1 -2
- package/tinymce-assets/plugins/colorpicker/plugin.min.js +2 -2
- package/tinymce-assets/plugins/contextmenu/plugin.js +1 -2
- package/tinymce-assets/plugins/contextmenu/plugin.min.js +2 -2
- package/tinymce-assets/plugins/directionality/plugin.js +1 -1
- package/tinymce-assets/plugins/directionality/plugin.min.js +1 -1
- package/tinymce-assets/plugins/emoticons/plugin.js +1 -1
- package/tinymce-assets/plugins/emoticons/plugin.min.js +1 -1
- package/tinymce-assets/plugins/fullpage/plugin.js +1 -2
- package/tinymce-assets/plugins/fullpage/plugin.min.js +2 -2
- package/tinymce-assets/plugins/fullscreen/plugin.js +385 -2
- package/tinymce-assets/plugins/fullscreen/plugin.min.js +2 -2
- package/tinymce-assets/plugins/help/plugin.js +68 -75
- package/tinymce-assets/plugins/help/plugin.min.js +2 -2
- package/tinymce-assets/plugins/hr/plugin.js +1 -1
- package/tinymce-assets/plugins/hr/plugin.min.js +1 -1
- package/tinymce-assets/plugins/image/plugin.js +38 -20
- package/tinymce-assets/plugins/image/plugin.min.js +2 -2
- package/tinymce-assets/plugins/imagetools/plugin.js +229 -195
- package/tinymce-assets/plugins/imagetools/plugin.min.js +2 -2
- package/tinymce-assets/plugins/importcss/plugin.js +1 -1
- package/tinymce-assets/plugins/importcss/plugin.min.js +1 -1
- package/tinymce-assets/plugins/insertdatetime/plugin.js +11 -8
- package/tinymce-assets/plugins/insertdatetime/plugin.min.js +2 -2
- package/tinymce-assets/plugins/legacyoutput/plugin.js +1 -2
- package/tinymce-assets/plugins/legacyoutput/plugin.min.js +2 -2
- package/tinymce-assets/plugins/link/plugin.js +20 -13
- package/tinymce-assets/plugins/link/plugin.min.js +2 -2
- package/tinymce-assets/plugins/lists/plugin.js +2 -2
- package/tinymce-assets/plugins/lists/plugin.min.js +2 -2
- package/tinymce-assets/plugins/media/plugin.js +43 -48
- package/tinymce-assets/plugins/media/plugin.min.js +2 -2
- package/tinymce-assets/plugins/nonbreaking/plugin.js +1 -1
- package/tinymce-assets/plugins/nonbreaking/plugin.min.js +1 -1
- package/tinymce-assets/plugins/noneditable/plugin.js +1 -1
- package/tinymce-assets/plugins/noneditable/plugin.min.js +1 -1
- package/tinymce-assets/plugins/pagebreak/plugin.js +1 -1
- package/tinymce-assets/plugins/pagebreak/plugin.min.js +1 -1
- package/tinymce-assets/plugins/paste/plugin.js +35 -3
- package/tinymce-assets/plugins/paste/plugin.min.js +2 -2
- package/tinymce-assets/plugins/preview/plugin.js +1 -1
- package/tinymce-assets/plugins/preview/plugin.min.js +1 -1
- package/tinymce-assets/plugins/print/plugin.js +1 -1
- package/tinymce-assets/plugins/print/plugin.min.js +1 -1
- package/tinymce-assets/plugins/quickbars/plugin.js +1 -1
- package/tinymce-assets/plugins/quickbars/plugin.min.js +1 -1
- package/tinymce-assets/plugins/save/plugin.js +1 -1
- package/tinymce-assets/plugins/save/plugin.min.js +1 -1
- package/tinymce-assets/plugins/searchreplace/plugin.js +1 -1
- package/tinymce-assets/plugins/searchreplace/plugin.min.js +1 -1
- package/tinymce-assets/plugins/spellchecker/plugin.js +1 -2
- package/tinymce-assets/plugins/spellchecker/plugin.min.js +2 -2
- package/tinymce-assets/plugins/tabfocus/plugin.js +1 -1
- package/tinymce-assets/plugins/tabfocus/plugin.min.js +1 -1
- package/tinymce-assets/plugins/table/plugin.js +456 -381
- package/tinymce-assets/plugins/table/plugin.min.js +2 -2
- package/tinymce-assets/plugins/template/plugin.js +1 -1
- package/tinymce-assets/plugins/template/plugin.min.js +1 -1
- package/tinymce-assets/plugins/textcolor/plugin.js +1 -2
- package/tinymce-assets/plugins/textcolor/plugin.min.js +2 -2
- package/tinymce-assets/plugins/textpattern/plugin.js +2 -2
- package/tinymce-assets/plugins/textpattern/plugin.min.js +2 -2
- package/tinymce-assets/plugins/toc/plugin.js +1 -1
- package/tinymce-assets/plugins/toc/plugin.min.js +1 -1
- package/tinymce-assets/plugins/visualblocks/plugin.js +1 -1
- package/tinymce-assets/plugins/visualblocks/plugin.min.js +1 -1
- package/tinymce-assets/plugins/visualchars/plugin.js +1 -1
- package/tinymce-assets/plugins/visualchars/plugin.min.js +1 -1
- package/tinymce-assets/plugins/wordcount/plugin.js +1 -1
- package/tinymce-assets/plugins/wordcount/plugin.min.js +1 -1
- package/tinymce-assets/skins/ui/oxide/content.css +1 -1
- package/tinymce-assets/skins/ui/oxide/content.inline.css +1 -1
- package/tinymce-assets/skins/ui/oxide/content.inline.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide/content.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide/skin.css +7 -7
- package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide/skin.shadowdom.css +7 -7
- package/tinymce-assets/skins/ui/oxide/skin.shadowdom.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.css +7 -7
- package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.css +7 -7
- package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -1
- package/tinymce-assets/themes/mobile/theme.js +225 -700
- package/tinymce-assets/themes/mobile/theme.min.js +2 -2
- package/tinymce-assets/themes/silver/theme.js +3224 -3686
- package/tinymce-assets/themes/silver/theme.min.js +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.0 (2021-10-11)
|
|
8
8
|
*/
|
|
9
9
|
(function () {
|
|
10
10
|
'use strict';
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
var global$
|
|
26
|
+
var global$5 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
27
27
|
|
|
28
|
-
var global$
|
|
28
|
+
var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
29
29
|
|
|
30
30
|
var typeOf = function (x) {
|
|
31
31
|
var t = typeof x;
|
|
@@ -160,6 +160,221 @@
|
|
|
160
160
|
from: from
|
|
161
161
|
};
|
|
162
162
|
|
|
163
|
+
var exports$1 = {}, module = { exports: exports$1 };
|
|
164
|
+
(function (define, exports, module, require) {
|
|
165
|
+
(function (global, factory) {
|
|
166
|
+
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());
|
|
167
|
+
}(this, function () {
|
|
168
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
169
|
+
var promise = { exports: {} };
|
|
170
|
+
(function (module) {
|
|
171
|
+
(function (root) {
|
|
172
|
+
var setTimeoutFunc = setTimeout;
|
|
173
|
+
function noop() {
|
|
174
|
+
}
|
|
175
|
+
function bind(fn, thisArg) {
|
|
176
|
+
return function () {
|
|
177
|
+
fn.apply(thisArg, arguments);
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function Promise(fn) {
|
|
181
|
+
if (typeof this !== 'object')
|
|
182
|
+
throw new TypeError('Promises must be constructed via new');
|
|
183
|
+
if (typeof fn !== 'function')
|
|
184
|
+
throw new TypeError('not a function');
|
|
185
|
+
this._state = 0;
|
|
186
|
+
this._handled = false;
|
|
187
|
+
this._value = undefined;
|
|
188
|
+
this._deferreds = [];
|
|
189
|
+
doResolve(fn, this);
|
|
190
|
+
}
|
|
191
|
+
function handle(self, deferred) {
|
|
192
|
+
while (self._state === 3) {
|
|
193
|
+
self = self._value;
|
|
194
|
+
}
|
|
195
|
+
if (self._state === 0) {
|
|
196
|
+
self._deferreds.push(deferred);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
self._handled = true;
|
|
200
|
+
Promise._immediateFn(function () {
|
|
201
|
+
var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
|
|
202
|
+
if (cb === null) {
|
|
203
|
+
(self._state === 1 ? resolve : reject)(deferred.promise, self._value);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
var ret;
|
|
207
|
+
try {
|
|
208
|
+
ret = cb(self._value);
|
|
209
|
+
} catch (e) {
|
|
210
|
+
reject(deferred.promise, e);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
resolve(deferred.promise, ret);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
function resolve(self, newValue) {
|
|
217
|
+
try {
|
|
218
|
+
if (newValue === self)
|
|
219
|
+
throw new TypeError('A promise cannot be resolved with itself.');
|
|
220
|
+
if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
|
|
221
|
+
var then = newValue.then;
|
|
222
|
+
if (newValue instanceof Promise) {
|
|
223
|
+
self._state = 3;
|
|
224
|
+
self._value = newValue;
|
|
225
|
+
finale(self);
|
|
226
|
+
return;
|
|
227
|
+
} else if (typeof then === 'function') {
|
|
228
|
+
doResolve(bind(then, newValue), self);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
self._state = 1;
|
|
233
|
+
self._value = newValue;
|
|
234
|
+
finale(self);
|
|
235
|
+
} catch (e) {
|
|
236
|
+
reject(self, e);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function reject(self, newValue) {
|
|
240
|
+
self._state = 2;
|
|
241
|
+
self._value = newValue;
|
|
242
|
+
finale(self);
|
|
243
|
+
}
|
|
244
|
+
function finale(self) {
|
|
245
|
+
if (self._state === 2 && self._deferreds.length === 0) {
|
|
246
|
+
Promise._immediateFn(function () {
|
|
247
|
+
if (!self._handled) {
|
|
248
|
+
Promise._unhandledRejectionFn(self._value);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
for (var i = 0, len = self._deferreds.length; i < len; i++) {
|
|
253
|
+
handle(self, self._deferreds[i]);
|
|
254
|
+
}
|
|
255
|
+
self._deferreds = null;
|
|
256
|
+
}
|
|
257
|
+
function Handler(onFulfilled, onRejected, promise) {
|
|
258
|
+
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
|
|
259
|
+
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
|
|
260
|
+
this.promise = promise;
|
|
261
|
+
}
|
|
262
|
+
function doResolve(fn, self) {
|
|
263
|
+
var done = false;
|
|
264
|
+
try {
|
|
265
|
+
fn(function (value) {
|
|
266
|
+
if (done)
|
|
267
|
+
return;
|
|
268
|
+
done = true;
|
|
269
|
+
resolve(self, value);
|
|
270
|
+
}, function (reason) {
|
|
271
|
+
if (done)
|
|
272
|
+
return;
|
|
273
|
+
done = true;
|
|
274
|
+
reject(self, reason);
|
|
275
|
+
});
|
|
276
|
+
} catch (ex) {
|
|
277
|
+
if (done)
|
|
278
|
+
return;
|
|
279
|
+
done = true;
|
|
280
|
+
reject(self, ex);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
Promise.prototype['catch'] = function (onRejected) {
|
|
284
|
+
return this.then(null, onRejected);
|
|
285
|
+
};
|
|
286
|
+
Promise.prototype.then = function (onFulfilled, onRejected) {
|
|
287
|
+
var prom = new this.constructor(noop);
|
|
288
|
+
handle(this, new Handler(onFulfilled, onRejected, prom));
|
|
289
|
+
return prom;
|
|
290
|
+
};
|
|
291
|
+
Promise.all = function (arr) {
|
|
292
|
+
var args = Array.prototype.slice.call(arr);
|
|
293
|
+
return new Promise(function (resolve, reject) {
|
|
294
|
+
if (args.length === 0)
|
|
295
|
+
return resolve([]);
|
|
296
|
+
var remaining = args.length;
|
|
297
|
+
function res(i, val) {
|
|
298
|
+
try {
|
|
299
|
+
if (val && (typeof val === 'object' || typeof val === 'function')) {
|
|
300
|
+
var then = val.then;
|
|
301
|
+
if (typeof then === 'function') {
|
|
302
|
+
then.call(val, function (val) {
|
|
303
|
+
res(i, val);
|
|
304
|
+
}, reject);
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
args[i] = val;
|
|
309
|
+
if (--remaining === 0) {
|
|
310
|
+
resolve(args);
|
|
311
|
+
}
|
|
312
|
+
} catch (ex) {
|
|
313
|
+
reject(ex);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
for (var i = 0; i < args.length; i++) {
|
|
317
|
+
res(i, args[i]);
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
Promise.resolve = function (value) {
|
|
322
|
+
if (value && typeof value === 'object' && value.constructor === Promise) {
|
|
323
|
+
return value;
|
|
324
|
+
}
|
|
325
|
+
return new Promise(function (resolve) {
|
|
326
|
+
resolve(value);
|
|
327
|
+
});
|
|
328
|
+
};
|
|
329
|
+
Promise.reject = function (value) {
|
|
330
|
+
return new Promise(function (resolve, reject) {
|
|
331
|
+
reject(value);
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
Promise.race = function (values) {
|
|
335
|
+
return new Promise(function (resolve, reject) {
|
|
336
|
+
for (var i = 0, len = values.length; i < len; i++) {
|
|
337
|
+
values[i].then(resolve, reject);
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
};
|
|
341
|
+
Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) {
|
|
342
|
+
setImmediate(fn);
|
|
343
|
+
} : function (fn) {
|
|
344
|
+
setTimeoutFunc(fn, 0);
|
|
345
|
+
};
|
|
346
|
+
Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
|
|
347
|
+
if (typeof console !== 'undefined' && console) {
|
|
348
|
+
console.warn('Possible Unhandled Promise Rejection:', err);
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
Promise._setImmediateFn = function _setImmediateFn(fn) {
|
|
352
|
+
Promise._immediateFn = fn;
|
|
353
|
+
};
|
|
354
|
+
Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
|
|
355
|
+
Promise._unhandledRejectionFn = fn;
|
|
356
|
+
};
|
|
357
|
+
if (module.exports) {
|
|
358
|
+
module.exports = Promise;
|
|
359
|
+
} else if (!root.Promise) {
|
|
360
|
+
root.Promise = Promise;
|
|
361
|
+
}
|
|
362
|
+
}(commonjsGlobal));
|
|
363
|
+
}(promise));
|
|
364
|
+
var promisePolyfill = promise.exports;
|
|
365
|
+
var Global = function () {
|
|
366
|
+
if (typeof window !== 'undefined') {
|
|
367
|
+
return window;
|
|
368
|
+
} else {
|
|
369
|
+
return Function('return this;')();
|
|
370
|
+
}
|
|
371
|
+
}();
|
|
372
|
+
var promisePolyfill_1 = { boltExport: Global.Promise || promisePolyfill };
|
|
373
|
+
return promisePolyfill_1;
|
|
374
|
+
}));
|
|
375
|
+
}(undefined, exports$1, module));
|
|
376
|
+
var Promise$1 = module.exports.boltExport;
|
|
377
|
+
|
|
163
378
|
var create$1 = function (width, height) {
|
|
164
379
|
return resize(document.createElement('canvas'), width, height);
|
|
165
380
|
};
|
|
@@ -185,187 +400,6 @@
|
|
|
185
400
|
return image.naturalHeight || image.height;
|
|
186
401
|
};
|
|
187
402
|
|
|
188
|
-
var promise = function () {
|
|
189
|
-
var Promise = function (fn) {
|
|
190
|
-
if (typeof this !== 'object') {
|
|
191
|
-
throw new TypeError('Promises must be constructed via new');
|
|
192
|
-
}
|
|
193
|
-
if (typeof fn !== 'function') {
|
|
194
|
-
throw new TypeError('not a function');
|
|
195
|
-
}
|
|
196
|
-
this._state = null;
|
|
197
|
-
this._value = null;
|
|
198
|
-
this._deferreds = [];
|
|
199
|
-
doResolve(fn, bind(resolve, this), bind(reject, this));
|
|
200
|
-
};
|
|
201
|
-
var anyWindow = window;
|
|
202
|
-
var asap = Promise.immediateFn || typeof anyWindow.setImmediate === 'function' && anyWindow.setImmediate || function (fn) {
|
|
203
|
-
return setTimeout(fn, 1);
|
|
204
|
-
};
|
|
205
|
-
var bind = function (fn, thisArg) {
|
|
206
|
-
return function () {
|
|
207
|
-
var args = [];
|
|
208
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
209
|
-
args[_i] = arguments[_i];
|
|
210
|
-
}
|
|
211
|
-
return fn.apply(thisArg, args);
|
|
212
|
-
};
|
|
213
|
-
};
|
|
214
|
-
var isArray = Array.isArray || function (value) {
|
|
215
|
-
return Object.prototype.toString.call(value) === '[object Array]';
|
|
216
|
-
};
|
|
217
|
-
function handle(deferred) {
|
|
218
|
-
var me = this;
|
|
219
|
-
if (this._state === null) {
|
|
220
|
-
this._deferreds.push(deferred);
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
asap(function () {
|
|
224
|
-
var cb = me._state ? deferred.onFulfilled : deferred.onRejected;
|
|
225
|
-
if (cb === null) {
|
|
226
|
-
(me._state ? deferred.resolve : deferred.reject)(me._value);
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
var ret;
|
|
230
|
-
try {
|
|
231
|
-
ret = cb(me._value);
|
|
232
|
-
} catch (e) {
|
|
233
|
-
deferred.reject(e);
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
deferred.resolve(ret);
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
function resolve(newValue) {
|
|
240
|
-
try {
|
|
241
|
-
if (newValue === this) {
|
|
242
|
-
throw new TypeError('A promise cannot be resolved with itself.');
|
|
243
|
-
}
|
|
244
|
-
if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
|
|
245
|
-
var then = newValue.then;
|
|
246
|
-
if (typeof then === 'function') {
|
|
247
|
-
doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this));
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
this._state = true;
|
|
252
|
-
this._value = newValue;
|
|
253
|
-
finale.call(this);
|
|
254
|
-
} catch (e) {
|
|
255
|
-
reject.call(this, e);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
function reject(newValue) {
|
|
259
|
-
this._state = false;
|
|
260
|
-
this._value = newValue;
|
|
261
|
-
finale.call(this);
|
|
262
|
-
}
|
|
263
|
-
function finale() {
|
|
264
|
-
for (var _i = 0, _a = this._deferreds; _i < _a.length; _i++) {
|
|
265
|
-
var deferred = _a[_i];
|
|
266
|
-
handle.call(this, deferred);
|
|
267
|
-
}
|
|
268
|
-
this._deferreds = [];
|
|
269
|
-
}
|
|
270
|
-
function Handler(onFulfilled, onRejected, resolve, reject) {
|
|
271
|
-
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
|
|
272
|
-
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
|
|
273
|
-
this.resolve = resolve;
|
|
274
|
-
this.reject = reject;
|
|
275
|
-
}
|
|
276
|
-
var doResolve = function (fn, onFulfilled, onRejected) {
|
|
277
|
-
var done = false;
|
|
278
|
-
try {
|
|
279
|
-
fn(function (value) {
|
|
280
|
-
if (done) {
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
done = true;
|
|
284
|
-
onFulfilled(value);
|
|
285
|
-
}, function (reason) {
|
|
286
|
-
if (done) {
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
done = true;
|
|
290
|
-
onRejected(reason);
|
|
291
|
-
});
|
|
292
|
-
} catch (ex) {
|
|
293
|
-
if (done) {
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
done = true;
|
|
297
|
-
onRejected(ex);
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
Promise.prototype.catch = function (onRejected) {
|
|
301
|
-
return this.then(null, onRejected);
|
|
302
|
-
};
|
|
303
|
-
Promise.prototype.then = function (onFulfilled, onRejected) {
|
|
304
|
-
var me = this;
|
|
305
|
-
return new Promise(function (resolve, reject) {
|
|
306
|
-
handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject));
|
|
307
|
-
});
|
|
308
|
-
};
|
|
309
|
-
Promise.all = function () {
|
|
310
|
-
var values = [];
|
|
311
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
312
|
-
values[_i] = arguments[_i];
|
|
313
|
-
}
|
|
314
|
-
var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values);
|
|
315
|
-
return new Promise(function (resolve, reject) {
|
|
316
|
-
if (args.length === 0) {
|
|
317
|
-
return resolve([]);
|
|
318
|
-
}
|
|
319
|
-
var remaining = args.length;
|
|
320
|
-
var res = function (i, val) {
|
|
321
|
-
try {
|
|
322
|
-
if (val && (typeof val === 'object' || typeof val === 'function')) {
|
|
323
|
-
var then = val.then;
|
|
324
|
-
if (typeof then === 'function') {
|
|
325
|
-
then.call(val, function (val) {
|
|
326
|
-
res(i, val);
|
|
327
|
-
}, reject);
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
args[i] = val;
|
|
332
|
-
if (--remaining === 0) {
|
|
333
|
-
resolve(args);
|
|
334
|
-
}
|
|
335
|
-
} catch (ex) {
|
|
336
|
-
reject(ex);
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
for (var i = 0; i < args.length; i++) {
|
|
340
|
-
res(i, args[i]);
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
};
|
|
344
|
-
Promise.resolve = function (value) {
|
|
345
|
-
if (value && typeof value === 'object' && value.constructor === Promise) {
|
|
346
|
-
return value;
|
|
347
|
-
}
|
|
348
|
-
return new Promise(function (resolve) {
|
|
349
|
-
resolve(value);
|
|
350
|
-
});
|
|
351
|
-
};
|
|
352
|
-
Promise.reject = function (reason) {
|
|
353
|
-
return new Promise(function (resolve, reject) {
|
|
354
|
-
reject(reason);
|
|
355
|
-
});
|
|
356
|
-
};
|
|
357
|
-
Promise.race = function (values) {
|
|
358
|
-
return new Promise(function (resolve, reject) {
|
|
359
|
-
for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {
|
|
360
|
-
var value = values_1[_i];
|
|
361
|
-
value.then(resolve, reject);
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
};
|
|
365
|
-
return Promise;
|
|
366
|
-
};
|
|
367
|
-
var Promise$1 = window.Promise ? window.Promise : promise();
|
|
368
|
-
|
|
369
403
|
var imageToBlob$2 = function (image) {
|
|
370
404
|
var src = image.src;
|
|
371
405
|
if (src.indexOf('data:') === 0) {
|
|
@@ -1004,11 +1038,11 @@
|
|
|
1004
1038
|
});
|
|
1005
1039
|
};
|
|
1006
1040
|
|
|
1007
|
-
var global$
|
|
1041
|
+
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
|
1008
1042
|
|
|
1009
|
-
var global$
|
|
1043
|
+
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Promise');
|
|
1010
1044
|
|
|
1011
|
-
var global = tinymce.util.Tools.resolve('tinymce.util.URI');
|
|
1045
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.util.URI');
|
|
1012
1046
|
|
|
1013
1047
|
var getToolbarItems = function (editor) {
|
|
1014
1048
|
return editor.getParam('imagetools_toolbar', 'rotateleft rotateright flipv fliph editimage imageoptions');
|
|
@@ -1134,13 +1168,13 @@
|
|
|
1134
1168
|
};
|
|
1135
1169
|
var isLocalImage = function (editor, img) {
|
|
1136
1170
|
var url = img.src;
|
|
1137
|
-
return url.indexOf('data:') === 0 || url.indexOf('blob:') === 0 || new global(url).host === editor.documentBaseURI.host;
|
|
1171
|
+
return url.indexOf('data:') === 0 || url.indexOf('blob:') === 0 || new global$1(url).host === editor.documentBaseURI.host;
|
|
1138
1172
|
};
|
|
1139
1173
|
var isCorsImage = function (editor, img) {
|
|
1140
|
-
return global$
|
|
1174
|
+
return global$4.inArray(getCorsHosts(editor), new global$1(img.src).host) !== -1;
|
|
1141
1175
|
};
|
|
1142
1176
|
var isCorsWithCredentialsImage = function (editor, img) {
|
|
1143
|
-
return global$
|
|
1177
|
+
return global$4.inArray(getCredentialsHosts(editor), new global$1(img.src).host) !== -1;
|
|
1144
1178
|
};
|
|
1145
1179
|
var defaultFetchImage = function (editor, img) {
|
|
1146
1180
|
if (isCorsImage(editor, img)) {
|
|
@@ -1164,18 +1198,18 @@
|
|
|
1164
1198
|
var findBlob = function (editor, img) {
|
|
1165
1199
|
var blobInfo = editor.editorUpload.blobCache.getByUri(img.src);
|
|
1166
1200
|
if (blobInfo) {
|
|
1167
|
-
return global$
|
|
1201
|
+
return global$2.resolve(blobInfo.blob());
|
|
1168
1202
|
}
|
|
1169
1203
|
return imageToBlob(editor, img);
|
|
1170
1204
|
};
|
|
1171
1205
|
var startTimedUpload = function (editor, imageUploadTimerState) {
|
|
1172
|
-
var imageUploadTimer = global$
|
|
1206
|
+
var imageUploadTimer = global$3.setEditorTimeout(editor, function () {
|
|
1173
1207
|
editor.editorUpload.uploadImagesAuto();
|
|
1174
1208
|
}, getUploadTimeout(editor));
|
|
1175
1209
|
imageUploadTimerState.set(imageUploadTimer);
|
|
1176
1210
|
};
|
|
1177
1211
|
var cancelTimedUpload = function (imageUploadTimerState) {
|
|
1178
|
-
global$
|
|
1212
|
+
global$3.clearTimeout(imageUploadTimerState.get());
|
|
1179
1213
|
};
|
|
1180
1214
|
var updateSelectedImage = function (editor, origBlob, ir, uploadImmediately, imageUploadTimerState, selectedImage, size) {
|
|
1181
1215
|
return ir.toBlob().then(function (blob) {
|
|
@@ -1366,7 +1400,7 @@
|
|
|
1366
1400
|
};
|
|
1367
1401
|
|
|
1368
1402
|
var register$2 = function (editor, imageUploadTimerState) {
|
|
1369
|
-
global$
|
|
1403
|
+
global$4.each({
|
|
1370
1404
|
mceImageRotateLeft: rotate(editor, imageUploadTimerState, -90),
|
|
1371
1405
|
mceImageRotateRight: rotate(editor, imageUploadTimerState, 90),
|
|
1372
1406
|
mceImageFlipVertical: flip(editor, imageUploadTimerState, 'v'),
|
|
@@ -1482,7 +1516,7 @@
|
|
|
1482
1516
|
};
|
|
1483
1517
|
|
|
1484
1518
|
function Plugin () {
|
|
1485
|
-
global$
|
|
1519
|
+
global$5.add('imagetools', function (editor) {
|
|
1486
1520
|
var imageUploadTimerState = Cell(0);
|
|
1487
1521
|
var lastSelectedImageState = Cell(null);
|
|
1488
1522
|
register$2(editor, imageUploadTimerState);
|
|
@@ -4,6 +4,6 @@
|
|
|
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.0 (2021-10-11)
|
|
8
8
|
*/
|
|
9
|
-
!function(){"use strict";function c(t){var e=t;return{get:function(){return e},set:function(t){e=t}}}function h(t){return null!=t}function r(){}function i(t){return function(){return t}}function t(t){return t}function e(){return d}function s(t){return n=typeof(e=t),"array"==(null===e?"null":"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n);var e,n}var n,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(t){return typeof t===n},u=i(!(n="function")),f=i(!0),d={fold:function(t,e){return t()},isSome:u,isNone:f,getOr:t,getOrThunk:m,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:t,orThunk:m,map:e,each:r,bind:e,exists:u,forall:f,filter:function(){return d},toArray:function(){return[]},toString:i("none()")};function m(t){return t()}function g(t,e){return _(document.createElement("canvas"),t,e)}function p(t){var e=g(t.width,t.height);return A(e).drawImage(t,0,0),e}var v,y,w,b,E,I=function(n){function t(){return o}function e(t){return t(n)}var r=i(n),o={fold:function(t,e){return e(n)},isSome:f,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return I(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?o:d},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},T={some:I,none:e,from:function(t){return null==t?d:I(t)}},A=function(t){return t.getContext("2d")},_=function(t,e,n){return t.width=e,t.height=n,t},R=window.Promise||(v=window,y=x.immediateFn||"function"==typeof v.setImmediate&&v.setImmediate||function(t){return setTimeout(t,1)},w=function(n,r){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(r,t)}},b=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},E=function(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(t){if(r)return;r=!0,n(t)}},x.prototype.catch=function(t){return this.then(null,t)},x.prototype.then=function(n,r){var o=this;return new x(function(t,e){U.call(o,new O(n,r,t,e))})},x.all=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var u=Array.prototype.slice.call(1===t.length&&b(t[0])?t[0]:t);return new x(function(r,o){if(0===u.length)return r([]);for(var i=u.length,a=function(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){a(e,t)},o)}u[e]=t,0==--i&&r(u)}catch(t){o(t)}},t=0;t<u.length;t++)a(t,u[t])})},x.resolve=function(e){return e&&"object"==typeof e&&e.constructor===x?e:new x(function(t){t(e)})},x.reject=function(n){return new x(function(t,e){e(n)})},x.race=function(o){return new x(function(t,e){for(var n=0,r=o;n<r.length;n++)r[n].then(t,e)})},x);function x(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],E(t,w(j,this),w(S,this))}function U(n){var r=this;null!==this._state?y(function(){var t,e=r._state?n.onFulfilled:n.onRejected;if(null!==e){try{t=e(r._value)}catch(t){return void n.reject(t)}n.resolve(t)}else(r._state?n.resolve:n.reject)(r._value)}):this._deferreds.push(n)}function j(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void E(w(e,t),w(j,this),w(S,this))}this._state=!0,this._value=t,M.call(this)}catch(t){S.call(this,t)}}function S(t){this._state=!1,this._value=t,M.call(this)}function M(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];U.call(this,n)}this._deferreds=[]}function O(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function L(u){return new R(function(t,e){function n(){o.removeEventListener("load",i),o.removeEventListener("error",a)}var r=URL.createObjectURL(u),o=new Image,i=function(){n(),t(o)},a=function(){n(),e("Unable to load data of type "+u.type+": "+r)};o.addEventListener("load",i),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(i,0)})}function k(t,r,o){return r=r||"image/png",a(HTMLCanvasElement.prototype.toBlob)?new R(function(e,n){t.toBlob(function(t){t?e(t):n()},r,o)}):N(t.toDataURL(r,o))}function P(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}function C(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return T.some(i);if(n(i,r))break}return T.none()}(t,e,u)}var B=function(r){return new R(function(t,e){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="blob",n.onload=function(){200===this.status&&t(this.response)},n.onerror=function(){var t;e(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+this.status+" downloading image"))},n.send()})},N=function(h){return new R(function(t,e){!function(){var t=h.split(","),e=/data:([^;]+)/.exec(t[0]);if(!e)return T.none();for(var n=e[1],r=t[1],o=atob(r),i=o.length,a=Math.ceil(i/1024),u=new Array(a),c=0;c<a;++c){for(var s=1024*c,l=Math.min(1024+s,i),f=new Array(l-s),d=s,m=0;d<l;++m,++d)f[m]=o[d].charCodeAt(0);u[c]=new Uint8Array(f)}return T.some(new Blob(u,{type:n}))}().fold(function(){e("uri is not base64: "+h)},t)})},D=function(t){URL.revokeObjectURL(t.src)},F=L,H=Array.prototype.indexOf,z=Object.keys;function q(t,e,n){function r(e,n){return t.then(function(t){return t.toDataURL(e||"image/png",n)})}return{getType:i(e.type),toBlob:function(){return R.resolve(e)},toDataURL:i(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then(function(t){return k(t,e,n)})},toAdjustedDataURL:r,toAdjustedBase64:function(t,e){return r(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(p)}}}function $(e,t){return k(e,t).then(function(t){return q(R.resolve(e),t,e.toDataURL())})}function W(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)}function V(e,n,r){return void 0===r&&(r=!1),new R(function(t){var a=new XMLHttpRequest;a.onreadystatechange=function(){4===a.readyState&&t({status:a.status,blob:a.response})},a.open("GET",e,!0),a.withCredentials=r,function(t){for(var e,n=z(t),r=0,o=n.length;r<o;r++){var i=n[r];e=t[i],a.setRequestHeader(i,e)}}(n),a.responseType="blob",a.send()})}function G(t){var e,n=(e=t,"ImageProxy HTTP error: "+C(rt,function(t){return e===t.code}).fold(i("Unknown ImageProxy error"),function(t){return t.message}));return R.reject(n)}function J(e){return C(ot,function(t){return t.type===e}).fold(i("Unknown service error"),function(t){return t.message})}function K(t){return"ImageProxy Service error: "+function(t){try{return T.some(JSON.parse(t))}catch(t){return T.none()}}(t).bind(function(t){return n=function(t,e){return h(t)?t[e]:void 0},r=t,P(["error","type"],function(t,e){r=n(r,t)}),e=r,T.from(e).map(J);var n,r,e}).getOr("Invalid JSON in service error message")}function X(t){return t<200||300<=t}function Q(t,e){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return V((r=e,o=-1===(n=t).indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)?n:n+o+"apiKey="+encodeURIComponent(r)),i).then(function(t){return X(t.status)?(e=t.status,"application/json"!==(null==(n=t.blob)?void 0:n.type)||400!==e&&403!==e&&404!==e&&500!==e?G(e):(r=n,new R(function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(t){e(t)},n.readAsText(r)}).then(function(t){var e=K(t);return R.reject(e)}))):R.resolve(t.blob);var r,e,n})}function Y(t,e,n){return void 0===n&&(n=!1),e?Q(t,e):V(t,{},n).then(function(t){return X(t.status)?G(t.status):R.resolve(t.blob)})}function Z(e){return n=e,new R(function(t){var e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(n)}).then(function(t){return q(L(e).then(function(t){D(t);var e=g(t.naturalWidth||t.width,t.naturalHeight||t.height);return A(e).drawImage(t,0,0),e}),e,t)});var n}!function(a){if(!s(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};P(a,function(t,r){var e=z(t);if(1!==e.length)throw new Error("one and only one name per case");var i=e[0],o=t[i];if(void 0!==n[i])throw new Error("duplicate key detected:"+i);if("cata"===i)throw new Error("cannot have a case named cata (sorry)");if(!s(o))throw new Error("case arguments must be an array");u.push(i),n[i]=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=n.length;if(e!==o.length)throw new Error("Wrong number of arguments to case "+i+". Expected "+o.length+" ("+o+"), got "+e);return{fold:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+t.length);return t[r].apply(null,n)},match:function(t){var o=z(t);if(u.length!==o.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+o.join(","));if(!function(t){for(var e,n=0,r=t.length;n<r;++n)if(!0!==(e=t[n],function(t,e){return-1<H.call(t,e)}(o,e)))return;return 1}(u))throw new Error("Not all branches were specified when using match. Specified: "+o.join(", ")+"\nRequired: "+u.join(", "));return t[i].apply(null,n)},log:function(t){console.log(t,{constructors:u,constructor:i,params:n})}}}})}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);function tt(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}}var et=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,a=Math.sin(r),u=Math.cos(r),c=W(Math.abs(o*u)+Math.abs(i*a)),s=W(Math.abs(o*a)+Math.abs(i*u)),l=g(c,s),f=A(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),$(l,e)},nt=function(t,e,n){var r=g(t.width,t.height),o=A(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),$(r,e)},rt=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],ot=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],it={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return tt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return tt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return tt(n)},fromDom:tt,fromPoint:function(t,e,n){return T.from(t.dom.elementFromPoint(e,n)).map(tt)}};function at(t){return t.getParam("imagetools_proxy")}function ut(t){function e(t){return/^[0-9\.]+px$/.test(t)}var n=t.style.width,r=t.style.height;return n||r?e(n)&&e(r)?{w:parseInt(n,10),h:parseInt(r,10)}:null:(n=t.width,r=t.height,n&&r?{w:parseInt(n,10),h:parseInt(r,10)}:null)}function ct(t){return{w:t.naturalWidth,h:t.naturalHeight}}function st(t){return e=it.fromDom(t),n="img",r=function(r){return function(t){var e=r.dom;if(1!==e.nodeType)return!1;var n=e;if(void 0!==n.matches)return n.matches(t);if(void 0!==n.msMatchesSelector)return n.msMatchesSelector(t);if(void 0!==n.webkitMatchesSelector)return n.webkitMatchesSelector(t);if(void 0!==n.mozMatchesSelector)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}(n)},C(e.dom.childNodes,function(t){return r(it.fromDom(t))}).map(it.fromDom);var e,n,r}function lt(t,e){return t.dom.is(e,"figure")}function ft(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")}function dt(e,t){function n(t){return ft(e,t)&&(jt(e,t)||St(e,t)||h(at(e)))}return lt(e,t)?st(t).bind(function(t){return n(t.dom)?T.some(t.dom):T.none()}):n(t)?T.some(t):T.none()}function mt(t,e){t.notificationManager.open({text:e,type:"error"})}function ht(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&<(t,n)?st(n):ft(t,e)?T.some(it.fromDom(e)):T.none()}function gt(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return h(r)?t.dom.encode(r[n]):null}function pt(t,e){if(St(t,e))return Y(e.src,null,(n=e,-1!==l.inArray(t.getParam("imagetools_credentials_hosts",[],"string[]"),new xt(n.src).host)));var n,r;if(jt(t,e))return(0===(r=e.src).indexOf("data:")?N:B)(r);var o=at(t);return Y(o+(-1===o.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),t.getParam("api_key",t.getParam("imagetools_api_key","","string"),"string"),!1)}function vt(t,e){var n,r,o=t.editorUpload.blobCache.getByUri(e.src);return o?Rt.resolve(o.blob()):(n=t,r=e,T.from(n.getParam("imagetools_fetch_image",null,"function")).fold(function(){return pt(n,r)},function(t){return t(r)}))}function yt(t){_t.clearTimeout(t.get())}function wt(u,c,s,l,f,d,m){return s.toBlob().then(function(t){var e,n,o,r=u.editorUpload.blobCache,i=d.src,a=c.type===t.type;return u.getParam("images_reuse_filename",!1,"boolean")&&(n=h(o=r.getByUri(i))?(i=o.uri(),e=o.name(),o.filename()):(e=gt(u,i,2),gt(u,i,1))),o=r.create({id:"imagetools"+Ut++,blob:t,base64:s.toBase64(),uri:i,name:e,filename:a?n:void 0}),r.add(o),u.undoManager.transact(function(){var r=function(){var t,e,n;u.$(d).off("load",r),u.nodeChanged(),l?u.editorUpload.uploadImagesAuto():(yt(f),t=u,e=f,n=_t.setEditorTimeout(t,function(){t.editorUpload.uploadImagesAuto()},t.getParam("images_upload_timeout",3e4,"number")),e.set(n))};u.$(d).on("load",r),m&&u.$(d).attr({width:m.w,height:m.h}),u.$(d).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})}function bt(r,o,t,i){return function(){return ht(r).fold(function(){mt(r,"Could not find selected image")},function(n){return r._scanForImages().then(function(){return vt(r,n.dom)}).then(function(e){return Z(e).then(t).then(function(t){return wt(r,e,t,!1,o,n.dom,i)})}).catch(function(t){mt(r,t)})})}}function Et(e,n,r){return function(){var t=ht(e).map(function(t){var e=ut(t.dom);return e?{w:e.h,h:e.w}:null}).getOrNull();return bt(e,n,function(t){return n=r,(e=t).toCanvas().then(function(t){return et(t,e.getType(),n)});var e,n},t)()}}function It(t,e,r){return function(){return bt(t,e,function(t){return n=r,(e=t).toCanvas().then(function(t){return nt(t,e.getType(),n)});var e,n})()}}function Tt(s,l){return function(){var n=ht(s),i=n.map(function(t){return ct(t.dom)});n.each(function(e){dt(s,e.dom).each(function(t){vt(s,e.dom).then(function(t){var e={blob:t,url:URL.createObjectURL(t)};s.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:e}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(t){var o=t.getData().imagetools.blob;n.each(function(r){i.each(function(t){var e,n,a,u,c;e=s,n=l,a=r.dom,u=t,F(c=o).then(function(t){var e,n,r,o,i=ct(t);return u.w===i.w&&u.h===i.h||ut(a)&&(e=a,(n=i)&&(r=e.style.width,o=e.style.height,(r||o)&&(e.style.width=n.w+"px",e.style.height=n.h+"px",e.removeAttribute("data-mce-style")),r=e.width,o=e.height,(r||o)&&(e.setAttribute("width",String(n.w)),e.setAttribute("height",String(n.h))))),URL.revokeObjectURL(t.src),c}).then(Z).then(function(t){return wt(e,c,t,!0,n,a)})})}),t.close()},onCancel:r,onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})})})})}}function At(e){function n(t){return function(){return e.execCommand(t)}}function t(){return ht(e).exists(function(t){return dt(e,t.dom).isSome()})}function r(e){function i(t){return e.setDisabled(!t)}return i(t()),o=o.concat([i]),function(){o=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var o=t[n];o!==i&&e.push(o)}return e}(o)}}var o=[];e.on("NodeChange",function(){var e=t();P(o,function(t){return t(e)})}),e.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft"),onSetup:r}),e.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight"),onSetup:r}),e.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical"),onSetup:r}),e.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal"),onSetup:r}),e.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:r}),e.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:n("mceImage")}),e.ui.registry.addContextMenu("imagetools",{update:function(t){return dt(e,t).map(function(t){return{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}}).toArray()}})}"undefined"!=typeof window||Function("return this;")();var _t=tinymce.util.Tools.resolve("tinymce.util.Delay"),Rt=tinymce.util.Tools.resolve("tinymce.util.Promise"),xt=tinymce.util.Tools.resolve("tinymce.util.URI"),Ut=0,jt=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new xt(n).host===t.documentBaseURI.host},St=function(t,e){return-1!==l.inArray(t.getParam("imagetools_cors_hosts",[],"string[]"),new xt(e.src).host)};o.add("imagetools",function(t){var e,r,o,i,n=c(0),a=c(null),u=t;l.each({mceImageRotateLeft:Et(u,n,-90),mceImageRotateRight:Et(u,n,90),mceImageFlipVertical:It(u,n,"v"),mceImageFlipHorizontal:It(u,n,"h"),mceEditImage:Tt(u,n)},function(t,e){u.addCommand(e,t)}),At(t),(e=t).ui.registry.addContextToolbar("imagetools",{items:e.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions"),predicate:function(t){return dt(e,t).isSome()},position:"node",scope:"node"}),o=n,i=a,(r=t).on("NodeChange",function(t){var e=i.get(),n=dt(r,t.element);e&&!n.exists(function(t){return e.src===t.src})&&(yt(o),r.editorUpload.uploadImagesAuto(),i.set(null)),n.each(i.set)})})}();
|
|
9
|
+
!function(){"use strict";function c(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function h(e){return null!=e}function r(){}function i(e){return function(){return e}}function e(e){return e}function t(){return d}function s(e){return n=typeof(t=e),"array"==(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n);var t,n}var n,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(e){return typeof e===n},u=i(!(n="function")),l=i(!0),d={fold:function(e,t){return e()},isSome:u,isNone:l,getOr:e,getOrThunk:m,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:e,orThunk:m,map:t,each:r,bind:t,exists:u,forall:l,filter:function(){return d},toArray:function(){return[]},toString:i("none()")};function m(e){return e()}var g=function(n){function e(){return o}function t(e){return e(n)}var r=i(n),o={fold:function(e,t){return t(n)},isSome:l,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return g(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:d},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},p={some:g,none:t,from:function(e){return null==e?d:g(e)}},v={},y={exports:v};function w(e,t){return U(document.createElement("canvas"),e,t)}function b(e){var t=w(e.width,e.height);return R(t).drawImage(e,0,0),t}function _(u){return new I(function(e,t){function n(){o.removeEventListener("load",i),o.removeEventListener("error",a)}var r=URL.createObjectURL(u),o=new Image,i=function(){n(),e(o)},a=function(){n(),t("Unable to load data of type "+u.type+": "+r)};o.addEventListener("load",i),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(i,0)})}function E(e,r,o){return r=r||"image/png",a(HTMLCanvasElement.prototype.toBlob)?new I(function(t,n){e.toBlob(function(e){e?t(e):n()},r,o)}):j(e.toDataURL(r,o))}function T(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function x(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return p.some(i);if(n(i,r))break}return p.none()}(e,t,u)}!function(){var e=this,t=function(){var e,t,n,r={exports:{}};function o(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function a(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,i._immediateFn(function(){var e,t=1===n._state?r.onFulfilled:r.onRejected;if(null!==t){try{e=t(n._value)}catch(e){return void c(r.promise,e)}u(r.promise,e)}else(1===n._state?u:c)(r.promise,n._value)})):n._deferreds.push(r)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function f(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e(function(e){n||(n=!0,u(t,e))},function(e){n||(n=!0,c(t,e))})}catch(e){if(n)return;n=!0,c(t,e)}}e=r,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=setTimeout,i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(o);return a(this,new f(e,t,n)),n},i.all=function(e){var u=Array.prototype.slice.call(e);return new i(function(o,i){if(0===u.length)return o([]);for(var a=u.length,e=0;e<u.length;e++)!function t(n,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if("function"==typeof r)return r.call(e,function(e){t(n,e)},i),0}u[n]=e,0==--a&&o(u)}catch(e){i(e)}}(e,u[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){n(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},e.exports?e.exports=i:t.Promise||(t.Promise=i);var d=r.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||d}};"object"==typeof v&&void 0!==y?y.exports=t():(e="undefined"!=typeof globalThis?globalThis:e||self).EphoxContactWrapper=t()}();var I=y.exports.boltExport,R=function(e){return e.getContext("2d")},U=function(e,t,n){return e.width=t,e.height=n,e},A=function(r){return new I(function(e,t){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="blob",n.onload=function(){200===this.status&&e(this.response)},n.onerror=function(){var e;t(0===this.status?((e=new Error("No access to download image")).code=18,e.name="SecurityError",e):new Error("Error "+this.status+" downloading image"))},n.send()})},j=function(h){return new I(function(e,t){!function(){var e=h.split(","),t=/data:([^;]+)/.exec(e[0]);if(!t)return p.none();for(var n=t[1],r=e[1],o=atob(r),i=o.length,a=Math.ceil(i/1024),u=new Array(a),c=0;c<a;++c){for(var s=1024*c,f=Math.min(1024+s,i),l=new Array(f-s),d=s,m=0;d<f;++m,++d)l[m]=o[d].charCodeAt(0);u[c]=new Uint8Array(l)}return p.some(new Blob(u,{type:n}))}().fold(function(){t("uri is not base64: "+h)},e)})},S=function(e){URL.revokeObjectURL(e.src)},M=_,P=Array.prototype.indexOf,O=Object.keys;function L(e,t,n){function r(t,n){return e.then(function(e){return e.toDataURL(t||"image/png",n)})}return{getType:i(t.type),toBlob:function(){return I.resolve(t)},toDataURL:i(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(t,n){return e.then(function(e){return E(e,t,n)})},toAdjustedDataURL:r,toAdjustedBase64:function(e,t){return r(e,t).then(function(e){return e.split(",")[1]})},toCanvas:function(){return e.then(b)}}}function k(t,e){return E(t,e).then(function(e){return L(I.resolve(t),e,t.toDataURL())})}function C(e,t){void 0===t&&(t=2);var n=Math.pow(10,t),r=Math.round(e*n);return Math.ceil(r/n)}function F(t,n,r){return void 0===r&&(r=!1),new I(function(e){var a=new XMLHttpRequest;a.onreadystatechange=function(){4===a.readyState&&e({status:a.status,blob:a.response})},a.open("GET",t,!0),a.withCredentials=r,function(e){for(var t,n=O(e),r=0,o=n.length;r<o;r++){var i=n[r];t=e[i],a.setRequestHeader(i,t)}}(n),a.responseType="blob",a.send()})}function B(e){var t,n=(t=e,"ImageProxy HTTP error: "+x(J,function(e){return t===e.code}).fold(i("Unknown ImageProxy error"),function(e){return e.message}));return I.reject(n)}function N(t){return x(K,function(e){return e.type===t}).fold(i("Unknown service error"),function(e){return e.message})}function D(e){return"ImageProxy Service error: "+function(e){try{return p.some(JSON.parse(e))}catch(e){return p.none()}}(e).bind(function(e){return n=function(e,t){return h(e)?e[t]:void 0},r=e,T(["error","type"],function(e,t){r=n(r,e)}),t=r,p.from(t).map(N);var n,r,t}).getOr("Invalid JSON in service error message")}function H(e){return e<200||300<=e}function z(e,t){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":t};return F((r=t,o=-1===(n=e).indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)?n:n+o+"apiKey="+encodeURIComponent(r)),i).then(function(e){return H(e.status)?(t=e.status,"application/json"!==(null==(n=e.blob)?void 0:n.type)||400!==t&&403!==t&&404!==t&&500!==t?B(t):(r=n,new I(function(e,t){var n=new FileReader;n.onload=function(){e(n.result)},n.onerror=function(e){t(e)},n.readAsText(r)}).then(function(e){var t=D(e);return I.reject(t)}))):I.resolve(e.blob);var r,t,n})}function q(e,t,n){return void 0===n&&(n=!1),t?z(e,t):F(e,{},n).then(function(e){return H(e.status)?B(e.status):I.resolve(e.blob)})}function W(t){return n=t,new I(function(e){var t=new FileReader;t.onloadend=function(){e(t.result)},t.readAsDataURL(n)}).then(function(e){return L(_(t).then(function(e){S(e);var t=w(e.naturalWidth||e.width,e.naturalHeight||e.height);return R(t).drawImage(e,0,0),t}),t,e)});var n}!function(a){if(!s(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};T(a,function(e,r){var t=O(e);if(1!==t.length)throw new Error("one and only one name per case");var i=t[0],o=e[i];if(void 0!==n[i])throw new Error("duplicate key detected:"+i);if("cata"===i)throw new Error("cannot have a case named cata (sorry)");if(!s(o))throw new Error("case arguments must be an array");u.push(i),n[i]=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=n.length;if(t!==o.length)throw new Error("Wrong number of arguments to case "+i+". Expected "+o.length+" ("+o+"), got "+t);return{fold:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+e.length);return e[r].apply(null,n)},match:function(e){var o=O(e);if(u.length!==o.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+o.join(","));if(!function(e){for(var t,n=0,r=e.length;n<r;++n)if(!0!==(t=e[n],function(e,t){return-1<P.call(e,t)}(o,t)))return;return 1}(u))throw new Error("Not all branches were specified when using match. Specified: "+o.join(", ")+"\nRequired: "+u.join(", "));return e[i].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:i,params:n})}}}})}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);function $(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var V=function(e,t,n){var r=(n<0?360+n:n)*Math.PI/180,o=e.width,i=e.height,a=Math.sin(r),u=Math.cos(r),c=C(Math.abs(o*u)+Math.abs(i*a)),s=C(Math.abs(o*a)+Math.abs(i*u)),f=w(c,s),l=R(f);return l.translate(c/2,s/2),l.rotate(r),l.drawImage(e,-o/2,-i/2),k(f,t)},G=function(e,t,n){var r=w(e.width,e.height),o=R(r);return"v"===n?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0)),k(r,t)},J=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],K=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],X={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return $(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return $(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return $(n)},fromDom:$,fromPoint:function(e,t,n){return p.from(e.dom.elementFromPoint(t,n)).map($)}};function Q(e){return e.getParam("imagetools_proxy")}function Y(e){function t(e){return/^[0-9\.]+px$/.test(e)}var n=e.style.width,r=e.style.height;return n||r?t(n)&&t(r)?{w:parseInt(n,10),h:parseInt(r,10)}:null:(n=e.width,r=e.height,n&&r?{w:parseInt(n,10),h:parseInt(r,10)}:null)}function Z(e){return{w:e.naturalWidth,h:e.naturalHeight}}function ee(e){return t=X.fromDom(e),n="img",r=function(r){return function(e){var t=r.dom;if(1!==t.nodeType)return!1;var n=t;if(void 0!==n.matches)return n.matches(e);if(void 0!==n.msMatchesSelector)return n.msMatchesSelector(e);if(void 0!==n.webkitMatchesSelector)return n.webkitMatchesSelector(e);if(void 0!==n.mozMatchesSelector)return n.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(n)},x(t.dom.childNodes,function(e){return r(X.fromDom(e))}).map(X.fromDom);var t,n,r}function te(e,t){return e.dom.is(t,"figure")}function ne(e,t){return e.dom.is(t,"img:not([data-mce-object],[data-mce-placeholder])")}function re(t,e){function n(e){return ne(t,e)&&(be(t,e)||_e(t,e)||h(Q(t)))}return te(t,e)?ee(e).bind(function(e){return n(e.dom)?p.some(e.dom):p.none()}):n(e)?p.some(e):p.none()}function oe(e,t){e.notificationManager.open({text:t,type:"error"})}function ie(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return null!==n&&te(e,n)?ee(n):ne(e,t)?p.some(X.fromDom(t)):p.none()}function ae(e,t,n){var r=t.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return h(r)?e.dom.encode(r[n]):null}function ue(e,t){if(_e(e,t))return q(t.src,null,(n=t,-1!==f.inArray(e.getParam("imagetools_credentials_hosts",[],"string[]"),new ye(n.src).host)));var n,r;if(be(e,t))return(0===(r=t.src).indexOf("data:")?j:A)(r);var o=Q(e);return q(o+(-1===o.indexOf("?")?"?":"&")+"url="+encodeURIComponent(t.src),e.getParam("api_key",e.getParam("imagetools_api_key","","string"),"string"),!1)}function ce(e,t){var n,r,o=e.editorUpload.blobCache.getByUri(t.src);return o?ve.resolve(o.blob()):(n=e,r=t,p.from(n.getParam("imagetools_fetch_image",null,"function")).fold(function(){return ue(n,r)},function(e){return e(r)}))}function se(e){pe.clearTimeout(e.get())}function fe(u,c,s,f,l,d,m){return s.toBlob().then(function(e){var t,n,o,r=u.editorUpload.blobCache,i=d.src,a=c.type===e.type;return u.getParam("images_reuse_filename",!1,"boolean")&&(n=h(o=r.getByUri(i))?(i=o.uri(),t=o.name(),o.filename()):(t=ae(u,i,2),ae(u,i,1))),o=r.create({id:"imagetools"+we++,blob:e,base64:s.toBase64(),uri:i,name:t,filename:a?n:void 0}),r.add(o),u.undoManager.transact(function(){var r=function(){var e,t,n;u.$(d).off("load",r),u.nodeChanged(),f?u.editorUpload.uploadImagesAuto():(se(l),e=u,t=l,n=pe.setEditorTimeout(e,function(){e.editorUpload.uploadImagesAuto()},e.getParam("images_upload_timeout",3e4,"number")),t.set(n))};u.$(d).on("load",r),m&&u.$(d).attr({width:m.w,height:m.h}),u.$(d).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})}function le(r,o,e,i){return function(){return ie(r).fold(function(){oe(r,"Could not find selected image")},function(n){return r._scanForImages().then(function(){return ce(r,n.dom)}).then(function(t){return W(t).then(e).then(function(e){return fe(r,t,e,!1,o,n.dom,i)})}).catch(function(e){oe(r,e)})})}}function de(t,n,r){return function(){var e=ie(t).map(function(e){var t=Y(e.dom);return t?{w:t.h,h:t.w}:null}).getOrNull();return le(t,n,function(e){return n=r,(t=e).toCanvas().then(function(e){return V(e,t.getType(),n)});var t,n},e)()}}function me(e,t,r){return function(){return le(e,t,function(e){return n=r,(t=e).toCanvas().then(function(e){return G(e,t.getType(),n)});var t,n})()}}function he(s,f){return function(){var n=ie(s),i=n.map(function(e){return Z(e.dom)});n.each(function(t){re(s,t.dom).each(function(e){ce(s,t.dom).then(function(e){var t={blob:e,url:URL.createObjectURL(e)};s.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:t}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(e){var o=e.getData().imagetools.blob;n.each(function(r){i.each(function(e){var t,n,a,u,c;t=s,n=f,a=r.dom,u=e,M(c=o).then(function(e){var t,n,r,o,i=Z(e);return u.w===i.w&&u.h===i.h||Y(a)&&(t=a,(n=i)&&(r=t.style.width,o=t.style.height,(r||o)&&(t.style.width=n.w+"px",t.style.height=n.h+"px",t.removeAttribute("data-mce-style")),r=t.width,o=t.height,(r||o)&&(t.setAttribute("width",String(n.w)),t.setAttribute("height",String(n.h))))),URL.revokeObjectURL(e.src),c}).then(W).then(function(e){return fe(t,c,e,!0,n,a)})})}),e.close()},onCancel:r,onAction:function(e,t){switch(t.name){case"save-state":t.value?e.enable("save"):e.disable("save");break;case"disable":e.disable("save"),e.disable("cancel");break;case"enable":e.enable("cancel")}}})})})})}}function ge(t){function n(e){return function(){return t.execCommand(e)}}function e(){return ie(t).exists(function(e){return re(t,e.dom).isSome()})}function r(t){function i(e){return t.setDisabled(!e)}return i(e()),o=o.concat([i]),function(){o=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e[n];o!==i&&t.push(o)}return t}(o)}}var o=[];t.on("NodeChange",function(){var t=e();T(o,function(e){return e(t)})}),t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft"),onSetup:r}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight"),onSetup:r}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical"),onSetup:r}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal"),onSetup:r}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:r}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:n("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(e){return re(t,e).map(function(e){return{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}}).toArray()}})}"undefined"!=typeof window||Function("return this;")();var pe=tinymce.util.Tools.resolve("tinymce.util.Delay"),ve=tinymce.util.Tools.resolve("tinymce.util.Promise"),ye=tinymce.util.Tools.resolve("tinymce.util.URI"),we=0,be=function(e,t){var n=t.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new ye(n).host===e.documentBaseURI.host},_e=function(e,t){return-1!==f.inArray(e.getParam("imagetools_cors_hosts",[],"string[]"),new ye(t.src).host)};o.add("imagetools",function(e){var t,r,o,i,n=c(0),a=c(null),u=e;f.each({mceImageRotateLeft:de(u,n,-90),mceImageRotateRight:de(u,n,90),mceImageFlipVertical:me(u,n,"v"),mceImageFlipHorizontal:me(u,n,"h"),mceEditImage:he(u,n)},function(e,t){u.addCommand(t,e)}),ge(e),(t=e).ui.registry.addContextToolbar("imagetools",{items:t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions"),predicate:function(e){return re(t,e).isSome()},position:"node",scope:"node"}),o=n,i=a,(r=e).on("NodeChange",function(e){var t=i.get(),n=re(r,e.element);t&&!n.exists(function(e){return t.src===e.src})&&(se(o),r.editorUpload.uploadImagesAuto(),i.set(null)),n.each(i.set)})})}();
|
|
@@ -4,6 +4,6 @@
|
|
|
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.0 (2021-10-11)
|
|
8
8
|
*/
|
|
9
9
|
!function(){"use strict";function t(n){return function(t){return r=typeof(e=t),(null===e?"null":"object"==r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r)===n;var e,r}}function y(t){return t.getParam("importcss_selector_converter")}function u(e){return l(e)?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e}function h(t,e){var r,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var o=n[1],i=n[2].substr(1).split(".").join(" "),c=x.makeMap("a,img");return n[1]?(r={title:e},t.schema.getTextBlockElements()[o]?r.block=o:t.schema.getBlockElements()[o]||c[o.toLowerCase()]?r.selector=o:r.inline=o):n[2]&&(r={inline:"span",title:e.substr(1),classes:i}),!1!==t.getParam("importcss_merge_classes")?r.classes=i:r.attributes={class:i},r}}function d(t,e){return null===e||!1!==t.getParam("importcss_exclusive")}function r(v){v.on("init",function(){function o(t,e){if(f=t,p=g,!(d(v,m=e)?f in p:f in m.selectors)){a=t,l=g,d(v,u=e)?l[a]=!0:u.selectors[a]=!0;var r=(i=(o=v).plugins.importcss,c=t,((s=e)&&s.selector_converter?s.selector_converter:y(o)?y(o):function(){return h(o,c)}).call(i,c,s));if(r){var n=r.name||_.DOM.uniqueId();return v.formatter.register(n,r),{title:r.title,format:n}}}var o,i,c,s,a,u,l,f,m,p;return null}var e,r,n,t,i=(e=[],r=[],n={},{addItemToGroup:function(t,e){n[t]?n[t].push(e):(r.push(t),n[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return function(t){for(var e=[],r=0,n=t.length;r<n;++r){if(!f(t[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+t);P.apply(e,t[r])}return e}(function(t,e){for(var r=t.length,n=new Array(r),o=0;o<r;o++){var i=t[o];n[o]=e(i,o)}return n}(r,function(t){var e=n[t];return 0===e.length?[]:[{title:t,items:e}]})).concat(e)}}),g={},c=u(v.getParam("importcss_selector_filter")),s=(t=v.getParam("importcss_groups"),x.map(t,function(t){return x.extend({},t,{original:t,selectors:{},filter:u(t.filter)})}));x.each(function(c,t,s){var a=[],r={},u=function(t,e){var r,n,o=n=t.href,i=p.cacheSuffix;if((n=o=l(o)?o.replace("?"+i,"").replace("&"+i,""):o)&&s(n,e)&&!function(t,e){var r,n=!1!==(r=t.getParam("skin"))&&(r||"oxide");if(n){var o=t.getParam("skin_url"),i=o?t.documentBaseURI.toAbsolute(o):m.baseURL+"/skins/ui/"+n,c=m.baseURL+"/skins/content/";return e===i+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(c)}}(c,n)){x.each(t.imports,function(t){u(t,!0)});try{r=t.cssRules||t.rules}catch(t){}x.each(r,function(t){t.styleSheet?u(t.styleSheet,!0):t.selectorText&&x.each(t.selectorText.split(","),function(t){a.push(x.trim(t))})})}};x.each(c.contentCSS,function(t){r[t]=!0}),s=s||function(t,e){return e||r[t]};try{x.each(t.styleSheets,function(t){u(t)})}catch(t){}return a}(v,v.getDoc(),u(v.getParam("importcss_file_filter"))),function(r){var t,e,n;-1===r.indexOf(".mce-")&&(c&&!c(r)||(n=r,0<(t=x.grep(s,function(t){return!t.filter||t.filter(n)})).length?x.each(t,function(t){var e=o(r,t);e&&i.addItemToGroup(t.title,e)}):(e=o(r,null))&&i.addItem(e)))});var a=i.toFormats();v.fire("addStyleModifications",{items:a,replace:!v.getParam("importcss_append")})})}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=t("string"),f=t("array"),_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=tinymce.util.Tools.resolve("tinymce.EditorManager"),p=tinymce.util.Tools.resolve("tinymce.Env"),x=tinymce.util.Tools.resolve("tinymce.util.Tools"),P=Array.prototype.push;e.add("importcss",function(t){return r(t),e=t,{convertSelectorToFormat:function(t){return h(e,t)}};var e})}();
|