Upgrade Umbraco 7.15.10
This commit is contained in:
@@ -4,6 +4,8 @@ var help = (function () {
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var noop = function () {
|
||||
};
|
||||
var constant = function (value) {
|
||||
return function () {
|
||||
return value;
|
||||
@@ -35,8 +37,6 @@ var help = (function () {
|
||||
var never = constant(false);
|
||||
var always = constant(true);
|
||||
|
||||
var never$1 = never;
|
||||
var always$1 = always;
|
||||
var none = function () {
|
||||
return NONE;
|
||||
};
|
||||
@@ -50,37 +50,27 @@ var help = (function () {
|
||||
var id = function (n) {
|
||||
return n;
|
||||
};
|
||||
var noop = function () {
|
||||
};
|
||||
var nul = function () {
|
||||
return null;
|
||||
};
|
||||
var undef = function () {
|
||||
return undefined;
|
||||
};
|
||||
var me = {
|
||||
fold: function (n, s) {
|
||||
return n();
|
||||
},
|
||||
is: never$1,
|
||||
isSome: never$1,
|
||||
isNone: always$1,
|
||||
is: never,
|
||||
isSome: never,
|
||||
isNone: always,
|
||||
getOr: id,
|
||||
getOrThunk: call,
|
||||
getOrDie: function (msg) {
|
||||
throw new Error(msg || 'error: getOrDie called on none.');
|
||||
},
|
||||
getOrNull: nul,
|
||||
getOrUndefined: undef,
|
||||
getOrNull: constant(null),
|
||||
getOrUndefined: constant(undefined),
|
||||
or: id,
|
||||
orThunk: call,
|
||||
map: none,
|
||||
ap: none,
|
||||
each: noop,
|
||||
bind: none,
|
||||
flatten: none,
|
||||
exists: never$1,
|
||||
forall: always$1,
|
||||
exists: never,
|
||||
forall: always,
|
||||
filter: none,
|
||||
equals: eq,
|
||||
equals_: eq,
|
||||
@@ -89,20 +79,16 @@ var help = (function () {
|
||||
},
|
||||
toString: constant('none()')
|
||||
};
|
||||
if (Object.freeze)
|
||||
if (Object.freeze) {
|
||||
Object.freeze(me);
|
||||
}
|
||||
return me;
|
||||
}();
|
||||
var some = function (a) {
|
||||
var constant_a = function () {
|
||||
return a;
|
||||
};
|
||||
var constant_a = constant(a);
|
||||
var self = function () {
|
||||
return me;
|
||||
};
|
||||
var map = function (f) {
|
||||
return some(f(a));
|
||||
};
|
||||
var bind = function (f) {
|
||||
return f(a);
|
||||
};
|
||||
@@ -113,8 +99,8 @@ var help = (function () {
|
||||
is: function (v) {
|
||||
return a === v;
|
||||
},
|
||||
isSome: always$1,
|
||||
isNone: never$1,
|
||||
isSome: always,
|
||||
isNone: never,
|
||||
getOr: constant_a,
|
||||
getOrThunk: constant_a,
|
||||
getOrDie: constant_a,
|
||||
@@ -122,35 +108,31 @@ var help = (function () {
|
||||
getOrUndefined: constant_a,
|
||||
or: self,
|
||||
orThunk: self,
|
||||
map: map,
|
||||
ap: function (optfab) {
|
||||
return optfab.fold(none, function (fab) {
|
||||
return some(fab(a));
|
||||
});
|
||||
map: function (f) {
|
||||
return some(f(a));
|
||||
},
|
||||
each: function (f) {
|
||||
f(a);
|
||||
},
|
||||
bind: bind,
|
||||
flatten: constant_a,
|
||||
exists: bind,
|
||||
forall: bind,
|
||||
filter: function (f) {
|
||||
return f(a) ? me : NONE;
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never$1, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
},
|
||||
toArray: function () {
|
||||
return [a];
|
||||
},
|
||||
toString: function () {
|
||||
return 'some(' + a + ')';
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
}
|
||||
};
|
||||
return me;
|
||||
@@ -165,13 +147,16 @@ var help = (function () {
|
||||
};
|
||||
|
||||
var typeOf = function (x) {
|
||||
if (x === null)
|
||||
if (x === null) {
|
||||
return 'null';
|
||||
}
|
||||
var t = typeof x;
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array'))
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
||||
return 'array';
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String'))
|
||||
}
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
||||
return 'string';
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var isType = function (type) {
|
||||
@@ -181,17 +166,11 @@ var help = (function () {
|
||||
};
|
||||
var isFunction = isType('function');
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
var rawIndexOf = function () {
|
||||
var pIndexOf = Array.prototype.indexOf;
|
||||
var fastIndex = function (xs, x) {
|
||||
return pIndexOf.call(xs, x);
|
||||
};
|
||||
var slowIndex = function (xs, x) {
|
||||
return slowIndexOf(xs, x);
|
||||
};
|
||||
return pIndexOf === undefined ? slowIndex : fastIndex;
|
||||
}();
|
||||
var nativeSlice = Array.prototype.slice;
|
||||
var nativeIndexOf = Array.prototype.indexOf;
|
||||
var rawIndexOf = function (ts, t) {
|
||||
return nativeIndexOf.call(ts, t);
|
||||
};
|
||||
var contains = function (xs, x) {
|
||||
return rawIndexOf(xs, x) > -1;
|
||||
};
|
||||
@@ -200,7 +179,7 @@ var help = (function () {
|
||||
var r = new Array(len);
|
||||
for (var i = 0; i < len; i++) {
|
||||
var x = xs[i];
|
||||
r[i] = f(x, i, xs);
|
||||
r[i] = f(x, i);
|
||||
}
|
||||
return r;
|
||||
};
|
||||
@@ -208,7 +187,7 @@ var help = (function () {
|
||||
var r = [];
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
r.push(x);
|
||||
}
|
||||
}
|
||||
@@ -217,22 +196,14 @@ var help = (function () {
|
||||
var find = function (xs, pred) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
return Option.some(x);
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
var slowIndexOf = function (xs, x) {
|
||||
for (var i = 0, len = xs.length; i < len; ++i) {
|
||||
if (xs[i] === x) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return slice.call(x);
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.I18n');
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -67,8 +67,9 @@ var image = (function (domGlobals) {
|
||||
|
||||
var path = function (parts, scope) {
|
||||
var o = scope !== undefined && scope !== null ? scope : Global;
|
||||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
|
||||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
|
||||
o = o[parts[i]];
|
||||
}
|
||||
return o;
|
||||
};
|
||||
var resolve = function (p, scope) {
|
||||
@@ -81,8 +82,9 @@ var image = (function (domGlobals) {
|
||||
};
|
||||
var getOrDie = function (name, scope) {
|
||||
var actual = unsafe(name, scope);
|
||||
if (actual === undefined || actual === null)
|
||||
throw name + ' not available on this browser';
|
||||
if (actual === undefined || actual === null) {
|
||||
throw new Error(name + ' not available on this browser');
|
||||
}
|
||||
return actual;
|
||||
};
|
||||
var Global$1 = { getOrDie: getOrDie };
|
||||
@@ -255,17 +257,20 @@ var image = (function (domGlobals) {
|
||||
var baseMerge = function (merger) {
|
||||
return function () {
|
||||
var objects = new Array(arguments.length);
|
||||
for (var i = 0; i < objects.length; i++)
|
||||
for (var i = 0; i < objects.length; i++) {
|
||||
objects[i] = arguments[i];
|
||||
if (objects.length === 0)
|
||||
}
|
||||
if (objects.length === 0) {
|
||||
throw new Error('Can\'t merge zero objects');
|
||||
}
|
||||
var ret = {};
|
||||
for (var j = 0; j < objects.length; j++) {
|
||||
var curObject = objects[j];
|
||||
for (var key in curObject)
|
||||
for (var key in curObject) {
|
||||
if (hasOwnProperty.call(curObject, key)) {
|
||||
ret[key] = merger(ret[key], curObject[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -24,6 +24,8 @@ var imagetools = (function (domGlobals) {
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var noop = function () {
|
||||
};
|
||||
var constant = function (value) {
|
||||
return function () {
|
||||
return value;
|
||||
@@ -46,8 +48,6 @@ var imagetools = (function (domGlobals) {
|
||||
var never = constant(false);
|
||||
var always = constant(true);
|
||||
|
||||
var never$1 = never;
|
||||
var always$1 = always;
|
||||
var none = function () {
|
||||
return NONE;
|
||||
};
|
||||
@@ -61,37 +61,27 @@ var imagetools = (function (domGlobals) {
|
||||
var id = function (n) {
|
||||
return n;
|
||||
};
|
||||
var noop = function () {
|
||||
};
|
||||
var nul = function () {
|
||||
return null;
|
||||
};
|
||||
var undef = function () {
|
||||
return undefined;
|
||||
};
|
||||
var me = {
|
||||
fold: function (n, s) {
|
||||
return n();
|
||||
},
|
||||
is: never$1,
|
||||
isSome: never$1,
|
||||
isNone: always$1,
|
||||
is: never,
|
||||
isSome: never,
|
||||
isNone: always,
|
||||
getOr: id,
|
||||
getOrThunk: call,
|
||||
getOrDie: function (msg) {
|
||||
throw new Error(msg || 'error: getOrDie called on none.');
|
||||
},
|
||||
getOrNull: nul,
|
||||
getOrUndefined: undef,
|
||||
getOrNull: constant(null),
|
||||
getOrUndefined: constant(undefined),
|
||||
or: id,
|
||||
orThunk: call,
|
||||
map: none,
|
||||
ap: none,
|
||||
each: noop,
|
||||
bind: none,
|
||||
flatten: none,
|
||||
exists: never$1,
|
||||
forall: always$1,
|
||||
exists: never,
|
||||
forall: always,
|
||||
filter: none,
|
||||
equals: eq,
|
||||
equals_: eq,
|
||||
@@ -100,20 +90,16 @@ var imagetools = (function (domGlobals) {
|
||||
},
|
||||
toString: constant('none()')
|
||||
};
|
||||
if (Object.freeze)
|
||||
if (Object.freeze) {
|
||||
Object.freeze(me);
|
||||
}
|
||||
return me;
|
||||
}();
|
||||
var some = function (a) {
|
||||
var constant_a = function () {
|
||||
return a;
|
||||
};
|
||||
var constant_a = constant(a);
|
||||
var self = function () {
|
||||
return me;
|
||||
};
|
||||
var map = function (f) {
|
||||
return some(f(a));
|
||||
};
|
||||
var bind = function (f) {
|
||||
return f(a);
|
||||
};
|
||||
@@ -124,8 +110,8 @@ var imagetools = (function (domGlobals) {
|
||||
is: function (v) {
|
||||
return a === v;
|
||||
},
|
||||
isSome: always$1,
|
||||
isNone: never$1,
|
||||
isSome: always,
|
||||
isNone: never,
|
||||
getOr: constant_a,
|
||||
getOrThunk: constant_a,
|
||||
getOrDie: constant_a,
|
||||
@@ -133,35 +119,31 @@ var imagetools = (function (domGlobals) {
|
||||
getOrUndefined: constant_a,
|
||||
or: self,
|
||||
orThunk: self,
|
||||
map: map,
|
||||
ap: function (optfab) {
|
||||
return optfab.fold(none, function (fab) {
|
||||
return some(fab(a));
|
||||
});
|
||||
map: function (f) {
|
||||
return some(f(a));
|
||||
},
|
||||
each: function (f) {
|
||||
f(a);
|
||||
},
|
||||
bind: bind,
|
||||
flatten: constant_a,
|
||||
exists: bind,
|
||||
forall: bind,
|
||||
filter: function (f) {
|
||||
return f(a) ? me : NONE;
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never$1, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
},
|
||||
toArray: function () {
|
||||
return [a];
|
||||
},
|
||||
toString: function () {
|
||||
return 'some(' + a + ')';
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
}
|
||||
};
|
||||
return me;
|
||||
@@ -175,58 +157,6 @@ var imagetools = (function (domGlobals) {
|
||||
from: from
|
||||
};
|
||||
|
||||
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
|
||||
|
||||
var path = function (parts, scope) {
|
||||
var o = scope !== undefined && scope !== null ? scope : Global;
|
||||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
|
||||
o = o[parts[i]];
|
||||
return o;
|
||||
};
|
||||
var resolve = function (p, scope) {
|
||||
var parts = p.split('.');
|
||||
return path(parts, scope);
|
||||
};
|
||||
|
||||
var unsafe = function (name, scope) {
|
||||
return resolve(name, scope);
|
||||
};
|
||||
var getOrDie = function (name, scope) {
|
||||
var actual = unsafe(name, scope);
|
||||
if (actual === undefined || actual === null)
|
||||
throw name + ' not available on this browser';
|
||||
return actual;
|
||||
};
|
||||
var Global$1 = { getOrDie: getOrDie };
|
||||
|
||||
function SandBlob (parts, properties) {
|
||||
var f = Global$1.getOrDie('Blob');
|
||||
return new f(parts, properties);
|
||||
}
|
||||
|
||||
function FileReader () {
|
||||
var f = Global$1.getOrDie('FileReader');
|
||||
return new f();
|
||||
}
|
||||
|
||||
function Uint8Array (arr) {
|
||||
var f = Global$1.getOrDie('Uint8Array');
|
||||
return new f(arr);
|
||||
}
|
||||
|
||||
var requestAnimationFrame = function (callback) {
|
||||
var f = Global$1.getOrDie('requestAnimationFrame');
|
||||
f(callback);
|
||||
};
|
||||
var atob = function (base64) {
|
||||
var f = Global$1.getOrDie('atob');
|
||||
return f(base64);
|
||||
};
|
||||
var Window = {
|
||||
atob: atob,
|
||||
requestAnimationFrame: requestAnimationFrame
|
||||
};
|
||||
|
||||
function create(width, height) {
|
||||
return resize(domGlobals.document.createElement('canvas'), width, height);
|
||||
}
|
||||
@@ -494,7 +424,7 @@ var imagetools = (function (domGlobals) {
|
||||
var mimetype = matches[1];
|
||||
var base64 = data[1];
|
||||
var sliceSize = 1024;
|
||||
var byteCharacters = Window.atob(base64);
|
||||
var byteCharacters = domGlobals.atob(base64);
|
||||
var bytesLength = byteCharacters.length;
|
||||
var slicesCount = Math.ceil(bytesLength / sliceSize);
|
||||
var byteArrays = new Array(slicesCount);
|
||||
@@ -505,9 +435,9 @@ var imagetools = (function (domGlobals) {
|
||||
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
|
||||
bytes[i] = byteCharacters[offset].charCodeAt(0);
|
||||
}
|
||||
byteArrays[sliceIndex] = Uint8Array(bytes);
|
||||
byteArrays[sliceIndex] = new Uint8Array(bytes);
|
||||
}
|
||||
return Option.some(SandBlob(byteArrays, { type: mimetype }));
|
||||
return Option.some(new domGlobals.Blob(byteArrays, { type: mimetype }));
|
||||
}
|
||||
function dataUriToBlob(uri) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
@@ -547,7 +477,7 @@ var imagetools = (function (domGlobals) {
|
||||
}
|
||||
function blobToDataUri(blob) {
|
||||
return new Promise(function (resolve) {
|
||||
var reader = FileReader();
|
||||
var reader = new domGlobals.FileReader();
|
||||
reader.onloadend = function () {
|
||||
resolve(reader.result);
|
||||
};
|
||||
@@ -1352,6 +1282,32 @@ var imagetools = (function (domGlobals) {
|
||||
return fromBlob(blob);
|
||||
};
|
||||
|
||||
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
|
||||
|
||||
var path = function (parts, scope) {
|
||||
var o = scope !== undefined && scope !== null ? scope : Global;
|
||||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
|
||||
o = o[parts[i]];
|
||||
}
|
||||
return o;
|
||||
};
|
||||
var resolve = function (p, scope) {
|
||||
var parts = p.split('.');
|
||||
return path(parts, scope);
|
||||
};
|
||||
|
||||
var unsafe = function (name, scope) {
|
||||
return resolve(name, scope);
|
||||
};
|
||||
var getOrDie = function (name, scope) {
|
||||
var actual = unsafe(name, scope);
|
||||
if (actual === undefined || actual === null) {
|
||||
throw new Error(name + ' not available on this browser');
|
||||
}
|
||||
return actual;
|
||||
};
|
||||
var Global$1 = { getOrDie: getOrDie };
|
||||
|
||||
var url = function () {
|
||||
return Global$1.getOrDie('URL');
|
||||
};
|
||||
@@ -2592,13 +2548,16 @@ var imagetools = (function (domGlobals) {
|
||||
};
|
||||
|
||||
var typeOf = function (x) {
|
||||
if (x === null)
|
||||
if (x === null) {
|
||||
return 'null';
|
||||
}
|
||||
var t = typeof x;
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array'))
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
||||
return 'array';
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String'))
|
||||
}
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
||||
return 'string';
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var isType = function (type) {
|
||||
@@ -2608,20 +2567,25 @@ var imagetools = (function (domGlobals) {
|
||||
};
|
||||
var isFunction = isType('function');
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
var nativeSlice = Array.prototype.slice;
|
||||
var find = function (xs, pred) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
return Option.some(x);
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return slice.call(x);
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
|
||||
function FileReader () {
|
||||
var f = Global$1.getOrDie('FileReader');
|
||||
return new f();
|
||||
}
|
||||
|
||||
function XMLHttpRequest () {
|
||||
var f = Global$1.getOrDie('XMLHttpRequest');
|
||||
return new f();
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -204,6 +204,8 @@ var lists = (function (domGlobals) {
|
||||
resolveBookmark: resolveBookmark
|
||||
};
|
||||
|
||||
var noop = function () {
|
||||
};
|
||||
var constant = function (value) {
|
||||
return function () {
|
||||
return value;
|
||||
@@ -221,8 +223,6 @@ var lists = (function (domGlobals) {
|
||||
var never = constant(false);
|
||||
var always = constant(true);
|
||||
|
||||
var never$1 = never;
|
||||
var always$1 = always;
|
||||
var none = function () {
|
||||
return NONE;
|
||||
};
|
||||
@@ -236,37 +236,27 @@ var lists = (function (domGlobals) {
|
||||
var id = function (n) {
|
||||
return n;
|
||||
};
|
||||
var noop = function () {
|
||||
};
|
||||
var nul = function () {
|
||||
return null;
|
||||
};
|
||||
var undef = function () {
|
||||
return undefined;
|
||||
};
|
||||
var me = {
|
||||
fold: function (n, s) {
|
||||
return n();
|
||||
},
|
||||
is: never$1,
|
||||
isSome: never$1,
|
||||
isNone: always$1,
|
||||
is: never,
|
||||
isSome: never,
|
||||
isNone: always,
|
||||
getOr: id,
|
||||
getOrThunk: call,
|
||||
getOrDie: function (msg) {
|
||||
throw new Error(msg || 'error: getOrDie called on none.');
|
||||
},
|
||||
getOrNull: nul,
|
||||
getOrUndefined: undef,
|
||||
getOrNull: constant(null),
|
||||
getOrUndefined: constant(undefined),
|
||||
or: id,
|
||||
orThunk: call,
|
||||
map: none,
|
||||
ap: none,
|
||||
each: noop,
|
||||
bind: none,
|
||||
flatten: none,
|
||||
exists: never$1,
|
||||
forall: always$1,
|
||||
exists: never,
|
||||
forall: always,
|
||||
filter: none,
|
||||
equals: eq,
|
||||
equals_: eq,
|
||||
@@ -275,20 +265,16 @@ var lists = (function (domGlobals) {
|
||||
},
|
||||
toString: constant('none()')
|
||||
};
|
||||
if (Object.freeze)
|
||||
if (Object.freeze) {
|
||||
Object.freeze(me);
|
||||
}
|
||||
return me;
|
||||
}();
|
||||
var some = function (a) {
|
||||
var constant_a = function () {
|
||||
return a;
|
||||
};
|
||||
var constant_a = constant(a);
|
||||
var self = function () {
|
||||
return me;
|
||||
};
|
||||
var map = function (f) {
|
||||
return some(f(a));
|
||||
};
|
||||
var bind = function (f) {
|
||||
return f(a);
|
||||
};
|
||||
@@ -299,8 +285,8 @@ var lists = (function (domGlobals) {
|
||||
is: function (v) {
|
||||
return a === v;
|
||||
},
|
||||
isSome: always$1,
|
||||
isNone: never$1,
|
||||
isSome: always,
|
||||
isNone: never,
|
||||
getOr: constant_a,
|
||||
getOrThunk: constant_a,
|
||||
getOrDie: constant_a,
|
||||
@@ -308,35 +294,31 @@ var lists = (function (domGlobals) {
|
||||
getOrUndefined: constant_a,
|
||||
or: self,
|
||||
orThunk: self,
|
||||
map: map,
|
||||
ap: function (optfab) {
|
||||
return optfab.fold(none, function (fab) {
|
||||
return some(fab(a));
|
||||
});
|
||||
map: function (f) {
|
||||
return some(f(a));
|
||||
},
|
||||
each: function (f) {
|
||||
f(a);
|
||||
},
|
||||
bind: bind,
|
||||
flatten: constant_a,
|
||||
exists: bind,
|
||||
forall: bind,
|
||||
filter: function (f) {
|
||||
return f(a) ? me : NONE;
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never$1, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
},
|
||||
toArray: function () {
|
||||
return [a];
|
||||
},
|
||||
toString: function () {
|
||||
return 'some(' + a + ')';
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
}
|
||||
};
|
||||
return me;
|
||||
@@ -351,13 +333,16 @@ var lists = (function (domGlobals) {
|
||||
};
|
||||
|
||||
var typeOf = function (x) {
|
||||
if (x === null)
|
||||
if (x === null) {
|
||||
return 'null';
|
||||
}
|
||||
var t = typeof x;
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array'))
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
||||
return 'array';
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String'))
|
||||
}
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
||||
return 'string';
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var isType = function (type) {
|
||||
@@ -366,31 +351,33 @@ var lists = (function (domGlobals) {
|
||||
};
|
||||
};
|
||||
var isString = isType('string');
|
||||
var isArray = isType('array');
|
||||
var isBoolean = isType('boolean');
|
||||
var isFunction = isType('function');
|
||||
var isNumber = isType('number');
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
var nativeSlice = Array.prototype.slice;
|
||||
var nativePush = Array.prototype.push;
|
||||
var map = function (xs, f) {
|
||||
var len = xs.length;
|
||||
var r = new Array(len);
|
||||
for (var i = 0; i < len; i++) {
|
||||
var x = xs[i];
|
||||
r[i] = f(x, i, xs);
|
||||
r[i] = f(x, i);
|
||||
}
|
||||
return r;
|
||||
};
|
||||
var each = function (xs, f) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
f(x, i, xs);
|
||||
f(x, i);
|
||||
}
|
||||
};
|
||||
var filter = function (xs, pred) {
|
||||
var r = [];
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
r.push(x);
|
||||
}
|
||||
}
|
||||
@@ -428,19 +415,19 @@ var lists = (function (domGlobals) {
|
||||
var find = function (xs, pred) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
return Option.some(x);
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
var push = Array.prototype.push;
|
||||
var flatten = function (xs) {
|
||||
var r = [];
|
||||
for (var i = 0, len = xs.length; i < len; ++i) {
|
||||
if (!Array.prototype.isPrototypeOf(xs[i]))
|
||||
if (!isArray(xs[i])) {
|
||||
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
|
||||
push.apply(r, xs[i]);
|
||||
}
|
||||
nativePush.apply(r, xs[i]);
|
||||
}
|
||||
return r;
|
||||
};
|
||||
@@ -449,7 +436,7 @@ var lists = (function (domGlobals) {
|
||||
return flatten(output);
|
||||
};
|
||||
var reverse = function (xs) {
|
||||
var r = slice.call(xs, 0);
|
||||
var r = nativeSlice.call(xs, 0);
|
||||
r.reverse();
|
||||
return r;
|
||||
};
|
||||
@@ -460,15 +447,16 @@ var lists = (function (domGlobals) {
|
||||
return xs.length === 0 ? Option.none() : Option.some(xs[xs.length - 1]);
|
||||
};
|
||||
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return slice.call(x);
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
|
||||
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
|
||||
|
||||
var path = function (parts, scope) {
|
||||
var o = scope !== undefined && scope !== null ? scope : Global;
|
||||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
|
||||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
|
||||
o = o[parts[i]];
|
||||
}
|
||||
return o;
|
||||
};
|
||||
var resolve = function (p, scope) {
|
||||
@@ -481,8 +469,9 @@ var lists = (function (domGlobals) {
|
||||
};
|
||||
var getOrDie = function (name, scope) {
|
||||
var actual = unsafe(name, scope);
|
||||
if (actual === undefined || actual === null)
|
||||
throw name + ' not available on this browser';
|
||||
if (actual === undefined || actual === null) {
|
||||
throw new Error(name + ' not available on this browser');
|
||||
}
|
||||
return actual;
|
||||
};
|
||||
var Global$1 = { getOrDie: getOrDie };
|
||||
@@ -613,17 +602,8 @@ var lists = (function (domGlobals) {
|
||||
fromPoint: fromPoint
|
||||
};
|
||||
|
||||
var liftN = function (arr, f) {
|
||||
var r = [];
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
var x = arr[i];
|
||||
if (x.isSome()) {
|
||||
r.push(x.getOrDie());
|
||||
} else {
|
||||
return Option.none();
|
||||
}
|
||||
}
|
||||
return Option.some(f.apply(null, r));
|
||||
var lift2 = function (oa, ob, f) {
|
||||
return oa.isSome() && ob.isSome() ? Option.some(f(oa.getOrDie(), ob.getOrDie())) : Option.none();
|
||||
};
|
||||
|
||||
var fromElements = function (elements, scope) {
|
||||
@@ -662,7 +642,7 @@ var lists = (function (domGlobals) {
|
||||
for (var k = 0, len = props.length; k < len; k++) {
|
||||
var i = props[k];
|
||||
var x = obj[i];
|
||||
f(x, i, obj);
|
||||
f(x, i);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -703,18 +683,20 @@ var lists = (function (domGlobals) {
|
||||
var firstMatch = function (regexes, s) {
|
||||
for (var i = 0; i < regexes.length; i++) {
|
||||
var x = regexes[i];
|
||||
if (x.test(s))
|
||||
if (x.test(s)) {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
var find$1 = function (regexes, agent) {
|
||||
var r = firstMatch(regexes, agent);
|
||||
if (!r)
|
||||
if (!r) {
|
||||
return {
|
||||
major: 0,
|
||||
minor: 0
|
||||
};
|
||||
}
|
||||
var group = function (i) {
|
||||
return Number(agent.replace(r, '$' + i));
|
||||
};
|
||||
@@ -722,8 +704,9 @@ var lists = (function (domGlobals) {
|
||||
};
|
||||
var detect = function (versionRegexes, agent) {
|
||||
var cleanedAgent = String(agent).toLowerCase();
|
||||
if (versionRegexes.length === 0)
|
||||
if (versionRegexes.length === 0) {
|
||||
return unknown();
|
||||
}
|
||||
return find$1(versionRegexes, cleanedAgent);
|
||||
};
|
||||
var unknown = function () {
|
||||
@@ -893,8 +876,7 @@ var lists = (function (domGlobals) {
|
||||
name: 'Edge',
|
||||
versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
|
||||
search: function (uastring) {
|
||||
var monstrosity = contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit');
|
||||
return monstrosity;
|
||||
return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit');
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1024,19 +1006,22 @@ var lists = (function (domGlobals) {
|
||||
|
||||
var ELEMENT$1 = ELEMENT;
|
||||
var is = function (element, selector) {
|
||||
var elem = element.dom();
|
||||
if (elem.nodeType !== ELEMENT$1) {
|
||||
var dom = element.dom();
|
||||
if (dom.nodeType !== ELEMENT$1) {
|
||||
return false;
|
||||
} else if (elem.matches !== undefined) {
|
||||
return elem.matches(selector);
|
||||
} else if (elem.msMatchesSelector !== undefined) {
|
||||
return elem.msMatchesSelector(selector);
|
||||
} else if (elem.webkitMatchesSelector !== undefined) {
|
||||
return elem.webkitMatchesSelector(selector);
|
||||
} else if (elem.mozMatchesSelector !== undefined) {
|
||||
return elem.mozMatchesSelector(selector);
|
||||
} else {
|
||||
throw new Error('Browser lacks native selectors');
|
||||
var elem = dom;
|
||||
if (elem.matches !== undefined) {
|
||||
return elem.matches(selector);
|
||||
} else if (elem.msMatchesSelector !== undefined) {
|
||||
return elem.msMatchesSelector(selector);
|
||||
} else if (elem.webkitMatchesSelector !== undefined) {
|
||||
return elem.webkitMatchesSelector(selector);
|
||||
} else if (elem.mozMatchesSelector !== undefined) {
|
||||
return elem.mozMatchesSelector(selector);
|
||||
} else {
|
||||
throw new Error('Browser lacks native selectors');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1056,12 +1041,10 @@ var lists = (function (domGlobals) {
|
||||
var is$1 = is;
|
||||
|
||||
var parent = function (element) {
|
||||
var dom = element.dom();
|
||||
return Option.from(dom.parentNode).map(Element.fromDom);
|
||||
return Option.from(element.dom().parentNode).map(Element.fromDom);
|
||||
};
|
||||
var children = function (element) {
|
||||
var dom = element.dom();
|
||||
return map(dom.childNodes, Element.fromDom);
|
||||
return map(element.dom().childNodes, Element.fromDom);
|
||||
};
|
||||
var child = function (element, index) {
|
||||
var cs = element.dom().childNodes;
|
||||
@@ -1107,6 +1090,15 @@ var lists = (function (domGlobals) {
|
||||
var r = element.dom().nodeName;
|
||||
return r.toLowerCase();
|
||||
};
|
||||
var type = function (element) {
|
||||
return element.dom().nodeType;
|
||||
};
|
||||
var isType$1 = function (t) {
|
||||
return function (element) {
|
||||
return type(element) === t;
|
||||
};
|
||||
};
|
||||
var isElement = isType$1(ELEMENT);
|
||||
|
||||
var rawSet = function (dom, key, value) {
|
||||
if (isString(value) || isBoolean(value) || isNumber(value)) {
|
||||
@@ -1177,10 +1169,7 @@ var lists = (function (domGlobals) {
|
||||
}
|
||||
};
|
||||
var appendSegments = function (head$1, tail) {
|
||||
liftN([
|
||||
last(head$1),
|
||||
head(tail)
|
||||
], joinSegment);
|
||||
lift2(last(head$1), head(tail), joinSegment);
|
||||
};
|
||||
var createSegment = function (scope, listType) {
|
||||
var segment = {
|
||||
@@ -1270,7 +1259,7 @@ var lists = (function (domGlobals) {
|
||||
return map(content, deep);
|
||||
};
|
||||
var createEntry = function (li, depth, isSelected) {
|
||||
return parent(li).map(function (list) {
|
||||
return parent(li).filter(isElement).map(function (list) {
|
||||
return {
|
||||
depth: depth,
|
||||
isSelected: isSelected,
|
||||
@@ -1302,17 +1291,20 @@ var lists = (function (domGlobals) {
|
||||
var baseMerge = function (merger) {
|
||||
return function () {
|
||||
var objects = new Array(arguments.length);
|
||||
for (var i = 0; i < objects.length; i++)
|
||||
for (var i = 0; i < objects.length; i++) {
|
||||
objects[i] = arguments[i];
|
||||
if (objects.length === 0)
|
||||
}
|
||||
if (objects.length === 0) {
|
||||
throw new Error('Can\'t merge zero objects');
|
||||
}
|
||||
var ret = {};
|
||||
for (var j = 0; j < objects.length; j++) {
|
||||
var curObject = objects[j];
|
||||
for (var key in curObject)
|
||||
for (var key in curObject) {
|
||||
if (hasOwnProperty.call(curObject, key)) {
|
||||
ret[key] = merger(ret[key], curObject[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
@@ -1474,10 +1466,7 @@ var lists = (function (domGlobals) {
|
||||
};
|
||||
var getItemSelection = function (editor) {
|
||||
var selectedListItems = map(Selection.getSelectedListItems(editor), Element.fromDom);
|
||||
return liftN([
|
||||
find(selectedListItems, not(hasFirstChildList)),
|
||||
find(reverse(selectedListItems), not(hasFirstChildList))
|
||||
], function (start, end) {
|
||||
return lift2(find(selectedListItems, not(hasFirstChildList)), find(reverse(selectedListItems), not(hasFirstChildList)), function (start, end) {
|
||||
return {
|
||||
start: start,
|
||||
end: end
|
||||
@@ -1529,17 +1518,17 @@ var lists = (function (domGlobals) {
|
||||
var SplitList = { splitList: splitList };
|
||||
|
||||
var outdentDlItem = function (editor, item) {
|
||||
if (is$1(item, 'DD')) {
|
||||
mutate(item, 'DT');
|
||||
} else if (is$1(item, 'DT')) {
|
||||
if (is$1(item, 'dd')) {
|
||||
mutate(item, 'dt');
|
||||
} else if (is$1(item, 'dt')) {
|
||||
parent(item).each(function (dl) {
|
||||
return SplitList.splitList(editor, dl.dom(), item.dom());
|
||||
});
|
||||
}
|
||||
};
|
||||
var indentDlItem = function (item) {
|
||||
if (is$1(item, 'DT')) {
|
||||
mutate(item, 'DD');
|
||||
if (is$1(item, 'dt')) {
|
||||
mutate(item, 'dd');
|
||||
}
|
||||
};
|
||||
var dlIndentation = function (editor, indentation, dlItems) {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -47,9 +47,154 @@ var media = (function () {
|
||||
hasDimensions: hasDimensions
|
||||
};
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.html.SaxParser');
|
||||
var Cell = function (initial) {
|
||||
var value = initial;
|
||||
var get = function () {
|
||||
return value;
|
||||
};
|
||||
var set = function (v) {
|
||||
value = v;
|
||||
};
|
||||
var clone = function () {
|
||||
return Cell(get());
|
||||
};
|
||||
return {
|
||||
get: get,
|
||||
set: set,
|
||||
clone: clone
|
||||
};
|
||||
};
|
||||
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
var noop = function () {
|
||||
};
|
||||
var constant = function (value) {
|
||||
return function () {
|
||||
return value;
|
||||
};
|
||||
};
|
||||
var never = constant(false);
|
||||
var always = constant(true);
|
||||
|
||||
var none = function () {
|
||||
return NONE;
|
||||
};
|
||||
var NONE = function () {
|
||||
var eq = function (o) {
|
||||
return o.isNone();
|
||||
};
|
||||
var call = function (thunk) {
|
||||
return thunk();
|
||||
};
|
||||
var id = function (n) {
|
||||
return n;
|
||||
};
|
||||
var me = {
|
||||
fold: function (n, s) {
|
||||
return n();
|
||||
},
|
||||
is: never,
|
||||
isSome: never,
|
||||
isNone: always,
|
||||
getOr: id,
|
||||
getOrThunk: call,
|
||||
getOrDie: function (msg) {
|
||||
throw new Error(msg || 'error: getOrDie called on none.');
|
||||
},
|
||||
getOrNull: constant(null),
|
||||
getOrUndefined: constant(undefined),
|
||||
or: id,
|
||||
orThunk: call,
|
||||
map: none,
|
||||
each: noop,
|
||||
bind: none,
|
||||
exists: never,
|
||||
forall: always,
|
||||
filter: none,
|
||||
equals: eq,
|
||||
equals_: eq,
|
||||
toArray: function () {
|
||||
return [];
|
||||
},
|
||||
toString: constant('none()')
|
||||
};
|
||||
if (Object.freeze) {
|
||||
Object.freeze(me);
|
||||
}
|
||||
return me;
|
||||
}();
|
||||
var some = function (a) {
|
||||
var constant_a = constant(a);
|
||||
var self = function () {
|
||||
return me;
|
||||
};
|
||||
var bind = function (f) {
|
||||
return f(a);
|
||||
};
|
||||
var me = {
|
||||
fold: function (n, s) {
|
||||
return s(a);
|
||||
},
|
||||
is: function (v) {
|
||||
return a === v;
|
||||
},
|
||||
isSome: always,
|
||||
isNone: never,
|
||||
getOr: constant_a,
|
||||
getOrThunk: constant_a,
|
||||
getOrDie: constant_a,
|
||||
getOrNull: constant_a,
|
||||
getOrUndefined: constant_a,
|
||||
or: self,
|
||||
orThunk: self,
|
||||
map: function (f) {
|
||||
return some(f(a));
|
||||
},
|
||||
each: function (f) {
|
||||
f(a);
|
||||
},
|
||||
bind: bind,
|
||||
exists: bind,
|
||||
forall: bind,
|
||||
filter: function (f) {
|
||||
return f(a) ? me : NONE;
|
||||
},
|
||||
toArray: function () {
|
||||
return [a];
|
||||
},
|
||||
toString: function () {
|
||||
return 'some(' + a + ')';
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
}
|
||||
};
|
||||
return me;
|
||||
};
|
||||
var from = function (value) {
|
||||
return value === null || value === undefined ? NONE : some(value);
|
||||
};
|
||||
var Option = {
|
||||
some: some,
|
||||
none: none,
|
||||
from: from
|
||||
};
|
||||
|
||||
var hasOwnProperty = Object.hasOwnProperty;
|
||||
var get = function (obj, key) {
|
||||
return has(obj, key) ? Option.from(obj[key]) : Option.none();
|
||||
};
|
||||
var has = function (obj, key) {
|
||||
return hasOwnProperty.call(obj, key);
|
||||
};
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.html.SaxParser');
|
||||
|
||||
var getVideoScriptMatch = function (prefixes, src) {
|
||||
if (prefixes) {
|
||||
@@ -62,76 +207,65 @@ var media = (function () {
|
||||
};
|
||||
var VideoScript = { getVideoScriptMatch: getVideoScriptMatch };
|
||||
|
||||
var DOM = global$3.DOM;
|
||||
var trimPx = function (value) {
|
||||
return value.replace(/px$/, '');
|
||||
};
|
||||
var addPx = function (value) {
|
||||
return /^[0-9.]+$/.test(value) ? value + 'px' : value;
|
||||
};
|
||||
var getSize = function (name) {
|
||||
return function (elm) {
|
||||
return elm ? trimPx(elm.style[name]) : '';
|
||||
var getEphoxEmbedData = function (attrs) {
|
||||
var style = attrs.map.style;
|
||||
var styles = style ? DOM.parseStyle(style) : {};
|
||||
return {
|
||||
type: 'ephox-embed-iri',
|
||||
source1: attrs.map['data-ephox-embed-iri'],
|
||||
source2: '',
|
||||
poster: '',
|
||||
width: get(styles, 'max-width').map(trimPx).getOr(''),
|
||||
height: get(styles, 'max-height').map(trimPx).getOr('')
|
||||
};
|
||||
};
|
||||
var setSize = function (name) {
|
||||
return function (elm, value) {
|
||||
if (elm) {
|
||||
elm.style[name] = addPx(value);
|
||||
}
|
||||
};
|
||||
};
|
||||
var Size = {
|
||||
getMaxWidth: getSize('maxWidth'),
|
||||
getMaxHeight: getSize('maxHeight'),
|
||||
setMaxWidth: setSize('maxWidth'),
|
||||
setMaxHeight: setSize('maxHeight')
|
||||
};
|
||||
|
||||
var DOM = global$4.DOM;
|
||||
var getEphoxEmbedIri = function (elm) {
|
||||
return DOM.getAttrib(elm, 'data-ephox-embed-iri');
|
||||
};
|
||||
var isEphoxEmbed = function (html) {
|
||||
var fragment = DOM.createFragment(html);
|
||||
return getEphoxEmbedIri(fragment.firstChild) !== '';
|
||||
};
|
||||
var htmlToDataSax = function (prefixes, html) {
|
||||
var htmlToData = function (prefixes, html) {
|
||||
var isEphoxEmbed = Cell(false);
|
||||
var data = {};
|
||||
global$3({
|
||||
global$4({
|
||||
validate: false,
|
||||
allow_conditional_comments: true,
|
||||
special: 'script,noscript',
|
||||
start: function (name, attrs) {
|
||||
if (!data.source1 && name === 'param') {
|
||||
data.source1 = attrs.map.movie;
|
||||
}
|
||||
if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') {
|
||||
if (!data.type) {
|
||||
data.type = name;
|
||||
if (isEphoxEmbed.get()) ; else if (has(attrs.map, 'data-ephox-embed-iri')) {
|
||||
isEphoxEmbed.set(true);
|
||||
data = getEphoxEmbedData(attrs);
|
||||
} else {
|
||||
if (!data.source1 && name === 'param') {
|
||||
data.source1 = attrs.map.movie;
|
||||
}
|
||||
data = global$2.extend(attrs.map, data);
|
||||
}
|
||||
if (name === 'script') {
|
||||
var videoScript = VideoScript.getVideoScriptMatch(prefixes, attrs.map.src);
|
||||
if (!videoScript) {
|
||||
return;
|
||||
if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') {
|
||||
if (!data.type) {
|
||||
data.type = name;
|
||||
}
|
||||
data = global$2.extend(attrs.map, data);
|
||||
}
|
||||
data = {
|
||||
type: 'script',
|
||||
source1: attrs.map.src,
|
||||
width: videoScript.width,
|
||||
height: videoScript.height
|
||||
};
|
||||
}
|
||||
if (name === 'source') {
|
||||
if (!data.source1) {
|
||||
data.source1 = attrs.map.src;
|
||||
} else if (!data.source2) {
|
||||
data.source2 = attrs.map.src;
|
||||
if (name === 'script') {
|
||||
var videoScript = VideoScript.getVideoScriptMatch(prefixes, attrs.map.src);
|
||||
if (!videoScript) {
|
||||
return;
|
||||
}
|
||||
data = {
|
||||
type: 'script',
|
||||
source1: attrs.map.src,
|
||||
width: videoScript.width,
|
||||
height: videoScript.height
|
||||
};
|
||||
}
|
||||
if (name === 'source') {
|
||||
if (!data.source1) {
|
||||
data.source1 = attrs.map.src;
|
||||
} else if (!data.source2) {
|
||||
data.source2 = attrs.map.src;
|
||||
}
|
||||
}
|
||||
if (name === 'img' && !data.poster) {
|
||||
data.poster = attrs.map.src;
|
||||
}
|
||||
}
|
||||
if (name === 'img' && !data.poster) {
|
||||
data.poster = attrs.map.src;
|
||||
}
|
||||
}
|
||||
}).parse(html);
|
||||
@@ -140,21 +274,6 @@ var media = (function () {
|
||||
data.poster = data.poster || '';
|
||||
return data;
|
||||
};
|
||||
var ephoxEmbedHtmlToData = function (html) {
|
||||
var fragment = DOM.createFragment(html);
|
||||
var div = fragment.firstChild;
|
||||
return {
|
||||
type: 'ephox-embed-iri',
|
||||
source1: getEphoxEmbedIri(div),
|
||||
source2: '',
|
||||
poster: '',
|
||||
width: Size.getMaxWidth(div),
|
||||
height: Size.getMaxHeight(div)
|
||||
};
|
||||
};
|
||||
var htmlToData = function (prefixes, html) {
|
||||
return isEphoxEmbed(html) ? ephoxEmbedHtmlToData(html) : htmlToDataSax(prefixes, html);
|
||||
};
|
||||
var HtmlToData = { htmlToData: htmlToData };
|
||||
|
||||
var global$5 = tinymce.util.Tools.resolve('tinymce.util.Promise');
|
||||
@@ -174,22 +293,21 @@ var media = (function () {
|
||||
};
|
||||
var Mime = { guess: guess };
|
||||
|
||||
var global$6 = tinymce.util.Tools.resolve('tinymce.html.Writer');
|
||||
var global$6 = tinymce.util.Tools.resolve('tinymce.html.Schema');
|
||||
|
||||
var global$7 = tinymce.util.Tools.resolve('tinymce.html.Schema');
|
||||
var global$7 = tinymce.util.Tools.resolve('tinymce.html.Writer');
|
||||
|
||||
var DOM$1 = global$4.DOM;
|
||||
var DOM$1 = global$3.DOM;
|
||||
var addPx = function (value) {
|
||||
return /^[0-9.]+$/.test(value) ? value + 'px' : value;
|
||||
};
|
||||
var setAttributes = function (attrs, updatedAttrs) {
|
||||
var name;
|
||||
var i;
|
||||
var value;
|
||||
var attr;
|
||||
for (name in updatedAttrs) {
|
||||
value = '' + updatedAttrs[name];
|
||||
for (var name in updatedAttrs) {
|
||||
var value = '' + updatedAttrs[name];
|
||||
if (attrs.map[name]) {
|
||||
i = attrs.length;
|
||||
var i = attrs.length;
|
||||
while (i--) {
|
||||
attr = attrs[i];
|
||||
var attr = attrs[i];
|
||||
if (attr.name === name) {
|
||||
if (value) {
|
||||
attrs.map[name] = value;
|
||||
@@ -209,17 +327,19 @@ var media = (function () {
|
||||
}
|
||||
}
|
||||
};
|
||||
var normalizeHtml = function (html) {
|
||||
var writer = global$6();
|
||||
var parser = global$3(writer);
|
||||
parser.parse(html);
|
||||
return writer.getContent();
|
||||
var updateEphoxEmbed = function (data, attrs) {
|
||||
var style = attrs.map.style;
|
||||
var styleMap = style ? DOM$1.parseStyle(style) : {};
|
||||
styleMap['max-width'] = addPx(data.width);
|
||||
styleMap['max-height'] = addPx(data.height);
|
||||
setAttributes(attrs, { style: DOM$1.serializeStyle(styleMap) });
|
||||
};
|
||||
var updateHtmlSax = function (html, data, updateAll) {
|
||||
var writer = global$6();
|
||||
var updateHtml = function (html, data, updateAll) {
|
||||
var writer = global$7();
|
||||
var isEphoxEmbed = Cell(false);
|
||||
var sourceCount = 0;
|
||||
var hasImage;
|
||||
global$3({
|
||||
global$4({
|
||||
validate: false,
|
||||
allow_conditional_comments: true,
|
||||
special: 'script,noscript',
|
||||
@@ -233,101 +353,94 @@ var media = (function () {
|
||||
writer.text(text, raw);
|
||||
},
|
||||
start: function (name, attrs, empty) {
|
||||
switch (name) {
|
||||
case 'video':
|
||||
case 'object':
|
||||
case 'embed':
|
||||
case 'img':
|
||||
case 'iframe':
|
||||
if (data.height !== undefined && data.width !== undefined) {
|
||||
setAttributes(attrs, {
|
||||
width: data.width,
|
||||
height: data.height
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (updateAll) {
|
||||
if (isEphoxEmbed.get()) ; else if (has(attrs.map, 'data-ephox-embed-iri')) {
|
||||
isEphoxEmbed.set(true);
|
||||
updateEphoxEmbed(data, attrs);
|
||||
} else {
|
||||
switch (name) {
|
||||
case 'video':
|
||||
setAttributes(attrs, {
|
||||
poster: data.poster,
|
||||
src: ''
|
||||
});
|
||||
if (data.source2) {
|
||||
setAttributes(attrs, { src: '' });
|
||||
case 'object':
|
||||
case 'embed':
|
||||
case 'img':
|
||||
case 'iframe':
|
||||
if (data.height !== undefined && data.width !== undefined) {
|
||||
setAttributes(attrs, {
|
||||
width: data.width,
|
||||
height: data.height
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'iframe':
|
||||
setAttributes(attrs, { src: data.source1 });
|
||||
break;
|
||||
case 'source':
|
||||
sourceCount++;
|
||||
if (sourceCount <= 2) {
|
||||
}
|
||||
if (updateAll) {
|
||||
switch (name) {
|
||||
case 'video':
|
||||
setAttributes(attrs, {
|
||||
src: data['source' + sourceCount],
|
||||
type: data['source' + sourceCount + 'mime']
|
||||
poster: data.poster,
|
||||
src: ''
|
||||
});
|
||||
if (!data['source' + sourceCount]) {
|
||||
if (data.source2) {
|
||||
setAttributes(attrs, { src: '' });
|
||||
}
|
||||
break;
|
||||
case 'iframe':
|
||||
setAttributes(attrs, { src: data.source1 });
|
||||
break;
|
||||
case 'source':
|
||||
sourceCount++;
|
||||
if (sourceCount <= 2) {
|
||||
setAttributes(attrs, {
|
||||
src: data['source' + sourceCount],
|
||||
type: data['source' + sourceCount + 'mime']
|
||||
});
|
||||
if (!data['source' + sourceCount]) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'img':
|
||||
if (!data.poster) {
|
||||
return;
|
||||
}
|
||||
hasImage = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'img':
|
||||
if (!data.poster) {
|
||||
return;
|
||||
}
|
||||
hasImage = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
writer.start(name, attrs, empty);
|
||||
},
|
||||
end: function (name) {
|
||||
if (name === 'video' && updateAll) {
|
||||
for (var index = 1; index <= 2; index++) {
|
||||
if (data['source' + index]) {
|
||||
var attrs = [];
|
||||
attrs.map = {};
|
||||
if (sourceCount < index) {
|
||||
setAttributes(attrs, {
|
||||
src: data['source' + index],
|
||||
type: data['source' + index + 'mime']
|
||||
});
|
||||
writer.start('source', attrs, true);
|
||||
if (!isEphoxEmbed.get()) {
|
||||
if (name === 'video' && updateAll) {
|
||||
for (var index = 1; index <= 2; index++) {
|
||||
if (data['source' + index]) {
|
||||
var attrs = [];
|
||||
attrs.map = {};
|
||||
if (sourceCount < index) {
|
||||
setAttributes(attrs, {
|
||||
src: data['source' + index],
|
||||
type: data['source' + index + 'mime']
|
||||
});
|
||||
writer.start('source', attrs, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.poster && name === 'object' && updateAll && !hasImage) {
|
||||
var imgAttrs = [];
|
||||
imgAttrs.map = {};
|
||||
setAttributes(imgAttrs, {
|
||||
src: data.poster,
|
||||
width: data.width,
|
||||
height: data.height
|
||||
});
|
||||
writer.start('img', imgAttrs, true);
|
||||
if (data.poster && name === 'object' && updateAll && !hasImage) {
|
||||
var imgAttrs = [];
|
||||
imgAttrs.map = {};
|
||||
setAttributes(imgAttrs, {
|
||||
src: data.poster,
|
||||
width: data.width,
|
||||
height: data.height
|
||||
});
|
||||
writer.start('img', imgAttrs, true);
|
||||
}
|
||||
}
|
||||
writer.end(name);
|
||||
}
|
||||
}, global$7({})).parse(html);
|
||||
}, global$6({})).parse(html);
|
||||
return writer.getContent();
|
||||
};
|
||||
var isEphoxEmbed$1 = function (html) {
|
||||
var fragment = DOM$1.createFragment(html);
|
||||
return DOM$1.getAttrib(fragment.firstChild, 'data-ephox-embed-iri') !== '';
|
||||
};
|
||||
var updateEphoxEmbed = function (html, data) {
|
||||
var fragment = DOM$1.createFragment(html);
|
||||
var div = fragment.firstChild;
|
||||
Size.setMaxWidth(div, data.width);
|
||||
Size.setMaxHeight(div, data.height);
|
||||
return normalizeHtml(div.outerHTML);
|
||||
};
|
||||
var updateHtml = function (html, data, updateAll) {
|
||||
return isEphoxEmbed$1(html) ? updateEphoxEmbed(html, data) : updateHtmlSax(html, data, updateAll);
|
||||
};
|
||||
var UpdateHtml = { updateHtml: updateHtml };
|
||||
|
||||
var urlPatterns = [
|
||||
@@ -551,6 +664,31 @@ var media = (function () {
|
||||
isCached: isCached
|
||||
};
|
||||
|
||||
var trimPx$1 = function (value) {
|
||||
return value.replace(/px$/, '');
|
||||
};
|
||||
var addPx$1 = function (value) {
|
||||
return /^[0-9.]+$/.test(value) ? value + 'px' : value;
|
||||
};
|
||||
var getSize = function (name) {
|
||||
return function (elm) {
|
||||
return elm ? trimPx$1(elm.style[name]) : '';
|
||||
};
|
||||
};
|
||||
var setSize = function (name) {
|
||||
return function (elm, value) {
|
||||
if (elm) {
|
||||
elm.style[name] = addPx$1(value);
|
||||
}
|
||||
};
|
||||
};
|
||||
var Size = {
|
||||
getMaxWidth: getSize('maxWidth'),
|
||||
getMaxHeight: getSize('maxHeight'),
|
||||
setMaxWidth: setSize('maxWidth'),
|
||||
setMaxHeight: setSize('maxHeight')
|
||||
};
|
||||
|
||||
var doSyncSize = function (widthCtrl, heightCtrl) {
|
||||
widthCtrl.state.set('oldVal', widthCtrl.value());
|
||||
heightCtrl.state.set('oldVal', heightCtrl.value());
|
||||
@@ -825,13 +963,13 @@ var media = (function () {
|
||||
};
|
||||
var Dialog = { showDialog: showDialog };
|
||||
|
||||
var get = function (editor) {
|
||||
var get$1 = function (editor) {
|
||||
var showDialog = function () {
|
||||
Dialog.showDialog(editor);
|
||||
};
|
||||
return { showDialog: showDialog };
|
||||
};
|
||||
var Api = { get: get };
|
||||
var Api = { get: get$1 };
|
||||
|
||||
var register = function (editor) {
|
||||
var showDialog = function () {
|
||||
@@ -847,9 +985,9 @@ var media = (function () {
|
||||
if (Settings.shouldFilterHtml(editor) === false) {
|
||||
return html;
|
||||
}
|
||||
var writer = global$6();
|
||||
var writer = global$7();
|
||||
var blocked;
|
||||
global$3({
|
||||
global$4({
|
||||
validate: false,
|
||||
allow_conditional_comments: false,
|
||||
special: 'script,noscript',
|
||||
@@ -864,14 +1002,16 @@ var media = (function () {
|
||||
},
|
||||
start: function (name, attrs, empty) {
|
||||
blocked = true;
|
||||
if (name === 'script' || name === 'noscript') {
|
||||
if (name === 'script' || name === 'noscript' || name === 'svg') {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < attrs.length; i++) {
|
||||
if (attrs[i].name.indexOf('on') === 0) {
|
||||
return;
|
||||
for (var i = attrs.length - 1; i >= 0; i--) {
|
||||
var attrName = attrs[i].name;
|
||||
if (attrName.indexOf('on') === 0) {
|
||||
delete attrs.map[attrName];
|
||||
attrs.splice(i, 1);
|
||||
}
|
||||
if (attrs[i].name === 'style') {
|
||||
if (attrName === 'style') {
|
||||
attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name);
|
||||
}
|
||||
}
|
||||
@@ -884,7 +1024,7 @@ var media = (function () {
|
||||
}
|
||||
writer.end(name);
|
||||
}
|
||||
}, global$7({})).parse(html);
|
||||
}, global$6({})).parse(html);
|
||||
return writer.getContent();
|
||||
};
|
||||
var Sanitize = { sanitize: sanitize };
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
@@ -51,14 +51,9 @@ var table = (function (domGlobals) {
|
||||
throw new Error(msg);
|
||||
};
|
||||
};
|
||||
var apply = function (f) {
|
||||
return f();
|
||||
};
|
||||
var never = constant(false);
|
||||
var always = constant(true);
|
||||
|
||||
var never$1 = never;
|
||||
var always$1 = always;
|
||||
var none = function () {
|
||||
return NONE;
|
||||
};
|
||||
@@ -72,37 +67,27 @@ var table = (function (domGlobals) {
|
||||
var id = function (n) {
|
||||
return n;
|
||||
};
|
||||
var noop = function () {
|
||||
};
|
||||
var nul = function () {
|
||||
return null;
|
||||
};
|
||||
var undef = function () {
|
||||
return undefined;
|
||||
};
|
||||
var me = {
|
||||
fold: function (n, s) {
|
||||
return n();
|
||||
},
|
||||
is: never$1,
|
||||
isSome: never$1,
|
||||
isNone: always$1,
|
||||
is: never,
|
||||
isSome: never,
|
||||
isNone: always,
|
||||
getOr: id,
|
||||
getOrThunk: call,
|
||||
getOrDie: function (msg) {
|
||||
throw new Error(msg || 'error: getOrDie called on none.');
|
||||
},
|
||||
getOrNull: nul,
|
||||
getOrUndefined: undef,
|
||||
getOrNull: constant(null),
|
||||
getOrUndefined: constant(undefined),
|
||||
or: id,
|
||||
orThunk: call,
|
||||
map: none,
|
||||
ap: none,
|
||||
each: noop,
|
||||
bind: none,
|
||||
flatten: none,
|
||||
exists: never$1,
|
||||
forall: always$1,
|
||||
exists: never,
|
||||
forall: always,
|
||||
filter: none,
|
||||
equals: eq,
|
||||
equals_: eq,
|
||||
@@ -111,20 +96,16 @@ var table = (function (domGlobals) {
|
||||
},
|
||||
toString: constant('none()')
|
||||
};
|
||||
if (Object.freeze)
|
||||
if (Object.freeze) {
|
||||
Object.freeze(me);
|
||||
}
|
||||
return me;
|
||||
}();
|
||||
var some = function (a) {
|
||||
var constant_a = function () {
|
||||
return a;
|
||||
};
|
||||
var constant_a = constant(a);
|
||||
var self = function () {
|
||||
return me;
|
||||
};
|
||||
var map = function (f) {
|
||||
return some(f(a));
|
||||
};
|
||||
var bind = function (f) {
|
||||
return f(a);
|
||||
};
|
||||
@@ -135,8 +116,8 @@ var table = (function (domGlobals) {
|
||||
is: function (v) {
|
||||
return a === v;
|
||||
},
|
||||
isSome: always$1,
|
||||
isNone: never$1,
|
||||
isSome: always,
|
||||
isNone: never,
|
||||
getOr: constant_a,
|
||||
getOrThunk: constant_a,
|
||||
getOrDie: constant_a,
|
||||
@@ -144,35 +125,31 @@ var table = (function (domGlobals) {
|
||||
getOrUndefined: constant_a,
|
||||
or: self,
|
||||
orThunk: self,
|
||||
map: map,
|
||||
ap: function (optfab) {
|
||||
return optfab.fold(none, function (fab) {
|
||||
return some(fab(a));
|
||||
});
|
||||
map: function (f) {
|
||||
return some(f(a));
|
||||
},
|
||||
each: function (f) {
|
||||
f(a);
|
||||
},
|
||||
bind: bind,
|
||||
flatten: constant_a,
|
||||
exists: bind,
|
||||
forall: bind,
|
||||
filter: function (f) {
|
||||
return f(a) ? me : NONE;
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never$1, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
},
|
||||
toArray: function () {
|
||||
return [a];
|
||||
},
|
||||
toString: function () {
|
||||
return 'some(' + a + ')';
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
}
|
||||
};
|
||||
return me;
|
||||
@@ -187,13 +164,16 @@ var table = (function (domGlobals) {
|
||||
};
|
||||
|
||||
var typeOf = function (x) {
|
||||
if (x === null)
|
||||
if (x === null) {
|
||||
return 'null';
|
||||
}
|
||||
var t = typeof x;
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array'))
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
||||
return 'array';
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String'))
|
||||
}
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
||||
return 'string';
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var isType = function (type) {
|
||||
@@ -207,49 +187,50 @@ var table = (function (domGlobals) {
|
||||
var isFunction = isType('function');
|
||||
var isNumber = isType('number');
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
var rawIndexOf = function () {
|
||||
var pIndexOf = Array.prototype.indexOf;
|
||||
var fastIndex = function (xs, x) {
|
||||
return pIndexOf.call(xs, x);
|
||||
};
|
||||
var slowIndex = function (xs, x) {
|
||||
return slowIndexOf(xs, x);
|
||||
};
|
||||
return pIndexOf === undefined ? slowIndex : fastIndex;
|
||||
}();
|
||||
var nativeSlice = Array.prototype.slice;
|
||||
var nativeIndexOf = Array.prototype.indexOf;
|
||||
var nativePush = Array.prototype.push;
|
||||
var rawIndexOf = function (ts, t) {
|
||||
return nativeIndexOf.call(ts, t);
|
||||
};
|
||||
var contains = function (xs, x) {
|
||||
return rawIndexOf(xs, x) > -1;
|
||||
};
|
||||
var exists = function (xs, pred) {
|
||||
return findIndex(xs, pred).isSome();
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
var map = function (xs, f) {
|
||||
var len = xs.length;
|
||||
var r = new Array(len);
|
||||
for (var i = 0; i < len; i++) {
|
||||
var x = xs[i];
|
||||
r[i] = f(x, i, xs);
|
||||
r[i] = f(x, i);
|
||||
}
|
||||
return r;
|
||||
};
|
||||
var each = function (xs, f) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
f(x, i, xs);
|
||||
f(x, i);
|
||||
}
|
||||
};
|
||||
var eachr = function (xs, f) {
|
||||
for (var i = xs.length - 1; i >= 0; i--) {
|
||||
var x = xs[i];
|
||||
f(x, i, xs);
|
||||
f(x, i);
|
||||
}
|
||||
};
|
||||
var filter = function (xs, pred) {
|
||||
var r = [];
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
r.push(x);
|
||||
}
|
||||
}
|
||||
@@ -270,7 +251,7 @@ var table = (function (domGlobals) {
|
||||
var find = function (xs, pred) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
return Option.some(x);
|
||||
}
|
||||
}
|
||||
@@ -279,27 +260,19 @@ var table = (function (domGlobals) {
|
||||
var findIndex = function (xs, pred) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
return Option.some(i);
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
var slowIndexOf = function (xs, x) {
|
||||
for (var i = 0, len = xs.length; i < len; ++i) {
|
||||
if (xs[i] === x) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
var push = Array.prototype.push;
|
||||
var flatten = function (xs) {
|
||||
var r = [];
|
||||
for (var i = 0, len = xs.length; i < len; ++i) {
|
||||
if (!Array.prototype.isPrototypeOf(xs[i]))
|
||||
if (!isArray(xs[i])) {
|
||||
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
|
||||
push.apply(r, xs[i]);
|
||||
}
|
||||
nativePush.apply(r, xs[i]);
|
||||
}
|
||||
return r;
|
||||
};
|
||||
@@ -310,14 +283,14 @@ var table = (function (domGlobals) {
|
||||
var forall = function (xs, pred) {
|
||||
for (var i = 0, len = xs.length; i < len; ++i) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs) !== true) {
|
||||
if (pred(x, i) !== true) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
var reverse = function (xs) {
|
||||
var r = slice.call(xs, 0);
|
||||
var r = nativeSlice.call(xs, 0);
|
||||
r.reverse();
|
||||
return r;
|
||||
};
|
||||
@@ -325,7 +298,7 @@ var table = (function (domGlobals) {
|
||||
return xs.length === 0 ? Option.none() : Option.some(xs[xs.length - 1]);
|
||||
};
|
||||
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return slice.call(x);
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
|
||||
var keys = Object.keys;
|
||||
@@ -334,21 +307,21 @@ var table = (function (domGlobals) {
|
||||
for (var k = 0, len = props.length; k < len; k++) {
|
||||
var i = props[k];
|
||||
var x = obj[i];
|
||||
f(x, i, obj);
|
||||
f(x, i);
|
||||
}
|
||||
};
|
||||
var map$1 = function (obj, f) {
|
||||
return tupleMap(obj, function (x, i, obj) {
|
||||
return tupleMap(obj, function (x, i) {
|
||||
return {
|
||||
k: i,
|
||||
v: f(x, i, obj)
|
||||
v: f(x, i)
|
||||
};
|
||||
});
|
||||
};
|
||||
var tupleMap = function (obj, f) {
|
||||
var r = {};
|
||||
each$1(obj, function (x, i) {
|
||||
var tuple = f(x, i, obj);
|
||||
var tuple = f(x, i);
|
||||
r[tuple.k] = tuple.v;
|
||||
});
|
||||
return r;
|
||||
@@ -385,11 +358,13 @@ var table = (function (domGlobals) {
|
||||
throw new Error('Unsupported keys for object: ' + sort(unsupported).join(', '));
|
||||
};
|
||||
var validateStrArr = function (label, array) {
|
||||
if (!isArray(array))
|
||||
if (!isArray(array)) {
|
||||
throw new Error('The ' + label + ' fields must be an array. Was: ' + array + '.');
|
||||
}
|
||||
each(array, function (a) {
|
||||
if (!isString(a))
|
||||
if (!isString(a)) {
|
||||
throw new Error('The value ' + a + ' in the ' + label + ' fields was not a string.');
|
||||
}
|
||||
});
|
||||
};
|
||||
var invalidTypeMessage = function (incorrect, type) {
|
||||
@@ -407,8 +382,9 @@ var table = (function (domGlobals) {
|
||||
|
||||
var MixedBag = function (required, optional) {
|
||||
var everything = required.concat(optional);
|
||||
if (everything.length === 0)
|
||||
if (everything.length === 0) {
|
||||
throw new Error('You must specify at least one required or optional field.');
|
||||
}
|
||||
validateStrArr('required', required);
|
||||
validateStrArr('optional', optional);
|
||||
checkDupes(everything);
|
||||
@@ -417,13 +393,15 @@ var table = (function (domGlobals) {
|
||||
var allReqd = forall(required, function (req) {
|
||||
return contains(keys$1, req);
|
||||
});
|
||||
if (!allReqd)
|
||||
if (!allReqd) {
|
||||
reqMessage(required, keys$1);
|
||||
}
|
||||
var unsupported = filter(keys$1, function (key) {
|
||||
return !contains(everything, key);
|
||||
});
|
||||
if (unsupported.length > 0)
|
||||
if (unsupported.length > 0) {
|
||||
unsuppMessage(unsupported);
|
||||
}
|
||||
var r = {};
|
||||
each(required, function (req) {
|
||||
r[req] = constant(obj[req]);
|
||||
@@ -448,6 +426,32 @@ var table = (function (domGlobals) {
|
||||
var ENTITY = domGlobals.Node.ENTITY_NODE;
|
||||
var NOTATION = domGlobals.Node.NOTATION_NODE;
|
||||
|
||||
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
|
||||
|
||||
var path = function (parts, scope) {
|
||||
var o = scope !== undefined && scope !== null ? scope : Global;
|
||||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
|
||||
o = o[parts[i]];
|
||||
}
|
||||
return o;
|
||||
};
|
||||
var resolve = function (p, scope) {
|
||||
var parts = p.split('.');
|
||||
return path(parts, scope);
|
||||
};
|
||||
|
||||
var unsafe = function (name, scope) {
|
||||
return resolve(name, scope);
|
||||
};
|
||||
var getOrDie = function (name, scope) {
|
||||
var actual = unsafe(name, scope);
|
||||
if (actual === undefined || actual === null) {
|
||||
throw new Error(name + ' not available on this browser');
|
||||
}
|
||||
return actual;
|
||||
};
|
||||
var Global$1 = { getOrDie: getOrDie };
|
||||
|
||||
var name = function (element) {
|
||||
var r = element.dom().nodeName;
|
||||
return r.toLowerCase();
|
||||
@@ -465,7 +469,6 @@ var table = (function (domGlobals) {
|
||||
};
|
||||
var isElement = isType$1(ELEMENT);
|
||||
var isText = isType$1(TEXT);
|
||||
var isDocument = isType$1(DOCUMENT);
|
||||
|
||||
var rawSet = function (dom, key, value) {
|
||||
if (isString(value) || isBoolean(value) || isNumber(value)) {
|
||||
@@ -503,10 +506,12 @@ var table = (function (domGlobals) {
|
||||
};
|
||||
|
||||
var checkRange = function (str, substr, start) {
|
||||
if (substr === '')
|
||||
if (substr === '') {
|
||||
return true;
|
||||
if (str.length < substr.length)
|
||||
}
|
||||
if (str.length < substr.length) {
|
||||
return false;
|
||||
}
|
||||
var x = str.substr(start, start + substr.length);
|
||||
return x === substr;
|
||||
};
|
||||
@@ -649,30 +654,6 @@ var table = (function (domGlobals) {
|
||||
}
|
||||
};
|
||||
|
||||
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
|
||||
|
||||
var path = function (parts, scope) {
|
||||
var o = scope !== undefined && scope !== null ? scope : Global;
|
||||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
|
||||
o = o[parts[i]];
|
||||
return o;
|
||||
};
|
||||
var resolve = function (p, scope) {
|
||||
var parts = p.split('.');
|
||||
return path(parts, scope);
|
||||
};
|
||||
|
||||
var unsafe = function (name, scope) {
|
||||
return resolve(name, scope);
|
||||
};
|
||||
var getOrDie = function (name, scope) {
|
||||
var actual = unsafe(name, scope);
|
||||
if (actual === undefined || actual === null)
|
||||
throw name + ' not available on this browser';
|
||||
return actual;
|
||||
};
|
||||
var Global$1 = { getOrDie: getOrDie };
|
||||
|
||||
var node = function () {
|
||||
var f = Global$1.getOrDie('Node');
|
||||
return f;
|
||||
@@ -694,18 +675,20 @@ var table = (function (domGlobals) {
|
||||
var firstMatch = function (regexes, s) {
|
||||
for (var i = 0; i < regexes.length; i++) {
|
||||
var x = regexes[i];
|
||||
if (x.test(s))
|
||||
if (x.test(s)) {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
var find$1 = function (regexes, agent) {
|
||||
var r = firstMatch(regexes, agent);
|
||||
if (!r)
|
||||
if (!r) {
|
||||
return {
|
||||
major: 0,
|
||||
minor: 0
|
||||
};
|
||||
}
|
||||
var group = function (i) {
|
||||
return Number(agent.replace(r, '$' + i));
|
||||
};
|
||||
@@ -713,8 +696,9 @@ var table = (function (domGlobals) {
|
||||
};
|
||||
var detect = function (versionRegexes, agent) {
|
||||
var cleanedAgent = String(agent).toLowerCase();
|
||||
if (versionRegexes.length === 0)
|
||||
if (versionRegexes.length === 0) {
|
||||
return unknown();
|
||||
}
|
||||
return find$1(versionRegexes, cleanedAgent);
|
||||
};
|
||||
var unknown = function () {
|
||||
@@ -880,8 +864,7 @@ var table = (function (domGlobals) {
|
||||
name: 'Edge',
|
||||
versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
|
||||
search: function (uastring) {
|
||||
var monstrosity = contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit');
|
||||
return monstrosity;
|
||||
return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit');
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -999,19 +982,22 @@ var table = (function (domGlobals) {
|
||||
var ELEMENT$1 = ELEMENT;
|
||||
var DOCUMENT$1 = DOCUMENT;
|
||||
var is = function (element, selector) {
|
||||
var elem = element.dom();
|
||||
if (elem.nodeType !== ELEMENT$1) {
|
||||
var dom = element.dom();
|
||||
if (dom.nodeType !== ELEMENT$1) {
|
||||
return false;
|
||||
} else if (elem.matches !== undefined) {
|
||||
return elem.matches(selector);
|
||||
} else if (elem.msMatchesSelector !== undefined) {
|
||||
return elem.msMatchesSelector(selector);
|
||||
} else if (elem.webkitMatchesSelector !== undefined) {
|
||||
return elem.webkitMatchesSelector(selector);
|
||||
} else if (elem.mozMatchesSelector !== undefined) {
|
||||
return elem.mozMatchesSelector(selector);
|
||||
} else {
|
||||
throw new Error('Browser lacks native selectors');
|
||||
var elem = dom;
|
||||
if (elem.matches !== undefined) {
|
||||
return elem.matches(selector);
|
||||
} else if (elem.msMatchesSelector !== undefined) {
|
||||
return elem.msMatchesSelector(selector);
|
||||
} else if (elem.webkitMatchesSelector !== undefined) {
|
||||
return elem.webkitMatchesSelector(selector);
|
||||
} else if (elem.mozMatchesSelector !== undefined) {
|
||||
return elem.mozMatchesSelector(selector);
|
||||
} else {
|
||||
throw new Error('Browser lacks native selectors');
|
||||
}
|
||||
}
|
||||
};
|
||||
var bypassSelector = function (dom) {
|
||||
@@ -1045,16 +1031,13 @@ var table = (function (domGlobals) {
|
||||
return Element.fromDom(element.dom().ownerDocument);
|
||||
};
|
||||
var defaultView = function (element) {
|
||||
var el = element.dom();
|
||||
var defView = el.ownerDocument.defaultView;
|
||||
return Element.fromDom(defView);
|
||||
return Element.fromDom(element.dom().ownerDocument.defaultView);
|
||||
};
|
||||
var parent = function (element) {
|
||||
var dom = element.dom();
|
||||
return Option.from(dom.parentNode).map(Element.fromDom);
|
||||
return Option.from(element.dom().parentNode).map(Element.fromDom);
|
||||
};
|
||||
var parents = function (element, isRoot) {
|
||||
var stop = isFunction(isRoot) ? isRoot : constant(false);
|
||||
var stop = isFunction(isRoot) ? isRoot : never;
|
||||
var dom = element.dom();
|
||||
var ret = [];
|
||||
while (dom.parentNode !== null && dom.parentNode !== undefined) {
|
||||
@@ -1070,16 +1053,13 @@ var table = (function (domGlobals) {
|
||||
return ret;
|
||||
};
|
||||
var prevSibling = function (element) {
|
||||
var dom = element.dom();
|
||||
return Option.from(dom.previousSibling).map(Element.fromDom);
|
||||
return Option.from(element.dom().previousSibling).map(Element.fromDom);
|
||||
};
|
||||
var nextSibling = function (element) {
|
||||
var dom = element.dom();
|
||||
return Option.from(dom.nextSibling).map(Element.fromDom);
|
||||
return Option.from(element.dom().nextSibling).map(Element.fromDom);
|
||||
};
|
||||
var children = function (element) {
|
||||
var dom = element.dom();
|
||||
return map(dom.childNodes, Element.fromDom);
|
||||
return map(element.dom().childNodes, Element.fromDom);
|
||||
};
|
||||
var child = function (element, index) {
|
||||
var cs = element.dom().childNodes;
|
||||
@@ -1225,20 +1205,24 @@ var table = (function (domGlobals) {
|
||||
return Option.none();
|
||||
};
|
||||
var closest = function (scope, predicate, isRoot) {
|
||||
var is = function (s) {
|
||||
return predicate(s);
|
||||
var is = function (s, test) {
|
||||
return test(s);
|
||||
};
|
||||
return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot);
|
||||
};
|
||||
var child$1 = function (scope, predicate) {
|
||||
var result = find(scope.dom().childNodes, compose(predicate, Element.fromDom));
|
||||
var pred = function (node) {
|
||||
return predicate(Element.fromDom(node));
|
||||
};
|
||||
var result = find(scope.dom().childNodes, pred);
|
||||
return result.map(Element.fromDom);
|
||||
};
|
||||
var descendant = function (scope, predicate) {
|
||||
var descend = function (node) {
|
||||
for (var i = 0; i < node.childNodes.length; i++) {
|
||||
if (predicate(Element.fromDom(node.childNodes[i]))) {
|
||||
return Option.some(Element.fromDom(node.childNodes[i]));
|
||||
var child_1 = Element.fromDom(node.childNodes[i]);
|
||||
if (predicate(child_1)) {
|
||||
return Option.some(child_1);
|
||||
}
|
||||
var res = descend(node.childNodes[i]);
|
||||
if (res.isSome()) {
|
||||
@@ -1545,18 +1529,9 @@ var table = (function (domGlobals) {
|
||||
}
|
||||
return getOption(element).getOr('');
|
||||
};
|
||||
var getOptionIE10 = function (element) {
|
||||
try {
|
||||
return getOptionSafe(element);
|
||||
} catch (e) {
|
||||
return Option.none();
|
||||
}
|
||||
};
|
||||
var getOptionSafe = function (element) {
|
||||
var getOption = function (element) {
|
||||
return is(element) ? Option.from(element.dom().nodeValue) : Option.none();
|
||||
};
|
||||
var browser = PlatformDetection$1.detect().browser;
|
||||
var getOption = browser.isIE() && browser.version.major === 10 ? getOptionIE10 : getOptionSafe;
|
||||
var set = function (element, value) {
|
||||
if (!is(element)) {
|
||||
throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');
|
||||
@@ -1902,15 +1877,18 @@ var table = (function (domGlobals) {
|
||||
return element.dom().ownerDocument;
|
||||
};
|
||||
var isBoundary = function (element) {
|
||||
if (!isElement(element))
|
||||
if (!isElement(element)) {
|
||||
return false;
|
||||
if (name(element) === 'body')
|
||||
}
|
||||
if (name(element) === 'body') {
|
||||
return true;
|
||||
}
|
||||
return contains(TagBoundaries, name(element));
|
||||
};
|
||||
var isEmptyTag = function (element) {
|
||||
if (!isElement(element))
|
||||
if (!isElement(element)) {
|
||||
return false;
|
||||
}
|
||||
return contains([
|
||||
'br',
|
||||
'img',
|
||||
@@ -2359,8 +2337,9 @@ var table = (function (domGlobals) {
|
||||
throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength);
|
||||
}
|
||||
var args = new Array(argLength);
|
||||
for (var i = 0; i < args.length; i++)
|
||||
for (var i = 0; i < args.length; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
var match = function (branches) {
|
||||
var branchKeys = keys(branches);
|
||||
if (constructors.length !== branchKeys.length) {
|
||||
@@ -2369,8 +2348,9 @@ var table = (function (domGlobals) {
|
||||
var allReqd = forall(constructors, function (reqKey) {
|
||||
return contains(branchKeys, reqKey);
|
||||
});
|
||||
if (!allReqd)
|
||||
if (!allReqd) {
|
||||
throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', '));
|
||||
}
|
||||
return branches[key].apply(null, args);
|
||||
};
|
||||
return {
|
||||
@@ -2765,18 +2745,6 @@ var table = (function (domGlobals) {
|
||||
};
|
||||
var CellMutations = { halve: halve };
|
||||
|
||||
var attached = function (element, scope) {
|
||||
var doc = scope || Element.fromDom(domGlobals.document.documentElement);
|
||||
return ancestor(element, curry(eq, doc)).isSome();
|
||||
};
|
||||
var windowOf = function (element) {
|
||||
var dom = element.dom();
|
||||
if (dom === dom.window && element instanceof domGlobals.Window) {
|
||||
return element;
|
||||
}
|
||||
return isDocument(element) ? dom.defaultView || dom.parentWindow : null;
|
||||
};
|
||||
|
||||
var r = function (left, top) {
|
||||
var translate = function (x, y) {
|
||||
return r(left + x, top + y);
|
||||
@@ -2799,7 +2767,7 @@ var table = (function (domGlobals) {
|
||||
var absolute = function (element) {
|
||||
var doc = element.dom().ownerDocument;
|
||||
var body = doc.body;
|
||||
var win = windowOf(Element.fromDom(doc));
|
||||
var win = doc.defaultView;
|
||||
var html = doc.documentElement;
|
||||
var scrollTop = firstDefinedOrZero(win.pageYOffset, html.scrollTop);
|
||||
var scrollLeft = firstDefinedOrZero(win.pageXOffset, html.scrollLeft);
|
||||
@@ -2811,11 +2779,10 @@ var table = (function (domGlobals) {
|
||||
var dom = element.dom();
|
||||
var doc = dom.ownerDocument;
|
||||
var body = doc.body;
|
||||
var html = Element.fromDom(doc.documentElement);
|
||||
if (body === dom) {
|
||||
return Position(body.offsetLeft, body.offsetTop);
|
||||
}
|
||||
if (!attached(element, html)) {
|
||||
if (!inBody(element)) {
|
||||
return Position(0, 0);
|
||||
}
|
||||
return boxPosition(dom);
|
||||
@@ -3531,7 +3498,7 @@ var table = (function (domGlobals) {
|
||||
var onPaste = function (warehouse, target) {
|
||||
return TableLookup.cell(target.element()).bind(function (cell) {
|
||||
return findInWarehouse(warehouse, cell).map(function (details) {
|
||||
var value = __assign({}, details, {
|
||||
var value = __assign(__assign({}, details), {
|
||||
generators: target.generators,
|
||||
clipboard: target.clipboard
|
||||
});
|
||||
@@ -4328,8 +4295,9 @@ var table = (function (domGlobals) {
|
||||
});
|
||||
};
|
||||
var baseWith = function (handleUnsupported, required, pred) {
|
||||
if (required.length === 0)
|
||||
if (required.length === 0) {
|
||||
throw new Error('You must specify at least one required field.');
|
||||
}
|
||||
validateStrArr('required', required);
|
||||
checkDupes(required);
|
||||
return function (obj) {
|
||||
@@ -4337,14 +4305,16 @@ var table = (function (domGlobals) {
|
||||
var allReqd = forall(required, function (req) {
|
||||
return contains(keys$1, req);
|
||||
});
|
||||
if (!allReqd)
|
||||
if (!allReqd) {
|
||||
reqMessage(required, keys$1);
|
||||
}
|
||||
handleUnsupported(required, keys$1);
|
||||
var invalidKeys = filter(required, function (key) {
|
||||
return !pred.validate(obj[key], key);
|
||||
});
|
||||
if (invalidKeys.length > 0)
|
||||
if (invalidKeys.length > 0) {
|
||||
invalidTypeMessage(invalidKeys, pred.label);
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
};
|
||||
@@ -4352,8 +4322,9 @@ var table = (function (domGlobals) {
|
||||
var unsupported = filter(keys, function (key) {
|
||||
return !contains(required, key);
|
||||
});
|
||||
if (unsupported.length > 0)
|
||||
if (unsupported.length > 0) {
|
||||
unsuppMessage(unsupported);
|
||||
}
|
||||
};
|
||||
var exactly = function (required) {
|
||||
return base(handleExact, required);
|
||||
@@ -6329,7 +6300,9 @@ var table = (function (domGlobals) {
|
||||
};
|
||||
};
|
||||
var detached = function (editable, chrome) {
|
||||
var origin = curry(absolute, chrome);
|
||||
var origin = function () {
|
||||
return absolute(chrome);
|
||||
};
|
||||
return {
|
||||
parent: constant(chrome),
|
||||
view: constant(editable),
|
||||
@@ -6449,17 +6422,20 @@ var table = (function (domGlobals) {
|
||||
var baseMerge = function (merger) {
|
||||
return function () {
|
||||
var objects = new Array(arguments.length);
|
||||
for (var i = 0; i < objects.length; i++)
|
||||
for (var i = 0; i < objects.length; i++) {
|
||||
objects[i] = arguments[i];
|
||||
if (objects.length === 0)
|
||||
}
|
||||
if (objects.length === 0) {
|
||||
throw new Error('Can\'t merge zero objects');
|
||||
}
|
||||
var ret = {};
|
||||
for (var j = 0; j < objects.length; j++) {
|
||||
var curObject = objects[j];
|
||||
for (var key in curObject)
|
||||
for (var key in curObject) {
|
||||
if (hasOwnProperty.call(curObject, key)) {
|
||||
ret[key] = merger(ret[key], curObject[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
@@ -6568,8 +6544,9 @@ var table = (function (domGlobals) {
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
if (timer !== null)
|
||||
if (timer !== null) {
|
||||
domGlobals.clearTimeout(timer);
|
||||
}
|
||||
timer = domGlobals.setTimeout(function () {
|
||||
fn.apply(null, args);
|
||||
timer = null;
|
||||
@@ -6876,7 +6853,7 @@ var table = (function (domGlobals) {
|
||||
};
|
||||
};
|
||||
|
||||
function TableResize (wire, vdirection) {
|
||||
var create$2 = function (wire, vdirection) {
|
||||
var hdirection = BarPositions.height;
|
||||
var manager = BarManager(wire, vdirection, hdirection);
|
||||
var events = Events.create({
|
||||
@@ -6907,7 +6884,8 @@ var table = (function (domGlobals) {
|
||||
destroy: manager.destroy,
|
||||
events: events.registry
|
||||
};
|
||||
}
|
||||
};
|
||||
var TableResize = { create: create$2 };
|
||||
|
||||
var createContainer = function () {
|
||||
var container = Element.fromTag('div');
|
||||
@@ -6966,7 +6944,7 @@ var table = (function (domGlobals) {
|
||||
var rawWire = TableWire.get(editor);
|
||||
wire = Option.some(rawWire);
|
||||
if (hasObjectResizing(editor) && hasTableResizeBars(editor)) {
|
||||
var sz = TableResize(rawWire, direction);
|
||||
var sz = TableResize.create(rawWire, direction);
|
||||
sz.on();
|
||||
sz.events.startDrag.bind(function (event) {
|
||||
selectionRng = Option.some(editor.selection.getRng());
|
||||
@@ -7046,7 +7024,7 @@ var table = (function (domGlobals) {
|
||||
}
|
||||
return adt$1.none(current);
|
||||
};
|
||||
var CellLocation = __assign({}, adt$1, { none: none$1 });
|
||||
var CellLocation = __assign(__assign({}, adt$1), { none: none$1 });
|
||||
|
||||
var detect$4 = function (current, isRoot) {
|
||||
return TableLookup.table(current, isRoot).bind(function (table) {
|
||||
@@ -7083,8 +7061,8 @@ var table = (function (domGlobals) {
|
||||
prev: prev
|
||||
};
|
||||
|
||||
var create$2 = Immutable('start', 'soffset', 'finish', 'foffset');
|
||||
var SimRange = { create: create$2 };
|
||||
var create$3 = Immutable('start', 'soffset', 'finish', 'foffset');
|
||||
var SimRange = { create: create$3 };
|
||||
|
||||
var adt$2 = Adt.generate([
|
||||
{ before: ['element'] },
|
||||
@@ -7365,8 +7343,7 @@ var table = (function (domGlobals) {
|
||||
});
|
||||
};
|
||||
var locateNode = function (doc, node, x, y) {
|
||||
var locator = isText(node) ? locate : searchInChildren;
|
||||
return locator(doc, node, x, y);
|
||||
return isText(node) ? locate(doc, node, x, y) : searchInChildren(doc, node, x, y);
|
||||
};
|
||||
var locate$1 = function (doc, node, x, y) {
|
||||
var r = doc.dom().createRange();
|
||||
@@ -7651,16 +7628,16 @@ var table = (function (domGlobals) {
|
||||
};
|
||||
var TabContext = { handle: handle$1 };
|
||||
|
||||
var create$3 = Immutable('selection', 'kill');
|
||||
var Response = { create: create$3 };
|
||||
var create$4 = Immutable('selection', 'kill');
|
||||
var Response = { create: create$4 };
|
||||
|
||||
var create$4 = function (start, soffset, finish, foffset) {
|
||||
var create$5 = function (start, soffset, finish, foffset) {
|
||||
return {
|
||||
start: constant(Situ.on(start, soffset)),
|
||||
finish: constant(Situ.on(finish, foffset))
|
||||
};
|
||||
};
|
||||
var Situs = { create: create$4 };
|
||||
var Situs = { create: create$5 };
|
||||
|
||||
var convertToRange = function (win, selection) {
|
||||
var rng = asLtrRange(win, selection);
|
||||
@@ -7804,10 +7781,11 @@ var table = (function (domGlobals) {
|
||||
var hone = function (universe, item, predicate, mode, direction, isRoot) {
|
||||
var next = go$1(universe, item, mode, direction);
|
||||
return next.bind(function (n) {
|
||||
if (isRoot(n.item()))
|
||||
if (isRoot(n.item())) {
|
||||
return Option.none();
|
||||
else
|
||||
} else {
|
||||
return predicate(n.item()) ? Option.some(n.item()) : hone(universe, n.item(), predicate, n.mode(), direction, isRoot);
|
||||
}
|
||||
});
|
||||
};
|
||||
var left$1 = function (universe, item, predicate, isRoot) {
|
||||
@@ -7890,7 +7868,7 @@ var table = (function (domGlobals) {
|
||||
var cata$2 = function (subject, onNone, onSuccess, onFailedUp, onFailedDown) {
|
||||
return subject.fold(onNone, onSuccess, onFailedUp, onFailedDown);
|
||||
};
|
||||
var BeforeAfter = __assign({}, adt$5, {
|
||||
var BeforeAfter = __assign(__assign({}, adt$5), {
|
||||
verify: verify,
|
||||
cata: cata$2
|
||||
});
|
||||
@@ -8415,6 +8393,18 @@ var table = (function (domGlobals) {
|
||||
isNavigation: isNavigation
|
||||
};
|
||||
|
||||
var toRaw = function (sr) {
|
||||
return {
|
||||
left: sr.left(),
|
||||
top: sr.top(),
|
||||
right: sr.right(),
|
||||
bottom: sr.bottom(),
|
||||
width: sr.width(),
|
||||
height: sr.height()
|
||||
};
|
||||
};
|
||||
var Rect = { toRaw: toRaw };
|
||||
|
||||
var isSafari = PlatformDetection$1.detect().browser.isSafari();
|
||||
var get$a = function (_DOC) {
|
||||
var doc = _DOC !== undefined ? _DOC.dom() : domGlobals.document;
|
||||
@@ -8437,9 +8427,7 @@ var table = (function (domGlobals) {
|
||||
};
|
||||
var getRangedRect = function (start, soffset, finish, foffset) {
|
||||
var sel = Selection.exact(start, soffset, finish, foffset);
|
||||
return getFirstRect$1(win, sel).map(function (structRect) {
|
||||
return map$1(structRect, apply);
|
||||
});
|
||||
return getFirstRect$1(win, sel).map(Rect.toRaw);
|
||||
};
|
||||
var getSelection = function () {
|
||||
return get$9(win).map(function (exactAdt) {
|
||||
@@ -8769,6 +8757,9 @@ var table = (function (domGlobals) {
|
||||
if (raw.buttons === undefined) {
|
||||
return true;
|
||||
}
|
||||
if (global$2.ie && global$2.ie >= 12 && raw.buttons === 0) {
|
||||
return true;
|
||||
}
|
||||
return (raw.buttons & 1) !== 0;
|
||||
};
|
||||
var mouseDown = function (e) {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -22,6 +22,17 @@ var textpattern = (function (domGlobals) {
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
function __spreadArrays() {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
||||
s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
||||
r[k] = a[j];
|
||||
return r;
|
||||
}
|
||||
|
||||
var noop = function () {
|
||||
};
|
||||
var constant = function (value) {
|
||||
return function () {
|
||||
return value;
|
||||
@@ -30,8 +41,6 @@ var textpattern = (function (domGlobals) {
|
||||
var never = constant(false);
|
||||
var always = constant(true);
|
||||
|
||||
var never$1 = never;
|
||||
var always$1 = always;
|
||||
var none = function () {
|
||||
return NONE;
|
||||
};
|
||||
@@ -45,37 +54,27 @@ var textpattern = (function (domGlobals) {
|
||||
var id = function (n) {
|
||||
return n;
|
||||
};
|
||||
var noop = function () {
|
||||
};
|
||||
var nul = function () {
|
||||
return null;
|
||||
};
|
||||
var undef = function () {
|
||||
return undefined;
|
||||
};
|
||||
var me = {
|
||||
fold: function (n, s) {
|
||||
return n();
|
||||
},
|
||||
is: never$1,
|
||||
isSome: never$1,
|
||||
isNone: always$1,
|
||||
is: never,
|
||||
isSome: never,
|
||||
isNone: always,
|
||||
getOr: id,
|
||||
getOrThunk: call,
|
||||
getOrDie: function (msg) {
|
||||
throw new Error(msg || 'error: getOrDie called on none.');
|
||||
},
|
||||
getOrNull: nul,
|
||||
getOrUndefined: undef,
|
||||
getOrNull: constant(null),
|
||||
getOrUndefined: constant(undefined),
|
||||
or: id,
|
||||
orThunk: call,
|
||||
map: none,
|
||||
ap: none,
|
||||
each: noop,
|
||||
bind: none,
|
||||
flatten: none,
|
||||
exists: never$1,
|
||||
forall: always$1,
|
||||
exists: never,
|
||||
forall: always,
|
||||
filter: none,
|
||||
equals: eq,
|
||||
equals_: eq,
|
||||
@@ -84,20 +83,16 @@ var textpattern = (function (domGlobals) {
|
||||
},
|
||||
toString: constant('none()')
|
||||
};
|
||||
if (Object.freeze)
|
||||
if (Object.freeze) {
|
||||
Object.freeze(me);
|
||||
}
|
||||
return me;
|
||||
}();
|
||||
var some = function (a) {
|
||||
var constant_a = function () {
|
||||
return a;
|
||||
};
|
||||
var constant_a = constant(a);
|
||||
var self = function () {
|
||||
return me;
|
||||
};
|
||||
var map = function (f) {
|
||||
return some(f(a));
|
||||
};
|
||||
var bind = function (f) {
|
||||
return f(a);
|
||||
};
|
||||
@@ -108,8 +103,8 @@ var textpattern = (function (domGlobals) {
|
||||
is: function (v) {
|
||||
return a === v;
|
||||
},
|
||||
isSome: always$1,
|
||||
isNone: never$1,
|
||||
isSome: always,
|
||||
isNone: never,
|
||||
getOr: constant_a,
|
||||
getOrThunk: constant_a,
|
||||
getOrDie: constant_a,
|
||||
@@ -117,35 +112,31 @@ var textpattern = (function (domGlobals) {
|
||||
getOrUndefined: constant_a,
|
||||
or: self,
|
||||
orThunk: self,
|
||||
map: map,
|
||||
ap: function (optfab) {
|
||||
return optfab.fold(none, function (fab) {
|
||||
return some(fab(a));
|
||||
});
|
||||
map: function (f) {
|
||||
return some(f(a));
|
||||
},
|
||||
each: function (f) {
|
||||
f(a);
|
||||
},
|
||||
bind: bind,
|
||||
flatten: constant_a,
|
||||
exists: bind,
|
||||
forall: bind,
|
||||
filter: function (f) {
|
||||
return f(a) ? me : NONE;
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never$1, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
},
|
||||
toArray: function () {
|
||||
return [a];
|
||||
},
|
||||
toString: function () {
|
||||
return 'some(' + a + ')';
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
}
|
||||
};
|
||||
return me;
|
||||
@@ -160,13 +151,16 @@ var textpattern = (function (domGlobals) {
|
||||
};
|
||||
|
||||
var typeOf = function (x) {
|
||||
if (x === null)
|
||||
if (x === null) {
|
||||
return 'null';
|
||||
}
|
||||
var t = typeof x;
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array'))
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
||||
return 'array';
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String'))
|
||||
}
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
||||
return 'string';
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var isType = function (type) {
|
||||
@@ -176,24 +170,24 @@ var textpattern = (function (domGlobals) {
|
||||
};
|
||||
var isFunction = isType('function');
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
var nativeSlice = Array.prototype.slice;
|
||||
var filter = function (xs, pred) {
|
||||
var r = [];
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
r.push(x);
|
||||
}
|
||||
}
|
||||
return r;
|
||||
};
|
||||
var sort = function (xs, comparator) {
|
||||
var copy = slice.call(xs, 0);
|
||||
var copy = nativeSlice.call(xs, 0);
|
||||
copy.sort(comparator);
|
||||
return copy;
|
||||
};
|
||||
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return slice.call(x);
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
|
||||
var hasOwnProperty = Object.hasOwnProperty;
|
||||
@@ -234,7 +228,7 @@ var textpattern = (function (domGlobals) {
|
||||
patternsState.set(createPatternSet(newPatterns));
|
||||
};
|
||||
var getPatterns = function () {
|
||||
return patternsState.get().inlinePatterns.concat(patternsState.get().blockPatterns, patternsState.get().replacementPatterns);
|
||||
return __spreadArrays(patternsState.get().inlinePatterns, patternsState.get().blockPatterns, patternsState.get().replacementPatterns);
|
||||
};
|
||||
return {
|
||||
setPatterns: setPatterns,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -35,36 +35,8 @@ var visualchars = (function (domGlobals) {
|
||||
};
|
||||
var Events = { fireVisualChars: fireVisualChars };
|
||||
|
||||
var charMap = {
|
||||
'\xA0': 'nbsp',
|
||||
'\xAD': 'shy'
|
||||
var noop = function () {
|
||||
};
|
||||
var charMapToRegExp = function (charMap, global) {
|
||||
var key, regExp = '';
|
||||
for (key in charMap) {
|
||||
regExp += key;
|
||||
}
|
||||
return new RegExp('[' + regExp + ']', global ? 'g' : '');
|
||||
};
|
||||
var charMapToSelector = function (charMap) {
|
||||
var key, selector = '';
|
||||
for (key in charMap) {
|
||||
if (selector) {
|
||||
selector += ',';
|
||||
}
|
||||
selector += 'span.mce-' + charMap[key];
|
||||
}
|
||||
return selector;
|
||||
};
|
||||
var Data = {
|
||||
charMap: charMap,
|
||||
regExp: charMapToRegExp(charMap),
|
||||
regExpGlobal: charMapToRegExp(charMap, true),
|
||||
selector: charMapToSelector(charMap),
|
||||
charMapToRegExp: charMapToRegExp,
|
||||
charMapToSelector: charMapToSelector
|
||||
};
|
||||
|
||||
var constant = function (value) {
|
||||
return function () {
|
||||
return value;
|
||||
@@ -73,8 +45,6 @@ var visualchars = (function (domGlobals) {
|
||||
var never = constant(false);
|
||||
var always = constant(true);
|
||||
|
||||
var never$1 = never;
|
||||
var always$1 = always;
|
||||
var none = function () {
|
||||
return NONE;
|
||||
};
|
||||
@@ -88,37 +58,27 @@ var visualchars = (function (domGlobals) {
|
||||
var id = function (n) {
|
||||
return n;
|
||||
};
|
||||
var noop = function () {
|
||||
};
|
||||
var nul = function () {
|
||||
return null;
|
||||
};
|
||||
var undef = function () {
|
||||
return undefined;
|
||||
};
|
||||
var me = {
|
||||
fold: function (n, s) {
|
||||
return n();
|
||||
},
|
||||
is: never$1,
|
||||
isSome: never$1,
|
||||
isNone: always$1,
|
||||
is: never,
|
||||
isSome: never,
|
||||
isNone: always,
|
||||
getOr: id,
|
||||
getOrThunk: call,
|
||||
getOrDie: function (msg) {
|
||||
throw new Error(msg || 'error: getOrDie called on none.');
|
||||
},
|
||||
getOrNull: nul,
|
||||
getOrUndefined: undef,
|
||||
getOrNull: constant(null),
|
||||
getOrUndefined: constant(undefined),
|
||||
or: id,
|
||||
orThunk: call,
|
||||
map: none,
|
||||
ap: none,
|
||||
each: noop,
|
||||
bind: none,
|
||||
flatten: none,
|
||||
exists: never$1,
|
||||
forall: always$1,
|
||||
exists: never,
|
||||
forall: always,
|
||||
filter: none,
|
||||
equals: eq,
|
||||
equals_: eq,
|
||||
@@ -127,20 +87,16 @@ var visualchars = (function (domGlobals) {
|
||||
},
|
||||
toString: constant('none()')
|
||||
};
|
||||
if (Object.freeze)
|
||||
if (Object.freeze) {
|
||||
Object.freeze(me);
|
||||
}
|
||||
return me;
|
||||
}();
|
||||
var some = function (a) {
|
||||
var constant_a = function () {
|
||||
return a;
|
||||
};
|
||||
var constant_a = constant(a);
|
||||
var self = function () {
|
||||
return me;
|
||||
};
|
||||
var map = function (f) {
|
||||
return some(f(a));
|
||||
};
|
||||
var bind = function (f) {
|
||||
return f(a);
|
||||
};
|
||||
@@ -151,8 +107,8 @@ var visualchars = (function (domGlobals) {
|
||||
is: function (v) {
|
||||
return a === v;
|
||||
},
|
||||
isSome: always$1,
|
||||
isNone: never$1,
|
||||
isSome: always,
|
||||
isNone: never,
|
||||
getOr: constant_a,
|
||||
getOrThunk: constant_a,
|
||||
getOrDie: constant_a,
|
||||
@@ -160,35 +116,31 @@ var visualchars = (function (domGlobals) {
|
||||
getOrUndefined: constant_a,
|
||||
or: self,
|
||||
orThunk: self,
|
||||
map: map,
|
||||
ap: function (optfab) {
|
||||
return optfab.fold(none, function (fab) {
|
||||
return some(fab(a));
|
||||
});
|
||||
map: function (f) {
|
||||
return some(f(a));
|
||||
},
|
||||
each: function (f) {
|
||||
f(a);
|
||||
},
|
||||
bind: bind,
|
||||
flatten: constant_a,
|
||||
exists: bind,
|
||||
forall: bind,
|
||||
filter: function (f) {
|
||||
return f(a) ? me : NONE;
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never$1, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
},
|
||||
toArray: function () {
|
||||
return [a];
|
||||
},
|
||||
toString: function () {
|
||||
return 'some(' + a + ')';
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
}
|
||||
};
|
||||
return me;
|
||||
@@ -203,13 +155,16 @@ var visualchars = (function (domGlobals) {
|
||||
};
|
||||
|
||||
var typeOf = function (x) {
|
||||
if (x === null)
|
||||
if (x === null) {
|
||||
return 'null';
|
||||
}
|
||||
var t = typeof x;
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array'))
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
||||
return 'array';
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String'))
|
||||
}
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
||||
return 'string';
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var isType = function (type) {
|
||||
@@ -219,24 +174,24 @@ var visualchars = (function (domGlobals) {
|
||||
};
|
||||
var isFunction = isType('function');
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
var nativeSlice = Array.prototype.slice;
|
||||
var map = function (xs, f) {
|
||||
var len = xs.length;
|
||||
var r = new Array(len);
|
||||
for (var i = 0; i < len; i++) {
|
||||
var x = xs[i];
|
||||
r[i] = f(x, i, xs);
|
||||
r[i] = f(x, i);
|
||||
}
|
||||
return r;
|
||||
};
|
||||
var each = function (xs, f) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
f(x, i, xs);
|
||||
f(x, i);
|
||||
}
|
||||
};
|
||||
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return slice.call(x);
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
|
||||
var fromHtml = function (html, scope) {
|
||||
@@ -290,6 +245,8 @@ var visualchars = (function (domGlobals) {
|
||||
var ENTITY = domGlobals.Node.ENTITY_NODE;
|
||||
var NOTATION = domGlobals.Node.NOTATION_NODE;
|
||||
|
||||
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
|
||||
|
||||
var type = function (element) {
|
||||
return element.dom().nodeType;
|
||||
};
|
||||
@@ -303,13 +260,44 @@ var visualchars = (function (domGlobals) {
|
||||
};
|
||||
var isText = isType$1(TEXT);
|
||||
|
||||
var charMap = {
|
||||
'\xA0': 'nbsp',
|
||||
'\xAD': 'shy'
|
||||
};
|
||||
var charMapToRegExp = function (charMap, global) {
|
||||
var key, regExp = '';
|
||||
for (key in charMap) {
|
||||
regExp += key;
|
||||
}
|
||||
return new RegExp('[' + regExp + ']', global ? 'g' : '');
|
||||
};
|
||||
var charMapToSelector = function (charMap) {
|
||||
var key, selector = '';
|
||||
for (key in charMap) {
|
||||
if (selector) {
|
||||
selector += ',';
|
||||
}
|
||||
selector += 'span.mce-' + charMap[key];
|
||||
}
|
||||
return selector;
|
||||
};
|
||||
var Data = {
|
||||
charMap: charMap,
|
||||
regExp: charMapToRegExp(charMap),
|
||||
regExpGlobal: charMapToRegExp(charMap, true),
|
||||
selector: charMapToSelector(charMap),
|
||||
charMapToRegExp: charMapToRegExp,
|
||||
charMapToSelector: charMapToSelector
|
||||
};
|
||||
|
||||
var wrapCharWithSpan = function (value) {
|
||||
return '<span data-mce-bogus="1" class="mce-' + Data.charMap[value] + '">' + value + '</span>';
|
||||
};
|
||||
var Html = { wrapCharWithSpan: wrapCharWithSpan };
|
||||
|
||||
var isMatch = function (n) {
|
||||
return isText(n) && value(n) !== undefined && Data.regExp.test(value(n));
|
||||
var value$1 = value(n);
|
||||
return isText(n) && value$1 !== undefined && Data.regExp.test(value$1);
|
||||
};
|
||||
var filterDescendants = function (scope, predicate) {
|
||||
var result = [];
|
||||
@@ -331,8 +319,8 @@ var visualchars = (function (domGlobals) {
|
||||
elm = elm.parentNode;
|
||||
}
|
||||
};
|
||||
var replaceWithSpans = function (html) {
|
||||
return html.replace(Data.regExpGlobal, Html.wrapCharWithSpan);
|
||||
var replaceWithSpans = function (text) {
|
||||
return text.replace(Data.regExpGlobal, Html.wrapCharWithSpan);
|
||||
};
|
||||
var Nodes = {
|
||||
isMatch: isMatch,
|
||||
@@ -345,7 +333,7 @@ var visualchars = (function (domGlobals) {
|
||||
var node, div;
|
||||
var nodeList = Nodes.filterDescendants(Element.fromDom(rootElm), Nodes.isMatch);
|
||||
each(nodeList, function (n) {
|
||||
var withSpans = Nodes.replaceWithSpans(value(n));
|
||||
var withSpans = Nodes.replaceWithSpans(editor.dom.encode(value(n)));
|
||||
div = editor.dom.create('div', null, withSpans);
|
||||
while (node = div.lastChild) {
|
||||
editor.dom.insertAfter(node, n.dom());
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -65,6 +65,8 @@ var wordcount = (function () {
|
||||
WHITESPACE: WHITESPACE
|
||||
};
|
||||
|
||||
var noop = function () {
|
||||
};
|
||||
var constant = function (value) {
|
||||
return function () {
|
||||
return value;
|
||||
@@ -73,8 +75,6 @@ var wordcount = (function () {
|
||||
var never = constant(false);
|
||||
var always = constant(true);
|
||||
|
||||
var never$1 = never;
|
||||
var always$1 = always;
|
||||
var none = function () {
|
||||
return NONE;
|
||||
};
|
||||
@@ -88,37 +88,27 @@ var wordcount = (function () {
|
||||
var id = function (n) {
|
||||
return n;
|
||||
};
|
||||
var noop = function () {
|
||||
};
|
||||
var nul = function () {
|
||||
return null;
|
||||
};
|
||||
var undef = function () {
|
||||
return undefined;
|
||||
};
|
||||
var me = {
|
||||
fold: function (n, s) {
|
||||
return n();
|
||||
},
|
||||
is: never$1,
|
||||
isSome: never$1,
|
||||
isNone: always$1,
|
||||
is: never,
|
||||
isSome: never,
|
||||
isNone: always,
|
||||
getOr: id,
|
||||
getOrThunk: call,
|
||||
getOrDie: function (msg) {
|
||||
throw new Error(msg || 'error: getOrDie called on none.');
|
||||
},
|
||||
getOrNull: nul,
|
||||
getOrUndefined: undef,
|
||||
getOrNull: constant(null),
|
||||
getOrUndefined: constant(undefined),
|
||||
or: id,
|
||||
orThunk: call,
|
||||
map: none,
|
||||
ap: none,
|
||||
each: noop,
|
||||
bind: none,
|
||||
flatten: none,
|
||||
exists: never$1,
|
||||
forall: always$1,
|
||||
exists: never,
|
||||
forall: always,
|
||||
filter: none,
|
||||
equals: eq,
|
||||
equals_: eq,
|
||||
@@ -127,19 +117,23 @@ var wordcount = (function () {
|
||||
},
|
||||
toString: constant('none()')
|
||||
};
|
||||
if (Object.freeze)
|
||||
if (Object.freeze) {
|
||||
Object.freeze(me);
|
||||
}
|
||||
return me;
|
||||
}();
|
||||
|
||||
var typeOf = function (x) {
|
||||
if (x === null)
|
||||
if (x === null) {
|
||||
return 'null';
|
||||
}
|
||||
var t = typeof x;
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array'))
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
||||
return 'array';
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String'))
|
||||
}
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
||||
return 'string';
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var isType = function (type) {
|
||||
@@ -149,18 +143,18 @@ var wordcount = (function () {
|
||||
};
|
||||
var isFunction = isType('function');
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
var nativeSlice = Array.prototype.slice;
|
||||
var map = function (xs, f) {
|
||||
var len = xs.length;
|
||||
var r = new Array(len);
|
||||
for (var i = 0; i < len; i++) {
|
||||
var x = xs[i];
|
||||
r[i] = f(x, i, xs);
|
||||
r[i] = f(x, i);
|
||||
}
|
||||
return r;
|
||||
};
|
||||
var from = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return slice.call(x);
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
|
||||
var SETS$1 = UnicodeData.SETS;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -560,8 +560,6 @@ var inlite = (function (domGlobals) {
|
||||
var never = constant(false);
|
||||
var always = constant(true);
|
||||
|
||||
var never$1 = never;
|
||||
var always$1 = always;
|
||||
var none = function () {
|
||||
return NONE;
|
||||
};
|
||||
@@ -575,37 +573,27 @@ var inlite = (function (domGlobals) {
|
||||
var id = function (n) {
|
||||
return n;
|
||||
};
|
||||
var noop = function () {
|
||||
};
|
||||
var nul = function () {
|
||||
return null;
|
||||
};
|
||||
var undef = function () {
|
||||
return undefined;
|
||||
};
|
||||
var me = {
|
||||
fold: function (n, s) {
|
||||
return n();
|
||||
},
|
||||
is: never$1,
|
||||
isSome: never$1,
|
||||
isNone: always$1,
|
||||
is: never,
|
||||
isSome: never,
|
||||
isNone: always,
|
||||
getOr: id,
|
||||
getOrThunk: call,
|
||||
getOrDie: function (msg) {
|
||||
throw new Error(msg || 'error: getOrDie called on none.');
|
||||
},
|
||||
getOrNull: nul,
|
||||
getOrUndefined: undef,
|
||||
getOrNull: constant(null),
|
||||
getOrUndefined: constant(undefined),
|
||||
or: id,
|
||||
orThunk: call,
|
||||
map: none,
|
||||
ap: none,
|
||||
each: noop,
|
||||
bind: none,
|
||||
flatten: none,
|
||||
exists: never$1,
|
||||
forall: always$1,
|
||||
exists: never,
|
||||
forall: always,
|
||||
filter: none,
|
||||
equals: eq,
|
||||
equals_: eq,
|
||||
@@ -614,20 +602,16 @@ var inlite = (function (domGlobals) {
|
||||
},
|
||||
toString: constant('none()')
|
||||
};
|
||||
if (Object.freeze)
|
||||
if (Object.freeze) {
|
||||
Object.freeze(me);
|
||||
}
|
||||
return me;
|
||||
}();
|
||||
var some = function (a) {
|
||||
var constant_a = function () {
|
||||
return a;
|
||||
};
|
||||
var constant_a = constant(a);
|
||||
var self = function () {
|
||||
return me;
|
||||
};
|
||||
var map = function (f) {
|
||||
return some(f(a));
|
||||
};
|
||||
var bind = function (f) {
|
||||
return f(a);
|
||||
};
|
||||
@@ -638,8 +622,8 @@ var inlite = (function (domGlobals) {
|
||||
is: function (v) {
|
||||
return a === v;
|
||||
},
|
||||
isSome: always$1,
|
||||
isNone: never$1,
|
||||
isSome: always,
|
||||
isNone: never,
|
||||
getOr: constant_a,
|
||||
getOrThunk: constant_a,
|
||||
getOrDie: constant_a,
|
||||
@@ -647,35 +631,31 @@ var inlite = (function (domGlobals) {
|
||||
getOrUndefined: constant_a,
|
||||
or: self,
|
||||
orThunk: self,
|
||||
map: map,
|
||||
ap: function (optfab) {
|
||||
return optfab.fold(none, function (fab) {
|
||||
return some(fab(a));
|
||||
});
|
||||
map: function (f) {
|
||||
return some(f(a));
|
||||
},
|
||||
each: function (f) {
|
||||
f(a);
|
||||
},
|
||||
bind: bind,
|
||||
flatten: constant_a,
|
||||
exists: bind,
|
||||
forall: bind,
|
||||
filter: function (f) {
|
||||
return f(a) ? me : NONE;
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never$1, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
},
|
||||
toArray: function () {
|
||||
return [a];
|
||||
},
|
||||
toString: function () {
|
||||
return 'some(' + a + ')';
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
}
|
||||
};
|
||||
return me;
|
||||
@@ -690,13 +670,16 @@ var inlite = (function (domGlobals) {
|
||||
};
|
||||
|
||||
var typeOf = function (x) {
|
||||
if (x === null)
|
||||
if (x === null) {
|
||||
return 'null';
|
||||
}
|
||||
var t = typeof x;
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array'))
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
||||
return 'array';
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String'))
|
||||
}
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
||||
return 'string';
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var isType$1 = function (type) {
|
||||
@@ -704,47 +687,49 @@ var inlite = (function (domGlobals) {
|
||||
return typeOf(value) === type;
|
||||
};
|
||||
};
|
||||
var isArray$1 = isType$1('array');
|
||||
var isFunction$1 = isType$1('function');
|
||||
var isNumber$1 = isType$1('number');
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
var rawIndexOf = function () {
|
||||
var pIndexOf = Array.prototype.indexOf;
|
||||
var fastIndex = function (xs, x) {
|
||||
return pIndexOf.call(xs, x);
|
||||
};
|
||||
var slowIndex = function (xs, x) {
|
||||
return slowIndexOf(xs, x);
|
||||
};
|
||||
return pIndexOf === undefined ? slowIndex : fastIndex;
|
||||
}();
|
||||
var nativeSlice = Array.prototype.slice;
|
||||
var nativeIndexOf = Array.prototype.indexOf;
|
||||
var nativePush = Array.prototype.push;
|
||||
var rawIndexOf = function (ts, t) {
|
||||
return nativeIndexOf.call(ts, t);
|
||||
};
|
||||
var indexOf = function (xs, x) {
|
||||
var r = rawIndexOf(xs, x);
|
||||
return r === -1 ? Option.none() : Option.some(r);
|
||||
};
|
||||
var exists = function (xs, pred) {
|
||||
return findIndex(xs, pred).isSome();
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
var map = function (xs, f) {
|
||||
var len = xs.length;
|
||||
var r = new Array(len);
|
||||
for (var i = 0; i < len; i++) {
|
||||
var x = xs[i];
|
||||
r[i] = f(x, i, xs);
|
||||
r[i] = f(x, i);
|
||||
}
|
||||
return r;
|
||||
};
|
||||
var each = function (xs, f) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
f(x, i, xs);
|
||||
f(x, i);
|
||||
}
|
||||
};
|
||||
var filter = function (xs, pred) {
|
||||
var r = [];
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
r.push(x);
|
||||
}
|
||||
}
|
||||
@@ -759,41 +744,24 @@ var inlite = (function (domGlobals) {
|
||||
var find = function (xs, pred) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
return Option.some(x);
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
var findIndex = function (xs, pred) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
return Option.some(i);
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
var slowIndexOf = function (xs, x) {
|
||||
for (var i = 0, len = xs.length; i < len; ++i) {
|
||||
if (xs[i] === x) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
var push = Array.prototype.push;
|
||||
var flatten$1 = function (xs) {
|
||||
var r = [];
|
||||
for (var i = 0, len = xs.length; i < len; ++i) {
|
||||
if (!Array.prototype.isPrototypeOf(xs[i]))
|
||||
if (!isArray$1(xs[i])) {
|
||||
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
|
||||
push.apply(r, xs[i]);
|
||||
}
|
||||
nativePush.apply(r, xs[i]);
|
||||
}
|
||||
return r;
|
||||
};
|
||||
var from$1 = isFunction$1(Array.from) ? Array.from : function (x) {
|
||||
return slice.call(x);
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
|
||||
var count = 0;
|
||||
@@ -1225,7 +1193,7 @@ var inlite = (function (domGlobals) {
|
||||
});
|
||||
|
||||
var Collection$1, proto;
|
||||
var push$1 = Array.prototype.push, slice$1 = Array.prototype.slice;
|
||||
var push = Array.prototype.push, slice = Array.prototype.slice;
|
||||
proto = {
|
||||
length: 0,
|
||||
init: function (items) {
|
||||
@@ -1239,10 +1207,10 @@ var inlite = (function (domGlobals) {
|
||||
if (items instanceof Collection$1) {
|
||||
self.add(items.toArray());
|
||||
} else {
|
||||
push$1.call(self, items);
|
||||
push.call(self, items);
|
||||
}
|
||||
} else {
|
||||
push$1.apply(self, items);
|
||||
push.apply(self, items);
|
||||
}
|
||||
return self;
|
||||
},
|
||||
@@ -1279,7 +1247,7 @@ var inlite = (function (domGlobals) {
|
||||
return new Collection$1(matches);
|
||||
},
|
||||
slice: function () {
|
||||
return new Collection$1(slice$1.apply(this, arguments));
|
||||
return new Collection$1(slice.apply(this, arguments));
|
||||
},
|
||||
eq: function (index) {
|
||||
return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
|
||||
@@ -4234,8 +4202,9 @@ var inlite = (function (domGlobals) {
|
||||
|
||||
var path = function (parts, scope) {
|
||||
var o = scope !== undefined && scope !== null ? scope : Global;
|
||||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
|
||||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
|
||||
o = o[parts[i]];
|
||||
}
|
||||
return o;
|
||||
};
|
||||
var resolve = function (p, scope) {
|
||||
@@ -4248,8 +4217,9 @@ var inlite = (function (domGlobals) {
|
||||
};
|
||||
var getOrDie = function (name, scope) {
|
||||
var actual = unsafe(name, scope);
|
||||
if (actual === undefined || actual === null)
|
||||
throw name + ' not available on this browser';
|
||||
if (actual === undefined || actual === null) {
|
||||
throw new Error(name + ' not available on this browser');
|
||||
}
|
||||
return actual;
|
||||
};
|
||||
var Global$1 = { getOrDie: getOrDie };
|
||||
@@ -5172,6 +5142,7 @@ var inlite = (function (domGlobals) {
|
||||
global$7(self.getEl('button')).on('click touchstart', function (e) {
|
||||
e.stopPropagation();
|
||||
input.click();
|
||||
e.preventDefault();
|
||||
});
|
||||
self.getEl().appendChild(input);
|
||||
},
|
||||
@@ -6311,18 +6282,20 @@ var inlite = (function (domGlobals) {
|
||||
var firstMatch = function (regexes, s) {
|
||||
for (var i = 0; i < regexes.length; i++) {
|
||||
var x = regexes[i];
|
||||
if (x.test(s))
|
||||
if (x.test(s)) {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
var find$1 = function (regexes, agent) {
|
||||
var r = firstMatch(regexes, agent);
|
||||
if (!r)
|
||||
if (!r) {
|
||||
return {
|
||||
major: 0,
|
||||
minor: 0
|
||||
};
|
||||
}
|
||||
var group = function (i) {
|
||||
return Number(agent.replace(r, '$' + i));
|
||||
};
|
||||
@@ -6330,8 +6303,9 @@ var inlite = (function (domGlobals) {
|
||||
};
|
||||
var detect = function (versionRegexes, agent) {
|
||||
var cleanedAgent = String(agent).toLowerCase();
|
||||
if (versionRegexes.length === 0)
|
||||
if (versionRegexes.length === 0) {
|
||||
return unknown();
|
||||
}
|
||||
return find$1(versionRegexes, cleanedAgent);
|
||||
};
|
||||
var unknown = function () {
|
||||
@@ -6501,8 +6475,7 @@ var inlite = (function (domGlobals) {
|
||||
name: 'Edge',
|
||||
versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
|
||||
search: function (uastring) {
|
||||
var monstrosity = contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit');
|
||||
return monstrosity;
|
||||
return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit');
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -7826,11 +7799,11 @@ var inlite = (function (domGlobals) {
|
||||
return menuItem && menuItem.text === '-';
|
||||
};
|
||||
var trimMenuItems = function (menuItems) {
|
||||
var menuItems2 = filter(menuItems, function (menuItem, i, menuItems) {
|
||||
var menuItems2 = filter(menuItems, function (menuItem, i) {
|
||||
return !isSeparator(menuItem) || !isSeparator(menuItems[i - 1]);
|
||||
});
|
||||
return filter(menuItems2, function (menuItem, i, menuItems) {
|
||||
return !isSeparator(menuItem) || i > 0 && i < menuItems.length - 1;
|
||||
return filter(menuItems2, function (menuItem, i) {
|
||||
return !isSeparator(menuItem) || i > 0 && i < menuItems2.length - 1;
|
||||
});
|
||||
};
|
||||
var createContextMenuItems = function (editor, context) {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
@@ -159,8 +159,6 @@ var modern = (function (domGlobals) {
|
||||
var never = constant(false);
|
||||
var always = constant(true);
|
||||
|
||||
var never$1 = never;
|
||||
var always$1 = always;
|
||||
var none = function () {
|
||||
return NONE;
|
||||
};
|
||||
@@ -174,37 +172,27 @@ var modern = (function (domGlobals) {
|
||||
var id = function (n) {
|
||||
return n;
|
||||
};
|
||||
var noop = function () {
|
||||
};
|
||||
var nul = function () {
|
||||
return null;
|
||||
};
|
||||
var undef = function () {
|
||||
return undefined;
|
||||
};
|
||||
var me = {
|
||||
fold: function (n, s) {
|
||||
return n();
|
||||
},
|
||||
is: never$1,
|
||||
isSome: never$1,
|
||||
isNone: always$1,
|
||||
is: never,
|
||||
isSome: never,
|
||||
isNone: always,
|
||||
getOr: id,
|
||||
getOrThunk: call,
|
||||
getOrDie: function (msg) {
|
||||
throw new Error(msg || 'error: getOrDie called on none.');
|
||||
},
|
||||
getOrNull: nul,
|
||||
getOrUndefined: undef,
|
||||
getOrNull: constant(null),
|
||||
getOrUndefined: constant(undefined),
|
||||
or: id,
|
||||
orThunk: call,
|
||||
map: none,
|
||||
ap: none,
|
||||
each: noop,
|
||||
bind: none,
|
||||
flatten: none,
|
||||
exists: never$1,
|
||||
forall: always$1,
|
||||
exists: never,
|
||||
forall: always,
|
||||
filter: none,
|
||||
equals: eq,
|
||||
equals_: eq,
|
||||
@@ -213,20 +201,16 @@ var modern = (function (domGlobals) {
|
||||
},
|
||||
toString: constant('none()')
|
||||
};
|
||||
if (Object.freeze)
|
||||
if (Object.freeze) {
|
||||
Object.freeze(me);
|
||||
}
|
||||
return me;
|
||||
}();
|
||||
var some = function (a) {
|
||||
var constant_a = function () {
|
||||
return a;
|
||||
};
|
||||
var constant_a = constant(a);
|
||||
var self = function () {
|
||||
return me;
|
||||
};
|
||||
var map = function (f) {
|
||||
return some(f(a));
|
||||
};
|
||||
var bind = function (f) {
|
||||
return f(a);
|
||||
};
|
||||
@@ -237,8 +221,8 @@ var modern = (function (domGlobals) {
|
||||
is: function (v) {
|
||||
return a === v;
|
||||
},
|
||||
isSome: always$1,
|
||||
isNone: never$1,
|
||||
isSome: always,
|
||||
isNone: never,
|
||||
getOr: constant_a,
|
||||
getOrThunk: constant_a,
|
||||
getOrDie: constant_a,
|
||||
@@ -246,35 +230,31 @@ var modern = (function (domGlobals) {
|
||||
getOrUndefined: constant_a,
|
||||
or: self,
|
||||
orThunk: self,
|
||||
map: map,
|
||||
ap: function (optfab) {
|
||||
return optfab.fold(none, function (fab) {
|
||||
return some(fab(a));
|
||||
});
|
||||
map: function (f) {
|
||||
return some(f(a));
|
||||
},
|
||||
each: function (f) {
|
||||
f(a);
|
||||
},
|
||||
bind: bind,
|
||||
flatten: constant_a,
|
||||
exists: bind,
|
||||
forall: bind,
|
||||
filter: function (f) {
|
||||
return f(a) ? me : NONE;
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never$1, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
},
|
||||
toArray: function () {
|
||||
return [a];
|
||||
},
|
||||
toString: function () {
|
||||
return 'some(' + a + ')';
|
||||
},
|
||||
equals: function (o) {
|
||||
return o.is(a);
|
||||
},
|
||||
equals_: function (o, elementEq) {
|
||||
return o.fold(never, function (b) {
|
||||
return elementEq(a, b);
|
||||
});
|
||||
}
|
||||
};
|
||||
return me;
|
||||
@@ -663,13 +643,16 @@ var modern = (function (domGlobals) {
|
||||
var ContextToolbars = { addContextualToolbars: addContextualToolbars };
|
||||
|
||||
var typeOf = function (x) {
|
||||
if (x === null)
|
||||
if (x === null) {
|
||||
return 'null';
|
||||
}
|
||||
var t = typeof x;
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array'))
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
||||
return 'array';
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String'))
|
||||
}
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
||||
return 'string';
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var isType = function (type) {
|
||||
@@ -677,47 +660,49 @@ var modern = (function (domGlobals) {
|
||||
return typeOf(value) === type;
|
||||
};
|
||||
};
|
||||
var isArray = isType('array');
|
||||
var isFunction = isType('function');
|
||||
var isNumber = isType('number');
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
var rawIndexOf = function () {
|
||||
var pIndexOf = Array.prototype.indexOf;
|
||||
var fastIndex = function (xs, x) {
|
||||
return pIndexOf.call(xs, x);
|
||||
};
|
||||
var slowIndex = function (xs, x) {
|
||||
return slowIndexOf(xs, x);
|
||||
};
|
||||
return pIndexOf === undefined ? slowIndex : fastIndex;
|
||||
}();
|
||||
var nativeSlice = Array.prototype.slice;
|
||||
var nativeIndexOf = Array.prototype.indexOf;
|
||||
var nativePush = Array.prototype.push;
|
||||
var rawIndexOf = function (ts, t) {
|
||||
return nativeIndexOf.call(ts, t);
|
||||
};
|
||||
var indexOf = function (xs, x) {
|
||||
var r = rawIndexOf(xs, x);
|
||||
return r === -1 ? Option.none() : Option.some(r);
|
||||
};
|
||||
var exists = function (xs, pred) {
|
||||
return findIndex(xs, pred).isSome();
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
var map = function (xs, f) {
|
||||
var len = xs.length;
|
||||
var r = new Array(len);
|
||||
for (var i = 0; i < len; i++) {
|
||||
var x = xs[i];
|
||||
r[i] = f(x, i, xs);
|
||||
r[i] = f(x, i);
|
||||
}
|
||||
return r;
|
||||
};
|
||||
var each = function (xs, f) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
f(x, i, xs);
|
||||
f(x, i);
|
||||
}
|
||||
};
|
||||
var filter = function (xs, pred) {
|
||||
var r = [];
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
r.push(x);
|
||||
}
|
||||
}
|
||||
@@ -732,7 +717,7 @@ var modern = (function (domGlobals) {
|
||||
var find = function (xs, pred) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
return Option.some(x);
|
||||
}
|
||||
}
|
||||
@@ -741,32 +726,24 @@ var modern = (function (domGlobals) {
|
||||
var findIndex = function (xs, pred) {
|
||||
for (var i = 0, len = xs.length; i < len; i++) {
|
||||
var x = xs[i];
|
||||
if (pred(x, i, xs)) {
|
||||
if (pred(x, i)) {
|
||||
return Option.some(i);
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
var slowIndexOf = function (xs, x) {
|
||||
for (var i = 0, len = xs.length; i < len; ++i) {
|
||||
if (xs[i] === x) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
var push = Array.prototype.push;
|
||||
var flatten = function (xs) {
|
||||
var r = [];
|
||||
for (var i = 0, len = xs.length; i < len; ++i) {
|
||||
if (!Array.prototype.isPrototypeOf(xs[i]))
|
||||
if (!isArray(xs[i])) {
|
||||
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
|
||||
push.apply(r, xs[i]);
|
||||
}
|
||||
nativePush.apply(r, xs[i]);
|
||||
}
|
||||
return r;
|
||||
};
|
||||
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return slice.call(x);
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
|
||||
var defaultMenus = {
|
||||
@@ -822,11 +799,11 @@ var modern = (function (domGlobals) {
|
||||
var menuItemsPass1 = filter(namedMenuItems, function (namedMenuItem) {
|
||||
return removedMenuItems.hasOwnProperty(namedMenuItem.name) === false;
|
||||
});
|
||||
var menuItemsPass2 = filter(menuItemsPass1, function (namedMenuItem, i, namedMenuItems) {
|
||||
return !isSeparator(namedMenuItem) || !isSeparator(namedMenuItems[i - 1]);
|
||||
var menuItemsPass2 = filter(menuItemsPass1, function (namedMenuItem, i) {
|
||||
return !isSeparator(namedMenuItem) || !isSeparator(menuItemsPass1[i - 1]);
|
||||
});
|
||||
return filter(menuItemsPass2, function (namedMenuItem, i, namedMenuItems) {
|
||||
return !isSeparator(namedMenuItem) || i > 0 && i < namedMenuItems.length - 1;
|
||||
return filter(menuItemsPass2, function (namedMenuItem, i) {
|
||||
return !isSeparator(namedMenuItem) || i > 0 && i < menuItemsPass2.length - 1;
|
||||
});
|
||||
};
|
||||
var createMenu = function (editorMenuItems, menus, removedMenuItems, context) {
|
||||
@@ -1765,7 +1742,7 @@ var modern = (function (domGlobals) {
|
||||
});
|
||||
|
||||
var Collection$1, proto;
|
||||
var push$1 = Array.prototype.push, slice$1 = Array.prototype.slice;
|
||||
var push = Array.prototype.push, slice = Array.prototype.slice;
|
||||
proto = {
|
||||
length: 0,
|
||||
init: function (items) {
|
||||
@@ -1779,10 +1756,10 @@ var modern = (function (domGlobals) {
|
||||
if (items instanceof Collection$1) {
|
||||
self.add(items.toArray());
|
||||
} else {
|
||||
push$1.call(self, items);
|
||||
push.call(self, items);
|
||||
}
|
||||
} else {
|
||||
push$1.apply(self, items);
|
||||
push.apply(self, items);
|
||||
}
|
||||
return self;
|
||||
},
|
||||
@@ -1819,7 +1796,7 @@ var modern = (function (domGlobals) {
|
||||
return new Collection$1(matches);
|
||||
},
|
||||
slice: function () {
|
||||
return new Collection$1(slice$1.apply(this, arguments));
|
||||
return new Collection$1(slice.apply(this, arguments));
|
||||
},
|
||||
eq: function (index) {
|
||||
return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
|
||||
@@ -4990,6 +4967,7 @@ var modern = (function (domGlobals) {
|
||||
global$9(self.getEl('button')).on('click touchstart', function (e) {
|
||||
e.stopPropagation();
|
||||
input.click();
|
||||
e.preventDefault();
|
||||
});
|
||||
self.getEl().appendChild(input);
|
||||
},
|
||||
@@ -6087,6 +6065,32 @@ var modern = (function (domGlobals) {
|
||||
var ENTITY = domGlobals.Node.ENTITY_NODE;
|
||||
var NOTATION = domGlobals.Node.NOTATION_NODE;
|
||||
|
||||
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
|
||||
|
||||
var path = function (parts, scope) {
|
||||
var o = scope !== undefined && scope !== null ? scope : Global;
|
||||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
|
||||
o = o[parts[i]];
|
||||
}
|
||||
return o;
|
||||
};
|
||||
var resolve = function (p, scope) {
|
||||
var parts = p.split('.');
|
||||
return path(parts, scope);
|
||||
};
|
||||
|
||||
var unsafe = function (name, scope) {
|
||||
return resolve(name, scope);
|
||||
};
|
||||
var getOrDie = function (name, scope) {
|
||||
var actual = unsafe(name, scope);
|
||||
if (actual === undefined || actual === null) {
|
||||
throw new Error(name + ' not available on this browser');
|
||||
}
|
||||
return actual;
|
||||
};
|
||||
var Global$1 = { getOrDie: getOrDie };
|
||||
|
||||
var Immutable = function () {
|
||||
var fields = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
@@ -6108,30 +6112,6 @@ var modern = (function (domGlobals) {
|
||||
};
|
||||
};
|
||||
|
||||
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
|
||||
|
||||
var path = function (parts, scope) {
|
||||
var o = scope !== undefined && scope !== null ? scope : Global;
|
||||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
|
||||
o = o[parts[i]];
|
||||
return o;
|
||||
};
|
||||
var resolve = function (p, scope) {
|
||||
var parts = p.split('.');
|
||||
return path(parts, scope);
|
||||
};
|
||||
|
||||
var unsafe = function (name, scope) {
|
||||
return resolve(name, scope);
|
||||
};
|
||||
var getOrDie = function (name, scope) {
|
||||
var actual = unsafe(name, scope);
|
||||
if (actual === undefined || actual === null)
|
||||
throw name + ' not available on this browser';
|
||||
return actual;
|
||||
};
|
||||
var Global$1 = { getOrDie: getOrDie };
|
||||
|
||||
var node = function () {
|
||||
var f = Global$1.getOrDie('Node');
|
||||
return f;
|
||||
@@ -6153,18 +6133,20 @@ var modern = (function (domGlobals) {
|
||||
var firstMatch = function (regexes, s) {
|
||||
for (var i = 0; i < regexes.length; i++) {
|
||||
var x = regexes[i];
|
||||
if (x.test(s))
|
||||
if (x.test(s)) {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
var find$1 = function (regexes, agent) {
|
||||
var r = firstMatch(regexes, agent);
|
||||
if (!r)
|
||||
if (!r) {
|
||||
return {
|
||||
major: 0,
|
||||
minor: 0
|
||||
};
|
||||
}
|
||||
var group = function (i) {
|
||||
return Number(agent.replace(r, '$' + i));
|
||||
};
|
||||
@@ -6172,8 +6154,9 @@ var modern = (function (domGlobals) {
|
||||
};
|
||||
var detect = function (versionRegexes, agent) {
|
||||
var cleanedAgent = String(agent).toLowerCase();
|
||||
if (versionRegexes.length === 0)
|
||||
if (versionRegexes.length === 0) {
|
||||
return unknown();
|
||||
}
|
||||
return find$1(versionRegexes, cleanedAgent);
|
||||
};
|
||||
var unknown = function () {
|
||||
@@ -6343,8 +6326,7 @@ var modern = (function (domGlobals) {
|
||||
name: 'Edge',
|
||||
versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
|
||||
search: function (uastring) {
|
||||
var monstrosity = contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit');
|
||||
return monstrosity;
|
||||
return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit');
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -7668,11 +7650,11 @@ var modern = (function (domGlobals) {
|
||||
return menuItem && menuItem.text === '-';
|
||||
};
|
||||
var trimMenuItems = function (menuItems) {
|
||||
var menuItems2 = filter(menuItems, function (menuItem, i, menuItems) {
|
||||
var menuItems2 = filter(menuItems, function (menuItem, i) {
|
||||
return !isSeparator$1(menuItem) || !isSeparator$1(menuItems[i - 1]);
|
||||
});
|
||||
return filter(menuItems2, function (menuItem, i, menuItems) {
|
||||
return !isSeparator$1(menuItem) || i > 0 && i < menuItems.length - 1;
|
||||
return filter(menuItems2, function (menuItem, i) {
|
||||
return !isSeparator$1(menuItem) || i > 0 && i < menuItems2.length - 1;
|
||||
});
|
||||
};
|
||||
var createContextMenuItems = function (editor, context) {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user