Untitled diff

Created Diff never expires
+ /* SCEditor v1.4.7 | (C) 2015, Sam Clarke | sceditor.com/license */
/* SCEditor v1.5.2 | (C) 2016, Sam Clarke | sceditor.com/license */ ! function(a) {
+! function(a) {
function b(d) {
function b(d) {
if (c[d]) return c[d].exports;
if (c[d]) return c[d].exports;
var e = c[d] = {
var e = c[d] = {
exports: {},
exports: {},
id: d,
id: d,
loaded: !1
loaded: !1
};
};
return a[d].call(e.exports, e, e.exports, b), e.loaded = !0, e.exports
return a[d].call(e.exports, e, e.exports, b), e.loaded = !0, e.exports
}
}
var c = {};
var c = {};
return b.m = a, b.c = c, b.p = "", b(0)
return b.m = a, b.c = c, b.p = "", b(0)
}([function(a, b, c) {
}([function(a, b, c) {
var d;
var d;
d = function() {
d = function(a) {
"use strict";
"use strict";
var a = c(1),
var b = c(1),
b = c(2),
d = c(2),
d = c(3),
e = c(3),
e = c(4),
f = c(6),
f = c(5);
g = c(7);
a.sceditor = b, b.commands = c(6), b.defaultOptions = c(7), b.RangeHelper = c(8), b.dom = c(9), b.ie = e.ie, b.ios = e.ios, b.isWysiwygSupported = e.isWysiwygSupported, b.regexEscape = f.regex, b.escapeEntities = f.entities, b.escapeUriScheme = f.uriScheme, b.PluginManager = d, b.plugins = d.plugins, a.fn.sceditor = function(c) {
b.sceditor = d, d.commands = c(9), d.defaultOptions = c(10), d.RangeHelper = c(4), d.dom = c(5), d.ie = f.ie, d.ios = f.ios, d.isWysiwygSupported = f.isWysiwygSupported, d.regexEscape = g.regex, d.escapeEntities = g.entities, d.escapeUriScheme = g.uriScheme, d.PluginManager = e, d.plugins = e.plugins, b.fn.sceditor = function(a) {
var d, f, g = [];
var c, e, g = [];
return c = c || {}, c.runWithoutWysiwygSupport || e.isWysiwygSupported ? (this.each(function() {
if (a = a || {}, a.runWithoutWysiwygSupport || f.isWysiwygSupported) return this.each(function() {
d = this.jquery ? this : a(this), f = d.data("sceditor"), d.parents(".sceditor-container").length > 0 || ("state" === c ? g.push(!!f) : "instance" === c ? g.push(f) : f || new b(this, c))
c = this.jquery ? this : b(this), e = c.data("sceditor"), c.parents(".sceditor-container").length > 0 || ("state" === a ? g.push(!!e) : "instance" === a ? g.push(e) : e || new d(this, a))
}), g.length ? 1 === g.length ? g[0] : a(g) : this) : void 0
}), g.length ? 1 === g.length ? g[0] : b(g) : this
}
}
}.call(b, c, b, a), !(void 0 !== d && (a.exports = d))
}.call(b, c, b, a), !(void 0 !== d && (a.exports = d))
}, function(a) {
}, function(a, b) {
a.exports = jQuery
a.exports = jQuery
}, function(a, b, c) {
}, function(a, b, c) {
var d;
var d;
d = function() {
d = function(a) {
"use strict";
"use strict";
var a = c(1),
var b = c(1),
b = c(3),
d = c(3),
d = c(8),
e = c(4),
e = c(9),
f = c(5),
f = c(5),
g = c(4),
g = c(7),
h = c(10),
h = c(6),
i = window,
i = c(8),
j = document,
j = window,
k = a(i),
k = document,
l = a(j),
l = b(j),
m = g.ie,
m = b(k),
n = m && 11 > m,
n = h.ie,
o = function(c, p) {
o = n && n < 11,
var q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, $, _, ab, bb, cb, db, eb, fb, gb, hb, ib, jb, kb, lb, mb, nb, ob, pb, qb, rb, sb, tb, ub = this,
p = function(a, c) {
vb = c.get ? c.get(0) : c,
var q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, $, _, aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa, qa, ra, sa, ta, ua = this,
wb = a(vb),
va = a.get ? a.get(0) : a,
xb = [],
wa = b(va),
yb = [],
xa = [],
zb = [],
ya = [],
Ab = {},
za = [],
Bb = [],
Aa = {},
Cb = {};
Ba = [],
ub.commands = a.extend(!0, {}, p.commands || o.commands), ub.opts = p = a.extend({}, o.defaultOptions, p), K = function() {
Ca = {};
wb.data("sceditor", ub), a.each(p, function(b, c) {
ua.commands = b.extend(!0, {}, c.commands || p.commands), ua.opts = c = b.extend({}, p.defaultOptions, c), K = function() {
a.isPlainObject(c) && (p[b] = a.extend(!0, {}, c))
wa.data("sceditor", ua), b.each(c, function(a, d) {
}), p.locale && "en" !== p.locale && Q(), q = a('<div class="sceditor-container" />').insertAfter(wb).css("z-index", p.zIndex), m && q.addClass("ie ie" + m), H = !!wb.attr("required"), wb.removeAttr("required"), P(), W(), R(), O(), U(), S(), T(), g.isWysiwygSupported || ub.toggleSourceMode(), hb();
b.isPlainObject(d) && (c[a] = b.extend(!0, {}, d))
var b = function() {
}), c.locale && "en" !== c.locale && Q(), q = b('<div class="sceditor-container" />').insertAfter(wa).css("z-index", c.zIndex), n && q.addClass("ie ie" + n), H = !!wa.attr("required"), wa.removeAttr("required"), P(), W(), R(), O(!!c.startInSourceMode), U(), S(), T(), h.isWysiwygSupported || ua.toggleSourceMode(), ha();
k.unbind("load", b), p.autofocus && mb(), p.autoExpand && ub.expandToContent(), fb(), C.call("ready")
var a = function() {
l.off("load", a), c.autofocus && ma(), c.autoExpand && ua.expandToContent(), fa(), C.call("ready")
};
};
k.load(b), j.readyState && "complete" === j.readyState && b()
l.on("load", a), k.readyState && "complete" === k.readyState && a()
}, P = function() {
}, P = function() {
var c = p.plugins;
var a = c.plugins;
c = c ? c.toString().split(",") : [], C = new b(ub), a.each(c, function(b, c) {
a = a ? a.toString().split(",") : [], C = new d(ua), b.each(a, function(a, c) {
C.register(a.trim(c))
C.register(b.trim(c))
})
})
}, Q = function() {
}, Q = function() {
var a;
var a;
A = o.locale[p.locale], A || (a = p.locale.split("-"), A = o.locale[a[0]]), A && A.dateFormat && (p.dateFormat = A.dateFormat)
A = p.locale[c.locale], A || (a = c.locale.split("-"), A = p.locale[a[0]]), A && A.dateFormat && (c.dateFormat = A.dateFormat)
}, O = function() {
}, O = function(a) {
var b, c;
var d, f;
w = a("<textarea></textarea>").hide(), s = a('<iframe frameborder="0" allowfullscreen="true"></iframe>'), p.spellcheck || w.attr("spellcheck", "false"), "https:" === i.location.protocol && s.attr("src", "javascript:false"), q.append(s).append(w), t = s[0], x = w[0], ub.dimensions(p.width || wb.width(), p.height || wb.height()), b = X(), b.open(), b.write(h("html", {
w = b("<textarea></textarea>"), s = b('<iframe frameborder="0" allowfullscreen="true"></iframe>'), a ? (q.addClass("sourceMode"), s.hide()) : (q.addClass("wysiwygMode"), w.hide()), c.spellcheck || w.attr("spellcheck", "false"), "https:" === j.location.protocol && s.attr("src", "javascript:false"), q.append(s).append(w), t = s[0], x = w[0], ua.dimensions(c.width || wa.width(), c.height || wa.height()), d = X(), d.open(), d.write(i("html", {
attrs: m ? ' class="ie ie"' + m : "",
attrs: n ? ' class="ie ie' + n + '"' : "",
spellcheck: p.spellcheck ? "" : 'spellcheck="false"',
spellcheck: c.spellcheck ? "" : 'spellcheck="false"',
charset: p.charset,
charset: c.charset,
style: p.style
style: c.style
})), b.close(), v = a(b), u = a(b.body), ub.readOnly(!!p.readOnly), (g.ios || m) && (u.height("100%"), m || u.bind("touchend", ub.focus)), c = wb.attr("tabindex"), w.attr("tabindex", c), s.attr("tabindex", c), B = new d(t.contentWindow), ub.val(wb.hide().val())
})), d.close(), v = b(d), u = b(d.body), ua.readOnly(!!c.readOnly), (h.ios || n) && (u.height("100%"), n || u.on("touchend", ua.focus)), f = wa.attr("tabindex"), w.attr("tabindex", f), s.attr("tabindex", f), B = new e(t.contentWindow), ua.val(wa.hide().val())
}, S = function() {
}, S = function() {
p.autoUpdate && (u.bind("blur", tb), w.bind("blur", tb)), null === p.rtl && (p.rtl = "rtl" === w.css("direction")), ub.rtl(!!p.rtl), p.autoExpand && v.bind("keyup", ub.expandToContent), p.resizeEnabled && V(), q.attr("id", p.id), ub.emoticons(p.emoticonsEnabled)
c.autoUpdate && (u.on("blur", ta), w.on("blur", ta)), null === c.rtl && (c.rtl = "rtl" === w.css("direction")), ua.rtl(!!c.rtl), c.autoExpand && v.on("keyup", ua.expandToContent), c.resizeEnabled && V(), q.attr("id", c.id), ua.emoticons(c.emoticonsEnabled)
}, T = function() {
}, T = function() {
var b = m ? "selectionchange" : "keyup focus blur contextmenu mouseup touchend click",
var a = n ? "selectionchange" : "keyup focus blur contextmenu mouseup touchend click",
c = "keydown keyup keypress focus blur contextmenu";
d = "keydown keyup keypress focus blur contextmenu";
l.click(eb), a(vb.form).bind("reset", bb).submit(ub.updateOriginal), k.bind("resize orientationChanged", fb), u.keypress(ab).keydown($).keydown(_).keyup(jb).blur(rb).keyup(sb).bind("paste", Y).bind(b, kb).bind(c, db), p.emoticonsCompat && i.getSelection && u.keyup(ob), w.blur(rb).keyup(sb).keydown($).bind(c, db), v.mousedown(cb).blur(rb).bind(b, kb).bind("beforedeactivate keyup mouseup", N).keyup(jb).focus(function() {
m.click(ea), b(va.form).on("reset", ba).submit(ua.updateOriginal), l.on("resize orientationChanged", fa), u.keypress(aa).keydown($).keydown(_).keyup(ja).blur(ra).keyup(sa).on("paste", Y).on(a, ka).on(d, da), c.emoticonsCompat && j.getSelection && u.keyup(oa), w.blur(ra).keyup(sa).keydown($).on(d, da), v.mousedown(ca).blur(ra).on(a, ka).on("beforedeactivate keyup mouseup", N).keyup(ja).focus(function() {
z = null
z = null
}), q.bind("selectionchanged", lb).bind("selectionchanged", hb).bind("selectionchanged valuechanged nodechanged", db)
}), q.on("selectionchanged", la).on("selectionchanged", ha).on("selectionchanged valuechanged nodechanged", da)
}, R = function() {
}, R = function() {
var b, c = ub.commands,
var a, d = ua.commands,
d = (p.toolbarExclude || "").split(","),
e = (c.toolbarExclude || "").split(","),
e = p.toolbar.split("|");
f = c.toolbar.split("|");
r = a('<div class="sceditor-toolbar" unselectable="on" />'), a.each(e, function(e, f) {
r = b('<div class="sceditor-toolbar" unselectable="on" />'), b.each(f, function(c, f) {
b = a('<div class="sceditor-group" />'), a.each(f.split(","), function(e, f) {
a = b('<div class="sceditor-group" />'), b.each(f.split(","), function(c, f) {
var g, i, j = c[f];
var g, h, j = d[f];
!j || a.inArray(f, d) > -1 || (i = j.shortcut, g = h("toolbarButton", {
!j || b.inArray(f, e) > -1 || (h = j.shortcut, g = i("toolbarButton", {
name: f,
name: f,
dispName: ub._(j.tooltip || f)
dispName: ua._(j.name || j.tooltip || f)
}, !0), g.data("sceditor-txtmode", !!j.txtExec).data("sceditor-wysiwygmode", !!j.exec).toggleClass("disabled", !j.exec).mousedown(function() {
}, !0), g.data("sceditor-txtmode", !!j.txtExec).data("sceditor-wysiwygmode", !!j.exec).toggleClass("disabled", !j.exec).mousedown(function() {
(!m || 9 > m) && (J = !0)
(!n || n < 9) && (J = !0)
}).click(function() {
}).click(function() {
var b = a(this);
var a = b(this);
return b.hasClass("disabled") || M(b, j), hb(), !1
return a.hasClass("disabled") || M(a, j), ha(), !1
}), j.tooltip && g.attr("title", ub._(j.tooltip) + (i ? "(" + i + ")" : "")), i && ub.addShortcut(i, f), j.state ? zb.push({
}), j.tooltip && g.attr("title", ua._(j.tooltip) + (h ? " (" + h + ")" : "")), h && ua.addShortcut(h, f), j.state ? za.push({
name: f,
name: f,
state: j.state
state: j.state
}) : "string" == typeof j.exec && zb.push({
}) : "string" == typeof j.exec && za.push({
name: f,
name: f,
state: j.exec
state: j.exec
}), b.append(g), Cb[f] = g)
}), a.append(g), Ca[f] = g)
}), b[0].firstChild && r.append(b)
}), a[0].firstChild && r.append(a)
}), a(p.toolbarContainer || q).append(r)
}), b(c.toolbarContainer || q).append(r)
}, U = function() {
}, U = function() {
a.each(ub.commands, function(b, c) {
b.each(ua.commands, function(a, c) {
c.forceNewLineAfter && a.isArray(c.forceNewLineAfter) && (yb = a.merge(yb, c.forceNewLineAfter))
c.forceNewLineAfter && b.isArray(c.forceNewLineAfter) && (ya = b.merge(ya, c.forceNewLineAfter))
}), jb()
}), ja()
}, V = function() {
}, V = function() {
var b, c, d, e, f, g, h = a('<div class="sceditor-grip" />'),
var a, d, e, f, g, h, i = b('<div class="sceditor-grip" />'),
j = a('<div class="sceditor-resize-cover" />'),
k = b('<div class="sceditor-resize-cover" />'),
k = "touchmove mousemove",
l = "touchmove mousemove",
n = "touchcancel touchend mouseup",
o = "touchcancel touchend mouseup",
o = 0,
p = 0,
r = 0,
r = 0,
s = 0,
s = 0,
t = 0,
t = 0,
u = 0,
u = 0,
v = 0,
v = 0,
w = q.width(),
w = q.width(),
x = q.height(),
x = q.height(),
y = !1,
y = !1,
z = ub.rtl();
z = ua.rtl();
b = p.resizeMinHeight || x / 1.5, c = p.resizeMaxHeight || 2.5 * x, d = p.resizeMinWidth || w / 1.25, e = p.resizeMaxWidth || 1.25 * w, f = function(a) {
a = c.resizeMinHeight || x / 1.5, d = c.resizeMaxHeight || 2.5 * x, e = c.resizeMinWidth || w / 1.25, f = c.resizeMaxWidth || 1.25 * w, g = function(b) {
"touchmove" === a.type ? (a = i.event, s = a.changedTouches[0].pageX, t = a.changedTouches[0].pageY) : (s = a.pageX, t = a.pageY);
"touchmove" === b.type ? (b = j.event, s = b.changedTouches[0].pageX, t = b.changedTouches[0].pageY) : (s = b.pageX, t = b.pageY);
var f = v + (t - r),
var g = v + (t - r),
g = z ? u - (s - o) : u + (s - o);
h = z ? u - (s - p) : u + (s - p);
e > 0 && g > e && (g = e), d > 0 && d > g && (g = d), p.resizeWidth || (g = !1), c > 0 && f > c && (f = c), b > 0 && b > f && (f = b), p.resizeHeight || (f = !1), (g || f) && (ub.dimensions(g, f), 7 > m && q.height(f)), a.preventDefault()
f > 0 && h > f && (h = f), e > 0 && h < e && (h = e), c.resizeWidth || (h = !1), d > 0 && g > d && (g = d), a > 0 && g < a && (g = a), c.resizeHeight || (g = !1), (h || g) && (ua.dimensions(h, g), n < 7 && q.height(g)), b.preventDefault()
}, g = function(a) {
}, h = function(a) {
y && (y = !1, j.hide(), q.removeClass("resizing").height("auto"), l.unbind(k, f), l.unbind(n, g), a.preventDefault())
y && (y = !1, k.hide(), q.removeClass("resizing").height("auto"), m.off(l, g), m.off(o, h), a.preventDefault())
}, q.append(h), q.append(j.hide()), h.bind("touchstart mousedown", function(a) {
}, q.append(i), q.append(k.hide()), i.on("touchstart mousedown", function(a) {
"touchstart" === a.type ? (a = i.event, o = a.touches[0].pageX, r = a.touches[0].pageY) : (o = a.pageX, r = a.pageY), u = q.width(), v = q.height(), y = !0, q.addClass("resizing"), j.show(), l.bind(k, f), l.bind(n, g), 7 > m && q.height(v), a.preventDefault()
"touchstart" === a.type ? (a = j.event, p = a.touches[0].pageX, r = a.touches[0].pageY) : (p = a.pageX, r = a.pageY), u = q.width(), v = q.height(), y = !0, q.addClass("resizing"), k.show(), m.on(l, g), m.on(o, h), n < 7 && q.height(v), a.preventDefault()
})
})
}, W = function() {
}, W = function() {
var b, c = p.emoticons,
var a, d = c.emoticons,
d = p.emoticonsRoot;
e = c.emoticonsRoot;
a.isPlainObject(c) && p.emoticonsEnabled && a.each(c, function(e, f) {
b.isPlainObject(d) && c.emoticonsEnabled && b.each(d, function(c, f) {
a.each(f, function(a, f) {
b.each(f, function(b, f) {
d && (f = {
e && (f = {
url: d + (f.url || f),
url: e + (f.url || f),
tooltip: f.tooltip || a
tooltip: f.tooltip || b
}, c[e][a] = f), b = j.createElement("img"), b.src = f.url || f, xb.push(b)
}, d[c][b] = f), a = k.createElement("img"), a.src = f.url || f, xa.push(a)
})
})
})
})
}, mb = function() {
}, ma = function() {
var b, c, d = v[0],
var a, d, e = v[0],
f = u[0],
g = u[0],
g = f.firstChild,
h = g.firstChild,
h = !!p.autofocusEnd;
i = !!c.autofocusEnd;
if (q.is(":visible")) {
if (q.is(":visible")) {
if (ub.sourceMode()) return c = h ? x.value.length : 0, void(x.setSelectionRange ? x.setSelectionRange(c, c) : (b = x.createTextRange(), b.moveEnd("character", c), b.collapse(!1), b.select()));
if (ua.sourceMode()) return d = i ? x.value.length : 0, void(x.setSelectionRange ? x.setSelectionRange(d, d) : (a = x.createTextRange(), a.moveEnd("character", d), a.collapse(!1), a.select()));
if (e.removeWhiteSpace(f), h)
if (f.removeWhiteSpace(g), i)
for ((g = f.lastChild) || (g = d.createElement("p"), u.append(g)); g.lastChild;) g = g.lastChild, !n && a(g).is("br") && g.previousSibling && (g = g.previousSibling);
for ((h = g.lastChild) || (h = e.createElement("p"), u.append(h)); h.lastChild;) h = h.lastChild, !o && b(h).is("br") && h.previousSibling && (h = h.previousSibling);
d.createRange ? (b = d.createRange(), e.canHaveChildren(g) ? b.selectNodeContents(g) : (b.setStartBefore(g), h && b.setStartAfter(g))) : (b = f.createTextRange(), b.moveToElementText(3 !== g.nodeType ? g : g.parentNode)), b.collapse(!h), B.selectRange(b), F = b, h && (v.scrollTop(f.scrollHeight), u.scrollTop(f.scrollHeight)), ub.focus()
e.createRange ? (a = e.createRange(), f.canHaveChildren(h) ? a.selectNodeContents(h) : (a.setStartBefore(h), i && a.setStartAfter(h))) : (a = g.createTextRange(), a.moveToElementText(3 !== h.nodeType ? h : h.parentNode)), a.collapse(!i), B.selectRange(a), F = a, i && (v.scrollTop(g.scrollHeight), u.scrollTop(g.scrollHeight)), ua.focus()
}
}
}, ub.readOnly = function(a) {
}, ua.readOnly = function(a) {
return "boolean" != typeof a ? "readonly" === w.attr("readonly") : (u[0].contentEditable = !a, a ? w.attr("readonly", "readonly") : w.removeAttr("readonly"), gb(a), ub)
return "boolean" != typeof a ? "readonly" === w.attr("readonly") : (u[0].contentEditable = !a, a ? w.attr("readonly", "readonly") : w.removeAttr("readonly"), ga(a), ua)
}, ub.rtl = function(a) {
}, ua.rtl = function(a) {
var b = a ? "rtl" : "ltr";
var b = a ? "rtl" : "ltr";
return "boolean" != typeof a ? "rtl" === w.attr("dir") : (u.attr("dir", b), w.attr("dir", b), q.removeClass("rtl").removeClass("ltr").addClass(b), ub)
return "boolean" != typeof a ? "rtl" === w.attr("dir") : (u.attr("dir", b), w.attr("dir", b), q.removeClass("rtl").removeClass("ltr").addClass(b), ua)
}, gb = function(b) {
}, ga = function(a) {
var c = ub.inSourceMode() ? "txtmode" : "wysiwygmode";
var c = ua.inSourceMode() ? "txtmode" : "wysiwygmode";
a.each(Cb, function(a, d) {
b.each(Ca, function(b, d) {
b !== !0 && d.data("sceditor-" + c) ? d.removeClass("disabled") : d.addClass("disabled")
a !== !0 && d.data("sceditor-" + c) ? d.removeClass("disabled") : d.addClass("disabled")
})
})
}, ub.width = function(a, b) {
}, ua.width = function(a, b) {
return a || 0 === a ? (ub.dimensions(a, null, b), ub) : q.width()
return a || 0 === a ? (ua.dimensions(a, null, b), ua) : q.width()
}, ub.dimensions = function(a, b, c) {
}, ua.dimensions = function(a, b, d) {
var d, e = 8 > m || j.documentMode < 8 ? 2 : 0;
var e, f = n < 8 || k.documentMode < 8 ? 2 : 0;
return a = a || 0 === a ? a : !1, b = b || 0 === b ? b : !1, a === !1 && b === !1 ? {
return a = !(!a && 0 !== a) && a, b = !(!b && 0 !== b) && b, a === !1 && b === !1 ? {
width: ub.width(),
width: ua.width(),
height: ub.height()
height: ua.height()
} : (s.data("outerWidthOffset") === d && ub.updateStyleCache(), a !== !1 && (c !== !1 && (p.width = a), b === !1 && (b = q.height(), c = !1), q.width(a), a && a.toString().indexOf("%") > -1 && (a = q.width()), s.width(a - s.data("outerWidthOffset")), w.width(a - w.data("outerWidthOffset")), g.ios && u && u.width(a - s.data("outerWidthOffset") - (u.outerWidth(!0) - u.width()))), b !== !1 && (c !== !1 && (p.height = b), b && b.toString().indexOf("%") > -1 && (b = q.height(b).height(), q.height("auto")), b -= p.toolbarContainer ? 0 : r.outerHeight(!0), s.height(b - s.data("outerHeightOffset")), w.height(b - e - w.data("outerHeightOffset"))), ub)
} : (s.data("outerWidthOffset") === e && ua.updateStyleCache(), a !== !1 && (d !== !1 && (c.width = a), b === !1 && (b = q.height(), d = !1), q.width(a), a && a.toString().indexOf("%") > -1 && (a = q.width()), s.width(a - s.data("outerWidthOffset")), w.width(a - w.data("outerWidthOffset")), h.ios && u && u.width(a - s.data("outerWidthOffset") - (u.outerWidth(!0) - u.width()))), b !== !1 && (d !== !1 && (c.height = b), b && b.toString().indexOf("%") > -1 && (b = q.height(b).height(), q.height("auto")), b -= c.toolbarContainer ? 0 : r.outerHeight(!0), s.height(b - s.data("outerHeightOffset")), w.height(b - f - w.data("outerHeightOffset"))), ua)
}, ub.updateStyleCache = function() {
}, ua.updateStyleCache = function() {
s.data("outerWidthOffset", s.outerWidth(!0) - s.width()), w.data("outerWidthOffset", w.outerWidth(!0) - w.width()), s.data("outerHeightOffset", s.outerHeight(!0) - s.height()), w.data("outerHeightOffset", w.outerHeight(!0) - w.height())
s.data("outerWidthOffset", s.outerWidth(!0) - s.width()), w.data("outerWidthOffset", w.outerWidth(!0) - w.width()), s.data("outerHeightOffset", s.outerHeight(!0) - s.height()), w.data("outerHeightOffset", w.outerHeight(!0) - w.height())
}, ub.height = function(a, b) {
}, ua.height = function(a, b) {
return a || 0 === a ? (ub.dimensions(null, a, b), ub) : q.height()
return a || 0 === a ? (ua.dimensions(null, a, b), ua) : q.height()
}, ub.maximize = function(b) {
}, ua.maximize = function(a) {
return "undefined" == typeof b ? q.is(".sceditor-maximize") : (b = !!b, 7 > m && a("html, body").toggleClass("sceditor-maximize", b), q.toggleClass("sceditor-maximize", b), ub.width(b ? "100%" : p.width, !1), ub.height(b ? "100%" : p.height, !1), ub)
return "undefined" == typeof a ? q.is(".sceditor-maximize") : (a = !!a, n < 7 && b("html, body").toggleClass("sceditor-maximize", a), q.toggleClass("sceditor-maximize", a), ua.width(a ? "100%" : c.width, !1), ua.height(a ? "100%" : c.height, !1), ua)
}, ub.expandToContent = function(a) {
}, ua.expandToContent = function(a) {
var b = q.height(),
var b = q.height(),
c = b - s.height(),
d = b - s.height(),
d = u[0].scrollHeight || v[0].documentElement.scrollHeight,
e = u[0].scrollHeight || v[0].documentElement.scrollHeight,
e = p.resizeMaxHeight || 2 * (p.height || wb.height());
f = c.resizeMaxHeight || 2 * (c.height || wa.height());
d += c, (a === !0 || e >= d) && d > b && ub.height(d)
e += d, (a === !0 || e <= f) && e > b && ua.height(e)
}, ub.destroy = function() {
}, ua.destroy = function() {
C && (C.destroy(), B = null, z = null, C = null, l.unbind("click", eb), k.unbind("resize orientationChanged", fb), a(vb.form).unbind("reset", bb).unbind("submit", ub.updateOriginal), u.unbind(), v.unbind().find("*").remove(), w.unbind().remove(), r.remove(), q.unbind().find("*").unbind().remove(), q.remove(), wb.removeData("sceditor").removeData("sceditorbbcode").show(), H && wb.attr("required", "required"))
C && (C.destroy(), B = null, z = null, C = null, y && y.off().remove(), m.off("click", ea), l.off("resize orientationChanged", fa), b(va.form).off("reset", ba).off("submit", ua.updateOriginal), u.off(), v.off().find("*").remove(), w.off().remove(), r.remove(), q.off().find("*").off().remove(), q.remove(), wa.removeData("sceditor").removeData("sceditorbbcode").show(), H && wa.attr("required", "required"))
}, ub.createDropDown = function(b, c, d, e) {
}, ua.createDropDown = function(a, d, e, f) {
var f, g = "sceditor-" + c,
var g, h = "sceditor-" + d,
h = y && y.is("." + g);
i = y && y.is("." + h);
ub.closeDropDown(), h || (e !== !1 && a(d).find(":not(input,textarea)").filter(function() {
ua.closeDropDown(!0), i || (f !== !1 && b(e).find(":not(input,textarea)").filter(function() {
return 1 === this.nodeType
return 1 === this.nodeType
}).attr("unselectable", "on"), f = {
}).attr("unselectable", "on"), g = {
top: b.offset().top,
top: a.offset().top,
left: b.offset().left,
left: a.offset().left,
marginTop: b.outerHeight()
marginTop: a.outerHeight()
}, a.extend(f, p.dropDownCss), y = a('<div class="sceditor-dropdown ' + g + '" />').css(f).append(d).appendTo(a("body")).on("click focusin", function(a) {
}, b.extend(g, c.dropDownCss), y = b('<div class="sceditor-dropdown ' + h + '" />').css(g).append(e).appendTo(b("body")).on("click focusin", function(a) {
a.stopPropagation()
a.stopPropagation()
}), setTimeout(function() {
}), setTimeout(function() {
y.find("input,textarea").first().focus()
y && y.find("input,textarea").first().focus()
}))
}))
}, eb = function(a) {
}, ea = function(a) {
3 !== a.which && y && (tb(), ub.closeDropDown())
3 !== a.which && y && (ta(), ua.closeDropDown())
}, Y = function(a) {
}, Y = function(a) {
var b, c, d, e = u[0],
var b, d, e, f = u[0],
f = v[0],
g = v[0],
g = 0,
h = 0,
h = j.createElement("div"),
i = k.createElement("div"),
i = f.createDocumentFragment(),
j = g.createDocumentFragment(),
k = a ? a.clipboardData : !1;
l = !!a && a.clipboardData;
if (p.disablePasting) return !1;
if (c.disablePasting) return !1;
if (p.enablePasteFiltering) {
if (c.enablePasteFiltering) {
if (B.saveRange(), j.body.appendChild(h), k && k.getData && ((b = k.getData("text/html")) || (b = k.getData("text/plain")))) return h.innerHTML = b, Z(e, h), !1;
if (B.saveRange(), k.body.appendChild(i), l && l.getData && ((b = l.getData("text/html")) || (b = l.getData("text/plain")))) return i.innerHTML = b, Z(f, i), !1;
for (d = u.scrollTop() || v.scrollTop(); e.firstChild;) i.appendChild(e.firstChild);
for (e = u.scrollTop() || v.scrollTop(); f.firstChild;) j.appendChild(f.firstChild);
return c = function(a, b) {
return d = function(a, b) {
if (a.childNodes.length > 0 || g > 25) {
if (a.childNodes.length > 0 || h > 25) {
for (; a.firstChild;) b.appendChild(a.firstChild);
for (; a.firstChild;) b.appendChild(a.firstChild);
for (; i.firstChild;) a.appendChild(i.firstChild);
for (; j.firstChild;) a.appendChild(j.firstChild);
u.scrollTop(d), v.scrollTop(d), b.childNodes.length > 0 ? Z(a, b) : B.restoreRange()
u.scrollTop(e), v.scrollTop(e), b.childNodes.length > 0 ? Z(a, b) : B.restoreRange()
} else g++, setTimeout(function() {
} else h++, setTimeout(function() {
c(a, b)
d(a, b)
}, 20)
}, 20)
}, c(e, h), ub.focus(), !0
}, d(f, i), ua.focus(), !0
}
}
}, Z = function(b, c) {
}, Z = function(a, c) {
e.fixNesting(c);
f.fixNesting(c);
var d = c.innerHTML;
var d = c.innerHTML;
C.hasHandler("toSource") && (d = C.callOnlyFirst("toSource", d, a(c))), c.parentNode.removeChild(c), C.hasHandler("toWysiwyg") && (d = C.callOnlyFirst("toWysiwyg", d, !0)), B.restoreRange(), ub.wysiwygEditorInsertHtml(d, null, !0)
C.hasHandler("toSource") && (d = C.callOnlyFirst("toSource", d, b(c))), c.parentNode.removeChild(c), C.hasHandler("toWysiwyg") && (d = C.callOnlyFirst("toWysiwyg", d, !0)), B.restoreRange(), ua.wysiwygEditorInsertHtml(d, null, !0)
}, ub.closeDropDown = function(a) {
}, ua.closeDropDown = function(a) {
y && (y.unbind().remove(), y = null), a === !0 && ub.focus()
y && (y.off().remove(), y = null), a === !0 && ua.focus()
}, X = function() {
}, X = function() {
return t.contentDocument ? t.contentDocument : t.contentWindow && t.contentWindow.document ? t.contentWindow.document : t.document
return t.contentDocument ? t.contentDocument : t.contentWindow && t.contentWindow.document ? t.contentWindow.document : t.document
}, ub.wysiwygEditorInsertHtml = function(b, c, d) {
}, ua.wysiwygEditorInsertHtml = function(a, c, d) {
var f, g, h, i = s.height();
var e, g, h, i = s.height();
ub.focus(), (d || !a(E).is("code") && 0 === a(E).parents("code").length) && (B.insertHTML(b, c), B.saveRange(), L(u[0]), f = u.find("#sceditor-end-marker").show(), g = u.scrollTop() || v.scrollTop(), h = e.getOffset(f[0]).top + 1.5 * f.outerHeight(!0) - i, f.hide(), (h > g || g > h + i) && (u.scrollTop(h), v.scrollTop(h)), qb(!1), B.restoreRange(), jb())
ua.focus(), (d || !b(E).is("code") && 0 === b(E).parents("code").length) && (B.insertHTML(a, c), B.saveRange(), L(u[0]), e = u.find("#sceditor-end-marker").show(), g = u.scrollTop() || v.scrollTop(), h = f.getOffset(e[0]).top + 1.5 * e.outerHeight(!0) - i, e.hide(), (h > g || h + i < g) && (u.scrollTop(h), v.scrollTop(h)), qa(!1), B.restoreRange(), ja())
}, ub.wysiwygEditorInsertText = function(a, b) {
}, ua.wysiwygEditorInsertText = function(a, b) {
ub.wysiwygEditorInsertHtml(f.entities(a), f.entities(b))
ua.wysiwygEditorInsertHtml(g.entities(a), g.entities(b))
}, ub.insertText = function(a, b) {
}, ua.insertText = function(a, b) {
return ub.inSourceMode() ? ub.sourceEditorInsertText(a, b) : ub.wysiwygEditorInsertText(a, b), ub
return ua.inSourceMode() ? ua.sourceEditorInsertText(a, b) : ua.wysiwygEditorInsertText(a, b), ua
}, ub.sourceEditorInsertText = function(a, b) {
}, ua.sourceEditorInsertText = function(a, b) {
var c, d, e, f = x.selectionStart,
var c, d, e, f = x.selectionStart,
g = x.selectionEnd;
g = x.selectionEnd;
d = x.scrollTop, x.focus(), "undefined" != typeof f ? (e = x.value, b && (a += e.substring(f, g) + b), x.value = e.substring(0, f) + a + e.substring(g, e.length), x.selectionStart = f + a.length - (b ? b.length : 0), x.selectionEnd = x.selectionStart) : (c = j.selection.createRange(), b && (a += c.text + b), c.text = a, b && c.moveEnd("character", 0 - b.length), c.moveStart("character", c.End - c.Start), c.select()), x.scrollTop = d, x.focus(), qb()
d = x.scrollTop, x.focus(), "undefined" != typeof f ? (e = x.value, b && (a += e.substring(f, g) + b), x.value = e.substring(0, f) + a + e.substring(g, e.length), x.selectionStart = f + a.length - (b ? b.length : 0), x.selectionEnd = x.selectionStart) : (c = k.selection.createRange(), b && (a += c.text + b), c.text = a, b && c.moveEnd("character", 0 - b.length), c.moveStart("character", c.End - c.Start), c.select()), x.scrollTop = d, x.focus(), qa()
}, ub.getRangeHelper = function() {
}, ua.getRangeHelper = function() {
return B
return B
}, ub.sourceEditorCaret = function(a) {
}, ua.sourceEditorCaret = function(a) {
var b, c = {};
var b, c = {};
return x.focus(), "undefined" != typeof x.selectionStart ? a ? (x.selectionStart = a.start, x.selectionEnd = a.end) : (c.start = x.selectionStart, c.end = x.selectionEnd) : (b = j.selection.createRange(), a ? (b.moveEnd("character", a.end), b.moveStart("character", a.start), b.select()) : (c.start = b.Start, c.end = b.End)), a ? this : c
return x.focus(), "undefined" != typeof x.selectionStart ? a ? (x.selectionStart = a.start, x.selectionEnd = a.end) : (c.start = x.selectionStart, c.end = x.selectionEnd) : (b = k.selection.createRange(), a ? (b.moveEnd("character", a.end), b.moveStart("character", a.start), b.select()) : (c.start = b.Start, c.end = b.End)), a ? this : c
}, ub.val = function(a, b) {
}, ua.val = function(a, b) {
return "string" != typeof a ? ub.inSourceMode() ? ub.getSourceEditorValue(!1) : ub.getWysiwygEditorValue(b) : (ub.inSourceMode() ? ub.setSourceEditorValue(a) : (b !== !1 && C.hasHandler("toWysiwyg") && (a = C.callOnlyFirst("toWysiwyg", a)), ub.setWysiwygEditorValue(a)), ub)
return "string" != typeof a ? ua.inSourceMode() ? ua.getSourceEditorValue(!1) : ua.getWysiwygEditorValue(b) : (ua.inSourceMode() ? ua.setSourceEditorValue(a) : (b !== !1 && C.hasHandler("toWysiwyg") && (a = C.callOnlyFirst("toWysiwyg", a)), ua.setWysiwygEditorValue(a)), ua)
}, ub.insert = function(b, c, d, e, f) {
}, ua.insert = function(a, c, d, e, f) {
if (ub.inSourceMode()) return ub.sourceEditorInsertText(b, c), ub;
if (ua.inSourceMode()) return ua.sourceEditorInsertText(a, c), ua;
if (c) {
if (c) {
var g = B.selectedHtml(),
var g = B.selectedHtml(),
h = a("<div>").appendTo(a("body")).hide().html(g);
h = b("<div>").appendTo(b("body")).hide().html(g);
d !== !1 && C.hasHandler("toSource") && (g = C.callOnlyFirst("toSource", g, h)), h.remove(), b += g + c
d !== !1 && C.hasHandler("toSource") && (g = C.callOnlyFirst("toSource", g, h)), h.remove(), a += g + c
}
}
return d !== !1 && C.hasHandler("toWysiwyg") && (b = C.callOnlyFirst("toWysiwyg", b, !0)), d !== !1 && f === !0 && (b = b.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&")), ub.wysiwygEditorInsertHtml(b), ub
return d !== !1 && C.hasHandler("toWysiwyg") && (a = C.callOnlyFirst("toWysiwyg", a, !0)), d !== !1 && f === !0 && (a = a.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&")), ua.wysiwygEditorInsertHtml(a), ua
}, ub.getWysiwygEditorValue = function(a) {
}, ua.getWysiwygEditorValue = function(a) {
var b, c, d = B.hasSelection();
var c, d = b("<div>").appendTo(document.body).append(b(u[0].childNodes).clone());
return d ? B.saveRange() : z && z.getBookmark && (c = z.getBookmark()), e.fixNesting(u[0]), b = u.html(), a !== !1 && C.hasHandler("toSource") && (b = C.callOnlyFirst("toSource", b, u)), d ? (B.restoreRange(), z = null) : c && (z.moveToBookmark(c), z = null), b
return f.fixNesting(d[0]), c = d.html(), a !== !1 && C.hasHandler("toSource") && (c = C.callOnlyFirst("toSource", c, d)), d.remove(), c
}, ub.getBody = function() {
}, ua.getBody = function() {
return u
return u
}, ub.getContentAreaContainer = function() {
}, ua.getContentAreaContainer = function() {
return s
return s
}, ub.getSourceEditorValue = function(a) {
}, ua.getSourceEditorValue = function(a) {
var b = w.val();
var b = w.val();
return a !== !1 && C.hasHandler("toWysiwyg") && (b = C.callOnlyFirst("toWysiwyg", b)), b
return a !== !1 && C.hasHandler("toWysiwyg") && (b = C.callOnlyFirst("toWysiwyg", b)), b
}, ub.setWysiwygEditorValue = function(a) {
}, ua.setWysiwygEditorValue = function(a) {
a || (a = "<p>" + (m ? "" : "<br />") + "</p>"), u[0].innerHTML = a, L(u[0]), jb(), qb()
a || (a = "<p>" + (n ? "" : "<br />") + "</p>"), u[0].innerHTML = a, L(u[0]), ja(), qa()
}, ub.setSourceEditorValue = function(a) {
}, ua.setSourceEditorValue = function(a) {
w.val(a), qb()
w.val(a), qa()
}, ub.updateOriginal = function() {
}, ua.updateOriginal = function() {
wb.val(ub.val())
wa.val(ua.val())
}, L = function(b) {
}, L = function(a) {
if (p.emoticonsEnabled && !a(b).parents("code").length) {
if (c.emoticonsEnabled && !b(a).parents("code").length) {
var c = b.ownerDocument,
var d = a.ownerDocument,
d = "\\s| | | | |&nbsp;",
e = "\\s| | | | |&nbsp;",
g = [],
h = [],
i = [],
j = [],
j = a.extend({}, p.emoticons.more, p.emoticons.dropdown, p.emoticons.hidden);
k = b.extend({}, c.emoticons.more, c.emoticons.dropdown, c.emoticons.hidden);
a.each(j, function(a) {
b.each(k, function(a) {
p.emoticonsCompat && (i[a] = new RegExp("(>|^|" + d + ")" + f.regex(a) + "($|<|" + d + ")")), g.push(a)
c.emoticonsCompat && (j[a] = new RegExp("(>|^|" + e + ")" + g.regex(a) + "($|<|" + e + ")")), h.push(a)
});
});
var k = function(b) {
var l = function(a) {
for (b = b.firstChild; b;) {
for (a = a.firstChild; a;) {
var d, f, l, m, n, o, q, r = b.parentNode,
var e, g, m, n, o, p, q, r = a.parentNode,
s = b.nodeValue;
s = a.nodeValue;
if (3 !== b.nodeType) a(b).is("code") || k(b);
if (3 !== a.nodeType) b(a).is("code") || l(a);
else if (s)
else if (s)
for (n = g.length; n--;) f = g[n], q = p.emoticonsCompat ? s.search(i[f]) : s.indexOf(f), q > -1 && (o = b.nextSibling, l = j[f], d = s.substr(q).split(f), s = s.substr(0, q) + d.shift(), b.nodeValue = s, m = e.parseHTML(h("emoticon", {
for (o = h.length; o--;) g = h[o], q = c.emoticonsCompat ? s.search(j[g]) : s.indexOf(g), q > -1 && (p = a.nextSibling, m = k[g], e = s.substr(q).split(g), s = s.substr(0, q) + e.shift(), a.nodeValue = s, n = f.parseHTML(i("emoticon", {
key: f,
key: g,
url: l.url || l,
url: m.url || m,
tooltip: l.tooltip || f
tooltip: m.tooltip || g
}), c), r.insertBefore(m[0], o), r.insertBefore(c.createTextNode(d.join(f)), o));
}), d), r.insertBefore(n[0], p), r.insertBefore(d.createTextNode(e.join(g)), p));
b = b.nextSibling
a = a.nextSibling
}
}
};
};
k(b), p.emoticonsCompat && (Bb = u.find("img[data-sceditor-emoticon]"))
l(a), c.emoticonsCompat && (Ba = u.find("img[data-sceditor-emoticon]"))
}
}
}, ub.inSourceMode = function() {
}, ua.inSourceMode = function() {
return q.hasClass("sourceMode")
return q.hasClass("sourceMode")
}, ub.sourceMode = function(a) {
}, ua.sourceMode = function(a) {
var b = ub.inSourceMode();
var b = ua.inSourceMode();
return "boolean" != typeof a ? b : ((b && !a || !b && a) && ub.toggleSourceMode(), ub)
return "boolean" != typeof a ? b : ((b && !a || !b && a) && ua.toggleSourceMode(), ua)
}, ub.toggleSourceMode = function() {
}, ua.toggleSourceMode = function() {
var a = ub.inSourceMode();
var a = ua.inSourceMode();
(g.isWysiwygSupported || !a) && (a || (B.saveRange(), B.clear()), ub.blur(), a ? ub.setWysiwygEditorValue(ub.getSourceEditorValue()) : ub.setSourceEditorValue(ub.getWysiwygEditorValue()), z = null, w.toggle(), s.toggle(), q.toggleClass("wysiwygMode", a).toggleClass("sourceMode", !a), gb(), hb())
!h.isWysiwygSupported && a || (a || (B.saveRange(), B.clear()), ua.blur(), a ? ua.setWysiwygEditorValue(ua.getSourceEditorValue()) : ua.setSourceEditorValue(ua.getWysiwygEditorValue()), z = null, w.toggle(), s.toggle(), q.toggleClass("wysiwygMode", a).toggleClass("sourceMode", !a), ga(), ha())
}, ib = function() {
}, ia = function() {
return x.focus(), "undefined" != typeof x.selectionStart ? x.value.substring(x.selectionStart, x.selectionEnd) : j.selection.createRange().text
return x.focus(), "undefined" != typeof x.selectionStart ? x.value.substring(x.selectionStart, x.selectionEnd) : k.selection.createRange().text
}, M = function(b, c) {
}, M = function(a, c) {
ub.inSourceMode() ? c.txtExec && (a.isArray(c.txtExec) ? ub.sourceEditorInsertText.apply(ub, c.txtExec) : c.txtExec.call(ub, b, ib())) : c.exec && (a.isFunction(c.exec) ? c.exec.call(ub, b) : ub.execCommand(c.exec, c.hasOwnProperty("execParam") ? c.execParam : null))
ua.inSourceMode() ? c.txtExec && (b.isArray(c.txtExec) ? ua.sourceEditorInsertText.apply(ua, c.txtExec) : c.txtExec.call(ua, a, ia())) : c.exec && (b.isFunction(c.exec) ? c.exec.call(ua, a) : ua.execCommand(c.exec, c.hasOwnProperty("execParam") ? c.execParam : null))
}, N = function() {
}, N = function() {
m && (z = B.selectedRange())
n && (z = B.selectedRange())
},