"),
+ makePredByNodeName: x,
+ isEditable: w,
+ isControlSizing: function(t) {
+ return t && i()(t).hasClass("note-control-sizing")
},
- isText: E,
- isElement: function (t) {
- return t && 1 === t.nodeType;
+ isText: $,
+ isElement: function(t) {
+ return t && 1 === t.nodeType
},
- isVoid: $,
- isPara: N,
- isPurePara: function (t) {
- return N(t) && !P(t);
+ isVoid: S,
+ isPara: _,
+ isPurePara: function(t) {
+ return _(t) && !T(t)
},
- isHeading: function (t) {
- return t && /^H[1-7]/.test(t.nodeName.toUpperCase());
+ isHeading: function(t) {
+ return t && /^H[1-7]/.test(t.nodeName.toUpperCase())
},
- isInline: A,
- isBlock: g.not(A),
- isBodyInline: function (t) {
- return A(t) && !V(t, N);
+ isInline: P,
+ isBlock: m.not(P),
+ isBodyInline: function(t) {
+ return P(t) && !W(t, _)
},
- isBody: O,
- isParaInline: function (t) {
- return A(t) && !!V(t, N);
+ isBody: B,
+ isParaInline: function(t) {
+ return P(t) && !!W(t, _)
},
- isPre: I,
- isList: F,
- isTable: R,
- isData: L,
- isCell: H,
- isBlockquote: B,
- isBodyContainer: z,
- isAnchor: M,
- isDiv: T("DIV"),
- isLi: P,
- isBR: T("BR"),
- isSpan: T("SPAN"),
- isB: T("B"),
- isU: T("U"),
- isS: T("S"),
- isI: T("I"),
- isImg: T("IMG"),
- isTextarea: ht,
- deepestChildIsEmpty: function (t) {
- do {
- if (null === t.firstElementChild || "" === t.firstElementChild.innerHTML) break;
- } while ((t = t.firstElementChild));
- return W(t);
+ isPre: N,
+ isList: R,
+ isTable: I,
+ isData: E,
+ isCell: A,
+ isBlockquote: F,
+ isBodyContainer: D,
+ isAnchor: H,
+ isDiv: x("DIV"),
+ isLi: T,
+ isBR: x("BR"),
+ isSpan: x("SPAN"),
+ isB: x("B"),
+ isU: x("U"),
+ isS: x("S"),
+ isI: x("I"),
+ isImg: x("IMG"),
+ isTextarea: tu,
+ deepestChildIsEmpty: function(t) {
+ do
+ if (null === t.firstElementChild || "" === t.firstElementChild.innerHTML) break; while (t = t.firstElementChild);
+ return O(t)
},
- isEmpty: W,
- isEmptyAnchor: g.and(M, W),
- isClosestSibling: function (t, e) {
- return t.nextSibling === e || t.previousSibling === e;
+ isEmpty: O,
+ isEmptyAnchor: m.and(H, O),
+ isClosestSibling: function(t, e) {
+ return t.nextSibling === e || t.previousSibling === e
},
- withClosestSiblings: function (t, e) {
- e = e || g.ok;
+ withClosestSiblings: function(t, e) {
+ e = e || m.ok;
var n = [];
- return t.previousSibling && e(t.previousSibling) && n.push(t.previousSibling), n.push(t), t.nextSibling && e(t.nextSibling) && n.push(t.nextSibling), n;
+ return t.previousSibling && e(t.previousSibling) && n.push(t.previousSibling), n.push(t), t.nextSibling && e(t.nextSibling) && n.push(t.nextSibling), n
},
- nodeLength: U,
- isLeftEdgePoint: Z,
- isRightEdgePoint: X,
- isEdgePoint: Q,
- isLeftEdgeOf: J,
- isRightEdgeOf: tt,
- isLeftEdgePointOf: function (t, e) {
- return Z(t) && J(t.node, e);
+ nodeLength: M,
+ isLeftEdgePoint: G,
+ isRightEdgePoint: Y,
+ isEdgePoint: Z,
+ isLeftEdgeOf: X,
+ isRightEdgeOf: Q,
+ isLeftEdgePointOf: function(t, e) {
+ return G(t) && X(t.node, e)
},
- isRightEdgePointOf: function (t, e) {
- return X(t) && tt(t.node, e);
+ isRightEdgePointOf: function(t, e) {
+ return Y(t) && Q(t.node, e)
},
- prevPoint: ot,
- nextPoint: it,
- nextPointWithEmptyNode: rt,
- isSamePoint: st,
- isVisiblePoint: function (t) {
- if (E(t.node) || !nt(t.node) || W(t.node)) return !0;
+ prevPoint: te,
+ nextPoint: tn,
+ nextPointWithEmptyNode: to,
+ isSamePoint: ta,
+ isVisiblePoint: function(t) {
+ if ($(t.node) || !tt(t.node) || O(t.node)) return !0;
var e = t.node.childNodes[t.offset - 1],
n = t.node.childNodes[t.offset];
- return !((e && !$(e)) || (n && !$(n)));
+ return !(e && !S(e) || n && !S(n))
},
- prevPointUntil: function (t, e) {
- for (; t; ) {
+ prevPointUntil: function(t, e) {
+ for (; t;) {
if (e(t)) return t;
- t = ot(t);
+ t = te(t)
}
- return null;
+ return null
},
- nextPointUntil: function (t, e) {
- for (; t; ) {
+ nextPointUntil: function(t, e) {
+ for (; t;) {
if (e(t)) return t;
- t = it(t);
+ t = tn(t)
}
- return null;
+ return null
},
- isCharPoint: function (t) {
- if (!E(t.node)) return !1;
+ isCharPoint: function(t) {
+ if (!$(t.node)) return !1;
var e = t.node.nodeValue.charAt(t.offset - 1);
- return e && " " !== e && e !== x;
+ return e && " " !== e && "\xa0" !== e
},
- isSpacePoint: function (t) {
- if (!E(t.node)) return !1;
+ isSpacePoint: function(t) {
+ if (!$(t.node)) return !1;
var e = t.node.nodeValue.charAt(t.offset - 1);
- return " " === e || e === x;
+ return " " === e || "\xa0" === e
},
- walkPoint: function (t, e, n, o) {
- for (var i = t; i && (n(i), !st(i, e)); ) {
- i = rt(i, o && t.node !== i.node && e.node !== i.node);
- }
+ walkPoint: function(t, e, n, o) {
+ for (var i = t; i && (n(i), !ta(i, e));) i = to(i, o && t.node !== i.node && e.node !== i.node)
},
- ancestor: V,
- singleChildAncestor: function (t, e) {
- for (t = t.parentNode; t && 1 === U(t); ) {
+ ancestor: W,
+ singleChildAncestor: function(t, e) {
+ for (t = t.parentNode; t && 1 === M(t);) {
if (e(t)) return t;
- if (S(t)) break;
- t = t.parentNode;
+ if (w(t)) break;
+ t = t.parentNode
}
- return null;
+ return null
},
- listAncestor: q,
- lastAncestor: function (t, e) {
- var n = q(t);
- return C.last(n.filter(e));
+ listAncestor: j,
+ lastAncestor: function(t, e) {
+ var n = j(t);
+ return C.last(n.filter(e))
},
- listNext: _,
- listPrev: function (t, e) {
- e = e || g.fail;
- for (var n = []; t && !e(t); ) n.push(t), (t = t.previousSibling);
- return n;
+ listNext: K,
+ listPrev: function(t, e) {
+ e = e || m.fail;
+ for (var n = []; t && !e(t);) n.push(t), t = t.previousSibling;
+ return n
},
- listDescendant: function (t, e) {
+ listDescendant: function(t, e) {
var n = [];
- return (
- (e = e || g.ok),
- (function o(i) {
+ return e = e || m.ok,
+ function o(i) {
t !== i && e(i) && n.push(i);
- for (var r = 0, a = i.childNodes.length; r < a; r++) o(i.childNodes[r]);
- })(t),
- n
- );
+ for (var a = 0, r = i.childNodes.length; a < r; a++) o(i.childNodes[a])
+ }(t), n
},
- commonAncestor: function (t, e) {
- for (var n = q(t), o = e; o; o = o.parentNode) if (n.indexOf(o) > -1) return o;
- return null;
+ commonAncestor: function(t, e) {
+ for (var n = j(t), o = e; o; o = o.parentNode)
+ if (n.indexOf(o) > -1) return o;
+ return null
},
- wrap: function (t, e) {
+ wrap: function(t, e) {
var n = t.parentNode,
o = i()("<" + e + ">")[0];
- return n.insertBefore(o, t), o.appendChild(t), o;
+ return n.insertBefore(o, t), o.appendChild(t), o
},
- insertAfter: G,
- appendChildNodes: Y,
- position: et,
- hasChildren: nt,
- makeOffsetPath: function (t, e) {
- return q(e, g.eq(t)).map(et).reverse();
+ insertAfter: V,
+ appendChildNodes: q,
+ position: J,
+ hasChildren: tt,
+ makeOffsetPath: function(t, e) {
+ return j(e, m.eq(t)).map(J).reverse()
},
- fromOffsetPath: function (t, e) {
+ fromOffsetPath: function(t, e) {
for (var n = t, o = 0, i = e.length; o < i; o++) n = n.childNodes.length <= e[o] ? n.childNodes[n.childNodes.length - 1] : n.childNodes[e[o]];
- return n;
+ return n
},
- splitTree: ct,
- splitPoint: function (t, e) {
- var n,
- o,
- i = e ? N : z,
- r = q(t.node, i),
- a = C.last(r) || t.node;
- i(a) ? ((n = r[r.length - 2]), (o = a)) : (o = (n = a).parentNode);
- var s = n && ct(n, t, { isSkipPaddingBlankHTML: e, isNotSplitEdgePoint: e });
- return s || o !== t.node || (s = t.node.childNodes[t.offset]), { rightNode: s, container: o };
+ splitTree: ts,
+ splitPoint: function(t, e) {
+ var n, o, i = e ? _ : D,
+ a = j(t.node, i),
+ r = C.last(a) || t.node;
+ i(r) ? (n = a[a.length - 2], o = r) : o = (n = r).parentNode;
+ var s = n && ts(n, t, {
+ isSkipPaddingBlankHTML: e,
+ isNotSplitEdgePoint: e
+ });
+ return s || o !== t.node || (s = t.node.childNodes[t.offset]), {
+ rightNode: s,
+ container: o
+ }
},
- create: ut,
- createText: function (t) {
- return document.createTextNode(t);
+ create: tl,
+ createText: function(t) {
+ return document.createTextNode(t)
},
- remove: dt,
- removeWhile: function (t, e) {
- for (; t && !S(t) && e(t); ) {
+ remove: tc,
+ removeWhile: function(t, e) {
+ for (; t && !w(t) && e(t);) {
var n = t.parentNode;
- dt(t), (t = n);
+ tc(t), t = n
}
},
- replace: function (t, e) {
+ replace: function(t, e) {
if (t.nodeName.toUpperCase() === e.toUpperCase()) return t;
- var n = ut(e);
- return t.style.cssText && (n.style.cssText = t.style.cssText), Y(n, C.from(t.childNodes)), G(n, t), dt(t), n;
+ var n = tl(e);
+ return t.style.cssText && (n.style.cssText = t.style.cssText), q(n, C.from(t.childNodes)), V(n, t), tc(t), n
},
- html: function (t, e) {
- var n = ft(t);
- if (e) {
- n = (n = n.replace(/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g, function (t, e, n) {
- n = n.toUpperCase();
- var o = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(n) && !!e,
- i = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(n);
- return t + (o || i ? "\n" : "");
- })).trim();
- }
- return n;
+ html: function(t, e) {
+ var n = td(t);
+ return e && (n = (n = n.replace(/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g, function(t, e, n) {
+ n = n.toUpperCase();
+ var o = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(n) && !!e,
+ i = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(n);
+ return t + (o || i ? "\n" : "")
+ })).trim()), n
},
- value: ft,
- posFromPlaceholder: function (t) {
+ value: td,
+ posFromPlaceholder: function(t) {
var e = i()(t),
n = e.offset(),
o = e.outerHeight(!0);
- return { left: n.left, top: n.top + o };
- },
- attachEvents: function (t, e) {
- Object.keys(e).forEach(function (n) {
- t.on(n, e[n]);
- });
+ return {
+ left: n.left,
+ top: n.top + o
+ }
},
- detachEvents: function (t, e) {
- Object.keys(e).forEach(function (n) {
- t.off(n, e[n]);
- });
+ attachEvents: function(t, e) {
+ Object.keys(e).forEach(function(n) {
+ t.on(n, e[n])
+ })
},
- isCustomStyleTag: function (t) {
- return t && !E(t) && C.contains(t.classList, "note-styletag");
+ detachEvents: function(t, e) {
+ Object.keys(e).forEach(function(n) {
+ t.off(n, e[n])
+ })
},
+ isCustomStyleTag: function(t) {
+ return t && !$(t) && C.contains(t.classList, "note-styletag")
+ }
};
- function mt(t, e) {
+
+ function tf(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
- (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o)
}
}
- var vt = (function () {
- function t(e, n) {
- !(function (t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
- })(this, t),
- (this.$note = e),
- (this.memos = {}),
- (this.modules = {}),
- (this.layoutInfo = {}),
- (this.options = i.a.extend(!0, {}, n)),
- (i.a.summernote.ui = i.a.summernote.ui_template(this.options)),
- (this.ui = i.a.summernote.ui),
- this.initialize();
+ var tp = function() {
+ var t, e, n;
+
+ function o(t, e) {
+ ! function(t, e) {
+ if (!(t instanceof e)) throw TypeError("Cannot call a class as a function")
+ }(this, o), this.$note = t, this.memos = {}, this.modules = {}, this.layoutInfo = {}, this.options = i.a.extend(!0, {}, e), i.a.summernote.ui = i.a.summernote.ui_template(this.options), this.ui = i.a.summernote.ui, this.initialize()
}
- var e, n, o;
- return (
- (e = t),
- (n = [
- {
- key: "initialize",
- value: function () {
- return (this.layoutInfo = this.ui.createLayout(this.$note)), this._initialize(), this.$note.hide(), this;
- },
- },
- {
- key: "destroy",
- value: function () {
- this._destroy(), this.$note.removeData("summernote"), this.ui.removeLayout(this.$note, this.layoutInfo);
- },
- },
- {
- key: "reset",
- value: function () {
- var t = this.isDisabled();
- this.code(pt.emptyPara), this._destroy(), this._initialize(), t && this.disable();
- },
- },
- {
- key: "_initialize",
- value: function () {
- var t = this;
- (this.options.id = g.uniqueId(i.a.now())), (this.options.container = this.options.container || this.layoutInfo.editor);
- var e = i.a.extend({}, this.options.buttons);
- Object.keys(e).forEach(function (n) {
- t.memo("button." + n, e[n]);
- });
- var n = i.a.extend({}, this.options.modules, i.a.summernote.plugins || {});
- Object.keys(n).forEach(function (e) {
- t.module(e, n[e], !0);
- }),
- Object.keys(this.modules).forEach(function (e) {
- t.initializeModule(e);
- });
- },
- },
- {
- key: "_destroy",
- value: function () {
- var t = this;
- Object.keys(this.modules)
- .reverse()
- .forEach(function (e) {
- t.removeModule(e);
- }),
- Object.keys(this.memos).forEach(function (e) {
- t.removeMemo(e);
- }),
- this.triggerEvent("destroy", this);
- },
- },
- {
- key: "code",
- value: function (t) {
- var e = this.invoke("codeview.isActivated");
- if (void 0 === t) return this.invoke("codeview.sync"), e ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html();
- e ? this.invoke("codeview.sync", t) : this.layoutInfo.editable.html(t), this.$note.val(t), this.triggerEvent("change", t, this.layoutInfo.editable);
- },
- },
- {
- key: "isDisabled",
- value: function () {
- return "false" === this.layoutInfo.editable.attr("contenteditable");
- },
- },
- {
- key: "enable",
- value: function () {
- this.layoutInfo.editable.attr("contenteditable", !0), this.invoke("toolbar.activate", !0), this.triggerEvent("disable", !1), (this.options.editing = !0);
- },
- },
- {
- key: "disable",
- value: function () {
- this.invoke("codeview.isActivated") && this.invoke("codeview.deactivate"),
- this.layoutInfo.editable.attr("contenteditable", !1),
- (this.options.editing = !1),
- this.invoke("toolbar.deactivate", !0),
- this.triggerEvent("disable", !0);
- },
- },
- {
- key: "triggerEvent",
- value: function () {
- var t = C.head(arguments),
- e = C.tail(C.from(arguments)),
- n = this.options.callbacks[g.namespaceToCamel(t, "on")];
- n && n.apply(this.$note[0], e), this.$note.trigger("summernote." + t, e);
- },
- },
- {
- key: "initializeModule",
- value: function (t) {
- var e = this.modules[t];
- (e.shouldInitialize = e.shouldInitialize || g.ok), e.shouldInitialize() && (e.initialize && e.initialize(), e.events && pt.attachEvents(this.$note, e.events));
- },
- },
- {
- key: "module",
- value: function (t, e, n) {
- if (1 === arguments.length) return this.modules[t];
- (this.modules[t] = new e(this)), n || this.initializeModule(t);
- },
- },
- {
- key: "removeModule",
- value: function (t) {
- var e = this.modules[t];
- e.shouldInitialize() && (e.events && pt.detachEvents(this.$note, e.events), e.destroy && e.destroy()), delete this.modules[t];
- },
- },
- {
- key: "memo",
- value: function (t, e) {
- if (1 === arguments.length) return this.memos[t];
- this.memos[t] = e;
- },
- },
- {
- key: "removeMemo",
- value: function (t) {
- this.memos[t] && this.memos[t].destroy && this.memos[t].destroy(), delete this.memos[t];
- },
- },
- {
- key: "createInvokeHandlerAndUpdateState",
- value: function (t, e) {
- var n = this;
- return function (o) {
- n.createInvokeHandler(t, e)(o), n.invoke("buttons.updateCurrentStyle");
- };
- },
- },
- {
- key: "createInvokeHandler",
- value: function (t, e) {
- var n = this;
- return function (o) {
- o.preventDefault();
- var r = i()(o.target);
- n.invoke(t, e || r.closest("[data-value]").data("value"), r);
- };
- },
- },
- {
- key: "invoke",
- value: function () {
- var t = C.head(arguments),
- e = C.tail(C.from(arguments)),
- n = t.split("."),
- o = n.length > 1,
- i = o && C.head(n),
- r = o ? C.last(n) : C.head(n),
- a = this.modules[i || "editor"];
- return !i && this[r] ? this[r].apply(this, e) : a && a[r] && a.shouldInitialize() ? a[r].apply(a, e) : void 0;
- },
- },
- ]) && mt(e.prototype, n),
- o && mt(e, o),
- t
- );
- })();
- function gt(t, e) {
+ return t = o, e = [{
+ key: "initialize",
+ value: function() {
+ return this.layoutInfo = this.ui.createLayout(this.$note), this._initialize(), this.$note.hide(), this
+ }
+ }, {
+ key: "destroy",
+ value: function() {
+ this._destroy(), this.$note.removeData("summernote"), this.ui.removeLayout(this.$note, this.layoutInfo)
+ }
+ }, {
+ key: "reset",
+ value: function() {
+ var t = this.isDisabled();
+ this.code(th.emptyPara), this._destroy(), this._initialize(), t && this.disable()
+ }
+ }, {
+ key: "_initialize",
+ value: function() {
+ var t = this;
+ this.options.id = m.uniqueId(i.a.now()), this.options.container = this.options.container || this.layoutInfo.editor;
+ var e = i.a.extend({}, this.options.buttons);
+ Object.keys(e).forEach(function(n) {
+ t.memo("button." + n, e[n])
+ });
+ var n = i.a.extend({}, this.options.modules, i.a.summernote.plugins || {});
+ Object.keys(n).forEach(function(e) {
+ t.module(e, n[e], !0)
+ }), Object.keys(this.modules).forEach(function(e) {
+ t.initializeModule(e)
+ })
+ }
+ }, {
+ key: "_destroy",
+ value: function() {
+ var t = this;
+ Object.keys(this.modules).reverse().forEach(function(e) {
+ t.removeModule(e)
+ }), Object.keys(this.memos).forEach(function(e) {
+ t.removeMemo(e)
+ }), this.triggerEvent("destroy", this)
+ }
+ }, {
+ key: "code",
+ value: function(t) {
+ var e = this.invoke("codeview.isActivated");
+ if (void 0 === t) return this.invoke("codeview.sync"), e ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html();
+ e ? this.invoke("codeview.sync", t) : this.layoutInfo.editable.html(t), this.$note.val(t), this.triggerEvent("change", t, this.layoutInfo.editable)
+ }
+ }, {
+ key: "isDisabled",
+ value: function() {
+ return "false" === this.layoutInfo.editable.attr("contenteditable")
+ }
+ }, {
+ key: "enable",
+ value: function() {
+ this.layoutInfo.editable.attr("contenteditable", !0), this.invoke("toolbar.activate", !0), this.triggerEvent("disable", !1), this.options.editing = !0
+ }
+ }, {
+ key: "disable",
+ value: function() {
+ this.invoke("codeview.isActivated") && this.invoke("codeview.deactivate"), this.layoutInfo.editable.attr("contenteditable", !1), this.options.editing = !1, this.invoke("toolbar.deactivate", !0), this.triggerEvent("disable", !0)
+ }
+ }, {
+ key: "triggerEvent",
+ value: function() {
+ var t = C.head(arguments),
+ e = C.tail(C.from(arguments)),
+ n = this.options.callbacks[m.namespaceToCamel(t, "on")];
+ n && n.apply(this.$note[0], e), this.$note.trigger("summernote." + t, e)
+ }
+ }, {
+ key: "initializeModule",
+ value: function(t) {
+ var e = this.modules[t];
+ e.shouldInitialize = e.shouldInitialize || m.ok, e.shouldInitialize() && (e.initialize && e.initialize(), e.events && th.attachEvents(this.$note, e.events))
+ }
+ }, {
+ key: "module",
+ value: function(t, e, n) {
+ if (1 === arguments.length) return this.modules[t];
+ this.modules[t] = new e(this), n || this.initializeModule(t)
+ }
+ }, {
+ key: "removeModule",
+ value: function(t) {
+ var e = this.modules[t];
+ e.shouldInitialize() && (e.events && th.detachEvents(this.$note, e.events), e.destroy && e.destroy()), delete this.modules[t]
+ }
+ }, {
+ key: "memo",
+ value: function(t, e) {
+ if (1 === arguments.length) return this.memos[t];
+ this.memos[t] = e
+ }
+ }, {
+ key: "removeMemo",
+ value: function(t) {
+ this.memos[t] && this.memos[t].destroy && this.memos[t].destroy(), delete this.memos[t]
+ }
+ }, {
+ key: "createInvokeHandlerAndUpdateState",
+ value: function(t, e) {
+ var n = this;
+ return function(o) {
+ n.createInvokeHandler(t, e)(o), n.invoke("buttons.updateCurrentStyle")
+ }
+ }
+ }, {
+ key: "createInvokeHandler",
+ value: function(t, e) {
+ var n = this;
+ return function(o) {
+ o.preventDefault();
+ var a = i()(o.target);
+ n.invoke(t, e || a.closest("[data-value]").data("value"), a)
+ }
+ }
+ }, {
+ key: "invoke",
+ value: function() {
+ var t = C.head(arguments),
+ e = C.tail(C.from(arguments)),
+ n = t.split("."),
+ o = n.length > 1,
+ i = o && C.head(n),
+ a = o ? C.last(n) : C.head(n),
+ r = this.modules[i || "editor"];
+ return !i && this[a] ? this[a].apply(this, e) : r && r[a] && r.shouldInitialize() ? r[a].apply(r, e) : void 0
+ }
+ }, ], tf(t.prototype, e), n && tf(t, n), o
+ }();
+
+ function tv(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
- (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o)
}
}
- function bt(t, e) {
- var n,
- o,
- i = t.parentElement(),
- r = document.body.createTextRange(),
- a = C.from(i.childNodes);
- for (n = 0; n < a.length; n++)
- if (!pt.isText(a[n])) {
- if ((r.moveToElementText(a[n]), r.compareEndPoints("StartToStart", t) >= 0)) break;
- o = a[n];
- }
- if (0 !== n && pt.isText(a[n - 1])) {
+
+ function tm(t, e) {
+ var n, o, i = t.parentElement(),
+ a = document.body.createTextRange(),
+ r = C.from(i.childNodes);
+ for (n = 0; n < r.length; n++)
+ if (!th.isText(r[n])) {
+ if (a.moveToElementText(r[n]), a.compareEndPoints("StartToStart", t) >= 0) break;
+ o = r[n]
+ } if (0 !== n && th.isText(r[n - 1])) {
var s = document.body.createTextRange(),
l = null;
- s.moveToElementText(o || i), s.collapse(!o), (l = o ? o.nextSibling : i.firstChild);
+ s.moveToElementText(o || i), s.collapse(!o), l = o ? o.nextSibling : i.firstChild;
var c = t.duplicate();
c.setEndPoint("StartToStart", s);
- for (var u = c.text.replace(/[\r\n]/g, "").length; u > l.nodeValue.length && l.nextSibling; ) (u -= l.nodeValue.length), (l = l.nextSibling);
- l.nodeValue;
- e && l.nextSibling && pt.isText(l.nextSibling) && u === l.nodeValue.length && ((u -= l.nodeValue.length), (l = l.nextSibling)), (i = l), (n = u);
+ for (var u = c.text.replace(/[\r\n]/g, "").length; u > l.nodeValue.length && l.nextSibling;) u -= l.nodeValue.length, l = l.nextSibling;
+ l.nodeValue, e && l.nextSibling && th.isText(l.nextSibling) && u === l.nodeValue.length && (u -= l.nodeValue.length, l = l.nextSibling), i = l, n = u
+ }
+ return {
+ cont: i,
+ offset: n
}
- return { cont: i, offset: n };
}
- function kt(t) {
+
+ function tg(t) {
var e = document.body.createTextRange(),
- n = (function t(e, n) {
+ n = function t(e, n) {
var o, i;
- if (pt.isText(e)) {
- var r = pt.listPrev(e, g.not(pt.isText)),
- a = C.last(r).previousSibling;
- (o = a || e.parentNode), (n += C.sum(C.tail(r), pt.nodeLength)), (i = !a);
+ if (th.isText(e)) {
+ var a = th.listPrev(e, m.not(th.isText)),
+ r = C.last(a).previousSibling;
+ o = r || e.parentNode, n += C.sum(C.tail(a), th.nodeLength), i = !r
} else {
- if (((o = e.childNodes[n] || e), pt.isText(o))) return t(o, 0);
- (n = 0), (i = !1);
+ if (o = e.childNodes[n] || e, th.isText(o)) return t(o, 0);
+ n = 0, i = !1
+ }
+ return {
+ node: o,
+ collapseToStart: i,
+ offset: n
}
- return { node: o, collapseToStart: i, offset: n };
- })(t.node, t.offset);
- return e.moveToElementText(n.node), e.collapse(n.collapseToStart), e.moveStart("character", n.offset), e;
+ }(t.node, t.offset);
+ return e.moveToElementText(n.node), e.collapse(n.collapseToStart), e.moveStart("character", n.offset), e
}
i.a.fn.extend({
- summernote: function () {
+ summernote: function() {
var t = i.a.type(C.head(arguments)),
- e = "string" === t,
- n = "object" === t,
- o = i.a.extend({}, i.a.summernote.options, n ? C.head(arguments) : {});
- (o.langInfo = i.a.extend(!0, {}, i.a.summernote.lang["en-US"], i.a.summernote.lang[o.lang])),
- (o.icons = i.a.extend(!0, {}, i.a.summernote.options.icons, o.icons)),
- (o.tooltip = "auto" === o.tooltip ? !m.isSupportTouch : o.tooltip),
- this.each(function (t, e) {
- var n = i()(e);
- if (!n.data("summernote")) {
- var r = new vt(n, o);
- n.data("summernote", r), n.data("summernote").triggerEvent("init", r.layoutInfo);
- }
- });
- var r = this.first();
- if (r.length) {
- var a = r.data("summernote");
- if (e) return a.invoke.apply(a, C.from(arguments));
- o.focus && a.invoke("editor.focus");
+ e = i.a.extend({}, i.a.summernote.options, "object" === t ? C.head(arguments) : {});
+ e.langInfo = i.a.extend(!0, {}, i.a.summernote.lang["en-US"], i.a.summernote.lang[e.lang]), e.icons = i.a.extend(!0, {}, i.a.summernote.options.icons, e.icons), e.tooltip = "auto" === e.tooltip ? !p.isSupportTouch : e.tooltip, this.each(function(t, n) {
+ var o = i()(n);
+ if (!o.data("summernote")) {
+ var a = new tp(o, e);
+ o.data("summernote", a), o.data("summernote").triggerEvent("init", a.layoutInfo)
+ }
+ });
+ var n = this.first();
+ if (n.length) {
+ var o = n.data("summernote");
+ if ("string" === t) return o.invoke.apply(o, C.from(arguments));
+ e.focus && o.invoke("editor.focus")
}
- return this;
- },
+ return this
+ }
});
- var yt = (function () {
- function t(e, n, o, i) {
- !(function (t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
- })(this, t),
- (this.sc = e),
- (this.so = n),
- (this.ec = o),
- (this.eo = i),
- (this.isOnEditable = this.makeIsOn(pt.isEditable)),
- (this.isOnList = this.makeIsOn(pt.isList)),
- (this.isOnAnchor = this.makeIsOn(pt.isAnchor)),
- (this.isOnCell = this.makeIsOn(pt.isCell)),
- (this.isOnData = this.makeIsOn(pt.isData));
- }
- var e, n, o;
- return (
- (e = t),
- (n = [
- {
- key: "nativeRange",
- value: function () {
- if (m.isW3CRangeSupport) {
- var t = document.createRange();
- return t.setStart(this.sc, this.so), t.setEnd(this.ec, this.eo), t;
+ var tb = function() {
+ var t, e, n;
+
+ function o(t, e, n, i) {
+ ! function(t, e) {
+ if (!(t instanceof e)) throw TypeError("Cannot call a class as a function")
+ }(this, o), this.sc = t, this.so = e, this.ec = n, this.eo = i, this.isOnEditable = this.makeIsOn(th.isEditable), this.isOnList = this.makeIsOn(th.isList), this.isOnAnchor = this.makeIsOn(th.isAnchor), this.isOnCell = this.makeIsOn(th.isCell), this.isOnData = this.makeIsOn(th.isData)
+ }
+ return t = o, e = [{
+ key: "nativeRange",
+ value: function() {
+ if (p.isW3CRangeSupport) {
+ var t = document.createRange();
+ return t.setStart(this.sc, this.so), t.setEnd(this.ec, this.eo), t
+ }
+ var e = tg({
+ node: this.sc,
+ offset: this.so
+ });
+ return e.setEndPoint("EndToEnd", tg({
+ node: this.ec,
+ offset: this.eo
+ })), e
+ }
+ }, {
+ key: "getPoints",
+ value: function() {
+ return {
+ sc: this.sc,
+ so: this.so,
+ ec: this.ec,
+ eo: this.eo
+ }
+ }
+ }, {
+ key: "getStartPoint",
+ value: function() {
+ return {
+ node: this.sc,
+ offset: this.so
+ }
+ }
+ }, {
+ key: "getEndPoint",
+ value: function() {
+ return {
+ node: this.ec,
+ offset: this.eo
+ }
+ }
+ }, {
+ key: "select",
+ value: function() {
+ var t = this.nativeRange();
+ if (p.isW3CRangeSupport) {
+ var e = document.getSelection();
+ e.rangeCount > 0 && e.removeAllRanges(), e.addRange(t)
+ } else t.select();
+ return this
+ }
+ }, {
+ key: "scrollIntoView",
+ value: function(t) {
+ var e = i()(t).height();
+ return t.scrollTop + e < this.sc.offsetTop && (t.scrollTop += Math.abs(t.scrollTop + e - this.sc.offsetTop)), this
+ }
+ }, {
+ key: "normalize",
+ value: function() {
+ var t = function(t, e) {
+ if (!t || th.isVisiblePoint(t) && (!th.isEdgePoint(t) || th.isRightEdgePoint(t) && !e || th.isLeftEdgePoint(t) && e || th.isRightEdgePoint(t) && e && th.isVoid(t.node.nextSibling) || th.isLeftEdgePoint(t) && !e && th.isVoid(t.node.previousSibling) || th.isBlock(t.node) && th.isEmpty(t.node))) return t;
+ var n = th.ancestor(t.node, th.isBlock),
+ o = !1;
+ if (!o) {
+ var i = th.prevPoint(t) || {
+ node: null
+ };
+ o = (th.isLeftEdgePointOf(t, n) || th.isVoid(i.node)) && !e
+ }
+ var a = !1;
+ if (!a) {
+ var r = th.nextPoint(t) || {
+ node: null
+ };
+ a = (th.isRightEdgePointOf(t, n) || th.isVoid(r.node)) && e
}
- var e = kt({ node: this.sc, offset: this.so });
- return e.setEndPoint("EndToEnd", kt({ node: this.ec, offset: this.eo })), e;
+ if (o || a) {
+ if (th.isVisiblePoint(t)) return t;
+ e = !e
+ }
+ return (e ? th.nextPointUntil(th.nextPoint(t), th.isVisiblePoint) : th.prevPointUntil(th.prevPoint(t), th.isVisiblePoint)) || t
},
- },
- {
- key: "getPoints",
- value: function () {
- return { sc: this.sc, so: this.so, ec: this.ec, eo: this.eo };
+ e = t(this.getEndPoint(), !1),
+ n = this.isCollapsed() ? e : t(this.getStartPoint(), !0);
+ return new o(n.node, n.offset, e.node, e.offset)
+ }
+ }, {
+ key: "nodes",
+ value: function(t, e) {
+ t = t || m.ok;
+ var n = e && e.includeAncestor,
+ o = e && e.fullyContains,
+ i = this.getStartPoint(),
+ a = this.getEndPoint(),
+ r = [],
+ s = [];
+ return th.walkPoint(i, a, function(e) {
+ var i;
+ th.isEditable(e.node) || (o ? (th.isLeftEdgePoint(e) && s.push(e.node), th.isRightEdgePoint(e) && C.contains(s, e.node) && (i = e.node)) : i = n ? th.ancestor(e.node, t) : e.node, i && t(i) && r.push(i))
+ }, !0), C.unique(r)
+ }
+ }, {
+ key: "commonAncestor",
+ value: function() {
+ return th.commonAncestor(this.sc, this.ec)
+ }
+ }, {
+ key: "expand",
+ value: function(t) {
+ var e = th.ancestor(this.sc, t),
+ n = th.ancestor(this.ec, t);
+ if (!e && !n) return new o(this.sc, this.so, this.ec, this.eo);
+ var i = this.getPoints();
+ return e && (i.sc = e, i.so = 0), n && (i.ec = n, i.eo = th.nodeLength(n)), new o(i.sc, i.so, i.ec, i.eo)
+ }
+ }, {
+ key: "collapse",
+ value: function(t) {
+ return t ? new o(this.sc, this.so, this.sc, this.so) : new o(this.ec, this.eo, this.ec, this.eo)
+ }
+ }, {
+ key: "splitText",
+ value: function() {
+ var t = this.sc === this.ec,
+ e = this.getPoints();
+ return th.isText(this.ec) && !th.isEdgePoint(this.getEndPoint()) && this.ec.splitText(this.eo), th.isText(this.sc) && !th.isEdgePoint(this.getStartPoint()) && (e.sc = this.sc.splitText(this.so), e.so = 0, t && (e.ec = e.sc, e.eo = this.eo - this.so)), new o(e.sc, e.so, e.ec, e.eo)
+ }
+ }, {
+ key: "deleteContents",
+ value: function() {
+ if (this.isCollapsed()) return this;
+ var t = this.splitText(),
+ e = t.nodes(null, {
+ fullyContains: !0
+ }),
+ n = th.prevPointUntil(t.getStartPoint(), function(t) {
+ return !C.contains(e, t.node)
+ }),
+ a = [];
+ return i.a.each(e, function(t, e) {
+ var o = e.parentNode;
+ n.node !== o && 1 === th.nodeLength(o) && a.push(o), th.remove(e, !1)
+ }), i.a.each(a, function(t, e) {
+ th.remove(e, !1)
+ }), new o(n.node, n.offset, n.node, n.offset).normalize()
+ }
+ }, {
+ key: "makeIsOn",
+ value: function(t) {
+ return function() {
+ var e = th.ancestor(this.sc, t);
+ return !!e && e === th.ancestor(this.ec, t)
+ }
+ }
+ }, {
+ key: "isLeftEdgeOf",
+ value: function(t) {
+ if (!th.isLeftEdgePoint(this.getStartPoint())) return !1;
+ var e = th.ancestor(this.sc, t);
+ return e && th.isLeftEdgeOf(this.sc, e)
+ }
+ }, {
+ key: "isCollapsed",
+ value: function() {
+ return this.sc === this.ec && this.so === this.eo
+ }
+ }, {
+ key: "wrapBodyInlineWithPara",
+ value: function() {
+ if (th.isBodyContainer(this.sc) && th.isEmpty(this.sc)) return this.sc.innerHTML = th.emptyPara, new o(this.sc.firstChild, 0, this.sc.firstChild, 0);
+ var t, e = this.normalize();
+ if (th.isParaInline(this.sc) || th.isPara(this.sc)) return e;
+ if (th.isInline(e.sc)) {
+ var n = th.listAncestor(e.sc, m.not(th.isInline));
+ t = C.last(n), th.isInline(t) || (t = n[n.length - 2] || e.sc.childNodes[e.so])
+ } else t = e.sc.childNodes[e.so > 0 ? e.so - 1 : 0];
+ if (t) {
+ var i = th.listPrev(t, th.isParaInline).reverse();
+ if ((i = i.concat(th.listNext(t.nextSibling, th.isParaInline))).length) {
+ var a = th.wrap(C.head(i), "p");
+ th.appendChildNodes(a, C.tail(i))
+ }
+ }
+ return this.normalize()
+ }
+ }, {
+ key: "insertNode",
+ value: function(t) {
+ var e = this;
+ (th.isText(t) || th.isInline(t)) && (e = this.wrapBodyInlineWithPara().deleteContents());
+ var n = th.splitPoint(e.getStartPoint(), th.isInline(t));
+ return n.rightNode ? (n.rightNode.parentNode.insertBefore(t, n.rightNode), th.isEmpty(n.rightNode) && th.isPara(t) && n.rightNode.parentNode.removeChild(n.rightNode)) : n.container.appendChild(t), t
+ }
+ }, {
+ key: "pasteHTML",
+ value: function(t) {
+ t = i.a.trim(t);
+ var e = i()("").html(t)[0],
+ n = C.from(e.childNodes),
+ o = this,
+ a = !1;
+ return o.so >= 0 && (n = n.reverse(), a = !0), n = n.map(function(t) {
+ return o.insertNode(t)
+ }), a && (n = n.reverse()), n
+ }
+ }, {
+ key: "toString",
+ value: function() {
+ var t = this.nativeRange();
+ return p.isW3CRangeSupport ? t.toString() : t.text
+ }
+ }, {
+ key: "getWordRange",
+ value: function(t) {
+ var e = this.getEndPoint();
+ if (!th.isCharPoint(e)) return this;
+ var n = th.prevPointUntil(e, function(t) {
+ return !th.isCharPoint(t)
+ });
+ return t && (e = th.nextPointUntil(e, function(t) {
+ return !th.isCharPoint(t)
+ })), new o(n.node, n.offset, e.node, e.offset)
+ }
+ }, {
+ key: "getWordsRange",
+ value: function(t) {
+ var e = this.getEndPoint(),
+ n = function(t) {
+ return !th.isCharPoint(t) && !th.isSpacePoint(t)
+ };
+ if (n(e)) return this;
+ var i = th.prevPointUntil(e, n);
+ return t && (e = th.nextPointUntil(e, n)), new o(i.node, i.offset, e.node, e.offset)
+ }
+ }, {
+ key: "getWordsMatchRange",
+ value: function(t) {
+ var e = this.getEndPoint(),
+ n = th.prevPointUntil(e, function(n) {
+ if (!th.isCharPoint(n) && !th.isSpacePoint(n)) return !0;
+ var i = new o(n.node, n.offset, e.node, e.offset),
+ a = t.exec(i.toString());
+ return a && 0 === a.index
+ }),
+ i = new o(n.node, n.offset, e.node, e.offset),
+ a = i.toString(),
+ r = t.exec(a);
+ return r && r[0].length === a.length ? i : null
+ }
+ }, {
+ key: "bookmark",
+ value: function(t) {
+ return {
+ s: {
+ path: th.makeOffsetPath(t, this.sc),
+ offset: this.so
},
- },
- {
- key: "getStartPoint",
- value: function () {
- return { node: this.sc, offset: this.so };
- },
- },
- {
- key: "getEndPoint",
- value: function () {
- return { node: this.ec, offset: this.eo };
- },
- },
- {
- key: "select",
- value: function () {
- var t = this.nativeRange();
- if (m.isW3CRangeSupport) {
- var e = document.getSelection();
- e.rangeCount > 0 && e.removeAllRanges(), e.addRange(t);
- } else t.select();
- return this;
- },
- },
- {
- key: "scrollIntoView",
- value: function (t) {
- var e = i()(t).height();
- return t.scrollTop + e < this.sc.offsetTop && (t.scrollTop += Math.abs(t.scrollTop + e - this.sc.offsetTop)), this;
- },
- },
- {
- key: "normalize",
- value: function () {
- var e = function (t, e) {
- if (!t) return t;
- if (
- pt.isVisiblePoint(t) &&
- (!pt.isEdgePoint(t) ||
- (pt.isRightEdgePoint(t) && !e) ||
- (pt.isLeftEdgePoint(t) && e) ||
- (pt.isRightEdgePoint(t) && e && pt.isVoid(t.node.nextSibling)) ||
- (pt.isLeftEdgePoint(t) && !e && pt.isVoid(t.node.previousSibling)) ||
- (pt.isBlock(t.node) && pt.isEmpty(t.node)))
- )
- return t;
- var n = pt.ancestor(t.node, pt.isBlock),
- o = !1;
- if (!o) {
- var i = pt.prevPoint(t) || { node: null };
- o = (pt.isLeftEdgePointOf(t, n) || pt.isVoid(i.node)) && !e;
- }
- var r = !1;
- if (!r) {
- var a = pt.nextPoint(t) || { node: null };
- r = (pt.isRightEdgePointOf(t, n) || pt.isVoid(a.node)) && e;
- }
- if (o || r) {
- if (pt.isVisiblePoint(t)) return t;
- e = !e;
- }
- return (e ? pt.nextPointUntil(pt.nextPoint(t), pt.isVisiblePoint) : pt.prevPointUntil(pt.prevPoint(t), pt.isVisiblePoint)) || t;
- },
- n = e(this.getEndPoint(), !1),
- o = this.isCollapsed() ? n : e(this.getStartPoint(), !0);
- return new t(o.node, o.offset, n.node, n.offset);
- },
- },
- {
- key: "nodes",
- value: function (t, e) {
- t = t || g.ok;
- var n = e && e.includeAncestor,
- o = e && e.fullyContains,
- i = this.getStartPoint(),
- r = this.getEndPoint(),
- a = [],
- s = [];
- return (
- pt.walkPoint(
- i,
- r,
- function (e) {
- var i;
- pt.isEditable(e.node) || (o ? (pt.isLeftEdgePoint(e) && s.push(e.node), pt.isRightEdgePoint(e) && C.contains(s, e.node) && (i = e.node)) : (i = n ? pt.ancestor(e.node, t) : e.node), i && t(i) && a.push(i));
- },
- !0
- ),
- C.unique(a)
- );
- },
- },
- {
- key: "commonAncestor",
- value: function () {
- return pt.commonAncestor(this.sc, this.ec);
- },
- },
- {
- key: "expand",
- value: function (e) {
- var n = pt.ancestor(this.sc, e),
- o = pt.ancestor(this.ec, e);
- if (!n && !o) return new t(this.sc, this.so, this.ec, this.eo);
- var i = this.getPoints();
- return n && ((i.sc = n), (i.so = 0)), o && ((i.ec = o), (i.eo = pt.nodeLength(o))), new t(i.sc, i.so, i.ec, i.eo);
- },
- },
- {
- key: "collapse",
- value: function (e) {
- return e ? new t(this.sc, this.so, this.sc, this.so) : new t(this.ec, this.eo, this.ec, this.eo);
- },
- },
- {
- key: "splitText",
- value: function () {
- var e = this.sc === this.ec,
- n = this.getPoints();
- return (
- pt.isText(this.ec) && !pt.isEdgePoint(this.getEndPoint()) && this.ec.splitText(this.eo),
- pt.isText(this.sc) && !pt.isEdgePoint(this.getStartPoint()) && ((n.sc = this.sc.splitText(this.so)), (n.so = 0), e && ((n.ec = n.sc), (n.eo = this.eo - this.so))),
- new t(n.sc, n.so, n.ec, n.eo)
- );
- },
- },
- {
- key: "deleteContents",
- value: function () {
- if (this.isCollapsed()) return this;
- var e = this.splitText(),
- n = e.nodes(null, { fullyContains: !0 }),
- o = pt.prevPointUntil(e.getStartPoint(), function (t) {
- return !C.contains(n, t.node);
- }),
- r = [];
- return (
- i.a.each(n, function (t, e) {
- var n = e.parentNode;
- o.node !== n && 1 === pt.nodeLength(n) && r.push(n), pt.remove(e, !1);
- }),
- i.a.each(r, function (t, e) {
- pt.remove(e, !1);
- }),
- new t(o.node, o.offset, o.node, o.offset).normalize()
- );
- },
- },
- {
- key: "makeIsOn",
- value: function (t) {
- return function () {
- var e = pt.ancestor(this.sc, t);
- return !!e && e === pt.ancestor(this.ec, t);
- };
- },
- },
- {
- key: "isLeftEdgeOf",
- value: function (t) {
- if (!pt.isLeftEdgePoint(this.getStartPoint())) return !1;
- var e = pt.ancestor(this.sc, t);
- return e && pt.isLeftEdgeOf(this.sc, e);
- },
- },
- {
- key: "isCollapsed",
- value: function () {
- return this.sc === this.ec && this.so === this.eo;
- },
- },
- {
- key: "wrapBodyInlineWithPara",
- value: function () {
- if (pt.isBodyContainer(this.sc) && pt.isEmpty(this.sc)) return (this.sc.innerHTML = pt.emptyPara), new t(this.sc.firstChild, 0, this.sc.firstChild, 0);
- var e,
- n = this.normalize();
- if (pt.isParaInline(this.sc) || pt.isPara(this.sc)) return n;
- if (pt.isInline(n.sc)) {
- var o = pt.listAncestor(n.sc, g.not(pt.isInline));
- (e = C.last(o)), pt.isInline(e) || (e = o[o.length - 2] || n.sc.childNodes[n.so]);
- } else e = n.sc.childNodes[n.so > 0 ? n.so - 1 : 0];
- if (e) {
- var i = pt.listPrev(e, pt.isParaInline).reverse();
- if ((i = i.concat(pt.listNext(e.nextSibling, pt.isParaInline))).length) {
- var r = pt.wrap(C.head(i), "p");
- pt.appendChildNodes(r, C.tail(i));
- }
- }
- return this.normalize();
- },
- },
- {
- key: "insertNode",
- value: function (t) {
- var e = this;
- (pt.isText(t) || pt.isInline(t)) && (e = this.wrapBodyInlineWithPara().deleteContents());
- var n = pt.splitPoint(e.getStartPoint(), pt.isInline(t));
- return n.rightNode ? (n.rightNode.parentNode.insertBefore(t, n.rightNode), pt.isEmpty(n.rightNode) && pt.isPara(t) && n.rightNode.parentNode.removeChild(n.rightNode)) : n.container.appendChild(t), t;
- },
- },
- {
- key: "pasteHTML",
- value: function (t) {
- t = i.a.trim(t);
- var e = i()("").html(t)[0],
- n = C.from(e.childNodes),
- o = this,
- r = !1;
- return (
- o.so >= 0 && ((n = n.reverse()), (r = !0)),
- (n = n.map(function (t) {
- return o.insertNode(t);
- })),
- r && (n = n.reverse()),
- n
- );
- },
- },
- {
- key: "toString",
- value: function () {
- var t = this.nativeRange();
- return m.isW3CRangeSupport ? t.toString() : t.text;
- },
- },
- {
- key: "getWordRange",
- value: function (e) {
- var n = this.getEndPoint();
- if (!pt.isCharPoint(n)) return this;
- var o = pt.prevPointUntil(n, function (t) {
- return !pt.isCharPoint(t);
- });
- return (
- e &&
- (n = pt.nextPointUntil(n, function (t) {
- return !pt.isCharPoint(t);
- })),
- new t(o.node, o.offset, n.node, n.offset)
- );
- },
- },
- {
- key: "getWordsRange",
- value: function (e) {
- var n = this.getEndPoint(),
- o = function (t) {
- return !pt.isCharPoint(t) && !pt.isSpacePoint(t);
- };
- if (o(n)) return this;
- var i = pt.prevPointUntil(n, o);
- return e && (n = pt.nextPointUntil(n, o)), new t(i.node, i.offset, n.node, n.offset);
- },
- },
- {
- key: "getWordsMatchRange",
- value: function (e) {
- var n = this.getEndPoint(),
- o = pt.prevPointUntil(n, function (o) {
- if (!pt.isCharPoint(o) && !pt.isSpacePoint(o)) return !0;
- var i = new t(o.node, o.offset, n.node, n.offset),
- r = e.exec(i.toString());
- return r && 0 === r.index;
- }),
- i = new t(o.node, o.offset, n.node, n.offset),
- r = i.toString(),
- a = e.exec(r);
- return a && a[0].length === r.length ? i : null;
- },
- },
- {
- key: "bookmark",
- value: function (t) {
- return { s: { path: pt.makeOffsetPath(t, this.sc), offset: this.so }, e: { path: pt.makeOffsetPath(t, this.ec), offset: this.eo } };
- },
- },
- {
- key: "paraBookmark",
- value: function (t) {
- return { s: { path: C.tail(pt.makeOffsetPath(C.head(t), this.sc)), offset: this.so }, e: { path: C.tail(pt.makeOffsetPath(C.last(t), this.ec)), offset: this.eo } };
- },
- },
- {
- key: "getClientRects",
- value: function () {
- return this.nativeRange().getClientRects();
+ e: {
+ path: th.makeOffsetPath(t, this.ec),
+ offset: this.eo
+ }
+ }
+ }
+ }, {
+ key: "paraBookmark",
+ value: function(t) {
+ return {
+ s: {
+ path: C.tail(th.makeOffsetPath(C.head(t), this.sc)),
+ offset: this.so
},
- },
- ]) && gt(e.prototype, n),
- o && gt(e, o),
- t
- );
- })(),
- wt = {
- create: function (t, e, n, o) {
- if (4 === arguments.length) return new yt(t, e, n, o);
- if (2 === arguments.length) return new yt(t, e, (n = t), (o = e));
+ e: {
+ path: C.tail(th.makeOffsetPath(C.last(t), this.ec)),
+ offset: this.eo
+ }
+ }
+ }
+ }, {
+ key: "getClientRects",
+ value: function() {
+ return this.nativeRange().getClientRects()
+ }
+ }, ], tv(t.prototype, e), n && tv(t, n), o
+ }(),
+ tk = {
+ create: function(t, e, n, o) {
+ if (4 === arguments.length) return new tb(t, e, n, o);
+ if (2 === arguments.length) return new tb(t, e, n = t, o = e);
var i = this.createFromSelection();
if (!i && 1 === arguments.length) {
- var r = arguments[0];
- return pt.isEditable(r) && (r = r.lastChild), this.createFromBodyElement(r, pt.emptyPara === arguments[0].innerHTML);
+ var a = arguments[0];
+ return th.isEditable(a) && (a = a.lastChild), this.createFromBodyElement(a, th.emptyPara === arguments[0].innerHTML)
}
- return i;
+ return i
},
- createFromBodyElement: function (t) {
- var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
- n = this.createFromNode(t);
- return n.collapse(e);
+ createFromBodyElement: function(t) {
+ var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
+ return this.createFromNode(t).collapse(e)
},
- createFromSelection: function () {
+ createFromSelection: function() {
var t, e, n, o;
- if (m.isW3CRangeSupport) {
+ if (p.isW3CRangeSupport) {
var i = document.getSelection();
- if (!i || 0 === i.rangeCount) return null;
- if (pt.isBody(i.anchorNode)) return null;
- var r = i.getRangeAt(0);
- (t = r.startContainer), (e = r.startOffset), (n = r.endContainer), (o = r.endOffset);
+ if (!i || 0 === i.rangeCount || th.isBody(i.anchorNode)) return null;
+ var a = i.getRangeAt(0);
+ t = a.startContainer, e = a.startOffset, n = a.endContainer, o = a.endOffset
} else {
- var a = document.selection.createRange(),
- s = a.duplicate();
+ var r = document.selection.createRange(),
+ s = r.duplicate();
s.collapse(!1);
- var l = a;
+ var l = r;
l.collapse(!0);
- var c = bt(l, !0),
- u = bt(s, !1);
- pt.isText(c.node) && pt.isLeftEdgePoint(c) && pt.isTextNode(u.node) && pt.isRightEdgePoint(u) && u.node.nextSibling === c.node && (c = u), (t = c.cont), (e = c.offset), (n = u.cont), (o = u.offset);
+ var c = tm(l, !0),
+ u = tm(s, !1);
+ th.isText(c.node) && th.isLeftEdgePoint(c) && th.isTextNode(u.node) && th.isRightEdgePoint(u) && u.node.nextSibling === c.node && (c = u), t = c.cont, e = c.offset, n = u.cont, o = u.offset
}
- return new yt(t, e, n, o);
+ return new tb(t, e, n, o)
},
- createFromNode: function (t) {
+ createFromNode: function(t) {
var e = t,
n = 0,
o = t,
- i = pt.nodeLength(o);
- return (
- pt.isVoid(e) && ((n = pt.listPrev(e).length - 1), (e = e.parentNode)),
- pt.isBR(o) ? ((i = pt.listPrev(o).length - 1), (o = o.parentNode)) : pt.isVoid(o) && ((i = pt.listPrev(o).length), (o = o.parentNode)),
- this.create(e, n, o, i)
- );
+ i = th.nodeLength(o);
+ return th.isVoid(e) && (n = th.listPrev(e).length - 1, e = e.parentNode), th.isBR(o) ? (i = th.listPrev(o).length - 1, o = o.parentNode) : th.isVoid(o) && (i = th.listPrev(o).length, o = o.parentNode), this.create(e, n, o, i)
},
- createFromNodeBefore: function (t) {
- return this.createFromNode(t).collapse(!0);
+ createFromNodeBefore: function(t) {
+ return this.createFromNode(t).collapse(!0)
},
- createFromNodeAfter: function (t) {
- return this.createFromNode(t).collapse();
+ createFromNodeAfter: function(t) {
+ return this.createFromNode(t).collapse()
},
- createFromBookmark: function (t, e) {
- var n = pt.fromOffsetPath(t, e.s.path),
+ createFromBookmark: function(t, e) {
+ var n = th.fromOffsetPath(t, e.s.path),
o = e.s.offset,
- i = pt.fromOffsetPath(t, e.e.path),
- r = e.e.offset;
- return new yt(n, o, i, r);
+ i = th.fromOffsetPath(t, e.e.path),
+ a = e.e.offset;
+ return new tb(n, o, i, a)
},
- createFromParaBookmark: function (t, e) {
+ createFromParaBookmark: function(t, e) {
var n = t.s.offset,
o = t.e.offset,
- i = pt.fromOffsetPath(C.head(e), t.s.path),
- r = pt.fromOffsetPath(C.last(e), t.e.path);
- return new yt(i, n, r, o);
- },
+ i = th.fromOffsetPath(C.head(e), t.s.path),
+ a = th.fromOffsetPath(C.last(e), t.e.path);
+ return new tb(i, n, a, o)
+ }
},
- Ct = {
+ ty = {
BACKSPACE: 8,
TAB: 9,
ENTER: 13,
@@ -1564,514 +1554,483 @@
HOME: 36,
END: 35,
PAGEUP: 33,
- PAGEDOWN: 34,
+ PAGEDOWN: 34
},
- xt = {
- isEdit: function (t) {
- return C.contains([Ct.BACKSPACE, Ct.TAB, Ct.ENTER, Ct.SPACE, Ct.DELETE], t);
+ tC = {
+ isEdit: function(t) {
+ return C.contains([ty.BACKSPACE, ty.TAB, ty.ENTER, ty.SPACE, ty.DELETE], t)
},
- isMove: function (t) {
- return C.contains([Ct.LEFT, Ct.UP, Ct.RIGHT, Ct.DOWN], t);
+ isMove: function(t) {
+ return C.contains([ty.LEFT, ty.UP, ty.RIGHT, ty.DOWN], t)
},
- isNavigation: function (t) {
- return C.contains([Ct.HOME, Ct.END, Ct.PAGEUP, Ct.PAGEDOWN], t);
+ isNavigation: function(t) {
+ return C.contains([ty.HOME, ty.END, ty.PAGEUP, ty.PAGEDOWN], t)
},
- nameFromCode: g.invertObject(Ct),
- code: Ct,
+ nameFromCode: m.invertObject(ty),
+ code: ty
};
- function St(t, e) {
+
+ function tw(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
- (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o)
}
}
- var Tt = (function () {
- function t(e) {
- !(function (t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
- })(this, t),
- (this.stack = []),
- (this.stackOffset = -1),
- (this.context = e),
- (this.$editable = e.layoutInfo.editable),
- (this.editable = this.$editable[0]);
+ var tx = function() {
+ var t, e, n;
+
+ function o(t) {
+ ! function(t, e) {
+ if (!(t instanceof e)) throw TypeError("Cannot call a class as a function")
+ }(this, o), this.stack = [], this.stackOffset = -1, this.context = t, this.$editable = t.layoutInfo.editable, this.editable = this.$editable[0]
}
- var e, n, o;
- return (
- (e = t),
- (n = [
- {
- key: "makeSnapshot",
- value: function () {
- var t = wt.create(this.editable);
- return { contents: this.$editable.html(), bookmark: t && t.isOnEditable() ? t.bookmark(this.editable) : { s: { path: [], offset: 0 }, e: { path: [], offset: 0 } } };
- },
- },
- {
- key: "applySnapshot",
- value: function (t) {
- null !== t.contents && this.$editable.html(t.contents), null !== t.bookmark && wt.createFromBookmark(this.editable, t.bookmark).select();
- },
- },
- {
- key: "rewind",
- value: function () {
- this.$editable.html() !== this.stack[this.stackOffset].contents && this.recordUndo(), (this.stackOffset = 0), this.applySnapshot(this.stack[this.stackOffset]);
- },
- },
- {
- key: "commit",
- value: function () {
- (this.stack = []), (this.stackOffset = -1), this.recordUndo();
- },
- },
- {
- key: "reset",
- value: function () {
- (this.stack = []), (this.stackOffset = -1), this.$editable.html(""), this.recordUndo();
- },
- },
- {
- key: "undo",
- value: function () {
- this.$editable.html() !== this.stack[this.stackOffset].contents && this.recordUndo(), this.stackOffset > 0 && (this.stackOffset--, this.applySnapshot(this.stack[this.stackOffset]));
- },
- },
- {
- key: "redo",
- value: function () {
- this.stack.length - 1 > this.stackOffset && (this.stackOffset++, this.applySnapshot(this.stack[this.stackOffset]));
- },
- },
- {
- key: "recordUndo",
- value: function () {
- this.stackOffset++,
- this.stack.length > this.stackOffset && (this.stack = this.stack.slice(0, this.stackOffset)),
- this.stack.push(this.makeSnapshot()),
- this.stack.length > this.context.options.historyLimit && (this.stack.shift(), (this.stackOffset -= 1));
- },
- },
- ]) && St(e.prototype, n),
- o && St(e, o),
- t
- );
- })();
- function Et(t, e) {
+ return t = o, e = [{
+ key: "makeSnapshot",
+ value: function() {
+ var t = tk.create(this.editable);
+ return {
+ contents: this.$editable.html(),
+ bookmark: t && t.isOnEditable() ? t.bookmark(this.editable) : {
+ s: {
+ path: [],
+ offset: 0
+ },
+ e: {
+ path: [],
+ offset: 0
+ }
+ }
+ }
+ }
+ }, {
+ key: "applySnapshot",
+ value: function(t) {
+ null !== t.contents && this.$editable.html(t.contents), null !== t.bookmark && tk.createFromBookmark(this.editable, t.bookmark).select()
+ }
+ }, {
+ key: "rewind",
+ value: function() {
+ this.$editable.html() !== this.stack[this.stackOffset].contents && this.recordUndo(), this.stackOffset = 0, this.applySnapshot(this.stack[this.stackOffset])
+ }
+ }, {
+ key: "commit",
+ value: function() {
+ this.stack = [], this.stackOffset = -1, this.recordUndo()
+ }
+ }, {
+ key: "reset",
+ value: function() {
+ this.stack = [], this.stackOffset = -1, this.$editable.html(""), this.recordUndo()
+ }
+ }, {
+ key: "undo",
+ value: function() {
+ this.$editable.html() !== this.stack[this.stackOffset].contents && this.recordUndo(), this.stackOffset > 0 && (this.stackOffset--, this.applySnapshot(this.stack[this.stackOffset]))
+ }
+ }, {
+ key: "redo",
+ value: function() {
+ this.stack.length - 1 > this.stackOffset && (this.stackOffset++, this.applySnapshot(this.stack[this.stackOffset]))
+ }
+ }, {
+ key: "recordUndo",
+ value: function() {
+ this.stackOffset++, this.stack.length > this.stackOffset && (this.stack = this.stack.slice(0, this.stackOffset)), this.stack.push(this.makeSnapshot()), this.stack.length > this.context.options.historyLimit && (this.stack.shift(), this.stackOffset -= 1)
+ }
+ }, ], tw(t.prototype, e), n && tw(t, n), o
+ }();
+
+ function t$(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
- (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o)
}
}
- var $t = (function () {
- function t() {
- !(function (t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
- })(this, t);
+ var tS = function() {
+ var t, e, n;
+
+ function o() {
+ ! function(t, e) {
+ if (!(t instanceof e)) throw TypeError("Cannot call a class as a function")
+ }(this, o)
}
- var e, n, o;
- return (
- (e = t),
- (n = [
- {
- key: "jQueryCSS",
- value: function (t, e) {
- if (m.jqueryVersion < 1.9) {
- var n = {};
- return (
- i.a.each(e, function (e, o) {
- n[o] = t.css(o);
- }),
- n
- );
- }
- return t.css(e);
- },
- },
- {
- key: "fromNode",
- value: function (t) {
- var e = this.jQueryCSS(t, ["font-family", "font-size", "text-align", "list-style-type", "line-height"]) || {},
- n = t[0].style.fontSize || e["font-size"];
- return (e["font-size"] = parseInt(n, 10)), (e["font-size-unit"] = n.match(/[a-z%]+$/)), e;
- },
- },
- {
- key: "stylePara",
- value: function (t, e) {
- i.a.each(t.nodes(pt.isPara, { includeAncestor: !0 }), function (t, n) {
- i()(n).css(e);
- });
- },
- },
- {
- key: "styleNodes",
- value: function (t, e) {
- t = t.splitText();
- var n = (e && e.nodeName) || "SPAN",
- o = !(!e || !e.expandClosestSibling),
- r = !(!e || !e.onlyPartialContains);
- if (t.isCollapsed()) return [t.insertNode(pt.create(n))];
- var a = pt.makePredByNodeName(n),
- s = t.nodes(pt.isText, { fullyContains: !0 }).map(function (t) {
- return pt.singleChildAncestor(t, a) || pt.wrap(t, n);
- });
- if (o) {
- if (r) {
- var l = t.nodes();
- a = g.and(a, function (t) {
- return C.contains(l, t);
- });
- }
- return s.map(function (t) {
- var e = pt.withClosestSiblings(t, a),
- n = C.head(e),
- o = C.tail(e);
- return (
- i.a.each(o, function (t, e) {
- pt.appendChildNodes(n, e.childNodes), pt.remove(e);
- }),
- C.head(e)
- );
- });
- }
- return s;
- },
- },
- {
- key: "current",
- value: function (t) {
- var e = i()(pt.isElement(t.sc) ? t.sc : t.sc.parentNode),
- n = this.fromNode(e);
- try {
- n = i.a.extend(n, {
- "font-bold": document.queryCommandState("bold") ? "bold" : "normal",
- "font-italic": document.queryCommandState("italic") ? "italic" : "normal",
- "font-underline": document.queryCommandState("underline") ? "underline" : "normal",
- "font-subscript": document.queryCommandState("subscript") ? "subscript" : "normal",
- "font-superscript": document.queryCommandState("superscript") ? "superscript" : "normal",
- "font-strikethrough": document.queryCommandState("strikethrough") ? "strikethrough" : "normal",
- "font-family": document.queryCommandValue("fontname") || n["font-family"],
- });
- } catch (t) {}
- if (t.isOnList()) {
- var o = ["circle", "disc", "disc-leading-zero", "square"].indexOf(n["list-style-type"]) > -1;
- n["list-style"] = o ? "unordered" : "ordered";
- } else n["list-style"] = "none";
- var r = pt.ancestor(t.sc, pt.isPara);
- if (r && r.style["line-height"]) n["line-height"] = r.style.lineHeight;
- else {
- var a = parseInt(n["line-height"], 10) / parseInt(n["font-size"], 10);
- n["line-height"] = a.toFixed(1);
- }
- return (n.anchor = t.isOnAnchor() && pt.ancestor(t.sc, pt.isAnchor)), (n.ancestors = pt.listAncestor(t.sc, pt.isEditable)), (n.range = t), n;
- },
- },
- ]) && Et(e.prototype, n),
- o && Et(e, o),
- t
- );
- })();
- function Nt(t, e) {
+ return t = o, e = [{
+ key: "jQueryCSS",
+ value: function(t, e) {
+ if (p.jqueryVersion < 1.9) {
+ var n = {};
+ return i.a.each(e, function(e, o) {
+ n[o] = t.css(o)
+ }), n
+ }
+ return t.css(e)
+ }
+ }, {
+ key: "fromNode",
+ value: function(t) {
+ var e = this.jQueryCSS(t, ["font-family", "font-size", "text-align", "list-style-type", "line-height"]) || {},
+ n = t[0].style.fontSize || e["font-size"];
+ return e["font-size"] = parseInt(n, 10), e["font-size-unit"] = n.match(/[a-z%]+$/), e
+ }
+ }, {
+ key: "stylePara",
+ value: function(t, e) {
+ i.a.each(t.nodes(th.isPara, {
+ includeAncestor: !0
+ }), function(t, n) {
+ i()(n).css(e)
+ })
+ }
+ }, {
+ key: "styleNodes",
+ value: function(t, e) {
+ t = t.splitText();
+ var n = e && e.nodeName || "SPAN",
+ o = !(!e || !e.expandClosestSibling),
+ a = !(!e || !e.onlyPartialContains);
+ if (t.isCollapsed()) return [t.insertNode(th.create(n))];
+ var r = th.makePredByNodeName(n),
+ s = t.nodes(th.isText, {
+ fullyContains: !0
+ }).map(function(t) {
+ return th.singleChildAncestor(t, r) || th.wrap(t, n)
+ });
+ if (o) {
+ if (a) {
+ var l = t.nodes();
+ r = m.and(r, function(t) {
+ return C.contains(l, t)
+ })
+ }
+ return s.map(function(t) {
+ var e = th.withClosestSiblings(t, r),
+ n = C.head(e),
+ o = C.tail(e);
+ return i.a.each(o, function(t, e) {
+ th.appendChildNodes(n, e.childNodes), th.remove(e)
+ }), C.head(e)
+ })
+ }
+ return s
+ }
+ }, {
+ key: "current",
+ value: function(t) {
+ var e = i()(th.isElement(t.sc) ? t.sc : t.sc.parentNode),
+ n = this.fromNode(e);
+ try {
+ n = i.a.extend(n, {
+ "font-bold": document.queryCommandState("bold") ? "bold" : "normal",
+ "font-italic": document.queryCommandState("italic") ? "italic" : "normal",
+ "font-underline": document.queryCommandState("underline") ? "underline" : "normal",
+ "font-subscript": document.queryCommandState("subscript") ? "subscript" : "normal",
+ "font-superscript": document.queryCommandState("superscript") ? "superscript" : "normal",
+ "font-strikethrough": document.queryCommandState("strikethrough") ? "strikethrough" : "normal",
+ "font-family": document.queryCommandValue("fontname") || n["font-family"]
+ })
+ } catch (o) {}
+ if (t.isOnList()) {
+ var a = ["circle", "disc", "disc-leading-zero", "square"].indexOf(n["list-style-type"]) > -1;
+ n["list-style"] = a ? "unordered" : "ordered"
+ } else n["list-style"] = "none";
+ var r = th.ancestor(t.sc, th.isPara);
+ if (r && r.style["line-height"]) n["line-height"] = r.style.lineHeight;
+ else {
+ var s = parseInt(n["line-height"], 10) / parseInt(n["font-size"], 10);
+ n["line-height"] = s.toFixed(1)
+ }
+ return n.anchor = t.isOnAnchor() && th.ancestor(t.sc, th.isAnchor), n.ancestors = th.listAncestor(t.sc, th.isEditable), n.range = t, n
+ }
+ }, ], t$(t.prototype, e), n && t$(t, n), o
+ }();
+
+ function t_(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
- (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o)
}
}
- var It = (function () {
- function t() {
- !(function (t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
- })(this, t);
+ var t9 = function() {
+ var t, e, n;
+
+ function o() {
+ ! function(t, e) {
+ if (!(t instanceof e)) throw TypeError("Cannot call a class as a function")
+ }(this, o)
}
- var e, n, o;
- return (
- (e = t),
- (n = [
- {
- key: "insertOrderedList",
- value: function (t) {
- this.toggleList("OL", t);
- },
- },
- {
- key: "insertUnorderedList",
- value: function (t) {
- this.toggleList("UL", t);
- },
- },
- {
- key: "indent",
- value: function (t) {
- var e = this,
- n = wt.create(t).wrapBodyInlineWithPara(),
- o = n.nodes(pt.isPara, { includeAncestor: !0 }),
- r = C.clusterBy(o, g.peq2("parentNode"));
- i.a.each(r, function (t, n) {
- var o = C.head(n);
- if (pt.isLi(o)) {
- var r = e.findList(o.previousSibling);
- r
- ? n.map(function (t) {
- return r.appendChild(t);
- })
- : (e.wrapList(n, o.parentNode.nodeName),
- n
- .map(function (t) {
- return t.parentNode;
- })
- .map(function (t) {
- return e.appendToPrevious(t);
- }));
- } else
- i.a.each(n, function (t, e) {
- i()(e).css("marginLeft", function (t, e) {
- return (parseInt(e, 10) || 0) + 25;
- });
- });
- }),
- n.select();
- },
- },
- {
- key: "outdent",
- value: function (t) {
- var e = this,
- n = wt.create(t).wrapBodyInlineWithPara(),
- o = n.nodes(pt.isPara, { includeAncestor: !0 }),
- r = C.clusterBy(o, g.peq2("parentNode"));
- i.a.each(r, function (t, n) {
- var o = C.head(n);
- pt.isLi(o)
- ? e.releaseList([n])
- : i.a.each(n, function (t, e) {
- i()(e).css("marginLeft", function (t, e) {
- return (e = parseInt(e, 10) || 0) > 25 ? e - 25 : "";
- });
- });
- }),
- n.select();
- },
- },
- {
- key: "toggleList",
- value: function (t, e) {
- var n = this,
- o = wt.create(e).wrapBodyInlineWithPara(),
- r = o.nodes(pt.isPara, { includeAncestor: !0 }),
- a = o.paraBookmark(r),
- s = C.clusterBy(r, g.peq2("parentNode"));
- if (C.find(r, pt.isPurePara)) {
- var l = [];
- i.a.each(s, function (e, o) {
- l = l.concat(n.wrapList(o, t));
- }),
- (r = l);
- } else {
- var c = o.nodes(pt.isList, { includeAncestor: !0 }).filter(function (e) {
- return !i.a.nodeName(e, t);
+ return t = o, e = [{
+ key: "insertOrderedList",
+ value: function(t) {
+ this.toggleList("OL", t)
+ }
+ }, {
+ key: "insertUnorderedList",
+ value: function(t) {
+ this.toggleList("UL", t)
+ }
+ }, {
+ key: "indent",
+ value: function(t) {
+ var e = this,
+ n = tk.create(t).wrapBodyInlineWithPara(),
+ o = n.nodes(th.isPara, {
+ includeAncestor: !0
+ }),
+ a = C.clusterBy(o, m.peq2("parentNode"));
+ i.a.each(a, function(t, n) {
+ var o = C.head(n);
+ if (th.isLi(o)) {
+ var a = e.findList(o.previousSibling);
+ a ? n.map(function(t) {
+ return a.appendChild(t)
+ }) : (e.wrapList(n, o.parentNode.nodeName), n.map(function(t) {
+ return t.parentNode
+ }).map(function(t) {
+ return e.appendToPrevious(t)
+ }))
+ } else i.a.each(n, function(t, e) {
+ i()(e).css("marginLeft", function(t, e) {
+ return (parseInt(e, 10) || 0) + 25
+ })
+ })
+ }), n.select()
+ }
+ }, {
+ key: "outdent",
+ value: function(t) {
+ var e = this,
+ n = tk.create(t).wrapBodyInlineWithPara(),
+ o = n.nodes(th.isPara, {
+ includeAncestor: !0
+ }),
+ a = C.clusterBy(o, m.peq2("parentNode"));
+ i.a.each(a, function(t, n) {
+ var o = C.head(n);
+ th.isLi(o) ? e.releaseList([n]) : i.a.each(n, function(t, e) {
+ i()(e).css("marginLeft", function(t, e) {
+ return (e = parseInt(e, 10) || 0) > 25 ? e - 25 : ""
+ })
+ })
+ }), n.select()
+ }
+ }, {
+ key: "toggleList",
+ value: function(t, e) {
+ var n = this,
+ o = tk.create(e).wrapBodyInlineWithPara(),
+ a = o.nodes(th.isPara, {
+ includeAncestor: !0
+ }),
+ r = o.paraBookmark(a),
+ s = C.clusterBy(a, m.peq2("parentNode"));
+ if (C.find(a, th.isPurePara)) {
+ var l = [];
+ i.a.each(s, function(e, o) {
+ l = l.concat(n.wrapList(o, t))
+ }), a = l
+ } else {
+ var c = o.nodes(th.isList, {
+ includeAncestor: !0
+ }).filter(function(e) {
+ return !i.a.nodeName(e, t)
+ });
+ c.length ? i.a.each(c, function(e, n) {
+ th.replace(n, t)
+ }) : a = this.releaseList(s, !0)
+ }
+ tk.createFromParaBookmark(r, a).select()
+ }
+ }, {
+ key: "wrapList",
+ value: function(t, e) {
+ var n = C.head(t),
+ o = C.last(t),
+ i = th.isList(n.previousSibling) && n.previousSibling,
+ a = th.isList(o.nextSibling) && o.nextSibling,
+ r = i || th.insertAfter(th.create(e || "UL"), o);
+ return t = t.map(function(t) {
+ return th.isPurePara(t) ? th.replace(t, "LI") : t
+ }), th.appendChildNodes(r, t), a && (th.appendChildNodes(r, C.from(a.childNodes)), th.remove(a)), t
+ }
+ }, {
+ key: "releaseList",
+ value: function(t, e) {
+ var n = this,
+ o = [];
+ return i.a.each(t, function(t, a) {
+ var r = C.head(a),
+ s = C.last(a),
+ l = e ? th.lastAncestor(r, th.isList) : r.parentNode,
+ c = l.parentNode;
+ if ("LI" === l.parentNode.nodeName) a.map(function(t) {
+ var e = n.findNextSiblings(t);
+ c.nextSibling ? c.parentNode.insertBefore(t, c.nextSibling) : c.parentNode.appendChild(t), e.length && (n.wrapList(e, l.nodeName), t.appendChild(e[0].parentNode))
+ }), 0 === l.children.length && c.removeChild(l), 0 === c.childNodes.length && c.parentNode.removeChild(c);
+ else {
+ var u = l.childNodes.length > 1 ? th.splitTree(l, {
+ node: s.parentNode,
+ offset: th.position(s) + 1
+ }, {
+ isSkipPaddingBlankHTML: !0
+ }) : null,
+ d = th.splitTree(l, {
+ node: r.parentNode,
+ offset: th.position(r)
+ }, {
+ isSkipPaddingBlankHTML: !0
});
- c.length
- ? i.a.each(c, function (e, n) {
- pt.replace(n, t);
- })
- : (r = this.releaseList(s, !0));
- }
- wt.createFromParaBookmark(a, r).select();
- },
- },
- {
- key: "wrapList",
- value: function (t, e) {
- var n = C.head(t),
- o = C.last(t),
- i = pt.isList(n.previousSibling) && n.previousSibling,
- r = pt.isList(o.nextSibling) && o.nextSibling,
- a = i || pt.insertAfter(pt.create(e || "UL"), o);
- return (
- (t = t.map(function (t) {
- return pt.isPurePara(t) ? pt.replace(t, "LI") : t;
- })),
- pt.appendChildNodes(a, t),
- r && (pt.appendChildNodes(a, C.from(r.childNodes)), pt.remove(r)),
- t
- );
- },
- },
- {
- key: "releaseList",
- value: function (t, e) {
- var n = this,
- o = [];
- return (
- i.a.each(t, function (t, r) {
- var a = C.head(r),
- s = C.last(r),
- l = e ? pt.lastAncestor(a, pt.isList) : a.parentNode,
- c = l.parentNode;
- if ("LI" === l.parentNode.nodeName)
- r.map(function (t) {
- var e = n.findNextSiblings(t);
- c.nextSibling ? c.parentNode.insertBefore(t, c.nextSibling) : c.parentNode.appendChild(t), e.length && (n.wrapList(e, l.nodeName), t.appendChild(e[0].parentNode));
- }),
- 0 === l.children.length && c.removeChild(l),
- 0 === c.childNodes.length && c.parentNode.removeChild(c);
- else {
- var u = l.childNodes.length > 1 ? pt.splitTree(l, { node: s.parentNode, offset: pt.position(s) + 1 }, { isSkipPaddingBlankHTML: !0 }) : null,
- d = pt.splitTree(l, { node: a.parentNode, offset: pt.position(a) }, { isSkipPaddingBlankHTML: !0 });
- (r = e ? pt.listDescendant(d, pt.isLi) : C.from(d.childNodes).filter(pt.isLi)),
- (!e && pt.isList(l.parentNode)) ||
- (r = r.map(function (t) {
- return pt.replace(t, "P");
- })),
- i.a.each(C.from(r).reverse(), function (t, e) {
- pt.insertAfter(e, l);
- });
- var h = C.compact([l, d, u]);
- i.a.each(h, function (t, e) {
- var n = [e].concat(pt.listDescendant(e, pt.isList));
- i.a.each(n.reverse(), function (t, e) {
- pt.nodeLength(e) || pt.remove(e, !0);
- });
- });
- }
- o = o.concat(r);
- }),
- o
- );
- },
- },
- {
- key: "appendToPrevious",
- value: function (t) {
- return t.previousSibling ? pt.appendChildNodes(t.previousSibling, [t]) : this.wrapList([t], "LI");
- },
- },
- {
- key: "findList",
- value: function (t) {
- return t
- ? C.find(t.children, function (t) {
- return ["OL", "UL"].indexOf(t.nodeName) > -1;
- })
- : null;
- },
- },
- {
- key: "findNextSiblings",
- value: function (t) {
- for (var e = []; t.nextSibling; ) e.push(t.nextSibling), (t = t.nextSibling);
- return e;
- },
- },
- ]) && Nt(e.prototype, n),
- o && Nt(e, o),
- t
- );
- })();
- function Pt(t, e) {
+ a = e ? th.listDescendant(d, th.isLi) : C.from(d.childNodes).filter(th.isLi), !e && th.isList(l.parentNode) || (a = a.map(function(t) {
+ return th.replace(t, "P")
+ })), i.a.each(C.from(a).reverse(), function(t, e) {
+ th.insertAfter(e, l)
+ });
+ var h = C.compact([l, d, u]);
+ i.a.each(h, function(t, e) {
+ var n = [e].concat(th.listDescendant(e, th.isList));
+ i.a.each(n.reverse(), function(t, e) {
+ th.nodeLength(e) || th.remove(e, !0)
+ })
+ })
+ }
+ o = o.concat(a)
+ }), o
+ }
+ }, {
+ key: "appendToPrevious",
+ value: function(t) {
+ return t.previousSibling ? th.appendChildNodes(t.previousSibling, [t]) : this.wrapList([t], "LI")
+ }
+ }, {
+ key: "findList",
+ value: function(t) {
+ return t ? C.find(t.children, function(t) {
+ return ["OL", "UL"].indexOf(t.nodeName) > -1
+ }) : null
+ }
+ }, {
+ key: "findNextSiblings",
+ value: function(t) {
+ for (var e = []; t.nextSibling;) e.push(t.nextSibling), t = t.nextSibling;
+ return e
+ }
+ }, ], t_(t.prototype, e), n && t_(t, n), o
+ }();
+
+ function tN(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
- (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o)
}
}
- var Rt = (function () {
- function t(e) {
- !(function (t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
- })(this, t),
- (this.bullet = new It()),
- (this.options = e.options);
+ var tT = function() {
+ var t, e, n;
+
+ function o(t) {
+ ! function(t, e) {
+ if (!(t instanceof e)) throw TypeError("Cannot call a class as a function")
+ }(this, o), this.bullet = new t9, this.options = t.options
}
- var e, n, o;
- return (
- (e = t),
- (n = [
- {
- key: "insertTab",
- value: function (t, e) {
- var n = pt.createText(new Array(e + 1).join(pt.NBSP_CHAR));
- (t = t.deleteContents()).insertNode(n, !0), (t = wt.create(n, e)).select();
- },
- },
- {
- key: "insertParagraph",
- value: function (t, e) {
- e = (e = (e = e || wt.create(t)).deleteContents()).wrapBodyInlineWithPara();
- var n,
- o = pt.ancestor(e.sc, pt.isPara);
- if (o) {
- if (pt.isLi(o) && (pt.isEmpty(o) || pt.deepestChildIsEmpty(o))) return void this.bullet.toggleList(o.parentNode.nodeName);
- var r = null;
- if ((1 === this.options.blockquoteBreakingLevel ? (r = pt.ancestor(o, pt.isBlockquote)) : 2 === this.options.blockquoteBreakingLevel && (r = pt.lastAncestor(o, pt.isBlockquote)), r)) {
- (n = i()(pt.emptyPara)[0]), pt.isRightEdgePoint(e.getStartPoint()) && pt.isBR(e.sc.nextSibling) && i()(e.sc.nextSibling).remove();
- var a = pt.splitTree(r, e.getStartPoint(), { isDiscardEmptySplits: !0 });
- a ? a.parentNode.insertBefore(n, a) : pt.insertAfter(n, r);
- } else {
- n = pt.splitTree(o, e.getStartPoint());
- var s = pt.listDescendant(o, pt.isEmptyAnchor);
- (s = s.concat(pt.listDescendant(n, pt.isEmptyAnchor))),
- i.a.each(s, function (t, e) {
- pt.remove(e);
- }),
- (pt.isHeading(n) || pt.isPre(n) || pt.isCustomStyleTag(n)) && pt.isEmpty(n) && (n = pt.replace(n, "p"));
- }
- } else {
- var l = e.sc.childNodes[e.so];
- (n = i()(pt.emptyPara)[0]), l ? e.sc.insertBefore(n, l) : e.sc.appendChild(n);
- }
- wt.create(n, 0).normalize().select().scrollIntoView(t);
- },
- },
- ]) && Pt(e.prototype, n),
- o && Pt(e, o),
- t
- );
- })();
- function Lt(t, e) {
+ return t = o, e = [{
+ key: "insertTab",
+ value: function(t, e) {
+ var n = th.createText(Array(e + 1).join(th.NBSP_CHAR));
+ (t = t.deleteContents()).insertNode(n, !0), (t = tk.create(n, e)).select()
+ }
+ }, {
+ key: "insertParagraph",
+ value: function(t, e) {
+ e = (e = (e = e || tk.create(t)).deleteContents()).wrapBodyInlineWithPara();
+ var n, o = th.ancestor(e.sc, th.isPara);
+ if (o) {
+ if (th.isLi(o) && (th.isEmpty(o) || th.deepestChildIsEmpty(o))) return void this.bullet.toggleList(o.parentNode.nodeName);
+ var a = null;
+ if (1 === this.options.blockquoteBreakingLevel ? a = th.ancestor(o, th.isBlockquote) : 2 === this.options.blockquoteBreakingLevel && (a = th.lastAncestor(o, th.isBlockquote)), a) {
+ n = i()(th.emptyPara)[0], th.isRightEdgePoint(e.getStartPoint()) && th.isBR(e.sc.nextSibling) && i()(e.sc.nextSibling).remove();
+ var r = th.splitTree(a, e.getStartPoint(), {
+ isDiscardEmptySplits: !0
+ });
+ r ? r.parentNode.insertBefore(n, r) : th.insertAfter(n, a)
+ } else {
+ n = th.splitTree(o, e.getStartPoint());
+ var s = th.listDescendant(o, th.isEmptyAnchor);
+ s = s.concat(th.listDescendant(n, th.isEmptyAnchor)), i.a.each(s, function(t, e) {
+ th.remove(e)
+ }), (th.isHeading(n) || th.isPre(n) || th.isCustomStyleTag(n)) && th.isEmpty(n) && (n = th.replace(n, "p"))
+ }
+ } else {
+ var l = e.sc.childNodes[e.so];
+ n = i()(th.emptyPara)[0], l ? e.sc.insertBefore(n, l) : e.sc.appendChild(n)
+ }
+ tk.create(n, 0).normalize().select().scrollIntoView(t)
+ }
+ }, ], tN(t.prototype, e), n && tN(t, n), o
+ }();
+
+ function tI(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
- (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o)
}
}
- var At = function t(e, n, o, i) {
- var r = { colPos: 0, rowPos: 0 },
- a = [],
+ var tE = function t(e, n, o, i) {
+ var a = {
+ colPos: 0,
+ rowPos: 0
+ },
+ r = [],
s = [];
- function l(t, e, n, o, i, r, s) {
- var l = { baseRow: n, baseCell: o, isRowSpan: i, isColSpan: r, isVirtual: s };
- a[t] || (a[t] = []), (a[t][e] = l);
+
+ function l(t, e, n, o, i, a, s) {
+ r[t] || (r[t] = []), r[t][e] = {
+ baseRow: n,
+ baseCell: o,
+ isRowSpan: i,
+ isColSpan: a,
+ isVirtual: s
+ }
}
+
function c(t, e, n, o) {
- return { baseCell: t.baseCell, action: e, virtualTable: { rowIndex: n, cellIndex: o } };
+ return {
+ baseCell: t.baseCell,
+ action: e,
+ virtualTable: {
+ rowIndex: n,
+ cellIndex: o
+ }
+ }
}
+
function u(t, e) {
- if (!a[t]) return e;
- if (!a[t][e]) return e;
- for (var n = e; a[t][n]; ) if ((n++, !a[t][n])) return n;
+ if (!r[t] || !r[t][e]) return e;
+ for (var n = e; r[t][n];)
+ if (n++, !r[t][n]) return n
}
+
function d(t, e) {
var n = u(t.rowIndex, e.cellIndex),
o = e.colSpan > 1,
i = e.rowSpan > 1,
- a = t.rowIndex === r.rowPos && e.cellIndex === r.colPos;
+ r = t.rowIndex === a.rowPos && e.cellIndex === a.colPos;
l(t.rowIndex, n, t, e, i, o, !1);
var s = e.attributes.rowSpan ? parseInt(e.attributes.rowSpan.value, 10) : 0;
if (s > 1)
for (var c = 1; c < s; c++) {
var d = t.rowIndex + c;
- h(d, n, e, a), l(d, n, t, e, !0, o, !0);
+ h(d, n, e, r), l(d, n, t, e, !0, o, !0)
}
var f = e.attributes.colSpan ? parseInt(e.attributes.colSpan.value, 10) : 0;
if (f > 1)
for (var p = 1; p < f; p++) {
- var m = u(t.rowIndex, n + p);
- h(t.rowIndex, m, e, a), l(t.rowIndex, m, t, e, i, !0, !0);
+ var v = u(t.rowIndex, n + p);
+ h(t.rowIndex, v, e, r), l(t.rowIndex, v, t, e, i, !0, !0)
}
}
+
function h(t, e, n, o) {
- t === r.rowPos && r.colPos >= n.cellIndex && n.cellIndex <= e && !o && r.colPos++;
+ t === a.rowPos && a.colPos >= n.cellIndex && n.cellIndex <= e && !o && a.colPos++
}
+
function f(e) {
switch (n) {
case t.where.Column:
@@ -2079,10 +2038,11 @@
break;
case t.where.Row:
if (!e.isVirtual && e.isRowSpan) return t.resultAction.AddCell;
- if (e.isRowSpan) return t.resultAction.SubtractSpanCount;
+ if (e.isRowSpan) return t.resultAction.SubtractSpanCount
}
- return t.resultAction.RemoveCell;
+ return t.resultAction.RemoveCell
}
+
function p(e) {
switch (n) {
case t.where.Column:
@@ -2091,3510 +2051,2940 @@
break;
case t.where.Row:
if (e.isRowSpan) return t.resultAction.SumSpanCount;
- if (e.isColSpan && e.isVirtual) return t.resultAction.Ignore;
+ if (e.isColSpan && e.isVirtual) return t.resultAction.Ignore
}
- return t.resultAction.AddCell;
+ return t.resultAction.AddCell
}
- (this.getActionList = function () {
- for (var e = n === t.where.Row ? r.rowPos : -1, i = n === t.where.Column ? r.colPos : -1, l = 0, u = !0; u; ) {
- var d = e >= 0 ? e : l,
- h = i >= 0 ? i : l,
- m = a[d];
- if (!m) return (u = !1), s;
- var v = m[h];
- if (!v) return (u = !1), s;
- var g = t.resultAction.Ignore;
- switch (o) {
- case t.requestAction.Add:
- g = p(v);
- break;
- case t.requestAction.Delete:
- g = f(v);
+ this.getActionList = function() {
+ for (var e = n === t.where.Row ? a.rowPos : -1, i = n === t.where.Column ? a.colPos : -1, l = 0, u = !0; u;) {
+ var d = e >= 0 ? e : l,
+ h = i >= 0 ? i : l,
+ v = r[d];
+ if (!v) return u = !1, s;
+ var m = v[h];
+ if (!m) return u = !1, s;
+ var g = t.resultAction.Ignore;
+ switch (o) {
+ case t.requestAction.Add:
+ g = p(m);
+ break;
+ case t.requestAction.Delete:
+ g = f(m)
+ }
+ s.push(c(m, g, d, h)), l++
}
- s.push(c(v, g, d, h)), l++;
- }
- return s;
- }),
- e &&
- e.tagName &&
- ("td" === e.tagName.toLowerCase() || "th" === e.tagName.toLowerCase()) &&
- ((r.colPos = e.cellIndex), e.parentElement && e.parentElement.tagName && "tr" === e.parentElement.tagName.toLowerCase() && (r.rowPos = e.parentElement.rowIndex)),
- (function () {
- for (var t = i.rows, e = 0; e < t.length; e++) for (var n = t[e].cells, o = 0; o < n.length; o++) d(t[e], n[o]);
- })();
+ return s
+ }, e && e.tagName && ("td" === e.tagName.toLowerCase() || "th" === e.tagName.toLowerCase()) && (a.colPos = e.cellIndex, e.parentElement && e.parentElement.tagName && "tr" === e.parentElement.tagName.toLowerCase() && (a.rowPos = e.parentElement.rowIndex)),
+ function() {
+ for (var t = i.rows, e = 0; e < t.length; e++)
+ for (var n = t[e].cells, o = 0; o < n.length; o++) d(t[e], n[o])
+ }()
+ };
+ tE.where = {
+ Row: 0,
+ Column: 1
+ }, tE.requestAction = {
+ Add: 0,
+ Delete: 1
+ }, tE.resultAction = {
+ Ignore: 0,
+ SubtractSpanCount: 1,
+ RemoveCell: 2,
+ AddCell: 3,
+ SumSpanCount: 4
};
- (At.where = { Row: 0, Column: 1 }), (At.requestAction = { Add: 0, Delete: 1 }), (At.resultAction = { Ignore: 0, SubtractSpanCount: 1, RemoveCell: 2, AddCell: 3, SumSpanCount: 4 });
- var Ft = (function () {
- function t() {
- !(function (t, e) {
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
- })(this, t);
+ var tP = function() {
+ var t, e, n;
+
+ function o() {
+ ! function(t, e) {
+ if (!(t instanceof e)) throw TypeError("Cannot call a class as a function")
+ }(this, o)
}
- var e, n, o;
- return (
- (e = t),
- (n = [
- {
- key: "tab",
- value: function (t, e) {
- var n = pt.ancestor(t.commonAncestor(), pt.isCell),
- o = pt.ancestor(n, pt.isTable),
- i = pt.listDescendant(o, pt.isCell),
- r = C[e ? "prev" : "next"](i, n);
- r && wt.create(r, 0).select();
- },
- },
- {
- key: "addRow",
- value: function (t, e) {
- for (
- var n = pt.ancestor(t.commonAncestor(), pt.isCell),
- o = i()(n).closest("tr"),
- r = this.recoverAttributes(o),
- a = i()("
"),
- s = new At(n, At.where.Row, At.requestAction.Add, i()(o).closest("table")[0]).getActionList(),
- l = 0;
- l < s.length;
- l++
- ) {
- var c = s[l],
- u = this.recoverAttributes(c.baseCell);
- switch (c.action) {
- case At.resultAction.AddCell:
- a.append("
" + pt.blank + "
");
- break;
- case At.resultAction.SumSpanCount:
- if ("top" === e && (c.baseCell.parent ? c.baseCell.closest("tr").rowIndex : 0) <= o[0].rowIndex) {
- var d = i()("")
- .append(i()("
" + pt.blank + "
").removeAttr("rowspan"))
- .html();
- a.append(d);
- break;
- }
- var h = parseInt(c.baseCell.rowSpan, 10);
- h++, c.baseCell.setAttribute("rowSpan", h);
- }
- }
- if ("top" === e) o.before(a);
- else {
- if (n.rowSpan > 1) {
- var f = o[0].rowIndex + (n.rowSpan - 2);
- return void i()(i()(o).parent().find("tr")[f]).after(i()(a));
- }
- o.after(a);
- }
- },
- },
- {
- key: "addCol",
- value: function (t, e) {
- var n = pt.ancestor(t.commonAncestor(), pt.isCell),
- o = i()(n).closest("tr");
- i()(o).siblings().push(o);
- for (var r = new At(n, At.where.Column, At.requestAction.Add, i()(o).closest("table")[0]).getActionList(), a = 0; a < r.length; a++) {
- var s = r[a],
- l = this.recoverAttributes(s.baseCell);
- switch (s.action) {
- case At.resultAction.AddCell:
- "right" === e ? i()(s.baseCell).after("
" + pt.blank + "
") : i()(s.baseCell).before("
" + pt.blank + "
");
- break;
- case At.resultAction.SumSpanCount:
- if ("right" === e) {
- var c = parseInt(s.baseCell.colSpan, 10);
- c++, s.baseCell.setAttribute("colSpan", c);
- } else i()(s.baseCell).before("
" + pt.blank + "
");
+ return t = o, e = [{
+ key: "tab",
+ value: function(t, e) {
+ var n = th.ancestor(t.commonAncestor(), th.isCell),
+ o = th.ancestor(n, th.isTable),
+ i = th.listDescendant(o, th.isCell),
+ a = C[e ? "prev" : "next"](i, n);
+ a && tk.create(a, 0).select()
+ }
+ }, {
+ key: "addRow",
+ value: function(t, e) {
+ for (var n = th.ancestor(t.commonAncestor(), th.isCell), o = i()(n).closest("tr"), a = this.recoverAttributes(o), r = i()("
"), s = new tE(n, tE.where.Row, tE.requestAction.Add, i()(o).closest("table")[0]).getActionList(), l = 0; l < s.length; l++) {
+ var c = s[l],
+ u = this.recoverAttributes(c.baseCell);
+ switch (c.action) {
+ case tE.resultAction.AddCell:
+ r.append("
" + th.blank + "
");
+ break;
+ case tE.resultAction.SumSpanCount:
+ if ("top" === e && (c.baseCell.parent ? c.baseCell.closest("tr").rowIndex : 0) <= o[0].rowIndex) {
+ var d = i()("").append(i()("
" + th.blank + "
").removeAttr("rowspan")).html();
+ r.append(d);
+ break
}
+ var h = parseInt(c.baseCell.rowSpan, 10);
+ h++, c.baseCell.setAttribute("rowSpan", h)
+ }
+ }
+ if ("top" === e) o.before(r);
+ else {
+ if (n.rowSpan > 1) {
+ var f = o[0].rowIndex + (n.rowSpan - 2);
+ return void i()(i()(o).parent().find("tr")[f]).after(i()(r))
+ }
+ o.after(r)
+ }
+ }
+ }, {
+ key: "addCol",
+ value: function(t, e) {
+ var n = th.ancestor(t.commonAncestor(), th.isCell),
+ o = i()(n).closest("tr");
+ i()(o).siblings().push(o);
+ for (var a = new tE(n, tE.where.Column, tE.requestAction.Add, i()(o).closest("table")[0]).getActionList(), r = 0; r < a.length; r++) {
+ var s = a[r],
+ l = this.recoverAttributes(s.baseCell);
+ switch (s.action) {
+ case tE.resultAction.AddCell:
+ "right" === e ? i()(s.baseCell).after("
" + th.blank + "
") : i()(s.baseCell).before("
" + th.blank + "
");
+ break;
+ case tE.resultAction.SumSpanCount:
+ if ("right" === e) {
+ var c = parseInt(s.baseCell.colSpan, 10);
+ c++, s.baseCell.setAttribute("colSpan", c)
+ } else i()(s.baseCell).before("
" + th.blank + "
")
+ }
+ }
+ }
+ }, {
+ key: "recoverAttributes",
+ value: function(t) {
+ var e = "";
+ if (!t) return e;
+ for (var n = t.attributes || [], o = 0; o < n.length; o++) "id" !== n[o].name.toLowerCase() && n[o].specified && (e += " " + n[o].name + "='" + n[o].value + "'");
+ return e
+ }
+ }, {
+ key: "deleteRow",
+ value: function(t) {
+ for (var e = th.ancestor(t.commonAncestor(), th.isCell), n = i()(e).closest("tr"), o = n.children("td, th").index(i()(e)), a = n[0].rowIndex, r = new tE(e, tE.where.Row, tE.requestAction.Delete, i()(n).closest("table")[0]).getActionList(), s = 0; s < r.length; s++)
+ if (r[s]) {
+ var l = r[s].baseCell,
+ c = r[s].virtualTable,
+ u = l.rowSpan && l.rowSpan > 1,
+ d = u ? parseInt(l.rowSpan, 10) : 0;
+ switch (r[s].action) {
+ case tE.resultAction.Ignore:
+ continue;
+ case tE.resultAction.AddCell:
+ var h = n.next("tr")[0];
+ if (!h) continue;
+ var f = n[0].cells[o];
+ u && (d > 2 ? (d--, h.insertBefore(f, h.cells[o]), h.cells[o].setAttribute("rowSpan", d), h.cells[o].innerHTML = "") : 2 === d && (h.insertBefore(f, h.cells[o]), h.cells[o].removeAttribute("rowSpan"), h.cells[o].innerHTML = ""));
+ continue;
+ case tE.resultAction.SubtractSpanCount:
+ u && (d > 2 ? (d--, l.setAttribute("rowSpan", d), c.rowIndex !== a && l.cellIndex === o && (l.innerHTML = "")) : 2 === d && (l.removeAttribute("rowSpan"), c.rowIndex !== a && l.cellIndex === o && (l.innerHTML = "")));
+ continue;
+ case tE.resultAction.RemoveCell:
+ continue
}
- },
- },
- {
- key: "recoverAttributes",
- value: function (t) {
- var e = "";
- if (!t) return e;
- for (var n = t.attributes || [], o = 0; o < n.length; o++) "id" !== n[o].name.toLowerCase() && n[o].specified && (e += " " + n[o].name + "='" + n[o].value + "'");
- return e;
- },
- },
- {
- key: "deleteRow",
- value: function (t) {
- for (
- var e = pt.ancestor(t.commonAncestor(), pt.isCell),
- n = i()(e).closest("tr"),
- o = n.children("td, th").index(i()(e)),
- r = n[0].rowIndex,
- a = new At(e, At.where.Row, At.requestAction.Delete, i()(n).closest("table")[0]).getActionList(),
- s = 0;
- s < a.length;
- s++
- )
- if (a[s]) {
- var l = a[s].baseCell,
- c = a[s].virtualTable,
- u = l.rowSpan && l.rowSpan > 1,
- d = u ? parseInt(l.rowSpan, 10) : 0;
- switch (a[s].action) {
- case At.resultAction.Ignore:
- continue;
- case At.resultAction.AddCell:
- var h = n.next("tr")[0];
- if (!h) continue;
- var f = n[0].cells[o];
- u &&
- (d > 2
- ? (d--, h.insertBefore(f, h.cells[o]), h.cells[o].setAttribute("rowSpan", d), (h.cells[o].innerHTML = ""))
- : 2 === d && (h.insertBefore(f, h.cells[o]), h.cells[o].removeAttribute("rowSpan"), (h.cells[o].innerHTML = "")));
- continue;
- case At.resultAction.SubtractSpanCount:
- u &&
- (d > 2 ? (d--, l.setAttribute("rowSpan", d), c.rowIndex !== r && l.cellIndex === o && (l.innerHTML = "")) : 2 === d && (l.removeAttribute("rowSpan"), c.rowIndex !== r && l.cellIndex === o && (l.innerHTML = "")));
- continue;
- case At.resultAction.RemoveCell:
- continue;
- }
+ } n.remove()
+ }
+ }, {
+ key: "deleteCol",
+ value: function(t) {
+ for (var e = th.ancestor(t.commonAncestor(), th.isCell), n = i()(e).closest("tr"), o = n.children("td, th").index(i()(e)), a = new tE(e, tE.where.Column, tE.requestAction.Delete, i()(n).closest("table")[0]).getActionList(), r = 0; r < a.length; r++)
+ if (a[r]) switch (a[r].action) {
+ case tE.resultAction.Ignore:
+ continue;
+ case tE.resultAction.SubtractSpanCount:
+ var s = a[r].baseCell;
+ if (s.colSpan && s.colSpan > 1) {
+ var l = s.colSpan ? parseInt(s.colSpan, 10) : 0;
+ l > 2 ? (l--, s.setAttribute("colSpan", l), s.cellIndex === o && (s.innerHTML = "")) : 2 === l && (s.removeAttribute("colSpan"), s.cellIndex === o && (s.innerHTML = ""))
}
- n.remove();
- },
- },
- {
- key: "deleteCol",
- value: function (t) {
- for (
- var e = pt.ancestor(t.commonAncestor(), pt.isCell),
- n = i()(e).closest("tr"),
- o = n.children("td, th").index(i()(e)),
- r = new At(e, At.where.Column, At.requestAction.Delete, i()(n).closest("table")[0]).getActionList(),
- a = 0;
- a < r.length;
- a++
- )
- if (r[a])
- switch (r[a].action) {
- case At.resultAction.Ignore:
- continue;
- case At.resultAction.SubtractSpanCount:
- var s = r[a].baseCell;
- if (s.colSpan && s.colSpan > 1) {
- var l = s.colSpan ? parseInt(s.colSpan, 10) : 0;
- l > 2 ? (l--, s.setAttribute("colSpan", l), s.cellIndex === o && (s.innerHTML = "")) : 2 === l && (s.removeAttribute("colSpan"), s.cellIndex === o && (s.innerHTML = ""));
- }
- continue;
- case At.resultAction.RemoveCell:
- pt.remove(r[a].baseCell, !0);
- continue;
- }
- },
- },
- {
- key: "createTable",
- value: function (t, e, n) {
- for (var o, r = [], a = 0; a < t; a++) r.push("
" + pt.blank + "
");
- o = r.join("");
- for (var s, l = [], c = 0; c < e; c++) l.push("
" + o + "
");
- s = l.join("");
- var u = i()("
" + s + "
");
- return n && n.tableClassName && u.addClass(n.tableClassName), u[0];
- },
- },
- {
- key: "deleteTable",
- value: function (t) {
- var e = pt.ancestor(t.commonAncestor(), pt.isCell);
- i()(e).closest("table").remove();
- },
- },
- ]) && Lt(e.prototype, n),
- o && Lt(e, o),
- t
- );
- })();
- function Dt(t, e) {
+ continue;
+ case tE.resultAction.RemoveCell:
+ th.remove(a[r].baseCell, !0);
+ continue
+ }
+ }
+ }, {
+ key: "createTable",
+ value: function(t, e, n) {
+ for (var o, a = [], r = 0; r < t; r++) a.push("
" + th.blank + "
");
+ o = a.join("");
+ for (var s, l = [], c = 0; c < e; c++) l.push("