@oat-sa/tao-core-shared-libs 1.11.1 → 1.11.3
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 +506 -499
- 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/.claude/settings.local.json +0 -9
- package/lib/ckeditor/.qodo/history.sqlite +0 -0
- package/lib/ckeditor/.qodo/indexes.sqlite +0 -0
package/lib/ckeditor/ckeditor.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
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:"Q48A",version:"4.14.1 TAO-3.4 DEV",revision:"c948ca084",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"),g=0;g<h.length;g++){var k=h[g].src.match(a);if(k){f=k[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
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(k){}}function f(){for(var a;a=g.shift();)a()}var g=[];return function(k){function b(){try{document.documentElement.doScroll("left")}catch(d){setTimeout(b,1);return}a()}g.push(k);"complete"===document.readyState&&setTimeout(a,1);if(1==g.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",
|
|
8
8
|
a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",a);window.attachEvent("onload",a);k=!1;try{k=!window.frameElement}catch(c){}document.documentElement.doScroll&&k&&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,g,k){function b(d,n,b
|
|
10
|
-
data:n,listenerData:g,stop:
|
|
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,g=function(){h=1};return function(k,b,c){var d=l(this)[k];k=a;var n=h;a=h=0;if(d){var
|
|
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,k){function b(d,n,a,b){d={name:f,sender:this,editor:d,
|
|
10
|
+
data:n,listenerData:g,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(k)&&(k=10);var n=this;b.fn=e;b.priority=k;for(var t=d.length-1;0<=t;t--)if(d[t].priority<=k)return d.splice(t+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,g=function(){h=1};return function(k,b,c){var d=l(this)[k];k=a;var n=h;a=h=0;if(d){var t=d.listeners;if(t.length)for(var t=t.slice(0),w,y=0;y<t.length;y++){if(d.errorProof)try{w=t[y].call(this,c,b,e,g)}catch(r){}else w=t[y].call(this,c,b,e,g);!1===w?h=1:"undefined"!=typeof w&&(b=w);if(a||h)break}}b=
|
|
12
12
|
h?!1:"undefined"==typeof b?!0:b;a=k;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 g=h.getListenerIndex(e);0<=g&&h.listeners.splice(g,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=
|
|
@@ -18,44 +18,44 @@ CKEDITOR.loadFullCore=function(){if("basic_ready"!=CKEDITOR.status)CKEDITOR.load
|
|
|
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
20
|
d;this._context=b;this._lastOutput=this._scheduledTimer=0;this._output=CKEDITOR.tools.bind(a,b||{});var k=this;this.input=function(){function d(){k._lastOutput=(new Date).getTime();k._scheduledTimer=0;k._call()}if(!k._scheduledTimer||!1!==k._reschedule()){var n=(new Date).getTime()-k._lastOutput;n<k._minInterval?k._scheduledTimer=setTimeout(d,k._minInterval-n):d()}}}function l(d,b,k){a.call(this,d,b,k);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,g=/</g,k=/"/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,
|
|
22
|
-
for(var
|
|
23
|
-
capitalize:function(d,
|
|
24
|
-
{},
|
|
25
|
-
function(d){return d.substr(1).toUpperCase()})}}(),buildStyleHtml:function(d){d=[].concat(d);for(var b
|
|
26
|
-
"\x26quot;")},htmlDecodeAttr:function(d){return CKEDITOR.tools.htmlDecode(d)},transformPlainTextToHtml:function(d,
|
|
27
|
-
2)}));k=k.replace(/^ | $/g,"\x26nbsp;");return k=k.replace(/(>|\s) /g,function(d,
|
|
28
|
-
c);return c.setTimeout(function(){k?d.apply(
|
|
29
|
-
|
|
30
|
-
d[
|
|
31
|
-
h[d];return
|
|
32
|
-
|
|
33
|
-
!0,
|
|
34
|
-
b
|
|
35
|
-
objectCompare:function(d,b
|
|
36
|
-
d}return!!d},eventsBuffer:function(d,b
|
|
37
|
-
|
|
38
|
-
e.push(String.fromCharCode(k))));return{display:f,aria:e}},transparentImageData:"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw\x3d\x3d",getCookie:function(d){d=d.toLowerCase();for(var
|
|
39
|
-
";path\x3d/"},getCsrfToken:function(){var d=CKEDITOR.tools.getCookie("ckCsrfToken");if(!d||40!=d.length){var d=[],
|
|
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,
|
|
41
|
-
c[1]===d)return c[0]}},convertHexStringToBytes:function(d){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,g=/</g,k=/"/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
|
+
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,k;"boolean"==typeof(b=arguments[a-1])?a--:"boolean"==typeof(b=arguments[a-2])&&(k=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(!k||a in k)d[a]=f[a]})}return d},prototypedCopy:function(d){var a=function(){};a.prototype=d;return new a},copy:function(d){var a=
|
|
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=[],k=0;k<d.length;k++)if(a=d[k])/@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(g,"\x26lt;")},htmlDecode:function(a){return a.replace(b,d)},htmlEncodeAttr:function(d){return CKEDITOR.tools.htmlEncode(d).replace(k,
|
|
26
|
+
"\x26quot;")},htmlDecodeAttr:function(d){return CKEDITOR.tools.htmlDecode(d)},transformPlainTextToHtml:function(d,a){var b=a==CKEDITOR.ENTER_BR,k=this.htmlEncode(d.replace(/\r\n/g,"\n")),k=k.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;"),c=a==CKEDITOR.ENTER_P?"p":"div";if(!b){var f=/\n{2}/g;if(f.test(k))var e="\x3c"+c+"\x3e",g="\x3c/"+c+"\x3e",k=e+k.replace(f,function(){return g+e})+g}k=k.replace(/\n/g,"\x3cbr\x3e");b||(k=k.replace(new RegExp("\x3cbr\x3e(?\x3d\x3c/"+c+"\x3e)"),function(d){return CKEDITOR.tools.repeat(d,
|
|
27
|
+
2)}));k=k.replace(/^ | $/g,"\x26nbsp;");return k=k.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,k,c){c||(c=window);b||(b=
|
|
28
|
+
c);return c.setTimeout(function(){k?d.apply(b,[].concat(k)):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,k=d.length;b<k;b++){if(a(d[b]))return b}else{if(d.indexOf)return d.indexOf(a);
|
|
29
|
+
b=0;for(k=d.length;b<k;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,k=d.privates||d._,c=d.proto;d=d.statics;!a&&(a=function(){b&&this.base.apply(this,arguments)});if(k)var f=a,a=function(){var d=this._||(this._={}),a;for(a in k){var b=k[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 u(){this.base=b.prototype.base;b.apply(this,arguments);this.base=u});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
|
+
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 k=arguments[a];try{d=k();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=[],k,c=CKEDITOR.tools.parseCssText(d,
|
|
33
|
+
!0,a);for(k in c)b.push(k+":"+c[k]);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,k){d=[a,b,k];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,k){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+k})},parseCssText:function(d,
|
|
34
|
+
a,b){var k={};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 k;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));k[b]=n});return k},writeCssText:function(d,a){var b,k=[];for(b in d)k.push(b+":"+d[b]);a&&k.sort();return k.join("; ")},
|
|
35
|
+
objectCompare:function(d,a,b){var k;if(!d&&!a)return!0;if(!d||!a)return!1;for(k in d)if(d[k]!=a[k])return!1;if(!b)for(k in a)if(d[k]!=a[k])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 k=0,c=d.length;k<c;++k)b[d[k]]=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(" "),k=b.length,c;k--;)c=d.createElement(b[k]),a&&d.appendChild(c)},checkIfAnyArrayItemMatches:function(d,a){for(var b=0,k=d.length;b<k;++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,k=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]));k&&(d[k]?(f.push(d[k]),e.push(d[k])):(f.push(String.fromCharCode(k)),
|
|
38
|
+
e.push(String.fromCharCode(k))));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,k,c=0;c<a.length;c++)if(b=a[c].split("\x3d"),k=decodeURIComponent(CKEDITOR.tools.trim(b[0]).toLowerCase()),k===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 k="abcdefghijklmnopqrstuvwxyz0123456789".charAt(d[b]%36),a=a+(.5<Math.random()?k.toUpperCase():k);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]],k=0;k<b.length;k++){var c=b[k];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,k;for(k=0;k<b;k++)a.push(parseInt(d.substr(2*k,2),16));return a},convertBytesToBase64:function(d){var a="",b=d.length,k;for(k=0;k<b;k+=3){var c=d.slice(k,k+3),f=c.length,e=[],g;if(3>f)for(g=f;3>g;g++)c[g]=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(g=0;4>g;g++)a=g<=f?a+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e[g]):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",
|
|
45
45
|
lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",
|
|
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
|
-
_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
|
|
49
|
-
function(d){return d.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset|revert)/g)||["0px"]})},sideShorthand:function(d,
|
|
50
|
-
[]),
|
|
51
|
-
b
|
|
52
|
-
function(
|
|
53
|
-
return
|
|
54
|
-
var k=CKEDITOR.tools.copy(
|
|
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
|
|
56
|
-
this[d];
|
|
57
|
-
d)?!
|
|
58
|
-
k]=new CKEDITOR.tools.style.border(c);return
|
|
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){k.top=c[d[0]];k.right=c[d[1]];k.bottom=c[d[2]];k.left=c[d[3]]}var k={},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 k},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 k=[];this.forEach(d,function(c,f){a.call(b,c,f,d)&&k.push(c)});return k},find:function(d,a,b){for(var k=d.length,c=0;c<k;){if(a.call(b,d[c],c,d))return d[c];c++}},forEach:function(d,a,b){var k=d.length,c;for(c=0;c<k;c++)a.call(b,d[c],c,d)},map:function(d,
|
|
51
|
+
a,b){for(var k=[],c=0;c<d.length;c++)k.push(a.call(b,d[c],c,d));return k},reduce:function(d,a,b,k){for(var c=0;c<d.length;c++)b=a.call(k,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 k=0;k<d.length;k++)if(a.call(b,d[k],k,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=[],k=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<k.length;c++)a.call(d,k[c])&&b.push(k[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,k=b.clone(d),c=b.clone(a);b.array.forEach(b.object.keys(c),function(d){k[d]="object"===typeof c[d]&&"object"===typeof k[d]?b.object.merge(k[d],c[d]):c[d]});return k}},getAbsoluteRectPosition:function(d,a){function b(d){if(d){var a=d.getClientRect();k.top+=a.top;k.left+=a.left;"x"in k&&"y"in k&&(k.x+=a.x,k.y+=a.y);b(d.getWindow().getFrame())}}
|
|
54
|
+
var k=CKEDITOR.tools.copy(a);b(d.getFrame());var c=CKEDITOR.document.getWindow().getScrollPosition();k.top+=c.y;k.left+=c.x;"x"in k&&"y"in k&&(k.y+=c.y,k.x+=c.x);k.right=k.left+k.width;k.bottom=k.top+k.height;return k}};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
|
+
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
|
+
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,k){var c=d["border-"+k]||a[k];b[k]=c?CKEDITOR.tools.style.parse.sideShorthand(c):null;return b},{});return CKEDITOR.tools.array.reduce(["top","right","bottom","left"],function(a,k){var c={},f;for(f in b){var e=d["border-"+k+"-"+f];c[f]=e?e:b[f]&&b[f][k]}a["border-"+
|
|
58
|
+
k]=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),k=1;k<arguments.length;k++){d=arguments[k];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
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},g={},k={"#":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
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},k,{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:g,article:f,aside:f,audio:a({source:1,track:1},f),b:h,base:g,bdi:h,bdo:h,blockquote:f,body:f,br:g,button:l(h,{a:1,button:1}),canvas:h,caption:f,cite:h,code:h,col:g,colgroup:{col:1},command:g,datalist:a({option:1},h),dd:f,del:h,details:a({summary:1},
|
|
61
61
|
f),dfn:h,div:f,dl:{dt:1,dd:1},dt:f,em:h,embed:g,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:g,html:a({head:1,body:1},f,m),i:h,iframe:k,img:g,input:g,ins:h,kbd:h,keygen:g,label:h,legend:h,li:f,link:g,main:f,map:f,mark:h,menu:a({li:1},f),meta:g,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},
|
|
@@ -116,11 +116,11 @@ arguments)}catch(d){}else a.apply(this,arguments);return this}:a}(),setAttribute
|
|
|
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 g=this.$.getBoundingClientRect(),h=d.$.documentElement,m=h.clientTop||f.$.clientTop||0,
|
|
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(;
|
|
119
|
+
8!==CKEDITOR.env.version:1)){var g=this.$.getBoundingClientRect(),h=d.$.documentElement,m=h.clientTop||f.$.clientTop||0,v=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=g.left+b-v,c=g.top+c-m)}else for(m=this,v=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(;v&&!v.equals(m);)b-=v.$.scrollLeft,c-=v.$.scrollTop,v=v.getParent();v=m;m=(g=m.$.offsetParent)?new CKEDITOR.dom.element(g):null}a&&(g=this.getWindow(),m=a.getWindow(),!g.equals(m)&&g.$.frameElement&&(a=(new CKEDITOR.dom.element(g.$.frameElement)).getDocumentPosition(a),b+=a.x,c+=a.y));document.documentElement.getBoundingClientRect||!CKEDITOR.env.gecko||
|
|
121
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,g;function h(d,b){/body|html/.test(a.getName())?
|
|
122
|
-
a.getWindow().$.scrollBy(d,b):(a.$.scrollLeft+=d,a.$.scrollTop+=b)}function m(d
|
|
123
|
-
CKEDITOR.env.webkit&&(e=this.getEditor(!1))&&(e._.previousScrollTop=null);e=a.getWindow();f=m(this,e);var
|
|
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 v(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 u=m(a,e),D=this.$.offsetHeight;d=this.$.offsetWidth;var p=a.$.clientHeight,x=a.$.clientWidth;e=f.x-v(this,"left")-u.x||0;g=f.y-v(this,"top")-u.y||0;d=f.x+d+v(this,"right")-(u.x+x)||0;f=f.y+D+v(this,"bottom")-(u.y+p)||0;(0>g||0<f)&&h(0,!0===b?g:!1===b?f:0>g?g: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
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(),g;if(!(e in b))if("checked"==e&&(g=this.getAttribute(e)))a.setAttribute(e,g);else if(!CKEDITOR.env.ie||this.hasAttribute(e))g=this.getAttribute(e),null===g&&(g=f.nodeValue),a.setAttribute(e,g)}""!==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,
|
|
@@ -130,9 +130,9 @@ a)));b();return a},findOne:function(a){var b=l(this);a=this.$.querySelector(h(th
|
|
|
130
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 g={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
|
-
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,
|
|
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 A=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||!A.equals(a))&&(!G||!a.equals(G))&&(a.type!=CKEDITOR.NODE_ELEMENT||!d||!a.equals(b.root))}}var
|
|
135
|
-
h,
|
|
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 A=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||!A.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
|
+
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);
|
|
@@ -140,11 +140,11 @@ return!!(a^b)}};CKEDITOR.dom.walker.invisible=function(a){var d=CKEDITOR.dom.wal
|
|
|
140
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(),g=CKEDITOR.dom.walker.bookmark(),k=CKEDITOR.dom.walker.temp(),b=function(a){return g(a)||m(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$inline)&&!a.is(CKEDITOR.dtd.$empty)};
|
|
141
141
|
CKEDITOR.dom.walker.ignored=function(a){return function(d){d=m(d)||g(d)||k(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(
|
|
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;p||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
|
+
J.length);for(a=0;a<c;a++)if(d=H[a],b=J[a],!d.equals(b))return a;return a-1}function h(){var b=F-1,c=M&&I&&!x.equals(q);b<K-1||b<O-1||c?(c?a.moveToPosition(q,CKEDITOR.POSITION_BEFORE_START):O==b+1&&G?a.moveToPosition(J[b],CKEDITOR.POSITION_BEFORE_END):a.moveToPosition(J[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,p=2==b;b=p||l;var x=a.startContainer,q=a.endContainer,B=a.startOffset,C=a.endOffset,A,G,M,I,E,L;if(p&&q.type==CKEDITOR.NODE_TEXT&&(x.equals(q)||x.type===CKEDITOR.NODE_ELEMENT&&x.getFirst().equals(q)))c.append(a.document.createText(q.substring(B,C)));else{q.type==CKEDITOR.NODE_TEXT?p?L=!0:q=q.split(C):0<q.getChildCount()?C>=q.getChildCount()?(q=q.getChild(C-1),G=!0):q=q.getChild(C):I=G=!0;x.type==
|
|
146
|
+
CKEDITOR.NODE_TEXT?p?E=!0:x.split(B):0<x.getChildCount()?0===B?(x=x.getChild(B),A=!0):x=x.getChild(B-1):M=A=!0;for(var H=x.getParents(),J=q.getParents(),F=k(),K=H.length-1,O=J.length-1,N=c,Y,S,Z,ia=-1,W=F;W<=K;W++){S=H[W];Z=S.getNext();for(W!=K||S.equals(J[W])&&K<O?b&&(Y=N.append(S.clone(0,e))):A?g(S,N,!1,M):E&&N.append(a.document.createText(S.substring(B)));Z;){if(Z.equals(J[W])){ia=W;break}Z=g(Z,N)}N=Y}N=c;for(W=F;W<=O;W++)if(c=J[W],Z=c.getPrevious(),c.equals(H[W]))b&&(N=N.getChild(0));else{W!=
|
|
147
|
+
O||c.equals(H[W])&&O<K?b&&(Y=N.append(c.clone(0,e))):G?g(c,N,!1,I):L&&N.append(a.document.createText(c.substring(0,C)));if(W>ia)for(;Z;)Z=g(Z,N,!0);N=Y}p||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
148
|
c=CKEDITOR.dom.walker.bookmark(1);return function(f){return c(f)||b(f)?!0:!a&&g(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)&&!(g(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},g=CKEDITOR.dom.walker.bogus(),
|
|
149
149
|
k=/^[\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&&
|
|
@@ -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;A=c!=a?c.getText():c.substring(d);if(f.test(A))return!1}return!0};if(this.collapsed)break;var k=this.getCommonAncestor(),h=this.root,m,l,
|
|
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;A=c!=a?c.getText():c.substring(d);if(f.test(A))return!1}return!0};if(this.collapsed)break;var k=this.getCommonAncestor(),h=this.root,m,l,p,x,q,B=!1,C,A;C=this.startContainer;var G=this.startOffset;C.type==CKEDITOR.NODE_TEXT?
|
|
162
|
+
(G&&(C=!CKEDITOR.tools.trim(C.substring(0,G)).length&&C,B=!!C),C&&((x=C.getPrevious())||(p=C.getParent()))):(G&&(x=C.getChild(G-1)||C.getLast()),x||(p=C));for(p=c(p);p||x;){if(p&&!x){!q&&p.equals(k)&&(q=!0);if(e?p.isBlockBoundary():!h.contains(p))break;B&&"inline"==p.getComputedStyle("display")||(B=!1,q?m=p:this.setStartBefore(p));x=p.getPrevious()}for(;x;)if(C=!1,x.type==CKEDITOR.NODE_COMMENT)x=x.getPrevious();else{if(x.type==CKEDITOR.NODE_TEXT)A=x.getText(),f.test(A)&&(x=null),C=/[\s\ufeff]$/.test(A);
|
|
163
|
+
else if((x.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||b&&x.is("br"))&&!x.data("cke-bookmark"))if(B&&CKEDITOR.dtd.$removeEmpty[x.getName()]){A=x.getText();if(f.test(A))x=null;else for(var G=x.$.getElementsByTagName("*"),M=0,I;I=G[M++];)if(!CKEDITOR.dtd.$removeEmpty[I.nodeName.toLowerCase()]){x=null;break}x&&(C=!!A.length)}else x=null;C&&(B?q?m=p:p&&this.setStartBefore(p):B=!0);if(x){C=x.getPrevious();if(!p&&!C){p=x;x=null;break}x=C}else p=null}p&&(p=c(p.getParent()))}C=this.endContainer;G=this.endOffset;
|
|
164
|
+
p=x=null;q=B=!1;C.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(C.substring(G)).length?B=!0:(B=!C.getLength(),G==C.getLength()?(x=C.getNext())||(p=C.getParent()):g(C,G)&&(p=C.getParent())):(x=C.getChild(G))||(p=C);for(;p||x;){if(p&&!x){!q&&p.equals(k)&&(q=!0);if(e?p.isBlockBoundary():!h.contains(p))break;B&&"inline"==p.getComputedStyle("display")||(B=!1,q?l=p:p&&this.setEndAfter(p));x=p.getNext()}for(;x;){C=!1;if(x.type==CKEDITOR.NODE_TEXT)A=x.getText(),g(x,0)||(x=null),C=/^[\s\ufeff]/.test(A);else if(x.type==
|
|
165
|
+
CKEDITOR.NODE_ELEMENT){if((0<x.$.offsetWidth||b&&x.is("br"))&&!x.data("cke-bookmark"))if(B&&CKEDITOR.dtd.$removeEmpty[x.getName()]){A=x.getText();if(f.test(A))x=null;else for(G=x.$.getElementsByTagName("*"),M=0;I=G[M++];)if(!CKEDITOR.dtd.$removeEmpty[I.nodeName.toLowerCase()]){x=null;break}x&&(C=!!A.length)}else x=null}else C=1;C&&B&&(q?l=p:this.setEndAfter(p));if(x){C=x.getNext();if(!p&&!C){p=x;x=null;break}x=C}else p=null}p&&(p=c(p.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:p=new CKEDITOR.dom.range(this.root);h=this.root;p.setStartAt(h,CKEDITOR.POSITION_AFTER_START);p.setEnd(this.startContainer,this.startOffset);p=new CKEDITOR.dom.walker(p);var E,L,H=CKEDITOR.dom.walker.blockBoundary(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),J=null,F=function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&"false"==a.getAttribute("contenteditable"))if(J){if(J.equals(a)){J=null;return}}else J=
|
|
167
|
+
a;else if(J)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};p.guard=F;p=p.lastBackward();E=E||h;this.setStartAt(E,!E.is("br")&&(!p&&this.checkStartOfBlock()||p&&E.contains(p))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){p=this.clone();p=new CKEDITOR.dom.walker(p);var K=CKEDITOR.dom.walker.whitespaces(),O=CKEDITOR.dom.walker.bookmark();p.evaluator=function(a){return!K(a)&&!O(a)};if((p=p.previous())&&
|
|
168
|
+
p.type==CKEDITOR.NODE_ELEMENT&&p.is("br"))break}p=this.clone();p.collapse();p.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);p=new CKEDITOR.dom.walker(p);p.guard=a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?e:F;E=J=L=null;p=p.lastForward();E=E||h;this.setEndAt(E,!p&&this.checkEndOfBlock()||p&&E.contains(p)?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,p=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),p=0):g.setEndBefore(h));var g=new CKEDITOR.dom.walker(g),x=CKEDITOR.dom.walker.bookmark(),q=CKEDITOR.dom.walker.bogus();g.evaluator=
|
|
170
|
+
function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var B;g.guard=function(b,c){if(e&&q(b)||x(b))return!0;if(a==CKEDITOR.SHRINK_ELEMENT&&b.type==CKEDITOR.NODE_TEXT||c&&b.equals(B)||!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||(B=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);p&&(g.reset(),(g=g[a==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(g,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END));return!(!c&&!p)}},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,
|
|
@@ -179,7 +179,7 @@ this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return f},removeEmptyBlocksAt
|
|
|
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
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)),k.test(a)&&this.trim(0,1));this.trim();a=new CKEDITOR.dom.elementPath(this.startContainer,this.root);b=this.clone();b.collapse(!0);b.setStartAt(a.block||a.blockLimit,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(b);a.evaluator=h();return a.checkBackward()},checkEndOfBlock:function(){var a=this.endContainer,
|
|
181
181
|
b=this.endOffset;CKEDITOR.env.ie&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.rtrim(a.substring(b)),k.test(a)&&this.trim(1,0));this.trim();a=new CKEDITOR.dom.elementPath(this.endContainer,this.root);b=this.clone();b.collapse(!1);b.setEndAt(a.block||a.blockLimit,CKEDITOR.POSITION_BEFORE_END);a=new CKEDITOR.dom.walker(b);a.evaluator=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
|
-
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(b
|
|
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
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()&&k.test(a.getText())?this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:
|
|
184
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,g=f,h=void 0;e.type==CKEDITOR.NODE_ELEMENT&&e.isEditable(!1)&&
|
|
185
185
|
(h=e[b?"getLast":"getFirst"](c));g||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")?
|
|
@@ -197,52 +197,52 @@ 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),g=CKEDITOR.dom.walker.whitespaces(!0),k=function(a){return m(a)&&g(a)},b={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var d,g,l,
|
|
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);g=
|
|
203
|
-
CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(
|
|
204
|
-
1;g=
|
|
205
|
-
"br"!=
|
|
206
|
-
|
|
207
|
-
"li"!=d.getName()?g.checkStartOfBlock()&&g.checkEndOfBlock()||(d=d.clone(!1),g.extractContents().appendTo(d),d.trim(),
|
|
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),g=CKEDITOR.dom.walker.whitespaces(!0),k=function(a){return m(a)&&g(a)},b={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var d,g,l,w,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 r=this.range.clone();g=r.startPath();var v=r.endPath(),z=!r.collapsed&&f(r,g.block),u=!r.collapsed&&f(r,v.block,1);r.shrink(CKEDITOR.SHRINK_ELEMENT,!0);z&&r.setStartAt(g.block,CKEDITOR.POSITION_BEFORE_END);u&&r.setEndAt(v.block,
|
|
202
|
+
CKEDITOR.POSITION_AFTER_START);g=r.endContainer.hasAscendant("pre",!0)||r.startContainer.hasAscendant("pre",!0);r.enlarge(this.forceBrBreak&&!g||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);r.collapsed||(g=new CKEDITOR.dom.walker(r.clone()),v=CKEDITOR.dom.walker.bookmark(!0,!0),g.evaluator=v,this._.nextNode=g.next(),g=new CKEDITOR.dom.walker(r.clone()),g.evaluator=v,g=g.previous(),this._.lastNode=g.getNextSourceNode(!0,null,r.root),this._.lastNode&&this._.lastNode.type==
|
|
203
|
+
CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(v=this.range.clone(),v.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),v.checkEndOfBlock()&&(v=new CKEDITOR.dom.elementPath(v.endContainer,v.root),this._.lastNode=(v.block||v.blockLimit).getNextSourceNode(!0))),this._.lastNode&&r.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=r.document.createText(""),this._.lastNode.insertAfter(g)),r=null);this._.started=
|
|
204
|
+
1;g=r}v=this._.nextNode;r=this._.lastNode;for(this._.nextNode=null;v;){var z=0,u=v.hasAscendant("pre"),D=v.type!=CKEDITOR.NODE_ELEMENT,p=0;if(D)v.type==CKEDITOR.NODE_TEXT&&e.test(v.getText())&&(D=0);else{var x=v.getName();if(CKEDITOR.dtd.$block[x]&&"false"==v.getAttribute("contenteditable")){d=v;h(this,a,d);break}else if(v.isBlockBoundary(this.forceBrBreak&&!u&&{br:1})){if("br"==x)D=1;else if(!g&&!v.getChildCount()&&"hr"!=x){d=v;l=v.equals(r);break}g&&(g.setEndAt(v,CKEDITOR.POSITION_BEFORE_START),
|
|
205
|
+
"br"!=x&&(this._.nextNode=v));z=1}else{if(v.getFirst()){g||(g=this.range.clone(),g.setStartAt(v,CKEDITOR.POSITION_BEFORE_START));v=v.getFirst();continue}D=1}}D&&!g&&(g=this.range.clone(),g.setStartAt(v,CKEDITOR.POSITION_BEFORE_START));l=(!z||D)&&v.equals(r);if(g&&!z)for(;!v.getNext(k)&&!l;){x=v.getParent();if(x.isBlockBoundary(this.forceBrBreak&&!u&&{br:1})){z=1;D=0;l||x.equals(r);g.setEndAt(x,CKEDITOR.POSITION_BEFORE_END);break}v=x;D=1;l=v.equals(r);p=1}D&&g.setEndAt(v,CKEDITOR.POSITION_AFTER_END);
|
|
206
|
+
v=this._getNextSourceNode(v,p,r);if((l=!v)||z&&g)break}if(!d){if(!g)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;d=new CKEDITOR.dom.elementPath(g.startContainer,g.root);v=d.blockLimit;z={div:1,th:1,td:1};d=d.block;!d&&v&&!this.enforceRealBlocks&&z[v.getName()]&&g.checkStartOfBlock()&&g.checkEndOfBlock()&&!v.equals(g.root)?d=v:!d||this.enforceRealBlocks&&d.is(b)?(d=this.range.document.createElement(a),g.extractContents().appendTo(d),d.trim(),g.insertNode(d),w=y=!0):
|
|
207
|
+
"li"!=d.getName()?g.checkStartOfBlock()&&g.checkEndOfBlock()||(d=d.clone(!1),g.extractContents().appendTo(d),d.trim(),y=g.splitBlock(),w=!y.wasStartOfBlock,y=!y.wasEndOfBlock,g.insertNode(d)):l||(this._.nextNode=d.equals(r)?null:this._getNextSourceNode(g.getBoundaryNodes().endNode,1,r))}w&&(w=d.getPrevious())&&w.type==CKEDITOR.NODE_ELEMENT&&("br"==w.getName()?w.remove():w.getLast()&&"br"==w.getLast().$.nodeName.toLowerCase()&&w.getLast().remove());y&&(w=d.getLast())&&w.type==CKEDITOR.NODE_ELEMENT&&
|
|
208
|
+
"br"==w.getName()&&(!CKEDITOR.env.needsBrFiller||w.getPrevious(m)||w.getNext(m))&&w.remove();this._.nextNode||(this._.nextNode=l||d.equals(r)||!r?null:this._getNextSourceNode(d,1,r));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
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,k;a=[];for(e in b){k=b[e];k="boolean"==
|
|
213
|
-
typeof k?{}:"function"==typeof k?{match:k}:
|
|
214
|
-
a.push(k)}b=f.elements;f=f.generic;var
|
|
215
|
-
h)if(b[
|
|
213
|
+
typeof k?{}:"function"==typeof k?{match:k}:M(k);"$"!=e.charAt(0)&&(k.elements=e);d&&(k.featureName=d.toLowerCase());var h=k;h.elements=g(h.elements,/\s+/)||null;h.propertiesOnly=h.propertiesOnly||!0===h.elements;var m=/\s*,\s*/,q=void 0;for(q in L){h[q]=g(h[q],m)||null;var l=h,x=H[q],n=g(h[H[q]],m),v=h[q],F=[],B=!0,O=void 0;n?B=!1:n={};for(O in v)"!"==O.charAt(0)&&(O=O.slice(1),F.push(O),n[O]=!0,B=!1);for(;O=F.pop();)v[O]=v["!"+O],delete v["!"+O];l[x]=(B?!1:n)||null}h.match=h.match||null;c.push(k);
|
|
214
|
+
a.push(k)}b=f.elements;f=f.generic;var t;d=0;for(c=a.length;d<c;++d){e=M(a[d]);k=!0===e.classes||!0===e.styles||!0===e.attributes;h=e;q=x=m=void 0;for(m in L)h[m]=z(h[m]);l=!0;for(q in H){m=H[q];x=h[m];n=[];v=void 0;for(v in x)-1<v.indexOf("*")?n.push(new RegExp("^"+v.replace(/\*/g,".*")+"$")):n.push(v);x=n;x.length&&(h[m]=x,l=!1)}h.nothingRequired=l;h.noProperties=!(h.attributes||h.classes||h.styles);if(!0===e.elements||null===e.elements)f[k?"unshift":"push"](e);else for(t in h=e.elements,delete e.elements,
|
|
215
|
+
h)if(b[t])b[t][k?"unshift":"push"](e);else b[t]=[e]}}function l(a,b,d,c){if(!a.match||a.match(b))if(c||k(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,g;f<e;++f)g=b[f],c[g]||(c[g]=a(g));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 g(a,b){if(!a)return!1;if(!0===a)return a;if("string"==typeof a)return a=
|
|
217
|
+
b,d){if(a.disabled||a.customConfig&&!d||!b)return!1;a._.cachedChecks={};return!0}function g(a,b){if(!a)return!1;if(!0===a)return a;if("string"==typeof a)return a=I(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 k(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,N);break}}function
|
|
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=I(a);b=a.match(J);)(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?I(d[1]):null}function t(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 w(a,b,d,c){var e=0,g;c.toHtml&&(b.name=b.name.replace(K,
|
|
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])){t(b);for(k=0;k<g.length;++k)x(a,b,g[k]);r(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 q={valid:!1,validAttributes:{},validClasses:{},validStyles:{},allAttributes:!1,allClasses:!1,
|
|
221
|
+
allStyles:!1,hadInvalidAttribute:!1,hadInvalidClass:!1,hadInvalidStyle:!1},n,F;if(a||g){t(b);if(k)for(n=0,F=k.length;n<F;++n)if(!1===f(k[n],b,q)){a=null;break a}if(h)for(n=0,F=h.length;n<F;++n)f(h[n],b,q);if(a)for(n=0,F=a.length;n<F;++n)l(a[n],b,q,m);if(g)for(n=0,F=g.length;n<F;++n)l(g[n],b,q,m);a=q}else a=null}if(!a||!a.valid)return d.push(b),1;F=a.validAttributes;var B=a.validStyles;g=a.validClasses;var k=b.attributes,G=b.styles,h=b.classes;m=b.classBackup;var z=b.styleBackup,C,I,u=[],q=[],A=/^data-cke-/;
|
|
222
|
+
n=!1;delete k.style;delete k["class"];delete b.classBackup;delete b.styleBackup;if(!a.allAttributes)for(C in k)F[C]||(A.test(C)?C==(I=C.replace(/^data-cke-saved-/,""))||F[I]||(delete k[C],n=!0):(delete k[C],n=!0));if(!a.allStyles||a.hadInvalidStyle){for(C in G)a.allStyles||B[C]?u.push(C+":"+G[C]):n=!0;u.length&&(k.style=u.sort().join("; "))}else z&&(k.style=z);if(!a.allClasses||a.hadInvalidClass){for(C=0;C<h.length;++C)(a.allClasses||g[h[C]])&&q.push(h[C]);q.length&&(k["class"]=q.sort().join(" "));
|
|
223
|
+
m&&q.length<m.split(/\s+/).length&&(n=!0)}else m&&(k["class"]=m);n&&(e=1);if(!c.skipFinalValidation&&!v(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 r(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 v(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 z(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 u(){return new CKEDITOR.htmlParser.element("br")}function D(a){return a.type==CKEDITOR.NODE_ELEMENT&&("br"==a.name||G.$block[a.name])}function p(a,b,d){var c=a.name;if(G.$empty[c]||!a.children.length)"hr"==c&&"br"==b?a.replaceWith(u()):
|
|
225
|
+
(a.parent&&d.push({check:"it",el:a.parent}),a.remove());else if(G.$block[c]||"tr"==c)if("br"==b)a.previous&&!D(a.previous)&&(b=u(),b.insertBefore(a)),a.next&&!D(a.next)&&(b=u(),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 x(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,N);break}}function q(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 B(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 q(b,a)}}function A(a){return function(b,d){d[a](b)}}var G=CKEDITOR.dtd,M=CKEDITOR.tools.copy,I=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
|
-
!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=
|
|
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
|
-
l[d.name]||
|
|
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=
|
|
232
|
+
if(!b||"span"!=a.name||!~CKEDITOR.tools.object.keys(a.attributes).join("|").indexOf("data-cke-"))if(k=w(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 q,l,n;if(g)for(l=0;l<g.length;++l)if((n=c.match(g[l]))&&n[0].length==c.length){d=!0;break a}c=CKEDITOR.htmlParser.fragment.fromHtml(c);1==c.children.length&&(q=c.children[0]).type==CKEDITOR.NODE_ELEMENT&&
|
|
233
|
+
w(f,q,d,m);d=!d.length}d||e.push(a)}},null,!0);e.length&&(h=!0);var q;a=[];c=E[c||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)];for(var l;d=e.pop();)d.type==CKEDITOR.NODE_ELEMENT?p(d,c,a):d.remove();for(;q=a.pop();)if(d=q.el,d.parent)switch(l=G[d.parent.name]||G.span,q.check){case "it":G.$removeEmpty[d.name]&&!d.children.length?p(d,c,a):v(d)||p(d,c,a);break;case "el-up":d.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||l[d.name]||p(d,c,a);break;case "parent-down":d.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||
|
|
234
|
+
l[d.name]||p(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(B(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,q=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,q=k[1]):(h=k.check,m=k.left,q=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 q?A(q):q});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=[],q;if(!1!==b&&(q=this._.transformations[g.name])){for(e=0;e<q.length;++e)x(this,g,q[e]);r(g)}w(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
|
|
241
|
+
delete this.disallowedContent}};var L={styles:1,attributes:1,classes:1},H={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},J=/^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,F={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},K=/^cke:(object|embed|param)$/,O=/^(object|embed|param)$/,N;N=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:q,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");
|
|
@@ -250,35 +250,35 @@ var l=a.removeCustomData("focusmanager_handlers");a.removeListener("blur",l.blur
|
|
|
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
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 g="string"==typeof h;g&&(h=[h]);e||(e=CKEDITOR);var k=h.length,b=[],c=[],d=function(a){f&&(g?f.call(e,a):f.call(e,b,c))};if(0===k)d(!0);else{var n=function(a,f){(f?b:c).push(a);0>=--k&&(m&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),
|
|
253
|
-
d(f))},
|
|
254
|
-
null;c.$.onerror=null;
|
|
253
|
+
d(f))},t=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)},w=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,t(b,!0)}:(c.$.onload=function(){setTimeout(function(){c.$.onload=
|
|
254
|
+
null;c.$.onerror=null;t(b,!0)},0)},c.$.onerror=function(){c.$.onload=null;c.$.onerror=null;t(b,!1)}));c.appendTo(CKEDITOR.document.getHead())}}};m&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var y=0;y<k;y++)w(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 g=this;f.push({scriptUrl:e,callback:function(){m&&m.apply(this,arguments);f.shift();a.call(g)}});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
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=[],g={},k={},b=0;b<
|
|
257
257
|
a.length;b++){var c=a[b];if(c)if(f[c]||e[c])k[c]=this.get(c);else{var d=this.getFilePath(c);m.push(d);d in g||(g[d]=[]);g[d].push(c)}}CKEDITOR.scriptLoader.load(m,function(a,b){if(b.length)throw Error('[CKEDITOR.resourceManager.load] Resource name "'+g[b[0]].join(",")+'" was not found at "'+b[0]+'".');for(var d=0;d<a.length;d++)for(var c=g[a[d]],e=0;e<c.length;e++){var m=c[e];k[m]=this.get(m);f[m]=1}l.call(h,k)},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={},g=function(k){a.call(this,k,function(a){CKEDITOR.tools.extend(m,a);var c=[],d;for(d in a){var k=a[d],h=k&&k.requires;if(!l[d]){if(k.icons)for(var
|
|
258
|
+
CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var l={};return function(h,f,e){var m={},g=function(k){a.call(this,k,function(a){CKEDITOR.tools.extend(m,a);var c=[],d;for(d in a){var k=a[d],h=k&&k.requires;if(!l[d]){if(k.icons)for(var w=k.icons.split(","),y=w.length;y--;)CKEDITOR.skin.addIcon(w[y],k.path+"icons/"+(CKEDITOR.env.hidpi&&k.hidpi?"hidpi/":"")+w[y]+".png");k.isSupportedEnvironment=k.isSupportedEnvironment||function(){return!0};l[d]=1}if(h)for(h.split&&(h=h.split(",")),k=0;k<h.length;k++)m[h[k]]||
|
|
259
259
|
c.push(h[k])}if(c.length)g.call(this,c);else{for(d in m)k=m[d],k.onLoad&&!k.onLoad._called&&(!1===k.onLoad()&&delete m[d],k.onLoad._called=1);f&&f.call(e||window,m)}},this)};g.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()||k(this,a)},0,this)}function l(){do var a="editor"+ ++
|
|
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 g(a){var b=a.config.customConfig;if(!b)return!1;var b=CKEDITOR.getUrl(b),d=
|
|
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()||k(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 g(a){var b=a.config.customConfig;if(!b)return!1;var b=CKEDITOR.getUrl(b),d=r[b]||(r[b]={});d.fn?(d.fn.call(a,a.config),CKEDITOR.getUrl(a.config.customConfig)!=b&&g(a)||a.fireOnce("customConfigLoaded")):CKEDITOR.scriptLoader.queue(b,function(){d.fn=
|
|
266
266
|
CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){};g(a)});return!0}function k(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
268
|
a.filter=a.activeFilter=new CKEDITOR.filter(a);b(a)});d&&null!=d.customConfig&&(a.config.customConfig=d.customConfig);g(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(
|
|
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,q=null,l=h.requires,n;CKEDITOR.tools.isArray(l)&&(l=l.join(","));if(l&&(n=l.match(k)))for(;l=n.pop();)CKEDITOR.error("editor-plugin-required",{plugin:l.replace(",",""),requiredBy:g});m&&!a.lang[g]&&(m.split&&
|
|
271
|
+
(m=m.split(",")),0<=CKEDITOR.tools.indexOf(m,a.langCode)?q=a.langCode:(q=a.langCode.replace(/-.*/,""),q=q!=a.langCode&&0<=CKEDITOR.tools.indexOf(m,q)?q:0<=CKEDITOR.tools.indexOf(m,"en")?"en":m[0]),h.langEntries&&h.langEntries[q]?(a.lang[g]=h.langEntries[q],q=null):e.push(CKEDITOR.getUrl(h.path+"lang/"+q+".js")));f.push(q);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 t(){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 w(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,r={};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&&t.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=w(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 t.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",
|
|
@@ -291,42 +291,42 @@ insertAfter:function(a){var l=a.parent.children,h=CKEDITOR.tools.indexOf(l,a),f=
|
|
|
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,k){function b(a){var b;if(0<
|
|
295
|
-
|
|
296
|
-
(
|
|
297
|
-
a in CKEDITOR.dtd.$tableContent?a==b||"dt"==a&&"dd"==b||"dd"==a&&"dt"==b:!1}var
|
|
298
|
-
return}"textarea"==d&&(
|
|
299
|
-
|
|
300
|
-
function(a){if(!(
|
|
301
|
-
|
|
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,k){function b(a){var b;if(0<v.length)for(var d=0;d<v.length;d++){var f=
|
|
295
|
+
v[d],e=f.name,g=CKEDITOR.dtd[e],k=u.name&&CKEDITOR.dtd[u.name];k&&!k[e]||a&&g&&!g[a]&&CKEDITOR.dtd[a]?e==u.name&&(n(u,u.parent,1),d--):(b||(c(),b=1),f=f.clone(),f.parent=u,u=f,v.splice(d,1),d--)}}function c(){for(;z.length;)n(z.shift(),u)}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||u||r;var e=u;void 0===b.previous&&
|
|
296
|
+
(t(c,b)&&(u=c,y.onTagOpen(k,{}),b.returnPoint=c=u),d(b),a(b)&&!b.children.length||c.add(b),"pre"==b.name&&(p=!1),"textarea"==b.name&&(D=!1));b.returnPoint?(u=b.returnPoint,delete b.returnPoint):u=f?c:e}function t(a,b){if((a==r||"body"==a.name)&&k&&(!a.name||CKEDITOR.dtd[a.name][k])){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 w(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,r=g instanceof CKEDITOR.htmlParser.element?g:"string"==typeof g?new CKEDITOR.htmlParser.element(g):new CKEDITOR.htmlParser.fragment,v=[],z=[],u=r,D="textarea"==r.name,p="pre"==r.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))v.push(e);else{if("pre"==d)p=!0;else{if("br"==d&&p){u.add(new CKEDITOR.htmlParser.text("\n"));
|
|
298
|
+
return}"textarea"==d&&(D=!0)}if("br"==d)z.push(e);else{for(;!(k=(g=u.name)?CKEDITOR.dtd[g]||(u._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):f,e.isUnknown||u.isUnknown||k[d]);)if(u.isOptionalClose)y.onTagClose(g);else if(d in h&&g in h)g=u.children,(g=g[g.length-1])&&"li"==g.name||n(g=new CKEDITOR.htmlParser.element("li"),u),!e.returnPoint&&(e.returnPoint=u),u=g;else if(d in CKEDITOR.dtd.$listItem&&!w(d,g))y.onTagOpen("li"==d?"ul":"dl",{},0,1);else if(g in l&&!w(d,g))!e.returnPoint&&(e.returnPoint=
|
|
299
|
+
u),u=u.parent;else if(g in CKEDITOR.dtd.$inline&&v.unshift(u),u.parent)n(u,u.parent,1);else{e.isOrphan=1;break}b(d);c();e.parent=u;e.isEmpty?n(e):u=e}}};y.onTagClose=function(a){for(var b=v.length-1;0<=b;b--)if(a==v[b].name){v.splice(b,1);return}for(var d=[],f=[],e=u;e!=r&&e.name!=a;)e._.isBlockLike||f.unshift(e),d.push(e),e=e.returnPoint||e.parent;if(e!=r){for(b=0;b<d.length;b++){var g=d[b];n(g,g.parent)}u=e;e._.isBlockLike&&c();n(e,e.parent);e==u&&(u=u.parent);v=v.concat(f)}"body"==a&&(k=!1)};y.onText=
|
|
300
|
+
function(a){if(!(u._.hasInlineStarted&&!z.length||p||D)&&(a=CKEDITOR.tools.ltrim(a),0===a.length))return;var d=u.name,g=d?CKEDITOR.dtd[d]||(u._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):f;if(!D&&!g["#"]&&d in l)y.onTagOpen(e[d]||""),y.onText(a);else{c();b();p||D||(a=a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," "));a=new CKEDITOR.htmlParser.text(a);if(t(u,a))this.onTagOpen(k,{},0,1);u.add(a)}};y.onCDATA=function(a){u.add(new CKEDITOR.htmlParser.cdata(a))};y.onComment=function(a){c();b();u.add(new CKEDITOR.htmlParser.comment(a))};
|
|
301
|
+
y.parse(m);for(c();u!=r;)n(u,u.parent,1);d(r);return r};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
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,k;for(g in f)(k=h[g])||(k=h[g]=new a),k.add(f[g],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
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,g=0;3>g;g++)if(m=e[g]){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
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],g=0,k=a.length;g<k;g++)m.push({value:a[g],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),g=this.rules,k=g.length,b,c,d,
|
|
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),g=this.rules,k=g.length,b,c,d,l;for(l=0;l<k;l++)if(e&&(b=f.type,c=f.name),d=g[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
309
|
(m[0]=f=d)}return f},execOnName:function(a,f){for(var e=0,m=this.rules,g=m.length,k;f&&e<g;e++)k=m[e],a.nonEditable&&!k.options.applyToAll||a.nestedEditable&&k.options.excludeNestedEditable||(f=f.replace(k.value[0],k.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
|
-
[],g=h(c),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(z))&&(d.index&&((new CKEDITOR.htmlParser.text(a.value.substring(0,d.index))).insertBefore(a),a.value=d[0]),!CKEDITOR.env.needsBrFiller&&
|
|
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(
|
|
315
|
-
(a=b+
|
|
316
|
-
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"+
|
|
319
|
-
{applyToAll:!0});e.addRules(C);e.addRules(A,{applyToAll:!0});e.addRules(a(b,"html"),{applyToAll:!0});b.on("toHtml",function(a){a=a.data;var f=a.dataValue,e,f=
|
|
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=
|
|
310
|
+
[],g=h(c),l,n;if(g)for(k(g,1)&&e.push(g);g;)m(g)&&(l=f(g))&&k(l)&&((n=f(l))&&!m(n)?e.push(l):(d(q).insertAfter(l),l.remove())),g=g.previous;for(g=0;g<e.length;g++)e[g].remove();if(e=!a||!1!==("function"==typeof b?b(c):b))q||CKEDITOR.env.needsBrFiller||c.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT?q||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 k(a,b){if((!q||
|
|
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(z))&&(d.index&&((new CKEDITOR.htmlParser.text(a.value.substring(0,d.index))).insertBefore(a),a.value=d[0]),!CKEDITOR.env.needsBrFiller&&q&&(!b||a.parent.name in n)||!q&&((d=a.previous)&&"br"==d.name||!d||m(d)))?!0:!1}var l={elements:{}},q="html"==b,n=CKEDITOR.tools.extend({},x),F;for(F in n)"#"in D[F]||delete n[F];for(F in n)l.elements[F]=
|
|
312
|
+
c(q,a.config.fillEmptyBlocks);l.root=c(q,!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 k=f(b);!c&&m(b.parent)?g(b.parent,d(a)):m(c)&&k&&!m(k)&&d(a).insertBefore(c)}}}}(q);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 x||a.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function g(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 k(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 I.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+w(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 t(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g,function(a){return"\x3c!--"+u+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function w(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 r(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!--"+u+(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(w(f),b)+"\x3c/"+d+"\x3e"})}var v;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(q);f.addRules(B,{applyToAll:!0});f.addRules(a(b,"data"),
|
|
319
|
+
{applyToAll:!0});e.addRules(C);e.addRules(A,{applyToAll:!0});e.addRules(a(b,"html"),{applyToAll:!0});b.on("toHtml",function(a){a=a.data;var f=a.dataValue,e,f=v(f),f=r(f,b),f=d(f,L),f=c(f),f=d(f,E),f=f.replace(J,"$1cke:$2"),f=f.replace(K,"\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=w(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=t(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=w(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 z=/(?: |\xa0)$/,
|
|
324
|
+
{dataValue:a,filter:c||this.editor.filter,context:d,enterMode:f||this.editor.enterMode}).dataValue}};var z=/(?: |\xa0)$/,u="{cke_protected}",D=CKEDITOR.dtd,p="caption colgroup col thead tfoot tbody".split(" "),x=CKEDITOR.tools.extend({},D.$blockLimit,D.$block),q={elements:{input:k,textarea:k}},B={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
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}}},A={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(
|
|
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(p,a.name),c=CKEDITOR.tools.indexOf(p,b.name));-1<d&&-1<c&&d!=c||(d=a.parent?a.getIndex():-1,c=b.parent?b.getIndex():-1);return d>c?
|
|
327
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&&g(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&&(A.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})});var G=/<(a|area|img|input|source)\b([^>]*)>/gi,
|
|
329
|
-
|
|
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&&(A.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,I=/^(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,J=/(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,F=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,K=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;v=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=
|
|
@@ -353,33 +353,33 @@ h.resetDirty();c?h.fire("unlockSnapshot"):"wysiwyg"==a&&h.fire("saveSnapshot");s
|
|
|
353
353
|
g.setSize("width",a,!0);c&&(c.style.width="1%");e=CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(e));var d=(g.$.offsetHeight||0)-(b.$.clientHeight||0),k=Math.max(e-(h?0:d),0);e=h?e+d:e;b.setStyle("height",CKEDITOR.tools.cssLength(k));c&&(c.style.width="100%");this.fire("resize",{outerHeight:e,contentsHeight:k,outerWidth:a||g.getSize("width")})};CKEDITOR.editor.prototype.getResizable=function(a){return a?this.ui.space("contents"):this.container};CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&
|
|
354
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,k=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;g(b,d.block,c)&&k.collapsed&&!k.getCommonAncestor().isReadOnly()&&(d=k.clone(),d.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),c=new CKEDITOR.dom.walker(d),
|
|
355
355
|
c.guard=function(a){return!f(a)||a.type==CKEDITOR.NODE_COMMENT||a.isReadOnly()},!c.checkForward()||d.checkStartOfBlock()&&d.checkEndOfBlock())&&(b=k.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&&k.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)&&
|
|
357
|
-
c){c&&b.type==CKEDITOR.NODE_ELEMENT&&b.is(e)&&(d=b);if(!(c||!f(b)||a&&
|
|
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)&&t(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 g(a,b,d){return!1!==
|
|
358
358
|
a.config.autoParagraph&&a.activeEnterMode!=CKEDITOR.ENTER_BR&&(a.editable().equals(d)&&!b||b&&"true"==b.getAttribute("contenteditable"))}function k(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,
|
|
359
|
+
b:a;(a=a.getParent())&&!c.equals(a)&&1==a.getChildCount();)b=a;b.remove()}var n,t,w,y,r,v,z,u,D,p;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]);
|
|
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)&&!
|
|
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})?z(d):d.startContainer.is(CKEDITOR.dtd.$list)&&
|
|
366
|
-
1))&&(h=CKEDITOR.dtd[k.getName()])&&(!h||!h[f]);)if(k.getName()in CKEDITOR.dtd.span){var g=d.splitElement(k),
|
|
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]);v(this,b||"html",a,d);d&&d.select();c(this);this.editor.fire("afterInsertHtml",{})},insertHtmlIntoRange:function(a,b,d){v(this,d||"html",a,b);this.editor.fire("afterInsertHtml",
|
|
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})?z(d):d.startContainer.is(CKEDITOR.dtd.$list)&&u(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),m=d.createBookmark();b(k);b(g);d.moveToBookmark(m)}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()};D.eol.detect(a,this);D.bogus.exclude(a);D.cell.shrink(a);a.fragment=a.range.cloneContents();D.tree.rebuild(a,this);D.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},extractHtmlFromRange:function(a,b){var d=p,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(!t(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),w(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(r,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,q,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)&&(q=k[d?"getPrevious":"getNext"](n))&&q.type==CKEDITOR.NODE_ELEMENT&&q.is("table")&&f[d?"checkStartOfBlock":"checkEndOfBlock"]()?(a.fire("saveSnapshot"),f[d?"checkEndOfBlock":"checkStartOfBlock"]()&&k.remove(),f["moveToElementEdit"+(d?"End":"Start")](q),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)&&(q=h[d?"getPrevious":"getNext"](n))?(a.fire("saveSnapshot"),f["moveToElementEdit"+(d?"End":"Start")](q),f.checkStartOfBlock()&&f.checkEndOfBlock()?q.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(r,""))){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,116 +387,116 @@ 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,n
|
|
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:!!X,dontFilter:F.dontFilter,filter:F.editor.activeFilter,enterMode:F.editor.activeEnterMode});
|
|
399
|
-
P.remove()}}F.dataWrapper=
|
|
400
|
-
|
|
401
|
-
(
|
|
402
|
-
|
|
403
|
-
if(
|
|
390
|
+
n=CKEDITOR.dom.walker.whitespaces(!0);t=CKEDITOR.dom.walker.bookmark(!1,!0);w=CKEDITOR.dom.walker.empty();y=CKEDITOR.dom.walker.bogus();r=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;v=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function d(b,c){var e,f,g,k,h=[],m=c.range.startContainer;e=c.range.startPath();for(var m=n[m.getName()],l=0,t=b.getChildren(),G=t.count(),v=-1,w=-1,B=0,u=e.contains(n.$list);l<
|
|
391
|
+
G;++l)e=t.getItem(l),a(e)?(g=e.getName(),u&&g in CKEDITOR.dtd.$list?h=h.concat(d(e,c)):(k=!!m[g],"br"!=g||!e.data("cke-eol")||l&&l!=G-1||(B=(f=l?h[l-1].node:t.getItem(l+1))&&(!a(f)||!f.is("br")),f=f&&a(f)&&n.$block[f.getName()]),-1!=v||k||(v=l),k||(w=l),h.push({isElement:1,isLineBreak:B,isBlock:e.isBlockBoundary(),hasBlockSibling:f,node:e,name:g,allowed:k}),f=B=0)):h.push({isElement:0,node:e,allowed:1});-1<v&&(h[v].firstNotAllowed=1);-1<w&&(h[w].lastNotAllowed=1);return h}function c(b,d){var e=[],
|
|
392
|
+
f=b.getChildren(),g=f.count(),k,h=0,m=n[d],l=!b.is(n.$inline)||b.is("br");for(l&&e.push(" ");h<g;h++)k=f.getItem(h),a(k)&&!k.is(m)?e=e.concat(c(k,d)):e.push(k);l&&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 m(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)&&t[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(),m(b,d,c,e))}function l(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,t={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},v={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},w=CKEDITOR.tools.extend({},n.$inline);delete w.br;return function(t,F,K,u){var z=t.editor,p=!1;"unfiltered_html"==F&&(F="html",p=!0);if(!u.checkReadOnly()){var D=(new CKEDITOR.dom.elementPath(u.startContainer,u.root)).blockLimit||u.root;F={type:F,dontFilter:p,editable:t,editor:z,range:u,blockLimit:D,mergeCandidates:[],zombies:[]};var p=F.range,D=F.mergeCandidates,r="html"===F.type,E,y,T,aa,ba,V;"text"==F.type&&
|
|
395
|
+
p.shrink(CKEDITOR.SHRINK_ELEMENT,!0,!1)&&(y=CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",p.document),p.insertNode(y),p.setStartAfter(y));T=new CKEDITOR.dom.elementPath(p.startContainer);F.endPath=aa=new CKEDITOR.dom.elementPath(p.endContainer);if(!p.collapsed){E=aa.block||aa.blockLimit;var ea=p.getCommonAncestor();E&&!E.equals(ea)&&!E.contains(ea)&&p.checkEndOfBlock()&&F.zombies.push(E);p.deleteContents()}for(;(ba=e(p))&&a(ba)&&ba.isBlockBoundary()&&T.contains(ba);)p.moveToPosition(ba,
|
|
396
|
+
CKEDITOR.POSITION_BEFORE_END);m(p,F.blockLimit,T,aa);y&&(p.setEndBefore(y),p.collapse(),y.remove());y=p.startPath();if(E=y.contains(h,!1,1))V=p.splitElement(E),F.inlineStylesRoot=E,F.inlineStylesPeak=y.lastElement;y=p.createBookmark();r&&(b(E),b(V));(E=y.startNode.getPrevious(f))&&a(E)&&h(E)&&D.push(E);(E=y.startNode.getNext(f))&&a(E)&&h(E)&&D.push(E);for(E=y.startNode;(E=E.getParent())&&h(E);)D.push(E);p.moveToBookmark(y);z.enterMode===CKEDITOR.ENTER_DIV&&""===z.getData(!0)&&((z=t.getFirst())&&z.remove(),
|
|
397
|
+
u.setStartAt(t,CKEDITOR.POSITION_AFTER_START),u.collapse(!0));if(t=K){t=F.range;if("text"==F.type&&F.inlineStylesRoot){u=F.inlineStylesPeak;z=u.getDocument().createText("{cke-peak}");for(V=F.inlineStylesRoot.getParent();!u.equals(V);)z=z.appendTo(u.clone()),u=u.getParent();K=z.getOuterHtml().split("{cke-peak}").join(K)}u=F.blockLimit.getName();if(/^\s+|\s+$/.test(K)&&"span"in CKEDITOR.dtd[u]){var X='\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e';K=X+K+X}K=F.editor.dataProcessor.toHtml(K,
|
|
398
|
+
{context:null,fixForBody:!1,protectedWhitespaces:!!X,dontFilter:F.dontFilter,filter:F.editor.activeFilter,enterMode:F.editor.activeEnterMode});u=t.document.createElement("body");u.setHtml(K);X&&(u.getFirst().remove(),u.getLast().remove());if((X=t.startPath().block)&&(1!=X.getChildCount()||!X.getBogus()))a:{var P;if(1==u.getChildCount()&&a(P=u.getFirst())&&P.is(v)&&!P.hasAttribute("contenteditable")){X=P.getElementsByTag("*");t=0;for(V=X.count();t<V;t++)if(z=X.getItem(t),!z.is(w))break a;P.moveChildren(P.getParent(1));
|
|
399
|
+
P.remove()}}F.dataWrapper=u;t=K}if(t){P=F.range;t=P.document;u=F.blockLimit;V=0;var Q,X=[],R,U;K=y=0;var ga,z=P.startContainer;ba=F.endPath.elements[0];var ha,p=ba.getPosition(z),D=!!ba.getCommonAncestor(z)&&p!=CKEDITOR.POSITION_IDENTICAL&&!(p&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED),z=d(F.dataWrapper,F);for(l(z,P);V<z.length;V++){p=z[V];if(r=p.isLineBreak)r=P,E=u,aa=T=void 0,p.hasBlockSibling?r=1:(T=r.startContainer.getAscendant(n.$block,1))&&T.is({div:1,p:1})?(aa=T.getPosition(E),
|
|
400
|
+
aa==CKEDITOR.POSITION_IDENTICAL||aa==CKEDITOR.POSITION_CONTAINS?r=0:(E=r.splitElement(T),r.moveToPosition(E,CKEDITOR.POSITION_AFTER_START),r=1)):r=0;if(r)K=0<V;else{r=P.startPath();!p.isBlock&&g(F.editor,r.block,r.blockLimit)&&(U=k(F.editor))&&(U=t.createElement(U),U.appendBogus(),P.insertNode(U),CKEDITOR.env.needsBrFiller&&(Q=U.getBogus())&&Q.remove(),P.moveToPosition(U,CKEDITOR.POSITION_BEFORE_END));if((r=P.startPath().block)&&!r.equals(R)){if(Q=r.getBogus())Q.remove(),X.push(r);R=r}p.firstNotAllowed&&
|
|
401
|
+
(y=1);if(y&&p.isElement){r=P.startContainer;for(E=null;r&&!n[r.getName()][p.name];){if(r.equals(u)){r=null;break}E=r;r=r.getParent()}if(r)E&&(ga=P.splitElement(E),F.zombies.push(ga),F.zombies.push(E));else{E=u.getName();ha=!V;r=V==z.length-1;E=c(p.node,E);T=[];aa=E.length;for(var ea=0,ja=void 0,da=0,ca=-1;ea<aa;ea++)ja=E[ea]," "==ja?(da||ha&&!ea||(T.push(new CKEDITOR.dom.text(" ")),ca=T.length),da=1):(T.push(ja),da=0);r&&ca==T.length&&T.pop();ha=T}}if(ha){for(;r=ha.pop();)P.insertNode(r);ha=0}else P.insertNode(p.node);
|
|
402
|
+
p.lastNotAllowed&&V<z.length-1&&((ga=D?ba:ga)&&P.setEndAt(ga,CKEDITOR.POSITION_AFTER_START),y=0);P.collapse()}}1!=z.length?Q=!1:(Q=z[0],Q=Q.isElement&&"false"==Q.node.getAttribute("contenteditable"));Q&&(K=!0,r=z[0].node,P.setStartAt(r,CKEDITOR.POSITION_BEFORE_START),P.setEndAt(r,CKEDITOR.POSITION_AFTER_END));F.dontMoveCaret=K;F.bogusNeededBlocks=X}Q=F.range;var fa;ga=F.bogusNeededBlocks;for(ha=Q.createBookmark();R=F.zombies.pop();)R.getParent()&&(U=Q.clone(),U.moveToElementEditStart(R),U.removeEmptyBlocksAtEnd());
|
|
403
|
+
if(ga)for(;R=ga.pop();)CKEDITOR.env.needsBrFiller?R.appendBogus():R.append(Q.document.createText(" "));for(;R=F.mergeCandidates.pop();)R.mergeSiblings();Q.moveToBookmark(ha);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)){fa=null;break}fa=Q.clone();fa.moveToPosition(R,CKEDITOR.POSITION_BEFORE_END)}R=R.getLast(f)}fa&&Q.moveToRange(fa)}}}}();z=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())}}();
|
|
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||!
|
|
406
|
+
CKEDITOR.POSITION_BEFORE_END))}}();u=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())}}();D={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
|
+
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)}}};p=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;w(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
|
-
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),
|
|
415
|
-
CKEDITOR.dom.element.setMarker(
|
|
416
|
-
e.push(f))}};g.lastForward();CKEDITOR.dom.element.clearAllMarkers(
|
|
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,
|
|
418
|
-
|
|
419
|
-
e.tableContentsRanges=h?h:a(g)},deleteRanges:function(a){for(var b;b=a.tableContentsRanges.pop();)b.extractContents(),
|
|
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),q=a.getAscendant("table",!0),m=m&&m.contains(q)||n&&n.contains(q);else m=void 0;m&&(f=d.clone(),f.selectNodeContents(a),
|
|
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
|
+
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
|
+
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(),w(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
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;g(a,d.block,d.blockLimit)&&(c=k(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();
|
|
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"),
|
|
425
|
-
!1;g&&(
|
|
426
|
-
path:d}))}function g(){
|
|
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(
|
|
423
|
+
this.root.editor,d=b.getSelection(1);this.reset();p=!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=z++;b._.fakeSelection=this;p=!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
|
+
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
|
+
!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 g(){q=!0;x||(k.call(this),x=CKEDITOR.tools.setTimeout(k,200,this))}function k(){x=null;q&&(CKEDITOR.tools.setTimeout(m,0,this),q=!1)}function b(a){return B(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(u);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=u.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(t(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 t(a,b){return b?a.replace(D,function(a,b){return b?" ":""}):a.replace(u,"")}function w(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
|
|
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 r(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 v="function"!=typeof window.getSelection,z=1,u=CKEDITOR.tools.repeat("",7),D=new RegExp(u+"( )?","g"),p,x,q,B=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,k=CKEDITOR.document,h=d.editable(),l=f.getBody(),
|
|
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||(z=d.window.getScrollPosition()))});h.attachListener(h,"mouseup",function(a){2==a.data.$.button&&z&&(d.document.$.documentElement.scrollLeft=z.x,d.document.$.documentElement.scrollTop=z.y);z=null});if("BackCompat"!=f.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var
|
|
439
|
-
|
|
440
|
-
(k.on("mouseup",b),
|
|
441
|
-
"mouseup",function(){
|
|
434
|
+
d.getSelection();a&&a.removeAllRanges()}var d=a.editor;d.on("contentDom",function(){function a(){w=new CKEDITOR.dom.selection(d.getSelection());w.lock()}function b(){k.removeListener("mouseup",b);q.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,k=CKEDITOR.document,h=d.editable(),l=f.getBody(),q=f.getDocumentElement(),t=h.isInline(),u,w;CKEDITOR.env.gecko&&h.attachListener(h,"focus",function(a){a.removeListener();0!==u&&(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(u&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){u=d._.previousActive&&d._.previousActive.equals(f.getActive());var a=null!=d._.previousScrollTop&&d._.previousScrollTop!=h.$.scrollTop;CKEDITOR.env.webkit&&u&&a&&(h.$.scrollTop=d._.previousScrollTop)}d.unlockSelection(u);u=0},null,null,-1);h.attachListener(h,
|
|
437
|
+
"mousedown",function(){u=0});if(CKEDITOR.env.ie||CKEDITOR.env.gecko||t)v?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=w&&(w.isFake||2>w.getRanges().length);CKEDITOR.env.gecko&&!t&&a||(d.lockSelection(w),u=1)},null,null,-1),h.attachListener(h,"mousedown",function(){u=0});if(CKEDITOR.env.ie&&!t){var z;h.attachListener(h,"mousedown",function(a){2==
|
|
438
|
+
a.data.$.button&&((a=d.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(z=d.window.getScrollPosition()))});h.attachListener(h,"mouseup",function(a){2==a.data.$.button&&z&&(d.document.$.documentElement.scrollLeft=z.x,d.document.$.documentElement.scrollTop=z.y);z=null});if("BackCompat"!=f.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var p,B;q.on("mousedown",function(a){function b(a){a=a.data.$;if(p){var d=l.$.createTextRange();try{d.moveToPoint(a.clientX,a.clientY)}catch(c){}p.setEndPoint(0>
|
|
439
|
+
B.compareEndPoints("StartToStart",d)?"EndToEnd":"StartToStart",d);p.select()}}function d(){q.removeListener("mousemove",b);k.removeListener("mouseup",d);q.removeListener("mouseup",d);p.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y<q.$.clientHeight&&a.$.x<q.$.clientWidth){p=l.$.createTextRange();try{p.moveToPoint(a.$.clientX,a.$.clientY)}catch(c){}B=p.duplicate();q.on("mousemove",b);k.on("mouseup",d);q.on("mouseup",d)}})}if(7<CKEDITOR.env.version&&11>CKEDITOR.env.version)q.on("mousedown",function(a){a.data.getTarget().is("html")&&
|
|
440
|
+
(k.on("mouseup",b),q.on("mouseup",b))})}}h.attachListener(h,"selectionchange",m,d);h.attachListener(h,"keyup",g,d);h.attachListener(h,"touchstart",g,d);h.attachListener(h,"touchend",g,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(t&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var x;h.attachListener(h,"mousedown",function(){x=1});h.attachListener(f.getDocumentElement(),
|
|
441
|
+
"mouseup",function(){x&&g.call(d);x=0})}else h.attachListener(CKEDITOR.env.ie?h:f.getDocumentElement(),"mouseup",g,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=t(a.data))},
|
|
444
|
+
b,null,20);b.on("toDataFormat",function(a){a.data.dataValue=t(a.data.dataValue)},null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(a){(a?m:g).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
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:z++;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 A={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:
|
|
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&&A[c.childNodes[d.startOffset].nodeName.toLowerCase()]&&(b=CKEDITOR.SELECTION_ELEMENT)}return a.type=b},getRanges:function(){var a=
|
|
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 A={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:t,_createFillingCharSequenceNode:d,FILLING_CHAR_SEQUENCE:u});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==
|
|
449
|
+
this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=v?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:v?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&&A[c.childNodes[d.startOffset].nodeName.toLowerCase()]&&(b=CKEDITOR.SELECTION_ELEMENT)}return a.type=b},getRanges:function(){var a=v?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,m=e.length-1,l=-1,n,q;h<=m;)if(l=Math.floor((h+m)/2),f=e[l],k.moveToElementText(f),n=k.compareEndPoints("StartToStart",b),0<n)m=l-1;else if(0>n)h=l+1;else return{container:c,offset:a(f)};if(-1==l||l==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&&(q=g,k-=g.nodeValue.length);return{container:q,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,q=g),f=g}catch(t){return{container:c,offset:a(f)}}return{container:q,offset:0<n?-k:q.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?r(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&&A[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=
|
|
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&&A[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=v?"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
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=z++},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
|
|
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 w,
|
|
463
|
-
|
|
464
|
-
b.setStartBefore(
|
|
465
|
-
m=m.getEnclosedNode(),b.isReadOnly()||m&&m.isReadOnly()))){
|
|
466
|
-
b.endOffset)}catch(
|
|
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 q,t;if(1==a.length&&!(t=a[0]).collapsed&&(m=t.getEnclosedNode())&&
|
|
461
|
+
m.type==CKEDITOR.NODE_ELEMENT&&(t=t.clone(),t.shrink(CKEDITOR.SHRINK_ELEMENT,!0),(q=t.getEnclosedNode())&&q.type==CKEDITOR.NODE_ELEMENT&&(m=q),"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)&&!p&&!a[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored"))e.call(this,a);else{if(v){q=CKEDITOR.dom.walker.whitespaces(!0);m=/\ufeff|\u00a0/;t={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 u,w,z;if((f=b.getEnclosedNode())&&f.type==CKEDITOR.NODE_ELEMENT&&f.getName()in A&&(!f.is("a")||!f.getText()))try{z=f.$.createControlRange();z.addElement(f.$);z.select();return}catch(B){}if(b.startContainer.type==CKEDITOR.NODE_ELEMENT&&b.startContainer.getName()in t||b.endContainer.type==CKEDITOR.NODE_ELEMENT&&b.endContainer.getName()in t)b.shrink(CKEDITOR.NODE_ELEMENT,!0),a=b.collapsed;z=b.createBookmark();
|
|
463
|
+
t=z.startNode;a||(h=z.endNode);z=b.document.$.body.createTextRange();z.moveToElementText(t.$);z.moveStart("character",1);h?(m=b.document.$.body.createTextRange(),m.moveToElementText(h.$),z.setEndPoint("EndToEnd",m),z.moveEnd("character",-1)):(u=t.getNext(q),w=t.hasAscendant("pre"),u=!(u&&u.getText&&u.getText().match(m))&&(w||!t.hasPrevious()||t.getPrevious().is&&t.getPrevious().is("br")),w=b.document.createElement("span"),w.setHtml("\x26#65279;"),w.insertBefore(t),u&&b.document.createText("").insertBefore(t));
|
|
464
|
+
b.setStartBefore(t);t.remove();a?(u?(z.moveStart("character",-1),z.select(),b.document.$.selection.clear()):z.select(),b.moveToPosition(w,CKEDITOR.POSITION_BEFORE_START),w.remove()):(b.setEndBefore(h),h.remove(),z.select())}else{h=this.getNative();if(!h)return;this.removeAllRanges();for(z=0;z<a.length;z++){if(z<a.length-1&&(u=a[z],w=a[z+1],m=u.clone(),m.setStart(u.endContainer,u.endOffset),m.setEnd(w.startContainer,w.startOffset),!m.collapsed&&(m.shrink(CKEDITOR.NODE_ELEMENT,!0),b=m.getCommonAncestor(),
|
|
465
|
+
m=m.getEnclosedNode(),b.isReadOnly()||m&&m.isReadOnly()))){w.setStart(u.startContainer,u.startOffset);a.splice(z--,1);continue}b=a[z];w=this.document.$.createRange();b.collapsed&&CKEDITOR.env.webkit&&c(b)&&(m=d(this.root),b.insertNode(m),(u=m.getNext())&&!m.getPrevious()&&u.type==CKEDITOR.NODE_ELEMENT&&"br"==u.getName()?(n(this.root),b.moveToPosition(u,CKEDITOR.POSITION_BEFORE_START)):b.moveToPosition(m,CKEDITOR.POSITION_AFTER_END));w.setStart(b.startContainer.$,b.startOffset);try{w.setEnd(b.endContainer.$,
|
|
466
|
+
b.endOffset)}catch(x){if(0<=x.toString().indexOf("NS_ERROR_ILLEGAL_VALUE"))b.collapse(1),w.setEnd(b.endContainer.$,b.endOffset);else throw x;}h.addRange(w)}}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();w(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
467
|
a;c.type=CKEDITOR.SELECTION_ELEMENT;c.selectedText=c.nativeSel=null;this.isFake=1;this.rev=z++;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[
|
|
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[v?"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
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=z(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
|
|
472
|
-
|
|
473
|
-
(
|
|
474
|
-
1:A[
|
|
475
|
-
|
|
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)?
|
|
477
|
-
else if(h.match)continue;else h=h.clone();h.append(e);e=h}e["start"==g.match?"insertBefore":"insertAfter"](g)}}else{var
|
|
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()&&
|
|
471
|
+
CKEDITOR.dtd[c];n||(g=!0,n=CKEDITOR.dtd.span);b.enlarge(CKEDITOR.ENLARGE_INLINE,1);b.trim();var q=b.createBookmark(),t=q.startNode,u=q.endNode,w=t,v;if(!k){var p=b.getCommonAncestor(),k=a(t,p),p=a(u,p);k&&(w=k.getNextSourceNode(!0));p&&(u=p)}for(w.getPosition(u)==CKEDITOR.POSITION_FOLLOWING&&(w=0);w;){k=!1;if(w.equals(u))w=null,k=!0;else{var B=w.type==CKEDITOR.NODE_ELEMENT?w.getName():null,p=B&&"false"==w.getAttribute("contentEditable"),x=B&&w.getAttribute("data-nostyle");if(B&&w.data("cke-bookmark")||
|
|
472
|
+
w.type===CKEDITOR.NODE_COMMENT){w=w.getNextSourceNode(!0);continue}if(p&&m&&CKEDITOR.dtd.$block[B])for(var r=w,D=e(r),C=void 0,A=D.length,G=0,r=A&&new CKEDITOR.dom.range(r.getDocument());G<A;++G){var C=D[G],M=CKEDITOR.filter.instances[C.data("cke-filter")];if(M?M.check(this):1)r.selectNodeContents(C),h.call(this,r)}D=B?!n[B]||x?0:p&&!m?0:l(w,u,f,L):1;if(D)if(C=w.getParent(),D=f,A=c,G=g,!C||!(C.getDtd()||CKEDITOR.dtd.span)[A]&&!G||D.parentRule&&!D.parentRule(C))k=!0;else{if(v||B&&CKEDITOR.dtd.$removeEmpty[B]&&
|
|
473
|
+
(w.getPosition(u)|L)!=L||(v=b.clone(),v.setStartBefore(w)),B=w.type,B==CKEDITOR.NODE_TEXT||p||B==CKEDITOR.NODE_ELEMENT&&!w.getChildCount()){for(var B=w,E;(k=!B.getNext(I))&&(E=B.getParent(),n[E.getName()])&&l(E,t,f,H);)B=E;v.setEndAfter(B)}}else k=!0;w=w.getNextSourceNode(x||p)}if(k&&v&&!v.collapsed){for(var k=z(this,d),p=k.hasAttributes(),x=v.getCommonAncestor(),B={},D={},C={},A={},da,ca,fa;k&&x;){if(x.getName()==c){for(da in f.attributes)!A[da]&&(fa=x.getAttribute(ca))&&(k.getAttribute(da)==fa?
|
|
474
|
+
D[da]=1:A[da]=1);for(ca in f.styles)!C[ca]&&(fa=x.getStyle(ca))&&(k.getStyle(ca)==fa?B[ca]=1:C[ca]=1)}x=x.getParent()}for(da in D)k.removeAttribute(da);for(ca in B)k.removeStyle(ca);p&&!k.hasAttributes()&&(k=null);k?(v.extractContents().appendTo(k),v.insertNode(k),y.call(this,k),k.mergeSiblings(),CKEDITOR.env.ie||k.$.normalize()):(k=new CKEDITOR.dom.element("span"),v.extractContents().appendTo(k),v.insertNode(k),y.call(this,k),k.remove(!0));v=null}}b.moveToBookmark(q);b.shrink(CKEDITOR.SHRINK_TEXT);
|
|
475
|
+
b.shrink(CKEDITOR.NODE_ELEMENT,!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=
|
|
476
|
+
a.createBookmark(),c=d.startNode,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)?w.call(this,h):r(h,p(this)[h.getName()]))}if(g){e=c;for(k=
|
|
477
|
+
0;;k++){h=f.elements[k];if(h.equals(g))break;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?w.call(this,f):r(f,p(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=
|
|
478
|
+
[];a.forEach(function(a){if("true"==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()&&u(a,this)}function g(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
479
|
a.removeStyle(e)}}function k(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=z(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)):
|
|
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&&
|
|
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)):w.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=t(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&&v(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 t(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 z(a,b,d){var c;c=a.element;"*"==c&&(c="span");c=new CKEDITOR.dom.element(c,b);d&&d.copyAttributes(c);c=
|
|
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},A={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*|$)/,
|
|
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 w(a,b){var d=this._.definition,c=d.attributes,d=d.styles,e=p(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)==x(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)!=x(k,d[k],!0)||(f=f||!!a.getStyle(k),a.removeStyle(k));r(a,e,C[a.getName()]);f&&(this._.definition.alwaysRemoveElement?
|
|
485
|
+
v(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==CKEDITOR.ENTER_BR&&!a.hasAttributes()?v(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function y(a){for(var b=p(this),d=a.getElementsByTag(this.element),c,e=d.count();0<=--e;)c=d.getItem(e),c.isReadOnly()||w.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()||r(c,b[f])}function r(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||v(a)}function v(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 z(a,b,d){var c;c=a.element;"*"==c&&(c="span");c=new CKEDITOR.dom.element(c,b);d&&d.copyAttributes(c);c=u(c,a);b.getCustomData("doc_processing_style")&&c.hasAttribute("id")?c.removeAttribute("id"):b.setCustomData("doc_processing_style",1);return c}function u(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 D(a,b){for(var d in a)a[d]=a[d].replace(M,function(a,d){return b[d]})}function p(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 x(a,
|
|
489
|
+
b,d){var c=new CKEDITOR.dom.element("span");c[d?"setStyle":"setAttribute"](a,b);return c[d?"getStyle":"getAttribute"](a)}function q(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 B(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},A={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,I=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),D(a.attributes,b),D(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:A[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 B.call(this,a.getSelection());if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;b||(this._.enterMode=a.activeEnterMode);B.call(this,a.getSelection(),0,a);this._.enterMode=b}},remove:function(a){if(a instanceof CKEDITOR.dom.document)return B.call(this,a.getSelection(),1);if(this.checkApplicable(a.elementPath(),
|
|
493
|
+
a)){var b=this._.enterMode;b||(this._.enterMode=a.activeEnterMode);B.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?k: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?g:null;return this.removeFromRange(a)},applyToObject:function(a){u(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?q(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=p(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
|
-
a,!0);return this.customHandlers[a.type]=b};var
|
|
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
501
|
h.length;e++){var m=h[e],g=m.style.checkActive(a.data.path,this)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;m.fn.call(this,g)}}));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",
|
|
@@ -504,7 +504,7 @@ CKEDITOR.stylesSet.addExternal(f,h[1]?h.slice(1).join(":"):CKEDITOR.getUrl("styl
|
|
|
504
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 g=f.endContainer.type===CKEDITOR.NODE_TEXT,k=h?f.startContainer.getLength():f.startContainer.getChildCount();
|
|
505
505
|
h=f.startOffset===k||h^g}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
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,g=null,k=[],b=f,c;e=e||f.getDocument().getBody();b||(b=e);do if(b.type==CKEDITOR.NODE_ELEMENT){k.push(b);if(!this.lastElement&&(this.lastElement=b,b.is(CKEDITOR.dtd.$object)||"false"==b.getAttribute("contenteditable")))continue;if(b.equals(e))break;if(!g&&(c=b.getName(),"true"==
|
|
507
|
-
b.getAttribute("contenteditable")?g=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
|
|
507
|
+
b.getAttribute("contenteditable")?g=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 t=c.getItem(d);if(t.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[t.getName()]){c=!0;break a}}c=!1}c=!c}c?h=b:g=b}}while(b=b.getParent());g||(g=e);this.block=h;this.blockLimit=g;this.root=e;this.elements=k}})();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
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,g=m.length;l&&(h?f+=1:--g);h&&(m=Array.prototype.slice.call(m,0),m.reverse());for(;f<g;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,
|
|
@@ -529,8 +529,8 @@ CKEDITOR.config.coreStyles_superscript={element:"sup"};(function(){function a(a,
|
|
|
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
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 g||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(
|
|
532
|
+
if(k&&k.length){for(var h={},v=f.createBookmarks(),k=k.createIterator(),z,u=0;z=k.getNextRange(1);){var D=z.getEnclosedNode();D&&(!D||D.type==CKEDITOR.NODE_ELEMENT&&D.getName()in m)||(D=l(z,e,g));D&&a(D,b,c,h);var p=new CKEDITOR.dom.walker(z),x=v[u].startNode,q=v[u++].endNode;p.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(x)&CKEDITOR.POSITION_FOLLOWING&&(a.getPosition(q)&CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_CONTAINS)==CKEDITOR.POSITION_PRECEDING)};for(;D=p.next();)a(D,b,c,h);z=z.createIterator();for(z.enlargeBr=g!=CKEDITOR.ENTER_BR;D=z.getNextParagraph(g==CKEDITOR.ENTER_P?"p":"div");)a(D,b,c,h)}CKEDITOR.dom.element.clearAllMarkers(h);c.forceNextSelectionCheck();f.selectBookmarks(v);c.focus()}}}}function f(a){var b=a==k.setAttribute,c=a==k.removeAttribute,e=/\bdirection\s*:\s*(.*?)\s*(:?$|;)/;
|
|
534
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={},g={};CKEDITOR.tools.extend(m,e,{tr:1,p:1,div:1,li:1});CKEDITOR.tools.extend(g,
|
|
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
536
|
"add":"remove")+"Class";var c=a.ui.space(a.config.toolbarLocation);if(c)c[b]("cke_mixed_dir_content")})}}});for(var k=CKEDITOR.dom.element.prototype,b=["setStyle","removeStyle","setAttribute","removeAttribute"],c=0;c<b.length;c++)k[b[c]]=CKEDITOR.tools.override(k[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 g=m[0].startNode,k=m[0].endNode,b;if(g&&"blockquote"==
|
|
@@ -551,8 +551,8 @@ function(a){13==a.data.getKeystroke()&&(h=!0)});g.getInputElement().on("keyup",f
|
|
|
551
551
|
function(){e.getInputElement().on("keyup",k)},e);CKEDITOR.ui.dialog.labeledElement.call(this,b,c,d,function(){g["aria-labelledby"]=this._.labelId;this._.required&&(g["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 g)a.push(b+'\x3d"'+CKEDITOR.tools.htmlEncode(g[b])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(e._["default"]),"\x3c/textarea\x3e\x3c/div\x3e");return a.join("")})}},checkbox:function(b,
|
|
552
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",k={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":f};g(a);c["default"]&&(k.checked="checked");"undefined"!=typeof a.inputStyle&&(a.style=a.inputStyle);
|
|
553
553
|
e.checkbox=new CKEDITOR.ui.dialog.uiElement(b,a,d,"input",null,k);d.push(' \x3clabel id\x3d"',f,'" for\x3d"',k.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=[],k=(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],
|
|
555
|
-
(
|
|
554
|
+
b,c,d,function(){for(var a=[],d=[],k=(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],D=void 0!==m[1]?m[1]:m[0],p=CKEDITOR.tools.getNextId()+"_radio_input",x=p+"_label",p=CKEDITOR.tools.extend({},c,{id:p,title:null,type:null},!0),l=CKEDITOR.tools.extend({},p,{title:l},!0),q={type:"radio","class":"cke_dialog_ui_radio_input",name:k,value:D,"aria-labelledby":x},B=[];f._["default"]==D&&(q.checked="checked");g(p);g(l);"undefined"!=typeof p.inputStyle&&
|
|
555
|
+
(p.style=p.inputStyle);p.keyboardFocusable=!0;e.push(new CKEDITOR.ui.dialog.uiElement(b,p,B,"input",null,q));B.push(" ");new CKEDITOR.ui.dialog.uiElement(b,l,B,"label",null,{id:x,"for":q.id},m[0]);a.push(B.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
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=[],k={id:e.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};d.push('\x3cdiv class\x3d"cke_dialog_ui_input_',
|
|
558
558
|
c.type,'" role\x3d"presentation"');c.width&&d.push('style\x3d"width:'+c.width+'" ');d.push("\x3e");void 0!==c.size&&(k.size=c.size);void 0!==c.multiple&&(k.multiple=c.multiple);g(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,
|
|
@@ -579,47 +579,47 @@ 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 g(a){var b=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",
|
|
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 g(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
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 k(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,
|
|
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,q=l-c.x,u=n-c.y;c={x:l,y:n};e.x+=q;e.y+=u;l=e.x+
|
|
586
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=A.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup",d)}}var c=null,e=null,f=a.getParentEditor(),
|
|
587
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=A.getChild(0).getFrameDocument(),g.on("mousemove",b),g.on("mouseup",d));f.data.preventDefault()},
|
|
588
|
-
a)}function
|
|
589
|
-
e==CKEDITOR.DIALOG_RESIZE_BOTH)
|
|
590
|
-
a.getParentEditor(),g,k,h,m,l,n,
|
|
588
|
+
a)}function t(a){function b(d){var n="rtl"==f.lang.dir,q=l.width,u=l.height,t=q+(d.data.$.screenX-m.x)*(n?-1:1)*(a._.moved?1:2),p=u+(d.data.$.screenY-m.y)*(a._.moved?1:2),z=a._.element.getFirst(),z=n&&parseInt(z.getComputedStyle("right"),10),v=a.getPosition();v.x=v.x||0;v.y=v.y||0;v.y+p>h.height&&(p=h.height-v.y);(n?z:v.x)+t>h.width&&(t=h.width-(n?z:v.x));p=Math.floor(p);t=Math.floor(t);if(e==CKEDITOR.DIALOG_RESIZE_WIDTH||e==CKEDITOR.DIALOG_RESIZE_BOTH)q=Math.max(c.minWidth||0,t-g);if(e==CKEDITOR.DIALOG_RESIZE_HEIGHT||
|
|
589
|
+
e==CKEDITOR.DIALOG_RESIZE_BOTH)u=Math.max(c.minHeight||0,p-k);a.resize(q,u);a._.moved&&w(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=A.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,q=CKEDITOR.tools.addFunction(function(c){function e(a){return a.isVisible()}l=a.getSize();var f=a.parts.contents,q=f.$.getElementsByTagName("iframe").length,u=!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks);q&&(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",u);
|
|
591
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=A.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('+
|
|
593
|
-
a._.viewportRatio=f}function
|
|
592
|
+
b+" cke_resizer_"+f.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(f.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+q+', event )"\x3e'+("ltr"==f.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(b,1)});f.on("destroy",function(){CKEDITOR.tools.removeFunction(q)})}}function w(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 r(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",
|
|
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);A=f;CKEDITOR.env.mac&&CKEDITOR.env.webkit||f.focus()}function v(a){CKEDITOR.document.getBody().removeClass("cke_dialog_open");A&&(a.focusManager.remove(A),A.hide())}function z(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=J[(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 u(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,d=a.data.$.altKey,c=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);(b=J[(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 D(a,b,d,c,e){(J[d]||(J[d]=[])).push({uiElement:a,
|
|
597
|
+
dialog:b,key:d,keyup:e||a.accessKeyUp,keydown:c||a.accessKeyDown})}function p(a){for(var b in J){for(var d=J[b],c=d.length-1;0<=c;c--)d[c].dialog!=a&&d[c].uiElement!=a||d.splice(c,1);0===d.length&&delete J[b]}}function x(a,b){a._.accessKeyMap[b]&&a.selectPage(a._.accessKeyMap[b])}function q(){}var B=CKEDITOR.tools.cssLength,C,A,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,k(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=z.parts;CKEDITOR.tools.setTimeout(function(){b.fire("ariaWidget",this.parts.contents)},0,this);z={top:0,visibility:"hidden"};CKEDITOR.env.ie6Compat&&(z.position="absolute");z["rtl"==
|
|
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){
|
|
607
|
-
|
|
608
|
-
1,
|
|
609
|
-
a(this),b.data.preventDefault())},this);
|
|
599
|
+
CKEDITOR.dialog=function(b,d){function f(){var a=r._.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 k(a){var b=r._.focusList;a=a||0;if(!(1>b.length)){var d=r._.currentFocusIndex;r._.tabBarMode&&0>a&&(d=0);try{b[d].getInputElement().$.blur()}catch(c){}var e=d,f=1<r._.pageCount;do{e+=a;if(f&&!r._.tabBarMode&&(e==b.length||-1==e)){r._.tabBarMode=!0;r._.tabs[r._.currentTabId][0].focus();
|
|
600
|
+
r._.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 q(d){if(r==CKEDITOR.dialog._.currentTop){var c=d.data.getKeystroke(),e="rtl"==b.lang.dir,f=[37,38,39,40];D=w=0;if(9==c||c==CKEDITOR.SHIFT+9)k(c==CKEDITOR.SHIFT+9?-1:1),D=1;else if(c==CKEDITOR.ALT+121&&!r._.tabBarMode&&1<r.getPageCount())a(r),D=1;else if(-1!=CKEDITOR.tools.indexOf(f,c)&&r._.tabBarMode)c=-1!=CKEDITOR.tools.indexOf([e?39:37,38],c)?
|
|
601
|
+
l.call(r):h.call(r),r.selectPage(c),r._.tabs[c][0].focus(),D=1;else if(13!=c&&32!=c||!r._.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),D=1),w=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(),w=1;else return;else this.selectPage(this._.currentTabId),this._.tabBarMode=!1,this._.currentFocusIndex=
|
|
602
|
+
-1,k(1),D=1;u(d)}}function u(a){D?a.data.preventDefault(1):w&&a.data.stopPropagation()}var p=CKEDITOR.dialog._.dialogDefinitions[d],z=CKEDITOR.tools.clone(C),v=b.config.dialog_buttonsOrder||"OS",B=b.lang.dir,x={},D,w;("OS"==v&&CKEDITOR.env.mac||"rtl"==v&&"ltr"==B||"ltr"==v&&"rtl"==B)&&z.buttons.reverse();p=CKEDITOR.tools.extend(p(b),z);p=CKEDITOR.tools.clone(p);p=new c(this,p);z=g(b);this._={editor:b,element:z.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=z.parts;CKEDITOR.tools.setTimeout(function(){b.fire("ariaWidget",this.parts.contents)},0,this);z={top:0,visibility:"hidden"};CKEDITOR.env.ie6Compat&&(z.position="absolute");z["rtl"==B?"right":"left"]=0;this.parts.dialog.setStyles(z);CKEDITOR.event.call(this);this.definition=p=CKEDITOR.fire("dialogDefinition",
|
|
604
|
+
{name:d,definition:p,dialog:this},b).definition;if(!("removeDialogTabs"in b._)&&b.config.removeDialogTabs){z=b.config.removeDialogTabs.split(";");for(B=0;B<z.length;B++)if(v=z[B].split(":"),2==v.length){var A=v[0];x[A]||(x[A]=[]);x[A].push(v[1])}b._.removeDialogTabs=x}if(b._.removeDialogTabs&&(x=b._.removeDialogTabs[d]))for(B=0;B<x.length;B++)p.removeContents(x[B]);if(p.onLoad)this.on("load",p.onLoad);if(p.onShow)this.on("show",p.onShow);if(p.onHide)this.on("hide",p.onHide);if(p.onOk)this.on("ok",
|
|
605
|
+
function(a){b.fire("saveSnapshot");setTimeout(function(){b.fire("saveSnapshot")},0);!1===p.onOk.call(this,a)&&(a.data.hide=!1)});this.state=CKEDITOR.DIALOG_STATE_IDLE;if(p.onCancel)this.on("cancel",function(a){!1===p.onCancel.call(this,a)&&(a.data.hide=!1)});var r=this,y=function(a){var b=r._.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=k;var G=this._.element;b.focusManager.add(G,1);this.on("show",function(){G.on("keydown",q,this);if(CKEDITOR.env.gecko)G.on("keypress",
|
|
607
|
+
u,this)});this.on("hide",function(){G.removeListener("keydown",q);CKEDITOR.env.gecko&&G.removeListener("keypress",u);y(function(a){m.apply(a)})});this.on("iframeAdded",function(a){(new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown",q,this,null,0)});this.on("show",function(){f();var a=1<r._.pageCount;b.config.dialog_startupFocusTab&&a?(r._.tabBarMode=!0,r._.tabs[r._.currentTabId][0].focus(),r._.currentFocusIndex=-1):this._.hasFocus||(this._.currentFocusIndex=a?-1:this._.focusList.length-
|
|
608
|
+
1,p.onFocus?(a=p.onFocus.call(this))&&a.focus():k(1))},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on("load",function(){var a=this.getElement(),b=a.getFirst();b.remove();b.appendTo(a)},this);n(this);t(this);(new CKEDITOR.dom.text(p.title,CKEDITOR.document)).appendTo(this.parts.title);for(B=0;B<p.contents.length;B++)(x=p.contents[B])&&this.addPage(x);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);B=[];x=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:p.buttons},B).getChild();this.parts.footer.setHtml(B.join(""));for(B=0;B<x.length;B++)this._.buttons[x[B].id]=x[B]};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)):w(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",z);a.on("keyup",
|
|
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,r(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",z);a.on("keyup",u);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",z);a.removeListener("keyup",
|
|
618
|
+
var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility","hidden");for(p(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 v(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=
|
|
619
|
+
10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",z);a.removeListener("keyup",u);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&&(D(this,this,"CTRL+"+a.accessKey,q,x),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,
|
|
@@ -628,16 +628,16 @@ b){if("undefined"==typeof b)b=this._.focusList.length,this._.focusList.push(new
|
|
|
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
|
|
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 I=function(a,b,d){for(var c=0,e;e=a[c];c++)if(e.id==b||d&&e[d]&&(e=I(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 I(this.contents,a)},getButton:function(a){return I(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 I(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={},J={};(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)||"",q=this.domId=l.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(m.display="none",this.notAllowed=!0);l.id=q;var u={};b.type&&(u["cke_dialog_ui_"+b.type]=1);b.className&&(u[b.className]=
|
|
634
|
+
1);b.disabled&&(u.cke_disabled=1);for(var t=l["class"]&&l["class"].split?l["class"].split(" "):[],q=0;q<t.length;q++)t[q]&&(u[t[q]]=1);t=[];for(q in u)t.push(q);l["class"]=t.join(" ");b.title&&(l.title=b.title);u=(b.style||"").split(";");b.align&&(t=b.align,m["margin-left"]="left"==t?0:"auto",m["margin-right"]="right"==t?0:"auto");for(q in m)u.push(q+":"+m[q]);b.hidden&&u.push("display:none");for(q=u.length-1;0<=q;q--)""===u[q]&&u.splice(q,1);0<u.length&&(l.style=(l.style?l.style+"; ":"")+u.join("; "));
|
|
635
|
+
for(q in l)h.push(q+'\x3d"'+CKEDITOR.tools.htmlEncode(l[q])+'" ');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&&D(this,a,"CTRL+"+b.accessKey);var p=this;a.on("load",function(){var b=p.getInputElement();if(b){var d=p.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;p.fire("focus");d&&this.addClass(d)});b.on("blur",function(){p.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=p.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:"+B(g[h])):c.push("width:"+Math.floor(100/d.length)+"%");k&&c.push("height:"+B(k));e&&void 0!==e.padding&&c.push("padding:"+B(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:"+B(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:"+B(g||"100%"));k?h.push("height:"+B(k[c])):e&&e.expand&&h.push("height:"+Math.floor(100/d.length)+"%");e&&void 0!==e.padding&&h.push("padding:"+B(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();
|
|
@@ -646,8 +646,8 @@ this.getInputElement().setAttribute("disabled","true");a.addClass("cke_disabled"
|
|
|
646
646
|
g,f,d,b)}};CKEDITOR.dialog.addUIElement("hbox",a);CKEDITOR.dialog.addUIElement("vbox",a)})();CKEDITOR.dialogCommand=function(a,b){this.dialogName=a;CKEDITOR.tools.extend(this,b,!0)};CKEDITOR.dialogCommand.prototype={exec:function(a){var b=this.tabId;a.openDialog(this.dialogName,function(a){b&&a.selectPage(b)})},canUndo:!1,editorFocus:1};(function(){var a=/^([a]|[^a])+$/,b=/^\d*$/,d=/^\d*(?:\.\d+)?$/,c=/^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,e=/^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,
|
|
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
|
-
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
|
|
650
|
-
null===CKEDITOR.dialog._.currentTop&&
|
|
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&&r(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 v(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
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,g){var k,b;"progress"==f?k=g:b=g;e=new CKEDITOR.plugins.notification(a,{message:e,type:f,progress:k,duration:b});e.show();return e};a.on("key",function(e){if(27==
|
|
@@ -658,72 +658,72 @@ a.progress&&"progress"!=this.type&&(k="progress");k&&(e.removeClass(this._getCla
|
|
|
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",z(
|
|
662
|
-
this.editor,m=e.ui.contentsElement.getClientRect(),g=e.ui.contentsElement.getDocumentPosition(),k,b,c=f.getClientRect(),d,l=this._notificationWidth,
|
|
663
|
-
10));e.toolbar&&(k=e.ui.space(e.config.toolbarLocation),b=k.getClientRect());k&&k.isVisible()&&b.bottom>m.top&&b.bottom<m.bottom-c.height?f.setStyles({position:"fixed",top:z(b.bottom)}):0<m.top?f.setStyles({position:"absolute",top:z(g.y)}):g.y+m.height-c.height>
|
|
664
|
-
f.setStyle("left",z(
|
|
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",z(u+m.width-l-t))}var f=this.element,e=
|
|
662
|
+
this.editor,m=e.ui.contentsElement.getClientRect(),g=e.ui.contentsElement.getDocumentPosition(),k,b,c=f.getClientRect(),d,l=this._notificationWidth,t=this._notificationMargin;d=CKEDITOR.document.getWindow();var w=d.getScrollPosition(),y=d.getViewPaneSize(),r=CKEDITOR.document.getBody(),v=r.getDocumentPosition(),z=CKEDITOR.tools.cssLength;l&&t||(d=this.element.getChild(0),l=this._notificationWidth=d.getClientRect().width,t=this._notificationMargin=parseInt(d.getComputedStyle("margin-left"),10)+parseInt(d.getComputedStyle("margin-right"),
|
|
663
|
+
10));e.toolbar&&(k=e.ui.space(e.config.toolbarLocation),b=k.getClientRect());k&&k.isVisible()&&b.bottom>m.top&&b.bottom<m.bottom-c.height?f.setStyles({position:"fixed",top:z(b.bottom)}):0<m.top?f.setStyles({position:"absolute",top:z(g.y)}):g.y+m.height-c.height>w.y?f.setStyles({position:"fixed",top:0}):f.setStyles({position:"absolute",top:z(g.y+m.height-c.height)});var u="fixed"==f.getStyle("position")?m.left:"static"!=r.getComputedStyle("position")?g.x-v.x:g.x;m.width<l+t?g.x+l+t>w.x+y.width?a():
|
|
664
|
+
f.setStyle("left",z(u)):g.x+l+t>w.x+y.width?f.setStyle("left",z(u)):g.x+m.width/2+l/2+t>w.x+y.width?f.setStyle("left",z(u-g.x+w.x+y.width-l-t)):0>m.left+m.width-l-t?a():0>m.left+m.width/2-l/2?f.setStyle("left",z(u-g.x+w.x)):f.setStyle("left",z(u+m.width/2-l/2-t/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
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 g(){var b=a.mode;b&&(b=this.modes[b]?void 0!==k[b]?k[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 k=null,b=CKEDITOR.env,c=this._.id=CKEDITOR.tools.getNextId(),d="",l=this.command,
|
|
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:
|
|
668
|
+
b,this.setState(b),this.refresh&&this.refresh())}var k=null,b=CKEDITOR.env,c=this._.id=CKEDITOR.tools.getNextId(),d="",l=this.command,t,w,y;this._.editor=a;var r={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)}},v=CKEDITOR.tools.addFunction(function(a){if(r.onkey)return a=new CKEDITOR.dom.event(a),!1!==r.onkey(r,a.getKeystroke())}),z=CKEDITOR.tools.addFunction(function(a){var b;r.onfocus&&
|
|
669
|
+
(b=!1!==r.onfocus(r,new CKEDITOR.dom.event(a)));return b}),u=0;r.clickFn=t=CKEDITOR.tools.addFunction(function(){u&&(a.unlockSelection(1),u=0);r.execute();b.iOS&&a.focus()});this.modes?(k={},a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(k[a.mode]=this._.state)},this),a.on("activeFilterChange",g,this),a.on("mode",g,this),!this.readOnly&&a.on("readOnly",g,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 D;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(D,"rtl"==b,this.icon,this.iconOffset))},this);l?(w=a.getCommandKeystroke(l))&&(y=CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard,w)):d+="off";w=this.name||this.command;var p=
|
|
671
|
+
null,x=this.icon;D=w;this.icon&&!/\./.test(this.icon)?(D=this.icon,x=null):(this.icon&&(p=this.icon),CKEDITOR.env.hidpi&&this.iconHiDpi&&(p=this.iconHiDpi));p?(CKEDITOR.skin.addIcon(p,p),x=null):p=D;d={id:c,name:w,iconName:D,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:v,focusFn:z,clickFn:t,style:CKEDITOR.skin.getIconStyle(p,"rtl"==a.lang.dir,x,this.iconOffset),arrowHtml:this.hasArrow?h.output():""};f.output(d,m);if(this.onRender)this.onRender();return r},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
|
-
g(),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,
|
|
674
|
+
g(),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,v=h.groups;if(v)for(var z=0;z<v.length;z++)m=v[z],(m=b[m])&&k(h,m);(m=b[h.name])&&k(h,m)}}return d}function g(){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
675
|
1:a.order<b.order?-1:1});return b}function k(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)?(k(e,CKEDITOR.tools.clone(c)),b.push(e)):c.items&&(k(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
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 g=0,k;k=f.items[g++];)if(k.focus){k.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
|
|
679
|
-
f&&(c=a.toolbar.items[0]);while(c&&!c.focus);c?c.focus():g(a,9);return!1;case 40:return a.button&&a.button.hasArrow?a.execute():g(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():(
|
|
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,
|
|
681
|
-
|
|
682
|
-
if(!z){
|
|
683
|
-
d=1):d&&(c.push("\x3c/span\x3e"),d=0);
|
|
678
|
+
{requires:"button",init:function(e){var l,g=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():g(a,9);return!1;case 40:return a.button&&a.button.hasArrow?a.execute():g(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,g(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,w=a(e),y=w.length,
|
|
681
|
+
r=0;r<y;r++){var v,z=0,u,D=w[r],p="/"!==D&&("/"===w[r+1]||r==y-1),x;if(D)if(d&&(c.push("\x3c/span\x3e"),l=d=0),"/"===D)c.push('\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e');else{x=D.items||D;for(var q=0;q<x.length;q++){var B=x[q],C;if(B){var A=function(a){a=a.render(e,c);G=z.items.push(a)-1;0<G&&(a.previous=z.items[G-1],a.previous.next=a);a.toolbar=z;a.onkey=g;a.onfocus=function(){e.toolbox.focusCommandExecuted||e.focus()}};if(B.type==CKEDITOR.UI_SEPARATOR)l=d&&B;else{C=!1!==B.canGroup;
|
|
682
|
+
if(!z){v=CKEDITOR.tools.getNextId();z={id:v,items:[]};u=D.name&&(e.lang.toolbar.toolbarGroups[D.name]||D.name);c.push('\x3cspan id\x3d"',v,'" class\x3d"cke_toolbar'+(p?' cke_toolbar_last"':'"'),u?' aria-labelledby\x3d"'+v+'_label"':"",' role\x3d"toolbar"\x3e');u&&c.push('\x3cspan id\x3d"',v,'_label" class\x3d"cke_voice_label"\x3e',u,"\x3c/span\x3e");c.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e');var G=m.push(z)-1;0<G&&(z.previous=m[G-1],z.previous.next=z)}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&&(A(l),l=0);A(B)}}}d&&(c.push("\x3c/span\x3e"),l=d=0);z&&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
|
-
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('+
|
|
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
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,g){var k=l(this.editor),b=0===f,c={name:a};if(g){if(g=CKEDITOR.tools.search(k,function(a){return a.name==g})){!g.groups&&(g.groups=[]);if(f&&(f=CKEDITOR.tools.indexOf(g.groups,f),0<=f)){g.groups.splice(f+1,0,a);return}b?g.groups.splice(0,0,a):g.groups.push(a);
|
|
688
688
|
return}f=null}f&&(f=CKEDITOR.tools.indexOf(k,function(a){return a.name==f}));b?k.splice(0,0,a):"number"==typeof f?k.splice(f+1,0,c):k.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&&A||
|
|
690
|
-
(g(),a.data.preventDefault(),
|
|
691
|
-
67,exec:function(){"cut"==this.type&&
|
|
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&&A||x(a)});"beforepaste"==C.mainPasteEvent&&(a.on("paste",function(a){G||
|
|
690
|
+
(g(),a.data.preventDefault(),x(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(){!A&&l(b)});var f;a.attachListener(CKEDITOR.env.ie?a:b.document.getDocumentElement(),"mouseup",function(){f=setTimeout(q,0)});b.on("destroy",function(){clearTimeout(f)});a.on("keyup",q)}function e(a){return{type:a,canUndo:"cut"==a,startDisabled:!0,fakeKeystroke:"cut"==a?CKEDITOR.CTRL+88:CKEDITOR.CTRL+
|
|
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(){A=1;setTimeout(function(){A=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
|
|
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
|
|
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)):
|
|
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,A=0,G=0;(function(){b.on("key",
|
|
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(){A=1;setTimeout(function(){A=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 q=new CKEDITOR.dom.element(!CKEDITOR.env.webkit&&
|
|
695
|
+
!f.is("body")||CKEDITOR.env.ie?"div":"body",e);q.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var n=0,e=e.getWindow();CKEDITOR.env.webkit?(f.append(q),q.addClass("cke_editable"),f.is("body")||(n="static"!=f.getComputedStyle("position")?f:CKEDITOR.dom.element.get(f.$.offsetParent),n=n.getDocumentPosition().y)):f.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(q);q.setStyles({position:"absolute",top:e.getScrollPosition().y-n+10+"px",width:"1px",height:Math.max(1,e.getViewPaneSize().height-
|
|
696
|
+
20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&q.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text"));(n=q.getParent().isReadOnly())?(q.setOpacity(0),q.setAttribute("contenteditable",!0)):q.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);n&&q.focus();n=new CKEDITOR.dom.range(q);n.selectNodeContents(q);var u=n.select();CKEDITOR.env.ie&&
|
|
697
|
+
(k=f.once("blur",function(){b.lockSelection(u)}));var p=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=p);k&&k.removeListener();CKEDITOR.env.ie&&f.focus();h.selectBookmarks(l);q.remove();var a;CKEDITOR.env.webkit&&(a=q.getFirst())&&a.is&&a.hasClass("Apple-style-span")&&(q=a);b.removeListener("selectionChange",g);c(q.getHtml())},0)}}function D(){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 p(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 x(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 q(){if("wysiwyg"==b.mode){var a=B("paste");b.getCommand("cut").setState(B("cut"));b.getCommand("copy").setState(B("copy"));b.getCommand("paste").setState(a);b.fire("pasteState",a)}}function B(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,A=0,G=0;(function(){b.on("key",p);b.on("contentDom",c);b.on("selectionChange",q);if(b.contextMenu){b.contextMenu.addListener(function(){return{cut:B("cut"),
|
|
701
|
+
copy:B("copy"),paste:B("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===D()&&(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
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 g(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
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 g(a,b){a.enterMode==CKEDITOR.ENTER_BR?b=b.replace(/(<\/p><p>)+/g,function(a){return CKEDITOR.tools.repeat("\x3cbr\x3e",
|
|
708
708
|
a.length/7*2)}).replace(/<\/?p>/g,""):a.enterMode==CKEDITOR.ENTER_DIV&&(b=b.replace(/<(\/)?p>/g,"\x3c$1div\x3e"));return b}function k(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(),
|
|
710
|
-
h.attachListener(
|
|
711
|
-
c.initDragDataTransfer,c,null,1);h.attachListener(b,"dragend",c.resetDragDataTransfer,c,null,100);h.attachListener(
|
|
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"),D=b.ui.space("bottom");c.preventDefaultDropOnElement(m);c.preventDefaultDropOnElement(D);
|
|
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
|
+
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
|
|
715
|
-
|
|
713
|
+
null,null,9999)})}var c;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",init:function(a){function c(a){if(!a||r===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"],r;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
|
+
r=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,q=!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||q)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)&&
|
|
722
722
|
c!=d.getChildCount())return a=b.startContainer.getChild(b.startOffset-1),d=b.startContainer.getChild(b.startOffset),a&&a.type==CKEDITOR.NODE_TEXT&&d&&d.type==CKEDITOR.NODE_TEXT&&(c=a.getLength(),a.setText(a.getText()+d.getText()),d.remove(),b.setStart(a,c),b.collapse(!0)),!0}var g=b.startContainer;"number"==typeof e&&"number"==typeof c&&g.type==CKEDITOR.NODE_ELEMENT&&(f(a.startContainer,g,c)||f(a.endContainer,g,e))},isDropRangeAffectedByDragRange:function(a,b){var c=b.startContainer,e=b.endOffset;
|
|
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,
|
|
724
|
-
c))||(h=b.createBookmark(!1));g=c.clone().createBookmark(!1);
|
|
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
|
+
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,
|
|
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(p){}}if(h){var x="cke-temp-"+(new Date).getTime();c.pasteHTML('\x3cspan id\x3d"'+x+'"\x3e\x3c/span\x3e');var q=b.document.getById(x);k.moveToPosition(q,CKEDITOR.POSITION_BEFORE_START);q.remove()}else{var B=b.document.$.elementFromPoint(e,f),C=new CKEDITOR.dom.element(B),A;if(C.equals(b.editable())||
|
|
727
727
|
"html"==C.getName())return g&&g.startContainer&&!g.startContainer.equals(b.editable())?g:null;A=C.getClientRect();e<A.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
729
|
a.data.$.clipboardData||null,b)},preventDefaultDropOnElement:function(a){a&&a.on("dragover",k)}};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"==
|
|
@@ -753,33 +753,33 @@ e){this.element=a.append(a.getDocument().createElement("div",{attributes:{tabind
|
|
|
753
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,k,b=h.count()-1;0<=b;b--)if(g=h.getItem(b),g.getAscendant(e)||(k=g,this._.focusIndex=b),"true"==g.getAttribute("aria-selected")){k=g;this._.focusIndex=b;break}k&&(a&&a(),CKEDITOR.env.webkit&&k.getDocument().getWindow().focus(),k.focus(),this.onMark&&this.onMark(k))},getItems:function(){return this.element.find("a,input")}},
|
|
754
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 g=this._.focusIndex,h=this._.getItems(),k;k=h.getItem(++g);)if(k.getAttribute("_cke_focus")&&k.$.offsetWidth){this._.focusIndex=g;k.focus(!0);break}return k||e?!1:(this._.focusIndex=-1,this.onKeyDown(a,1));case "prev":g=this._.focusIndex;for(h=this._.getItems();0<g&&(k=
|
|
755
755
|
h.getItem(--g));){if(k.getAttribute("_cke_focus")&&k.$.offsetWidth){this._.focusIndex=g;k.focus(!0);break}k=null}return k||e?!1:(this._.focusIndex=h.count(),this.onKeyDown(a,1));case "click":case "mouseup":return g=this._.focusIndex,(k=0<=g&&this._.getItems().getItem(g))&&k.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,g){g=CKEDITOR.tools.genKey(f.getUniqueId(),
|
|
756
|
-
e.getUniqueId(),a.lang.dir,a.uiColor||"",m.css||"",g||"");var k=l[g];k||(k=l[g]=new CKEDITOR.ui.panel(f,m),k.element=e.append(CKEDITOR.dom.element.createFromHtml(k.render(a),f)),k.element.setStyles({display:"none",position:"absolute"}));return k}var l={};CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(h,f,e,
|
|
757
|
-
f,e,
|
|
758
|
-
showBlock:function(a,f,e,
|
|
759
|
-
{x:0,y:0},
|
|
756
|
+
e.getUniqueId(),a.lang.dir,a.uiColor||"",m.css||"",g||"");var k=l[g];k||(k=l[g]=new CKEDITOR.ui.panel(f,m),k.element=e.append(CKEDITOR.dom.element.createFromHtml(k.render(a),f)),k.element.setStyles({display:"none",position:"absolute"}));return k}var l={};CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(h,f,e,l){function g(){d.hide()}e.forceIFrame=1;e.toolbarRelated&&h.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(f=CKEDITOR.document.getById("cke_"+h.name));var k=f.getDocument();l=a(h,k,
|
|
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:k,iframe:c,children:[],dir:h.lang.dir,showBlockParams:null,markFirst:void 0!==e.markFirst?e.markFirst:!0};h.on("mode",g);h.on("resize",g);k.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,g,k){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),t=n.getDocument(),w=this._.parentElement.getPositionedAncestor(),y=f.getDocumentPosition(t),t=w?w.getDocumentPosition(t):
|
|
759
|
+
{x:0,y:0},r="rtl"==this._.dir,v=y.x+(l||0)-t.x,z=y.y+(g||0)-t.y;!r||1!=e&&4!=e?r||2!=e&&3!=e||(v+=f.$.offsetWidth-1):v+=f.$.offsetWidth;if(3==e||4==e)z+=f.$.offsetHeight-1;this._.panel._.offsetParentId=f.getId();n.setStyles({top:z+"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
|
-
!1===this.onEscape(a))return!1},this);CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.tools.bind(function(){var a=
|
|
762
|
-
0)+3);a.setStyle("height",d+"px");b._.currentBlock.element.setStyle("display","none").removeStyle("display")}else a.removeStyle("height");
|
|
763
|
-
a.top<f&&(z=e>f?z-f:d.height>f?z-a.bottom+d.height:z-a.top);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&((d=a=
|
|
764
|
-
|
|
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");r&&(v-=n.$.offsetWidth);n.setStyle("left",v+"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,g=r?a.right:d.width-a.left,h=r?d.width-a.right:a.left;r?g<e&&(v=h>e?v+e:d.width>e?v-a.left:v-a.right+d.width):g<e&&(v=h>e?v-e:d.width>e?v-a.right+d.width:v-a.left);e=a.top;d.height-
|
|
763
|
+
a.top<f&&(z=e>f?z-f:d.height>f?z-a.bottom+d.height:z-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")&&(v=CKEDITOR.env.ie8Compat?v-2*n.getDocument().getDocumentElement().$.scrollLeft:v-(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:z+"px",left:v+"px"});n.setOpacity(1);k&&k()},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,
|
|
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,
|
|
769
|
-
f+"Style"]),z=CKEDITOR.tools.getNextId()+"_colorBox",
|
|
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!==g.colorButton_enableAutomatic&&this._.panel._.iframe.getFrameDocument().getById(z).setStyle("background-color",d);if(c=b&&b.getRanges()[0]){for(var b=new CKEDITOR.dom.walker(c),k=c.collapsed?c.startContainer:b.next(),c="";k;){k.type!==CKEDITOR.NODE_ELEMENT&&(k=k.getParent());k=m(k.getComputedStyle("back"==f?"background-color":"color"));c=c||k;if(c!==k){c="";break}k=b.next()}"transparent"==c&&(c="");"fore"==f&&(
|
|
773
|
-
"#"+m(d));
|
|
774
|
-
f(a)};var
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
k.more,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',
|
|
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,k){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,g,k),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,r=b.commandName;b=b.contentTransformations||{};var v=new CKEDITOR.style(g["colorButton_"+
|
|
769
|
+
f+"Style"]),z=CKEDITOR.tools.getNextId()+"_colorBox",u={type:f},D=new CKEDITOR.style(g["colorButton_"+f+"Style"],{color:"inherit"}),p;a.addCommand(r,{contextSensitive:!0,exec:function(a,b){if(!a.readOnly){var c=b.newStyle;a.removeStyle(D);a.focus();c&&a.applyStyle(c);a.fire("saveSnapshot")}},refresh:function(a,b){D.checkApplicable(b,a,a.activeFilter)?D.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:r,editorFocus:0,toolbar:"colors,"+y,allowedContent:v,requiredContent:v,contentTransformations:b,panel:{css:CKEDITOR.skin.getPath("editor"),attributes:{role:"listbox","aria-label":k.panelTitle}},select:function(a){var b=g.colorButton_colors.split(",");a=CKEDITOR.tools.array.find(b,a);a=m(a);e(p,a);p._.markFirstDisplayed()},onBlock:function(b,c){p=c;c.autoSize=!0;c.element.addClass("cke_colorblock");c.element.setHtml(h({type:f,colorBoxId:z,colorData:u,
|
|
771
|
+
commandName:r}));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!==g.colorButton_enableAutomatic&&this._.panel._.iframe.getFrameDocument().getById(z).setStyle("background-color",d);if(c=b&&b.getRanges()[0]){for(var b=new CKEDITOR.dom.walker(c),k=c.collapsed?c.startContainer:b.next(),c="";k;){k.type!==CKEDITOR.NODE_ELEMENT&&(k=k.getParent());k=m(k.getComputedStyle("back"==f?"background-color":"color"));c=c||k;if(c!==k){c="";break}k=b.next()}"transparent"==c&&(c="");"fore"==f&&(u.automaticTextColor=
|
|
773
|
+
"#"+m(d));u.selectionColor=c?"#"+c:"";e(p,c)}return d}})}function h(b){function c(b){b=b&&new CKEDITOR.style(p,{color:b});a.execCommand(m,{newStyle:b})}var e=b.type,h=b.colorBoxId,l=b.colorData,m=b.commandName;b=[];var v=g.colorButton_colors.split(","),z=g.colorButton_colorsPerRow||6,u=a.plugins.colordialog&&!1!==g.colorButton_enableMore,D=v.length+(u?2:1),p=a.config["colorButton_"+e+"Style"];p.childRule="back"==e?function(a){return f(a)}:function(a){return!(a.is("a")||a.getElementsByTag("a").count())||
|
|
774
|
+
f(a)};var x=CKEDITOR.tools.addFunction(function(b){a.focus();a.fire("saveSnapshot");"?"==b?a.getColorFromDialog(function(a){a&&c(a)},null,l):c(b&&"#"+b)});!1!==g.colorButton_enableAutomatic&&b.push('\x3ca class\x3d"cke_colorauto" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',k.auto,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',x,",null,'",e,"');return false;\" href\x3d\"javascript:void('",k.auto,'\')" role\x3d"option" aria-posinset\x3d"1" aria-setsize\x3d"',
|
|
775
|
+
D,'"\x3e\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e\x3ctr\x3e\x3ctd colspan\x3d"'+z+'" align\x3d"center"\x3e\x3cspan class\x3d"cke_colorbox" id\x3d"',h,'"\x3e\x3c/span\x3e',k.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<v.length;h++){0===h%z&&b.push("\x3c/tr\x3e\x3ctr\x3e");var q=v[h].split("/"),B=q[0],C=q[1]||B;b.push('\x3ctd\x3e\x3ca class\x3d"cke_colorbox" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
|
|
776
|
+
q[1]?B:a.lang.colorbutton.colors[C]||C,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',x,",'",C,"','",e,"'); return false;\" href\x3d\"javascript:void('",C,'\')" data-value\x3d"'+C+'" role\x3d"option" aria-posinset\x3d"',h+2,'" aria-setsize\x3d"',D,'"\x3e\x3cspan class\x3d"cke_colorbox" style\x3d"background-color:#',C,'"\x3e\x3c/span\x3e\x3c/a\x3e\x3c/td\x3e')}u&&b.push('\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d"'+z+'" align\x3d"center"\x3e\x3ca class\x3d"cke_colormore" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
|
|
777
|
+
k.more,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',x,",'?','",e,"');return false;\" href\x3d\"javascript:void('",k.more,"')\"",' role\x3d"option" aria-posinset\x3d"',D,'" aria-setsize\x3d"',D,'"\x3e',k.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
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 g=a.config,k=a.lang.colorbutton;if(!CKEDITOR.env.hc){l({name:"TextColor",type:"fore",commandName:"textColor",title:k.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
780
|
b.styles=c.styles;b.attributes=c.attributes||{};return b}}]];l({name:"BGColor",type:"back",commandName:"bgColor",title:k.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
|
|
782
|
-
a);h.call(f,a)};g=function(a){e&&(a.data=e)};k=function(a){a.removeListener("ok",
|
|
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,k,b;l=function(a){k(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)};g=function(a){e&&(a.data=e)};k=function(a){a.removeListener("ok",l);a.removeListener("cancel",l);a.removeListener("show",g)};b=function(a){a.on("ok",l);a.on("cancel",l);a.on("show",g,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
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 k=CKEDITOR.plugins.copyformatting;k._addScreenReaderContainer();
|
|
785
785
|
m||(CKEDITOR.document.appendStyleSheet(this.path+"styles/copyformatting.css"),m=!0);a.addContentsCss&&a.addContentsCss(this.path+"styles/copyformatting.css");a.copyFormatting=new k.state(a);a.addCommand("copyFormatting",k.commands.copyFormatting);a.addCommand("applyFormatting",k.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(),
|
|
@@ -788,18 +788,18 @@ d=c.isInline()?c:a.document,f=a.ui.get("CopyFormatting");c.attachListener(d,"mou
|
|
|
788
788
|
c=k._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=k._extractStylesFromRange(a,c),e=k._determineContext(c),h,m;if(a.copyFormatting._isContextAllowed(e))for(m=0;m<d.length;m++)e=d[m],h=c.createBookmark(),-1===f(k.preservedElements,e.element)?CKEDITOR.env.webkit&&!CKEDITOR.env.chrome?d[m].removeFromRange(b.data.range,
|
|
789
789
|
b.editor):d[m].remove(b.editor):l(e.element,b.data.styles)&&k._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
|
-
"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),
|
|
792
|
-
|
|
793
|
-
b._putScreenReaderMessage(a,"copied");b._attachPasteKeystrokeHandler(a)}},applyFormatting:{editorFocus:CKEDITOR.env.ie&&!CKEDITOR.env.edge?!1:!0,exec:function(a,e){var b=a.getCommand("copyFormatting"),c=e?"keystrokeHandler"==e.from:!1,d=CKEDITOR.plugins.copyformatting,f=a.copyFormatting,h=d._getCursorContainer(a),
|
|
794
|
-
null,h.removeClass("cke_copyformatting_active"),
|
|
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
|
+
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;
|
|
793
|
+
b._putScreenReaderMessage(a,"copied");b._attachPasteKeystrokeHandler(a)}},applyFormatting:{editorFocus:CKEDITOR.env.ie&&!CKEDITOR.env.edge?!1:!0,exec:function(a,e){var b=a.getCommand("copyFormatting"),c=e?"keystrokeHandler"==e.from:!1,d=CKEDITOR.plugins.copyformatting,f=a.copyFormatting,h=d._getCursorContainer(a),l=CKEDITOR.document.getDocumentElement();if(c&&!f.styles)return d._putScreenReaderMessage(a,"failed"),d._detachPasteKeystrokeHandler(a),!1;c=d._applyFormat(a,f.styles);f.sticky||(f.styles=
|
|
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 g=a,h=/\s/g,
|
|
798
|
-
CKEDITOR.NODE_TEXT;)g=!
|
|
799
|
-
(h=c(
|
|
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,
|
|
801
|
-
e._.definition.element="span",
|
|
802
|
-
[c]),f.moveToBookmark(d)},_applyStylesToTableContext:function(e,k,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,
|
|
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 g=a,h=/\s/g,l="p br ol ul li td th div caption body".split(" "),m=!1,q=!1,n,C;do{for(n=e(g,d);!n&&g.getParent();){g=g.getParent();if(-1!==f(l,g.getName())){q=m=!0;break}n=e(g,d)}if(n&&n.getName&&-1!==f(l,n.getName())){m=!0;break}g=n}while(g&&g.getStyle&&("none"==g.getStyle("display")||!g.getText()));for(g||(g=a);g.type!==
|
|
798
|
+
CKEDITOR.NODE_TEXT;)g=!m||d||q?g.getChild(0):g.getChild(g.getChildCount()-1);for(l=b(g);null!=(q=h.exec(l))&&(C=q.index,d););if("number"!==typeof C&&!m)return c(g,d);if(m)d?C=0:(h=/([\.\b]*$)/,C=(q=h.exec(l))?q.index:l.length);else if(d&&(C+=1,C>l.length))return c(g);return{node:g,offset:C}}var d=/\b\w+\b/ig,h,l,m,y,r;m=y=r=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),r=h.node,d=h.offset),{startNode:y,startOffset:a,endNode:r,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
|
+
!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
|
+
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,k,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=k.createBookmark(),-1!==f(["table","tr"],d.element)?a(k,d.element,function(a){d.applyToObject(a)}):-1!==f(["td","th"],d.element)?a(k,{td:1,th:1},function(a){c(a,d)}):-1!==f(["thead","tbody"],d.element)?a(k,{thead:1,tbody:1},function(a){c(a,d)}):CKEDITOR.plugins.copyformatting._applyStylesToTextContext(e,
|
|
803
803
|
k,[d]),k.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||
|
|
@@ -808,21 +808,21 @@ beforeInit:function(a){for(var l=a.config.menu_groups.split(","),h=a._.menuGroup
|
|
|
808
808
|
b.order?-1:a.order>b.order?1:0})}var l='\x3cspan class\x3d"cke_menuitem"\x3e\x3ca id\x3d"{id}" class\x3d"cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href\x3d"{href}" title\x3d"{title}" tabindex\x3d"-1" _cke_focus\x3d1 hidefocus\x3d"true" role\x3d"{role}" aria-label\x3d"{attrLabel}" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasPopup}" aria-disabled\x3d"{disabled}" {ariaChecked} draggable\x3d"false"',h="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(l+=' onkeypress\x3d"return false;"');
|
|
809
809
|
CKEDITOR.env.gecko&&(l+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;" ondragstart\x3d"return false;"');CKEDITOR.env.ie&&(h='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var l=l+(' onmouseover\x3d"CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout\x3d"CKEDITOR.tools.callFunction({moveOutFn},{index});" onclick\x3d"'+h+'CKEDITOR.tools.callFunction({clickFn},{index}); return false;"\x3e')+'\x3cspan class\x3d"cke_menubutton_inner"\x3e\x3cspan class\x3d"cke_menubutton_icon"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{iconStyle}"\x3e\x3c/span\x3e\x3c/span\x3e\x3cspan class\x3d"cke_menubutton_label"\x3e{label}\x3c/span\x3e{shortcutHtml}{arrowHtml}\x3c/span\x3e\x3c/a\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_voice_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e\x3c/span\x3e',
|
|
810
810
|
f=CKEDITOR.addTemplate("menuItem",l),e=CKEDITOR.addTemplate("menuArrow",'\x3cspan class\x3d"cke_menuarrow"\x3e\x3cspan\x3e{label}\x3c/span\x3e\x3c/span\x3e'),m=CKEDITOR.addTemplate("menuShortcut",'\x3cspan class\x3d"cke_menubutton_label cke_menubutton_shortcut"\x3e{shortcut}\x3c/span\x3e');CKEDITOR.menu=CKEDITOR.tools.createClass({$:function(a,e){e=this._.definition=e||{};this.id=CKEDITOR.tools.getNextId();this.editor=a;this.items=[];this._.listeners=[];this._.level=e.level||1;var b=CKEDITOR.tools.extend({},
|
|
811
|
-
e.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level-1,block:{}}),c=b.block.attributes=b.attributes||{};!c.role&&(c.role="menu");this._.panelDefinition=b},_:{onShow:function(){var a=this.editor.getSelection(),e=a&&a.getStartElement(),b=this.editor.elementPath(),c=this._.listeners;this.removeAll();for(var d=0;d<c.length;d++){var f=c[d](e,a,b);if(f)for(var h in f){var
|
|
811
|
+
e.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level-1,block:{}}),c=b.block.attributes=b.attributes||{};!c.role&&(c.role="menu");this._.panelDefinition=b},_:{onShow:function(){var a=this.editor.getSelection(),e=a&&a.getStartElement(),b=this.editor.elementPath(),c=this._.listeners;this.removeAll();for(var d=0;d<c.length;d++){var f=c[d](e,a,b);if(f)for(var h in f){var l=this.editor.getMenuItem(h);!l||l.command&&!this.editor.getCommand(l.command).state||(l.state=f[h],this.add(l))}}},onClick:function(a){this.hide();
|
|
812
812
|
if(a.onClick)a.onClick();else a.command&&this.editor.execCommand(a.command)},onEscape:function(a){var e=this.parent;e?e._.panel.hideChild(1):27==a&&this.hide(1);return!1},onHide:function(){this.onHide&&this.onHide()},showSubMenu:function(a){var e=this._.subMenu,b=this.items[a];if(b=b.getItems&&b.getItems()){e?e.removeAll():(e=this._.subMenu=new CKEDITOR.menu(this.editor,CKEDITOR.tools.extend({},this._.definition,{level:this._.level+1},!0)),e.parent=this,e._.onClick=CKEDITOR.tools.bind(this._.onClick,
|
|
813
813
|
this));for(var c in b){var d=this.editor.getMenuItem(c);d&&(d.state=b[c],e.add(d))}var f=this._.panel.getBlock(this.id).element.getDocument().getById(this.id+String(a));setTimeout(function(){e.show(f,2)},0)}else this._.panel.hideChild(1)}},proto:{add:function(a){a.order||(a.order=this.items.length);this.items.push(a)},removeAll:function(){this.items=[]},show:function(e,f,b,c){if(!this.parent&&(this._.onShow(),!this.items.length))return;f=f||("rtl"==this.editor.lang.dir?2:1);var d=this.items,h=this.editor,
|
|
814
|
-
|
|
815
|
-
|
|
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
|
|
817
|
-
|
|
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
|
+
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
|
+
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
|
+
r=d.length,v=r&&d[0].group,z=0;z<r;z++){var u=d[z];v!=u.group&&(y.push('\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'),v=u.group);u.render(this,z,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
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,k,b){var c=a.id+String(k),d="undefined"==typeof this.state?CKEDITOR.TRISTATE_OFF:
|
|
819
|
-
this.state,h="",l=this.editor,
|
|
820
|
-
|
|
821
|
-
this.icon?null:this.icon,this.iconOffset),shortcutHtml:
|
|
819
|
+
this.state,h="",l=this.editor,w,y,r=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 v=this.getItems,z="\x26#"+("rtl"==this.editor.lang.dir?"9668":"9658")+";",u=this.name;this.icon&&!/\./.test(this.icon)&&(u=this.icon);this.command&&(w=l.getCommand(this.command),(w=l.getCommandKeystroke(w))&&(y=CKEDITOR.tools.keystrokeToString(l.lang.common.keyboard,
|
|
820
|
+
w)));w=CKEDITOR.tools.htmlEncodeAttr(this.label);a={id:c,name:this.name,iconName:u,label:this.label,attrLabel:w,cls:this.className||"",state:r,hasPopup:v?"true":"false",disabled:d==CKEDITOR.TRISTATE_DISABLED,title:w+(y?" ("+y.display+")":""),ariaShortcut:y?l.lang.common.keyboardShortcut+" "+y.aria:"",href:"javascript:void('"+(w||"").replace("'")+"')",hoverFn:a._.itemOverFn,moveOutFn:a._.itemOutFn,clickFn:a._.itemClickFn,index:k,iconStyle:CKEDITOR.skin.getIconStyle(u,"rtl"==this.editor.lang.dir,u==
|
|
821
|
+
this.icon?null:this.icon,this.iconOffset),shortcutHtml:y?m.output({shortcut:y.display}):"",arrowHtml:v?e.output({label:z}):"",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
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 k=CKEDITOR.env.webkit?f:CKEDITOR.env.mac?a.$.metaKey:a.$.ctrlKey;if(!l||!k)if(a.preventDefault(),!e){if(CKEDITOR.env.mac&&CKEDITOR.env.webkit){var k=this.editor,b=(new CKEDITOR.dom.elementPath(a.getTarget(),k.editable())).contains(function(a){return a.hasAttribute("contenteditable")},
|
|
823
823
|
!0);b&&"false"==b.getAttribute("contenteditable")&&k.getSelection().fake(b)}var b=a.getTarget().getDocument(),c=a.getTarget().getDocument().getDocumentElement(),k=!b.equals(CKEDITOR.document),b=b.getWindow().getScrollPosition(),d=k?a.$.clientX:a.$.pageX||b.x+a.$.clientX,h=k?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
|
-
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,
|
|
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
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 g=f.editor,k=g.editable?g.editable():"wysiwyg"==g.mode?g.document&&g.document.getBody():g.textarea,b=f.listenerData;if(k){if("wysiwyg"==g.mode){if(CKEDITOR.dialog._.currentTop||
|
|
827
827
|
!k)return;a(k.getHtml())&&(k.setHtml(b),k.addClass("placeholder"))}"source"==g.mode&&(e?"mode"==f.name&&k.setAttribute("placeholder",b):a(k.getValue())&&(k.setValue(b),k.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())},
|
|
@@ -831,17 +831,17 @@ m.editable?m.editable():"wysiwyg"==m.mode?m.document&&m.document.getBody():m.tex
|
|
|
831
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"}[g.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
832
|
a[e].split(":");if(3==f.length){var g=f[0],k=f[1],f=f[2];b[g]||(b[g]={});b[g][k]||(b[g][k]=[]);b[g][k].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,k,h;"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(k=e[g],h=a.getContents(g),f=0;f<k.length;f++)h.remove(k[f]);
|
|
833
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(k=e[g],h=a.getContents(g),f=0;f<k.length;f++)h.get(k[f]).hidden=!0;if(m.config.dialogFieldsDefaultValues&&(e=m.config.dialogFieldsDefaultValues[d]))for(g in e){k=e[g];h=a.getContents(g);for(var l in k)(d=h.get(l))&&(d["default"]=k[l])}}})}})})();(function(){function a(a){var e=this.att;a=a&&a.hasAttribute(e)&&a.getAttribute(e)||
|
|
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
|
|
835
|
-
return
|
|
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 g=f.lang.common,k={id:"advanced",label:g.advancedTab,title:g.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:g.id,setup:a,commit:l}),e.dir&&b.push({id:"advLangDir",att:"dir",type:"select",requiredContent:m?m+"[dir]":null,label:g.langDir,"default":"",style:"width:100%",items:[[g.notSet,""],[g.langDirLTR,"ltr"],[g.langDirRTL,"rtl"]],
|
|
836
836
|
setup:a,commit:l}),k.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:g.styles,"default":"",validate:CKEDITOR.dialog.validate.inlineStyle(g.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
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:g.cssClasses,"default":"",setup:a,commit:l}]}),k.elements[0].children.push({type:"hbox",widths:["50%","50%"],children:[].concat(b)});return k}})})();(function(){function a(a,h){var f=
|
|
838
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 g=document.createElement("div"),k;g.innerHTML="\x26"+a.join(";\x26")+";";k=g.innerHTML;g=null;for(g=0;g<k.length;g++){var b=k.charAt(g);f[b]="\x26"+a[g]+";";e.push(b)}}f.regex=e.join(h?"|":"");return f}CKEDITOR.plugins.add("entities",
|
|
839
839
|
{afterInit:function(l){function h(a){return b[a]}function f(a){return"force"!=e.entities_processNumerical&&g[a]?g[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
841
|
e.entities_additional&&m.push(e.entities_additional));var g=a(m.join(",")),k=g.regex?"["+g.regex+"]":"a^";delete g.regex;e.entities&&e.entities_processNumerical&&(k="[^ -~]|"+k);var k=new RegExp(k,"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(k,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,g=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-
|
|
843
|
-
0,
|
|
844
|
-
"rtl"==e.contentsLangDirection?"right":"left":c-
|
|
842
|
+
CKEDITOR.config.entities_additional="#39";(function(){function a(a){var e=a.config,m=a.fire("uiSpace",{space:"top",html:""}).html,g=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-u-x);break;case "pin":c("fixed","top",B);break;case "bottom":c("absolute","top",b.y+(v.height||v.bottom-v.top)+x)}k=a}var k,m,r,v,z,u,D,p=e.floatSpaceDockedOffsetX||0,x=e.floatSpaceDockedOffsetY||0,q=e.floatSpacePinnedOffsetX||
|
|
843
|
+
0,B=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");r=b.getClientRect();v=m.getClientRect();z=l.getViewPaneSize();u=r.height;D="pageXOffset"in l.$?l.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft;k?(u+x<=v.top?d("top"):u+x>z.height-v.bottom?d("pin"):d("bottom"),c=z.width/2,c=e.floatSpacePreferRight?"right":0<v.left&&v.right<z.width&&v.width>r.width?
|
|
844
|
+
"rtl"==e.contentsLangDirection?"right":"left":c-v.left>v.right-c?"left":"right",r.width>z.width?(c="left",n=0):(n="left"==c?0<v.left?v.left:0:v.right<z.width?z.width-v.right:0,n+r.width>z.width&&(c="left"==c?"right":"left",n=0)),b.setStyle(c,h(("pin"==k?q:p)+n+("pin"==k?0:"left"==c?D:-D)))):(k="pin",d("pin"),g(c))}}}();if(m){var k=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
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(k.output({content:m,
|
|
846
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,g),d=CKEDITOR.tools.eventsBuffer(100,g);b.unselectable();b.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){g(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=
|
|
@@ -858,8 +858,8 @@ f.getItem(++k);){if(a.equals(g)){this._.focusIndex=k;break}}else this.element.fo
|
|
|
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
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 g=CKEDITOR.env,k,b,c="cke_"+this.id,d=CKEDITOR.tools.addFunction(function(c){b&&(a.unlockSelection(1),b=0);k.execute(c)},this),n=this;k={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
|
|
862
|
-
b);break;default:k.onkey(k,c)}a.preventDefault()}),
|
|
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 t=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:k.onkey(k,c)}a.preventDefault()}),w=CKEDITOR.tools.addFunction(function(){k.onfocus&&k.onfocus()});b=0;k.keyDownFn=t;g={id:c,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:g.gecko&&!g.hc?"":(this.title||"").replace("'",""),keydownFn:t,focusFn:w,clickFn:d};h.output(g,e);if(this.onRender)this.onRender();return k},createPanel:function(a){if(!this._.panel){var e=this._.panelDefinition,h=this._.panelDefinition.block,g=e.parent||CKEDITOR.document.getBody(),
|
|
863
863
|
k="cke_combopanel__"+this.name,b=new CKEDITOR.ui.floatPanel(a,g,e),e=b.addListBlock(this.id,h),c=this;b.onShow=function(){this.element.addClass(k);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(k);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?
|
|
@@ -885,14 +885,14 @@ this._.indent?this.indentation():l&&l.breakBeforeClose&&(this.lineBreak(),this.i
|
|
|
885
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,g;e.on("refresh",function(a){var b=[l],c;for(c in a.data.states)b.push(a.data.states[c]);
|
|
886
886
|
this.setState(CKEDITOR.tools.search(b,h)?h:l)},e,null,100);e.on("exec",function(e){m=a.getSelection();g=m.createBookmarks(1);e.data||(e.data={});e.data.done=!1},e,null,0);e.on("exec",function(){a.forceNextSelectionCheck();m.selectBookmarks(g)},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
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(),h=a.data.node;e.setStartBefore(h);e.setEndAfter(h);for(var b=new CKEDITOR.dom.walker(e),c;c=b.next();)if(c.type==CKEDITOR.NODE_ELEMENT)if(!c.equals(h)&&c.getDirection())e.setStartAfter(c),b=new CKEDITOR.dom.walker(e);else{var d=f.config.indentClasses;if(d)for(var l=
|
|
888
|
-
"ltr"==a.data.dir?["_rtl",""]:["","_rtl"],
|
|
888
|
+
"ltr"==a.data.dir?["_rtl",""]:["","_rtl"],t=0;t<d.length;t++)c.hasClass(d[t]+l[0])&&(c.removeClass(d[t]+l[0]),c.addClass(d[t]+l[1]));d=c.getStyle("margin-right");l=c.getStyle("margin-left");d?c.setStyle("margin-left",d):c.removeStyle("margin-left");l?c.setStyle("margin-right",l):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 g=f.startContainer,l=f.endContainer;g&&!g.getParent().equals(b);)g=g.getParent();for(;l&&!l.getParent().equals(b);)l=l.getParent();if(!g||!l)return!1;for(var m=[],
|
|
892
|
-
l=l.getCustomData("listarray_index");l<=m.getCustomData("listarray_index");l++)if(
|
|
893
|
-
A=[],
|
|
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
|
-
|
|
891
|
+
(function(){function a(a){function b(b){for(var g=f.startContainer,l=f.endContainer;g&&!g.getParent().equals(b);)g=g.getParent();for(;l&&!l.getParent().equals(b);)l=l.getParent();if(!g||!l)return!1;for(var m=[],p=!1;!p;)g.equals(l)&&(p=!0),m.push(g),g=g.getNext();if(1>m.length)return!1;g=b.getParents(!0);for(l=0;l<g.length;l++)if(g[l].getName&&e[g[l].getName()]){b=g[l];break}for(var g=c.isIndent?1:-1,l=m[0],m=m[m.length-1],p=CKEDITOR.plugins.list.listToArray(b,d),x=p[m.getCustomData("listarray_index")].indent,
|
|
892
|
+
l=l.getCustomData("listarray_index");l<=m.getCustomData("listarray_index");l++)if(p[l].indent+=g,0<g){for(var q=p[l].parent,B=l-1;0<=B;B--)if(p[B].indent===g){q=p[B].parent;break}p[l].parent=new CKEDITOR.dom.element(q.getName(),q.getDocument())}for(l=m.getCustomData("listarray_index")+1;l<p.length&&p[l].indent>x;l++)p[l].indent+=g;g=CKEDITOR.plugins.list.arrayToList(p,d,null,a.config.enterMode,b.getDirection());if(!c.isIndent){var C;if((C=b.getParent())&&C.is("li"))for(var m=g.listNode.getChildren(),
|
|
893
|
+
A=[],r,l=m.count()-1;0<=l;l--)(r=m.getItem(l))&&r.is&&r.is("li")&&A.push(r)}g&&g.listNode.replace(b);if(A&&A.length)for(l=0;l<A.length;l++){for(r=b=A[l];(r=r.getNext())&&r.is&&r.getName()in e;)CKEDITOR.env.needsNbspFiller&&!b.getFirst(h)&&b.append(f.document.createText(" ")),b.append(r);b.insertAfter(C)}g&&a.fire("contentDomInvalidated");return!0}for(var c=this,d=this.database,e=this.context,f,g=a.getSelection(),g=(g&&g.getRanges()).createIterator();f=g.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 r=f.getEnclosedNode();r&&r.type==CKEDITOR.NODE_ELEMENT&&r.getName()in e&&(f.setStartAt(r,CKEDITOR.POSITION_AFTER_START),f.setEndAt(r,CKEDITOR.POSITION_BEFORE_END),m=r)}m&&f.startContainer.type==CKEDITOR.NODE_ELEMENT&&f.startContainer.getName()in e&&(r=new CKEDITOR.dom.walker(f),r.evaluator=l,f.startContainer=
|
|
895
|
+
r.next());m&&f.endContainer.type==CKEDITOR.NODE_ELEMENT&&f.endContainer.getName()in e&&(r=new CKEDITOR.dom.walker(f),r.evaluator=l,f.endContainer=r.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,g=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(e){function b(b){c.specificDefinition.apply(this,
|
|
896
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?g:m}:function(a,
|
|
897
897
|
b){return!this.getContext(b)||this.isIndent?m:g},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"):"");""===
|
|
@@ -907,8 +907,8 @@ e=h.getSelectedText();for(var k=0,b=-1,c=0;c<e.length;c++)if(" "===e.charAt(c)||
|
|
|
907
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 g=a.config.enterMode==CKEDITOR.ENTER_P?"p":"div";if(e){switch(h){case "left":this.cssClassName=
|
|
908
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=g+"("+this.cssClassName+")"}else this.requiredContent=g+"{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
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 g=new CKEDITOR.dom.walker(h),k;k=g.next();)if(k.type==CKEDITOR.NODE_ELEMENT)if(!k.equals(a.data.node)&&k.getDirection())h.setStartAfter(k),g=new CKEDITOR.dom.walker(h);else{var b=e.config.justifyClasses;b&&(k.hasClass(b[0])?(k.removeClass(b[0]),k.addClass(b[2])):k.hasClass(b[2])&&(k.removeClass(b[2]),k.addClass(b[0])));b=k.getStyle("text-align");"left"==b?k.setStyle("text-align",
|
|
910
|
-
"right"):"right"==b&&k.setStyle("text-align","left")}}l.prototype={exec:function(f){var e=f.getSelection(),h=f.config.enterMode;if(e){for(var g=e.createBookmarks(),k=e.getRanges(),b=this.cssClassName,c,d,l=f.config.useComputedState,l=void 0===l||l,
|
|
911
|
-
|
|
910
|
+
"right"):"right"==b&&k.setStyle("text-align","left")}}l.prototype={exec:function(f){var e=f.getSelection(),h=f.config.enterMode;if(e){for(var g=e.createBookmarks(),k=e.getRanges(),b=this.cssClassName,c,d,l=f.config.useComputedState,l=void 0===l||l,t=k.length-1;0<=t;t--)for(c=k[t].createIterator(),c.enlargeBr=h!=CKEDITOR.ENTER_BR;d=c.getNextParagraph(h==CKEDITOR.ENTER_P?"p":"div");)if(!d.isReadOnly()){var w=d.getName(),y;y=f.activeFilter.check(w+"{text-align}");if((w=f.activeFilter.check(w+"("+b+")"))||
|
|
911
|
+
y){d.removeAttribute("align");d.removeStyle("text-align");var r=b&&(d.$.className=CKEDITOR.tools.ltrim(d.$.className.replace(this.cssClassRegex,""))),v=this.state==CKEDITOR.TRISTATE_OFF&&(!l||a(d,!0)!=this.value);b&&w?v?d.addClass(b):r||d.removeAttribute("class"):v&&y&&d.setStyle("text-align",this.value)}}f.focus();f.forceNextSelectionCheck();e.selectBookmarks(g)}},refresh:function(f,e){var h=e.block||e.blockLimit,g=h.getName(),k=h.equals(f.editable()),g=this.cssClassName?f.activeFilter.check(g+"("+
|
|
912
912
|
this.cssClassName+")"):f.activeFilter.check(g+"{text-align}");k&&!CKEDITOR.dtd.$list[e.lastElement.getName()]?this.setState(CKEDITOR.TRISTATE_OFF):!k&&g?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"),g=new l(a,"justifyright","right"),k=new l(a,"justifyblock",
|
|
913
913
|
"justify");a.addCommand("justifyleft",e);a.addCommand("justifycenter",m);a.addCommand("justifyright",g);a.addCommand("justifyblock",k);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
914
|
command:"justifyblock",toolbar:"align,40"}));a.on("dirChanged",h)}}})})();(function(){function a(a,e){var h=f.exec(a),b=f.exec(e);if(h){if(!h[2]&&"px"==b[2])return b[1];if("px"==h[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 h=
|
|
@@ -924,76 +924,76 @@ toolbar:"links,20"}),a.ui.addButton("Anchor",{label:a.lang.link.anchor.toolbar,c
|
|
|
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
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,g=/subject=([^;?:@&=$,\/]*)/i,k=/body=([^;?:@&=$,\/]*)/i,b=/^#(.*)$/,c=/^((?:http|https|ftp|news):\/\/)?(.*)$/,d=/^(_(?:self|top|parent|blank))$/,
|
|
927
|
-
n=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
|
|
927
|
+
n=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,t=/^javascript:([^(]+)\(([^)]+)\)$/,w=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,y=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,r=/^tel:(.*)$/,v={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,x=a.config.emailProtection,q={},B;h.match(e)&&("encode"==x?h=h.replace(n,function(a,b,c){c=c||"";return"mailto:"+String.fromCharCode.apply(String,b.split(","))+c.replace(/\\'/g,"'")}):x&&h.replace(t,function(a,b,c){if(b==l.name){q.type="email";a=q.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(!q.type)if(x=h.match(b))q.type="anchor",q.anchor={},q.anchor.name=q.anchor.id=x[1];else if(x=h.match(r))q.type="tel",q.tel=x[1];else if(x=h.match(m)){B=h.match(g);var h=h.match(k),C=q.email={};q.type="email";C.address=x[0].replace("mailto:","");B&&(C.subject=decodeURIComponent(B[1]));h&&(C.body=decodeURIComponent(h[1]))}else h&&(B=h.match(c))&&(q.type="url",q.url={},q.url.protocol=B[1],q.url.url=
|
|
932
|
+
B[2]);if(f){if(h=f.getAttribute("target"))q.target={type:h.match(d)?h:"frame",name:h};else if(h=(h=f.data("cke-pa-onclick")||f.getAttribute("onclick"))&&h.match(w))for(q.target={type:"popup",name:h[1]};x=y.exec(h[2]);)"yes"!=x[2]&&"1"!=x[2]||x[1]in{height:1,width:1,top:1,left:1}?isFinite(x[2])&&(q.target[x[1]]=x[2]):q.target[x[1]]=!0;null!==f.getAttribute("download")&&(q.download=!0);var h={},A;for(A in v)(x=f.getAttribute(A))&&(h[v[A]]=x);if(A=f.data("cke-saved-name")||h.advName)h.advName=A;CKEDITOR.tools.isEmpty(h)||
|
|
933
|
+
(q.advanced=h)}return q},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
|
+
"","', '"],A="resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "),f=A.length,k=function(a){c.target[a]&&A.push(a+"\x3d"+c.target[a])},g=0;g<f;g++)A[g]+=c.target[A[g]]?"\x3dyes":"\x3dno";k("width");k("left");k("height");k("top");d.push(A.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 n in v)(d=c.advanced[v[n]])&&(e[n]=d);e.name&&
|
|
936
|
+
(e["data-cke-saved-name"]=e.name)}e["data-cke-saved-href"]&&(e.href=e["data-cke-saved-href"]);n={target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1,download:1};c.advanced&&CKEDITOR.tools.extend(n,v);for(var r in e)delete n[r];return{set:e,removed:CKEDITOR.tools.object.keys(n)}},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=
|
|
940
940
|
0;g<b.contents.length;g++){var h=b.contents[g];(h=h.getAscendant("li",!0))&&!h.getCustomData("list_item_processed")&&(f.push(h),CKEDITOR.dom.element.setMarker(c,h,"list_item_processed",!0))}for(var h=b.root.getDocument(),k,l,g=0;g<f.length;g++){var m=f[g].getCustomData("listarray_index");k=e[m].parent;k.is(this.type)||(l=h.createElement(this.type),k.copyAttributes(l,{start:1,type:1}),l.removeStyle("list-style-type"),e[m].parent=l)}c=CKEDITOR.plugins.list.arrayToList(e,c,null,a.config.enterMode);for(var n,
|
|
941
941
|
e=c.listNode.getChildCount(),g=0;g<e&&(n=c.listNode.getChild(g));g++)n.getName()==this.type&&d.push(n);c.listNode.replace(b.root);a.fire("contentDomInvalidated")}function l(a,b,c){var d=b.contents,e=b.root.getDocument(),f=[];if(1==d.length&&d[0].equals(b.root)){var g=e.createElement("div");d[0].moveChildren&&d[0].moveChildren(g);d[0].append(g);d[0]=g}b=b.contents[0].getParent();for(g=0;g<d.length;g++)b=b.getCommonAncestor(d[g].getParent());a=a.config.useComputedState;var h,k;a=void 0===a||a;for(g=
|
|
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")||
|
|
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 k(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(
|
|
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"](r);)(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"](t);d&&d.type==CKEDITOR.NODE_ELEMENT&&d.is(a.getName())&&(e(a,d,null,!c),a.remove(),a=d)}b();b(1)}function g(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 k(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(t))&&
|
|
947
|
+
w(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(t))&&f.equals(h.getFirst(t))&&(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 t(a)&&!w(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(t))&&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(),t=function(a){return!(d(a)||n(a))},w=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=
|
|
952
|
-
h.$.documentMode&&
|
|
953
|
-
1));else if(N.type==CKEDITOR.NODE_ELEMENT&&N.isBlockBoundary()){l&&!N.getDirection()&&N.setAttribute("dir",
|
|
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
|
|
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?
|
|
958
|
-
this.state==CKEDITOR.TRISTATE_OFF;
|
|
959
|
-
|
|
950
|
+
b&&CKEDITOR.dom.element.setMarker(b,k,"listarray_index",d.length);d.push(l);for(var m=0,n=k.getChildCount(),r;m<n;m++)r=k.getChild(m),r.type==CKEDITOR.NODE_ELEMENT&&c[r.getName()]?CKEDITOR.plugins.list.listToArray(r,b,d,e+1,l.grandparent):l.contents.push(r)}}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,r=Math.max(a[d].indent,0),w=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==r){l&&a[m].parent.getName()==l.getName()||(l=a[m].parent.clone(!1,1),f&&l.setAttribute("dir",f),k.append(l));w=l.append(H.element.clone(0,1));y!=l.getDirection(1)&&w.setAttribute("dir",y);for(g=0;g<H.contents.length;g++)w.append(H.contents[g].clone(1,1));m++}else if(H.indent==Math.max(r,0)+1)H=a[m-1].element.getDirection(1),m=CKEDITOR.plugins.list.arrayToList(a,null,m,e,H!=y?y:null),!w.getChildCount()&&CKEDITOR.env.needsNbspFiller&&7>=
|
|
952
|
+
h.$.documentMode&&w.append(h.createText(" ")),w.append(m.listNode),m=m.nextIndex;else if(-1==H.indent&&!d&&g){c[g.getName()]?(w=H.element.clone(!1,!0),y!=g.getDirection(1)&&w.setAttribute("dir",y)):w=new CKEDITOR.dom.documentFragment(h);var l=g.getDirection(1)!=y,J=H.element,F=J.getAttribute("class"),K=J.getAttribute("style"),O=w.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(e!=CKEDITOR.ENTER_BR||l||K||F),N,Y=H.contents.length,S;for(g=0;g<Y;g++)if(N=H.contents[g],n(N)&&1<Y)O?S=N.clone(1,1):w.append(N.clone(1,
|
|
953
|
+
1));else if(N.type==CKEDITOR.NODE_ELEMENT&&N.isBlockBoundary()){l&&!N.getDirection()&&N.setAttribute("dir",y);E=N;var Z=J.getAttribute("style");Z&&E.setAttribute("style",Z.replace(/([^;])$/,"$1;")+(E.getAttribute("style")||""));F&&N.addClass(F);E=null;S&&(w.append(S),S=null);w.append(N.clone(1,1))}else O?(E||(E=h.createElement(L),w.append(E),l&&E.setAttribute("dir",y)),K&&E.setAttribute("style",K),F&&E.setAttribute("class",F),S&&(E.append(S),S=null),E.append(N.clone(1,1))):w.append(N.clone(1,1));
|
|
954
|
+
S&&((E||w).append(S),S=null);w.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&m!=a.length-1&&(CKEDITOR.env.needsBrFiller&&(y=w.getLast())&&y.type==CKEDITOR.NODE_ELEMENT&&y.is("br")&&y.remove(),(y=w.getLast(t))&&y.type==CKEDITOR.NODE_ELEMENT&&y.is(CKEDITOR.dtd.$block)||w.append(h.createElement("br")));y=w.$.nodeName.toLowerCase();"div"!=y&&"p"!=y||w.appendBogus();k.append(w);l=null;m++}else return null;E=null;if(a.length<=m||Math.max(a[m].indent,0)<r)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]$/,r=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(),q=k&&k.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF){var n=b.editable();if(n.getFirst(t)){var r=1==q.length&&q[0];(g=r&&r.getEnclosedNode())&&g.is&&this.type==g.getName()&&this.setState(CKEDITOR.TRISTATE_ON)}else g.enterMode==
|
|
957
|
+
CKEDITOR.ENTER_BR?n.appendBogus():q[0].fixBlock(1,g.enterMode==CKEDITOR.ENTER_P?"p":"div"),k.selectRanges(q)}for(var g=k.createBookmarks(!0),n=[],A={},q=q.createIterator(),w=0;(r=q.getNextRange())&&++w;){var y=r.getBoundaryNodes(),I=y.startNode,E=y.endNode;I.type==CKEDITOR.NODE_ELEMENT&&"td"==I.getName()&&r.setStartAt(y.startNode,CKEDITOR.POSITION_AFTER_START);E.type==CKEDITOR.NODE_ELEMENT&&"td"==E.getName()&&r.setEndAt(y.endNode,CKEDITOR.POSITION_BEFORE_END);r=r.createIterator();for(r.forceBrBreak=
|
|
958
|
+
this.state==CKEDITOR.TRISTATE_OFF;y=r.getNextParagraph();)if(!y.getCustomData("list_block")&&!f(y)){CKEDITOR.dom.element.setMarker(A,y,"list_block",1);for(var L=b.elementPath(y),I=L.elements,E=0,L=L.blockLimit,H,J=I.length-1;0<=J&&(H=I[J]);J--)if(c[H.getName()]&&L.contains(H)){L.removeCustomData("list_group_object_"+w);(I=H.getCustomData("list_group_object"))?I.contents.push(y):(I={root:H,contents:[y]},n.push(I),CKEDITOR.dom.element.setMarker(A,H,"list_group_object",I));E=1;break}E||(E=L,E.getCustomData("list_group_object_"+
|
|
959
|
+
w)?E.getCustomData("list_group_object_"+w).contents.push(y):(I={root:E,contents:[y]},CKEDITOR.dom.element.setMarker(A,E,"list_group_object_"+w,I),n.push(I)))}}for(H=[];0<n.length;)I=n.shift(),this.state==CKEDITOR.TRISTATE_OFF?d(I)||(c[I.root.getName()]?a.call(this,b,I,A,H):l.call(this,b,I,H)):this.state==CKEDITOR.TRISTATE_ON&&c[I.root.getName()]&&!d(I)&&h.call(this,b,I,A);for(J=0;J<H.length;J++)m(H[J]);CKEDITOR.dom.element.clearAllMarkers(A);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)&&(A=A.getParent())&&A.is("li")&&(A=b(A))?(f=A,A=A.getPrevious(
|
|
963
|
-
if(f)k(a,e,h),d.cancel();else{var
|
|
964
|
-
(l=2),l&&A){h=h.clone();h.moveToElementEditStart(A);if(1==l&&(e.optimize(),!e.startContainer.equals(f))){for(f=e.startContainer;f.is(CKEDITOR.dtd.$inline);)
|
|
965
|
-
A.is(c)&&(A=A.getFirst(
|
|
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(),r=new CKEDITOR.dom.walker(h.clone());r.evaluator=function(a){return t(a)&&!w(a)};r.guard=function(a,b){return!(b&&a.type==CKEDITOR.NODE_ELEMENT&&a.is("table"))};e=h.clone();if(m){var A;(A=l.contains(c))&&h.checkBoundaryOfElement(A,
|
|
962
|
+
CKEDITOR.START)&&(A=A.getParent())&&A.is("li")&&(A=b(A))?(f=A,A=A.getPrevious(t),e.moveToPosition(A&&w(A)?A:f,CKEDITOR.POSITION_BEFORE_START)):(r.range.setStartAt(n,CKEDITOR.POSITION_AFTER_START),r.range.setEnd(h.startContainer,h.startOffset),(A=r.previous())&&A.type==CKEDITOR.NODE_ELEMENT&&(A.getName()in c||A.is("li"))&&(A.is("li")||(r.range.selectNodeContents(A),r.reset(),r.evaluator=g,A=r.previous()),f=A,e.moveToElementEditEnd(f),e.moveToPosition(e.endPath().block,CKEDITOR.POSITION_BEFORE_END)));
|
|
963
|
+
if(f)k(a,e,h),d.cancel();else{var G=l.contains(c);G&&h.checkBoundaryOfElement(G,CKEDITOR.START)&&(f=G.getFirst(t),h.checkBoundaryOfElement(f,CKEDITOR.START)&&(A=G.getPrevious(t),b(f)?A&&(h.moveToElementEditEnd(A),h.select()):a.execCommand("outdent"),d.cancel()))}}else if(f=l.contains("li")){if(r.range.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),m=(n=f.getLast(t))&&g(n)?n:f,l=0,(A=r.next())&&A.type==CKEDITOR.NODE_ELEMENT&&A.getName()in c&&A.equals(n)?(l=1,A=r.next()):h.checkBoundaryOfElement(m,CKEDITOR.END)&&
|
|
964
|
+
(l=2),l&&A){h=h.clone();h.moveToElementEditStart(A);if(1==l&&(e.optimize(),!e.startContainer.equals(f))){for(f=e.startContainer;f.is(CKEDITOR.dtd.$inline);)G=f,f=f.getParent();G&&e.moveToPosition(G,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));k(a,e,h);d.cancel()}}else r.range.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),(A=r.next())&&A.type==CKEDITOR.NODE_ELEMENT&&
|
|
965
|
+
A.is(c)&&(A=A.getFirst(t),l.block&&h.checkStartOfBlock()&&h.checkEndOfBlock()?(l.block.remove(),h.moveToElementEditStart(A),h.select()):b(A)?(h.moveToElementEditStart(A),h.select()):(h=h.clone(),h.moveToElementEditStart(A),k(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)&&!
|
|
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:
|
|
968
|
+
c.equals(b.getNext(function(a){return!(P(a)||Q(a)||t(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=g(b);if("true"==c.getAttribute("contenteditable"))return b;if(c.is(a.triggers))return c}return null}function f(a,b,c){p(a,b);p(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)&&!t(b)&&!d(a,b)})}function m(a,b,c){return a>b&&a<c}function g(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 k(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
|
+
"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
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(ea,c),{base:V+"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(ea,c),{base:V+"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(){
|
|
972
|
+
detach:function(){this.wrap.getParent()&&this.wrap.remove();return this},mouseNear:function(){p(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&&p(a,e,!0);f&&p(a,f,!0);p(a,h,!0);a.inInlineMode&&x(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
974
|
0:b.scroll.y,this.look(O)):d.is(N)||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(N)):(a.inInlineMode&&(k.top-=b.editable.top+b.editable.border.top),this.look(Y));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 A("span",a.doc)});for(c=d.lineChildren.length;c--;)d.lineChildren[c].appendTo(d);d.look(Y);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(
|
|
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;
|
|
977
|
-
exec:function(){function d(e){var f=
|
|
978
|
-
if(!
|
|
979
|
-
a.$}function
|
|
980
|
-
!b.is(
|
|
981
|
-
0,b.size.top+f)?(a=a.inInlineMode||0===e.scroll.y?O:Y,new l([null,b,
|
|
982
|
-
|
|
983
|
-
q?N:O:Y]);return 0 in g?new l(g):null}function
|
|
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-
|
|
986
|
-
!k&&
|
|
987
|
-
|
|
988
|
-
(m.line.detach(),a.once("getData",function(){m.line.attach()},null,null,1E3))},null,null,0),g.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;
|
|
989
|
-
0}),g.attachListener(g,"keydown",function(b){if("wysiwyg"==a.mode)switch(b.data.getKeystroke()){case 2228240:case 16:m.hiddenMode=1,m.line.detach()}}),g.attachListener(m.inInlineMode?g:n,"mousemove",function(b){
|
|
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
|
-
ea="\x3cspan\x3e"+S+"\x3c/span\x3e";
|
|
994
|
-
h.type!=CKEDITOR.NODE_ELEMENT||!h.$||
|
|
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)||
|
|
975
|
+
c;b--;)(c=this.lineChildren[b]).setAttribute("style",c.base+c.looks[0|a/2]);this.oldLook=a}},wrap:new A("span",a.doc)});for(c=d.lineChildren.length;c--;)d.lineChildren[c].appendTo(d);d.look(Y);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=g(a.element,!0))&&f.data("cke-enter-mode")||a.enterMode,f=new A(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(T,1);
|
|
978
|
+
if(!r(a,b)&&b&&!b.equals(a.editable)&&!b.contains(a.editable)){(f=g(b))&&"false"==f.getAttribute("contenteditable")&&(b=f);a.element=b;f=e(a,b,!c);var k;n(f)&&f.is(a.triggers)&&f.is(W)&&(!e(a,f,!c)||(k=e(a,f,!c))&&n(k)&&k.is(a.triggers))?d(f):(k=h(a,b),n(k)&&(e(a,k,!c)?(b=e(a,k,!c))&&n(b)&&b.is(a.triggers)&&d(k):d(k)))}}}()}}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 t(a){if(!n(a))return!1;var b;(b=w(a))||(n(a)?(b={left:1,right:1,center:1},b=!(!b[a.getComputedStyle("float")]&&!b[a.getAttribute("align")])):b=!1);return b}function w(a){return!!{absolute:1,fixed:1}[a.getComputedStyle("position")]}function y(a,b){return n(b)?b.is(a.triggers):null}function r(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 v(a,b,c){b=b[c?"getLast":"getFirst"](function(b){return a.isRelevant(b)&&
|
|
980
|
+
!b.is(ia)});if(!b)return!1;p(a,b);return c?b.size.top>a.mouse.y:b.size.bottom<a.mouse.y}function z(a){var b=a.editable,c=a.mouse,e=a.view,f=a.triggerOffset;x(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)||t(b)||!y(a,b))return null;p(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:Y,new l([null,b,H,K,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)?N:Y,new l([b,null,J,K,a])):null}function u(a){var b=a.mouse,c=a.view,d=a.triggerOffset,f=h(a);if(!f)return null;p(a,f);var d=Math.min(d,0|f.size.outerHeight/2),g=[],k,q;if(m(b.y,f.size.top-1,f.size.top+d))q=!1;else if(m(b.y,f.size.bottom-d,f.size.bottom+1))q=!0;else return null;if(t(f)||
|
|
982
|
+
v(a,f,q)||f.getParent().is(Z))return null;var B=e(a,f,!q);if(B){if(B&&B.type==CKEDITOR.NODE_TEXT)return null;if(n(B)){if(t(B)||!y(a,B)||B.getParent().is(Z))return null;g=[B,f][q?"reverse":"concat"]().concat([F,K])}}else f.equals(a.editable[q?"getLast":"getFirst"](a.isRelevant))?(x(a),q&&m(b.y,f.size.bottom-d,c.pane.height)&&m(f.size.bottom,c.pane.height-d,c.pane.height)?k=N:m(b.y,0,f.size.top+d)&&(k=O)):k=Y,g=[null,f][q?"reverse":"concat"]().concat([q?J:H,K,k,f.equals(a.editable[q?"getLast":"getFirst"](a.isRelevant))?
|
|
983
|
+
q?N:O:Y]);return 0 in g?new l(g):null}function D(a,b,c,d){for(var e=b.getDocumentPosition(),f={},g={},h={},k={},l=U.length;l--;)f[U[l]]=parseInt(b.getComputedStyle.call(b,"border-"+U[l]+"-width"),10)||0,h[U[l]]=parseInt(b.getComputedStyle.call(b,"padding-"+U[l]),10)||0,g[U[l]]=parseInt(b.getComputedStyle.call(b,"margin-"+U[l]),10)||0;c&&!d||q(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 p(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,D(a,b,c),{date:+new Date},!0)}function x(a,b){a.view.editable=D(a,a.editable,b,!0)}function q(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 B(a,b,c,d){for(var e=d,f=d,g=0,h=!1,k=!1,m=a.view.pane.height,q=a.mouse;q.y+g<m&&0<q.y-g;){h||(h=b(e,d));k||(k=b(f,d));!h&&0<q.y-g&&(e=c(a,{x:q.x,y:q.y-g}));
|
|
986
|
+
!k&&q.y+g<m&&(f=c(a,{x:q.x,y:q.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,g=f.magicline_triggerOffset||30,m={editor:a,enterMode:f.enterMode,triggerOffset:g,holdDistance:0|g*(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?T:{table:1,hr:1,div:1,ul:1,ol:1,dl:1,form:1,blockquote:1}},
|
|
987
|
+
B,A,p;m.isRelevant=function(a){return n(a)&&!d(m,a)&&!t(a)};a.on("contentDom",function(){var g=a.editable(),n=a.document,v=a.window;C(m,{editable:g,inInlineMode:g.isInline(),doc:n,win:v,hotNode:null},!0);m.boundary=m.inInlineMode?m.editable:m.doc.getDocumentElement();g.is(E.$inline)||(m.inInlineMode&&!w(g)&&g.setStyles({position:"relative",top:null,left:null}),k.call(this,m),q(m),g.attachListener(a,"beforeUndoImage",function(){m.line.detach()}),g.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),g.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;q(m);x(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(p),p=null,m.line.detach())}else clearTimeout(p),p=null,m.line.detach()}),g.attachListener(g,"keyup",function(){m.hiddenMode=
|
|
989
|
+
0}),g.attachListener(g,"keydown",function(b){if("wysiwyg"==a.mode)switch(b.data.getKeystroke()){case 2228240:case 16:m.hiddenMode=1,m.line.detach()}}),g.attachListener(m.inInlineMode?g:n,"mousemove",function(b){A=!0;if("wysiwyg"==a.mode&&!a.readOnly&&!p){var c={x:b.data.$.clientX,y:b.data.$.clientY};p=setTimeout(function(){m.mouse=c;p=m.trigger=null;q(m);A&&!m.hiddenMode&&a.focusManager.hasFocus&&!m.line.mouseNear()&&(m.element=X(m,!0))&&((m.trigger=z(m)||u(m)||R(m))&&!r(m,m.trigger.upper||m.trigger.lower)?
|
|
990
|
+
m.line.attach().place():(m.trigger=null,m.line.detach()),A=!1)},30)}}),g.attachListener(v,"scroll",function(){"wysiwyg"==a.mode&&(m.line.detach(),M.webkit&&(m.hiddenMode=1,clearTimeout(B),B=setTimeout(function(){m.mouseDown||(m.hiddenMode=0)},50)))}),g.attachListener(I?n:v,"mousedown",function(){"wysiwyg"==a.mode&&(m.line.detach(),m.hiddenMode=1,m.mouseDown=1)}),g.attachListener(I?n:v,"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:D,that:m,
|
|
992
|
+
triggerEdge:u,triggerEditable:z,triggerExpand:R})},this)}});var C=CKEDITOR.tools.extend,A=CKEDITOR.dom.element,G=A.createFromHtml,M=CKEDITOR.env,I=CKEDITOR.env.ie&&9>CKEDITOR.env.version,E=CKEDITOR.dtd,L={},H=128,J=64,F=32,K=16,O=4,N=2,Y=1,S=" ",Z=E.$listItem,ia=E.$tableContent,W=C({},E.$nonEditable,E.$empty),T=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;",V=ba+"border-color:transparent;display:block;border-style:solid;",
|
|
993
|
+
ea="\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||Y);return this},is:function(a){return(this.properties&a)==a}};var X=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=B(d,function(a,b){return!b.equals(a)},function(a,b){return X(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;p(d,g);p(d,h);if(!m(d.mouse.y,g.size.top,h.size.bottom))return null;for(var e=Number.MAX_VALUE,l,q,r,x;h&&!h.equals(g)&&(q=g.getNext(d.isRelevant));)l=Math.abs(f(d,g,q)-d.mouse.y),l<e&&(e=l,r=g,x=q),g=q,p(d,g);if(!r||!x||!m(d.mouse.y,r.size.top,x.size.bottom))return null;k.upper=r;k.lower=x;return k.set(F,8)}function c(a,
|
|
996
|
+
b){return!(b&&b.type==CKEDITOR.NODE_TEXT||Q(b)||t(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||t(f)||t(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}}(),U=["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
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(k){var b=a(this.handlers,
|
|
999
999
|
k),c;if(0!==b.length){c=h(b);c=f(c,function(){return e.fire("paste",k.data)});if(!c)return k.cancel();l(b,k)}},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,g=new CKEDITOR.htmlParser.filter,
|
|
@@ -1008,9 +1008,9 @@ 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},g=[],k;k=e.getNextRange();){var b=k.createBookmark();k=a.createRange();k.setStartBefore(b.startNode);b.endNode&&k.setEndAfter(b.endNode);k.collapsed||k.enlarge(CKEDITOR.ENLARGE_ELEMENT);var c=k.createBookmark(),d=c.startNode,n=c.endNode,
|
|
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=
|
|
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},g=[],k;k=e.getNextRange();){var b=k.createBookmark();k=a.createRange();k.setStartBefore(b.startNode);b.endNode&&k.setEndAfter(b.endNode);k.collapsed||k.enlarge(CKEDITOR.ENLARGE_ELEMENT);var c=k.createBookmark(),d=c.startNode,n=c.endNode,t=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)};t(d);if(n)for(t(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 t=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=t;c.startNode.remove();c.endNode&&c.endNode.remove();k.moveToBookmark(b);g.push(k)}a.forceNextSelectionCheck();a.getSelection().selectRanges(g)}}},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
1014
|
CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign";CKEDITOR.plugins.add("resize",{init:function(a){function l(e){var g=b.width,h=b.height,l=g+(e.data.$.screenX-k.x)*("rtl"==m?-1:1);e=h+(e.data.$.screenY-k.y);c&&(g=Math.max(f.resize_minWidth,Math.min(l,f.resize_maxWidth)));d&&(h=Math.max(f.resize_minHeight,Math.min(e,f.resize_maxHeight)));a.resize(c?g:null,h)}function h(){CKEDITOR.document.removeListener("mousemove",l);CKEDITOR.document.removeListener("mouseup",
|
|
1015
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 g=null,k,b,c=("both"==f.resize_dir||
|
|
1016
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){g||(g=a.getResizable());b={width:g.$.offsetWidth||0,height:g.$.offsetHeight||0};k={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&&
|
|
@@ -1043,60 +1043,60 @@ h["border-top"]===h["border-bottom"]&&(e=CKEDITOR.tools.style.parse.border(h["bo
|
|
|
1043
1043
|
"th")||h.equals(g)||(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
|
-
return e}function l(b,c){for(var d=
|
|
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
|
-
(--
|
|
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=
|
|
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 A=new CKEDITOR.dom.element(l[n]),t=A.getParent().$.rowIndex;1==A.$.rowSpan?A.remove():
|
|
1048
|
+
(--A.$.rowSpan,t==b&&(t=f[b+1],t[n-1]?A.insertAfter(new CKEDITOR.dom.element(t[n-1])):(new CKEDITOR.dom.element(e.$.rows[b+1])).append(A,1)));n+=A.$.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
|
+
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
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 g(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
|
|
1052
|
-
|
|
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 t=0,w=h[n].length;t<w;t++)void 0===k&&h[n][t]==f.$&&(k=t),h[n][t]==g.$&&(l=t);for(n=k;n<=l;n++)for(t=0;t<h.length;t++)g=h[t],f=new CKEDITOR.dom.element(e.$.rows[t]),g=new CKEDITOR.dom.element(g[n]),g.$&&(1==g.$.colSpan?g.remove():--g.$.colSpan,
|
|
1052
|
+
t+=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 k(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=
|
|
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
|
|
1061
|
-
|
|
1062
|
-
right:function(a){a.styles["background-color"]=
|
|
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),A;if(c){var t;try{var w=parseInt(b.getAttribute("rowspan"),10)||1;A=parseInt(b.getAttribute("colspan"),
|
|
1056
|
+
10)||1;t=h["up"==c?m-w:"down"==c?m+w:m]["left"==c?n-A:"right"==c?n+A:n]}catch(y){return!1}if(!t||b.$==t)return!1;f["up"==c||"left"==c?"unshift":"push"](new CKEDITOR.dom.element(t))}c=b.getDocument();var E=m,w=t=0,L=!e&&new CKEDITOR.dom.documentFragment(c),H=0;for(c=0;c<f.length;c++){A=f[c];var J=A.getParent(),F=A.getFirst(),K=A.$.colSpan,O=A.$.rowSpan,J=J.$.rowIndex,N=d(h,J,A),H=H+K*O,w=Math.max(w,N-n+K);t=Math.max(t,J-m+O);e||(K=A,(O=K.getBogus())&&O.remove(),K.trim(),A.getChildren().count()&&(J==
|
|
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")),A.moveChildren(L)),c?A.remove():A.setHtml(""));E=J}if(e)return t*w==H;L.moveChildren(b);b.appendBogus();w>=l?b.removeAttribute("rowSpan"):b.$.rowSpan=t;t>=k?b.removeAttribute("colSpan"):b.$.colSpan=w;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 t(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),A,f=e.clone(),k=0;k<h.length;k++)if(A=h[k],A.parentNode==g.$&&k>l){f.insertBefore(new CKEDITOR.dom.element(A));break}else A=null;A||g.append(f)}else for(m=n=1,g=f.clone(),g.insertAfter(f),g.append(f=e.clone()),A=d(h,k),l=0;l<A.length;l++)A[l].rowSpan++;
|
|
1059
|
+
f.appendBogus();e.$.rowSpan=n;f.$.rowSpan=m;1==n&&e.removeAttribute("rowSpan");1==m&&f.removeAttribute("rowSpan");return f}function w(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 u=d.lang.table,
|
|
1061
|
+
y=CKEDITOR.tools.style.parse,p="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:p,contentTransformations:[[{element:"td",left:function(a){return a.styles.background&&y.background(a.styles.background).color},
|
|
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
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=g(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(
|
|
1066
|
+
exec:function(a){c(w(a.getSelection()))}}));f("cellHorizontalSplit",e({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a){c(t(a.getSelection()))}}));f("cellInsertBefore",e({requiredContent:"table",exec:function(a){a=a.getSelection();k(a,!0)}}));f("cellInsertAfter",e({requiredContent:"table",exec:function(a){a=a.getSelection();k(a)}}));d.addMenuItems&&d.addMenuItems({tablecell:{label:u.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:w(b,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_horizontal:t(b,!0)?CKEDITOR.TRISTATE_OFF:
|
|
1068
|
+
CKEDITOR.TRISTATE_DISABLED};d.filter.check(p)&&(b.tablecell_properties=0<c.length?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);return b}},tablecell_insertBefore:{label:u.cell.insertBefore,group:"tablecell",command:"cellInsertBefore",order:5},tablecell_insertAfter:{label:u.cell.insertAfter,group:"tablecell",command:"cellInsertAfter",order:10},tablecell_delete:{label:u.cell.deleteCell,group:"tablecell",command:"cellDelete",order:15},tablecell_merge:{label:u.cell.merge,group:"tablecell",command:"cellMerge",
|
|
1069
1069
|
order:16},tablecell_merge_right:{label:u.cell.mergeRight,group:"tablecell",command:"cellMergeRight",order:17},tablecell_merge_down:{label:u.cell.mergeDown,group:"tablecell",command:"cellMergeDown",order:18},tablecell_split_horizontal:{label:u.cell.splitHorizontal,group:"tablecell",command:"cellHorizontalSplit",order:19},tablecell_split_vertical:{label:u.cell.splitVertical,group:"tablecell",command:"cellVerticalSplit",order:20},tablecell_properties:{label:u.cell.title,group:"tablecellproperties",command:"cellProperties",
|
|
1070
1070
|
order:21},tablerow:{label:u.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:u.row.insertBefore,group:"tablerow",command:"rowInsertBefore",order:5},tablerow_insertAfter:{label:u.row.insertAfter,group:"tablerow",command:"rowInsertAfter",order:10},tablerow_delete:{label:u.row.deleteRow,group:"tablerow",command:"rowDelete",order:15},
|
|
1071
1071
|
tablecolumn:{label:u.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:u.column.insertBefore,group:"tablecolumn",command:"columnInsertBefore",order:5},tablecolumn_insertAfter:{label:u.column.insertAfter,group:"tablecolumn",command:"columnInsertAfter",order:10},tablecolumn_delete:{label:u.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,g=[];for(l=l||0;l<=f;l++){m++;!g[m]&&(g[m]=[]);for(var k=-1,b=h;b<=(-1===e?a[l].cells.length-1:e);b++){var c=a[l].cells[b];if(!c)break;for(k++;g[m][k];)k++;for(var d=isNaN(c.colSpan)?1:c.colSpan,c=isNaN(c.rowSpan)?1:c.rowSpan,n=0;n<c&&!(l+n>f);n++){g[m+n]||(g[m+n]=[]);for(var
|
|
1073
|
+
e:-1;var m=-1,g=[];for(l=l||0;l<=f;l++){m++;!g[m]&&(g[m]=[]);for(var k=-1,b=h;b<=(-1===e?a[l].cells.length-1:e);b++){var c=a[l].cells[b];if(!c)break;for(k++;g[m][k];)k++;for(var d=isNaN(c.colSpan)?1:c.colSpan,c=isNaN(c.rowSpan)?1:c.rowSpan,n=0;n<c&&!(l+n>f);n++){g[m+n]||(g[m+n]=[]);for(var t=0;t<d;t++)g[m+n][k+t]=a[l].cells[b]}k+=d-1;if(-1!==e&&k>=e)break}}return g};(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 g(b,c,d){var g=z(b.getSelection(!0));c=c.is("table")?null:c;var h;(h=
|
|
1077
|
-
c||g[0],
|
|
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&&(r={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 g(b,c,d){var g=z(b.getSelection(!0));c=c.is("table")?null:c;var h;(h=r.active&&!r.first)&&!(h=c)&&(h=b.getSelection().getRanges(),h=1<g.length||h[0]&&!h[0].collapsed?!0:!1);if(h)r.first=
|
|
1077
|
+
c||g[0],r.dirty=c?!1:1!==g.length;else if(r.active&&c&&r.first.getAscendant("table").equals(c.getAscendant("table"))){g=l(r.first,c);if(!r.dirty&&1===g.length&&!a(d.data.getTarget()))return f(b,"mouseup"===d.name);r.dirty=!0;r.last=c;e(b,g)}}function k(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
1078
|
c.length&&c[0]._getTableElement()&&c[0]._getTableElement().is("table")&&(e=c[0]._getTableElement());e=z(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(
|
|
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=z(a.getSelection()))});a.on("afterCommandExec",function(d){-1!==CKEDITOR.tools.array.indexOf(b,d.data.name)&&c(a,d.data)})}var
|
|
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(
|
|
1079
|
+
a.getCommonAncestor(b).is(u):!1}function e(a){return!a.getAscendant("table",!0)&&a.getDocument().equals(l.document)}function k(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),t=b.data.getTarget(),w=t&&t.getAscendant({td:1,th:1},!0),t=t&&t.getAscendant("table",!0),u={table:1,thead:1,tbody:1,tfoot:1,tr:1,td:1,th:1};t&&t.hasAttribute("data-cke-tableselection-ignored")||(k(b,n,p,t)&&f(l,!0),!r.active&&"mousedown"===b.name&&CKEDITOR.tools.getMouseButton(b)===CKEDITOR.MOUSE_BUTTON_LEFT&&t&&(r={active:!0},CKEDITOR.document.on("mouseup",c,null,{editor:l})),(w||t)&&g(l,w||t,b),"mouseup"===b.name&&(CKEDITOR.tools.getMouseButton(b)===
|
|
1081
|
+
CKEDITOR.MOUSE_BUTTON_LEFT&&(e(b.data.getTarget())||d(p,t))&&m(l),r={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,r;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),r=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);r.removeListener();a.fire("unlockSnapshot");b&&(a.extractSelectedHtml(),a.fire("saveSnapshot"))},100))}function t(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 w(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=z(a.getSelection()))});a.on("afterCommandExec",function(d){-1!==CKEDITOR.tools.array.indexOf(b,d.data.name)&&c(a,d.data)})}var r={active:!1},v,z,u,D,p;w.prototype={};w.prototype._reset=function(){this.cells={first:null,last:null,all:[]};this.rows={first:null,last:null}};w.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")};w.prototype.getTableMap=function(){var a=u(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)};w.prototype._getTable=function(){return this.rows.first.getAscendant("table")};
|
|
1086
|
+
w.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=D(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)};w.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(p(e),c));this.setSelectedCells(e)};w.prototype.emptyCells=function(a){a=a||this.cells.all;for(var b=0;b<a.length;b++)a[b].setHtml("")};w.prototype._arraySortByDOMOrder=function(a){a.sort(function(a,b){return a.getPosition(b)&CKEDITOR.POSITION_PRECEDING?-1:1})};var x={onPaste:function(a){function b(a){var c=d.createRange();c.selectNodeContents(a);c.select()}function c(a){return Math.max.apply(null,
|
|
1088
1088
|
CKEDITOR.tools.array.map(a,function(a){return a.length},0))}var d=a.editor,f=d.getSelection(),g=z(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
|
|
1089
|
+
b=void 0,b=!b;return b?!1:!0})(f,g,k,h)&&(g=g[0].getAscendant("table"),m=new w(z(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=u(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,q=function(a){return!k.contains(a)&&a.is&&a.is("td","th")};m&&!q(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(){
|
|
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(){v=CKEDITOR.plugins.tabletools;z=v.getSelectedCells;u=v.getCellColIndex;D=v.insertRow;p=v.insertColumn;CKEDITOR.document.appendStyleSheet(this.path+
|
|
1098
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",k);CKEDITOR.plugins.tableselection.keyboardIntegration(a);CKEDITOR.plugins.clipboard&&
|
|
1099
|
-
!CKEDITOR.plugins.clipboard.isCustomCopyCutSupported&&(b.attachListener(b,"cut",
|
|
1099
|
+
!CKEDITOR.plugins.clipboard.isCustomCopyCutSupported&&(b.attachListener(b,"cut",t),b.attachListener(b,"copy",t))}),a.on("paste",x.onPaste,x),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",
|
|
@@ -1115,54 +1115,61 @@ b;a.addCommand("insertTaoTooltip",{exec:function(a){var b=a.config.taoQtiItem,e=
|
|
|
1115
1115
|
function(){g(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
|
-
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){
|
|
1119
|
-
a=
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
a.
|
|
1130
|
-
"")})
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
!0)
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
(a.
|
|
1152
|
-
|
|
1153
|
-
b.
|
|
1154
|
-
function(a){a.
|
|
1155
|
-
|
|
1156
|
-
"";
|
|
1157
|
-
"
|
|
1158
|
-
"
|
|
1159
|
-
|
|
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)){z=!1;var b=a.cloneContents().childNodes,d;for(d=0;d<b.length;d++)if(c=b[d],!z&&c.nodeType!==window.Node.TEXT_NODE){z=!0;break}if(b=""!==a.toString().trim())b=h(a.startContainer),a=h(a.endContainer),b=b.isSameNode(a);b=b&&!z}else b=!1;return b}function g(a){return a&&a.type===CKEDITOR.NODE_TEXT&&
|
|
1120
|
+
""===a.getText()}function k(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("",a.document),e.insertBefore(c),d.insertAfter(c)),{startAnchor:e,endAnchor:d};
|
|
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 b(b,c){if(!b||!b.isCollapsed()||8!==c&&46!==c)return!1;var d=b.getRanges()[0];if(!d)return!1;var e=d.startContainer;if(!e||!e.getAscendant)return!1;e=e.getAscendant("rt",!0);if(!e)return!1;k(e);var f;a:{f=new CKEDITOR.dom.range(a.document);f.selectNodeContents(e);
|
|
1122
|
+
f=new CKEDITOR.dom.walker(f);for(var g=f.next();g;){if(g.type===CKEDITOR.NODE_TEXT)for(var h=g.getText(),l=0;l<h.length;l++)if(""!==h.charAt(l)){f={node:g,offset:l};break a}g=f.next()}f=null}if(!(g=!f)){a:if(g=f,d.startContainer.equals(g.node))d=d.startOffset<=g.offset;else{for(h=e.getFirst();h;){if(h.equals(d.startContainer)){d=!0;break a}if(h.equals(g.node)){d=!1;break a}h=h.getNext()}d=!1}g=!d}if(g)return!1;a.fire("saveSnapshot");a.fire("lockSnapshot");try{var m=f.node.getText();f.node.$.nodeValue=
|
|
1123
|
+
m.slice(0,f.offset)+m.slice(f.offset+1);k(e);var n=k(e),p=a.getSelection(),r=new CKEDITOR.dom.range(a.document);r.setStart(n.startAnchor,1);r.collapse(!0);p.selectRanges([r])}finally{a.fire("unlockSnapshot")}return!0}function c(a){a&&a.getAscendant&&(a=a.getAscendant("rt",!0))&&k(a)}function d(b,c){if(v||!b||!b.isCollapsed())return!1;var d=b.getRanges()[0];if(!d)return!1;var e=d.startContainer;if(!e||!e.getAscendant)return!1;var f=e.getAscendant("rt",!0);if(f)return k(f),!1;(f=c&&c.getAscendant?c.getAscendant("ruby",
|
|
1124
|
+
!0):null)||(f=e.getAscendant("ruby",!0));if(!f)return!1;var g=f.find("rt"),h=g.count()?g.getItem(0):null;if(!h)return!1;var g=k(h),l=new CKEDITOR.dom.range(a.document),m=!0,h=h.getIndex();e.equals(f)&&d.startOffset>h&&(m=!1);m?l.setStart(g.startAnchor,1):l.setStartBefore(g.endAnchor);l.collapse(!0);v=!0;try{b.selectRanges([l])}finally{v=!1}return!0}function n(a){return a.replace(r,function(a,b,c,d){return b+c.replace(y,"")+d})}function t(b,c,d){b=b.getAscendant("ruby");if(!b)return!1;var e=b.find("rb"),
|
|
1125
|
+
f=b.find("rt"),e=e.count()?e.getItem(0):null,f=f.count()?f.getItem(0):null,g;if(e&&!f||c&&e&&f&&""===(f.$.textContent||"").replace(y,"").trim()){a.fire("saveSnapshot");a.fire("lockSnapshot");try{var h=e?e.getText():"",k=new CKEDITOR.dom.text(h,a.document);k.replace(b);c||(g=new CKEDITOR.dom.range(a.document),g.selectNodeContents(k),d.selectRanges([g]));a.updateElement();a.fire("change")}finally{a.fire("unlockSnapshot")}return!0}}function w(a){function b(c){p.forEach(function(b){a.getCommand(b).setState(!c);
|
|
1126
|
+
a.getCommand(b).setState(c)});x.forEach(function(a){a.setState(c)})}var c=a.getCommand("rubyFurigana"),d=a.getSelection(),g=d.getRanges()[0];p.length||a.toolbar.forEach(function(a){a.items&&a.items.length&&a.items.forEach(function(a){a.command&&"rubyFurigana"!==a.command?(p.push(a.command),D.includes(a.command)&&u.push(a)):a.command||"undefined"===typeof a.setState||x.push(a)})});c&&(m(a)?(c.setState(CKEDITOR.TRISTATE_OFF),b(CKEDITOR.TRISTATE_OFF)):d.getRanges()[0]&&f(g.startContainer)?t(g.startContainer,
|
|
1127
|
+
!1,d)?(c.setState(CKEDITOR.TRISTATE_DISABLED),b(CKEDITOR.TRISTATE_OFF)):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);u.forEach(function(a){a.setState(CKEDITOR.TRISTATE_OFF)})},150)):(c.setState(CKEDITOR.TRISTATE_DISABLED),b(CKEDITOR.TRISTATE_OFF)))}var y=/\u200B/g,r=/(<rt\b[^>]*>)([\s\S]*?)(<\/rt>)/gi,v=!1,z,u=[],D="bold italic strike spanUnderline subscript superscript".split(" "),
|
|
1128
|
+
p=[],x=[];a.addCommand("rubyFurigana",{exec:function(a){var b=a.getSelection(),c=b.getRanges()[0].startContainer,d,e,g;if(f(c))if(d=c.getAscendant("ruby"),e=d.find("rb"),t(c,!0))w(a);else{a.fire("saveSnapshot");a.fire("lockSnapshot");try{var c="",h=e.getItem(0);h&&(c=h.getText());var n=new CKEDITOR.dom.text(c,a.document);n.replace(d);g=new CKEDITOR.dom.range(a.document);g.setStartAfter(n);g.collapse(!0);b.selectRanges([g]);a.updateElement();a.fire("change");w(a)}finally{a.fire("unlockSnapshot")}}else m(a)&&
|
|
1129
|
+
(a.fire("saveSnapshot"),a.fire("lockSnapshot"),d=new CKEDITOR.dom.element("ruby",a.document),e=new CKEDITOR.dom.element("rb",a.document),e.append(l(b)),g=new CKEDITOR.dom.element("rt",a.document),d.append(e),d.append(g),e=k(g),a.insertElement(d),g=d.getNext(),(!g||g.type===CKEDITOR.NODE_TEXT&&""===g.getText().trim())&&(new CKEDITOR.dom.text("",a.document)).insertAfter(d),g=new CKEDITOR.dom.range(a.document),g.setStart(e.startAnchor,1),g.collapse(!0),a.getSelection().removeAllRanges(),a.getSelection().selectRanges([g]),
|
|
1130
|
+
w(a),a.fire("unlockSnapshot"))}});a.on("instanceReady",function(){var e=a.editable();a.getCommand("rubyFurigana").setState(CKEDITOR.TRISTATE_DISABLED);e.attachListener(e,"mouseup",function(){w(a)});e.attachListener(e,"focus",function(b){var e=a.getSelection();b=b&&b.data&&b.data.getTarget?b.data.getTarget():null;d(e,b);(e=e&&e.getRanges()[0])&&c(e.startContainer)});e.attachListener(e,"keyup",function(){w(a)});e.attachListener(e,"keydown",function(c){var d=c&&c.data&&c.data.$?c.data.$:null,d=d?d.keyCode:
|
|
1131
|
+
null,e=a.getSelection();b(e,d)&&(c&&c.data&&c.data.preventDefault&&c.data.preventDefault(),a.fire("change"),w(a))});a.on("selectionChange",function(){var b=a.getSelection();d(b);(b=b&&b.getRanges()[0])&&c(b.startContainer)})});a.on("getData",function(a){a.data.dataValue=n(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)&&""===(f.$.textContent||"").replace(y,"").trim()&&(f=e.find("rb"),
|
|
1132
|
+
f.count())){a.fire("saveSnapshot");a.fire("lockSnapshot");try{var g=f.getItem(0),h=g.$.innerHTML,k;try{k=CKEDITOR.dom.element.createFromHtml(h,a.document)}catch(l){k=null}k&&k.type!==CKEDITOR.NODE_TEXT||(k=new CKEDITOR.dom.text(g.getText(),a.document));k.replace(e);c=!0}finally{a.fire("unlockSnapshot")}}}c&&(a.updateElement(),a.fire("change"),w(a))});a.ui.addButton("TaoFurigana",{label:a.lang.rubyFurigana.button,command:"rubyFurigana",icon:this.path+"images/taofurigana.png"})}});"use strict";(function(){function a(a,
|
|
1133
|
+
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&&e.save()}function d(){e.enabled=a.readOnly?!1:"wysiwyg"==a.mode;e.onChange()}var e=a.undoManager=new f(a),h=e.editingHandler=new g(e),k=a.addCommand("undo",{exec:function(){e.undo()&&(a.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,
|
|
1134
|
+
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(){k.setState(e.undoable()?CKEDITOR.TRISTATE_OFF: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",
|
|
1135
|
+
h.attachListeners,h);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",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=
|
|
1136
|
+
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||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]+
|
|
1137
|
+
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)!=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=
|
|
1138
|
+
-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||"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+
|
|
1139
|
+
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);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];
|
|
1140
|
+
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=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),
|
|
1141
|
+
!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-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)?
|
|
1142
|
+
(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}}},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)}};
|
|
1143
|
+
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=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=
|
|
1144
|
+
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=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||
|
|
1145
|
+
!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 g=CKEDITOR.plugins.undo.NativeEditingHandler=function(a){this.undoManager=a;this.ignoreInputEvent=!1;this.keyEventsStack=new k;this.lastKeydownImage=null};g.prototype={onKeydown:function(a){var c=a.data.getKey();if(229!==c)if(-1<CKEDITOR.tools.indexOf(l,
|
|
1146
|
+
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,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));
|
|
1147
|
+
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);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)},
|
|
1148
|
+
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(),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":
|
|
1149
|
+
"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(),"click",function(){d.onNavigationKey()},null,null,999);c.attachListener(this.undoManager.editor,"blur",function(){d.keyEventsStack.remove(9)},null,null,999)}};var k=CKEDITOR.plugins.undo.KeyEventsStack=
|
|
1150
|
+
function(){this.stack=[]};k.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);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"==
|
|
1151
|
+
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)}}})();(function(){function a(a){function f(a){var b=!1;d.attachListener(d,"keydown",function(){var c=h.getBody().getElementsByTag(a);if(!b){for(var d=0;d<c.count();d++)c.getItem(d).setCustomData("retain",
|
|
1152
|
+
!0);b=!0}},null,null,1);d.attachListener(d,"keyup",function(){var c=h.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 g=this.editor;if(g&&!g.isDetached()){var h=a.document,b=h.body,c=h.getElementById("cke_actscrpt");c&&c.parentNode.removeChild(c);(c=h.getElementById("cke_shimscrpt"))&&c.parentNode.removeChild(c);(c=h.getElementById("cke_basetagscrpt"))&&c.parentNode.removeChild(c);
|
|
1153
|
+
b.contentEditable=!0;CKEDITOR.env.ie&&(b.hideFocus=!0,b.disabled=!0,b.removeAttribute("disabled"));delete this._.isLoadingData;this.$=b;h=new CKEDITOR.dom.document(h);this.setup();this.fixInitialSelection();var d=this;CKEDITOR.env.ie&&!CKEDITOR.env.edge&&h.getDocumentElement().addClass(h.$.compatMode);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&g.enterMode!=CKEDITOR.ENTER_P?f("p"):CKEDITOR.env.edge&&15>CKEDITOR.env.version&&g.enterMode!=CKEDITOR.ENTER_DIV&&f("div");if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&
|
|
1154
|
+
10<CKEDITOR.env.version)h.getDocumentElement().on("mousedown",function(a){a.data.getTarget().is("html")&&setTimeout(function(){g.editable().focus()})});l(g);try{g.document.$.execCommand("2D-position",!1,!0)}catch(n){}(CKEDITOR.env.gecko||CKEDITOR.env.ie&&"CSS1Compat"==g.document.$.compatMode)&&this.attachListener(this,"keydown",function(a){var b=a.data.getKeystroke();if(33==b||34==b)if(CKEDITOR.env.ie)setTimeout(function(){g.getSelection().scrollIntoView()},0);else if(g.window.$.innerHeight>this.$.offsetHeight){var c=
|
|
1155
|
+
g.createRange();c[33==b?"moveToElementEditStart":"moveToElementEditEnd"](this);c.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(h,"blur",function(){try{h.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&this.attachListener(h,"touchend",function(){a.focus()});b=g.document.getElementsByTag("title").getItem(0);b.data("cke-title",b.getText());CKEDITOR.env.ie&&(g.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready");
|
|
1156
|
+
g.fire("contentDom");this._.isPendingFocus&&(g.focus(),this._.isPendingFocus=!1);setTimeout(function(){g.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",g),b=null),d.$.attachEvent("onresizestart",g),b=d.$)})}function g(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var h=a.document.$;h.execCommand("enableObjectResizing",!1,!a.config.disableObjectResizing);
|
|
1157
|
+
h.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=[],g;for(g in CKEDITOR.dtd.$removeEmpty)f.push("html.CSS1Compat "+g+"[contenteditable\x3dfalse]");a.push(f.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(a.push("html{height:100% !important}"),
|
|
1158
|
+
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 [*]",requiredContent:"body"});a.addMode("wysiwyg",function(h){function g(c){c&&c.removeListener();a.isDestroyed()||a.isDetached()||(a.editable(new f(a,
|
|
1159
|
+
b.$.contentWindow.document.body)),a.setData(a.getData(1),h))}var k="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",k=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent(k)+"}())":"",b=CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"'+k+'" frameBorder\x3d"0"\x3e\x3c/iframe\x3e');b.setStyles({width:"100%",height:"100%"});b.addClass("cke_wysiwyg_frame").addClass("cke_reset");
|
|
1160
|
+
k=a.ui.space("contents");k.append(b);var c=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.gecko;if(c)b.on("load",g);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(),t=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+d+'" class\x3d"cke_voice_label"\x3e'+l+"\x3c/span\x3e");k.append(t,1);b.setAttribute("aria-describedby",d)}a.on("beforeModeUnload",function(a){a.removeListener();t&&t.remove()});
|
|
1161
|
+
b.setAttributes({tabIndex:a.tabIndex,allowTransparency:"true"});!c&&g();a.fire("ariaWidget",b)})}});CKEDITOR.editor.prototype.addContentsCss=function(a){var f=this.config,g=f.contentsCss;CKEDITOR.tools.isArray(g)||(f.contentsCss=g?[g]:[]);f.contentsCss.push(a)};f=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments);this._.frameLoadedHandler=CKEDITOR.tools.addFunction(function(e){CKEDITOR.tools.setTimeout(a,0,this,e)},this);this._.docTitle=this.getWindow().getFrame().getAttribute("title")},
|
|
1162
|
+
base:CKEDITOR.editable,proto:{setData:function(a,f){var g=this.editor;if(f)this.setHtml(a),this.fixInitialSelection(),g.fire("dataReady");else{this._.isLoadingData=!0;g._.dataStore={id:1};var k=g.config,b=k.fullPage,c=k.docType,d=CKEDITOR.tools.buildStyleHtml(h()).replace(/<style>/,'\x3cstyle data-cke-temp\x3d"1"\x3e');b||(d+=CKEDITOR.tools.buildStyleHtml(g.config.contentsCss));var l=k.baseHref?'\x3cbase href\x3d"'+k.baseHref+'" data-cke-temp\x3d"1" /\x3e':"";b&&(a=a.replace(/<!DOCTYPE[^>]*>/i,function(a){g.docType=
|
|
1163
|
+
c=a;return""}).replace(/<\?xml\s[^\?]*\?>/i,function(a){g.xmlDeclaration=a;return""}));a=g.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"),l&&(a=a.replace(/<head[^>]*?>/,"$\x26"+l)),a=a.replace(/<\/head\s*>/,d+"$\x26"),a=
|
|
1164
|
+
c+a):a=k.docType+'\x3chtml dir\x3d"'+k.contentsLangDirection+'" lang\x3d"'+(k.contentsLanguage||g.langCode)+'"\x3e\x3chead\x3e\x3ctitle\x3e'+this._.docTitle+"\x3c/title\x3e"+l+d+"\x3c/head\x3e\x3cbody"+(k.bodyId?' id\x3d"'+k.bodyId+'"':"")+(k.bodyClass?' class\x3d"'+k.bodyClass+'"':"")+"\x3e"+a+"\x3c/body\x3e\x3c/html\x3e";CKEDITOR.env.gecko&&(a=a.replace(/<body/,'\x3cbody contenteditable\x3d"true" '),2E4>CKEDITOR.env.version&&(a=a.replace(/<body[^>]*>/,"$\x26\x3c!-- cke-content-start --\x3e")));
|
|
1165
|
+
k='\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&&(k+='\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e');
|
|
1166
|
+
l&&CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(k+='\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');a=a.replace(/(?=\s*<\/(:?head)>)/,k);this.clearCustomData();this.clearListeners();g.fire("contentDomUnload");var t=this.getDocument();try{t.write(a)}catch(w){setTimeout(function(){t.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();a=this.editor;var f=a.config,g=f.fullPage,h=g&&a.docType,b=g&&a.xmlDeclaration,
|
|
1160
1167
|
c=this.getDocument(),g=g?c.getDocumentElement().getOuterHtml():c.getBody().getHtml();CKEDITOR.env.gecko&&f.enterMode!=CKEDITOR.ENTER_BR&&(g=g.replace(/<br>(?=\s*(:?$|<\/body>))/,""));g=a.dataProcessor.toDataFormat(g);b&&(g=b+"\n"+g);h&&(g=h+"\n"+g);return g},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);
|
|
1161
1168
|
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"!==
|
|
1162
1169
|
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;
|
|
1163
1170
|
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=
|
|
1164
|
-
null;a.interactionWrapper=null;var e=a.getSelection(),k=e&&e.getStartElement();if(k){var b;if(k)try{for(var c=k,e=!1,k=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)&&(k=c);if("function"===typeof c.getParent){if(c=c.getParent(),l(c))break}else break}if(!e&&k&&"function"===typeof k.getChildren)for(var n=k.getChildren(),d=0;d<n.count();d++){var
|
|
1165
|
-
if(f(
|
|
1171
|
+
null;a.interactionWrapper=null;var e=a.getSelection(),k=e&&e.getStartElement();if(k){var b;if(k)try{for(var c=k,e=!1,k=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)&&(k=c);if("function"===typeof c.getParent){if(c=c.getParent(),l(c))break}else break}if(!e&&k&&"function"===typeof k.getChildren)for(var n=k.getChildren(),d=0;d<n.count();d++){var t=n.getItem(d);
|
|
1172
|
+
if(f(t)){a.interactionElement=t;a.interactionWrapper=k;e=!0;break}}b=e}catch(w){console.error("Error in findInteractionFromElement:",w),b=!1}else b=!1;if(b)return!0}var y=a.editable();return y&&m(y)?!0:!1}catch(r){return console.error("Error in findInteractionAndWrapper:",r),!1}}function m(e){if(!e)return!1;try{if(f(e)){a.interactionElement=e;if("function"===typeof e.getParent){var k=e.getParent();h(k)?a.interactionWrapper=k:a.interactionWrapper=null}else a.interactionWrapper=null;return!0}if(h(e)&&
|
|
1166
1173
|
"function"===typeof e.getChildren)for(var b=e.getChildren(),k=0;k<b.count();k++){var c=b.getItem(k);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");
|
|
1167
1174
|
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";
|
|
1168
1175
|
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",
|