Skip to content

Instantly share code, notes, and snippets.

@hxgdzyuyi
Created November 16, 2014 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hxgdzyuyi/a61857bbb3eacc0fd4d0 to your computer and use it in GitHub Desktop.
Save hxgdzyuyi/a61857bbb3eacc0fd4d0 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
YUI.add("squarespace-wysiwyg-constants", function(E) {
E.namespace("Squarespace.Wysiwyg").EditorTypes = {
IFRAME: "IFRAME",
INLINE: "INLINE"
};
var d = E.namespace("Squarespace.Wysiwyg").ToolbarTypes = {
BLOCK: "BLOCK",
LOCKED_BLOCK: "LOCKED_BLOCK",
FULL: "FULL",
LAYOUT_SMALL: "LAYOUT_SMALL",
DIALOG_SMALL: "DIALOG_SMALL",
ULTRA_SMALL: "ULTRA_SMALL"
},
f = E.namespace("Squarespace.Wysiwyg").ToolbarConfigs = {};
f[d.BLOCK] = [{
name: "unique",
items: ["Undo", "Redo", "-", "Bold", "Italic", "sqslink", "-", "JustifyLeft", "JustifyCenter", "JustifyRight",
"-", "Format", "NumberedList", "BulletedList", "Outdent", "Indent", "-", E.Squarespace.Utils.isCKShowSourceEnabled() ? "Sourcedialog" : "none", "PasteText", "RemoveFormat", "sqsremoveblock"
]
}];
f[d.LOCKED_BLOCK] = [{
name: "unique",
items: ["Undo", "Redo", "-", "Bold", "Italic", "sqslink", "-", "JustifyLeft", "JustifyCenter", "JustifyRight", "-", "Format", "NumberedList", "BulletedList", "Outdent", "Indent", "-", E.Squarespace.Utils.isCKShowSourceEnabled() ? "Sourcedialog" : "none", "PasteText", "RemoveFormat"]
}];
f[d.FULL] = [{
name: "left",
items: ["Undo",
"Redo", "-", "Bold", "Italic", "sqslink", "-", "Format", "NumberedList", "BulletedList", "Outdent", "Indent", "-", E.Squarespace.Utils.isCKShowSourceEnabled() ? "Source" : "none", "PasteText", "RemoveFormat"
]
}, {
name: "right",
items: ["Maximize"]
}];
f[d.LAYOUT_SMALL] = [{
name: "unique",
items: ["Undo", "Redo", "-", "Bold", "Italic", "sqslink", "-", E.Squarespace.Utils.isCKShowSourceEnabled() ? "Source" : "none", "PasteText", "RemoveFormat"]
}];
f[d.DIALOG_SMALL] = [{
name: "left",
items: ["Undo", "Redo", "-", "Bold", "Italic", "sqslink", "-", E.Squarespace.Utils.isCKShowSourceEnabled() ?
"Source" : "none", "PasteText", "RemoveFormat"
]
}, {
name: "right",
items: ["Maximize"]
}];
f[d.ULTRA_SMALL] = [{
name: "unique",
items: ["Bold", "Italic", "sqslink", E.Squarespace.Utils.isCKShowSourceEnabled() ? "Source" : "none"]
}]
}, "1.0", {
requires: ["squarespace-util"]
});
YUI.add("squarespace-ckeditor", function(E) {}, "1.0", {
requires: ["thirdparty-ckeditor", "squarespace-wysiwyg-editor"]
});
YUI.add("thirdparty-ckeditor", function(E) {
with(E.config.win) window.CKEDITOR_BASEPATH = Static.SQUARESPACE_CONTEXT && Static.SQUARESPACE_CONTEXT.appDomain ? "//static." + Static.SQUARESPACE_CONTEXT.appDomain + "/universal/scripts-thirdparty/ckeditor_build_201410221425/" : "/universal/scripts-thirdparty/ckeditor_build_201410221425/",
function() {
if (!window.CKEDITOR || !window.CKEDITOR.dom) window.CKEDITOR || (window.CKEDITOR = function() {
var d = {
timestamp: "E9MI",
version: "4.2 DEV",
revision: "0",
rnd: Math.floor(900 * Math.random()) +
100,
_: {
pending: []
},
status: "unloaded",
basePath: window.CKEDITOR_BASEPATH || "",
getUrl: function(a) {
-1 == a.indexOf(":/") && 0 !== a.indexOf("/") && (a = this.basePath + a);
this.timestamp && "/" != a.charAt(a.length - 1) && !/[&?]t=/.test(a) && (a += (0 <= a.indexOf("?") ? "&" : "?") + "t=" + this.timestamp);
return a
},
domReady: function() {
function a() {
try {
document.addEventListener ? (document.removeEventListener("DOMContentLoaded", a, !1), b()) : document.attachEvent && "complete" === document.readyState && (document.detachEvent("onreadystatechange",
a), b())
} catch (e) {}
}
function b() {
for (var b; b = e.shift();) b()
}
var e = [];
return function(b) {
e.push(b);
"complete" === document.readyState && setTimeout(a, 1);
if (1 == e.length)
if (document.addEventListener) document.addEventListener("DOMContentLoaded", a, !1), window.addEventListener("load", a, !1);
else if (document.attachEvent) {
document.attachEvent("onreadystatechange", a);
window.attachEvent("onload", a);
b = !1;
try {
b = !window.frameElement
} catch (c) {}
if (document.documentElement.doScroll && b) {
var d = function() {
try {
document.documentElement.doScroll("left")
} catch (b) {
setTimeout(d,
1);
return
}
a()
};
d()
}
}
}
}()
},
f = window.CKEDITOR_GETURL;
if (f) {
var c = d.getUrl;
d.getUrl = function(a) {
return f.call(d, a) || c.call(d, a)
}
}
return d
}()), CKEDITOR.event || (CKEDITOR.event = function() {}, CKEDITOR.event.implementOn = function(d) {
var f = CKEDITOR.event.prototype,
c;
for (c in f) void 0 == d[c] && (d[c] = f[c])
}, CKEDITOR.event.prototype = function() {
function d(a) {
var b = f(this);
return b[a] || (b[a] = new c(a))
}
var f = function(a) {
a = a.getPrivate && a.getPrivate() || a._ || (a._ = {});
return a.events || (a.events = {})
},
c = function(a) {
this.name =
a;
this.listeners = []
};
c.prototype = {
getListenerIndex: function(a) {
for (var b = 0, e = this.listeners; b < e.length; b++)
if (e[b].fn == a) return b;
return -1
}
};
return {
define: function(a, b) {
var e = d.call(this, a);
CKEDITOR.tools.extend(e, b, !0)
},
on: function(a, b, e, c, k) {
function h(d, m, n, h) {
d = {
name: a,
sender: this,
editor: d,
data: m,
listenerData: c,
stop: n,
cancel: h,
removeListener: l
};
return !1 === b.call(e, d) ? !1 : d.data
}
function l() {
f.removeListener(a, b)
}
var n = d.call(this, a);
if (0 > n.getListenerIndex(b)) {
n = n.listeners;
e || (e = this);
isNaN(k) &&
(k = 10);
var f = this;
h.fn = b;
h.priority = k;
for (var r = n.length - 1; 0 <= r; r--)
if (n[r].priority <= k) return n.splice(r + 1, 0, h), {
removeListener: l
};
n.unshift(h)
}
return {
removeListener: l
}
},
once: function() {
var a = arguments[1];
arguments[1] = function(b) {
b.removeListener();
return a.apply(this, arguments)
};
return this.on.apply(this, arguments)
},
capture: function() {
CKEDITOR.event.useCapture = 1;
var a = this.on.apply(this, arguments);
CKEDITOR.event.useCapture = 0;
return a
},
fire: function() {
var a = 0,
b = function() {
a = 1
},
e = 0,
c = function() {
e =
1
};
return function(d, h, l) {
var n = f(this)[d];
d = a;
var q = e;
a = e = 0;
if (n) {
var r = n.listeners;
if (r.length)
for (var r = r.slice(0), u, m = 0; m < r.length; m++) {
if (n.errorProof) try {
u = r[m].call(this, l, h, b, c)
} catch (p) {} else u = r[m].call(this, l, h, b, c);
!1 === u ? e = 1 : "undefined" != typeof u && (h = u);
if (a || e) break
}
}
h = e ? !1 : "undefined" == typeof h ? !0 : h;
a = d;
e = q;
return h
}
}(),
fireOnce: function(a, b, e) {
b = this.fire(a, b, e);
delete f(this)[a];
return b
},
removeListener: function(a, b) {
var e = f(this)[a];
if (e) {
var c = e.getListenerIndex(b);
0 <= c && e.listeners.splice(c,
1)
}
},
removeAllListeners: function() {
var a = f(this),
b;
for (b in a) delete a[b]
},
hasListeners: function(a) {
return (a = f(this)[a]) && 0 < a.listeners.length
}
}
}()), CKEDITOR.editor || (CKEDITOR.editor = function() {
CKEDITOR._.pending.push([this, arguments]);
CKEDITOR.event.call(this)
}, CKEDITOR.editor.prototype.fire = function(d, f) {
d in {
instanceReady: 1,
loaded: 1
} && (this[d] = !0);
return CKEDITOR.event.prototype.fire.call(this, d, f, this)
}, CKEDITOR.editor.prototype.fireOnce = function(d, f) {
d in {
instanceReady: 1,
loaded: 1
} && (this[d] = !0);
return CKEDITOR.event.prototype.fireOnce.call(this, d, f, this)
}, CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)), CKEDITOR.env || (CKEDITOR.env = function() {
var d = navigator.userAgent.toLowerCase(),
f = window.opera,
c = {
ie: -1 < d.indexOf("trident/"),
opera: !!f && f.version,
webkit: -1 < d.indexOf(" applewebkit/"),
air: -1 < d.indexOf(" adobeair/"),
mac: -1 < d.indexOf("macintosh"),
quirks: "BackCompat" == document.compatMode,
mobile: -1 < d.indexOf("mobile"),
iOS: /(ipad|iphone|ipod)/.test(d),
isCustomDomain: function() {
if (!this.ie) return !1;
var b = document.domain,
a = window.location.hostname;
return b != a && b != "[" + a + "]"
},
secure: "https:" == location.protocol
};
c.gecko = "Gecko" == navigator.product && !c.webkit && !c.opera && !c.ie;
c.webkit && (-1 < d.indexOf("chrome") ? c.chrome = !0 : c.safari = !0);
var a = 0;
c.ie && (a = c.quirks || !document.documentMode ? parseFloat(d.match(/msie (\d+)/)[1]) : document.documentMode, c.ie9Compat = 9 == a, c.ie8Compat = 8 == a, c.ie7Compat = 7 == a, c.ie6Compat = 7 > a || c.quirks && 10 > a);
if (c.gecko) {
var b = d.match(/rv:([\d\.]+)/);
b && (b = b[1].split("."), a = 1E4 * b[0] +
100 * (b[1] || 0) + 1 * (b[2] || 0))
}
c.opera && (a = parseFloat(f.version()));
c.air && (a = parseFloat(d.match(/ adobeair\/(\d+)/)[1]));
c.webkit && (a = parseFloat(d.match(/ applewebkit\/(\d+)/)[1]));
c.version = a;
c.isCompatible = c.iOS && 534 <= a || !c.mobile && (c.ie && 6 < a || c.gecko && 10801 <= a || c.opera && 9.5 <= a || c.air && 1 <= a || c.webkit && 522 <= a || !1);
c.hidpi = 2 <= window.devicePixelRatio;
c.needsBrFiller = c.gecko || c.webkit || c.ie && 10 < a;
c.needsNbspFiller = c.ie && 11 > a;
c.cssClass = "cke_browser_" + (c.ie ? "ie" : c.gecko ? "gecko" : c.opera ? "opera" : c.webkit ?
"webkit" : "unknown");
c.quirks && (c.cssClass += " cke_browser_quirks");
c.ie && (c.cssClass += " cke_browser_ie" + (c.quirks || 7 > c.version ? "6" : c.version), c.quirks && (c.cssClass += " cke_browser_iequirks"));
c.gecko && (10900 > a ? c.cssClass += " cke_browser_gecko18" : 11E3 >= a && (c.cssClass += " cke_browser_gecko19"));
c.air && (c.cssClass += " cke_browser_air");
c.iOS && (c.cssClass += " cke_browser_ios");
c.hidpi && (c.cssClass += " cke_hidpi");
return c
}()), "unloaded" == CKEDITOR.status && function() {
CKEDITOR.event.implementOn(CKEDITOR);
CKEDITOR.loadFullCore =
function() {
if ("basic_ready" != CKEDITOR.status) CKEDITOR.loadFullCore._load = 1;
else {
delete CKEDITOR.loadFullCore;
var d = document.createElement("script");
d.type = "text/javascript";
d.src = CKEDITOR.basePath + "ckeditor.js";
document.getElementsByTagName("head")[0].appendChild(d)
}
};
CKEDITOR.loadFullCoreTimeout = 0;
CKEDITOR.add = function(d) {
(this._.pending || (this._.pending = [])).push(d)
};
(function() {
CKEDITOR.domReady(function() {
var d = CKEDITOR.loadFullCore,
f = CKEDITOR.loadFullCoreTimeout;
d && (CKEDITOR.status = "basic_ready",
d && d._load ? d() : f && setTimeout(function() {
CKEDITOR.loadFullCore && CKEDITOR.loadFullCore()
}, 1E3 * f))
})
})();
CKEDITOR.status = "basic_loaded"
}(), CKEDITOR.dom = {},
function() {
var d = [],
f = CKEDITOR.env.gecko ? "-moz-" : CKEDITOR.env.webkit ? "-webkit-" : CKEDITOR.env.opera ? "-o-" : CKEDITOR.env.ie ? "-ms-" : "";
CKEDITOR.on("reset", function() {
d = []
});
CKEDITOR.tools = {
arrayCompare: function(c, a) {
if (!c && !a) return !0;
if (!c || !a || c.length != a.length) return !1;
for (var b = 0; b < c.length; b++)
if (c[b] != a[b]) return !1;
return !0
},
clone: function(c) {
var a;
if (c && c instanceof Array) {
a = [];
for (var b = 0; b < c.length; b++) a[b] = CKEDITOR.tools.clone(c[b]);
return a
}
if (null === c || "object" != typeof c || c instanceof String || c instanceof Number || c instanceof Boolean || c instanceof Date || c instanceof RegExp) return c;
a = new c.constructor;
for (b in c) a[b] = CKEDITOR.tools.clone(c[b]);
return a
},
capitalize: function(c, a) {
return c.charAt(0).toUpperCase() + (a ? c.slice(1) : c.slice(1).toLowerCase())
},
extend: function(c) {
var a = arguments.length,
b, e;
if ("boolean" == typeof(b = arguments[a - 1])) a--;
else if ("boolean" == typeof(b = arguments[a - 2])) e = arguments[a - 1], a -= 2;
for (var d = 1; d < a; d++) {
var k = arguments[d],
h;
for (h in k)
if (!0 === b || void 0 == c[h])
if (!e || h in e) c[h] = k[h]
}
return c
},
prototypedCopy: function(c) {
var a = function() {};
a.prototype = c;
return new a
},
copy: function(c) {
var a = {},
b;
for (b in c) a[b] = c[b];
return a
},
isArray: function(c) {
return "[object Array]" == Object.prototype.toString.call(c)
},
isEmpty: function(c) {
for (var a in c)
if (c.hasOwnProperty(a)) return !1;
return !0
},
cssVendorPrefix: function(c, a, b) {
if (b) return f +
c + ":" + a + ";" + c + ":" + a;
b = {};
b[c] = a;
b[f + c] = a;
return b
},
cssStyleToDomStyle: function() {
var c = document.createElement("div").style,
a = "undefined" != typeof c.cssFloat ? "cssFloat" : "undefined" != typeof c.styleFloat ? "styleFloat" : "float";
return function(b) {
return "float" == b ? a : b.replace(/-./g, function(b) {
return b.substr(1).toUpperCase()
})
}
}(),
buildStyleHtml: function(c) {
c = [].concat(c);
for (var a, b = [], e = 0; e < c.length; e++)
if (a = c[e]) / @
import | [{}] / .test(a) ? b.push("<style>" + a + "</style>") : b.push('<link type="text/css" rel=stylesheet href="' +
a + '">');
return b.join("")
},
htmlEncode: function(c) {
return ("" + c).replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;")
},
htmlEncodeAttr: function(c) {
return c.replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
},
htmlDecodeAttr: function(c) {
return c.replace(/&quot;/g, '"').replace(/&lt;/g, "<").replace(/&gt;/g, ">")
},
getNextNumber: function() {
var c = 0;
return function() {
return ++c
}
}(),
getNextId: function() {
return "cke_" + this.getNextNumber()
},
override: function(c, a) {
var b = a(c);
b.prototype = c.prototype;
return b
},
setTimeout: function(c, a, b, e, d) {
d || (d = window);
b || (b = d);
return d.setTimeout(function() {
e ? c.apply(b, [].concat(e)) : c.apply(b)
}, a || 0)
},
trim: function() {
var c = /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;
return function(a) {
return a.replace(c, "")
}
}(),
ltrim: function() {
var c = /^[ \t\n\r]+/g;
return function(a) {
return a.replace(c, "")
}
}(),
rtrim: function() {
var c = /[ \t\n\r]+$/g;
return function(a) {
return a.replace(c, "")
}
}(),
indexOf: function(c, a) {
if ("function" == typeof a)
for (var b = 0, e = c.length; b < e; b++) {
if (a(c[b])) return b
} else {
if (c.indexOf) return c.indexOf(a);
b = 0;
for (e = c.length; b < e; b++)
if (c[b] === a) return b
}
return -1
},
search: function(c, a) {
var b = CKEDITOR.tools.indexOf(c, a);
return 0 <= b ? c[b] : null
},
bind: function(c, a) {
return function() {
return c.apply(a, arguments)
}
},
createClass: function(c) {
var a = c.$,
b = c.base,
e = c.privates || c._,
d = c.proto;
c = c.statics;
!a && (a = function() {
b && this.base.apply(this, arguments)
});
if (e) var k = a,
a = function() {
var b = this._ || (this._ = {}),
a;
for (a in e) {
var c = e[a];
b[a] = "function" == typeof c ? CKEDITOR.tools.bind(c, this) : c
}
k.apply(this, arguments)
};
b &&
(a.prototype = this.prototypedCopy(b.prototype), a.prototype.constructor = a, a.base = b, a.baseProto = b.prototype, a.prototype.base = function() {
this.base = b.prototype.base;
b.apply(this, arguments);
this.base = arguments.callee
});
d && this.extend(a.prototype, d, !0);
c && this.extend(a, c, !0);
return a
},
addFunction: function(c, a) {
return d.push(function() {
return c.apply(a || this, arguments)
}) - 1
},
removeFunction: function(c) {
d[c] = null
},
callFunction: function(c) {
var a = d[c];
return a && a.apply(window, Array.prototype.slice.call(arguments,
1))
},
cssLength: function() {
var c = /^-?\d+\.?\d*px$/,
a;
return function(b) {
a = CKEDITOR.tools.trim(b + "") + "px";
return c.test(a) ? a : b || ""
}
}(),
convertToPx: function() {
var c;
return function(a) {
c || (c = CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"></div>', CKEDITOR.document), CKEDITOR.document.getBody().append(c));
return !/%$/.test(a) ? (c.setStyle("width", a), c.$.clientWidth) : a
}
}(),
repeat: function(c, a) {
return Array(a + 1).join(c)
},
tryThese: function() {
for (var c,
a = 0, b = arguments.length; a < b; a++) {
var e = arguments[a];
try {
c = e();
break
} catch (d) {}
}
return c
},
genKey: function() {
return Array.prototype.slice.call(arguments).join("-")
},
defer: function(c) {
return function() {
var a = arguments,
b = this;
window.setTimeout(function() {
c.apply(b, a)
}, 0)
}
},
normalizeCssText: function(c, a) {
var b = [],
e, d = CKEDITOR.tools.parseCssText(c, !0, a);
for (e in d) b.push(e + ":" + d[e]);
b.sort();
return b.length ? b.join(";") + ";" : ""
},
convertRgbToHex: function(c) {
return c.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,
function(a, b, e, c) {
a = [b, e, c];
for (b = 0; 3 > b; b++) a[b] = ("0" + parseInt(a[b], 10).toString(16)).slice(-2);
return "#" + a.join("")
})
},
parseCssText: function(c, a, b) {
var e = {};
b && (b = new CKEDITOR.dom.element("span"), b.setAttribute("style", c), c = CKEDITOR.tools.convertRgbToHex(b.getAttribute("style") || ""));
if (!c || ";" == c) return e;
c.replace(/&quot;/g, '"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(b, c, d) {
a && (c = c.toLowerCase(), "font-family" == c && (d = d.toLowerCase().replace(/["']/g, "").replace(/\s*,\s*/g, ",")),
d = CKEDITOR.tools.trim(d));
e[c] = d
});
return e
},
writeCssText: function(c, a) {
var b, e = [];
for (b in c) e.push(b + ":" + c[b]);
a && e.sort();
return e.join("; ")
},
objectCompare: function(c, a, b) {
var e;
if (!c && !a) return !0;
if (!c || !a) return !1;
for (e in c)
if (c[e] != a[e]) return !1;
if (!b)
for (e in a)
if (c[e] != a[e]) return !1;
return !0
},
objectKeys: function(c) {
var a = [],
b;
for (b in c) a.push(b);
return a
},
convertArrayToObject: function(c, a) {
var b = {};
1 == arguments.length && (a = !0);
for (var e = 0, d = c.length; e < d; ++e) b[c[e]] = a;
return b
},
fixDomain: function() {
for (var c;;) try {
c =
window.parent.document.domain;
break
} catch (a) {
c = c ? c.replace(/.+?(?:\.|$)/, "") : document.domain;
if (!c) break;
document.domain = c
}
return !!c
},
eventsBuffer: function(c, a) {
function b() {
d = (new Date).getTime();
e = !1;
a()
}
var e, d = 0;
return {
input: function() {
if (!e) {
var a = (new Date).getTime() - d;
a < c ? e = setTimeout(b, c - a) : b()
}
},
reset: function() {
e && clearTimeout(e);
e = d = 0
}
}
},
enableHtml5Elements: function(c, a) {
for (var b = "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),
e = b.length, d; e--;) d = c.createElement(b[e]), a && c.appendChild(d)
}
}
}(), CKEDITOR.dtd = function() {
var d = CKEDITOR.tools.extend,
f = function(b, a) {
for (var e = CKEDITOR.tools.clone(b), c = 1; c < arguments.length; c++) {
a = arguments[c];
for (var d in a) delete e[d]
}
return e
},
c = {},
a = {},
b = {
address: 1,
article: 1,
aside: 1,
blockquote: 1,
details: 1,
div: 1,
dl: 1,
fieldset: 1,
figure: 1,
footer: 1,
form: 1,
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1,
header: 1,
hgroup: 1,
hr: 1,
menu: 1,
nav: 1,
ol: 1,
p: 1,
pre: 1,
section: 1,
table: 1,
ul: 1
},
e = {
command: 1,
link: 1,
meta: 1,
noscript: 1,
script: 1,
style: 1
},
g = {},
k = {
"#": 1
},
h = {
center: 1,
dir: 1,
noframes: 1
};
d(c, {
a: 1,
abbr: 1,
area: 1,
audio: 1,
b: 1,
bdi: 1,
bdo: 1,
br: 1,
button: 1,
canvas: 1,
cite: 1,
code: 1,
command: 1,
datalist: 1,
del: 1,
dfn: 1,
em: 1,
embed: 1,
i: 1,
iframe: 1,
img: 1,
input: 1,
ins: 1,
kbd: 1,
keygen: 1,
label: 1,
map: 1,
mark: 1,
meter: 1,
noscript: 1,
object: 1,
output: 1,
progress: 1,
q: 1,
ruby: 1,
s: 1,
samp: 1,
script: 1,
select: 1,
small: 1,
span: 1,
strong: 1,
sub: 1,
sup: 1,
textarea: 1,
time: 1,
u: 1,
"var": 1,
video: 1,
wbr: 1
}, k, {
acronym: 1,
applet: 1,
basefont: 1,
big: 1,
font: 1,
isindex: 1,
strike: 1,
style: 1,
tt: 1
});
d(a, b, c, h);
f = {
a: f(c, {
a: 1,
button: 1
}),
abbr: c,
address: a,
area: g,
article: d({
style: 1
}, a),
aside: d({
style: 1
}, a),
audio: d({
source: 1,
track: 1
}, a),
b: c,
base: g,
bdi: c,
bdo: c,
blockquote: a,
body: a,
br: g,
button: f(c, {
a: 1,
button: 1
}),
canvas: c,
caption: a,
cite: c,
code: c,
col: g,
colgroup: {
col: 1
},
command: g,
datalist: d({
option: 1
}, c),
dd: a,
del: c,
details: d({
summary: 1
}, a),
dfn: c,
div: d({
style: 1
}, a),
dl: {
dt: 1,
dd: 1
},
dt: a,
em: c,
embed: g,
fieldset: d({
legend: 1
}, a),
figcaption: a,
figure: d({
figcaption: 1
}, a),
footer: a,
form: a,
h1: c,
h2: c,
h3: c,
h4: c,
h5: c,
h6: c,
head: d({
title: 1,
base: 1
}, e),
header: a,
hgroup: {
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1
},
hr: g,
html: d({
head: 1,
body: 1
}, a, e),
i: c,
iframe: k,
img: g,
input: g,
ins: c,
kbd: c,
keygen: g,
label: c,
legend: c,
li: a,
link: g,
map: a,
mark: c,
menu: d({
li: 1
}, a),
meta: g,
meter: f(c, {
meter: 1
}),
nav: a,
noscript: d({
link: 1,
meta: 1,
style: 1
}, c),
object: d({
param: 1
}, c),
ol: {
li: 1
},
optgroup: {
option: 1
},
option: k,
output: c,
p: c,
param: g,
pre: c,
progress: f(c, {
progress: 1
}),
q: c,
rp: c,
rt: c,
ruby: d({
rp: 1,
rt: 1
}, c),
s: c,
samp: c,
script: k,
section: d({
style: 1
}, a),
select: {
optgroup: 1,
option: 1
},
small: c,
source: g,
span: c,
strong: c,
style: k,
sub: c,
summary: c,
sup: c,
table: {
caption: 1,
colgroup: 1,
thead: 1,
tfoot: 1,
tbody: 1,
tr: 1
},
tbody: {
tr: 1
},
td: a,
textarea: k,
tfoot: {
tr: 1
},
th: a,
thead: {
tr: 1
},
time: f(c, {
time: 1
}),
title: k,
tr: {
th: 1,
td: 1
},
track: g,
u: c,
ul: {
li: 1
},
"var": c,
video: d({
source: 1,
track: 1
}, a),
wbr: g,
acronym: c,
applet: d({
param: 1
}, a),
basefont: g,
big: c,
center: a,
dialog: g,
dir: {
li: 1
},
font: c,
isindex: g,
noframes: a,
strike: c,
tt: c
};
d(f, {
$block: d({
audio: 1,
dd: 1,
dt: 1,
figcaption: 1,
li: 1,
video: 1
}, b, h),
$blockLimit: {
article: 1,
aside: 1,
audio: 1,
body: 1,
caption: 1,
details: 1,
dir: 1,
div: 1,
dl: 1,
fieldset: 1,
figcaption: 1,
figure: 1,
footer: 1,
form: 1,
header: 1,
hgroup: 1,
menu: 1,
nav: 1,
ol: 1,
section: 1,
table: 1,
td: 1,
th: 1,
tr: 1,
ul: 1,
video: 1
},
$cdata: {
script: 1,
style: 1
},
$editable: {
address: 1,
article: 1,
aside: 1,
blockquote: 1,
body: 1,
details: 1,
div: 1,
fieldset: 1,
figcaption: 1,
footer: 1,
form: 1,
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1,
header: 1,
hgroup: 1,
nav: 1,
p: 1,
pre: 1,
section: 1
},
$empty: {
area: 1,
base: 1,
basefont: 1,
br: 1,
col: 1,
command: 1,
dialog: 1,
embed: 1,
hr: 1,
img: 1,
input: 1,
isindex: 1,
keygen: 1,
link: 1,
meta: 1,
param: 1,
source: 1,
track: 1,
wbr: 1
},
$inline: c,
$list: {
dl: 1,
ol: 1,
ul: 1
},
$listItem: {
dd: 1,
dt: 1,
li: 1
},
$nonBodyContent: d({
body: 1,
head: 1,
html: 1
}, f.head),
$nonEditable: {
applet: 1,
audio: 1,
button: 1,
embed: 1,
iframe: 1,
map: 1,
object: 1,
option: 1,
param: 1,
script: 1,
textarea: 1,
video: 1
},
$object: {
applet: 1,
audio: 1,
button: 1,
hr: 1,
iframe: 1,
img: 1,
input: 1,
object: 1,
select: 1,
table: 1,
textarea: 1,
video: 1
},
$removeEmpty: {
abbr: 1,
acronym: 1,
b: 1,
bdi: 1,
bdo: 1,
big: 1,
cite: 1,
code: 1,
del: 1,
dfn: 1,
em: 1,
font: 1,
i: 1,
ins: 1,
label: 1,
kbd: 1,
mark: 1,
meter: 1,
output: 1,
q: 1,
ruby: 1,
s: 1,
samp: 1,
small: 1,
span: 1,
strike: 1,
strong: 1,
sub: 1,
sup: 1,
time: 1,
tt: 1,
u: 1,
"var": 1
},
$tabIndex: {
a: 1,
area: 1,
button: 1,
input: 1,
object: 1,
select: 1,
textarea: 1
},
$tableContent: {
caption: 1,
col: 1,
colgroup: 1,
tbody: 1,
td: 1,
tfoot: 1,
th: 1,
thead: 1,
tr: 1
},
$transparent: {
a: 1,
audio: 1,
canvas: 1,
del: 1,
ins: 1,
map: 1,
noscript: 1,
object: 1,
video: 1
},
$intermediate: {
caption: 1,
colgroup: 1,
dd: 1,
dt: 1,
figcaption: 1,
legend: 1,
li: 1,
optgroup: 1,
option: 1,
rp: 1,
rt: 1,
summary: 1,
tbody: 1,
td: 1,
tfoot: 1,
th: 1,
thead: 1,
tr: 1
}
});
return f
}(), CKEDITOR.dom.event = function(d) {
this.$ = d
}, CKEDITOR.dom.event.prototype = {
getKey: function() {
return this.$.keyCode || this.$.which
},
getKeystroke: function() {
var d = this.getKey();
if (this.$.ctrlKey || this.$.metaKey) d += CKEDITOR.CTRL;
this.$.shiftKey && (d += CKEDITOR.SHIFT);
this.$.altKey && (d += CKEDITOR.ALT);
return d
},
preventDefault: function(d) {
var f = this.$;
f.preventDefault ? f.preventDefault() : f.returnValue = !1;
d && this.stopPropagation()
},
stopPropagation: function() {
var d = this.$;
d.stopPropagation ? d.stopPropagation() :
d.cancelBubble = !0
},
getTarget: function() {
var d = this.$.target || this.$.srcElement;
return d ? new CKEDITOR.dom.node(d) : null
},
getPhase: function() {
return this.$.eventPhase || 2
},
getPageOffset: function() {
var d = this.getTarget().getDocument().$;
return {
x: this.$.pageX || this.$.clientX + (d.documentElement.scrollLeft || d.body.scrollLeft),
y: this.$.pageY || this.$.clientY + (d.documentElement.scrollTop || d.body.scrollTop)
}
}
}, CKEDITOR.CTRL = 1114112, CKEDITOR.SHIFT = 2228224, CKEDITOR.ALT = 4456448, CKEDITOR.EVENT_PHASE_CAPTURING = 1,
CKEDITOR.EVENT_PHASE_AT_TARGET = 2, CKEDITOR.EVENT_PHASE_BUBBLING = 3, CKEDITOR.dom.domObject = function(d) {
d && (this.$ = d)
}, CKEDITOR.dom.domObject.prototype = function() {
var d = function(d, c) {
return function(a) {
"undefined" != typeof CKEDITOR && d.fire(c, new CKEDITOR.dom.event(a))
}
};
return {
getPrivate: function() {
var d;
if (!(d = this.getCustomData("_"))) this.setCustomData("_", d = {});
return d
},
on: function(f) {
var c = this.getCustomData("_cke_nativeListeners");
c || (c = {}, this.setCustomData("_cke_nativeListeners", c));
c[f] || (c = c[f] =
d(this, f), this.$.addEventListener ? this.$.addEventListener(f, c, !!CKEDITOR.event.useCapture) : this.$.attachEvent && this.$.attachEvent("on" + f, c));
return CKEDITOR.event.prototype.on.apply(this, arguments)
},
removeListener: function(d) {
CKEDITOR.event.prototype.removeListener.apply(this, arguments);
if (!this.hasListeners(d)) {
var c = this.getCustomData("_cke_nativeListeners"),
a = c && c[d];
a && (this.$.removeEventListener ? this.$.removeEventListener(d, a, !1) : this.$.detachEvent && this.$.detachEvent("on" + d, a), delete c[d])
}
},
removeAllListeners: function() {
var d = this.getCustomData("_cke_nativeListeners"),
c;
for (c in d) {
var a = d[c];
this.$.detachEvent ? this.$.detachEvent("on" + c, a) : this.$.removeEventListener && this.$.removeEventListener(c, a, !1);
delete d[c]
}
}
}
}(),
function(d) {
var f = {};
CKEDITOR.on("reset", function() {
f = {}
});
d.equals = function(c) {
try {
return c && c.$ === this.$
} catch (a) {
return !1
}
};
d.setCustomData = function(c, a) {
var b = this.getUniqueId();
(f[b] || (f[b] = {}))[c] = a;
return this
};
d.getCustomData = function(c) {
var a = this.$["data-cke-expando"];
return (a = a && f[a]) && c in a ? a[c] : null
};
d.removeCustomData = function(c) {
var a = this.$["data-cke-expando"],
a = a && f[a],
b, e;
a && (b = a[c], e = c in a, delete a[c]);
return e ? b : null
};
d.clearCustomData = function() {
this.removeAllListeners();
var c = this.$["data-cke-expando"];
c && delete f[c]
};
d.getUniqueId = function() {
return this.$["data-cke-expando"] || (this.$["data-cke-expando"] = CKEDITOR.tools.getNextNumber())
};
CKEDITOR.event.implementOn(d)
}(CKEDITOR.dom.domObject.prototype), CKEDITOR.dom.node = function(d) {
return d ? new CKEDITOR.dom[d.nodeType ==
CKEDITOR.NODE_DOCUMENT ? "document" : d.nodeType == CKEDITOR.NODE_ELEMENT ? "element" : d.nodeType == CKEDITOR.NODE_TEXT ? "text" : d.nodeType == CKEDITOR.NODE_COMMENT ? "comment" : d.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT ? "documentFragment" : "domObject"](d) : this
}, CKEDITOR.dom.node.prototype = new CKEDITOR.dom.domObject, CKEDITOR.NODE_ELEMENT = 1, CKEDITOR.NODE_DOCUMENT = 9, CKEDITOR.NODE_TEXT = 3, CKEDITOR.NODE_COMMENT = 8, CKEDITOR.NODE_DOCUMENT_FRAGMENT = 11, CKEDITOR.POSITION_IDENTICAL = 0, CKEDITOR.POSITION_DISCONNECTED = 1, CKEDITOR.POSITION_FOLLOWING =
2, CKEDITOR.POSITION_PRECEDING = 4, CKEDITOR.POSITION_IS_CONTAINED = 8, CKEDITOR.POSITION_CONTAINS = 16, CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype, {
appendTo: function(d, f) {
d.append(this, f);
return d
},
clone: function(d, f) {
var c = this.$.cloneNode(d),
a = function(b) {
b["data-cke-expando"] && (b["data-cke-expando"] = !1);
if (b.nodeType == CKEDITOR.NODE_ELEMENT && (f || b.removeAttribute("id", !1), d)) {
b = b.childNodes;
for (var e = 0; e < b.length; e++) a(b[e])
}
};
a(c);
return new CKEDITOR.dom.node(c)
},
hasPrevious: function() {
return !!this.$.previousSibling
},
hasNext: function() {
return !!this.$.nextSibling
},
insertAfter: function(d) {
d.$.parentNode.insertBefore(this.$, d.$.nextSibling);
return d
},
insertBefore: function(d) {
d.$.parentNode.insertBefore(this.$, d.$);
return d
},
insertBeforeMe: function(d) {
this.$.parentNode.insertBefore(d.$, this.$);
return d
},
getAddress: function(d) {
for (var f = [], c = this.getDocument().$.documentElement, a = this.$; a && a != c;) {
var b = a.parentNode;
b && f.unshift(this.getIndex.call({
$: a
}, d));
a = b
}
return f
},
getDocument: function() {
return new CKEDITOR.dom.document(this.$.ownerDocument ||
this.$.parentNode.ownerDocument)
},
getIndex: function(d) {
var f = this.$,
c = -1,
a;
if (!this.$.parentNode) return c;
do
if (!d || !(f != this.$ && f.nodeType == CKEDITOR.NODE_TEXT && (a || !f.nodeValue))) c++, a = f.nodeType == CKEDITOR.NODE_TEXT;
while (f = f.previousSibling);
return c
},
getNextSourceNode: function(d, f, c) {
if (c && !c.call) {
var a = c;
c = function(b) {
return !b.equals(a)
}
}
d = !d && this.getFirst && this.getFirst();
var b;
if (!d) {
if (this.type == CKEDITOR.NODE_ELEMENT && c && !1 === c(this, !0)) return null;
d = this.getNext()
}
for (; !d && (b = (b || this).getParent());) {
if (c &&
!1 === c(b, !0)) return null;
d = b.getNext()
}
return !d || c && !1 === c(d) ? null : f && f != d.type ? d.getNextSourceNode(!1, f, c) : d
},
getPreviousSourceNode: function(d, f, c) {
if (c && !c.call) {
var a = c;
c = function(b) {
return !b.equals(a)
}
}
d = !d && this.getLast && this.getLast();
var b;
if (!d) {
if (this.type == CKEDITOR.NODE_ELEMENT && c && !1 === c(this, !0)) return null;
d = this.getPrevious()
}
for (; !d && (b = (b || this).getParent());) {
if (c && !1 === c(b, !0)) return null;
d = b.getPrevious()
}
return !d || c && !1 === c(d) ? null : f && d.type != f ? d.getPreviousSourceNode(!1, f, c) :
d
},
getPrevious: function(d) {
var f = this.$,
c;
do c = (f = f.previousSibling) && 10 != f.nodeType && new CKEDITOR.dom.node(f); while (c && d && !d(c));
return c
},
getNext: function(d) {
var f = this.$,
c;
do c = (f = f.nextSibling) && new CKEDITOR.dom.node(f); while (c && d && !d(c));
return c
},
getParent: function(d) {
var f = this.$.parentNode;
return f && (f.nodeType == CKEDITOR.NODE_ELEMENT || d && f.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) ? new CKEDITOR.dom.node(f) : null
},
getParents: function(d) {
var f = this,
c = [];
do c[d ? "push" : "unshift"](f); while (f = f.getParent());
return c
},
getCommonAncestor: function(d) {
if (d.equals(this)) return this;
if (d.contains && d.contains(this)) return d;
var f = this.contains ? this : this.getParent();
do
if (f.contains(d)) return f;
while (f = f.getParent());
return null
},
getPosition: function(d) {
var f = this.$,
c = d.$;
if (f.compareDocumentPosition) return f.compareDocumentPosition(c);
if (f == c) return CKEDITOR.POSITION_IDENTICAL;
if (this.type == CKEDITOR.NODE_ELEMENT && d.type == CKEDITOR.NODE_ELEMENT) {
if (f.contains) {
if (f.contains(c)) return CKEDITOR.POSITION_CONTAINS +
CKEDITOR.POSITION_PRECEDING;
if (c.contains(f)) return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
}
if ("sourceIndex" in f) return 0 > f.sourceIndex || 0 > c.sourceIndex ? CKEDITOR.POSITION_DISCONNECTED : f.sourceIndex < c.sourceIndex ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING
}
f = this.getAddress();
d = d.getAddress();
for (var c = Math.min(f.length, d.length), a = 0; a <= c - 1; a++)
if (f[a] != d[a]) {
if (a < c) return f[a] < d[a] ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING;
break
}
return f.length < d.length ?
CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
},
getAscendant: function(d, f) {
var c = this.$,
a;
f || (c = c.parentNode);
for (; c;) {
if (c.nodeName && (a = c.nodeName.toLowerCase(), "string" == typeof d ? a == d : a in d)) return new CKEDITOR.dom.node(c);
try {
c = c.parentNode
} catch (b) {
c = null
}
}
return null
},
hasAscendant: function(d, f) {
var c = this.$;
f || (c = c.parentNode);
for (; c;) {
if (c.nodeName && c.nodeName.toLowerCase() == d) return !0;
c = c.parentNode
}
return !1
},
move: function(d,
f) {
d.append(this.remove(), f)
},
remove: function(d) {
var f = this.$,
c = f.parentNode;
if (c) {
if (d)
for (; d = f.firstChild;) c.insertBefore(f.removeChild(d), f);
c.removeChild(f)
}
return this
},
replace: function(d) {
this.insertBefore(d);
d.remove()
},
trim: function() {
this.ltrim();
this.rtrim()
},
ltrim: function() {
for (var d; this.getFirst && (d = this.getFirst());) {
if (d.type == CKEDITOR.NODE_TEXT) {
var f = CKEDITOR.tools.ltrim(d.getText()),
c = d.getLength();
if (f) f.length < c && (d.split(c - f.length), this.$.removeChild(this.$.firstChild));
else {
d.remove();
continue
}
}
break
}
},
rtrim: function() {
for (var d; this.getLast && (d = this.getLast());) {
if (d.type == CKEDITOR.NODE_TEXT) {
var f = CKEDITOR.tools.rtrim(d.getText()),
c = d.getLength();
if (f) f.length < c && (d.split(f.length), this.$.lastChild.parentNode.removeChild(this.$.lastChild));
else {
d.remove();
continue
}
}
break
}
CKEDITOR.env.needsBrFiller && (d = this.$.lastChild) && 1 == d.type && "br" == d.nodeName.toLowerCase() && d.parentNode.removeChild(d)
},
isReadOnly: function() {
var d = this;
this.type != CKEDITOR.NODE_ELEMENT && (d = this.getParent());
if (d && "undefined" != typeof d.$.isContentEditable) return !(d.$.isContentEditable || d.data("cke-editable"));
for (; d && !d.data("cke-editable");) {
if ("false" == d.getAttribute("contentEditable")) return !0;
if ("true" == d.getAttribute("contentEditable")) break;
d = d.getParent()
}
return !d
}
}), CKEDITOR.dom.window = function(d) {
CKEDITOR.dom.domObject.call(this, d)
}, CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject, CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype, {
focus: function() {
this.$.focus()
},
getViewPaneSize: function() {
var d =
this.$.document,
f = "CSS1Compat" == d.compatMode;
return {
width: (f ? d.documentElement.clientWidth : d.body.clientWidth) || 0,
height: (f ? d.documentElement.clientHeight : d.body.clientHeight) || 0
}
},
getScrollPosition: function() {
var d = this.$;
if ("pageXOffset" in d) return {
x: d.pageXOffset || 0,
y: d.pageYOffset || 0
};
d = d.document;
return {
x: d.documentElement.scrollLeft || d.body.scrollLeft || 0,
y: d.documentElement.scrollTop || d.body.scrollTop || 0
}
},
getFrame: function() {
var d = this.$.frameElement;
return d ? new CKEDITOR.dom.element.get(d) :
null
}
}), CKEDITOR.dom.document = function(d) {
CKEDITOR.dom.domObject.call(this, d)
}, CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject, CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype, {
type: CKEDITOR.NODE_DOCUMENT,
appendStyleSheet: function(d) {
if (this.$.createStyleSheet) this.$.createStyleSheet(d);
else {
var f = new CKEDITOR.dom.element("link");
f.setAttributes({
rel: "stylesheet",
type: "text/css",
href: d
});
this.getHead().append(f)
}
},
appendStyleText: function(d) {
if (this.$.createStyleSheet) {
var f = this.$.createStyleSheet("");
f.cssText = d
} else {
var c = new CKEDITOR.dom.element("style", this);
c.append(new CKEDITOR.dom.text(d, this));
this.getHead().append(c)
}
return f || c.$.sheet
},
createElement: function(d, f) {
var c = new CKEDITOR.dom.element(d, this);
f && (f.attributes && c.setAttributes(f.attributes), f.styles && c.setStyles(f.styles));
return c
},
createText: function(d) {
return new CKEDITOR.dom.text(d, this)
},
focus: function() {
this.getWindow().focus()
},
getActive: function() {
return new CKEDITOR.dom.element(this.$.activeElement)
},
getById: function(d) {
return (d =
this.$.getElementById(d)) ? new CKEDITOR.dom.element(d) : null
},
getByAddress: function(d, f) {
for (var c = this.$.documentElement, a = 0; c && a < d.length; a++) {
var b = d[a];
if (f)
for (var e = -1, g = 0; g < c.childNodes.length; g++) {
var k = c.childNodes[g];
if (!(!0 === f && 3 == k.nodeType && k.previousSibling && 3 == k.previousSibling.nodeType) && (e++, e == b)) {
c = k;
break
}
} else c = c.childNodes[b]
}
return c ? new CKEDITOR.dom.node(c) : null
},
getElementsByTag: function(d, f) {
if ((!CKEDITOR.env.ie || 8 < document.documentMode) && f) d = f + ":" + d;
return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(d))
},
getHead: function() {
var d = this.$.getElementsByTagName("head")[0];
return d ? new CKEDITOR.dom.element(d) : this.getDocumentElement().append(new CKEDITOR.dom.element("head"), !0)
},
getBody: function() {
return new CKEDITOR.dom.element(this.$.body)
},
getDocumentElement: function() {
return new CKEDITOR.dom.element(this.$.documentElement)
},
getWindow: function() {
return new CKEDITOR.dom.window(this.$.parentWindow || this.$.defaultView)
},
write: function(d) {
this.$.open("text/html", "replace");
CKEDITOR.env.ie && (d = d.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,
'$&\n<script data-cke-temp="1">(' + CKEDITOR.tools.fixDomain + ")();\x3c/script>"));
this.$.write(d);
this.$.close()
},
find: function(d) {
return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(d))
},
findOne: function(d) {
return (d = this.$.querySelector(d)) ? new CKEDITOR.dom.element(d) : null
},
_getHtml5ShivFrag: function() {
var d = this.getCustomData("html5ShivFrag");
d || (d = this.$.createDocumentFragment(), CKEDITOR.tools.enableHtml5Elements(d, !0), this.setCustomData("html5ShivFrag", d));
return d
}
}), CKEDITOR.dom.nodeList =
function(d) {
this.$ = d
}, CKEDITOR.dom.nodeList.prototype = {
count: function() {
return this.$.length
},
getItem: function(d) {
return 0 > d || d >= this.$.length ? null : (d = this.$[d]) ? new CKEDITOR.dom.node(d) : null
}
}, CKEDITOR.dom.element = function(d, f) {
"string" == typeof d && (d = (f ? f.$ : document).createElement(d));
CKEDITOR.dom.domObject.call(this, d)
}, CKEDITOR.dom.element.get = function(d) {
return (d = "string" == typeof d ? document.getElementById(d) || document.getElementsByName(d)[0] : d) && (d.$ ? d : new CKEDITOR.dom.element(d))
}, CKEDITOR.dom.element.prototype =
new CKEDITOR.dom.node, CKEDITOR.dom.element.createFromHtml = function(d, f) {
var c = new CKEDITOR.dom.element("div", f);
c.setHtml(d);
return c.getFirst().remove()
}, CKEDITOR.dom.element.setMarker = function(d, f, c, a) {
var b = f.getCustomData("list_marker_id") || f.setCustomData("list_marker_id", CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),
e = f.getCustomData("list_marker_names") || f.setCustomData("list_marker_names", {}).getCustomData("list_marker_names");
d[b] = f;
e[c] = 1;
return f.setCustomData(c, a)
}, CKEDITOR.dom.element.clearAllMarkers =
function(d) {
for (var f in d) CKEDITOR.dom.element.clearMarkers(d, d[f], 1)
}, CKEDITOR.dom.element.clearMarkers = function(d, f, c) {
var a = f.getCustomData("list_marker_names"),
b = f.getCustomData("list_marker_id"),
e;
for (e in a) f.removeCustomData(e);
f.removeCustomData("list_marker_names");
c && (f.removeCustomData("list_marker_id"), delete d[b])
},
function() {
function d(b) {
var a = !0;
b.$.id || (b.$.id = "cke_tmp_" + CKEDITOR.tools.getNextNumber(), a = !1);
return function() {
a || b.removeAttribute("id")
}
}
function f(b, a) {
return "#" +
b.$.id + " " + a.split(/,\s*/).join(", #" + b.$.id + " ")
}
function c(b) {
for (var e = 0, c = 0, d = a[b].length; c < d; c++) e += parseInt(this.getComputedStyle(a[b][c]) || 0, 10) || 0;
return e
}
CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype, {
type: CKEDITOR.NODE_ELEMENT,
addClass: function(b) {
var a = this.$.className;
a && (RegExp("(?:^|\\s)" + b + "(?:\\s|$)", "").test(a) || (a += " " + b));
this.$.className = a || b
},
removeClass: function(b) {
var a = this.getAttribute("class");
a && (b = RegExp("(?:^|\\s+)" + b + "(?=\\s|$)", "i"), b.test(a) && ((a = a.replace(b,
"").replace(/^\s+/, "")) ? this.setAttribute("class", a) : this.removeAttribute("class")));
return this
},
hasClass: function(b) {
return RegExp("(?:^|\\s+)" + b + "(?=\\s|$)", "").test(this.getAttribute("class"))
},
append: function(b, a) {
"string" == typeof b && (b = this.getDocument().createElement(b));
a ? this.$.insertBefore(b.$, this.$.firstChild) : this.$.appendChild(b.$);
return b
},
appendHtml: function(b) {
if (this.$.childNodes.length) {
var a = new CKEDITOR.dom.element("div", this.getDocument());
a.setHtml(b);
a.moveChildren(this)
} else this.setHtml(b)
},
appendText: function(b) {
void 0 != this.$.text ? this.$.text += b : this.append(new CKEDITOR.dom.text(b))
},
appendBogus: function(b) {
if (b || CKEDITOR.env.needsBrFiller || CKEDITOR.env.opera) {
for (b = this.getLast(); b && b.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim(b.getText());) b = b.getPrevious();
if (!b || !b.is || !b.is("br")) b = CKEDITOR.env.opera ? this.getDocument().createText("") : this.getDocument().createElement("br"), CKEDITOR.env.gecko && b.setAttribute("type", "_moz"), this.append(b)
}
},
breakParent: function(b) {
var a = new CKEDITOR.dom.range(this.getDocument());
a.setStartAfter(this);
a.setEndAfter(b);
b = a.extractContents();
a.insertNode(this.remove());
b.insertAfterNode(this)
},
contains: CKEDITOR.env.ie || CKEDITOR.env.webkit ? function(b) {
var a = this.$;
return b.type != CKEDITOR.NODE_ELEMENT ? a.contains(b.getParent().$) : a != b.$ && a.contains(b.$)
} : function(b) {
return !!(this.$.compareDocumentPosition(b.$) & 16)
},
focus: function() {
function b() {
try {
this.$.focus()
} catch (b) {}
}
return function(a) {
a ? CKEDITOR.tools.setTimeout(b, 100, this) : b.call(this)
}
}(),
getHtml: function() {
var b = this.$.innerHTML;
return CKEDITOR.env.ie ? b.replace(/<\?[^>]*>/g, "") : b
},
getOuterHtml: function() {
if (this.$.outerHTML) return this.$.outerHTML.replace(/<\?[^>]*>/, "");
var b = this.$.ownerDocument.createElement("div");
b.appendChild(this.$.cloneNode(!0));
return b.innerHTML
},
getClientRect: function() {
var b = CKEDITOR.tools.extend({}, this.$.getBoundingClientRect());
!b.width && (b.width = b.right - b.left);
!b.height && (b.height = b.bottom - b.top);
return b
},
setHtml: CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? function(b) {
try {
var a = this.$;
if (this.getParent()) return a.innerHTML =
b;
var c = this.getDocument()._getHtml5ShivFrag();
c.appendChild(a);
a.innerHTML = b;
c.removeChild(a);
return b
} catch (d) {
this.$.innerHTML = "";
a = new CKEDITOR.dom.element("body", this.getDocument());
a.$.innerHTML = b;
for (a = a.getChildren(); a.count();) this.append(a.getItem(0));
return b
}
} : function(b) {
return this.$.innerHTML = b
},
setText: function(b) {
CKEDITOR.dom.element.prototype.setText = void 0 != this.$.innerText ? function(b) {
return this.$.innerText = b
} : function(b) {
return this.$.textContent = b
};
return this.setText(b)
},
getAttribute: function() {
var b =
function(b) {
return this.$.getAttribute(b, 2)
};
return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) ? function(b) {
switch (b) {
case "class":
b = "className";
break;
case "http-equiv":
b = "httpEquiv";
break;
case "name":
return this.$.name;
case "tabindex":
return b = this.$.getAttribute(b, 2), 0 !== b && 0 === this.$.tabIndex && (b = null), b;
case "checked":
return b = this.$.attributes.getNamedItem(b), (b.specified ? b.nodeValue : this.$.checked) ? "checked" : null;
case "hspace":
case "value":
return this.$[b];
case "style":
return this.$.style.cssText;
case "contenteditable":
case "contentEditable":
return this.$.attributes.getNamedItem("contentEditable").specified ? this.$.getAttribute("contentEditable") : null
}
return this.$.getAttribute(b, 2)
} : b
}(),
getChildren: function() {
return new CKEDITOR.dom.nodeList(this.$.childNodes)
},
getComputedStyle: CKEDITOR.env.ie ? function(b) {
return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(b)]
} : function(b) {
var a = this.getWindow().$.getComputedStyle(this.$, null);
return a ? a.getPropertyValue(b) : ""
},
getDtd: function() {
var b =
CKEDITOR.dtd[this.getName()];
this.getDtd = function() {
return b
};
return b
},
getElementsByTag: CKEDITOR.dom.document.prototype.getElementsByTag,
getTabIndex: CKEDITOR.env.ie ? function() {
var b = this.$.tabIndex;
0 === b && !CKEDITOR.dtd.$tabIndex[this.getName()] && 0 !== parseInt(this.getAttribute("tabindex"), 10) && (b = -1);
return b
} : CKEDITOR.env.webkit ? function() {
var b = this.$.tabIndex;
void 0 == b && (b = parseInt(this.getAttribute("tabindex"), 10), isNaN(b) && (b = -1));
return b
} : function() {
return this.$.tabIndex
},
getText: function() {
return this.$.textContent ||
this.$.innerText || ""
},
getWindow: function() {
return this.getDocument().getWindow()
},
getId: function() {
return this.$.id || null
},
getNameAtt: function() {
return this.$.name || null
},
getName: function() {
var b = this.$.nodeName.toLowerCase();
if (CKEDITOR.env.ie && !(8 < document.documentMode)) {
var a = this.$.scopeName;
"HTML" != a && (b = a.toLowerCase() + ":" + b)
}
return (this.getName = function() {
return b
})()
},
getValue: function() {
return this.$.value
},
getFirst: function(b) {
var a = this.$.firstChild;
(a = a && new CKEDITOR.dom.node(a)) && b &&
!b(a) && (a = a.getNext(b));
return a
},
getLast: function(b) {
var a = this.$.lastChild;
(a = a && new CKEDITOR.dom.node(a)) && b && !b(a) && (a = a.getPrevious(b));
return a
},
getStyle: function(b) {
return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(b)]
},
is: function() {
var b = this.getName();
if ("object" == typeof arguments[0]) return !!arguments[0][b];
for (var a = 0; a < arguments.length; a++)
if (arguments[a] == b) return !0;
return !1
},
isEditable: function(b) {
var a = this.getName();
return this.isReadOnly() || "none" == this.getComputedStyle("display") ||
"hidden" == this.getComputedStyle("visibility") || CKEDITOR.dtd.$nonEditable[a] || CKEDITOR.dtd.$empty[a] || this.is("a") && (this.data("cke-saved-name") || this.hasAttribute("name")) && !this.getChildCount() ? !1 : !1 !== b ? (b = CKEDITOR.dtd[a] || CKEDITOR.dtd.span, !(!b || !b["#"])) : !0
},
isIdentical: function(b) {
var a = this.clone(0, 1);
b = b.clone(0, 1);
a.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
b.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
if (a.$.isEqualNode) return a.$.style.cssText = CKEDITOR.tools.normalizeCssText(a.$.style.cssText), b.$.style.cssText = CKEDITOR.tools.normalizeCssText(b.$.style.cssText), a.$.isEqualNode(b.$);
a = a.getOuterHtml();
b = b.getOuterHtml();
if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version && this.is("a")) {
var c = this.getParent();
c.type == CKEDITOR.NODE_ELEMENT && (c = c.clone(), c.setHtml(a), a = c.getHtml(), c.setHtml(b), b = c.getHtml())
}
return a == b
},
isVisible: function() {
var b = (this.$.offsetHeight || this.$.offsetWidth) && "hidden" != this.getComputedStyle("visibility"),
a, c;
if (b && (CKEDITOR.env.webkit || CKEDITOR.env.opera))
if (a = this.getWindow(), !a.equals(CKEDITOR.document.getWindow()) && (c = a.$.frameElement)) b = (new CKEDITOR.dom.element(c)).isVisible();
return !!b
},
isEmptyInlineRemoveable: function() {
if (!CKEDITOR.dtd.$removeEmpty[this.getName()]) return !1;
for (var b = this.getChildren(), a = 0, c = b.count(); a < c; a++) {
var d = b.getItem(a);
if (!(d.type == CKEDITOR.NODE_ELEMENT && d.data("cke-bookmark")) && (d.type == CKEDITOR.NODE_ELEMENT && !d.isEmptyInlineRemoveable() || d.type == CKEDITOR.NODE_TEXT &&
CKEDITOR.tools.trim(d.getText()))) return !1
}
return !0
},
hasAttributes: CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) ? function() {
for (var b = this.$.attributes, a = 0; a < b.length; a++) {
var c = b[a];
switch (c.nodeName) {
case "class":
if (this.getAttribute("class")) return !0;
case "data-cke-expando":
continue;
default:
if (c.specified) return !0
}
}
return !1
} : function() {
var b = this.$.attributes,
a = b.length,
c = {
"data-cke-expando": 1,
_moz_dirty: 1
};
return 0 < a && (2 < a || !c[b[0].nodeName] || 2 == a && !c[b[1].nodeName])
},
hasAttribute: function() {
function b(b) {
b =
this.$.attributes.getNamedItem(b);
return !(!b || !b.specified)
}
return CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? function(a) {
return "name" == a ? !!this.$.name : b.call(this, a)
} : b
}(),
hide: function() {
this.setStyle("display", "none")
},
moveChildren: function(b, a) {
var c = this.$;
b = b.$;
if (c != b) {
var d;
if (a)
for (; d = c.lastChild;) b.insertBefore(c.removeChild(d), b.firstChild);
else
for (; d = c.firstChild;) b.appendChild(c.removeChild(d))
}
},
mergeSiblings: function() {
function b(b, a, c) {
if (a && a.type == CKEDITOR.NODE_ELEMENT) {
for (var d = []; a.data("cke-bookmark") || a.isEmptyInlineRemoveable();)
if (d.push(a), a = c ? a.getNext() : a.getPrevious(), !a || a.type != CKEDITOR.NODE_ELEMENT) return;
if (b.isIdentical(a)) {
for (var l = c ? b.getLast() : b.getFirst(); d.length;) d.shift().move(b, !c);
a.moveChildren(b, !c);
a.remove();
l && l.type == CKEDITOR.NODE_ELEMENT && l.mergeSiblings()
}
}
}
return function(a) {
if (!1 === a || CKEDITOR.dtd.$removeEmpty[this.getName()] || this.is("a")) b(this, this.getNext(), !0), b(this, this.getPrevious())
}
}(),
show: function() {
this.setStyles({
display: "",
visibility: ""
})
},
setAttribute: function() {
var b = function(b, a) {
this.$.setAttribute(b, a);
return this
};
return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) ? function(a, c) {
"class" == a ? this.$.className = c : "style" == a ? this.$.style.cssText = c : "tabindex" == a ? this.$.tabIndex = c : "checked" == a ? this.$.checked = c : "contenteditable" == a ? b.call(this, "contentEditable", c) : b.apply(this, arguments);
return this
} : CKEDITOR.env.ie8Compat && CKEDITOR.env.secure ? function(a, c) {
if ("src" == a && c.match(/^http:\/\//)) try {
b.apply(this,
arguments)
} catch (d) {} else b.apply(this, arguments);
return this
} : b
}(),
setAttributes: function(b) {
for (var a in b) this.setAttribute(a, b[a]);
return this
},
setValue: function(b) {
this.$.value = b;
return this
},
removeAttribute: function() {
var b = function(b) {
this.$.removeAttribute(b)
};
return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) ? function(b) {
"class" == b ? b = "className" : "tabindex" == b ? b = "tabIndex" : "contenteditable" == b && (b = "contentEditable");
this.$.removeAttribute(b)
} : b
}(),
removeAttributes: function(b) {
if (CKEDITOR.tools.isArray(b))
for (var a =
0; a < b.length; a++) this.removeAttribute(b[a]);
else
for (a in b) b.hasOwnProperty(a) && this.removeAttribute(a)
},
removeStyle: function(b) {
var a = this.$.style;
if (!a.removeProperty && ("border" == b || "margin" == b || "padding" == b)) {
var c = ["top", "left", "right", "bottom"],
d;
"border" == b && (d = ["color", "style", "width"]);
for (var a = [], h = 0; h < c.length; h++)
if (d)
for (var l = 0; l < d.length; l++) a.push([b, c[h], d[l]].join("-"));
else a.push([b, c[h]].join("-"));
for (b = 0; b < a.length; b++) this.removeStyle(a[b])
} else a.removeProperty ? a.removeProperty(b) :
a.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(b)), this.$.style.cssText || this.removeAttribute("style")
},
setStyle: function(b, a) {
this.$.style[CKEDITOR.tools.cssStyleToDomStyle(b)] = a;
return this
},
setStyles: function(b) {
for (var a in b) this.setStyle(a, b[a]);
return this
},
setOpacity: function(b) {
CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? (b = Math.round(100 * b), this.setStyle("filter", 100 <= b ? "" : "progid:DXImageTransform.Microsoft.Alpha(opacity=" + b + ")")) : this.setStyle("opacity", b)
},
unselectable: function() {
this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select",
"none"));
if (CKEDITOR.env.ie || CKEDITOR.env.opera) {
this.setAttribute("unselectable", "on");
for (var b, a = this.getElementsByTag("*"), c = 0, d = a.count(); c < d; c++) b = a.getItem(c), b.setAttribute("unselectable", "on")
}
},
getPositionedAncestor: function() {
for (var b = this;
"html" != b.getName();) {
if ("static" != b.getComputedStyle("position")) return b;
b = b.getParent()
}
return null
},
getDocumentPosition: function(b) {
var a = 0,
c = 0,
d = this.getDocument(),
h = d.getBody(),
l = "BackCompat" == d.$.compatMode;
if (document.documentElement.getBoundingClientRect) {
var n =
this.$.getBoundingClientRect(),
f = d.$.documentElement,
r = f.clientTop || h.$.clientTop || 0,
u = f.clientLeft || h.$.clientLeft || 0,
m = !0;
CKEDITOR.env.ie && (m = d.getDocumentElement().contains(this), d = d.getBody().contains(this), m = l && d || !l && m);
m && (a = n.left + (!l && f.scrollLeft || h.$.scrollLeft), a -= u, c = n.top + (!l && f.scrollTop || h.$.scrollTop), c -= r)
} else {
h = this;
for (d = null; h && !("body" == h.getName() || "html" == h.getName());) {
a += h.$.offsetLeft - h.$.scrollLeft;
c += h.$.offsetTop - h.$.scrollTop;
h.equals(this) || (a += h.$.clientLeft || 0, c +=
h.$.clientTop || 0);
for (; d && !d.equals(h);) a -= d.$.scrollLeft, c -= d.$.scrollTop, d = d.getParent();
d = h;
h = (n = h.$.offsetParent) ? new CKEDITOR.dom.element(n) : null
}
}
b && (h = this.getWindow(), d = b.getWindow(), !h.equals(d) && h.$.frameElement && (b = (new CKEDITOR.dom.element(h.$.frameElement)).getDocumentPosition(b), a += b.x, c += b.y));
!document.documentElement.getBoundingClientRect && (CKEDITOR.env.gecko && !l) && (a += this.$.clientLeft ? 1 : 0, c += this.$.clientTop ? 1 : 0);
return {
x: a,
y: c
}
},
scrollIntoView: function(b) {
var a = this.getParent();
if (a) {
do
if ((a.$.clientWidth && a.$.clientWidth < a.$.scrollWidth || a.$.clientHeight && a.$.clientHeight < a.$.scrollHeight) && !a.is("body") && this.scrollIntoParent(a, b, 1), a.is("html")) {
var c = a.getWindow();
try {
var d = c.$.frameElement;
d && (a = new CKEDITOR.dom.element(d))
} catch (h) {}
}
while (a = a.getParent())
}
},
scrollIntoParent: function(a, c, d) {
function k(c, d) {
/body|html/.test(a.getName()) ? a.getWindow().$.scrollBy(c, d) : (a.$.scrollLeft += c, a.$.scrollTop += d)
}
function h(a, b) {
var c = {
x: 0,
y: 0
};
if (!a.is(m ? "body" : "html")) {
var d =
a.$.getBoundingClientRect();
c.x = d.left;
c.y = d.top
}
d = a.getWindow();
d.equals(b) || (d = h(CKEDITOR.dom.element.get(d.$.frameElement), b), c.x += d.x, c.y += d.y);
return c
}
function l(a, b) {
return parseInt(a.getComputedStyle("margin-" + b) || 0, 10) || 0
}
var n, f, r, u;
!a && (a = this.getWindow());
r = a.getDocument();
var m = "BackCompat" == r.$.compatMode;
a instanceof CKEDITOR.dom.window && (a = m ? r.getBody() : r.getDocumentElement());
r = a.getWindow();
f = h(this, r);
var p = h(a, r),
w = this.$.offsetHeight;
n = this.$.offsetWidth;
var t = a.$.clientHeight,
x = a.$.clientWidth;
r = f.x - l(this, "left") - p.x || 0;
u = f.y - l(this, "top") - p.y || 0;
n = f.x + n + l(this, "right") - (p.x + x) || 0;
f = f.y + w + l(this, "bottom") - (p.y + t) || 0;
if (0 > u || 0 < f) k(0, !0 === c ? u : !1 === c ? f : 0 > u ? u : f);
if (d && (0 > r || 0 < n)) k(0 > r ? r : n, 0)
},
setState: function(a, c, d) {
c = c || "cke";
switch (a) {
case CKEDITOR.TRISTATE_ON:
this.addClass(c + "_on");
this.removeClass(c + "_off");
this.removeClass(c + "_disabled");
d && this.setAttribute("aria-pressed", !0);
d && this.removeAttribute("aria-disabled");
break;
case CKEDITOR.TRISTATE_DISABLED:
this.addClass(c +
"_disabled");
this.removeClass(c + "_off");
this.removeClass(c + "_on");
d && this.setAttribute("aria-disabled", !0);
d && this.removeAttribute("aria-pressed");
break;
default:
this.addClass(c + "_off"), this.removeClass(c + "_on"), this.removeClass(c + "_disabled"), d && this.removeAttribute("aria-pressed"), d && this.removeAttribute("aria-disabled")
}
},
getFrameDocument: function() {
var a = this.$;
try {
a.contentWindow.document
} catch (c) {
a.src = a.src
}
return a && new CKEDITOR.dom.document(a.contentWindow.document)
},
copyAttributes: function(a,
c) {
var d = this.$.attributes;
c = c || {};
for (var k = 0; k < d.length; k++) {
var h = d[k],
l = h.nodeName.toLowerCase(),
n;
if (!(l in c))
if ("checked" == l && (n = this.getAttribute(l))) a.setAttribute(l, n);
else if (h.specified || CKEDITOR.env.ie && h.nodeValue && "value" == l) n = this.getAttribute(l), null === n && (n = h.nodeValue), a.setAttribute(l, n)
}
"" !== this.$.style.cssText && (a.$.style.cssText = this.$.style.cssText)
},
renameNode: function(a) {
if (this.getName() != a) {
var c = this.getDocument();
a = new CKEDITOR.dom.element(a, c);
this.copyAttributes(a);
this.moveChildren(a);
this.getParent() && this.$.parentNode.replaceChild(a.$, this.$);
a.$["data-cke-expando"] = this.$["data-cke-expando"];
this.$ = a.$
}
},
getChild: function() {
function a(b, c) {
var d = b.childNodes;
if (0 <= c && c < d.length) return d[c]
}
return function(c) {
var d = this.$;
if (c.slice)
for (; 0 < c.length && d;) d = a(d, c.shift());
else d = a(d, c);
return d ? new CKEDITOR.dom.node(d) : null
}
}(),
getChildCount: function() {
return this.$.childNodes.length
},
disableContextMenu: function() {
this.on("contextmenu", function(a) {
a.data.getTarget().hasClass("cke_enable_context_menu") ||
a.data.preventDefault()
})
},
getDirection: function(a) {
return a ? this.getComputedStyle("direction") || this.getDirection() || this.getParent() && this.getParent().getDirection(1) || this.getDocument().$.dir || "ltr" : this.getStyle("direction") || this.getAttribute("dir")
},
data: function(a, c) {
a = "data-" + a;
if (void 0 === c) return this.getAttribute(a);
!1 === c ? this.removeAttribute(a) : this.setAttribute(a, c);
return null
},
getEditor: function() {
var a = CKEDITOR.instances,
c, d;
for (c in a)
if (d = a[c], d.element.equals(this) && d.elementMode !=
CKEDITOR.ELEMENT_MODE_APPENDTO) return d;
return null
},
find: function(a) {
var c = d(this);
a = new CKEDITOR.dom.nodeList(this.$.querySelectorAll(f(this, a)));
c();
return a
},
findOne: function(a) {
var c = d(this);
a = this.$.querySelector(f(this, a));
c();
return a ? new CKEDITOR.dom.element(a) : null
},
forEach: function(a, c, d) {
if (!d && (!c || this.type == c)) var k = a(this);
if (!1 !== k) {
d = this.getChildren();
for (var h = 0; h < d.count(); h++) k = d.getItem(h), k.type == CKEDITOR.NODE_ELEMENT ? k.forEach(a, c) : (!c || k.type == c) && a(k)
}
}
});
var a = {
width: ["border-left-width",
"border-right-width", "padding-left", "padding-right"
],
height: ["border-top-width", "border-bottom-width", "padding-top", "padding-bottom"]
};
CKEDITOR.dom.element.prototype.setSize = function(a, d, g) {
if ("number" == typeof d) {
if (g && (!CKEDITOR.env.ie || !CKEDITOR.env.quirks)) d -= c.call(this, a);
this.setStyle(a, d + "px")
}
};
CKEDITOR.dom.element.prototype.getSize = function(a, d) {
var g = Math.max(this.$["offset" + CKEDITOR.tools.capitalize(a)], this.$["client" + CKEDITOR.tools.capitalize(a)]) || 0;
d && (g -= c.call(this, a));
return g
}
}(),
CKEDITOR.dom.documentFragment = function(d) {
d = d || CKEDITOR.document;
this.$ = d.type == CKEDITOR.NODE_DOCUMENT ? d.$.createDocumentFragment() : d
}, CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.element.prototype, {
type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
insertAfterNode: function(d) {
d = d.$;
d.parentNode.insertBefore(this.$, d.nextSibling)
}
}, !0, {
append: 1,
appendBogus: 1,
getFirst: 1,
getLast: 1,
getParent: 1,
getNext: 1,
getPrevious: 1,
appendTo: 1,
moveChildren: 1,
insertBefore: 1,
insertAfterNode: 1,
replace: 1,
trim: 1,
type: 1,
ltrim: 1,
rtrim: 1,
getDocument: 1,
getChildCount: 1,
getChild: 1,
getChildren: 1
}),
function() {
function d(a, b) {
var c = this.range;
if (this._.end) return null;
if (!this._.start) {
this._.start = 1;
if (c.collapsed) return this.end(), null;
c.optimize()
}
var d, n = c.startContainer;
d = c.endContainer;
var e = c.startOffset,
h = c.endOffset,
g, k = this.guard,
l = this.type,
f = a ? "getPreviousSourceNode" : "getNextSourceNode";
if (!a && !this._.guardLTR) {
var s = d.type == CKEDITOR.NODE_ELEMENT ? d : d.getParent(),
v = d.type == CKEDITOR.NODE_ELEMENT ?
d.getChild(h) : d.getNext();
this._.guardLTR = function(a, b) {
return (!b || !s.equals(a)) && (!v || !a.equals(v)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root))
}
}
if (a && !this._.guardRTL) {
var G = n.type == CKEDITOR.NODE_ELEMENT ? n : n.getParent(),
A = n.type == CKEDITOR.NODE_ELEMENT ? e ? n.getChild(e - 1) : null : n.getPrevious();
this._.guardRTL = function(a, b) {
return (!b || !G.equals(a)) && (!A || !a.equals(A)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root))
}
}
var D = a ? this._.guardRTL : this._.guardLTR;
g = k ? function(a, b) {
return !1 ===
D(a, b) ? !1 : k(a, b)
} : D;
if (this.current) d = this.current[f](!1, l, g);
else {
if (a) d.type == CKEDITOR.NODE_ELEMENT && (d = 0 < h ? d.getChild(h - 1) : !1 === g(d, !0) ? null : d.getPreviousSourceNode(!0, l, g));
else if (d = n, d.type == CKEDITOR.NODE_ELEMENT && !(d = d.getChild(e))) d = !1 === g(n, !0) ? null : n.getNextSourceNode(!0, l, g);
d && !1 === g(d) && (d = null)
}
for (; d && !this._.end;) {
this.current = d;
if (!this.evaluator || !1 !== this.evaluator(d)) {
if (!b) return d
} else if (b && this.evaluator) return !1;
d = d[f](!1, l, g)
}
this.end();
return this.current = null
}
function f(a) {
for (var b,
c = null; b = d.call(this, a);) c = b;
return c
}
function c(a) {
if (l(a)) return !1;
if (a.type == CKEDITOR.NODE_TEXT) return !0;
if (a.type == CKEDITOR.NODE_ELEMENT) {
if (a.is(CKEDITOR.dtd.$inline) || "false" == a.getAttribute("contenteditable")) return !0;
var b;
if (b = !CKEDITOR.env.needsBrFiller)
if (b = a.is(n)) a: {
b = 0;
for (var c = a.getChildCount(); b < c; ++b)
if (!l(a.getChild(b))) {
b = !1;
break a
}
b = !0
}
if (b) return !0
}
return !1
}
CKEDITOR.dom.walker = CKEDITOR.tools.createClass({
$: function(a) {
this.range = a;
this._ = {}
},
proto: {
end: function() {
this._.end =
1
},
next: function() {
return d.call(this)
},
previous: function() {
return d.call(this, 1)
},
checkForward: function() {
return !1 !== d.call(this, 0, 1)
},
checkBackward: function() {
return !1 !== d.call(this, 1, 1)
},
lastForward: function() {
return f.call(this)
},
lastBackward: function() {
return f.call(this, 1)
},
reset: function() {
delete this.current;
this._ = {}
}
}
});
var a = {
block: 1,
"list-item": 1,
table: 1,
"table-row-group": 1,
"table-header-group": 1,
"table-footer-group": 1,
"table-row": 1,
"table-column-group": 1,
"table-column": 1,
"table-cell": 1,
"table-caption": 1
},
b = {
absolute: 1,
fixed: 1
};
CKEDITOR.dom.element.prototype.isBlockBoundary = function(c) {
return "none" == this.getComputedStyle("float") && !(this.getComputedStyle("position") in b) && a[this.getComputedStyle("display")] ? !0 : !!(this.is(CKEDITOR.dtd.$block) || c && this.is(c))
};
CKEDITOR.dom.walker.blockBoundary = function(a) {
return function(b) {
return !(b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary(a))
}
};
CKEDITOR.dom.walker.listItemBoundary = function() {
return this.blockBoundary({
br: 1
})
};
CKEDITOR.dom.walker.bookmark =
function(a, b) {
function c(a) {
return a && a.getName && "span" == a.getName() && a.data("cke-bookmark")
}
return function(d) {
var n, e;
n = d && d.type != CKEDITOR.NODE_ELEMENT && (e = d.getParent()) && c(e);
n = a ? n : n || c(d);
return !!(b ^ n)
}
};
CKEDITOR.dom.walker.whitespaces = function(a) {
return function(b) {
var c;
b && b.type == CKEDITOR.NODE_TEXT && (c = !CKEDITOR.tools.trim(b.getText()) || CKEDITOR.env.webkit && "\u200b" == b.getText());
return !!(a ^ c)
}
};
CKEDITOR.dom.walker.invisible = function(a) {
var b = CKEDITOR.dom.walker.whitespaces(),
b = CKEDITOR.dom.walker.whitespaces(),
c = CKEDITOR.env.webkit ? 1 : 0;
return function(d) {
b(d) ? d = 1 : (d.type == CKEDITOR.NODE_TEXT && (d = d.getParent()), d = d.$.offsetWidth <= c);
return !!(a ^ d)
}
};
CKEDITOR.dom.walker.nodeType = function(a, b) {
return function(c) {
return !!(b ^ c.type == a)
}
};
CKEDITOR.dom.walker.bogus = function(a) {
function b(a) {
return !g(a) && !k(a)
}
return function(c) {
var d = CKEDITOR.env.needsBrFiller ? c.is && c.is("br") : c.getText && e.test(c.getText());
d && (d = c.getParent(), c = c.getNext(b), d = d.isBlockBoundary() && (!c || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary()));
return !!(a ^ d)
}
};
CKEDITOR.dom.walker.temp = function(a) {
return function(b) {
b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent());
b = b && b.hasAttribute("data-cke-temp");
return !!(a ^ b)
}
};
var e = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
g = CKEDITOR.dom.walker.whitespaces(),
k = CKEDITOR.dom.walker.bookmark(),
h = CKEDITOR.dom.walker.temp();
CKEDITOR.dom.walker.ignored = function(a) {
return function(b) {
b = g(b) || k(b) || h(b);
return !!(a ^ b)
}
};
var l = CKEDITOR.dom.walker.ignored(),
n = function(a) {
var b = {},
c;
for (c in a) CKEDITOR.dtd[c]["#"] && (b[c] =
1);
return b
}(CKEDITOR.dtd.$block);
CKEDITOR.dom.walker.editable = function(a) {
return function(b) {
return !!(a ^ c(b))
}
};
CKEDITOR.dom.element.prototype.getBogus = function() {
var a = this;
do a = a.getPreviousSourceNode(); while (k(a) || g(a) || a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$inline) && !a.is(CKEDITOR.dtd.$empty));
return a && (CKEDITOR.env.needsBrFiller ? a.is && a.is("br") : a.getText && e.test(a.getText())) ? a : !1
}
}(), CKEDITOR.dom.range = function(d) {
this.endOffset = this.endContainer = this.startOffset = this.startContainer =
null;
this.collapsed = !0;
var f = d instanceof CKEDITOR.dom.document;
this.document = f ? d : d.getDocument();
this.root = f ? d.getBody() : d
},
function() {
function d() {
var a = !1,
b = CKEDITOR.dom.walker.whitespaces(),
c = CKEDITOR.dom.walker.bookmark(!0),
d = CKEDITOR.dom.walker.bogus();
return function(m) {
return c(m) || b(m) ? !0 : d(m) && !a ? a = !0 : m.type == CKEDITOR.NODE_TEXT && (m.hasAscendant("pre") || CKEDITOR.tools.trim(m.getText()).length) || m.type == CKEDITOR.NODE_ELEMENT && !m.is(e) ? !1 : !0
}
}
function f(a) {
var b = CKEDITOR.dom.walker.whitespaces(),
c = CKEDITOR.dom.walker.bookmark(1);
return function(d) {
return c(d) || b(d) ? !0 : !a && g(d) || d.type == CKEDITOR.NODE_ELEMENT && d.is(CKEDITOR.dtd.$removeEmpty)
}
}
function c(a) {
return function() {
var b;
return this[a ? "getPreviousNode" : "getNextNode"](function(a) {
!b && l(a) && (b = a);
return h(a) && !(g(a) && a.equals(b))
})
}
}
var a = function(a) {
a.collapsed = a.startContainer && a.endContainer && a.startContainer.equals(a.endContainer) && a.startOffset == a.endOffset
},
b = function(a, b, c, d) {
a.optimizeBookmark();
var m = a.startContainer,
e = a.endContainer,
h = a.startOffset,
g = a.endOffset,
k, l;
e.type == CKEDITOR.NODE_TEXT ? e = e.split(g) : 0 < e.getChildCount() && (g >= e.getChildCount() ? (e = e.append(a.document.createText("")), l = !0) : e = e.getChild(g));
m.type == CKEDITOR.NODE_TEXT ? (m.split(h), m.equals(e) && (e = m.getNext())) : h ? h >= m.getChildCount() ? (m = m.append(a.document.createText("")), k = !0) : m = m.getChild(h).getPrevious() : (m = m.append(a.document.createText(""), 1), k = !0);
var h = m.getParents(),
g = e.getParents(),
f, C, s;
for (f = 0; f < h.length && !(C = h[f], s = g[f], !C.equals(s)); f++);
for (var v =
c, G, A, D, B = f; B < h.length; B++) {
G = h[B];
v && !G.equals(m) && (A = v.append(G.clone()));
for (G = G.getNext(); G && !G.equals(g[B]) && !G.equals(e);) D = G.getNext(), 2 == b ? v.append(G.clone(!0)) : (G.remove(), 1 == b && v.append(G)), G = D;
v && (v = A)
}
v = c;
for (c = f; c < g.length; c++) {
G = g[c];
0 < b && !G.equals(e) && (A = v.append(G.clone()));
if (!h[c] || G.$.parentNode != h[c].$.parentNode)
for (G = G.getPrevious(); G && !G.equals(h[c]) && !G.equals(m);) D = G.getPrevious(), 2 == b ? v.$.insertBefore(G.$.cloneNode(!0), v.$.firstChild) : (G.remove(), 1 == b && v.$.insertBefore(G.$,
v.$.firstChild)), G = D;
v && (v = A)
}
if (2 == b) C = a.startContainer, C.type == CKEDITOR.NODE_TEXT && (C.$.data += C.$.nextSibling.data, C.$.parentNode.removeChild(C.$.nextSibling)), a = a.endContainer, a.type == CKEDITOR.NODE_TEXT && a.$.nextSibling && (a.$.data += a.$.nextSibling.data, a.$.parentNode.removeChild(a.$.nextSibling));
else {
if (C && s && (m.$.parentNode != C.$.parentNode || e.$.parentNode != s.$.parentNode)) b = s.getIndex(), k && s.$.parentNode == m.$.parentNode && b--, d && C.type == CKEDITOR.NODE_ELEMENT ? (d = CKEDITOR.dom.element.createFromHtml('<span data-cke-bookmark="1" style="display:none">&nbsp;</span>',
a.document), d.insertAfter(C), C.mergeSiblings(!1), a.moveToBookmark({
startNode: d
})) : a.setStart(s.getParent(), b);
a.collapse(!0)
}
k && m.remove();
l && e.$.parentNode && e.remove()
},
e = {
abbr: 1,
acronym: 1,
b: 1,
bdo: 1,
big: 1,
cite: 1,
code: 1,
del: 1,
dfn: 1,
em: 1,
font: 1,
i: 1,
ins: 1,
label: 1,
kbd: 1,
q: 1,
samp: 1,
small: 1,
span: 1,
strike: 1,
strong: 1,
sub: 1,
sup: 1,
tt: 1,
u: 1,
"var": 1
},
g = CKEDITOR.dom.walker.bogus(),
k = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
h = CKEDITOR.dom.walker.editable(),
l = CKEDITOR.dom.walker.ignored(!0);
CKEDITOR.dom.range.prototype = {
clone: function() {
var a =
new CKEDITOR.dom.range(this.root);
a.startContainer = this.startContainer;
a.startOffset = this.startOffset;
a.endContainer = this.endContainer;
a.endOffset = this.endOffset;
a.collapsed = this.collapsed;
return a
},
collapse: function(a) {
a ? (this.endContainer = this.startContainer, this.endOffset = this.startOffset) : (this.startContainer = this.endContainer, this.startOffset = this.endOffset);
this.collapsed = !0
},
cloneContents: function() {
var a = new CKEDITOR.dom.documentFragment(this.document);
this.collapsed || b(this, 2, a);
return a
},
deleteContents: function(a) {
this.collapsed || b(this, 0, null, a)
},
extractContents: function(a) {
var c = new CKEDITOR.dom.documentFragment(this.document);
this.collapsed || b(this, 1, c, a);
return c
},
createBookmark: function(a) {
var b, c, d, m, e = this.collapsed;
b = this.document.createElement("span");
b.data("cke-bookmark", 1);
b.setStyle("display", "none");
b.setHtml("&nbsp;");
a && (d = "cke_bm_" + CKEDITOR.tools.getNextNumber(), b.setAttribute("id", d + (e ? "C" : "S")));
e || (c = b.clone(), c.setHtml("&nbsp;"), a && c.setAttribute("id", d + "E"),
m = this.clone(), m.collapse(), m.insertNode(c));
m = this.clone();
m.collapse(!0);
m.insertNode(b);
c ? (this.setStartAfter(b), this.setEndBefore(c)) : this.moveToPosition(b, CKEDITOR.POSITION_AFTER_END);
return {
startNode: a ? d + (e ? "C" : "S") : b,
endNode: a ? d + "E" : c,
serializable: a,
collapsed: e
}
},
createBookmark2: function() {
function a(b) {
var c = b.container,
d = b.offset,
m;
m = c;
var e = d;
if (m = m.type != CKEDITOR.NODE_ELEMENT || 0 === e || e == m.getChildCount() ? 0 : m.getChild(e - 1).type == CKEDITOR.NODE_TEXT && m.getChild(e).type == CKEDITOR.NODE_TEXT) c =
c.getChild(d - 1), d = c.getLength();
c.type == CKEDITOR.NODE_ELEMENT && 1 < d && (d = c.getChild(d - 1).getIndex(!0) + 1);
if (c.type == CKEDITOR.NODE_TEXT) {
m = c;
for (e = 0;
(m = m.getPrevious()) && m.type == CKEDITOR.NODE_TEXT;) e += m.getLength();
d += e
}
b.container = c;
b.offset = d
}
return function(b) {
var c = this.collapsed,
d = {
container: this.startContainer,
offset: this.startOffset
},
m = {
container: this.endContainer,
offset: this.endOffset
};
b && (a(d), c || a(m));
return {
start: d.container.getAddress(b),
end: c ? null : m.container.getAddress(b),
startOffset: d.offset,
endOffset: m.offset,
normalized: b,
collapsed: c,
is2: !0
}
}
}(),
moveToBookmark: function(a) {
if (a.is2) {
var b = this.document.getByAddress(a.start, a.normalized),
c = a.startOffset,
d = a.end && this.document.getByAddress(a.end, a.normalized);
a = a.endOffset;
this.setStart(b, c);
d ? this.setEnd(d, a) : this.collapse(!0)
} else b = (c = a.serializable) ? this.document.getById(a.startNode) : a.startNode, a = c ? this.document.getById(a.endNode) : a.endNode, this.setStartBefore(b), b.remove(), a ? (this.setEndBefore(a), a.remove()) : this.collapse(!0)
},
getBoundaryNodes: function() {
var a =
this.startContainer,
b = this.endContainer,
c = this.startOffset,
d = this.endOffset,
m;
if (a.type == CKEDITOR.NODE_ELEMENT)
if (m = a.getChildCount(), m > c) a = a.getChild(c);
else if (1 > m) a = a.getPreviousSourceNode();
else {
for (a = a.$; a.lastChild;) a = a.lastChild;
a = new CKEDITOR.dom.node(a);
a = a.getNextSourceNode() || a
}
if (b.type == CKEDITOR.NODE_ELEMENT)
if (m = b.getChildCount(), m > d) b = b.getChild(d).getPreviousSourceNode(!0);
else if (1 > m) b = b.getPreviousSourceNode();
else {
for (b = b.$; b.lastChild;) b = b.lastChild;
b = new CKEDITOR.dom.node(b)
}
a.getPosition(b) &
CKEDITOR.POSITION_FOLLOWING && (a = b);
return {
startNode: a,
endNode: b
}
},
getCommonAncestor: function(a, b) {
var c = this.startContainer,
d = this.endContainer,
c = c.equals(d) ? a && c.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset - 1 ? c.getChild(this.startOffset) : c : c.getCommonAncestor(d);
return b && !c.is ? c.getParent() : c
},
optimize: function() {
var a = this.startContainer,
b = this.startOffset;
a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setStartAfter(a) : this.setStartBefore(a));
a = this.endContainer;
b = this.endOffset;
a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setEndAfter(a) : this.setEndBefore(a))
},
optimizeBookmark: function() {
var a = this.startContainer,
b = this.endContainer;
a.is && a.is("span") && a.data("cke-bookmark") && this.setStartAt(a, CKEDITOR.POSITION_BEFORE_START);
b && b.is && (b.is("span") && b.data("cke-bookmark")) && this.setEndAt(b, CKEDITOR.POSITION_AFTER_END)
},
trim: function(a, b) {
var c = this.startContainer,
d = this.startOffset,
m = this.collapsed;
if ((!a || m) && c && c.type == CKEDITOR.NODE_TEXT) {
if (d)
if (d >= c.getLength()) d =
c.getIndex() + 1, c = c.getParent();
else {
var e = c.split(d),
d = c.getIndex() + 1,
c = c.getParent();
this.startContainer.equals(this.endContainer) ? this.setEnd(e, this.endOffset - this.startOffset) : c.equals(this.endContainer) && (this.endOffset += 1)
} else d = c.getIndex(), c = c.getParent();
this.setStart(c, d);
if (m) {
this.collapse(!0);
return
}
}
c = this.endContainer;
d = this.endOffset;
!b && (!m && c && c.type == CKEDITOR.NODE_TEXT) && (d ? (d >= c.getLength() || c.split(d), d = c.getIndex() + 1) : d = c.getIndex(), c = c.getParent(), this.setEnd(c, d))
},
enlarge: function(a,
b) {
function c(a) {
return a && a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable") ? null : a
}
switch (a) {
case CKEDITOR.ENLARGE_INLINE:
var d = 1;
case CKEDITOR.ENLARGE_ELEMENT:
if (this.collapsed) break;
var m = this.getCommonAncestor(),
e = this.root,
h, g, k, l, f, C = !1,
s, v;
s = this.startContainer;
v = this.startOffset;
if (s.type == CKEDITOR.NODE_TEXT) {
if (v && (s = !CKEDITOR.tools.trim(s.substring(0, v)).length && s, C = !!s), s && !(l = s.getPrevious())) k = s.getParent()
} else v && (l = s.getChild(v - 1) || s.getLast()), l || (k = s);
for (k = c(k); k ||
l;) {
if (k && !l) {
!f && k.equals(m) && (f = !0);
if (d ? k.isBlockBoundary() : !e.contains(k)) break;
if (!C || "inline" != k.getComputedStyle("display")) C = !1, f ? h = k : this.setStartBefore(k);
l = k.getPrevious()
}
for (; l;)
if (s = !1, l.type == CKEDITOR.NODE_COMMENT) l = l.getPrevious();
else {
if (l.type == CKEDITOR.NODE_TEXT) v = l.getText(), /[^\s\ufeff]/.test(v) && (l = null), s = /[\s\ufeff]$/.test(v);
else if ((0 < l.$.offsetWidth || b && l.is("br")) && !l.data("cke-bookmark"))
if (C && CKEDITOR.dtd.$removeEmpty[l.getName()]) {
v = l.getText();
if (/[^\s\ufeff]/.test(v)) l =
null;
else
for (var G = l.$.getElementsByTagName("*"), A = 0, D; D = G[A++];)
if (!CKEDITOR.dtd.$removeEmpty[D.nodeName.toLowerCase()]) {
l = null;
break
}
l && (s = !!v.length)
} else l = null;
s && (C ? f ? h = k : k && this.setStartBefore(k) : C = !0);
if (l) {
s = l.getPrevious();
if (!k && !s) {
k = l;
l = null;
break
}
l = s
} else k = null
}
k && (k = c(k.getParent()))
}
s = this.endContainer;
v = this.endOffset;
k = l = null;
f = C = !1;
if (s.type == CKEDITOR.NODE_TEXT) {
if (s = !CKEDITOR.tools.trim(s.substring(v)).length && s, C = !(s && s.getLength()), s && !(l = s.getNext())) k = s.getParent()
} else(l =
s.getChild(v)) || (k = s);
for (; k || l;) {
if (k && !l) {
!f && k.equals(m) && (f = !0);
if (d ? k.isBlockBoundary() : !e.contains(k)) break;
if (!C || "inline" != k.getComputedStyle("display")) C = !1, f ? g = k : k && this.setEndAfter(k);
l = k.getNext()
}
for (; l;) {
s = !1;
if (l.type == CKEDITOR.NODE_TEXT) v = l.getText(), /[^\s\ufeff]/.test(v) && (l = null), s = /^[\s\ufeff]/.test(v);
else if (l.type == CKEDITOR.NODE_ELEMENT) {
if ((0 < l.$.offsetWidth || b && l.is("br")) && !l.data("cke-bookmark"))
if (C && CKEDITOR.dtd.$removeEmpty[l.getName()]) {
v = l.getText();
if (/[^\s\ufeff]/.test(v)) l =
null;
else {
G = l.$.getElementsByTagName("*");
for (A = 0; D = G[A++];)
if (!CKEDITOR.dtd.$removeEmpty[D.nodeName.toLowerCase()]) {
l = null;
break
}
}
l && (s = !!v.length)
} else l = null
} else s = 1;
s && C && (f ? g = k : this.setEndAfter(k));
if (l) {
s = l.getNext();
if (!k && !s) {
k = l;
l = null;
break
}
l = s
} else k = null
}
k && (k = c(k.getParent()))
}
h && g && (m = h.contains(g) ? g : h, this.setStartBefore(m), this.setEndAfter(m));
break;
case CKEDITOR.ENLARGE_BLOCK_CONTENTS:
case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
k = new CKEDITOR.dom.range(this.root);
e = this.root;
k.setStartAt(e,
CKEDITOR.POSITION_AFTER_START);
k.setEnd(this.startContainer, this.startOffset);
k = new CKEDITOR.dom.walker(k);
var B, M, F = CKEDITOR.dom.walker.blockBoundary(a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? {
br: 1
} : null),
H = null,
I = function(a) {
if (a.type == CKEDITOR.NODE_ELEMENT && "false" == a.getAttribute("contenteditable"))
if (H) {
if (H.equals(a)) {
H = null;
return
}
} else H = a;
else if (H) return;
var b = F(a);
b || (B = a);
return b
},
d = function(a) {
var b = I(a);
!b && a.is && a.is("br") && (M = a);
return b
};
k.guard = I;
k = k.lastBackward();
B = B || e;
this.setStartAt(B, !B.is("br") && (!k && this.checkStartOfBlock() || k && B.contains(k)) ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_AFTER_END);
if (a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS) {
k = this.clone();
k = new CKEDITOR.dom.walker(k);
var J = CKEDITOR.dom.walker.whitespaces(),
N = CKEDITOR.dom.walker.bookmark();
k.evaluator = function(a) {
return !J(a) && !N(a)
};
if ((k = k.previous()) && k.type == CKEDITOR.NODE_ELEMENT && k.is("br")) break
}
k = this.clone();
k.collapse();
k.setEndAt(e, CKEDITOR.POSITION_BEFORE_END);
k = new CKEDITOR.dom.walker(k);
k.guard =
a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? d : I;
B = null;
k = k.lastForward();
B = B || e;
this.setEndAt(B, !k && this.checkEndOfBlock() || k && B.contains(k) ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_BEFORE_START);
M && this.setEndAfter(M)
}
},
shrink: function(a, b, c) {
if (!this.collapsed) {
a = a || CKEDITOR.SHRINK_TEXT;
var d = this.clone(),
e = this.startContainer,
h = this.endContainer,
k = this.startOffset,
l = this.endOffset,
g = 1,
f = 1;
e && e.type == CKEDITOR.NODE_TEXT && (k ? k >= e.getLength() ? d.setStartAfter(e) : (d.setStartBefore(e), g = 0) : d.setStartBefore(e));
h && h.type == CKEDITOR.NODE_TEXT && (l ? l >= h.getLength() ? d.setEndAfter(h) : (d.setEndAfter(h), f = 0) : d.setEndBefore(h));
var d = new CKEDITOR.dom.walker(d),
z = CKEDITOR.dom.walker.bookmark();
d.evaluator = function(b) {
return b.type == (a == CKEDITOR.SHRINK_ELEMENT ? CKEDITOR.NODE_ELEMENT : CKEDITOR.NODE_TEXT)
};
var C;
d.guard = function(b, d) {
if (z(b)) return !0;
if (a == CKEDITOR.SHRINK_ELEMENT && b.type == CKEDITOR.NODE_TEXT || d && b.equals(C) || !1 === c && b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary() || b.type == CKEDITOR.NODE_ELEMENT && b.hasAttribute("contenteditable")) return !1;
!d && b.type == CKEDITOR.NODE_ELEMENT && (C = b);
return !0
};
g && (e = d[a == CKEDITOR.SHRINK_ELEMENT ? "lastForward" : "next"]()) && this.setStartAt(e, b ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START);
f && (d.reset(), (d = d[a == CKEDITOR.SHRINK_ELEMENT ? "lastBackward" : "previous"]()) && this.setEndAt(d, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_END));
return !(!g && !f)
}
},
insertNode: function(a) {
this.optimizeBookmark();
this.trim(!1, !0);
var b = this.startContainer,
c = b.getChild(this.startOffset);
c ? a.insertBefore(c) :
b.append(a);
a.getParent() && a.getParent().equals(this.endContainer) && this.endOffset++;
this.setStartBefore(a)
},
moveToPosition: function(a, b) {
this.setStartAt(a, b);
this.collapse(!0)
},
moveToRange: function(a) {
this.setStart(a.startContainer, a.startOffset);
this.setEnd(a.endContainer, a.endOffset)
},
selectNodeContents: function(a) {
this.setStart(a, 0);
this.setEnd(a, a.type == CKEDITOR.NODE_TEXT ? a.getLength() : a.getChildCount())
},
setStart: function(b, c) {
b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] &&
(c = b.getIndex(), b = b.getParent());
this.startContainer = b;
this.startOffset = c;
this.endContainer || (this.endContainer = b, this.endOffset = c);
a(this)
},
setEnd: function(b, c) {
b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex() + 1, b = b.getParent());
this.endContainer = b;
this.endOffset = c;
this.startContainer || (this.startContainer = b, this.startOffset = c);
a(this)
},
setStartAfter: function(a) {
this.setStart(a.getParent(), a.getIndex() + 1)
},
setStartBefore: function(a) {
this.setStart(a.getParent(), a.getIndex())
},
setEndAfter: function(a) {
this.setEnd(a.getParent(), a.getIndex() + 1)
},
setEndBefore: function(a) {
this.setEnd(a.getParent(), a.getIndex())
},
setStartAt: function(b, c) {
switch (c) {
case CKEDITOR.POSITION_AFTER_START:
this.setStart(b, 0);
break;
case CKEDITOR.POSITION_BEFORE_END:
b.type == CKEDITOR.NODE_TEXT ? this.setStart(b, b.getLength()) : this.setStart(b, b.getChildCount());
break;
case CKEDITOR.POSITION_BEFORE_START:
this.setStartBefore(b);
break;
case CKEDITOR.POSITION_AFTER_END:
this.setStartAfter(b)
}
a(this)
},
setEndAt: function(b,
c) {
switch (c) {
case CKEDITOR.POSITION_AFTER_START:
this.setEnd(b, 0);
break;
case CKEDITOR.POSITION_BEFORE_END:
b.type == CKEDITOR.NODE_TEXT ? this.setEnd(b, b.getLength()) : this.setEnd(b, b.getChildCount());
break;
case CKEDITOR.POSITION_BEFORE_START:
this.setEndBefore(b);
break;
case CKEDITOR.POSITION_AFTER_END:
this.setEndAfter(b)
}
a(this)
},
fixBlock: function(a, b) {
var c = this.createBookmark(),
d = this.document.createElement(b);
this.collapse(a);
this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);
this.extractContents().appendTo(d);
d.trim();
d.appendBogus();
this.insertNode(d);
this.moveToBookmark(c);
return d
},
splitBlock: function(a) {
var b = new CKEDITOR.dom.elementPath(this.startContainer, this.root),
c = new CKEDITOR.dom.elementPath(this.endContainer, this.root),
d = b.block,
e = c.block,
h = null;
if (!b.blockLimit.equals(c.blockLimit)) return null;
"br" != a && (d || (d = this.fixBlock(!0, a), e = (new CKEDITOR.dom.elementPath(this.endContainer, this.root)).block), e || (e = this.fixBlock(!1, a)));
a = d && this.checkStartOfBlock();
b = e && this.checkEndOfBlock();
this.deleteContents();
d && d.equals(e) && (b ? (h = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this.moveToPosition(e, CKEDITOR.POSITION_AFTER_END), e = null) : a ? (h = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this.moveToPosition(d, CKEDITOR.POSITION_BEFORE_START), d = null) : (e = this.splitElement(d), d.is("ul", "ol") || d.appendBogus()));
return {
previousBlock: d,
nextBlock: e,
wasStartOfBlock: a,
wasEndOfBlock: b,
elementPath: h
}
},
splitElement: function(a) {
if (!this.collapsed) return null;
this.setEndAt(a, CKEDITOR.POSITION_BEFORE_END);
var b = this.extractContents(),
c = a.clone(!1);
b.appendTo(c);
c.insertAfter(a);
this.moveToPosition(a, CKEDITOR.POSITION_AFTER_END);
return c
},
removeEmptyBlocksAtEnd: function() {
function a(d) {
return function(a) {
return b(a) || c(a) || a.type == CKEDITOR.NODE_ELEMENT && a.isEmptyInlineRemoveable() || d.is("table") && a.is("caption") ? !1 : !0
}
}
var b = CKEDITOR.dom.walker.whitespaces(),
c = CKEDITOR.dom.walker.bookmark(!1);
return function(b) {
for (var c = this.createBookmark(), d = this[b ? "endPath" : "startPath"](), e = d.block || d.blockLimit,
h; e && !e.equals(d.root) && !e.getFirst(a(e));) h = e.getParent(), this[b ? "setEndAt" : "setStartAt"](e, CKEDITOR.POSITION_AFTER_END), e.remove(1), e = h;
this.moveToBookmark(c)
}
}(),
startPath: function() {
return new CKEDITOR.dom.elementPath(this.startContainer, this.root)
},
endPath: function() {
return new CKEDITOR.dom.elementPath(this.endContainer, this.root)
},
checkBoundaryOfElement: function(a, b) {
var c = b == CKEDITOR.START,
d = this.clone();
d.collapse(c);
d[c ? "setStartAt" : "setEndAt"](a, c ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END);
d = new CKEDITOR.dom.walker(d);
d.evaluator = f(c);
return d[c ? "checkBackward" : "checkForward"]()
},
checkStartOfBlock: function() {
var a = this.startContainer,
b = this.startOffset;
CKEDITOR.env.ie && (b && a.type == CKEDITOR.NODE_TEXT) && (a = CKEDITOR.tools.ltrim(a.substring(0, b)), k.test(a) && this.trim(0, 1));
this.trim();
a = new CKEDITOR.dom.elementPath(this.startContainer, this.root);
b = this.clone();
b.collapse(!0);
b.setStartAt(a.block || a.blockLimit, CKEDITOR.POSITION_AFTER_START);
a = new CKEDITOR.dom.walker(b);
a.evaluator = d();
return a.checkBackward()
},
checkEndOfBlock: function() {
var a = this.endContainer,
b = this.endOffset;
CKEDITOR.env.ie && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.rtrim(a.substring(b)), k.test(a) && this.trim(1, 0));
this.trim();
a = new CKEDITOR.dom.elementPath(this.endContainer, this.root);
b = this.clone();
b.collapse(!1);
b.setEndAt(a.block || a.blockLimit, CKEDITOR.POSITION_BEFORE_END);
a = new CKEDITOR.dom.walker(b);
a.evaluator = d();
return a.checkForward()
},
getPreviousNode: function(a, b, c) {
var d = this.clone();
d.collapse(1);
d.setStartAt(c || this.root,
CKEDITOR.POSITION_AFTER_START);
c = new CKEDITOR.dom.walker(d);
c.evaluator = a;
c.guard = b;
return c.previous()
},
getNextNode: function(a, b, c) {
var d = this.clone();
d.collapse();
d.setEndAt(c || this.root, CKEDITOR.POSITION_BEFORE_END);
c = new CKEDITOR.dom.walker(d);
c.evaluator = a;
c.guard = b;
return c.next()
},
checkReadOnly: function() {
function a(b, c) {
for (; b;) {
if (b.type == CKEDITOR.NODE_ELEMENT) {
if ("false" == b.getAttribute("contentEditable") && !b.data("cke-editable")) return 0;
if (b.is("html") || "true" == b.getAttribute("contentEditable") &&
(b.contains(c) || b.equals(c))) break
}
b = b.getParent()
}
return 1
}
return function() {
var b = this.startContainer,
c = this.endContainer;
return !(a(b, c) && a(c, b))
}
}(),
moveToElementEditablePosition: function(a, b) {
if (a.type == CKEDITOR.NODE_ELEMENT && !a.isEditable(!1)) return this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START), !0;
for (var c = 0; a;) {
if (a.type == CKEDITOR.NODE_TEXT) {
b && this.endContainer && this.checkEndOfBlock() && k.test(a.getText()) ? this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START) :
this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START);
c = 1;
break
}
if (a.type == CKEDITOR.NODE_ELEMENT)
if (a.isEditable()) this.moveToPosition(a, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_START), c = 1;
else if (b && a.is("br") && this.endContainer && this.checkEndOfBlock()) this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START);
else if ("false" == a.getAttribute("contenteditable") && a.is(CKEDITOR.dtd.$block)) return this.setStartBefore(a), this.setEndAfter(a), !0;
var d = a,
e = c,
h = void 0;
d.type == CKEDITOR.NODE_ELEMENT && d.isEditable(!1) && (h = d[b ? "getLast" : "getFirst"](l));
!e && !h && (h = d[b ? "getPrevious" : "getNext"](l));
a = h
}
return !!c
},
moveToClosestEditablePosition: function(a, b) {
var c = new CKEDITOR.dom.range(this.root),
d = 0,
e, h = [CKEDITOR.POSITION_AFTER_END, CKEDITOR.POSITION_BEFORE_START];
c.moveToPosition(a, h[b ? 0 : 1]);
if (a.is(CKEDITOR.dtd.$block)) {
if (e = c[b ? "getNextEditableNode" : "getPreviousEditableNode"]()) d = 1, e.type == CKEDITOR.NODE_ELEMENT && e.is(CKEDITOR.dtd.$block) && "false" == e.getAttribute("contenteditable") ?
(c.setStartAt(e, CKEDITOR.POSITION_BEFORE_START), c.setEndAt(e, CKEDITOR.POSITION_AFTER_END)) : c.moveToPosition(e, h[b ? 1 : 0])
} else d = 1;
d && this.moveToRange(c);
return !!d
},
moveToElementEditStart: function(a) {
return this.moveToElementEditablePosition(a)
},
moveToElementEditEnd: function(a) {
return this.moveToElementEditablePosition(a, !0)
},
getEnclosedNode: function() {
var a = this.clone();
a.optimize();
if (a.startContainer.type != CKEDITOR.NODE_ELEMENT || a.endContainer.type != CKEDITOR.NODE_ELEMENT) return null;
var a = new CKEDITOR.dom.walker(a),
b = CKEDITOR.dom.walker.bookmark(!1, !0),
c = CKEDITOR.dom.walker.whitespaces(!0);
a.evaluator = function(a) {
return c(a) && b(a)
};
var d = a.next();
a.reset();
return d && d.equals(a.previous()) ? d : null
},
getTouchedStartNode: function() {
var a = this.startContainer;
return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.startOffset) || a
},
getTouchedEndNode: function() {
var a = this.endContainer;
return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.endOffset - 1) || a
},
getNextEditableNode: c(),
getPreviousEditableNode: c(1),
scrollIntoView: function() {
var a = new CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>", this.document),
b, c, d, e = this.clone();
e.optimize();
(d = e.startContainer.type == CKEDITOR.NODE_TEXT) ? (c = e.startContainer.getText(), b = e.startContainer.split(e.startOffset), a.insertAfter(e.startContainer)) : e.insertNode(a);
a.scrollIntoView();
d && (e.startContainer.setText(c), b.remove());
a.remove()
}
}
}(), CKEDITOR.POSITION_AFTER_START = 1, CKEDITOR.POSITION_BEFORE_END = 2, CKEDITOR.POSITION_BEFORE_START = 3, CKEDITOR.POSITION_AFTER_END =
4, CKEDITOR.ENLARGE_ELEMENT = 1, CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2, CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3, CKEDITOR.ENLARGE_INLINE = 4, CKEDITOR.START = 1, CKEDITOR.END = 2, CKEDITOR.SHRINK_ELEMENT = 1, CKEDITOR.SHRINK_TEXT = 2, "use strict",
function() {
function d(a) {
1 > arguments.length || (this.range = a, this.forceBrBreak = 0, this.enlargeBr = 1, this.enforceRealBlocks = 0, this._ || (this._ = {}))
}
function f(a, b, c) {
for (a = a.getNextSourceNode(b, null, c); !e(a);) a = a.getNextSourceNode(b, null, c);
return a
}
function c(a) {
var b = [];
a.forEach(function(a) {
if ("true" ==
a.getAttribute("contenteditable")) return b.push(a), !1
}, CKEDITOR.NODE_ELEMENT, !0);
return b
}
function a(b, d, e, k) {
a: {
void 0 == k && (k = c(e));
for (var g; g = k.shift();)
if (g.getDtd().p) {
k = {
element: g,
remaining: k
};
break a
}
k = null
}
if (!k) return 0;
if ((g = CKEDITOR.filter.instances[k.element.data("cke-filter")]) && !g.check(d)) return a(b, d, e, k.remaining);d = new CKEDITOR.dom.range(k.element);d.selectNodeContents(k.element);d = d.createIterator();d.enlargeBr = b.enlargeBr;d.enforceRealBlocks = b.enforceRealBlocks;d.activeFilter =
d.filter = g;b._.nestedEditable = {
element: k.element,
container: e,
remaining: k.remaining,
iterator: d
};
return 1
}
var b = /^[\r\n\t ]+$/,
e = CKEDITOR.dom.walker.bookmark(!1, !0),
g = CKEDITOR.dom.walker.whitespaces(!0),
k = function(a) {
return e(a) && g(a)
};
d.prototype = {
getNextParagraph: function(c) {
var d, g, q, r, u;
c = c || "p";
if (this._.nestedEditable) {
if (d = this._.nestedEditable.iterator.getNextParagraph(c)) return this.activeFilter = this._.nestedEditable.iterator.activeFilter, d;
this.activeFilter = this.filter;
if (a(this, c, this._.nestedEditable.container,
this._.nestedEditable.remaining)) return this.activeFilter = this._.nestedEditable.iterator.activeFilter, this._.nestedEditable.iterator.getNextParagraph(c);
this._.nestedEditable = null
}
if (!this.range.root.getDtd()[c]) return null;
if (!this._.started) {
var m = this.range.clone();
m.shrink(CKEDITOR.SHRINK_ELEMENT, !0);
g = m.endContainer.hasAscendant("pre", !0) || m.startContainer.hasAscendant("pre", !0);
m.enlarge(this.forceBrBreak && !g || !this.enlargeBr ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS);
if (!m.collapsed) {
g = new CKEDITOR.dom.walker(m.clone());
var p = CKEDITOR.dom.walker.bookmark(!0, !0);
g.evaluator = p;
this._.nextNode = g.next();
g = new CKEDITOR.dom.walker(m.clone());
g.evaluator = p;
g = g.previous();
this._.lastNode = g.getNextSourceNode(!0);
this._.lastNode && (this._.lastNode.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(this._.lastNode.getText()) && this._.lastNode.getParent().isBlockBoundary()) && (p = this.range.clone(), p.moveToPosition(this._.lastNode, CKEDITOR.POSITION_AFTER_END), p.checkEndOfBlock() &&
(p = new CKEDITOR.dom.elementPath(p.endContainer, p.root), this._.lastNode = (p.block || p.blockLimit).getNextSourceNode(!0)));
if (!this._.lastNode || !m.root.contains(this._.lastNode)) this._.lastNode = this._.docEndMarker = m.document.createText(""), this._.lastNode.insertAfter(g);
m = null
}
this._.started = 1;
g = m
}
p = this._.nextNode;
m = this._.lastNode;
for (this._.nextNode = null; p;) {
var w = 0,
t = p.hasAscendant("pre"),
x = p.type != CKEDITOR.NODE_ELEMENT,
y = 0;
if (x) p.type == CKEDITOR.NODE_TEXT && b.test(p.getText()) && (x = 0);
else {
var z = p.getName();
if (CKEDITOR.dtd.$block[z] && "false" == p.getAttribute("contenteditable")) {
d = p;
a(this, c, d);
break
} else if (p.isBlockBoundary(this.forceBrBreak && !t && {
br: 1
})) {
if ("br" == z) x = 1;
else if (!g && !p.getChildCount() && "hr" != z) {
d = p;
q = p.equals(m);
break
}
g && (g.setEndAt(p, CKEDITOR.POSITION_BEFORE_START), "br" != z && (this._.nextNode = p));
w = 1
} else {
if (p.getFirst()) {
g || (g = this.range.clone(), g.setStartAt(p, CKEDITOR.POSITION_BEFORE_START));
p = p.getFirst();
continue
}
x = 1
}
}
x && !g && (g = this.range.clone(), g.setStartAt(p, CKEDITOR.POSITION_BEFORE_START));
q = (!w || x) && p.equals(m);
if (g && !w)
for (; !p.getNext(k) && !q;) {
z = p.getParent();
if (z.isBlockBoundary(this.forceBrBreak && !t && {
br: 1
})) {
w = 1;
x = 0;
q || z.equals(m);
g.setEndAt(z, CKEDITOR.POSITION_BEFORE_END);
break
}
p = z;
x = 1;
q = p.equals(m);
y = 1
}
x && g.setEndAt(p, CKEDITOR.POSITION_AFTER_END);
p = f(p, y, m);
if ((q = !p) || w && g) break
}
if (!d) {
if (!g) return this._.docEndMarker && this._.docEndMarker.remove(), this._.nextNode = null;
d = new CKEDITOR.dom.elementPath(g.startContainer, g.root);
p = d.blockLimit;
w = {
div: 1,
th: 1,
td: 1
};
d = d.block;
if (!d &&
p && !this.enforceRealBlocks && w[p.getName()] && g.checkStartOfBlock() && g.checkEndOfBlock() && !p.equals(g.root)) d = p;
else if (!d || this.enforceRealBlocks && "li" == d.getName()) d = this.range.document.createElement(c), g.extractContents().appendTo(d), d.trim(), g.insertNode(d), r = u = !0;
else if ("li" != d.getName()) {
if (!g.checkStartOfBlock() || !g.checkEndOfBlock()) d = d.clone(!1), g.extractContents().appendTo(d), d.trim(), u = g.splitBlock(), r = !u.wasStartOfBlock, u = !u.wasEndOfBlock, g.insertNode(d)
} else q || (this._.nextNode = d.equals(m) ?
null : f(g.getBoundaryNodes().endNode, 1, m))
}
r && (r = d.getPrevious()) && r.type == CKEDITOR.NODE_ELEMENT && ("br" == r.getName() ? r.remove() : r.getLast() && "br" == r.getLast().$.nodeName.toLowerCase() && r.getLast().remove());
u && (r = d.getLast()) && r.type == CKEDITOR.NODE_ELEMENT && "br" == r.getName() && (!CKEDITOR.env.needsBrFiller || r.getPrevious(e) || r.getNext(e)) && r.remove();
this._.nextNode || (this._.nextNode = q || d.equals(m) || !m ? null : f(d, 1, m));
return d
}
};
CKEDITOR.dom.range.prototype.createIterator = function() {
return new d(this)
}
}(),
CKEDITOR.command = function(d, f) {
this.uiItems = [];
this.exec = function(a) {
if (this.state == CKEDITOR.TRISTATE_DISABLED || !this.checkAllowed()) return !1;
this.editorFocus && d.focus();
return !1 === this.fire("exec") ? !0 : !1 !== f.exec.call(this, d, a)
};
this.refresh = function(a, b) {
if (!this.readOnly && a.readOnly) return !0;
if (this.context && !b.isContextFor(this.context) || !this.checkAllowed(!0)) return this.disable(), !0;
this.startDisabled || this.enable();
this.modes && !this.modes[a.mode] && this.disable();
return !1 === this.fire("refresh", {
editor: a,
path: b
}) ? !0 : f.refresh && !1 !== f.refresh.apply(this, arguments)
};
var c;
this.checkAllowed = function(a) {
return !a && "boolean" == typeof c ? c : c = d.activeFilter.checkFeature(this)
};
CKEDITOR.tools.extend(this, f, {
modes: {
wysiwyg: 1
},
editorFocus: 1,
contextSensitive: !!f.context,
state: CKEDITOR.TRISTATE_DISABLED
});
CKEDITOR.event.call(this)
}, CKEDITOR.command.prototype = {
enable: function() {
this.state == CKEDITOR.TRISTATE_DISABLED && this.checkAllowed() && this.setState(!this.preserveState || "undefined" == typeof this.previousState ?
CKEDITOR.TRISTATE_OFF : this.previousState)
},
disable: function() {
this.setState(CKEDITOR.TRISTATE_DISABLED)
},
setState: function(d) {
if (this.state == d || d != CKEDITOR.TRISTATE_DISABLED && !this.checkAllowed()) return !1;
this.previousState = this.state;
this.state = d;
this.fire("state");
return !0
},
toggleState: function() {
this.state == CKEDITOR.TRISTATE_OFF ? this.setState(CKEDITOR.TRISTATE_ON) : this.state == CKEDITOR.TRISTATE_ON && this.setState(CKEDITOR.TRISTATE_OFF)
}
}, CKEDITOR.event.implementOn(CKEDITOR.command.prototype), CKEDITOR.ENTER_P =
1, CKEDITOR.ENTER_BR = 2, CKEDITOR.ENTER_DIV = 3, CKEDITOR.config = {
customConfig: "config.js",
autoUpdateElement: !0,
language: "",
defaultLanguage: "en",
contentsLangDirection: "",
enterMode: CKEDITOR.ENTER_P,
forceEnterMode: !1,
shiftEnterMode: CKEDITOR.ENTER_BR,
docType: "<!DOCTYPE html>",
bodyId: "",
bodyClass: "",
fullPage: !1,
height: 200,
extraPlugins: "",
removePlugins: "",
protectedSource: [],
tabIndex: 0,
width: "",
baseFloatZIndex: 1E4,
blockedKeystrokes: [CKEDITOR.CTRL + 66, CKEDITOR.CTRL + 73, CKEDITOR.CTRL + 85]
},
function() {
function d(a,
c, d, e, m) {
var h = c.name;
if ((e || "function" != typeof a.elements || a.elements(h)) && (!a.match || a.match(c))) {
if (e = !m) {
a: if (a.nothingRequired) e = !0;
else {
if (m = a.requiredClasses) {
h = c.classes;
for (e = 0; e < m.length; ++e)
if (-1 == CKEDITOR.tools.indexOf(h, m[e])) {
e = !1;
break a
}
}
e = b(c.styles, a.requiredStyles) && b(c.attributes, a.requiredAttributes)
}e = !e
}
if (!e && (a.propertiesOnly || (d.valid = !0), d.allAttributes || (d.allAttributes = f(a.attributes, c.attributes, d.validAttributes)), d.allStyles || (d.allStyles = f(a.styles, c.styles, d.validStyles)), !d.allClasses)) {
a = a.classes;
c = c.classes;
e = d.validClasses;
if (a)
if (!0 === a) c = !0;
else {
m = 0;
for (var h = c.length, g; m < h; ++m) g = c[m], e[g] || (e[g] = a(g));
c = !1
} else c = !1;
d.allClasses = c
}
}
}
function f(a, b, c) {
if (!a) return !1;
if (!0 === a) return !0;
for (var d in b) c[d] || (c[d] = a(d, b[d]));
return !1
}
function c(a, b) {
if (!a) return !1;
if (!0 === a) return a;
if ("string" == typeof a) return a = s(a), "*" == a ? !0 : CKEDITOR.tools.convertArrayToObject(a.split(b));
if (CKEDITOR.tools.isArray(a)) return a.length ? CKEDITOR.tools.convertArrayToObject(a) : !1;
var c = {},
d = 0,
e;
for (e in a) c[e] = a[e], d++;
return d ? c : !1
}
function a(a) {
if (a._.filterFunction) return a._.filterFunction;
var b = /^cke:(object|embed|param)$/,
c = /^(object|embed|param)$/;
return a._.filterFunction = function(e, m, g, k, f, x, t) {
var u = e.name,
s, y = !1;
f && (e.name = u = u.replace(b, "$1"));
if (g = g && g[u]) {
h(e);
for (u = 0; u < g.length; ++u) p(a, e, g[u]);
l(e)
}
if (m) {
u = e.name;
g = m.elements[u];
var z = m.generic;
m = {
valid: !1,
validAttributes: {},
validClasses: {},
validStyles: {},
allAttributes: !1,
allClasses: !1,
allStyles: !1
};
if (!g && !z) return k.push(e), !0;
h(e);
if (g) {
u = 0;
for (s = g.length; u < s; ++u) d(g[u], e, m, !0, x)
}
if (z) {
u = 0;
for (s = z.length; u < s; ++u) d(z[u], e, m, !1, x)
}
if (!m.valid) return k.push(e), !0;
x = m.validAttributes;
u = m.validStyles;
g = m.validClasses;
s = e.attributes;
var z = e.styles,
w = s["class"],
q = s.style,
r, C, v = [],
A = [],
G = /^data-cke-/,
D = !1;
delete s.style;
delete s["class"];
if (!m.allAttributes)
for (r in s)
if (!x[r])
if (G.test(r)) {
if (r != (C = r.replace(/^data-cke-saved-/, "")) && !x[C]) delete s[r], D = !0
} else delete s[r], D = !0;
if (m.allStyles) q && (s.style = q);
else {
for (r in z) u[r] ?
v.push(r + ":" + z[r]) : D = !0;
v.length && (s.style = v.sort().join("; "))
}
if (m.allClasses) w && (s["class"] = w);
else {
for (r in g) g[r] && A.push(r);
A.length && (s["class"] = A.sort().join(" "));
w && A.length < w.split(/\s+/).length && (D = !0)
}
D && (y = !0);
if (!t && !n(e)) return k.push(e), !0
}
f && (e.name = e.name.replace(c, "cke:$1"));
return y
}
}
function b(a, b) {
if (!b) return !0;
for (var c = 0; c < b.length; ++c)
if (!(b[c] in a)) return !1;
return !0
}
function e(a) {
if (!a) return {};
a = a.split(/\s*,\s*/).sort();
for (var b = {}; a.length;) b[a.shift()] = v;
return b
}
function g(a) {
var b, c, d, e, m = {},
h = 1;
for (a = s(a); b = a.match(B);)(c = b[2]) ? (d = k(c, "styles"), e = k(c, "attrs"), c = k(c, "classes")) : d = e = c = null, m["$" + h++] = {
elements: b[1],
classes: c,
styles: d,
attributes: e
}, a = a.slice(b[0].length);
return m
}
function k(a, b) {
var c = a.match(M[b]);
return c ? s(c[1]) : null
}
function h(a) {
a.styles || (a.styles = CKEDITOR.tools.parseCssText(a.attributes.style || "", 1));
a.classes || (a.classes = a.attributes["class"] ? a.attributes["class"].split(/\s+/) : [])
}
function l(a) {
var b = a.attributes,
c;
delete b.style;
delete b["class"];
if (c = CKEDITOR.tools.writeCssText(a.styles, !0)) b.style = c;
a.classes.length && (b["class"] = a.classes.sort().join(" "))
}
function n(a) {
switch (a.name) {
case "a":
if (!a.children.length && !a.attributes.name) return !1;
break;
case "img":
if (!a.attributes.src) return !1
}
return !0
}
function q(a) {
return !a ? !1 : !0 === a ? !0 : function(b) {
return b in a
}
}
function r() {
return new CKEDITOR.htmlParser.element("br")
}
function u(a) {
return a.type == CKEDITOR.NODE_ELEMENT && ("br" == a.name || z.$block[a.name])
}
function m(a, b, c) {
var d =
a.name;
if (z.$empty[d] || !a.children.length) "hr" == d && "br" == b ? a.replaceWith(r()) : (a.parent && c.push({
check: "it",
el: a.parent
}), a.remove());
else if (z.$block[d] || "tr" == d)
if ("br" == b) a.previous && !u(a.previous) && (b = r(), b.insertBefore(a)), a.next && !u(a.next) && (b = r(), b.insertAfter(a)), a.replaceWithChildren();
else {
var d = a.children,
e;
a: {
e = z[b];
for (var m = 0, h = d.length, g; m < h; ++m)
if (g = d[m], g.type == CKEDITOR.NODE_ELEMENT && !e[g.name]) {
e = !1;
break a
}
e = !0
}
if (e) a.name = b, a.attributes = {}, c.push({
check: "parent-down",
el: a
});
else {
e =
a.parent;
for (var m = e.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || "body" == e.name, k, h = d.length; 0 < h;) g = d[--h], m && (g.type == CKEDITOR.NODE_TEXT || g.type == CKEDITOR.NODE_ELEMENT && z.$inline[g.name]) ? (k || (k = new CKEDITOR.htmlParser.element(b), k.insertAfter(a), c.push({
check: "parent-down",
el: k
})), k.add(g, 0)) : (k = null, g.insertAfter(a), e.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT && g.type == CKEDITOR.NODE_ELEMENT && !z[e.name][g.name] && c.push({
check: "el-up",
el: g
}));
a.remove()
}
} else "style" == d ? a.remove() : (a.parent && c.push({
check: "it",
el: a.parent
}), a.replaceWithChildren())
}
function p(a, b, c) {
var d, e;
for (d = 0; d < c.length; ++d)
if (e = c[d], (!e.check || a.check(e.check, !1)) && (!e.left || e.left(b))) {
e.right(b, F);
break
}
}
function w(a, b) {
var c = b.getDefinition(),
d = c.attributes,
e = c.styles,
m, h, g, k;
if (a.name != c.element) return !1;
for (m in d)
if ("class" == m) {
c = d[m].split(/\s+/);
for (g = a.classes.join("|"); k = c.pop();)
if (-1 == g.indexOf(k)) return !1
} else if (a.attributes[m] != d[m]) return !1;
for (h in e)
if (a.styles[h] != e[h]) return !1;
return !0
}
function t(a, b) {
var c, d;
"string" == typeof a ? c = a : a instanceof CKEDITOR.style ? d = a : (c = a[0], d = a[1]);
return [{
element: c,
left: d,
right: function(a, c) {
c.transform(a, b)
}
}]
}
function x(a) {
return function(b) {
return w(b, a)
}
}
function y(a) {
return function(b, c) {
c[a](b)
}
}
var z = CKEDITOR.dtd,
C = CKEDITOR.tools.copy,
s = CKEDITOR.tools.trim,
v = "cke-test",
G = ["", "p", "br", "div"];
CKEDITOR.filter = function(a) {
this.allowedContent = [];
this.disabled = !1;
this.editor = null;
this.id = CKEDITOR.tools.getNextNumber();
this._ = {
rules: {},
transformations: {},
cachedTests: {}
};
CKEDITOR.filter.instances[this.id] = this;
if (a instanceof CKEDITOR.editor) {
a = this.editor = a;
this.customConfig = !0;
var b = a.config.allowedContent;
!0 === b ? this.disabled = !0 : (b || (this.customConfig = !1), this.allow(b, "config", 1), this.allow(a.config.extraAllowedContent, "extra", 1), this.allow(G[a.enterMode] + " " + G[a.shiftEnterMode], "default", 1))
} else this.customConfig = !1, this.allow(a, "default", 1)
};
CKEDITOR.filter.instances = {};
CKEDITOR.filter.prototype = {
allow: function(a, b, d) {
if (this.disabled || this.customConfig && !d ||
!a) return !1;
this._.cachedChecks = {};
var e, m;
if ("string" == typeof a) a = g(a);
else if (a instanceof CKEDITOR.style) m = a.getDefinition(), d = {}, a = m.attributes, d[m.element] = m = {
styles: m.styles,
requiredStyles: m.styles && CKEDITOR.tools.objectKeys(m.styles)
}, a && (a = C(a), m.classes = a["class"] ? a["class"].split(/\s+/) : null, m.requiredClasses = m.classes, delete a["class"], m.attributes = a, m.requiredAttributes = a && CKEDITOR.tools.objectKeys(a)), a = d;
else if (CKEDITOR.tools.isArray(a)) {
for (e = 0; e < a.length; ++e) m = this.allow(a[e], b, d);
return m
}
var h;
d = [];
for (h in a) {
m = a[h];
m = "boolean" == typeof m ? {} : "function" == typeof m ? {
match: m
} : C(m);
"$" != h.charAt(0) && (m.elements = h);
b && (m.featureName = b.toLowerCase());
var k = m;
k.elements = c(k.elements, /\s+/) || null;
k.propertiesOnly = k.propertiesOnly || !0 === k.elements;
var l = /\s*,\s*/,
f = void 0;
for (f in A) {
k[f] = c(k[f], l) || null;
var p = k,
x = D[f],
n = c(k[D[f]], l),
t = k[f],
u = [],
s = !0,
y = void 0;
n ? s = !1 : n = {};
for (y in t) "!" == y.charAt(0) && (y = y.slice(1), u.push(y), n[y] = !0, s = !1);
for (; y = u.pop();) t[y] = t["!" + y], delete t["!" + y];
p[x] = (s ? !1 : n) || null
}
k.match = k.match || null;
this.allowedContent.push(m);
d.push(m)
}
b = this._.rules;
h = b.elements || {};
a = b.generic || [];
m = 0;
for (k = d.length; m < k; ++m) {
l = C(d[m]);
f = !0 === l.classes || !0 === l.styles || !0 === l.attributes;
p = l;
x = void 0;
for (x in A) p[x] = q(p[x]);
n = !0;
for (x in D) x = D[x], p[x] = CKEDITOR.tools.objectKeys(p[x]), p[x] && (n = !1);
p.nothingRequired = n;
if (!0 === l.elements || null === l.elements) l.elements = q(l.elements), a[f ? "unshift" : "push"](l);
else
for (e in p = l.elements, delete l.elements, p)
if (h[e]) h[e][f ? "unshift" :
"push"
](l);
else h[e] = [l]
}
b.elements = h;
b.generic = a.length ? a : null;
return !0
},
applyTo: function(b, c, d, e) {
if (this.disabled) return !1;
var h = [],
g = !d && this._.rules,
k = this._.transformations,
l = a(this),
f = this.editor && this.editor.config.protectedSource,
p = !1;
b.forEach(function(a) {
if (a.type == CKEDITOR.NODE_ELEMENT) {
if ("off" == a.attributes["data-cke-filter"]) return !1;
if (!c || !("span" == a.name && ~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-"))) l(a, g, k, h, c) && (p = !0)
} else if (a.type == CKEDITOR.NODE_COMMENT &&
a.value.match(/^\{cke_protected\}(?!\{C\})/)) {
var b;
a: {
var d = decodeURIComponent(a.value.replace(/^\{cke_protected\}/, ""));
b = [];
var e, m, J;
if (f)
for (m = 0; m < f.length; ++m)
if ((J = d.match(f[m])) && J[0].length == d.length) {
b = !0;
break a
}
d = CKEDITOR.htmlParser.fragment.fromHtml(d);
1 == d.children.length && (e = d.children[0]).type == CKEDITOR.NODE_ELEMENT && l(e, g, k, b, c);
b = !b.length
}
b || h.push(a)
}
}, null, !0);
h.length && (p = !0);
var x;
b = [];
for (e = G[e || (this.editor ? this.editor.enterMode : CKEDITOR.ENTER_P)]; d = h.pop();) d.type == CKEDITOR.NODE_ELEMENT ?
m(d, e, b) : d.remove();
for (; x = b.pop();)
if (d = x.el, d.parent) switch (x.check) {
case "it":
z.$removeEmpty[d.name] && !d.children.length ? m(d, e, b) : n(d) || m(d, e, b);
break;
case "el-up":
d.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT && !z[d.parent.name][d.name] && m(d, e, b);
break;
case "parent-down":
d.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT && !z[d.parent.name][d.name] && m(d.parent, e, b)
}
return p
},
checkFeature: function(a) {
if (this.disabled || !a) return !0;
a.toFeature && (a = a.toFeature(this.editor));
return !a.requiredContent || this.check(a.requiredContent)
},
disable: function() {
this.disabled = !0
},
addContentForms: function(a) {
if (!this.disabled && a) {
var b, c, d = [],
e;
for (b = 0; b < a.length && !e; ++b)
if (c = a[b], ("string" == typeof c || c instanceof CKEDITOR.style) && this.check(c)) e = c;
if (e) {
for (b = 0; b < a.length; ++b) d.push(t(a[b], e));
this.addTransformations(d)
}
}
},
addFeature: function(a) {
if (this.disabled || !a) return !0;
a.toFeature && (a = a.toFeature(this.editor));
this.allow(a.allowedContent, a.name);
this.addTransformations(a.contentTransformations);
this.addContentForms(a.contentForms);
return this.customConfig && a.requiredContent ? this.check(a.requiredContent) : !0
},
addTransformations: function(a) {
var b, c;
if (!this.disabled && a) {
var d = this._.transformations,
e;
for (e = 0; e < a.length; ++e) {
b = a[e];
var m = void 0,
h = void 0,
g = void 0,
k = void 0,
l = void 0,
f = void 0;
c = [];
for (h = 0; h < b.length; ++h) g = b[h], "string" == typeof g ? (g = g.split(/\s*:\s*/), k = g[0], l = null, f = g[1]) : (k = g.check, l = g.left, f = g.right), m || (m = g, m = m.element ? m.element : k ? k.match(/^([a-z0-9]+)/i)[0] : m.left.getDefinition().element), l instanceof CKEDITOR.style &&
(l = x(l)), c.push({
check: k == m ? null : k,
left: l,
right: "string" == typeof f ? y(f) : f
});
b = m;
d[b] || (d[b] = []);
d[b].push(c)
}
}
},
check: function(b, c, d) {
if (this.disabled) return !0;
if (CKEDITOR.tools.isArray(b)) {
for (var m = b.length; m--;)
if (this.check(b[m], c, d)) return !0;
return !1
}
var h, k;
if ("string" == typeof b) {
k = b + "<" + (!1 === c ? "0" : "1") + (d ? "1" : "0") + ">";
if (k in this._.cachedChecks) return this._.cachedChecks[k];
m = g(b).$1;
h = m.styles;
var f = m.classes;
m.name = m.elements;
m.classes = f = f ? f.split(/\s*,\s*/) : [];
m.styles = e(h);
m.attributes =
e(m.attributes);
m.children = [];
f.length && (m.attributes["class"] = f.join(" "));
h && (m.attributes.style = CKEDITOR.tools.writeCssText(m.styles));
h = m
} else m = b.getDefinition(), h = m.styles, f = m.attributes || {}, h ? (h = C(h), f.style = CKEDITOR.tools.writeCssText(h, !0)) : h = {}, h = {
name: m.element,
attributes: f,
classes: f["class"] ? f["class"].split(/\s+/) : [],
styles: h,
children: []
};
var f = CKEDITOR.tools.clone(h),
x = [],
n;
if (!1 !== c && (n = this._.transformations[h.name])) {
for (m = 0; m < n.length; ++m) p(this, h, n[m]);
l(h)
}
a(this)(f, this._.rules, !1 === c ? !1 : this._.transformations, x, !1, !d, !d);
c = 0 < x.length ? !1 : CKEDITOR.tools.objectCompare(h.attributes, f.attributes, !0) ? !0 : !1;
"string" == typeof b && (this._.cachedChecks[k] = c);
return c
},
getAllowedEnterMode: function() {
var a = ["p", "div", "br"],
b = {
p: CKEDITOR.ENTER_P,
div: CKEDITOR.ENTER_DIV,
br: CKEDITOR.ENTER_BR
};
return function(c, d) {
var e = a.slice(),
m;
if (this.check(G[c])) return c;
for (d || (e = e.reverse()); m = e.pop();)
if (this.check(m)) return b[m];
return CKEDITOR.ENTER_BR
}
}()
};
var A = {
styles: 1,
attributes: 1,
classes: 1
},
D = {
styles: "requiredStyles",
attributes: "requiredAttributes",
classes: "requiredClasses"
},
B = /^([a-z0-9*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,
M = {
styles: /{([^}]+)}/,
attrs: /\[([^\]]+)\]/,
classes: /\(([^\)]+)\)/
},
F = CKEDITOR.filter.transformationsTools = {
sizeToStyle: function(a) {
this.lengthToStyle(a, "width");
this.lengthToStyle(a, "height")
},
sizeToAttribute: function(a) {
this.lengthToAttribute(a, "width");
this.lengthToAttribute(a, "height")
},
lengthToStyle: function(a,
b, c) {
c = c || b;
if (!(c in a.styles)) {
var d = a.attributes[b];
d && (/^\d+$/.test(d) && (d += "px"), a.styles[c] = d)
}
delete a.attributes[b]
},
lengthToAttribute: function(a, b, c) {
c = c || b;
if (!(c in a.attributes)) {
var d = a.styles[b],
e = d && d.match(/^(\d+)(?:\.\d*)?px$/);
e ? a.attributes[c] = e[1] : d == v && (a.attributes[c] = v)
}
delete a.styles[b]
},
alignmentToStyle: function(a) {
if (!("float" in a.styles)) {
var b = a.attributes.align;
if ("left" == b || "right" == b) a.styles["float"] = b
}
delete a.attributes.align
},
alignmentToAttribute: function(a) {
if (!("align" in
a.attributes)) {
var b = a.styles["float"];
if ("left" == b || "right" == b) a.attributes.align = b
}
delete a.styles["float"]
},
matchesStyle: w,
transform: function(a, b) {
if ("string" == typeof b) a.name = b;
else {
var c = b.getDefinition(),
d = c.styles,
e = c.attributes,
m, h, g, k;
a.name = c.element;
for (m in e)
if ("class" == m) {
c = a.classes.join("|");
for (g = e[m].split(/\s+/); k = g.pop();) - 1 == c.indexOf(k) && a.classes.push(k)
} else a.attributes[m] = e[m];
for (h in d) a.styles[h] = d[h]
}
}
}
}(),
function() {
CKEDITOR.focusManager = function(d) {
if (d.focusManager) return d.focusManager;
this.hasFocus = !1;
this.currentActive = null;
this._ = {
editor: d
};
return this
};
CKEDITOR.focusManager._ = {
blurDelay: 200
};
CKEDITOR.focusManager.prototype = {
focus: function(d) {
this._.timer && clearTimeout(this._.timer);
d && (this.currentActive = d);
!this.hasFocus && !this._.locked && ((d = CKEDITOR.currentInstance) && d.focusManager.blur(1), this.hasFocus = !0, (d = this._.editor.container) && d.addClass("cke_focus"), this._.editor.fire("focus"))
},
lock: function() {
this._.locked = 1
},
unlock: function() {
delete this._.locked
},
blur: function(d) {
function f() {
if (this.hasFocus) {
this.hasFocus = !1;
var a = this._.editor.container;
a && a.removeClass("cke_focus");
this._.editor.fire("blur")
}
}
if (!this._.locked) {
this._.timer && clearTimeout(this._.timer);
var c = CKEDITOR.focusManager._.blurDelay;
d || !c ? f.call(this) : this._.timer = CKEDITOR.tools.setTimeout(function() {
delete this._.timer;
f.call(this)
}, c, this)
}
},
add: function(d, f) {
var c = d.getCustomData("focusmanager");
if (!c || c != this) {
c && c.remove(d);
var c = "focus",
a = "blur";
f && (CKEDITOR.env.ie ? (c = "focusin", a = "focusout") : CKEDITOR.event.useCapture = 1);
var b = {
blur: function() {
d.equals(this.currentActive) &&
this.blur()
},
focus: function() {
this.focus(d)
}
};
d.on(c, b.focus, this);
d.on(a, b.blur, this);
f && (CKEDITOR.event.useCapture = 0);
d.setCustomData("focusmanager", this);
d.setCustomData("focusmanager_handlers", b)
}
},
remove: function(d) {
d.removeCustomData("focusmanager");
var f = d.removeCustomData("focusmanager_handlers");
d.removeListener("blur", f.blur);
d.removeListener("focus", f.focus)
}
}
}(), CKEDITOR.keystrokeHandler = function(d) {
if (d.keystrokeHandler) return d.keystrokeHandler;
this.keystrokes = {};
this.blockedKeystrokes = {};
this._ = {
editor: d
};
return this
},
function() {
var d, f = function(a) {
a = a.data;
var b = a.getKeystroke(),
c = this.keystrokes[b],
g = this._.editor;
d = !1 === g.fire("key", {
keyCode: b
});
d || (c && (d = !1 !== g.execCommand(c, {
from: "keystrokeHandler"
})), d || (d = !!this.blockedKeystrokes[b]));
d && a.preventDefault(!0);
return !d
},
c = function(a) {
d && (d = !1, a.data.preventDefault(!0))
};
CKEDITOR.keystrokeHandler.prototype = {
attach: function(a) {
a.on("keydown", f, this);
if (CKEDITOR.env.opera || CKEDITOR.env.gecko && CKEDITOR.env.mac) a.on("keypress",
c, this)
}
}
}(),
function() {
CKEDITOR.lang = {
languages: {
af: 1,
ar: 1,
bg: 1,
bn: 1,
bs: 1,
ca: 1,
cs: 1,
cy: 1,
da: 1,
de: 1,
el: 1,
"en-au": 1,
"en-ca": 1,
"en-gb": 1,
en: 1,
eo: 1,
es: 1,
et: 1,
eu: 1,
fa: 1,
fi: 1,
fo: 1,
"fr-ca": 1,
fr: 1,
gl: 1,
gu: 1,
he: 1,
hi: 1,
hr: 1,
hu: 1,
id: 1,
is: 1,
it: 1,
ja: 1,
ka: 1,
km: 1,
ko: 1,
ku: 1,
lt: 1,
lv: 1,
mk: 1,
mn: 1,
ms: 1,
nb: 1,
nl: 1,
no: 1,
pl: 1,
"pt-br": 1,
pt: 1,
ro: 1,
ru: 1,
si: 1,
sk: 1,
sl: 1,
sq: 1,
"sr-latn": 1,
sr: 1,
sv: 1,
th: 1,
tr: 1,
ug: 1,
uk: 1,
vi: 1,
"zh-cn": 1,
zh: 1
},
rtl: {
ar: 1,
fa: 1,
he: 1,
ku: 1,
ug: 1
},
load: function(d, f, c) {
if (!d || !CKEDITOR.lang.languages[d]) d =
this.detect(f, d);
this[d] ? c(d, this[d]) : CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/" + d + ".js"), function() {
this[d].dir = this.rtl[d] ? "rtl" : "ltr";
c(d, this[d])
}, this)
},
detect: function(d, f) {
var c = this.languages;
f = f || navigator.userLanguage || navigator.language || d;
var a = f.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),
b = a[1],
a = a[2];
c[b + "-" + a] ? b = b + "-" + a : c[b] || (b = null);
CKEDITOR.lang.detect = b ? function() {
return b
} : function(a) {
return a
};
return b || d
}
}
}(), CKEDITOR.scriptLoader = function() {
var d = {},
f = {};
return {
load: function(c,
a, b, e) {
var g = "string" == typeof c;
g && (c = [c]);
b || (b = CKEDITOR);
var k = c.length,
h = [],
l = [],
n = function(c) {
a && (g ? a.call(b, c) : a.call(b, h, l))
};
if (0 === k) n(!0);
else {
var q = function(a, b) {
(b ? h : l).push(a);
0 >= --k && (e && CKEDITOR.document.getDocumentElement().removeStyle("cursor"), n(b))
},
r = function(a, b) {
d[a] = 1;
var c = f[a];
delete f[a];
for (var e = 0; e < c.length; e++) c[e](a, b)
},
u = function(b) {
if (d[b]) q(b, !0);
else {
var c = f[b] || (f[b] = []);
c.push(q);
if (!(1 < c.length)) {
var e = new CKEDITOR.dom.element("script");
e.setAttributes({
type: "text/javascript",
src: b
});
a && (CKEDITOR.env.ie && 11 > CKEDITOR.env.version ? e.$.onreadystatechange = function() {
if ("loaded" == e.$.readyState || "complete" == e.$.readyState) e.$.onreadystatechange = null, r(b, !0)
} : (e.$.onload = function() {
setTimeout(function() {
r(b, !0)
}, 0)
}, e.$.onerror = function() {
r(b, !1)
}));
e.appendTo(CKEDITOR.document.getHead())
}
}
};
e && CKEDITOR.document.getDocumentElement().setStyle("cursor", "wait");
for (var m = 0; m < k; m++) u(c[m])
}
},
queue: function() {
function c() {
var b;
(b = a[0]) && this.load(b.scriptUrl, b.callback, CKEDITOR,
0)
}
var a = [];
return function(b, d) {
var g = this;
a.push({
scriptUrl: b,
callback: function() {
d && d.apply(this, arguments);
a.shift();
c.call(g)
}
});
1 == a.length && c.call(this)
}
}()
}
}(), CKEDITOR.resourceManager = function(d, f) {
this.basePath = d;
this.fileName = f;
this.registered = {};
this.loaded = {};
this.externals = {};
this._ = {
waitingList: {}
}
}, CKEDITOR.resourceManager.prototype = {
add: function(d, f) {
if (this.registered[d]) throw '[CKEDITOR.resourceManager.add] The resource name "' + d + '" is already registered.';
var c = this.registered[d] =
f || {};
c.name = d;
c.path = this.getPath(d);
CKEDITOR.fire(d + CKEDITOR.tools.capitalize(this.fileName) + "Ready", c);
return this.get(d)
},
get: function(d) {
return this.registered[d] || null
},
getPath: function(d) {
var f = this.externals[d];
return CKEDITOR.getUrl(f && f.dir || this.basePath + d + "/")
},
getFilePath: function(d) {
var f = this.externals[d];
return CKEDITOR.getUrl(this.getPath(d) + (f ? f.file : this.fileName + ".js"))
},
addExternal: function(d, f, c) {
d = d.split(",");
for (var a = 0; a < d.length; a++) {
var b = d[a];
c || (f = f.replace(/[^\/]+$/,
function(a) {
c = a;
return ""
}));
this.externals[b] = {
dir: f,
file: c || this.fileName + ".js"
}
}
},
load: function(d, f, c) {
CKEDITOR.tools.isArray(d) || (d = d ? [d] : []);
for (var a = this.loaded, b = this.registered, e = [], g = {}, k = {}, h = 0; h < d.length; h++) {
var l = d[h];
if (l)
if (!a[l] && !b[l]) {
var n = this.getFilePath(l);
e.push(n);
n in g || (g[n] = []);
g[n].push(l)
} else k[l] = this.get(l)
}
CKEDITOR.scriptLoader.load(e, function(b, d) {
if (d.length) throw '[CKEDITOR.resourceManager.load] Resource name "' + g[d[0]].join(",") + '" was not found at "' + d[0] + '".';
for (var e = 0; e < b.length; e++)
for (var m = g[b[e]], h = 0; h < m.length; h++) {
var l = m[h];
k[l] = this.get(l);
a[l] = 1
}
f.call(c, k)
}, this)
}
}, CKEDITOR.plugins = new CKEDITOR.resourceManager("plugins/", "plugin"), CKEDITOR.plugins.load = CKEDITOR.tools.override(CKEDITOR.plugins.load, function(d) {
var f = {};
return function(c, a, b) {
var e = {},
g = function(c) {
d.call(this, c, function(c) {
CKEDITOR.tools.extend(e, c);
var d = [],
k;
for (k in c) {
var q = c[k],
r = q && q.requires;
if (!f[k]) {
if (q.icons)
for (var u = q.icons.split(","), m = u.length; m--;) CKEDITOR.skin.addIcon(u[m],
q.path + "icons/" + (CKEDITOR.env.hidpi && q.hidpi ? "hidpi/" : "") + u[m] + ".png");
f[k] = 1
}
if (r) {
r.split && (r = r.split(","));
for (q = 0; q < r.length; q++) e[r[q]] || d.push(r[q])
}
}
if (d.length) g.call(this, d);
else {
for (k in e) q = e[k], q.onLoad && !q.onLoad._called && (!1 === q.onLoad() && delete e[k], q.onLoad._called = 1);
a && a.call(b || window, e)
}
}, this)
};
g.call(this, c)
}
}), CKEDITOR.plugins.setLang = function(d, f, c) {
var a = this.get(d);
d = a.langEntries || (a.langEntries = {});
a = a.lang || (a.lang = []);
a.split && (a = a.split(",")); - 1 == CKEDITOR.tools.indexOf(a,
f) && a.push(f);
d[f] = c
}, CKEDITOR.ui = function(d) {
if (d.ui) return d.ui;
this.items = {};
this.instances = {};
this.editor = d;
this._ = {
handlers: {}
};
return this
}, CKEDITOR.ui.prototype = {
add: function(d, f, c) {
c.name = d.toLowerCase();
var a = this.items[d] = {
type: f,
command: c.command || null,
args: Array.prototype.slice.call(arguments, 2)
};
CKEDITOR.tools.extend(a, c)
},
get: function(d) {
return this.instances[d]
},
create: function(d) {
var f = this.items[d],
c = f && this._.handlers[f.type],
a = f && f.command && this.editor.getCommand(f.command),
c = c &&
c.create.apply(this, f.args);
this.instances[d] = c;
a && a.uiItems.push(c);
c && !c.type && (c.type = f.type);
return c
},
addHandler: function(d, f) {
this._.handlers[d] = f
},
space: function(d) {
return CKEDITOR.document.getById(this.spaceId(d))
},
spaceId: function(d) {
return this.editor.id + "_" + d
}
}, CKEDITOR.event.implementOn(CKEDITOR.ui),
function() {
function d(a, d, e) {
CKEDITOR.event.call(this);
a = a && CKEDITOR.tools.clone(a);
if (void 0 !== d) {
if (d instanceof CKEDITOR.dom.element) {
if (!e) throw Error("One of the element modes must be specified.");
} else throw Error("Expect element of type CKEDITOR.dom.element.");
if (CKEDITOR.env.ie && CKEDITOR.env.quirks && e == CKEDITOR.ELEMENT_MODE_INLINE) throw Error("Inline element mode is not supported on IE quirks.");
if (!(e == CKEDITOR.ELEMENT_MODE_INLINE ? d.is(CKEDITOR.dtd.$editable) || d.is("textarea") : e == CKEDITOR.ELEMENT_MODE_REPLACE ? !d.is(CKEDITOR.dtd.$nonBodyContent) : 1)) throw Error('The specified element mode is not supported on element: "' + d.getName() + '".');
this.element = d;
this.elementMode = e;
this.name = this.elementMode !=
CKEDITOR.ELEMENT_MODE_APPENDTO && (d.getId() || d.getNameAtt())
} else this.elementMode = CKEDITOR.ELEMENT_MODE_NONE;
this._ = {};
this.commands = {};
this.templates = {};
this.name = this.name || f();
this.id = CKEDITOR.tools.getNextId();
this.status = "unloaded";
this.config = CKEDITOR.tools.prototypedCopy(CKEDITOR.config);
this.ui = new CKEDITOR.ui(this);
this.focusManager = new CKEDITOR.focusManager(this);
this.keystrokeHandler = new CKEDITOR.keystrokeHandler(this);
this.on("readOnly", c);
this.on("selectionChange", function(a) {
b(this,
a.data.path)
});
this.on("activeFilterChange", function() {
b(this, this.elementPath(), !0)
});
this.on("mode", c);
this.on("instanceReady", function() {
this.config.startupFocus && this.focus()
});
CKEDITOR.fire("instanceCreated", null, this);
CKEDITOR.add(this);
CKEDITOR.tools.setTimeout(function() {
g(this, a)
}, 0, this)
}
function f() {
do var a = "editor" + ++r; while (CKEDITOR.instances[a]);
return a
}
function c() {
var b = this.commands,
c;
for (c in b) a(this, b[c])
}
function a(a, b) {
b[b.startDisabled ? "disable" : a.readOnly && !b.readOnly ? "disable" :
b.modes[a.mode] ? "enable" : "disable"]()
}
function b(a, b, c) {
if (b) {
var d, e, h = a.commands;
for (e in h) d = h[e], (c || d.contextSensitive) && d.refresh(a, b)
}
}
function e(a) {
var b = a.config.customConfig;
if (!b) return !1;
var b = CKEDITOR.getUrl(b),
c = u[b] || (u[b] = {});
c.fn ? (c.fn.call(a, a.config), (CKEDITOR.getUrl(a.config.customConfig) == b || !e(a)) && a.fireOnce("customConfigLoaded")) : CKEDITOR.scriptLoader.queue(b, function() {
c.fn = CKEDITOR.editorConfig ? CKEDITOR.editorConfig : function() {};
e(a)
});
return !0
}
function g(a, b) {
a.on("customConfigLoaded",
function() {
if (b) {
if (b.on)
for (var c in b.on) a.on(c, b.on[c]);
CKEDITOR.tools.extend(a.config, b, !0);
delete a.config.on
}
c = a.config;
a.readOnly = !(!c.readOnly && !(a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.is("textarea") ? a.element.hasAttribute("disabled") : a.element.isReadOnly() : a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && a.element.hasAttribute("disabled")));
a.blockless = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? !(a.element.is("textarea") || CKEDITOR.dtd[a.element.getName()].p) : !1;
a.tabIndex = c.tabIndex ||
a.element && a.element.getAttribute("tabindex") || 0;
a.activeEnterMode = a.enterMode = a.blockless ? CKEDITOR.ENTER_BR : c.enterMode;
a.activeShiftEnterMode = a.shiftEnterMode = a.blockless ? CKEDITOR.ENTER_BR : c.shiftEnterMode;
c.skin && (CKEDITOR.skinName = c.skin);
a.fireOnce("configLoaded");
a.dataProcessor = new CKEDITOR.htmlDataProcessor(a);
a.filter = a.activeFilter = new CKEDITOR.filter(a);
k(a)
});
b && void 0 != b.customConfig && (a.config.customConfig = b.customConfig);
e(a) || a.fireOnce("customConfigLoaded")
}
function k(a) {
CKEDITOR.skin.loadPart("editor",
function() {
h(a)
})
}
function h(a) {
CKEDITOR.lang.load(a.config.language, a.config.defaultLanguage, function(b, c) {
var d = a.config.title;
a.langCode = b;
a.lang = CKEDITOR.tools.prototypedCopy(c);
a.title = "string" == typeof d || !1 === d ? d : [a.lang.editor, a.name].join(", ");
CKEDITOR.env.gecko && (10900 > CKEDITOR.env.version && "rtl" == a.lang.dir) && (a.lang.dir = "ltr");
a.config.contentsLangDirection || (a.config.contentsLangDirection = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.getDirection(1) : a.lang.dir);
a.fire("langLoaded");
l(a)
})
}
function l(a) {
a.getStylesSet(function(b) {
a.once("loaded", function() {
a.fire("stylesSet", {
styles: b
})
}, null, null, 1);
n(a)
})
}
function n(a) {
var b = a.config,
c = b.plugins,
d = b.extraPlugins,
e = b.removePlugins;
if (d) var h = RegExp("(?:^|,)(?:" + d.replace(/\s*,\s*/g, "|") + ")(?=,|$)", "g"),
c = c.replace(h, ""),
c = c + ("," + d);
if (e) var g = RegExp("(?:^|,)(?:" + e.replace(/\s*,\s*/g, "|") + ")(?=,|$)", "g"),
c = c.replace(g, "");
CKEDITOR.env.air && (c += ",adobeair");
CKEDITOR.plugins.load(c.split(","), function(c) {
var d = [],
e = [],
h = [];
a.plugins =
c;
for (var k in c) {
var f = c[k],
l = f.lang,
x = null,
n = f.requires,
t;
CKEDITOR.tools.isArray(n) && (n = n.join(","));
if (n && (t = n.match(g)))
for (; n = t.pop();) CKEDITOR.tools.setTimeout(function(a, b) {
throw Error('Plugin "' + a.replace(",", "") + '" cannot be removed from the plugins list, because it\'s required by "' + b + '" plugin.');
}, 0, null, [n, k]);
l && !a.lang[k] && (l.split && (l = l.split(",")), 0 <= CKEDITOR.tools.indexOf(l, a.langCode) ? x = a.langCode : (x = a.langCode.replace(/-.*/, ""), x = x != a.langCode && 0 <= CKEDITOR.tools.indexOf(l, x) ? x :
0 <= CKEDITOR.tools.indexOf(l, "en") ? "en" : l[0]), !f.langEntries || !f.langEntries[x] ? h.push(CKEDITOR.getUrl(f.path + "lang/" + x + ".js")) : (a.lang[k] = f.langEntries[x], x = null));
e.push(x);
d.push(f)
}
CKEDITOR.scriptLoader.load(h, function() {
for (var c = ["beforeInit", "init", "afterInit"], h = 0; h < c.length; h++)
for (var g = 0; g < d.length; g++) {
var k = d[g];
0 === h && e[g] && (k.lang && k.langEntries) && (a.lang[k.name] = k.langEntries[e[g]]);
if (k[c[h]]) k[c[h]](a)
}
a.fireOnce("pluginsLoaded");
b.keystrokes && a.setKeystroke(a.config.keystrokes);
for (g = 0; g < a.config.blockedKeystrokes.length; g++) a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[g]] = 1;
a.status = "loaded";
a.fireOnce("loaded");
CKEDITOR.fire("instanceLoaded", null, a)
})
})
}
function q() {
var a = this.element;
if (a && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) {
var b = this.getData();
this.config.htmlEncodeOutput && (b = CKEDITOR.tools.htmlEncode(b));
a.is("textarea") ? a.setValue(b) : a.setHtml(b);
return !0
}
return !1
}
d.prototype = CKEDITOR.editor.prototype;
CKEDITOR.editor = d;
var r = 0,
u = {};
CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
addCommand: function(b, c) {
c.name = b.toLowerCase();
var d = new CKEDITOR.command(this, c);
this.mode && a(this, d);
return this.commands[b] = d
},
_attachToForm: function() {
var a = this,
b = a.element,
c = new CKEDITOR.dom.element(b.$.form);
if (b.is("textarea") && c) {
var d = function(c) {
a.updateElement();
a._.required && !b.getValue() && !1 === a.fire("required") && c.data.preventDefault()
};
c.on("submit", d);
c.$.submit && (c.$.submit.call && c.$.submit.apply) && (c.$.submit = CKEDITOR.tools.override(c.$.submit,
function(a) {
return function() {
d();
a.apply ? a.apply(this) : a()
}
}));
a.on("destroy", function() {
c.removeListener("submit", d)
})
}
},
destroy: function(a) {
this.fire("beforeDestroy");
!a && q.call(this);
this.editable(null);
this.status = "destroyed";
this.fire("destroy");
this.removeAllListeners();
CKEDITOR.remove(this);
CKEDITOR.fire("instanceDestroyed", null, this)
},
elementPath: function(a) {
return (a = a || this.getSelection().getStartElement()) ? new CKEDITOR.dom.elementPath(a, this.editable()) : null
},
createRange: function() {
var a =
this.editable();
return a ? new CKEDITOR.dom.range(a) : null
},
execCommand: function(a, b) {
var c = this.getCommand(a),
d = {
name: a,
commandData: b,
command: c
};
return c && (c.state != CKEDITOR.TRISTATE_DISABLED && !0 !== this.fire("beforeCommandExec", d)) && (d.returnValue = c.exec(d.commandData), !c.async && !0 !== this.fire("afterCommandExec", d)) ? d.returnValue : !1
},
getCommand: function(a) {
return this.commands[a]
},
getData: function(a) {
!a && this.fire("beforeGetData");
var b = this._.data;
"string" != typeof b && (b = (b = this.element) && this.elementMode ==
CKEDITOR.ELEMENT_MODE_REPLACE ? b.is("textarea") ? b.getValue() : b.getHtml() : "");
b = {
dataValue: b
};
!a && this.fire("getData", b);
return b.dataValue
},
getSnapshot: function() {
var a = this.fire("getSnapshot");
if ("string" != typeof a) {
var b = this.element;
b && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (a = b.is("textarea") ? b.getValue() : b.getHtml())
}
return a
},
loadSnapshot: function(a) {
this.fire("loadSnapshot", a)
},
setData: function(a, b, c) {
if (b) this.on("dataReady", function(a) {
a.removeListener();
b.call(a.editor)
});
a = {
dataValue: a
};
!c && this.fire("setData", a);
this._.data = a.dataValue;
!c && this.fire("afterSetData", a)
},
setReadOnly: function(a) {
a = void 0 == a || a;
this.readOnly != a && (this.readOnly = a, this.keystrokeHandler.blockedKeystrokes[8] = +a, this.editable().setReadOnly(a), this.fire("readOnly"))
},
insertHtml: function(a, b) {
this.fire("insertHtml", {
dataValue: a,
mode: b
})
},
insertText: function(a) {
this.fire("insertText", a)
},
insertElement: function(a) {
this.fire("insertElement", a)
},
focus: function() {
this.fire("beforeFocus")
},
checkDirty: function() {
return "ready" ==
this.status && this._.previousValue !== this.getSnapshot()
},
resetDirty: function() {
this._.previousValue = this.getSnapshot()
},
updateElement: function() {
return q.call(this)
},
setKeystroke: function() {
for (var a = this.keystrokeHandler.keystrokes, b = CKEDITOR.tools.isArray(arguments[0]) ? arguments[0] : [
[].slice.call(arguments, 0)
], c, d, e = b.length; e--;) c = b[e], d = 0, CKEDITOR.tools.isArray(c) && (d = c[1], c = c[0]), d ? a[c] = d : delete a[c]
},
addFeature: function(a) {
return this.filter.addFeature(a)
},
setActiveFilter: function(a) {
a || (a = this.filter);
this.activeFilter !== a && (this.activeFilter = a, this.fire("activeFilterChange"), a === this.filter ? this.setActiveEnterMode(null, null) : this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode), a.getAllowedEnterMode(this.shiftEnterMode, !0)))
},
setActiveEnterMode: function(a, b) {
a = a ? this.blockless ? CKEDITOR.ENTER_BR : a : this.enterMode;
b = b ? this.blockless ? CKEDITOR.ENTER_BR : b : this.shiftEnterMode;
if (this.activeEnterMode != a || this.activeShiftEnterMode != b) this.activeEnterMode = a, this.activeShiftEnterMode = b, this.fire("activeEnterModeChange")
}
})
}(),
CKEDITOR.ELEMENT_MODE_NONE = 0, CKEDITOR.ELEMENT_MODE_REPLACE = 1, CKEDITOR.ELEMENT_MODE_APPENDTO = 2, CKEDITOR.ELEMENT_MODE_INLINE = 3, CKEDITOR.htmlParser = function() {
this._ = {
htmlPartsRegex: RegExp("<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)--\x3e)|(?:([^\\s>]+)\\s*((?:(?:\"[^\"]*\")|(?:'[^']*')|[^\"'>])*)\\/?>))", "g")
}
},
function() {
var d = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,
f = {
checked: 1,
compact: 1,
declare: 1,
defer: 1,
disabled: 1,
ismap: 1,
multiple: 1,
nohref: 1,
noresize: 1,
noshade: 1,
nowrap: 1,
readonly: 1,
selected: 1
};
CKEDITOR.htmlParser.prototype = {
onTagOpen: function() {},
onTagClose: function() {},
onText: function() {},
onCDATA: function() {},
onComment: function() {},
parse: function(c) {
for (var a, b, e = 0, g; a = this._.htmlPartsRegex.exec(c);) {
b = a.index;
if (b > e)
if (e = c.substring(e, b), g) g.push(e);
else this.onText(e);
e = this._.htmlPartsRegex.lastIndex;
if (b = a[1])
if (b = b.toLowerCase(), g && CKEDITOR.dtd.$cdata[b] && (this.onCDATA(g.join("")), g = null), !g) {
this.onTagClose(b);
continue
}
if (g) g.push(a[0]);
else if (b =
a[3]) {
if (b = b.toLowerCase(), !/="/.test(b)) {
var k = {},
h;
a = a[4];
var l = !!(a && "/" == a.charAt(a.length - 1));
if (a)
for (; h = d.exec(a);) {
var n = h[1].toLowerCase();
h = h[2] || h[3] || h[4] || "";
k[n] = !h && f[n] ? n : CKEDITOR.tools.htmlDecodeAttr(h)
}
this.onTagOpen(b, k, l);
!g && CKEDITOR.dtd.$cdata[b] && (g = [])
}
} else if (b = a[2]) this.onComment(b)
}
if (c.length > e) this.onText(c.substring(e, c.length))
}
}
}(), CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass({
$: function() {
this._ = {
output: []
}
},
proto: {
openTag: function(d) {
this._.output.push("<",
d)
},
openTagClose: function(d, f) {
f ? this._.output.push(" />") : this._.output.push(">")
},
attribute: function(d, f) {
"string" == typeof f && (f = CKEDITOR.tools.htmlEncodeAttr(f));
this._.output.push(" ", d, '="', f, '"')
},
closeTag: function(d) {
this._.output.push("</", d, ">")
},
text: function(d) {
this._.output.push(d)
},
comment: function(d) {
this._.output.push("\x3c!--", d, "--\x3e")
},
write: function(d) {
this._.output.push(d)
},
reset: function() {
this._.output = [];
this._.indent = !1
},
getHtml: function(d) {
var f = this._.output.join("");
d &&
this.reset();
return f
}
}
}), "use strict",
function() {
CKEDITOR.htmlParser.node = function() {};
CKEDITOR.htmlParser.node.prototype = {
remove: function() {
var d = this.parent.children,
f = CKEDITOR.tools.indexOf(d, this),
c = this.previous,
a = this.next;
c && (c.next = a);
a && (a.previous = c);
d.splice(f, 1);
this.parent = null
},
replaceWith: function(d) {
var f = this.parent.children,
c = CKEDITOR.tools.indexOf(f, this),
a = d.previous = this.previous,
b = d.next = this.next;
a && (a.next = d);
b && (b.previous = d);
f[c] = d;
d.parent = this.parent;
this.parent = null
},
insertAfter: function(d) {
var f = d.parent.children,
c = CKEDITOR.tools.indexOf(f, d),
a = d.next;
f.splice(c + 1, 0, this);
this.next = d.next;
this.previous = d;
d.next = this;
a && (a.previous = this);
this.parent = d.parent
},
insertBefore: function(d) {
var f = d.parent.children,
c = CKEDITOR.tools.indexOf(f, d);
f.splice(c, 0, this);
this.next = d;
(this.previous = d.previous) && (d.previous.next = this);
d.previous = this;
this.parent = d.parent
},
getAscendant: function(d) {
var f = "function" == typeof d ? d : "string" == typeof d ? function(a) {
return a.name == d
} : function(a) {
return a.name in
d
},
c = this.parent;
for (; c && c.type == CKEDITOR.NODE_ELEMENT;) {
if (f(c)) return c;
c = c.parent
}
return null
},
wrapWith: function(d) {
this.replaceWith(d);
d.add(this);
return d
},
getIndex: function() {
return CKEDITOR.tools.indexOf(this.parent.children, this)
},
getFilterContext: function(d) {
return d || {}
}
}
}(), "use strict", CKEDITOR.htmlParser.comment = function(d) {
this.value = d;
this._ = {
isBlockLike: !1
}
}, CKEDITOR.htmlParser.comment.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
type: CKEDITOR.NODE_COMMENT,
filter: function(d,
f) {
var c = this.value;
if (!(c = d.onComment(f, c, this))) return this.remove(), !1;
if ("string" != typeof c) return this.replaceWith(c), !1;
this.value = c;
return !0
},
writeHtml: function(d, f) {
f && this.filter(f);
d.comment(this.value)
}
}), "use strict",
function() {
CKEDITOR.htmlParser.text = function(d) {
this.value = d;
this._ = {
isBlockLike: !1
}
};
CKEDITOR.htmlParser.text.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
type: CKEDITOR.NODE_TEXT,
filter: function(d, f) {
if (!(this.value = d.onText(f, this.value, this))) return this.remove(), !1
},
writeHtml: function(d, f) {
f && this.filter(f);
d.text(this.value)
}
})
}(), "use strict",
function() {
CKEDITOR.htmlParser.cdata = function(d) {
this.value = d
};
CKEDITOR.htmlParser.cdata.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
type: CKEDITOR.NODE_TEXT,
filter: function() {},
writeHtml: function(d) {
d.write(this.value)
}
})
}(), "use strict", CKEDITOR.htmlParser.fragment = function() {
this.children = [];
this.parent = null;
this._ = {
isBlockLike: !0,
hasInlineStarted: !1
}
},
function() {
function d(a) {
return a.attributes["data-cke-survive"] ?
!1 : "a" == a.name && a.attributes.href || CKEDITOR.dtd.$removeEmpty[a.name]
}
var f = CKEDITOR.tools.extend({
table: 1,
ul: 1,
ol: 1,
dl: 1
}, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl),
c = {
ol: 1,
ul: 1
},
a = CKEDITOR.tools.extend({}, {
html: 1
}, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, {
style: 1,
script: 1
});
CKEDITOR.htmlParser.fragment.fromHtml = function(b, e, g) {
function k(a) {
var b;
if (0 < p.length)
for (var c = 0; c < p.length; c++) {
var d = p[c],
e = d.name,
g = CKEDITOR.dtd[e],
k = t.name && CKEDITOR.dtd[t.name];
(!k ||
k[e]) && (!a || !g || g[a] || !CKEDITOR.dtd[a]) ? (b || (h(), b = 1), d = d.clone(), d.parent = t, t = d, p.splice(c, 1), c--) : e == t.name && (n(t, t.parent, 1), c--)
}
}
function h() {
for (; w.length;) n(w.shift(), t)
}
function l(a) {
if (a._.isBlockLike && "pre" != a.name && "textarea" != a.name) {
var b = a.children.length,
c = a.children[b - 1],
d;
c && c.type == CKEDITOR.NODE_TEXT && ((d = CKEDITOR.tools.rtrim(c.value)) ? c.value = d : a.children.length = b - 1)
}
}
function n(a, b, c) {
b = b || t || m;
var e = t;
void 0 === a.previous && (q(b, a) && (t = b, u.onTagOpen(g, {}), a.returnPoint = b = t), l(a), (!d(a) || a.children.length) && b.add(a), "pre" == a.name && (y = !1), "textarea" == a.name && (x = !1));
a.returnPoint ? (t = a.returnPoint, delete a.returnPoint) : t = c ? b : e
}
function q(a, b) {
if ((a == m || "body" == a.name) && g && (!a.name || CKEDITOR.dtd[a.name][g])) {
var c, d;
return (c = b.attributes && (d = b.attributes["data-cke-real-element-type"]) ? d : b.name) && c in CKEDITOR.dtd.$inline && !(c in CKEDITOR.dtd.head) && !b.isOrphan || b.type == CKEDITOR.NODE_TEXT
}
}
function r(a, b) {
return a in CKEDITOR.dtd.$listItem || a in CKEDITOR.dtd.$tableContent ? a ==
b || "dt" == a && "dd" == b || "dd" == a && "dt" == b : !1
}
var u = new CKEDITOR.htmlParser,
m = e instanceof CKEDITOR.htmlParser.element ? e : "string" == typeof e ? new CKEDITOR.htmlParser.element(e) : new CKEDITOR.htmlParser.fragment,
p = [],
w = [],
t = m,
x = "textarea" == m.name,
y = "pre" == m.name;
u.onTagOpen = function(b, e, g, m) {
e = new CKEDITOR.htmlParser.element(b, e);
e.isUnknown && g && (e.isEmpty = !0);
e.isOptionalClose = m;
if (d(e)) p.push(e);
else {
if ("pre" == b) y = !0;
else {
if ("br" == b && y) {
t.add(new CKEDITOR.htmlParser.text("\n"));
return
}
"textarea" == b && (x = !0)
}
if ("br" == b) w.push(e);
else {
for (;;)
if (m = (g = t.name) ? CKEDITOR.dtd[g] || (t._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : a, !e.isUnknown && !t.isUnknown && !m[b])
if (t.isOptionalClose) u.onTagClose(g);
else if (b in c && g in c) g = t.children, (g = g[g.length - 1]) && "li" == g.name || n(g = new CKEDITOR.htmlParser.element("li"), t), !e.returnPoint && (e.returnPoint = t), t = g;
else if (b in CKEDITOR.dtd.$listItem && !r(b, g)) u.onTagOpen("li" == b ? "ul" : "dl", {}, 0, 1);
else if (g in f && !r(b, g)) !e.returnPoint && (e.returnPoint = t), t = t.parent;
else if (g in
CKEDITOR.dtd.$inline && p.unshift(t), t.parent) n(t, t.parent, 1);
else {
e.isOrphan = 1;
break
} else break;
k(b);
h();
e.parent = t;
e.isEmpty ? n(e) : t = e
}
}
};
u.onTagClose = function(a) {
for (var b = p.length - 1; 0 <= b; b--)
if (a == p[b].name) {
p.splice(b, 1);
return
}
for (var c = [], d = [], e = t; e != m && e.name != a;) e._.isBlockLike || d.unshift(e), c.push(e), e = e.returnPoint || e.parent;
if (e != m) {
for (b = 0; b < c.length; b++) {
var k = c[b];
n(k, k.parent)
}
t = e;
e._.isBlockLike && h();
n(e, e.parent);
e == t && (t = t.parent);
p = p.concat(d)
}
"body" == a && (g = !1)
};
u.onText = function(b) {
if ((!t._.hasInlineStarted ||
w.length) && !y && !x)
if (b = CKEDITOR.tools.ltrim(b), 0 === b.length) return;
var d = t.name,
e = d ? CKEDITOR.dtd[d] || (t._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : a;
if (!x && !e["#"] && d in f) u.onTagOpen(d in c ? "li" : "dl" == d ? "dd" : "table" == d ? "tr" : "tr" == d ? "td" : ""), u.onText(b);
else {
h();
k();
!y && !x && (b = b.replace(/[\t\r\n ]{2,}|[\t\r\n]/g, " "));
b = new CKEDITOR.htmlParser.text(b);
if (q(t, b)) this.onTagOpen(g, {}, 0, 1);
t.add(b)
}
};
u.onCDATA = function(a) {
t.add(new CKEDITOR.htmlParser.cdata(a))
};
u.onComment = function(a) {
h();
k();
t.add(new CKEDITOR.htmlParser.comment(a))
};
u.parse(b);
for (h(); t != m;) n(t, t.parent, 1);
l(m);
return m
};
CKEDITOR.htmlParser.fragment.prototype = {
type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
add: function(a, c) {
isNaN(c) && (c = this.children.length);
var d = 0 < c ? this.children[c - 1] : null;
if (d) {
if (a._.isBlockLike && d.type == CKEDITOR.NODE_TEXT && (d.value = CKEDITOR.tools.rtrim(d.value), 0 === d.value.length)) {
this.children.pop();
this.add(a);
return
}
d.next = a
}
a.previous = d;
a.parent = this;
this.children.splice(c, 0, a);
this._.hasInlineStarted ||
(this._.hasInlineStarted = a.type == CKEDITOR.NODE_TEXT || a.type == CKEDITOR.NODE_ELEMENT && !a._.isBlockLike)
},
filter: function(a, c) {
c = this.getFilterContext(c);
a.onRoot(c, this);
this.filterChildren(a, !1, c)
},
filterChildren: function(a, c, d) {
if (this.childrenFilteredBy != a.id) {
d = this.getFilterContext(d);
if (c && !this.parent) a.onRoot(d, this);
this.childrenFilteredBy = a.id;
for (c = 0; c < this.children.length; c++) !1 === this.children[c].filter(a, d) && c--
}
},
writeHtml: function(a, c) {
c && this.filter(c);
this.writeChildrenHtml(a)
},
writeChildrenHtml: function(a,
c, d) {
var k = this.getFilterContext();
if (d && !this.parent && c) c.onRoot(k, this);
c && this.filterChildren(c, !1, k);
c = 0;
d = this.children;
for (k = d.length; c < k; c++) d[c].writeHtml(a)
},
forEach: function(a, c, d) {
if (!d && (!c || this.type == c)) var k = a(this);
if (!1 !== k) {
d = this.children;
for (var h = 0; h < d.length; h++) k = d[h], k.type == CKEDITOR.NODE_ELEMENT ? k.forEach(a, c) : (!c || k.type == c) && a(k)
}
},
getFilterContext: function(a) {
return a || {}
}
}
}(), "use strict",
function() {
function d() {
this.rules = []
}
function f(c, a, b, e) {
var g, k;
for (g in a)(k =
c[g]) || (k = c[g] = new d), k.add(a[g], b, e)
}
CKEDITOR.htmlParser.filter = CKEDITOR.tools.createClass({
$: function(c) {
this.id = CKEDITOR.tools.getNextNumber();
this.elementNameRules = new d;
this.attributeNameRules = new d;
this.elementsRules = {};
this.attributesRules = {};
this.textRules = new d;
this.commentRules = new d;
this.rootRules = new d;
c && this.addRules(c, 10)
},
proto: {
addRules: function(c, a) {
var b;
"number" == typeof a ? b = a : a && "priority" in a && (b = a.priority);
"number" != typeof b && (b = 10);
"object" != typeof a && (a = {});
c.elementNames &&
this.elementNameRules.addMany(c.elementNames, b, a);
c.attributeNames && this.attributeNameRules.addMany(c.attributeNames, b, a);
c.elements && f(this.elementsRules, c.elements, b, a);
c.attributes && f(this.attributesRules, c.attributes, b, a);
c.text && this.textRules.add(c.text, b, a);
c.comment && this.commentRules.add(c.comment, b, a);
c.root && this.rootRules.add(c.root, b, a)
},
applyTo: function(c) {
c.filter(this)
},
onElementName: function(c, a) {
return this.elementNameRules.execOnName(c, a)
},
onAttributeName: function(c, a) {
return this.attributeNameRules.execOnName(c,
a)
},
onText: function(c, a) {
return this.textRules.exec(c, a)
},
onComment: function(c, a, b) {
return this.commentRules.exec(c, a, b)
},
onRoot: function(c, a) {
return this.rootRules.exec(c, a)
},
onElement: function(c, a) {
for (var b = [this.elementsRules["^"], this.elementsRules[a.name], this.elementsRules.$], d, g = 0; 3 > g; g++)
if (d = b[g]) {
d = d.exec(c, a, this);
if (!1 === d) return null;
if (d && d != a) return this.onNode(c, d);
if (a.parent && !a.name) break
}
return a
},
onNode: function(c, a) {
var b = a.type;
return b == CKEDITOR.NODE_ELEMENT ? this.onElement(c,
a) : b == CKEDITOR.NODE_TEXT ? new CKEDITOR.htmlParser.text(this.onText(c, a.value)) : b == CKEDITOR.NODE_COMMENT ? new CKEDITOR.htmlParser.comment(this.onComment(c, a.value)) : null
},
onAttribute: function(c, a, b, d) {
return (b = this.attributesRules[b]) ? b.exec(c, d, a, this) : d
}
}
});
CKEDITOR.htmlParser.filterRulesGroup = d;
d.prototype = {
add: function(c, a, b) {
this.rules.splice(this.findIndex(a), 0, {
value: c,
priority: a,
options: b
})
},
addMany: function(c, a, b) {
for (var d = [this.findIndex(a), 0], g = 0, k = c.length; g < k; g++) d.push({
value: c[g],
priority: a,
options: b
});
this.rules.splice.apply(this.rules, d)
},
findIndex: function(c) {
for (var a = this.rules, b = a.length - 1; 0 <= b && c < a[b].priority;) b--;
return b + 1
},
exec: function(c, a) {
var b = a instanceof CKEDITOR.htmlParser.node || a instanceof CKEDITOR.htmlParser.fragment,
d = Array.prototype.slice.call(arguments, 1),
g = this.rules,
k = g.length,
h, f, n, q;
for (q = 0; q < k; q++)
if (b && (h = a.type, f = a.name), n = g[q], !c.nonEditable || n.options.applyToAll) {
n = n.value.apply(null, d);
if (!1 === n) return n;
if (b) {
if (n && (n.name != f || n.type != h)) return n
} else if ("string" !=
typeof n) return n;
void 0 != n && (d[0] = a = n)
}
return a
},
execOnName: function(c, a) {
for (var b = 0, d = this.rules, g = d.length, k; a && b < g; b++)
if (k = d[b], !c.nonEditable || k.options.applyToAll) a = a.replace(k.value[0], k.value[1]);
return a
}
}
}(),
function() {
function d(d, h) {
function k(a) {
return a || CKEDITOR.env.needsNbspFiller ? new CKEDITOR.htmlParser.text("\u00a0") : new CKEDITOR.htmlParser.element("br", {
"data-cke-bogus": 1
})
}
function g(a, d) {
return function(e) {
if (e.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
var h = [],
g = f(e),
l, J;
if (g)
for (m(g,
1) && h.push(g); g;) {
if (b(g) && (l = c(g)) && m(l))(J = c(l)) && !b(J) ? h.push(l) : (k(x).insertAfter(l), l.remove());
g = g.previous
}
for (g = 0; g < h.length; g++) h[g].remove();
if (h = CKEDITOR.env.opera && !a || ("function" == typeof d ? !1 !== d(e) : d)) !x && !CKEDITOR.env.needsBrFiller && e.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT ? h = !1 : !x && !CKEDITOR.env.needsBrFiller && (7 < document.documentMode || e.name in CKEDITOR.dtd.tr || e.name in CKEDITOR.dtd.$listItem) ? h = !1 : (h = f(e), h = !h || "form" == e.name && "input" == h.name);
h && e.add(k(a))
}
}
}
function m(a, c) {
if ((!x ||
CKEDITOR.env.needsBrFiller) && a.type == CKEDITOR.NODE_ELEMENT && "br" == a.name && !a.attributes["data-cke-eol"]) return !0;
var d;
if (a.type == CKEDITOR.NODE_TEXT && (d = a.value.match(p)))
if (d.index && ((new CKEDITOR.htmlParser.text(a.value.substring(0, d.index))).insertBefore(a), a.value = d[0]), !CKEDITOR.env.needsBrFiller && x && (!c || a.parent.name in n) || !x && ((d = a.previous) && "br" == d.name || !d || b(d))) return !0;
return !1
}
var l = {
elements: {}
},
x = "html" == h,
n = CKEDITOR.tools.extend({}, y),
I;
for (I in n) "#" in t[I] || delete n[I];
for (I in n) l.elements[I] =
g(x, !1 !== d.config.fillEmptyBlocks);
l.root = g(x);
l.elements.br = function(d) {
return function(h) {
if (h.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
var g = h.attributes;
if ("data-cke-bogus" in g || "data-cke-eol" in g) delete g["data-cke-bogus"];
else {
for (g = h.next; g && a(g);) g = g.next;
var m = c(h);
!g && b(h.parent) ? e(h.parent, k(d)) : b(g) && m && !b(m) && k(d).insertBefore(g)
}
}
}
}(x);
return l
}
function f(b) {
for (b = b.children[b.children.length - 1]; b && a(b);) b = b.previous;
return b
}
function c(b) {
for (b = b.previous; b && a(b);) b = b.previous;
return b
}
function a(a) {
return a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(a.value) || a.type == CKEDITOR.NODE_ELEMENT && a.attributes["data-cke-bookmark"]
}
function b(a) {
return a && (a.type == CKEDITOR.NODE_ELEMENT && a.name in y || a.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT)
}
function e(a, b) {
var c = a.children[a.children.length - 1];
a.children.push(b);
b.parent = a;
c && (c.next = b, b.previous = c)
}
function g(a) {
a = a.attributes;
"false" != a.contenteditable && (a["data-cke-editable"] = a.contenteditable ? "true" : 1);
a.contenteditable =
"false"
}
function k(a) {
a = a.attributes;
switch (a["data-cke-editable"]) {
case "true":
a.contenteditable = "true";
break;
case "1":
delete a.contenteditable
}
}
function h(a) {
return a.replace(G, function(a, b, c) {
return "<" + b + c.replace(A, function(a, b) {
return !/^on/.test(b) && -1 == c.indexOf("data-cke-saved-" + b) ? (a = a.slice(1), " data-cke-saved-" + a + " data-cke-" + CKEDITOR.rnd + "-" + a) : a
}) + ">"
})
}
function l(a, b) {
return a.replace(b, function(a, b, c) {
0 === a.indexOf("<textarea") && (a = b + r(c).replace(/</g, "&lt;").replace(/>/g, "&gt;") + "</textarea>");
return "<cke:encoded>" + encodeURIComponent(a) + "</cke:encoded>"
})
}
function n(a) {
return a.replace(M, function(a, b) {
return decodeURIComponent(b)
})
}
function q(a) {
return a.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g, function(a) {
return "\x3c!--" + w + "{C}" + encodeURIComponent(a).replace(/--/g, "%2D%2D") + "--\x3e"
})
}
function r(a) {
return a.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g, function(a, b) {
return decodeURIComponent(b)
})
}
function u(a, b) {
var c = b._.dataStore;
return a.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g,
function(a, b) {
return decodeURIComponent(b)
}).replace(/\{cke_protected_(\d+)\}/g, function(a, b) {
return c && c[b] || ""
})
}
function m(a, b) {
var c = [],
d = b.config.protectedSource,
e = b._.dataStore || (b._.dataStore = {
id: 1
}),
h = /<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,
d = [/<script[\s\S]*?<\/script>/gi, /<noscript[\s\S]*?<\/noscript>/gi].concat(d);
a = a.replace(/<\!--[\s\S]*?--\>/g, function(a) {
return "\x3c!--{cke_tempcomment}" + (c.push(a) - 1) + "--\x3e"
});
for (var g = 0; g < d.length; g++) a = a.replace(d[g], function(a) {
a = a.replace(h,
function(a, b, d) {
return c[d]
});
return /cke_temp(comment)?/.test(a) ? a : "\x3c!--{cke_temp}" + (c.push(a) - 1) + "--\x3e"
});
a = a.replace(h, function(a, b, d) {
return "\x3c!--" + w + (b ? "{C}" : "") + encodeURIComponent(c[d]).replace(/--/g, "%2D%2D") + "--\x3e"
});
return a.replace(/(['"]).*?\1/g, function(a) {
return a.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g, function(a, b) {
e[e.id] = decodeURIComponent(b);
return "{cke_protected_" + e.id++ +"}"
})
})
}
CKEDITOR.htmlDataProcessor = function(a) {
var b, c, e = this;
this.editor = a;
this.dataFilter =
b = new CKEDITOR.htmlParser.filter;
this.htmlFilter = c = new CKEDITOR.htmlParser.filter;
this.writer = new CKEDITOR.htmlParser.basicWriter;
b.addRules(z);
b.addRules(C, {
applyToAll: !0
});
b.addRules(d(a, "data"), {
applyToAll: !0
});
c.addRules(s);
c.addRules(v, {
applyToAll: !0
});
c.addRules(d(a, "html"), {
applyToAll: !0
});
a.on("toHtml", function(b) {
b = b.data;
var c = b.dataValue,
c = m(c, a),
c = l(c, B),
c = h(c),
c = l(c, D),
c = c.replace(F, "$1cke:$2"),
c = c.replace(I, "<cke:$1$2></cke:$1>"),
c = CKEDITOR.env.opera ? c : c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,
"$1$2$2"),
d = b.context || a.editable().getName(),
e;
CKEDITOR.env.ie && (9 > CKEDITOR.env.version && "pre" == d) && (d = "div", c = "<pre>" + c + "</pre>", e = 1);
d = a.document.createElement(d);
d.setHtml("a" + c);
c = d.getHtml().substr(1);
c = c.replace(RegExp(" data-cke-" + CKEDITOR.rnd + "-", "ig"), " ");
e && (c = c.replace(/^<pre>|<\/pre>$/gi, ""));
c = c.replace(H, "$1$2");
c = n(c);
c = r(c);
b.dataValue = CKEDITOR.htmlParser.fragment.fromHtml(c, b.context, !1 === b.fixForBody ? !1 : b.enterMode != CKEDITOR.ENTER_BR && !1 !== a.config.autoParagraph ? b.enterMode == CKEDITOR.ENTER_DIV ?
"div" : "p" : !1)
}, null, null, 5);
a.on("toHtml", function(b) {
b.data.filter.applyTo(b.data.dataValue, !0, b.data.dontFilter, b.data.enterMode) && a.fire("dataFiltered")
}, null, null, 6);
a.on("toHtml", function(a) {
a.data.dataValue.filterChildren(e.dataFilter, !0)
}, null, null, 10);
a.on("toHtml", function(a) {
a = a.data;
var b = a.dataValue,
c = new CKEDITOR.htmlParser.basicWriter;
b.writeChildrenHtml(c);
b = c.getHtml(!0);
a.dataValue = q(b)
}, null, null, 15);
a.on("toDataFormat", function(b) {
var c = b.data.dataValue;
b.data.enterMode != CKEDITOR.ENTER_BR &&
(c = c.replace(/^<br *\/?>/i, ""));
b.data.dataValue = CKEDITOR.htmlParser.fragment.fromHtml(c, b.data.context, b.data.enterMode != CKEDITOR.ENTER_BR && !1 !== a.config.autoParagraph ? b.data.enterMode == CKEDITOR.ENTER_DIV ? "div" : "p" : !1)
}, null, null, 5);
a.on("toDataFormat", function(a) {
a.data.dataValue.filterChildren(e.htmlFilter, !0)
}, null, null, 10);
a.on("toDataFormat", function(a) {
a.data.filter.applyTo(a.data.dataValue, !1, !0)
}, null, null, 11);
a.on("toDataFormat", function(b) {
var c = b.data.dataValue,
d = e.writer;
d.reset();
c.writeChildrenHtml(d);
c = d.getHtml(!0);
c = r(c);
c = u(c, a);
b.data.dataValue = c
}, null, null, 15)
};
CKEDITOR.htmlDataProcessor.prototype = {
toHtml: function(a, b, c, d) {
var e = this.editor,
h, g, k;
b && "object" == typeof b ? (h = b.context, c = b.fixForBody, d = b.dontFilter, g = b.filter, k = b.enterMode) : h = b;
!h && null !== h && (h = e.editable().getName());
return e.fire("toHtml", {
dataValue: a,
context: h,
fixForBody: c,
dontFilter: d,
filter: g || e.filter,
enterMode: k || e.enterMode
}).dataValue
},
toDataFormat: function(a, b) {
var c, d, e;
b && (c = b.context, d = b.filter, e = b.enterMode);
!c &&
null !== c && (c = this.editor.editable().getName());
return this.editor.fire("toDataFormat", {
dataValue: a,
filter: d || this.editor.filter,
context: c,
enterMode: e || this.editor.enterMode
}).dataValue
}
};
var p = /(?:&nbsp;|\xa0)$/,
w = "{cke_protected}",
t = CKEDITOR.dtd,
x = "caption colgroup col thead tfoot tbody".split(" "),
y = CKEDITOR.tools.extend({}, t.$blockLimit, t.$block),
z = {
elements: {
input: g,
textarea: g
}
},
C = {
attributeNames: [
[/^on/, "data-cke-pa-on"],
[/^data-cke-expando$/, ""]
]
},
s = {
elements: {
embed: function(a) {
var b = a.parent;
if (b && "object" == b.name) {
var c = b.attributes.width,
b = b.attributes.height;
c && (a.attributes.width = c);
b && (a.attributes.height = b)
}
},
a: function(a) {
if (!a.children.length && !a.attributes.name && !a.attributes["data-cke-saved-name"]) return !1
}
}
},
v = {
elementNames: [
[/^cke:/, ""],
[/^\?xml:namespace$/, ""]
],
attributeNames: [
[/^data-cke-(saved|pa)-/, ""],
[/^data-cke-.*/, ""],
["hidefocus", ""]
],
elements: {
$: function(a) {
var b = a.attributes;
if (b) {
if (b["data-cke-temp"]) return !1;
for (var c = ["name", "href", "src"], d, e = 0; e < c.length; e++) d =
"data-cke-saved-" + c[e], d in b && delete b[c[e]]
}
return a
},
table: function(a) {
a.children.slice(0).sort(function(a, b) {
var c, d;
a.type == CKEDITOR.NODE_ELEMENT && b.type == a.type && (c = CKEDITOR.tools.indexOf(x, a.name), d = CKEDITOR.tools.indexOf(x, b.name)); - 1 < c && -1 < d && c != d || (c = a.parent ? a.getIndex() : -1, d = b.parent ? b.getIndex() : -1);
return c > d ? 1 : -1
})
},
param: function(a) {
a.children = [];
a.isEmpty = !0;
return a
},
span: function(a) {
"Apple-style-span" == a.attributes["class"] && delete a.name
},
html: function(a) {
delete a.attributes.contenteditable;
delete a.attributes["class"]
},
body: function(a) {
delete a.attributes.spellcheck;
delete a.attributes.contenteditable
},
style: function(a) {
var b = a.children[0];
b && b.value && (b.value = CKEDITOR.tools.trim(b.value));
a.attributes.type || (a.attributes.type = "text/css")
},
title: function(a) {
var b = a.children[0];
!b && e(a, b = new CKEDITOR.htmlParser.text);
b.value = a.attributes["data-cke-title"] || ""
},
input: k,
textarea: k
},
attributes: {
"class": function(a) {
return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g, "")) || !1
}
}
};
CKEDITOR.env.ie && (v.attributes.style = function(a) {
return a.replace(/(^|;)([^\:]+)/g, function(a) {
return a.toLowerCase()
})
});
var G = /<(a|area|img|input|source)\b([^>]*)>/gi,
A = /\s(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,
D = /(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
B = /(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,
M = /<cke:encoded>([^<]*)<\/cke:encoded>/gi,
F = /(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,
H = /(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,
I = /<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi
}(), "use strict", CKEDITOR.htmlParser.element = function(d, f) {
this.name = d;
this.attributes = f || {};
this.children = [];
var c = d || "",
a = c.match(/^cke:(.*)/);
a && (c = a[1]);
c = !(!CKEDITOR.dtd.$nonBodyContent[c] && !CKEDITOR.dtd.$block[c] && !CKEDITOR.dtd.$listItem[c] && !CKEDITOR.dtd.$tableContent[c] && !(CKEDITOR.dtd.$nonEditable[c] || "br" == c));
this.isEmpty = !!CKEDITOR.dtd.$empty[d];
this.isUnknown = !CKEDITOR.dtd[d];
this._ = {
isBlockLike: c,
hasInlineStarted: this.isEmpty || !c
}
},
CKEDITOR.htmlParser.cssStyle = function(d) {
var f = {};
((d instanceof CKEDITOR.htmlParser.element ? d.attributes.style : d) || "").replace(/&quot;/g, '"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(c, a, b) {
"font-family" == a && (b = b.replace(/["']/g, ""));
f[a.toLowerCase()] = b
});
return {
rules: f,
populate: function(c) {
var a = this.toString();
a && (c instanceof CKEDITOR.dom.element ? c.setAttribute("style", a) : c instanceof CKEDITOR.htmlParser.element ? c.attributes.style = a : c.style = a)
},
toString: function() {
var c = [],
a;
for (a in f) f[a] && c.push(a, ":", f[a], ";");
return c.join("")
}
}
},
function() {
function d(a) {
return function(b) {
return b.type == CKEDITOR.NODE_ELEMENT && ("string" == typeof a ? b.name == a : b.name in a)
}
}
var f = function(a, b) {
a = a[0];
b = b[0];
return a < b ? -1 : a > b ? 1 : 0
},
c = CKEDITOR.htmlParser.fragment.prototype;
CKEDITOR.htmlParser.element.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
type: CKEDITOR.NODE_ELEMENT,
add: c.add,
clone: function() {
return new CKEDITOR.htmlParser.element(this.name, this.attributes)
},
filter: function(a,
b) {
var c = this,
d, k;
b = c.getFilterContext(b);
if (b.off) return !0;
if (!c.parent) a.onRoot(b, c);
for (;;) {
d = c.name;
if (!(k = a.onElementName(b, d))) return this.remove(), !1;
c.name = k;
if (!(c = a.onElement(b, c))) return this.remove(), !1;
if (c !== this) return this.replaceWith(c), !1;
if (c.name == d) break;
if (c.type != CKEDITOR.NODE_ELEMENT) return this.replaceWith(c), !1;
if (!c.name) return this.replaceWithChildren(), !1
}
d = c.attributes;
var h, l;
for (h in d) {
l = h;
for (k = d[h];;)
if (l = a.onAttributeName(b, h))
if (l != h) delete d[h], h = l;
else break;
else {
delete d[h];
break
}
l && (!1 === (k = a.onAttribute(b, c, l, k)) ? delete d[l] : d[l] = k)
}
c.isEmpty || this.filterChildren(a, !1, b);
return !0
},
filterChildren: c.filterChildren,
writeHtml: function(a, b) {
b && this.filter(b);
var c = this.name,
d = [],
k = this.attributes,
h, l;
a.openTag(c, k);
for (h in k) d.push([h, k[h]]);
a.sortAttributes && d.sort(f);
h = 0;
for (l = d.length; h < l; h++) k = d[h], a.attribute(k[0], k[1]);
a.openTagClose(c, this.isEmpty);
this.writeChildrenHtml(a);
this.isEmpty || a.closeTag(c)
},
writeChildrenHtml: c.writeChildrenHtml,
replaceWithChildren: function() {
for (var a =
this.children, b = a.length; b;) a[--b].insertAfter(this);
this.remove()
},
forEach: c.forEach,
getFirst: function(a) {
if (!a) return this.children.length ? this.children[0] : null;
"function" != typeof a && (a = d(a));
for (var b = 0, c = this.children.length; b < c; ++b)
if (a(this.children[b])) return this.children[b];
return null
},
getHtml: function() {
var a = new CKEDITOR.htmlParser.basicWriter;
this.writeChildrenHtml(a);
return a.getHtml()
},
setHtml: function(a) {
a = this.children = CKEDITOR.htmlParser.fragment.fromHtml(a).children;
for (var b = 0,
c = a.length; b < c; ++b) a[b].parent = this
},
getOuterHtml: function() {
var a = new CKEDITOR.htmlParser.basicWriter;
this.writeHtml(a);
return a.getHtml()
},
split: function(a) {
for (var b = this.children.splice(a, this.children.length - a), c = this.clone(), d = 0; d < b.length; ++d) b[d].parent = c;
c.children = b;
b[0] && (b[0].previous = null);
0 < a && (this.children[a - 1].next = null);
this.parent.add(c, this.getIndex() + 1);
return c
},
removeClass: function(a) {
var b = this.attributes["class"];
b && ((b = CKEDITOR.tools.trim(b.replace(RegExp("(?:\\s+|^)" + a +
"(?:\\s+|$)"), " "))) ? this.attributes["class"] = b : delete this.attributes["class"])
},
hasClass: function(a) {
var b = this.attributes["class"];
return !b ? !1 : RegExp("(?:^|\\s)" + a + "(?=\\s|$)").test(b)
},
getFilterContext: function(a) {
var b = [];
a || (a = {
off: !1,
nonEditable: !1
});
!a.off && "off" == this.attributes["data-cke-processor"] && b.push("off", !0);
!a.nonEditable && "false" == this.attributes.contenteditable && b.push("nonEditable", !0);
if (b.length) {
a = CKEDITOR.tools.copy(a);
for (var c = 0; c < b.length; c += 2) a[b[c]] = b[c + 1]
}
return a
}
}, !0)
}(),
function() {
var d = {};
CKEDITOR.template = function(f) {
if (d[f]) this.output = d[f];
else {
var c = f.replace(/'/g, "\\'").replace(/{([^}]+)}/g, function(a, b) {
return "',data['" + b + "']==undefined?'{" + b + "}':data['" + b + "'],'"
});
this.output = d[f] = Function("data", "buffer", "return buffer?buffer.push('" + c + "'):['" + c + "'].join('');")
}
}
}(), delete CKEDITOR.loadFullCore, CKEDITOR.instances = {}, CKEDITOR.document = new CKEDITOR.dom.document(document), CKEDITOR.add = function(d) {
CKEDITOR.instances[d.name] = d;
d.on("focus", function() {
CKEDITOR.currentInstance !=
d && (CKEDITOR.currentInstance = d, CKEDITOR.fire("currentInstance"))
});
d.on("blur", function() {
CKEDITOR.currentInstance == d && (CKEDITOR.currentInstance = null, CKEDITOR.fire("currentInstance"))
});
CKEDITOR.fire("instance", null, d)
}, CKEDITOR.remove = function(d) {
delete CKEDITOR.instances[d.name]
},
function() {
var d = {};
CKEDITOR.addTemplate = function(f, c) {
var a = d[f];
if (a) return a;
a = {
name: f,
source: c
};
CKEDITOR.fire("template", a);
return d[f] = new CKEDITOR.template(a.source)
};
CKEDITOR.getTemplate = function(f) {
return d[f]
}
}(),
function() {
var d = [];
CKEDITOR.addCss = function(f) {
d.push(f)
};
CKEDITOR.getCss = function() {
return d.join("\n")
}
}(), CKEDITOR.on("instanceDestroyed", function() {
CKEDITOR.tools.isEmpty(this.instances) && CKEDITOR.fire("reset")
}), CKEDITOR.TRISTATE_ON = 1, CKEDITOR.TRISTATE_OFF = 2, CKEDITOR.TRISTATE_DISABLED = 0,
function() {
CKEDITOR.inline = function(d, f) {
if (!CKEDITOR.env.isCompatible) return null;
d = CKEDITOR.dom.element.get(d);
if (d.getEditor()) throw 'The editor instance "' + d.getEditor().name + '" is already attached to the provided element.';
var c = new CKEDITOR.editor(f, d, CKEDITOR.ELEMENT_MODE_INLINE),
a = d.is("textarea") ? d : null;
a ? (c.setData(a.getValue(), null, !0), d = CKEDITOR.dom.element.createFromHtml('<div contenteditable="' + !!c.readOnly + '" class="cke_textarea_inline">' + a.getValue() + "</div>", CKEDITOR.document), d.insertAfter(a), a.hide(), a.$.form && c._attachToForm()) : c.setData(d.getHtml(), null, !0);
c.on("loaded", function() {
c.fire("uiReady");
c.editable(d);
c.container = d;
c.setData(c.getData(1));
c.resetDirty();
c.fire("contentDom");
c.mode = "wysiwyg";
c.fire("mode");
c.status = "ready";
c.fireOnce("instanceReady");
CKEDITOR.fire("instanceReady", null, c)
}, null, null, 1E4);
c.on("destroy", function() {
a && (c.container.clearCustomData(), c.container.remove(), a.show());
c.element.clearCustomData();
delete c.element
});
return c
};
CKEDITOR.inlineAll = function() {
var d, f, c;
for (c in CKEDITOR.dtd.$editable)
for (var a = CKEDITOR.document.getElementsByTag(c), b = 0, e = a.count(); b < e; b++) d = a.getItem(b), "true" == d.getAttribute("contenteditable") && (f = {
element: d,
config: {}
}, !1 !== CKEDITOR.fire("inline",
f) && CKEDITOR.inline(d, f.config))
};
CKEDITOR.domReady(function() {
!CKEDITOR.disableAutoInline && CKEDITOR.inlineAll()
})
}(), CKEDITOR.replaceClass = "ckeditor",
function() {
function d(a, d, g, k) {
if (!CKEDITOR.env.isCompatible) return null;
a = CKEDITOR.dom.element.get(a);
if (a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
var h = new CKEDITOR.editor(d, a, k);
k == CKEDITOR.ELEMENT_MODE_REPLACE && (a.setStyle("visibility", "hidden"), h._.required = a.hasAttribute("required"),
a.removeAttribute("required"));
g && h.setData(g, null, !0);
h.on("loaded", function() {
try {
c(h), k == CKEDITOR.ELEMENT_MODE_REPLACE && h.config.autoUpdateElement && a.$.form && h._attachToForm(), h.setMode(h.config.startupMode, function() {
h.resetDirty();
h.status = "ready";
h.fireOnce("instanceReady");
CKEDITOR.fire("instanceReady", null, h)
})
} catch (d) {}
});
h.on("destroy", f);
return h
}
function f() {
var a = this.container,
c = this.element;
a && (a.clearCustomData(), a.remove());
c && (c.clearCustomData(), this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE &&
(c.show(), this._.required && c.setAttribute("required", "required")), delete this.element)
}
function c(b) {
var c = b.name,
d = b.element,
k = b.elementMode,
h = b.fire("uiSpace", {
space: "top",
html: ""
}).html,
l = b.fire("uiSpace", {
space: "bottom",
html: ""
}).html;
a || (a = CKEDITOR.addTemplate("maincontainer", '<{outerEl} id="cke_{name}" class="{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir="{langDir}" lang="{langCode}" role="application" aria-labelledby="cke_{name}_arialbl"><span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span><{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation"></{outerEl}>{bottomHtml}</{outerEl}></{outerEl}>'));
c = CKEDITOR.dom.element.createFromHtml(a.output({
id: b.id,
name: c,
langDir: b.lang.dir,
langCode: b.langCode,
voiceLabel: [b.lang.editor, b.name].join(", "),
topHtml: h ? '<span id="' + b.ui.spaceId("top") + '" class="cke_top cke_reset_all" role="presentation" style="height:auto">' + h + "</span>" : "",
contentId: b.ui.spaceId("contents"),
bottomHtml: l ? '<span id="' + b.ui.spaceId("bottom") + '" class="cke_bottom cke_reset_all" role="presentation">' + l + "</span>" : "",
outerEl: CKEDITOR.env.ie ? "span" : "div"
}));
k == CKEDITOR.ELEMENT_MODE_REPLACE ?
(d.hide(), c.insertAfter(d)) : d.append(c);
b.container = c;
h && b.ui.space("top").unselectable();
l && b.ui.space("bottom").unselectable();
d = b.config.width;
k = b.config.height;
d && c.setStyle("width", CKEDITOR.tools.cssLength(d));
k && b.ui.space("contents").setStyle("height", CKEDITOR.tools.cssLength(k));
c.disableContextMenu();
CKEDITOR.env.webkit && c.on("focus", function() {
b.focus()
});
b.fireOnce("uiReady")
}
CKEDITOR.replace = function(a, c) {
return d(a, c, null, CKEDITOR.ELEMENT_MODE_REPLACE)
};
CKEDITOR.appendTo = function(a, c,
g) {
return d(a, c, g, CKEDITOR.ELEMENT_MODE_APPENDTO)
};
CKEDITOR.replaceAll = function() {
for (var a = document.getElementsByTagName("textarea"), c = 0; c < a.length; c++) {
var d = null,
k = a[c];
if (k.name || k.id) {
if ("string" == typeof arguments[0]) {
if (!RegExp("(?:^|\\s)" + arguments[0] + "(?:$|\\s)").test(k.className)) continue
} else if ("function" == typeof arguments[0] && (d = {}, !1 === arguments[0](k, d))) continue;
this.replace(k, d)
}
}
};
CKEDITOR.editor.prototype.addMode = function(a, c) {
(this._.modes || (this._.modes = {}))[a] = c
};
CKEDITOR.editor.prototype.setMode =
function(a, c) {
var d = this,
k = this._.modes;
if (!(a == d.mode || !k || !k[a])) {
d.fire("beforeSetMode", a);
if (d.mode) {
var h = d.checkDirty();
d._.previousMode = d.mode;
d.fire("beforeModeUnload");
d.editable(0);
d.ui.space("contents").setHtml("");
d.mode = ""
}
this._.modes[a](function() {
d.mode = a;
void 0 !== h && !h && d.resetDirty();
setTimeout(function() {
d.fire("mode");
c && c.call(d)
}, 0)
})
}
};
CKEDITOR.editor.prototype.resize = function(a, c, d, k) {
var h = this.container,
l = this.ui.space("contents"),
f = CKEDITOR.env.webkit && this.document && this.document.getWindow().$.frameElement;
k = k ? h.getChild(1) : h;
k.setSize("width", a, !0);
f && (f.style.width = "1%");
l.setStyle("height", Math.max(c - (d ? 0 : (k.$.offsetHeight || 0) - (l.$.clientHeight || 0)), 0) + "px");
f && (f.style.width = "100%");
this.fire("resize")
};
CKEDITOR.editor.prototype.getResizable = function(a) {
return a ? this.ui.space("contents") : this.container
};
var a;
CKEDITOR.domReady(function() {
CKEDITOR.replaceClass && CKEDITOR.replaceAll(CKEDITOR.replaceClass)
})
}(), CKEDITOR.config.startupMode = "wysiwyg",
function() {
function d(b) {
var c = b.editor,
d = b.data.path,
e = d.blockLimit,
h = b.data.selection,
k = h.getRanges()[0],
g;
if (CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller)
if (h = f(h, d)) h.appendBogus(), g = CKEDITOR.env.ie;
if (!1 !== c.config.autoParagraph && (c.activeEnterMode != CKEDITOR.ENTER_BR && c.editable().equals(e) && !d.block && k.collapsed && !k.getCommonAncestor().isReadOnly()) && (d = k.clone(), d.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS), e = new CKEDITOR.dom.walker(d), e.guard = function(b) {
return !a(b) || b.type == CKEDITOR.NODE_COMMENT || b.isReadOnly()
}, !e.checkForward() ||
d.checkStartOfBlock() && d.checkEndOfBlock())) c = k.fixBlock(!0, c.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p"), CKEDITOR.env.needsBrFiller || (c = c.getFirst(a)) && c.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(c.getText()).match(/^(?:&nbsp;|\xa0)$/) && c.remove(), g = 1, b.cancel();
g && k.select()
}
function f(b, c) {
if (b.isFake) return 0;
var d = c.block || c.blockLimit,
e = d && d.getLast(a);
if (d && d.isBlockBoundary() && (!e || !(e.type == CKEDITOR.NODE_ELEMENT && e.isBlockBoundary())) && !d.is("pre") && !d.getBogus()) return d
}
function c(a) {
var b =
a.data.getTarget();
b.is("input") && (b = b.getAttribute("type"), ("submit" == b || "reset" == b) && a.data.preventDefault())
}
function a(a) {
return n(a) && q(a)
}
function b(a, b) {
return function(c) {
var d = CKEDITOR.dom.element.get(c.data.$.toElement || c.data.$.fromElement || c.data.$.relatedTarget);
(!d || !b.equals(d) && !b.contains(d)) && a.call(this, c)
}
}
function e(b) {
var c, d = b.getRanges()[0],
e = b.root,
k = {
table: 1,
ul: 1,
ol: 1,
dl: 1
};
if (d.startPath().contains(k)) {
b = function(b) {
return function(d, e) {
e && d.type == CKEDITOR.NODE_ELEMENT &&
d.is(k) && (c = d);
if (!e && a(d) && (!b || !h(d))) return !1
}
};
var g = d.clone();
g.collapse(1);
g.setStartAt(e, CKEDITOR.POSITION_AFTER_START);
e = new CKEDITOR.dom.walker(g);
e.guard = b();
e.checkBackward();
if (c) return g = d.clone(), g.collapse(), g.setEndAt(c, CKEDITOR.POSITION_AFTER_END), e = new CKEDITOR.dom.walker(g), e.guard = b(!0), c = !1, e.checkForward(), c
}
return null
}
function g(a) {
a.editor.focus();
a.editor.fire("saveSnapshot")
}
function k(a, b) {
var c = a.editor;
!b && c.getSelection().scrollIntoView();
setTimeout(function() {
c.fire("saveSnapshot")
},
0)
}
CKEDITOR.editable = CKEDITOR.tools.createClass({
base: CKEDITOR.dom.element,
$: function(a, b) {
this.base(b.$ || b);
this.editor = a;
this.hasFocus = !1;
this.setup()
},
proto: {
focus: function() {
var a;
if (CKEDITOR.env.webkit && !this.hasFocus && (a = this.editor._.previousActive || this.getDocument().getActive(), this.contains(a))) {
a.focus();
return
}
try {
this.$[CKEDITOR.env.ie && this.getDocument().equals(CKEDITOR.document) ? "setActive" : "focus"]()
} catch (b) {
if (!CKEDITOR.env.ie) throw b;
}
CKEDITOR.env.safari && !this.isInline() && (a = CKEDITOR.document.getActive(),
a.equals(this.getWindow().getFrame()) || this.getWindow().focus())
},
on: function(a, c) {
var d = Array.prototype.slice.call(arguments, 0);
CKEDITOR.env.ie && /^focus|blur$/.exec(a) && (a = "focus" == a ? "focusin" : "focusout", c = b(c, this), d[0] = a, d[1] = c);
return CKEDITOR.dom.element.prototype.on.apply(this, d)
},
attachListener: function(a, b, c, d, e, h) {
!this._.listeners && (this._.listeners = []);
var k = Array.prototype.slice.call(arguments, 1),
k = a.on.apply(a, k);
this._.listeners.push(k);
return k
},
clearListeners: function() {
var a = this._.listeners;
try {
for (; a.length;) a.pop().removeListener()
} catch (b) {}
},
restoreAttrs: function() {
var a = this._.attrChanges,
b, c;
for (c in a) a.hasOwnProperty(c) && (b = a[c], null !== b ? this.setAttribute(c, b) : this.removeAttribute(c))
},
attachClass: function(a) {
var b = this.getCustomData("classes");
this.hasClass(a) || (!b && (b = []), b.push(a), this.setCustomData("classes", b), this.addClass(a))
},
changeAttr: function(a, b) {
var c = this.getAttribute(a);
b !== c && (!this._.attrChanges && (this._.attrChanges = {}), a in this._.attrChanges || (this._.attrChanges[a] =
c), this.setAttribute(a, b))
},
insertHtml: function(a, b) {
g(this);
r(this, b || "html", a)
},
insertText: function(a) {
g(this);
var b = this.editor,
c = b.getSelection().getStartElement().hasAscendant("pre", !0) ? CKEDITOR.ENTER_BR : b.activeEnterMode,
b = c == CKEDITOR.ENTER_BR,
d = CKEDITOR.tools;
a = d.htmlEncode(a.replace(/\r\n/g, "\n"));
a = a.replace(/\t/g, "&nbsp;&nbsp; &nbsp;");
c = c == CKEDITOR.ENTER_P ? "p" : "div";
if (!b) {
var e = /\n{2}/g;
if (e.test(a)) {
var h = "<" + c + ">",
k = "</" + c + ">";
a = h + a.replace(e, function() {
return k + h
}) + k
}
}
a = a.replace(/\n/g,
"<br>");
b || (a = a.replace(RegExp("<br>(?=</" + c + ">)"), function(a) {
return d.repeat(a, 2)
}));
a = a.replace(/^ | $/g, "&nbsp;");
a = a.replace(/(>|\s) /g, function(a, b) {
return b + "&nbsp;"
}).replace(/ (?=<)/g, "&nbsp;");
r(this, "text", a)
},
insertElement: function(a, b) {
b ? this.insertElementIntoRange(a, b) : this.insertElementIntoSelection(a)
},
insertElementIntoRange: function(a, b) {
var c = this.editor,
d = c.config.enterMode,
e = a.getName(),
h = CKEDITOR.dtd.$block[e];
if (b.checkReadOnly()) return !1;
b.deleteContents(1);
var k, g;
if (h)
for (;
(k =
b.getCommonAncestor(0, 1)) && (g = CKEDITOR.dtd[k.getName()]) && (!g || !g[e]);) k.getName() in CKEDITOR.dtd.span ? b.splitElement(k) : b.checkStartOfBlock() && b.checkEndOfBlock() ? (b.setStartBefore(k), b.collapse(!0), k.remove()) : b.splitBlock(d == CKEDITOR.ENTER_DIV ? "div" : "p", c.editable());
b.insertNode(a);
return !0
},
insertElementIntoSelection: function(b) {
var c = this.editor,
d = c.activeEnterMode,
c = c.getSelection(),
e = c.getRanges(),
f = b.getName(),
f = CKEDITOR.dtd.$block[f],
l, n, q;
g(this);
for (var r = e.length; r--;) q = e[r], l = !r && b ||
b.clone(1), this.insertElementIntoRange(l, q) && !n && (n = l);
n && (q.moveToPosition(n, CKEDITOR.POSITION_AFTER_END), f && ((b = n.getNext(function(b) {
return a(b) && !h(b)
})) && b.type == CKEDITOR.NODE_ELEMENT && b.is(CKEDITOR.dtd.$block) ? b.getDtd()["#"] ? q.moveToElementEditStart(b) : q.moveToElementEditEnd(n) : !b && d != CKEDITOR.ENTER_BR && (b = q.fixBlock(!0, d == CKEDITOR.ENTER_DIV ? "div" : "p"), q.moveToElementEditStart(b))));
c.selectRanges([q]);
k(this, CKEDITOR.env.opera)
},
setData: function(a, b) {
b || (a = this.editor.dataProcessor.toHtml(a));
this.setHtml(a);
this.editor.fire("dataReady")
},
getData: function(a) {
var b = this.getHtml();
a || (b = this.editor.dataProcessor.toDataFormat(b));
return b
},
setReadOnly: function(a) {
this.setAttribute("contenteditable", !a)
},
detach: function() {
this.removeClass("cke_editable");
var a = this.editor;
this._.detach();
delete a.document;
delete a.window
},
isInline: function() {
return this.getDocument().equals(CKEDITOR.document)
},
setup: function() {
var b = this.editor;
this.attachListener(b, "beforeGetData", function() {
var a = this.getData();
this.is("textarea") || !1 !== b.config.ignoreEmptyParagraph && (a = a.replace(l, function(a, b) {
return b
}));
b.setData(a, null, 1)
}, this);
this.attachListener(b, "getSnapshot", function(a) {
a.data = this.getData(1)
}, this);
this.attachListener(b, "afterSetData", function() {
this.setData(b.getData(1))
}, this);
this.attachListener(b, "loadSnapshot", function(a) {
this.setData(a.data, 1)
}, this);
this.attachListener(b, "beforeFocus", function() {
var a = b.getSelection();
(a = a && a.getNative()) && "Control" == a.type || this.focus()
}, this);
this.attachListener(b,
"insertHtml",
function(a) {
this.insertHtml(a.data.dataValue, a.data.mode)
}, this);
this.attachListener(b, "insertElement", function(a) {
this.insertElement(a.data)
}, this);
this.attachListener(b, "insertText", function(a) {
this.insertText(a.data)
}, this);
this.setReadOnly(b.readOnly);
this.attachClass("cke_editable");
this.attachClass(b.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? "cke_editable_inline" : b.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE || b.elementMode == CKEDITOR.ELEMENT_MODE_APPENDTO ? "cke_editable_themed" : "");
this.attachClass("cke_contents_" + b.config.contentsLangDirection);
b.keystrokeHandler.blockedKeystrokes[8] = +b.readOnly;
b.keystrokeHandler.attach(this);
this.on("blur", function(a) {
CKEDITOR.env.opera && CKEDITOR.document.getActive().equals(this.isInline() ? this : this.getWindow().getFrame()) ? a.cancel() : this.hasFocus = !1
}, null, null, -1);
this.on("focus", function() {
this.hasFocus = !0
}, null, null, -1);
b.focusManager.add(this);
this.equals(CKEDITOR.document.getActive()) && (this.hasFocus = !0, b.once("contentDom", function() {
b.focusManager.focus()
}));
this.isInline() && this.changeAttr("tabindex", b.tabIndex);
if (!this.is("textarea")) {
b.document = this.getDocument();
b.window = this.getWindow();
var d = b.document;
this.changeAttr("spellcheck", !b.config.disableNativeSpellChecker);
var h = b.config.contentsLangDirection;
this.getDirection(1) != h && this.changeAttr("dir", h);
var k = CKEDITOR.getCss();
k && (h = d.getHead(), h.getCustomData("stylesheet") || (k = d.appendStyleText(k), k = new CKEDITOR.dom.element(k.ownerNode || k.owningElement), h.setCustomData("stylesheet", k), k.data("cke-temp",
1)));
h = d.getCustomData("stylesheet_ref") || 0;
d.setCustomData("stylesheet_ref", h + 1);
this.setCustomData("cke_includeReadonly", !b.config.disableReadonlyStyling);
this.attachListener(this, "click", function(a) {
a = a.data;
var b = (new CKEDITOR.dom.elementPath(a.getTarget(), this)).contains("a");
b && 2 != a.$.button && b.isReadOnly() && a.preventDefault()
});
var g = {
8: 1,
46: 1
};
this.attachListener(b, "key", function(a) {
if (b.readOnly) return !0;
var c = a.data.keyCode,
d;
if (c in g) {
var h = b.getSelection();
a = h.getRanges()[0];
var k = a.startPath(),
f, l, m, c = 8 == c;
if (h = e(h)) b.fire("saveSnapshot"), a.moveToPosition(h, CKEDITOR.POSITION_BEFORE_START), h.remove(), a.select(), b.fire("saveSnapshot"), d = 1;
else if (a.collapsed)
if ((f = k.block) && (m = f[c ? "getPrevious" : "getNext"](n)) && m.type == CKEDITOR.NODE_ELEMENT && m.is("table") && a[c ? "checkStartOfBlock" : "checkEndOfBlock"]()) b.fire("saveSnapshot"), a[c ? "checkEndOfBlock" : "checkStartOfBlock"]() && f.remove(), a["moveToElementEdit" + (c ? "End" : "Start")](m), a.select(), b.fire("saveSnapshot"), d = 1;
else if (k.blockLimit && k.blockLimit.is("td") &&
(l = k.blockLimit.getAscendant("table")) && a.checkBoundaryOfElement(l, c ? CKEDITOR.START : CKEDITOR.END) && (m = l[c ? "getPrevious" : "getNext"](n))) b.fire("saveSnapshot"), a["moveToElementEdit" + (c ? "End" : "Start")](m), a.checkStartOfBlock() && a.checkEndOfBlock() ? m.remove() : a.select(), b.fire("saveSnapshot"), d = 1;
else if ((l = k.contains(["td", "th", "caption"])) && a.checkBoundaryOfElement(l, c ? CKEDITOR.START : CKEDITOR.END)) d = 1
}
return !d
});
b.blockless && CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller && this.attachListener(this, "keyup",
function(c) {
c.data.getKeystroke() in g && !this.getFirst(a) && (this.appendBogus(), c = b.createRange(), c.moveToPosition(this, CKEDITOR.POSITION_AFTER_START), c.select())
});
this.attachListener(this, "dblclick", function(a) {
if (b.readOnly) return !1;
a = {
element: a.data.getTarget()
};
b.fire("doubleclick", a)
});
this.attachListener(this, "click", function(a) {
if (b.readOnly) return !1;
a = {
element: a.data.getTarget()
};
b.fire("click", a)
});
CKEDITOR.env.ie && this.attachListener(this, "click", c);
!CKEDITOR.env.ie && !CKEDITOR.env.opera &&
this.attachListener(this, "mousedown", function(a) {
var c = a.data.getTarget();
c.is("img", "hr", "input", "textarea", "select") && (b.getSelection().selectElement(c), c.is("input", "textarea", "select") && a.data.preventDefault())
});
CKEDITOR.env.gecko && this.attachListener(this, "mouseup", function(a) {
if (2 == a.data.$.button && (a = a.data.getTarget(), !a.getOuterHtml().replace(l, ""))) {
var c = b.createRange();
c.moveToElementEditStart(a);
c.select(!0)
}
});
CKEDITOR.env.webkit && (this.attachListener(this, "click", function(a) {
a.data.getTarget().is("input",
"select") && a.data.preventDefault()
}), this.attachListener(this, "mouseup", function(a) {
a.data.getTarget().is("input", "textarea") && a.data.preventDefault()
}))
}
}
},
_: {
detach: function() {
this.editor.setData(this.editor.getData(), 0, 1);
this.clearListeners();
this.restoreAttrs();
var a;
if (a = this.removeCustomData("classes"))
for (; a.length;) this.removeClass(a.pop());
a = this.getDocument();
var b = a.getHead();
if (b.getCustomData("stylesheet")) {
var c = a.getCustomData("stylesheet_ref");
--c ? a.setCustomData("stylesheet_ref",
c) : (a.removeCustomData("stylesheet_ref"), b.removeCustomData("stylesheet").remove())
}
delete this.editor
}
}
});
CKEDITOR.editor.prototype.editable = function(a) {
var b = this._.editable;
if (b && a) return 0;
arguments.length && (b = this._.editable = a ? a instanceof CKEDITOR.editable ? a : new CKEDITOR.editable(this, a) : (b && b.detach(), null));
return b
};
var h = CKEDITOR.dom.walker.bogus(),
l = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,
n = CKEDITOR.dom.walker.whitespaces(!0),
q = CKEDITOR.dom.walker.bookmark(!1, !0);
CKEDITOR.on("instanceLoaded", function(a) {
var b = a.editor;
b.on("insertElement", function(a) {
a = a.data;
if (a.type == CKEDITOR.NODE_ELEMENT && (a.is("input") || a.is("textarea"))) "false" != a.getAttribute("contentEditable") && a.data("cke-editable", a.hasAttribute("contenteditable") ? "true" : "1"), a.setAttribute("contentEditable", !1)
});
b.on("selectionChange", function(a) {
if (!b.readOnly) {
var c = b.getSelection();
c && !c.isLocked && (c = b.checkDirty(), b.fire("lockSnapshot"), d(a), b.fire("unlockSnapshot"), !c && b.resetDirty())
}
})
});
CKEDITOR.on("instanceCreated", function(a) {
var b = a.editor;
b.on("mode", function() {
var a = b.editable();
if (a && a.isInline()) {
var c = b.title;
a.changeAttr("role", "textbox");
a.changeAttr("aria-label", c);
c && a.changeAttr("title", c);
if (c = this.ui.space(this.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? "top" : "contents")) {
var d = CKEDITOR.tools.getNextId(),
e = CKEDITOR.dom.element.createFromHtml('<span id="' + d + '" class="cke_voice_label">' + this.lang.common.editorHelp + "</span>");
c.append(e);
a.changeAttr("aria-describedby",
d)
}
}
})
});
CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");
var r = function() {
function b(a) {
return a.type == CKEDITOR.NODE_ELEMENT
}
function c(a, d) {
var e, h, k, g, f = [],
n = d.range.startContainer;
e = d.range.startPath();
for (var n = l[n.getName()], I = 0, J = a.getChildren(), x = J.count(), t = -1, s = -1, p = 0, q = e.contains(l.$list); I < x; ++I)
if (e = J.getItem(I), b(e))
if (k = e.getName(), q && k in CKEDITOR.dtd.$list) f = f.concat(c(e, d));
else {
g = !!n[k];
if ("br" == k && e.data("cke-eol") &&
(!I || I == x - 1)) p = (h = I ? f[I - 1].node : J.getItem(I + 1)) && (!b(h) || !h.is("br")), h = h && b(h) && l.$block[h.getName()]; - 1 == t && !g && (t = I);
g || (s = I);
f.push({
isElement: 1,
isLineBreak: p,
isBlock: e.isBlockBoundary(),
hasBlockSibling: h,
node: e,
name: k,
allowed: g
});
h = p = 0
} else f.push({
isElement: 0,
node: e,
allowed: 1
}); - 1 < t && (f[t].firstNotAllowed = 1); - 1 < s && (f[s].lastNotAllowed = 1);
return f
}
function d(a, c) {
var e = [],
h = a.getChildren(),
k = h.count(),
g, f = 0,
m = l[c],
n = !a.is(l.$inline) || a.is("br");
for (n && e.push(" "); f < k; f++) g = h.getItem(f), b(g) &&
!g.is(m) ? e = e.concat(d(g, c)) : e.push(g);
n && e.push(" ");
return e
}
function e(a) {
return a && b(a) && (a.is(l.$removeEmpty) || a.is("a") && !a.isBlockBoundary())
}
function h(a, c, d, e) {
var k = a.clone(),
g, l;
k.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
if ((g = (new CKEDITOR.dom.walker(k)).next()) && b(g) && f[g.getName()] && (l = g.getPrevious()) && b(l) && !l.getParent().equals(a.startContainer) && d.contains(l) && e.contains(g) && g.isIdentical(l)) g.moveChildren(l), g.remove(), h(a, c, d, e)
}
function g(a, c) {
function d(a, c) {
if (c.isBlock && c.isElement &&
!c.node.is("br") && b(a) && a.is("br")) return a.remove(), 1
}
var e = c.endContainer.getChild(c.endOffset),
h = c.endContainer.getChild(c.endOffset - 1);
e && d(e, a[a.length - 1]);
h && d(h, a[0]) && (c.setEnd(c.endContainer, c.endOffset - 1), c.collapse())
}
var l = CKEDITOR.dtd,
f = {
p: 1,
div: 1,
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1,
ul: 1,
ol: 1,
li: 1,
pre: 1,
dl: 1,
blockquote: 1
},
n = {
p: 1,
div: 1,
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1
},
s = CKEDITOR.tools.extend({}, l.$inline);
delete s.br;
return function(f, q, r) {
var z = f.editor;
f.getDocument();
var B = z.getSelection().getRanges()[0],
M = !1;
"unfiltered_html" == q && (q = "html", M = !0);
if (!B.checkReadOnly()) {
var F = (new CKEDITOR.dom.elementPath(B.startContainer, B.root)).blockLimit || B.root;
q = {
type: q,
dontFilter: M,
editable: f,
editor: z,
range: B,
blockLimit: F,
mergeCandidates: [],
zombies: []
};
var z = q.range,
M = q.mergeCandidates,
H, I, J, N;
"text" == q.type && z.shrink(CKEDITOR.SHRINK_ELEMENT, !0, !1) && (H = CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>", z.document), z.insertNode(H), z.setStartAfter(H));
I = new CKEDITOR.dom.elementPath(z.startContainer);
q.endPath =
J = new CKEDITOR.dom.elementPath(z.endContainer);
if (!z.collapsed) {
var F = J.block || J.blockLimit,
P = z.getCommonAncestor();
F && !F.equals(P) && (!F.contains(P) && z.checkEndOfBlock()) && q.zombies.push(F);
z.deleteContents()
}
for (;
(N = b(z.startContainer) && z.startContainer.getChild(z.startOffset - 1)) && b(N) && N.isBlockBoundary() && I.contains(N);) z.moveToPosition(N, CKEDITOR.POSITION_BEFORE_END);
h(z, q.blockLimit, I, J);
H && (z.setEndBefore(H), z.collapse(), H.remove());
H = z.startPath();
if (F = H.contains(e, !1, 1)) z.splitElement(F),
q.inlineStylesRoot = F, q.inlineStylesPeak = H.lastElement;
H = z.createBookmark();
(F = H.startNode.getPrevious(a)) && b(F) && e(F) && M.push(F);
(F = H.startNode.getNext(a)) && b(F) && e(F) && M.push(F);
for (F = H.startNode;
(F = F.getParent()) && e(F);) M.push(F);
z.moveToBookmark(H);
if (H = r) {
H = q.range;
if ("text" == q.type && q.inlineStylesRoot) {
N = q.inlineStylesPeak;
z = N.getDocument().createText("{cke-peak}");
for (M = q.inlineStylesRoot.getParent(); !N.equals(M);) z = z.appendTo(N.clone()), N = N.getParent();
r = z.getOuterHtml().split("{cke-peak}").join(r)
}
N =
q.blockLimit.getName();
if (/^\s+|\s+$/.test(r) && "span" in CKEDITOR.dtd[N]) {
var R = '<span data-cke-marker="1">&nbsp;</span>';
r = R + r + R
}
r = q.editor.dataProcessor.toHtml(r, {
context: null,
fixForBody: !1,
dontFilter: q.dontFilter,
filter: q.editor.activeFilter,
enterMode: q.editor.activeEnterMode
});
N = H.document.createElement("body");
N.setHtml(r);
R && (N.getFirst().remove(), N.getLast().remove());
if ((R = H.startPath().block) && !(1 == R.getChildCount() && R.getBogus())) a: {
var L;
if (1 == N.getChildCount() && b(L = N.getFirst()) && L.is(n)) {
R =
L.getElementsByTag("*");
H = 0;
for (M = R.count(); H < M; H++)
if (z = R.getItem(H), !z.is(s)) break a;
L.moveChildren(L.getParent(1));
L.remove()
}
}
q.dataWrapper = N;
H = r
}
if (H) {
L = q.range;
var R = L.document,
K;
r = q.blockLimit;
H = 0;
var Q;
N = [];
var O, U, M = z = 0,
S, W;
I = L.startContainer;
var F = q.endPath.elements[0],
X;
J = F.getPosition(I);
P = !!F.getCommonAncestor(I) && J != CKEDITOR.POSITION_IDENTICAL && !(J & CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED);
I = c(q.dataWrapper, q);
for (g(I, L); H < I.length; H++) {
J = I[H];
if (K = J.isLineBreak) {
K =
L;
S = r;
var T = void 0,
Z = void 0;
J.hasBlockSibling ? K = 1 : (T = K.startContainer.getAscendant(l.$block, 1), !T || !T.is({
div: 1,
p: 1
}) ? K = 0 : (Z = T.getPosition(S), Z == CKEDITOR.POSITION_IDENTICAL || Z == CKEDITOR.POSITION_CONTAINS ? K = 0 : (S = K.splitElement(T), K.moveToPosition(S, CKEDITOR.POSITION_AFTER_START), K = 1)))
}
if (K) M = 0 < H;
else {
K = L.startPath();
if (!J.isBlock && !1 !== q.editor.config.autoParagraph && q.editor.activeEnterMode != CKEDITOR.ENTER_BR && (q.editor.editable().equals(K.blockLimit) && !K.block) && (U = q.editor.activeEnterMode != CKEDITOR.ENTER_BR &&
!1 !== q.editor.config.autoParagraph ? q.editor.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p" : !1)) U = R.createElement(U), U.appendBogus(), L.insertNode(U), CKEDITOR.env.needsBrFiller && (Q = U.getBogus()) && Q.remove(), L.moveToPosition(U, CKEDITOR.POSITION_BEFORE_END);
if ((K = L.startPath().block) && !K.equals(O)) {
if (Q = K.getBogus()) Q.remove(), N.push(K);
O = K
}
J.firstNotAllowed && (z = 1);
if (z && J.isElement) {
K = L.startContainer;
for (S = null; K && !l[K.getName()][J.name];) {
if (K.equals(r)) {
K = null;
break
}
S = K;
K = K.getParent()
}
if (K) S && (W =
L.splitElement(S), q.zombies.push(W), q.zombies.push(S));
else {
S = r.getName();
X = !H;
K = H == I.length - 1;
S = d(J.node, S);
for (var T = [], Z = S.length, aa = 0, E = void 0, ca = 0, da = -1; aa < Z; aa++)
if (E = S[aa], " " == E) {
if (!ca && (!X || aa)) T.push(new CKEDITOR.dom.text(" ")), da = T.length;
ca = 1
} else T.push(E), ca = 0;
K && da == T.length && T.pop();
X = T
}
}
if (X) {
for (; K = X.pop();) L.insertNode(K);
X = 0
} else L.insertNode(J.node);
J.lastNotAllowed && H < I.length - 1 && ((W = P ? F : W) && L.setEndAt(W, CKEDITOR.POSITION_AFTER_START), z = 0);
L.collapse()
}
}
q.dontMoveCaret = M;
q.bogusNeededBlocks =
N
}
Q = q.range;
var $;
W = q.bogusNeededBlocks;
for (X = Q.createBookmark(); O = q.zombies.pop();) O.getParent() && (U = Q.clone(), U.moveToElementEditStart(O), U.removeEmptyBlocksAtEnd());
if (W)
for (; O = W.pop();) CKEDITOR.env.needsBrFiller ? O.appendBogus() : O.append(Q.document.createText("\u00a0"));
for (; O = q.mergeCandidates.pop();) O.mergeSiblings();
Q.moveToBookmark(X);
if (!q.dontMoveCaret) {
for (O = b(Q.startContainer) && Q.startContainer.getChild(Q.startOffset - 1); O && b(O) && !O.is(l.$empty);) {
if (O.isBlockBoundary()) Q.moveToPosition(O,
CKEDITOR.POSITION_BEFORE_END);
else {
if (e(O) && O.getHtml().match(/(\s|&nbsp;)$/g)) {
$ = null;
break
}
$ = Q.clone();
$.moveToPosition(O, CKEDITOR.POSITION_BEFORE_END)
}
O = O.getLast(a)
}
$ && Q.moveToRange($)
}
B.select();
k(f)
}
}
}()
}(),
function() {
function d() {
var a = this._.fakeSelection,
b;
if (a && (b = this.getSelection(1), !b || !b.isHidden())) a.reset(), a = 0;
if (!a && (a = b || this.getSelection(1), !a || a.getType() == CKEDITOR.SELECTION_NONE)) return;
this.fire("selectionCheck", a);
b = this.elementPath();
b.compare(this._.selectionPreviousPath) ||
(CKEDITOR.env.webkit && (this._.previousActive = this.document.getActive()), this._.selectionPreviousPath = b, this.fire("selectionChange", {
selection: a,
path: b
}))
}
function f() {
q = !0;
n || (c.call(this), n = CKEDITOR.tools.setTimeout(c, 200, this))
}
function c() {
n = null;
q && (CKEDITOR.tools.setTimeout(d, 0, this), q = !1)
}
function a(a) {
function b(c, d) {
return !c || c.type == CKEDITOR.NODE_TEXT ? !1 : a.clone()["moveToElementEdit" + (d ? "End" : "Start")](c)
}
if (!(a.root instanceof CKEDITOR.editable)) return !1;
var c = a.startContainer,
d = a.getPreviousNode(r,
null, c),
e = a.getNextNode(r, null, c);
return b(d) || b(e, 1) || !d && !e && !(c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary() && c.getBogus()) ? !0 : !1
}
function b(a) {
return a.getCustomData("cke-fillingChar")
}
function e(a, b) {
var c = a && a.removeCustomData("cke-fillingChar");
if (c) {
if (!1 !== b) {
var d, e = a.getDocument().getSelection().getNative(),
h = e && "None" != e.type && e.getRangeAt(0);
if (1 < c.getLength() && h && h.intersectsNode(c.$)) {
d = [e.anchorOffset, e.focusOffset];
h = e.focusNode == c.$ && 0 < e.focusOffset;
e.anchorNode == c.$ && 0 < e.anchorOffset &&
d[0] --;
h && d[1] --;
var k, h = e;
h.isCollapsed || (k = h.getRangeAt(0), k.setStart(h.anchorNode, h.anchorOffset), k.setEnd(h.focusNode, h.focusOffset), k = k.collapsed);
k && d.unshift(d.pop())
}
}
c.setText(g(c.getText()));
d && (c = e.getRangeAt(0), c.setStart(c.startContainer, d[0]), c.setEnd(c.startContainer, d[1]), e.removeAllRanges(), e.addRange(c))
}
}
function g(a) {
return a.replace(/\u200B( )?/g, function(a) {
return a[1] ? "\u00a0" : ""
})
}
function k(a, b, c) {
var d = a.on("focus", function(a) {
a.cancel()
}, null, null, -100);
if (CKEDITOR.env.ie) var e =
a.getDocument().on("selectionchange", function(a) {
a.cancel()
}, null, null, -100);
else {
var h = new CKEDITOR.dom.range(a);
h.moveToElementEditStart(a);
var k = a.getDocument().$.createRange();
k.setStart(h.startContainer.$, h.startOffset);
k.collapse(1);
b.removeAllRanges();
b.addRange(k)
}
c && a.focus();
d.removeListener();
e && e.removeListener()
}
function h(a) {
var b = CKEDITOR.dom.element.createFromHtml('<div data-cke-hidden-sel="1" data-cke-temp="1" style="' + (CKEDITOR.env.ie ? "display:none" : "position:fixed;top:0;left:-1000px") +
'">&nbsp;</div>', a.document);
a.fire("lockSnapshot");
a.editable().append(b);
var c = a.getSelection(),
d = a.createRange(),
e = c.root.on("selectionchange", function(a) {
a.cancel()
}, null, null, 0);
d.setStartAt(b, CKEDITOR.POSITION_AFTER_START);
d.setEndAt(b, CKEDITOR.POSITION_BEFORE_END);
c.selectRanges([d]);
e.removeListener();
a.fire("unlockSnapshot");
a._.hiddenSelectionContainer = b
}
function l(a) {
var b = {
37: 1,
39: 1,
8: 1,
46: 1
};
return function(c) {
var d = c.data.getKeystroke();
if (b[d]) {
var e = a.getSelection().getRanges(),
h =
e[0];
if (1 == e.length && h.collapsed && (d = h[38 > d ? "getPreviousEditableNode" : "getNextEditableNode"]()) && d.type == CKEDITOR.NODE_ELEMENT && "false" == d.getAttribute("contenteditable")) a.getSelection().fake(d), c.data.preventDefault(), c.cancel()
}
}
}
var n, q, r = CKEDITOR.dom.walker.invisible(1),
u = function() {
function a(b) {
return function(a) {
var c = a.editor.createRange();
c.moveToClosestEditablePosition(a.selected, b) && a.editor.getSelection().selectRanges([c]);
return !1
}
}
function b(a) {
return function(b) {
var c = b.editor,
d = c.createRange(),
e;
if (!(e = d.moveToClosestEditablePosition(b.selected, a))) e = d.moveToClosestEditablePosition(b.selected, !a);
e && c.getSelection().selectRanges([d]);
c.fire("saveSnapshot");
b.selected.remove();
e || (d.moveToElementEditablePosition(c.editable()), c.getSelection().selectRanges([d]));
c.fire("saveSnapshot");
return !1
}
}
var c = a(),
d = a(1);
return {
37: c,
38: c,
39: d,
40: d,
8: b(),
46: b(1)
}
}();
CKEDITOR.on("instanceCreated", function(a) {
function b() {
var a = c.getSelection();
a && a.removeAllRanges()
}
var c = a.editor;
c.on("contentDom",
function() {
var a = c.document,
b = CKEDITOR.document,
h = c.editable(),
k = a.getBody(),
g = a.getDocumentElement(),
n = h.isInline(),
x, q;
CKEDITOR.env.gecko && h.attachListener(h, "focus", function(a) {
a.removeListener();
if (0 !== x && (a = c.getSelection().getNative()) && a.isCollapsed && a.anchorNode == h.$) a = c.createRange(), a.moveToElementEditStart(h), a.select()
}, null, null, -2);
h.attachListener(h, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() {
x && CKEDITOR.env.webkit && (x = c._.previousActive && c._.previousActive.equals(a.getActive()));
c.unlockSelection(x);
x = 0
}, null, null, -1);
h.attachListener(h, "mousedown", function() {
x = 0
});
if (CKEDITOR.env.ie || CKEDITOR.env.opera || n) {
var t = function() {
q = new CKEDITOR.dom.selection(c.getSelection());
q.lock()
};
m ? h.attachListener(h, "beforedeactivate", t, null, null, -1) : h.attachListener(c, "selectionCheck", t, null, null, -1);
h.attachListener(h, CKEDITOR.env.webkit ? "DOMFocusOut" : "blur", function() {
c.lockSelection(q);
x = 1
}, null, null, -1);
h.attachListener(h, "mousedown", function() {
x = 0
})
}
if (CKEDITOR.env.ie && !n) {
var p;
h.attachListener(h,
"mousedown",
function(a) {
if (2 == a.data.$.button && (a = c.document.getSelection(), !a || a.getType() == CKEDITOR.SELECTION_NONE)) p = c.window.getScrollPosition()
});
h.attachListener(h, "mouseup", function(a) {
2 == a.data.$.button && p && (c.document.$.documentElement.scrollLeft = p.x, c.document.$.documentElement.scrollTop = p.y);
p = null
});
if ("BackCompat" != a.$.compatMode) {
if (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) g.on("mousedown", function(a) {
function c(a) {
a = a.data.$;
if (e) {
var b = k.$.createTextRange();
try {
b.moveToPoint(a.x,
a.y)
} catch (d) {}
e.setEndPoint(0 > f.compareEndPoints("StartToStart", b) ? "EndToEnd" : "StartToStart", b);
e.select()
}
}
function d() {
g.removeListener("mousemove", c);
b.removeListener("mouseup", d);
g.removeListener("mouseup", d);
e.select()
}
a = a.data;
if (a.getTarget().is("html") && a.$.y < g.$.clientHeight && a.$.x < g.$.clientWidth) {
var e = k.$.createTextRange();
try {
e.moveToPoint(a.$.x, a.$.y)
} catch (h) {}
var f = e.duplicate();
g.on("mousemove", c);
b.on("mouseup", d);
g.on("mouseup", d)
}
});
if (7 < CKEDITOR.env.version && 11 > CKEDITOR.env.version) {
g.on("mousedown",
function(a) {
a.data.getTarget().is("html") && (b.on("mouseup", r), g.on("mouseup", r))
});
var r = function() {
b.removeListener("mouseup", r);
g.removeListener("mouseup", r);
var c = CKEDITOR.document.$.selection,
d = c.createRange();
"None" != c.type && d.parentElement().ownerDocument == a.$ && d.select()
}
}
}
}
h.attachListener(h, "selectionchange", d, c);
h.attachListener(h, "keyup", f, c);
h.attachListener(h, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() {
c.forceNextSelectionCheck();
c.selectionChange(1)
});
if (n ? CKEDITOR.env.webkit ||
CKEDITOR.env.gecko : CKEDITOR.env.opera) {
var I;
h.attachListener(h, "mousedown", function() {
I = 1
});
h.attachListener(a.getDocumentElement(), "mouseup", function() {
I && f.call(c);
I = 0
})
} else h.attachListener(CKEDITOR.env.ie ? h : a.getDocumentElement(), "mouseup", f, c);
CKEDITOR.env.webkit && h.attachListener(a, "keydown", function(a) {
switch (a.data.getKey()) {
case 13:
case 33:
case 34:
case 35:
case 36:
case 37:
case 39:
case 8:
case 45:
case 46:
e(h)
}
}, null, null, -1);
h.attachListener(h, "keydown", l(c), null, null, -1)
});
c.on("contentDomUnload",
c.forceNextSelectionCheck, c);
c.on("dataReady", function() {
delete c._.fakeSelection;
delete c._.hiddenSelectionContainer;
c.selectionChange(1)
});
c.on("loadSnapshot", function() {
var a = c.editable().getLast(function(a) {
return a.type == CKEDITOR.NODE_ELEMENT
});
a && a.hasAttribute("data-cke-hidden-sel") && a.remove()
}, null, null, 100);
CKEDITOR.env.ie9Compat && c.on("beforeDestroy", b, null, null, 9);
CKEDITOR.env.webkit && c.on("setData", b);
c.on("contentDomUnload", function() {
c.unlockSelection()
});
c.on("key", function(a) {
if ("wysiwyg" ==
c.mode) {
var b = c.getSelection();
if (b.isFake) {
var d = u[a.data.keyCode];
if (d) return d({
editor: c,
selected: b.getSelectedElement(),
selection: b,
keyEvent: a
})
}
}
})
});
CKEDITOR.on("instanceReady", function(a) {
var c = a.editor;
if (CKEDITOR.env.webkit) {
c.on("selectionChange", function() {
var a = c.editable(),
d = b(a);
d && (d.getCustomData("ready") ? e(a) : d.setCustomData("ready", 1))
}, null, null, -1);
c.on("beforeSetMode", function() {
e(c.editable())
}, null, null, -1);
var d, h;
a = function() {
var a = c.editable();
if (a && (a = b(a))) {
var e = c.document.$.defaultView.getSelection();
"Caret" == e.type && e.anchorNode == a.$ && (h = 1);
d = a.getText();
a.setText(g(d))
}
};
var k = function() {
var a = c.editable();
if (a && (a = b(a))) a.setText(d), h && (c.document.$.defaultView.getSelection().setPosition(a.$, a.getLength()), h = 0)
};
c.on("beforeUndoImage", a);
c.on("afterUndoImage", k);
c.on("beforeGetData", a, null, null, 0);
c.on("getData", k)
}
});
CKEDITOR.editor.prototype.selectionChange = function(a) {
(a ? d : f).call(this)
};
CKEDITOR.editor.prototype.getSelection = function(a) {
return (this._.savedSelection || this._.fakeSelection) &&
!a ? this._.savedSelection || this._.fakeSelection : (a = this.editable()) && "wysiwyg" == this.mode ? new CKEDITOR.dom.selection(a) : null
};
CKEDITOR.editor.prototype.lockSelection = function(a) {
a = a || this.getSelection(1);
return a.getType() != CKEDITOR.SELECTION_NONE ? (!a.isLocked && a.lock(), this._.savedSelection = a, !0) : !1
};
CKEDITOR.editor.prototype.unlockSelection = function(a) {
var b = this._.savedSelection;
return b ? (b.unlock(a), delete this._.savedSelection, !0) : !1
};
CKEDITOR.editor.prototype.forceNextSelectionCheck = function() {
delete this._.selectionPreviousPath
};
CKEDITOR.dom.document.prototype.getSelection = function() {
return new CKEDITOR.dom.selection(this)
};
CKEDITOR.dom.range.prototype.select = function() {
var a = this.root instanceof CKEDITOR.editable ? this.root.editor.getSelection() : new CKEDITOR.dom.selection(this.root);
a.selectRanges([this]);
return a
};
CKEDITOR.SELECTION_NONE = 1;
CKEDITOR.SELECTION_TEXT = 2;
CKEDITOR.SELECTION_ELEMENT = 3;
var m = "function" != typeof window.getSelection,
p = 1;
CKEDITOR.dom.selection = function(a) {
if (a instanceof CKEDITOR.dom.selection) {
var b =
a;
a = a.root
}
var c = a instanceof CKEDITOR.dom.element;
this.rev = b ? b.rev : p++;
this.document = a instanceof CKEDITOR.dom.document ? a : a.getDocument();
this.root = a = c ? a : this.document.getBody();
this.isLocked = 0;
this._ = {
cache: {}
};
if (b) return CKEDITOR.tools.extend(this._.cache, b._.cache), this.isFake = b.isFake, this.isLocked = b.isLocked, this;
b = m ? this.document.$.selection : this.document.getWindow().$.getSelection();
if (CKEDITOR.env.webkit)("None" == b.type && this.document.getActive().equals(a) || "Caret" == b.type && b.anchorNode.nodeType ==
CKEDITOR.NODE_DOCUMENT) && k(a, b);
else if (CKEDITOR.env.gecko) b && this.document.getActive().equals(a) && (b.anchorNode && b.anchorNode.nodeType == CKEDITOR.NODE_DOCUMENT) && k(a, b, !0);
else if (CKEDITOR.env.ie) {
var d;
try {
d = this.document.getActive()
} catch (e) {}
m ? "None" == b.type && d && d.equals(this.document.getDocumentElement()) && k(a, null, !0) : ((b = b && b.anchorNode) && (b = new CKEDITOR.dom.node(b)), d && d.equals(this.document.getDocumentElement()) && (b && (a.equals(b) || a.contains(b))) && k(a, null, !0))
}
d = this.getNative();
var h, g;
if (d)
if (d.getRangeAt) h = (g = d.rangeCount && d.getRangeAt(0)) && new CKEDITOR.dom.node(g.commonAncestorContainer);
else {
try {
g = d.createRange()
} catch (f) {}
h = g && CKEDITOR.dom.element.get(g.item && g.item(0) || g.parentElement())
}
if (!h || !(h.type == CKEDITOR.NODE_ELEMENT || h.type == CKEDITOR.NODE_TEXT) || !this.root.equals(h) && !this.root.contains(h)) this._.cache.type = CKEDITOR.SELECTION_NONE, this._.cache.startElement = null, this._.cache.selectedElement = null, this._.cache.selectedText = "", this._.cache.ranges = new CKEDITOR.dom.rangeList;
return this
};
var w = {
img: 1,
hr: 1,
li: 1,
table: 1,
tr: 1,
td: 1,
th: 1,
embed: 1,
object: 1,
ol: 1,
ul: 1,
a: 1,
input: 1,
form: 1,
select: 1,
textarea: 1,
button: 1,
fieldset: 1,
thead: 1,
tfoot: 1
};
CKEDITOR.dom.selection.prototype = {
getNative: function() {
return void 0 !== this._.cache.nativeSel ? this._.cache.nativeSel : this._.cache.nativeSel = m ? this.document.$.selection : this.document.getWindow().$.getSelection()
},
getType: m ? function() {
var a = this._.cache;
if (a.type) return a.type;
var b = CKEDITOR.SELECTION_NONE;
try {
var c = this.getNative(),
d = c.type;
"Text" == d && (b = CKEDITOR.SELECTION_TEXT);
"Control" == d && (b = CKEDITOR.SELECTION_ELEMENT);
c.createRange().parentElement() && (b = CKEDITOR.SELECTION_TEXT)
} catch (e) {}
return a.type = b
} : function() {
var a = this._.cache;
if (a.type) return a.type;
var b = CKEDITOR.SELECTION_TEXT,
c = this.getNative();
if (!c || !c.rangeCount) b = CKEDITOR.SELECTION_NONE;
else if (1 == c.rangeCount) {
var c = c.getRangeAt(0),
d = c.startContainer;
d == c.endContainer && (1 == d.nodeType && 1 == c.endOffset - c.startOffset && w[d.childNodes[c.startOffset].nodeName.toLowerCase()]) &&
(b = CKEDITOR.SELECTION_ELEMENT)
}
return a.type = b
},
getRanges: function() {
var a = m ? function() {
function a(b) {
return (new CKEDITOR.dom.node(b)).getIndex()
}
var b = function(b, c) {
b = b.duplicate();
b.collapse(c);
var d = b.parentElement();
if (!d.hasChildNodes()) return {
container: d,
offset: 0
};
for (var e = d.children, h, k, g = b.duplicate(), f = 0, l = e.length - 1, m = -1, n, I; f <= l;)
if (m = Math.floor((f + l) / 2), h = e[m], g.moveToElementText(h), n = g.compareEndPoints("StartToStart", b), 0 < n) l = m - 1;
else if (0 > n) f = m + 1;
else return {
container: d,
offset: a(h)
};
if (-1 == m || m == e.length - 1 && 0 > n) {
g.moveToElementText(d);
g.setEndPoint("StartToStart", b);
g = g.text.replace(/(\r\n|\r)/g, "\n").length;
e = d.childNodes;
if (!g) return h = e[e.length - 1], h.nodeType != CKEDITOR.NODE_TEXT ? {
container: d,
offset: e.length
} : {
container: h,
offset: h.nodeValue.length
};
for (d = e.length; 0 < g && 0 < d;) k = e[--d], k.nodeType == CKEDITOR.NODE_TEXT && (I = k, g -= k.nodeValue.length);
return {
container: I,
offset: -g
}
}
g.collapse(0 < n ? !0 : !1);
g.setEndPoint(0 < n ? "StartToStart" : "EndToStart", b);
g = g.text.replace(/(\r\n|\r)/g, "\n").length;
if (!g) return {
container: d,
offset: a(h) + (0 < n ? 0 : 1)
};
for (; 0 < g;) try {
k = h[0 < n ? "previousSibling" : "nextSibling"], k.nodeType == CKEDITOR.NODE_TEXT && (g -= k.nodeValue.length, I = k), h = k
} catch (J) {
return {
container: d,
offset: a(h)
}
}
return {
container: I,
offset: 0 < n ? -g : I.nodeValue.length + g
}
};
return function() {
var a = this.getNative(),
c = a && a.createRange(),
d = this.getType();
if (!a) return [];
if (d == CKEDITOR.SELECTION_TEXT) return a = new CKEDITOR.dom.range(this.root), d = b(c, !0), a.setStart(new CKEDITOR.dom.node(d.container), d.offset), d = b(c),
a.setEnd(new CKEDITOR.dom.node(d.container), d.offset), a.endContainer.getPosition(a.startContainer) & CKEDITOR.POSITION_PRECEDING && a.endOffset <= a.startContainer.getIndex() && a.collapse(), [a];
if (d == CKEDITOR.SELECTION_ELEMENT) {
for (var d = [], e = 0; e < c.length; e++) {
for (var h = c.item(e), k = h.parentNode, g = 0, a = new CKEDITOR.dom.range(this.root); g < k.childNodes.length && k.childNodes[g] != h; g++);
a.setStart(new CKEDITOR.dom.node(k), g);
a.setEnd(new CKEDITOR.dom.node(k), g + 1);
d.push(a)
}
return d
}
return []
}
}() : function() {
var a = [],
b, c = this.getNative();
if (!c) return a;
for (var d = 0; d < c.rangeCount; d++) {
var e = c.getRangeAt(d);
b = new CKEDITOR.dom.range(this.root);
b.setStart(new CKEDITOR.dom.node(e.startContainer), e.startOffset);
b.setEnd(new CKEDITOR.dom.node(e.endContainer), e.endOffset);
a.push(b)
}
return a
};
return function(b) {
var c = this._.cache;
if (c.ranges && !b) return c.ranges;
c.ranges || (c.ranges = new CKEDITOR.dom.rangeList(a.call(this)));
if (b)
for (var d = c.ranges, e = 0; e < d.length; e++) {
var h = d[e];
h.getCommonAncestor().isReadOnly() && d.splice(e,
1);
if (!h.collapsed) {
if (h.startContainer.isReadOnly()) {
b = h.startContainer;
for (var k; b && (!(k = b.type == CKEDITOR.NODE_ELEMENT) || !b.is("body")) && b.isReadOnly();) k && "false" == b.getAttribute("contentEditable") && h.setStartAfter(b), b = b.getParent()
}
b = h.startContainer;
k = h.endContainer;
var g = h.startOffset,
f = h.endOffset,
l = h.clone();
b && b.type == CKEDITOR.NODE_TEXT && (g >= b.getLength() ? l.setStartAfter(b) : l.setStartBefore(b));
k && k.type == CKEDITOR.NODE_TEXT && (f ? l.setEndAfter(k) : l.setEndBefore(k));
b = new CKEDITOR.dom.walker(l);
b.evaluator = function(a) {
if (a.type == CKEDITOR.NODE_ELEMENT && a.isReadOnly()) {
var b = h.clone();
h.setEndBefore(a);
h.collapsed && d.splice(e--, 1);
a.getPosition(l.endContainer) & CKEDITOR.POSITION_CONTAINS || (b.setStartAfter(a), b.collapsed || d.splice(e + 1, 0, b));
return !0
}
return !1
};
b.next()
}
}
return c.ranges
}
}(),
getStartElement: function() {
var a = this._.cache;
if (void 0 !== a.startElement) return a.startElement;
var b;
switch (this.getType()) {
case CKEDITOR.SELECTION_ELEMENT:
return this.getSelectedElement();
case CKEDITOR.SELECTION_TEXT:
var c =
this.getRanges()[0];
if (c) {
if (c.collapsed) b = c.startContainer, b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent());
else {
for (c.optimize();;)
if (b = c.startContainer, c.startOffset == (b.getChildCount ? b.getChildCount() : b.getLength()) && !b.isBlockBoundary()) c.setStartAfter(b);
else break;
b = c.startContainer;
if (b.type != CKEDITOR.NODE_ELEMENT) return b.getParent();
b = b.getChild(c.startOffset);
if (!b || b.type != CKEDITOR.NODE_ELEMENT) b = c.startContainer;
else
for (c = b.getFirst(); c && c.type == CKEDITOR.NODE_ELEMENT;) b = c, c = c.getFirst()
}
b =
b.$
}
}
return a.startElement = b ? new CKEDITOR.dom.element(b) : null
},
getSelectedElement: function() {
var a = this._.cache;
if (void 0 !== a.selectedElement) return a.selectedElement;
var b = this,
c = CKEDITOR.tools.tryThese(function() {
return b.getNative().createRange().item(0)
}, function() {
for (var a = b.getRanges()[0].clone(), c, d, e = 2; e && (!(c = a.getEnclosedNode()) || !(c.type == CKEDITOR.NODE_ELEMENT && w[c.getName()] && (d = c))); e--) a.shrink(CKEDITOR.SHRINK_ELEMENT);
return d && d.$
});
return a.selectedElement = c ? new CKEDITOR.dom.element(c) :
null
},
getSelectedText: function() {
var a = this._.cache;
if (void 0 !== a.selectedText) return a.selectedText;
var b = this.getNative(),
b = m ? "Control" == b.type ? "" : b.createRange().text : b.toString();
return a.selectedText = b
},
lock: function() {
this.getRanges();
this.getStartElement();
this.getSelectedElement();
this.getSelectedText();
this._.cache.nativeSel = null;
this.isLocked = 1
},
unlock: function(a) {
if (this.isLocked) {
if (a) var b = this.getSelectedElement(),
c = !b && this.getRanges(),
d = this.isFake;
this.isLocked = 0;
this.reset();
a &&
(a = b || c[0] && c[0].getCommonAncestor()) && a.getAscendant("body", 1) && (d ? this.fake(b) : b ? this.selectElement(b) : this.selectRanges(c))
}
},
reset: function() {
this._.cache = {};
this.isFake = 0;
var a = this.root.editor;
if (a && a._.fakeSelection && this.rev == a._.fakeSelection.rev) {
delete a._.fakeSelection;
var b = a._.hiddenSelectionContainer;
b && (a.fire("lockSnapshot"), b.remove(), a.fire("unlockSnapshot"));
delete a._.hiddenSelectionContainer
}
this.rev = p++
},
selectElement: function(a) {
var b = new CKEDITOR.dom.range(this.root);
b.setStartBefore(a);
b.setEndAfter(a);
this.selectRanges([b])
},
selectRanges: function(b) {
this.reset();
if (b.length)
if (this.isLocked) {
var c = CKEDITOR.document.getActive();
this.unlock();
this.selectRanges(b);
this.lock();
!c.equals(this.root) && c.focus()
} else if (1 == b.length && !b[0].collapsed && (c = b[0].getEnclosedNode()) && c.type == CKEDITOR.NODE_ELEMENT && "false" == c.getAttribute("contenteditable")) this.fake(c);
else {
if (m) {
var d = CKEDITOR.dom.walker.whitespaces(!0),
h = /\ufeff|\u00a0/,
k = {
table: 1,
tbody: 1,
tr: 1
};
1 < b.length && (c = b[b.length - 1],
b[0].setEnd(c.endContainer, c.endOffset));
c = b[0];
b = c.collapsed;
var g, l, f, n = c.getEnclosedNode();
if (n && n.type == CKEDITOR.NODE_ELEMENT && n.getName() in w && (!n.is("a") || !n.getText())) try {
f = n.$.createControlRange();
f.addElement(n.$);
f.select();
return
} catch (q) {}(c.startContainer.type == CKEDITOR.NODE_ELEMENT && c.startContainer.getName() in k || c.endContainer.type == CKEDITOR.NODE_ELEMENT && c.endContainer.getName() in k) && c.shrink(CKEDITOR.NODE_ELEMENT, !0);
f = c.createBookmark();
var k = f.startNode,
p;
b || (p = f.endNode);
f =
c.document.$.body.createTextRange();
f.moveToElementText(k.$);
f.moveStart("character", 1);
p ? (h = c.document.$.body.createTextRange(), h.moveToElementText(p.$), f.setEndPoint("EndToEnd", h), f.moveEnd("character", -1)) : (g = k.getNext(d), l = k.hasAscendant("pre"), g = !(g && g.getText && g.getText().match(h)) && (l || !k.hasPrevious() || k.getPrevious().is && k.getPrevious().is("br")), l = c.document.createElement("span"), l.setHtml("&#65279;"), l.insertBefore(k), g && c.document.createText("\ufeff").insertBefore(k));
c.setStartBefore(k);
k.remove();
b ? (g ? (f.moveStart("character", -1), f.select(), c.document.$.selection.clear()) : f.select(), c.moveToPosition(l, CKEDITOR.POSITION_BEFORE_START), l.remove()) : (c.setEndBefore(p), p.remove(), f.select())
} else {
p = this.getNative();
if (!p) return;
CKEDITOR.env.opera && (c = this.document.$.createRange(), c.selectNodeContents(this.root.$), p.addRange(c));
this.removeAllRanges();
for (f = 0; f < b.length; f++) {
if (f < b.length - 1 && (c = b[f], h = b[f + 1], l = c.clone(), l.setStart(c.endContainer, c.endOffset), l.setEnd(h.startContainer,
h.startOffset), !l.collapsed && (l.shrink(CKEDITOR.NODE_ELEMENT, !0), g = l.getCommonAncestor(), l = l.getEnclosedNode(), g.isReadOnly() || l && l.isReadOnly()))) {
h.setStart(c.startContainer, c.startOffset);
b.splice(f--, 1);
continue
}
c = b[f];
h = this.document.$.createRange();
g = c.startContainer;
if (CKEDITOR.env.opera && (c.collapsed && g.type == CKEDITOR.NODE_ELEMENT) && (l = g.getChild(c.startOffset - 1), d = g.getChild(c.startOffset), !l && !d && g.is(CKEDITOR.dtd.$removeEmpty) || l && l.type == CKEDITOR.NODE_ELEMENT || d && d.type == CKEDITOR.NODE_ELEMENT)) c.insertNode(this.document.createText("")),
c.collapse(1);
c.collapsed && (CKEDITOR.env.webkit && a(c)) && (g = this.root, e(g, !1), l = g.getDocument().createText("\u200b"), g.setCustomData("cke-fillingChar", l), c.insertNode(l), (g = l.getNext()) && !l.getPrevious() && g.type == CKEDITOR.NODE_ELEMENT && "br" == g.getName() ? (e(this.root), c.moveToPosition(g, CKEDITOR.POSITION_BEFORE_START)) : c.moveToPosition(l, CKEDITOR.POSITION_AFTER_END));
h.setStart(c.startContainer.$, c.startOffset);
try {
h.setEnd(c.endContainer.$, c.endOffset)
} catch (r) {
if (0 <= r.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")) c.collapse(1),
h.setEnd(c.endContainer.$, c.endOffset);
else throw r;
}
p.addRange(h)
}
}
this.reset();
this.root.fire("selectionchange")
}
},
fake: function(a) {
var b = this.root.editor;
this.reset();
h(b);
var c = this._.cache,
d = new CKEDITOR.dom.range(this.root);
d.setStartBefore(a);
d.setEndAfter(a);
c.ranges = new CKEDITOR.dom.rangeList(d);
c.selectedElement = c.startElement = a;
c.type = CKEDITOR.SELECTION_ELEMENT;
c.selectedText = c.nativeSel = null;
this.isFake = 1;
this.rev = p++;
b._.fakeSelection = this;
this.root.fire("selectionchange")
},
isHidden: function() {
var a =
this.getCommonAncestor();
a && a.type == CKEDITOR.NODE_TEXT && (a = a.getParent());
return !(!a || !a.data("cke-hidden-sel"))
},
createBookmarks: function(a) {
a = this.getRanges().createBookmarks(a);
this.isFake && (a.isFake = 1);
return a
},
createBookmarks2: function(a) {
a = this.getRanges().createBookmarks2(a);
this.isFake && (a.isFake = 1);
return a
},
selectBookmarks: function(a) {
for (var b = [], c = 0; c < a.length; c++) {
var d = new CKEDITOR.dom.range(this.root);
d.moveToBookmark(a[c]);
b.push(d)
}
a.isFake ? this.fake(b[0].getEnclosedNode()) : this.selectRanges(b);
return this
},
getCommonAncestor: function() {
var a = this.getRanges();
return !a.length ? null : a[0].startContainer.getCommonAncestor(a[a.length - 1].endContainer)
},
scrollIntoView: function() {
this.type != CKEDITOR.SELECTION_NONE && this.getRanges()[0].scrollIntoView()
},
removeAllRanges: function() {
var a = this.getNative();
try {
a && a[m ? "empty" : "removeAllRanges"]()
} catch (b) {}
this.reset()
}
}
}(), "use strict", CKEDITOR.editor.prototype.attachStyleStateChange = function(d, f) {
var c = this._.styleStateChangeCallbacks;
c || (c = this._.styleStateChangeCallbacks = [], this.on("selectionChange", function(a) {
for (var b = 0; b < c.length; b++) {
var d = c[b],
g = d.style.checkActive(a.data.path) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
d.fn.call(this, g)
}
}));
c.push({
style: d,
fn: f
})
}, CKEDITOR.STYLE_BLOCK = 1, CKEDITOR.STYLE_INLINE = 2, CKEDITOR.STYLE_OBJECT = 3,
function() {
function d(a, b) {
for (var c, d;
(a = a.getParent()) && !a.equals(b);)
if (a.getAttribute("data-nostyle")) c = a;
else if (!d) {
var e = a.getAttribute("contentEditable");
"false" == e ? c = a : "true" == e && (d = 1)
}
return c
}
function f(b) {
var c = b.document;
if (b.collapsed) c = w(this, c), b.insertNode(c), b.moveToPosition(c, CKEDITOR.POSITION_BEFORE_END);
else {
var e = this.element,
h = this._.definition,
k, g = h.ignoreReadonly,
l = g || h.includeReadonly;
void 0 == l && (l = b.root.getCustomData("cke_includeReadonly"));
var m = CKEDITOR.dtd[e];
m || (k = !0, m = CKEDITOR.dtd.span);
b.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
b.trim();
var n = b.createBookmark(),
q = n.startNode,
p = n.endNode,
r = q,
t;
if (!g) {
var x = b.getCommonAncestor(),
g = d(q, x),
x = d(p, x);
g && (r = g.getNextSourceNode(!0));
x && (p = x)
}
for (r.getPosition(p) ==
CKEDITOR.POSITION_FOLLOWING && (r = 0); r;) {
g = !1;
if (r.equals(p)) r = null, g = !0;
else {
var s = r.type == CKEDITOR.NODE_ELEMENT ? r.getName() : null,
x = s && "false" == r.getAttribute("contentEditable"),
y = s && r.getAttribute("data-nostyle");
if (s && r.data("cke-bookmark")) {
r = r.getNextSourceNode(!0);
continue
}
if (x && l && CKEDITOR.dtd.$block[s])
for (var z = r, A = a(z), v = void 0, C = A.length, B = 0, z = C && new CKEDITOR.dom.range(z.getDocument()); B < C; ++B) {
var v = A[B],
G = CKEDITOR.filter.instances[v.data("cke-filter")];
if (G ? G.check(this) : 1) z.selectNodeContents(v),
f.call(this, z)
}
if (A = s ? !m[s] || y ? 0 : x && !l ? 0 : (r.getPosition(p) | M) == M && (!h.childRule || h.childRule(r)) : 1)
if ((A = r.getParent()) && ((A.getDtd() || CKEDITOR.dtd.span)[e] || k) && (!h.parentRule || h.parentRule(A))) {
if (!t && (!s || !CKEDITOR.dtd.$removeEmpty[s] || (r.getPosition(p) | M) == M)) t = b.clone(), t.setStartBefore(r);
s = r.type;
if (s == CKEDITOR.NODE_TEXT || x || s == CKEDITOR.NODE_ELEMENT && !r.getChildCount()) {
for (var s = r, E;
(g = !s.getNext(D)) && (E = s.getParent(), m[E.getName()]) && (E.getPosition(q) | F) == F && (!h.childRule || h.childRule(E));) s =
E;
t.setEndAfter(s)
}
} else g = !0;
else g = !0;
r = r.getNextSourceNode(y || x)
}
if (g && t && !t.collapsed) {
for (var g = w(this, c), x = g.hasAttributes(), y = t.getCommonAncestor(), s = {}, A = {}, v = {}, C = {}, Y, V, ba; g && y;) {
if (y.getName() == e) {
for (Y in h.attributes)
if (!C[Y] && (ba = y.getAttribute(V))) g.getAttribute(Y) == ba ? A[Y] = 1 : C[Y] = 1;
for (V in h.styles)
if (!v[V] && (ba = y.getStyle(V))) g.getStyle(V) == ba ? s[V] = 1 : v[V] = 1
}
y = y.getParent()
}
for (Y in A) g.removeAttribute(Y);
for (V in s) g.removeStyle(V);
x && !g.hasAttributes() && (g = null);
g ? (t.extractContents().appendTo(g),
t.insertNode(g), u.call(this, g), g.mergeSiblings(), CKEDITOR.env.ie || g.$.normalize()) : (g = new CKEDITOR.dom.element("span"), t.extractContents().appendTo(g), t.insertNode(g), u.call(this, g), g.remove(!0));
t = null
}
}
b.moveToBookmark(n);
b.shrink(CKEDITOR.SHRINK_TEXT);
b.shrink(CKEDITOR.NODE_ELEMENT, !0)
}
}
function c(a) {
function b() {
for (var a = new CKEDITOR.dom.elementPath(d.getParent()), c = new CKEDITOR.dom.elementPath(f.getParent()), e = null, h = null, g = 0; g < a.elements.length; g++) {
var k = a.elements[g];
if (k == a.block || k == a.blockLimit) break;
n.checkElementRemovable(k) && (e = k)
}
for (g = 0; g < c.elements.length; g++) {
k = c.elements[g];
if (k == c.block || k == c.blockLimit) break;
n.checkElementRemovable(k) && (h = k)
}
h && f.breakParent(h);
e && d.breakParent(e)
}
a.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
var c = a.createBookmark(),
d = c.startNode;
if (a.collapsed) {
for (var e = new CKEDITOR.dom.elementPath(d.getParent(), a.root), h, g = 0, k; g < e.elements.length && (k = e.elements[g]) && !(k == e.block || k == e.blockLimit); g++)
if (this.checkElementRemovable(k)) {
var l;
a.collapsed && (a.checkBoundaryOfElement(k,
CKEDITOR.END) || (l = a.checkBoundaryOfElement(k, CKEDITOR.START))) ? (h = k, h.match = l ? "start" : "end") : (k.mergeSiblings(), k.is(this.element) ? r.call(this, k) : m(k, y(this)[k.getName()]))
}
if (h) {
k = d;
for (g = 0;; g++) {
l = e.elements[g];
if (l.equals(h)) break;
else if (l.match) continue;
else l = l.clone();
l.append(k);
k = l
}
k["start" == h.match ? "insertBefore" : "insertAfter"](h)
}
} else {
var f = c.endNode,
n = this;
b();
for (e = d; !e.equals(f);) h = e.getNextSourceNode(), e.type == CKEDITOR.NODE_ELEMENT && this.checkElementRemovable(e) && (e.getName() == this.element ?
r.call(this, e) : m(e, y(this)[e.getName()]), h.type == CKEDITOR.NODE_ELEMENT && h.contains(d) && (b(), h = d.getNext())), e = h
}
a.moveToBookmark(c);
a.shrink(CKEDITOR.NODE_ELEMENT, !0)
}
function a(a) {
var b = [];
a.forEach(function(a) {
if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1
}, CKEDITOR.NODE_ELEMENT, !0);
return b
}
function b(a) {
var b = a.getEnclosedNode() || a.getCommonAncestor(!1, !0);
(a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) && !a.isReadOnly() && t(a, this)
}
function e(a) {
var b = a.getCommonAncestor(!0, !0);
if (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) {
var b = this._.definition,
c = b.attributes;
if (c)
for (var d in c) a.removeAttribute(d, c[d]);
if (b.styles)
for (var e in b.styles) b.styles.hasOwnProperty(e) && a.removeStyle(e)
}
}
function g(a) {
var b = a.createBookmark(!0),
c = a.createIterator();
c.enforceRealBlocks = !0;
this._.enterMode && (c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR);
for (var d, e = a.document, g; d = c.getNextParagraph();)
if (!d.isReadOnly() && (c.activeFilter ? c.activeFilter.check(this) :
1)) g = w(this, e, d), h(d, g);
a.moveToBookmark(b)
}
function k(a) {
var b = a.createBookmark(1),
c = a.createIterator();
c.enforceRealBlocks = !0;
c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;
for (var d, e; d = c.getNextParagraph();) this.checkElementRemovable(d) && (d.is("pre") ? ((e = this._.enterMode == CKEDITOR.ENTER_BR ? null : a.document.createElement(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div")) && d.copyAttributes(e), h(d, e)) : r.call(this, d));
a.moveToBookmark(b)
}
function h(a, b) {
var c = !b;
c && (b = a.getDocument().createElement("div"),
a.copyAttributes(b));
var d = b && b.is("pre"),
e = a.is("pre"),
h = !d && e;
if (d && !e) {
e = b;
(h = a.getBogus()) && h.remove();
h = a.getHtml();
h = n(h, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, "");
h = h.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, "$1");
h = h.replace(/([ \t\n\r]+|&nbsp;)/g, " ");
h = h.replace(/<br\b[^>]*>/gi, "\n");
if (CKEDITOR.env.ie) {
var g = a.getDocument().createElement("div");
g.append(e);
e.$.outerHTML = "<pre>" + h + "</pre>";
e.copyAttributes(g.getFirst());
e = g.getFirst().remove()
} else e.setHtml(h);
b = e
} else h ? b = q(c ? [a.getHtml()] :
l(a), b) : a.moveChildren(b);
b.replace(a);
if (d) {
var c = b,
k;
if ((k = c.getPrevious(B)) && k.type == CKEDITOR.NODE_ELEMENT && k.is("pre")) d = n(k.getHtml(), /\n$/, "") + "\n\n" + n(c.getHtml(), /^\n/, ""), CKEDITOR.env.ie ? c.$.outerHTML = "<pre>" + d + "</pre>" : c.setHtml(d), k.remove()
} else c && p(b)
}
function l(a) {
a.getName();
var b = [];
n(a.getOuterHtml(), /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi, function(a, b, c) {
return b + "</pre>" + c + "<pre>"
}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi, function(a, c) {
b.push(c)
});
return b
}
function n(a, b, c) {
var d = "",
e = "";
a = a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi, function(a, b, c) {
b && (d = b);
c && (e = c);
return ""
});
return d + a.replace(b, c) + e
}
function q(a, b) {
var c;
1 < a.length && (c = new CKEDITOR.dom.documentFragment(b.getDocument()));
for (var d = 0; d < a.length; d++) {
var e = a[d],
e = e.replace(/(\r\n|\r)/g, "\n"),
e = n(e, /^[ \t]*\n/, ""),
e = n(e, /\n$/, ""),
e = n(e, /^[ \t]+|[ \t]+$/g, function(a, b) {
return 1 == a.length ? "&nbsp;" : b ? " " + CKEDITOR.tools.repeat("&nbsp;",
a.length - 1) : CKEDITOR.tools.repeat("&nbsp;", a.length - 1) + " "
}),
e = e.replace(/\n/g, "<br>"),
e = e.replace(/[ \t]{2,}/g, function(a) {
return CKEDITOR.tools.repeat("&nbsp;", a.length - 1) + " "
});
if (c) {
var h = b.clone();
h.setHtml(e);
c.append(h)
} else b.setHtml(e)
}
return c || b
}
function r(a) {
var b = this._.definition,
c = b.attributes,
b = b.styles,
d = y(this)[a.getName()],
e = CKEDITOR.tools.isEmpty(c) && CKEDITOR.tools.isEmpty(b),
h;
for (h in c)("class" == h || this._.definition.fullMatch) && a.getAttribute(h) != z(h, c[h]) || (e = a.hasAttribute(h),
a.removeAttribute(h));
for (var g in b) this._.definition.fullMatch && a.getStyle(g) != z(g, b[g], !0) || (e = e || !!a.getStyle(g), a.removeStyle(g));
m(a, d, s[a.getName()]);
e && (this._.definition.alwaysRemoveElement ? p(a, 1) : !CKEDITOR.dtd.$block[a.getName()] || this._.enterMode == CKEDITOR.ENTER_BR && !a.hasAttributes() ? p(a) : a.renameNode(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div"))
}
function u(a) {
for (var b = y(this), c = a.getElementsByTag(this.element), d, e = c.count(); 0 <= --e;) d = c.getItem(e), d.isReadOnly() || r.call(this, d);
for (var h in b)
if (h !=
this.element) {
c = a.getElementsByTag(h);
for (e = c.count() - 1; 0 <= e; e--) d = c.getItem(e), d.isReadOnly() || m(d, b[h])
}
}
function m(a, b, c) {
if (b = b && b.attributes)
for (var d = 0; d < b.length; d++) {
var e = b[d][0],
h;
if (h = a.getAttribute(e)) {
var g = b[d][1];
(null === g || g.test && g.test(h) || "string" == typeof g && h == g) && a.removeAttribute(e)
}
}
c || p(a)
}
function p(a, b) {
if (!a.hasAttributes() || b)
if (CKEDITOR.dtd.$block[a.getName()]) {
var c = a.getPrevious(B),
d = a.getNext(B);
c && (c.type == CKEDITOR.NODE_TEXT || !c.isBlockBoundary({
br: 1
})) && a.append("br",
1);
d && (d.type == CKEDITOR.NODE_TEXT || !d.isBlockBoundary({
br: 1
})) && a.append("br");
a.remove(!0)
} else c = a.getFirst(), d = a.getLast(), a.remove(!0), c && (c.type == CKEDITOR.NODE_ELEMENT && c.mergeSiblings(), d && !c.equals(d) && d.type == CKEDITOR.NODE_ELEMENT && d.mergeSiblings())
}
function w(a, b, c) {
var d;
d = a.element;
"*" == d && (d = "span");
d = new CKEDITOR.dom.element(d, b);
c && c.copyAttributes(d);
d = t(d, a);
b.getCustomData("doc_processing_style") && d.hasAttribute("id") ? d.removeAttribute("id") : b.setCustomData("doc_processing_style",
1);
return d
}
function t(a, b) {
var c = b._.definition,
d = c.attributes,
c = CKEDITOR.style.getStyleText(c);
if (d)
for (var e in d) a.setAttribute(e, d[e]);
c && a.setAttribute("style", c);
return a
}
function x(a, b) {
for (var c in a) a[c] = a[c].replace(A, function(a, c) {
return b[c]
})
}
function y(a) {
if (a._.overrides) return a._.overrides;
var b = a._.overrides = {},
c = a._.definition.overrides;
if (c) {
CKEDITOR.tools.isArray(c) || (c = [c]);
for (var d = 0; d < c.length; d++) {
var e = c[d],
h, g;
"string" == typeof e ? h = e.toLowerCase() : (h = e.element ? e.element.toLowerCase() :
a.element, g = e.attributes);
e = b[h] || (b[h] = {});
if (g) {
var e = e.attributes = e.attributes || [],
k;
for (k in g) e.push([k.toLowerCase(), g[k]])
}
}
}
return b
}
function z(a, b, c) {
var d = new CKEDITOR.dom.element("span");
d[c ? "setStyle" : "setAttribute"](a, b);
return d[c ? "getStyle" : "getAttribute"](a)
}
function C(a, b) {
for (var c = a.document, d = a.getRanges(), e = b ? this.removeFromRange : this.applyToRange, h, g = d.createIterator(); h = g.getNextRange();) e.call(this, h);
a.selectRanges(d);
c.removeCustomData("doc_processing_style")
}
var s = {
address: 1,
div: 1,
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1,
p: 1,
pre: 1,
section: 1,
header: 1,
footer: 1,
nav: 1,
article: 1,
aside: 1,
figure: 1,
dialog: 1,
hgroup: 1,
time: 1,
meter: 1,
menu: 1,
command: 1,
keygen: 1,
output: 1,
progress: 1,
details: 1,
datagrid: 1,
datalist: 1
},
v = {
a: 1,
embed: 1,
hr: 1,
img: 1,
li: 1,
object: 1,
ol: 1,
table: 1,
td: 1,
tr: 1,
th: 1,
ul: 1,
dl: 1,
dt: 1,
dd: 1,
form: 1,
audio: 1,
video: 1
},
G = /\s*(?:;\s*|$)/,
A = /#\((.+?)\)/g,
D = CKEDITOR.dom.walker.bookmark(0, 1),
B = CKEDITOR.dom.walker.whitespaces(1);
CKEDITOR.style = function(a, b) {
var c = a.attributes;
c && c.style && (a.styles =
CKEDITOR.tools.extend({}, a.styles, CKEDITOR.tools.parseCssText(c.style)), delete c.style);
b && (a = CKEDITOR.tools.clone(a), x(a.attributes, b), x(a.styles, b));
c = this.element = a.element ? "string" == typeof a.element ? a.element.toLowerCase() : a.element : "*";
this.type = a.type || (s[c] ? CKEDITOR.STYLE_BLOCK : v[c] ? CKEDITOR.STYLE_OBJECT : CKEDITOR.STYLE_INLINE);
"object" == typeof this.element && (this.type = CKEDITOR.STYLE_OBJECT);
this._ = {
definition: a
}
};
CKEDITOR.editor.prototype.applyStyle = function(a) {
a.checkApplicable(this.elementPath()) &&
C.call(a, this.getSelection())
};
CKEDITOR.editor.prototype.removeStyle = function(a) {
a.checkApplicable(this.elementPath()) && C.call(a, this.getSelection(), 1)
};
CKEDITOR.style.prototype = {
apply: function(a) {
C.call(this, a.getSelection())
},
remove: function(a) {
C.call(this, a.getSelection(), 1)
},
applyToRange: function(a) {
return (this.applyToRange = this.type == CKEDITOR.STYLE_INLINE ? f : this.type == CKEDITOR.STYLE_BLOCK ? g : this.type == CKEDITOR.STYLE_OBJECT ? b : null).call(this, a)
},
removeFromRange: function(a) {
return (this.removeFromRange =
this.type == CKEDITOR.STYLE_INLINE ? c : this.type == CKEDITOR.STYLE_BLOCK ? k : this.type == CKEDITOR.STYLE_OBJECT ? e : null).call(this, a)
},
applyToObject: function(a) {
t(a, this)
},
checkActive: function(a) {
switch (this.type) {
case CKEDITOR.STYLE_BLOCK:
return this.checkElementRemovable(a.block || a.blockLimit, !0);
case CKEDITOR.STYLE_OBJECT:
case CKEDITOR.STYLE_INLINE:
for (var b = a.elements, c = 0, d; c < b.length; c++)
if (d = b[c], !(this.type == CKEDITOR.STYLE_INLINE && (d == a.block || d == a.blockLimit))) {
if (this.type == CKEDITOR.STYLE_OBJECT) {
var e =
d.getName();
if (!("string" == typeof this.element ? e == this.element : e in this.element)) continue
}
if (this.checkElementRemovable(d, !0)) return !0
}
}
return !1
},
checkApplicable: function(a, b) {
if (b && !b.check(this)) return !1;
switch (this.type) {
case CKEDITOR.STYLE_OBJECT:
return !!a.contains(this.element);
case CKEDITOR.STYLE_BLOCK:
return !!a.blockLimit.getDtd()[this.element]
}
return !0
},
checkElementMatch: function(a, b) {
var c = this._.definition;
if (!a || !c.ignoreReadonly && a.isReadOnly()) return !1;
var d = a.getName();
if ("string" ==
typeof this.element ? d == this.element : d in this.element) {
if (!b && !a.hasAttributes()) return !0;
if (d = c._AC) c = d;
else {
var d = {},
e = 0,
h = c.attributes;
if (h)
for (var g in h) e++, d[g] = h[g];
if (g = CKEDITOR.style.getStyleText(c)) d.style || e++, d.style = g;
d._length = e;
c = c._AC = d
}
if (c._length) {
for (var k in c)
if ("_length" != k) {
e = a.getAttribute(k) || "";
if ("style" == k) a: {
d = c[k];
"string" == typeof d && (d = CKEDITOR.tools.parseCssText(d));
"string" == typeof e && (e = CKEDITOR.tools.parseCssText(e, !0));
g = void 0;
for (g in d)
if (!(g in e && (e[g] == d[g] ||
"inherit" == d[g] || "inherit" == e[g]))) {
d = !1;
break a
}
d = !0
} else d = c[k] == e;
if (d) {
if (!b) return !0
} else if (b) return !1
}
if (b) return !0
} else return !0
}
return !1
},
checkElementRemovable: function(a, b) {
if (this.checkElementMatch(a, b)) return !0;
var c = y(this)[a.getName()];
if (c) {
var d;
if (!(c = c.attributes)) return !0;
for (var e = 0; e < c.length; e++)
if (d = c[e][0], d = a.getAttribute(d)) {
var h = c[e][1];
if (null === h || "string" == typeof h && d == h || h.test(d)) return !0
}
}
return !1
},
buildPreview: function(a) {
var b = this._.definition,
c = [],
d = b.element;
"bdo" == d && (d = "span");
var c = ["<", d],
e = b.attributes;
if (e)
for (var h in e) c.push(" ", h, '="', e[h], '"');
(e = CKEDITOR.style.getStyleText(b)) && c.push(' style="', e, '"');
c.push(">", a || b.name, "</", d, ">");
return c.join("")
},
getDefinition: function() {
return this._.definition
}
};
CKEDITOR.style.getStyleText = function(a) {
var b = a._ST;
if (b) return b;
var b = a.styles,
c = a.attributes && a.attributes.style || "",
d = "";
c.length && (c = c.replace(G, ";"));
for (var e in b) {
var h = b[e],
g = (e + ":" + h).replace(G, ";");
"inherit" == h ? d += g : c += g
}
c.length &&
(c = CKEDITOR.tools.normalizeCssText(c, !0));
return a._ST = c + d
};
var M = CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED,
F = CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED
}(), CKEDITOR.styleCommand = function(d, f) {
this.requiredContent = this.allowedContent = this.style = d;
CKEDITOR.tools.extend(this, f, !0)
}, CKEDITOR.styleCommand.prototype.exec = function(d) {
d.focus();
this.state == CKEDITOR.TRISTATE_OFF ? d.applyStyle(this.style) : this.state == CKEDITOR.TRISTATE_ON &&
d.removeStyle(this.style)
}, CKEDITOR.stylesSet = new CKEDITOR.resourceManager("", "stylesSet"), CKEDITOR.addStylesSet = CKEDITOR.tools.bind(CKEDITOR.stylesSet.add, CKEDITOR.stylesSet), CKEDITOR.loadStylesSet = function(d, f, c) {
CKEDITOR.stylesSet.addExternal(d, f, "");
CKEDITOR.stylesSet.load(d, c)
}, CKEDITOR.editor.prototype.getStylesSet = function(d) {
if (this._.stylesDefinitions) d(this._.stylesDefinitions);
else {
var f = this,
c = f.config.stylesCombo_stylesSet || f.config.stylesSet;
if (!1 === c) d(null);
else if (c instanceof Array) f._.stylesDefinitions =
c, d(c);
else {
c || (c = "default");
var c = c.split(":"),
a = c[0];
CKEDITOR.stylesSet.addExternal(a, c[1] ? c.slice(1).join(":") : CKEDITOR.getUrl("styles.js"), "");
CKEDITOR.stylesSet.load(a, function(b) {
f._.stylesDefinitions = b[a];
d(f._.stylesDefinitions)
})
}
}
}, CKEDITOR.dom.comment = function(d, f) {
"string" == typeof d && (d = (f ? f.$ : document).createComment(d));
CKEDITOR.dom.domObject.call(this, d)
}, CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node, CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype, {
type: CKEDITOR.NODE_COMMENT,
getOuterHtml: function() {
return "\x3c!--" + this.$.nodeValue + "--\x3e"
}
}), "use strict",
function() {
var d = {},
f = {},
c;
for (c in CKEDITOR.dtd.$blockLimit) c in CKEDITOR.dtd.$list || (d[c] = 1);
for (c in CKEDITOR.dtd.$block) c in CKEDITOR.dtd.$blockLimit || c in CKEDITOR.dtd.$empty || (f[c] = 1);
CKEDITOR.dom.elementPath = function(a, b) {
var c = null,
g = null,
k = [],
h = a,
l;
b = b || a.getDocument().getBody();
do
if (h.type == CKEDITOR.NODE_ELEMENT) {
k.push(h);
if (!this.lastElement && (this.lastElement = h, h.is(CKEDITOR.dtd.$object) || "false" == h.getAttribute("contenteditable"))) continue;
if (h.equals(b)) break;
if (!g && (l = h.getName(), "true" == h.getAttribute("contenteditable") ? g = h : !c && f[l] && (c = h), d[l])) {
var n;
if (n = !c) {
if (l = "div" == l) {
a: {
l = h.getChildren();
n = 0;
for (var q = l.count(); n < q; n++) {
var r = l.getItem(n);
if (r.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[r.getName()]) {
l = !0;
break a
}
}
l = !1
}
l = !l
}
n = l
}
n ? c = h : g = h
}
}
while (h = h.getParent());
g || (g = b);
this.block = c;
this.blockLimit = g;
this.root = b;
this.elements = k
}
}(), CKEDITOR.dom.elementPath.prototype = {
compare: function(d) {
var f = this.elements;
d = d && d.elements;
if (!d || f.length != d.length) return !1;
for (var c = 0; c < f.length; c++)
if (!f[c].equals(d[c])) return !1;
return !0
},
contains: function(d, f, c) {
var a;
"string" == typeof d && (a = function(a) {
return a.getName() == d
});
d instanceof CKEDITOR.dom.element ? a = function(a) {
return a.equals(d)
} : CKEDITOR.tools.isArray(d) ? a = function(a) {
return -1 < CKEDITOR.tools.indexOf(d, a.getName())
} : "function" == typeof d ? a = d : "object" == typeof d && (a = function(a) {
return a.getName() in d
});
var b = this.elements,
e = b.length;
f && e--;
c && (b = Array.prototype.slice.call(b,
0), b.reverse());
for (f = 0; f < e; f++)
if (a(b[f])) return b[f];
return null
},
isContextFor: function(d) {
var f;
return d in CKEDITOR.dtd.$block ? (f = this.contains(CKEDITOR.dtd.$intermediate) || this.root.equals(this.block) && this.block || this.blockLimit, !!f.getDtd()[d]) : !0
},
direction: function() {
return (this.block || this.blockLimit || this.root).getDirection(1)
}
}, CKEDITOR.dom.text = function(d, f) {
"string" == typeof d && (d = (f ? f.$ : document).createTextNode(d));
this.$ = d
}, CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node, CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype, {
type: CKEDITOR.NODE_TEXT,
getLength: function() {
return this.$.nodeValue.length
},
getText: function() {
return this.$.nodeValue
},
setText: function(d) {
this.$.nodeValue = d
},
split: function(d) {
var f = this.$.parentNode,
c = f.childNodes.length,
a = this.getLength(),
b = this.getDocument(),
e = new CKEDITOR.dom.text(this.$.splitText(d), b);
f.childNodes.length == c && (d >= a ? (e = b.createText(""), e.insertAfter(this)) : (d = b.createText(""), d.insertAfter(e), d.remove()));
return e
},
substring: function(d, f) {
return "number" != typeof f ? this.$.nodeValue.substr(d) :
this.$.nodeValue.substring(d, f)
}
}),
function() {
function d(c, a, b) {
var d = c.serializable,
g = a[b ? "endContainer" : "startContainer"],
k = b ? "endOffset" : "startOffset",
h = d ? a.document.getById(c.startNode) : c.startNode;
c = d ? a.document.getById(c.endNode) : c.endNode;
g.equals(h.getPrevious()) ? (a.startOffset = a.startOffset - g.getLength() - c.getPrevious().getLength(), g = c.getNext()) : g.equals(c.getPrevious()) && (a.startOffset -= g.getLength(), g = c.getNext());
g.equals(h.getParent()) && a[k] ++;
g.equals(c.getParent()) && a[k] ++;
a[b ? "endContainer" :
"startContainer"] = g;
return a
}
CKEDITOR.dom.rangeList = function(c) {
if (c instanceof CKEDITOR.dom.rangeList) return c;
c ? c instanceof CKEDITOR.dom.range && (c = [c]) : c = [];
return CKEDITOR.tools.extend(c, f)
};
var f = {
createIterator: function() {
var c = this,
a = CKEDITOR.dom.walker.bookmark(),
b = [],
d;
return {
getNextRange: function(g) {
d = void 0 == d ? 0 : d + 1;
var k = c[d];
if (k && 1 < c.length) {
if (!d)
for (var h = c.length - 1; 0 <= h; h--) b.unshift(c[h].createBookmark(!0));
if (g)
for (var l = 0; c[d + l + 1];) {
var f = k.document;
g = 0;
h = f.getById(b[l].endNode);
for (f = f.getById(b[l + 1].startNode);;) {
h = h.getNextSourceNode(!1);
if (f.equals(h)) g = 1;
else if (a(h) || h.type == CKEDITOR.NODE_ELEMENT && h.isBlockBoundary()) continue;
break
}
if (!g) break;
l++
}
for (k.moveToBookmark(b.shift()); l--;) h = c[++d], h.moveToBookmark(b.shift()), k.setEnd(h.endContainer, h.endOffset)
}
return k
}
}
},
createBookmarks: function(c) {
for (var a = [], b, e = 0; e < this.length; e++) {
a.push(b = this[e].createBookmark(c, !0));
for (var g = e + 1; g < this.length; g++) this[g] = d(b, this[g]), this[g] = d(b, this[g], !0)
}
return a
},
createBookmarks2: function(c) {
for (var a = [], b = 0; b < this.length; b++) a.push(this[b].createBookmark2(c));
return a
},
moveToBookmarks: function(c) {
for (var a = 0; a < this.length; a++) this[a].moveToBookmark(c[a])
}
}
}(),
function() {
function d() {
return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1] || "skins/" + CKEDITOR.skinName.split(",")[0] + "/")
}
function f(a) {
var b = CKEDITOR.skin["ua_" + a],
c = CKEDITOR.env;
if (b)
for (var b = b.split(",").sort(function(a, b) {
return a > b ? -1 : 1
}), e = 0, h; e < b.length; e++) {
h = b[e];
if (c.ie && (h.replace(/^ie/, "") == c.version || c.quirks && "iequirks" ==
h)) h = "ie";
if (c[h]) {
a += "_" + b[e];
break
}
}
return CKEDITOR.getUrl(d() + a + ".css")
}
function c(a, b) {
e[a] || (CKEDITOR.document.appendStyleSheet(f(a)), e[a] = 1);
b && b()
}
function a(a) {
var b = a.getById(g);
b || (b = a.getHead().append("style"), b.setAttribute("id", g), b.setAttribute("type", "text/css"));
return b
}
function b(a, b, c) {
var d, e, h;
if (CKEDITOR.env.webkit) {
b = b.split("}").slice(0, -1);
for (e = 0; e < b.length; e++) b[e] = b[e].split("{")
}
for (var g = 0; g < a.length; g++)
if (CKEDITOR.env.webkit)
for (e = 0; e < b.length; e++) {
h = b[e][1];
for (d =
0; d < c.length; d++) h = h.replace(c[d][0], c[d][1]);
a[g].$.sheet.addRule(b[e][0], h)
} else {
h = b;
for (d = 0; d < c.length; d++) h = h.replace(c[d][0], c[d][1]);
CKEDITOR.env.ie && 11 > CKEDITOR.env.version ? a[g].$.styleSheet.cssText += h : a[g].$.innerHTML += h
}
}
var e = {};
CKEDITOR.skin = {
path: d,
loadPart: function(a, b) {
CKEDITOR.skin.name != CKEDITOR.skinName.split(",")[0] ? CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(d() + "skin.js"), function() {
c(a, b)
}) : c(a, b)
},
getPath: function(a) {
return CKEDITOR.getUrl(f(a))
},
icons: {},
addIcon: function(a, b,
c, d) {
a = a.toLowerCase();
this.icons[a] || (this.icons[a] = {
path: b,
offset: c || 0,
bgsize: d || "16px"
})
},
getIconStyle: function() {
return ""
}
};
CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
getUiColor: function() {
return this.uiColor
},
setUiColor: function(c) {
var d = a(CKEDITOR.document);
return (this.setUiColor = function(a) {
var c = CKEDITOR.skin.chameleon,
e = [
[h, a]
];
this.uiColor = a;
b([d], c(this, "editor"), e);
b(k, c(this, "panel"), e)
}).call(this, c)
}
});
var g = "cke_ui_color",
k = [],
h = /\$color/g;
CKEDITOR.on("instanceLoaded", function(c) {
if (!CKEDITOR.env.ie ||
!CKEDITOR.env.quirks) {
var d = c.editor;
c = function(c) {
c = (c.data[0] || c.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();
if (!c.getById("cke_ui_color")) {
c = a(c);
k.push(c);
var e = d.getUiColor();
e && b([c], CKEDITOR.skin.chameleon(d, "panel"), [
[h, e]
])
}
};
d.on("panelShow", c);
d.on("menuShow", c);
d.config.uiColor && d.setUiColor(d.config.uiColor)
}
})
}(),
function() {
if (CKEDITOR.env.webkit) CKEDITOR.env.hc = !1;
else {
var d = CKEDITOR.dom.element.createFromHtml('<div style="width:0px;height:0px;position:absolute;left:-10000px;border: 1px solid;border-color: red blue;"></div>',
CKEDITOR.document);
d.appendTo(CKEDITOR.document.getHead());
try {
CKEDITOR.env.hc = d.getComputedStyle("border-top-color") == d.getComputedStyle("border-right-color")
} catch (f) {
CKEDITOR.env.hc = !1
}
d.remove()
}
CKEDITOR.env.hc && (CKEDITOR.env.cssClass += " cke_hc");
CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");
CKEDITOR.status = "loaded";
CKEDITOR.fireOnce("loaded");
if (d = CKEDITOR._.pending) {
delete CKEDITOR._.pending;
for (var c = 0; c < d.length; c++) CKEDITOR.editor.prototype.constructor.apply(d[c][0], d[c][1]),
CKEDITOR.add(d[c][0])
}
}(), CKEDITOR.skin.name = "sqsBlack", CKEDITOR.skin.chameleon = function(d, f) {
var c = "",
a = "." + d.id;
switch (d.config.uiColor) {
case "Light":
"editor" == f && (c = c + (a + ".cke_ltr .cke_button__undo_icon{background-image: url(/universal/images-v6/damask/wysiwyg/undo-dark-v2.png) !important;background-position: center !important;}") + (a + ".cke_ltr .cke_button__redo_icon{background-image: url(/universal/images-v6/damask/wysiwyg/redo-dark-v2.png) !important;background-position: center !important;}") +
(a + ".cke_ltr .cke_button__bold_icon{background-image: url(/universal/images-v6/damask/wysiwyg/bold-dark-v2.png) !important;background-position: center !important;}") + (a + ".cke_ltr .cke_button__italic_icon{background-image: url(/universal/images-v6/damask/wysiwyg/italic-dark-v2.png) !important;background-position: center !important;}") + (a + ".cke_ltr .cke_button__sqslink_icon{background-image: url(/universal/images-v6/damask/wysiwyg/link-dark-v2.png) !important;background-position: center !important;}") +
(a + ".cke_ltr .cke_button__blockquote_icon{background-image: url(/universal/images-v6/damask/wysiwyg/quote-dark-v2.png) !important;background-position: center !important;}") + (a + ".cke_ltr .cke_button__numberedlist_icon{background-image: url(/universal/images-v6/damask/wysiwyg/ol-dark-v2.png) !important;background-position: center !important;}") + (a + ".cke_ltr .cke_button__bulletedlist_icon{background-image: url(/universal/images-v6/damask/wysiwyg/ul-dark-v2.png) !important;background-position: center !important;}") +
(a + ".cke_ltr .cke_button__outdent_icon{background-image: url(/universal/images-v6/damask/wysiwyg/indent-more-dark-v2.png) !important;background-position: center !important;}") + (a + ".cke_ltr .cke_button__indent_icon{background-image: url(/universal/images-v6/damask/wysiwyg/indent-less-dark-v2.png) !important;background-position: center !important;}") + (a + ".cke_ltr .cke_button__pastetext_icon{background-image: url(/universal/images-v6/damask/wysiwyg/paste-plain-dark-v2.png) !important;background-position: center !important;}") +
(a + ".cke_ltr .cke_button__removeformat_icon{background-image: url(/universal/images-v6/damask/wysiwyg/remove-formatting-dark-v2.png) !important;background-position: center !important;}") + (a + ".cke_ltr .cke_button__maximize_icon{background-image: url(/universal/images-v6/damask/wysiwyg/full-screen-dark-v2.png) !important;background-position: center !important;height: 33px;width: 33px;}") + (a + ".cke_ltr .cke_toolbar_separator, .cke_ltr .cke_combo{border-left-color: #d2d2d2;border-right-color: #d2d2d2;}") +
(a + ".cke_ltr .cke_combo_arrow{background-image: url(/universal/images-v6/damask/chevron-down-dark-v2.png) !important;}") + (a + ".cke_ltr .cke_button_on{background-color: #dadada}"))
}
return c
}, CKEDITOR.plugins.add("basicstyles", {
init: function(d) {
var f = 0,
c = function(b, c, e, l) {
if (l) {
l = new CKEDITOR.style(l);
var n = a[e];
n.unshift(l);
d.attachStyleStateChange(l, function(a) {
!d.readOnly && d.getCommand(e).setState(a)
});
d.addCommand(e, new CKEDITOR.styleCommand(l, {
contentForms: n
}));
d.ui.addButton && d.ui.addButton(b, {
label: c,
command: e,
toolbar: "basicstyles," + (f += 10)
})
}
},
a = {
bold: ["strong", "b", ["span", function(a) {
a = a.styles["font-weight"];
return "bold" == a || 700 <= +a
}]],
italic: ["em", "i", ["span", function(a) {
return "italic" == a.styles["font-style"]
}]],
underline: ["u", ["span", function(a) {
return "underline" == a.styles["text-decoration"]
}]],
strike: ["s", "strike", ["span", function(a) {
return "line-through" == a.styles["text-decoration"]
}]],
subscript: ["sub"],
superscript: ["sup"]
},
b = d.config,
e = d.lang.basicstyles;
c("Bold", e.bold, "bold",
b.coreStyles_bold);
c("Italic", e.italic, "italic", b.coreStyles_italic);
c("Underline", e.underline, "underline", b.coreStyles_underline);
c("Strike", e.strike, "strike", b.coreStyles_strike);
c("Subscript", e.subscript, "subscript", b.coreStyles_subscript);
c("Superscript", e.superscript, "superscript", b.coreStyles_superscript);
d.setKeystroke([
[CKEDITOR.CTRL + 66, "bold"],
[CKEDITOR.CTRL + 73, "italic"],
[CKEDITOR.CTRL + 85, "underline"]
])
}
}), CKEDITOR.config.coreStyles_bold = {
element: "strong",
overrides: "b"
}, CKEDITOR.config.coreStyles_italic = {
element: "em",
overrides: "i"
}, CKEDITOR.config.coreStyles_underline = {
element: "u"
}, CKEDITOR.config.coreStyles_strike = {
element: "s",
overrides: "strike"
}, CKEDITOR.config.coreStyles_subscript = {
element: "sub"
}, CKEDITOR.config.coreStyles_superscript = {
element: "sup"
},
function() {
var d = {
exec: function(d) {
var c = d.getCommand("blockquote").state,
a = d.getSelection(),
b = a && a.getRanges()[0];
if (b) {
var e = a.createBookmarks();
if (CKEDITOR.env.ie) {
var g = e[0].startNode,
k = e[0].endNode,
h;
if (g && "blockquote" == g.getParent().getName())
for (h =
g; h = h.getNext();)
if (h.type == CKEDITOR.NODE_ELEMENT && h.isBlockBoundary()) {
g.move(h, !0);
break
}
if (k && "blockquote" == k.getParent().getName())
for (h = k; h = h.getPrevious();)
if (h.type == CKEDITOR.NODE_ELEMENT && h.isBlockBoundary()) {
k.move(h);
break
}
}
var l = b.createIterator();
l.enlargeBr = d.config.enterMode != CKEDITOR.ENTER_BR;
if (c == CKEDITOR.TRISTATE_OFF) {
for (g = []; c = l.getNextParagraph();) g.push(c);
1 > g.length && (c = d.document.createElement(d.config.enterMode == CKEDITOR.ENTER_P ? "p" : "div"), k = e.shift(), b.insertNode(c), c.append(new CKEDITOR.dom.text("\ufeff",
d.document)), b.moveToBookmark(k), b.selectNodeContents(c), b.collapse(!0), k = b.createBookmark(), g.push(c), e.unshift(k));
h = g[0].getParent();
b = [];
for (k = 0; k < g.length; k++) c = g[k], h = h.getCommonAncestor(c.getParent());
for (c = {
table: 1,
tbody: 1,
tr: 1,
ol: 1,
ul: 1
}; c[h.getName()];) h = h.getParent();
for (k = null; 0 < g.length;) {
for (c = g.shift(); !c.getParent().equals(h);) c = c.getParent();
c.equals(k) || b.push(c);
k = c
}
for (; 0 < b.length;)
if (c = b.shift(), "blockquote" == c.getName()) {
for (k = new CKEDITOR.dom.documentFragment(d.document); c.getFirst();) k.append(c.getFirst().remove()),
g.push(k.getLast());
k.replace(c)
} else g.push(c);
b = d.document.createElement("blockquote");
for (b.insertBefore(g[0]); 0 < g.length;) c = g.shift(), b.append(c)
} else if (c == CKEDITOR.TRISTATE_ON) {
k = [];
for (h = {}; c = l.getNextParagraph();) {
for (g = b = null; c.getParent();) {
if ("blockquote" == c.getParent().getName()) {
b = c.getParent();
g = c;
break
}
c = c.getParent()
}
b && (g && !g.getCustomData("blockquote_moveout")) && (k.push(g), CKEDITOR.dom.element.setMarker(h, g, "blockquote_moveout", !0))
}
CKEDITOR.dom.element.clearAllMarkers(h);
c = [];
g = [];
for (h = {}; 0 < k.length;) l = k.shift(), b = l.getParent(), l.getPrevious() ? l.getNext() ? (l.breakParent(l.getParent()), g.push(l.getNext())) : l.remove().insertAfter(b) : l.remove().insertBefore(b), b.getCustomData("blockquote_processed") || (g.push(b), CKEDITOR.dom.element.setMarker(h, b, "blockquote_processed", !0)), c.push(l);
CKEDITOR.dom.element.clearAllMarkers(h);
for (k = g.length - 1; 0 <= k; k--) {
b = g[k];
a: {
h = b;
for (var l = 0, n = h.getChildCount(), q = void 0; l < n && (q = h.getChild(l)); l++)
if (q.type == CKEDITOR.NODE_ELEMENT && q.isBlockBoundary()) {
h = !1;
break a
}
h = !0
}
h && b.remove()
}
if (d.config.enterMode == CKEDITOR.ENTER_BR)
for (b = !0; c.length;)
if (l = c.shift(), "div" == l.getName()) {
k = new CKEDITOR.dom.documentFragment(d.document);
b && l.getPrevious() && !(l.getPrevious().type == CKEDITOR.NODE_ELEMENT && l.getPrevious().isBlockBoundary()) && k.append(d.document.createElement("br"));
for (b = l.getNext() && !(l.getNext().type == CKEDITOR.NODE_ELEMENT && l.getNext().isBlockBoundary()); l.getFirst();) l.getFirst().remove().appendTo(k);
b && k.append(d.document.createElement("br"));
k.replace(l);
b = !1
}
}
a.selectBookmarks(e);
d.focus()
}
},
refresh: function(d, c) {
this.setState(d.elementPath(c.block || c.blockLimit).contains("blockquote", 1) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
},
context: "blockquote",
allowedContent: "blockquote",
requiredContent: "blockquote"
};
CKEDITOR.plugins.add("blockquote", {
init: function(f) {
f.blockless || (f.addCommand("blockquote", d), f.ui.addButton && f.ui.addButton("Blockquote", {
label: f.lang.blockquote.toolbar,
command: "blockquote",
toolbar: "blocks,10"
}))
}
})
}(), CKEDITOR.plugins.add("dialogui", {
onLoad: function() {
var d = function(a) {
this._ || (this._ = {});
this._["default"] = this._.initValue = a["default"] || "";
this._.required = a.required || !1;
for (var b = [this._], c = 1; c < arguments.length; c++) b.push(arguments[c]);
b.push(!0);
CKEDITOR.tools.extend.apply(CKEDITOR.tools, b);
return this._
},
f = {
build: function(a, b, c) {
return new CKEDITOR.ui.dialog.textInput(a, b, c)
}
},
c = {
build: function(a, b, c) {
return new CKEDITOR.ui.dialog[b.type](a, b, c)
}
},
a = {
isChanged: function() {
return this.getValue() != this.getInitValue()
},
reset: function(a) {
this.setValue(this.getInitValue(),
a)
},
setInitValue: function() {
this._.initValue = this.getValue()
},
resetInitValue: function() {
this._.initValue = this._["default"]
},
getInitValue: function() {
return this._.initValue
}
},
b = CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
onChange: function(a, b) {
this._.domOnChangeRegistered || (a.on("load", function() {
this.getInputElement().on("change", function() {
a.parts.dialog.isVisible() && this.fire("change", {
value: this.getValue()
})
}, this)
}, this), this._.domOnChangeRegistered = !0);
this.on("change",
b)
}
}, !0),
e = /^on([A-Z]\w+)/,
g = function(a) {
for (var b in a)(e.test(b) || "title" == b || "type" == b) && delete a[b];
return a
};
CKEDITOR.tools.extend(CKEDITOR.ui.dialog, {
labeledElement: function(a, b, c, e) {
if (!(4 > arguments.length)) {
var g = d.call(this, b);
g.labelId = CKEDITOR.tools.getNextId() + "_label";
this._.children = [];
CKEDITOR.ui.dialog.uiElement.call(this, a, b, c, "div", null, {
role: "presentation"
}, function() {
var c = [],
d = b.required ? " cke_required" : "";
"horizontal" != b.labelLayout ? c.push('<label class="cke_dialog_ui_labeled_label' +
d + '" ', ' id="' + g.labelId + '"', g.inputId ? ' for="' + g.inputId + '"' : "", (b.labelStyle ? ' style="' + b.labelStyle + '"' : "") + ">", b.label, "</label>", '<div class="cke_dialog_ui_labeled_content"', b.controlStyle ? ' style="' + b.controlStyle + '"' : "", ' role="radiogroup" aria-labelledby="' + g.labelId + '">', e.call(this, a, b), "</div>") : (d = {
type: "hbox",
widths: b.widths,
padding: 0,
children: [{
type: "html",
html: '<label class="cke_dialog_ui_labeled_label' + d + '" id="' + g.labelId + '" for="' + g.inputId + '"' + (b.labelStyle ? ' style="' + b.labelStyle +
'"' : "") + ">" + CKEDITOR.tools.htmlEncode(b.label) + "</span>"
}, {
type: "html",
html: '<span class="cke_dialog_ui_labeled_content"' + (b.controlStyle ? ' style="' + b.controlStyle + '"' : "") + ">" + e.call(this, a, b) + "</span>"
}]
}, CKEDITOR.dialog._.uiElementBuilders.hbox.build(a, d, c));
return c.join("")
})
}
},
textInput: function(a, b, c) {
if (!(3 > arguments.length)) {
d.call(this, b);
var e = this._.inputId = CKEDITOR.tools.getNextId() + "_textInput",
g = {
"class": "cke_dialog_ui_input_" + b.type,
id: e,
type: b.type
};
b.validate && (this.validate = b.validate);
b.maxLength && (g.maxlength = b.maxLength);
b.size && (g.size = b.size);
b.inputStyle && (g.style = b.inputStyle);
var f = this,
u = !1;
a.on("load", function() {
f.getInputElement().on("keydown", function(a) {
13 == a.data.getKeystroke() && (u = !0)
});
f.getInputElement().on("keyup", function(b) {
13 == b.data.getKeystroke() && u && (a.getButton("ok") && setTimeout(function() {
a.getButton("ok").click()
}, 0), u = !1)
}, null, null, 1E3)
});
CKEDITOR.ui.dialog.labeledElement.call(this, a, b, c, function() {
var a = ['<div class="cke_dialog_ui_input_', b.type, '" role="presentation"'];
b.width && a.push('style="width:' + b.width + '" ');
a.push("><input ");
g["aria-labelledby"] = this._.labelId;
this._.required && (g["aria-required"] = this._.required);
for (var c in g) a.push(c + '="' + g[c] + '" ');
a.push(" /></div>");
return a.join("")
})
}
},
textarea: function(a, b, c) {
if (!(3 > arguments.length)) {
d.call(this, b);
var e = this,
g = this._.inputId = CKEDITOR.tools.getNextId() + "_textarea",
f = {};
b.validate && (this.validate = b.validate);
f.rows = b.rows || 5;
f.cols = b.cols || 20;
f["class"] = "cke_dialog_ui_input_textarea " + (b["class"] ||
"");
"undefined" != typeof b.inputStyle && (f.style = b.inputStyle);
b.dir && (f.dir = b.dir);
CKEDITOR.ui.dialog.labeledElement.call(this, a, b, c, function() {
f["aria-labelledby"] = this._.labelId;
this._.required && (f["aria-required"] = this._.required);
var a = ['<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea id="', g, '" '],
b;
for (b in f) a.push(b + '="' + CKEDITOR.tools.htmlEncode(f[b]) + '" ');
a.push(">", CKEDITOR.tools.htmlEncode(e._["default"]), "</textarea></div>");
return a.join("")
})
}
},
checkbox: function(a,
b, c) {
if (!(3 > arguments.length)) {
var e = d.call(this, b, {
"default": !!b["default"]
});
b.validate && (this.validate = b.validate);
CKEDITOR.ui.dialog.uiElement.call(this, a, b, c, "span", null, null, function() {
var c = CKEDITOR.tools.extend({}, b, {
id: b.id ? b.id + "_checkbox" : CKEDITOR.tools.getNextId() + "_checkbox"
}, !0),
d = [],
f = CKEDITOR.tools.getNextId() + "_label",
l = {
"class": "cke_dialog_ui_checkbox_input",
type: "checkbox",
"aria-labelledby": f
};
g(c);
b["default"] && (l.checked = "checked");
"undefined" != typeof c.inputStyle && (c.style = c.inputStyle);
e.checkbox = new CKEDITOR.ui.dialog.uiElement(a, c, d, "input", null, l);
d.push(' <label id="', f, '" for="', l.id, '"' + (b.labelStyle ? ' style="' + b.labelStyle + '"' : "") + ">", CKEDITOR.tools.htmlEncode(b.label), "</label>");
return d.join("")
})
}
},
radio: function(a, b, c) {
if (!(3 > arguments.length)) {
d.call(this, b);
this._["default"] || (this._["default"] = this._.initValue = b.items[0][1]);
b.validate && (this.validate = b.valdiate);
var e = [],
f = this;
CKEDITOR.ui.dialog.labeledElement.call(this, a, b, c, function() {
for (var c = [], d = [], l = (b.id ?
b.id : CKEDITOR.tools.getNextId()) + "_radio", p = 0; p < b.items.length; p++) {
var w = b.items[p],
t = void 0 !== w[2] ? w[2] : w[0],
x = void 0 !== w[1] ? w[1] : w[0],
y = CKEDITOR.tools.getNextId() + "_radio_input",
z = y + "_label",
y = CKEDITOR.tools.extend({}, b, {
id: y,
title: null,
type: null
}, !0),
t = CKEDITOR.tools.extend({}, y, {
title: t
}, !0),
C = {
type: "radio",
"class": "cke_dialog_ui_radio_input",
name: l,
value: x,
"aria-labelledby": z
},
s = [];
f._["default"] == x && (C.checked = "checked");
g(y);
g(t);
"undefined" != typeof y.inputStyle && (y.style = y.inputStyle);
y.keyboardFocusable = !0;
e.push(new CKEDITOR.ui.dialog.uiElement(a, y, s, "input", null, C));
s.push(" ");
new CKEDITOR.ui.dialog.uiElement(a, t, s, "label", null, {
id: z,
"for": C.id
}, w[0]);
c.push(s.join(""))
}
new CKEDITOR.ui.dialog.hbox(a, e, c, d);
return d.join("")
});
this._.children = e
}
},
button: function(a, b, c) {
if (arguments.length) {
"function" == typeof b && (b = b(a.getParentEditor()));
d.call(this, b, {
disabled: b.disabled || !1
});
CKEDITOR.event.implementOn(this);
var e = this;
a.on("load", function() {
var a = this.getElement();
(function() {
a.on("click", function(a) {
e.click();
a.data.preventDefault()
});
a.on("keydown", function(a) {
a.data.getKeystroke() in {
32: 1
} && (e.click(), a.data.preventDefault())
})
})();
a.unselectable()
}, this);
var g = CKEDITOR.tools.extend({}, b);
delete g.style;
var f = CKEDITOR.tools.getNextId() + "_label";
CKEDITOR.ui.dialog.uiElement.call(this, a, g, c, "a", null, {
style: b.style,
href: "javascript:void(0)",
title: b.label,
hidefocus: "true",
"class": b["class"],
role: "button",
"aria-labelledby": f
}, '<span id="' + f + '" class="cke_dialog_ui_button">' + CKEDITOR.tools.htmlEncode(b.label) +
"</span>")
}
},
select: function(a, b, c) {
if (!(3 > arguments.length)) {
var e = d.call(this, b);
b.validate && (this.validate = b.validate);
e.inputId = CKEDITOR.tools.getNextId() + "_select";
CKEDITOR.ui.dialog.labeledElement.call(this, a, b, c, function() {
var c = CKEDITOR.tools.extend({}, b, {
id: b.id ? b.id + "_select" : CKEDITOR.tools.getNextId() + "_select"
}, !0),
d = [],
f = [],
l = {
id: e.inputId,
"class": "cke_dialog_ui_input_select",
"aria-labelledby": this._.labelId
};
d.push('<div class="cke_dialog_ui_input_', b.type, '" role="presentation"');
b.width &&
d.push('style="width:' + b.width + '" ');
d.push(">");
void 0 != b.size && (l.size = b.size);
void 0 != b.multiple && (l.multiple = b.multiple);
g(c);
for (var p = 0, w; p < b.items.length && (w = b.items[p]); p++) f.push('<option value="', CKEDITOR.tools.htmlEncode(void 0 !== w[1] ? w[1] : w[0]).replace(/"/g, "&quot;"), '" /> ', CKEDITOR.tools.htmlEncode(w[0]));
"undefined" != typeof c.inputStyle && (c.style = c.inputStyle);
e.select = new CKEDITOR.ui.dialog.uiElement(a, c, d, "select", null, l, f.join(""));
d.push("</div>");
return d.join("")
})
}
},
file: function(a,
b, c) {
if (!(3 > arguments.length)) {
void 0 === b["default"] && (b["default"] = "");
var e = CKEDITOR.tools.extend(d.call(this, b), {
definition: b,
buttons: []
});
b.validate && (this.validate = b.validate);
a.on("load", function() {
CKEDITOR.document.getById(e.frameId).getParent().addClass("cke_dialog_ui_input_file")
});
CKEDITOR.ui.dialog.labeledElement.call(this, a, b, c, function() {
e.frameId = CKEDITOR.tools.getNextId() + "_fileInput";
var a = ['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" role="presentation" id="',
e.frameId, '" title="', b.label, '" src="javascript:void('
];
a.push(CKEDITOR.env.ie ? "(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "})()" : "0");
a.push(')"></iframe>');
return a.join("")
})
}
},
fileButton: function(a, b, c) {
if (!(3 > arguments.length)) {
d.call(this, b);
var e = this;
b.validate && (this.validate = b.validate);
var g = CKEDITOR.tools.extend({}, b),
f = g.onClick;
g.className = (g.className ? g.className + " " : "") + "cke_dialog_ui_button";
g.onClick = function(c) {
var d =
b["for"];
if (!f || !1 !== f.call(this, c)) a.getContentElement(d[0], d[1]).submit(), this.disable()
};
a.on("load", function() {
a.getContentElement(b["for"][0], b["for"][1])._.buttons.push(e)
});
CKEDITOR.ui.dialog.button.call(this, a, g, c)
}
},
html: function() {
var a = /^\s*<[\w:]+\s+([^>]*)?>/,
b = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,
c = /\/$/;
return function(d, e, g) {
if (!(3 > arguments.length)) {
var f = [],
m = e.html;
"<" != m.charAt(0) && (m = "<span>" + m + "</span>");
var p = e.focus;
if (p) {
var w = this.focus;
this.focus = function() {
("function" ==
typeof p ? p : w).call(this);
this.fire("focus")
};
e.isFocusable && (this.isFocusable = this.isFocusable);
this.keyboardFocusable = !0
}
CKEDITOR.ui.dialog.uiElement.call(this, d, e, f, "span", null, null, "");
f = f.join("").match(a);
m = m.match(b) || ["", "", ""];
c.test(m[1]) && (m[1] = m[1].slice(0, -1), m[2] = "/" + m[2]);
g.push([m[1], " ", f[1] || "", m[2]].join(""))
}
}
}(),
fieldset: function(a, b, c, d, e) {
var g = e.label;
this._ = {
children: b
};
CKEDITOR.ui.dialog.uiElement.call(this, a, e, d, "fieldset", null, null, function() {
var a = [];
g && a.push("<legend" +
(e.labelStyle ? ' style="' + e.labelStyle + '"' : "") + ">" + g + "</legend>");
for (var b = 0; b < c.length; b++) a.push(c[b]);
return a.join("")
})
}
}, !0);
CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
setLabel: function(a) {
var b = CKEDITOR.document.getById(this._.labelId);
1 > b.getChildCount() ? (new CKEDITOR.dom.text(a, CKEDITOR.document)).appendTo(b) : b.getChild(0).$.nodeValue = a;
return this
},
getLabel: function() {
var a =
CKEDITOR.document.getById(this._.labelId);
return !a || 1 > a.getChildCount() ? "" : a.getChild(0).getText()
},
eventProcessors: b
}, !0);
CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
click: function() {
return !this._.disabled ? this.fire("click", {
dialog: this._.dialog
}) : !1
},
enable: function() {
this._.disabled = !1;
var a = this.getElement();
a && a.removeClass("cke_disabled")
},
disable: function() {
this._.disabled = !0;
this.getElement().addClass("cke_disabled")
},
isVisible: function() {
return this.getElement().getFirst().isVisible()
},
isEnabled: function() {
return !this._.disabled
},
eventProcessors: CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
onClick: function(a, b) {
this.on("click", function() {
b.apply(this, arguments)
})
}
}, !0),
accessKeyUp: function() {
this.click()
},
accessKeyDown: function() {
this.focus()
},
keyboardFocusable: !0
}, !0);
CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
getInputElement: function() {
return CKEDITOR.document.getById(this._.inputId)
},
focus: function() {
var a = this.selectParentTab();
setTimeout(function() {
var b = a.getInputElement();
b && b.$.focus()
}, 0)
},
select: function() {
var a = this.selectParentTab();
setTimeout(function() {
var b = a.getInputElement();
b && (b.$.focus(), b.$.select())
}, 0)
},
accessKeyUp: function() {
this.select()
},
setValue: function(a) {
!a && (a = "");
return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this, arguments)
},
keyboardFocusable: !0
}, a, !0);
CKEDITOR.ui.dialog.textarea.prototype = new CKEDITOR.ui.dialog.textInput;
CKEDITOR.ui.dialog.select.prototype =
CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
getInputElement: function() {
return this._.select.getElement()
},
add: function(a, b, c) {
var d = new CKEDITOR.dom.element("option", this.getDialog().getParentEditor().document),
e = this.getInputElement().$;
d.$.text = a;
d.$.value = void 0 === b || null === b ? a : b;
void 0 === c || null === c ? CKEDITOR.env.ie ? e.add(d.$) : e.add(d.$, null) : e.add(d.$, c);
return this
},
remove: function(a) {
this.getInputElement().$.remove(a);
return this
},
clear: function() {
for (var a = this.getInputElement().$; 0 <
a.length;) a.remove(0);
return this
},
keyboardFocusable: !0
}, a, !0);
CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
getInputElement: function() {
return this._.checkbox.getElement()
},
setValue: function(a, b) {
this.getInputElement().$.checked = a;
!b && this.fire("change", {
value: a
})
},
getValue: function() {
return this.getInputElement().$.checked
},
accessKeyUp: function() {
this.setValue(!this.getValue())
},
eventProcessors: {
onChange: function(a, c) {
if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return b.onChange.apply(this,
arguments);
a.on("load", function() {
var a = this._.checkbox.getElement();
a.on("propertychange", function(b) {
b = b.data.$;
"checked" == b.propertyName && this.fire("change", {
value: a.$.checked
})
}, this)
}, this);
this.on("change", c);
return null
}
},
keyboardFocusable: !0
}, a, !0);
CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
setValue: function(a, b) {
for (var c = this._.children, d, e = 0; e < c.length && (d = c[e]); e++) d.getElement().$.checked = d.getValue() == a;
!b && this.fire("change", {
value: a
})
},
getValue: function() {
for (var a = this._.children, b = 0; b < a.length; b++)
if (a[b].getElement().$.checked) return a[b].getValue();
return null
},
accessKeyUp: function() {
var a = this._.children,
b;
for (b = 0; b < a.length; b++)
if (a[b].getElement().$.checked) {
a[b].getElement().focus();
return
}
a[0].getElement().focus()
},
eventProcessors: {
onChange: function(a, c) {
if (CKEDITOR.env.ie) a.on("load", function() {
for (var a = this._.children, b = this, c = 0; c < a.length; c++) a[c].getElement().on("propertychange", function(a) {
a = a.data.$;
"checked" == a.propertyName &&
this.$.checked && b.fire("change", {
value: this.getAttribute("value")
})
})
}, this), this.on("change", c);
else return b.onChange.apply(this, arguments);
return null
}
}
}, a, !0);
CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, a, {
getInputElement: function() {
var a = CKEDITOR.document.getById(this._.frameId).getFrameDocument();
return 0 < a.$.forms.length ? new CKEDITOR.dom.element(a.$.forms[0].elements[0]) : this.getElement()
},
submit: function() {
this.getInputElement().getParent().$.submit();
return this
},
getAction: function() {
return this.getInputElement().getParent().$.action
},
registerEvents: function(a) {
var b = /^on([A-Z]\w+)/,
c, d = function(a, b, c, d) {
a.on("formLoaded", function() {
a.getInputElement().on(c, d, a)
})
},
e;
for (e in a)
if (c = e.match(b)) this.eventProcessors[e] ? this.eventProcessors[e].call(this, this._.dialog, a[e]) : d(this, this._.dialog, c[1].toLowerCase(), a[e]);
return this
},
reset: function() {
function a() {
c.$.open();
var k = "";
d.size && (k = d.size - (CKEDITOR.env.ie ? 7 : 0));
var t = b.frameId + "_input";
c.$.write(['<html dir="' + m + '" lang="' + p + '"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">', '<form enctype="multipart/form-data" method="POST" dir="' + m + '" lang="' + p + '" action="', CKEDITOR.tools.htmlEncode(d.action), '"><label id="', b.labelId, '" for="', t, '" style="display:none">', CKEDITOR.tools.htmlEncode(d.label), '</label><input id="', t, '" aria-labelledby="', b.labelId, '" type="file" name="', CKEDITOR.tools.htmlEncode(d.id || "cke_upload"), '" size="', CKEDITOR.tools.htmlEncode(0 <
k ? k : ""), '" /></form></body></html><script>', CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "", "window.parent.CKEDITOR.tools.callFunction(" + g + ");", "window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction(" + f + ")}", "\x3c/script>"].join(""));
c.$.close();
for (k = 0; k < e.length; k++) e[k].enable()
}
var b = this._,
c = CKEDITOR.document.getById(b.frameId).getFrameDocument(),
d = b.definition,
e = b.buttons,
g = this.formLoadedNumber,
f = this.formUnloadNumber,
m = b.dialog._.editor.lang.dir,
p = b.dialog._.editor.langCode;
g || (g = this.formLoadedNumber = CKEDITOR.tools.addFunction(function() {
this.fire("formLoaded")
}, this), f = this.formUnloadNumber = CKEDITOR.tools.addFunction(function() {
this.getInputElement().clearCustomData()
}, this), this.getDialog()._.editor.on("destroy", function() {
CKEDITOR.tools.removeFunction(g);
CKEDITOR.tools.removeFunction(f)
}));
CKEDITOR.env.gecko ? setTimeout(a, 500) : a()
},
getValue: function() {
return this.getInputElement().$.value || ""
},
setInitValue: function() {
this._.initValue = ""
},
eventProcessors: {
onChange: function(a,
b) {
this._.domOnChangeRegistered || (this.on("formLoaded", function() {
this.getInputElement().on("change", function() {
this.fire("change", {
value: this.getValue()
})
}, this)
}, this), this._.domOnChangeRegistered = !0);
this.on("change", b)
}
},
keyboardFocusable: !0
}, !0);
CKEDITOR.ui.dialog.fileButton.prototype = new CKEDITOR.ui.dialog.button;
CKEDITOR.ui.dialog.fieldset.prototype = CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);
CKEDITOR.dialog.addUIElement("text", f);
CKEDITOR.dialog.addUIElement("password", f);
CKEDITOR.dialog.addUIElement("textarea",
c);
CKEDITOR.dialog.addUIElement("checkbox", c);
CKEDITOR.dialog.addUIElement("radio", c);
CKEDITOR.dialog.addUIElement("button", c);
CKEDITOR.dialog.addUIElement("select", c);
CKEDITOR.dialog.addUIElement("file", c);
CKEDITOR.dialog.addUIElement("fileButton", c);
CKEDITOR.dialog.addUIElement("html", c);
CKEDITOR.dialog.addUIElement("fieldset", {
build: function(a, b, c) {
for (var d = b.children, e, g = [], f = [], m = 0; m < d.length && (e = d[m]); m++) {
var p = [];
g.push(p);
f.push(CKEDITOR.dialog._.uiElementBuilders[e.type].build(a, e, p))
}
return new CKEDITOR.ui.dialog[b.type](a,
f, g, c, b)
}
})
}
}), CKEDITOR.DIALOG_RESIZE_NONE = 0, CKEDITOR.DIALOG_RESIZE_WIDTH = 1, CKEDITOR.DIALOG_RESIZE_HEIGHT = 2, CKEDITOR.DIALOG_RESIZE_BOTH = 3,
function() {
function d() {
for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId) + a, c = b - 1; c > b - a; c--)
if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a];
return null
}
function f() {
for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId), c = b + 1; c < b + a; c++)
if (this._.tabs[this._.tabIdList[c %
a]][0].$.offsetHeight) return this._.tabIdList[c % a];
return null
}
function c(a, b) {
for (var c = a.$.getElementsByTagName("input"), d = 0, e = c.length; d < e; d++) {
var g = new CKEDITOR.dom.element(c[d]);
"text" == g.getAttribute("type").toLowerCase() && (b ? (g.setAttribute("value", g.getCustomData("fake_value") || ""), g.removeCustomData("fake_value")) : (g.setCustomData("fake_value", g.getAttribute("value")), g.setAttribute("value", "")))
}
}
function a(a, b) {
var c = this.getInputElement();
c && (a ? c.removeAttribute("aria-invalid") : c.setAttribute("aria-invalid", !0));
a || (this.select ? this.select() : this.focus());
b && alert(b);
this.fire("validated", {
valid: a,
msg: b
})
}
function b() {
var a = this.getInputElement();
a && a.removeAttribute("aria-invalid")
}
function e(a) {
a = CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog", p).output({
id: CKEDITOR.tools.getNextNumber(),
editorId: a.id,
langDir: a.lang.dir,
langCode: a.langCode,
editorDialogClass: "cke_editor_" + a.name.replace(/\./g, "\\.") + "_dialog",
closeTitle: a.lang.common.close,
hidpi: CKEDITOR.env.hidpi ? "cke_hidpi" : ""
}));
var b = a.getChild([0, 0, 0, 0, 0]),
c = b.getChild(0),
d = b.getChild(1);
if (CKEDITOR.env.ie && !CKEDITOR.env.ie6Compat) {
var e = "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())";
CKEDITOR.dom.element.createFromHtml('<iframe frameBorder="0" class="cke_iframe_shim" src="' + e + '" tabIndex="-1"></iframe>').appendTo(b.getParent())
}
c.unselectable();
d.unselectable();
return {
element: a,
parts: {
dialog: a.getChild(0),
title: c,
close: d,
tabs: b.getChild(2),
contents: b.getChild([3,
0, 0, 0
]),
footer: b.getChild([3, 0, 1, 0])
}
}
}
function g(a, b, c) {
this.element = b;
this.focusIndex = c;
this.tabIndex = 0;
this.isFocusable = function() {
return !b.getAttribute("disabled") && b.isVisible()
};
this.focus = function() {
a._.currentFocusIndex = this.focusIndex;
this.element.focus()
};
b.on("keydown", function(a) {
a.data.getKeystroke() in {
32: 1,
13: 1
} && this.fire("click")
});
b.on("focus", function() {
this.fire("mouseover")
});
b.on("blur", function() {
this.fire("mouseout")
})
}
function k(a) {
function b() {
a.layout()
}
var c = CKEDITOR.document.getWindow();
c.on("resize", b);
a.on("hide", function() {
c.removeListener("resize", b)
})
}
function h(a, b) {
this._ = {
dialog: a
};
CKEDITOR.tools.extend(this, b)
}
function l(a) {
function b(c) {
var f = a.getSize(),
l = CKEDITOR.document.getWindow().getViewPaneSize(),
m = c.data.$.screenX,
n = c.data.$.screenY,
p = m - d.x,
q = n - d.y;
d = {
x: m,
y: n
};
e.x += p;
e.y += q;
a.move(e.x + k[3] < h ? -k[3] : e.x - k[1] > l.width - f.width - h ? l.width - f.width + ("rtl" == g.lang.dir ? 0 : k[1]) : e.x, e.y + k[0] < h ? -k[0] : e.y - k[2] > l.height - f.height - h ? l.height - f.height + k[2] : e.y, 1);
c.data.preventDefault()
}
function c() {
CKEDITOR.document.removeListener("mousemove", b);
CKEDITOR.document.removeListener("mouseup", c);
if (CKEDITOR.env.ie6Compat) {
var a = v.getChild(0).getFrameDocument();
a.removeListener("mousemove", b);
a.removeListener("mouseup", c)
}
}
var d = null,
e = null;
a.getElement().getFirst();
var g = a.getParentEditor(),
h = g.config.dialog_magnetDistance,
k = CKEDITOR.skin.margins || [0, 0, 0, 0];
"undefined" == typeof h && (h = 20);
a.parts.title.on("mousedown", function(g) {
d = {
x: g.data.$.screenX,
y: g.data.$.screenY
};
CKEDITOR.document.on("mousemove",
b);
CKEDITOR.document.on("mouseup", c);
e = a.getPosition();
if (CKEDITOR.env.ie6Compat) {
var h = v.getChild(0).getFrameDocument();
h.on("mousemove", b);
h.on("mouseup", c)
}
g.data.preventDefault()
}, a)
}
function n(a) {
function b(c) {
var p = "rtl" == k.lang.dir,
q = n.width,
r = n.height,
t = q + (c.data.$.screenX - d) * (p ? -1 : 1) * (a._.moved ? 1 : 2),
x = r + (c.data.$.screenY - e) * (a._.moved ? 1 : 2),
s = a._.element.getFirst(),
s = p && s.getComputedStyle("right"),
J = a.getPosition();
J.y + x > m.height && (x = m.height - J.y);
if ((p ? s : J.x) + t > m.width) t = m.width - (p ? s : J.x);
if (h == CKEDITOR.DIALOG_RESIZE_WIDTH || h == CKEDITOR.DIALOG_RESIZE_BOTH) q = Math.max(g.minWidth || 0, t - f);
if (h == CKEDITOR.DIALOG_RESIZE_HEIGHT || h == CKEDITOR.DIALOG_RESIZE_BOTH) r = Math.max(g.minHeight || 0, x - l);
a.resize(q, r);
a._.moved || a.layout();
c.data.preventDefault()
}
function c() {
CKEDITOR.document.removeListener("mouseup", c);
CKEDITOR.document.removeListener("mousemove", b);
p && (p.remove(), p = null);
if (CKEDITOR.env.ie6Compat) {
var a = v.getChild(0).getFrameDocument();
a.removeListener("mouseup", c);
a.removeListener("mousemove",
b)
}
}
var d, e, g = a.definition,
h = g.resizable;
if (h != CKEDITOR.DIALOG_RESIZE_NONE) {
var k = a.getParentEditor(),
f, l, m, n, p, q = CKEDITOR.tools.addFunction(function(g) {
n = a.getSize();
var h = a.parts.contents;
h.$.getElementsByTagName("iframe").length && (p = CKEDITOR.dom.element.createFromHtml('<div class="cke_dialog_resize_cover" style="height: 100%; position: absolute; width: 100%;"></div>'), h.append(p));
l = n.height - a.parts.contents.getSize("height", !(CKEDITOR.env.gecko || CKEDITOR.env.opera || CKEDITOR.env.ie && CKEDITOR.env.quirks));
f = n.width - a.parts.contents.getSize("width", 1);
d = g.screenX;
e = g.screenY;
m = CKEDITOR.document.getWindow().getViewPaneSize();
CKEDITOR.document.on("mousemove", b);
CKEDITOR.document.on("mouseup", c);
CKEDITOR.env.ie6Compat && (h = v.getChild(0).getFrameDocument(), h.on("mousemove", b), h.on("mouseup", c));
g.preventDefault && g.preventDefault()
});
a.on("load", function() {
var b = "";
h == CKEDITOR.DIALOG_RESIZE_WIDTH ? b = " cke_resizer_horizontal" : h == CKEDITOR.DIALOG_RESIZE_HEIGHT && (b = " cke_resizer_vertical");
b = CKEDITOR.dom.element.createFromHtml('<div class="cke_resizer' +
b + " cke_resizer_" + k.lang.dir + '" title="' + CKEDITOR.tools.htmlEncode(k.lang.common.resize) + '" onmousedown="CKEDITOR.tools.callFunction(' + q + ', event )">' + ("ltr" == k.lang.dir ? "\u25e2" : "\u25e3") + "</div>");
a.parts.footer.append(b, 1)
});
k.on("destroy", function() {
CKEDITOR.tools.removeFunction(q)
})
}
}
function q(a) {
a.data.preventDefault(1)
}
function r(a) {
var b = CKEDITOR.document.getWindow(),
c = a.config,
d = c.dialog_backgroundCoverColor || "white",
e = c.dialog_backgroundCoverOpacity,
g = c.baseFloatZIndex,
c = CKEDITOR.tools.genKey(d,
e, g),
h = s[c];
h ? h.show() : (g = ['<div tabIndex="-1" style="position: ', CKEDITOR.env.ie6Compat ? "absolute" : "fixed", "; z-index: ", g, "; top: 0px; left: 0px; ", !CKEDITOR.env.ie6Compat ? "background-color: " + d : "", '" class="cke_dialog_background_cover">'], CKEDITOR.env.ie6Compat && (d = "<html><body style=\\'background-color:" + d + ";\\'></body></html>", g.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:'), g.push("void((function(){" + encodeURIComponent("document.open();(" +
CKEDITOR.tools.fixDomain + ")();document.write( '" + d + "' );document.close();") + "})())"), g.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>')), g.push("</div>"), h = CKEDITOR.dom.element.createFromHtml(g.join("")), h.setOpacity(void 0 != e ? e : 0.5), h.on("keydown", q), h.on("keypress", q), h.on("keyup", q), h.appendTo(CKEDITOR.document.getBody()), s[c] = h);
a.focusManager.add(h);
v = h;
a = function() {
var a = b.getViewPaneSize();
h.setStyles({
width: a.width +
"px",
height: a.height + "px"
})
};
var k = function() {
var a = b.getScrollPosition(),
c = CKEDITOR.dialog._.currentTop;
h.setStyles({
left: a.x + "px",
top: a.y + "px"
});
if (c) {
do a = c.getPosition(), c.move(a.x, a.y); while (c = c._.parentDialog)
}
};
C = a;
b.on("resize", a);
a();
(!CKEDITOR.env.mac || !CKEDITOR.env.webkit) && h.focus();
if (CKEDITOR.env.ie6Compat) {
var f = function() {
k();
arguments.callee.prevScrollHandler.apply(this, arguments)
};
b.$.setTimeout(function() {
f.prevScrollHandler = window.onscroll || function() {};
window.onscroll = f
}, 0);
k()
}
}
function u(a) {
v && (a.focusManager.remove(v), a = CKEDITOR.document.getWindow(), v.hide(), a.removeListener("resize", C), CKEDITOR.env.ie6Compat && a.$.setTimeout(function() {
window.onscroll = window.onscroll && window.onscroll.prevScrollHandler || null
}, 0), C = null)
}
var m = CKEDITOR.tools.cssLength,
p = '<div class="cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir="{langDir}" lang="{langCode}" role="dialog" aria-labelledby="cke_dialog_title_{id}"><table class="cke_dialog ' + CKEDITOR.env.cssClass + ' cke_{langDir}" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="cke_dialog_body" role="presentation"><div id="cke_dialog_title_{id}" class="cke_dialog_title" role="presentation"></div><a id="cke_dialog_close_button_{id}" class="cke_dialog_close_button" href="javascript:void(0)" title="{closeTitle}" role="button"><span class="cke_label">X</span></a><div id="cke_dialog_tabs_{id}" class="cke_dialog_tabs" role="tablist"></div><table class="cke_dialog_contents" role="presentation"><tr><td id="cke_dialog_contents_{id}" class="cke_dialog_contents_body" role="presentation"></td></tr><tr><td id="cke_dialog_footer_{id}" class="cke_dialog_footer" role="presentation"></td></tr></table></div></td></tr></table></div>';
CKEDITOR.dialog = function(c, g) {
function h() {
var a = v._.focusList;
a.sort(function(a, b) {
return a.tabIndex != b.tabIndex ? b.tabIndex - a.tabIndex : a.focusIndex - b.focusIndex
});
for (var b = a.length, c = 0; c < b; c++) a[c].focusIndex = c
}
function k(a) {
var b = v._.focusList;
a = a || 0;
if (!(1 > b.length)) {
var c = v._.currentFocusIndex;
try {
b[c].getInputElement().$.blur()
} catch (d) {}
for (var e = c = (c + a + b.length) % b.length; a && !b[e].isFocusable() && !(e = (e + a + b.length) % b.length, e == c););
b[e].focus();
"text" == b[e].type && b[e].select()
}
}
function m(a) {
if (v ==
CKEDITOR.dialog._.currentTop) {
var b = a.data.getKeystroke(),
e = "rtl" == c.lang.dir;
y = u = 0;
if (9 == b || b == CKEDITOR.SHIFT + 9) b = b == CKEDITOR.SHIFT + 9, v._.tabBarMode ? (b = b ? d.call(v) : f.call(v), v.selectPage(b), v._.tabs[b][0].focus()) : k(b ? -1 : 1), y = 1;
else if (b == CKEDITOR.ALT + 121 && !v._.tabBarMode && 1 < v.getPageCount()) v._.tabBarMode = !0, v._.tabs[v._.currentTabId][0].focus(), y = 1;
else if ((37 == b || 39 == b) && v._.tabBarMode) b = b == (e ? 39 : 37) ? d.call(v) : f.call(v), v.selectPage(b), v._.tabs[b][0].focus(), y = 1;
else if ((13 == b || 32 == b) && v._.tabBarMode) this.selectPage(this._.currentTabId),
this._.tabBarMode = !1, this._.currentFocusIndex = -1, k(1), y = 1;
else if (13 == b) {
b = a.data.getTarget();
if (!b.is("a", "button", "select", "textarea") && (!b.is("input") || "button" != b.$.type))(b = this.getButton("ok")) && CKEDITOR.tools.setTimeout(b.click, 0, b), y = 1;
u = 1
} else if (27 == b)(b = this.getButton("cancel")) ? CKEDITOR.tools.setTimeout(b.click, 0, b) : !1 !== this.fire("cancel", {
hide: !0
}).hide && this.hide(), u = 1;
else return;
p(a)
}
}
function p(a) {
y ? a.data.preventDefault(1) : u && a.data.stopPropagation()
}
var q = CKEDITOR.dialog._.dialogDefinitions[g],
r = CKEDITOR.tools.clone(w),
t = c.config.dialog_buttonsOrder || "OS",
x = c.lang.dir,
s = {},
y, u;
("OS" == t && CKEDITOR.env.mac || "rtl" == t && "ltr" == x || "ltr" == t && "rtl" == x) && r.buttons.reverse();
q = CKEDITOR.tools.extend(q(c), r);
q = CKEDITOR.tools.clone(q);
q = new z(this, q);
r = e(c);
this._ = {
editor: c,
element: r.element,
name: g,
contentSize: {
width: 0,
height: 0
},
size: {
width: 0,
height: 0
},
contents: {},
buttons: {},
accessKeyMap: {},
tabs: {},
tabIdList: [],
currentTabId: null,
currentTabIndex: null,
pageCount: 0,
lastTab: null,
tabBarMode: !1,
focusList: [],
currentFocusIndex: 0,
hasFocus: !1
};
this.parts = r.parts;
CKEDITOR.tools.setTimeout(function() {
c.fire("ariaWidget", this.parts.contents)
}, 0, this);
r = {
position: CKEDITOR.env.ie6Compat ? "absolute" : "fixed",
top: 0,
visibility: "hidden"
};
r["rtl" == x ? "right" : "left"] = 0;
this.parts.dialog.setStyles(r);
CKEDITOR.event.call(this);
this.definition = q = CKEDITOR.fire("dialogDefinition", {
name: g,
definition: q
}, c).definition;
if (!("removeDialogTabs" in c._) && c.config.removeDialogTabs) {
r = c.config.removeDialogTabs.split(";");
for (x = 0; x <
r.length; x++)
if (t = r[x].split(":"), 2 == t.length) {
var A = t[0];
s[A] || (s[A] = []);
s[A].push(t[1])
}
c._.removeDialogTabs = s
}
if (c._.removeDialogTabs && (s = c._.removeDialogTabs[g]))
for (x = 0; x < s.length; x++) q.removeContents(s[x]);
if (q.onLoad) this.on("load", q.onLoad);
if (q.onShow) this.on("show", q.onShow);
if (q.onHide) this.on("hide", q.onHide);
if (q.onOk) this.on("ok", function(a) {
c.fire("saveSnapshot");
setTimeout(function() {
c.fire("saveSnapshot")
}, 0);
!1 === q.onOk.call(this, a) && (a.data.hide = !1)
});
if (q.onCancel) this.on("cancel",
function(a) {
!1 === q.onCancel.call(this, a) && (a.data.hide = !1)
});
var v = this,
C = function(a) {
var b = v._.contents,
c;
for (c in b)
for (var d in b[c])
if (a.call(this, b[c][d])) return
};
this.on("ok", function(b) {
C(function(c) {
if (c.validate) {
var d = c.validate(this),
e = "string" == typeof d || !1 === d;
e && (b.data.hide = !1, b.stop());
a.call(c, !e, "string" == typeof d ? d : void 0);
return e
}
})
}, this, null, 0);
this.on("cancel", function(a) {
C(function(b) {
if (b.isChanged()) return !c.config.dialog_noConfirmCancel && !confirm(c.lang.common.confirmCancel) &&
(a.data.hide = !1), !0
})
}, this, null, 0);
this.parts.close.on("click", function(a) {
!1 !== this.fire("cancel", {
hide: !0
}).hide && this.hide();
a.data.preventDefault()
}, this);
this.changeFocus = k;
var B = this._.element;
c.focusManager.add(B, 1);
this.on("show", function() {
B.on("keydown", m, this);
if (CKEDITOR.env.opera || CKEDITOR.env.gecko) B.on("keypress", p, this)
});
this.on("hide", function() {
B.removeListener("keydown", m);
(CKEDITOR.env.opera || CKEDITOR.env.gecko) && B.removeListener("keypress", p);
C(function(a) {
b.apply(a)
})
});
this.on("iframeAdded",
function(a) {
(new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown", m, this, null, 0)
});
this.on("show", function() {
h();
if (c.config.dialog_startupFocusTab && 1 < v._.pageCount) v._.tabBarMode = !0, v._.tabs[v._.currentTabId][0].focus();
else if (!this._.hasFocus)
if (this._.currentFocusIndex = -1, q.onFocus) {
var a = q.onFocus.call(this);
a && a.focus()
} else k(1)
}, this, null, 4294967295);
if (CKEDITOR.env.ie6Compat) this.on("load", function() {
var a = this.getElement(),
b = a.getFirst();
b.remove();
b.appendTo(a)
},
this);
l(this);
n(this);
(new CKEDITOR.dom.text(q.title, CKEDITOR.document)).appendTo(this.parts.title);
for (x = 0; x < q.contents.length; x++)(s = q.contents[x]) && this.addPage(s);
this.parts.tabs.on("click", function(a) {
var b = a.data.getTarget();
b.hasClass("cke_dialog_tab") && (b = b.$.id, this.selectPage(b.substring(4, b.lastIndexOf("_"))), this._.tabBarMode && (this._.tabBarMode = !1, this._.currentFocusIndex = -1, k(1)), a.data.preventDefault())
}, this);
x = [];
s = CKEDITOR.dialog._.uiElementBuilders.hbox.build(this, {
type: "hbox",
className: "cke_dialog_footer_buttons",
widths: [],
children: q.buttons
}, x).getChild();
this.parts.footer.setHtml(x.join(""));
for (x = 0; x < s.length; x++) this._.buttons[s[x].id] = s[x]
};
CKEDITOR.dialog.prototype = {
destroy: function() {
this.hide();
this._.element.remove()
},
resize: function() {
return function(a, b) {
if (!this._.contentSize || !(this._.contentSize.width == a && this._.contentSize.height == b)) CKEDITOR.dialog.fire("resize", {
dialog: this,
width: a,
height: b
}, this._.editor), this.fire("resize", {
width: a,
height: b
}, this._.editor),
this.parts.contents.setStyles({
width: a + "px",
height: b + "px"
}), "rtl" == this._.editor.lang.dir && this._.position && (this._.position.x = CKEDITOR.document.getWindow().getViewPaneSize().width - this._.contentSize.width - parseInt(this._.element.getFirst().getStyle("right"), 10)), this._.contentSize = {
width: a,
height: b
}
}
}(),
getSize: function() {
var a = this._.element.getFirst();
return {
width: a.$.offsetWidth || 0,
height: a.$.offsetHeight || 0
}
},
move: function(a, b, c) {
var d = this._.element.getFirst(),
e = "rtl" == this._.editor.lang.dir,
g = "fixed" == d.getComputedStyle("position");
CKEDITOR.env.ie && d.setStyle("zoom", "100%");
if (!g || !this._.position || !(this._.position.x == a && this._.position.y == b)) this._.position = {
x: a,
y: b
}, g || (g = CKEDITOR.document.getWindow().getScrollPosition(), a += g.x, b += g.y), e && (g = this.getSize(), a = CKEDITOR.document.getWindow().getViewPaneSize().width - g.width - a), b = {
top: (0 < b ? b : 0) + "px"
}, b[e ? "right" : "left"] = (0 < a ? a : 0) + "px", d.setStyles(b), c && (this._.moved = 1)
},
getPosition: function() {
return CKEDITOR.tools.extend({}, this._.position)
},
show: function() {
var a = this._.element,
b = this.definition;
!a.getParent() || !a.getParent().equals(CKEDITOR.document.getBody()) ? a.appendTo(CKEDITOR.document.getBody()) : a.setStyle("display", "block");
if (CKEDITOR.env.gecko && 10900 > CKEDITOR.env.version) {
var c = this.parts.dialog;
c.setStyle("position", "absolute");
setTimeout(function() {
c.setStyle("position", "fixed")
}, 0)
}
this.resize(this._.contentSize && this._.contentSize.width || b.width || b.minWidth, this._.contentSize && this._.contentSize.height || b.height || b.minHeight);
this.reset();
this.selectPage(this.definition.contents[0].id);
null === CKEDITOR.dialog._.currentZIndex && (CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex);
this._.element.getFirst().setStyle("z-index", CKEDITOR.dialog._.currentZIndex += 10);
null === CKEDITOR.dialog._.currentTop ? (CKEDITOR.dialog._.currentTop = this, this._.parentDialog = null, r(this._.editor)) : (this._.parentDialog = CKEDITOR.dialog._.currentTop, this._.parentDialog.getElement().getFirst().$.style.zIndex -= Math.floor(this._.editor.config.baseFloatZIndex /
2), CKEDITOR.dialog._.currentTop = this);
a.on("keydown", A);
a.on(CKEDITOR.env.opera ? "keypress" : "keyup", D);
this._.hasFocus = !1;
for (var d in b.contents)
if (b.contents[d]) {
var a = b.contents[d],
e = this._.tabs[a.id],
g = a.requiredContent,
h = 0;
if (e) {
for (var f in this._.contents[a.id]) {
var l = this._.contents[a.id][f];
"hbox" == l.type || ("vbox" == l.type || !l.getInputElement()) || (l.requiredContent && !this._.editor.activeFilter.check(l.requiredContent) ? l.disable() : (l.enable(), h++))
}!h || g && !this._.editor.activeFilter.check(g) ?
e[0].addClass("cke_dialog_tab_disabled") : e[0].removeClass("cke_dialog_tab_disabled")
}
}
CKEDITOR.tools.setTimeout(function() {
this.layout();
k(this);
this.parts.dialog.setStyle("visibility", "");
this.fireOnce("load", {});
CKEDITOR.ui.fire("ready", this);
this.fire("show", {});
this._.editor.fire("dialogShow", this);
this._.parentDialog || this._.editor.focusManager.lock();
this.foreach(function(a) {
a.setInitValue && a.setInitValue()
})
}, 100, this)
},
layout: function() {
var a = this.parts.dialog,
b = this.getSize(),
c = CKEDITOR.document.getWindow().getViewPaneSize(),
d = (c.width - b.width) / 2,
e = (c.height - b.height) / 2;
CKEDITOR.env.ie6Compat || (b.height + (0 < e ? e : 0) > c.height || b.width + (0 < d ? d : 0) > c.width ? a.setStyle("position", "absolute") : a.setStyle("position", "fixed"));
this.move(this._.moved ? this._.position.x : d, this._.moved ? this._.position.y : e)
},
foreach: function(a) {
for (var b in this._.contents)
for (var c in this._.contents[b]) a.call(this, this._.contents[b][c]);
return this
},
reset: function() {
var a = function(a) {
a.reset && a.reset(1)
};
return function() {
this.foreach(a);
return this
}
}(),
setupContent: function() {
var a = arguments;
this.foreach(function(b) {
b.setup && b.setup.apply(b, a)
})
},
commitContent: function() {
var a = arguments;
this.foreach(function(b) {
CKEDITOR.env.ie && this._.currentFocusIndex == b.focusIndex && b.getInputElement().$.blur();
b.commit && b.commit.apply(b, a)
})
},
hide: function() {
if (this.parts.dialog.isVisible()) {
this.fire("hide", {});
this._.editor.fire("dialogHide", this);
this.selectPage(this._.tabIdList[0]);
var a = this._.element;
a.setStyle("display", "none");
this.parts.dialog.setStyle("visibility",
"hidden");
for (M(this); CKEDITOR.dialog._.currentTop != this;) CKEDITOR.dialog._.currentTop.hide();
if (this._.parentDialog) {
var b = this._.parentDialog.getElement().getFirst();
b.setStyle("z-index", parseInt(b.$.style.zIndex, 10) + Math.floor(this._.editor.config.baseFloatZIndex / 2))
} else u(this._.editor);
if (CKEDITOR.dialog._.currentTop = this._.parentDialog) CKEDITOR.dialog._.currentZIndex -= 10;
else {
CKEDITOR.dialog._.currentZIndex = null;
a.removeListener("keydown", A);
a.removeListener(CKEDITOR.env.opera ? "keypress" : "keyup",
D);
var c = this._.editor;
c.focus();
setTimeout(function() {
c.focusManager.unlock()
}, 0)
}
delete this._.parentDialog;
this.foreach(function(a) {
a.resetInitValue && a.resetInitValue()
})
}
},
addPage: function(a) {
if (!a.requiredContent || this._.editor.filter.check(a.requiredContent)) {
for (var b = [], c = a.label ? ' title="' + CKEDITOR.tools.htmlEncode(a.label) + '"' : "", d = CKEDITOR.dialog._.uiElementBuilders.vbox.build(this, {
type: "vbox",
className: "cke_dialog_page_contents",
children: a.elements,
expand: !!a.expand,
padding: a.padding,
style: a.style || "width: 100%;"
}, b), e = this._.contents[a.id] = {}, g = d.getChild(), h = 0; d = g.shift();) !d.notAllowed && "hbox" != d.type && "vbox" != d.type && h++, e[d.id] = d, "function" == typeof d.getChild && g.push.apply(g, d.getChild());
h || (a.hidden = !0);
b = CKEDITOR.dom.element.createFromHtml(b.join(""));
b.setAttribute("role", "tabpanel");
d = CKEDITOR.env;
e = "cke_" + a.id + "_" + CKEDITOR.tools.getNextNumber();
c = CKEDITOR.dom.element.createFromHtml(['<a class="cke_dialog_tab"', 0 < this._.pageCount ? " cke_last" : "cke_first", c, a.hidden ? ' style="display:none"' :
"", ' id="', e, '"', d.gecko && 10900 <= d.version && !d.hc ? "" : ' href="javascript:void(0)"', ' tabIndex="-1" hidefocus="true" role="tab">', a.label, "</a>"
].join(""));
b.setAttribute("aria-labelledby", e);
this._.tabs[a.id] = [c, b];
this._.tabIdList.push(a.id);
!a.hidden && this._.pageCount++;
this._.lastTab = c;
this.updateStyle();
b.setAttribute("name", a.id);
b.appendTo(this.parts.contents);
c.unselectable();
this.parts.tabs.append(c);
a.accessKey && (B(this, this, "CTRL+" + a.accessKey, H, F), this._.accessKeyMap["CTRL+" + a.accessKey] =
a.id)
}
},
selectPage: function(a) {
if (this._.currentTabId != a && !this._.tabs[a][0].hasClass("cke_dialog_tab_disabled") && !0 !== this.fire("selectPage", {
page: a,
currentPage: this._.currentTabId
})) {
for (var b in this._.tabs) {
var d = this._.tabs[b][0],
e = this._.tabs[b][1];
b != a && (d.removeClass("cke_dialog_tab_selected"), e.hide());
e.setAttribute("aria-hidden", b != a)
}
var g = this._.tabs[a];
g[0].addClass("cke_dialog_tab_selected");
CKEDITOR.env.ie6Compat || CKEDITOR.env.ie7Compat ? (c(g[1]), g[1].show(), setTimeout(function() {
c(g[1],
1)
}, 0)) : g[1].show();
this._.currentTabId = a;
this._.currentTabIndex = CKEDITOR.tools.indexOf(this._.tabIdList, a)
}
},
updateStyle: function() {
this.parts.dialog[(1 === this._.pageCount ? "add" : "remove") + "Class"]("cke_single_page")
},
hidePage: function(a) {
var b = this._.tabs[a] && this._.tabs[a][0];
b && (1 != this._.pageCount && b.isVisible()) && (a == this._.currentTabId && this.selectPage(d.call(this)), b.hide(), this._.pageCount--, this.updateStyle())
},
showPage: function(a) {
if (a = this._.tabs[a] && this._.tabs[a][0]) a.show(), this._.pageCount++,
this.updateStyle()
},
getElement: function() {
return this._.element
},
getName: function() {
return this._.name
},
getContentElement: function(a, b) {
var c = this._.contents[a];
return c && c[b]
},
getValueOf: function(a, b) {
return this.getContentElement(a, b).getValue()
},
setValueOf: function(a, b, c) {
return this.getContentElement(a, b).setValue(c)
},
getButton: function(a) {
return this._.buttons[a]
},
click: function(a) {
return this._.buttons[a].click()
},
disableButton: function(a) {
return this._.buttons[a].disable()
},
enableButton: function(a) {
return this._.buttons[a].enable()
},
getPageCount: function() {
return this._.pageCount
},
getParentEditor: function() {
return this._.editor
},
getSelectedElement: function() {
return this.getParentEditor().getSelection().getSelectedElement()
},
addFocusable: function(a, b) {
if ("undefined" == typeof b) b = this._.focusList.length, this._.focusList.push(new g(this, a, b));
else {
this._.focusList.splice(b, 0, new g(this, a, b));
for (var c = b + 1; c < this._.focusList.length; c++) this._.focusList[c].focusIndex++
}
}
};
CKEDITOR.tools.extend(CKEDITOR.dialog, {
add: function(a, b) {
if (!this._.dialogDefinitions[a] ||
"function" == typeof b) this._.dialogDefinitions[a] = b
},
exists: function(a) {
return !!this._.dialogDefinitions[a]
},
getCurrent: function() {
return CKEDITOR.dialog._.currentTop
},
isTabEnabled: function(a, b, c) {
a = a.config.removeDialogTabs;
return !(a && a.match(RegExp("(?:^|;)" + b + ":" + c + "(?:$|;)", "i")))
},
okButton: function() {
var a = function(a, b) {
b = b || {};
return CKEDITOR.tools.extend({
id: "ok",
type: "button",
label: a.lang.common.ok,
"class": "cke_dialog_ui_button_ok",
onClick: function(a) {
a = a.data.dialog;
!1 !== a.fire("ok", {
hide: !0
}).hide &&
a.hide()
}
}, b, !0)
};
a.type = "button";
a.override = function(b) {
return CKEDITOR.tools.extend(function(c) {
return a(c, b)
}, {
type: "button"
}, !0)
};
return a
}(),
cancelButton: function() {
var a = function(a, b) {
b = b || {};
return CKEDITOR.tools.extend({
id: "cancel",
type: "button",
label: a.lang.common.cancel,
"class": "cke_dialog_ui_button_cancel",
onClick: function(a) {
a = a.data.dialog;
!1 !== a.fire("cancel", {
hide: !0
}).hide && a.hide()
}
}, b, !0)
};
a.type = "button";
a.override = function(b) {
return CKEDITOR.tools.extend(function(c) {
return a(c,
b)
}, {
type: "button"
}, !0)
};
return a
}(),
addUIElement: function(a, b) {
this._.uiElementBuilders[a] = b
}
});
CKEDITOR.dialog._ = {
uiElementBuilders: {},
dialogDefinitions: {},
currentTop: null,
currentZIndex: null
};
CKEDITOR.event.implementOn(CKEDITOR.dialog);
CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);
var w = {
resizable: CKEDITOR.DIALOG_RESIZE_BOTH,
minWidth: 600,
minHeight: 400,
buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton]
},
t = function(a, b, c) {
for (var d = 0, e; e = a[d]; d++)
if (e.id == b || c && e[c] && (e = t(e[c],
b, c))) return e;
return null
},
x = function(a, b, c, d, e) {
if (c) {
for (var g = 0, h; h = a[g]; g++) {
if (h.id == c) return a.splice(g, 0, b), b;
if (d && h[d] && (h = x(h[d], b, c, d, !0))) return h
}
if (e) return null
}
a.push(b);
return b
},
y = function(a, b, c) {
for (var d = 0, e; e = a[d]; d++) {
if (e.id == b) return a.splice(d, 1);
if (c && e[c] && (e = y(e[c], b, c))) return e
}
return null
},
z = function(a, b) {
this.dialog = a;
for (var c = b.contents, d = 0, e; e = c[d]; d++) c[d] = e && new h(a, e);
CKEDITOR.tools.extend(this, b)
};
z.prototype = {
getContents: function(a) {
return t(this.contents,
a)
},
getButton: function(a) {
return t(this.buttons, a)
},
addContents: function(a, b) {
return x(this.contents, a, b)
},
addButton: function(a, b) {
return x(this.buttons, a, b)
},
removeContents: function(a) {
y(this.contents, a)
},
removeButton: function(a) {
y(this.buttons, a)
}
};
h.prototype = {
get: function(a) {
return t(this.elements, a, "children")
},
add: function(a, b) {
return x(this.elements, a, b, "children")
},
remove: function(a) {
y(this.elements, a, "children")
}
};
var C, s = {},
v, G = {},
A = function(a) {
var b = a.data.$.ctrlKey || a.data.$.metaKey,
c =
a.data.$.altKey,
d = a.data.$.shiftKey,
e = String.fromCharCode(a.data.$.keyCode);
if ((b = G[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (d ? "SHIFT+" : "") + e]) && b.length) b = b[b.length - 1], b.keydown && b.keydown.call(b.uiElement, b.dialog, b.key), a.data.preventDefault()
},
D = function(a) {
var b = a.data.$.ctrlKey || a.data.$.metaKey,
c = a.data.$.altKey,
d = a.data.$.shiftKey,
e = String.fromCharCode(a.data.$.keyCode);
if ((b = G[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (d ? "SHIFT+" : "") + e]) && b.length) b = b[b.length - 1], b.keyup && (b.keyup.call(b.uiElement, b.dialog, b.key),
a.data.preventDefault())
},
B = function(a, b, c, d, e) {
(G[c] || (G[c] = [])).push({
uiElement: a,
dialog: b,
key: c,
keyup: e || a.accessKeyUp,
keydown: d || a.accessKeyDown
})
},
M = function(a) {
for (var b in G) {
for (var c = G[b], d = c.length - 1; 0 <= d; d--)(c[d].dialog == a || c[d].uiElement == a) && c.splice(d, 1);
0 === c.length && delete G[b]
}
},
F = function(a, b) {
a._.accessKeyMap[b] && a.selectPage(a._.accessKeyMap[b])
},
H = function() {};
(function() {
CKEDITOR.ui.dialog = {
uiElement: function(a, b, c, d, e, g, h) {
if (!(4 > arguments.length)) {
var k = (d.call ? d(b) : d) || "div",
f = ["<", k, " "],
l = (e && e.call ? e(b) : e) || {},
m = (g && g.call ? g(b) : g) || {},
n = (h && h.call ? h.call(this, a, b) : h) || "",
p = this.domId = m.id || CKEDITOR.tools.getNextId() + "_uiElement";
this.id = b.id;
b.requiredContent && !a.getParentEditor().filter.check(b.requiredContent) && (l.display = "none", this.notAllowed = !0);
m.id = p;
var q = {};
b.type && (q["cke_dialog_ui_" + b.type] = 1);
b.className && (q[b.className] = 1);
b.disabled && (q.cke_disabled = 1);
for (var r = m["class"] && m["class"].split ? m["class"].split(" ") : [], p = 0; p < r.length; p++) r[p] && (q[r[p]] = 1);
r = [];
for (p in q) r.push(p);
m["class"] = r.join(" ");
b.title && (m.title = b.title);
q = (b.style || "").split(";");
b.align && (r = b.align, l["margin-left"] = "left" == r ? 0 : "auto", l["margin-right"] = "right" == r ? 0 : "auto");
for (p in l) q.push(p + ":" + l[p]);
b.hidden && q.push("display:none");
for (p = q.length - 1; 0 <= p; p--) "" === q[p] && q.splice(p, 1);
0 < q.length && (m.style = (m.style ? m.style + "; " : "") + q.join("; "));
for (p in m) f.push(p + '="' + CKEDITOR.tools.htmlEncode(m[p]) + '" ');
f.push(">", n, "</", k, ">");
c.push(f.join(""));
(this._ || (this._ = {})).dialog =
a;
"boolean" == typeof b.isChanged && (this.isChanged = function() {
return b.isChanged
});
"function" == typeof b.isChanged && (this.isChanged = b.isChanged);
"function" == typeof b.setValue && (this.setValue = CKEDITOR.tools.override(this.setValue, function(a) {
return function(c) {
a.call(this, b.setValue.call(this, c))
}
}));
"function" == typeof b.getValue && (this.getValue = CKEDITOR.tools.override(this.getValue, function(a) {
return function() {
return b.getValue.call(this, a.call(this))
}
}));
CKEDITOR.event.implementOn(this);
this.registerEvents(b);
this.accessKeyUp && this.accessKeyDown && b.accessKey && B(this, a, "CTRL+" + b.accessKey);
var t = this;
a.on("load", function() {
var b = t.getInputElement();
if (b) {
var c = t.type in {
checkbox: 1,
ratio: 1
} && CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? "cke_dialog_ui_focused" : "";
b.on("focus", function() {
a._.tabBarMode = !1;
a._.hasFocus = !0;
t.fire("focus");
c && this.addClass(c)
});
b.on("blur", function() {
t.fire("blur");
c && this.removeClass(c)
})
}
});
CKEDITOR.tools.extend(this, b);
this.keyboardFocusable && (this.tabIndex = b.tabIndex || 0, this.focusIndex =
a._.focusList.push(this) - 1, this.on("focus", function() {
a._.currentFocusIndex = t.focusIndex
}))
}
},
hbox: function(a, b, c, d, e) {
if (!(4 > arguments.length)) {
this._ || (this._ = {});
var g = this._.children = b,
h = e && e.widths || null,
k = e && e.height || null,
f, l = {
role: "presentation"
};
e && e.align && (l.align = e.align);
CKEDITOR.ui.dialog.uiElement.call(this, a, e || {
type: "hbox"
}, d, "table", {}, l, function() {
var a = ['<tbody><tr class="cke_dialog_ui_hbox">'];
for (f = 0; f < c.length; f++) {
var b = "cke_dialog_ui_hbox_child",
d = [];
0 === f && (b = "cke_dialog_ui_hbox_first");
f == c.length - 1 && (b = "cke_dialog_ui_hbox_last");
a.push('<td class="', b, '" role="presentation" ');
h ? h[f] && d.push("width:" + m(h[f])) : d.push("width:" + Math.floor(100 / c.length) + "%");
k && d.push("height:" + m(k));
e && void 0 != e.padding && d.push("padding:" + m(e.padding));
CKEDITOR.env.ie && CKEDITOR.env.quirks && g[f].align && d.push("text-align:" + g[f].align);
0 < d.length && a.push('style="' + d.join("; ") + '" ');
a.push(">", c[f], "</td>")
}
a.push("</tr></tbody>");
return a.join("")
})
}
},
vbox: function(a, b, c, d, e) {
if (!(3 > arguments.length)) {
this._ ||
(this._ = {});
var g = this._.children = b,
h = e && e.width || null,
k = e && e.heights || null;
CKEDITOR.ui.dialog.uiElement.call(this, a, e || {
type: "vbox"
}, d, "div", null, {
role: "presentation"
}, function() {
var b = ['<table role="presentation" cellspacing="0" border="0" '];
b.push('style="');
e && e.expand && b.push("height:100%;");
b.push("width:" + m(h || "100%"), ";");
CKEDITOR.env.webkit && b.push("float:none;");
b.push('"');
b.push('align="', CKEDITOR.tools.htmlEncode(e && e.align || ("ltr" == a.getParentEditor().lang.dir ? "left" : "right")), '" ');
b.push("><tbody>");
for (var d = 0; d < c.length; d++) {
var f = [];
b.push('<tr><td role="presentation" ');
h && f.push("width:" + m(h || "100%"));
k ? f.push("height:" + m(k[d])) : e && e.expand && f.push("height:" + Math.floor(100 / c.length) + "%");
e && void 0 != e.padding && f.push("padding:" + m(e.padding));
CKEDITOR.env.ie && CKEDITOR.env.quirks && g[d].align && f.push("text-align:" + g[d].align);
0 < f.length && b.push('style="', f.join("; "), '" ');
b.push(' class="cke_dialog_ui_vbox_child">', c[d], "</td></tr>")
}
b.push("</tbody></table>");
return b.join("")
})
}
}
}
})();
CKEDITOR.ui.dialog.uiElement.prototype = {
getElement: function() {
return CKEDITOR.document.getById(this.domId)
},
getInputElement: function() {
return this.getElement()
},
getDialog: function() {
return this._.dialog
},
setValue: function(a, b) {
this.getInputElement().setValue(a);
!b && this.fire("change", {
value: a
});
return this
},
getValue: function() {
return this.getInputElement().getValue()
},
isChanged: function() {
return !1
},
selectParentTab: function() {
for (var a = this.getInputElement();
(a = a.getParent()) && -1 == a.$.className.search("cke_dialog_page_contents"););
if (!a) return this;
a = a.getAttribute("name");
this._.dialog._.currentTabId != a && this._.dialog.selectPage(a);
return this
},
focus: function() {
this.selectParentTab().getInputElement().focus();
return this
},
registerEvents: function(a) {
var b = /^on([A-Z]\w+)/,
c, d = function(a, b, c, d) {
b.on("load", function() {
a.getInputElement().on(c, d, a)
})
},
e;
for (e in a)
if (c = e.match(b)) this.eventProcessors[e] ? this.eventProcessors[e].call(this, this._.dialog, a[e]) : d(this, this._.dialog, c[1].toLowerCase(), a[e]);
return this
},
eventProcessors: {
onLoad: function(a,
b) {
a.on("load", b, this)
},
onShow: function(a, b) {
a.on("show", b, this)
},
onHide: function(a, b) {
a.on("hide", b, this)
}
},
accessKeyDown: function() {
this.focus()
},
accessKeyUp: function() {},
disable: function() {
var a = this.getElement();
this.getInputElement().setAttribute("disabled", "true");
a.addClass("cke_disabled")
},
enable: function() {
var a = this.getElement();
this.getInputElement().removeAttribute("disabled");
a.removeClass("cke_disabled")
},
isEnabled: function() {
return !this.getElement().hasClass("cke_disabled")
},
isVisible: function() {
return this.getInputElement().isVisible()
},
isFocusable: function() {
return !this.isEnabled() || !this.isVisible() ? !1 : !0
}
};
CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
getChild: function(a) {
if (1 > arguments.length) return this._.children.concat();
a.splice || (a = [a]);
return 2 > a.length ? this._.children[a[0]] : this._.children[a[0]] && this._.children[a[0]].getChild ? this._.children[a[0]].getChild(a.slice(1, a.length)) : null
}
}, !0);
CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox;
(function() {
var a = {
build: function(a,
b, c) {
for (var d = b.children, e, g = [], h = [], k = 0; k < d.length && (e = d[k]); k++) {
var f = [];
g.push(f);
h.push(CKEDITOR.dialog._.uiElementBuilders[e.type].build(a, e, f))
}
return new CKEDITOR.ui.dialog[b.type](a, h, g, c, b)
}
};
CKEDITOR.dialog.addUIElement("hbox", a);
CKEDITOR.dialog.addUIElement("vbox", a)
})();
CKEDITOR.dialogCommand = function(a, b) {
this.dialogName = a;
CKEDITOR.tools.extend(this, b, !0)
};
CKEDITOR.dialogCommand.prototype = {
exec: function(a) {
CKEDITOR.env.opera ? CKEDITOR.tools.setTimeout(function() {
a.openDialog(this.dialogName)
},
0, this) : a.openDialog(this.dialogName)
},
canUndo: !1,
editorFocus: 1
};
(function() {
var a = /^([a]|[^a])+$/,
b = /^\d*$/,
c = /^\d*(?:\.\d+)?$/,
d = /^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,
e = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,
g = /^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;
CKEDITOR.VALIDATE_OR = 1;
CKEDITOR.VALIDATE_AND = 2;
CKEDITOR.dialog.validate = {
functions: function() {
var a = arguments;
return function() {
var b = this && this.getValue ? this.getValue() : a[0],
c = void 0,
d = CKEDITOR.VALIDATE_AND,
e = [],
g;
for (g = 0; g < a.length; g++)
if ("function" ==
typeof a[g]) e.push(a[g]);
else break;
g < a.length && "string" == typeof a[g] && (c = a[g], g++);
g < a.length && "number" == typeof a[g] && (d = a[g]);
var h = d == CKEDITOR.VALIDATE_AND ? !0 : !1;
for (g = 0; g < e.length; g++) h = d == CKEDITOR.VALIDATE_AND ? h && e[g](b) : h || e[g](b);
return !h ? c : !0
}
},
regex: function(a, b) {
return function(c) {
c = this && this.getValue ? this.getValue() : c;
return !a.test(c) ? b : !0
}
},
notEmpty: function(b) {
return this.regex(a, b)
},
integer: function(a) {
return this.regex(b, a)
},
number: function(a) {
return this.regex(c, a)
},
cssLength: function(a) {
return this.functions(function(a) {
return e.test(CKEDITOR.tools.trim(a))
},
a)
},
htmlLength: function(a) {
return this.functions(function(a) {
return d.test(CKEDITOR.tools.trim(a))
}, a)
},
inlineStyle: function(a) {
return this.functions(function(a) {
return g.test(CKEDITOR.tools.trim(a))
}, a)
},
equals: function(a, b) {
return this.functions(function(b) {
return b == a
}, b)
},
notEqual: function(a, b) {
return this.functions(function(b) {
return b != a
}, b)
}
};
CKEDITOR.on("instanceDestroyed", function(a) {
if (CKEDITOR.tools.isEmpty(CKEDITOR.instances)) {
for (var b; b = CKEDITOR.dialog._.currentTop;) b.hide();
for (var c in s) s[c].remove();
s = {}
}
a = a.editor._.storedDialogs;
for (var d in a) a[d].destroy()
})
})();
CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
openDialog: function(a, b) {
var c = null,
d = CKEDITOR.dialog._.dialogDefinitions[a];
null === CKEDITOR.dialog._.currentTop && r(this);
if ("function" == typeof d) c = this._.storedDialogs || (this._.storedDialogs = {}), c = c[a] || (c[a] = new CKEDITOR.dialog(this, a)), b && b.call(c, c), c.show();
else {
if ("failed" == d) throw u(this), Error('[CKEDITOR.dialog.openDialog] Dialog "' + a + '" failed when loading definition.');
"string" ==
typeof d && CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(d), function() {
"function" != typeof CKEDITOR.dialog._.dialogDefinitions[a] && (CKEDITOR.dialog._.dialogDefinitions[a] = "failed");
this.openDialog(a, b)
}, this, 0, 1)
}
CKEDITOR.skin.loadPart("dialog");
return c
}
})
}(), CKEDITOR.plugins.add("dialog", {
requires: "dialogui",
init: function(d) {
d.on("doubleclick", function(f) {
f.data.dialog && d.openDialog(f.data.dialog)
}, null, null, 999)
}
}), CKEDITOR.dialog.add("paste", function(d) {
function f(a) {
var b = new CKEDITOR.dom.document(a.document),
c = b.getBody(),
g = b.getById("cke_actscrpt");
g && g.remove();
c.setAttribute("contenteditable", !0);
if (CKEDITOR.env.ie && 8 > CKEDITOR.env.version) b.getWindow().on("blur", function() {
b.$.selection.empty()
});
b.on("keydown", function(a) {
a = a.data;
var b;
switch (a.getKeystroke()) {
case 27:
this.hide();
b = 1;
break;
case 9:
case CKEDITOR.SHIFT + 9:
this.changeFocus(1), b = 1
}
b && a.preventDefault()
}, this);
d.fire("ariaWidget", new CKEDITOR.dom.element(a.frameElement));
b.getWindow().getFrame().removeCustomData("pendingFocus") && c.focus()
}
var c = d.lang.clipboard;
d.on("pasteDialogCommit", function(a) {
a.data && d.fire("paste", {
type: "auto",
dataValue: a.data
})
}, null, null, 1E3);
return {
title: c.title,
minWidth: 700,
minHeight: 400,
onShow: function() {
this.parts.dialog.$.offsetHeight;
this.setupContent();
this.parts.title.setHtml(this.customTitle || c.title);
this.customTitle = null
},
onLoad: function() {
(CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) && "rtl" == d.lang.dir && this.parts.contents.setStyle("overflow", "hidden")
},
onOk: function() {
this.commitContent()
},
contents: [{
id: "general",
label: d.lang.common.generalTab,
elements: [{
type: "html",
id: "securityMsg",
html: '<div style="white-space:normal;width:340px">' + c.securityMsg + "</div>"
}, {
type: "html",
id: "pasteMsg",
html: '<div style="white-space:normal;width:340px">' + c.pasteMsg + "</div>"
}, {
type: "html",
id: "editing_area",
style: "width:100%;height:100%",
html: "",
focus: function() {
var a = this.getInputElement(),
b = a.getFrameDocument().getBody();
!b || !b.$ || b.isReadOnly() ? a.setCustomData("pendingFocus", 1) : b.focus()
},
setup: function() {
var a =
this.getDialog(),
b = '<html dir="' + d.config.contentsLangDirection + '" lang="' + (d.config.contentsLanguage || d.langCode) + '"><head><style>body{margin:3px;padding:20px;font-family: "proxima-nova", "Helvetica Neue", Helvetica, Arial, sans-serif;font-size: 14px;color: #333;}</style><script src="//use.typekit.com/cpb5jyo.js">\x3c/script></head><body><script id="cke_actscrpt" type="text/javascript">window.parent.CKEDITOR.tools.callFunction(' + CKEDITOR.tools.addFunction(f, a) + ",this);\x3c/script></body></html>",
e = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie ? "javascript:void((function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + '})())"' : "",
g = CKEDITOR.dom.element.createFromHtml('<iframe class="cke_pasteframe" frameborder="0" allowTransparency="true" src="' + e + '" role="region" aria-label="' + c.pasteArea + '" aria-describedby="' + a.getContentElement("general", "pasteMsg").domId + '" aria-multiple="true"></iframe>');
g.on("load", function(a) {
a.removeListener();
a = g.getFrameDocument();
a.write(b);
a.getBody().$ ? d.focusManager.add(a.getBody()) : d.focusManager.add(a);
CKEDITOR.env.air && f.call(this, a.getWindow().$)
}, a);
g.setCustomData("dialog", a);
a = this.getElement();
a.setHtml("");
a.append(g);
if (CKEDITOR.env.ie) {
var k = CKEDITOR.dom.element.createFromHtml('<span tabindex="-1" style="position:absolute" role="presentation"></span>');
k.on("focus", function() {
setTimeout(function() {
g.$.contentWindow.focus()
})
});
a.append(k);
this.focus = function() {
k.focus();
this.fire("focus")
}
}
this.getInputElement =
function() {
return g
};
CKEDITOR.env.ie && (a.setStyle("display", "block"), a.setStyle("height", g.$.offsetHeight + 2 + "px"))
},
commit: function() {
var a = this.getDialog().getParentEditor(),
b = this.getInputElement().getFrameDocument().getBody(),
c = b.getBogus(),
d;
c && c.remove();
d = b.getHtml();
setTimeout(function() {
a.fire("pasteDialogCommit", d)
}, 0)
}
}]
}]
}
}), "use strict",
function() {
function d(a) {
function b() {
var c = a.editable();
c.on(G, function(a) {
(!CKEDITOR.env.ie || !C) && x(a)
});
CKEDITOR.env.ie && c.on("paste", function(b) {
s ||
(e(), b.data.preventDefault(), x(b), r("paste") || a.openDialog("paste"))
});
CKEDITOR.env.ie && (c.on("contextmenu", f, null, null, 0), c.on("beforepaste", function(a) {
a.data && !a.data.$.ctrlKey && f()
}, null, null, 0));
c.on("beforecut", function() {
!C && m(a)
});
var d;
c.attachListener(CKEDITOR.env.ie ? c : a.document.getDocumentElement(), "mouseup", function() {
d = setTimeout(function() {
y()
}, 0)
});
a.on("destroy", function() {
clearTimeout(d)
});
c.on("keyup", y)
}
function c(b) {
return {
type: b,
canUndo: "cut" == b,
startDisabled: !0,
exec: function() {
"cut" ==
this.type && m();
var b, c = this.type;
if (CKEDITOR.env.ie) b = r(c);
else try {
b = a.document.$.execCommand(c, !1, null)
} catch (d) {
b = !1
}
b || alert(a.lang.clipboard[this.type + "Error"]);
return b
}
}
}
function d() {
return {
canUndo: !1,
async: !0,
exec: function(a, b) {
var c = function(b, c) {
b && u(b.type, b.dataValue, !!c);
a.fire("afterCommandExec", {
name: "paste",
command: d,
returnValue: !!b
})
},
d = this;
"string" == typeof b ? c({
type: "auto",
dataValue: b
}, 1) : a.getClipboardData(c)
}
}
}
function e() {
s = 1;
setTimeout(function() {
s = 0
}, 100)
}
function f() {
C = 1;
setTimeout(function() {
C = 0
}, 10)
}
function r(b) {
var c = a.document,
d = c.getBody(),
e = !1,
h = function() {
e = !0
};
d.on(b, h);
(7 < CKEDITOR.env.version ? c.$ : c.$.selection.createRange()).execCommand(b);
d.removeListener(b, h);
return e
}
function u(b, c, d) {
b = {
type: b
};
if (d && !a.fire("beforePaste", b) || !c) return !1;
b.dataValue = c;
return a.fire("paste", b)
}
function m() {
if (CKEDITOR.env.ie && !CKEDITOR.env.quirks) {
var b = a.getSelection(),
c, d, e;
if (b.getType() == CKEDITOR.SELECTION_ELEMENT && (c = b.getSelectedElement())) d = b.getRanges()[0], e =
a.document.createText(""), e.insertBefore(c), d.setStartBefore(e), d.setEndAfter(c), b.selectRanges([d]), setTimeout(function() {
c.getParent() && (e.remove(), b.selectElement(c))
}, 0)
}
}
function p(b, c) {
var d = a.document,
e = a.editable(),
h = function(a) {
a.cancel()
},
k = CKEDITOR.env.gecko && 10902 >= CKEDITOR.env.version,
f;
if (!d.getById("cke_pastebin")) {
var l = a.getSelection(),
m = l.createBookmarks(),
n = new CKEDITOR.dom.element((CKEDITOR.env.webkit || e.is("body")) && !CKEDITOR.env.ie && !CKEDITOR.env.opera ? "body" : "div", d);
n.setAttributes({
id: "cke_pastebin",
"data-cke-temp": "1"
});
CKEDITOR.env.opera && n.appendBogus();
var p = 0,
d = d.getWindow();
k ? (n.insertAfter(m[0].startNode), n.setStyle("display", "inline")) : (CKEDITOR.env.webkit ? (e.append(n), n.addClass("cke_editable"), e.is("body") || (k = "static" != e.getComputedStyle("position") ? e : CKEDITOR.dom.element.get(e.$.offsetParent), p = k.getDocumentPosition().y)) : e.getAscendant(CKEDITOR.env.ie || CKEDITOR.env.opera ? "body" : "html", 1).append(n), n.setStyles({
position: "absolute",
top: d.getScrollPosition().y - p + 10 + "px",
width: "1px",
height: Math.max(1, d.getViewPaneSize().height - 20) + "px",
overflow: "hidden",
margin: 0,
padding: 0
}));
(k = n.getParent().isReadOnly()) ? (n.setOpacity(0), n.setAttribute("contenteditable", !0)) : n.setStyle("ltr" == a.config.contentsLangDirection ? "left" : "right", "-1000px");
a.on("selectionChange", h, null, null, 0);
CKEDITOR.env.webkit && (f = e.once("blur", h, null, null, -100));
k && n.focus();
k = new CKEDITOR.dom.range(n);
k.selectNodeContents(n);
var q = k.select();
CKEDITOR.env.ie && (f = e.once("blur", function() {
a.lockSelection(q)
}));
var r =
CKEDITOR.document.getWindow().getScrollPosition().y;
setTimeout(function() {
if (CKEDITOR.env.webkit || CKEDITOR.env.opera) CKEDITOR.document[CKEDITOR.env.webkit ? "getBody" : "getDocumentElement"]().$.scrollTop = r;
f && f.removeListener();
CKEDITOR.env.ie && e.focus();
l.selectBookmarks(m);
n.remove();
var b;
if (CKEDITOR.env.webkit && (b = n.getFirst()) && b.is && b.hasClass("Apple-style-span")) n = b;
a.removeListener("selectionChange", h);
c(n.getHtml())
}, 0)
}
}
function w() {
if (CKEDITOR.env.ie) {
a.focus();
e();
var b = a.focusManager;
b.lock();
if (a.editable().fire(G) && !r("paste")) return b.unlock(), !1;
b.unlock()
} else try {
if (a.editable().fire(G) && !a.document.$.execCommand("Paste", !1, null)) throw 0;
} catch (c) {
return !1
}
return !0
}
function t(b) {
if ("wysiwyg" == a.mode) switch (b.data.keyCode) {
case CKEDITOR.CTRL + 86:
case CKEDITOR.SHIFT + 45:
b = a.editable();
e();
!CKEDITOR.env.ie && b.fire("beforepaste");
(CKEDITOR.env.opera || CKEDITOR.env.gecko && 10900 > CKEDITOR.env.version) && b.fire("paste");
break;
case CKEDITOR.CTRL + 88:
case CKEDITOR.SHIFT + 46:
a.fire("saveSnapshot"),
setTimeout(function() {
a.fire("saveSnapshot")
}, 0)
}
}
function x(b) {
var c = {
type: "auto"
},
d = a.fire("beforePaste", c);
p(b, function(a) {
a = a.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig, "");
d && u(c.type, a, 0, 1)
})
}
function y() {
if ("wysiwyg" == a.mode) {
var b = z("paste");
a.getCommand("cut").setState(z("cut"));
a.getCommand("copy").setState(z("copy"));
a.getCommand("paste").setState(b);
a.fire("pasteState", b)
}
}
function z(b) {
if (v && b in {
paste: 1,
cut: 1
}) return CKEDITOR.TRISTATE_DISABLED;
if ("paste" == b) return CKEDITOR.TRISTATE_OFF;
b = a.getSelection();
var c = b.getRanges();
return b.getType() == CKEDITOR.SELECTION_NONE || 1 == c.length && c[0].collapsed ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF
}
var C = 0,
s = 0,
v = 0,
G = CKEDITOR.env.ie ? "beforepaste" : "paste";
(function() {
a.on("key", t);
a.on("contentDom", b);
a.on("selectionChange", function(a) {
v = a.data.selection.getRanges()[0].checkReadOnly();
y()
});
a.contextMenu && a.contextMenu.addListener(function(a, b) {
v = b.getRanges()[0].checkReadOnly();
return {
cut: z("cut"),
copy: z("copy"),
paste: z("paste")
}
})
})();
(function() {
function b(c, d, e, h, k) {
var f = a.lang.clipboard[d];
a.addCommand(d, e);
a.ui.addButton && a.ui.addButton(c, {
label: f,
command: d,
toolbar: "clipboard," + h
});
a.addMenuItems && a.addMenuItem(d, {
label: f,
command: d,
group: "clipboard",
order: k
})
}
b("Cut", "cut", c("cut"), 10, 1);
b("Copy", "copy", c("copy"), 20, 4);
b("Paste", "paste", d(), 30, 8)
})();
a.getClipboardData = function(b, c) {
function d(a) {
a.removeListener();
a.cancel();
c(a.data)
}
function e(a) {
a.removeListener();
a.cancel();
l = !0;
c({
type: f,
dataValue: a.data
})
}
function h() {
this.customTitle =
b && b.title
}
var k = !1,
f = "auto",
l = !1;
c || (c = b, b = null);
a.on("paste", d, null, null, 0);
a.on("beforePaste", function(a) {
a.removeListener();
k = !0;
f = a.data.type
}, null, null, 1E3);
!1 === w() && (a.removeListener("paste", d), k && a.fire("pasteDialog", h) ? (a.on("pasteDialogCommit", e), a.on("dialogHide", function(a) {
a.removeListener();
a.data.removeListener("pasteDialogCommit", e);
setTimeout(function() {
l || c(null)
}, 10)
})) : c(null))
}
}
function f(a) {
if (CKEDITOR.env.webkit) {
if (!a.match(/^[^<]*$/g) && !a.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi)) return "html"
} else if (CKEDITOR.env.ie) {
if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi) &&
!a.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi)) return "html"
} else if (CKEDITOR.env.gecko || CKEDITOR.env.opera) {
if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi)) return "html"
} else return "html";
return "htmlifiedtext"
}
function c(a, b) {
function c(a) {
return CKEDITOR.tools.repeat("</p><p>", ~~(a / 2)) + (1 == a % 2 ? "<br>" : "")
}
b = b.replace(/\s+/g, " ").replace(/> +</g, "><").replace(/<br ?\/>/gi, "<br>");
b = b.replace(/<\/?[A-Z]+>/g, function(a) {
return a.toLowerCase()
});
if (b.match(/^[^<]$/)) return b;
CKEDITOR.env.webkit && -1 < b.indexOf("<div>") &&
(b = b.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g, "<br>").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g, "<div></div>"), b.match(/<div>(<br>|)<\/div>/) && (b = "<p>" + b.replace(/(<div>(<br>|)<\/div>)+/g, function(a) {
return c(a.split("</div><div>").length + 1)
}) + "</p>"), b = b.replace(/<\/div><div>/g, "<br>"), b = b.replace(/<\/?div>/g, ""));
if ((CKEDITOR.env.gecko || CKEDITOR.env.opera) && a.enterMode != CKEDITOR.ENTER_BR) CKEDITOR.env.gecko && (b = b.replace(/^<br><br>$/, "<br>")), -1 < b.indexOf("<br><br>") && (b = "<p>" +
b.replace(/(<br>){2,}/g, function(a) {
return c(a.length / 4)
}) + "</p>");
return e(a, b)
}
function a() {
var a = new CKEDITOR.htmlParser.filter,
b = {
blockquote: 1,
dl: 1,
fieldset: 1,
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1,
ol: 1,
p: 1,
table: 1,
ul: 1
},
c = CKEDITOR.tools.extend({
br: 0
}, CKEDITOR.dtd.$inline),
d = {
p: 1,
br: 1,
"cke:br": 1
},
e = CKEDITOR.dtd,
f = CKEDITOR.tools.extend({
area: 1,
basefont: 1,
embed: 1,
iframe: 1,
map: 1,
object: 1,
param: 1
}, CKEDITOR.dtd.$nonBodyContent, CKEDITOR.dtd.$cdata),
r = function(a) {
delete a.name;
a.add(new CKEDITOR.htmlParser.text(" "))
},
u = function(a) {
for (var b = a, c;
(b = b.next) && b.name && b.name.match(/^h\d$/);) {
c = new CKEDITOR.htmlParser.element("cke:br");
c.isEmpty = !0;
for (a.add(c); c = b.children.shift();) a.add(c)
}
};
a.addRules({
elements: {
h1: u,
h2: u,
h3: u,
h4: u,
h5: u,
h6: u,
img: function(a) {
a = CKEDITOR.tools.trim(a.attributes.alt || "");
var b = " ";
a && !a.match(/(^http|\.(jpe?g|gif|png))/i) && (b = " [" + a + "] ");
return new CKEDITOR.htmlParser.text(b)
},
td: r,
th: r,
$: function(a) {
var g = a.name,
r;
if (f[g]) return !1;
a.attributes = [];
if ("br" == g) return a;
if (b[g]) a.name =
"p";
else if (c[g]) delete a.name;
else if (e[g]) {
r = new CKEDITOR.htmlParser.element("cke:br");
r.isEmpty = !0;
if (CKEDITOR.dtd.$empty[g]) return r;
a.add(r, 0);
r = r.clone();
r.isEmpty = !0;
a.add(r);
delete a.name
}
d[a.name] || delete a.name;
return a
}
}
}, {
applyToAll: !0
});
return a
}
function b(a, b, c) {
b = new CKEDITOR.htmlParser.fragment.fromHtml(b);
var d = new CKEDITOR.htmlParser.basicWriter;
b.writeHtml(d, c);
b = d.getHtml();
b = b.replace(/\s*(<\/?[a-z:]+ ?\/?>)\s*/g, "$1").replace(/(<cke:br \/>){2,}/g, "<cke:br />").replace(/(<cke:br \/>)(<\/?p>|<br \/>)/g,
"$2").replace(/(<\/?p>|<br \/>)(<cke:br \/>)/g, "$1").replace(/<(cke:)?br( \/)?>/g, "<br>").replace(/<p><\/p>/g, "");
var f = 0;
b = b.replace(/<\/?p>/g, function(a) {
if ("<p>" == a) {
if (1 < ++f) return "</p><p>"
} else if (0 < --f) return "</p><p>";
return a
}).replace(/<p><\/p>/g, "");
return e(a, b)
}
function e(a, b) {
a.enterMode == CKEDITOR.ENTER_BR ? b = b.replace(/(<\/p><p>)+/g, function(a) {
return CKEDITOR.tools.repeat("<br>", 2 * (a.length / 7))
}).replace(/<\/?p>/g, "") : a.enterMode == CKEDITOR.ENTER_DIV && (b = b.replace(/<(\/)?p>/g, "<$1div>"));
return b
}
CKEDITOR.plugins.add("clipboard", {
requires: "dialog",
init: function(e) {
var k;
d(e);
e.on("paste", function(a) {
var b = a.data.dataValue,
c = CKEDITOR.dtd.$block; - 1 < b.indexOf("Apple-") && (b = b.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi, " "), "html" != a.data.type && (b = b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi, function(a, b) {
return b.replace(/\t/g, "&nbsp;&nbsp; &nbsp;")
})), -1 < b.indexOf('<br class="Apple-interchange-newline">') && (a.data.startsWithEOL = 1, a.data.preSniffing =
"html", b = b.replace(/<br class="Apple-interchange-newline">/, "")), b = b.replace(/(<[^>]+) class="Apple-[^"]*"/gi, "$1"));
if (b.match(/^<[^<]+cke_(editable|contents)/i)) {
var d, e, g = new CKEDITOR.dom.element("div");
for (g.setHtml(b); 1 == g.getChildCount() && (d = g.getFirst()) && d.type == CKEDITOR.NODE_ELEMENT && (d.hasClass("cke_editable") || d.hasClass("cke_contents"));) g = e = d;
e && (b = e.getHtml().replace(/<br>$/i, ""))
}
CKEDITOR.env.ie ? b = b.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g, function(b, d) {
return d.toLowerCase() in c ? (a.data.preSniffing =
"html", "<" + d) : b
}) : CKEDITOR.env.webkit ? b = b.replace(/<\/(\w+)><div><br><\/div>$/, function(b, d) {
return d in c ? (a.data.endsWithEOL = 1, "</" + d + ">") : b
}) : CKEDITOR.env.gecko && (b = b.replace(/(\s)<br>$/, "$1"));
a.data.dataValue = b
}, null, null, 3);
e.on("paste", function(d) {
d = d.data;
var l = d.type,
n = d.dataValue,
q, r = e.config.clipboard_defaultContentType || "html";
q = "html" == l || "html" == d.preSniffing ? "html" : f(n);
"htmlifiedtext" == q ? n = c(e.config, n) : "text" == l && "html" == q && (n = b(e.config, n, k || (k = a(e))));
d.startsWithEOL && (n = '<br data-cke-eol="1">' +
n);
d.endsWithEOL && (n += '<br data-cke-eol="1">');
"auto" == l && (l = "html" == q || "html" == r ? "html" : "text");
d.type = l;
d.dataValue = n;
delete d.preSniffing;
delete d.startsWithEOL;
delete d.endsWithEOL
}, null, null, 6);
e.on("paste", function(a) {
a = a.data;
e.insertHtml(a.dataValue, a.type);
setTimeout(function() {
e.fire("afterPaste")
}, 0)
}, null, null, 1E3);
e.on("pasteDialog", function(a) {
setTimeout(function() {
e.openDialog("paste", a.data)
}, 0)
})
}
})
}(),
function() {
var d = '<a id="{id}" class="cke_button cke_button__{name} cke_button_{state} {cls}"' +
(CKEDITOR.env.gecko && 10900 <= CKEDITOR.env.version && !CKEDITOR.env.hc ? "" : '" href="javascript:void(\'{titleJs}\')"') + ' title="{title}" tabindex="-1" hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="{hasArrow}"';
if (CKEDITOR.env.opera || CKEDITOR.env.gecko && CKEDITOR.env.mac) d += ' onkeypress="return false;"';
CKEDITOR.env.gecko && (d += ' onblur="this.style.cssText = this.style.cssText;"');
var d = d + (' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" onmousedown="return CKEDITOR.tools.callFunction({mousedownFn},event);" ' +
(CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick") + '="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span class="cke_button_icon cke_button__{iconName}_icon" style="{style}"'),
d = d + '>&nbsp;</span><span id="{id}_label" class="cke_button_label cke_button__{name}_label" aria-hidden="false">{label}</span>{arrowHtml}</a>',
f = CKEDITOR.addTemplate("buttonArrow", '<span class="cke_button_arrow">' + (CKEDITOR.env.hc ? "&#9660;" : "") + "</span>"),
c = CKEDITOR.addTemplate("button", d);
CKEDITOR.plugins.add("button", {
beforeInit: function(a) {
a.ui.addHandler(CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler)
}
});
CKEDITOR.UI_BUTTON = "button";
CKEDITOR.ui.button = function(a) {
CKEDITOR.tools.extend(this, a, {
title: a.label,
click: a.click || function(b) {
b.execCommand(a.command)
}
});
this._ = {}
};
CKEDITOR.ui.button.handler = {
create: function(a) {
return new CKEDITOR.ui.button(a)
}
};
CKEDITOR.ui.button.prototype = {
render: function(a, b) {
var d = CKEDITOR.env,
g = this._.id = CKEDITOR.tools.getNextId(),
k = "",
h = this.command,
l;
this._.editor = a;
var n = {
id: g,
button: this,
editor: a,
focus: function() {
CKEDITOR.document.getById(g).focus()
},
execute: function() {
this.button.click(a)
},
attach: function(a) {
this.button.attach(a)
}
},
q = CKEDITOR.tools.addFunction(function(a) {
if (n.onkey) return a = new CKEDITOR.dom.event(a), !1 !== n.onkey(n, a.getKeystroke())
}),
r = CKEDITOR.tools.addFunction(function(a) {
var b;
n.onfocus && (b = !1 !== n.onfocus(n, new CKEDITOR.dom.event(a)));
CKEDITOR.env.gecko && 10900 > CKEDITOR.env.version && a.preventBubble();
return b
}),
u = 0,
m = CKEDITOR.tools.addFunction(function() {
if (CKEDITOR.env.opera) {
var b =
a.editable();
b.isInline() && b.hasFocus && (a.lockSelection(), u = 1)
}
});
n.clickFn = l = CKEDITOR.tools.addFunction(function() {
u && (a.unlockSelection(1), u = 0);
n.execute()
});
if (this.modes) {
var p = {},
w = function() {
var b = a.mode;
b && (b = this.modes[b] ? void 0 != p[b] ? p[b] : CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, b = a.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : b, this.setState(b), this.refresh && this.refresh())
};
a.on("beforeModeUnload", function() {
a.mode && this._.state != CKEDITOR.TRISTATE_DISABLED && (p[a.mode] = this._.state)
},
this);
a.on("activeFilterChange", w, this);
a.on("mode", w, this);
!this.readOnly && a.on("readOnly", w, this)
} else if (h && (h = a.getCommand(h))) h.on("state", function() {
this.setState(h.state)
}, this), k += h.state == CKEDITOR.TRISTATE_ON ? "on" : h.state == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off";
if (this.directional) a.on("contentDirChanged", function(b) {
var c = CKEDITOR.document.getById(this._.id),
d = c.getFirst();
b = b.data;
b != a.lang.dir ? c.addClass("cke_" + b) : c.removeClass("cke_ltr").removeClass("cke_rtl");
d.setAttribute("style",
CKEDITOR.skin.getIconStyle(t, "rtl" == b, this.icon, this.iconOffset))
}, this);
h || (k += "off");
var t = w = this.name || this.command;
this.icon && !/\./.test(this.icon) && (t = this.icon, this.icon = null);
d = {
id: g,
name: w,
iconName: t,
label: this.label,
cls: this.className || "",
state: k,
title: this.title,
titleJs: d.gecko && 10900 <= d.version && !d.hc ? "" : (this.title || "").replace("'", ""),
hasArrow: this.hasArrow ? "true" : "false",
keydownFn: q,
mousedownFn: m,
focusFn: r,
clickFn: l,
style: CKEDITOR.skin.getIconStyle(t, "rtl" == a.lang.dir, this.icon, this.iconOffset),
arrowHtml: this.hasArrow ? f.output() : ""
};
c.output(d, b);
if (this.onRender) this.onRender();
return n
},
setState: function(a) {
if (this._.state == a) return !1;
this._.state = a;
var b = CKEDITOR.document.getById(this._.id);
return b ? (b.setState(a, "cke_button"), a == CKEDITOR.TRISTATE_DISABLED ? b.setAttribute("aria-disabled", !0) : b.removeAttribute("aria-disabled"), a == CKEDITOR.TRISTATE_ON ? b.setAttribute("aria-pressed", !0) : b.removeAttribute("aria-pressed"), !0) : !1
},
getState: function() {
return this._.state
},
toFeature: function(a) {
if (this._.feature) return this._.feature;
var b = this;
!this.allowedContent && !this.requiredContent && this.command && (b = a.getCommand(this.command) || b);
return this._.feature = b
}
};
CKEDITOR.ui.prototype.addButton = function(a, b) {
this.add(a, CKEDITOR.UI_BUTTON, b)
}
}(),
function() {
function d(a) {
function c() {
for (var e = d(), h = CKEDITOR.tools.clone(a.config.toolbarGroups) || f(a), l = 0; l < h.length; l++) {
var m = h[l];
if ("/" != m) {
"string" == typeof m && (m = h[l] = {
name: m
});
var n, w = m.groups;
if (w)
for (var t = 0; t < w.length; t++) n = w[t], (n = e[n]) && k(m, n);
(n = e[m.name]) && k(m, n)
}
}
return h
}
function d() {
var c = {},
e, g, h;
for (e in a.ui.items) g = a.ui.items[e], h = g.toolbar || "others", h = h.split(","), g = h[0], h = parseInt(h[1] || -1, 10), c[g] || (c[g] = []), c[g].push({
name: e,
order: h
});
for (g in c) c[g] = c[g].sort(function(a, b) {
return a.order == b.order ? 0 : 0 > b.order ? -1 : 0 > a.order ? 1 : a.order < b.order ? -1 : 1
});
return c
}
function k(c, d) {
if (d.length) {
c.items ? c.items.push(a.ui.create("-")) : c.items = [];
for (var e; e = d.shift();)
if (e = "string" == typeof e ? e : e.name, !l || -1 == CKEDITOR.tools.indexOf(l, e))(e = a.ui.create(e)) && a.addFeature(e) &&
c.items.push(e)
}
}
function h(a) {
var b = [],
c, d, e;
for (c = 0; c < a.length; ++c) d = a[c], e = {}, "/" == d ? b.push(d) : CKEDITOR.tools.isArray(d) ? (k(e, CKEDITOR.tools.clone(d)), b.push(e)) : d.items && (k(e, CKEDITOR.tools.clone(d.items)), e.name = d.name, b.push(e));
return b
}
var l = a.config.removeButtons,
l = l && l.split(","),
n = a.config.toolbar;
"string" == typeof n && (n = a.config["toolbar_" + n]);
return a.toolbar = n ? h(n) : c()
}
function f(a) {
return a._.toolbarGroups || (a._.toolbarGroups = [{
name: "document",
groups: ["mode", "document", "doctools"]
}, {
name: "clipboard",
groups: ["clipboard", "undo"]
}, {
name: "editing",
groups: ["find", "selection", "spellchecker"]
}, {
name: "forms"
}, "/", {
name: "basicstyles",
groups: ["basicstyles", "cleanup"]
}, {
name: "paragraph",
groups: ["list", "indent", "blocks", "align", "bidi"]
}, {
name: "links"
}, {
name: "insert"
}, "/", {
name: "styles"
}, {
name: "colors"
}, {
name: "tools"
}, {
name: "others"
}, {
name: "about"
}])
}
var c = function() {
this.toolbars = [];
this.focusCommandExecuted = !1
};
c.prototype.focus = function() {
for (var a = 0, c; c = this.toolbars[a++];)
for (var d =
0, k; k = c.items[d++];)
if (k.focus) {
k.focus();
return
}
};
var a = {
modes: {
wysiwyg: 1,
source: 1
},
readOnly: 1,
exec: function(a) {
a.toolbox && (a.toolbox.focusCommandExecuted = !0, CKEDITOR.env.ie || CKEDITOR.env.air ? setTimeout(function() {
a.toolbox.focus()
}, 100) : a.toolbox.focus())
}
};
CKEDITOR.plugins.add("toolbar", {
requires: "button",
init: function(b) {
var e, g = function(a, c) {
var d, f = "rtl" == b.lang.dir,
q = b.config.toolbarGroupCycling,
q = void 0 === q || q;
switch (c) {
case 9:
case CKEDITOR.SHIFT + 9:
for (; !d || !d.items.length;)
if (d = 9 == c ? (d ? d.next :
a.toolbar.next) || b.toolbox.toolbars[0] : (d ? d.previous : a.toolbar.previous) || b.toolbox.toolbars[b.toolbox.toolbars.length - 1], d.items.length)
for (a = d.items[e ? d.items.length - 1 : 0]; a && !a.focus;)(a = e ? a.previous : a.next) || (d = 0);
a && a.focus();
return !1;
case f ? 37:
39:
case 40:
d = a;
do d = d.next, !d && q && (d = a.toolbar.items[0]); while (d && !d.focus);
d ? d.focus() : g(a, 9);
return !1;
case f ? 39:
37:
case 38:
d = a;
do d = d.previous, !d && q && (d = a.toolbar.items[a.toolbar.items.length - 1]); while (d && !d.focus);
d ? d.focus() : (e = 1, g(a, CKEDITOR.SHIFT +
9), e = 0);
return !1;
case 27:
return b.focus(), !1;
case 13:
case 32:
return a.execute(), !1
}
return !0
};
b.on("uiSpace", function(a) {
if (a.data.space == b.config.toolbarLocation) {
a.removeListener();
b.toolbox = new c;
var e = CKEDITOR.tools.getNextId(),
f = ['<span id="', e, '" class="cke_voice_label">', b.lang.toolbar.toolbars, "</span>", '<span id="' + b.ui.spaceId("toolbox") + '" class="cke_toolbox" role="group" aria-labelledby="', e, '" onmousedown="return false;">'],
e = !1 !== b.config.toolbarStartupExpanded,
n, q;
b.config.toolbarCanCollapse &&
b.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && f.push('<span class="cke_toolbox_main"' + (e ? ">" : ' style="display:none">'));
for (var r = b.toolbox.toolbars, u = d(b), m = 0; m < u.length; m++) {
var p, w = 0,
t, x = u[m],
y;
if (x)
if (n && (f.push("</span>"), q = n = 0), "/" === x) f.push('<span class="cke_toolbar_break"></span>');
else {
y = x.items || x;
for (var z = 0; z < y.length; z++) {
var C = y[z],
s;
if (C)
if (C.type == CKEDITOR.UI_SEPARATOR) q = n && C;
else {
s = !1 !== C.canGroup;
if (!w) {
p = CKEDITOR.tools.getNextId();
w = {
id: p,
items: []
};
t = x.name && (b.lang.toolbar.toolbarGroups[x.name] ||
x.name);
f.push('<span id="', p, '" class="cke_toolbar"', t ? ' aria-labelledby="' + p + '_label"' : "", ' role="toolbar">');
t && f.push('<span id="', p, '_label" class="cke_voice_label">', t, "</span>");
f.push('<span class="cke_toolbar_start"></span>');
var v = r.push(w) - 1;
0 < v && (w.previous = r[v - 1], w.previous.next = w)
}
s ? n || (f.push('<span class="cke_toolgroup" role="presentation">'), n = 1) : n && (f.push("</span>"), n = 0);
p = function(a) {
a = a.render(b, f);
v = w.items.push(a) - 1;
0 < v && (a.previous = w.items[v - 1], a.previous.next = a);
a.toolbar =
w;
a.onkey = g;
a.onfocus = function() {
b.toolbox.focusCommandExecuted || b.focus()
}
};
q && (p(q), q = 0);
p(C)
}
}
n && (f.push("</span>"), q = n = 0);
w && f.push('<span class="cke_toolbar_end"></span></span>')
}
}
b.config.toolbarCanCollapse && f.push("</span>");
if (b.config.toolbarCanCollapse && b.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
var G = CKEDITOR.tools.addFunction(function() {
b.execCommand("toolbarCollapse")
});
b.on("destroy", function() {
CKEDITOR.tools.removeFunction(G)
});
b.addCommand("toolbarCollapse", {
readOnly: 1,
exec: function(a) {
var b =
a.ui.space("toolbar_collapser"),
c = b.getPrevious(),
d = a.ui.space("contents"),
e = c.getParent(),
g = parseInt(d.$.style.height, 10),
h = e.$.offsetHeight,
f = b.hasClass("cke_toolbox_collapser_min");
f ? (c.show(), b.removeClass("cke_toolbox_collapser_min"), b.setAttribute("title", a.lang.toolbar.toolbarCollapse)) : (c.hide(), b.addClass("cke_toolbox_collapser_min"), b.setAttribute("title", a.lang.toolbar.toolbarExpand));
b.getFirst().setText(f ? "\u25b2" : "\u25c0");
d.setStyle("height", g - (e.$.offsetHeight - h) + "px");
a.fire("resize")
},
modes: {
wysiwyg: 1,
source: 1
}
});
b.setKeystroke(CKEDITOR.ALT + (CKEDITOR.env.ie || CKEDITOR.env.webkit ? 189 : 109), "toolbarCollapse");
f.push('<a title="' + (e ? b.lang.toolbar.toolbarCollapse : b.lang.toolbar.toolbarExpand) + '" id="' + b.ui.spaceId("toolbar_collapser") + '" tabIndex="-1" class="cke_toolbox_collapser');
e || f.push(" cke_toolbox_collapser_min");
f.push('" onclick="CKEDITOR.tools.callFunction(' + G + ')">', '<span class="cke_arrow">&#9650;</span>', "</a>")
}
f.push("</span>");
a.data.html += f.join("")
}
});
b.on("destroy",
function() {
if (this.toolbox) {
var a, b = 0,
c, d, e;
for (a = this.toolbox.toolbars; b < a.length; b++) {
d = a[b].items;
for (c = 0; c < d.length; c++) e = d[c], e.clickFn && CKEDITOR.tools.removeFunction(e.clickFn), e.keyDownFn && CKEDITOR.tools.removeFunction(e.keyDownFn)
}
}
});
b.on("uiReady", function() {
var a = b.ui.space("toolbox");
a && b.focusManager.add(a, 1)
});
b.addCommand("toolbarFocus", a);
b.setKeystroke(CKEDITOR.ALT + 121, "toolbarFocus");
b.ui.add("-", CKEDITOR.UI_SEPARATOR, {});
b.ui.addHandler(CKEDITOR.UI_SEPARATOR, {
create: function() {
return {
render: function(a,
b) {
b.push('<span class="cke_toolbar_separator" role="separator"></span>');
return {}
}
}
}
})
}
});
CKEDITOR.ui.prototype.addToolbarGroup = function(a, c, d) {
var k = f(this.editor),
h = 0 === c,
l = {
name: a
};
if (d) {
if (d = CKEDITOR.tools.search(k, function(a) {
return a.name == d
})) {
!d.groups && (d.groups = []);
if (c && (c = CKEDITOR.tools.indexOf(d.groups, c), 0 <= c)) {
d.groups.splice(c + 1, 0, a);
return
}
h ? d.groups.splice(0, 0, a) : d.groups.push(a);
return
}
c = null
}
c && (c = CKEDITOR.tools.indexOf(k, function(a) {
return a.name == c
}));
h ? k.splice(0, 0, a) : "number" ==
typeof c ? k.splice(c + 1, 0, l) : k.push(a)
}
}(), CKEDITOR.UI_SEPARATOR = "separator", CKEDITOR.config.toolbarLocation = "top",
function() {
function d(a, b, c) {
c = a.config.forceEnterMode || c;
"wysiwyg" == a.mode && (b || (b = a.activeEnterMode), a.elementPath().isContextFor("p") || (b = CKEDITOR.ENTER_BR, c = 1), a.fire("saveSnapshot"), b == CKEDITOR.ENTER_BR ? e(a, b, null, c) : g(a, b, null, c), a.fire("saveSnapshot"))
}
function f(a) {
a = a.getSelection().getRanges(!0);
for (var b = a.length - 1; 0 < b; b--) a[b].deleteContents();
return a[0]
}
CKEDITOR.plugins.add("enterkey", {
init: function(a) {
a.addCommand("enter", {
modes: {
wysiwyg: 1
},
editorFocus: !1,
exec: function(a) {
d(a)
}
});
a.addCommand("shiftEnter", {
modes: {
wysiwyg: 1
},
editorFocus: !1,
exec: function(a) {
d(a, a.activeShiftEnterMode, 1)
}
});
a.setKeystroke([
[13, "enter"],
[CKEDITOR.SHIFT + 13, "shiftEnter"]
])
}
});
var c = CKEDITOR.dom.walker.whitespaces(),
a = CKEDITOR.dom.walker.bookmark();
CKEDITOR.plugins.enterkey = {
enterBlock: function(b, d, g, q) {
if (g = g || f(b)) {
var r = g.document,
u = g.checkStartOfBlock(),
m = g.checkEndOfBlock(),
p = b.elementPath(g.startContainer).block,
w = d == CKEDITOR.ENTER_DIV ? "div" : "p",
t;
if (u && m) {
if (p && (p.is("li") || p.getParent().is("li"))) {
g = p.getParent();
t = g.getParent();
q = !p.hasPrevious();
var x = !p.hasNext(),
w = b.getSelection(),
y = w.createBookmarks(),
u = p.getDirection(1),
m = p.getAttribute("class"),
z = p.getAttribute("style"),
C = t.getDirection(1) != u;
b = b.enterMode != CKEDITOR.ENTER_BR || C || z || m;
if (t.is("li"))
if (q || x) p[q ? "insertBefore" : "insertAfter"](t);
else p.breakParent(t);
else {
if (b)
if (t = r.createElement(d == CKEDITOR.ENTER_P ? "p" : "div"), C && t.setAttribute("dir",
u), z && t.setAttribute("style", z), m && t.setAttribute("class", m), p.moveChildren(t), q || x) t[q ? "insertBefore" : "insertAfter"](g);
else p.breakParent(g), t.insertAfter(g);
else if (p.appendBogus(!0), q || x)
for (; r = p[q ? "getFirst" : "getLast"]();) r[q ? "insertBefore" : "insertAfter"](g);
else
for (p.breakParent(g); r = p.getLast();) r.insertAfter(g);
p.remove()
}
w.selectBookmarks(y);
return
}
if (p && p.getParent().is("blockquote")) {
p.breakParent(p.getParent());
p.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1)) || p.getPrevious().remove();
p.getNext().getFirst(CKEDITOR.dom.walker.invisible(1)) || p.getNext().remove();
g.moveToElementEditStart(p);
g.select();
return
}
} else if (p && p.is("pre") && !m) {
e(b, d, g, q);
return
}
if (m = g.splitBlock(w)) {
d = m.previousBlock;
p = m.nextBlock;
b = m.wasStartOfBlock;
u = m.wasEndOfBlock;
if (p) y = p.getParent(), y.is("li") && (p.breakParent(y), p.move(p.getNext(), 1));
else if (d && (y = d.getParent()) && y.is("li")) d.breakParent(y), y = d.getNext(), g.moveToElementEditStart(y), d.move(d.getPrevious());
if (!b && !u) p.is("li") && (t = g.clone(), t.selectNodeContents(p),
t = new CKEDITOR.dom.walker(t), t.evaluator = function(b) {
return !(a(b) || c(b) || b.type == CKEDITOR.NODE_ELEMENT && b.getName() in CKEDITOR.dtd.$inline && !(b.getName() in CKEDITOR.dtd.$empty))
}, (y = t.next()) && y.type == CKEDITOR.NODE_ELEMENT && y.is("ul", "ol") && (CKEDITOR.env.needsBrFiller ? r.createElement("br") : r.createText("\u00a0")).insertBefore(y)), p && g.moveToElementEditStart(p);
else {
if (d) {
if (d.is("li") || !k.test(d.getName()) && !d.is("pre")) t = d.clone()
} else p && (t = p.clone());
t ? q && !t.is("li") && t.renameNode(w) : y && y.is("li") ?
t = y : (t = r.createElement(w), d && (x = d.getDirection()) && t.setAttribute("dir", x));
if (r = m.elementPath) {
q = 0;
for (w = r.elements.length; q < w; q++) {
y = r.elements[q];
if (y.equals(r.block) || y.equals(r.blockLimit)) break;
CKEDITOR.dtd.$removeEmpty[y.getName()] && (y = y.clone(), t.moveChildren(y), t.append(y))
}
}
t.appendBogus();
t.getParent() || g.insertNode(t);
t.is("li") && t.removeAttribute("value");
if (CKEDITOR.env.ie && b && (!u || !d.getChildCount())) g.moveToElementEditStart(u ? d : t), g.select();
g.moveToElementEditStart(b && !u ? p : t)
}
g.select();
g.scrollIntoView()
}
}
},
enterBr: function(a, b, c, d) {
if (c = c || f(a)) {
var e = c.document,
u = c.checkEndOfBlock(),
m = new CKEDITOR.dom.elementPath(a.getSelection().getStartElement()),
p = m.block,
m = p && m.block.getName();
!d && "li" == m ? g(a, b, c, d) : (!d && u && k.test(m) ? (u = p.getDirection()) ? (e = e.createElement("div"), e.setAttribute("dir", u), e.insertAfter(p), c.setStart(e, 0)) : (e.createElement("br").insertAfter(p), CKEDITOR.env.gecko && e.createText("").insertAfter(p), c.setStartAt(p.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START :
CKEDITOR.POSITION_AFTER_START)) : (p = "pre" == m && CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? e.createText("\r") : e.createElement("br"), c.deleteContents(), c.insertNode(p), CKEDITOR.env.needsBrFiller ? (e.createText("\ufeff").insertAfter(p), u && p.getParent().appendBogus(), p.getNext().$.nodeValue = "", c.setStartAt(p.getNext(), CKEDITOR.POSITION_AFTER_START)) : c.setStartAt(p, CKEDITOR.POSITION_AFTER_END)), c.collapse(!0), c.select(), c.scrollIntoView())
}
}
};
var b = CKEDITOR.plugins.enterkey,
e = b.enterBr,
g = b.enterBlock,
k = /^h[1-6]$/
}(),
function() {
CKEDITOR.plugins.add("panel", {
beforeInit: function(a) {
a.ui.addHandler(CKEDITOR.UI_PANEL, CKEDITOR.ui.panel.handler)
}
});
CKEDITOR.UI_PANEL = "panel";
CKEDITOR.ui.panel = function(a, b) {
b && CKEDITOR.tools.extend(this, b);
CKEDITOR.tools.extend(this, {
className: "",
css: []
});
this.id = CKEDITOR.tools.getNextId();
this.document = a;
this.isFramed = this.forceIFrame || this.css.length;
this._ = {
blocks: {}
}
};
CKEDITOR.ui.panel.handler = {
create: function(a) {
return new CKEDITOR.ui.panel(a)
}
};
var d = CKEDITOR.addTemplate("panel",
'<div lang="{langCode}" id="{id}" dir={dir} class="cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style="z-index:{z-index}" role="presentation">{frame}</div>'),
f = CKEDITOR.addTemplate("panel-frame", '<iframe id="{id}" class="cke_panel_frame" role="presentation" frameborder="0" src="{src}"></iframe>'),
c = CKEDITOR.addTemplate("panel-frame-inner", '<!DOCTYPE html><html class="cke_panel_container {env}" dir="{dir}" lang="{langCode}"><head>{css}</head><body class="cke_{dir}" style="margin:0;padding:0" onload="{onload}"></body></html>');
CKEDITOR.ui.panel.prototype = {
render: function(a, b) {
this.getHolderElement = function() {
var a = this._.holder;
if (!a) {
if (this.isFramed) {
var a = this.document.getById(this.id + "_frame"),
b = a.getParent(),
a = a.getFrameDocument();
CKEDITOR.env.iOS && b.setStyles({
overflow: "scroll",
"-webkit-overflow-scrolling": "touch"
});
b = CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function() {
this.isLoaded = !0;
if (this.onLoad) this.onLoad()
}, this));
a.write(c.output(CKEDITOR.tools.extend({
css: CKEDITOR.tools.buildStyleHtml(this.css),
onload: "window.parent.CKEDITOR.tools.callFunction(" +
b + ");"
}, e)));
a.getWindow().$.CKEDITOR = CKEDITOR;
a.on("key" + (CKEDITOR.env.opera ? "press" : "down"), function(a) {
var b = a.data.getKeystroke(),
c = this.document.getById(this.id).getAttribute("dir");
this._.onKeyDown && !1 === this._.onKeyDown(b) ? a.data.preventDefault() : (27 == b || b == ("rtl" == c ? 39 : 37)) && this.onEscape && !1 === this.onEscape(b) && a.data.preventDefault()
}, this);
a = a.getBody();
a.unselectable();
CKEDITOR.env.air && CKEDITOR.tools.callFunction(b)
} else a = this.document.getById(this.id);
this._.holder = a
}
return a
};
var e = {
editorId: a.id,
id: this.id,
langCode: a.langCode,
dir: a.lang.dir,
cls: this.className,
frame: "",
env: CKEDITOR.env.cssClass,
"z-index": a.config.baseFloatZIndex + 1
};
if (this.isFramed) {
var g = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie ? "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())" : "";
e.frame = f.output({
id: this.id + "_frame",
src: g
})
}
g = d.output(e);
b && b.push(g);
return g
},
addBlock: function(a, b) {
b = this._.blocks[a] = b instanceof CKEDITOR.ui.panel.block ?
b : new CKEDITOR.ui.panel.block(this.getHolderElement(), b);
this._.currentBlock || this.showBlock(a);
return b
},
getBlock: function(a) {
return this._.blocks[a]
},
showBlock: function(a) {
a = this._.blocks[a];
var b = this._.currentBlock,
c = !this.forceIFrame || CKEDITOR.env.ie ? this._.holder : this.document.getById(this.id + "_frame");
b && b.hide();
this._.currentBlock = a;
CKEDITOR.fire("ariaWidget", c);
a._.focusIndex = -1;
this._.onKeyDown = a.onKeyDown && CKEDITOR.tools.bind(a.onKeyDown, a);
a.show();
return a
},
destroy: function() {
this.element &&
this.element.remove()
}
};
CKEDITOR.ui.panel.block = CKEDITOR.tools.createClass({
$: function(a, b) {
this.element = a.append(a.getDocument().createElement("div", {
attributes: {
tabindex: -1,
"class": "cke_panel_block"
},
styles: {
display: "none"
}
}));
b && CKEDITOR.tools.extend(this, b);
this.element.setAttributes({
role: this.attributes.role || "presentation",
"aria-label": this.attributes["aria-label"],
title: this.attributes.title || this.attributes["aria-label"]
});
this.keys = {};
this._.focusIndex = -1;
this.element.disableContextMenu()
},
_: {
markItem: function(a) {
-1 != a && (a = this.element.getElementsByTag("a").getItem(this._.focusIndex = a), (CKEDITOR.env.webkit || CKEDITOR.env.opera) && a.getDocument().getWindow().focus(), a.focus(), this.onMark && this.onMark(a))
}
},
proto: {
show: function() {
this.element.setStyle("display", "")
},
hide: function() {
(!this.onHide || !0 !== this.onHide.call(this)) && this.element.setStyle("display", "none")
},
onKeyDown: function(a) {
var b = this.keys[a];
switch (b) {
case "next":
a = this._.focusIndex;
for (var b = this.element.getElementsByTag("a"),
c; c = b.getItem(++a);)
if (c.getAttribute("_cke_focus") && c.$.offsetWidth) {
this._.focusIndex = a;
c.focus();
break
}
return !1;
case "prev":
a = this._.focusIndex;
for (b = this.element.getElementsByTag("a"); 0 < a && (c = b.getItem(--a));)
if (c.getAttribute("_cke_focus") && c.$.offsetWidth) {
this._.focusIndex = a;
c.focus();
break
}
return !1;
case "click":
case "mouseup":
return a = this._.focusIndex, (c = 0 <= a && this.element.getElementsByTag("a").getItem(a)) && (c.$[b] ? c.$[b]() : c.$["on" + b]()), !1
}
return !0
}
}
})
}(), CKEDITOR.plugins.add("floatpanel", {
requires: "panel"
}),
function() {
function d(c, a, b, d, g) {
g = CKEDITOR.tools.genKey(a.getUniqueId(), b.getUniqueId(), c.lang.dir, c.uiColor || "", d.css || "", g || "");
var k = f[g];
k || (k = f[g] = new CKEDITOR.ui.panel(a, d), k.element = b.append(CKEDITOR.dom.element.createFromHtml(k.render(c), a)), k.element.setStyles({
display: "none",
position: "absolute"
}));
return k
}
var f = {};
CKEDITOR.ui.floatPanel = CKEDITOR.tools.createClass({
$: function(c, a, b, e) {
function g() {
n.hide()
}
b.forceIFrame = 1;
b.toolbarRelated && c.elementMode == CKEDITOR.ELEMENT_MODE_INLINE &&
(a = CKEDITOR.document.getById("cke_" + c.name));
var f = a.getDocument();
e = d(c, f, a, b, e || 0);
var h = e.element,
l = h.getFirst(),
n = this;
h.disableContextMenu();
this.element = h;
this._ = {
editor: c,
panel: e,
parentElement: a,
definition: b,
document: f,
iframe: l,
children: [],
dir: c.lang.dir
};
c.on("mode", g);
c.on("resize", g);
f.getWindow().on("resize", g)
},
proto: {
addBlock: function(c, a) {
return this._.panel.addBlock(c, a)
},
addListBlock: function(c, a) {
return this._.panel.addListBlock(c, a)
},
getBlock: function(c) {
return this._.panel.getBlock(c)
},
showBlock: function(c, a, b, d, g, f) {
var h = this._.panel,
l = h.showBlock(c);
this.allowBlur(!1);
c = this._.editor.editable();
this._.returnFocus = c.hasFocus ? c : new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);
var n = this.element;
c = this._.iframe;
c = CKEDITOR.env.ie ? c : new CKEDITOR.dom.window(c.$.contentWindow);
var q = n.getDocument(),
r = this._.parentElement.getPositionedAncestor(),
u = a.getDocumentPosition(q),
q = r ? r.getDocumentPosition(q) : {
x: 0,
y: 0
},
m = "rtl" == this._.dir,
p = u.x + (d || 0) - q.x,
w = u.y + (g || 0) - q.y;
if (m && (1 ==
b || 4 == b)) p += a.$.offsetWidth;
else if (!m && (2 == b || 3 == b)) p += a.$.offsetWidth - 1;
if (3 == b || 4 == b) w += a.$.offsetHeight - 1;
this._.panel._.offsetParentId = a.getId();
n.setStyles({
top: w + "px",
left: 0,
display: ""
});
n.setOpacity(0);
n.getFirst().removeStyle("width");
this._.editor.focusManager.add(c);
this._.blurSet || (CKEDITOR.event.useCapture = !0, c.on("blur", function(a) {
this.allowBlur() && (a.data.getPhase() == CKEDITOR.EVENT_PHASE_AT_TARGET && this.visible && !this._.activeChild) && (delete this._.returnFocus, this.hide())
}, this),
c.on("focus", function() {
this._.focused = !0;
this.hideChild();
this.allowBlur(!0)
}, this), CKEDITOR.event.useCapture = !1, this._.blurSet = 1);
h.onEscape = CKEDITOR.tools.bind(function(a) {
if (this.onEscape && !1 === this.onEscape(a)) return !1
}, this);
CKEDITOR.tools.setTimeout(function() {
var a = CKEDITOR.tools.bind(function() {
n.removeStyle("width");
if (l.autoSize) {
var a = l.element.getDocument(),
a = (CKEDITOR.env.webkit ? l.element : a.getBody()).$.scrollWidth;
CKEDITOR.env.ie && CKEDITOR.env.quirks && 0 < a && (a += (n.$.offsetWidth || 0) -
(n.$.clientWidth || 0) + 3);
n.setStyle("width", a + 10 + "px");
a = l.element.$.scrollHeight;
CKEDITOR.env.ie && CKEDITOR.env.quirks && 0 < a && (a += (n.$.offsetHeight || 0) - (n.$.clientHeight || 0) + 3);
n.setStyle("height", a + "px");
h._.currentBlock.element.setStyle("display", "none").removeStyle("display")
} else n.removeStyle("height");
m && (p -= n.$.offsetWidth);
n.setStyle("left", p + "px");
var b = h.element.getWindow(),
a = n.$.getBoundingClientRect(),
b = b.getViewPaneSize(),
c = a.width || a.right - a.left,
d = a.height || a.bottom - a.top,
e = m ? a.right :
b.width - a.left,
g = m ? b.width - a.right : a.left;
m ? e < c && (p = g > c ? p + c : b.width > c ? p - a.left : p - a.right + b.width) : e < c && (p = g > c ? p - c : b.width > c ? p - a.right + b.width : p - a.left);
c = a.top;
b.height - a.top < d && (w = c > d ? w - d : b.height > d ? w - a.bottom + b.height : w - a.top);
CKEDITOR.env.ie && (b = a = new CKEDITOR.dom.element(n.$.offsetParent), "html" == b.getName() && (b = b.getDocument().getBody()), "rtl" == b.getComputedStyle("direction") && (p = CKEDITOR.env.ie8Compat ? p - 2 * n.getDocument().getDocumentElement().$.scrollLeft : p - (a.$.scrollWidth - a.$.clientWidth)));
var a = n.getFirst(),
q;
(q = a.getCustomData("activePanel")) && q.onHide && q.onHide.call(this, 1);
a.setCustomData("activePanel", this);
n.setStyles({
top: w + "px",
left: p + "px"
});
n.setOpacity(1);
f && f()
}, this);
h.isLoaded ? a() : h.onLoad = a;
CKEDITOR.tools.setTimeout(function() {
var a = CKEDITOR.env.webkit && CKEDITOR.document.getWindow().getScrollPosition().y;
this.focus();
l.element.focus();
CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = a);
this.allowBlur(!0);
this._.editor.fire("panelShow", this)
}, 0, this)
}, CKEDITOR.env.air ?
200 : 0, this);
this.visible = 1;
this.onShow && this.onShow.call(this)
},
focus: function() {
if (CKEDITOR.env.webkit) {
var c = CKEDITOR.document.getActive();
!c.equals(this._.iframe) && c.$.blur()
}(this._.lastFocused || this._.iframe.getFrameDocument().getWindow()).focus()
},
blur: function() {
var c = this._.iframe.getFrameDocument().getActive();
c.is("a") && (this._.lastFocused = c)
},
hide: function(c) {
if (this.visible && (!this.onHide || !0 !== this.onHide.call(this))) {
this.hideChild();
CKEDITOR.env.gecko && this._.iframe.getFrameDocument().$.activeElement.blur();
this.element.setStyle("display", "none");
this.visible = 0;
this.element.getFirst().removeCustomData("activePanel");
if (c = c && this._.returnFocus) CKEDITOR.env.webkit && c.type && c.getWindow().$.focus(), c.focus();
delete this._.lastFocused;
this._.editor.fire("panelHide", this)
}
},
allowBlur: function(c) {
var a = this._.panel;
void 0 != c && (a.allowBlur = c);
return a.allowBlur
},
showAsChild: function(c, a, b, d, g, f) {
this._.activeChild == c && c._.panel._.offsetParentId == b.getId() || (this.hideChild(), c.onHide = CKEDITOR.tools.bind(function() {
CKEDITOR.tools.setTimeout(function() {
this._.focused ||
this.hide()
}, 0, this)
}, this), this._.activeChild = c, this._.focused = !1, c.showBlock(a, b, d, g, f), this.blur(), (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) && setTimeout(function() {
c.element.getChild(0).$.style.cssText += ""
}, 100))
},
hideChild: function(c) {
var a = this._.activeChild;
a && (delete a.onHide, delete this._.activeChild, a.hide(), c && this.focus())
}
}
});
CKEDITOR.on("instanceDestroyed", function() {
var c = CKEDITOR.tools.isEmpty(CKEDITOR.instances),
a;
for (a in f) {
var b = f[a];
c ? b.destroy() : b.element.hide()
}
c && (f = {})
})
}(), CKEDITOR.plugins.add("listblock", {
requires: "panel",
onLoad: function() {
var d = CKEDITOR.addTemplate("panel-list", '<ul role="presentation" class="cke_panel_list">{items}</ul>'),
f = CKEDITOR.addTemplate("panel-list-item", '<li id="{id}" class="cke_panel_listItem" role=presentation><a id="{id}_option" _cke_focus=1 hidefocus=true title="{title}" href="javascript:void(\'{val}\')" {onclick}="CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role="option">{text}</a></li>'),
c = CKEDITOR.addTemplate("panel-list-group",
'<h1 id="{id}" class="cke_panel_grouptitle" role="presentation" >{label}</h1>');
CKEDITOR.ui.panel.prototype.addListBlock = function(a, b) {
return this.addBlock(a, new CKEDITOR.ui.listBlock(this.getHolderElement(), b))
};
CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass({
base: CKEDITOR.ui.panel.block,
$: function(a, b) {
b = b || {};
var c = b.attributes || (b.attributes = {});
(this.multiSelect = !!b.multiSelect) && (c["aria-multiselectable"] = !0);
!c.role && (c.role = "listbox");
this.base.apply(this, arguments);
this.element.setAttribute("role",
c.role);
c = this.keys;
c[40] = "next";
c[9] = "next";
c[38] = "prev";
c[CKEDITOR.SHIFT + 9] = "prev";
c[32] = CKEDITOR.env.ie ? "mouseup" : "click";
CKEDITOR.env.ie && (c[13] = "mouseup");
this._.pendingHtml = [];
this._.pendingList = [];
this._.items = {};
this._.groups = {}
},
_: {
close: function() {
if (this._.started) {
var a = d.output({
items: this._.pendingList.join("")
});
this._.pendingList = [];
this._.pendingHtml.push(a);
delete this._.started
}
},
getClick: function() {
this._.click || (this._.click = CKEDITOR.tools.addFunction(function(a) {
var b = this.toggle(a);
if (this.onClick) this.onClick(a, b)
}, this));
return this._.click
}
},
proto: {
add: function(a, b, c) {
var d = CKEDITOR.tools.getNextId();
this._.started || (this._.started = 1, this._.size = this._.size || 0);
this._.items[a] = d;
a = {
id: d,
val: a,
onclick: CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick",
clickFn: this._.getClick(),
title: c || a,
text: b || a
};
this._.pendingList.push(f.output(a))
},
startGroup: function(a) {
this._.close();
var b = CKEDITOR.tools.getNextId();
this._.groups[a] = b;
this._.pendingHtml.push(c.output({
id: b,
label: a
}))
},
commit: function() {
this._.close();
this.element.appendHtml(this._.pendingHtml.join(""));
delete this._.size;
this._.pendingHtml = []
},
toggle: function(a) {
var b = this.isMarked(a);
b ? this.unmark(a) : this.mark(a);
return !b
},
hideGroup: function(a) {
var b = (a = this.element.getDocument().getById(this._.groups[a])) && a.getNext();
a && (a.setStyle("display", "none"), b && "ul" == b.getName() && b.setStyle("display", "none"))
},
hideItem: function(a) {
this.element.getDocument().getById(this._.items[a]).setStyle("display", "none")
},
showAll: function() {
var a = this._.items,
b = this._.groups,
c = this.element.getDocument(),
d;
for (d in a) c.getById(a[d]).setStyle("display", "");
for (var f in b) a = c.getById(b[f]), d = a.getNext(), a.setStyle("display", ""), d && "ul" == d.getName() && d.setStyle("display", "")
},
mark: function(a) {
this.multiSelect || this.unmarkAll();
a = this._.items[a];
var b = this.element.getDocument().getById(a);
b.addClass("cke_selected");
this.element.getDocument().getById(a + "_option").setAttribute("aria-selected", !0);
this.onMark && this.onMark(b)
},
unmark: function(a) {
var b = this.element.getDocument();
a = this._.items[a];
var c = b.getById(a);
c.removeClass("cke_selected");
b.getById(a + "_option").removeAttribute("aria-selected");
this.onUnmark && this.onUnmark(c)
},
unmarkAll: function() {
var a = this._.items,
b = this.element.getDocument(),
c;
for (c in a) {
var d = a[c];
b.getById(d).removeClass("cke_selected");
b.getById(d + "_option").removeAttribute("aria-selected")
}
this.onUnmark && this.onUnmark()
},
isMarked: function(a) {
return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")
},
focus: function(a) {
this._.focusIndex = -1;
var b = this.element.getElementsByTag("a"),
c, d = -1;
if (a)
for (c = this.element.getDocument().getById(this._.items[a]).getFirst(); a = b.getItem(++d);) {
if (a.equals(c)) {
this._.focusIndex = d;
break
}
} else this.element.focus();
c && setTimeout(function() {
c.focus()
}, 0)
}
}
})
}
}), CKEDITOR.plugins.add("richcombo", {
requires: "floatpanel,listblock,button",
beforeInit: function(d) {
d.ui.addHandler(CKEDITOR.UI_RICHCOMBO, CKEDITOR.ui.richCombo.handler)
}
}),
function() {
var d = '<span id="{id}" class="cke_combo cke_combo__{name} {cls}" role="presentation"><span id="{id}_label" class="cke_combo_label">{label}</span><a class="cke_combo_button" hidefocus=true title="{title}" tabindex="-1"' +
(CKEDITOR.env.gecko && 10900 <= CKEDITOR.env.version && !CKEDITOR.env.hc ? "" : '" href="javascript:void(\'{titleJs}\')"') + ' hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="true"';
if (CKEDITOR.env.opera || CKEDITOR.env.gecko && CKEDITOR.env.mac) d += ' onkeypress="return false;"';
CKEDITOR.env.gecko && (d += ' onblur="this.style.cssText = this.style.cssText;"');
var d = d + (' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event,this);" onmousedown="return CKEDITOR.tools.callFunction({mousedownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" ' +
(CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick") + '="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span id="{id}_text" class="cke_combo_text cke_combo_inlinelabel">{label}</span><span class="cke_combo_open"><span class="cke_combo_arrow">' + (CKEDITOR.env.hc ? "&#9660;" : CKEDITOR.env.air ? "&nbsp;" : "") + "</span></span></a></span>"),
f = CKEDITOR.addTemplate("combo", d);
CKEDITOR.UI_RICHCOMBO = "richcombo";
CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass({
$: function(c) {
CKEDITOR.tools.extend(this,
c, {
canGroup: !1,
title: c.label,
modes: {
wysiwyg: 1
},
editorFocus: 1
});
c = this.panel || {};
delete this.panel;
this.id = CKEDITOR.tools.getNextNumber();
this.document = c.parent && c.parent.getDocument() || CKEDITOR.document;
c.className = "cke_combopanel";
c.block = {
multiSelect: c.multiSelect,
attributes: c.attributes
};
c.toolbarRelated = !0;
this._ = {
panelDefinition: c,
items: {}
}
},
proto: {
renderHtml: function(c) {
var a = [];
this.render(c, a);
return a.join("")
},
render: function(c, a) {
function b() {
var a = this.modes[c.mode] ? CKEDITOR.TRISTATE_OFF :
CKEDITOR.TRISTATE_DISABLED;
c.readOnly && !this.readOnly && (a = CKEDITOR.TRISTATE_DISABLED);
this.setState(a);
this.setValue("");
a != CKEDITOR.TRISTATE_DISABLED && this.refresh && this.refresh()
}
var d = CKEDITOR.env,
g = "cke_" + this.id,
k = CKEDITOR.tools.addFunction(function(a) {
r && (c.unlockSelection(1), r = 0);
l.execute(a)
}, this),
h = this,
l = {
id: g,
combo: this,
focus: function() {
CKEDITOR.document.getById(g).getChild(1).focus()
},
execute: function(a) {
var b = h._;
if (b.state != CKEDITOR.TRISTATE_DISABLED)
if (h.createPanel(c), b.on) b.panel.hide();
else {
h.commit();
var d = h.getValue();
d ? b.list.mark(d) : b.list.unmarkAll();
b.panel.showBlock(h.id, new CKEDITOR.dom.element(a), 4)
}
},
clickFn: k
};
c.on("activeFilterChange", b, this);
c.on("mode", b, this);
!this.readOnly && c.on("readOnly", b, this);
var n = CKEDITOR.tools.addFunction(function(a, b) {
a = new CKEDITOR.dom.event(a);
var c = a.getKeystroke();
switch (c) {
case 13:
case 32:
case 40:
CKEDITOR.tools.callFunction(k, b);
break;
default:
l.onkey(l, c)
}
a.preventDefault()
}),
q = CKEDITOR.tools.addFunction(function() {
l.onfocus && l.onfocus()
}),
r = 0,
u = CKEDITOR.tools.addFunction(function() {
if (CKEDITOR.env.opera) {
var a = c.editable();
a.isInline() && a.hasFocus && (c.lockSelection(), r = 1)
}
});
l.keyDownFn = n;
d = {
id: g,
name: this.name || this.command,
label: this.label,
title: this.title,
cls: this.className || "",
titleJs: d.gecko && 10900 <= d.version && !d.hc ? "" : (this.title || "").replace("'", ""),
keydownFn: n,
mousedownFn: u,
focusFn: q,
clickFn: k
};
f.output(d, a);
if (this.onRender) this.onRender();
return l
},
createPanel: function(c) {
if (!this._.panel) {
var a = this._.panelDefinition,
b =
this._.panelDefinition.block,
d = a.parent || CKEDITOR.document.getBody(),
g = "cke_combopanel__" + this.name,
f = new CKEDITOR.ui.floatPanel(c, d, a),
h = f.addListBlock(this.id, b),
l = this;
f.onShow = function() {
this.element.addClass(g);
l.setState(CKEDITOR.TRISTATE_ON);
l._.on = 1;
l.editorFocus && !c.focusManager.hasFocus && c.focus();
if (l.onOpen) l.onOpen();
c.once("panelShow", function() {
h.focus(!h.multiSelect && l.getValue())
})
};
f.onHide = function(a) {
this.element.removeClass(g);
l.setState(l.modes && l.modes[c.mode] ? CKEDITOR.TRISTATE_OFF :
CKEDITOR.TRISTATE_DISABLED);
l._.on = 0;
if (!a && l.onClose) l.onClose()
};
f.onEscape = function() {
f.hide(1)
};
h.onClick = function(a, b) {
l.onClick && l.onClick.call(l, a, b);
f.hide()
};
this._.panel = f;
this._.list = h;
f.getBlock(this.id).onHide = function() {
l._.on = 0;
l.setState(CKEDITOR.TRISTATE_OFF)
};
this.init && this.init()
}
},
setValue: function(c, a) {
this._.value = c;
var b = this.document.getById("cke_" + this.id + "_text");
b && (!c && !a ? (a = this.label, b.addClass("cke_combo_inlinelabel")) : b.removeClass("cke_combo_inlinelabel"), b.setText("undefined" !=
typeof a ? a : c))
},
getValue: function() {
return this._.value || ""
},
unmarkAll: function() {
this._.list.unmarkAll()
},
mark: function(c) {
this._.list.mark(c)
},
hideItem: function(c) {
this._.list.hideItem(c)
},
hideGroup: function(c) {
this._.list.hideGroup(c)
},
showAll: function() {
this._.list.showAll()
},
add: function(c, a, b) {
this._.items[c] = b || c;
this._.list.add(c, a, b)
},
startGroup: function(c) {
this._.list.startGroup(c)
},
commit: function() {
this._.committed || (this._.list.commit(), this._.committed = 1, CKEDITOR.ui.fire("ready", this));
this._.committed = 1
},
setState: function(c) {
if (this._.state != c) {
var a = this.document.getById("cke_" + this.id);
a.setState(c, "cke_combo");
c == CKEDITOR.TRISTATE_DISABLED ? a.setAttribute("aria-disabled", !0) : a.removeAttribute("aria-disabled");
this._.state = c
}
},
getState: function() {
return this._.state
},
enable: function() {
this._.state == CKEDITOR.TRISTATE_DISABLED && this.setState(this._.lastState)
},
disable: function() {
this._.state != CKEDITOR.TRISTATE_DISABLED && (this._.lastState = this._.state, this.setState(CKEDITOR.TRISTATE_DISABLED))
}
},
statics: {
handler: {
create: function(c) {
return new CKEDITOR.ui.richCombo(c)
}
}
}
});
CKEDITOR.ui.prototype.addRichCombo = function(c, a) {
this.add(c, CKEDITOR.UI_RICHCOMBO, a)
}
}(), CKEDITOR.plugins.add("format", {
requires: "richcombo",
init: function(d) {
if (!d.blockless) {
for (var f = d.config, c = d.lang.format, a = f.format_tags.split(";"), b = {}, e = 0, g = [], k = 0; k < a.length; k++) {
var h = a[k],
l = new CKEDITOR.style(f["format_" + h]);
if (!d.filter.customConfig || d.filter.check(l)) e++, b[h] = l, b[h]._.enterMode = d.config.enterMode, g.push(l)
}
0 !==
e && d.ui.addRichCombo("Format", {
label: c.label,
title: c.panelTitle,
toolbar: "styles,20",
allowedContent: g,
panel: {
css: [CKEDITOR.skin.getPath("editor")].concat(f.contentsCss),
multiSelect: !1,
attributes: {
"aria-label": c.panelTitle
}
},
init: function() {
this.startGroup(c.panelTitle);
for (var a in b) {
var d = c["tag_" + a];
this.add(a, b[a].buildPreview(d), d)
}
},
onClick: function(a) {
d.focus();
d.fire("saveSnapshot");
a = b[a];
var c = d.elementPath();
d[a.checkActive(c) ? "removeStyle" : "applyStyle"](a);
setTimeout(function() {
d.fire("saveSnapshot")
},
0)
},
onRender: function() {
d.on("selectionChange", function(a) {
var c = this.getValue();
a = a.data.path;
this.refresh();
for (var e in b)
if (b[e].checkActive(a)) {
e != c && this.setValue(e, d.lang.format["tag_" + e]);
return
}
this.setValue("")
}, this)
},
onOpen: function() {
this.showAll();
for (var a in b) d.activeFilter.check(b[a]) || this.hideItem(a)
},
refresh: function() {
var a = d.elementPath();
if (a) {
if (a.isContextFor("p"))
for (var c in b)
if (d.activeFilter.check(b[c])) return;
this.setState(CKEDITOR.TRISTATE_DISABLED)
}
}
})
}
}
}), CKEDITOR.config.format_tags =
"p;h1;h2;h3;h4;h5;h6;pre;address;div", CKEDITOR.config.format_p = {
element: "p"
}, CKEDITOR.config.format_div = {
element: "div"
}, CKEDITOR.config.format_pre = {
element: "pre"
}, CKEDITOR.config.format_quote = {
element: "blockquote"
}, CKEDITOR.config.format_address = {
element: "address"
}, CKEDITOR.config.format_h1 = {
element: "h1"
}, CKEDITOR.config.format_h2 = {
element: "h2"
}, CKEDITOR.config.format_h3 = {
element: "h3"
}, CKEDITOR.config.format_h4 = {
element: "h4"
}, CKEDITOR.config.format_h5 = {
element: "h5"
}, CKEDITOR.config.format_h6 = {
element: "h6"
},
function() {
function d(a) {
var b = this.editor,
c = a.document,
d = c.body;
if (a.window) {
(a = c.getElementById("cke_actscrpt")) && a.parentNode.removeChild(a);
(a = c.getElementById("cke_shimscrpt")) && a.parentNode.removeChild(a);
CKEDITOR.env.gecko && (d.contentEditable = !1, 2E4 > CKEDITOR.env.version && (d.innerHTML = d.innerHTML.replace(/^.*<\!-- cke-content-start --\>/, ""), setTimeout(function() {
var a = new CKEDITOR.dom.range(new CKEDITOR.dom.document(c));
a.setStart(new CKEDITOR.dom.node(d), 0);
b.getSelection().selectRanges([a])
},
0)));
d.contentEditable = !0;
CKEDITOR.env.ie && (d.hideFocus = !0, d.disabled = !0, d.removeAttribute("disabled"));
delete this._.isLoadingData;
this.$ = d;
c = new CKEDITOR.dom.document(c);
this.setup();
CKEDITOR.env.ie && (c.getDocumentElement().addClass(c.$.compatMode), b.config.enterMode != CKEDITOR.ENTER_P && c.on("selectionchange", function() {
var a = c.getBody(),
d = b.getSelection(),
g = d && d.getRanges()[0];
g && a.getHtml().match(/^<p>(?:&nbsp;|<br>)<\/p>$/i) && g.startContainer.equals(a) && setTimeout(function() {
g = b.getSelection().getRanges()[0];
g.startContainer.equals("body") || (a.getFirst().remove(1), g.moveToElementEditEnd(a), g.select())
}, 0)
}));
if (CKEDITOR.env.webkit || CKEDITOR.env.ie && 10 < CKEDITOR.env.version) c.getDocumentElement().on("mousedown", function(a) {
a.data.getTarget().is("html") && setTimeout(function() {
b.editable().focus()
})
});
try {
b.document.$.execCommand("2D-position", !1, !0)
} catch (f) {}
try {
b.document.$.execCommand("enableInlineTableEditing", !1, !b.config.disableNativeTableHandles)
} catch (h) {}
if (b.config.disableObjectResizing) try {
this.getDocument().$.execCommand("enableObjectResizing", !1, !1)
} catch (l) {
this.attachListener(this, CKEDITOR.env.ie ? "resizestart" : "resize", function(a) {
a.data.preventDefault()
})
}(CKEDITOR.env.gecko || CKEDITOR.env.ie && "CSS1Compat" == b.document.$.compatMode) && this.attachListener(this, "keydown", function(a) {
var c = a.data.getKeystroke();
if (33 == c || 34 == c)
if (CKEDITOR.env.ie) setTimeout(function() {
b.getSelection().scrollIntoView()
}, 0);
else if (b.window.$.innerHeight > this.$.offsetHeight) {
var d = b.createRange();
d[33 == c ? "moveToElementEditStart" : "moveToElementEditEnd"](this);
d.select();
a.data.preventDefault()
}
});
CKEDITOR.env.ie && this.attachListener(c, "blur", function() {
try {
c.$.selection.empty()
} catch (a) {}
});
b.document.getElementsByTag("title").getItem(0).data("cke-title", b.document.$.title);
CKEDITOR.env.ie && (b.document.$.title = this._.docTitle);
CKEDITOR.tools.setTimeout(function() {
b.fire("contentDom");
this._.isPendingFocus && (b.focus(), this._.isPendingFocus = !1);
setTimeout(function() {
b.fire("dataReady")
}, 0);
CKEDITOR.env.ie && setTimeout(function() {
if (b.document) {
var a = b.document.$.body;
a.runtimeStyle.marginBottom = "0px";
a.runtimeStyle.marginBottom = ""
}
}, 1E3)
}, 0, this)
}
}
function f() {
var a = [];
if (8 <= CKEDITOR.document.$.documentMode) {
a.push("html.CSS1Compat [contenteditable=false]{min-height:0 !important}");
var b = [],
c;
for (c in CKEDITOR.dtd.$removeEmpty) b.push("html.CSS1Compat " + c + "[contenteditable=false]");
a.push(b.join(",") + "{display:inline-block}")
} else CKEDITOR.env.gecko && (a.push("html{height:100% !important}"), a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));
a.push("html{cursor:text;*cursor:auto}");
a.push("img,input,textarea{cursor:default}");
return a.join("\n")
}
CKEDITOR.plugins.add("wysiwygarea", {
init: function(a) {
a.config.fullPage && a.addFeature({
allowedContent: "html head title; style [media,type]; body (*)[id]; meta link [*]",
requiredContent: "body"
});
a.addMode("wysiwyg", function(b) {
function d(e) {
e && e.removeListener();
a.editable(new c(a, f.$.contentWindow.document.body));
a.setData(a.getData(1), b)
}
var g = "document.open();" + (CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain +
")();" : "") + "document.close();",
g = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie ? "javascript:void(function(){" + encodeURIComponent(g) + "}())" : "",
f = CKEDITOR.dom.element.createFromHtml('<iframe src="' + g + '" frameBorder="0"></iframe>');
f.setStyles({
width: "100%",
height: "100%"
});
f.addClass("cke_wysiwyg_frame cke_reset");
var h = a.ui.space("contents");
h.append(f);
if (g = CKEDITOR.env.ie || CKEDITOR.env.gecko) f.on("load", d);
var l = a.title,
n = a.lang.common.editorHelp;
l && (CKEDITOR.env.ie && (l += ", " + n), f.setAttribute("title",
l));
var l = CKEDITOR.tools.getNextId(),
q = CKEDITOR.dom.element.createFromHtml('<span id="' + l + '" class="cke_voice_label">' + n + "</span>");
h.append(q, 1);
a.on("beforeModeUnload", function(a) {
a.removeListener();
q.remove()
});
f.setAttributes({
"aria-describedby": l,
tabIndex: a.tabIndex,
allowTransparency: "true"
});
!g && d();
CKEDITOR.env.webkit && (g = function() {
h.setStyle("width", "100%");
f.hide();
f.setSize("width", h.getSize("width"));
h.removeStyle("width");
f.show()
}, f.setCustomData("onResize", g), CKEDITOR.document.getWindow().on("resize",
g));
a.fire("ariaWidget", f)
})
}
});
var c = CKEDITOR.tools.createClass({
$: function(a) {
this.base.apply(this, arguments);
this._.frameLoadedHandler = CKEDITOR.tools.addFunction(function(a) {
CKEDITOR.tools.setTimeout(d, 0, this, a)
}, this);
this._.docTitle = this.getWindow().getFrame().getAttribute("title")
},
base: CKEDITOR.editable,
proto: {
setData: function(a, b) {
var c = this.editor;
if (b) this.setHtml(a), c.fire("dataReady");
else {
this._.isLoadingData = !0;
c._.dataStore = {
id: 1
};
var d = c.config,
k = d.fullPage,
h = d.docType,
l = CKEDITOR.tools.buildStyleHtml(f()).replace(/<style>/,
'<style data-cke-temp="1">');
k || (l += CKEDITOR.tools.buildStyleHtml(c.config.contentsCss));
var n = d.baseHref ? '<base href="' + d.baseHref + '" data-cke-temp="1" />' : "";
k && (a = a.replace(/<!DOCTYPE[^>]*>/i, function(a) {
c.docType = h = a;
return ""
}).replace(/<\?xml\s[^\?]*\?>/i, function(a) {
c.xmlDeclaration = a;
return ""
}));
a = c.dataProcessor.toHtml(a);
k ? (/<body[\s|>]/.test(a) || (a = "<body>" + a), /<html[\s|>]/.test(a) || (a = "<html>" + a + "</html>"), /<head[\s|>]/.test(a) ? /<title[\s|>]/.test(a) || (a = a.replace(/<head[^>]*>/, "$&<title></title>")) :
a = a.replace(/<html[^>]*>/, "$&<head><title></title></head>"), n && (a = a.replace(/<head>/, "$&" + n)), a = a.replace(/<\/head\s*>/, l + "$&"), a = h + a) : a = d.docType + '<html dir="' + d.contentsLangDirection + '" lang="' + (d.contentsLanguage || c.langCode) + '"><head><title>' + this._.docTitle + "</title>" + n + l + "</head><body" + (d.bodyId ? ' id="' + d.bodyId + '"' : "") + (d.bodyClass ? ' class="' + d.bodyClass + '"' : "") + ">" + a + "</body></html>";
CKEDITOR.env.gecko && (a = a.replace(/<body/, '<body contenteditable="true" '), 2E4 > CKEDITOR.env.version && (a = a.replace(/<body[^>]*>/,
"$&\x3c!-- cke-content-start --\x3e")));
d = '<script id="cke_actscrpt" type="text/javascript"' + (CKEDITOR.env.ie ? ' defer="defer" ' : "") + ">var wasLoaded=0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction(" + this._.frameLoadedHandler + ",window);wasLoaded=1;}" + (CKEDITOR.env.ie ? "onload();" : 'document.addEventListener("DOMContentLoaded", onload, false );') + "\x3c/script>";
CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (d += '<script id="cke_shimscrpt">window.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script>');
a = a.replace(/(?=\s*<\/(:?head)>)/, d);
this.clearCustomData();
this.clearListeners();
c.fire("contentDomUnload");
var q = this.getDocument();
try {
q.write(a)
} catch (r) {
setTimeout(function() {
q.write(a)
}, 0)
}
}
},
getData: function(a) {
if (a) return this.getHtml();
a = this.editor;
var b = a.config,
c = b.fullPage,
d = c && a.docType,
f = c && a.xmlDeclaration,
h = this.getDocument(),
c = c ? h.getDocumentElement().getOuterHtml() : h.getBody().getHtml();
CKEDITOR.env.gecko && b.enterMode != CKEDITOR.ENTER_BR && (c = c.replace(/<br>(?=\s*(:?$|<\/body>))/,
""));
c = a.dataProcessor.toDataFormat(c);
f && (c = f + "\n" + c);
d && (c = d + "\n" + c);
return c
},
focus: function() {
this._.isLoadingData ? this._.isPendingFocus = !0 : c.baseProto.focus.call(this)
},
detach: function() {
var a = this.editor,
b = a.document,
d = a.window.getFrame();
c.baseProto.detach.call(this);
this.clearCustomData();
b.getDocumentElement().clearCustomData();
d.clearCustomData();
CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);
(b = d.removeCustomData("onResize")) && b.removeListener();
a.fire("contentDomUnload");
d.remove()
}
}
})
}(),
CKEDITOR.config.disableObjectResizing = !1, CKEDITOR.config.disableNativeTableHandles = !0, CKEDITOR.config.disableNativeSpellChecker = !0, CKEDITOR.config.contentsCss = CKEDITOR.basePath + "contents.css",
function() {
function d(a, b) {
var d, g;
b.on("refresh", function(a) {
var b = [f],
d;
for (d in a.data.states) b.push(a.data.states[d]);
this.setState(CKEDITOR.tools.search(b, c) ? c : f)
}, b, null, 100);
b.on("exec", function(b) {
d = a.getSelection();
g = d.createBookmarks(1);
b.data || (b.data = {});
b.data.done = !1
}, b, null, 0);
b.on("exec", function() {
a.forceNextSelectionCheck();
d.selectBookmarks(g)
}, b, null, 100)
}
var f = CKEDITOR.TRISTATE_DISABLED,
c = CKEDITOR.TRISTATE_OFF;
CKEDITOR.plugins.add("indent", {
init: function(a) {
var b = CKEDITOR.plugins.indent.genericDefinition;
d(a, a.addCommand("indent", new b(!0)));
d(a, a.addCommand("outdent", new b));
a.ui.addButton && (a.ui.addButton("Indent", {
label: a.lang.indent.indent,
command: "indent",
directional: !0,
toolbar: "indent,20"
}), a.ui.addButton("Outdent", {
label: a.lang.indent.outdent,
command: "outdent",
directional: !0,
toolbar: "indent,10"
}));
a.on("dirChanged",
function(b) {
var c = a.createRange(),
d = b.data.node;
c.setStartBefore(d);
c.setEndAfter(d);
for (var h = new CKEDITOR.dom.walker(c), f; f = h.next();)
if (f.type == CKEDITOR.NODE_ELEMENT)
if (!f.equals(d) && f.getDirection()) c.setStartAfter(f), h = new CKEDITOR.dom.walker(c);
else {
var n = a.config.indentClasses;
if (n)
for (var q = "ltr" == b.data.dir ? ["_rtl", ""] : ["", "_rtl"], r = 0; r < n.length; r++) f.hasClass(n[r] + q[0]) && (f.removeClass(n[r] + q[0]), f.addClass(n[r] + q[1]));
n = f.getStyle("margin-right");
q = f.getStyle("margin-left");
n ? f.setStyle("margin-left",
n) : f.removeStyle("margin-left");
q ? f.setStyle("margin-right", q) : f.removeStyle("margin-right")
}
})
}
});
CKEDITOR.plugins.indent = {
genericDefinition: function(a) {
this.isIndent = !!a;
this.startDisabled = !this.isIndent
},
specificDefinition: function(a, b, c) {
this.name = b;
this.editor = a;
this.jobs = {};
this.enterBr = a.config.enterMode == CKEDITOR.ENTER_BR;
this.isIndent = !!c;
this.relatedGlobal = c ? "indent" : "outdent";
this.indentKey = c ? 9 : CKEDITOR.SHIFT + 9;
this.database = {}
},
registerCommands: function(a, b) {
a.on("pluginsLoaded", function() {
for (var a in b)(function(a,
b) {
var c = a.getCommand(b.relatedGlobal),
d;
for (d in b.jobs) c.on("exec", function(c) {
c.data.done || (a.fire("lockSnapshot"), b.execJob(a, d) && (c.data.done = !0), a.fire("unlockSnapshot"), CKEDITOR.dom.element.clearAllMarkers(b.database))
}, this, null, d), c.on("refresh", function(c) {
c.data.states || (c.data.states = {});
c.data.states[b.name + "@" + d] = b.refreshJob(a, d, c.data.path)
}, this, null, d);
a.addFeature(b)
})(this, b[a])
})
}
};
CKEDITOR.plugins.indent.genericDefinition.prototype = {
context: "p",
exec: function() {}
};
CKEDITOR.plugins.indent.specificDefinition.prototype = {
execJob: function(a, b) {
var c = this.jobs[b];
if (c.state != f) return c.exec.call(this, a)
},
refreshJob: function(a, b, c) {
b = this.jobs[b];
b.state = a.activeFilter.checkFeature(this) ? b.refresh.call(this, a, c) : f;
return b.state
},
getContext: function(a) {
return a.contains(this.context)
}
}
}(),
function() {
function d(a, b, c) {
if (!a.getCustomData("indent_processed")) {
var d = this.editor,
e = this.isIndent;
if (b) {
d = a.$.className.match(this.classNameRegex);
c = 0;
d && (d = d[1], c = CKEDITOR.tools.indexOf(b, d) + 1);
if (0 > (c += e ? 1 : -1)) return;
c = Math.min(c,
b.length);
c = Math.max(c, 0);
a.$.className = CKEDITOR.tools.ltrim(a.$.className.replace(this.classNameRegex, ""));
0 < c && a.addClass(b[c - 1])
} else {
b = f(a, c);
c = parseInt(a.getStyle(b), 10);
var q = d.config.indentOffset || 40;
isNaN(c) && (c = 0);
c += (e ? 1 : -1) * q;
if (0 > c) return;
c = Math.max(c, 0);
c = Math.ceil(c / q) * q;
a.setStyle(b, c ? c + (d.config.indentUnit || "px") : "");
"" === a.getAttribute("style") && a.removeAttribute("style")
}
CKEDITOR.dom.element.setMarker(this.database, a, "indent_processed", 1)
}
}
function f(a, b) {
return "ltr" == (b || a.getComputedStyle("direction")) ?
"margin-left" : "margin-right"
}
var c = CKEDITOR.dtd.$listItem,
a = CKEDITOR.dtd.$list,
b = CKEDITOR.TRISTATE_DISABLED,
e = CKEDITOR.TRISTATE_OFF;
CKEDITOR.plugins.add("indentblock", {
requires: "indent",
init: function(g) {
function k(g, k) {
h.specificDefinition.apply(this, arguments);
this.allowedContent = {
"div h1 h2 h3 h4 h5 h6 ol p pre ul": {
propertiesOnly: !0,
styles: !l ? "margin-left,margin-right" : null,
classes: l || null
}
};
this.enterBr && (this.allowedContent.div = !0);
this.requiredContent = (this.enterBr ? "div" : "p") + (l ? "(" + l.join(",") +
")" : "{margin-left}");
this.jobs = {
20: {
refresh: function(a, d) {
var g = d.block || d.blockLimit;
if (g.is(c)) g = g.getParent();
else if (g.getAscendant(c)) return b;
if (!this.enterBr && !this.getContext(d)) return b;
if (l) {
var h;
h = l;
var g = g.$.className.match(this.classNameRegex),
k = this.isIndent;
return (h = g ? k ? g[1] != h.slice(-1) : !0 : k) ? e : b
}
return this.isIndent ? e : g ? CKEDITOR[0 >= (parseInt(g.getStyle(f(g)), 10) || 0) ? "TRISTATE_DISABLED" : "TRISTATE_OFF"] : b
},
exec: function(b) {
var c = b.getSelection(),
c = c && c.getRanges(1)[0],
e;
if (e = b.elementPath().contains(a)) d.call(this,
e, l);
else {
c = c.createIterator();
b = b.config.enterMode;
c.enforceRealBlocks = !0;
for (c.enlargeBr = b != CKEDITOR.ENTER_BR; e = c.getNextParagraph(b == CKEDITOR.ENTER_P ? "p" : "div");) d.call(this, e, l)
}
return !0
}
}
}
}
var h = CKEDITOR.plugins.indent,
l = g.config.indentClasses;
h.registerCommands(g, {
indentblock: new k(g, "indentblock", !0),
outdentblock: new k(g, "outdentblock")
});
CKEDITOR.tools.extend(k.prototype, h.specificDefinition.prototype, {
context: {
div: 1,
dl: 1,
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1,
ul: 1,
ol: 1,
p: 1,
pre: 1,
table: 1
},
classNameRegex: l ?
RegExp("(?:^|\\s+)(" + l.join("|") + ")(?=$|\\s)") : null
})
}
})
}(),
function() {
function d(b) {
function d(c) {
for (var k = m.startContainer, l = m.endContainer; k && !k.getParent().equals(c);) k = k.getParent();
for (; l && !l.getParent().equals(c);) l = l.getParent();
if (!k || !l) return !1;
for (var p = k, k = [], w = !1; !w;) p.equals(l) && (w = !0), k.push(p), p = p.getNext();
if (1 > k.length) return !1;
p = c.getParents(!0);
for (l = 0; l < p.length; l++)
if (p[l].getName && f[p[l].getName()]) {
c = p[l];
break
}
for (var p = e.isIndent ? 1 : -1, l = k[0], k = k[k.length - 1], w = CKEDITOR.plugins.list.listToArray(c,
g), s = w[k.getCustomData("listarray_index")].indent, l = l.getCustomData("listarray_index"); l <= k.getCustomData("listarray_index"); l++)
if (w[l].indent += p, 0 < p) {
var v = w[l].parent;
w[l].parent = new CKEDITOR.dom.element(v.getName(), v.getDocument())
}
for (l = k.getCustomData("listarray_index") + 1; l < w.length && w[l].indent > s; l++) w[l].indent += p;
k = CKEDITOR.plugins.list.arrayToList(w, g, null, b.config.enterMode, c.getDirection());
if (!e.isIndent) {
var u;
if ((u = c.getParent()) && u.is("li"))
for (var p = k.listNode.getChildren(), A = [],
D, l = p.count() - 1; 0 <= l; l--)(D = p.getItem(l)) && D.is && D.is("li") && A.push(D)
}
k && k.listNode.replace(c);
if (A && A.length)
for (l = 0; l < A.length; l++) {
for (D = c = A[l];
(D = D.getNext()) && D.is && D.getName() in f;) CKEDITOR.env.needsNbspFiller && !c.getFirst(a) && c.append(m.document.createText("\u00a0")), c.append(D);
c.insertAfter(u)
}
k && b.fire("contentDomInvalidated");
return !0
}
for (var e = this, g = this.database, f = this.context, k = b.getSelection(), k = (k && k.getRanges()).createIterator(), m; m = k.getNextRange();) {
for (var p = m.getCommonAncestor(); p &&
!(p.type == CKEDITOR.NODE_ELEMENT && f[p.getName()]);) p = p.getParent();
p || (p = m.startPath().contains(f)) && m.setEndAt(p, CKEDITOR.POSITION_BEFORE_END);
if (!p) {
var w = m.getEnclosedNode();
w && (w.type == CKEDITOR.NODE_ELEMENT && w.getName() in f) && (m.setStartAt(w, CKEDITOR.POSITION_AFTER_START), m.setEndAt(w, CKEDITOR.POSITION_BEFORE_END), p = w)
}
p && (m.startContainer.type == CKEDITOR.NODE_ELEMENT && m.startContainer.getName() in f) && (w = new CKEDITOR.dom.walker(m), w.evaluator = c, m.startContainer = w.next());
p && (m.endContainer.type ==
CKEDITOR.NODE_ELEMENT && m.endContainer.getName() in f) && (w = new CKEDITOR.dom.walker(m), w.evaluator = c, m.endContainer = w.previous());
if (p) return d(p)
}
return 0
}
function f(a, b) {
b || (b = a.contains(this.context));
return b && a.block && a.block.equals(b.getFirst(c))
}
function c(a) {
return a.type == CKEDITOR.NODE_ELEMENT && a.is("li")
}
function a(a) {
return b(a) && e(a)
}
var b = CKEDITOR.dom.walker.whitespaces(!0),
e = CKEDITOR.dom.walker.bookmark(!1, !0),
g = CKEDITOR.TRISTATE_DISABLED,
k = CKEDITOR.TRISTATE_OFF;
CKEDITOR.plugins.add("indentlist", {
requires: "indent",
init: function(a) {
function b(a, e) {
c.specificDefinition.apply(this, arguments);
this.requiredContent = ["ul", "ol"];
a.on("key", function(b) {
if ("wysiwyg" == a.mode && b.data.keyCode == this.indentKey) {
var c = this.getContext(a.elementPath());
if (c && (!this.isIndent || !f.call(this, a.elementPath(), c))) a.execCommand(this.relatedGlobal), b.cancel()
}
}, this);
this.jobs[this.isIndent ? 10 : 30] = {
refresh: this.isIndent ? function(a, b) {
var c = this.getContext(b),
d = f.call(this, b, c);
return !c || !this.isIndent || d ? g : k
} : function(a,
b) {
return !this.getContext(b) || this.isIndent ? g : k
},
exec: CKEDITOR.tools.bind(d, this)
}
}
var c = CKEDITOR.plugins.indent;
c.registerCommands(a, {
indentlist: new b(a, "indentlist", !0),
outdentlist: new b(a, "outdentlist")
});
CKEDITOR.tools.extend(b.prototype, c.specificDefinition.prototype, {
context: {
ol: 1,
ul: 1
}
})
}
})
}(),
function() {
function d(a, b) {
b = void 0 === b || b;
var c;
if (b) c = a.getComputedStyle("text-align");
else {
for (; !a.hasAttribute || !a.hasAttribute("align") && !a.getStyle("text-align");) {
c = a.getParent();
if (!c) break;
a =
c
}
c = a.getStyle("text-align") || a.getAttribute("align") || ""
}
c && (c = c.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i, ""));
!c && b && (c = "rtl" == a.getComputedStyle("direction") ? "right" : "left");
return c
}
function f(a, b, c) {
this.editor = a;
this.name = b;
this.value = c;
this.context = "p";
b = a.config.justifyClasses;
var d = a.config.enterMode == CKEDITOR.ENTER_P ? "p" : "div";
if (b) {
switch (c) {
case "left":
this.cssClassName = b[0];
break;
case "center":
this.cssClassName = b[1];
break;
case "right":
this.cssClassName = b[2];
break;
case "justify":
this.cssClassName =
b[3]
}
this.cssClassRegex = RegExp("(?:^|\\s+)(?:" + b.join("|") + ")(?=$|\\s)");
this.requiredContent = d + "(" + this.cssClassName + ")"
} else this.requiredContent = d + "{text-align}";
this.allowedContent = {
"caption div h1 h2 h3 h4 h5 h6 p pre td th li": {
propertiesOnly: !0,
styles: this.cssClassName ? null : "text-align",
classes: this.cssClassName || null
}
};
a.config.enterMode == CKEDITOR.ENTER_BR && (this.allowedContent.div = !0)
}
function c(a) {
var b = a.editor,
c = b.createRange();
c.setStartBefore(a.data.node);
c.setEndAfter(a.data.node);
for (var d = new CKEDITOR.dom.walker(c), f; f = d.next();)
if (f.type == CKEDITOR.NODE_ELEMENT)
if (!f.equals(a.data.node) && f.getDirection()) c.setStartAfter(f), d = new CKEDITOR.dom.walker(c);
else {
var h = b.config.justifyClasses;
h && (f.hasClass(h[0]) ? (f.removeClass(h[0]), f.addClass(h[2])) : f.hasClass(h[2]) && (f.removeClass(h[2]), f.addClass(h[0])));
h = f.getStyle("text-align");
"left" == h ? f.setStyle("text-align", "right") : "right" == h && f.setStyle("text-align", "left")
}
}
f.prototype = {
exec: function(a) {
var b = a.getSelection(),
c = a.config.enterMode;
if (b) {
for (var g = b.createBookmarks(), f = b.getRanges(), h = this.cssClassName, l, n, q = a.config.useComputedState, q = void 0 === q || q, r = f.length - 1; 0 <= r; r--) {
l = f[r].createIterator();
for (l.enlargeBr = c != CKEDITOR.ENTER_BR; n = l.getNextParagraph(c == CKEDITOR.ENTER_P ? "p" : "div");)
if (!n.isReadOnly()) {
n.removeAttribute("align");
n.removeStyle("text-align");
var u = h && (n.$.className = CKEDITOR.tools.ltrim(n.$.className.replace(this.cssClassRegex, ""))),
m = this.state == CKEDITOR.TRISTATE_OFF && (!q || d(n, !0) != this.value);
h ? m ? n.addClass(h) :
u || n.removeAttribute("class") : m && n.setStyle("text-align", this.value)
}
}
a.focus();
a.forceNextSelectionCheck();
b.selectBookmarks(g)
}
},
refresh: function(a, b) {
var c = b.block || b.blockLimit;
this.setState("body" != c.getName() && d(c, this.editor.config.useComputedState) == this.value ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
}
};
CKEDITOR.plugins.add("justify", {
init: function(a) {
if (!a.blockless) {
var b = new f(a, "justifyleft", "left"),
d = new f(a, "justifycenter", "center"),
g = new f(a, "justifyright", "right"),
k = new f(a, "justifyblock",
"justify");
a.addCommand("justifyleft", b);
a.addCommand("justifycenter", d);
a.addCommand("justifyright", g);
a.addCommand("justifyblock", k);
a.ui.addButton && (a.ui.addButton("JustifyLeft", {
label: a.lang.justify.left,
command: "justifyleft",
toolbar: "align,10"
}), a.ui.addButton("JustifyCenter", {
label: a.lang.justify.center,
command: "justifycenter",
toolbar: "align,20"
}), a.ui.addButton("JustifyRight", {
label: a.lang.justify.right,
command: "justifyright",
toolbar: "align,30"
}), a.ui.addButton("JustifyBlock", {
label: a.lang.justify.block,
command: "justifyblock",
toolbar: "align,40"
}));
a.on("dirChanged", c)
}
}
})
}(),
function() {
function d(a, b, c) {
function d(c) {
if ((l = k[c ? "getFirst" : "getLast"]()) && (!l.is || !l.isBlockBoundary()) && (n = b.root[c ? "getPrevious" : "getNext"](CKEDITOR.dom.walker.invisible(!0))) && (!n.is || !n.isBlockBoundary({
br: 1
}))) a.document.createElement("br")[c ? "insertBefore" : "insertAfter"](l)
}
for (var e = CKEDITOR.plugins.list.listToArray(b.root, c), g = [], f = 0; f < b.contents.length; f++) {
var h = b.contents[f];
if ((h = h.getAscendant("li", !0)) && !h.getCustomData("list_item_processed")) g.push(h),
CKEDITOR.dom.element.setMarker(c, h, "list_item_processed", !0)
}
h = null;
for (f = 0; f < g.length; f++) h = g[f].getCustomData("listarray_index"), e[h].indent = -1;
for (f = h + 1; f < e.length; f++)
if (e[f].indent > e[f - 1].indent + 1) {
g = e[f - 1].indent + 1 - e[f].indent;
for (h = e[f].indent; e[f] && e[f].indent >= h;) e[f].indent += g, f++;
f--
}
var k = CKEDITOR.plugins.list.arrayToList(e, c, null, a.config.enterMode, b.root.getAttribute("dir")).listNode,
l, n;
d(!0);
d();
k.replace(b.root);
a.fire("contentDomInvalidated")
}
function f(a, b) {
this.name = a;
this.context =
this.type = b;
this.allowedContent = b + " li";
this.requiredContent = b
}
function c(a, b, c, d) {
for (var e, g; e = a[d ? "getLast" : "getFirst"](u);)(g = e.getDirection(1)) !== b.getDirection(1) && e.setAttribute("dir", g), e.remove(), c ? e[d ? "insertBefore" : "insertAfter"](c) : b.append(e, d)
}
function a(a) {
var b;
(b = function(b) {
var d = a[b ? "getPrevious" : "getNext"](n);
d && (d.type == CKEDITOR.NODE_ELEMENT && d.is(a.getName())) && (c(a, d, null, !b), a.remove(), a = d)
})();
b(1)
}
function b(a) {
return a.type == CKEDITOR.NODE_ELEMENT && (a.getName() in CKEDITOR.dtd.$block ||
a.getName() in CKEDITOR.dtd.$listItem) && CKEDITOR.dtd[a.getName()]["#"]
}
function e(b, d, e) {
b.fire("saveSnapshot");
e.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);
var f = e.extractContents();
d.trim(!1, !0);
var h = d.createBookmark(),
k = new CKEDITOR.dom.elementPath(d.startContainer),
l = k.block,
k = k.lastElement.getAscendant("li", 1) || l,
r = new CKEDITOR.dom.elementPath(e.startContainer),
s = r.contains(CKEDITOR.dtd.$listItem),
r = r.contains(CKEDITOR.dtd.$list);
l ? (l = l.getBogus()) && l.remove() : r && (l = r.getPrevious(n)) && q(l) &&
l.remove();
(l = f.getLast()) && l.type == CKEDITOR.NODE_ELEMENT && l.is("br") && l.remove();
(l = d.startContainer.getChild(d.startOffset)) ? f.insertBefore(l): d.startContainer.append(f);
if (s && (f = g(s))) k.contains(s) ? (c(f, s.getParent(), s), f.remove()) : k.append(f);
for (; e.checkStartOfBlock() && e.checkEndOfBlock();) r = e.startPath(), f = r.block, f.is("li") && (k = f.getParent(), f.equals(k.getLast(n)) && f.equals(k.getFirst(n)) && (f = k)), e.moveToPosition(f, CKEDITOR.POSITION_BEFORE_START), f.remove();
e = e.clone();
f = b.editable();
e.setEndAt(f,
CKEDITOR.POSITION_BEFORE_END);
e = new CKEDITOR.dom.walker(e);
e.evaluator = function(a) {
return n(a) && !q(a)
};
(e = e.next()) && e.type == CKEDITOR.NODE_ELEMENT && e.getName() in CKEDITOR.dtd.$list && a(e);
d.moveToBookmark(h);
d.select();
b.fire("saveSnapshot")
}
function g(a) {
return (a = a.getLast(n)) && a.type == CKEDITOR.NODE_ELEMENT && a.getName() in k ? a : null
}
var k = {
ol: 1,
ul: 1
},
h = CKEDITOR.dom.walker.whitespaces(),
l = CKEDITOR.dom.walker.bookmark(),
n = function(a) {
return !(h(a) || l(a))
},
q = CKEDITOR.dom.walker.bogus();
CKEDITOR.plugins.list = {
listToArray: function(a, b, c, d, e) {
if (!k[a.getName()]) return [];
d || (d = 0);
c || (c = []);
for (var g = 0, f = a.getChildCount(); g < f; g++) {
var h = a.getChild(g);
h.type == CKEDITOR.NODE_ELEMENT && h.getName() in CKEDITOR.dtd.$list && CKEDITOR.plugins.list.listToArray(h, b, c, d + 1);
if ("li" == h.$.nodeName.toLowerCase()) {
var l = {
parent: a,
indent: d,
element: h,
contents: []
};
e ? l.grandparent = e : (l.grandparent = a.getParent(), l.grandparent && "li" == l.grandparent.$.nodeName.toLowerCase() && (l.grandparent = l.grandparent.getParent()));
b && CKEDITOR.dom.element.setMarker(b,
h, "listarray_index", c.length);
c.push(l);
for (var n = 0, q = h.getChildCount(), r; n < q; n++) r = h.getChild(n), r.type == CKEDITOR.NODE_ELEMENT && k[r.getName()] ? CKEDITOR.plugins.list.listToArray(r, b, c, d + 1, l.grandparent) : l.contents.push(r)
}
}
return c
},
arrayToList: function(a, b, c, d, e) {
c || (c = 0);
if (!a || a.length < c + 1) return null;
for (var g, f = a[c].parent.getDocument(), h = new CKEDITOR.dom.documentFragment(f), q = null, r = c, u = Math.max(a[c].indent, 0), A = null, D, B, E = d == CKEDITOR.ENTER_P ? "p" : "div";;) {
var F = a[r];
g = F.grandparent;
D = F.element.getDirection(1);
if (F.indent == u) {
if (!q || a[r].parent.getName() != q.getName()) q = a[r].parent.clone(!1, 1), e && q.setAttribute("dir", e), h.append(q);
A = q.append(F.element.clone(0, 1));
D != q.getDirection(1) && A.setAttribute("dir", D);
for (g = 0; g < F.contents.length; g++) A.append(F.contents[g].clone(1, 1));
r++
} else if (F.indent == Math.max(u, 0) + 1) F = a[r - 1].element.getDirection(1), r = CKEDITOR.plugins.list.arrayToList(a, null, r, d, F != D ? D : null), !A.getChildCount() && CKEDITOR.env.needsNbspFiller && !(7 < f.$.documentMode) && A.append(f.createText("\u00a0")),
A.append(r.listNode), r = r.nextIndex;
else if (-1 == F.indent && !c && g) {
k[g.getName()] ? (A = F.element.clone(!1, !0), D != g.getDirection(1) && A.setAttribute("dir", D)) : A = new CKEDITOR.dom.documentFragment(f);
var q = g.getDirection(1) != D,
H = F.element,
I = H.getAttribute("class"),
J = H.getAttribute("style"),
N = A.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && (d != CKEDITOR.ENTER_BR || q || J || I),
P, R = F.contents.length,
L;
for (g = 0; g < R; g++)
if (P = F.contents[g], l(P) && 1 < R) N ? L = P.clone(1, 1) : A.append(P.clone(1, 1));
else if (P.type == CKEDITOR.NODE_ELEMENT &&
P.isBlockBoundary()) {
q && !P.getDirection() && P.setAttribute("dir", D);
B = P;
var K = H.getAttribute("style");
K && B.setAttribute("style", K.replace(/([^;])$/, "$1;") + (B.getAttribute("style") || ""));
I && P.addClass(I);
B = null;
L && (A.append(L), L = null);
A.append(P.clone(1, 1))
} else N ? (B || (B = f.createElement(E), A.append(B), q && B.setAttribute("dir", D)), J && B.setAttribute("style", J), I && B.setAttribute("class", I), L && (B.append(L), L = null), B.append(P.clone(1, 1))) : A.append(P.clone(1, 1));
L && ((B || A).append(L), L = null);
A.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT &&
r != a.length - 1 && (CKEDITOR.env.needsBrFiller && (D = A.getLast()) && D.type == CKEDITOR.NODE_ELEMENT && D.is("br") && D.remove(), D = A.getLast(n), (!D || !(D.type == CKEDITOR.NODE_ELEMENT && D.is(CKEDITOR.dtd.$block))) && A.append(f.createElement("br")));
D = A.$.nodeName.toLowerCase();
("div" == D || "p" == D) && A.appendBogus();
h.append(A);
q = null;
r++
} else return null;
B = null;
if (a.length <= r || Math.max(a[r].indent, 0) < u) break
}
if (b)
for (a = h.getFirst(); a;) {
if (a.type == CKEDITOR.NODE_ELEMENT && (CKEDITOR.dom.element.clearMarkers(b, a), a.getName() in
CKEDITOR.dtd.$listItem && (c = a, f = void 0, d = c.getDirection()))) {
for (e = c.getParent(); e && !(f = e.getDirection());) e = e.getParent();
d == f && c.removeAttribute("dir")
}
a = a.getNextSourceNode()
}
return {
listNode: h,
nextIndex: r
}
}
};
var r = /^h[1-6]$/,
u = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);
f.prototype = {
exec: function(b) {
this.refresh(b, b.elementPath());
var c = b.config,
e = b.getSelection(),
g = e && e.getRanges();
if (this.state == CKEDITOR.TRISTATE_OFF) {
var f = b.editable();
if (f.getFirst(n)) {
var h = 1 == g.length && g[0];
(c = h &&
h.getEnclosedNode()) && c.is && this.type == c.getName() && this.setState(CKEDITOR.TRISTATE_ON)
} else c.enterMode == CKEDITOR.ENTER_BR ? f.appendBogus() : g[0].fixBlock(1, c.enterMode == CKEDITOR.ENTER_P ? "p" : "div"), e.selectRanges(g)
}
for (var c = e.createBookmarks(!0), f = [], l = {}, g = g.createIterator(), q = 0;
(h = g.getNextRange()) && ++q;) {
var s = h.getBoundaryNodes(),
v = s.startNode,
u = s.endNode;
v.type == CKEDITOR.NODE_ELEMENT && "td" == v.getName() && h.setStartAt(s.startNode, CKEDITOR.POSITION_AFTER_START);
u.type == CKEDITOR.NODE_ELEMENT && "td" ==
u.getName() && h.setEndAt(s.endNode, CKEDITOR.POSITION_BEFORE_END);
h = h.createIterator();
for (h.forceBrBreak = this.state == CKEDITOR.TRISTATE_OFF; s = h.getNextParagraph();)
if (!s.getCustomData("list_block")) {
CKEDITOR.dom.element.setMarker(l, s, "list_block", 1);
for (var A = b.elementPath(s), v = A.elements, u = 0, A = A.blockLimit, D, B = v.length - 1; 0 <= B && (D = v[B]); B--)
if (k[D.getName()] && A.contains(D)) {
A.removeCustomData("list_group_object_" + q);
(v = D.getCustomData("list_group_object")) ? v.contents.push(s): (v = {
root: D,
contents: [s]
},
f.push(v), CKEDITOR.dom.element.setMarker(l, D, "list_group_object", v));
u = 1;
break
}
u || (u = A, u.getCustomData("list_group_object_" + q) ? u.getCustomData("list_group_object_" + q).contents.push(s) : (v = {
root: u,
contents: [s]
}, CKEDITOR.dom.element.setMarker(l, u, "list_group_object_" + q, v), f.push(v)))
}
}
for (D = []; 0 < f.length;)
if (v = f.shift(), this.state == CKEDITOR.TRISTATE_OFF)
if (k[v.root.getName()]) {
g = b;
q = v;
v = l;
h = D;
u = CKEDITOR.plugins.list.listToArray(q.root, v);
A = [];
for (s = 0; s < q.contents.length; s++)
if (B = q.contents[s], (B = B.getAscendant("li", !0)) && !B.getCustomData("list_item_processed")) A.push(B), CKEDITOR.dom.element.setMarker(v, B, "list_item_processed", !0);
for (var B = q.root.getDocument(), E = void 0, F = void 0, s = 0; s < A.length; s++) {
var H = A[s].getCustomData("listarray_index"),
E = u[H].parent;
E.is(this.type) || (F = B.createElement(this.type), E.copyAttributes(F, {
start: 1,
type: 1
}), F.removeStyle("list-style-type"), u[H].parent = F)
}
v = CKEDITOR.plugins.list.arrayToList(u, v, null, g.config.enterMode);
u = void 0;
A = v.listNode.getChildCount();
for (s = 0; s < A && (u = v.listNode.getChild(s)); s++) u.getName() ==
this.type && h.push(u);
v.listNode.replace(q.root);
g.fire("contentDomInvalidated")
} else {
u = b;
s = v;
h = D;
A = s.contents;
g = s.root.getDocument();
q = [];
1 == A.length && A[0].equals(s.root) && (v = g.createElement("div"), A[0].moveChildren && A[0].moveChildren(v), A[0].append(v), A[0] = v);
s = s.contents[0].getParent();
for (B = 0; B < A.length; B++) s = s.getCommonAncestor(A[B].getParent());
E = u.config.useComputedState;
u = v = void 0;
E = void 0 === E || E;
for (B = 0; B < A.length; B++)
for (F = A[B]; H = F.getParent();) {
if (H.equals(s)) {
q.push(F);
!u && F.getDirection() &&
(u = 1);
F = F.getDirection(E);
null !== v && (v = v && v != F ? null : F);
break
}
F = H
}
if (!(1 > q.length)) {
A = q[q.length - 1].getNext();
B = g.createElement(this.type);
for (h.push(B); q.length;) h = q.shift(), E = g.createElement("li"), h.is("pre") || r.test(h.getName()) || "false" == h.getAttribute("contenteditable") ? h.appendTo(E) : (h.copyAttributes(E), v && h.getDirection() && (E.removeStyle("direction"), E.removeAttribute("dir")), h.moveChildren(E), h.remove()), E.appendTo(B);
v && u && B.setAttribute("dir", v);
A ? B.insertBefore(A) : B.appendTo(s)
}
} else this.state ==
CKEDITOR.TRISTATE_ON && k[v.root.getName()] && d.call(this, b, v, l);
for (B = 0; B < D.length; B++) a(D[B]);
CKEDITOR.dom.element.clearAllMarkers(l);
e.selectBookmarks(c);
b.focus()
},
refresh: function(a, b) {
var c = b.contains(k, 1),
d = b.blockLimit || b.root;
c && d.contains(c) ? this.setState(c.is(this.type) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_OFF)
}
};
CKEDITOR.plugins.add("list", {
requires: "indentlist",
init: function(a) {
a.blockless || (a.addCommand("numberedlist", new f("numberedlist", "ol")), a.addCommand("bulletedlist",
new f("bulletedlist", "ul")), a.ui.addButton && (a.ui.addButton("NumberedList", {
label: a.lang.list.numberedlist,
command: "numberedlist",
directional: !0,
toolbar: "list,10"
}), a.ui.addButton("BulletedList", {
label: a.lang.list.bulletedlist,
command: "bulletedlist",
directional: !0,
toolbar: "list,20"
})), a.on("key", function(c) {
var d = c.data.keyCode;
if ("wysiwyg" == a.mode && d in {
8: 1,
46: 1
}) {
var f = a.getSelection().getRanges()[0],
h = f && f.startPath();
if (f && f.collapsed) {
var h = new CKEDITOR.dom.elementPath(f.startContainer),
l = 8 ==
d,
r = a.editable(),
u = new CKEDITOR.dom.walker(f.clone());
u.evaluator = function(a) {
return n(a) && !q(a)
};
u.guard = function(a, b) {
return !(b && a.type == CKEDITOR.NODE_ELEMENT && a.is("table"))
};
d = f.clone();
if (l) {
var s, v;
if ((s = h.contains(k)) && f.checkBoundaryOfElement(s, CKEDITOR.START) && (s = s.getParent()) && s.is("li") && (s = g(s))) v = s, s = s.getPrevious(n), d.moveToPosition(s && q(s) ? s : v, CKEDITOR.POSITION_BEFORE_START);
else if (u.range.setStartAt(r, CKEDITOR.POSITION_AFTER_START), u.range.setEnd(f.startContainer, f.startOffset), (s = u.previous()) && s.type == CKEDITOR.NODE_ELEMENT && (s.getName() in k || s.is("li"))) s.is("li") || (u.range.selectNodeContents(s), u.reset(), u.evaluator = b, s = u.previous()), v = s, d.moveToElementEditEnd(v);
if (v) e(a, d, f), c.cancel();
else if ((d = h.contains(k)) && f.checkBoundaryOfElement(d, CKEDITOR.START)) v = d.getFirst(n), f.checkBoundaryOfElement(v, CKEDITOR.START) && (s = d.getPrevious(n), g(v) ? s && (f.moveToElementEditEnd(s), f.select()) : a.execCommand("outdent"), c.cancel())
} else if (v = h.contains("li")) u.range.setEndAt(r, CKEDITOR.POSITION_BEFORE_END),
r = (h = v.getLast(n)) && b(h) ? h : v, v = 0, (s = u.next()) && s.type == CKEDITOR.NODE_ELEMENT && s.getName() in k && s.equals(h) ? (v = 1, s = u.next()) : f.checkBoundaryOfElement(r, CKEDITOR.END) && (v = 1), v && s && (f = f.clone(), f.moveToElementEditStart(s), e(a, d, f), c.cancel());
else if (u.range.setEndAt(r, CKEDITOR.POSITION_BEFORE_END), (s = u.next()) && s.type == CKEDITOR.NODE_ELEMENT && s.is(k)) s = s.getFirst(n), h.block && f.checkStartOfBlock() && f.checkEndOfBlock() ? (h.block.remove(), f.moveToElementEditStart(s), f.select()) : g(s) ? (f.moveToElementEditStart(s),
f.select()) : (f = f.clone(), f.moveToElementEditStart(s), e(a, d, f)), c.cancel();
setTimeout(function() {
a.selectionChange(1)
})
}
}
}))
}
})
}(),
function() {
function d(a) {
if (!a || a.type != CKEDITOR.NODE_ELEMENT || "form" != a.getName()) return [];
for (var b = [], c = ["style", "className"], d = 0; d < c.length; d++) {
var f = a.$.elements.namedItem(c[d]);
f && (f = new CKEDITOR.dom.element(f), b.push([f, f.nextSibling]), f.remove())
}
return b
}
function f(a, b) {
if (a && !(a.type != CKEDITOR.NODE_ELEMENT || "form" != a.getName()) && 0 < b.length)
for (var c = b.length -
1; 0 <= c; c--) {
var d = b[c][0],
f = b[c][1];
f ? d.insertBefore(f) : d.appendTo(a)
}
}
function c(a, b) {
var c = d(a),
h = {},
l = a.$;
b || (h["class"] = l.className || "", l.className = -1 !== l.className.indexOf("squarespace-damask") ? "squarespace-damask" : -1 !== l.className.indexOf("squarespace-cameron") ? "squarespace-cameron" : "");
h.inline = l.style.cssText || "";
b || (l.style.cssText = "position: static; overflow: visible");
f(c);
return h
}
function a(a, b) {
var c = d(a),
h = a.$;
"class" in b && (h.className = b["class"]);
"inline" in b && (h.style.cssText = b.inline);
f(c)
}
function b(a) {
if (!a.editable().isInline()) {
var b = CKEDITOR.instances,
c;
for (c in b) {
var d = b[c];
"wysiwyg" == d.mode && !d.readOnly && (d = d.document.getBody(), d.setAttribute("contentEditable", !1), d.setAttribute("contentEditable", !0))
}
a.editable().hasFocus && (a.toolbox.focus(), a.focus())
}
}
CKEDITOR.plugins.add("maximize", {
init: function(d) {
function f() {
var a = l.getViewPaneSize();
d.resize(a.width, a.height, null, !0)
}
if (d.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
var k = d.lang,
h = CKEDITOR.document,
l = h.getWindow(),
n, q, r, u = CKEDITOR.TRISTATE_OFF;
d.addCommand("maximize", {
modes: {
wysiwyg: !CKEDITOR.env.iOS,
source: !CKEDITOR.env.iOS
},
readOnly: 1,
editorFocus: !1,
exec: function() {
var m = d.container.getChild(1),
p = d.ui.space("contents");
if ("wysiwyg" == d.mode) {
var w = d.getSelection();
n = w && w.getRanges();
q = l.getScrollPosition()
} else {
var t = d.editable().$;
n = !CKEDITOR.env.ie && [t.selectionStart, t.selectionEnd];
q = [t.scrollLeft, t.scrollTop]
}
if (this.state == CKEDITOR.TRISTATE_OFF) {
l.on("resize", f);
r = l.getScrollPosition();
for (w = d.container; w =
w.getParent();) w.setCustomData("maximize_saved_styles", c(w)), w.setStyle("z-index", d.config.baseFloatZIndex - 5);
p.setCustomData("maximize_saved_styles", c(p, !0));
m.setCustomData("maximize_saved_styles", c(m, !0));
p = {
overflow: CKEDITOR.env.webkit ? "" : "hidden",
width: 0,
height: 0
};
h.getDocumentElement().setStyles(p);
!CKEDITOR.env.gecko && h.getDocumentElement().setStyle("position", "fixed");
(!CKEDITOR.env.gecko || !CKEDITOR.env.quirks) && h.getBody().setStyles(p);
CKEDITOR.env.ie ? setTimeout(function() {
l.$.scrollTo(0,
0)
}, 0) : l.$.scrollTo(0, 0);
m.setStyle("position", CKEDITOR.env.gecko && CKEDITOR.env.quirks ? "fixed" : "absolute");
m.$.offsetLeft;
m.setStyles({
"z-index": d.config.baseFloatZIndex - 5,
left: "0px",
top: "0px"
});
m.addClass("cke_maximized");
f();
p = m.getDocumentPosition();
m.setStyles({
left: -1 * p.x + "px",
top: -1 * p.y + "px"
});
CKEDITOR.env.gecko && b(d)
} else if (this.state == CKEDITOR.TRISTATE_ON) {
l.removeListener("resize", f);
p = [p, m];
for (w = 0; w < p.length; w++) a(p[w], p[w].getCustomData("maximize_saved_styles")), p[w].removeCustomData("maximize_saved_styles");
for (w = d.container; w = w.getParent();) a(w, w.getCustomData("maximize_saved_styles")), w.removeCustomData("maximize_saved_styles");
CKEDITOR.env.ie ? setTimeout(function() {
l.$.scrollTo(r.x, r.y)
}, 0) : l.$.scrollTo(r.x, r.y);
m.removeClass("cke_maximized");
CKEDITOR.env.webkit && (m.setStyle("display", "inline"), setTimeout(function() {
m.setStyle("display", "block")
}, 0));
d.fire("resize")
}
this.toggleState();
if (w = this.uiItems[0]) p = this.state == CKEDITOR.TRISTATE_OFF ? k.maximize.maximize : k.maximize.minimize, w = CKEDITOR.document.getById(w._.id),
w.getChild(1).setHtml(p), w.setAttribute("title", p), w.setAttribute("href", 'javascript:void("' + p + '");');
"wysiwyg" == d.mode ? n ? (CKEDITOR.env.gecko && b(d), d.getSelection().selectRanges(n), (t = d.getSelection().getStartElement()) && t.scrollIntoView(!0)) : l.$.scrollTo(q.x, q.y) : (n && (t.selectionStart = n[0], t.selectionEnd = n[1]), t.scrollLeft = q[0], t.scrollTop = q[1]);
n = q = null;
u = this.state;
d.fire("maximize", this.state)
},
canUndo: !1
});
d.ui.addButton && d.ui.addButton("Maximize", {
label: k.maximize.maximize,
command: "maximize",
toolbar: "tools,10"
});
d.on("mode", function() {
var a = d.getCommand("maximize");
a.setState(a.state == CKEDITOR.TRISTATE_DISABLED ? CKEDITOR.TRISTATE_DISABLED : u)
}, null, null, 100)
}
}
})
}(),
function() {
var d = {
canUndo: !1,
async: !0,
exec: function(f) {
f.getClipboardData({
title: f.lang.pastetext.title
}, function(c) {
c && f.fire("paste", {
type: "text",
dataValue: c.dataValue
});
f.fire("afterCommandExec", {
name: "pastetext",
command: d,
returnValue: !!c
})
})
}
};
CKEDITOR.plugins.add("pastetext", {
requires: "clipboard",
init: function(f) {
f.addCommand("pastetext",
d);
f.ui.addButton && f.ui.addButton("PasteText", {
label: f.lang.pastetext.button,
command: "pastetext",
toolbar: "clipboard,40"
});
if (f.config.forcePasteAsPlainText) f.on("beforePaste", function(c) {
"html" != c.data.type && (c.data.type = "text")
});
f.on("pasteState", function(c) {
f.getCommand("pastetext").setState(c.data)
})
}
})
}(), CKEDITOR.plugins.add("removeformat", {
init: function(d) {
d.addCommand("removeFormat", CKEDITOR.plugins.removeformat.commands.removeformat);
d.ui.addButton && d.ui.addButton("RemoveFormat", {
label: d.lang.removeformat.toolbar,
command: "removeFormat",
toolbar: "cleanup,10"
})
}
}), CKEDITOR.plugins.removeformat = {
commands: {
removeformat: {
exec: function(d) {
for (var f = d._.removeFormatRegex || (d._.removeFormatRegex = RegExp("^(?:" + d.config.removeFormatTags.replace(/,/g, "|") + ")$", "i")), c = d._.removeAttributes || (d._.removeAttributes = d.config.removeFormatAttributes.split(",")), a = CKEDITOR.plugins.removeformat.filter, b = d.getSelection().getRanges(1), e = b.createIterator(), g; g = e.getNextRange();) {
g.collapsed || g.enlarge(CKEDITOR.ENLARGE_ELEMENT);
var k =
g.createBookmark(),
h = k.startNode,
l = k.endNode,
n = function(b) {
for (var c = d.elementPath(b), e = c.elements, g = 1, h;
(h = e[g]) && !h.equals(c.block) && !h.equals(c.blockLimit); g++) f.test(h.getName()) && a(d, h) && b.breakParent(h)
};
n(h);
if (l) {
n(l);
for (h = h.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT); h && !h.equals(l);) n = h.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT), !("img" == h.getName() && h.data("cke-realelement")) && a(d, h) && (f.test(h.getName()) ? h.remove(1) : (h.removeAttributes(c), d.fire("removeFormatCleanup", h))), h = n
}
g.moveToBookmark(k)
}
d.forceNextSelectionCheck();
d.getSelection().selectRanges(b)
}
}
},
filter: function(d, f) {
for (var c = d._.removeFormatFilters || [], a = 0; a < c.length; a++)
if (!1 === c[a](f)) return !1;
return !0
}
}, CKEDITOR.editor.prototype.addRemoveFormatFilter = function(d) {
this._.removeFormatFilters || (this._.removeFormatFilters = []);
this._.removeFormatFilters.push(d)
}, CKEDITOR.config.removeFormatTags = "b,big,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var", CKEDITOR.config.removeFormatAttributes = "class,style,lang,width,height,align,hspace,valign",
function() {
function d(a) {
this.editor = a;
this.reset()
}
CKEDITOR.plugins.add("undo", {
init: function(a) {
function b(a) {
f.enabled && !1 !== a.data.command.canUndo && f.save()
}
function c() {
f.enabled = a.readOnly ? !1 : "wysiwyg" == a.mode;
f.onChange()
}
var f = a.undoManager = new d(a),
k = a.addCommand("undo", {
exec: function() {
f.undo() && (a.selectionChange(), this.fire("afterUndo"))
},
startDisabled: !0,
canUndo: !1
}),
h = a.addCommand("redo", {
exec: function() {
f.redo() && (a.selectionChange(), this.fire("afterRedo"))
},
startDisabled: !0,
canUndo: !1
});
a.setKeystroke([
[CKEDITOR.CTRL + 90, "undo"],
[CKEDITOR.CTRL + 89, "redo"],
[CKEDITOR.CTRL + CKEDITOR.SHIFT + 90, "redo"]
]);
f.onChange = function() {
k.setState(f.undoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
h.setState(f.redoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
};
a.on("beforeCommandExec", b);
a.on("afterCommandExec", b);
a.on("saveSnapshot", function(a) {
f.save(a.data && a.data.contentOnly)
});
a.on("contentDom", function() {
a.editable().on("keydown", function(a) {
a = a.data.getKey();
(8 == a || 46 ==
a) && f.type(a, 0)
});
a.editable().on("keypress", function(a) {
f.type(a.data.getKey(), 1)
})
});
a.on("beforeModeUnload", function() {
"wysiwyg" == a.mode && f.save(!0)
});
a.on("mode", c);
a.on("readOnly", c);
a.ui.addButton && (a.ui.addButton("Undo", {
label: a.lang.undo.undo,
command: "undo",
toolbar: "undo,10"
}), a.ui.addButton("Redo", {
label: a.lang.undo.redo,
command: "redo",
toolbar: "undo,20"
}));
a.resetUndo = function() {
f.reset();
a.fire("saveSnapshot")
};
a.on("updateSnapshot", function() {
f.currentImage && f.update()
});
a.on("lockSnapshot",
function(a) {
f.lock(a.data && a.data.dontUpdate)
});
a.on("unlockSnapshot", f.unlock, f)
}
});
CKEDITOR.plugins.undo = {};
var f = CKEDITOR.plugins.undo.Image = function(a, b) {
this.editor = a;
a.fire("beforeUndoImage");
var c = a.getSnapshot();
CKEDITOR.env.ie && c && (c = c.replace(/\s+data-cke-expando=".*?"/g, ""));
this.contents = c;
b || (this.bookmarks = (c = c && a.getSelection()) && c.createBookmarks2(!0));
a.fire("afterUndoImage")
},
c = /\b(?:href|src|name)="[^"]*?"/gi;
f.prototype = {
equalsContent: function(a) {
var b = this.contents;
a = a.contents;
if (CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat)) b = b.replace(c, ""), a = a.replace(c, "");
return b != a ? !1 : !0
},
equalsSelection: function(a) {
var b = this.bookmarks;
a = a.bookmarks;
if (b || a) {
if (!b || !a || b.length != a.length) return !1;
for (var c = 0; c < b.length; c++) {
var d = b[c],
f = a[c];
if (d.startOffset != f.startOffset || d.endOffset != f.endOffset || !CKEDITOR.tools.arrayCompare(d.start, f.start) || !CKEDITOR.tools.arrayCompare(d.end, f.end)) return !1
}
}
return !0
}
};
d.prototype = {
type: function(a, b) {
var c = !b && a != this.lastKeystroke,
d = this.editor;
if (!this.typing || b && !this.wasCharacter || c) {
var k = new f(d),
h = this.snapshots.length;
CKEDITOR.tools.setTimeout(function() {
var a = d.getSnapshot();
CKEDITOR.env.ie && (a = a.replace(/\s+data-cke-expando=".*?"/g, ""));
k.contents != a && h == this.snapshots.length && (this.typing = !0, this.save(!1, k, !1) || this.snapshots.splice(this.index + 1, this.snapshots.length - this.index - 1), this.hasUndo = !0, this.hasRedo = !1, this.modifiersCount = this.typesCount = 1, this.onChange())
}, 0, this)
}
this.lastKeystroke = a;
(this.wasCharacter =
b) ? (this.modifiersCount = 0, this.typesCount++, 25 < this.typesCount ? (this.save(!1, null, !1), this.typesCount = 1) : setTimeout(function() {
d.fire("change")
}, 0)) : (this.typesCount = 0, this.modifiersCount++, 25 < this.modifiersCount ? (this.save(!1, null, !1), this.modifiersCount = 1) : setTimeout(function() {
d.fire("change")
}, 0))
},
reset: function() {
this.lastKeystroke = 0;
this.snapshots = [];
this.index = -1;
this.limit = this.editor.config.undoStackSize || 20;
this.currentImage = null;
this.hasRedo = this.hasUndo = !1;
this.locked = null;
this.resetType()
},
resetType: function() {
this.typing = !1;
delete this.lastKeystroke;
this.modifiersCount = this.typesCount = 0
},
fireChange: function() {
this.hasUndo = !!this.getNextImage(!0);
this.hasRedo = !!this.getNextImage(!1);
this.resetType();
this.onChange()
},
save: function(a, b, c) {
if (this.locked) return !1;
var d = this.snapshots;
b || (b = new f(this.editor));
if (!1 === b.contents) return !1;
if (this.currentImage)
if (b.equalsContent(this.currentImage)) {
if (a || b.equalsSelection(this.currentImage)) return !1
} else this.editor.fire("change");
d.splice(this.index +
1, d.length - this.index - 1);
d.length == this.limit && d.shift();
this.index = d.push(b) - 1;
this.currentImage = b;
!1 !== c && this.fireChange();
return !0
},
restoreImage: function(a) {
var b = this.editor,
c;
a.bookmarks && (b.focus(), c = b.getSelection());
this.locked = 1;
this.editor.loadSnapshot(a.contents);
a.bookmarks ? c.selectBookmarks(a.bookmarks) : CKEDITOR.env.ie && (c = this.editor.document.getBody().$.createTextRange(), c.collapse(!0), c.select());
this.locked = 0;
this.index = a.index;
this.currentImage = this.snapshots[this.index];
this.update();
this.fireChange();
b.fire("change")
},
getNextImage: function(a) {
var b = this.snapshots,
c = this.currentImage,
d;
if (c)
if (a)
for (d = this.index - 1; 0 <= d; d--) {
if (a = b[d], !c.equalsContent(a)) return a.index = d, a
} else
for (d = this.index + 1; d < b.length; d++)
if (a = b[d], !c.equalsContent(a)) return a.index = d, a;
return null
},
redoable: function() {
return this.enabled && this.hasRedo
},
undoable: function() {
return this.enabled && this.hasUndo
},
undo: function() {
if (this.undoable()) {
this.save(!0);
var a = this.getNextImage(!0);
if (a) return this.restoreImage(a), !0
}
return !1
},
redo: function() {
if (this.redoable() && (this.save(!0), this.redoable())) {
var a = this.getNextImage(!1);
if (a) return this.restoreImage(a), !0
}
return !1
},
update: function(a) {
if (!this.locked) {
a || (a = new f(this.editor));
for (var b = this.index, c = this.snapshots; 0 < b && this.currentImage.equalsContent(c[b - 1]);) b -= 1;
c.splice(b, this.index - b + 1, a);
this.index = b;
this.currentImage = a
}
},
lock: function(a) {
this.locked ? this.locked.level++ : a ? this.locked = {
level: 1
} : (a = new f(this.editor, !0), this.locked = {
update: this.currentImage &&
this.currentImage.equalsContent(a) ? a : null,
level: 1
})
},
unlock: function() {
if (this.locked && !--this.locked.level) {
var a = this.locked.update,
b = a && new f(this.editor, !0);
this.locked = null;
a && !a.equalsContent(b) && this.update()
}
}
}
}(),
function() {
CKEDITOR.plugins.add("sqslink", {
init: function(d) {
d.addCommand("sqslink", CKEDITOR.plugins.sqslink);
d.ui.addButton && d.ui.addButton("sqslink", {
label: "Edit Link",
command: "sqslink",
toolbar: "sqs"
});
d.on("click", function(f) {
f = CKEDITOR.plugins.sqslink.getSelectedLink(d) || f.data.element;
!f.isReadOnly() && f.is("a") && (d.getSelection().selectElement(f), CKEDITOR.plugins.sqslink.exec(d))
});
d.on("contentDomUnload", function() {
CKEDITOR.plugins.sqslink.linkDialog && CKEDITOR.plugins.sqslink.linkDialog.close()
})
}
});
CKEDITOR.plugins.sqslink = {
getSelectedLink: function(d) {
var f = d.getSelection(),
c = f.getSelectedElement();
return c && c.is("a") ? c : (f = f.getRanges(!0)[0]) ? (f.shrink(CKEDITOR.SHRINK_TEXT), d.elementPath(f.getCommonAncestor()).contains("a", 1)) : null
},
initializeFlyout: function(d) {
CKEDITOR.plugins.sqslink.linkDialog =
new E.Squarespace.Flyout.LinkEdit;
CKEDITOR.plugins.sqslink.linkDialog.on("dataChange", function(f) {
f = f.newVal;
var c = f.anchorNode;
if (c) {
var a = c.getAttribute("href"),
b = c.hasAttribute("target");
if (a !== f.linkUrl || b !== f.newWindow) c.setAttribute("href", f.linkUrl), c.setAttribute("data-cke-saved-href", f.linkUrl), f.newWindow ? c.setAttribute("target", "_blank") : c.removeAttribute("target"), this.data.hasChanged = !0, d.fire("change")
}
}, this);
CKEDITOR.plugins.sqslink.linkDialog.on("close", function() {
if (this.data.newlink &&
!this.data.hasChanged) {
var f = new CKEDITOR.style({
element: "a",
type: CKEDITOR.STYLE_INLINE,
alwaysRemoveElement: 1
}),
c = this.data.range,
a = function(a) {
a && (1 == a.type && a.is("a")) && (d.getSelection().selectElement(a), d.removeStyle(f))
};
if (c.startContainer !== c.endContainer) {
for (var b = c.startContainer; b && b.$ !== c.endContainer.$;) nextCont = b.getNextSourceNode(), a(b), b = nextCont;
a(b)
}
}
this.data.hasChanged && (d.changed = !0);
CKEDITOR.plugins.sqslink.linkDialog.destroy();
CKEDITOR.plugins.sqslink.linkDialog = null
}, this);
CKEDITOR.plugins.sqslink.linkDialog.on("unlink", function() {
var f = new CKEDITOR.style({
element: "a",
type: CKEDITOR.STYLE_INLINE,
alwaysRemoveElement: 1
});
d.removeStyle(f);
d.changed = !0;
d.fire("change")
}, this)
},
exec: function(d) {
if (CKEDITOR.plugins.sqslink.linkDialog) {
if (CKEDITOR.plugins.sqslink.linkDialog._editPanel.get("visible") || CKEDITOR.plugins.sqslink.linkDialog._promptPanel.get("visible")) {
CKEDITOR.plugins.sqslink.linkDialog.close();
return
}
} else this.initializeFlyout(d);
this.data = {};
var f = d.getSelection(),
c = null;
(c = this.getSelectedLink(d)) && c.hasAttribute("href") ? f.selectElement(c) : c = null;
f = f.getRanges(!0)[0];
if (!f.collapsed) {
var a;
if (!d.editable().isInline()) {
var b = d.window.getScrollPosition();
a = E.one(d.window.getFrame().$).getXY();
a[0] -= window.scrollX - b.x;
a[1] -= window.scrollY - Math.min(window.scrollY, 37) + b.y
}
this.data.range = f;
if (!c || !c.is("a")) {
d = new CKEDITOR.style({
element: "a",
attributes: {
href: "#"
}
});
d.type = CKEDITOR.STYLE_INLINE;
d.applyToRange(f);
for (f.select(); f.startContainer.is("strong") || f.startContainer.is("em");) f.setStart(f.startContainer.getParent());
this.data.newlink = !0;
this.data.range = f;
CKEDITOR.plugins.sqslink.linkDialog.openEdit(E.one(f.startContainer.$), void 0, void 0, void 0, a)
} else CKEDITOR.plugins.sqslink.linkDialog.openPrompt(E.one(c.$), void 0, void 0, void 0, a);
CKEDITOR.plugins.sqslink.linkDialog.on("dataChange", function(a) {
function b(a) {
if (a && 1 == a.type && a.is("a")) {
var d = a.getAttribute("href"),
e = a.hasAttribute("target");
if (d !== c.linkUrl || e !== c.newWindow) a.setAttribute("href", c.linkUrl), a.setAttribute("data-cke-saved-href", c.linkUrl), c.newWindow ?
a.setAttribute("target", "_blank") : a.removeAttribute("target")
}
}
var c = a.newVal;
if (this.data.range && this.data.range.startContainer.$ !== this.data.range.endContainer.$) {
for (a = this.data.range.startContainer.getNextSourceNode(); a && a.$ !== this.data.range.endContainer.$;) b(a), a = a.getNextSourceNode();
b(a)
}
}, this)
}
},
canUndo: !1
}
}(), CKEDITOR.config.customConfig = !1, CKEDITOR.editorConfig = function(d) {
d.placeholder = "Write here...";
d.title = !1;
d.stylesSet = !1;
d.baseFloatZIndex = 2 * E.Squarespace.DIALOG_ZINDEX_BASE;
d.extraPlugins =
"";
d.format_tags = "p;h1;h2;h3;quote;pre";
d.extraAllowedContent = "a[!href,document-href,target];p h1 h2 h3{text-align};span{font-size}";
d.justifyClasses = ["text-align-left", "text-align-center", "text-align-right", "text-align-justify"];
d.removeFormatTags = "b,big,code,del,dfn,em,font,h1,h2,h3,h4,h5,h6,i,ins,kbd,pre,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var";
d.contentsCss = "/universal/styles-v6/ckeditor_contents.css";
d.dialog_backgroundCoverColor = "#222";
d.disableNativeSpellChecker = !1;
d.blockedKeystrokes = [CKEDITOR.CTRL + 66, CKEDITOR.CTRL + 73, CKEDITOR.CTRL + 85, CKEDITOR.CTRL + 90, CKEDITOR.CTRL + CKEDITOR.SHIFT + 90]
}, CKEDITOR.lang.en = {
undo: {
redo: "Redo",
undo: "Undo"
},
toolbar: {
toolbarCollapse: "Collapse Toolbar",
toolbarExpand: "Expand Toolbar",
toolbarGroups: {
document: "Document",
clipboard: "Clipboard/Undo",
editing: "Editing",
forms: "Forms",
basicstyles: "Basic Styles",
paragraph: "Paragraph",
links: "Links",
insert: "Insert",
styles: "Styles",
colors: "Colors",
tools: "Tools"
},
toolbars: "Editor toolbars"
},
removeformat: {
toolbar: "Remove Format"
},
pastetext: {
button: "Paste as plain text",
title: "Paste as Plain Text"
},
maximize: {
maximize: "Maximize",
minimize: "Minimize"
},
list: {
bulletedlist: "Insert/Remove Bulleted List",
numberedlist: "Insert/Remove Numbered List"
},
justify: {
block: "Justify",
center: "Center",
left: "Align Left",
right: "Align Right"
},
indent: {
indent: "Increase Indent",
outdent: "Decrease Indent"
},
format: {
label: "Format",
panelTitle: "Paragraph Format",
tag_address: "Address",
tag_div: "Normal (DIV)",
tag_h1: "Heading 1",
tag_h2: "Heading 2",
tag_h3: "Heading 3",
tag_h4: "Heading 4",
tag_h5: "Heading 5",
tag_h6: "Heading 6",
tag_p: "Normal",
tag_quote: "Quote",
tag_pre: "Code"
},
clipboard: {
copy: "Copy",
copyError: "Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).",
cut: "Cut",
cutError: "Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).",
paste: "Paste",
pasteArea: "Paste Area",
pasteMsg: "Paste into the box below using the keyboard (<strong>Ctrl/Cmd+V</strong>) and hit OK. Squarespace will strip out special formatting and insert this content to your document as plain text.",
securityMsg: "",
title: "Paste"
},
blockquote: {
toolbar: "Block Quote"
},
basicstyles: {
bold: "Bold",
italic: "Italic",
strike: "Strike Through",
subscript: "Subscript",
superscript: "Superscript",
underline: "Underline"
},
editor: "Rich Text Editor",
editorPanel: "Rich Text Editor panel",
sourcearea: {
toolbar: "< >"
},
sourcedialog: {
toolbar: "< >",
title: "Source"
},
common: {
editorHelp: "Press ALT 0 for help",
browseServer: "Browse Server",
url: "URL",
protocol: "Protocol",
upload: "Upload",
uploadSubmit: "Send it to the Server",
image: "Image",
flash: "Flash",
form: "Form",
checkbox: "Checkbox",
radio: "Radio Button",
textField: "Text Field",
textarea: "Textarea",
hiddenField: "Hidden Field",
button: "Button",
select: "Selection Field",
imageButton: "Image Button",
notSet: "<not set>",
id: "Id",
name: "Name",
langDir: "Language Direction",
langDirLtr: "Left to Right (LTR)",
langDirRtl: "Right to Left (RTL)",
langCode: "Language Code",
longDescr: "Long Description URL",
cssClass: "Stylesheet Classes",
advisoryTitle: "Advisory Title",
cssStyle: "Style",
ok: "OK",
cancel: "Cancel",
close: "Close",
preview: "Preview",
resize: "Resize",
generalTab: "General",
advancedTab: "Advanced",
validateNumberFailed: "This value is not a number.",
confirmNewPage: "Any unsaved changes to this content will be lost. Are you sure you want to load new page?",
confirmCancel: "You have changed some options. Are you sure you want to close the dialog window?",
options: "Options",
target: "Target",
targetNew: "New Window (_blank)",
targetTop: "Topmost Window (_top)",
targetSelf: "Same Window (_self)",
targetParent: "Parent Window (_parent)",
langDirLTR: "Left to Right (LTR)",
langDirRTL: "Right to Left (RTL)",
styles: "Style",
cssClasses: "Stylesheet Classes",
width: "Width",
height: "Height",
align: "Alignment",
alignLeft: "Left",
alignRight: "Right",
alignCenter: "Center",
alignTop: "Top",
alignMiddle: "Middle",
alignBottom: "Bottom",
invalidValue: "Invalid value.",
invalidHeight: "Height must be a number.",
invalidWidth: "Width must be a number.",
invalidCssLength: 'Value specified for the "%1" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).',
invalidHtmlLength: 'Value specified for the "%1" field must be a positive number with or without a valid HTML measurement unit (px or %).',
invalidInlineStyle: 'Value specified for the inline style must consist of one or more tuples with the format of "name : value", separated by semi-colons.',
cssLengthTooltip: "Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).",
unavailable: '%1<span class="cke_accessibility">, unavailable</span>'
}
}, CKEDITOR.lang.en.dir =
"ltr", CKEDITOR.plugins.add("sqsloader", {
init: function(d) {
d.on("instanceReady", function(d) {
if (!d.editor.editable().isInline()) {
var c = document.createElement("link"),
a = CKEDITOR.instances[d.editor.name];
c.rel = "stylesheet";
c.href = "//static.squarespace.com/universal/fonts/hfj/22049/6450A57A8AE2B86E8.css";
c.type = "text/css";
c.onload = function() {
try {
a.window.$.Typekit.load()
} catch (b) {}
};
a.document.getHead().$.appendChild(c)
}
});
d.on("beforeCommandExec", function(d) {
d = d.editor;
var c = ["id"];
if (d.getSelection()) {
d.undoManager.lock();
for (var a = d.getSelection().getRanges(1), b = a.createIterator(), e; e = b.getNextRange();) {
e.collapsed || e.enlarge(CKEDITOR.ENLARGE_ELEMENT);
var g = e.createBookmark(),
k = g.startNode,
h = g.endNode;
if (h)
for (k = k.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT); k && !k.equals(h);) {
var l = k.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT);
k.data("cke-realelement") || k.removeAttributes(c);
k = l
}
e.moveToBookmark(g)
}
d.forceNextSelectionCheck();
d.getSelection().selectRanges(a);
d.undoManager.unlock()
}
});
CKEDITOR.dom.element.prototype.getDirection =
function() {
return "ltr"
};
CKEDITOR.dom.node.prototype.isReadOnly = function() {
var d = this;
for (this.type != CKEDITOR.NODE_ELEMENT && (d = this.getParent()); d && !d.data("cke-editable");) {
if ("false" == d.getAttribute("contentEditable")) return !0;
if ("true" == d.getAttribute("contentEditable")) break;
d = d.getParent()
}
return !d
};
d.on("contentDom", function() {
d.document.on("dragstart", function() {})
});
(function() {
var d = {
address: 1,
blockquote: 1,
div: 1,
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1,
p: 1,
pre: 1,
section: 1,
header: 1,
footer: 1,
nav: 1,
article: 1,
aside: 1,
figure: 1,
dialog: 1,
hgroup: 1,
time: 1,
meter: 1,
menu: 1,
command: 1,
keygen: 1,
output: 1,
progress: 1,
details: 1,
datagrid: 1,
datalist: 1
},
c = {
a: 1,
embed: 1,
hr: 1,
img: 1,
li: 1,
object: 1,
ol: 1,
table: 1,
td: 1,
tr: 1,
th: 1,
ul: 1,
dl: 1,
dt: 1,
dd: 1,
form: 1,
audio: 1,
video: 1
},
a = /\s*(?:;\s*|$)/;
CKEDITOR.dom.walker.bookmark(0, 1);
CKEDITOR.dom.walker.whitespaces(1);
CKEDITOR.style2 = function(a, e) {
var g = a.attributes;
g && g.style && (a.styles = CKEDITOR.tools.extend({}, a.styles, CKEDITOR.tools.parseCssText(g.style)), delete g.style);
e && (a = CKEDITOR.tools.clone(a),
replaceVariables(a.attributes, e), replaceVariables(a.styles, e));
g = this.element = a.element ? "string" == typeof a.element ? a.element.toLowerCase() : a.element : "*";
this.type = a.type || (d[g] ? CKEDITOR.STYLE_BLOCK : c[g] ? CKEDITOR.STYLE_OBJECT : CKEDITOR.STYLE_INLINE);
"object" == typeof this.element && (this.type = CKEDITOR.STYLE_OBJECT);
this._ = {
definition: a
}
};
CKEDITOR.style2.prototype = CKEDITOR.style.prototype;
CKEDITOR.style = CKEDITOR.style2;
CKEDITOR.style.getStyleText = function(b) {
var c = b._ST;
if (c) return c;
var c = b.styles,
d =
b.attributes && b.attributes.style || "",
f = "";
d.length && (d = d.replace(a, ";"));
for (var h in c) {
var l = c[h],
n = (h + ":" + l).replace(a, ";");
"inherit" == l ? f += n : d += n
}
d.length && (d = CKEDITOR.tools.normalizeCssText(d, !0));
return b._ST = d + f
}
})()
}
}), CKEDITOR.plugins.add("sqsremoveblock", {
init: function(d) {
d.addCommand("sqsremoveblock", CKEDITOR.plugins.sqsremoveblock);
d.ui.addButton && d.ui.addButton("sqsremoveblock", {
label: "Remove Block",
command: "sqsremoveblock",
toolbar: "sqs"
})
}
}), CKEDITOR.plugins.sqsremoveblock = {
exec: function(d) {
d.fire("removeBlock")
},
canUndo: !1,
readOnly: 1
},
function() {
function d(b) {
var d = b.config,
g = b.fire("uiSpace", {
space: "top",
html: ""
}).html,
k = function() {
function f(b) {
var c = l.getDocumentPosition();
switch (b) {
case "top":
h.setStyle("top", a(c.y - t - z));
h.setStyle("position", "absolute");
break;
case "pin":
case "bottom":
h.setStyle("top", a(d.floatSpacePinnedOffsetY)), h.setStyle("position", "fixed")
}
g = b
}
var g, l, m, n, w, t, x, y = d.floatSpaceDockedOffsetX || 0,
z = d.floatSpaceDockedOffsetY || 0,
C = d.floatSpacePinnedOffsetX || 0;
return function(s) {
if (l = b.editable())
if (s &&
"focus" == s.name && h.show(), h.removeStyle("left"), h.removeStyle("right"), m = h.getClientRect(), n = l.getClientRect(), w = c.getViewPaneSize(), t = m.height, x = "pageXOffset" in c.$ ? c.$.pageXOffset : CKEDITOR.document.$.documentElement.scrollLeft, g) {
t + z <= n.top - d.floatSpacePinnedOffsetY ? f("top") : t + z > w.height - n.bottom ? f("pin") : f("bottom");
s = w.width / 2;
s = 0 < n.left && n.right < w.width && n.width > m.width ? "rtl" == b.config.contentsLangDirection ? "right" : "left" : s - n.left > n.right - s ? "left" : "right";
var v;
m.width > w.width ? (s = "left", v = 0) :
(v = "left" == s ? 0 < n.left ? n.left : 0 : n.right < w.width ? w.width - n.right : 0, v + m.width > w.width && (s = "left" == s ? "right" : "left", v = 0));
h.setStyle(s, a(("pin" == g ? C : y) + v + ("pin" == g ? 0 : "left" == s ? x : -x)))
} else g = "pin", f("pin"), k(s)
}
}();
if (g) {
var h = CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(f.output({
content: g,
id: b.id,
langDir: b.lang.dir,
langCode: b.langCode,
name: b.name,
style: "display:none;z-index:" + (d.baseFloatZIndex - 1),
topId: b.ui.spaceId("top"),
voiceLabel: b.lang.editorPanel + ", " + b.name
}))),
l = CKEDITOR.tools.eventsBuffer(500,
k),
n = CKEDITOR.tools.eventsBuffer(100, k);
h.unselectable();
h.on("mousedown", function(a) {
a = a.data;
a.getTarget().hasAscendant("a", 1) || a.preventDefault()
});
b.on("focus", function(a) {
k(a);
b.on("change", l.input);
c.on("scroll", n.input);
c.on("resize", n.input)
});
b.on("blur", function() {
h.hide();
b.removeListener("change", l.input);
c.removeListener("scroll", n.input);
c.removeListener("resize", n.input)
});
b.on("destroy", function() {
c.removeListener("scroll", n.input);
c.removeListener("resize", n.input);
h.clearCustomData();
h.remove()
});
b.focusManager.hasFocus && h.show();
b.focusManager.add(h, 1)
}
}
var f = CKEDITOR.addTemplate("floatcontainer", '<div id="cke_{name}" class="cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir="{langDir}" title="' + (CKEDITOR.env.gecko ? " " : "") + '" lang="{langCode}" role="application" style="{style}" aria-labelledby="cke_{name}_arialbl"><span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span><div class="cke_inner"><div id="{topId}" class="cke_top" role="presentation">{content}</div></div></div>'),
c = CKEDITOR.document.getWindow(),
a = CKEDITOR.tools.cssLength;
CKEDITOR.plugins.add("sqsfloatingspace", {
init: function(a) {
a.on("loaded", function() {
d(this)
}, null, null, 20)
}
})
}(),
function() {
function d(a) {
if (20 < a.length) return !1;
a = a.replace(/[\n|\t]*/g, "").toLowerCase();
return !a || "<br>" == a || "<p>&nbsp;<br></p>" == a || "<p><br></p>" == a || "<p>&nbsp;</p>" == a || "&nbsp;" == a || " " == a || "&nbsp;<br>" == a || " <br>" == a ? !0 : !1
}
function f(a) {
var c = a.editor,
f = c.editable ? c.editable() : "wysiwyg" == c.mode ? c.document && c.document.getBody() :
c.textarea,
h = a.listenerData;
c.editable().isInline() && ("wysiwyg" == c.mode ? !CKEDITOR.dialog._.currentTop && (f && d(f.getHtml().replace(/(?:[ ]{2})|(?:\s{0,20}id="yui[^"]+")|(?:(\w?)\u200b(\w?))/g, ""))) && (f.setHtml(h), f.addClass("placeholder")) : b ? "mode" == a.name && f.setAttribute("placeholder", h) : d(f.getValue().replace(/(?:[ ]{2})|(?:\s{0,20}id="yui[^"]+")|(?:(\w?)\u200b(\w?))/g, "")) && (f.setValue(h), f.addClass("placeholder")))
}
function c(a) {
a = a.editor;
var b = a.editable ? a.editable() : "wysiwyg" == a.mode ? a.document &&
a.document.getBody() : a.textarea;
"wysiwyg" == a.mode ? b.hasClass("placeholder") && (b.removeClass("placeholder"), b.setHtml("")) : b.hasClass("placeholder") && (b.removeClass("placeholder"), b.setValue(""))
}
function a(b) {
return !b ? null : b.getAttribute("lang") || a(b.getParent())
}
var b = "placeholder" in document.createElement("textarea");
CKEDITOR.plugins.add("confighelper", {
getPlaceholderCss: function() {
return ".placeholder{ color: #999; }"
},
onLoad: function() {
CKEDITOR.addCss && CKEDITOR.addCss(this.getPlaceholderCss())
},
init: function(e) {
e.on("mode", function(a) {
a.editor.focusManager.hasFocus = !1
});
var g = e.element.getAttribute("placeholder") || e.config.placeholder;
if (g) {
e.addCss && e.addCss(this.getPlaceholderCss());
var k = CKEDITOR.document.getHead().append("style");
k.setAttribute("type", "text/css");
CKEDITOR.env.ie && 11 !== CKEDITOR.env.version ? k.$.styleSheet.cssText = "textarea.placeholder { color: #999; font-style: italic; }" : k.$.innerHTML = "textarea.placeholder { color: #999; font-style: italic; }";
e.on("getData", function(a) {
var b =
e.editable ? e.editable() : "wysiwyg" == e.mode ? e.document && e.document.getBody() : e.textarea;
b && b.hasClass("placeholder") && (a.data.dataValue = "")
});
e.on("setData", function(a) {
if (!CKEDITOR.dialog._.currentTop && !("source" == e.mode && b)) {
var c = e.editable ? e.editable() : "wysiwyg" == e.mode ? e.document && e.document.getBody() : e.textarea;
c && (d(a.data.dataValue) ? f(a) : c.hasClass("placeholder") && c.removeClass("placeholder"))
}
});
e.on("blur", f, null, g);
e.on("mode", f, null, g);
e.on("focus", c);
e.on("beforeModeUnload", c)
}
if ((g = e.config.contentsLanguage ||
a(e.element)) && !e.config.scayt_sLang) e.config.scayt_sLang = {
en: "en_US",
"en-us": "en_US",
"en-gb": "en_GB",
"pt-br": "pt_BR",
da: "da_DK",
"da-dk": "da_DK",
"nl-nl": "nl_NL",
"en-ca": "en_CA",
"fi-fi": "fi_FI",
fr: "fr_FR",
"fr-fr": "fr_FR",
"fr-ca": "fr_CA",
de: "de_DE",
"de-de": "de_DE",
"el-gr": "el_GR",
it: "it_IT",
"it-it": "it_IT",
"nb-no": "nb_NO",
pt: "pt_PT",
"pt-pt": "pt_PT",
es: "es_ES",
"es-es": "es_ES",
"sv-se": "sv_SE"
}[g.toLowerCase()];
var h = function(a) {
if ("object" == typeof a) return a;
a = a.split(";");
var b = {},
c;
for (c = 0; c < a.length; c++) {
var d =
a[c].split(":");
if (3 == d.length) {
var e = d[0],
f = d[1],
d = d[2];
b[e] || (b[e] = {});
b[e][f] || (b[e][f] = []);
b[e][f].push(d)
}
}
return b
};
CKEDITOR.on("dialogDefinition", function(a) {
if (e == a.editor) {
var b = a.data.name;
a = a.data.definition;
var c, d, f, g, k;
"tableProperties" == b && "table" == b;
!("removeDialogFields" in e._) && e.config.removeDialogFields && (e._.removeDialogFields = h(e.config.removeDialogFields));
if (e._.removeDialogFields && (c = e._.removeDialogFields[b]))
for (f in c) {
g = c[f];
k = a.getContents(f);
for (d = 0; d < g.length; d++) k.remove(g[d])
}!("hideDialogFields" in
e._) && e.config.hideDialogFields && (e._.hideDialogFields = h(e.config.hideDialogFields));
if (e._.hideDialogFields && (c = e._.hideDialogFields[b]))
for (f in c) {
g = c[f];
k = a.getContents(f);
for (d = 0; d < g.length; d++) k.get(g[d]).hidden = !0
}
if (e.config.dialogFieldsDefaultValues && (c = e.config.dialogFieldsDefaultValues[b]))
for (f in c) {
g = c[f];
k = a.getContents(f);
for (var w in g)(b = k.get(w)) && (b["default"] = g[w])
}
}
})
}
})
}(),
function() {
CKEDITOR.plugins.add("sourcearea", {
init: function(f) {
function c() {
this.hide();
this.setStyle("height",
this.getParent().$.clientHeight + "px");
this.setStyle("width", this.getParent().$.clientWidth + "px");
this.show()
}
if (f.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
var a = CKEDITOR.plugins.sourcearea;
f.addMode("source", function(a) {
var e = f.ui.space("contents").getDocument().createElement("textarea");
e.setStyles(CKEDITOR.tools.extend({
width: CKEDITOR.env.ie7Compat ? "99%" : "100%",
height: "100%",
resize: "none",
outline: "none",
"text-align": "left"
}, CKEDITOR.tools.cssVendorPrefix("tab-size", f.config.sourceAreaTabSize ||
4)));
e.setAttribute("dir", "ltr");
e.addClass("cke_source cke_reset cke_enable_context_menu");
f.ui.space("contents").append(e);
e = f.editable(new d(f, e));
e.setData(f.getData(1));
CKEDITOR.env.ie && (e.attachListener(f, "resize", c, e), e.attachListener(CKEDITOR.document.getWindow(), "resize", c, e), CKEDITOR.tools.setTimeout(c, 0, e));
f.fire("ariaWidget", this);
a()
});
f.addCommand("source", a.commands.source);
f.ui.addButton && f.ui.addButton("Source", {
label: f.lang.sourcearea.toolbar,
command: "source",
toolbar: "mode,10"
});
f.on("mode", function() {
f.getCommand("source").setState("source" == f.mode ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
})
}
}
});
var d = CKEDITOR.tools.createClass({
base: CKEDITOR.editable,
proto: {
setData: function(d) {
this.setValue(d);
this.editor.fire("dataReady")
},
getData: function() {
return this.getValue()
},
insertHtml: function() {},
insertElement: function() {},
insertText: function() {},
setReadOnly: function(d) {
this[(d ? "set" : "remove") + "Attribute"]("readOnly", "readonly")
},
detach: function() {
d.baseProto.detach.call(this);
this.clearCustomData();
this.remove()
}
}
})
}(), CKEDITOR.plugins.sourcearea = {
commands: {
source: {
modes: {
wysiwyg: 1,
source: 1
},
editorFocus: !1,
readOnly: 1,
exec: function(d) {
"wysiwyg" == d.mode && d.fire("saveSnapshot");
d.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);
d.setMode("source" == d.mode ? "wysiwyg" : "source")
},
canUndo: !1
}
}
}, CKEDITOR.plugins.add("sourcedialog", {
init: function(d) {
d.addCommand("sourcedialog", new CKEDITOR.dialogCommand("sourcedialog"));
CKEDITOR.dialog.add("sourcedialog", this.path + "dialogs/sourcedialog.js");
d.ui.addButton && d.ui.addButton("Sourcedialog", {
label: d.lang.sourcedialog.toolbar,
command: "sourcedialog",
toolbar: "mode,10"
})
}
}),
function() {
CKEDITOR.plugins.add("webkit-span-fix", {
init: function(d) {
if (CKEDITOR.env.webkit) {
var f = function(a) {
var b = [];
if (a instanceof CKEDITOR.dom.element || a instanceof CKEDITOR.dom.text)
if (a = a.getParents(!0), null !== a)
for (var c = 0; c < a.length && !(b[c] = a[c], 1 <= c && a[c] instanceof CKEDITOR.dom.element && "block" == a[c].getComputedStyle("display")); c++);
return b
},
c = function() {
var a = [],
b = d.getSelection(),
c, g, k;
if (null !== b && (g = b.getRanges(), g.length && (c = g[0].getNextNode(), null !== c && (k = f(c), void 0 !== k[k.length - 2])))) {
k = k[k.length - 2];
do a.push(k), k = k.getNext(); while (null !== k)
}
return {
siblings: a,
redoSelection: function() {
null !== b && null !== g && g.length && b.selectRanges(g)
},
nextNode: c
}
};
d.on("contentDom", function() {
d.document.on("keydown", function() {
if (d.document) {
var a = c();
try {
d.document.once("keyup", function() {
try {
var b = c(),
d = !1;
if (null !== a.nextNode && null !== b.nextNode) {
var k = f(a.nextNode),
h = f(b.nextNode);
k[k.length - 1].getAddress().join("|") != h[h.length - 1].getAddress().join("|") && (d = !0)
}
if (d)
for (d = 0; d < a.siblings.length && void 0 !== b.siblings[d]; d++) nodeBeforeKey = a.siblings[d], nodeAfterKey = b.siblings[d], nodeBeforeKey instanceof CKEDITOR.dom.text && nodeAfterKey instanceof CKEDITOR.dom.element && "span" == nodeAfterKey.getName() ? nodeAfterKey.remove(!0) : nodeBeforeKey instanceof CKEDITOR.dom.element && nodeAfterKey instanceof CKEDITOR.dom.element && (nodeAfterKey.getComputedStyle("display").match(/^inline/) &&
nodeAfterKey instanceof CKEDITOR.dom.element && nodeAfterKey.getName() == nodeBeforeKey.getName() && nodeAfterKey.getAttribute("style") != nodeBeforeKey.getAttribute("style")) && (null != nodeBeforeKey.getAttribute("style") ? nodeAfterKey.setAttribute("style", nodeBeforeKey.getAttribute("style")) : nodeAfterKey.removeAttribute("style")), b.redoSelection()
} catch (l) {}
})
} catch (b) {}
}
})
})
}
}
})
}(), CKEDITOR.config.plugins = "basicstyles,blockquote,dialogui,dialog,clipboard,button,toolbar,enterkey,panel,floatpanel,listblock,richcombo,format,wysiwygarea,indent,indentblock,indentlist,justify,list,maximize,pastetext,removeformat,undo,sqslink,sqsloader,sqsremoveblock,sqsfloatingspace,confighelper,sourcearea,sourcedialog,webkit-span-fix",
CKEDITOR.config.skin = "sqsBlack", CKEDITOR.lang.languages = {
en: 1
}
}()
}, "1.0");
YUI.add("squarespace-wysiwyg-editor", function(E) {
var d = /(?:[ ]{2})|(?:\s{0,20}id="yui[^"]+")|(?:(\w?)\u200b(\w?))/g,
f = [{
sqsEvent: "change",
ckEvent: "change"
}, {
sqsEvent: "dataReady",
ckEvent: "dataReady"
}, {
sqsEvent: "focus",
ckEvent: "focus"
}, {
sqsEvent: "blur",
ckEvent: "blur"
}, {
sqsEvent: "removeBlock",
ckEvent: "removeBlock"
}, {
sqsEvent: "contentDom",
ckEvent: "contentDom"
}, {
sqsEvent: "loaded",
ckEvent: "loaded"
}, {
sqsEvent: "maximize",
ckEvent: "maximize"
}],
c = [13, CKEDITOR.SHIFT + 13, CKEDITOR.CTRL + 13, CKEDITOR.ALT + 13],
a = E.namespace("Squarespace.Wysiwyg").Editor =
E.Base.create("wysiwygEditor", E.Squarespace.SSWidget, [], {
initializer: function() {
this._editorConfig = {};
this._editorConfig.toolbar = E.Squarespace.Wysiwyg.ToolbarConfigs[this.get("toolbarType")];
this._editorConfig.height = this._getEditorHeight();
this._editorConfig.tabIndex = 0;
this._queuedSetData;
this._isSettingData = !1;
var a = this.get("node")._node.ownerDocument;
(a.defaultView || a.parentWindow).CKEDITOR.editorConfig(this._editorConfig);
!0 === this.get("isSingleLine") && this._initSingleLineEditor();
this._isInline() ?
this._internalEditor = this._initializeInlineEditor() : this._internalEditor = this._initializeIframeEditor();
this._bindProxyEvents();
this._bindEditorEvents()
},
getEditorData: function() {
return this.cleanEditorData(this._internalEditor.getData())
},
cleanEditorData: function(a) {
return !E.Lang.isValue(a) ? "" : a.replace(d, "").replace(/\u2028/g, "")
},
setEditorData: function(a) {
this._isSettingData ? this._queuedSetData = a : this._setEditorData(a)
},
_setEditorData: function(a) {
E.Lang.isValue(a) || (a = "");
this._isSettingData = !0;
this._internalEditor.setData(a, E.bind(function() {
this._isSettingData = !1;
var a = this._queuedSetData;
E.Lang.isValue(a) && (this._queuedSetData = null, this._setEditorData(a))
}, this))
},
giveEditorFocus: function() {
this._internalEditor.focusManager.hasFocus || this._internalEditor.focus()
},
getEditorSelection: function() {
return this._internalEditor.getSelection().getNative()
},
didDataChange: function() {
return this.get("edited")
},
_initializeInlineEditor: function() {
var b = this.get("node"),
c = b._node.ownerDocument,
c = c.defaultView ||
c.parentWindow;
b.set("autocapitalize", "on");
b.set("contentEditable", !0);
b.addClass(a.CSS_PREFIX);
c.CKEDITOR.disableAutoInline = !0;
this._editorConfig.uiColor = "Dark";
this._editorConfig.floatSpaceDockedOffsetY = this._getDockedToolbarOffset();
return c.CKEDITOR.inline(b.getDOMNode(), this._editorConfig)
},
_initializeIframeEditor: function() {
this._editorConfig.uiColor = "Light";
var a = this.get("node"),
c = a._node.ownerDocument;
return (c.defaultView || c.parentWindow).CKEDITOR.replace(a.getDOMNode(), this._editorConfig)
},
_bindProxyEvents: function() {
E.Array.each(f, function(a) {
this._internalEditor.on(a.ckEvent, function(c) {
this.fire(a.sqsEvent, c)
}, this)
}, this)
},
_bindEditorEvents: function() {
this.after("editableChange", function(a) {
a.newVal !== this._internalEditor.get("editable") && this._internalEditor.set("editable", a.newVal)
}, this);
this._internalEditor.on("change", function(a) {
this.set("edited", !0)
}, this);
this._internalEditor.on("focus", function(a) {
this._internalEditor.setReadOnly(!1);
this._isInline() && (this._internalEditor.config.floatSpacePinnedOffsetY =
this._getFloatingToolbarOffset())
}, this);
if (!0 === this.get("isSingleLine")) this._internalEditor.on("paste", this._truncateOnPaste, this)
},
_initSingleLineEditor: function() {
var a = this._editorConfig.blockedKeystrokes,
a = a.concat(c);
this._editorConfig.blockedKeystrokes = a;
this._editorConfig.keystrokes = [
[13, null],
[CKEDITOR.SHIFT + 13, null]
]
},
_isInline: function() {
return this.get("editorType") === E.Squarespace.Wysiwyg.EditorTypes.INLINE
},
_truncateOnPaste: function(a) {
var c = a.data.dataValue,
d = c.indexOf("<br>"); - 1 !==
d && (a.data.dataValue = c.substring(0, d))
},
_getParentDialog: function() {
return this.get("node").ancestor(".sqs-dialog-field")
},
_isEditorInDialog: function() {
return E.Lang.isValue(this._getParentDialog())
},
_isEditorInIFrame: function() {
var a = this.g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment