Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
(function() {
if (window.CKEDITOR && window.CKEDITOR.dom) return;
if (!window.CKEDITOR) window.CKEDITOR = (function() {
var a = {
timestamp: 'B49E5BQ',
version: '3.6',
revision: '6902',
_: {},
status: 'unloaded',
basePath: (function() {
var d = window.CKEDITOR_BASEPATH || '';
if (!d) {
var e = document.getElementsByTagName('script');
for (var f = 0; f < e.length; f++) {
var g = e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);
if (g) {
d = g[1];
break;
}
}
}
if (d.indexOf(':/') == -1)
if (d.indexOf('/') === 0) d = location.href.match(/^.*?:\/\/[^\/]*/)[0] + d;
else d = location.href.match(/^[^\?]*\/(?:)/)[0] + d;
if (!d) throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';
return d;
})(),
getUrl: function(d) {
if (d.indexOf(':/') == -1 && d.indexOf('/') !== 0) d = this.basePath + d;
if (this.timestamp && d.charAt(d.length - 1) != '/' && !/[&?]t=/.test(d)) d += (d.indexOf('?') >= 0 ? '&' : '?') + 't=' + this.timestamp;
return d;
}
},
b = window.CKEDITOR_GETURL;
if (b) {
var c = a.getUrl;
a.getUrl = function(d) {
return b.call(a, d) || c.call(a, d);
};
}
return a;
})();
var a = CKEDITOR;
if (!a.event) {
a.event = function() {};
a.event.implementOn = function(b) {
var c = a.event.prototype;
for (var d in c) {
if (b[d] == undefined) b[d] = c[d];
}
};
a.event.prototype = (function() {
var b = function(d) {
var e = d.getPrivate && d.getPrivate() || d._ || (d._ = {});
return e.events || (e.events = {});
},
c = function(d) {
this.name = d;
this.listeners = [];
};
c.prototype = {
getListenerIndex: function(d) {
for (var e = 0, f = this.listeners; e < f.length; e++) {
if (f[e].fn == d) return e;
}
return -1;
}
};
return {
on: function(d, e, f, g, h) {
var i = b(this),
j = i[d] || (i[d] = new c(d));
if (j.getListenerIndex(e) < 0) {
var k = j.listeners;
if (!f) f = this;
if (isNaN(h)) h = 10;
var l = this,
m = function(o, p, q, r) {
var s = {
name: d,
sender: this,
editor: o,
data: p,
listenerData: g,
stop: q,
cancel: r,
removeListener: function() {
l.removeListener(d, e);
}
};
e.call(f, s);
return s.data;
};
m.fn = e;
m.priority = h;
for (var n = k.length - 1; n >= 0; n--) {
if (k[n].priority <= h) {
k.splice(n + 1, 0, m);
return;
}
}
k.unshift(m);
}
},
fire: (function() {
var d = false,
e = function() {
d = true;
},
f = false,
g = function() {
f = true;
};
return function(h, i, j) {
var k = b(this)[h],
l = d,
m = f;
d = f = false;
if (k) {
var n = k.listeners;
if (n.length) {
n = n.slice(0);
for (var o = 0; o < n.length; o++) {
var p = n[o].call(this, j, i, e, g);
if (typeof p != 'undefined') i = p;
if (d || f) break;
}
}
}
var q = f || (typeof i == 'undefined' ? false : i);
d = l;
f = m;
return q;
};
})(),
fireOnce: function(d, e, f) {
var g = this.fire(d, e, f);
delete b(this)[d];
return g;
},
removeListener: function(d, e) {
var f = b(this)[d];
if (f) {
var g = f.getListenerIndex(e);
if (g >= 0) f.listeners.splice(g, 1);
}
},
hasListeners: function(d) {
var e = b(this)[d];
return e && e.listeners.length > 0;
}
};
})();
}
if (!a.editor) {
a.ELEMENT_MODE_NONE = 0;
a.ELEMENT_MODE_REPLACE = 1;
a.ELEMENT_MODE_APPENDTO = 2;
a.editor = function(b, c, d, e) {
var f = this;
f._ = {
instanceConfig: b,
element: c,
data: e
};
f.elementMode = d || 0;
a.event.call(f);
f._init();
};
a.editor.replace = function(b, c) {
var d = b;
if (typeof d != 'object') {
d = document.getElementById(b);
if (d && d.tagName.toLowerCase() in {
style: 1,
script: 1,
base: 1,
link: 1,
meta: 1,
title: 1
}) d = null;
if (!d) {
var e = 0,
f = document.getElementsByName(b);
while ((d = f[e++]) && d.tagName.toLowerCase() != 'textarea') {}
}
if (!d) throw '[CKEDITOR.editor.replace] The element with id or name "' + b + '" was not found.';
}
d.style.visibility = 'hidden';
return new a.editor(c, d, 1);
};
a.editor.appendTo = function(b, c, d) {
var e = b;
if (typeof e != 'object') {
e = document.getElementById(b);
if (!e) throw '[CKEDITOR.editor.appendTo] The element with id "' + b + '" was not found.';
}
return new a.editor(c, e, 2, d);
};
a.editor.prototype = {
_init: function() {
var b = a.editor._pending || (a.editor._pending = []);
b.push(this);
},
fire: function(b, c) {
return a.event.prototype.fire.call(this, b, c, this);
},
fireOnce: function(b, c) {
return a.event.prototype.fireOnce.call(this, b, c, this);
}
};
a.event.implementOn(a.editor.prototype, true);
}
if (!a.env) a.env = (function() {
var b = navigator.userAgent.toLowerCase(),
c = window.opera,
d = {
ie: /* @cc_on!@ */ false,
opera: !!c && c.version,
webkit: b.indexOf(' applewebkit/') > -1,
air: b.indexOf(' adobeair/') > -1,
mac: b.indexOf('macintosh') > -1,
quirks: document.compatMode == 'BackCompat',
mobile: b.indexOf('mobile') > -1,
isCustomDomain: function() {
if (!this.ie) return false;
var g = document.domain,
h = window.location.hostname;
return g != h && g != '[' + h + ']';
}
};
d.gecko = navigator.product == 'Gecko' && !d.webkit && !d.opera;
var e = 0;
if (d.ie) {
e = parseFloat(b.match(/msie (\d+)/)[1]);
d.ie8 = !!document.documentMode;
d.ie8Compat = document.documentMode == 8;
d.ie9Compat = document.documentMode == 9;
d.ie7Compat = e == 7 && !document.documentMode || document.documentMode == 7;
d.ie6Compat = e < 7 || d.quirks;
}
if (d.gecko) {
var f = b.match(/rv:([\d\.]+)/);
if (f) {
f = f[1].split('.');
e = f[0] * 10000 + (f[1] || 0) * 100 + +(f[2] || 0);
}
}
if (d.opera) e = parseFloat(c.version());
if (d.air) e = parseFloat(b.match(/ adobeair\/(\d+)/)[1]);
if (d.webkit) e = parseFloat(b.match(/ applewebkit\/(\d+)/)[1]);
d.version = e;
d.isCompatible = !d.mobile && (d.ie && e >= 6 || d.gecko && e >= 10801 || d.opera && e >= 9.5 || d.air && e >= 1 || d.webkit && e >= 522 || false);
d.cssClass = 'cke_browser_' + (d.ie ? 'ie' : d.gecko ? 'gecko' : d.opera ? 'opera' : d.webkit ? 'webkit' : 'unknown');
if (d.quirks) d.cssClass += ' cke_browser_quirks';
if (d.ie) {
d.cssClass += ' cke_browser_ie' + (d.version < 7 ? '6' : d.version >= 8 ? document.documentMode : '7');
if (d.quirks) d.cssClass += ' cke_browser_iequirks';
}
if (d.gecko && e < 10900) d.cssClass += ' cke_browser_gecko18';
if (d.air) d.cssClass += ' cke_browser_air';
return d;
})();
var b = a.env;
var c = b.ie;
if (a.status == 'unloaded')(function() {
a.event.implementOn(a);
a.loadFullCore = function() {
if (a.status != 'basic_ready') {
a.loadFullCore._load = 1;
return;
}
delete a.loadFullCore;
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = a.basePath + 'ckeditor.js';
document.getElementsByTagName('head')[0].appendChild(e);
};
a.loadFullCoreTimeout = 0;
a.replaceClass = 'ckeditor';
a.replaceByClassEnabled = 1;
var d = function(e, f, g, h) {
if (b.isCompatible) {
if (a.loadFullCore) a.loadFullCore();
var i = g(e, f, h);
a.add(i);
return i;
}
return null;
};
a.replace = function(e, f) {
return d(e, f, a.editor.replace);
};
a.appendTo = function(e, f, g) {
return d(e, f, a.editor.appendTo, g);
};
a.add = function(e) {
var f = this._.pending || (this._.pending = []);
f.push(e);
};
a.replaceAll = function() {
var e = document.getElementsByTagName('textarea');
for (var f = 0; f < e.length; f++) {
var g = null,
h = e[f];
if (!h.name && !h.id) continue;
if (typeof arguments[0] == 'string') {
var i = new RegExp('(?:^|\\s)' + arguments[0] + '(?:$|\\s)');
if (!i.test(h.className)) continue;
} else if (typeof arguments[0] == 'function') {
g = {};
if (arguments[0](h, g) === false) continue;
}
this.replace(h, g);
}
};
(function() {
var e = function() {
var f = a.loadFullCore,
g = a.loadFullCoreTimeout;
if (a.replaceByClassEnabled) a.replaceAll(a.replaceClass);
a.status = 'basic_ready';
if (f && f._load) f();
else if (g) setTimeout(function() {
if (a.loadFullCore) a.loadFullCore();
}, g * 1000);
};
if (window.addEventListener) window.addEventListener('load', e, false);
else if (window.attachEvent) window.attachEvent('onload', e);
})();
a.status = 'basic_loaded';
})();
a.dom = {};
var d = a.dom;
(function() {
var e = [];
a.on('reset', function() {
e = [];
});
a.tools = {
arrayCompare: function(f, g) {
if (!f && !g) return true;
if (!f || !g || f.length != g.length) return false;
for (var h = 0; h < f.length; h++) {
if (f[h] != g[h]) return false;
}
return true;
},
clone: function(f) {
var g;
if (f && f instanceof Array) {
g = [];
for (var h = 0; h < f.length; h++) g[h] = this.clone(f[h]);
return g;
}
if (f === null || typeof f != 'object' || f instanceof String || f instanceof Number || f instanceof Boolean || f instanceof Date || f instanceof RegExp) return f;
g = new f.constructor();
for (var i in f) {
var j = f[i];
g[i] = this.clone(j);
}
return g;
},
capitalize: function(f) {
return f.charAt(0).toUpperCase() + f.substring(1).toLowerCase();
},
extend: function(f) {
var g = arguments.length,
h, i;
if (typeof(h = arguments[g - 1]) == 'boolean') g--;
else if (typeof(h = arguments[g - 2]) == 'boolean') {
i = arguments[g - 1];
g -= 2;
}
for (var j = 1; j < g; j++) {
var k = arguments[j];
for (var l in k) {
if (h === true || f[l] == undefined)
if (!i || l in i) f[l] = k[l];
}
}
return f;
},
prototypedCopy: function(f) {
var g = function() {};
g.prototype = f;
return new g();
},
isArray: function(f) {
return !!f && f instanceof Array;
},
isEmpty: function(f) {
for (var g in f) {
if (f.hasOwnProperty(g)) return false;
}
return true;
},
cssStyleToDomStyle: (function() {
var f = document.createElement('div').style,
g = typeof f.cssFloat != 'undefined' ? 'cssFloat' : typeof f.styleFloat != 'undefined' ? 'styleFloat' : 'float';
return function(h) {
if (h == 'float') return g;
else return h.replace(/-./g, function(i) {
return i.substr(1).toUpperCase();
});
};
})(),
buildStyleHtml: function(f) {
f = [].concat(f);
var g, h = [];
for (var i = 0; i < f.length; i++) {
g = f[i];
if (/@import|[{}]/.test(g)) h.push('');
else h.push('');
}
return h.join('');
},
htmlEncode: function(f) {
var g = function(k) {
var l = new d.element('span');
l.setText(k);
return l.getHtml();
},
h = g('\n').toLowerCase() == ' ' ? function(k) {
return g(k).replace(/ /gi, '\n');
} : g,
i = g('>') == '>' ? function(k) {
return h(k).replace(/>/g, '>');
} : h,
j = g(' ') == ' ' ? function(k) {
return i(k).replace(/ /g, ' ');
} : i;
this.htmlEncode = j;
return this.htmlEncode(f);
},
htmlEncodeAttr: function(f) {
return f.replace(/"/g, '"').replace(//g, '>');
},
getNextNumber: (function() {
var f = 0;
return function() {
return ++f;
};
})(),
getNextId: function() {
return 'cke_' + this.getNextNumber();
},
override: function(f, g) {
return g(f);
},
setTimeout: function(f, g, h, i, j) {
if (!j) j = window;
if (!h) h = j;
return j.setTimeout(function() {
if (i) f.apply(h, [].concat(i));
else f.apply(h);
}, g || 0);
},
trim: (function() {
var f = /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;
return function(g) {
return g.replace(f, '');
};
})(),
ltrim: (function() {
var f = /^[ \t\n\r]+/g;
return function(g) {
return g.replace(f, '');
};
})(),
rtrim: (function() {
var f = /[ \t\n\r]+$/g;
return function(g) {
return g.replace(f, '');
};
})(),
indexOf: Array.prototype.indexOf ? function(f, g) {
return f.indexOf(g);
} : function(f, g) {
for (var h = 0, i = f.length; h < i; h++) {
if (f[h] === g) return h;
}
return -1;
},
bind: function(f, g) {
return function() {
return f.apply(g, arguments);
};
},
createClass: function(f) {
var g = f.$,
h = f.base,
i = f.privates || f._,
j = f.proto,
k = f.statics;
if (i) {
var l = g;
g = function() {
var p = this;
var m = p._ || (p._ = {});
for (var n in i) {
var o = i[n];
m[n] = typeof o == 'function' ? a.tools.bind(o, p) : o;
}
l.apply(p, arguments);
};
}
if (h) {
g.prototype = this.prototypedCopy(h.prototype);
g.prototype['constructor'] = g;
g.prototype.base = function() {
this.base = h.prototype.base;
h.apply(this, arguments);
this.base = arguments.callee;
};
}
if (j) this.extend(g.prototype, j, true);
if (k) this.extend(g, k, true);
return g;
},
addFunction: function(f, g) {
return e.push(function() {
return f.apply(g || this, arguments);
}) - 1;
},
removeFunction: function(f) {
e[f] = null;
},
callFunction: function(f) {
var g = e[f];
return g && g.apply(window, Array.prototype.slice.call(arguments, 1));
},
cssLength: (function() {
var f = /^\d+(?:\.\d+)?$/;
return function(g) {
return g + (f.test(g) ? 'px' : '');
};
})(),
repeat: function(f, g) {
return new Array(g + 1).join(f);
},
tryThese: function() {
var f;
for (var g = 0, h = arguments.length; g < h; g++) {
var i = arguments[g];
try {
f = i();
break;
} catch (j) {}
}
return f;
},
genKey: function() {
return Array.prototype.slice.call(arguments).join('-');
}
};
})();
var e = a.tools;
a.dtd = (function() {
var f = e.extend,
g = {
isindex: 1,
fieldset: 1
},
h = {
input: 1,
button: 1,
select: 1,
textarea: 1,
label: 1
},
i = f({
a: 1
}, h),
j = f({
iframe: 1
}, i),
k = {
hr: 1,
ul: 1,
menu: 1,
div: 1,
blockquote: 1,
noscript: 1,
table: 1,
center: 1,
address: 1,
dir: 1,
pre: 1,
h5: 1,
dl: 1,
h4: 1,
noframes: 1,
h6: 1,
ol: 1,
h1: 1,
h3: 1,
h2: 1
},
l = {
ins: 1,
del: 1,
script: 1,
style: 1
},
m = f({
b: 1,
acronym: 1,
bdo: 1,
'var': 1,
'#': 1,
abbr: 1,
code: 1,
br: 1,
i: 1,
cite: 1,
kbd: 1,
u: 1,
strike: 1,
s: 1,
tt: 1,
strong: 1,
q: 1,
samp: 1,
em: 1,
dfn: 1,
span: 1
}, l),
n = f({
sub: 1,
img: 1,
object: 1,
sup: 1,
basefont: 1,
map: 1,
applet: 1,
font: 1,
big: 1,
small: 1
}, m),
o = f({
p: 1
}, n),
p = f({
iframe: 1
}, n, h),
q = {
img: 1,
noscript: 1,
br: 1,
kbd: 1,
center: 1,
button: 1,
basefont: 1,
h5: 1,
h4: 1,
samp: 1,
h6: 1,
ol: 1,
h1: 1,
h3: 1,
h2: 1,
form: 1,
font: 1,
'#': 1,
select: 1,
menu: 1,
ins: 1,
abbr: 1,
label: 1,
code: 1,
table: 1,
script: 1,
cite: 1,
input: 1,
iframe: 1,
strong: 1,
textarea: 1,
noframes: 1,
big: 1,
small: 1,
span: 1,
hr: 1,
sub: 1,
bdo: 1,
'var': 1,
div: 1,
object: 1,
sup: 1,
strike: 1,
dir: 1,
map: 1,
dl: 1,
applet: 1,
del: 1,
isindex: 1,
fieldset: 1,
ul: 1,
b: 1,
acronym: 1,
a: 1,
blockquote: 1,
i: 1,
u: 1,
s: 1,
tt: 1,
address: 1,
q: 1,
pre: 1,
p: 1,
em: 1,
dfn: 1
},
r = f({
a: 1
}, p),
s = {
tr: 1
},
t = {
'#': 1
},
u = f({
param: 1
}, q),
v = f({
form: 1
}, g, j, k, o),
w = {
li: 1
},
x = {
style: 1,
script: 1
},
y = {
base: 1,
link: 1,
meta: 1,
title: 1
},
z = f(y, x),
A = {
head: 1,
body: 1
},
B = {
html: 1
},
C = {
address: 1,
blockquote: 1,
center: 1,
dir: 1,
div: 1,
dl: 1,
fieldset: 1,
form: 1,
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1,
hr: 1,
isindex: 1,
menu: 1,
noframes: 1,
ol: 1,
p: 1,
pre: 1,
table: 1,
ul: 1
};
return {
$nonBodyContent: f(B, A, y),
$block: C,
$blockLimit: {
body: 1,
div: 1,
td: 1,
th: 1,
caption: 1,
form: 1
},
$inline: r,
$body: f({
script: 1,
style: 1
}, C),
$cdata: {
script: 1,
style: 1
},
$empty: {
area: 1,
base: 1,
br: 1,
col: 1,
hr: 1,
img: 1,
input: 1,
link: 1,
meta: 1,
param: 1
},
$listItem: {
dd: 1,
dt: 1,
li: 1
},
$list: {
ul: 1,
ol: 1,
dl: 1
},
$nonEditable: {
applet: 1,
button: 1,
embed: 1,
iframe: 1,
map: 1,
object: 1,
option: 1,
script: 1,
textarea: 1,
param: 1
},
$removeEmpty: {
abbr: 1,
acronym: 1,
address: 1,
b: 1,
bdo: 1,
big: 1,
cite: 1,
code: 1,
del: 1,
dfn: 1,
em: 1,
font: 1,
i: 1,
ins: 1,
label: 1,
kbd: 1,
q: 1,
s: 1,
samp: 1,
small: 1,
span: 1,
strike: 1,
strong: 1,
sub: 1,
sup: 1,
tt: 1,
u: 1,
'var': 1
},
$tabIndex: {
a: 1,
area: 1,
button: 1,
input: 1,
object: 1,
select: 1,
textarea: 1
},
$tableContent: {
caption: 1,
col: 1,
colgroup: 1,
tbody: 1,
td: 1,
tfoot: 1,
th: 1,
thead: 1,
tr: 1
},
html: A,
head: z,
style: t,
script: t,
body: v,
base: {},
link: {},
meta: {},
title: t,
col: {},
tr: {
td: 1,
th: 1
},
img: {},
colgroup: {
col: 1
},
noscript: v,
td: v,
br: {},
th: v,
center: v,
kbd: r,
button: f(o, k),
basefont: {},
h5: r,
h4: r,
samp: r,
h6: r,
ol: w,
h1: r,
h3: r,
option: t,
h2: r,
form: f(g, j, k, o),
select: {
optgroup: 1,
option: 1
},
font: r,
ins: r,
menu: w,
abbr: r,
label: r,
table: {
thead: 1,
col: 1,
tbody: 1,
tr: 1,
colgroup: 1,
caption: 1,
tfoot: 1
},
code: r,
tfoot: s,
cite: r,
li: v,
input: {},
iframe: v,
strong: r,
textarea: t,
noframes: v,
big: r,
small: r,
span: r,
hr: {},
dt: r,
sub: r,
optgroup: {
option: 1
},
param: {},
bdo: r,
'var': r,
div: v,
object: u,
sup: r,
dd: v,
strike: r,
area: {},
dir: w,
map: f({
area: 1,
form: 1,
p: 1
}, g, l, k),
applet: u,
dl: {
dt: 1,
dd: 1
},
del: r,
isindex: {},
fieldset: f({
legend: 1
}, q),
thead: s,
ul: w,
acronym: r,
b: r,
a: p,
blockquote: v,
caption: r,
i: r,
u: r,
tbody: s,
s: r,
address: f(j, o),
tt: r,
legend: r,
q: r,
pre: f(m, i),
p: r,
em: r,
dfn: r
};
})();
var f = a.dtd;
d.event = function(g) {
this.$ = g;
};
d.event.prototype = {
getKey: function() {
return this.$.keyCode || this.$.which;
},
getKeystroke: function() {
var h = this;
var g = h.getKey();
if (h.$.ctrlKey || h.$.metaKey) g += 1000;
if (h.$.shiftKey) g += 2000;
if (h.$.altKey) g += 4000;
return g;
},
preventDefault: function(g) {
var h = this.$;
if (h.preventDefault) h.preventDefault();
else h.returnValue = false;
if (g) this.stopPropagation();
},
stopPropagation: function() {
var g = this.$;
if (g.stopPropagation) g.stopPropagation();
else g.cancelBubble = true;
},
getTarget: function() {
var g = this.$.target || this.$.srcElement;
return g ? new d.node(g) : null;
}
};
a.CTRL = 1000;
a.SHIFT = 2000;
a.ALT = 4000;
d.domObject = function(g) {
if (g) this.$ = g;
};
d.domObject.prototype = (function() {
var g = function(h, i) {
return function(j) {
if (typeof a != 'undefined') h.fire(i, new d.event(j));
};
};
return {
getPrivate: function() {
var h;
if (!(h = this.getCustomData('_'))) this.setCustomData('_', h = {});
return h;
},
on: function(h) {
var k = this;
var i = k.getCustomData('_cke_nativeListeners');
if (!i) {
i = {};
k.setCustomData('_cke_nativeListeners', i);
}
if (!i[h]) {
var j = i[h] = g(k, h);
if (k.$.attachEvent) k.$.attachEvent('on' + h, j);
else if (k.$.addEventListener) k.$.addEventListener(h, j, !!a.event.useCapture);
}
return a.event.prototype.on.apply(k, arguments);
},
removeListener: function(h) {
var k = this;
a.event.prototype.removeListener.apply(k, arguments);
if (!k.hasListeners(h)) {
var i = k.getCustomData('_cke_nativeListeners'),
j = i && i[h];
if (j) {
if (k.$.detachEvent) k.$.detachEvent('on' + h, j);
else if (k.$.removeEventListener) k.$.removeEventListener(h, j, false);
delete i[h];
}
}
},
removeAllListeners: function() {
var k = this;
var h = k.getCustomData('_cke_nativeListeners');
for (var i in h) {
var j = h[i];
if (k.$.detachEvent) k.$.detachEvent('on' + i, j);
else if (k.$.removeEventListener) k.$.removeEventListener(i, j, false);
delete h[i];
}
}
};
})();
(function(g) {
var h = {};
a.on('reset', function() {
h = {};
});
g.equals = function(i) {
return i && i.$ === this.$;
};
g.setCustomData = function(i, j) {
var k = this.getUniqueId(),
l = h[k] || (h[k] = {});
l[i] = j;
return this;
};
g.getCustomData = function(i) {
var j = this.$['data-cke-expando'],
k = j && h[j];
return k && k[i];
};
g.removeCustomData = function(i) {
var j = this.$['data-cke-expando'],
k = j && h[j],
l = k && k[i];
if (typeof l != 'undefined') delete k[i];
return l || null;
};
g.clearCustomData = function() {
this.removeAllListeners();
var i = this.$['data-cke-expando'];
i && delete h[i];
};
g.getUniqueId = function() {
return this.$['data-cke-expando'] || (this.$['data-cke-expando'] = e.getNextNumber());
};
a.event.implementOn(g);
})(d.domObject.prototype);
d.window = function(g) {
d.domObject.call(this, g);
};
d.window.prototype = new d.domObject();
e.extend(d.window.prototype, {
focus: function() {
if (b.webkit && this.$.parent) this.$.parent.focus();
this.$.focus();
},
getViewPaneSize: function() {
var g = this.$.document,
h = g.compatMode == 'CSS1Compat';
return {
width: (h ? g.documentElement.clientWidth : g.body.clientWidth) || 0,
height: (h ? g.documentElement.clientHeight : g.body.clientHeight) || 0
};
},
getScrollPosition: function() {
var g = this.$;
if ('pageXOffset' in g) return {
x: g.pageXOffset || 0,
y: g.pageYOffset || 0
};
else {
var h = g.document;
return {
x: h.documentElement.scrollLeft || h.body.scrollLeft || 0,
y: h.documentElement.scrollTop || h.body.scrollTop || 0
};
}
}
});
d.document = function(g) {
d.domObject.call(this, g);
};
var g = d.document;
g.prototype = new d.domObject();
e.extend(g.prototype, {
appendStyleSheet: function(h) {
if (this.$.createStyleSheet) this.$.createStyleSheet(h);
else {
var i = new d.element('link');
i.setAttributes({
rel: 'stylesheet',
type: 'text/css',
href: h
});
this.getHead().append(i);
}
},
appendStyleText: function(h) {
var k = this;
if (k.$.createStyleSheet) {
var i = k.$.createStyleSheet('');
i.cssText = h;
} else {
var j = new d.element('style', k);
j.append(new d.text(h, k));
k.getHead().append(j);
}
},
createElement: function(h, i) {
var j = new d.element(h, this);
if (i) {
if (i.attributes) j.setAttributes(i.attributes);
if (i.styles) j.setStyles(i.styles);
}
return j;
},
createText: function(h) {
return new d.text(h, this);
},
focus: function() {
this.getWindow().focus();
},
getById: function(h) {
var i = this.$.getElementById(h);
return i ? new d.element(i) : null;
},
getByAddress: function(h, i) {
var j = this.$.documentElement;
for (var k = 0; j && k < h.length; k++) {
var l = h[k];
if (!i) {
j = j.childNodes[l];
continue;
}
var m = -1;
for (var n = 0; n < j.childNodes.length; n++) {
var o = j.childNodes[n];
if (i === true && o.nodeType == 3 && o.previousSibling && o.previousSibling.nodeType == 3) continue;
m++;
if (m == l) {
j = o;
break;
}
}
}
return j ? new d.node(j) : null;
},
getElementsByTag: function(h, i) {
if (!(c && !(document.documentMode > 8)) && i) h = i + ':' + h;
return new d.nodeList(this.$.getElementsByTagName(h));
},
getHead: function() {
var h = this.$.getElementsByTagName('head')[0];
if (!h) h = this.getDocumentElement().append(new d.element('head'), true);
else h = new d.element(h);
return (this.getHead = function() {
return h;
})();
},
getBody: function() {
var h = new d.element(this.$.body);
return (this.getBody = function() {
return h;
})();
},
getDocumentElement: function() {
var h = new d.element(this.$.documentElement);
return (this.getDocumentElement = function() {
return h;
})();
},
getWindow: function() {
var h = new d.window(this.$.parentWindow || this.$.defaultView);
return (this.getWindow = function() {
return h;
})();
},
write: function(h) {
var i = this;
i.$.open('text/html', 'replace');
b.isCustomDomain() && (i.$.domain = document.domain);
i.$.write(h);
i.$.close();
}
});
d.node = function(h) {
if (h) {
switch (h.nodeType) {
case 9:
return new g(h);
case 1:
return new d.element(h);
case 3:
return new d.text(h);
}
d.domObject.call(this, h);
}
return this;
};
d.node.prototype = new d.domObject();
a.NODE_ELEMENT = 1;
a.NODE_DOCUMENT = 9;
a.NODE_TEXT = 3;
a.NODE_COMMENT = 8;
a.NODE_DOCUMENT_FRAGMENT = 11;
a.POSITION_IDENTICAL = 0;
a.POSITION_DISCONNECTED = 1;
a.POSITION_FOLLOWING = 2;
a.POSITION_PRECEDING = 4;
a.POSITION_IS_CONTAINED = 8;
a.POSITION_CONTAINS = 16;
e.extend(d.node.prototype, {
appendTo: function(h, i) {
h.append(this, i);
return h;
},
clone: function(h, i) {
var j = this.$.cloneNode(h),
k = function(l) {
if (l.nodeType != 1) return;
if (!i) l.removeAttribute('id', false);
l.removeAttribute('data-cke-expando', false);
if (h) {
var m = l.childNodes;
for (var n = 0; n < m.length; n++) k(m[n]);
}
};
k(j);
return new d.node(j);
},
hasPrevious: function() {
return !!this.$.previousSibling;
},
hasNext: function() {
return !!this.$.nextSibling;
},
insertAfter: function(h) {
h.$.parentNode.insertBefore(this.$, h.$.nextSibling);
return h;
},
insertBefore: function(h) {
h.$.parentNode.insertBefore(this.$, h.$);
return h;
},
insertBeforeMe: function(h) {
this.$.parentNode.insertBefore(h.$, this.$);
return h;
},
getAddress: function(h) {
var i = [],
j = this.getDocument().$.documentElement,
k = this.$;
while (k && k != j) {
var l = k.parentNode;
if (l) i.unshift(this.getIndex.call({
$: k
}, h));
k = l;
}
return i;
},
getDocument: function() {
return new g(this.$.ownerDocument || this.$.parentNode.ownerDocument);
},
getIndex: function(h) {
var i = this.$,
j = 0;
while (i = i.previousSibling) {
if (h && i.nodeType == 3 && (!i.nodeValue.length || i.previousSibling && i.previousSibling.nodeType == 3)) continue;
j++;
}
return j;
},
getNextSourceNode: function(h, i, j) {
if (j && !j.call) {
var k = j;
j = function(n) {
return !n.equals(k);
};
}
var l = !h && this.getFirst && this.getFirst(),
m;
if (!l) {
if (this.type == 1 && j && j(this, true) === false) return null;
l = this.getNext();
}
while (!l && (m = (m || this).getParent())) {
if (j && j(m, true) === false) return null;
l = m.getNext();
}
if (!l) return null;
if (j && j(l) === false) return null;
if (i && i != l.type) return l.getNextSourceNode(false, i, j);
return l;
},
getPreviousSourceNode: function(h, i, j) {
if (j && !j.call) {
var k = j;
j = function(n) {
return !n.equals(k);
};
}
var l = !h && this.getLast && this.getLast(),
m;
if (!l) {
if (this.type == 1 && j && j(this, true) === false) return null;
l = this.getPrevious();
}
while (!l && (m = (m || this).getParent())) {
if (j && j(m, true) === false) return null;
l = m.getPrevious();
}
if (!l) return null;
if (j && j(l) === false) return null;
if (i && l.type != i) return l.getPreviousSourceNode(false, i, j);
return l;
},
getPrevious: function(h) {
var i = this.$,
j;
do {
i = i.previousSibling;
j = i && new d.node(i);
} while (j && h && !h(j));
return j;
},
getNext: function(h) {
var i = this.$,
j;
do {
i = i.nextSibling;
j = i && new d.node(i);
} while (j && h && !h(j));
return j;
},
getParent: function() {
var h = this.$.parentNode;
return h && h.nodeType == 1 ? new d.node(h) : null;
},
getParents: function(h) {
var i = this,
j = [];
do j[h ? 'push' : 'unshift'](i); while (i = i.getParent());
return j;
},
getCommonAncestor: function(h) {
var j = this;
if (h.equals(j)) return j;
if (h.contains && h.contains(j)) return h;
var i = j.contains ? j : j.getParent();
do {
if (i.contains(h)) return i;
} while (i = i.getParent());
return null;
},
getPosition: function(h) {
var i = this.$,
j = h.$;
if (i.compareDocumentPosition) return i.compareDocumentPosition(j);
if (i == j) return 0;
if (this.type == 1 && h.type == 1) {
if (i.contains) {
if (i.contains(j)) return 16 + 4;
if (j.contains(i)) return 8 + 2;
}
if ('sourceIndex' in i) return i.sourceIndex < 0 || j.sourceIndex < 0 ? 1 : i.sourceIndex < j.sourceIndex ? 4 : 2;
}
var k = this.getAddress(),
l = h.getAddress(),
m = Math.min(k.length, l.length);
for (var n = 0; n <= m - 1; n++) {
if (k[n] != l[n]) {
if (n < m) return k[n] < l[n] ? 4 : 2;
break;
}
}
return k.length < l.length ? 16 + 4 : 8 + 2;
},
getAscendant: function(h, i) {
var j = this.$;
if (!i) j = j.parentNode;
while (j) {
if (j.nodeName && j.nodeName.toLowerCase() == h) return new d.node(j);
j = j.parentNode;
}
return null;
},
hasAscendant: function(h, i) {
var j = this.$;
if (!i) j = j.parentNode;
while (j) {
if (j.nodeName && j.nodeName.toLowerCase() == h) return true;
j = j.parentNode;
}
return false;
},
move: function(h, i) {
h.append(this.remove(), i);
},
remove: function(h) {
var i = this.$,
j = i.parentNode;
if (j) {
if (h)
for (var k; k = i.firstChild;) j.insertBefore(i.removeChild(k), i);
j.removeChild(i);
}
return this;
},
replace: function(h) {
this.insertBefore(h);
h.remove();
},
trim: function() {
this.ltrim();
this.rtrim();
},
ltrim: function() {
var k = this;
var h;
while (k.getFirst && (h = k.getFirst())) {
if (h.type == 3) {
var i = e.ltrim(h.getText()),
j = h.getLength();
if (!i) {
h.remove();
continue;
} else if (i.length < j) {
h.split(j - i.length);
k.$.removeChild(k.$.firstChild);
}
}
break;
}
},
rtrim: function() {
var k = this;
var h;
while (k.getLast && (h = k.getLast())) {
if (h.type == 3) {
var i = e.rtrim(h.getText()),
j = h.getLength();
if (!i) {
h.remove();
continue;
} else if (i.length < j) {
h.split(i.length);
k.$.lastChild.parentNode.removeChild(k.$.lastChild);
}
}
break;
}
if (!c && !b.opera) {
h = k.$.lastChild;
if (h && h.type == 1 && h.nodeName.toLowerCase() == 'br') h.parentNode.removeChild(h);
}
},
isReadOnly: function() {
var h = this;
while (h) {
if (h.type == 1) {
if (h.is('body') || !!h.data('cke-editable')) break;
if (h.getAttribute('contentEditable') == 'false') return h;
else if (h.getAttribute('contentEditable') == 'true') break;
}
h = h.getParent();
}
return false;
}
});
d.nodeList = function(h) {
this.$ = h;
};
d.nodeList.prototype = {
count: function() {
return this.$.length;
},
getItem: function(h) {
var i = this.$[h];
return i ? new d.node(i) : null;
}
};
d.element = function(h, i) {
if (typeof h == 'string') h = (i ? i.$ : document).createElement(h);
d.domObject.call(this, h);
};
var h = d.element;
h.get = function(i) {
return i && (i.$ ? i : new h(i));
};
h.prototype = new d.node();
h.createFromHtml = function(i, j) {
var k = new h('div', j);
k.setHtml(i);
return k.getFirst().remove();
};
h.setMarker = function(i, j, k, l) {
var m = j.getCustomData('list_marker_id') || j.setCustomData('list_marker_id', e.getNextNumber()).getCustomData('list_marker_id'),
n = j.getCustomData('list_marker_names') || j.setCustomData('list_marker_names', {}).getCustomData('list_marker_names');
i[m] = j;
n[k] = 1;
return j.setCustomData(k, l);
};
h.clearAllMarkers = function(i) {
for (var j in i) h.clearMarkers(i, i[j], 1);
};
h.clearMarkers = function(i, j, k) {
var l = j.getCustomData('list_marker_names'),
m = j.getCustomData('list_marker_id');
for (var n in l) j.removeCustomData(n);
j.removeCustomData('list_marker_names');
if (k) {
j.removeCustomData('list_marker_id');
delete i[m];
}
};
e.extend(h.prototype, {
type: 1,
addClass: function(i) {
var j = this.$.className;
if (j) {
var k = new RegExp('(?:^|\\s)' + i + '(?:\\s|$)', '');
if (!k.test(j)) j += ' ' + i;
}
this.$.className = j || i;
},
removeClass: function(i) {
var j = this.getAttribute('class');
if (j) {
var k = new RegExp('(?:^|\\s+)' + i + '(?=\\s|$)', 'i');
if (k.test(j)) {
j = j.replace(k, '').replace(/^\s+/, '');
if (j) this.setAttribute('class', j);
else this.removeAttribute('class');
}
}
},
hasClass: function(i) {
var j = new RegExp('(?:^|\\s+)' + i + '(?=\\s|$)', '');
return j.test(this.getAttribute('class'));
},
append: function(i, j) {
var k = this;
if (typeof i == 'string') i = k.getDocument().createElement(i);
if (j) k.$.insertBefore(i.$, k.$.firstChild);
else k.$.appendChild(i.$);
return i;
},
appendHtml: function(i) {
var k = this;
if (!k.$.childNodes.length) k.setHtml(i);
else {
var j = new h('div', k.getDocument());
j.setHtml(i);
j.moveChildren(k);
}
},
appendText: function(i) {
if (this.$.text != undefined) this.$.text += i;
else this.append(new d.text(i));
},
appendBogus: function() {
var k = this;
var i = k.getLast();
while (i && i.type == 3 && !e.rtrim(i.getText())) i = i.getPrevious();
if (!i || !i.is || !i.is('br')) {
var j = b.opera ? k.getDocument().createText('') : k.getDocument().createElement('br');
b.gecko && j.setAttribute('type', '_moz');
k.append(j);
}
},
breakParent: function(i) {
var l = this;
var j = new d.range(l.getDocument());
j.setStartAfter(l);
j.setEndAfter(i);
var k = j.extractContents();
j.insertNode(l.remove());
k.insertAfterNode(l);
},
contains: c || b.webkit ? function(i) {
var j = this.$;
return i.type != 1 ? j.contains(i.getParent().$) : j != i.$ && j.contains(i.$);
} : function(i) {
return !!(this.$.compareDocumentPosition(i.$) & 16);
},
focus: (function() {
function i() {
try {
this.$.focus();
} catch (j) {}
};
return function(j) {
if (j) e.setTimeout(i, 100, this);
else i.call(this);
};
})(),
getHtml: function() {
var i = this.$.innerHTML;
return c ? i.replace(/<\?[^>]*>/g, '') : i;
},
getOuterHtml: function() {
var j = this;
if (j.$.outerHTML) return j.$.outerHTML.replace(/<\?[^>]*>/, '');
var i = j.$.ownerDocument.createElement('div');
i.appendChild(j.$.cloneNode(true));
return i.innerHTML;
},
setHtml: function(i) {
return this.$.innerHTML = i;
},
setText: function(i) {
h.prototype.setText = this.$.innerText != undefined ? function(j) {
return this.$.innerText = j;
} : function(j) {
return this.$.textContent = j;
};
return this.setText(i);
},
getAttribute: (function() {
var i = function(j) {
return this.$.getAttribute(j, 2);
};
if (c && (b.ie7Compat || b.ie6Compat)) return function(j) {
var n = this;
switch (j) {
case 'class':
j = 'className';
break;
case 'http-equiv':
j = 'httpEquiv';
break;
case 'name':
return n.$.name;
case 'tabindex':
var k = i.call(n, j);
if (k !== 0 && n.$.tabIndex === 0) k = null;
return k;
break;
case 'checked':
var l = n.$.attributes.getNamedItem(j),
m = l.specified ? l.nodeValue : n.$.checked;
return m ? 'checked' : null;
case 'hspace':
case 'value':
return n.$[j];
case 'style':
return n.$.style.cssText;
}
return i.call(n, j);
};
else return i;
})(),
getChildren: function() {
return new d.nodeList(this.$.childNodes);
},
getComputedStyle: c ? function(i) {
return this.$.currentStyle[e.cssStyleToDomStyle(i)];
} : function(i) {
return this.getWindow().$.getComputedStyle(this.$, '').getPropertyValue(i);
},
getDtd: function() {
var i = f[this.getName()];
this.getDtd = function() {
return i;
};
return i;
},
getElementsByTag: g.prototype.getElementsByTag,
getTabIndex: c ? function() {
var i = this.$.tabIndex;
if (i === 0 && !f.$tabIndex[this.getName()] && parseInt(this.getAttribute('tabindex'), 10) !== 0) i = -1;
return i;
} : b.webkit ? function() {
var i = this.$.tabIndex;
if (i == undefined) {
i = parseInt(this.getAttribute('tabindex'), 10);
if (isNaN(i)) i = -1;
}
return i;
} : function() {
return this.$.tabIndex;
},
getText: function() {
return this.$.textContent || this.$.innerText || '';
},
getWindow: function() {
return this.getDocument().getWindow();
},
getId: function() {
return this.$.id || null;
},
getNameAtt: function() {
return this.$.name || null;
},
getName: function() {
var i = this.$.nodeName.toLowerCase();
if (c && !(document.documentMode > 8)) {
var j = this.$.scopeName;
if (j != 'HTML') i = j.toLowerCase() + ':' + i;
}
return (this.getName = function() {
return i;
})();
},
getValue: function() {
return this.$.value;
},
getFirst: function(i) {
var j = this.$.firstChild,
k = j && new d.node(j);
if (k && i && !i(k)) k = k.getNext(i);
return k;
},
getLast: function(i) {
var j = this.$.lastChild,
k = j && new d.node(j);
if (k && i && !i(k)) k = k.getPrevious(i);
return k;
},
getStyle: function(i) {
return this.$.style[e.cssStyleToDomStyle(i)];
},
is: function() {
var i = this.getName();
for (var j = 0; j < arguments.length; j++) {
if (arguments[j] == i) return true;
}
return false;
},
isEditable: function() {
if (this.isReadOnly()) return false;
var i = this.getName(),
j = !f.$nonEditable[i] && (f[i] || f.span);
return j && j['#'];
},
isIdentical: function(i) {
if (this.getName() != i.getName()) return false;
var j = this.$.attributes,
k = i.$.attributes,
l = j.length,
m = k.length;
for (var n = 0; n < l; n++) {
var o = j[n];
if (o.nodeName == '_moz_dirty') continue;
if ((!c || o.specified && o.nodeName != 'data-cke-expando') && o.nodeValue != i.getAttribute(o.nodeName)) return false;
}
if (c)
for (n = 0; n < m; n++) {
o = k[n];
if (o.specified && o.nodeName != 'data-cke-expando' && o.nodeValue != this.getAttribute(o.nodeName)) return false;
}
return true;
},
isVisible: function() {
var i = !!this.$.offsetHeight && this.getComputedStyle('visibility') != 'hidden',
j, k;
if (i && (b.webkit || b.opera)) {
j = this.getWindow();
if (!j.equals(a.document.getWindow()) && (k = j.$.frameElement)) i = new h(k).isVisible();
}
return i;
},
isEmptyInlineRemoveable: function() {
if (!f.$removeEmpty[this.getName()]) return false;
var i = this.getChildren();
for (var j = 0, k = i.count(); j < k; j++) {
var l = i.getItem(j);
if (l.type == 1 && l.data('cke-bookmark')) continue;
if (l.type == 1 && !l.isEmptyInlineRemoveable() || l.type == 3 && e.trim(l.getText())) return false;
}
return true;
},
hasAttributes: c && (b.ie7Compat || b.ie6Compat) ? function() {
var i = this.$.attributes;
for (var j = 0; j < i.length; j++) {
var k = i[j];
switch (k.nodeName) {
case 'class':
if (this.getAttribute('class')) return true;
case 'data-cke-expando':
continue;
default:
if (k.specified) return true;
}
}
return false;
} : function() {
var i = this.$.attributes,
j = i.length,
k = {
'data-cke-expando': 1,
_moz_dirty: 1
};
return j > 0 && (j > 2 || !k[i[0].nodeName] || j == 2 && !k[i[1].nodeName]);
},
hasAttribute: (function() {
function i(j) {
var k = this.$.attributes.getNamedItem(j);
return !!(k && k.specified);
};
return c && b.version < 8 ? function(j) {
if (j == 'name') return !!this.$.name;
return i.call(this, j);
} : i;
})(),
hide: function() {
this.setStyle('display', 'none');
},
moveChildren: function(i, j) {
var k = this.$;
i = i.$;
if (k == i) return;
var l;
if (j)
while (l = k.lastChild) i.insertBefore(k.removeChild(l), i.firstChild);
else
while (l = k.firstChild) i.appendChild(k.removeChild(l));
},
mergeSiblings: (function() {
function i(j, k, l) {
if (k && k.type == 1) {
var m = [];
while (k.data('cke-bookmark') || k.isEmptyInlineRemoveable()) {
m.push(k);
k = l ? k.getNext() : k.getPrevious();
if (!k || k.type != 1) return;
}
if (j.isIdentical(k)) {
var n = l ? j.getLast() : j.getFirst();
while (m.length) m.shift().move(j, !l);
k.moveChildren(j, !l);
k.remove();
if (n && n.type == 1) n.mergeSiblings();
}
}
};
return function(j) {
var k = this;
if (!(j === false || f.$removeEmpty[k.getName()] || k.is('a'))) return;
i(k, k.getNext(), true);
i(k, k.getPrevious());
};
})(),
show: function() {
this.setStyles({
display: '',
visibility: ''
});
},
setAttribute: (function() {
var i = function(j, k) {
this.$.setAttribute(j, k);
return this;
};
if (c && (b.ie7Compat || b.ie6Compat)) return function(j, k) {
var l = this;
if (j == 'class') l.$.className = k;
else if (j == 'style') l.$.style.cssText = k;
else if (j == 'tabindex') l.$.tabIndex = k;
else if (j == 'checked') l.$.checked = k;
else i.apply(l, arguments);
return l;
};
else return i;
})(),
setAttributes: function(i) {
for (var j in i) this.setAttribute(j, i[j]);
return this;
},
setValue: function(i) {
this.$.value = i;
return this;
},
removeAttribute: (function() {
var i = function(j) {
this.$.removeAttribute(j);
};
if (c && (b.ie7Compat || b.ie6Compat)) return function(j) {
if (j == 'class') j = 'className';
else if (j == 'tabindex') j = 'tabIndex';
i.call(this, j);
};
else return i;
})(),
removeAttributes: function(i) {
if (e.isArray(i))
for (var j = 0; j < i.length; j++) this.removeAttribute(i[j]);
else
for (var k in i) i.hasOwnProperty(k) && this.removeAttribute(k);
},
removeStyle: function(i) {
var j = this;
j.setStyle(i, '');
if (j.$.style.removeAttribute) j.$.style.removeAttribute(e.cssStyleToDomStyle(i));
if (!j.$.style.cssText) j.removeAttribute('style');
},
setStyle: function(i, j) {
this.$.style[e.cssStyleToDomStyle(i)] = j;
return this;
},
setStyles: function(i) {
for (var j in i) this.setStyle(j, i[j]);
return this;
},
setOpacity: function(i) {
if (c) {
i = Math.round(i * 100);
this.setStyle('filter', i >= 100 ? '' : 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + i + ')');
} else this.setStyle('opacity', i);
},
unselectable: b.gecko ? function() {
this.$.style.MozUserSelect = 'none';
this.on('dragstart', function(i) {
i.data.preventDefault();
});
} : b.webkit ? function() {
this.$.style.KhtmlUserSelect = 'none';
this.on('dragstart', function(i) {
i.data.preventDefault();
});
} : function() {
if (c || b.opera) {
var i = this.$,
j, k = 0;
i.unselectable = 'on';
while (j = i.all[k++]) switch (j.tagName.toLowerCase()) {
case 'iframe':
case 'textarea':
case 'input':
case 'select':
break;
default:
j.unselectable = 'on';
}
}
},
getPositionedAncestor: function() {
var i = this;
while (i.getName() != 'html') {
if (i.getComputedStyle('position') != 'static') return i;
i = i.getParent();
}
return null;
},
getDocumentPosition: function(i) {
var D = this;
var j = 0,
k = 0,
l = D.getDocument().getBody(),
m = D.getDocument().$.compatMode == 'BackCompat',
n = D.getDocument();
if (document.documentElement.getBoundingClientRect) {
var o = D.$.getBoundingClientRect(),
p = n.$,
q = p.documentElement,
r = q.clientTop || l.$.clientTop || 0,
s = q.clientLeft || l.$.clientLeft || 0,
t = true;
if (c) {
var u = n.getDocumentElement().contains(D),
v = n.getBody().contains(D);
t = m && v || !m && u;
}
if (t) {
j = o.left + (!m && q.scrollLeft || l.$.scrollLeft);
j -= s;
k = o.top + (!m && q.scrollTop || l.$.scrollTop);
k -= r;
}
} else {
var w = D,
x = null,
y;
while (w && !(w.getName() == 'body' || w.getName() == 'html')) {
j += w.$.offsetLeft - w.$.scrollLeft;
k += w.$.offsetTop - w.$.scrollTop;
if (!w.equals(D)) {
j += w.$.clientLeft || 0;
k += w.$.clientTop || 0;
}
var z = x;
while (z && !z.equals(w)) {
j -= z.$.scrollLeft;
k -= z.$.scrollTop;
z = z.getParent();
}
x = w;
w = (y = w.$.offsetParent) ? new h(y) : null;
}
}
if (i) {
var A = D.getWindow(),
B = i.getWindow();
if (!A.equals(B) && A.$.frameElement) {
var C = new h(A.$.frameElement).getDocumentPosition(i);
j += C.x;
k += C.y;
}
}
if (!document.documentElement.getBoundingClientRect)
if (b.gecko && !m) {
j += D.$.clientLeft ? 1 : 0;
k += D.$.clientTop ? 1 : 0;
}
return {
x: j,
y: k
};
},
scrollIntoView: function(i) {
var o = this;
var j = o.getWindow(),
k = j.getViewPaneSize().height,
l = k * -1;
if (i) l += k;
else {
l += o.$.offsetHeight || 0;
l += parseInt(o.getComputedStyle('marginBottom') || 0, 10) || 0;
}
var m = o.getDocumentPosition();
l += m.y;
l = l < 0 ? 0 : l;
var n = j.getScrollPosition().y;
if (l > n || l < n - k) j.$.scrollTo(0, l);
},
setState: function(i) {
var j = this;
switch (i) {
case 1:
j.addClass('cke_on');
j.removeClass('cke_off');
j.removeClass('cke_disabled');
break;
case 0:
j.addClass('cke_disabled');
j.removeClass('cke_off');
j.removeClass('cke_on');
break;
default:
j.addClass('cke_off');
j.removeClass('cke_on');
j.removeClass('cke_disabled');
break;
}
},
getFrameDocument: function() {
var i = this.$;
try {
i.contentWindow.document;
} catch (j) {
i.src = i.src;
if (c && b.version < 7) window.showModalDialog('javascript:document.write("")');
}
return i && new g(i.contentWindow.document);
},
copyAttributes: function(i, j) {
var p = this;
var k = p.$.attributes;
j = j || {};
for (var l = 0; l < k.length; l++) {
var m = k[l],
n = m.nodeName.toLowerCase(),
o;
if (n in j) continue;
if (n == 'checked' && (o = p.getAttribute(n))) i.setAttribute(n, o);
else if (m.specified || c && m.nodeValue && n == 'value') {
o = p.getAttribute(n);
if (o === null) o = m.nodeValue;
i.setAttribute(n, o);
}
}
if (p.$.style.cssText !== '') i.$.style.cssText = p.$.style.cssText;
},
renameNode: function(i) {
var l = this;
if (l.getName() == i) return;
var j = l.getDocument(),
k = new h(i, j);
l.copyAttributes(k);
l.moveChildren(k);
l.getParent() && l.$.parentNode.replaceChild(k.$, l.$);
k.$['data-cke-expando'] = l.$['data-cke-expando'];
l.$ = k.$;
},
getChild: function(i) {
var j = this.$;
if (!i.slice) j = j.childNodes[i];
else
while (i.length > 0 && j) j = j.childNodes[i.shift()];
return j ? new d.node(j) : null;
},
getChildCount: function() {
return this.$.childNodes.length;
},
disableContextMenu: function() {
this.on('contextmenu', function(i) {
if (!i.data.getTarget().hasClass('cke_enable_context_menu')) i.data.preventDefault();
});
},
getDirection: function(i) {
return i ? this.getComputedStyle('direction') : this.getStyle('direction') || this.getAttribute('dir');
},
data: function(i, j) {
i = 'data-' + i;
if (j === undefined) return this.getAttribute(i);
else if (j === false) this.removeAttribute(i);
else this.setAttribute(i, j);
return null;
}
});
(function() {
var i = {
width: ['border-left-width', 'border-right-width', 'padding-left', 'padding-right'],
height: ['border-top-width', 'border-bottom-width', 'padding-top', 'padding-bottom']
};
function j(k) {
var l = 0;
for (var m = 0, n = i[k].length; m < n; m++) l += parseInt(this.getComputedStyle(i[k][m]) || 0, 10) || 0;
return l;
};
h.prototype.setSize = function(k, l, m) {
if (typeof l == 'number') {
if (m && !(c && b.quirks)) l -= j.call(this, k);
this.setStyle(k, l + 'px');
}
};
h.prototype.getSize = function(k, l) {
var m = Math.max(this.$['offset' + e.capitalize(k)], this.$['client' + e.capitalize(k)]) || 0;
if (l) m -= j.call(this, k);
return m;
};
})();
a.command = function(i, j) {
this.uiItems = [];
this.exec = function(k) {
if (this.state == 0) return false;
if (this.editorFocus) i.focus();
return j.exec.call(this, i, k) !== false;
};
e.extend(this, j, {
modes: {
wysiwyg: 1
},
editorFocus: 1,
state: 2
});
a.event.call(this);
};
a.command.prototype = {
enable: function() {
var i = this;
if (i.state == 0) i.setState(!i.preserveState || typeof i.previousState == 'undefined' ? 2 : i.previousState);
},
disable: function() {
this.setState(0);
},
setState: function(i) {
var j = this;
if (j.state == i) return false;
j.previousState = j.state;
j.state = i;
j.fire('state');
return true;
},
toggleState: function() {
var i = this;
if (i.state == 2) i.setState(1);
else if (i.state == 1) i.setState(2);
}
};
a.event.implementOn(a.command.prototype, true);
a.ENTER_P = 1;
a.ENTER_BR = 2;
a.ENTER_DIV = 3;
a.config = {
customConfig: 'config.js',
autoUpdateElement: true,
baseHref: '',
contentsCss: a.basePath + 'contents.css',
contentsLangDirection: 'ui',
contentsLanguage: '',
language: '',
defaultLanguage: 'en',
enterMode: 1,
forceEnterMode: false,
shiftEnterMode: 2,
corePlugins: '',
docType: '',
bodyId: '',
bodyClass: '',
fullPage: false,
height: 200,
plugins: 'about,a11yhelp,basicstyles,bidi,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,dialogadvtab,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,iframe,image,indent,justify,keystrokes,link,list,liststyle,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,showborders,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',
extraPlugins: '',
removePlugins: '',
protectedSource: [],
tabIndex: 0,
theme: 'default',
skin: 'kama',
width: '',
baseFloatZIndex: 10000
};
var i = a.config;
a.focusManager = function(j) {
if (j.focusManager) return j.focusManager;
this.hasFocus = false;
this._ = {
editor: j
};
return this;
};
a.focusManager.prototype = {
focus: function() {
var k = this;
if (k._.timer) clearTimeout(k._.timer);
if (!k.hasFocus) {
if (a.currentInstance) a.currentInstance.focusManager.forceBlur();
var j = k._.editor;
j.container.getChild(1).addClass('cke_focus');
k.hasFocus = true;
j.fire('focus');
}
},
blur: function() {
var j = this;
if (j._.timer) clearTimeout(j._.timer);
j._.timer = setTimeout(function() {
delete j._.timer;
j.forceBlur();
}, 100);
},
forceBlur: function() {
if (this.hasFocus) {
var j = this._.editor;
j.container.getChild(1).removeClass('cke_focus');
this.hasFocus = false;
j.fire('blur');
}
}
};
(function() {
var j = {};
a.lang = {
languages: {
af: 1,
ar: 1,
bg: 1,
bn: 1,
bs: 1,
ca: 1,
cs: 1,
cy: 1,
da: 1,
de: 1,
el: 1,
'en-au': 1,
'en-ca': 1,
'en-gb': 1,
en: 1,
eo: 1,
es: 1,
et: 1,
eu: 1,
fa: 1,
fi: 1,
fo: 1,
'fr-ca': 1,
fr: 1,
gl: 1,
gu: 1,
he: 1,
hi: 1,
hr: 1,
hu: 1,
is: 1,
it: 1,
ja: 1,
ka: 1,
km: 1,
ko: 1,
lt: 1,
lv: 1,
mn: 1,
ms: 1,
nb: 1,
nl: 1,
no: 1,
pl: 1,
'pt-br': 1,
pt: 1,
ro: 1,
ru: 1,
sk: 1,
sl: 1,
'sr-latn': 1,
sr: 1,
sv: 1,
th: 1,
tr: 1,
uk: 1,
vi: 1,
'zh-cn': 1,
zh: 1
},
load: function(k, l, m) {
if (!k || !a.lang.languages[k]) k = this.detect(l, k);
if (!this[k]) a.scriptLoader.load(a.getUrl('lang/' + k + '.js'), function() {
m(k, this[k]);
}, this);
else m(k, this[k]);
},
detect: function(k, l) {
var m = this.languages;
l = l || navigator.userLanguage || navigator.language;
var n = l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),
o = n[1],
p = n[2];
if (m[o + '-' + p]) o = o + '-' + p;
else if (!m[o]) o = null;
a.lang.detect = o ? function() {
return o;
} : function(q) {
return q;
};
return o || k;
}
};
})();
a.scriptLoader = (function() {
var j = {},
k = {};
return {
load: function(l, m, n, o) {
var p = typeof l == 'string';
if (p) l = [l];
if (!n) n = a;
var q = l.length,
r = [],
s = [],
t = function(y) {
if (m)
if (p) m.call(n, y);
else m.call(n, r, s);
};
if (q === 0) {
t(true);
return;
}
var u = function(y, z) {
(z ? r : s).push(y);
if (--q <= 0) {
o && a.document.getDocumentElement().removeStyle('cursor');
t(z);
}
},
v = function(y, z) {
j[y] = 1;
var A = k[y];
delete k[y];
for (var B = 0; B < A.length; B++) A[B](y, z);
},
w = function(y) {
if (j[y]) {
u(y, true);
return;
}
var z = k[y] || (k[y] = []);
z.push(u);
if (z.length > 1) return;
var A = new h('script');
A.setAttributes({
type: 'text/javascript',
src: y
});
if (m)
if (c) A.$.onreadystatechange = function() {
if (A.$.readyState == 'loaded' || A.$.readyState == 'complete') {
A.$.onreadystatechange = null;
v(y, true);
}
};
else {
A.$.onload = function() {
setTimeout(function() {
v(y, true);
}, 0);
};
A.$.onerror = function() {
v(y, false);
};
}
A.appendTo(a.document.getHead());
};
o && a.document.getDocumentElement().setStyle('cursor', 'wait');
for (var x = 0; x < q; x++) w(l[x]);
}
};
})();
a.resourceManager = function(j, k) {
var l = this;
l.basePath = j;
l.fileName = k;
l.registered = {};
l.loaded = {};
l.externals = {};
l._ = {
waitingList: {}
};
};
a.resourceManager.prototype = {
add: function(j, k) {
if (this.registered[j]) throw '[CKEDITOR.resourceManager.add] The resource name "' + j + '" is already registered.';
a.fire(j + e.capitalize(this.fileName) + 'Ready', this.registered[j] = k || {});
},
get: function(j) {
return this.registered[j] || null;
},
getPath: function(j) {
var k = this.externals[j];
return a.getUrl(k && k.dir || this.basePath + j + '/');
},
getFilePath: function(j) {
var k = this.externals[j];
return a.getUrl(this.getPath(j) + (k && typeof k.file == 'string' ? k.file : this.fileName + '.js'));
},
addExternal: function(j, k, l) {
j = j.split(',');
for (var m = 0; m < j.length; m++) {
var n = j[m];
this.externals[n] = {
dir: k,
file: l
};
}
},
load: function(j, k, l) {
if (!e.isArray(j)) j = j ? [j] : [];
var m = this.loaded,
n = this.registered,
o = [],
p = {},
q = {};
for (var r = 0; r < j.length; r++) {
var s = j[r];
if (!s) continue;
if (!m[s] && !n[s]) {
var t = this.getFilePath(s);
o.push(t);
if (!(t in p)) p[t] = [];
p[t].push(s);
} else q[s] = this.get(s);
}
a.scriptLoader.load(o, function(u, v) {
if (v.length) throw '[CKEDITOR.resourceManager.load] Resource name "' + p[v[0]].join(',') + '" was not found at "' + v[0] + '".';
for (var w = 0; w < u.length; w++) {
var x = p[u[w]];
for (var y = 0; y < x.length; y++) {
var z = x[y];
q[z] = this.get(z);
m[z] = 1;
}
}
k.call(l, q);
}, this);
}
};
a.plugins = new a.resourceManager('plugins/', 'plugin');
var j = a.plugins;
j.load = e.override(j.load, function(k) {
return function(l, m, n) {
var o = {},
p = function(q) {
k.call(this, q, function(r) {
e.extend(o, r);
var s = [];
for (var t in r) {
var u = r[t],
v = u && u.requires;
if (v)
for (var w = 0; w < v.length; w++) {
if (!o[v[w]]) s.push(v[w]);
}
}
if (s.length) p.call(this, s);
else {
for (t in o) {
u = o[t];
if (u.onLoad && !u.onLoad._called) {
u.onLoad();
u.onLoad._called = 1;
}
}
if (m) m.call(n || window, o);
}
}, this);
};
p.call(this, l);
};
});
j.setLang = function(k, l, m) {
var n = this.get(k),
o = n.langEntries || (n.langEntries = {}),
p = n.lang || (n.lang = []);
if (e.indexOf(p, l) == -1) p.push(l);
o[l] = m;
};
a.skins = (function() {
var k = {},
l = {},
m = function(n, o, p, q) {
var r = k[o];
if (!n.skin) {
n.skin = r;
if (r.init) r.init(n);
}
var s = function(B) {
for (var C = 0; C < B.length; C++) B[C] = a.getUrl(l[o] + B[C]);
};
function t(B, C) {
return B.replace(/url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g, function(D, E, F, G) {
if (/^\/|^\w?:/.test(F)) return D;
else return 'url(' + C + E + F + G + ')';
});
};
p = r[p];
var u = !p || !!p._isLoaded;
if (u) q && q();
else {
var v = p._pending || (p._pending = []);
v.push(q);
if (v.length > 1) return;
var w = !p.css || !p.css.length,
x = !p.js || !p.js.length,
y = function() {
if (w && x) {
p._isLoaded = 1;
for (var B = 0; B < v.length; B++) {
if (v[B]) v[B]();
}
}
};
if (!w) {
var z = p.css;
if (e.isArray(z)) {
s(z);
for (var A = 0; A < z.length; A++) a.document.appendStyleSheet(z[A]);
} else {
z = t(z, a.getUrl(l[o]));
a.document.appendStyleText(z);
}
p.css = z;
w = 1;
}
if (!x) {
s(p.js);
a.scriptLoader.load(p.js, function() {
x = 1;
y();
});
}
y();
}
};
return {
add: function(n, o) {
k[n] = o;
o.skinPath = l[n] || (l[n] = a.getUrl('skins/' + n + '/'));
},
load: function(n, o, p) {
var q = n.skinName,
r = n.skinPath;
if (k[q]) m(n, q, o, p);
else {
l[q] = r;
a.scriptLoader.load(a.getUrl(r + 'skin.js'), function() {
m(n, q, o, p);
});
}
}
};
})();
a.themes = new a.resourceManager('themes/', 'theme');
a.ui = function(k) {
if (k.ui) return k.ui;
this._ = {
handlers: {},
items: {},
editor: k
};
return this;
};
var k = a.ui;
k.prototype = {
add: function(l, m, n) {
this._.items[l] = {
type: m,
command: n.command || null,
args: Array.prototype.slice.call(arguments, 2)
};
},
create: function(l) {
var q = this;
var m = q._.items[l],
n = m && q._.handlers[m.type],
o = m && m.command && q._.editor.getCommand(m.command),
p = n && n.create.apply(q, m.args);
m && (p = e.extend(p, q._.editor.skin[m.type], true));
if (o) o.uiItems.push(p);
return p;
},
addHandler: function(l, m) {
this._.handlers[l] = m;
}
};
a.event.implementOn(k);
(function() {
var l = 0,
m = function() {
var x = 'editor' + ++l;
return a.instances && a.instances[x] ? m() : x;
},
n = {},
o = function(x) {
var y = x.config.customConfig;
if (!y) return false;
y = a.getUrl(y);
var z = n[y] || (n[y] = {});
if (z.fn) {
z.fn.call(x, x.config);
if (a.getUrl(x.config.customConfig) == y || !o(x)) x.fireOnce('customConfigLoaded');
} else a.scriptLoader.load(y, function() {
if (a.editorConfig) z.fn = a.editorConfig;
else z.fn = function() {};
o(x);
});
return true;
},
p = function(x, y) {
x.on('customConfigLoaded', function() {
if (y) {
if (y.on)
for (var z in y.on) x.on(z, y.on[z]);
e.extend(x.config, y, true);
delete x.config.on;
}
q(x);
});
if (y && y.customConfig != undefined) x.config.customConfig = y.customConfig;
if (!o(x)) x.fireOnce('customConfigLoaded');
},
q = function(x) {
var y = x.config.skin.split(','),
z = y[0],
A = a.getUrl(y[1] || 'skins/' + z + '/');
x.skinName = z;
x.skinPath = A;
x.skinClass = 'cke_skin_' + z;
x.tabIndex = x.config.tabIndex || x.element.getAttribute('tabindex') || 0;
x.readOnly = !!(x.config.readOnly || x.element.getAttribute('disabled'));
x.fireOnce('configLoaded');
t(x);
},
r = function(x) {
a.lang.load(x.config.language, x.config.defaultLanguage, function(y, z) {
x.langCode = y;
x.lang = e.prototypedCopy(z);
if (b.gecko && b.version < 10900 && x.lang.dir == 'rtl') x.lang.dir = 'ltr';
var A = x.config;
A.contentsLangDirection == 'ui' && (A.contentsLangDirection = x.lang.dir);
s(x);
});
},
s = function(x) {
var y = x.config,
z = y.plugins,
A = y.extraPlugins,
B = y.removePlugins;
if (A) {
var C = new RegExp('(?:^|,)(?:' + A.replace(/\s*,\s*/g, '|') + ')(?=,|$)', 'g');
z = z.replace(C, '');
z += ',' + A;
}
if (B) {
C = new RegExp('(?:^|,)(?:' + B.replace(/\s*,\s*/g, '|') + ')(?=,|$)', 'g');
z = z.replace(C, '');
}
b.air && (z += ',adobeair');
j.load(z.split(','), function(D) {
var E = [],
F = [],
G = [];
x.plugins = D;
for (var H in D) {
var I = D[H],
J = I.lang,
K = j.getPath(H),
L = null;
I.path = K;
if (J) {
L = e.indexOf(J, x.langCode) >= 0 ? x.langCode : J[0];
if (!I.langEntries || !I.langEntries[L]) G.push(a.getUrl(K + 'lang/' + L + '.js'));
else {
e.extend(x.lang, I.langEntries[L]);
L = null;
}
}
F.push(L);
E.push(I);
}
a.scriptLoader.load(G, function() {
var M = ['beforeInit', 'init', 'afterInit'];
for (var N = 0; N < M.length; N++)
for (var O = 0; O < E.length; O++) {
var P = E[O];
if (N === 0 && F[O] && P.lang) e.extend(x.lang, P.langEntries[F[O]]);
if (P[M[N]]) P[M[N]](x);
}
x.fire('pluginsLoaded');
u(x);
});
});
},
t = function(x) {
a.skins.load(x, 'editor', function() {
r(x);
});
},
u = function(x) {
var y = x.config.theme;
a.themes.load(y, function() {
var z = x.theme = a.themes.get(y);
z.path = a.themes.getPath(y);
z.build(x);
if (x.config.autoUpdateElement) v(x);
});
},
v = function(x) {
var y = x.element;
if (x.elementMode == 1 && y.is('textarea')) {
var z = y.$.form && new h(y.$.form);
if (z) {
function A() {
x.updateElement();
};
z.on('submit', A);
if (!z.$.submit.nodeName && !z.$.submit.length) z.$.submit = e.override(z.$.submit, function(B) {
return function() {
x.updateElement();
if (B.apply) B.apply(this, arguments);
else B();
};
});
x.on('destroy', function() {
z.removeListener('submit', A);
});
}
}
};
function w() {
var x, y = this._.commands,
z = this.mode;
if (!z) return;
for (var A in y) {
x = y[A];
x[x.startDisabled ? 'disable' : this.readOnly && !x.readOnly ? 'disable' : x.modes[z] ? 'enable' : 'disable']();
}
};
a.editor.prototype._init = function() {
var z = this;
var x = h.get(z._.element),
y = z._.instanceConfig;
delete z._.element;
delete z._.instanceConfig;
z._.commands = {};
z._.styles = [];
z.element = x;
z.name = x && z.elementMode == 1 && (x.getId() || x.getNameAtt()) || m();
if (z.name in a.instances) throw '[CKEDITOR.editor] The instance "' + z.name + '" already exists.';
z.id = e.getNextId();
z.config = e.prototypedCopy(i);
z.ui = new k(z);
z.focusManager = new a.focusManager(z);
a.fire('instanceCreated', null, z);
z.on('mode', w, null, null, 1);
z.on('readOnly', w, null, null, 1);
p(z, y);
};
})();
e.extend(a.editor.prototype, {
addCommand: function(l, m) {
return this._.commands[l] = new a.command(this, m);
},
addCss: function(l) {
this._.styles.push(l);
},
destroy: function(l) {
var m = this;
if (!l) m.updateElement();
m.fire('destroy');
m.theme && m.theme.destroy(m);
a.remove(m);
a.fire('instanceDestroyed', null, m);
},
execCommand: function(l, m) {
var n = this.getCommand(l),
o = {
name: l,
commandData: m,
command: n
};
if (n && n.state != 0)
if (this.fire('beforeCommandExec', o) !== true) {
o.returnValue = n.exec(o.commandData);
if (!n.async && this.fire('afterCommandExec', o) !== true) return o.returnValue;
}
return false;
},
getCommand: function(l) {
return this._.commands[l];
},
getData: function() {
var n = this;
n.fire('beforeGetData');
var l = n._.data;
if (typeof l != 'string') {
var m = n.element;
if (m && n.elementMode == 1) l = m.is('textarea') ? m.getValue() : m.getHtml();
else l = '';
}
l = {
dataValue: l
};
n.fire('getData', l);
return l.dataValue;
},
getSnapshot: function() {
var l = this.fire('getSnapshot');
if (typeof l != 'string') {
var m = this.element;
if (m && this.elementMode == 1) l = m.is('textarea') ? m.getValue() : m.getHtml();
}
return l;
},
loadSnapshot: function(l) {
this.fire('loadSnapshot', l);
},
setData: function(l, m, n) {
if (m) this.on('dataReady', function(p) {
p.removeListener();
m.call(p.editor);
});
var o = {
dataValue: l
};
!n && this.fire('setData', o);
this._.data = o.dataValue;
!n && this.fire('afterSetData', o);
},
setReadOnly: function(l) {
if (this.readOnly != !l) {
this.readOnly = !l;
this.fire('readOnly');
}
},
insertHtml: function(l) {
this.fire('insertHtml', l);
},
insertText: function(l) {
this.fire('insertText', l);
},
insertElement: function(l) {
this.fire('insertElement', l);
},
checkDirty: function() {
return this.mayBeDirty && this._.previousValue !== this.getSnapshot();
},
resetDirty: function() {
if (this.mayBeDirty) this._.previousValue = this.getSnapshot();
},
updateElement: function() {
var n = this;
var l = n.element;
if (l && n.elementMode == 1) {
var m = n.getData();
if (n.config.htmlEncodeOutput) m = e.htmlEncode(m);
if (l.is('textarea')) l.setValue(m);
else l.setHtml(m);
}
}
});
a.on('loaded', function() {
var l = a.editor._pending;
if (l) {
delete a.editor._pending;
for (var m = 0; m < l.length; m++) l[m]._init();
}
});
a.htmlParser = function() {
this._ = {
htmlPartsRegex: new RegExp("<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:\"[^\"]*\")|(?:'[^']*')|[^\"'>])*)\\/?>))", 'g')
};
};
(function() {
var l = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,
m = {
checked: 1,
compact: 1,
declare: 1,
defer: 1,
disabled: 1,
ismap: 1,
multiple: 1,
nohref: 1,
noresize: 1,
noshade: 1,
nowrap: 1,
readonly: 1,
selected: 1
};
a.htmlParser.prototype = {
onTagOpen: function() {},
onTagClose: function() {},
onText: function() {},
onCDATA: function() {},
onComment: function() {},
parse: function(n) {
var A = this;
var o, p, q = 0,
r;
while (o = A._.htmlPartsRegex.exec(n)) {
var s = o.index;
if (s > q) {
var t = n.substring(q, s);
if (r) r.push(t);
else A.onText(t);
}
q = A._.htmlPartsRegex.lastIndex;
if (p = o[1]) {
p = p.toLowerCase();
if (r && f.$cdata[p]) {
A.onCDATA(r.join(''));
r = null;
}
if (!r) {
A.onTagClose(p);
continue;
}
}
if (r) {
r.push(o[0]);
continue;
}
if (p = o[3]) {
p = p.toLowerCase();
if (/="/.test(p)) continue;
var u = {},
v, w = o[4],
x = !!(w && w.charAt(w.length - 1) == '/');
if (w)
while (v = l.exec(w)) {
var y = v[1].toLowerCase(),
z = v[2] || v[3] || v[4] || '';
if (!z && m[y]) u[y] = y;
else u[y] = z;
}
A.onTagOpen(p, u, x);
if (!r && f.$cdata[p]) r = [];
continue;
}
if (p = o[2]) A.onComment(p);
}
if (n.length > q) A.onText(n.substring(q, n.length));
}
};
})();
a.htmlParser.comment = function(l) {
this.value = l;
this._ = {
isBlockLike: false
};
};
a.htmlParser.comment.prototype = {
type: 8,
writeHtml: function(l, m) {
var n = this.value;
if (m) {
if (!(n = m.onComment(n, this))) return;
if (typeof n != 'string') {
n.parent = this.parent;
n.writeHtml(l, m);
return;
}
}
l.comment(n);
}
};
(function() {
var l = /[\t\r\n ]{2,}|[\t\r\n]/g;
a.htmlParser.text = function(m) {
this.value = m;
this._ = {
isBlockLike: false
};
};
a.htmlParser.text.prototype = {
type: 3,
writeHtml: function(m, n) {
var o = this.value;
if (n && !(o = n.onText(o, this))) return;
m.text(o);
}
};
})();
(function() {
a.htmlParser.cdata = function(l) {
this.value = l;
};
a.htmlParser.cdata.prototype = {
type: 3,
writeHtml: function(l) {
l.write(this.value);
}
};
})();
a.htmlParser.fragment = function() {
this.children = [];
this.parent = null;
this._ = {
isBlockLike: true,
hasInlineStarted: false
};
};
(function() {
var l = e.extend({
table: 1,
ul: 1,
ol: 1,
dl: 1
}, f.table, f.ul, f.ol, f.dl),
m = {
ol: 1,
ul: 1
},
n = e.extend({}, {
html: 1
}, f.html, f.body, f.head, {
style: 1,
script: 1
});
a.htmlParser.fragment.fromHtml = function(o, p, q) {
var r = new a.htmlParser(),
s = q || new a.htmlParser.fragment(),
t = [],
u = [],
v = s,
w = false;
function x(A) {
var B;
if (t.length > 0)
for (var C = 0; C < t.length; C++) {
var D = t[C],
E = D.name,
F = f[E],
G = v.name && f[v.name];
if ((!G || G[E]) && (!A || !F || F[A] || !f[A])) {
if (!B) {
y();
B = 1;
}
D = D.clone();
D.parent = v;
v = D;
t.splice(C, 1);
C--;
}
}
};
function y() {
while (u.length) v.add(u.shift());
};
function z(A, B, C) {
if (A.previous !== undefined) return;
B = B || v || s;
var D = v;
if (p && (!B.type || B.name == 'body')) {
var E, F;
if (A.attributes && (F = A.attributes['data-cke-real-element-type'])) E = F;
else E = A.name;
if (E && !(E in f.$body || E == 'body' || A.isOrphan)) {
v = B;
r.onTagOpen(p, {});
A.returnPoint = B = v;
}
}
if (A._.isBlockLike && A.name != 'pre') {
var G = A.children.length,
H = A.children[G - 1],
I;
if (H && H.type == 3)
if (!(I = e.rtrim(H.value))) A.children.length = G - 1;
else H.value = I;
}
B.add(A);
if (A.returnPoint) {
v = A.returnPoint;
delete A.returnPoint;
} else v = C ? B : D;
};
r.onTagOpen = function(A, B, C, D) {
var E = new a.htmlParser.element(A, B);
if (E.isUnknown && C) E.isEmpty = true;
E.isOptionalClose = D;
if (f.$removeEmpty[A]) {
t.push(E);
return;
} else if (A == 'pre') w = true;
else if (A == 'br' && w) {
v.add(new a.htmlParser.text('\n'));
return;
}
if (A == 'br') {
u.push(E);
return;
}
while (1) {
var F = v.name,
G = F ? f[F] || (v._.isBlockLike ? f.div : f.span) : n;
if (!E.isUnknown && !v.isUnknown && !G[A]) {
if (v.isOptionalClose) r.onTagClose(F);
else if (A in m && F in m) {
var H = v.children,
I = H[H.length - 1];
if (!(I && I.name == 'li')) z(I = new a.htmlParser.element('li'), v);
!E.returnPoint && (E.returnPoint = v);
v = I;
} else if (A in f.$listItem && F != A) r.onTagOpen(A == 'li' ? 'ul' : 'dl', {}, 0, 1);
else if (F in l && F != A) {
!E.returnPoint && (E.returnPoint = v);
v = v.parent;
} else {
if (F in f.$inline) t.unshift(v);
if (v.parent) z(v, v.parent, 1);
else {
E.isOrphan = 1;
break;
}
}
} else break;
}
x(A);
y();
E.parent = v;
if (E.isEmpty) z(E);
else v = E;
};
r.onTagClose = function(A) {
for (var B = t.length - 1; B >= 0; B--) {
if (A == t[B].name) {
t.splice(B, 1);
return;
}
}
var C = [],
D = [],
E = v;
while (E != s && E.name != A) {
if (!E._.isBlockLike) D.unshift(E);
C.push(E);
E = E.returnPoint || E.parent;
}
if (E != s) {
for (B = 0; B < C.length; B++) {
var F = C[B];
z(F, F.parent);
}
v = E;
if (v.name == 'pre') w = false;
if (E._.isBlockLike) y();
z(E, E.parent);
if (E == v) v = v.parent;
t = t.concat(D);
}
if (A == 'body') p = false;
};
r.onText = function(A) {
if ((!v._.hasInlineStarted || u.length) && !w) {
A = e.ltrim(A);
if (A.length === 0) return;
}
y();
x();
if (p && (!v.type || v.name == 'body') && e.trim(A)) this.onTagOpen(p, {}, 0, 1);
if (!w) A = A.replace(/[\t\r\n ]{2,}|[\t\r\n]/g, ' ');
v.add(new a.htmlParser.text(A));
};
r.onCDATA = function(A) {
v.add(new a.htmlParser.cdata(A));
};
r.onComment = function(A) {
y();
x();
v.add(new a.htmlParser.comment(A));
};
r.parse(o);
y(!c && 1);
while (v != s) z(v, v.parent, 1);
return s;
};
a.htmlParser.fragment.prototype = {
add: function(o) {
var r = this;
var p = r.children.length,
q = p > 0 && r.children[p - 1] || null;
if (q) {
if (o._.isBlockLike && q.type == 3) {
q.value = e.rtrim(q.value);
if (q.value.length === 0) {
r.children.pop();
r.add(o);
return;
}
}
q.next = o;
}
o.previous = q;
o.parent = r;
r.children.push(o);
r._.hasInlineStarted = o.type == 3 || o.type == 1 && !o._.isBlockLike;
},
writeHtml: function(o, p) {
var q;
this.filterChildren = function() {
var r = new a.htmlParser.basicWriter();
this.writeChildrenHtml.call(this, r, p, true);
var s = r.getHtml();
this.children = new a.htmlParser.fragment.fromHtml(s).children;
q = 1;
};
!this.name && p && p.onFragment(this);
this.writeChildrenHtml(o, q ? null : p);
},
writeChildrenHtml: function(o, p) {
for (var q = 0; q < this.children.length; q++) this.children[q].writeHtml(o, p);
}
};
})();
a.htmlParser.element = function(l, m) {
var s = this;
s.name = l;
s.attributes = m || (m = {});
s.children = [];
var n = m['data-cke-real-element-type'] || l || '',
o = n.match(/^cke:(.*)/);
o && (n = o[1]);
var p = f,
q = !!(p.$nonBodyContent[n] || p.$block[n] || p.$listItem[n] || p.$tableContent[n] || p.$nonEditable[n] || n == 'br'),
r = !!p.$empty[l];
s.isEmpty = r;
s.isUnknown = !p[l];
s._ = {
isBlockLike: q,
hasInlineStarted: r || !q
};
};
(function() {
var l = function(m, n) {
m = m[0];
n = n[0];
return m < n ? -1 : m > n ? 1 : 0;
};
a.htmlParser.element.prototype = {
type: 1,
add: a.htmlParser.fragment.prototype.add,
clone: function() {
return new a.htmlParser.element(this.name, this.attributes);
},
writeHtml: function(m, n) {
var o = this.attributes,
p = this,
q = p.name,
r, s, t, u;
p.filterChildren = function() {
if (!u) {
var z = new a.htmlParser.basicWriter();
a.htmlParser.fragment.prototype.writeChildrenHtml.call(p, z, n);
p.children = new a.htmlParser.fragment.fromHtml(z.getHtml(), 0, p.clone()).children;
u = 1;
}
};
if (n) {
for (;;) {
if (!(q = n.onElementName(q))) return;
p.name = q;
if (!(p = n.onElement(p))) return;
p.parent = this.parent;
if (p.name == q) break;
if (p.type != 1) {
p.writeHtml(m, n);
return;
}
q = p.name;
if (!q) {
this.writeChildrenHtml.call(p, m, u ? null : n);
return;
}
}
o = p.attributes;
}
m.openTag(q, o);
var v = [];
for (var w = 0; w < 2; w++)
for (r in o) {
s = r;
t = o[r];
if (w == 1) v.push([r, t]);
else if (n) {
for (;;) {
if (!(s = n.onAttributeName(r))) {
delete o[r];
break;
} else if (s != r) {
delete o[r];
r = s;
continue;
} else break;
}
if (s)
if ((t = n.onAttribute(p, s, t)) === false) delete o[s];
else o[s] = t;
}
}
if (m.sortAttributes) v.sort(l);
var x = v.length;
for (w = 0; w < x; w++) {
var y = v[w];
m.attribute(y[0], y[1]);
}
m.openTagClose(q, p.isEmpty);
if (!p.isEmpty) {
this.writeChildrenHtml.call(p, m, u ? null : n);
m.closeTag(q);
}
},
writeChildrenHtml: function(m, n) {
a.htmlParser.fragment.prototype.writeChildrenHtml.apply(this, arguments);
}
};
})();
(function() {
a.htmlParser.filter = e.createClass({
$: function(q) {
this._ = {
elementNames: [],
attributeNames: [],
elements: {
$length: 0
},
attributes: {
$length: 0
}
};
if (q) this.addRules(q, 10);
},
proto: {
addRules: function(q, r) {
var s = this;
if (typeof r != 'number') r = 10;
m(s._.elementNames, q.elementNames, r);
m(s._.attributeNames, q.attributeNames, r);
n(s._.elements, q.elements, r);
n(s._.attributes, q.attributes, r);
s._.text = o(s._.text, q.text, r) || s._.text;
s._.comment = o(s._.comment, q.comment, r) || s._.comment;
s._.root = o(s._.root, q.root, r) || s._.root;
},
onElementName: function(q) {
return l(q, this._.elementNames);
},
onAttributeName: function(q) {
return l(q, this._.attributeNames);
},
onText: function(q) {
var r = this._.text;
return r ? r.filter(q) : q;
},
onComment: function(q, r) {
var s = this._.comment;
return s ? s.filter(q, r) : q;
},
onFragment: function(q) {
var r = this._.root;
return r ? r.filter(q) : q;
},
onElement: function(q) {
var v = this;
var r = [v._.elements['^'], v._.elements[q.name], v._.elements.$],
s, t;
for (var u = 0; u < 3; u++) {
s = r[u];
if (s) {
t = s.filter(q, v);
if (t === false) return null;
if (t && t != q) return v.onNode(t);
if (q.parent && !q.name) break;
}
}
return q;
},
onNode: function(q) {
var r = q.type;
return r == 1 ? this.onElement(q) : r == 3 ? new a.htmlParser.text(this.onText(q.value)) : r == 8 ? new a.htmlParser.comment(this.onComment(q.value)) : null;
},
onAttribute: function(q, r, s) {
var t = this._.attributes[r];
if (t) {
var u = t.filter(s, q, this);
if (u === false) return false;
if (typeof u != 'undefined') return u;
}
return s;
}
}
});
function l(q, r) {
for (var s = 0; q && s < r.length; s++) {
var t = r[s];
q = q.replace(t[0], t[1]);
}
return q;
};
function m(q, r, s) {
if (typeof r == 'function') r = [r];
var t, u, v = q.length,
w = r && r.length;
if (w) {
for (t = 0; t < v && q[t].pri < s; t++) {}
for (u = w - 1; u >= 0; u--) {
var x = r[u];
if (x) {
x.pri = s;
q.splice(t, 0, x);
}
}
}
};
function n(q, r, s) {
if (r)
for (var t in r) {
var u = q[t];
q[t] = o(u, r[t], s);
if (!u) q.$length++;
}
};
function o(q, r, s) {
if (r) {
r.pri = s;
if (q) {
if (!q.splice) {
if (q.pri > s) q = [r, q];
else q = [q, r];
q.filter = p;
} else m(q, r, s);
return q;
} else {
r.filter = r;
return r;
}
}
};
function p(q) {
var r = q.type || q instanceof a.htmlParser.fragment;
for (var s = 0; s < this.length; s++) {
if (r) var t = q.type,
u = q.name;
var v = this[s],
w = v.apply(window, arguments);
if (w === false) return w;
if (r) {
if (w && (w.name != u || w.type != t)) return w;
} else if (typeof w != 'string') return w;
w != undefined && (q = w);
}
return q;
};
})();
a.htmlParser.basicWriter = e.createClass({
$: function() {
this._ = {
output: []
};
},
proto: {
openTag: function(l, m) {
this._.output.push('<', l);
},
openTagClose: function(l, m) {
if (m) this._.output.push(' />');
else this._.output.push('>');
},
attribute: function(l, m) {
if (typeof m == 'string') m = e.htmlEncodeAttr(m);
this._.output.push(' ', l, '="', m, '"');
},
closeTag: function(l) {
this._.output.push('', l, '>');
},
text: function(l) {
this._.output.push(l);
},
comment: function(l) {
this._.output.push('');
},
write: function(l) {
this._.output.push(l);
},
reset: function() {
this._.output = [];
this._.indent = false;
},
getHtml: function(l) {
var m = this._.output.join('');
if (l) this.reset();
return m;
}
}
});
delete a.loadFullCore;
a.instances = {};
a.document = new g(document);
a.add = function(l) {
a.instances[l.name] = l;
l.on('focus', function() {
if (a.currentInstance != l) {
a.currentInstance = l;
a.fire('currentInstance');
}
});
l.on('blur', function() {
if (a.currentInstance == l) {
a.currentInstance = null;
a.fire('currentInstance');
}
});
};
a.remove = function(l) {
delete a.instances[l.name];
};
a.on('instanceDestroyed', function() {
if (e.isEmpty(this.instances)) a.fire('reset');
});
a.TRISTATE_ON = 1;
a.TRISTATE_OFF = 2;
a.TRISTATE_DISABLED = 0;
d.comment = e.createClass({
base: d.node,
$: function(l, m) {
if (typeof l == 'string') l = (m ? m.$ : document).createComment(l);
this.base(l);
},
proto: {
type: 8,
getOuterHtml: function() {
return '';
}
}
});
(function() {
var l = {
address: 1,
blockquote: 1,
dl: 1,
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1,
p: 1,
pre: 1,
li: 1,
dt: 1,
dd: 1,
legend: 1
},
m = {
body: 1,
div: 1,
table: 1,
tbody: 1,
tr: 1,
td: 1,
th: 1,
caption: 1,
form: 1,
fieldset: 1
},
n = function(o) {
var p = o.getChildren();
for (var q = 0, r = p.count(); q < r; q++) {
var s = p.getItem(q);
if (s.type == 1 && f.$block[s.getName()]) return true;
}
return false;
};
d.elementPath = function(o) {
var u = this;
var p = null,
q = null,
r = [],
s = o;
while (s) {
if (s.type == 1) {
if (!u.lastElement) u.lastElement = s;
var t = s.getName();
if (c && s.$.scopeName != 'HTML') t = s.$.scopeName.toLowerCase() + ':' + t;
if (!q) {
if (!p && l[t]) p = s;
if (m[t])
if (!p && t == 'div' && !n(s)) p = s;
else q = s;
}
r.push(s);
if (t == 'body') break;
}
s = s.getParent();
}
u.block = p;
u.blockLimit = q;
u.elements = r;
};
})();
d.elementPath.prototype = {
compare: function(l) {
var m = this.elements,
n = l && l.elements;
if (!n || m.length != n.length) return false;
for (var o = 0; o < m.length; o++) {
if (!m[o].equals(n[o])) return false;
}
return true;
},
contains: function(l) {
var m = this.elements;
for (var n = 0; n < m.length; n++) {
if (m[n].getName() in l) return m[n];
}
return null;
}
};
d.text = function(l, m) {
if (typeof l == 'string') l = (m ? m.$ : document).createTextNode(l);
this.$ = l;
};
d.text.prototype = new d.node();
e.extend(d.text.prototype, {
type: 3,
getLength: function() {
return this.$.nodeValue.length;
},
getText: function() {
return this.$.nodeValue;
},
setText: function(l) {
this.$.nodeValue = l;
},
split: function(l) {
var q = this;
if (c && l == q.getLength()) {
var m = q.getDocument().createText('');
m.insertAfter(q);
return m;
}
var n = q.getDocument(),
o = new d.text(q.$.splitText(l), n);
if (b.ie8) {
var p = new d.text('', n);
p.insertAfter(o);
p.remove();
}
return o;
},
substring: function(l, m) {
if (typeof m != 'number') return this.$.nodeValue.substr(l);
else return this.$.nodeValue.substring(l, m);
}
});
d.documentFragment = function(l) {
l = l || a.document;
this.$ = l.$.createDocumentFragment();
};
e.extend(d.documentFragment.prototype, h.prototype, {
type: 11,
insertAfterNode: function(l) {
l = l.$;
l.parentNode.insertBefore(this.$, l.nextSibling);
}
}, true, {
append: 1,
appendBogus: 1,
getFirst: 1,
getLast: 1,
appendTo: 1,
moveChildren: 1,
insertBefore: 1,
insertAfterNode: 1,
replace: 1,
trim: 1,
type: 1,
ltrim: 1,
rtrim: 1,
getDocument: 1,
getChildCount: 1,
getChild: 1,
getChildren: 1
});
(function() {
function l(s, t) {
if (this._.end) return null;
var u, v = this.range,
w, x = this.guard,
y = this.type,
z = s ? 'getPreviousSourceNode' : 'getNextSourceNode';
if (!this._.start) {
this._.start = 1;
v.trim();
if (v.collapsed) {
this.end();
return null;
}
}
if (!s && !this._.guardLTR) {
var A = v.endContainer,
B = A.getChild(v.endOffset);
this._.guardLTR = function(F, G) {
return (!G || !A.equals(F)) && (!B || !F.equals(B)) && (F.type != 1 || !G || F.getName() != 'body');
};
}
if (s && !this._.guardRTL) {
var C = v.startContainer,
D = v.startOffset > 0 && C.getChild(v.startOffset - 1);
this._.guardRTL = function(F, G) {
return (!G || !C.equals(F)) && (!D || !F.equals(D)) && (F.type != 1 || !G || F.getName() != 'body');
};
}
var E = s ? this._.guardRTL : this._.guardLTR;
if (x) w = function(F, G) {
if (E(F, G) === false) return false;
return x(F, G);
};
else w = E;
if (this.current) u = this.current[z](false, y, w);
else if (s) {
u = v.endContainer;
if (v.endOffset > 0) {
u = u.getChild(v.endOffset - 1);
if (w(u) === false) u = null;
} else u = w(u, true) === false ? null : u.getPreviousSourceNode(true, y, w);
} else {
u = v.startContainer;
u = u.getChild(v.startOffset);
if (u) {
if (w(u) === false) u = null;
} else u = w(v.startContainer, true) === false ? null : v.startContainer.getNextSourceNode(true, y, w);
}
while (u && !this._.end) {
this.current = u;
if (!this.evaluator || this.evaluator(u) !== false) {
if (!t) return u;
} else if (t && this.evaluator) return false;
u = u[z](false, y, w);
}
this.end();
return this.current = null;
};
function m(s) {
var t, u = null;
while (t = l.call(this, s)) u = t;
return u;
};
d.walker = e.createClass({
$: function(s) {
this.range = s;
this._ = {};
},
proto: {
end: function() {
this._.end = 1;
},
next: function() {
return l.call(this);
},
previous: function() {
return l.call(this, 1);
},
checkForward: function() {
return l.call(this, 0, 1) !== false;
},
checkBackward: function() {
return l.call(this, 1, 1) !== false;
},
lastForward: function() {
return m.call(this);
},
lastBackward: function() {
return m.call(this, 1);
},
reset: function() {
delete this.current;
this._ = {};
}
}
});
var n = {
block: 1,
'list-item': 1,
table: 1,
'table-row-group': 1,
'table-header-group': 1,
'table-footer-group': 1,
'table-row': 1,
'table-column-group': 1,
'table-column': 1,
'table-cell': 1,
'table-caption': 1
};
h.prototype.isBlockBoundary = function(s) {
var t = s ? e.extend({}, f.$block, s || {}) : f.$block;
return this.getComputedStyle('float') == 'none' && n[this.getComputedStyle('display')] || t[this.getName()];
};
d.walker.blockBoundary = function(s) {
return function(t, u) {
return !(t.type == 1 && t.isBlockBoundary(s));
};
};
d.walker.listItemBoundary = function() {
return this.blockBoundary({
br: 1
});
};
d.walker.bookmark = function(s, t) {
function u(v) {
return v && v.getName && v.getName() == 'span' && v.data('cke-bookmark');
};
return function(v) {
var w, x;
w = v && !v.getName && (x = v.getParent()) && u(x);
w = s ? w : w || u(v);
return !!(t ^ w);
};
};
d.walker.whitespaces = function(s) {
return function(t) {
var u = t && t.type == 3 && !e.trim(t.getText());
return !!(s ^ u);
};
};
d.walker.invisible = function(s) {
var t = d.walker.whitespaces();
return function(u) {
var v = t(u) || u.is && !u.$.offsetHeight;
return !!(s ^ v);
};
};
d.walker.nodeType = function(s, t) {
return function(u) {
return !!(t ^ u.type == s);
};
};
var o = /^[\t\r\n ]*(?: |\xa0)$/,
p = d.walker.whitespaces(),
q = d.walker.bookmark(),
r = function(s) {
return q(s) || p(s) || s.type == 1 && s.getName() in f.$inline && !(s.getName() in f.$empty);
};
h.prototype.getBogus = function() {
var s = this;
do s = s.getPreviousSourceNode(); while (r(s));
if (s && (!c ? s.is && s.is('br') : s.getText && o.test(s.getText()))) return s;
return false;
};
})();
d.range = function(l) {
var m = this;
m.startContainer = null;
m.startOffset = null;
m.endContainer = null;
m.endOffset = null;
m.collapsed = true;
m.document = l;
};
(function() {
var l = function(t) {
t.collapsed = t.startContainer && t.endContainer && t.startContainer.equals(t.endContainer) && t.startOffset == t.endOffset;
},
m = function(t, u, v, w) {
t.optimizeBookmark();
var x = t.startContainer,
y = t.endContainer,
z = t.startOffset,
A = t.endOffset,
B, C;
if (y.type == 3) y = y.split(A);
else if (y.getChildCount() > 0)
if (A >= y.getChildCount()) {
y = y.append(t.document.createText(''));
C = true;
} else y = y.getChild(A);
if (x.type == 3) {
x.split(z);
if (x.equals(y)) y = x.getNext();
} else if (!z) {
x = x.getFirst().insertBeforeMe(t.document.createText(''));
B = true;
} else if (z >= x.getChildCount()) {
x = x.append(t.document.createText(''));
B = true;
} else x = x.getChild(z).getPrevious();
var D = x.getParents(),
E = y.getParents(),
F, G, H;
for (F = 0; F < D.length; F++) {
G = D[F];
H = E[F];
if (!G.equals(H)) break;
}
var I = v,
J, K, L, M;
for (var N = F; N < D.length; N++) {
J = D[N];
if (I && !J.equals(x)) K = I.append(J.clone());
L = J.getNext();
while (L) {
if (L.equals(E[N]) || L.equals(y)) break;
M = L.getNext();
if (u == 2) I.append(L.clone(true));
else {
L.remove();
if (u == 1) I.append(L);
}
L = M;
}
if (I) I = K;
}
I = v;
for (var O = F; O < E.length; O++) {
J = E[O];
if (u > 0 && !J.equals(y)) K = I.append(J.clone());
if (!D[O] || J.$.parentNode != D[O].$.parentNode) {
L = J.getPrevious();
while (L) {
if (L.equals(D[O]) || L.equals(x)) break;
M = L.getPrevious();
if (u == 2) I.$.insertBefore(L.$.cloneNode(true), I.$.firstChild);
else {
L.remove();
if (u == 1) I.$.insertBefore(L.$, I.$.firstChild);
}
L = M;
}
}
if (I) I = K;
}
if (u == 2) {
var P = t.startContainer;
if (P.type == 3) {
P.$.data += P.$.nextSibling.data;
P.$.parentNode.removeChild(P.$.nextSibling);
}
var Q = t.endContainer;
if (Q.type == 3 && Q.$.nextSibling) {
Q.$.data += Q.$.nextSibling.data;
Q.$.parentNode.removeChild(Q.$.nextSibling);
}
} else {
if (G && H && (x.$.parentNode != G.$.parentNode || y.$.parentNode != H.$.parentNode)) {
var R = H.getIndex();
if (B && H.$.parentNode == x.$.parentNode) R--;
if (w && G.type == 1) {
var S = h.createFromHtml('', t.document);
S.insertAfter(G);
G.mergeSiblings(false);
t.moveToBookmark({
startNode: S
});
} else t.setStart(H.getParent(), R);
}
t.collapse(true);
}
if (B) x.remove();
if (C && y.$.parentNode) y.remove();
},
n = {
abbr: 1,
acronym: 1,
b: 1,
bdo: 1,
big: 1,
cite: 1,
code: 1,
del: 1,
dfn: 1,
em: 1,
font: 1,
i: 1,
ins: 1,
label: 1,
kbd: 1,
q: 1,
samp: 1,
small: 1,
span: 1,
strike: 1,
strong: 1,
sub: 1,
sup: 1,
tt: 1,
u: 1,
'var': 1
};
function o(t) {
var u = false,
v = d.walker.bookmark(true);
return function(w) {
if (v(w)) return true;
if (w.type == 3) {
if (w.hasAscendant('pre') || e.trim(w.getText()).length) return false;
} else if (w.type == 1)
if (!n[w.getName()])
if (!t && !c && w.getName() == 'br' && !u) u = true;
else return false;
return true;
};
};
function p(t) {
return t.type != 3 && t.getName() in f.$removeEmpty || !e.trim(t.getText()) || !!t.getParent().data('cke-bookmark');
};
var q = new d.walker.whitespaces(),
r = new d.walker.bookmark();
function s(t) {
return !q(t) && !r(t);
};
d.range.prototype = {
clone: function() {
var u = this;
var t = new d.range(u.document);
t.startContainer = u.startContainer;
t.startOffset = u.startOffset;
t.endContainer = u.endContainer;
t.endOffset = u.endOffset;
t.collapsed = u.collapsed;
return t;
},
collapse: function(t) {
var u = this;
if (t) {
u.endContainer = u.startContainer;
u.endOffset = u.startOffset;
} else {
u.startContainer = u.endContainer;
u.startOffset = u.endOffset;
}
u.collapsed = true;
},
cloneContents: function() {
var t = new d.documentFragment(this.document);
if (!this.collapsed) m(this, 2, t);
return t;
},
deleteContents: function(t) {
if (this.collapsed) return;
m(this, 0, null, t);
},
extractContents: function(t) {
var u = new d.documentFragment(this.document);
if (!this.collapsed) m(this, 1, u, t);
return u;
},
createBookmark: function(t) {
var z = this;
var u, v, w, x, y = z.collapsed;
u = z.document.createElement('span');
u.data('cke-bookmark', 1);
u.setStyle('display', 'none');
u.setHtml(' ');
if (t) {
w = 'cke_bm_' + e.getNextNumber();
u.setAttribute('id', w + 'S');
}
if (!y) {
v = u.clone();
v.setHtml(' ');
if (t) v.setAttribute('id', w + 'E');
x = z.clone();
x.collapse();
x.insertNode(v);
}
x = z.clone();
x.collapse(true);
x.insertNode(u);
if (v) {
z.setStartAfter(u);
z.setEndBefore(v);
} else z.moveToPosition(u, 4);
return {
startNode: t ? w + 'S' : u,
endNode: t ? w + 'E' : v,
serializable: t,
collapsed: y
};
},
createBookmark2: function(t) {
var B = this;
var u = B.startContainer,
v = B.endContainer,
w = B.startOffset,
x = B.endOffset,
y = B.collapsed,
z, A;
if (!u || !v) return {
start: 0,
end: 0
};
if (t) {
if (u.type == 1) {
z = u.getChild(w);
if (z && z.type == 3 && w > 0 && z.getPrevious().type == 3) {
u = z;
w = 0;
}
if (z && z.type == 1) w = z.getIndex(1);
}
while (u.type == 3 && (A = u.getPrevious()) && A.type == 3) {
u = A;
w += A.getLength();
}
if (!y) {
if (v.type == 1) {
z = v.getChild(x);
if (z && z.type == 3 && x > 0 && z.getPrevious().type == 3) {
v = z;
x = 0;
}
if (z && z.type == 1) x = z.getIndex(1);
}
while (v.type == 3 && (A = v.getPrevious()) && A.type == 3) {
v = A;
x += A.getLength();
}
}
}
return {
start: u.getAddress(t),
end: y ? null : v.getAddress(t),
startOffset: w,
endOffset: x,
normalized: t,
collapsed: y,
is2: true
};
},
moveToBookmark: function(t) {
var B = this;
if (t.is2) {
var u = B.document.getByAddress(t.start, t.normalized),
v = t.startOffset,
w = t.end && B.document.getByAddress(t.end, t.normalized),
x = t.endOffset;
B.setStart(u, v);
if (w) B.setEnd(w, x);
else B.collapse(true);
} else {
var y = t.serializable,
z = y ? B.document.getById(t.startNode) : t.startNode,
A = y ? B.document.getById(t.endNode) : t.endNode;
B.setStartBefore(z);
z.remove();
if (A) {
B.setEndBefore(A);
A.remove();
} else B.collapse(true);
}
},
getBoundaryNodes: function() {
var y = this;
var t = y.startContainer,
u = y.endContainer,
v = y.startOffset,
w = y.endOffset,
x;
if (t.type == 1) {
x = t.getChildCount();
if (x > v) t = t.getChild(v);
else if (x < 1) t = t.getPreviousSourceNode();
else {
t = t.$;
while (t.lastChild) t = t.lastChild;
t = new d.node(t);
t = t.getNextSourceNode() || t;
}
}
if (u.type == 1) {
x = u.getChildCount();
if (x > w) u = u.getChild(w).getPreviousSourceNode(true);
else if (x < 1) u = u.getPreviousSourceNode();
else {
u = u.$;
while (u.lastChild) u = u.lastChild;
u = new d.node(u);
}
}
if (t.getPosition(u) & 2) t = u;
return {
startNode: t,
endNode: u
};
},
getCommonAncestor: function(t, u) {
var y = this;
var v = y.startContainer,
w = y.endContainer,
x;
if (v.equals(w)) {
if (t && v.type == 1 && y.startOffset == y.endOffset - 1) x = v.getChild(y.startOffset);
else x = v;
} else x = v.getCommonAncestor(w);
return u && !x.is ? x.getParent() : x;
},
optimize: function() {
var v = this;
var t = v.startContainer,
u = v.startOffset;
if (t.type != 1)
if (!u) v.setStartBefore(t);
else if (u >= t.getLength()) v.setStartAfter(t);
t = v.endContainer;
u = v.endOffset;
if (t.type != 1)
if (!u) v.setEndBefore(t);
else if (u >= t.getLength()) v.setEndAfter(t);
},
optimizeBookmark: function() {
var v = this;
var t = v.startContainer,
u = v.endContainer;
if (t.is && t.is('span') && t.data('cke-bookmark')) v.setStartAt(t, 3);
if (u && u.is && u.is('span') && u.data('cke-bookmark')) v.setEndAt(u, 4);
},
trim: function(t, u) {
var B = this;
var v = B.startContainer,
w = B.startOffset,
x = B.collapsed;
if ((!t || x) && v && v.type == 3) {
if (!w) {
w = v.getIndex();
v = v.getParent();
} else if (w >= v.getLength()) {
w = v.getIndex() + 1;
v = v.getParent();
} else {
var y = v.split(w);
w = v.getIndex() + 1;
v = v.getParent();
if (B.startContainer.equals(B.endContainer)) B.setEnd(y, B.endOffset - B.startOffset);
else if (v.equals(B.endContainer)) B.endOffset += 1;
}
B.setStart(v, w);
if (x) {
B.collapse(true);
return;
}
}
var z = B.endContainer,
A = B.endOffset;
if (!(u || x) && z && z.type == 3) {
if (!A) {
A = z.getIndex();
z = z.getParent();
} else if (A >= z.getLength()) {
A = z.getIndex() + 1;
z = z.getParent();
} else {
z.split(A);
A = z.getIndex() + 1;
z = z.getParent();
}
B.setEnd(z, A);
}
},
enlarge: function(t, u) {
switch (t) {
case 1:
if (this.collapsed) return;
var v = this.getCommonAncestor(),
w = this.document.getBody(),
x, y, z, A, B, C = false,
D, E, F = this.startContainer,
G = this.startOffset;
if (F.type == 3) {
if (G) {
F = !e.trim(F.substring(0, G)).length && F;
C = !!F;
}
if (F)
if (!(A = F.getPrevious())) z = F.getParent();
} else {
if (G) A = F.getChild(G - 1) || F.getLast();
if (!A) z = F;
}
while (z || A) {
if (z && !A) {
if (!B && z.equals(v)) B = true;
if (!w.contains(z)) break;
if (!C || z.getComputedStyle('display') != 'inline') {
C = false;
if (B) x = z;
else this.setStartBefore(z);
}
A = z.getPrevious();
}
while (A) {
D = false;
if (A.type == 3) {
E = A.getText();
if (/[^\s\ufeff]/.test(E)) A = null;
D = /[\s\ufeff]$/.test(E);
} else if ((A.$.offsetWidth > 0 || u && A.is('br')) && !A.data('cke-bookmark'))
if (C && f.$removeEmpty[A.getName()]) {
E = A.getText();
if (/[^\s\ufeff]/.test(E)) A = null;
else {
var H = A.$.all || A.$.getElementsByTagName('*');
for (var I = 0, J; J = H[I++];) {
if (!f.$removeEmpty[J.nodeName.toLowerCase()]) {
A = null;
break;
}
}
}
if (A) D = !!E.length;
} else A = null;
if (D)
if (C) {
if (B) x = z;
else if (z) this.setStartBefore(z);
} else C = true;
if (A) {
var K = A.getPrevious();
if (!z && !K) {
z = A;
A = null;
break;
}
A = K;
} else z = null;
}
if (z) z = z.getParent();
}
F = this.endContainer;
G = this.endOffset;
z = A = null;
B = C = false;
if (F.type == 3) {
F = !e.trim(F.substring(G)).length && F;
C = !(F && F.getLength());
if (F)
if (!(A = F.getNext())) z = F.getParent();
} else {
A = F.getChild(G);
if (!A) z = F;
}
while (z || A) {
if (z && !A) {
if (!B && z.equals(v)) B = true;
if (!w.contains(z)) break;
if (!C || z.getComputedStyle('display') != 'inline') {
C = false;
if (B) y = z;
else if (z) this.setEndAfter(z);
}
A = z.getNext();
}
while (A) {
D = false;
if (A.type == 3) {
E = A.getText();
if (/[^\s\ufeff]/.test(E)) A = null;
D = /^[\s\ufeff]/.test(E);
} else if ((A.$.offsetWidth > 0 || u && A.is('br')) && !A.data('cke-bookmark'))
if (C && f.$removeEmpty[A.getName()]) {
E = A.getText();
if (/[^\s\ufeff]/.test(E)) A = null;
else {
H = A.$.all || A.$.getElementsByTagName('*');
for (I = 0; J = H[I++];) {
if (!f.$removeEmpty[J.nodeName.toLowerCase()]) {
A = null;
break;
}
}
}
if (A) D = !!E.length;
} else A = null;
if (D)
if (C)
if (B) y = z;
else this.setEndAfter(z);
if (A) {
K = A.getNext();
if (!z && !K) {
z = A;
A = null;
break;
}
A = K;
} else z = null;
}
if (z) z = z.getParent();
}
if (x && y) {
v = x.contains(y) ? y : x;
this.setStartBefore(v);
this.setEndAfter(v);
}
break;
case 2:
case 3:
var L = new d.range(this.document);
w = this.document.getBody();
L.setStartAt(w, 1);
L.setEnd(this.startContainer, this.startOffset);
var M = new d.walker(L),
N, O, P = d.walker.blockBoundary(t == 3 ? {
br: 1
} : null),
Q = function(S) {
var T = P(S);
if (!T) N = S;
return T;
},
R = function(S) {
var T = Q(S);
if (!T && S.is && S.is('br')) O = S;
return T;
};
M.guard = Q;
z = M.lastBackward();
N = N || w;
this.setStartAt(N, !N.is('br') && (!z && this.checkStartOfBlock() || z && N.contains(z)) ? 1 : 4);
L = this.clone();
L.collapse();
L.setEndAt(w, 2);
M = new d.walker(L);
M.guard = t == 3 ? R : Q;
N = null;
z = M.lastForward();
N = N || w;
this.setEndAt(N, !z && this.checkEndOfBlock() || z && N.contains(z) ? 2 : 3);
if (O) this.setEndAfter(O);
}
},
shrink: function(t, u) {
if (!this.collapsed) {
t = t || 2;
var v = this.clone(),
w = this.startContainer,
x = this.endContainer,
y = this.startOffset,
z = this.endOffset,
A = this.collapsed,
B = 1,
C = 1;
if (w && w.type == 3)
if (!y) v.setStartBefore(w);
else if (y >= w.getLength()) v.setStartAfter(w);
else {
v.setStartBefore(w);
B = 0;
}
if (x && x.type == 3)
if (!z) v.setEndBefore(x);
else if (z >= x.getLength()) v.setEndAfter(x);
else {
v.setEndAfter(x);
C = 0;
}
var D = new d.walker(v),
E = d.walker.bookmark();
D.evaluator = function(I) {
return I.type == (t == 1 ? 1 : 3);
};
var F;
D.guard = function(I, J) {
if (E(I)) return true;
if (t == 1 && I.type == 3) return false;
if (J && I.equals(F)) return false;
if (!J && I.type == 1) F = I;
return true;
};
if (B) {
var G = D[t == 1 ? 'lastForward' : 'next']();
G && this.setStartAt(G, u ? 1 : 3);
}
if (C) {
D.reset();
var H = D[t == 1 ? 'lastBackward' : 'previous']();
H && this.setEndAt(H, u ? 2 : 4);
}
return !!(B || C);
}
},
insertNode: function(t) {
var x = this;
x.optimizeBookmark();
x.trim(false, true);
var u = x.startContainer,
v = x.startOffset,
w = u.getChild(v);
if (w) t.insertBefore(w);
else u.append(t);
if (t.getParent().equals(x.endContainer)) x.endOffset++;
x.setStartBefore(t);
},
moveToPosition: function(t, u) {
this.setStartAt(t, u);
this.collapse(true);
},
selectNodeContents: function(t) {
this.setStart(t, 0);
this.setEnd(t, t.type == 3 ? t.getLength() : t.getChildCount());
},
setStart: function(t, u) {
var v = this;
if (t.type == 1 && f.$empty[t.getName()]) u = t.getIndex(), t = t.getParent();
v.startContainer = t;
v.startOffset = u;
if (!v.endContainer) {
v.endContainer = t;
v.endOffset = u;
}
l(v);
},
setEnd: function(t, u) {
var v = this;
if (t.type == 1 && f.$empty[t.getName()]) u = t.getIndex() + 1, t = t.getParent();
v.endContainer = t;
v.endOffset = u;
if (!v.startContainer) {
v.startContainer = t;
v.startOffset = u;
}
l(v);
},
setStartAfter: function(t) {
this.setStart(t.getParent(), t.getIndex() + 1);
},
setStartBefore: function(t) {
this.setStart(t.getParent(), t.getIndex());
},
setEndAfter: function(t) {
this.setEnd(t.getParent(), t.getIndex() + 1);
},
setEndBefore: function(t) {
this.setEnd(t.getParent(), t.getIndex());
},
setStartAt: function(t, u) {
var v = this;
switch (u) {
case 1:
v.setStart(t, 0);
break;
case 2:
if (t.type == 3) v.setStart(t, t.getLength());
else v.setStart(t, t.getChildCount());
break;
case 3:
v.setStartBefore(t);
break;
case 4:
v.setStartAfter(t);
}
l(v);
},
setEndAt: function(t, u) {
var v = this;
switch (u) {
case 1:
v.setEnd(t, 0);
break;
case 2:
if (t.type == 3) v.setEnd(t, t.getLength());
else v.setEnd(t, t.getChildCount());
break;
case 3:
v.setEndBefore(t);
break;
case 4:
v.setEndAfter(t);
}
l(v);
},
fixBlock: function(t, u) {
var x = this;
var v = x.createBookmark(),
w = x.document.createElement(u);
x.collapse(t);
x.enlarge(2);
x.extractContents().appendTo(w);
w.trim();
if (!c) w.appendBogus();
x.insertNode(w);
x.moveToBookmark(v);
return w;
},
splitBlock: function(t) {
var D = this;
var u = new d.elementPath(D.startContainer),
v = new d.elementPath(D.endContainer),
w = u.blockLimit,
x = v.blockLimit,
y = u.block,
z = v.block,
A = null;
if (!w.equals(x)) return null;
if (t != 'br') {
if (!y) {
y = D.fixBlock(true, t);
z = new d.elementPath(D.endContainer).block;
}
if (!z) z = D.fixBlock(false, t);
}
var B = y && D.checkStartOfBlock(),
C = z && D.checkEndOfBlock();
D.deleteContents();
if (y && y.equals(z))
if (C) {
A = new d.elementPath(D.startContainer);
D.moveToPosition(z, 4);
z = null;
} else if (B) {
A = new d.elementPath(D.startContainer);
D.moveToPosition(y, 3);
y = null;
} else {
z = D.splitElement(y);
if (!c && !y.is('ul', 'ol')) y.appendBogus();
}
return {
previousBlock: y,
nextBlock: z,
wasStartOfBlock: B,
wasEndOfBlock: C,
elementPath: A
};
},
splitElement: function(t) {
var w = this;
if (!w.collapsed) return null;
w.setEndAt(t, 2);
var u = w.extractContents(),
v = t.clone(false);
u.appendTo(v);
v.insertAfter(t);
w.moveToPosition(t, 4);
return v;
},
checkBoundaryOfElement: function(t, u) {
var v = u == 1,
w = this.clone();
w.collapse(v);
w[v ? 'setStartAt' : 'setEndAt'](t, v ? 1 : 2);
var x = new d.walker(w);
x.evaluator = p;
return x[v ? 'checkBackward' : 'checkForward']();
},
checkStartOfBlock: function() {
var z = this;
var t = z.startContainer,
u = z.startOffset;
if (u && t.type == 3) {
var v = e.ltrim(t.substring(0, u));
if (v.length) return false;
}
z.trim();
var w = new d.elementPath(z.startContainer),
x = z.clone();
x.collapse(true);
x.setStartAt(w.block || w.blockLimit, 1);
var y = new d.walker(x);
y.evaluator = o(true);
return y.checkBackward();
},
checkEndOfBlock: function() {
var z = this;
var t = z.endContainer,
u = z.endOffset;
if (t.type == 3) {
var v = e.rtrim(t.substring(u));
if (v.length) return false;
}
z.trim();
var w = new d.elementPath(z.endContainer),
x = z.clone();
x.collapse(false);
x.setEndAt(w.block || w.blockLimit, 2);
var y = new d.walker(x);
y.evaluator = o(false);
return y.checkForward();
},
checkReadOnly: (function() {
function t(u, v) {
while (u) {
if (u.type == 1)
if (u.getAttribute('contentEditable') == 'false' && !u.data('cke-editable')) return 0;
else if (u.is('html') || u.getAttribute('contentEditable') == 'true' && (u.contains(v) || u.equals(v))) break;
u = u.getParent();
}
return 1;
};
return function() {
var u = this.startContainer,
v = this.endContainer;
return !(t(u, v) && t(v, u));
};
})(),
moveToElementEditablePosition: function(t, u) {
var v;
if (f.$empty[t.getName()]) return false;
while (t && t.type == 1) {
v = t.isEditable();
if (v) this.moveToPosition(t, u ? 2 : 1);
else if (f.$inline[t.getName()]) {
this.moveToPosition(t, u ? 4 : 3);
return true;
}
if (f.$empty[t.getName()]) t = t[u ? 'getPrevious' : 'getNext'](s);
else t = t[u ? 'getLast' : 'getFirst'](s);
if (t && t.type == 3) {
this.moveToPosition(t, u ? 4 : 3);
return true;
}
}
return v;
},
moveToElementEditStart: function(t) {
return this.moveToElementEditablePosition(t);
},
moveToElementEditEnd: function(t) {
return this.moveToElementEditablePosition(t, true);
},
getEnclosedNode: function() {
var t = this.clone();
t.optimize();
if (t.startContainer.type != 1 || t.endContainer.type != 1) return null;
var u = new d.walker(t),
v = d.walker.bookmark(true),
w = d.walker.whitespaces(true),
x = function(z) {
return w(z) && v(z);
};
t.evaluator = x;
var y = u.next();
u.reset();
return y && y.equals(u.previous()) ? y : null;
},
getTouchedStartNode: function() {
var t = this.startContainer;
if (this.collapsed || t.type != 1) return t;
return t.getChild(this.startOffset) || t;
},
getTouchedEndNode: function() {
var t = this.endContainer;
if (this.collapsed || t.type != 1) return t;
return t.getChild(this.endOffset - 1) || t;
}
};
})();
a.POSITION_AFTER_START = 1;
a.POSITION_BEFORE_END = 2;
a.POSITION_BEFORE_START = 3;
a.POSITION_AFTER_END = 4;
a.ENLARGE_ELEMENT = 1;
a.ENLARGE_BLOCK_CONTENTS = 2;
a.ENLARGE_LIST_ITEM_CONTENTS = 3;
a.START = 1;
a.END = 2;
a.STARTEND = 3;
a.SHRINK_ELEMENT = 1;
a.SHRINK_TEXT = 2;
(function() {
d.rangeList = function(n) {
if (n instanceof d.rangeList) return n;
if (!n) n = [];
else if (n instanceof d.range) n = [n];
return e.extend(n, l);
};
var l = {
createIterator: function() {
var n = this,
o = d.walker.bookmark(),
p = function(s) {
return !(s.is && s.is('tr'));
},
q = [],
r;
return {
getNextRange: function(s) {
r = r == undefined ? 0 : r + 1;
var t = n[r];
if (t && n.length > 1) {
if (!r)
for (var u = n.length - 1; u >= 0; u--) q.unshift(n[u].createBookmark(true));
if (s) {
var v = 0;
while (n[r + v + 1]) {
var w = t.document,
x = 0,
y = w.getById(q[v].endNode),
z = w.getById(q[v + 1].startNode),
A;
while (1) {
A = y.getNextSourceNode(false);
if (!z.equals(A)) {
if (o(A) || A.type == 1 && A.isBlockBoundary()) {
y = A;
continue;
}
} else x = 1;
break;
}
if (!x) break;
v++;
}
}
t.moveToBookmark(q.shift());
while (v--) {
A = n[++r];
A.moveToBookmark(q.shift());
t.setEnd(A.endContainer, A.endOffset);
}
}
return t;
}
};
},
createBookmarks: function(n) {
var s = this;
var o = [],
p;
for (var q = 0; q < s.length; q++) {
o.push(p = s[q].createBookmark(n, true));
for (var r = q + 1; r < s.length; r++) {
s[r] = m(p, s[r]);
s[r] = m(p, s[r], true);
}
}
return o;
},
createBookmarks2: function(n) {
var o = [];
for (var p = 0; p < this.length; p++) o.push(this[p].createBookmark2(n));
return o;
},
moveToBookmarks: function(n) {
for (var o = 0; o < this.length; o++) this[o].moveToBookmark(n[o]);
}
};
function m(n, o, p) {
var q = n.serializable,
r = o[p ? 'endContainer' : 'startContainer'],
s = p ? 'endOffset' : 'startOffset',
t = q ? o.document.getById(n.startNode) : n.startNode,
u = q ? o.document.getById(n.endNode) : n.endNode;
if (r.equals(t.getPrevious())) {
o.startOffset = o.startOffset - r.getLength() - u.getPrevious().getLength();
r = u.getNext();
} else if (r.equals(u.getPrevious())) {
o.startOffset = o.startOffset - r.getLength();
r = u.getNext();
}
r.equals(t.getParent()) && o[s]++;
r.equals(u.getParent()) && o[s]++;
o[p ? 'endContainer' : 'startContainer'] = r;
return o;
};
})();
(function() {
if (b.webkit) {
b.hc = false;
return;
}
var l = h.createFromHtml('', a.document);
l.appendTo(a.document.getHead());
try {
b.hc = l.getComputedStyle('border-top-color') == l.getComputedStyle('border-right-color');
} catch (m) {
b.hc = false;
}
if (b.hc) b.cssClass += ' cke_hc';
l.remove();
})();
j.load(i.corePlugins.split(','), function() {
a.status = 'loaded';
a.fire('loaded');
var l = a._.pending;
if (l) {
delete a._.pending;
for (var m = 0; m < l.length; m++) a.add(l[m]);
}
});
if (c) try {
document.execCommand('BackgroundImageCache', false, true);
} catch (l) {}
a.skins.add('kama', (function() {
var m = 'cke_ui_color';
return {
editor: {
css: ['editor.css']
},
dialog: {
css: ['dialog.css']
},
richcombo: {
canGroup: false
},
templates: {
css: ['templates.css']
},
margins: [0, 0, 0, 0],
init: function(n) {
if (n.config.width && !isNaN(n.config.width)) n.config.width -= 12;
var o = [],
p = /\$color/g,
q = '/* UI Color Support */.cke_skin_kama .cke_menuitem .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:active .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover .cke_label,.cke_skin_kama .cke_menuitem a:focus .cke_label,.cke_skin_kama .cke_menuitem a:active .cke_label{\tbackground-color: $color !important;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_label{\tbackground-color: transparent !important;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a.cke_disabled .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuseparator{\tbackground-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover,.cke_skin_kama .cke_menuitem a:focus,.cke_skin_kama .cke_menuitem a:active{\tbackground-color: $color !important;}';
if (b.webkit) {
q = q.split('}').slice(0, -1);
for (var r = 0; r < q.length; r++) q[r] = q[r].split('{');
}
function s(v) {
var w = v.getById(m);
if (!w) {
w = v.getHead().append('style');
w.setAttribute('id', m);
w.setAttribute('type', 'text/css');
}
return w;
};
function t(v, w, x) {
var y, z, A;
for (var B = 0; B < v.length; B++) {
if (b.webkit)
for (z = 0; z < w.length; z++) {
A = w[z][1];
for (y = 0; y < x.length; y++) A = A.replace(x[y][0], x[y][1]);
v[B].$.sheet.addRule(w[z][0], A);
} else {
A = w;
for (y = 0; y < x.length; y++) A = A.replace(x[y][0], x[y][1]);
if (c) v[B].$.styleSheet.cssText += A;
else v[B].$.innerHTML += A;
}
}
};
var u = /\$color/g;
e.extend(n, {
uiColor: null,
getUiColor: function() {
return this.uiColor;
},
setUiColor: function(v) {
var w, x = s(a.document),
y = '.' + n.id,
z = [y + ' .cke_wrapper', y + '_dialog .cke_dialog_contents', y + '_dialog a.cke_dialog_tab', y + '_dialog .cke_dialog_footer'].join(','),
A = 'background-color: $color !important;';
if (b.webkit) w = [
[z, A]
];
else w = z + '{' + A + '}';
return (this.setUiColor = function(B) {
var C = [
[u, B]
];
n.uiColor = B;
t([x], w, C);
t(o, q, C);
})(v);
}
});
n.on('menuShow', function(v) {
var w = v.data[0],
x = w.element.getElementsByTag('iframe').getItem(0).getFrameDocument();
if (!x.getById('cke_ui_color')) {
var y = s(x);
o.push(y);
var z = n.getUiColor();
if (z) t([y], q, [
[u, z]
]);
}
});
if (n.config.uiColor) n.setUiColor(n.config.uiColor);
}
};
})());
(function() {
a.dialog ? m() : a.on('dialogPluginReady', m);
function m() {
a.dialog.on('resize', function(n) {
var o = n.data,
p = o.width,
q = o.height,
r = o.dialog,
s = r.parts.contents;
if (o.skin != 'kama') return;
s.setStyles({
width: p + 'px',
height: q + 'px'
});
});
};
})();
j.add('about', {
requires: ['dialog'],
init: function(m) {
var n = m.addCommand('about', new a.dialogCommand('about'));
n.modes = {
wysiwyg: 1,
source: 1
};
n.canUndo = false;
n.readOnly = 1;
m.ui.addButton('About', {
label: m.lang.about.title,
command: 'about'
});
a.dialog.add('about', this.path + 'dialogs/about.js');
}
});
(function() {
var m = 'a11yhelp',
n = 'a11yHelp';
j.add(m, {
availableLangs: {
en: 1,
he: 1
},
init: function(o) {
var p = this;
o.addCommand(n, {
exec: function() {
var q = o.langCode;
q = p.availableLangs[q] ? q : 'en';
a.scriptLoader.load(a.getUrl(p.path + 'lang/' + q + '.js'), function() {
e.extend(o.lang, p.langEntries[q]);
o.openDialog(n);
});
},
modes: {
wysiwyg: 1,
source: 1
},
readOnly: 1,
canUndo: false
});
a.dialog.add(n, this.path + 'dialogs/a11yhelp.js');
}
});
})();
j.add('basicstyles', {
requires: ['styles', 'button'],
init: function(m) {
var n = function(q, r, s, t) {
var u = new a.style(t);
m.attachStyleStateChange(u, function(v) {
!m.readOnly && m.getCommand(s).setState(v);
});
m.addCommand(s, new a.styleCommand(u));
m.ui.addButton(q, {
label: r,
command: s
});
},
o = m.config,
p = m.lang;
n('Bold', p.bold, 'bold', o.coreStyles_bold);
n('Italic', p.italic, 'italic', o.coreStyles_italic);
n('Underline', p.underline, 'underline', o.coreStyles_underline);
n('Strike', p.strike, 'strike', o.coreStyles_strike);
n('Subscript', p.subscript, 'subscript', o.coreStyles_subscript);
n('Superscript', p.superscript, 'superscript', o.coreStyles_superscript);
}
});
i.coreStyles_bold = {
element: 'strong',
overrides: 'b'
};
i.coreStyles_italic = {
element: 'em',
overrides: 'i'
};
i.coreStyles_underline = {
element: 'u'
};
i.coreStyles_strike = {
element: 'strike'
};
i.coreStyles_subscript = {
element: 'sub'
};
i.coreStyles_superscript = {
element: 'sup'
};
(function() {
var m = {
table: 1,
ul: 1,
ol: 1,
blockquote: 1,
div: 1
},
n = {},
o = {};
e.extend(n, m, {
tr: 1,
p: 1,
div: 1,
li: 1
});
e.extend(o, n, {
td: 1
});
function p(B) {
q(B);
r(B);
};
function q(B) {
var C = B.editor,
D = B.data.path;
if (C.readOnly) return;
var E = C.config.useComputedState,
F;
E = E === undefined || E;
if (!E) F = s(D.lastElement);
F = F || D.block || D.blockLimit;
F.is('body') && (F = C.getSelection().getRanges()[0].getEnclosedNode());
if (!F) return;
var G = E ? F.getComputedStyle('direction') : F.getStyle('direction') || F.getAttribute('dir');
C.getCommand('bidirtl').setState(G == 'rtl' ? 1 : 2);
C.getCommand('bidiltr').setState(G == 'ltr' ? 1 : 2);
};
function r(B) {
var C = B.editor,
D = B.data.path.block || B.data.path.blockLimit;
C.fire('contentDirChanged', D ? D.getComputedStyle('direction') : C.lang.dir);
};
function s(B) {
while (B && !(B.getName() in o || B.is('body'))) {
var C = B.getParent();
if (!C) break;
B = C;
}
return B;
};
function t(B, C, D, E) {
if (B.isReadOnly()) return;
h.setMarker(E, B, 'bidi_processed', 1);
var F = B;
while ((F = F.getParent()) && !F.is('body')) {
if (F.getCustomData('bidi_processed')) {
B.removeStyle('direction');
B.removeAttribute('dir');
return;
}
}
var G = 'useComputedState' in D.config ? D.config.useComputedState : 1,
H = G ? B.getComputedStyle('direction') : B.getStyle('direction') || B.hasAttribute('dir');
if (H == C) return;
B.removeStyle('direction');
if (G) {
B.removeAttribute('dir');
if (C != B.getComputedStyle('direction')) B.setAttribute('dir', C);
} else B.setAttribute('dir', C);
D.forceNextSelectionCheck();
};
function u(B, C, D) {
var E = B.getCommonAncestor(false, true);
B = B.clone();
B.enlarge(D == 2 ? 3 : 2);
if (B.checkBoundaryOfElement(E, 1) && B.checkBoundaryOfElement(E, 2)) {
var F;
while (E && E.type == 1 && (F = E.getParent()) && F.getChildCount() == 1 && !(E.getName() in C)) E = F;
return E.type == 1 && E.getName() in C && E;
}
};
function v(B) {
return function(C) {
var D = C.getSelection(),
E = C.config.enterMode,
F = D.getRanges();
if (F && F.length) {
var G = {},
H = D.createBookmarks(),
I = F.createIterator(),
J, K = 0;
while (J = I.getNextRange(1)) {
var L = J.getEnclosedNode();
if (!L || L && !(L.type == 1 && L.getName() in n)) L = u(J, m, E);
L && t(L, B, C, G);
var M, N, O = new d.walker(J),
P = H[K].startNode,
Q = H[K++].endNode;
O.evaluator = function(R) {
return !!(R.type == 1 && R.getName() in m && !(R.getName() == (E == 1 ? 'p' : 'div') && R.getParent().type == 1 && R.getParent().getName() == 'blockquote') && R.getPosition(P) & 2 && (R.getPosition(Q) & 4 + 16) == 4);
};
while (N = O.next()) t(N, B, C, G);
M = J.createIterator();
M.enlargeBr = E != 2;
while (N = M.getNextParagraph(E == 1 ? 'p' : 'div')) t(N, B, C, G);
}
h.clearAllMarkers(G);
C.forceNextSelectionCheck();
D.selectBookmarks(H);
C.focus();
}
};
};
j.add('bidi', {
requires: ['styles', 'button'],
init: function(B) {
var C = function(E, F, G, H) {
B.addCommand(G, new a.command(B, {
exec: H
}));
B.ui.addButton(E, {
label: F,
command: G
});
},
D = B.lang.bidi;
C('BidiLtr', D.ltr, 'bidiltr', v('ltr'));
C('BidiRtl', D.rtl, 'bidirtl', v('rtl'));
B.on('selectionChange', p);
B.on('contentDom', function() {
B.document.on('dirChanged', function(E) {
B.fire('dirChanged', {
node: E.data,
dir: E.data.getDirection(1)
});
});
});
}
});
function w(B) {
var C = B.getDocument().getBody().getParent();
while (B) {
if (B.equals(C)) return false;
B = B.getParent();
}
return true;
};
function x(B) {
var C = B == y.setAttribute,
D = B == y.removeAttribute,
E = /\bdirection\s*:\s*(.*?)\s*(:?$|;)/;
return function(F, G) {
var J = this;
if (!J.getDocument().equals(a.document)) {
var H;
if ((F == (C || D ? 'dir' : 'direction') || F == 'style' && (D || E.test(G))) && !w(J)) {
H = J.getDirection(1);
var I = B.apply(J, arguments);
if (H != J.getDirection(1)) {
J.getDocument().fire('dirChanged', J);
return I;
}
}
}
return B.apply(J, arguments);
};
};
var y = h.prototype,
z = ['setStyle', 'removeStyle', 'setAttribute', 'removeAttribute'];
for (var A = 0; A < z.length; A++) y[z[A]] = e.override(y[z[A]], x);
})();
(function() {
function m(q, r) {
var s = r.block || r.blockLimit;
if (!s || s.getName() == 'body') return 2;
if (s.getAscendant('blockquote', true)) return 1;
return 2;
};
function n(q) {
var r = q.editor;
if (r.readOnly) return;
var s = r.getCommand('blockquote');
s.state = m(r, q.data.path);
s.fire('state');
};
function o(q) {
for (var r = 0, s = q.getChildCount(), t; r < s && (t = q.getChild(r)); r++) {
if (t.type == 1 && t.isBlockBoundary()) return false;
}
return true;
};
var p = {
exec: function(q) {
var r = q.getCommand('blockquote').state,
s = q.getSelection(),
t = s && s.getRanges(true)[0];
if (!t) return;
var u = s.createBookmarks();
if (c) {
var v = u[0].startNode,
w = u[0].endNode,
x;
if (v && v.getParent().getName() == 'blockquote') {
x = v;
while (x = x.getNext()) {
if (x.type == 1 && x.isBlockBoundary()) {
v.move(x, true);
break;
}
}
}
if (w && w.getParent().getName() == 'blockquote') {
x = w;
while (x = x.getPrevious()) {
if (x.type == 1 && x.isBlockBoundary()) {
w.move(x);
break;
}
}
}
}
var y = t.createIterator(),
z;
y.enlargeBr = q.config.enterMode != 2;
if (r == 2) {
var A = [];
while (z = y.getNextParagraph()) A.push(z);
if (A.length < 1) {
var B = q.document.createElement(q.config.enterMode == 1 ? 'p' : 'div'),
C = u.shift();
t.insertNode(B);
B.append(new d.text('\ufeff', q.document));
t.moveToBookmark(C);
t.selectNodeContents(B);
t.collapse(true);
C = t.createBookmark();
A.push(B);
u.unshift(C);
}
var D = A[0].getParent(),
E = [];
for (var F = 0; F < A.length; F++) {
z = A[F];
D = D.getCommonAncestor(z.getParent());
}
var G = {
table: 1,
tbody: 1,
tr: 1,
ol: 1,
ul: 1
};
while (G[D.getName()]) D = D.getParent();
var H = null;
while (A.length > 0) {
z = A.shift();
while (!z.getParent().equals(D)) z = z.getParent();
if (!z.equals(H)) E.push(z);
H = z;
}
while (E.length > 0) {
z = E.shift();
if (z.getName() == 'blockquote') {
var I = new d.documentFragment(q.document);
while (z.getFirst()) {
I.append(z.getFirst().remove());
A.push(I.getLast());
}
I.replace(z);
} else A.push(z);
}
var J = q.document.createElement('blockquote');
J.insertBefore(A[0]);
while (A.length > 0) {
z = A.shift();
J.append(z);
}
} else if (r == 1) {
var K = [],
L = {};
while (z = y.getNextParagraph()) {
var M = null,
N = null;
while (z.getParent()) {
if (z.getParent().getName() == 'blockquote') {
M = z.getParent();
N = z;
break;
}
z = z.getParent();
}
if (M && N && !N.getCustomData('blockquote_moveout')) {
K.push(N);
h.setMarker(L, N, 'blockquote_moveout', true);
}
}
h.clearAllMarkers(L);
var O = [],
P = [];
L = {};
while (K.length > 0) {
var Q = K.shift();
J = Q.getParent();
if (!Q.getPrevious()) Q.remove().insertBefore(J);
else if (!Q.getNext()) Q.remove().insertAfter(J);
else {
Q.breakParent(Q.getParent());
P.push(Q.getNext());
}
if (!J.getCustomData('blockquote_processed')) {
P.push(J);
h.setMarker(L, J, 'blockquote_processed', true);
}
O.push(Q);
}
h.clearAllMarkers(L);
for (F = P.length - 1; F >= 0; F--) {
J = P[F];
if (o(J)) J.remove();
}
if (q.config.enterMode == 2) {
var R = true;
while (O.length) {
Q = O.shift();
if (Q.getName() == 'div') {
I = new d.documentFragment(q.document);
var S = R && Q.getPrevious() && !(Q.getPrevious().type == 1 && Q.getPrevious().isBlockBoundary());
if (S) I.append(q.document.createElement('br'));
var T = Q.getNext() && !(Q.getNext().type == 1 && Q.getNext().isBlockBoundary());
while (Q.getFirst()) Q.getFirst().remove().appendTo(I);
if (T) I.append(q.document.createElement('br'));
I.replace(Q);
R = false;
}
}
}
}
s.selectBookmarks(u);
q.focus();
}
};
j.add('blockquote', {
init: function(q) {
q.addCommand('blockquote', p);
q.ui.addButton('Blockquote', {
label: q.lang.blockquote,
command: 'blockquote'
});
q.on('selectionChange', n);
},
requires: ['domiterator']
});
})();
j.add('button', {
beforeInit: function(m) {
m.ui.addHandler('button', k.button.handler);
}
});
a.UI_BUTTON = 'button';
k.button = function(m) {
e.extend(this, m, {
title: m.label,
className: m.className || m.command && 'cke_button_' + m.command || '',
click: m.click || (function(n) {
n.execCommand(m.command);
})
});
this._ = {};
};
k.button.handler = {
create: function(m) {
return new k.button(m);
}
};
(function() {
k.button.prototype = {
render: function(m, n) {
var o = b,
p = this._.id = e.getNextId(),
q = '',
r = this.command,
s;
this._.editor = m;
var t = {
id: p,
button: this,
editor: m,
focus: function() {
var z = a.document.getById(p);
z.focus();
},
execute: function() {
this.button.click(m);
}
},
u = e.addFunction(function(z) {
if (t.onkey) {
z = new d.event(z);
return t.onkey(t, z.getKeystroke()) !== false;
}
}),
v = e.addFunction(function(z) {
var A;
if (t.onfocus) A = t.onfocus(t, new d.event(z)) !== false;
if (b.gecko && b.version < 10900) z.preventBubble();
return A;
});
t.clickFn = s = e.addFunction(t.execute, t);
if (this.modes) {
var w = {};
function x() {
var z = m.mode;
if (z) {
var A = this.modes[z] ? w[z] != undefined ? w[z] : 2 : 0;
this.setState(m.readOnly && !this.readOnly ? 0 : A);
}
};
m.on('beforeModeUnload', function() {
if (m.mode && this._.state != 0) w[m.mode] = this._.state;
}, this);
m.on('mode', x, this);
!this.readOnly && m.on('readOnly', x, this);
} else if (r) {
r = m.getCommand(r);
if (r) {
r.on('state', function() {
this.setState(r.state);
}, this);
q += 'cke_' + (r.state == 1 ? 'on' : r.state == 0 ? 'disabled' : 'off');
}
}
if (!r) q += 'cke_off';
if (this.className) q += ' ' + this.className;
n.push('', '= 10900 && !o.hc ? '' : '" href="javascript:void(\'' + (this.title || '').replace("'", '') + "')\"", ' title="', this.title, '" tabindex="-1" hidefocus="true" role="button" aria-labelledby="' + p + '_label"' + (this.hasArrow ? ' aria-haspopup="true"' : ''));
if (o.opera || o.gecko && o.mac) n.push(' onkeypress="return false;"');
if (o.gecko) n.push(' onblur="this.style.cssText = this.style.cssText;"');
n.push(' onkeydown="return CKEDITOR.tools.callFunction(', u, ', event);" onfocus="return CKEDITOR.tools.callFunction(', v, ', event);" onclick="CKEDITOR.tools.callFunction(', s, ', this); return false;">', this.label, '');
if (this.hasArrow) n.push('' + (b.hc ? '▼' : ' ') + '');
n.push('', '');
if (this.onRender) this.onRender();
return t;
},
setState: function(m) {
if (this._.state == m) return false;
this._.state = m;
var n = a.document.getById(this._.id);
if (n) {
n.setState(m);
m == 0 ? n.setAttribute('aria-disabled', true) : n.removeAttribute('aria-disabled');
m == 1 ? n.setAttribute('aria-pressed', true) : n.removeAttribute('aria-pressed');
return true;
} else return false;
}
};
})();
k.prototype.addButton = function(m, n) {
this.add(m, 'button', n);
};
(function() {
var m = function(y, z) {
var A = y.document,
B = A.getBody(),
C = 0,
D = function() {
C = 1;
};
B.on(z, D);
(b.version > 7 ? A.$ : A.$.selection.createRange()).execCommand(z);
B.removeListener(z, D);
return C;
},
n = c ? function(y, z) {
return m(y, z);
} : function(y, z) {
try {
return y.document.$.execCommand(z, false, null);
} catch (A) {
return false;
}
},
o = function(y) {
var z = this;
z.type = y;
z.canUndo = z.type == 'cut';
z.startDisabled = true;
};
o.prototype = {
exec: function(y, z) {
this.type == 'cut' && t(y);
var A = n(y, this.type);
if (!A) alert(y.lang.clipboard[this.type + 'Error']);
return A;
}
};
var p = {
canUndo: false,
exec: c ? function(y) {
y.focus();
if (!y.document.getBody().fire('beforepaste') && !m(y, 'paste')) {
y.fire('pasteDialog');
return false;
}
} : function(y) {
try {
if (!y.document.getBody().fire('beforepaste') && !y.document.$.execCommand('Paste', false, null)) throw 0;
} catch (z) {
setTimeout(function() {
y.fire('pasteDialog');
}, 0);
return false;
}
}
},
q = function(y) {
if (this.mode != 'wysiwyg') return;
switch (y.data.keyCode) {
case 1000 + 86:
case 2000 + 45:
var z = this.document.getBody();
if (!c && z.fire('beforepaste')) y.cancel();
else if (b.opera || b.gecko && b.version < 10900) z.fire('paste');
return;
case 1000 + 88:
case 2000 + 46:
var A = this;
this.fire('saveSnapshot');
setTimeout(function() {
A.fire('saveSnapshot');
}, 0);
}
};
function r(y) {
y.cancel();
};
function s(y, z, A) {
var B = this.document;
if (B.getById('cke_pastebin')) return;
if (z == 'text' && y.data && y.data.$.clipboardData) {
var C = y.data.$.clipboardData.getData('text/plain');
if (C) {
y.data.preventDefault();
A(C);
return;
}
}
var D = this.getSelection(),
E = new d.range(B),
F = new h(z == 'text' ? 'textarea' : b.webkit ? 'body' : 'div', B);
F.setAttribute('id', 'cke_pastebin');
b.webkit && F.append(B.createText('\xa0'));
B.getBody().append(F);
F.setStyles({
position: 'absolute',
top: D.getStartElement().getDocumentPosition().y + 'px',
width: '1px',
height: '1px',
overflow: 'hidden'
});
F.setStyle(this.config.contentsLangDirection == 'ltr' ? 'left' : 'right', '-1000px');
var G = D.createBookmarks();
this.on('selectionChange', r, null, null, 0);
if (z == 'text') F.$.focus();
else {
E.setStartAt(F, 1);
E.setEndAt(F, 2);
E.select(true);
}
var H = this;
window.setTimeout(function() {
z == 'text' && b.gecko && H.focusGrabber.focus();
F.remove();
H.removeListener('selectionChange', r);
var I;
F = b.webkit && (I = F.getFirst()) && I.is && I.hasClass('Apple-style-span') ? I : F;
D.selectBookmarks(G);
A(F['get' + (z == 'text' ? 'Value' : 'Html')]());
}, 0);
};
function t(y) {
if (!c || b.quirks) return;
var z = y.getSelection(),
A;
if (z.getType() == 3 && (A = z.getSelectedElement())) {
var B = z.getRanges()[0],
C = y.document.createText('');
C.insertBefore(A);
B.setStartBefore(C);
B.setEndAfter(A);
z.selectRanges([B]);
setTimeout(function() {
if (A.getParent()) {
C.remove();
z.selectElement(A);
}
}, 0);
}
};
var u;
function v(y, z) {
c && (u = 1);
var A = 2;
try {
A = z.document.$.queryCommandEnabled(y) ? 2 : 0;
} catch (B) {}
u = 0;
return A;
};
var w;
function x() {
var z = this;
if (z.mode != 'wysiwyg') return;
z.getCommand('cut').setState(w ? 0 : v('Cut', z));
z.getCommand('copy').setState(v('Copy', z));
var y = w ? 0 : b.webkit ? 2 : v('Paste', z);
z.fire('pasteState', y);
};
j.add('clipboard', {
requires: ['dialog', 'htmldataprocessor'],
init: function(y) {
y.on('paste', function(A) {
var B = A.data;
if (B.html) y.insertHtml(B.html);
else if (B.text) y.insertText(B.text);
setTimeout(function() {
y.fire('afterPaste');
}, 0);
}, null, null, 1000);
y.on('pasteDialog', function(A) {
setTimeout(function() {
y.openDialog('paste');
}, 0);
});
y.on('pasteState', function(A) {
y.getCommand('paste').setState(A.data);
});
function z(A, B, C, D) {
var E = y.lang[B];
y.addCommand(B, C);
y.ui.addButton(A, {
label: E,
command: B
});
if (y.addMenuItems) y.addMenuItem(B, {
label: E,
command: B,
group: 'clipboard',
order: D
});
};
z('Cut', 'cut', new o('cut'), 1);
z('Copy', 'copy', new o('copy'), 4);
z('Paste', 'paste', p, 8);
a.dialog.add('paste', a.getUrl(this.path + 'dialogs/paste.js'));
y.on('key', q, y);
y.on('contentDom', function() {
var A = y.document.getBody();
A.on(b.webkit ? 'paste' : 'beforepaste', function(B) {
if (u) return;
var C = {
mode: 'html'
};
y.fire('beforePaste', C);
s.call(y, B, C.mode, function(D) {
if (!(D = e.trim(D.replace(/]+data-cke-bookmark[^<]*?<\/span>/ig, '')))) return;
var E = {};
E[C.mode] = D;
y.fire('paste', E);
});
});
A.on('beforecut', function() {
!u && t(y);
});
A.on('mouseup', function() {
setTimeout(function() {
x.call(y);
}, 0);
}, y);
A.on('keyup', x, y);
});
y.on('selectionChange', function(A) {
w = A.data.selection.getRanges()[0].checkReadOnly();
x.call(y);
});
if (y.contextMenu) y.contextMenu.addListener(function(A, B) {
var C = B.getRanges()[0].checkReadOnly();
return {
cut: !C && v('Cut', y),
copy: v('Copy', y),
paste: !C && (b.webkit ? 2 : v('Paste', y))
};
});
}
});
})();
j.add('colorbutton', {
requires: ['panelbutton', 'floatpanel', 'styles'],
init: function(m) {
var n = m.config,
o = m.lang.colorButton,
p;
if (!b.hc) {
q('TextColor', 'fore', o.textColorTitle);
q('BGColor', 'back', o.bgColorTitle);
}
function q(t, u, v) {
var w = e.getNextId() + '_colorBox';
m.ui.add(t, 'panelbutton', {
label: v,
title: v,
className: 'cke_button_' + t.toLowerCase(),
modes: {
wysiwyg: 1
},
panel: {
css: m.skin.editor.css,
attributes: {
role: 'listbox',
'aria-label': o.panelTitle
}
},
onBlock: function(x, y) {
y.autoSize = true;
y.element.addClass('cke_colorblock');
y.element.setHtml(r(x, u, w));
y.element.getDocument().getBody().setStyle('overflow', 'hidden');
k.fire('ready', this);
var z = y.keys,
A = m.lang.dir == 'rtl';
z[A ? 37 : 39] = 'next';
z[40] = 'next';
z[9] = 'next';
z[A ? 39 : 37] = 'prev';
z[38] = 'prev';
z[2000 + 9] = 'prev';
z[32] = 'click';
},
onOpen: function() {
var x = m.getSelection(),
y = x && x.getStartElement(),
z = new d.elementPath(y),
A;
y = z.block || z.blockLimit || m.document.getBody();
do A = y && y.getComputedStyle(u == 'back' ? 'background-color' : 'color') || 'transparent'; while (u == 'back' && A == 'transparent' && y && (y = y.getParent()));
if (!A || A == 'transparent') A = '#ffffff';
this._.panel._.iframe.getFrameDocument().getById(w).setStyle('background-color', A);
}
});
};
function r(t, u, v) {
var w = [],
x = n.colorButton_colors.split(','),
y = x.length + (n.colorButton_enableMore ? 2 : 1),
z = e.addFunction(function(F, G) {
if (F == '?') {
var H = arguments.callee;
function I(K) {
this.removeListener('ok', I);
this.removeListener('cancel', I);
K.name == 'ok' && H(this.getContentElement('picker', 'selectedColor').getValue(), G);
};
m.openDialog('colordialog', function() {
this.on('ok', I);
this.on('cancel', I);
});
return;
}
m.focus();
t.hide();
m.fire('saveSnapshot');
new a.style(n['colorButton_' + G + 'Style'], {
color: 'inherit'
}).remove(m.document);
if (F) {
var J = n['colorButton_' + G + 'Style'];
J.childRule = G == 'back' ? function(K) {
return s(K);
} : function(K) {
return K.getName() != 'a' || s(K);
};
new a.style(J, {
color: F
}).apply(m.document);
}
m.fire('saveSnapshot');
});
w.push('
', o.auto, '
');
for (var A = 0; A < x.length; A++) {
if (A % 8 === 0) w.push('
');
var B = x[A].split('/'),
C = B[0],
D = B[1] || C;
if (!B[1]) C = '#' + C.replace(/^(.)(.)(.)$/, '$1$1$2$2$3$3');
var E = m.lang.colors[D] || D;
w.push('
');
}
if (n.colorButton_enableMore === undefined || n.colorButton_enableMore) w.push('
');
return w.join('');
};
function s(t) {
return t.getAttribute('contentEditable') == 'false' || t.getAttribute('data-nostyle');
};
}
});
i.colorButton_colors = '000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';
i.colorButton_foreStyle = {
element: 'span',
styles: {
color: '#(color)'
},
overrides: [{
element: 'font',
attributes: {
color: null
}
}]
};
i.colorButton_backStyle = {
element: 'span',
styles: {
'background-color': '#(color)'
}
};
j.colordialog = {
init: function(m) {
m.addCommand('colordialog', new a.dialogCommand('colordialog'));
a.dialog.add('colordialog', this.path + 'dialogs/colordialog.js');
}
};
j.add('colordialog', j.colordialog);
j.add('contextmenu', {
requires: ['menu'],
onLoad: function() {
j.contextMenu = e.createClass({
base: a.menu,
$: function(m) {
this.base.call(this, m, {
panel: {
className: m.skinClass + ' cke_contextmenu',
attributes: {
'aria-label': m.lang.contextmenu.options
}
}
});
},
proto: {
addTarget: function(m, n) {
if (b.opera && !('oncontextmenu' in document.body)) {
var o;
m.on('mousedown', function(s) {
s = s.data;
if (s.$.button != 2) {
if (s.getKeystroke() == 1000 + 1) m.fire('contextmenu', s);
return;
}
if (n && (b.mac ? s.$.metaKey : s.$.ctrlKey)) return;
var t = s.getTarget();
if (!o) {
var u = t.getDocument();
o = u.createElement('input');
o.$.type = 'button';
u.getBody().append(o);
}
o.setAttribute('style', 'position:absolute;top:' + (s.$.clientY - 2) + 'px;left:' + (s.$.clientX - 2) + 'px;width:5px;height:5px;opacity:0.01');
});
m.on('mouseup', function(s) {
if (o) {
o.remove();
o = undefined;
m.fire('contextmenu', s.data);
}
});
}
m.on('contextmenu', function(s) {
var t = s.data;
if (n && (b.webkit ? p : b.mac ? t.$.metaKey : t.$.ctrlKey)) return;
t.preventDefault();
var u = t.getTarget().getDocument().getDocumentElement(),
v = t.$.clientX,
w = t.$.clientY;
e.setTimeout(function() {
this.open(u, null, v, w);
}, 0, this);
}, this);
if (b.opera) m.on('keypress', function(s) {
var t = s.data;
if (t.$.keyCode === 0) t.preventDefault();
});
if (b.webkit) {
var p, q = function(s) {
p = b.mac ? s.data.$.metaKey : s.data.$.ctrlKey;
},
r = function() {
p = 0;
};
m.on('keydown', q);
m.on('keyup', r);
m.on('contextmenu', r);
}
},
open: function(m, n, o, p) {
this.editor.focus();
m = m || a.document.getDocumentElement();
this.show(m, n, o, p);
}
}
});
},
beforeInit: function(m) {
m.contextMenu = new j.contextMenu(m);
m.addCommand('contextMenu', {
exec: function() {
m.contextMenu.open(m.document.getBody());
}
});
}
});
(function() {
function m(o) {
var p = this.att,
q = o && o.hasAttribute(p) && o.getAttribute(p) || '';
if (q !== undefined) this.setValue(q);
};
function n() {
var o;
for (var p = 0; p < arguments.length; p++) {
if (arguments[p] instanceof h) {
o = arguments[p];
break;
}
}
if (o) {
var q = this.att,
r = this.getValue();
if (r) o.setAttribute(q, r);
else o.removeAttribute(q, r);
}
};
j.add('dialogadvtab', {
createAdvancedTab: function(o, p) {
if (!p) p = {
id: 1,
dir: 1,
classes: 1,
styles: 1
};
var q = o.lang.common,
r = {
id: 'advanced',
label: q.advancedTab,
title: q.advancedTab,
elements: [{
type: 'vbox',
padding: 1,
children: []
}]
},
s = [];
if (p.id || p.dir) {
if (p.id) s.push({
id: 'advId',
att: 'id',
type: 'text',
label: q.id,
setup: m,
commit: n
});
if (p.dir) s.push({
id: 'advLangDir',
att: 'dir',
type: 'select',
label: q.langDir,
'default': '',
style: 'width:100%',
items: [
[q.notSet, ''],
[q.langDirLTR, 'ltr'],
[q.langDirRTL, 'rtl']
],
setup: m,
commit: n
});
r.elements[0].children.push({
type: 'hbox',
widths: ['50%', '50%'],
children: [].concat(s)
});
}
if (p.styles || p.classes) {
s = [];
if (p.styles) s.push({
id: 'advStyles',
att: 'style',
type: 'text',
label: q.styles,
'default': '',
getStyle: function(t, u) {
var v = this.getValue().match(new RegExp(t + '\\s*:s*([^;]*)', 'i'));
return v ? v[1] : u;
},
updateStyle: function(t, u) {
var v = this.getValue();
if (v) v = v.replace(new RegExp('\\s*' + t + 's*:[^;]*(?:$|;s*)', 'i'), '').replace(/^[;\s]+/, '').replace(/\s+$/, '');
if (u) {
v && !/;\s*$/.test(v) && (v += '; ');
v += t + ': ' + u;
}
this.setValue(v, 1);
},
setup: m,
commit: n
});
if (p.classes) s.push({
type: 'hbox',
widths: ['45%', '55%'],
children: [{
id: 'advCSSClasses',
att: 'class',
type: 'text',
label: q.cssClasses,
'default': '',
setup: m,
commit: n
}]
});
r.elements[0].children.push({
type: 'hbox',
widths: ['50%', '50%'],
children: [].concat(s)
});
}
return r;
}
});
})();
(function() {
j.add('div', {
requires: ['editingblock', 'domiterator', 'styles'],
init: function(m) {
var n = m.lang.div;
m.addCommand('creatediv', new a.dialogCommand('creatediv'));
m.addCommand('editdiv', new a.dialogCommand('editdiv'));
m.addCommand('removediv', {
exec: function(o) {
var p = o.getSelection(),
q = p && p.getRanges(),
r, s = p.createBookmarks(),
t, u = [];
function v(x) {
var y = new d.elementPath(x),
z = y.blockLimit,
A = z.is('div') && z;
if (A && !A.data('cke-div-added')) {
u.push(A);
A.data('cke-div-added');
}
};
for (var w = 0; w < q.length; w++) {
r = q[w];
if (r.collapsed) v(p.getStartElement());
else {
t = new d.walker(r);
t.evaluator = v;
t.lastForward();
}
}
for (w = 0; w < u.length; w++) u[w].remove(true);
p.selectBookmarks(s);
}
});
m.ui.addButton('CreateDiv', {
label: n.toolbar,
command: 'creatediv'
});
if (m.addMenuItems) {
m.addMenuItems({
editdiv: {
label: n.edit,
command: 'editdiv',
group: 'div',
order: 1
},
removediv: {
label: n.remove,
command: 'removediv',
group: 'div',
order: 5
}
});
if (m.contextMenu) m.contextMenu.addListener(function(o, p) {
if (!o || o.isReadOnly()) return null;
var q = new d.elementPath(o),
r = q.blockLimit;
if (r && r.getAscendant('div', true)) return {
editdiv: 2,
removediv: 2
};
return null;
});
}
a.dialog.add('creatediv', this.path + 'dialogs/div.js');
a.dialog.add('editdiv', this.path + 'dialogs/div.js');
}
});
})();
(function() {
var m = {
toolbarFocus: {
editorFocus: false,
readOnly: 1,
exec: function(o) {
var p = o._.elementsPath.idBase,
q = a.document.getById(p + '0');
q && q.focus(c || b.air);
}
}
},
n = '';
j.add('elementspath', {
requires: ['selection'],
init: function(o) {
var p = 'cke_path_' + o.name,
q, r = function() {
if (!q) q = a.document.getById(p);
return q;
},
s = 'cke_elementspath_' + e.getNextNumber() + '_';
o._.elementsPath = {
idBase: s,
filters: []
};
o.on('themeSpace', function(x) {
if (x.data.space == 'bottom') x.data.html += '' + o.lang.elementsPath.eleLabel + '' + '
' + n + '
';
});
function t(x) {
o.focus();
var y = o._.elementsPath.list[x];
if (y.is('body')) {
var z = new d.range(o.document);
z.selectNodeContents(y);
z.select();
} else o.getSelection().selectElement(y);
};
var u = e.addFunction(t),
v = e.addFunction(function(x, y) {
var z = o._.elementsPath.idBase,
A;
y = new d.event(y);
var B = o.lang.dir == 'rtl';
switch (y.getKeystroke()) {
case B ? 39:
37:
case 9:
A = a.document.getById(z + (x + 1));
if (!A) A = a.document.getById(z + '0');
A.focus();
return false;
case B ? 37:
39:
case 2000 + 9:
A = a.document.getById(z + (x - 1));
if (!A) A = a.document.getById(z + (o._.elementsPath.list.length - 1));
A.focus();
return false;
case 27:
o.focus();
return false;
case 13:
case 32:
t(x);
return false;
}
return true;
});
o.on('selectionChange', function(x) {
var y = b,
z = x.data.selection,
A = z.getStartElement(),
B = [],
C = x.editor,
D = C._.elementsPath.list = [],
E = C._.elementsPath.filters;
while (A) {
var F = 0,
G;
if (A.data('cke-display-name')) G = A.data('cke-display-name');
else if (A.data('cke-real-element-type')) G = A.data('cke-real-element-type');
else G = A.getName();
for (var H = 0; H < E.length; H++) {
var I = E[H](A, G);
if (I === false) {
F = 1;
break;
}
G = I || G;
}
if (!F) {
var J = D.push(A) - 1,
K = '';
if (y.opera || y.gecko && y.mac) K += ' onkeypress="return false;"';
if (y.gecko) K += ' onblur="this.style.cssText = this.style.cssText;"';
var L = C.lang.elementsPath.eleTitle.replace(/%1/, G);
B.unshift('', G, '' + L + '', '');
}
if (G == 'body') break;
A = A.getParent();
}
var M = r();
M.setHtml(B.join('') + n);
C.fire('elementsPathUpdate', {
space: M
});
});
function w() {
q && q.setHtml(n);
delete o._.elementsPath.list;
};
o.on('readOnly', w);
o.on('contentDomUnload', w);
o.addCommand('elementsPathFocus', m.toolbarFocus);
}
});
})();
(function() {
j.add('enterkey', {
requires: ['keystrokes', 'indent'],
init: function(t) {
t.addCommand('enter', {
modes: {
wysiwyg: 1
},
editorFocus: false,
exec: function(v) {
r(v);
}
});
t.addCommand('shiftEnter', {
modes: {
wysiwyg: 1
},
editorFocus: false,
exec: function(v) {
q(v);
}
});
var u = t.keystrokeHandler.keystrokes;
u[13] = 'enter';
u[2000 + 13] = 'shiftEnter';
}
});
j.enterkey = {
enterBlock: function(t, u, v, w) {
v = v || s(t);
if (!v) return;
var x = v.document,
y = v.checkStartOfBlock(),
z = v.checkEndOfBlock(),
A = new d.elementPath(v.startContainer),
B = A.block;
if (y && z) {
if (B && (B.is('li') || B.getParent().is('li'))) {
t.execCommand('outdent');
return;
}
} else if (!z && B && B.is('pre')) n(t, u, v, w);
var C = u == 3 ? 'div' : 'p',
D = v.splitBlock(C);
if (!D) return;
var E = D.previousBlock,
F = D.nextBlock,
G = D.wasStartOfBlock,
H = D.wasEndOfBlock,
I;
if (F) {
I = F.getParent();
if (I.is('li')) {
F.breakParent(I);
F.move(F.getNext(), 1);
}
} else if (E && (I = E.getParent()) && I.is('li')) {
E.breakParent(I);
I = E.getNext();
v.moveToElementEditStart(I);
E.move(E.getPrevious());
}
if (!G && !H) {
if (F.is('li') && (I = F.getFirst(d.walker.invisible(true))) && I.is && I.is('ul', 'ol'))(c ? x.createText('\xa0') : x.createElement('br')).insertBefore(I);
if (F) v.moveToElementEditStart(F);
} else {
var J, K;
if (E) {
if (E.is('li') || !(p.test(E.getName()) || E.is('pre'))) {
J = E.clone();
J.is('li') && J.removeAttribute('value');
}
} else if (F) J = F.clone();
if (!J) {
if (I && I.is('li')) J = I;
else {
J = x.createElement(C);
if (E && (K = E.getDirection())) J.setAttribute('dir', K);
}
} else if (w && !J.is('li')) J.renameNode(C);
var L = D.elementPath;
if (L)
for (var M = 0, N = L.elements.length; M < N; M++) {
var O = L.elements[M];
if (O.equals(L.block) || O.equals(L.blockLimit)) break;
if (f.$removeEmpty[O.getName()]) {
O = O.clone();
J.moveChildren(O);
J.append(O);
}
}
if (!c) J.appendBogus();
if (!J.getParent()) v.insertNode(J);
if (c && G && (!H || !E.getChildCount())) {
v.moveToElementEditStart(H ? E : J);
v.select();
}
v.moveToElementEditStart(G && !H ? F : J);
}
if (!c)
if (F) {
var P = x.createElement('span');
P.setHtml(' ');
v.insertNode(P);
P.scrollIntoView();
v.deleteContents();
} else J.scrollIntoView();
v.select();
},
enterBr: function(t, u, v, w) {
v = v || s(t);
if (!v) return;
var x = v.document,
y = u == 3 ? 'div' : 'p',
z = v.checkEndOfBlock(),
A = new d.elementPath(t.getSelection().getStartElement()),
B = A.block,
C = B && A.block.getName(),
D = false;
if (!w && C == 'li') {
o(t, u, v, w);
return;
}
if (!w && z && p.test(C)) {
var E, F;
if (F = B.getDirection()) {
E = x.createElement('div');
E.setAttribute('dir', F);
E.insertAfter(B);
v.setStart(E, 0);
} else {
x.createElement('br').insertAfter(B);
if (b.gecko) x.createText('').insertAfter(B);
v.setStartAt(B.getNext(), c ? 3 : 1);
}
} else {
var G;
D = C == 'pre';
if (D && !b.gecko) G = x.createText(c ? '\r' : '\n');
else G = x.createElement('br');
v.deleteContents();
v.insertNode(G);
if (c) v.setStartAt(G, 4);
else {
x.createText('\ufeff').insertAfter(G);
if (z) G.getParent().appendBogus();
G.getNext().$.nodeValue = '';
v.setStartAt(G.getNext(), 1);
var H = null;
if (!b.gecko) {
H = x.createElement('span');
H.setHtml(' ');
} else H = x.createElement('br');
H.insertBefore(G.getNext());
H.scrollIntoView();
H.remove();
}
}
v.collapse(true);
v.select(D);
}
};
var m = j.enterkey,
n = m.enterBr,
o = m.enterBlock,
p = /^h[1-6]$/;
function q(t) {
if (t.mode != 'wysiwyg') return false;
return r(t, t.config.shiftEnterMode, 1);
};
function r(t, u, v) {
v = t.config.forceEnterMode || v;
if (t.mode != 'wysiwyg') return false;
if (!u) u = t.config.enterMode;
setTimeout(function() {
t.fire('saveSnapshot');
if (u == 2) n(t, u, null, v);
else o(t, u, null, v);
}, 0);
return true;
};
function s(t) {
var u = t.getSelection().getRanges(true);
for (var v = u.length - 1; v > 0; v--) u[v].deleteContents();
return u[0];
};
})();
(function() {
var m = 'nbsp,gt,lt,amp',
n = 'quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro',
o = 'Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml',
p = 'Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv';
function q(r, s) {
var t = {},
u = [],
v = {
nbsp: '\xa0',
shy: '',
gt: '>',
lt: '<',
amp: '&'
};
r = r.replace(/\b(nbsp|shy|gt|lt|amp)(?:,|$)/g, function(A, B) {
var C = s ? '&' + B + ';' : v[B],
D = s ? v[B] : '&' + B + ';';
t[C] = D;
u.push(C);
return '';
});
if (!s && r) {
r = r.split(',');
var w = document.createElement('div'),
x;
w.innerHTML = '&' + r.join(';&') + ';';
x = w.innerHTML;
w = null;
for (var y = 0; y < x.length; y++) {
var z = x.charAt(y);
t[z] = '&' + r[y] + ';';
u.push(z);
}
}
t.regex = u.join(s ? '|' : '');
return t;
};
j.add('entities', {
afterInit: function(r) {
var s = r.config,
t = r.dataProcessor,
u = t && t.htmlFilter;
if (u) {
var v = '';
if (s.basicEntities !== false) v += m;
if (s.entities) {
v += ',' + n;
if (s.entities_latin) v += ',' + o;
if (s.entities_greek) v += ',' + p;
if (s.entities_additional) v += ',' + s.entities_additional;
}
var w = q(v),
x = w.regex ? '[' + w.regex + ']' : 'a^';
delete w.regex;
if (s.entities && s.entities_processNumerical) x = '[^ -~]|' + x;
x = new RegExp(x, 'g');
function y(C) {
return s.entities_processNumerical == 'force' || !w[C] ? '' + C.charCodeAt(0) + ';' : w[C];
};
var z = q([m, 'shy'].join(','), true),
A = new RegExp(z.regex, 'g');
function B(C) {
return z[C];
};
u.addRules({
text: function(C) {
return C.replace(A, B).replace(x, y);
}
});
}
}
});
})();
i.basicEntities = true;
i.entities = true;
i.entities_latin = true;
i.entities_greek = true;
i.entities_additional = '#39';
(function() {
function m(v, w) {
var x = [];
if (!w) return v;
else
for (var y in w) x.push(y + '=' + encodeURIComponent(w[y]));
return v + (v.indexOf('?') != -1 ? '&' : '?') + x.join('&');
};
function n(v) {
v += '';
var w = v.charAt(0).toUpperCase();
return w + v.substr(1);
};
function o(v) {
var C = this;
var w = C.getDialog(),
x = w.getParentEditor();
x._.filebrowserSe = C;
var y = x.config['filebrowser' + n(w.getName()) + 'WindowWidth'] || x.config.filebrowserWindowWidth || '80%',
z = x.config['filebrowser' + n(w.getName()) + 'WindowHeight'] || x.config.filebrowserWindowHeight || '70%',
A = C.filebrowser.params || {};
A.CKEditor = x.name;
A.CKEditorFuncNum = x._.filebrowserFn;
if (!A.langCode) A.langCode = x.langCode;
var B = m(C.filebrowser.url, A);
x.popup(B, y, z, x.config.fileBrowserWindowFeatures);
};
function p(v) {
var y = this;
var w = y.getDialog(),
x = w.getParentEditor();
x._.filebrowserSe = y;
if (!w.getContentElement(y['for'][0], y['for'][1]).getInputElement().$.value) return false;
if (!w.getContentElement(y['for'][0], y['for'][1]).getAction()) return false;
return true;
};
function q(v, w, x) {
var y = x.params || {};
y.CKEditor = v.name;
y.CKEditorFuncNum = v._.filebrowserFn;
if (!y.langCode) y.langCode = v.langCode;
w.action = m(x.url, y);
w.filebrowser = x;
};
function r(v, w, x, y) {
var z, A;
for (var B in y) {
z = y[B];
if (z.type == 'hbox' || z.type == 'vbox') r(v, w, x, z.children);
if (!z.filebrowser) continue;
if (typeof z.filebrowser == 'string') {
var C = {
action: z.type == 'fileButton' ? 'QuickUpload' : 'Browse',
target: z.filebrowser
};
z.filebrowser = C;
}
if (z.filebrowser.action == 'Browse') {
var D = z.filebrowser.url;
if (D === undefined) {
D = v.config['filebrowser' + n(w) + 'BrowseUrl'];
if (D === undefined) D = v.config.filebrowserBrowseUrl;
}
if (D) {
z.onClick = o;
z.filebrowser.url = D;
z.hidden = false;
}
} else if (z.filebrowser.action == 'QuickUpload' && z['for']) {
D = z.filebrowser.url;
if (D === undefined) {
D = v.config['filebrowser' + n(w) + 'UploadUrl'];
if (D === undefined) D = v.config.filebrowserUploadUrl;
}
if (D) {
var E = z.onClick;
z.onClick = function(F) {
var G = F.sender;
if (E && E.call(G, F) === false) return false;
return p.call(G, F);
};
z.filebrowser.url = D;
z.hidden = false;
q(v, x.getContents(z['for'][0]).get(z['for'][1]), z.filebrowser);
}
}
}
};
function s(v, w) {
var x = w.getDialog(),
y = w.filebrowser.target || null;
v = v.replace(/#/g, '%23');
if (y) {
var z = y.split(':'),
A = x.getContentElement(z[0], z[1]);
if (A) {
A.setValue(v);
x.selectPage(z[0]);
}
}
};
function t(v, w, x) {
if (x.indexOf(';') !== -1) {
var y = x.split(';');
for (var z = 0; z < y.length; z++) {
if (t(v, w, y[z])) return true;
}
return false;
}
var A = v.getContents(w).get(x).filebrowser;
return A && A.url;
};
function u(v, w) {
var A = this;
var x = A._.filebrowserSe.getDialog(),
y = A._.filebrowserSe['for'],
z = A._.filebrowserSe.filebrowser.onSelect;
if (y) x.getContentElement(y[0], y[1]).reset();
if (typeof w == 'function' && w.call(A._.filebrowserSe) === false) return;
if (z && z.call(A._.filebrowserSe, v, w) === false) return;
if (typeof w == 'string' && w) alert(w);
if (v) s(v, A._.filebrowserSe);
};
j.add('filebrowser', {
init: function(v, w) {
v._.filebrowserFn = e.addFunction(u, v);
v.on('destroy', function() {
e.removeFunction(this._.filebrowserFn);
});
}
});
a.on('dialogDefinition', function(v) {
var w = v.data.definition,
x;
for (var y in w.contents) {
if (x = w.contents[y]) {
r(v.editor, v.data.name, w, x.elements);
if (x.hidden && x.filebrowser) x.hidden = !t(w, x.id, x.filebrowser);
}
}
});
})();
j.add('find', {
init: function(m) {
var n = j.find;
m.ui.addButton('Find', {
label: m.lang.findAndReplace.find,
command: 'find'
});
var o = m.addCommand('find', new a.dialogCommand('find'));
o.canUndo = false;
o.readOnly = 1;
m.ui.addButton('Replace', {
label: m.lang.findAndReplace.replace,
command: 'replace'
});
var p = m.addCommand('replace', new a.dialogCommand('replace'));
p.canUndo = false;
a.dialog.add('find', this.path + 'dialogs/find.js');
a.dialog.add('replace', this.path + 'dialogs/find.js');
},
requires: ['styles']
});
i.find_highlight = {
element: 'span',
styles: {
'background-color': '#004',
color: '#fff'
}
};
(function() {
var m = /\.swf(?:$|\?)/i,
n = e.cssLength;
function o(q) {
var r = q.attributes;
return r.type == 'application/x-shockwave-flash' || m.test(r.src || '');
};
function p(q, r) {
var s = q.createFakeParserElement(r, 'cke_flash', 'flash', true),
t = s.attributes.style || '',
u = r.attributes.width,
v = r.attributes.height;
if (typeof u != 'undefined') t = s.attributes.style = t + 'width:' + n(u) + ';';
if (typeof v != 'undefined') t = s.attributes.style = t + 'height:' + n(v) + ';';
return s;
};
j.add('flash', {
init: function(q) {
q.addCommand('flash', new a.dialogCommand('flash'));
q.ui.addButton('Flash', {
label: q.lang.common.flash,
command: 'flash'
});
a.dialog.add('flash', this.path + 'dialogs/flash.js');
q.addCss('img.cke_flash{background-image: url(' + a.getUrl(this.path + 'images/placeholder.png') + ');' + 'background-position: center center;' + 'background-repeat: no-repeat;' + 'border: 1px solid #a9a9a9;' + 'width: 80px;' + 'height: 80px;' + '}');
if (q.addMenuItems) q.addMenuItems({
flash: {
label: q.lang.flash.properties,
command: 'flash',
group: 'flash'
}
});
q.on('doubleclick', function(r) {
var s = r.data.element;
if (s.is('img') && s.data('cke-real-element-type') == 'flash') r.data.dialog = 'flash';
});
if (q.contextMenu) q.contextMenu.addListener(function(r, s) {
if (r && r.is('img') && !r.isReadOnly() && r.data('cke-real-element-type') == 'flash') return {
flash: 2
};
});
},
afterInit: function(q) {
var r = q.dataProcessor,
s = r && r.dataFilter;
if (s) s.addRules({
elements: {
'cke:object': function(t) {
var u = t.attributes,
v = u.classid && String(u.classid).toLowerCase();
if (!v && !o(t)) {
for (var w = 0; w < t.children.length; w++) {
if (t.children[w].name == 'cke:embed') {
if (!o(t.children[w])) return null;
return p(q, t);
}
}
return null;
}
return p(q, t);
},
'cke:embed': function(t) {
if (!o(t)) return null;
return p(q, t);
}
}
}, 5);
},
requires: ['fakeobjects']
});
})();
e.extend(i, {
flashEmbedTagOnly: false,
flashAddEmbedTag: true,
flashConvertOnEdit: false
});
(function() {
function m(n, o, p, q, r, s, t) {
var u = n.config,
v = r.split(';'),
w = [],
x = {};
for (var y = 0; y < v.length; y++) {
var z = v[y];
if (z) {
z = z.split('/');
var A = {},
B = v[y] = z[0];
A[p] = w[y] = z[1] || B;
x[B] = new a.style(t, A);
x[B]._.definition.name = B;
} else v.splice(y--, 1);
}
n.ui.addRichCombo(o, {
label: q.label,
title: q.panelTitle,
className: 'cke_' + (p == 'size' ? 'fontSize' : 'font'),
panel: {
css: n.skin.editor.css.concat(u.contentsCss),
multiSelect: false,
attributes: {
'aria-label': q.panelTitle
}
},
init: function() {
this.startGroup(q.panelTitle);
for (var C = 0; C < v.length; C++) {
var D = v[C];
this.add(D, x[D].buildPreview(), D);
}
},
onClick: function(C) {
n.focus();
n.fire('saveSnapshot');
var D = x[C];
if (this.getValue() == C) D.remove(n.document);
else D.apply(n.document);
n.fire('saveSnapshot');
},
onRender: function() {
n.on('selectionChange', function(C) {
var D = this.getValue(),
E = C.data.path,
F = E.elements;
for (var G = 0, H; G < F.length; G++) {
H = F[G];
for (var I in x) {
if (x[I].checkElementRemovable(H, true)) {
if (I != D) this.setValue(I);
return;
}
}
}
this.setValue('', s);
}, this);
}
});
};
j.add('font', {
requires: ['richcombo', 'styles'],
init: function(n) {
var o = n.config;
m(n, 'Font', 'family', n.lang.font, o.font_names, o.font_defaultLabel, o.font_style);
m(n, 'FontSize', 'size', n.lang.fontSize, o.fontSize_sizes, o.fontSize_defaultLabel, o.fontSize_style);
}
});
})();
i.font_names = 'Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif';
i.font_defaultLabel = '';
i.font_style = {
element: 'span',
styles: {
'font-family': '#(family)'
},
overrides: [{
element: 'font',
attributes: {
face: null
}
}]
};
i.fontSize_sizes = '8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px';
i.fontSize_defaultLabel = '';
i.fontSize_style = {
element: 'span',
styles: {
'font-size': '#(size)'
},
overrides: [{
element: 'font',
attributes: {
size: null
}
}]
};
j.add('format', {
requires: ['richcombo', 'styles'],
init: function(m) {
var n = m.config,
o = m.lang.format,
p = n.format_tags.split(';'),
q = {};
for (var r = 0; r < p.length; r++) {
var s = p[r];
q[s] = new a.style(n['format_' + s]);
q[s]._.enterMode = m.config.enterMode;
}
m.ui.addRichCombo('Format', {
label: o.label,
title: o.panelTitle,
className: 'cke_format',
panel: {
css: m.skin.editor.css.concat(n.contentsCss),
multiSelect: false,
attributes: {
'aria-label': o.panelTitle
}
},
init: function() {
this.startGroup(o.panelTitle);
for (var t in q) {
var u = o['tag_' + t];
this.add(t, q[t].buildPreview(u), u);
}
},
onClick: function(t) {
m.focus();
m.fire('saveSnapshot');
var u = q[t],
v = new d.elementPath(m.getSelection().getStartElement());
u[u.checkActive(v) ? 'remove' : 'apply'](m.document);
setTimeout(function() {
m.fire('saveSnapshot');
}, 0);
},
onRender: function() {
m.on('selectionChange', function(t) {
var u = this.getValue(),
v = t.data.path;
for (var w in q) {
if (q[w].checkActive(v)) {
if (w != u) this.setValue(w, m.lang.format['tag_' + w]);
return;
}
}
this.setValue('');
}, this);
}
});
}
});
i.format_tags = 'p;h1;h2;h3;h4;h5;h6;pre;address;div';
i.format_p = {
element: 'p'
};
i.format_div = {
element: 'div'
};
i.format_pre = {
element: 'pre'
};
i.format_address = {
element: 'address'
};
i.format_h1 = {
element: 'h1'
};
i.format_h2 = {
element: 'h2'
};
i.format_h3 = {
element: 'h3'
};
i.format_h4 = {
element: 'h4'
};
i.format_h5 = {
element: 'h5'
};
i.format_h6 = {
element: 'h6'
};
j.add('forms', {
init: function(m) {
var n = m.lang;
m.addCss('form{border: 1px dotted #FF0000;padding: 2px;}\n');
m.addCss('img.cke_hidden{background-image: url(' + a.getUrl(this.path + 'images/hiddenfield.gif') + ');' + 'background-position: center center;' + 'background-repeat: no-repeat;' + 'border: 1px solid #a9a9a9;' + 'width: 16px !important;' + 'height: 16px !important;' + '}');
var o = function(q, r, s) {
m.addCommand(r, new a.dialogCommand(r));
m.ui.addButton(q, {
label: n.common[q.charAt(0).toLowerCase() + q.slice(1)],
command: r
});
a.dialog.add(r, s);
},
p = this.path + 'dialogs/';
o('Form', 'form', p + 'form.js');
o('Checkbox', 'checkbox', p + 'checkbox.js');
o('Radio', 'radio', p + 'radio.js');
o('TextField', 'textfield', p + 'textfield.js');
o('Textarea', 'textarea', p + 'textarea.js');
o('Select', 'select', p + 'select.js');
o('Button', 'button', p + 'button.js');
o('ImageButton', 'imagebutton', j.getPath('image') + 'dialogs/image.js');
o('HiddenField', 'hiddenfield', p + 'hiddenfield.js');
if (m.addMenuItems) m.addMenuItems({
form: {
label: n.form.menu,
command: 'form',
group: 'form'
},
checkbox: {
label: n.checkboxAndRadio.checkboxTitle,
command: 'checkbox',
group: 'checkbox'
},
radio: {
label: n.checkboxAndRadio.radioTitle,
command: 'radio',
group: 'radio'
},
textfield: {
label: n.textfield.title,
command: 'textfield',
group: 'textfield'
},
hiddenfield: {
label: n.hidden.title,
command: 'hiddenfield',
group: 'hiddenfield'
},
imagebutton: {
label: n.image.titleButton,
command: 'imagebutton',
group: 'imagebutton'
},
button: {
label: n.button.title,
command: 'button',
group: 'button'
},
select: {
label: n.select.title,
command: 'select',
group: 'select'
},
textarea: {
label: n.textarea.title,
command: 'textarea',
group: 'textarea'
}
});
if (m.contextMenu) {
m.contextMenu.addListener(function(q) {
if (q && q.hasAscendant('form', true) && !q.isReadOnly()) return {
form: 2
};
});
m.contextMenu.addListener(function(q) {
if (q && !q.isReadOnly()) {
var r = q.getName();
if (r == 'select') return {
select: 2
};
if (r == 'textarea') return {
textarea: 2
};
if (r == 'input') switch (q.getAttribute('type')) {
case 'button':
case 'submit':
case 'reset':
return {
button: 2
};
case 'checkbox':
return {
checkbox: 2
};
case 'radio':
return {
radio: 2
};
case 'image':
return {
imagebutton: 2
};
default:
return {
textfield: 2
};
}
if (r == 'img' && q.data('cke-real-element-type') == 'hiddenfield') return {
hiddenfield: 2
};
}
});
}
m.on('doubleclick', function(q) {
var r = q.data.element;
if (r.is('form')) q.data.dialog = 'form';
else if (r.is('select')) q.data.dialog = 'select';
else if (r.is('textarea')) q.data.dialog = 'textarea';
else if (r.is('img') && r.data('cke-real-element-type') == 'hiddenfield') q.data.dialog = 'hiddenfield';
else if (r.is('input')) switch (r.getAttribute('type')) {
case 'button':
case 'submit':
case 'reset':
q.data.dialog = 'button';
break;
case 'checkbox':
q.data.dialog = 'checkbox';
break;
case 'radio':
q.data.dialog = 'radio';
break;
case 'image':
q.data.dialog = 'imagebutton';
break;
default:
q.data.dialog = 'textfield';
break;
}
});
},
afterInit: function(m) {
var n = m.dataProcessor,
o = n && n.htmlFilter,
p = n && n.dataFilter;
if (c) o && o.addRules({
elements: {
input: function(q) {
var r = q.attributes,
s = r.type;
if (!s) r.type = 'text';
if (s == 'checkbox' || s == 'radio') r.value == 'on' && delete r.value;
}
}
});
if (p) p.addRules({
elements: {
input: function(q) {
if (q.attributes.type == 'hidden') return m.createFakeParserElement(q, 'cke_hidden', 'hiddenfield');
}
}
});
},
requires: ['image', 'fakeobjects']
});
if (c) h.prototype.hasAttribute = e.override(h.prototype.hasAttribute, function(m) {
return function(n) {
var q = this;
var o = q.$.attributes.getNamedItem(n);
if (q.getName() == 'input') switch (n) {
case 'class':
return q.$.className.length > 0;
case 'checked':
return !!q.$.checked;
case 'value':
var p = q.getAttribute('type');
return p == 'checkbox' || p == 'radio' ? q.$.value != 'on' : q.$.value;
}
return m.apply(q, arguments);
};
});
(function() {
var m = {
canUndo: false,
exec: function(o) {
o.insertElement(o.document.createElement('hr'));
}
},
n = 'horizontalrule';
j.add(n, {
init: function(o) {
o.addCommand(n, m);
o.ui.addButton('HorizontalRule', {
label: o.lang.horizontalrule,
command: n
});
}
});
})();
(function() {
var m = /^[\t\r\n ]*(?: |\xa0)$/,
n = '{cke_protected}';
function o(T) {
var U = T.children.length,
V = T.children[U - 1];
while (V && V.type == 3 && !e.trim(V.value)) V = T.children[--U];
return V;
};
function p(T, U) {
var V = T.children,
W = o(T);
if (W) {
if ((U || !c) && W.type == 1 && W.name == 'br') V.pop();
if (W.type == 3 && m.test(W.value)) V.pop();
}
};
function q(T, U, V) {
if (!U && (!V || typeof V == 'function' && V(T) === false)) return false;
if (U && c && (document.documentMode > 7 || T.name in f.tr || T.name in f.$listItem)) return false;
var W = o(T);
return !W || W && (W.type == 1 && W.name == 'br' || T.name == 'form' && W.name == 'input');
};
function r(T, U) {
return function(V) {
p(V, !T);
if (q(V, !T, U))
if (T || c) V.add(new a.htmlParser.text('\xa0'));
else V.add(new a.htmlParser.element('br', {}));
};
};
var s = f,
t = ['caption', 'colgroup', 'col', 'thead', 'tfoot', 'tbody'],
u = e.extend({}, s.$block, s.$listItem, s.$tableContent);
for (var v in u) {
if (!('br' in s[v])) delete u[v];
}
delete u.pre;
var w = {
elements: {},
attributeNames: [
[/^on/, 'data-cke-pa-on']
]
},
x = {
elements: {}
};
for (v in u) x.elements[v] = r();
var y = {
elementNames: [
[/^cke:/, ''],
[/^\?xml:namespace$/, '']
],
attributeNames: [
[/^data-cke-(saved|pa)-/, ''],
[/^data-cke-.*/, ''],
['hidefocus', '']
],
elements: {
$: function(T) {
var U = T.attributes;
if (U) {
if (U['data-cke-temp']) return false;
var V = ['name', 'href', 'src'],
W;
for (var X = 0; X < V.length; X++) {
W = 'data-cke-saved-' + V[X];
W in U && delete U[V[X]];
}
}
return T;
},
table: function(T) {
var U = T.children;
U.sort(function(V, W) {
return V.type == 1 && W.type == V.type ? e.indexOf(t, V.name) > e.indexOf(t, W.name) ? 1 : -1 : 0;
});
},
embed: function(T) {
var U = T.parent;
if (U && U.name == 'object') {
var V = U.attributes.width,
W = U.attributes.height;
V && (T.attributes.width = V);
W && (T.attributes.height = W);
}
},
param: function(T) {
T.children = [];
T.isEmpty = true;
return T;
},
a: function(T) {
if (!(T.children.length || T.attributes.name || T.attributes['data-cke-saved-name'])) return false;
},
span: function(T) {
if (T.attributes['class'] == 'Apple-style-span') delete T.name;
},
pre: function(T) {
c && p(T);
},
html: function(T) {
delete T.attributes.contenteditable;
delete T.attributes['class'];
},
body: function(T) {
delete T.attributes.spellcheck;
delete T.attributes.contenteditable;
},
style: function(T) {
var U = T.children[0];
U && U.value && (U.value = e.trim(U.value));
if (!T.attributes.type) T.attributes.type = 'text/css';
},
title: function(T) {
var U = T.children[0];
U && (U.value = T.attributes['data-cke-title'] || '');
}
},
attributes: {
'class': function(T, U) {
return e.ltrim(T.replace(/(?:^|\s+)cke_[^\s]*/g, '')) || false;
}
}
};
if (c) y.attributes.style = function(T, U) {
return T.replace(/(^|;)([^\:]+)/g, function(V) {
return V.toLowerCase();
});
};
function z(T) {
var U = T.attributes;
if (U.contenteditable != 'false') U['data-cke-editable'] = U.contenteditable ? 'true' : 1;
U.contenteditable = 'false';
};
function A(T) {
var U = T.attributes;
switch (U['data-cke-editable']) {
case 'true':
U.contenteditable = 'true';
break;
case '1':
delete U.contenteditable;
break;
}
};
for (v in {
input: 1,
textarea: 1
}) {
w.elements[v] = z;
y.elements[v] = A;
}
var B = /<(a|area|img|input)\b([^>]*)>/gi,
C = /\b(href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,
D = /(?:';
!X && (Z = e.buildStyleHtml(C.config.contentsCss) + Z);
var aa = W.baseHref ? '' : '';
if (X) V = V.replace(/]*>/i, function(ab) {
C.docType = Y = ab;
return '';
}).replace(/<\?xml\s[^\?]*\?>/i, function(ab) {
C.xmlDeclaration = ab;
return '';
});
if (C.dataProcessor) V = C.dataProcessor.toHtml(V, D);
if (X) {
if (!/]/.test(V)) V = '' + V;
if (!/]/.test(V)) V = '' + V + '';
if (!/]/.test(V)) V = V.replace(/]*>/, '$&');
else if (!/]/.test(V)) V = V.replace(/]*>/, '$&');
aa && (V = V.replace(//, '$&' + aa));
V = V.replace(/<\/head\s*>/, Z + '$&');
V = Y + V;
} else V = W.docType + '' + '' + '' + E + '' + aa + Z + '' + '' + V + '';
if (b.gecko) V = V.replace(/ (?=\s*<\/(:?html|body)>)/, '$& ');
V += T;
this.onDispose();
S(V);
},
getData: function() {
var V = C.config,
W = V.fullPage,
X = W && C.docType,
Y = W && C.xmlDeclaration,
Z = M.getFrameDocument(),
aa = W ? Z.getDocumentElement().getOuterHtml() : Z.getBody().getHtml();
if (b.gecko) aa = aa.replace(/ (?=\s*(:?$|<\/body>))/, '');
if (C.dataProcessor) aa = C.dataProcessor.toDataFormat(aa, D);
if (V.ignoreEmptyParagraph) aa = aa.replace(m, function(ab, ac) {
return ac;
});
if (Y) aa = Y + '\n' + aa;
if (X) aa = X + '\n' + aa;
return aa;
},
getSnapshotData: function() {
return M.getFrameDocument().getBody().getHtml();
},
loadSnapshotData: function(V) {
M.getFrameDocument().getBody().setHtml(V);
},
onDispose: function() {
if (!C.document) return;
C.document.getDocumentElement().clearCustomData();
C.document.getBody().clearCustomData();
C.window.clearCustomData();
C.document.clearCustomData();
M.clearCustomData();
M.remove();
},
unload: function(V) {
this.onDispose();
C.window = C.document = M = L = O = null;
C.fire('contentDomUnload');
},
focus: function() {
var V = C.window;
if (N) O = true;
else if (b.opera && C.document) {
var W = C.window.$.frameElement;
W.blur(), W.focus();
C.document.getBody().focus();
C.selectionChange();
} else if (!b.opera && V) {
b.air ? setTimeout(function() {
V.focus();
}, 0) : V.focus();
C.selectionChange();
}
}
});
C.on('insertHtml', p(q), null, null, 20);
C.on('insertElement', p(s), null, null, 20);
C.on('insertText', p(r), null, null, 20);
C.on('selectionChange', B, null, null, 1);
});
var G;
C.on('contentDom', function() {
var L = C.document.getElementsByTag('title').getItem(0);
L.data('cke-title', C.document.$.title);
C.document.$.title = E;
});
C.on('readOnly', function() {
if (C.mode == 'wysiwyg') {
var L = C.getMode();
L.loadData(L.getData());
}
});
if (a.document.$.documentMode >= 8) {
C.addCss('html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}');
var H = [];
for (var I in f.$removeEmpty) H.push('html.CSS1Compat ' + I + '[contenteditable=false]');
C.addCss(H.join(',') + '{ display:inline-block;}');
} else if (b.gecko) {
C.addCss('html { height: 100% !important; }');
C.addCss('img:-moz-broken { -moz-force-broken-image-icon : 1;\twidth : 24px; height : 24px; }');
}
C.addCss('html {\t_overflow-y: scroll; cursor: text;\t*cursor:auto;}');
C.addCss('img, input, textarea { cursor: default;}');
function J(L) {
if (C.readOnly) return;
e.tryThese(function() {
C.document.$.designMode = 'on';
setTimeout(function() {
C.document.$.designMode = 'off';
if (a.currentInstance == C) C.document.getBody().focus();
}, 50);
}, function() {
C.document.$.designMode = 'off';
var M = C.document.getBody();
M.setAttribute('contentEditable', false);
M.setAttribute('contentEditable', true);
!L && J(1);
});
};
if (b.gecko || c || b.opera) {
var K;
C.on('uiReady', function() {
K = C.container.append(h.createFromHtml(''));
K.on('focus', function() {
C.focus();
});
C.focusGrabber = K;
});
C.on('destroy', function() {
e.removeFunction(F);
K.clearCustomData();
delete C.focusGrabber;
});
}
C.on('insertElement', function(L) {
var M = L.data;
if (M.type == 1 && (M.is('input') || M.is('textarea'))) {
if (!M.isReadOnly()) M.data('cke-editable', M.hasAttribute('contenteditable') ? 'true' : '1');
M.setAttribute('contentEditable', false);
}
});
}
});
if (b.gecko)(function() {
var C = document.body;
if (!C) window.addEventListener('load', arguments.callee, false);
else {
var D = C.getAttribute('onpageshow');
C.setAttribute('onpageshow', (D ? D + ';' : '') + 'event.persisted && (function(){' + 'var allInstances = CKEDITOR.instances, editor, doc;' + 'for ( var i in allInstances )' + '{' + '\teditor = allInstances[ i ];' + '\tdoc = editor.document;' + '\tif ( doc )' + '\t{' + '\t\tdoc.$.designMode = "off";' + '\t\tdoc.$.designMode = "on";' + '\t}' + '}' + '})();');
}
})();
})();
i.disableObjectResizing = false;
i.disableNativeTableHandles = true;
i.disableNativeSpellChecker = true;
i.ignoreEmptyParagraph = true;
j.add('wsc', {
requires: ['dialog'],
init: function(m) {
var n = 'checkspell',
o = m.addCommand(n, new a.dialogCommand(n));
o.modes = {
wysiwyg: !b.opera && !b.air && document.domain == window.location.hostname
};
m.ui.addButton('SpellChecker', {
label: m.lang.spellCheck.toolbar,
command: n
});
a.dialog.add(n, this.path + 'dialogs/wsc.js');
}
});
i.wsc_customerId = i.wsc_customerId || '1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk';
i.wsc_customLoaderScript = i.wsc_customLoaderScript || null;
a.DIALOG_RESIZE_NONE = 0;
a.DIALOG_RESIZE_WIDTH = 1;
a.DIALOG_RESIZE_HEIGHT = 2;
a.DIALOG_RESIZE_BOTH = 3;
(function() {
var m = e.cssLength;
function n(Q) {
return !!this._.tabs[Q][0].$.offsetHeight;
};
function o() {
var U = this;
var Q = U._.currentTabId,
R = U._.tabIdList.length,
S = e.indexOf(U._.tabIdList, Q) + R;
for (var T = S - 1; T > S - R; T--) {
if (n.call(U, U._.tabIdList[T % R])) return U._.tabIdList[T % R];
}
return null;
};
function p() {
var U = this;
var Q = U._.currentTabId,
R = U._.tabIdList.length,
S = e.indexOf(U._.tabIdList, Q);
for (var T = S + 1; T < S + R; T++) {
if (n.call(U, U._.tabIdList[T % R])) return U._.tabIdList[T % R];
}
return null;
};
function q(Q, R) {
var S = Q.$.getElementsByTagName('input');
for (var T = 0, U = S.length; T < U; T++) {
var V = new h(S[T]);
if (V.getAttribute('type').toLowerCase() == 'text')
if (R) {
V.setAttribute('value', V.getCustomData('fake_value') || '');
V.removeCustomData('fake_value');
} else {
V.setCustomData('fake_value', V.getAttribute('value'));
V.setAttribute('value', '');
}
}
};
a.dialog = function(Q, R) {
var S = a.dialog._.dialogDefinitions[R],
T = e.clone(s),
U = Q.config.dialog_buttonsOrder || 'OS',
V = Q.lang.dir;
if (U == 'OS' && b.mac || U == 'rtl' && V == 'ltr' || U == 'ltr' && V == 'rtl') T.buttons.reverse();
S = e.extend(S(Q), T);
S = e.clone(S);
S = new w(this, S);
var W = a.document,
X = Q.theme.buildDialog(Q);
this._ = {
editor: Q,
element: X.element,
name: R,
contentSize: {
width: 0,
height: 0
},
size: {
width: 0,
height: 0
},
contents: {},
buttons: {},
accessKeyMap: {},
tabs: {},
tabIdList: [],
currentTabId: null,
currentTabIndex: null,
pageCount: 0,
lastTab: null,
tabBarMode: false,
focusList: [],
currentFocusIndex: 0,
hasFocus: false
};
this.parts = X.parts;
e.setTimeout(function() {
Q.fire('ariaWidget', this.parts.contents);
}, 0, this);
var Y = {
position: b.ie6Compat ? 'absolute' : 'fixed',
top: 0,
visibility: 'hidden'
};
Y[V == 'rtl' ? 'right' : 'left'] = 0;
this.parts.dialog.setStyles(Y);
a.event.call(this);
this.definition = S = a.fire('dialogDefinition', {
name: R,
definition: S
}, Q).definition;
var Z = {};
if (!('removeDialogTabs' in Q._) && Q.config.removeDialogTabs) {
var aa = Q.config.removeDialogTabs.split(';');
for (i = 0; i < aa.length; i++) {
var ab = aa[i].split(':');
if (ab.length == 2) {
var ac = ab[0];
if (!Z[ac]) Z[ac] = [];
Z[ac].push(ab[1]);
}
}
Q._.removeDialogTabs = Z;
}
if (Q._.removeDialogTabs && (Z = Q._.removeDialogTabs[R]))
for (i = 0; i < Z.length; i++) S.removeContents(Z[i]);
if (S.onLoad) this.on('load', S.onLoad);
if (S.onShow) this.on('show', S.onShow);
if (S.onHide) this.on('hide', S.onHide);
if (S.onOk) this.on('ok', function(ap) {
Q.fire('saveSnapshot');
setTimeout(function() {
Q.fire('saveSnapshot');
}, 0);
if (S.onOk.call(this, ap) === false) ap.data.hide = false;
});
if (S.onCancel) this.on('cancel', function(ap) {
if (S.onCancel.call(this, ap) === false) ap.data.hide = false;
});
var ad = this,
ae = function(ap) {
var aq = ad._.contents,
ar = false;
for (var as in aq)
for (var at in aq[as]) {
ar = ap.call(this, aq[as][at]);
if (ar) return;
}
};
this.on('ok', function(ap) {
ae(function(aq) {
if (aq.validate) {
var ar = aq.validate(this);
if (typeof ar == 'string') {
alert(ar);
ar = false;
}
if (ar === false) {
if (aq.select) aq.select();
else aq.focus();
ap.data.hide = false;
ap.stop();
return true;
}
}
});
}, this, null, 0);
this.on('cancel', function(ap) {
ae(function(aq) {
if (aq.isChanged()) {
if (!confirm(Q.lang.common.confirmCancel)) ap.data.hide = false;
return true;
}
});
}, this, null, 0);
this.parts.close.on('click', function(ap) {
if (this.fire('cancel', {
hide: true
}).hide !== false) this.hide();
ap.data.preventDefault();
}, this);
function af() {
var ap = ad._.focusList;
ap.sort(function(as, at) {
if (as.tabIndex != at.tabIndex) return at.tabIndex - as.tabIndex;
else return as.focusIndex - at.focusIndex;
});
var aq = ap.length;
for (var ar = 0; ar < aq; ar++) ap[ar].focusIndex = ar;
};
function ag(ap) {
var aq = ad._.focusList,
ar = ap ? 1 : -1;
if (aq.length < 1) return;
var as = ad._.currentFocusIndex;
try {
aq[as].getInputElement().$.blur();
} catch (av) {}
var at = (as + ar + aq.length) % aq.length,
au = at;
while (!aq[au].isFocusable()) {
au = (au + ar + aq.length) % aq.length;
if (au == at) break;
}
aq[au].focus();
if (aq[au].type == 'text') aq[au].select();
};
this.changeFocus = ag;
var ah;
function ai(ap) {
var au = this;
if (ad != a.dialog._.currentTop) return;
var aq = ap.data.getKeystroke(),
ar = Q.lang.dir == 'rtl';
ah = 0;
if (aq == 9 || aq == 2000 + 9) {
var as = aq == 2000 + 9;
if (ad._.tabBarMode) {
var at = as ? o.call(ad) : p.call(ad);
ad.selectPage(at);
ad._.tabs[at][0].focus();
} else ag(!as);
ah = 1;
} else if (aq == 4000 + 121 && !ad._.tabBarMode && ad.getPageCount() > 1) {
ad._.tabBarMode = true;
ad._.tabs[ad._.currentTabId][0].focus();
ah = 1;
} else if ((aq == 37 || aq == 39) && ad._.tabBarMode) {
at = aq == (ar ? 39 : 37) ? o.call(ad) : p.call(ad);
ad.selectPage(at);
ad._.tabs[at][0].focus();
ah = 1;
} else if ((aq == 13 || aq == 32) && ad._.tabBarMode) {
au.selectPage(au._.currentTabId);
au._.tabBarMode = false;
au._.currentFocusIndex = -1;
ag(true);
ah = 1;
}
if (ah) {
ap.stop();
ap.data.preventDefault();
}
};
function aj(ap) {
ah && ap.data.preventDefault();
};
var ak = this._.element;
this.on('show', function() {
ak.on('keydown', ai, this, null, 0);
if (b.opera || b.gecko && b.mac) ak.on('keypress', aj, this);
});
this.on('hide', function() {
ak.removeListener('keydown', ai);
if (b.opera || b.gecko && b.mac) ak.removeListener('keypress', aj);
});
this.on('iframeAdded', function(ap) {
var aq = new g(ap.data.iframe.$.contentWindow.document);
aq.on('keydown', ai, this, null, 0);
});
this.on('show', function() {
var at = this;
af();
if (Q.config.dialog_startupFocusTab && ad._.pageCount > 1) {
ad._.tabBarMode = true;
ad._.tabs[ad._.currentTabId][0].focus();
} else if (!at._.hasFocus) {
at._.currentFocusIndex = -1;
if (S.onFocus) {
var ap = S.onFocus.call(at);
ap && ap.focus();
} else ag(true);
if (at._.editor.mode == 'wysiwyg' && c) {
var aq = Q.document.$.selection,
ar = aq.createRange();
if (ar)
if (ar.parentElement && ar.parentElement().ownerDocument == Q.document.$ || ar.item && ar.item(0).ownerDocument == Q.document.$) {
var as = document.body.createTextRange();
as.moveToElementText(at.getElement().getFirst().$);
as.collapse(true);
as.select();
}
}
}
}, this, null, 4294967295);
if (b.ie6Compat) this.on('load', function(ap) {
var aq = this.getElement(),
ar = aq.getFirst();
ar.remove();
ar.appendTo(aq);
}, this);
y(this);
z(this);
new d.text(S.title, a.document).appendTo(this.parts.title);
for (var al = 0; al < S.contents.length; al++) {
var am = S.contents[al];
am && this.addPage(am);
}
this.parts.tabs.on('click', function(ap) {
var as = this;
var aq = ap.data.getTarget();
if (aq.hasClass('cke_dialog_tab')) {
var ar = aq.$.id;
as.selectPage(ar.substring(4, ar.lastIndexOf('_')));
if (as._.tabBarMode) {
as._.tabBarMode = false;
as._.currentFocusIndex = -1;
ag(true);
}
ap.data.preventDefault();
}
}, this);
var an = [],
ao = a.dialog._.uiElementBuilders.hbox.build(this, {
type: 'hbox',
className: 'cke_dialog_footer_buttons',
widths: [],
children: S.buttons
}, an).getChild();
this.parts.footer.setHtml(an.join(''));
for (al = 0; al < ao.length; al++) this._.buttons[ao[al].id] = ao[al];
};
function r(Q, R, S) {
this.element = R;
this.focusIndex = S;
this.tabIndex = 0;
this.isFocusable = function() {
return !R.getAttribute('disabled') && R.isVisible();
};
this.focus = function() {
Q._.currentFocusIndex = this.focusIndex;
this.element.focus();
};
R.on('keydown', function(T) {
if (T.data.getKeystroke() in {
32: 1,
13: 1
}) this.fire('click');
});
R.on('focus', function() {
this.fire('mouseover');
});
R.on('blur', function() {
this.fire('mouseout');
});
};
a.dialog.prototype = {
destroy: function() {
this.hide();
this._.element.remove();
},
resize: (function() {
return function(Q, R) {
var S = this;
if (S._.contentSize && S._.contentSize.width == Q && S._.contentSize.height == R) return;
a.dialog.fire('resize', {
dialog: S,
skin: S._.editor.skinName,
width: Q,
height: R
}, S._.editor);
S.fire('resize', {
skin: S._.editor.skinName,
width: Q,
height: R
}, S._.editor);
if (S._.editor.lang.dir == 'rtl' && S._.position) S._.position.x = a.document.getWindow().getViewPaneSize().width - S._.contentSize.width - parseInt(S._.element.getFirst().getStyle('right'), 10);
S._.contentSize = {
width: Q,
height: R
};
};
})(),
getSize: function() {
var Q = this._.element.getFirst();
return {
width: Q.$.offsetWidth || 0,
height: Q.$.offsetHeight || 0
};
},
move: (function() {
var Q;
return function(R, S, T) {
var aa = this;
var U = aa._.element.getFirst(),
V = aa._.editor.lang.dir == 'rtl';
if (Q === undefined) Q = U.getComputedStyle('position') == 'fixed';
if (Q && aa._.position && aa._.position.x == R && aa._.position.y == S) return;
aa._.position = {
x: R,
y: S
};
if (!Q) {
var W = a.document.getWindow().getScrollPosition();
R += W.x;
S += W.y;
}
if (V) {
var X = aa.getSize(),
Y = a.document.getWindow().getViewPaneSize();
R = Y.width - X.width - R;
}
var Z = {
top: (S > 0 ? S : 0) + 'px'
};
Z[V ? 'right' : 'left'] = (R > 0 ? R : 0) + 'px';
U.setStyles(Z);
T && (aa._.moved = 1);
};
})(),
getPosition: function() {
return e.extend({}, this._.position);
},
show: function() {
var Q = this._.element,
R = this.definition;
if (!(Q.getParent() && Q.getParent().equals(a.document.getBody()))) Q.appendTo(a.document.getBody());
else Q.setStyle('display', 'block');
if (b.gecko && b.version < 10900) {
var S = this.parts.dialog;
S.setStyle('position', 'absolute');
setTimeout(function() {
S.setStyle('position', 'fixed');
}, 0);
}
this.resize(this._.contentSize && this._.contentSize.width || R.width || R.minWidth, this._.contentSize && this._.contentSize.height || R.height || R.minHeight);
this.reset();
this.selectPage(this.definition.contents[0].id);
if (a.dialog._.currentZIndex === null) a.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex;
this._.element.getFirst().setStyle('z-index', a.dialog._.currentZIndex += 10);
if (a.dialog._.currentTop === null) {
a.dialog._.currentTop = this;
this._.parentDialog = null;
E(this._.editor);
Q.on('keydown', I);
Q.on(b.opera ? 'keypress' : 'keyup', J);
for (var T in {
keyup: 1,
keydown: 1,
keypress: 1
}) Q.on(T, P);
} else {
this._.parentDialog = a.dialog._.currentTop;
var U = this._.parentDialog.getElement().getFirst();
U.$.style.zIndex -= Math.floor(this._.editor.config.baseFloatZIndex / 2);
a.dialog._.currentTop = this;
}
K(this, this, '\x1b', null, function() {
this.getButton('cancel') && this.getButton('cancel').click();
});
this._.hasFocus = false;
e.setTimeout(function() {
this.layout();
this.parts.dialog.setStyle('visibility', '');
this.fireOnce('load', {});
k.fire('ready', this);
this.fire('show', {});
this._.editor.fire('dialogShow', this);
this.foreach(function(V) {
V.setInitValue && V.setInitValue();
});
}, 100, this);
},
layout: function() {
var S = this;
var Q = a.document.getWindow().getViewPaneSize(),
R = S.getSize();
S.move(S._.moved ? S._.position.x : (Q.width - R.width) / 2, S._.moved ? S._.position.y : (Q.height - R.height) / 2);
},
foreach: function(Q) {
var T = this;
for (var R in T._.contents)
for (var S in T._.contents[R]) Q(T._.contents[R][S]);
return T;
},
reset: (function() {
var Q = function(R) {
if (R.reset) R.reset(1);
};
return function() {
this.foreach(Q);
return this;
};
})(),
setupContent: function() {
var Q = arguments;
this.foreach(function(R) {
if (R.setup) R.setup.apply(R, Q);
});
},
commitContent: function() {
var Q = arguments;
this.foreach(function(R) {
if (R.commit) R.commit.apply(R, Q);
});
},
hide: function() {
if (!this.parts.dialog.isVisible()) return;
this.fire('hide', {});
this._.editor.fire('dialogHide', this);
var Q = this._.element;
Q.setStyle('display', 'none');
this.parts.dialog.setStyle('visibility', 'hidden');
L(this);
while (a.dialog._.currentTop != this) a.dialog._.currentTop.hide();
if (!this._.parentDialog) F();
else {
var R = this._.parentDialog.getElement().getFirst();
R.setStyle('z-index', parseInt(R.$.style.zIndex, 10) + Math.floor(this._.editor.config.baseFloatZIndex / 2));
}
a.dialog._.currentTop = this._.parentDialog;
if (!this._.parentDialog) {
a.dialog._.currentZIndex = null;
Q.removeListener('keydown', I);
Q.removeListener(b.opera ? 'keypress' : 'keyup', J);
for (var S in {
keyup: 1,
keydown: 1,
keypress: 1
}) Q.removeListener(S, P);
var T = this._.editor;
T.focus();
if (T.mode == 'wysiwyg' && c) {
var U = T.getSelection();
U && U.unlock(true);
}
} else a.dialog._.currentZIndex -= 10;
delete this._.parentDialog;
this.foreach(function(V) {
V.resetInitValue && V.resetInitValue();
});
},
addPage: function(Q) {
var ac = this;
var R = [],
S = Q.label ? ' title="' + e.htmlEncode(Q.label) + '"' : '',
T = Q.elements,
U = a.dialog._.uiElementBuilders.vbox.build(ac, {
type: 'vbox',
className: 'cke_dialog_page_contents',
children: Q.elements,
expand: !!Q.expand,
padding: Q.padding,
style: Q.style || 'width: 100%;height:100%'
}, R),
V = h.createFromHtml(R.join(''));
V.setAttribute('role', 'tabpanel');
var W = b,
X = 'cke_' + Q.id + '_' + e.getNextNumber(),
Y = h.createFromHtml([' 0 ? ' cke_last' : 'cke_first', S, !!Q.hidden ? ' style="display:none"' : '', ' id="', X, '"', W.gecko && W.version >= 10900 && !W.hc ? '' : ' href="javascript:void(0)"', ' tabIndex="-1"', ' hidefocus="true"', ' role="tab">', Q.label, ''].join(''));
V.setAttribute('aria-labelledby', X);
ac._.tabs[Q.id] = [Y, V];
ac._.tabIdList.push(Q.id);
!Q.hidden && ac._.pageCount++;
ac._.lastTab = Y;
ac.updateStyle();
var Z = ac._.contents[Q.id] = {},
aa, ab = U.getChild();
while (aa = ab.shift()) {
Z[aa.id] = aa;
if (typeof aa.getChild == 'function') ab.push.apply(ab, aa.getChild());
}
V.setAttribute('name', Q.id);
V.appendTo(ac.parts.contents);
Y.unselectable();
ac.parts.tabs.append(Y);
if (Q.accessKey) {
K(ac, ac, 'CTRL+' + Q.accessKey, N, M);
ac._.accessKeyMap['CTRL+' + Q.accessKey] = Q.id;
}
},
selectPage: function(Q) {
if (this._.currentTabId == Q) return;
if (this.fire('selectPage', {
page: Q,
currentPage: this._.currentTabId
}) === true) return;
for (var R in this._.tabs) {
var S = this._.tabs[R][0],
T = this._.tabs[R][1];
if (R != Q) {
S.removeClass('cke_dialog_tab_selected');
T.hide();
}
T.setAttribute('aria-hidden', R != Q);
}
var U = this._.tabs[Q];
U[0].addClass('cke_dialog_tab_selected');
if (b.ie6Compat || b.ie7Compat) {
q(U[1]);
U[1].show();
setTimeout(function() {
q(U[1], 1);
}, 0);
} else U[1].show();
this._.currentTabId = Q;
this._.currentTabIndex = e.indexOf(this._.tabIdList, Q);
},
updateStyle: function() {
this.parts.dialog[(this._.pageCount === 1 ? 'add' : 'remove') + 'Class']('cke_single_page');
},
hidePage: function(Q) {
var S = this;
var R = S._.tabs[Q] && S._.tabs[Q][0];
if (!R || S._.pageCount == 1 || !R.isVisible()) return;
else if (Q == S._.currentTabId) S.selectPage(o.call(S));
R.hide();
S._.pageCount--;
S.updateStyle();
},
showPage: function(Q) {
var S = this;
var R = S._.tabs[Q] && S._.tabs[Q][0];
if (!R) return;
R.show();
S._.pageCount++;
S.updateStyle();
},
getElement: function() {
return this._.element;
},
getName: function() {
return this._.name;
},
getContentElement: function(Q, R) {
var S = this._.contents[Q];
return S && S[R];
},
getValueOf: function(Q, R) {
return this.getContentElement(Q, R).getValue();
},
setValueOf: function(Q, R, S) {
return this.getContentElement(Q, R).setValue(S);
},
getButton: function(Q) {
return this._.buttons[Q];
},
click: function(Q) {
return this._.buttons[Q].click();
},
disableButton: function(Q) {
return this._.buttons[Q].disable();
},
enableButton: function(Q) {
return this._.buttons[Q].enable();
},
getPageCount: function() {
return this._.pageCount;
},
getParentEditor: function() {
return this._.editor;
},
getSelectedElement: function() {
return this.getParentEditor().getSelection().getSelectedElement();
},
addFocusable: function(Q, R) {
var T = this;
if (typeof R == 'undefined') {
R = T._.focusList.length;
T._.focusList.push(new r(T, Q, R));
} else {
T._.focusList.splice(R, 0, new r(T, Q, R));
for (var S = R + 1; S < T._.focusList.length; S++) T._.focusList[S].focusIndex++;
}
}
};
e.extend(a.dialog, {
add: function(Q, R) {
if (!this._.dialogDefinitions[Q] || typeof R == 'function') this._.dialogDefinitions[Q] = R;
},
exists: function(Q) {
return !!this._.dialogDefinitions[Q];
},
getCurrent: function() {
return a.dialog._.currentTop;
},
okButton: (function() {
var Q = function(R, S) {
S = S || {};
return e.extend({
id: 'ok',
type: 'button',
label: R.lang.common.ok,
'class': 'cke_dialog_ui_button_ok',
onClick: function(T) {
var U = T.data.dialog;
if (U.fire('ok', {
hide: true
}).hide !== false) U.hide();
}
}, S, true);
};
Q.type = 'button';
Q.override = function(R) {
return e.extend(function(S) {
return Q(S, R);
}, {
type: 'button'
}, true);
};
return Q;
})(),
cancelButton: (function() {
var Q = function(R, S) {
S = S || {};
return e.extend({
id: 'cancel',
type: 'button',
label: R.lang.common.cancel,
'class': 'cke_dialog_ui_button_cancel',
onClick: function(T) {
var U = T.data.dialog;
if (U.fire('cancel', {
hide: true
}).hide !== false) U.hide();
}
}, S, true);
};
Q.type = 'button';
Q.override = function(R) {
return e.extend(function(S) {
return Q(S, R);
}, {
type: 'button'
}, true);
};
return Q;
})(),
addUIElement: function(Q, R) {
this._.uiElementBuilders[Q] = R;
}
});
a.dialog._ = {
uiElementBuilders: {},
dialogDefinitions: {},
currentTop: null,
currentZIndex: null
};
a.event.implementOn(a.dialog);
a.event.implementOn(a.dialog.prototype, true);
var s = {
resizable: 3,
minWidth: 600,
minHeight: 400,
buttons: [a.dialog.okButton, a.dialog.cancelButton]
},
t = function(Q, R, S) {
for (var T = 0, U; U = Q[T]; T++) {
if (U.id == R) return U;
if (S && U[S]) {
var V = t(U[S], R, S);
if (V) return V;
}
}
return null;
},
u = function(Q, R, S, T, U) {
if (S) {
for (var V = 0, W; W = Q[V]; V++) {
if (W.id == S) {
Q.splice(V, 0, R);
return R;
}
if (T && W[T]) {
var X = u(W[T], R, S, T, true);
if (X) return X;
}
}
if (U) return null;
}
Q.push(R);
return R;
},
v = function(Q, R, S) {
for (var T = 0, U; U = Q[T]; T++) {
if (U.id == R) return Q.splice(T, 1);
if (S && U[S]) {
var V = v(U[S], R, S);
if (V) return V;
}
}
return null;
},
w = function(Q, R) {
this.dialog = Q;
var S = R.contents;
for (var T = 0, U; U = S[T]; T++) S[T] = U && new x(Q, U);
e.extend(this, R);
};
w.prototype = {
getContents: function(Q) {
return t(this.contents, Q);
},
getButton: function(Q) {
return t(this.buttons, Q);
},
addContents: function(Q, R) {
return u(this.contents, Q, R);
},
addButton: function(Q, R) {
return u(this.buttons, Q, R);
},
removeContents: function(Q) {
v(this.contents, Q);
},
removeButton: function(Q) {
v(this.buttons, Q);
}
};
function x(Q, R) {
this._ = {
dialog: Q
};
e.extend(this, R);
};
x.prototype = {
get: function(Q) {
return t(this.elements, Q, 'children');
},
add: function(Q, R) {
return u(this.elements, Q, R, 'children');
},
remove: function(Q) {
v(this.elements, Q, 'children');
}
};
function y(Q) {
var R = null,
S = null,
T = Q.getElement().getFirst(),
U = Q.getParentEditor(),
V = U.config.dialog_magnetDistance,
W = U.skin.margins || [0, 0, 0, 0];
if (typeof V == 'undefined') V = 20;
function X(Z) {
var aa = Q.getSize(),
ab = a.document.getWindow().getViewPaneSize(),
ac = Z.data.$.screenX,
ad = Z.data.$.screenY,
ae = ac - R.x,
af = ad - R.y,
ag, ah;
R = {
x: ac,
y: ad
};
S.x += ae;
S.y += af;
if (S.x + W[3] < V) ag = -W[3];
else if (S.x - W[1] > ab.width - aa.width - V) ag = ab.width - aa.width + (U.lang.dir == 'rtl' ? 0 : W[1]);
else ag = S.x;
if (S.y + W[0] < V) ah = -W[0];
else if (S.y - W[2] > ab.height - aa.height - V) ah = ab.height - aa.height + W[2];
else ah = S.y;
Q.move(ag, ah, 1);
Z.data.preventDefault();
};
function Y(Z) {
a.document.removeListener('mousemove', X);
a.document.removeListener('mouseup', Y);
if (b.ie6Compat) {
var aa = C.getChild(0).getFrameDocument();
aa.removeListener('mousemove', X);
aa.removeListener('mouseup', Y);
}
};
Q.parts.title.on('mousedown', function(Z) {
R = {
x: Z.data.$.screenX,
y: Z.data.$.screenY
};
a.document.on('mousemove', X);
a.document.on('mouseup', Y);
S = Q.getPosition();
if (b.ie6Compat) {
var aa = C.getChild(0).getFrameDocument();
aa.on('mousemove', X);
aa.on('mouseup', Y);
}
Z.data.preventDefault();
}, Q);
};
function z(Q) {
var R = Q.definition,
S = R.resizable;
if (S == 0) return;
var T = Q.getParentEditor(),
U, V, W, X, Y, Z, aa = e.addFunction(function(ad) {
Y = Q.getSize();
var ae = Q.parts.contents,
af = ae.$.getElementsByTagName('iframe').length;
if (af) {
Z = h.createFromHtml('');
ae.append(Z);
}
V = Y.height - Q.parts.contents.getSize('height', !(b.gecko || b.opera || c && b.quirks));
U = Y.width - Q.parts.contents.getSize('width', 1);
X = {
x: ad.screenX,
y: ad.screenY
};
W = a.document.getWindow().getViewPaneSize();
a.document.on('mousemove', ab);
a.document.on('mouseup', ac);
if (b.ie6Compat) {
var ag = C.getChild(0).getFrameDocument();
ag.on('mousemove', ab);
ag.on('mouseup', ac);
}
ad.preventDefault && ad.preventDefault();
});
Q.on('load', function() {
var ad = '';
if (S == 1) ad = ' cke_resizer_horizontal';
else if (S == 2) ad = ' cke_resizer_vertical';
var ae = h.createFromHtml('');
Q.parts.footer.append(ae, 1);
});
T.on('destroy', function() {
e.removeFunction(aa);
});
function ab(ad) {
var ae = T.lang.dir == 'rtl',
af = (ad.data.$.screenX - X.x) * (ae ? -1 : 1),
ag = ad.data.$.screenY - X.y,
ah = Y.width,
ai = Y.height,
aj = ah + af * (Q._.moved ? 1 : 2),
ak = ai + ag * (Q._.moved ? 1 : 2),
al = Q._.element.getFirst(),
am = ae && al.getComputedStyle('right'),
an = Q.getPosition();
if (an.y + ak > W.height) ak = W.height - an.y;
if ((ae ? am : an.x) + aj > W.width) aj = W.width - (ae ? am : an.x);
if (S == 1 || S == 3) ah = Math.max(R.minWidth || 0, aj - U);
if (S == 2 || S == 3) ai = Math.max(R.minHeight || 0, ak - V);
Q.resize(ah, ai);
if (!Q._.moved) Q.layout();
ad.data.preventDefault();
};
function ac() {
a.document.removeListener('mouseup', ac);
a.document.removeListener('mousemove', ab);
if (Z) {
Z.remove();
Z = null;
}
if (b.ie6Compat) {
var ad = C.getChild(0).getFrameDocument();
ad.removeListener('mouseup', ac);
ad.removeListener('mousemove', ab);
}
};
};
var A, B = {},
C;
function D(Q) {
Q.data.preventDefault(1);
};
function E(Q) {
var R = a.document.getWindow(),
S = Q.config,
T = S.dialog_backgroundCoverColor || 'white',
U = S.dialog_backgroundCoverOpacity,
V = S.baseFloatZIndex,
W = e.genKey(T, U, V),
X = B[W];
if (!X) {
var Y = ['
'];
if (b.ie6Compat) {
var Z = b.isCustomDomain(),
aa = "";
Y.push('');
}
Y.push('
');
X = h.createFromHtml(Y.join(''));
X.setOpacity(U != undefined ? U : 0.5);
X.on('keydown', D);
X.on('keypress', D);
X.on('keyup', D);
X.appendTo(a.document.getBody());
B[W] = X;
} else X.show();
C = X;
var ab = function() {
var ae = R.getViewPaneSize();
X.setStyles({
width: ae.width + 'px',
height: ae.height + 'px'
});
},
ac = function() {
var ae = R.getScrollPosition(),
af = a.dialog._.currentTop;
X.setStyles({
left: ae.x + 'px',
top: ae.y + 'px'
});
if (af)
do {
var ag = af.getPosition();
af.move(ag.x, ag.y);
} while (af = af._.parentDialog)
};
A = ab;
R.on('resize', ab);
ab();
if (!(b.mac && b.webkit)) X.focus();
if (b.ie6Compat) {
var ad = function() {
ac();
arguments.callee.prevScrollHandler.apply(this, arguments);
};
R.$.setTimeout(function() {
ad.prevScrollHandler = window.onscroll || (function() {});
window.onscroll = ad;
}, 0);
ac();
}
};
function F() {
if (!C) return;
var Q = a.document.getWindow();
C.hide();
Q.removeListener('resize', A);
if (b.ie6Compat) Q.$.setTimeout(function() {
var R = window.onscroll && window.onscroll.prevScrollHandler;
window.onscroll = R || null;
}, 0);
A = null;
};
function G() {
for (var Q in B) B[Q].remove();
B = {};
};
var H = {},
I = function(Q) {
var R = Q.data.$.ctrlKey || Q.data.$.metaKey,
S = Q.data.$.altKey,
T = Q.data.$.shiftKey,
U = String.fromCharCode(Q.data.$.keyCode),
V = H[(R ? 'CTRL+' : '') + (S ? 'ALT+' : '') + (T ? 'SHIFT+' : '') + U];
if (!V || !V.length) return;
V = V[V.length - 1];
V.keydown && V.keydown.call(V.uiElement, V.dialog, V.key);
Q.data.preventDefault();
},
J = function(Q) {
var R = Q.data.$.ctrlKey || Q.data.$.metaKey,
S = Q.data.$.altKey,
T = Q.data.$.shiftKey,
U = String.fromCharCode(Q.data.$.keyCode),
V = H[(R ? 'CTRL+' : '') + (S ? 'ALT+' : '') + (T ? 'SHIFT+' : '') + U];
if (!V || !V.length) return;
V = V[V.length - 1];
if (V.keyup) {
V.keyup.call(V.uiElement, V.dialog, V.key);
Q.data.preventDefault();
}
},
K = function(Q, R, S, T, U) {
var V = H[S] || (H[S] = []);
V.push({
uiElement: Q,
dialog: R,
key: S,
keyup: U || Q.accessKeyUp,
keydown: T || Q.accessKeyDown
});
},
L = function(Q) {
for (var R in H) {
var S = H[R];
for (var T = S.length - 1; T >= 0; T--) {
if (S[T].dialog == Q || S[T].uiElement == Q) S.splice(T, 1);
}
if (S.length === 0) delete H[R];
}
},
M = function(Q, R) {
if (Q._.accessKeyMap[R]) Q.selectPage(Q._.accessKeyMap[R]);
},
N = function(Q, R) {},
O = {
27: 1,
13: 1
},
P = function(Q) {
if (Q.data.getKeystroke() in O) Q.data.stopPropagation();
};
(function() {
k.dialog = {
uiElement: function(Q, R, S, T, U, V, W) {
if (arguments.length < 4) return;
var X = (T.call ? T(R) : T) || 'div',
Y = ['<', X, ' '],
Z = (U && U.call ? U(R) : U) || {},
aa = (V && V.call ? V(R) : V) || {},
ab = (W && W.call ? W.call(this, Q, R) : W) || '',
ac = this.domId = aa.id || e.getNextId() + '_uiElement',
ad = this.id = R.id,
ae;
aa.id = ac;
var af = {};
if (R.type) af['cke_dialog_ui_' + R.type] = 1;
if (R.className) af[R.className] = 1;
if (R.disabled) af.cke_disabled = 1;
var ag = aa['class'] && aa['class'].split ? aa['class'].split(' ') : [];
for (ae = 0; ae < ag.length; ae++) {
if (ag[ae]) af[ag[ae]] = 1;
}
var ah = [];
for (ae in af) ah.push(ae);
aa['class'] = ah.join(' ');
if (R.title) aa.title = R.title;
var ai = (R.style || '').split(';');
for (ae in Z) ai.push(ae + ':' + Z[ae]);
if (R.hidden) ai.push('display:none');
for (ae = ai.length - 1; ae >= 0; ae--) {
if (ai[ae] === '') ai.splice(ae, 1);
}
if (ai.length > 0) aa.style = (aa.style ? aa.style + '; ' : '') + ai.join('; ');
for (ae in aa) Y.push(ae + '="' + e.htmlEncode(aa[ae]) + '" ');
Y.push('>', ab, '', X, '>');
S.push(Y.join(''));
(this._ || (this._ = {})).dialog = Q;
if (typeof R.isChanged == 'boolean') this.isChanged = function() {
return R.isChanged;
};
if (typeof R.isChanged == 'function') this.isChanged = R.isChanged;
a.event.implementOn(this);
this.registerEvents(R);
if (this.accessKeyUp && this.accessKeyDown && R.accessKey) K(this, Q, 'CTRL+' + R.accessKey);
var aj = this;
Q.on('load', function() {
if (aj.getInputElement()) aj.getInputElement().on('focus', function() {
Q._.tabBarMode = false;
Q._.hasFocus = true;
aj.fire('focus');
}, aj);
});
if (this.keyboardFocusable) {
this.tabIndex = R.tabIndex || 0;
this.focusIndex = Q._.focusList.push(this) - 1;
this.on('focus', function() {
Q._.currentFocusIndex = aj.focusIndex;
});
}
e.extend(this, R);
},
hbox: function(Q, R, S, T, U) {
if (arguments.length < 4) return;
this._ || (this._ = {});
var V = this._.children = R,
W = U && U.widths || null,
X = U && U.height || null,
Y = {},
Z, aa = function() {
var ac = ['
'];
for (Z = 0; Z < S.length; Z++) {
var ad = 'cke_dialog_ui_hbox_child',
ae = [];
if (Z === 0) ad = 'cke_dialog_ui_hbox_first';
if (Z == S.length - 1) ad = 'cke_dialog_ui_hbox_last';
ac.push('
');
return Z.join('');
};
k.dialog.uiElement.call(this, Q, U || {
type: 'vbox'
}, T, 'div', null, {
role: 'presentation'
}, Y);
}
};
})();
k.dialog.uiElement.prototype = {
getElement: function() {
return a.document.getById(this.domId);
},
getInputElement: function() {
return this.getElement();
},
getDialog: function() {
return this._.dialog;
},
setValue: function(Q, R) {
this.getInputElement().setValue(Q);
!R && this.fire('change', {
value: Q
});
return this;
},
getValue: function() {
return this.getInputElement().getValue();
},
isChanged: function() {
return false;
},
selectParentTab: function() {
var T = this;
var Q = T.getInputElement(),
R = Q,
S;
while ((R = R.getParent()) && R.$.className.search('cke_dialog_page_contents') == -1) {}
if (!R) return T;
S = R.getAttribute('name');
if (T._.dialog._.currentTabId != S) T._.dialog.selectPage(S);
return T;
},
focus: function() {
this.selectParentTab().getInputElement().focus();
return this;
},
registerEvents: function(Q) {
var R = /^on([A-Z]\w+)/,
S, T = function(V, W, X, Y) {
W.on('load', function() {
V.getInputElement().on(X, Y, V);
});
};
for (var U in Q) {
if (!(S = U.match(R))) continue;
if (this.eventProcessors[U]) this.eventProcessors[U].call(this, this._.dialog, Q[U]);
else T(this, this._.dialog, S[1].toLowerCase(), Q[U]);
}
return this;
},
eventProcessors: {
onLoad: function(Q, R) {
Q.on('load', R, this);
},
onShow: function(Q, R) {
Q.on('show', R, this);
},
onHide: function(Q, R) {
Q.on('hide', R, this);
}
},
accessKeyDown: function(Q, R) {
this.focus();
},
accessKeyUp: function(Q, R) {},
disable: function() {
var Q = this.getElement();
Q.setAttribute('disabled', 'true');
Q.addClass('cke_disabled');
},
enable: function() {
var Q = this.getElement();
Q.removeAttribute('disabled');
Q.removeClass('cke_disabled');
},
isEnabled: function() {
return !this.getInputElement().getAttribute('disabled');
},
isVisible: function() {
return this.getInputElement().isVisible();
},
isFocusable: function() {
if (!this.isEnabled() || !this.isVisible()) return false;
return true;
}
};
k.dialog.hbox.prototype = e.extend(new k.dialog.uiElement(), {
getChild: function(Q) {
var R = this;
if (arguments.length < 1) return R._.children.concat();
if (!Q.splice) Q = [Q];
if (Q.length < 2) return R._.children[Q[0]];
else return R._.children[Q[0]] && R._.children[Q[0]].getChild ? R._.children[Q[0]].getChild(Q.slice(1, Q.length)) : null;
}
}, true);
k.dialog.vbox.prototype = new k.dialog.hbox();
(function() {
var Q = {
build: function(R, S, T) {
var U = S.children,
V, W = [],
X = [];
for (var Y = 0; Y < U.length && (V = U[Y]); Y++) {
var Z = [];
W.push(Z);
X.push(a.dialog._.uiElementBuilders[V.type].build(R, V, Z));
}
return new k.dialog[S.type](R, X, W, T, S);
}
};
a.dialog.addUIElement('hbox', Q);
a.dialog.addUIElement('vbox', Q);
})();
a.dialogCommand = function(Q) {
this.dialogName = Q;
};
a.dialogCommand.prototype = {
exec: function(Q) {
Q.openDialog(this.dialogName);
},
canUndo: false,
editorFocus: c || b.webkit
};
(function() {
var Q = /^([a]|[^a])+$/,
R = /^\d*$/,
S = /^\d*(?:\.\d+)?$/;
a.VALIDATE_OR = 1;
a.VALIDATE_AND = 2;
a.dialog.validate = {
functions: function() {
return function() {
var Z = this;
var T = Z && Z.getValue ? Z.getValue() : arguments[0],
U = undefined,
V = 2,
W = [],
X;
for (X = 0; X < arguments.length; X++) {
if (typeof arguments[X] == 'function') W.push(arguments[X]);
else break;
}
if (X < arguments.length && typeof arguments[X] == 'string') {
U = arguments[X];
X++;
}
if (X < arguments.length && typeof arguments[X] == 'number') V = arguments[X];
var Y = V == 2 ? true : false;
for (X = 0; X < W.length; X++) {
if (V == 2) Y = Y && W[X](T);
else Y = Y || W[X](T);
}
if (!Y) {
if (U !== undefined) alert(U);
if (Z && (Z.select || Z.focus)) Z.select || Z.focus();
return false;
}
return true;
};
},
regex: function(T, U) {
return function() {
var W = this;
var V = W && W.getValue ? W.getValue() : arguments[0];
if (!T.test(V)) {
if (U !== undefined) alert(U);
if (W && (W.select || W.focus))
if (W.select) W.select();
else W.focus();
return false;
}
return true;
};
},
notEmpty: function(T) {
return this.regex(Q, T);
},
integer: function(T) {
return this.regex(R, T);
},
number: function(T) {
return this.regex(S, T);
},
equals: function(T, U) {
return this.functions(function(V) {
return V == T;
}, U);
},
notEqual: function(T, U) {
return this.functions(function(V) {
return V != T;
}, U);
}
};
a.on('instanceDestroyed', function(T) {
if (e.isEmpty(a.instances)) {
var U;
while (U = a.dialog._.currentTop) U.hide();
G();
}
var V = T.editor._.storedDialogs;
for (var W in V) V[W].destroy();
});
})();
e.extend(a.editor.prototype, {
openDialog: function(Q, R) {
if (this.mode == 'wysiwyg' && c) {
var S = this.getSelection();
S && S.lock();
}
var T = a.dialog._.dialogDefinitions[Q],
U = this.skin.dialog;
if (a.dialog._.currentTop === null) E(this);
if (typeof T == 'function' && U._isLoaded) {
var V = this._.storedDialogs || (this._.storedDialogs = {}),
W = V[Q] || (V[Q] = new a.dialog(this, Q));
R && R.call(W, W);
W.show();
return W;
} else if (T == 'failed') {
F();
throw new Error('[CKEDITOR.dialog.openDialog] Dialog "' + Q + '" failed when loading definition.');
}
var X = this;
function Y(aa) {
var ab = a.dialog._.dialogDefinitions[Q],
ac = X.skin.dialog;
if (!ac._isLoaded || Z && typeof aa == 'undefined') return;
if (typeof ab != 'function') a.dialog._.dialogDefinitions[Q] = 'failed';
X.openDialog(Q, R);
};
if (typeof T == 'string') {
var Z = 1;
a.scriptLoader.load(a.getUrl(T), Y, null, 0, 1);
}
a.skins.load(this, 'dialog', Y);
return null;
}
});
})();
j.add('dialog', {
requires: ['dialogui']
});
j.add('styles', {
requires: ['selection'],
init: function(m) {
m.on('contentDom', function() {
m.document.setCustomData('cke_includeReadonly', !m.config.disableReadonlyStyling);
});
}
});
a.editor.prototype.attachStyleStateChange = function(m, n) {
var o = this._.styleStateChangeCallbacks;
if (!o) {
o = this._.styleStateChangeCallbacks = [];
this.on('selectionChange', function(p) {
for (var q = 0; q < o.length; q++) {
var r = o[q],
s = r.style.checkActive(p.data.path) ? 1 : 2;
r.fn.call(this, s);
}
});
}
o.push({
style: m,
fn: n
});
};
a.STYLE_BLOCK = 1;
a.STYLE_INLINE = 2;
a.STYLE_OBJECT = 3;
(function() {
var m = {
address: 1,
div: 1,
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1,
p: 1,
pre: 1
},
n = {
a: 1,
embed: 1,
hr: 1,
img: 1,
li: 1,
object: 1,
ol: 1,
table: 1,
td: 1,
tr: 1,
th: 1,
ul: 1,
dl: 1,
dt: 1,
dd: 1,
form: 1
},
o = /\s*(?:;\s*|$)/,
p = /#\((.+?)\)/g,
q = d.walker.bookmark(0, 1),
r = d.walker.whitespaces(1);
a.style = function(T, U) {
if (U) {
T = e.clone(T);
L(T.attributes, U);
L(T.styles, U);
}
var V = this.element = (T.element || '*').toLowerCase();
this.type = m[V] ? 1 : n[V] ? 3 : 2;
this._ = {
definition: T
};
};
a.style.prototype = {
apply: function(T) {
S.call(this, T, false);
},
remove: function(T) {
S.call(this, T, true);
},
applyToRange: function(T) {
var U = this;
return (U.applyToRange = U.type == 2 ? t : U.type == 1 ? x : U.type == 3 ? v : null).call(U, T);
},
removeFromRange: function(T) {
var U = this;
return (U.removeFromRange = U.type == 2 ? u : U.type == 1 ? y : U.type == 3 ? w : null).call(U, T);
},
applyToObject: function(T) {
K(T, this);
},
checkActive: function(T) {
var X = this;
switch (X.type) {
case 1:
return X.checkElementRemovable(T.block || T.blockLimit, true);
case 3:
case 2:
var U = T.elements;
for (var V = 0, W; V < U.length; V++) {
W = U[V];
if (X.type == 2 && (W == T.block || W == T.blockLimit)) continue;
if (X.type == 3 && !(W.getName() in n)) continue;
if (X.checkElementRemovable(W, true)) return true;
}
}
return false;
},
checkApplicable: function(T) {
switch (this.type) {
case 2:
case 1:
break;
case 3:
return T.lastElement.getAscendant(this.element, true);
}
return true;
},
checkElementRemovable: function(T, U) {
if (!T || T.isReadOnly()) return false;
var V = this._.definition,
W;
if (T.getName() == this.element) {
if (!U && !T.hasAttributes()) return true;
W = M(V);
if (W._length) {
for (var X in W) {
if (X == '_length') continue;
var Y = T.getAttribute(X) || '';
if (X == 'style' ? R(W[X], P(Y, false)) : W[X] == Y) {
if (!U) return true;
} else if (U) return false;
}
if (U) return true;
} else return true;
}
var Z = N(this)[T.getName()];
if (Z) {
if (!(W = Z.attributes)) return true;
for (var aa = 0; aa < W.length; aa++) {
X = W[aa][0];
var ab = T.getAttribute(X);
if (ab) {
var ac = W[aa][1];
if (ac === null || typeof ac == 'string' && ab == ac || ac.test(ab)) return true;
}
}
}
return false;
},
buildPreview: function(T) {
var U = this._.definition,
V = [],
W = U.element;
if (W == 'bdo') W = 'span';
V = ['<', W];
var X = U.attributes;
if (X)
for (var Y in X) V.push(' ', Y, '="', X[Y], '"');
var Z = a.style.getStyleText(U);
if (Z) V.push(' style="', Z, '"');
V.push('>', T || U.name, '', W, '>');
return V.join('');
}
};
a.style.getStyleText = function(T) {
var U = T._ST;
if (U) return U;
U = T.styles;
var V = T.attributes && T.attributes.style || '',
W = '';
if (V.length) V = V.replace(o, ';');
for (var X in U) {
var Y = U[X],
Z = (X + ':' + Y).replace(o, ';');
if (Y == 'inherit') W += Z;
else V += Z;
}
if (V.length) V = P(V);
V += W;
return T._ST = V;
};
function s(T) {
var U, V;
while (T = T.getParent()) {
if (T.getName() == 'body') break;
if (T.getAttribute('data-nostyle')) U = T;
else if (!V) {
var W = T.getAttribute('contentEditable');
if (W == 'false') U = T;
else if (W == 'true') V = 1;
}
}
return U;
};
function t(T) {
var ax = this;
var U = T.document;
if (T.collapsed) {
var V = J(ax, U);
T.insertNode(V);
T.moveToPosition(V, 2);
return;
}
var W = ax.element,
X = ax._.definition,
Y, Z = X.includeReadonly;
if (Z == undefined) Z = U.getCustomData('cke_includeReadonly');
var aa = f[W] || (Y = true, f.span);
T.enlarge(1, 1);
T.trim();
var ab = T.createBookmark(),
ac = ab.startNode,
ad = ab.endNode,
ae = ac,
af, ag = s(ac),
ah = s(ad);
if (ag) ae = ag.getNextSourceNode(true);
if (ah) ad = ah;
if (ae.getPosition(ad) == 2) ae = 0;
while (ae) {
var ai = false;
if (ae.equals(ad)) {
ae = null;
ai = true;
} else {
var aj = ae.type,
ak = aj == 1 ? ae.getName() : null,
al = ak && ae.getAttribute('contentEditable') == 'false',
am = ak && ae.getAttribute('data-nostyle');
if (ak && ae.data('cke-bookmark')) {
ae = ae.getNextSourceNode(true);
continue;
}
if (!ak || aa[ak] && !am && (!al || Z) && (ae.getPosition(ad) | 4 | 0 | 8) == 4 + 0 + 8 && (!X.childRule || X.childRule(ae))) {
var an = ae.getParent();
if (an && ((an.getDtd() || f.span)[W] || Y) && (!X.parentRule || X.parentRule(an))) {
if (!af && (!ak || !f.$removeEmpty[ak] || (ae.getPosition(ad) | 4 | 0 | 8) == 4 + 0 + 8)) {
af = new d.range(U);
af.setStartBefore(ae);
}
if (aj == 3 || al || aj == 1 && !ae.getChildCount()) {
var ao = ae,
ap;
while ((ai = !ao.getNext(q)) && (ap = ao.getParent(), aa[ap.getName()]) && (ap.getPosition(ac) | 2 | 0 | 8) == 2 + 0 + 8 && (!X.childRule || X.childRule(ap))) ao = ap;
af.setEndAfter(ao);
}
} else ai = true;
} else ai = true;
ae = ae.getNextSourceNode(am || al);
}
if (ai && af && !af.collapsed) {
var aq = J(ax, U),
ar = aq.hasAttributes(),
as = af.getCommonAncestor(),
at = {
styles: {},
attrs: {},
blockedStyles: {},
blockedAttrs: {}
},
au, av, aw;
while (aq && as) {
if (as.getName() == W) {
for (au in X.attributes) {
if (at.blockedAttrs[au] || !(aw = as.getAttribute(av))) continue;
if (aq.getAttribute(au) == aw) at.attrs[au] = 1;
else at.blockedAttrs[au] = 1;
}
for (av in X.styles) {
if (at.blockedStyles[av] || !(aw = as.getStyle(av))) continue;
if (aq.getStyle(av) == aw) at.styles[av] = 1;
else at.blockedStyles[av] = 1;
}
}
as = as.getParent();
}
for (au in at.attrs) aq.removeAttribute(au);
for (av in at.styles) aq.removeStyle(av);
if (ar && !aq.hasAttributes()) aq = null;
if (aq) {
af.extractContents().appendTo(aq);
G(ax, aq);
af.insertNode(aq);
aq.mergeSiblings();
if (!c) aq.$.normalize();
} else {
aq = new h('span');
af.extractContents().appendTo(aq);
af.insertNode(aq);
G(ax, aq);
aq.remove(true);
}
af = null;
}
}
T.moveToBookmark(ab);
T.shrink(2);
};
function u(T) {
T.enlarge(1, 1);
var U = T.createBookmark(),
V = U.startNode;
if (T.collapsed) {
var W = new d.elementPath(V.getParent()),
X;
for (var Y = 0, Z; Y < W.elements.length && (Z = W.elements[Y]); Y++) {
if (Z == W.block || Z == W.blockLimit) break;
if (this.checkElementRemovable(Z)) {
var aa;
if (T.collapsed && (T.checkBoundaryOfElement(Z, 2) || (aa = T.checkBoundaryOfElement(Z, 1)))) {
X = Z;
X.match = aa ? 'start' : 'end';
} else {
Z.mergeSiblings();
if (Z.getName() == this.element) F(this, Z);
else H(Z, N(this)[Z.getName()]);
}
}
}
if (X) {
var ab = V;
for (Y = 0; true; Y++) {
var ac = W.elements[Y];
if (ac.equals(X)) break;
else if (ac.match) continue;
else ac = ac.clone();
ac.append(ab);
ab = ac;
}
ab[X.match == 'start' ? 'insertBefore' : 'insertAfter'](X);
}
} else {
var ad = U.endNode,
ae = this;
function af() {
var ai = new d.elementPath(V.getParent()),
aj = new d.elementPath(ad.getParent()),
ak = null,
al = null;
for (var am = 0; am < ai.elements.length; am++) {
var an = ai.elements[am];
if (an == ai.block || an == ai.blockLimit) break;
if (ae.checkElementRemovable(an)) ak = an;
}
for (am = 0; am < aj.elements.length; am++) {
an = aj.elements[am];
if (an == aj.block || an == aj.blockLimit) break;
if (ae.checkElementRemovable(an)) al = an;
}
if (al) ad.breakParent(al);
if (ak) V.breakParent(ak);
};
af();
var ag = V.getNext();
while (!ag.equals(ad)) {
var ah = ag.getNextSourceNode();
if (ag.type == 1 && this.checkElementRemovable(ag)) {
if (ag.getName() == this.element) F(this, ag);
else H(ag, N(this)[ag.getName()]);
if (ah.type == 1 && ah.contains(V)) {
af();
ah = V.getNext();
}
}
ag = ah;
}
}
T.moveToBookmark(U);
};
function v(T) {
var U = T.getCommonAncestor(true, true),
V = U.getAscendant(this.element, true);
V && !V.isReadOnly() && K(V, this);
};
function w(T) {
var U = T.getCommonAncestor(true, true),
V = U.getAscendant(this.element, true);
if (!V) return;
var W = this,
X = W._.definition,
Y = X.attributes,
Z = a.style.getStyleText(X);
if (Y)
for (var aa in Y) V.removeAttribute(aa, Y[aa]);
if (X.styles)
for (var ab in X.styles) {
if (!X.styles.hasOwnProperty(ab)) continue;
V.removeStyle(ab);
}
};
function x(T) {
var U = T.createBookmark(true),
V = T.createIterator();
V.enforceRealBlocks = true;
if (this._.enterMode) V.enlargeBr = this._.enterMode != 2;
var W, X = T.document,
Y;
while (W = V.getNextParagraph()) {
if (!W.isReadOnly()) {
var Z = J(this, X, W);
z(W, Z);
}
}
T.moveToBookmark(U);
};
function y(T) {
var Y = this;
var U = T.createBookmark(1),
V = T.createIterator();
V.enforceRealBlocks = true;
V.enlargeBr = Y._.enterMode != 2;
var W;
while (W = V.getNextParagraph()) {
if (Y.checkElementRemovable(W))
if (W.is('pre')) {
var X = Y._.enterMode == 2 ? null : T.document.createElement(Y._.enterMode == 1 ? 'p' : 'div');
X && W.copyAttributes(X);
z(W, X);
} else F(Y, W, 1);
}
T.moveToBookmark(U);
};
function z(T, U) {
var V = !U;
if (V) {
U = T.getDocument().createElement('div');
T.copyAttributes(U);
}
var W = U && U.is('pre'),
X = T.is('pre'),
Y = W && !X,
Z = !W && X;
if (Y) U = E(T, U);
else if (Z) U = D(V ? [T.getHtml()] : B(T), U);
else T.moveChildren(U);
U.replace(T);
if (W) A(U);
else if (V) I(U);
};
function A(T) {
var U;
if (!((U = T.getPrevious(r)) && U.is && U.is('pre'))) return;
var V = C(U.getHtml(), /\n$/, '') + '\n\n' + C(T.getHtml(), /^\n/, '');
if (c) T.$.outerHTML = '
' + V + '
';
else T.setHtml(V);
U.remove();
};
function B(T) {
var U = /(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,
V = T.getName(),
W = C(T.getOuterHtml(), U, function(Y, Z, aa) {
return Z + '
' + aa + '
';
}),
X = [];
W.replace(/
([\s\S]*?)<\/pre>/gi, function(Y, Z) {
X.push(Z);
});
return X;
};
function C(T, U, V) {
var W = '',
X = '';
T = T.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi, function(Y, Z, aa) {
Z && (W = Z);
aa && (X = aa);
return '';
});
return W + T.replace(U, V) + X;
};
function D(T, U) {
var V;
if (T.length > 1) V = new d.documentFragment(U.getDocument());
for (var W = 0; W < T.length; W++) {
var X = T[W];
X = X.replace(/(\r\n|\r)/g, '\n');
X = C(X, /^[ \t]*\n/, '');
X = C(X, /\n$/, '');
X = C(X, /^[ \t]+|[ \t]+$/g, function(Z, aa, ab) {
if (Z.length == 1) return ' ';
else if (!aa) return e.repeat(' ', Z.length - 1) + ' ';
else return ' ' + e.repeat(' ', Z.length - 1);
});
X = X.replace(/\n/g, ' ');
X = X.replace(/[ \t]{2,}/g, function(Z) {
return e.repeat(' ', Z.length - 1) + ' ';
});
if (V) {
var Y = U.clone();
Y.setHtml(X);
V.append(Y);
} else U.setHtml(X);
}
return V || U;
};
function E(T, U) {
var V = T.getBogus();
V && V.remove();
var W = T.getHtml();
W = C(W, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, '');
W = W.replace(/[ \t\r\n]*( ]*>)[ \t\r\n]*/gi, '$1');
W = W.replace(/([ \t\n\r]+| )/g, ' ');
W = W.replace(/ ]*>/gi, '\n');
if (c) {
var X = T.getDocument().createElement('div');
X.append(U);
U.$.outerHTML = '
' + W + '
';
U.copyAttributes(X.getFirst());
U = X.getFirst().remove();
} else U.setHtml(W);
return U;
};
function F(T, U) {
var V = T._.definition,
W = e.extend({}, V.attributes, N(T)[U.getName()]),
X = V.styles,
Y = e.isEmpty(W) && e.isEmpty(X);
for (var Z in W) {
if ((Z == 'class' || T._.definition.fullMatch) && U.getAttribute(Z) != O(Z, W[Z])) continue;
Y = U.hasAttribute(Z);
U.removeAttribute(Z);
}
for (var aa in X) {
if (T._.definition.fullMatch && U.getStyle(aa) != O(aa, X[aa], true)) continue;
Y = Y || !!U.getStyle(aa);
U.removeStyle(aa);
}
if (Y) !f.$block[U.getName()] || T._.enterMode == 2 && !U.hasAttributes() ? I(U) : U.renameNode(T._.enterMode == 1 ? 'p' : 'div');
};
function G(T, U) {
var V = T._.definition,
W = V.attributes,
X = V.styles,
Y = N(T),
Z = U.getElementsByTag(T.element);
for (var aa = Z.count(); --aa >= 0;) F(T, Z.getItem(aa));
for (var ab in Y) {
if (ab != T.element) {
Z = U.getElementsByTag(ab);
for (aa = Z.count() - 1; aa >= 0; aa--) {
var ac = Z.getItem(aa);
H(ac, Y[ab]);
}
}
}
};
function H(T, U) {
var V = U && U.attributes;
if (V)
for (var W = 0; W < V.length; W++) {
var X = V[W][0],
Y;
if (Y = T.getAttribute(X)) {
var Z = V[W][1];
if (Z === null || Z.test && Z.test(Y) || typeof Z == 'string' && Y == Z) T.removeAttribute(X);
}
}
I(T);
};
function I(T) {
if (!T.hasAttributes())
if (f.$block[T.getName()]) {
var U = T.getPrevious(r),
V = T.getNext(r);
if (U && (U.type == 3 || !U.isBlockBoundary({
br: 1
}))) T.append('br', 1);
if (V && (V.type == 3 || !V.isBlockBoundary({
br: 1
}))) T.append('br');
T.remove(true);
} else {
var W = T.getFirst(),
X = T.getLast();
T.remove(true);
if (W) {
W.type == 1 && W.mergeSiblings();
if (X && !W.equals(X) && X.type == 1) X.mergeSiblings();
}
}
};
function J(T, U, V) {
var W, X = T._.definition,
Y = T.element;
if (Y == '*') Y = 'span';
W = new h(Y, U);
if (V) V.copyAttributes(W);
W = K(W, T);
if (U.getCustomData('doc_processing_style') && W.hasAttribute('id')) W.removeAttribute('id');
else U.setCustomData('doc_processing_style', 1);
return W;
};
function K(T, U) {
var V = U._.definition,
W = V.attributes,
X = a.style.getStyleText(V);
if (W)
for (var Y in W) T.setAttribute(Y, W[Y]);
if (X) T.setAttribute('style', X);
return T;
};
function L(T, U) {
for (var V in T) T[V] = T[V].replace(p, function(W, X) {
return U[X];
});
};
function M(T) {
var U = T._AC;
if (U) return U;
U = {};
var V = 0,
W = T.attributes;
if (W)
for (var X in W) {
V++;
U[X] = W[X];
}
var Y = a.style.getStyleText(T);
if (Y) {
if (!U.style) V++;
U.style = Y;
}
U._length = V;
return T._AC = U;
};
function N(T) {
if (T._.overrides) return T._.overrides;
var U = T._.overrides = {},
V = T._.definition.overrides;
if (V) {
if (!e.isArray(V)) V = [V];
for (var W = 0; W < V.length; W++) {
var X = V[W],
Y, Z, aa;
if (typeof X == 'string') Y = X.toLowerCase();
else {
Y = X.element ? X.element.toLowerCase() : T.element;
aa = X.attributes;
}
Z = U[Y] || (U[Y] = {});
if (aa) {
var ab = Z.attributes = Z.attributes || [];
for (var ac in aa) ab.push([ac.toLowerCase(), aa[ac]]);
}
}
}
return U;
};
function O(T, U, V) {
var W = new h('span');
W[V ? 'setStyle' : 'setAttribute'](T, U);
return W[V ? 'getStyle' : 'getAttribute'](T);
};
function P(T, U) {
var V;
if (U !== false) {
var W = new h('span');
W.setAttribute('style', T);
V = W.getAttribute('style') || '';
} else V = T;
V = V.replace(/(font-family:)(.*?)(?=;|$)/, function(X, Y, Z) {
var aa = Z.split(',');
for (var ab = 0; ab < aa.length; ab++) aa[ab] = e.trim(aa[ab].replace(/["']/g, ''));
return Y + aa.join(',');
});
return V.replace(/\s*([;:])\s*/, '$1').replace(/([^\s;])$/, '$1;').replace(/,\s+/g, ',').replace(/\"/g, '').toLowerCase();
};
function Q(T) {
var U = {};
T.replace(/"/g, '"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(V, W, X) {
U[W] = X;
});
return U;
};
function R(T, U) {
typeof T == 'string' && (T = Q(T));
typeof U == 'string' && (U = Q(U));
for (var V in T) {
if (!(V in U && (U[V] == T[V] || T[V] == 'inherit' || U[V] == 'inherit'))) return false;
}
return true;
};
function S(T, U) {
var V = T.getSelection(),
W = V.getRanges(),
X = U ? this.removeFromRange : this.applyToRange,
Y, Z = W.createIterator();
while (Y = Z.getNextRange()) X.call(this, Y);
V.selectRanges(W);
T.removeCustomData('doc_processing_style');
};
})();
a.styleCommand = function(m) {
this.style = m;
};
a.styleCommand.prototype.exec = function(m) {
var o = this;
m.focus();
var n = m.document;
if (n)
if (o.state == 2) o.style.apply(n);
else if (o.state == 1) o.style.remove(n);
return !!n;
};
a.stylesSet = new a.resourceManager('', 'stylesSet');
a.addStylesSet = e.bind(a.stylesSet.add, a.stylesSet);
a.loadStylesSet = function(m, n, o) {
a.stylesSet.addExternal(m, n, '');
a.stylesSet.load(m, o);
};
a.editor.prototype.getStylesSet = function(m) {
if (!this._.stylesDefinitions) {
var n = this,
o = n.config.stylesCombo_stylesSet || n.config.stylesSet || 'default';
if (o instanceof Array) {
n._.stylesDefinitions = o;
m(o);
return;
}
var p = o.split(':'),
q = p[0],
r = p[1],
s = j.registered.styles.path;
a.stylesSet.addExternal(q, r ? p.slice(1).join(':') : s + 'styles/' + q + '.js', '');
a.stylesSet.load(q, function(t) {
n._.stylesDefinitions = t[q];
m(n._.stylesDefinitions);
});
} else m(this._.stylesDefinitions);
};
j.add('domiterator');
(function() {
function m(s) {
var t = this;
if (arguments.length < 1) return;
t.range = s;
t.forceBrBreak = 0;
t.enlargeBr = 1;
t.enforceRealBlocks = 0;
t._ || (t._ = {});
};
var n = /^[\r\n\t ]+$/,
o = d.walker.bookmark(false, true),
p = d.walker.whitespaces(true),
q = function(s) {
return o(s) && p(s);
};
function r(s, t, u) {
var v = s.getNextSourceNode(t, null, u);
while (!o(v)) v = v.getNextSourceNode(t, null, u);
return v;
};
m.prototype = {
getNextParagraph: function(s) {
var S = this;
var t, u, v, w, x, y;
if (!S._.lastNode) {
u = S.range.clone();
u.shrink(1, true);
w = u.endContainer.hasAscendant('pre', true) || u.startContainer.hasAscendant('pre', true);
u.enlarge(S.forceBrBreak && !w || !S.enlargeBr ? 3 : 2);
var z = new d.walker(u),
A = d.walker.bookmark(true, true);
z.evaluator = A;
S._.nextNode = z.next();
z = new d.walker(u);
z.evaluator = A;
var B = z.previous();
S._.lastNode = B.getNextSourceNode(true);
if (S._.lastNode && S._.lastNode.type == 3 && !e.trim(S._.lastNode.getText()) && S._.lastNode.getParent().isBlockBoundary()) {
var C = new d.range(u.document);
C.moveToPosition(S._.lastNode, 4);
if (C.checkEndOfBlock()) {
var D = new d.elementPath(C.endContainer),
E = D.block || D.blockLimit;
S._.lastNode = E.getNextSourceNode(true);
}
}
if (!S._.lastNode) {
S._.lastNode = S._.docEndMarker = u.document.createText('');
S._.lastNode.insertAfter(B);
}
u = null;
}
var F = S._.nextNode;
B = S._.lastNode;
S._.nextNode = null;
while (F) {
var G = 0,
H = F.hasAscendant('pre'),
I = F.type != 1,
J = 0;
if (!I) {
var K = F.getName();
if (F.isBlockBoundary(S.forceBrBreak && !H && {
br: 1
})) {
if (K == 'br') I = 1;
else if (!u && !F.getChildCount() && K != 'hr') {
t = F;
v = F.equals(B);
break;
}
if (u) {
u.setEndAt(F, 3);
if (K != 'br') S._.nextNode = F;
}
G = 1;
} else {
if (F.getFirst()) {
if (!u) {
u = new d.range(S.range.document);
u.setStartAt(F, 3);
}
F = F.getFirst();
continue;
}
I = 1;
}
} else if (F.type == 3)
if (n.test(F.getText())) I = 0;
if (I && !u) {
u = new d.range(S.range.document);
u.setStartAt(F, 3);
}
v = (!G || I) && F.equals(B);
if (u && !G)
while (!F.getNext(q) && !v) {
var L = F.getParent();
if (L.isBlockBoundary(S.forceBrBreak && !H && {
br: 1
})) {
G = 1;
I = 0;
v = v || L.equals(B);
u.setEndAt(L, 2);
break;
}
F = L;
I = 1;
v = F.equals(B);
J = 1;
}
if (I) u.setEndAt(F, 4);
F = r(F, J, B);
v = !F;
if (v || G && u) break;
}
if (!t) {
if (!u) {
S._.docEndMarker && S._.docEndMarker.remove();
S._.nextNode = null;
return null;
}
var M = new d.elementPath(u.startContainer),
N = M.blockLimit,
O = {
div: 1,
th: 1,
td: 1
};
t = M.block;
if (!t && !S.enforceRealBlocks && O[N.getName()] && u.checkStartOfBlock() && u.checkEndOfBlock()) t = N;
else if (!t || S.enforceRealBlocks && t.getName() == 'li') {
t = S.range.document.createElement(s || 'p');
u.extractContents().appendTo(t);
t.trim();
u.insertNode(t);
x = y = true;
} else if (t.getName() != 'li') {
if (!u.checkStartOfBlock() || !u.checkEndOfBlock()) {
t = t.clone(false);
u.extractContents().appendTo(t);
t.trim();
var P = u.splitBlock();
x = !P.wasStartOfBlock;
y = !P.wasEndOfBlock;
u.insertNode(t);
}
} else if (!v) S._.nextNode = t.equals(B) ? null : r(u.getBoundaryNodes().endNode, 1, B);
}
if (x) {
var Q = t.getPrevious();
if (Q && Q.type == 1)
if (Q.getName() == 'br') Q.remove();
else if (Q.getLast() && Q.getLast().$.nodeName.toLowerCase() == 'br') Q.getLast().remove();
}
if (y) {
var R = t.getLast();
if (R && R.type == 1 && R.getName() == 'br')
if (c || R.getPrevious(o) || R.getNext(o)) R.remove();
}
if (!S._.nextNode) S._.nextNode = v || t.equals(B) ? null : r(t, 1, B);
return t;
}
};
d.range.prototype.createIterator = function() {
return new m(this);
};
})();
j.add('panelbutton', {
requires: ['button'],
beforeInit: function(m) {
m.ui.addHandler('panelbutton', k.panelButton.handler);
}
});
a.UI_PANELBUTTON = 'panelbutton';
(function() {
var m = function(n) {
var p = this;
var o = p._;
if (o.state == 0) return;
p.createPanel(n);
if (o.on) {
o.panel.hide();
return;
}
o.panel.showBlock(p._.id, p.document.getById(p._.id), 4);
};
k.panelButton = e.createClass({
base: k.button,
$: function(n) {
var p = this;
var o = n.panel;
delete n.panel;
p.base(n);
p.document = o && o.parent && o.parent.getDocument() || a.document;
o.block = {
attributes: o.attributes
};
p.hasArrow = true;
p.click = m;
p._ = {
panelDefinition: o
};
},
statics: {
handler: {
create: function(n) {
return new k.panelButton(n);
}
}
},
proto: {
createPanel: function(n) {
var o = this._;
if (o.panel) return;
var p = this._.panelDefinition || {},
q = this._.panelDefinition.block,
r = p.parent || a.document.getBody(),
s = this._.panel = new k.floatPanel(n, r, p),
t = s.addBlock(o.id, q),
u = this;
s.onShow = function() {
if (u.className) this.element.getFirst().addClass(u.className + '_panel');
u.setState(1);
o.on = 1;
if (u.onOpen) u.onOpen();
};
s.onHide = function(v) {
if (u.className) this.element.getFirst().removeClass(u.className + '_panel');
u.setState(u.modes && u.modes[n.mode] ? 2 : 0);
o.on = 0;
if (!v && u.onClose) u.onClose();
};
s.onEscape = function() {
s.hide();
u.document.getById(o.id).focus();
};
if (this.onBlock) this.onBlock(s, t);
t.onHide = function() {
o.on = 0;
u.setState(2);
};
}
}
});
})();
j.add('floatpanel', {
requires: ['panel']
});
(function() {
var m = {},
n = false;
function o(p, q, r, s, t) {
var u = e.genKey(q.getUniqueId(), r.getUniqueId(), p.skinName, p.lang.dir, p.uiColor || '', s.css || '', t || ''),
v = m[u];
if (!v) {
v = m[u] = new k.panel(q, s);
v.element = r.append(h.createFromHtml(v.renderHtml(p), q));
v.element.setStyles({
display: 'none',
position: 'absolute'
});
}
return v;
};
k.floatPanel = e.createClass({
$: function(p, q, r, s) {
r.forceIFrame = 1;
var t = q.getDocument(),
u = o(p, t, q, r, s || 0),
v = u.element,
w = v.getFirst().getFirst();
this.element = v;
this._ = {
panel: u,
parentElement: q,
definition: r,
document: t,
iframe: w,
children: [],
dir: p.lang.dir
};
p.on('mode', function() {
this.hide();
}, this);
},
proto: {
addBlock: function(p, q) {
return this._.panel.addBlock(p, q);
},
addListBlock: function(p, q) {
return this._.panel.addListBlock(p, q);
},
getBlock: function(p) {
return this._.panel.getBlock(p);
},
showBlock: function(p, q, r, s, t) {
var u = this._.panel,
v = u.showBlock(p);
this.allowBlur(false);
n = 1;
var w = this.element,
x = this._.iframe,
y = this._.definition,
z = q.getDocumentPosition(w.getDocument()),
A = this._.dir == 'rtl',
B = z.x + (s || 0),
C = z.y + (t || 0);
if (A && (r == 1 || r == 4)) B += q.$.offsetWidth;
else if (!A && (r == 2 || r == 3)) B += q.$.offsetWidth - 1;
if (r == 3 || r == 4) C += q.$.offsetHeight - 1;
this._.panel._.offsetParentId = q.getId();
w.setStyles({
top: C + 'px',
left: 0,
display: ''
});
w.setOpacity(0);
w.getFirst().removeStyle('width');
if (!this._.blurSet) {
var D = c ? x : new d.window(x.$.contentWindow);
a.event.useCapture = true;
D.on('blur', function(E) {
var G = this;
if (!G.allowBlur()) return;
var F;
if (c && !G.allowBlur() || (F = E.data.getTarget()) && F.getName && F.getName() != 'iframe') return;
if (G.visible && !G._.activeChild && !n) G.hide();
}, this);
D.on('focus', function() {
this._.focused = true;
this.hideChild();
this.allowBlur(true);
}, this);
a.event.useCapture = false;
this._.blurSet = 1;
}
u.onEscape = e.bind(function(E) {
if (this.onEscape && this.onEscape(E) === false) return false;
}, this);
e.setTimeout(function() {
if (A) B -= w.$.offsetWidth;
var E = e.bind(function() {
var F = w.getFirst();
if (v.autoSize) {
var G = v.element.$;
if (b.gecko || b.opera) G = G.parentNode;
if (c) G = G.document.body;
var H = G.scrollWidth;
if (c && b.quirks && H > 0) H += (F.$.offsetWidth || 0) - (F.$.clientWidth || 0);
H += 4;
F.setStyle('width', H + 'px');
v.element.addClass('cke_frameLoaded');
var I = v.element.$.scrollHeight;
if (c && b.quirks && I > 0) I += (F.$.offsetHeight || 0) - (F.$.clientHeight || 0);
F.setStyle('height', I + 'px');
u._.currentBlock.element.setStyle('display', 'none').removeStyle('display');
} else F.removeStyle('height');
var J = u.element,
K = J.getWindow(),
L = K.getScrollPosition(),
M = K.getViewPaneSize(),
N = {
height: J.$.offsetHeight,
width: J.$.offsetWidth
};
if (A ? B < 0 : B + N.width > M.width + L.x) B += N.width * (A ? 1 : -1);
if (C + N.height > M.height + L.y) C -= N.height;
if (c) {
var O = new h(w.$.offsetParent),
P = O;
if (P.getName() == 'html') P = P.getDocument().getBody();
if (P.getComputedStyle('direction') == 'rtl')
if (b.ie8Compat) B -= w.getDocument().getDocumentElement().$.scrollLeft * 2;
else B -= O.$.scrollWidth - O.$.clientWidth;
}
var Q = w.getFirst(),
R;
if (R = Q.getCustomData('activePanel')) R.onHide && R.onHide.call(this, 1);
Q.setCustomData('activePanel', this);
w.setStyles({
top: C + 'px',
left: B + 'px'
});
w.setOpacity(1);
}, this);
u.isLoaded ? E() : u.onLoad = E;
e.setTimeout(function() {
x.$.contentWindow.focus();
this.allowBlur(true);
}, 0, this);
}, b.air ? 200 : 0, this);
this.visible = 1;
if (this.onShow) this.onShow.call(this);
n = 0;
},
hide: function() {
var p = this;
if (p.visible && (!p.onHide || p.onHide.call(p) !== true)) {
p.hideChild();
p.element.setStyle('display', 'none');
p.visible = 0;
p.element.getFirst().removeCustomData('activePanel');
}
},
allowBlur: function(p) {
var q = this._.panel;
if (p != undefined) q.allowBlur = p;
return q.allowBlur;
},
showAsChild: function(p, q, r, s, t, u) {
if (this._.activeChild == p && p._.panel._.offsetParentId == r.getId()) return;
this.hideChild();
p.onHide = e.bind(function() {
e.setTimeout(function() {
if (!this._.focused) this.hide();
}, 0, this);
}, this);
this._.activeChild = p;
this._.focused = false;
p.showBlock(q, r, s, t, u);
if (b.ie7Compat || b.ie8 && b.ie6Compat) setTimeout(function() {
p.element.getChild(0).$.style.cssText += '';
}, 100);
},
hideChild: function() {
var p = this._.activeChild;
if (p) {
delete p.onHide;
delete this._.activeChild;
p.hide();
}
}
}
});
a.on('instanceDestroyed', function() {
var p = e.isEmpty(a.instances);
for (var q in m) {
var r = m[q];
if (p) r.destroy();
else r.element.hide();
}
p && (m = {});
});
})();
j.add('menu', {
beforeInit: function(m) {
var n = m.config.menu_groups.split(','),
o = m._.menuGroups = {},
p = m._.menuItems = {};
for (var q = 0; q < n.length; q++) o[n[q]] = q + 1;
m.addMenuGroup = function(r, s) {
o[r] = s || 100;
};
m.addMenuItem = function(r, s) {
if (o[s.group]) p[r] = new a.menuItem(this, r, s);
};
m.addMenuItems = function(r) {
for (var s in r) this.addMenuItem(s, r[s]);
};
m.getMenuItem = function(r) {
return p[r];
};
},
requires: ['floatpanel']
});
(function() {
a.menu = e.createClass({
$: function(n, o) {
var r = this;
o = r._.definition = o || {};
r.id = e.getNextId();
r.editor = n;
r.items = [];
r._.listeners = [];
r._.level = o.level || 1;
var p = e.extend({}, o.panel, {
css: n.skin.editor.css,
level: r._.level - 1,
block: {}
}),
q = p.block.attributes = p.attributes || {};
!q.role && (q.role = 'menu');
r._.panelDefinition = p;
},
_: {
onShow: function() {
var v = this;
var n = v.editor.getSelection();
if (c) n && n.lock();
var o = n && n.getStartElement(),
p = v._.listeners,
q = [];
v.removeAll();
for (var r = 0; r < p.length; r++) {
var s = p[r](o, n);
if (s)
for (var t in s) {
var u = v.editor.getMenuItem(t);
if (u && (!u.command || v.editor.getCommand(u.command).state)) {
u.state = s[t];
v.add(u);
}
}
}
},
onClick: function(n) {
this.hide();
if (n.onClick) n.onClick();
else if (n.command) this.editor.execCommand(n.command);
},
onEscape: function(n) {
var o = this.parent;
if (o) {
o._.panel.hideChild();
var p = o._.panel._.panel._.currentBlock,
q = p._.focusIndex;
p._.markItem(q);
} else if (n == 27) {
this.hide();
this.editor.focus();
}
return false;
},
onHide: function() {
if (c) {
var n = this.editor.getSelection();
n && n.unlock();
}
this.onHide && this.onHide();
},
showSubMenu: function(n) {
var v = this;
var o = v._.subMenu,
p = v.items[n],
q = p.getItems && p.getItems();
if (!q) {
v._.panel.hideChild();
return;
}
var r = v._.panel.getBlock(v.id);
r._.focusIndex = n;
if (o) o.removeAll();
else {
o = v._.subMenu = new a.menu(v.editor, e.extend({}, v._.definition, {
level: v._.level + 1
}, true));
o.parent = v;
o._.onClick = e.bind(v._.onClick, v);
}
for (var s in q) {
var t = v.editor.getMenuItem(s);
if (t) {
t.state = q[s];
o.add(t);
}
}
var u = v._.panel.getBlock(v.id).element.getDocument().getById(v.id + String(n));
o.show(u, 2);
}
},
proto: {
add: function(n) {
if (!n.order) n.order = this.items.length;
this.items.push(n);
},
removeAll: function() {
this.items = [];
},
show: function(n, o, p, q) {
if (!this.parent) {
this._.onShow();
if (!this.items.length) return;
}
o = o || (this.editor.lang.dir == 'rtl' ? 2 : 1);
var r = this.items,
s = this.editor,
t = this._.panel,
u = this._.element;
if (!t) {
t = this._.panel = new k.floatPanel(this.editor, a.document.getBody(), this._.panelDefinition, this._.level);
t.onEscape = e.bind(function(F) {
if (this._.onEscape(F) === false) return false;
}, this);
t.onHide = e.bind(function() {
this._.onHide && this._.onHide();
}, this);
var v = t.addBlock(this.id, this._.panelDefinition.block);
v.autoSize = true;
var w = v.keys;
w[40] = 'next';
w[9] = 'next';
w[38] = 'prev';
w[2000 + 9] = 'prev';
w[32] = 'click';
w[s.lang.dir == 'rtl' ? 37 : 39] = 'click';
u = this._.element = v.element;
u.addClass(s.skinClass);
var x = u.getDocument();
x.getBody().setStyle('overflow', 'hidden');
x.getElementsByTag('html').getItem(0).setStyle('overflow', 'hidden');
this._.itemOverFn = e.addFunction(function(F) {
var G = this;
clearTimeout(G._.showSubTimeout);
G._.showSubTimeout = e.setTimeout(G._.showSubMenu, s.config.menu_subMenuDelay || 400, G, [F]);
}, this);
this._.itemOutFn = e.addFunction(function(F) {
clearTimeout(this._.showSubTimeout);
}, this);
this._.itemClickFn = e.addFunction(function(F) {
var H = this;
var G = H.items[F];
if (G.state == 0) {
H.hide();
return;
}
if (G.getItems) H._.showSubMenu(F);
else H._.onClick(G);
}, this);
}
m(r);
var y = s.container.getChild(1),
z = y.hasClass('cke_mixed_dir_content') ? ' cke_mixed_dir_content' : '',
A = ['
'],
B = r.length,
C = B && r[0].group;
for (var D = 0; D < B; D++) {
var E = r[D];
if (C != E.group) {
A.push('');
C = E.group;
}
E.render(this, D, A);
}
A.push('
');
u.setHtml(A.join(''));
k.fire('ready', this);
if (this.parent) this.parent._.panel.showAsChild(t, this.id, n, o, p, q);
else t.showBlock(this.id, n, o, p, q);
s.fire('menuShow', [t]);
},
addListener: function(n) {
this._.listeners.push(n);
},
hide: function() {
var n = this;
n._.onHide && n._.onHide();
n._.panel && n._.panel.hide();
}
}
});
function m(n) {
n.sort(function(o, p) {
if (o.group < p.group) return -1;
else if (o.group > p.group) return 1;
return o.order < p.order ? -1 : o.order > p.order ? 1 : 0;
});
};
a.menuItem = e.createClass({
$: function(n, o, p) {
var q = this;
e.extend(q, p, {
order: 0,
className: 'cke_button_' + o
});
q.group = n._.menuGroups[q.group];
q.editor = n;
q.name = o;
},
proto: {
render: function(n, o, p) {
var w = this;
var q = n.id + String(o),
r = typeof w.state == 'undefined' ? 2 : w.state,
s = ' cke_' + (r == 1 ? 'on' : r == 0 ? 'disabled' : 'off'),
t = w.label;
if (w.className) s += ' ' + w.className;
var u = w.getItems;
p.push('' + '' + '');
if (u) p.push('', '', w.editor.lang.dir == 'rtl' ? '9668' : '9658', ';', '');
p.push(t, '');
}
}
});
})();
i.menu_groups = 'clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';
(function() {
var m;
j.add('editingblock', {
init: function(n) {
if (!n.config.editingBlock) return;
n.on('themeSpace', function(o) {
if (o.data.space == 'contents') o.data.html += ' ';
});
n.on('themeLoaded', function() {
n.fireOnce('editingBlockReady');
});
n.on('uiReady', function() {
n.setMode(n.config.startupMode);
});
n.on('afterSetData', function() {
if (!m) {
function o() {
console.log("afterSetData- Setting m to TRUE");
m = true;
n.getMode().loadData(n.getData());
console.log("afterSetData- Setting m to FALSE");
m = false;
};
if (n.mode) o();
else n.on('mode', function() {
if (n.mode) {
o();
n.removeListener('mode', arguments.callee);
}
});
}
});
n.on('beforeGetData', function() {
if (!m && n.mode) {
m = true;
try {
n.setData(n.getMode().getData(), null, 1);
} catch (e) {
console.log("error in beforeGetData: " + e);
console.log(e);
}
m = false;
}
});
n.on('getSnapshot', function(o) {
if (n.mode) o.data = n.getMode().getSnapshotData();
});
n.on('loadSnapshot', function(o) {
if (n.mode) n.getMode().loadSnapshotData(o.data);
});
n.on('mode', function(o) {
o.removeListener();
b.webkit && n.container.on('focus', function() {
n.focus();
});
if (n.config.startupFocus) n.focus();
setTimeout(function() {
n.fireOnce('instanceReady');
a.fire('instanceReady', null, n);
}, 0);
});
n.on('destroy', function() {
var o = this;
if (o.mode) o._.modes[o.mode].unload(o.getThemeSpace('contents'));
});
}
});
a.editor.prototype.mode = '';
a.editor.prototype.addMode = function(n, o) {
o.name = n;
(this._.modes || (this._.modes = {}))[n] = o;
};
a.editor.prototype.setMode = function(n) {
this.fire('beforeSetMode', {
newMode: n
});
var o, p = this.getThemeSpace('contents'),
q = this.checkDirty();
if (this.mode) {
if (n == this.mode) return;
this.fire('beforeModeUnload');
var r = this.getMode();
o = r.getData();
r.unload(p);
this.mode = '';
}
p.setHtml('');
var s = this.getMode(n);
if (!s) throw '[CKEDITOR.editor.setMode] Unknown mode "' + n + '".';
if (!q) this.on('mode', function() {
this.resetDirty();
this.removeListener('mode', arguments.callee);
});
s.load(p, typeof o != 'string' ? this.getData() : o);
};
a.editor.prototype.getMode = function(n) {
return this._.modes && this._.modes[n || this.mode];
};
a.editor.prototype.focus = function() {
this.forceNextSelectionCheck();
var n = this.getMode();
if (n) n.focus();
};
})();
i.startupMode = 'wysiwyg';
i.editingBlock = true;
(function() {
function m() {
var B = this;
try {
var y = B.getSelection();
if (!y || !y.document.getWindow().$) return;
var z = y.getStartElement(),
A = new d.elementPath(z);
if (!A.compare(B._.selectionPreviousPath)) {
B._.selectionPreviousPath = A;
B.fire('selectionChange', {
selection: y,
path: A,
element: z
});
}
} catch (C) {}
};
var n, o;
function p() {
o = true;
if (n) return;
q.call(this);
n = e.setTimeout(q, 200, this);
};
function q() {
n = null;
if (o) {
e.setTimeout(m, 0, this);
o = false;
}
};
function r(y) {
function z(C) {
return C && C.type == 1 && C.getName() in f.$removeEmpty;
};
var A = y.startContainer,
B = y.startOffset;
if (A.type == 3) return false;
return !e.trim(A.getHtml()) ? z(A) : z(A.getChild(B - 1)) || z(A.getChild(B));
};
var s = {
modes: {
wysiwyg: 1,
source: 1
},
readOnly: c || b.webkit,
exec: function(y) {
switch (y.mode) {
case 'wysiwyg':
y.document.$.execCommand('SelectAll', false, null);
y.forceNextSelectionCheck();
y.selectionChange();
break;
case 'source':
var z = y.textarea.$;
if (c) z.createTextRange().execCommand('SelectAll');
else {
z.selectionStart = 0;
z.selectionEnd = z.value.length;
}
z.focus();
}
},
canUndo: false
};
function t(y) {
w(y);
var z = y.createText('');
y.setCustomData('cke-fillingChar', z);
return z;
};
function u(y) {
return y && y.getCustomData('cke-fillingChar');
};
function v(y) {
var z = y && u(y);
if (z)
if (z.getCustomData('ready')) w(y);
else z.setCustomData('ready', 1);
};
function w(y) {
var z = y && y.removeCustomData('cke-fillingChar');
if (z) {
z.setText(z.getText().replace(/\u200B/g, ''));
z = 0;
}
};
j.add('selection', {
init: function(y) {
if (b.webkit) {
y.on('selectionChange', function() {
v(y.document);
});
y.on('beforeSetMode', function() {
w(y.document);
});
y.on('key', function(D) {
switch (D.data.keyCode) {
case 13:
case 2000 + 13:
case 37:
case 39:
case 8:
w(y.document);
}
}, null, null, 10);
var z, A;
function B() {
var D = y.document,
E = u(D);
if (E) {
var F = D.$.defaultView.getSelection();
if (F.type == 'Caret' && F.anchorNode == E.$) A = 1;
z = E.getText();
E.setText(z.replace(/\u200B/g, ''));
}
};
function C() {
var D = y.document,
E = u(D);
if (E) {
E.setText(z);
if (A) {
D.$.defaultView.getSelection().setPosition(E.$, E.getLength());
A = 0;
}
}
};
y.on('beforeUndoImage', B);
y.on('afterUndoImage', C);
y.on('beforeGetData', B, null, null, 0);
y.on('getData', C);
}
y.on('contentDom', function() {
var D = y.document,
E = D.getBody(),
F = D.getDocumentElement();
if (c) {
var G, H, I = 1;
E.on('focusin', function(M) {
if (M.data.$.srcElement.nodeName != 'BODY') return;
if (G) {
if (I) {
try {
G.select();
} catch (O) {}
var N = D.getCustomData('cke_locked_selection');
if (N) {
N.unlock();
N.lock();
}
}
G = null;
}
});
E.on('focus', function() {
H = 1;
L();
});
E.on('beforedeactivate', function(M) {
if (M.data.$.toElement) return;
H = 0;
I = 1;
});
if (c && b.version < 8) y.on('blur', function(M) {
try {
y.document && y.document.$.selection.empty();
} catch (N) {}
});
F.on('mousedown', function() {
I = 0;
});
F.on('mouseup', function() {
I = 1;
});
if (c && (b.ie7Compat || b.version < 8 || b.quirks)) F.on('click', function(M) {
if (M.data.getTarget().getName() == 'html') y.getSelection().getRanges()[0].select();
});
var J;
E.on('mousedown', function(M) {
if (M.data.$.button == 2) {
var N = y.document.$.selection;
if (N.type == 'None') J = y.window.getScrollPosition();
}
K();
});
E.on('mouseup', function(M) {
if (M.data.$.button == 2 && J) {
y.document.$.documentElement.scrollLeft = J.x;
y.document.$.documentElement.scrollTop = J.y;
}
J = null;
H = 1;
setTimeout(function() {
L(true);
}, 0);
});
E.on('keydown', K);
E.on('keyup', function() {
H = 1;
L();
});
D.on('selectionchange', L);
function K() {
H = 0;
};
function L(M) {
if (H) {
var N = y.document,
O = y.getSelection(),
P = O && O.getNative();
if (M && P && P.type == 'None')
if (!N.$.queryCommandEnabled('InsertImage')) {
e.setTimeout(L, 50, this, true);
return;
}
var Q;
if (P && P.type && P.type != 'Control' && (Q = P.createRange()) && (Q = Q.parentElement()) && (Q = Q.nodeName) && Q.toLowerCase() in {
input: 1,
textarea: 1
}) return;
G = P && O.getRanges()[0];
p.call(y);
}
};
} else {
D.on('mouseup', p, y);
D.on('keyup', p, y);
}
});
y.on('contentDomUnload', y.forceNextSelectionCheck, y);
y.addCommand('selectAll', s);
y.ui.addButton('SelectAll', {
label: y.lang.selectAll,
command: 'selectAll'
});
y.selectionChange = p;
}
});
a.editor.prototype.getSelection = function() {
return this.document && this.document.getSelection();
};
a.editor.prototype.forceNextSelectionCheck = function() {
delete this._.selectionPreviousPath;
};
g.prototype.getSelection = function() {
var y = new d.selection(this);
return !y || y.isInvalid ? null : y;
};
a.SELECTION_NONE = 1;
a.SELECTION_TEXT = 2;
a.SELECTION_ELEMENT = 3;
d.selection = function(y) {
var B = this;
var z = y.getCustomData('cke_locked_selection');
if (z) return z;
B.document = y;
B.isLocked = 0;
B._ = {
cache: {}
};
if (c) {
var A = B.getNative().createRange();
if (!A || A.item && A.item(0).ownerDocument != B.document.$ || A.parentElement && A.parentElement().ownerDocument != B.document.$) B.isInvalid = true;
}
return B;
};
var x = {
img: 1,
hr: 1,
li: 1,
table: 1,
tr: 1,
td: 1,
th: 1,
embed: 1,
object: 1,
ol: 1,
ul: 1,
a: 1,
input: 1,
form: 1,
select: 1,
textarea: 1,
button: 1,
fieldset: 1,
thead: 1,
tfoot: 1
};
d.selection.prototype = {
getNative: c ? function() {
return this._.cache.nativeSel || (this._.cache.nativeSel = this.document.$.selection);
} : function() {
return this._.cache.nativeSel || (this._.cache.nativeSel = this.document.getWindow().$.getSelection());
},
getType: c ? function() {
var y = this._.cache;
if (y.type) return y.type;
var z = 1;
try {
var A = this.getNative(),
B = A.type;
if (B == 'Text') z = 2;
if (B == 'Control') z = 3;
if (A.createRange().parentElement) z = 2;
} catch (C) {}
return y.type = z;
} : function() {
var y = this._.cache;
if (y.type) return y.type;
var z = 2,
A = this.getNative();
if (!A) z = 1;
else if (A.rangeCount == 1) {
var B = A.getRangeAt(0),
C = B.startContainer;
if (C == B.endContainer && C.nodeType == 1 && B.endOffset - B.startOffset == 1 && x[C.childNodes[B.startOffset].nodeName.toLowerCase()]) z = 3;
}
return y.type = z;
},
getRanges: (function() {
var y = c ? (function() {
function z(B) {
return new d.node(B).getIndex();
};
var A = function(B, C) {
B = B.duplicate();
B.collapse(C);
var D = B.parentElement(),
E = D.ownerDocument;
if (!D.hasChildNodes()) return {
container: D,
offset: 0
};
var F = D.children,
G, H, I = B.duplicate(),
J = 0,
K = F.length - 1,
L = -1,
M, N;
while (J <= K) {
L = Math.floor((J + K) / 2);
G = F[L];
I.moveToElementText(G);
M = I.compareEndPoints('StartToStart', B);
if (M > 0) K = L - 1;
else if (M < 0) J = L + 1;
else if (b.ie9Compat && G.tagName == 'BR') {
var O = 'cke_range_marker';
B.execCommand('CreateBookmark', false, O);
G = E.getElementsByName(O)[0];
var P = z(G);
D.removeChild(G);
return {
container: D,
offset: P
};
} else return {
container: D,
offset: z(G)
};
}
if (L == -1 || L == F.length - 1 && M < 0) {
I.moveToElementText(D);
I.setEndPoint('StartToStart', B);
N = I.text.replace(/(\r\n|\r)/g, '\n').length;
F = D.childNodes;
if (!N) {
G = F[F.length - 1];
if (G.nodeType == 1) return {
container: D,
offset: F.length
};
else return {
container: G,
offset: G.nodeValue.length
};
}
var Q = F.length;
while (N > 0) N -= F[--Q].nodeValue.length;
return {
container: F[Q],
offset: -N
};
} else {
I.collapse(M > 0 ? true : false);
I.setEndPoint(M > 0 ? 'StartToStart' : 'EndToStart', B);
N = I.text.replace(/(\r\n|\r)/g, '\n').length;
if (!N) return {
container: D,
offset: z(G) + (M > 0 ? 0 : 1)
};
while (N > 0) try {
H = G[M > 0 ? 'previousSibling' : 'nextSibling'];
N -= H.nodeValue.length;
G = H;
} catch (R) {
return {
container: D,
offset: z(G)
};
}
return {
container: G,
offset: M > 0 ? -N : G.nodeValue.length + N
};
}
};
return function() {
var L = this;
var B = L.getNative(),
C = B && B.createRange(),
D = L.getType(),
E;
if (!B) return [];
if (D == 2) {
E = new d.range(L.document);
var F = A(C, true);
E.setStart(new d.node(F.container), F.offset);
F = A(C);
E.setEnd(new d.node(F.container), F.offset);
if (E.endContainer.getPosition(E.startContainer) & 4 && E.endOffset <= E.startContainer.getIndex()) E.collapse();
return [E];
} else if (D == 3) {
var G = [];
for (var H = 0; H < C.length; H++) {
var I = C.item(H),
J = I.parentNode,
K = 0;
E = new d.range(L.document);
for (; K < J.childNodes.length && J.childNodes[K] != I; K++) {}
E.setStart(new d.node(J), K);
E.setEnd(new d.node(J), K + 1);
G.push(E);
}
return G;
}
return [];
};
})() : function() {
var z = [],
A, B = this.document,
C = this.getNative();
if (!C) return z;
if (!C.rangeCount) {
A = new d.range(B);
A.moveToElementEditStart(B.getBody());
z.push(A);
}
for (var D = 0; D < C.rangeCount; D++) {
var E = C.getRangeAt(D);
A = new d.range(B);
A.setStart(new d.node(E.startContainer), E.startOffset);
A.setEnd(new d.node(E.endContainer), E.endOffset);
z.push(A);
}
return z;
};
return function(z) {
var A = this._.cache;
if (A.ranges && !z) return A.ranges;
else if (!A.ranges) A.ranges = new d.rangeList(y.call(this));
if (z) {
var B = A.ranges;
for (var C = 0; C < B.length; C++) {
var D = B[C],
E = D.getCommonAncestor();
if (E.isReadOnly()) B.splice(C, 1);
if (D.collapsed) continue;
var F = D.startContainer,
G = D.endContainer,
H = D.startOffset,
I = D.endOffset,
J = D.clone(),
K;
if (K = F.isReadOnly()) D.setStartAfter(K);
if (F && F.type == 3)
if (H >= F.getLength()) J.setStartAfter(F);
else J.setStartBefore(F);
if (G && G.type == 3)
if (!I) J.setEndBefore(G);
else J.setEndAfter(G);
var L = new d.walker(J);
L.evaluator = function(M) {
if (M.type == 1 && M.isReadOnly()) {
var N = D.clone();
D.setEndBefore(M);
if (D.collapsed) B.splice(C--, 1);
if (!(M.getPosition(J.endContainer) & 16)) {
N.setStartAfter(M);
if (!N.collapsed) B.splice(C + 1, 0, N);
}
return true;
}
return false;
};
L.next();
}
}
return A.ranges;
};
})(),
getStartElement: function() {
var F = this;
var y = F._.cache;
if (y.startElement !== undefined) return y.startElement;
var z, A = F.getNative();
switch (F.getType()) {
case 3:
return F.getSelectedElement();
case 2:
var B = F.getRanges()[0];
if (B) {
if (!B.collapsed) {
B.optimize();
while (1) {
var C = B.startContainer,
D = B.startOffset;
if (D == (C.getChildCount ? C.getChildCount() : C.getLength()) && !C.isBlockBoundary()) B.setStartAfter(C);
else break;
}
z = B.startContainer;
if (z.type != 1) return z.getParent();
z = z.getChild(B.startOffset);
if (!z || z.type != 1) z = B.startContainer;
else {
var E = z.getFirst();
while (E && E.type == 1) {
z = E;
E = E.getFirst();
}
}
} else {
z = B.startContainer;
if (z.type != 1) z = z.getParent();
}
z = z.$;
}
}
return y.startElement = z ? new h(z) : null;
},
getSelectedElement: function() {
var y = this._.cache;
if (y.selectedElement !== undefined) return y.selectedElement;
var z = this,
A = e.tryThese(function() {
return z.getNative().createRange().item(0);
}, function() {
var B = z.getRanges()[0],
C, D;
for (var E = 2; E && !((C = B.getEnclosedNode()) && C.type == 1 && x[C.getName()] && (D = C)); E--) B.shrink(1);
return D.$;
});
return y.selectedElement = A ? new h(A) : null;
},
lock: function() {
var y = this;
y.getRanges();
y.getStartElement();
y.getSelectedElement();
y._.cache.nativeSel = {};
y.isLocked = 1;
y.document.setCustomData('cke_locked_selection', y);
},
unlock: function(y) {
var D = this;
var z = D.document,
A = z.getCustomData('cke_locked_selection');
if (A) {
z.setCustomData('cke_locked_selection', null);
if (y) {
var B = A.getSelectedElement(),
C = !B && A.getRanges();
D.isLocked = 0;
D.reset();
z.getBody().focus();
if (B) D.selectElement(B);
else D.selectRanges(C);
}
}
if (!A || !y) {
D.isLocked = 0;
D.reset();
}
},
reset: function() {
this._.cache = {};
},
selectElement: function(y) {
var A = this;
if (A.isLocked) {
var z = new d.range(A.document);
z.setStartBefore(y);
z.setEndAfter(y);
A._.cache.selectedElement = y;
A._.cache.startElement = y;
A._.cache.ranges = new d.rangeList(z);
A._.cache.type = 3;
return;
}
z = new d.range(y.getDocument());
z.setStartBefore(y);
z.setEndAfter(y);
z.select();
A.document.fire('selectionchange');
A.reset();
},
selectRanges: function(y) {
var M = this;
if (M.isLocked) {
M._.cache.selectedElement = null;
M._.cache.startElement = y[0] && y[0].getTouchedStartNode();
M._.cache.ranges = new d.rangeList(y);
M._.cache.type = 2;
return;
}
if (c) {
if (y.length > 1) {
var z = y[y.length - 1];
y[0].setEnd(z.endContainer, z.endOffset);
y.length = 1;
}
if (y[0]) y[0].select();
M.reset();
} else {
var A = M.getNative();
if (!A) return;
if (y.length) {
A.removeAllRanges();
b.webkit && w(M.document);
}
for (var B = 0; B < y.length; B++) {
if (B < y.length - 1) {
var C = y[B],
D = y[B + 1],
E = C.clone();
E.setStart(C.endContainer, C.endOffset);
E.setEnd(D.startContainer, D.startOffset);
if (!E.collapsed) {
E.shrink(1, true);
var F = E.getCommonAncestor(),
G = E.getEnclosedNode();
if (F.isReadOnly() || G && G.isReadOnly()) {
D.setStart(C.startContainer, C.startOffset);
y.splice(B--, 1);
continue;
}
}
}
var H = y[B],
I = M.document.$.createRange(),
J = H.startContainer;
if (H.collapsed && (b.opera || b.gecko && b.version < 10900) && J.type == 1 && !J.getChildCount()) J.appendText('');
if (H.collapsed && b.webkit && r(H)) {
var K = t(M.document);
H.insertNode(K);
var L = K.getNext();
if (L && !K.getPrevious() && L.type == 1 && L.getName() == 'br') {
w(M.document);
H.moveToPosition(L, 3);
} else H.moveToPosition(K, 4);
}
I.setStart(H.startContainer.$, H.startOffset);
try {
I.setEnd(H.endContainer.$, H.endOffset);
} catch (N) {
if (N.toString().indexOf('NS_ERROR_ILLEGAL_VALUE') >= 0) {
H.collapse(1);
I.setEnd(H.endContainer.$, H.endOffset);
} else throw N;
}
A.addRange(I);
}
M.reset();
}
},
createBookmarks: function(y) {
return this.getRanges().createBookmarks(y);
},
createBookmarks2: function(y) {
return this.getRanges().createBookmarks2(y);
},
selectBookmarks: function(y) {
var z = [];
for (var A = 0; A < y.length; A++) {
var B = new d.range(this.document);
B.moveToBookmark(y[A]);
z.push(B);
}
this.selectRanges(z);
return this;
},
getCommonAncestor: function() {
var y = this.getRanges(),
z = y[0].startContainer,
A = y[y.length - 1].endContainer;
return z.getCommonAncestor(A);
},
scrollIntoView: function() {
var y = this.getStartElement();
y.scrollIntoView();
}
};
})();
(function() {
var m = d.walker.whitespaces(true),
n = /\ufeff|\u00a0/,
o = {
table: 1,
tbody: 1,
tr: 1
};
d.range.prototype.select = c ? function(p) {
var A = this;
var q = A.collapsed,
r, s, t, u = A.getEnclosedNode();
if (u) try {
t = A.document.$.body.createControlRange();
t.addElement(u.$);
t.select();
return;
} catch (B) {}
if (A.startContainer.type == 1 && A.startContainer.getName() in o || A.endContainer.type == 1 && A.endContainer.getName() in o) A.shrink(1, true);
var v = A.createBookmark(),
w = v.startNode,
x;
if (!q) x = v.endNode;
t = A.document.$.body.createTextRange();
t.moveToElementText(w.$);
t.moveStart('character', 1);
if (x) {
var y = A.document.$.body.createTextRange();
y.moveToElementText(x.$);
t.setEndPoint('EndToEnd', y);
t.moveEnd('character', -1);
} else {
var z = w.getNext(m);
r = !(z && z.getText && z.getText().match(n)) && (p || !w.hasPrevious() || w.getPrevious().is && w.getPrevious().is('br'));
s = A.document.createElement('span');
s.setHtml('');
s.insertBefore(w);
if (r) A.document.createText('\ufeff').insertBefore(w);
}
A.setStartBefore(w);
w.remove();
if (q) {
if (r) {
t.moveStart('character', -1);
t.select();
A.document.$.selection.clear();
} else t.select();
A.moveToPosition(s, 3);
s.remove();
} else {
A.setEndBefore(x);
x.remove();
t.select();
}
A.document.fire('selectionchange');
} : function() {
this.document.getSelection().selectRanges([this]);
};
})();
(function() {
var m = {
elements: {
$: function(n) {
var o = n.attributes,
p = o && o['data-cke-realelement'],
q = p && new a.htmlParser.fragment.fromHtml(decodeURIComponent(p)),
r = q && q.children[0];
if (r && n.attributes['data-cke-resizable']) {
var s = n.attributes.style;
if (s) {
var t = /(?:^|\s)width\s*:\s*(\d+)/i.exec(s),
u = t && t[1];
t = /(?:^|\s)height\s*:\s*(\d+)/i.exec(s);
var v = t && t[1];
if (u) r.attributes.width = u;
if (v) r.attributes.height = v;
}
}
return r;
}
}
};
j.add('fakeobjects', {
requires: ['htmlwriter'],
afterInit: function(n) {
var o = n.dataProcessor,
p = o && o.htmlFilter;
if (p) p.addRules(m);
}
});
})();
a.editor.prototype.createFakeElement = function(m, n, o, p) {
var q = this.lang.fakeobjects,
r = q[o] || q.unknown,
s = {
'class': n,
src: a.getUrl('images/spacer.gif'),
'data-cke-realelement': encodeURIComponent(m.getOuterHtml()),
'data-cke-real-node-type': m.type,
alt: r,
title: r,
align: m.getAttribute('align') || ''
};
if (o) s['data-cke-real-element-type'] = o;
if (p) s['data-cke-resizable'] = p;
return this.document.createElement('img', {
attributes: s
});
};
a.editor.prototype.createFakeParserElement = function(m, n, o, p) {
var q = this.lang.fakeobjects,
r = q[o] || q.unknown,
s, t = new a.htmlParser.basicWriter();
m.writeHtml(t);
s = t.getHtml();
var u = {
'class': n,
src: a.getUrl('images/spacer.gif'),
'data-cke-realelement': encodeURIComponent(s),
'data-cke-real-node-type': m.type,
alt: r,
title: r,
align: m.attributes.align || ''
};
if (o) u['data-cke-real-element-type'] = o;
if (p) u['data-cke-resizable'] = p;
return new a.htmlParser.element('img', u);
};
a.editor.prototype.restoreRealElement = function(m) {
if (m.data('cke-real-node-type') != 1) return null;
return h.createFromHtml(decodeURIComponent(m.data('cke-realelement')), this.document);
};
j.add('richcombo', {
requires: ['floatpanel', 'listblock', 'button'],
beforeInit: function(m) {
m.ui.addHandler('richcombo', k.richCombo.handler);
}
});
a.UI_RICHCOMBO = 'richcombo';
k.richCombo = e.createClass({
$: function(m) {
var o = this;
e.extend(o, m, {
title: m.label,
modes: {
wysiwyg: 1
}
});
var n = o.panel || {};
delete o.panel;
o.id = e.getNextNumber();
o.document = n && n.parent && n.parent.getDocument() || a.document;
n.className = (n.className || '') + ' cke_rcombopanel';
n.block = {
multiSelect: n.multiSelect,
attributes: n.attributes
};
o._ = {
panelDefinition: n,
items: {},
state: 2
};
},
statics: {
handler: {
create: function(m) {
return new k.richCombo(m);
}
}
},
proto: {
renderHtml: function(m) {
var n = [];
this.render(m, n);
return n.join('');
},
render: function(m, n) {
var o = b,
p = 'cke_' + this.id,
q = e.addFunction(function(u) {
var x = this;
var v = x._;
if (v.state == 0) return;
x.createPanel(m);
if (v.on) {
v.panel.hide();
return;
}
x.commit();
var w = x.getValue();
if (w) v.list.mark(w);
else v.list.unmarkAll();
v.panel.showBlock(x.id, new h(u), 4);
}, this),
r = {
id: p,
combo: this,
focus: function() {
var u = a.document.getById(p).getChild(1);
u.focus();
},
clickFn: q
};
function s() {
var v = this;
var u = v.modes[m.mode] ? 2 : 0;
v.setState(m.readOnly && !v.readOnly ? 0 : u);
v.setValue('');
};
m.on('mode', s, this);
!this.readOnly && m.on('readOnly', s, this);
var t = e.addFunction(function(u, v) {
u = new d.event(u);
var w = u.getKeystroke();
switch (w) {
case 13:
case 32:
case 40:
e.callFunction(q, v);
break;
default:
r.onkey(r, w);
}
u.preventDefault();
});
r.keyDownFn = t;
n.push('', '', '', this.label, '', '= 10900 && !o.hc ? '' : " href=\"javascript:void('" + this.label + "')\"", ' role="button" aria-labelledby="', p, '_label" aria-describedby="', p, '_text" aria-haspopup="true"');
if (b.opera || b.gecko && b.mac) n.push(' onkeypress="return false;"');
if (b.gecko) n.push(' onblur="this.style.cssText = this.style.cssText;"');
n.push(' onkeydown="CKEDITOR.tools.callFunction( ', t, ', event, this );" onclick="CKEDITOR.tools.callFunction(', q, ', this); return false;">' + this.label + '' + '' + '' + (b.hc ? '▼' : b.air ? ' ' : '') + '' + '' + '' + '');
if (this.onRender) this.onRender();
return r;
},
createPanel: function(m) {
if (this._.panel) return;
var n = this._.panelDefinition,
o = this._.panelDefinition.block,
p = n.parent || a.document.getBody(),
q = new k.floatPanel(m, p, n),
r = q.addListBlock(this.id, o),
s = this;
q.onShow = function() {
if (s.className) this.element.getFirst().addClass(s.className + '_panel');
s.setState(1);
r.focus(!s.multiSelect && s.getValue());
s._.on = 1;
if (s.onOpen) s.onOpen();
};
q.onHide = function(t) {
if (s.className) this.element.getFirst().removeClass(s.className + '_panel');
s.setState(s.modes && s.modes[m.mode] ? 2 : 0);
s._.on = 0;
if (!t && s.onClose) s.onClose();
};
q.onEscape = function() {
q.hide();
s.document.getById('cke_' + s.id).getFirst().getNext().focus();
};
r.onClick = function(t, u) {
s.document.getWindow().focus();
if (s.onClick) s.onClick.call(s, t, u);
if (u) s.setValue(t, s._.items[t]);
else s.setValue('');
q.hide();
};
this._.panel = q;
this._.list = r;
q.getBlock(this.id).onHide = function() {
s._.on = 0;
s.setState(2);
};
if (this.init) this.init();
},
setValue: function(m, n) {
var p = this;
p._.value = m;
var o = p.document.getById('cke_' + p.id + '_text');
if (o) {
if (!(m || n)) {
n = p.label;
o.addClass('cke_inline_label');
} else o.removeClass('cke_inline_label');
o.setHtml(typeof n != 'undefined' ? n : m);
}
},
getValue: function() {
return this._.value || '';
},
unmarkAll: function() {
this._.list.unmarkAll();
},
mark: function(m) {
this._.list.mark(m);
},
hideItem: function(m) {
this._.list.hideItem(m);
},
hideGroup: function(m) {
this._.list.hideGroup(m);
},
showAll: function() {
this._.list.showAll();
},
add: function(m, n, o) {
this._.items[m] = o || m;
this._.list.add(m, n, o);
},
startGroup: function(m) {
this._.list.startGroup(m);
},
commit: function() {
var m = this;
if (!m._.committed) {
m._.list.commit();
m._.committed = 1;
k.fire('ready', m);
}
m._.committed = 1;
},
setState: function(m) {
var n = this;
if (n._.state == m) return;
n.document.getById('cke_' + n.id).setState(m);
n._.state = m;
}
}
});
k.prototype.addRichCombo = function(m, n) {
this.add(m, 'richcombo', n);
};
j.add('htmlwriter');
a.htmlWriter = e.createClass({
base: a.htmlParser.basicWriter,
$: function() {
var o = this;
o.base();
o.indentationChars = '\t';
o.selfClosingEnd = ' />';
o.lineBreakChars = '\n';
o.forceSimpleAmpersand = 0;
o.sortAttributes = 1;
o._.indent = 0;
o._.indentation = '';
o._.inPre = 0;
o._.rules = {};
var m = f;
for (var n in e.extend({}, m.$nonBodyContent, m.$block, m.$listItem, m.$tableContent)) o.setRules(n, {
indent: 1,
breakBeforeOpen: 1,
breakAfterOpen: 1,
breakBeforeClose: !m[n]['#'],
breakAfterClose: 1
});
o.setRules('br', {
breakAfterOpen: 1
});
o.setRules('title', {
indent: 0,
breakAfterOpen: 0
});
o.setRules('style', {
indent: 0,
breakBeforeClose: 1
});
o.setRules('pre', {
indent: 0
});
},
proto: {
openTag: function(m, n) {
var p = this;
var o = p._.rules[m];
if (p._.indent) p.indentation();
else if (o && o.breakBeforeOpen) {
p.lineBreak();
p.indentation();
}
p._.output.push('<', m);
},
openTagClose: function(m, n) {
var p = this;
var o = p._.rules[m];
if (n) p._.output.push(p.selfClosingEnd);
else {
p._.output.push('>');
if (o && o.indent) p._.indentation += p.indentationChars;
}
if (o && o.breakAfterOpen) p.lineBreak();
m == 'pre' && (p._.inPre = 1);
},
attribute: function(m, n) {
if (typeof n == 'string') {
this.forceSimpleAmpersand && (n = n.replace(/&/g, '&'));
n = e.htmlEncodeAttr(n);
}
this._.output.push(' ', m, '="', n, '"');
},
closeTag: function(m) {
var o = this;
var n = o._.rules[m];
if (n && n.indent) o._.indentation = o._.indentation.substr(o.indentationChars.length);
if (o._.indent) o.indentation();
else if (n && n.breakBeforeClose) {
o.lineBreak();
o.indentation();
}
o._.output.push('', m, '>');
m == 'pre' && (o._.inPre = 0);
if (n && n.breakAfterClose) o.lineBreak();
},
text: function(m) {
var n = this;
if (n._.indent) {
n.indentation();
!n._.inPre && (m = e.ltrim(m));
}
n._.output.push(m);
},
comment: function(m) {
if (this._.indent) this.indentation();
this._.output.push('');
},
lineBreak: function() {
var m = this;
if (!m._.inPre && m._.output.length > 0) m._.output.push(m.lineBreakChars);
m._.indent = 1;
},
indentation: function() {
var m = this;
if (!m._.inPre) m._.output.push(m._.indentation);
m._.indent = 0;
},
setRules: function(m, n) {
var o = this._.rules[m];
if (o) e.extend(o, n, true);
else this._.rules[m] = n;
}
}
});
j.add('menubutton', {
requires: ['button', 'menu'],
beforeInit: function(m) {
m.ui.addHandler('menubutton', k.menuButton.handler);
}
});
a.UI_MENUBUTTON = 'menubutton';
(function() {
var m = function(n) {
var o = this._;
if (o.state === 0) return;
o.previousState = o.state;
var p = o.menu;
if (!p) {
p = o.menu = new a.menu(n, {
panel: {
className: n.skinClass + ' cke_contextmenu',
attributes: {
'aria-label': n.lang.common.options
}
}
});
p.onHide = e.bind(function() {
this.setState(this.modes && this.modes[n.mode] ? o.previousState : 0);
}, this);
if (this.onMenu) p.addListener(this.onMenu);
}
if (o.on) {
p.hide();
return;
}
this.setState(1);
p.show(a.document.getById(this._.id), 4);
};
k.menuButton = e.createClass({
base: k.button,
$: function(n) {
var o = n.panel;
delete n.panel;
this.base(n);
this.hasArrow = true;
this.click = m;
},
statics: {
handler: {
create: function(n) {
return new k.menuButton(n);
}
}
}
});
})();
j.add('dialogui');
(function() {
var m = function(u) {
var x = this;
x._ || (x._ = {});
x._['default'] = x._.initValue = u['default'] || '';
x._.required = u.required || false;
var v = [x._];
for (var w = 1; w < arguments.length; w++) v.push(arguments[w]);
v.push(true);
e.extend.apply(e, v);
return x._;
},
n = {
build: function(u, v, w) {
return new k.dialog.textInput(u, v, w);
}
},
o = {
build: function(u, v, w) {
return new k.dialog[v.type](u, v, w);
}
},
p = {
build: function(u, v, w) {
var x = v.children,
y, z = [],
A = [];
for (var B = 0; B < x.length && (y = x[B]); B++) {
var C = [];
z.push(C);
A.push(a.dialog._.uiElementBuilders[y.type].build(u, y, C));
}
return new k.dialog[v.type](u, A, z, w, v);
}
},
q = {
isChanged: function() {
return this.getValue() != this.getInitValue();
},
reset: function(u) {
this.setValue(this.getInitValue(), u);
},
setInitValue: function() {
this._.initValue = this.getValue();
},
resetInitValue: function() {
this._.initValue = this._['default'];
},
getInitValue: function() {
return this._.initValue;
}
},
r = e.extend({}, k.dialog.uiElement.prototype.eventProcessors, {
onChange: function(u, v) {
if (!this._.domOnChangeRegistered) {
u.on('load', function() {
this.getInputElement().on('change', function() {
if (!u.parts.dialog.isVisible()) return;
this.fire('change', {
value: this.getValue()
});
}, this);
}, this);
this._.domOnChangeRegistered = true;
}
this.on('change', v);
}
}, true),
s = /^on([A-Z]\w+)/,
t = function(u) {
for (var v in u) {
if (s.test(v) || v == 'title' || v == 'type') delete u[v];
}
return u;
};
e.extend(k.dialog, {
labeledElement: function(u, v, w, x) {
if (arguments.length < 4) return;
var y = m.call(this, v);
y.labelId = e.getNextId() + '_label';
var z = this._.children = [],
A = function() {
var B = [],
C = v.required ? ' cke_required' : '';
if (v.labelLayout != 'horizontal') B.push('', '
', x.call(this, u, v), '
');
else {
var D = {
type: 'hbox',
widths: v.widths,
padding: 0,
children: [{
type: 'html',
html: ''
}, {
type: 'html',
html: '' + x.call(this, u, v) + ''
}]
};
a.dialog._.uiElementBuilders.hbox.build(u, D, B);
}
return B.join('');
};
k.dialog.uiElement.call(this, u, v, w, 'div', null, {
role: 'presentation'
}, A);
},
textInput: function(u, v, w) {
if (arguments.length < 3) return;
m.call(this, v);
var x = this._.inputId = e.getNextId() + '_textInput',
y = {
'class': 'cke_dialog_ui_input_' + v.type,
id: x,
type: 'text'
},
z;
if (v.validate) this.validate = v.validate;
if (v.maxLength) y.maxlength = v.maxLength;
if (v.size) y.size = v.size;
if (v.controlStyle) y.style = v.controlStyle;
var A = this,
B = false;
u.on('load', function() {
A.getInputElement().on('keydown', function(D) {
if (D.data.getKeystroke() == 13) B = true;
});
A.getInputElement().on('keyup', function(D) {
if (D.data.getKeystroke() == 13 && B) {
u.getButton('ok') && setTimeout(function() {
u.getButton('ok').click();
}, 0);
B = false;
}
}, null, null, 1000);
});
var C = function() {
var D = ['');
return D.join('');
};
k.dialog.labeledElement.call(this, u, v, w, C);
},
textarea: function(u, v, w) {
if (arguments.length < 3) return;
m.call(this, v);
var x = this,
y = this._.inputId = e.getNextId() + '_textarea',
z = {};
if (v.validate) this.validate = v.validate;
z.rows = v.rows || 5;
z.cols = v.cols || 20;
var A = function() {
z['aria-labelledby'] = this._.labelId;
this._.required && (z['aria-required'] = this._.required);
var B = ['');
return B.join('');
};
k.dialog.labeledElement.call(this, u, v, w, A);
},
checkbox: function(u, v, w) {
if (arguments.length < 3) return;
var x = m.call(this, v, {
'default': !!v['default']
});
if (v.validate) this.validate = v.validate;
var y = function() {
var z = e.extend({}, v, {
id: v.id ? v.id + '_checkbox' : e.getNextId() + '_checkbox'
}, true),
A = [],
B = e.getNextId() + '_label',
C = {
'class': 'cke_dialog_ui_checkbox_input',
type: 'checkbox',
'aria-labelledby': B
};
t(z);
if (v['default']) C.checked = 'checked';
if (typeof z.controlStyle != 'undefined') z.style = z.controlStyle;
x.checkbox = new k.dialog.uiElement(u, z, A, 'input', null, C);
A.push(' ');
return A.join('');
};
k.dialog.uiElement.call(this, u, v, w, 'span', null, null, y);
},
radio: function(u, v, w) {
if (arguments.length < 3) return;
m.call(this, v);
if (!this._['default']) this._['default'] = this._.initValue = v.items[0][1];
if (v.validate) this.validate = v.valdiate;
var x = [],
y = this,
z = function() {
var A = [],
B = [],
C = {
'class': 'cke_dialog_ui_radio_item',
'aria-labelledby': this._.labelId
},
D = v.id ? v.id + '_radio' : e.getNextId() + '_radio';
for (var E = 0; E < v.items.length; E++) {
var F = v.items[E],
G = F[2] !== undefined ? F[2] : F[0],
H = F[1] !== undefined ? F[1] : F[0],
I = e.getNextId() + '_radio_input',
J = I + '_label',
K = e.extend({}, v, {
id: I,
title: null,
type: null
}, true),
L = e.extend({}, K, {
title: G
}, true),
M = {
type: 'radio',
'class': 'cke_dialog_ui_radio_input',
name: D,
value: H,
'aria-labelledby': J
},
N = [];
if (y._['default'] == H) M.checked = 'checked';
t(K);
t(L);
if (typeof K.controlStyle != 'undefined') K.style = K.controlStyle;
x.push(new k.dialog.uiElement(u, K, N, 'input', null, M));
N.push(' ');
new k.dialog.uiElement(u, L, N, 'label', null, {
id: J,
'for': M.id
}, F[0]);
A.push(N.join(''));
}
new k.dialog.hbox(u, [], A, B);
return B.join('');
};
k.dialog.labeledElement.call(this, u, v, w, z);
this._.children = x;
},
button: function(u, v, w) {
if (!arguments.length) return;
if (typeof v == 'function') v = v(u.getParentEditor());
m.call(this, v, {
disabled: v.disabled || false
});
a.event.implementOn(this);
var x = this;
u.on('load', function(A) {
var B = this.getElement();
(function() {
B.on('click', function(C) {
x.fire('click', {
dialog: x.getDialog()
});
C.data.preventDefault();
});
B.on('keydown', function(C) {
if (C.data.getKeystroke() in {
32: 1
}) {
x.click();
C.data.preventDefault();
}
});
})();
B.unselectable();
}, this);
var y = e.extend({}, v);
delete y.style;
var z = e.getNextId() + '_label';
k.dialog.uiElement.call(this, u, y, w, 'a', null, {
style: v.style,
href: 'javascript:void(0)',
title: v.label,
hidefocus: 'true',
'class': v['class'],
role: 'button',
'aria-labelledby': z
}, '' + e.htmlEncode(v.label) + '');
},
select: function(u, v, w) {
if (arguments.length < 3) return;
var x = m.call(this, v);
if (v.validate) this.validate = v.validate;
x.inputId = e.getNextId() + '_select';
var y = function() {
var z = e.extend({}, v, {
id: v.id ? v.id + '_select' : e.getNextId() + '_select'
}, true),
A = [],
B = [],
C = {
id: x.inputId,
'class': 'cke_dialog_ui_input_select',
'aria-labelledby': this._.labelId
};
if (v.size != undefined) C.size = v.size;
if (v.multiple != undefined) C.multiple = v.multiple;
t(z);
for (var D = 0, E; D < v.items.length && (E = v.items[D]); D++) B.push(' ', e.htmlEncode(E[0]));
if (typeof z.controlStyle != 'undefined') z.style = z.controlStyle;
x.select = new k.dialog.uiElement(u, z, A, 'select', null, C, B.join(''));
return A.join('');
};
k.dialog.labeledElement.call(this, u, v, w, y);
},
file: function(u, v, w) {
if (arguments.length < 3) return;
if (v['default'] === undefined) v['default'] = '';
var x = e.extend(m.call(this, v), {
definition: v,
buttons: []
});
if (v.validate) this.validate = v.validate;
var y = function() {
x.frameId = e.getNextId() + '_fileInput';
var z = b.isCustomDomain(),
A = ['');
return A.join('');
};
u.on('load', function() {
var z = a.document.getById(x.frameId),
A = z.getParent();
A.addClass('cke_dialog_ui_input_file');
});
k.dialog.labeledElement.call(this, u, v, w, y);
},
fileButton: function(u, v, w) {
if (arguments.length < 3) return;
var x = m.call(this, v),
y = this;
if (v.validate) this.validate = v.validate;
var z = e.extend({}, v),
A = z.onClick;
z.className = (z.className ? z.className + ' ' : '') + 'cke_dialog_ui_button';
z.onClick = function(B) {
var C = v['for'];
if (!A || A.call(this, B) !== false) {
u.getContentElement(C[0], C[1]).submit();
this.disable();
}
};
u.on('load', function() {
u.getContentElement(v['for'][0], v['for'][1])._.buttons.push(y);
});
k.dialog.button.call(this, u, z, w);
},
html: (function() {
var u = /^\s*<[\w:]+\s+([^>]*)?>/,
v = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,
w = /\/$/;
return function(x, y, z) {
if (arguments.length < 3) return;
var A = [],
B, C = y.html,
D, E;
if (C.charAt(0) != '<') C = '' + C + '';
var F = y.focus;
if (F) {
var G = this.focus;
this.focus = function() {
G.call(this);
typeof F == 'function' && F.call(this);
this.fire('focus');
};
if (y.isFocusable) {
var H = this.isFocusable;
this.isFocusable = H;
}
this.keyboardFocusable = true;
}
k.dialog.uiElement.call(this, x, y, A, 'span', null, null, '');
B = A.join('');
D = B.match(u);
E = C.match(v) || ['', '', ''];
if (w.test(E[1])) {
E[1] = E[1].slice(0, -1);
E[2] = '/' + E[2];
}
z.push([E[1], ' ', D[1] || '', E[2]].join(''));
};
})(),
fieldset: function(u, v, w, x, y) {
var z = y.label,
A = function() {
var B = [];
z && B.push('');
for (var C = 0; C < w.length; C++) B.push(w[C]);
return B.join('');
};
this._ = {
children: v
};
k.dialog.uiElement.call(this, u, y, x, 'fieldset', null, null, A);
}
}, true);
k.dialog.html.prototype = new k.dialog.uiElement();
k.dialog.labeledElement.prototype = e.extend(new k.dialog.uiElement(), {
setLabel: function(u) {
var v = a.document.getById(this._.labelId);
if (v.getChildCount() < 1) new d.text(u, a.document).appendTo(v);
else v.getChild(0).$.nodeValue = u;
return this;
},
getLabel: function() {
var u = a.document.getById(this._.labelId);
if (!u || u.getChildCount() < 1) return '';
else return u.getChild(0).getText();
},
eventProcessors: r
}, true);
k.dialog.button.prototype = e.extend(new k.dialog.uiElement(), {
click: function() {
var u = this;
if (!u._.disabled) return u.fire('click', {
dialog: u._.dialog
});
u.getElement().$.blur();
return false;
},
enable: function() {
this._.disabled = false;
var u = this.getElement();
u && u.removeClass('cke_disabled');
},
disable: function() {
this._.disabled = true;
this.getElement().addClass('cke_disabled');
},
isVisible: function() {
return this.getElement().getFirst().isVisible();
},
isEnabled: function() {
return !this._.disabled;
},
eventProcessors: e.extend({}, k.dialog.uiElement.prototype.eventProcessors, {
onClick: function(u, v) {
this.on('click', v);
}
}, true),
accessKeyUp: function() {
this.click();
},
accessKeyDown: function() {
this.focus();
},
keyboardFocusable: true
}, true);
k.dialog.textInput.prototype = e.extend(new k.dialog.labeledElement(), {
getInputElement: function() {
return a.document.getById(this._.inputId);
},
focus: function() {
var u = this.selectParentTab();
setTimeout(function() {
var v = u.getInputElement();
v && v.$.focus();
}, 0);
},
select: function() {
var u = this.selectParentTab();
setTimeout(function() {
var v = u.getInputElement();
if (v) {
v.$.focus();
v.$.select();
}
}, 0);
},
accessKeyUp: function() {
this.select();
},
setValue: function(u) {
!u && (u = '');
return k.dialog.uiElement.prototype.setValue.apply(this, arguments);
},
keyboardFocusable: true
}, q, true);
k.dialog.textarea.prototype = new k.dialog.textInput();
k.dialog.select.prototype = e.extend(new k.dialog.labeledElement(), {
getInputElement: function() {
return this._.select.getElement();
},
add: function(u, v, w) {
var x = new h('option', this.getDialog().getParentEditor().document),
y = this.getInputElement().$;
x.$.text = u;
x.$.value = v === undefined || v === null ? u : v;
if (w === undefined || w === null) {
if (c) y.add(x.$);
else y.add(x.$, null);
} else y.add(x.$, w);
return this;
},
remove: function(u) {
var v = this.getInputElement().$;
v.remove(u);
return this;
},
clear: function() {
var u = this.getInputElement().$;
while (u.length > 0) u.remove(0);
return this;
},
keyboardFocusable: true
}, q, true);
k.dialog.checkbox.prototype = e.extend(new k.dialog.uiElement(), {
getInputElement: function() {
return this._.checkbox.getElement();
},
setValue: function(u, v) {
this.getInputElement().$.checked = u;
!v && this.fire('change', {
value: u
});
},
getValue: function() {
return this.getInputElement().$.checked;
},
accessKeyUp: function() {
this.setValue(!this.getValue());
},
eventProcessors: {
onChange: function(u, v) {
if (!c) return r.onChange.apply(this, arguments);
else {
u.on('load', function() {
var w = this._.checkbox.getElement();
w.on('propertychange', function(x) {
x = x.data.$;
if (x.propertyName == 'checked') this.fire('change', {
value: w.$.checked
});
}, this);
}, this);
this.on('change', v);
}
return null;
}
},
keyboardFocusable: true
}, q, true);
k.dialog.radio.prototype = e.extend(new k.dialog.uiElement(), {
setValue: function(u, v) {
var w = this._.children,
x;
for (var y = 0; y < w.length && (x = w[y]); y++) x.getElement().$.checked = x.getValue() == u;
!v && this.fire('change', {
value: u
});
},
getValue: function() {
var u = this._.children;
for (var v = 0; v < u.length; v++) {
if (u[v].getElement().$.checked) return u[v].getValue();
}
return null;
},
accessKeyUp: function() {
var u = this._.children,
v;
for (v = 0; v < u.length; v++) {
if (u[v].getElement().$.checked) {
u[v].getElement().focus();
return;
}
}
u[0].getElement().focus();
},
eventProcessors: {
onChange: function(u, v) {
if (!c) return r.onChange.apply(this, arguments);
else {
u.on('load', function() {
var w = this._.children,
x = this;
for (var y = 0; y < w.length; y++) {
var z = w[y].getElement();
z.on('propertychange', function(A) {
A = A.data.$;
if (A.propertyName == 'checked' && this.$.checked) x.fire('change', {
value: this.getAttribute('value')
});
});
}
}, this);
this.on('change', v);
}
return null;
}
},
keyboardFocusable: true
}, q, true);
k.dialog.file.prototype = e.extend(new k.dialog.labeledElement(), q, {
getInputElement: function() {
var u = a.document.getById(this._.frameId).getFrameDocument();
return u.$.forms.length > 0 ? new h(u.$.forms[0].elements[0]) : this.getElement();
},
submit: function() {
this.getInputElement().getParent().$.submit();
return this;
},
getAction: function() {
return this.getInputElement().getParent().$.action;
},
registerEvents: function(u) {
var v = /^on([A-Z]\w+)/,
w, x = function(z, A, B, C) {
z.on('formLoaded', function() {
z.getInputElement().on(B, C, z);
});
};
for (var y in u) {
if (!(w = y.match(v))) continue;
if (this.eventProcessors[y]) this.eventProcessors[y].call(this, this._.dialog, u[y]);
else x(this, this._.dialog, w[1].toLowerCase(), u[y]);
}
return this;
},
reset: function() {
var u = this._,
v = a.document.getById(u.frameId),
w = v.getFrameDocument(),
x = u.definition,
y = u.buttons,
z = this.formLoadedNumber,
A = this.formUnloadNumber,
B = u.dialog._.editor.lang.dir,
C = u.dialog._.editor.langCode;
if (!z) {
z = this.formLoadedNumber = e.addFunction(function() {
this.fire('formLoaded');
}, this);
A = this.formUnloadNumber = e.addFunction(function() {
this.getInputElement().clearCustomData();
}, this);
this.getDialog()._.editor.on('destroy', function() {
e.removeFunction(z);
e.removeFunction(A);
});
}
function D() {
w.$.open();
if (b.isCustomDomain()) w.$.domain = document.domain;
var E = '';
if (x.size) E = x.size - (c ? 7 : 0);
w.$.write(['', '', '', ''].join(''));
w.$.close();
for (var F = 0; F < y.length; F++) y[F].enable();
};
if (b.gecko) setTimeout(D, 500);
else D();
},
getValue: function() {
return this.getInputElement().$.value || '';
},
setInitValue: function() {
this._.initValue = '';
},
eventProcessors: {
onChange: function(u, v) {
if (!this._.domOnChangeRegistered) {
this.on('formLoaded', function() {
this.getInputElement().on('change', function() {
this.fire('change', {
value: this.getValue()
});
}, this);
}, this);
this._.domOnChangeRegistered = true;
}
this.on('change', v);
}
},
keyboardFocusable: true
}, true);
k.dialog.fileButton.prototype = new k.dialog.button();
k.dialog.fieldset.prototype = e.clone(k.dialog.hbox.prototype);
a.dialog.addUIElement('text', n);
a.dialog.addUIElement('password', n);
a.dialog.addUIElement('textarea', o);
a.dialog.addUIElement('checkbox', o);
a.dialog.addUIElement('radio', o);
a.dialog.addUIElement('button', o);
a.dialog.addUIElement('select', o);
a.dialog.addUIElement('file', o);
a.dialog.addUIElement('fileButton', o);
a.dialog.addUIElement('html', o);
a.dialog.addUIElement('fieldset', p);
})();
j.add('panel', {
beforeInit: function(m) {
m.ui.addHandler('panel', k.panel.handler);
}
});
a.UI_PANEL = 'panel';
k.panel = function(m, n) {
var o = this;
if (n) e.extend(o, n);
e.extend(o, {
className: '',
css: []
});
o.id = e.getNextId();
o.document = m;
o._ = {
blocks: {}
};
};
k.panel.handler = {
create: function(m) {
return new k.panel(m);
}
};
k.panel.prototype = {
renderHtml: function(m) {
var n = [];
this.render(m, n);
return n.join('');
},
render: function(m, n) {
var p = this;
var o = p.id;
n.push('
' + '
');
if (p.forceIFrame || p.css.length) {
n.push('');
}
n.push('
');
return o;
},
getHolderElement: function() {
var m = this._.holder;
if (!m) {
if (this.forceIFrame || this.css.length) {
var n = this.document.getById(this.id + '_frame'),
o = n.getParent(),
p = o.getAttribute('dir'),
q = o.getParent().getAttribute('class'),
r = o.getParent().getAttribute('lang'),
s = n.getFrameDocument(),
t = e.addFunction(e.bind(function(w) {
this.isLoaded = true;
if (this.onLoad) this.onLoad();
}, this)),
u = '' + '' + '' + '' + '' + e.buildStyleHtml(this.css) + '';
s.write(u);
var v = s.getWindow();
v.$.CKEDITOR = a;
s.on('key' + (b.opera ? 'press' : 'down'), function(w) {
var z = this;
var x = w.data.getKeystroke(),
y = z.document.getById(z.id).getAttribute('dir');
if (z._.onKeyDown && z._.onKeyDown(x) === false) {
w.data.preventDefault();
return;
}
if (x == 27 || x == (y == 'rtl' ? 39 : 37))
if (z.onEscape && z.onEscape(x) === false) w.data.preventDefault();
}, this);
m = s.getBody();
m.unselectable();
b.air && e.callFunction(t);
} else m = this.document.getById(this.id);
this._.holder = m;
}
return m;
},
addBlock: function(m, n) {
var o = this;
n = o._.blocks[m] = n instanceof k.panel.block ? n : new k.panel.block(o.getHolderElement(), n);
if (!o._.currentBlock) o.showBlock(m);
return n;
},
getBlock: function(m) {
return this._.blocks[m];
},
showBlock: function(m) {
var n = this._.blocks,
o = n[m],
p = this._.currentBlock,
q = this.forceIFrame ? this.document.getById(this.id + '_frame') : this._.holder;
q.getParent().getParent().disableContextMenu();
if (p) {
q.removeAttributes(p.attributes);
p.hide();
}
this._.currentBlock = o;
q.setAttributes(o.attributes);
a.fire('ariaWidget', q);
o._.focusIndex = -1;
this._.onKeyDown = o.onKeyDown && e.bind(o.onKeyDown, o);
o.onMark = function(r) {
q.setAttribute('aria-activedescendant', r.getId() + '_option');
};
o.onUnmark = function() {
q.removeAttribute('aria-activedescendant');
};
o.show();
return o;
},
destroy: function() {
this.element && this.element.remove();
}
};
k.panel.block = e.createClass({
$: function(m, n) {
var o = this;
o.element = m.append(m.getDocument().createElement('div', {
attributes: {
tabIndex: -1,
'class': 'cke_panel_block',
role: 'presentation'
},
styles: {
display: 'none'
}
}));
if (n) e.extend(o, n);
if (!o.attributes.title) o.attributes.title = o.attributes['aria-label'];
o.keys = {};
o._.focusIndex = -1;
o.element.disableContextMenu();
},
_: {
markItem: function(m) {
var p = this;
if (m == -1) return;
var n = p.element.getElementsByTag('a'),
o = n.getItem(p._.focusIndex = m);
if (b.webkit || b.opera) o.getDocument().getWindow().focus();
o.focus();
p.onMark && p.onMark(o);
}
},
proto: {
show: function() {
this.element.setStyle('display', '');
},
hide: function() {
var m = this;
if (!m.onHide || m.onHide.call(m) !== true) m.element.setStyle('display', 'none');
},
onKeyDown: function(m) {
var r = this;
var n = r.keys[m];
switch (n) {
case 'next':
var o = r._.focusIndex,
p = r.element.getElementsByTag('a'),
q;
while (q = p.getItem(++o)) {
if (q.getAttribute('_cke_focus') && q.$.offsetWidth) {
r._.focusIndex = o;
q.focus();
break;
}
}
return false;
case 'prev':
o = r._.focusIndex;
p = r.element.getElementsByTag('a');
while (o > 0 && (q = p.getItem(--o))) {
if (q.getAttribute('_cke_focus') && q.$.offsetWidth) {
r._.focusIndex = o;
q.focus();
break;
}
}
return false;
case 'click':
o = r._.focusIndex;
q = o >= 0 && r.element.getElementsByTag('a').getItem(o);
if (q) q.$.click ? q.$.click() : q.$.onclick();
return false;
}
return true;
}
}
});
j.add('listblock', {
requires: ['panel'],
onLoad: function() {
k.panel.prototype.addListBlock = function(m, n) {
return this.addBlock(m, new k.listBlock(this.getHolderElement(), n));
};
k.listBlock = e.createClass({
base: k.panel.block,
$: function(m, n) {
var q = this;
n = n || {};
var o = n.attributes || (n.attributes = {});
(q.multiSelect = !!n.multiSelect) && (o['aria-multiselectable'] = true);
!o.role && (o.role = 'listbox');
q.base.apply(q, arguments);
var p = q.keys;
p[40] = 'next';
p[9] = 'next';
p[38] = 'prev';
p[2000 + 9] = 'prev';
p[32] = 'click';
q._.pendingHtml = [];
q._.items = {};
q._.groups = {};
},
_: {
close: function() {
if (this._.started) {
this._.pendingHtml.push('');
delete this._.started;
}
},
getClick: function() {
if (!this._.click) this._.click = e.addFunction(function(m) {
var o = this;
var n = true;
if (o.multiSelect) n = o.toggle(m);
else o.mark(m);
if (o.onClick) o.onClick(m, n);
}, this);
return this._.click;
}
},
proto: {
add: function(m, n, o) {
var r = this;
var p = r._.pendingHtml,
q = e.getNextId();
if (!r._.started) {
p.push('
');
},
startGroup: function(m) {
this._.close();
var n = e.getNextId();
this._.groups[m] = n;
this._.pendingHtml.push('
', m, '
');
},
commit: function() {
var p = this;
p._.close();
p.element.appendHtml(p._.pendingHtml.join(''));
var m = p._.items,
n = p.element.getDocument();
for (var o in m) n.getById(m[o] + '_option').setAttribute('aria-setsize', p._.size);
delete p._.size;
p._.pendingHtml = [];
},
toggle: function(m) {
var n = this.isMarked(m);
if (n) this.unmark(m);
else this.mark(m);
return !n;
},
hideGroup: function(m) {
var n = this.element.getDocument().getById(this._.groups[m]),
o = n && n.getNext();
if (n) {
n.setStyle('display', 'none');
if (o && o.getName() == 'ul') o.setStyle('display', 'none');
}
},
hideItem: function(m) {
this.element.getDocument().getById(this._.items[m]).setStyle('display', 'none');
},
showAll: function() {
var m = this._.items,
n = this._.groups,
o = this.element.getDocument();
for (var p in m) o.getById(m[p]).setStyle('display', '');
for (var q in n) {
var r = o.getById(n[q]),
s = r.getNext();
r.setStyle('display', '');
if (s && s.getName() == 'ul') s.setStyle('display', '');
}
},
mark: function(m) {
var p = this;
if (!p.multiSelect) p.unmarkAll();
var n = p._.items[m],
o = p.element.getDocument().getById(n);
o.addClass('cke_selected');
p.element.getDocument().getById(n + '_option').setAttribute('aria-selected', true);
p.element.setAttribute('aria-activedescendant', n + '_option');
p.onMark && p.onMark(o);
},
unmark: function(m) {
var n = this;
n.element.getDocument().getById(n._.items[m]).removeClass('cke_selected');
n.onUnmark && n.onUnmark(n._.items[m]);
},
unmarkAll: function() {
var p = this;
var m = p._.items,
n = p.element.getDocument();
for (var o in m) n.getById(m[o]).removeClass('cke_selected');
p.onUnmark && p.onUnmark();
},
isMarked: function(m) {
return this.element.getDocument().getById(this._.items[m]).hasClass('cke_selected');
},
focus: function(m) {
this._.focusIndex = -1;
if (m) {
var n = this.element.getDocument().getById(this._.items[m]).getFirst(),
o = this.element.getElementsByTag('a'),
p, q = -1;
while (p = o.getItem(++q)) {
if (p.equals(n)) {
this._.focusIndex = q;
break;
}
}
setTimeout(function() {
n.focus();
}, 0);
}
}
}
});
}
});
a.themes.add('default', (function() {
var m = {};
function n(o, p) {
var q, r;
r = o.config.sharedSpaces;
r = r && r[p];
r = r && a.document.getById(r);
if (r) {
var s = '' + '' + '' + '' + '' + '
' + '
',
t = r.append(h.createFromHtml(s, r.getDocument()));
if (r.getCustomData('cke_hasshared')) t.hide();
else r.setCustomData('cke_hasshared', 1);
q = t.getChild([0, 0, 0, 0]);
!o.sharedSpaces && (o.sharedSpaces = {});
o.sharedSpaces[p] = q;
o.on('focus', function() {
for (var u = 0, v, w = r.getChildren(); v = w.getItem(u); u++) {
if (v.type == 1 && !v.equals(t) && v.hasClass('cke_shared')) v.hide();
}
t.show();
});
o.on('destroy', function() {
t.remove();
});
}
return q;
};
return {
build: function(o, p) {
var q = o.name,
r = o.element,
s = o.elementMode;
if (!r || s == 0) return;
if (s == 1) r.hide();
var t = o.fire('themeSpace', {
space: 'top',
html: ''
}).html,
u = o.fire('themeSpace', {
space: 'contents',
html: ''
}).html,
v = o.fireOnce('themeSpace', {
space: 'bottom',
html: ''
}).html,
w = u && o.config.height,
x = o.config.tabIndex || o.element.getAttribute('tabindex') || 0;
if (!u) w = 'auto';
else if (!isNaN(w)) w += 'px';
var y = '',
z = o.config.width;
if (z) {
if (!isNaN(z)) z += 'px';
y += 'width: ' + z + ';';
}
var A = t && n(o, 'top'),
B = n(o, 'bottom');
A && (A.setHtml(t), t = '');
B && (B.setHtml(v), v = '');
var C = '';
if (m[o.skinClass]) C = '';
else m[o.skinClass] = 1;
var D = h.createFromHtml(['' + '' + o.lang.editor + '' + '
', t, '
', u, '
', v, '
' + C + '' + '' + ''].join(''));
D.getChild([1, 0, 0, 0, 0]).unselectable();
D.getChild([1, 0, 0, 0, 2]).unselectable();
if (s == 1) D.insertAfter(r);
else r.append(D);
o.container = D;
D.disableContextMenu();
o.on('contentDirChanged', function(E) {
var F = (o.lang.dir != E.data ? 'add' : 'remove') + 'Class';
D.getChild(1)[F]('cke_mixed_dir_content');
var G = this.sharedSpaces && this.sharedSpaces[this.config.toolbarLocation];
G && G.getParent().getParent()[F]('cke_mixed_dir_content');
});
o.fireOnce('themeLoaded');
o.fireOnce('uiReady');
},
buildDialog: function(o) {
var p = e.getNextNumber(),
q = h.createFromHtml(['