@oat-sa/tao-core-shared-libs 1.11.3 → 1.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ckeditor/ckeditor.js +697 -692
- package/lib/ckeditor/skins/kama/editor.css +1 -1
- package/lib/ckeditor/skins/kama/editor_ie.css +1 -1
- package/lib/ckeditor/skins/kama/editor_ie7.css +1 -1
- package/lib/ckeditor/skins/kama/editor_ie8.css +1 -1
- package/lib/ckeditor/skins/kama/editor_iequirks.css +1 -1
- package/lib/ckeditor/skins/moono/editor.css +1 -1
- package/lib/ckeditor/skins/moono/editor_gecko.css +1 -1
- package/lib/ckeditor/skins/moono/editor_ie.css +1 -1
- package/lib/ckeditor/skins/moono/editor_ie7.css +1 -1
- package/lib/ckeditor/skins/moono/editor_ie8.css +1 -1
- package/lib/ckeditor/skins/moono/editor_iequirks.css +1 -1
- package/lib/ckeditor/skins/moono-lisa/editor.css +1 -1
- package/lib/ckeditor/skins/moono-lisa/editor_gecko.css +1 -1
- package/lib/ckeditor/skins/moono-lisa/editor_ie.css +1 -1
- package/lib/ckeditor/skins/moono-lisa/editor_ie8.css +1 -1
- package/lib/ckeditor/skins/moono-lisa/editor_iequirks.css +1 -1
- package/lib/ckeditor/skins/tao/editor.css +1 -1
- package/package.json +1 -1
package/lib/ckeditor/ckeditor.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Copyright (c) 2003-2026, CKSource - Frederico Knabben. All rights reserved.
|
|
3
3
|
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
(function(){if(!window.CKEDITOR||!window.CKEDITOR.dom){window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,l={timestamp:"
|
|
5
|
+
(function(){if(!window.CKEDITOR||!window.CKEDITOR.dom){window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,l={timestamp:"Q4I5",version:"4.14.1 TAO-3.4 DEV",revision:"7b4c79ce2",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var f=window.CKEDITOR_BASEPATH||"";if(!f)for(var h=document.getElementsByTagName("script"),k=0;k<h.length;k++){var g=h[k].src.match(a);if(g){f=g[1];break}}-1==f.indexOf(":/")&&
|
|
6
6
|
"//"!=f.slice(0,2)&&(f=0===f.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+f:location.href.match(/^[^\?]*\/(?:)/)[0]+f);if(!f)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return f}(),getUrl:function(a){-1==a.indexOf(":/")&&0!==a.indexOf("/")&&(a=this.basePath+a);this.timestamp&&"/"!=a.charAt(a.length-1)&&!/[&?]t=/.test(a)&&(a+=(0<=a.indexOf("?")?"\x26":"?")+"t\x3d"+this.timestamp);
|
|
7
|
-
return a},domReady:function(){function a(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",a,!1),f()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",a),f())}catch(
|
|
8
|
-
a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",a);window.attachEvent("onload",a);
|
|
9
|
-
CKEDITOR.event.prototype=function(){function a(a){var e=l(this);return e[a]||(e[a]=new h(a))}var l=function(a){a=a.getPrivate&&a.getPrivate()||a._||(a._={});return a.events||(a.events={})},h=function(a){this.name=a;this.listeners=[]};h.prototype={getListenerIndex:function(a){for(var e=0,h=this.listeners;e<h.length;e++)if(h[e].fn==a)return e;return-1}};return{define:function(f,e){var h=a.call(this,f);CKEDITOR.tools.extend(h,e,!0)},on:function(f,e,h,g
|
|
10
|
-
data:n,listenerData:
|
|
11
|
-
arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,e=function(){a=1},h=0,
|
|
12
|
-
h?!1:"undefined"==typeof b?!0:b;a=
|
|
7
|
+
return a},domReady:function(){function a(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",a,!1),f()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",a),f())}catch(g){}}function f(){for(var a;a=k.shift();)a()}var k=[];return function(g){function b(){try{document.documentElement.doScroll("left")}catch(d){setTimeout(b,1);return}a()}k.push(g);"complete"===document.readyState&&setTimeout(a,1);if(1==k.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",
|
|
8
|
+
a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",a);window.attachEvent("onload",a);g=!1;try{g=!window.frameElement}catch(c){}document.documentElement.doScroll&&g&&b()}}}()},h=window.CKEDITOR_GETURL;if(h){var f=l.getUrl;l.getUrl=function(a){return h.call(l,a)||f.call(l,a)}}return l}());CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(a){var l=CKEDITOR.event.prototype,h;for(h in l)null==a[h]&&(a[h]=l[h])},
|
|
9
|
+
CKEDITOR.event.prototype=function(){function a(a){var e=l(this);return e[a]||(e[a]=new h(a))}var l=function(a){a=a.getPrivate&&a.getPrivate()||a._||(a._={});return a.events||(a.events={})},h=function(a){this.name=a;this.listeners=[]};h.prototype={getListenerIndex:function(a){for(var e=0,h=this.listeners;e<h.length;e++)if(h[e].fn==a)return e;return-1}};return{define:function(f,e){var h=a.call(this,f);CKEDITOR.tools.extend(h,e,!0)},on:function(f,e,h,k,g){function b(d,n,a,b){d={name:f,sender:this,editor:d,
|
|
10
|
+
data:n,listenerData:k,stop:a,cancel:b,removeListener:c};return!1===e.call(h,d)?!1:d.data}function c(){n.removeListener(f,e)}var d=a.call(this,f);if(0>d.getListenerIndex(e)){d=d.listeners;h||(h=this);isNaN(g)&&(g=10);var n=this;b.fn=e;b.priority=g;for(var p=d.length-1;0<=p;p--)if(d[p].priority<=g)return d.splice(p+1,0,b),{removeListener:c};d.unshift(b)}return{removeListener:c}},once:function(){var a=Array.prototype.slice.call(arguments),e=a[1];a[1]=function(a){a.removeListener();return e.apply(this,
|
|
11
|
+
arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,e=function(){a=1},h=0,k=function(){h=1};return function(g,b,c){var d=l(this)[g];g=a;var n=h;a=h=0;if(d){var p=d.listeners;if(p.length)for(var p=p.slice(0),q,y=0;y<p.length;y++){if(d.errorProof)try{q=p[y].call(this,c,b,e,k)}catch(t){}else q=p[y].call(this,c,b,e,k);!1===q?h=1:"undefined"!=typeof q&&(b=q);if(a||h)break}}b=
|
|
12
|
+
h?!1:"undefined"==typeof b?!0:b;a=g;h=n;return b}}(),fireOnce:function(a,e,h){e=this.fire(a,e,h);delete l(this)[a];return e},removeListener:function(a,e){var h=l(this)[a];if(h){var k=h.getListenerIndex(e);0<=k&&h.listeners.splice(k,1)}},removeAllListeners:function(){var a=l(this),e;for(e in a)delete a[e]},hasListeners:function(a){return(a=l(this)[a])&&0<a.listeners.length}}}());CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]);CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=
|
|
13
13
|
function(a,l){a in{instanceReady:1,loaded:1}&&(this[a]=!0);return CKEDITOR.event.prototype.fire.call(this,a,l,this)},CKEDITOR.editor.prototype.fireOnce=function(a,l){a in{instanceReady:1,loaded:1}&&(this[a]=!0);return CKEDITOR.event.prototype.fireOnce.call(this,a,l,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype));CKEDITOR.env||(CKEDITOR.env=function(){var a=navigator.userAgent.toLowerCase(),l=a.match(/edge[ \/](\d+.?\d*)/),h=-1<a.indexOf("trident/"),h=!(!l&&!h),h={ie:h,edge:!!l,webkit:!h&&
|
|
14
14
|
-1<a.indexOf(" applewebkit/"),air:-1<a.indexOf(" adobeair/"),mac:-1<a.indexOf("macintosh"),quirks:"BackCompat"==document.compatMode&&(!document.documentMode||10>document.documentMode),mobile:-1<a.indexOf("mobile"),iOS:/(ipad|iphone|ipod)/.test(a),isCustomDomain:function(){if(!this.ie)return!1;var a=document.domain,f=window.location.hostname;return a!=f&&a!="["+f+"]"},secure:"https:"==location.protocol};h.gecko="Gecko"==navigator.product&&!h.webkit&&!h.ie;h.webkit&&(-1<a.indexOf("chrome")?h.chrome=
|
|
15
15
|
!0:h.safari=!0);var f=0;h.ie&&(f=l?parseFloat(l[1]):h.quirks||!document.documentMode?parseFloat(a.match(/msie (\d+)/)[1]):document.documentMode,h.ie9Compat=9==f,h.ie8Compat=8==f,h.ie7Compat=7==f,h.ie6Compat=7>f||h.quirks);h.gecko&&(l=a.match(/rv:([\d\.]+)/))&&(l=l[1].split("."),f=1E4*l[0]+100*(l[1]||0)+1*(l[2]||0));h.air&&(f=parseFloat(a.match(/ adobeair\/(\d+)/)[1]));h.webkit&&(f=parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));h.version=f;h.isCompatible=!(h.ie&&7>f)&&!(h.gecko&&4E4>f)&&!(h.webkit&&
|
|
@@ -17,28 +17,28 @@ function(a,l){a in{instanceReady:1,loaded:1}&&(this[a]=!0);return CKEDITOR.event
|
|
|
17
17
|
CKEDITOR.loadFullCore=function(){if("basic_ready"!=CKEDITOR.status)CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var a=document.createElement("script");a.type="text/javascript";a.src=CKEDITOR.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(a)}};CKEDITOR.loadFullCoreTimeout=0;CKEDITOR.add=function(a){(this._.pending||(this._.pending=[])).push(a)};(function(){CKEDITOR.domReady(function(){var a=CKEDITOR.loadFullCore,l=CKEDITOR.loadFullCoreTimeout;a&&(CKEDITOR.status=
|
|
18
18
|
"basic_ready",a&&a._load?a():l&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},1E3*l))})})();CKEDITOR.status="basic_loaded"}();"use strict";CKEDITOR.VERBOSITY_WARN=1;CKEDITOR.VERBOSITY_ERROR=2;CKEDITOR.verbosity=CKEDITOR.VERBOSITY_WARN|CKEDITOR.VERBOSITY_ERROR;CKEDITOR.warn=function(a,l){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_WARN&&CKEDITOR.fire("log",{type:"warn",errorCode:a,additionalData:l})};CKEDITOR.error=function(a,l){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_ERROR&&CKEDITOR.fire("log",
|
|
19
19
|
{type:"error",errorCode:a,additionalData:l})};CKEDITOR.on("log",function(a){if(window.console&&window.console.log){var l=console[a.data.type]?a.data.type:"log",h=a.data.errorCode;if(a=a.data.additionalData)console[l]("[CKEDITOR] Error code: "+h+".",a);else console[l]("[CKEDITOR] Error code: "+h+".");console[l]("[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#"+h)}},null,null,999);CKEDITOR.dom={};(function(){function a(d,a,b){this._minInterval=
|
|
20
|
-
d;this._context=b;this._lastOutput=this._scheduledTimer=0;this._output=CKEDITOR.tools.bind(a,b||{});var
|
|
21
|
-
Array.prototype.slice.call(arguments);d.call(this)}})}var h=[],f=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",e=/&/g,m=/>/g,
|
|
20
|
+
d;this._context=b;this._lastOutput=this._scheduledTimer=0;this._output=CKEDITOR.tools.bind(a,b||{});var g=this;this.input=function(){function d(){g._lastOutput=(new Date).getTime();g._scheduledTimer=0;g._call()}if(!g._scheduledTimer||!1!==g._reschedule()){var n=(new Date).getTime()-g._lastOutput;n<g._minInterval?g._scheduledTimer=setTimeout(d,g._minInterval-n):d()}}}function l(d,b,g){a.call(this,d,b,g);this._args=[];var c=this;this.input=CKEDITOR.tools.override(this.input,function(d){return function(){c._args=
|
|
21
|
+
Array.prototype.slice.call(arguments);d.call(this)}})}var h=[],f=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",e=/&/g,m=/>/g,k=/</g,g=/"/g,b=/&(lt|gt|amp|quot|nbsp|shy|#\d{1,5});/g,c={lt:"\x3c",gt:"\x3e",amp:"\x26",quot:'"',nbsp:" ",shy:""},d=function(d,a){return"#"==a[0]?String.fromCharCode(parseInt(a.slice(1),10)):c[a]};CKEDITOR.on("reset",function(){h=[]});CKEDITOR.tools={arrayCompare:function(d,a){if(!d&&!a)return!0;if(!d||!a||d.length!=a.length)return!1;
|
|
22
22
|
for(var b=0;b<d.length;b++)if(d[b]!=a[b])return!1;return!0},getIndex:function(d,a){for(var b=0;b<d.length;++b)if(a(d[b]))return b;return-1},clone:function(d){var a;if(d&&d instanceof Array){a=[];for(var b=0;b<d.length;b++)a[b]=CKEDITOR.tools.clone(d[b]);return a}if(null===d||"object"!=typeof d||d instanceof String||d instanceof Number||d instanceof Boolean||d instanceof Date||d instanceof RegExp||d.nodeType||d.window===d)return d;a=new d.constructor;for(b in d)a[b]=CKEDITOR.tools.clone(d[b]);return a},
|
|
23
|
-
capitalize:function(d,a){return d.charAt(0).toUpperCase()+(a?d.slice(1):d.slice(1).toLowerCase())},extend:function(d){var a=arguments.length,b,
|
|
23
|
+
capitalize:function(d,a){return d.charAt(0).toUpperCase()+(a?d.slice(1):d.slice(1).toLowerCase())},extend:function(d){var a=arguments.length,b,g;"boolean"==typeof(b=arguments[a-1])?a--:"boolean"==typeof(b=arguments[a-2])&&(g=arguments[a-1],a-=2);for(var c=1;c<a;c++){var f=arguments[c]||{};CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(f),function(a){if(!0===b||null==d[a])if(!g||a in g)d[a]=f[a]})}return d},prototypedCopy:function(d){var a=function(){};a.prototype=d;return new a},copy:function(d){var a=
|
|
24
24
|
{},b;for(b in d)a[b]=d[b];return a},isArray:function(d){return"[object Array]"==Object.prototype.toString.call(d)},isEmpty:function(d){for(var a in d)if(d.hasOwnProperty(a))return!1;return!0},cssVendorPrefix:function(d,a,b){if(b)return f+d+":"+a+";"+d+":"+a;b={};b[d]=a;b[f+d]=a;return b},cssStyleToDomStyle:function(){var d=document.createElement("div").style,a="undefined"!=typeof d.cssFloat?"cssFloat":"undefined"!=typeof d.styleFloat?"styleFloat":"float";return function(d){return"float"==d?a:d.replace(/-./g,
|
|
25
|
-
function(d){return d.substr(1).toUpperCase()})}}(),buildStyleHtml:function(d){d=[].concat(d);for(var a,b=[],
|
|
26
|
-
"\x26quot;")},htmlDecodeAttr:function(d){return CKEDITOR.tools.htmlDecode(d)},transformPlainTextToHtml:function(d,a){var b=a==CKEDITOR.ENTER_BR,
|
|
27
|
-
2)}));
|
|
28
|
-
c);return c.setTimeout(function(){
|
|
29
|
-
b=0;for(
|
|
30
|
-
d[a]="function"==typeof b?CKEDITOR.tools.bind(b,this):b}f.apply(this,arguments)};b&&(a.prototype=this.prototypedCopy(b.prototype),a.prototype.constructor=a,a.base=b,a.baseProto=b.prototype,a.prototype.base=function
|
|
25
|
+
function(d){return d.substr(1).toUpperCase()})}}(),buildStyleHtml:function(d){d=[].concat(d);for(var a,b=[],g=0;g<d.length;g++)if(a=d[g])/@import|[{}]/.test(a)?b.push("\x3cstyle\x3e"+a+"\x3c/style\x3e"):b.push('\x3clink type\x3d"text/css" rel\x3dstylesheet href\x3d"'+a+'"\x3e');return b.join("")},htmlEncode:function(d){return void 0===d||null===d?"":String(d).replace(e,"\x26amp;").replace(m,"\x26gt;").replace(k,"\x26lt;")},htmlDecode:function(a){return a.replace(b,d)},htmlEncodeAttr:function(d){return CKEDITOR.tools.htmlEncode(d).replace(g,
|
|
26
|
+
"\x26quot;")},htmlDecodeAttr:function(d){return CKEDITOR.tools.htmlDecode(d)},transformPlainTextToHtml:function(d,a){var b=a==CKEDITOR.ENTER_BR,g=this.htmlEncode(d.replace(/\r\n/g,"\n")),g=g.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;"),c=a==CKEDITOR.ENTER_P?"p":"div";if(!b){var f=/\n{2}/g;if(f.test(g))var e="\x3c"+c+"\x3e",k="\x3c/"+c+"\x3e",g=e+g.replace(f,function(){return k+e})+k}g=g.replace(/\n/g,"\x3cbr\x3e");b||(g=g.replace(new RegExp("\x3cbr\x3e(?\x3d\x3c/"+c+"\x3e)"),function(d){return CKEDITOR.tools.repeat(d,
|
|
27
|
+
2)}));g=g.replace(/^ | $/g,"\x26nbsp;");return g=g.replace(/(>|\s) /g,function(d,a){return a+"\x26nbsp;"}).replace(/ (?=<)/g,"\x26nbsp;")},getNextNumber:function(){var d=0;return function(){return++d}}(),getNextId:function(){return"cke_"+this.getNextNumber()},getUniqueId:function(){for(var d="e",a=0;8>a;a++)d+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return d},override:function(d,a){var b=a(d);b.prototype=d.prototype;return b},setTimeout:function(d,a,b,g,c){c||(c=window);b||(b=
|
|
28
|
+
c);return c.setTimeout(function(){g?d.apply(b,[].concat(g)):d.apply(b)},a||0)},throttle:function(d,a,b){return new this.buffers.throttle(d,a,b)},trim:function(){var d=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(a){return a.replace(d,"")}}(),ltrim:function(){var d=/^[ \t\n\r]+/g;return function(a){return a.replace(d,"")}}(),rtrim:function(){var d=/[ \t\n\r]+$/g;return function(a){return a.replace(d,"")}}(),indexOf:function(d,a){if("function"==typeof a)for(var b=0,g=d.length;b<g;b++){if(a(d[b]))return b}else{if(d.indexOf)return d.indexOf(a);
|
|
29
|
+
b=0;for(g=d.length;b<g;b++)if(d[b]===a)return b}return-1},search:function(d,a){var b=CKEDITOR.tools.indexOf(d,a);return 0<=b?d[b]:null},bind:function(d,a){var b=Array.prototype.slice.call(arguments,2);return function(){return d.apply(a,b.concat(Array.prototype.slice.call(arguments)))}},createClass:function(d){var a=d.$,b=d.base,g=d.privates||d._,c=d.proto;d=d.statics;!a&&(a=function(){b&&this.base.apply(this,arguments)});if(g)var f=a,a=function(){var d=this._||(this._={}),a;for(a in g){var b=g[a];
|
|
30
|
+
d[a]="function"==typeof b?CKEDITOR.tools.bind(b,this):b}f.apply(this,arguments)};b&&(a.prototype=this.prototypedCopy(b.prototype),a.prototype.constructor=a,a.base=b,a.baseProto=b.prototype,a.prototype.base=function r(){this.base=b.prototype.base;b.apply(this,arguments);this.base=r});c&&this.extend(a.prototype,c,!0);d&&this.extend(a,d,!0);return a},addFunction:function(d,a){return h.push(function(){return d.apply(a||this,arguments)})-1},removeFunction:function(d){h[d]=null},callFunction:function(d){var a=
|
|
31
31
|
h[d];return a&&a.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var d=/^-?\d+\.?\d*px$/,a;return function(b){a=CKEDITOR.tools.trim(b+"")+"px";return d.test(a)?a:b||""}}(),convertToPx:function(){var d;return function(a){d||(d=CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"\x3e\x3c/div\x3e',CKEDITOR.document),CKEDITOR.document.getBody().append(d));if(!/%$/.test(a)){var b=0>parseFloat(a);
|
|
32
|
-
b&&(a=a.replace("-",""));d.setStyle("width",a);a=d.$.clientWidth;return b?-a:a}return a}}(),repeat:function(d,a){return Array(a+1).join(d)},tryThese:function(){for(var d,a=0,b=arguments.length;a<b;a++){var
|
|
33
|
-
!0,a);for(
|
|
34
|
-
a,b){var
|
|
35
|
-
objectCompare:function(d,a,b){var
|
|
36
|
-
d}return!!d},eventsBuffer:function(d,a,b){return new this.buffers.event(d,a,b)},enableHtml5Elements:function(d,a){for(var b="abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video".split(" "),
|
|
37
|
-
a){for(var b in d)if(b.match(a))return!0;return!1},keystrokeToString:function(d,a){var b=this.keystrokeToArray(d,a);b.display=b.display.join("+");b.aria=b.aria.join("+");return b},keystrokeToArray:function(d,a){var b=a&16711680,
|
|
38
|
-
e.push(String.fromCharCode(
|
|
39
|
-
";path\x3d/"},getCsrfToken:function(){var d=CKEDITOR.tools.getCookie("ckCsrfToken");if(!d||40!=d.length){var d=[],a="";if(window.crypto&&window.crypto.getRandomValues)d=new Uint8Array(40),window.crypto.getRandomValues(d);else for(var b=0;40>b;b++)d.push(Math.floor(256*Math.random()));for(b=0;b<d.length;b++)var
|
|
40
|
-
CSS.escape?CSS.escape(d):isNaN(parseInt(d.charAt(0),10))?d:"\\3"+d.charAt(0)+" "+d.substring(1,d.length):""},getMouseButton:function(d){return(d=d&&d.data?d.data.$:d)?CKEDITOR.tools.normalizeMouseButton(d.button):!1},normalizeMouseButton:function(d,a){if(!CKEDITOR.env.ie||9<=CKEDITOR.env.version&&!CKEDITOR.env.ie6Compat)return d;for(var b=[[CKEDITOR.MOUSE_BUTTON_LEFT,1],[CKEDITOR.MOUSE_BUTTON_MIDDLE,4],[CKEDITOR.MOUSE_BUTTON_RIGHT,2]],
|
|
41
|
-
c[1]===d)return c[0]}},convertHexStringToBytes:function(d){var a=[],b=d.length/2,
|
|
32
|
+
b&&(a=a.replace("-",""));d.setStyle("width",a);a=d.$.clientWidth;return b?-a:a}return a}}(),repeat:function(d,a){return Array(a+1).join(d)},tryThese:function(){for(var d,a=0,b=arguments.length;a<b;a++){var g=arguments[a];try{d=g();break}catch(c){}}return d},genKey:function(){return Array.prototype.slice.call(arguments).join("-")},defer:function(d){return function(){var a=arguments,b=this;window.setTimeout(function(){d.apply(b,a)},0)}},normalizeCssText:function(d,a){var b=[],g,c=CKEDITOR.tools.parseCssText(d,
|
|
33
|
+
!0,a);for(g in c)b.push(g+":"+c[g]);b.sort();return b.length?b.join(";")+";":""},convertRgbToHex:function(d){return d.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,function(d,a,b,g){d=[a,b,g];for(a=0;3>a;a++)d[a]=("0"+parseInt(d[a],10).toString(16)).slice(-2);return"#"+d.join("")})},normalizeHex:function(d){return d.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi,function(d,a,b,g){d=a.toLowerCase();3==d.length&&(d=d.split(""),d=[d[0],d[0],d[1],d[1],d[2],d[2]].join(""));return"#"+d+g})},parseCssText:function(d,
|
|
34
|
+
a,b){var g={};b&&(d=(new CKEDITOR.dom.element("span")).setAttribute("style",d).getAttribute("style")||"");d&&(d=CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(d)));if(!d||";"==d)return g;d.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(d,b,n){a&&(b=b.toLowerCase(),"font-family"==b&&(n=n.replace(/\s*,\s*/g,",")),n=CKEDITOR.tools.trim(n));g[b]=n});return g},writeCssText:function(d,a){var b,g=[];for(b in d)g.push(b+":"+d[b]);a&&g.sort();return g.join("; ")},
|
|
35
|
+
objectCompare:function(d,a,b){var g;if(!d&&!a)return!0;if(!d||!a)return!1;for(g in d)if(d[g]!=a[g])return!1;if(!b)for(g in a)if(d[g]!=a[g])return!1;return!0},objectKeys:function(d){return CKEDITOR.tools.object.keys(d)},convertArrayToObject:function(d,a){var b={};1==arguments.length&&(a=!0);for(var g=0,c=d.length;g<c;++g)b[d[g]]=a;return b},fixDomain:function(){for(var d;;)try{d=window.parent.document.domain;break}catch(a){d=d?d.replace(/.+?(?:\.|$)/,""):document.domain;if(!d)break;document.domain=
|
|
36
|
+
d}return!!d},eventsBuffer:function(d,a,b){return new this.buffers.event(d,a,b)},enableHtml5Elements:function(d,a){for(var b="abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video".split(" "),g=b.length,c;g--;)c=d.createElement(b[g]),a&&d.appendChild(c)},checkIfAnyArrayItemMatches:function(d,a){for(var b=0,g=d.length;b<g;++b)if(d[b].match(a))return!0;return!1},checkIfAnyObjectPropertyMatches:function(d,
|
|
37
|
+
a){for(var b in d)if(b.match(a))return!0;return!1},keystrokeToString:function(d,a){var b=this.keystrokeToArray(d,a);b.display=b.display.join("+");b.aria=b.aria.join("+");return b},keystrokeToArray:function(d,a){var b=a&16711680,g=a&65535,c=CKEDITOR.env.mac,f=[],e=[];b&CKEDITOR.CTRL&&(f.push(c?"⌘":d[17]),e.push(c?d[224]:d[17]));b&CKEDITOR.ALT&&(f.push(c?"⌥":d[18]),e.push(d[18]));b&CKEDITOR.SHIFT&&(f.push(c?"⇧":d[16]),e.push(d[16]));g&&(d[g]?(f.push(d[g]),e.push(d[g])):(f.push(String.fromCharCode(g)),
|
|
38
|
+
e.push(String.fromCharCode(g))));return{display:f,aria:e}},transparentImageData:"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw\x3d\x3d",getCookie:function(d){d=d.toLowerCase();for(var a=document.cookie.split(";"),b,g,c=0;c<a.length;c++)if(b=a[c].split("\x3d"),g=decodeURIComponent(CKEDITOR.tools.trim(b[0]).toLowerCase()),g===d)return decodeURIComponent(1<b.length?b[1]:"");return null},setCookie:function(d,a){document.cookie=encodeURIComponent(d)+"\x3d"+encodeURIComponent(a)+
|
|
39
|
+
";path\x3d/"},getCsrfToken:function(){var d=CKEDITOR.tools.getCookie("ckCsrfToken");if(!d||40!=d.length){var d=[],a="";if(window.crypto&&window.crypto.getRandomValues)d=new Uint8Array(40),window.crypto.getRandomValues(d);else for(var b=0;40>b;b++)d.push(Math.floor(256*Math.random()));for(b=0;b<d.length;b++)var g="abcdefghijklmnopqrstuvwxyz0123456789".charAt(d[b]%36),a=a+(.5<Math.random()?g.toUpperCase():g);d=a;CKEDITOR.tools.setCookie("ckCsrfToken",d)}return d},escapeCss:function(d){return d?window.CSS&&
|
|
40
|
+
CSS.escape?CSS.escape(d):isNaN(parseInt(d.charAt(0),10))?d:"\\3"+d.charAt(0)+" "+d.substring(1,d.length):""},getMouseButton:function(d){return(d=d&&d.data?d.data.$:d)?CKEDITOR.tools.normalizeMouseButton(d.button):!1},normalizeMouseButton:function(d,a){if(!CKEDITOR.env.ie||9<=CKEDITOR.env.version&&!CKEDITOR.env.ie6Compat)return d;for(var b=[[CKEDITOR.MOUSE_BUTTON_LEFT,1],[CKEDITOR.MOUSE_BUTTON_MIDDLE,4],[CKEDITOR.MOUSE_BUTTON_RIGHT,2]],g=0;g<b.length;g++){var c=b[g];if(c[0]===d&&a)return c[1];if(!a&&
|
|
41
|
+
c[1]===d)return c[0]}},convertHexStringToBytes:function(d){var a=[],b=d.length/2,g;for(g=0;g<b;g++)a.push(parseInt(d.substr(2*g,2),16));return a},convertBytesToBase64:function(d){var a="",b=d.length,g;for(g=0;g<b;g+=3){var c=d.slice(g,g+3),f=c.length,e=[],k;if(3>f)for(k=f;3>k;k++)c[k]=0;e[0]=(c[0]&252)>>2;e[1]=(c[0]&3)<<4|c[1]>>4;e[2]=(c[1]&15)<<2|(c[2]&192)>>6;e[3]=c[2]&63;for(k=0;4>k;k++)a=k<=f?a+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e[k]):a+"\x3d"}return a},
|
|
42
42
|
style:{parse:{_colors:{aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",
|
|
43
43
|
darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",
|
|
44
44
|
ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",
|
|
@@ -46,21 +46,21 @@ lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightsla
|
|
|
46
46
|
moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",
|
|
47
47
|
seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",windowtext:"windowtext",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},_borderStyle:"none hidden dotted dashed solid double groove ridge inset outset".split(" "),
|
|
48
48
|
_widthRegExp:/^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/,_rgbaRegExp:/rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,_hslaRegExp:/hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,background:function(d){var a={},b=this._findColor(d);b.length&&(a.color=b[0],CKEDITOR.tools.array.forEach(b,function(a){d=d.replace(a,"")}));if(d=CKEDITOR.tools.trim(d))a.unprocessed=d;return a},margin:function(d){return CKEDITOR.tools.style.parse.sideShorthand(d,
|
|
49
|
-
function(d){return d.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset|revert)/g)||["0px"]})},sideShorthand:function(d,a){function b(d){
|
|
50
|
-
[]),a=a.concat(d.match(this._hslaRegExp)||[]);return a=a.concat(b.filter(d.split(/\s+/),function(d){return d.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi)?!0:d.toLowerCase()in CKEDITOR.tools.style.parse._colors}))}}},array:{filter:function(d,a,b){var
|
|
51
|
-
a,b){for(var
|
|
52
|
-
function(a){return[a,d[a]]})},values:function(d){return CKEDITOR.tools.array.map(CKEDITOR.tools.object.keys(d),function(a){return d[a]})},keys:function(d){var a=Object.prototype.hasOwnProperty,b=[],
|
|
53
|
-
return b},findKey:function(d,a){if("object"!==typeof d)return null;for(var b in d)if(d[b]===a)return b;return null},merge:function(d,a){var b=CKEDITOR.tools,
|
|
54
|
-
var
|
|
49
|
+
function(d){return d.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset|revert)/g)||["0px"]})},sideShorthand:function(d,a){function b(d){g.top=c[d[0]];g.right=c[d[1]];g.bottom=c[d[2]];g.left=c[d[3]]}var g={},c=a?a(d):d.split(/\s+/);switch(c.length){case 1:b([0,0,0,0]);break;case 2:b([0,1,0,1]);break;case 3:b([0,1,2,1]);break;case 4:b([0,1,2,3])}return g},border:function(d){return CKEDITOR.tools.style.border.fromCssRule(d)},_findColor:function(d){var a=[],b=CKEDITOR.tools.array,a=a.concat(d.match(this._rgbaRegExp)||
|
|
50
|
+
[]),a=a.concat(d.match(this._hslaRegExp)||[]);return a=a.concat(b.filter(d.split(/\s+/),function(d){return d.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi)?!0:d.toLowerCase()in CKEDITOR.tools.style.parse._colors}))}}},array:{filter:function(d,a,b){var g=[];this.forEach(d,function(c,f){a.call(b,c,f,d)&&g.push(c)});return g},find:function(d,a,b){for(var g=d.length,c=0;c<g;){if(a.call(b,d[c],c,d))return d[c];c++}},forEach:function(d,a,b){var g=d.length,c;for(c=0;c<g;c++)a.call(b,d[c],c,d)},map:function(d,
|
|
51
|
+
a,b){for(var g=[],c=0;c<d.length;c++)g.push(a.call(b,d[c],c,d));return g},reduce:function(d,a,b,g){for(var c=0;c<d.length;c++)b=a.call(g,b,d[c],c,d);return b},every:function(d,a,b){if(!d.length)return!0;a=this.filter(d,a,b);return d.length===a.length},some:function(d,a,b){for(var g=0;g<d.length;g++)if(a.call(b,d[g],g,d))return!0;return!1}},object:{DONT_ENUMS:"toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor".split(" "),entries:function(d){return CKEDITOR.tools.array.map(CKEDITOR.tools.object.keys(d),
|
|
52
|
+
function(a){return[a,d[a]]})},values:function(d){return CKEDITOR.tools.array.map(CKEDITOR.tools.object.keys(d),function(a){return d[a]})},keys:function(d){var a=Object.prototype.hasOwnProperty,b=[],g=CKEDITOR.tools.object.DONT_ENUMS;if(CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(!d||"object"!==typeof d)){a=[];if("string"===typeof d)for(b=0;b<d.length;b++)a.push(String(b));return a}for(var c in d)b.push(c);if(CKEDITOR.env.ie&&9>CKEDITOR.env.version)for(c=0;c<g.length;c++)a.call(d,g[c])&&b.push(g[c]);
|
|
53
|
+
return b},findKey:function(d,a){if("object"!==typeof d)return null;for(var b in d)if(d[b]===a)return b;return null},merge:function(d,a){var b=CKEDITOR.tools,g=b.clone(d),c=b.clone(a);b.array.forEach(b.object.keys(c),function(d){g[d]="object"===typeof c[d]&&"object"===typeof g[d]?b.object.merge(g[d],c[d]):c[d]});return g}},getAbsoluteRectPosition:function(d,a){function b(d){if(d){var a=d.getClientRect();g.top+=a.top;g.left+=a.left;"x"in g&&"y"in g&&(g.x+=a.x,g.y+=a.y);b(d.getWindow().getFrame())}}
|
|
54
|
+
var g=CKEDITOR.tools.copy(a);b(d.getFrame());var c=CKEDITOR.document.getWindow().getScrollPosition();g.top+=c.y;g.left+=c.x;"x"in g&&"y"in g&&(g.y+=c.y,g.x+=c.x);g.right=g.left+g.width;g.bottom=g.top+g.height;return g}};a.prototype={reset:function(){this._lastOutput=0;this._clearTimer()},_reschedule:function(){return!1},_call:function(){this._output()},_clearTimer:function(){this._scheduledTimer&&clearTimeout(this._scheduledTimer);this._scheduledTimer=0}};l.prototype=CKEDITOR.tools.prototypedCopy(a.prototype);
|
|
55
55
|
l.prototype._reschedule=function(){this._scheduledTimer&&this._clearTimer()};l.prototype._call=function(){this._output.apply(this._context,this._args)};CKEDITOR.tools.buffers={};CKEDITOR.tools.buffers.event=a;CKEDITOR.tools.buffers.throttle=l;CKEDITOR.tools.style.border=CKEDITOR.tools.createClass({$:function(d){d=d||{};this.width=d.width;this.style=d.style;this.color=d.color;this._.normalize()},_:{normalizeMap:{color:[[/windowtext/g,"black"]]},normalize:function(){for(var d in this._.normalizeMap){var a=
|
|
56
56
|
this[d];a&&(this[d]=CKEDITOR.tools.array.reduce(this._.normalizeMap[d],function(d,a){return d.replace(a[0],a[1])},a))}}},proto:{toString:function(){return CKEDITOR.tools.array.filter([this.width,this.style,this.color],function(d){return!!d}).join(" ")}},statics:{fromCssRule:function(d){var a={},b=d.split(/\s+/g);d=CKEDITOR.tools.style.parse._findColor(d);d.length&&(a.color=d[0]);CKEDITOR.tools.array.forEach(b,function(d){a.style||-1===CKEDITOR.tools.indexOf(CKEDITOR.tools.style.parse._borderStyle,
|
|
57
|
-
d)?!a.width&&CKEDITOR.tools.style.parse._widthRegExp.test(d)&&(a.width=d):a.style=d});return new CKEDITOR.tools.style.border(a)},splitCssValues:function(d,a){a=a||{};var b=CKEDITOR.tools.array.reduce(["width","style","color"],function(b,
|
|
58
|
-
|
|
59
|
-
dl:1,fieldset:1,figure:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,hr:1,main:1,menu:1,nav:1,ol:1,p:1,pre:1,section:1,table:1,ul:1},m={command:1,link:1,meta:1,noscript:1,script:1,style:1},
|
|
60
|
-
q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,"var":1,video:1,wbr:1},
|
|
61
|
-
f),dfn:h,div:f,dl:{dt:1,dd:1},dt:f,em:h,embed:
|
|
62
|
-
option:
|
|
63
|
-
f),basefont:
|
|
57
|
+
d)?!a.width&&CKEDITOR.tools.style.parse._widthRegExp.test(d)&&(a.width=d):a.style=d});return new CKEDITOR.tools.style.border(a)},splitCssValues:function(d,a){a=a||{};var b=CKEDITOR.tools.array.reduce(["width","style","color"],function(b,g){var c=d["border-"+g]||a[g];b[g]=c?CKEDITOR.tools.style.parse.sideShorthand(c):null;return b},{});return CKEDITOR.tools.array.reduce(["top","right","bottom","left"],function(a,g){var c={},f;for(f in b){var e=d["border-"+g+"-"+f];c[f]=e?e:b[f]&&b[f][g]}a["border-"+
|
|
58
|
+
g]=new CKEDITOR.tools.style.border(c);return a},{})}}});CKEDITOR.tools.array.indexOf=CKEDITOR.tools.indexOf;CKEDITOR.tools.array.isArray=CKEDITOR.tools.isArray;CKEDITOR.MOUSE_BUTTON_LEFT=0;CKEDITOR.MOUSE_BUTTON_MIDDLE=1;CKEDITOR.MOUSE_BUTTON_RIGHT=2})();CKEDITOR.dtd=function(){var a=CKEDITOR.tools.extend,l=function(a,d){for(var b=CKEDITOR.tools.clone(a),g=1;g<arguments.length;g++){d=arguments[g];for(var f in d)delete b[f]}return b},h={},f={},e={address:1,article:1,aside:1,blockquote:1,details:1,div:1,
|
|
59
|
+
dl:1,fieldset:1,figure:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,hr:1,main:1,menu:1,nav:1,ol:1,p:1,pre:1,section:1,table:1,ul:1},m={command:1,link:1,meta:1,noscript:1,script:1,style:1},k={},g={"#":1},b={center:1,dir:1,noframes:1};a(h,{a:1,abbr:1,area:1,audio:1,b:1,bdi:1,bdo:1,br:1,button:1,canvas:1,cite:1,code:1,command:1,datalist:1,del:1,dfn:1,em:1,embed:1,i:1,iframe:1,img:1,input:1,ins:1,kbd:1,keygen:1,label:1,map:1,mark:1,meter:1,noscript:1,object:1,output:1,progress:1,
|
|
60
|
+
q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,"var":1,video:1,wbr:1},g,{acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1});a(f,e,h,b);l={a:l(h,{a:1,button:1}),abbr:h,address:f,area:k,article:f,aside:f,audio:a({source:1,track:1},f),b:h,base:k,bdi:h,bdo:h,blockquote:f,body:f,br:k,button:l(h,{a:1,button:1}),canvas:h,caption:f,cite:h,code:h,col:k,colgroup:{col:1},command:k,datalist:a({option:1},h),dd:f,del:h,details:a({summary:1},
|
|
61
|
+
f),dfn:h,div:f,dl:{dt:1,dd:1},dt:f,em:h,embed:k,fieldset:a({legend:1},f),figcaption:f,figure:a({figcaption:1},f),footer:f,form:f,h1:h,h2:h,h3:h,h4:h,h5:h,h6:h,head:a({title:1,base:1},m),header:f,hgroup:{h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},hr:k,html:a({head:1,body:1},f,m),i:h,iframe:g,img:k,input:k,ins:h,kbd:h,keygen:k,label:h,legend:h,li:f,link:k,main:f,map:f,mark:h,menu:a({li:1},f),meta:k,meter:l(h,{meter:1}),nav:f,noscript:a({link:1,meta:1,style:1},h),object:a({param:1},h),ol:{li:1},optgroup:{option:1},
|
|
62
|
+
option:g,output:h,p:h,param:k,pre:h,progress:l(h,{progress:1}),q:h,rp:h,rt:h,ruby:a({rp:1,rt:1},h),s:h,samp:h,script:g,section:f,select:{optgroup:1,option:1},small:h,source:k,span:h,strong:h,style:g,sub:h,summary:a({h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},h),sup:h,table:{caption:1,colgroup:1,thead:1,tfoot:1,tbody:1,tr:1},tbody:{tr:1},td:f,textarea:g,tfoot:{tr:1},th:f,thead:{tr:1},time:l(h,{time:1}),title:g,tr:{th:1,td:1},track:k,u:h,ul:{li:1},"var":h,video:a({source:1,track:1},f),wbr:k,acronym:h,applet:a({param:1},
|
|
63
|
+
f),basefont:k,big:h,center:f,dialog:k,dir:{li:1},font:h,isindex:k,noframes:f,strike:h,tt:h};a(l,{$block:a({audio:1,dd:1,dt:1,figcaption:1,li:1,video:1},e,b),$blockLimit:{article:1,aside:1,audio:1,body:1,caption:1,details:1,dir:1,div:1,dl:1,fieldset:1,figcaption:1,figure:1,footer:1,form:1,header:1,hgroup:1,main:1,menu:1,nav:1,ol:1,section:1,table:1,td:1,th:1,tr:1,ul:1,video:1},$cdata:{script:1,style:1},$editable:{address:1,article:1,aside:1,blockquote:1,body:1,details:1,div:1,fieldset:1,figcaption:1,
|
|
64
64
|
footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,main:1,nav:1,p:1,pre:1,section:1},$empty:{area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1},$inline:h,$list:{dl:1,ol:1,ul:1},$listItem:{dd:1,dt:1,li:1},$nonBodyContent:a({body:1,head:1,html:1},l.head),$nonEditable:{applet:1,audio:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,param:1,script:1,textarea:1,video:1},$object:{applet:1,audio:1,
|
|
65
65
|
button:1,hr:1,iframe:1,img:1,input:1,object:1,select:1,table:1,textarea:1,video:1},$removeEmpty:{abbr:1,acronym:1,b:1,bdi:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,mark:1,meter:1,output:1,q:1,ruby:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,"var":1},$tabIndex:{a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},$tableContent:{caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},$transparent:{a:1,audio:1,canvas:1,del:1,
|
|
66
66
|
ins:1,map:1,noscript:1,object:1,video:1},$intermediate:{caption:1,colgroup:1,dd:1,dt:1,figcaption:1,legend:1,li:1,optgroup:1,option:1,rp:1,rt:1,summary:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1}});return l}();CKEDITOR.dom.event=function(a){this.$=a};CKEDITOR.dom.event.prototype={getKey:function(){return this.$.keyCode||this.$.which},getKeystroke:function(){var a=this.getKey();if(this.$.ctrlKey||this.$.metaKey)a+=CKEDITOR.CTRL;this.$.shiftKey&&(a+=CKEDITOR.SHIFT);this.$.altKey&&(a+=CKEDITOR.ALT);return a},
|
|
@@ -71,9 +71,9 @@ f=h&&h[a];f&&(this.$.removeEventListener?this.$.removeEventListener(a,f,!1):this
|
|
|
71
71
|
{};CKEDITOR.on("reset",function(){l={}});a.equals=function(a){try{return a&&a.$===this.$}catch(f){return!1}};a.setCustomData=function(a,f){var e=this.getUniqueId();(l[e]||(l[e]={}))[a]=f;return this};a.getCustomData=function(a){var f=this.$["data-cke-expando"];return(f=f&&l[f])&&a in f?f[a]:null};a.removeCustomData=function(a){var f=this.$["data-cke-expando"],f=f&&l[f],e,m;f&&(e=f[a],m=a in f,delete f[a]);return m?e:null};a.clearCustomData=function(){this.removeAllListeners();var a=this.getUniqueId();
|
|
72
72
|
a&&delete l[a]};a.getUniqueId=function(){return this.$["data-cke-expando"]||(this.$["data-cke-expando"]=CKEDITOR.tools.getNextNumber())};CKEDITOR.event.implementOn(a)})(CKEDITOR.dom.domObject.prototype);CKEDITOR.dom.node=function(a){return a?new CKEDITOR.dom[a.nodeType==CKEDITOR.NODE_DOCUMENT?"document":a.nodeType==CKEDITOR.NODE_ELEMENT?"element":a.nodeType==CKEDITOR.NODE_TEXT?"text":a.nodeType==CKEDITOR.NODE_COMMENT?"comment":a.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT?"documentFragment":"domObject"](a):
|
|
73
73
|
this};CKEDITOR.dom.node.prototype=new CKEDITOR.dom.domObject;CKEDITOR.NODE_ELEMENT=1;CKEDITOR.NODE_DOCUMENT=9;CKEDITOR.NODE_TEXT=3;CKEDITOR.NODE_COMMENT=8;CKEDITOR.NODE_DOCUMENT_FRAGMENT=11;CKEDITOR.POSITION_IDENTICAL=0;CKEDITOR.POSITION_DISCONNECTED=1;CKEDITOR.POSITION_FOLLOWING=2;CKEDITOR.POSITION_PRECEDING=4;CKEDITOR.POSITION_IS_CONTAINED=8;CKEDITOR.POSITION_CONTAINS=16;CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype,{appendTo:function(a,l){a.append(this,l);return a},clone:function(a,l){function h(f){f["data-cke-expando"]&&
|
|
74
|
-
(f["data-cke-expando"]=!1);if(f.nodeType==CKEDITOR.NODE_ELEMENT||f.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)if(l||f.nodeType!=CKEDITOR.NODE_ELEMENT||f.removeAttribute("id",!1),a){f=f.childNodes;for(var e=0;e<f.length;e++)h(f[e])}}function f(e){if(e.type==CKEDITOR.NODE_ELEMENT||e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT){if(e.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var
|
|
74
|
+
(f["data-cke-expando"]=!1);if(f.nodeType==CKEDITOR.NODE_ELEMENT||f.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)if(l||f.nodeType!=CKEDITOR.NODE_ELEMENT||f.removeAttribute("id",!1),a){f=f.childNodes;for(var e=0;e<f.length;e++)h(f[e])}}function f(e){if(e.type==CKEDITOR.NODE_ELEMENT||e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT){if(e.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var k=e.getName();":"==k[0]&&e.renameNode(k.substring(1))}if(a)for(k=0;k<e.getChildCount();k++)f(e.getChild(k))}}var e=this.$.cloneNode(a);
|
|
75
75
|
h(e);e=new CKEDITOR.dom.node(e);CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(this.type==CKEDITOR.NODE_ELEMENT||this.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)&&f(e);return e},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(a){a.$.parentNode.insertBefore(this.$,a.$.nextSibling);return a},insertBefore:function(a){a.$.parentNode.insertBefore(this.$,a.$);return a},insertBeforeMe:function(a){this.$.parentNode.insertBefore(a.$,this.$);
|
|
76
|
-
return a},getAddress:function(a){for(var l=[],h=this.getDocument().$.documentElement,f=this;f&&f!=h;){var e=f.getParent();e&&l.unshift(this.getIndex.call(f,a));f=e}return l},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(a){function l(a,f){var
|
|
76
|
+
return a},getAddress:function(a){for(var l=[],h=this.getDocument().$.documentElement,f=this;f&&f!=h;){var e=f.getParent();e&&l.unshift(this.getIndex.call(f,a));f=e}return l},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(a){function l(a,f){var g=f?a.getNext():a.getPrevious();return g&&g.type==CKEDITOR.NODE_TEXT?g.isEmpty()?l(g,f):g:null}var h=this,f=-1,e;if(!this.getParent()||a&&h.type==CKEDITOR.NODE_TEXT&&h.isEmpty()&&
|
|
77
77
|
!l(h)&&!l(h,!0))return-1;do if(!a||h.equals(this)||h.type!=CKEDITOR.NODE_TEXT||!e&&!h.isEmpty())f++,e=h.type==CKEDITOR.NODE_TEXT;while(h=h.getPrevious());return f},getNextSourceNode:function(a,l,h){if(h&&!h.call){var f=h;h=function(a){return!a.equals(f)}}a=!a&&this.getFirst&&this.getFirst();var e;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&h&&!1===h(this,!0))return null;a=this.getNext()}for(;!a&&(e=(e||this).getParent());){if(h&&!1===h(e,!0))return null;a=e.getNext()}return!a||h&&!1===h(a)?null:l&&
|
|
78
78
|
l!=a.type?a.getNextSourceNode(!1,l,h):a},getPreviousSourceNode:function(a,l,h){if(h&&!h.call){var f=h;h=function(a){return!a.equals(f)}}a=!a&&this.getLast&&this.getLast();var e;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&h&&!1===h(this,!0))return null;a=this.getPrevious()}for(;!a&&(e=(e||this).getParent());){if(h&&!1===h(e,!0))return null;a=e.getPrevious()}return!a||h&&!1===h(a)?null:l&&a.type!=l?a.getPreviousSourceNode(!1,l,h):a},getPrevious:function(a){var l=this.$,h;do h=(l=l.previousSibling)&&
|
|
79
79
|
10!=l.nodeType&&new CKEDITOR.dom.node(l);while(h&&a&&!a(h));return h},getNext:function(a){var l=this.$,h;do h=(l=l.nextSibling)&&new CKEDITOR.dom.node(l);while(h&&a&&!a(h));return h},getParent:function(a){var l=this.$.parentNode;return l&&(l.nodeType==CKEDITOR.NODE_ELEMENT||a&&l.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(l):null},getParents:function(a){var l=this,h=[];do h[a?"push":"unshift"](l);while(l=l.getParent());return h},getCommonAncestor:function(a){if(a.equals(this))return this;
|
|
@@ -86,15 +86,15 @@ l&&l.is("textarea","input")&&(a=!0);if(!a&&l&&"undefined"!=typeof l.$.isContentE
|
|
|
86
86
|
getViewPaneSize:function(){var a=this.$.document,l="CSS1Compat"==a.compatMode;return{width:(l?a.documentElement.clientWidth:a.body.clientWidth)||0,height:(l?a.documentElement.clientHeight:a.body.clientHeight)||0}},getScrollPosition:function(){var a=this.$;if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};a=a.document;return{x:a.documentElement.scrollLeft||a.body.scrollLeft||0,y:a.documentElement.scrollTop||a.body.scrollTop||0}},getFrame:function(){var a=this.$.frameElement;return a?
|
|
87
87
|
new CKEDITOR.dom.element.get(a):null}});CKEDITOR.dom.document=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.document.prototype=new CKEDITOR.dom.domObject;CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype,{type:CKEDITOR.NODE_DOCUMENT,appendStyleSheet:function(a){if(this.$.createStyleSheet)this.$.createStyleSheet(a);else{var l=new CKEDITOR.dom.element("link");l.setAttributes({rel:"stylesheet",type:"text/css",href:a});this.getHead().append(l)}},appendStyleText:function(a){if(this.$.createStyleSheet){var l=
|
|
88
88
|
this.$.createStyleSheet("");l.cssText=a}else{var h=new CKEDITOR.dom.element("style",this);h.append(new CKEDITOR.dom.text(a,this));this.getHead().append(h)}return l||h.$.sheet},createElement:function(a,l){var h=new CKEDITOR.dom.element(a,this);l&&(l.attributes&&h.setAttributes(l.attributes),l.styles&&h.setStyles(l.styles));return h},createText:function(a){return new CKEDITOR.dom.text(a,this)},focus:function(){this.getWindow().focus()},getActive:function(){var a;try{a=this.$.activeElement}catch(l){return null}return new CKEDITOR.dom.element(a)},
|
|
89
|
-
getById:function(a){return(a=this.$.getElementById(a))?new CKEDITOR.dom.element(a):null},getByAddress:function(a,l){for(var h=this.$.documentElement,f=0;h&&f<a.length;f++){var e=a[f];if(l)for(var m=-1,
|
|
89
|
+
getById:function(a){return(a=this.$.getElementById(a))?new CKEDITOR.dom.element(a):null},getByAddress:function(a,l){for(var h=this.$.documentElement,f=0;h&&f<a.length;f++){var e=a[f];if(l)for(var m=-1,k=0;k<h.childNodes.length;k++){var g=h.childNodes[k];if(!0!==l||3!=g.nodeType||!g.previousSibling||3!=g.previousSibling.nodeType)if(m++,m==e){h=g;break}}else h=h.childNodes[e]}return h?new CKEDITOR.dom.node(h):null},getElementsByTag:function(a,l){CKEDITOR.env.ie&&8>=document.documentMode||!l||(a=l+":"+
|
|
90
90
|
a);return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))},getHead:function(){var a=this.$.getElementsByTagName("head")[0];return a=a?new CKEDITOR.dom.element(a):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),!0)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(a){this.$.open("text/html",
|
|
91
91
|
"replace");CKEDITOR.env.ie&&(a=a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,'$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e('+CKEDITOR.tools.fixDomain+")();\x3c/script\x3e"));this.$.write(a);this.$.close()},find:function(a){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))},findOne:function(a){return(a=this.$.querySelector(a))?new CKEDITOR.dom.element(a):null},_getHtml5ShivFrag:function(){var a=this.getCustomData("html5ShivFrag");a||(a=this.$.createDocumentFragment(),CKEDITOR.tools.enableHtml5Elements(a,
|
|
92
92
|
!0),this.setCustomData("html5ShivFrag",a));return a}});CKEDITOR.dom.nodeList=function(a){this.$=a};CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(a){return 0>a||a>=this.$.length?null:(a=this.$[a])?new CKEDITOR.dom.node(a):null},toArray:function(){return CKEDITOR.tools.array.map(this.$,function(a){return new CKEDITOR.dom.node(a)})}};CKEDITOR.dom.element=function(a,l){"string"==typeof a&&(a=(l?l.$:document).createElement(a));CKEDITOR.dom.domObject.call(this,
|
|
93
93
|
a)};CKEDITOR.dom.element.get=function(a){return(a="string"==typeof a?document.getElementById(a)||document.getElementsByName(a)[0]:a)&&(a.$?a:new CKEDITOR.dom.element(a))};CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node;CKEDITOR.dom.element.createFromHtml=function(a,l){var h=new CKEDITOR.dom.element("div",l);h.setHtml(a);return h.getFirst().remove()};CKEDITOR.dom.element.setMarker=function(a,l,h,f){var e=l.getCustomData("list_marker_id")||l.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),
|
|
94
94
|
m=l.getCustomData("list_marker_names")||l.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");a[e]=l;m[h]=1;return l.setCustomData(h,f)};CKEDITOR.dom.element.clearAllMarkers=function(a){for(var l in a)CKEDITOR.dom.element.clearMarkers(a,a[l],1)};CKEDITOR.dom.element.clearMarkers=function(a,l,h){var f=l.getCustomData("list_marker_names"),e=l.getCustomData("list_marker_id"),m;for(m in f)l.removeCustomData(m);l.removeCustomData("list_marker_names");h&&(l.removeCustomData("list_marker_id"),
|
|
95
|
-
delete a[e])};(function(){function a(a,b){return-1<(" "+a+" ").replace(m," ").indexOf(" "+b+" ")}function l(a){var b=!0;a.$.id||(a.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),b=!1);return function(){b||a.removeAttribute("id")}}function h(a,b){var c=CKEDITOR.tools.escapeCss(a.$.id);return"#"+c+" "+b.split(/,\s*/).join(", #"+c+" ")}function f(a){for(var b=0,c=0,d=
|
|
96
|
-
typeof e&&null!==String(e.add).match(/\[Native code\]/gi),m=/[\n\t\r]/g;CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:e?function(a){this.$.classList.add(a);return this}:function(
|
|
97
|
-
|
|
95
|
+
delete a[e])};(function(){function a(a,b){return-1<(" "+a+" ").replace(m," ").indexOf(" "+b+" ")}function l(a){var b=!0;a.$.id||(a.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),b=!1);return function(){b||a.removeAttribute("id")}}function h(a,b){var c=CKEDITOR.tools.escapeCss(a.$.id);return"#"+c+" "+b.split(/,\s*/).join(", #"+c+" ")}function f(a){for(var b=0,c=0,d=k[a].length;c<d;c++)b+=parseFloat(this.getComputedStyle(k[a][c])||0,10)||0;return b}var e=document.createElement("_").classList,e="undefined"!==
|
|
96
|
+
typeof e&&null!==String(e.add).match(/\[Native code\]/gi),m=/[\n\t\r]/g;CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:e?function(a){this.$.classList.add(a);return this}:function(g){var b=this.$.className;b&&(a(b,g)||(b+=" "+g));this.$.className=b||g;return this},removeClass:e?function(a){var b=this.$;b.classList.remove(a);b.className||b.removeAttribute("class");return this}:function(g){var b=this.getAttribute("class");b&&a(b,g)&&((b=b.replace(new RegExp("(?:^|\\s+)"+
|
|
97
|
+
g+"(?\x3d\\s|$)"),"").replace(/^\s+/,""))?this.setAttribute("class",b):this.removeAttribute("class"));return this},hasClass:function(g){return a(this.$.className,g)},append:function(a,b){"string"==typeof a&&(a=this.getDocument().createElement(a));b?this.$.insertBefore(a.$,this.$.firstChild):this.$.appendChild(a.$);return a},appendHtml:function(a){if(this.$.childNodes.length){var b=new CKEDITOR.dom.element("div",this.getDocument());b.setHtml(a);b.moveChildren(this)}else this.setHtml(a)},appendText:function(a){null!=
|
|
98
98
|
this.$.text&&CKEDITOR.env.ie&&9>CKEDITOR.env.version?this.$.text+=a:this.append(new CKEDITOR.dom.text(a))},appendBogus:function(a){if(a||CKEDITOR.env.needsBrFiller){for(a=this.getLast();a&&a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(a.getText());)a=a.getPrevious();a&&a.is&&a.is("br")||(a=this.getDocument().createElement("br"),CKEDITOR.env.gecko&&a.setAttribute("type","_moz"),this.append(a))}},breakParent:function(a,b){var c=new CKEDITOR.dom.range(this.getDocument());c.setStartAfter(this);c.setEndAfter(a);
|
|
99
99
|
var d=c.extractContents(!1,b||!1),f;c.insertNode(this.remove());if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){for(c=new CKEDITOR.dom.element("div");f=d.getFirst();)f.$.style.backgroundColor&&(f.$.style.backgroundColor=f.$.style.backgroundColor),c.append(f);c.insertAfter(this);c.remove(!0)}else d.insertAfterNode(this)},contains:document.compareDocumentPosition?function(a){return!!(this.$.compareDocumentPosition(a.$)&16)}:function(a){var b=this.$;return a.type!=CKEDITOR.NODE_ELEMENT?b.contains(a.getParent().$):
|
|
100
100
|
b!=a.$&&b.contains(a.$)},focus:function(){function a(){try{this.$.focus()}catch(b){}}return function(b){b?CKEDITOR.tools.setTimeout(a,100,this):a.call(this)}}(),getHtml:function(){var a=this.$.innerHTML;return CKEDITOR.env.ie?a.replace(/<\?[^>]*>/g,""):a},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var a=this.$.ownerDocument.createElement("div");a.appendChild(this.$.cloneNode(!0));return a.innerHTML},getClientRect:function(a){var b=CKEDITOR.tools.extend({},
|
|
@@ -109,44 +109,44 @@ CKEDITOR.dtd.span,!(!a||!a["#"])):!0},isIdentical:function(a){var b=this.clone(0
|
|
|
109
109
|
a.getOuterHtml();if(CKEDITOR.env.ie&&9>CKEDITOR.env.version&&this.is("a")){var c=this.getParent();c.type==CKEDITOR.NODE_ELEMENT&&(c=c.clone(),c.setHtml(b),b=c.getHtml(),c.setHtml(a),a=c.getHtml())}return b==a},isVisible:function(){var a=(this.$.offsetHeight||this.$.offsetWidth)&&"hidden"!=this.getComputedStyle("visibility"),b,c;a&&CKEDITOR.env.webkit&&(b=this.getWindow(),!b.equals(CKEDITOR.document.getWindow())&&(c=b.$.frameElement)&&(a=(new CKEDITOR.dom.element(c)).isVisible()));return!!a},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return!1;
|
|
110
110
|
for(var a=this.getChildren(),b=0,c=a.count();b<c;b++){var d=a.getItem(b);if(d.type!=CKEDITOR.NODE_ELEMENT||!d.data("cke-bookmark"))if(d.type==CKEDITOR.NODE_ELEMENT&&!d.isEmptyInlineRemoveable()||d.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(d.getText()))return!1}return!0},hasAttributes:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(){for(var a=this.$.attributes,b=0;b<a.length;b++){var c=a[b];switch(c.nodeName){case "class":if(this.getAttribute("class"))return!0;case "data-cke-expando":continue;
|
|
111
111
|
default:if(c.specified)return!0}}return!1}:function(){var a=this.$.attributes,b=a.length,c={"data-cke-expando":1,_moz_dirty:1};return 0<b&&(2<b||!c[a[0].nodeName]||2==b&&!c[a[1].nodeName])},hasAttribute:function(){function a(b){var c=this.$.attributes.getNamedItem(b);if("input"==this.getName())switch(b){case "class":return 0<this.$.className.length;case "checked":return!!this.$.checked;case "value":return b=this.getAttribute("type"),"checkbox"==b||"radio"==b?"on"!=this.$.value:!!this.$.value}return c?
|
|
112
|
-
c.specified:!1}return CKEDITOR.env.ie?8>CKEDITOR.env.version?function(b){return"name"==b?!!this.$.name:a.call(this,b)}:a:function(a){return!!this.$.attributes.getNamedItem(a)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,b){var c=this.$;a=a.$;if(c!=a){var d;if(b)for(;d=c.lastChild;)a.insertBefore(c.removeChild(d),a.firstChild);else for(;d=c.firstChild;)a.appendChild(c.removeChild(d))}},mergeSiblings:function(){function a(b,c,d){if(c&&c.type==CKEDITOR.NODE_ELEMENT){for(var
|
|
113
|
-
[];c.data("cke-bookmark")||c.isEmptyInlineRemoveable();)if(
|
|
112
|
+
c.specified:!1}return CKEDITOR.env.ie?8>CKEDITOR.env.version?function(b){return"name"==b?!!this.$.name:a.call(this,b)}:a:function(a){return!!this.$.attributes.getNamedItem(a)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,b){var c=this.$;a=a.$;if(c!=a){var d;if(b)for(;d=c.lastChild;)a.insertBefore(c.removeChild(d),a.firstChild);else for(;d=c.firstChild;)a.appendChild(c.removeChild(d))}},mergeSiblings:function(){function a(b,c,d){if(c&&c.type==CKEDITOR.NODE_ELEMENT){for(var g=
|
|
113
|
+
[];c.data("cke-bookmark")||c.isEmptyInlineRemoveable();)if(g.push(c),c=d?c.getNext():c.getPrevious(),!c||c.type!=CKEDITOR.NODE_ELEMENT)return;if(b.isIdentical(c)){for(var f=d?b.getLast():b.getFirst();g.length;)g.shift().move(b,!d);c.moveChildren(b,!d);c.remove();f&&f.type==CKEDITOR.NODE_ELEMENT&&f.mergeSiblings()}}}return function(b){if(!1===b||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))a(this,this.getNext(),!0),a(this,this.getPrevious())}}(),show:function(){this.setStyles({display:"",
|
|
114
114
|
visibility:""})},setAttribute:function(){var a=function(a,c){this.$.setAttribute(a,c);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(b,c){"class"==b?this.$.className=c:"style"==b?this.$.style.cssText=c:"tabindex"==b?this.$.tabIndex=c:"checked"==b?this.$.checked=c:"contenteditable"==b?a.call(this,"contentEditable",c):a.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(b,c){if("src"==b&&c.match(/^http:\/\//))try{a.apply(this,
|
|
115
115
|
arguments)}catch(d){}else a.apply(this,arguments);return this}:a}(),setAttributes:function(a){for(var b in a)this.setAttribute(b,a[b]);return this},setValue:function(a){this.$.value=a;return this},removeAttribute:function(){var a=function(a){this.$.removeAttribute(a)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){"class"==a?a="className":"tabindex"==a?a="tabIndex":"contenteditable"==a&&(a="contentEditable");this.$.removeAttribute(a)}:a}(),removeAttributes:function(a){if(CKEDITOR.tools.isArray(a))for(var b=
|
|
116
116
|
0;b<a.length;b++)this.removeAttribute(a[b]);else for(b in a=a||this.getAttributes(),a)a.hasOwnProperty(b)&&this.removeAttribute(b)},removeStyle:function(a){var b=this.$.style;if(b.removeProperty||"border"!=a&&"margin"!=a&&"padding"!=a)b.removeProperty?b.removeProperty(a):b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a)),this.$.style.cssText||this.removeAttribute("style");else{var c=["top","left","right","bottom"],d;"border"==a&&(d=["color","style","width"]);for(var b=[],f=0;f<c.length;f++)if(d)for(var e=
|
|
117
117
|
0;e<d.length;e++)b.push([a,c[f],d[e]].join("-"));else b.push([a,c[f]].join("-"));for(a=0;a<b.length;a++)this.removeStyle(b[a])}},setStyle:function(a,b){this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]=b;return this},setStyles:function(a){for(var b in a)this.setStyle(b,a[b]);return this},setOpacity:function(a){CKEDITOR.env.ie&&9>CKEDITOR.env.version?(a=Math.round(100*a),this.setStyle("filter",100<=a?"":"progid:DXImageTransform.Microsoft.Alpha(opacity\x3d"+a+")")):this.setStyle("opacity",a)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select",
|
|
118
118
|
"none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var a,b=this.getElementsByTag("*"),c=0,d=b.count();c<d;c++)a=b.getItem(c),a.setAttribute("unselectable","on")}},getPositionedAncestor:function(){for(var a=this;"html"!=a.getName();){if("static"!=a.getComputedStyle("position"))return a;a=a.getParent()}return null},getDocumentPosition:function(a){var b=0,c=0,d=this.getDocument(),f=d.getBody(),e="BackCompat"==d.$.compatMode;if(document.documentElement.getBoundingClientRect&&(CKEDITOR.env.ie?
|
|
119
|
-
8!==CKEDITOR.env.version:1)){var
|
|
120
|
-
"html"!=m.getName();){b+=m.$.offsetLeft-m.$.scrollLeft;c+=m.$.offsetTop-m.$.scrollTop;m.equals(this)||(b+=m.$.clientLeft||0,c+=m.$.clientTop||0);for(;
|
|
121
|
-
e||(b+=this.$.clientLeft?1:0,c+=this.$.clientTop?1:0);return{x:b,y:c}},scrollIntoView:function(a){var b=this.getParent();if(b){do if((b.$.clientWidth&&b.$.clientWidth<b.$.scrollWidth||b.$.clientHeight&&b.$.clientHeight<b.$.scrollHeight)&&!b.is("body")&&this.scrollIntoParent(b,a,1),b.is("html")){var c=b.getWindow();try{var d=c.$.frameElement;d&&(b=new CKEDITOR.dom.element(d))}catch(f){}}while(b=b.getParent())}},scrollIntoParent:function(a,b,c){var d,f,e,
|
|
122
|
-
a.getWindow().$.scrollBy(d,b):(a.$.scrollLeft+=d,a.$.scrollTop+=b)}function m(a,d){var b={x:0,y:0};if(!a.is(l?"body":"html")){var c=a.$.getBoundingClientRect();b.x=c.left;b.y=c.top}c=a.getWindow();c.equals(d)||(c=m(CKEDITOR.dom.element.get(c.$.frameElement),d),b.x+=c.x,b.y+=c.y);return b}function
|
|
123
|
-
CKEDITOR.env.webkit&&(e=this.getEditor(!1))&&(e._.previousScrollTop=null);e=a.getWindow();f=m(this,e);var
|
|
119
|
+
8!==CKEDITOR.env.version:1)){var k=this.$.getBoundingClientRect(),h=d.$.documentElement,m=h.clientTop||f.$.clientTop||0,w=h.clientLeft||f.$.clientLeft||0,l=!0;CKEDITOR.env.ie&&(l=d.getDocumentElement().contains(this),d=d.getBody().contains(this),l=e&&d||!e&&l);l&&(CKEDITOR.env.webkit||CKEDITOR.env.ie&&12<=CKEDITOR.env.version?(b=f.$.scrollLeft||h.scrollLeft,c=f.$.scrollTop||h.scrollTop):(c=e?f.$:h,b=c.scrollLeft,c=c.scrollTop),b=k.left+b-w,c=k.top+c-m)}else for(m=this,w=null;m&&"body"!=m.getName()&&
|
|
120
|
+
"html"!=m.getName();){b+=m.$.offsetLeft-m.$.scrollLeft;c+=m.$.offsetTop-m.$.scrollTop;m.equals(this)||(b+=m.$.clientLeft||0,c+=m.$.clientTop||0);for(;w&&!w.equals(m);)b-=w.$.scrollLeft,c-=w.$.scrollTop,w=w.getParent();w=m;m=(k=m.$.offsetParent)?new CKEDITOR.dom.element(k):null}a&&(k=this.getWindow(),m=a.getWindow(),!k.equals(m)&&k.$.frameElement&&(a=(new CKEDITOR.dom.element(k.$.frameElement)).getDocumentPosition(a),b+=a.x,c+=a.y));document.documentElement.getBoundingClientRect||!CKEDITOR.env.gecko||
|
|
121
|
+
e||(b+=this.$.clientLeft?1:0,c+=this.$.clientTop?1:0);return{x:b,y:c}},scrollIntoView:function(a){var b=this.getParent();if(b){do if((b.$.clientWidth&&b.$.clientWidth<b.$.scrollWidth||b.$.clientHeight&&b.$.clientHeight<b.$.scrollHeight)&&!b.is("body")&&this.scrollIntoParent(b,a,1),b.is("html")){var c=b.getWindow();try{var d=c.$.frameElement;d&&(b=new CKEDITOR.dom.element(d))}catch(f){}}while(b=b.getParent())}},scrollIntoParent:function(a,b,c){var d,f,e,k;function h(d,b){/body|html/.test(a.getName())?
|
|
122
|
+
a.getWindow().$.scrollBy(d,b):(a.$.scrollLeft+=d,a.$.scrollTop+=b)}function m(a,d){var b={x:0,y:0};if(!a.is(l?"body":"html")){var c=a.$.getBoundingClientRect();b.x=c.left;b.y=c.top}c=a.getWindow();c.equals(d)||(c=m(CKEDITOR.dom.element.get(c.$.frameElement),d),b.x+=c.x,b.y+=c.y);return b}function w(a,d){return parseInt(a.getComputedStyle("margin-"+d)||0,10)||0}!a&&(a=this.getWindow());e=a.getDocument();var l="BackCompat"==e.$.compatMode;a instanceof CKEDITOR.dom.window&&(a=l?e.getBody():e.getDocumentElement());
|
|
123
|
+
CKEDITOR.env.webkit&&(e=this.getEditor(!1))&&(e._.previousScrollTop=null);e=a.getWindow();f=m(this,e);var r=m(a,e),A=this.$.offsetHeight;d=this.$.offsetWidth;var u=a.$.clientHeight,z=a.$.clientWidth;e=f.x-w(this,"left")-r.x||0;k=f.y-w(this,"top")-r.y||0;d=f.x+d+w(this,"right")-(r.x+z)||0;f=f.y+A+w(this,"bottom")-(r.y+u)||0;(0>k||0<f)&&h(0,!0===b?k:!1===b?f:0>k?k:f);c&&(0>e||0<d)&&h(0>e?e:d,0)},setState:function(a,b,c){b=b||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(b+"_on");this.removeClass(b+
|
|
124
124
|
"_off");this.removeClass(b+"_disabled");c&&this.setAttribute("aria-pressed",!0);c&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(b+"_disabled");this.removeClass(b+"_off");this.removeClass(b+"_on");c&&this.setAttribute("aria-disabled",!0);c&&this.removeAttribute("aria-pressed");break;default:this.addClass(b+"_off"),this.removeClass(b+"_on"),this.removeClass(b+"_disabled"),c&&this.removeAttribute("aria-pressed"),c&&this.removeAttribute("aria-disabled")}},
|
|
125
|
-
getFrameDocument:function(){var a=this.$;try{a.contentWindow.document}catch(b){a.src=a.src}return a&&new CKEDITOR.dom.document(a.contentWindow.document)},copyAttributes:function(a,b){var c=this.$.attributes;b=b||{};for(var d=0;d<c.length;d++){var f=c[d],e=f.nodeName.toLowerCase(),
|
|
125
|
+
getFrameDocument:function(){var a=this.$;try{a.contentWindow.document}catch(b){a.src=a.src}return a&&new CKEDITOR.dom.document(a.contentWindow.document)},copyAttributes:function(a,b){var c=this.$.attributes;b=b||{};for(var d=0;d<c.length;d++){var f=c[d],e=f.nodeName.toLowerCase(),k;if(!(e in b))if("checked"==e&&(k=this.getAttribute(e)))a.setAttribute(e,k);else if(!CKEDITOR.env.ie||this.hasAttribute(e))k=this.getAttribute(e),null===k&&(k=f.nodeValue),a.setAttribute(e,k)}""!==this.$.style.cssText&&
|
|
126
126
|
(a.$.style.cssText=this.$.style.cssText)},renameNode:function(a){if(this.getName()!=a){var b=this.getDocument();a=new CKEDITOR.dom.element(a,b);this.copyAttributes(a);this.moveChildren(a);this.getParent(!0)&&this.$.parentNode.replaceChild(a.$,this.$);a.$["data-cke-expando"]=this.$["data-cke-expando"];this.$=a.$;delete this.getName}},getChild:function(){function a(b,c){var d=b.childNodes;if(0<=c&&c<d.length)return d[c]}return function(b){var c=this.$;if(b.slice)for(b=b.slice();0<b.length&&c;)c=a(c,
|
|
127
127
|
b.shift());else c=a(c,b);return c?new CKEDITOR.dom.node(c):null}}(),getChildCount:function(){return this.$.childNodes.length},disableContextMenu:function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT&&b.hasClass("cke_enable_context_menu")}this.on("contextmenu",function(b){b.data.getTarget().getAscendant(a,!0)||b.data.preventDefault()})},getDirection:function(a){return a?this.getComputedStyle("direction")||this.getDirection()||this.getParent()&&this.getParent().getDirection(1)||this.getDocument().$.dir||
|
|
128
128
|
"ltr":this.getStyle("direction")||this.getAttribute("dir")},data:function(a,b){a="data-"+a;if(void 0===b)return this.getAttribute(a);!1===b?this.removeAttribute(a):this.setAttribute(a,b);return null},getEditor:function(a){var b=CKEDITOR.instances,c,d,f;a=a||void 0===a;for(c in b)if(d=b[c],d.element.equals(this)&&d.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO||!a&&(f=d.editable())&&(f.equals(this)||f.contains(this)))return d;return null},find:function(a){var b=l(this);a=new CKEDITOR.dom.nodeList(this.$.querySelectorAll(h(this,
|
|
129
129
|
a)));b();return a},findOne:function(a){var b=l(this);a=this.$.querySelector(h(this,a));b();return a?new CKEDITOR.dom.element(a):null},forEach:function(a,b,c){if(!(c||b&&this.type!=b))var d=a(this);if(!1!==d){c=this.getChildren();for(var f=0;f<c.count();f++)d=c.getItem(f),d.type==CKEDITOR.NODE_ELEMENT?d.forEach(a,b):b&&d.type!=b||a(d)}},fireEventHandler:function(a,b){var c="on"+a,d=this.$;if(CKEDITOR.env.ie&&9>CKEDITOR.env.version){var f=d.ownerDocument.createEventObject(),e;for(e in b)f[e]=b[e];d.fireEvent(c,
|
|
130
|
-
f)}else d[d[a]?a:c](b)},isDetached:function(){var a=this.getDocument(),b=a.getDocumentElement();return b.equals(this)||b.contains(this)?!CKEDITOR.env.ie||8<CKEDITOR.env.version&&!CKEDITOR.env.quirks?!a.$.defaultView:!1:!0}});var
|
|
130
|
+
f)}else d[d[a]?a:c](b)},isDetached:function(){var a=this.getDocument(),b=a.getDocumentElement();return b.equals(this)||b.contains(this)?!CKEDITOR.env.ie||8<CKEDITOR.env.version&&!CKEDITOR.env.quirks?!a.$.defaultView:!1:!0}});var k={width:["border-left-width","border-right-width","padding-left","padding-right"],height:["border-top-width","border-bottom-width","padding-top","padding-bottom"]};CKEDITOR.dom.element.prototype.setSize=function(a,b,c){"number"==typeof b&&(!c||CKEDITOR.env.ie&&CKEDITOR.env.quirks||
|
|
131
131
|
(b-=f.call(this,a)),this.setStyle(a,b+"px"))};CKEDITOR.dom.element.prototype.getSize=function(a,b){var c=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(a)],this.$["client"+CKEDITOR.tools.capitalize(a)])||0;b&&(c-=f.call(this,a));return c}})();CKEDITOR.dom.documentFragment=function(a){a=a||CKEDITOR.document;this.$=a.type==CKEDITOR.NODE_DOCUMENT?a.$.createDocumentFragment():a};CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,
|
|
132
132
|
insertAfterNode:function(a){a=a.$;a.parentNode.insertBefore(this.$,a.nextSibling)},getHtml:function(){var a=new CKEDITOR.dom.element("div");this.clone(1,1).appendTo(a);return a.getHtml().replace(/\s*data-cke-expando=".*?"/g,"")}},!0,{append:1,appendBogus:1,clone:1,getFirst:1,getHtml:1,getLast:1,getParent:1,getNext:1,getPrevious:1,appendTo:1,moveChildren:1,insertBefore:1,insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1});CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,
|
|
133
133
|
CKEDITOR.dom.document.prototype,!0,{find:1,findOne:1});(function(){function a(a,d){var b=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(b.collapsed)return this.end(),null;b.optimize()}var c,f=b.startContainer;c=b.endContainer;var e=b.startOffset,k=b.endOffset,g,n=this.guard,h=this.type,m=a?"getPreviousSourceNode":"getNextSourceNode";if(!a&&!this._.guardLTR){var l=c.type==CKEDITOR.NODE_ELEMENT?c:c.getParent(),C=c.type==CKEDITOR.NODE_ELEMENT?c.getChild(k):c.getNext();this._.guardLTR=
|
|
134
|
-
function(a,d){return(!d||!l.equals(a))&&(!C||!a.equals(C))&&(a.type!=CKEDITOR.NODE_ELEMENT||!d||!a.equals(b.root))}}if(a&&!this._.guardRTL){var
|
|
134
|
+
function(a,d){return(!d||!l.equals(a))&&(!C||!a.equals(C))&&(a.type!=CKEDITOR.NODE_ELEMENT||!d||!a.equals(b.root))}}if(a&&!this._.guardRTL){var B=f.type==CKEDITOR.NODE_ELEMENT?f:f.getParent(),G=f.type==CKEDITOR.NODE_ELEMENT?e?f.getChild(e-1):null:f.getPrevious();this._.guardRTL=function(a,d){return(!d||!B.equals(a))&&(!G||!a.equals(G))&&(a.type!=CKEDITOR.NODE_ELEMENT||!d||!a.equals(b.root))}}var M=a?this._.guardRTL:this._.guardLTR;g=n?function(a,d){return!1===M(a,d)?!1:n(a,d)}:M;this.current?c=this.current[m](!1,
|
|
135
135
|
h,g):(a?c.type==CKEDITOR.NODE_ELEMENT&&(c=0<k?c.getChild(k-1):!1===g(c,!0)?null:c.getPreviousSourceNode(!0,h,g)):(c=f,c.type==CKEDITOR.NODE_ELEMENT&&((c=c.getChild(e))||(c=!1===g(f,!0)?null:f.getNextSourceNode(!0,h,g)))),c&&!1===g(c)&&(c=null));for(;c&&!this._.end;){this.current=c;if(!this.evaluator||!1!==this.evaluator(c)){if(!d)return c}else if(d&&this.evaluator)return!1;c=c[m](!1,h,g)}this.end();return this.current=null}function l(d){for(var b,c=null;b=a.call(this,d);)c=b;return c}CKEDITOR.dom.walker=
|
|
136
136
|
CKEDITOR.tools.createClass({$:function(a){this.range=a;this._={}},proto:{end:function(){this._.end=1},next:function(){return a.call(this)},previous:function(){return a.call(this,1)},checkForward:function(){return!1!==a.call(this,0,1)},checkBackward:function(){return!1!==a.call(this,1,1)},lastForward:function(){return l.call(this)},lastBackward:function(){return l.call(this,1)},reset:function(){delete this.current;this._={}}}});var h={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,
|
|
137
137
|
"table-footer-group":1,"table-row":1,"table-column-group":1,"table-column":1,"table-cell":1,"table-caption":1},f={absolute:1,fixed:1};CKEDITOR.dom.element.prototype.isBlockBoundary=function(a){return"none"!=this.getComputedStyle("float")||this.getComputedStyle("position")in f||!h[this.getComputedStyle("display")]?!!(this.is(CKEDITOR.dtd.$block)||a&&this.is(a)):!0};CKEDITOR.dom.walker.blockBoundary=function(a){return function(d){return!(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary(a))}};CKEDITOR.dom.walker.listItemBoundary=
|
|
138
138
|
function(){return this.blockBoundary({br:1})};CKEDITOR.dom.walker.bookmark=function(a,d){function b(a){return a&&a.getName&&"span"==a.getName()&&a.data("cke-bookmark")}return function(c){var f,e;f=c&&c.type!=CKEDITOR.NODE_ELEMENT&&(e=c.getParent())&&b(e);f=a?f:f||b(c);return!!(d^f)}};CKEDITOR.dom.walker.whitespaces=function(a){return function(d){var b;d&&d.type==CKEDITOR.NODE_TEXT&&(b=!CKEDITOR.tools.trim(d.getText())||CKEDITOR.env.webkit&&d.getText()==CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE);
|
|
139
|
-
return!!(a^b)}};CKEDITOR.dom.walker.invisible=function(a){var d=CKEDITOR.dom.walker.whitespaces(),b=CKEDITOR.env.webkit?1:0;return function(c){d(c)?c=1:(c.type==CKEDITOR.NODE_TEXT&&(c=c.getParent()),c=c.$.offsetWidth<=b);return!!(a^c)}};CKEDITOR.dom.walker.nodeType=function(a,d){return function(b){return!!(d^b.type==a)}};CKEDITOR.dom.walker.bogus=function(a){function d(a){return!m(a)&&!
|
|
140
|
-
b=b.getNext(d),c=c.isBlockBoundary()&&(!b||b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()));return!!(a^c)}};CKEDITOR.dom.walker.temp=function(a){return function(d){d.type!=CKEDITOR.NODE_ELEMENT&&(d=d.getParent());d=d&&d.hasAttribute("data-cke-temp");return!!(a^d)}};var e=/^[\t\r\n ]*(?: |\xa0)$/,m=CKEDITOR.dom.walker.whitespaces(),
|
|
141
|
-
CKEDITOR.dom.walker.ignored=function(a){return function(d){d=m(d)||
|
|
139
|
+
return!!(a^b)}};CKEDITOR.dom.walker.invisible=function(a){var d=CKEDITOR.dom.walker.whitespaces(),b=CKEDITOR.env.webkit?1:0;return function(c){d(c)?c=1:(c.type==CKEDITOR.NODE_TEXT&&(c=c.getParent()),c=c.$.offsetWidth<=b);return!!(a^c)}};CKEDITOR.dom.walker.nodeType=function(a,d){return function(b){return!!(d^b.type==a)}};CKEDITOR.dom.walker.bogus=function(a){function d(a){return!m(a)&&!k(a)}return function(b){var c=CKEDITOR.env.needsBrFiller?b.is&&b.is("br"):b.getText&&e.test(b.getText());c&&(c=b.getParent(),
|
|
140
|
+
b=b.getNext(d),c=c.isBlockBoundary()&&(!b||b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()));return!!(a^c)}};CKEDITOR.dom.walker.temp=function(a){return function(d){d.type!=CKEDITOR.NODE_ELEMENT&&(d=d.getParent());d=d&&d.hasAttribute("data-cke-temp");return!!(a^d)}};var e=/^[\t\r\n ]*(?: |\xa0)$/,m=CKEDITOR.dom.walker.whitespaces(),k=CKEDITOR.dom.walker.bookmark(),g=CKEDITOR.dom.walker.temp(),b=function(a){return k(a)||m(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$inline)&&!a.is(CKEDITOR.dtd.$empty)};
|
|
141
|
+
CKEDITOR.dom.walker.ignored=function(a){return function(d){d=m(d)||k(d)||g(d);return!!(a^d)}};var c=CKEDITOR.dom.walker.ignored();CKEDITOR.dom.walker.empty=function(a){return function(d){for(var b=0,f=d.getChildCount();b<f;++b)if(!c(d.getChild(b)))return!!a;return!a}};var d=CKEDITOR.dom.walker.empty(),n=CKEDITOR.dom.walker.validEmptyBlockContainers=CKEDITOR.tools.extend(function(a){var d={},b;for(b in a)CKEDITOR.dtd[b]["#"]&&(d[b]=1);return d}(CKEDITOR.dtd.$block),{caption:1,td:1,th:1});CKEDITOR.dom.walker.editable=
|
|
142
142
|
function(a){return function(b){b=c(b)?!1:b.type==CKEDITOR.NODE_TEXT||b.type==CKEDITOR.NODE_ELEMENT&&(b.is(CKEDITOR.dtd.$inline)||b.is("hr")||"false"==b.getAttribute("contenteditable")||!CKEDITOR.env.needsBrFiller&&b.is(n)&&d(b))?!0:!1;return!!(a^b)}};CKEDITOR.dom.element.prototype.getBogus=function(){var a=this;do a=a.getPreviousSourceNode();while(b(a));return a&&(CKEDITOR.env.needsBrFiller?a.is&&a.is("br"):a.getText&&e.test(a.getText()))?a:!1}})();CKEDITOR.dom.range=function(a){this.endOffset=this.endContainer=
|
|
143
|
-
this.startOffset=this.startContainer=null;this.collapsed=!0;var l=a instanceof CKEDITOR.dom.document;this.document=l?a:a.getDocument();this.root=l?a.getBody():a};(function(){function a(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer.equals(a.endContainer)&&a.startOffset==a.endOffset}function l(a,b,c,f,e){function g(a,d,b,c){var f=b?a.getPrevious():a.getNext();if(c&&m)return f;
|
|
144
|
-
|
|
145
|
-
b.mergeSiblings(!1),a.moveToBookmark({startNode:c}))):a.collapse(!0)}a.optimizeBookmark();var m=0===b,l=1==b,
|
|
146
|
-
CKEDITOR.NODE_TEXT?
|
|
147
|
-
O||c.equals(H[
|
|
148
|
-
c=CKEDITOR.dom.walker.bookmark(1);return function(f){return c(f)||b(f)?!0:!a&&
|
|
149
|
-
|
|
143
|
+
this.startOffset=this.startContainer=null;this.collapsed=!0;var l=a instanceof CKEDITOR.dom.document;this.document=l?a:a.getDocument();this.root=l?a.getBody():a};(function(){function a(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer.equals(a.endContainer)&&a.startOffset==a.endOffset}function l(a,b,c,f,e){function g(a,d,b,c){var f=b?a.getPrevious():a.getNext();if(c&&m)return f;u||c?d.append(a.clone(!0,e),b):(a.remove(),l&&d.append(a,b));return f}function k(){var a,d,b,c=Math.min(H.length,
|
|
144
|
+
K.length);for(a=0;a<c;a++)if(d=H[a],b=K[a],!d.equals(b))return a;return a-1}function h(){var b=F-1,c=M&&J&&!z.equals(v);b<N-1||b<O-1||c?(c?a.moveToPosition(v,CKEDITOR.POSITION_BEFORE_START):O==b+1&&G?a.moveToPosition(K[b],CKEDITOR.POSITION_BEFORE_END):a.moveToPosition(K[b+1],CKEDITOR.POSITION_BEFORE_START),f&&(b=H[b+1])&&b.type==CKEDITOR.NODE_ELEMENT&&(c=CKEDITOR.dom.element.createFromHtml('\x3cspan data-cke-bookmark\x3d"1" style\x3d"display:none"\x3e\x26nbsp;\x3c/span\x3e',a.document),c.insertAfter(b),
|
|
145
|
+
b.mergeSiblings(!1),a.moveToBookmark({startNode:c}))):a.collapse(!0)}a.optimizeBookmark();var m=0===b,l=1==b,u=2==b;b=u||l;var z=a.startContainer,v=a.endContainer,D=a.startOffset,C=a.endOffset,B,G,M,J,E,L;if(u&&v.type==CKEDITOR.NODE_TEXT&&(z.equals(v)||z.type===CKEDITOR.NODE_ELEMENT&&z.getFirst().equals(v)))c.append(a.document.createText(v.substring(D,C)));else{v.type==CKEDITOR.NODE_TEXT?u?L=!0:v=v.split(C):0<v.getChildCount()?C>=v.getChildCount()?(v=v.getChild(C-1),G=!0):v=v.getChild(C):J=G=!0;z.type==
|
|
146
|
+
CKEDITOR.NODE_TEXT?u?E=!0:z.split(D):0<z.getChildCount()?0===D?(z=z.getChild(D),B=!0):z=z.getChild(D-1):M=B=!0;for(var H=z.getParents(),K=v.getParents(),F=k(),N=H.length-1,O=K.length-1,I=c,X,S,Y,ga=-1,V=F;V<=N;V++){S=H[V];Y=S.getNext();for(V!=N||S.equals(K[V])&&N<O?b&&(X=I.append(S.clone(0,e))):B?g(S,I,!1,M):E&&I.append(a.document.createText(S.substring(D)));Y;){if(Y.equals(K[V])){ga=V;break}Y=g(Y,I)}I=X}I=c;for(V=F;V<=O;V++)if(c=K[V],Y=c.getPrevious(),c.equals(H[V]))b&&(I=I.getChild(0));else{V!=
|
|
147
|
+
O||c.equals(H[V])&&O<N?b&&(X=I.append(c.clone(0,e))):G?g(c,I,!1,J):L&&I.append(a.document.createText(c.substring(0,C)));if(V>ga)for(;Y;)Y=g(Y,I,!0);I=X}u||h()}}function h(){var a=!1,b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!0),f=CKEDITOR.dom.walker.bogus();return function(e){return c(e)||b(e)?!0:f(e)&&!a?a=!0:e.type==CKEDITOR.NODE_TEXT&&(e.hasAscendant("pre")||CKEDITOR.tools.trim(e.getText()).length)||e.type==CKEDITOR.NODE_ELEMENT&&!e.is(m)?!1:!0}}function f(a){var b=CKEDITOR.dom.walker.whitespaces(),
|
|
148
|
+
c=CKEDITOR.dom.walker.bookmark(1);return function(f){return c(f)||b(f)?!0:!a&&k(f)||f.type==CKEDITOR.NODE_ELEMENT&&f.is(CKEDITOR.dtd.$removeEmpty)}}function e(a){return function(){var f;return this[a?"getPreviousNode":"getNextNode"](function(a){!f&&c(a)&&(f=a);return b(a)&&!(k(a)&&a.equals(f))})}}var m={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},k=CKEDITOR.dom.walker.bogus(),
|
|
149
|
+
g=/^[\t\r\n ]*(?: |\xa0)$/,b=CKEDITOR.dom.walker.editable(),c=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype={clone:function(){var a=new CKEDITOR.dom.range(this.root);a._setStartContainer(this.startContainer);a.startOffset=this.startOffset;a._setEndContainer(this.endContainer);a.endOffset=this.endOffset;a.collapsed=this.collapsed;return a},collapse:function(a){a?(this._setEndContainer(this.startContainer),this.endOffset=this.startOffset):(this._setStartContainer(this.endContainer),
|
|
150
150
|
this.startOffset=this.endOffset);this.collapsed=!0},cloneContents:function(a){var b=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||l(this,2,b,!1,"undefined"==typeof a?!0:a);return b},deleteContents:function(a){this.collapsed||l(this,0,null,a)},extractContents:function(a,b){var c=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||l(this,1,c,a,"undefined"==typeof b?!0:b);return c},equals:function(a){return this.startOffset===a.startOffset&&this.endOffset===a.endOffset&&
|
|
151
151
|
this.startContainer.equals(a.startContainer)&&this.endContainer.equals(a.endContainer)},createBookmark:function(a){function b(a){return a.getAscendant(function(a){var d;if(d=a.data&&a.data("cke-temp"))d=-1===CKEDITOR.tools.array.indexOf(["cke_copybin","cke_pastebin"],a.getAttribute("id"));return d},!0)}var c=this.startContainer,f=this.endContainer,e=this.collapsed,g,k,h,m;g=this.document.createElement("span");g.data("cke-bookmark",1);g.setStyle("display","none");g.setHtml("\x26nbsp;");a&&(h="cke_bm_"+
|
|
152
152
|
CKEDITOR.tools.getNextNumber(),g.setAttribute("id",h+(e?"C":"S")));e||(k=g.clone(),k.setHtml("\x26nbsp;"),a&&k.setAttribute("id",h+"E"),m=this.clone(),b(f)&&(f=b(f),m.moveToPosition(f,CKEDITOR.POSITION_AFTER_END)),m.collapse(),m.insertNode(k));m=this.clone();b(c)&&(f=b(c),m.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START));m.collapse(!0);m.insertNode(g);k?(this.setStartAfter(g),this.setEndBefore(k)):this.moveToPosition(g,CKEDITOR.POSITION_AFTER_END);return{startNode:a?h+(e?"C":"S"):g,endNode:a?h+
|
|
@@ -158,17 +158,17 @@ else{for(a=a.$;a.lastChild;)a=a.lastChild;a=new CKEDITOR.dom.node(a);a=a.getNext
|
|
|
158
158
|
this.startOffset==this.endOffset-1?c.getChild(this.startOffset):c:c.getCommonAncestor(f);return b&&!c.is?c.getParent():c},optimize:function(){var a=this.startContainer,b=this.startOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setStartAfter(a):this.setStartBefore(a));a=this.endContainer;b=this.endOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setEndAfter(a):this.setEndBefore(a))},optimizeBookmark:function(){var a=this.startContainer,b=this.endContainer;a.is&&a.is("span")&&
|
|
159
159
|
a.data("cke-bookmark")&&this.setStartAt(a,CKEDITOR.POSITION_BEFORE_START);b&&b.is&&b.is("span")&&b.data("cke-bookmark")&&this.setEndAt(b,CKEDITOR.POSITION_AFTER_END)},trim:function(a,b){var c=this.startContainer,f=this.startOffset,e=this.collapsed;if((!a||e)&&c&&c.type==CKEDITOR.NODE_TEXT){if(f)if(f>=c.getLength())f=c.getIndex()+1,c=c.getParent();else{var g=c.split(f),f=c.getIndex()+1,c=c.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(g,this.endOffset-this.startOffset):c.equals(this.endContainer)&&
|
|
160
160
|
(this.endOffset+=1)}else f=c.getIndex(),c=c.getParent();this.setStart(c,f);if(e){this.collapse(!0);return}}c=this.endContainer;f=this.endOffset;b||e||!c||c.type!=CKEDITOR.NODE_TEXT||(f?(f>=c.getLength()||c.split(f),f=c.getIndex()+1):f=c.getIndex(),c=c.getParent(),this.setEnd(c,f))},enlarge:function(a,b){function c(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}var f=new RegExp(/[^\s\ufeff]/);switch(a){case CKEDITOR.ENLARGE_INLINE:var e=1;case CKEDITOR.ENLARGE_ELEMENT:var g=
|
|
161
|
-
function(a,d){var b=new CKEDITOR.dom.range(h);b.setStart(a,d);b.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);var b=new CKEDITOR.dom.walker(b),c;for(b.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};c=b.next();){if(c.type!=CKEDITOR.NODE_TEXT)return!1;
|
|
162
|
-
(G&&(C=!CKEDITOR.tools.trim(C.substring(0,G)).length&&C,
|
|
163
|
-
else if((
|
|
164
|
-
|
|
165
|
-
CKEDITOR.NODE_ELEMENT){if((0<
|
|
166
|
-
this.setEndAfter(k));break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
|
|
167
|
-
a;else if(
|
|
168
|
-
|
|
169
|
-
!0,e=c&&c.skipBogus;if(!this.collapsed){a=a||CKEDITOR.SHRINK_TEXT;var g=this.clone(),k=this.startContainer,h=this.endContainer,m=this.startOffset,l=this.endOffset,
|
|
170
|
-
function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var
|
|
171
|
-
CKEDITOR.POSITION_BEFORE_START);
|
|
161
|
+
function(a,d){var b=new CKEDITOR.dom.range(h);b.setStart(a,d);b.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);var b=new CKEDITOR.dom.walker(b),c;for(b.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};c=b.next();){if(c.type!=CKEDITOR.NODE_TEXT)return!1;B=c!=a?c.getText():c.substring(d);if(f.test(B))return!1}return!0};if(this.collapsed)break;var k=this.getCommonAncestor(),h=this.root,m,l,u,z,v,D=!1,C,B;C=this.startContainer;var G=this.startOffset;C.type==CKEDITOR.NODE_TEXT?
|
|
162
|
+
(G&&(C=!CKEDITOR.tools.trim(C.substring(0,G)).length&&C,D=!!C),C&&((z=C.getPrevious())||(u=C.getParent()))):(G&&(z=C.getChild(G-1)||C.getLast()),z||(u=C));for(u=c(u);u||z;){if(u&&!z){!v&&u.equals(k)&&(v=!0);if(e?u.isBlockBoundary():!h.contains(u))break;D&&"inline"==u.getComputedStyle("display")||(D=!1,v?m=u:this.setStartBefore(u));z=u.getPrevious()}for(;z;)if(C=!1,z.type==CKEDITOR.NODE_COMMENT)z=z.getPrevious();else{if(z.type==CKEDITOR.NODE_TEXT)B=z.getText(),f.test(B)&&(z=null),C=/[\s\ufeff]$/.test(B);
|
|
163
|
+
else if((z.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||b&&z.is("br"))&&!z.data("cke-bookmark"))if(D&&CKEDITOR.dtd.$removeEmpty[z.getName()]){B=z.getText();if(f.test(B))z=null;else for(var G=z.$.getElementsByTagName("*"),M=0,J;J=G[M++];)if(!CKEDITOR.dtd.$removeEmpty[J.nodeName.toLowerCase()]){z=null;break}z&&(C=!!B.length)}else z=null;C&&(D?v?m=u:u&&this.setStartBefore(u):D=!0);if(z){C=z.getPrevious();if(!u&&!C){u=z;z=null;break}z=C}else u=null}u&&(u=c(u.getParent()))}C=this.endContainer;G=this.endOffset;
|
|
164
|
+
u=z=null;v=D=!1;C.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(C.substring(G)).length?D=!0:(D=!C.getLength(),G==C.getLength()?(z=C.getNext())||(u=C.getParent()):g(C,G)&&(u=C.getParent())):(z=C.getChild(G))||(u=C);for(;u||z;){if(u&&!z){!v&&u.equals(k)&&(v=!0);if(e?u.isBlockBoundary():!h.contains(u))break;D&&"inline"==u.getComputedStyle("display")||(D=!1,v?l=u:u&&this.setEndAfter(u));z=u.getNext()}for(;z;){C=!1;if(z.type==CKEDITOR.NODE_TEXT)B=z.getText(),g(z,0)||(z=null),C=/^[\s\ufeff]/.test(B);else if(z.type==
|
|
165
|
+
CKEDITOR.NODE_ELEMENT){if((0<z.$.offsetWidth||b&&z.is("br"))&&!z.data("cke-bookmark"))if(D&&CKEDITOR.dtd.$removeEmpty[z.getName()]){B=z.getText();if(f.test(B))z=null;else for(G=z.$.getElementsByTagName("*"),M=0;J=G[M++];)if(!CKEDITOR.dtd.$removeEmpty[J.nodeName.toLowerCase()]){z=null;break}z&&(C=!!B.length)}else z=null}else C=1;C&&D&&(v?l=u:this.setEndAfter(u));if(z){C=z.getNext();if(!u&&!C){u=z;z=null;break}z=C}else u=null}u&&(u=c(u.getParent()))}m&&l&&(k=m.contains(l)?l:m,this.setStartBefore(k),
|
|
166
|
+
this.setEndAfter(k));break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:u=new CKEDITOR.dom.range(this.root);h=this.root;u.setStartAt(h,CKEDITOR.POSITION_AFTER_START);u.setEnd(this.startContainer,this.startOffset);u=new CKEDITOR.dom.walker(u);var E,L,H=CKEDITOR.dom.walker.blockBoundary(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),K=null,F=function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&"false"==a.getAttribute("contenteditable"))if(K){if(K.equals(a)){K=null;return}}else K=
|
|
167
|
+
a;else if(K)return;var d=H(a);d||(E=a);return d},e=function(a){var d=F(a);!d&&a.is&&a.is("br")&&(L=a);return d};u.guard=F;u=u.lastBackward();E=E||h;this.setStartAt(E,!E.is("br")&&(!u&&this.checkStartOfBlock()||u&&E.contains(u))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){u=this.clone();u=new CKEDITOR.dom.walker(u);var N=CKEDITOR.dom.walker.whitespaces(),O=CKEDITOR.dom.walker.bookmark();u.evaluator=function(a){return!N(a)&&!O(a)};if((u=u.previous())&&
|
|
168
|
+
u.type==CKEDITOR.NODE_ELEMENT&&u.is("br"))break}u=this.clone();u.collapse();u.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);u=new CKEDITOR.dom.walker(u);u.guard=a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?e:F;E=K=L=null;u=u.lastForward();E=E||h;this.setEndAt(E,!u&&this.checkEndOfBlock()||u&&E.contains(u)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START);L&&this.setEndAfter(L)}},shrink:function(a,b,c){var f="boolean"===typeof c?c:c&&"boolean"===typeof c.shrinkOnBlockBoundary?c.shrinkOnBlockBoundary:
|
|
169
|
+
!0,e=c&&c.skipBogus;if(!this.collapsed){a=a||CKEDITOR.SHRINK_TEXT;var g=this.clone(),k=this.startContainer,h=this.endContainer,m=this.startOffset,l=this.endOffset,u=c=1;k&&k.type==CKEDITOR.NODE_TEXT&&(m?m>=k.getLength()?g.setStartAfter(k):(g.setStartBefore(k),c=0):g.setStartBefore(k));h&&h.type==CKEDITOR.NODE_TEXT&&(l?l>=h.getLength()?g.setEndAfter(h):(g.setEndAfter(h),u=0):g.setEndBefore(h));var g=new CKEDITOR.dom.walker(g),z=CKEDITOR.dom.walker.bookmark(),v=CKEDITOR.dom.walker.bogus();g.evaluator=
|
|
170
|
+
function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var D;g.guard=function(b,c){if(e&&v(b)||z(b))return!0;if(a==CKEDITOR.SHRINK_ELEMENT&&b.type==CKEDITOR.NODE_TEXT||c&&b.equals(D)||!1===f&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return!1;c||b.type!=CKEDITOR.NODE_ELEMENT||(D=b);return!0};c&&(k=g[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(k,b?CKEDITOR.POSITION_AFTER_START:
|
|
171
|
+
CKEDITOR.POSITION_BEFORE_START);u&&(g.reset(),(g=g[a==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(g,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END));return!(!c&&!u)}},insertNode:function(a){this.optimizeBookmark();this.trim(!1,!0);var b=this.startContainer,c=b.getChild(this.startOffset);c?a.insertBefore(c):b.append(a);a.getParent()&&a.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(a)},moveToPosition:function(a,b){this.setStartAt(a,
|
|
172
172
|
b);this.collapse(!0)},moveToRange:function(a){this.setStart(a.startContainer,a.startOffset);this.setEnd(a.endContainer,a.endOffset)},selectNodeContents:function(a){this.setStart(a,0);this.setEnd(a,a.type==CKEDITOR.NODE_TEXT?a.getLength():a.getChildCount())},setStart:function(d,b){d.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[d.getName()]&&(b=d.getIndex(),d=d.getParent());this._setStartContainer(d);this.startOffset=b;this.endContainer||(this._setEndContainer(d),this.endOffset=b);a(this)},setEnd:function(d,
|
|
173
173
|
b){d.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[d.getName()]&&(b=d.getIndex()+1,d=d.getParent());this._setEndContainer(d);this.endOffset=b;this.startContainer||(this._setStartContainer(d),this.startOffset=b);a(this)},setStartAfter:function(a){this.setStart(a.getParent(),a.getIndex()+1)},setStartBefore:function(a){this.setStart(a.getParent(),a.getIndex())},setEndAfter:function(a){this.setEnd(a.getParent(),a.getIndex()+1)},setEndBefore:function(a){this.setEnd(a.getParent(),a.getIndex())},setStartAt:function(d,
|
|
174
174
|
b){switch(b){case CKEDITOR.POSITION_AFTER_START:this.setStart(d,0);break;case CKEDITOR.POSITION_BEFORE_END:d.type==CKEDITOR.NODE_TEXT?this.setStart(d,d.getLength()):this.setStart(d,d.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(d);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(d)}a(this)},setEndAt:function(d,b){switch(b){case CKEDITOR.POSITION_AFTER_START:this.setEnd(d,0);break;case CKEDITOR.POSITION_BEFORE_END:d.type==CKEDITOR.NODE_TEXT?this.setEnd(d,
|
|
@@ -177,12 +177,12 @@ new CKEDITOR.dom.elementPath(this.startContainer,this.root),f=new CKEDITOR.dom.e
|
|
|
177
177
|
CKEDITOR.POSITION_AFTER_END),g=null):c?(k=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),e=null):(g=this.splitElement(e,b||!1),e.is("ul","ol")||e.appendBogus()));return{previousBlock:e,nextBlock:g,wasStartOfBlock:c,wasEndOfBlock:f,elementPath:k}},splitElement:function(a,b){if(!this.collapsed)return null;this.setEndAt(a,CKEDITOR.POSITION_BEFORE_END);var c=this.extractContents(!1,b||!1),f=a.clone(!1,b||!1);c.appendTo(f);f.insertAfter(a);
|
|
178
178
|
this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return f},removeEmptyBlocksAtEnd:function(){function a(d){return function(a){return b(a)||c(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.isEmptyInlineRemoveable()||d.is("table")&&a.is("caption")?!1:!0}}var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!1);return function(b){for(var c=this.createBookmark(),f=this[b?"endPath":"startPath"](),e=f.block||f.blockLimit,g;e&&!e.equals(f.root)&&!e.getFirst(a(e));)g=e.getParent(),this[b?"setEndAt":
|
|
179
179
|
"setStartAt"](e,CKEDITOR.POSITION_AFTER_END),e.remove(1),e=g;this.moveToBookmark(c)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,this.root)},checkBoundaryOfElement:function(a,b){var c=b==CKEDITOR.START,e=this.clone();e.collapse(c);e[c?"setStartAt":"setEndAt"](a,c?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);e=new CKEDITOR.dom.walker(e);e.evaluator=f(c);return e[c?
|
|
180
|
-
"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var a=this.startContainer,b=this.startOffset;CKEDITOR.env.ie&&b&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.ltrim(a.substring(0,b)),
|
|
181
|
-
b=this.endOffset;CKEDITOR.env.ie&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.rtrim(a.substring(b)),
|
|
180
|
+
"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var a=this.startContainer,b=this.startOffset;CKEDITOR.env.ie&&b&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.ltrim(a.substring(0,b)),g.test(a)&&this.trim(0,1));this.trim();a=new CKEDITOR.dom.elementPath(this.startContainer,this.root);b=this.clone();b.collapse(!0);b.setStartAt(a.block||a.blockLimit,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(b);a.evaluator=h();return a.checkBackward()},checkEndOfBlock:function(){var a=this.endContainer,
|
|
181
|
+
b=this.endOffset;CKEDITOR.env.ie&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.rtrim(a.substring(b)),g.test(a)&&this.trim(1,0));this.trim();a=new CKEDITOR.dom.elementPath(this.endContainer,this.root);b=this.clone();b.collapse(!1);b.setEndAt(a.block||a.blockLimit,CKEDITOR.POSITION_BEFORE_END);a=new CKEDITOR.dom.walker(b);a.evaluator=h();return a.checkForward()},getPreviousNode:function(a,b,c){var f=this.clone();f.collapse(1);f.setStartAt(c||this.root,CKEDITOR.POSITION_AFTER_START);c=new CKEDITOR.dom.walker(f);
|
|
182
182
|
c.evaluator=a;c.guard=b;return c.previous()},getNextNode:function(a,b,c){var f=this.clone();f.collapse();f.setEndAt(c||this.root,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(f);c.evaluator=a;c.guard=b;return c.next()},checkReadOnly:function(){function a(d,b){for(;d;){if(d.type==CKEDITOR.NODE_ELEMENT){if("false"==d.getAttribute("contentEditable")&&!d.data("cke-editable"))return 0;if(d.is("html")||"true"==d.getAttribute("contentEditable")&&(d.contains(b)||d.equals(b)))break}d=d.getParent()}return 1}
|
|
183
|
-
return function(){var b=this.startContainer,c=this.endContainer;return!(a(b,c)&&a(c,b))}}(),moveToElementEditablePosition:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&!a.isEditable(!1))return this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var f=0;a;){if(a.type==CKEDITOR.NODE_TEXT){b&&this.endContainer&&this.checkEndOfBlock()&&
|
|
184
|
-
CKEDITOR.POSITION_BEFORE_START);f=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable())this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),f=1;else if(b&&a.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);else if("false"==a.getAttribute("contenteditable")&&a.is(CKEDITOR.dtd.$block))return this.setStartBefore(a),this.setEndAfter(a),!0;var e=a,
|
|
185
|
-
(h=e[b?"getLast":"getFirst"](c));
|
|
183
|
+
return function(){var b=this.startContainer,c=this.endContainer;return!(a(b,c)&&a(c,b))}}(),moveToElementEditablePosition:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&!a.isEditable(!1))return this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var f=0;a;){if(a.type==CKEDITOR.NODE_TEXT){b&&this.endContainer&&this.checkEndOfBlock()&&g.test(a.getText())?this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:
|
|
184
|
+
CKEDITOR.POSITION_BEFORE_START);f=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable())this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),f=1;else if(b&&a.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);else if("false"==a.getAttribute("contenteditable")&&a.is(CKEDITOR.dtd.$block))return this.setStartBefore(a),this.setEndAfter(a),!0;var e=a,k=f,h=void 0;e.type==CKEDITOR.NODE_ELEMENT&&e.isEditable(!1)&&
|
|
185
|
+
(h=e[b?"getLast":"getFirst"](c));k||h||(h=e[b?"getPrevious":"getNext"](c));a=h}return!!f},moveToClosestEditablePosition:function(a,b){var c,f=0,e,g,k=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];a?(c=new CKEDITOR.dom.range(this.root),c.moveToPosition(a,k[b?0:1])):c=this.clone();if(a&&!a.is(CKEDITOR.dtd.$block))f=1;else if(e=c[b?"getNextEditableNode":"getPreviousEditableNode"]())f=1,(g=e.type==CKEDITOR.NODE_ELEMENT)&&e.is(CKEDITOR.dtd.$block)&&"false"==e.getAttribute("contenteditable")?
|
|
186
186
|
(c.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),c.setEndAt(e,CKEDITOR.POSITION_AFTER_END)):!CKEDITOR.env.needsBrFiller&&g&&e.is(CKEDITOR.dom.walker.validEmptyBlockContainers)?(c.setEnd(e,0),c.collapse()):c.moveToPosition(e,k[b?1:0]);f&&this.moveToRange(c);return!!f},moveToElementEditStart:function(a){return this.moveToElementEditablePosition(a)},moveToElementEditEnd:function(a){return this.moveToElementEditablePosition(a,!0)},getEnclosedNode:function(){var a=this.clone();a.optimize();if(a.startContainer.type!=
|
|
187
187
|
CKEDITOR.NODE_ELEMENT||a.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var a=new CKEDITOR.dom.walker(a),b=CKEDITOR.dom.walker.bookmark(!1,!0),c=CKEDITOR.dom.walker.whitespaces(!0);a.evaluator=function(a){return c(a)&&b(a)};var f=a.next();a.reset();return f&&f.equals(a.previous())?f:null},getTouchedStartNode:function(){var a=this.startContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.startOffset)||a},getTouchedEndNode:function(){var a=this.endContainer;return this.collapsed||
|
|
188
188
|
a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.endOffset-1)||a},getNextEditableNode:e(),getPreviousEditableNode:e(1),_getTableElement:function(a){a=a||{td:1,th:1,tr:1,tbody:1,thead:1,tfoot:1,table:1};var b=this.getTouchedStartNode(),c=this.getTouchedEndNode(),f=b.getAscendant("table",!0),c=c.getAscendant("table",!0);return f&&!this.root.contains(f)?null:this.getEnclosedNode()?this.getEnclosedNode().getAscendant(a,!0):f&&c&&(f.equals(c)||f.contains(c)||c.contains(f))?b.getAscendant(a,!0):null},scrollIntoView:function(){var a=
|
|
@@ -197,189 +197,189 @@ b){var c=this.getCommonAncestor(),f=this.getBoundaryNodes(),e=[],g,k,h,m;if(c&&c
|
|
|
197
197
|
b.enlarge(CKEDITOR.ENLARGE_ELEMENT);if(d){var f=new CKEDITOR.dom.range(b.root),c=new CKEDITOR.dom.walker(f),e=CKEDITOR.dom.walker.whitespaces();f.setStart(d.endContainer,d.endOffset);f.setEnd(b.startContainer,b.startOffset);for(f=c.next();e(f)||b.endContainer.equals(f);)f=c.next();c=!f}c?d.setEnd(b.endContainer,b.endOffset):a.push(b);return a},[])}})();CKEDITOR.POSITION_AFTER_START=1;CKEDITOR.POSITION_BEFORE_END=2;CKEDITOR.POSITION_BEFORE_START=3;CKEDITOR.POSITION_AFTER_END=4;CKEDITOR.ENLARGE_ELEMENT=
|
|
198
198
|
1;CKEDITOR.ENLARGE_BLOCK_CONTENTS=2;CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS=3;CKEDITOR.ENLARGE_INLINE=4;CKEDITOR.START=1;CKEDITOR.END=2;CKEDITOR.SHRINK_ELEMENT=1;CKEDITOR.SHRINK_TEXT=2;"use strict";(function(){function a(a){1>arguments.length||(this.range=a,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||(this._={}))}function l(a){var b=[];a.forEach(function(a){if("true"==a.getAttribute("contenteditable"))return b.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return b}function h(a,b,f,e){a:{null==
|
|
199
199
|
e&&(e=l(f));for(var g;g=e.shift();)if(g.getDtd().p){e={element:g,remaining:e};break a}e=null}if(!e)return 0;if((g=CKEDITOR.filter.instances[e.element.data("cke-filter")])&&!g.check(b))return h(a,b,f,e.remaining);b=new CKEDITOR.dom.range(e.element);b.selectNodeContents(e.element);b=b.createIterator();b.enlargeBr=a.enlargeBr;b.enforceRealBlocks=a.enforceRealBlocks;b.activeFilter=b.filter=g;a._.nestedEditable={element:e.element,container:f,remaining:e.remaining,iterator:b};return 1}function f(a,b,f){if(!b)return!1;
|
|
200
|
-
a=a.clone();a.collapse(!f);return a.checkBoundaryOfElement(b,f?CKEDITOR.START:CKEDITOR.END)}var e=/^[\r\n\t ]+$/,m=CKEDITOR.dom.walker.bookmark(!1,!0),
|
|
201
|
-
this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(a);this._.nestedEditable=null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var
|
|
202
|
-
CKEDITOR.POSITION_AFTER_START);
|
|
203
|
-
CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(
|
|
204
|
-
1;
|
|
205
|
-
"br"!=
|
|
206
|
-
|
|
207
|
-
"li"!=d.getName()?
|
|
208
|
-
"br"==
|
|
200
|
+
a=a.clone();a.collapse(!f);return a.checkBoundaryOfElement(b,f?CKEDITOR.START:CKEDITOR.END)}var e=/^[\r\n\t ]+$/,m=CKEDITOR.dom.walker.bookmark(!1,!0),k=CKEDITOR.dom.walker.whitespaces(!0),g=function(a){return m(a)&&k(a)},b={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var d,k,l,q,y;a=a||"p";if(this._.nestedEditable){if(d=this._.nestedEditable.iterator.getNextParagraph(a))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,d;this.activeFilter=this.filter;if(h(this,a,
|
|
201
|
+
this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(a);this._.nestedEditable=null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var t=this.range.clone();k=t.startPath();var w=t.endPath(),x=!t.collapsed&&f(t,k.block),r=!t.collapsed&&f(t,w.block,1);t.shrink(CKEDITOR.SHRINK_ELEMENT,!0);x&&t.setStartAt(k.block,CKEDITOR.POSITION_BEFORE_END);r&&t.setEndAt(w.block,
|
|
202
|
+
CKEDITOR.POSITION_AFTER_START);k=t.endContainer.hasAscendant("pre",!0)||t.startContainer.hasAscendant("pre",!0);t.enlarge(this.forceBrBreak&&!k||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);t.collapsed||(k=new CKEDITOR.dom.walker(t.clone()),w=CKEDITOR.dom.walker.bookmark(!0,!0),k.evaluator=w,this._.nextNode=k.next(),k=new CKEDITOR.dom.walker(t.clone()),k.evaluator=w,k=k.previous(),this._.lastNode=k.getNextSourceNode(!0,null,t.root),this._.lastNode&&this._.lastNode.type==
|
|
203
|
+
CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(w=this.range.clone(),w.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),w.checkEndOfBlock()&&(w=new CKEDITOR.dom.elementPath(w.endContainer,w.root),this._.lastNode=(w.block||w.blockLimit).getNextSourceNode(!0))),this._.lastNode&&t.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=t.document.createText(""),this._.lastNode.insertAfter(k)),t=null);this._.started=
|
|
204
|
+
1;k=t}w=this._.nextNode;t=this._.lastNode;for(this._.nextNode=null;w;){var x=0,r=w.hasAscendant("pre"),A=w.type!=CKEDITOR.NODE_ELEMENT,u=0;if(A)w.type==CKEDITOR.NODE_TEXT&&e.test(w.getText())&&(A=0);else{var z=w.getName();if(CKEDITOR.dtd.$block[z]&&"false"==w.getAttribute("contenteditable")){d=w;h(this,a,d);break}else if(w.isBlockBoundary(this.forceBrBreak&&!r&&{br:1})){if("br"==z)A=1;else if(!k&&!w.getChildCount()&&"hr"!=z){d=w;l=w.equals(t);break}k&&(k.setEndAt(w,CKEDITOR.POSITION_BEFORE_START),
|
|
205
|
+
"br"!=z&&(this._.nextNode=w));x=1}else{if(w.getFirst()){k||(k=this.range.clone(),k.setStartAt(w,CKEDITOR.POSITION_BEFORE_START));w=w.getFirst();continue}A=1}}A&&!k&&(k=this.range.clone(),k.setStartAt(w,CKEDITOR.POSITION_BEFORE_START));l=(!x||A)&&w.equals(t);if(k&&!x)for(;!w.getNext(g)&&!l;){z=w.getParent();if(z.isBlockBoundary(this.forceBrBreak&&!r&&{br:1})){x=1;A=0;l||z.equals(t);k.setEndAt(z,CKEDITOR.POSITION_BEFORE_END);break}w=z;A=1;l=w.equals(t);u=1}A&&k.setEndAt(w,CKEDITOR.POSITION_AFTER_END);
|
|
206
|
+
w=this._getNextSourceNode(w,u,t);if((l=!w)||x&&k)break}if(!d){if(!k)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;d=new CKEDITOR.dom.elementPath(k.startContainer,k.root);w=d.blockLimit;x={div:1,th:1,td:1};d=d.block;!d&&w&&!this.enforceRealBlocks&&x[w.getName()]&&k.checkStartOfBlock()&&k.checkEndOfBlock()&&!w.equals(k.root)?d=w:!d||this.enforceRealBlocks&&d.is(b)?(d=this.range.document.createElement(a),k.extractContents().appendTo(d),d.trim(),k.insertNode(d),q=y=!0):
|
|
207
|
+
"li"!=d.getName()?k.checkStartOfBlock()&&k.checkEndOfBlock()||(d=d.clone(!1),k.extractContents().appendTo(d),d.trim(),y=k.splitBlock(),q=!y.wasStartOfBlock,y=!y.wasEndOfBlock,k.insertNode(d)):l||(this._.nextNode=d.equals(t)?null:this._getNextSourceNode(k.getBoundaryNodes().endNode,1,t))}q&&(q=d.getPrevious())&&q.type==CKEDITOR.NODE_ELEMENT&&("br"==q.getName()?q.remove():q.getLast()&&"br"==q.getLast().$.nodeName.toLowerCase()&&q.getLast().remove());y&&(q=d.getLast())&&q.type==CKEDITOR.NODE_ELEMENT&&
|
|
208
|
+
"br"==q.getName()&&(!CKEDITOR.env.needsBrFiller||q.getPrevious(m)||q.getNext(m))&&q.remove();this._.nextNode||(this._.nextNode=l||d.equals(t)||!t?null:this._getNextSourceNode(d,1,t));return d},_getNextSourceNode:function(a,b,f){function e(a){return!(a.equals(f)||a.equals(g))}var g=this.range.root;for(a=a.getNextSourceNode(b,null,e);!m(a);)a=a.getNextSourceNode(b,null,e);return a}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}})();CKEDITOR.command=function(a,l){this.uiItems=
|
|
209
209
|
[];this.exec=function(f){if(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())return!1;this.editorFocus&&a.focus();return!1===this.fire("exec")?!0:!1!==l.exec.call(this,a,f)};this.refresh=function(a,e){if(!this.readOnly&&a.readOnly)return!0;if(this.context&&!e.isContextFor(this.context)||!this.checkAllowed(!0))return this.disable(),!0;this.startDisabled||this.enable();this.modes&&!this.modes[a.mode]&&this.disable();return!1===this.fire("refresh",{editor:a,path:e})?!0:l.refresh&&!1!==l.refresh.apply(this,
|
|
210
210
|
arguments)};var h;this.checkAllowed=function(f){return f||"boolean"!=typeof h?h=a.activeFilter.checkFeature(this):h};CKEDITOR.tools.extend(this,l,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!l.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)};CKEDITOR.command.prototype={enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(this.preserveState&&"undefined"!=typeof this.previousState?this.previousState:CKEDITOR.TRISTATE_OFF)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},
|
|
211
211
|
setState:function(a){if(this.state==a||a!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return!1;this.previousState=this.state;this.state=a;this.fire("state");return!0},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?this.setState(CKEDITOR.TRISTATE_ON):this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.event.implementOn(CKEDITOR.command.prototype);CKEDITOR.ENTER_P=1;CKEDITOR.ENTER_BR=2;CKEDITOR.ENTER_DIV=3;CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,
|
|
212
|
-
language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"\x3c!DOCTYPE html\x3e",bodyId:"",bodyClass:"",fullPage:!1,height:200,contentsCss:CKEDITOR.getUrl("contents.css"),extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:999999,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]};(function(){function a(a,b,d,c,f){var e,
|
|
213
|
-
typeof
|
|
214
|
-
a.push(
|
|
215
|
-
h)if(b[
|
|
212
|
+
language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"\x3c!DOCTYPE html\x3e",bodyId:"",bodyClass:"",fullPage:!1,height:200,contentsCss:CKEDITOR.getUrl("contents.css"),extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:999999,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]};(function(){function a(a,b,d,c,f){var e,g;a=[];for(e in b){g=b[e];g="boolean"==
|
|
213
|
+
typeof g?{}:"function"==typeof g?{match:g}:M(g);"$"!=e.charAt(0)&&(g.elements=e);d&&(g.featureName=d.toLowerCase());var h=g;h.elements=k(h.elements,/\s+/)||null;h.propertiesOnly=h.propertiesOnly||!0===h.elements;var m=/\s*,\s*/,l=void 0;for(l in L){h[l]=k(h[l],m)||null;var z=h,n=H[l],v=k(h[H[l]],m),w=h[l],F=[],O=!0,p=void 0;v?O=!1:v={};for(p in w)"!"==p.charAt(0)&&(p=p.slice(1),F.push(p),v[p]=!0,O=!1);for(;p=F.pop();)w[p]=w["!"+p],delete w["!"+p];z[n]=(O?!1:v)||null}h.match=h.match||null;c.push(g);
|
|
214
|
+
a.push(g)}b=f.elements;f=f.generic;var D;d=0;for(c=a.length;d<c;++d){e=M(a[d]);g=!0===e.classes||!0===e.styles||!0===e.attributes;h=e;l=n=m=void 0;for(m in L)h[m]=x(h[m]);z=!0;for(l in H){m=H[l];n=h[m];v=[];w=void 0;for(w in n)-1<w.indexOf("*")?v.push(new RegExp("^"+w.replace(/\*/g,".*")+"$")):v.push(w);n=v;n.length&&(h[m]=n,z=!1)}h.nothingRequired=z;h.noProperties=!(h.attributes||h.classes||h.styles);if(!0===e.elements||null===e.elements)f[g?"unshift":"push"](e);else for(D in h=e.elements,delete e.elements,
|
|
215
|
+
h)if(b[D])b[D][g?"unshift":"push"](e);else b[D]=[e]}}function l(a,b,d,c){if(!a.match||a.match(b))if(c||g(a,b))if(a.propertiesOnly||(d.valid=!0),d.allAttributes||(d.allAttributes=h(a.attributes,b.attributes,d.validAttributes)),d.allStyles||(d.allStyles=h(a.styles,b.styles,d.validStyles)),!d.allClasses){a=a.classes;b=b.classes;c=d.validClasses;if(a)if(!0===a)a=!0;else{for(var f=0,e=b.length,k;f<e;++f)k=b[f],c[k]||(c[k]=a(k));a=!1}else a=!1;d.allClasses=a}}function h(a,b,d){if(!a)return!1;if(!0===a)return!0;
|
|
216
216
|
for(var c in b)d[c]||(d[c]=a(c));return!1}function f(a,b,d){if(!a.match||a.match(b)){if(a.noProperties)return!1;d.hadInvalidAttribute=e(a.attributes,b.attributes)||d.hadInvalidAttribute;d.hadInvalidStyle=e(a.styles,b.styles)||d.hadInvalidStyle;a=a.classes;b=b.classes;if(a){for(var c=!1,f=!0===a,g=b.length;g--;)if(f||a(b[g]))b.splice(g,1),c=!0;a=c}else a=!1;d.hadInvalidClass=a||d.hadInvalidClass}}function e(a,b){if(!a)return!1;var d=!1,c=!0===a,f;for(f in b)if(c||a(f))delete b[f],d=!0;return d}function m(a,
|
|
217
|
-
b,d){if(a.disabled||a.customConfig&&!d||!b)return!1;a._.cachedChecks={};return!0}function
|
|
217
|
+
b,d){if(a.disabled||a.customConfig&&!d||!b)return!1;a._.cachedChecks={};return!0}function k(a,b){if(!a)return!1;if(!0===a)return a;if("string"==typeof a)return a=J(a),"*"==a?!0:CKEDITOR.tools.convertArrayToObject(a.split(b));if(CKEDITOR.tools.isArray(a))return a.length?CKEDITOR.tools.convertArrayToObject(a):!1;var d={},c=0,f;for(f in a)d[f]=a[f],c++;return c?d:!1}function g(a,d){if(a.nothingRequired)return!0;var c,f,e,g;if(e=a.requiredClasses)for(g=d.classes,c=0;c<e.length;++c)if(f=e[c],"string"==
|
|
218
218
|
typeof f){if(-1==CKEDITOR.tools.indexOf(g,f))return!1}else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(g,f))return!1;return b(d.styles,a.requiredStyles)&&b(d.attributes,a.requiredAttributes)}function b(a,b){if(!b)return!0;for(var d=0,c;d<b.length;++d)if(c=b[d],"string"==typeof c){if(!(c in a))return!1}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a,c))return!1;return!0}function c(a){if(!a)return{};a=a.split(/\s*,\s*/).sort();for(var b={};a.length;)b[a.shift()]="cke-test";return b}function d(a){var b,
|
|
219
|
-
d,c,f,e={},g=1;for(a=
|
|
220
|
-
"$1"));if(c.doCallbacks&&a.elementCallbacks){a:{g=a.elementCallbacks;for(var k=0,h=g.length,m;k<h;++k)if(m=g[k](b)){g=m;break a}g=void 0}if(g)return g}if(c.doTransform&&(g=a._.transformations[b.name])){
|
|
221
|
-
allStyles:!1,hadInvalidAttribute:!1,hadInvalidClass:!1,hadInvalidStyle:!1},
|
|
222
|
-
|
|
223
|
-
m&&
|
|
224
|
-
function
|
|
225
|
-
(a.parent&&d.push({check:"it",el:a.parent}),a.remove());else if(G.$block[c]||"tr"==c)if("br"==b)a.previous&&!
|
|
226
|
-
h,m,g=c.length;0<g;)k=c[--g],e&&(k.type==CKEDITOR.NODE_TEXT||k.type==CKEDITOR.NODE_ELEMENT&&G.$inline[k.name])?(h||(h=new CKEDITOR.htmlParser.element(b),h.insertAfter(a),d.push({check:"parent-down",el:h})),h.add(k,0)):(h=null,m=G[f.name]||G.span,k.insertAfter(a),f.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||k.type!=CKEDITOR.NODE_ELEMENT||m[k.name]||d.push({check:"el-up",el:k}));a.remove()}}else c in{style:1,script:1}?a.remove():(a.parent&&d.push({check:"it",el:a.parent}),a.replaceWithChildren())}function
|
|
227
|
-
b,d){var c,f;for(c=0;c<d.length;++c)if(f=d[c],!(f.check&&!a.check(f.check,!1)||f.left&&!f.left(b))){f.right(b,
|
|
228
|
-
a:(d=a[0],c=a[1]);return[{element:d,left:c,right:function(a,d){d.transform(a,b)}}]}function C(a){return function(b){return
|
|
219
|
+
d,c,f,e={},g=1;for(a=J(a);b=a.match(K);)(d=b[2])?(c=n(d,"styles"),f=n(d,"attrs"),d=n(d,"classes")):c=f=d=null,e["$"+g++]={elements:b[1],classes:d,styles:c,attributes:f},a=a.slice(b[0].length);return e}function n(a,b){var d=a.match(F[b]);return d?J(d[1]):null}function p(a){var b=a.styleBackup=a.attributes.style,d=a.classBackup=a.attributes["class"];a.styles||(a.styles=CKEDITOR.tools.parseCssText(b||"",1));a.classes||(a.classes=d?d.split(/\s+/):[])}function q(a,b,d,c){var e=0,g;c.toHtml&&(b.name=b.name.replace(N,
|
|
220
|
+
"$1"));if(c.doCallbacks&&a.elementCallbacks){a:{g=a.elementCallbacks;for(var k=0,h=g.length,m;k<h;++k)if(m=g[k](b)){g=m;break a}g=void 0}if(g)return g}if(c.doTransform&&(g=a._.transformations[b.name])){p(b);for(k=0;k<g.length;++k)z(a,b,g[k]);t(b)}if(c.doFilter){a:{k=b.name;h=a._;a=h.allowedRules.elements[k];g=h.allowedRules.generic;k=h.disallowedRules.elements[k];h=h.disallowedRules.generic;m=c.skipRequired;var n={valid:!1,validAttributes:{},validClasses:{},validStyles:{},allAttributes:!1,allClasses:!1,
|
|
221
|
+
allStyles:!1,hadInvalidAttribute:!1,hadInvalidClass:!1,hadInvalidStyle:!1},v,F;if(a||g){p(b);if(k)for(v=0,F=k.length;v<F;++v)if(!1===f(k[v],b,n)){a=null;break a}if(h)for(v=0,F=h.length;v<F;++v)f(h[v],b,n);if(a)for(v=0,F=a.length;v<F;++v)l(a[v],b,n,m);if(g)for(v=0,F=g.length;v<F;++v)l(g[v],b,n,m);a=n}else a=null}if(!a||!a.valid)return d.push(b),1;F=a.validAttributes;var D=a.validStyles;g=a.validClasses;var k=b.attributes,x=b.styles,h=b.classes;m=b.classBackup;var I=b.styleBackup,r,J,G=[],n=[],C=/^data-cke-/;
|
|
222
|
+
v=!1;delete k.style;delete k["class"];delete b.classBackup;delete b.styleBackup;if(!a.allAttributes)for(r in k)F[r]||(C.test(r)?r==(J=r.replace(/^data-cke-saved-/,""))||F[J]||(delete k[r],v=!0):(delete k[r],v=!0));if(!a.allStyles||a.hadInvalidStyle){for(r in x)a.allStyles||D[r]?G.push(r+":"+x[r]):v=!0;G.length&&(k.style=G.sort().join("; "))}else I&&(k.style=I);if(!a.allClasses||a.hadInvalidClass){for(r=0;r<h.length;++r)(a.allClasses||g[h[r]])&&n.push(h[r]);n.length&&(k["class"]=n.sort().join(" "));
|
|
223
|
+
m&&n.length<m.split(/\s+/).length&&(v=!0)}else m&&(k["class"]=m);v&&(e=1);if(!c.skipFinalValidation&&!w(b))return d.push(b),1}c.toHtml&&(b.name=b.name.replace(O,"cke:$1"));return e}function y(a){var b=[],d;for(d in a)-1<d.indexOf("*")&&b.push(d.replace(/\*/g,".*"));return b.length?new RegExp("^(?:"+b.join("|")+")$"):null}function t(a){var b=a.attributes,d;delete b.style;delete b["class"];if(d=CKEDITOR.tools.writeCssText(a.styles,!0))b.style=d;a.classes.length&&(b["class"]=a.classes.sort().join(" "))}
|
|
224
|
+
function w(a){switch(a.name){case "a":if(!(a.children.length||a.attributes.name||a.attributes.id))return!1;break;case "img":if(!a.attributes.src)return!1}return!0}function x(a){if(!a)return!1;if(!0===a)return!0;var b=y(a);return function(d){return d in a||b&&d.match(b)}}function r(){return new CKEDITOR.htmlParser.element("br")}function A(a){return a.type==CKEDITOR.NODE_ELEMENT&&("br"==a.name||G.$block[a.name])}function u(a,b,d){var c=a.name;if(G.$empty[c]||!a.children.length)"hr"==c&&"br"==b?a.replaceWith(r()):
|
|
225
|
+
(a.parent&&d.push({check:"it",el:a.parent}),a.remove());else if(G.$block[c]||"tr"==c)if("br"==b)a.previous&&!A(a.previous)&&(b=r(),b.insertBefore(a)),a.next&&!A(a.next)&&(b=r(),b.insertAfter(a)),a.replaceWithChildren();else{var c=a.children,f;b:{f=G[b];for(var e=0,g=c.length,k;e<g;++e)if(k=c[e],k.type==CKEDITOR.NODE_ELEMENT&&!f[k.name]){f=!1;break b}f=!0}if(f)a.name=b,a.attributes={},d.push({check:"parent-down",el:a});else{f=a.parent;for(var e=f.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||"body"==f.name,
|
|
226
|
+
h,m,g=c.length;0<g;)k=c[--g],e&&(k.type==CKEDITOR.NODE_TEXT||k.type==CKEDITOR.NODE_ELEMENT&&G.$inline[k.name])?(h||(h=new CKEDITOR.htmlParser.element(b),h.insertAfter(a),d.push({check:"parent-down",el:h})),h.add(k,0)):(h=null,m=G[f.name]||G.span,k.insertAfter(a),f.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||k.type!=CKEDITOR.NODE_ELEMENT||m[k.name]||d.push({check:"el-up",el:k}));a.remove()}}else c in{style:1,script:1}?a.remove():(a.parent&&d.push({check:"it",el:a.parent}),a.replaceWithChildren())}function z(a,
|
|
227
|
+
b,d){var c,f;for(c=0;c<d.length;++c)if(f=d[c],!(f.check&&!a.check(f.check,!1)||f.left&&!f.left(b))){f.right(b,I);break}}function v(a,b){var d=b.getDefinition(),c=d.attributes,f=d.styles,e,g,k,h;if(a.name!=d.element)return!1;for(e in c)if("class"==e)for(d=c[e].split(/\s+/),k=a.classes.join("|");h=d.pop();){if(-1==k.indexOf(h))return!1}else if(a.attributes[e]!=c[e])return!1;for(g in f)if(a.styles[g]!=f[g])return!1;return!0}function D(a,b){var d,c;"string"==typeof a?d=a:a instanceof CKEDITOR.style?c=
|
|
228
|
+
a:(d=a[0],c=a[1]);return[{element:d,left:c,right:function(a,d){d.transform(a,b)}}]}function C(a){return function(b){return v(b,a)}}function B(a){return function(b,d){d[a](b)}}var G=CKEDITOR.dtd,M=CKEDITOR.tools.copy,J=CKEDITOR.tools.trim,E=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2;CKEDITOR.filter=function(a,b){this.allowedContent=[];this.disallowedContent=[];this.elementCallbacks=null;this.disabled=!1;this.editor=null;this.id=CKEDITOR.tools.getNextNumber();this._={allowedRules:{elements:{},
|
|
229
229
|
generic:[]},disallowedRules:{elements:{},generic:[]},transformations:{},cachedTests:{},cachedChecks:{}};CKEDITOR.filter.instances[this.id]=this;var d=this.editor=a instanceof CKEDITOR.editor?a:null;if(d&&!b){this.customConfig=!0;var c=d.config.allowedContent;!0===c?this.disabled=!0:(c||(this.customConfig=!1),this.allow(c,"config",1),this.allow(d.config.extraAllowedContent,"extra",1),this.allow(E[d.enterMode]+" "+E[d.shiftEnterMode],"default",1),this.disallow(d.config.disallowedContent))}else this.customConfig=
|
|
230
230
|
!1,this.allow(b||a,"default",1)};CKEDITOR.filter.instances={};CKEDITOR.filter.prototype={allow:function(b,c,f){if(!m(this,b,f))return!1;var e,g;if("string"==typeof b)b=d(b);else if(b instanceof CKEDITOR.style){if(b.toAllowedContentRules)return this.allow(b.toAllowedContentRules(this.editor),c,f);e=b.getDefinition();b={};f=e.attributes;b[e.element]=e={styles:e.styles,requiredStyles:e.styles&&CKEDITOR.tools.object.keys(e.styles)};f&&(f=M(f),e.classes=f["class"]?f["class"].split(/\s+/):null,e.requiredClasses=
|
|
231
231
|
e.classes,delete f["class"],e.attributes=f,e.requiredAttributes=f&&CKEDITOR.tools.object.keys(f))}else if(CKEDITOR.tools.isArray(b)){for(e=0;e<b.length;++e)g=this.allow(b[e],c,f);return g}a(this,b,c,this.allowedContent,this._.allowedRules);return!0},applyTo:function(a,b,d,c){if(this.disabled)return!1;var f=this,e=[],g=this.editor&&this.editor.config.protectedSource,k,h=!1,m={doFilter:!d,doTransform:!0,doCallbacks:!0,toHtml:b};a.forEach(function(a){if(a.type==CKEDITOR.NODE_ELEMENT){if("off"==a.attributes["data-cke-filter"])return!1;
|
|
232
|
-
if(!b||"span"!=a.name||!~CKEDITOR.tools.object.keys(a.attributes).join("|").indexOf("data-cke-"))if(k=
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
CKEDITOR.style)&&this.check(d)&&(f=d);if(f){for(b=0;b<a.length;++b)c.push(
|
|
236
|
-
this.check(a.requiredContent):!0},addTransformations:function(a){var b,d;if(!this.disabled&&a){var c=this._.transformations,f;for(f=0;f<a.length;++f){b=a[f];var e=void 0,g=void 0,k=void 0,h=void 0,m=void 0,
|
|
237
|
-
right:"string"==typeof
|
|
238
|
-
(g.attributes["class"]=e.join(" "));h&&(g.attributes.style=CKEDITOR.tools.writeCssText(g.styles))}else g=a.getDefinition(),h=g.styles,e=g.attributes||{},h&&!CKEDITOR.tools.isEmpty(h)?(h=M(h),e.style=CKEDITOR.tools.writeCssText(h,!0)):h={},g={name:g.element,attributes:e,classes:e["class"]?e["class"].split(/\s+/):[],styles:h,children:[]};var h=CKEDITOR.tools.clone(g),m=[],
|
|
232
|
+
if(!b||"span"!=a.name||!~CKEDITOR.tools.object.keys(a.attributes).join("|").indexOf("data-cke-"))if(k=q(f,a,e,m),k&1)h=!0;else if(k&2)return!1}else if(a.type==CKEDITOR.NODE_COMMENT&&a.value.match(/^\{cke_protected\}(?!\{C\})/)){var d;a:{var c=decodeURIComponent(a.value.replace(/^\{cke_protected\}/,""));d=[];var l,n,z;if(g)for(n=0;n<g.length;++n)if((z=c.match(g[n]))&&z[0].length==c.length){d=!0;break a}c=CKEDITOR.htmlParser.fragment.fromHtml(c);1==c.children.length&&(l=c.children[0]).type==CKEDITOR.NODE_ELEMENT&&
|
|
233
|
+
q(f,l,d,m);d=!d.length}d||e.push(a)}},null,!0);e.length&&(h=!0);var l;a=[];c=E[c||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)];for(var n;d=e.pop();)d.type==CKEDITOR.NODE_ELEMENT?u(d,c,a):d.remove();for(;l=a.pop();)if(d=l.el,d.parent)switch(n=G[d.parent.name]||G.span,l.check){case "it":G.$removeEmpty[d.name]&&!d.children.length?u(d,c,a):w(d)||u(d,c,a);break;case "el-up":d.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||n[d.name]||u(d,c,a);break;case "parent-down":d.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||
|
|
234
|
+
n[d.name]||u(d.parent,c,a)}return h},checkFeature:function(a){if(this.disabled||!a)return!0;a.toFeature&&(a=a.toFeature(this.editor));return!a.requiredContent||this.check(a.requiredContent)},disable:function(){this.disabled=!0},disallow:function(b){if(!m(this,b,!0))return!1;"string"==typeof b&&(b=d(b));a(this,b,null,this.disallowedContent,this._.disallowedRules);return!0},addContentForms:function(a){if(!this.disabled&&a){var b,d,c=[],f;for(b=0;b<a.length&&!f;++b)d=a[b],("string"==typeof d||d instanceof
|
|
235
|
+
CKEDITOR.style)&&this.check(d)&&(f=d);if(f){for(b=0;b<a.length;++b)c.push(D(a[b],f));this.addTransformations(c)}}},addElementCallback:function(a){this.elementCallbacks||(this.elementCallbacks=[]);this.elementCallbacks.push(a)},addFeature:function(a){if(this.disabled||!a)return!0;a.toFeature&&(a=a.toFeature(this.editor));this.allow(a.allowedContent,a.name);this.addTransformations(a.contentTransformations);this.addContentForms(a.contentForms);return a.requiredContent&&(this.customConfig||this.disallowedContent.length)?
|
|
236
|
+
this.check(a.requiredContent):!0},addTransformations:function(a){var b,d;if(!this.disabled&&a){var c=this._.transformations,f;for(f=0;f<a.length;++f){b=a[f];var e=void 0,g=void 0,k=void 0,h=void 0,m=void 0,l=void 0;d=[];for(g=0;g<b.length;++g)k=b[g],"string"==typeof k?(k=k.split(/\s*:\s*/),h=k[0],m=null,l=k[1]):(h=k.check,m=k.left,l=k.right),e||(e=k,e=e.element?e.element:h?h.match(/^([a-z0-9]+)/i)[0]:e.left.getDefinition().element),m instanceof CKEDITOR.style&&(m=C(m)),d.push({check:h==e?null:h,left:m,
|
|
237
|
+
right:"string"==typeof l?B(l):l});b=e;c[b]||(c[b]=[]);c[b].push(d)}}},check:function(a,b,f){if(this.disabled)return!0;if(CKEDITOR.tools.isArray(a)){for(var e=a.length;e--;)if(this.check(a[e],b,f))return!0;return!1}var g,k;if("string"==typeof a){k=a+"\x3c"+(!1===b?"0":"1")+(f?"1":"0")+"\x3e";if(k in this._.cachedChecks)return this._.cachedChecks[k];g=d(a).$1;var h=g.styles,e=g.classes;g.name=g.elements;g.classes=e=e?e.split(/\s*,\s*/):[];g.styles=c(h);g.attributes=c(g.attributes);g.children=[];e.length&&
|
|
238
|
+
(g.attributes["class"]=e.join(" "));h&&(g.attributes.style=CKEDITOR.tools.writeCssText(g.styles))}else g=a.getDefinition(),h=g.styles,e=g.attributes||{},h&&!CKEDITOR.tools.isEmpty(h)?(h=M(h),e.style=CKEDITOR.tools.writeCssText(h,!0)):h={},g={name:g.element,attributes:e,classes:e["class"]?e["class"].split(/\s+/):[],styles:h,children:[]};var h=CKEDITOR.tools.clone(g),m=[],l;if(!1!==b&&(l=this._.transformations[g.name])){for(e=0;e<l.length;++e)z(this,g,l[e]);t(g)}q(this,h,m,{doFilter:!0,doTransform:!1!==
|
|
239
239
|
b,skipRequired:!f,skipFinalValidation:!f});0<m.length?f=!1:((b=g.attributes["class"])&&(g.attributes["class"]=g.attributes["class"].split(" ").sort().join(" ")),f=CKEDITOR.tools.objectCompare(g.attributes,h.attributes,!0),b&&(g.attributes["class"]=b));"string"==typeof a&&(this._.cachedChecks[k]=f);return f},getAllowedEnterMode:function(){var a=["p","div","br"],b={p:CKEDITOR.ENTER_P,div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR};return function(d,c){var f=a.slice(),e;if(this.check(E[d]))return d;for(c||
|
|
240
240
|
(f=f.reverse());e=f.pop();)if(this.check(e))return b[e];return CKEDITOR.ENTER_BR}}(),clone:function(){var a=new CKEDITOR.filter,b=CKEDITOR.tools.clone;a.allowedContent=b(this.allowedContent);a._.allowedRules=b(this._.allowedRules);a.disallowedContent=b(this.disallowedContent);a._.disallowedRules=b(this._.disallowedRules);a._.transformations=b(this._.transformations);a.disabled=this.disabled;a.editor=this.editor;return a},destroy:function(){delete CKEDITOR.filter.instances[this.id];delete this._;delete this.allowedContent;
|
|
241
|
-
delete this.disallowedContent}};var L={styles:1,attributes:1,classes:1},H={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},
|
|
241
|
+
delete this.disallowedContent}};var L={styles:1,attributes:1,classes:1},H={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},K=/^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,F={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},N=/^cke:(object|embed|param)$/,O=/^(object|embed|param)$/,I;I=CKEDITOR.filter.transformationsTools={sizeToStyle:function(a){this.lengthToStyle(a,"width");this.lengthToStyle(a,
|
|
242
242
|
"height")},sizeToAttribute:function(a){this.lengthToAttribute(a,"width");this.lengthToAttribute(a,"height")},lengthToStyle:function(a,b,d){d=d||b;if(!(d in a.styles)){var c=a.attributes[b];c&&(/^\d+$/.test(c)&&(c+="px"),a.styles[d]=c)}delete a.attributes[b]},lengthToAttribute:function(a,b,d){d=d||b;if(!(d in a.attributes)){var c=a.styles[b],f=c&&c.match(/^(\d+)(?:\.\d*)?px$/);f?a.attributes[d]=f[1]:"cke-test"==c&&(a.attributes[d]="cke-test")}delete a.styles[b]},alignmentToStyle:function(a){if(!("float"in
|
|
243
243
|
a.styles)){var b=a.attributes.align;if("left"==b||"right"==b)a.styles["float"]=b}delete a.attributes.align},alignmentToAttribute:function(a){if(!("align"in a.attributes)){var b=a.styles["float"];if("left"==b||"right"==b)a.attributes.align=b}delete a.styles["float"]},splitBorderShorthand:function(a){if(a.styles.border){var b=CKEDITOR.tools.style.parse.border(a.styles.border);b.color&&(a.styles["border-color"]=b.color);b.style&&(a.styles["border-style"]=b.style);b.width&&(a.styles["border-width"]=b.width);
|
|
244
244
|
delete a.styles.border}},listTypeToStyle:function(a){if(a.attributes.type)switch(a.attributes.type){case "a":a.styles["list-style-type"]="lower-alpha";break;case "A":a.styles["list-style-type"]="upper-alpha";break;case "i":a.styles["list-style-type"]="lower-roman";break;case "I":a.styles["list-style-type"]="upper-roman";break;case "1":a.styles["list-style-type"]="decimal";break;default:a.styles["list-style-type"]=a.attributes.type}},splitMarginShorthand:function(a){function b(c){a.styles["margin-top"]=
|
|
245
|
-
d[c[0]];a.styles["margin-right"]=d[c[1]];a.styles["margin-bottom"]=d[c[2]];a.styles["margin-left"]=d[c[3]]}if(a.styles.margin){var d=a.styles.margin.match(/(\-?[\.\d]+\w+)/g)||["0px"];switch(d.length){case 1:b([0,0,0,0]);break;case 2:b([0,1,0,1]);break;case 3:b([0,1,2,1]);break;case 4:b([0,1,2,3])}delete a.styles.margin}},matchesStyle:
|
|
245
|
+
d[c[0]];a.styles["margin-right"]=d[c[1]];a.styles["margin-bottom"]=d[c[2]];a.styles["margin-left"]=d[c[3]]}if(a.styles.margin){var d=a.styles.margin.match(/(\-?[\.\d]+\w+)/g)||["0px"];switch(d.length){case 1:b([0,0,0,0]);break;case 2:b([0,1,0,1]);break;case 3:b([0,1,2,1]);break;case 4:b([0,1,2,3])}delete a.styles.margin}},matchesStyle:v,transform:function(a,b){if("string"==typeof b)a.name=b;else{var d=b.getDefinition(),c=d.styles,f=d.attributes,e,g,k,h;a.name=d.element;for(e in f)if("class"==e)for(d=
|
|
246
246
|
a.classes.join("|"),k=f[e].split(/\s+/);h=k.pop();)-1==d.indexOf(h)&&a.classes.push(h);else a.attributes[e]=f[e];for(g in c)a.styles[g]=c[g]}}}})();(function(){CKEDITOR.focusManager=function(a){if(a.focusManager)return a.focusManager;this.hasFocus=!1;this.currentActive=null;this._={editor:a};return this};CKEDITOR.focusManager._={blurDelay:200};CKEDITOR.focusManager.prototype={focus:function(a){this._.timer&&clearTimeout(this._.timer);a&&(this.currentActive=a);this.hasFocus||this._.locked||((a=CKEDITOR.currentInstance)&&
|
|
247
247
|
a.focusManager.blur(1),this.hasFocus=!0,(a=this._.editor.container)&&a.addClass("cke_focus"),this._.editor.fire("focus"))},lock:function(){this._.locked=1},unlock:function(){delete this._.locked},blur:function(a){function l(){if(this.hasFocus){this.hasFocus=!1;var a=this._.editor.container;a&&a.removeClass("cke_focus");this._.editor.fire("blur")}}if(!this._.locked){this._.timer&&clearTimeout(this._.timer);var h=CKEDITOR.focusManager._.blurDelay;a||!h?l.call(this):this._.timer=CKEDITOR.tools.setTimeout(function(){delete this._.timer;
|
|
248
248
|
l.call(this)},h,this)}},add:function(a,l){var h=a.getCustomData("focusmanager");if(!h||h!=this){h&&h.remove(a);var h="focus",f="blur";l&&(CKEDITOR.env.ie?(h="focusin",f="focusout"):CKEDITOR.event.useCapture=1);var e={blur:function(){a.equals(this.currentActive)&&this.blur()},focus:function(){this.focus(a)}};a.on(h,e.focus,this);a.on(f,e.blur,this);l&&(CKEDITOR.event.useCapture=0);a.setCustomData("focusmanager",this);a.setCustomData("focusmanager_handlers",e)}},remove:function(a){a.removeCustomData("focusmanager");
|
|
249
|
-
var l=a.removeCustomData("focusmanager_handlers");a.removeListener("blur",l.blur);a.removeListener("focus",l.focus)}}})();CKEDITOR.keystrokeHandler=function(a){if(a.keystrokeHandler)return a.keystrokeHandler;this.keystrokes={};this.blockedKeystrokes={};this._={editor:a};return this};(function(){var a,l=function(f){f=f.data;var e=f.getKeystroke(),h=this.keystrokes[e],
|
|
249
|
+
var l=a.removeCustomData("focusmanager_handlers");a.removeListener("blur",l.blur);a.removeListener("focus",l.focus)}}})();CKEDITOR.keystrokeHandler=function(a){if(a.keystrokeHandler)return a.keystrokeHandler;this.keystrokes={};this.blockedKeystrokes={};this._={editor:a};return this};(function(){var a,l=function(f){f=f.data;var e=f.getKeystroke(),h=this.keystrokes[e],k=this._.editor;a=!1===k.fire("key",{keyCode:e,domEvent:f});a||(h&&(a=!1!==k.execCommand(h,{from:"keystrokeHandler"})),a||(a=!!this.blockedKeystrokes[e]));
|
|
250
250
|
a&&f.preventDefault(!0);return!a},h=function(f){a&&(a=!1,f.data.preventDefault(!0))};CKEDITOR.keystrokeHandler.prototype={attach:function(a){a.on("keydown",l,this);if(CKEDITOR.env.gecko&&CKEDITOR.env.mac)a.on("keypress",h,this)}}})();(function(){CKEDITOR.lang={languages:{af:1,ar:1,az:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,"en-au":1,"en-ca":1,"en-gb":1,en:1,eo:1,es:1,"es-mx":1,et:1,eu:1,fa:1,fi:1,fo:1,"fr-ca":1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,
|
|
251
251
|
ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no:1,oc:1,pl:1,"pt-br":1,pt:1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,"sr-latn":1,sr:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,"zh-cn":1,zh:1},rtl:{ar:1,fa:1,he:1,ku:1,ug:1},load:function(a,l,h){a&&CKEDITOR.lang.languages[a]||(a=this.detect(l,a));var f=this;l=function(){f[a].dir=f.rtl[a]?"rtl":"ltr";h(a,f[a])};this[a]?l():CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+a+".js"),l,this)},detect:function(a,l){var h=this.languages;l=l||navigator.userLanguage||navigator.language||
|
|
252
|
-
a;var f=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),e=f[1],f=f[2];h[e+"-"+f]?e=e+"-"+f:h[e]||(e=null);CKEDITOR.lang.detect=e?function(){return e}:function(a){return a};return e||a}}})();CKEDITOR.scriptLoader=function(){var a={},l={};return{load:function(h,f,e,m){var
|
|
253
|
-
d(f))},
|
|
254
|
-
null;c.$.onerror=null;
|
|
252
|
+
a;var f=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),e=f[1],f=f[2];h[e+"-"+f]?e=e+"-"+f:h[e]||(e=null);CKEDITOR.lang.detect=e?function(){return e}:function(a){return a};return e||a}}})();CKEDITOR.scriptLoader=function(){var a={},l={};return{load:function(h,f,e,m){var k="string"==typeof h;k&&(h=[h]);e||(e=CKEDITOR);var g=h.length,b=[],c=[],d=function(a){f&&(k?f.call(e,a):f.call(e,b,c))};if(0===g)d(!0);else{var n=function(a,f){(f?b:c).push(a);0>=--g&&(m&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),
|
|
253
|
+
d(f))},p=function(b,d){a[b]=1;var c=l[b];delete l[b];for(var f=0;f<c.length;f++)c[f](b,d)},q=function(b){if(a[b])n(b,!0);else{var d=l[b]||(l[b]=[]);d.push(n);if(!(1<d.length)){var c=new CKEDITOR.dom.element("script");c.setAttributes({type:"text/javascript",src:b});f&&(CKEDITOR.env.ie&&(8>=CKEDITOR.env.version||CKEDITOR.env.ie9Compat)?c.$.onreadystatechange=function(){if("loaded"==c.$.readyState||"complete"==c.$.readyState)c.$.onreadystatechange=null,p(b,!0)}:(c.$.onload=function(){setTimeout(function(){c.$.onload=
|
|
254
|
+
null;c.$.onerror=null;p(b,!0)},0)},c.$.onerror=function(){c.$.onload=null;c.$.onerror=null;p(b,!1)}));c.appendTo(CKEDITOR.document.getHead())}}};m&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var y=0;y<g;y++)q(h[y])}},queue:function(){function a(){var e;(e=f[0])&&this.load(e.scriptUrl,e.callback,CKEDITOR,0)}var f=[];return function(e,m){var k=this;f.push({scriptUrl:e,callback:function(){m&&m.apply(this,arguments);f.shift();a.call(k)}});1==f.length&&a.call(this)}}()}}();CKEDITOR.resourceManager=
|
|
255
255
|
function(a,l){this.basePath=a;this.fileName=l;this.registered={};this.loaded={};this.externals={};this._={waitingList:{}}};CKEDITOR.resourceManager.prototype={add:function(a,l){if(this.registered[a])throw Error('[CKEDITOR.resourceManager.add] The resource name "'+a+'" is already registered.');var h=this.registered[a]=l||{};h.name=a;h.path=this.getPath(a);CKEDITOR.fire(a+CKEDITOR.tools.capitalize(this.fileName)+"Ready",h);return this.get(a)},get:function(a){return this.registered[a]||null},getPath:function(a){var l=
|
|
256
|
-
this.externals[a];return CKEDITOR.getUrl(l&&l.dir||this.basePath+a+"/")},getFilePath:function(a){var l=this.externals[a];return CKEDITOR.getUrl(this.getPath(a)+(l?l.file:this.fileName+".js"))},addExternal:function(a,l,h){h||(l=l.replace(/[^\/]+$/,function(a){h=a;return""}));h=h||this.fileName+".js";a=a.split(",");for(var f=0;f<a.length;f++)this.externals[a[f]]={dir:l,file:h}},load:function(a,l,h){CKEDITOR.tools.isArray(a)||(a=a?[a]:[]);for(var f=this.loaded,e=this.registered,m=[],
|
|
257
|
-
a.length;b++){var c=a[b];if(c)if(f[c]||e[c])
|
|
258
|
-
CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var l={};return function(h,f,e){var m={},
|
|
259
|
-
c.push(h[
|
|
256
|
+
this.externals[a];return CKEDITOR.getUrl(l&&l.dir||this.basePath+a+"/")},getFilePath:function(a){var l=this.externals[a];return CKEDITOR.getUrl(this.getPath(a)+(l?l.file:this.fileName+".js"))},addExternal:function(a,l,h){h||(l=l.replace(/[^\/]+$/,function(a){h=a;return""}));h=h||this.fileName+".js";a=a.split(",");for(var f=0;f<a.length;f++)this.externals[a[f]]={dir:l,file:h}},load:function(a,l,h){CKEDITOR.tools.isArray(a)||(a=a?[a]:[]);for(var f=this.loaded,e=this.registered,m=[],k={},g={},b=0;b<
|
|
257
|
+
a.length;b++){var c=a[b];if(c)if(f[c]||e[c])g[c]=this.get(c);else{var d=this.getFilePath(c);m.push(d);d in k||(k[d]=[]);k[d].push(c)}}CKEDITOR.scriptLoader.load(m,function(a,b){if(b.length)throw Error('[CKEDITOR.resourceManager.load] Resource name "'+k[b[0]].join(",")+'" was not found at "'+b[0]+'".');for(var d=0;d<a.length;d++)for(var c=k[a[d]],e=0;e<c.length;e++){var m=c[e];g[m]=this.get(m);f[m]=1}l.call(h,g)},this)}};CKEDITOR.plugins=new CKEDITOR.resourceManager("plugins/","plugin");CKEDITOR.plugins.load=
|
|
258
|
+
CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var l={};return function(h,f,e){var m={},k=function(g){a.call(this,g,function(a){CKEDITOR.tools.extend(m,a);var c=[],d;for(d in a){var g=a[d],h=g&&g.requires;if(!l[d]){if(g.icons)for(var q=g.icons.split(","),y=q.length;y--;)CKEDITOR.skin.addIcon(q[y],g.path+"icons/"+(CKEDITOR.env.hidpi&&g.hidpi?"hidpi/":"")+q[y]+".png");g.isSupportedEnvironment=g.isSupportedEnvironment||function(){return!0};l[d]=1}if(h)for(h.split&&(h=h.split(",")),g=0;g<h.length;g++)m[h[g]]||
|
|
259
|
+
c.push(h[g])}if(c.length)k.call(this,c);else{for(d in m)g=m[d],g.onLoad&&!g.onLoad._called&&(!1===g.onLoad()&&delete m[d],g.onLoad._called=1);f&&f.call(e||window,m)}},this)};k.call(this,h)}});CKEDITOR.plugins.setLang=function(a,l,h){var f=this.get(a);a=f.langEntries||(f.langEntries={});f=f.lang||(f.lang=[]);f.split&&(f=f.split(","));-1==CKEDITOR.tools.indexOf(f,l)&&f.push(l);a[l]=h};CKEDITOR.ui=function(a){if(a.ui)return a.ui;this.items={};this.instances={};this.editor=a;this._={handlers:{}};return this};
|
|
260
260
|
CKEDITOR.ui.prototype={add:function(a,l,h){h.name=a.toLowerCase();var f=this.items[a]={type:l,command:h.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(f,h)},get:function(a){return this.instances[a]},create:function(a){var l=this.items[a],h=l&&this._.handlers[l.type],f=l&&l.command&&this.editor.getCommand(l.command),h=h&&h.create.apply(this,l.args);this.instances[a]=h;f&&f.uiItems.push(h);h&&!h.type&&(h.type=l.type);return h},addHandler:function(a,l){this._.handlers[a]=
|
|
261
261
|
l},space:function(a){return CKEDITOR.document.getById(this.spaceId(a))},spaceId:function(a){return this.editor.id+"_"+a}};CKEDITOR.event.implementOn(CKEDITOR.ui);(function(){function a(a,b,d){CKEDITOR.event.call(this);a=a&&CKEDITOR.tools.clone(a);if(void 0!==b){if(!(b instanceof CKEDITOR.dom.element))throw Error("Expect element of type CKEDITOR.dom.element.");if(!d)throw Error("One of the element modes must be specified.");if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&d==CKEDITOR.ELEMENT_MODE_INLINE)throw Error("Inline element mode is not supported on IE quirks.");
|
|
262
262
|
if(!h(b,d))throw Error('The specified element mode is not supported on element: "'+b.getName()+'".');this.element=b;this.elementMode=d;this.name=this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO&&(b.getId()||b.getNameAtt())}else this.elementMode=CKEDITOR.ELEMENT_MODE_NONE;this._={};this.commands={};this.templates={};this.name=this.name||l();this.id=CKEDITOR.tools.getNextId();this.status="unloaded";this.config=CKEDITOR.tools.prototypedCopy(CKEDITOR.config);this.ui=new CKEDITOR.ui(this);this.focusManager=
|
|
263
263
|
new CKEDITOR.focusManager(this);this.keystrokeHandler=new CKEDITOR.keystrokeHandler(this);this.on("readOnly",f);this.on("selectionChange",function(a){m(this,a.data.path)});this.on("activeFilterChange",function(){m(this,this.elementPath(),!0)});this.on("mode",f);CKEDITOR.dom.selection.setupEditorOptimization(this);this.on("instanceReady",function(){if(this.config.startupFocus){if("end"===this.config.startupFocus){var a=this.createRange();a.selectNodeContents(this.editable());a.shrink(CKEDITOR.SHRINK_ELEMENT,
|
|
264
|
-
!0);a.collapse();this.getSelection().selectRanges([a])}this.focus()}});CKEDITOR.fire("instanceCreated",null,this);CKEDITOR.add(this);CKEDITOR.tools.setTimeout(function(){this.isDestroyed()||this.isDetached()||
|
|
265
|
-
b;for(b in a)e(this,a[b])}function e(a,b){b[b.startDisabled?"disable":a.readOnly&&!b.readOnly?"disable":b.modes[a.mode]?"enable":"disable"]()}function m(a,b,d){if(b){var c,f,e=a.commands;for(f in e)c=e[f],(d||c.contextSensitive)&&c.refresh(a,b)}}function
|
|
266
|
-
CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){};
|
|
264
|
+
!0);a.collapse();this.getSelection().selectRanges([a])}this.focus()}});CKEDITOR.fire("instanceCreated",null,this);CKEDITOR.add(this);CKEDITOR.tools.setTimeout(function(){this.isDestroyed()||this.isDetached()||g(this,a)},0,this)}function l(){do var a="editor"+ ++y;while(CKEDITOR.instances[a]);return a}function h(a,b){return b==CKEDITOR.ELEMENT_MODE_INLINE?a.is(CKEDITOR.dtd.$editable)||a.is("textarea"):b==CKEDITOR.ELEMENT_MODE_REPLACE?!a.is(CKEDITOR.dtd.$nonBodyContent):1}function f(){var a=this.commands,
|
|
265
|
+
b;for(b in a)e(this,a[b])}function e(a,b){b[b.startDisabled?"disable":a.readOnly&&!b.readOnly?"disable":b.modes[a.mode]?"enable":"disable"]()}function m(a,b,d){if(b){var c,f,e=a.commands;for(f in e)c=e[f],(d||c.contextSensitive)&&c.refresh(a,b)}}function k(a){var b=a.config.customConfig;if(!b)return!1;var b=CKEDITOR.getUrl(b),d=t[b]||(t[b]={});d.fn?(d.fn.call(a,a.config),CKEDITOR.getUrl(a.config.customConfig)!=b&&k(a)||a.fireOnce("customConfigLoaded")):CKEDITOR.scriptLoader.queue(b,function(){d.fn=
|
|
266
|
+
CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){};k(a)});return!0}function g(a,d){a.on("customConfigLoaded",function(){if(d){if(d.on)for(var c in d.on)a.on(c,d.on[c]);CKEDITOR.tools.extend(a.config,d,!0);delete a.config.on}c=a.config;a.readOnly=c.readOnly?!0:a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.is("textarea")?a.element.hasAttribute("disabled")||a.element.hasAttribute("readonly"):a.element.isReadOnly():a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?a.element.hasAttribute("disabled")||
|
|
267
267
|
a.element.hasAttribute("readonly"):!1;a.blockless=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?!(a.element.is("textarea")||CKEDITOR.dtd[a.element.getName()].p):!1;a.tabIndex=c.tabIndex||a.element&&a.element.getAttribute("tabindex")||0;a.activeEnterMode=a.enterMode=a.blockless?CKEDITOR.ENTER_BR:c.enterMode;a.activeShiftEnterMode=a.shiftEnterMode=a.blockless?CKEDITOR.ENTER_BR:c.shiftEnterMode;c.skin&&(CKEDITOR.skinName=c.skin);a.fireOnce("configLoaded");a.dataProcessor=new CKEDITOR.htmlDataProcessor(a);
|
|
268
|
-
a.filter=a.activeFilter=new CKEDITOR.filter(a);b(a)});d&&null!=d.customConfig&&(a.config.customConfig=d.customConfig);
|
|
268
|
+
a.filter=a.activeFilter=new CKEDITOR.filter(a);b(a)});d&&null!=d.customConfig&&(a.config.customConfig=d.customConfig);k(a)||a.fireOnce("customConfigLoaded")}function b(a){CKEDITOR.skin.loadPart("editor",function(){c(a)})}function c(a){CKEDITOR.lang.load(a.config.language,a.config.defaultLanguage,function(b,c){var f=a.config.title;a.langCode=b;a.lang=CKEDITOR.tools.prototypedCopy(c);a.title="string"==typeof f||!1===f?f:[a.lang.editor,a.name].join(", ");a.config.contentsLangDirection||(a.config.contentsLangDirection=
|
|
269
269
|
a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.getDirection(1):a.lang.dir);a.fire("langLoaded");d(a)})}function d(a){a.getStylesSet(function(b){a.once("loaded",function(){a.fire("stylesSet",{styles:b})},null,null,1);n(a)})}function n(a){function b(a){if(!a)return"";CKEDITOR.tools.isArray(a)&&(a=a.join(","));return a.replace(/\s/g,"")}var d=a.config,c=b(d.plugins),f=b(d.extraPlugins),e=b(d.removePlugins);if(f)var g=new RegExp("(?:^|,)(?:"+f.replace(/,/g,"|")+")(?\x3d,|$)","g"),c=c.replace(g,
|
|
270
|
-
""),c=c+(","+f);if(e)var k=new RegExp("(?:^|,)(?:"+e.replace(/,/g,"|")+")(?\x3d,|$)","g"),c=c.replace(k,"");CKEDITOR.env.air&&(c+=",adobeair");CKEDITOR.plugins.load(c.split(","),function(b){var c=[],f=[],e=[];a.plugins=CKEDITOR.tools.extend({},a.plugins,b);for(var g in b){var h=b[g],m=h.lang,
|
|
271
|
-
(m=m.split(",")),0<=CKEDITOR.tools.indexOf(m,a.langCode)?
|
|
272
|
-
c[g];0===e&&f[g]&&k.lang&&k.langEntries&&(a.lang[k.name]=k.langEntries[f[g]]);if(k[b[e]])k[b[e]](a)}a.fireOnce("pluginsLoaded");d.keystrokes&&a.setKeystroke(a.config.keystrokes);for(g=0;g<a.config.blockedKeystrokes.length;g++)a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[g]]=1;a.status="loaded";a.fireOnce("loaded");CKEDITOR.fire("instanceLoaded",null,a)}})})}function
|
|
273
|
-
(b=CKEDITOR.tools.htmlEncode(b));a.is("textarea")?a.setValue(b):a.setHtml(b);return!0}return!1}function
|
|
274
|
-
e.append(l.getAscendant({thead:1,tbody:1,tfoot:1}).clone()),f.append(e),e=e.findOne("thead, tbody, tfoot")),g&&g.equals(l)||(g=l,k=l.clone(),e.append(k)),k.append(c(m))):f.append(m.cloneContents())}return e?f:b.getHtmlFromRange(a[0])}a.prototype=CKEDITOR.editor.prototype;CKEDITOR.editor=a;var y=0,
|
|
270
|
+
""),c=c+(","+f);if(e)var k=new RegExp("(?:^|,)(?:"+e.replace(/,/g,"|")+")(?\x3d,|$)","g"),c=c.replace(k,"");CKEDITOR.env.air&&(c+=",adobeair");CKEDITOR.plugins.load(c.split(","),function(b){var c=[],f=[],e=[];a.plugins=CKEDITOR.tools.extend({},a.plugins,b);for(var g in b){var h=b[g],m=h.lang,l=null,n=h.requires,z;CKEDITOR.tools.isArray(n)&&(n=n.join(","));if(n&&(z=n.match(k)))for(;n=z.pop();)CKEDITOR.error("editor-plugin-required",{plugin:n.replace(",",""),requiredBy:g});m&&!a.lang[g]&&(m.split&&
|
|
271
|
+
(m=m.split(",")),0<=CKEDITOR.tools.indexOf(m,a.langCode)?l=a.langCode:(l=a.langCode.replace(/-.*/,""),l=l!=a.langCode&&0<=CKEDITOR.tools.indexOf(m,l)?l:0<=CKEDITOR.tools.indexOf(m,"en")?"en":m[0]),h.langEntries&&h.langEntries[l]?(a.lang[g]=h.langEntries[l],l=null):e.push(CKEDITOR.getUrl(h.path+"lang/"+l+".js")));f.push(l);c.push(h)}CKEDITOR.scriptLoader.load(e,function(){if(!a.isDestroyed()&&!a.isDetached()){for(var b=["beforeInit","init","afterInit"],e=0;e<b.length;e++)for(var g=0;g<c.length;g++){var k=
|
|
272
|
+
c[g];0===e&&f[g]&&k.lang&&k.langEntries&&(a.lang[k.name]=k.langEntries[f[g]]);if(k[b[e]])k[b[e]](a)}a.fireOnce("pluginsLoaded");d.keystrokes&&a.setKeystroke(a.config.keystrokes);for(g=0;g<a.config.blockedKeystrokes.length;g++)a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[g]]=1;a.status="loaded";a.fireOnce("loaded");CKEDITOR.fire("instanceLoaded",null,a)}})})}function p(){var a=this.element;if(a&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var b=this.getData();this.config.htmlEncodeOutput&&
|
|
273
|
+
(b=CKEDITOR.tools.htmlEncode(b));a.is("textarea")?a.setValue(b):a.setHtml(b);return!0}return!1}function q(a,b){function d(a){var b=a.startContainer,c=a.endContainer;return b.is&&(b.is("tr")||b.is("td")&&b.equals(c)&&a.endOffset===b.getChildCount())?!0:!1}function c(a){var b=a.startContainer;return b.is("tr")?a.cloneContents():b.clone(!0)}for(var f=new CKEDITOR.dom.documentFragment,e,g,k,h=0;h<a.length;h++){var m=a[h],l=m.startContainer.getAscendant("tr",!0);d(m)?(e||(e=l.getAscendant("table").clone(),
|
|
274
|
+
e.append(l.getAscendant({thead:1,tbody:1,tfoot:1}).clone()),f.append(e),e=e.findOne("thead, tbody, tfoot")),g&&g.equals(l)||(g=l,k=l.clone(),e.append(k)),k.append(c(m))):f.append(m.cloneContents())}return e?f:b.getHtmlFromRange(a[0])}a.prototype=CKEDITOR.editor.prototype;CKEDITOR.editor=a;var y=0,t={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{plugins:{detectConflict:function(a,b){for(var d=0;d<b.length;d++){var c=b[d];if(this[c])return CKEDITOR.warn("editor-plugin-conflict",{plugin:a,replacedWith:c}),
|
|
275
275
|
!0}return!1}},addCommand:function(a,b){b.name=a.toLowerCase();var d=b instanceof CKEDITOR.command?b:new CKEDITOR.command(this,b);this.mode&&e(this,d);return this.commands[a]=d},_attachToForm:function(){function a(b){d.updateElement();d._.required&&!c.getValue()&&!1===d.fire("required")&&b.data.preventDefault()}function b(a){return!!(a&&a.call&&a.apply)}var d=this,c=d.element,f=new CKEDITOR.dom.element(c.$.form);c.is("textarea")&&f&&(f.on("submit",a),b(f.$.submit)&&(f.$.submit=CKEDITOR.tools.override(f.$.submit,
|
|
276
|
-
function(b){return function(){a();b.apply?b.apply(this):b()}})),d.on("destroy",function(){f.removeListener("submit",a)}))},destroy:function(a){var b=CKEDITOR.filter.instances,d=this;this.fire("beforeDestroy");!a&&
|
|
276
|
+
function(b){return function(){a();b.apply?b.apply(this):b()}})),d.on("destroy",function(){f.removeListener("submit",a)}))},destroy:function(a){var b=CKEDITOR.filter.instances,d=this;this.fire("beforeDestroy");!a&&p.call(this);this.editable(null);this.filter&&delete this.filter;CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(b),function(a){a=b[a];d===a.editor&&a.destroy()});delete this.activeFilter;this.status="destroyed";this.fire("destroy");this.removeAllListeners();CKEDITOR.remove(this);
|
|
277
277
|
CKEDITOR.fire("instanceDestroyed",null,this)},elementPath:function(a){if(!a){a=this.getSelection();if(!a)return null;a=a.getStartElement()}return a?new CKEDITOR.dom.elementPath(a,this.editable()):null},createRange:function(){var a=this.editable();return a?new CKEDITOR.dom.range(a):null},execCommand:function(a,b){var d=this.getCommand(a),c={name:a,commandData:b||{},command:d};return d&&d.state!=CKEDITOR.TRISTATE_DISABLED&&!1!==this.fire("beforeCommandExec",c)&&(c.returnValue=d.exec(c.commandData),
|
|
278
278
|
!d.async&&!1!==this.fire("afterCommandExec",c))?c.returnValue:!1},getCommand:function(a){return this.commands[a]},getData:function(a){!a&&this.fire("beforeGetData");var b=this._.data;"string"!=typeof b&&(b=(b=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?b.is("textarea")?b.getValue():b.getHtml():"");b={dataValue:b};!a&&this.fire("getData",b);return b.dataValue},getSnapshot:function(){var a=this.fire("getSnapshot");"string"!=typeof a&&(a=(a=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?
|
|
279
279
|
a.is("textarea")?a.getValue():a.getHtml():"");return a},loadSnapshot:function(a){this.fire("loadSnapshot",a)},setData:function(a,b,d){var c=!0,f=b;b&&"object"==typeof b&&(d=b.internal,f=b.callback,c=!b.noSnapshot);!d&&c&&this.fire("saveSnapshot");if(f||!d)this.once("dataReady",function(a){!d&&c&&this.fire("saveSnapshot");f&&f.call(a.editor)});a={dataValue:a};!d&&this.fire("setData",a);this._.data=a.dataValue;!d&&this.fire("afterSetData",a)},setReadOnly:function(a){a=null==a||a;this.readOnly!=a&&(this.readOnly=
|
|
280
|
-
a,this.keystrokeHandler.blockedKeystrokes[8]=+a,this.editable().setReadOnly(a),this.fire("readOnly"))},insertHtml:function(a,b,d){this.fire("insertHtml",{dataValue:a,mode:b,range:d})},insertText:function(a){this.fire("insertText",a)},insertElement:function(a){this.fire("insertElement",a)},getSelectedHtml:function(a){var b=this.editable(),d=this.getSelection(),d=d&&d.getRanges();if(!b||!d||0===d.length)return null;b=
|
|
281
|
-
c=this.getSelection().getRanges(),f=new CKEDITOR.dom.documentFragment,e;if(!d||0===c.length)return null;for(e=0;e<c.length;e++)f.append(d.extractHtmlFromRange(c[e],b));b||this.getSelection().selectRanges([c[0]]);return a?f.getHtml():f},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return"ready"==this.status&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return
|
|
280
|
+
a,this.keystrokeHandler.blockedKeystrokes[8]=+a,this.editable().setReadOnly(a),this.fire("readOnly"))},insertHtml:function(a,b,d){this.fire("insertHtml",{dataValue:a,mode:b,range:d})},insertText:function(a){this.fire("insertText",a)},insertElement:function(a){this.fire("insertElement",a)},getSelectedHtml:function(a){var b=this.editable(),d=this.getSelection(),d=d&&d.getRanges();if(!b||!d||0===d.length)return null;b=q(d,b);return a?b.getHtml():b},extractSelectedHtml:function(a,b){var d=this.editable(),
|
|
281
|
+
c=this.getSelection().getRanges(),f=new CKEDITOR.dom.documentFragment,e;if(!d||0===c.length)return null;for(e=0;e<c.length;e++)f.append(d.extractHtmlFromRange(c[e],b));b||this.getSelection().selectRanges([c[0]]);return a?f.getHtml():f},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return"ready"==this.status&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return p.call(this)},setKeystroke:function(){for(var a=
|
|
282
282
|
this.keystrokeHandler.keystrokes,b=CKEDITOR.tools.isArray(arguments[0])?arguments[0]:[[].slice.call(arguments,0)],d,c,f=b.length;f--;)d=b[f],c=0,CKEDITOR.tools.isArray(d)&&(c=d[1],d=d[0]),c?a[d]=c:delete a[d]},getCommandKeystroke:function(a,b){var d="string"===typeof a?this.getCommand(a):a,c=[];if(d){var f=CKEDITOR.tools.object.findKey(this.commands,d),e=this.keystrokeHandler.keystrokes;if(d.fakeKeystroke)c.push(d.fakeKeystroke);else for(var g in e)e[g]===f&&c.push(g)}return b?c:c[0]||null},addFeature:function(a){return this.filter.addFeature(a)},
|
|
283
283
|
setActiveFilter:function(a){a||(a=this.filter);this.activeFilter!==a&&(this.activeFilter=a,this.fire("activeFilterChange"),a===this.filter?this.setActiveEnterMode(null,null):this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode),a.getAllowedEnterMode(this.shiftEnterMode,!0)))},setActiveEnterMode:function(a,b){a=a?this.blockless?CKEDITOR.ENTER_BR:a:this.enterMode;b=b?this.blockless?CKEDITOR.ENTER_BR:b:this.shiftEnterMode;if(this.activeEnterMode!=a||this.activeShiftEnterMode!=b)this.activeEnterMode=
|
|
284
284
|
a,this.activeShiftEnterMode=b,this.fire("activeEnterModeChange")},showNotification:function(a){alert(a)},isDetached:function(){return!!this.container&&this.container.isDetached()},isDestroyed:function(){return"destroyed"===this.status}});CKEDITOR.editor._getEditorElement=function(a){if(!CKEDITOR.env.isCompatible)return null;var b=CKEDITOR.dom.element.get(a);return b?b.getEditor()?(CKEDITOR.error("editor-element-conflict",{editorName:b.getEditor().name}),null):b:(CKEDITOR.error("editor-incorrect-element",
|
|
285
285
|
{element:a}),null)}})();CKEDITOR.ELEMENT_MODE_NONE=0;CKEDITOR.ELEMENT_MODE_REPLACE=1;CKEDITOR.ELEMENT_MODE_APPENDTO=2;CKEDITOR.ELEMENT_MODE_INLINE=3;CKEDITOR.htmlParser=function(){this._={htmlPartsRegex:/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}};(function(){var a=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,l={checked:1,compact:1,declare:1,defer:1,disabled:1,
|
|
286
|
-
ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(h){for(var f,e,m=0,
|
|
287
|
-
continue}if(
|
|
286
|
+
ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(h){for(var f,e,m=0,k;f=this._.htmlPartsRegex.exec(h);){e=f.index;if(e>m)if(m=h.substring(m,e),k)k.push(m);else this.onText(m);m=this._.htmlPartsRegex.lastIndex;if(e=f[1])if(e=e.toLowerCase(),k&&CKEDITOR.dtd.$cdata[e]&&(this.onCDATA(k.join("")),k=null),!k){this.onTagClose(e);
|
|
287
|
+
continue}if(k)k.push(f[0]);else if(e=f[3]){if(e=e.toLowerCase(),!/="/.test(e)){var g={},b,c=f[4];f=!!f[5];if(c)for(;b=a.exec(c);){var d=b[1].toLowerCase();b=b[2]||b[3]||b[4]||"";g[d]=!b&&l[d]?d:CKEDITOR.tools.htmlDecodeAttr(b)}this.onTagOpen(e,g,f);!k&&CKEDITOR.dtd.$cdata[e]&&(k=[])}}else if(e=f[2])this.onComment(e)}if(h.length>m)this.onText(h.substring(m,h.length))}}})();CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(a){this._.output.push("\x3c",
|
|
288
288
|
a)},openTagClose:function(a,l){l?this._.output.push(" /\x3e"):this._.output.push("\x3e")},attribute:function(a,l){"string"==typeof l&&(l=CKEDITOR.tools.htmlEncodeAttr(l));this._.output.push(" ",a,'\x3d"',l,'"')},closeTag:function(a){this._.output.push("\x3c/",a,"\x3e")},text:function(a){this._.output.push(a)},comment:function(a){this._.output.push("\x3c!--",a,"--\x3e")},write:function(a){this._.output.push(a)},reset:function(){this._.output=[];this._.indent=!1},getHtml:function(a){var l=this._.output.join("");
|
|
289
289
|
a&&this.reset();return l}}});"use strict";(function(){CKEDITOR.htmlParser.node=function(){};CKEDITOR.htmlParser.node.prototype={remove:function(){var a=this.parent.children,l=CKEDITOR.tools.indexOf(a,this),h=this.previous,f=this.next;h&&(h.next=f);f&&(f.previous=h);a.splice(l,1);this.parent=null},replaceWith:function(a){var l=this.parent.children,h=CKEDITOR.tools.indexOf(l,this),f=a.previous=this.previous,e=a.next=this.next;f&&(f.next=a);e&&(e.previous=a);l[h]=a;a.parent=this.parent;this.parent=null},
|
|
290
290
|
insertAfter:function(a){var l=a.parent.children,h=CKEDITOR.tools.indexOf(l,a),f=a.next;l.splice(h+1,0,this);this.next=a.next;this.previous=a;a.next=this;f&&(f.previous=this);this.parent=a.parent},insertBefore:function(a){var l=a.parent.children,h=CKEDITOR.tools.indexOf(l,a);l.splice(h,0,this);this.next=a;(this.previous=a.previous)&&(a.previous.next=this);a.previous=this;this.parent=a.parent},getAscendant:function(a){var l="function"==typeof a?a:"string"==typeof a?function(f){return f.name==a}:function(f){return f.name in
|
|
291
291
|
a},h=this.parent;for(;h&&h.type==CKEDITOR.NODE_ELEMENT;){if(l(h))return h;h=h.parent}return null},wrapWith:function(a){this.replaceWith(a);a.add(this);return a},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(a){return a||{}}}})();"use strict";CKEDITOR.htmlParser.comment=function(a){this.value=a;this._={isBlockLike:!1}};CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(a,
|
|
292
292
|
l){var h=this.value;if(!(h=a.onComment(l,h,this)))return this.remove(),!1;if("string"!=typeof h)return this.replaceWith(h),!1;this.value=h;return!0},writeHtml:function(a,l){l&&this.filter(l);a.comment(this.value)}});"use strict";(function(){CKEDITOR.htmlParser.text=function(a){this.value=a;this._={isBlockLike:!1}};CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(a,l){if(!(this.value=a.onText(l,this.value,this)))return this.remove(),
|
|
293
293
|
!1},writeHtml:function(a,l){l&&this.filter(l);a.text(this.value)}})})();"use strict";(function(){CKEDITOR.htmlParser.cdata=function(a){this.value=a};CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(a){a.write(this.value)}})})();"use strict";CKEDITOR.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:!0,hasInlineStarted:!1}};(function(){function a(a){return a.attributes["data-cke-survive"]?
|
|
294
|
-
!1:"a"==a.name&&a.attributes.href||CKEDITOR.dtd.$removeEmpty[a.name]}var l=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),h={ol:1,ul:1},f=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),e={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=function(m,g
|
|
295
|
-
|
|
296
|
-
(
|
|
297
|
-
a in CKEDITOR.dtd.$tableContent?a==b||"dt"==a&&"dd"==b||"dd"==a&&"dt"==b:!1}var y=new CKEDITOR.htmlParser,
|
|
298
|
-
return}"textarea"==d&&(
|
|
299
|
-
|
|
300
|
-
function(a){if(!(
|
|
301
|
-
y.parse(m);for(c();
|
|
294
|
+
!1:"a"==a.name&&a.attributes.href||CKEDITOR.dtd.$removeEmpty[a.name]}var l=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),h={ol:1,ul:1},f=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),e={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=function(m,k,g){function b(a){var b;if(0<w.length)for(var d=0;d<w.length;d++){var f=
|
|
295
|
+
w[d],e=f.name,g=CKEDITOR.dtd[e],k=r.name&&CKEDITOR.dtd[r.name];k&&!k[e]||a&&g&&!g[a]&&CKEDITOR.dtd[a]?e==r.name&&(n(r,r.parent,1),d--):(b||(c(),b=1),f=f.clone(),f.parent=r,r=f,w.splice(d,1),d--)}}function c(){for(;x.length;)n(x.shift(),r)}function d(a){if(a._.isBlockLike&&"pre"!=a.name&&"textarea"!=a.name){var b=a.children.length,d=a.children[b-1],c;d&&d.type==CKEDITOR.NODE_TEXT&&((c=CKEDITOR.tools.rtrim(d.value))?d.value=c:a.children.length=b-1)}}function n(b,c,f){c=c||r||t;var e=r;void 0===b.previous&&
|
|
296
|
+
(p(c,b)&&(r=c,y.onTagOpen(g,{}),b.returnPoint=c=r),d(b),a(b)&&!b.children.length||c.add(b),"pre"==b.name&&(u=!1),"textarea"==b.name&&(A=!1));b.returnPoint?(r=b.returnPoint,delete b.returnPoint):r=f?c:e}function p(a,b){if((a==t||"body"==a.name)&&g&&(!a.name||CKEDITOR.dtd[a.name][g])){var d,c;return(d=b.attributes&&(c=b.attributes["data-cke-real-element-type"])?c:b.name)&&d in CKEDITOR.dtd.$inline&&!(d in CKEDITOR.dtd.head)&&!b.isOrphan||b.type==CKEDITOR.NODE_TEXT}}function q(a,b){return a in CKEDITOR.dtd.$listItem||
|
|
297
|
+
a in CKEDITOR.dtd.$tableContent?a==b||"dt"==a&&"dd"==b||"dd"==a&&"dt"==b:!1}var y=new CKEDITOR.htmlParser,t=k instanceof CKEDITOR.htmlParser.element?k:"string"==typeof k?new CKEDITOR.htmlParser.element(k):new CKEDITOR.htmlParser.fragment,w=[],x=[],r=t,A="textarea"==t.name,u="pre"==t.name;y.onTagOpen=function(d,e,g,k){e=new CKEDITOR.htmlParser.element(d,e);e.isUnknown&&g&&(e.isEmpty=!0);e.isOptionalClose=k;if(a(e))w.push(e);else{if("pre"==d)u=!0;else{if("br"==d&&u){r.add(new CKEDITOR.htmlParser.text("\n"));
|
|
298
|
+
return}"textarea"==d&&(A=!0)}if("br"==d)x.push(e);else{for(;!(k=(g=r.name)?CKEDITOR.dtd[g]||(r._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):f,e.isUnknown||r.isUnknown||k[d]);)if(r.isOptionalClose)y.onTagClose(g);else if(d in h&&g in h)g=r.children,(g=g[g.length-1])&&"li"==g.name||n(g=new CKEDITOR.htmlParser.element("li"),r),!e.returnPoint&&(e.returnPoint=r),r=g;else if(d in CKEDITOR.dtd.$listItem&&!q(d,g))y.onTagOpen("li"==d?"ul":"dl",{},0,1);else if(g in l&&!q(d,g))!e.returnPoint&&(e.returnPoint=
|
|
299
|
+
r),r=r.parent;else if(g in CKEDITOR.dtd.$inline&&w.unshift(r),r.parent)n(r,r.parent,1);else{e.isOrphan=1;break}b(d);c();e.parent=r;e.isEmpty?n(e):r=e}}};y.onTagClose=function(a){for(var b=w.length-1;0<=b;b--)if(a==w[b].name){w.splice(b,1);return}for(var d=[],f=[],e=r;e!=t&&e.name!=a;)e._.isBlockLike||f.unshift(e),d.push(e),e=e.returnPoint||e.parent;if(e!=t){for(b=0;b<d.length;b++){var k=d[b];n(k,k.parent)}r=e;e._.isBlockLike&&c();n(e,e.parent);e==r&&(r=r.parent);w=w.concat(f)}"body"==a&&(g=!1)};y.onText=
|
|
300
|
+
function(a){if(!(r._.hasInlineStarted&&!x.length||u||A)&&(a=CKEDITOR.tools.ltrim(a),0===a.length))return;var d=r.name,k=d?CKEDITOR.dtd[d]||(r._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):f;if(!A&&!k["#"]&&d in l)y.onTagOpen(e[d]||""),y.onText(a);else{c();b();u||A||(a=a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," "));a=new CKEDITOR.htmlParser.text(a);if(p(r,a))this.onTagOpen(g,{},0,1);r.add(a)}};y.onCDATA=function(a){r.add(new CKEDITOR.htmlParser.cdata(a))};y.onComment=function(a){c();b();r.add(new CKEDITOR.htmlParser.comment(a))};
|
|
301
|
+
y.parse(m);for(c();r!=t;)n(r,r.parent,1);d(t);return t};CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(a,f){isNaN(f)&&(f=this.children.length);var e=0<f?this.children[f-1]:null;if(e){if(a._.isBlockLike&&e.type==CKEDITOR.NODE_TEXT&&(e.value=CKEDITOR.tools.rtrim(e.value),0===e.value.length)){this.children.pop();this.add(a);return}e.next=a}a.previous=e;a.parent=this;this.children.splice(f,0,a);this._.hasInlineStarted||(this._.hasInlineStarted=a.type==CKEDITOR.NODE_TEXT||
|
|
302
302
|
a.type==CKEDITOR.NODE_ELEMENT&&!a._.isBlockLike)},filter:function(a,f){f=this.getFilterContext(f);a.onRoot(f,this);this.filterChildren(a,!1,f)},filterChildren:function(a,f,e){if(this.childrenFilteredBy!=a.id){e=this.getFilterContext(e);if(f&&!this.parent)a.onRoot(e,this);this.childrenFilteredBy=a.id;for(f=0;f<this.children.length;f++)!1===this.children[f].filter(a,e)&&f--}},writeHtml:function(a,f){f&&this.filter(f);this.writeChildrenHtml(a)},writeChildrenHtml:function(a,f,e){var b=this.getFilterContext();
|
|
303
|
-
if(e&&!this.parent&&f)f.onRoot(b,this);f&&this.filterChildren(f,!1,b);f=0;e=this.children;for(b=e.length;f<b;f++)e[f].writeHtml(a)},forEach:function(a,f,e){if(!(e||f&&this.type!=f))var b=a(this);if(!1!==b){e=this.children;for(var c=0;c<e.length;c++)b=e[c],b.type==CKEDITOR.NODE_ELEMENT?b.forEach(a,f):f&&b.type!=f||a(b)}},getFilterContext:function(a){return a||{}}}})();"use strict";(function(){function a(){this.rules=[]}function l(h,f,e,m){var g
|
|
303
|
+
if(e&&!this.parent&&f)f.onRoot(b,this);f&&this.filterChildren(f,!1,b);f=0;e=this.children;for(b=e.length;f<b;f++)e[f].writeHtml(a)},forEach:function(a,f,e){if(!(e||f&&this.type!=f))var b=a(this);if(!1!==b){e=this.children;for(var c=0;c<e.length;c++)b=e[c],b.type==CKEDITOR.NODE_ELEMENT?b.forEach(a,f):f&&b.type!=f||a(b)}},getFilterContext:function(a){return a||{}}}})();"use strict";(function(){function a(){this.rules=[]}function l(h,f,e,m){var k,g;for(k in f)(g=h[k])||(g=h[k]=new a),g.add(f[k],e,m)}
|
|
304
304
|
CKEDITOR.htmlParser.filter=CKEDITOR.tools.createClass({$:function(h){this.id=CKEDITOR.tools.getNextNumber();this.elementNameRules=new a;this.attributeNameRules=new a;this.elementsRules={};this.attributesRules={};this.textRules=new a;this.commentRules=new a;this.rootRules=new a;h&&this.addRules(h,10)},proto:{addRules:function(a,f){var e;"number"==typeof f?e=f:f&&"priority"in f&&(e=f.priority);"number"!=typeof e&&(e=10);"object"!=typeof f&&(f={});a.elementNames&&this.elementNameRules.addMany(a.elementNames,
|
|
305
305
|
e,f);a.attributeNames&&this.attributeNameRules.addMany(a.attributeNames,e,f);a.elements&&l(this.elementsRules,a.elements,e,f);a.attributes&&l(this.attributesRules,a.attributes,e,f);a.text&&this.textRules.add(a.text,e,f);a.comment&&this.commentRules.add(a.comment,e,f);a.root&&this.rootRules.add(a.root,e,f)},applyTo:function(a){a.filter(this)},onElementName:function(a,f){return this.elementNameRules.execOnName(a,f)},onAttributeName:function(a,f){return this.attributeNameRules.execOnName(a,f)},onText:function(a,
|
|
306
|
-
f,e){return this.textRules.exec(a,f,e)},onComment:function(a,f,e){return this.commentRules.exec(a,f,e)},onRoot:function(a,f){return this.rootRules.exec(a,f)},onElement:function(a,f){for(var e=[this.elementsRules["^"],this.elementsRules[f.name],this.elementsRules.$],m,
|
|
307
|
-
new CKEDITOR.htmlParser.text(this.onText(a,f.value,f)):e==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,f.value,f)):null},onAttribute:function(a,f,e,m){return(e=this.attributesRules[e])?e.exec(a,m,f,this):m}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,f,e){this.rules.splice(this.findIndex(f),0,{value:a,priority:f,options:e})},addMany:function(a,f,e){for(var m=[this.findIndex(f),0],
|
|
308
|
-
m)},findIndex:function(a){for(var f=this.rules,e=f.length-1;0<=e&&a<f[e].priority;)e--;return e+1},exec:function(a,f){var e=f instanceof CKEDITOR.htmlParser.node||f instanceof CKEDITOR.htmlParser.fragment,m=Array.prototype.slice.call(arguments,1),
|
|
309
|
-
(m[0]=f=d)}return f},execOnName:function(a,f){for(var e=0,m=this.rules,
|
|
310
|
-
[],
|
|
311
|
-
CKEDITOR.env.needsBrFiller)&&a.type==CKEDITOR.NODE_ELEMENT&&"br"==a.name&&!a.attributes["data-cke-eol"])return!0;var d;return a.type==CKEDITOR.NODE_TEXT&&(d=a.value.match(
|
|
312
|
-
c(
|
|
313
|
-
e(a);)a=a.previous;return a}function f(a){for(a=a.previous;a&&e(a);)a=a.previous;return a}function e(a){return a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(a.value)||a.type==CKEDITOR.NODE_ELEMENT&&a.attributes["data-cke-bookmark"]}function m(a){return a&&(a.type==CKEDITOR.NODE_ELEMENT&&a.name in
|
|
314
|
-
(a["data-cke-editable"]=a.contenteditable?"true":1);a.contenteditable="false"}function b(a){a=a.attributes;switch(a["data-cke-editable"]){case "true":a.contenteditable="true";break;case "1":delete a.contenteditable}}function c(a){return a.replace(G,function(a,b,d){return"\x3c"+b+d.replace(M,function(a,b){return
|
|
315
|
-
(a=b+
|
|
316
|
-
function y(a,b){var d=b._.dataStore;return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return d&&d[b]||""})}function
|
|
317
|
-
(d.push(a)-1)+"--\x3e"});for(var g=0;g<c.length;g++)a=a.replace(c[g],function(a){a=a.replace(e,function(a,b,c){return d[c]});return/cke_temp(comment)?/.test(a)?a:"\x3c!--{cke_temp}"+(d.push(a)-1)+"--\x3e"});a=a.replace(e,function(a,b,c){return"\x3c!--"+
|
|
318
|
-
b){f[f.id]=decodeURIComponent(b);return"{cke_protected_"+f.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,d,c,f){return"\x3c"+d+c+"\x3e"+y(
|
|
319
|
-
{applyToAll:!0});e.addRules(C);e.addRules(
|
|
320
|
-
f="\x3cpre\x3e"+f+"\x3c/pre\x3e",g=1);e=b.document.createElement(e);e.setHtml("a"+f);f=e.getHtml().substr(1);f=f.replace(new RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");g&&(f=f.replace(/^<pre>|<\/pre>$/gi,""));f=f.replace(F,"$1$2");f=n(f);f=
|
|
321
|
-
function(a){a.data.filter.applyTo(a.data.dataValue,!0,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(g.dataFilter,!0)},null,null,10);b.on("toHtml",function(a){a=a.data;var b=a.dataValue,d=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(d);b=d.getHtml(!0);a.dataValue=
|
|
322
|
-
a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(d,a.data.context,l(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(g.htmlFilter,!0)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,!1,!0)},null,null,11);b.on("toDataFormat",function(a){var d=a.data.dataValue,c=g.writer;c.reset();d.writeChildrenHtml(c);d=c.getHtml(!0);d=
|
|
306
|
+
f,e){return this.textRules.exec(a,f,e)},onComment:function(a,f,e){return this.commentRules.exec(a,f,e)},onRoot:function(a,f){return this.rootRules.exec(a,f)},onElement:function(a,f){for(var e=[this.elementsRules["^"],this.elementsRules[f.name],this.elementsRules.$],m,k=0;3>k;k++)if(m=e[k]){m=m.exec(a,f,this);if(!1===m)return null;if(m&&m!=f)return this.onNode(a,m);if(f.parent&&!f.name)break}return f},onNode:function(a,f){var e=f.type;return e==CKEDITOR.NODE_ELEMENT?this.onElement(a,f):e==CKEDITOR.NODE_TEXT?
|
|
307
|
+
new CKEDITOR.htmlParser.text(this.onText(a,f.value,f)):e==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,f.value,f)):null},onAttribute:function(a,f,e,m){return(e=this.attributesRules[e])?e.exec(a,m,f,this):m}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,f,e){this.rules.splice(this.findIndex(f),0,{value:a,priority:f,options:e})},addMany:function(a,f,e){for(var m=[this.findIndex(f),0],k=0,g=a.length;k<g;k++)m.push({value:a[k],priority:f,options:e});this.rules.splice.apply(this.rules,
|
|
308
|
+
m)},findIndex:function(a){for(var f=this.rules,e=f.length-1;0<=e&&a<f[e].priority;)e--;return e+1},exec:function(a,f){var e=f instanceof CKEDITOR.htmlParser.node||f instanceof CKEDITOR.htmlParser.fragment,m=Array.prototype.slice.call(arguments,1),k=this.rules,g=k.length,b,c,d,l;for(l=0;l<g;l++)if(e&&(b=f.type,c=f.name),d=k[l],!(a.nonEditable&&!d.options.applyToAll||a.nestedEditable&&d.options.excludeNestedEditable)){d=d.value.apply(null,m);if(!1===d||e&&d&&(d.name!=c||d.type!=b))return d;null!=d&&
|
|
309
|
+
(m[0]=f=d)}return f},execOnName:function(a,f){for(var e=0,m=this.rules,k=m.length,g;f&&e<k;e++)g=m[e],a.nonEditable&&!g.options.applyToAll||a.nestedEditable&&g.options.excludeNestedEditable||(f=f.replace(g.value[0],g.value[1]));return f}}})();(function(){function a(a,b){function d(a){return a||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text(" "):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function c(a,b){return function(c){if(c.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var e=
|
|
310
|
+
[],k=h(c),l,F;if(k)for(g(k,1)&&e.push(k);k;)m(k)&&(l=f(k))&&g(l)&&((F=f(l))&&!m(F)?e.push(l):(d(n).insertAfter(l),l.remove())),k=k.previous;for(k=0;k<e.length;k++)e[k].remove();if(e=!a||!1!==("function"==typeof b?b(c):b))n||CKEDITOR.env.needsBrFiller||c.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT?n||CKEDITOR.env.needsBrFiller||!(7<document.documentMode||c.name in CKEDITOR.dtd.tr||c.name in CKEDITOR.dtd.$listItem)?(e=h(c),e=!e||"form"==c.name&&"input"==e.name):e=!1:e=!1;e&&c.add(d(a))}}}function g(a,b){if((!n||
|
|
311
|
+
CKEDITOR.env.needsBrFiller)&&a.type==CKEDITOR.NODE_ELEMENT&&"br"==a.name&&!a.attributes["data-cke-eol"])return!0;var d;return a.type==CKEDITOR.NODE_TEXT&&(d=a.value.match(x))&&(d.index&&((new CKEDITOR.htmlParser.text(a.value.substring(0,d.index))).insertBefore(a),a.value=d[0]),!CKEDITOR.env.needsBrFiller&&n&&(!b||a.parent.name in F)||!n&&((d=a.previous)&&"br"==d.name||!d||m(d)))?!0:!1}var l={elements:{}},n="html"==b,F=CKEDITOR.tools.extend({},z),v;for(v in F)"#"in A[v]||delete F[v];for(v in F)l.elements[v]=
|
|
312
|
+
c(n,a.config.fillEmptyBlocks);l.root=c(n,!1);l.elements.br=function(a){return function(b){if(b.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var c=b.attributes;if("data-cke-bogus"in c||"data-cke-eol"in c)delete c["data-cke-bogus"];else{for(c=b.next;c&&e(c);)c=c.next;var g=f(b);!c&&m(b.parent)?k(b.parent,d(a)):m(c)&&g&&!m(g)&&d(a).insertBefore(c)}}}}(n);return l}function l(a,b){return a!=CKEDITOR.ENTER_BR&&!1!==b?a==CKEDITOR.ENTER_DIV?"div":"p":!1}function h(a){for(a=a.children[a.children.length-1];a&&
|
|
313
|
+
e(a);)a=a.previous;return a}function f(a){for(a=a.previous;a&&e(a);)a=a.previous;return a}function e(a){return a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(a.value)||a.type==CKEDITOR.NODE_ELEMENT&&a.attributes["data-cke-bookmark"]}function m(a){return a&&(a.type==CKEDITOR.NODE_ELEMENT&&a.name in z||a.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function k(a,b){var d=a.children[a.children.length-1];a.children.push(b);b.parent=a;d&&(d.next=b,b.previous=d)}function g(a){a=a.attributes;"false"!=a.contenteditable&&
|
|
314
|
+
(a["data-cke-editable"]=a.contenteditable?"true":1);a.contenteditable="false"}function b(a){a=a.attributes;switch(a["data-cke-editable"]){case "true":a.contenteditable="true";break;case "1":delete a.contenteditable}}function c(a){return a.replace(G,function(a,b,d){return"\x3c"+b+d.replace(M,function(a,b){return J.test(b)&&-1==d.indexOf("data-cke-saved-"+b)?" data-cke-saved-"+a+" data-cke-"+CKEDITOR.rnd+"-"+a:a})+"\x3e"})}function d(a,b){return a.replace(b,function(a,b,d){0===a.indexOf("\x3ctextarea")&&
|
|
315
|
+
(a=b+q(d).replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;")+"\x3c/textarea\x3e");return"\x3ccke:encoded\x3e"+encodeURIComponent(a)+"\x3c/cke:encoded\x3e"})}function n(a){return a.replace(H,function(a,b){return decodeURIComponent(b)})}function p(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g,function(a){return"\x3c!--"+r+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function q(a){return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)})}
|
|
316
|
+
function y(a,b){var d=b._.dataStore;return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return d&&d[b]||""})}function t(a,b){var d=[],c=b.config.protectedSource,f=b._.dataStore||(b._.dataStore={id:1}),e=/<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,c=[/<script[\s\S]*?(<\/script>|$)/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(c);a=a.replace(/\x3c!--[\s\S]*?--\x3e/g,function(a){return"\x3c!--{cke_tempcomment}"+
|
|
317
|
+
(d.push(a)-1)+"--\x3e"});for(var g=0;g<c.length;g++)a=a.replace(c[g],function(a){a=a.replace(e,function(a,b,c){return d[c]});return/cke_temp(comment)?/.test(a)?a:"\x3c!--{cke_temp}"+(d.push(a)-1)+"--\x3e"});a=a.replace(e,function(a,b,c){return"\x3c!--"+r+(b?"{C}":"")+encodeURIComponent(d[c]).replace(/--/g,"%2D%2D")+"--\x3e"});a=a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g,function(a){return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g,function(a,
|
|
318
|
+
b){f[f.id]=decodeURIComponent(b);return"{cke_protected_"+f.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,d,c,f){return"\x3c"+d+c+"\x3e"+y(q(f),b)+"\x3c/"+d+"\x3e"})}var w;CKEDITOR.htmlDataProcessor=function(b){var f,e,g=this;this.editor=b;this.dataFilter=f=new CKEDITOR.htmlParser.filter;this.htmlFilter=e=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;f.addRules(v);f.addRules(D,{applyToAll:!0});f.addRules(a(b,"data"),
|
|
319
|
+
{applyToAll:!0});e.addRules(C);e.addRules(B,{applyToAll:!0});e.addRules(a(b,"html"),{applyToAll:!0});b.on("toHtml",function(a){a=a.data;var f=a.dataValue,e,f=w(f),f=t(f,b),f=d(f,L),f=c(f),f=d(f,E),f=f.replace(K,"$1cke:$2"),f=f.replace(N,"\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),f=f.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2"),f=f.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");e=a.context||b.editable().getName();var g;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&"pre"==e&&(e="div",
|
|
320
|
+
f="\x3cpre\x3e"+f+"\x3c/pre\x3e",g=1);e=b.document.createElement(e);e.setHtml("a"+f);f=e.getHtml().substr(1);f=f.replace(new RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");g&&(f=f.replace(/^<pre>|<\/pre>$/gi,""));f=f.replace(F,"$1$2");f=n(f);f=q(f);e=!1===a.fixForBody?!1:l(a.enterMode,b.config.autoParagraph);f=CKEDITOR.htmlParser.fragment.fromHtml(f,a.context,e);e&&(g=f,!g.children.length&&CKEDITOR.dtd[g.name][e]&&(e=new CKEDITOR.htmlParser.element(e),g.add(e)));a.dataValue=f},null,null,5);b.on("toHtml",
|
|
321
|
+
function(a){a.data.filter.applyTo(a.data.dataValue,!0,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(g.dataFilter,!0)},null,null,10);b.on("toHtml",function(a){a=a.data;var b=a.dataValue,d=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(d);b=d.getHtml(!0);a.dataValue=p(b)},null,null,15);b.on("toDataFormat",function(a){var d=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(d=d.replace(/^<br *\/?>/i,""));
|
|
322
|
+
a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(d,a.data.context,l(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(g.htmlFilter,!0)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,!1,!0)},null,null,11);b.on("toDataFormat",function(a){var d=a.data.dataValue,c=g.writer;c.reset();d.writeChildrenHtml(c);d=c.getHtml(!0);d=q(d);d=y(d,b);a.data.dataValue=d},null,null,15)};CKEDITOR.htmlDataProcessor.prototype=
|
|
323
323
|
{toHtml:function(a,b,d,c){var f=this.editor,e,g,k,h;b&&"object"==typeof b?(e=b.context,d=b.fixForBody,c=b.dontFilter,g=b.filter,k=b.enterMode,h=b.protectedWhitespaces):e=b;e||null===e||(e=f.editable().getName());return f.fire("toHtml",{dataValue:a,context:e,fixForBody:d,dontFilter:c,filter:g||f.filter,enterMode:k||f.enterMode,protectedWhitespaces:h}).dataValue},toDataFormat:function(a,b){var d,c,f;b&&(d=b.context,c=b.filter,f=b.enterMode);d||null===d||(d=this.editor.editable().getName());return this.editor.fire("toDataFormat",
|
|
324
|
-
{dataValue:a,filter:c||this.editor.filter,context:d,enterMode:f||this.editor.enterMode}).dataValue}};var
|
|
325
|
-
"");if(0===b.indexOf("javascript")||0===b.indexOf("data"))a.attributes["data-cke-pa-src"]=a.attributes.src,delete a.attributes.src}}}},C={elements:{embed:function(a){var b=a.parent;if(b&&"object"==b.name){var d=b.attributes.width,b=b.attributes.height;d&&(a.attributes.width=d);b&&(a.attributes.height=b)}},a:function(a){var b=a.attributes;if(!(a.children.length||b.name||b.id||a.attributes["data-cke-saved-name"]))return!1}}},
|
|
326
|
-
""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return!1;for(var d=["name","href","src"],c,f=0;f<d.length;f++)c="data-cke-saved-"+d[f],c in b&&delete b[d[f]]}return a},table:function(a){a.children.slice(0).sort(function(a,b){var d,c;a.type==CKEDITOR.NODE_ELEMENT&&b.type==a.type&&(d=CKEDITOR.tools.indexOf(
|
|
327
|
-
1:-1})},param:function(a){a.children=[];a.isEmpty=!0;return a},span:function(a){"Apple-style-span"==a.attributes["class"]&&delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck;delete a.attributes.contenteditable},style:function(a){var b=a.children[0];b&&b.value&&(b.value=CKEDITOR.tools.trim(b.value));a.attributes.type||(a.attributes.type="text/css")},title:function(a){var b=a.children[0];!b&&
|
|
328
|
-
b.value=a.attributes["data-cke-title"]||""},input:b,textarea:b},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(
|
|
329
|
-
L=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,H=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,
|
|
324
|
+
{dataValue:a,filter:c||this.editor.filter,context:d,enterMode:f||this.editor.enterMode}).dataValue}};var x=/(?: |\xa0)$/,r="{cke_protected}",A=CKEDITOR.dtd,u="caption colgroup col thead tfoot tbody".split(" "),z=CKEDITOR.tools.extend({},A.$blockLimit,A.$block),v={elements:{input:g,textarea:g}},D={attributeNames:[[/^on/,"data-cke-pa-on"],[/^srcdoc/,"data-cke-pa-srcdoc"],[/^data-cke-expando$/,""]],elements:{iframe:function(a){if(a.attributes&&a.attributes.src){var b=a.attributes.src.toLowerCase().replace(/[^a-z]/gi,
|
|
325
|
+
"");if(0===b.indexOf("javascript")||0===b.indexOf("data"))a.attributes["data-cke-pa-src"]=a.attributes.src,delete a.attributes.src}}}},C={elements:{embed:function(a){var b=a.parent;if(b&&"object"==b.name){var d=b.attributes.width,b=b.attributes.height;d&&(a.attributes.width=d);b&&(a.attributes.height=b)}},a:function(a){var b=a.attributes;if(!(a.children.length||b.name||b.id||a.attributes["data-cke-saved-name"]))return!1}}},B={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,
|
|
326
|
+
""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return!1;for(var d=["name","href","src"],c,f=0;f<d.length;f++)c="data-cke-saved-"+d[f],c in b&&delete b[d[f]]}return a},table:function(a){a.children.slice(0).sort(function(a,b){var d,c;a.type==CKEDITOR.NODE_ELEMENT&&b.type==a.type&&(d=CKEDITOR.tools.indexOf(u,a.name),c=CKEDITOR.tools.indexOf(u,b.name));-1<d&&-1<c&&d!=c||(d=a.parent?a.getIndex():-1,c=b.parent?b.getIndex():-1);return d>c?
|
|
327
|
+
1:-1})},param:function(a){a.children=[];a.isEmpty=!0;return a},span:function(a){"Apple-style-span"==a.attributes["class"]&&delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck;delete a.attributes.contenteditable},style:function(a){var b=a.children[0];b&&b.value&&(b.value=CKEDITOR.tools.trim(b.value));a.attributes.type||(a.attributes.type="text/css")},title:function(a){var b=a.children[0];!b&&k(a,b=new CKEDITOR.htmlParser.text);
|
|
328
|
+
b.value=a.attributes["data-cke-title"]||""},input:b,textarea:b},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(B.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})});var G=/<(a|area|img|input|source)\b([^>]*)>/gi,M=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,J=/^(href|src|name)$/i,E=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
|
|
329
|
+
L=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,H=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,K=/(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,F=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,N=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;w=function(){function a(d){return CKEDITOR.tools.array.reduce(d.split(""),function(a,d){var c=d.toLowerCase(),f=d.toUpperCase(),e=b(c);c!==f&&(e+="|"+b(f));return a+("("+e+")")},"")}function b(a){var d;d=a.charCodeAt(0);var c=d.toString(16);
|
|
330
330
|
d={htmlCode:"\x26#"+d+";?",hex:"\x26#x0*"+c+";?",entity:{"\x3c":"\x26lt;","\x3e":"\x26gt;",":":"\x26colon;"}[a]};for(var f in d)d[f]&&(a+="|"+d[f]);return a}var d=new RegExp("("+a("\x3ccke:encoded\x3e")+"(.*?)"+a("\x3c/cke:encoded\x3e")+")|("+a("\x3c")+a("/")+"?"+a("cke:encoded\x3e")+")","gi"),c=new RegExp("(("+a("{cke_protected")+")(_[0-9]*)?"+a("}")+")","gi");return function(a){return a.replace(d,"").replace(c,"")}}()})();"use strict";CKEDITOR.htmlParser.element=function(a,l){this.name=a;this.attributes=
|
|
331
331
|
l||{};this.children=[];var h=a||"",f=h.match(/^cke:(.*)/);f&&(h=f[1]);h=!!(CKEDITOR.dtd.$nonBodyContent[h]||CKEDITOR.dtd.$block[h]||CKEDITOR.dtd.$listItem[h]||CKEDITOR.dtd.$tableContent[h]||CKEDITOR.dtd.$nonEditable[h]||"br"==h);this.isEmpty=!!CKEDITOR.dtd.$empty[a];this.isUnknown=!CKEDITOR.dtd[a];this._={isBlockLike:h,hasInlineStarted:this.isEmpty||!h}};CKEDITOR.htmlParser.cssStyle=function(a){var l={};((a instanceof CKEDITOR.htmlParser.element?a.attributes.style:a)||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
|
|
332
332
|
function(a,f,e){"font-family"==f&&(e=e.replace(/["']/g,""));l[f.toLowerCase()]=e});return{rules:l,populate:function(a){var f=this.toString();f&&(a instanceof CKEDITOR.dom.element?a.setAttribute("style",f):a instanceof CKEDITOR.htmlParser.element?a.attributes.style=f:a.style=f)},toString:function(){var a=[],f;for(f in l)l[f]&&a.push(f,":",l[f],";");return a.join("")}}};(function(){function a(a){return function(e){return e.type==CKEDITOR.NODE_ELEMENT&&("string"==typeof a?e.name==a:e.name in a)}}var l=
|
|
333
|
-
function(a,e){a=a[0];e=e[0];return a<e?-1:a>e?1:0},h=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:h.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a,e){var h=this,g
|
|
334
|
-
!1;if(h!==this)return this.replaceWith(h),!1;if(h.name==
|
|
335
|
-
|
|
333
|
+
function(a,e){a=a[0];e=e[0];return a<e?-1:a>e?1:0},h=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:h.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a,e){var h=this,k,g;e=h.getFilterContext(e);if(!h.parent)a.onRoot(e,h);for(;;){k=h.name;if(!(g=a.onElementName(e,k)))return this.remove(),!1;h.name=g;if(!(h=a.onElement(e,h)))return this.remove(),
|
|
334
|
+
!1;if(h!==this)return this.replaceWith(h),!1;if(h.name==k)break;if(h.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(h),!1;if(!h.name)return this.replaceWithChildren(),!1}k=h.attributes;var b,c;for(b in k){for(g=k[b];;)if(c=a.onAttributeName(e,b))if(c!=b)delete k[b],b=c;else break;else{delete k[b];break}c&&(!1===(g=a.onAttribute(e,h,c,g))?delete k[c]:k[c]=g)}h.isEmpty||this.filterChildren(a,!1,e);return!0},filterChildren:h.filterChildren,writeHtml:function(a,e){e&&this.filter(e);var h=this.name,
|
|
335
|
+
k=[],g=this.attributes,b,c;a.openTag(h,g);for(b in g)k.push([b,g[b]]);a.sortAttributes&&k.sort(l);b=0;for(c=k.length;b<c;b++)g=k[b],a.attribute(g[0],g[1]);a.openTagClose(h,this.isEmpty);this.writeChildrenHtml(a);this.isEmpty||a.closeTag(h)},writeChildrenHtml:h.writeChildrenHtml,replaceWithChildren:function(){for(var a=this.children,e=a.length;e;)a[--e].insertAfter(this);this.remove()},forEach:h.forEach,getFirst:function(f){if(!f)return this.children.length?this.children[0]:null;"function"!=typeof f&&
|
|
336
336
|
(f=a(f));for(var e=0,h=this.children.length;e<h;++e)if(f(this.children[e]))return this.children[e];return null},getHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeChildrenHtml(a);return a.getHtml()},setHtml:function(a){a=this.children=CKEDITOR.htmlParser.fragment.fromHtml(a).children;for(var e=0,h=a.length;e<h;++e)a[e].parent=this},getOuterHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeHtml(a);return a.getHtml()},split:function(a){for(var e=this.children.splice(a,
|
|
337
|
-
this.children.length-a),h=this.clone(),
|
|
338
|
-
function(g){var b="function"===typeof a?a(g):g.name===a;if(b||!e)return b;g.children&&g.findOne&&(h=g.findOne(a,!0));return!!h});return h||
|
|
337
|
+
this.children.length-a),h=this.clone(),k=0;k<e.length;++k)e[k].parent=h;h.children=e;e[0]&&(e[0].previous=null);0<a&&(this.children[a-1].next=null);this.parent.add(h,this.getIndex()+1);return h},find:function(a,e){void 0===e&&(e=!1);var h=[],k;for(k=0;k<this.children.length;k++){var g=this.children[k];"function"==typeof a&&a(g)?h.push(g):"string"==typeof a&&g.name===a&&h.push(g);e&&g.find&&(h=h.concat(g.find(a,e)))}return h},findOne:function(a,e){var h=null,k=CKEDITOR.tools.array.find(this.children,
|
|
338
|
+
function(g){var b="function"===typeof a?a(g):g.name===a;if(b||!e)return b;g.children&&g.findOne&&(h=g.findOne(a,!0));return!!h});return h||k||null},addClass:function(a){if(!this.hasClass(a)){var e=this.attributes["class"]||"";this.attributes["class"]=e+(e?" ":"")+a}},removeClass:function(a){var e=this.attributes["class"];e&&((e=CKEDITOR.tools.trim(e.replace(new RegExp("(?:\\s+|^)"+a+"(?:\\s+|$)")," ")))?this.attributes["class"]=e:delete this.attributes["class"])},hasClass:function(a){var e=this.attributes["class"];
|
|
339
339
|
return e?(new RegExp("(?:^|\\s)"+a+"(?\x3d\\s|$)")).test(e):!1},getFilterContext:function(a){var e=[];a||(a={nonEditable:!1,nestedEditable:!1});a.nonEditable||"false"!=this.attributes.contenteditable?a.nonEditable&&!a.nestedEditable&&"true"==this.attributes.contenteditable&&e.push("nestedEditable",!0):e.push("nonEditable",!0);if(e.length){a=CKEDITOR.tools.copy(a);for(var h=0;h<e.length;h+=2)a[e[h]]=e[h+1]}return a}},!0)})();(function(){var a=/{([^}]+)}/g;CKEDITOR.template=function(a){this.source=
|
|
340
340
|
"function"===typeof a?a:String(a)};CKEDITOR.template.prototype.output=function(l,h){var f=("function"===typeof this.source?this.source(l):this.source).replace(a,function(a,f){return void 0!==l[f]?l[f]:a});return h?h.push(f):f}})();delete CKEDITOR.loadFullCore;CKEDITOR.instances={};CKEDITOR.document=new CKEDITOR.dom.document(document);CKEDITOR.add=function(a){function l(){CKEDITOR.currentInstance==a&&(CKEDITOR.currentInstance=null,CKEDITOR.fire("currentInstance"))}CKEDITOR.instances[a.name]=a;a.on("focus",
|
|
341
341
|
function(){CKEDITOR.currentInstance!=a&&(CKEDITOR.currentInstance=a,CKEDITOR.fire("currentInstance"))});a.on("blur",l);a.on("destroy",l);CKEDITOR.fire("instance",null,a)};CKEDITOR.remove=function(a){delete CKEDITOR.instances[a.name]};(function(){var a={};CKEDITOR.addTemplate=function(l,h){var f=a[l];if(f)return f;f={name:l,source:h};CKEDITOR.fire("template",f);return a[l]=new CKEDITOR.template(f.source)};CKEDITOR.getTemplate=function(l){return a[l]}})();(function(){var a=[];CKEDITOR.addCss=function(l){a.push(l)};
|
|
342
342
|
CKEDITOR.getCss=function(){return a.join("\n")}})();CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")});CKEDITOR.TRISTATE_ON=1;CKEDITOR.TRISTATE_OFF=2;CKEDITOR.TRISTATE_DISABLED=0;(function(){CKEDITOR.inline=function(a,l){a=CKEDITOR.editor._getEditorElement(a);if(!a)return null;var h=new CKEDITOR.editor(l,a,CKEDITOR.ELEMENT_MODE_INLINE),f=a.is("textarea")?a:null;f?(h.setData(f.getValue(),null,!0),a=CKEDITOR.dom.element.createFromHtml('\x3cdiv contenteditable\x3d"'+
|
|
343
343
|
!!h.readOnly+'" class\x3d"cke_textarea_inline"\x3e'+f.getValue()+"\x3c/div\x3e",CKEDITOR.document),a.insertAfter(f),f.hide(),f.$.form&&h._attachToForm()):(l&&"undefined"!==typeof l.readOnly&&!l.readOnly&&a.setAttribute("contenteditable","true"),h.setData(a.getHtml(),null,!0));h.on("loaded",function(){h.fire("uiReady");h.editable(a);h.container=a;h.ui.contentsElement=a;h.setData(h.getData(1));h.resetDirty();h.fire("contentDom");h.mode="wysiwyg";h.fire("mode");h.status="ready";h.fireOnce("instanceReady");
|
|
344
344
|
CKEDITOR.fire("instanceReady",null,h)},null,null,1E4);h.on("destroy",function(){var a=h.container;f&&a&&(a.clearCustomData(),a.remove());f&&f.show();h.element.clearCustomData();delete h.element});return h};CKEDITOR.inlineAll=function(){var a,l,h;for(h in CKEDITOR.dtd.$editable)for(var f=CKEDITOR.document.getElementsByTag(h),e=0,m=f.count();e<m;e++)a=f.getItem(e),"true"==a.getAttribute("contenteditable")&&(l={element:a,config:{}},!1!==CKEDITOR.fire("inline",l)&&CKEDITOR.inline(a,l.config))};CKEDITOR.domReady(function(){!CKEDITOR.disableAutoInline&&
|
|
345
|
-
CKEDITOR.inlineAll()})})();CKEDITOR.replaceClass="ckeditor";(function(){function a(a,e,m,
|
|
346
|
-
function(){
|
|
345
|
+
CKEDITOR.inlineAll()})})();CKEDITOR.replaceClass="ckeditor";(function(){function a(a,e,m,k){a=CKEDITOR.editor._getEditorElement(a);if(!a)return null;var g=new CKEDITOR.editor(e,a,k);k==CKEDITOR.ELEMENT_MODE_REPLACE&&(a.setStyle("visibility","hidden"),g._.required=a.hasAttribute("required"),a.removeAttribute("required"));m&&g.setData(m,null,!0);g.on("loaded",function(){g.isDestroyed()||g.isDetached()||(h(g),k==CKEDITOR.ELEMENT_MODE_REPLACE&&g.config.autoUpdateElement&&a.$.form&&g._attachToForm(),g.setMode(g.config.startupMode,
|
|
346
|
+
function(){g.resetDirty();g.status="ready";g.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,g)}))});g.on("destroy",l);return g}function l(){var a=this.container,e=this.element;a&&(a.clearCustomData(),a.remove());e&&(e.clearCustomData(),this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(e.show(),this._.required&&e.setAttribute("required","required")),delete this.element)}function h(a){var e=a.name,h=a.element,k=a.elementMode,g=a.fire("uiSpace",{space:"top",html:""}).html,b=a.fire("uiSpace",
|
|
347
347
|
{space:"bottom",html:""}).html,c=new CKEDITOR.template('\x3c{outerEl} id\x3d"cke_{name}" class\x3d"{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"application"'+(a.title?' aria-labelledby\x3d"cke_{name}_arialbl"':"")+"\x3e"+(a.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':"")+'\x3c{outerEl} class\x3d"cke_inner cke_reset" role\x3d"presentation"\x3e{topHtml}\x3c{outerEl} id\x3d"{contentId}" class\x3d"cke_contents cke_reset" role\x3d"presentation"\x3e\x3c/{outerEl}\x3e{bottomHtml}\x3c/{outerEl}\x3e\x3c/{outerEl}\x3e'),
|
|
348
|
-
e=CKEDITOR.dom.element.createFromHtml(c.output({id:a.id,name:e,langDir:a.lang.dir,langCode:a.langCode,voiceLabel:a.title,topHtml:
|
|
349
|
-
(h.hide(),e.insertAfter(h)):h.append(e);a.container=e;a.ui.contentsElement=a.ui.space("contents");
|
|
350
|
-
CKEDITOR.appendTo=function(f,e,h){return a(f,e,h,CKEDITOR.ELEMENT_MODE_APPENDTO)};CKEDITOR.replaceAll=function(){for(var a=document.getElementsByTagName("textarea"),e=0;e<a.length;e++){var h=null,
|
|
351
|
-
{}))[a]=e};CKEDITOR.editor.prototype.setMode=function(a,e){var h=this,
|
|
352
|
-
h.resetDirty();c?h.fire("unlockSnapshot"):"wysiwyg"==a&&h.fire("saveSnapshot");setTimeout(function(){h.isDestroyed()||h.isDetached()||(h.fire("mode"),e&&e.call(h))},0)})}};CKEDITOR.editor.prototype.resize=function(a,e,h,
|
|
353
|
-
|
|
354
|
-
CKEDITOR.replaceAll(CKEDITOR.replaceClass)})})();CKEDITOR.config.startupMode="wysiwyg";(function(){function a(a){var b=a.editor,d=a.data.path,c=d.blockLimit,e=a.data.selection,
|
|
355
|
-
c.guard=function(a){return!f(a)||a.type==CKEDITOR.NODE_COMMENT||a.isReadOnly()},!c.checkForward()||d.checkStartOfBlock()&&d.checkEndOfBlock())&&(b=
|
|
356
|
-
c&&c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary()||d.is("pre")||d.getBogus()))return d}function h(a){var b=a.data.getTarget();b.is("input")&&(b=b.getAttribute("type"),"submit"!=b&&"reset"!=b||a.data.preventDefault())}function f(a){return n(a)&&
|
|
357
|
-
c){c&&b.type==CKEDITOR.NODE_ELEMENT&&b.is(e)&&(d=b);if(!(c||!f(b)||a&&y(b)))return!1}}var d,c=a.getRanges()[0];a=a.root;var e={table:1,ul:1,ol:1,dl:1};if(c.startPath().contains(e)){var g=c.clone();g.collapse(1);g.setStartAt(a,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(g);a.guard=b();a.checkBackward();if(d)return g=c.clone(),g.collapse(),g.setEndAt(d,CKEDITOR.POSITION_AFTER_END),a=new CKEDITOR.dom.walker(g),a.guard=b(!0),d=!1,a.checkForward(),d}return null}function
|
|
358
|
-
a.config.autoParagraph&&a.activeEnterMode!=CKEDITOR.ENTER_BR&&(a.editable().equals(d)&&!b||b&&"true"==b.getAttribute("contenteditable"))}function
|
|
359
|
-
b:a;(a=a.getParent())&&!c.equals(a)&&1==a.getChildCount();)b=a;b.remove()}var n,t,w,
|
|
348
|
+
e=CKEDITOR.dom.element.createFromHtml(c.output({id:a.id,name:e,langDir:a.lang.dir,langCode:a.langCode,voiceLabel:a.title,topHtml:g?'\x3cspan id\x3d"'+a.ui.spaceId("top")+'" class\x3d"cke_top cke_reset_all" role\x3d"presentation" style\x3d"height:auto"\x3e'+g+"\x3c/span\x3e":"",contentId:a.ui.spaceId("contents"),bottomHtml:b?'\x3cspan id\x3d"'+a.ui.spaceId("bottom")+'" class\x3d"cke_bottom cke_reset_all" role\x3d"presentation"\x3e'+b+"\x3c/span\x3e":"",outerEl:CKEDITOR.env.ie?"span":"div"}));k==CKEDITOR.ELEMENT_MODE_REPLACE?
|
|
349
|
+
(h.hide(),e.insertAfter(h)):h.append(e);a.container=e;a.ui.contentsElement=a.ui.space("contents");g&&a.ui.space("top").unselectable();b&&a.ui.space("bottom").unselectable();h=a.config.width;k=a.config.height;h&&e.setStyle("width",CKEDITOR.tools.cssLength(h));k&&a.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(k));e.disableContextMenu();CKEDITOR.env.webkit&&e.on("focus",function(){a.focus()});a.fireOnce("uiReady")}CKEDITOR.replace=function(f,e){return a(f,e,null,CKEDITOR.ELEMENT_MODE_REPLACE)};
|
|
350
|
+
CKEDITOR.appendTo=function(f,e,h){return a(f,e,h,CKEDITOR.ELEMENT_MODE_APPENDTO)};CKEDITOR.replaceAll=function(){for(var a=document.getElementsByTagName("textarea"),e=0;e<a.length;e++){var h=null,k=a[e];if(k.name||k.id){if("string"==typeof arguments[0]){if(!(new RegExp("(?:^|\\s)"+arguments[0]+"(?:$|\\s)")).test(k.className))continue}else if("function"==typeof arguments[0]&&(h={},!1===arguments[0](k,h)))continue;this.replace(k,h)}}};CKEDITOR.editor.prototype.addMode=function(a,e){(this._.modes||(this._.modes=
|
|
351
|
+
{}))[a]=e};CKEDITOR.editor.prototype.setMode=function(a,e){var h=this,k=this._.modes;if(a!=h.mode&&k&&k[a]){h.fire("beforeSetMode",a);if(h.mode){var g=h.checkDirty(),k=h._.previousModeData,b,c=0;h.fire("beforeModeUnload");h.editable(0);h._.previousMode=h.mode;h._.previousModeData=b=h.getData(1);"source"==h.mode&&k==b&&(h.fire("lockSnapshot",{forceUpdate:!0}),c=1);h.ui.space("contents").setHtml("");h.mode=""}else h._.previousModeData=h.getData(1);this._.modes[a](function(){h.mode=a;void 0!==g&&!g&&
|
|
352
|
+
h.resetDirty();c?h.fire("unlockSnapshot"):"wysiwyg"==a&&h.fire("saveSnapshot");setTimeout(function(){h.isDestroyed()||h.isDetached()||(h.fire("mode"),e&&e.call(h))},0)})}};CKEDITOR.editor.prototype.resize=function(a,e,h,k){var g=this.container,b=this.ui.space("contents"),c=CKEDITOR.env.webkit&&this.document&&this.document.getWindow().$.frameElement;k=k?this.container.getFirst(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_inner")}):g;a=CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(a));
|
|
353
|
+
k.setSize("width",a,!0);c&&(c.style.width="1%");e=CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(e));var d=(k.$.offsetHeight||0)-(b.$.clientHeight||0),g=Math.max(e-(h?0:d),0);e=h?e+d:e;b.setStyle("height",CKEDITOR.tools.cssLength(g));c&&(c.style.width="100%");this.fire("resize",{outerHeight:e,contentsHeight:g,outerWidth:a||k.getSize("width")})};CKEDITOR.editor.prototype.getResizable=function(a){return a?this.ui.space("contents"):this.container};CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&
|
|
354
|
+
CKEDITOR.replaceAll(CKEDITOR.replaceClass)})})();CKEDITOR.config.startupMode="wysiwyg";(function(){function a(a){var b=a.editor,d=a.data.path,c=d.blockLimit,e=a.data.selection,g=e.getRanges()[0],h;if(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)if(e=l(e,d))e.appendBogus(),h=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.edge&&b._.previousActive;k(b,d.block,c)&&g.collapsed&&!g.getCommonAncestor().isReadOnly()&&(d=g.clone(),d.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),c=new CKEDITOR.dom.walker(d),
|
|
355
|
+
c.guard=function(a){return!f(a)||a.type==CKEDITOR.NODE_COMMENT||a.isReadOnly()},!c.checkForward()||d.checkStartOfBlock()&&d.checkEndOfBlock())&&(b=g.fixBlock(!0,b.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p"),CKEDITOR.env.needsBrFiller||(b=b.getFirst(f))&&b.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(b.getText()).match(/^(?: |\xa0)$/)&&b.remove(),h=1,a.cancel());h&&g.select()}function l(a,b){if(a.isFake)return 0;var d=b.block||b.blockLimit,c=d&&d.getLast(f);if(!(!d||!d.isBlockBoundary()||
|
|
356
|
+
c&&c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary()||d.is("pre")||d.getBogus()))return d}function h(a){var b=a.data.getTarget();b.is("input")&&(b=b.getAttribute("type"),"submit"!=b&&"reset"!=b||a.data.preventDefault())}function f(a){return n(a)&&p(a)}function e(a,b){return function(d){var c=d.data.$.toElement||d.data.$.fromElement||d.data.$.relatedTarget;(c=c&&c.nodeType==CKEDITOR.NODE_ELEMENT?new CKEDITOR.dom.element(c):null)&&(b.equals(c)||b.contains(c))||a.call(this,d)}}function m(a){function b(a){return function(b,
|
|
357
|
+
c){c&&b.type==CKEDITOR.NODE_ELEMENT&&b.is(e)&&(d=b);if(!(c||!f(b)||a&&y(b)))return!1}}var d,c=a.getRanges()[0];a=a.root;var e={table:1,ul:1,ol:1,dl:1};if(c.startPath().contains(e)){var g=c.clone();g.collapse(1);g.setStartAt(a,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(g);a.guard=b();a.checkBackward();if(d)return g=c.clone(),g.collapse(),g.setEndAt(d,CKEDITOR.POSITION_AFTER_END),a=new CKEDITOR.dom.walker(g),a.guard=b(!0),d=!1,a.checkForward(),d}return null}function k(a,b,d){return!1!==
|
|
358
|
+
a.config.autoParagraph&&a.activeEnterMode!=CKEDITOR.ENTER_BR&&(a.editable().equals(d)&&!b||b&&"true"==b.getAttribute("contenteditable"))}function g(a){return a.activeEnterMode!=CKEDITOR.ENTER_BR&&!1!==a.config.autoParagraph?a.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p":!1}function b(a){a&&a.isEmptyInlineRemoveable()&&a.remove()}function c(a){var b=a.editor;b.getSelection().scrollIntoView();setTimeout(function(){b.fire("saveSnapshot")},0)}function d(a,b,d){var c=a.getCommonAncestor(b);for(b=a=d?
|
|
359
|
+
b:a;(a=a.getParent())&&!c.equals(a)&&1==a.getChildCount();)b=a;b.remove()}var n,p,q,y,t,w,x,r,A,u;CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,$:function(a,b){this.base(b.$||b);this.editor=a;this.status="unloaded";this.hasFocus=!1;this.setup()},proto:{focus:function(){var a;if(CKEDITOR.env.webkit&&!this.hasFocus&&(a=this.editor._.previousActive||this.getDocument().getActive(),this.contains(a))){a.focus();return}CKEDITOR.env.edge&&14<CKEDITOR.env.version&&!this.hasFocus&&
|
|
360
360
|
this.getDocument().equals(CKEDITOR.document)&&(this.editor._.previousScrollTop=this.$.scrollTop);try{if(!CKEDITOR.env.ie||CKEDITOR.env.edge&&14<CKEDITOR.env.version||!this.getDocument().equals(CKEDITOR.document))if(CKEDITOR.env.chrome){var b=this.$.scrollTop;this.$.focus();this.$.scrollTop=b}else this.$.focus();else this.$.setActive()}catch(d){if(!CKEDITOR.env.ie)throw d;}CKEDITOR.env.safari&&!this.isInline()&&(a=CKEDITOR.document.getActive(),a.equals(this.getWindow().getFrame())||this.getWindow().focus())},
|
|
361
361
|
on:function(a,b){var d=Array.prototype.slice.call(arguments,0);CKEDITOR.env.ie&&/^focus|blur$/.exec(a)&&(a="focus"==a?"focusin":"focusout",b=e(b,this),d[0]=a,d[1]=b);return CKEDITOR.dom.element.prototype.on.apply(this,d)},attachListener:function(a){!this._.listeners&&(this._.listeners=[]);var b=Array.prototype.slice.call(arguments,1),b=a.on.apply(a,b);this._.listeners.push(b);return b},clearListeners:function(){var a=this._.listeners;try{for(;a.length;)a.pop().removeListener()}catch(b){}},restoreAttrs:function(){var a=
|
|
362
362
|
this._.attrChanges,b,d;for(d in a)a.hasOwnProperty(d)&&(b=a[d],null!==b?this.setAttribute(d,b):this.removeAttribute(d))},attachClass:function(a){var b=this.getCustomData("classes");this.hasClass(a)||(!b&&(b=[]),b.push(a),this.setCustomData("classes",b),this.addClass(a))},changeAttr:function(a,b){var d=this.getAttribute(a);b!==d&&(!this._.attrChanges&&(this._.attrChanges={}),a in this._.attrChanges||(this._.attrChanges[a]=d),this.setAttribute(a,b))},insertText:function(a){this.editor.focus();this.insertHtml(this.transformPlainTextToHtml(a),
|
|
363
|
-
"text")},transformPlainTextToHtml:function(a){var b=this.editor.getSelection().getStartElement().hasAscendant("pre",!0)?CKEDITOR.ENTER_BR:this.editor.activeEnterMode;return CKEDITOR.tools.transformPlainTextToHtml(a,b)},insertHtml:function(a,b,d){var e=this.editor;e.focus();e.fire("saveSnapshot");d||(d=e.getSelection().getRanges()[0]);
|
|
363
|
+
"text")},transformPlainTextToHtml:function(a){var b=this.editor.getSelection().getStartElement().hasAscendant("pre",!0)?CKEDITOR.ENTER_BR:this.editor.activeEnterMode;return CKEDITOR.tools.transformPlainTextToHtml(a,b)},insertHtml:function(a,b,d){var e=this.editor;e.focus();e.fire("saveSnapshot");d||(d=e.getSelection().getRanges()[0]);w(this,b||"html",a,d);d&&d.select();c(this);this.editor.fire("afterInsertHtml",{})},insertHtmlIntoRange:function(a,b,d){w(this,d||"html",a,b);this.editor.fire("afterInsertHtml",
|
|
364
364
|
{intoRange:b})},insertElement:function(a,b){var d=this.editor;d.focus();d.fire("saveSnapshot");var e=d.activeEnterMode,d=d.getSelection(),g=a.getName(),g=CKEDITOR.dtd.$block[g];b||(b=d.getRanges()[0]);this.insertElementIntoRange(a,b)&&(b.moveToPosition(a,CKEDITOR.POSITION_AFTER_END),g&&((g=a.getNext(function(a){return f(a)&&!y(a)}))&&g.type==CKEDITOR.NODE_ELEMENT&&g.is(CKEDITOR.dtd.$block)?g.getDtd()["#"]?b.moveToElementEditStart(g):b.moveToElementEditEnd(a):g||e==CKEDITOR.ENTER_BR||(g=b.fixBlock(!0,
|
|
365
|
-
e==CKEDITOR.ENTER_DIV?"div":"p"),b.moveToElementEditStart(g))));d.selectRanges([b]);c(this)},insertElementIntoSelection:function(a){this.insertElement(a)},insertElementIntoRange:function(a,d){var c=this.editor,e=c.config.enterMode,f=a.getName(),g=CKEDITOR.dtd.$block[f];if(d.checkReadOnly())return!1;d.deleteContents(1);d.startContainer.type==CKEDITOR.NODE_ELEMENT&&(d.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})?
|
|
366
|
-
1))&&(h=CKEDITOR.dtd[k.getName()])&&(!h||!h[f]);)if(k.getName()in CKEDITOR.dtd.span){var g=d.splitElement(k),
|
|
365
|
+
e==CKEDITOR.ENTER_DIV?"div":"p"),b.moveToElementEditStart(g))));d.selectRanges([b]);c(this)},insertElementIntoSelection:function(a){this.insertElement(a)},insertElementIntoRange:function(a,d){var c=this.editor,e=c.config.enterMode,f=a.getName(),g=CKEDITOR.dtd.$block[f];if(d.checkReadOnly())return!1;d.deleteContents(1);d.startContainer.type==CKEDITOR.NODE_ELEMENT&&(d.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})?x(d):d.startContainer.is(CKEDITOR.dtd.$list)&&r(d));var k,h;if(g)for(;(k=d.getCommonAncestor(0,
|
|
366
|
+
1))&&(h=CKEDITOR.dtd[k.getName()])&&(!h||!h[f]);)if(k.getName()in CKEDITOR.dtd.span){var g=d.splitElement(k),l=d.createBookmark();b(k);b(g);d.moveToBookmark(l)}else d.checkStartOfBlock()&&d.checkEndOfBlock()?(d.setStartBefore(k),d.collapse(!0),k.remove()):d.splitBlock(e==CKEDITOR.ENTER_DIV?"div":"p",c.editable());d.insertNode(a);return!0},setData:function(a,b){b||(a=this.editor.dataProcessor.toHtml(a));this.setHtml(a);this.fixInitialSelection();"unloaded"==this.status&&(this.status="ready");this.editor.fire("dataReady")},
|
|
367
367
|
getData:function(a){var b=this.getHtml();a||(b=this.editor.dataProcessor.toDataFormat(b));return b},setReadOnly:function(a){this.setAttribute("contenteditable",!a)},detach:function(){this.status="detached";this.editor.setData(this.editor.getData(),{internal:!0});this.clearListeners();try{this._.cleanCustomData()}catch(a){if(!CKEDITOR.env.ie||-2146828218!==a.number)throw a;}this.editor.fire("contentDomUnload");delete this.editor.document;delete this.editor.window;delete this.editor},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},
|
|
368
368
|
fixInitialSelection:function(){function a(){var b=d.getDocument().$,c=b.getSelection(),e;a:if(c.anchorNode&&c.anchorNode==d.$)e=!0;else{if(CKEDITOR.env.webkit&&(e=d.getDocument().getActive())&&e.equals(d)&&!c.anchorNode){e=!0;break a}e=void 0}e&&(e=new CKEDITOR.dom.range(d),e.moveToElementEditStart(d),b=b.createRange(),b.setStart(e.startContainer.$,e.startOffset),b.collapse(!0),c.removeAllRanges(),c.addRange(b))}function b(){var a=d.getDocument().$,c=a.selection,e=d.getDocument().getActive();"None"==
|
|
369
369
|
c.type&&e.equals(d)&&(c=new CKEDITOR.dom.range(d),a=a.body.createTextRange(),c.moveToElementEditStart(d),c=c.startContainer,c.type!=CKEDITOR.NODE_ELEMENT&&(c=c.getParent()),a.moveToElementText(c.$),a.collapse(!0),a.select())}var d=this;if(CKEDITOR.env.ie&&(9>CKEDITOR.env.version||CKEDITOR.env.quirks))this.hasFocus&&(this.focus(),b());else if(this.hasFocus)this.focus(),a();else this.once("focus",function(){a()},null,null,-999)},getHtmlFromRange:function(a){if(a.collapsed)return new CKEDITOR.dom.documentFragment(a.document);
|
|
370
|
-
a={doc:this.getDocument(),range:a.clone()};
|
|
370
|
+
a={doc:this.getDocument(),range:a.clone()};A.eol.detect(a,this);A.bogus.exclude(a);A.cell.shrink(a);a.fragment=a.range.cloneContents();A.tree.rebuild(a,this);A.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},extractHtmlFromRange:function(a,b){var d=u,c={range:a,doc:a.document},e=this.getHtmlFromRange(a);if(a.collapsed)return a.optimize(),e;a.enlarge(CKEDITOR.ENLARGE_INLINE,1);d.table.detectPurge(c);c.bookmark=a.createBookmark();delete c.range;var f=this.editor.createRange();
|
|
371
371
|
f.moveToPosition(c.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);c.targetBookmark=f.createBookmark();d.list.detectMerge(c,this);d.table.detectRanges(c,this);d.block.detectMerge(c,this);c.tableContentsRanges?(d.table.deleteRanges(c),a.moveToBookmark(c.bookmark),c.range=a):(a.moveToBookmark(c.bookmark),c.range=a,a.extractContents(d.detectExtractMerge(c)));a.moveToBookmark(c.targetBookmark);a.optimize();d.fixUneditableRangePosition(a);d.list.merge(c,this);d.table.purge(c,this);d.block.merge(c,this);
|
|
372
|
-
if(b){d=a.startPath();if(c=a.checkStartOfBlock()&&a.checkEndOfBlock()&&d.block&&!a.root.equals(d.block)){a:{var c=d.block.getElementsByTag("span"),f=0,g;if(c)for(;g=c.getItem(f++);)if(!
|
|
373
|
-
this.getData();this.is("textarea")||!1!==a.config.ignoreEmptyParagraph&&(b=b.replace(
|
|
372
|
+
if(b){d=a.startPath();if(c=a.checkStartOfBlock()&&a.checkEndOfBlock()&&d.block&&!a.root.equals(d.block)){a:{var c=d.block.getElementsByTag("span"),f=0,g;if(c)for(;g=c.getItem(f++);)if(!p(g)){c=!0;break a}c=!1}c=!c}c&&(a.moveToPosition(d.block,CKEDITOR.POSITION_BEFORE_START),d.block.remove())}else d.autoParagraph(this.editor,a),q(a.startContainer)&&a.startContainer.appendBogus();a.startContainer.mergeSiblings();return e},setup:function(){var a=this.editor;this.attachListener(a,"beforeGetData",function(){var b=
|
|
373
|
+
this.getData();this.is("textarea")||!1!==a.config.ignoreEmptyParagraph&&(b=b.replace(t,function(a,b){return b}));a.setData(b,null,1)},this);this.attachListener(a,"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(a,"afterSetData",function(){this.setData(a.getData(1))},this);this.attachListener(a,"loadSnapshot",function(a){this.setData(a.data,1)},this);this.attachListener(a,"beforeFocus",function(){var b=a.getSelection();(b=b&&b.getNative())&&"Control"==b.type||this.focus()},
|
|
374
374
|
this);this.attachListener(a,"insertHtml",function(a){this.insertHtml(a.data.dataValue,a.data.mode,a.data.range)},this);this.attachListener(a,"insertElement",function(a){this.insertElement(a.data)},this);this.attachListener(a,"insertText",function(a){this.insertText(a.data)},this);this.setReadOnly(a.readOnly);this.attachClass("cke_editable");a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?this.attachClass("cke_editable_inline"):a.elementMode!=CKEDITOR.ELEMENT_MODE_REPLACE&&a.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO||
|
|
375
375
|
this.attachClass("cke_editable_themed");this.attachClass("cke_contents_"+a.config.contentsLangDirection);a.keystrokeHandler.blockedKeystrokes[8]=+a.readOnly;a.keystrokeHandler.attach(this);this.on("blur",function(){this.hasFocus=!1},null,null,-1);this.on("focus",function(){this.hasFocus=!0},null,null,-1);if(CKEDITOR.env.webkit)this.on("scroll",function(){a._.previousScrollTop=a.editable().$.scrollTop},null,null,-1);if(CKEDITOR.env.edge&&14<CKEDITOR.env.version){var b=function(){var d=a.editable();
|
|
376
376
|
null!=a._.previousScrollTop&&d.getDocument().equals(CKEDITOR.document)&&(d.$.scrollTop=a._.previousScrollTop,a._.previousScrollTop=null,this.removeListener("scroll",b))};this.on("scroll",b)}a.focusManager.add(this);this.equals(CKEDITOR.document.getActive())&&(this.hasFocus=!0,a.once("contentDom",function(){a.focusManager.focus(this)},this));this.isInline()&&this.changeAttr("tabindex",a.tabIndex);if(!this.is("textarea")){a.document=this.getDocument();a.window=this.getWindow();var c=a.document;this.changeAttr("spellcheck",
|
|
377
377
|
!a.config.disableNativeSpellChecker);var e=a.config.contentsLangDirection;this.getDirection(1)!=e&&this.changeAttr("dir",e);var g=CKEDITOR.getCss();if(g){var e=c.getHead(),k=e.getCustomData("stylesheet");k?g!=k.getText()&&(CKEDITOR.env.ie&&9>CKEDITOR.env.version?k.$.styleSheet.cssText=g:k.setText(g)):(g=c.appendStyleText(g),g=new CKEDITOR.dom.element(g.ownerNode||g.owningElement),e.setCustomData("stylesheet",g),g.data("cke-temp",1))}e=c.getCustomData("stylesheet_ref")||0;c.setCustomData("stylesheet_ref",
|
|
378
|
-
e+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){a=a.data;var b=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&2!=a.$.button&&b.isReadOnly()&&a.preventDefault()});var l={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var d=b.data.domEvent.getKey(),c;b=a.getSelection();if(0!==b.getRanges().length){if(d in l){var e,f=b.getRanges()[0],g=f.startPath(),k,h,
|
|
379
|
-
11>CKEDITOR.env.version&&(e=b.getSelectedElement())||(e=m(b))?(a.fire("saveSnapshot"),f.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),e.remove(),f.select(),a.fire("saveSnapshot"),c=1):f.collapsed&&((k=g.block)&&(
|
|
380
|
-
c=1):g.blockLimit&&g.blockLimit.is("td")&&(h=g.blockLimit.getAscendant("table"))&&f.checkBoundaryOfElement(h,d?CKEDITOR.START:CKEDITOR.END)&&(
|
|
378
|
+
e+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){a=a.data;var b=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&2!=a.$.button&&b.isReadOnly()&&a.preventDefault()});var l={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var d=b.data.domEvent.getKey(),c;b=a.getSelection();if(0!==b.getRanges().length){if(d in l){var e,f=b.getRanges()[0],g=f.startPath(),k,h,p,d=8==d;CKEDITOR.env.ie&&
|
|
379
|
+
11>CKEDITOR.env.version&&(e=b.getSelectedElement())||(e=m(b))?(a.fire("saveSnapshot"),f.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),e.remove(),f.select(),a.fire("saveSnapshot"),c=1):f.collapsed&&((k=g.block)&&(p=k[d?"getPrevious":"getNext"](n))&&p.type==CKEDITOR.NODE_ELEMENT&&p.is("table")&&f[d?"checkStartOfBlock":"checkEndOfBlock"]()?(a.fire("saveSnapshot"),f[d?"checkEndOfBlock":"checkStartOfBlock"]()&&k.remove(),f["moveToElementEdit"+(d?"End":"Start")](p),f.select(),a.fire("saveSnapshot"),
|
|
380
|
+
c=1):g.blockLimit&&g.blockLimit.is("td")&&(h=g.blockLimit.getAscendant("table"))&&f.checkBoundaryOfElement(h,d?CKEDITOR.START:CKEDITOR.END)&&(p=h[d?"getPrevious":"getNext"](n))?(a.fire("saveSnapshot"),f["moveToElementEdit"+(d?"End":"Start")](p),f.checkStartOfBlock()&&f.checkEndOfBlock()?p.remove():f.select(),a.fire("saveSnapshot"),c=1):(h=g.contains(["td","th","caption"]))&&f.checkBoundaryOfElement(h,d?CKEDITOR.START:CKEDITOR.END)&&(c=1))}return!c}});a.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&
|
|
381
381
|
this.attachListener(this,"keyup",function(b){b.data.getKeystroke()in l&&!this.getFirst(f)&&(this.appendBogus(),b=a.createRange(),b.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),b.select())});this.attachListener(this,"dblclick",function(b){if(a.readOnly)return!1;b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this,"click",h);CKEDITOR.env.ie&&!CKEDITOR.env.edge||this.attachListener(this,"mousedown",function(b){var d=b.data.getTarget();d.is("img","hr",
|
|
382
|
-
"input","textarea","select")&&!d.isReadOnly()&&(a.getSelection().selectElement(d),d.is("input","textarea","select")&&b.data.preventDefault())});CKEDITOR.env.edge&&this.attachListener(this,"mouseup",function(b){(b=b.data.getTarget())&&b.is("img")&&!b.isReadOnly()&&a.getSelection().selectElement(b)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(2==b.data.$.button&&(b=b.data.getTarget(),!b.getAscendant("table")&&!b.getOuterHtml().replace(
|
|
382
|
+
"input","textarea","select")&&!d.isReadOnly()&&(a.getSelection().selectElement(d),d.is("input","textarea","select")&&b.data.preventDefault())});CKEDITOR.env.edge&&this.attachListener(this,"mouseup",function(b){(b=b.data.getTarget())&&b.is("img")&&!b.isReadOnly()&&a.getSelection().selectElement(b)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(2==b.data.$.button&&(b=b.data.getTarget(),!b.getAscendant("table")&&!b.getOuterHtml().replace(t,""))){var d=a.createRange();d.moveToElementEditStart(b);
|
|
383
383
|
d.select(!0)}});CKEDITOR.env.webkit&&(this.attachListener(this,"click",function(a){a.data.getTarget().is("input","select")&&a.data.preventDefault()}),this.attachListener(this,"mouseup",function(a){a.data.getTarget().is("input","textarea")&&a.data.preventDefault()}));CKEDITOR.env.webkit&&this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var c=b.data.domEvent.getKey();if(c in l&&(b=a.getSelection(),0!==b.getRanges().length)){var c=8==c,e=b.getRanges()[0];b=e.startPath();if(e.collapsed)a:{var f=
|
|
384
384
|
b.block;if(f&&e[c?"checkStartOfBlock":"checkEndOfBlock"]()&&e.moveToClosestEditablePosition(f,!c)&&e.collapsed){if(e.startContainer.type==CKEDITOR.NODE_ELEMENT){var g=e.startContainer.getChild(e.startOffset-(c?1:0));if(g&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("hr")){a.fire("saveSnapshot");g.remove();b=!0;break a}}e=e.startPath().block;if(!e||e&&e.contains(f))b=void 0;else{a.fire("saveSnapshot");var k;(k=(c?e:f).getBogus())&&k.remove();k=a.getSelection();g=k.createBookmarks();(c?f:e).moveChildren(c?
|
|
385
385
|
e:f,!1);b.lastElement.mergeSiblings();d(f,e,!c);k.selectBookmarks(g);b=!0}}else b=!1}else c=e,k=b.block,e=c.endPath().block,k&&e&&!k.equals(e)?(a.fire("saveSnapshot"),(f=k.getBogus())&&f.remove(),c.enlarge(CKEDITOR.ENLARGE_INLINE),c.deleteContents(),e.getParent()&&(e.moveChildren(k,!1),b.lastElement.mergeSiblings(),d(k,e,!0)),c=a.getSelection().getRanges()[0],c.collapse(1),c.optimize(),""===c.startContainer.getHtml()&&c.startContainer.appendBogus(),c.select(),b=!0):b=!1;if(!b)return;a.getSelection().scrollIntoView();
|
|
@@ -387,176 +387,176 @@ a.fire("saveSnapshot");return!1}},this,null,100)}},getUniqueId:function(){var a;
|
|
|
387
387
|
--d?a.setCustomData("stylesheet_ref",d):(a.removeCustomData("stylesheet_ref"),b.removeCustomData("stylesheet").remove())}}}}});CKEDITOR.editor.prototype.editable=function(a){var b=this._.editable;if(b&&a)return 0;if(!arguments.length)return b;a?b=a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,a):(b&&b.detach(),b=null);return this._.editable=b};CKEDITOR.on("instanceLoaded",function(b){var d=b.editor;d.on("insertElement",function(a){a=a.data;a.type==CKEDITOR.NODE_ELEMENT&&(a.is("input")||
|
|
388
388
|
a.is("textarea"))&&("false"!=a.getAttribute("contentEditable")&&a.data("cke-editable",a.hasAttribute("contenteditable")?"true":"1"),a.setAttribute("contentEditable",!1))});d.on("selectionChange",function(b){if(!d.readOnly){var c=d.getSelection();c&&!c.isLocked&&(c=d.checkDirty(),d.fire("lockSnapshot"),a(b),d.fire("unlockSnapshot"),!c&&d.resetDirty())}})});CKEDITOR.on("instanceCreated",function(a){var b=a.editor;b.on("mode",function(){var a=b.editable();if(a&&a.isInline()){var d=b.title;a.changeAttr("role",
|
|
389
389
|
"textbox");a.changeAttr("aria-multiline","true");a.changeAttr("aria-label",d);d&&a.changeAttr("title",d);var c=b.fire("ariaEditorHelpLabel",{}).label;if(c&&(d=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents"))){var e=CKEDITOR.tools.getNextId(),c=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+e+'" class\x3d"cke_voice_label"\x3e'+c+"\x3c/span\x3e");d.append(c);a.changeAttr("aria-describedby",e)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");
|
|
390
|
-
n=CKEDITOR.dom.walker.whitespaces(!0);
|
|
391
|
-
|
|
392
|
-
f=b.getChildren(),g=f.count(),k,h=0,
|
|
393
|
-
(k=g.getPrevious())&&a(k)&&!k.getParent().equals(b.startContainer)&&c.contains(k)&&e.contains(g)&&g.isIdentical(k)&&(g.moveChildren(k),g.remove(),
|
|
394
|
-
h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},
|
|
395
|
-
|
|
396
|
-
CKEDITOR.POSITION_BEFORE_END);
|
|
397
|
-
|
|
398
|
-
{context:null,fixForBody:!1,protectedWhitespaces:!!
|
|
399
|
-
P.remove()}}F.dataWrapper=
|
|
400
|
-
aa==CKEDITOR.POSITION_IDENTICAL||aa==CKEDITOR.POSITION_CONTAINS?
|
|
401
|
-
(y=1);if(y&&
|
|
402
|
-
|
|
403
|
-
if(
|
|
390
|
+
n=CKEDITOR.dom.walker.whitespaces(!0);p=CKEDITOR.dom.walker.bookmark(!1,!0);q=CKEDITOR.dom.walker.empty();y=CKEDITOR.dom.walker.bogus();t=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;w=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function d(b,c){var e,f,g,k,h=[],l=c.range.startContainer;e=c.range.startPath();for(var l=n[l.getName()],m=0,p=b.getChildren(),w=p.count(),r=-1,q=-1,G=0,x=e.contains(n.$list);m<
|
|
391
|
+
w;++m)e=p.getItem(m),a(e)?(g=e.getName(),x&&g in CKEDITOR.dtd.$list?h=h.concat(d(e,c)):(k=!!l[g],"br"!=g||!e.data("cke-eol")||m&&m!=w-1||(G=(f=m?h[m-1].node:p.getItem(m+1))&&(!a(f)||!f.is("br")),f=f&&a(f)&&n.$block[f.getName()]),-1!=r||k||(r=m),k||(q=m),h.push({isElement:1,isLineBreak:G,isBlock:e.isBlockBoundary(),hasBlockSibling:f,node:e,name:g,allowed:k}),f=G=0)):h.push({isElement:0,node:e,allowed:1});-1<r&&(h[r].firstNotAllowed=1);-1<q&&(h[q].lastNotAllowed=1);return h}function c(b,d){var e=[],
|
|
392
|
+
f=b.getChildren(),g=f.count(),k,h=0,l=n[d],m=!b.is(n.$inline)||b.is("br");for(m&&e.push(" ");h<g;h++)k=f.getItem(h),a(k)&&!k.is(l)?e=e.concat(c(k,d)):e.push(k);m&&e.push(" ");return e}function e(b){return a(b.startContainer)&&b.startContainer.getChild(b.startOffset-1)}function h(b){return b&&a(b)&&(b.is(n.$removeEmpty)||b.is("a")&&!b.isBlockBoundary())}function l(b,d,c,e){var f=b.clone(),g,k;f.setEndAt(d,CKEDITOR.POSITION_BEFORE_END);(g=(new CKEDITOR.dom.walker(f)).next())&&a(g)&&p[g.getName()]&&
|
|
393
|
+
(k=g.getPrevious())&&a(k)&&!k.getParent().equals(b.startContainer)&&c.contains(k)&&e.contains(g)&&g.isIdentical(k)&&(g.moveChildren(k),g.remove(),l(b,d,c,e))}function m(b,d){function c(b,d){if(d.isBlock&&d.isElement&&!d.node.is("br")&&a(b)&&b.is("br"))return b.remove(),1}var e=d.endContainer.getChild(d.endOffset),f=d.endContainer.getChild(d.endOffset-1);e&&c(e,b[b.length-1]);f&&c(f,b[0])&&(d.setEnd(d.endContainer,d.endOffset-1),d.collapse())}var n=CKEDITOR.dtd,p={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,
|
|
394
|
+
h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},w={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},r=CKEDITOR.tools.extend({},n.$inline);delete r.br;return function(p,F,N,q){var I=p.editor,x=!1;"unfiltered_html"==F&&(F="html",x=!0);if(!q.checkReadOnly()){var u=(new CKEDITOR.dom.elementPath(q.startContainer,q.root)).blockLimit||q.root;F={type:F,dontFilter:x,editable:p,editor:I,range:q,blockLimit:u,mergeCandidates:[],zombies:[]};var x=F.range,u=F.mergeCandidates,A="html"===F.type,t,y,E,aa,ba,U;"text"==F.type&&
|
|
395
|
+
x.shrink(CKEDITOR.SHRINK_ELEMENT,!0,!1)&&(y=CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",x.document),x.insertNode(y),x.setStartAfter(y));E=new CKEDITOR.dom.elementPath(x.startContainer);F.endPath=aa=new CKEDITOR.dom.elementPath(x.endContainer);if(!x.collapsed){t=aa.block||aa.blockLimit;var da=x.getCommonAncestor();t&&!t.equals(da)&&!t.contains(da)&&x.checkEndOfBlock()&&F.zombies.push(t);x.deleteContents()}for(;(ba=e(x))&&a(ba)&&ba.isBlockBoundary()&&E.contains(ba);)x.moveToPosition(ba,
|
|
396
|
+
CKEDITOR.POSITION_BEFORE_END);l(x,F.blockLimit,E,aa);y&&(x.setEndBefore(y),x.collapse(),y.remove());y=x.startPath();if(t=y.contains(h,!1,1))U=x.splitElement(t),F.inlineStylesRoot=t,F.inlineStylesPeak=y.lastElement;y=x.createBookmark();A&&(b(t),b(U));(t=y.startNode.getPrevious(f))&&a(t)&&h(t)&&u.push(t);(t=y.startNode.getNext(f))&&a(t)&&h(t)&&u.push(t);for(t=y.startNode;(t=t.getParent())&&h(t);)u.push(t);x.moveToBookmark(y);I.enterMode===CKEDITOR.ENTER_DIV&&""===I.getData(!0)&&((I=p.getFirst())&&I.remove(),
|
|
397
|
+
q.setStartAt(p,CKEDITOR.POSITION_AFTER_START),q.collapse(!0));if(p=N){p=F.range;if("text"==F.type&&F.inlineStylesRoot){q=F.inlineStylesPeak;I=q.getDocument().createText("{cke-peak}");for(U=F.inlineStylesRoot.getParent();!q.equals(U);)I=I.appendTo(q.clone()),q=q.getParent();N=I.getOuterHtml().split("{cke-peak}").join(N)}q=F.blockLimit.getName();if(/^\s+|\s+$/.test(N)&&"span"in CKEDITOR.dtd[q]){var W='\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e';N=W+N+W}N=F.editor.dataProcessor.toHtml(N,
|
|
398
|
+
{context:null,fixForBody:!1,protectedWhitespaces:!!W,dontFilter:F.dontFilter,filter:F.editor.activeFilter,enterMode:F.editor.activeEnterMode});q=p.document.createElement("body");q.setHtml(N);W&&(q.getFirst().remove(),q.getLast().remove());if((W=p.startPath().block)&&(1!=W.getChildCount()||!W.getBogus()))a:{var P;if(1==q.getChildCount()&&a(P=q.getFirst())&&P.is(w)&&!P.hasAttribute("contenteditable")){W=P.getElementsByTag("*");p=0;for(U=W.count();p<U;p++)if(I=W.getItem(p),!I.is(r))break a;P.moveChildren(P.getParent(1));
|
|
399
|
+
P.remove()}}F.dataWrapper=q;p=N}if(p){P=F.range;p=P.document;q=F.blockLimit;U=0;var Q,W=[],R,T;N=y=0;var Z,I=P.startContainer;ba=F.endPath.elements[0];var fa,x=ba.getPosition(I),u=!!ba.getCommonAncestor(I)&&x!=CKEDITOR.POSITION_IDENTICAL&&!(x&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED),I=d(F.dataWrapper,F);for(m(I,P);U<I.length;U++){x=I[U];if(A=x.isLineBreak)A=P,t=q,aa=E=void 0,x.hasBlockSibling?A=1:(E=A.startContainer.getAscendant(n.$block,1))&&E.is({div:1,p:1})?(aa=E.getPosition(t),
|
|
400
|
+
aa==CKEDITOR.POSITION_IDENTICAL||aa==CKEDITOR.POSITION_CONTAINS?A=0:(t=A.splitElement(E),A.moveToPosition(t,CKEDITOR.POSITION_AFTER_START),A=1)):A=0;if(A)N=0<U;else{A=P.startPath();!x.isBlock&&k(F.editor,A.block,A.blockLimit)&&(T=g(F.editor))&&(T=p.createElement(T),T.appendBogus(),P.insertNode(T),CKEDITOR.env.needsBrFiller&&(Q=T.getBogus())&&Q.remove(),P.moveToPosition(T,CKEDITOR.POSITION_BEFORE_END));if((A=P.startPath().block)&&!A.equals(R)){if(Q=A.getBogus())Q.remove(),W.push(A);R=A}x.firstNotAllowed&&
|
|
401
|
+
(y=1);if(y&&x.isElement){A=P.startContainer;for(t=null;A&&!n[A.getName()][x.name];){if(A.equals(q)){A=null;break}t=A;A=A.getParent()}if(A)t&&(Z=P.splitElement(t),F.zombies.push(Z),F.zombies.push(t));else{t=q.getName();fa=!U;A=U==I.length-1;t=c(x.node,t);E=[];aa=t.length;for(var da=0,ha=void 0,ia=0,ca=-1;da<aa;da++)ha=t[da]," "==ha?(ia||fa&&!da||(E.push(new CKEDITOR.dom.text(" ")),ca=E.length),ia=1):(E.push(ha),ia=0);A&&ca==E.length&&E.pop();fa=E}}if(fa){for(;A=fa.pop();)P.insertNode(A);fa=0}else P.insertNode(x.node);
|
|
402
|
+
x.lastNotAllowed&&U<I.length-1&&((Z=u?ba:Z)&&P.setEndAt(Z,CKEDITOR.POSITION_AFTER_START),y=0);P.collapse()}}1!=I.length?Q=!1:(Q=I[0],Q=Q.isElement&&"false"==Q.node.getAttribute("contenteditable"));Q&&(N=!0,A=I[0].node,P.setStartAt(A,CKEDITOR.POSITION_BEFORE_START),P.setEndAt(A,CKEDITOR.POSITION_AFTER_END));F.dontMoveCaret=N;F.bogusNeededBlocks=W}Q=F.range;var ea;Z=F.bogusNeededBlocks;for(fa=Q.createBookmark();R=F.zombies.pop();)R.getParent()&&(T=Q.clone(),T.moveToElementEditStart(R),T.removeEmptyBlocksAtEnd());
|
|
403
|
+
if(Z)for(;R=Z.pop();)CKEDITOR.env.needsBrFiller?R.appendBogus():R.append(Q.document.createText(" "));for(;R=F.mergeCandidates.pop();)R.mergeSiblings();Q.moveToBookmark(fa);if(!F.dontMoveCaret){for(R=e(Q);R&&a(R)&&!R.is(n.$empty);){if(R.isBlockBoundary())Q.moveToPosition(R,CKEDITOR.POSITION_BEFORE_END);else{if(h(R)&&R.getHtml().match(/(\s| )$/g)){ea=null;break}ea=Q.clone();ea.moveToPosition(R,CKEDITOR.POSITION_BEFORE_END)}R=R.getLast(f)}ea&&Q.moveToRange(ea)}}}}();x=function(){function a(b){b=
|
|
404
404
|
new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$tableContent)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT};return b}function b(a,d,c){d=a.getDocument().createElement(d);a.append(d,c);return d}function d(a){var b=a.count(),c;for(b;0<b--;)c=a.getItem(b),CKEDITOR.tools.trim(c.getHtml())||(c.appendBogus(),CKEDITOR.env.ie&&9>CKEDITOR.env.version&&c.getChildCount()&&c.getFirst().remove())}return function(c){var e=
|
|
405
405
|
c.startContainer,f=e.getAscendant("table",1),g=!1;d(f.getElementsByTag("td"));d(f.getElementsByTag("th"));f=c.clone();f.setStart(e,0);f=a(f).lastBackward();f||(f=c.clone(),f.setEndAt(e,CKEDITOR.POSITION_BEFORE_END),f=a(f).lastForward(),g=!0);f||(f=e);f.is("table")?(c.setStartAt(f,CKEDITOR.POSITION_BEFORE_START),c.collapse(!0),f.remove()):(f.is({tbody:1,thead:1,tfoot:1})&&(f=b(f,"tr",g)),f.is("tr")&&(f=b(f,f.getParent().is("thead")?"th":"td",g)),(e=f.getBogus())&&e.remove(),c.moveToPosition(f,g?CKEDITOR.POSITION_AFTER_START:
|
|
406
|
-
CKEDITOR.POSITION_BEFORE_END))}}();
|
|
407
|
-
c=!0);e||(e=d);e.is(CKEDITOR.dtd.$list)?(b.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),b.collapse(!0),e.remove()):((d=e.getBogus())&&d.remove(),b.moveToPosition(e,c?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END),b.select())}}();
|
|
406
|
+
CKEDITOR.POSITION_BEFORE_END))}}();r=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$list)||a.is(CKEDITOR.dtd.$listItem)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$listItem)};return b}return function(b){var d=b.startContainer,c=!1,e;e=b.clone();e.setStart(d,0);e=a(e).lastBackward();e||(e=b.clone(),e.setEndAt(d,CKEDITOR.POSITION_BEFORE_END),e=a(e).lastForward(),
|
|
407
|
+
c=!0);e||(e=d);e.is(CKEDITOR.dtd.$list)?(b.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),b.collapse(!0),e.remove()):((d=e.getBogus())&&d.remove(),b.moveToPosition(e,c?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END),b.select())}}();A={eol:{detect:function(a,b){var d=a.range,c=d.clone(),e=d.clone(),f=new CKEDITOR.dom.elementPath(d.startContainer,b),g=new CKEDITOR.dom.elementPath(d.endContainer,b);c.collapse(1);e.collapse();f.block&&c.checkBoundaryOfElement(f.block,CKEDITOR.END)&&(d.setStartAfter(f.block),
|
|
408
408
|
a.prependEolBr=1);g.block&&e.checkBoundaryOfElement(g.block,CKEDITOR.START)&&(d.setEndBefore(g.block),a.appendEolBr=1)},fix:function(a,b){var d=b.getDocument(),c;a.appendEolBr&&(c=this.createEolBr(d),a.fragment.append(c));!a.prependEolBr||c&&!c.getPrevious()||a.fragment.append(this.createEolBr(d),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}},bogus:{exclude:function(a){var b=a.range.getBoundaryNodes(),d=b.startNode,b=b.endNode;!b||!y(b)||d&&d.equals(b)||
|
|
409
409
|
a.range.setEndBefore(b)}},tree:{rebuild:function(a,b){var d=a.range,c=d.getCommonAncestor(),e=new CKEDITOR.dom.elementPath(c,b),f=new CKEDITOR.dom.elementPath(d.startContainer,b),d=new CKEDITOR.dom.elementPath(d.endContainer,b),g;c.type==CKEDITOR.NODE_TEXT&&(c=c.getParent());if(e.blockLimit.is({tr:1,table:1})){var k=e.contains("table").getParent();g=function(a){return!a.equals(k)}}else if(e.block&&e.block.is(CKEDITOR.dtd.$listItem)&&(f=f.contains(CKEDITOR.dtd.$list),d=d.contains(CKEDITOR.dtd.$list),
|
|
410
410
|
!f.equals(d))){var h=e.contains(CKEDITOR.dtd.$list).getParent();g=function(a){return!a.equals(h)}}g||(g=function(a){return!a.equals(e.block)&&!a.equals(e.blockLimit)});this.rebuildFragment(a,b,c,g)},rebuildFragment:function(a,b,d,c){for(var e;d&&!d.equals(b)&&c(d);)e=d.clone(0,1),a.fragment.appendTo(e),a.fragment=e,d=d.getParent()}},cell:{shrink:function(a){a=a.range;var b=a.startContainer,d=a.endContainer,c=a.startOffset,e=a.endOffset;b.type==CKEDITOR.NODE_ELEMENT&&b.equals(d)&&b.is("tr")&&++c==
|
|
411
|
-
e&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};
|
|
411
|
+
e&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};u=function(){function a(b,d){var c=b.getParent();if(c.is(CKEDITOR.dtd.$inline))b[d?"insertBefore":"insertAfter"](c)}function b(d,c,e){a(c);a(e,1);for(var f;f=e.getNext();)f.insertAfter(c),c=f;q(d)&&d.remove()}function d(a,b){var c=new CKEDITOR.dom.range(a);c.setStartAfter(b.startNode);c.setEndBefore(b.endNode);return c}return{list:{detectMerge:function(a,b){var c=d(b,a.bookmark),e=c.startPath(),f=c.endPath(),g=e.contains(CKEDITOR.dtd.$list),k=f.contains(CKEDITOR.dtd.$list);
|
|
412
412
|
a.mergeList=g&&k&&g.getParent().equals(k.getParent())&&!g.equals(k);a.mergeListItems=e.block&&f.block&&e.block.is(CKEDITOR.dtd.$listItem)&&f.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList||a.mergeListItems)c=c.clone(),c.setStartBefore(a.bookmark.startNode),c.setEndAfter(a.bookmark.endNode),a.mergeListBookmark=c.createBookmark()},merge:function(a,d){if(a.mergeListBookmark){var c=a.mergeListBookmark.startNode,e=a.mergeListBookmark.endNode,f=new CKEDITOR.dom.elementPath(c,d),g=new CKEDITOR.dom.elementPath(e,
|
|
413
413
|
d);if(a.mergeList){var k=f.contains(CKEDITOR.dtd.$list),h=g.contains(CKEDITOR.dtd.$list);k.equals(h)||(h.moveChildren(k),h.remove())}a.mergeListItems&&(f=f.contains(CKEDITOR.dtd.$listItem),g=g.contains(CKEDITOR.dtd.$listItem),f.equals(g)||b(g,c,e));c.remove();e.remove()}}},block:{detectMerge:function(a,b){if(!a.tableContentsRanges&&!a.mergeListBookmark){var d=new CKEDITOR.dom.range(b);d.setStartBefore(a.bookmark.startNode);d.setEndAfter(a.bookmark.endNode);a.mergeBlockBookmark=d.createBookmark()}},
|
|
414
414
|
merge:function(a,d){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var c=a.mergeBlockBookmark.startNode,e=a.mergeBlockBookmark.endNode,f=new CKEDITOR.dom.elementPath(c,d),g=new CKEDITOR.dom.elementPath(e,d),f=f.block,g=g.block;f&&g&&!f.equals(g)&&b(g,c,e);c.remove();e.remove()}}},table:function(){function a(d){var e=[],f,g=new CKEDITOR.dom.walker(d),k=d.startPath().contains(c),h=d.endPath().contains(c),l={};g.guard=function(a,g){if(a.type==CKEDITOR.NODE_ELEMENT){var m="visited_"+(g?"out":"in");if(a.getCustomData(m))return;
|
|
415
|
-
CKEDITOR.dom.element.setMarker(l,a,m,1)}if(g&&k&&a.equals(k))f=d.clone(),f.setEndAt(k,CKEDITOR.POSITION_BEFORE_END),e.push(f);else if(!g&&h&&a.equals(h))f=d.clone(),f.setStartAt(h,CKEDITOR.POSITION_AFTER_START),e.push(f);else{if(m=!g)m=a.type==CKEDITOR.NODE_ELEMENT&&a.is(c)&&(!k||b(a,k))&&(!h||b(a,h));if(!m&&(m=g))if(a.is(c))var m=k&&k.getAscendant("table",!0),n=h&&h.getAscendant("table",!0),
|
|
415
|
+
CKEDITOR.dom.element.setMarker(l,a,m,1)}if(g&&k&&a.equals(k))f=d.clone(),f.setEndAt(k,CKEDITOR.POSITION_BEFORE_END),e.push(f);else if(!g&&h&&a.equals(h))f=d.clone(),f.setStartAt(h,CKEDITOR.POSITION_AFTER_START),e.push(f);else{if(m=!g)m=a.type==CKEDITOR.NODE_ELEMENT&&a.is(c)&&(!k||b(a,k))&&(!h||b(a,h));if(!m&&(m=g))if(a.is(c))var m=k&&k.getAscendant("table",!0),n=h&&h.getAscendant("table",!0),p=a.getAscendant("table",!0),m=m&&m.contains(p)||n&&n.contains(p);else m=void 0;m&&(f=d.clone(),f.selectNodeContents(a),
|
|
416
416
|
e.push(f))}};g.lastForward();CKEDITOR.dom.element.clearAllMarkers(l);return e}function b(a,d){var c=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,e=a.getPosition(d);return e===CKEDITOR.POSITION_IDENTICAL?!1:0===(e&c)}var c={td:1,th:1,caption:1};return{detectPurge:function(a){var b=a.range,d=b.clone();d.enlarge(CKEDITOR.ENLARGE_ELEMENT);var d=new CKEDITOR.dom.walker(d),e=0;d.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(c)&&++e};d.checkForward();if(1<e){var d=b.startPath().contains("table"),
|
|
417
417
|
f=b.endPath().contains("table");d&&f&&b.checkBoundaryOfElement(d,CKEDITOR.START)&&b.checkBoundaryOfElement(f,CKEDITOR.END)&&(b=a.range.clone(),b.setStartBefore(d),b.setEndAfter(f),a.purgeTableBookmark=b.createBookmark())}},detectRanges:function(e,f){var g=d(f,e.bookmark),k=g.clone(),h,m,l=g.getCommonAncestor();l.is(CKEDITOR.dtd.$tableContent)&&!l.is(c)&&(l=l.getAscendant("table",!0));m=l;l=new CKEDITOR.dom.elementPath(g.startContainer,m);m=new CKEDITOR.dom.elementPath(g.endContainer,m);l=l.contains("table");
|
|
418
418
|
m=m.contains("table");if(l||m)l&&m&&b(l,m)?(e.tableSurroundingRange=k,k.setStartAt(l,CKEDITOR.POSITION_AFTER_END),k.setEndAt(m,CKEDITOR.POSITION_BEFORE_START),k=g.clone(),k.setEndAt(l,CKEDITOR.POSITION_AFTER_END),h=g.clone(),h.setStartAt(m,CKEDITOR.POSITION_BEFORE_START),h=a(k).concat(a(h))):l?m||(e.tableSurroundingRange=k,k.setStartAt(l,CKEDITOR.POSITION_AFTER_END),g.setEndAt(l,CKEDITOR.POSITION_AFTER_END)):(e.tableSurroundingRange=k,k.setEndAt(m,CKEDITOR.POSITION_BEFORE_START),g.setStartAt(m,CKEDITOR.POSITION_AFTER_START)),
|
|
419
|
-
e.tableContentsRanges=h?h:a(g)},deleteRanges:function(a){for(var b;b=a.tableContentsRanges.pop();)b.extractContents(),
|
|
420
|
-
detectExtractMerge:function(a){return!(a.range.startPath().contains(CKEDITOR.dtd.$listItem)&&a.range.endPath().contains(CKEDITOR.dtd.$listItem))},fixUneditableRangePosition:function(a){a.startContainer.getDtd()["#"]||a.moveToClosestEditablePosition(null,!0)},autoParagraph:function(a,b){var d=b.startPath(),c;
|
|
419
|
+
e.tableContentsRanges=h?h:a(g)},deleteRanges:function(a){for(var b;b=a.tableContentsRanges.pop();)b.extractContents(),q(b.startContainer)&&b.startContainer.appendBogus();a.tableSurroundingRange&&a.tableSurroundingRange.extractContents()},purge:function(a){if(a.purgeTableBookmark){var b=a.doc,d=a.range.clone(),b=b.createElement("p");b.insertBefore(a.purgeTableBookmark.startNode);d.moveToBookmark(a.purgeTableBookmark);d.deleteContents();a.range.moveToPosition(b,CKEDITOR.POSITION_AFTER_START)}}}}(),
|
|
420
|
+
detectExtractMerge:function(a){return!(a.range.startPath().contains(CKEDITOR.dtd.$listItem)&&a.range.endPath().contains(CKEDITOR.dtd.$listItem))},fixUneditableRangePosition:function(a){a.startContainer.getDtd()["#"]||a.moveToClosestEditablePosition(null,!0)},autoParagraph:function(a,b){var d=b.startPath(),c;k(a,d.block,d.blockLimit)&&(c=g(a))&&(c=b.document.createElement(c),c.appendBogus(),b.insertNode(c),b.moveToPosition(c,CKEDITOR.POSITION_AFTER_START))}}}()})();(function(){function a(a){return CKEDITOR.plugins.widget&&
|
|
421
421
|
CKEDITOR.plugins.widget.isDomWidget(a)}function l(b,d){if(0===b.length||a(b[0].getEnclosedNode()))return!1;var c,e;if((c=!d&&1===b.length)&&!(c=b[0].collapsed)){var f=b[0];c=f.startContainer.getAscendant({td:1,th:1},!0);var g=f.endContainer.getAscendant({td:1,th:1},!0);e=CKEDITOR.tools.trim;c&&c.equals(g)&&!c.findOne("td, th, tr, tbody, table")?(f=f.cloneContents(),c=f.getFirst()?e(f.getFirst().getText())!==e(c.getText()):!0):c=!1}if(c)return!1;for(e=0;e<b.length;e++)if(c=b[e]._getTableElement(),
|
|
422
422
|
!c)return!1;return!0}function h(a){function b(a){a=a.find("td, th");var d=[],c;for(c=0;c<a.count();c++)d.push(a.getItem(c));return d}var d=[],c,e;for(e=0;e<a.length;e++)c=a[e]._getTableElement(),c.is&&c.is({td:1,th:1})?d.push(c):d=d.concat(b(c));return d}function f(a){a=h(a);var b="",d=[],c,e;for(e=0;e<a.length;e++)c&&!c.equals(a[e].getAscendant("tr"))?(b+=d.join("\t")+"\n",c=a[e].getAscendant("tr"),d=[]):0===e&&(c=a[e].getAscendant("tr")),d.push(a[e].getText());return b+=d.join("\t")}function e(a){var b=
|
|
423
|
-
this.root.editor,d=b.getSelection(1);this.reset();
|
|
423
|
+
this.root.editor,d=b.getSelection(1);this.reset();u=!0;d.root.once("selectionchange",function(a){a.cancel()},null,null,0);d.selectRanges([a[0]]);d=this._.cache;d.ranges=new CKEDITOR.dom.rangeList(a);d.type=CKEDITOR.SELECTION_TEXT;d.selectedElement=a[0]._getTableElement();d.selectedText=f(a);d.nativeSel=null;this.isFake=1;this.rev=x++;b._.fakeSelection=this;u=!1;this.root.fire("selectionchange")}function m(){var b=this._.fakeSelection,d;if(b){d=this.getSelection(1);var c;if(!(c=!d)&&(c=!d.isHidden())){c=
|
|
424
424
|
b;var e=d.getRanges(),f=c.getRanges(),g=e.length&&e[0]._getTableElement()&&e[0]._getTableElement().getAscendant("table",!0),k=f.length&&f[0]._getTableElement()&&f[0]._getTableElement().getAscendant("table",!0),h=1===e.length&&e[0]._getTableElement()&&e[0]._getTableElement().is("table"),m=1===f.length&&f[0]._getTableElement()&&f[0]._getTableElement().is("table");if(a(c.getSelectedElement()))c=!1;else{var n=1===e.length&&e[0].collapsed,f=l(e,!!CKEDITOR.env.webkit)&&l(f);g=g&&k?g.equals(k)||k.contains(g):
|
|
425
425
|
!1;g&&(n||f)?(h&&!m&&c.selectRanges(e),c=!0):c=!1}c=!c}c&&(b.reset(),b=0)}if(!b&&(b=d||this.getSelection(1),!b||b.getType()==CKEDITOR.SELECTION_NONE))return;this.fire("selectionCheck",b);d=this.elementPath();d.compare(this._.selectionPreviousPath)||(c=this._.selectionPreviousPath&&this._.selectionPreviousPath.blockLimit.equals(d.blockLimit),!CKEDITOR.env.webkit&&!CKEDITOR.env.gecko||c||(this._.previousActive=this.document.getActive()),this._.selectionPreviousPath=d,this.fire("selectionChange",{selection:b,
|
|
426
|
-
path:d}))}function
|
|
427
|
-
d(f,1)||!(e||f||c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary()&&c.getBogus())?!0:!1}function d(a){n(a,!1);var b=a.getDocument().createText(
|
|
428
|
-
c.anchorNode==d.$&&c.anchorOffset>f&&(g[0].offset-=f);c.focusNode==d.$&&c.focusOffset>f&&(g[1].offset-=f)}}d.setText(
|
|
426
|
+
path:d}))}function k(){v=!0;z||(g.call(this),z=CKEDITOR.tools.setTimeout(g,200,this))}function g(){z=null;v&&(CKEDITOR.tools.setTimeout(m,0,this),v=!1)}function b(a){return D(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?!0:!1}function c(a){function d(b,c){return b&&b.type!=CKEDITOR.NODE_TEXT?a.clone()["moveToElementEdit"+(c?"End":"Start")](b):!1}if(!(a.root instanceof CKEDITOR.editable))return!1;var c=a.startContainer,e=a.getPreviousNode(b,null,c),f=a.getNextNode(b,null,c);return d(e)||
|
|
427
|
+
d(f,1)||!(e||f||c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary()&&c.getBogus())?!0:!1}function d(a){n(a,!1);var b=a.getDocument().createText(r);a.setCustomData("cke-fillingChar",b);return b}function n(a,b){var d=a&&a.removeCustomData("cke-fillingChar");if(d){if(!1!==b){var c=a.getDocument().getSelection().getNative(),e=c&&"None"!=c.type&&c.getRangeAt(0),f=r.length;if(d.getLength()>f&&e&&e.intersectsNode(d.$)){var g=[{node:c.anchorNode,offset:c.anchorOffset},{node:c.focusNode,offset:c.focusOffset}];
|
|
428
|
+
c.anchorNode==d.$&&c.anchorOffset>f&&(g[0].offset-=f);c.focusNode==d.$&&c.focusOffset>f&&(g[1].offset-=f)}}d.setText(p(d.getText(),1));g&&(d=a.getDocument().$,c=d.getSelection(),d=d.createRange(),d.setStart(g[0].node,g[0].offset),d.collapse(!0),c.removeAllRanges(),c.addRange(d),c.extend(g[1].node,g[1].offset))}}function p(a,b){return b?a.replace(A,function(a,b){return b?" ":""}):a.replace(r,"")}function q(a,b){var d=b&&CKEDITOR.tools.htmlEncode(b)||"\x26nbsp;",d=CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"'+
|
|
429
429
|
(CKEDITOR.env.ie&&14>CKEDITOR.env.version?"display:none":"position:fixed;top:0;left:-1000px;width:0;height:0;overflow:hidden;")+'"\x3e'+d+"\x3c/div\x3e",a.document);a.fire("lockSnapshot");a.editable().append(d);var c=a.getSelection(1),e=a.createRange(),f=c.root.on("selectionchange",function(a){a.cancel()},null,null,0);e.setStartAt(d,CKEDITOR.POSITION_AFTER_START);e.setEndAt(d,CKEDITOR.POSITION_BEFORE_END);c.selectRanges([e]);f.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=
|
|
430
|
-
d}function y(a){var b={37:1,39:1,8:1,46:1};return function(d){var c=d.data.getKeystroke();if(b[c]){var e=a.getSelection().getRanges(),f=e[0];1==e.length&&f.collapsed&&(c=f[38>c?"getPreviousEditableNode":"getNextEditableNode"]())&&c.type==CKEDITOR.NODE_ELEMENT&&"false"==c.getAttribute("contenteditable")&&(a.getSelection().fake(c),d.data.preventDefault(),d.cancel())}}}function
|
|
430
|
+
d}function y(a){var b={37:1,39:1,8:1,46:1};return function(d){var c=d.data.getKeystroke();if(b[c]){var e=a.getSelection().getRanges(),f=e[0];1==e.length&&f.collapsed&&(c=f[38>c?"getPreviousEditableNode":"getNextEditableNode"]())&&c.type==CKEDITOR.NODE_ELEMENT&&"false"==c.getAttribute("contenteditable")&&(a.getSelection().fake(c),d.data.preventDefault(),d.cancel())}}}function t(a){for(var b=0;b<a.length;b++){var d=a[b];d.getCommonAncestor().isReadOnly()&&a.splice(b,1);if(!d.collapsed){if(d.startContainer.isReadOnly())for(var c=
|
|
431
431
|
d.startContainer,e;c&&!((e=c.type==CKEDITOR.NODE_ELEMENT)&&c.is("body")||!c.isReadOnly());)e&&"false"==c.getAttribute("contentEditable")&&d.setStartAfter(c),c=c.getParent();c=d.startContainer;e=d.endContainer;var f=d.startOffset,g=d.endOffset,k=d.clone();c&&c.type==CKEDITOR.NODE_TEXT&&(f>=c.getLength()?k.setStartAfter(c):k.setStartBefore(c));e&&e.type==CKEDITOR.NODE_TEXT&&(g?k.setEndAfter(e):k.setEndBefore(e));c=new CKEDITOR.dom.walker(k);c.evaluator=function(c){if(c.type==CKEDITOR.NODE_ELEMENT&&
|
|
432
|
-
c.isReadOnly()){var e=d.clone();d.setEndBefore(c);d.collapsed&&a.splice(b--,1);c.getPosition(k.endContainer)&CKEDITOR.POSITION_CONTAINS||(e.setStartAfter(c),e.collapsed||a.splice(b+1,0,e));return!0}return!1};c.next()}}return a}var
|
|
432
|
+
c.isReadOnly()){var e=d.clone();d.setEndBefore(c);d.collapsed&&a.splice(b--,1);c.getPosition(k.endContainer)&CKEDITOR.POSITION_CONTAINS||(e.setStartAfter(c),e.collapsed||a.splice(b+1,0,e));return!0}return!1};c.next()}}return a}var w="function"!=typeof window.getSelection,x=1,r=CKEDITOR.tools.repeat("",7),A=new RegExp(r+"( )?","g"),u,z,v,D=CKEDITOR.dom.walker.invisible(1),C=function(){function a(b){return function(a){var d=a.editor.createRange();d.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([d]);
|
|
433
433
|
return!1}}function b(a){return function(b){var d=b.editor,c=d.createRange(),e;if(!d.readOnly)return(e=c.moveToClosestEditablePosition(b.selected,a))||(e=c.moveToClosestEditablePosition(b.selected,!a)),e&&d.getSelection().selectRanges([c]),d.fire("saveSnapshot"),b.selected.remove(),e||(c.moveToElementEditablePosition(d.editable()),d.getSelection().selectRanges([c])),d.fire("saveSnapshot"),!1}}var d=a(),c=a(1);return{37:d,38:d,39:c,40:c,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(a){function b(){var a=
|
|
434
|
-
d.getSelection();a&&a.removeAllRanges()}var d=a.editor;d.on("contentDom",function(){function a(){
|
|
435
|
-
!d.equals(h)&&(b.selectElement(d),a.data.preventDefault()))}function e(a){a=a.getRanges()[0];return a?(a=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")},!0))&&"false"===a.getAttribute("contenteditable")?a:null:null}var f=d.document,
|
|
436
|
-
a.isCollapsed&&a.anchorNode==h.$&&(a=d.createRange(),a.moveToElementEditStart(h),a.select())},null,null,-2);h.attachListener(h,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){if(
|
|
437
|
-
"mousedown",function(){
|
|
438
|
-
a.data.$.button&&((a=d.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(
|
|
439
|
-
|
|
440
|
-
(
|
|
441
|
-
"mouseup",function(){
|
|
434
|
+
d.getSelection();a&&a.removeAllRanges()}var d=a.editor;d.on("contentDom",function(){function a(){r=new CKEDITOR.dom.selection(d.getSelection());r.lock()}function b(){g.removeListener("mouseup",b);p.removeListener("mouseup",b);var a=CKEDITOR.document.$.selection,d=a.createRange();"None"!=a.type&&d.parentElement()&&d.parentElement().ownerDocument==f.$&&d.select()}function c(a){var b,d;b=(b=this.document.getActive())?"input"===b.getName()||"textarea"===b.getName():!1;b||(b=this.getSelection(1),(d=e(b))&&
|
|
435
|
+
!d.equals(h)&&(b.selectElement(d),a.data.preventDefault()))}function e(a){a=a.getRanges()[0];return a?(a=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")},!0))&&"false"===a.getAttribute("contenteditable")?a:null:null}var f=d.document,g=CKEDITOR.document,h=d.editable(),l=f.getBody(),p=f.getDocumentElement(),v=h.isInline(),q,r;CKEDITOR.env.gecko&&h.attachListener(h,"focus",function(a){a.removeListener();0!==q&&(a=d.getSelection().getNative())&&
|
|
436
|
+
a.isCollapsed&&a.anchorNode==h.$&&(a=d.createRange(),a.moveToElementEditStart(h),a.select())},null,null,-2);h.attachListener(h,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){if(q&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){q=d._.previousActive&&d._.previousActive.equals(f.getActive());var a=null!=d._.previousScrollTop&&d._.previousScrollTop!=h.$.scrollTop;CKEDITOR.env.webkit&&q&&a&&(h.$.scrollTop=d._.previousScrollTop)}d.unlockSelection(q);q=0},null,null,-1);h.attachListener(h,
|
|
437
|
+
"mousedown",function(){q=0});if(CKEDITOR.env.ie||CKEDITOR.env.gecko||v)w?h.attachListener(h,"beforedeactivate",a,null,null,-1):h.attachListener(d,"selectionCheck",a,null,null,-1),h.attachListener(h,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusout":"blur",function(){var a=r&&(r.isFake||2>r.getRanges().length);CKEDITOR.env.gecko&&!v&&a||(d.lockSelection(r),q=1)},null,null,-1),h.attachListener(h,"mousedown",function(){q=0});if(CKEDITOR.env.ie&&!v){var x;h.attachListener(h,"mousedown",function(a){2==
|
|
438
|
+
a.data.$.button&&((a=d.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(x=d.window.getScrollPosition()))});h.attachListener(h,"mouseup",function(a){2==a.data.$.button&&x&&(d.document.$.documentElement.scrollLeft=x.x,d.document.$.documentElement.scrollTop=x.y);x=null});if("BackCompat"!=f.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var u,A;p.on("mousedown",function(a){function b(a){a=a.data.$;if(u){var d=l.$.createTextRange();try{d.moveToPoint(a.clientX,a.clientY)}catch(c){}u.setEndPoint(0>
|
|
439
|
+
A.compareEndPoints("StartToStart",d)?"EndToEnd":"StartToStart",d);u.select()}}function d(){p.removeListener("mousemove",b);g.removeListener("mouseup",d);p.removeListener("mouseup",d);u.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y<p.$.clientHeight&&a.$.x<p.$.clientWidth){u=l.$.createTextRange();try{u.moveToPoint(a.$.clientX,a.$.clientY)}catch(c){}A=u.duplicate();p.on("mousemove",b);g.on("mouseup",d);p.on("mouseup",d)}})}if(7<CKEDITOR.env.version&&11>CKEDITOR.env.version)p.on("mousedown",function(a){a.data.getTarget().is("html")&&
|
|
440
|
+
(g.on("mouseup",b),p.on("mouseup",b))})}}h.attachListener(h,"selectionchange",m,d);h.attachListener(h,"keyup",k,d);h.attachListener(h,"touchstart",k,d);h.attachListener(h,"touchend",k,d);CKEDITOR.env.ie&&h.attachListener(h,"keydown",c,d);h.attachListener(h,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){d.forceNextSelectionCheck();d.selectionChange(1)});if(v&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var z;h.attachListener(h,"mousedown",function(){z=1});h.attachListener(f.getDocumentElement(),
|
|
441
|
+
"mouseup",function(){z&&k.call(d);z=0})}else h.attachListener(CKEDITOR.env.ie?h:f.getDocumentElement(),"mouseup",k,d);CKEDITOR.env.webkit&&h.attachListener(f,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:h.hasFocus&&n(h)}},null,null,-1);h.attachListener(h,"keydown",y(d),null,null,-1)});d.on("setData",function(){d.unlockSelection();CKEDITOR.env.webkit&&b()});d.on("contentDomUnload",function(){d.unlockSelection()});if(CKEDITOR.env.ie9Compat)d.on("beforeDestroy",
|
|
442
442
|
b,null,null,9);d.on("dataReady",function(){delete d._.fakeSelection;delete d._.hiddenSelectionContainer;d.selectionChange(1)});d.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=d.editable().getLast(a);b&&b.hasAttribute("data-cke-hidden-sel")&&(b.remove(),CKEDITOR.env.gecko&&(a=d.editable().getFirst(a))&&a.is("br")&&a.getAttribute("_moz_editor_bogus_node")&&a.remove())},null,null,100);d.on("key",function(a){if("wysiwyg"==d.mode){var b=d.getSelection();if(b.isFake){var c=
|
|
443
|
-
C[a.data.keyCode];if(c)return c({editor:d,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var b=a.editor;b.on("selectionChange",function(){var a=b.editable(),d=a.getCustomData("cke-fillingChar");d&&(d.getCustomData("ready")?(n(a),a.editor.fire("selectionCheck")):d.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){n(b.editable())},null,null,-1);b.on("getSnapshot",function(a){a.data&&(a.data=
|
|
444
|
-
b,null,20);b.on("toDataFormat",function(a){a.data.dataValue=
|
|
443
|
+
C[a.data.keyCode];if(c)return c({editor:d,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var b=a.editor;b.on("selectionChange",function(){var a=b.editable(),d=a.getCustomData("cke-fillingChar");d&&(d.getCustomData("ready")?(n(a),a.editor.fire("selectionCheck")):d.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){n(b.editable())},null,null,-1);b.on("getSnapshot",function(a){a.data&&(a.data=p(a.data))},
|
|
444
|
+
b,null,20);b.on("toDataFormat",function(a){a.data.dataValue=p(a.data.dataValue)},null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(a){(a?m:k).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){return!this._.savedSelection&&!this._.fakeSelection||a?(a=this.editable())&&"wysiwyg"==this.mode?new CKEDITOR.dom.selection(a):null:this._.savedSelection||this._.fakeSelection};CKEDITOR.editor.prototype.getSelectedRanges=function(a){var b=this.getSelection();return b&&b.getRanges(a)||
|
|
445
445
|
[]};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);return a.getType()!=CKEDITOR.SELECTION_NONE?(!a.isLocked&&a.lock(),this._.savedSelection=a,!0):!1};CKEDITOR.editor.prototype.unlockSelection=function(a){var b=this._.savedSelection;return b?(b.unlock(a),delete this._.savedSelection,!0):!1};CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath};CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};
|
|
446
|
-
CKEDITOR.dom.range.prototype.select=function(){var a=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);a.selectRanges([this]);return a};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT=2;CKEDITOR.SELECTION_ELEMENT=3;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection){var b=a;a=a.root}var d=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:
|
|
446
|
+
CKEDITOR.dom.range.prototype.select=function(){var a=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);a.selectRanges([this]);return a};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT=2;CKEDITOR.SELECTION_ELEMENT=3;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection){var b=a;a=a.root}var d=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:x++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=
|
|
447
447
|
d?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(b)return CKEDITOR.tools.extend(this._.cache,b._.cache),this.isFake=b.isFake,this.isLocked=b.isLocked,this;a=this.getNative();var c,e;if(a)if(a.getRangeAt)c=(e=a.rangeCount&&a.getRangeAt(0))&&new CKEDITOR.dom.node(e.commonAncestorContainer);else{try{e=a.createRange()}catch(f){}c=e&&CKEDITOR.dom.element.get(e.item&&e.item(0)||e.parentElement())}if(!c||c.type!=CKEDITOR.NODE_ELEMENT&&c.type!=CKEDITOR.NODE_TEXT||!this.root.equals(c)&&!this.root.contains(c))this._.cache.type=
|
|
448
|
-
CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var
|
|
449
|
-
this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=
|
|
450
|
-
CKEDITOR.SELECTION_TEXT,d=this.getNative();if(!d||!d.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(1==d.rangeCount){var d=d.getRangeAt(0),c=d.startContainer;c==d.endContainer&&1==c.nodeType&&1==d.endOffset-d.startOffset&&
|
|
451
|
-
offset:0};for(var e=c.children,f,g,k=b.duplicate(),h=0,
|
|
452
|
-
for(c=e.length;0<k&&0<c;)g=e[--c],g.nodeType==CKEDITOR.NODE_TEXT&&(
|
|
448
|
+
CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var B={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:p,_createFillingCharSequenceNode:d,FILLING_CHAR_SEQUENCE:r});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==
|
|
449
|
+
this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=w?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:w?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var d=this.getNative(),c=d.type;"Text"==c&&(b=CKEDITOR.SELECTION_TEXT);"Control"==c&&(b=CKEDITOR.SELECTION_ELEMENT);d.createRange().parentElement()&&(b=CKEDITOR.SELECTION_TEXT)}catch(e){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=
|
|
450
|
+
CKEDITOR.SELECTION_TEXT,d=this.getNative();if(!d||!d.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(1==d.rangeCount){var d=d.getRangeAt(0),c=d.startContainer;c==d.endContainer&&1==c.nodeType&&1==d.endOffset-d.startOffset&&B[c.childNodes[d.startOffset].nodeName.toLowerCase()]&&(b=CKEDITOR.SELECTION_ELEMENT)}return a.type=b},getRanges:function(){var a=w?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,d){b=b.duplicate();b.collapse(d);var c=b.parentElement();if(!c.hasChildNodes())return{container:c,
|
|
451
|
+
offset:0};for(var e=c.children,f,g,k=b.duplicate(),h=0,l=e.length-1,m=-1,n,p;h<=l;)if(m=Math.floor((h+l)/2),f=e[m],k.moveToElementText(f),n=k.compareEndPoints("StartToStart",b),0<n)l=m-1;else if(0>n)h=m+1;else return{container:c,offset:a(f)};if(-1==m||m==e.length-1&&0>n){k.moveToElementText(c);k.setEndPoint("StartToStart",b);k=k.text.replace(/(\r\n|\r)/g,"\n").length;e=c.childNodes;if(!k)return f=e[e.length-1],f.nodeType!=CKEDITOR.NODE_TEXT?{container:c,offset:e.length}:{container:f,offset:f.nodeValue.length};
|
|
452
|
+
for(c=e.length;0<k&&0<c;)g=e[--c],g.nodeType==CKEDITOR.NODE_TEXT&&(p=g,k-=g.nodeValue.length);return{container:p,offset:-k}}k.collapse(0<n?!0:!1);k.setEndPoint(0<n?"StartToStart":"EndToStart",b);k=k.text.replace(/(\r\n|\r)/g,"\n").length;if(!k)return{container:c,offset:a(f)+(0<n?0:1)};for(;0<k;)try{g=f[0<n?"previousSibling":"nextSibling"],g.nodeType==CKEDITOR.NODE_TEXT&&(k-=g.nodeValue.length,p=g),f=g}catch(v){return{container:c,offset:a(f)}}return{container:p,offset:0<n?-k:p.nodeValue.length+k}};
|
|
453
453
|
return function(){var a=this.getNative(),d=a&&a.createRange(),c=this.getType();if(!a)return[];if(c==CKEDITOR.SELECTION_TEXT)return a=new CKEDITOR.dom.range(this.root),c=b(d,!0),a.setStart(new CKEDITOR.dom.node(c.container),c.offset),c=b(d),a.setEnd(new CKEDITOR.dom.node(c.container),c.offset),a.endContainer.getPosition(a.startContainer)&CKEDITOR.POSITION_PRECEDING&&a.endOffset<=a.startContainer.getIndex()&&a.collapse(),[a];if(c==CKEDITOR.SELECTION_ELEMENT){for(var c=[],e=0;e<d.length;e++){for(var f=
|
|
454
454
|
d.item(e),g=f.parentNode,k=0,a=new CKEDITOR.dom.range(this.root);k<g.childNodes.length&&g.childNodes[k]!=f;k++);a.setStart(new CKEDITOR.dom.node(g),k);a.setEnd(new CKEDITOR.dom.node(g),k+1);c.push(a)}return c}return[]}}():function(){var a=[],b,d=this.getNative();if(!d)return a;for(var c=0;c<d.rangeCount;c++){var e=d.getRangeAt(c);b=new CKEDITOR.dom.range(this.root);b.setStart(new CKEDITOR.dom.node(e.startContainer),e.startOffset);b.setEnd(new CKEDITOR.dom.node(e.endContainer),e.endOffset);a.push(b)}return a};
|
|
455
|
-
return function(b){var d=this._.cache,c=d.ranges;c||(d.ranges=c=new CKEDITOR.dom.rangeList(a.call(this)));return b?
|
|
455
|
+
return function(b){var d=this._.cache,c=d.ranges;c||(d.ranges=c=new CKEDITOR.dom.rangeList(a.call(this)));return b?t(new CKEDITOR.dom.rangeList(c.slice())):c}}(),getStartElement:function(){var a=this._.cache;if(void 0!==a.startElement)return a.startElement;var b;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var d=this.getRanges()[0];if(d){if(d.collapsed)b=d.startContainer,b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent());else{for(d.optimize();b=
|
|
456
456
|
d.startContainer,d.startOffset==(b.getChildCount?b.getChildCount():b.getLength())&&!b.isBlockBoundary();)d.setStartAfter(b);b=d.startContainer;if(b.type!=CKEDITOR.NODE_ELEMENT)return b.getParent();if((b=b.getChild(d.startOffset))&&b.type==CKEDITOR.NODE_ELEMENT)for(d=b.getFirst();d&&d.type==CKEDITOR.NODE_ELEMENT;)b=d,d=d.getFirst();else b=d.startContainer}b=b.$}}return a.startElement=b?new CKEDITOR.dom.element(b):null},getSelectedElement:function(){var a=this._.cache;if(void 0!==a.selectedElement)return a.selectedElement;
|
|
457
|
-
var b=this,d=CKEDITOR.tools.tryThese(function(){return b.getNative().createRange().item(0)},function(){for(var a=b.getRanges()[0].clone(),d,c,e=2;e&&!((d=a.getEnclosedNode())&&d.type==CKEDITOR.NODE_ELEMENT&&
|
|
457
|
+
var b=this,d=CKEDITOR.tools.tryThese(function(){return b.getNative().createRange().item(0)},function(){for(var a=b.getRanges()[0].clone(),d,c,e=2;e&&!((d=a.getEnclosedNode())&&d.type==CKEDITOR.NODE_ELEMENT&&B[d.getName()]&&(c=d));e--)a.shrink(CKEDITOR.SHRINK_ELEMENT);return c&&c.$});return a.selectedElement=d?new CKEDITOR.dom.element(d):null},getSelectedText:function(){var a=this._.cache;if(void 0!==a.selectedText)return a.selectedText;var b=this.getNative(),b=w?"Control"==b.type?"":b.createRange().text:
|
|
458
458
|
b.toString();return a.selectedText=b},lock:function(){this.getRanges();this.getStartElement();this.getSelectedElement();this.getSelectedText();this._.cache.nativeSel=null;this.isLocked=1},unlock:function(a){if(this.isLocked){if(a)var b=this.getSelectedElement(),d=this.getRanges(),c=this.isFake;this.isLocked=0;this.reset();a&&(a=b||d[0]&&d[0].getCommonAncestor())&&a.getAscendant("body",1)&&((a=this.root.editor)&&a.plugins.tableselection&&a.plugins.tableselection.isSupportedEnvironment(a)&&l(d)?e.call(this,
|
|
459
|
-
d):c?this.fake(b):b&&2>d.length?this.selectElement(b):this.selectRanges(d))}},reset:function(){this._.cache={};this.isFake=0;var a=this.root.editor;if(a&&a._.fakeSelection)if(this.rev==a._.fakeSelection.rev){delete a._.fakeSelection;var b=a._.hiddenSelectionContainer;if(b){var d=a.checkDirty();a.fire("lockSnapshot");b.remove();a.fire("unlockSnapshot");!d&&a.resetDirty()}delete a._.hiddenSelectionContainer}else CKEDITOR.warn("selection-fake-reset");this.rev=
|
|
460
|
-
b.setStartBefore(a);b.setEndAfter(a);this.selectRanges([b])},selectRanges:function(a){var b=this.root.editor,f=b&&b._.hiddenSelectionContainer;this.reset();if(f)for(var f=this.root,g,k=0;k<a.length;++k)g=a[k],g.endContainer.equals(f)&&(g.endOffset=Math.min(g.endOffset,f.getChildCount()));if(a.length)if(this.isLocked){var h=CKEDITOR.document.getActive();this.unlock();this.selectRanges(a);this.lock();h&&!h.equals(this.root)&&h.focus()}else{var m;a:{var
|
|
461
|
-
m.type==CKEDITOR.NODE_ELEMENT&&(
|
|
462
|
-
tr:1};1<a.length&&(b=a[a.length-1],a[0].setEnd(b.endContainer,b.endOffset));b=a[0];a=b.collapsed;var
|
|
463
|
-
|
|
464
|
-
b.setStartBefore(
|
|
465
|
-
m=m.getEnclosedNode(),b.isReadOnly()||m&&m.isReadOnly()))){
|
|
466
|
-
b.endOffset)}catch(
|
|
467
|
-
a;c.type=CKEDITOR.SELECTION_ELEMENT;c.selectedText=c.nativeSel=null;this.isFake=1;this.rev=
|
|
459
|
+
d):c?this.fake(b):b&&2>d.length?this.selectElement(b):this.selectRanges(d))}},reset:function(){this._.cache={};this.isFake=0;var a=this.root.editor;if(a&&a._.fakeSelection)if(this.rev==a._.fakeSelection.rev){delete a._.fakeSelection;var b=a._.hiddenSelectionContainer;if(b){var d=a.checkDirty();a.fire("lockSnapshot");b.remove();a.fire("unlockSnapshot");!d&&a.resetDirty()}delete a._.hiddenSelectionContainer}else CKEDITOR.warn("selection-fake-reset");this.rev=x++},selectElement:function(a){var b=new CKEDITOR.dom.range(this.root);
|
|
460
|
+
b.setStartBefore(a);b.setEndAfter(a);this.selectRanges([b])},selectRanges:function(a){var b=this.root.editor,f=b&&b._.hiddenSelectionContainer;this.reset();if(f)for(var f=this.root,g,k=0;k<a.length;++k)g=a[k],g.endContainer.equals(f)&&(g.endOffset=Math.min(g.endOffset,f.getChildCount()));if(a.length)if(this.isLocked){var h=CKEDITOR.document.getActive();this.unlock();this.selectRanges(a);this.lock();h&&!h.equals(this.root)&&h.focus()}else{var m;a:{var p,v;if(1==a.length&&!(v=a[0]).collapsed&&(m=v.getEnclosedNode())&&
|
|
461
|
+
m.type==CKEDITOR.NODE_ELEMENT&&(v=v.clone(),v.shrink(CKEDITOR.SHRINK_ELEMENT,!0),(p=v.getEnclosedNode())&&p.type==CKEDITOR.NODE_ELEMENT&&(m=p),"false"==m.getAttribute("contenteditable")))break a;m=void 0}if(m)this.fake(m);else if(b&&b.plugins.tableselection&&b.plugins.tableselection.isSupportedEnvironment(b)&&l(a)&&!u&&!a[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored"))e.call(this,a);else{if(w){p=CKEDITOR.dom.walker.whitespaces(!0);m=/\ufeff|\u00a0/;v={table:1,tbody:1,
|
|
462
|
+
tr:1};1<a.length&&(b=a[a.length-1],a[0].setEnd(b.endContainer,b.endOffset));b=a[0];a=b.collapsed;var q,r,x;if((f=b.getEnclosedNode())&&f.type==CKEDITOR.NODE_ELEMENT&&f.getName()in B&&(!f.is("a")||!f.getText()))try{x=f.$.createControlRange();x.addElement(f.$);x.select();return}catch(A){}if(b.startContainer.type==CKEDITOR.NODE_ELEMENT&&b.startContainer.getName()in v||b.endContainer.type==CKEDITOR.NODE_ELEMENT&&b.endContainer.getName()in v)b.shrink(CKEDITOR.NODE_ELEMENT,!0),a=b.collapsed;x=b.createBookmark();
|
|
463
|
+
v=x.startNode;a||(h=x.endNode);x=b.document.$.body.createTextRange();x.moveToElementText(v.$);x.moveStart("character",1);h?(m=b.document.$.body.createTextRange(),m.moveToElementText(h.$),x.setEndPoint("EndToEnd",m),x.moveEnd("character",-1)):(q=v.getNext(p),r=v.hasAscendant("pre"),q=!(q&&q.getText&&q.getText().match(m))&&(r||!v.hasPrevious()||v.getPrevious().is&&v.getPrevious().is("br")),r=b.document.createElement("span"),r.setHtml("\x26#65279;"),r.insertBefore(v),q&&b.document.createText("").insertBefore(v));
|
|
464
|
+
b.setStartBefore(v);v.remove();a?(q?(x.moveStart("character",-1),x.select(),b.document.$.selection.clear()):x.select(),b.moveToPosition(r,CKEDITOR.POSITION_BEFORE_START),r.remove()):(b.setEndBefore(h),h.remove(),x.select())}else{h=this.getNative();if(!h)return;this.removeAllRanges();for(x=0;x<a.length;x++){if(x<a.length-1&&(q=a[x],r=a[x+1],m=q.clone(),m.setStart(q.endContainer,q.endOffset),m.setEnd(r.startContainer,r.startOffset),!m.collapsed&&(m.shrink(CKEDITOR.NODE_ELEMENT,!0),b=m.getCommonAncestor(),
|
|
465
|
+
m=m.getEnclosedNode(),b.isReadOnly()||m&&m.isReadOnly()))){r.setStart(q.startContainer,q.startOffset);a.splice(x--,1);continue}b=a[x];r=this.document.$.createRange();b.collapsed&&CKEDITOR.env.webkit&&c(b)&&(m=d(this.root),b.insertNode(m),(q=m.getNext())&&!m.getPrevious()&&q.type==CKEDITOR.NODE_ELEMENT&&"br"==q.getName()?(n(this.root),b.moveToPosition(q,CKEDITOR.POSITION_BEFORE_START)):b.moveToPosition(m,CKEDITOR.POSITION_AFTER_END));r.setStart(b.startContainer.$,b.startOffset);try{r.setEnd(b.endContainer.$,
|
|
466
|
+
b.endOffset)}catch(z){if(0<=z.toString().indexOf("NS_ERROR_ILLEGAL_VALUE"))b.collapse(1),r.setEnd(b.endContainer.$,b.endOffset);else throw z;}h.addRange(r)}}this.reset();this.root.fire("selectionchange")}}},fake:function(a,b){var d=this.root.editor;void 0===b&&a.hasAttribute("aria-label")&&(b=a.getAttribute("aria-label"));this.reset();q(d,b);var c=this._.cache,e=new CKEDITOR.dom.range(this.root);e.setStartBefore(a);e.setEndAfter(a);c.ranges=new CKEDITOR.dom.rangeList(e);c.selectedElement=c.startElement=
|
|
467
|
+
a;c.type=CKEDITOR.SELECTION_ELEMENT;c.selectedText=c.nativeSel=null;this.isFake=1;this.rev=x++;d._.fakeSelection=this;this.root.fire("selectionchange")},isHidden:function(){var a=this.getCommonAncestor();a&&a.type==CKEDITOR.NODE_TEXT&&(a=a.getParent());return!(!a||!a.data("cke-hidden-sel"))},isInTable:function(a){return l(this.getRanges(),a)},isCollapsed:function(){var a=this.getRanges();return 1===a.length&&a[0].collapsed},createBookmarks:function(a){a=this.getRanges().createBookmarks(a);this.isFake&&
|
|
468
468
|
(a.isFake=1);return a},createBookmarks2:function(a){a=this.getRanges().createBookmarks2(a);this.isFake&&(a.isFake=1);return a},selectBookmarks:function(a){for(var b=[],d,c=0;c<a.length;c++){var e=new CKEDITOR.dom.range(this.root);e.moveToBookmark(a[c]);b.push(e)}a.isFake&&(d=l(b)?b[0]._getTableElement():b[0].getEnclosedNode(),d&&d.type==CKEDITOR.NODE_ELEMENT||(CKEDITOR.warn("selection-not-fake"),a.isFake=0));a.isFake&&!l(b)?this.fake(d):this.selectRanges(b);return this},getCommonAncestor:function(){var a=
|
|
469
|
-
this.getRanges();return a.length?a[0].startContainer.getCommonAncestor(a[a.length-1].endContainer):null},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var a=this.getNative();try{a&&a[
|
|
470
|
-
!a.equals(b);)if(a.getAttribute("data-nostyle"))d=a;else if(!c){var e=a.getAttribute("contentEditable");"false"==e?d=a:"true"==e&&(c=1)}return d}function l(a,b,d,c){return(a.getPosition(b)|c)==c&&(!d.childRule||d.childRule(a))}function h(b){var d=b.document;if(b.collapsed)d=
|
|
471
|
-
CKEDITOR.dtd[c];n||(g=!0,n=CKEDITOR.dtd.span);b.enlarge(CKEDITOR.ENLARGE_INLINE,1);b.trim();var
|
|
472
|
-
|
|
473
|
-
(
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
a.removeStyle(e)}}function
|
|
480
|
-
(e.is("pre")?((f=this._.enterMode==CKEDITOR.ENTER_BR?null:a.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&e.copyAttributes(f),c(e,f)):
|
|
481
|
-
" ");g=g.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var k=a.getDocument().createElement("div");k.append(f);f.$.outerHTML="\x3cpre\x3e"+g+"\x3c/pre\x3e";f.copyAttributes(k.getFirst());f=k.getFirst().remove()}else f.setHtml(g);b=f}else g?b=
|
|
482
|
-
c.setHtml(e),h.remove())}else c&&
|
|
469
|
+
this.getRanges();return a.length?a[0].startContainer.getCommonAncestor(a[a.length-1].endContainer):null},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var a=this.getNative();try{a&&a[w?"empty":"removeAllRanges"]()}catch(b){}this.reset()}}}})();"use strict";CKEDITOR.STYLE_BLOCK=1;CKEDITOR.STYLE_INLINE=2;CKEDITOR.STYLE_OBJECT=3;(function(){function a(a,b){for(var d,c;(a=a.getParent())&&
|
|
470
|
+
!a.equals(b);)if(a.getAttribute("data-nostyle"))d=a;else if(!c){var e=a.getAttribute("contentEditable");"false"==e?d=a:"true"==e&&(c=1)}return d}function l(a,b,d,c){return(a.getPosition(b)|c)==c&&(!d.childRule||d.childRule(a))}function h(b){var d=b.document;if(b.collapsed)d=x(this,d),b.insertNode(d),b.moveToPosition(d,CKEDITOR.POSITION_BEFORE_END);else{var c=this.element,f=this._.definition,g,k=f.ignoreReadonly,m=k||f.includeReadonly;null==m&&(m=b.root.getCustomData("cke_includeReadonly"));var n=
|
|
471
|
+
CKEDITOR.dtd[c];n||(g=!0,n=CKEDITOR.dtd.span);b.enlarge(CKEDITOR.ENLARGE_INLINE,1);b.trim();var p=b.createBookmark(),v=p.startNode,q=p.endNode,r=v,w;if(!k){var u=b.getCommonAncestor(),k=a(v,u),u=a(q,u);k&&(r=k.getNextSourceNode(!0));u&&(q=u)}for(r.getPosition(q)==CKEDITOR.POSITION_FOLLOWING&&(r=0);r;){k=!1;if(r.equals(q))r=null,k=!0;else{var A=r.type==CKEDITOR.NODE_ELEMENT?r.getName():null,u=A&&"false"==r.getAttribute("contentEditable"),z=A&&r.getAttribute("data-nostyle");if(A&&r.data("cke-bookmark")||
|
|
472
|
+
r.type===CKEDITOR.NODE_COMMENT){r=r.getNextSourceNode(!0);continue}if(u&&m&&CKEDITOR.dtd.$block[A])for(var t=r,D=e(t),C=void 0,B=D.length,Z=0,t=B&&new CKEDITOR.dom.range(t.getDocument());Z<B;++Z){var C=D[Z],G=CKEDITOR.filter.instances[C.data("cke-filter")];if(G?G.check(this):1)t.selectNodeContents(C),h.call(this,t)}D=A?!n[A]||z?0:u&&!m?0:l(r,q,f,L):1;if(D)if(C=r.getParent(),D=f,B=c,Z=g,!C||!(C.getDtd()||CKEDITOR.dtd.span)[B]&&!Z||D.parentRule&&!D.parentRule(C))k=!0;else{if(w||A&&CKEDITOR.dtd.$removeEmpty[A]&&
|
|
473
|
+
(r.getPosition(q)|L)!=L||(w=b.clone(),w.setStartBefore(r)),A=r.type,A==CKEDITOR.NODE_TEXT||u||A==CKEDITOR.NODE_ELEMENT&&!r.getChildCount()){for(var A=r,M;(k=!A.getNext(J))&&(M=A.getParent(),n[M.getName()])&&l(M,v,f,H);)A=M;w.setEndAfter(A)}}else k=!0;r=r.getNextSourceNode(z||u)}if(k&&w&&!w.collapsed){for(var k=x(this,d),u=k.hasAttributes(),z=w.getCommonAncestor(),A={},D={},C={},B={},E,ca,ea;k&&z;){if(z.getName()==c){for(E in f.attributes)!B[E]&&(ea=z.getAttribute(ca))&&(k.getAttribute(E)==ea?D[E]=
|
|
474
|
+
1:B[E]=1);for(ca in f.styles)!C[ca]&&(ea=z.getStyle(ca))&&(k.getStyle(ca)==ea?A[ca]=1:C[ca]=1)}z=z.getParent()}for(E in D)k.removeAttribute(E);for(ca in A)k.removeStyle(ca);u&&!k.hasAttributes()&&(k=null);k?(w.extractContents().appendTo(k),w.insertNode(k),y.call(this,k),k.mergeSiblings(),CKEDITOR.env.ie||k.$.normalize()):(k=new CKEDITOR.dom.element("span"),w.extractContents().appendTo(k),w.insertNode(k),y.call(this,k),k.remove(!0));w=null}}b.moveToBookmark(p);b.shrink(CKEDITOR.SHRINK_TEXT);b.shrink(CKEDITOR.NODE_ELEMENT,
|
|
475
|
+
!0)}}function f(a){function b(){for(var a=new CKEDITOR.dom.elementPath(c.getParent()),d=new CKEDITOR.dom.elementPath(l.getParent()),e=null,f=null,g=0;g<a.elements.length;g++){var k=a.elements[g];if(k==a.block||k==a.blockLimit)break;n.checkElementRemovable(k,!0)&&(e=k)}for(g=0;g<d.elements.length;g++){k=d.elements[g];if(k==d.block||k==d.blockLimit)break;n.checkElementRemovable(k,!0)&&(f=k)}f&&l.breakParent(f);e&&c.breakParent(e)}a.enlarge(CKEDITOR.ENLARGE_INLINE,1);var d=a.createBookmark(),c=d.startNode,
|
|
476
|
+
e=this._.definition.alwaysRemoveElement;if(a.collapsed){for(var f=new CKEDITOR.dom.elementPath(c.getParent(),a.root),g,k=0,h;k<f.elements.length&&(h=f.elements[k])&&h!=f.block&&h!=f.blockLimit;k++)if(this.checkElementRemovable(h)){var m;!e&&a.collapsed&&(a.checkBoundaryOfElement(h,CKEDITOR.END)||(m=a.checkBoundaryOfElement(h,CKEDITOR.START)))?(g=h,g.match=m?"start":"end"):(h.mergeSiblings(),h.is(this.element)?q.call(this,h):t(h,u(this)[h.getName()]))}if(g){e=c;for(k=0;;k++){h=f.elements[k];if(h.equals(g))break;
|
|
477
|
+
else if(h.match)continue;else h=h.clone();h.append(e);e=h}e["start"==g.match?"insertBefore":"insertAfter"](g)}}else{var l=d.endNode,n=this;b();for(f=c;!f.equals(l);)g=f.getNextSourceNode(),f.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(f)&&(f.getName()==this.element?q.call(this,f):t(f,u(this)[f.getName()]),g.type==CKEDITOR.NODE_ELEMENT&&g.contains(c)&&(b(),g=c.getNext())),f=g}a.moveToBookmark(d);a.shrink(CKEDITOR.NODE_ELEMENT,!0)}function e(a){var b=[];a.forEach(function(a){if("true"==
|
|
478
|
+
a.getAttribute("contenteditable"))return b.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return b}function m(a){var b=a.getEnclosedNode()||a.getCommonAncestor(!1,!0);(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1))&&!a.isReadOnly()&&r(a,this)}function k(a){var b=a.getCommonAncestor(!0,!0);if(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1)){var b=this._.definition,d=b.attributes;if(d)for(var c in d)a.removeAttribute(c,d[c]);if(b.styles)for(var e in b.styles)b.styles.hasOwnProperty(e)&&
|
|
479
|
+
a.removeStyle(e)}}function g(a){var b=a.createBookmark(!0),d=a.createIterator();d.enforceRealBlocks=!0;this._.enterMode&&(d.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR);for(var e,f=a.document,g;e=d.getNextParagraph();)!e.isReadOnly()&&(d.activeFilter?d.activeFilter.check(this):1)&&(g=x(this,f,e),c(e,g));a.moveToBookmark(b)}function b(a){var b=a.createBookmark(1),d=a.createIterator();d.enforceRealBlocks=!0;d.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var e,f;e=d.getNextParagraph();)this.checkElementRemovable(e)&&
|
|
480
|
+
(e.is("pre")?((f=this._.enterMode==CKEDITOR.ENTER_BR?null:a.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&e.copyAttributes(f),c(e,f)):q.call(this,e));a.moveToBookmark(b)}function c(a,b){var c=!b;c&&(b=a.getDocument().createElement("div"),a.copyAttributes(b));var e=b&&b.is("pre"),f=a.is("pre"),g=!e&&f;if(e&&!f){f=b;(g=a.getBogus())&&g.remove();g=a.getHtml();g=n(g,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");g=g.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");g=g.replace(/([ \t\n\r]+| )/g,
|
|
481
|
+
" ");g=g.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var k=a.getDocument().createElement("div");k.append(f);f.$.outerHTML="\x3cpre\x3e"+g+"\x3c/pre\x3e";f.copyAttributes(k.getFirst());f=k.getFirst().remove()}else f.setHtml(g);b=f}else g?b=p(c?[a.getHtml()]:d(a),b):a.moveChildren(b);b.replace(a);if(e){var c=b,h;(h=c.getPrevious(E))&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("pre")&&(e=n(h.getHtml(),/\n$/,"")+"\n\n"+n(c.getHtml(),/^\n/,""),CKEDITOR.env.ie?c.$.outerHTML="\x3cpre\x3e"+e+"\x3c/pre\x3e":
|
|
482
|
+
c.setHtml(e),h.remove())}else c&&w(b)}function d(a){var b=[];n(a.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,d){return b+"\x3c/pre\x3e"+d+"\x3cpre\x3e"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(a,d){b.push(d)});return b}function n(a,b,d){var c="",e="";a=a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(a,b,d){b&&(c=b);d&&(e=d);return""});return c+a.replace(b,d)+e}function p(a,b){var d;
|
|
483
483
|
1<a.length&&(d=new CKEDITOR.dom.documentFragment(b.getDocument()));for(var c=0;c<a.length;c++){var e=a[c],e=e.replace(/(\r\n|\r)/g,"\n"),e=n(e,/^[ \t]*\n/,""),e=n(e,/\n$/,""),e=n(e,/^[ \t]+|[ \t]+$/g,function(a,b){return 1==a.length?"\x26nbsp;":b?" "+CKEDITOR.tools.repeat("\x26nbsp;",a.length-1):CKEDITOR.tools.repeat("\x26nbsp;",a.length-1)+" "}),e=e.replace(/\n/g,"\x3cbr\x3e"),e=e.replace(/[ \t]{2,}/g,function(a){return CKEDITOR.tools.repeat("\x26nbsp;",a.length-1)+" "});if(d){var f=b.clone();f.setHtml(e);
|
|
484
|
-
d.append(f)}else b.setHtml(e)}return d||b}function
|
|
485
|
-
|
|
486
|
-
f;if(f=a.getAttribute(e)){var g=b[c][1];(null===g||g.test&&g.test(f)||"string"==typeof g&&f==g)&&a.removeAttribute(e)}}d||
|
|
487
|
-
c&&!d.equals(c)&&c.type==CKEDITOR.NODE_ELEMENT&&c.mergeSiblings())}function
|
|
488
|
-
return a}function
|
|
489
|
-
b,d){var c=new CKEDITOR.dom.element("span");c[d?"setStyle":"setAttribute"](a,b);return c[d?"getStyle":"getAttribute"](a)}function
|
|
490
|
-
for(var e,f=c.createIterator();e=f.getNextRange();)b.call(this,e,d);a.selectRanges(c)}var C={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},
|
|
491
|
-
1),E=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,b){if("string"==typeof a.type)return new CKEDITOR.style.customHandlers[a.type](a);var d=a.attributes;d&&d.style&&(a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(d.style)),delete d.style);b&&(a=CKEDITOR.tools.clone(a),
|
|
492
|
-
CKEDITOR.STYLE_INLINE);"object"==typeof this.element&&(this.type=CKEDITOR.STYLE_OBJECT);this._={definition:a}};CKEDITOR.style.prototype={apply:function(a){if(a instanceof CKEDITOR.dom.document)return
|
|
493
|
-
a)){var b=this._.enterMode;b||(this._.enterMode=a.activeEnterMode);
|
|
484
|
+
d.append(f)}else b.setHtml(e)}return d||b}function q(a,b){var d=this._.definition,c=d.attributes,d=d.styles,e=u(this)[a.getName()],f=CKEDITOR.tools.isEmpty(c)&&CKEDITOR.tools.isEmpty(d),g;for(g in c)if("class"!=g&&!this._.definition.fullMatch||a.getAttribute(g)==z(g,c[g]))b&&"data-"==g.slice(0,5)||(f=a.hasAttribute(g),a.removeAttribute(g));for(var k in d)this._.definition.fullMatch&&a.getStyle(k)!=z(k,d[k],!0)||(f=f||!!a.getStyle(k),a.removeStyle(k));t(a,e,C[a.getName()]);f&&(this._.definition.alwaysRemoveElement?
|
|
485
|
+
w(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==CKEDITOR.ENTER_BR&&!a.hasAttributes()?w(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function y(a){for(var b=u(this),d=a.getElementsByTag(this.element),c,e=d.count();0<=--e;)c=d.getItem(e),c.isReadOnly()||q.call(this,c,!0);for(var f in b)if(f!=this.element)for(d=a.getElementsByTag(f),e=d.count()-1;0<=e;e--)c=d.getItem(e),c.isReadOnly()||t(c,b[f])}function t(a,b,d){if(b=b&&b.attributes)for(var c=0;c<b.length;c++){var e=b[c][0],
|
|
486
|
+
f;if(f=a.getAttribute(e)){var g=b[c][1];(null===g||g.test&&g.test(f)||"string"==typeof g&&f==g)&&a.removeAttribute(e)}}d||w(a)}function w(a,b){if(!a.hasAttributes()||b)if(CKEDITOR.dtd.$block[a.getName()]){var d=a.getPrevious(E),c=a.getNext(E);!d||d.type!=CKEDITOR.NODE_TEXT&&d.isBlockBoundary({br:1})||a.append("br",1);!c||c.type!=CKEDITOR.NODE_TEXT&&c.isBlockBoundary({br:1})||a.append("br");a.remove(!0)}else d=a.getFirst(),c=a.getLast(),a.remove(!0),d&&(d.type==CKEDITOR.NODE_ELEMENT&&d.mergeSiblings(),
|
|
487
|
+
c&&!d.equals(c)&&c.type==CKEDITOR.NODE_ELEMENT&&c.mergeSiblings())}function x(a,b,d){var c;c=a.element;"*"==c&&(c="span");c=new CKEDITOR.dom.element(c,b);d&&d.copyAttributes(c);c=r(c,a);b.getCustomData("doc_processing_style")&&c.hasAttribute("id")?c.removeAttribute("id"):b.setCustomData("doc_processing_style",1);return c}function r(a,b){var d=b._.definition,c=d.attributes,d=CKEDITOR.style.getStyleText(d);if(c)for(var e in c)a.setAttribute(e,c[e]);d&&a.setAttribute("style",d);a.getDocument().removeCustomData("doc_processing_style");
|
|
488
|
+
return a}function A(a,b){for(var d in a)a[d]=a[d].replace(M,function(a,d){return b[d]})}function u(a){if(a._.overrides)return a._.overrides;var b=a._.overrides={},d=a._.definition.overrides;if(d){CKEDITOR.tools.isArray(d)||(d=[d]);for(var c=0;c<d.length;c++){var e=d[c],f,g;"string"==typeof e?f=e.toLowerCase():(f=e.element?e.element.toLowerCase():a.element,g=e.attributes);e=b[f]||(b[f]={});if(g){var e=e.attributes=e.attributes||[],k;for(k in g)e.push([k.toLowerCase(),g[k]])}}}return b}function z(a,
|
|
489
|
+
b,d){var c=new CKEDITOR.dom.element("span");c[d?"setStyle":"setAttribute"](a,b);return c[d?"getStyle":"getAttribute"](a)}function v(a,b){function d(a,b){return"font-family"==b.toLowerCase()?a.replace(/["']/g,""):a}"string"==typeof a&&(a=CKEDITOR.tools.parseCssText(a));"string"==typeof b&&(b=CKEDITOR.tools.parseCssText(b,!0));for(var c in a)if(!(c in b)||d(b[c],c)!=d(a[c],c)&&"inherit"!=a[c]&&"inherit"!=b[c])return!1;return!0}function D(a,b,d){var c=a.getRanges();b=b?this.removeFromRange:this.applyToRange;
|
|
490
|
+
for(var e,f=c.createIterator();e=f.getNextRange();)b.call(this,e,d);a.selectRanges(c)}var C={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},B={a:1,blockquote:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},G=/\s*(?:;\s*|$)/,M=/#\((.+?)\)/g,J=CKEDITOR.dom.walker.bookmark(0,
|
|
491
|
+
1),E=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,b){if("string"==typeof a.type)return new CKEDITOR.style.customHandlers[a.type](a);var d=a.attributes;d&&d.style&&(a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(d.style)),delete d.style);b&&(a=CKEDITOR.tools.clone(a),A(a.attributes,b),A(a.styles,b));d=this.element=a.element?"string"==typeof a.element?a.element.toLowerCase():a.element:"*";this.type=a.type||(C[d]?CKEDITOR.STYLE_BLOCK:B[d]?CKEDITOR.STYLE_OBJECT:
|
|
492
|
+
CKEDITOR.STYLE_INLINE);"object"==typeof this.element&&(this.type=CKEDITOR.STYLE_OBJECT);this._={definition:a}};CKEDITOR.style.prototype={apply:function(a){if(a instanceof CKEDITOR.dom.document)return D.call(this,a.getSelection());if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;b||(this._.enterMode=a.activeEnterMode);D.call(this,a.getSelection(),0,a);this._.enterMode=b}},remove:function(a){if(a instanceof CKEDITOR.dom.document)return D.call(this,a.getSelection(),1);if(this.checkApplicable(a.elementPath(),
|
|
493
|
+
a)){var b=this._.enterMode;b||(this._.enterMode=a.activeEnterMode);D.call(this,a.getSelection(),1,a);this._.enterMode=b}},applyToRange:function(a){this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?h:this.type==CKEDITOR.STYLE_BLOCK?g:this.type==CKEDITOR.STYLE_OBJECT?m:null;return this.applyToRange(a)},removeFromRange:function(a){this.removeFromRange=this.type==CKEDITOR.STYLE_INLINE?f:this.type==CKEDITOR.STYLE_BLOCK?b:this.type==CKEDITOR.STYLE_OBJECT?k:null;return this.removeFromRange(a)},applyToObject:function(a){r(a,
|
|
494
494
|
this)},checkActive:function(a,b){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(a.block||a.blockLimit,!0,b);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var d=a.elements,c=0,e;c<d.length;c++)if(e=d[c],this.type!=CKEDITOR.STYLE_INLINE||e!=a.block&&e!=a.blockLimit){if(this.type==CKEDITOR.STYLE_OBJECT){var f=e.getName();if(!("string"==typeof this.element?f==this.element:f in this.element))continue}if(this.checkElementRemovable(e,!0,b))return!0}}return!1},checkApplicable:function(a,
|
|
495
495
|
b,d){b&&b instanceof CKEDITOR.filter&&(d=b);if(d&&!d.check(this))return!1;switch(this.type){case CKEDITOR.STYLE_OBJECT:return!!a.contains(this.element);case CKEDITOR.STYLE_BLOCK:return!!a.blockLimit.getDtd()[this.element]}return!0},checkElementMatch:function(a,b){var d=this._.definition;if(!a||!d.ignoreReadonly&&a.isReadOnly())return!1;var c=a.getName();if("string"==typeof this.element?c==this.element:c in this.element){if(!b&&!a.hasAttributes())return!0;if(c=d._AC)d=c;else{var c={},e=0,f=d.attributes;
|
|
496
|
-
if(f)for(var g in f)e++,c[g]=f[g];if(g=CKEDITOR.style.getStyleText(d))c.style||e++,c.style=g;c._length=e;d=d._AC=c}if(d._length){for(var k in d)if("_length"!=k)if(c=a.getAttribute(k)||"","style"==k?
|
|
496
|
+
if(f)for(var g in f)e++,c[g]=f[g];if(g=CKEDITOR.style.getStyleText(d))c.style||e++,c.style=g;c._length=e;d=d._AC=c}if(d._length){for(var k in d)if("_length"!=k)if(c=a.getAttribute(k)||"","style"==k?v(d[k],c):d[k]==c){if(!b)return!0}else if(b)return!1;if(b)return!0}else return!0}return!1},checkElementRemovable:function(a,b,d){if(this.checkElementMatch(a,b,d))return!0;if(b=u(this)[a.getName()]){var c;if(!(b=b.attributes))return!0;for(d=0;d<b.length;d++)if(c=b[d][0],c=a.getAttribute(c)){var e=b[d][1];
|
|
497
497
|
if(null===e)return!0;if("string"==typeof e){if(c==e)return!0}else if(e.test(c))return!0}}return!1},buildPreview:function(a){var b=this._.definition,d=[],c=b.element;"bdo"==c&&(c="span");var d=["\x3c",c],e=b.attributes;if(e)for(var f in e)d.push(" ",f,'\x3d"',e[f],'"');(e=CKEDITOR.style.getStyleText(b))&&d.push(' style\x3d"',e,'"');d.push("\x3e",a||b.name,"\x3c/",c,"\x3e");return d.join("")},getDefinition:function(){return this._.definition}};CKEDITOR.style.getStyleText=function(a){var b=a._ST;if(b)return b;
|
|
498
498
|
var b=a.styles,d=a.attributes&&a.attributes.style||"",c="";d.length&&(d=d.replace(G,";"));for(var e in b){var f=b[e],g=(e+":"+f).replace(G,";");"inherit"==f?c+=g:d+=g}d.length&&(d=CKEDITOR.tools.normalizeCssText(d,!0));return a._ST=d+c};CKEDITOR.style.customHandlers={};CKEDITOR.style.addCustomHandler=function(a){var b=function(a){this._={definition:a};this.setup&&this.setup(a)};b.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),{assignedTo:CKEDITOR.STYLE_OBJECT},
|
|
499
499
|
a,!0);return this.customHandlers[a.type]=b};var L=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,H=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED})();CKEDITOR.styleCommand=function(a,l){this.requiredContent=this.allowedContent=this.style=a;CKEDITOR.tools.extend(this,l,!0)};CKEDITOR.styleCommand.prototype.exec=function(a){a.focus();this.state==CKEDITOR.TRISTATE_OFF?a.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&
|
|
500
500
|
a.removeStyle(this.style)};CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet");CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet);CKEDITOR.loadStylesSet=function(a,l,h){CKEDITOR.stylesSet.addExternal(a,l,"");CKEDITOR.stylesSet.load(a,h)};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(a,l){var h=this._.styleStateChangeCallbacks;h||(h=this._.styleStateChangeCallbacks=[],this.on("selectionChange",function(a){for(var e=0;e<
|
|
501
|
-
h.length;e++){var m=h[e],
|
|
501
|
+
h.length;e++){var m=h[e],k=m.style.checkActive(a.data.path,this)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;m.fn.call(this,k)}}));h.push({style:a,fn:l})},applyStyle:function(a){a.apply(this)},removeStyle:function(a){a.remove(this)},getStylesSet:function(a){if(this._.stylesDefinitions)a(this._.stylesDefinitions);else{var l=this,h=l.config.stylesCombo_stylesSet||l.config.stylesSet;if(!1===h)a(null);else if(h instanceof Array)l._.stylesDefinitions=h,a(h);else{h||(h="default");var h=h.split(":"),f=h[0];
|
|
502
502
|
CKEDITOR.stylesSet.addExternal(f,h[1]?h.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),"");CKEDITOR.stylesSet.load(f,function(e){l._.stylesDefinitions=e[f];a(l._.stylesDefinitions)})}}}});(function(){if(window.Promise)CKEDITOR.tools.promise=Promise;else{var a=CKEDITOR.getUrl("vendor/promise.js");if("function"===typeof window.define&&window.define.amd&&"function"===typeof window.require)return window.require([a],function(a){CKEDITOR.tools.promise=a});CKEDITOR.scriptLoader.load(a,function(l){if(!l)return CKEDITOR.error("no-vendor-lib",
|
|
503
503
|
{path:a});if("undefined"!==typeof window.ES6Promise)return CKEDITOR.tools.promise=ES6Promise})}})();(function(){function a(a,e,m){a.once("selectionCheck",function(a){if(!l){var f=a.data.getRanges()[0];m.equals(f)?a.cancel():e.equals(f)&&(h=!0)}},null,null,-1)}var l=!0,h=!1;CKEDITOR.dom.selection.setupEditorOptimization=function(a){a.on("selectionCheck",function(a){a.data&&!h&&a.data.optimizeInElementEnds();h=!1});a.on("contentDom",function(){var e=a.editable();e&&(e.attachListener(e,"keydown",function(a){this._.shiftPressed=
|
|
504
|
-
a.data.$.shiftKey},this),e.attachListener(e,"keyup",function(a){this._.shiftPressed=a.data.$.shiftKey},this))})};CKEDITOR.dom.selection.prototype.optimizeInElementEnds=function(){var f=this.getRanges()[0],e=this.root.editor,h;if(this.root.editor._.shiftPressed||this.isFake||f.isCollapsed||f.startContainer.equals(f.endContainer))h=!1;else if(0===f.endOffset)h=!0;else{h=f.startContainer.type===CKEDITOR.NODE_TEXT;var
|
|
505
|
-
h=f.startOffset===
|
|
506
|
-
{},l={},h;for(h in CKEDITOR.dtd.$blockLimit)h in CKEDITOR.dtd.$list||(a[h]=1);for(h in CKEDITOR.dtd.$block)h in CKEDITOR.dtd.$blockLimit||h in CKEDITOR.dtd.$empty||(l[h]=1);CKEDITOR.dom.elementPath=function(f,e){var h=null,
|
|
507
|
-
b.getAttribute("contenteditable")?
|
|
508
|
-
return!0},contains:function(a,l,h){var f=0,e;"string"==typeof a&&(e=function(e){return e.getName()==a});a instanceof CKEDITOR.dom.element?e=function(e){return e.equals(a)}:CKEDITOR.tools.isArray(a)?e=function(e){return-1<CKEDITOR.tools.indexOf(a,e.getName())}:"function"==typeof a?e=a:"object"==typeof a&&(e=function(e){return e.getName()in a});var m=this.elements,
|
|
504
|
+
a.data.$.shiftKey},this),e.attachListener(e,"keyup",function(a){this._.shiftPressed=a.data.$.shiftKey},this))})};CKEDITOR.dom.selection.prototype.optimizeInElementEnds=function(){var f=this.getRanges()[0],e=this.root.editor,h;if(this.root.editor._.shiftPressed||this.isFake||f.isCollapsed||f.startContainer.equals(f.endContainer))h=!1;else if(0===f.endOffset)h=!0;else{h=f.startContainer.type===CKEDITOR.NODE_TEXT;var k=f.endContainer.type===CKEDITOR.NODE_TEXT,g=h?f.startContainer.getLength():f.startContainer.getChildCount();
|
|
505
|
+
h=f.startOffset===g||h^k}h&&(h=f.clone(),f.shrink(CKEDITOR.SHRINK_TEXT,!1,{skipBogus:!CKEDITOR.env.webkit}),l=!1,a(e,f,h),f.select(),l=!0)}})();CKEDITOR.dom.comment=function(a,l){"string"==typeof a&&(a=(l?l.$:document).createComment(a));CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"\x3c!--"+this.$.nodeValue+"--\x3e"}});"use strict";(function(){var a=
|
|
506
|
+
{},l={},h;for(h in CKEDITOR.dtd.$blockLimit)h in CKEDITOR.dtd.$list||(a[h]=1);for(h in CKEDITOR.dtd.$block)h in CKEDITOR.dtd.$blockLimit||h in CKEDITOR.dtd.$empty||(l[h]=1);CKEDITOR.dom.elementPath=function(f,e){var h=null,k=null,g=[],b=f,c;e=e||f.getDocument().getBody();b||(b=e);do if(b.type==CKEDITOR.NODE_ELEMENT){g.push(b);if(!this.lastElement&&(this.lastElement=b,b.is(CKEDITOR.dtd.$object)||"false"==b.getAttribute("contenteditable")))continue;if(b.equals(e))break;if(!k&&(c=b.getName(),"true"==
|
|
507
|
+
b.getAttribute("contenteditable")?k=b:!h&&l[c]&&(h=b),a[c])){if(c=!h&&"div"==c){a:{c=b.getChildren();for(var d=0,n=c.count();d<n;d++){var p=c.getItem(d);if(p.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[p.getName()]){c=!0;break a}}c=!1}c=!c}c?h=b:k=b}}while(b=b.getParent());k||(k=e);this.block=h;this.blockLimit=k;this.root=e;this.elements=g}})();CKEDITOR.dom.elementPath.prototype={compare:function(a){var l=this.elements;a=a&&a.elements;if(!a||l.length!=a.length)return!1;for(var h=0;h<l.length;h++)if(!l[h].equals(a[h]))return!1;
|
|
508
|
+
return!0},contains:function(a,l,h){var f=0,e;"string"==typeof a&&(e=function(e){return e.getName()==a});a instanceof CKEDITOR.dom.element?e=function(e){return e.equals(a)}:CKEDITOR.tools.isArray(a)?e=function(e){return-1<CKEDITOR.tools.indexOf(a,e.getName())}:"function"==typeof a?e=a:"object"==typeof a&&(e=function(e){return e.getName()in a});var m=this.elements,k=m.length;l&&(h?f+=1:--k);h&&(m=Array.prototype.slice.call(m,0),m.reverse());for(;f<k;f++)if(e(m[f]))return m[f];return null},isContextFor:function(a){var l;
|
|
509
509
|
return a in CKEDITOR.dtd.$block?(l=this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit,!!l.getDtd()[a]):!0},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}};CKEDITOR.dom.text=function(a,l){"string"==typeof a&&(a=(l?l.$:document).createTextNode(a));this.$=a};CKEDITOR.dom.text.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype,{type:CKEDITOR.NODE_TEXT,getLength:function(){return this.$.nodeValue.length},
|
|
510
510
|
getText:function(){return this.$.nodeValue},setText:function(a){this.$.nodeValue=a},isEmpty:function(a){var l=this.getText();a&&(l=CKEDITOR.tools.trim(l));return!l||l===CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE},split:function(a){var l=this.$.parentNode,h=l.childNodes.length,f=this.getLength(),e=this.getDocument(),m=new CKEDITOR.dom.text(this.$.splitText(a),e);l.childNodes.length==h&&(a>=f?(m=e.createText(""),m.insertAfter(this)):(a=e.createText(""),a.insertAfter(m),a.remove()));return m},substring:function(a,
|
|
511
|
-
l){return"number"!=typeof l?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,l)}});(function(){function a(a,f,e){var m=a.serializable,
|
|
512
|
-
f[
|
|
513
|
-
0;a[m+c+1];){var d=
|
|
514
|
-
a(e,this[
|
|
515
|
-
0,g;f<d.length;f++)if(g=d[f],e.ie&&(g.replace(/^ie/,"")==e.version||e.quirks&&"iequirks"==g)&&(g="ie"),e[g]){b+="_"+d[f];break}return CKEDITOR.getUrl(a()+b+".css")}function h(a,b){m[a]||(CKEDITOR.document.appendStyleSheet(l(a)),m[a]=1);b&&b()}function f(a){var b=a.getById(
|
|
511
|
+
l){return"number"!=typeof l?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,l)}});(function(){function a(a,f,e){var m=a.serializable,k=f[e?"endContainer":"startContainer"],g=e?"endOffset":"startOffset",b=m?f.document.getById(a.startNode):a.startNode;a=m?f.document.getById(a.endNode):a.endNode;k.equals(b.getPrevious())?(f.startOffset=f.startOffset-k.getLength()-a.getPrevious().getLength(),k=a.getNext()):k.equals(a.getPrevious())&&(f.startOffset-=k.getLength(),k=a.getNext());k.equals(b.getParent())&&
|
|
512
|
+
f[g]++;k.equals(a.getParent())&&f[g]++;f[e?"endContainer":"startContainer"]=k;return f}CKEDITOR.dom.rangeList=function(a){if(a instanceof CKEDITOR.dom.rangeList)return a;a?a instanceof CKEDITOR.dom.range&&(a=[a]):a=[];return CKEDITOR.tools.extend(a,l)};var l={createIterator:function(){var a=this,f=CKEDITOR.dom.walker.bookmark(),e=[],m;return{getNextRange:function(k){m=void 0===m?0:m+1;var g=a[m];if(g&&1<a.length){if(!m)for(var b=a.length-1;0<=b;b--)e.unshift(a[b].createBookmark(!0));if(k)for(var c=
|
|
513
|
+
0;a[m+c+1];){var d=g.document;k=0;b=d.getById(e[c].endNode);for(d=d.getById(e[c+1].startNode);;){b=b.getNextSourceNode(!1);if(d.equals(b))k=1;else if(f(b)||b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary())continue;break}if(!k)break;c++}for(g.moveToBookmark(e.shift());c--;)b=a[++m],b.moveToBookmark(e.shift()),g.setEnd(b.endContainer,b.endOffset)}return g}}},createBookmarks:function(h){for(var f=[],e,m=0;m<this.length;m++){f.push(e=this[m].createBookmark(h,!0));for(var k=m+1;k<this.length;k++)this[k]=
|
|
514
|
+
a(e,this[k]),this[k]=a(e,this[k],!0)}return f},createBookmarks2:function(a){for(var f=[],e=0;e<this.length;e++)f.push(this[e].createBookmark2(a));return f},moveToBookmarks:function(a){for(var f=0;f<this.length;f++)this[f].moveToBookmark(a[f])}}})();(function(){function a(){return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1]||"skins/"+CKEDITOR.skinName.split(",")[0]+"/")}function l(b){var d=CKEDITOR.skin["ua_"+b],e=CKEDITOR.env;if(d)for(var d=d.split(",").sort(function(a,b){return a>b?-1:1}),f=
|
|
515
|
+
0,g;f<d.length;f++)if(g=d[f],e.ie&&(g.replace(/^ie/,"")==e.version||e.quirks&&"iequirks"==g)&&(g="ie"),e[g]){b+="_"+d[f];break}return CKEDITOR.getUrl(a()+b+".css")}function h(a,b){m[a]||(CKEDITOR.document.appendStyleSheet(l(a)),m[a]=1);b&&b()}function f(a){var b=a.getById(k);b||(b=a.getHead().append("style"),b.setAttribute("id",k),b.setAttribute("type","text/css"));return b}function e(a,b,e){var f,g,k;if(CKEDITOR.env.webkit)for(b=b.split("}").slice(0,-1),g=0;g<b.length;g++)b[g]=b[g].split("{");for(var h=
|
|
516
516
|
0;h<a.length;h++)if(CKEDITOR.env.webkit)for(g=0;g<b.length;g++){k=b[g][1];for(f=0;f<e.length;f++)k=k.replace(e[f][0],e[f][1]);a[h].$.sheet.addRule(b[g][0],k)}else{k=b;for(f=0;f<e.length;f++)k=k.replace(e[f][0],e[f][1]);CKEDITOR.env.ie&&11>CKEDITOR.env.version?a[h].$.styleSheet.cssText+=k:a[h].$.innerHTML+=k}}var m={};CKEDITOR.skin={path:a,loadPart:function(b,d){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a()+"skin.js"),function(){h(b,d)}):h(b,d)},
|
|
517
517
|
getPath:function(a){return CKEDITOR.getUrl(l(a))},icons:{},addIcon:function(a,b,e,f){a=a.toLowerCase();this.icons[a]||(this.icons[a]={path:b,offset:e||0,bgsize:f||"16px"})},getIconStyle:function(a,b,e,f,g){var k;a&&(a=a.toLowerCase(),b&&(k=this.icons[a+"-rtl"]),k||(k=this.icons[a]));a=e||k&&k.path||"";f=f||k&&k.offset;g=g||k&&k.bgsize||"16px";a&&(a=a.replace(/'/g,"\\'"));return a&&"background-image:url('"+CKEDITOR.getUrl(a)+"');background-position:0 "+f+"px;background-size:"+g+";"}};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,
|
|
518
|
-
{getUiColor:function(){return this.uiColor},setUiColor:function(a){var d=f(CKEDITOR.document);return(this.setUiColor=function(a){this.uiColor=a;var c=CKEDITOR.skin.chameleon,f="",
|
|
519
|
-
if(!a.getById("cke_ui_color")){var c=f(a);
|
|
518
|
+
{getUiColor:function(){return this.uiColor},setUiColor:function(a){var d=f(CKEDITOR.document);return(this.setUiColor=function(a){this.uiColor=a;var c=CKEDITOR.skin.chameleon,f="",k="";"function"==typeof c&&(f=c(this,"editor"),k=c(this,"panel"));a=[[b,a]];e([d],f,a);e(g,k,a)}).call(this,a)}});var k="cke_ui_color",g=[],b=/\$color/g;CKEDITOR.on("instanceLoaded",function(a){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var d=a.editor;a=function(a){a=(a.data[0]||a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();
|
|
519
|
+
if(!a.getById("cke_ui_color")){var c=f(a);g.push(c);d.on("destroy",function(){g=CKEDITOR.tools.array.filter(g,function(a){return c!==a})});(a=d.getUiColor())&&e([c],CKEDITOR.skin.chameleon(d,"panel"),[[b,a]])}};d.on("panelShow",a);d.on("menuShow",a);d.config.uiColor&&d.setUiColor(d.config.uiColor)}})})();(function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=!1;else{var a=CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"\x3e\x3c/div\x3e',
|
|
520
520
|
CKEDITOR.document);a.appendTo(CKEDITOR.document.getHead());try{var l=a.getComputedStyle("border-top-color"),h=a.getComputedStyle("border-right-color");CKEDITOR.env.hc=!(!l||l!=h)}catch(f){CKEDITOR.env.hc=!1}a.remove()}CKEDITOR.env.hc&&(CKEDITOR.env.cssClass+=" cke_hc");CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(a=CKEDITOR._.pending)for(delete CKEDITOR._.pending,l=0;l<a.length;l++)CKEDITOR.editor.prototype.constructor.apply(a[l][0],
|
|
521
|
-
a[l][1]),CKEDITOR.add(a[l][0])})();CKEDITOR.skin.name="tao";CKEDITOR.skin.ua_editor="";CKEDITOR.skin.ua_dialog="";CKEDITOR.skin.chameleon=function(){var a=function(){return function(a,e){for(var h=a.match(/[^#]./g),
|
|
521
|
+
a[l][1]),CKEDITOR.add(a[l][0])})();CKEDITOR.skin.name="tao";CKEDITOR.skin.ua_editor="";CKEDITOR.skin.ua_dialog="";CKEDITOR.skin.chameleon=function(){var a=function(){return function(a,e){for(var h=a.match(/[^#]./g),k=0;3>k;k++){var g=k,b;b=parseInt(h[k],16);b=("0"+(0>e?0|b*(1+e):0|b+(255-b)*e).toString(16)).slice(-2);h[g]=b}return"#"+h.join("")}}(),l=function(){var a=new CKEDITOR.template("background:#{to};background-image:-webkit-gradient(linear,lefttop,leftbottom,from({from}),to({to}));background-image:-moz-linear-gradient(top,{from},{to});background-image:-webkit-linear-gradient(top,{from},{to});background-image:-o-linear-gradient(top,{from},{to});background-image:-ms-linear-gradient(top,{from},{to});background-image:linear-gradient(top,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType\x3d0,startColorstr\x3d'{from}',endColorstr\x3d'{to}');");
|
|
522
522
|
return function(e,h){return a.output({from:e,to:h})}}(),h={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),
|
|
523
523
|
panel:new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")};
|
|
524
524
|
return function(f,e){var m=f.uiColor,m={id:"."+f.id,defaultBorder:a(m,-.1),defaultGradient:l(a(m,.9),m),lightGradient:l(a(m,1),a(m,.7)),mediumGradient:l(a(m,.8),a(m,.5)),ckeButtonOn:l(a(m,.6),a(m,.7)),ckeResizer:a(m,-.4),ckeToolbarSeparator:a(m,.5),ckeColorauto:a(m,.8),dialogBody:a(m,.7),dialogTabSelected:l("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:a(m,-.6),elementsPathBg:m,menubuttonIcon:a(m,.5),menubuttonIconHover:a(m,.3)};return h[e].output(m).replace(/\[/g,"{").replace(/\]/g,
|
|
525
|
-
"}")}}();CKEDITOR.plugins.add("basicstyles",{init:function(a){var l=0,h=function(e,
|
|
525
|
+
"}")}}();CKEDITOR.plugins.add("basicstyles",{init:function(a){var l=0,h=function(e,g,b,c){if(c){c=new CKEDITOR.style(c);var d=f[b];d.unshift(c);a.attachStyleStateChange(c,function(d){!a.readOnly&&a.getCommand(b).setState(d)});a.addCommand(b,new CKEDITOR.styleCommand(c,{contentForms:d}));a.ui.addButton&&a.ui.addButton(e,{label:g,command:b,toolbar:"basicstyles,"+(l+=10)})}},f={bold:["strong","b",["span",function(a){a=a.styles["font-weight"];return"bold"==a||700<=+a}]],italic:["em","i",["span",function(a){return"italic"==
|
|
526
526
|
a.styles["font-style"]}]],underline:["u",["span",function(a){return"underline"==a.styles["text-decoration"]}]],strike:["s","strike",["span",function(a){return"line-through"==a.styles["text-decoration"]}]],subscript:["sub"],superscript:["sup"]},e=a.config,m=a.lang.basicstyles;h("Bold",m.bold,"bold",e.coreStyles_bold);h("Italic",m.italic,"italic",e.coreStyles_italic);h("Underline",m.underline,"underline",e.coreStyles_underline);h("Strike",m.strike,"strike",e.coreStyles_strike);h("Subscript",m.subscript,
|
|
527
527
|
"subscript",e.coreStyles_subscript);h("Superscript",m.superscript,"superscript",e.coreStyles_superscript);a.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+85,"underline"]])}});CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"};CKEDITOR.config.coreStyles_italic={element:"em",overrides:"i"};CKEDITOR.config.coreStyles_underline={element:"u"};CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"};CKEDITOR.config.coreStyles_subscript={element:"sub"};
|
|
528
528
|
CKEDITOR.config.coreStyles_superscript={element:"sup"};(function(){function a(a,b,c,e){if(!a.isReadOnly()&&!a.equals(c.editable())){CKEDITOR.dom.element.setMarker(e,a,"bidi_processed",1);e=a;for(var f=c.editable();(e=e.getParent())&&!e.equals(f);)if(e.getCustomData("bidi_processed")){a.removeStyle("direction");a.removeAttribute("dir");return}e="useComputedState"in c.config?c.config.useComputedState:1;(e?a.getComputedStyle("direction"):a.getStyle("direction")||a.hasAttribute("dir"))!=b&&(a.removeStyle("direction"),
|
|
529
529
|
e?(a.removeAttribute("dir"),b!=a.getComputedStyle("direction")&&a.setAttribute("dir",b)):a.setAttribute("dir",b),c.forceNextSelectionCheck())}}function l(a,b,c){var e=a.getCommonAncestor(!1,!0);a=a.clone();a.enlarge(c==CKEDITOR.ENTER_BR?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);if(a.checkBoundaryOfElement(e,CKEDITOR.START)&&a.checkBoundaryOfElement(e,CKEDITOR.END)){for(var f;e&&e.type==CKEDITOR.NODE_ELEMENT&&(f=e.getParent())&&1==f.getChildCount()&&!(e.getName()in b);)e=
|
|
530
|
-
f;return e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in b&&e}}function h(b){return{context:"p",allowedContent:{"h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td":{propertiesOnly:!0,attributes:"dir"}},requiredContent:"p[dir]",refresh:function(a,b){var d=a.config.useComputedState,c,d=void 0===d||d;if(!d){c=b.lastElement;for(var e=a.editable();c&&!(c.getName()in
|
|
530
|
+
f;return e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in b&&e}}function h(b){return{context:"p",allowedContent:{"h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td":{propertiesOnly:!0,attributes:"dir"}},requiredContent:"p[dir]",refresh:function(a,b){var d=a.config.useComputedState,c,d=void 0===d||d;if(!d){c=b.lastElement;for(var e=a.editable();c&&!(c.getName()in k||c.equals(e));){var f=c.getParent();if(!f)break;c=f}}c=c||b.block||b.blockLimit;c.equals(a.editable())&&(e=a.getSelection().getRanges()[0].getEnclosedNode())&&
|
|
531
531
|
e.type==CKEDITOR.NODE_ELEMENT&&(c=e);c&&(d=d?c.getComputedStyle("direction"):c.getStyle("direction")||c.getAttribute("dir"),a.getCommand("bidirtl").setState("rtl"==d?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF),a.getCommand("bidiltr").setState("ltr"==d?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF));d=(b.block||b.blockLimit||a.editable()).getDirection(1);d!=(a._.selDir||a.lang.dir)&&(a._.selDir=d,a.fire("contentDirChanged",d))},exec:function(c){var f=c.getSelection(),g=c.config.enterMode,k=f.getRanges();
|
|
532
|
-
if(k&&k.length){for(var h={},
|
|
533
|
-
a.getPosition(
|
|
534
|
-
return function(f,g){if(!this.isReadOnly()){var k;if(k=f==(b||c?"dir":"direction")||"style"==f&&(c||e.test(g))){a:{k=this;for(var h=k.getDocument().getBody().getParent();k;){if(k.equals(h)){k=!1;break a}k=k.getParent()}k=!0}k=!k}if(k&&(k=this.getDirection(1),h=a.apply(this,arguments),k!=this.getDirection(1)))return this.getDocument().fire("dirChanged",this),h}return a.apply(this,arguments)}}var e={table:1,ul:1,ol:1,blockquote:1,div:1},m={},
|
|
532
|
+
if(k&&k.length){for(var h={},w=f.createBookmarks(),k=k.createIterator(),x,r=0;x=k.getNextRange(1);){var A=x.getEnclosedNode();A&&(!A||A.type==CKEDITOR.NODE_ELEMENT&&A.getName()in m)||(A=l(x,e,g));A&&a(A,b,c,h);var u=new CKEDITOR.dom.walker(x),z=w[r].startNode,v=w[r++].endNode;u.evaluator=function(a){var b=g==CKEDITOR.ENTER_P?"p":"div",d;if(d=(a?a.type==CKEDITOR.NODE_ELEMENT:!1)&&a.getName()in e){if(b=a.is(b))b=(b=a.getParent())?b.type==CKEDITOR.NODE_ELEMENT:!1;d=!(b&&a.getParent().is("blockquote"))}return!!(d&&
|
|
533
|
+
a.getPosition(z)&CKEDITOR.POSITION_FOLLOWING&&(a.getPosition(v)&CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_CONTAINS)==CKEDITOR.POSITION_PRECEDING)};for(;A=u.next();)a(A,b,c,h);x=x.createIterator();for(x.enlargeBr=g!=CKEDITOR.ENTER_BR;A=x.getNextParagraph(g==CKEDITOR.ENTER_P?"p":"div");)a(A,b,c,h)}CKEDITOR.dom.element.clearAllMarkers(h);c.forceNextSelectionCheck();f.selectBookmarks(w);c.focus()}}}}function f(a){var b=a==g.setAttribute,c=a==g.removeAttribute,e=/\bdirection\s*:\s*(.*?)\s*(:?$|;)/;
|
|
534
|
+
return function(f,g){if(!this.isReadOnly()){var k;if(k=f==(b||c?"dir":"direction")||"style"==f&&(c||e.test(g))){a:{k=this;for(var h=k.getDocument().getBody().getParent();k;){if(k.equals(h)){k=!1;break a}k=k.getParent()}k=!0}k=!k}if(k&&(k=this.getDirection(1),h=a.apply(this,arguments),k!=this.getDirection(1)))return this.getDocument().fire("dirChanged",this),h}return a.apply(this,arguments)}}var e={table:1,ul:1,ol:1,blockquote:1,div:1},m={},k={};CKEDITOR.tools.extend(m,e,{tr:1,p:1,div:1,li:1});CKEDITOR.tools.extend(k,
|
|
535
535
|
m,{td:1});CKEDITOR.plugins.add("bidi",{init:function(a){function b(c,e,f,g,k){a.addCommand(f,new CKEDITOR.command(a,g));a.ui.addButton&&a.ui.addButton(c,{label:e,command:f,toolbar:"bidi,"+k})}if(!a.blockless){var c=a.lang.bidi;b("BidiLtr",c.ltr,"bidiltr",h("ltr"),10);b("BidiRtl",c.rtl,"bidirtl",h("rtl"),20);a.on("contentDom",function(){a.document.on("dirChanged",function(b){a.fire("dirChanged",{node:b.data,dir:b.data.getDirection(1)})})});a.on("contentDirChanged",function(b){b=(a.lang.dir!=b.data?
|
|
536
|
-
"add":"remove")+"Class";var c=a.ui.space(a.config.toolbarLocation);if(c)c[b]("cke_mixed_dir_content")})}}});for(var
|
|
537
|
-
|
|
538
|
-
m.shift(),e.insertNode(h),h.append(new CKEDITOR.dom.text("",a.document)),e.moveToBookmark(
|
|
539
|
-
new CKEDITOR.dom.documentFragment(a.document);h.getFirst();)
|
|
540
|
-
|
|
541
|
-
d&&(n=b.getChild(c));c++)if(n.type==CKEDITOR.NODE_ELEMENT&&n.isBlockBoundary()){b=!1;break a}b=!0}b&&e.remove()}if(a.config.enterMode==CKEDITOR.ENTER_BR)for(e=!0;h.length;)if(c=h.shift(),"div"==c.getName()){
|
|
542
|
-
e&&
|
|
536
|
+
"add":"remove")+"Class";var c=a.ui.space(a.config.toolbarLocation);if(c)c[b]("cke_mixed_dir_content")})}}});for(var g=CKEDITOR.dom.element.prototype,b=["setStyle","removeStyle","setAttribute","removeAttribute"],c=0;c<b.length;c++)g[b[c]]=CKEDITOR.tools.override(g[b[c]],f)})();(function(){var a={exec:function(a){var h=a.getCommand("blockquote").state,f=a.getSelection(),e=f&&f.getRanges()[0];if(e){var m=f.createBookmarks();if(CKEDITOR.env.ie){var k=m[0].startNode,g=m[0].endNode,b;if(k&&"blockquote"==
|
|
537
|
+
k.getParent().getName())for(b=k;b=b.getNext();)if(b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()){k.move(b,!0);break}if(g&&"blockquote"==g.getParent().getName())for(b=g;b=b.getPrevious();)if(b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()){g.move(b);break}}var c=e.createIterator();c.enlargeBr=a.config.enterMode!=CKEDITOR.ENTER_BR;if(h==CKEDITOR.TRISTATE_OFF){for(k=[];h=c.getNextParagraph();)k.push(h);1>k.length&&(h=a.document.createElement(a.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),g=
|
|
538
|
+
m.shift(),e.insertNode(h),h.append(new CKEDITOR.dom.text("",a.document)),e.moveToBookmark(g),e.selectNodeContents(h),e.collapse(!0),g=e.createBookmark(),k.push(h),m.unshift(g));b=k[0].getParent();e=[];for(g=0;g<k.length;g++)h=k[g],b=b.getCommonAncestor(h.getParent());for(h={table:1,tbody:1,tr:1,ol:1,ul:1};h[b.getName()];)b=b.getParent();for(g=null;0<k.length;){for(h=k.shift();!h.getParent().equals(b);)h=h.getParent();h.equals(g)||e.push(h);g=h}for(;0<e.length;)if(h=e.shift(),"blockquote"==h.getName()){for(g=
|
|
539
|
+
new CKEDITOR.dom.documentFragment(a.document);h.getFirst();)g.append(h.getFirst().remove()),k.push(g.getLast());g.replace(h)}else k.push(h);e=a.document.createElement("blockquote");for(e.insertBefore(k[0]);0<k.length;)h=k.shift(),e.append(h)}else if(h==CKEDITOR.TRISTATE_ON){g=[];for(b={};h=c.getNextParagraph();){for(k=e=null;h.getParent();){if("blockquote"==h.getParent().getName()){e=h.getParent();k=h;break}h=h.getParent()}e&&k&&!k.getCustomData("blockquote_moveout")&&(g.push(k),CKEDITOR.dom.element.setMarker(b,
|
|
540
|
+
k,"blockquote_moveout",!0))}CKEDITOR.dom.element.clearAllMarkers(b);h=[];k=[];for(b={};0<g.length;)c=g.shift(),e=c.getParent(),c.getPrevious()?c.getNext()?(c.breakParent(c.getParent()),k.push(c.getNext())):c.remove().insertAfter(e):c.remove().insertBefore(e),e.getCustomData("blockquote_processed")||(k.push(e),CKEDITOR.dom.element.setMarker(b,e,"blockquote_processed",!0)),h.push(c);CKEDITOR.dom.element.clearAllMarkers(b);for(g=k.length-1;0<=g;g--){e=k[g];a:{b=e;for(var c=0,d=b.getChildCount(),n=void 0;c<
|
|
541
|
+
d&&(n=b.getChild(c));c++)if(n.type==CKEDITOR.NODE_ELEMENT&&n.isBlockBoundary()){b=!1;break a}b=!0}b&&e.remove()}if(a.config.enterMode==CKEDITOR.ENTER_BR)for(e=!0;h.length;)if(c=h.shift(),"div"==c.getName()){g=new CKEDITOR.dom.documentFragment(a.document);!e||!c.getPrevious()||c.getPrevious().type==CKEDITOR.NODE_ELEMENT&&c.getPrevious().isBlockBoundary()||g.append(a.document.createElement("br"));for(e=c.getNext()&&!(c.getNext().type==CKEDITOR.NODE_ELEMENT&&c.getNext().isBlockBoundary());c.getFirst();)c.getFirst().remove().appendTo(g);
|
|
542
|
+
e&&g.append(a.document.createElement("br"));g.replace(c);e=!1}}f.selectBookmarks(m);a.focus()}},refresh:function(a,h){this.setState(a.elementPath(h.block||h.blockLimit).contains("blockquote",1)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)},context:"blockquote",allowedContent:"blockquote",requiredContent:"blockquote"};CKEDITOR.plugins.add("blockquote",{init:function(l){l.blockless||(l.addCommand("blockquote",a),l.ui.addButton&&l.ui.addButton("Blockquote",{label:l.lang.blockquote.toolbar,command:"blockquote",
|
|
543
543
|
toolbar:"blocks,10"}))}})})();CKEDITOR.plugins.add("dialogui",{onLoad:function(){var a=function(a){this._||(this._={});this._["default"]=this._.initValue=a["default"]||"";this._.required=a.required||!1;for(var c=[this._],d=1;d<arguments.length;d++)c.push(arguments[d]);c.push(!0);CKEDITOR.tools.extend.apply(CKEDITOR.tools,c);return this._},l={build:function(a,c,d){return new CKEDITOR.ui.dialog.textInput(a,c,d)}},h={build:function(a,c,d){return new CKEDITOR.ui.dialog[c.type](a,c,d)}},f={isChanged:function(){return this.getValue()!=
|
|
544
544
|
this.getInitValue()},reset:function(a){this.setValue(this.getInitValue(),a)},setInitValue:function(){this._.initValue=this.getValue()},resetInitValue:function(){this._.initValue=this._["default"]},getInitValue:function(){return this._.initValue}},e=CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onChange:function(a,c){this._.domOnChangeRegistered||(a.on("load",function(){this.getInputElement().on("change",function(){a.parts.dialog.isVisible()&&this.fire("change",{value:this.getValue()})},
|
|
545
|
-
this)},this),this._.domOnChangeRegistered=!0);this.on("change",c)}},!0),m=/^on([A-Z]\w+)/,
|
|
545
|
+
this)},this),this._.domOnChangeRegistered=!0);this.on("change",c)}},!0),m=/^on([A-Z]\w+)/,k=function(a){for(var c in a)(m.test(c)||"title"==c||"type"==c)&&delete a[c];return a},g=function(a){a=a.data.getKeystroke();a==CKEDITOR.SHIFT+CKEDITOR.ALT+36?this.setDirectionMarker("ltr"):a==CKEDITOR.SHIFT+CKEDITOR.ALT+35&&this.setDirectionMarker("rtl")};CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{labeledElement:function(b,c,d,e){if(!(4>arguments.length)){var f=a.call(this,c);f.labelId=CKEDITOR.tools.getNextId()+
|
|
546
546
|
"_label";this._.children=[];var g={role:c.role||"presentation"};c.includeLabel&&(g["aria-labelledby"]=f.labelId);CKEDITOR.ui.dialog.uiElement.call(this,b,c,d,"div",null,g,function(){var a=[],d=c.required?" cke_required":"";"horizontal"!=c.labelLayout?a.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label'+d+'" ',' id\x3d"'+f.labelId+'"',f.inputId?' for\x3d"'+f.inputId+'"':"",(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e",c.label,"\x3c/label\x3e",'\x3cdiv class\x3d"cke_dialog_ui_labeled_content"',
|
|
547
547
|
c.controlStyle?' style\x3d"'+c.controlStyle+'"':"",' role\x3d"presentation"\x3e',e.call(this,b,c),"\x3c/div\x3e"):(d={type:"hbox",widths:c.widths,padding:0,children:[{type:"html",html:'\x3clabel class\x3d"cke_dialog_ui_labeled_label'+d+'" id\x3d"'+f.labelId+'" for\x3d"'+f.inputId+'"'+(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e"+CKEDITOR.tools.htmlEncode(c.label)+"\x3c/label\x3e"},{type:"html",html:'\x3cspan class\x3d"cke_dialog_ui_labeled_content"'+(c.controlStyle?' style\x3d"'+c.controlStyle+
|
|
548
|
-
'"':"")+"\x3e"+e.call(this,b,c)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,d,a));return a.join("")})}},textInput:function(b,c,d){if(!(3>arguments.length)){a.call(this,c);var e=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",f={"class":"cke_dialog_ui_input_"+c.type,id:e,type:c.type};c.validate&&(this.validate=c.validate);c.maxLength&&(f.maxlength=c.maxLength);c.size&&(f.size=c.size);c.inputStyle&&(f.style=c.inputStyle);var
|
|
549
|
-
function(a){13==a.data.getKeystroke()&&(h=!0)});
|
|
550
|
-
(f["aria-required"]=this._.required);for(var b in f)a.push(b+'\x3d"'+f[b]+'" ');a.push(" /\x3e\x3c/div\x3e");return a.join("")})}},textarea:function(b,c,d){if(!(3>arguments.length)){a.call(this,c);var e=this,f=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",
|
|
551
|
-
function(){e.getInputElement().on("keyup",
|
|
552
|
-
c,d){if(!(3>arguments.length)){var e=a.call(this,c,{"default":!!c["default"]});c.validate&&(this.validate=c.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,c,d,"span",null,null,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),d=[],f=CKEDITOR.tools.getNextId()+"_label",
|
|
553
|
-
e.checkbox=new CKEDITOR.ui.dialog.uiElement(b,a,d,"input",null,
|
|
554
|
-
b,c,d,function(){for(var a=[],d=[],
|
|
555
|
-
(
|
|
548
|
+
'"':"")+"\x3e"+e.call(this,b,c)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,d,a));return a.join("")})}},textInput:function(b,c,d){if(!(3>arguments.length)){a.call(this,c);var e=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",f={"class":"cke_dialog_ui_input_"+c.type,id:e,type:c.type};c.validate&&(this.validate=c.validate);c.maxLength&&(f.maxlength=c.maxLength);c.size&&(f.size=c.size);c.inputStyle&&(f.style=c.inputStyle);var k=this,h=!1;b.on("load",function(){k.getInputElement().on("keydown",
|
|
549
|
+
function(a){13==a.data.getKeystroke()&&(h=!0)});k.getInputElement().on("keyup",function(a){13==a.data.getKeystroke()&&h&&(b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0),h=!1);k.bidi&&g.call(k,a)},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,b,c,d,function(){var a=['\x3cdiv class\x3d"cke_dialog_ui_input_',c.type,'" role\x3d"presentation"'];c.width&&a.push('style\x3d"width:'+c.width+'" ');a.push("\x3e\x3cinput ");f["aria-labelledby"]=this._.labelId;this._.required&&
|
|
550
|
+
(f["aria-required"]=this._.required);for(var b in f)a.push(b+'\x3d"'+f[b]+'" ');a.push(" /\x3e\x3c/div\x3e");return a.join("")})}},textarea:function(b,c,d){if(!(3>arguments.length)){a.call(this,c);var e=this,f=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",k={};c.validate&&(this.validate=c.validate);k.rows=c.rows||5;k.cols=c.cols||20;k["class"]="cke_dialog_ui_input_textarea "+(c["class"]||"");"undefined"!=typeof c.inputStyle&&(k.style=c.inputStyle);c.dir&&(k.dir=c.dir);if(e.bidi)b.on("load",
|
|
551
|
+
function(){e.getInputElement().on("keyup",g)},e);CKEDITOR.ui.dialog.labeledElement.call(this,b,c,d,function(){k["aria-labelledby"]=this._.labelId;this._.required&&(k["aria-required"]=this._.required);var a=['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',f,'" '],b;for(b in k)a.push(b+'\x3d"'+CKEDITOR.tools.htmlEncode(k[b])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(e._["default"]),"\x3c/textarea\x3e\x3c/div\x3e");return a.join("")})}},checkbox:function(b,
|
|
552
|
+
c,d){if(!(3>arguments.length)){var e=a.call(this,c,{"default":!!c["default"]});c.validate&&(this.validate=c.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,c,d,"span",null,null,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),d=[],f=CKEDITOR.tools.getNextId()+"_label",g={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":f};k(a);c["default"]&&(g.checked="checked");"undefined"!=typeof a.inputStyle&&(a.style=a.inputStyle);
|
|
553
|
+
e.checkbox=new CKEDITOR.ui.dialog.uiElement(b,a,d,"input",null,g);d.push(' \x3clabel id\x3d"',f,'" for\x3d"',g.id,'"'+(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e",CKEDITOR.tools.htmlEncode(c.label),"\x3c/label\x3e");return d.join("")})}},radio:function(b,c,d){if(!(3>arguments.length)){a.call(this,c);this._["default"]||(this._["default"]=this._.initValue=c.items[0][1]);c.validate&&(this.validate=c.validate);var e=[],f=this;c.role="radiogroup";c.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this,
|
|
554
|
+
b,c,d,function(){for(var a=[],d=[],g=(c.id?c.id:CKEDITOR.tools.getNextId())+"_radio",h=0;h<c.items.length;h++){var m=c.items[h],l=void 0!==m[2]?m[2]:m[0],A=void 0!==m[1]?m[1]:m[0],u=CKEDITOR.tools.getNextId()+"_radio_input",z=u+"_label",u=CKEDITOR.tools.extend({},c,{id:u,title:null,type:null},!0),l=CKEDITOR.tools.extend({},u,{title:l},!0),v={type:"radio","class":"cke_dialog_ui_radio_input",name:g,value:A,"aria-labelledby":z},D=[];f._["default"]==A&&(v.checked="checked");k(u);k(l);"undefined"!=typeof u.inputStyle&&
|
|
555
|
+
(u.style=u.inputStyle);u.keyboardFocusable=!0;e.push(new CKEDITOR.ui.dialog.uiElement(b,u,D,"input",null,v));D.push(" ");new CKEDITOR.ui.dialog.uiElement(b,l,D,"label",null,{id:z,"for":v.id},m[0]);a.push(D.join(""))}new CKEDITOR.ui.dialog.hbox(b,e,a,d);return d.join("")});this._.children=e}},button:function(b,c,d){if(arguments.length){"function"==typeof c&&(c=c(b.getParentEditor()));a.call(this,c,{disabled:c.disabled||!1});CKEDITOR.event.implementOn(this);var e=this;b.on("load",function(){var a=this.getElement();
|
|
556
556
|
(function(){a.on("click",function(a){e.click();a.data.preventDefault()});a.on("keydown",function(a){a.data.getKeystroke()in{32:1}&&(e.click(),a.data.preventDefault())})})();a.unselectable()},this);var f=CKEDITOR.tools.extend({},c);delete f.style;var g=CKEDITOR.tools.getNextId()+"_label";CKEDITOR.ui.dialog.uiElement.call(this,b,f,d,"a",null,{style:c.style,href:"javascript:void(0)",title:c.label,hidefocus:"true","class":c["class"],role:"button","aria-labelledby":g},'\x3cspan id\x3d"'+g+'" class\x3d"cke_dialog_ui_button"\x3e'+
|
|
557
|
-
CKEDITOR.tools.htmlEncode(c.label)+"\x3c/span\x3e")}},select:function(b,c,d){if(!(3>arguments.length)){var e=a.call(this,c);c.validate&&(this.validate=c.validate);e.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,c,d,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),d=[],f=[],
|
|
558
|
-
c.type,'" role\x3d"presentation"');c.width&&d.push('style\x3d"width:'+c.width+'" ');d.push("\x3e");void 0!==c.size&&(
|
|
559
|
-
|
|
557
|
+
CKEDITOR.tools.htmlEncode(c.label)+"\x3c/span\x3e")}},select:function(b,c,d){if(!(3>arguments.length)){var e=a.call(this,c);c.validate&&(this.validate=c.validate);e.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,c,d,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),d=[],f=[],g={id:e.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};d.push('\x3cdiv class\x3d"cke_dialog_ui_input_',
|
|
558
|
+
c.type,'" role\x3d"presentation"');c.width&&d.push('style\x3d"width:'+c.width+'" ');d.push("\x3e");void 0!==c.size&&(g.size=c.size);void 0!==c.multiple&&(g.multiple=c.multiple);k(a);for(var h=0,m;h<c.items.length&&(m=c.items[h]);h++)f.push('\x3coption value\x3d"',CKEDITOR.tools.htmlEncode(void 0!==m[1]?m[1]:m[0]).replace(/"/g,"\x26quot;"),'" /\x3e ',CKEDITOR.tools.htmlEncode(m[0]));"undefined"!=typeof a.inputStyle&&(a.style=a.inputStyle);e.select=new CKEDITOR.ui.dialog.uiElement(b,a,d,"select",null,
|
|
559
|
+
g,f.join(""));d.push("\x3c/div\x3e");return d.join("")})}},file:function(b,c,d){if(!(3>arguments.length)){void 0===c["default"]&&(c["default"]="");var e=CKEDITOR.tools.extend(a.call(this,c),{definition:c,buttons:[]});c.validate&&(this.validate=c.validate);b.on("load",function(){CKEDITOR.document.getById(e.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,c,d,function(){e.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var a=['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"',
|
|
560
560
|
e.frameId,'" title\x3d"',c.label,'" src\x3d"javascript:void('];a.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");a.push(')"\x3e\x3c/iframe\x3e');return a.join("")})}},fileButton:function(b,c,d){var e=this;if(!(3>arguments.length)){a.call(this,c);c.validate&&(this.validate=c.validate);var f=CKEDITOR.tools.extend({},c),g=f.onClick;f.className=(f.className?f.className+" ":"")+"cke_dialog_ui_button";f.onClick=function(a){var d=
|
|
561
561
|
c["for"];a=g?g.call(this,a):!1;!1!==a&&("xhr"!==a&&b.getContentElement(d[0],d[1]).submit(),this.disable())};b.on("load",function(){b.getContentElement(c["for"][0],c["for"][1])._.buttons.push(e)});CKEDITOR.ui.dialog.button.call(this,b,f,d)}},html:function(){var a=/^\s*<[\w:]+\s+([^>]*)?>/,c=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,d=/\/$/;return function(e,f,g){if(!(3>arguments.length)){var k=[],h=f.html;"\x3c"!=h.charAt(0)&&(h="\x3cspan\x3e"+h+"\x3c/span\x3e");var m=f.focus;if(m){var l=this.focus;
|
|
562
562
|
this.focus=function(){("function"==typeof m?m:l).call(this);this.fire("focus")};f.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,e,f,k,"span",null,null,"");k=k.join("").match(a);h=h.match(c)||["","",""];d.test(h[1])&&(h[1]=h[1].slice(0,-1),h[2]="/"+h[2]);g.push([h[1]," ",k[1]||"",h[2]].join(""))}}}(),fieldset:function(a,c,d,e,f){var g=f.label;this._={children:c};CKEDITOR.ui.dialog.uiElement.call(this,a,f,e,"fieldset",null,null,function(){var a=
|
|
@@ -579,65 +579,65 @@ new CKEDITOR.ui.dialog.button;CKEDITOR.ui.dialog.fieldset.prototype=CKEDITOR.too
|
|
|
579
579
|
h);CKEDITOR.dialog.addUIElement("html",h);CKEDITOR.dialog.addUIElement("fieldset",{build:function(a,c,d){for(var e=c.children,f,g=[],k=[],h=0;h<e.length&&(f=e[h]);h++){var m=[];g.push(m);k.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a,f,m))}return new CKEDITOR.ui.dialog[c.type](a,k,g,d,c)}})}});CKEDITOR.DIALOG_RESIZE_NONE=0;CKEDITOR.DIALOG_RESIZE_WIDTH=1;CKEDITOR.DIALOG_RESIZE_HEIGHT=2;CKEDITOR.DIALOG_RESIZE_BOTH=3;CKEDITOR.DIALOG_STATE_IDLE=1;CKEDITOR.DIALOG_STATE_BUSY=2;(function(){function a(a){a._.tabBarMode=
|
|
580
580
|
!0;a._.tabs[a._.currentTabId][0].focus();a._.currentFocusIndex=-1}function l(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId)+a,d=b-1;d>b-a;d--)if(this._.tabs[this._.tabIdList[d%a]][0].$.offsetHeight)return this._.tabIdList[d%a];return null}function h(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),d=b+1;d<b+a;d++)if(this._.tabs[this._.tabIdList[d%a]][0].$.offsetHeight)return this._.tabIdList[d%a];
|
|
581
581
|
return null}function f(a,b){for(var d=a.$.getElementsByTagName("input"),c=0,e=d.length;c<e;c++){var f=new CKEDITOR.dom.element(d[c]);"text"==f.getAttribute("type").toLowerCase()&&(b?(f.setAttribute("value",f.getCustomData("fake_value")||""),f.removeCustomData("fake_value")):(f.setCustomData("fake_value",f.getAttribute("value")),f.setAttribute("value","")))}}function e(a,b){var d=this.getInputElement();d&&(a?d.removeAttribute("aria-invalid"):d.setAttribute("aria-invalid",!0));a||(this.select?this.select():
|
|
582
|
-
this.focus());b&&alert(b);this.fire("validated",{valid:a,msg:b})}function m(){var a=this.getInputElement();a&&a.removeAttribute("aria-invalid")}function
|
|
582
|
+
this.focus());b&&alert(b);this.fire("validated",{valid:a,msg:b})}function m(){var a=this.getInputElement();a&&a.removeAttribute("aria-invalid")}function k(a){var b=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",M).output({id:CKEDITOR.tools.getNextNumber(),editorId:a.id,langDir:a.lang.dir,langCode:a.langCode,editorDialogClass:"cke_editor_"+a.name.replace(/\./g,"\\.")+"_dialog",closeTitle:a.lang.common.close,hidpi:CKEDITOR.env.hidpi?"cke_hidpi":""})),d=b.getChild([0,0,0,0,0]),c=d.getChild(0),
|
|
583
583
|
e=d.getChild(1);a.plugins.clipboard&&CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(d);!CKEDITOR.env.ie||CKEDITOR.env.quirks||CKEDITOR.env.edge||(a="javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())",CKEDITOR.dom.element.createFromHtml('\x3ciframe frameBorder\x3d"0" class\x3d"cke_iframe_shim" src\x3d"'+a+'" tabIndex\x3d"-1"\x3e\x3c/iframe\x3e').appendTo(d.getParent()));c.unselectable();e.unselectable();return{element:b,
|
|
584
|
-
parts:{dialog:b.getChild(0),title:c,close:e,tabs:d.getChild(2),contents:d.getChild([3,0,0,0]),footer:d.getChild([3,0,1,0])}}}function
|
|
585
|
-
function b(a){function b(){a.layout()}var d=CKEDITOR.document.getWindow();d.on("resize",b);a.on("hide",function(){d.removeListener("resize",b)})}function c(a,b){this.dialog=a;for(var c=b.contents,e=0,f;f=c[e];e++)c[e]=f&&new d(a,f);CKEDITOR.tools.extend(this,b)}function d(a,b){this._={dialog:a};CKEDITOR.tools.extend(this,b)}function n(a){function b(d){var h=a.getSize(),m=a.parts.dialog.getParent().getClientSize(),l=d.data.$.screenX,n=d.data.$.screenY,
|
|
586
|
-
k[3]<g?-k[3]:e.x-k[1]>m.width-h.width-g?m.width-h.width+("rtl"==f.lang.dir?0:k[1]):e.x;h=e.y+k[0]<g?-k[0]:e.y-k[2]>m.height-h.height-g?m.height-h.height+k[2]:e.y;l=Math.floor(l);h=Math.floor(h);a.move(l,h,1);d.data.preventDefault()}function d(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",d);if(CKEDITOR.env.ie6Compat){var a=
|
|
587
|
-
g=f.config.dialog_magnetDistance,k=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof g&&(g=20);a.parts.title.on("mousedown",function(f){if(!a._.moved){var g=a._.element;g.getFirst().setStyle("position","absolute");g.removeStyle("display");a._.moved=!0;a.layout()}c={x:f.data.$.screenX,y:f.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",d);e=a.getPosition();CKEDITOR.env.ie6Compat&&(g=
|
|
588
|
-
a)}function
|
|
589
|
-
e==CKEDITOR.DIALOG_RESIZE_BOTH)
|
|
590
|
-
a.getParentEditor(),g,k,h,m,l,n,
|
|
591
|
-
g=l.width-a.parts.contents.getFirst(e).getSize("width",1);m={x:c.screenX,y:c.screenY};h=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",d);CKEDITOR.env.ie6Compat&&(f=
|
|
592
|
-
b+" cke_resizer_"+f.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(f.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+
|
|
593
|
-
a._.viewportRatio=f}function y(a){a.data.preventDefault(1)}function
|
|
584
|
+
parts:{dialog:b.getChild(0),title:c,close:e,tabs:d.getChild(2),contents:d.getChild([3,0,0,0]),footer:d.getChild([3,0,1,0])}}}function g(a,b,d){this.element=b;this.focusIndex=d;this.tabIndex=0;this.isFocusable=function(){return!b.getAttribute("disabled")&&b.isVisible()};this.focus=function(){a._.currentFocusIndex=this.focusIndex;this.element.focus()};b.on("keydown",function(a){a.data.getKeystroke()in{32:1,13:1}&&this.fire("click")});b.on("focus",function(){this.fire("mouseover")});b.on("blur",function(){this.fire("mouseout")})}
|
|
585
|
+
function b(a){function b(){a.layout()}var d=CKEDITOR.document.getWindow();d.on("resize",b);a.on("hide",function(){d.removeListener("resize",b)})}function c(a,b){this.dialog=a;for(var c=b.contents,e=0,f;f=c[e];e++)c[e]=f&&new d(a,f);CKEDITOR.tools.extend(this,b)}function d(a,b){this._={dialog:a};CKEDITOR.tools.extend(this,b)}function n(a){function b(d){var h=a.getSize(),m=a.parts.dialog.getParent().getClientSize(),l=d.data.$.screenX,n=d.data.$.screenY,v=l-c.x,r=n-c.y;c={x:l,y:n};e.x+=v;e.y+=r;l=e.x+
|
|
586
|
+
k[3]<g?-k[3]:e.x-k[1]>m.width-h.width-g?m.width-h.width+("rtl"==f.lang.dir?0:k[1]):e.x;h=e.y+k[0]<g?-k[0]:e.y-k[2]>m.height-h.height-g?m.height-h.height+k[2]:e.y;l=Math.floor(l);h=Math.floor(h);a.move(l,h,1);d.data.preventDefault()}function d(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",d);if(CKEDITOR.env.ie6Compat){var a=B.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup",d)}}var c=null,e=null,f=a.getParentEditor(),
|
|
587
|
+
g=f.config.dialog_magnetDistance,k=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof g&&(g=20);a.parts.title.on("mousedown",function(f){if(!a._.moved){var g=a._.element;g.getFirst().setStyle("position","absolute");g.removeStyle("display");a._.moved=!0;a.layout()}c={x:f.data.$.screenX,y:f.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",d);e=a.getPosition();CKEDITOR.env.ie6Compat&&(g=B.getChild(0).getFrameDocument(),g.on("mousemove",b),g.on("mouseup",d));f.data.preventDefault()},
|
|
588
|
+
a)}function p(a){function b(d){var n="rtl"==f.lang.dir,v=l.width,r=l.height,p=v+(d.data.$.screenX-m.x)*(n?-1:1)*(a._.moved?1:2),x=r+(d.data.$.screenY-m.y)*(a._.moved?1:2),w=a._.element.getFirst(),w=n&&parseInt(w.getComputedStyle("right"),10),u=a.getPosition();u.x=u.x||0;u.y=u.y||0;u.y+x>h.height&&(x=h.height-u.y);(n?w:u.x)+p>h.width&&(p=h.width-(n?w:u.x));x=Math.floor(x);p=Math.floor(p);if(e==CKEDITOR.DIALOG_RESIZE_WIDTH||e==CKEDITOR.DIALOG_RESIZE_BOTH)v=Math.max(c.minWidth||0,p-g);if(e==CKEDITOR.DIALOG_RESIZE_HEIGHT||
|
|
589
|
+
e==CKEDITOR.DIALOG_RESIZE_BOTH)r=Math.max(c.minHeight||0,x-k);a.resize(v,r);a._.moved&&q(a,a._.position.x,a._.position.y);a._.moved||a.layout();d.data.preventDefault()}function d(){CKEDITOR.document.removeListener("mouseup",d);CKEDITOR.document.removeListener("mousemove",b);n&&(n.remove(),n=null);if(CKEDITOR.env.ie6Compat){var a=B.getChild(0).getFrameDocument();a.removeListener("mouseup",d);a.removeListener("mousemove",b)}}var c=a.definition,e=c.resizable;if(e!=CKEDITOR.DIALOG_RESIZE_NONE){var f=
|
|
590
|
+
a.getParentEditor(),g,k,h,m,l,n,v=CKEDITOR.tools.addFunction(function(c){function e(a){return a.isVisible()}l=a.getSize();var f=a.parts.contents,v=f.$.getElementsByTagName("iframe").length,r=!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks);v&&(n=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%; left:0; top:0;"\x3e\x3c/div\x3e'),f.append(n));k=l.height-a.parts.contents.getFirst(e).getSize("height",r);
|
|
591
|
+
g=l.width-a.parts.contents.getFirst(e).getSize("width",1);m={x:c.screenX,y:c.screenY};h=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",d);CKEDITOR.env.ie6Compat&&(f=B.getChild(0).getFrameDocument(),f.on("mousemove",b),f.on("mouseup",d));c.preventDefault&&c.preventDefault()});a.on("load",function(){var b="";e==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":e==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer'+
|
|
592
|
+
b+" cke_resizer_"+f.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(f.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+v+', event )"\x3e'+("ltr"==f.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(b,1)});f.on("destroy",function(){CKEDITOR.tools.removeFunction(v)})}}function q(a,b,d){var c=a.parts.dialog.getParent().getClientSize(),e=a.getSize(),f=a._.viewportRatio,g=Math.max(c.width-e.width,0),c=Math.max(c.height-e.height,0);f.width=g?b/g:f.width;f.height=c?d/c:f.height;
|
|
593
|
+
a._.viewportRatio=f}function y(a){a.data.preventDefault(1)}function t(a){var b=a.config,d=CKEDITOR.skinName||a.config.skin,c=b.dialog_backgroundCoverColor||("moono-lisa"==d?"black":"white"),d=b.dialog_backgroundCoverOpacity,e=b.baseFloatZIndex,b=CKEDITOR.tools.genKey(c,d,e),f=H[b];CKEDITOR.document.getBody().addClass("cke_dialog_open");f?f.show():(e=['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",e,"; top: 0px; left: 0px; ","; width: 100%; height: 100%;",
|
|
594
594
|
CKEDITOR.env.ie6Compat?"":"background-color: "+c,'" class\x3d"cke_dialog_background_cover"\x3e'],CKEDITOR.env.ie6Compat&&(c="\x3chtml\x3e\x3cbody style\x3d\\'background-color:"+c+";\\'\x3e\x3c/body\x3e\x3c/html\x3e",e.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'),e.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.write( '"+c+"' );document.close();")+"})())"),e.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')),
|
|
595
|
-
e.push("\x3c/div\x3e"),f=CKEDITOR.dom.element.createFromHtml(e.join("")),f.setOpacity(void 0!==d?d:.5),f.on("keydown",y),f.on("keypress",y),f.on("keyup",y),f.appendTo(CKEDITOR.document.getBody()),H[b]=f);a.focusManager.add(f);
|
|
596
|
-
(b=
|
|
597
|
-
dialog:b,key:d,keyup:e||a.accessKeyUp,keydown:c||a.accessKeyDown})}function
|
|
595
|
+
e.push("\x3c/div\x3e"),f=CKEDITOR.dom.element.createFromHtml(e.join("")),f.setOpacity(void 0!==d?d:.5),f.on("keydown",y),f.on("keypress",y),f.on("keyup",y),f.appendTo(CKEDITOR.document.getBody()),H[b]=f);a.focusManager.add(f);B=f;CKEDITOR.env.mac&&CKEDITOR.env.webkit||f.focus()}function w(a){CKEDITOR.document.getBody().removeClass("cke_dialog_open");B&&(a.focusManager.remove(B),B.hide())}function x(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,d=a.data.$.altKey,c=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);
|
|
596
|
+
(b=K[(b?"CTRL+":"")+(d?"ALT+":"")+(c?"SHIFT+":"")+e])&&b.length&&(b=b[b.length-1],b.keydown&&b.keydown.call(b.uiElement,b.dialog,b.key),a.data.preventDefault())}function r(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,d=a.data.$.altKey,c=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);(b=K[(b?"CTRL+":"")+(d?"ALT+":"")+(c?"SHIFT+":"")+e])&&b.length&&(b=b[b.length-1],b.keyup&&(b.keyup.call(b.uiElement,b.dialog,b.key),a.data.preventDefault()))}function A(a,b,d,c,e){(K[d]||(K[d]=[])).push({uiElement:a,
|
|
597
|
+
dialog:b,key:d,keyup:e||a.accessKeyUp,keydown:c||a.accessKeyDown})}function u(a){for(var b in K){for(var d=K[b],c=d.length-1;0<=c;c--)d[c].dialog!=a&&d[c].uiElement!=a||d.splice(c,1);0===d.length&&delete K[b]}}function z(a,b){a._.accessKeyMap[b]&&a.selectPage(a._.accessKeyMap[b])}function v(){}var D=CKEDITOR.tools.cssLength,C,B,G=!CKEDITOR.env.ie||CKEDITOR.env.edge,M='\x3cdiv class\x3d"cke_reset_all cke_dialog_container {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" style\x3d"'+(G?"display:flex":
|
|
598
598
|
"")+'" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog '+CKEDITOR.env.cssClass+' cke_{langDir}" style\x3d"'+(G?"margin:auto":"position:absolute")+'" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd role\x3d"presentation"\x3e\x3cdiv class\x3d"cke_dialog_body" role\x3d"presentation"\x3e\x3cdiv id\x3d"cke_dialog_title_{id}" class\x3d"cke_dialog_title" role\x3d"presentation"\x3e\x3c/div\x3e\x3ca id\x3d"cke_dialog_close_button_{id}" class\x3d"cke_dialog_close_button" href\x3d"javascript:void(0)" title\x3d"{closeTitle}" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e\x3cdiv id\x3d"cke_dialog_tabs_{id}" class\x3d"cke_dialog_tabs" role\x3d"tablist"\x3e\x3c/div\x3e\x3ctable class\x3d"cke_dialog_contents" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_contents_{id}" class\x3d"cke_dialog_contents_body" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_footer_{id}" class\x3d"cke_dialog_footer" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e';
|
|
599
|
-
CKEDITOR.dialog=function(b,d){function f(){var a=
|
|
600
|
-
|
|
601
|
-
l.call(
|
|
602
|
-
-1,
|
|
603
|
-
buttons:{},accessKeyMap:{},viewportRatio:{width:.5,height:.5},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:!1,focusList:[],currentFocusIndex:0,hasFocus:!1};this.parts=
|
|
604
|
-
{name:d,definition:
|
|
605
|
-
function(a){b.fire("saveSnapshot");setTimeout(function(){b.fire("saveSnapshot")},0);!1===
|
|
606
|
-
e.call(b,!c,"string"==typeof d?d:void 0);return c}})},this,null,0);this.on("cancel",function(a){y(function(d){if(d.isChanged())return b.config.dialog_noConfirmCancel||confirm(b.lang.common.confirmCancel)||(a.data.hide=!1),!0})},this,null,0);this.parts.close.on("click",function(a){!1!==this.fire("cancel",{hide:!0}).hide&&this.hide();a.data.preventDefault()},this);this.changeFocus=
|
|
607
|
-
|
|
608
|
-
1,
|
|
609
|
-
a(this),b.data.preventDefault())},this);
|
|
599
|
+
CKEDITOR.dialog=function(b,d){function f(){var a=B._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,d=0;d<b;d++)a[d].focusIndex=d}function g(a){var b=B._.focusList;a=a||0;if(!(1>b.length)){var d=B._.currentFocusIndex;B._.tabBarMode&&0>a&&(d=0);try{b[d].getInputElement().$.blur()}catch(c){}var e=d,f=1<B._.pageCount;do{e+=a;if(f&&!B._.tabBarMode&&(e==b.length||-1==e)){B._.tabBarMode=!0;B._.tabs[B._.currentTabId][0].focus();
|
|
600
|
+
B._.currentFocusIndex=-1;return}e=(e+b.length)%b.length;if(e==d)break}while(a&&!b[e].isFocusable());b[e].focus();"text"==b[e].type&&b[e].select()}}function v(d){if(B==CKEDITOR.dialog._.currentTop){var c=d.data.getKeystroke(),e="rtl"==b.lang.dir,f=[37,38,39,40];q=D=0;if(9==c||c==CKEDITOR.SHIFT+9)g(c==CKEDITOR.SHIFT+9?-1:1),q=1;else if(c==CKEDITOR.ALT+121&&!B._.tabBarMode&&1<B.getPageCount())a(B),q=1;else if(-1!=CKEDITOR.tools.indexOf(f,c)&&B._.tabBarMode)c=-1!=CKEDITOR.tools.indexOf([e?39:37,38],c)?
|
|
601
|
+
l.call(B):h.call(B),B.selectPage(c),B._.tabs[c][0].focus(),q=1;else if(13!=c&&32!=c||!B._.tabBarMode)if(13==c)c=d.data.getTarget(),c.is("a","button","select","textarea")||c.is("input")&&"button"==c.$.type||((c=this.getButton("ok"))&&CKEDITOR.tools.setTimeout(c.click,0,c),q=1),D=1;else if(27==c)(c=this.getButton("cancel"))?CKEDITOR.tools.setTimeout(c.click,0,c):!1!==this.fire("cancel",{hide:!0}).hide&&this.hide(),D=1;else return;else this.selectPage(this._.currentTabId),this._.tabBarMode=!1,this._.currentFocusIndex=
|
|
602
|
+
-1,g(1),q=1;r(d)}}function r(a){q?a.data.preventDefault(1):D&&a.data.stopPropagation()}var x=CKEDITOR.dialog._.dialogDefinitions[d],w=CKEDITOR.tools.clone(C),u=b.config.dialog_buttonsOrder||"OS",A=b.lang.dir,z={},q,D;("OS"==u&&CKEDITOR.env.mac||"rtl"==u&&"ltr"==A||"ltr"==u&&"rtl"==A)&&w.buttons.reverse();x=CKEDITOR.tools.extend(x(b),w);x=CKEDITOR.tools.clone(x);x=new c(this,x);w=k(b);this._={editor:b,element:w.element,name:d,model:null,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},
|
|
603
|
+
buttons:{},accessKeyMap:{},viewportRatio:{width:.5,height:.5},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:!1,focusList:[],currentFocusIndex:0,hasFocus:!1};this.parts=w.parts;CKEDITOR.tools.setTimeout(function(){b.fire("ariaWidget",this.parts.contents)},0,this);w={top:0,visibility:"hidden"};CKEDITOR.env.ie6Compat&&(w.position="absolute");w["rtl"==A?"right":"left"]=0;this.parts.dialog.setStyles(w);CKEDITOR.event.call(this);this.definition=x=CKEDITOR.fire("dialogDefinition",
|
|
604
|
+
{name:d,definition:x,dialog:this},b).definition;if(!("removeDialogTabs"in b._)&&b.config.removeDialogTabs){w=b.config.removeDialogTabs.split(";");for(A=0;A<w.length;A++)if(u=w[A].split(":"),2==u.length){var t=u[0];z[t]||(z[t]=[]);z[t].push(u[1])}b._.removeDialogTabs=z}if(b._.removeDialogTabs&&(z=b._.removeDialogTabs[d]))for(A=0;A<z.length;A++)x.removeContents(z[A]);if(x.onLoad)this.on("load",x.onLoad);if(x.onShow)this.on("show",x.onShow);if(x.onHide)this.on("hide",x.onHide);if(x.onOk)this.on("ok",
|
|
605
|
+
function(a){b.fire("saveSnapshot");setTimeout(function(){b.fire("saveSnapshot")},0);!1===x.onOk.call(this,a)&&(a.data.hide=!1)});this.state=CKEDITOR.DIALOG_STATE_IDLE;if(x.onCancel)this.on("cancel",function(a){!1===x.onCancel.call(this,a)&&(a.data.hide=!1)});var B=this,y=function(a){var b=B._.contents,d=!1,c;for(c in b)for(var e in b[c])if(d=a.call(this,b[c][e]))return};this.on("ok",function(a){y(function(b){if(b.validate){var d=b.validate(this),c="string"==typeof d||!1===d;c&&(a.data.hide=!1,a.stop());
|
|
606
|
+
e.call(b,!c,"string"==typeof d?d:void 0);return c}})},this,null,0);this.on("cancel",function(a){y(function(d){if(d.isChanged())return b.config.dialog_noConfirmCancel||confirm(b.lang.common.confirmCancel)||(a.data.hide=!1),!0})},this,null,0);this.parts.close.on("click",function(a){!1!==this.fire("cancel",{hide:!0}).hide&&this.hide();a.data.preventDefault()},this);this.changeFocus=g;var G=this._.element;b.focusManager.add(G,1);this.on("show",function(){G.on("keydown",v,this);if(CKEDITOR.env.gecko)G.on("keypress",
|
|
607
|
+
r,this)});this.on("hide",function(){G.removeListener("keydown",v);CKEDITOR.env.gecko&&G.removeListener("keypress",r);y(function(a){m.apply(a)})});this.on("iframeAdded",function(a){(new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown",v,this,null,0)});this.on("show",function(){f();var a=1<B._.pageCount;b.config.dialog_startupFocusTab&&a?(B._.tabBarMode=!0,B._.tabs[B._.currentTabId][0].focus(),B._.currentFocusIndex=-1):this._.hasFocus||(this._.currentFocusIndex=a?-1:this._.focusList.length-
|
|
608
|
+
1,x.onFocus?(a=x.onFocus.call(this))&&a.focus():g(1))},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on("load",function(){var a=this.getElement(),b=a.getFirst();b.remove();b.appendTo(a)},this);n(this);p(this);(new CKEDITOR.dom.text(x.title,CKEDITOR.document)).appendTo(this.parts.title);for(A=0;A<x.contents.length;A++)(z=x.contents[A])&&this.addPage(z);this.parts.tabs.on("click",function(b){var d=b.data.getTarget();d.hasClass("cke_dialog_tab")&&(d=d.$.id,this.selectPage(d.substring(4,d.lastIndexOf("_"))),
|
|
609
|
+
a(this),b.data.preventDefault())},this);A=[];z=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:x.buttons},A).getChild();this.parts.footer.setHtml(A.join(""));for(A=0;A<z.length;A++)this._.buttons[z[A].id]=z[A]};CKEDITOR.dialog.prototype={destroy:function(){this.hide();this._.element.remove()},resize:function(a,b){if(!this._.contentSize||this._.contentSize.width!=a||this._.contentSize.height!=b){CKEDITOR.dialog.fire("resize",
|
|
610
610
|
{dialog:this,width:a,height:b},this._.editor);this.fire("resize",{width:a,height:b},this._.editor);this.parts.contents.setStyles({width:a+"px",height:b+"px"});if("rtl"==this._.editor.lang.dir&&this._.position){var d=this.parts.dialog.getParent().getClientSize().width;this._.position.x=d-this._.contentSize.width-parseInt(this._.element.getFirst().getStyle("right"),10)}this._.contentSize={width:a,height:b}}},getSize:function(){var a=this._.element.getFirst();return{width:a.$.offsetWidth||0,height:a.$.offsetHeight||
|
|
611
|
-
0}},move:function(a,b,d){var c=this._.element.getFirst(),e="rtl"==this._.editor.lang.dir;CKEDITOR.env.ie&&c.setStyle("zoom","100%");var f=this.parts.dialog.getParent().getClientSize(),g=this.getSize(),k=this._.viewportRatio,h=Math.max(f.width-g.width,0),f=Math.max(f.height-g.height,0);this._.position&&this._.position.x==a&&this._.position.y==b?(a=Math.floor(h*k.width),b=Math.floor(f*k.height)):
|
|
611
|
+
0}},move:function(a,b,d){var c=this._.element.getFirst(),e="rtl"==this._.editor.lang.dir;CKEDITOR.env.ie&&c.setStyle("zoom","100%");var f=this.parts.dialog.getParent().getClientSize(),g=this.getSize(),k=this._.viewportRatio,h=Math.max(f.width-g.width,0),f=Math.max(f.height-g.height,0);this._.position&&this._.position.x==a&&this._.position.y==b?(a=Math.floor(h*k.width),b=Math.floor(f*k.height)):q(this,a,b);this._.position={x:a,y:b};e&&(a=h-a);b={top:(0<b?b:0)+"px"};b[e?"right":"left"]=(0<a?a:0)+"px";
|
|
612
612
|
c.setStyles(b);d&&(this._.moved=1)},getPosition:function(){return CKEDITOR.tools.extend({},this._.position)},show:function(){var a=this._.element,d=this.definition,c=CKEDITOR.document.getBody(),e=this._.editor.config.baseFloatZIndex;a.getParent()&&a.getParent().equals(c)?a.setStyle("display",G?"flex":"block"):a.appendTo(c);this.resize(this._.contentSize&&this._.contentSize.width||d.width||d.minWidth,this._.contentSize&&this._.contentSize.height||d.height||d.minHeight);this.reset();null===this._.currentTabId&&
|
|
613
|
-
this.selectPage(this.definition.contents[0].id);null===CKEDITOR.dialog._.currentZIndex&&(CKEDITOR.dialog._.currentZIndex=e);this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex+=10);this.getElement().setStyle("z-index",CKEDITOR.dialog._.currentZIndex);null===CKEDITOR.dialog._.currentTop?(CKEDITOR.dialog._.currentTop=this,this._.parentDialog=null,
|
|
614
|
-
Math.floor(e/2),this._.parentDialog.getElement().setStyle("z-index",c.$.style.zIndex),CKEDITOR.dialog._.currentTop=this);a.on("keydown",
|
|
613
|
+
this.selectPage(this.definition.contents[0].id);null===CKEDITOR.dialog._.currentZIndex&&(CKEDITOR.dialog._.currentZIndex=e);this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex+=10);this.getElement().setStyle("z-index",CKEDITOR.dialog._.currentZIndex);null===CKEDITOR.dialog._.currentTop?(CKEDITOR.dialog._.currentTop=this,this._.parentDialog=null,t(this._.editor)):(this._.parentDialog=CKEDITOR.dialog._.currentTop,c=this._.parentDialog.getElement().getFirst(),c.$.style.zIndex-=
|
|
614
|
+
Math.floor(e/2),this._.parentDialog.getElement().setStyle("z-index",c.$.style.zIndex),CKEDITOR.dialog._.currentTop=this);a.on("keydown",x);a.on("keyup",r);this._.hasFocus=!1;for(var f in d.contents)if(d.contents[f]){var a=d.contents[f],e=this._.tabs[a.id],c=a.requiredContent,g=0;if(e){for(var k in this._.contents[a.id]){var h=this._.contents[a.id][k];"hbox"!=h.type&&"vbox"!=h.type&&h.getInputElement()&&(h.requiredContent&&!this._.editor.activeFilter.check(h.requiredContent)?h.disable():(h.enable(),
|
|
615
615
|
g++))}!g||c&&!this._.editor.activeFilter.check(c)?e[0].addClass("cke_dialog_tab_disabled"):e[0].removeClass("cke_dialog_tab_disabled")}}CKEDITOR.tools.setTimeout(function(){this.layout();b(this);this.parts.dialog.setStyle("visibility","");this.fireOnce("load",{});CKEDITOR.ui.fire("ready",this);this.fire("show",{});this._.editor.fire("dialogShow",this);this._.parentDialog||this._.editor.focusManager.lock();this.foreach(function(a){a.setInitValue&&a.setInitValue()})},100,this)},layout:function(){var a=
|
|
616
616
|
this.parts.dialog;if(this._.moved||!G){var b=this.getSize(),d=CKEDITOR.document.getWindow().getViewPaneSize(),c;this._.moved&&this._.position?(c=this._.position.x,b=this._.position.y):(c=(d.width-b.width)/2,b=(d.height-b.height)/2);CKEDITOR.env.ie6Compat||(a.setStyle("position","absolute"),a.removeStyle("margin"));c=Math.floor(c);b=Math.floor(b);this.move(c,b)}},foreach:function(a){for(var b in this._.contents)for(var d in this._.contents[b])a.call(this,this._.contents[b][d]);return this},reset:function(){var a=
|
|
617
617
|
function(a){a.reset&&a.reset(1)};return function(){this.foreach(a);return this}}(),setupContent:function(){var a=arguments;this.foreach(function(b){b.setup&&b.setup.apply(b,a)})},commitContent:function(){var a=arguments;this.foreach(function(b){CKEDITOR.env.ie&&this._.currentFocusIndex==b.focusIndex&&b.getInputElement().$.blur();b.commit&&b.commit.apply(b,a)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{});this._.editor.fire("dialogHide",this);this.selectPage(this._.tabIdList[0]);
|
|
618
|
-
var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility","hidden");for(
|
|
619
|
-
10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",
|
|
618
|
+
var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility","hidden");for(u(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var b=this._.parentDialog.getElement().getFirst();this._.parentDialog.getElement().removeStyle("z-index");b.setStyle("z-index",parseInt(b.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else w(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=
|
|
619
|
+
10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",x);a.removeListener("keyup",r);var d=this._.editor;d.focus();setTimeout(function(){d.focusManager.unlock();CKEDITOR.env.iOS&&d.window.focus()},0)}delete this._.parentDialog;this.foreach(function(a){a.resetInitValue&&a.resetInitValue()});this.setState(CKEDITOR.DIALOG_STATE_IDLE)}},addPage:function(a){if(!a.requiredContent||this._.editor.filter.check(a.requiredContent)){for(var b=[],d=a.label?' title\x3d"'+CKEDITOR.tools.htmlEncode(a.label)+
|
|
620
620
|
'"':"",c=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents",children:a.elements,expand:!!a.expand,padding:a.padding,style:a.style||"width: 100%;"},b),e=this._.contents[a.id]={},f=c.getChild(),g=0;c=f.shift();)c.notAllowed||"hbox"==c.type||"vbox"==c.type||g++,e[c.id]=c,"function"==typeof c.getChild&&f.push.apply(f,c.getChild());g||(a.hidden=!0);b=CKEDITOR.dom.element.createFromHtml(b.join(""));b.setAttribute("role","tabpanel");b.setStyle("min-height",
|
|
621
621
|
"100%");c=CKEDITOR.env;e="cke_"+a.id+"_"+CKEDITOR.tools.getNextNumber();d=CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"',0<this._.pageCount?" cke_last":"cke_first",d,a.hidden?' style\x3d"display:none"':"",' id\x3d"',e,'"',c.gecko&&!c.hc?"":' href\x3d"javascript:void(0)"',' tabIndex\x3d"-1" hidefocus\x3d"true" role\x3d"tab"\x3e',a.label,"\x3c/a\x3e"].join(""));b.setAttribute("aria-labelledby",e);this._.tabs[a.id]=[d,b];this._.tabIdList.push(a.id);!a.hidden&&this._.pageCount++;
|
|
622
|
-
this._.lastTab=d;this.updateStyle();b.setAttribute("name",a.id);b.appendTo(this.parts.contents);d.unselectable();this.parts.tabs.append(d);a.accessKey&&(
|
|
622
|
+
this._.lastTab=d;this.updateStyle();b.setAttribute("name",a.id);b.appendTo(this.parts.contents);d.unselectable();this.parts.tabs.append(d);a.accessKey&&(A(this,this,"CTRL+"+a.accessKey,v,z),this._.accessKeyMap["CTRL+"+a.accessKey]=a.id)}},selectPage:function(a){if(this._.currentTabId!=a&&!this._.tabs[a][0].hasClass("cke_dialog_tab_disabled")&&!1!==this.fire("selectPage",{page:a,currentPage:this._.currentTabId})){for(var b in this._.tabs){var d=this._.tabs[b][0],c=this._.tabs[b][1];b!=a&&(d.removeClass("cke_dialog_tab_selected"),
|
|
623
623
|
d.removeAttribute("aria-selected"),c.hide());c.setAttribute("aria-hidden",b!=a)}var e=this._.tabs[a];e[0].addClass("cke_dialog_tab_selected");e[0].setAttribute("aria-selected",!0);CKEDITOR.env.ie6Compat||CKEDITOR.env.ie7Compat?(f(e[1]),e[1].show(),setTimeout(function(){f(e[1],1)},0)):e[1].show();this._.currentTabId=a;this._.currentTabIndex=CKEDITOR.tools.indexOf(this._.tabIdList,a)}},updateStyle:function(){this.parts.dialog[(1===this._.pageCount?"add":"remove")+"Class"]("cke_single_page")},hidePage:function(a){var b=
|
|
624
624
|
this._.tabs[a]&&this._.tabs[a][0];b&&1!=this._.pageCount&&b.isVisible()&&(a==this._.currentTabId&&this.selectPage(l.call(this)),b.hide(),this._.pageCount--,this.updateStyle())},showPage:function(a){if(a=this._.tabs[a]&&this._.tabs[a][0])a.show(),this._.pageCount++,this.updateStyle()},getElement:function(){return this._.element},getName:function(){return this._.name},getContentElement:function(a,b){var d=this._.contents[a];return d&&d[b]},getValueOf:function(a,b){return this.getContentElement(a,b).getValue()},
|
|
625
625
|
setValueOf:function(a,b,d){return this.getContentElement(a,b).setValue(d)},getButton:function(a){return this._.buttons[a]},click:function(a){return this._.buttons[a].click()},disableButton:function(a){return this._.buttons[a].disable()},enableButton:function(a){return this._.buttons[a].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},addFocusable:function(a,
|
|
626
|
-
b){if("undefined"==typeof b)b=this._.focusList.length,this._.focusList.push(new
|
|
626
|
+
b){if("undefined"==typeof b)b=this._.focusList.length,this._.focusList.push(new g(this,a,b));else{this._.focusList.splice(b,0,new g(this,a,b));for(var d=b+1;d<this._.focusList.length;d++)this._.focusList[d].focusIndex++}},setState:function(a){if(this.state!=a){this.state=a;if(a==CKEDITOR.DIALOG_STATE_BUSY){if(!this.parts.spinner){var b=this.getParentEditor().lang.dir,d={attributes:{"class":"cke_dialog_spinner"},styles:{"float":"rtl"==b?"right":"left"}};d.styles["margin-"+("rtl"==b?"left":"right")]=
|
|
627
627
|
"8px";this.parts.spinner=CKEDITOR.document.createElement("div",d);this.parts.spinner.setHtml("\x26#8987;");this.parts.spinner.appendTo(this.parts.title,1)}this.parts.spinner.show();this.getButton("ok").disable()}else a==CKEDITOR.DIALOG_STATE_IDLE&&(this.parts.spinner&&this.parts.spinner.hide(),this.getButton("ok").enable());this.fire("state",a)}},getModel:function(a){return this._.model?this._.model:this.definition.getModel?this.definition.getModel(a):null},setModel:function(a){this._.model=a},getMode:function(a){if(this.definition.getMode)return this.definition.getMode(a);
|
|
628
628
|
a=this.getModel(a);return!a||a instanceof CKEDITOR.dom.element&&!a.getParent()?CKEDITOR.dialog.CREATION_MODE:CKEDITOR.dialog.EDITING_MODE}};CKEDITOR.tools.extend(CKEDITOR.dialog,{CREATION_MODE:0,EDITING_MODE:1,add:function(a,b){this._.dialogDefinitions[a]&&"function"!=typeof b||(this._.dialogDefinitions[a]=b)},exists:function(a){return!!this._.dialogDefinitions[a]},getCurrent:function(){return CKEDITOR.dialog._.currentTop},isTabEnabled:function(a,b,d){a=a.config.removeDialogTabs;return!(a&&a.match(new RegExp("(?:^|;)"+
|
|
629
629
|
b+":"+d+"(?:$|;)","i")))},okButton:function(){var a=function(a,b){b=b||{};return CKEDITOR.tools.extend({id:"ok",type:"button",label:a.lang.common.ok,"class":"cke_dialog_ui_button_ok",onClick:function(a){a=a.data.dialog;!1!==a.fire("ok",{hide:!0}).hide&&a.hide()}},b,!0)};a.type="button";a.override=function(b){return CKEDITOR.tools.extend(function(d){return a(d,b)},{type:"button"},!0)};return a}(),cancelButton:function(){var a=function(a,b){b=b||{};return CKEDITOR.tools.extend({id:"cancel",type:"button",
|
|
630
630
|
label:a.lang.common.cancel,"class":"cke_dialog_ui_button_cancel",onClick:function(a){a=a.data.dialog;!1!==a.fire("cancel",{hide:!0}).hide&&a.hide()}},b,!0)};a.type="button";a.override=function(b){return CKEDITOR.tools.extend(function(d){return a(d,b)},{type:"button"},!0)};return a}(),addUIElement:function(a,b){this._.uiElementBuilders[a]=b}});CKEDITOR.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};CKEDITOR.event.implementOn(CKEDITOR.dialog);CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);
|
|
631
|
-
C={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]};var
|
|
632
|
-
b,d)))return e}return null};c.prototype={getContents:function(a){return
|
|
633
|
-
"children")}};var H={},
|
|
634
|
-
1);b.disabled&&(
|
|
635
|
-
for(
|
|
636
|
-
function(a){return function(){return b.getValue.call(this,a.call(this))}}));CKEDITOR.event.implementOn(this);this.registerEvents(b);this.accessKeyUp&&this.accessKeyDown&&b.accessKey&&
|
|
637
|
-
d&&this.removeClass(d)})}});CKEDITOR.tools.extend(this,b);this.keyboardFocusable&&(this.tabIndex=b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=
|
|
638
|
-
['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];for(h=0;h<d.length;h++){var b="cke_dialog_ui_hbox_child",c=[];0===h&&(b="cke_dialog_ui_hbox_first");h==d.length-1&&(b="cke_dialog_ui_hbox_last");a.push('\x3ctd class\x3d"',b,'" role\x3d"presentation" ');g?g[h]&&c.push("width:"+
|
|
631
|
+
C={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]};var J=function(a,b,d){for(var c=0,e;e=a[c];c++)if(e.id==b||d&&e[d]&&(e=J(e[d],b,d)))return e;return null},E=function(a,b,d,c,e){if(d){for(var f=0,g;g=a[f];f++){if(g.id==d)return a.splice(f,0,b),b;if(c&&g[c]&&(g=E(g[c],b,d,c,!0)))return g}if(e)return null}a.push(b);return b},L=function(a,b,d){for(var c=0,e;e=a[c];c++){if(e.id==b)return a.splice(c,1);if(d&&e[d]&&(e=L(e[d],
|
|
632
|
+
b,d)))return e}return null};c.prototype={getContents:function(a){return J(this.contents,a)},getButton:function(a){return J(this.buttons,a)},addContents:function(a,b){return E(this.contents,a,b)},addButton:function(a,b){return E(this.buttons,a,b)},removeContents:function(a){L(this.contents,a)},removeButton:function(a){L(this.buttons,a)}};d.prototype={get:function(a){return J(this.elements,a,"children")},add:function(a,b){return E(this.elements,a,b,"children")},remove:function(a){L(this.elements,a,
|
|
633
|
+
"children")}};var H={},K={};(function(){CKEDITOR.ui.dialog={uiElement:function(a,b,d,c,e,f,g){if(!(4>arguments.length)){var k=(c.call?c(b):c)||"div",h=["\x3c",k," "],m=(e&&e.call?e(b):e)||{},l=(f&&f.call?f(b):f)||{},n=(g&&g.call?g.call(this,a,b):g)||"",v=this.domId=l.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(m.display="none",this.notAllowed=!0);l.id=v;var r={};b.type&&(r["cke_dialog_ui_"+b.type]=1);b.className&&(r[b.className]=
|
|
634
|
+
1);b.disabled&&(r.cke_disabled=1);for(var p=l["class"]&&l["class"].split?l["class"].split(" "):[],v=0;v<p.length;v++)p[v]&&(r[p[v]]=1);p=[];for(v in r)p.push(v);l["class"]=p.join(" ");b.title&&(l.title=b.title);r=(b.style||"").split(";");b.align&&(p=b.align,m["margin-left"]="left"==p?0:"auto",m["margin-right"]="right"==p?0:"auto");for(v in m)r.push(v+":"+m[v]);b.hidden&&r.push("display:none");for(v=r.length-1;0<=v;v--)""===r[v]&&r.splice(v,1);0<r.length&&(l.style=(l.style?l.style+"; ":"")+r.join("; "));
|
|
635
|
+
for(v in l)h.push(v+'\x3d"'+CKEDITOR.tools.htmlEncode(l[v])+'" ');h.push("\x3e",n,"\x3c/",k,"\x3e");d.push(h.join(""));(this._||(this._={})).dialog=a;"boolean"==typeof b.isChanged&&(this.isChanged=function(){return b.isChanged});"function"==typeof b.isChanged&&(this.isChanged=b.isChanged);"function"==typeof b.setValue&&(this.setValue=CKEDITOR.tools.override(this.setValue,function(a){return function(d){a.call(this,b.setValue.call(this,d))}}));"function"==typeof b.getValue&&(this.getValue=CKEDITOR.tools.override(this.getValue,
|
|
636
|
+
function(a){return function(){return b.getValue.call(this,a.call(this))}}));CKEDITOR.event.implementOn(this);this.registerEvents(b);this.accessKeyUp&&this.accessKeyDown&&b.accessKey&&A(this,a,"CTRL+"+b.accessKey);var x=this;a.on("load",function(){var b=x.getInputElement();if(b){var d=x.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&8>CKEDITOR.env.version?"cke_dialog_ui_focused":"";b.on("focus",function(){a._.tabBarMode=!1;a._.hasFocus=!0;x.fire("focus");d&&this.addClass(d)});b.on("blur",function(){x.fire("blur");
|
|
637
|
+
d&&this.removeClass(d)})}});CKEDITOR.tools.extend(this,b);this.keyboardFocusable&&(this.tabIndex=b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=x.focusIndex}))}},hbox:function(a,b,d,c,e){if(!(4>arguments.length)){this._||(this._={});var f=this._.children=b,g=e&&e.widths||null,k=e&&e.height||null,h,m={role:"presentation"};e&&e.align&&(m.align=e.align);CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"hbox"},c,"table",{},m,function(){var a=
|
|
638
|
+
['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];for(h=0;h<d.length;h++){var b="cke_dialog_ui_hbox_child",c=[];0===h&&(b="cke_dialog_ui_hbox_first");h==d.length-1&&(b="cke_dialog_ui_hbox_last");a.push('\x3ctd class\x3d"',b,'" role\x3d"presentation" ');g?g[h]&&c.push("width:"+D(g[h])):c.push("width:"+Math.floor(100/d.length)+"%");k&&c.push("height:"+D(k));e&&void 0!==e.padding&&c.push("padding:"+D(e.padding));CKEDITOR.env.ie&&CKEDITOR.env.quirks&&f[h].align&&c.push("text-align:"+f[h].align);
|
|
639
639
|
0<c.length&&a.push('style\x3d"'+c.join("; ")+'" ');a.push("\x3e",d[h],"\x3c/td\x3e")}a.push("\x3c/tr\x3e\x3c/tbody\x3e");return a.join("")})}},vbox:function(a,b,d,c,e){if(!(3>arguments.length)){this._||(this._={});var f=this._.children=b,g=e&&e.width||null,k=e&&e.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"vbox"},c,"div",null,{role:"presentation"},function(){var b=['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" '];b.push('style\x3d"');e&&e.expand&&b.push("height:100%;");
|
|
640
|
-
b.push("width:"+
|
|
640
|
+
b.push("width:"+D(g||"100%"),";");CKEDITOR.env.webkit&&b.push("float:none;");b.push('"');b.push('align\x3d"',CKEDITOR.tools.htmlEncode(e&&e.align||("ltr"==a.getParentEditor().lang.dir?"left":"right")),'" ');b.push("\x3e\x3ctbody\x3e");for(var c=0;c<d.length;c++){var h=[];b.push('\x3ctr\x3e\x3ctd role\x3d"presentation" ');g&&h.push("width:"+D(g||"100%"));k?h.push("height:"+D(k[c])):e&&e.expand&&h.push("height:"+Math.floor(100/d.length)+"%");e&&void 0!==e.padding&&h.push("padding:"+D(e.padding));CKEDITOR.env.ie&&
|
|
641
641
|
CKEDITOR.env.quirks&&f[c].align&&h.push("text-align:"+f[c].align);0<h.length&&b.push('style\x3d"',h.join("; "),'" ');b.push(' class\x3d"cke_dialog_ui_vbox_child"\x3e',d[c],"\x3c/td\x3e\x3c/tr\x3e")}b.push("\x3c/tbody\x3e\x3c/table\x3e");return b.join("")})}}}})();CKEDITOR.ui.dialog.uiElement.prototype={getElement:function(){return CKEDITOR.document.getById(this.domId)},getInputElement:function(){return this.getElement()},getDialog:function(){return this._.dialog},setValue:function(a,b){this.getInputElement().setValue(a);
|
|
642
642
|
!b&&this.fire("change",{value:a});return this},getValue:function(){return this.getInputElement().getValue()},isChanged:function(){return!1},selectParentTab:function(){for(var a=this.getInputElement();(a=a.getParent())&&-1==a.$.className.search("cke_dialog_page_contents"););if(!a)return this;a=a.getAttribute("name");this._.dialog._.currentTabId!=a&&this._.dialog.selectPage(a);return this},focus:function(){this.selectParentTab().getInputElement().focus();return this},registerEvents:function(a){var b=
|
|
643
643
|
/^on([A-Z]\w+)/,d,c=function(a,b,d,c){b.on("load",function(){a.getInputElement().on(d,c,a)})},e;for(e in a)if(d=e.match(b))this.eventProcessors[e]?this.eventProcessors[e].call(this,this._.dialog,a[e]):c(this,this._.dialog,d[1].toLowerCase(),a[e]);return this},eventProcessors:{onLoad:function(a,b){a.on("load",b,this)},onShow:function(a,b){a.on("show",b,this)},onHide:function(a,b){a.on("hide",b,this)}},accessKeyDown:function(){this.focus()},accessKeyUp:function(){},disable:function(){var a=this.getElement();
|
|
@@ -647,75 +647,75 @@ g,f,d,b)}};CKEDITOR.dialog.addUIElement("hbox",a);CKEDITOR.dialog.addUIElement("
|
|
|
647
647
|
f=/^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;CKEDITOR.VALIDATE_OR=1;CKEDITOR.VALIDATE_AND=2;CKEDITOR.dialog.validate={functions:function(){var a=arguments;return function(){var b=this&&this.getValue?this.getValue():a[0],d,c=CKEDITOR.VALIDATE_AND,e=[],f;for(f=0;f<a.length;f++)if("function"==typeof a[f])e.push(a[f]);else break;f<a.length&&"string"==typeof a[f]&&(d=a[f],f++);f<a.length&&"number"==typeof a[f]&&(c=a[f]);var g=c==CKEDITOR.VALIDATE_AND?!0:!1;for(f=0;f<e.length;f++)g=c==CKEDITOR.VALIDATE_AND?g&&
|
|
648
648
|
e[f](b):g||e[f](b);return g?!0:d}},regex:function(a,b){return function(d){d=this&&this.getValue?this.getValue():d;return a.test(d)?!0:b}},notEmpty:function(b){return this.regex(a,b)},integer:function(a){return this.regex(b,a)},number:function(a){return this.regex(d,a)},cssLength:function(a){return this.functions(function(a){return e.test(CKEDITOR.tools.trim(a))},a)},htmlLength:function(a){return this.functions(function(a){return c.test(CKEDITOR.tools.trim(a))},a)},inlineStyle:function(a){return this.functions(function(a){return f.test(CKEDITOR.tools.trim(a))},
|
|
649
649
|
a)},equals:function(a,b){return this.functions(function(b){return b==a},b)},notEqual:function(a,b){return this.functions(function(b){return b!=a},b)}};CKEDITOR.on("instanceDestroyed",function(a){if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)){for(var b;b=CKEDITOR.dialog._.currentTop;)b.hide();for(var d in H)H[d].remove();H={}}a=a.editor._.storedDialogs;for(var c in a)a[c].destroy()})})();CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(a,b,d){var c=null,e=CKEDITOR.dialog._.dialogDefinitions[a];
|
|
650
|
-
null===CKEDITOR.dialog._.currentTop&&
|
|
650
|
+
null===CKEDITOR.dialog._.currentTop&&t(this);if("function"==typeof e)e=this._.storedDialogs||(this._.storedDialogs={}),c=e[a]||(e[a]=new CKEDITOR.dialog(this,a)),c.setModel(d),b&&b.call(c,c),c.show();else{if("failed"==e)throw w(this),Error('[CKEDITOR.dialog.openDialog] Dialog "'+a+'" failed when loading definition.');"string"==typeof e&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e),function(){"function"!=typeof CKEDITOR.dialog._.dialogDefinitions[a]&&(CKEDITOR.dialog._.dialogDefinitions[a]="failed");
|
|
651
651
|
this.openDialog(a,b,d)},this,0,1)}CKEDITOR.skin.loadPart("dialog");if(c)c.once("hide",function(){c.setModel(null)},null,null,999);return c}})})();var ka=!1;CKEDITOR.plugins.add("dialog",{requires:"dialogui",init:function(a){ka||(CKEDITOR.document.appendStyleSheet(this.path+"styles/dialog.css"),ka=!0);a.on("doubleclick",function(l){l.data.dialog&&a.openDialog(l.data.dialog)},null,null,999)}});"use strict";(function(){function a(a,f){CKEDITOR.tools.extend(this,f,{editor:a,id:"cke-"+CKEDITOR.tools.getUniqueId(),
|
|
652
652
|
area:a._.notificationArea});f.type||(this.type="info");this.element=this._createElement();a.plugins.clipboard&&CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(this.element)}function l(a){var f=this;this.editor=a;this.notifications=[];this.element=this._createElement();this._uiBuffer=CKEDITOR.tools.eventsBuffer(10,this._layout,this);this._changeBuffer=CKEDITOR.tools.eventsBuffer(500,this._layout,this);a.on("destroy",function(){f._removeListeners();f.element.remove()})}CKEDITOR.plugins.add("notification",
|
|
653
|
-
{init:function(a){function f(a){var f=new CKEDITOR.dom.element("div");f.setStyles({position:"fixed","margin-left":"-9999px"});f.setAttributes({"aria-live":"assertive","aria-atomic":"true"});f.setText(a);CKEDITOR.document.getBody().append(f);setTimeout(function(){f.remove()},100)}a._.notificationArea=new l(a);a.showNotification=function(e,f,
|
|
654
|
-
e.data.keyCode){var m=a._.notificationArea.notifications;m.length&&(f(a.lang.notification.closed),m[m.length-1].hide(),e.cancel())}})}});a.prototype={show:function(){!1!==this.editor.fire("notificationShow",{notification:this})&&(this.area.add(this),this._hideAfterTimeout())},update:function(a){var f=!0;!1===this.editor.fire("notificationUpdate",{notification:this,options:a})&&(f=!1);var e=this.element,m=e.findOne(".cke_notification_message"),
|
|
655
|
-
a.progress&&"progress"!=this.type&&(
|
|
653
|
+
{init:function(a){function f(a){var f=new CKEDITOR.dom.element("div");f.setStyles({position:"fixed","margin-left":"-9999px"});f.setAttributes({"aria-live":"assertive","aria-atomic":"true"});f.setText(a);CKEDITOR.document.getBody().append(f);setTimeout(function(){f.remove()},100)}a._.notificationArea=new l(a);a.showNotification=function(e,f,k){var g,b;"progress"==f?g=k:b=k;e=new CKEDITOR.plugins.notification(a,{message:e,type:f,progress:g,duration:b});e.show();return e};a.on("key",function(e){if(27==
|
|
654
|
+
e.data.keyCode){var m=a._.notificationArea.notifications;m.length&&(f(a.lang.notification.closed),m[m.length-1].hide(),e.cancel())}})}});a.prototype={show:function(){!1!==this.editor.fire("notificationShow",{notification:this})&&(this.area.add(this),this._hideAfterTimeout())},update:function(a){var f=!0;!1===this.editor.fire("notificationUpdate",{notification:this,options:a})&&(f=!1);var e=this.element,m=e.findOne(".cke_notification_message"),k=e.findOne(".cke_notification_progress"),g=a.type;e.removeAttribute("role");
|
|
655
|
+
a.progress&&"progress"!=this.type&&(g="progress");g&&(e.removeClass(this._getClass()),e.removeAttribute("aria-label"),this.type=g,e.addClass(this._getClass()),e.setAttribute("aria-label",this.type),"progress"!=this.type||k?"progress"!=this.type&&k&&k.remove():(k=this._createProgressElement(),k.insertBefore(m)));void 0!==a.message&&(this.message=a.message,m.setHtml(this.message));void 0!==a.progress&&(this.progress=a.progress,k&&k.setStyle("width",this._getPercentageProgress()));f&&a.important&&(e.setAttribute("role",
|
|
656
656
|
"alert"),this.isVisible()||this.area.add(this));this.duration=a.duration;this._hideAfterTimeout()},hide:function(){!1!==this.editor.fire("notificationHide",{notification:this})&&this.area.remove(this)},isVisible:function(){return 0<=CKEDITOR.tools.indexOf(this.area.notifications,this)},_createElement:function(){var a=this,f,e,m=this.editor.lang.common.close;f=new CKEDITOR.dom.element("div");f.addClass("cke_notification");f.addClass(this._getClass());f.setAttributes({id:this.id,role:"alert","aria-label":this.type});
|
|
657
657
|
"progress"==this.type&&f.append(this._createProgressElement());e=new CKEDITOR.dom.element("p");e.addClass("cke_notification_message");e.setHtml(this.message);f.append(e);e=CKEDITOR.dom.element.createFromHtml('\x3ca class\x3d"cke_notification_close" href\x3d"javascript:void(0)" title\x3d"'+m+'" role\x3d"button" tabindex\x3d"-1"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e');f.append(e);e.on("click",function(){a.editor.focus();a.hide()});return f},_getClass:function(){return"progress"==
|
|
658
658
|
this.type?"cke_notification_info":"cke_notification_"+this.type},_createProgressElement:function(){var a=new CKEDITOR.dom.element("span");a.addClass("cke_notification_progress");a.setStyle("width",this._getPercentageProgress());return a},_getPercentageProgress:function(){return Math.round(100*(this.progress||0))+"%"},_hideAfterTimeout:function(){var a=this,f;this._hideTimeoutId&&clearTimeout(this._hideTimeoutId);if("number"==typeof this.duration)f=this.duration;else if("info"==this.type||"success"==
|
|
659
659
|
this.type)f="number"==typeof this.editor.config.notification_duration?this.editor.config.notification_duration:5E3;f&&(a._hideTimeoutId=setTimeout(function(){a.hide()},f))}};l.prototype={add:function(a){this.notifications.push(a);this.element.append(a.element);1==this.element.getChildCount()&&(CKEDITOR.document.getBody().append(this.element),this._attachListeners());this._layout()},remove:function(a){var f=CKEDITOR.tools.indexOf(this.notifications,a);0>f||(this.notifications.splice(f,1),a.element.remove(),
|
|
660
660
|
this.element.getChildCount()||(this._removeListeners(),this.element.remove()))},_createElement:function(){var a=this.editor,f=a.config,e=new CKEDITOR.dom.element("div");e.addClass("cke_notifications_area");e.setAttribute("id","cke_notifications_area_"+a.name);e.setStyle("z-index",f.baseFloatZIndex-2);return e},_attachListeners:function(){var a=CKEDITOR.document.getWindow(),f=this.editor;a.on("scroll",this._uiBuffer.input);a.on("resize",this._uiBuffer.input);f.on("change",this._changeBuffer.input);
|
|
661
|
-
f.on("floatingSpaceLayout",this._layout,this,null,20);f.on("blur",this._layout,this,null,20)},_removeListeners:function(){var a=CKEDITOR.document.getWindow(),f=this.editor;a.removeListener("scroll",this._uiBuffer.input);a.removeListener("resize",this._uiBuffer.input);f.removeListener("change",this._changeBuffer.input);f.removeListener("floatingSpaceLayout",this._layout);f.removeListener("blur",this._layout)},_layout:function(){function a(){f.setStyle("left",
|
|
662
|
-
this.editor,m=e.ui.contentsElement.getClientRect(),
|
|
663
|
-
10));e.toolbar&&(
|
|
664
|
-
f.setStyle("left",
|
|
661
|
+
f.on("floatingSpaceLayout",this._layout,this,null,20);f.on("blur",this._layout,this,null,20)},_removeListeners:function(){var a=CKEDITOR.document.getWindow(),f=this.editor;a.removeListener("scroll",this._uiBuffer.input);a.removeListener("resize",this._uiBuffer.input);f.removeListener("change",this._changeBuffer.input);f.removeListener("floatingSpaceLayout",this._layout);f.removeListener("blur",this._layout)},_layout:function(){function a(){f.setStyle("left",x(r+m.width-l-p))}var f=this.element,e=
|
|
662
|
+
this.editor,m=e.ui.contentsElement.getClientRect(),k=e.ui.contentsElement.getDocumentPosition(),g,b,c=f.getClientRect(),d,l=this._notificationWidth,p=this._notificationMargin;d=CKEDITOR.document.getWindow();var q=d.getScrollPosition(),y=d.getViewPaneSize(),t=CKEDITOR.document.getBody(),w=t.getDocumentPosition(),x=CKEDITOR.tools.cssLength;l&&p||(d=this.element.getChild(0),l=this._notificationWidth=d.getClientRect().width,p=this._notificationMargin=parseInt(d.getComputedStyle("margin-left"),10)+parseInt(d.getComputedStyle("margin-right"),
|
|
663
|
+
10));e.toolbar&&(g=e.ui.space(e.config.toolbarLocation),b=g.getClientRect());g&&g.isVisible()&&b.bottom>m.top&&b.bottom<m.bottom-c.height?f.setStyles({position:"fixed",top:x(b.bottom)}):0<m.top?f.setStyles({position:"absolute",top:x(k.y)}):k.y+m.height-c.height>q.y?f.setStyles({position:"fixed",top:0}):f.setStyles({position:"absolute",top:x(k.y+m.height-c.height)});var r="fixed"==f.getStyle("position")?m.left:"static"!=t.getComputedStyle("position")?k.x-w.x:k.x;m.width<l+p?k.x+l+p>q.x+y.width?a():
|
|
664
|
+
f.setStyle("left",x(r)):k.x+l+p>q.x+y.width?f.setStyle("left",x(r)):k.x+m.width/2+l/2+p>q.x+y.width?f.setStyle("left",x(r-k.x+q.x+y.width-l-p)):0>m.left+m.width-l-p?a():0>m.left+m.width/2-l/2?f.setStyle("left",x(r-k.x+q.x)):f.setStyle("left",x(r+m.width/2-l/2-p/2))}};CKEDITOR.plugins.notification=a})();(function(){var a='\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"';
|
|
665
665
|
CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(a+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(a+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var l="";CKEDITOR.env.ie&&(l='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var a=a+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+l+'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"')+
|
|
666
666
|
'\x3e\x26nbsp;\x3c/span\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_button_label cke_button__{name}_label" aria-hidden\x3d"false"\x3e{label}\x3c/span\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_button_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e{arrowHtml}\x3c/a\x3e',h=CKEDITOR.addTemplate("buttonArrow",'\x3cspan class\x3d"cke_button_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":"")+"\x3c/span\x3e"),f=CKEDITOR.addTemplate("button",a);CKEDITOR.plugins.add("button",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON,
|
|
667
|
-
CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(f){f.execCommand(a.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}};CKEDITOR.ui.button.prototype={render:function(a,m){function
|
|
668
|
-
b,this.setState(b),this.refresh&&this.refresh())}var
|
|
669
|
-
(b=!1!==
|
|
670
|
-
"on":l.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");var
|
|
671
|
-
null,
|
|
672
|
-
"").replace("'",""),hasArrow:"string"===typeof this.hasArrow&&this.hasArrow||(this.hasArrow?"true":"false"),keydownFn:
|
|
667
|
+
CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(f){f.execCommand(a.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}};CKEDITOR.ui.button.prototype={render:function(a,m){function k(){var b=a.mode;b&&(b=this.modes[b]?void 0!==g[b]?g[b]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,b=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:
|
|
668
|
+
b,this.setState(b),this.refresh&&this.refresh())}var g=null,b=CKEDITOR.env,c=this._.id=CKEDITOR.tools.getNextId(),d="",l=this.command,p,q,y;this._.editor=a;var t={id:c,button:this,editor:a,focus:function(){CKEDITOR.document.getById(c).focus()},execute:function(){this.button.click(a)},attach:function(a){this.button.attach(a)}},w=CKEDITOR.tools.addFunction(function(a){if(t.onkey)return a=new CKEDITOR.dom.event(a),!1!==t.onkey(t,a.getKeystroke())}),x=CKEDITOR.tools.addFunction(function(a){var b;t.onfocus&&
|
|
669
|
+
(b=!1!==t.onfocus(t,new CKEDITOR.dom.event(a)));return b}),r=0;t.clickFn=p=CKEDITOR.tools.addFunction(function(){r&&(a.unlockSelection(1),r=0);t.execute();b.iOS&&a.focus()});this.modes?(g={},a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(g[a.mode]=this._.state)},this),a.on("activeFilterChange",k,this),a.on("mode",k,this),!this.readOnly&&a.on("readOnly",k,this)):l&&(l=a.getCommand(l))&&(l.on("state",function(){this.setState(l.state)},this),d+=l.state==CKEDITOR.TRISTATE_ON?
|
|
670
|
+
"on":l.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");var A;if(this.directional)a.on("contentDirChanged",function(b){var d=CKEDITOR.document.getById(this._.id),c=d.getFirst();b=b.data;b!=a.lang.dir?d.addClass("cke_"+b):d.removeClass("cke_ltr").removeClass("cke_rtl");c.setAttribute("style",CKEDITOR.skin.getIconStyle(A,"rtl"==b,this.icon,this.iconOffset))},this);l?(q=a.getCommandKeystroke(l))&&(y=CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard,q)):d+="off";q=this.name||this.command;var u=
|
|
671
|
+
null,z=this.icon;A=q;this.icon&&!/\./.test(this.icon)?(A=this.icon,z=null):(this.icon&&(u=this.icon),CKEDITOR.env.hidpi&&this.iconHiDpi&&(u=this.iconHiDpi));u?(CKEDITOR.skin.addIcon(u,u),z=null):u=A;d={id:c,name:q,iconName:A,label:this.label,cls:(this.hasArrow?"cke_button_expandable ":"")+(this.className||""),state:d,ariaDisabled:"disabled"==d?"true":"false",title:this.title+(y?" ("+y.display+")":""),ariaShortcut:y?a.lang.common.keyboardShortcut+" "+y.aria:"",titleJs:b.gecko&&!b.hc?"":(this.title||
|
|
672
|
+
"").replace("'",""),hasArrow:"string"===typeof this.hasArrow&&this.hasArrow||(this.hasArrow?"true":"false"),keydownFn:w,focusFn:x,clickFn:p,style:CKEDITOR.skin.getIconStyle(u,"rtl"==a.lang.dir,z,this.iconOffset),arrowHtml:this.hasArrow?h.output():""};f.output(d,m);if(this.onRender)this.onRender();return t},setState:function(a){if(this._.state==a)return!1;this._.state=a;var f=CKEDITOR.document.getById(this._.id);return f?(f.setState(a,"cke_button"),f.setAttribute("aria-disabled",a==CKEDITOR.TRISTATE_DISABLED),
|
|
673
673
|
this.hasArrow?f.setAttribute("aria-expanded",a==CKEDITOR.TRISTATE_ON):a===CKEDITOR.TRISTATE_ON?f.setAttribute("aria-pressed",!0):f.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(a){if(this._.feature)return this._.feature;var f=this;this.allowedContent||this.requiredContent||!this.command||(f=a.getCommand(this.command)||f);return this._.feature=f}};CKEDITOR.ui.prototype.addButton=function(a,f){this.add(a,CKEDITOR.UI_BUTTON,f)}})();(function(){function a(a){function f(){for(var b=
|
|
674
|
-
|
|
675
|
-
1:a.order<b.order?-1:1});return b}function
|
|
674
|
+
k(),d=CKEDITOR.tools.clone(a.config.toolbarGroups)||l(a),c=0;c<d.length;c++){var h=d[c];if("/"!=h){"string"==typeof h&&(h=d[c]={name:h});var m,w=h.groups;if(w)for(var x=0;x<w.length;x++)m=w[x],(m=b[m])&&g(h,m);(m=b[h.name])&&g(h,m)}}return d}function k(){var b={},d,c,f;for(d in a.ui.items)c=a.ui.items[d],f=c.toolbar||"others",f=f.split(","),c=f[0],f=parseInt(f[1]||-1,10),b[c]||(b[c]=[]),b[c].push({name:d,order:f});for(c in b)b[c]=b[c].sort(function(a,b){return a.order==b.order?0:0>b.order?-1:0>a.order?
|
|
675
|
+
1:a.order<b.order?-1:1});return b}function g(b,d){if(d.length){b.items?b.items.push(a.ui.create("-")):b.items=[];for(var f;f=d.shift();)f="string"==typeof f?f:f.name,c&&-1!=CKEDITOR.tools.indexOf(c,f)||(f=a.ui.create(f))&&a.addFeature(f)&&b.items.push(f)}}function b(a){var b=[],d,c,e;for(d=0;d<a.length;++d)c=a[d],e={},"/"==c?b.push(c):CKEDITOR.tools.isArray(c)?(g(e,CKEDITOR.tools.clone(c)),b.push(e)):c.items&&(g(e,CKEDITOR.tools.clone(c.items)),e.name=c.name,b.push(e));return b}var c=a.config.removeButtons,
|
|
676
676
|
c=c&&c.split(","),d=a.config.toolbar;"string"==typeof d&&(d=a.config["toolbar_"+d]);return a.toolbar=d?b(d):f()}function l(a){return a._.toolbarGroups||(a._.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"forms"},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},
|
|
677
|
-
"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var h=function(){this.toolbars=[];this.focusCommandExecuted=!1};h.prototype.focus=function(){for(var a=0,f;f=this.toolbars[a++];)for(var
|
|
678
|
-
{requires:"button",init:function(e){var l,
|
|
679
|
-
f&&(c=a.toolbar.items[0]);while(c&&!c.focus);c?c.focus():
|
|
680
|
-
c=['\x3cspan id\x3d"',b,'" class\x3d"cke_voice_label"\x3e',e.lang.toolbar.toolbars,"\x3c/span\x3e",'\x3cspan id\x3d"'+e.ui.spaceId("toolbox")+'" class\x3d"cke_toolbox" role\x3d"group" aria-labelledby\x3d"',b,'" onmousedown\x3d"return false;"\x3e'],b=!1!==e.config.toolbarStartupExpanded,d,l;e.config.toolbarCanCollapse&&e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&c.push('\x3cspan class\x3d"cke_toolbox_main"'+(b?"\x3e":' style\x3d"display:none"\x3e'));for(var m=e.toolbox.toolbars,
|
|
681
|
-
|
|
682
|
-
if(!
|
|
683
|
-
d=1):d&&(c.push("\x3c/span\x3e"),d=0);l&&(
|
|
677
|
+
"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var h=function(){this.toolbars=[];this.focusCommandExecuted=!1};h.prototype.focus=function(){for(var a=0,f;f=this.toolbars[a++];)for(var k=0,g;g=f.items[k++];)if(g.focus){g.focus();return}};var f={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(a){a.toolbox&&(a.toolbox.focusCommandExecuted=!0,CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){a.toolbox.focus()},100):a.toolbox.focus())}};CKEDITOR.plugins.add("toolbar",
|
|
678
|
+
{requires:"button",init:function(e){var l,k=function(a,b){var c,d="rtl"==e.lang.dir,f=e.config.toolbarGroupCycling,h=d?37:39,d=d?39:37,f=void 0===f||f;switch(b){case 9:case CKEDITOR.SHIFT+9:for(;!c||!c.items.length;)if(c=9==b?(c?c.next:a.toolbar.next)||e.toolbox.toolbars[0]:(c?c.previous:a.toolbar.previous)||e.toolbox.toolbars[e.toolbox.toolbars.length-1],c.items.length)for(a=c.items[l?c.items.length-1:0];a&&!a.focus;)(a=l?a.previous:a.next)||(c=0);a&&a.focus();return!1;case h:c=a;do c=c.next,!c&&
|
|
679
|
+
f&&(c=a.toolbar.items[0]);while(c&&!c.focus);c?c.focus():k(a,9);return!1;case 40:return a.button&&a.button.hasArrow?a.execute():k(a,40==b?h:d),!1;case d:case 38:c=a;do c=c.previous,!c&&f&&(c=a.toolbar.items[a.toolbar.items.length-1]);while(c&&!c.focus);c?c.focus():(l=1,k(a,CKEDITOR.SHIFT+9),l=0);return!1;case 27:return e.focus(),!1;case 13:case 32:return a.execute(),!1}return!0};e.on("uiSpace",function(f){if(f.data.space==e.config.toolbarLocation){f.removeListener();e.toolbox=new h;var b=CKEDITOR.tools.getNextId(),
|
|
680
|
+
c=['\x3cspan id\x3d"',b,'" class\x3d"cke_voice_label"\x3e',e.lang.toolbar.toolbars,"\x3c/span\x3e",'\x3cspan id\x3d"'+e.ui.spaceId("toolbox")+'" class\x3d"cke_toolbox" role\x3d"group" aria-labelledby\x3d"',b,'" onmousedown\x3d"return false;"\x3e'],b=!1!==e.config.toolbarStartupExpanded,d,l;e.config.toolbarCanCollapse&&e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&c.push('\x3cspan class\x3d"cke_toolbox_main"'+(b?"\x3e":' style\x3d"display:none"\x3e'));for(var m=e.toolbox.toolbars,q=a(e),y=q.length,
|
|
681
|
+
t=0;t<y;t++){var w,x=0,r,A=q[t],u="/"!==A&&("/"===q[t+1]||t==y-1),z;if(A)if(d&&(c.push("\x3c/span\x3e"),l=d=0),"/"===A)c.push('\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e');else{z=A.items||A;for(var v=0;v<z.length;v++){var D=z[v],C;if(D){var B=function(a){a=a.render(e,c);G=x.items.push(a)-1;0<G&&(a.previous=x.items[G-1],a.previous.next=a);a.toolbar=x;a.onkey=k;a.onfocus=function(){e.toolbox.focusCommandExecuted||e.focus()}};if(D.type==CKEDITOR.UI_SEPARATOR)l=d&&D;else{C=!1!==D.canGroup;
|
|
682
|
+
if(!x){w=CKEDITOR.tools.getNextId();x={id:w,items:[]};r=A.name&&(e.lang.toolbar.toolbarGroups[A.name]||A.name);c.push('\x3cspan id\x3d"',w,'" class\x3d"cke_toolbar'+(u?' cke_toolbar_last"':'"'),r?' aria-labelledby\x3d"'+w+'_label"':"",' role\x3d"toolbar"\x3e');r&&c.push('\x3cspan id\x3d"',w,'_label" class\x3d"cke_voice_label"\x3e',r,"\x3c/span\x3e");c.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e');var G=m.push(x)-1;0<G&&(x.previous=m[G-1],x.previous.next=x)}C?d||(c.push('\x3cspan class\x3d"cke_toolgroup" role\x3d"presentation"\x3e'),
|
|
683
|
+
d=1):d&&(c.push("\x3c/span\x3e"),d=0);l&&(B(l),l=0);B(D)}}}d&&(c.push("\x3c/span\x3e"),l=d=0);x&&c.push('\x3cspan class\x3d"cke_toolbar_end"\x3e\x3c/span\x3e\x3c/span\x3e')}}e.config.toolbarCanCollapse&&c.push("\x3c/span\x3e");if(e.config.toolbarCanCollapse&&e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var M=CKEDITOR.tools.addFunction(function(){e.execCommand("toolbarCollapse")});e.on("destroy",function(){CKEDITOR.tools.removeFunction(M)});e.addCommand("toolbarCollapse",{readOnly:1,exec:function(a){var b=
|
|
684
684
|
a.ui.space("toolbar_collapser"),d=b.getPrevious(),c=a.ui.space("contents"),e=d.getParent(),f=parseInt(c.$.style.height,10),g=e.$.offsetHeight,k=b.hasClass("cke_toolbox_collapser_min");k?(d.show(),b.removeClass("cke_toolbox_collapser_min"),b.setAttribute("title",a.lang.toolbar.toolbarCollapse)):(d.hide(),b.addClass("cke_toolbox_collapser_min"),b.setAttribute("title",a.lang.toolbar.toolbarExpand));b.getFirst().setText(k?"▲":"◀");c.setStyle("height",f-(e.$.offsetHeight-g)+"px");a.fire("resize",{outerHeight:a.container.$.offsetHeight,
|
|
685
685
|
contentsHeight:c.$.offsetHeight,outerWidth:a.container.$.offsetWidth})},modes:{wysiwyg:1,source:1}});e.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?189:109),"toolbarCollapse");c.push('\x3ca title\x3d"'+(b?e.lang.toolbar.toolbarCollapse:e.lang.toolbar.toolbarExpand)+'" id\x3d"'+e.ui.spaceId("toolbar_collapser")+'" tabIndex\x3d"-1" class\x3d"cke_toolbox_collapser');b||c.push(" cke_toolbox_collapser_min");c.push('" onclick\x3d"CKEDITOR.tools.callFunction('+M+')"\x3e','\x3cspan class\x3d"cke_arrow"\x3e\x26#9650;\x3c/span\x3e',
|
|
686
686
|
"\x3c/a\x3e")}c.push("\x3c/span\x3e");f.data.html+=c.join("")}});e.on("destroy",function(){if(this.toolbox){var a,b=0,c,d,e;for(a=this.toolbox.toolbars;b<a.length;b++)for(d=a[b].items,c=0;c<d.length;c++)e=d[c],e.clickFn&&CKEDITOR.tools.removeFunction(e.clickFn),e.keyDownFn&&CKEDITOR.tools.removeFunction(e.keyDownFn)}});e.on("uiReady",function(){var a=e.ui.space("toolbox");a&&e.focusManager.add(a,1)});e.addCommand("toolbarFocus",f);e.setKeystroke(CKEDITOR.ALT+121,"toolbarFocus");e.ui.add("-",CKEDITOR.UI_SEPARATOR,
|
|
687
|
-
{});e.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(a,b){b.push('\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e');return{}}}}})}});CKEDITOR.ui.prototype.addToolbarGroup=function(a,f,
|
|
688
|
-
return}f=null}f&&(f=CKEDITOR.tools.indexOf(
|
|
689
|
-
return a.fire("paste",b)}function l(b){function c(){var a=b.editable();if(CKEDITOR.plugins.clipboard.isCustomCopyCutSupported){var e=function(a){b.getSelection().isCollapsed()||(b.readOnly&&"cut"==a.name||C.initPasteDataTransfer(a,b),a.data.preventDefault())};a.on("copy",e);a.on("cut",e);a.on("cut",function(){b.readOnly||b.extractSelectedHtml()},null,null,999)}a.on(C.mainPasteEvent,function(a){"beforepaste"==C.mainPasteEvent&&
|
|
690
|
-
(g(),a.data.preventDefault(),
|
|
687
|
+
{});e.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(a,b){b.push('\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e');return{}}}}})}});CKEDITOR.ui.prototype.addToolbarGroup=function(a,f,k){var g=l(this.editor),b=0===f,c={name:a};if(k){if(k=CKEDITOR.tools.search(g,function(a){return a.name==k})){!k.groups&&(k.groups=[]);if(f&&(f=CKEDITOR.tools.indexOf(k.groups,f),0<=f)){k.groups.splice(f+1,0,a);return}b?k.groups.splice(0,0,a):k.groups.push(a);
|
|
688
|
+
return}f=null}f&&(f=CKEDITOR.tools.indexOf(g,function(a){return a.name==f}));b?g.splice(0,0,a):"number"==typeof f?g.splice(f+1,0,c):g.push(a)}})();CKEDITOR.UI_SEPARATOR="separator";CKEDITOR.config.toolbarLocation="top";"use strict";(function(){function a(a,b,c){b.type||(b.type="auto");if(c&&!1===a.fire("beforePaste",b)||!b.dataValue&&b.dataTransfer.isEmpty())return!1;b.dataValue||(b.dataValue="");if(CKEDITOR.env.gecko&&"drop"==b.method&&a.toolbox)a.once("afterPaste",function(){a.toolbox.focus()});
|
|
689
|
+
return a.fire("paste",b)}function l(b){function c(){var a=b.editable();if(CKEDITOR.plugins.clipboard.isCustomCopyCutSupported){var e=function(a){b.getSelection().isCollapsed()||(b.readOnly&&"cut"==a.name||C.initPasteDataTransfer(a,b),a.data.preventDefault())};a.on("copy",e);a.on("cut",e);a.on("cut",function(){b.readOnly||b.extractSelectedHtml()},null,null,999)}a.on(C.mainPasteEvent,function(a){"beforepaste"==C.mainPasteEvent&&B||z(a)});"beforepaste"==C.mainPasteEvent&&(a.on("paste",function(a){G||
|
|
690
|
+
(g(),a.data.preventDefault(),z(a),h("paste"))}),a.on("contextmenu",k,null,null,0),a.on("beforepaste",function(a){!a.data||a.data.$.ctrlKey||a.data.$.shiftKey||k()},null,null,0));a.on("beforecut",function(){!B&&l(b)});var f;a.attachListener(CKEDITOR.env.ie?a:b.document.getDocumentElement(),"mouseup",function(){f=setTimeout(v,0)});b.on("destroy",function(){clearTimeout(f)});a.on("keyup",v)}function e(a){return{type:a,canUndo:"cut"==a,startDisabled:!0,fakeKeystroke:"cut"==a?CKEDITOR.CTRL+88:CKEDITOR.CTRL+
|
|
691
691
|
67,exec:function(){"cut"==this.type&&l();var a;var c=this.type;if(CKEDITOR.env.ie)a=h(c);else try{a=b.document.$.execCommand(c,!1,null)}catch(e){a=!1}a||b.showNotification(b.lang.clipboard[this.type+"Error"]);return a}}}function f(){return{canUndo:!1,async:!0,fakeKeystroke:CKEDITOR.CTRL+86,exec:function(b,d){function c(d,g){g="undefined"!==typeof g?g:!0;d?(d.method="paste",d.dataTransfer||(d.dataTransfer=C.initPasteDataTransfer()),a(b,d,g)):f&&!b._.forcePasteDialog&&b.showNotification(h,"info",b.config.clipboard_notificationDuration);
|
|
692
692
|
b._.forcePasteDialog=!1;b.fire("afterCommandExec",{name:"paste",command:e,returnValue:!!d})}d="undefined"!==typeof d&&null!==d?d:{};var e=this,f="undefined"!==typeof d.notification?d.notification:!0,g=d.type,k=CKEDITOR.tools.keystrokeToString(b.lang.common.keyboard,b.getCommandKeystroke(this)),h="string"===typeof f?f:b.lang.clipboard.pasteNotification.replace(/%1/,'\x3ckbd aria-label\x3d"'+k.aria+'"\x3e'+k.display+"\x3c/kbd\x3e"),k="string"===typeof d?d:d.dataValue;g&&!0!==b.config.forcePasteAsPlainText&&
|
|
693
|
-
"allow-word"!==b.config.forcePasteAsPlainText?b._.nextPasteType=g:delete b._.nextPasteType;"string"===typeof k?c({dataValue:k}):b.getClipboardData(c)}}}function g(){G=1;setTimeout(function(){G=0},100)}function k(){
|
|
694
|
-
b.getSelection(),c,e,f;a.getType()==CKEDITOR.SELECTION_ELEMENT&&(c=a.getSelectedElement())&&(e=a.getRanges()[0],f=b.document.createText(""),f.insertBefore(c),e.setStartBefore(f),e.setEndAfter(c),a.selectRanges([e]),setTimeout(function(){c.getParent()&&(f.remove(),a.selectElement(c))},0))}}function m(a,c){var e=b.document,f=b.editable(),g=function(a){a.cancel()},k;if(!e.getById("cke_pastebin")){var h=b.getSelection(),l=h.createBookmarks();CKEDITOR.env.ie&&h.root.fire("selectionchange");var
|
|
695
|
-
!f.is("body")||CKEDITOR.env.ie?"div":"body",e);
|
|
696
|
-
20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&
|
|
697
|
-
(k=f.once("blur",function(){b.lockSelection(
|
|
698
|
-
method:"paste"}),!1;b.focus();g();var a=b.focusManager;a.lock();if(b.editable().fire(C.mainPasteEvent)&&!h("paste"))return a.unlock(),!1;a.unlock();return!0}function
|
|
699
|
-
dataTransfer:C.initPasteDataTransfer(c)};e.dataTransfer.cacheData();var f=!1!==b.fire("beforePaste",e);f&&C.canClipboardApiBeTrusted(e.dataTransfer,b)?(c.data.preventDefault(),setTimeout(function(){a(b,e)},0)):m(c,function(c){e.dataValue=c.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");f&&a(b,e)})}function
|
|
700
|
-
b.getSelection(),c=c&&c.getRanges()[0];if((b.readOnly||c&&c.checkReadOnly())&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;a=b.getSelection();c=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==c.length&&c[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var C=CKEDITOR.plugins.clipboard,
|
|
701
|
-
copy:
|
|
693
|
+
"allow-word"!==b.config.forcePasteAsPlainText?b._.nextPasteType=g:delete b._.nextPasteType;"string"===typeof k?c({dataValue:k}):b.getClipboardData(c)}}}function g(){G=1;setTimeout(function(){G=0},100)}function k(){B=1;setTimeout(function(){B=0},10)}function h(a){var c=b.document,e=c.getBody(),f=!1,g=function(){f=!0};e.on(a,g);7<CKEDITOR.env.version?c.$.execCommand(a):c.$.selection.createRange().execCommand(a);e.removeListener(a,g);return f}function l(){if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var a=
|
|
694
|
+
b.getSelection(),c,e,f;a.getType()==CKEDITOR.SELECTION_ELEMENT&&(c=a.getSelectedElement())&&(e=a.getRanges()[0],f=b.document.createText(""),f.insertBefore(c),e.setStartBefore(f),e.setEndAfter(c),a.selectRanges([e]),setTimeout(function(){c.getParent()&&(f.remove(),a.selectElement(c))},0))}}function m(a,c){var e=b.document,f=b.editable(),g=function(a){a.cancel()},k;if(!e.getById("cke_pastebin")){var h=b.getSelection(),l=h.createBookmarks();CKEDITOR.env.ie&&h.root.fire("selectionchange");var n=new CKEDITOR.dom.element(!CKEDITOR.env.webkit&&
|
|
695
|
+
!f.is("body")||CKEDITOR.env.ie?"div":"body",e);n.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var r=0,e=e.getWindow();CKEDITOR.env.webkit?(f.append(n),n.addClass("cke_editable"),f.is("body")||(r="static"!=f.getComputedStyle("position")?f:CKEDITOR.dom.element.get(f.$.offsetParent),r=r.getDocumentPosition().y)):f.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(n);n.setStyles({position:"absolute",top:e.getScrollPosition().y-r+10+"px",width:"1px",height:Math.max(1,e.getViewPaneSize().height-
|
|
696
|
+
20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&n.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text"));(r=n.getParent().isReadOnly())?(n.setOpacity(0),n.setAttribute("contenteditable",!0)):n.setStyle("ltr"==b.config.contentsLangDirection?"left":"right","-10000px");b.on("selectionChange",g,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)k=f.once("blur",g,null,null,-100);r&&n.focus();r=new CKEDITOR.dom.range(n);r.selectNodeContents(n);var v=r.select();CKEDITOR.env.ie&&
|
|
697
|
+
(k=f.once("blur",function(){b.lockSelection(v)}));var x=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=x);k&&k.removeListener();CKEDITOR.env.ie&&f.focus();h.selectBookmarks(l);n.remove();var a;CKEDITOR.env.webkit&&(a=n.getFirst())&&a.is&&a.hasClass("Apple-style-span")&&(n=a);b.removeListener("selectionChange",g);c(n.getHtml())},0)}}function A(){if("paste"==C.mainPasteEvent)return b.fire("beforePaste",{type:"auto",
|
|
698
|
+
method:"paste"}),!1;b.focus();g();var a=b.focusManager;a.lock();if(b.editable().fire(C.mainPasteEvent)&&!h("paste"))return a.unlock(),!1;a.unlock();return!0}function u(a){if("wysiwyg"==b.mode)switch(a.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:a=b.editable();g();"paste"==C.mainPasteEvent&&a.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:b.fire("saveSnapshot"),setTimeout(function(){b.fire("saveSnapshot")},50)}}function z(c){var e={type:"auto",method:"paste",
|
|
699
|
+
dataTransfer:C.initPasteDataTransfer(c)};e.dataTransfer.cacheData();var f=!1!==b.fire("beforePaste",e);f&&C.canClipboardApiBeTrusted(e.dataTransfer,b)?(c.data.preventDefault(),setTimeout(function(){a(b,e)},0)):m(c,function(c){e.dataValue=c.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");f&&a(b,e)})}function v(){if("wysiwyg"==b.mode){var a=D("paste");b.getCommand("cut").setState(D("cut"));b.getCommand("copy").setState(D("copy"));b.getCommand("paste").setState(a);b.fire("pasteState",a)}}function D(a){var c=
|
|
700
|
+
b.getSelection(),c=c&&c.getRanges()[0];if((b.readOnly||c&&c.checkReadOnly())&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;a=b.getSelection();c=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==c.length&&c[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var C=CKEDITOR.plugins.clipboard,B=0,G=0;(function(){b.on("key",u);b.on("contentDom",c);b.on("selectionChange",v);if(b.contextMenu){b.contextMenu.addListener(function(){return{cut:D("cut"),
|
|
701
|
+
copy:D("copy"),paste:D("paste")}});var a=null;b.on("menuShow",function(){a&&(a.removeListener(),a=null);var c=b.contextMenu.findItemByCommandName("paste");c&&c.element&&(a=c.element.on("touchend",function(){b._.forcePasteDialog=!0}))})}if(b.ui.addButton)b.once("instanceReady",function(){b._.pasteButtons&&CKEDITOR.tools.array.forEach(b._.pasteButtons,function(a){if(a=b.ui.get(a))if(a=CKEDITOR.document.getById(a._.id))a.on("touchend",function(){b._.forcePasteDialog=!0})})})})();(function(){function a(c,
|
|
702
702
|
e,f,g,k){var h=b.lang.clipboard[e];b.addCommand(e,f);b.ui.addButton&&b.ui.addButton(c,{label:h,command:e,toolbar:"clipboard,"+g});b.addMenuItems&&b.addMenuItem(e,{label:h,command:e,group:"clipboard",order:k})}a("Cut","cut",e("cut"),10,1);a("Copy","copy",e("copy"),20,4);a("Paste","paste",f(),30,8);b._.pasteButtons||(b._.pasteButtons=[]);b._.pasteButtons.push("Paste")})();b.getClipboardData=function(a,c){function e(a){a.removeListener();a.cancel();c(a.data)}function f(a){a.removeListener();a.cancel();
|
|
703
|
-
c({type:k,dataValue:a.data.dataValue,dataTransfer:a.data.dataTransfer,method:"paste"})}var g=!1,k="auto";c||(c=a,a=null);b.on("beforePaste",function(a){a.removeListener();g=!0;k=a.data.type},null,null,1E3);b.on("paste",e,null,null,0);!1===
|
|
703
|
+
c({type:k,dataValue:a.data.dataValue,dataTransfer:a.data.dataTransfer,method:"paste"})}var g=!1,k="auto";c||(c=a,a=null);b.on("beforePaste",function(a){a.removeListener();g=!0;k=a.data.type},null,null,1E3);b.on("paste",e,null,null,0);!1===A()&&(b.removeListener("paste",e),b._.forcePasteDialog&&g&&b.fire("pasteDialog")?(b.on("pasteDialogCommit",f),b.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",f);a.data._.committed||c(null)})):c(null))}}function h(a){if(CKEDITOR.env.webkit){if(!a.match(/^[^<]*$/g)&&
|
|
704
704
|
!a.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!a.match(/^([^<]|<br( ?\/)?>)*$/gi)&&!a.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!a.match(/^([^<]|<br( ?\/)?>)*$/gi))return"html"}else return"html";return"htmlifiedtext"}function f(a,b){function c(a){return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e",~~(a/2))+(1==a%2?"\x3cbr\x3e":"")}b=b.replace(/(?!\u3000)\s+/g," ").replace(/> +</g,"\x3e\x3c").replace(/<br ?\/>/gi,
|
|
705
705
|
"\x3cbr\x3e");b=b.replace(/<\/?[A-Z]+>/g,function(a){return a.toLowerCase()});if(b.match(/^[^<]$/))return b;CKEDITOR.env.webkit&&-1<b.indexOf("\x3cdiv\x3e")&&(b=b.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g,"\x3cbr\x3e").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g,"\x3cdiv\x3e\x3c/div\x3e"),b.match(/<div>(<br>|)<\/div>/)&&(b="\x3cp\x3e"+b.replace(/(<div>(<br>|)<\/div>)+/g,function(a){return c(a.split("\x3c/div\x3e\x3cdiv\x3e").length+1)})+"\x3c/p\x3e"),b=b.replace(/<\/div><div>/g,"\x3cbr\x3e"),
|
|
706
|
-
b=b.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&a.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(b=b.replace(/^<br><br>$/,"\x3cbr\x3e")),-1<b.indexOf("\x3cbr\x3e\x3cbr\x3e")&&(b="\x3cp\x3e"+b.replace(/(<br>){2,}/g,function(a){return c(a.length/4)})+"\x3c/p\x3e"));return
|
|
707
|
-
"br")):"semantic-content"==e?((e=c.semanticContent)||(e=new CKEDITOR.filter(a,{}),e.allow({$1:{elements:b(),attributes:!0,styles:!1,classes:!1}}),e=c.semanticContent=e),e):e?new CKEDITOR.filter(a,e):null}}}function m(a,b,c){b=CKEDITOR.htmlParser.fragment.fromHtml(b);var e=new CKEDITOR.htmlParser.basicWriter;c.applyTo(b,!0,!1,a.activeEnterMode);b.writeHtml(e);return e.getHtml()}function
|
|
708
|
-
a.length/7*2)}).replace(/<\/?p>/g,""):a.enterMode==CKEDITOR.ENTER_DIV&&(b=b.replace(/<(\/)?p>/g,"\x3c$1div\x3e"));return b}function
|
|
709
|
-
function f(e,g){e.select();a(b,{dataTransfer:g,method:"drop"},1);c.resetDragDataTransfer()}function g(a,c,e){var f={$:a.data.$,target:a.data.getTarget()};c&&(f.dragRange=c);e&&(f.dropRange=e);!1===b.fire(a.name,f)&&a.data.preventDefault()}function k(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());return a.getChildCount()}var h=b.editable(),l=CKEDITOR.plugins.clipboard.getDropTarget(b),m=b.ui.space("top"),
|
|
706
|
+
b=b.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&a.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(b=b.replace(/^<br><br>$/,"\x3cbr\x3e")),-1<b.indexOf("\x3cbr\x3e\x3cbr\x3e")&&(b="\x3cp\x3e"+b.replace(/(<br>){2,}/g,function(a){return c(a.length/4)})+"\x3c/p\x3e"));return k(a,b)}function e(a){function b(){var a={},d;for(d in CKEDITOR.dtd)"$"!=d.charAt(0)&&"div"!=d&&"span"!=d&&(a[d]=1);return a}var c={};return{get:function(e){return"plain-text"==e?c.plainText||(c.plainText=new CKEDITOR.filter(a,
|
|
707
|
+
"br")):"semantic-content"==e?((e=c.semanticContent)||(e=new CKEDITOR.filter(a,{}),e.allow({$1:{elements:b(),attributes:!0,styles:!1,classes:!1}}),e=c.semanticContent=e),e):e?new CKEDITOR.filter(a,e):null}}}function m(a,b,c){b=CKEDITOR.htmlParser.fragment.fromHtml(b);var e=new CKEDITOR.htmlParser.basicWriter;c.applyTo(b,!0,!1,a.activeEnterMode);b.writeHtml(e);return e.getHtml()}function k(a,b){a.enterMode==CKEDITOR.ENTER_BR?b=b.replace(/(<\/p><p>)+/g,function(a){return CKEDITOR.tools.repeat("\x3cbr\x3e",
|
|
708
|
+
a.length/7*2)}).replace(/<\/?p>/g,""):a.enterMode==CKEDITOR.ENTER_DIV&&(b=b.replace(/<(\/)?p>/g,"\x3c$1div\x3e"));return b}function g(a){a.data.preventDefault();a.data.$.dataTransfer.dropEffect="none"}function b(b){var c=CKEDITOR.plugins.clipboard;b.on("contentDom",function(){function e(c,f,g){f.select();a(b,{dataTransfer:g,method:"drop"},1);g.sourceEditor.fire("saveSnapshot");g.sourceEditor.editable().extractHtmlFromRange(c);g.sourceEditor.getSelection().selectRanges([c]);g.sourceEditor.fire("saveSnapshot")}
|
|
709
|
+
function f(e,g){e.select();a(b,{dataTransfer:g,method:"drop"},1);c.resetDragDataTransfer()}function g(a,c,e){var f={$:a.data.$,target:a.data.getTarget()};c&&(f.dragRange=c);e&&(f.dropRange=e);!1===b.fire(a.name,f)&&a.data.preventDefault()}function k(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());return a.getChildCount()}var h=b.editable(),l=CKEDITOR.plugins.clipboard.getDropTarget(b),m=b.ui.space("top"),A=b.ui.space("bottom");c.preventDefaultDropOnElement(m);c.preventDefaultDropOnElement(A);
|
|
710
710
|
h.attachListener(l,"dragstart",g);h.attachListener(b,"dragstart",c.resetDragDataTransfer,c,null,1);h.attachListener(b,"dragstart",function(a){c.initDragDataTransfer(a,b)},null,null,2);h.attachListener(b,"dragstart",function(){var a=c.dragRange=b.getSelection().getRanges()[0];CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(c.dragStartContainerChildCount=a?k(a.startContainer):null,c.dragEndContainerChildCount=a?k(a.endContainer):null)},null,null,100);h.attachListener(l,"dragend",g);h.attachListener(b,"dragend",
|
|
711
711
|
c.initDragDataTransfer,c,null,1);h.attachListener(b,"dragend",c.resetDragDataTransfer,c,null,100);h.attachListener(l,"dragover",function(a){if(CKEDITOR.env.edge)a.data.preventDefault();else{var b=a.data.getTarget();b&&b.is&&b.is("html")?a.data.preventDefault():CKEDITOR.env.ie&&CKEDITOR.plugins.clipboard.isFileApiSupported&&a.data.$.dataTransfer.types.contains("Files")&&a.data.preventDefault()}});h.attachListener(l,"drop",function(a){if(!a.data.$.defaultPrevented&&(a.data.preventDefault(),!b.readOnly)){var e=
|
|
712
712
|
a.data.getTarget();if(!e.isReadOnly()||e.type==CKEDITOR.NODE_ELEMENT&&e.is("html")){var e=c.getRangeAtDropPosition(a,b),f=c.dragRange;e&&g(a,f,e)}}},null,null,9999);h.attachListener(b,"drop",c.initDragDataTransfer,c,null,1);h.attachListener(b,"drop",function(a){if(a=a.data){var g=a.dropRange,k=a.dragRange,h=a.dataTransfer;h.getTransferType(b)==CKEDITOR.DATA_TRANSFER_INTERNAL?setTimeout(function(){c.internalDrop(k,g,h,b)},0):h.getTransferType(b)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?e(k,g,h):f(g,h)}},
|
|
713
|
-
null,null,9999)})}var c;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",init:function(a){function c(a){if(!a||
|
|
714
|
-
if(CKEDITOR.env.gecko){var y=["image/png","image/jpeg","image/gif"],
|
|
715
|
-
|
|
713
|
+
null,null,9999)})}var c;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",init:function(a){function c(a){if(!a||t===a.id)return!1;var b=a.getTypes(),b=1===b.length&&"Files"===b[0];a=1===a.getFilesCount();return b&&a}var g,k=e(a);a.config.forcePasteAsPlainText?g="plain-text":a.config.pasteFilter?g=a.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in a.config||(g="semantic-content");a.pasteFilter=k.get(g);l(a);b(a);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));
|
|
714
|
+
if(CKEDITOR.env.gecko){var y=["image/png","image/jpeg","image/gif"],t;a.on("paste",function(b){var e=b.data,f=e.dataTransfer;if(!e.dataValue&&"paste"==e.method&&c(f)&&(f=f.getFile(0),-1!=CKEDITOR.tools.indexOf(y,f.type))){var g=new FileReader;g.addEventListener("load",function(){b.data.dataValue='\x3cimg src\x3d"'+g.result+'" /\x3e';a.fire("paste",b.data)},!1);g.addEventListener("abort",function(){a.fire("paste",b.data)},!1);g.addEventListener("error",function(){a.fire("paste",b.data)},!1);g.readAsDataURL(f);
|
|
715
|
+
t=e.dataTransfer.id;b.stop()}},null,null,1)}a.on("paste",function(b){b.data.dataTransfer||(b.data.dataTransfer=new CKEDITOR.plugins.clipboard.dataTransfer);if(!b.data.dataValue){var c=b.data.dataTransfer,e=c.getData("text/html");if(e)b.data.dataValue=e,b.data.type="html";else if(e=c.getData("text/plain"))b.data.dataValue=a.editable().transformPlainTextToHtml(e),b.data.type="text"}},null,null,1);a.on("paste",function(a){var b=a.data.dataValue,d=CKEDITOR.dtd.$block;-1<b.indexOf("Apple-")&&(b=b.replace(/<span class="Apple-converted-space"> <\/span>/gi,
|
|
716
716
|
" "),"html"!=a.data.type&&(b=b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;")})),-1<b.indexOf('\x3cbr class\x3d"Apple-interchange-newline"\x3e')&&(a.data.startsWithEOL=1,a.data.preSniffing="html",b=b.replace(/<br class="Apple-interchange-newline">/,"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(b.match(/^<[^<]+cke_(editable|contents)/i)){var c,e,f=new CKEDITOR.dom.element("div");for(f.setHtml(b);1==f.getChildCount()&&
|
|
717
717
|
(c=f.getFirst())&&c.type==CKEDITOR.NODE_ELEMENT&&(c.hasClass("cke_editable")||c.hasClass("cke_contents"));)f=e=c;e&&(b=e.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?b=b.replace(/^ (?: |\r\n)?<(\w+)/g,function(b,c){return c.toLowerCase()in d?(a.data.preSniffing="html","\x3c"+c):b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)><div><br><\/div>$/,function(b,c){return c in d?(a.data.endsWithEOL=1,"\x3c/"+c+"\x3e"):b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)<br>$/,"$1"));a.data.dataValue=b},null,
|
|
718
|
-
null,3);a.on("paste",function(b){b=b.data;var c=a._.nextPasteType||b.type,e=b.dataValue,g,l=a.config.clipboard_defaultContentType||"html",n=b.dataTransfer.getTransferType(a)==CKEDITOR.DATA_TRANSFER_EXTERNAL,
|
|
718
|
+
null,3);a.on("paste",function(b){b=b.data;var c=a._.nextPasteType||b.type,e=b.dataValue,g,l=a.config.clipboard_defaultContentType||"html",n=b.dataTransfer.getTransferType(a)==CKEDITOR.DATA_TRANSFER_EXTERNAL,v=!0===a.config.forcePasteAsPlainText;g="html"==c||"html"==b.preSniffing?"html":h(e);delete a._.nextPasteType;"htmlifiedtext"==g&&(e=f(a.config,e));if("text"==c&&"html"==g)e=m(a,e,k.get("plain-text"));else if(n&&a.pasteFilter&&!b.dontFilter||v)e=m(a,e,a.pasteFilter);b.startsWithEOL&&(e='\x3cbr data-cke-eol\x3d"1"\x3e'+
|
|
719
719
|
e);b.endsWithEOL&&(e+='\x3cbr data-cke-eol\x3d"1"\x3e');"auto"==c&&(c="html"==g||"html"==l?"html":"text");b.type=c;b.dataValue=e;delete b.preSniffing;delete b.startsWithEOL;delete b.endsWithEOL},null,null,6);a.on("paste",function(b){b=b.data;b.dataValue&&(a.insertHtml(b.dataValue,b.type,b.range),setTimeout(function(){a.fire("afterPaste")},0))},null,null,1E3);a.on("pasteDialog",function(b){setTimeout(function(){a.openDialog("paste",b.data)},0)})}});CKEDITOR.plugins.clipboard={isCustomCopyCutSupported:CKEDITOR.env.ie&&
|
|
720
720
|
16>CKEDITOR.env.version||CKEDITOR.env.iOS&&605>CKEDITOR.env.version?!1:!0,isCustomDataTypesSupported:!CKEDITOR.env.ie||16<=CKEDITOR.env.version,isFileApiSupported:!CKEDITOR.env.ie||9<CKEDITOR.env.version,mainPasteEvent:CKEDITOR.env.ie&&!CKEDITOR.env.edge?"beforepaste":"paste",addPasteButton:function(a,b,c){a.ui.addButton&&(a.ui.addButton(b,c),a._.pasteButtons||(a._.pasteButtons=[]),a._.pasteButtons.push(b))},canClipboardApiBeTrusted:function(a,b){return a.getTransferType(b)!=CKEDITOR.DATA_TRANSFER_EXTERNAL||
|
|
721
721
|
CKEDITOR.env.chrome&&!a.isEmpty()||CKEDITOR.env.gecko&&(a.getData("text/html")||a.getFilesCount())||CKEDITOR.env.safari&&603<=CKEDITOR.env.version&&!CKEDITOR.env.iOS||CKEDITOR.env.iOS&&605<=CKEDITOR.env.version||CKEDITOR.env.edge&&16<=CKEDITOR.env.version?!0:!1},getDropTarget:function(a){var b=a.editable();return CKEDITOR.env.ie&&9>CKEDITOR.env.version||b.isInline()?b:a.document},fixSplitNodesAfterDrop:function(a,b,c,e){function f(a,d,c){var e=a;e.type==CKEDITOR.NODE_TEXT&&(e=a.getParent());if(e.equals(d)&&
|
|
@@ -723,10 +723,10 @@ c!=d.getChildCount())return a=b.startContainer.getChild(b.startOffset-1),d=b.sta
|
|
|
723
723
|
return a.endContainer.equals(c)&&a.endOffset<=e||a.startContainer.getParent().equals(c)&&a.startContainer.getIndex()<e||a.endContainer.getParent().equals(c)&&a.endContainer.getIndex()<e?!0:!1},internalDrop:function(b,c,e,f){var g=CKEDITOR.plugins.clipboard,k=f.editable(),h,l;f.fire("saveSnapshot");f.fire("lockSnapshot",{dontUpdate:1});CKEDITOR.env.ie&&10>CKEDITOR.env.version&&this.fixSplitNodesAfterDrop(b,c,g.dragStartContainerChildCount,g.dragEndContainerChildCount);(l=this.isDropRangeAffectedByDragRange(b,
|
|
724
724
|
c))||(h=b.createBookmark(!1));g=c.clone().createBookmark(!1);l&&(h=b.createBookmark(!1));b=h.startNode;c=h.endNode;l=g.startNode;c&&b.getPosition(l)&CKEDITOR.POSITION_PRECEDING&&c.getPosition(l)&CKEDITOR.POSITION_FOLLOWING&&l.insertBefore(b);b=f.createRange();b.moveToBookmark(h);k.extractHtmlFromRange(b,1);c=f.createRange();g.startNode.getCommonAncestor(k)||(g=f.getSelection().createBookmarks()[0]);c.moveToBookmark(g);a(f,{dataTransfer:e,method:"drop",range:c},1);f.fire("unlockSnapshot")},getRangeAtDropPosition:function(a,
|
|
725
725
|
b){var c=a.data.$,e=c.clientX,f=c.clientY,g=b.getSelection(!0).getRanges()[0],k=b.createRange();if(a.data.testRange)return a.data.testRange;if(document.caretRangeFromPoint&&b.document.$.caretRangeFromPoint(e,f))c=b.document.$.caretRangeFromPoint(e,f),k.setStart(CKEDITOR.dom.node(c.startContainer),c.startOffset),k.collapse(!0);else if(c.rangeParent)k.setStart(CKEDITOR.dom.node(c.rangeParent),c.rangeOffset),k.collapse(!0);else{if(CKEDITOR.env.ie&&8<CKEDITOR.env.version&&g&&b.editable().hasFocus)return g;
|
|
726
|
-
if(document.body.createTextRange){b.focus();c=b.document.getBody().$.createTextRange();try{for(var h=!1,l=0;20>l&&!h;l++){if(!h)try{c.moveToPoint(e,f-l),h=!0}catch(m){}if(!h)try{c.moveToPoint(e,f+l),h=!0}catch(
|
|
727
|
-
"html"==C.getName())return g&&g.startContainer&&!g.startContainer.equals(b.editable())?g:null;
|
|
726
|
+
if(document.body.createTextRange){b.focus();c=b.document.getBody().$.createTextRange();try{for(var h=!1,l=0;20>l&&!h;l++){if(!h)try{c.moveToPoint(e,f-l),h=!0}catch(m){}if(!h)try{c.moveToPoint(e,f+l),h=!0}catch(u){}}if(h){var z="cke-temp-"+(new Date).getTime();c.pasteHTML('\x3cspan id\x3d"'+z+'"\x3e\x3c/span\x3e');var v=b.document.getById(z);k.moveToPosition(v,CKEDITOR.POSITION_BEFORE_START);v.remove()}else{var D=b.document.$.elementFromPoint(e,f),C=new CKEDITOR.dom.element(D),B;if(C.equals(b.editable())||
|
|
727
|
+
"html"==C.getName())return g&&g.startContainer&&!g.startContainer.equals(b.editable())?g:null;B=C.getClientRect();e<B.left?k.setStartAt(C,CKEDITOR.POSITION_AFTER_START):k.setStartAt(C,CKEDITOR.POSITION_BEFORE_END);k.collapse(!0)}}catch(G){return null}}else return null}return k},initDragDataTransfer:function(a,b){var c=a.data.$?a.data.$.dataTransfer:null,e=new this.dataTransfer(c,b);"dragstart"===a.name&&e.storeId();c?this.dragData&&e.id==this.dragData.id?e=this.dragData:this.dragData=e:this.dragData?
|
|
728
728
|
e=this.dragData:this.dragData=e;a.data.dataTransfer=e},resetDragDataTransfer:function(){this.dragData=null},initPasteDataTransfer:function(a,b){if(this.isCustomCopyCutSupported){if(a&&a.data&&a.data.$){var c=a.data.$.clipboardData,e=new this.dataTransfer(c,b);"copy"!==a.name&&"cut"!==a.name||e.storeId();this.copyCutData&&e.id==this.copyCutData.id?(e=this.copyCutData,e.$=c):this.copyCutData=e;return e}return new this.dataTransfer(null,b)}return new this.dataTransfer(CKEDITOR.env.edge&&a&&a.data.$&&
|
|
729
|
-
a.data.$.clipboardData||null,b)},preventDefaultDropOnElement:function(a){a&&a.on("dragover",
|
|
729
|
+
a.data.$.clipboardData||null,b)},preventDefaultDropOnElement:function(a){a&&a.on("dragover",g)}};c=CKEDITOR.plugins.clipboard.isCustomDataTypesSupported?"cke/id":"Text";CKEDITOR.plugins.clipboard.dataTransfer=function(a,b){a&&(this.$=a);this._={metaRegExp:/^<meta.*?>/i,bodyRegExp:/<body(?:[\s\S]*?)>([\s\S]*)<\/body>/i,fragmentRegExp:/\s*\x3c!--StartFragment--\x3e|\x3c!--EndFragment--\x3e\s*/g,data:{},files:[],nativeHtmlCache:"",normalizeType:function(a){a=a.toLowerCase();return"text"==a||"text/plain"==
|
|
730
730
|
a?"Text":"url"==a?"URL":a}};this._.fallbackDataTransfer=new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this);this.id=this.getData(c);this.id||(this.id="Text"==c?"":"cke-"+CKEDITOR.tools.getUniqueId());b&&(this.sourceEditor=b,this.setData("text/html",b.getSelectedHtml(1)),"Text"==c||this.getData("text/plain")||this.setData("text/plain",b.getSelection().getSelectedText()))};CKEDITOR.DATA_TRANSFER_INTERNAL=1;CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2;CKEDITOR.DATA_TRANSFER_EXTERNAL=3;CKEDITOR.plugins.clipboard.dataTransfer.prototype=
|
|
731
731
|
{getData:function(a,b){a=this._.normalizeType(a);var c="text/html"==a&&b?this._.nativeHtmlCache:this._.data[a];if(void 0===c||null===c||""===c){if(this._.fallbackDataTransfer.isRequired())c=this._.fallbackDataTransfer.getData(a,b);else try{c=this.$.getData(a)||""}catch(e){c=""}"text/html"!=a||b||(c=this._stripHtml(c))}"Text"==a&&CKEDITOR.env.gecko&&this.getFilesCount()&&"file://"==c.substring(0,7)&&(c="");if("string"===typeof c)var f=c.indexOf("\x3c/html\x3e"),c=-1!==f?c.substring(0,f+7):c;return c},
|
|
732
732
|
setData:function(a,b){a=this._.normalizeType(a);"text/html"==a?(this._.data[a]=this._stripHtml(b),this._.nativeHtmlCache=b):this._.data[a]=b;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||"URL"==a||"Text"==a)if("Text"==c&&"Text"==a&&(this.id=b),this._.fallbackDataTransfer.isRequired())this._.fallbackDataTransfer.setData(a,b);else try{this.$.setData(a,b)}catch(e){}},storeId:function(){"Text"!==c&&this.setData(c,this.id)},getTransferType:function(a){return this.sourceEditor?this.sourceEditor==
|
|
@@ -740,53 +740,53 @@ CKEDITOR.plugins.clipboard.fallbackDataTransfer;-1===CKEDITOR.tools.indexOf(c._c
|
|
|
740
740
|
this._dataTransfer._.data[this._customDataFallbackType];a||(a=this._extractDataComment(this._getData(this._customDataFallbackType,!0)).content);return a},_getFallbackTypeData:function(){var a=CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes,b=this._extractDataComment(this._getData(this._customDataFallbackType,!0)).data||{},c=this._dataTransfer._.data;CKEDITOR.tools.array.forEach(a,function(a){void 0!==c[a]?b[a]=c[a]:void 0!==b[a]&&(b[a]=b[a])},this);return b},_isUnsupportedMimeTypeError:function(a){return a.message&&
|
|
741
741
|
-1!==a.message.search(/element not found/gi)},_extractDataComment:function(a){var b={data:null,content:a||""};if(a&&16<a.length){var c;(c=/\x3c!--cke-data:(.*?)--\x3e/g.exec(a))&&c[1]&&(b.data=JSON.parse(decodeURIComponent(c[1])),b.content=a.replace(c[0],""))}return b},_applyDataComment:function(a,b){var c="";b&&CKEDITOR.tools.object.keys(b).length&&(c="\x3c!--cke-data:"+encodeURIComponent(JSON.stringify(b))+"--\x3e");return c+(a&&a.length?a:"")}}})();CKEDITOR.config.clipboard_notificationDuration=
|
|
742
742
|
1E4;CKEDITOR.plugins.add("panelbutton",{requires:"button",onLoad:function(){function a(a){var h=this._;h.state!=CKEDITOR.TRISTATE_DISABLED&&(this.createPanel(a),h.on?h.panel.hide():h.panel.showBlock(this._.id,this.document.getById(this._.id),4))}CKEDITOR.ui.panelButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(l){var h=l.panel||{};delete l.panel;this.base(l);this.document=h.parent&&h.parent.getDocument()||CKEDITOR.document;h.block={attributes:h.attributes};h.toolbarRelated=!0;
|
|
743
|
-
this.hasArrow="listbox";this.click=a;this._={panelDefinition:h}},statics:{handler:{create:function(a){return new CKEDITOR.ui.panelButton(a)}}},proto:{createPanel:function(a){var h=this._;if(!h.panel){var f=this._.panelDefinition,e=this._.panelDefinition.block,m=f.parent||CKEDITOR.document.getBody(),
|
|
744
|
-
h.on=1;
|
|
743
|
+
this.hasArrow="listbox";this.click=a;this._={panelDefinition:h}},statics:{handler:{create:function(a){return new CKEDITOR.ui.panelButton(a)}}},proto:{createPanel:function(a){var h=this._;if(!h.panel){var f=this._.panelDefinition,e=this._.panelDefinition.block,m=f.parent||CKEDITOR.document.getBody(),k=this._.panel=new CKEDITOR.ui.floatPanel(a,m,f),f=k.addBlock(h.id,e),g=this,b=a.getCommand(this.command);k.onShow=function(){g.className&&this.element.addClass(g.className+"_panel");g.setState(CKEDITOR.TRISTATE_ON);
|
|
744
|
+
h.on=1;g.editorFocus&&a.focus();if(g.onOpen)g.onOpen()};k.onHide=function(c){g.className&&this.element.getFirst().removeClass(g.className+"_panel");!g.modes&&b?g.setStateFromCommand(b):g.setState(g.modes&&g.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);h.on=0;if(!c&&g.onClose)g.onClose()};k.onEscape=function(){k.hide(1);g.document.getById(h.id).focus()};if(this.onBlock)this.onBlock(k,f);f.onHide=function(){h.on=0;!g.modes&&g.command?g.setStateFromCommand(b):g.setState(CKEDITOR.TRISTATE_OFF)}}},
|
|
745
745
|
setStateFromCommand:function(a){this.setState(a.state)}}})},beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_PANELBUTTON,CKEDITOR.ui.panelButton.handler)}});CKEDITOR.UI_PANELBUTTON="panelbutton";(function(){CKEDITOR.plugins.add("panel",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_PANEL,CKEDITOR.ui.panel.handler)}});CKEDITOR.UI_PANEL="panel";CKEDITOR.ui.panel=function(a,e){e&&CKEDITOR.tools.extend(this,e);CKEDITOR.tools.extend(this,{className:"",css:[]});this.id=CKEDITOR.tools.getNextId();
|
|
746
746
|
this.document=a;this.isFramed=this.forceIFrame||this.css.length;this._={blocks:{}}};CKEDITOR.ui.panel.handler={create:function(a){return new CKEDITOR.ui.panel(a)}};var a=CKEDITOR.addTemplate("panel",'\x3cdiv lang\x3d"{langCode}" id\x3d"{id}" dir\x3d{dir} class\x3d"cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style\x3d"z-index:{z-index}" role\x3d"presentation"\x3e{frame}\x3c/div\x3e'),l=CKEDITOR.addTemplate("panel-frame",'\x3ciframe id\x3d"{id}" class\x3d"cke_panel_frame" role\x3d"presentation" frameborder\x3d"0" src\x3d"{src}"\x3e\x3c/iframe\x3e'),
|
|
747
747
|
h=CKEDITOR.addTemplate("panel-frame-inner",'\x3c!DOCTYPE html\x3e\x3chtml class\x3d"cke_panel_container {env}" dir\x3d"{dir}" lang\x3d"{langCode}"\x3e\x3chead\x3e{css}\x3c/head\x3e\x3cbody class\x3d"cke_{dir}" style\x3d"margin:0;padding:0" onload\x3d"{onload}"\x3e\x3c/body\x3e\x3c/html\x3e');CKEDITOR.ui.panel.prototype={render:function(f,e){var m={editorId:f.id,id:this.id,langCode:f.langCode,dir:f.lang.dir,cls:this.className,frame:"",env:CKEDITOR.env.cssClass,"z-index":f.config.baseFloatZIndex+1};
|
|
748
748
|
this.getHolderElement=function(){var a=this._.holder;if(!a){if(this.isFramed){var a=this.document.getById(this.id+"_frame"),b=a.getParent(),a=a.getFrameDocument();CKEDITOR.env.iOS&&b.setStyles({overflow:"scroll","-webkit-overflow-scrolling":"touch"});b=CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function(){this.isLoaded=!0;if(this.onLoad)this.onLoad()},this));a.write(h.output(CKEDITOR.tools.extend({css:CKEDITOR.tools.buildStyleHtml(this.css),onload:"window.parent.CKEDITOR.tools.callFunction("+
|
|
749
749
|
b+");"},m)));a.getWindow().$.CKEDITOR=CKEDITOR;a.on("keydown",function(a){var b=a.data.getKeystroke(),e=this.document.getById(this.id).getAttribute("dir");if("input"!==a.data.getTarget().getName()||37!==b&&39!==b)this._.onKeyDown&&!1===this._.onKeyDown(b)?"input"===a.data.getTarget().getName()&&32===b||a.data.preventDefault():(27==b||b==("rtl"==e?39:37))&&this.onEscape&&!1===this.onEscape(b)&&a.data.preventDefault()},this);a=a.getBody();a.unselectable();CKEDITOR.env.air&&CKEDITOR.tools.callFunction(b)}else a=
|
|
750
|
-
this.document.getById(this.id);this._.holder=a}return a};if(this.isFramed){var
|
|
750
|
+
this.document.getById(this.id);this._.holder=a}return a};if(this.isFramed){var k=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())":"";m.frame=l.output({id:this.id+"_frame",src:k})}k=a.output(m);e&&e.push(k);return k},addBlock:function(a,e){e=this._.blocks[a]=e instanceof CKEDITOR.ui.panel.block?e:new CKEDITOR.ui.panel.block(this.getHolderElement(),e);
|
|
751
751
|
this._.currentBlock||this.showBlock(a);return e},getBlock:function(a){return this._.blocks[a]},showBlock:function(a){a=this._.blocks[a];var e=this._.currentBlock,h=!this.forceIFrame||CKEDITOR.env.ie?this._.holder:this.document.getById(this.id+"_frame");e&&e.hide();this._.currentBlock=a;CKEDITOR.fire("ariaWidget",h);a._.focusIndex=-1;this._.onKeyDown=a.onKeyDown&&CKEDITOR.tools.bind(a.onKeyDown,a);a.show();return a},destroy:function(){this.element&&this.element.remove()}};CKEDITOR.ui.panel.block=CKEDITOR.tools.createClass({$:function(a,
|
|
752
752
|
e){this.element=a.append(a.getDocument().createElement("div",{attributes:{tabindex:-1,"class":"cke_panel_block"},styles:{display:"none"}}));e&&CKEDITOR.tools.extend(this,e);this.element.setAttributes({role:this.attributes.role||"presentation","aria-label":this.attributes["aria-label"],title:this.attributes.title||this.attributes["aria-label"]});this.keys={};this._.focusIndex=-1;this.element.disableContextMenu()},_:{markItem:function(a){-1!=a&&(a=this._.getItems().getItem(this._.focusIndex=a),CKEDITOR.env.webkit&&
|
|
753
|
-
a.getDocument().getWindow().focus(),a.focus(),this.onMark&&this.onMark(a))},markFirstDisplayed:function(a){for(var e=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&"none"==a.getStyle("display")},h=this._.getItems(),g,
|
|
754
|
-
proto:{show:function(){this.element.setStyle("display","")},hide:function(){this.onHide&&!0===this.onHide.call(this)||this.element.setStyle("display","none")},onKeyDown:function(a,e){var h=this.keys[a];switch(h){case "next":for(var
|
|
755
|
-
h.getItem(--
|
|
756
|
-
e.getUniqueId(),a.lang.dir,a.uiColor||"",m.css||"",
|
|
757
|
-
f,e,l||0);var b=l.element,c=b.getFirst(),d=this;b.disableContextMenu();this.element=b;this._={editor:h,panel:l,parentElement:f,definition:e,document:
|
|
758
|
-
showBlock:function(a,f,e,l,g
|
|
759
|
-
{x:0,y:0},
|
|
753
|
+
a.getDocument().getWindow().focus(),a.focus(),this.onMark&&this.onMark(a))},markFirstDisplayed:function(a){for(var e=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&"none"==a.getStyle("display")},h=this._.getItems(),k,g,b=h.count()-1;0<=b;b--)if(k=h.getItem(b),k.getAscendant(e)||(g=k,this._.focusIndex=b),"true"==k.getAttribute("aria-selected")){g=k;this._.focusIndex=b;break}g&&(a&&a(),CKEDITOR.env.webkit&&g.getDocument().getWindow().focus(),g.focus(),this.onMark&&this.onMark(g))},getItems:function(){return this.element.find("a,input")}},
|
|
754
|
+
proto:{show:function(){this.element.setStyle("display","")},hide:function(){this.onHide&&!0===this.onHide.call(this)||this.element.setStyle("display","none")},onKeyDown:function(a,e){var h=this.keys[a];switch(h){case "next":for(var k=this._.focusIndex,h=this._.getItems(),g;g=h.getItem(++k);)if(g.getAttribute("_cke_focus")&&g.$.offsetWidth){this._.focusIndex=k;g.focus(!0);break}return g||e?!1:(this._.focusIndex=-1,this.onKeyDown(a,1));case "prev":k=this._.focusIndex;for(h=this._.getItems();0<k&&(g=
|
|
755
|
+
h.getItem(--k));){if(g.getAttribute("_cke_focus")&&g.$.offsetWidth){this._.focusIndex=k;g.focus(!0);break}g=null}return g||e?!1:(this._.focusIndex=h.count(),this.onKeyDown(a,1));case "click":case "mouseup":return k=this._.focusIndex,(g=0<=k&&this._.getItems().getItem(k))&&g.fireEventHandler(h,{button:CKEDITOR.tools.normalizeMouseButton(CKEDITOR.MOUSE_BUTTON_LEFT,!0)}),!1}return!0}}})})();CKEDITOR.plugins.add("floatpanel",{requires:"panel"});(function(){function a(a,f,e,m,k){k=CKEDITOR.tools.genKey(f.getUniqueId(),
|
|
756
|
+
e.getUniqueId(),a.lang.dir,a.uiColor||"",m.css||"",k||"");var g=l[k];g||(g=l[k]=new CKEDITOR.ui.panel(f,m),g.element=e.append(CKEDITOR.dom.element.createFromHtml(g.render(a),f)),g.element.setStyles({display:"none",position:"absolute"}));return g}var l={};CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(h,f,e,l){function k(){d.hide()}e.forceIFrame=1;e.toolbarRelated&&h.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(f=CKEDITOR.document.getById("cke_"+h.name));var g=f.getDocument();l=a(h,g,
|
|
757
|
+
f,e,l||0);var b=l.element,c=b.getFirst(),d=this;b.disableContextMenu();this.element=b;this._={editor:h,panel:l,parentElement:f,definition:e,document:g,iframe:c,children:[],dir:h.lang.dir,showBlockParams:null,markFirst:void 0!==e.markFirst?e.markFirst:!0};h.on("mode",k);h.on("resize",k);g.getWindow().on("resize",function(){this.reposition()},this)},proto:{addBlock:function(a,f){return this._.panel.addBlock(a,f)},addListBlock:function(a,f){return this._.panel.addListBlock(a,f)},getBlock:function(a){return this._.panel.getBlock(a)},
|
|
758
|
+
showBlock:function(a,f,e,l,k,g){var b=this._.panel,c=b.showBlock(a);this._.showBlockParams=[].slice.call(arguments);this.allowBlur(!1);var d=this._.editor.editable();this._.returnFocus=d.hasFocus?d:new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);this._.hideTimeout=0;var n=this.element,d=this._.iframe,d=CKEDITOR.env.ie&&!CKEDITOR.env.edge?d:new CKEDITOR.dom.window(d.$.contentWindow),p=n.getDocument(),q=this._.parentElement.getPositionedAncestor(),y=f.getDocumentPosition(p),p=q?q.getDocumentPosition(p):
|
|
759
|
+
{x:0,y:0},t="rtl"==this._.dir,w=y.x+(l||0)-p.x,x=y.y+(k||0)-p.y;!t||1!=e&&4!=e?t||2!=e&&3!=e||(w+=f.$.offsetWidth-1):w+=f.$.offsetWidth;if(3==e||4==e)x+=f.$.offsetHeight-1;this._.panel._.offsetParentId=f.getId();n.setStyles({top:x+"px",left:0,display:""});n.setOpacity(0);n.getFirst().removeStyle("width");this._.editor.focusManager.add(d);this._.blurSet||(CKEDITOR.event.useCapture=!0,d.on("blur",function(a){function b(){delete this._.returnFocus;this.hide()}this.allowBlur()&&a.data.getPhase()==CKEDITOR.EVENT_PHASE_AT_TARGET&&
|
|
760
760
|
this.visible&&!this._.activeChild&&(CKEDITOR.env.iOS?this._.hideTimeout||(this._.hideTimeout=CKEDITOR.tools.setTimeout(b,0,this)):b.call(this))},this),d.on("focus",function(){this._.focused=!0;this.hideChild();this.allowBlur(!0)},this),CKEDITOR.env.iOS&&(d.on("touchstart",function(){clearTimeout(this._.hideTimeout)},this),d.on("touchend",function(){this._.hideTimeout=0;this.focus()},this)),CKEDITOR.event.useCapture=!1,this._.blurSet=1);b.onEscape=CKEDITOR.tools.bind(function(a){if(this.onEscape&&
|
|
761
761
|
!1===this.onEscape(a))return!1},this);CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.tools.bind(function(){var a=n;a.removeStyle("width");if(c.autoSize){var d=c.element.getDocument(),d=(CKEDITOR.env.webkit||CKEDITOR.env.edge?c.element:d.getBody()).$.scrollWidth;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&0<d&&(d+=(a.$.offsetWidth||0)-(a.$.clientWidth||0)+3);a.setStyle("width",d+10+"px");d=c.element.$.scrollHeight;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&0<d&&(d+=(a.$.offsetHeight||0)-(a.$.clientHeight||
|
|
762
|
-
0)+3);a.setStyle("height",d+"px");b._.currentBlock.element.setStyle("display","none").removeStyle("display")}else a.removeStyle("height");
|
|
763
|
-
a.top<f&&(
|
|
764
|
-
n.setStyles({top:
|
|
762
|
+
0)+3);a.setStyle("height",d+"px");b._.currentBlock.element.setStyle("display","none").removeStyle("display")}else a.removeStyle("height");t&&(w-=n.$.offsetWidth);n.setStyle("left",w+"px");var d=b.element.getWindow(),a=n.$.getBoundingClientRect(),d=d.getViewPaneSize(),e=a.width||a.right-a.left,f=a.height||a.bottom-a.top,k=t?a.right:d.width-a.left,h=t?d.width-a.right:a.left;t?k<e&&(w=h>e?w+e:d.width>e?w-a.left:w-a.right+d.width):k<e&&(w=h>e?w-e:d.width>e?w-a.right+d.width:w-a.left);e=a.top;d.height-
|
|
763
|
+
a.top<f&&(x=e>f?x-f:d.height>f?x-a.bottom+d.height:x-a.top);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&((d=a=n.$.offsetParent&&new CKEDITOR.dom.element(n.$.offsetParent))&&"html"==d.getName()&&(d=d.getDocument().getBody()),d&&"rtl"==d.getComputedStyle("direction")&&(w=CKEDITOR.env.ie8Compat?w-2*n.getDocument().getDocumentElement().$.scrollLeft:w-(a.$.scrollWidth-a.$.clientWidth)));var a=n.getFirst(),l;(l=a.getCustomData("activePanel"))&&l.onHide&&l.onHide.call(this,1);a.setCustomData("activePanel",this);
|
|
764
|
+
n.setStyles({top:x+"px",left:w+"px"});n.setOpacity(1);g&&g()},this);b.isLoaded?a():b.onLoad=a;CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus();c.element.focus();CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=a);this.allowBlur(!0);this._.markFirst&&(CKEDITOR.env.ie?CKEDITOR.tools.setTimeout(function(){c.markFirstDisplayed?c.markFirstDisplayed():c._.markFirstDisplayed()},0):c.markFirstDisplayed?c.markFirstDisplayed():
|
|
765
765
|
c._.markFirstDisplayed());this._.editor.fire("panelShow",this)},0,this)},CKEDITOR.env.air?200:0,this);this.visible=1;this.onShow&&this.onShow.call(this)},reposition:function(){var a=this._.showBlockParams;this.visible&&this._.showBlockParams&&(this.hide(),this.showBlock.apply(this,a))},focus:function(){if(CKEDITOR.env.webkit){var a=CKEDITOR.document.getActive();a&&!a.equals(this._.iframe)&&a.$.blur()}(this._.lastFocused||this._.iframe.getFrameDocument().getWindow()).focus()},blur:function(){var a=
|
|
766
766
|
this._.iframe.getFrameDocument().getActive();a&&a.is("a")&&(this._.lastFocused=a)},hide:function(a){if(this.visible&&(!this.onHide||!0!==this.onHide.call(this))){this.hideChild();CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur();this.element.setStyle("display","none");this.visible=0;this.element.getFirst().removeCustomData("activePanel");if(a=a&&this._.returnFocus)CKEDITOR.env.webkit&&a.type&&a.getWindow().$.focus(),a.focus();delete this._.lastFocused;this._.showBlockParams=
|
|
767
|
-
null;this._.editor.fire("panelHide",this)}},allowBlur:function(a){var f=this._.panel;void 0!==a&&(f.allowBlur=a);return f.allowBlur},showAsChild:function(a,f,e,l,g
|
|
768
|
-
""},100)},hideChild:function(a){var f=this._.activeChild;f&&(delete f.onHide,delete this._.activeChild,f.hide(),a&&this.focus())}}});CKEDITOR.on("instanceDestroyed",function(){var a=CKEDITOR.tools.isEmpty(CKEDITOR.instances),f;for(f in l){var e=l[f];a?e.destroy():e.element.hide()}a&&(l={})})})();CKEDITOR.plugins.add("colorbutton",{requires:"panelbutton,floatpanel",init:function(a){function l(b){var c=b.name,f=b.type,l=b.title,y=b.order,
|
|
769
|
-
f+"Style"]),
|
|
770
|
-
CKEDITOR.UI_PANELBUTTON,{label:l,title:l,command:
|
|
771
|
-
commandName:
|
|
772
|
-
f&&"transparent"==d&&c&&(c=c.getParent()));d&&"transparent"!=d||(d="#ffffff");!1!==
|
|
773
|
-
"#"+m(d));
|
|
774
|
-
f(a)};var
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
c.getItem(e);f.removeAttribute("aria-selected");b&&b==m(f.getAttribute("data-value"))&&f.setAttribute("aria-selected",!0)}}function m(a){return CKEDITOR.tools.normalizeHex("#"+CKEDITOR.tools.convertRgbToHex(a||"")).replace(/#/g,"")}var
|
|
767
|
+
null;this._.editor.fire("panelHide",this)}},allowBlur:function(a){var f=this._.panel;void 0!==a&&(f.allowBlur=a);return f.allowBlur},showAsChild:function(a,f,e,l,k,g){if(this._.activeChild!=a||a._.panel._.offsetParentId!=e.getId())this.hideChild(),a.onHide=CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){this._.focused||this.hide()},0,this)},this),this._.activeChild=a,this._.focused=!1,a.showBlock(f,e,l,k,g),this.blur(),(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&setTimeout(function(){a.element.getChild(0).$.style.cssText+=
|
|
768
|
+
""},100)},hideChild:function(a){var f=this._.activeChild;f&&(delete f.onHide,delete this._.activeChild,f.hide(),a&&this.focus())}}});CKEDITOR.on("instanceDestroyed",function(){var a=CKEDITOR.tools.isEmpty(CKEDITOR.instances),f;for(f in l){var e=l[f];a?e.destroy():e.element.hide()}a&&(l={})})})();CKEDITOR.plugins.add("colorbutton",{requires:"panelbutton,floatpanel",init:function(a){function l(b){var c=b.name,f=b.type,l=b.title,y=b.order,t=b.commandName;b=b.contentTransformations||{};var w=new CKEDITOR.style(k["colorButton_"+
|
|
769
|
+
f+"Style"]),x=CKEDITOR.tools.getNextId()+"_colorBox",r={type:f},A=new CKEDITOR.style(k["colorButton_"+f+"Style"],{color:"inherit"}),u;a.addCommand(t,{contextSensitive:!0,exec:function(a,b){if(!a.readOnly){var c=b.newStyle;a.removeStyle(A);a.focus();c&&a.applyStyle(c);a.fire("saveSnapshot")}},refresh:function(a,b){A.checkApplicable(b,a,a.activeFilter)?A.checkActive(b,a)?this.setState(CKEDITOR.TRISTATE_ON):this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)}});a.ui.add(c,
|
|
770
|
+
CKEDITOR.UI_PANELBUTTON,{label:l,title:l,command:t,editorFocus:0,toolbar:"colors,"+y,allowedContent:w,requiredContent:w,contentTransformations:b,panel:{css:CKEDITOR.skin.getPath("editor"),attributes:{role:"listbox","aria-label":g.panelTitle}},select:function(a){var b=k.colorButton_colors.split(",");a=CKEDITOR.tools.array.find(b,a);a=m(a);e(u,a);u._.markFirstDisplayed()},onBlock:function(b,c){u=c;c.autoSize=!0;c.element.addClass("cke_colorblock");c.element.setHtml(h({type:f,colorBoxId:x,colorData:r,
|
|
771
|
+
commandName:t}));c.element.getDocument().getBody().setStyle("overflow","hidden");CKEDITOR.ui.fire("ready",this);var d=c.keys,e="rtl"==a.lang.dir;d[e?37:39]="next";d[40]="next";d[9]="next";d[e?39:37]="prev";d[38]="prev";d[CKEDITOR.SHIFT+9]="prev";d[32]="click"},onOpen:function(){var b=a.getSelection(),c=b&&b.getStartElement(),d=a.elementPath(c);if(!d)return null;c=d.block||d.blockLimit||a.document.getBody();do d=c&&c.getComputedStyle("back"==f?"background-color":"color")||"transparent";while("back"==
|
|
772
|
+
f&&"transparent"==d&&c&&(c=c.getParent()));d&&"transparent"!=d||(d="#ffffff");!1!==k.colorButton_enableAutomatic&&this._.panel._.iframe.getFrameDocument().getById(x).setStyle("background-color",d);if(c=b&&b.getRanges()[0]){for(var b=new CKEDITOR.dom.walker(c),g=c.collapsed?c.startContainer:b.next(),c="";g;){g.type!==CKEDITOR.NODE_ELEMENT&&(g=g.getParent());g=m(g.getComputedStyle("back"==f?"background-color":"color"));c=c||g;if(c!==g){c="";break}g=b.next()}"transparent"==c&&(c="");"fore"==f&&(r.automaticTextColor=
|
|
773
|
+
"#"+m(d));r.selectionColor=c?"#"+c:"";e(u,c)}return d}})}function h(b){function c(b){b=b&&new CKEDITOR.style(u,{color:b});a.execCommand(m,{newStyle:b})}var e=b.type,h=b.colorBoxId,l=b.colorData,m=b.commandName;b=[];var w=k.colorButton_colors.split(","),x=k.colorButton_colorsPerRow||6,r=a.plugins.colordialog&&!1!==k.colorButton_enableMore,A=w.length+(r?2:1),u=a.config["colorButton_"+e+"Style"];u.childRule="back"==e?function(a){return f(a)}:function(a){return!(a.is("a")||a.getElementsByTag("a").count())||
|
|
774
|
+
f(a)};var z=CKEDITOR.tools.addFunction(function(b){a.focus();a.fire("saveSnapshot");"?"==b?a.getColorFromDialog(function(a){a&&c(a)},null,l):c(b&&"#"+b)});!1!==k.colorButton_enableAutomatic&&b.push('\x3ca class\x3d"cke_colorauto" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',g.auto,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',z,",null,'",e,"');return false;\" href\x3d\"javascript:void('",g.auto,'\')" role\x3d"option" aria-posinset\x3d"1" aria-setsize\x3d"',
|
|
775
|
+
A,'"\x3e\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e\x3ctr\x3e\x3ctd colspan\x3d"'+x+'" align\x3d"center"\x3e\x3cspan class\x3d"cke_colorbox" id\x3d"',h,'"\x3e\x3c/span\x3e',g.auto,"\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/a\x3e");b.push('\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e');for(h=0;h<w.length;h++){0===h%x&&b.push("\x3c/tr\x3e\x3ctr\x3e");var v=w[h].split("/"),D=v[0],C=v[1]||D;b.push('\x3ctd\x3e\x3ca class\x3d"cke_colorbox" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
|
|
776
|
+
v[1]?D:a.lang.colorbutton.colors[C]||C,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',z,",'",C,"','",e,"'); return false;\" href\x3d\"javascript:void('",C,'\')" data-value\x3d"'+C+'" role\x3d"option" aria-posinset\x3d"',h+2,'" aria-setsize\x3d"',A,'"\x3e\x3cspan class\x3d"cke_colorbox" style\x3d"background-color:#',C,'"\x3e\x3c/span\x3e\x3c/a\x3e\x3c/td\x3e')}r&&b.push('\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d"'+x+'" align\x3d"center"\x3e\x3ca class\x3d"cke_colormore" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
|
|
777
|
+
g.more,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',z,",'?','",e,"');return false;\" href\x3d\"javascript:void('",g.more,"')\"",' role\x3d"option" aria-posinset\x3d"',A,'" aria-setsize\x3d"',A,'"\x3e',g.more,"\x3c/a\x3e\x3c/td\x3e");b.push("\x3c/tr\x3e\x3c/table\x3e");return b.join("")}function f(a){return"false"==a.getAttribute("contentEditable")||a.getAttribute("data-nostyle")}function e(a,b){for(var c=a._.getItems(),e=0;e<c.count();e++){var f=
|
|
778
|
+
c.getItem(e);f.removeAttribute("aria-selected");b&&b==m(f.getAttribute("data-value"))&&f.setAttribute("aria-selected",!0)}}function m(a){return CKEDITOR.tools.normalizeHex("#"+CKEDITOR.tools.convertRgbToHex(a||"")).replace(/#/g,"")}var k=a.config,g=a.lang.colorbutton;if(!CKEDITOR.env.hc){l({name:"TextColor",type:"fore",commandName:"textColor",title:g.textColorTitle,order:10,contentTransformations:[[{element:"font",check:"span{color}",left:function(a){return!!a.attributes.color},right:function(a){a.name=
|
|
779
779
|
"span";a.attributes.color&&(a.styles.color=a.attributes.color);delete a.attributes.color}}]]});var b,c=a.config.colorButton_normalizeBackground;if(void 0===c||c)b=[[{element:"span",left:function(a){var b=CKEDITOR.tools;if("span"!=a.name||!a.styles||!a.styles.background)return!1;a=b.style.parse.background(a.styles.background);return a.color&&1===b.object.keys(a).length},right:function(b){var c=(new CKEDITOR.style(a.config.colorButton_backStyle,{color:b.styles.background})).getDefinition();b.name=c.element;
|
|
780
|
-
b.styles=c.styles;b.attributes=c.attributes||{};return b}}]];l({name:"BGColor",type:"back",commandName:"bgColor",title:
|
|
781
|
-
CKEDITOR.config.colorButton_backStyle={element:"span",styles:{"background-color":"#(color)"}};CKEDITOR.plugins.colordialog={requires:"dialog",init:function(a){var l=new CKEDITOR.dialogCommand("colordialog");l.editorFocus=!1;a.addCommand("colordialog",l);CKEDITOR.dialog.add("colordialog",this.path+"dialogs/colordialog.js");a.getColorFromDialog=function(h,f,e){var l,g,
|
|
782
|
-
a);h.call(f,a)};
|
|
780
|
+
b.styles=c.styles;b.attributes=c.attributes||{};return b}}]];l({name:"BGColor",type:"back",commandName:"bgColor",title:g.bgColorTitle,order:20,contentTransformations:b})}}});CKEDITOR.config.colorButton_colors="1ABC9C,2ECC71,3498DB,9B59B6,4E5F70,F1C40F,16A085,27AE60,2980B9,8E44AD,2C3E50,F39C12,E67E22,E74C3C,ECF0F1,95A5A6,DDD,FFF,D35400,C0392B,BDC3C7,7F8C8D,999,000";CKEDITOR.config.colorButton_foreStyle={element:"span",styles:{color:"#(color)"},overrides:[{element:"font",attributes:{color:null}}]};
|
|
781
|
+
CKEDITOR.config.colorButton_backStyle={element:"span",styles:{"background-color":"#(color)"}};CKEDITOR.plugins.colordialog={requires:"dialog",init:function(a){var l=new CKEDITOR.dialogCommand("colordialog");l.editorFocus=!1;a.addCommand("colordialog",l);CKEDITOR.dialog.add("colordialog",this.path+"dialogs/colordialog.js");a.getColorFromDialog=function(h,f,e){var l,k,g,b;l=function(a){g(this);a="ok"==a.name?this.getValueOf("picker","selectedColor"):null;/^[0-9a-f]{3}([0-9a-f]{3})?$/i.test(a)&&(a="#"+
|
|
782
|
+
a);h.call(f,a)};k=function(a){e&&(a.data=e)};g=function(a){a.removeListener("ok",l);a.removeListener("cancel",l);a.removeListener("show",k)};b=function(a){a.on("ok",l);a.on("cancel",l);a.on("show",k,null,null,5)};a.execCommand("colordialog");if(a._.storedDialogs&&a._.storedDialogs.colordialog)b(a._.storedDialogs.colordialog);else CKEDITOR.on("dialogDefinition",function(a){if("colordialog"==a.data.name){var d=a.data.definition;a.removeListener();d.onLoad=CKEDITOR.tools.override(d.onLoad,function(a){return function(){b(this);
|
|
783
783
|
d.onLoad=a;"function"==typeof a&&a.call(this)}})}})}}};CKEDITOR.plugins.add("colordialog",CKEDITOR.plugins.colordialog);(function(){function a(a,e,b,c){var d=new CKEDITOR.dom.walker(a);if(a=a.startContainer.getAscendant(e,!0)||a.endContainer.getAscendant(e,!0))if(b(a),c)return;for(;a=d.next();)if(a=a.getAscendant(e,!0))if(b(a),c)break}function l(a,e){var b={ul:"ol",ol:"ul"};return-1!==f(e,function(c){return c.element===a||c.element===b[a]})}function h(a){this.styles=null;this.sticky=!1;this.editor=
|
|
784
|
-
a;this.filter=new CKEDITOR.filter(a,a.config.copyFormatting_allowRules);!0===a.config.copyFormatting_allowRules&&(this.filter.disabled=!0);a.config.copyFormatting_disallowRules&&this.filter.disallow(a.config.copyFormatting_disallowRules)}var f=CKEDITOR.tools.indexOf,e=CKEDITOR.tools.getMouseButton,m=!1;CKEDITOR.plugins.add("copyformatting",{lang:"az,de,en,it,ja,nb,nl,oc,pl,pt-br,ru,sv,tr,zh,zh-cn",icons:"copyformatting",hidpi:!0,init:function(a){var
|
|
785
|
-
m||(CKEDITOR.document.appendStyleSheet(this.path+"styles/copyformatting.css"),m=!0);a.addContentsCss&&a.addContentsCss(this.path+"styles/copyformatting.css");a.copyFormatting=new
|
|
784
|
+
a;this.filter=new CKEDITOR.filter(a,a.config.copyFormatting_allowRules);!0===a.config.copyFormatting_allowRules&&(this.filter.disabled=!0);a.config.copyFormatting_disallowRules&&this.filter.disallow(a.config.copyFormatting_disallowRules)}var f=CKEDITOR.tools.indexOf,e=CKEDITOR.tools.getMouseButton,m=!1;CKEDITOR.plugins.add("copyformatting",{lang:"az,de,en,it,ja,nb,nl,oc,pl,pt-br,ru,sv,tr,zh,zh-cn",icons:"copyformatting",hidpi:!0,init:function(a){var g=CKEDITOR.plugins.copyformatting;g._addScreenReaderContainer();
|
|
785
|
+
m||(CKEDITOR.document.appendStyleSheet(this.path+"styles/copyformatting.css"),m=!0);a.addContentsCss&&a.addContentsCss(this.path+"styles/copyformatting.css");a.copyFormatting=new g.state(a);a.addCommand("copyFormatting",g.commands.copyFormatting);a.addCommand("applyFormatting",g.commands.applyFormatting);a.ui.addButton("CopyFormatting",{label:a.lang.copyformatting.label,command:"copyFormatting",toolbar:"cleanup,0"});a.on("contentDom",function(){var b=a.getCommand("copyFormatting"),c=a.editable(),
|
|
786
786
|
d=c.isInline()?c:a.document,f=a.ui.get("CopyFormatting");c.attachListener(d,"mouseup",function(c){e(c)===CKEDITOR.MOUSE_BUTTON_LEFT&&b.state===CKEDITOR.TRISTATE_ON&&a.execCommand("applyFormatting")});c.attachListener(CKEDITOR.document,"mouseup",function(d){e(d)!==CKEDITOR.MOUSE_BUTTON_LEFT||b.state!==CKEDITOR.TRISTATE_ON||c.contains(d.data.getTarget())||a.execCommand("copyFormatting")});f&&(d=CKEDITOR.document.getById(f._.id),c.attachListener(d,"dblclick",function(){a.execCommand("copyFormatting",
|
|
787
787
|
{sticky:!0})}),c.attachListener(d,"mouseup",function(a){a.data.stopPropagation()}))});a.config.copyFormatting_keystrokeCopy&&a.setKeystroke(a.config.copyFormatting_keystrokeCopy,"copyFormatting");a.on("key",function(b){var c=a.getCommand("copyFormatting");b=b.data.domEvent;b.getKeystroke&&27===b.getKeystroke()&&c.state===CKEDITOR.TRISTATE_ON&&a.execCommand("copyFormatting")});a.copyFormatting.on("extractFormatting",function(b){var c=b.data.element;if(c.contains(a.editable())||c.equals(a.editable()))return b.cancel();
|
|
788
|
-
c=
|
|
789
|
-
b.editor):d[m].remove(b.editor):l(e.element,b.data.styles)&&
|
|
788
|
+
c=g._convertElementToStyleDef(c);if(!a.copyFormatting.filter.check(new CKEDITOR.style(c),!0,!0))return b.cancel();b.data.styleDef=c});a.copyFormatting.on("applyFormatting",function(b){if(!b.data.preventFormatStripping){var c=b.data.range,d=g._extractStylesFromRange(a,c),e=g._determineContext(c),h,m;if(a.copyFormatting._isContextAllowed(e))for(m=0;m<d.length;m++)e=d[m],h=c.createBookmark(),-1===f(g.preservedElements,e.element)?CKEDITOR.env.webkit&&!CKEDITOR.env.chrome?d[m].removeFromRange(b.data.range,
|
|
789
|
+
b.editor):d[m].remove(b.editor):l(e.element,b.data.styles)&&g._removeStylesFromElementInRange(c,e.element),c.moveToBookmark(h)}});a.copyFormatting.on("applyFormatting",function(b){var c=CKEDITOR.plugins.copyformatting,d=c._determineContext(b.data.range);"list"===d&&a.copyFormatting._isContextAllowed("list")?c._applyStylesToListContext(b.editor,b.data.range,b.data.styles):"table"===d&&a.copyFormatting._isContextAllowed("table")?c._applyStylesToTableContext(b.editor,b.data.range,b.data.styles):a.copyFormatting._isContextAllowed("text")&&
|
|
790
790
|
c._applyStylesToTextContext(b.editor,b.data.range,b.data.styles)},null,null,999)}});h.prototype._isContextAllowed=function(a){var e=this.editor.config.copyFormatting_allowedContexts;return!0===e||-1!==f(e,a)};CKEDITOR.event.implementOn(h.prototype);CKEDITOR.plugins.copyformatting={state:h,inlineBoundary:"h1 h2 h3 h4 h5 h6 p div".split(" "),excludedAttributes:["id","style","href","data-cke-saved-href","dir"],elementsForInlineTransform:["li"],excludedElementsFromInlineTransform:["table","thead","tbody",
|
|
791
791
|
"ul","ol"],excludedAttributesFromInlineTransform:["value","type"],preservedElements:"ul ol li td th tr thead tbody table".split(" "),breakOnElements:["ul","ol","table"],_initialKeystrokePasteCommand:null,commands:{copyFormatting:{exec:function(a,e){var b=CKEDITOR.plugins.copyformatting,c=a.copyFormatting,d=e?"keystrokeHandler"==e.from:!1,f=e?e.sticky||d:!1,h=b._getCursorContainer(a),l=CKEDITOR.document.getDocumentElement();if(this.state===CKEDITOR.TRISTATE_ON)return c.styles=null,c.sticky=!1,h.removeClass("cke_copyformatting_active"),
|
|
792
792
|
l.removeClass("cke_copyformatting_disabled"),l.removeClass("cke_copyformatting_tableresize_cursor"),b._putScreenReaderMessage(a,"canceled"),b._detachPasteKeystrokeHandler(a),this.setState(CKEDITOR.TRISTATE_OFF);c.styles=b._extractStylesFromElement(a,a.elementPath().lastElement);this.setState(CKEDITOR.TRISTATE_ON);d||(h.addClass("cke_copyformatting_active"),l.addClass("cke_copyformatting_tableresize_cursor"),a.config.copyFormatting_outerCursor&&l.addClass("cke_copyformatting_disabled"));c.sticky=f;
|
|
@@ -794,13 +794,13 @@ b._putScreenReaderMessage(a,"copied");b._attachPasteKeystrokeHandler(a)}},applyF
|
|
|
794
794
|
null,h.removeClass("cke_copyformatting_active"),l.removeClass("cke_copyformatting_disabled"),l.removeClass("cke_copyformatting_tableresize_cursor"),b.setState(CKEDITOR.TRISTATE_OFF),d._detachPasteKeystrokeHandler(a));d._putScreenReaderMessage(a,c?"applied":"canceled")}}},_getCursorContainer:function(a){return a.elementMode===CKEDITOR.ELEMENT_MODE_INLINE?a.editable():a.editable().getParent()},_convertElementToStyleDef:function(a){var e=CKEDITOR.tools,b=a.getAttributes(CKEDITOR.plugins.copyformatting.excludedAttributes),
|
|
795
795
|
e=e.parseCssText(a.getAttribute("style"),!0,!0);return{element:a.getName(),type:CKEDITOR.STYLE_INLINE,attributes:b,styles:e}},_extractStylesFromElement:function(a,e){var b={},c=[];do if(e.type===CKEDITOR.NODE_ELEMENT&&!e.hasAttribute("data-cke-bookmark")&&(b.element=e,a.copyFormatting.fire("extractFormatting",b,a)&&b.styleDef&&c.push(new CKEDITOR.style(b.styleDef)),e.getName&&-1!==f(CKEDITOR.plugins.copyformatting.breakOnElements,e.getName())))break;while((e=e.getParent())&&e.type===CKEDITOR.NODE_ELEMENT);
|
|
796
796
|
return c},_extractStylesFromRange:function(a,e){for(var b=[],c=new CKEDITOR.dom.walker(e),d;d=c.next();)b=b.concat(CKEDITOR.plugins.copyformatting._extractStylesFromElement(a,d));return b},_removeStylesFromElementInRange:function(a,e){for(var b=-1!==f(["ol","ul","table"],e),c=new CKEDITOR.dom.walker(a),d;d=c.next();)if(d=d.getAscendant(e,!0))if(d.removeAttributes(d.getAttributes()),b)break},_getSelectedWordOffset:function(a){function e(a,b){return a[b?"getPrevious":"getNext"](function(a){return a.type!==
|
|
797
|
-
CKEDITOR.NODE_COMMENT})}function b(a){return a.type==CKEDITOR.NODE_ELEMENT?(a=a.getHtml().replace(/<span.*?> <\/span>/g,""),a.replace(/<.*?>/g,"")):a.getText()}function c(a,d){var
|
|
798
|
-
CKEDITOR.NODE_TEXT;)
|
|
799
|
-
(h=c(m),
|
|
797
|
+
CKEDITOR.NODE_COMMENT})}function b(a){return a.type==CKEDITOR.NODE_ELEMENT?(a=a.getHtml().replace(/<span.*?> <\/span>/g,""),a.replace(/<.*?>/g,"")):a.getText()}function c(a,d){var k=a,h=/\s/g,l="p br ol ul li td th div caption body".split(" "),m=!1,v=!1,n,p;do{for(n=e(k,d);!n&&k.getParent();){k=k.getParent();if(-1!==f(l,k.getName())){v=m=!0;break}n=e(k,d)}if(n&&n.getName&&-1!==f(l,n.getName())){m=!0;break}k=n}while(k&&k.getStyle&&("none"==k.getStyle("display")||!k.getText()));for(k||(k=a);k.type!==
|
|
798
|
+
CKEDITOR.NODE_TEXT;)k=!m||d||v?k.getChild(0):k.getChild(k.getChildCount()-1);for(l=b(k);null!=(v=h.exec(l))&&(p=v.index,d););if("number"!==typeof p&&!m)return c(k,d);if(m)d?p=0:(h=/([\.\b]*$)/,p=(v=h.exec(l))?v.index:l.length);else if(d&&(p+=1,p>l.length))return c(k);return{node:k,offset:p}}var d=/\b\w+\b/ig,h,l,m,y,t;m=y=t=a.startContainer;for(h=b(m);null!=(l=d.exec(h));)if(l.index+l[0].length>=a.startOffset)return a=l.index,d=l.index+l[0].length,0===l.index&&(l=c(m,!0),y=l.node,a=l.offset),d>=h.length&&
|
|
799
|
+
(h=c(m),t=h.node,d=h.offset),{startNode:y,startOffset:a,endNode:t,endOffset:d};return null},_filterStyles:function(a){var e=CKEDITOR.tools.isEmpty,b=[],c,d;for(d=0;d<a.length;d++)c=a[d]._.definition,-1!==CKEDITOR.tools.indexOf(CKEDITOR.plugins.copyformatting.inlineBoundary,c.element)&&(c.element=a[d].element="span"),"span"===c.element&&e(c.attributes)&&e(c.styles)||b.push(a[d]);return b},_determineContext:function(a){function e(b){var c=new CKEDITOR.dom.walker(a),d;if(a.startContainer.getAscendant(b,
|
|
800
800
|
!0)||a.endContainer.getAscendant(b,!0))return!0;for(;d=c.next();)if(d.getAscendant(b,!0))return!0}return e({ul:1,ol:1})?"list":e("table")?"table":"text"},_applyStylesToTextContext:function(a,e,b){var c=CKEDITOR.plugins.copyformatting,d=c.excludedAttributesFromInlineTransform,h,l;CKEDITOR.env.webkit&&!CKEDITOR.env.chrome&&a.getSelection().selectRanges([e]);for(h=0;h<b.length;h++)if(e=b[h],-1===f(c.excludedElementsFromInlineTransform,e.element)){if(-1!==f(c.elementsForInlineTransform,e.element))for(e.element=
|
|
801
801
|
e._.definition.element="span",l=0;l<d.length;l++)e._.definition.attributes[d[l]]&&delete e._.definition.attributes[d[l]];e.apply(a)}},_applyStylesToListContext:function(e,f,b){var c,d,h;for(h=0;h<b.length;h++)c=b[h],d=f.createBookmark(),"ol"===c.element||"ul"===c.element?a(f,{ul:1,ol:1},function(a){var b=c;a.getName()!==b.element&&a.renameNode(b.element);b.applyToObject(a)},!0):"li"===c.element?a(f,"li",function(a){c.applyToObject(a)}):CKEDITOR.plugins.copyformatting._applyStylesToTextContext(e,f,
|
|
802
|
-
[c]),f.moveToBookmark(d)},_applyStylesToTableContext:function(e,
|
|
803
|
-
|
|
802
|
+
[c]),f.moveToBookmark(d)},_applyStylesToTableContext:function(e,g,b){function c(a,b){a.getName()!==b.element&&(b=b.getDefinition(),b.element=a.getName(),b=new CKEDITOR.style(b));b.applyToObject(a)}var d,h,l;for(l=0;l<b.length;l++)d=b[l],h=g.createBookmark(),-1!==f(["table","tr"],d.element)?a(g,d.element,function(a){d.applyToObject(a)}):-1!==f(["td","th"],d.element)?a(g,{td:1,th:1},function(a){c(a,d)}):-1!==f(["thead","tbody"],d.element)?a(g,{thead:1,tbody:1},function(a){c(a,d)}):CKEDITOR.plugins.copyformatting._applyStylesToTextContext(e,
|
|
803
|
+
g,[d]),g.moveToBookmark(h)},_applyFormat:function(a,e){var b=a.getSelection().getRanges()[0],c=CKEDITOR.plugins.copyformatting,d,f;if(!b)return!1;if(b.collapsed){f=a.getSelection().createBookmarks();if(!(d=c._getSelectedWordOffset(b)))return;b=a.createRange();b.setStart(d.startNode,d.startOffset);b.setEnd(d.endNode,d.endOffset);b.select()}e=c._filterStyles(e);if(!a.copyFormatting.fire("applyFormatting",{styles:e,range:b,preventFormatStripping:!1},a))return!1;f&&a.getSelection().selectBookmarks(f);
|
|
804
804
|
return!0},_putScreenReaderMessage:function(a,e){var b=this._getScreenReaderContainer();b&&b.setText(a.lang.copyformatting.notification[e])},_addScreenReaderContainer:function(){if(this._getScreenReaderContainer())return this._getScreenReaderContainer();if(!CKEDITOR.env.ie6Compat&&!CKEDITOR.env.ie7Compat)return CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_screen_reader_only cke_copyformatting_notification"\x3e\x3cdiv aria-live\x3d"polite"\x3e\x3c/div\x3e\x3c/div\x3e')).getChild(0)},
|
|
805
805
|
_getScreenReaderContainer:function(){if(!CKEDITOR.env.ie6Compat&&!CKEDITOR.env.ie7Compat)return CKEDITOR.document.getBody().findOne(".cke_copyformatting_notification div[aria-live]")},_attachPasteKeystrokeHandler:function(a){var e=a.config.copyFormatting_keystrokePaste;e&&(this._initialKeystrokePasteCommand=a.keystrokeHandler.keystrokes[e],a.setKeystroke(e,"applyFormatting"))},_detachPasteKeystrokeHandler:function(a){var e=a.config.copyFormatting_keystrokePaste;e&&a.setKeystroke(e,this._initialKeystrokePasteCommand||
|
|
806
806
|
!1)}};CKEDITOR.config.copyFormatting_outerCursor=!0;CKEDITOR.config.copyFormatting_allowRules="b s u i em strong span p div td th ol ul li(*)[*]{*}";CKEDITOR.config.copyFormatting_disallowRules="*[data-cke-widget*,data-widget*,data-cke-realelement](cke_widget*)";CKEDITOR.config.copyFormatting_allowedContexts=!0;CKEDITOR.config.copyFormatting_keystrokeCopy=CKEDITOR.CTRL+CKEDITOR.SHIFT+67;CKEDITOR.config.copyFormatting_keystrokePaste=CKEDITOR.CTRL+CKEDITOR.SHIFT+86})();CKEDITOR.plugins.add("menu",{requires:"floatpanel",
|
|
@@ -814,67 +814,67 @@ this));for(var c in b){var d=this.editor.getMenuItem(c);d&&(d.state=b[c],e.add(d
|
|
|
814
814
|
l=this._.panel,m=this._.element;if(!l){l=this._.panel=new CKEDITOR.ui.floatPanel(this.editor,CKEDITOR.document.getBody(),this._.panelDefinition,this._.level);l.onEscape=CKEDITOR.tools.bind(function(a){if(!1===this._.onEscape(a))return!1},this);l.onShow=function(){l._.panel.getHolderElement().getParent().addClass("cke").addClass("cke_reset_all")};l.onHide=CKEDITOR.tools.bind(function(){this._.onHide&&this._.onHide()},this);m=l.addBlock(this.id,this._.panelDefinition.block);m.autoSize=!0;var y=m.keys;
|
|
815
815
|
y[40]="next";y[9]="next";y[38]="prev";y[CKEDITOR.SHIFT+9]="prev";y["rtl"==h.lang.dir?37:39]=CKEDITOR.env.ie?"mouseup":"click";y[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(y[13]="mouseup");m=this._.element=m.element;y=m.getDocument();y.getBody().setStyle("overflow","hidden");y.getElementsByTag("html").getItem(0).setStyle("overflow","hidden");this._.itemOverFn=CKEDITOR.tools.addFunction(function(a){clearTimeout(this._.showSubTimeout);this._.showSubTimeout=CKEDITOR.tools.setTimeout(this._.showSubMenu,
|
|
816
816
|
h.config.menu_subMenuDelay||400,this,[a])},this);this._.itemOutFn=CKEDITOR.tools.addFunction(function(){clearTimeout(this._.showSubTimeout)},this);this._.itemClickFn=CKEDITOR.tools.addFunction(function(a){var b=this.items[a];if(b.state==CKEDITOR.TRISTATE_DISABLED)this.hide(1);else if(b.getItems)this._.showSubMenu(a);else this._.onClick(b)},this)}a(d);for(var y=h.elementPath(),y=['\x3cdiv class\x3d"cke_menu'+(y&&y.direction()!=h.lang.dir?" cke_mixed_dir_content":"")+'" role\x3d"presentation"\x3e'],
|
|
817
|
-
|
|
818
|
-
findItemByCommandName:function(a){var e=CKEDITOR.tools.array.filter(this.items,function(b){return a===b.command});return e.length?(e=e[0],{item:e,element:this._.element.findOne("."+e.className)}):null}}});CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(a,e,b){CKEDITOR.tools.extend(this,b,{order:0,className:"cke_menubutton__"+e});this.group=a._.menuGroups[this.group];this.editor=a;this.name=e},proto:{render:function(a,
|
|
819
|
-
this.state,h="",l=this.editor,
|
|
820
|
-
|
|
821
|
-
this.icon?null:this.icon,this.iconOffset),shortcutHtml:y?m.output({shortcut:y.display}):"",arrowHtml:
|
|
822
|
-
$:function(a){this.base.call(this,a,{panel:{css:a.config.contextmenu_contentsCss,className:"cke_menu_panel",attributes:{"aria-label":a.lang.contextmenu.options}}})},proto:{addTarget:function(a,l){function h(){e=!1}var f,e;a.on("contextmenu",function(a){a=a.data;var
|
|
823
|
-
!0);b&&"false"==b.getAttribute("contenteditable")&&
|
|
817
|
+
t=d.length,w=t&&d[0].group,x=0;x<t;x++){var r=d[x];w!=r.group&&(y.push('\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'),w=r.group);r.render(this,x,y)}y.push("\x3c/div\x3e");m.setHtml(y.join(""));CKEDITOR.ui.fire("ready",this);this.parent?this.parent._.panel.showAsChild(l,this.id,e,f,b,c):l.showBlock(this.id,e,f,b,c);h.fire("menuShow",[l])},addListener:function(a){this._.listeners.push(a)},hide:function(a){this._.onHide&&this._.onHide();this._.panel&&this._.panel.hide(a)},
|
|
818
|
+
findItemByCommandName:function(a){var e=CKEDITOR.tools.array.filter(this.items,function(b){return a===b.command});return e.length?(e=e[0],{item:e,element:this._.element.findOne("."+e.className)}):null}}});CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(a,e,b){CKEDITOR.tools.extend(this,b,{order:0,className:"cke_menubutton__"+e});this.group=a._.menuGroups[this.group];this.editor=a;this.name=e},proto:{render:function(a,g,b){var c=a.id+String(g),d="undefined"==typeof this.state?CKEDITOR.TRISTATE_OFF:
|
|
819
|
+
this.state,h="",l=this.editor,q,y,t=d==CKEDITOR.TRISTATE_ON?"on":d==CKEDITOR.TRISTATE_DISABLED?"disabled":"off";this.role in{menuitemcheckbox:1,menuitemradio:1}&&(h=' aria-checked\x3d"'+(d==CKEDITOR.TRISTATE_ON?"true":"false")+'"');var w=this.getItems,x="\x26#"+("rtl"==this.editor.lang.dir?"9668":"9658")+";",r=this.name;this.icon&&!/\./.test(this.icon)&&(r=this.icon);this.command&&(q=l.getCommand(this.command),(q=l.getCommandKeystroke(q))&&(y=CKEDITOR.tools.keystrokeToString(l.lang.common.keyboard,
|
|
820
|
+
q)));q=CKEDITOR.tools.htmlEncodeAttr(this.label);a={id:c,name:this.name,iconName:r,label:this.label,attrLabel:q,cls:this.className||"",state:t,hasPopup:w?"true":"false",disabled:d==CKEDITOR.TRISTATE_DISABLED,title:q+(y?" ("+y.display+")":""),ariaShortcut:y?l.lang.common.keyboardShortcut+" "+y.aria:"",href:"javascript:void('"+(q||"").replace("'")+"')",hoverFn:a._.itemOverFn,moveOutFn:a._.itemOutFn,clickFn:a._.itemClickFn,index:g,iconStyle:CKEDITOR.skin.getIconStyle(r,"rtl"==this.editor.lang.dir,r==
|
|
821
|
+
this.icon?null:this.icon,this.iconOffset),shortcutHtml:y?m.output({shortcut:y.display}):"",arrowHtml:w?e.output({label:x}):"",role:this.role?this.role:"menuitem",ariaChecked:h};f.output(a,b)}}})})();CKEDITOR.config.menu_groups="clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div";CKEDITOR.plugins.add("contextmenu",{requires:"menu",onLoad:function(){CKEDITOR.plugins.contextMenu=CKEDITOR.tools.createClass({base:CKEDITOR.menu,
|
|
822
|
+
$:function(a){this.base.call(this,a,{panel:{css:a.config.contextmenu_contentsCss,className:"cke_menu_panel",attributes:{"aria-label":a.lang.contextmenu.options}}})},proto:{addTarget:function(a,l){function h(){e=!1}var f,e;a.on("contextmenu",function(a){a=a.data;var g=CKEDITOR.env.webkit?f:CKEDITOR.env.mac?a.$.metaKey:a.$.ctrlKey;if(!l||!g)if(a.preventDefault(),!e){if(CKEDITOR.env.mac&&CKEDITOR.env.webkit){var g=this.editor,b=(new CKEDITOR.dom.elementPath(a.getTarget(),g.editable())).contains(function(a){return a.hasAttribute("contenteditable")},
|
|
823
|
+
!0);b&&"false"==b.getAttribute("contenteditable")&&g.getSelection().fake(b)}var b=a.getTarget().getDocument(),c=a.getTarget().getDocument().getDocumentElement(),g=!b.equals(CKEDITOR.document),b=b.getWindow().getScrollPosition(),d=g?a.$.clientX:a.$.pageX||b.x+a.$.clientX,h=g?a.$.clientY:a.$.pageY||b.y+a.$.clientY;CKEDITOR.tools.setTimeout(function(){this.open(c,null,d,h)},CKEDITOR.env.ie?200:0,this)}},this);if(CKEDITOR.env.webkit){var m=function(){f=0};a.on("keydown",function(a){f=CKEDITOR.env.mac?
|
|
824
824
|
a.data.$.metaKey:a.data.$.ctrlKey});a.on("keyup",m);a.on("contextmenu",m)}CKEDITOR.env.gecko&&!CKEDITOR.env.mac&&(a.on("keydown",function(a){a.data.$.shiftKey&&121===a.data.$.keyCode&&(e=!0)},null,null,0),a.on("keyup",h),a.on("contextmenu",h))},open:function(a,l,h,f){!1!==this.editor.config.enableContextMenu&&this.editor.getSelection().getType()!==CKEDITOR.SELECTION_NONE&&(this.editor.focus(),a=a||CKEDITOR.document.getDocumentElement(),this.editor.selectionChange(1),this.show(a,l,h,f))}}})},beforeInit:function(a){var l=
|
|
825
825
|
a.contextMenu=new CKEDITOR.plugins.contextMenu(a);a.on("contentDom",function(){l.addTarget(a.editable(),!1!==a.config.browserContextMenuOnCtrl)});a.addCommand("contextMenu",{exec:function(a){var f=0,e=0,l=a.getSelection().getRanges(),l=l[l.length-1].getClientRects(a.editable().isInline());if(l=l[l.length-1])f=l["rtl"===a.lang.dir?"left":"right"],e=l.bottom;a.contextMenu.open(a.document.getBody().getParent(),null,f,e)}});a.setKeystroke(CKEDITOR.SHIFT+121,"contextMenu");a.setKeystroke(CKEDITOR.CTRL+
|
|
826
|
-
CKEDITOR.SHIFT+121,"contextMenu")}});(function(){function a(a){return 20<a.length?!1:(a=a.replace(/[\n|\t]*/g,"").toLowerCase())&&"\x3cbr\x3e"!=a&&"\x3cp\x3e\x26nbsp;\x3cbr\x3e\x3c/p\x3e"!=a&&"\x3cp\x3e\x3cbr\x3e\x3c/p\x3e"!=a&&"\x3cp\x3e\x26nbsp;\x3c/p\x3e"!=a&&"\x26nbsp;"!=a&&" "!=a&&"\x26nbsp;\x3cbr\x3e"!=a&&" \x3cbr\x3e"!=a?!1:!0}function l(f){var
|
|
827
|
-
!
|
|
826
|
+
CKEDITOR.SHIFT+121,"contextMenu")}});(function(){function a(a){return 20<a.length?!1:(a=a.replace(/[\n|\t]*/g,"").toLowerCase())&&"\x3cbr\x3e"!=a&&"\x3cp\x3e\x26nbsp;\x3cbr\x3e\x3c/p\x3e"!=a&&"\x3cp\x3e\x3cbr\x3e\x3c/p\x3e"!=a&&"\x3cp\x3e\x26nbsp;\x3c/p\x3e"!=a&&"\x26nbsp;"!=a&&" "!=a&&"\x26nbsp;\x3cbr\x3e"!=a&&" \x3cbr\x3e"!=a?!1:!0}function l(f){var h=f.editor,g=h.editable?h.editable():"wysiwyg"==h.mode?h.document&&h.document.getBody():h.textarea,b=f.listenerData;if(g){if("wysiwyg"==h.mode){if(CKEDITOR.dialog._.currentTop||
|
|
827
|
+
!g)return;a(g.getHtml())&&(g.setHtml(b),g.addClass("placeholder"))}"source"==h.mode&&(e?"mode"==f.name&&g.setAttribute("placeholder",b):a(g.getValue())&&(g.setValue(b),g.addClass("placeholder")))}}function h(a){a=a.editor;var e=a.editable?a.editable():"wysiwyg"==a.mode?a.document&&a.document.getBody():a.textarea;if(e){if("wysiwyg"==a.mode){if(!e.hasClass("placeholder"))return;e.removeClass("placeholder");if(CKEDITOR.dtd[e.getName()].p){e.setHtml("\x3cp\x3e\x3cbr/\x3e\x3c/p\x3e");var f=new CKEDITOR.dom.range(a.document);
|
|
828
828
|
f.moveToElementEditablePosition(e.getFirst(),!0);a.getSelection().selectRanges([f])}else e.setHtml(" ")}"source"==a.mode&&e.hasClass("placeholder")&&(e.removeClass("placeholder"),e.setValue(""))}}function f(a){return a?a.getAttribute("lang")||f(a.getParent()):null}var e="placeholder"in document.createElement("textarea");CKEDITOR.plugins.add("confighelper",{getPlaceholderCss:function(){return".placeholder{ color: #999; }"},onLoad:function(){CKEDITOR.addCss&&CKEDITOR.addCss(this.getPlaceholderCss())},
|
|
829
|
-
init:function(m){m.on("mode",function(a){a.editor.focusManager.hasFocus=!1});var
|
|
830
|
-
m.editable?m.editable():"wysiwyg"==m.mode?m.document&&m.document.getBody():m.textarea;b&&b.hasClass("placeholder")&&(a.data.dataValue="")});m.on("setData",function(b){if(!(CKEDITOR.dialog._.currentTop||"source"==m.mode&&e)){var d=m.editable?m.editable():"wysiwyg"==m.mode?m.document&&m.document.getBody():m.textarea;d&&(a(b.data.dataValue)?l(b):d.hasClass("placeholder")&&d.removeClass("placeholder"))}});m.on("blur",l,null,
|
|
831
|
-
f(m.element))&&!m.config.scayt_sLang&&(m.config.scayt_sLang={en:"en_US","en-us":"en_US","en-gb":"en_GB","pt-br":"pt_BR",da:"da_DK","da-dk":"da_DK","nl-nl":"nl_NL","en-ca":"en_CA","fi-fi":"fi_FI",fr:"fr_FR","fr-fr":"fr_FR","fr-ca":"fr_CA",de:"de_DE","de-de":"de_DE","el-gr":"el_GR",it:"it_IT","it-it":"it_IT","nb-no":"nb_NO",pt:"pt_PT","pt-pt":"pt_PT",es:"es_ES","es-es":"es_ES","sv-se":"sv_SE"}[
|
|
832
|
-
a[e].split(":");if(3==f.length){var g=f[0],
|
|
833
|
-
"hideDialogFields"in m._||!m.config.hideDialogFields||(m._.hideDialogFields=b(m.config.hideDialogFields));if(m._.hideDialogFields&&(e=m._.hideDialogFields[d]))for(g in e)for(
|
|
829
|
+
init:function(m){m.on("mode",function(a){a.editor.focusManager.hasFocus=!1});var k=m.element.getAttribute("placeholder")||m.config.placeholder;if(k){m.addCss&&m.addCss(this.getPlaceholderCss());var g=CKEDITOR.document.getHead().append("style");g.setAttribute("type","text/css");CKEDITOR.env.ie&&11>CKEDITOR.env.version?g.$.styleSheet.cssText="textarea.placeholder { color: #999; font-style: italic; }":g.$.innerHTML="textarea.placeholder { color: #999; font-style: italic; }";m.on("getData",function(a){var b=
|
|
830
|
+
m.editable?m.editable():"wysiwyg"==m.mode?m.document&&m.document.getBody():m.textarea;b&&b.hasClass("placeholder")&&(a.data.dataValue="")});m.on("setData",function(b){if(!(CKEDITOR.dialog._.currentTop||"source"==m.mode&&e)){var d=m.editable?m.editable():"wysiwyg"==m.mode?m.document&&m.document.getBody():m.textarea;d&&(a(b.data.dataValue)?l(b):d.hasClass("placeholder")&&d.removeClass("placeholder"))}});m.on("blur",l,null,k);m.on("mode",l,null,k);m.on("focus",h);m.on("beforeModeUnload",h)}(k=m.config.contentsLanguage||
|
|
831
|
+
f(m.element))&&!m.config.scayt_sLang&&(m.config.scayt_sLang={en:"en_US","en-us":"en_US","en-gb":"en_GB","pt-br":"pt_BR",da:"da_DK","da-dk":"da_DK","nl-nl":"nl_NL","en-ca":"en_CA","fi-fi":"fi_FI",fr:"fr_FR","fr-fr":"fr_FR","fr-ca":"fr_CA",de:"de_DE","de-de":"de_DE","el-gr":"el_GR",it:"it_IT","it-it":"it_IT","nb-no":"nb_NO",pt:"pt_PT","pt-pt":"pt_PT",es:"es_ES","es-es":"es_ES","sv-se":"sv_SE"}[k.toLowerCase()]);var b=function(a){if("object"==typeof a)return a;a=a.split(";");var b={},e;for(e=0;e<a.length;e++){var f=
|
|
832
|
+
a[e].split(":");if(3==f.length){var g=f[0],h=f[1],f=f[2];b[g]||(b[g]={});b[g][h]||(b[g][h]=[]);b[g][h].push(f)}}return b};CKEDITOR.on("dialogDefinition",function(a){if(m==a.editor){var d=a.data.name;a=a.data.definition;var e,f,g,h,k;"tableProperties"==d&&"table"==d;"removeDialogFields"in m._||!m.config.removeDialogFields||(m._.removeDialogFields=b(m.config.removeDialogFields));if(m._.removeDialogFields&&(e=m._.removeDialogFields[d]))for(g in e)for(h=e[g],k=a.getContents(g),f=0;f<h.length;f++)k.remove(h[f]);
|
|
833
|
+
"hideDialogFields"in m._||!m.config.hideDialogFields||(m._.hideDialogFields=b(m.config.hideDialogFields));if(m._.hideDialogFields&&(e=m._.hideDialogFields[d]))for(g in e)for(h=e[g],k=a.getContents(g),f=0;f<h.length;f++)k.get(h[f]).hidden=!0;if(m.config.dialogFieldsDefaultValues&&(e=m.config.dialogFieldsDefaultValues[d]))for(g in e){h=e[g];k=a.getContents(g);for(var l in h)(d=k.get(l))&&(d["default"]=h[l])}}})}})})();(function(){function a(a){var e=this.att;a=a&&a.hasAttribute(e)&&a.getAttribute(e)||
|
|
834
834
|
"";void 0!==a&&this.setValue(a)}function l(){for(var a,e=0;e<arguments.length;e++)if(arguments[e]instanceof CKEDITOR.dom.element){a=arguments[e];break}if(a){var e=this.att,h=this.getValue();h?a.setAttribute(e,h):a.removeAttribute(e,h)}}var h={id:1,dir:1,classes:1,styles:1};CKEDITOR.plugins.add("dialogadvtab",{requires:"dialog",allowedContent:function(a){a||(a=h);var e=[];a.id&&e.push("id");a.dir&&e.push("dir");var l="";e.length&&(l+="["+e.join(",")+"]");a.classes&&(l+="(*)");a.styles&&(l+="{*}");
|
|
835
|
-
return l},createAdvancedTab:function(f,e,m){e||(e=h);var
|
|
836
|
-
setup:a,commit:l}),
|
|
837
|
-
g=f.document.createElement("span");g.setAttribute("style",e);g.setStyle(a,b);e=CKEDITOR.tools.normalizeCssText(g.getAttribute("style"));this.setValue(e,1)},setup:a,commit:l}),e.classes&&b.push({type:"hbox",widths:["45%","55%"],children:[{id:"advCSSClasses",att:"class",type:"text",requiredContent:m?m+"(cke-xyz)":null,label:
|
|
838
|
-
{},e=[],m={nbsp:" ",shy:"",gt:"\x3e",lt:"\x3c",amp:"\x26",apos:"'",quot:'"'};a=a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(a,b){var g=h?"\x26"+b+";":m[b];f[g]=h?m[b]:"\x26"+b+";";e.push(g);return""});a=a.replace(/,$/,"");if(!h&&a){a=a.split(",");var
|
|
839
|
-
{afterInit:function(l){function h(a){return b[a]}function f(a){return"force"!=e.entities_processNumerical&&
|
|
835
|
+
return l},createAdvancedTab:function(f,e,m){e||(e=h);var k=f.lang.common,g={id:"advanced",label:k.advancedTab,title:k.advancedTab,elements:[{type:"vbox",padding:1,children:[]}]},b=[];if(e.id||e.dir)e.id&&b.push({id:"advId",att:"id",type:"text",requiredContent:m?m+"[id]":null,label:k.id,setup:a,commit:l}),e.dir&&b.push({id:"advLangDir",att:"dir",type:"select",requiredContent:m?m+"[dir]":null,label:k.langDir,"default":"",style:"width:100%",items:[[k.notSet,""],[k.langDirLTR,"ltr"],[k.langDirRTL,"rtl"]],
|
|
836
|
+
setup:a,commit:l}),g.elements[0].children.push({type:"hbox",widths:["50%","50%"],children:[].concat(b)});if(e.styles||e.classes)b=[],e.styles&&b.push({id:"advStyles",att:"style",type:"text",requiredContent:m?m+"{cke-xyz}":null,label:k.styles,"default":"",validate:CKEDITOR.dialog.validate.inlineStyle(k.invalidInlineStyle),onChange:function(){},getStyle:function(a,b){var e=this.getValue().match(new RegExp("(?:^|;)\\s*"+a+"\\s*:\\s*([^;]*)","i"));return e?e[1]:b},updateStyle:function(a,b){var e=this.getValue(),
|
|
837
|
+
g=f.document.createElement("span");g.setAttribute("style",e);g.setStyle(a,b);e=CKEDITOR.tools.normalizeCssText(g.getAttribute("style"));this.setValue(e,1)},setup:a,commit:l}),e.classes&&b.push({type:"hbox",widths:["45%","55%"],children:[{id:"advCSSClasses",att:"class",type:"text",requiredContent:m?m+"(cke-xyz)":null,label:k.cssClasses,"default":"",setup:a,commit:l}]}),g.elements[0].children.push({type:"hbox",widths:["50%","50%"],children:[].concat(b)});return g}})})();(function(){function a(a,h){var f=
|
|
838
|
+
{},e=[],m={nbsp:" ",shy:"",gt:"\x3e",lt:"\x3c",amp:"\x26",apos:"'",quot:'"'};a=a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(a,b){var g=h?"\x26"+b+";":m[b];f[g]=h?m[b]:"\x26"+b+";";e.push(g);return""});a=a.replace(/,$/,"");if(!h&&a){a=a.split(",");var k=document.createElement("div"),g;k.innerHTML="\x26"+a.join(";\x26")+";";g=k.innerHTML;k=null;for(k=0;k<g.length;k++){var b=g.charAt(k);f[b]="\x26"+a[k]+";";e.push(b)}}f.regex=e.join(h?"|":"");return f}CKEDITOR.plugins.add("entities",
|
|
839
|
+
{afterInit:function(l){function h(a){return b[a]}function f(a){return"force"!=e.entities_processNumerical&&k[a]?k[a]:"\x26#"+a.charCodeAt(0)+";"}var e=l.config;if(l=(l=l.dataProcessor)&&l.htmlFilter){var m=[];!1!==e.basicEntities&&m.push("nbsp,gt,lt,amp");e.entities&&(m.length&&m.push("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"),
|
|
840
840
|
e.entities_latin&&m.push("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"),e.entities_greek&&m.push("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"),
|
|
841
|
-
e.entities_additional&&m.push(e.entities_additional));var
|
|
842
|
-
CKEDITOR.config.entities_additional="#39";(function(){function a(a){var e=a.config,m=a.fire("uiSpace",{space:"top",html:""}).html,
|
|
843
|
-
0,
|
|
844
|
-
"rtl"==e.contentsLangDirection?"right":"left":c-
|
|
845
|
-
(CKEDITOR.env.gecko?" ":"")+'" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"'+(a.title?' aria-labelledby\x3d"cke_{name}_arialbl"':" ")+"\x3e"+(a.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':" ")+'\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),b=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(
|
|
846
|
-
id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(e.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.title}))),c=CKEDITOR.tools.eventsBuffer(500,
|
|
841
|
+
e.entities_additional&&m.push(e.entities_additional));var k=a(m.join(",")),g=k.regex?"["+k.regex+"]":"a^";delete k.regex;e.entities&&e.entities_processNumerical&&(g="[^ -~]|"+g);var g=new RegExp(g,"g"),b=a("nbsp,gt,lt,amp,shy",!0),c=new RegExp(b.regex,"g");l.addRules({text:function(a){return a.replace(c,h).replace(g,f)}},{applyToAll:!0,excludeNestedEditable:!0})}}})})();CKEDITOR.config.basicEntities=!0;CKEDITOR.config.entities=!0;CKEDITOR.config.entities_latin=!0;CKEDITOR.config.entities_greek=!0;
|
|
842
|
+
CKEDITOR.config.entities_additional="#39";(function(){function a(a){var e=a.config,m=a.fire("uiSpace",{space:"top",html:""}).html,k=function(){function c(a,d,e){b.setStyle(d,h(e));b.setStyle("position",a)}function d(a){var b=m.getDocumentPosition();switch(a){case "top":c("absolute","top",b.y-r-z);break;case "pin":c("fixed","top",D);break;case "bottom":c("absolute","top",b.y+(w.height||w.bottom-w.top)+z)}g=a}var g,m,t,w,x,r,A,u=e.floatSpaceDockedOffsetX||0,z=e.floatSpaceDockedOffsetY||0,v=e.floatSpacePinnedOffsetX||
|
|
843
|
+
0,D=e.floatSpacePinnedOffsetY||0;return function(c){if(m=a.editable()){var n=c&&"focus"==c.name;n&&b.show();a.fire("floatingSpaceLayout",{show:n});b.removeStyle("left");b.removeStyle("right");t=b.getClientRect();w=m.getClientRect();x=l.getViewPaneSize();r=t.height;A="pageXOffset"in l.$?l.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft;g?(r+z<=w.top?d("top"):r+z>x.height-w.bottom?d("pin"):d("bottom"),c=x.width/2,c=e.floatSpacePreferRight?"right":0<w.left&&w.right<x.width&&w.width>t.width?
|
|
844
|
+
"rtl"==e.contentsLangDirection?"right":"left":c-w.left>w.right-c?"left":"right",t.width>x.width?(c="left",n=0):(n="left"==c?0<w.left?w.left:0:w.right<x.width?x.width-w.right:0,n+t.width>x.width&&(c="left"==c?"right":"left",n=0)),b.setStyle(c,h(("pin"==g?v:u)+n+("pin"==g?0:"left"==c?A:-A)))):(g="pin",d("pin"),k(c))}}}();if(m){var g=new CKEDITOR.template('\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" title\x3d"'+
|
|
845
|
+
(CKEDITOR.env.gecko?" ":"")+'" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"'+(a.title?' aria-labelledby\x3d"cke_{name}_arialbl"':" ")+"\x3e"+(a.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':" ")+'\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),b=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(g.output({content:m,
|
|
846
|
+
id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(e.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.title}))),c=CKEDITOR.tools.eventsBuffer(500,k),d=CKEDITOR.tools.eventsBuffer(100,k);b.unselectable();b.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){k(b);a.on("change",c.input);l.on("scroll",d.input);l.on("resize",d.input)});a.on("blur",function(){b.hide();a.removeListener("change",
|
|
847
847
|
c.input);l.removeListener("scroll",d.input);l.removeListener("resize",d.input)});a.on("destroy",function(){l.removeListener("scroll",d.input);l.removeListener("resize",d.input);b.clearCustomData();b.remove()});a.focusManager.hasFocus&&b.show();a.focusManager.add(b,1)}}var l=CKEDITOR.document.getWindow(),h=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(f){f.on("loaded",function(){a(this)},null,null,20)}})})();CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var a=
|
|
848
848
|
CKEDITOR.addTemplate("panel-list",'\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),l=CKEDITOR.addTemplate("panel-list-item",'\x3cli id\x3d"{id}" class\x3d"cke_panel_listItem" role\x3dpresentation\x3e\x3ca id\x3d"{id}_option" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"{title}" draggable\x3d"false" ondragstart\x3d"return false;" href\x3d"javascript:void(\'{val}\')" onclick\x3d"{onclick}CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'),
|
|
849
|
-
h=CKEDITOR.addTemplate("panel-list-group",'\x3ch1 id\x3d"{id}" draggable\x3d"false" ondragstart\x3d"return false;" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'),f=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(a,f){return this.addBlock(a,new CKEDITOR.ui.listBlock(this.getHolderElement(),f))};CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(a,f){f=f||{};var
|
|
850
|
-
(
|
|
851
|
-
delete this._.started}},getClick:function(){this._.click||(this._.click=CKEDITOR.tools.addFunction(function(a){var f=this.toggle(a);if(this.onClick)this.onClick(a,f)},this));return this._.click}},proto:{add:function(a,h,
|
|
852
|
-
"",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(
|
|
853
|
-
this.element.getDocument().getById(this._.groups[a]))&&a.getNext();a&&(a.setStyle("display","none"),f&&"ul"==f.getName()&&f.setStyle("display","none"))},hideItem:function(a){this.element.getDocument().getById(this._.items[a]).setStyle("display","none")},showAll:function(){var a=this._.items,f=this._.groups,
|
|
854
|
-
"")},mark:function(a){this.multiSelect||this.unmarkAll();a=this._.items[a];var f=this.element.getDocument().getById(a);f.addClass("cke_selected");this.element.getDocument().getById(a+"_option").setAttribute("aria-selected",!0);this.onMark&&this.onMark(f)},markFirstDisplayed:function(){var a=this;this._.markFirstDisplayed(function(){a.multiSelect||a.unmarkAll()})},unmark:function(a){var f=this.element.getDocument();a=this._.items[a];var
|
|
855
|
-
this.onUnmark&&this.onUnmark(
|
|
856
|
-
f.getItem(++
|
|
849
|
+
h=CKEDITOR.addTemplate("panel-list-group",'\x3ch1 id\x3d"{id}" draggable\x3d"false" ondragstart\x3d"return false;" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'),f=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(a,f){return this.addBlock(a,new CKEDITOR.ui.listBlock(this.getHolderElement(),f))};CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(a,f){f=f||{};var h=f.attributes||(f.attributes={});(this.multiSelect=!!f.multiSelect)&&
|
|
850
|
+
(h["aria-multiselectable"]=!0);!h.role&&(h.role="listbox");this.base.apply(this,arguments);this.element.setAttribute("role",h.role);h=this.keys;h[40]="next";h[9]="next";h[38]="prev";h[CKEDITOR.SHIFT+9]="prev";h[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(h[13]="mouseup");this._.pendingHtml=[];this._.pendingList=[];this._.items={};this._.groups={}},_:{close:function(){if(this._.started){var e=a.output({items:this._.pendingList.join("")});this._.pendingList=[];this._.pendingHtml.push(e);
|
|
851
|
+
delete this._.started}},getClick:function(){this._.click||(this._.click=CKEDITOR.tools.addFunction(function(a){var f=this.toggle(a);if(this.onClick)this.onClick(a,f)},this));return this._.click}},proto:{add:function(a,h,k){var g=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0);this._.items[a]=g;var b;b=CKEDITOR.tools.htmlEncodeAttr(a).replace(f,"\\'");a={id:g,val:b,onclick:CKEDITOR.env.ie?'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26':
|
|
852
|
+
"",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(k||a),text:h||a};this._.pendingList.push(l.output(a))},startGroup:function(a){this._.close();var f=CKEDITOR.tools.getNextId();this._.groups[a]=f;this._.pendingHtml.push(h.output({id:f,label:a}))},commit:function(){this._.close();this.element.appendHtml(this._.pendingHtml.join(""));delete this._.size;this._.pendingHtml=[]},toggle:function(a){var f=this.isMarked(a);f?this.unmark(a):this.mark(a);return!f},hideGroup:function(a){var f=(a=
|
|
853
|
+
this.element.getDocument().getById(this._.groups[a]))&&a.getNext();a&&(a.setStyle("display","none"),f&&"ul"==f.getName()&&f.setStyle("display","none"))},hideItem:function(a){this.element.getDocument().getById(this._.items[a]).setStyle("display","none")},showAll:function(){var a=this._.items,f=this._.groups,h=this.element.getDocument(),g;for(g in a)h.getById(a[g]).setStyle("display","");for(var b in f)a=h.getById(f[b]),g=a.getNext(),a.setStyle("display",""),g&&"ul"==g.getName()&&g.setStyle("display",
|
|
854
|
+
"")},mark:function(a){this.multiSelect||this.unmarkAll();a=this._.items[a];var f=this.element.getDocument().getById(a);f.addClass("cke_selected");this.element.getDocument().getById(a+"_option").setAttribute("aria-selected",!0);this.onMark&&this.onMark(f)},markFirstDisplayed:function(){var a=this;this._.markFirstDisplayed(function(){a.multiSelect||a.unmarkAll()})},unmark:function(a){var f=this.element.getDocument();a=this._.items[a];var h=f.getById(a);h.removeClass("cke_selected");f.getById(a+"_option").removeAttribute("aria-selected");
|
|
855
|
+
this.onUnmark&&this.onUnmark(h)},unmarkAll:function(){var a=this._.items,f=this.element.getDocument(),h;for(h in a){var g=a[h];f.getById(g).removeClass("cke_selected");f.getById(g+"_option").removeAttribute("aria-selected")}this.onUnmark&&this.onUnmark()},isMarked:function(a){return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")},focus:function(a){this._.focusIndex=-1;var f=this.element.getElementsByTag("a"),h,g=-1;if(a)for(h=this.element.getDocument().getById(this._.items[a]).getFirst();a=
|
|
856
|
+
f.getItem(++g);){if(a.equals(h)){this._.focusIndex=g;break}}else this.element.focus();h&&setTimeout(function(){h.focus()},0)}}})}});CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler)}});(function(){var a='\x3cspan id\x3d"{id}" class\x3d"cke_combo cke_combo__{name} {cls}" role\x3d"presentation"\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_combo_label"\x3e{label}\x3c/span\x3e\x3ca class\x3d"cke_combo_button" title\x3d"{title}" tabindex\x3d"-1"'+
|
|
857
857
|
(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-haspopup\x3d"listbox"',l="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(a+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(a+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');CKEDITOR.env.ie&&(l='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var a=a+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+
|
|
858
858
|
l+'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan id\x3d"{id}_text" class\x3d"cke_combo_text cke_combo_inlinelabel"\x3e{label}\x3c/span\x3e\x3cspan class\x3d"cke_combo_open"\x3e\x3cspan class\x3d"cke_combo_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":CKEDITOR.env.air?"\x26nbsp;":"")+"\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e"),h=CKEDITOR.addTemplate("combo",a);CKEDITOR.UI_RICHCOMBO="richcombo";CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(a){CKEDITOR.tools.extend(this,
|
|
859
859
|
a,{canGroup:!1,title:a.label,modes:{wysiwyg:1},editorFocus:1});a=this.panel||{};delete this.panel;this.id=CKEDITOR.tools.getNextNumber();this.document=a.parent&&a.parent.getDocument()||CKEDITOR.document;a.className="cke_combopanel";a.block={multiSelect:a.multiSelect,attributes:a.attributes};a.toolbarRelated=!0;this._={panelDefinition:a,items:{},listeners:[]}},proto:{renderHtml:function(a){var e=[];this.render(a,e);return e.join("")},render:function(a,e){function l(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var b=
|
|
860
|
-
this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;a.readOnly&&!this.readOnly&&(b=CKEDITOR.TRISTATE_DISABLED);this.setState(b);this.setValue("");b!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var
|
|
861
|
-
c.on)c.panel.hide();else{n.commit();var d=n.getValue();d?c.list.mark(d):c.list.unmarkAll();c.panel.showBlock(n.id,new CKEDITOR.dom.element(b),4)}},clickFn:d};this._.listeners.push(a.on("activeFilterChange",l,this));this._.listeners.push(a.on("mode",l,this));this._.listeners.push(a.on("selectionChange",l,this));!this.readOnly&&this._.listeners.push(a.on("readOnly",l,this));var
|
|
862
|
-
b);break;default:
|
|
863
|
-
|
|
860
|
+
this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;a.readOnly&&!this.readOnly&&(b=CKEDITOR.TRISTATE_DISABLED);this.setState(b);this.setValue("");b!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var k=CKEDITOR.env,g,b,c="cke_"+this.id,d=CKEDITOR.tools.addFunction(function(c){b&&(a.unlockSelection(1),b=0);g.execute(c)},this),n=this;g={id:c,combo:this,focus:function(){CKEDITOR.document.getById(c).getChild(1).focus()},execute:function(b){var c=n._;if(c.state!=CKEDITOR.TRISTATE_DISABLED)if(n.createPanel(a),
|
|
861
|
+
c.on)c.panel.hide();else{n.commit();var d=n.getValue();d?c.list.mark(d):c.list.unmarkAll();c.panel.showBlock(n.id,new CKEDITOR.dom.element(b),4)}},clickFn:d};this._.listeners.push(a.on("activeFilterChange",l,this));this._.listeners.push(a.on("mode",l,this));this._.listeners.push(a.on("selectionChange",l,this));!this.readOnly&&this._.listeners.push(a.on("readOnly",l,this));var p=CKEDITOR.tools.addFunction(function(a,b){a=new CKEDITOR.dom.event(a);var c=a.getKeystroke();switch(c){case 13:case 32:case 40:CKEDITOR.tools.callFunction(d,
|
|
862
|
+
b);break;default:g.onkey(g,c)}a.preventDefault()}),q=CKEDITOR.tools.addFunction(function(){g.onfocus&&g.onfocus()});b=0;g.keyDownFn=p;k={id:c,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:k.gecko&&!k.hc?"":(this.title||"").replace("'",""),keydownFn:p,focusFn:q,clickFn:d};h.output(k,e);if(this.onRender)this.onRender();return g},createPanel:function(a){if(!this._.panel){var e=this._.panelDefinition,h=this._.panelDefinition.block,k=e.parent||CKEDITOR.document.getBody(),
|
|
863
|
+
g="cke_combopanel__"+this.name,b=new CKEDITOR.ui.floatPanel(a,k,e),e=b.addListBlock(this.id,h),c=this;b.onShow=function(){this.element.addClass(g);c.setState(CKEDITOR.TRISTATE_ON);c._.on=1;c.editorFocus&&!a.focusManager.hasFocus&&a.focus();if(c.onOpen)c.onOpen()};b.onHide=function(b){this.element.removeClass(g);c.setState(c.modes&&c.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);c._.on=0;if(!b&&c.onClose)c.onClose()};b.onEscape=function(){b.hide(1)};e.onClick=function(a,e){c.onClick&&
|
|
864
864
|
c.onClick.call(c,a,e);b.hide()};this._.panel=b;this._.list=e;b.getBlock(this.id).onHide=function(){c._.on=0;c.setState(CKEDITOR.TRISTATE_OFF)};this.init&&this.init()}},setValue:function(a,e){this._.value=a;var h=this.document.getById("cke_"+this.id+"_text");h&&(a||e?h.removeClass("cke_combo_inlinelabel"):(e=this.label,h.addClass("cke_combo_inlinelabel")),h.setText("undefined"!=typeof e?e:a))},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(a){this._.list.mark(a)},
|
|
865
865
|
hideItem:function(a){this._.list.hideItem(a)},hideGroup:function(a){this._.list.hideGroup(a)},showAll:function(){this._.list.showAll()},add:function(a,e,h){this._.items[a]=h||a;this._.list.add(a,e,h)},startGroup:function(a){this._.list.startGroup(a)},commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this));this._.committed=1},setState:function(a){if(this._.state!=a){var e=this.document.getById("cke_"+this.id);e.setState(a,"cke_combo");a==CKEDITOR.TRISTATE_DISABLED?
|
|
866
866
|
e.setAttribute("aria-disabled",!0):e.removeAttribute("aria-disabled");this._.state=a}},getState:function(){return this._.state},enable:function(){this._.state==CKEDITOR.TRISTATE_DISABLED&&this.setState(this._.lastState)},disable:function(){this._.state!=CKEDITOR.TRISTATE_DISABLED&&(this._.lastState=this._.state,this.setState(CKEDITOR.TRISTATE_DISABLED))},destroy:function(){CKEDITOR.tools.array.forEach(this._.listeners,function(a){a.removeListener()});this._.listeners=[]},select:function(a){if(!CKEDITOR.tools.isEmpty(this._.items))for(var e in this._.items)if(a({value:e,
|
|
867
|
-
text:this._.items[e]})){this.setValue(e);break}}},statics:{handler:{create:function(a){return new CKEDITOR.ui.richCombo(a)}}}});CKEDITOR.ui.prototype.addRichCombo=function(a,e){this.add(a,CKEDITOR.UI_RICHCOMBO,e)}})();(function(){function a(a,h){var
|
|
868
|
-
f=void 0===c;if(d||c)if(d&&e.collapsed&&l({editor:a,range:e,style:d}),f)a.removeStyle(d);else{if(e=d)e=d instanceof CKEDITOR.style&&c instanceof CKEDITOR.style?CKEDITOR.style.getStyleText(d.getDefinition())===CKEDITOR.style.getStyleText(c.getDefinition()):!1,e=!e;e&&a.removeStyle(d);a.applyStyle(c)}},refresh:function(a,c){b.checkApplicable(c,a,a.activeFilter)||this.setState(CKEDITOR.TRISTATE_DISABLED)}});d=a.getCommand(h.commandName);a.ui.addRichCombo(h.comboName,{label:
|
|
867
|
+
text:this._.items[e]})){this.setValue(e);break}}},statics:{handler:{create:function(a){return new CKEDITOR.ui.richCombo(a)}}}});CKEDITOR.ui.prototype.addRichCombo=function(a,e){this.add(a,CKEDITOR.UI_RICHCOMBO,e)}})();(function(){function a(a,h){var k=a.config,g=h.lang,b=new CKEDITOR.style(h.styleDefinition),c=new f({entries:h.entries,styleVariable:h.styleVariable,styleDefinition:h.styleDefinition}),d;a.addCommand(h.commandName,{exec:function(a,b){var c=b.newStyle,d=b.oldStyle,e=a.getSelection().getRanges()[0],
|
|
868
|
+
f=void 0===c;if(d||c)if(d&&e.collapsed&&l({editor:a,range:e,style:d}),f)a.removeStyle(d);else{if(e=d)e=d instanceof CKEDITOR.style&&c instanceof CKEDITOR.style?CKEDITOR.style.getStyleText(d.getDefinition())===CKEDITOR.style.getStyleText(c.getDefinition()):!1,e=!e;e&&a.removeStyle(d);a.applyStyle(c)}},refresh:function(a,c){b.checkApplicable(c,a,a.activeFilter)||this.setState(CKEDITOR.TRISTATE_DISABLED)}});d=a.getCommand(h.commandName);a.ui.addRichCombo(h.comboName,{label:g.label,title:g.panelTitle,
|
|
869
869
|
command:h.commandName,toolbar:"styles,"+h.order,defaultValue:"cke-default",allowedContent:b,requiredContent:b,contentTransformations:"span"===h.styleDefinition.element?[[{element:"font",check:"span",left:function(a){return!!a.attributes.size||!!a.attributes.align||!!a.attributes.face},right:function(a){var b=" x-small small medium large x-large xx-large 48px".split(" ");a.name="span";a.attributes.size&&(a.styles["font-size"]=b[a.attributes.size],delete a.attributes.size);a.attributes.align&&(a.styles["text-align"]=
|
|
870
|
-
a.attributes.align,delete a.attributes.align);a.attributes.face&&(a.styles["font-family"]=a.attributes.face,delete a.attributes.face)}}]]:null,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(
|
|
871
|
-
{newStyle:c.getStyle(b),oldStyle:c.getStyle(d)});a.fire("saveSnapshot")},onRender:function(){a.on("selectionChange",function(b){var d=this.getValue();(b=c.getMatchingValue(a,b.data.path))?b!=d&&this.setValue(b):this.setValue("",h.defaultLabel)},this);d.on("state",function(){this.setState(d.state)},this)},refresh:function(){this.setState(d.state)}})}function l(a){var f=a.editor,
|
|
872
|
-
CKEDITOR.START);d=
|
|
873
|
-
CKEDITOR.POSITION_AFTER_START);h(a,f)}}var f=CKEDITOR.tools.createClass({$:function(a){var f=a.entries.split(";");this._.data={};this._.names=[];for(var
|
|
874
|
-
this._.names[f];a.add(
|
|
870
|
+
a.attributes.align,delete a.attributes.align);a.attributes.face&&(a.styles["font-family"]=a.attributes.face,delete a.attributes.face)}}]]:null,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(k.contentsCss),multiSelect:!1,attributes:{"aria-label":g.panelTitle}},init:function(){var b="("+a.lang.common.optionDefault+")";this.startGroup(g.panelTitle);this.add(this.defaultValue,b,b);c.addToCombo(this)},onClick:function(b){var d=this.getValue();a.focus();a.fire("saveSnapshot");a.execCommand(h.commandName,
|
|
871
|
+
{newStyle:c.getStyle(b),oldStyle:c.getStyle(d)});a.fire("saveSnapshot")},onRender:function(){a.on("selectionChange",function(b){var d=this.getValue();(b=c.getMatchingValue(a,b.data.path))?b!=d&&this.setValue(b):this.setValue("",h.defaultLabel)},this);d.on("state",function(){this.setState(d.state)},this)},refresh:function(){this.setState(d.state)}})}function l(a){var f=a.editor,k=a.range,g=a.style,b,c,d;b=f.elementPath();if(a=b.contains(function(a){return g.checkElementRemovable(a)})){c=k.checkBoundaryOfElement(a,
|
|
872
|
+
CKEDITOR.START);d=k.checkBoundaryOfElement(a,CKEDITOR.END);if(c&&d){for(c=k.createBookmark();b=a.getFirst();)b.insertBefore(a);a.remove();k.moveToBookmark(c)}else c||d?k.moveToPosition(a,c?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_END):(k.splitElement(a),k.moveToPosition(a,CKEDITOR.POSITION_AFTER_END)),h(k,b.elements.slice(),a);f.getSelection().selectRanges([k])}}function h(a,f,k){var g=f.pop();if(g){if(k)return h(a,f,g.equals(k)?null:k);k=g.clone();a.insertNode(k);a.moveToPosition(k,
|
|
873
|
+
CKEDITOR.POSITION_AFTER_START);h(a,f)}}var f=CKEDITOR.tools.createClass({$:function(a){var f=a.entries.split(";");this._.data={};this._.names=[];for(var h=0;h<f.length;h++){var g=f[h],b,c;g?(g=g.split("/"),b=g[0],g=g[1],c={},c[a.styleVariable]=g||b,this._.data[b]=new CKEDITOR.style(a.styleDefinition,c),this._.data[b]._.definition.name=b,this._.names.push(b)):(f.splice(h,1),h--)}},proto:{getStyle:function(a){return this._.data[a]},addToCombo:function(a){for(var f=0;f<this._.names.length;f++){var h=
|
|
874
|
+
this._.names[f];a.add(h,this.getStyle(h).buildPreview(),h)}},getMatchingValue:function(a,f){for(var h=f.elements,g=0,b;g<h.length;g++)if(b=h[g],b=this._.findMatchingStyleName(a,b))return b;return null}},_:{findMatchingStyleName:function(a,f){return CKEDITOR.tools.array.find(this._.names,function(h){return this.getStyle(h).checkElementMatch(f,!0,a)},this)}}});CKEDITOR.plugins.add("font",{requires:"richcombo",init:function(e){var f=e.config;a(e,{comboName:"Font",commandName:"font",styleVariable:"family",
|
|
875
875
|
lang:e.lang.font,entries:f.font_names,defaultLabel:f.font_defaultLabel,styleDefinition:f.font_style,order:30});a(e,{comboName:"FontSize",commandName:"fontSize",styleVariable:"size",lang:e.lang.font.fontSize,entries:f.fontSize_sizes,defaultLabel:f.fontSize_defaultLabel,styleDefinition:f.fontSize_style,order:40})}})})();CKEDITOR.config.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";
|
|
876
876
|
CKEDITOR.config.font_defaultLabel="";CKEDITOR.config.font_style={element:"span",styles:{"font-family":"#(family)"},overrides:[{element:"font",attributes:{face:null}}]};CKEDITOR.config.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";CKEDITOR.config.fontSize_defaultLabel="";CKEDITOR.config.fontSize_style={element:"span",styles:{"font-size":"#(size)"},overrides:[{element:"font",attributes:{size:null}}]};CKEDITOR.plugins.add("format",
|
|
877
|
-
{requires:"richcombo",init:function(a){if(!a.blockless){for(var l=a.config,h=a.lang.format,f=l.format_tags.split(";"),e={},m=0,
|
|
877
|
+
{requires:"richcombo",init:function(a){if(!a.blockless){for(var l=a.config,h=a.lang.format,f=l.format_tags.split(";"),e={},m=0,k=[],g=0;g<f.length;g++){var b=f[g],c=new CKEDITOR.style(l["format_"+b]);if(!a.filter.customConfig||a.filter.check(c))m++,e[b]=c,e[b]._.enterMode=a.config.enterMode,k.push(c)}0!==m&&a.ui.addRichCombo("Format",{label:h.label,title:h.panelTitle,toolbar:"styles,20",allowedContent:k,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(l.contentsCss),multiSelect:!1,attributes:{"aria-label":h.panelTitle}},
|
|
878
878
|
init:function(){this.startGroup(h.panelTitle);for(var a in e){var b=h["tag_"+a];this.add(a,e[a].buildPreview(b),b)}},onClick:function(b){a.focus();a.fire("saveSnapshot");b=e[b];var c=a.elementPath();b.checkActive(c,a)||a.applyStyle(b);setTimeout(function(){a.fire("saveSnapshot")},0)},onRender:function(){a.on("selectionChange",function(b){var c=this.getValue();b=b.data.path;this.refresh();for(var f in e)if(e[f].checkActive(b,a)){f!=c&&this.setValue(f,a.lang.format["tag_"+f]);return}this.setValue("")},
|
|
879
879
|
this)},onOpen:function(){this.showAll();for(var b in e)a.activeFilter.check(e[b])||this.hideItem(b)},refresh:function(){var b=a.elementPath();if(b){if(b.isContextFor("p"))for(var c in e)if(a.activeFilter.check(e[c]))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}}})}}});CKEDITOR.config.format_tags="p;h1;h2;h3;h4;h5;h6;pre;address;div";CKEDITOR.config.format_p={element:"p"};CKEDITOR.config.format_div={element:"div"};CKEDITOR.config.format_pre={element:"pre"};CKEDITOR.config.format_address={element:"address"};
|
|
880
880
|
CKEDITOR.config.format_h1={element:"h1"};CKEDITOR.config.format_h2={element:"h2"};CKEDITOR.config.format_h3={element:"h3"};CKEDITOR.config.format_h4={element:"h4"};CKEDITOR.config.format_h5={element:"h5"};CKEDITOR.config.format_h6={element:"h6"};CKEDITOR.plugins.add("htmlwriter",{init:function(a){var l=new CKEDITOR.htmlWriter;l.forceSimpleAmpersand=a.config.forceSimpleAmpersand;l.indentationChars=a.config.dataIndentationChars||"\t";a.dataProcessor.writer=l}});CKEDITOR.htmlWriter=CKEDITOR.tools.createClass({base:CKEDITOR.htmlParser.basicWriter,
|
|
@@ -882,40 +882,40 @@ $:function(){this.base();this.indentationChars="\t";this.selfClosingEnd=" /\x3e"
|
|
|
882
882
|
{indent:0,breakAfterOpen:0});this.setRules("style",{indent:0,breakBeforeClose:1});this.setRules("pre",{breakAfterOpen:1,indent:0})},proto:{openTag:function(a){var l=this._.rules[a];this._.afterCloser&&l&&l.needsSpace&&this._.needsSpace&&this._.output.push("\n");this._.indent?this.indentation():l&&l.breakBeforeOpen&&(this.lineBreak(),this.indentation());this._.output.push("\x3c",a);this._.afterCloser=0},openTagClose:function(a,l){var h=this._.rules[a];l?(this._.output.push(this.selfClosingEnd),h&&
|
|
883
883
|
h.breakAfterClose&&(this._.needsSpace=h.needsSpace)):(this._.output.push("\x3e"),h&&h.indent&&(this._.indentation+=this.indentationChars));h&&h.breakAfterOpen&&this.lineBreak();"pre"==a&&(this._.inPre=1)},attribute:function(a,l){"string"==typeof l&&(l=CKEDITOR.tools.htmlEncodeAttr(l),this.forceSimpleAmpersand&&(l=l.replace(/&/g,"\x26")));this._.output.push(" ",a,'\x3d"',l,'"')},closeTag:function(a){var l=this._.rules[a];l&&l.indent&&(this._.indentation=this._.indentation.substr(this.indentationChars.length));
|
|
884
884
|
this._.indent?this.indentation():l&&l.breakBeforeClose&&(this.lineBreak(),this.indentation());this._.output.push("\x3c/",a,"\x3e");"pre"==a&&(this._.inPre=0);l&&l.breakAfterClose&&(this.lineBreak(),this._.needsSpace=l.needsSpace);this._.afterCloser=1},text:function(a){this._.indent&&(this.indentation(),!this._.inPre&&(a=CKEDITOR.tools.ltrim(a)));this._.output.push(a)},comment:function(a){this._.indent&&this.indentation();this._.output.push("\x3c!--",a,"--\x3e")},lineBreak:function(){!this._.inPre&&
|
|
885
|
-
0<this._.output.length&&this._.output.push(this.lineBreakChars);this._.indent=1},indentation:function(){!this._.inPre&&this._.indentation&&this._.output.push(this._.indentation);this._.indent=0},reset:function(){this._.output=[];this._.indent=0;this._.indentation="";this._.afterCloser=0;this._.inPre=0;this._.needsSpace=0},setRules:function(a,l){var h=this._.rules[a];h?CKEDITOR.tools.extend(h,l,!0):this._.rules[a]=l}}});(function(){function a(a,e){var m,
|
|
886
|
-
this.setState(CKEDITOR.tools.search(b,h)?h:l)},e,null,100);e.on("exec",function(e){m=a.getSelection();
|
|
887
|
-
{label:f.lang.indent.indent,command:"indent",directional:!0,toolbar:"indent,20"}),f.ui.addButton("Outdent",{label:f.lang.indent.outdent,command:"outdent",directional:!0,toolbar:"indent,10"}));f.on("dirChanged",function(a){var e=f.createRange(),
|
|
888
|
-
"ltr"==a.data.dir?["_rtl",""]:["","_rtl"],
|
|
885
|
+
0<this._.output.length&&this._.output.push(this.lineBreakChars);this._.indent=1},indentation:function(){!this._.inPre&&this._.indentation&&this._.output.push(this._.indentation);this._.indent=0},reset:function(){this._.output=[];this._.indent=0;this._.indentation="";this._.afterCloser=0;this._.inPre=0;this._.needsSpace=0},setRules:function(a,l){var h=this._.rules[a];h?CKEDITOR.tools.extend(h,l,!0):this._.rules[a]=l}}});(function(){function a(a,e){var m,k;e.on("refresh",function(a){var b=[l],c;for(c in a.data.states)b.push(a.data.states[c]);
|
|
886
|
+
this.setState(CKEDITOR.tools.search(b,h)?h:l)},e,null,100);e.on("exec",function(e){m=a.getSelection();k=m.createBookmarks(1);e.data||(e.data={});e.data.done=!1},e,null,0);e.on("exec",function(){a.forceNextSelectionCheck();m.selectBookmarks(k)},e,null,100)}var l=CKEDITOR.TRISTATE_DISABLED,h=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indent",{init:function(f){var e=CKEDITOR.plugins.indent.genericDefinition;a(f,f.addCommand("indent",new e(!0)));a(f,f.addCommand("outdent",new e));f.ui.addButton&&(f.ui.addButton("Indent",
|
|
887
|
+
{label:f.lang.indent.indent,command:"indent",directional:!0,toolbar:"indent,20"}),f.ui.addButton("Outdent",{label:f.lang.indent.outdent,command:"outdent",directional:!0,toolbar:"indent,10"}));f.on("dirChanged",function(a){var e=f.createRange(),g=a.data.node;e.setStartBefore(g);e.setEndAfter(g);for(var b=new CKEDITOR.dom.walker(e),c;c=b.next();)if(c.type==CKEDITOR.NODE_ELEMENT)if(!c.equals(g)&&c.getDirection())e.setStartAfter(c),b=new CKEDITOR.dom.walker(e);else{var d=f.config.indentClasses;if(d)for(var h=
|
|
888
|
+
"ltr"==a.data.dir?["_rtl",""]:["","_rtl"],l=0;l<d.length;l++)c.hasClass(d[l]+h[0])&&(c.removeClass(d[l]+h[0]),c.addClass(d[l]+h[1]));d=c.getStyle("margin-right");h=c.getStyle("margin-left");d?c.setStyle("margin-left",d):c.removeStyle("margin-left");h?c.setStyle("margin-right",h):c.removeStyle("margin-right")}})}});CKEDITOR.plugins.indent={genericDefinition:function(a){this.isIndent=!!a;this.startDisabled=!this.isIndent},specificDefinition:function(a,e,h){this.name=e;this.editor=a;this.jobs={};this.enterBr=
|
|
889
889
|
a.config.enterMode==CKEDITOR.ENTER_BR;this.isIndent=!!h;this.relatedGlobal=h?"indent":"outdent";this.indentKey=h?9:CKEDITOR.SHIFT+9;this.database={}},registerCommands:function(a,e){a.on("pluginsLoaded",function(){for(var a in e)(function(a,e){var b=a.getCommand(e.relatedGlobal),c;for(c in e.jobs)b.on("exec",function(b){b.data.done||(a.fire("lockSnapshot"),e.execJob(a,c)&&(b.data.done=!0),a.fire("unlockSnapshot"),CKEDITOR.dom.element.clearAllMarkers(e.database))},this,null,c),b.on("refresh",function(b){b.data.states||
|
|
890
890
|
(b.data.states={});b.data.states[e.name+"@"+c]=e.refreshJob(a,c,b.data.path)},this,null,c);a.addFeature(e)})(this,e[a])})}};CKEDITOR.plugins.indent.genericDefinition.prototype={context:"p",exec:function(){}};CKEDITOR.plugins.indent.specificDefinition.prototype={execJob:function(a,e){var h=this.jobs[e];if(h.state!=l)return h.exec.call(this,a)},refreshJob:function(a,e,h){e=this.jobs[e];a.activeFilter.checkFeature(this)?e.state=e.refresh.call(this,a,h):e.state=l;return e.state},getContext:function(a){return a.contains(this.context)}}})();
|
|
891
|
-
(function(){function a(a){function b(b){for(var
|
|
892
|
-
l=l.getCustomData("listarray_index");l<=m.getCustomData("listarray_index");l++)if(
|
|
893
|
-
|
|
894
|
-
(m.type!=CKEDITOR.NODE_ELEMENT||!e[m.getName()]);){if(a.editable().equals(m)){m=!1;break}m=m.getParent()}m||(m=f.startPath().contains(e))&&f.setEndAt(m,CKEDITOR.POSITION_BEFORE_END);if(!m){var
|
|
895
|
-
|
|
896
|
-
arguments);this.requiredContent=["ul","ol"];b.on("key",function(a){var c=b.elementPath();if("wysiwyg"==b.mode&&a.data.keyCode==this.indentKey&&c){var e=this.getContext(c);!e||this.isIndent&&CKEDITOR.plugins.indentList.firstItemInPath(this.context,c,e)||(b.execCommand(this.relatedGlobal),a.cancel())}},this);this.jobs[this.isIndent?10:30]={refresh:this.isIndent?function(a,b){var c=this.getContext(b),d=CKEDITOR.plugins.indentList.firstItemInPath(this.context,b,c);return c&&this.isIndent&&!d?
|
|
897
|
-
b){return!this.getContext(b)||this.isIndent?m:
|
|
891
|
+
(function(){function a(a){function b(b){for(var k=f.startContainer,l=f.endContainer;k&&!k.getParent().equals(b);)k=k.getParent();for(;l&&!l.getParent().equals(b);)l=l.getParent();if(!k||!l)return!1;for(var m=[],u=!1;!u;)k.equals(l)&&(u=!0),m.push(k),k=k.getNext();if(1>m.length)return!1;k=b.getParents(!0);for(l=0;l<k.length;l++)if(k[l].getName&&e[k[l].getName()]){b=k[l];break}for(var k=c.isIndent?1:-1,l=m[0],m=m[m.length-1],u=CKEDITOR.plugins.list.listToArray(b,d),z=u[m.getCustomData("listarray_index")].indent,
|
|
892
|
+
l=l.getCustomData("listarray_index");l<=m.getCustomData("listarray_index");l++)if(u[l].indent+=k,0<k){for(var v=u[l].parent,D=l-1;0<=D;D--)if(u[D].indent===k){v=u[D].parent;break}u[l].parent=new CKEDITOR.dom.element(v.getName(),v.getDocument())}for(l=m.getCustomData("listarray_index")+1;l<u.length&&u[l].indent>z;l++)u[l].indent+=k;k=CKEDITOR.plugins.list.arrayToList(u,d,null,a.config.enterMode,b.getDirection());if(!c.isIndent){var t;if((t=b.getParent())&&t.is("li"))for(var m=k.listNode.getChildren(),
|
|
893
|
+
B=[],q,l=m.count()-1;0<=l;l--)(q=m.getItem(l))&&q.is&&q.is("li")&&B.push(q)}k&&k.listNode.replace(b);if(B&&B.length)for(l=0;l<B.length;l++){for(q=b=B[l];(q=q.getNext())&&q.is&&q.getName()in e;)CKEDITOR.env.needsNbspFiller&&!b.getFirst(h)&&b.append(f.document.createText(" ")),b.append(q);b.insertAfter(t)}k&&a.fire("contentDomInvalidated");return!0}for(var c=this,d=this.database,e=this.context,f,k=a.getSelection(),k=(k&&k.getRanges()).createIterator();f=k.getNextRange();){for(var m=f.getCommonAncestor();m&&
|
|
894
|
+
(m.type!=CKEDITOR.NODE_ELEMENT||!e[m.getName()]);){if(a.editable().equals(m)){m=!1;break}m=m.getParent()}m||(m=f.startPath().contains(e))&&f.setEndAt(m,CKEDITOR.POSITION_BEFORE_END);if(!m){var t=f.getEnclosedNode();t&&t.type==CKEDITOR.NODE_ELEMENT&&t.getName()in e&&(f.setStartAt(t,CKEDITOR.POSITION_AFTER_START),f.setEndAt(t,CKEDITOR.POSITION_BEFORE_END),m=t)}m&&f.startContainer.type==CKEDITOR.NODE_ELEMENT&&f.startContainer.getName()in e&&(t=new CKEDITOR.dom.walker(f),t.evaluator=l,f.startContainer=
|
|
895
|
+
t.next());m&&f.endContainer.type==CKEDITOR.NODE_ELEMENT&&f.endContainer.getName()in e&&(t=new CKEDITOR.dom.walker(f),t.evaluator=l,f.endContainer=t.previous());if(m)return b(m)}return 0}function l(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is("li")}function h(a){return f(a)&&e(a)}var f=CKEDITOR.dom.walker.whitespaces(!0),e=CKEDITOR.dom.walker.bookmark(!1,!0),m=CKEDITOR.TRISTATE_DISABLED,k=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(e){function b(b){c.specificDefinition.apply(this,
|
|
896
|
+
arguments);this.requiredContent=["ul","ol"];b.on("key",function(a){var c=b.elementPath();if("wysiwyg"==b.mode&&a.data.keyCode==this.indentKey&&c){var e=this.getContext(c);!e||this.isIndent&&CKEDITOR.plugins.indentList.firstItemInPath(this.context,c,e)||(b.execCommand(this.relatedGlobal),a.cancel())}},this);this.jobs[this.isIndent?10:30]={refresh:this.isIndent?function(a,b){var c=this.getContext(b),d=CKEDITOR.plugins.indentList.firstItemInPath(this.context,b,c);return c&&this.isIndent&&!d?k:m}:function(a,
|
|
897
|
+
b){return!this.getContext(b)||this.isIndent?m:k},exec:CKEDITOR.tools.bind(a,this)}}var c=CKEDITOR.plugins.indent;c.registerCommands(e,{indentlist:new b(e,"indentlist",!0),outdentlist:new b(e,"outdentlist")});CKEDITOR.tools.extend(b.prototype,c.specificDefinition.prototype,{context:{ol:1,ul:1}})}});CKEDITOR.plugins.indentList={};CKEDITOR.plugins.indentList.firstItemInPath=function(a,b,c){var d=b.contains(l);c||(c=b.contains(a));return c&&d&&d.equals(c.getFirst(l))}})();(function(){function a(a,e,b){if(!a.getCustomData("indent_processed")){var c=
|
|
898
898
|
this.editor,d=this.isIndent;if(e){c=a.$.className.match(this.classNameRegex);b=0;c&&(c=c[1],b=CKEDITOR.tools.indexOf(e,c)+1);if(0>(b+=d?1:-1))return;b=Math.min(b,e.length);b=Math.max(b,0);a.$.className=CKEDITOR.tools.ltrim(a.$.className.replace(this.classNameRegex,""));0<b&&a.addClass(e[b-1])}else{e=l(a,b);b=parseInt(a.getStyle(e),10);var f=c.config.indentOffset||40;isNaN(b)&&(b=0);b+=(d?1:-1)*f;if(0>b)return;b=Math.max(b,0);b=Math.ceil(b/f)*f;a.setStyle(e,b?b+(c.config.indentUnit||"px"):"");""===
|
|
899
|
-
a.getAttribute("style")&&a.removeAttribute("style")}CKEDITOR.dom.element.setMarker(this.database,a,"indent_processed",1)}}function l(a,e){return"ltr"==(e||a.getComputedStyle("direction"))?"margin-left":"margin-right"}var h=CKEDITOR.dtd.$listItem,f=CKEDITOR.dtd.$list,e=CKEDITOR.TRISTATE_DISABLED,m=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentblock",{requires:"indent",init:function(
|
|
899
|
+
a.getAttribute("style")&&a.removeAttribute("style")}CKEDITOR.dom.element.setMarker(this.database,a,"indent_processed",1)}}function l(a,e){return"ltr"==(e||a.getComputedStyle("direction"))?"margin-left":"margin-right"}var h=CKEDITOR.dtd.$listItem,f=CKEDITOR.dtd.$list,e=CKEDITOR.TRISTATE_DISABLED,m=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentblock",{requires:"indent",init:function(k){function g(){b.specificDefinition.apply(this,arguments);this.allowedContent={"div h1 h2 h3 h4 h5 h6 ol p pre ul":{propertiesOnly:!0,
|
|
900
900
|
styles:c?null:"margin-left,margin-right",classes:c||null}};this.contentTransformations=[["div: splitMarginShorthand"],["h1: splitMarginShorthand"],["h2: splitMarginShorthand"],["h3: splitMarginShorthand"],["h4: splitMarginShorthand"],["h5: splitMarginShorthand"],["h6: splitMarginShorthand"],["ol: splitMarginShorthand"],["p: splitMarginShorthand"],["pre: splitMarginShorthand"],["ul: splitMarginShorthand"]];this.enterBr&&(this.allowedContent.div=!0);this.requiredContent=(this.enterBr?"div":"p")+(c?
|
|
901
901
|
"("+c.join(",")+")":"{margin-left}");this.jobs={20:{refresh:function(a,b){var f=b.block||b.blockLimit;if(!f.is(h))var g=f.getAscendant(h),f=g&&b.contains(g)||f;f.is(h)&&(f=f.getParent());if(this.enterBr||this.getContext(b)){if(c){var g=c,f=f.$.className.match(this.classNameRegex),k=this.isIndent,g=f?k?f[1]!=g.slice(-1):!0:k;return g?m:e}return this.isIndent?m:f?CKEDITOR[0>=(parseInt(f.getStyle(l(f)),10)||0)?"TRISTATE_DISABLED":"TRISTATE_OFF"]:e}return e},exec:function(b){var e=b.getSelection(),e=
|
|
902
|
-
e&&e.getRanges()[0],g;if(g=b.elementPath().contains(f))a.call(this,g,c);else for(e=e.createIterator(),b=b.config.enterMode,e.enforceRealBlocks=!0,e.enlargeBr=b!=CKEDITOR.ENTER_BR;g=e.getNextParagraph(b==CKEDITOR.ENTER_P?"p":"div");)g.isReadOnly()||a.call(this,g,c);return!0}}}}var b=CKEDITOR.plugins.indent,c=
|
|
903
|
-
dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,p:1,pre:1,table:1},classNameRegex:c?new RegExp("(?:^|\\s+)("+c.join("|")+")(?\x3d$|\\s)"):null})}})})();CKEDITOR.plugins.add("taotab",{init:function(a){function l(a){var e,h="";a=parseInt(a||4,10);for(e=0;e<a;e++)h+=String.fromCharCode(160);return h}function h(a){var e,l=[];for(e=0;e<a.childNodes.length;e++){var
|
|
904
|
-
a.getSelection(),m=e.getRanges(),
|
|
905
|
-
a+4),m[0].setEnd(
|
|
906
|
-
e=h.getSelectedText();for(var
|
|
907
|
-
else{for(;!a.hasAttribute||!a.hasAttribute("align")&&!a.getStyle("text-align");){h=a.getParent();if(!h)break;a=h}h=a.getStyle("text-align")||a.getAttribute("align")||""}h&&(h=h.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i,""));!h&&e&&(h="rtl"==a.getComputedStyle("direction")?"right":"left");return h}function l(a,e,h){this.editor=a;this.name=e;this.value=h;this.context="p";e=a.config.justifyClasses;var
|
|
908
|
-
e[0];break;case "center":this.cssClassName=e[1];break;case "right":this.cssClassName=e[2];break;case "justify":this.cssClassName=e[3]}this.cssClassRegex=new RegExp("(?:^|\\s+)(?:"+e.join("|")+")(?\x3d$|\\s)");this.requiredContent=
|
|
909
|
-
(this.allowedContent.div=!0)}function h(a){var e=a.editor,h=e.createRange();h.setStartBefore(a.data.node);h.setEndAfter(a.data.node);for(var
|
|
910
|
-
"right"):"right"==b&&
|
|
911
|
-
y){d.removeAttribute("align");d.removeStyle("text-align");var
|
|
912
|
-
this.cssClassName+")"):f.activeFilter.check(
|
|
913
|
-
"justify");a.addCommand("justifyleft",e);a.addCommand("justifycenter",m);a.addCommand("justifyright",
|
|
914
|
-
command:"justifyblock",toolbar:"align,40"}));a.on("dirChanged",h)}}})})();(function(){function a(a,e){var
|
|
915
|
-
(new l(e)).rules;e=f.attributes;var b=
|
|
902
|
+
e&&e.getRanges()[0],g;if(g=b.elementPath().contains(f))a.call(this,g,c);else for(e=e.createIterator(),b=b.config.enterMode,e.enforceRealBlocks=!0,e.enlargeBr=b!=CKEDITOR.ENTER_BR;g=e.getNextParagraph(b==CKEDITOR.ENTER_P?"p":"div");)g.isReadOnly()||a.call(this,g,c);return!0}}}}var b=CKEDITOR.plugins.indent,c=k.config.indentClasses;b.registerCommands(k,{indentblock:new g(k,"indentblock",!0),outdentblock:new g(k,"outdentblock")});CKEDITOR.tools.extend(g.prototype,b.specificDefinition.prototype,{context:{div:1,
|
|
903
|
+
dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,p:1,pre:1,table:1},classNameRegex:c?new RegExp("(?:^|\\s+)("+c.join("|")+")(?\x3d$|\\s)"):null})}})})();CKEDITOR.plugins.add("taotab",{init:function(a){function l(a){var e,h="";a=parseInt(a||4,10);for(e=0;e<a;e++)h+=String.fromCharCode(160);return h}function h(a){var e,l=[];for(e=0;e<a.childNodes.length;e++){var k=a.childNodes[e];k.nodeType===Node.TEXT_NODE?l.push(k):k.nodeType===Node.ELEMENT_NODE&&(l=l.concat(h(k)))}return l}a.addCommand("insertTab",{exec:function(a){var e=
|
|
904
|
+
a.getSelection(),m=e.getRanges(),k=new CKEDITOR.dom.text(e._.cache.nativeSel.focusNode),g=k.getText();if(null===g){k=h(m[0].root.$);a.insertHtml(l(4));a:{m=h(m[0].root.$);for(a=0;a<m.length;a++)if(!k[a]){m=m[a];break a}else if(!m[a].isEqualNode(k[a])){m=m[a];break a}m=void 0}k=new CKEDITOR.dom.text(m);m=e.getRanges();m[0].setStart(k,3);m[0].setEnd(k,3);e.selectRanges([m[0]]);m[0].setStart(k,4);m[0].setEnd(k,4)}else a=m[0].startOffset,k.setText([g.slice(0,a),l(4),g.slice(a)].join("")),m[0].setStart(k,
|
|
905
|
+
a+4),m[0].setEnd(k,a+4);e.selectRanges([m[0]])}});a.ui.addButton("TaoTab",{label:a.lang.insertTab.button,command:"insertTab",icon:this.path+"images/taotab.png"})}});CKEDITOR.plugins.add("taountab",{init:function(a){a.addCommand("removeTab",{exec:function(a){var h=a.getSelection();a=a.getSelection().getRanges();var f,e,m=new CKEDITOR.dom.text(h._.cache.nativeSel.focusNode),k=m.getText();if(null!==k){f=a[0].startOffset;a[0].setStart(m,Math.max(0,f-4));a[0].setEnd(m,Math.min(f+4,k.length));h.selectRanges([a[0]]);
|
|
906
|
+
e=h.getSelectedText();for(var g=0,b=-1,c=0;c<e.length;c++)if(" "===e.charAt(c)||e.charAt(c)===String.fromCharCode(160)){if(g||(b=c),g++,4===g)break}else g=0,b=-1;e=4===g?b:-1;0<=e&&(f=Math.max(0,f-4)+e,m.setText([k.slice(0,f),k.slice(f+4)].join("")));a[0].setStart(m,f);a[0].setEnd(m,f);h.selectRanges([a[0]])}}});a.ui.addButton("TaoUnTab",{label:a.lang.removeTab.button,command:"removeTab",icon:this.path+"images/taountab.png"})}});(function(){function a(a,e){e=void 0===e||e;var h;if(e)h=a.getComputedStyle("text-align");
|
|
907
|
+
else{for(;!a.hasAttribute||!a.hasAttribute("align")&&!a.getStyle("text-align");){h=a.getParent();if(!h)break;a=h}h=a.getStyle("text-align")||a.getAttribute("align")||""}h&&(h=h.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i,""));!h&&e&&(h="rtl"==a.getComputedStyle("direction")?"right":"left");return h}function l(a,e,h){this.editor=a;this.name=e;this.value=h;this.context="p";e=a.config.justifyClasses;var k=a.config.enterMode==CKEDITOR.ENTER_P?"p":"div";if(e){switch(h){case "left":this.cssClassName=
|
|
908
|
+
e[0];break;case "center":this.cssClassName=e[1];break;case "right":this.cssClassName=e[2];break;case "justify":this.cssClassName=e[3]}this.cssClassRegex=new RegExp("(?:^|\\s+)(?:"+e.join("|")+")(?\x3d$|\\s)");this.requiredContent=k+"("+this.cssClassName+")"}else this.requiredContent=k+"{text-align}";this.allowedContent={"caption div h1 h2 h3 h4 h5 h6 p pre td th li":{propertiesOnly:!0,styles:this.cssClassName?null:"text-align",classes:this.cssClassName||null}};a.config.enterMode==CKEDITOR.ENTER_BR&&
|
|
909
|
+
(this.allowedContent.div=!0)}function h(a){var e=a.editor,h=e.createRange();h.setStartBefore(a.data.node);h.setEndAfter(a.data.node);for(var k=new CKEDITOR.dom.walker(h),g;g=k.next();)if(g.type==CKEDITOR.NODE_ELEMENT)if(!g.equals(a.data.node)&&g.getDirection())h.setStartAfter(g),k=new CKEDITOR.dom.walker(h);else{var b=e.config.justifyClasses;b&&(g.hasClass(b[0])?(g.removeClass(b[0]),g.addClass(b[2])):g.hasClass(b[2])&&(g.removeClass(b[2]),g.addClass(b[0])));b=g.getStyle("text-align");"left"==b?g.setStyle("text-align",
|
|
910
|
+
"right"):"right"==b&&g.setStyle("text-align","left")}}l.prototype={exec:function(f){var e=f.getSelection(),h=f.config.enterMode;if(e){for(var k=e.createBookmarks(),g=e.getRanges(),b=this.cssClassName,c,d,l=f.config.useComputedState,l=void 0===l||l,p=g.length-1;0<=p;p--)for(c=g[p].createIterator(),c.enlargeBr=h!=CKEDITOR.ENTER_BR;d=c.getNextParagraph(h==CKEDITOR.ENTER_P?"p":"div");)if(!d.isReadOnly()){var q=d.getName(),y;y=f.activeFilter.check(q+"{text-align}");if((q=f.activeFilter.check(q+"("+b+")"))||
|
|
911
|
+
y){d.removeAttribute("align");d.removeStyle("text-align");var t=b&&(d.$.className=CKEDITOR.tools.ltrim(d.$.className.replace(this.cssClassRegex,""))),w=this.state==CKEDITOR.TRISTATE_OFF&&(!l||a(d,!0)!=this.value);b&&q?w?d.addClass(b):t||d.removeAttribute("class"):w&&y&&d.setStyle("text-align",this.value)}}f.focus();f.forceNextSelectionCheck();e.selectBookmarks(k)}},refresh:function(f,e){var h=e.block||e.blockLimit,k=h.getName(),g=h.equals(f.editable()),k=this.cssClassName?f.activeFilter.check(k+"("+
|
|
912
|
+
this.cssClassName+")"):f.activeFilter.check(k+"{text-align}");g&&!CKEDITOR.dtd.$list[e.lastElement.getName()]?this.setState(CKEDITOR.TRISTATE_OFF):!g&&k?this.setState(a(h,this.editor.config.useComputedState)==this.value?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)}};CKEDITOR.plugins.add("justify",{init:function(a){if(!a.blockless){var e=new l(a,"justifyleft","left"),m=new l(a,"justifycenter","center"),k=new l(a,"justifyright","right"),g=new l(a,"justifyblock",
|
|
913
|
+
"justify");a.addCommand("justifyleft",e);a.addCommand("justifycenter",m);a.addCommand("justifyright",k);a.addCommand("justifyblock",g);a.ui.addButton&&(a.ui.addButton("JustifyLeft",{label:a.lang.common.alignLeft,command:"justifyleft",toolbar:"align,10"}),a.ui.addButton("JustifyCenter",{label:a.lang.common.center,command:"justifycenter",toolbar:"align,20"}),a.ui.addButton("JustifyRight",{label:a.lang.common.alignRight,command:"justifyright",toolbar:"align,30"}),a.ui.addButton("JustifyBlock",{label:a.lang.common.justify,
|
|
914
|
+
command:"justifyblock",toolbar:"align,40"}));a.on("dirChanged",h)}}})})();(function(){function a(a,e){var g=f.exec(a),b=f.exec(e);if(g){if(!g[2]&&"px"==b[2])return b[1];if("px"==g[2]&&!b[2])return b[1]+"px"}return e}var l=CKEDITOR.htmlParser.cssStyle,h=CKEDITOR.tools.cssLength,f=/^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,e={elements:{$:function(e){var f=e.attributes;if((f=(f=(f=f&&f["data-cke-realelement"])&&new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(f)))&&f.children[0])&&e.attributes["data-cke-resizable"]){var g=
|
|
915
|
+
(new l(e)).rules;e=f.attributes;var b=g.width,g=g.height;b&&(e.width=a(e.width,b));g&&(e.height=a(e.height,g))}return f}}};CKEDITOR.plugins.add("fakeobjects",{init:function(a){a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}","fakeobjects")},afterInit:function(a){(a=(a=a.dataProcessor)&&a.htmlFilter)&&a.addRules(e,{applyToAll:!0})}});CKEDITOR.editor.prototype.createFakeElement=function(a,e,f,b){var c=this.lang.fakeobjects,c=c[f]||c.unknown;e={"class":e,"data-cke-realelement":encodeURIComponent(a.getOuterHtml()),
|
|
916
916
|
"data-cke-real-node-type":a.type,alt:c,title:c,align:a.getAttribute("align")||""};CKEDITOR.env.hc||(e.src=CKEDITOR.tools.transparentImageData);f&&(e["data-cke-real-element-type"]=f);b&&(e["data-cke-resizable"]=b,f=new l,b=a.getAttribute("width"),a=a.getAttribute("height"),b&&(f.rules.width=h(b)),a&&(f.rules.height=h(a)),f.populate(e));return this.document.createElement("img",{attributes:e})};CKEDITOR.editor.prototype.createFakeParserElement=function(a,e,f,b){var c=this.lang.fakeobjects,c=c[f]||c.unknown,
|
|
917
917
|
d;d=new CKEDITOR.htmlParser.basicWriter;a.writeHtml(d);d=d.getHtml();e={"class":e,"data-cke-realelement":encodeURIComponent(d),"data-cke-real-node-type":a.type,alt:c,title:c,align:a.attributes.align||""};CKEDITOR.env.hc||(e.src=CKEDITOR.tools.transparentImageData);f&&(e["data-cke-real-element-type"]=f);b&&(e["data-cke-resizable"]=b,b=a.attributes,a=new l,f=b.width,b=b.height,void 0!==f&&(a.rules.width=h(f)),void 0!==b&&(a.rules.height=h(b)),a.populate(e));return new CKEDITOR.htmlParser.element("img",
|
|
918
|
-
e)};CKEDITOR.editor.prototype.restoreRealElement=function(e){if(e.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var f=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(e.data("cke-realelement")),this.document);if(e.data("cke-resizable")){var
|
|
918
|
+
e)};CKEDITOR.editor.prototype.restoreRealElement=function(e){if(e.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var f=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(e.data("cke-realelement")),this.document);if(e.data("cke-resizable")){var g=e.getStyle("width");e=e.getStyle("height");g&&f.setAttribute("width",a(f.getAttribute("width"),g));e&&f.setAttribute("height",a(f.getAttribute("height"),e))}return f}})();"use strict";(function(){function a(a){return a.replace(/'/g,"\\$\x26")}
|
|
919
919
|
function l(a){for(var b=a.length,c=[],d,e=0;e<b;e++)d=a.charCodeAt(e),c.push(d);return"String.fromCharCode("+c.join(",")+")"}function h(b,c){for(var d=b.plugins.link,e=d.compiledProtectionFunction.params,d=[d.compiledProtectionFunction.name,"("],f,g,h=0;h<e.length;h++)f=e[h].toLowerCase(),g=c[f],0<h&&d.push(","),d.push("'",g?a(encodeURIComponent(c[f])):"","'");d.push(")");return d.join("")}function f(a){a=a.config.emailProtection||"";var b;a&&"encode"!=a&&(b={},a.replace(/^([^(]+)\(([^)]+)\)$/,function(a,
|
|
920
920
|
c,d){b.name=c;b.params=[];d.replace(/[^,\s]+/g,function(a){b.params.push(a)})}));return b}CKEDITOR.plugins.add("link",{requires:"dialog,fakeobjects",onLoad:function(){function a(b){return c.replace(/%1/g,"rtl"==b?"right":"left").replace(/%2/g,"cke_contents_"+b)}var b="background:url("+CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png")+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",c=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+
|
|
921
921
|
b+"padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{"+b+"width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";CKEDITOR.addCss(a("ltr")+a("rtl"))},init:function(a){var b="a[!href]";CKEDITOR.dialog.isTabEnabled(a,"link","advanced")&&(b=b.replace("]",",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type,download]{*}(*)"));CKEDITOR.dialog.isTabEnabled(a,"link","target")&&(b=b.replace("]",",target,onclick]"));a.addCommand("link",new CKEDITOR.dialogCommand("link",{allowedContent:b,
|
|
@@ -923,17 +923,17 @@ requiredContent:"a[href]"}));a.addCommand("anchor",new CKEDITOR.dialogCommand("a
|
|
|
923
923
|
toolbar:"links,20"}),a.ui.addButton("Anchor",{label:a.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"}));CKEDITOR.dialog.add("link",this.path+"dialogs/link.js");CKEDITOR.dialog.add("anchor",this.path+"dialogs/anchor.js");a.on("doubleclick",function(b){var c=b.data.element.getAscendant({a:1,img:1},!0);c&&!c.isReadOnly()&&(c.is("a")?(b.data.dialog=!c.getAttribute("name")||c.getAttribute("href")&&c.getChildCount()?"link":"anchor",b.data.link=c):CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,
|
|
924
924
|
c)&&(b.data.dialog="anchor"))},null,null,0);a.on("doubleclick",function(b){b.data.dialog in{link:1,anchor:1}&&b.data.link&&a.getSelection().selectElement(b.data.link)},null,null,20);a.addMenuItems&&a.addMenuItems({anchor:{label:a.lang.link.anchor.menu,command:"anchor",group:"anchor",order:1},removeAnchor:{label:a.lang.link.anchor.remove,command:"removeAnchor",group:"anchor",order:5},link:{label:a.lang.link.menu,command:"link",group:"link",order:1},unlink:{label:a.lang.link.unlink,command:"unlink",
|
|
925
925
|
group:"link",order:5}});a.contextMenu&&a.contextMenu.addListener(function(b){if(!b||b.isReadOnly())return null;b=CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b);if(!b&&!(b=CKEDITOR.plugins.link.getSelectedLink(a)))return null;var c={};b.getAttribute("href")&&b.getChildCount()&&(c={link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF});b&&b.hasAttribute("name")&&(c.anchor=c.removeAnchor=CKEDITOR.TRISTATE_OFF);return c});this.compiledProtectionFunction=f(a)},afterInit:function(a){a.dataProcessor.dataFilter.addRules({elements:{a:function(b){return b.attributes.name?
|
|
926
|
-
b.children.length?null:a.createFakeParserElement(b,"cke_anchor","anchor"):null}}});var b=a._.elementsPath&&a._.elementsPath.filters;b&&b.push(function(b,c){if("a"==c&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b)||b.getAttribute("name")&&(!b.getAttribute("href")||!b.getChildCount())))return"anchor"})}});var e=/^javascript:/,m=/^(?:mailto)(?:(?!\?(subject|body)=).)+/i,
|
|
927
|
-
n=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
|
|
926
|
+
b.children.length?null:a.createFakeParserElement(b,"cke_anchor","anchor"):null}}});var b=a._.elementsPath&&a._.elementsPath.filters;b&&b.push(function(b,c){if("a"==c&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b)||b.getAttribute("name")&&(!b.getAttribute("href")||!b.getChildCount())))return"anchor"})}});var e=/^javascript:/,m=/^(?:mailto)(?:(?!\?(subject|body)=).)+/i,k=/subject=([^;?:@&=$,\/]*)/i,g=/body=([^;?:@&=$,\/]*)/i,b=/^#(.*)$/,c=/^((?:http|https|ftp|news):\/\/)?(.*)$/,d=/^(_(?:self|top|parent|blank))$/,
|
|
927
|
+
n=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,p=/^javascript:([^(]+)\(([^)]+)\)$/,q=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,y=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,t=/^tel:(.*)$/,w={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",type:"advContentType","class":"advCSSClasses",charset:"advCharset",style:"advStyles",
|
|
928
928
|
rel:"advRel"};CKEDITOR.plugins.link={getSelectedLink:function(a,b){var c=a.getSelection(),d=c.getSelectedElement(),e=c.getRanges(),f=[],g;if(!b&&d&&d.is("a"))return d;for(d=0;d<e.length;d++)if(g=c.getRanges()[d],g.shrink(CKEDITOR.SHRINK_ELEMENT,!0,{skipBogus:!0}),(g=a.elementPath(g.getCommonAncestor()).contains("a",1))&&b)f.push(g);else if(g)return g;return b?f:null},getEditorAnchors:function(a){for(var b=a.editable(),c=b.isInline()&&!a.plugins.divarea?a.document:b,b=c.getElementsByTag("a"),c=c.getElementsByTag("img"),
|
|
929
929
|
d=[],e=0,f;f=b.getItem(e++);)(f.data("cke-saved-name")||f.hasAttribute("name"))&&d.push({name:f.data("cke-saved-name")||f.getAttribute("name"),id:f.getAttribute("id")});for(e=0;f=c.getItem(e++);)(f=this.tryRestoreFakeAnchor(a,f))&&d.push({name:f.getAttribute("name"),id:f.getAttribute("id")});return d},fakeAnchor:!0,tryRestoreFakeAnchor:function(a,b){if(b&&b.data("cke-real-element-type")&&"anchor"==b.data("cke-real-element-type")){var c=a.restoreRealElement(b);if(c.data("cke-saved-name"))return c}},
|
|
930
|
-
parseLinkAttributes:function(a,f){var h=f&&(f.data("cke-saved-href")||f.getAttribute("href"))||"",l=a.plugins.link.compiledProtectionFunction,
|
|
931
|
-
"").replace(/\\'/g,"'"),f=e(f),e=l.params[g].toLowerCase(),a[e]=f;a.address=[a.name,a.domain].join("@")}}));if(!
|
|
932
|
-
|
|
933
|
-
(
|
|
930
|
+
parseLinkAttributes:function(a,f){var h=f&&(f.data("cke-saved-href")||f.getAttribute("href"))||"",l=a.plugins.link.compiledProtectionFunction,z=a.config.emailProtection,v={},D;h.match(e)&&("encode"==z?h=h.replace(n,function(a,b,c){c=c||"";return"mailto:"+String.fromCharCode.apply(String,b.split(","))+c.replace(/\\'/g,"'")}):z&&h.replace(p,function(a,b,c){if(b==l.name){v.type="email";a=v.email={};b=/(^')|('$)/g;c=c.match(/[^,\s]+/g);for(var d=c.length,e,f,g=0;g<d;g++)e=decodeURIComponent,f=c[g].replace(b,
|
|
931
|
+
"").replace(/\\'/g,"'"),f=e(f),e=l.params[g].toLowerCase(),a[e]=f;a.address=[a.name,a.domain].join("@")}}));if(!v.type)if(z=h.match(b))v.type="anchor",v.anchor={},v.anchor.name=v.anchor.id=z[1];else if(z=h.match(t))v.type="tel",v.tel=z[1];else if(z=h.match(m)){D=h.match(k);var h=h.match(g),C=v.email={};v.type="email";C.address=z[0].replace("mailto:","");D&&(C.subject=decodeURIComponent(D[1]));h&&(C.body=decodeURIComponent(h[1]))}else h&&(D=h.match(c))&&(v.type="url",v.url={},v.url.protocol=D[1],v.url.url=
|
|
932
|
+
D[2]);if(f){if(h=f.getAttribute("target"))v.target={type:h.match(d)?h:"frame",name:h};else if(h=(h=f.data("cke-pa-onclick")||f.getAttribute("onclick"))&&h.match(q))for(v.target={type:"popup",name:h[1]};z=y.exec(h[2]);)"yes"!=z[2]&&"1"!=z[2]||z[1]in{height:1,width:1,top:1,left:1}?isFinite(z[2])&&(v.target[z[1]]=z[2]):v.target[z[1]]=!0;null!==f.getAttribute("download")&&(v.download=!0);var h={},B;for(B in w)(z=f.getAttribute(B))&&(h[w[B]]=z);if(B=f.data("cke-saved-name")||h.advName)h.advName=B;CKEDITOR.tools.isEmpty(h)||
|
|
933
|
+
(v.advanced=h)}return v},getLinkAttributes:function(b,c){var d=b.config.emailProtection||"",e={};switch(c.type){case "url":var d=c.url&&void 0!==c.url.protocol?c.url.protocol:"http://",f=c.url&&CKEDITOR.tools.trim(c.url.url)||"";e["data-cke-saved-href"]=0===f.indexOf("/")?f:d+f;break;case "anchor":d=c.anchor&&c.anchor.id;e["data-cke-saved-href"]="#"+(c.anchor&&c.anchor.name||d||"");break;case "email":var g=c.email,f=g.address;switch(d){case "":case "encode":var k=encodeURIComponent(g.subject||""),
|
|
934
934
|
m=encodeURIComponent(g.body||""),g=[];k&&g.push("subject\x3d"+k);m&&g.push("body\x3d"+m);g=g.length?"?"+g.join("\x26"):"";"encode"==d?(d=["javascript:void(location.href\x3d'mailto:'+",l(f)],g&&d.push("+'",a(g),"'"),d.push(")")):d=["mailto:",f,g];break;default:d=f.split("@",2),g.name=d[0],g.domain=d[1],d=["javascript:",h(b,g)]}e["data-cke-saved-href"]=d.join("");break;case "tel":e["data-cke-saved-href"]="tel:"+c.tel}if(c.target)if("popup"==c.target.type){for(var d=["window.open(this.href, '",c.target.name||
|
|
935
|
-
"","', '"],
|
|
936
|
-
(e["data-cke-saved-name"]=e.name)}e["data-cke-saved-href"]&&(e.href=e["data-cke-saved-href"]);
|
|
935
|
+
"","', '"],n="resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "),f=n.length,k=function(a){c.target[a]&&n.push(a+"\x3d"+c.target[a])},g=0;g<f;g++)n[g]+=c.target[n[g]]?"\x3dyes":"\x3dno";k("width");k("left");k("height");k("top");d.push(n.join(","),"'); return false;");e["data-cke-pa-onclick"]=d.join("")}else"notSet"!=c.target.type&&c.target.name&&(e.target=c.target.name);c.download&&(e.download="");if(c.advanced){for(var t in w)(d=c.advanced[w[t]])&&(e[t]=d);e.name&&
|
|
936
|
+
(e["data-cke-saved-name"]=e.name)}e["data-cke-saved-href"]&&(e.href=e["data-cke-saved-href"]);t={target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1,download:1};c.advanced&&CKEDITOR.tools.extend(t,w);for(var p in e)delete t[p];return{set:e,removed:CKEDITOR.tools.object.keys(t)}},showDisplayTextForElement:function(a,b){var c={img:1,table:1,tbody:1,thead:1,tfoot:1,input:1,select:1,textarea:1},d=b.getSelection();return b.widgets&&b.widgets.focused||d&&1<d.getRanges().length?!1:!a||!a.getName||
|
|
937
937
|
!a.is(c)}};CKEDITOR.unlinkCommand=function(){};CKEDITOR.unlinkCommand.prototype={exec:function(a){if(CKEDITOR.env.ie){var b=a.getSelection().getRanges()[0],c=b.getPreviousEditableNode()&&b.getPreviousEditableNode().getAscendant("a",!0)||b.getNextEditableNode()&&b.getNextEditableNode().getAscendant("a",!0),d;b.collapsed&&c&&(d=b.createBookmark(),b.selectNodeContents(c),b.select())}c=new CKEDITOR.style({element:"a",type:CKEDITOR.STYLE_INLINE,alwaysRemoveElement:1});a.removeStyle(c);d&&(b.moveToBookmark(d),
|
|
938
938
|
b.select())},refresh:function(a,b){var c=b.lastElement&&b.lastElement.getAscendant("a",!0);c&&"a"==c.getName()&&c.getAttribute("href")&&c.getChildCount()?this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)},contextSensitive:1,startDisabled:1,requiredContent:"a[href]",editorFocus:1};CKEDITOR.removeAnchorCommand=function(){};CKEDITOR.removeAnchorCommand.prototype={exec:function(a){var b=a.getSelection(),c=b.createBookmarks(),d;if(b&&(d=b.getSelectedElement())&&(d.getChildCount()?
|
|
939
939
|
d.is("a"):CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,d)))d.remove(1);else if(d=CKEDITOR.plugins.link.getSelectedLink(a))d.hasAttribute("href")?(d.removeAttributes({name:1,"data-cke-saved-name":1}),d.removeClass("cke_anchor")):d.remove(1);b.selectBookmarks(c)},requiredContent:"a[name]"};CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:!0,linkShowTargetTab:!0,linkDefaultProtocol:"http://"})})();(function(){function a(a,b,c,d){for(var e=CKEDITOR.plugins.list.listToArray(b.root,c),f=[],g=
|
|
@@ -942,65 +942,65 @@ e=c.listNode.getChildCount(),g=0;g<e&&(n=c.listNode.getChild(g));g++)n.getName()
|
|
|
942
942
|
0;g<d.length;g++)for(var l=d[g],m;m=l.getParent();){if(m.equals(b)){f.push(l);!k&&l.getDirection()&&(k=1);l=l.getDirection(a);null!==h&&(h=h&&h!=l?null:l);break}l=m}if(!(1>f.length)){d=f[f.length-1].getNext();g=e.createElement(this.type);for(c.push(g);f.length;)c=f.shift(),a=e.createElement("li"),l=c,l.is("pre")||y.test(l.getName())||"false"==l.getAttribute("contenteditable")?c.appendTo(a):(c.copyAttributes(a),h&&c.getDirection()&&(a.removeStyle("direction"),a.removeAttribute("dir")),c.moveChildren(a),
|
|
943
943
|
c.remove()),a.appendTo(g);h&&k&&g.setAttribute("dir",h);d?g.insertBefore(d):g.appendTo(b)}}function h(a,b,c){function d(c){if(!(!(l=k[c?"getFirst":"getLast"]())||l.is&&l.isBlockBoundary()||!(m=b.root[c?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))||m.is&&m.isBlockBoundary({br:1})))a.document.createElement("br")[c?"insertBefore":"insertAfter"](l)}for(var e=CKEDITOR.plugins.list.listToArray(b.root,c),f=[],g=0;g<b.contents.length;g++){var h=b.contents[g];(h=h.getAscendant("li",!0))&&!h.getCustomData("list_item_processed")&&
|
|
944
944
|
(f.push(h),CKEDITOR.dom.element.setMarker(c,h,"list_item_processed",!0))}h=null;for(g=0;g<f.length;g++)h=f[g].getCustomData("listarray_index"),e[h].indent=-1;for(g=h+1;g<e.length;g++)if(e[g].indent>e[g-1].indent+1){f=e[g-1].indent+1-e[g].indent;for(h=e[g].indent;e[g]&&e[g].indent>=h;)e[g].indent+=f,g++;g--}var k=CKEDITOR.plugins.list.arrayToList(e,c,null,a.config.enterMode,b.root.getAttribute("dir")).listNode,l,m;d(!0);d();k.replace(b.root);a.fire("contentDomInvalidated")}function f(a,b){this.name=
|
|
945
|
-
a;this.context=this.type=b;this.allowedContent=b+" li";this.requiredContent=b}function e(a,b,c,d){for(var e,f;e=a[d?"getLast":"getFirst"](
|
|
946
|
-
CKEDITOR.dtd.$block||a.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[a.getName()]["#"]}function
|
|
947
|
-
|
|
948
|
-
a.editable();d.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=function(a){return
|
|
945
|
+
a;this.context=this.type=b;this.allowedContent=b+" li";this.requiredContent=b}function e(a,b,c,d){for(var e,f;e=a[d?"getLast":"getFirst"](t);)(f=e.getDirection(1))!==b.getDirection(1)&&e.setAttribute("dir",f),e.remove(),c?e[d?"insertBefore":"insertAfter"](c):b.append(e,d),c=e}function m(a){function b(c){var d=a[c?"getPrevious":"getNext"](p);d&&d.type==CKEDITOR.NODE_ELEMENT&&d.is(a.getName())&&(e(a,d,null,!c),a.remove(),a=d)}b();b(1)}function k(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.getName()in
|
|
946
|
+
CKEDITOR.dtd.$block||a.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[a.getName()]["#"]}function g(a,c,d){a.fire("saveSnapshot");d.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var f=d.extractContents();c.trim(!1,!0);var g=c.createBookmark(),h=new CKEDITOR.dom.elementPath(c.startContainer),k=h.block,h=h.lastElement.getAscendant("li",1)||k,l=new CKEDITOR.dom.elementPath(d.startContainer),n=l.contains(CKEDITOR.dtd.$listItem),l=l.contains(CKEDITOR.dtd.$list);k?(k=k.getBogus())&&k.remove():l&&(k=l.getPrevious(p))&&
|
|
947
|
+
q(k)&&k.remove();(k=f.getLast())&&k.type==CKEDITOR.NODE_ELEMENT&&k.is("br")&&k.remove();(k=c.startContainer.getChild(c.startOffset))?f.insertBefore(k):c.startContainer.append(f);n&&(f=b(n))&&(h.contains(n)?(e(f,n.getParent(),n),f.remove()):h.append(f));for(;d.checkStartOfBlock()&&d.checkEndOfBlock();){l=d.startPath();f=l.block;if(!f)break;f.is("li")&&(h=f.getParent(),f.equals(h.getLast(p))&&f.equals(h.getFirst(p))&&(f=h));d.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START);f.remove()}d=d.clone();f=
|
|
948
|
+
a.editable();d.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=function(a){return p(a)&&!q(a)};(d=d.next())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getName()in CKEDITOR.dtd.$list&&m(d);c.moveToBookmark(g);c.select();a.fire("saveSnapshot")}function b(a){return(a=a.getLast(p))&&a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in c?a:null}var c={ol:1,ul:1},d=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(),p=function(a){return!(d(a)||n(a))},q=CKEDITOR.dom.walker.bogus();
|
|
949
949
|
CKEDITOR.plugins.list={listToArray:function(a,b,d,e,f){if(!c[a.getName()])return[];e||(e=0);d||(d=[]);for(var g=0,h=a.getChildCount();g<h;g++){var k=a.getChild(g);k.type==CKEDITOR.NODE_ELEMENT&&k.getName()in CKEDITOR.dtd.$list&&CKEDITOR.plugins.list.listToArray(k,b,d,e+1);if("li"==k.$.nodeName.toLowerCase()){var l={parent:a,indent:e,element:k,contents:[]};f?l.grandparent=f:(l.grandparent=a.getParent(),l.grandparent&&"li"==l.grandparent.$.nodeName.toLowerCase()&&(l.grandparent=l.grandparent.getParent()));
|
|
950
|
-
b&&CKEDITOR.dom.element.setMarker(b,k,"listarray_index",d.length);d.push(l);for(var m=0,n=k.getChildCount(),
|
|
951
|
-
a[m];g=H.grandparent;y=H.element.getDirection(1);if(H.indent==
|
|
952
|
-
h.$.documentMode&&
|
|
953
|
-
1));else if(
|
|
954
|
-
S&&((E||
|
|
955
|
-
(CKEDITOR.dom.element.clearMarkers(b,a),a.getName()in CKEDITOR.dtd.$listItem&&(d=a,h=f=e=void 0,e=d.getDirection()))){for(f=d.getParent();f&&!(h=f.getDirection());)f=f.getParent();e==h&&d.removeAttribute("dir")}a=a.getNextSourceNode()}return{listNode:k,nextIndex:m}}};var y=/^h[1-6]$/,
|
|
956
|
-
function(a){return-1===CKEDITOR.tools.array.indexOf(b,a.type)}).length}function f(a){var b=!0;if(0===a.getChildCount())return!1;a.forEach(function(a){if(a.type!==CKEDITOR.NODE_COMMENT)return b=!1},null,!0);return b}this.refresh(b,b.elementPath());var g=b.config,k=b.getSelection(),
|
|
957
|
-
CKEDITOR.ENTER_BR?n.appendBogus():
|
|
958
|
-
this.state==CKEDITOR.TRISTATE_OFF;y=
|
|
959
|
-
|
|
950
|
+
b&&CKEDITOR.dom.element.setMarker(b,k,"listarray_index",d.length);d.push(l);for(var m=0,n=k.getChildCount(),t;m<n;m++)t=k.getChild(m),t.type==CKEDITOR.NODE_ELEMENT&&c[t.getName()]?CKEDITOR.plugins.list.listToArray(t,b,d,e+1,l.grandparent):l.contents.push(t)}}return d},arrayToList:function(a,b,d,e,f){d||(d=0);if(!a||a.length<d+1)return null;for(var g,h=a[d].parent.getDocument(),k=new CKEDITOR.dom.documentFragment(h),l=null,m=d,t=Math.max(a[d].indent,0),q=null,y,E,L=e==CKEDITOR.ENTER_P?"p":"div";;){var H=
|
|
951
|
+
a[m];g=H.grandparent;y=H.element.getDirection(1);if(H.indent==t){l&&a[m].parent.getName()==l.getName()||(l=a[m].parent.clone(!1,1),f&&l.setAttribute("dir",f),k.append(l));q=l.append(H.element.clone(0,1));y!=l.getDirection(1)&&q.setAttribute("dir",y);for(g=0;g<H.contents.length;g++)q.append(H.contents[g].clone(1,1));m++}else if(H.indent==Math.max(t,0)+1)H=a[m-1].element.getDirection(1),m=CKEDITOR.plugins.list.arrayToList(a,null,m,e,H!=y?y:null),!q.getChildCount()&&CKEDITOR.env.needsNbspFiller&&7>=
|
|
952
|
+
h.$.documentMode&&q.append(h.createText(" ")),q.append(m.listNode),m=m.nextIndex;else if(-1==H.indent&&!d&&g){c[g.getName()]?(q=H.element.clone(!1,!0),y!=g.getDirection(1)&&q.setAttribute("dir",y)):q=new CKEDITOR.dom.documentFragment(h);var l=g.getDirection(1)!=y,K=H.element,F=K.getAttribute("class"),N=K.getAttribute("style"),O=q.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(e!=CKEDITOR.ENTER_BR||l||N||F),I,X=H.contents.length,S;for(g=0;g<X;g++)if(I=H.contents[g],n(I)&&1<X)O?S=I.clone(1,1):q.append(I.clone(1,
|
|
953
|
+
1));else if(I.type==CKEDITOR.NODE_ELEMENT&&I.isBlockBoundary()){l&&!I.getDirection()&&I.setAttribute("dir",y);E=I;var Y=K.getAttribute("style");Y&&E.setAttribute("style",Y.replace(/([^;])$/,"$1;")+(E.getAttribute("style")||""));F&&I.addClass(F);E=null;S&&(q.append(S),S=null);q.append(I.clone(1,1))}else O?(E||(E=h.createElement(L),q.append(E),l&&E.setAttribute("dir",y)),N&&E.setAttribute("style",N),F&&E.setAttribute("class",F),S&&(E.append(S),S=null),E.append(I.clone(1,1))):q.append(I.clone(1,1));
|
|
954
|
+
S&&((E||q).append(S),S=null);q.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&m!=a.length-1&&(CKEDITOR.env.needsBrFiller&&(y=q.getLast())&&y.type==CKEDITOR.NODE_ELEMENT&&y.is("br")&&y.remove(),(y=q.getLast(p))&&y.type==CKEDITOR.NODE_ELEMENT&&y.is(CKEDITOR.dtd.$block)||q.append(h.createElement("br")));y=q.$.nodeName.toLowerCase();"div"!=y&&"p"!=y||q.appendBogus();k.append(q);l=null;m++}else return null;E=null;if(a.length<=m||Math.max(a[m].indent,0)<t)break}if(b)for(a=k.getFirst();a;){if(a.type==CKEDITOR.NODE_ELEMENT&&
|
|
955
|
+
(CKEDITOR.dom.element.clearMarkers(b,a),a.getName()in CKEDITOR.dtd.$listItem&&(d=a,h=f=e=void 0,e=d.getDirection()))){for(f=d.getParent();f&&!(h=f.getDirection());)f=f.getParent();e==h&&d.removeAttribute("dir")}a=a.getNextSourceNode()}return{listNode:k,nextIndex:m}}};var y=/^h[1-6]$/,t=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);f.prototype={exec:function(b){function d(a){return c[a.root.getName()]&&!e(a.root,[CKEDITOR.NODE_COMMENT])}function e(a,b){return CKEDITOR.tools.array.filter(a.getChildren().toArray(),
|
|
956
|
+
function(a){return-1===CKEDITOR.tools.array.indexOf(b,a.type)}).length}function f(a){var b=!0;if(0===a.getChildCount())return!1;a.forEach(function(a){if(a.type!==CKEDITOR.NODE_COMMENT)return b=!1},null,!0);return b}this.refresh(b,b.elementPath());var g=b.config,k=b.getSelection(),v=k&&k.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF){var n=b.editable();if(n.getFirst(p)){var t=1==v.length&&v[0];(g=t&&t.getEnclosedNode())&&g.is&&this.type==g.getName()&&this.setState(CKEDITOR.TRISTATE_ON)}else g.enterMode==
|
|
957
|
+
CKEDITOR.ENTER_BR?n.appendBogus():v[0].fixBlock(1,g.enterMode==CKEDITOR.ENTER_P?"p":"div"),k.selectRanges(v)}for(var g=k.createBookmarks(!0),n=[],B={},v=v.createIterator(),q=0;(t=v.getNextRange())&&++q;){var y=t.getBoundaryNodes(),J=y.startNode,E=y.endNode;J.type==CKEDITOR.NODE_ELEMENT&&"td"==J.getName()&&t.setStartAt(y.startNode,CKEDITOR.POSITION_AFTER_START);E.type==CKEDITOR.NODE_ELEMENT&&"td"==E.getName()&&t.setEndAt(y.endNode,CKEDITOR.POSITION_BEFORE_END);t=t.createIterator();for(t.forceBrBreak=
|
|
958
|
+
this.state==CKEDITOR.TRISTATE_OFF;y=t.getNextParagraph();)if(!y.getCustomData("list_block")&&!f(y)){CKEDITOR.dom.element.setMarker(B,y,"list_block",1);for(var L=b.elementPath(y),J=L.elements,E=0,L=L.blockLimit,H,K=J.length-1;0<=K&&(H=J[K]);K--)if(c[H.getName()]&&L.contains(H)){L.removeCustomData("list_group_object_"+q);(J=H.getCustomData("list_group_object"))?J.contents.push(y):(J={root:H,contents:[y]},n.push(J),CKEDITOR.dom.element.setMarker(B,H,"list_group_object",J));E=1;break}E||(E=L,E.getCustomData("list_group_object_"+
|
|
959
|
+
q)?E.getCustomData("list_group_object_"+q).contents.push(y):(J={root:E,contents:[y]},CKEDITOR.dom.element.setMarker(B,E,"list_group_object_"+q,J),n.push(J)))}}for(H=[];0<n.length;)J=n.shift(),this.state==CKEDITOR.TRISTATE_OFF?d(J)||(c[J.root.getName()]?a.call(this,b,J,B,H):l.call(this,b,J,H)):this.state==CKEDITOR.TRISTATE_ON&&c[J.root.getName()]&&!d(J)&&h.call(this,b,J,B);for(K=0;K<H.length;K++)m(H[K]);CKEDITOR.dom.element.clearAllMarkers(B);k.selectBookmarks(g);b.focus()},refresh:function(a,b){var d=
|
|
960
960
|
b.contains(c,1),e=b.blockLimit||b.root;d&&e.contains(d)?this.setState(d.is(this.type)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.plugins.add("list",{requires:"indentlist",init:function(a){a.blockless||(a.addCommand("numberedlist",new f("numberedlist","ol")),a.addCommand("bulletedlist",new f("bulletedlist","ul")),a.ui.addButton&&(a.ui.addButton("NumberedList",{label:a.lang.list.numberedlist,command:"numberedlist",directional:!0,toolbar:"list,10"}),a.ui.addButton("BulletedList",
|
|
961
|
-
{label:a.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),a.on("key",function(d){var e=d.data.domEvent.getKey(),f;if("wysiwyg"==a.mode&&e in{8:1,46:1}){var h=a.getSelection().getRanges()[0],l=h&&h.startPath();if(h&&h.collapsed){var m=8==e,n=a.editable(),
|
|
962
|
-
CKEDITOR.START)&&(
|
|
963
|
-
if(f)
|
|
964
|
-
(l=2),l&&
|
|
965
|
-
|
|
961
|
+
{label:a.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),a.on("key",function(d){var e=d.data.domEvent.getKey(),f;if("wysiwyg"==a.mode&&e in{8:1,46:1}){var h=a.getSelection().getRanges()[0],l=h&&h.startPath();if(h&&h.collapsed){var m=8==e,n=a.editable(),t=new CKEDITOR.dom.walker(h.clone());t.evaluator=function(a){return p(a)&&!q(a)};t.guard=function(a,b){return!(b&&a.type==CKEDITOR.NODE_ELEMENT&&a.is("table"))};e=h.clone();if(m){var B;(B=l.contains(c))&&h.checkBoundaryOfElement(B,
|
|
962
|
+
CKEDITOR.START)&&(B=B.getParent())&&B.is("li")&&(B=b(B))?(f=B,B=B.getPrevious(p),e.moveToPosition(B&&q(B)?B:f,CKEDITOR.POSITION_BEFORE_START)):(t.range.setStartAt(n,CKEDITOR.POSITION_AFTER_START),t.range.setEnd(h.startContainer,h.startOffset),(B=t.previous())&&B.type==CKEDITOR.NODE_ELEMENT&&(B.getName()in c||B.is("li"))&&(B.is("li")||(t.range.selectNodeContents(B),t.reset(),t.evaluator=k,B=t.previous()),f=B,e.moveToElementEditEnd(f),e.moveToPosition(e.endPath().block,CKEDITOR.POSITION_BEFORE_END)));
|
|
963
|
+
if(f)g(a,e,h),d.cancel();else{var y=l.contains(c);y&&h.checkBoundaryOfElement(y,CKEDITOR.START)&&(f=y.getFirst(p),h.checkBoundaryOfElement(f,CKEDITOR.START)&&(B=y.getPrevious(p),b(f)?B&&(h.moveToElementEditEnd(B),h.select()):a.execCommand("outdent"),d.cancel()))}}else if(f=l.contains("li")){if(t.range.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),m=(n=f.getLast(p))&&k(n)?n:f,l=0,(B=t.next())&&B.type==CKEDITOR.NODE_ELEMENT&&B.getName()in c&&B.equals(n)?(l=1,B=t.next()):h.checkBoundaryOfElement(m,CKEDITOR.END)&&
|
|
964
|
+
(l=2),l&&B){h=h.clone();h.moveToElementEditStart(B);if(1==l&&(e.optimize(),!e.startContainer.equals(f))){for(f=e.startContainer;f.is(CKEDITOR.dtd.$inline);)y=f,f=f.getParent();y&&e.moveToPosition(y,CKEDITOR.POSITION_AFTER_END)}2==l&&(e.moveToPosition(e.endPath().block,CKEDITOR.POSITION_BEFORE_END),h.endPath().block&&h.moveToPosition(h.endPath().block,CKEDITOR.POSITION_AFTER_START));g(a,e,h);d.cancel()}}else t.range.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),(B=t.next())&&B.type==CKEDITOR.NODE_ELEMENT&&
|
|
965
|
+
B.is(c)&&(B=B.getFirst(p),l.block&&h.checkStartOfBlock()&&h.checkEndOfBlock()?(l.block.remove(),h.moveToElementEditStart(B),h.select()):b(B)?(h.moveToElementEditStart(B),h.select()):(h=h.clone(),h.moveToElementEditStart(B),g(a,e,h)),d.cancel());setTimeout(function(){a.selectionChange(1)})}}}))}})})();(function(){CKEDITOR.plugins.liststyle={requires:"dialog,contextmenu",init:function(a){if(!a.blockless){var l;l=new CKEDITOR.dialogCommand("numberedListStyle",{requiredContent:"ol",allowedContent:"ol{list-style-type}[start]; li{list-style-type}[value]",
|
|
966
966
|
contentTransformations:[["ol: listTypeToStyle"]]});l=a.addCommand("numberedListStyle",l);a.addFeature(l);CKEDITOR.dialog.add("numberedListStyle",this.path+"dialogs/liststyle.js");l=new CKEDITOR.dialogCommand("bulletedListStyle",{requiredContent:"ul",allowedContent:"ul{list-style-type}",contentTransformations:[["ul: listTypeToStyle"]]});l=a.addCommand("bulletedListStyle",l);a.addFeature(l);CKEDITOR.dialog.add("bulletedListStyle",this.path+"dialogs/liststyle.js");a.addMenuGroup("list",108);a.addMenuItems({numberedlist:{label:a.lang.liststyle.numberedTitle,
|
|
967
967
|
group:"list",command:"numberedListStyle"},bulletedlist:{label:a.lang.liststyle.bulletedTitle,group:"list",command:"bulletedListStyle"}});a.contextMenu.addListener(function(a){if(!a||a.isReadOnly())return null;for(;a;){var f=a.getName();if("ol"==f)return{numberedlist:CKEDITOR.TRISTATE_OFF};if("ul"==f)return{bulletedlist:CKEDITOR.TRISTATE_OFF};a=a.getParent()}return null})}}};CKEDITOR.plugins.add("liststyle",CKEDITOR.plugins.liststyle)})();"use strict";(function(){function a(a,b,c){return n(b)&&n(c)&&
|
|
968
|
-
c.equals(b.getNext(function(a){return!(P(a)||Q(a)||
|
|
969
|
-
b.type==CKEDITOR.NODE_TEXT&&!P(b)||n(b)&&!
|
|
968
|
+
c.equals(b.getNext(function(a){return!(P(a)||Q(a)||p(a))}))}function l(a){this.upper=a[0];this.lower=a[1];this.set.apply(this,a.slice(2))}function h(a){var b=a.element;if(b&&n(b)&&(b=b.getAscendant(a.triggers,!0))&&a.editable.contains(b)){var c=k(b);if("true"==c.getAttribute("contenteditable"))return b;if(c.is(a.triggers))return c}return null}function f(a,b,c){u(a,b);u(a,c);a=b.size.bottom;c=c.size.top;return a&&c?0|(a+c)/2:a||c}function e(a,b,c){return b=b[c?"getPrevious":"getNext"](function(b){return b&&
|
|
969
|
+
b.type==CKEDITOR.NODE_TEXT&&!P(b)||n(b)&&!p(b)&&!d(a,b)})}function m(a,b,c){return a>b&&a<c}function k(a,b){if(a.data("cke-editable"))return null;for(b||(a=a.getParent());a&&!a.data("cke-editable");){if(a.hasAttribute("contenteditable"))return a;a=a.getParent()}return null}function g(a){var c=a.doc,d=G('\x3cspan contenteditable\x3d"false" data-cke-magic-line\x3d"1" style\x3d"'+ba+"position:absolute;border-top:1px dashed "+a.boxColor+'"\x3e\x3c/span\x3e',c),e=CKEDITOR.getUrl(this.path+"images/"+(M.hidpi?
|
|
970
970
|
"hidpi/":"")+"icon"+(a.rtl?"-rtl":"")+".png");C(d,{attach:function(){this.wrap.getParent()||this.wrap.appendTo(a.editable,!0);return this},lineChildren:[C(G('\x3cspan title\x3d"'+a.editor.lang.magicline.title+'" contenteditable\x3d"false"\x3e\x26#8629;\x3c/span\x3e',c),{base:ba+"height:17px;width:17px;"+(a.rtl?"left":"right")+":17px;background:url("+e+") center no-repeat "+a.boxColor+";cursor:pointer;"+(M.hc?"font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;":"")+(M.hidpi?
|
|
971
|
-
"background-size: 9px 10px;":""),looks:["top:-8px; border-radius: 2px;","top:-17px; border-radius: 2px 2px 0px 0px;","top:-1px; border-radius: 0px 0px 2px 2px;"]}),C(G(
|
|
972
|
-
detach:function(){this.wrap.getParent()&&this.wrap.remove();return this},mouseNear:function(){
|
|
971
|
+
"background-size: 9px 10px;":""),looks:["top:-8px; border-radius: 2px;","top:-17px; border-radius: 2px 2px 0px 0px;","top:-1px; border-radius: 0px 0px 2px 2px;"]}),C(G(da,c),{base:U+"left:0px;border-left-color:"+a.boxColor+";",looks:["border-width:8px 0 8px 8px;top:-8px","border-width:8px 0 0 8px;top:-8px","border-width:0 0 8px 8px;top:0px"]}),C(G(da,c),{base:U+"right:0px;border-right-color:"+a.boxColor+";",looks:["border-width:8px 8px 8px 0;top:-8px","border-width:8px 8px 0 0;top:-8px","border-width:0 8px 8px 0;top:0px"]})],
|
|
972
|
+
detach:function(){this.wrap.getParent()&&this.wrap.remove();return this},mouseNear:function(){u(a,this);var b=a.holdDistance,c=this.size;return c&&m(a.mouse.y,c.top-b,c.bottom+b)&&m(a.mouse.x,c.left-b,c.right+b)?!0:!1},place:function(){var b=a.view,c=a.editable,d=a.trigger,e=d.upper,f=d.lower,g=e||f,h=g.getParent(),k={};this.trigger=d;e&&u(a,e,!0);f&&u(a,f,!0);u(a,h,!0);a.inInlineMode&&z(a,!0);h.equals(c)?(k.left=b.scroll.x,k.right=-b.scroll.x,k.width=""):(k.left=g.size.left-g.size.margin.left+b.scroll.x-
|
|
973
973
|
(a.inInlineMode?b.editable.left+b.editable.border.left:0),k.width=g.size.outerWidth+g.size.margin.left+g.size.margin.right+b.scroll.x,k.right="");e&&f?k.top=e.size.margin.bottom===f.size.margin.top?0|e.size.bottom+e.size.margin.bottom/2:e.size.margin.bottom<f.size.margin.top?e.size.bottom+e.size.margin.bottom:e.size.bottom+e.size.margin.bottom-f.size.margin.top:e?f||(k.top=e.size.bottom+e.size.margin.bottom):k.top=f.size.top-f.size.margin.top;d.is(O)||m(k.top,b.scroll.y-15,b.scroll.y+5)?(k.top=a.inInlineMode?
|
|
974
|
-
0:b.scroll.y,this.look(O)):d.is(
|
|
975
|
-
c;b--;)(c=this.lineChildren[b]).setAttribute("style",c.base+c.looks[0|a/2]);this.oldLook=a}},wrap:new
|
|
976
|
-
function(a){a.data.preventDefault(!0)});a.line=d}function b(a,b,c){var d=new CKEDITOR.dom.range(a.doc),e=a.editor,f;M.ie&&a.enterMode==CKEDITOR.ENTER_BR?f=a.doc.createText(S):(f=(f=
|
|
977
|
-
exec:function(){function d(e){var f=M.ie&&9>M.version?" ":S,g=a.hotNode&&a.hotNode.getText()==f&&a.element.equals(a.hotNode)&&a.lastCmdDirection===!!c;b(a,function(b){g&&a.hotNode&&a.hotNode.remove();b[c?"insertAfter":"insertBefore"](e);b.setAttributes({"data-cke-magicline-hot":1,"data-cke-magicline-dir":!!c});a.lastCmdDirection=!!c});M.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();a.line.detach()}return function(b){b=b.getSelection().getStartElement();var f;b=b.getAscendant(
|
|
978
|
-
if(!
|
|
979
|
-
a.$}function
|
|
980
|
-
!b.is(
|
|
981
|
-
0,b.size.top+f)?(a=a.inInlineMode||0===e.scroll.y?O:
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
h.bottom+f.top+f.bottom);k.width=k.outerWidth-(h.left+h.right+f.left+f.right);k.bottom=k.top+k.outerHeight;k.right=k.left+k.outerWidth;a.inInlineMode&&(k.scroll={top:b.$.scrollTop,left:b.$.scrollLeft});return C({border:f,padding:h,margin:g,ignoreScroll:c},k,!0)}function
|
|
985
|
-
b){a.view||(a.view={});var c=a.view;if(!(!b&&c&&c.date>new Date-aa)){var d=a.win,c=d.getScrollPosition(),d=d.getViewPaneSize();C(a.view,{scroll:{x:c.x,y:c.y,width:a.doc.$.documentElement.scrollWidth-d.width,height:a.doc.$.documentElement.scrollHeight-d.height},pane:{width:d.width,height:d.height,bottom:d.height+c.y},date:+new Date},!0)}}function
|
|
986
|
-
!k&&
|
|
987
|
-
B,
|
|
988
|
-
(m.line.detach(),a.once("getData",function(){m.line.attach()},null,null,1E3))},null,null,0),
|
|
989
|
-
0}),
|
|
990
|
-
m.line.attach().place():(m.trigger=null,m.line.detach()),
|
|
991
|
-
c(m,!0)),a.setKeystroke([[f.magicline_keystrokePrevious,"accessPreviousSpace"],[f.magicline_keystrokeNext,"accessNextSpace"]]),a.on("loadSnapshot",function(){var b,c,d,e;for(e in{p:1,br:1,div:1})for(b=a.document.getElementsByTag(e),d=b.count();d--;)if((c=b.getItem(d)).data("cke-magicline-hot")){m.hotNode=c;m.lastCmdDirection="true"===c.data("cke-magicline-dir")?!0:!1;return}}),a._.magiclineBackdoor={accessFocusSpace:b,boxTrigger:l,isLine:d,getAscendantTrigger:h,getNonEmptyNeighbour:e,getSize:
|
|
992
|
-
triggerEdge:
|
|
993
|
-
|
|
994
|
-
h.type!=CKEDITOR.NODE_ELEMENT||!h.$||M.ie&&9>M.version&&!b.boundary.equals(h)&&!b.boundary.contains(h)?null:h}}(),P=CKEDITOR.dom.walker.whitespaces(),Q=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),R=function(){function b(d){var e=d.element,g,h,k;if(!n(e)||e.contains(d.editable)||e.isReadOnly())return null;k=
|
|
995
|
-
else g=e.getFirst(function(a){return c(d,a)});if(h&&e.contains(h))for(;!h.getParent().equals(e);)h=h.getParent();else h=e.getLast(function(a){return c(d,a)});if(!g||!h)return null;
|
|
996
|
-
b){return!(b&&b.type==CKEDITOR.NODE_TEXT||Q(b)||
|
|
974
|
+
0:b.scroll.y,this.look(O)):d.is(I)||m(k.top,b.pane.bottom-5,b.pane.bottom+15)?(k.top=a.inInlineMode?b.editable.height+b.editable.padding.top+b.editable.padding.bottom:b.pane.bottom-1,this.look(I)):(a.inInlineMode&&(k.top-=b.editable.top+b.editable.border.top),this.look(X));a.inInlineMode&&(k.top--,k.top+=b.editable.scroll.top,k.left+=b.editable.scroll.left);for(var l in k)k[l]=CKEDITOR.tools.cssLength(k[l]);this.setStyles(k)},look:function(a){if(this.oldLook!=a){for(var b=this.lineChildren.length,
|
|
975
|
+
c;b--;)(c=this.lineChildren[b]).setAttribute("style",c.base+c.looks[0|a/2]);this.oldLook=a}},wrap:new B("span",a.doc)});for(c=d.lineChildren.length;c--;)d.lineChildren[c].appendTo(d);d.look(X);d.appendTo(d.wrap);d.unselectable();d.lineChildren[0].on("mouseup",function(c){d.detach();b(a,function(b){var c=a.line.trigger;b[c.is(H)?"insertBefore":"insertAfter"](c.is(H)?c.lower:c.upper)},!0);a.editor.focus();M.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();c.data.preventDefault(!0)});d.on("mousedown",
|
|
976
|
+
function(a){a.data.preventDefault(!0)});a.line=d}function b(a,b,c){var d=new CKEDITOR.dom.range(a.doc),e=a.editor,f;M.ie&&a.enterMode==CKEDITOR.ENTER_BR?f=a.doc.createText(S):(f=(f=k(a.element,!0))&&f.data("cke-enter-mode")||a.enterMode,f=new B(L[f],a.doc),f.is("br")||a.doc.createText(S).appendTo(f));c&&e.fire("saveSnapshot");b(f);d.moveToPosition(f,CKEDITOR.POSITION_AFTER_START);e.getSelection().selectRanges([d]);a.hotNode=f;c&&e.fire("saveSnapshot")}function c(a,c){return{canUndo:!0,modes:{wysiwyg:1},
|
|
977
|
+
exec:function(){function d(e){var f=M.ie&&9>M.version?" ":S,g=a.hotNode&&a.hotNode.getText()==f&&a.element.equals(a.hotNode)&&a.lastCmdDirection===!!c;b(a,function(b){g&&a.hotNode&&a.hotNode.remove();b[c?"insertAfter":"insertBefore"](e);b.setAttributes({"data-cke-magicline-hot":1,"data-cke-magicline-dir":!!c});a.lastCmdDirection=!!c});M.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();a.line.detach()}return function(b){b=b.getSelection().getStartElement();var f;b=b.getAscendant(ja,1);
|
|
978
|
+
if(!t(a,b)&&b&&!b.equals(a.editable)&&!b.contains(a.editable)){(f=k(b))&&"false"==f.getAttribute("contenteditable")&&(b=f);a.element=b;f=e(a,b,!c);var g;n(f)&&f.is(a.triggers)&&f.is(V)&&(!e(a,f,!c)||(g=e(a,f,!c))&&n(g)&&g.is(a.triggers))?d(f):(g=h(a,b),n(g)&&(e(a,g,!c)?(b=e(a,g,!c))&&n(b)&&b.is(a.triggers)&&d(g):d(g)))}}}()}}function d(a,b){if(!b||b.type!=CKEDITOR.NODE_ELEMENT||!b.$)return!1;var c=a.line;return c.wrap.equals(b)||c.wrap.contains(b)}function n(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&
|
|
979
|
+
a.$}function p(a){if(!n(a))return!1;var b;(b=q(a))||(n(a)?(b={left:1,right:1,center:1},b=!(!b[a.getComputedStyle("float")]&&!b[a.getAttribute("align")])):b=!1);return b}function q(a){return!!{absolute:1,fixed:1}[a.getComputedStyle("position")]}function y(a,b){return n(b)?b.is(a.triggers):null}function t(a,b){if(!b)return!1;for(var c=b.getParents(1),d=c.length;d--;)for(var e=a.tabuList.length;e--;)if(c[d].hasAttribute(a.tabuList[e]))return!0;return!1}function w(a,b,c){b=b[c?"getLast":"getFirst"](function(b){return a.isRelevant(b)&&
|
|
980
|
+
!b.is(ga)});if(!b)return!1;u(a,b);return c?b.size.top>a.mouse.y:b.size.bottom<a.mouse.y}function x(a){var b=a.editable,c=a.mouse,e=a.view,f=a.triggerOffset;z(a);var g=c.y>(a.inInlineMode?e.editable.top+e.editable.height/2:Math.min(e.editable.height,e.pane.height)/2),b=b[g?"getLast":"getFirst"](function(a){return!(P(a)||Q(a))});if(!b)return null;d(a,b)&&(b=a.line.wrap[g?"getPrevious":"getNext"](function(a){return!(P(a)||Q(a))}));if(!n(b)||p(b)||!y(a,b))return null;u(a,b);return!g&&0<=b.size.top&&m(c.y,
|
|
981
|
+
0,b.size.top+f)?(a=a.inInlineMode||0===e.scroll.y?O:X,new l([null,b,H,N,a])):g&&b.size.bottom<=e.pane.height&&m(c.y,b.size.bottom-f,e.pane.height)?(a=a.inInlineMode||m(b.size.bottom,e.pane.height-f,e.pane.height)?I:X,new l([b,null,K,N,a])):null}function r(a){var b=a.mouse,c=a.view,d=a.triggerOffset,f=h(a);if(!f)return null;u(a,f);var d=Math.min(d,0|f.size.outerHeight/2),g=[],k,v;if(m(b.y,f.size.top-1,f.size.top+d))v=!1;else if(m(b.y,f.size.bottom-d,f.size.bottom+1))v=!0;else return null;if(p(f)||
|
|
982
|
+
w(a,f,v)||f.getParent().is(Y))return null;var t=e(a,f,!v);if(t){if(t&&t.type==CKEDITOR.NODE_TEXT)return null;if(n(t)){if(p(t)||!y(a,t)||t.getParent().is(Y))return null;g=[t,f][v?"reverse":"concat"]().concat([F,N])}}else f.equals(a.editable[v?"getLast":"getFirst"](a.isRelevant))?(z(a),v&&m(b.y,f.size.bottom-d,c.pane.height)&&m(f.size.bottom,c.pane.height-d,c.pane.height)?k=I:m(b.y,0,f.size.top+d)&&(k=O)):k=X,g=[null,f][v?"reverse":"concat"]().concat([v?K:H,N,k,f.equals(a.editable[v?"getLast":"getFirst"](a.isRelevant))?
|
|
983
|
+
v?I:O:X]);return 0 in g?new l(g):null}function A(a,b,c,d){for(var e=b.getDocumentPosition(),f={},g={},h={},k={},l=T.length;l--;)f[T[l]]=parseInt(b.getComputedStyle.call(b,"border-"+T[l]+"-width"),10)||0,h[T[l]]=parseInt(b.getComputedStyle.call(b,"padding-"+T[l]),10)||0,g[T[l]]=parseInt(b.getComputedStyle.call(b,"margin-"+T[l]),10)||0;c&&!d||v(a,d);k.top=e.y-(c?0:a.view.scroll.y);k.left=e.x-(c?0:a.view.scroll.x);k.outerWidth=b.$.offsetWidth;k.outerHeight=b.$.offsetHeight;k.height=k.outerHeight-(h.top+
|
|
984
|
+
h.bottom+f.top+f.bottom);k.width=k.outerWidth-(h.left+h.right+f.left+f.right);k.bottom=k.top+k.outerHeight;k.right=k.left+k.outerWidth;a.inInlineMode&&(k.scroll={top:b.$.scrollTop,left:b.$.scrollLeft});return C({border:f,padding:h,margin:g,ignoreScroll:c},k,!0)}function u(a,b,c){if(!n(b))return b.size=null;if(!b.size)b.size={};else if(b.size.ignoreScroll==c&&b.size.date>new Date-aa)return null;return C(b.size,A(a,b,c),{date:+new Date},!0)}function z(a,b){a.view.editable=A(a,a.editable,b,!0)}function v(a,
|
|
985
|
+
b){a.view||(a.view={});var c=a.view;if(!(!b&&c&&c.date>new Date-aa)){var d=a.win,c=d.getScrollPosition(),d=d.getViewPaneSize();C(a.view,{scroll:{x:c.x,y:c.y,width:a.doc.$.documentElement.scrollWidth-d.width,height:a.doc.$.documentElement.scrollHeight-d.height},pane:{width:d.width,height:d.height,bottom:d.height+c.y},date:+new Date},!0)}}function D(a,b,c,d){for(var e=d,f=d,g=0,h=!1,k=!1,m=a.view.pane.height,v=a.mouse;v.y+g<m&&0<v.y-g;){h||(h=b(e,d));k||(k=b(f,d));!h&&0<v.y-g&&(e=c(a,{x:v.x,y:v.y-g}));
|
|
986
|
+
!k&&v.y+g<m&&(f=c(a,{x:v.x,y:v.y+g}));if(h&&k)break;g+=2}return new l([e,f,null,null])}CKEDITOR.plugins.add("magicline",{init:function(a){var f=a.config,k=f.magicline_triggerOffset||30,m={editor:a,enterMode:f.enterMode,triggerOffset:k,holdDistance:0|k*(f.magicline_holdDistance||.5),boxColor:f.magicline_color||"#ff0000",rtl:"rtl"==f.contentsLangDirection,tabuList:["data-cke-hidden-sel"].concat(f.magicline_tabuList||[]),triggers:f.magicline_everywhere?ja:{table:1,hr:1,div:1,ul:1,ol:1,dl:1,form:1,blockquote:1}},
|
|
987
|
+
w,B,u;m.isRelevant=function(a){return n(a)&&!d(m,a)&&!p(a)};a.on("contentDom",function(){var k=a.editable(),n=a.document,p=a.window;C(m,{editable:k,inInlineMode:k.isInline(),doc:n,win:p,hotNode:null},!0);m.boundary=m.inInlineMode?m.editable:m.doc.getDocumentElement();k.is(E.$inline)||(m.inInlineMode&&!q(k)&&k.setStyles({position:"relative",top:null,left:null}),g.call(this,m),v(m),k.attachListener(a,"beforeUndoImage",function(){m.line.detach()}),k.attachListener(a,"beforeGetData",function(){m.line.wrap.getParent()&&
|
|
988
|
+
(m.line.detach(),a.once("getData",function(){m.line.attach()},null,null,1E3))},null,null,0),k.attachListener(m.inInlineMode?n:n.getWindow().getFrame(),"mouseout",function(b){if("wysiwyg"==a.mode)if(m.inInlineMode){var c=b.data.$.clientX;b=b.data.$.clientY;v(m);z(m,!0);var d=m.view.editable,e=m.view.scroll;c>d.left-e.x&&c<d.right-e.x&&b>d.top-e.y&&b<d.bottom-e.y||(clearTimeout(u),u=null,m.line.detach())}else clearTimeout(u),u=null,m.line.detach()}),k.attachListener(k,"keyup",function(){m.hiddenMode=
|
|
989
|
+
0}),k.attachListener(k,"keydown",function(b){if("wysiwyg"==a.mode)switch(b.data.getKeystroke()){case 2228240:case 16:m.hiddenMode=1,m.line.detach()}}),k.attachListener(m.inInlineMode?k:n,"mousemove",function(b){B=!0;if("wysiwyg"==a.mode&&!a.readOnly&&!u){var c={x:b.data.$.clientX,y:b.data.$.clientY};u=setTimeout(function(){m.mouse=c;u=m.trigger=null;v(m);B&&!m.hiddenMode&&a.focusManager.hasFocus&&!m.line.mouseNear()&&(m.element=W(m,!0))&&((m.trigger=x(m)||r(m)||R(m))&&!t(m,m.trigger.upper||m.trigger.lower)?
|
|
990
|
+
m.line.attach().place():(m.trigger=null,m.line.detach()),B=!1)},30)}}),k.attachListener(p,"scroll",function(){"wysiwyg"==a.mode&&(m.line.detach(),M.webkit&&(m.hiddenMode=1,clearTimeout(w),w=setTimeout(function(){m.mouseDown||(m.hiddenMode=0)},50)))}),k.attachListener(J?n:p,"mousedown",function(){"wysiwyg"==a.mode&&(m.line.detach(),m.hiddenMode=1,m.mouseDown=1)}),k.attachListener(J?n:p,"mouseup",function(){m.hiddenMode=0;m.mouseDown=0}),a.addCommand("accessPreviousSpace",c(m)),a.addCommand("accessNextSpace",
|
|
991
|
+
c(m,!0)),a.setKeystroke([[f.magicline_keystrokePrevious,"accessPreviousSpace"],[f.magicline_keystrokeNext,"accessNextSpace"]]),a.on("loadSnapshot",function(){var b,c,d,e;for(e in{p:1,br:1,div:1})for(b=a.document.getElementsByTag(e),d=b.count();d--;)if((c=b.getItem(d)).data("cke-magicline-hot")){m.hotNode=c;m.lastCmdDirection="true"===c.data("cke-magicline-dir")?!0:!1;return}}),a._.magiclineBackdoor={accessFocusSpace:b,boxTrigger:l,isLine:d,getAscendantTrigger:h,getNonEmptyNeighbour:e,getSize:A,that:m,
|
|
992
|
+
triggerEdge:r,triggerEditable:x,triggerExpand:R})},this)}});var C=CKEDITOR.tools.extend,B=CKEDITOR.dom.element,G=B.createFromHtml,M=CKEDITOR.env,J=CKEDITOR.env.ie&&9>CKEDITOR.env.version,E=CKEDITOR.dtd,L={},H=128,K=64,F=32,N=16,O=4,I=2,X=1,S=" ",Y=E.$listItem,ga=E.$tableContent,V=C({},E.$nonEditable,E.$empty),ja=E.$block,aa=100,ba="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",U=ba+"border-color:transparent;display:block;border-style:solid;",
|
|
993
|
+
da="\x3cspan\x3e"+S+"\x3c/span\x3e";L[CKEDITOR.ENTER_BR]="br";L[CKEDITOR.ENTER_P]="p";L[CKEDITOR.ENTER_DIV]="div";l.prototype={set:function(a,b,c){this.properties=a+b+(c||X);return this},is:function(a){return(this.properties&a)==a}};var W=function(){function a(b,c){var d=b.$.elementFromPoint(c.x,c.y);return d&&d.nodeType?new CKEDITOR.dom.element(d):null}return function(b,c,e){if(!b.mouse)return null;var f=b.doc,g=b.line.wrap;e=e||b.mouse;var h=a(f,e);c&&d(b,h)&&(g.hide(),h=a(f,e),g.show());return!h||
|
|
994
|
+
h.type!=CKEDITOR.NODE_ELEMENT||!h.$||M.ie&&9>M.version&&!b.boundary.equals(h)&&!b.boundary.contains(h)?null:h}}(),P=CKEDITOR.dom.walker.whitespaces(),Q=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),R=function(){function b(d){var e=d.element,g,h,k;if(!n(e)||e.contains(d.editable)||e.isReadOnly())return null;k=D(d,function(a,b){return!b.equals(a)},function(a,b){return W(a,!0,b)},e);g=k.upper;h=k.lower;if(a(d,g,h))return k.set(F,8);if(g&&e.contains(g))for(;!g.getParent().equals(e);)g=g.getParent();
|
|
995
|
+
else g=e.getFirst(function(a){return c(d,a)});if(h&&e.contains(h))for(;!h.getParent().equals(e);)h=h.getParent();else h=e.getLast(function(a){return c(d,a)});if(!g||!h)return null;u(d,g);u(d,h);if(!m(d.mouse.y,g.size.top,h.size.bottom))return null;for(var e=Number.MAX_VALUE,l,v,t,z;h&&!h.equals(g)&&(v=g.getNext(d.isRelevant));)l=Math.abs(f(d,g,v)-d.mouse.y),l<e&&(e=l,t=g,z=v),g=v,u(d,g);if(!t||!z||!m(d.mouse.y,t.size.top,z.size.bottom))return null;k.upper=t;k.lower=z;return k.set(F,8)}function c(a,
|
|
996
|
+
b){return!(b&&b.type==CKEDITOR.NODE_TEXT||Q(b)||p(b)||d(a,b)||b.type==CKEDITOR.NODE_ELEMENT&&b.$&&b.is("br"))}return function(c){var d=b(c),e;if(e=d){e=d.upper;var f=d.lower;e=!e||!f||p(f)||p(e)||f.equals(e)||e.equals(f)||f.contains(e)||e.contains(f)?!1:y(c,e)&&y(c,f)&&a(c,e,f)?!0:!1}return e?d:null}}(),T=["top","left","right","bottom"]})();CKEDITOR.config.magicline_keystrokePrevious=CKEDITOR.CTRL+CKEDITOR.SHIFT+51;CKEDITOR.config.magicline_keystrokeNext=CKEDITOR.CTRL+CKEDITOR.SHIFT+52;(function(){function a(a,
|
|
997
997
|
e){return CKEDITOR.tools.array.filter(a,function(a){return a.canHandle(e)}).sort(function(a,c){return a.priority===c.priority?0:a.priority-c.priority})}function l(a,e){var b=a.shift();b&&b.handle(e,function(){l(a,e)})}function h(a){var e=CKEDITOR.tools.array.reduce(a,function(a,c){return CKEDITOR.tools.array.isArray(c.filters)?a.concat(c.filters):a},[]);return CKEDITOR.tools.array.filter(e,function(a,c){return CKEDITOR.tools.array.indexOf(e,a)===c})}function f(a,f){var b=0,c,d;if(!CKEDITOR.tools.array.isArray(a)||
|
|
998
|
-
0===a.length)return!0;c=CKEDITOR.tools.array.filter(a,function(a){return-1===CKEDITOR.tools.array.indexOf(e,a)});if(0<c.length)for(d=0;d<c.length;d++)(function(a){CKEDITOR.scriptLoader.queue(a,function(d){d&&e.push(a);++b===c.length&&f()})})(c[d]);return 0===c.length}var e=[],m=CKEDITOR.tools.createClass({$:function(){this.handlers=[]},proto:{register:function(a){"number"!==typeof a.priority&&(a.priority=10);this.handlers.push(a)},addPasteListener:function(e){e.on("paste",function(
|
|
999
|
-
|
|
1000
|
-
|
|
998
|
+
0===a.length)return!0;c=CKEDITOR.tools.array.filter(a,function(a){return-1===CKEDITOR.tools.array.indexOf(e,a)});if(0<c.length)for(d=0;d<c.length;d++)(function(a){CKEDITOR.scriptLoader.queue(a,function(d){d&&e.push(a);++b===c.length&&f()})})(c[d]);return 0===c.length}var e=[],m=CKEDITOR.tools.createClass({$:function(){this.handlers=[]},proto:{register:function(a){"number"!==typeof a.priority&&(a.priority=10);this.handlers.push(a)},addPasteListener:function(e){e.on("paste",function(g){var b=a(this.handlers,
|
|
999
|
+
g),c;if(0!==b.length){c=h(b);c=f(c,function(){return e.fire("paste",g.data)});if(!c)return g.cancel();l(b,g)}},this,null,3)}}});CKEDITOR.plugins.add("pastetools",{requires:"clipboard",beforeInit:function(a){a.pasteTools=new m;a.pasteTools.addPasteListener(a)}});CKEDITOR.plugins.pastetools={filters:{},loadFilters:f,createFilter:function(a){var e=CKEDITOR.tools.array.isArray(a.rules)?a.rules:[a.rules],b=a.additionalTransforms;return function(a,d){var f=new CKEDITOR.htmlParser.basicWriter,h=new CKEDITOR.htmlParser.filter,
|
|
1000
|
+
k;b&&(a=b(a,d));CKEDITOR.tools.array.forEach(e,function(b){h.addRules(b(a,d,h))});k=CKEDITOR.htmlParser.fragment.fromHtml(a);h.applyTo(k);k.writeHtml(f);return f.getHtml()}},getClipboardData:function(a,e){var b;return CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||"text/html"===e?(b=a.dataTransfer.getData(e,!0))||"text/html"!==e?b:a.dataValue:null},getConfigValue:function(a,e){if(a&&a.config){var b=CKEDITOR.tools,c=a.config,d=b.object.keys(c),f=["pasteTools_"+e,"pasteFromWord_"+e,"pasteFromWord"+
|
|
1001
1001
|
b.capitalize(e,!0)],f=b.array.find(f,function(a){return-1!==b.array.indexOf(d,a)});return c[f]}},getContentGeneratorName:function(a){if((a=/<meta\s+name=["']?generator["']?\s+content=["']?(\w+)/gi.exec(a))&&a.length)return a=a[1].toLowerCase(),0===a.indexOf("microsoft")?"microsoft":0===a.indexOf("libreoffice")?"libreoffice":"unknown"}};CKEDITOR.pasteFilters={}})();(function(){CKEDITOR.plugins.add("pastefromlibreoffice",{requires:"pastetools",isSupportedEnvironment:function(){var a=CKEDITOR.env.ie&&
|
|
1002
1002
|
11>=CKEDITOR.env.version;return!(CKEDITOR.env.webkit&&!CKEDITOR.env.chrome)&&!a},init:function(a){if(this.isSupportedEnvironment()){var l=CKEDITOR.plugins.getPath("pastetools"),h=this.path;a.pasteTools.register({priority:100,filters:[CKEDITOR.getUrl(l+"filter/common.js"),CKEDITOR.getUrl(l+"filter/image.js"),CKEDITOR.getUrl(h+"filter/default.js")],canHandle:function(a){a=a.data;return(a=a.dataTransfer.getData("text/html",!0)||a.dataValue)?"libreoffice"===CKEDITOR.plugins.pastetools.getContentGeneratorName(a):
|
|
1003
|
-
!1},handle:function(f,e){var h=f.data,
|
|
1003
|
+
!1},handle:function(f,e){var h=f.data,k=h.dataValue||CKEDITOR.plugins.pastetools.getClipboardData(h,"text/html");h.dontFilter=!0;k=CKEDITOR.pasteFilters.image(k,a,CKEDITOR.plugins.pastetools.getClipboardData(h,"text/rtf"));h.dataValue=CKEDITOR.pasteFilters.libreoffice(k,a);!0===a.config.forcePasteAsPlainText&&(h.type="text");e()}})}}})})();(function(){CKEDITOR.plugins.add("pastefromword",{requires:"pastetools",init:function(a){function l(a){var e=CKEDITOR.plugins.pastefromword&&CKEDITOR.plugins.pastefromword.images,
|
|
1004
1004
|
b,c=[];if(e&&a.editor.filter.check("img[src]")&&(b=e.extractTagsFromHtml(a.data.dataValue),0!==b.length&&(e=e.extractFromRtf(a.data.dataTransfer["text/rtf"]),0!==e.length&&(CKEDITOR.tools.array.forEach(e,function(a){c.push(a.type?"data:"+a.type+";base64,"+CKEDITOR.tools.convertBytesToBase64(CKEDITOR.tools.convertHexStringToBytes(a.hex)):null)},this),b.length===c.length))))for(e=0;e<b.length;e++)0===b[e].indexOf("file://")&&c[e]&&(a.data.dataValue=a.data.dataValue.replace(b[e],c[e]))}var h=0,f=CKEDITOR.plugins.getPath("pastetools"),
|
|
1005
1005
|
e=this.path,m=void 0===a.config.pasteFromWord_inlineImages?!0:a.config.pasteFromWord_inlineImages,f=[CKEDITOR.getUrl(f+"filter/common.js"),CKEDITOR.getUrl(e+"filter/default.js")];a.addCommand("pastefromword",{canUndo:!1,async:!0,exec:function(a,e){h=1;a.execCommand("paste",{type:"html",notification:e&&"undefined"!==typeof e.notification?e.notification:!0})}});CKEDITOR.plugins.clipboard.addPasteButton(a,"PasteFromWord",{label:a.lang.pastefromword.toolbar,command:"pastefromword",toolbar:"clipboard,50"});
|
|
1006
1006
|
a.pasteTools.register({filters:a.config.pasteFromWordCleanupFile?[a.config.pasteFromWordCleanupFile]:f,canHandle:function(a){a=CKEDITOR.plugins.pastetools.getClipboardData(a.data,"text/html");var e=CKEDITOR.plugins.pastetools.getContentGeneratorName(a),b=/(class="?Mso|style=["'][^"]*?\bmso\-|w:WordDocument|<o:\w+>|<\/font>)/,e=e?"microsoft"===e:b.test(a);return a&&(h||e)},handle:function(e,f){var b=e.data,c=CKEDITOR.plugins.pastetools.getClipboardData(b,"text/html"),d=CKEDITOR.plugins.pastetools.getClipboardData(b,
|
|
@@ -1008,17 +1008,17 @@ a.pasteTools.register({filters:a.config.pasteFromWordCleanupFile?[a.config.paste
|
|
|
1008
1008
|
m)a.on("afterPasteFromWord",l)}})})();(function(){var a={canUndo:!1,async:!0,exec:function(a,h){var f=a.lang,e=CKEDITOR.tools.keystrokeToString(f.common.keyboard,a.getCommandKeystroke(CKEDITOR.env.ie?a.commands.paste:this)),m=h&&"undefined"!==typeof h.notification?h.notification:!h||!h.from||"keystrokeHandler"===h.from&&CKEDITOR.env.ie,f=m&&"string"===typeof m?m:f.pastetext.pasteNotification.replace(/%1/,'\x3ckbd aria-label\x3d"'+e.aria+'"\x3e'+e.display+"\x3c/kbd\x3e");a.execCommand("paste",{type:"text",
|
|
1009
1009
|
notification:m?f:!1})}};CKEDITOR.plugins.add("pastetext",{requires:"clipboard",init:function(l){var h=CKEDITOR.env.safari?CKEDITOR.CTRL+CKEDITOR.ALT+CKEDITOR.SHIFT+86:CKEDITOR.CTRL+CKEDITOR.SHIFT+86;l.addCommand("pastetext",a);l.setKeystroke(h,"pastetext");CKEDITOR.plugins.clipboard.addPasteButton(l,"PasteText",{label:l.lang.pastetext.button,command:"pastetext",toolbar:"clipboard,40"});if(l.config.forcePasteAsPlainText)l.on("beforePaste",function(a){"html"!=a.data.type&&(a.data.type="text")});l.on("pasteState",
|
|
1010
1010
|
function(a){l.getCommand("pastetext").setState(a.data)})}})})();CKEDITOR.plugins.add("removeformat",{init:function(a){a.addCommand("removeFormat",CKEDITOR.plugins.removeformat.commands.removeformat);a.ui.addButton&&a.ui.addButton("RemoveFormat",{label:a.lang.removeformat.toolbar,command:"removeFormat",toolbar:"cleanup,10"})}});CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(a){for(var l=a._.removeFormatRegex||(a._.removeFormatRegex=new RegExp("^(?:"+a.config.removeFormatTags.replace(/,/g,
|
|
1011
|
-
"|")+")$","i")),h=a._.removeAttributes||(a._.removeAttributes=a.config.removeFormatAttributes.split(",")),f=CKEDITOR.plugins.removeformat.filter,e=a.getSelection().getRanges().createIterator(),m=function(a){return a.type==CKEDITOR.NODE_ELEMENT},
|
|
1012
|
-
a.elementPath(b),d=c.elements,e=1,g;(g=d[e])&&!g.equals(c.block)&&!g.equals(c.blockLimit);e++)l.test(g.getName())&&f(a,g)&&b.breakParent(g)};
|
|
1013
|
-
a.fire("removeFormatCleanup",d))),d=
|
|
1014
|
-
CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign";CKEDITOR.plugins.add("resize",{init:function(a){function l(e){var
|
|
1015
|
-
h);a.document&&(a.document.removeListener("mousemove",l),a.document.removeListener("mouseup",h))}var f=a.config,e=a.ui.spaceId("resizer"),m=a.element?a.element.getDirection(1):"ltr";!f.resize_dir&&(f.resize_dir="vertical");void 0===f.resize_maxWidth&&(f.resize_maxWidth=3E3);void 0===f.resize_maxHeight&&(f.resize_maxHeight=3E3);void 0===f.resize_minWidth&&(f.resize_minWidth=750);void 0===f.resize_minHeight&&(f.resize_minHeight=250);if(!1!==f.resize_enabled){var
|
|
1016
|
-
"horizontal"==f.resize_dir)&&f.resize_minWidth!=f.resize_maxWidth,d=("both"==f.resize_dir||"vertical"==f.resize_dir)&&f.resize_minHeight!=f.resize_maxHeight,n=CKEDITOR.tools.addFunction(function(c){
|
|
1011
|
+
"|")+")$","i")),h=a._.removeAttributes||(a._.removeAttributes=a.config.removeFormatAttributes.split(",")),f=CKEDITOR.plugins.removeformat.filter,e=a.getSelection().getRanges().createIterator(),m=function(a){return a.type==CKEDITOR.NODE_ELEMENT},k=[],g;g=e.getNextRange();){var b=g.createBookmark();g=a.createRange();g.setStartBefore(b.startNode);b.endNode&&g.setEndAfter(b.endNode);g.collapsed||g.enlarge(CKEDITOR.ENLARGE_ELEMENT);var c=g.createBookmark(),d=c.startNode,n=c.endNode,p=function(b){for(var c=
|
|
1012
|
+
a.elementPath(b),d=c.elements,e=1,g;(g=d[e])&&!g.equals(c.block)&&!g.equals(c.blockLimit);e++)l.test(g.getName())&&f(a,g)&&b.breakParent(g)};p(d);if(n)for(p(n),d=d.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);d&&!d.equals(n);)if(d.isReadOnly()){if(d.getPosition(n)&CKEDITOR.POSITION_CONTAINS)break;d=d.getNext(m)}else p=d.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),"img"==d.getName()&&d.data("cke-realelement")||d.hasAttribute("data-cke-bookmark")||!f(a,d)||(l.test(d.getName())?d.remove(1):(d.removeAttributes(h),
|
|
1013
|
+
a.fire("removeFormatCleanup",d))),d=p;c.startNode.remove();c.endNode&&c.endNode.remove();g.moveToBookmark(b);k.push(g)}a.forceNextSelectionCheck();a.getSelection().selectRanges(k)}}},filter:function(a,l){for(var h=a._.removeFormatFilters||[],f=0;f<h.length;f++)if(!1===h[f](l))return!1;return!0}};CKEDITOR.editor.prototype.addRemoveFormatFilter=function(a){this._.removeFormatFilters||(this._.removeFormatFilters=[]);this._.removeFormatFilters.push(a)};CKEDITOR.config.removeFormatTags="b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var";
|
|
1014
|
+
CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign";CKEDITOR.plugins.add("resize",{init:function(a){function l(e){var h=b.width,k=b.height,l=h+(e.data.$.screenX-g.x)*("rtl"==m?-1:1);e=k+(e.data.$.screenY-g.y);c&&(h=Math.max(f.resize_minWidth,Math.min(l,f.resize_maxWidth)));d&&(k=Math.max(f.resize_minHeight,Math.min(e,f.resize_maxHeight)));a.resize(c?h:null,k)}function h(){CKEDITOR.document.removeListener("mousemove",l);CKEDITOR.document.removeListener("mouseup",
|
|
1015
|
+
h);a.document&&(a.document.removeListener("mousemove",l),a.document.removeListener("mouseup",h))}var f=a.config,e=a.ui.spaceId("resizer"),m=a.element?a.element.getDirection(1):"ltr";!f.resize_dir&&(f.resize_dir="vertical");void 0===f.resize_maxWidth&&(f.resize_maxWidth=3E3);void 0===f.resize_maxHeight&&(f.resize_maxHeight=3E3);void 0===f.resize_minWidth&&(f.resize_minWidth=750);void 0===f.resize_minHeight&&(f.resize_minHeight=250);if(!1!==f.resize_enabled){var k=null,g,b,c=("both"==f.resize_dir||
|
|
1016
|
+
"horizontal"==f.resize_dir)&&f.resize_minWidth!=f.resize_maxWidth,d=("both"==f.resize_dir||"vertical"==f.resize_dir)&&f.resize_minHeight!=f.resize_maxHeight,n=CKEDITOR.tools.addFunction(function(c){k||(k=a.getResizable());b={width:k.$.offsetWidth||0,height:k.$.offsetHeight||0};g={x:c.screenX,y:c.screenY};f.resize_minWidth>b.width&&(f.resize_minWidth=b.width);f.resize_minHeight>b.height&&(f.resize_minHeight=b.height);CKEDITOR.document.on("mousemove",l);CKEDITOR.document.on("mouseup",h);a.document&&
|
|
1017
1017
|
(a.document.on("mousemove",l),a.document.on("mouseup",h));c.preventDefault&&c.preventDefault()});a.on("destroy",function(){CKEDITOR.tools.removeFunction(n)});a.on("uiSpace",function(b){if("bottom"==b.data.space){var f="";c&&!d&&(f=" cke_resizer_horizontal");!c&&d&&(f=" cke_resizer_vertical");var g='\x3cspan id\x3d"'+e+'" class\x3d"cke_resizer'+f+" cke_resizer_"+m+'" title\x3d"'+CKEDITOR.tools.htmlEncode(a.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+n+', event)"\x3e'+("ltr"==
|
|
1018
1018
|
m?"◢":"◣")+"\x3c/span\x3e";"ltr"==m&&"ltr"==f?b.data.html+=g:b.data.html=g+b.data.html}},a,null,100);a.on("maximize",function(b){a.ui.space("resizer")[b.data==CKEDITOR.TRISTATE_ON?"hide":"show"]()})}}});(function(){CKEDITOR.plugins.add("selectall",{init:function(a){a.addCommand("selectAll",{modes:{wysiwyg:1,source:1},exec:function(a){var h=a.editable();if(h.is("textarea"))a=h.$,CKEDITOR.env.ie&&a.createTextRange?a.createTextRange().execCommand("SelectAll"):(a.selectionStart=0,a.selectionEnd=a.value.length),
|
|
1019
|
-
a.focus();else{if(h.is("body"))a.document.$.execCommand("SelectAll",!1,null);else{var f=a.createRange();f.selectNodeContents(h);f.select()}a.forceNextSelectionCheck();a.selectionChange()}},canUndo:!1});a.ui.addButton&&a.ui.addButton("SelectAll",{label:a.lang.selectall.toolbar,command:"selectAll",toolbar:"selection,10"})}})})();(function(){function a(a,f,e){var m,
|
|
1020
|
-
function(a){a.data.space==f&&a.cancel()},null,null,1),
|
|
1021
|
-
CKEDITOR.NODE_ELEMENT&&!b.equals(
|
|
1019
|
+
a.focus();else{if(h.is("body"))a.document.$.execCommand("SelectAll",!1,null);else{var f=a.createRange();f.selectNodeContents(h);f.select()}a.forceNextSelectionCheck();a.selectionChange()}},canUndo:!1});a.ui.addButton&&a.ui.addButton("SelectAll",{label:a.lang.selectall.toolbar,command:"selectAll",toolbar:"selection,10"})}})})();(function(){function a(a,f,e){var m,k;if(e="string"==typeof e?CKEDITOR.document.getById(e):new CKEDITOR.dom.element(e))if(m=a.fire("uiSpace",{space:f,html:""}).html)a.on("uiSpace",
|
|
1020
|
+
function(a){a.data.space==f&&a.cancel()},null,null,1),k=e.append(CKEDITOR.dom.element.createFromHtml(l.output({id:a.id,name:a.name,langDir:a.lang.dir,langCode:a.langCode,space:f,spaceId:a.ui.spaceId(f),content:m}))),e.getCustomData("cke_hasshared")?k.hide():e.setCustomData("cke_hasshared",1),k.unselectable(),k.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()}),a.focusManager.add(k,1),a.on("focus",function(){for(var a=0,b,c=e.getChildren();b=c.getItem(a);a++)b.type==
|
|
1021
|
+
CKEDITOR.NODE_ELEMENT&&!b.equals(k)&&b.hasClass("cke_shared")&&b.hide();k.show()}),a.on("destroy",function(){k.remove()})}var l=CKEDITOR.addTemplate("sharedcontainer",'\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_shared cke_detached cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" title\x3d"'+(CKEDITOR.env.gecko?" ":"")+'" lang\x3d"{langCode}" role\x3d"presentation"\x3e\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{spaceId}" class\x3d"cke_{space}" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e');
|
|
1022
1022
|
CKEDITOR.plugins.add("sharedspace",{init:function(h){h.on("loaded",function(){var f=h.config.sharedSpaces;if(f)for(var e in f)a(h,e,f[e])},null,null,9)}})})();(function(){CKEDITOR.plugins.add("sourcearea",{init:function(l){function h(){var a=e&&this.equals(CKEDITOR.document.getActive());this.hide();this.setStyle("height",this.getParent().$.clientHeight+"px");this.setStyle("width",this.getParent().$.clientWidth+"px");this.show();a&&this.focus()}if(l.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var f=
|
|
1023
1023
|
CKEDITOR.plugins.sourcearea;l.addMode("source",function(e){var f=l.ui.space("contents").getDocument().createElement("textarea");f.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",l.config.sourceAreaTabSize||4)));f.setAttribute("dir","ltr");f.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu");l.ui.space("contents").append(f);f=l.editable(new a(l,
|
|
1024
1024
|
f));f.setData(l.getData(1));CKEDITOR.env.ie&&(f.attachListener(l,"resize",h,f),f.attachListener(CKEDITOR.document.getWindow(),"resize",h,f),CKEDITOR.tools.setTimeout(h,0,f));l.fire("ariaWidget",this);e()});l.addCommand("source",f.commands.source);l.ui.addButton&&l.ui.addButton("Source",{label:l.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"});l.on("mode",function(){l.getCommand("source").setState("source"==l.mode?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});var e=CKEDITOR.env.ie&&9==
|
|
@@ -1027,150 +1027,155 @@ CKEDITOR.env.version}}});var a=CKEDITOR.tools.createClass({base:CKEDITOR.editabl
|
|
|
1027
1027
|
{label:a.lang.sourcedialog.toolbar,command:"sourcedialog",toolbar:"mode,10"})}});CKEDITOR.plugins.add("specialchar",{availableLangs:{af:1,ar:1,az:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,en:1,"en-au":1,"en-ca":1,"en-gb":1,eo:1,es:1,"es-mx":1,et:1,eu:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,he:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,nb:1,nl:1,no:1,oc:1,pl:1,pt:1,"pt-br":1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,"sr-latn":1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},requires:"dialog",init:function(a){var l=
|
|
1028
1028
|
this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js");a.addCommand("specialchar",{exec:function(){var h=a.langCode,h=l.availableLangs[h]?h:l.availableLangs[h.replace(/-.*/,"")]?h.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(l.path+"dialogs/lang/"+h+".js"),function(){CKEDITOR.tools.extend(a.lang.specialchar,l.langEntries[h]);a.openDialog("specialchar")})},modes:{wysiwyg:1},canUndo:!1});a.ui.addButton&&a.ui.addButton("SpecialChar",{label:a.lang.specialchar.toolbar,
|
|
1029
1029
|
command:"specialchar",toolbar:"insert,50"})}});CKEDITOR.config.specialChars="! \x26quot; # $ % \x26amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; \x26lt; \x3d \x26gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x26euro; \x26lsquo; \x26rsquo; \x26ldquo; \x26rdquo; \x26ndash; \x26mdash; \x26iexcl; \x26cent; \x26pound; \x26curren; \x26yen; \x26brvbar; \x26sect; \x26uml; \x26copy; \x26ordf; \x26laquo; \x26not; \x26reg; \x26macr; \x26deg; \x26sup2; \x26sup3; \x26acute; \x26micro; \x26para; \x26middot; \x26cedil; \x26sup1; \x26ordm; \x26raquo; \x26frac14; \x26frac12; \x26frac34; \x26iquest; \x26Agrave; \x26Aacute; \x26Acirc; \x26Atilde; \x26Auml; \x26Aring; \x26AElig; \x26Ccedil; \x26Egrave; \x26Eacute; \x26Ecirc; \x26Euml; \x26Igrave; \x26Iacute; \x26Icirc; \x26Iuml; \x26ETH; \x26Ntilde; \x26Ograve; \x26Oacute; \x26Ocirc; \x26Otilde; \x26Ouml; \x26times; \x26Oslash; \x26Ugrave; \x26Uacute; \x26Ucirc; \x26Uuml; \x26Yacute; \x26THORN; \x26szlig; \x26agrave; \x26aacute; \x26acirc; \x26atilde; \x26auml; \x26aring; \x26aelig; \x26ccedil; \x26egrave; \x26eacute; \x26ecirc; \x26euml; \x26igrave; \x26iacute; \x26icirc; \x26iuml; \x26eth; \x26ntilde; \x26ograve; \x26oacute; \x26ocirc; \x26otilde; \x26ouml; \x26divide; \x26oslash; \x26ugrave; \x26uacute; \x26ucirc; \x26uuml; \x26yacute; \x26thorn; \x26yuml; \x26OElig; \x26oelig; \x26#372; \x26#374 \x26#373 \x26#375; \x26sbquo; \x26#8219; \x26bdquo; \x26hellip; \x26trade; \x26#9658; \x26bull; \x26rarr; \x26rArr; \x26hArr; \x26diams; \x26asymp;".split(" ");
|
|
1030
|
-
(function(){CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(a){var l=a.config,h=a.lang.stylescombo,f={},e=[],m=[];a.on("stylesSet",function(
|
|
1031
|
-
d+1E3*(c==CKEDITOR.STYLE_OBJECT?1:c==CKEDITOR.STYLE_BLOCK?2:3),f[b]=
|
|
1032
|
-
b=c),this.add(f,a.type==CKEDITOR.STYLE_OBJECT?f:a.buildPreview(),f);this.commit()},onClick:function(e){a.focus();a.fire("saveSnapshot");e=f[e];var
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
th:1},1)){var
|
|
1036
|
-
new CKEDITOR.dom.element(c.insertRow(-1),f.document),d=0,l=b.length;d<l;d++)c.append((new CKEDITOR.dom.element(b[d],f.document)).clone(!1,!1)).appendBogus();
|
|
1037
|
-
|
|
1038
|
-
void 0===l?this.getTabIndex():l,f,e,m,g,
|
|
1039
|
-
|
|
1040
|
-
(m=b,g
|
|
1030
|
+
(function(){CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(a){var l=a.config,h=a.lang.stylescombo,f={},e=[],m=[];a.on("stylesSet",function(h){if(h=h.data.styles){for(var g,b,c,d=0,n=h.length;d<n;d++)(g=h[d],a.blockless&&g.element in CKEDITOR.dtd.$block||"string"==typeof g.type&&!CKEDITOR.style.customHandlers[g.type]||(b=g.name,g=new CKEDITOR.style(g),a.filter.customConfig&&!a.filter.check(g)))||(g._name=b,g._.enterMode=l.enterMode,g._.type=c=g.assignedTo||g.type,g._.weight=
|
|
1031
|
+
d+1E3*(c==CKEDITOR.STYLE_OBJECT?1:c==CKEDITOR.STYLE_BLOCK?2:3),f[b]=g,e.push(g),m.push(g));e.sort(function(a,b){return a._.weight-b._.weight})}});a.ui.addRichCombo("Styles",{label:h.label,title:h.panelTitle,toolbar:"styles,10",allowedContent:m,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(l.contentsCss),multiSelect:!0,attributes:{"aria-label":h.panelTitle}},init:function(){var a,f,b,c,d,l;d=0;for(l=e.length;d<l;d++)a=e[d],f=a._name,c=a._.type,c!=b&&(this.startGroup(h["panelTitle"+String(c)]),
|
|
1032
|
+
b=c),this.add(f,a.type==CKEDITOR.STYLE_OBJECT?f:a.buildPreview(),f);this.commit()},onClick:function(e){a.focus();a.fire("saveSnapshot");e=f[e];var g=a.elementPath();if(e.group&&e.removeStylesFromSameGroup(a))a.applyStyle(e);else a[e.checkActive(g,a)?"removeStyle":"applyStyle"](e);a.fire("saveSnapshot")},onRender:function(){a.on("selectionChange",function(e){var g=this.getValue();e=e.data.path.elements;for(var b=0,c=e.length,d;b<c;b++){d=e[b];for(var h in f)if(f[h].checkElementRemovable(d,!0,a)){h!=
|
|
1033
|
+
g&&this.setValue(h);return}}this.setValue("")},this)},onOpen:function(){var e=a.getSelection(),e=e.getSelectedElement()||e.getStartElement()||a.editable(),e=a.elementPath(e),g=[0,0,0,0];this.showAll();this.unmarkAll();for(var b in f){var c=f[b],d=c._.type;c.checkApplicable(e,a,a.activeFilter)?g[d]++:this.hideItem(b);c.checkActive(e,a)&&this.mark(b)}g[CKEDITOR.STYLE_BLOCK]||this.hideGroup(h["panelTitle"+String(CKEDITOR.STYLE_BLOCK)]);g[CKEDITOR.STYLE_INLINE]||this.hideGroup(h["panelTitle"+String(CKEDITOR.STYLE_INLINE)]);
|
|
1034
|
+
g[CKEDITOR.STYLE_OBJECT]||this.hideGroup(h["panelTitle"+String(CKEDITOR.STYLE_OBJECT)])},refresh:function(){var e=a.elementPath();if(e){for(var g in f)if(f[g].checkApplicable(e,a,a.activeFilter))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}},reset:function(){f={};e=[]}})}})})();(function(){function a(a){return{editorFocus:!1,canUndo:!1,modes:{wysiwyg:1},exec:function(f){if(f.editable().hasFocus){var h=f.getSelection(),g;if(g=(new CKEDITOR.dom.elementPath(h.getCommonAncestor(),h.root)).contains({td:1,
|
|
1035
|
+
th:1},1)){var h=f.createRange(),b=CKEDITOR.tools.tryThese(function(){var b=g.getParent().$.cells[g.$.cellIndex+(a?-1:1)];b.parentNode.parentNode;return b},function(){var b=g.getParent(),b=b.getAscendant("table").$.rows[b.$.rowIndex+(a?-1:1)];return b.cells[a?b.cells.length-1:0]});if(b||a)if(b)b=new CKEDITOR.dom.element(b),h.moveToElementEditStart(b),h.checkStartOfBlock()&&h.checkEndOfBlock()||h.selectNodeContents(b);else return!0;else{for(var c=g.getAscendant("table").$,b=g.getParent().$.cells,c=
|
|
1036
|
+
new CKEDITOR.dom.element(c.insertRow(-1),f.document),d=0,l=b.length;d<l;d++)c.append((new CKEDITOR.dom.element(b[d],f.document)).clone(!1,!1)).appendBogus();h.moveToElementEditStart(c)}h.select(!0);return!0}}return!1}}}var l={editorFocus:!1,modes:{wysiwyg:1,source:1}},h={exec:function(a){a.container.focusNext(!0,a.tabIndex)}},f={exec:function(a){a.container.focusPrevious(!0,a.tabIndex)}};CKEDITOR.plugins.add("tab",{init:function(e){for(var m=!1!==e.config.enableTabKeyTools,k=e.config.tabSpaces||0,
|
|
1037
|
+
g="";k--;)g+=" ";if(g)e.on("key",function(a){9==a.data.keyCode&&(e.insertText(g),a.cancel())});if(m)e.on("key",function(a){(9==a.data.keyCode&&e.execCommand("selectNextCell")||a.data.keyCode==CKEDITOR.SHIFT+9&&e.execCommand("selectPreviousCell"))&&a.cancel()});e.addCommand("blur",CKEDITOR.tools.extend(h,l));e.addCommand("blurBack",CKEDITOR.tools.extend(f,l));e.addCommand("selectNextCell",a());e.addCommand("selectPreviousCell",a(!0))}})})();CKEDITOR.dom.element.prototype.focusNext=function(a,l){var h=
|
|
1038
|
+
void 0===l?this.getTabIndex():l,f,e,m,k,g,b;if(0>=h)for(g=this.getNextSourceNode(a,CKEDITOR.NODE_ELEMENT);g;){if(g.isVisible()&&0===g.getTabIndex()){m=g;break}g=g.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT)}else for(g=this.getDocument().getBody().getFirst();g=g.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!f)if(!e&&g.equals(this)){if(e=!0,a){if(!(g=g.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;f=1}}else e&&!this.contains(g)&&(f=1);if(g.isVisible()&&!(0>(b=g.getTabIndex()))){if(f&&b==h){m=
|
|
1039
|
+
g;break}b>h&&(!m||!k||b<k)?(m=g,k=b):m||0!==b||(m=g,k=b)}}m&&m.focus()};CKEDITOR.dom.element.prototype.focusPrevious=function(a,l){for(var h=void 0===l?this.getTabIndex():l,f,e,m,k=0,g,b=this.getDocument().getBody().getLast();b=b.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!f)if(!e&&b.equals(this)){if(e=!0,a){if(!(b=b.getPreviousSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;f=1}}else e&&!this.contains(b)&&(f=1);if(b.isVisible()&&!(0>(g=b.getTabIndex())))if(0>=h){if(f&&0===g){m=b;break}g>k&&
|
|
1040
|
+
(m=b,k=g)}else{if(f&&g==h){m=b;break}g<h&&(!m||g>k)&&(m=b,k=g)}}m&&m.focus()};CKEDITOR.plugins.add("table",{requires:"dialog",init:function(a){function l(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,f){this.setState(f.contains("table",1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}if(!a.blockless){var h=a.lang.table;a.addCommand("table",new CKEDITOR.dialogCommand("table",{context:"table",allowedContent:"table{width,height,border-collapse}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];td{border*,background-color,vertical-align,width,height}[colspan,rowspan];"+
|
|
1041
1041
|
(a.plugins.dialogadvtab?"table"+a.plugins.dialogadvtab.allowedContent():""),requiredContent:"table",contentTransformations:[["table{width}: sizeToStyle","table[width]: sizeToAttribute"],["td: splitBorderShorthand"],[{element:"table",right:function(a){if(a.styles){var e;if(a.styles.border)e=CKEDITOR.tools.style.parse.border(a.styles.border);else if(CKEDITOR.env.ie&&8===CKEDITOR.env.version){var h=a.styles;h["border-left"]&&h["border-left"]===h["border-right"]&&h["border-right"]===h["border-top"]&&
|
|
1042
|
-
h["border-top"]===h["border-bottom"]&&(e=CKEDITOR.tools.style.parse.border(h["border-top"]))}e&&e.style&&"solid"===e.style&&e.width&&0!==parseFloat(e.width)&&(a.attributes.border=1);"collapse"==a.styles["border-collapse"]&&(a.attributes.cellspacing=0)}}}]]}));a.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",l()));a.addCommand("tableDelete",l({exec:function(a){var e=a.elementPath().contains("table",1);if(e){var h=e.getParent(),
|
|
1043
|
-
"th")||h.equals(
|
|
1042
|
+
h["border-top"]===h["border-bottom"]&&(e=CKEDITOR.tools.style.parse.border(h["border-top"]))}e&&e.style&&"solid"===e.style&&e.width&&0!==parseFloat(e.width)&&(a.attributes.border=1);"collapse"==a.styles["border-collapse"]&&(a.attributes.cellspacing=0)}}}]]}));a.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",l()));a.addCommand("tableDelete",l({exec:function(a){var e=a.elementPath().contains("table",1);if(e){var h=e.getParent(),k=a.editable();1!=h.getChildCount()||h.is("td",
|
|
1043
|
+
"th")||h.equals(k)||(e=h);a=a.createRange();a.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);e.remove();a.select()}}}));a.ui.addButton&&a.ui.addButton("Table",{label:h.toolbar,command:"table",toolbar:"insert,30"});CKEDITOR.dialog.add("table",this.path+"dialogs/table.js");CKEDITOR.dialog.add("tableProperties",this.path+"dialogs/table.js");a.addMenuItems&&a.addMenuItems({table:{label:h.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:h.deleteTable,command:"tableDelete",group:"table",
|
|
1044
1044
|
order:1}});a.on("doubleclick",function(a){a.data.element.is("table")&&(a.data.dialog="tableProperties")});a.contextMenu&&a.contextMenu.addListener(function(){return{tabledelete:CKEDITOR.TRISTATE_OFF,table:CKEDITOR.TRISTATE_OFF}})}}});(function(){function a(a,b){function c(a){return b?b.contains(a)&&a.getAscendant("table",!0).equals(b):!0}function d(a){var b=/^(?:td|th)$/;0<e.length||a.type!=CKEDITOR.NODE_ELEMENT||!b.test(a.getName())||a.getCustomData("selected_cell")||(CKEDITOR.dom.element.setMarker(f,
|
|
1045
1045
|
a,"selected_cell",!0),e.push(a))}var e=[],f={};if(!a)return e;for(var g=a.getRanges(),h=0;h<g.length;h++){var k=g[h];if(k.collapsed)(k=k.getCommonAncestor().getAscendant({td:1,th:1},!0))&&c(k)&&e.push(k);else{var k=new CKEDITOR.dom.walker(k),l;for(k.guard=d;l=k.next();)l.type==CKEDITOR.NODE_ELEMENT&&l.is(CKEDITOR.dtd.table)||(l=l.getAscendant({td:1,th:1},!0))&&!l.getCustomData("selected_cell")&&c(l)&&(CKEDITOR.dom.element.setMarker(f,l,"selected_cell",!0),e.push(l))}}CKEDITOR.dom.element.clearAllMarkers(f);
|
|
1046
1046
|
return e}function l(b,c){for(var d=y(b)?b:a(b),e=d[0],f=e.getAscendant("table"),e=e.getDocument(),g=d[0].getParent(),h=g.$.rowIndex,d=d[d.length-1],k=d.getParent().$.rowIndex+d.$.rowSpan-1,d=new CKEDITOR.dom.element(f.$.rows[k]),h=c?h:k,g=c?g:d,d=CKEDITOR.tools.buildTableMap(f),f=d[h],h=c?d[h-1]:d[h+1],d=d[0].length,e=e.createElement("tr"),k=0;f[k]&&k<d;k++){var l;1<f[k].rowSpan&&h&&f[k]==h[k]?(l=f[k],l.rowSpan+=1):(l=(new CKEDITOR.dom.element(f[k])).clone(),l.removeAttribute("rowSpan"),l.appendBogus(),
|
|
1047
|
-
e.append(l),l=l.$);k+=l.colSpan-1}c?e.insertBefore(g):e.insertAfter(g);return e}function h(b){if(b instanceof CKEDITOR.dom.selection){var c=b.getRanges(),d=a(b),e=d[0].getAscendant("table"),f=CKEDITOR.tools.buildTableMap(e),g=d[0].getParent().$.rowIndex,d=d[d.length-1],k=d.getParent().$.rowIndex+d.$.rowSpan-1,d=[];b.reset();for(b=g;b<=k;b++){for(var l=f[b],m=new CKEDITOR.dom.element(e.$.rows[b]),n=0;n<l.length;n++){var
|
|
1048
|
-
(--
|
|
1047
|
+
e.append(l),l=l.$);k+=l.colSpan-1}c?e.insertBefore(g):e.insertAfter(g);return e}function h(b){if(b instanceof CKEDITOR.dom.selection){var c=b.getRanges(),d=a(b),e=d[0].getAscendant("table"),f=CKEDITOR.tools.buildTableMap(e),g=d[0].getParent().$.rowIndex,d=d[d.length-1],k=d.getParent().$.rowIndex+d.$.rowSpan-1,d=[];b.reset();for(b=g;b<=k;b++){for(var l=f[b],m=new CKEDITOR.dom.element(e.$.rows[b]),n=0;n<l.length;n++){var B=new CKEDITOR.dom.element(l[n]),p=B.getParent().$.rowIndex;1==B.$.rowSpan?B.remove():
|
|
1048
|
+
(--B.$.rowSpan,p==b&&(p=f[b+1],p[n-1]?B.insertAfter(new CKEDITOR.dom.element(p[n-1])):(new CKEDITOR.dom.element(e.$.rows[b+1])).append(B,1)));n+=B.$.colSpan-1}d.push(m)}f=e.$.rows;c[0].moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);g=new CKEDITOR.dom.element(f[k+1]||(0<g?f[g-1]:null)||e.$.parentNode);for(b=d.length;0<=b;b--)h(d[b]);return e.$.parentNode?g:(c[0].select(),null)}b instanceof CKEDITOR.dom.element&&(e=b.getAscendant("table"),1==e.$.rows.length?e.remove():b.remove());return null}function f(a){for(var b=
|
|
1049
1049
|
a.getParent().$.cells,c=0,d=0;d<b.length;d++){var e=b[d],c=c+e.colSpan;if(e==a.$)break}return c-1}function e(a,b){for(var c=b?Infinity:0,d=0;d<a.length;d++){var e=f(a[d]);if(b?e<c:e>c)c=e}return c}function m(b,c){for(var d=y(b)?b:a(b),f=d[0].getAscendant("table"),g=e(d,1),d=e(d),h=c?g:d,k=CKEDITOR.tools.buildTableMap(f),f=[],g=[],d=[],l=k.length,m=0;m<l;m++){var n=c?k[m][h-1]:k[m][h+1];f.push(k[m][h]);g.push(n)}for(m=0;m<l;m++)f[m]&&(1<f[m].colSpan&&g[m]==f[m]?(k=f[m],k.colSpan+=1):(h=new CKEDITOR.dom.element(f[m]),
|
|
1050
|
-
k=h.clone(),k.removeAttribute("colSpan"),k.appendBogus(),k[c?"insertBefore":"insertAfter"].call(k,h),d.push(k),k=k.$),m+=k.rowSpan-1);return d}function
|
|
1051
|
-
b.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);return b.select()}CKEDITOR.env.webkit&&!b.isFake&&(b=c(b));var d=b.getRanges(),e=a(b),f=e[0],g=e[e.length-1],e=f.getAscendant("table"),h=CKEDITOR.tools.buildTableMap(e),k,l,m=[];b.reset();var n=0;for(b=h.length;n<b;n++)for(var
|
|
1052
|
-
|
|
1050
|
+
k=h.clone(),k.removeAttribute("colSpan"),k.appendBogus(),k[c?"insertBefore":"insertAfter"].call(k,h),d.push(k),k=k.$),m+=k.rowSpan-1);return d}function k(b){function c(a){var b=a.getRanges(),d,e;if(1!==b.length)return a;b=b[0];if(b.collapsed||0!==b.endOffset)return a;d=b.endContainer;e=d.getName().toLowerCase();if("td"!==e&&"th"!==e)return a;for((e=d.getPrevious())||(e=d.getParent().getPrevious().getLast());e.type!==CKEDITOR.NODE_TEXT&&"br"!==e.getName().toLowerCase();)if(e=e.getLast(),!e)return a;
|
|
1051
|
+
b.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);return b.select()}CKEDITOR.env.webkit&&!b.isFake&&(b=c(b));var d=b.getRanges(),e=a(b),f=e[0],g=e[e.length-1],e=f.getAscendant("table"),h=CKEDITOR.tools.buildTableMap(e),k,l,m=[];b.reset();var n=0;for(b=h.length;n<b;n++)for(var p=0,q=h[n].length;p<q;p++)void 0===k&&h[n][p]==f.$&&(k=p),h[n][p]==g.$&&(l=p);for(n=k;n<=l;n++)for(p=0;p<h.length;p++)g=h[p],f=new CKEDITOR.dom.element(e.$.rows[p]),g=new CKEDITOR.dom.element(g[n]),g.$&&(1==g.$.colSpan?g.remove():--g.$.colSpan,
|
|
1052
|
+
p+=g.$.rowSpan-1,f.$.cells.length||m.push(f));k=h[0].length-1>l?new CKEDITOR.dom.element(h[0][l+1]):k&&-1!==h[0][k-1].cellIndex?new CKEDITOR.dom.element(h[0][k-1]):new CKEDITOR.dom.element(e.$.parentNode);m.length==b&&(d[0].moveToPosition(e,CKEDITOR.POSITION_AFTER_END),d[0].select(),e.remove());return k}function g(a,b){var c=a.getStartElement().getAscendant({td:1,th:1},!0);if(c){var d=c.clone();d.appendBogus();b?d.insertBefore(c):d.insertAfter(c)}}function b(d){if(d instanceof CKEDITOR.dom.selection){var e=
|
|
1053
1053
|
d.getRanges(),f=a(d),g=f[0]&&f[0].getAscendant("table"),h;a:{var k=0;h=f.length-1;for(var l={},m,n;m=f[k++];)CKEDITOR.dom.element.setMarker(l,m,"delete_cell",!0);for(k=0;m=f[k++];)if((n=m.getPrevious())&&!n.getCustomData("delete_cell")||(n=m.getNext())&&!n.getCustomData("delete_cell")){CKEDITOR.dom.element.clearAllMarkers(l);h=n;break a}CKEDITOR.dom.element.clearAllMarkers(l);k=f[0].getParent();(k=k.getPrevious())?h=k.getLast():(k=f[h].getParent(),h=(k=k.getNext())?k.getChild(0):null)}d.reset();for(d=
|
|
1054
1054
|
f.length-1;0<=d;d--)b(f[d]);h?c(h,!0):g&&(e[0].moveToPosition(g,CKEDITOR.POSITION_BEFORE_START),e[0].select(),g.remove())}else d instanceof CKEDITOR.dom.element&&(e=d.getParent(),1==e.getChildCount()?e.remove():d.remove())}function c(a,b){var c=a.getDocument(),d=CKEDITOR.document;CKEDITOR.env.ie&&10==CKEDITOR.env.version&&(d.focus(),c.focus());c=new CKEDITOR.dom.range(c);c["moveToElementEdit"+(b?"End":"Start")](a)||(c.selectNodeContents(a),c.collapse(b?!1:!0));c.select(!0)}function d(a,b,c){a=a[b];
|
|
1055
|
-
if("undefined"==typeof c)return a;for(b=0;a&&b<a.length;b++){if(c.is&&a[b]==c.$)return b;if(b==c)return new CKEDITOR.dom.element(a[b])}return c.is?-1:null}function n(b,c,e){var f=a(b),g;if((c?1!=f.length:2>f.length)||(g=b.getCommonAncestor())&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("table"))return!1;b=f[0];g=b.getAscendant("table");var h=CKEDITOR.tools.buildTableMap(g),k=h.length,l=h[0].length,m=b.getParent().$.rowIndex,n=d(h,m,b),
|
|
1056
|
-
10)||1;
|
|
1057
|
-
E||!F||F.isBlockBoundary&&F.isBlockBoundary({br:1})||(E=L.getLast(CKEDITOR.dom.walker.whitespaces(!0)),!E||E.is&&E.is("br")||L.append("br")),
|
|
1058
|
-
e.length)return!1;if(c)return!0;var e=e[0],f=e.getParent(),g=f.getAscendant("table"),h=CKEDITOR.tools.buildTableMap(g),k=f.$.rowIndex,l=d(h,k,e),m=e.$.rowSpan,n;if(1<m){n=Math.ceil(m/2);for(var m=Math.floor(m/2),f=k+n,g=new CKEDITOR.dom.element(g.$.rows[f]),h=d(h,f),
|
|
1059
|
-
f.appendBogus();e.$.rowSpan=n;f.$.rowSpan=m;1==n&&e.removeAttribute("rowSpan");1==m&&f.removeAttribute("rowSpan");return f}function
|
|
1060
|
-
g.insertAfter(e);g.appendBogus();e.$.colSpan=f;g.$.colSpan=k;1==f&&e.removeAttribute("colSpan");1==k&&g.removeAttribute("colSpan");return g}var y=CKEDITOR.tools.isArray;CKEDITOR.plugins.tabletools={requires:"table,dialog,contextmenu",init:function(d){function e(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,b){this.setState(b.contains({td:1,th:1},1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}function f(a,b){var c=d.addCommand(a,b);d.addFeature(c)}var
|
|
1061
|
-
y=CKEDITOR.tools.style.parse,
|
|
1055
|
+
if("undefined"==typeof c)return a;for(b=0;a&&b<a.length;b++){if(c.is&&a[b]==c.$)return b;if(b==c)return new CKEDITOR.dom.element(a[b])}return c.is?-1:null}function n(b,c,e){var f=a(b),g;if((c?1!=f.length:2>f.length)||(g=b.getCommonAncestor())&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("table"))return!1;b=f[0];g=b.getAscendant("table");var h=CKEDITOR.tools.buildTableMap(g),k=h.length,l=h[0].length,m=b.getParent().$.rowIndex,n=d(h,m,b),p;if(c){var q;try{var y=parseInt(b.getAttribute("rowspan"),10)||1;p=parseInt(b.getAttribute("colspan"),
|
|
1056
|
+
10)||1;q=h["up"==c?m-y:"down"==c?m+y:m]["left"==c?n-p:"right"==c?n+p:n]}catch(J){return!1}if(!q||b.$==q)return!1;f["up"==c||"left"==c?"unshift":"push"](new CKEDITOR.dom.element(q))}c=b.getDocument();var E=m,y=q=0,L=!e&&new CKEDITOR.dom.documentFragment(c),H=0;for(c=0;c<f.length;c++){p=f[c];var K=p.getParent(),F=p.getFirst(),N=p.$.colSpan,O=p.$.rowSpan,K=K.$.rowIndex,I=d(h,K,p),H=H+N*O,y=Math.max(y,I-n+N);q=Math.max(q,K-m+O);e||(N=p,(O=N.getBogus())&&O.remove(),N.trim(),p.getChildren().count()&&(K==
|
|
1057
|
+
E||!F||F.isBlockBoundary&&F.isBlockBoundary({br:1})||(E=L.getLast(CKEDITOR.dom.walker.whitespaces(!0)),!E||E.is&&E.is("br")||L.append("br")),p.moveChildren(L)),c?p.remove():p.setHtml(""));E=K}if(e)return q*y==H;L.moveChildren(b);b.appendBogus();y>=l?b.removeAttribute("rowSpan"):b.$.rowSpan=q;q>=k?b.removeAttribute("colSpan"):b.$.colSpan=y;e=new CKEDITOR.dom.nodeList(g.$.rows);f=e.count();for(c=f-1;0<=c;c--)g=e.getItem(c),g.$.cells.length||(g.remove(),f++);return b}function p(b,c){var e=a(b);if(1<
|
|
1058
|
+
e.length)return!1;if(c)return!0;var e=e[0],f=e.getParent(),g=f.getAscendant("table"),h=CKEDITOR.tools.buildTableMap(g),k=f.$.rowIndex,l=d(h,k,e),m=e.$.rowSpan,n;if(1<m){n=Math.ceil(m/2);for(var m=Math.floor(m/2),f=k+n,g=new CKEDITOR.dom.element(g.$.rows[f]),h=d(h,f),p,f=e.clone(),k=0;k<h.length;k++)if(p=h[k],p.parentNode==g.$&&k>l){f.insertBefore(new CKEDITOR.dom.element(p));break}else p=null;p||g.append(f)}else for(m=n=1,g=f.clone(),g.insertAfter(f),g.append(f=e.clone()),p=d(h,k),l=0;l<p.length;l++)p[l].rowSpan++;
|
|
1059
|
+
f.appendBogus();e.$.rowSpan=n;f.$.rowSpan=m;1==n&&e.removeAttribute("rowSpan");1==m&&f.removeAttribute("rowSpan");return f}function q(b,c){var e=a(b);if(1<e.length)return!1;if(c)return!0;var e=e[0],f=e.getParent(),g=f.getAscendant("table"),g=CKEDITOR.tools.buildTableMap(g),h=d(g,f.$.rowIndex,e),k=e.$.colSpan;if(1<k)f=Math.ceil(k/2),k=Math.floor(k/2);else{for(var k=f=1,l=[],m=0;m<g.length;m++){var n=g[m];l.push(n[h]);1<n[h].rowSpan&&(m+=n[h].rowSpan-1)}for(g=0;g<l.length;g++)l[g].colSpan++}g=e.clone();
|
|
1060
|
+
g.insertAfter(e);g.appendBogus();e.$.colSpan=f;g.$.colSpan=k;1==f&&e.removeAttribute("colSpan");1==k&&g.removeAttribute("colSpan");return g}var y=CKEDITOR.tools.isArray;CKEDITOR.plugins.tabletools={requires:"table,dialog,contextmenu",init:function(d){function e(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,b){this.setState(b.contains({td:1,th:1},1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}function f(a,b){var c=d.addCommand(a,b);d.addFeature(c)}var r=d.lang.table,
|
|
1061
|
+
y=CKEDITOR.tools.style.parse,u="td{width} td{height} td{border-color} td{background-color} td{white-space} td{vertical-align} td{text-align} td[colspan] td[rowspan] th".split(" ");f("cellProperties",new CKEDITOR.dialogCommand("cellProperties",e({allowedContent:"td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",requiredContent:u,contentTransformations:[[{element:"td",left:function(a){return a.styles.background&&y.background(a.styles.background).color},
|
|
1062
1062
|
right:function(a){a.styles["background-color"]=y.background(a.styles.background).color}},{element:"td",check:"td{vertical-align}",left:function(a){return a.attributes&&a.attributes.valign},right:function(a){a.styles["vertical-align"]=a.attributes.valign;delete a.attributes.valign}}],[{element:"tr",check:"td{height}",left:function(a){return a.styles&&a.styles.height},right:function(a){CKEDITOR.tools.array.forEach(a.children,function(b){b.name in{td:1,th:1}&&(b.attributes["cke-row-height"]=a.styles.height)});
|
|
1063
1063
|
delete a.styles.height}}],[{element:"td",check:"td{height}",left:function(a){return(a=a.attributes)&&a["cke-row-height"]},right:function(a){a.styles.height=a.attributes["cke-row-height"];delete a.attributes["cke-row-height"]}}]]})));CKEDITOR.dialog.add("cellProperties",this.path+"dialogs/tableCell.js");f("rowDelete",e({requiredContent:"table",exec:function(a){a=a.getSelection();(a=h(a))&&c(a)}}));f("rowInsertBefore",e({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);l(b,!0)}}));
|
|
1064
|
-
f("rowInsertAfter",e({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);l(b)}}));f("columnDelete",e({requiredContent:"table",exec:function(a){a=a.getSelection();(a=
|
|
1064
|
+
f("rowInsertAfter",e({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);l(b)}}));f("columnDelete",e({requiredContent:"table",exec:function(a){a=a.getSelection();(a=k(a))&&c(a,!0)}}));f("columnInsertBefore",e({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);m(b,!0)}}));f("columnInsertAfter",e({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);m(b)}}));f("cellDelete",e({requiredContent:"table",exec:function(a){a=a.getSelection();b(a)}}));f("cellMerge",
|
|
1065
1065
|
e({allowedContent:"td[colspan,rowspan]",requiredContent:"td[colspan,rowspan]",exec:function(a,b){b.cell=n(a.getSelection());c(b.cell,!0)}}));f("cellMergeRight",e({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a,b){b.cell=n(a.getSelection(),"right");c(b.cell,!0)}}));f("cellMergeDown",e({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(a,b){b.cell=n(a.getSelection(),"down");c(b.cell,!0)}}));f("cellVerticalSplit",e({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",
|
|
1066
|
-
exec:function(a){c(
|
|
1067
|
-
{tablecell_insertBefore:CKEDITOR.TRISTATE_OFF,tablecell_insertAfter:CKEDITOR.TRISTATE_OFF,tablecell_delete:CKEDITOR.TRISTATE_OFF,tablecell_merge:n(b,null,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_right:n(b,"right",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_down:n(b,"down",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_vertical:
|
|
1068
|
-
CKEDITOR.TRISTATE_DISABLED};d.filter.check(
|
|
1069
|
-
order:16},tablecell_merge_right:{label:
|
|
1070
|
-
order:21},tablerow:{label:
|
|
1071
|
-
tablecolumn:{label:
|
|
1066
|
+
exec:function(a){c(q(a.getSelection()))}}));f("cellHorizontalSplit",e({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a){c(p(a.getSelection()))}}));f("cellInsertBefore",e({requiredContent:"table",exec:function(a){a=a.getSelection();g(a,!0)}}));f("cellInsertAfter",e({requiredContent:"table",exec:function(a){a=a.getSelection();g(a)}}));d.addMenuItems&&d.addMenuItems({tablecell:{label:r.cell.menu,group:"tablecell",order:1,getItems:function(){var b=d.getSelection(),c=a(b),b=
|
|
1067
|
+
{tablecell_insertBefore:CKEDITOR.TRISTATE_OFF,tablecell_insertAfter:CKEDITOR.TRISTATE_OFF,tablecell_delete:CKEDITOR.TRISTATE_OFF,tablecell_merge:n(b,null,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_right:n(b,"right",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_down:n(b,"down",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_vertical:q(b,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_horizontal:p(b,!0)?CKEDITOR.TRISTATE_OFF:
|
|
1068
|
+
CKEDITOR.TRISTATE_DISABLED};d.filter.check(u)&&(b.tablecell_properties=0<c.length?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);return b}},tablecell_insertBefore:{label:r.cell.insertBefore,group:"tablecell",command:"cellInsertBefore",order:5},tablecell_insertAfter:{label:r.cell.insertAfter,group:"tablecell",command:"cellInsertAfter",order:10},tablecell_delete:{label:r.cell.deleteCell,group:"tablecell",command:"cellDelete",order:15},tablecell_merge:{label:r.cell.merge,group:"tablecell",command:"cellMerge",
|
|
1069
|
+
order:16},tablecell_merge_right:{label:r.cell.mergeRight,group:"tablecell",command:"cellMergeRight",order:17},tablecell_merge_down:{label:r.cell.mergeDown,group:"tablecell",command:"cellMergeDown",order:18},tablecell_split_horizontal:{label:r.cell.splitHorizontal,group:"tablecell",command:"cellHorizontalSplit",order:19},tablecell_split_vertical:{label:r.cell.splitVertical,group:"tablecell",command:"cellVerticalSplit",order:20},tablecell_properties:{label:r.cell.title,group:"tablecellproperties",command:"cellProperties",
|
|
1070
|
+
order:21},tablerow:{label:r.row.menu,group:"tablerow",order:1,getItems:function(){return{tablerow_insertBefore:CKEDITOR.TRISTATE_OFF,tablerow_insertAfter:CKEDITOR.TRISTATE_OFF,tablerow_delete:CKEDITOR.TRISTATE_OFF}}},tablerow_insertBefore:{label:r.row.insertBefore,group:"tablerow",command:"rowInsertBefore",order:5},tablerow_insertAfter:{label:r.row.insertAfter,group:"tablerow",command:"rowInsertAfter",order:10},tablerow_delete:{label:r.row.deleteRow,group:"tablerow",command:"rowDelete",order:15},
|
|
1071
|
+
tablecolumn:{label:r.column.menu,group:"tablecolumn",order:1,getItems:function(){return{tablecolumn_insertBefore:CKEDITOR.TRISTATE_OFF,tablecolumn_insertAfter:CKEDITOR.TRISTATE_OFF,tablecolumn_delete:CKEDITOR.TRISTATE_OFF}}},tablecolumn_insertBefore:{label:r.column.insertBefore,group:"tablecolumn",command:"columnInsertBefore",order:5},tablecolumn_insertAfter:{label:r.column.insertAfter,group:"tablecolumn",command:"columnInsertAfter",order:10},tablecolumn_delete:{label:r.column.deleteColumn,group:"tablecolumn",
|
|
1072
1072
|
command:"columnDelete",order:15}});d.contextMenu&&d.contextMenu.addListener(function(a,b,c){return(a=c.contains({td:1,th:1},1))&&!a.isReadOnly()?{tablecell:CKEDITOR.TRISTATE_OFF,tablerow:CKEDITOR.TRISTATE_OFF,tablecolumn:CKEDITOR.TRISTATE_OFF}:null})},getCellColIndex:f,insertRow:l,insertColumn:m,getSelectedCells:a};CKEDITOR.plugins.add("tabletools",CKEDITOR.plugins.tabletools)})();CKEDITOR.tools.buildTableMap=function(a,l,h,f,e){a=a.$.rows;h=h||0;f="number"===typeof f?f:a.length-1;e="number"===typeof e?
|
|
1073
|
-
e:-1;var m=-1,
|
|
1073
|
+
e:-1;var m=-1,k=[];for(l=l||0;l<=f;l++){m++;!k[m]&&(k[m]=[]);for(var g=-1,b=h;b<=(-1===e?a[l].cells.length-1:e);b++){var c=a[l].cells[b];if(!c)break;for(g++;k[m][g];)g++;for(var d=isNaN(c.colSpan)?1:c.colSpan,c=isNaN(c.rowSpan)?1:c.rowSpan,n=0;n<c&&!(l+n>f);n++){k[m+n]||(k[m+n]=[]);for(var p=0;p<d;p++)k[m+n][g+p]=a[l].cells[b]}g+=d-1;if(-1!==e&&g>=e)break}}return k};(function(){function a(a){return CKEDITOR.plugins.widget&&CKEDITOR.plugins.widget.isDomWidget(a)}function l(a,c){var d=a.getAscendant("table"),
|
|
1074
1074
|
e=c.getAscendant("table"),f=CKEDITOR.tools.buildTableMap(d),g=b(a),h=b(c),k=[],l={},m,n;d.contains(e)&&(c=c.getAscendant({td:1,th:1}),h=b(c));g>h&&(d=g,g=h,h=d,d=a,a=c,c=d);for(d=0;d<f[g].length;d++)if(a.$===f[g][d]){m=d;break}for(d=0;d<f[h].length;d++)if(c.$===f[h][d]){n=d;break}m>n&&(d=m,m=n,n=d);for(d=g;d<=h;d++)for(g=m;g<=n;g++)e=new CKEDITOR.dom.element(f[d][g]),e.$&&!e.getCustomData("selected_cell")&&(k.push(e),CKEDITOR.dom.element.setMarker(l,e,"selected_cell",!0));CKEDITOR.dom.element.clearAllMarkers(l);
|
|
1075
|
-
return k}function h(a){return(a=a.editable().findOne(".cke_table-faked-selection"))&&a.getAscendant("table")}function f(a,b){var c=a.editable().find(".cke_table-faked-selection"),d=a.editable().findOne("[data-cke-table-faked-selection-table]"),e;a.fire("lockSnapshot");a.editable().removeClass("cke_table-faked-selection-editor");for(e=0;e<c.count();e++)c.getItem(e).removeClass("cke_table-faked-selection");d&&d.data("cke-table-faked-selection-table",!1);a.fire("unlockSnapshot");b&&(
|
|
1076
|
-
a.getSelection().reset())}function e(a,b){var c=[],d,e;for(e=0;e<b.length;e++)d=a.createRange(),d.setStartBefore(b[e]),d.setEndAfter(b[e]),c.push(d);a.getSelection().selectRanges(c)}function m(a){var b=a.editable().find(".cke_table-faked-selection");1>b.count()||(b=l(b.getItem(0),b.getItem(b.count()-1)),e(a,b))}function
|
|
1077
|
-
c||g[0],
|
|
1078
|
-
c.length&&c[0]._getTableElement()&&c[0]._getTableElement().is("table")&&(e=c[0]._getTableElement());e=
|
|
1079
|
-
a.getCommonAncestor(b).is(u):!1}function e(a){return!a.getAscendant("table",!0)&&a.getDocument().equals(l.document)}function
|
|
1080
|
-
b.editor||b.listenerData.editor,n=l.getSelection(1),p=h(l),
|
|
1081
|
-
CKEDITOR.MOUSE_BUTTON_LEFT&&(e(b.data.getTarget())||d(p,
|
|
1082
|
-
k=CKEDITOR.env.ie&&9>CKEDITOR.env.version,l=a.blockless||CKEDITOR.env.ie?"span":"div",m,n,p,
|
|
1083
|
-
null,null,0),k&&(p=h.scrollTop),g.selectNodeContents(m),g.select(),k&&(h.scrollTop=p),setTimeout(function(){n.remove();d.selectBookmarks(e);
|
|
1084
|
-
b,c){a.on("beforeCommandExec",function(c){-1!==CKEDITOR.tools.array.indexOf(b,c.data.name)&&(c.data.selectedCells=
|
|
1085
|
-
a[0];this.cells.last=a[a.length-1];this.rows.first=a[0].getAscendant("tr");this.rows.last=this.cells.last.getAscendant("tr")};
|
|
1086
|
-
|
|
1087
|
-
a)return;for(var d=this.cells,e=d.all,f=b(d.first),g=b(d.last),d=0;d<a;d++)e=e.concat(CKEDITOR.tools.array.filter(
|
|
1088
|
-
CKEDITOR.tools.array.map(a,function(a){return a.length},0))}var d=a.editor,f=d.getSelection(),g=
|
|
1089
|
-
b=void 0,b=!b;return b?!1:!0})(f,g,k,h)&&(g=g[0].getAscendant("table"),m=new
|
|
1075
|
+
return k}function h(a){return(a=a.editable().findOne(".cke_table-faked-selection"))&&a.getAscendant("table")}function f(a,b){var c=a.editable().find(".cke_table-faked-selection"),d=a.editable().findOne("[data-cke-table-faked-selection-table]"),e;a.fire("lockSnapshot");a.editable().removeClass("cke_table-faked-selection-editor");for(e=0;e<c.count();e++)c.getItem(e).removeClass("cke_table-faked-selection");d&&d.data("cke-table-faked-selection-table",!1);a.fire("unlockSnapshot");b&&(t={active:!1},a.getSelection().isInTable()&&
|
|
1076
|
+
a.getSelection().reset())}function e(a,b){var c=[],d,e;for(e=0;e<b.length;e++)d=a.createRange(),d.setStartBefore(b[e]),d.setEndAfter(b[e]),c.push(d);a.getSelection().selectRanges(c)}function m(a){var b=a.editable().find(".cke_table-faked-selection");1>b.count()||(b=l(b.getItem(0),b.getItem(b.count()-1)),e(a,b))}function k(b,c,d){var g=x(b.getSelection(!0));c=c.is("table")?null:c;var h;(h=t.active&&!t.first)&&!(h=c)&&(h=b.getSelection().getRanges(),h=1<g.length||h[0]&&!h[0].collapsed?!0:!1);if(h)t.first=
|
|
1077
|
+
c||g[0],t.dirty=c?!1:1!==g.length;else if(t.active&&c&&t.first.getAscendant("table").equals(c.getAscendant("table"))){g=l(t.first,c);if(!t.dirty&&1===g.length&&!a(d.data.getTarget()))return f(b,"mouseup"===d.name);t.dirty=!0;t.last=c;e(b,g)}}function g(a){var b=(a=a.editor||a.sender.editor)&&a.getSelection(),c=b&&b.getRanges()||[],d=c&&c[0].getEnclosedNode(),d=d&&d.type==CKEDITOR.NODE_ELEMENT&&d.is("img"),e;if(b&&(f(a),b.isInTable()&&b.isFake))if(d)a.getSelection().reset();else if(!c[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored")){1===
|
|
1078
|
+
c.length&&c[0]._getTableElement()&&c[0]._getTableElement().is("table")&&(e=c[0]._getTableElement());e=x(b,e);a.fire("lockSnapshot");for(b=0;b<e.length;b++)e[b].addClass("cke_table-faked-selection");0<e.length&&(a.editable().addClass("cke_table-faked-selection-editor"),e[0].getAscendant("table").data("cke-table-faked-selection-table",""));a.fire("unlockSnapshot")}}function b(a){return a.getAscendant("tr",!0).$.rowIndex}function c(b){function d(a,b){return a&&b?a.equals(b)||a.contains(b)||b.contains(a)||
|
|
1079
|
+
a.getCommonAncestor(b).is(u):!1}function e(a){return!a.getAscendant("table",!0)&&a.getDocument().equals(l.document)}function g(a,b,c,d){if("mousedown"===a.name&&(CKEDITOR.tools.getMouseButton(a)===CKEDITOR.MOUSE_BUTTON_LEFT||!d))return!0;if(b=a.name===(CKEDITOR.env.gecko?"mousedown":"mouseup")&&!e(a.data.getTarget()))a=a.data.getTarget().getAscendant({td:1,th:1},!0),b=!(a&&a.hasClass("cke_table-faked-selection"));return b}if(b.data.getTarget().getName&&("mouseup"===b.name||!a(b.data.getTarget()))){var l=
|
|
1080
|
+
b.editor||b.listenerData.editor,n=l.getSelection(1),p=h(l),q=b.data.getTarget(),r=q&&q.getAscendant({td:1,th:1},!0),q=q&&q.getAscendant("table",!0),u={table:1,thead:1,tbody:1,tfoot:1,tr:1,td:1,th:1};q&&q.hasAttribute("data-cke-tableselection-ignored")||(g(b,n,p,q)&&f(l,!0),!t.active&&"mousedown"===b.name&&CKEDITOR.tools.getMouseButton(b)===CKEDITOR.MOUSE_BUTTON_LEFT&&q&&(t={active:!0},CKEDITOR.document.on("mouseup",c,null,{editor:l})),(r||q)&&k(l,r||q,b),"mouseup"===b.name&&(CKEDITOR.tools.getMouseButton(b)===
|
|
1081
|
+
CKEDITOR.MOUSE_BUTTON_LEFT&&(e(b.data.getTarget())||d(p,q))&&m(l),t={active:!1},CKEDITOR.document.removeListener("mouseup",c)))}}function d(a){var b=a.data.getTarget().getAscendant("table",!0);b&&b.hasAttribute("data-cke-tableselection-ignored")||(b=a.data.getTarget().getAscendant({td:1,th:1},!0))&&!b.hasClass("cke_table-faked-selection")&&(a.cancel(),a.data.preventDefault())}function n(a,b){function c(a){a.cancel()}var d=a.getSelection(),e=d.createBookmarks(),f=a.document,g=a.createRange(),h=f.getDocumentElement().$,
|
|
1082
|
+
k=CKEDITOR.env.ie&&9>CKEDITOR.env.version,l=a.blockless||CKEDITOR.env.ie?"span":"div",m,n,p,q;f.getById("cke_table_copybin")||(m=f.createElement(l),n=f.createElement(l),n.setAttributes({id:"cke_table_copybin","data-cke-temp":"1"}),m.setStyles({position:"absolute",width:"1px",height:"1px",overflow:"hidden"}),m.setStyle("ltr"==a.config.contentsLangDirection?"left":"right","-5000px"),m.setHtml(a.getSelectedHtml(!0)),a.fire("lockSnapshot"),n.append(m),a.editable().append(n),q=a.on("selectionChange",c,
|
|
1083
|
+
null,null,0),k&&(p=h.scrollTop),g.selectNodeContents(m),g.select(),k&&(h.scrollTop=p),setTimeout(function(){n.remove();d.selectBookmarks(e);q.removeListener();a.fire("unlockSnapshot");b&&(a.extractSelectedHtml(),a.fire("saveSnapshot"))},100))}function p(a){var b=a.editor||a.sender.editor,c=b.getSelection();c.isInTable()&&(c.getRanges()[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored")||n(b,"cut"===a.name))}function q(a){this._reset();a&&this.setSelectedCells(a)}function y(a,
|
|
1084
|
+
b,c){a.on("beforeCommandExec",function(c){-1!==CKEDITOR.tools.array.indexOf(b,c.data.name)&&(c.data.selectedCells=x(a.getSelection()))});a.on("afterCommandExec",function(d){-1!==CKEDITOR.tools.array.indexOf(b,d.data.name)&&c(a,d.data)})}var t={active:!1},w,x,r,A,u;q.prototype={};q.prototype._reset=function(){this.cells={first:null,last:null,all:[]};this.rows={first:null,last:null}};q.prototype.setSelectedCells=function(a){this._reset();a=a.slice(0);this._arraySortByDOMOrder(a);this.cells.all=a;this.cells.first=
|
|
1085
|
+
a[0];this.cells.last=a[a.length-1];this.rows.first=a[0].getAscendant("tr");this.rows.last=this.cells.last.getAscendant("tr")};q.prototype.getTableMap=function(){var a=r(this.cells.first),c;a:{c=this.cells.last;var d=c.getAscendant("table"),e=b(c),d=CKEDITOR.tools.buildTableMap(d),f;for(f=0;f<d[e].length;f++)if((new CKEDITOR.dom.element(d[e][f])).equals(c)){c=f;break a}c=void 0}return CKEDITOR.tools.buildTableMap(this._getTable(),b(this.rows.first),a,b(this.rows.last),c)};q.prototype._getTable=function(){return this.rows.first.getAscendant("table")};
|
|
1086
|
+
q.prototype.insertRow=function(a,b,c){if("undefined"===typeof a)a=1;else if(0>=a)return;for(var d=this.cells.first.$.cellIndex,e=this.cells.last.$.cellIndex,f=c?[]:this.cells.all,g,h=0;h<a;h++)g=A(c?this.cells.all:f,b),g=CKEDITOR.tools.array.filter(g.find("td, th").toArray(),function(a){return c?!0:a.$.cellIndex>=d&&a.$.cellIndex<=e}),f=b?g.concat(f):f.concat(g);this.setSelectedCells(f)};q.prototype.insertColumn=function(a){function c(a){a=b(a);return a>=f&&a<=g}if("undefined"===typeof a)a=1;else if(0>=
|
|
1087
|
+
a)return;for(var d=this.cells,e=d.all,f=b(d.first),g=b(d.last),d=0;d<a;d++)e=e.concat(CKEDITOR.tools.array.filter(u(e),c));this.setSelectedCells(e)};q.prototype.emptyCells=function(a){a=a||this.cells.all;for(var b=0;b<a.length;b++)a[b].setHtml("")};q.prototype._arraySortByDOMOrder=function(a){a.sort(function(a,b){return a.getPosition(b)&CKEDITOR.POSITION_PRECEDING?-1:1})};var z={onPaste:function(a){function b(a){var c=d.createRange();c.selectNodeContents(a);c.select()}function c(a){return Math.max.apply(null,
|
|
1088
|
+
CKEDITOR.tools.array.map(a,function(a){return a.length},0))}var d=a.editor,f=d.getSelection(),g=x(f),h=f.isInTable(!0)&&this.isBoundarySelection(f),k=this.findTableInPastedContent(d,a.data.dataValue),m,n;(function(a,b,c,d){a=a.getRanges();var e=a.length&&a[0]._getTableElement({table:1});if(!b.length||e&&e.hasAttribute("data-cke-tableselection-ignored")||d&&!c)return!1;if(b=!d)(b=a[0])?(b=b.clone(),b.enlarge(CKEDITOR.ENLARGE_ELEMENT),b=(b=b.getEnclosedNode())&&b.is&&b.is(CKEDITOR.dtd.$tableContent)):
|
|
1089
|
+
b=void 0,b=!b;return b?!1:!0})(f,g,k,h)&&(g=g[0].getAscendant("table"),m=new q(x(f,g)),d.once("afterPaste",function(){var a;if(n){a=new CKEDITOR.dom.element(n[0][0]);var b=n[n.length-1];a=l(a,new CKEDITOR.dom.element(b[b.length-1]))}else a=m.cells.all;e(d,a)}),k?(a.stop(),h?(m.insertRow(1,1===h,!0),f.selectElement(m.rows.first)):(m.emptyCells(),e(d,m.cells.all)),a=m.getTableMap(),n=CKEDITOR.tools.buildTableMap(k),m.insertRow(n.length-a.length),m.insertColumn(c(n)-c(a)),a=m.getTableMap(),this.pasteTable(m,
|
|
1090
1090
|
a,n),d.fire("saveSnapshot"),setTimeout(function(){d.fire("afterPaste")},0)):(b(m.cells.first),d.once("afterPaste",function(){d.fire("lockSnapshot");m.emptyCells(m.cells.all.slice(1));e(d,m.cells.all);d.fire("unlockSnapshot")})))},isBoundarySelection:function(a){a=a.getRanges()[0];var b=a.endContainer.getAscendant("tr",!0);if(b&&a.collapsed){if(a.checkBoundaryOfElement(b,CKEDITOR.START))return 1;if(a.checkBoundaryOfElement(b,CKEDITOR.END))return 2}return 0},findTableInPastedContent:function(a,b){var c=
|
|
1091
|
-
a.dataProcessor,d=new CKEDITOR.dom.element("body");c||(c=new CKEDITOR.htmlDataProcessor(a));d.setHtml(c.toHtml(b),{fixForBody:!1});return 1<d.getChildCount()?null:d.findOne("table")},pasteTable:function(a,b,c){var d,e=
|
|
1091
|
+
a.dataProcessor,d=new CKEDITOR.dom.element("body");c||(c=new CKEDITOR.htmlDataProcessor(a));d.setHtml(c.toHtml(b),{fixForBody:!1});return 1<d.getChildCount()?null:d.findOne("table")},pasteTable:function(a,b,c){var d,e=r(a.cells.first),f=a._getTable(),g={},h,k,l,m;for(l=0;l<c.length;l++)for(h=new CKEDITOR.dom.element(f.$.rows[a.rows.first.$.rowIndex+l]),m=0;m<c[l].length;m++)if(k=new CKEDITOR.dom.element(c[l][m]),d=b[l]&&b[l][m]?new CKEDITOR.dom.element(b[l][m]):null,k&&!k.getCustomData("processed")){if(d&&
|
|
1092
1092
|
d.getParent())k.replace(d);else if(0===m||c[l][m-1])(d=0!==m?new CKEDITOR.dom.element(c[l][m-1]):null)&&h.equals(d.getParent())?k.insertAfter(d):0<e?h.$.cells[e]?k.insertAfter(new CKEDITOR.dom.element(h.$.cells[e])):h.append(k):h.append(k,!0);CKEDITOR.dom.element.setMarker(g,k,"processed",!0)}else k.getCustomData("processed")&&d&&d.remove();CKEDITOR.dom.element.clearAllMarkers(g)}};CKEDITOR.plugins.tableselection={getCellsBetween:l,keyboardIntegration:function(a){function b(a){var c=a.getEnclosedNode();
|
|
1093
1093
|
c&&"function"===typeof c.is&&c.is({td:1,th:1})?c.setText(""):a.deleteContents();CKEDITOR.tools.array.forEach(a._find("td"),function(a){a.appendBogus()})}var c=a.editable();c.attachListener(c,"keydown",function(a){function c(b,d){if(!d.length)return null;var f=a.createRange(),g=CKEDITOR.dom.range.mergeRanges(d);CKEDITOR.tools.array.forEach(g,function(a){a.enlarge(CKEDITOR.ENLARGE_ELEMENT)});var h=g[0].getBoundaryNodes(),k=h.startNode,h=h.endNode;if(k&&k.is&&k.is(e)){for(var l=k.getAscendant("table",
|
|
1094
|
-
!0),m=k.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l),n=!1,
|
|
1094
|
+
!0),m=k.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l),n=!1,p=function(a){return!k.contains(a)&&a.is&&a.is("td","th")};m&&!p(m);)m=m.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l);!m&&h&&h.is&&!h.is("table")&&h.getNext()&&(m=h.getNext().findOne("td, th"),n=!0);if(m)f["moveToElementEdit"+(n?"Start":"End")](m);else f.setStartBefore(k.getAscendant("table",!0)),f.collapse(!0);g[0].deleteContents();return[f]}if(k)return f.moveToElementEditablePosition(k),[f]}var d={37:1,38:1,39:1,40:1,8:1,46:1,13:1},
|
|
1095
1095
|
e=CKEDITOR.tools.extend({table:1},CKEDITOR.dtd.$tableContent);delete e.td;delete e.th;return function(e){var f=e.data.getKey(),g=e.data.getKeystroke(),h,k=37===f||38==f,l,m,n;if(d[f]&&!a.readOnly&&(h=a.getSelection())&&h.isInTable()&&h.isFake){l=h.getRanges();m=l[0]._getTableElement();n=l[l.length-1]._getTableElement();if(13!==f||a.plugins.enterkey)e.data.preventDefault(),e.cancel();if(36<f&&41>f)l[0].moveToElementEditablePosition(k?m:n,!k),h.selectRanges([l[0]]);else if(13!==f||13===g||g===CKEDITOR.SHIFT+
|
|
1096
1096
|
13){for(e=0;e<l.length;e++)b(l[e]);(e=c(m,l))?l=e:l[0].moveToElementEditablePosition(m);h.selectRanges(l);13===f&&a.plugins.enterkey?(a.fire("lockSnapshot"),13===g?a.execCommand("enter"):a.execCommand("shiftEnter"),a.fire("unlockSnapshot"),a.fire("saveSnapshot")):13!==f&&a.fire("saveSnapshot")}}}}(a),null,null,-1);c.attachListener(c,"keypress",function(c){var d=a.getSelection(),e=c.data.$.charCode||13===c.data.getKey(),f;if(!a.readOnly&&d&&d.isInTable()&&d.isFake&&e&&!(c.data.getKeystroke()&CKEDITOR.CTRL)){c=
|
|
1097
|
-
d.getRanges();e=c[0].getEnclosedNode().getAscendant({td:1,th:1},!0);for(f=0;f<c.length;f++)b(c[f]);e&&(c[0].moveToElementEditablePosition(e),d.selectRanges([c[0]]))}},null,null,-1)}};CKEDITOR.plugins.add("tableselection",{requires:"clipboard,tabletools",isSupportedEnvironment:function(){return!(CKEDITOR.env.ie&&11>CKEDITOR.env.version)},onLoad:function(){
|
|
1098
|
-
"styles/tableselection.css")},init:function(a){this.isSupportedEnvironment()&&(a.addContentsCss&&a.addContentsCss(this.path+"styles/tableselection.css"),a.on("contentDom",function(){var b=a.editable(),e=b.isInline()?b:a.document,f={editor:a};b.attachListener(e,"mousedown",c,null,f);b.attachListener(e,"mousemove",c,null,f);b.attachListener(e,"mouseup",c,null,f);b.attachListener(b,"dragstart",d);b.attachListener(a,"selectionCheck",
|
|
1099
|
-
!CKEDITOR.plugins.clipboard.isCustomCopyCutSupported&&(b.attachListener(b,"cut",
|
|
1097
|
+
d.getRanges();e=c[0].getEnclosedNode().getAscendant({td:1,th:1},!0);for(f=0;f<c.length;f++)b(c[f]);e&&(c[0].moveToElementEditablePosition(e),d.selectRanges([c[0]]))}},null,null,-1)}};CKEDITOR.plugins.add("tableselection",{requires:"clipboard,tabletools",isSupportedEnvironment:function(){return!(CKEDITOR.env.ie&&11>CKEDITOR.env.version)},onLoad:function(){w=CKEDITOR.plugins.tabletools;x=w.getSelectedCells;r=w.getCellColIndex;A=w.insertRow;u=w.insertColumn;CKEDITOR.document.appendStyleSheet(this.path+
|
|
1098
|
+
"styles/tableselection.css")},init:function(a){this.isSupportedEnvironment()&&(a.addContentsCss&&a.addContentsCss(this.path+"styles/tableselection.css"),a.on("contentDom",function(){var b=a.editable(),e=b.isInline()?b:a.document,f={editor:a};b.attachListener(e,"mousedown",c,null,f);b.attachListener(e,"mousemove",c,null,f);b.attachListener(e,"mouseup",c,null,f);b.attachListener(b,"dragstart",d);b.attachListener(a,"selectionCheck",g);CKEDITOR.plugins.tableselection.keyboardIntegration(a);CKEDITOR.plugins.clipboard&&
|
|
1099
|
+
!CKEDITOR.plugins.clipboard.isCustomCopyCutSupported&&(b.attachListener(b,"cut",p),b.attachListener(b,"copy",p))}),a.on("paste",z.onPaste,z),y(a,"rowInsertBefore rowInsertAfter columnInsertBefore columnInsertAfter cellInsertBefore cellInsertAfter".split(" "),function(a,b){e(a,b.selectedCells)}),y(a,["cellMerge","cellMergeRight","cellMergeDown"],function(a,b){e(a,[b.commandData.cell])}),y(a,["cellDelete"],function(a){f(a,!0)}))}})})();CKEDITOR.plugins.add("taoqtiimage",{init:function(a){var l;a.addCommand("insertQtiImage",
|
|
1100
1100
|
{exec:function(a){var f=a.config.taoQtiItem;"function"===typeof f.insert&&(l=a.getSelection().getRanges(),a.focus(),l&&0<l.length&&a.getSelection().selectRanges(l),a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"img" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),f.insert.call(a),l=null)}});a.ui.addButton("TaoQtiImage",{label:a.lang.insertQtiImage.button,command:"insertQtiImage",icon:this.path+"images/taoqtiimage.png"})}});CKEDITOR.plugins.add("taoqtimaths",{init:function(a){var l;
|
|
1101
1101
|
a.addCommand("insertQtiMaths",{exec:function(a){var f=a.config.taoQtiItem;"function"===typeof f.insert&&(l=a.getSelection().getRanges(),a.focus(),l&&0<l.length&&a.getSelection().selectRanges(l),a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"math" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),f.insert.call(a),l=null)}});a.ui.addButton("TaoQtiMaths",{label:a.lang.insertQtiMaths.button,command:"insertQtiMaths",icon:this.path+"images/taoqtimaths.png"})}});CKEDITOR.plugins.add("taoqtimedia",
|
|
1102
1102
|
{init:function(a){var l;a.addCommand("insertQtiMedia",{exec:function(a){var f=a.config.taoQtiItem;"function"===typeof f.insert&&(l=a.getSelection().getRanges(),a.focus(),l&&0<l.length&&a.getSelection().selectRanges(l),a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"object" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),f.insert.call(a),l=null)}});a.ui.addButton("TaoQtiMedia",{label:a.lang.insertQtiMedia.button,command:"insertQtiMedia",icon:this.path+"images/taoqtimedia.png"})}});CKEDITOR.plugins.add("taoqtitable",
|
|
1103
1103
|
{requires:"dialog",icons:this.path+"images/taoqtitable.png",hidpi:!1,init:function(a){var l=!0;if("table"===a.element.getAttribute("data-qti-class"))l=!1;else if(a.blockless)return;var h=a.lang.table;a.addCommand("taoqtitable",new CKEDITOR.dialogCommand("taoqtitable",{context:"table",allowedContent:"table[summary];caption tbody thead tfoot;th td tr[scope];"+(a.plugins.dialogadvtab?"table"+a.plugins.dialogadvtab.allowedContent():""),requiredContent:"table"}));a.addCommand("taoqtitableProperties",new CKEDITOR.dialogCommand("taoqtitableProperties"));
|
|
1104
1104
|
l&&a.ui.addButton&&a.ui.addButton("TaoQtiTable",{label:h.toolbar,command:"taoqtitable",toolbar:"insert,30",icon:this.path+"images/taoqtitable.png"});CKEDITOR.dialog.add("taoqtitable",this.path+"dialogs/taoqtitable.js");CKEDITOR.dialog.add("taoqtitableProperties",this.path+"dialogs/taoqtitable.js")}});CKEDITOR.plugins.add("menubutton",{requires:"button,menu",onLoad:function(){var a=function(a){var h=this._,f=h.menu;h.state!==CKEDITOR.TRISTATE_DISABLED&&(h.on&&f?f.hide():(h.previousState=h.state,f||
|
|
1105
1105
|
(f=h.menu=new CKEDITOR.menu(a,{panel:{className:"cke_menu_panel",attributes:{"aria-label":a.lang.common.options}}}),f.onHide=CKEDITOR.tools.bind(function(){var e=this.command?a.getCommand(this.command).modes:this.modes;this.setState(!e||e[a.mode]?h.previousState:CKEDITOR.TRISTATE_DISABLED);h.on=0},this),this.onMenu&&f.addListener(this.onMenu)),this.setState(CKEDITOR.TRISTATE_ON),h.on=1,setTimeout(function(){f.show(CKEDITOR.document.getById(h.id),4)},0)))};CKEDITOR.ui.menuButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,
|
|
1106
|
-
$:function(l){delete l.panel;this.base(l);this.hasArrow="menu";this.click=a},statics:{handler:{create:function(a){return new CKEDITOR.ui.menuButton(a)}}}})},beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_MENUBUTTON,CKEDITOR.ui.menuButton.handler)}});CKEDITOR.UI_MENUBUTTON="menubutton";CKEDITOR.plugins.add("taounderline",{requires:"menubutton",init:function(a){function l(b){[e,m,
|
|
1107
|
-
a.elementPath(),b=e.checkActive(b,a)||m.checkActive(b,a)||
|
|
1108
|
-
attributes:{"class":"txt-dashed"}}),
|
|
1109
|
-
{contentForms:b}));a.addCommand("spanWavy",new CKEDITOR.styleCommand(
|
|
1110
|
-
group:"taounderline",order:3,role:"menuitemcheckbox",onClick:function(){f();l(
|
|
1111
|
-
c.trim(),b.selectRanges([c]),d=b.createBookmarks())}var f=a.elementPath(),b=e.checkActive(f,a),c=m.checkActive(f,a),f=
|
|
1106
|
+
$:function(l){delete l.panel;this.base(l);this.hasArrow="menu";this.click=a},statics:{handler:{create:function(a){return new CKEDITOR.ui.menuButton(a)}}}})},beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_MENUBUTTON,CKEDITOR.ui.menuButton.handler)}});CKEDITOR.UI_MENUBUTTON="menubutton";CKEDITOR.plugins.add("taounderline",{requires:"menubutton",init:function(a){function l(b){[e,m,k].forEach(function(c){c!==b&&a.removeStyle(c)});b.checkActive(a.elementPath(),a)?a.removeStyle(b):a.applyStyle(b)}function h(){if(!a.readOnly){var b=
|
|
1107
|
+
a.elementPath(),b=e.checkActive(b,a)||m.checkActive(b,a)||k.checkActive(b,a),c=a.ui.get("TaoUnderline");c&&c.setState(b?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)}}function f(){if(d)try{a.focus();var b=a.getSelection();b&&b.selectBookmarks(d)}catch(c){var e=a.getSelection();if(e){var f=e.getRanges();if(f.length){var g=f[0];g.shrink(CKEDITOR.SHRINK_TEXT);g.trim();e.selectRanges([g])}}}finally{d=null}}var e=new CKEDITOR.style({element:"span",attributes:{"class":"txt-underline"}}),m=new CKEDITOR.style({element:"span",
|
|
1108
|
+
attributes:{"class":"txt-dashed"}}),k=new CKEDITOR.style({element:"span",attributes:{"class":"txt-wavy"}}),g=["u",["span",function(a){return"underline"===a.styles["text-decoration"]}]];g.unshift(e);var b=[["span",function(a){return"underline dashed"===a.styles["text-decoration"]}]];b.unshift(m);var c=[["span",function(a){return"underline wavy"===a.styles["text-decoration"]}]];c.unshift(k);a.addCommand("spanUnderline",new CKEDITOR.styleCommand(e,{contentForms:g}));a.addCommand("spanDashed",new CKEDITOR.styleCommand(m,
|
|
1109
|
+
{contentForms:b}));a.addCommand("spanWavy",new CKEDITOR.styleCommand(k,{contentForms:c}));a.attachStyleStateChange(e,h);a.attachStyleStateChange(m,h);a.attachStyleStateChange(k,h);var d=null,g={taounderline_underline:{label:a.lang.spanUnderline.menu.solid,group:"taounderline",order:1,role:"menuitemcheckbox",onClick:function(){f();l(e)},style:e},taounderline_dashed:{label:a.lang.spanUnderline.menu.dashed,group:"taounderline",order:2,role:"menuitemcheckbox",onClick:function(){f();l(m)},style:m},taounderline_wavy:{label:a.lang.spanUnderline.menu.wavy,
|
|
1110
|
+
group:"taounderline",order:3,role:"menuitemcheckbox",onClick:function(){f();l(k)},style:k}};a.addMenuGroup("taounderline",1);a.addMenuItems(g);a.ui.add("TaoUnderline",CKEDITOR.UI_MENUBUTTON,{label:a.lang.spanUnderline.button,toolbar:"basicstyles,20",icon:this.path+"images/taounderline.png",command:"spanUnderline",onMenu:function(){document&&document.body&&document.body.classList.add("cke_panel_visible");var b=a.getSelection();if(b){var c=b.getRanges();c.length&&(c=c[0],c.shrink(CKEDITOR.SHRINK_TEXT),
|
|
1111
|
+
c.trim(),b.selectRanges([c]),d=b.createBookmarks())}var f=a.elementPath(),b=e.checkActive(f,a),c=m.checkActive(f,a),f=k.checkActive(f,a);return{taounderline_underline:b?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF,taounderline_dashed:c?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF,taounderline_wavy:f?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF}}})}});CKEDITOR.plugins.add("taotooltip",{init:function(a){function l(a){var d=a.getSelection(),g=d.getNative();a=null;d.getRanges()[0]&&(a=d.getRanges()[0].startContainer);
|
|
1112
1112
|
if(d=null!==g)if(d=g.getRangeAt(0),!(d=g&&g.isCollapsed&&!e(g.getRangeAt(d.startContainer))))if(g=!g.isCollapsed&&g.getRangeAt(0)){b=!1;h(g.cloneContents());if(d=""!==g.toString().trim())var d=f(g.startContainer),k=f(g.endContainer),d=d.isSameNode(k);d=d&&!b&&!e(g.startContainer)}else d=!1;if(g=d)a=a?null!==a.getAscendant("ruby"):!1,g=!a;return g}function h(a){a=a.childNodes;var d,e;for(e=0;e<a.length;e++)if(d=a[e],!b&&d.nodeType===window.Node.ELEMENT_NODE){var f=d.nodeName&&d.nodeName.toLowerCase();
|
|
1113
|
-
-1===
|
|
1114
|
-
b;a.addCommand("insertTaoTooltip",{exec:function(a){var b=a.config.taoQtiItem,e=a.getSelection(),f=e.getNative(),g;l(a)&&"function"===typeof b.insert&&(g=new CKEDITOR.dom.element("span",a.document),g.setAttributes({"data-new":!0,"data-qti-class":"_tooltip","class":"widget-box"}),f&&f.isCollapsed?g.appendHtml("\x26nbsp;"):g.append(m(e)),a.insertElement(g),b.insert.call(a,g.$))}});a.on("instanceReady",function(){var b=a.editable();b.attachListener(b,"mouseup",function(){
|
|
1115
|
-
function(){
|
|
1113
|
+
-1===g.indexOf(f)?b=!0:h(d)}}function f(a){return a.nodeType===window.Node.TEXT_NODE?a.parentNode:a}function e(a){return(new CKEDITOR.dom.element(a)).getAscendant(function(a){return a.$&&a.$.dataset&&"_tooltip"===a.$.dataset.qtiClass})}function m(a){a=a.getRanges()[0].extractContents().$;return new CKEDITOR.dom.element(a)}function k(a){var b=a.getCommand("insertTaoTooltip");b&&(l(a)?b.setState(CKEDITOR.TRISTATE_OFF):b.setState(CKEDITOR.TRISTATE_DISABLED))}var g="b strong i em s sub sup u".split(" "),
|
|
1114
|
+
b;a.addCommand("insertTaoTooltip",{exec:function(a){var b=a.config.taoQtiItem,e=a.getSelection(),f=e.getNative(),g;l(a)&&"function"===typeof b.insert&&(g=new CKEDITOR.dom.element("span",a.document),g.setAttributes({"data-new":!0,"data-qti-class":"_tooltip","class":"widget-box"}),f&&f.isCollapsed?g.appendHtml("\x26nbsp;"):g.append(m(e)),a.insertElement(g),b.insert.call(a,g.$))}});a.on("instanceReady",function(){var b=a.editable();b.attachListener(b,"mouseup",function(){k(a)});b.attachListener(b,"keyup",
|
|
1115
|
+
function(){k(a)})});a.ui.addButton("TaoTooltip",{label:a.lang.insertTaoTooltip.button,command:"insertTaoTooltip",icon:this.path+"images/taotooltip.png"})}});CKEDITOR.plugins.add("taohighlight",{init:function(a){var l=new CKEDITOR.style({element:"span",attributes:{"class":"txt-highlight"}}),h=["span"];h.unshift(l);a.attachStyleStateChange(l,function(f){!a.readOnly&&a.getCommand("spanHighlight").setState(f)});a.addCommand("spanHighlight",new CKEDITOR.styleCommand(l,{contentForms:h}));a.ui.addButton("TaoHighlight",
|
|
1116
1116
|
{label:a.lang.spanHighlight.button,command:"spanHighlight",icon:this.path+"images/taohighlight.png"})}});CKEDITOR.plugins.add("taoqtiinclude",{init:function(a){var l;a.addCommand("insertQtiInclude",{exec:function(a){var f=a.config.taoQtiItem;"function"===typeof f.insert&&(l=a.getSelection().getRanges(),a.focus(),l&&0<l.length&&a.getSelection().selectRanges(l),a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"include" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),f.insert.call(a),l=
|
|
1117
1117
|
null)}});a.ui.addButton("TaoQtiInclude",{label:a.lang.insertQtiInclude.button,command:"insertQtiInclude",icon:this.path+"images/taoqtiimage.png"})}});CKEDITOR.plugins.add("taoqtiprintedvariable",{init:function(a){var l;a.addCommand("insertQtiPrintedVariable",{exec:function(a){var f=a.config.taoQtiItem;"function"===typeof f.insert&&(l=a.getSelection().getRanges(),a.focus(),l&&0<l.length&&a.getSelection().selectRanges(l),a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"printedVariable" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),
|
|
1118
1118
|
f.insert.call(a),l=null)}});a.ui.addButton("TaoQtiPrintedVariable",{label:a.lang.insertQtiPrintedVariable.button,command:"insertQtiPrintedVariable",icon:this.path+"images/taoqtiprintedvariable.png"})}});CKEDITOR.plugins.add("taofurigana",{init:function(a){function l(a){a=a.getRanges()[0].extractContents().$;return new CKEDITOR.dom.element(a)}function h(a){return a.nodeType===window.Node.TEXT_NODE?a.parentNode:a}function f(a){return a?null!==a.getAscendant("ruby"):!1}function e(a){return a?f(a)&&null!==
|
|
1119
|
-
a.getAscendant("rt",!0):!1}function m(a){var b=a.getSelection();a=b.getNative();var c;if(c=null!==a)c=!(b&&b.isCollapsed())&&b.getRanges()[0]&&!f(b.getRanges()[0].startContainer);if(b=c)if(a=!a.isCollapsed&&a.getRangeAt(0)){
|
|
1120
|
-
""===a.getText()}function
|
|
1121
|
-
g(c)?e=c:(e=new CKEDITOR.dom.text("",a.document),e.insertBefore(c));d=b.getLast();g(d)||(d=new CKEDITOR.dom.text("",a.document),b.append(d));e.equals(d)&&(d=new CKEDITOR.dom.text("",a.document),d.insertAfter(e));return{startAnchor:e,endAnchor:d}}function
|
|
1122
|
-
f=new CKEDITOR.dom.walker(
|
|
1123
|
-
|
|
1124
|
-
!0):null)||(f
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
(a.
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
a.
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
b.
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
l
|
|
1167
|
-
|
|
1119
|
+
a.getAscendant("rt",!0):!1}function m(a){var b=a.getSelection();a=b.getNative();var c;if(c=null!==a)c=!(b&&b.isCollapsed())&&b.getRanges()[0]&&!f(b.getRanges()[0].startContainer);if(b=c)if(a=!a.isCollapsed&&a.getRangeAt(0)){H=!1;var b=a.cloneContents().childNodes,d;for(d=0;d<b.length;d++)if(c=b[d],!H&&c.nodeType!==window.Node.TEXT_NODE){H=!0;break}if(b=""!==a.toString().trim())b=h(a.startContainer),a=h(a.endContainer),b=b.isSameNode(a);b=b&&!H}else b=!1;return b}function k(a){return(a.$.textContent||
|
|
1120
|
+
"").replace(B,"").trim().length}function g(a){return a&&a.type===CKEDITOR.NODE_TEXT&&""===a.getText()}function b(b){var c=b.getFirst(),d=b.getLast(),e;if(!c)return e=new CKEDITOR.dom.text("",a.document),d=new CKEDITOR.dom.text("",a.document),b.append(e),b.append(d),{startAnchor:e,endAnchor:d};if(c.equals(d))return g(c)?(c.remove(),e=new CKEDITOR.dom.text("",a.document),d=new CKEDITOR.dom.text("",a.document),b.append(e),b.append(d)):(e=new CKEDITOR.dom.text("",a.document),d=new CKEDITOR.dom.text("",
|
|
1121
|
+
a.document),e.insertBefore(c),d.insertAfter(c)),{startAnchor:e,endAnchor:d};g(c)?e=c:(e=new CKEDITOR.dom.text("",a.document),e.insertBefore(c));d=b.getLast();g(d)||(d=new CKEDITOR.dom.text("",a.document),b.append(d));e.equals(d)&&(d=new CKEDITOR.dom.text("",a.document),d.insertAfter(e));return{startAnchor:e,endAnchor:d}}function c(c){c=b(c);var d=a.getSelection(),e=new CKEDITOR.dom.range(a.document);e.setStart(c.startAnchor,1);e.collapse(!0);d.selectRanges([e])}function d(d,e){if(!d||!d.isCollapsed()||
|
|
1122
|
+
8!==e&&46!==e)return!1;var f=d.getRanges()[0];if(!f)return!1;var g=f.startContainer;if(!g||!g.getAscendant)return!1;g=g.getAscendant("rt",!0);if(!g)return!1;b(g);var h;a:{h=new CKEDITOR.dom.range(a.document);h.selectNodeContents(g);h=new CKEDITOR.dom.walker(h);for(var k=h.next();k;){if(k.type===CKEDITOR.NODE_TEXT)for(var l=k.getText(),m=0;m<l.length;m++)if(""!==l.charAt(m)){h={node:k,offset:m};break a}k=h.next()}h=null}if(!(k=!h)){a:if(k=h,f.startContainer.equals(k.node))f=f.startOffset<=k.offset;
|
|
1123
|
+
else{for(l=g.getFirst();l;){if(l.equals(f.startContainer)){f=!0;break a}if(l.equals(k.node)){f=!1;break a}l=l.getNext()}f=!1}k=!f}if(k)return!1;a.fire("saveSnapshot");a.fire("lockSnapshot");try{var n=h.node.getText();h.node.$.nodeValue=n.slice(0,h.offset)+n.slice(h.offset+1);b(g);c(g)}finally{a.fire("unlockSnapshot")}return!0}function n(c,d){if(M||!c||!c.isCollapsed())return!1;var e=c.getRanges()[0];if(!e)return!1;var f=e.startContainer;if(!f||!f.getAscendant)return!1;var g=f.getAscendant("rt",!0);
|
|
1124
|
+
if(g){var h=0===e.startOffset;b(g);if(!h)return!1}(g=d&&d.getAscendant?d.getAscendant("ruby",!0):null)||(g=f.getAscendant("ruby",!0));if(!g)return!1;var h=g.find("rt"),k=h.count()?h.getItem(0):null;if(!k)return!1;var h=b(k),l=new CKEDITOR.dom.range(a.document),m=!0,k=k.getIndex();f.equals(g)&&e.startOffset>k&&(m=!1);m?l.setStart(h.startAnchor,1):l.setStartBefore(h.endAnchor);l.collapse(!0);M=!0;try{c.selectRanges([l])}finally{M=!1}return!0}function p(c){var d=a.getSelection();n(d,c);(c=d&&d.getRanges()[0])&&
|
|
1125
|
+
(c=c.startContainer)&&c.getAscendant&&(c=c.getAscendant("rt",!0))&&b(c)}function q(a){return a.replace(G,function(a,b,c,d){return b+c.replace(B,"")+d})}function y(d,e){if(8!==e&&37!==e||!d||!d.isCollapsed())return!1;var f=d.getRanges()[0];if(!f)return!1;if(f=x(f,!1)){f=f.findOne("rt");if(!f)return!1;a.fire("lockSnapshot");try{b(f),c(f)}finally{a.fire("unlockSnapshot")}return!0}return!1}function t(b,c){if(46!==c&&8!==c||!b||!b.isCollapsed())return!1;var d=b.getRanges()[0];if(!d||!d.startContainer)return!1;
|
|
1126
|
+
var e=46===c,f=d.startContainer.getAscendant("ruby");f||(f=x(d,e));if(f){e=f.findOne("rt");d=f.findOne("rb");e=e?k(e):0;d=d?k(d):0;if(1<e+d)return!1;a.fire("saveSnapshot");a.fire("lockSnapshot");try{var g=f.getNext();f.remove();C(g)}finally{a.fire("unlockSnapshot")}return!0}return!1}function w(b,c){if(37!==c||!b||!b.isCollapsed())return!1;var d=b.getRanges()[0];if(!d||!d.startContainer)return!1;var e=d.startContainer;if(e.type===CKEDITOR.NODE_TEXT&&e.getAscendant("rt",!0)){var d=e.getText().substring(0,
|
|
1127
|
+
d.startOffset),f=e.getAscendant("rt",!0),g=e.getAscendant("ruby",!0);if(g&&f.getFirst().equals(e)&&!d.replace(B,"").length)if(g.getPrevious()){a.fire("lockSnapshot");try{var h=new CKEDITOR.dom.range(a.document);h.moveToPosition(g,CKEDITOR.POSITION_BEFORE_START);b.selectRanges([h])}finally{return a.fire("unlockSnapshot"),!0}}else return!0}return!1}function x(a,b){if(b){var c=a.getBoundaryNodes().endNode;if(c&&a.checkBoundaryOfElement(c,CKEDITOR.END)){var d=c.getNext();if(r(d))return d}}else{var c=
|
|
1128
|
+
a.startContainer,e=a.startOffset;if(c.type!==CKEDITOR.NODE_TEXT){c=a.getBoundaryNodes().startNode;if(c.type!==CKEDITOR.NODE_TEXT||c.getText().length&&!a.checkBoundaryOfElement(c,CKEDITOR.END))return null;e=c.getText().length}if(d=c.getPrevious()){if(r(d)&&A(c)&&1>=e)return d;c=c&&c.type===CKEDITOR.NODE_TEXT?!c.getText().length:!1;if(c&&0===e&&(e=d.getPrevious(),r(e)&&A(d)&&1>=d.getText().length))return e}}}function r(a){return a&&a.getName&&"ruby"===a.getName()}function A(a){return a&&a.type===CKEDITOR.NODE_TEXT?
|
|
1129
|
+
(a=a.getText(),1<=a.length&&""===a[0]&&""!==a[1]):!1}function u(){if(!J){var b=a.document.find("ruby");if(b.count()){J=L=!0;a.fire("lockSnapshot");try{for(var c=0;c<b.count();c++){var d=b.getItem(c),e=d.getNext();A(e)||(e.getFirst&&A(e.getFirst())&&C(e.getFirst()),z(d))}}finally{a.fire("unlockSnapshot"),J=!1}}}}function z(b){(new CKEDITOR.dom.text("",a.document)).insertAfter(b)}function v(b,c,d){b=b.getAscendant("ruby");if(!b)return!1;var e=b.find("rb"),f=b.find("rt"),e=e.count()?e.getItem(0):
|
|
1130
|
+
null,f=f.count()?f.getItem(0):null,g;if(e&&!f||c&&e&&f&&0===k(f)){a.fire("saveSnapshot");a.fire("lockSnapshot");try{var h=e?e.getText():"",l=new CKEDITOR.dom.text(h,a.document);l.replace(b);var m=l.getNext();C(m);c||(g=new CKEDITOR.dom.range(a.document),g.selectNodeContents(l),d.selectRanges([g]));a.fire("change")}finally{a.fire("unlockSnapshot")}return!0}}function D(a){function b(c){N.forEach(function(b){a.getCommand(b).setState(!c);a.getCommand(b).setState(c)});O.forEach(function(a){a.setState(c)})}
|
|
1131
|
+
var c=a.getCommand("rubyFurigana"),d=a.getSelection(),g=d.getRanges()[0];N.length||a.toolbar.forEach(function(a){a.items&&a.items.length&&a.items.forEach(function(a){a.command&&"rubyFurigana"!==a.command?(N.push(a.command),F.includes(a.command)&&K.push(a)):a.command||"undefined"===typeof a.setState||O.push(a)})});c&&(m(a)?(c.setState(CKEDITOR.TRISTATE_OFF),b(CKEDITOR.TRISTATE_OFF)):d.getRanges()[0]&&f(g.startContainer)?v(g.startContainer,!1,d)?(c.setState(CKEDITOR.TRISTATE_DISABLED),b(CKEDITOR.TRISTATE_OFF)):
|
|
1132
|
+
e(g.startContainer)?(c.setState(CKEDITOR.TRISTATE_ON),setTimeout(function(){b(CKEDITOR.TRISTATE_DISABLED)},150)):(c.setState(CKEDITOR.TRISTATE_ON),setTimeout(function(){b(CKEDITOR.TRISTATE_DISABLED);K.forEach(function(a){a.setState(CKEDITOR.TRISTATE_OFF)})},150)):(c.setState(CKEDITOR.TRISTATE_DISABLED),b(CKEDITOR.TRISTATE_OFF)))}function C(a){A(a)&&(1===a.getText().length?a.remove():a.setText(a.getText().substring(1)))}var B=/\u200B/g,G=/(<rt\b[^>]*>)([\s\S]*?)(<\/rt>)/gi,M=!1,J=!1,E=!1,L=!1,H,K=
|
|
1133
|
+
[],F="bold italic strike spanUnderline subscript superscript".split(" "),N=[],O=[];a.addCommand("rubyFurigana",{exec:function(a){var c=a.getSelection(),d=c.getRanges()[0].startContainer,e,g,h;if(f(d))if(e=d.getAscendant("ruby"),g=e.find("rb"),v(d,!0))D(a);else{a.fire("saveSnapshot");a.fire("lockSnapshot");try{var d="",k=g.getItem(0);k&&(d=k.getText());var n=new CKEDITOR.dom.text(d,a.document);n.replace(e);var p=n.getNext();C(p);h=new CKEDITOR.dom.range(a.document);h.setStartAfter(n);h.collapse(!0);
|
|
1134
|
+
c.selectRanges([h]);a.fire("change");D(a)}finally{a.fire("unlockSnapshot")}}else m(a)&&(L=!0,a.fire("saveSnapshot"),a.fire("lockSnapshot"),e=new CKEDITOR.dom.element("ruby",a.document),g=new CKEDITOR.dom.element("rb",a.document),g.append(l(c)),h=new CKEDITOR.dom.element("rt",a.document),e.append(g),e.append(h),g=b(h),a.insertElement(e),z(e),h=new CKEDITOR.dom.range(a.document),h.setStart(g.startAnchor,1),h.collapse(!0),a.getSelection().removeAllRanges(),a.getSelection().selectRanges([h]),D(a),a.fire("unlockSnapshot"))}});
|
|
1135
|
+
a.on("instanceReady",function(){var b=a.editable();a.getCommand("rubyFurigana").setState(CKEDITOR.TRISTATE_DISABLED);b.attachListener(CKEDITOR.document,"mouseup",function(){if(E&&(E=!1,D(a),L)){var b=a.getSelection(),c;if(b&&b.isCollapsed()){c=b.getRanges()[0];var d=c.startContainer;c=0===c.startOffset&&d&&d.type===CKEDITOR.NODE_TEXT&&d.getAscendant("rt",!0)&&d.getText().startsWith("")?!0:!1}else c=!1;c&&p(b)}});b.attachListener(b,"mousedown",function(){E=!0});b.attachListener(b,"focus",function(a){L&&
|
|
1136
|
+
(a=a&&a.data&&a.data.getTarget?a.data.getTarget():null,p(a))});b.attachListener(b,"keyup",function(){D(a)});b.attachListener(b,"keydown",function(b){if(L){var c=b&&b.data&&b.data.$?b.data.$:null,c=c?c.keyCode:null,e=a.getSelection();if(d(e,c)||w(e,c)||y(e,c)||t(e,c))b&&b.data&&b.data.preventDefault&&b.data.preventDefault(),a.fire("change"),D(a)}});a.on("selectionChange",function(){L&&(u(),p())})});a.on("dataReady",function(){u()});a.on("change",function(){L&&u()});a.on("getData",function(a){a.data.dataValue=
|
|
1137
|
+
q(a.data.dataValue)});a.on("blur",function(){for(var b=a.document.find("ruby"),c=!1,d=0;d<b.count();d++){var e=b.getItem(d),f=e.find("rt");if((f=f.count()?f.getItem(0):null)&&0===k(f)){f=e.find("rb");a.fire("saveSnapshot");a.fire("lockSnapshot");try{var g=e.getNext();C(g);var h=f.count()?f.getItem(0):null;if(h){var l=h.$.innerHTML,m;try{m=CKEDITOR.dom.element.createFromHtml(l,a.document)}catch(n){m=null}m&&m.type!==CKEDITOR.NODE_TEXT||(m=new CKEDITOR.dom.text(h.getText(),a.document));m.replace(e)}else e.remove();
|
|
1138
|
+
c=!0}finally{a.fire("unlockSnapshot")}}}c&&(a.updateElement(),a.fire("change"),D(a))});a.ui.addButton("TaoFurigana",{label:a.lang.rubyFurigana.button,command:"rubyFurigana",icon:this.path+"images/taofurigana.png"})}});"use strict";(function(){function a(a,c){return CKEDITOR.tools.array.reduce(c,function(a,b){return b(a)},a)}var l=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],h={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(a){function c(a){e.enabled&&!1!==a.data.command.canUndo&&
|
|
1139
|
+
e.save()}function d(){e.enabled=a.readOnly?!1:"wysiwyg"==a.mode;e.onChange()}var e=a.undoManager=new f(a),g=e.editingHandler=new k(e),h=a.addCommand("undo",{exec:function(){e.undo()&&(a.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),m=a.addCommand("redo",{exec:function(){e.redo()&&(a.selectionChange(),this.fire("afterRedo"))},startDisabled:!0,canUndo:!1});a.setKeystroke([[l[0],"undo"],[l[1],"redo"],[l[2],"redo"]]);e.onChange=function(){h.setState(e.undoable()?CKEDITOR.TRISTATE_OFF:
|
|
1140
|
+
CKEDITOR.TRISTATE_DISABLED);m.setState(e.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)};a.on("beforeCommandExec",c);a.on("afterCommandExec",c);a.on("saveSnapshot",function(a){e.save(a.data&&a.data.contentOnly)});a.on("contentDom",g.attachListeners,g);a.on("instanceReady",function(){a.fire("saveSnapshot")});a.on("beforeModeUnload",function(){"wysiwyg"==a.mode&&e.save(!0)});a.on("mode",d);a.on("readOnly",d);a.ui.addButton&&(a.ui.addButton("Undo",{label:a.lang.undo.undo,command:"undo",
|
|
1141
|
+
toolbar:"undo,10"}),a.ui.addButton("Redo",{label:a.lang.undo.redo,command:"redo",toolbar:"undo,20"}));a.resetUndo=function(){e.reset();a.fire("saveSnapshot")};a.on("updateSnapshot",function(){e.currentImage&&e.update()});a.on("lockSnapshot",function(a){a=a.data;e.lock(a&&a.dontUpdate,a&&a.forceUpdate)});a.on("unlockSnapshot",e.unlock,e)}});CKEDITOR.plugins.undo={};var f=CKEDITOR.plugins.undo.UndoManager=function(a){this.strokesRecorded=[0,0];this.locked=null;this.previousKeyGroup=-1;this.limit=a.config.undoStackSize||
|
|
1142
|
+
20;this.strokesLimit=25;this._filterRules=[];this.editor=a;this.reset();CKEDITOR.env.ie&&this.addFilterRule(function(a){return a.replace(/\s+data-cke-expando=".*?"/g,"")})};f.prototype={type:function(a,c){var d=f.getKeyGroup(a),e=this.strokesRecorded[d]+1;c=c||e>=this.strokesLimit;this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange());c?(e=0,this.editor.fire("saveSnapshot")):this.editor.fire("change");this.strokesRecorded[d]=e;this.previousKeyGroup=d},keyGroupChanged:function(a){return f.getKeyGroup(a)!=
|
|
1143
|
+
this.previousKeyGroup},reset:function(){this.snapshots=[];this.index=-1;this.currentImage=null;this.hasRedo=this.hasUndo=!1;this.locked=null;this.resetType()},resetType:function(){this.strokesRecorded=[0,0];this.typing=!1;this.previousKeyGroup=-1},refreshState:function(){this.hasUndo=!!this.getNextImage(!0);this.hasRedo=!!this.getNextImage(!1);this.resetType();this.onChange()},save:function(a,c,d){var f=this.editor;if(this.locked||"ready"!=f.status||"wysiwyg"!=f.mode)return!1;var g=f.editable();if(!g||
|
|
1144
|
+
"ready"!=g.status)return!1;g=this.snapshots;c||(c=new e(f));if(!1===c.contents)return!1;if(this.currentImage)if(c.equalsContent(this.currentImage)){if(a||c.equalsSelection(this.currentImage))return!1}else!1!==d&&f.fire("change");g.splice(this.index+1,g.length-this.index-1);g.length==this.limit&&g.shift();this.index=g.push(c)-1;this.currentImage=c;!1!==d&&this.refreshState();return!0},restoreImage:function(a){var c=this.editor,d;a.bookmarks&&(c.focus(),d=c.getSelection());this.locked={level:999};this.editor.loadSnapshot(a.contents);
|
|
1145
|
+
a.bookmarks?d.selectBookmarks(a.bookmarks):CKEDITOR.env.ie&&(d=this.editor.document.getBody().$.createTextRange(),d.collapse(!0),d.select());this.locked=null;this.index=a.index;this.currentImage=this.snapshots[this.index];this.update();this.refreshState();c.fire("change")},getNextImage:function(a){var c=this.snapshots,d=this.currentImage,e;if(d)if(a)for(e=this.index-1;0<=e;e--){if(a=c[e],!d.equalsContent(a))return a.index=e,a}else for(e=this.index+1;e<c.length;e++)if(a=c[e],!d.equalsContent(a))return a.index=
|
|
1146
|
+
e,a;return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){if(this.undoable()){this.save(!0);var a=this.getNextImage(!0);if(a)return this.restoreImage(a),!0}return!1},redo:function(){if(this.redoable()&&(this.save(!0),this.redoable())){var a=this.getNextImage(!1);if(a)return this.restoreImage(a),!0}return!1},update:function(a){if(!this.locked){a||(a=new e(this.editor));for(var c=this.index,d=this.snapshots;0<c&&this.currentImage.equalsContent(d[c-
|
|
1147
|
+
1]);)--c;d.splice(c,this.index-c+1,a);this.index=c;this.currentImage=a}},updateSelection:function(a){if(!this.snapshots.length)return!1;var c=this.snapshots,d=c[c.length-1];return d.equalsContent(a)&&!d.equalsSelection(a)?(this.currentImage=c[c.length-1]=a,!0):!1},lock:function(a,c){if(this.locked)this.locked.level++;else if(a)this.locked={level:1};else{var d=null;if(c)d=!0;else{var f=new e(this.editor,!0);this.currentImage&&this.currentImage.equalsContent(f)&&(d=f)}this.locked={update:d,level:1}}},
|
|
1148
|
+
unlock:function(){if(this.locked&&!--this.locked.level){var a=this.locked.update;this.locked=null;if(!0===a)this.update();else if(a){var c=new e(this.editor,!0);a.equalsContent(c)||this.update()}}},addFilterRule:function(a){this._filterRules.push(a)}};f.navigationKeyCodes={37:1,38:1,39:1,40:1,36:1,35:1,33:1,34:1};f.keyGroups={PRINTABLE:0,FUNCTIONAL:1};f.isNavigationKey=function(a){return!!f.navigationKeyCodes[a]};f.getKeyGroup=function(a){var c=f.keyGroups;return h[a]?c.FUNCTIONAL:c.PRINTABLE};f.getOppositeKeyGroup=
|
|
1149
|
+
function(a){var c=f.keyGroups;return a==c.FUNCTIONAL?c.PRINTABLE:c.FUNCTIONAL};f.ieFunctionalKeysBug=function(a){return CKEDITOR.env.ie&&f.getKeyGroup(a)==f.keyGroups.FUNCTIONAL};var e=CKEDITOR.plugins.undo.Image=function(b,c){this.editor=b;b.fire("beforeUndoImage");var d=b.getSnapshot();d&&(this.contents=a(d,b.undoManager._filterRules));c||(this.bookmarks=(d=d&&b.getSelection())&&d.createBookmarks2(!0));b.fire("afterUndoImage")},m=/\b(?:href|src|name)="[^"]*?"/gi;e.prototype={equalsContent:function(a){var c=
|
|
1150
|
+
this.contents;a=a.contents;CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)&&(c=c.replace(m,""),a=a.replace(m,""));return c!=a?!1:!0},equalsSelection:function(a){var c=this.bookmarks;a=a.bookmarks;if(c||a){if(!c||!a||c.length!=a.length)return!1;for(var d=0;d<c.length;d++){var e=c[d],f=a[d];if(e.startOffset!=f.startOffset||e.endOffset!=f.endOffset||!CKEDITOR.tools.arrayCompare(e.start,f.start)||!CKEDITOR.tools.arrayCompare(e.end,f.end))return!1}}return!0}};var k=CKEDITOR.plugins.undo.NativeEditingHandler=
|
|
1151
|
+
function(a){this.undoManager=a;this.ignoreInputEvent=!1;this.keyEventsStack=new g;this.lastKeydownImage=null};k.prototype={onKeydown:function(a){var c=a.data.getKey();if(229!==c)if(-1<CKEDITOR.tools.indexOf(l,a.data.getKeystroke()))a.data.preventDefault();else if(this.keyEventsStack.cleanUp(a),a=this.undoManager,this.keyEventsStack.getLast(c)||this.keyEventsStack.push(c),this.lastKeydownImage=new e(a.editor),f.isNavigationKey(c)||this.undoManager.keyGroupChanged(c))if(a.strokesRecorded[0]||a.strokesRecorded[1])a.save(!1,
|
|
1152
|
+
this.lastKeydownImage,!1),a.resetType()},onInput:function(){if(this.ignoreInputEvent)this.ignoreInputEvent=!1;else{var a=this.keyEventsStack.getLast();a||(a=this.keyEventsStack.push(0));this.keyEventsStack.increment(a.keyCode);this.keyEventsStack.getTotalInputs()>=this.undoManager.strokesLimit&&(this.undoManager.type(a.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(a){var c=this.undoManager;a=a.data.getKey();var d=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(a);
|
|
1153
|
+
if(!(f.ieFunctionalKeysBug(a)&&this.lastKeydownImage&&this.lastKeydownImage.equalsContent(new e(c.editor,!0))))if(0<d)c.type(a);else if(f.isNavigationKey(a))this.onNavigationKey(!0)},onNavigationKey:function(a){var c=this.undoManager;!a&&c.save(!0,null,!1)||c.updateSelection(new e(c.editor));c.resetType()},ignoreInputEventListener:function(){this.ignoreInputEvent=!0},activateInputEventListener:function(){this.ignoreInputEvent=!1},attachListeners:function(){var a=this.undoManager.editor,c=a.editable(),
|
|
1154
|
+
d=this;c.attachListener(c,"keydown",function(a){d.onKeydown(a);if(f.ieFunctionalKeysBug(a.data.getKey()))d.onInput()},null,null,999);c.attachListener(c,CKEDITOR.env.ie?"keypress":"input",d.onInput,d,null,999);c.attachListener(c,"keyup",d.onKeyup,d,null,999);c.attachListener(c,"paste",d.ignoreInputEventListener,d,null,999);c.attachListener(c,"drop",d.ignoreInputEventListener,d,null,999);a.on("afterPaste",d.activateInputEventListener,d,null,999);c.attachListener(c.isInline()?c:a.document.getDocumentElement(),
|
|
1155
|
+
"click",function(){d.onNavigationKey()},null,null,999);c.attachListener(this.undoManager.editor,"blur",function(){d.keyEventsStack.remove(9)},null,null,999)}};var g=CKEDITOR.plugins.undo.KeyEventsStack=function(){this.stack=[]};g.prototype={push:function(a){a=this.stack.push({keyCode:a,inputs:0});return this.stack[a-1]},getLastIndex:function(a){if("number"!=typeof a)return this.stack.length-1;for(var c=this.stack.length;c--;)if(this.stack[c].keyCode==a)return c;return-1},getLast:function(a){a=this.getLastIndex(a);
|
|
1156
|
+
return-1!=a?this.stack[a]:null},increment:function(a){this.getLast(a).inputs++},remove:function(a){a=this.getLastIndex(a);-1!=a&&this.stack.splice(a,1)},resetInputs:function(a){if("number"==typeof a)this.getLast(a).inputs=0;else for(a=this.stack.length;a--;)this.stack[a].inputs=0},getTotalInputs:function(){for(var a=this.stack.length,c=0;a--;)c+=this.stack[a].inputs;return c},cleanUp:function(a){a=a.data.$;a.ctrlKey||a.metaKey||this.remove(17);a.shiftKey||this.remove(16);a.altKey||this.remove(18)}}})();
|
|
1157
|
+
(function(){function a(a){function f(a){var b=!1;d.attachListener(d,"keydown",function(){var c=g.getBody().getElementsByTag(a);if(!b){for(var d=0;d<c.count();d++)c.getItem(d).setCustomData("retain",!0);b=!0}},null,null,1);d.attachListener(d,"keyup",function(){var c=g.getElementsByTag(a);b&&(1==c.count()&&!c.getItem(0).getCustomData("retain")&&CKEDITOR.tools.isEmpty(c.getItem(0).getAttributes())&&c.getItem(0).remove(1),b=!1)})}var h=this.editor;if(h&&!h.isDetached()){var g=a.document,b=g.body,c=g.getElementById("cke_actscrpt");
|
|
1158
|
+
c&&c.parentNode.removeChild(c);(c=g.getElementById("cke_shimscrpt"))&&c.parentNode.removeChild(c);(c=g.getElementById("cke_basetagscrpt"))&&c.parentNode.removeChild(c);b.contentEditable=!0;CKEDITOR.env.ie&&(b.hideFocus=!0,b.disabled=!0,b.removeAttribute("disabled"));delete this._.isLoadingData;this.$=b;g=new CKEDITOR.dom.document(g);this.setup();this.fixInitialSelection();var d=this;CKEDITOR.env.ie&&!CKEDITOR.env.edge&&g.getDocumentElement().addClass(g.$.compatMode);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&
|
|
1159
|
+
h.enterMode!=CKEDITOR.ENTER_P?f("p"):CKEDITOR.env.edge&&15>CKEDITOR.env.version&&h.enterMode!=CKEDITOR.ENTER_DIV&&f("div");if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10<CKEDITOR.env.version)g.getDocumentElement().on("mousedown",function(a){a.data.getTarget().is("html")&&setTimeout(function(){h.editable().focus()})});l(h);try{h.document.$.execCommand("2D-position",!1,!0)}catch(n){}(CKEDITOR.env.gecko||CKEDITOR.env.ie&&"CSS1Compat"==h.document.$.compatMode)&&this.attachListener(this,"keydown",function(a){var b=
|
|
1160
|
+
a.data.getKeystroke();if(33==b||34==b)if(CKEDITOR.env.ie)setTimeout(function(){h.getSelection().scrollIntoView()},0);else if(h.window.$.innerHeight>this.$.offsetHeight){var c=h.createRange();c[33==b?"moveToElementEditStart":"moveToElementEditEnd"](this);c.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(g,"blur",function(){try{g.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&this.attachListener(g,"touchend",function(){a.focus()});b=h.document.getElementsByTag("title").getItem(0);
|
|
1161
|
+
b.data("cke-title",b.getText());CKEDITOR.env.ie&&(h.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready");h.fire("contentDom");this._.isPendingFocus&&(h.focus(),this._.isPendingFocus=!1);setTimeout(function(){h.fire("dataReady")},0)},0,this)}}function l(a){function f(){var b;a.editable().attachListener(a,"selectionChange",function(){var d=a.getSelection().getSelectedElement();d&&(b&&(b.detachEvent("onresizestart",h),b=null),d.$.attachEvent("onresizestart",
|
|
1162
|
+
h),b=d.$)})}function h(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var g=a.document.$;g.execCommand("enableObjectResizing",!1,!a.config.disableObjectResizing);g.execCommand("enableInlineTableEditing",!1,!a.config.disableNativeTableHandles)}catch(b){}else CKEDITOR.env.ie&&11>CKEDITOR.env.version&&a.config.disableObjectResizing&&f(a)}function h(){var a=[];if(8<=CKEDITOR.document.$.documentMode){a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");var f=[],h;for(h in CKEDITOR.dtd.$removeEmpty)f.push("html.CSS1Compat "+
|
|
1163
|
+
h+"[contenteditable\x3dfalse]");a.push(f.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(a.push("html{height:100% !important}"),a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));a.push("html{cursor:text;*cursor:auto}");a.push("img,input,textarea{cursor:default}");return a.join("\n")}var f;CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",
|
|
1164
|
+
requiredContent:"body"});a.addMode("wysiwyg",function(h){function k(c){c&&c.removeListener();a.isDestroyed()||a.isDetached()||(a.editable(new f(a,b.$.contentWindow.document.body)),a.setData(a.getData(1),h))}var g="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",g=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent(g)+"}())":"",b=CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"'+
|
|
1165
|
+
g+'" frameBorder\x3d"0"\x3e\x3c/iframe\x3e');b.setStyles({width:"100%",height:"100%"});b.addClass("cke_wysiwyg_frame").addClass("cke_reset");g=a.ui.space("contents");g.append(b);var c=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.gecko;if(c)b.on("load",k);var d=a.title,l=a.fire("ariaEditorHelpLabel",{}).label;d&&(CKEDITOR.env.ie&&l&&(d+=", "+l),b.setAttribute("title",d));if(l){var d=CKEDITOR.tools.getNextId(),p=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+d+'" class\x3d"cke_voice_label"\x3e'+
|
|
1166
|
+
l+"\x3c/span\x3e");g.append(p,1);b.setAttribute("aria-describedby",d)}a.on("beforeModeUnload",function(a){a.removeListener();p&&p.remove()});b.setAttributes({tabIndex:a.tabIndex,allowTransparency:"true"});!c&&k();a.fire("ariaWidget",b)})}});CKEDITOR.editor.prototype.addContentsCss=function(a){var f=this.config,h=f.contentsCss;CKEDITOR.tools.isArray(h)||(f.contentsCss=h?[h]:[]);f.contentsCss.push(a)};f=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments);this._.frameLoadedHandler=
|
|
1167
|
+
CKEDITOR.tools.addFunction(function(e){CKEDITOR.tools.setTimeout(a,0,this,e)},this);this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(a,f){var k=this.editor;if(f)this.setHtml(a),this.fixInitialSelection(),k.fire("dataReady");else{this._.isLoadingData=!0;k._.dataStore={id:1};var g=k.config,b=g.fullPage,c=g.docType,d=CKEDITOR.tools.buildStyleHtml(h()).replace(/<style>/,'\x3cstyle data-cke-temp\x3d"1"\x3e');b||(d+=CKEDITOR.tools.buildStyleHtml(k.config.contentsCss));
|
|
1168
|
+
var l=g.baseHref?'\x3cbase href\x3d"'+g.baseHref+'" data-cke-temp\x3d"1" /\x3e':"";b&&(a=a.replace(/<!DOCTYPE[^>]*>/i,function(a){k.docType=c=a;return""}).replace(/<\?xml\s[^\?]*\?>/i,function(a){k.xmlDeclaration=a;return""}));a=k.dataProcessor.toHtml(a);b?(/<body[\s|>]/.test(a)||(a="\x3cbody\x3e"+a),/<html[\s|>]/.test(a)||(a="\x3chtml\x3e"+a+"\x3c/html\x3e"),/<head[\s|>]/.test(a)?/<title[\s|>]/.test(a)||(a=a.replace(/<head[^>]*>/,"$\x26\x3ctitle\x3e\x3c/title\x3e")):a=a.replace(/<html[^>]*>/,"$\x26\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e"),
|
|
1169
|
+
l&&(a=a.replace(/<head[^>]*?>/,"$\x26"+l)),a=a.replace(/<\/head\s*>/,d+"$\x26"),a=c+a):a=g.docType+'\x3chtml dir\x3d"'+g.contentsLangDirection+'" lang\x3d"'+(g.contentsLanguage||k.langCode)+'"\x3e\x3chead\x3e\x3ctitle\x3e'+this._.docTitle+"\x3c/title\x3e"+l+d+"\x3c/head\x3e\x3cbody"+(g.bodyId?' id\x3d"'+g.bodyId+'"':"")+(g.bodyClass?' class\x3d"'+g.bodyClass+'"':"")+"\x3e"+a+"\x3c/body\x3e\x3c/html\x3e";CKEDITOR.env.gecko&&(a=a.replace(/<body/,'\x3cbody contenteditable\x3d"true" '),2E4>CKEDITOR.env.version&&
|
|
1170
|
+
(a=a.replace(/<body[^>]*>/,"$\x26\x3c!-- cke-content-start --\x3e")));g='\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"'+(CKEDITOR.env.ie?' defer\x3d"defer" ':"")+"\x3evar wasLoaded\x3d0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction("+this._.frameLoadedHandler+",window);wasLoaded\x3d1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"\x3c/script\x3e";CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(g+='\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e');
|
|
1171
|
+
l&&CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(g+='\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');a=a.replace(/(?=\s*<\/(:?head)>)/,g);this.clearCustomData();this.clearListeners();k.fire("contentDomUnload");var p=this.getDocument();try{p.write(a)}catch(q){setTimeout(function(){p.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();a=this.editor;var f=a.config,h=f.fullPage,g=h&&a.docType,b=h&&a.xmlDeclaration,
|
|
1172
|
+
c=this.getDocument(),h=h?c.getDocumentElement().getOuterHtml():c.getBody().getHtml();CKEDITOR.env.gecko&&f.enterMode!=CKEDITOR.ENTER_BR&&(h=h.replace(/<br>(?=\s*(:?$|<\/body>))/,""));h=a.dataProcessor.toDataFormat(h);b&&(h=b+"\n"+h);g&&(h=g+"\n"+h);return h},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:f.baseProto.focus.call(this)},detach:function(){var a=this.editor,h=a.document,a=a.container.findOne("iframe.cke_wysiwyg_frame");f.baseProto.detach.call(this);this.clearCustomData(this._.expandoNumber);
|
|
1168
1173
|
h.getDocumentElement().clearCustomData();CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);a&&(a.clearCustomData(),(h=a.removeCustomData("onResize"))&&h.removeListener(),a.isDetached()||a.remove())}}})})();CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;CKEDITOR.plugins.add("interactionsource",{lang:"en",requires:"dialog",icons:"sourcedialog,sourcedialog-rtl",hidpi:!0,init:function(a){function l(a){if(!a||"function"!==
|
|
1169
1174
|
typeof a.getName||"div"!==a.getName())return!1;try{var e=a.getAttribute("class")||"",b=a.getAttribute("data-units")||"";if(-1!==e.indexOf("col-12")&&"12"===b)return!0;a=["grid-row","qti-itemBody","item-editor-drop-area"];for(b=0;b<a.length;b++)if(-1!==e.indexOf(a[b]))return!0;return!1}catch(c){return console.error("Error in isBoundaryElement:",c),!1}}function h(a){if(!a||"function"!==typeof a.getName||"function"!==typeof a.getAttribute)return!1;try{if("div"===a.getName()&&!a.getAttribute("data-qti-class")){if(l(a))return!1;
|
|
1170
1175
|
if("function"===typeof a.hasClass&&a.hasClass("custom-interaction-wrapper"))return!0;if("function"===typeof a.getChildren){var e=a.getChildren();for(a=0;a<e.count();a++){var b=e.getItem(a);if(f(b))return!0}}}return!1}catch(c){return console.error("Error in isCustomWrapperDiv:",c),!1}}function f(a){if(!a||"function"!==typeof a.getAttribute)return!1;try{return a.getAttribute("data-serial")&&a.getAttribute("data-qti-class")}catch(e){return console.error("Error in isInteractionElement:",e),!1}}function e(){try{a.interactionElement=
|
|
1171
|
-
null;a.interactionWrapper=null;var e=a.getSelection(),
|
|
1172
|
-
if(f(
|
|
1173
|
-
"function"===typeof e.getChildren)for(var b=e.getChildren(),
|
|
1176
|
+
null;a.interactionWrapper=null;var e=a.getSelection(),g=e&&e.getStartElement();if(g){var b;if(g)try{for(var c=g,e=!1,g=null;c&&!e;){if(f(c))if(e=!0,a.interactionElement=c,"function"===typeof c.getParent){var d=c.getParent();h(d)?a.interactionWrapper=d:a.interactionWrapper=null}else a.interactionWrapper=null;else h(c)&&(g=c);if("function"===typeof c.getParent){if(c=c.getParent(),l(c))break}else break}if(!e&&g&&"function"===typeof g.getChildren)for(var n=g.getChildren(),d=0;d<n.count();d++){var p=n.getItem(d);
|
|
1177
|
+
if(f(p)){a.interactionElement=p;a.interactionWrapper=g;e=!0;break}}b=e}catch(q){console.error("Error in findInteractionFromElement:",q),b=!1}else b=!1;if(b)return!0}var y=a.editable();return y&&m(y)?!0:!1}catch(t){return console.error("Error in findInteractionAndWrapper:",t),!1}}function m(e){if(!e)return!1;try{if(f(e)){a.interactionElement=e;if("function"===typeof e.getParent){var g=e.getParent();h(g)?a.interactionWrapper=g:a.interactionWrapper=null}else a.interactionWrapper=null;return!0}if(h(e)&&
|
|
1178
|
+
"function"===typeof e.getChildren)for(var b=e.getChildren(),g=0;g<b.count();g++){var c=b.getItem(g);if(f(c))return a.interactionElement=c,a.interactionWrapper=e,!0}if("function"===typeof e.getChildren){var d=e.getChildren();for(e=0;e<d.count();e++)if(m(d.getItem(e)))return!0}return!1}catch(l){return console.error("Error in scanForInteractions:",l),!1}}a.addCommand("interactionsource",new CKEDITOR.dialogCommand("interactionsourcedialog"));CKEDITOR.dialog.add("interactionsourcedialog",this.path+"dialogs/interactionsource.js");
|
|
1174
1179
|
a.ui.addButton("InteractionSource",{label:a.lang.interactionsource.toolbar,command:"interactionsource",icon:"sourcedialog",toolbar:"mode,11"});a.on("selectionChange",function(){e()});a.findInteractionAndWrapper=e}});CKEDITOR.config.plugins="basicstyles,bidi,blockquote,dialogui,dialog,notification,button,toolbar,clipboard,panelbutton,panel,floatpanel,colorbutton,colordialog,copyformatting,menu,contextmenu,confighelper,dialogadvtab,entities,floatingspace,listblock,richcombo,font,format,htmlwriter,indent,indentlist,indentblock,taotab,taountab,justify,fakeobjects,link,list,liststyle,magicline,pastetools,pastefromlibreoffice,pastefromword,pastetext,removeformat,resize,selectall,sharedspace,sourcearea,sourcedialog,specialchar,stylescombo,tab,table,tabletools,tableselection,taoqtiimage,taoqtimaths,taoqtimedia,taoqtitable,menubutton,taounderline,taotooltip,taohighlight,taoqtiinclude,taoqtiprintedvariable,taofurigana,undo,wysiwygarea,interactionsource";
|
|
1175
1180
|
CKEDITOR.config.skin="tao";(function(){var a=function(a,h){var f=CKEDITOR.getUrl("plugins/"+h);a=a.split(",");for(var e=0;e<a.length;e++)CKEDITOR.skin.icons[a[e]]={path:f,offset:-a[++e],bgsize:a[++e]}};CKEDITOR.env.hidpi?a("about,0,,bold,24,,italic,48,,strike,72,,subscript,96,,superscript,120,,underline,144,,bidiltr,168,,bidirtl,192,,blockquote,216,,copy-rtl,240,,copy,264,,cut-rtl,288,,cut,312,,paste-rtl,336,,paste,360,,codesnippet,384,,bgcolor,408,,textcolor,432,,copyformatting,456,,creatediv,480,,docprops-rtl,504,,docprops,528,,easyimagealigncenter,552,,easyimagealignleft,576,,easyimagealignright,600,,easyimagealt,624,,easyimagefull,648,,easyimageside,672,,easyimageupload,696,,embed,720,,embedsemantic,744,,emojipanel,768,,find-rtl,792,,find,816,,replace,840,,flash,864,,button,888,,checkbox,912,,form,936,,hiddenfield,960,,imagebutton,984,,radio,1008,,select-rtl,1032,,select,1056,,textarea-rtl,1080,,textarea,1104,,textfield-rtl,1128,,textfield,1152,,horizontalrule,1176,,iframe,1200,,image,1224,,indent-rtl,1248,,indent,1272,,outdent-rtl,1296,,outdent,1320,,interactionsource,2688,auto,justifyblock,1368,,justifycenter,1392,,justifyleft,1416,,justifyright,1440,,anchor-rtl,1464,,anchor,1488,,link,1512,,unlink,1536,,bulletedlist-rtl,1560,,bulletedlist,1584,,numberedlist-rtl,1608,,numberedlist,1632,,mathjax,1656,,maximize,1680,,newpage-rtl,1704,,newpage,1728,,pagebreak-rtl,1752,,pagebreak,1776,,pastefromword-rtl,1800,,pastefromword,1824,,pastetext-rtl,1848,,pastetext,1872,,placeholder,1896,,preview-rtl,1920,,preview,1944,,print,1968,,removeformat,1992,,save,2016,,selectall,2040,,showblocks-rtl,2064,,showblocks,2088,,smiley,2112,,source-rtl,2136,,source,2160,,sourcedialog-rtl,2184,,sourcedialog,2208,,specialchar,2232,,table,2256,,language,2280,,templates-rtl,2304,,templates,2328,,uicolor,2352,,redo-rtl,2376,,redo,2400,,undo-rtl,2424,,undo,2448,,simplebox,4944,auto",
|
|
1176
1181
|
"icons_hidpi.png"):a("about,0,auto,bold,24,auto,italic,48,auto,strike,72,auto,subscript,96,auto,superscript,120,auto,underline,144,auto,bidiltr,168,auto,bidirtl,192,auto,blockquote,216,auto,copy-rtl,240,auto,copy,264,auto,cut-rtl,288,auto,cut,312,auto,paste-rtl,336,auto,paste,360,auto,codesnippet,384,auto,bgcolor,408,auto,textcolor,432,auto,copyformatting,456,auto,creatediv,480,auto,docprops-rtl,504,auto,docprops,528,auto,easyimagealigncenter,552,auto,easyimagealignleft,576,auto,easyimagealignright,600,auto,easyimagealt,624,auto,easyimagefull,648,auto,easyimageside,672,auto,easyimageupload,696,auto,embed,720,auto,embedsemantic,744,auto,emojipanel,768,auto,find-rtl,792,auto,find,816,auto,replace,840,auto,flash,864,auto,button,888,auto,checkbox,912,auto,form,936,auto,hiddenfield,960,auto,imagebutton,984,auto,radio,1008,auto,select-rtl,1032,auto,select,1056,auto,textarea-rtl,1080,auto,textarea,1104,auto,textfield-rtl,1128,auto,textfield,1152,auto,horizontalrule,1176,auto,iframe,1200,auto,image,1224,auto,indent-rtl,1248,auto,indent,1272,auto,outdent-rtl,1296,auto,outdent,1320,auto,interactionsource,1344,auto,justifyblock,1368,auto,justifycenter,1392,auto,justifyleft,1416,auto,justifyright,1440,auto,anchor-rtl,1464,auto,anchor,1488,auto,link,1512,auto,unlink,1536,auto,bulletedlist-rtl,1560,auto,bulletedlist,1584,auto,numberedlist-rtl,1608,auto,numberedlist,1632,auto,mathjax,1656,auto,maximize,1680,auto,newpage-rtl,1704,auto,newpage,1728,auto,pagebreak-rtl,1752,auto,pagebreak,1776,auto,pastefromword-rtl,1800,auto,pastefromword,1824,auto,pastetext-rtl,1848,auto,pastetext,1872,auto,placeholder,1896,auto,preview-rtl,1920,auto,preview,1944,auto,print,1968,auto,removeformat,1992,auto,save,2016,auto,selectall,2040,auto,showblocks-rtl,2064,auto,showblocks,2088,auto,smiley,2112,auto,source-rtl,2136,auto,source,2160,auto,sourcedialog-rtl,2184,auto,sourcedialog,2208,auto,specialchar,2232,auto,table,2256,auto,language,2280,auto,templates-rtl,2304,auto,templates,2328,auto,uicolor,2352,auto,redo-rtl,2376,auto,redo,2400,auto,undo-rtl,2424,auto,undo,2448,auto,simplebox,2472,auto",
|