(function(d) {
var a = /^\s*|\s*$/g,
e, c = "B".replace(/A(.)|B/, "$1") === "$1";
var b = {
majorVersion: "3",
minorVersion: "4.1",
releaseDate: "2011-03-24",
_init: function() {
var s = this,
q = document,
o = navigator,
g = o.userAgent,
m, f, l, k, j, r;
s.isOpera = d.opera && opera.buildNumber;
s.isWebKit = /WebKit/.test(g);
s.isIE = !s.isWebKit && !s.isOpera && (/MSIE/gi).test(g) && (/Explorer/gi).test(o.appName);
s.isIE6 = s.isIE && /MSIE [56]/.test(g);
s.isGecko = !s.isWebKit && /Gecko/.test(g);
s.isMac = g.indexOf("Mac") != -1;
s.isAir = /adobeair/i.test(g);
s.isIDevice = /(iPad|iPhone)/.test(g);
if (d.tinyMCEPreInit) {
s.suffix = tinyMCEPreInit.suffix;
s.baseURL = tinyMCEPreInit.base;
s.query = tinyMCEPreInit.query;
return
}
s.suffix = "";
f = q.getElementsByTagName("base");
for (m = 0; m < f.length; m++) {
if (r = f[m].href) {
if (/^https?:\/\/[^\/]+$/.test(r)) {
r += "/"
}
k = r ? r.match(/.*\//)[0] : ""
}
}
function h(i) {
if (i.src && /tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)) {
if (/_(src|dev)\.js/g.test(i.src)) {
s.suffix = "_src"
}
if ((j = i.src.indexOf("?")) != -1) {
s.query = i.src.substring(j + 1)
}
s.baseURL = i.src.substring(0, i.src.lastIndexOf("/"));
if (k && s.baseURL.indexOf("://") == -1 && s.baseURL.indexOf("/") !== 0) {
s.baseURL = k + s.baseURL
}
return s.baseURL
}
return null
}
f = q.getElementsByTagName("script");
for (m = 0; m < f.length; m++) {
if (h(f[m])) {
return
}
}
l = q.getElementsByTagName("head")[0];
if (l) {
f = l.getElementsByTagName("script");
for (m = 0; m < f.length; m++) {
if (h(f[m])) {
return
}
}
}
return
},
is: function(g, f) {
if (!f) {
return g !== e
}
if (f == "array" && (g.hasOwnProperty && g instanceof Array)) {
return true
}
return typeof(g) == f
},
makeMap: function(f, j, h) {
var g;
f = f || [];
j = j || ",";
if (typeof(f) == "string") {
f = f.split(j)
}
h = h || {};
g = f.length;
while (g--) {
h[f[g]] = {}
}
return h
},
each: function(i, f, h) {
var j, g;
if (!i) {
return 0
}
h = h || i;
if (i.length !== e) {
for (j = 0, g = i.length; j < g; j++) {
if (f.call(h, i[j], j, i) === false) {
return 0
}
}
} else {
for (j in i) {
if (i.hasOwnProperty(j)) {
if (f.call(h, i[j], j, i) === false) {
return 0
}
}
}
}
return 1
},
map: function(g, h) {
var i = [];
b.each(g, function(f) {
i.push(h(f))
});
return i
},
grep: function(g, h) {
var i = [];
b.each(g, function(f) {
if (!h || h(f)) {
i.push(f)
}
});
return i
},
inArray: function(g, h) {
var j, f;
if (g) {
for (j = 0, f = g.length; j < f; j++) {
if (g[j] === h) {
return j
}
}
}
return -1
},
extend: function(k, j) {
var h, g, f = arguments;
for (h = 1, g = f.length; h < g; h++) {
j = f[h];
b.each(j, function(i, l) {
if (i !== e) {
k[l] = i
}
})
}
return k
},
trim: function(f) {
return (f ? "" + f : "").replace(a, "")
},
create: function(o, f, j) {
var n = this,
g, i, k, l, h, m = 0;
o = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(o);
k = o[3].match(/(^|\.)(\w+)$/i)[2];
i = n.createNS(o[3].replace(/\.\w+$/, ""), j);
if (i[k]) {
return
}
if (o[2] == "static") {
i[k] = f;
if (this.onCreate) {
this.onCreate(o[2], o[3], i[k])
}
return
}
if (!f[k]) {
f[k] = function() {};
m = 1
}
i[k] = f[k];
n.extend(i[k].prototype, f);
if (o[5]) {
g = n.resolve(o[5]).prototype;
l = o[5].match(/\.(\w+)$/i)[1];
h = i[k];
if (m) {
i[k] = function() {
return g[l].apply(this, arguments)
}
} else {
i[k] = function() {
this.parent = g[l];
return h.apply(this, arguments)
}
}
i[k].prototype[k] = i[k];
n.each(g, function(p, q) {
i[k].prototype[q] = g[q]
});
n.each(f, function(p, q) {
if (g[q]) {
i[k].prototype[q] = function() {
this.parent = g[q];
return p.apply(this, arguments)
}
} else {
if (q != k) {
i[k].prototype[q] = p
}
}
})
}
n.each(f["static"], function(p, q) {
i[k][q] = p
});
if (this.onCreate) {
this.onCreate(o[2], o[3], i[k].prototype)
}
},
walk: function(i, h, j, g) {
g = g || this;
if (i) {
if (j) {
i = i[j]
}
b.each(i, function(k, f) {
if (h.call(g, k, f, j) === false) {
return false
}
b.walk(k, h, j, g)
})
}
},
createNS: function(j, h) {
var g, f;
h = h || d;
j = j.split(".");
for (g = 0; g < j.length; g++) {
f = j[g];
if (!h[f]) {
h[f] = {}
}
h = h[f]
}
return h
},
resolve: function(j, h) {
var g, f;
h = h || d;
j = j.split(".");
for (g = 0, f = j.length; g < f; g++) {
h = h[j[g]];
if (!h) {
break
}
}
return h
},
addUnload: function(j, i) {
var h = this;
j = {
func: j,
scope: i || this
};
if (!h.unloads) {
function g() {
var f = h.unloads,
l, m;
if (f) {
for (m in f) {
l = f[m];
if (l && l.func) {
l.func.call(l.scope, 1)
}
}
if (d.detachEvent) {
d.detachEvent("onbeforeunload", k);
d.detachEvent("onunload", g)
} else {
if (d.removeEventListener) {
d.removeEventListener("unload", g, false)
}
}
h.unloads = l = f = w = g = 0;
if (d.CollectGarbage) {
CollectGarbage()
}
}
}
function k() {
var l = document;
if (l.readyState == "interactive") {
function f() {
l.detachEvent("onstop", f);
if (g) {
g()
}
l = 0
}
if (l) {
l.attachEvent("onstop", f)
}
d.setTimeout(function() {
if (l) {
l.detachEvent("onstop", f)
}
}, 0)
}
}
if (d.attachEvent) {
d.attachEvent("onunload", g);
d.attachEvent("onbeforeunload", k)
} else {
if (d.addEventListener) {
d.addEventListener("unload", g, false)
}
}
h.unloads = [j]
} else {
h.unloads.push(j)
}
return j
},
removeUnload: function(i) {
var g = this.unloads,
h = null;
b.each(g, function(j, f) {
if (j && j.func == i) {
g.splice(f, 1);
h = i;
return false
}
});
return h
},
explode: function(f, g) {
return f ? b.map(f.split(g || ","), b.trim) : f
},
_addVer: function(g) {
var f;
if (!this.query) {
return g
}
f = (g.indexOf("?") == -1 ? "?" : "&") + this.query;
if (g.indexOf("#") == -1) {
return g + f
}
return g.replace("#", f + "#")
},
_replace: function(h, f, g) {
if (c) {
return g.replace(h, function() {
var l = f,
j = arguments,
k;
for (k = 0; k < j.length - 2; k++) {
if (j[k] === e) {
l = l.replace(new RegExp("\\$" + k, "g"), "")
} else {
l = l.replace(new RegExp("\\$" + k, "g"), j[k])
}
}
return l
})
}
return g.replace(h, f)
}
};
b._init();
d.tinymce = d.tinyMCE = b
})(window);
tinymce.create("tinymce.util.Dispatcher", {
scope: null,
listeners: null,
Dispatcher: function(a) {
this.scope = a || this;
this.listeners = []
},
add: function(a, b) {
this.listeners.push({
cb: a,
scope: b || this.scope
});
return a
},
addToTop: function(a, b) {
this.listeners.unshift({
cb: a,
scope: b || this.scope
});
return a
},
remove: function(a) {
var b = this.listeners,
c = null;
tinymce.each(b, function(e, d) {
if (a == e.cb) {
c = a;
b.splice(d, 1);
return false
}
});
return c
},
dispatch: function() {
var f, d = arguments,
e, b = this.listeners,
g;
for (e = 0; e < b.length; e++) {
g = b[e];
f = g.cb.apply(g.scope, d);
if (f === false) {
break
}
}
return f
}
});
(function() {
var a = tinymce.each;
tinymce.create("tinymce.util.URI", {
URI: function(e, g) {
var f = this,
h, d, c;
e = tinymce.trim(e);
g = f.settings = g || {};
if (/^(mailto|tel|news|javascript|about|data):/i.test(e) || /^\s*#/.test(e)) {
f.source = e;
return
}
if (e.indexOf("/") === 0 && e.indexOf("//") !== 0) {
e = (g.base_uri ? g.base_uri.protocol || "http" : "http") + "://mce_host" + e
}
if (!/^\w*:?\/\//.test(e)) {
e = (g.base_uri.protocol || "http") + "://mce_host" + f.toAbsPath(g.base_uri.path, e)
}
e = e.replace(/@@/g, "(mce_at)");
e = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);
a(["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"], function(b, j) {
var k = e[j];
if (k) {
k = k.replace(/\(mce_at\)/g, "@@")
}
f[b] = k
});
if (c = g.base_uri) {
if (!f.protocol) {
f.protocol = c.protocol
}
if (!f.userInfo) {
f.userInfo = c.userInfo
}
if (!f.port && f.host == "mce_host") {
f.port = c.port
}
if (!f.host || f.host == "mce_host") {
f.host = c.host
}
f.source = ""
}
},
setPath: function(c) {
var b = this;
c = /^(.*?)\/?(\w+)?$/.exec(c);
b.path = c[0];
b.directory = c[1];
b.file = c[2];
b.source = "";
b.getURI()
},
toRelative: function(b) {
var c = this,
d;
if (b === "./") {
return b
}
b = new tinymce.util.URI(b, {
base_uri: c
});
if ((b.host != "mce_host" && c.host != b.host && b.host) || c.port != b.port || c.protocol != b.protocol) {
return b.getURI()
}
d = c.toRelPath(c.path, b.path);
if (b.query) {
d += "?" + b.query
}
if (b.anchor) {
d += "#" + b.anchor
}
return d
},
toAbsolute: function(b, c) {
var b = new tinymce.util.URI(b, {
base_uri: this
});
return b.getURI(this.host == b.host && this.protocol == b.protocol ? c : 0)
},
toRelPath: function(g, h) {
var c, f = 0,
d = "",
e, b;
g = g.substring(0, g.lastIndexOf("/"));
g = g.split("/");
c = h.split("/");
if (g.length >= c.length) {
for (e = 0, b = g.length; e < b; e++) {
if (e >= c.length || g[e] != c[e]) {
f = e + 1;
break
}
}
}
if (g.length < c.length) {
for (e = 0, b = c.length; e < b; e++) {
if (e >= g.length || g[e] != c[e]) {
f = e + 1;
break
}
}
}
if (f == 1) {
return h
}
for (e = 0, b = g.length - (f - 1); e < b; e++) {
d += "../"
}
for (e = f - 1, b = c.length; e < b; e++) {
if (e != f - 1) {
d += "/" + c[e]
} else {
d += c[e]
}
}
return d
},
toAbsPath: function(e, f) {
var c, b = 0,
h = [],
d, g;
d = /\/$/.test(f) ? "/" : "";
e = e.split("/");
f = f.split("/");
a(e, function(i) {
if (i) {
h.push(i)
}
});
e = h;
for (c = f.length - 1, h = []; c >= 0; c--) {
if (f[c].length == 0 || f[c] == ".") {
continue
}
if (f[c] == "..") {
b++;
continue
}
if (b > 0) {
b--;
continue
}
h.push(f[c])
}
c = e.length - b;
if (c <= 0) {
g = h.reverse().join("/")
} else {
g = e.slice(0, c).join("/") + "/" + h.reverse().join("/")
}
if (g.indexOf("/") !== 0) {
g = "/" + g
}
if (d && g.lastIndexOf("/") !== g.length - 1) {
g += d
}
return g
},
getURI: function(d) {
var c, b = this;
if (!b.source || d) {
c = "";
if (!d) {
if (b.protocol) {
c += b.protocol + "://"
}
if (b.userInfo) {
c += b.userInfo + "@"
}
if (b.host) {
c += b.host
}
if (b.port) {
c += ":" + b.port
}
}
if (b.path) {
c += b.path
}
if (b.query) {
c += "?" + b.query
}
if (b.anchor) {
c += "#" + b.anchor
}
b.source = c
}
return b.source
}
})
})();
(function() {
var a = tinymce.each;
tinymce.create("static tinymce.util.Cookie", {
getHash: function(d) {
var b = this.get(d),
c;
if (b) {
a(b.split("&"), function(e) {
e = e.split("=");
c = c || {};
c[unescape(e[0])] = unescape(e[1])
})
}
return c
},
setHash: function(j, b, g, f, i, c) {
var h = "";
a(b, function(e, d) {
h += (!h ? "" : "&") + escape(d) + "=" + escape(e)
});
this.set(j, h, g, f, i, c)
},
get: function(i) {
var h = document.cookie,
g, f = i + "=",
d;
if (!h) {
return
}
d = h.indexOf("; " + f);
if (d == -1) {
d = h.indexOf(f);
if (d != 0) {
return null
}
} else {
d += 2
}
g = h.indexOf(";", d);
if (g == -1) {
g = h.length
}
return unescape(h.substring(d + f.length, g))
},
set: function(i, b, g, f, h, c) {
document.cookie = i + "=" + escape(b) + ((g) ? "; expires=" + g.toGMTString() : "") + ((f) ? "; path=" + escape(f) : "") + ((h) ? "; domain=" + h : "") + ((c) ? "; secure" : "")
},
remove: function(e, b) {
var c = new Date();
c.setTime(c.getTime() - 1000);
this.set(e, "", c, b, c)
}
})
})();
(function() {
function serialize(o, quote) {
var i, v, t;
quote = quote || '"';
if (o == null) {
return "null"
}
t = typeof o;
if (t == "string") {
v = "\bb\tt\nn\ff\rr\"\"''\\\\";
return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) {
if (quote === '"' && a === "'") {
return a
}
i = v.indexOf(b);
if (i + 1) {
return "\\" + v.charAt(i + 1)
}
a = b.charCodeAt().toString(16);
return "\\u" + "0000".substring(a.length) + a
}) + quote
}
if (t == "object") {
if (o.hasOwnProperty && o instanceof Array) {
for (i = 0, v = "["; i < o.length; i++) {
v += (i > 0 ? "," : "") + serialize(o[i], quote)
}
return v + "]"
}
v = "{";
for (i in o) {
v += typeof o[i] != "function" ? (v.length > 1 ? "," + quote : quote) + i + quote + ":" + serialize(o[i], quote) : ""
}
return v + "}"
}
return "" + o
}
tinymce.util.JSON = {
serialize: serialize,
parse: function(s) {
try {
return eval("(" + s + ")")
} catch (ex) {}
}
}
})();
tinymce.create("static tinymce.util.XHR", {
send: function(g) {
var a, e, b = window,
h = 0;
g.scope = g.scope || this;
g.success_scope = g.success_scope || g.scope;
g.error_scope = g.error_scope || g.scope;
g.async = g.async === false ? false : true;
g.data = g.data || "";
function d(i) {
a = 0;
try {
a = new ActiveXObject(i)
} catch (c) {}
return a
}
a = b.XMLHttpRequest ? new XMLHttpRequest() : d("Microsoft.XMLHTTP") || d("Msxml2.XMLHTTP");
if (a) {
if (a.overrideMimeType) {
a.overrideMimeType(g.content_type)
}
a.open(g.type || (g.data ? "POST" : "GET"), g.url, g.async);
if (g.content_type) {
a.setRequestHeader("Content-Type", g.content_type)
}
a.setRequestHeader("X-Requested-With", "XMLHttpRequest");
a.send(g.data);
function f() {
if (!g.async || a.readyState == 4 || h++ > 10000) {
if (g.success && h < 10000 && a.status == 200) {
g.success.call(g.success_scope, "" + a.responseText, a, g)
} else {
if (g.error) {
g.error.call(g.error_scope, h > 10000 ? "TIMED_OUT" : "GENERAL", a, g)
}
}
a = null
} else {
b.setTimeout(f, 10)
}
}
if (!g.async) {
return f()
}
e = b.setTimeout(f, 10)
}
}
});
(function() {
var c = tinymce.extend,
b = tinymce.util.JSON,
a = tinymce.util.XHR;
tinymce.create("tinymce.util.JSONRequest", {
JSONRequest: function(d) {
this.settings = c({}, d);
this.count = 0
},
send: function(f) {
var e = f.error,
d = f.success;
f = c(this.settings, f);
f.success = function(h, g) {
h = b.parse(h);
if (typeof(h) == "undefined") {
h = {
error: "JSON Parse error."
}
}
if (h.error) {
e.call(f.error_scope || f.scope, h.error, g)
} else {
d.call(f.success_scope || f.scope, h.result)
}
};
f.error = function(h, g) {
if (e) {
e.call(f.error_scope || f.scope, h, g)
}
};
f.data = b.serialize({
id: f.id || "c" + (this.count++),
method: f.method,
params: f.params
});
f.content_type = "application/json";
a.send(f)
},
"static": {
sendRPC: function(d) {
return new tinymce.util.JSONRequest().send(d)
}
}
})
}());
(function(j) {
var a, g, d, k = /[&\"\u007E-\uD7FF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
b = /[<>&\u007E-\uD7FF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
f = /[<>&\"\']/g,
c = /&(#)?([\w]+);/g,
i = {
128: "\u20AC",
130: "\u201A",
131: "\u0192",
132: "\u201E",
133: "\u2026",
134: "\u2020",
135: "\u2021",
136: "\u02C6",
137: "\u2030",
138: "\u0160",
139: "\u2039",
140: "\u0152",
142: "\u017D",
145: "\u2018",
146: "\u2019",
147: "\u201C",
148: "\u201D",
149: "\u2022",
150: "\u2013",
151: "\u2014",
152: "\u02DC",
153: "\u2122",
154: "\u0161",
155: "\u203A",
156: "\u0153",
158: "\u017E",
159: "\u0178"
};
g = {
'"': """,
"'": "'",
"<": "<",
">": ">",
"&": "&"
};
d = {
"<": "<",
">": ">",
"&": "&",
""": '"',
"'": "'"
};
function h(l) {
var m;
m = document.createElement("div");
m.innerHTML = l;
return m.textContent || m.innerText || l
}
function e(m, p) {
var n, o, l, q = {};
if (m) {
m = m.split(",");
p = p || 10;
for (n = 0; n < m.length; n += 2) {
o = String.fromCharCode(parseInt(m[n], p));
if (!g[o]) {
l = "&" + m[n + 1] + ";";
q[o] = l;
q[l] = o
}
}
return q
}
}
a = e("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro", 32);
j.html = j.html || {};
j.html.Entities = {
encodeRaw: function(m, l) {
return m.replace(l ? k : b, function(n) {
return g[n] || n
})
},
encodeAllRaw: function(l) {
return ("" + l).replace(f, function(m) {
return g[m] || m
})
},
encodeNumeric: function(m, l) {
return m.replace(l ? k : b, function(n) {
if (n.length > 1) {
return "" + (((n.charCodeAt(0) - 55296) * 1024) + (n.charCodeAt(1) - 56320) + 65536) + ";"
}
return g[n] || "" + n.charCodeAt(0) + ";"
})
},
encodeNamed: function(n, l, m) {
m = m || a;
return n.replace(l ? k : b, function(o) {
return g[o] || m[o] || o
})
},
getEncodeFunc: function(l, o) {
var p = j.html.Entities;
o = e(o) || a;
function m(r, q) {
return r.replace(q ? k : b, function(s) {
return g[s] || o[s] || "" + s.charCodeAt(0) + ";" || s
})
}
function n(r, q) {
return p.encodeNamed(r, q, o)
}
l = j.makeMap(l.replace(/\+/g, ","));
if (l.named && l.numeric) {
return m
}
if (l.named) {
if (o) {
return n
}
return p.encodeNamed
}
if (l.numeric) {
return p.encodeNumeric
}
return p.encodeRaw
},
decode: function(l) {
return l.replace(c, function(n, m, o) {
if (m) {
o = parseInt(o);
if (o > 65535) {
o -= 65536;
return String.fromCharCode(55296 + (o >> 10), 56320 + (o & 1023))
} else {
return i[o] || String.fromCharCode(o)
}
}
return d[n] || a[n] || h(n)
})
}
}
})(tinymce);
tinymce.html.Styles = function(d, f) {
var k = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,
h = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,
b = /\s*([^:]+):\s*([^;]+);?/g,
l = /\s+$/,
m = /rgb/,
e, g, a = {},
j;
d = d || {};
j = "\\\" \\' \\; \\: ; : _".split(" ");
for (g = 0; g < j.length; g++) {
a[j[g]] = "_" + g;
a["_" + g] = j[g]
}
function c(n, q, p, i) {
function o(r) {
r = parseInt(r).toString(16);
return r.length > 1 ? r : "0" + r
}
return "#" + o(q) + o(p) + o(i)
}
return {
toHex: function(i) {
return i.replace(k, c)
},
parse: function(r) {
var y = {},
p, n, v, q, u = d.url_converter,
x = d.url_converter_scope || this;
function o(C, F) {
var E, B, A, D;
E = y[C + "-top" + F];
if (!E) {
return
}
B = y[C + "-right" + F];
if (E != B) {
return
}
A = y[C + "-bottom" + F];
if (B != A) {
return
}
D = y[C + "-left" + F];
if (A != D) {
return
}
y[C + F] = D;
delete y[C + "-top" + F];
delete y[C + "-right" + F];
delete y[C + "-bottom" + F];
delete y[C + "-left" + F]
}
function t(B) {
var C = y[B],
A;
if (!C || C.indexOf(" ") < 0) {
return
}
C = C.split(" ");
A = C.length;
while (A--) {
if (C[A] !== C[0]) {
return false
}
}
y[B] = C[0];
return true
}
function z(C, B, A, D) {
if (!t(B)) {
return
}
if (!t(A)) {
return
}
if (!t(D)) {
return
}
y[C] = y[B] + " " + y[A] + " " + y[D];
delete y[B];
delete y[A];
delete y[D]
}
function s(A) {
q = true;
return a[A]
}
function i(B, A) {
if (q) {
B = B.replace(/_[0-9]/g, function(C) {
return a[C]
})
}
if (!A) {
B = B.replace(/\\([\'\";:])/g, "$1")
}
return B
}
if (r) {
r = r.replace(/\\[\"\';:_]/g, s).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(A) {
return A.replace(/[;:]/g, s)
});
while (p = b.exec(r)) {
n = p[1].replace(l, "").toLowerCase();
v = p[2].replace(l, "");
if (n && v.length > 0) {
if (n === "font-weight" && v === "700") {
v = "bold"
} else {
if (n === "color" || n === "background-color") {
v = v.toLowerCase()
}
}
v = v.replace(k, c);
v = v.replace(h, function(B, A, E, D, F, C) {
F = F || C;
if (F) {
F = i(F);
return "'" + F.replace(/\'/g, "\\'") + "'"
}
A = i(A || E || D);
if (u) {
A = u.call(x, A, "style")
}
return "url('" + A.replace(/\'/g, "\\'") + "')"
});
y[n] = q ? i(v, true) : v
}
b.lastIndex = p.index + p[0].length
}
o("border", "");
o("border", "-width");
o("border", "-color");
o("border", "-style");
o("padding", "");
o("margin", "");
z("border", "border-width", "border-style", "border-color");
if (y.border === "medium none") {
delete y.border
}
}
return y
},
serialize: function(p, r) {
var o = "",
n, q;
function i(t) {
var x, u, s, t, v;
x = f.styles[t];
if (x) {
for (u = 0, s = x.length; u < s; u++) {
t = x[u];
v = p[t];
if (v !== e) {
o += (o.length > 0 ? " " : "") + t + ": " + v + ";"
}
}
}
}
if (r && f && f.styles) {
i("*");
i(n)
} else {
for (n in p) {
q = p[n];
if (q !== e) {
o += (o.length > 0 ? " " : "") + n + ": " + q + ";"
}
}
}
return o
}
}
};
(function(l) {
var g = {},
i, k, f, d, b, e, c = l.makeMap,
j = l.each;
function h(n, m) {
return n.split(m || ",")
}
function a(q, p) {
var n, o = {};
function m(r) {
return r.replace(/[A-Z]+/g, function(s) {
return m(q[s])
})
}
for (n in q) {
if (q.hasOwnProperty(n)) {
q[n] = m(q[n])
}
}
m(p).replace(/#/g, "#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g, function(u, s, r, t) {
r = h(r, "|");
o[s] = {
attributes: c(r),
attributesOrder: r,
children: c(t, "|", {
"#comment": {}
})
}
});
return o
}
k = "h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,noscript,menu,isindex,samp,header,footer,article,section,hgroup";
k = c(k, ",", c(k.toUpperCase()));
g = a({
Z: "H|K|N|O|P",
Y: "X|form|R|Q",
ZG: "E|span|width|align|char|charoff|valign",
X: "p|T|div|U|W|isindex|fieldset|table",
ZF: "E|align|char|charoff|valign",
W: "pre|hr|blockquote|address|center|noframes",
ZE: "abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",
ZD: "[E][S]",
U: "ul|ol|dl|menu|dir",
ZC: "p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",
T: "h1|h2|h3|h4|h5|h6",
ZB: "X|S|Q",
S: "R|P",
ZA: "a|G|J|M|O|P",
R: "a|H|K|N|O",
Q: "noscript|P",
P: "ins|del|script",
O: "input|select|textarea|label|button",
N: "M|L",
M: "em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",
L: "sub|sup",
K: "J|I",
J: "tt|i|b|u|s|strike",
I: "big|small|font|basefont",
H: "G|F",
G: "br|span|bdo",
F: "object|applet|img|map|iframe",
E: "A|B|C",
D: "accesskey|tabindex|onfocus|onblur",
C: "onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",
B: "lang|xml:lang|dir",
A: "id|class|style|title"
}, "script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]");
i = c("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,preload,autoplay,loop,controls");
f = c("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source");
d = l.extend(c("td,th,iframe,video,object"), f);
b = c("pre,script,style");
e = c("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
l.html.Schema = function(p) {
var x = this,
m = {},
n = {},
u = [],
o;
p = p || {};
if (p.verify_html === false) {
p.valid_elements = "*[*]"
}
if (p.valid_styles) {
o = {};
j(p.valid_styles, function(z, y) {
o[y] = l.explode(z)
})
}
function v(y) {
return new RegExp("^" + y.replace(/([?+*])/g, ".$1") + "$")
}
function r(F) {
var E, A, T, P, U, z, C, O, R, K, S, W, I, D, Q, y, M, B, V, X, J, N, H = /^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,
L = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,
G = /[*?+]/;
if (F) {
F = h(F);
if (m["@"]) {
M = m["@"].attributes;
B = m["@"].attributesOrder
}
for (E = 0, A = F.length; E < A; E++) {
z = H.exec(F[E]);
if (z) {
Q = z[1];
K = z[2];
y = z[3];
R = z[4];
I = {};
D = [];
C = {
attributes: I,
attributesOrder: D
};
if (Q === "#") {
C.paddEmpty = true
}
if (Q === "-") {
C.removeEmpty = true
}
if (M) {
for (X in M) {
I[X] = M[X]
}
D.push.apply(D, B)
}
if (R) {
R = h(R, "|");
for (T = 0, P = R.length; T < P; T++) {
z = L.exec(R[T]);
if (z) {
O = {};
W = z[1];
S = z[2].replace(/::/g, ":");
Q = z[3];
N = z[4];
if (W === "!") {
C.attributesRequired = C.attributesRequired || [];
C.attributesRequired.push(S);
O.required = true
}
if (W === "-") {
delete I[S];
D.splice(l.inArray(D, S), 1);
continue
}
if (Q) {
if (Q === "=") {
C.attributesDefault = C.attributesDefault || [];
C.attributesDefault.push({
name: S,
value: N
});
O.defaultValue = N
}
if (Q === ":") {
C.attributesForced = C.attributesForced || [];
C.attributesForced.push({
name: S,
value: N
});
O.forcedValue = N
}
if (Q === "<") {
O.validValues = c(N, "?")
}
}
if (G.test(S)) {
C.attributePatterns = C.attributePatterns || [];
O.pattern = v(S);
C.attributePatterns.push(O)
} else {
if (!I[S]) {
D.push(S)
}
I[S] = O
}
}
}
}
if (!M && K == "@") {
M = I;
B = D
}
if (y) {
C.outputName = K;
m[y] = C
}
if (G.test(K)) {
C.pattern = v(K);
u.push(C)
} else {
m[K] = C
}
}
}
}
}
function t(y) {
m = {};
u = [];
r(y);
j(g, function(A, z) {
n[z] = A.children
})
}
function q(z) {
var y = /^(~)?(.+)$/;
if (z) {
j(h(z), function(C) {
var B = y.exec(C),
D = B[1] === "~" ? "span" : "div",
A = B[2];
n[A] = n[D];
j(n, function(E, F) {
if (E[D]) {
E[A] = E[D]
}
})
})
}
}
function s(z) {
var y = /^([+\-]?)(\w+)\[([^\]]+)\]$/;
if (z) {
j(h(z), function(D) {
var C = y.exec(D),
A, B;
if (C) {
B = C[1];
if (B) {
A = n[C[2]]
} else {
A = n[C[2]] = {
"#comment": {}
}
}
A = n[C[2]];
j(h(C[3], "|"), function(E) {
if (B === "-") {
delete A[E]
} else {
A[E] = {}
}
})
}
})
}
}
if (!p.valid_elements) {
j(g, function(z, y) {
m[y] = {
attributes: z.attributes,
attributesOrder: z.attributesOrder
};
n[y] = z.children
});
j(h("strong/b,em/i"), function(y) {
y = h(y, "/");
m[y[1]].outputName = y[0]
});
m.img.attributesDefault = [{
name: "alt",
value: ""
}];
j(h("ol,ul,li,sub,sup,blockquote,tr,div,span,font,a,table,tbody"), function(y) {
m[y].removeEmpty = true
});
j(h("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"), function(y) {
m[y].paddEmpty = true
})
} else {
t(p.valid_elements)
}
q(p.custom_elements);
s(p.valid_children);
r(p.extended_valid_elements);
s("+ol[ul|ol],+ul[ul|ol]");
if (p.invalid_elements) {
l.each(l.explode(p.invalid_elements), function(y) {
if (m[y]) {
delete m[y]
}
})
}
x.children = n;
x.styles = o;
x.getBoolAttrs = function() {
return i
};
x.getBlockElements = function() {
return k
};
x.getShortEndedElements = function() {
return f
};
x.getSelfClosingElements = function() {
return e
};
x.getNonEmptyElements = function() {
return d
};
x.getWhiteSpaceElements = function() {
return b
};
x.isValidChild = function(y, A) {
var z = n[y];
return !!(z && z[A])
};
x.getElementRule = function(y) {
var A = m[y],
z;
if (A) {
return A
}
z = u.length;
while (z--) {
A = u[z];
if (A.pattern.test(y)) {
return A
}
}
};
x.addValidElements = r;
x.setValidElements = t;
x.addCustomElements = q;
x.addValidChildren = s
};
l.html.Schema.boolAttrMap = i;
l.html.Schema.blockElementsMap = k
})(tinymce);
(function(a) {
a.html.SaxParser = function(c, e) {
var b = this,
d = function() {};
c = c || {};
b.schema = e = e || new a.html.Schema();
if (c.fix_self_closing !== false) {
c.fix_self_closing = true
}
a.each("comment cdata text start end pi doctype".split(" "), function(f) {
if (f) {
b[f] = c[f] || d
}
});
b.parse = function(q) {
var A = this,
f, m = 0,
G, j, l = [],
B, K, t, N, F, k, p, x, I, r, E, o, J, n, H, M, L, z, D, h, g, u, s = 0,
v = a.html.Entities.decode,
y;
function C(O) {
var Q, P;
Q = l.length;
while (Q--) {
if (l[Q].name === O) {
break
}
}
if (Q >= 0) {
for (P = l.length - 1; P >= Q; P--) {
O = l[P];
if (O.valid) {
A.end(O.name)
}
}
l.length = Q
}
}
D = new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([^\\s\\/<>]+)\\s*((?:[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*)>))", "g");
h = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;
g = {
script: /<\/script[^>]*>/gi,
style: /<\/style[^>]*>/gi,
noscript: /<\/noscript[^>]*>/gi
};
F = e.getShortEndedElements();
z = e.getSelfClosingElements();
k = e.getBoolAttrs();
x = c.validate;
y = c.fix_self_closing;
while (f = D.exec(q)) {
if (m < f.index) {
A.text(v(q.substr(m, f.index - m)))
}
if (G = f[6]) {
C(G.toLowerCase())
} else {
if (G = f[7]) {
G = G.toLowerCase();
p = G in F;
if (y && z[G] && l.length > 0 && l[l.length - 1].name === G) {
C(G)
}
if (!x || (I = e.getElementRule(G))) {
r = true;
if (x) {
J = I.attributes;
n = I.attributePatterns
}
if (o = f[8]) {
B = [];
B.map = {};
o.replace(h, function(P, O, T, S, R) {
var U, Q;
O = O.toLowerCase();
T = O in k ? O : v(T || S || R || "");
if (x && O.indexOf("data-") !== 0) {
U = J[O];
if (!U && n) {
Q = n.length;
while (Q--) {
U = n[Q];
if (U.pattern.test(O)) {
break
}
}
if (Q === -1) {
U = null
}
}
if (!U) {
return
}
if (U.validValues && !(T in U.validValues)) {
return
}
}
B.map[O] = T;
B.push({
name: O,
value: T
})
})
} else {
B = [];
B.map = {}
}
if (x) {
H = I.attributesRequired;
M = I.attributesDefault;
L = I.attributesForced;
if (L) {
K = L.length;
while (K--) {
E = L[K];
N = E.name;
u = E.value;
if (u === "{$uid}") {
u = "mce_" + s++
}
B.map[N] = u;
B.push({
name: N,
value: u
})
}
}
if (M) {
K = M.length;
while (K--) {
E = M[K];
N = E.name;
if (!(N in B.map)) {
u = E.value;
if (u === "{$uid}") {
u = "mce_" + s++
}
B.map[N] = u;
B.push({
name: N,
value: u
})
}
}
}
if (H) {
K = H.length;
while (K--) {
if (H[K] in B.map) {
break
}
}
if (K === -1) {
r = false
}
}
if (B.map["data-mce-bogus"]) {
r = false
}
}
if (r) {
A.start(G, B, p)
}
} else {
r = false
}
if (j = g[G]) {
j.lastIndex = m = f.index + f[0].length;
if (f = j.exec(q)) {
if (r) {
t = q.substr(m, f.index - m)
}
m = f.index + f[0].length
} else {
t = q.substr(m);
m = q.length
}
if (r && t.length > 0) {
A.text(t, true)
}
if (r) {
A.end(G)
}
D.lastIndex = m;
continue
}
if (!p) {
if (!o || o.indexOf("/") != o.length - 1) {
l.push({
name: G,
valid: r
})
} else {
if (r) {
A.end(G)
}
}
}
} else {
if (G = f[1]) {
A.comment(G)
} else {
if (G = f[2]) {
A.cdata(G)
} else {
if (G = f[3]) {
A.doctype(G)
} else {
if (G = f[4]) {
A.pi(G, f[5])
}
}
}
}
}
}
m = f.index + f[0].length
}
if (m < q.length) {
A.text(v(q.substr(m)))
}
for (K = l.length - 1; K >= 0; K--) {
G = l[K];
if (G.valid) {
A.end(G.name)
}
}
}
}
})(tinymce);
(function(d) {
var c = /^[ \t\r\n]*$/,
e = {
"#text": 3,
"#comment": 8,
"#cdata": 4,
"#pi": 7,
"#doctype": 10,
"#document-fragment": 11
};
function a(k, l, j) {
var i, h, f = j ? "lastChild" : "firstChild",
g = j ? "prev" : "next";
if (k[f]) {
return k[f]
}
if (k !== l) {
i = k[g];
if (i) {
return i
}
for (h = k.parent; h && h !== l; h = h.parent) {
i = h[g];
if (i) {
return i
}
}
}
}
function b(f, g) {
this.name = f;
this.type = g;
if (g === 1) {
this.attributes = [];
this.attributes.map = {}
}
}
d.extend(b.prototype, {
replace: function(g) {
var f = this;
if (g.parent) {
g.remove()
}
f.insert(g, f);
f.remove();
return f
},
attr: function(h, l) {
var f = this,
g, j, k;
if (typeof h !== "string") {
for (j in h) {
f.attr(j, h[j])
}
return f
}
if (g = f.attributes) {
if (l !== k) {
if (l === null) {
if (h in g.map) {
delete g.map[h];
j = g.length;
while (j--) {
if (g[j].name === h) {
g = g.splice(j, 1);
return f
}
}
}
return f
}
if (h in g.map) {
j = g.length;
while (j--) {
if (g[j].name === h) {
g[j].value = l;
break
}
}
} else {
g.push({
name: h,
value: l
})
}
g.map[h] = l;
return f
} else {
return g.map[h]
}
}
},
clone: function() {
var g = this,
n = new b(g.name, g.type),
h, f, m, j, k;
if (m = g.attributes) {
k = [];
k.map = {};
for (h = 0, f = m.length; h < f; h++) {
j = m[h];
if (j.name !== "id") {
k[k.length] = {
name: j.name,
value: j.value
};
k.map[j.name] = j.value
}
}
n.attributes = k
}
n.value = g.value;
n.shortEnded = g.shortEnded;
return n
},
wrap: function(g) {
var f = this;
f.parent.insert(g, f);
g.append(f);
return f
},
unwrap: function() {
var f = this,
h, g;
for (h = f.firstChild; h;) {
g = h.next;
f.insert(h, f, true);
h = g
}
f.remove()
},
remove: function() {
var f = this,
h = f.parent,
g = f.next,
i = f.prev;
if (h) {
if (h.firstChild === f) {
h.firstChild = g;
if (g) {
g.prev = null
}
} else {
i.next = g
}
if (h.lastChild === f) {
h.lastChild = i;
if (i) {
i.next = null
}
} else {
g.prev = i
}
f.parent = f.next = f.prev = null
}
return f
},
append: function(h) {
var f = this,
g;
if (h.parent) {
h.remove()
}
g = f.lastChild;
if (g) {
g.next = h;
h.prev = g;
f.lastChild = h
} else {
f.lastChild = f.firstChild = h
}
h.parent = f;
return h
},
insert: function(h, f, i) {
var g;
if (h.parent) {
h.remove()
}
g = f.parent || this;
if (i) {
if (f === g.firstChild) {
g.firstChild = h
} else {
f.prev.next = h
}
h.prev = f.prev;
h.next = f;
f.prev = h
} else {
if (f === g.lastChild) {
g.lastChild = h
} else {
f.next.prev = h
}
h.next = f.next;
h.prev = f;
f.next = h
}
h.parent = g;
return h
},
getAll: function(g) {
var f = this,
h, i = [];
for (h = f.firstChild; h; h = a(h, f)) {
if (h.name === g) {
i.push(h)
}
}
return i
},
empty: function() {
var g = this,
f, h, j;
if (g.firstChild) {
f = [];
for (j = g.firstChild; j; j = a(j, g)) {
f.push(j)
}
h = f.length;
while (h--) {
j = f[h];
j.parent = j.firstChild = j.lastChild = j.next = j.prev = null
}
}
g.firstChild = g.lastChild = null;
return g
},
isEmpty: function(j) {
var f = this,
h = f.firstChild,
g;
if (h) {
do {
if (h.type === 1) {
if (h.attributes.map["data-mce-bogus"]) {
continue
}
if (j[h.name]) {
return false
}
g = h.attributes.length;
while (g--) {
if (h.attributes[g].name.indexOf("data-") === 0) {
return false
}
}
}
if ((h.type === 3 && !c.test(h.value))) {
return false
}
} while (h = a(h, f))
}
return true
}
});
d.extend(b, {
create: function(g, f) {
var i, h;
i = new b(g, e[g] || 1);
if (f) {
for (h in f) {
i.attr(h, f[h])
}
}
return i
}
});
d.html.Node = b
})(tinymce);
(function(b) {
var a = b.html.Node;
b.html.DomParser = function(g, h) {
var f = this,
e = {},
d = [],
i = {},
c = {};
g = g || {};
g.root_name = g.root_name || "body";
f.schema = h = h || new b.html.Schema();
function j(m) {
var o, p, x, v, z, n, q, l, t, u, k, s, y, r;
s = b.makeMap("tr,td,th,tbody,thead,tfoot,table");
k = h.getNonEmptyElements();
for (o = 0; o < m.length; o++) {
p = m[o];
if (!p.parent) {
continue
}
v = [p];
for (x = p.parent; x && !h.isValidChild(x.name, p.name) && !s[x.name]; x = x.parent) {
v.push(x)
}
if (x && v.length > 1) {
v.reverse();
z = n = f.filterNode(v[0].clone());
for (t = 0; t < v.length - 1; t++) {
if (h.isValidChild(n.name, v[t].name)) {
q = f.filterNode(v[t].clone());
n.append(q)
} else {
q = n
}
for (l = v[t].firstChild; l && l != v[t + 1];) {
r = l.next;
q.append(l);
l = r
}
n = q
}
if (!z.isEmpty(k)) {
x.insert(z, v[0], true);
x.insert(p, z)
} else {
x.insert(p, v[0], true)
}
x = v[0];
if (x.isEmpty(k) || x.firstChild === x.lastChild && x.firstChild.name === "br") {
x.empty().remove()
}
} else {
if (p.parent) {
if (p.name === "li") {
y = p.prev;
if (y && (y.name === "ul" || y.name === "ul")) {
y.append(p);
continue
}
y = p.next;
if (y && (y.name === "ul" || y.name === "ul")) {
y.insert(p, y.firstChild, true);
continue
}
p.wrap(f.filterNode(new a("ul", 1)));
continue
}
if (h.isValidChild(p.parent.name, "div") && h.isValidChild("div", p.name)) {
p.wrap(f.filterNode(new a("div", 1)))
} else {
if (p.name === "style" || p.name === "script") {
p.empty().remove()
} else {
p.unwrap()
}
}
}
}
}
}
f.filterNode = function(m) {
var l, k, n;
if (k in e) {
n = i[k];
if (n) {
n.push(m)
} else {
i[k] = [m]
}
}
l = d.length;
while (l--) {
k = d[l].name;
if (k in m.attributes.map) {
n = c[k];
if (n) {
n.push(m)
} else {
c[k] = [m]
}
}
}
return m
};
f.addNodeFilter = function(k, l) {
b.each(b.explode(k), function(m) {
var n = e[m];
if (!n) {
e[m] = n = []
}
n.push(l)
})
};
f.addAttributeFilter = function(k, l) {
b.each(b.explode(k), function(m) {
var n;
for (n = 0; n < d.length; n++) {
if (d[n].name === m) {
d[n].callbacks.push(l);
return
}
}
d.push({
name: m,
callbacks: [l]
})
})
};
f.parse = function(u, m) {
var n, D, y, x, A, z, v, q, C, G, o, B, F = [],
s, k, r, p, t;
m = m || {};
i = {};
c = {};
o = b.extend(b.makeMap("script,style,head,title,meta,param"), h.getBlockElements());
t = h.getNonEmptyElements();
p = h.children;
r = h.getWhiteSpaceElements();
B = /^[ \t\r\n]+/;
s = /[ \t\r\n]+$/;
k = /[ \t\r\n]+/g;
function E(l, H) {
var I = new a(l, H),
J;
if (l in e) {
J = i[l];
if (J) {
J.push(I)
} else {
i[l] = [I]
}
}
return I
}
n = new b.html.SaxParser({
validate: g.validate,
fix_self_closing: false,
cdata: function(l) {
y.append(E("#cdata", 4)).value = l
},
text: function(I, l) {
var H;
if (!r[y.name]) {
I = I.replace(k, " ");
if (y.lastChild && o[y.lastChild.name]) {
I = I.replace(B, "")
}
}
if (I.length !== 0) {
H = E("#text", 3);
H.raw = !! l;
y.append(H).value = I
}
},
comment: function(l) {
y.append(E("#comment", 8)).value = l
},
pi: function(l, H) {
y.append(E(l, 7)).value = H
},
doctype: function(l) {
y.append(E("#doctype", 10)).value = l
},
start: function(l, P, I) {
var N, K, J, H, L, Q, O, M;
J = h.getElementRule(l);
if (J) {
N = E(J.outputName || l, 1);
N.attributes = P;
N.shortEnded = I;
y.append(N);
M = p[y.name];
if (M && p[N.name] && !M[N.name]) {
F.push(N)
}
K = d.length;
while (K--) {
L = d[K].name;
if (L in P.map) {
C = c[L];
if (C) {
C.push(N)
} else {
c[L] = [N]
}
}
}
if (o[l]) {
for (H = N.prev; H && H.type === 3;) {
Q = H.value.replace(s, "");
if (Q.length > 0) {
H.value = Q;
H = H.prev
} else {
O = H.prev;
H.remove();
H = O
}
}
}
if (!I) {
y = N
}
}
},
end: function(l) {
var L, I, K, H, J;
I = h.getElementRule(l);
if (I) {
if (o[l]) {
if (!r[y.name]) {
for (L = y.firstChild; L && L.type === 3;) {
K = L.value.replace(B, "");
if (K.length > 0) {
L.value = K;
L = L.next
} else {
H = L.next;
L.remove();
L = H
}
}
for (L = y.lastChild; L && L.type === 3;) {
K = L.value.replace(s, "");
if (K.length > 0) {
L.value = K;
L = L.prev
} else {
H = L.prev;
L.remove();
L = H
}
}
}
L = y.prev;
if (L && L.type === 3) {
K = L.value.replace(B, "");
if (K.length > 0) {
L.value = K
} else {
L.remove()
}
}
}
if (I.removeEmpty || I.paddEmpty) {
if (y.isEmpty(t)) {
if (I.paddEmpty) {
y.empty().append(new a("#text", "3")).value = "\u00a0"
} else {
if (!y.attributes.map.name) {
J = y.parent;
y.empty().remove();
y = J;
return
}
}
}
}
y = y.parent
}
}
}, h);
D = y = new a(g.root_name, 11);
n.parse(u);
j(F);
for (G in i) {
C = e[G];
x = i[G];
v = x.length;
while (v--) {
if (!x[v].parent) {
x.splice(v, 1)
}
}
for (A = 0, z = C.length; A < z; A++) {
C[A](x, G, m)
}
}
for (A = 0, z = d.length; A < z; A++) {
C = d[A];
if (C.name in c) {
x = c[C.name];
v = x.length;
while (v--) {
if (!x[v].parent) {
x.splice(v, 1)
}
}
for (v = 0, q = C.callbacks.length; v < q; v++) {
C.callbacks[v](x, C.name, m)
}
}
}
return D
};
if (g.remove_trailing_brs) {
f.addNodeFilter("br", function(n, m) {
var r, q = n.length,
o, u = h.getBlockElements(),
k = h.getNonEmptyElements(),
s, p, t;
for (r = 0; r < q; r++) {
o = n[r];
s = o.parent;
if (u[o.parent.name] && o === s.lastChild) {
p = o.prev;
while (p) {
t = p.name;
if (t !== "span" || p.attr("data-mce-type") !== "bookmark") {
if (t !== "br") {
break
}
if (t === "br") {
o = null;
break
}
}
p = p.prev
}
if (o) {
o.remove();
if (s.isEmpty(k)) {
elementRule = h.getElementRule(s.name);
if (elementRule.removeEmpty) {
s.remove()
} else {
if (elementRule.paddEmpty) {
s.empty().append(new b.html.Node("#text", 3)).value = "\u00a0"
}
}
}
}
}
}
})
}
}
})(tinymce);
tinymce.html.Writer = function(e) {
var c = [],
a, b, d, f, g;
e = e || {};
a = e.indent;
b = tinymce.makeMap(e.indent_before || "");
d = tinymce.makeMap(e.indent_after || "");
f = tinymce.html.Entities.getEncodeFunc(e.entity_encoding || "raw", e.entities);
g = e.element_format == "html";
return {
start: function(m, k, p) {
var n, j, h, o;
if (a && b[m] && c.length > 0) {
o = c[c.length - 1];
if (o.length > 0 && o !== "\n") {
c.push("\n")
}
}
c.push("<", m);
if (k) {
for (n = 0, j = k.length; n < j; n++) {
h = k[n];
c.push(" ", h.name, '="', f(h.value, true), '"')
}
}
if (!p || g) {
c[c.length] = ">"
} else {
c[c.length] = " />"
}
},
end: function(h) {
var i;
c.push("", h, ">");
if (a && d[h] && c.length > 0) {
i = c[c.length - 1];
if (i.length > 0 && i !== "\n") {
c.push("\n")
}
}
},
text: function(i, h) {
if (i.length > 0) {
c[c.length] = h ? i : f(i)
}
},
cdata: function(h) {
c.push("")
},
comment: function(h) {
c.push("")
},
pi: function(h, i) {
if (i) {
c.push("", h, " ", i, "?>")
} else {
c.push("", h, "?>")
}
},
doctype: function(h) {
c.push("")
},
reset: function() {
c.length = 0
},
getContent: function() {
return c.join("").replace(/\n$/, "")
}
}
};
(function(a) {
a.html.Serializer = function(c, d) {
var b = this,
e = new a.html.Writer(c);
c = c || {};
c.validate = "validate" in c ? c.validate : true;
b.schema = d = d || new a.html.Schema();
b.writer = e;
b.serialize = function(h) {
var g, i;
i = c.validate;
g = {
3: function(k, j) {
e.text(k.value, k.raw)
},
8: function(j) {
e.comment(j.value)
},
7: function(j) {
e.pi(j.name, j.value)
},
10: function(j) {
e.doctype(j.value)
},
4: function(j) {
e.cdata(j.value)
},
11: function(j) {
if ((j = j.firstChild)) {
do {
f(j)
} while (j = j.next)
}
}
};
e.reset();
function f(k) {
var t = g[k.type],
j, o, s, r, p, u, n, m, q;
if (!t) {
j = k.name;
o = k.shortEnded;
s = k.attributes;
if (i && s && s.length > 1) {
u = [];
u.map = {};
q = d.getElementRule(k.name);
for (n = 0, m = q.attributesOrder.length; n < m; n++) {
r = q.attributesOrder[n];
if (r in s.map) {
p = s.map[r];
u.map[r] = p;
u.push({
name: r,
value: p
})
}
}
for (n = 0, m = s.length; n < m; n++) {
r = s[n].name;
if (!(r in u.map)) {
p = s.map[r];
u.map[r] = p;
u.push({
name: r,
value: p
})
}
}
s = u
}
e.start(k.name, s, o);
if (!o) {
if ((k = k.firstChild)) {
do {
f(k)
} while (k = k.next)
}
e.end(j)
}
} else {
t(k)
}
}
if (h.type == 1 && !c.inner) {
f(h)
} else {
g[11](h)
}
return e.getContent()
}
}
})(tinymce);
(function(d) {
var f = d.each,
c = d.is,
e = d.isWebKit,
a = d.isIE,
h = d.html.Entities,
b = /^([a-z0-9],?)+$/i,
g = d.html.Schema.blockElementsMap;
d.create("tinymce.dom.DOMUtils", {
doc: null,
root: null,
files: null,
pixelStyles: /^(top|left|bottom|right|width|height|borderWidth)$/,
props: {
"for": "htmlFor",
"class": "className",
className: "className",
checked: "checked",
disabled: "disabled",
maxlength: "maxLength",
readonly: "readOnly",
selected: "selected",
value: "value",
id: "id",
name: "name",
type: "type"
},
DOMUtils: function(m, k) {
var j = this,
i;
j.doc = m;
j.win = window;
j.files = {};
j.cssFlicker = false;
j.counter = 0;
j.stdMode = !d.isIE || m.documentMode >= 8;
j.boxModel = !d.isIE || m.compatMode == "CSS1Compat" || j.stdMode;
j.hasOuterHTML = "outerHTML" in m.createElement("a");
j.settings = k = d.extend({
keep_values: false,
hex_colors: 1
}, k);
j.styles = new d.html.Styles({
url_converter: k.url_converter,
url_converter_scope: k.url_converter_scope
}, k.schema);
if (d.isIE6) {
try {
m.execCommand("BackgroundImageCache", false, true)
} catch (l) {
j.cssFlicker = true
}
}
if (a) {
("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g, function(n) {
m.createElement(n)
})
}
d.addUnload(j.destroy, j)
},
getRoot: function() {
var i = this,
j = i.settings;
return (j && i.get(j.root_element)) || i.doc.body
},
getViewPort: function(j) {
var k, i;
j = !j ? this.win : j;
k = j.document;
i = this.boxModel ? k.documentElement : k.body;
return {
x: j.pageXOffset || i.scrollLeft,
y: j.pageYOffset || i.scrollTop,
w: j.innerWidth || i.clientWidth,
h: j.innerHeight || i.clientHeight
}
},
getRect: function(l) {
var k, i = this,
j;
l = i.get(l);
k = i.getPos(l);
j = i.getSize(l);
return {
x: k.x,
y: k.y,
w: j.w,
h: j.h
}
},
getSize: function(l) {
var j = this,
i, k;
l = j.get(l);
i = j.getStyle(l, "width");
k = j.getStyle(l, "height");
if (i.indexOf("px") === -1) {
i = 0
}
if (k.indexOf("px") === -1) {
k = 0
}
return {
w: parseInt(i) || l.offsetWidth || l.clientWidth,
h: parseInt(k) || l.offsetHeight || l.clientHeight
}
},
getParent: function(k, j, i) {
return this.getParents(k, j, i, false)
},
getParents: function(s, m, k, q) {
var j = this,
i, l = j.settings,
p = [];
s = j.get(s);
q = q === undefined;
if (l.strict_root) {
k = k || j.getRoot()
}
if (c(m, "string")) {
i = m;
if (m === "*") {
m = function(o) {
return o.nodeType == 1
}
} else {
m = function(o) {
return j.is(o, i)
}
}
}
while (s) {
if (s == k || !s.nodeType || s.nodeType === 9) {
break
}
if (!m || m(s)) {
if (q) {
p.push(s)
} else {
return s
}
}
s = s.parentNode
}
return q ? p : null
},
get: function(i) {
var j;
if (i && this.doc && typeof(i) == "string") {
j = i;
i = this.doc.getElementById(i);
if (i && i.id !== j) {
return this.doc.getElementsByName(j)[1]
}
}
return i
},
getNext: function(j, i) {
return this._findSib(j, i, "nextSibling")
},
getPrev: function(j, i) {
return this._findSib(j, i, "previousSibling")
},
select: function(k, j) {
var i = this;
return d.dom.Sizzle(k, i.get(j) || i.get(i.settings.root_element) || i.doc, [])
},
is: function(l, j) {
var k;
if (l.length === undefined) {
if (j === "*") {
return l.nodeType == 1
}
if (b.test(j)) {
j = j.toLowerCase().split(/,/);
l = l.nodeName.toLowerCase();
for (k = j.length - 1; k >= 0; k--) {
if (j[k] == l) {
return true
}
}
return false
}
}
return d.dom.Sizzle.matches(j, l.nodeType ? [l] : l).length > 0
},
add: function(l, o, i, k, m) {
var j = this;
return this.run(l, function(r) {
var q, n;
q = c(o, "string") ? j.doc.createElement(o) : o;
j.setAttribs(q, i);
if (k) {
if (k.nodeType) {
q.appendChild(k)
} else {
j.setHTML(q, k)
}
}
return !m ? r.appendChild(q) : q
})
},
create: function(k, i, j) {
return this.add(this.doc.createElement(k), k, i, j, 1)
},
createHTML: function(q, i, m) {
var p = "",
l = this,
j;
p += "<" + q;
for (j in i) {
if (i.hasOwnProperty(j)) {
p += " " + j + '="' + l.encode(i[j]) + '"'
}
}
if (typeof(m) != "undefined") {
return p + ">" + m + "" + q + ">"
}
return p + " />"
},
remove: function(i, j) {
return this.run(i, function(l) {
var k, m;
k = l.parentNode;
if (!k) {
return null
}
if (j) {
while (m = l.firstChild) {
if (!d.isIE || m.nodeType !== 3 || m.nodeValue) {
k.insertBefore(m, l)
} else {
l.removeChild(m)
}
}
}
return k.removeChild(l)
})
},
setStyle: function(l, i, j) {
var k = this;
return k.run(l, function(o) {
var n, m;
n = o.style;
i = i.replace(/-(\D)/g, function(q, p) {
return p.toUpperCase()
});
if (k.pixelStyles.test(i) && (d.is(j, "number") || /^[\-0-9\.]+$/.test(j))) {
j += "px"
}
switch (i) {
case "opacity":
if (a) {
n.filter = j === "" ? "" : "alpha(opacity=" + (j * 100) + ")";
if (!l.currentStyle || !l.currentStyle.hasLayout) {
n.display = "inline-block"
}
}
n[i] = n["-moz-opacity"] = n["-khtml-opacity"] = j || "";
break;
case "float":
a ? n.styleFloat = j : n.cssFloat = j;
break;
default:
n[i] = j || ""
}
if (k.settings.update_styles) {
k.setAttrib(o, "data-mce-style")
}
})
},
getStyle: function(l, i, k) {
l = this.get(l);
if (!l) {
return false
}
if (this.doc.defaultView && k) {
i = i.replace(/[A-Z]/g, function(m) {
return "-" + m
});
try {
return this.doc.defaultView.getComputedStyle(l, null).getPropertyValue(i)
} catch (j) {
return null
}
}
i = i.replace(/-(\D)/g, function(n, m) {
return m.toUpperCase()
});
if (i == "float") {
i = a ? "styleFloat" : "cssFloat"
}
if (l.currentStyle && k) {
return l.currentStyle[i]
}
return l.style[i]
},
setStyles: function(l, m) {
var j = this,
k = j.settings,
i;
i = k.update_styles;
k.update_styles = 0;
f(m, function(o, p) {
j.setStyle(l, p, o)
});
k.update_styles = i;
if (k.update_styles) {
j.setAttrib(l, k.cssText)
}
},
removeAllAttribs: function(i) {
return this.run(i, function(l) {
var j = l.attributes;
for (var k = j.length - 1; k >= 0; k--) {
l.removeAttributeNode(j.item(k))
}
})
},
setAttrib: function(k, l, i) {
var j = this;
if (!k || !l) {
return
}
if (j.settings.strict) {
l = l.toLowerCase()
}
return this.run(k, function(n) {
var m = j.settings;
switch (l) {
case "style":
if (!c(i, "string")) {
f(i, function(o, p) {
j.setStyle(n, p, o)
});
return
}
if (m.keep_values) {
if (i && !j._isRes(i)) {
n.setAttribute("data-mce-style", i, 2)
} else {
n.removeAttribute("data-mce-style", 2)
}
}
n.style.cssText = i;
break;
case "class":
n.className = i || "";
break;
case "src":
case "href":
if (m.keep_values) {
if (m.url_converter) {
i = m.url_converter.call(m.url_converter_scope || j, i, l, n)
}
j.setAttrib(n, "data-mce-" + l, i, 2)
}
break;
case "shape":
n.setAttribute("data-mce-style", i);
break
}
if (c(i) && i !== null && i.length !== 0) {
n.setAttribute(l, "" + i, 2)
} else {
n.removeAttribute(l, 2)
}
})
},
setAttribs: function(j, k) {
var i = this;
return this.run(j, function(l) {
f(k, function(m, o) {
i.setAttrib(l, o, m)
})
})
},
getAttrib: function(l, m, k) {
var i, j = this;
l = j.get(l);
if (!l || l.nodeType !== 1) {
return false
}
if (!c(k)) {
k = ""
}
if (/^(src|href|style|coords|shape)$/.test(m)) {
i = l.getAttribute("data-mce-" + m);
if (i) {
return i
}
}
if (a && j.props[m]) {
i = l[j.props[m]];
i = i && i.nodeValue ? i.nodeValue : i
}
if (!i) {
i = l.getAttribute(m, 2)
}
if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(m)) {
if (l[j.props[m]] === true && i === "") {
return m
}
return i ? m : ""
}
if (l.nodeName === "FORM" && l.getAttributeNode(m)) {
return l.getAttributeNode(m).nodeValue
}
if (m === "style") {
i = i || l.style.cssText;
if (i) {
i = j.serializeStyle(j.parseStyle(i), l.nodeName);
if (j.settings.keep_values && !j._isRes(i)) {
l.setAttribute("data-mce-style", i)
}
}
}
if (e && m === "class" && i) {
i = i.replace(/(apple|webkit)\-[a-z\-]+/gi, "")
}
if (a) {
switch (m) {
case "rowspan":
case "colspan":
if (i === 1) {
i = ""
}
break;
case "size":
if (i === "+0" || i === 20 || i === 0) {
i = ""
}
break;
case "width":
case "height":
case "vspace":
case "checked":
case "disabled":
case "readonly":
if (i === 0) {
i = ""
}
break;
case "hspace":
if (i === -1) {
i = ""
}
break;
case "maxlength":
case "tabindex":
if (i === 32768 || i === 2147483647 || i === "32768") {
i = ""
}
break;
case "multiple":
case "compact":
case "noshade":
case "nowrap":
if (i === 65535) {
return m
}
return k;
case "shape":
i = i.toLowerCase();
break;
default:
if (m.indexOf("on") === 0 && i) {
i = d._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, "$1", "" + i)
}
}
}
return (i !== undefined && i !== null && i !== "") ? "" + i : k
},
getPos: function(q, l) {
var j = this,
i = 0,
p = 0,
m, o = j.doc,
k;
q = j.get(q);
l = l || o.body;
if (q) {
if (a && !j.stdMode) {
q = q.getBoundingClientRect();
m = j.boxModel ? o.documentElement : o.body;
i = j.getStyle(j.select("html")[0], "borderWidth");
i = (i == "medium" || j.boxModel && !j.isIE6) && 2 || i;
return {
x: q.left + m.scrollLeft - i,
y: q.top + m.scrollTop - i
}
}
k = q;
while (k && k != l && k.nodeType) {
i += k.offsetLeft || 0;
p += k.offsetTop || 0;
k = k.offsetParent
}
k = q.parentNode;
while (k && k != l && k.nodeType) {
i -= k.scrollLeft || 0;
p -= k.scrollTop || 0;
k = k.parentNode
}
}
return {
x: i,
y: p
}
},
parseStyle: function(i) {
return this.styles.parse(i)
},
serializeStyle: function(j, i) {
return this.styles.serialize(j, i)
},
loadCSS: function(i) {
var k = this,
l = k.doc,
j;
if (!i) {
i = ""
}
j = k.select("head")[0];
f(i.split(","), function(m) {
var n;
if (k.files[m]) {
return
}
k.files[m] = true;
n = k.create("link", {
rel: "stylesheet",
href: d._addVer(m)
});
if (a && l.documentMode && l.recalc) {
n.onload = function() {
if (l.recalc) {
l.recalc()
}
n.onload = null
}
}
j.appendChild(n)
})
},
addClass: function(i, j) {
return this.run(i, function(k) {
var l;
if (!j) {
return 0
}
if (this.hasClass(k, j)) {
return k.className
}
l = this.removeClass(k, j);
return k.className = (l != "" ? (l + " ") : "") + j
})
},
removeClass: function(k, l) {
var i = this,
j;
return i.run(k, function(n) {
var m;
if (i.hasClass(n, l)) {
if (!j) {
j = new RegExp("(^|\\s+)" + l + "(\\s+|$)", "g")
}
m = n.className.replace(j, " ");
m = d.trim(m != " " ? m : "");
n.className = m;
if (!m) {
n.removeAttribute("class");
n.removeAttribute("className")
}
return m
}
return n.className
})
},
hasClass: function(j, i) {
j = this.get(j);
if (!j || !i) {
return false
}
return (" " + j.className + " ").indexOf(" " + i + " ") !== -1
},
show: function(i) {
return this.setStyle(i, "display", "block")
},
hide: function(i) {
return this.setStyle(i, "display", "none")
},
isHidden: function(i) {
i = this.get(i);
return !i || i.style.display == "none" || this.getStyle(i, "display") == "none"
},
uniqueId: function(i) {
return (!i ? "mce_" : i) + (this.counter++)
},
setHTML: function(k, j) {
var i = this;
return i.run(k, function(m) {
if (a) {
while (m.firstChild) {
m.removeChild(m.firstChild)
}
try {
m.innerHTML = "
" + j;
m.removeChild(m.firstChild)
} catch (l) {
m = i.create("div");
m.innerHTML = "
" + j;
f(m.childNodes, function(o, n) {
if (n) {
m.appendChild(o)
}
})
}
} else {
m.innerHTML = j
}
return j
})
},
getOuterHTML: function(k) {
var j, i = this;
k = i.get(k);
if (!k) {
return null
}
if (k.nodeType === 1 && i.hasOuterHTML) {
return k.outerHTML
}
j = (k.ownerDocument || i.doc).createElement("body");
j.appendChild(k.cloneNode(true));
return j.innerHTML
},
setOuterHTML: function(l, j, m) {
var i = this;
function k(p, o, r) {
var s, q;
q = r.createElement("body");
q.innerHTML = o;
s = q.lastChild;
while (s) {
i.insertAfter(s.cloneNode(true), p);
s = s.previousSibling
}
i.remove(p)
}
return this.run(l, function(o) {
o = i.get(o);
if (o.nodeType == 1) {
m = m || o.ownerDocument || i.doc;
if (a) {
try {
if (a && o.nodeType == 1) {
o.outerHTML = j
} else {
k(o, j, m)
}
} catch (n) {
k(o, j, m)
}
} else {
k(o, j, m)
}
}
})
},
decode: h.decode,
encode: h.encodeAllRaw,
insertAfter: function(i, j) {
j = this.get(j);
return this.run(i, function(l) {
var k, m;
k = j.parentNode;
m = j.nextSibling;
if (m) {
k.insertBefore(l, m)
} else {
k.appendChild(l)
}
return l
})
},
isBlock: function(j) {
var i = j.nodeType;
if (i) {
return !!(i === 1 && g[j.nodeName])
}
return !!g[j]
},
replace: function(m, l, i) {
var j = this;
if (c(l, "array")) {
m = m.cloneNode(true)
}
return j.run(l, function(k) {
if (i) {
f(d.grep(k.childNodes), function(n) {
m.appendChild(n)
})
}
return k.parentNode.replaceChild(m, k)
})
},
rename: function(l, i) {
var k = this,
j;
if (l.nodeName != i.toUpperCase()) {
j = k.create(i);
f(k.getAttribs(l), function(m) {
k.setAttrib(j, m.nodeName, k.getAttrib(l, m.nodeName))
});
k.replace(j, l, 1)
}
return j || l
},
findCommonAncestor: function(k, i) {
var l = k,
j;
while (l) {
j = i;
while (j && l != j) {
j = j.parentNode
}
if (l == j) {
break
}
l = l.parentNode
}
if (!l && k.ownerDocument) {
return k.ownerDocument.documentElement
}
return l
},
toHex: function(i) {
var k = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);
function j(l) {
l = parseInt(l).toString(16);
return l.length > 1 ? l : "0" + l
}
if (k) {
i = "#" + j(k[1]) + j(k[2]) + j(k[3]);
return i
}
return i
},
getClasses: function() {
var n = this,
j = [],
m, o = {},
p = n.settings.class_filter,
l;
if (n.classes) {
return n.classes
}
function q(i) {
f(i.imports, function(s) {
q(s)
});
f(i.cssRules || i.rules, function(s) {
switch (s.type || 1) {
case 1:
if (s.selectorText) {
f(s.selectorText.split(","), function(r) {
r = r.replace(/^\s*|\s*$|^\s\./g, "");
if (/\.mce/.test(r) || !/\.[\w\-]+$/.test(r)) {
return
}
l = r;
r = d._replace(/.*\.([a-z0-9_\-]+).*/i, "$1", r);
if (p && !(r = p(r, l))) {
return
}
if (!o[r]) {
j.push({
"class": r
});
o[r] = 1
}
})
}
break;
case 3:
q(s.styleSheet);
break
}
})
}
try {
f(n.doc.styleSheets, q)
} catch (k) {}
if (j.length > 0) {
n.classes = j
}
return j
},
run: function(l, k, j) {
var i = this,
m;
if (i.doc && typeof(l) === "string") {
l = i.get(l)
}
if (!l) {
return false
}
j = j || this;
if (!l.nodeType && (l.length || l.length === 0)) {
m = [];
f(l, function(o, n) {
if (o) {
if (typeof(o) == "string") {
o = i.doc.getElementById(o)
}
m.push(k.call(j, o, n))
}
});
return m
}
return k.call(j, l)
},
getAttribs: function(j) {
var i;
j = this.get(j);
if (!j) {
return []
}
if (a) {
i = [];
if (j.nodeName == "OBJECT") {
return j.attributes
}
if (j.nodeName === "OPTION" && this.getAttrib(j, "selected")) {
i.push({
specified: 1,
nodeName: "selected"
})
}
j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, "").replace(/[\w:\-]+/gi, function(k) {
i.push({
specified: 1,
nodeName: k
})
});
return i
}
return j.attributes
},
destroy: function(j) {
var i = this;
if (i.events) {
i.events.destroy()
}
i.win = i.doc = i.root = i.events = null;
if (!j) {
d.removeUnload(i.destroy)
}
},
createRng: function() {
var i = this.doc;
return i.createRange ? i.createRange() : new d.dom.Range(this)
},
nodeIndex: function(n, o) {
var i = 0,
l, m, k, j;
if (n) {
for (l = n.nodeType, n = n.previousSibling, m = n; n; n = n.previousSibling) {
k = n.nodeType;
if (o && k == 3) {
j = false;
try {
j = n.nodeValue.length
} catch (p) {}
if (k == l || !j) {
continue
}
}
i++;
l = k
}
}
return i
},
split: function(m, l, p) {
var q = this,
i = q.createRng(),
n, k, o;
function j(t) {
var s, r = t.childNodes;
if (t.nodeType == 1 && t.getAttribute("data-mce-type") == "bookmark") {
return
}
for (s = r.length - 1; s >= 0; s--) {
j(r[s])
}
if (t.nodeType != 9) {
if (t.nodeType == 3 && t.nodeValue.length > 0) {
if (!q.isBlock(t.parentNode) || d.trim(t.nodeValue).length > 0) {
return
}
}
if (t.nodeType == 1) {
r = t.childNodes;
if (r.length == 1 && r[0] && r[0].nodeType == 1 && r[0].getAttribute("data-mce-type") == "bookmark") {
t.parentNode.insertBefore(r[0], t)
}
if (r.length || /^(br|hr|input|img)$/i.test(t.nodeName)) {
return
}
}
q.remove(t)
}
return t
}
if (m && l) {
i.setStart(m.parentNode, q.nodeIndex(m));
i.setEnd(l.parentNode, q.nodeIndex(l));
n = i.extractContents();
i = q.createRng();
i.setStart(l.parentNode, q.nodeIndex(l) + 1);
i.setEnd(m.parentNode, q.nodeIndex(m) + 1);
k = i.extractContents();
o = m.parentNode;
o.insertBefore(j(n), m);
if (p) {
o.replaceChild(p, l)
} else {
o.insertBefore(l, m)
}
o.insertBefore(j(k), m);
q.remove(m);
return p || l
}
},
bind: function(m, i, l, k) {
var j = this;
if (!j.events) {
j.events = new d.dom.EventUtils()
}
return j.events.add(m, i, l, k || this)
},
unbind: function(l, i, k) {
var j = this;
if (!j.events) {
j.events = new d.dom.EventUtils()
}
return j.events.remove(l, i, k)
},
_findSib: function(l, i, j) {
var k = this,
m = i;
if (l) {
if (c(m, "string")) {
m = function(n) {
return k.is(n, i)
}
}
for (l = l[j]; l; l = l[j]) {
if (m(l)) {
return l
}
}
}
return null
},
_isRes: function(i) {
return /^(top|left|bottom|right|width|height)/i.test(i) || /;\s*(top|left|bottom|right|width|height)/i.test(i)
}
});
d.DOM = new d.dom.DOMUtils(document, {
process_html: 0
})
})(tinymce);
(function(a) {
function b(c) {
var N = this,
e = c.doc,
S = 0,
E = 1,
j = 2,
D = true,
R = false,
U = "startOffset",
h = "startContainer",
P = "endContainer",
z = "endOffset",
k = tinymce.extend,
n = c.nodeIndex;
k(N, {
startContainer: e,
startOffset: 0,
endContainer: e,
endOffset: 0,
collapsed: D,
commonAncestorContainer: e,
START_TO_START: 0,
START_TO_END: 1,
END_TO_END: 2,
END_TO_START: 3,
setStart: q,
setEnd: s,
setStartBefore: g,
setStartAfter: I,
setEndBefore: J,
setEndAfter: u,
collapse: A,
selectNode: x,
selectNodeContents: F,
compareBoundaryPoints: v,
deleteContents: p,
extractContents: H,
cloneContents: d,
insertNode: C,
surroundContents: M,
cloneRange: K
});
function q(V, t) {
B(D, V, t)
}
function s(V, t) {
B(R, V, t)
}
function g(t) {
q(t.parentNode, n(t))
}
function I(t) {
q(t.parentNode, n(t) + 1)
}
function J(t) {
s(t.parentNode, n(t))
}
function u(t) {
s(t.parentNode, n(t) + 1)
}
function A(t) {
if (t) {
N[P] = N[h];
N[z] = N[U]
} else {
N[h] = N[P];
N[U] = N[z]
}
N.collapsed = D
}
function x(t) {
g(t);
u(t)
}
function F(t) {
q(t, 0);
s(t, t.nodeType === 1 ? t.childNodes.length : t.nodeValue.length)
}
function v(Y, t) {
var ab = N[h],
W = N[U],
aa = N[P],
V = N[z],
Z = t.startContainer,
ad = t.startOffset,
X = t.endContainer,
ac = t.endOffset;
if (Y === 0) {
return G(ab, W, Z, ad)
}
if (Y === 1) {
return G(aa, V, Z, ad)
}
if (Y === 2) {
return G(aa, V, X, ac)
}
if (Y === 3) {
return G(ab, W, X, ac)
}
}
function p() {
m(j)
}
function H() {
return m(S)
}
function d() {
return m(E)
}
function C(Y) {
var V = this[h],
t = this[U],
X, W;
if ((V.nodeType === 3 || V.nodeType === 4) && V.nodeValue) {
if (!t) {
V.parentNode.insertBefore(Y, V)
} else {
if (t >= V.nodeValue.length) {
c.insertAfter(Y, V)
} else {
X = V.splitText(t);
V.parentNode.insertBefore(Y, X)
}
}
} else {
if (V.childNodes.length > 0) {
W = V.childNodes[t]
}
if (W) {
V.insertBefore(Y, W)
} else {
V.appendChild(Y)
}
}
}
function M(V) {
var t = N.extractContents();
N.insertNode(V);
V.appendChild(t);
N.selectNode(V)
}
function K() {
return k(new b(c), {
startContainer: N[h],
startOffset: N[U],
endContainer: N[P],
endOffset: N[z],
collapsed: N.collapsed,
commonAncestorContainer: N.commonAncestorContainer
})
}
function O(t, V) {
var W;
if (t.nodeType == 3) {
return t
}
if (V < 0) {
return t
}
W = t.firstChild;
while (W && V > 0) {
--V;
W = W.nextSibling
}
if (W) {
return W
}
return t
}
function l() {
return (N[h] == N[P] && N[U] == N[z])
}
function G(X, Z, V, Y) {
var aa, W, t, ab, ad, ac;
if (X == V) {
if (Z == Y) {
return 0
}
if (Z < Y) {
return -1
}
return 1
}
aa = V;
while (aa && aa.parentNode != X) {
aa = aa.parentNode
}
if (aa) {
W = 0;
t = X.firstChild;
while (t != aa && W < Z) {
W++;
t = t.nextSibling
}
if (Z <= W) {
return -1
}
return 1
}
aa = X;
while (aa && aa.parentNode != V) {
aa = aa.parentNode
}
if (aa) {
W = 0;
t = V.firstChild;
while (t != aa && W < Y) {
W++;
t = t.nextSibling
}
if (W < Y) {
return -1
}
return 1
}
ab = c.findCommonAncestor(X, V);
ad = X;
while (ad && ad.parentNode != ab) {
ad = ad.parentNode
}
if (!ad) {
ad = ab
}
ac = V;
while (ac && ac.parentNode != ab) {
ac = ac.parentNode
}
if (!ac) {
ac = ab
}
if (ad == ac) {
return 0
}
t = ab.firstChild;
while (t) {
if (t == ad) {
return -1
}
if (t == ac) {
return 1
}
t = t.nextSibling
}
}
function B(V, Y, X) {
var t, W;
if (V) {
N[h] = Y;
N[U] = X
} else {
N[P] = Y;
N[z] = X
}
t = N[P];
while (t.parentNode) {
t = t.parentNode
}
W = N[h];
while (W.parentNode) {
W = W.parentNode
}
if (W == t) {
if (G(N[h], N[U], N[P], N[z]) > 0) {
N.collapse(V)
}
} else {
N.collapse(V)
}
N.collapsed = l();
N.commonAncestorContainer = c.findCommonAncestor(N[h], N[P])
}
function m(ab) {
var aa, X = 0,
ad = 0,
V, Z, W, Y, t, ac;
if (N[h] == N[P]) {
return f(ab)
}
for (aa = N[P], V = aa.parentNode; V; aa = V, V = V.parentNode) {
if (V == N[h]) {
return r(aa, ab)
}++X
}
for (aa = N[h], V = aa.parentNode; V; aa = V, V = V.parentNode) {
if (V == N[P]) {
return T(aa, ab)
}++ad
}
Z = ad - X;
W = N[h];
while (Z > 0) {
W = W.parentNode;
Z--
}
Y = N[P];
while (Z < 0) {
Y = Y.parentNode;
Z++
}
for (t = W.parentNode, ac = Y.parentNode; t != ac; t = t.parentNode, ac = ac.parentNode) {
W = t;
Y = ac
}
return o(W, Y, ab)
}
function f(Z) {
var ab, Y, X, aa, t, W, V;
if (Z != j) {
ab = e.createDocumentFragment()
}
if (N[U] == N[z]) {
return ab
}
if (N[h].nodeType == 3) {
Y = N[h].nodeValue;
X = Y.substring(N[U], N[z]);
if (Z != E) {
N[h].deleteData(N[U], N[z] - N[U]);
N.collapse(D)
}
if (Z == j) {
return
}
ab.appendChild(e.createTextNode(X));
return ab
}
aa = O(N[h], N[U]);
t = N[z] - N[U];
while (t > 0) {
W = aa.nextSibling;
V = y(aa, Z);
if (ab) {
ab.appendChild(V)
}--t;
aa = W
}
if (Z != E) {
N.collapse(D)
}
return ab
}
function r(ab, Y) {
var aa, Z, V, t, X, W;
if (Y != j) {
aa = e.createDocumentFragment()
}
Z = i(ab, Y);
if (aa) {
aa.appendChild(Z)
}
V = n(ab);
t = V - N[U];
if (t <= 0) {
if (Y != E) {
N.setEndBefore(ab);
N.collapse(R)
}
return aa
}
Z = ab.previousSibling;
while (t > 0) {
X = Z.previousSibling;
W = y(Z, Y);
if (aa) {
aa.insertBefore(W, aa.firstChild)
}--t;
Z = X
}
if (Y != E) {
N.setEndBefore(ab);
N.collapse(R)
}
return aa
}
function T(Z, Y) {
var ab, V, aa, t, X, W;
if (Y != j) {
ab = e.createDocumentFragment()
}
aa = Q(Z, Y);
if (ab) {
ab.appendChild(aa)
}
V = n(Z);
++V;
t = N[z] - V;
aa = Z.nextSibling;
while (t > 0) {
X = aa.nextSibling;
W = y(aa, Y);
if (ab) {
ab.appendChild(W)
}--t;
aa = X
}
if (Y != E) {
N.setStartAfter(Z);
N.collapse(D)
}
return ab
}
function o(Z, t, ac) {
var W, ae, Y, aa, ab, V, ad, X;
if (ac != j) {
ae = e.createDocumentFragment()
}
W = Q(Z, ac);
if (ae) {
ae.appendChild(W)
}
Y = Z.parentNode;
aa = n(Z);
ab = n(t);
++aa;
V = ab - aa;
ad = Z.nextSibling;
while (V > 0) {
X = ad.nextSibling;
W = y(ad, ac);
if (ae) {
ae.appendChild(W)
}
ad = X;
--V
}
W = i(t, ac);
if (ae) {
ae.appendChild(W)
}
if (ac != E) {
N.setStartAfter(Z);
N.collapse(D)
}
return ae
}
function i(aa, ab) {
var W = O(N[P], N[z] - 1),
ac, Z, Y, t, V, X = W != N[P];
if (W == aa) {
return L(W, X, R, ab)
}
ac = W.parentNode;
Z = L(ac, R, R, ab);
while (ac) {
while (W) {
Y = W.previousSibling;
t = L(W, X, R, ab);
if (ab != j) {
Z.insertBefore(t, Z.firstChild)
}
X = D;
W = Y
}
if (ac == aa) {
return Z
}
W = ac.previousSibling;
ac = ac.parentNode;
V = L(ac, R, R, ab);
if (ab != j) {
V.appendChild(Z)
}
Z = V
}
}
function Q(aa, ab) {
var X = O(N[h], N[U]),
Y = X != N[h],
ac, Z, W, t, V;
if (X == aa) {
return L(X, Y, D, ab)
}
ac = X.parentNode;
Z = L(ac, R, D, ab);
while (ac) {
while (X) {
W = X.nextSibling;
t = L(X, Y, D, ab);
if (ab != j) {
Z.appendChild(t)
}
Y = D;
X = W
}
if (ac == aa) {
return Z
}
X = ac.nextSibling;
ac = ac.parentNode;
V = L(ac, R, D, ab);
if (ab != j) {
V.appendChild(Z)
}
Z = V
}
}
function L(t, Y, ab, ac) {
var X, W, Z, V, aa;
if (Y) {
return y(t, ac)
}
if (t.nodeType == 3) {
X = t.nodeValue;
if (ab) {
V = N[U];
W = X.substring(V);
Z = X.substring(0, V)
} else {
V = N[z];
W = X.substring(0, V);
Z = X.substring(V)
}
if (ac != E) {
t.nodeValue = Z
}
if (ac == j) {
return
}
aa = t.cloneNode(R);
aa.nodeValue = W;
return aa
}
if (ac == j) {
return
}
return t.cloneNode(R)
}
function y(V, t) {
if (t != j) {
return t == E ? V.cloneNode(D) : V
}
V.parentNode.removeChild(V)
}
}
a.Range = b
})(tinymce.dom);
(function() {
function a(g) {
var i = this,
j = "\uFEFF",
e, h, d = g.dom,
c = true,
f = false;
function b() {
var n = g.getRng(),
k = d.createRng(),
m, o;
m = n.item ? n.item(0) : n.parentElement();
if (m.ownerDocument != d.doc) {
return k
}
o = g.isCollapsed();
if (n.item || !m.hasChildNodes()) {
if (o) {
k.setStart(m, 0);
k.setEnd(m, 0)
} else {
k.setStart(m.parentNode, d.nodeIndex(m));
k.setEnd(k.startContainer, k.startOffset + 1)
}
return k
}
function l(s) {
var u, q, t, p, A = 0,
x, y, z, r, v;
r = n.duplicate();
r.collapse(s);
u = d.create("a");
z = r.parentElement();
if (!z.hasChildNodes()) {
k[s ? "setStart" : "setEnd"](z, 0);
return
}
z.appendChild(u);
r.moveToElementText(u);
v = n.compareEndPoints(s ? "StartToStart" : "EndToEnd", r);
if (v > 0) {
k[s ? "setStartAfter" : "setEndAfter"](z);
d.remove(u);
return
}
p = tinymce.grep(z.childNodes);
x = p.length - 1;
while (A <= x) {
y = Math.floor((A + x) / 2);
z.insertBefore(u, p[y]);
r.moveToElementText(u);
v = n.compareEndPoints(s ? "StartToStart" : "EndToEnd", r);
if (v > 0) {
A = y + 1
} else {
if (v < 0) {
x = y - 1
} else {
found = true;
break
}
}
}
q = v > 0 || y == 0 ? u.nextSibling : u.previousSibling;
if (q.nodeType == 1) {
d.remove(u);
t = d.nodeIndex(q);
q = q.parentNode;
if (!s || y > 0) {
t++
}
} else {
if (v > 0 || y == 0) {
r.setEndPoint(s ? "StartToStart" : "EndToEnd", n);
t = r.text.length
} else {
r.setEndPoint(s ? "StartToStart" : "EndToEnd", n);
t = q.nodeValue.length - r.text.length
}
d.remove(u)
}
k[s ? "setStart" : "setEnd"](q, t)
}
l(true);
if (!o) {
l()
}
return k
}
this.addRange = function(k) {
var p, n, m, r, u, s, t = g.dom.doc,
o = t.body;
function l(B) {
var x, A, v, z, y;
v = d.create("a");
x = B ? m : u;
A = B ? r : s;
z = p.duplicate();
if (x == t || x == t.documentElement) {
x = o;
A = 0
}
if (x.nodeType == 3) {
x.parentNode.insertBefore(v, x);
z.moveToElementText(v);
z.moveStart("character", A);
d.remove(v);
p.setEndPoint(B ? "StartToStart" : "EndToEnd", z)
} else {
y = x.childNodes;
if (y.length) {
if (A >= y.length) {
d.insertAfter(v, y[y.length - 1])
} else {
x.insertBefore(v, y[A])
}
z.moveToElementText(v)
} else {
v = t.createTextNode(j);
x.appendChild(v);
z.moveToElementText(v.parentNode);
z.collapse(c)
}
p.setEndPoint(B ? "StartToStart" : "EndToEnd", z);
d.remove(v)
}
}
this.destroy();
m = k.startContainer;
r = k.startOffset;
u = k.endContainer;
s = k.endOffset;
p = o.createTextRange();
if (m == u && m.nodeType == 1 && r == s - 1) {
if (r == s - 1) {
try {
n = o.createControlRange();
n.addElement(m.childNodes[r]);
n.select();
return
} catch (q) {}
}
}
l(true);
l();
p.select()
};
this.getRangeAt = function() {
if (!e || !tinymce.dom.RangeUtils.compareRanges(h, g.getRng())) {
e = b();
h = g.getRng()
}
try {
e.startContainer.nextSibling
} catch (k) {
e = b();
h = null
}
return e
};
this.destroy = function() {
h = e = null
}
}
tinymce.dom.TridentSelection = a
})();
(function() {
var p = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
j = 0,
d = Object.prototype.toString,
o = false,
i = true;
[0, 0].sort(function() {
i = false;
return 0
});
var b = function(v, e, z, A) {
z = z || [];
e = e || document;
var C = e;
if (e.nodeType !== 1 && e.nodeType !== 9) {
return []
}
if (!v || typeof v !== "string") {
return z
}
var x = [],
s, E, H, r, u = true,
t = b.isXML(e),
B = v,
D, G, F, y;
do {
p.exec("");
s = p.exec(B);
if (s) {
B = s[3];
x.push(s[1]);
if (s[2]) {
r = s[3];
break
}
}
} while (s);
if (x.length > 1 && k.exec(v)) {
if (x.length === 2 && f.relative[x[0]]) {
E = h(x[0] + x[1], e)
} else {
E = f.relative[x[0]] ? [e] : b(x.shift(), e);
while (x.length) {
v = x.shift();
if (f.relative[v]) {
v += x.shift()
}
E = h(v, E)
}
}
} else {
if (!A && x.length > 1 && e.nodeType === 9 && !t && f.match.ID.test(x[0]) && !f.match.ID.test(x[x.length - 1])) {
D = b.find(x.shift(), e, t);
e = D.expr ? b.filter(D.expr, D.set)[0] : D.set[0]
}
if (e) {
D = A ? {
expr: x.pop(),
set: a(A)
} : b.find(x.pop(), x.length === 1 && (x[0] === "~" || x[0] === "+") && e.parentNode ? e.parentNode : e, t);
E = D.expr ? b.filter(D.expr, D.set) : D.set;
if (x.length > 0) {
H = a(E)
} else {
u = false
}
while (x.length) {
G = x.pop();
F = G;
if (!f.relative[G]) {
G = ""
} else {
F = x.pop()
}
if (F == null) {
F = e
}
f.relative[G](H, F, t)
}
} else {
H = x = []
}
}
if (!H) {
H = E
}
if (!H) {
b.error(G || v)
}
if (d.call(H) === "[object Array]") {
if (!u) {
z.push.apply(z, H)
} else {
if (e && e.nodeType === 1) {
for (y = 0; H[y] != null; y++) {
if (H[y] && (H[y] === true || H[y].nodeType === 1 && b.contains(e, H[y]))) {
z.push(E[y])
}
}
} else {
for (y = 0; H[y] != null; y++) {
if (H[y] && H[y].nodeType === 1) {
z.push(E[y])
}
}
}
}
} else {
a(H, z)
}
if (r) {
b(r, C, z, A);
b.uniqueSort(z)
}
return z
};
b.uniqueSort = function(r) {
if (c) {
o = i;
r.sort(c);
if (o) {
for (var e = 1; e < r.length; e++) {
if (r[e] === r[e - 1]) {
r.splice(e--, 1)
}
}
}
}
return r
};
b.matches = function(e, r) {
return b(e, null, null, r)
};
b.find = function(y, e, z) {
var x;
if (!y) {
return []
}
for (var t = 0, s = f.order.length; t < s; t++) {
var v = f.order[t],
u;
if ((u = f.leftMatch[v].exec(y))) {
var r = u[1];
u.splice(1, 1);
if (r.substr(r.length - 1) !== "\\") {
u[1] = (u[1] || "").replace(/\\/g, "");
x = f.find[v](u, e, z);
if (x != null) {
y = y.replace(f.match[v], "");
break
}
}
}
}
if (!x) {
x = e.getElementsByTagName("*")
}
return {
set: x,
expr: y
}
};
b.filter = function(C, B, F, u) {
var s = C,
H = [],
z = B,
x, e, y = B && B[0] && b.isXML(B[0]);
while (C && B.length) {
for (var A in f.filter) {
if ((x = f.leftMatch[A].exec(C)) != null && x[2]) {
var r = f.filter[A],
G, E, t = x[1];
e = false;
x.splice(1, 1);
if (t.substr(t.length - 1) === "\\") {
continue
}
if (z === H) {
H = []
}
if (f.preFilter[A]) {
x = f.preFilter[A](x, z, F, H, u, y);
if (!x) {
e = G = true
} else {
if (x === true) {
continue
}
}
}
if (x) {
for (var v = 0;
(E = z[v]) != null; v++) {
if (E) {
G = r(E, x, v, z);
var D = u ^ !! G;
if (F && G != null) {
if (D) {
e = true
} else {
z[v] = false
}
} else {
if (D) {
H.push(E);
e = true
}
}
}
}
}
if (G !== undefined) {
if (!F) {
z = H
}
C = C.replace(f.match[A], "");
if (!e) {
return []
}
break
}
}
}
if (C === s) {
if (e == null) {
b.error(C)
} else {
break
}
}
s = C
}
return z
};
b.error = function(e) {
throw "Syntax error, unrecognized expression: " + e
};
var f = b.selectors = {
order: ["ID", "NAME", "TAG"],
match: {
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
},
leftMatch: {},
attrMap: {
"class": "className",
"for": "htmlFor"
},
attrHandle: {
href: function(e) {
return e.getAttribute("href")
}
},
relative: {
"+": function(x, r) {
var t = typeof r === "string",
v = t && !/\W/.test(r),
y = t && !v;
if (v) {
r = r.toLowerCase()
}
for (var s = 0, e = x.length, u; s < e; s++) {
if ((u = x[s])) {
while ((u = u.previousSibling) && u.nodeType !== 1) {}
x[s] = y || u && u.nodeName.toLowerCase() === r ? u || false : u === r
}
}
if (y) {
b.filter(r, x, true)
}
},
">": function(x, r) {
var u = typeof r === "string",
v, s = 0,
e = x.length;
if (u && !/\W/.test(r)) {
r = r.toLowerCase();
for (; s < e; s++) {
v = x[s];
if (v) {
var t = v.parentNode;
x[s] = t.nodeName.toLowerCase() === r ? t : false
}
}
} else {
for (; s < e; s++) {
v = x[s];
if (v) {
x[s] = u ? v.parentNode : v.parentNode === r
}
}
if (u) {
b.filter(r, x, true)
}
}
},
"": function(t, r, v) {
var s = j++,
e = q,
u;
if (typeof r === "string" && !/\W/.test(r)) {
r = r.toLowerCase();
u = r;
e = n
}
e("parentNode", r, s, t, u, v)
},
"~": function(t, r, v) {
var s = j++,
e = q,
u;
if (typeof r === "string" && !/\W/.test(r)) {
r = r.toLowerCase();
u = r;
e = n
}
e("previousSibling", r, s, t, u, v)
}
},
find: {
ID: function(r, s, t) {
if (typeof s.getElementById !== "undefined" && !t) {
var e = s.getElementById(r[1]);
return e ? [e] : []
}
},
NAME: function(s, v) {
if (typeof v.getElementsByName !== "undefined") {
var r = [],
u = v.getElementsByName(s[1]);
for (var t = 0, e = u.length; t < e; t++) {
if (u[t].getAttribute("name") === s[1]) {
r.push(u[t])
}
}
return r.length === 0 ? null : r
}
},
TAG: function(e, r) {
return r.getElementsByTagName(e[1])
}
},
preFilter: {
CLASS: function(t, r, s, e, x, y) {
t = " " + t[1].replace(/\\/g, "") + " ";
if (y) {
return t
}
for (var u = 0, v;
(v = r[u]) != null; u++) {
if (v) {
if (x ^ (v.className && (" " + v.className + " ").replace(/[\t\n]/g, " ").indexOf(t) >= 0)) {
if (!s) {
e.push(v)
}
} else {
if (s) {
r[u] = false
}
}
}
}
return false
},
ID: function(e) {
return e[1].replace(/\\/g, "")
},
TAG: function(r, e) {
return r[1].toLowerCase()
},
CHILD: function(e) {
if (e[1] === "nth") {
var r = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2] === "even" && "2n" || e[2] === "odd" && "2n+1" || !/\D/.test(e[2]) && "0n+" + e[2] || e[2]);
e[2] = (r[1] + (r[2] || 1)) - 0;
e[3] = r[3] - 0
}
e[0] = j++;
return e
},
ATTR: function(u, r, s, e, v, x) {
var t = u[1].replace(/\\/g, "");
if (!x && f.attrMap[t]) {
u[1] = f.attrMap[t]
}
if (u[2] === "~=") {
u[4] = " " + u[4] + " "
}
return u
},
PSEUDO: function(u, r, s, e, v) {
if (u[1] === "not") {
if ((p.exec(u[3]) || "").length > 1 || /^\w/.test(u[3])) {
u[3] = b(u[3], null, null, r)
} else {
var t = b.filter(u[3], r, s, true ^ v);
if (!s) {
e.push.apply(e, t)
}
return false
}
} else {
if (f.match.POS.test(u[0]) || f.match.CHILD.test(u[0])) {
return true
}
}
return u
},
POS: function(e) {
e.unshift(true);
return e
}
},
filters: {
enabled: function(e) {
return e.disabled === false && e.type !== "hidden"
},
disabled: function(e) {
return e.disabled === true
},
checked: function(e) {
return e.checked === true
},
selected: function(e) {
e.parentNode.selectedIndex;
return e.selected === true
},
parent: function(e) {
return !!e.firstChild
},
empty: function(e) {
return !e.firstChild
},
has: function(s, r, e) {
return !!b(e[3], s).length
},
header: function(e) {
return (/h\d/i).test(e.nodeName)
},
text: function(e) {
return "text" === e.type
},
radio: function(e) {
return "radio" === e.type
},
checkbox: function(e) {
return "checkbox" === e.type
},
file: function(e) {
return "file" === e.type
},
password: function(e) {
return "password" === e.type
},
submit: function(e) {
return "submit" === e.type
},
image: function(e) {
return "image" === e.type
},
reset: function(e) {
return "reset" === e.type
},
button: function(e) {
return "button" === e.type || e.nodeName.toLowerCase() === "button"
},
input: function(e) {
return (/input|select|textarea|button/i).test(e.nodeName)
}
},
setFilters: {
first: function(r, e) {
return e === 0
},
last: function(s, r, e, t) {
return r === t.length - 1
},
even: function(r, e) {
return e % 2 === 0
},
odd: function(r, e) {
return e % 2 === 1
},
lt: function(s, r, e) {
return r < e[3] - 0
},
gt: function(s, r, e) {
return r > e[3] - 0
},
nth: function(s, r, e) {
return e[3] - 0 === r
},
eq: function(s, r, e) {
return e[3] - 0 === r
}
},
filter: {
PSEUDO: function(s, y, x, z) {
var e = y[1],
r = f.filters[e];
if (r) {
return r(s, x, y, z)
} else {
if (e === "contains") {
return (s.textContent || s.innerText || b.getText([s]) || "").indexOf(y[3]) >= 0
} else {
if (e === "not") {
var t = y[3];
for (var v = 0, u = t.length; v < u; v++) {
if (t[v] === s) {
return false
}
}
return true
} else {
b.error("Syntax error, unrecognized expression: " + e)
}
}
}
},
CHILD: function(e, t) {
var x = t[1],
r = e;
switch (x) {
case "only":
case "first":
while ((r = r.previousSibling)) {
if (r.nodeType === 1) {
return false
}
}
if (x === "first") {
return true
}
r = e;
case "last":
while ((r = r.nextSibling)) {
if (r.nodeType === 1) {
return false
}
}
return true;
case "nth":
var s = t[2],
A = t[3];
if (s === 1 && A === 0) {
return true
}
var v = t[0],
z = e.parentNode;
if (z && (z.sizcache !== v || !e.nodeIndex)) {
var u = 0;
for (r = z.firstChild; r; r = r.nextSibling) {
if (r.nodeType === 1) {
r.nodeIndex = ++u
}
}
z.sizcache = v
}
var y = e.nodeIndex - A;
if (s === 0) {
return y === 0
} else {
return (y % s === 0 && y / s >= 0)
}
}
},
ID: function(r, e) {
return r.nodeType === 1 && r.getAttribute("id") === e
},
TAG: function(r, e) {
return (e === "*" && r.nodeType === 1) || r.nodeName.toLowerCase() === e
},
CLASS: function(r, e) {
return (" " + (r.className || r.getAttribute("class")) + " ").indexOf(e) > -1
},
ATTR: function(v, t) {
var s = t[1],
e = f.attrHandle[s] ? f.attrHandle[s](v) : v[s] != null ? v[s] : v.getAttribute(s),
x = e + "",
u = t[2],
r = t[4];
return e == null ? u === "!=" : u === "=" ? x === r : u === "*=" ? x.indexOf(r) >= 0 : u === "~=" ? (" " + x + " ").indexOf(r) >= 0 : !r ? x && e !== false : u === "!=" ? x !== r : u === "^=" ? x.indexOf(r) === 0 : u === "$=" ? x.substr(x.length - r.length) === r : u === "|=" ? x === r || x.substr(0, r.length + 1) === r + "-" : false
},
POS: function(u, r, s, v) {
var e = r[2],
t = f.setFilters[e];
if (t) {
return t(u, s, r, v)
}
}
}
};
var k = f.match.POS,
g = function(r, e) {
return "\\" + (e - 0 + 1)
};
for (var m in f.match) {
f.match[m] = new RegExp(f.match[m].source + (/(?![^\[]*\])(?![^\(]*\))/.source));
f.leftMatch[m] = new RegExp(/(^(?:.|\r|\n)*?)/.source + f.match[m].source.replace(/\\(\d+)/g, g))
}
var a = function(r, e) {
r = Array.prototype.slice.call(r, 0);
if (e) {
e.push.apply(e, r);
return e
}
return r
};
try {
Array.prototype.slice.call(document.documentElement.childNodes, 0)[0].nodeType
} catch (l) {
a = function(u, t) {
var r = t || [],
s = 0;
if (d.call(u) === "[object Array]") {
Array.prototype.push.apply(r, u)
} else {
if (typeof u.length === "number") {
for (var e = u.length; s < e; s++) {
r.push(u[s])
}
} else {
for (; u[s]; s++) {
r.push(u[s])
}
}
}
return r
}
}
var c;
if (document.documentElement.compareDocumentPosition) {
c = function(r, e) {
if (!r.compareDocumentPosition || !e.compareDocumentPosition) {
if (r == e) {
o = true
}
return r.compareDocumentPosition ? -1 : 1
}
var s = r.compareDocumentPosition(e) & 4 ? -1 : r === e ? 0 : 1;
if (s === 0) {
o = true
}
return s
}
} else {
if ("sourceIndex" in document.documentElement) {
c = function(r, e) {
if (!r.sourceIndex || !e.sourceIndex) {
if (r == e) {
o = true
}
return r.sourceIndex ? -1 : 1
}
var s = r.sourceIndex - e.sourceIndex;
if (s === 0) {
o = true
}
return s
}
} else {
if (document.createRange) {
c = function(t, r) {
if (!t.ownerDocument || !r.ownerDocument) {
if (t == r) {
o = true
}
return t.ownerDocument ? -1 : 1
}
var s = t.ownerDocument.createRange(),
e = r.ownerDocument.createRange();
s.setStart(t, 0);
s.setEnd(t, 0);
e.setStart(r, 0);
e.setEnd(r, 0);
var u = s.compareBoundaryPoints(Range.START_TO_END, e);
if (u === 0) {
o = true
}
return u
}
}
}
}
b.getText = function(e) {
var r = "",
t;
for (var s = 0; e[s]; s++) {
t = e[s];
if (t.nodeType === 3 || t.nodeType === 4) {
r += t.nodeValue
} else {
if (t.nodeType !== 8) {
r += b.getText(t.childNodes)
}
}
}
return r
};
(function() {
var r = document.createElement("div"),
s = "script" + (new Date()).getTime();
r.innerHTML = "";
var e = document.documentElement;
e.insertBefore(r, e.firstChild);
if (document.getElementById(s)) {
f.find.ID = function(u, v, x) {
if (typeof v.getElementById !== "undefined" && !x) {
var t = v.getElementById(u[1]);
return t ? t.id === u[1] || typeof t.getAttributeNode !== "undefined" && t.getAttributeNode("id").nodeValue === u[1] ? [t] : undefined : []
}
};
f.filter.ID = function(v, t) {
var u = typeof v.getAttributeNode !== "undefined" && v.getAttributeNode("id");
return v.nodeType === 1 && u && u.nodeValue === t
}
}
e.removeChild(r);
e = r = null
})();
(function() {
var e = document.createElement("div");
e.appendChild(document.createComment(""));
if (e.getElementsByTagName("*").length > 0) {
f.find.TAG = function(r, v) {
var u = v.getElementsByTagName(r[1]);
if (r[1] === "*") {
var t = [];
for (var s = 0; u[s]; s++) {
if (u[s].nodeType === 1) {
t.push(u[s])
}
}
u = t
}
return u
}
}
e.innerHTML = "";
if (e.firstChild && typeof e.firstChild.getAttribute !== "undefined" && e.firstChild.getAttribute("href") !== "#") {
f.attrHandle.href = function(r) {
return r.getAttribute("href", 2)
}
}
e = null
})();
if (document.querySelectorAll) {
(function() {
var e = b,
s = document.createElement("div");
s.innerHTML = "
" + c.createHTML("span", { id: f.id + "_voiceDesc", "class": "voiceLabel", style: "display:none;" }, f.settings.title); i += c.createHTML("a", { id: f.id + "_text", tabindex: -1, href: "javascript:;", "class": "mceText", onclick: "return false;", onmousedown: "return false;" }, c.encode(f.settings.title)) + " | "; i += "" + c.createHTML("a", { id: f.id + "_open", tabindex: -1, href: "javascript:;", "class": "mceOpen", onclick: "return false;", onmousedown: "return false;" }, '') + " | "; i += "
' + t.content + "" } }) } if (x.verify_css_classes) { r.serializer.attribValueFilter = function(C, A) { var B, t; if (C == "class") { if (!r.classesRE) { t = r.dom.getClasses(); if (t.length > 0) { B = ""; i(t, function(s) { B += (B ? "|" : "") + s["class"] }); r.classesRE = new RegExp("(" + B + ")", "gi") } } return !r.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(A) || r.classesRE.test(A) ? A : "" } return A } } if (x.cleanup_callback) { r.onBeforeSetContent.add(function(s, t) { t.content = r.execCallback("cleanup_callback", "insert_to_editor", t.content, t) }); r.onPreProcess.add(function(s, t) { if (t.set) { r.execCallback("cleanup_callback", "insert_to_editor_dom", t.node, t) } if (t.get) { r.execCallback("cleanup_callback", "get_from_editor_dom", t.node, t) } }); r.onPostProcess.add(function(s, t) { if (t.set) { t.content = r.execCallback("cleanup_callback", "insert_to_editor", t.content, t) } if (t.get) { t.content = r.execCallback("cleanup_callback", "get_from_editor", t.content, t) } }) } if (x.save_callback) { r.onGetContent.add(function(s, t) { if (t.save) { t.content = r.execCallback("save_callback", r.id, t.content, r.getBody()) } }) } if (x.handle_event_callback) { r.onEvent.add(function(s, t, A) { if (r.execCallback("handle_event_callback", t, s, A) === false) { j.cancel(t) } }) } r.onSetContent.add(function() { r.addVisual(r.getBody()) }); if (x.padd_empty_editor) { r.onPostProcess.add(function(s, t) { t.content = t.content.replace(/^(
]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
[\r\n]*)$/, "")
})
}
if (a) {
function u(s, t) {
i(s.dom.select("a"), function(B) {
var A = B.parentNode;
if (s.dom.isBlock(A) && A.lastChild === B) {
s.dom.add(A, "br", {
"data-mce-bogus": 1
})
}
})
}
r.onExecCommand.add(function(s, t) {
if (t === "CreateLink") {
u(s)
}
});
r.onSetContent.add(r.selection.onSetContent.add(u));
if (!x.readonly) {
try {
z.designMode = "Off";
z.designMode = "On"
} catch (q) {}
}
}
setTimeout(function() {
if (r.removed) {
return
}
r.load({
initial: true,
format: "html"
});
r.startContent = r.getContent({
format: "raw"
});
r.undoManager.add();
r.initialized = true;
r.onInit.dispatch(r);
r.execCallback("setupcontent_callback", r.id, r.getBody(), r.getDoc());
r.execCallback("init_instance_callback", r);
r.focus(true);
r.nodeChanged({
initial: 1
});
i(r.contentCSS, function(s) {
r.dom.loadCSS(s)
});
if (x.auto_focus) {
setTimeout(function() {
var s = m.get(x.auto_focus);
s.selection.select(s.getBody(), 1);
s.selection.collapse(1);
s.getWin().focus()
}, 100)
}
}, 1);
y = null
},
focus: function(s) {
var x, q = this,
v = q.settings.content_editable,
r, p, u = q.getDoc();
if (!s) {
r = q.selection.getRng();
if (r.item) {
p = r.item(0)
}
if (!v) {
q.getWin().focus()
}
if (p && p.ownerDocument == u) {
r = u.body.createControlRange();
r.addElement(p);
r.select()
}
}
if (m.activeEditor != q) {
if ((x = m.activeEditor) != null) {
x.onDeactivate.dispatch(x, q)
}
q.onActivate.dispatch(q, x)
}
m._setActive(q)
},
execCallback: function(u) {
var p = this,
r = p.settings[u], q;
if (!r) {
return
}
if (p.callbackLookup && (q = p.callbackLookup[u])) {
r = q.func;
console.log(r);
q = q.scope
}
if (d(r, "string")) {
q = r.replace(/\.\w+$/, "");
q = q ? m.resolve(q) : 0;
r = m.resolve(r);
p.callbackLookup = p.callbackLookup || {};
p.callbackLookup[u] = {
func: r,
scope: q
}
}
return r.apply(q || p, Array.prototype.slice.call(arguments, 1))
},
translate: function(p) {
var r = this.settings.language || "en",
q = m.i18n;
if (!p) {
return ""
}
return q[r + "." + p] || p.replace(/{\#([^}]+)\}/g, function(t, s) {
return q[r + "." + s] || "{#" + s + "}"
})
},
getLang: function(q, p) {
return m.i18n[(this.settings.language || "en") + "." + q] || (d(p) ? p : "{#" + q + "}")
},
getParam: function(u, r, p) {
var s = m.trim,
q = d(this.settings[u]) ? this.settings[u] : r,
t;
if (p === "hash") {
t = {};
if (d(q, "string")) {
i(q.indexOf("=") > 0 ? q.split(/[;,](?![^=;,]*(?:[;,]|$))/) : q.split(","), function(x) {
x = x.split("=");
if (x.length > 1) {
t[s(x[0])] = s(x[1])
} else {
t[s(x[0])] = s(x)
}
})
} else {
t = q
}
return t
}
return q
},
nodeChanged: function(r) {
var p = this,
q = p.selection,
u = q.getStart() || p.getBody();
if (p.initialized) {
r = r || {};
u = b && u.ownerDocument != p.getDoc() ? p.getBody() : u;
r.parents = [];
p.dom.getParent(u, function(s) {
if (s.nodeName == "BODY") {
return true
}
r.parents.push(s)
});
p.onNodeChange.dispatch(p, r ? r.controlManager || p.controlManager : p.controlManager, u, q.isCollapsed(), r)
}
},
addButton: function(r, q) {
var p = this;
p.buttons = p.buttons || {};
p.buttons[r] = q
},
addCommand: function(p, r, q) {
this.execCommands[p] = {
func: r,
scope: q || this
}
},
addQueryStateHandler: function(p, r, q) {
this.queryStateCommands[p] = {
func: r,
scope: q || this
}
},
addQueryValueHandler: function(p, r, q) {
this.queryValueCommands[p] = {
func: r,
scope: q || this
}
},
addShortcut: function(r, u, p, s) {
var q = this,
v;
if (!q.settings.custom_shortcuts) {
return false
}
q.shortcuts = q.shortcuts || {};
if (d(p, "string")) {
v = p;
p = function() {
q.execCommand(v, false, null)
}
}
if (d(p, "object")) {
v = p;
p = function() {
q.execCommand(v[0], v[1], v[2])
}
}
i(g(r), function(t) {
var x = {
func: p,
scope: s || this,
desc: u,
alt: false,
ctrl: false,
shift: false
};
i(g(t, "+"), function(y) {
switch (y) {
case "alt":
case "ctrl":
case "shift":
x[y] = true;
break;
default:
x.charCode = y.charCodeAt(0);
x.keyCode = y.toUpperCase().charCodeAt(0)
}
});
q.shortcuts[(x.ctrl ? "ctrl" : "") + "," + (x.alt ? "alt" : "") + "," + (x.shift ? "shift" : "") + "," + x.keyCode] = x
});
return true
},
execCommand: function(x, v, z, p) {
var r = this,
u = 0,
y, q;
if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x) && (!p || !p.skip_focus)) {
r.focus()
}
y = {};
r.onBeforeExecCommand.dispatch(r, x, v, z, y);
if (y.terminate) {
return false
}
if (r.execCallback("execcommand_callback", r.id, r.selection.getNode(), x, v, z)) {
r.onExecCommand.dispatch(r, x, v, z, p);
return true
}
if (y = r.execCommands[x]) {
q = y.func.call(y.scope, v, z);
if (q !== true) {
r.onExecCommand.dispatch(r, x, v, z, p);
return q
}
}
i(r.plugins, function(s) {
if (s.execCommand && s.execCommand(x, v, z)) {
r.onExecCommand.dispatch(r, x, v, z, p);
u = 1;
return false
}
});
if (u) {
return true
}
if (r.theme && r.theme.execCommand && r.theme.execCommand(x, v, z)) {
r.onExecCommand.dispatch(r, x, v, z, p);
return true
}
if (r.editorCommands.execCommand(x, v, z)) {
r.onExecCommand.dispatch(r, x, v, z, p);
return true
}
r.getDoc().execCommand(x, v, z);
r.onExecCommand.dispatch(r, x, v, z, p)
},
queryCommandState: function(u) {
var q = this,
v, r;
if (q._isHidden()) {
return
}
if (v = q.queryStateCommands[u]) {
r = v.func.call(v.scope);
if (r !== true) {
return r
}
}
v = q.editorCommands.queryCommandState(u);
if (v !== -1) {
return v
}
try {
return this.getDoc().queryCommandState(u)
} catch (p) {}
},
queryCommandValue: function(v) {
var q = this,
u, r;
if (q._isHidden()) {
return
}
if (u = q.queryValueCommands[v]) {
r = u.func.call(u.scope);
if (r !== true) {
return r
}
}
u = q.editorCommands.queryCommandValue(v);
if (d(u)) {
return u
}
try {
return this.getDoc().queryCommandValue(v)
} catch (p) {}
},
show: function() {
var p = this;
n.show(p.getContainer());
n.hide(p.id);
p.load()
},
hide: function() {
var p = this,
q = p.getDoc();
if (b && q) {
q.execCommand("SelectAll")
}
p.save();
n.hide(p.getContainer());
n.setStyle(p.id, "display", p.orgDisplay)
},
isHidden: function() {
return !n.isHidden(this.id)
},
setProgressState: function(p, q, r) {
this.onSetProgressState.dispatch(this, p, q, r);
return p
},
load: function(s) {
var p = this,
r = p.getElement(),
q;
if (r) {
s = s || {};
s.load = true;
q = p.setContent(d(r.value) ? r.value : r.innerHTML, s);
s.element = r;
if (!s.no_events) {
p.onLoadContent.dispatch(p, s)
}
s.element = r = null;
return q
}
},
save: function(u) {
var p = this,
s = p.getElement(),
q, r;
if (!s || !p.initialized) {
return
}
u = u || {};
u.save = true;
if (!u.no_events) {
p.undoManager.typing = false;
p.undoManager.add()
}
u.element = s;
q = u.content = p.getContent(u);
if (!u.no_events) {
p.onSaveContent.dispatch(p, u)
}
q = u.content;
if (!/TEXTAREA|INPUT/i.test(s.nodeName)) {
s.innerHTML = q;
if (r = n.getParent(p.id, "form")) {
i(r.elements, function(t) {
if (t.name == p.id) {
t.value = q;
return false
}
})
}
} else {
s.value = q
}
u.element = s = null;
return q
},
setContent: function(t, s) {
var r = this,
q, p = r.getBody();
s = s || {};
s.format = s.format || "html";
s.set = true;
s.content = t;
if (!s.no_events) {
r.onBeforeSetContent.dispatch(r, s)
}
t = s.content;
if (!m.isIE && (t.length === 0 || /^\s+$/.test(t))) {
p.innerHTML = '
';
return
}
if (s.format !== "raw") {
t = new m.html.Serializer({}, r.schema).serialize(r.parser.parse(t))
}
s.content = m.trim(t);
r.dom.setHTML(p, s.content);
if (!s.no_events) {
r.onSetContent.dispatch(r, s)
}
return s.content
},
getContent: function(q) {
var p = this,
r;
q = q || {};
q.format = q.format || "html";
q.get = true;
if (!q.no_events) {
p.onBeforeGetContent.dispatch(p, q)
}
if (q.format == "raw") {
r = p.getBody().innerHTML
} else {
r = p.serializer.serialize(p.getBody(), q)
}
q.content = m.trim(r);
if (!q.no_events) {
p.onGetContent.dispatch(p, q)
}
return q.content
},
isDirty: function() {
var p = this;
return m.trim(p.startContent) != m.trim(p.getContent({
format: "raw",
no_events: 1
})) && !p.isNotDirty
},
getContainer: function() {
var p = this;
if (!p.container) {
p.container = n.get(p.editorContainer || p.id + "_parent")
}
return p.container
},
getContentAreaContainer: function() {
return this.contentAreaContainer
},
getElement: function() {
return n.get(this.settings.content_element || this.id)
},
getWin: function() {
var p = this,
q;
if (!p.contentWindow) {
q = n.get(p.id + "_ifr");
if (q) {
p.contentWindow = q.contentWindow
}
}
return p.contentWindow
},
getDoc: function() {
var q = this,
p;
if (!q.contentDocument) {
p = q.getWin();
if (p) {
q.contentDocument = p.document
}
}
return q.contentDocument
},
getBody: function() {
return this.bodyElement || this.getDoc().body
},
convertURL: function(p, x, v) {
var q = this,
r = q.settings;
if (r.urlconverter_callback) {
return q.execCallback("urlconverter_callback", p, v, true, x)
}
if (!r.convert_urls || (v && v.nodeName == "LINK") || p.indexOf("file:") === 0) {
return p
}
if (r.relative_urls) {
return q.documentBaseURI.toRelative(p)
}
p = q.documentBaseURI.toAbsolute(p, r.remove_script_host);
return p
},
addVisual: function(r) {
var p = this,
q = p.settings;
r = r || p.getBody();
if (!d(p.hasVisual)) {
p.hasVisual = q.visual
}
i(p.dom.select("table,a", r), function(t) {
var s;
switch (t.nodeName) {
case "TABLE":
s = p.dom.getAttrib(t, "border");
if (!s || s == "0") {
if (p.hasVisual) {
p.dom.addClass(t, q.visual_table_class)
} else {
p.dom.removeClass(t, q.visual_table_class)
}
}
return;
case "A":
s = p.dom.getAttrib(t, "name");
if (s) {
if (p.hasVisual) {
p.dom.addClass(t, "mceItemAnchor")
} else {
p.dom.removeClass(t, "mceItemAnchor")
}
}
return
}
});
p.onVisualAid.dispatch(p, r, p.hasVisual)
},
remove: function() {
var p = this,
q = p.getContainer();
p.removed = 1;
p.hide();
p.execCallback("remove_instance_callback", p);
p.onRemove.dispatch(p);
p.onExecCommand.listeners = [];
m.remove(p);
n.remove(q)
},
destroy: function(q) {
var p = this;
if (p.destroyed) {
return
}
if (!q) {
m.removeUnload(p.destroy);
tinyMCE.onBeforeUnload.remove(p._beforeUnload);
if (p.theme && p.theme.destroy) {
p.theme.destroy()
}
p.controlManager.destroy();
p.selection.destroy();
p.dom.destroy();
if (!p.settings.content_editable) {
j.clear(p.getWin());
j.clear(p.getDoc())
}
j.clear(p.getBody());
j.clear(p.formElement)
}
if (p.formElement) {
p.formElement.submit = p.formElement._mceOldSubmit;
p.formElement._mceOldSubmit = null
}
p.contentAreaContainer = p.formElement = p.container = p.settings.content_element = p.bodyElement = p.contentDocument = p.contentWindow = null;
if (p.selection) {
p.selection = p.selection.win = p.selection.dom = p.selection.dom.doc = null
}
p.destroyed = 1
},
_addEvents: function() {
var B = this,
r, C = B.settings,
q = B.dom,
x = {
mouseup: "onMouseUp",
mousedown: "onMouseDown",
click: "onClick",
keyup: "onKeyUp",
keydown: "onKeyDown",
keypress: "onKeyPress",
submit: "onSubmit",
reset: "onReset",
contextmenu: "onContextMenu",
dblclick: "onDblClick",
paste: "onPaste"
};
function p(t, D) {
var s = t.type;
if (B.removed) {
return
}
if (B.onEvent.dispatch(B, t, D) !== false) {
B[x[t.fakeType || t.type]].dispatch(B, t, D)
}
}
i(x, function(t, s) {
switch (s) {
case "contextmenu":
q.bind(B.getDoc(), s, p);
break;
case "paste":
q.bind(B.getBody(), s, function(D) {
p(D)
});
break;
case "submit":
case "reset":
q.bind(B.getElement().form || n.getParent(B.id, "form"), s, p);
break;
default:
q.bind(C.content_editable ? B.getBody() : B.getDoc(), s, p)
}
});
q.bind(C.content_editable ? B.getBody() : (a ? B.getDoc() : B.getWin()), "focus", function(s) {
B.focus(true)
});
if (m.isGecko) {
q.bind(B.getDoc(), "DOMNodeInserted", function(t) {
var s;
t = t.target;
if (t.nodeType === 1 && t.nodeName === "IMG" && (s = t.getAttribute("data-mce-src"))) {
t.src = B.documentBaseURI.toAbsolute(s)
}
})
}
if (a) {
function u() {
var E = this,
G = E.getDoc(),
F = E.settings;
if (a && !F.readonly) {
if (E._isHidden()) {
try {
if (!F.content_editable) {
G.designMode = "On"
}
} catch (D) {}
}
try {
G.execCommand("styleWithCSS", 0, false)
} catch (D) {
if (!E._isHidden()) {
try {
G.execCommand("useCSS", 0, true)
} catch (D) {}
}
}
if (!F.table_inline_editing) {
try {
G.execCommand("enableInlineTableEditing", false, false)
} catch (D) {}
}
if (!F.object_resizing) {
try {
G.execCommand("enableObjectResizing", false, false)
} catch (D) {}
}
}
}
B.onBeforeExecCommand.add(u);
B.onMouseDown.add(u)
}
if (m.isWebKit) {
B.onClick.add(function(s, t) {
t = t.target;
if (t.nodeName == "IMG" || (t.nodeName == "A" && q.hasClass(t, "mceItemAnchor"))) {
B.selection.getSel().setBaseAndExtent(t, 0, t, 1);
B.nodeChanged()
}
})
}
B.onMouseUp.add(B.nodeChanged);
B.onKeyUp.add(function(s, t) {
var D = t.keyCode;
if ((D >= 33 && D <= 36) || (D >= 37 && D <= 40) || D == 13 || D == 45 || D == 46 || D == 8 || (m.isMac && (D == 91 || D == 93)) || t.ctrlKey) {
B.nodeChanged()
}
});
B.onReset.add(function() {
B.setContent(B.startContent, {
format: "raw"
})
});
if (C.custom_shortcuts) {
if (C.custom_undo_redo_keyboard_shortcuts) {
B.addShortcut("ctrl+z", B.getLang("undo_desc"), "Undo");
B.addShortcut("ctrl+y", B.getLang("redo_desc"), "Redo")
}
B.addShortcut("ctrl+b", B.getLang("bold_desc"), "Bold");
B.addShortcut("ctrl+i", B.getLang("italic_desc"), "Italic");
B.addShortcut("ctrl+u", B.getLang("underline_desc"), "Underline");
for (r = 1; r <= 6; r++) {
B.addShortcut("ctrl+" + r, "", ["FormatBlock", false, "h" + r])
}
B.addShortcut("ctrl+7", "", ["FormatBlock", false, "
"]); B.addShortcut("ctrl+8", "", ["FormatBlock", false, "