tinymce-rails 5.0.12 → 5.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/source/tinymce/tinymce.js +688 -157
  3. data/lib/tinymce/rails/version.rb +2 -2
  4. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
  5. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
  6. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +2 -2
  7. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -1
  8. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
  9. data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +1 -1
  10. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
  11. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
  12. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +1 -1
  13. data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +1 -1
  14. data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +1 -1
  15. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
  16. data/vendor/assets/javascripts/tinymce/plugins/emoticons/js/emojis.js +1 -1
  17. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +2 -2
  18. data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +1 -1
  19. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +1 -1
  20. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +1 -1
  21. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +1 -1
  22. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +2 -2
  23. data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +2 -2
  24. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
  25. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -1
  26. data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +1 -1
  27. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +2 -2
  28. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +2 -2
  29. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -1
  30. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +2 -2
  31. data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +1 -1
  32. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
  33. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +2 -2
  34. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
  35. data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +1 -1
  36. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +2 -2
  37. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -1
  38. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +2 -2
  39. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +1 -1
  40. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +1 -1
  41. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -2
  42. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -1
  43. data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +1 -1
  44. data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +1 -1
  45. data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +1 -1
  46. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
  47. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +2 -2
  48. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -1
  49. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -1
  50. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
  51. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -1
  52. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -1
  53. data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +2 -2
  54. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -2
  55. data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
  56. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14885cd65079fb63e21da5834e2bb602abe75fc7fda09c8119b4fd32fe6bf9ee
4
- data.tar.gz: fde4d0f53d7b2a9f3fc6f03531c8602f6d1cd8b9e5f9edc98f09131b6cff7e89
3
+ metadata.gz: 75cea0a3470f10e2b30af1c61af87354a14b7a4ecbe7a3b5721bae0a08b0be09
4
+ data.tar.gz: 17bcec541aeeca306c947a3db45c4a51eda8325bf7195689214cf79b3f02747a
5
5
  SHA512:
6
- metadata.gz: 9c742cd3ff8e5a17e3b7c8bbead554419c393ab7e83384c587a6040adb4acfdeebba92495c74fa0bca3c9c58c1d3500acc47766b3060f16f0b01bfc7e4711651
7
- data.tar.gz: a2d246649f692a198bddfd58063d5a9c487259506d8682e9b270056128f1ddc3cd67c2679bbb4a1a204ec4889c35682b9f04fb4b4091d027ba39484c0dc51ff4
6
+ metadata.gz: dc1faf8b0e49117efa9097f245ce85f75ccd1403a28cbd94fedef758234747a283e3a66530f4a1716f57f04f30a941a24fdb5c70f983b7c3bcb8e5b38c7c4bfa
7
+ data.tar.gz: 72ac2548d61e8d64a1072020dd1f1aacc9c74a4f3f943ae7bdc17209554d7fc921df95ff653347df19e7545e740562af9abf16dc0a9e7dd4f57ae4d2fd7166fc
@@ -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.0.12 (2019-07-18)
7
+ * Version: 5.0.13 (2019-08-06)
8
8
  */
9
9
  (function (domGlobals) {
10
10
  'use strict';
@@ -400,46 +400,6 @@
400
400
  return t;
401
401
  }
402
402
 
403
- var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
404
-
405
- var path = function (parts, scope) {
406
- var o = scope !== undefined && scope !== null ? scope : Global;
407
- for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
408
- o = o[parts[i]];
409
- }
410
- return o;
411
- };
412
- var resolve = function (p, scope) {
413
- var parts = p.split('.');
414
- return path(parts, scope);
415
- };
416
-
417
- var unsafe = function (name, scope) {
418
- return resolve(name, scope);
419
- };
420
- var getOrDie = function (name, scope) {
421
- var actual = unsafe(name, scope);
422
- if (actual === undefined || actual === null) {
423
- throw new Error(name + ' not available on this browser');
424
- }
425
- return actual;
426
- };
427
- var Global$1 = { getOrDie: getOrDie };
428
-
429
- var url = function () {
430
- return Global$1.getOrDie('URL');
431
- };
432
- var createObjectURL = function (blob) {
433
- return url().createObjectURL(blob);
434
- };
435
- var revokeObjectURL = function (u) {
436
- url().revokeObjectURL(u);
437
- };
438
- var URL = {
439
- createObjectURL: createObjectURL,
440
- revokeObjectURL: revokeObjectURL
441
- };
442
-
443
403
  var nav = domGlobals.navigator, userAgent = nav.userAgent;
444
404
  var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android, fileApi, phone, tablet, windowsPhone;
445
405
  var matchMediaQuery = function (query) {
@@ -456,7 +416,7 @@
456
416
  gecko = !webkit && !ie11 && /Gecko/.test(userAgent);
457
417
  mac = userAgent.indexOf('Mac') !== -1;
458
418
  iDevice = /(iPad|iPhone)/.test(userAgent);
459
- fileApi = 'FormData' in domGlobals.window && 'FileReader' in domGlobals.window && 'URL' in domGlobals.window && !!URL.createObjectURL;
419
+ fileApi = 'FormData' in domGlobals.window && 'FileReader' in domGlobals.window && 'URL' in domGlobals.window && !!domGlobals.URL.createObjectURL;
460
420
  phone = matchMediaQuery('only screen and (max-device-width: 480px)') && (android || iDevice);
461
421
  tablet = matchMediaQuery('only screen and (min-width: 800px)') && (android || iDevice);
462
422
  windowsPhone = userAgent.indexOf('Windows Phone') !== -1;
@@ -759,7 +719,8 @@
759
719
  returnValue: 1,
760
720
  webkitMovementX: 1,
761
721
  webkitMovementY: 1,
762
- keyIdentifier: 1
722
+ keyIdentifier: 1,
723
+ mozPressure: 1
763
724
  };
764
725
  var hasIsDefaultPrevented = function (event) {
765
726
  return event.isDefaultPrevented === returnTrue || event.isDefaultPrevented === returnFalse;
@@ -2369,7 +2330,7 @@
2369
2330
  }
2370
2331
  return o;
2371
2332
  };
2372
- var resolve$1 = function (n, o) {
2333
+ var resolve = function (n, o) {
2373
2334
  var i, l;
2374
2335
  o = o || domGlobals.window;
2375
2336
  n = n.split('.');
@@ -2409,7 +2370,7 @@
2409
2370
  create: create,
2410
2371
  walk: walk,
2411
2372
  createNS: createNS,
2412
- resolve: resolve$1,
2373
+ resolve: resolve,
2413
2374
  explode: explode,
2414
2375
  _addCacheSuffix: _addCacheSuffix
2415
2376
  };
@@ -3825,18 +3786,14 @@
3825
3786
  };
3826
3787
  var Recurse = { toArray: toArray$1 };
3827
3788
 
3828
- var node = function () {
3829
- var f = Global$1.getOrDie('Node');
3830
- return f;
3831
- };
3832
3789
  var compareDocumentPosition = function (a, b, match) {
3833
3790
  return (a.compareDocumentPosition(b) & match) !== 0;
3834
3791
  };
3835
3792
  var documentPositionPreceding = function (a, b) {
3836
- return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_PRECEDING);
3793
+ return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_PRECEDING);
3837
3794
  };
3838
3795
  var documentPositionContainedBy = function (a, b) {
3839
- return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_CONTAINED_BY);
3796
+ return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_CONTAINED_BY);
3840
3797
  };
3841
3798
  var Node = {
3842
3799
  documentPositionPreceding: documentPositionPreceding,
@@ -4010,6 +3967,503 @@
4010
3967
  };
4011
3968
  var Position = { getPos: getPos };
4012
3969
 
3970
+ var exports$1 = {}, module$1 = { exports: exports$1 };
3971
+ (function (define, exports, module, require) {
3972
+ (function (f) {
3973
+ if (typeof exports === 'object' && typeof module !== 'undefined') {
3974
+ module.exports = f();
3975
+ } else if (typeof define === 'function' && define.amd) {
3976
+ define([], f);
3977
+ } else {
3978
+ var g;
3979
+ if (typeof window !== 'undefined') {
3980
+ g = window;
3981
+ } else if (typeof global !== 'undefined') {
3982
+ g = global;
3983
+ } else if (typeof self !== 'undefined') {
3984
+ g = self;
3985
+ } else {
3986
+ g = this;
3987
+ }
3988
+ g.EphoxContactWrapper = f();
3989
+ }
3990
+ }(function () {
3991
+ return function () {
3992
+ function r(e, n, t) {
3993
+ function o(i, f) {
3994
+ if (!n[i]) {
3995
+ if (!e[i]) {
3996
+ var c = 'function' == typeof require && require;
3997
+ if (!f && c)
3998
+ return c(i, !0);
3999
+ if (u)
4000
+ return u(i, !0);
4001
+ var a = new Error('Cannot find module \'' + i + '\'');
4002
+ throw a.code = 'MODULE_NOT_FOUND', a;
4003
+ }
4004
+ var p = n[i] = { exports: {} };
4005
+ e[i][0].call(p.exports, function (r) {
4006
+ var n = e[i][1][r];
4007
+ return o(n || r);
4008
+ }, p, p.exports, r, e, n, t);
4009
+ }
4010
+ return n[i].exports;
4011
+ }
4012
+ for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++)
4013
+ o(t[i]);
4014
+ return o;
4015
+ }
4016
+ return r;
4017
+ }()({
4018
+ 1: [
4019
+ function (require, module, exports) {
4020
+ var process = module.exports = {};
4021
+ var cachedSetTimeout;
4022
+ var cachedClearTimeout;
4023
+ function defaultSetTimout() {
4024
+ throw new Error('setTimeout has not been defined');
4025
+ }
4026
+ function defaultClearTimeout() {
4027
+ throw new Error('clearTimeout has not been defined');
4028
+ }
4029
+ (function () {
4030
+ try {
4031
+ if (typeof setTimeout === 'function') {
4032
+ cachedSetTimeout = setTimeout;
4033
+ } else {
4034
+ cachedSetTimeout = defaultSetTimout;
4035
+ }
4036
+ } catch (e) {
4037
+ cachedSetTimeout = defaultSetTimout;
4038
+ }
4039
+ try {
4040
+ if (typeof clearTimeout === 'function') {
4041
+ cachedClearTimeout = clearTimeout;
4042
+ } else {
4043
+ cachedClearTimeout = defaultClearTimeout;
4044
+ }
4045
+ } catch (e) {
4046
+ cachedClearTimeout = defaultClearTimeout;
4047
+ }
4048
+ }());
4049
+ function runTimeout(fun) {
4050
+ if (cachedSetTimeout === setTimeout) {
4051
+ return setTimeout(fun, 0);
4052
+ }
4053
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
4054
+ cachedSetTimeout = setTimeout;
4055
+ return setTimeout(fun, 0);
4056
+ }
4057
+ try {
4058
+ return cachedSetTimeout(fun, 0);
4059
+ } catch (e) {
4060
+ try {
4061
+ return cachedSetTimeout.call(null, fun, 0);
4062
+ } catch (e) {
4063
+ return cachedSetTimeout.call(this, fun, 0);
4064
+ }
4065
+ }
4066
+ }
4067
+ function runClearTimeout(marker) {
4068
+ if (cachedClearTimeout === clearTimeout) {
4069
+ return clearTimeout(marker);
4070
+ }
4071
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
4072
+ cachedClearTimeout = clearTimeout;
4073
+ return clearTimeout(marker);
4074
+ }
4075
+ try {
4076
+ return cachedClearTimeout(marker);
4077
+ } catch (e) {
4078
+ try {
4079
+ return cachedClearTimeout.call(null, marker);
4080
+ } catch (e) {
4081
+ return cachedClearTimeout.call(this, marker);
4082
+ }
4083
+ }
4084
+ }
4085
+ var queue = [];
4086
+ var draining = false;
4087
+ var currentQueue;
4088
+ var queueIndex = -1;
4089
+ function cleanUpNextTick() {
4090
+ if (!draining || !currentQueue) {
4091
+ return;
4092
+ }
4093
+ draining = false;
4094
+ if (currentQueue.length) {
4095
+ queue = currentQueue.concat(queue);
4096
+ } else {
4097
+ queueIndex = -1;
4098
+ }
4099
+ if (queue.length) {
4100
+ drainQueue();
4101
+ }
4102
+ }
4103
+ function drainQueue() {
4104
+ if (draining) {
4105
+ return;
4106
+ }
4107
+ var timeout = runTimeout(cleanUpNextTick);
4108
+ draining = true;
4109
+ var len = queue.length;
4110
+ while (len) {
4111
+ currentQueue = queue;
4112
+ queue = [];
4113
+ while (++queueIndex < len) {
4114
+ if (currentQueue) {
4115
+ currentQueue[queueIndex].run();
4116
+ }
4117
+ }
4118
+ queueIndex = -1;
4119
+ len = queue.length;
4120
+ }
4121
+ currentQueue = null;
4122
+ draining = false;
4123
+ runClearTimeout(timeout);
4124
+ }
4125
+ process.nextTick = function (fun) {
4126
+ var args = new Array(arguments.length - 1);
4127
+ if (arguments.length > 1) {
4128
+ for (var i = 1; i < arguments.length; i++) {
4129
+ args[i - 1] = arguments[i];
4130
+ }
4131
+ }
4132
+ queue.push(new Item(fun, args));
4133
+ if (queue.length === 1 && !draining) {
4134
+ runTimeout(drainQueue);
4135
+ }
4136
+ };
4137
+ function Item(fun, array) {
4138
+ this.fun = fun;
4139
+ this.array = array;
4140
+ }
4141
+ Item.prototype.run = function () {
4142
+ this.fun.apply(null, this.array);
4143
+ };
4144
+ process.title = 'browser';
4145
+ process.browser = true;
4146
+ process.env = {};
4147
+ process.argv = [];
4148
+ process.version = '';
4149
+ process.versions = {};
4150
+ function noop() {
4151
+ }
4152
+ process.on = noop;
4153
+ process.addListener = noop;
4154
+ process.once = noop;
4155
+ process.off = noop;
4156
+ process.removeListener = noop;
4157
+ process.removeAllListeners = noop;
4158
+ process.emit = noop;
4159
+ process.prependListener = noop;
4160
+ process.prependOnceListener = noop;
4161
+ process.listeners = function (name) {
4162
+ return [];
4163
+ };
4164
+ process.binding = function (name) {
4165
+ throw new Error('process.binding is not supported');
4166
+ };
4167
+ process.cwd = function () {
4168
+ return '/';
4169
+ };
4170
+ process.chdir = function (dir) {
4171
+ throw new Error('process.chdir is not supported');
4172
+ };
4173
+ process.umask = function () {
4174
+ return 0;
4175
+ };
4176
+ },
4177
+ {}
4178
+ ],
4179
+ 2: [
4180
+ function (require, module, exports) {
4181
+ (function (setImmediate) {
4182
+ (function (root) {
4183
+ var setTimeoutFunc = setTimeout;
4184
+ function noop() {
4185
+ }
4186
+ function bind(fn, thisArg) {
4187
+ return function () {
4188
+ fn.apply(thisArg, arguments);
4189
+ };
4190
+ }
4191
+ function Promise(fn) {
4192
+ if (typeof this !== 'object')
4193
+ throw new TypeError('Promises must be constructed via new');
4194
+ if (typeof fn !== 'function')
4195
+ throw new TypeError('not a function');
4196
+ this._state = 0;
4197
+ this._handled = false;
4198
+ this._value = undefined;
4199
+ this._deferreds = [];
4200
+ doResolve(fn, this);
4201
+ }
4202
+ function handle(self, deferred) {
4203
+ while (self._state === 3) {
4204
+ self = self._value;
4205
+ }
4206
+ if (self._state === 0) {
4207
+ self._deferreds.push(deferred);
4208
+ return;
4209
+ }
4210
+ self._handled = true;
4211
+ Promise._immediateFn(function () {
4212
+ var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
4213
+ if (cb === null) {
4214
+ (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
4215
+ return;
4216
+ }
4217
+ var ret;
4218
+ try {
4219
+ ret = cb(self._value);
4220
+ } catch (e) {
4221
+ reject(deferred.promise, e);
4222
+ return;
4223
+ }
4224
+ resolve(deferred.promise, ret);
4225
+ });
4226
+ }
4227
+ function resolve(self, newValue) {
4228
+ try {
4229
+ if (newValue === self)
4230
+ throw new TypeError('A promise cannot be resolved with itself.');
4231
+ if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
4232
+ var then = newValue.then;
4233
+ if (newValue instanceof Promise) {
4234
+ self._state = 3;
4235
+ self._value = newValue;
4236
+ finale(self);
4237
+ return;
4238
+ } else if (typeof then === 'function') {
4239
+ doResolve(bind(then, newValue), self);
4240
+ return;
4241
+ }
4242
+ }
4243
+ self._state = 1;
4244
+ self._value = newValue;
4245
+ finale(self);
4246
+ } catch (e) {
4247
+ reject(self, e);
4248
+ }
4249
+ }
4250
+ function reject(self, newValue) {
4251
+ self._state = 2;
4252
+ self._value = newValue;
4253
+ finale(self);
4254
+ }
4255
+ function finale(self) {
4256
+ if (self._state === 2 && self._deferreds.length === 0) {
4257
+ Promise._immediateFn(function () {
4258
+ if (!self._handled) {
4259
+ Promise._unhandledRejectionFn(self._value);
4260
+ }
4261
+ });
4262
+ }
4263
+ for (var i = 0, len = self._deferreds.length; i < len; i++) {
4264
+ handle(self, self._deferreds[i]);
4265
+ }
4266
+ self._deferreds = null;
4267
+ }
4268
+ function Handler(onFulfilled, onRejected, promise) {
4269
+ this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
4270
+ this.onRejected = typeof onRejected === 'function' ? onRejected : null;
4271
+ this.promise = promise;
4272
+ }
4273
+ function doResolve(fn, self) {
4274
+ var done = false;
4275
+ try {
4276
+ fn(function (value) {
4277
+ if (done)
4278
+ return;
4279
+ done = true;
4280
+ resolve(self, value);
4281
+ }, function (reason) {
4282
+ if (done)
4283
+ return;
4284
+ done = true;
4285
+ reject(self, reason);
4286
+ });
4287
+ } catch (ex) {
4288
+ if (done)
4289
+ return;
4290
+ done = true;
4291
+ reject(self, ex);
4292
+ }
4293
+ }
4294
+ Promise.prototype['catch'] = function (onRejected) {
4295
+ return this.then(null, onRejected);
4296
+ };
4297
+ Promise.prototype.then = function (onFulfilled, onRejected) {
4298
+ var prom = new this.constructor(noop);
4299
+ handle(this, new Handler(onFulfilled, onRejected, prom));
4300
+ return prom;
4301
+ };
4302
+ Promise.all = function (arr) {
4303
+ var args = Array.prototype.slice.call(arr);
4304
+ return new Promise(function (resolve, reject) {
4305
+ if (args.length === 0)
4306
+ return resolve([]);
4307
+ var remaining = args.length;
4308
+ function res(i, val) {
4309
+ try {
4310
+ if (val && (typeof val === 'object' || typeof val === 'function')) {
4311
+ var then = val.then;
4312
+ if (typeof then === 'function') {
4313
+ then.call(val, function (val) {
4314
+ res(i, val);
4315
+ }, reject);
4316
+ return;
4317
+ }
4318
+ }
4319
+ args[i] = val;
4320
+ if (--remaining === 0) {
4321
+ resolve(args);
4322
+ }
4323
+ } catch (ex) {
4324
+ reject(ex);
4325
+ }
4326
+ }
4327
+ for (var i = 0; i < args.length; i++) {
4328
+ res(i, args[i]);
4329
+ }
4330
+ });
4331
+ };
4332
+ Promise.resolve = function (value) {
4333
+ if (value && typeof value === 'object' && value.constructor === Promise) {
4334
+ return value;
4335
+ }
4336
+ return new Promise(function (resolve) {
4337
+ resolve(value);
4338
+ });
4339
+ };
4340
+ Promise.reject = function (value) {
4341
+ return new Promise(function (resolve, reject) {
4342
+ reject(value);
4343
+ });
4344
+ };
4345
+ Promise.race = function (values) {
4346
+ return new Promise(function (resolve, reject) {
4347
+ for (var i = 0, len = values.length; i < len; i++) {
4348
+ values[i].then(resolve, reject);
4349
+ }
4350
+ });
4351
+ };
4352
+ Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) {
4353
+ setImmediate(fn);
4354
+ } : function (fn) {
4355
+ setTimeoutFunc(fn, 0);
4356
+ };
4357
+ Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
4358
+ if (typeof console !== 'undefined' && console) {
4359
+ console.warn('Possible Unhandled Promise Rejection:', err);
4360
+ }
4361
+ };
4362
+ Promise._setImmediateFn = function _setImmediateFn(fn) {
4363
+ Promise._immediateFn = fn;
4364
+ };
4365
+ Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
4366
+ Promise._unhandledRejectionFn = fn;
4367
+ };
4368
+ if (typeof module !== 'undefined' && module.exports) {
4369
+ module.exports = Promise;
4370
+ } else if (!root.Promise) {
4371
+ root.Promise = Promise;
4372
+ }
4373
+ }(this));
4374
+ }.call(this, require('timers').setImmediate));
4375
+ },
4376
+ { 'timers': 3 }
4377
+ ],
4378
+ 3: [
4379
+ function (require, module, exports) {
4380
+ (function (setImmediate, clearImmediate) {
4381
+ var nextTick = require('process/browser.js').nextTick;
4382
+ var apply = Function.prototype.apply;
4383
+ var slice = Array.prototype.slice;
4384
+ var immediateIds = {};
4385
+ var nextImmediateId = 0;
4386
+ exports.setTimeout = function () {
4387
+ return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
4388
+ };
4389
+ exports.setInterval = function () {
4390
+ return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
4391
+ };
4392
+ exports.clearTimeout = exports.clearInterval = function (timeout) {
4393
+ timeout.close();
4394
+ };
4395
+ function Timeout(id, clearFn) {
4396
+ this._id = id;
4397
+ this._clearFn = clearFn;
4398
+ }
4399
+ Timeout.prototype.unref = Timeout.prototype.ref = function () {
4400
+ };
4401
+ Timeout.prototype.close = function () {
4402
+ this._clearFn.call(window, this._id);
4403
+ };
4404
+ exports.enroll = function (item, msecs) {
4405
+ clearTimeout(item._idleTimeoutId);
4406
+ item._idleTimeout = msecs;
4407
+ };
4408
+ exports.unenroll = function (item) {
4409
+ clearTimeout(item._idleTimeoutId);
4410
+ item._idleTimeout = -1;
4411
+ };
4412
+ exports._unrefActive = exports.active = function (item) {
4413
+ clearTimeout(item._idleTimeoutId);
4414
+ var msecs = item._idleTimeout;
4415
+ if (msecs >= 0) {
4416
+ item._idleTimeoutId = setTimeout(function onTimeout() {
4417
+ if (item._onTimeout)
4418
+ item._onTimeout();
4419
+ }, msecs);
4420
+ }
4421
+ };
4422
+ exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) {
4423
+ var id = nextImmediateId++;
4424
+ var args = arguments.length < 2 ? false : slice.call(arguments, 1);
4425
+ immediateIds[id] = true;
4426
+ nextTick(function onNextTick() {
4427
+ if (immediateIds[id]) {
4428
+ if (args) {
4429
+ fn.apply(null, args);
4430
+ } else {
4431
+ fn.call(null);
4432
+ }
4433
+ exports.clearImmediate(id);
4434
+ }
4435
+ });
4436
+ return id;
4437
+ };
4438
+ exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) {
4439
+ delete immediateIds[id];
4440
+ };
4441
+ }.call(this, require('timers').setImmediate, require('timers').clearImmediate));
4442
+ },
4443
+ {
4444
+ 'process/browser.js': 1,
4445
+ 'timers': 3
4446
+ }
4447
+ ],
4448
+ 4: [
4449
+ function (require, module, exports) {
4450
+ var promisePolyfill = require('promise-polyfill');
4451
+ var Global = function () {
4452
+ if (typeof window !== 'undefined') {
4453
+ return window;
4454
+ } else {
4455
+ return Function('return this;')();
4456
+ }
4457
+ }();
4458
+ module.exports = { boltExport: Global.Promise || promisePolyfill };
4459
+ },
4460
+ { 'promise-polyfill': 2 }
4461
+ ]
4462
+ }, {}, [4])(4);
4463
+ }));
4464
+ }(undefined, exports$1, module$1, undefined));
4465
+ var Promise = module$1.exports.boltExport;
4466
+
4013
4467
  var nu$3 = function (baseFn) {
4014
4468
  var data = Option.none();
4015
4469
  var callbacks = [];
@@ -4062,42 +4516,31 @@
4062
4516
  pure: pure
4063
4517
  };
4064
4518
 
4065
- var bounce = function (f) {
4066
- return function () {
4067
- var args = [];
4068
- for (var _i = 0; _i < arguments.length; _i++) {
4069
- args[_i] = arguments[_i];
4070
- }
4071
- var me = this;
4072
- domGlobals.setTimeout(function () {
4073
- f.apply(me, args);
4074
- }, 0);
4075
- };
4519
+ var errorReporter = function (err) {
4520
+ domGlobals.setTimeout(function () {
4521
+ throw err;
4522
+ }, 0);
4076
4523
  };
4077
-
4078
- var nu$4 = function (baseFn) {
4524
+ var make = function (run) {
4079
4525
  var get = function (callback) {
4080
- baseFn(bounce(callback));
4526
+ run().then(callback, errorReporter);
4081
4527
  };
4082
4528
  var map = function (fab) {
4083
- return nu$4(function (callback) {
4084
- get(function (a) {
4085
- var value = fab(a);
4086
- callback(value);
4087
- });
4529
+ return make(function () {
4530
+ return run().then(fab);
4088
4531
  });
4089
4532
  };
4090
4533
  var bind = function (aFutureB) {
4091
- return nu$4(function (callback) {
4092
- get(function (a) {
4093
- aFutureB(a).get(callback);
4534
+ return make(function () {
4535
+ return run().then(function (v) {
4536
+ return aFutureB(v).toPromise();
4094
4537
  });
4095
4538
  });
4096
4539
  };
4097
4540
  var anonBind = function (futureB) {
4098
- return nu$4(function (callback) {
4099
- get(function (a) {
4100
- futureB.get(callback);
4541
+ return make(function () {
4542
+ return run().then(function () {
4543
+ return futureB.toPromise();
4101
4544
  });
4102
4545
  });
4103
4546
  };
@@ -4106,25 +4549,32 @@
4106
4549
  };
4107
4550
  var toCached = function () {
4108
4551
  var cache = null;
4109
- return nu$4(function (callback) {
4552
+ return make(function () {
4110
4553
  if (cache === null) {
4111
- cache = toLazy();
4554
+ cache = run();
4112
4555
  }
4113
- cache.get(callback);
4556
+ return cache;
4114
4557
  });
4115
4558
  };
4559
+ var toPromise = run;
4116
4560
  return {
4117
4561
  map: map,
4118
4562
  bind: bind,
4119
4563
  anonBind: anonBind,
4120
4564
  toLazy: toLazy,
4121
4565
  toCached: toCached,
4566
+ toPromise: toPromise,
4122
4567
  get: get
4123
4568
  };
4124
4569
  };
4570
+ var nu$4 = function (baseFn) {
4571
+ return make(function () {
4572
+ return new Promise(baseFn);
4573
+ });
4574
+ };
4125
4575
  var pure$1 = function (a) {
4126
- return nu$4(function (callback) {
4127
- callback(a);
4576
+ return make(function () {
4577
+ return Promise.resolve(a);
4128
4578
  });
4129
4579
  };
4130
4580
  var Future = {
@@ -8228,7 +8678,7 @@
8228
8678
  }
8229
8679
  return CaretPosition$1(container, offset);
8230
8680
  };
8231
- var resolve$2 = function (root, path) {
8681
+ var resolve$1 = function (root, path) {
8232
8682
  var parts, container, offset;
8233
8683
  if (!path) {
8234
8684
  return null;
@@ -9208,9 +9658,9 @@
9208
9658
  var resolveCaretPositionBookmark = function (dom, bookmark) {
9209
9659
  var rng, pos;
9210
9660
  rng = dom.createRng();
9211
- pos = resolve$2(dom.getRoot(), bookmark.start);
9661
+ pos = resolve$1(dom.getRoot(), bookmark.start);
9212
9662
  rng.setStart(pos.container(), pos.offset());
9213
- pos = resolve$2(dom.getRoot(), bookmark.end);
9663
+ pos = resolve$1(dom.getRoot(), bookmark.end);
9214
9664
  rng.setEnd(pos.container(), pos.offset());
9215
9665
  return rng;
9216
9666
  };
@@ -9380,7 +9830,7 @@
9380
9830
  return rng;
9381
9831
  });
9382
9832
  };
9383
- var resolve$3 = function (selection, bookmark) {
9833
+ var resolve$2 = function (selection, bookmark) {
9384
9834
  var dom = selection.dom;
9385
9835
  if (bookmark) {
9386
9836
  if (isPathBookmark(bookmark)) {
@@ -9397,7 +9847,7 @@
9397
9847
  }
9398
9848
  return Option.none();
9399
9849
  };
9400
- var ResolveBookmark = { resolve: resolve$3 };
9850
+ var ResolveBookmark = { resolve: resolve$2 };
9401
9851
 
9402
9852
  var getBookmark$1 = function (selection, type, normalized) {
9403
9853
  return GetBookmark.getBookmark(selection, type, normalized);
@@ -11418,7 +11868,8 @@
11418
11868
  };
11419
11869
 
11420
11870
  var isEditorUIElement = function (elm) {
11421
- return elm.className.toString().indexOf('tox-') !== -1 || elm.className.toString().indexOf('mce-') !== -1;
11871
+ var className = elm.className.toString();
11872
+ return className.indexOf('tox-') !== -1 || className.indexOf('mce-') !== -1;
11422
11873
  };
11423
11874
  var FocusManager = { isEditorUIElement: isEditorUIElement };
11424
11875
 
@@ -11461,10 +11912,10 @@
11461
11912
  var throttledStore = first(function () {
11462
11913
  SelectionBookmark.store(editor);
11463
11914
  }, 0);
11464
- if (editor.inline) {
11465
- registerPageMouseUp(editor, throttledStore);
11466
- }
11467
11915
  editor.on('init', function () {
11916
+ if (editor.inline) {
11917
+ registerPageMouseUp(editor, throttledStore);
11918
+ }
11468
11919
  registerEditorEvents(editor, throttledStore);
11469
11920
  });
11470
11921
  editor.on('remove', function () {
@@ -11478,6 +11929,14 @@
11478
11929
  var isEditorUIElement$1 = function (elm) {
11479
11930
  return FocusManager.isEditorUIElement(elm);
11480
11931
  };
11932
+ var isEditorContentAreaElement = function (elm) {
11933
+ var classList = elm.classList;
11934
+ if (classList !== undefined) {
11935
+ return classList.contains('tox-edit-area') || classList.contains('tox-edit-area__iframe') || classList.contains('mce-content-body');
11936
+ } else {
11937
+ return false;
11938
+ }
11939
+ };
11481
11940
  var isUIElement = function (editor, elm) {
11482
11941
  var customSelector = editor ? editor.settings.custom_ui_selector : '';
11483
11942
  var parent = DOM$1.getParent(elm, function (elm) {
@@ -11549,6 +12008,7 @@
11549
12008
  var FocusController = {
11550
12009
  setup: setup$2,
11551
12010
  isEditorUIElement: isEditorUIElement$1,
12011
+ isEditorContentAreaElement: isEditorContentAreaElement,
11552
12012
  isUIElement: isUIElement
11553
12013
  };
11554
12014
 
@@ -11603,8 +12063,8 @@
11603
12063
  return rawBody && hasElementFocus(Element.fromDom(rawBody));
11604
12064
  };
11605
12065
  var hasUiFocus = function (editor) {
11606
- return hasElementFocus(Element.fromDom(editor.getContainer())) || active().filter(function (elem) {
11607
- return FocusController.isUIElement(editor, elem.dom());
12066
+ return active().filter(function (elem) {
12067
+ return !FocusController.isEditorContentAreaElement(elem.dom()) && FocusController.isUIElement(editor, elem.dom());
11608
12068
  }).isSome();
11609
12069
  };
11610
12070
  var hasFocus$1 = function (editor) {
@@ -11881,6 +12341,13 @@
11881
12341
  var hasSection = function (sectionResult, name) {
11882
12342
  return sectionResult.sections().hasOwnProperty(name);
11883
12343
  };
12344
+ var isSectionTheme = function (sectionResult, name, theme) {
12345
+ var section = sectionResult.sections();
12346
+ return hasSection(sectionResult, name) && section[name].theme === theme;
12347
+ };
12348
+ var getSectionConfig = function (sectionResult, name) {
12349
+ return hasSection(sectionResult, name) ? sectionResult.sections()[name] : {};
12350
+ };
11884
12351
  var getDefaultSettings = function (id, documentBaseUrl, editor) {
11885
12352
  return {
11886
12353
  id: id,
@@ -11922,8 +12389,10 @@
11922
12389
  };
11923
12390
  var processPlugins = function (isTouchDevice, sectionResult, defaultOverrideSettings, settings) {
11924
12391
  var forcedPlugins = normalizePlugins(defaultOverrideSettings.forced_plugins);
11925
- var plugins = normalizePlugins(settings.plugins);
11926
- var platformPlugins = isTouchDevice && hasSection(sectionResult, 'mobile') ? filterMobilePlugins(plugins) : plugins;
12392
+ var desktopPlugins = normalizePlugins(settings.plugins);
12393
+ var mobileConfig = getSectionConfig(sectionResult, 'mobile');
12394
+ var mobilePlugins = mobileConfig.plugins ? normalizePlugins(mobileConfig.plugins) : desktopPlugins;
12395
+ var platformPlugins = isTouchDevice && isSectionTheme(sectionResult, 'mobile', 'mobile') ? filterMobilePlugins(mobilePlugins) : isTouchDevice && hasSection(sectionResult, 'mobile') ? mobilePlugins : desktopPlugins;
11927
12396
  var combinedPlugins = combinePlugins(forcedPlugins, platformPlugins);
11928
12397
  return Tools.extend(settings, { plugins: combinedPlugins.join(' ') });
11929
12398
  };
@@ -12479,11 +12948,6 @@
12479
12948
 
12480
12949
  var ThemeManager = AddOnManager$1.ThemeManager;
12481
12950
 
12482
- function XMLHttpRequest () {
12483
- var f = Global$1.getOrDie('XMLHttpRequest');
12484
- return new f();
12485
- }
12486
-
12487
12951
  function Uploader(uploadStatus, settings) {
12488
12952
  var pendingPromises = {};
12489
12953
  var pathJoin = function (path1, path2) {
@@ -12494,7 +12958,7 @@
12494
12958
  };
12495
12959
  var defaultHandler = function (blobInfo, success, failure, progress) {
12496
12960
  var xhr, formData;
12497
- xhr = XMLHttpRequest();
12961
+ xhr = new domGlobals.XMLHttpRequest();
12498
12962
  xhr.open('POST', settings.url);
12499
12963
  xhr.withCredentials = settings.credentials;
12500
12964
  xhr.upload.onprogress = function (e) {
@@ -12613,36 +13077,13 @@
12613
13077
  return { upload: upload };
12614
13078
  }
12615
13079
 
12616
- function FileReader () {
12617
- var f = Global$1.getOrDie('FileReader');
12618
- return new f();
12619
- }
12620
-
12621
- function Uint8Array (arr) {
12622
- var f = Global$1.getOrDie('Uint8Array');
12623
- return new f(arr);
12624
- }
12625
-
12626
- var requestAnimationFrame$1 = function (callback) {
12627
- var f = Global$1.getOrDie('requestAnimationFrame');
12628
- f(callback);
12629
- };
12630
- var atob = function (base64) {
12631
- var f = Global$1.getOrDie('atob');
12632
- return f(base64);
12633
- };
12634
- var Window = {
12635
- atob: atob,
12636
- requestAnimationFrame: requestAnimationFrame$1
12637
- };
12638
-
12639
13080
  var blobUriToBlob = function (url) {
12640
13081
  return new promiseObj(function (resolve, reject) {
12641
13082
  var rejectWithError = function () {
12642
13083
  reject('Cannot convert ' + url + ' to Blob. Resource might not exist or is inaccessible.');
12643
13084
  };
12644
13085
  try {
12645
- var xhr = XMLHttpRequest();
13086
+ var xhr = new domGlobals.XMLHttpRequest();
12646
13087
  xhr.open('GET', url, true);
12647
13088
  xhr.responseType = 'blob';
12648
13089
  xhr.onload = function () {
@@ -12676,12 +13117,12 @@
12676
13117
  var str, arr, i;
12677
13118
  var uriParts = parseDataUri(uri);
12678
13119
  try {
12679
- str = Window.atob(uriParts.data);
13120
+ str = domGlobals.atob(uriParts.data);
12680
13121
  } catch (e) {
12681
13122
  resolve(new domGlobals.Blob([]));
12682
13123
  return;
12683
13124
  }
12684
- arr = Uint8Array(str.length);
13125
+ arr = new Uint8Array(str.length);
12685
13126
  for (i = 0; i < arr.length; i++) {
12686
13127
  arr[i] = str.charCodeAt(i);
12687
13128
  }
@@ -12699,7 +13140,7 @@
12699
13140
  };
12700
13141
  var blobToDataUri = function (blob) {
12701
13142
  return new promiseObj(function (resolve) {
12702
- var reader = FileReader();
13143
+ var reader = new domGlobals.FileReader();
12703
13144
  reader.onloadend = function () {
12704
13145
  resolve(reader.result);
12705
13146
  };
@@ -12879,7 +13320,7 @@
12879
13320
  filename: constant(name + '.' + mimeToExt(o.blob.type)),
12880
13321
  blob: constant(o.blob),
12881
13322
  base64: constant(o.base64),
12882
- blobUri: constant(o.blobUri || URL.createObjectURL(o.blob)),
13323
+ blobUri: constant(o.blobUri || domGlobals.URL.createObjectURL(o.blob)),
12883
13324
  uri: constant(o.uri)
12884
13325
  };
12885
13326
  };
@@ -12904,7 +13345,7 @@
12904
13345
  var removeByUri = function (blobUri) {
12905
13346
  cache = filter(cache, function (blobInfo) {
12906
13347
  if (blobInfo.blobUri() === blobUri) {
12907
- URL.revokeObjectURL(blobInfo.blobUri());
13348
+ domGlobals.URL.revokeObjectURL(blobInfo.blobUri());
12908
13349
  return false;
12909
13350
  }
12910
13351
  return true;
@@ -12912,7 +13353,7 @@
12912
13353
  };
12913
13354
  var destroy = function () {
12914
13355
  each(cache, function (cachedBlobInfo) {
12915
- URL.revokeObjectURL(cachedBlobInfo.blobUri());
13356
+ domGlobals.URL.revokeObjectURL(cachedBlobInfo.blobUri());
12916
13357
  });
12917
13358
  cache = [];
12918
13359
  };
@@ -21485,25 +21926,37 @@
21485
21926
  return true;
21486
21927
  };
21487
21928
  };
21929
+ var getAncestorCe = function (editor, node) {
21930
+ return Option.from(getContentEditableRoot$2(editor.getBody(), node));
21931
+ };
21488
21932
  var backspaceDeleteCaret = function (editor, forward) {
21489
- var result = read$4(editor.getBody(), forward, editor.selection.getRng()).map(function (deleteAction) {
21490
- return deleteAction.fold(deleteElement$1(editor, forward), moveToElement(editor, forward), moveToPosition(editor));
21933
+ var selectedNode = editor.selection.getNode();
21934
+ return getAncestorCe(editor, selectedNode).filter(NodeType.isContentEditableFalse).fold(function () {
21935
+ var result = read$4(editor.getBody(), forward, editor.selection.getRng()).map(function (deleteAction) {
21936
+ return deleteAction.fold(deleteElement$1(editor, forward), moveToElement(editor, forward), moveToPosition(editor));
21937
+ });
21938
+ return result.getOr(false);
21939
+ }, function () {
21940
+ return true;
21491
21941
  });
21492
- return result.getOr(false);
21493
21942
  };
21494
21943
  var deleteOffscreenSelection = function (rootElement) {
21495
21944
  each(descendants$1(rootElement, '.mce-offscreen-selection'), remove$1);
21496
21945
  };
21497
21946
  var backspaceDeleteRange = function (editor, forward) {
21498
- var selectedElement = editor.selection.getNode();
21499
- if (NodeType.isContentEditableFalse(selectedElement)) {
21500
- deleteOffscreenSelection(Element.fromDom(editor.getBody()));
21501
- DeleteElement.deleteElement(editor, forward, Element.fromDom(editor.selection.getNode()));
21502
- DeleteUtils.paddEmptyBody(editor);
21503
- return true;
21504
- } else {
21505
- return false;
21947
+ var selectedNode = editor.selection.getNode();
21948
+ if (NodeType.isContentEditableFalse(selectedNode)) {
21949
+ var hasCefAncestor = getAncestorCe(editor, selectedNode.parentNode).filter(NodeType.isContentEditableFalse);
21950
+ return hasCefAncestor.fold(function () {
21951
+ deleteOffscreenSelection(Element.fromDom(editor.getBody()));
21952
+ DeleteElement.deleteElement(editor, forward, Element.fromDom(editor.selection.getNode()));
21953
+ DeleteUtils.paddEmptyBody(editor);
21954
+ return true;
21955
+ }, function () {
21956
+ return true;
21957
+ });
21506
21958
  }
21959
+ return false;
21507
21960
  };
21508
21961
  var getContentEditableRoot$2 = function (root, node) {
21509
21962
  while (node && node !== root) {
@@ -25538,7 +25991,7 @@
25538
25991
  return EditorCommands;
25539
25992
  }();
25540
25993
 
25541
- var nativeEvents = Tools.makeMap('focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange ' + 'mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover ' + 'draggesture dragdrop drop drag submit ' + 'compositionstart compositionend compositionupdate touchstart touchmove touchend', ' ');
25994
+ var nativeEvents = Tools.makeMap('focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange ' + 'mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover ' + 'draggesture dragdrop drop drag submit ' + 'compositionstart compositionend compositionupdate touchstart touchmove touchend', ' ');
25542
25995
  var EventDispatcher = function () {
25543
25996
  function EventDispatcher(settings) {
25544
25997
  this.bindings = {};
@@ -26304,7 +26757,7 @@
26304
26757
 
26305
26758
  var DOM$8 = DOMUtils$1.DOM;
26306
26759
  var extend$3 = Tools.extend, each$j = Tools.each;
26307
- var resolve$4 = Tools.resolve;
26760
+ var resolve$3 = Tools.resolve;
26308
26761
  var ie$2 = Env.ie;
26309
26762
  var Editor = function () {
26310
26763
  function Editor(id, settings, editorManager) {
@@ -26377,8 +26830,8 @@
26377
26830
  }
26378
26831
  if (typeof callback === 'string') {
26379
26832
  scope = callback.replace(/\.\w+$/, '');
26380
- scope = scope ? resolve$4(scope) : 0;
26381
- callback = resolve$4(callback);
26833
+ scope = scope ? resolve$3(scope) : 0;
26834
+ callback = resolve$3(callback);
26382
26835
  self.callbackLookup = self.callbackLookup || {};
26383
26836
  self.callbackLookup[name] = {
26384
26837
  func: callback,
@@ -26745,8 +27198,8 @@
26745
27198
  suffix: null,
26746
27199
  $: DomQuery,
26747
27200
  majorVersion: '5',
26748
- minorVersion: '0.12',
26749
- releaseDate: '2019-07-18',
27201
+ minorVersion: '0.13',
27202
+ releaseDate: '2019-08-06',
26750
27203
  editors: legacyEditors,
26751
27204
  i18n: I18n,
26752
27205
  activeEditor: null,
@@ -27119,6 +27572,83 @@
27119
27572
  }(RangeUtils || (RangeUtils = {})));
27120
27573
  var RangeUtils$1 = RangeUtils;
27121
27574
 
27575
+ var awaiter = function (resolveCb, rejectCb, timeout) {
27576
+ if (timeout === void 0) {
27577
+ timeout = 1000;
27578
+ }
27579
+ var done = false;
27580
+ var timer = null;
27581
+ var complete = function (completer) {
27582
+ return function () {
27583
+ var args = [];
27584
+ for (var _i = 0; _i < arguments.length; _i++) {
27585
+ args[_i] = arguments[_i];
27586
+ }
27587
+ if (!done) {
27588
+ done = true;
27589
+ if (timer !== null) {
27590
+ domGlobals.clearTimeout(timer);
27591
+ timer = null;
27592
+ }
27593
+ completer.apply(null, args);
27594
+ }
27595
+ };
27596
+ };
27597
+ var resolve = complete(resolveCb);
27598
+ var reject = complete(rejectCb);
27599
+ var start = function () {
27600
+ var args = [];
27601
+ for (var _i = 0; _i < arguments.length; _i++) {
27602
+ args[_i] = arguments[_i];
27603
+ }
27604
+ if (!done && timer === null) {
27605
+ timer = domGlobals.setTimeout(function () {
27606
+ return reject.apply(null, args);
27607
+ }, timeout);
27608
+ }
27609
+ };
27610
+ return {
27611
+ start: start,
27612
+ resolve: resolve,
27613
+ reject: reject
27614
+ };
27615
+ };
27616
+ var create$6 = function () {
27617
+ var tasks = {};
27618
+ var resultFns = {};
27619
+ var load = function (id, url) {
27620
+ var loadErrMsg = 'Script at URL "' + url + '" failed to load';
27621
+ var runErrMsg = 'Script at URL "' + url + '" did not call `tinymce.Resource.add(\'' + id + '\', data)` within 1 second';
27622
+ if (tasks[id] !== undefined) {
27623
+ return tasks[id];
27624
+ } else {
27625
+ var task = new promiseObj(function (resolve, reject) {
27626
+ var waiter = awaiter(resolve, reject);
27627
+ resultFns[id] = waiter.resolve;
27628
+ ScriptLoader.ScriptLoader.loadScript(url, function () {
27629
+ return waiter.start(runErrMsg);
27630
+ }, function () {
27631
+ return waiter.reject(loadErrMsg);
27632
+ });
27633
+ });
27634
+ tasks[id] = task;
27635
+ return task;
27636
+ }
27637
+ };
27638
+ var add = function (id, data) {
27639
+ if (resultFns[id] !== undefined) {
27640
+ resultFns[id](data);
27641
+ delete resultFns[id];
27642
+ }
27643
+ tasks[id] = promiseObj.resolve(data);
27644
+ };
27645
+ return {
27646
+ load: load,
27647
+ add: add
27648
+ };
27649
+ };
27650
+ var Resource = create$6();
27651
+
27122
27652
  var min = Math.min, max = Math.max, round$2 = Math.round;
27123
27653
  var relativePosition = function (rect, targetRect, rel) {
27124
27654
  var x, y, w, h, targetW, targetH;
@@ -27153,7 +27683,7 @@
27153
27683
  if (rel[4] === 'c') {
27154
27684
  x -= round$2(w / 2);
27155
27685
  }
27156
- return create$6(x, y, w, h);
27686
+ return create$7(x, y, w, h);
27157
27687
  };
27158
27688
  var findBestRelativePosition = function (rect, targetRect, constrainRect, rels) {
27159
27689
  var pos, i;
@@ -27166,7 +27696,7 @@
27166
27696
  return null;
27167
27697
  };
27168
27698
  var inflate = function (rect, w, h) {
27169
- return create$6(rect.x - w, rect.y - h, rect.w + w * 2, rect.h + h * 2);
27699
+ return create$7(rect.x - w, rect.y - h, rect.w + w * 2, rect.h + h * 2);
27170
27700
  };
27171
27701
  var intersect = function (rect, cropRect) {
27172
27702
  var x1, y1, x2, y2;
@@ -27177,7 +27707,7 @@
27177
27707
  if (x2 - x1 < 0 || y2 - y1 < 0) {
27178
27708
  return null;
27179
27709
  }
27180
- return create$6(x1, y1, x2 - x1, y2 - y1);
27710
+ return create$7(x1, y1, x2 - x1, y2 - y1);
27181
27711
  };
27182
27712
  var clamp$1 = function (rect, clampRect, fixedSize) {
27183
27713
  var underflowX1, underflowY1, overflowX2, overflowY2, x1, y1, x2, y2, cx2, cy2;
@@ -27201,9 +27731,9 @@
27201
27731
  }
27202
27732
  x2 -= overflowX2;
27203
27733
  y2 -= overflowY2;
27204
- return create$6(x1, y1, x2 - x1, y2 - y1);
27734
+ return create$7(x1, y1, x2 - x1, y2 - y1);
27205
27735
  };
27206
- var create$6 = function (x, y, w, h) {
27736
+ var create$7 = function (x, y, w, h) {
27207
27737
  return {
27208
27738
  x: x,
27209
27739
  y: y,
@@ -27212,7 +27742,7 @@
27212
27742
  };
27213
27743
  };
27214
27744
  var fromClientRect = function (clientRect) {
27215
- return create$6(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
27745
+ return create$7(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
27216
27746
  };
27217
27747
  var Rect = {
27218
27748
  inflate: inflate,
@@ -27220,7 +27750,7 @@
27220
27750
  findBestRelativePosition: findBestRelativePosition,
27221
27751
  intersect: intersect,
27222
27752
  clamp: clamp$1,
27223
- create: create$6,
27753
+ create: create$7,
27224
27754
  fromClientRect: fromClientRect
27225
27755
  };
27226
27756
 
@@ -27524,7 +28054,7 @@
27524
28054
  settings.async = settings.async !== false;
27525
28055
  settings.data = settings.data || '';
27526
28056
  XHR.fire('beforeInitialize', { settings: settings });
27527
- xhr = XMLHttpRequest();
28057
+ xhr = new domGlobals.XMLHttpRequest();
27528
28058
  if (xhr) {
27529
28059
  if (xhr.overrideMimeType) {
27530
28060
  xhr.overrideMimeType(settings.content_type);
@@ -27594,7 +28124,7 @@
27594
28124
  return JSONRequest;
27595
28125
  }();
27596
28126
 
27597
- var create$7 = function () {
28127
+ var create$8 = function () {
27598
28128
  return function () {
27599
28129
  var data = {};
27600
28130
  var keys = [];
@@ -27637,7 +28167,7 @@
27637
28167
  try {
27638
28168
  localStorage = domGlobals.window.localStorage;
27639
28169
  } catch (e) {
27640
- localStorage = create$7();
28170
+ localStorage = create$8();
27641
28171
  }
27642
28172
  var LocalStorage = localStorage;
27643
28173
 
@@ -27702,6 +28232,7 @@
27702
28232
  PluginManager: AddOnManager$1.PluginManager,
27703
28233
  ThemeManager: AddOnManager$1.ThemeManager,
27704
28234
  IconManager: IconManager,
28235
+ Resource: Resource,
27705
28236
  trim: Tools.trim,
27706
28237
  isArray: Tools.isArray,
27707
28238
  is: Tools.is,