@oat-sa/tao-core-shared-libs 1.4.0 → 1.5.0
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 +848 -845
- package/lib/ckeditor/lang/af.js +1 -1
- package/lib/ckeditor/lang/ar.js +1 -1
- package/lib/ckeditor/lang/az.js +1 -1
- package/lib/ckeditor/lang/bg.js +1 -1
- package/lib/ckeditor/lang/bn.js +1 -1
- package/lib/ckeditor/lang/bs.js +1 -1
- package/lib/ckeditor/lang/ca.js +1 -1
- package/lib/ckeditor/lang/cs.js +1 -1
- package/lib/ckeditor/lang/cy.js +1 -1
- package/lib/ckeditor/lang/da.js +1 -1
- package/lib/ckeditor/lang/de-ch.js +1 -1
- package/lib/ckeditor/lang/de.js +1 -1
- package/lib/ckeditor/lang/el.js +1 -1
- package/lib/ckeditor/lang/en-au.js +1 -1
- package/lib/ckeditor/lang/en-ca.js +1 -1
- package/lib/ckeditor/lang/en-gb.js +1 -1
- package/lib/ckeditor/lang/en.js +1 -1
- package/lib/ckeditor/lang/eo.js +1 -1
- package/lib/ckeditor/lang/es-mx.js +1 -1
- package/lib/ckeditor/lang/es.js +1 -1
- package/lib/ckeditor/lang/et.js +1 -1
- package/lib/ckeditor/lang/eu.js +1 -1
- package/lib/ckeditor/lang/fa.js +1 -1
- package/lib/ckeditor/lang/fi.js +1 -1
- package/lib/ckeditor/lang/fo.js +1 -1
- package/lib/ckeditor/lang/fr-ca.js +1 -1
- package/lib/ckeditor/lang/fr.js +1 -1
- package/lib/ckeditor/lang/gl.js +1 -1
- package/lib/ckeditor/lang/gu.js +1 -1
- package/lib/ckeditor/lang/he.js +1 -1
- package/lib/ckeditor/lang/hi.js +1 -1
- package/lib/ckeditor/lang/hr.js +1 -1
- package/lib/ckeditor/lang/hu.js +1 -1
- package/lib/ckeditor/lang/id.js +1 -1
- package/lib/ckeditor/lang/is.js +1 -1
- package/lib/ckeditor/lang/it.js +1 -1
- package/lib/ckeditor/lang/ja.js +1 -1
- package/lib/ckeditor/lang/ka.js +1 -1
- package/lib/ckeditor/lang/km.js +1 -1
- package/lib/ckeditor/lang/ko.js +1 -1
- package/lib/ckeditor/lang/ku.js +1 -1
- package/lib/ckeditor/lang/lt.js +1 -1
- package/lib/ckeditor/lang/lv.js +1 -1
- package/lib/ckeditor/lang/mk.js +1 -1
- package/lib/ckeditor/lang/mn.js +1 -1
- package/lib/ckeditor/lang/ms.js +1 -1
- package/lib/ckeditor/lang/nb.js +1 -1
- package/lib/ckeditor/lang/nl.js +1 -1
- package/lib/ckeditor/lang/no.js +1 -1
- package/lib/ckeditor/lang/oc.js +1 -1
- package/lib/ckeditor/lang/pl.js +1 -1
- package/lib/ckeditor/lang/pt-br.js +1 -1
- package/lib/ckeditor/lang/pt.js +1 -1
- package/lib/ckeditor/lang/ro.js +1 -1
- package/lib/ckeditor/lang/ru.js +1 -1
- package/lib/ckeditor/lang/si.js +1 -1
- package/lib/ckeditor/lang/sk.js +1 -1
- package/lib/ckeditor/lang/sl.js +1 -1
- package/lib/ckeditor/lang/sq.js +1 -1
- package/lib/ckeditor/lang/sr-latn.js +1 -1
- package/lib/ckeditor/lang/sr.js +1 -1
- package/lib/ckeditor/lang/sv.js +1 -1
- package/lib/ckeditor/lang/th.js +1 -1
- package/lib/ckeditor/lang/tr.js +1 -1
- package/lib/ckeditor/lang/tt.js +1 -1
- package/lib/ckeditor/lang/ug.js +1 -1
- package/lib/ckeditor/lang/uk.js +1 -1
- package/lib/ckeditor/lang/vi.js +1 -1
- package/lib/ckeditor/lang/zh-cn.js +1 -1
- package/lib/ckeditor/lang/zh.js +1 -1
- package/lib/ckeditor/plugins/horizontalrule/lang/af.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/ar.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/az.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/bg.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/bn.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/bs.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/ca.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/cs.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/cy.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/da.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/de-ch.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/de.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/el.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/en-au.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/en-ca.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/en-gb.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/en.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/eo.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/es-mx.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/es.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/et.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/eu.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/fa.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/fi.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/fo.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/fr-ca.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/fr.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/gl.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/gu.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/he.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/hi.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/hr.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/hu.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/id.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/is.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/it.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/ja.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/ka.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/km.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/ko.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/ku.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/lt.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/lv.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/mk.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/mn.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/ms.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/nb.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/nl.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/no.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/oc.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/pl.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/pt-br.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/pt.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/ro.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/ru.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/si.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/sk.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/sl.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/sq.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/sr-latn.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/sr.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/sv.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/th.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/tr.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/tt.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/ug.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/uk.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/vi.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/zh-cn.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/lang/zh.js +1 -7
- package/lib/ckeditor/plugins/horizontalrule/plugin.js +7 -86
- package/lib/ckeditor/plugins/icons.png +0 -0
- package/lib/ckeditor/plugins/icons_hidpi.png +0 -0
- package/lib/ckeditor/plugins/taofurigana/images/taofurigana.png +0 -0
- package/lib/ckeditor/plugins/taolanguage/plugin.js +6 -5
- 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/kama/icons.png +0 -0
- package/lib/ckeditor/skins/kama/icons_hidpi.png +0 -0
- 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/icons.png +0 -0
- package/lib/ckeditor/skins/moono/icons_hidpi.png +0 -0
- 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/moono-lisa/icons.png +0 -0
- package/lib/ckeditor/skins/moono-lisa/icons_hidpi.png +0 -0
- package/lib/ckeditor/skins/tao/dialog.css.map +1 -1
- package/lib/ckeditor/skins/tao/editor.css +1 -1
- package/lib/ckeditor/skins/tao/editor.css.map +1 -1
- package/lib/ckeditor/skins/tao/icons.png +0 -0
- package/lib/ckeditor/skins/tao/icons_hidpi.png +0 -0
- package/package.json +1 -1
package/lib/ckeditor/ckeditor.js
CHANGED
|
@@ -2,43 +2,43 @@
|
|
|
2
2
|
Copyright (c) 2003-2022, 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:"MAND",version:"4.14.1 TAO-3 DEV",revision:"2de12caec",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var f=window.CKEDITOR_BASEPATH||"";if(!f)for(var g=document.getElementsByTagName("script"),k=0;k<g.length;k++){var h=g[k].src.match(a);if(h){f=h[1];break}}-1==f.indexOf(":/")&&
|
|
6
6
|
"//"!=f.slice(0,2)&&(f=0===f.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+f:location.href.match(/^[^\?]*\/(?:)/)[0]+f);if(!f)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return f}(),getUrl:function(a){-1==a.indexOf(":/")&&0!==a.indexOf("/")&&(a=this.basePath+a);this.timestamp&&"/"!=a.charAt(a.length-1)&&!/[&?]t=/.test(a)&&(a+=(0<=a.indexOf("?")?"\x26":"?")+"t\x3d"+this.timestamp);
|
|
7
|
-
return a},domReady:function(){function a(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",a,!1),f()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",a),f())}catch(
|
|
8
|
-
a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",a);window.attachEvent("onload",a);
|
|
9
|
-
CKEDITOR.event.prototype=function(){function a(a){var e=l(this);return e[a]||(e[a]=new
|
|
10
|
-
data:n,listenerData:k,stop:b,cancel:
|
|
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},
|
|
12
|
-
|
|
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*)/),
|
|
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};
|
|
15
|
-
!0:
|
|
16
|
-
534>f);
|
|
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(h){}}function f(){for(var h;h=k.shift();)h()}var k=[];return function(h){function b(){try{document.documentElement.doScroll("left")}catch(c){setTimeout(b,1);return}a()}k.push(h);"complete"===document.readyState&&setTimeout(a,1);if(1==k.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",
|
|
8
|
+
a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",a);window.attachEvent("onload",a);h=!1;try{h=!window.frameElement}catch(d){}document.documentElement.doScroll&&h&&b()}}}()},g=window.CKEDITOR_GETURL;if(g){var f=l.getUrl;l.getUrl=function(a){return g.call(l,a)||f.call(l,a)}}return l}());CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(a){var l=CKEDITOR.event.prototype,g;for(g in l)null==a[g]&&(a[g]=l[g])},
|
|
9
|
+
CKEDITOR.event.prototype=function(){function a(a){var e=l(this);return e[a]||(e[a]=new g(a))}var l=function(a){a=a.getPrivate&&a.getPrivate()||a._||(a._={});return a.events||(a.events={})},g=function(a){this.name=a;this.listeners=[]};g.prototype={getListenerIndex:function(a){for(var e=0,g=this.listeners;e<g.length;e++)if(g[e].fn==a)return e;return-1}};return{define:function(f,e){var g=a.call(this,f);CKEDITOR.tools.extend(g,e,!0)},on:function(f,e,g,k,h){function b(c,n,b,a){c={name:f,sender:this,editor:c,
|
|
10
|
+
data:n,listenerData:k,stop:b,cancel:a,removeListener:d};return!1===e.call(g,c)?!1:c.data}function d(){n.removeListener(f,e)}var c=a.call(this,f);if(0>c.getListenerIndex(e)){c=c.listeners;g||(g=this);isNaN(h)&&(h=10);var n=this;b.fn=e;b.priority=h;for(var p=c.length-1;0<=p;p--)if(c[p].priority<=h)return c.splice(p+1,0,b),{removeListener:d};c.unshift(b)}return{removeListener:d}},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},g=0,k=function(){g=1};return function(h,b,d){var c=l(this)[h];h=a;var n=g;a=g=0;if(c){var p=c.listeners;if(p.length)for(var p=p.slice(0),q,t=0;t<p.length;t++){if(c.errorProof)try{q=p[t].call(this,d,b,e,k)}catch(r){}else q=p[t].call(this,d,b,e,k);!1===q?g=1:"undefined"!=typeof q&&(b=q);if(a||g)break}}b=
|
|
12
|
+
g?!1:"undefined"==typeof b?!0:b;a=h;g=n;return b}}(),fireOnce:function(a,e,g){e=this.fire(a,e,g);delete l(this)[a];return e},removeListener:function(a,e){var g=l(this)[a];if(g){var k=g.getListenerIndex(e);0<=k&&g.listeners.splice(k,1)}},removeAllListeners:function(){var a=l(this),e;for(e in a)delete a[e]},hasListeners:function(a){return(a=l(this)[a])&&0<a.listeners.length}}}());CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]);CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=
|
|
13
|
+
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*)/),g=-1<a.indexOf("trident/"),g=!(!l&&!g),g={ie:g,edge:!!l,webkit:!g&&
|
|
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};g.gecko="Gecko"==navigator.product&&!g.webkit&&!g.ie;g.webkit&&(-1<a.indexOf("chrome")?g.chrome=
|
|
15
|
+
!0:g.safari=!0);var f=0;g.ie&&(f=l?parseFloat(l[1]):g.quirks||!document.documentMode?parseFloat(a.match(/msie (\d+)/)[1]):document.documentMode,g.ie9Compat=9==f,g.ie8Compat=8==f,g.ie7Compat=7==f,g.ie6Compat=7>f||g.quirks);g.gecko&&(l=a.match(/rv:([\d\.]+)/))&&(l=l[1].split("."),f=1E4*l[0]+100*(l[1]||0)+1*(l[2]||0));g.air&&(f=parseFloat(a.match(/ adobeair\/(\d+)/)[1]));g.webkit&&(f=parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));g.version=f;g.isCompatible=!(g.ie&&7>f)&&!(g.gecko&&4E4>f)&&!(g.webkit&&
|
|
16
|
+
534>f);g.hidpi=2<=window.devicePixelRatio;g.needsBrFiller=g.gecko||g.webkit||g.ie&&10<f;g.needsNbspFiller=g.ie&&11>f;g.cssClass="cke_browser_"+(g.ie?"ie":g.gecko?"gecko":g.webkit?"webkit":"unknown");g.quirks&&(g.cssClass+=" cke_browser_quirks");g.ie&&(g.cssClass+=" cke_browser_ie"+(g.quirks?"6 cke_browser_iequirks":g.version));g.air&&(g.cssClass+=" cke_browser_air");g.iOS&&(g.cssClass+=" cke_browser_ios");g.hidpi&&(g.cssClass+=" cke_hidpi");return g}());"unloaded"==CKEDITOR.status&&function(){CKEDITOR.event.implementOn(CKEDITOR);
|
|
17
17
|
CKEDITOR.loadFullCore=function(){if("basic_ready"!=CKEDITOR.status)CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var a=document.createElement("script");a.type="text/javascript";a.src=CKEDITOR.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(a)}};CKEDITOR.loadFullCoreTimeout=0;CKEDITOR.add=function(a){(this._.pending||(this._.pending=[])).push(a)};(function(){CKEDITOR.domReady(function(){var a=CKEDITOR.loadFullCore,l=CKEDITOR.loadFullCoreTimeout;a&&(CKEDITOR.status=
|
|
18
18
|
"basic_ready",a&&a._load?a():l&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},1E3*l))})})();CKEDITOR.status="basic_loaded"}();"use strict";CKEDITOR.VERBOSITY_WARN=1;CKEDITOR.VERBOSITY_ERROR=2;CKEDITOR.verbosity=CKEDITOR.VERBOSITY_WARN|CKEDITOR.VERBOSITY_ERROR;CKEDITOR.warn=function(a,l){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_WARN&&CKEDITOR.fire("log",{type:"warn",errorCode:a,additionalData:l})};CKEDITOR.error=function(a,l){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_ERROR&&CKEDITOR.fire("log",
|
|
19
|
-
{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",
|
|
20
|
-
c;this._context=a;this._lastOutput=this._scheduledTimer=0;this._output=CKEDITOR.tools.bind(b,a||{});var
|
|
21
|
-
Array.prototype.slice.call(arguments);c.call(this)}})}var
|
|
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",g=a.data.errorCode;if(a=a.data.additionalData)console[l]("[CKEDITOR] Error code: "+g+".",a);else console[l]("[CKEDITOR] Error code: "+g+".");console[l]("[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#"+g)}},null,null,999);CKEDITOR.dom={};(function(){function a(c,b,a){this._minInterval=
|
|
20
|
+
c;this._context=a;this._lastOutput=this._scheduledTimer=0;this._output=CKEDITOR.tools.bind(b,a||{});var h=this;this.input=function(){function c(){h._lastOutput=(new Date).getTime();h._scheduledTimer=0;h._call()}if(!h._scheduledTimer||!1!==h._reschedule()){var n=(new Date).getTime()-h._lastOutput;n<h._minInterval?h._scheduledTimer=setTimeout(c,h._minInterval-n):c()}}}function l(c,b,h){a.call(this,c,b,h);this._args=[];var d=this;this.input=CKEDITOR.tools.override(this.input,function(c){return function(){d._args=
|
|
21
|
+
Array.prototype.slice.call(arguments);c.call(this)}})}var g=[],f=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",e=/&/g,m=/>/g,k=/</g,h=/"/g,b=/&(lt|gt|amp|quot|nbsp|shy|#\d{1,5});/g,d={lt:"\x3c",gt:"\x3e",amp:"\x26",quot:'"',nbsp:" ",shy:""},c=function(c,b){return"#"==b[0]?String.fromCharCode(parseInt(b.slice(1),10)):d[b]};CKEDITOR.on("reset",function(){g=[]});CKEDITOR.tools={arrayCompare:function(c,b){if(!c&&!b)return!0;if(!c||!b||c.length!=b.length)return!1;
|
|
22
22
|
for(var a=0;a<c.length;a++)if(c[a]!=b[a])return!1;return!0},getIndex:function(c,b){for(var a=0;a<c.length;++a)if(b(c[a]))return a;return-1},clone:function(c){var b;if(c&&c instanceof Array){b=[];for(var a=0;a<c.length;a++)b[a]=CKEDITOR.tools.clone(c[a]);return b}if(null===c||"object"!=typeof c||c instanceof String||c instanceof Number||c instanceof Boolean||c instanceof Date||c instanceof RegExp||c.nodeType||c.window===c)return c;b=new c.constructor;for(a in c)b[a]=CKEDITOR.tools.clone(c[a]);return b},
|
|
23
|
-
capitalize:function(c,b){return c.charAt(0).toUpperCase()+(b?c.slice(1):c.slice(1).toLowerCase())},extend:function(c){var b=arguments.length,a,
|
|
23
|
+
capitalize:function(c,b){return c.charAt(0).toUpperCase()+(b?c.slice(1):c.slice(1).toLowerCase())},extend:function(c){var b=arguments.length,a,h;"boolean"==typeof(a=arguments[b-1])?b--:"boolean"==typeof(a=arguments[b-2])&&(h=arguments[b-1],b-=2);for(var d=1;d<b;d++){var f=arguments[d]||{};CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(f),function(b){if(!0===a||null==c[b])if(!h||b in h)c[b]=f[b]})}return c},prototypedCopy:function(c){var b=function(){};b.prototype=c;return new b},copy:function(c){var b=
|
|
24
24
|
{},a;for(a in c)b[a]=c[a];return b},isArray:function(c){return"[object Array]"==Object.prototype.toString.call(c)},isEmpty:function(c){for(var b in c)if(c.hasOwnProperty(b))return!1;return!0},cssVendorPrefix:function(c,b,a){if(a)return f+c+":"+b+";"+c+":"+b;a={};a[c]=b;a[f+c]=b;return a},cssStyleToDomStyle:function(){var c=document.createElement("div").style,b="undefined"!=typeof c.cssFloat?"cssFloat":"undefined"!=typeof c.styleFloat?"styleFloat":"float";return function(c){return"float"==c?b:c.replace(/-./g,
|
|
25
|
-
function(c){return c.substr(1).toUpperCase()})}}(),buildStyleHtml:function(c){c=[].concat(c);for(var b,a=[],
|
|
26
|
-
"\x26quot;")},htmlDecodeAttr:function(c){return CKEDITOR.tools.htmlDecode(c)},transformPlainTextToHtml:function(c,b){var a=b==CKEDITOR.ENTER_BR,
|
|
27
|
-
2)}));
|
|
28
|
-
d);return d.setTimeout(function(){
|
|
29
|
-
a=0;for(
|
|
30
|
-
c[b]="function"==typeof a?CKEDITOR.tools.bind(a,this):a}f.apply(this,arguments)};a&&(b.prototype=this.prototypedCopy(a.prototype),b.prototype.constructor=b,b.base=a,b.baseProto=a.prototype,b.prototype.base=function
|
|
31
|
-
|
|
32
|
-
a&&(b=b.replace("-",""));c.setStyle("width",b);b=c.$.clientWidth;return a?-b:b}return b}}(),repeat:function(c,b){return Array(b+1).join(c)},tryThese:function(){for(var c,b=0,a=arguments.length;b<a;b++){var
|
|
33
|
-
!0,b);for(
|
|
34
|
-
b,a){var
|
|
35
|
-
objectCompare:function(c,b,a){var
|
|
36
|
-
c}return!!c},eventsBuffer:function(c,b,a){return new this.buffers.event(c,b,a)},enableHtml5Elements:function(c,b){for(var a="abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video".split(" "),
|
|
37
|
-
b){for(var a in c)if(a.match(b))return!0;return!1},keystrokeToString:function(c,b){var a=this.keystrokeToArray(c,b);a.display=a.display.join("+");a.aria=a.aria.join("+");return a},keystrokeToArray:function(c,b){var a=b&16711680,
|
|
38
|
-
e.push(String.fromCharCode(
|
|
39
|
-
";path\x3d/"},getCsrfToken:function(){var c=CKEDITOR.tools.getCookie("ckCsrfToken");if(!c||40!=c.length){var c=[],b="";if(window.crypto&&window.crypto.getRandomValues)c=new Uint8Array(40),window.crypto.getRandomValues(c);else for(var a=0;40>a;a++)c.push(Math.floor(256*Math.random()));for(a=0;a<c.length;a++)var
|
|
40
|
-
CSS.escape?CSS.escape(c):isNaN(parseInt(c.charAt(0),10))?c:"\\3"+c.charAt(0)+" "+c.substring(1,c.length):""},getMouseButton:function(c){return(c=c&&c.data?c.data.$:c)?CKEDITOR.tools.normalizeMouseButton(c.button):!1},normalizeMouseButton:function(c,b){if(!CKEDITOR.env.ie||9<=CKEDITOR.env.version&&!CKEDITOR.env.ie6Compat)return c;for(var a=[[CKEDITOR.MOUSE_BUTTON_LEFT,1],[CKEDITOR.MOUSE_BUTTON_MIDDLE,4],[CKEDITOR.MOUSE_BUTTON_RIGHT,2]],
|
|
41
|
-
d[1]===c)return d[0]}},convertHexStringToBytes:function(c){var b=[],a=c.length/2,
|
|
25
|
+
function(c){return c.substr(1).toUpperCase()})}}(),buildStyleHtml:function(c){c=[].concat(c);for(var b,a=[],h=0;h<c.length;h++)if(b=c[h])/@import|[{}]/.test(b)?a.push("\x3cstyle\x3e"+b+"\x3c/style\x3e"):a.push('\x3clink type\x3d"text/css" rel\x3dstylesheet href\x3d"'+b+'"\x3e');return a.join("")},htmlEncode:function(c){return void 0===c||null===c?"":String(c).replace(e,"\x26amp;").replace(m,"\x26gt;").replace(k,"\x26lt;")},htmlDecode:function(n){return n.replace(b,c)},htmlEncodeAttr:function(c){return CKEDITOR.tools.htmlEncode(c).replace(h,
|
|
26
|
+
"\x26quot;")},htmlDecodeAttr:function(c){return CKEDITOR.tools.htmlDecode(c)},transformPlainTextToHtml:function(c,b){var a=b==CKEDITOR.ENTER_BR,h=this.htmlEncode(c.replace(/\r\n/g,"\n")),h=h.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;"),d=b==CKEDITOR.ENTER_P?"p":"div";if(!a){var f=/\n{2}/g;if(f.test(h))var e="\x3c"+d+"\x3e",k="\x3c/"+d+"\x3e",h=e+h.replace(f,function(){return k+e})+k}h=h.replace(/\n/g,"\x3cbr\x3e");a||(h=h.replace(new RegExp("\x3cbr\x3e(?\x3d\x3c/"+d+"\x3e)"),function(c){return CKEDITOR.tools.repeat(c,
|
|
27
|
+
2)}));h=h.replace(/^ | $/g,"\x26nbsp;");return h=h.replace(/(>|\s) /g,function(c,b){return b+"\x26nbsp;"}).replace(/ (?=<)/g,"\x26nbsp;")},getNextNumber:function(){var c=0;return function(){return++c}}(),getNextId:function(){return"cke_"+this.getNextNumber()},getUniqueId:function(){for(var c="e",b=0;8>b;b++)c+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return c},override:function(c,b){var a=b(c);a.prototype=c.prototype;return a},setTimeout:function(c,b,a,h,d){d||(d=window);a||(a=
|
|
28
|
+
d);return d.setTimeout(function(){h?c.apply(a,[].concat(h)):c.apply(a)},b||0)},throttle:function(c,b,a){return new this.buffers.throttle(c,b,a)},trim:function(){var c=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(b){return b.replace(c,"")}}(),ltrim:function(){var c=/^[ \t\n\r]+/g;return function(b){return b.replace(c,"")}}(),rtrim:function(){var c=/[ \t\n\r]+$/g;return function(b){return b.replace(c,"")}}(),indexOf:function(c,b){if("function"==typeof b)for(var a=0,h=c.length;a<h;a++){if(b(c[a]))return a}else{if(c.indexOf)return c.indexOf(b);
|
|
29
|
+
a=0;for(h=c.length;a<h;a++)if(c[a]===b)return a}return-1},search:function(c,b){var a=CKEDITOR.tools.indexOf(c,b);return 0<=a?c[a]:null},bind:function(c,b){var a=Array.prototype.slice.call(arguments,2);return function(){return c.apply(b,a.concat(Array.prototype.slice.call(arguments)))}},createClass:function(c){var b=c.$,a=c.base,h=c.privates||c._,d=c.proto;c=c.statics;!b&&(b=function(){a&&this.base.apply(this,arguments)});if(h)var f=b,b=function(){var c=this._||(this._={}),b;for(b in h){var a=h[b];
|
|
30
|
+
c[b]="function"==typeof a?CKEDITOR.tools.bind(a,this):a}f.apply(this,arguments)};a&&(b.prototype=this.prototypedCopy(a.prototype),b.prototype.constructor=b,b.base=a,b.baseProto=a.prototype,b.prototype.base=function x(){this.base=a.prototype.base;a.apply(this,arguments);this.base=x});d&&this.extend(b.prototype,d,!0);c&&this.extend(b,c,!0);return b},addFunction:function(c,b){return g.push(function(){return c.apply(b||this,arguments)})-1},removeFunction:function(c){g[c]=null},callFunction:function(c){var b=
|
|
31
|
+
g[c];return b&&b.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var c=/^-?\d+\.?\d*px$/,b;return function(a){b=CKEDITOR.tools.trim(a+"")+"px";return c.test(b)?b:a||""}}(),convertToPx:function(){var c;return function(b){c||(c=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(c));if(!/%$/.test(b)){var a=0>parseFloat(b);
|
|
32
|
+
a&&(b=b.replace("-",""));c.setStyle("width",b);b=c.$.clientWidth;return a?-b:b}return b}}(),repeat:function(c,b){return Array(b+1).join(c)},tryThese:function(){for(var c,b=0,a=arguments.length;b<a;b++){var h=arguments[b];try{c=h();break}catch(d){}}return c},genKey:function(){return Array.prototype.slice.call(arguments).join("-")},defer:function(c){return function(){var b=arguments,a=this;window.setTimeout(function(){c.apply(a,b)},0)}},normalizeCssText:function(c,b){var a=[],h,d=CKEDITOR.tools.parseCssText(c,
|
|
33
|
+
!0,b);for(h in d)a.push(h+":"+d[h]);a.sort();return a.length?a.join(";")+";":""},convertRgbToHex:function(c){return c.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,function(c,b,a,h){c=[b,a,h];for(b=0;3>b;b++)c[b]=("0"+parseInt(c[b],10).toString(16)).slice(-2);return"#"+c.join("")})},normalizeHex:function(c){return c.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi,function(c,b,a,h){c=b.toLowerCase();3==c.length&&(c=c.split(""),c=[c[0],c[0],c[1],c[1],c[2],c[2]].join(""));return"#"+c+h})},parseCssText:function(c,
|
|
34
|
+
b,a){var h={};a&&(c=(new CKEDITOR.dom.element("span")).setAttribute("style",c).getAttribute("style")||"");c&&(c=CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(c)));if(!c||";"==c)return h;c.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(c,a,d){b&&(a=a.toLowerCase(),"font-family"==a&&(d=d.replace(/\s*,\s*/g,",")),d=CKEDITOR.tools.trim(d));h[a]=d});return h},writeCssText:function(c,b){var a,h=[];for(a in c)h.push(a+":"+c[a]);b&&h.sort();return h.join("; ")},
|
|
35
|
+
objectCompare:function(c,b,a){var h;if(!c&&!b)return!0;if(!c||!b)return!1;for(h in c)if(c[h]!=b[h])return!1;if(!a)for(h in b)if(c[h]!=b[h])return!1;return!0},objectKeys:function(c){return CKEDITOR.tools.object.keys(c)},convertArrayToObject:function(c,b){var a={};1==arguments.length&&(b=!0);for(var h=0,d=c.length;h<d;++h)a[c[h]]=b;return a},fixDomain:function(){for(var c;;)try{c=window.parent.document.domain;break}catch(b){c=c?c.replace(/.+?(?:\.|$)/,""):document.domain;if(!c)break;document.domain=
|
|
36
|
+
c}return!!c},eventsBuffer:function(c,b,a){return new this.buffers.event(c,b,a)},enableHtml5Elements:function(c,b){for(var a="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(" "),h=a.length,d;h--;)d=c.createElement(a[h]),b&&c.appendChild(d)},checkIfAnyArrayItemMatches:function(c,b){for(var a=0,h=c.length;a<h;++a)if(c[a].match(b))return!0;return!1},checkIfAnyObjectPropertyMatches:function(c,
|
|
37
|
+
b){for(var a in c)if(a.match(b))return!0;return!1},keystrokeToString:function(c,b){var a=this.keystrokeToArray(c,b);a.display=a.display.join("+");a.aria=a.aria.join("+");return a},keystrokeToArray:function(c,b){var a=b&16711680,h=b&65535,d=CKEDITOR.env.mac,f=[],e=[];a&CKEDITOR.CTRL&&(f.push(d?"⌘":c[17]),e.push(d?c[224]:c[17]));a&CKEDITOR.ALT&&(f.push(d?"⌥":c[18]),e.push(c[18]));a&CKEDITOR.SHIFT&&(f.push(d?"⇧":c[16]),e.push(c[16]));h&&(c[h]?(f.push(c[h]),e.push(c[h])):(f.push(String.fromCharCode(h)),
|
|
38
|
+
e.push(String.fromCharCode(h))));return{display:f,aria:e}},transparentImageData:"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw\x3d\x3d",getCookie:function(c){c=c.toLowerCase();for(var b=document.cookie.split(";"),a,h,d=0;d<b.length;d++)if(a=b[d].split("\x3d"),h=decodeURIComponent(CKEDITOR.tools.trim(a[0]).toLowerCase()),h===c)return decodeURIComponent(1<a.length?a[1]:"");return null},setCookie:function(c,b){document.cookie=encodeURIComponent(c)+"\x3d"+encodeURIComponent(b)+
|
|
39
|
+
";path\x3d/"},getCsrfToken:function(){var c=CKEDITOR.tools.getCookie("ckCsrfToken");if(!c||40!=c.length){var c=[],b="";if(window.crypto&&window.crypto.getRandomValues)c=new Uint8Array(40),window.crypto.getRandomValues(c);else for(var a=0;40>a;a++)c.push(Math.floor(256*Math.random()));for(a=0;a<c.length;a++)var h="abcdefghijklmnopqrstuvwxyz0123456789".charAt(c[a]%36),b=b+(.5<Math.random()?h.toUpperCase():h);c=b;CKEDITOR.tools.setCookie("ckCsrfToken",c)}return c},escapeCss:function(c){return c?window.CSS&&
|
|
40
|
+
CSS.escape?CSS.escape(c):isNaN(parseInt(c.charAt(0),10))?c:"\\3"+c.charAt(0)+" "+c.substring(1,c.length):""},getMouseButton:function(c){return(c=c&&c.data?c.data.$:c)?CKEDITOR.tools.normalizeMouseButton(c.button):!1},normalizeMouseButton:function(c,b){if(!CKEDITOR.env.ie||9<=CKEDITOR.env.version&&!CKEDITOR.env.ie6Compat)return c;for(var a=[[CKEDITOR.MOUSE_BUTTON_LEFT,1],[CKEDITOR.MOUSE_BUTTON_MIDDLE,4],[CKEDITOR.MOUSE_BUTTON_RIGHT,2]],h=0;h<a.length;h++){var d=a[h];if(d[0]===c&&b)return d[1];if(!b&&
|
|
41
|
+
d[1]===c)return d[0]}},convertHexStringToBytes:function(c){var b=[],a=c.length/2,h;for(h=0;h<a;h++)b.push(parseInt(c.substr(2*h,2),16));return b},convertBytesToBase64:function(c){var b="",a=c.length,h;for(h=0;h<a;h+=3){var d=c.slice(h,h+3),f=d.length,e=[],k;if(3>f)for(k=f;3>k;k++)d[k]=0;e[0]=(d[0]&252)>>2;e[1]=(d[0]&3)<<4|d[1]>>4;e[2]=(d[1]&15)<<2|(d[2]&192)>>6;e[3]=d[2]&63;for(k=0;4>k;k++)b=k<=f?b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e[k]):b+"\x3d"}return b},
|
|
42
42
|
style:{parse:{_colors:{aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",
|
|
43
43
|
darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",
|
|
44
44
|
ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",
|
|
@@ -46,61 +46,61 @@ lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightsla
|
|
|
46
46
|
moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",
|
|
47
47
|
seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",windowtext:"windowtext",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},_borderStyle:"none hidden dotted dashed solid double groove ridge inset outset".split(" "),
|
|
48
48
|
_widthRegExp:/^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/,_rgbaRegExp:/rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,_hslaRegExp:/hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,background:function(c){var b={},a=this._findColor(c);a.length&&(b.color=a[0],CKEDITOR.tools.array.forEach(a,function(b){c=c.replace(b,"")}));if(c=CKEDITOR.tools.trim(c))b.unprocessed=c;return b},margin:function(c){return CKEDITOR.tools.style.parse.sideShorthand(c,
|
|
49
|
-
function(c){return c.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset|revert)/g)||["0px"]})},sideShorthand:function(c,b){function a(c){
|
|
50
|
-
[]),b=b.concat(c.match(this._hslaRegExp)||[]);return b=b.concat(a.filter(c.split(/\s+/),function(c){return c.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi)?!0:c.toLowerCase()in CKEDITOR.tools.style.parse._colors}))}}},array:{filter:function(c,b,a){var
|
|
51
|
-
b,a){for(var
|
|
52
|
-
function(b){return[b,c[b]]})},values:function(c){return CKEDITOR.tools.array.map(CKEDITOR.tools.object.keys(c),function(b){return c[b]})},keys:function(c){var b=Object.prototype.hasOwnProperty,a=[],
|
|
53
|
-
return a},findKey:function(c,b){if("object"!==typeof c)return null;for(var a in c)if(c[a]===b)return a;return null},merge:function(c,b){var a=CKEDITOR.tools,
|
|
54
|
-
var
|
|
49
|
+
function(c){return c.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset|revert)/g)||["0px"]})},sideShorthand:function(c,b){function a(c){h.top=d[c[0]];h.right=d[c[1]];h.bottom=d[c[2]];h.left=d[c[3]]}var h={},d=b?b(c):c.split(/\s+/);switch(d.length){case 1:a([0,0,0,0]);break;case 2:a([0,1,0,1]);break;case 3:a([0,1,2,1]);break;case 4:a([0,1,2,3])}return h},border:function(c){return CKEDITOR.tools.style.border.fromCssRule(c)},_findColor:function(c){var b=[],a=CKEDITOR.tools.array,b=b.concat(c.match(this._rgbaRegExp)||
|
|
50
|
+
[]),b=b.concat(c.match(this._hslaRegExp)||[]);return b=b.concat(a.filter(c.split(/\s+/),function(c){return c.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi)?!0:c.toLowerCase()in CKEDITOR.tools.style.parse._colors}))}}},array:{filter:function(c,b,a){var h=[];this.forEach(c,function(d,f){b.call(a,d,f,c)&&h.push(d)});return h},find:function(c,b,a){for(var h=c.length,d=0;d<h;){if(b.call(a,c[d],d,c))return c[d];d++}},forEach:function(c,b,a){var h=c.length,d;for(d=0;d<h;d++)b.call(a,c[d],d,c)},map:function(c,
|
|
51
|
+
b,a){for(var h=[],d=0;d<c.length;d++)h.push(b.call(a,c[d],d,c));return h},reduce:function(c,b,a,h){for(var d=0;d<c.length;d++)a=b.call(h,a,c[d],d,c);return a},every:function(c,b,a){if(!c.length)return!0;b=this.filter(c,b,a);return c.length===b.length},some:function(c,b,a){for(var h=0;h<c.length;h++)if(b.call(a,c[h],h,c))return!0;return!1}},object:{DONT_ENUMS:"toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor".split(" "),entries:function(c){return CKEDITOR.tools.array.map(CKEDITOR.tools.object.keys(c),
|
|
52
|
+
function(b){return[b,c[b]]})},values:function(c){return CKEDITOR.tools.array.map(CKEDITOR.tools.object.keys(c),function(b){return c[b]})},keys:function(c){var b=Object.prototype.hasOwnProperty,a=[],h=CKEDITOR.tools.object.DONT_ENUMS;if(CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(!c||"object"!==typeof c)){b=[];if("string"===typeof c)for(a=0;a<c.length;a++)b.push(String(a));return b}for(var d in c)a.push(d);if(CKEDITOR.env.ie&&9>CKEDITOR.env.version)for(d=0;d<h.length;d++)b.call(c,h[d])&&a.push(h[d]);
|
|
53
|
+
return a},findKey:function(c,b){if("object"!==typeof c)return null;for(var a in c)if(c[a]===b)return a;return null},merge:function(c,b){var a=CKEDITOR.tools,h=a.clone(c),d=a.clone(b);a.array.forEach(a.object.keys(d),function(c){h[c]="object"===typeof d[c]&&"object"===typeof h[c]?a.object.merge(h[c],d[c]):d[c]});return h}},getAbsoluteRectPosition:function(c,b){function a(c){if(c){var b=c.getClientRect();h.top+=b.top;h.left+=b.left;"x"in h&&"y"in h&&(h.x+=b.x,h.y+=b.y);a(c.getWindow().getFrame())}}
|
|
54
|
+
var h=CKEDITOR.tools.copy(b);a(c.getFrame());var d=CKEDITOR.document.getWindow().getScrollPosition();h.top+=d.y;h.left+=d.x;"x"in h&&"y"in h&&(h.y+=d.y,h.x+=d.x);h.right=h.left+h.width;h.bottom=h.top+h.height;return h}};a.prototype={reset:function(){this._lastOutput=0;this._clearTimer()},_reschedule:function(){return!1},_call:function(){this._output()},_clearTimer:function(){this._scheduledTimer&&clearTimeout(this._scheduledTimer);this._scheduledTimer=0}};l.prototype=CKEDITOR.tools.prototypedCopy(a.prototype);
|
|
55
55
|
l.prototype._reschedule=function(){this._scheduledTimer&&this._clearTimer()};l.prototype._call=function(){this._output.apply(this._context,this._args)};CKEDITOR.tools.buffers={};CKEDITOR.tools.buffers.event=a;CKEDITOR.tools.buffers.throttle=l;CKEDITOR.tools.style.border=CKEDITOR.tools.createClass({$:function(c){c=c||{};this.width=c.width;this.style=c.style;this.color=c.color;this._.normalize()},_:{normalizeMap:{color:[[/windowtext/g,"black"]]},normalize:function(){for(var c in this._.normalizeMap){var b=
|
|
56
56
|
this[c];b&&(this[c]=CKEDITOR.tools.array.reduce(this._.normalizeMap[c],function(c,b){return c.replace(b[0],b[1])},b))}}},proto:{toString:function(){return CKEDITOR.tools.array.filter([this.width,this.style,this.color],function(c){return!!c}).join(" ")}},statics:{fromCssRule:function(c){var b={},a=c.split(/\s+/g);c=CKEDITOR.tools.style.parse._findColor(c);c.length&&(b.color=c[0]);CKEDITOR.tools.array.forEach(a,function(c){b.style||-1===CKEDITOR.tools.indexOf(CKEDITOR.tools.style.parse._borderStyle,
|
|
57
|
-
c)?!b.width&&CKEDITOR.tools.style.parse._widthRegExp.test(c)&&(b.width=c):b.style=c});return new CKEDITOR.tools.style.border(b)},splitCssValues:function(c,b){b=b||{};var a=CKEDITOR.tools.array.reduce(["width","style","color"],function(a,
|
|
58
|
-
|
|
59
|
-
dl:1,fieldset:1,figure:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,hr:1,main:1,menu:1,nav:1,ol:1,p:1,pre:1,section:1,table:1,ul:1},m={command:1,link:1,meta:1,noscript:1,script:1,style:1},k={},
|
|
60
|
-
q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,"var":1,video:1,wbr:1},
|
|
61
|
-
f),dfn:
|
|
62
|
-
option:
|
|
63
|
-
f),basefont:k,big:
|
|
64
|
-
footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,main:1,nav:1,p:1,pre:1,section:1},$empty:{area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1},$inline:
|
|
57
|
+
c)?!b.width&&CKEDITOR.tools.style.parse._widthRegExp.test(c)&&(b.width=c):b.style=c});return new CKEDITOR.tools.style.border(b)},splitCssValues:function(c,b){b=b||{};var a=CKEDITOR.tools.array.reduce(["width","style","color"],function(a,h){var d=c["border-"+h]||b[h];a[h]=d?CKEDITOR.tools.style.parse.sideShorthand(d):null;return a},{});return CKEDITOR.tools.array.reduce(["top","right","bottom","left"],function(b,h){var d={},f;for(f in a){var e=c["border-"+h+"-"+f];d[f]=e?e:a[f]&&a[f][h]}b["border-"+
|
|
58
|
+
h]=new CKEDITOR.tools.style.border(d);return b},{})}}});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(b,c){for(var a=CKEDITOR.tools.clone(b),h=1;h<arguments.length;h++){c=arguments[h];for(var f in c)delete a[f]}return a},g={},f={},e={address:1,article:1,aside:1,blockquote:1,details:1,div:1,
|
|
59
|
+
dl:1,fieldset:1,figure:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,hr:1,main:1,menu:1,nav:1,ol:1,p:1,pre:1,section:1,table:1,ul:1},m={command:1,link:1,meta:1,noscript:1,script:1,style:1},k={},h={"#":1},b={center:1,dir:1,noframes:1};a(g,{a:1,abbr:1,area:1,audio:1,b:1,bdi:1,bdo:1,br:1,button:1,canvas:1,cite:1,code:1,command:1,datalist:1,del:1,dfn:1,em:1,embed:1,i:1,iframe:1,img:1,input:1,ins:1,kbd:1,keygen:1,label:1,map:1,mark:1,meter:1,noscript:1,object:1,output:1,progress:1,
|
|
60
|
+
q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,"var":1,video:1,wbr:1},h,{acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1});a(f,e,g,b);l={a:l(g,{a:1,button:1}),abbr:g,address:f,area:k,article:f,aside:f,audio:a({source:1,track:1},f),b:g,base:k,bdi:g,bdo:g,blockquote:f,body:f,br:k,button:l(g,{a:1,button:1}),canvas:g,caption:f,cite:g,code:g,col:k,colgroup:{col:1},command:k,datalist:a({option:1},g),dd:f,del:g,details:a({summary:1},
|
|
61
|
+
f),dfn:g,div:f,dl:{dt:1,dd:1},dt:f,em:g,embed:k,fieldset:a({legend:1},f),figcaption:f,figure:a({figcaption:1},f),footer:f,form:f,h1:g,h2:g,h3:g,h4:g,h5:g,h6:g,head:a({title:1,base:1},m),header:f,hgroup:{h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},hr:k,html:a({head:1,body:1},f,m),i:g,iframe:h,img:k,input:k,ins:g,kbd:g,keygen:k,label:g,legend:g,li:f,link:k,main:f,map:f,mark:g,menu:a({li:1},f),meta:k,meter:l(g,{meter:1}),nav:f,noscript:a({link:1,meta:1,style:1},g),object:a({param:1},g),ol:{li:1},optgroup:{option:1},
|
|
62
|
+
option:h,output:g,p:g,param:k,pre:g,progress:l(g,{progress:1}),q:g,rp:g,rt:g,ruby:a({rp:1,rt:1},g),s:g,samp:g,script:h,section:f,select:{optgroup:1,option:1},small:g,source:k,span:g,strong:g,style:h,sub:g,summary:a({h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},g),sup:g,table:{caption:1,colgroup:1,thead:1,tfoot:1,tbody:1,tr:1},tbody:{tr:1},td:f,textarea:h,tfoot:{tr:1},th:f,thead:{tr:1},time:l(g,{time:1}),title:h,tr:{th:1,td:1},track:k,u:g,ul:{li:1},"var":g,video:a({source:1,track:1},f),wbr:k,acronym:g,applet:a({param:1},
|
|
63
|
+
f),basefont:k,big:g,center:f,dialog:k,dir:{li:1},font:g,isindex:k,noframes:f,strike:g,tt:g};a(l,{$block:a({audio:1,dd:1,dt:1,figcaption:1,li:1,video:1},e,b),$blockLimit:{article:1,aside:1,audio:1,body:1,caption:1,details:1,dir:1,div:1,dl:1,fieldset:1,figcaption:1,figure:1,footer:1,form:1,header:1,hgroup:1,main:1,menu:1,nav:1,ol:1,section:1,table:1,td:1,th:1,tr:1,ul:1,video:1},$cdata:{script:1,style:1},$editable:{address:1,article:1,aside:1,blockquote:1,body:1,details:1,div:1,fieldset:1,figcaption:1,
|
|
64
|
+
footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,main:1,nav:1,p:1,pre:1,section:1},$empty:{area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1},$inline:g,$list:{dl:1,ol:1,ul:1},$listItem:{dd:1,dt:1,li:1},$nonBodyContent:a({body:1,head:1,html:1},l.head),$nonEditable:{applet:1,audio:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,param:1,script:1,textarea:1,video:1},$object:{applet:1,audio:1,
|
|
65
65
|
button:1,hr:1,iframe:1,img:1,input:1,object:1,select:1,table:1,textarea:1,video:1},$removeEmpty:{abbr:1,acronym:1,b:1,bdi:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,mark:1,meter:1,output:1,q:1,ruby:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,"var":1},$tabIndex:{a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},$tableContent:{caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},$transparent:{a:1,audio:1,canvas:1,del:1,
|
|
66
66
|
ins:1,map:1,noscript:1,object:1,video:1},$intermediate:{caption:1,colgroup:1,dd:1,dt:1,figcaption:1,legend:1,li:1,optgroup:1,option:1,rp:1,rt:1,summary:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1}});return l}();CKEDITOR.dom.event=function(a){this.$=a};CKEDITOR.dom.event.prototype={getKey:function(){return this.$.keyCode||this.$.which},getKeystroke:function(){var a=this.getKey();if(this.$.ctrlKey||this.$.metaKey)a+=CKEDITOR.CTRL;this.$.shiftKey&&(a+=CKEDITOR.SHIFT);this.$.altKey&&(a+=CKEDITOR.ALT);return a},
|
|
67
67
|
preventDefault:function(a){var l=this.$;l.preventDefault?l.preventDefault():l.returnValue=!1;a&&this.stopPropagation()},stopPropagation:function(){var a=this.$;a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},getTarget:function(){var a=this.$.target||this.$.srcElement;return a?new CKEDITOR.dom.node(a):null},getPhase:function(){return this.$.eventPhase||2},getPageOffset:function(){var a=this.getTarget().getDocument().$;return{x:this.$.pageX||this.$.clientX+(a.documentElement.scrollLeft||a.body.scrollLeft),
|
|
68
|
-
y:this.$.pageY||this.$.clientY+(a.documentElement.scrollTop||a.body.scrollTop)}}};CKEDITOR.CTRL=1114112;CKEDITOR.SHIFT=2228224;CKEDITOR.ALT=4456448;CKEDITOR.EVENT_PHASE_CAPTURING=1;CKEDITOR.EVENT_PHASE_AT_TARGET=2;CKEDITOR.EVENT_PHASE_BUBBLING=3;CKEDITOR.dom.domObject=function(a){a&&(this.$=a)};CKEDITOR.dom.domObject.prototype=function(){var a=function(a,
|
|
69
|
-
this.setCustomData("_",a={});return a},on:function(l){var
|
|
70
|
-
f=
|
|
68
|
+
y:this.$.pageY||this.$.clientY+(a.documentElement.scrollTop||a.body.scrollTop)}}};CKEDITOR.CTRL=1114112;CKEDITOR.SHIFT=2228224;CKEDITOR.ALT=4456448;CKEDITOR.EVENT_PHASE_CAPTURING=1;CKEDITOR.EVENT_PHASE_AT_TARGET=2;CKEDITOR.EVENT_PHASE_BUBBLING=3;CKEDITOR.dom.domObject=function(a){a&&(this.$=a)};CKEDITOR.dom.domObject.prototype=function(){var a=function(a,g){return function(f){"undefined"!=typeof CKEDITOR&&a.fire(g,new CKEDITOR.dom.event(f))}};return{getPrivate:function(){var a;(a=this.getCustomData("_"))||
|
|
69
|
+
this.setCustomData("_",a={});return a},on:function(l){var g=this.getCustomData("_cke_nativeListeners");g||(g={},this.setCustomData("_cke_nativeListeners",g));g[l]||(g=g[l]=a(this,l),this.$.addEventListener?this.$.addEventListener(l,g,!!CKEDITOR.event.useCapture):this.$.attachEvent&&this.$.attachEvent("on"+l,g));return CKEDITOR.event.prototype.on.apply(this,arguments)},removeListener:function(a){CKEDITOR.event.prototype.removeListener.apply(this,arguments);if(!this.hasListeners(a)){var g=this.getCustomData("_cke_nativeListeners"),
|
|
70
|
+
f=g&&g[a];f&&(this.$.removeEventListener?this.$.removeEventListener(a,f,!1):this.$.detachEvent&&this.$.detachEvent("on"+a,f),delete g[a])}},removeAllListeners:function(){try{var a=this.getCustomData("_cke_nativeListeners"),g;for(g in a){var f=a[g];this.$.detachEvent?this.$.detachEvent("on"+g,f):this.$.removeEventListener&&this.$.removeEventListener(g,f,!1);delete a[g]}}catch(e){if(!CKEDITOR.env.edge||-2146828218!==e.number)throw e;}CKEDITOR.event.prototype.removeAllListeners.call(this)}}}();(function(a){var l=
|
|
71
71
|
{};CKEDITOR.on("reset",function(){l={}});a.equals=function(a){try{return a&&a.$===this.$}catch(f){return!1}};a.setCustomData=function(a,f){var e=this.getUniqueId();(l[e]||(l[e]={}))[a]=f;return this};a.getCustomData=function(a){var f=this.$["data-cke-expando"];return(f=f&&l[f])&&a in f?f[a]:null};a.removeCustomData=function(a){var f=this.$["data-cke-expando"],f=f&&l[f],e,m;f&&(e=f[a],m=a in f,delete f[a]);return m?e:null};a.clearCustomData=function(){this.removeAllListeners();var a=this.getUniqueId();
|
|
72
72
|
a&&delete l[a]};a.getUniqueId=function(){return this.$["data-cke-expando"]||(this.$["data-cke-expando"]=CKEDITOR.tools.getNextNumber())};CKEDITOR.event.implementOn(a)})(CKEDITOR.dom.domObject.prototype);CKEDITOR.dom.node=function(a){return a?new CKEDITOR.dom[a.nodeType==CKEDITOR.NODE_DOCUMENT?"document":a.nodeType==CKEDITOR.NODE_ELEMENT?"element":a.nodeType==CKEDITOR.NODE_TEXT?"text":a.nodeType==CKEDITOR.NODE_COMMENT?"comment":a.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT?"documentFragment":"domObject"](a):
|
|
73
|
-
this};CKEDITOR.dom.node.prototype=new CKEDITOR.dom.domObject;CKEDITOR.NODE_ELEMENT=1;CKEDITOR.NODE_DOCUMENT=9;CKEDITOR.NODE_TEXT=3;CKEDITOR.NODE_COMMENT=8;CKEDITOR.NODE_DOCUMENT_FRAGMENT=11;CKEDITOR.POSITION_IDENTICAL=0;CKEDITOR.POSITION_DISCONNECTED=1;CKEDITOR.POSITION_FOLLOWING=2;CKEDITOR.POSITION_PRECEDING=4;CKEDITOR.POSITION_IS_CONTAINED=8;CKEDITOR.POSITION_CONTAINS=16;CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype,{appendTo:function(a,l){a.append(this,l);return a},clone:function(a,l){function
|
|
74
|
-
(f["data-cke-expando"]=!1);if(f.nodeType==CKEDITOR.NODE_ELEMENT||f.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)if(l||f.nodeType!=CKEDITOR.NODE_ELEMENT||f.removeAttribute("id",!1),a){f=f.childNodes;for(var e=0;e<f.length;e++)
|
|
75
|
-
|
|
76
|
-
return a},getAddress:function(a){for(var l=[],
|
|
77
|
-
!l(
|
|
78
|
-
l!=a.type?a.getNextSourceNode(!1,l,
|
|
79
|
-
10!=l.nodeType&&new CKEDITOR.dom.node(l);while(
|
|
80
|
-
if(a.contains&&a.contains(this))return a;var l=this.contains?this:this.getParent();do if(l.contains(a))return l;while(l=l.getParent());return null},getPosition:function(a){var l=this.$,
|
|
81
|
-
CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in l)return 0>l.sourceIndex||0>
|
|
82
|
-
getAscendant:function(a,l){var
|
|
83
|
-
l)},remove:function(a){var l=this.$,
|
|
84
|
-
rtrim:function(){for(var a;this.getLast&&(a=this.getLast());){if(a.type==CKEDITOR.NODE_TEXT){var l=CKEDITOR.tools.rtrim(a.getText()),
|
|
73
|
+
this};CKEDITOR.dom.node.prototype=new CKEDITOR.dom.domObject;CKEDITOR.NODE_ELEMENT=1;CKEDITOR.NODE_DOCUMENT=9;CKEDITOR.NODE_TEXT=3;CKEDITOR.NODE_COMMENT=8;CKEDITOR.NODE_DOCUMENT_FRAGMENT=11;CKEDITOR.POSITION_IDENTICAL=0;CKEDITOR.POSITION_DISCONNECTED=1;CKEDITOR.POSITION_FOLLOWING=2;CKEDITOR.POSITION_PRECEDING=4;CKEDITOR.POSITION_IS_CONTAINED=8;CKEDITOR.POSITION_CONTAINS=16;CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype,{appendTo:function(a,l){a.append(this,l);return a},clone:function(a,l){function g(f){f["data-cke-expando"]&&
|
|
74
|
+
(f["data-cke-expando"]=!1);if(f.nodeType==CKEDITOR.NODE_ELEMENT||f.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)if(l||f.nodeType!=CKEDITOR.NODE_ELEMENT||f.removeAttribute("id",!1),a){f=f.childNodes;for(var e=0;e<f.length;e++)g(f[e])}}function f(e){if(e.type==CKEDITOR.NODE_ELEMENT||e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT){if(e.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var k=e.getName();":"==k[0]&&e.renameNode(k.substring(1))}if(a)for(k=0;k<e.getChildCount();k++)f(e.getChild(k))}}var e=this.$.cloneNode(a);
|
|
75
|
+
g(e);e=new CKEDITOR.dom.node(e);CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(this.type==CKEDITOR.NODE_ELEMENT||this.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)&&f(e);return e},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(a){a.$.parentNode.insertBefore(this.$,a.$.nextSibling);return a},insertBefore:function(a){a.$.parentNode.insertBefore(this.$,a.$);return a},insertBeforeMe:function(a){this.$.parentNode.insertBefore(a.$,this.$);
|
|
76
|
+
return a},getAddress:function(a){for(var l=[],g=this.getDocument().$.documentElement,f=this;f&&f!=g;){var e=f.getParent();e&&l.unshift(this.getIndex.call(f,a));f=e}return l},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(a){function l(a,f){var h=f?a.getNext():a.getPrevious();return h&&h.type==CKEDITOR.NODE_TEXT?h.isEmpty()?l(h,f):h:null}var g=this,f=-1,e;if(!this.getParent()||a&&g.type==CKEDITOR.NODE_TEXT&&g.isEmpty()&&
|
|
77
|
+
!l(g)&&!l(g,!0))return-1;do if(!a||g.equals(this)||g.type!=CKEDITOR.NODE_TEXT||!e&&!g.isEmpty())f++,e=g.type==CKEDITOR.NODE_TEXT;while(g=g.getPrevious());return f},getNextSourceNode:function(a,l,g){if(g&&!g.call){var f=g;g=function(a){return!a.equals(f)}}a=!a&&this.getFirst&&this.getFirst();var e;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&g&&!1===g(this,!0))return null;a=this.getNext()}for(;!a&&(e=(e||this).getParent());){if(g&&!1===g(e,!0))return null;a=e.getNext()}return!a||g&&!1===g(a)?null:l&&
|
|
78
|
+
l!=a.type?a.getNextSourceNode(!1,l,g):a},getPreviousSourceNode:function(a,l,g){if(g&&!g.call){var f=g;g=function(a){return!a.equals(f)}}a=!a&&this.getLast&&this.getLast();var e;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&g&&!1===g(this,!0))return null;a=this.getPrevious()}for(;!a&&(e=(e||this).getParent());){if(g&&!1===g(e,!0))return null;a=e.getPrevious()}return!a||g&&!1===g(a)?null:l&&a.type!=l?a.getPreviousSourceNode(!1,l,g):a},getPrevious:function(a){var l=this.$,g;do g=(l=l.previousSibling)&&
|
|
79
|
+
10!=l.nodeType&&new CKEDITOR.dom.node(l);while(g&&a&&!a(g));return g},getNext:function(a){var l=this.$,g;do g=(l=l.nextSibling)&&new CKEDITOR.dom.node(l);while(g&&a&&!a(g));return g},getParent:function(a){var l=this.$.parentNode;return l&&(l.nodeType==CKEDITOR.NODE_ELEMENT||a&&l.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(l):null},getParents:function(a){var l=this,g=[];do g[a?"push":"unshift"](l);while(l=l.getParent());return g},getCommonAncestor:function(a){if(a.equals(this))return this;
|
|
80
|
+
if(a.contains&&a.contains(this))return a;var l=this.contains?this:this.getParent();do if(l.contains(a))return l;while(l=l.getParent());return null},getPosition:function(a){var l=this.$,g=a.$;if(l.compareDocumentPosition)return l.compareDocumentPosition(g);if(l==g)return CKEDITOR.POSITION_IDENTICAL;if(this.type==CKEDITOR.NODE_ELEMENT&&a.type==CKEDITOR.NODE_ELEMENT){if(l.contains){if(l.contains(g))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(g.contains(l))return CKEDITOR.POSITION_IS_CONTAINED+
|
|
81
|
+
CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in l)return 0>l.sourceIndex||0>g.sourceIndex?CKEDITOR.POSITION_DISCONNECTED:l.sourceIndex<g.sourceIndex?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING}l=this.getAddress();a=a.getAddress();for(var g=Math.min(l.length,a.length),f=0;f<g;f++)if(l[f]!=a[f])return l[f]<a[f]?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING;return l.length<a.length?CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING},
|
|
82
|
+
getAscendant:function(a,l){var g=this.$,f,e;l||(g=g.parentNode);"function"==typeof a?(e=!0,f=a):(e=!1,f=function(f){f="string"==typeof f.nodeName?f.nodeName.toLowerCase():"";return"string"==typeof a?f==a:f in a});for(;g;){if(f(e?new CKEDITOR.dom.node(g):g))return new CKEDITOR.dom.node(g);try{g=g.parentNode}catch(m){g=null}}return null},hasAscendant:function(a,l){var g=this.$;l||(g=g.parentNode);for(;g;){if(g.nodeName&&g.nodeName.toLowerCase()==a)return!0;g=g.parentNode}return!1},move:function(a,l){a.append(this.remove(),
|
|
83
|
+
l)},remove:function(a){var l=this.$,g=l.parentNode;if(g){if(a)for(;a=l.firstChild;)g.insertBefore(l.removeChild(a),l);g.removeChild(l)}return this},replace:function(a){this.insertBefore(a);a.remove()},trim:function(){this.ltrim();this.rtrim()},ltrim:function(){for(var a;this.getFirst&&(a=this.getFirst());){if(a.type==CKEDITOR.NODE_TEXT){var l=CKEDITOR.tools.ltrim(a.getText()),g=a.getLength();if(l)l.length<g&&(a.split(g-l.length),this.$.removeChild(this.$.firstChild));else{a.remove();continue}}break}},
|
|
84
|
+
rtrim:function(){for(var a;this.getLast&&(a=this.getLast());){if(a.type==CKEDITOR.NODE_TEXT){var l=CKEDITOR.tools.rtrim(a.getText()),g=a.getLength();if(l)l.length<g&&(a.split(l.length),this.$.lastChild.parentNode.removeChild(this.$.lastChild));else{a.remove();continue}}break}CKEDITOR.env.needsBrFiller&&(a=this.$.lastChild)&&1==a.type&&"br"==a.nodeName.toLowerCase()&&a.parentNode.removeChild(a)},isReadOnly:function(a){var l=this;this.type!=CKEDITOR.NODE_ELEMENT&&(l=this.getParent());CKEDITOR.env.edge&&
|
|
85
85
|
l&&l.is("textarea","input")&&(a=!0);if(!a&&l&&"undefined"!=typeof l.$.isContentEditable)return!(l.$.isContentEditable||l.data("cke-editable"));for(;l;){if(l.data("cke-editable"))return!1;if(l.hasAttribute("contenteditable"))return"false"==l.getAttribute("contenteditable");l=l.getParent()}return!0}});CKEDITOR.dom.window=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.window.prototype=new CKEDITOR.dom.domObject;CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype,{focus:function(){this.$.focus()},
|
|
86
86
|
getViewPaneSize:function(){var a=this.$.document,l="CSS1Compat"==a.compatMode;return{width:(l?a.documentElement.clientWidth:a.body.clientWidth)||0,height:(l?a.documentElement.clientHeight:a.body.clientHeight)||0}},getScrollPosition:function(){var a=this.$;if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};a=a.document;return{x:a.documentElement.scrollLeft||a.body.scrollLeft||0,y:a.documentElement.scrollTop||a.body.scrollTop||0}},getFrame:function(){var a=this.$.frameElement;return a?
|
|
87
87
|
new CKEDITOR.dom.element.get(a):null}});CKEDITOR.dom.document=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.document.prototype=new CKEDITOR.dom.domObject;CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype,{type:CKEDITOR.NODE_DOCUMENT,appendStyleSheet:function(a){if(this.$.createStyleSheet)this.$.createStyleSheet(a);else{var l=new CKEDITOR.dom.element("link");l.setAttributes({rel:"stylesheet",type:"text/css",href:a});this.getHead().append(l)}},appendStyleText:function(a){if(this.$.createStyleSheet){var l=
|
|
88
|
-
this.$.createStyleSheet("");l.cssText=a}else{var
|
|
89
|
-
getById:function(a){return(a=this.$.getElementById(a))?new CKEDITOR.dom.element(a):null},getByAddress:function(a,l){for(var
|
|
88
|
+
this.$.createStyleSheet("");l.cssText=a}else{var g=new CKEDITOR.dom.element("style",this);g.append(new CKEDITOR.dom.text(a,this));this.getHead().append(g)}return l||g.$.sheet},createElement:function(a,l){var g=new CKEDITOR.dom.element(a,this);l&&(l.attributes&&g.setAttributes(l.attributes),l.styles&&g.setStyles(l.styles));return g},createText:function(a){return new CKEDITOR.dom.text(a,this)},focus:function(){this.getWindow().focus()},getActive:function(){var a;try{a=this.$.activeElement}catch(l){return null}return new CKEDITOR.dom.element(a)},
|
|
89
|
+
getById:function(a){return(a=this.$.getElementById(a))?new CKEDITOR.dom.element(a):null},getByAddress:function(a,l){for(var g=this.$.documentElement,f=0;g&&f<a.length;f++){var e=a[f];if(l)for(var m=-1,k=0;k<g.childNodes.length;k++){var h=g.childNodes[k];if(!0!==l||3!=h.nodeType||!h.previousSibling||3!=h.previousSibling.nodeType)if(m++,m==e){g=h;break}}else g=g.childNodes[e]}return g?new CKEDITOR.dom.node(g):null},getElementsByTag:function(a,l){CKEDITOR.env.ie&&8>=document.documentMode||!l||(a=l+":"+
|
|
90
90
|
a);return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))},getHead:function(){var a=this.$.getElementsByTagName("head")[0];return a=a?new CKEDITOR.dom.element(a):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),!0)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(a){this.$.open("text/html",
|
|
91
91
|
"replace");CKEDITOR.env.ie&&(a=a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,'$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e('+CKEDITOR.tools.fixDomain+")();\x3c/script\x3e"));this.$.write(a);this.$.close()},find:function(a){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))},findOne:function(a){return(a=this.$.querySelector(a))?new CKEDITOR.dom.element(a):null},_getHtml5ShivFrag:function(){var a=this.getCustomData("html5ShivFrag");a||(a=this.$.createDocumentFragment(),CKEDITOR.tools.enableHtml5Elements(a,
|
|
92
92
|
!0),this.setCustomData("html5ShivFrag",a));return a}});CKEDITOR.dom.nodeList=function(a){this.$=a};CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(a){return 0>a||a>=this.$.length?null:(a=this.$[a])?new CKEDITOR.dom.node(a):null},toArray:function(){return CKEDITOR.tools.array.map(this.$,function(a){return new CKEDITOR.dom.node(a)})}};CKEDITOR.dom.element=function(a,l){"string"==typeof a&&(a=(l?l.$:document).createElement(a));CKEDITOR.dom.domObject.call(this,
|
|
93
|
-
a)};CKEDITOR.dom.element.get=function(a){return(a="string"==typeof a?document.getElementById(a)||document.getElementsByName(a)[0]:a)&&(a.$?a:new CKEDITOR.dom.element(a))};CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node;CKEDITOR.dom.element.createFromHtml=function(a,l){var
|
|
94
|
-
m=l.getCustomData("list_marker_names")||l.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");a[e]=l;m[
|
|
95
|
-
delete a[e])};(function(){function a(a,b){return-1<(" "+a+" ").replace(m," ").indexOf(" "+b+" ")}function l(a){var b=!0;a.$.id||(a.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),b=!1);return function(){b||a.removeAttribute("id")}}function
|
|
96
|
-
typeof e&&null!==String(e.add).match(/\[Native code\]/gi),m=/[\n\t\r]/g;CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:e?function(a){this.$.classList.add(a);return this}:function(
|
|
97
|
-
|
|
93
|
+
a)};CKEDITOR.dom.element.get=function(a){return(a="string"==typeof a?document.getElementById(a)||document.getElementsByName(a)[0]:a)&&(a.$?a:new CKEDITOR.dom.element(a))};CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node;CKEDITOR.dom.element.createFromHtml=function(a,l){var g=new CKEDITOR.dom.element("div",l);g.setHtml(a);return g.getFirst().remove()};CKEDITOR.dom.element.setMarker=function(a,l,g,f){var e=l.getCustomData("list_marker_id")||l.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),
|
|
94
|
+
m=l.getCustomData("list_marker_names")||l.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");a[e]=l;m[g]=1;return l.setCustomData(g,f)};CKEDITOR.dom.element.clearAllMarkers=function(a){for(var l in a)CKEDITOR.dom.element.clearMarkers(a,a[l],1)};CKEDITOR.dom.element.clearMarkers=function(a,l,g){var f=l.getCustomData("list_marker_names"),e=l.getCustomData("list_marker_id"),m;for(m in f)l.removeCustomData(m);l.removeCustomData("list_marker_names");g&&(l.removeCustomData("list_marker_id"),
|
|
95
|
+
delete a[e])};(function(){function a(a,b){return-1<(" "+a+" ").replace(m," ").indexOf(" "+b+" ")}function l(a){var b=!0;a.$.id||(a.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),b=!1);return function(){b||a.removeAttribute("id")}}function g(a,b){var d=CKEDITOR.tools.escapeCss(a.$.id);return"#"+d+" "+b.split(/,\s*/).join(", #"+d+" ")}function f(a){for(var b=0,d=0,c=k[a].length;d<c;d++)b+=parseFloat(this.getComputedStyle(k[a][d])||0,10)||0;return b}var e=document.createElement("_").classList,e="undefined"!==
|
|
96
|
+
typeof e&&null!==String(e.add).match(/\[Native code\]/gi),m=/[\n\t\r]/g;CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:e?function(a){this.$.classList.add(a);return this}:function(h){var b=this.$.className;b&&(a(b,h)||(b+=" "+h));this.$.className=b||h;return this},removeClass:e?function(a){var b=this.$;b.classList.remove(a);b.className||b.removeAttribute("class");return this}:function(h){var b=this.getAttribute("class");b&&a(b,h)&&((b=b.replace(new RegExp("(?:^|\\s+)"+
|
|
97
|
+
h+"(?\x3d\\s|$)"),"").replace(/^\s+/,""))?this.setAttribute("class",b):this.removeAttribute("class"));return this},hasClass:function(h){return a(this.$.className,h)},append:function(a,b){"string"==typeof a&&(a=this.getDocument().createElement(a));b?this.$.insertBefore(a.$,this.$.firstChild):this.$.appendChild(a.$);return a},appendHtml:function(a){if(this.$.childNodes.length){var b=new CKEDITOR.dom.element("div",this.getDocument());b.setHtml(a);b.moveChildren(this)}else this.setHtml(a)},appendText:function(a){null!=
|
|
98
98
|
this.$.text&&CKEDITOR.env.ie&&9>CKEDITOR.env.version?this.$.text+=a:this.append(new CKEDITOR.dom.text(a))},appendBogus:function(a){if(a||CKEDITOR.env.needsBrFiller){for(a=this.getLast();a&&a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(a.getText());)a=a.getPrevious();a&&a.is&&a.is("br")||(a=this.getDocument().createElement("br"),CKEDITOR.env.gecko&&a.setAttribute("type","_moz"),this.append(a))}},breakParent:function(a,b){var d=new CKEDITOR.dom.range(this.getDocument());d.setStartAfter(this);d.setEndAfter(a);
|
|
99
99
|
var c=d.extractContents(!1,b||!1),f;d.insertNode(this.remove());if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){for(d=new CKEDITOR.dom.element("div");f=c.getFirst();)f.$.style.backgroundColor&&(f.$.style.backgroundColor=f.$.style.backgroundColor),d.append(f);d.insertAfter(this);d.remove(!0)}else c.insertAfterNode(this)},contains:document.compareDocumentPosition?function(a){return!!(this.$.compareDocumentPosition(a.$)&16)}:function(a){var b=this.$;return a.type!=CKEDITOR.NODE_ELEMENT?b.contains(a.getParent().$):
|
|
100
100
|
b!=a.$&&b.contains(a.$)},focus:function(){function a(){try{this.$.focus()}catch(b){}}return function(b){b?CKEDITOR.tools.setTimeout(a,100,this):a.call(this)}}(),getHtml:function(){var a=this.$.innerHTML;return CKEDITOR.env.ie?a.replace(/<\?[^>]*>/g,""):a},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var a=this.$.ownerDocument.createElement("div");a.appendChild(this.$.cloneNode(!0));return a.innerHTML},getClientRect:function(a){var b=CKEDITOR.tools.extend({},
|
|
101
101
|
this.$.getBoundingClientRect());!b.width&&(b.width=b.right-b.left);!b.height&&(b.height=b.bottom-b.top);return a?CKEDITOR.tools.getAbsoluteRectPosition(this.getWindow(),b):b},setHtml:CKEDITOR.env.ie&&9>CKEDITOR.env.version?function(a){try{var b=this.$;if(this.getParent())return b.innerHTML=a;var d=this.getDocument()._getHtml5ShivFrag();d.appendChild(b);b.innerHTML=a;d.removeChild(b);return a}catch(c){this.$.innerHTML="";b=new CKEDITOR.dom.element("body",this.getDocument());b.$.innerHTML=a;for(b=b.getChildren();b.count();)this.append(b.getItem(0));
|
|
102
|
-
return a}}:function(a){return this.$.innerHTML=a},setText:function(){var a=document.createElement("p");a.innerHTML="x";a=a.textContent;return function(b){this.$[a?"textContent":"innerText"]=b}}(),getAttribute:function(){var a=function(
|
|
103
|
-
2),0!==
|
|
102
|
+
return a}}:function(a){return this.$.innerHTML=a},setText:function(){var a=document.createElement("p");a.innerHTML="x";a=a.textContent;return function(b){this.$[a?"textContent":"innerText"]=b}}(),getAttribute:function(){var a=function(b){return this.$.getAttribute(b,2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(b){switch(b){case "class":b="className";break;case "http-equiv":b="httpEquiv";break;case "name":return this.$.name;case "tabindex":return b=this.$.getAttribute(b,
|
|
103
|
+
2),0!==b&&0===this.$.tabIndex&&(b=null),b;case "checked":return b=this.$.attributes.getNamedItem(b),(b.specified?b.nodeValue:this.$.checked)?"checked":null;case "hspace":case "value":return this.$[b];case "style":return this.$.style.cssText;case "contenteditable":case "contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(b,2)}:a}(),getAttributes:function(a){var b={},d=this.$.attributes,c;a=CKEDITOR.tools.isArray(a)?
|
|
104
104
|
a:[];for(c=0;c<d.length;c++)-1===CKEDITOR.tools.indexOf(a,d[c].name)&&(b[d[c].name]=d[c].value);return b},getChildren:function(){return new CKEDITOR.dom.nodeList(this.$.childNodes)},getClientSize:function(){return{width:this.$.clientWidth,height:this.$.clientHeight}},getComputedStyle:document.defaultView&&document.defaultView.getComputedStyle?function(a){var b=this.getWindow().$.getComputedStyle(this.$,null);return b?b.getPropertyValue(a):""}:function(a){return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]},
|
|
105
105
|
getDtd:function(){var a=CKEDITOR.dtd[this.getName()];this.getDtd=function(){return a};return a},getElementsByTag:CKEDITOR.dom.document.prototype.getElementsByTag,getTabIndex:function(){var a=this.$.tabIndex;return 0!==a||CKEDITOR.dtd.$tabIndex[this.getName()]||0===parseInt(this.getAttribute("tabindex"),10)?a:-1},getText:function(){return this.$.textContent||this.$.innerText||""},getWindow:function(){return this.getDocument().getWindow()},getId:function(){return this.$.id||null},getNameAtt:function(){return this.$.name||
|
|
106
106
|
null},getName:function(){var a=this.$.nodeName.toLowerCase();if(CKEDITOR.env.ie&&8>=document.documentMode){var b=this.$.scopeName;"HTML"!=b&&(a=b.toLowerCase()+":"+a)}this.getName=function(){return a};return this.getName()},getValue:function(){return this.$.value},getFirst:function(a){var b=this.$.firstChild;(b=b&&new CKEDITOR.dom.node(b))&&a&&!a(b)&&(b=b.getNext(a));return b},getLast:function(a){var b=this.$.lastChild;(b=b&&new CKEDITOR.dom.node(b))&&a&&!a(b)&&(b=b.getPrevious(a));return b},getStyle:function(a){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]},
|
|
@@ -109,48 +109,48 @@ CKEDITOR.dtd.span,!(!a||!a["#"])):!0},isIdentical:function(a){var b=this.clone(0
|
|
|
109
109
|
a.getOuterHtml();if(CKEDITOR.env.ie&&9>CKEDITOR.env.version&&this.is("a")){var d=this.getParent();d.type==CKEDITOR.NODE_ELEMENT&&(d=d.clone(),d.setHtml(b),b=d.getHtml(),d.setHtml(a),a=d.getHtml())}return b==a},isVisible:function(){var a=(this.$.offsetHeight||this.$.offsetWidth)&&"hidden"!=this.getComputedStyle("visibility"),b,d;a&&CKEDITOR.env.webkit&&(b=this.getWindow(),!b.equals(CKEDITOR.document.getWindow())&&(d=b.$.frameElement)&&(a=(new CKEDITOR.dom.element(d)).isVisible()));return!!a},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return!1;
|
|
110
110
|
for(var a=this.getChildren(),b=0,d=a.count();b<d;b++){var c=a.getItem(b);if(c.type!=CKEDITOR.NODE_ELEMENT||!c.data("cke-bookmark"))if(c.type==CKEDITOR.NODE_ELEMENT&&!c.isEmptyInlineRemoveable()||c.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(c.getText()))return!1}return!0},hasAttributes:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(){for(var a=this.$.attributes,b=0;b<a.length;b++){var d=a[b];switch(d.nodeName){case "class":if(this.getAttribute("class"))return!0;case "data-cke-expando":continue;
|
|
111
111
|
default:if(d.specified)return!0}}return!1}:function(){var a=this.$.attributes,b=a.length,d={"data-cke-expando":1,_moz_dirty:1};return 0<b&&(2<b||!d[a[0].nodeName]||2==b&&!d[a[1].nodeName])},hasAttribute:function(){function a(b){var d=this.$.attributes.getNamedItem(b);if("input"==this.getName())switch(b){case "class":return 0<this.$.className.length;case "checked":return!!this.$.checked;case "value":return b=this.getAttribute("type"),"checkbox"==b||"radio"==b?"on"!=this.$.value:!!this.$.value}return d?
|
|
112
|
-
d.specified:!1}return CKEDITOR.env.ie?8>CKEDITOR.env.version?function(b){return"name"==b?!!this.$.name:a.call(this,b)}:a:function(a){return!!this.$.attributes.getNamedItem(a)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,b){var d=this.$;a=a.$;if(d!=a){var c;if(b)for(;c=d.lastChild;)a.insertBefore(d.removeChild(c),a.firstChild);else for(;c=d.firstChild;)a.appendChild(d.removeChild(c))}},mergeSiblings:function(){function a(b,d,c){if(d&&d.type==CKEDITOR.NODE_ELEMENT){for(var
|
|
113
|
-
[];d.data("cke-bookmark")||d.isEmptyInlineRemoveable();)if(
|
|
112
|
+
d.specified:!1}return CKEDITOR.env.ie?8>CKEDITOR.env.version?function(b){return"name"==b?!!this.$.name:a.call(this,b)}:a:function(a){return!!this.$.attributes.getNamedItem(a)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,b){var d=this.$;a=a.$;if(d!=a){var c;if(b)for(;c=d.lastChild;)a.insertBefore(d.removeChild(c),a.firstChild);else for(;c=d.firstChild;)a.appendChild(d.removeChild(c))}},mergeSiblings:function(){function a(b,d,c){if(d&&d.type==CKEDITOR.NODE_ELEMENT){for(var h=
|
|
113
|
+
[];d.data("cke-bookmark")||d.isEmptyInlineRemoveable();)if(h.push(d),d=c?d.getNext():d.getPrevious(),!d||d.type!=CKEDITOR.NODE_ELEMENT)return;if(b.isIdentical(d)){for(var f=c?b.getLast():b.getFirst();h.length;)h.shift().move(b,!c);d.moveChildren(b,!c);d.remove();f&&f.type==CKEDITOR.NODE_ELEMENT&&f.mergeSiblings()}}}return function(b){if(!1===b||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))a(this,this.getNext(),!0),a(this,this.getPrevious())}}(),show:function(){this.setStyles({display:"",
|
|
114
114
|
visibility:""})},setAttribute:function(){var a=function(a,d){this.$.setAttribute(a,d);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(b,d){"class"==b?this.$.className=d:"style"==b?this.$.style.cssText=d:"tabindex"==b?this.$.tabIndex=d:"checked"==b?this.$.checked=d:"contenteditable"==b?a.call(this,"contentEditable",d):a.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(b,d){if("src"==b&&d.match(/^http:\/\//))try{a.apply(this,
|
|
115
115
|
arguments)}catch(c){}else a.apply(this,arguments);return this}:a}(),setAttributes:function(a){for(var b in a)this.setAttribute(b,a[b]);return this},setValue:function(a){this.$.value=a;return this},removeAttribute:function(){var a=function(a){this.$.removeAttribute(a)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){"class"==a?a="className":"tabindex"==a?a="tabIndex":"contenteditable"==a&&(a="contentEditable");this.$.removeAttribute(a)}:a}(),removeAttributes:function(a){if(CKEDITOR.tools.isArray(a))for(var b=
|
|
116
116
|
0;b<a.length;b++)this.removeAttribute(a[b]);else for(b in a=a||this.getAttributes(),a)a.hasOwnProperty(b)&&this.removeAttribute(b)},removeStyle:function(a){var b=this.$.style;if(b.removeProperty||"border"!=a&&"margin"!=a&&"padding"!=a)b.removeProperty?b.removeProperty(a):b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a)),this.$.style.cssText||this.removeAttribute("style");else{var d=["top","left","right","bottom"],c;"border"==a&&(c=["color","style","width"]);for(var b=[],f=0;f<d.length;f++)if(c)for(var e=
|
|
117
117
|
0;e<c.length;e++)b.push([a,d[f],c[e]].join("-"));else b.push([a,d[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("*"),d=0,c=b.count();d<c;d++)a=b.getItem(d),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,d=0,c=this.getDocument(),f=c.getBody(),e="BackCompat"==c.$.compatMode;if(document.documentElement.getBoundingClientRect&&(CKEDITOR.env.ie?
|
|
119
|
-
8!==CKEDITOR.env.version:1)){var k=this.$.getBoundingClientRect(),
|
|
119
|
+
8!==CKEDITOR.env.version:1)){var k=this.$.getBoundingClientRect(),g=c.$.documentElement,m=g.clientTop||f.$.clientTop||0,v=g.clientLeft||f.$.clientLeft||0,l=!0;CKEDITOR.env.ie&&(l=c.getDocumentElement().contains(this),c=c.getBody().contains(this),l=e&&c||!e&&l);l&&(CKEDITOR.env.webkit||CKEDITOR.env.ie&&12<=CKEDITOR.env.version?(b=f.$.scrollLeft||g.scrollLeft,d=f.$.scrollTop||g.scrollTop):(d=e?f.$:g,b=d.scrollLeft,d=d.scrollTop),b=k.left+b-v,d=k.top+d-m)}else for(m=this,v=null;m&&"body"!=m.getName()&&
|
|
120
120
|
"html"!=m.getName();){b+=m.$.offsetLeft-m.$.scrollLeft;d+=m.$.offsetTop-m.$.scrollTop;m.equals(this)||(b+=m.$.clientLeft||0,d+=m.$.clientTop||0);for(;v&&!v.equals(m);)b-=v.$.scrollLeft,d-=v.$.scrollTop,v=v.getParent();v=m;m=(k=m.$.offsetParent)?new CKEDITOR.dom.element(k):null}a&&(k=this.getWindow(),m=a.getWindow(),!k.equals(m)&&k.$.frameElement&&(a=(new CKEDITOR.dom.element(k.$.frameElement)).getDocumentPosition(a),b+=a.x,d+=a.y));document.documentElement.getBoundingClientRect||!CKEDITOR.env.gecko||
|
|
121
|
-
e||(b+=this.$.clientLeft?1:0,d+=this.$.clientTop?1:0);return{x:b,y:d}},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 d=b.getWindow();try{var c=d.$.frameElement;c&&(b=new CKEDITOR.dom.element(c))}catch(f){}}while(b=b.getParent())}},scrollIntoParent:function(a,b,d){var c,f,e,k;function
|
|
121
|
+
e||(b+=this.$.clientLeft?1:0,d+=this.$.clientTop?1:0);return{x:b,y:d}},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 d=b.getWindow();try{var c=d.$.frameElement;c&&(b=new CKEDITOR.dom.element(c))}catch(f){}}while(b=b.getParent())}},scrollIntoParent:function(a,b,d){var c,f,e,k;function g(c,b){/body|html/.test(a.getName())?
|
|
122
122
|
a.getWindow().$.scrollBy(c,b):(a.$.scrollLeft+=c,a.$.scrollTop+=b)}function m(c,a){var b={x:0,y:0};if(!c.is(l?"body":"html")){var d=c.$.getBoundingClientRect();b.x=d.left;b.y=d.top}d=c.getWindow();d.equals(a)||(d=m(CKEDITOR.dom.element.get(d.$.frameElement),a),b.x+=d.x,b.y+=d.y);return b}function v(c,a){return parseInt(c.getComputedStyle("margin-"+a)||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
|
|
123
|
+
CKEDITOR.env.webkit&&(e=this.getEditor(!1))&&(e._.previousScrollTop=null);e=a.getWindow();f=m(this,e);var x=m(a,e),z=this.$.offsetHeight;c=this.$.offsetWidth;var A=a.$.clientHeight,w=a.$.clientWidth;e=f.x-v(this,"left")-x.x||0;k=f.y-v(this,"top")-x.y||0;c=f.x+c+v(this,"right")-(x.x+w)||0;f=f.y+z+v(this,"bottom")-(x.y+A)||0;(0>k||0<f)&&g(0,!0===b?k:!1===b?f:0>k?k:f);d&&(0>e||0<c)&&g(0>e?e:c,0)},setState:function(a,b,d){b=b||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(b+"_on");this.removeClass(b+
|
|
124
124
|
"_off");this.removeClass(b+"_disabled");d&&this.setAttribute("aria-pressed",!0);d&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(b+"_disabled");this.removeClass(b+"_off");this.removeClass(b+"_on");d&&this.setAttribute("aria-disabled",!0);d&&this.removeAttribute("aria-pressed");break;default:this.addClass(b+"_off"),this.removeClass(b+"_on"),this.removeClass(b+"_disabled"),d&&this.removeAttribute("aria-pressed"),d&&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 d=this.$.attributes;b=b||{};for(var c=0;c<d.length;c++){var f=d[c],e=f.nodeName.toLowerCase(),k;if(!(e in b))if("checked"==e&&(k=this.getAttribute(e)))a.setAttribute(e,k);else if(!CKEDITOR.env.ie||this.hasAttribute(e))k=this.getAttribute(e),null===k&&(k=f.nodeValue),a.setAttribute(e,k)}""!==this.$.style.cssText&&
|
|
126
126
|
(a.$.style.cssText=this.$.style.cssText)},renameNode:function(a){if(this.getName()!=a){var b=this.getDocument();a=new CKEDITOR.dom.element(a,b);this.copyAttributes(a);this.moveChildren(a);this.getParent(!0)&&this.$.parentNode.replaceChild(a.$,this.$);a.$["data-cke-expando"]=this.$["data-cke-expando"];this.$=a.$;delete this.getName}},getChild:function(){function a(b,d){var c=b.childNodes;if(0<=d&&d<c.length)return c[d]}return function(b){var d=this.$;if(b.slice)for(b=b.slice();0<b.length&&d;)d=a(d,
|
|
127
127
|
b.shift());else d=a(d,b);return d?new CKEDITOR.dom.node(d):null}}(),getChildCount:function(){return this.$.childNodes.length},disableContextMenu:function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT&&b.hasClass("cke_enable_context_menu")}this.on("contextmenu",function(b){b.data.getTarget().getAscendant(a,!0)||b.data.preventDefault()})},getDirection:function(a){return a?this.getComputedStyle("direction")||this.getDirection()||this.getParent()&&this.getParent().getDirection(1)||this.getDocument().$.dir||
|
|
128
|
-
"ltr":this.getStyle("direction")||this.getAttribute("dir")},data:function(a,b){a="data-"+a;if(void 0===b)return this.getAttribute(a);!1===b?this.removeAttribute(a):this.setAttribute(a,b);return null},getEditor:function(a){var b=CKEDITOR.instances,d,c,f;a=a||void 0===a;for(d in b)if(c=b[d],c.element.equals(this)&&c.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO||!a&&(f=c.editable())&&(f.equals(this)||f.contains(this)))return c;return null},find:function(a){var b=l(this);a=new CKEDITOR.dom.nodeList(this.$.querySelectorAll(
|
|
129
|
-
a)));b();return a},findOne:function(a){var b=l(this);a=this.$.querySelector(
|
|
128
|
+
"ltr":this.getStyle("direction")||this.getAttribute("dir")},data:function(a,b){a="data-"+a;if(void 0===b)return this.getAttribute(a);!1===b?this.removeAttribute(a):this.setAttribute(a,b);return null},getEditor:function(a){var b=CKEDITOR.instances,d,c,f;a=a||void 0===a;for(d in b)if(c=b[d],c.element.equals(this)&&c.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO||!a&&(f=c.editable())&&(f.equals(this)||f.contains(this)))return c;return null},find:function(a){var b=l(this);a=new CKEDITOR.dom.nodeList(this.$.querySelectorAll(g(this,
|
|
129
|
+
a)));b();return a},findOne:function(a){var b=l(this);a=this.$.querySelector(g(this,a));b();return a?new CKEDITOR.dom.element(a):null},forEach:function(a,b,d){if(!(d||b&&this.type!=b))var c=a(this);if(!1!==c){d=this.getChildren();for(var f=0;f<d.count();f++)c=d.getItem(f),c.type==CKEDITOR.NODE_ELEMENT?c.forEach(a,b):b&&c.type!=b||a(c)}},fireEventHandler:function(a,b){var d="on"+a,c=this.$;if(CKEDITOR.env.ie&&9>CKEDITOR.env.version){var f=c.ownerDocument.createEventObject(),e;for(e in b)f[e]=b[e];c.fireEvent(d,
|
|
130
130
|
f)}else c[c[a]?a:d](b)},isDetached:function(){var a=this.getDocument(),b=a.getDocumentElement();return b.equals(this)||b.contains(this)?!CKEDITOR.env.ie||8<CKEDITOR.env.version&&!CKEDITOR.env.quirks?!a.$.defaultView:!1:!0}});var k={width:["border-left-width","border-right-width","padding-left","padding-right"],height:["border-top-width","border-bottom-width","padding-top","padding-bottom"]};CKEDITOR.dom.element.prototype.setSize=function(a,b,d){"number"==typeof b&&(!d||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 d=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(a)],this.$["client"+CKEDITOR.tools.capitalize(a)])||0;b&&(d-=f.call(this,a));return d}})();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(c,a){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 d,f=b.startContainer;d=b.endContainer;var e=b.startOffset,
|
|
134
|
-
function(c,a){return(!a||!l.equals(c))&&(!C||!c.equals(C))&&(c.type!=CKEDITOR.NODE_ELEMENT||!a||!c.equals(b.root))}}if(c&&!this._.guardRTL){var B=f.type==CKEDITOR.NODE_ELEMENT?f:f.getParent(),G=f.type==CKEDITOR.NODE_ELEMENT?e?f.getChild(e-1):null:f.getPrevious();this._.guardRTL=function(c,a){return(!a||!B.equals(c))&&(!G||!c.equals(G))&&(c.type!=CKEDITOR.NODE_ELEMENT||!a||!c.equals(b.root))}}var K=c?this._.guardRTL:this._.guardLTR;k=
|
|
135
|
-
|
|
136
|
-
CKEDITOR.tools.createClass({$:function(c){this.range=c;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
|
|
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(c){return"none"!=this.getComputedStyle("float")||this.getComputedStyle("position")in f||!
|
|
133
|
+
CKEDITOR.dom.document.prototype,!0,{find:1,findOne:1});(function(){function a(c,a){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 d,f=b.startContainer;d=b.endContainer;var e=b.startOffset,h=b.endOffset,k,n=this.guard,g=this.type,m=c?"getPreviousSourceNode":"getNextSourceNode";if(!c&&!this._.guardLTR){var l=d.type==CKEDITOR.NODE_ELEMENT?d:d.getParent(),C=d.type==CKEDITOR.NODE_ELEMENT?d.getChild(h):d.getNext();this._.guardLTR=
|
|
134
|
+
function(c,a){return(!a||!l.equals(c))&&(!C||!c.equals(C))&&(c.type!=CKEDITOR.NODE_ELEMENT||!a||!c.equals(b.root))}}if(c&&!this._.guardRTL){var B=f.type==CKEDITOR.NODE_ELEMENT?f:f.getParent(),G=f.type==CKEDITOR.NODE_ELEMENT?e?f.getChild(e-1):null:f.getPrevious();this._.guardRTL=function(c,a){return(!a||!B.equals(c))&&(!G||!c.equals(G))&&(c.type!=CKEDITOR.NODE_ELEMENT||!a||!c.equals(b.root))}}var K=c?this._.guardRTL:this._.guardLTR;k=n?function(c,a){return!1===K(c,a)?!1:n(c,a)}:K;this.current?d=this.current[m](!1,
|
|
135
|
+
g,k):(c?d.type==CKEDITOR.NODE_ELEMENT&&(d=0<h?d.getChild(h-1):!1===k(d,!0)?null:d.getPreviousSourceNode(!0,g,k)):(d=f,d.type==CKEDITOR.NODE_ELEMENT&&((d=d.getChild(e))||(d=!1===k(f,!0)?null:f.getNextSourceNode(!0,g,k)))),d&&!1===k(d)&&(d=null));for(;d&&!this._.end;){this.current=d;if(!this.evaluator||!1!==this.evaluator(d)){if(!a)return d}else if(a&&this.evaluator)return!1;d=d[m](!1,g,k)}this.end();return this.current=null}function l(c){for(var b,d=null;b=a.call(this,c);)d=b;return d}CKEDITOR.dom.walker=
|
|
136
|
+
CKEDITOR.tools.createClass({$:function(c){this.range=c;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 g={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,
|
|
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(c){return"none"!=this.getComputedStyle("float")||this.getComputedStyle("position")in f||!g[this.getComputedStyle("display")]?!!(this.is(CKEDITOR.dtd.$block)||c&&this.is(c)):!0};CKEDITOR.dom.walker.blockBoundary=function(c){return function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary(c))}};CKEDITOR.dom.walker.listItemBoundary=
|
|
138
138
|
function(){return this.blockBoundary({br:1})};CKEDITOR.dom.walker.bookmark=function(c,a){function b(c){return c&&c.getName&&"span"==c.getName()&&c.data("cke-bookmark")}return function(d){var f,e;f=d&&d.type!=CKEDITOR.NODE_ELEMENT&&(e=d.getParent())&&b(e);f=c?f:f||b(d);return!!(a^f)}};CKEDITOR.dom.walker.whitespaces=function(c){return function(a){var b;a&&a.type==CKEDITOR.NODE_TEXT&&(b=!CKEDITOR.tools.trim(a.getText())||CKEDITOR.env.webkit&&a.getText()==CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE);
|
|
139
139
|
return!!(c^b)}};CKEDITOR.dom.walker.invisible=function(c){var a=CKEDITOR.dom.walker.whitespaces(),b=CKEDITOR.env.webkit?1:0;return function(d){a(d)?d=1:(d.type==CKEDITOR.NODE_TEXT&&(d=d.getParent()),d=d.$.offsetWidth<=b);return!!(c^d)}};CKEDITOR.dom.walker.nodeType=function(c,a){return function(b){return!!(a^b.type==c)}};CKEDITOR.dom.walker.bogus=function(c){function a(c){return!m(c)&&!k(c)}return function(b){var d=CKEDITOR.env.needsBrFiller?b.is&&b.is("br"):b.getText&&e.test(b.getText());d&&(d=b.getParent(),
|
|
140
|
-
b=b.getNext(a),d=d.isBlockBoundary()&&(!b||b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()));return!!(c^d)}};CKEDITOR.dom.walker.temp=function(c){return function(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());a=a&&a.hasAttribute("data-cke-temp");return!!(c^a)}};var e=/^[\t\r\n ]*(?: |\xa0)$/,m=CKEDITOR.dom.walker.whitespaces(),k=CKEDITOR.dom.walker.bookmark(),
|
|
141
|
-
CKEDITOR.dom.walker.ignored=function(c){return function(a){a=m(a)||k(a)||
|
|
140
|
+
b=b.getNext(a),d=d.isBlockBoundary()&&(!b||b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()));return!!(c^d)}};CKEDITOR.dom.walker.temp=function(c){return function(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());a=a&&a.hasAttribute("data-cke-temp");return!!(c^a)}};var e=/^[\t\r\n ]*(?: |\xa0)$/,m=CKEDITOR.dom.walker.whitespaces(),k=CKEDITOR.dom.walker.bookmark(),h=CKEDITOR.dom.walker.temp(),b=function(c){return k(c)||m(c)||c.type==CKEDITOR.NODE_ELEMENT&&c.is(CKEDITOR.dtd.$inline)&&!c.is(CKEDITOR.dtd.$empty)};
|
|
141
|
+
CKEDITOR.dom.walker.ignored=function(c){return function(a){a=m(a)||k(a)||h(a);return!!(c^a)}};var d=CKEDITOR.dom.walker.ignored();CKEDITOR.dom.walker.empty=function(c){return function(a){for(var b=0,f=a.getChildCount();b<f;++b)if(!d(a.getChild(b)))return!!c;return!c}};var c=CKEDITOR.dom.walker.empty(),n=CKEDITOR.dom.walker.validEmptyBlockContainers=CKEDITOR.tools.extend(function(c){var a={},b;for(b in c)CKEDITOR.dtd[b]["#"]&&(a[b]=1);return a}(CKEDITOR.dtd.$block),{caption:1,td:1,th:1});CKEDITOR.dom.walker.editable=
|
|
142
142
|
function(a){return function(b){b=d(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)&&c(b))?!0:!1;return!!(a^b)}};CKEDITOR.dom.element.prototype.getBogus=function(){var c=this;do c=c.getPreviousSourceNode();while(b(c));return c&&(CKEDITOR.env.needsBrFiller?c.is&&c.is("br"):c.getText&&e.test(c.getText()))?c:!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(c){c.collapsed=c.startContainer&&c.endContainer&&c.startContainer.equals(c.endContainer)&&c.startOffset==c.endOffset}function l(c,a,b,d,f){function e(c,a,b,d){var
|
|
144
|
-
J.length);for(c=0;c<d;c++)if(a=I[c],b=J[c],!a.equals(b))return c;return c-1}function k(){var a=F-1,b=K&&H&&!
|
|
145
|
-
a.mergeSiblings(!1),c.moveToBookmark({startNode:b}))):c.collapse(!0)}c.optimizeBookmark();var
|
|
146
|
-
CKEDITOR.NODE_TEXT?l?E=!0:
|
|
147
|
-
P||b.equals(I[W])&&P<L?a&&(Y=N.append(b.clone(0,f))):G?e(b,N,!1,H):M&&N.append(c.document.createText(b.substring(0,C)));if(W>ha)for(;Z;)Z=e(Z,N,!0);N=Y}l||k()}}function
|
|
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(c){c.collapsed=c.startContainer&&c.endContainer&&c.startContainer.equals(c.endContainer)&&c.startOffset==c.endOffset}function l(c,a,b,d,f){function e(c,a,b,d){var h=b?c.getPrevious():c.getNext();if(d&&g)return h;l||d?a.append(c.clone(!0,f),b):(c.remove(),m&&a.append(c,b));return h}function h(){var c,a,b,d=Math.min(I.length,
|
|
144
|
+
J.length);for(c=0;c<d;c++)if(a=I[c],b=J[c],!a.equals(b))return c;return c-1}function k(){var a=F-1,b=K&&H&&!w.equals(u);a<L-1||a<P-1||b?(b?c.moveToPosition(u,CKEDITOR.POSITION_BEFORE_START):P==a+1&&G?c.moveToPosition(J[a],CKEDITOR.POSITION_BEFORE_END):c.moveToPosition(J[a+1],CKEDITOR.POSITION_BEFORE_START),d&&(a=I[a+1])&&a.type==CKEDITOR.NODE_ELEMENT&&(b=CKEDITOR.dom.element.createFromHtml('\x3cspan data-cke-bookmark\x3d"1" style\x3d"display:none"\x3e\x26nbsp;\x3c/span\x3e',c.document),b.insertAfter(a),
|
|
145
|
+
a.mergeSiblings(!1),c.moveToBookmark({startNode:b}))):c.collapse(!0)}c.optimizeBookmark();var g=0===a,m=1==a,l=2==a;a=l||m;var w=c.startContainer,u=c.endContainer,D=c.startOffset,C=c.endOffset,B,G,K,H,E,M;if(l&&u.type==CKEDITOR.NODE_TEXT&&(w.equals(u)||w.type===CKEDITOR.NODE_ELEMENT&&w.getFirst().equals(u)))b.append(c.document.createText(u.substring(D,C)));else{u.type==CKEDITOR.NODE_TEXT?l?M=!0:u=u.split(C):0<u.getChildCount()?C>=u.getChildCount()?(u=u.getChild(C-1),G=!0):u=u.getChild(C):H=G=!0;w.type==
|
|
146
|
+
CKEDITOR.NODE_TEXT?l?E=!0:w.split(D):0<w.getChildCount()?0===D?(w=w.getChild(D),B=!0):w=w.getChild(D-1):K=B=!0;for(var I=w.getParents(),J=u.getParents(),F=h(),L=I.length-1,P=J.length-1,N=b,Y,S,Z,ha=-1,W=F;W<=L;W++){S=I[W];Z=S.getNext();for(W!=L||S.equals(J[W])&&L<P?a&&(Y=N.append(S.clone(0,f))):B?e(S,N,!1,K):E&&N.append(c.document.createText(S.substring(D)));Z;){if(Z.equals(J[W])){ha=W;break}Z=e(Z,N)}N=Y}N=b;for(W=F;W<=P;W++)if(b=J[W],Z=b.getPrevious(),b.equals(I[W]))a&&(N=N.getChild(0));else{W!=
|
|
147
|
+
P||b.equals(I[W])&&P<L?a&&(Y=N.append(b.clone(0,f))):G?e(b,N,!1,H):M&&N.append(c.document.createText(b.substring(0,C)));if(W>ha)for(;Z;)Z=e(Z,N,!0);N=Y}l||k()}}function g(){var c=!1,a=CKEDITOR.dom.walker.whitespaces(),b=CKEDITOR.dom.walker.bookmark(!0),d=CKEDITOR.dom.walker.bogus();return function(f){return b(f)||a(f)?!0:d(f)&&!c?c=!0:f.type==CKEDITOR.NODE_TEXT&&(f.hasAscendant("pre")||CKEDITOR.tools.trim(f.getText()).length)||f.type==CKEDITOR.NODE_ELEMENT&&!f.is(m)?!1:!0}}function f(c){var a=CKEDITOR.dom.walker.whitespaces(),
|
|
148
148
|
b=CKEDITOR.dom.walker.bookmark(1);return function(d){return b(d)||a(d)?!0:!c&&k(d)||d.type==CKEDITOR.NODE_ELEMENT&&d.is(CKEDITOR.dtd.$removeEmpty)}}function e(c){return function(){var a;return this[c?"getPreviousNode":"getNextNode"](function(c){!a&&d(c)&&(a=c);return b(c)&&!(k(c)&&c.equals(a))})}}var m={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},k=CKEDITOR.dom.walker.bogus(),
|
|
149
|
-
|
|
149
|
+
h=/^[\t\r\n ]*(?: |\xa0)$/,b=CKEDITOR.dom.walker.editable(),d=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype={clone:function(){var c=new CKEDITOR.dom.range(this.root);c._setStartContainer(this.startContainer);c.startOffset=this.startOffset;c._setEndContainer(this.endContainer);c.endOffset=this.endOffset;c.collapsed=this.collapsed;return c},collapse:function(c){c?(this._setEndContainer(this.startContainer),this.endOffset=this.startOffset):(this._setStartContainer(this.endContainer),
|
|
150
150
|
this.startOffset=this.endOffset);this.collapsed=!0},cloneContents:function(c){var a=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||l(this,2,a,!1,"undefined"==typeof c?!0:c);return a},deleteContents:function(c){this.collapsed||l(this,0,null,c)},extractContents:function(c,a){var b=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||l(this,1,b,c,"undefined"==typeof a?!0:a);return b},equals:function(c){return this.startOffset===c.startOffset&&this.endOffset===c.endOffset&&
|
|
151
|
-
this.startContainer.equals(c.startContainer)&&this.endContainer.equals(c.endContainer)},createBookmark:function(c){function a(c){return c.getAscendant(function(c){var a;if(a=c.data&&c.data("cke-temp"))a=-1===CKEDITOR.tools.array.indexOf(["cke_copybin","cke_pastebin"],c.getAttribute("id"));return a},!0)}var b=this.startContainer,d=this.endContainer,f=this.collapsed,e,
|
|
152
|
-
CKEDITOR.tools.getNextNumber(),e.setAttribute("id",k+(f?"C":"S")));f||(
|
|
153
|
-
"E":
|
|
151
|
+
this.startContainer.equals(c.startContainer)&&this.endContainer.equals(c.endContainer)},createBookmark:function(c){function a(c){return c.getAscendant(function(c){var a;if(a=c.data&&c.data("cke-temp"))a=-1===CKEDITOR.tools.array.indexOf(["cke_copybin","cke_pastebin"],c.getAttribute("id"));return a},!0)}var b=this.startContainer,d=this.endContainer,f=this.collapsed,e,h,k,g;e=this.document.createElement("span");e.data("cke-bookmark",1);e.setStyle("display","none");e.setHtml("\x26nbsp;");c&&(k="cke_bm_"+
|
|
152
|
+
CKEDITOR.tools.getNextNumber(),e.setAttribute("id",k+(f?"C":"S")));f||(h=e.clone(),h.setHtml("\x26nbsp;"),c&&h.setAttribute("id",k+"E"),g=this.clone(),a(d)&&(d=a(d),g.moveToPosition(d,CKEDITOR.POSITION_AFTER_END)),g.collapse(),g.insertNode(h));g=this.clone();a(b)&&(d=a(b),g.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START));g.collapse(!0);g.insertNode(e);h?(this.setStartAfter(e),this.setEndBefore(h)):this.moveToPosition(e,CKEDITOR.POSITION_AFTER_END);return{startNode:c?k+(f?"C":"S"):e,endNode:c?k+
|
|
153
|
+
"E":h,serializable:c,collapsed:f}},createBookmark2:function(){function c(c){var a=c.container,d=c.offset,f;f=a;var e=d;f=f.type!=CKEDITOR.NODE_ELEMENT||0===e||e==f.getChildCount()?0:f.getChild(e-1).type==CKEDITOR.NODE_TEXT&&f.getChild(e).type==CKEDITOR.NODE_TEXT;f&&(a=a.getChild(d-1),d=a.getLength());if(a.type==CKEDITOR.NODE_ELEMENT&&0<d){a:{for(f=a;d--;)if(e=f.getChild(d).getIndex(!0),0<=e){d=e;break a}d=-1}d+=1}if(a.type==CKEDITOR.NODE_TEXT){f=a;for(e=0;(f=f.getPrevious())&&f.type==CKEDITOR.NODE_TEXT;)e+=
|
|
154
154
|
f.getText().replace(CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE,"").length;f=e;a.isEmpty()?(e=a.getPrevious(b),f?(d=f,a=e?e.getNext():a.getParent().getFirst()):(a=a.getParent(),d=e?e.getIndex(!0)+1:0)):d+=f}c.container=a;c.offset=d}function a(c,b){var d=b.getCustomData("cke-fillingChar");if(d){var f=c.container;d.equals(f)&&(c.offset-=CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE.length,0>=c.offset&&(c.offset=f.getIndex(),c.container=f.getParent()))}}var b=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,
|
|
155
155
|
!0);return function(b){var d=this.collapsed,f={container:this.startContainer,offset:this.startOffset},e={container:this.endContainer,offset:this.endOffset};b&&(c(f),a(f,this.root),d||(c(e),a(e,this.root)));return{start:f.container.getAddress(b),end:d?null:e.container.getAddress(b),startOffset:f.offset,endOffset:e.offset,normalized:b,collapsed:d,is2:!0}}}(),moveToBookmark:function(c){if(c.is2){var a=this.document.getByAddress(c.start,c.normalized),b=c.startOffset,d=c.end&&this.document.getByAddress(c.end,
|
|
156
156
|
c.normalized);c=c.endOffset;this.setStart(a,b);d?this.setEnd(d,c):this.collapse(!0)}else a=(b=c.serializable)?this.document.getById(c.startNode):c.startNode,c=b?this.document.getById(c.endNode):c.endNode,this.setStartBefore(a),a.remove(),c?(this.setEndBefore(c),c.remove()):this.collapse(!0)},getBoundaryNodes:function(){var c=this.startContainer,a=this.endContainer,b=this.startOffset,d=this.endOffset,f;if(c.type==CKEDITOR.NODE_ELEMENT)if(f=c.getChildCount(),f>b)c=c.getChild(b);else if(1>f)c=c.getPreviousSourceNode();
|
|
@@ -158,409 +158,409 @@ else{for(c=c.$;c.lastChild;)c=c.lastChild;c=new CKEDITOR.dom.node(c);c=c.getNext
|
|
|
158
158
|
this.startOffset==this.endOffset-1?b.getChild(this.startOffset):b:b.getCommonAncestor(d);return a&&!b.is?b.getParent():b},optimize:function(){var c=this.startContainer,a=this.startOffset;c.type!=CKEDITOR.NODE_ELEMENT&&(a?a>=c.getLength()&&this.setStartAfter(c):this.setStartBefore(c));c=this.endContainer;a=this.endOffset;c.type!=CKEDITOR.NODE_ELEMENT&&(a?a>=c.getLength()&&this.setEndAfter(c):this.setEndBefore(c))},optimizeBookmark:function(){var c=this.startContainer,a=this.endContainer;c.is&&c.is("span")&&
|
|
159
159
|
c.data("cke-bookmark")&&this.setStartAt(c,CKEDITOR.POSITION_BEFORE_START);a&&a.is&&a.is("span")&&a.data("cke-bookmark")&&this.setEndAt(a,CKEDITOR.POSITION_AFTER_END)},trim:function(c,a){var b=this.startContainer,d=this.startOffset,f=this.collapsed;if((!c||f)&&b&&b.type==CKEDITOR.NODE_TEXT){if(d)if(d>=b.getLength())d=b.getIndex()+1,b=b.getParent();else{var e=b.split(d),d=b.getIndex()+1,b=b.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(e,this.endOffset-this.startOffset):b.equals(this.endContainer)&&
|
|
160
160
|
(this.endOffset+=1)}else d=b.getIndex(),b=b.getParent();this.setStart(b,d);if(f){this.collapse(!0);return}}b=this.endContainer;d=this.endOffset;a||f||!b||b.type!=CKEDITOR.NODE_TEXT||(d?(d>=b.getLength()||b.split(d),d=b.getIndex()+1):d=b.getIndex(),b=b.getParent(),this.setEnd(b,d))},enlarge:function(c,a){function b(c){return c&&c.type==CKEDITOR.NODE_ELEMENT&&c.hasAttribute("contenteditable")?null:c}var d=new RegExp(/[^\s\ufeff]/);switch(c){case CKEDITOR.ENLARGE_INLINE:var f=1;case CKEDITOR.ENLARGE_ELEMENT:var e=
|
|
161
|
-
function(c,a){var b=new CKEDITOR.dom.range(k);b.setStart(c,a);b.setEndAt(k,CKEDITOR.POSITION_BEFORE_END);var b=new CKEDITOR.dom.walker(b),f;for(b.guard=function(c){return!(c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary())};f=b.next();){if(f.type!=CKEDITOR.NODE_TEXT)return!1;B=f!=c?f.getText():f.substring(a);if(d.test(B))return!1}return!0};if(this.collapsed)break;var
|
|
162
|
-
(G&&(C=!CKEDITOR.tools.trim(C.substring(0,G)).length&&C,D=!!C),C&&((
|
|
163
|
-
else if((
|
|
164
|
-
l=
|
|
165
|
-
CKEDITOR.NODE_ELEMENT){if((0<
|
|
166
|
-
this.setEndAfter(
|
|
161
|
+
function(c,a){var b=new CKEDITOR.dom.range(k);b.setStart(c,a);b.setEndAt(k,CKEDITOR.POSITION_BEFORE_END);var b=new CKEDITOR.dom.walker(b),f;for(b.guard=function(c){return!(c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary())};f=b.next();){if(f.type!=CKEDITOR.NODE_TEXT)return!1;B=f!=c?f.getText():f.substring(a);if(d.test(B))return!1}return!0};if(this.collapsed)break;var h=this.getCommonAncestor(),k=this.root,g,m,l,w,u,D=!1,C,B;C=this.startContainer;var G=this.startOffset;C.type==CKEDITOR.NODE_TEXT?
|
|
162
|
+
(G&&(C=!CKEDITOR.tools.trim(C.substring(0,G)).length&&C,D=!!C),C&&((w=C.getPrevious())||(l=C.getParent()))):(G&&(w=C.getChild(G-1)||C.getLast()),w||(l=C));for(l=b(l);l||w;){if(l&&!w){!u&&l.equals(h)&&(u=!0);if(f?l.isBlockBoundary():!k.contains(l))break;D&&"inline"==l.getComputedStyle("display")||(D=!1,u?g=l:this.setStartBefore(l));w=l.getPrevious()}for(;w;)if(C=!1,w.type==CKEDITOR.NODE_COMMENT)w=w.getPrevious();else{if(w.type==CKEDITOR.NODE_TEXT)B=w.getText(),d.test(B)&&(w=null),C=/[\s\ufeff]$/.test(B);
|
|
163
|
+
else if((w.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||a&&w.is("br"))&&!w.data("cke-bookmark"))if(D&&CKEDITOR.dtd.$removeEmpty[w.getName()]){B=w.getText();if(d.test(B))w=null;else for(var G=w.$.getElementsByTagName("*"),K=0,H;H=G[K++];)if(!CKEDITOR.dtd.$removeEmpty[H.nodeName.toLowerCase()]){w=null;break}w&&(C=!!B.length)}else w=null;C&&(D?u?g=l:l&&this.setStartBefore(l):D=!0);if(w){C=w.getPrevious();if(!l&&!C){l=w;w=null;break}w=C}else l=null}l&&(l=b(l.getParent()))}C=this.endContainer;G=this.endOffset;
|
|
164
|
+
l=w=null;u=D=!1;C.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(C.substring(G)).length?D=!0:(D=!C.getLength(),G==C.getLength()?(w=C.getNext())||(l=C.getParent()):e(C,G)&&(l=C.getParent())):(w=C.getChild(G))||(l=C);for(;l||w;){if(l&&!w){!u&&l.equals(h)&&(u=!0);if(f?l.isBlockBoundary():!k.contains(l))break;D&&"inline"==l.getComputedStyle("display")||(D=!1,u?m=l:l&&this.setEndAfter(l));w=l.getNext()}for(;w;){C=!1;if(w.type==CKEDITOR.NODE_TEXT)B=w.getText(),e(w,0)||(w=null),C=/^[\s\ufeff]/.test(B);else if(w.type==
|
|
165
|
+
CKEDITOR.NODE_ELEMENT){if((0<w.$.offsetWidth||a&&w.is("br"))&&!w.data("cke-bookmark"))if(D&&CKEDITOR.dtd.$removeEmpty[w.getName()]){B=w.getText();if(d.test(B))w=null;else for(G=w.$.getElementsByTagName("*"),K=0;H=G[K++];)if(!CKEDITOR.dtd.$removeEmpty[H.nodeName.toLowerCase()]){w=null;break}w&&(C=!!B.length)}else w=null}else C=1;C&&D&&(u?m=l:this.setEndAfter(l));if(w){C=w.getNext();if(!l&&!C){l=w;w=null;break}w=C}else l=null}l&&(l=b(l.getParent()))}g&&m&&(h=g.contains(m)?m:g,this.setStartBefore(h),
|
|
166
|
+
this.setEndAfter(h));break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:l=new CKEDITOR.dom.range(this.root);k=this.root;l.setStartAt(k,CKEDITOR.POSITION_AFTER_START);l.setEnd(this.startContainer,this.startOffset);l=new CKEDITOR.dom.walker(l);var E,M,I=CKEDITOR.dom.walker.blockBoundary(c==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),J=null,F=function(c){if(c.type==CKEDITOR.NODE_ELEMENT&&"false"==c.getAttribute("contenteditable"))if(J){if(J.equals(c)){J=null;return}}else J=
|
|
167
167
|
c;else if(J)return;var a=I(c);a||(E=c);return a},f=function(c){var a=F(c);!a&&c.is&&c.is("br")&&(M=c);return a};l.guard=F;l=l.lastBackward();E=E||k;this.setStartAt(E,!E.is("br")&&(!l&&this.checkStartOfBlock()||l&&E.contains(l))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(c==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){l=this.clone();l=new CKEDITOR.dom.walker(l);var L=CKEDITOR.dom.walker.whitespaces(),P=CKEDITOR.dom.walker.bookmark();l.evaluator=function(c){return!L(c)&&!P(c)};if((l=l.previous())&&
|
|
168
168
|
l.type==CKEDITOR.NODE_ELEMENT&&l.is("br"))break}l=this.clone();l.collapse();l.setEndAt(k,CKEDITOR.POSITION_BEFORE_END);l=new CKEDITOR.dom.walker(l);l.guard=c==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?f:F;E=J=M=null;l=l.lastForward();E=E||k;this.setEndAt(E,!l&&this.checkEndOfBlock()||l&&E.contains(l)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START);M&&this.setEndAfter(M)}},shrink:function(c,a,b){var d="boolean"===typeof b?b:b&&"boolean"===typeof b.shrinkOnBlockBoundary?b.shrinkOnBlockBoundary:
|
|
169
|
-
!0,f=b&&b.skipBogus;if(!this.collapsed){c=c||CKEDITOR.SHRINK_TEXT;var e=this.clone(),
|
|
170
|
-
function(a){return a.type==(c==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var D;e.guard=function(a,b){if(f&&
|
|
169
|
+
!0,f=b&&b.skipBogus;if(!this.collapsed){c=c||CKEDITOR.SHRINK_TEXT;var e=this.clone(),h=this.startContainer,k=this.endContainer,g=this.startOffset,m=this.endOffset,l=b=1;h&&h.type==CKEDITOR.NODE_TEXT&&(g?g>=h.getLength()?e.setStartAfter(h):(e.setStartBefore(h),b=0):e.setStartBefore(h));k&&k.type==CKEDITOR.NODE_TEXT&&(m?m>=k.getLength()?e.setEndAfter(k):(e.setEndAfter(k),l=0):e.setEndBefore(k));var e=new CKEDITOR.dom.walker(e),w=CKEDITOR.dom.walker.bookmark(),u=CKEDITOR.dom.walker.bogus();e.evaluator=
|
|
170
|
+
function(a){return a.type==(c==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var D;e.guard=function(a,b){if(f&&u(a)||w(a))return!0;if(c==CKEDITOR.SHRINK_ELEMENT&&a.type==CKEDITOR.NODE_TEXT||b&&a.equals(D)||!1===d&&a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary()||a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable"))return!1;b||a.type!=CKEDITOR.NODE_ELEMENT||(D=a);return!0};b&&(h=e[c==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(h,a?CKEDITOR.POSITION_AFTER_START:
|
|
171
171
|
CKEDITOR.POSITION_BEFORE_START);l&&(e.reset(),(e=e[c==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(e,a?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END));return!(!b&&!l)}},insertNode:function(c){this.optimizeBookmark();this.trim(!1,!0);var a=this.startContainer,b=a.getChild(this.startOffset);b?c.insertBefore(b):a.append(c);c.getParent()&&c.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(c)},moveToPosition:function(c,a){this.setStartAt(c,
|
|
172
|
-
a);this.collapse(!0)},moveToRange:function(
|
|
173
|
-
b){c.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[c.getName()]&&(b=c.getIndex()+1,c=c.getParent());this._setEndContainer(c);this.endOffset=b;this.startContainer||(this._setStartContainer(c),this.startOffset=b);a(this)},setStartAfter:function(
|
|
172
|
+
a);this.collapse(!0)},moveToRange:function(c){this.setStart(c.startContainer,c.startOffset);this.setEnd(c.endContainer,c.endOffset)},selectNodeContents:function(c){this.setStart(c,0);this.setEnd(c,c.type==CKEDITOR.NODE_TEXT?c.getLength():c.getChildCount())},setStart:function(c,b){c.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[c.getName()]&&(b=c.getIndex(),c=c.getParent());this._setStartContainer(c);this.startOffset=b;this.endContainer||(this._setEndContainer(c),this.endOffset=b);a(this)},setEnd:function(c,
|
|
173
|
+
b){c.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[c.getName()]&&(b=c.getIndex()+1,c=c.getParent());this._setEndContainer(c);this.endOffset=b;this.startContainer||(this._setStartContainer(c),this.startOffset=b);a(this)},setStartAfter:function(c){this.setStart(c.getParent(),c.getIndex()+1)},setStartBefore:function(c){this.setStart(c.getParent(),c.getIndex())},setEndAfter:function(c){this.setEnd(c.getParent(),c.getIndex()+1)},setEndBefore:function(c){this.setEnd(c.getParent(),c.getIndex())},setStartAt:function(c,
|
|
174
174
|
b){switch(b){case CKEDITOR.POSITION_AFTER_START:this.setStart(c,0);break;case CKEDITOR.POSITION_BEFORE_END:c.type==CKEDITOR.NODE_TEXT?this.setStart(c,c.getLength()):this.setStart(c,c.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(c);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(c)}a(this)},setEndAt:function(c,b){switch(b){case CKEDITOR.POSITION_AFTER_START:this.setEnd(c,0);break;case CKEDITOR.POSITION_BEFORE_END:c.type==CKEDITOR.NODE_TEXT?this.setEnd(c,
|
|
175
|
-
c.getLength()):this.setEnd(c,c.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(c);break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(c)}a(this)},fixBlock:function(a
|
|
176
|
-
new CKEDITOR.dom.elementPath(this.startContainer,this.root),
|
|
177
|
-
CKEDITOR.POSITION_AFTER_END),
|
|
178
|
-
this.moveToPosition(
|
|
179
|
-
"setStartAt"](
|
|
180
|
-
"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var
|
|
181
|
-
|
|
175
|
+
c.getLength()):this.setEnd(c,c.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(c);break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(c)}a(this)},fixBlock:function(c,a){var b=this.createBookmark(),d=this.document.createElement(a);this.collapse(c);this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);this.extractContents().appendTo(d);d.trim();this.insertNode(d);var f=d.getBogus();f&&f.remove();d.appendBogus();this.moveToBookmark(b);return d},splitBlock:function(c,a){var b=
|
|
176
|
+
new CKEDITOR.dom.elementPath(this.startContainer,this.root),d=new CKEDITOR.dom.elementPath(this.endContainer,this.root),f=b.block,e=d.block,h=null;if(!b.blockLimit.equals(d.blockLimit))return null;"br"!=c&&(f||(f=this.fixBlock(!0,c),e=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block),e||(e=this.fixBlock(!1,c)));b=f&&this.checkStartOfBlock();d=e&&this.checkEndOfBlock();this.deleteContents();f&&f.equals(e)&&(d?(h=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(e,
|
|
177
|
+
CKEDITOR.POSITION_AFTER_END),e=null):b?(h=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START),f=null):(e=this.splitElement(f,a||!1),f.is("ul","ol")||f.appendBogus()));return{previousBlock:f,nextBlock:e,wasStartOfBlock:b,wasEndOfBlock:d,elementPath:h}},splitElement:function(c,a){if(!this.collapsed)return null;this.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);var b=this.extractContents(!1,a||!1),d=c.clone(!1,a||!1);b.appendTo(d);d.insertAfter(c);
|
|
178
|
+
this.moveToPosition(c,CKEDITOR.POSITION_AFTER_END);return d},removeEmptyBlocksAtEnd:function(){function c(c){return function(d){return a(d)||b(d)||d.type==CKEDITOR.NODE_ELEMENT&&d.isEmptyInlineRemoveable()||c.is("table")&&d.is("caption")?!1:!0}}var a=CKEDITOR.dom.walker.whitespaces(),b=CKEDITOR.dom.walker.bookmark(!1);return function(a){for(var b=this.createBookmark(),d=this[a?"endPath":"startPath"](),f=d.block||d.blockLimit,e;f&&!f.equals(d.root)&&!f.getFirst(c(f));)e=f.getParent(),this[a?"setEndAt":
|
|
179
|
+
"setStartAt"](f,CKEDITOR.POSITION_AFTER_END),f.remove(1),f=e;this.moveToBookmark(b)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,this.root)},checkBoundaryOfElement:function(c,a){var b=a==CKEDITOR.START,d=this.clone();d.collapse(b);d[b?"setStartAt":"setEndAt"](c,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=f(b);return d[b?
|
|
180
|
+
"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var c=this.startContainer,a=this.startOffset;CKEDITOR.env.ie&&a&&c.type==CKEDITOR.NODE_TEXT&&(c=CKEDITOR.tools.ltrim(c.substring(0,a)),h.test(c)&&this.trim(0,1));this.trim();c=new CKEDITOR.dom.elementPath(this.startContainer,this.root);a=this.clone();a.collapse(!0);a.setStartAt(c.block||c.blockLimit,CKEDITOR.POSITION_AFTER_START);c=new CKEDITOR.dom.walker(a);c.evaluator=g();return c.checkBackward()},checkEndOfBlock:function(){var c=this.endContainer,
|
|
181
|
+
a=this.endOffset;CKEDITOR.env.ie&&c.type==CKEDITOR.NODE_TEXT&&(c=CKEDITOR.tools.rtrim(c.substring(a)),h.test(c)&&this.trim(1,0));this.trim();c=new CKEDITOR.dom.elementPath(this.endContainer,this.root);a=this.clone();a.collapse(!1);a.setEndAt(c.block||c.blockLimit,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(a);c.evaluator=g();return c.checkForward()},getPreviousNode:function(a,b,d){var f=this.clone();f.collapse(1);f.setStartAt(d||this.root,CKEDITOR.POSITION_AFTER_START);d=new CKEDITOR.dom.walker(f);
|
|
182
182
|
d.evaluator=a;d.guard=b;return d.previous()},getNextNode:function(a,b,d){var f=this.clone();f.collapse();f.setEndAt(d||this.root,CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(f);d.evaluator=a;d.guard=b;return d.next()},checkReadOnly:function(){function a(c,b){for(;c;){if(c.type==CKEDITOR.NODE_ELEMENT){if("false"==c.getAttribute("contentEditable")&&!c.data("cke-editable"))return 0;if(c.is("html")||"true"==c.getAttribute("contentEditable")&&(c.contains(b)||c.equals(b)))break}c=c.getParent()}return 1}
|
|
183
|
-
return function(){var b=this.startContainer,d=this.endContainer;return!(a(b,d)&&a(d,b))}}(),moveToElementEditablePosition:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&!a.isEditable(!1))return this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var f=0;a;){if(a.type==CKEDITOR.NODE_TEXT){b&&this.endContainer&&this.checkEndOfBlock()&&
|
|
184
|
-
CKEDITOR.POSITION_BEFORE_START);f=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable())this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),f=1;else if(b&&a.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);else if("false"==a.getAttribute("contenteditable")&&a.is(CKEDITOR.dtd.$block))return this.setStartBefore(a),this.setEndAfter(a),!0;var e=a,k=f,
|
|
185
|
-
(
|
|
186
|
-
(d.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),d.setEndAt(e,CKEDITOR.POSITION_AFTER_END)):!CKEDITOR.env.needsBrFiller&&
|
|
183
|
+
return function(){var b=this.startContainer,d=this.endContainer;return!(a(b,d)&&a(d,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()&&h.test(a.getText())?this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:
|
|
184
|
+
CKEDITOR.POSITION_BEFORE_START);f=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable())this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),f=1;else if(b&&a.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);else if("false"==a.getAttribute("contenteditable")&&a.is(CKEDITOR.dtd.$block))return this.setStartBefore(a),this.setEndAfter(a),!0;var e=a,k=f,g=void 0;e.type==CKEDITOR.NODE_ELEMENT&&e.isEditable(!1)&&
|
|
185
|
+
(g=e[b?"getLast":"getFirst"](d));k||g||(g=e[b?"getPrevious":"getNext"](d));a=g}return!!f},moveToClosestEditablePosition:function(a,b){var d,f=0,e,h,k=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];a?(d=new CKEDITOR.dom.range(this.root),d.moveToPosition(a,k[b?0:1])):d=this.clone();if(a&&!a.is(CKEDITOR.dtd.$block))f=1;else if(e=d[b?"getNextEditableNode":"getPreviousEditableNode"]())f=1,(h=e.type==CKEDITOR.NODE_ELEMENT)&&e.is(CKEDITOR.dtd.$block)&&"false"==e.getAttribute("contenteditable")?
|
|
186
|
+
(d.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),d.setEndAt(e,CKEDITOR.POSITION_AFTER_END)):!CKEDITOR.env.needsBrFiller&&h&&e.is(CKEDITOR.dom.walker.validEmptyBlockContainers)?(d.setEnd(e,0),d.collapse()):d.moveToPosition(e,k[b?1:0]);f&&this.moveToRange(d);return!!f},moveToElementEditStart:function(a){return this.moveToElementEditablePosition(a)},moveToElementEditEnd:function(a){return this.moveToElementEditablePosition(a,!0)},getEnclosedNode:function(){var a=this.clone();a.optimize();if(a.startContainer.type!=
|
|
187
187
|
CKEDITOR.NODE_ELEMENT||a.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var a=new CKEDITOR.dom.walker(a),b=CKEDITOR.dom.walker.bookmark(!1,!0),d=CKEDITOR.dom.walker.whitespaces(!0);a.evaluator=function(a){return d(a)&&b(a)};var f=a.next();a.reset();return f&&f.equals(a.previous())?f:null},getTouchedStartNode:function(){var a=this.startContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.startOffset)||a},getTouchedEndNode:function(){var a=this.endContainer;return this.collapsed||
|
|
188
188
|
a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.endOffset-1)||a},getNextEditableNode:e(),getPreviousEditableNode:e(1),_getTableElement:function(a){a=a||{td:1,th:1,tr:1,tbody:1,thead:1,tfoot:1,table:1};var b=this.getTouchedStartNode(),d=this.getTouchedEndNode(),f=b.getAscendant("table",!0),d=d.getAscendant("table",!0);return f&&!this.root.contains(f)?null:this.getEnclosedNode()?this.getEnclosedNode().getAscendant(a,!0):f&&d&&(f.equals(d)||f.contains(d)||d.contains(f))?b.getAscendant(a,!0):null},scrollIntoView:function(){var a=
|
|
189
|
-
new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",this.document),b,d,f,e=this.clone();e.optimize();(f=e.startContainer.type==CKEDITOR.NODE_TEXT)?(d=e.startContainer.getText(),b=e.startContainer.split(e.startOffset),a.insertAfter(e.startContainer)):e.insertNode(a);a.scrollIntoView();f&&(e.startContainer.setText(d),b.remove());a.remove()},getClientRects:function(){function a(c,b){var d=CKEDITOR.tools.array.map(c,function(a){return a}),f=new CKEDITOR.dom.range(b.root),e,
|
|
190
|
-
k;b.startContainer instanceof CKEDITOR.dom.element&&(
|
|
189
|
+
new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",this.document),b,d,f,e=this.clone();e.optimize();(f=e.startContainer.type==CKEDITOR.NODE_TEXT)?(d=e.startContainer.getText(),b=e.startContainer.split(e.startOffset),a.insertAfter(e.startContainer)):e.insertNode(a);a.scrollIntoView();f&&(e.startContainer.setText(d),b.remove());a.remove()},getClientRects:function(){function a(c,b){var d=CKEDITOR.tools.array.map(c,function(a){return a}),f=new CKEDITOR.dom.range(b.root),e,h,
|
|
190
|
+
k;b.startContainer instanceof CKEDITOR.dom.element&&(h=0===b.startOffset&&b.startContainer.hasAttribute("data-widget"));b.endContainer instanceof CKEDITOR.dom.element&&(k=(k=b.endOffset===(b.endContainer.getChildCount?b.endContainer.getChildCount():b.endContainer.length))&&b.endContainer.hasAttribute("data-widget"));h&&f.setStart(b.startContainer.getParent(),b.startContainer.getIndex());k&&f.setEnd(b.endContainer.getParent(),b.endContainer.getIndex()+1);if(h||k)b=f;f=b.cloneContents().find("[data-cke-widget-id]").toArray();
|
|
191
191
|
if(f=CKEDITOR.tools.array.map(f,function(a){var c=b.root.editor;a=a.getAttribute("data-cke-widget-id");return c.widgets.instances[a].element}))return f=CKEDITOR.tools.array.map(f,function(a){var c;c=a.getParent().hasClass("cke_widget_wrapper")?a.getParent():a;e=this.root.getDocument().$.createRange();e.setStart(c.getParent().$,c.getIndex());e.setEnd(c.getParent().$,c.getIndex()+1);c=e.getClientRects();c.widgetRect=a.getClientRect();return c},b),CKEDITOR.tools.array.forEach(f,function(a){function c(f){CKEDITOR.tools.array.forEach(d,
|
|
192
|
-
function(c,e){var
|
|
192
|
+
function(c,e){var h=CKEDITOR.tools.objectCompare(a[f],c);h||(h=CKEDITOR.tools.objectCompare(a.widgetRect,c));h&&(Array.prototype.splice.call(d,e,a.length-f,a.widgetRect),b=!0)});b||(f<d.length-1?c(f+1):d.push(a.widgetRect))}var b;c(0)}),d}function b(a,c,d){var e;c.collapsed?d.startContainer instanceof CKEDITOR.dom.element?(a=d.checkStartOfBlock(),e=new CKEDITOR.dom.text(""),a?d.startContainer.append(e,!0):0===d.startOffset?e.insertBefore(d.startContainer.getFirst()):(d=d.startContainer.getChildren().getItem(d.startOffset-
|
|
193
193
|
1),e.insertAfter(d)),c.setStart(e.$,0),c.setEnd(e.$,0),a=c.getClientRects(),e.remove()):d.startContainer instanceof CKEDITOR.dom.text&&(""===d.startContainer.getText()?(d.startContainer.setText(""),a=c.getClientRects(),d.startContainer.setText("")):a=[f(d.createBookmark())]):a=[f(d.createBookmark())];return a}function d(a,c,b){a=CKEDITOR.tools.extend({},a);c&&(a=CKEDITOR.tools.getAbsoluteRectPosition(b.document.getWindow(),a));!a.width&&(a.width=a.right-a.left);!a.height&&(a.height=a.bottom-a.top);
|
|
194
194
|
return a}function f(a){var c=a.startNode;a=a.endNode;var b;c.setText("");c.removeStyle("display");a?(a.setText(""),a.removeStyle("display"),b=[c.getClientRect(),a.getClientRect()],a.remove()):b=[c.getClientRect(),c.getClientRect()];c.remove();return{right:Math.max(b[0].right,b[1].right),bottom:Math.max(b[0].bottom,b[1].bottom),left:Math.min(b[0].left,b[1].left),top:Math.min(b[0].top,b[1].top),width:Math.abs(b[0].left-b[1].left),height:Math.max(b[0].bottom,b[1].bottom)-Math.min(b[0].top,b[1].top)}}
|
|
195
|
-
return void 0!==this.document.getSelection?function(f){var e=this.root.getDocument().$.createRange(),
|
|
196
|
-
b){var d=this.getCommonAncestor(),f=this.getBoundaryNodes(),e=[],
|
|
195
|
+
return void 0!==this.document.getSelection?function(f){var e=this.root.getDocument().$.createRange(),h;e.setStart(this.startContainer.$,this.startOffset);e.setEnd(this.endContainer.$,this.endOffset);h=e.getClientRects();h=a(h,this);h.length||(h=b(h,e,this));return CKEDITOR.tools.array.map(h,function(a){return d(a,f,this)},this)}:function(a){return[d(f(this.createBookmark()),a,this)]}}(),_setStartContainer:function(a){this.startContainer=a},_setEndContainer:function(a){this.endContainer=a},_find:function(a,
|
|
196
|
+
b){var d=this.getCommonAncestor(),f=this.getBoundaryNodes(),e=[],h,k,g,m;if(d&&d.find)for(k=d.find(a),h=0;h<k.count();h++)if(d=k.getItem(h),b||!d.isReadOnly())g=d.getPosition(f.startNode)&CKEDITOR.POSITION_FOLLOWING||f.startNode.equals(d),m=d.getPosition(f.endNode)&CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_IS_CONTAINED||f.endNode.equals(d),g&&m&&e.push(d);return e}};CKEDITOR.dom.range.mergeRanges=function(a){return CKEDITOR.tools.array.reduce(a,function(a,c){var b=a[a.length-1],d=!1;c=c.clone();
|
|
197
197
|
c.enlarge(CKEDITOR.ENLARGE_ELEMENT);if(b){var f=new CKEDITOR.dom.range(c.root),d=new CKEDITOR.dom.walker(f),e=CKEDITOR.dom.walker.whitespaces();f.setStart(b.endContainer,b.endOffset);f.setEnd(c.startContainer,c.startOffset);for(f=d.next();e(f)||c.endContainer.equals(f);)f=d.next();d=!f}d?b.setEnd(c.endContainer,c.endOffset):a.push(c);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
|
-
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 c=[];a.forEach(function(a){if("true"==a.getAttribute("contenteditable"))return c.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return c}function
|
|
199
|
-
f&&(f=l(b));for(var e;e=f.shift();)if(e.getDtd().p){f={element:e,remaining:f};break a}f=null}if(!f)return 0;if((e=CKEDITOR.filter.instances[f.element.data("cke-filter")])&&!e.check(c))return
|
|
200
|
-
a=a.clone();a.collapse(!b);return a.checkBoundaryOfElement(c,b?CKEDITOR.START:CKEDITOR.END)}var e=/^[\r\n\t ]+$/,m=CKEDITOR.dom.walker.bookmark(!1,!0),k=CKEDITOR.dom.walker.whitespaces(!0),
|
|
201
|
-
this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(a);this._.nestedEditable=null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var
|
|
202
|
-
CKEDITOR.POSITION_AFTER_START);k=
|
|
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&&
|
|
204
|
-
1;k=
|
|
205
|
-
"br"!=
|
|
206
|
-
v=this._getNextSourceNode(v,A,
|
|
207
|
-
"li"!=c.getName()?k.checkStartOfBlock()&&k.checkEndOfBlock()||(c=c.clone(!1),k.extractContents().appendTo(c),c.trim(),
|
|
208
|
-
"br"==
|
|
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 c=[];a.forEach(function(a){if("true"==a.getAttribute("contenteditable"))return c.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return c}function g(a,c,b,f){a:{null==
|
|
199
|
+
f&&(f=l(b));for(var e;e=f.shift();)if(e.getDtd().p){f={element:e,remaining:f};break a}f=null}if(!f)return 0;if((e=CKEDITOR.filter.instances[f.element.data("cke-filter")])&&!e.check(c))return g(a,c,b,f.remaining);c=new CKEDITOR.dom.range(f.element);c.selectNodeContents(f.element);c=c.createIterator();c.enlargeBr=a.enlargeBr;c.enforceRealBlocks=a.enforceRealBlocks;c.activeFilter=c.filter=e;a._.nestedEditable={element:f.element,container:b,remaining:f.remaining,iterator:c};return 1}function f(a,c,b){if(!c)return!1;
|
|
200
|
+
a=a.clone();a.collapse(!b);return a.checkBoundaryOfElement(c,b?CKEDITOR.START:CKEDITOR.END)}var e=/^[\r\n\t ]+$/,m=CKEDITOR.dom.walker.bookmark(!1,!0),k=CKEDITOR.dom.walker.whitespaces(!0),h=function(a){return m(a)&&k(a)},b={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var c,k,l,q,t;a=a||"p";if(this._.nestedEditable){if(c=this._.nestedEditable.iterator.getNextParagraph(a))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,c;this.activeFilter=this.filter;if(g(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();k=r.startPath();var v=r.endPath(),y=!r.collapsed&&f(r,k.block),x=!r.collapsed&&f(r,v.block,1);r.shrink(CKEDITOR.SHRINK_ELEMENT,!0);y&&r.setStartAt(k.block,CKEDITOR.POSITION_BEFORE_END);x&&r.setEndAt(v.block,
|
|
202
|
+
CKEDITOR.POSITION_AFTER_START);k=r.endContainer.hasAscendant("pre",!0)||r.startContainer.hasAscendant("pre",!0);r.enlarge(this.forceBrBreak&&!k||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);r.collapsed||(k=new CKEDITOR.dom.walker(r.clone()),v=CKEDITOR.dom.walker.bookmark(!0,!0),k.evaluator=v,this._.nextNode=k.next(),k=new CKEDITOR.dom.walker(r.clone()),k.evaluator=v,k=k.previous(),this._.lastNode=k.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(k)),r=null);this._.started=
|
|
204
|
+
1;k=r}v=this._.nextNode;r=this._.lastNode;for(this._.nextNode=null;v;){var y=0,x=v.hasAscendant("pre"),z=v.type!=CKEDITOR.NODE_ELEMENT,A=0;if(z)v.type==CKEDITOR.NODE_TEXT&&e.test(v.getText())&&(z=0);else{var w=v.getName();if(CKEDITOR.dtd.$block[w]&&"false"==v.getAttribute("contenteditable")){c=v;g(this,a,c);break}else if(v.isBlockBoundary(this.forceBrBreak&&!x&&{br:1})){if("br"==w)z=1;else if(!k&&!v.getChildCount()&&"hr"!=w){c=v;l=v.equals(r);break}k&&(k.setEndAt(v,CKEDITOR.POSITION_BEFORE_START),
|
|
205
|
+
"br"!=w&&(this._.nextNode=v));y=1}else{if(v.getFirst()){k||(k=this.range.clone(),k.setStartAt(v,CKEDITOR.POSITION_BEFORE_START));v=v.getFirst();continue}z=1}}z&&!k&&(k=this.range.clone(),k.setStartAt(v,CKEDITOR.POSITION_BEFORE_START));l=(!y||z)&&v.equals(r);if(k&&!y)for(;!v.getNext(h)&&!l;){w=v.getParent();if(w.isBlockBoundary(this.forceBrBreak&&!x&&{br:1})){y=1;z=0;l||w.equals(r);k.setEndAt(w,CKEDITOR.POSITION_BEFORE_END);break}v=w;z=1;l=v.equals(r);A=1}z&&k.setEndAt(v,CKEDITOR.POSITION_AFTER_END);
|
|
206
|
+
v=this._getNextSourceNode(v,A,r);if((l=!v)||y&&k)break}if(!c){if(!k)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;c=new CKEDITOR.dom.elementPath(k.startContainer,k.root);v=c.blockLimit;y={div:1,th:1,td:1};c=c.block;!c&&v&&!this.enforceRealBlocks&&y[v.getName()]&&k.checkStartOfBlock()&&k.checkEndOfBlock()&&!v.equals(k.root)?c=v:!c||this.enforceRealBlocks&&c.is(b)?(c=this.range.document.createElement(a),k.extractContents().appendTo(c),c.trim(),k.insertNode(c),q=t=!0):
|
|
207
|
+
"li"!=c.getName()?k.checkStartOfBlock()&&k.checkEndOfBlock()||(c=c.clone(!1),k.extractContents().appendTo(c),c.trim(),t=k.splitBlock(),q=!t.wasStartOfBlock,t=!t.wasEndOfBlock,k.insertNode(c)):l||(this._.nextNode=c.equals(r)?null:this._getNextSourceNode(k.getBoundaryNodes().endNode,1,r))}q&&(q=c.getPrevious())&&q.type==CKEDITOR.NODE_ELEMENT&&("br"==q.getName()?q.remove():q.getLast()&&"br"==q.getLast().$.nodeName.toLowerCase()&&q.getLast().remove());t&&(q=c.getLast())&&q.type==CKEDITOR.NODE_ELEMENT&&
|
|
208
|
+
"br"==q.getName()&&(!CKEDITOR.env.needsBrFiller||q.getPrevious(m)||q.getNext(m))&&q.remove();this._.nextNode||(this._.nextNode=l||c.equals(r)||!r?null:this._getNextSourceNode(c,1,r));return c},_getNextSourceNode:function(a,c,b){function f(a){return!(a.equals(b)||a.equals(e))}var e=this.range.root;for(a=a.getNextSourceNode(c,null,f);!m(a);)a=a.getNextSourceNode(c,null,f);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
|
-
arguments)};var
|
|
210
|
+
arguments)};var g;this.checkAllowed=function(f){return f||"boolean"!=typeof g?g=a.activeFilter.checkFeature(this):g};CKEDITOR.tools.extend(this,l,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!l.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)};CKEDITOR.command.prototype={enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(this.preserveState&&"undefined"!=typeof this.previousState?this.previousState:CKEDITOR.TRISTATE_OFF)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},
|
|
211
211
|
setState:function(a){if(this.state==a||a!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return!1;this.previousState=this.state;this.state=a;this.fire("state");return!0},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?this.setState(CKEDITOR.TRISTATE_ON):this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.event.implementOn(CKEDITOR.command.prototype);CKEDITOR.ENTER_P=1;CKEDITOR.ENTER_BR=2;CKEDITOR.ENTER_DIV=3;CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,
|
|
212
|
-
language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"\x3c!DOCTYPE html\x3e",bodyId:"",bodyClass:"",fullPage:!1,height:200,contentsCss:CKEDITOR.getUrl("contents.css"),extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:999999,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]};(function(){function a(a,c,b,d,f){var e,
|
|
213
|
-
typeof
|
|
214
|
-
a.push(
|
|
215
|
-
|
|
216
|
-
for(var d in c)b[d]||(b[d]=a(d));return!1}function f(a,c,b){if(!a.match||a.match(c)){if(a.noProperties)return!1;b.hadInvalidAttribute=e(a.attributes,c.attributes)||b.hadInvalidAttribute;b.hadInvalidStyle=e(a.styles,c.styles)||b.hadInvalidStyle;a=a.classes;c=c.classes;if(a){for(var d=!1,f=!0===a,
|
|
217
|
-
c,b){if(a.disabled||a.customConfig&&!b||!c)return!1;a._.cachedChecks={};return!0}function k(a,c){if(!a)return!1;if(!0===a)return a;if("string"==typeof a)return a=H(a),"*"==a?!0:CKEDITOR.tools.convertArrayToObject(a.split(c));if(CKEDITOR.tools.isArray(a))return a.length?CKEDITOR.tools.convertArrayToObject(a):!1;var b={},d=0,f;for(f in a)b[f]=a[f],d++;return d?b:!1}function
|
|
218
|
-
typeof f){if(-1==CKEDITOR.tools.indexOf(
|
|
219
|
-
b,d,f,e={},
|
|
220
|
-
"$1"));if(d.doCallbacks&&a.elementCallbacks){a:{
|
|
221
|
-
allStyles:!1,hadInvalidAttribute:!1,hadInvalidClass:!1,hadInvalidStyle:!1},
|
|
222
|
-
|
|
223
|
-
m&&n.length<m.split(/\s+/).length&&(
|
|
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 y(a){if(!a)return!1;if(!0===a)return!0;var c=
|
|
225
|
-
(a.parent&&b.push({check:"it",el:a.parent}),a.remove());else if(G.$block[d]||"tr"==d)if("br"==c)a.previous&&!z(a.previous)&&(c=
|
|
226
|
-
|
|
227
|
-
c,b){var d,f;for(d=0;d<b.length;++d)if(f=b[d],!(f.check&&!a.check(f.check,!1)||f.left&&!f.left(c))){f.right(c,N);break}}function
|
|
228
|
-
a:(b=a[0],d=a[1]);return[{element:b,left:d,right:function(a,b){b.transform(a,c)}}]}function C(a){return function(c){return
|
|
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,c,b,d,f){var e,h;a=[];for(e in c){h=c[e];h="boolean"==
|
|
213
|
+
typeof h?{}:"function"==typeof h?{match:h}:K(h);"$"!=e.charAt(0)&&(h.elements=e);b&&(h.featureName=b.toLowerCase());var g=h;g.elements=k(g.elements,/\s+/)||null;g.propertiesOnly=g.propertiesOnly||!0===g.elements;var m=/\s*,\s*/,l=void 0;for(l in M){g[l]=k(g[l],m)||null;var w=g,n=I[l],u=k(g[I[l]],m),v=g[l],F=[],P=!0,p=void 0;u?P=!1:u={};for(p in v)"!"==p.charAt(0)&&(p=p.slice(1),F.push(p),u[p]=!0,P=!1);for(;p=F.pop();)v[p]=v["!"+p],delete v["!"+p];w[n]=(P?!1:u)||null}g.match=g.match||null;d.push(h);
|
|
214
|
+
a.push(h)}c=f.elements;f=f.generic;var D;b=0;for(d=a.length;b<d;++b){e=K(a[b]);h=!0===e.classes||!0===e.styles||!0===e.attributes;g=e;l=n=m=void 0;for(m in M)g[m]=y(g[m]);w=!0;for(l in I){m=I[l];n=g[m];u=[];v=void 0;for(v in n)-1<v.indexOf("*")?u.push(new RegExp("^"+v.replace(/\*/g,".*")+"$")):u.push(v);n=u;n.length&&(g[m]=n,w=!1)}g.nothingRequired=w;g.noProperties=!(g.attributes||g.classes||g.styles);if(!0===e.elements||null===e.elements)f[h?"unshift":"push"](e);else for(D in g=e.elements,delete e.elements,
|
|
215
|
+
g)if(c[D])c[D][h?"unshift":"push"](e);else c[D]=[e]}}function l(a,c,b,d){if(!a.match||a.match(c))if(d||h(a,c))if(a.propertiesOnly||(b.valid=!0),b.allAttributes||(b.allAttributes=g(a.attributes,c.attributes,b.validAttributes)),b.allStyles||(b.allStyles=g(a.styles,c.styles,b.validStyles)),!b.allClasses){a=a.classes;c=c.classes;d=b.validClasses;if(a)if(!0===a)a=!0;else{for(var f=0,e=c.length,k;f<e;++f)k=c[f],d[k]||(d[k]=a(k));a=!1}else a=!1;b.allClasses=a}}function g(a,c,b){if(!a)return!1;if(!0===a)return!0;
|
|
216
|
+
for(var d in c)b[d]||(b[d]=a(d));return!1}function f(a,c,b){if(!a.match||a.match(c)){if(a.noProperties)return!1;b.hadInvalidAttribute=e(a.attributes,c.attributes)||b.hadInvalidAttribute;b.hadInvalidStyle=e(a.styles,c.styles)||b.hadInvalidStyle;a=a.classes;c=c.classes;if(a){for(var d=!1,f=!0===a,h=c.length;h--;)if(f||a(c[h]))c.splice(h,1),d=!0;a=d}else a=!1;b.hadInvalidClass=a||b.hadInvalidClass}}function e(a,c){if(!a)return!1;var b=!1,d=!0===a,f;for(f in c)if(d||a(f))delete c[f],b=!0;return b}function m(a,
|
|
217
|
+
c,b){if(a.disabled||a.customConfig&&!b||!c)return!1;a._.cachedChecks={};return!0}function k(a,c){if(!a)return!1;if(!0===a)return a;if("string"==typeof a)return a=H(a),"*"==a?!0:CKEDITOR.tools.convertArrayToObject(a.split(c));if(CKEDITOR.tools.isArray(a))return a.length?CKEDITOR.tools.convertArrayToObject(a):!1;var b={},d=0,f;for(f in a)b[f]=a[f],d++;return d?b:!1}function h(a,c){if(a.nothingRequired)return!0;var d,f,e,h;if(e=a.requiredClasses)for(h=c.classes,d=0;d<e.length;++d)if(f=e[d],"string"==
|
|
218
|
+
typeof f){if(-1==CKEDITOR.tools.indexOf(h,f))return!1}else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(h,f))return!1;return b(c.styles,a.requiredStyles)&&b(c.attributes,a.requiredAttributes)}function b(a,c){if(!c)return!0;for(var b=0,d;b<c.length;++b)if(d=c[b],"string"==typeof d){if(!(d in a))return!1}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a,d))return!1;return!0}function d(a){if(!a)return{};a=a.split(/\s*,\s*/).sort();for(var c={};a.length;)c[a.shift()]="cke-test";return c}function c(a){var c,
|
|
219
|
+
b,d,f,e={},h=1;for(a=H(a);c=a.match(J);)(b=c[2])?(d=n(b,"styles"),f=n(b,"attrs"),b=n(b,"classes")):d=f=b=null,e["$"+h++]={elements:c[1],classes:b,styles:d,attributes:f},a=a.slice(c[0].length);return e}function n(a,c){var b=a.match(F[c]);return b?H(b[1]):null}function p(a){var c=a.styleBackup=a.attributes.style,b=a.classBackup=a.attributes["class"];a.styles||(a.styles=CKEDITOR.tools.parseCssText(c||"",1));a.classes||(a.classes=b?b.split(/\s+/):[])}function q(a,c,b,d){var e=0,h;d.toHtml&&(c.name=c.name.replace(L,
|
|
220
|
+
"$1"));if(d.doCallbacks&&a.elementCallbacks){a:{h=a.elementCallbacks;for(var k=0,g=h.length,m;k<g;++k)if(m=h[k](c)){h=m;break a}h=void 0}if(h)return h}if(d.doTransform&&(h=a._.transformations[c.name])){p(c);for(k=0;k<h.length;++k)w(a,c,h[k]);r(c)}if(d.doFilter){a:{k=c.name;g=a._;a=g.allowedRules.elements[k];h=g.allowedRules.generic;k=g.disallowedRules.elements[k];g=g.disallowedRules.generic;m=d.skipRequired;var n={valid:!1,validAttributes:{},validClasses:{},validStyles:{},allAttributes:!1,allClasses:!1,
|
|
221
|
+
allStyles:!1,hadInvalidAttribute:!1,hadInvalidClass:!1,hadInvalidStyle:!1},u,F;if(a||h){p(c);if(k)for(u=0,F=k.length;u<F;++u)if(!1===f(k[u],c,n)){a=null;break a}if(g)for(u=0,F=g.length;u<F;++u)f(g[u],c,n);if(a)for(u=0,F=a.length;u<F;++u)l(a[u],c,n,m);if(h)for(u=0,F=h.length;u<F;++u)l(h[u],c,n,m);a=n}else a=null}if(!a||!a.valid)return b.push(c),1;F=a.validAttributes;var y=a.validStyles;h=a.validClasses;var k=c.attributes,D=c.styles,g=c.classes;m=c.classBackup;var x=c.styleBackup,H,G,C=[],n=[],q=/^data-cke-/;
|
|
222
|
+
u=!1;delete k.style;delete k["class"];delete c.classBackup;delete c.styleBackup;if(!a.allAttributes)for(H in k)F[H]||(q.test(H)?H==(G=H.replace(/^data-cke-saved-/,""))||F[G]||(delete k[H],u=!0):(delete k[H],u=!0));if(!a.allStyles||a.hadInvalidStyle){for(H in D)a.allStyles||y[H]?C.push(H+":"+D[H]):u=!0;C.length&&(k.style=C.sort().join("; "))}else x&&(k.style=x);if(!a.allClasses||a.hadInvalidClass){for(H=0;H<g.length;++H)(a.allClasses||h[g[H]])&&n.push(g[H]);n.length&&(k["class"]=n.sort().join(" "));
|
|
223
|
+
m&&n.length<m.split(/\s+/).length&&(u=!0)}else m&&(k["class"]=m);u&&(e=1);if(!d.skipFinalValidation&&!v(c))return b.push(c),1}d.toHtml&&(c.name=c.name.replace(P,"cke:$1"));return e}function t(a){var c=[],b;for(b in a)-1<b.indexOf("*")&&c.push(b.replace(/\*/g,".*"));return c.length?new RegExp("^(?:"+c.join("|")+")$"):null}function r(a){var c=a.attributes,b;delete c.style;delete c["class"];if(b=CKEDITOR.tools.writeCssText(a.styles,!0))c.style=b;a.classes.length&&(c["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 y(a){if(!a)return!1;if(!0===a)return!0;var c=t(a);return function(b){return b in a||c&&b.match(c)}}function x(){return new CKEDITOR.htmlParser.element("br")}function z(a){return a.type==CKEDITOR.NODE_ELEMENT&&("br"==a.name||G.$block[a.name])}function A(a,c,b){var d=a.name;if(G.$empty[d]||!a.children.length)"hr"==d&&"br"==c?a.replaceWith(x()):
|
|
225
|
+
(a.parent&&b.push({check:"it",el:a.parent}),a.remove());else if(G.$block[d]||"tr"==d)if("br"==c)a.previous&&!z(a.previous)&&(c=x(),c.insertBefore(a)),a.next&&!z(a.next)&&(c=x(),c.insertAfter(a)),a.replaceWithChildren();else{var d=a.children,f;b:{f=G[c];for(var e=0,h=d.length,k;e<h;++e)if(k=d[e],k.type==CKEDITOR.NODE_ELEMENT&&!f[k.name]){f=!1;break b}f=!0}if(f)a.name=c,a.attributes={},b.push({check:"parent-down",el:a});else{f=a.parent;for(var e=f.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||"body"==f.name,
|
|
226
|
+
g,m,h=d.length;0<h;)k=d[--h],e&&(k.type==CKEDITOR.NODE_TEXT||k.type==CKEDITOR.NODE_ELEMENT&&G.$inline[k.name])?(g||(g=new CKEDITOR.htmlParser.element(c),g.insertAfter(a),b.push({check:"parent-down",el:g})),g.add(k,0)):(g=null,m=G[f.name]||G.span,k.insertAfter(a),f.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||k.type!=CKEDITOR.NODE_ELEMENT||m[k.name]||b.push({check:"el-up",el:k}));a.remove()}}else d in{style:1,script:1}?a.remove():(a.parent&&b.push({check:"it",el:a.parent}),a.replaceWithChildren())}function w(a,
|
|
227
|
+
c,b){var d,f;for(d=0;d<b.length;++d)if(f=b[d],!(f.check&&!a.check(f.check,!1)||f.left&&!f.left(c))){f.right(c,N);break}}function u(a,c){var b=c.getDefinition(),d=b.attributes,f=b.styles,e,h,k,g;if(a.name!=b.element)return!1;for(e in d)if("class"==e)for(b=d[e].split(/\s+/),k=a.classes.join("|");g=b.pop();){if(-1==k.indexOf(g))return!1}else if(a.attributes[e]!=d[e])return!1;for(h in f)if(a.styles[h]!=f[h])return!1;return!0}function D(a,c){var b,d;"string"==typeof a?b=a:a instanceof CKEDITOR.style?d=
|
|
228
|
+
a:(b=a[0],d=a[1]);return[{element:b,left:d,right:function(a,b){b.transform(a,c)}}]}function C(a){return function(c){return u(c,a)}}function B(a){return function(c,b){b[a](c)}}var G=CKEDITOR.dtd,K=CKEDITOR.tools.copy,H=CKEDITOR.tools.trim,E=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2;CKEDITOR.filter=function(a,c){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 b=this.editor=a instanceof CKEDITOR.editor?a:null;if(b&&!c){this.customConfig=!0;var d=b.config.allowedContent;!0===d?this.disabled=!0:(d||(this.customConfig=!1),this.allow(d,"config",1),this.allow(b.config.extraAllowedContent,"extra",1),this.allow(E[b.enterMode]+" "+E[b.shiftEnterMode],"default",1),this.disallow(b.config.disallowedContent))}else this.customConfig=
|
|
230
|
-
!1,this.allow(c||a,"default",1)};CKEDITOR.filter.instances={};CKEDITOR.filter.prototype={allow:function(b,d,f){if(!m(this,b,f))return!1;var e,
|
|
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)
|
|
232
|
-
if(!c||"span"!=a.name||!~CKEDITOR.tools.object.keys(a.attributes).join("|").indexOf("data-cke-"))if(k=
|
|
233
|
-
|
|
234
|
-
|
|
230
|
+
!1,this.allow(c||a,"default",1)};CKEDITOR.filter.instances={};CKEDITOR.filter.prototype={allow:function(b,d,f){if(!m(this,b,f))return!1;var e,h;if("string"==typeof b)b=c(b);else if(b instanceof CKEDITOR.style){if(b.toAllowedContentRules)return this.allow(b.toAllowedContentRules(this.editor),d,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=K(f),e.classes=f["class"]?f["class"].split(/\s+/):null,e.requiredClasses=
|
|
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)h=this.allow(b[e],d,f);return h}a(this,b,d,this.allowedContent,this._.allowedRules);return!0},applyTo:function(a,c,b,d){if(this.disabled)return!1;var f=this,e=[],h=this.editor&&this.editor.config.protectedSource,k,g=!1,m={doFilter:!b,doTransform:!0,doCallbacks:!0,toHtml:c};a.forEach(function(a){if(a.type==CKEDITOR.NODE_ELEMENT){if("off"==a.attributes["data-cke-filter"])return!1;
|
|
232
|
+
if(!c||"span"!=a.name||!~CKEDITOR.tools.object.keys(a.attributes).join("|").indexOf("data-cke-"))if(k=q(f,a,e,m),k&1)g=!0;else if(k&2)return!1}else if(a.type==CKEDITOR.NODE_COMMENT&&a.value.match(/^\{cke_protected\}(?!\{C\})/)){var b;a:{var d=decodeURIComponent(a.value.replace(/^\{cke_protected\}/,""));b=[];var l,w,n;if(h)for(w=0;w<h.length;++w)if((n=d.match(h[w]))&&n[0].length==d.length){b=!0;break a}d=CKEDITOR.htmlParser.fragment.fromHtml(d);1==d.children.length&&(l=d.children[0]).type==CKEDITOR.NODE_ELEMENT&&
|
|
233
|
+
q(f,l,b,m);b=!b.length}b||e.push(a)}},null,!0);e.length&&(g=!0);var l;a=[];d=E[d||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)];for(var w;b=e.pop();)b.type==CKEDITOR.NODE_ELEMENT?A(b,d,a):b.remove();for(;l=a.pop();)if(b=l.el,b.parent)switch(w=G[b.parent.name]||G.span,l.check){case "it":G.$removeEmpty[b.name]&&!b.children.length?A(b,d,a):v(b)||A(b,d,a);break;case "el-up":b.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||w[b.name]||A(b,d,a);break;case "parent-down":b.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||
|
|
234
|
+
w[b.name]||A(b.parent,d,a)}return g},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=c(b));a(this,b,null,this.disallowedContent,this._.disallowedRules);return!0},addContentForms:function(a){if(!this.disabled&&a){var c,b,d=[],f;for(c=0;c<a.length&&!f;++c)b=a[c],("string"==typeof b||b instanceof
|
|
235
235
|
CKEDITOR.style)&&this.check(b)&&(f=b);if(f){for(c=0;c<a.length;++c)d.push(D(a[c],f));this.addTransformations(d)}}},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 c,b;if(!this.disabled&&a){var d=this._.transformations,f;for(f=0;f<a.length;++f){c=a[f];var e=void 0,
|
|
237
|
-
right:"string"==typeof l?B(l):l});c=e;d[c]||(d[c]=[]);d[c].push(b)}}},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
|
|
238
|
-
(
|
|
239
|
-
b,skipRequired:!f,skipFinalValidation:!f});0<m.length?f=!1:((b=
|
|
236
|
+
this.check(a.requiredContent):!0},addTransformations:function(a){var c,b;if(!this.disabled&&a){var d=this._.transformations,f;for(f=0;f<a.length;++f){c=a[f];var e=void 0,h=void 0,k=void 0,g=void 0,m=void 0,l=void 0;b=[];for(h=0;h<c.length;++h)k=c[h],"string"==typeof k?(k=k.split(/\s*:\s*/),g=k[0],m=null,l=k[1]):(g=k.check,m=k.left,l=k.right),e||(e=k,e=e.element?e.element:g?g.match(/^([a-z0-9]+)/i)[0]:e.left.getDefinition().element),m instanceof CKEDITOR.style&&(m=C(m)),b.push({check:g==e?null:g,left:m,
|
|
237
|
+
right:"string"==typeof l?B(l):l});c=e;d[c]||(d[c]=[]);d[c].push(b)}}},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 h,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];h=c(a).$1;var g=h.styles,e=h.classes;h.name=h.elements;h.classes=e=e?e.split(/\s*,\s*/):[];h.styles=d(g);h.attributes=d(h.attributes);h.children=[];e.length&&
|
|
238
|
+
(h.attributes["class"]=e.join(" "));g&&(h.attributes.style=CKEDITOR.tools.writeCssText(h.styles))}else h=a.getDefinition(),g=h.styles,e=h.attributes||{},g&&!CKEDITOR.tools.isEmpty(g)?(g=K(g),e.style=CKEDITOR.tools.writeCssText(g,!0)):g={},h={name:h.element,attributes:e,classes:e["class"]?e["class"].split(/\s+/):[],styles:g,children:[]};var g=CKEDITOR.tools.clone(h),m=[],l;if(!1!==b&&(l=this._.transformations[h.name])){for(e=0;e<l.length;++e)w(this,h,l[e]);r(h)}q(this,g,m,{doFilter:!0,doTransform:!1!==
|
|
239
|
+
b,skipRequired:!f,skipFinalValidation:!f});0<m.length?f=!1:((b=h.attributes["class"])&&(h.attributes["class"]=h.attributes["class"].split(" ").sort().join(" ")),f=CKEDITOR.tools.objectCompare(h.attributes,g.attributes,!0),b&&(h.attributes["class"]=b));"string"==typeof a&&(this._.cachedChecks[k]=f);return f},getAllowedEnterMode:function(){var a=["p","div","br"],c={p:CKEDITOR.ENTER_P,div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR};return function(b,d){var f=a.slice(),e;if(this.check(E[b]))return b;for(d||
|
|
240
240
|
(f=f.reverse());e=f.pop();)if(this.check(e))return c[e];return CKEDITOR.ENTER_BR}}(),clone:function(){var a=new CKEDITOR.filter,c=CKEDITOR.tools.clone;a.allowedContent=c(this.allowedContent);a._.allowedRules=c(this._.allowedRules);a.disallowedContent=c(this.disallowedContent);a._.disallowedRules=c(this._.disallowedRules);a._.transformations=c(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
241
|
delete this.disallowedContent}};var M={styles:1,attributes:1,classes:1},I={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:/\(([^\)]+)\)/},L=/^cke:(object|embed|param)$/,P=/^(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,c,b){b=b||c;if(!(b in a.styles)){var d=a.attributes[c];d&&(/^\d+$/.test(d)&&(d+="px"),a.styles[b]=d)}delete a.attributes[c]},lengthToAttribute:function(a,c,b){b=b||c;if(!(b in a.attributes)){var d=a.styles[c],f=d&&d.match(/^(\d+)(?:\.\d*)?px$/);f?a.attributes[b]=f[1]:"cke-test"==d&&(a.attributes[b]="cke-test")}delete a.styles[c]},alignmentToStyle:function(a){if(!("float"in
|
|
243
243
|
a.styles)){var c=a.attributes.align;if("left"==c||"right"==c)a.styles["float"]=c}delete a.attributes.align},alignmentToAttribute:function(a){if(!("align"in a.attributes)){var c=a.styles["float"];if("left"==c||"right"==c)a.attributes.align=c}delete a.styles["float"]},splitBorderShorthand:function(a){if(a.styles.border){var c=CKEDITOR.tools.style.parse.border(a.styles.border);c.color&&(a.styles["border-color"]=c.color);c.style&&(a.styles["border-style"]=c.style);c.width&&(a.styles["border-width"]=c.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 c(d){a.styles["margin-top"]=
|
|
245
|
-
b[d[0]];a.styles["margin-right"]=b[d[1]];a.styles["margin-bottom"]=b[d[2]];a.styles["margin-left"]=b[d[3]]}if(a.styles.margin){var b=a.styles.margin.match(/(\-?[\.\d]+\w+)/g)||["0px"];switch(b.length){case 1:c([0,0,0,0]);break;case 2:c([0,1,0,1]);break;case 3:c([0,1,2,1]);break;case 4:c([0,1,2,3])}delete a.styles.margin}},matchesStyle:
|
|
246
|
-
a.classes.join("|"),k=f[e].split(/\s+/);
|
|
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
|
|
248
|
-
l.call(this)},
|
|
249
|
-
var l=a.removeCustomData("focusmanager_handlers");a.removeListener("blur",l.blur);a.removeListener("focus",l.focus)}}})();CKEDITOR.keystrokeHandler=function(a){if(a.keystrokeHandler)return a.keystrokeHandler;this.keystrokes={};this.blockedKeystrokes={};this._={editor:a};return this};(function(){var a,l=function(f){f=f.data;var e=f.getKeystroke(),
|
|
250
|
-
a&&f.preventDefault(!0);return!a},
|
|
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,
|
|
252
|
-
a;var f=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),e=f[1],f=f[2];
|
|
253
|
-
c(f))},
|
|
254
|
-
null;d.$.onerror=null;
|
|
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
|
|
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,
|
|
257
|
-
a.length;b++){var d=a[b];if(d)if(f[d]||e[d])
|
|
258
|
-
CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var l={};return function(
|
|
259
|
-
d.push(h
|
|
260
|
-
CKEDITOR.ui.prototype={add:function(a,l,
|
|
245
|
+
b[d[0]];a.styles["margin-right"]=b[d[1]];a.styles["margin-bottom"]=b[d[2]];a.styles["margin-left"]=b[d[3]]}if(a.styles.margin){var b=a.styles.margin.match(/(\-?[\.\d]+\w+)/g)||["0px"];switch(b.length){case 1:c([0,0,0,0]);break;case 2:c([0,1,0,1]);break;case 3:c([0,1,2,1]);break;case 4:c([0,1,2,3])}delete a.styles.margin}},matchesStyle:u,transform:function(a,c){if("string"==typeof c)a.name=c;else{var b=c.getDefinition(),d=b.styles,f=b.attributes,e,h,k,g;a.name=b.element;for(e in f)if("class"==e)for(b=
|
|
246
|
+
a.classes.join("|"),k=f[e].split(/\s+/);g=k.pop();)-1==b.indexOf(g)&&a.classes.push(g);else a.attributes[e]=f[e];for(h in d)a.styles[h]=d[h]}}}})();(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
|
+
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 g=CKEDITOR.focusManager._.blurDelay;a||!g?l.call(this):this._.timer=CKEDITOR.tools.setTimeout(function(){delete this._.timer;
|
|
248
|
+
l.call(this)},g,this)}},add:function(a,l){var g=a.getCustomData("focusmanager");if(!g||g!=this){g&&g.remove(a);var g="focus",f="blur";l&&(CKEDITOR.env.ie?(g="focusin",f="focusout"):CKEDITOR.event.useCapture=1);var e={blur:function(){a.equals(this.currentActive)&&this.blur()},focus:function(){this.focus(a)}};a.on(g,e.focus,this);a.on(f,e.blur,this);l&&(CKEDITOR.event.useCapture=0);a.setCustomData("focusmanager",this);a.setCustomData("focusmanager_handlers",e)}},remove:function(a){a.removeCustomData("focusmanager");
|
|
249
|
+
var l=a.removeCustomData("focusmanager_handlers");a.removeListener("blur",l.blur);a.removeListener("focus",l.focus)}}})();CKEDITOR.keystrokeHandler=function(a){if(a.keystrokeHandler)return a.keystrokeHandler;this.keystrokes={};this.blockedKeystrokes={};this._={editor:a};return this};(function(){var a,l=function(f){f=f.data;var e=f.getKeystroke(),g=this.keystrokes[e],k=this._.editor;a=!1===k.fire("key",{keyCode:e,domEvent:f});a||(g&&(a=!1!==k.execCommand(g,{from:"keystrokeHandler"})),a||(a=!!this.blockedKeystrokes[e]));
|
|
250
|
+
a&&f.preventDefault(!0);return!a},g=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",g,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
|
+
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,g){a&&CKEDITOR.lang.languages[a]||(a=this.detect(l,a));var f=this;l=function(){f[a].dir=f.rtl[a]?"rtl":"ltr";g(a,f[a])};this[a]?l():CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+a+".js"),l,this)},detect:function(a,l){var g=this.languages;l=l||navigator.userLanguage||navigator.language||
|
|
252
|
+
a;var f=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),e=f[1],f=f[2];g[e+"-"+f]?e=e+"-"+f:g[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(g,f,e,m){var k="string"==typeof g;k&&(g=[g]);e||(e=CKEDITOR);var h=g.length,b=[],d=[],c=function(a){f&&(k?f.call(e,a):f.call(e,b,d))};if(0===h)c(!0);else{var n=function(a,f){(f?b:d).push(a);0>=--h&&(m&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),
|
|
253
|
+
c(f))},p=function(c,b){a[c]=1;var d=l[c];delete l[c];for(var f=0;f<d.length;f++)d[f](c,b)},q=function(c){if(a[c])n(c,!0);else{var b=l[c]||(l[c]=[]);b.push(n);if(!(1<b.length)){var d=new CKEDITOR.dom.element("script");d.setAttributes({type:"text/javascript",src:c});f&&(CKEDITOR.env.ie&&(8>=CKEDITOR.env.version||CKEDITOR.env.ie9Compat)?d.$.onreadystatechange=function(){if("loaded"==d.$.readyState||"complete"==d.$.readyState)d.$.onreadystatechange=null,p(c,!0)}:(d.$.onload=function(){setTimeout(function(){d.$.onload=
|
|
254
|
+
null;d.$.onerror=null;p(c,!0)},0)},d.$.onerror=function(){d.$.onload=null;d.$.onerror=null;p(c,!1)}));d.appendTo(CKEDITOR.document.getHead())}}};m&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var t=0;t<h;t++)q(g[t])}},queue:function(){function a(){var e;(e=f[0])&&this.load(e.scriptUrl,e.callback,CKEDITOR,0)}var f=[];return function(e,m){var k=this;f.push({scriptUrl:e,callback:function(){m&&m.apply(this,arguments);f.shift();a.call(k)}});1==f.length&&a.call(this)}}()}}();CKEDITOR.resourceManager=
|
|
255
|
+
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 g=this.registered[a]=l||{};g.name=a;g.path=this.getPath(a);CKEDITOR.fire(a+CKEDITOR.tools.capitalize(this.fileName)+"Ready",g);return this.get(a)},get:function(a){return this.registered[a]||null},getPath:function(a){var l=
|
|
256
|
+
this.externals[a];return CKEDITOR.getUrl(l&&l.dir||this.basePath+a+"/")},getFilePath:function(a){var l=this.externals[a];return CKEDITOR.getUrl(this.getPath(a)+(l?l.file:this.fileName+".js"))},addExternal:function(a,l,g){g||(l=l.replace(/[^\/]+$/,function(a){g=a;return""}));g=g||this.fileName+".js";a=a.split(",");for(var f=0;f<a.length;f++)this.externals[a[f]]={dir:l,file:g}},load:function(a,l,g){CKEDITOR.tools.isArray(a)||(a=a?[a]:[]);for(var f=this.loaded,e=this.registered,m=[],k={},h={},b=0;b<
|
|
257
|
+
a.length;b++){var d=a[b];if(d)if(f[d]||e[d])h[d]=this.get(d);else{var c=this.getFilePath(d);m.push(c);c in k||(k[c]=[]);k[c].push(d)}}CKEDITOR.scriptLoader.load(m,function(a,c){if(c.length)throw Error('[CKEDITOR.resourceManager.load] Resource name "'+k[c[0]].join(",")+'" was not found at "'+c[0]+'".');for(var b=0;b<a.length;b++)for(var d=k[a[b]],e=0;e<d.length;e++){var m=d[e];h[m]=this.get(m);f[m]=1}l.call(g,h)},this)}};CKEDITOR.plugins=new CKEDITOR.resourceManager("plugins/","plugin");CKEDITOR.plugins.load=
|
|
258
|
+
CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var l={};return function(g,f,e){var m={},k=function(h){a.call(this,h,function(a){CKEDITOR.tools.extend(m,a);var d=[],c;for(c in a){var h=a[c],g=h&&h.requires;if(!l[c]){if(h.icons)for(var q=h.icons.split(","),t=q.length;t--;)CKEDITOR.skin.addIcon(q[t],h.path+"icons/"+(CKEDITOR.env.hidpi&&h.hidpi?"hidpi/":"")+q[t]+".png");h.isSupportedEnvironment=h.isSupportedEnvironment||function(){return!0};l[c]=1}if(g)for(g.split&&(g=g.split(",")),h=0;h<g.length;h++)m[g[h]]||
|
|
259
|
+
d.push(g[h])}if(d.length)k.call(this,d);else{for(c in m)h=m[c],h.onLoad&&!h.onLoad._called&&(!1===h.onLoad()&&delete m[c],h.onLoad._called=1);f&&f.call(e||window,m)}},this)};k.call(this,g)}});CKEDITOR.plugins.setLang=function(a,l,g){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]=g};CKEDITOR.ui=function(a){if(a.ui)return a.ui;this.items={};this.instances={};this.editor=a;this._={handlers:{}};return this};
|
|
260
|
+
CKEDITOR.ui.prototype={add:function(a,l,g){g.name=a.toLowerCase();var f=this.items[a]={type:l,command:g.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(f,g)},get:function(a){return this.instances[a]},create:function(a){var l=this.items[a],g=l&&this._.handlers[l.type],f=l&&l.command&&this.editor.getCommand(l.command),g=g&&g.create.apply(this,l.args);this.instances[a]=g;f&&f.uiItems.push(g);g&&!g.type&&(g.type=l.type);return g},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,c,b){CKEDITOR.event.call(this);a=a&&CKEDITOR.tools.clone(a);if(void 0!==c){if(!(c instanceof CKEDITOR.dom.element))throw Error("Expect element of type CKEDITOR.dom.element.");if(!b)throw Error("One of the element modes must be specified.");if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&b==CKEDITOR.ELEMENT_MODE_INLINE)throw Error("Inline element mode is not supported on IE quirks.");
|
|
262
|
-
if(!
|
|
262
|
+
if(!g(c,b))throw Error('The specified element mode is not supported on element: "'+c.getName()+'".');this.element=c;this.elementMode=b;this.name=this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO&&(c.getId()||c.getNameAtt())}else this.elementMode=CKEDITOR.ELEMENT_MODE_NONE;this._={};this.commands={};this.templates={};this.name=this.name||l();this.id=CKEDITOR.tools.getNextId();this.status="unloaded";this.config=CKEDITOR.tools.prototypedCopy(CKEDITOR.config);this.ui=new CKEDITOR.ui(this);this.focusManager=
|
|
263
263
|
new CKEDITOR.focusManager(this);this.keystrokeHandler=new CKEDITOR.keystrokeHandler(this);this.on("readOnly",f);this.on("selectionChange",function(a){m(this,a.data.path)});this.on("activeFilterChange",function(){m(this,this.elementPath(),!0)});this.on("mode",f);CKEDITOR.dom.selection.setupEditorOptimization(this);this.on("instanceReady",function(){if(this.config.startupFocus){if("end"===this.config.startupFocus){var a=this.createRange();a.selectNodeContents(this.editable());a.shrink(CKEDITOR.SHRINK_ELEMENT,
|
|
264
|
-
!0);a.collapse();this.getSelection().selectRanges([a])}this.focus()}});CKEDITOR.fire("instanceCreated",null,this);CKEDITOR.add(this);CKEDITOR.tools.setTimeout(function(){this.isDestroyed()||this.isDetached()||
|
|
265
|
-
c;for(c in a)e(this,a[c])}function e(a,c){c[c.startDisabled?"disable":a.readOnly&&!c.readOnly?"disable":c.modes[a.mode]?"enable":"disable"]()}function m(a,c,b){if(c){var d,f,e=a.commands;for(f in e)d=e[f],(b||d.contextSensitive)&&d.refresh(a,c)}}function k(a){var c=a.config.customConfig;if(!c)return!1;var c=CKEDITOR.getUrl(c),b=
|
|
266
|
-
CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){};k(a)});return!0}function
|
|
264
|
+
!0);a.collapse();this.getSelection().selectRanges([a])}this.focus()}});CKEDITOR.fire("instanceCreated",null,this);CKEDITOR.add(this);CKEDITOR.tools.setTimeout(function(){this.isDestroyed()||this.isDetached()||h(this,a)},0,this)}function l(){do var a="editor"+ ++t;while(CKEDITOR.instances[a]);return a}function g(a,c){return c==CKEDITOR.ELEMENT_MODE_INLINE?a.is(CKEDITOR.dtd.$editable)||a.is("textarea"):c==CKEDITOR.ELEMENT_MODE_REPLACE?!a.is(CKEDITOR.dtd.$nonBodyContent):1}function f(){var a=this.commands,
|
|
265
|
+
c;for(c in a)e(this,a[c])}function e(a,c){c[c.startDisabled?"disable":a.readOnly&&!c.readOnly?"disable":c.modes[a.mode]?"enable":"disable"]()}function m(a,c,b){if(c){var d,f,e=a.commands;for(f in e)d=e[f],(b||d.contextSensitive)&&d.refresh(a,c)}}function k(a){var c=a.config.customConfig;if(!c)return!1;var c=CKEDITOR.getUrl(c),b=r[c]||(r[c]={});b.fn?(b.fn.call(a,a.config),CKEDITOR.getUrl(a.config.customConfig)!=c&&k(a)||a.fireOnce("customConfigLoaded")):CKEDITOR.scriptLoader.queue(c,function(){b.fn=
|
|
266
|
+
CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){};k(a)});return!0}function h(a,c){a.on("customConfigLoaded",function(){if(c){if(c.on)for(var d in c.on)a.on(d,c.on[d]);CKEDITOR.tools.extend(a.config,c,!0);delete a.config.on}d=a.config;a.readOnly=d.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=d.tabIndex||a.element&&a.element.getAttribute("tabindex")||0;a.activeEnterMode=a.enterMode=a.blockless?CKEDITOR.ENTER_BR:d.enterMode;a.activeShiftEnterMode=a.shiftEnterMode=a.blockless?CKEDITOR.ENTER_BR:d.shiftEnterMode;d.skin&&(CKEDITOR.skinName=d.skin);a.fireOnce("configLoaded");a.dataProcessor=new CKEDITOR.htmlDataProcessor(a);
|
|
268
268
|
a.filter=a.activeFilter=new CKEDITOR.filter(a);b(a)});c&&null!=c.customConfig&&(a.config.customConfig=c.customConfig);k(a)||a.fireOnce("customConfigLoaded")}function b(a){CKEDITOR.skin.loadPart("editor",function(){d(a)})}function d(a){CKEDITOR.lang.load(a.config.language,a.config.defaultLanguage,function(b,d){var f=a.config.title;a.langCode=b;a.lang=CKEDITOR.tools.prototypedCopy(d);a.title="string"==typeof f||!1===f?f:[a.lang.editor,a.name].join(", ");a.config.contentsLangDirection||(a.config.contentsLangDirection=
|
|
269
|
-
a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.getDirection(1):a.lang.dir);a.fire("langLoaded");c(a)})}function c(a){a.getStylesSet(function(c){a.once("loaded",function(){a.fire("stylesSet",{styles:c})},null,null,1);n(a)})}function n(a){function c(a){if(!a)return"";CKEDITOR.tools.isArray(a)&&(a=a.join(","));return a.replace(/\s/g,"")}var b=a.config,d=c(b.plugins),f=c(b.extraPlugins),e=c(b.removePlugins);if(f)var
|
|
270
|
-
""),d=d+(","+f);if(e)var k=new RegExp("(?:^|,)(?:"+e.replace(/,/g,"|")+")(?\x3d,|$)","g"),d=d.replace(k,"");CKEDITOR.env.air&&(d+=",adobeair");CKEDITOR.plugins.load(d.split(","),function(c){var d=[],f=[],e=[];a.plugins=CKEDITOR.tools.extend({},a.plugins,c);for(var
|
|
271
|
-
(m=m.split(",")),0<=CKEDITOR.tools.indexOf(m,a.langCode)?l=a.langCode:(l=a.langCode.replace(/-.*/,""),l=l!=a.langCode&&0<=CKEDITOR.tools.indexOf(m,l)?l:0<=CKEDITOR.tools.indexOf(m,"en")?"en":m[0]),
|
|
272
|
-
d[
|
|
273
|
-
(c=CKEDITOR.tools.htmlEncode(c));a.is("textarea")?a.setValue(c):a.setHtml(c);return!0}return!1}function
|
|
274
|
-
e.append(l.getAscendant({thead:1,tbody:1,tfoot:1}).clone()),f.append(e),e=e.findOne("thead, tbody, tfoot")),
|
|
269
|
+
a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.getDirection(1):a.lang.dir);a.fire("langLoaded");c(a)})}function c(a){a.getStylesSet(function(c){a.once("loaded",function(){a.fire("stylesSet",{styles:c})},null,null,1);n(a)})}function n(a){function c(a){if(!a)return"";CKEDITOR.tools.isArray(a)&&(a=a.join(","));return a.replace(/\s/g,"")}var b=a.config,d=c(b.plugins),f=c(b.extraPlugins),e=c(b.removePlugins);if(f)var h=new RegExp("(?:^|,)(?:"+f.replace(/,/g,"|")+")(?\x3d,|$)","g"),d=d.replace(h,
|
|
270
|
+
""),d=d+(","+f);if(e)var k=new RegExp("(?:^|,)(?:"+e.replace(/,/g,"|")+")(?\x3d,|$)","g"),d=d.replace(k,"");CKEDITOR.env.air&&(d+=",adobeair");CKEDITOR.plugins.load(d.split(","),function(c){var d=[],f=[],e=[];a.plugins=CKEDITOR.tools.extend({},a.plugins,c);for(var h in c){var g=c[h],m=g.lang,l=null,w=g.requires,n;CKEDITOR.tools.isArray(w)&&(w=w.join(","));if(w&&(n=w.match(k)))for(;w=n.pop();)CKEDITOR.error("editor-plugin-required",{plugin:w.replace(",",""),requiredBy:h});m&&!a.lang[h]&&(m.split&&
|
|
271
|
+
(m=m.split(",")),0<=CKEDITOR.tools.indexOf(m,a.langCode)?l=a.langCode:(l=a.langCode.replace(/-.*/,""),l=l!=a.langCode&&0<=CKEDITOR.tools.indexOf(m,l)?l:0<=CKEDITOR.tools.indexOf(m,"en")?"en":m[0]),g.langEntries&&g.langEntries[l]?(a.lang[h]=g.langEntries[l],l=null):e.push(CKEDITOR.getUrl(g.path+"lang/"+l+".js")));f.push(l);d.push(g)}CKEDITOR.scriptLoader.load(e,function(){if(!a.isDestroyed()&&!a.isDetached()){for(var c=["beforeInit","init","afterInit"],e=0;e<c.length;e++)for(var h=0;h<d.length;h++){var k=
|
|
272
|
+
d[h];0===e&&f[h]&&k.lang&&k.langEntries&&(a.lang[k.name]=k.langEntries[f[h]]);if(k[c[e]])k[c[e]](a)}a.fireOnce("pluginsLoaded");b.keystrokes&&a.setKeystroke(a.config.keystrokes);for(h=0;h<a.config.blockedKeystrokes.length;h++)a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[h]]=1;a.status="loaded";a.fireOnce("loaded");CKEDITOR.fire("instanceLoaded",null,a)}})})}function p(){var a=this.element;if(a&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var c=this.getData();this.config.htmlEncodeOutput&&
|
|
273
|
+
(c=CKEDITOR.tools.htmlEncode(c));a.is("textarea")?a.setValue(c):a.setHtml(c);return!0}return!1}function q(a,c){function b(a){var c=a.startContainer,d=a.endContainer;return c.is&&(c.is("tr")||c.is("td")&&c.equals(d)&&a.endOffset===c.getChildCount())?!0:!1}function d(a){var c=a.startContainer;return c.is("tr")?a.cloneContents():c.clone(!0)}for(var f=new CKEDITOR.dom.documentFragment,e,h,k,g=0;g<a.length;g++){var m=a[g],l=m.startContainer.getAscendant("tr",!0);b(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")),h&&h.equals(l)||(h=l,k=l.clone(),e.append(k)),k.append(d(m))):f.append(m.cloneContents())}return e?f:c.getHtmlFromRange(a[0])}a.prototype=CKEDITOR.editor.prototype;CKEDITOR.editor=a;var t=0,r={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{plugins:{detectConflict:function(a,c){for(var b=0;b<c.length;b++){var d=c[b];if(this[d])return CKEDITOR.warn("editor-plugin-conflict",{plugin:a,replacedWith:d}),
|
|
275
275
|
!0}return!1}},addCommand:function(a,c){c.name=a.toLowerCase();var b=c instanceof CKEDITOR.command?c:new CKEDITOR.command(this,c);this.mode&&e(this,b);return this.commands[a]=b},_attachToForm:function(){function a(c){b.updateElement();b._.required&&!d.getValue()&&!1===b.fire("required")&&c.data.preventDefault()}function c(a){return!!(a&&a.call&&a.apply)}var b=this,d=b.element,f=new CKEDITOR.dom.element(d.$.form);d.is("textarea")&&f&&(f.on("submit",a),c(f.$.submit)&&(f.$.submit=CKEDITOR.tools.override(f.$.submit,
|
|
276
|
-
function(c){return function(){a();c.apply?c.apply(this):c()}})),b.on("destroy",function(){f.removeListener("submit",a)}))},destroy:function(a){var c=CKEDITOR.filter.instances,b=this;this.fire("beforeDestroy");!a&&
|
|
276
|
+
function(c){return function(){a();c.apply?c.apply(this):c()}})),b.on("destroy",function(){f.removeListener("submit",a)}))},destroy:function(a){var c=CKEDITOR.filter.instances,b=this;this.fire("beforeDestroy");!a&&p.call(this);this.editable(null);this.filter&&delete this.filter;CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(c),function(a){a=c[a];b===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,c){var b=this.getCommand(a),d={name:a,commandData:c||{},command:b};return b&&b.state!=CKEDITOR.TRISTATE_DISABLED&&!1!==this.fire("beforeCommandExec",d)&&(d.returnValue=b.exec(d.commandData),
|
|
278
278
|
!b.async&&!1!==this.fire("afterCommandExec",d))?d.returnValue:!1},getCommand:function(a){return this.commands[a]},getData:function(a){!a&&this.fire("beforeGetData");var c=this._.data;"string"!=typeof c&&(c=(c=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?c.is("textarea")?c.getValue():c.getHtml():"");c={dataValue:c};!a&&this.fire("getData",c);return c.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,c,b){var d=!0,f=c;c&&"object"==typeof c&&(b=c.internal,f=c.callback,d=!c.noSnapshot);!b&&d&&this.fire("saveSnapshot");if(f||!b)this.once("dataReady",function(a){!b&&d&&this.fire("saveSnapshot");f&&f.call(a.editor)});a={dataValue:a};!b&&this.fire("setData",a);this._.data=a.dataValue;!b&&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,c,b){this.fire("insertHtml",{dataValue:a,mode:c,range:b})},insertText:function(a){this.fire("insertText",a)},insertElement:function(a){this.fire("insertElement",a)},getSelectedHtml:function(a){var c=this.editable(),b=this.getSelection(),b=b&&b.getRanges();if(!c||!b||0===b.length)return null;c=
|
|
281
|
-
d=this.getSelection().getRanges(),f=new CKEDITOR.dom.documentFragment,e;if(!b||0===d.length)return null;for(e=0;e<d.length;e++)f.append(b.extractHtmlFromRange(d[e],c));c||this.getSelection().selectRanges([d[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
|
|
282
|
-
this.keystrokeHandler.keystrokes,c=CKEDITOR.tools.isArray(arguments[0])?arguments[0]:[[].slice.call(arguments,0)],b,d,f=c.length;f--;)b=c[f],d=0,CKEDITOR.tools.isArray(b)&&(d=b[1],b=b[0]),d?a[b]=d:delete a[b]},getCommandKeystroke:function(a,c){var b="string"===typeof a?this.getCommand(a):a,d=[];if(b){var f=CKEDITOR.tools.object.findKey(this.commands,b),e=this.keystrokeHandler.keystrokes;if(b.fakeKeystroke)d.push(b.fakeKeystroke);else for(var
|
|
280
|
+
a,this.keystrokeHandler.blockedKeystrokes[8]=+a,this.editable().setReadOnly(a),this.fire("readOnly"))},insertHtml:function(a,c,b){this.fire("insertHtml",{dataValue:a,mode:c,range:b})},insertText:function(a){this.fire("insertText",a)},insertElement:function(a){this.fire("insertElement",a)},getSelectedHtml:function(a){var c=this.editable(),b=this.getSelection(),b=b&&b.getRanges();if(!c||!b||0===b.length)return null;c=q(b,c);return a?c.getHtml():c},extractSelectedHtml:function(a,c){var b=this.editable(),
|
|
281
|
+
d=this.getSelection().getRanges(),f=new CKEDITOR.dom.documentFragment,e;if(!b||0===d.length)return null;for(e=0;e<d.length;e++)f.append(b.extractHtmlFromRange(d[e],c));c||this.getSelection().selectRanges([d[0]]);return a?f.getHtml():f},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return"ready"==this.status&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return p.call(this)},setKeystroke:function(){for(var a=
|
|
282
|
+
this.keystrokeHandler.keystrokes,c=CKEDITOR.tools.isArray(arguments[0])?arguments[0]:[[].slice.call(arguments,0)],b,d,f=c.length;f--;)b=c[f],d=0,CKEDITOR.tools.isArray(b)&&(d=b[1],b=b[0]),d?a[b]=d:delete a[b]},getCommandKeystroke:function(a,c){var b="string"===typeof a?this.getCommand(a):a,d=[];if(b){var f=CKEDITOR.tools.object.findKey(this.commands,b),e=this.keystrokeHandler.keystrokes;if(b.fakeKeystroke)d.push(b.fakeKeystroke);else for(var h in e)e[h]===f&&d.push(h)}return c?d:d[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,c){a=a?this.blockless?CKEDITOR.ENTER_BR:a:this.enterMode;c=c?this.blockless?CKEDITOR.ENTER_BR:c:this.shiftEnterMode;if(this.activeEnterMode!=a||this.activeShiftEnterMode!=c)this.activeEnterMode=
|
|
284
284
|
a,this.activeShiftEnterMode=c,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 c=CKEDITOR.dom.element.get(a);return c?c.getEditor()?(CKEDITOR.error("editor-element-conflict",{editorName:c.getEditor().name}),null):c:(CKEDITOR.error("editor-incorrect-element",
|
|
285
285
|
{element:a}),null)}})();CKEDITOR.ELEMENT_MODE_NONE=0;CKEDITOR.ELEMENT_MODE_REPLACE=1;CKEDITOR.ELEMENT_MODE_APPENDTO=2;CKEDITOR.ELEMENT_MODE_INLINE=3;CKEDITOR.htmlParser=function(){this._={htmlPartsRegex:/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}};(function(){var a=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,l={checked:1,compact:1,declare:1,defer:1,disabled:1,
|
|
286
|
-
ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(
|
|
287
|
-
continue}if(k)k.push(f[0]);else if(e=f[3]){if(e=e.toLowerCase(),!/="/.test(e)){var
|
|
286
|
+
ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(g){for(var f,e,m=0,k;f=this._.htmlPartsRegex.exec(g);){e=f.index;if(e>m)if(m=g.substring(m,e),k)k.push(m);else this.onText(m);m=this._.htmlPartsRegex.lastIndex;if(e=f[1])if(e=e.toLowerCase(),k&&CKEDITOR.dtd.$cdata[e]&&(this.onCDATA(k.join("")),k=null),!k){this.onTagClose(e);
|
|
287
|
+
continue}if(k)k.push(f[0]);else if(e=f[3]){if(e=e.toLowerCase(),!/="/.test(e)){var h={},b,d=f[4];f=!!f[5];if(d)for(;b=a.exec(d);){var c=b[1].toLowerCase();b=b[2]||b[3]||b[4]||"";h[c]=!b&&l[c]?c:CKEDITOR.tools.htmlDecodeAttr(b)}this.onTagOpen(e,h,f);!k&&CKEDITOR.dtd.$cdata[e]&&(k=[])}}else if(e=f[2])this.onComment(e)}if(g.length>m)this.onText(g.substring(m,g.length))}}})();CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(a){this._.output.push("\x3c",
|
|
288
288
|
a)},openTagClose:function(a,l){l?this._.output.push(" /\x3e"):this._.output.push("\x3e")},attribute:function(a,l){"string"==typeof l&&(l=CKEDITOR.tools.htmlEncodeAttr(l));this._.output.push(" ",a,'\x3d"',l,'"')},closeTag:function(a){this._.output.push("\x3c/",a,"\x3e")},text:function(a){this._.output.push(a)},comment:function(a){this._.output.push("\x3c!--",a,"--\x3e")},write:function(a){this._.output.push(a)},reset:function(){this._.output=[];this._.indent=!1},getHtml:function(a){var l=this._.output.join("");
|
|
289
|
-
a&&this.reset();return l}}});"use strict";(function(){CKEDITOR.htmlParser.node=function(){};CKEDITOR.htmlParser.node.prototype={remove:function(){var a=this.parent.children,l=CKEDITOR.tools.indexOf(a,this),
|
|
290
|
-
insertAfter:function(a){var l=a.parent.children,
|
|
291
|
-
a},
|
|
292
|
-
l){var
|
|
289
|
+
a&&this.reset();return l}}});"use strict";(function(){CKEDITOR.htmlParser.node=function(){};CKEDITOR.htmlParser.node.prototype={remove:function(){var a=this.parent.children,l=CKEDITOR.tools.indexOf(a,this),g=this.previous,f=this.next;g&&(g.next=f);f&&(f.previous=g);a.splice(l,1);this.parent=null},replaceWith:function(a){var l=this.parent.children,g=CKEDITOR.tools.indexOf(l,this),f=a.previous=this.previous,e=a.next=this.next;f&&(f.next=a);e&&(e.previous=a);l[g]=a;a.parent=this.parent;this.parent=null},
|
|
290
|
+
insertAfter:function(a){var l=a.parent.children,g=CKEDITOR.tools.indexOf(l,a),f=a.next;l.splice(g+1,0,this);this.next=a.next;this.previous=a;a.next=this;f&&(f.previous=this);this.parent=a.parent},insertBefore:function(a){var l=a.parent.children,g=CKEDITOR.tools.indexOf(l,a);l.splice(g,0,this);this.next=a;(this.previous=a.previous)&&(a.previous.next=this);a.previous=this;this.parent=a.parent},getAscendant:function(a){var l="function"==typeof a?a:"string"==typeof a?function(f){return f.name==a}:function(f){return f.name in
|
|
291
|
+
a},g=this.parent;for(;g&&g.type==CKEDITOR.NODE_ELEMENT;){if(l(g))return g;g=g.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
|
+
l){var g=this.value;if(!(g=a.onComment(l,g,this)))return this.remove(),!1;if("string"!=typeof g)return this.replaceWith(g),!1;this.value=g;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),
|
|
295
|
-
v[b],e=f.name,
|
|
296
|
-
(
|
|
297
|
-
a in CKEDITOR.dtd.$tableContent?a==c||"dt"==a&&"dd"==c||"dd"==a&&"dt"==c:!1}var
|
|
298
|
-
return}"textarea"==c&&(z=!0)}if("br"==c)y.push(e);else{for(;!(k=(
|
|
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),g={ol:1,ul:1},f=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),e={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=function(m,k,h){function b(a){var c;if(0<v.length)for(var b=0;b<v.length;b++){var f=
|
|
295
|
+
v[b],e=f.name,h=CKEDITOR.dtd[e],k=x.name&&CKEDITOR.dtd[x.name];k&&!k[e]||a&&h&&!h[a]&&CKEDITOR.dtd[a]?e==x.name&&(n(x,x.parent,1),b--):(c||(d(),c=1),f=f.clone(),f.parent=x,x=f,v.splice(b,1),b--)}}function d(){for(;y.length;)n(y.shift(),x)}function c(a){if(a._.isBlockLike&&"pre"!=a.name&&"textarea"!=a.name){var c=a.children.length,b=a.children[c-1],d;b&&b.type==CKEDITOR.NODE_TEXT&&((d=CKEDITOR.tools.rtrim(b.value))?b.value=d:a.children.length=c-1)}}function n(b,d,f){d=d||x||r;var e=x;void 0===b.previous&&
|
|
296
|
+
(p(d,b)&&(x=d,t.onTagOpen(h,{}),b.returnPoint=d=x),c(b),a(b)&&!b.children.length||d.add(b),"pre"==b.name&&(A=!1),"textarea"==b.name&&(z=!1));b.returnPoint?(x=b.returnPoint,delete b.returnPoint):x=f?d:e}function p(a,c){if((a==r||"body"==a.name)&&h&&(!a.name||CKEDITOR.dtd[a.name][h])){var b,d;return(b=c.attributes&&(d=c.attributes["data-cke-real-element-type"])?d:c.name)&&b in CKEDITOR.dtd.$inline&&!(b in CKEDITOR.dtd.head)&&!c.isOrphan||c.type==CKEDITOR.NODE_TEXT}}function q(a,c){return a in CKEDITOR.dtd.$listItem||
|
|
297
|
+
a in CKEDITOR.dtd.$tableContent?a==c||"dt"==a&&"dd"==c||"dd"==a&&"dt"==c:!1}var t=new CKEDITOR.htmlParser,r=k instanceof CKEDITOR.htmlParser.element?k:"string"==typeof k?new CKEDITOR.htmlParser.element(k):new CKEDITOR.htmlParser.fragment,v=[],y=[],x=r,z="textarea"==r.name,A="pre"==r.name;t.onTagOpen=function(c,e,h,k){e=new CKEDITOR.htmlParser.element(c,e);e.isUnknown&&h&&(e.isEmpty=!0);e.isOptionalClose=k;if(a(e))v.push(e);else{if("pre"==c)A=!0;else{if("br"==c&&A){x.add(new CKEDITOR.htmlParser.text("\n"));
|
|
298
|
+
return}"textarea"==c&&(z=!0)}if("br"==c)y.push(e);else{for(;!(k=(h=x.name)?CKEDITOR.dtd[h]||(x._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):f,e.isUnknown||x.isUnknown||k[c]);)if(x.isOptionalClose)t.onTagClose(h);else if(c in g&&h in g)h=x.children,(h=h[h.length-1])&&"li"==h.name||n(h=new CKEDITOR.htmlParser.element("li"),x),!e.returnPoint&&(e.returnPoint=x),x=h;else if(c in CKEDITOR.dtd.$listItem&&!q(c,h))t.onTagOpen("li"==c?"ul":"dl",{},0,1);else if(h in l&&!q(c,h))!e.returnPoint&&(e.returnPoint=
|
|
299
|
+
x),x=x.parent;else if(h in CKEDITOR.dtd.$inline&&v.unshift(x),x.parent)n(x,x.parent,1);else{e.isOrphan=1;break}b(c);d();e.parent=x;e.isEmpty?n(e):x=e}}};t.onTagClose=function(a){for(var c=v.length-1;0<=c;c--)if(a==v[c].name){v.splice(c,1);return}for(var b=[],f=[],e=x;e!=r&&e.name!=a;)e._.isBlockLike||f.unshift(e),b.push(e),e=e.returnPoint||e.parent;if(e!=r){for(c=0;c<b.length;c++){var k=b[c];n(k,k.parent)}x=e;e._.isBlockLike&&d();n(e,e.parent);e==x&&(x=x.parent);v=v.concat(f)}"body"==a&&(h=!1)};t.onText=
|
|
300
|
+
function(a){if(!(x._.hasInlineStarted&&!y.length||A||z)&&(a=CKEDITOR.tools.ltrim(a),0===a.length))return;var c=x.name,k=c?CKEDITOR.dtd[c]||(x._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):f;if(!z&&!k["#"]&&c in l)t.onTagOpen(e[c]||""),t.onText(a);else{d();b();A||z||(a=a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," "));a=new CKEDITOR.htmlParser.text(a);if(p(x,a))this.onTagOpen(h,{},0,1);x.add(a)}};t.onCDATA=function(a){x.add(new CKEDITOR.htmlParser.cdata(a))};t.onComment=function(a){d();b();x.add(new CKEDITOR.htmlParser.comment(a))};
|
|
301
|
+
t.parse(m);for(d();x!=r;)n(x,x.parent,1);c(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
|
-
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 d=0;d<e.length;d++)b=e[d],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(
|
|
304
|
-
CKEDITOR.htmlParser.filter=CKEDITOR.tools.createClass({$:function(
|
|
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 d=0;d<e.length;d++)b=e[d],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(g,f,e,m){var k,h;for(k in f)(h=g[k])||(h=g[k]=new a),h.add(f[k],e,m)}
|
|
304
|
+
CKEDITOR.htmlParser.filter=CKEDITOR.tools.createClass({$:function(g){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;g&&this.addRules(g,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,k=0;3>k;k++)if(m=e[k]){m=m.exec(a,f,this);if(!1===m)return null;if(m&&m!=f)return this.onNode(a,m);if(f.parent&&!f.name)break}return f},onNode:function(a,f){var e=f.type;return e==CKEDITOR.NODE_ELEMENT?this.onElement(a,f):e==CKEDITOR.NODE_TEXT?
|
|
307
|
-
new CKEDITOR.htmlParser.text(this.onText(a,f.value,f)):e==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,f.value,f)):null},onAttribute:function(a,f,e,m){return(e=this.attributesRules[e])?e.exec(a,m,f,this):m}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,f,e){this.rules.splice(this.findIndex(f),0,{value:a,priority:f,options:e})},addMany:function(a,f,e){for(var m=[this.findIndex(f),0],k=0,
|
|
308
|
-
m)},findIndex:function(a){for(var f=this.rules,e=f.length-1;0<=e&&a<f[e].priority;)e--;return e+1},exec:function(a,f){var e=f instanceof CKEDITOR.htmlParser.node||f instanceof CKEDITOR.htmlParser.fragment,m=Array.prototype.slice.call(arguments,1),k=this.rules,
|
|
309
|
-
(m[0]=f=c)}return f},execOnName:function(a,f){for(var e=0,m=this.rules,k=m.length,
|
|
310
|
-
[],k=
|
|
311
|
-
CKEDITOR.env.needsBrFiller)&&a.type==CKEDITOR.NODE_ELEMENT&&"br"==a.name&&!a.attributes["data-cke-eol"])return!0;var b;return a.type==CKEDITOR.NODE_TEXT&&(b=a.value.match(y))&&(b.index&&((new CKEDITOR.htmlParser.text(a.value.substring(0,b.index))).insertBefore(a),a.value=b[0]),!CKEDITOR.env.needsBrFiller&&n&&(!c||a.parent.name in F)||!n&&((b=a.previous)&&"br"==b.name||!b||m(b)))?!0:!1}var l={elements:{}},n="html"==c,F=CKEDITOR.tools.extend({},
|
|
312
|
-
d(n,a.config.fillEmptyBlocks);l.root=d(n,!1);l.elements.br=function(a){return function(c){if(c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var d=c.attributes;if("data-cke-bogus"in d||"data-cke-eol"in d)delete d["data-cke-bogus"];else{for(d=c.next;d&&e(d);)d=d.next;var
|
|
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
|
|
307
|
+
new CKEDITOR.htmlParser.text(this.onText(a,f.value,f)):e==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,f.value,f)):null},onAttribute:function(a,f,e,m){return(e=this.attributesRules[e])?e.exec(a,m,f,this):m}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,f,e){this.rules.splice(this.findIndex(f),0,{value:a,priority:f,options:e})},addMany:function(a,f,e){for(var m=[this.findIndex(f),0],k=0,h=a.length;k<h;k++)m.push({value:a[k],priority:f,options:e});this.rules.splice.apply(this.rules,
|
|
308
|
+
m)},findIndex:function(a){for(var f=this.rules,e=f.length-1;0<=e&&a<f[e].priority;)e--;return e+1},exec:function(a,f){var e=f instanceof CKEDITOR.htmlParser.node||f instanceof CKEDITOR.htmlParser.fragment,m=Array.prototype.slice.call(arguments,1),k=this.rules,h=k.length,b,d,c,l;for(l=0;l<h;l++)if(e&&(b=f.type,d=f.name),c=k[l],!(a.nonEditable&&!c.options.applyToAll||a.nestedEditable&&c.options.excludeNestedEditable)){c=c.value.apply(null,m);if(!1===c||e&&c&&(c.name!=d||c.type!=b))return c;null!=c&&
|
|
309
|
+
(m[0]=f=c)}return f},execOnName:function(a,f){for(var e=0,m=this.rules,k=m.length,h;f&&e<k;e++)h=m[e],a.nonEditable&&!h.options.applyToAll||a.nestedEditable&&h.options.excludeNestedEditable||(f=f.replace(h.value[0],h.value[1]));return f}}})();(function(){function a(a,c){function b(a){return a||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text(" "):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function d(a,c){return function(d){if(d.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var e=
|
|
310
|
+
[],k=g(d),l,w;if(k)for(h(k,1)&&e.push(k);k;)m(k)&&(l=f(k))&&h(l)&&((w=f(l))&&!m(w)?e.push(l):(b(n).insertAfter(l),l.remove())),k=k.previous;for(k=0;k<e.length;k++)e[k].remove();if(e=!a||!1!==("function"==typeof c?c(d):c))n||CKEDITOR.env.needsBrFiller||d.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT?n||CKEDITOR.env.needsBrFiller||!(7<document.documentMode||d.name in CKEDITOR.dtd.tr||d.name in CKEDITOR.dtd.$listItem)?(e=g(d),e=!e||"form"==d.name&&"input"==e.name):e=!1:e=!1;e&&d.add(b(a))}}}function h(a,c){if((!n||
|
|
311
|
+
CKEDITOR.env.needsBrFiller)&&a.type==CKEDITOR.NODE_ELEMENT&&"br"==a.name&&!a.attributes["data-cke-eol"])return!0;var b;return a.type==CKEDITOR.NODE_TEXT&&(b=a.value.match(y))&&(b.index&&((new CKEDITOR.htmlParser.text(a.value.substring(0,b.index))).insertBefore(a),a.value=b[0]),!CKEDITOR.env.needsBrFiller&&n&&(!c||a.parent.name in F)||!n&&((b=a.previous)&&"br"==b.name||!b||m(b)))?!0:!1}var l={elements:{}},n="html"==c,F=CKEDITOR.tools.extend({},w),u;for(u in F)"#"in z[u]||delete F[u];for(u in F)l.elements[u]=
|
|
312
|
+
d(n,a.config.fillEmptyBlocks);l.root=d(n,!1);l.elements.br=function(a){return function(c){if(c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var d=c.attributes;if("data-cke-bogus"in d||"data-cke-eol"in d)delete d["data-cke-bogus"];else{for(d=c.next;d&&e(d);)d=d.next;var h=f(c);!d&&m(c.parent)?k(c.parent,b(a)):m(d)&&h&&!m(h)&&b(a).insertBefore(d)}}}}(n);return l}function l(a,c){return a!=CKEDITOR.ENTER_BR&&!1!==c?a==CKEDITOR.ENTER_DIV?"div":"p":!1}function g(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 w||a.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function k(a,c){var b=a.children[a.children.length-1];a.children.push(c);c.parent=a;b&&(b.next=c,c.previous=b)}function h(a){a=a.attributes;"false"!=a.contenteditable&&
|
|
314
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 d(a){return a.replace(G,function(a,c,b){return"\x3c"+c+b.replace(K,function(a,c){return H.test(c)&&-1==b.indexOf("data-cke-saved-"+c)?" data-cke-saved-"+a+" data-cke-"+CKEDITOR.rnd+"-"+a:a})+"\x3e"})}function c(a,c){return a.replace(c,function(a,c,b){0===a.indexOf("\x3ctextarea")&&
|
|
315
|
-
(a=c+
|
|
316
|
-
function
|
|
317
|
-
(b.push(a)-1)+"--\x3e"});for(var
|
|
318
|
-
c){f[f.id]=decodeURIComponent(c);return"{cke_protected_"+f.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,b,d,f){return"\x3c"+b+d+"\x3e"+
|
|
319
|
-
{applyToAll:!0});e.addRules(C);e.addRules(B,{applyToAll:!0});e.addRules(a(b,"html"),{applyToAll:!0});b.on("toHtml",function(a){a=a.data;var f=a.dataValue,e,f=v(f),f=
|
|
320
|
-
f="\x3cpre\x3e"+f+"\x3c/pre\x3e",
|
|
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(
|
|
322
|
-
a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,l(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(
|
|
323
|
-
{toHtml:function(a,c,b,d){var f=this.editor,e,
|
|
324
|
-
{dataValue:a,filter:d||this.editor.filter,context:b,enterMode:f||this.editor.enterMode}).dataValue}};var y=/(?: |\xa0)$/,
|
|
315
|
+
(a=c+q(b).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(I,function(a,c){return decodeURIComponent(c)})}function p(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g,function(a){return"\x3c!--"+x+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function q(a){return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g,function(a,c){return decodeURIComponent(c)})}
|
|
316
|
+
function t(a,c){var b=c._.dataStore;return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(a,c){return decodeURIComponent(c)}).replace(/\{cke_protected_(\d+)\}/g,function(a,c){return b&&b[c]||""})}function r(a,c){var b=[],d=c.config.protectedSource,f=c._.dataStore||(c._.dataStore={id:1}),e=/<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,d=[/<script[\s\S]*?(<\/script>|$)/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(d);a=a.replace(/\x3c!--[\s\S]*?--\x3e/g,function(a){return"\x3c!--{cke_tempcomment}"+
|
|
317
|
+
(b.push(a)-1)+"--\x3e"});for(var h=0;h<d.length;h++)a=a.replace(d[h],function(a){a=a.replace(e,function(a,c,d){return b[d]});return/cke_temp(comment)?/.test(a)?a:"\x3c!--{cke_temp}"+(b.push(a)-1)+"--\x3e"});a=a.replace(e,function(a,c,d){return"\x3c!--"+x+(c?"{C}":"")+encodeURIComponent(b[d]).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
|
+
c){f[f.id]=decodeURIComponent(c);return"{cke_protected_"+f.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,b,d,f){return"\x3c"+b+d+"\x3e"+t(q(f),c)+"\x3c/"+b+"\x3e"})}var v;CKEDITOR.htmlDataProcessor=function(b){var f,e,h=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(u);f.addRules(D,{applyToAll:!0});f.addRules(a(b,"data"),
|
|
319
|
+
{applyToAll:!0});e.addRules(C);e.addRules(B,{applyToAll:!0});e.addRules(a(b,"html"),{applyToAll:!0});b.on("toHtml",function(a){a=a.data;var f=a.dataValue,e,f=v(f),f=r(f,b),f=c(f,M),f=d(f),f=c(f,E),f=f.replace(J,"$1cke:$2"),f=f.replace(L,"\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 h;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&"pre"==e&&(e="div",
|
|
320
|
+
f="\x3cpre\x3e"+f+"\x3c/pre\x3e",h=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"),"");h&&(f=f.replace(/^<pre>|<\/pre>$/gi,""));f=f.replace(F,"$1$2");f=n(f);f=q(f);e=!1===a.fixForBody?!1:l(a.enterMode,b.config.autoParagraph);f=CKEDITOR.htmlParser.fragment.fromHtml(f,a.context,e);e&&(h=f,!h.children.length&&CKEDITOR.dtd[h.name][e]&&(e=new CKEDITOR.htmlParser.element(e),h.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(h.dataFilter,!0)},null,null,10);b.on("toHtml",function(a){a=a.data;var c=a.dataValue,b=new CKEDITOR.htmlParser.basicWriter;c.writeChildrenHtml(b);c=b.getHtml(!0);a.dataValue=p(c)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(c=c.replace(/^<br *\/?>/i,""));
|
|
322
|
+
a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,l(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(h.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 c=a.data.dataValue,d=h.writer;d.reset();c.writeChildrenHtml(d);c=d.getHtml(!0);c=q(c);c=t(c,b);a.data.dataValue=c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype=
|
|
323
|
+
{toHtml:function(a,c,b,d){var f=this.editor,e,h,k,g;c&&"object"==typeof c?(e=c.context,b=c.fixForBody,d=c.dontFilter,h=c.filter,k=c.enterMode,g=c.protectedWhitespaces):e=c;e||null===e||(e=f.editable().getName());return f.fire("toHtml",{dataValue:a,context:e,fixForBody:b,dontFilter:d,filter:h||f.filter,enterMode:k||f.enterMode,protectedWhitespaces:g}).dataValue},toDataFormat:function(a,c){var b,d,f;c&&(b=c.context,d=c.filter,f=c.enterMode);b||null===b||(b=this.editor.editable().getName());return this.editor.fire("toDataFormat",
|
|
324
|
+
{dataValue:a,filter:d||this.editor.filter,context:b,enterMode:f||this.editor.enterMode}).dataValue}};var y=/(?: |\xa0)$/,x="{cke_protected}",z=CKEDITOR.dtd,A="caption colgroup col thead tfoot tbody".split(" "),w=CKEDITOR.tools.extend({},z.$blockLimit,z.$block),u={elements:{input:h,textarea:h}},D={attributeNames:[[/^on/,"data-cke-pa-on"],[/^srcdoc/,"data-cke-pa-srcdoc"],[/^data-cke-expando$/,""]],elements:{iframe:function(a){if(a.attributes&&a.attributes.src){var c=a.attributes.src.toLowerCase().replace(/[^a-z]/gi,
|
|
325
325
|
"");if(0===c.indexOf("javascript")||0===c.indexOf("data"))a.attributes["data-cke-pa-src"]=a.attributes.src,delete a.attributes.src}}}},C={elements:{embed:function(a){var c=a.parent;if(c&&"object"==c.name){var b=c.attributes.width,c=c.attributes.height;b&&(a.attributes.width=b);c&&(a.attributes.height=c)}},a:function(a){var c=a.attributes;if(!(a.children.length||c.name||c.id||a.attributes["data-cke-saved-name"]))return!1}}},B={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,
|
|
326
326
|
""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var c=a.attributes;if(c){if(c["data-cke-temp"])return!1;for(var b=["name","href","src"],d,f=0;f<b.length;f++)d="data-cke-saved-"+b[f],d in c&&delete c[b[f]]}return a},table:function(a){a.children.slice(0).sort(function(a,c){var b,d;a.type==CKEDITOR.NODE_ELEMENT&&c.type==a.type&&(b=CKEDITOR.tools.indexOf(A,a.name),d=CKEDITOR.tools.indexOf(A,c.name));-1<b&&-1<d&&b!=d||(b=a.parent?a.getIndex():-1,d=c.parent?c.getIndex():-1);return b>d?
|
|
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 c=a.children[0];c&&c.value&&(c.value=CKEDITOR.tools.trim(c.value));a.attributes.type||(a.attributes.type="text/css")},title:function(a){var c=a.children[0];!c&&k(a,c=new CKEDITOR.htmlParser.text);
|
|
328
328
|
c.value=a.attributes["data-cke-title"]||""},input:b,textarea:b},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(B.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})});var G=/<(a|area|img|input|source)\b([^>]*)>/gi,K=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,H=/^(href|src|name)$/i,E=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
|
|
329
329
|
M=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,I=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,J=/(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,F=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,L=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;v=function(){function a(b){return CKEDITOR.tools.array.reduce(b.split(""),function(a,b){var d=b.toLowerCase(),f=b.toUpperCase(),e=c(d);d!==f&&(e+="|"+c(f));return a+("("+e+")")},"")}function c(a){var b;b=a.charCodeAt(0);var d=b.toString(16);
|
|
330
330
|
b={htmlCode:"\x26#"+b+";?",hex:"\x26#x0*"+d+";?",entity:{"\x3c":"\x26lt;","\x3e":"\x26gt;",":":"\x26colon;"}[a]};for(var f in b)b[f]&&(a+="|"+b[f]);return a}var b=new RegExp("("+a("\x3ccke:encoded\x3e")+"(.*?)"+a("\x3c/cke:encoded\x3e")+")|("+a("\x3c")+a("/")+"?"+a("cke:encoded\x3e")+")","gi"),d=new RegExp("(("+a("{cke_protected")+")(_[0-9]*)?"+a("}")+")","gi");return function(a){return a.replace(b,"").replace(d,"")}}()})();"use strict";CKEDITOR.htmlParser.element=function(a,l){this.name=a;this.attributes=
|
|
331
|
-
l||{};this.children=[];var
|
|
331
|
+
l||{};this.children=[];var g=a||"",f=g.match(/^cke:(.*)/);f&&(g=f[1]);g=!!(CKEDITOR.dtd.$nonBodyContent[g]||CKEDITOR.dtd.$block[g]||CKEDITOR.dtd.$listItem[g]||CKEDITOR.dtd.$tableContent[g]||CKEDITOR.dtd.$nonEditable[g]||"br"==g);this.isEmpty=!!CKEDITOR.dtd.$empty[a];this.isUnknown=!CKEDITOR.dtd[a];this._={isBlockLike:g,hasInlineStarted:this.isEmpty||!g}};CKEDITOR.htmlParser.cssStyle=function(a){var l={};((a instanceof CKEDITOR.htmlParser.element?a.attributes.style:a)||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
|
|
332
332
|
function(a,f,e){"font-family"==f&&(e=e.replace(/["']/g,""));l[f.toLowerCase()]=e});return{rules:l,populate:function(a){var f=this.toString();f&&(a instanceof CKEDITOR.dom.element?a.setAttribute("style",f):a instanceof CKEDITOR.htmlParser.element?a.attributes.style=f:a.style=f)},toString:function(){var a=[],f;for(f in l)l[f]&&a.push(f,":",l[f],";");return a.join("")}}};(function(){function a(a){return function(e){return e.type==CKEDITOR.NODE_ELEMENT&&("string"==typeof a?e.name==a:e.name in a)}}var l=
|
|
333
|
-
function(a,e){a=a[0];e=e[0];return a<e?-1:a>e?1:0},
|
|
334
|
-
!1;if(
|
|
335
|
-
k=[],
|
|
336
|
-
(f=a(f));for(var e=0,
|
|
337
|
-
this.children.length-a),
|
|
338
|
-
function(
|
|
339
|
-
return e?(new RegExp("(?:^|\\s)"+a+"(?\x3d\\s|$)")).test(e):!1},getFilterContext:function(a){var e=[];a||(a={nonEditable:!1,nestedEditable:!1});a.nonEditable||"false"!=this.attributes.contenteditable?a.nonEditable&&!a.nestedEditable&&"true"==this.attributes.contenteditable&&e.push("nestedEditable",!0):e.push("nonEditable",!0);if(e.length){a=CKEDITOR.tools.copy(a);for(var
|
|
340
|
-
"function"===typeof a?a:String(a)};CKEDITOR.template.prototype.output=function(l,
|
|
341
|
-
function(){CKEDITOR.currentInstance!=a&&(CKEDITOR.currentInstance=a,CKEDITOR.fire("currentInstance"))});a.on("blur",l);a.on("destroy",l);CKEDITOR.fire("instance",null,a)};CKEDITOR.remove=function(a){delete CKEDITOR.instances[a.name]};(function(){var a={};CKEDITOR.addTemplate=function(l,
|
|
342
|
-
CKEDITOR.getCss=function(){return a.join("\n")}})();CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")});CKEDITOR.TRISTATE_ON=1;CKEDITOR.TRISTATE_OFF=2;CKEDITOR.TRISTATE_DISABLED=0;(function(){CKEDITOR.inline=function(a,l){a=CKEDITOR.editor._getEditorElement(a);if(!a)return null;var
|
|
343
|
-
!!
|
|
344
|
-
CKEDITOR.fire("instanceReady",null,
|
|
345
|
-
CKEDITOR.inlineAll()})})();CKEDITOR.replaceClass="ckeditor";(function(){function a(a,e,m,k){a=CKEDITOR.editor._getEditorElement(a);if(!a)return null;var
|
|
346
|
-
function(){
|
|
333
|
+
function(a,e){a=a[0];e=e[0];return a<e?-1:a>e?1:0},g=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:g.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a,e){var g=this,k,h;e=g.getFilterContext(e);if(!g.parent)a.onRoot(e,g);for(;;){k=g.name;if(!(h=a.onElementName(e,k)))return this.remove(),!1;g.name=h;if(!(g=a.onElement(e,g)))return this.remove(),
|
|
334
|
+
!1;if(g!==this)return this.replaceWith(g),!1;if(g.name==k)break;if(g.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(g),!1;if(!g.name)return this.replaceWithChildren(),!1}k=g.attributes;var b,d;for(b in k){for(h=k[b];;)if(d=a.onAttributeName(e,b))if(d!=b)delete k[b],b=d;else break;else{delete k[b];break}d&&(!1===(h=a.onAttribute(e,g,d,h))?delete k[d]:k[d]=h)}g.isEmpty||this.filterChildren(a,!1,e);return!0},filterChildren:g.filterChildren,writeHtml:function(a,e){e&&this.filter(e);var g=this.name,
|
|
335
|
+
k=[],h=this.attributes,b,d;a.openTag(g,h);for(b in h)k.push([b,h[b]]);a.sortAttributes&&k.sort(l);b=0;for(d=k.length;b<d;b++)h=k[b],a.attribute(h[0],h[1]);a.openTagClose(g,this.isEmpty);this.writeChildrenHtml(a);this.isEmpty||a.closeTag(g)},writeChildrenHtml:g.writeChildrenHtml,replaceWithChildren:function(){for(var a=this.children,e=a.length;e;)a[--e].insertAfter(this);this.remove()},forEach:g.forEach,getFirst:function(f){if(!f)return this.children.length?this.children[0]:null;"function"!=typeof f&&
|
|
336
|
+
(f=a(f));for(var e=0,g=this.children.length;e<g;++e)if(f(this.children[e]))return this.children[e];return null},getHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeChildrenHtml(a);return a.getHtml()},setHtml:function(a){a=this.children=CKEDITOR.htmlParser.fragment.fromHtml(a).children;for(var e=0,g=a.length;e<g;++e)a[e].parent=this},getOuterHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeHtml(a);return a.getHtml()},split:function(a){for(var e=this.children.splice(a,
|
|
337
|
+
this.children.length-a),g=this.clone(),k=0;k<e.length;++k)e[k].parent=g;g.children=e;e[0]&&(e[0].previous=null);0<a&&(this.children[a-1].next=null);this.parent.add(g,this.getIndex()+1);return g},find:function(a,e){void 0===e&&(e=!1);var g=[],k;for(k=0;k<this.children.length;k++){var h=this.children[k];"function"==typeof a&&a(h)?g.push(h):"string"==typeof a&&h.name===a&&g.push(h);e&&h.find&&(g=g.concat(h.find(a,e)))}return g},findOne:function(a,e){var g=null,k=CKEDITOR.tools.array.find(this.children,
|
|
338
|
+
function(h){var b="function"===typeof a?a(h):h.name===a;if(b||!e)return b;h.children&&h.findOne&&(g=h.findOne(a,!0));return!!g});return g||k||null},addClass:function(a){if(!this.hasClass(a)){var e=this.attributes["class"]||"";this.attributes["class"]=e+(e?" ":"")+a}},removeClass:function(a){var e=this.attributes["class"];e&&((e=CKEDITOR.tools.trim(e.replace(new RegExp("(?:\\s+|^)"+a+"(?:\\s+|$)")," ")))?this.attributes["class"]=e:delete this.attributes["class"])},hasClass:function(a){var e=this.attributes["class"];
|
|
339
|
+
return e?(new RegExp("(?:^|\\s)"+a+"(?\x3d\\s|$)")).test(e):!1},getFilterContext:function(a){var e=[];a||(a={nonEditable:!1,nestedEditable:!1});a.nonEditable||"false"!=this.attributes.contenteditable?a.nonEditable&&!a.nestedEditable&&"true"==this.attributes.contenteditable&&e.push("nestedEditable",!0):e.push("nonEditable",!0);if(e.length){a=CKEDITOR.tools.copy(a);for(var g=0;g<e.length;g+=2)a[e[g]]=e[g+1]}return a}},!0)})();(function(){var a=/{([^}]+)}/g;CKEDITOR.template=function(a){this.source=
|
|
340
|
+
"function"===typeof a?a:String(a)};CKEDITOR.template.prototype.output=function(l,g){var f=("function"===typeof this.source?this.source(l):this.source).replace(a,function(a,f){return void 0!==l[f]?l[f]:a});return g?g.push(f):f}})();delete CKEDITOR.loadFullCore;CKEDITOR.instances={};CKEDITOR.document=new CKEDITOR.dom.document(document);CKEDITOR.add=function(a){function l(){CKEDITOR.currentInstance==a&&(CKEDITOR.currentInstance=null,CKEDITOR.fire("currentInstance"))}CKEDITOR.instances[a.name]=a;a.on("focus",
|
|
341
|
+
function(){CKEDITOR.currentInstance!=a&&(CKEDITOR.currentInstance=a,CKEDITOR.fire("currentInstance"))});a.on("blur",l);a.on("destroy",l);CKEDITOR.fire("instance",null,a)};CKEDITOR.remove=function(a){delete CKEDITOR.instances[a.name]};(function(){var a={};CKEDITOR.addTemplate=function(l,g){var f=a[l];if(f)return f;f={name:l,source:g};CKEDITOR.fire("template",f);return a[l]=new CKEDITOR.template(f.source)};CKEDITOR.getTemplate=function(l){return a[l]}})();(function(){var a=[];CKEDITOR.addCss=function(l){a.push(l)};
|
|
342
|
+
CKEDITOR.getCss=function(){return a.join("\n")}})();CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")});CKEDITOR.TRISTATE_ON=1;CKEDITOR.TRISTATE_OFF=2;CKEDITOR.TRISTATE_DISABLED=0;(function(){CKEDITOR.inline=function(a,l){a=CKEDITOR.editor._getEditorElement(a);if(!a)return null;var g=new CKEDITOR.editor(l,a,CKEDITOR.ELEMENT_MODE_INLINE),f=a.is("textarea")?a:null;f?(g.setData(f.getValue(),null,!0),a=CKEDITOR.dom.element.createFromHtml('\x3cdiv contenteditable\x3d"'+
|
|
343
|
+
!!g.readOnly+'" class\x3d"cke_textarea_inline"\x3e'+f.getValue()+"\x3c/div\x3e",CKEDITOR.document),a.insertAfter(f),f.hide(),f.$.form&&g._attachToForm()):(l&&"undefined"!==typeof l.readOnly&&!l.readOnly&&a.setAttribute("contenteditable","true"),g.setData(a.getHtml(),null,!0));g.on("loaded",function(){g.fire("uiReady");g.editable(a);g.container=a;g.ui.contentsElement=a;g.setData(g.getData(1));g.resetDirty();g.fire("contentDom");g.mode="wysiwyg";g.fire("mode");g.status="ready";g.fireOnce("instanceReady");
|
|
344
|
+
CKEDITOR.fire("instanceReady",null,g)},null,null,1E4);g.on("destroy",function(){var a=g.container;f&&a&&(a.clearCustomData(),a.remove());f&&f.show();g.element.clearCustomData();delete g.element});return g};CKEDITOR.inlineAll=function(){var a,l,g;for(g in CKEDITOR.dtd.$editable)for(var f=CKEDITOR.document.getElementsByTag(g),e=0,m=f.count();e<m;e++)a=f.getItem(e),"true"==a.getAttribute("contenteditable")&&(l={element:a,config:{}},!1!==CKEDITOR.fire("inline",l)&&CKEDITOR.inline(a,l.config))};CKEDITOR.domReady(function(){!CKEDITOR.disableAutoInline&&
|
|
345
|
+
CKEDITOR.inlineAll()})})();CKEDITOR.replaceClass="ckeditor";(function(){function a(a,e,m,k){a=CKEDITOR.editor._getEditorElement(a);if(!a)return null;var h=new CKEDITOR.editor(e,a,k);k==CKEDITOR.ELEMENT_MODE_REPLACE&&(a.setStyle("visibility","hidden"),h._.required=a.hasAttribute("required"),a.removeAttribute("required"));m&&h.setData(m,null,!0);h.on("loaded",function(){h.isDestroyed()||h.isDetached()||(g(h),k==CKEDITOR.ELEMENT_MODE_REPLACE&&h.config.autoUpdateElement&&a.$.form&&h._attachToForm(),h.setMode(h.config.startupMode,
|
|
346
|
+
function(){h.resetDirty();h.status="ready";h.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,h)}))});h.on("destroy",l);return h}function l(){var a=this.container,e=this.element;a&&(a.clearCustomData(),a.remove());e&&(e.clearCustomData(),this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(e.show(),this._.required&&e.setAttribute("required","required")),delete this.element)}function g(a){var e=a.name,g=a.element,k=a.elementMode,h=a.fire("uiSpace",{space:"top",html:""}).html,b=a.fire("uiSpace",
|
|
347
347
|
{space:"bottom",html:""}).html,d=new CKEDITOR.template('\x3c{outerEl} id\x3d"cke_{name}" class\x3d"{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"application"'+(a.title?' aria-labelledby\x3d"cke_{name}_arialbl"':"")+"\x3e"+(a.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':"")+'\x3c{outerEl} class\x3d"cke_inner cke_reset" role\x3d"presentation"\x3e{topHtml}\x3c{outerEl} id\x3d"{contentId}" class\x3d"cke_contents cke_reset" role\x3d"presentation"\x3e\x3c/{outerEl}\x3e{bottomHtml}\x3c/{outerEl}\x3e\x3c/{outerEl}\x3e'),
|
|
348
|
-
e=CKEDITOR.dom.element.createFromHtml(d.output({id:a.id,name:e,langDir:a.lang.dir,langCode:a.langCode,voiceLabel:a.title,topHtml:
|
|
349
|
-
(
|
|
350
|
-
CKEDITOR.appendTo=function(f,e,
|
|
351
|
-
{}))[a]=e};CKEDITOR.editor.prototype.setMode=function(a,e){var
|
|
352
|
-
|
|
353
|
-
k.setSize("width",a,!0);d&&(d.style.width="1%");e=CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(e));var c=(k.$.offsetHeight||0)-(b.$.clientHeight||0),
|
|
354
|
-
CKEDITOR.replaceAll(CKEDITOR.replaceClass)})})();CKEDITOR.config.startupMode="wysiwyg";(function(){function a(a){var c=a.editor,b=a.data.path,d=b.blockLimit,e=a.data.selection,
|
|
355
|
-
d.guard=function(a){return!f(a)||a.type==CKEDITOR.NODE_COMMENT||a.isReadOnly()},!d.checkForward()||b.checkStartOfBlock()&&b.checkEndOfBlock())&&(c=
|
|
356
|
-
d&&d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()||b.is("pre")||b.getBogus()))return b}function
|
|
357
|
-
d){d&&c.type==CKEDITOR.NODE_ELEMENT&&c.is(e)&&(b=c);if(!(d||!f(c)||a&&
|
|
358
|
-
a.config.autoParagraph&&a.activeEnterMode!=CKEDITOR.ENTER_BR&&(a.editable().equals(b)&&!c||c&&"true"==c.getAttribute("contenteditable"))}function
|
|
359
|
-
c:a;(a=a.getParent())&&!d.equals(a)&&1==a.getChildCount();)c=a;c.remove()}var n,
|
|
348
|
+
e=CKEDITOR.dom.element.createFromHtml(d.output({id:a.id,name:e,langDir:a.lang.dir,langCode:a.langCode,voiceLabel:a.title,topHtml:h?'\x3cspan id\x3d"'+a.ui.spaceId("top")+'" class\x3d"cke_top cke_reset_all" role\x3d"presentation" style\x3d"height:auto"\x3e'+h+"\x3c/span\x3e":"",contentId:a.ui.spaceId("contents"),bottomHtml:b?'\x3cspan id\x3d"'+a.ui.spaceId("bottom")+'" class\x3d"cke_bottom cke_reset_all" role\x3d"presentation"\x3e'+b+"\x3c/span\x3e":"",outerEl:CKEDITOR.env.ie?"span":"div"}));k==CKEDITOR.ELEMENT_MODE_REPLACE?
|
|
349
|
+
(g.hide(),e.insertAfter(g)):g.append(e);a.container=e;a.ui.contentsElement=a.ui.space("contents");h&&a.ui.space("top").unselectable();b&&a.ui.space("bottom").unselectable();g=a.config.width;k=a.config.height;g&&e.setStyle("width",CKEDITOR.tools.cssLength(g));k&&a.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(k));e.disableContextMenu();CKEDITOR.env.webkit&&e.on("focus",function(){a.focus()});a.fireOnce("uiReady")}CKEDITOR.replace=function(f,e){return a(f,e,null,CKEDITOR.ELEMENT_MODE_REPLACE)};
|
|
350
|
+
CKEDITOR.appendTo=function(f,e,g){return a(f,e,g,CKEDITOR.ELEMENT_MODE_APPENDTO)};CKEDITOR.replaceAll=function(){for(var a=document.getElementsByTagName("textarea"),e=0;e<a.length;e++){var g=null,k=a[e];if(k.name||k.id){if("string"==typeof arguments[0]){if(!(new RegExp("(?:^|\\s)"+arguments[0]+"(?:$|\\s)")).test(k.className))continue}else if("function"==typeof arguments[0]&&(g={},!1===arguments[0](k,g)))continue;this.replace(k,g)}}};CKEDITOR.editor.prototype.addMode=function(a,e){(this._.modes||(this._.modes=
|
|
351
|
+
{}))[a]=e};CKEDITOR.editor.prototype.setMode=function(a,e){var g=this,k=this._.modes;if(a!=g.mode&&k&&k[a]){g.fire("beforeSetMode",a);if(g.mode){var h=g.checkDirty(),k=g._.previousModeData,b,d=0;g.fire("beforeModeUnload");g.editable(0);g._.previousMode=g.mode;g._.previousModeData=b=g.getData(1);"source"==g.mode&&k==b&&(g.fire("lockSnapshot",{forceUpdate:!0}),d=1);g.ui.space("contents").setHtml("");g.mode=""}else g._.previousModeData=g.getData(1);this._.modes[a](function(){g.mode=a;void 0!==h&&!h&&
|
|
352
|
+
g.resetDirty();d?g.fire("unlockSnapshot"):"wysiwyg"==a&&g.fire("saveSnapshot");setTimeout(function(){g.isDestroyed()||g.isDetached()||(g.fire("mode"),e&&e.call(g))},0)})}};CKEDITOR.editor.prototype.resize=function(a,e,g,k){var h=this.container,b=this.ui.space("contents"),d=CKEDITOR.env.webkit&&this.document&&this.document.getWindow().$.frameElement;k=k?this.container.getFirst(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_inner")}):h;a=CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(a));
|
|
353
|
+
k.setSize("width",a,!0);d&&(d.style.width="1%");e=CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(e));var c=(k.$.offsetHeight||0)-(b.$.clientHeight||0),h=Math.max(e-(g?0:c),0);e=g?e+c:e;b.setStyle("height",CKEDITOR.tools.cssLength(h));d&&(d.style.width="100%");this.fire("resize",{outerHeight:e,contentsHeight:h,outerWidth:a||k.getSize("width")})};CKEDITOR.editor.prototype.getResizable=function(a){return a?this.ui.space("contents"):this.container};CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&
|
|
354
|
+
CKEDITOR.replaceAll(CKEDITOR.replaceClass)})})();CKEDITOR.config.startupMode="wysiwyg";(function(){function a(a){var c=a.editor,b=a.data.path,d=b.blockLimit,e=a.data.selection,h=e.getRanges()[0],g;if(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)if(e=l(e,b))e.appendBogus(),g=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.edge&&c._.previousActive;k(c,b.block,d)&&h.collapsed&&!h.getCommonAncestor().isReadOnly()&&(b=h.clone(),b.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),d=new CKEDITOR.dom.walker(b),
|
|
355
|
+
d.guard=function(a){return!f(a)||a.type==CKEDITOR.NODE_COMMENT||a.isReadOnly()},!d.checkForward()||b.checkStartOfBlock()&&b.checkEndOfBlock())&&(c=h.fixBlock(!0,c.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p"),CKEDITOR.env.needsBrFiller||(c=c.getFirst(f))&&c.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(c.getText()).match(/^(?: |\xa0)$/)&&c.remove(),g=1,a.cancel());g&&h.select()}function l(a,c){if(a.isFake)return 0;var b=c.block||c.blockLimit,d=b&&b.getLast(f);if(!(!b||!b.isBlockBoundary()||
|
|
356
|
+
d&&d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()||b.is("pre")||b.getBogus()))return b}function g(a){var c=a.data.getTarget();c.is("input")&&(c=c.getAttribute("type"),"submit"!=c&&"reset"!=c||a.data.preventDefault())}function f(a){return n(a)&&p(a)}function e(a,c){return function(b){var d=b.data.$.toElement||b.data.$.fromElement||b.data.$.relatedTarget;(d=d&&d.nodeType==CKEDITOR.NODE_ELEMENT?new CKEDITOR.dom.element(d):null)&&(c.equals(d)||c.contains(d))||a.call(this,b)}}function m(a){function c(a){return function(c,
|
|
357
|
+
d){d&&c.type==CKEDITOR.NODE_ELEMENT&&c.is(e)&&(b=c);if(!(d||!f(c)||a&&t(c)))return!1}}var b,d=a.getRanges()[0];a=a.root;var e={table:1,ul:1,ol:1,dl:1};if(d.startPath().contains(e)){var h=d.clone();h.collapse(1);h.setStartAt(a,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(h);a.guard=c();a.checkBackward();if(b)return h=d.clone(),h.collapse(),h.setEndAt(b,CKEDITOR.POSITION_AFTER_END),a=new CKEDITOR.dom.walker(h),a.guard=c(!0),b=!1,a.checkForward(),b}return null}function k(a,c,b){return!1!==
|
|
358
|
+
a.config.autoParagraph&&a.activeEnterMode!=CKEDITOR.ENTER_BR&&(a.editable().equals(b)&&!c||c&&"true"==c.getAttribute("contenteditable"))}function h(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 d(a){var c=a.editor;c.getSelection().scrollIntoView();setTimeout(function(){c.fire("saveSnapshot")},0)}function c(a,c,b){var d=a.getCommonAncestor(c);for(c=a=b?
|
|
359
|
+
c:a;(a=a.getParent())&&!d.equals(a)&&1==a.getChildCount();)c=a;c.remove()}var n,p,q,t,r,v,y,x,z,A;CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,$:function(a,c){this.base(c.$||c);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 c=this.$.scrollTop;this.$.focus();this.$.scrollTop=c}else this.$.focus();else this.$.setActive()}catch(b){if(!CKEDITOR.env.ie)throw b;}CKEDITOR.env.safari&&!this.isInline()&&(a=CKEDITOR.document.getActive(),a.equals(this.getWindow().getFrame())||this.getWindow().focus())},
|
|
361
361
|
on:function(a,c){var b=Array.prototype.slice.call(arguments,0);CKEDITOR.env.ie&&/^focus|blur$/.exec(a)&&(a="focus"==a?"focusin":"focusout",c=e(c,this),b[0]=a,b[1]=c);return CKEDITOR.dom.element.prototype.on.apply(this,b)},attachListener:function(a){!this._.listeners&&(this._.listeners=[]);var c=Array.prototype.slice.call(arguments,1),c=a.on.apply(a,c);this._.listeners.push(c);return c},clearListeners:function(){var a=this._.listeners;try{for(;a.length;)a.pop().removeListener()}catch(c){}},restoreAttrs:function(){var a=
|
|
362
362
|
this._.attrChanges,c,b;for(b in a)a.hasOwnProperty(b)&&(c=a[b],null!==c?this.setAttribute(b,c):this.removeAttribute(b))},attachClass:function(a){var c=this.getCustomData("classes");this.hasClass(a)||(!c&&(c=[]),c.push(a),this.setCustomData("classes",c),this.addClass(a))},changeAttr:function(a,c){var b=this.getAttribute(a);c!==b&&(!this._.attrChanges&&(this._.attrChanges={}),a in this._.attrChanges||(this._.attrChanges[a]=b),this.setAttribute(a,c))},insertText:function(a){this.editor.focus();this.insertHtml(this.transformPlainTextToHtml(a),
|
|
363
363
|
"text")},transformPlainTextToHtml:function(a){var c=this.editor.getSelection().getStartElement().hasAscendant("pre",!0)?CKEDITOR.ENTER_BR:this.editor.activeEnterMode;return CKEDITOR.tools.transformPlainTextToHtml(a,c)},insertHtml:function(a,c,b){var e=this.editor;e.focus();e.fire("saveSnapshot");b||(b=e.getSelection().getRanges()[0]);v(this,c||"html",a,b);b.select();d(this);this.editor.fire("afterInsertHtml",{})},insertHtmlIntoRange:function(a,c,b){v(this,b||"html",a,c);this.editor.fire("afterInsertHtml",
|
|
364
|
-
{intoRange:c})},insertElement:function(a,c){var b=this.editor;b.focus();b.fire("saveSnapshot");var e=b.activeEnterMode,b=b.getSelection(),
|
|
365
|
-
e==CKEDITOR.ENTER_DIV?"div":"p"),c.moveToElementEditStart(
|
|
366
|
-
1))&&(
|
|
364
|
+
{intoRange:c})},insertElement:function(a,c){var b=this.editor;b.focus();b.fire("saveSnapshot");var e=b.activeEnterMode,b=b.getSelection(),h=a.getName(),h=CKEDITOR.dtd.$block[h];c||(c=b.getRanges()[0]);this.insertElementIntoRange(a,c)&&(c.moveToPosition(a,CKEDITOR.POSITION_AFTER_END),h&&((h=a.getNext(function(a){return f(a)&&!t(a)}))&&h.type==CKEDITOR.NODE_ELEMENT&&h.is(CKEDITOR.dtd.$block)?h.getDtd()["#"]?c.moveToElementEditStart(h):c.moveToElementEditEnd(a):h||e==CKEDITOR.ENTER_BR||(h=c.fixBlock(!0,
|
|
365
|
+
e==CKEDITOR.ENTER_DIV?"div":"p"),c.moveToElementEditStart(h))));b.selectRanges([c]);d(this)},insertElementIntoSelection:function(a){this.insertElement(a)},insertElementIntoRange:function(a,c){var d=this.editor,e=d.config.enterMode,f=a.getName(),h=CKEDITOR.dtd.$block[f];if(c.checkReadOnly())return!1;c.deleteContents(1);c.startContainer.type==CKEDITOR.NODE_ELEMENT&&(c.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})?y(c):c.startContainer.is(CKEDITOR.dtd.$list)&&x(c));var k,g;if(h)for(;(k=c.getCommonAncestor(0,
|
|
366
|
+
1))&&(g=CKEDITOR.dtd[k.getName()])&&(!g||!g[f]);)if(k.getName()in CKEDITOR.dtd.span){var h=c.splitElement(k),l=c.createBookmark();b(k);b(h);c.moveToBookmark(l)}else c.checkStartOfBlock()&&c.checkEndOfBlock()?(c.setStartBefore(k),c.collapse(!0),k.remove()):c.splitBlock(e==CKEDITOR.ENTER_DIV?"div":"p",d.editable());c.insertNode(a);return!0},setData:function(a,c){c||(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 c=this.getHtml();a||(c=this.editor.dataProcessor.toDataFormat(c));return c},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 c=b.getDocument().$,d=c.getSelection(),e;a:if(d.anchorNode&&d.anchorNode==b.$)e=!0;else{if(CKEDITOR.env.webkit&&(e=b.getDocument().getActive())&&e.equals(b)&&!d.anchorNode){e=!0;break a}e=void 0}e&&(e=new CKEDITOR.dom.range(b),e.moveToElementEditStart(b),c=c.createRange(),c.setStart(e.startContainer.$,e.startOffset),c.collapse(!0),d.removeAllRanges(),d.addRange(c))}function c(){var a=b.getDocument().$,d=a.selection,e=b.getDocument().getActive();"None"==
|
|
369
369
|
d.type&&e.equals(b)&&(d=new CKEDITOR.dom.range(b),a=a.body.createTextRange(),d.moveToElementEditStart(b),d=d.startContainer,d.type!=CKEDITOR.NODE_ELEMENT&&(d=d.getParent()),a.moveToElementText(d.$),a.collapse(!0),a.select())}var b=this;if(CKEDITOR.env.ie&&(9>CKEDITOR.env.version||CKEDITOR.env.quirks))this.hasFocus&&(this.focus(),c());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
370
|
a={doc:this.getDocument(),range:a.clone()};z.eol.detect(a,this);z.bogus.exclude(a);z.cell.shrink(a);a.fragment=a.range.cloneContents();z.tree.rebuild(a,this);z.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},extractHtmlFromRange:function(a,c){var b=A,d={range:a,doc:a.document},e=this.getHtmlFromRange(a);if(a.collapsed)return a.optimize(),e;a.enlarge(CKEDITOR.ENLARGE_INLINE,1);b.table.detectPurge(d);d.bookmark=a.createBookmark();delete d.range;var f=this.editor.createRange();
|
|
371
371
|
f.moveToPosition(d.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);d.targetBookmark=f.createBookmark();b.list.detectMerge(d,this);b.table.detectRanges(d,this);b.block.detectMerge(d,this);d.tableContentsRanges?(b.table.deleteRanges(d),a.moveToBookmark(d.bookmark),d.range=a):(a.moveToBookmark(d.bookmark),d.range=a,a.extractContents(b.detectExtractMerge(d)));a.moveToBookmark(d.targetBookmark);a.optimize();b.fixUneditableRangePosition(a);b.list.merge(d,this);b.table.purge(d,this);b.block.merge(d,this);
|
|
372
|
-
if(c){b=a.startPath();if(d=a.checkStartOfBlock()&&a.checkEndOfBlock()&&b.block&&!a.root.equals(b.block)){a:{var d=b.block.getElementsByTag("span"),f=0,
|
|
373
|
-
this.getData();this.is("textarea")||!1!==a.config.ignoreEmptyParagraph&&(c=c.replace(
|
|
372
|
+
if(c){b=a.startPath();if(d=a.checkStartOfBlock()&&a.checkEndOfBlock()&&b.block&&!a.root.equals(b.block)){a:{var d=b.block.getElementsByTag("span"),f=0,h;if(d)for(;h=d.getItem(f++);)if(!p(h)){d=!0;break a}d=!1}d=!d}d&&(a.moveToPosition(b.block,CKEDITOR.POSITION_BEFORE_START),b.block.remove())}else b.autoParagraph(this.editor,a),q(a.startContainer)&&a.startContainer.appendBogus();a.startContainer.mergeSiblings();return e},setup:function(){var a=this.editor;this.attachListener(a,"beforeGetData",function(){var c=
|
|
373
|
+
this.getData();this.is("textarea")||!1!==a.config.ignoreEmptyParagraph&&(c=c.replace(r,function(a,c){return c}));a.setData(c,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 c=a.getSelection();(c=c&&c.getNative())&&"Control"==c.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 c=a.editable();
|
|
376
376
|
null!=a._.previousScrollTop&&c.getDocument().equals(CKEDITOR.document)&&(c.$.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 d=a.document;this.changeAttr("spellcheck",
|
|
377
|
-
!a.config.disableNativeSpellChecker);var e=a.config.contentsLangDirection;this.getDirection(1)!=e&&this.changeAttr("dir",e);var
|
|
378
|
-
e+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){a=a.data;var c=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");c&&2!=a.$.button&&c.isReadOnly()&&a.preventDefault()});var l={8:1,46:1};this.attachListener(a,"key",function(c){if(a.readOnly)return!0;var b=c.data.domEvent.getKey(),d;c=a.getSelection();if(0!==c.getRanges().length){if(b in l){var e,f=c.getRanges()[0],
|
|
379
|
-
11>CKEDITOR.env.version&&(e=c.getSelectedElement())||(e=m(c))?(a.fire("saveSnapshot"),f.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),e.remove(),f.select(),a.fire("saveSnapshot"),d=1):f.collapsed&&((k=
|
|
380
|
-
d=1):
|
|
381
|
-
this.attachListener(this,"keyup",function(c){c.data.getKeystroke()in l&&!this.getFirst(f)&&(this.appendBogus(),c=a.createRange(),c.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),c.select())});this.attachListener(this,"dblclick",function(c){if(a.readOnly)return!1;c={element:c.data.getTarget()};a.fire("doubleclick",c)});CKEDITOR.env.ie&&this.attachListener(this,"click",
|
|
382
|
-
"input","textarea","select")&&!b.isReadOnly()&&(a.getSelection().selectElement(b),b.is("input","textarea","select")&&c.data.preventDefault())});CKEDITOR.env.edge&&this.attachListener(this,"mouseup",function(c){(c=c.data.getTarget())&&c.is("img")&&!c.isReadOnly()&&a.getSelection().selectElement(c)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(c){if(2==c.data.$.button&&(c=c.data.getTarget(),!c.getAscendant("table")&&!c.getOuterHtml().replace(
|
|
377
|
+
!a.config.disableNativeSpellChecker);var e=a.config.contentsLangDirection;this.getDirection(1)!=e&&this.changeAttr("dir",e);var h=CKEDITOR.getCss();if(h){var e=d.getHead(),k=e.getCustomData("stylesheet");k?h!=k.getText()&&(CKEDITOR.env.ie&&9>CKEDITOR.env.version?k.$.styleSheet.cssText=h:k.setText(h)):(h=d.appendStyleText(h),h=new CKEDITOR.dom.element(h.ownerNode||h.owningElement),e.setCustomData("stylesheet",h),h.data("cke-temp",1))}e=d.getCustomData("stylesheet_ref")||0;d.setCustomData("stylesheet_ref",
|
|
378
|
+
e+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){a=a.data;var c=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");c&&2!=a.$.button&&c.isReadOnly()&&a.preventDefault()});var l={8:1,46:1};this.attachListener(a,"key",function(c){if(a.readOnly)return!0;var b=c.data.domEvent.getKey(),d;c=a.getSelection();if(0!==c.getRanges().length){if(b in l){var e,f=c.getRanges()[0],h=f.startPath(),k,g,p,b=8==b;CKEDITOR.env.ie&&
|
|
379
|
+
11>CKEDITOR.env.version&&(e=c.getSelectedElement())||(e=m(c))?(a.fire("saveSnapshot"),f.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),e.remove(),f.select(),a.fire("saveSnapshot"),d=1):f.collapsed&&((k=h.block)&&(p=k[b?"getPrevious":"getNext"](n))&&p.type==CKEDITOR.NODE_ELEMENT&&p.is("table")&&f[b?"checkStartOfBlock":"checkEndOfBlock"]()?(a.fire("saveSnapshot"),f[b?"checkEndOfBlock":"checkStartOfBlock"]()&&k.remove(),f["moveToElementEdit"+(b?"End":"Start")](p),f.select(),a.fire("saveSnapshot"),
|
|
380
|
+
d=1):h.blockLimit&&h.blockLimit.is("td")&&(g=h.blockLimit.getAscendant("table"))&&f.checkBoundaryOfElement(g,b?CKEDITOR.START:CKEDITOR.END)&&(p=g[b?"getPrevious":"getNext"](n))?(a.fire("saveSnapshot"),f["moveToElementEdit"+(b?"End":"Start")](p),f.checkStartOfBlock()&&f.checkEndOfBlock()?p.remove():f.select(),a.fire("saveSnapshot"),d=1):(g=h.contains(["td","th","caption"]))&&f.checkBoundaryOfElement(g,b?CKEDITOR.START:CKEDITOR.END)&&(d=1))}return!d}});a.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&
|
|
381
|
+
this.attachListener(this,"keyup",function(c){c.data.getKeystroke()in l&&!this.getFirst(f)&&(this.appendBogus(),c=a.createRange(),c.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),c.select())});this.attachListener(this,"dblclick",function(c){if(a.readOnly)return!1;c={element:c.data.getTarget()};a.fire("doubleclick",c)});CKEDITOR.env.ie&&this.attachListener(this,"click",g);CKEDITOR.env.ie&&!CKEDITOR.env.edge||this.attachListener(this,"mousedown",function(c){var b=c.data.getTarget();b.is("img","hr",
|
|
382
|
+
"input","textarea","select")&&!b.isReadOnly()&&(a.getSelection().selectElement(b),b.is("input","textarea","select")&&c.data.preventDefault())});CKEDITOR.env.edge&&this.attachListener(this,"mouseup",function(c){(c=c.data.getTarget())&&c.is("img")&&!c.isReadOnly()&&a.getSelection().selectElement(c)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(c){if(2==c.data.$.button&&(c=c.data.getTarget(),!c.getAscendant("table")&&!c.getOuterHtml().replace(r,""))){var b=a.createRange();b.moveToElementEditStart(c);
|
|
383
383
|
b.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 d=b.data.domEvent.getKey();if(d in l&&(b=a.getSelection(),0!==b.getRanges().length)){var d=8==d,e=b.getRanges()[0];b=e.startPath();if(e.collapsed)a:{var f=
|
|
384
|
-
b.block;if(f&&e[d?"checkStartOfBlock":"checkEndOfBlock"]()&&e.moveToClosestEditablePosition(f,!d)&&e.collapsed){if(e.startContainer.type==CKEDITOR.NODE_ELEMENT){var
|
|
385
|
-
e:f,!1);b.lastElement.mergeSiblings();c(f,e,!d);k.selectBookmarks(
|
|
384
|
+
b.block;if(f&&e[d?"checkStartOfBlock":"checkEndOfBlock"]()&&e.moveToClosestEditablePosition(f,!d)&&e.collapsed){if(e.startContainer.type==CKEDITOR.NODE_ELEMENT){var h=e.startContainer.getChild(e.startOffset-(d?1:0));if(h&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("hr")){a.fire("saveSnapshot");h.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=(d?e:f).getBogus())&&k.remove();k=a.getSelection();h=k.createBookmarks();(d?f:e).moveChildren(d?
|
|
385
|
+
e:f,!1);b.lastElement.mergeSiblings();c(f,e,!d);k.selectBookmarks(h);b=!0}}else b=!1}else d=e,k=b.block,e=d.endPath().block,k&&e&&!k.equals(e)?(a.fire("saveSnapshot"),(f=k.getBogus())&&f.remove(),d.enlarge(CKEDITOR.ENLARGE_INLINE),d.deleteContents(),e.getParent()&&(e.moveChildren(k,!1),b.lastElement.mergeSiblings(),c(k,e,!0)),d=a.getSelection().getRanges()[0],d.collapse(1),d.optimize(),""===d.startContainer.getHtml()&&d.startContainer.appendBogus(),d.select(),b=!0):b=!1;if(!b)return;a.getSelection().scrollIntoView();
|
|
386
386
|
a.fire("saveSnapshot");return!1}},this,null,100)}},getUniqueId:function(){var a;try{this._.expandoNumber=a=CKEDITOR.dom.domObject.prototype.getUniqueId.call(this)}catch(c){a=this._&&this._.expandoNumber}return a}},_:{cleanCustomData:function(){this.removeClass("cke_editable");this.restoreAttrs();for(var a=this.removeCustomData("classes");a&&a.length;)this.removeClass(a.pop());if(!this.is("textarea")){var a=this.getDocument(),c=a.getHead();if(c.getCustomData("stylesheet")){var b=a.getCustomData("stylesheet_ref");
|
|
387
387
|
--b?a.setCustomData("stylesheet_ref",b):(a.removeCustomData("stylesheet_ref"),c.removeCustomData("stylesheet").remove())}}}}});CKEDITOR.editor.prototype.editable=function(a){var c=this._.editable;if(c&&a)return 0;if(!arguments.length)return c;a?c=a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,a):(c&&c.detach(),c=null);return this._.editable=c};CKEDITOR.on("instanceLoaded",function(c){var b=c.editor;b.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))});b.on("selectionChange",function(c){if(!b.readOnly){var d=b.getSelection();d&&!d.isLocked&&(d=b.checkDirty(),b.fire("lockSnapshot"),a(c),b.fire("unlockSnapshot"),!d&&b.resetDirty())}})});CKEDITOR.on("instanceCreated",function(a){var c=a.editor;c.on("mode",function(){var a=c.editable();if(a&&a.isInline()){var b=c.title;a.changeAttr("role",
|
|
389
389
|
"textbox");a.changeAttr("aria-multiline","true");a.changeAttr("aria-label",b);b&&a.changeAttr("title",b);var d=c.fire("ariaEditorHelpLabel",{}).label;if(d&&(b=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents"))){var e=CKEDITOR.tools.getNextId(),d=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+e+'" class\x3d"cke_voice_label"\x3e'+d+"\x3c/span\x3e");b.append(d);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
|
-
v;++m)e=
|
|
392
|
-
f=c.getChildren(),
|
|
393
|
-
(k=
|
|
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},
|
|
395
|
-
z.shrink(CKEDITOR.SHRINK_ELEMENT,!0,!1)&&(E=CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",z.document),z.insertNode(E),z.setStartAfter(E));T=new CKEDITOR.dom.elementPath(z.startContainer);F.endPath=ba=new CKEDITOR.dom.elementPath(z.endContainer);if(!z.collapsed){
|
|
396
|
-
CKEDITOR.POSITION_BEFORE_END);l(z,F.blockLimit,T,ba);E&&(z.setEndBefore(E),z.collapse(),E.remove());E=z.startPath();if(
|
|
397
|
-
|
|
398
|
-
{context:null,fixForBody:!1,protectedWhitespaces:!!X,dontFilter:F.dontFilter,filter:F.editor.activeFilter,enterMode:F.editor.activeEnterMode});p
|
|
399
|
-
O.remove()}}F.dataWrapper=p
|
|
400
|
-
ba==CKEDITOR.POSITION_IDENTICAL||ba==CKEDITOR.POSITION_CONTAINS?A=0:(
|
|
401
|
-
(E=1);if(E&&z.isElement){A=O.startContainer;for(
|
|
402
|
-
z.lastNotAllowed&&V<y.length-1&&((aa=
|
|
403
|
-
if(aa)for(;R=aa.pop();)CKEDITOR.env.needsBrFiller?R.appendBogus():R.append(Q.document.createText(" "));for(;R=F.mergeCandidates.pop();)R.mergeSiblings();Q.moveToBookmark(ga);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(
|
|
390
|
+
n=CKEDITOR.dom.walker.whitespaces(!0);p=CKEDITOR.dom.walker.bookmark(!1,!0);q=CKEDITOR.dom.walker.empty();t=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(c){return c.type==CKEDITOR.NODE_ELEMENT}function c(b,d){var e,f,h,k,g=[],l=d.range.startContainer;e=d.range.startPath();for(var l=n[l.getName()],m=0,p=b.getChildren(),v=p.count(),x=-1,G=-1,q=0,y=e.contains(n.$list);m<
|
|
391
|
+
v;++m)e=p.getItem(m),a(e)?(h=e.getName(),y&&h in CKEDITOR.dtd.$list?g=g.concat(c(e,d)):(k=!!l[h],"br"!=h||!e.data("cke-eol")||m&&m!=v-1||(q=(f=m?g[m-1].node:p.getItem(m+1))&&(!a(f)||!f.is("br")),f=f&&a(f)&&n.$block[f.getName()]),-1!=x||k||(x=m),k||(G=m),g.push({isElement:1,isLineBreak:q,isBlock:e.isBlockBoundary(),hasBlockSibling:f,node:e,name:h,allowed:k}),f=q=0)):g.push({isElement:0,node:e,allowed:1});-1<x&&(g[x].firstNotAllowed=1);-1<G&&(g[G].lastNotAllowed=1);return g}function d(c,b){var e=[],
|
|
392
|
+
f=c.getChildren(),h=f.count(),k,g=0,l=n[b],m=!c.is(n.$inline)||c.is("br");for(m&&e.push(" ");g<h;g++)k=f.getItem(g),a(k)&&!k.is(l)?e=e.concat(d(k,b)):e.push(k);m&&e.push(" ");return e}function e(c){return a(c.startContainer)&&c.startContainer.getChild(c.startOffset-1)}function g(c){return c&&a(c)&&(c.is(n.$removeEmpty)||c.is("a")&&!c.isBlockBoundary())}function l(c,b,d,e){var f=c.clone(),h,k;f.setEndAt(b,CKEDITOR.POSITION_BEFORE_END);(h=(new CKEDITOR.dom.walker(f)).next())&&a(h)&&p[h.getName()]&&
|
|
393
|
+
(k=h.getPrevious())&&a(k)&&!k.getParent().equals(c.startContainer)&&d.contains(k)&&e.contains(h)&&h.isIdentical(k)&&(h.moveChildren(k),h.remove(),l(c,b,d,e))}function m(c,b){function d(c,b){if(b.isBlock&&b.isElement&&!b.node.is("br")&&a(c)&&c.is("br"))return c.remove(),1}var e=b.endContainer.getChild(b.endOffset),f=b.endContainer.getChild(b.endOffset-1);e&&d(e,c[c.length-1]);f&&d(f,c[0])&&(b.setEnd(b.endContainer,b.endOffset-1),b.collapse())}var n=CKEDITOR.dtd,p={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,
|
|
394
|
+
h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},v={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},x=CKEDITOR.tools.extend({},n.$inline);delete x.br;return function(p,F,L,q){var y=p.editor,z=!1;"unfiltered_html"==F&&(F="html",z=!0);if(!q.checkReadOnly()){var r=(new CKEDITOR.dom.elementPath(q.startContainer,q.root)).blockLimit||q.root;F={type:F,dontFilter:z,editable:p,editor:y,range:q,blockLimit:r,mergeCandidates:[],zombies:[]};var z=F.range,r=F.mergeCandidates,A="html"===F.type,t,E,T,ba,ca,V;"text"==F.type&&
|
|
395
|
+
z.shrink(CKEDITOR.SHRINK_ELEMENT,!0,!1)&&(E=CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",z.document),z.insertNode(E),z.setStartAfter(E));T=new CKEDITOR.dom.elementPath(z.startContainer);F.endPath=ba=new CKEDITOR.dom.elementPath(z.endContainer);if(!z.collapsed){t=ba.block||ba.blockLimit;var ea=z.getCommonAncestor();t&&!t.equals(ea)&&!t.contains(ea)&&z.checkEndOfBlock()&&F.zombies.push(t);z.deleteContents()}for(;(ca=e(z))&&a(ca)&&ca.isBlockBoundary()&&T.contains(ca);)z.moveToPosition(ca,
|
|
396
|
+
CKEDITOR.POSITION_BEFORE_END);l(z,F.blockLimit,T,ba);E&&(z.setEndBefore(E),z.collapse(),E.remove());E=z.startPath();if(t=E.contains(g,!1,1))V=z.splitElement(t),F.inlineStylesRoot=t,F.inlineStylesPeak=E.lastElement;E=z.createBookmark();A&&(b(t),b(V));(t=E.startNode.getPrevious(f))&&a(t)&&g(t)&&r.push(t);(t=E.startNode.getNext(f))&&a(t)&&g(t)&&r.push(t);for(t=E.startNode;(t=t.getParent())&&g(t);)r.push(t);z.moveToBookmark(E);y.enterMode===CKEDITOR.ENTER_DIV&&""===y.getData(!0)&&((y=p.getFirst())&&y.remove(),
|
|
397
|
+
q.setStartAt(p,CKEDITOR.POSITION_AFTER_START),q.collapse(!0));if(p=L){p=F.range;if("text"==F.type&&F.inlineStylesRoot){q=F.inlineStylesPeak;y=q.getDocument().createText("{cke-peak}");for(V=F.inlineStylesRoot.getParent();!q.equals(V);)y=y.appendTo(q.clone()),q=q.getParent();L=y.getOuterHtml().split("{cke-peak}").join(L)}q=F.blockLimit.getName();if(/^\s+|\s+$/.test(L)&&"span"in CKEDITOR.dtd[q]){var X='\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e';L=X+L+X}L=F.editor.dataProcessor.toHtml(L,
|
|
398
|
+
{context:null,fixForBody:!1,protectedWhitespaces:!!X,dontFilter:F.dontFilter,filter:F.editor.activeFilter,enterMode:F.editor.activeEnterMode});q=p.document.createElement("body");q.setHtml(L);X&&(q.getFirst().remove(),q.getLast().remove());if((X=p.startPath().block)&&(1!=X.getChildCount()||!X.getBogus()))a:{var O;if(1==q.getChildCount()&&a(O=q.getFirst())&&O.is(v)&&!O.hasAttribute("contenteditable")){X=O.getElementsByTag("*");p=0;for(V=X.count();p<V;p++)if(y=X.getItem(p),!y.is(x))break a;O.moveChildren(O.getParent(1));
|
|
399
|
+
O.remove()}}F.dataWrapper=q;p=L}if(p){O=F.range;p=O.document;q=F.blockLimit;V=0;var Q,X=[],R,U;L=E=0;var aa,y=O.startContainer;ca=F.endPath.elements[0];var ga,z=ca.getPosition(y),r=!!ca.getCommonAncestor(y)&&z!=CKEDITOR.POSITION_IDENTICAL&&!(z&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED),y=c(F.dataWrapper,F);for(m(y,O);V<y.length;V++){z=y[V];if(A=z.isLineBreak)A=O,t=q,ba=T=void 0,z.hasBlockSibling?A=1:(T=A.startContainer.getAscendant(n.$block,1))&&T.is({div:1,p:1})?(ba=T.getPosition(t),
|
|
400
|
+
ba==CKEDITOR.POSITION_IDENTICAL||ba==CKEDITOR.POSITION_CONTAINS?A=0:(t=A.splitElement(T),A.moveToPosition(t,CKEDITOR.POSITION_AFTER_START),A=1)):A=0;if(A)L=0<V;else{A=O.startPath();!z.isBlock&&k(F.editor,A.block,A.blockLimit)&&(U=h(F.editor))&&(U=p.createElement(U),U.appendBogus(),O.insertNode(U),CKEDITOR.env.needsBrFiller&&(Q=U.getBogus())&&Q.remove(),O.moveToPosition(U,CKEDITOR.POSITION_BEFORE_END));if((A=O.startPath().block)&&!A.equals(R)){if(Q=A.getBogus())Q.remove(),X.push(A);R=A}z.firstNotAllowed&&
|
|
401
|
+
(E=1);if(E&&z.isElement){A=O.startContainer;for(t=null;A&&!n[A.getName()][z.name];){if(A.equals(q)){A=null;break}t=A;A=A.getParent()}if(A)t&&(aa=O.splitElement(t),F.zombies.push(aa),F.zombies.push(t));else{t=q.getName();ga=!V;A=V==y.length-1;t=d(z.node,t);T=[];ba=t.length;for(var ea=0,ia=void 0,ja=0,da=-1;ea<ba;ea++)ia=t[ea]," "==ia?(ja||ga&&!ea||(T.push(new CKEDITOR.dom.text(" ")),da=T.length),ja=1):(T.push(ia),ja=0);A&&da==T.length&&T.pop();ga=T}}if(ga){for(;A=ga.pop();)O.insertNode(A);ga=0}else O.insertNode(z.node);
|
|
402
|
+
z.lastNotAllowed&&V<y.length-1&&((aa=r?ca:aa)&&O.setEndAt(aa,CKEDITOR.POSITION_AFTER_START),E=0);O.collapse()}}1!=y.length?Q=!1:(Q=y[0],Q=Q.isElement&&"false"==Q.node.getAttribute("contenteditable"));Q&&(L=!0,A=y[0].node,O.setStartAt(A,CKEDITOR.POSITION_BEFORE_START),O.setEndAt(A,CKEDITOR.POSITION_AFTER_END));F.dontMoveCaret=L;F.bogusNeededBlocks=X}Q=F.range;var fa;aa=F.bogusNeededBlocks;for(ga=Q.createBookmark();R=F.zombies.pop();)R.getParent()&&(U=Q.clone(),U.moveToElementEditStart(R),U.removeEmptyBlocksAtEnd());
|
|
403
|
+
if(aa)for(;R=aa.pop();)CKEDITOR.env.needsBrFiller?R.appendBogus():R.append(Q.document.createText(" "));for(;R=F.mergeCandidates.pop();)R.mergeSiblings();Q.moveToBookmark(ga);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(g(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)}}}}();y=function(){function a(c){c=
|
|
404
404
|
new CKEDITOR.dom.walker(c);c.guard=function(a,c){if(c)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$tableContent)};c.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT};return c}function c(a,b,d){b=a.getDocument().createElement(b);a.append(b,d);return b}function b(a){var c=a.count(),d;for(c;0<c--;)d=a.getItem(c),CKEDITOR.tools.trim(d.getHtml())||(d.appendBogus(),CKEDITOR.env.ie&&9>CKEDITOR.env.version&&d.getChildCount()&&d.getFirst().remove())}return function(d){var e=
|
|
405
|
-
d.startContainer,f=e.getAscendant("table",1),
|
|
406
|
-
CKEDITOR.POSITION_BEFORE_END))}}();
|
|
407
|
-
d=!0);e||(e=b);e.is(CKEDITOR.dtd.$list)?(c.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),c.collapse(!0),e.remove()):((b=e.getBogus())&&b.remove(),c.moveToPosition(e,d?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END),c.select())}}();z={eol:{detect:function(a,c){var b=a.range,d=b.clone(),e=b.clone(),f=new CKEDITOR.dom.elementPath(b.startContainer,c),
|
|
408
|
-
a.prependEolBr=1);
|
|
409
|
-
a.range.setEndBefore(c)}},tree:{rebuild:function(a,c){var b=a.range,d=b.getCommonAncestor(),e=new CKEDITOR.dom.elementPath(d,c),f=new CKEDITOR.dom.elementPath(b.startContainer,c),b=new CKEDITOR.dom.elementPath(b.endContainer,c),
|
|
410
|
-
!f.equals(b))){var
|
|
411
|
-
e&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};A=function(){function a(c,b){var d=c.getParent();if(d.is(CKEDITOR.dtd.$inline))c[b?"insertBefore":"insertAfter"](d)}function c(b,d,e){a(d);a(e,1);for(var f;f=e.getNext();)f.insertAfter(d),d=f;
|
|
412
|
-
a.mergeList=
|
|
413
|
-
b);if(a.mergeList){var k=f.contains(CKEDITOR.dtd.$list),h
|
|
414
|
-
merge:function(a,b){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var d=a.mergeBlockBookmark.startNode,e=a.mergeBlockBookmark.endNode,f=new CKEDITOR.dom.elementPath(d,b),
|
|
415
|
-
CKEDITOR.dom.element.setMarker(l,a,m,1)}if(
|
|
416
|
-
e.push(f))}};
|
|
417
|
-
f=c.endPath().contains("table");b&&f&&c.checkBoundaryOfElement(b,CKEDITOR.START)&&c.checkBoundaryOfElement(f,CKEDITOR.END)&&(c=a.range.clone(),c.setStartBefore(b),c.setEndAfter(f),a.purgeTableBookmark=c.createBookmark())}},detectRanges:function(e,f){var
|
|
418
|
-
l=l.contains("table");if(m||l)m&&l&&c(m,l)?(e.tableSurroundingRange=k,k.setStartAt(m,CKEDITOR.POSITION_AFTER_END),k.setEndAt(l,CKEDITOR.POSITION_BEFORE_START),k=
|
|
419
|
-
e.tableContentsRanges=
|
|
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,c){var b=c.startPath(),d;k(a,b.block,b.blockLimit)&&(d=
|
|
421
|
-
CKEDITOR.plugins.widget.isDomWidget(a)}function l(c,b){if(0===c.length||a(c[0].getEnclosedNode()))return!1;var d,e;if((d=!b&&1===c.length)&&!(d=c[0].collapsed)){var f=c[0];d=f.startContainer.getAscendant({td:1,th:1},!0);var
|
|
422
|
-
!d)return!1;return!0}function
|
|
405
|
+
d.startContainer,f=e.getAscendant("table",1),h=!1;b(f.getElementsByTag("td"));b(f.getElementsByTag("th"));f=d.clone();f.setStart(e,0);f=a(f).lastBackward();f||(f=d.clone(),f.setEndAt(e,CKEDITOR.POSITION_BEFORE_END),f=a(f).lastForward(),h=!0);f||(f=e);f.is("table")?(d.setStartAt(f,CKEDITOR.POSITION_BEFORE_START),d.collapse(!0),f.remove()):(f.is({tbody:1,thead:1,tfoot:1})&&(f=c(f,"tr",h)),f.is("tr")&&(f=c(f,f.getParent().is("thead")?"th":"td",h)),(e=f.getBogus())&&e.remove(),d.moveToPosition(f,h?CKEDITOR.POSITION_AFTER_START:
|
|
406
|
+
CKEDITOR.POSITION_BEFORE_END))}}();x=function(){function a(c){c=new CKEDITOR.dom.walker(c);c.guard=function(a,c){if(c)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$list)||a.is(CKEDITOR.dtd.$listItem)};c.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$listItem)};return c}return function(c){var b=c.startContainer,d=!1,e;e=c.clone();e.setStart(b,0);e=a(e).lastBackward();e||(e=c.clone(),e.setEndAt(b,CKEDITOR.POSITION_BEFORE_END),e=a(e).lastForward(),
|
|
407
|
+
d=!0);e||(e=b);e.is(CKEDITOR.dtd.$list)?(c.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),c.collapse(!0),e.remove()):((b=e.getBogus())&&b.remove(),c.moveToPosition(e,d?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END),c.select())}}();z={eol:{detect:function(a,c){var b=a.range,d=b.clone(),e=b.clone(),f=new CKEDITOR.dom.elementPath(b.startContainer,c),h=new CKEDITOR.dom.elementPath(b.endContainer,c);d.collapse(1);e.collapse();f.block&&d.checkBoundaryOfElement(f.block,CKEDITOR.END)&&(b.setStartAfter(f.block),
|
|
408
|
+
a.prependEolBr=1);h.block&&e.checkBoundaryOfElement(h.block,CKEDITOR.START)&&(b.setEndBefore(h.block),a.appendEolBr=1)},fix:function(a,c){var b=c.getDocument(),d;a.appendEolBr&&(d=this.createEolBr(b),a.fragment.append(d));!a.prependEolBr||d&&!d.getPrevious()||a.fragment.append(this.createEolBr(b),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}},bogus:{exclude:function(a){var c=a.range.getBoundaryNodes(),b=c.startNode,c=c.endNode;!c||!t(c)||b&&b.equals(c)||
|
|
409
|
+
a.range.setEndBefore(c)}},tree:{rebuild:function(a,c){var b=a.range,d=b.getCommonAncestor(),e=new CKEDITOR.dom.elementPath(d,c),f=new CKEDITOR.dom.elementPath(b.startContainer,c),b=new CKEDITOR.dom.elementPath(b.endContainer,c),h;d.type==CKEDITOR.NODE_TEXT&&(d=d.getParent());if(e.blockLimit.is({tr:1,table:1})){var k=e.contains("table").getParent();h=function(a){return!a.equals(k)}}else if(e.block&&e.block.is(CKEDITOR.dtd.$listItem)&&(f=f.contains(CKEDITOR.dtd.$list),b=b.contains(CKEDITOR.dtd.$list),
|
|
410
|
+
!f.equals(b))){var g=e.contains(CKEDITOR.dtd.$list).getParent();h=function(a){return!a.equals(g)}}h||(h=function(a){return!a.equals(e.block)&&!a.equals(e.blockLimit)});this.rebuildFragment(a,c,d,h)},rebuildFragment:function(a,c,b,d){for(var e;b&&!b.equals(c)&&d(b);)e=b.clone(0,1),a.fragment.appendTo(e),a.fragment=e,b=b.getParent()}},cell:{shrink:function(a){a=a.range;var c=a.startContainer,b=a.endContainer,d=a.startOffset,e=a.endOffset;c.type==CKEDITOR.NODE_ELEMENT&&c.equals(b)&&c.is("tr")&&++d==
|
|
411
|
+
e&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};A=function(){function a(c,b){var d=c.getParent();if(d.is(CKEDITOR.dtd.$inline))c[b?"insertBefore":"insertAfter"](d)}function c(b,d,e){a(d);a(e,1);for(var f;f=e.getNext();)f.insertAfter(d),d=f;q(b)&&b.remove()}function b(a,c){var d=new CKEDITOR.dom.range(a);d.setStartAfter(c.startNode);d.setEndBefore(c.endNode);return d}return{list:{detectMerge:function(a,c){var d=b(c,a.bookmark),e=d.startPath(),f=d.endPath(),h=e.contains(CKEDITOR.dtd.$list),k=f.contains(CKEDITOR.dtd.$list);
|
|
412
|
+
a.mergeList=h&&k&&h.getParent().equals(k.getParent())&&!h.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)d=d.clone(),d.setStartBefore(a.bookmark.startNode),d.setEndAfter(a.bookmark.endNode),a.mergeListBookmark=d.createBookmark()},merge:function(a,b){if(a.mergeListBookmark){var d=a.mergeListBookmark.startNode,e=a.mergeListBookmark.endNode,f=new CKEDITOR.dom.elementPath(d,b),h=new CKEDITOR.dom.elementPath(e,
|
|
413
|
+
b);if(a.mergeList){var k=f.contains(CKEDITOR.dtd.$list),g=h.contains(CKEDITOR.dtd.$list);k.equals(g)||(g.moveChildren(k),g.remove())}a.mergeListItems&&(f=f.contains(CKEDITOR.dtd.$listItem),h=h.contains(CKEDITOR.dtd.$listItem),f.equals(h)||c(h,d,e));d.remove();e.remove()}}},block:{detectMerge:function(a,c){if(!a.tableContentsRanges&&!a.mergeListBookmark){var b=new CKEDITOR.dom.range(c);b.setStartBefore(a.bookmark.startNode);b.setEndAfter(a.bookmark.endNode);a.mergeBlockBookmark=b.createBookmark()}},
|
|
414
|
+
merge:function(a,b){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var d=a.mergeBlockBookmark.startNode,e=a.mergeBlockBookmark.endNode,f=new CKEDITOR.dom.elementPath(d,b),h=new CKEDITOR.dom.elementPath(e,b),f=f.block,h=h.block;f&&h&&!f.equals(h)&&c(h,d,e);d.remove();e.remove()}}},table:function(){function a(b){var e=[],f,h=new CKEDITOR.dom.walker(b),k=b.startPath().contains(d),g=b.endPath().contains(d),l={};h.guard=function(a,h){if(a.type==CKEDITOR.NODE_ELEMENT){var m="visited_"+(h?"out":"in");if(a.getCustomData(m))return;
|
|
415
|
+
CKEDITOR.dom.element.setMarker(l,a,m,1)}if(h&&k&&a.equals(k))f=b.clone(),f.setEndAt(k,CKEDITOR.POSITION_BEFORE_END),e.push(f);else if(!h&&g&&a.equals(g))f=b.clone(),f.setStartAt(g,CKEDITOR.POSITION_AFTER_START),e.push(f);else{if(m=!h)m=a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&(!k||c(a,k))&&(!g||c(a,g));if(!m&&(m=h))if(a.is(d))var m=k&&k.getAscendant("table",!0),n=g&&g.getAscendant("table",!0),p=a.getAscendant("table",!0),m=m&&m.contains(p)||n&&n.contains(p);else m=void 0;m&&(f=b.clone(),f.selectNodeContents(a),
|
|
416
|
+
e.push(f))}};h.lastForward();CKEDITOR.dom.element.clearAllMarkers(l);return e}function c(a,b){var d=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,e=a.getPosition(b);return e===CKEDITOR.POSITION_IDENTICAL?!1:0===(e&d)}var d={td:1,th:1,caption:1};return{detectPurge:function(a){var c=a.range,b=c.clone();b.enlarge(CKEDITOR.ENLARGE_ELEMENT);var b=new CKEDITOR.dom.walker(b),e=0;b.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&++e};b.checkForward();if(1<e){var b=c.startPath().contains("table"),
|
|
417
|
+
f=c.endPath().contains("table");b&&f&&c.checkBoundaryOfElement(b,CKEDITOR.START)&&c.checkBoundaryOfElement(f,CKEDITOR.END)&&(c=a.range.clone(),c.setStartBefore(b),c.setEndAfter(f),a.purgeTableBookmark=c.createBookmark())}},detectRanges:function(e,f){var h=b(f,e.bookmark),k=h.clone(),g,l,m=h.getCommonAncestor();m.is(CKEDITOR.dtd.$tableContent)&&!m.is(d)&&(m=m.getAscendant("table",!0));l=m;m=new CKEDITOR.dom.elementPath(h.startContainer,l);l=new CKEDITOR.dom.elementPath(h.endContainer,l);m=m.contains("table");
|
|
418
|
+
l=l.contains("table");if(m||l)m&&l&&c(m,l)?(e.tableSurroundingRange=k,k.setStartAt(m,CKEDITOR.POSITION_AFTER_END),k.setEndAt(l,CKEDITOR.POSITION_BEFORE_START),k=h.clone(),k.setEndAt(m,CKEDITOR.POSITION_AFTER_END),g=h.clone(),g.setStartAt(l,CKEDITOR.POSITION_BEFORE_START),g=a(k).concat(a(g))):m?l||(e.tableSurroundingRange=k,k.setStartAt(m,CKEDITOR.POSITION_AFTER_END),h.setEndAt(m,CKEDITOR.POSITION_AFTER_END)):(e.tableSurroundingRange=k,k.setEndAt(l,CKEDITOR.POSITION_BEFORE_START),h.setStartAt(l,CKEDITOR.POSITION_AFTER_START)),
|
|
419
|
+
e.tableContentsRanges=g?g:a(h)},deleteRanges:function(a){for(var c;c=a.tableContentsRanges.pop();)c.extractContents(),q(c.startContainer)&&c.startContainer.appendBogus();a.tableSurroundingRange&&a.tableSurroundingRange.extractContents()},purge:function(a){if(a.purgeTableBookmark){var c=a.doc,b=a.range.clone(),c=c.createElement("p");c.insertBefore(a.purgeTableBookmark.startNode);b.moveToBookmark(a.purgeTableBookmark);b.deleteContents();a.range.moveToPosition(c,CKEDITOR.POSITION_AFTER_START)}}}}(),
|
|
420
|
+
detectExtractMerge:function(a){return!(a.range.startPath().contains(CKEDITOR.dtd.$listItem)&&a.range.endPath().contains(CKEDITOR.dtd.$listItem))},fixUneditableRangePosition:function(a){a.startContainer.getDtd()["#"]||a.moveToClosestEditablePosition(null,!0)},autoParagraph:function(a,c){var b=c.startPath(),d;k(a,b.block,b.blockLimit)&&(d=h(a))&&(d=c.document.createElement(d),d.appendBogus(),c.insertNode(d),c.moveToPosition(d,CKEDITOR.POSITION_AFTER_START))}}}()})();(function(){function a(a){return CKEDITOR.plugins.widget&&
|
|
421
|
+
CKEDITOR.plugins.widget.isDomWidget(a)}function l(c,b){if(0===c.length||a(c[0].getEnclosedNode()))return!1;var d,e;if((d=!b&&1===c.length)&&!(d=c[0].collapsed)){var f=c[0];d=f.startContainer.getAscendant({td:1,th:1},!0);var h=f.endContainer.getAscendant({td:1,th:1},!0);e=CKEDITOR.tools.trim;d&&d.equals(h)&&!d.findOne("td, th, tr, tbody, table")?(f=f.cloneContents(),d=f.getFirst()?e(f.getFirst().getText())!==e(d.getText()):!0):d=!1}if(d)return!1;for(e=0;e<c.length;e++)if(d=c[e]._getTableElement(),
|
|
422
|
+
!d)return!1;return!0}function g(a){function c(a){a=a.find("td, th");var b=[],d;for(d=0;d<a.count();d++)b.push(a.getItem(d));return b}var b=[],d,e;for(e=0;e<a.length;e++)d=a[e]._getTableElement(),d.is&&d.is({td:1,th:1})?b.push(d):b=b.concat(c(d));return b}function f(a){a=g(a);var c="",b=[],d,e;for(e=0;e<a.length;e++)d&&!d.equals(a[e].getAscendant("tr"))?(c+=b.join("\t")+"\n",d=a[e].getAscendant("tr"),b=[]):0===e&&(d=a[e].getAscendant("tr")),b.push(a[e].getText());return c+=b.join("\t")}function e(a){var c=
|
|
423
423
|
this.root.editor,b=c.getSelection(1);this.reset();A=!0;b.root.once("selectionchange",function(a){a.cancel()},null,null,0);b.selectRanges([a[0]]);b=this._.cache;b.ranges=new CKEDITOR.dom.rangeList(a);b.type=CKEDITOR.SELECTION_TEXT;b.selectedElement=a[0]._getTableElement();b.selectedText=f(a);b.nativeSel=null;this.isFake=1;this.rev=y++;c._.fakeSelection=this;A=!1;this.root.fire("selectionchange")}function m(){var c=this._.fakeSelection,b;if(c){b=this.getSelection(1);var d;if(!(d=!b)&&(d=!b.isHidden())){d=
|
|
424
|
-
c;var e=b.getRanges(),f=d.getRanges(),
|
|
425
|
-
!1;
|
|
426
|
-
path:b}))}function k(){
|
|
427
|
-
c(f,1)||!(e||f||d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()&&d.getBogus())?!0:!1}function c(a){n(a,!1);var c=a.getDocument().createText(
|
|
428
|
-
d.anchorNode==b.$&&d.anchorOffset>f&&(
|
|
424
|
+
c;var e=b.getRanges(),f=d.getRanges(),h=e.length&&e[0]._getTableElement()&&e[0]._getTableElement().getAscendant("table",!0),k=f.length&&f[0]._getTableElement()&&f[0]._getTableElement().getAscendant("table",!0),g=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(d.getSelectedElement()))d=!1;else{var n=1===e.length&&e[0].collapsed,f=l(e,!!CKEDITOR.env.webkit)&&l(f);h=h&&k?h.equals(k)||k.contains(h):
|
|
425
|
+
!1;h&&(n||f)?(g&&!m&&d.selectRanges(e),d=!0):d=!1}d=!d}d&&(c.reset(),c=0)}if(!c&&(c=b||this.getSelection(1),!c||c.getType()==CKEDITOR.SELECTION_NONE))return;this.fire("selectionCheck",c);b=this.elementPath();b.compare(this._.selectionPreviousPath)||(d=this._.selectionPreviousPath&&this._.selectionPreviousPath.blockLimit.equals(b.blockLimit),!CKEDITOR.env.webkit&&!CKEDITOR.env.gecko||d||(this._.previousActive=this.document.getActive()),this._.selectionPreviousPath=b,this.fire("selectionChange",{selection:c,
|
|
426
|
+
path:b}))}function k(){u=!0;w||(h.call(this),w=CKEDITOR.tools.setTimeout(h,200,this))}function h(){w=null;u&&(CKEDITOR.tools.setTimeout(m,0,this),u=!1)}function b(a){return D(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?!0:!1}function d(a){function c(b,d){return b&&b.type!=CKEDITOR.NODE_TEXT?a.clone()["moveToElementEdit"+(d?"End":"Start")](b):!1}if(!(a.root instanceof CKEDITOR.editable))return!1;var d=a.startContainer,e=a.getPreviousNode(b,null,d),f=a.getNextNode(b,null,d);return c(e)||
|
|
427
|
+
c(f,1)||!(e||f||d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()&&d.getBogus())?!0:!1}function c(a){n(a,!1);var c=a.getDocument().createText(x);a.setCustomData("cke-fillingChar",c);return c}function n(a,c){var b=a&&a.removeCustomData("cke-fillingChar");if(b){if(!1!==c){var d=a.getDocument().getSelection().getNative(),e=d&&"None"!=d.type&&d.getRangeAt(0),f=x.length;if(b.getLength()>f&&e&&e.intersectsNode(b.$)){var h=[{node:d.anchorNode,offset:d.anchorOffset},{node:d.focusNode,offset:d.focusOffset}];
|
|
428
|
+
d.anchorNode==b.$&&d.anchorOffset>f&&(h[0].offset-=f);d.focusNode==b.$&&d.focusOffset>f&&(h[1].offset-=f)}}b.setText(p(b.getText(),1));h&&(b=a.getDocument().$,d=b.getSelection(),b=b.createRange(),b.setStart(h[0].node,h[0].offset),b.collapse(!0),d.removeAllRanges(),d.addRange(b),d.extend(h[1].node,h[1].offset))}}function p(a,c){return c?a.replace(z,function(a,c){return c?" ":""}):a.replace(x,"")}function q(a,c){var b=c&&CKEDITOR.tools.htmlEncode(c)||"\x26nbsp;",b=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'+b+"\x3c/div\x3e",a.document);a.fire("lockSnapshot");a.editable().append(b);var d=a.getSelection(1),e=a.createRange(),f=d.root.on("selectionchange",function(a){a.cancel()},null,null,0);e.setStartAt(b,CKEDITOR.POSITION_AFTER_START);e.setEndAt(b,CKEDITOR.POSITION_BEFORE_END);d.selectRanges([e]);f.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=
|
|
430
|
-
b}function
|
|
431
|
-
b.startContainer,e;d&&!((e=d.type==CKEDITOR.NODE_ELEMENT)&&d.is("body")||!d.isReadOnly());)e&&"false"==d.getAttribute("contentEditable")&&b.setStartAfter(d),d=d.getParent();d=b.startContainer;e=b.endContainer;var f=b.startOffset,
|
|
432
|
-
d.isReadOnly()){var e=b.clone();b.setEndBefore(d);b.collapsed&&a.splice(c--,1);d.getPosition(k.endContainer)&CKEDITOR.POSITION_CONTAINS||(e.setStartAfter(d),e.collapsed||a.splice(c+1,0,e));return!0}return!1};d.next()}}return a}var v="function"!=typeof window.getSelection,y=1,
|
|
430
|
+
b}function t(a){var c={37:1,39:1,8:1,46:1};return function(b){var d=b.data.getKeystroke();if(c[d]){var e=a.getSelection().getRanges(),f=e[0];1==e.length&&f.collapsed&&(d=f[38>d?"getPreviousEditableNode":"getNextEditableNode"]())&&d.type==CKEDITOR.NODE_ELEMENT&&"false"==d.getAttribute("contenteditable")&&(a.getSelection().fake(d),b.data.preventDefault(),b.cancel())}}}function r(a){for(var c=0;c<a.length;c++){var b=a[c];b.getCommonAncestor().isReadOnly()&&a.splice(c,1);if(!b.collapsed){if(b.startContainer.isReadOnly())for(var d=
|
|
431
|
+
b.startContainer,e;d&&!((e=d.type==CKEDITOR.NODE_ELEMENT)&&d.is("body")||!d.isReadOnly());)e&&"false"==d.getAttribute("contentEditable")&&b.setStartAfter(d),d=d.getParent();d=b.startContainer;e=b.endContainer;var f=b.startOffset,h=b.endOffset,k=b.clone();d&&d.type==CKEDITOR.NODE_TEXT&&(f>=d.getLength()?k.setStartAfter(d):k.setStartBefore(d));e&&e.type==CKEDITOR.NODE_TEXT&&(h?k.setEndAfter(e):k.setEndBefore(e));d=new CKEDITOR.dom.walker(k);d.evaluator=function(d){if(d.type==CKEDITOR.NODE_ELEMENT&&
|
|
432
|
+
d.isReadOnly()){var e=b.clone();b.setEndBefore(d);b.collapsed&&a.splice(c--,1);d.getPosition(k.endContainer)&CKEDITOR.POSITION_CONTAINS||(e.setStartAfter(d),e.collapsed||a.splice(c+1,0,e));return!0}return!1};d.next()}}return a}var v="function"!=typeof window.getSelection,y=1,x=CKEDITOR.tools.repeat("",7),z=new RegExp(x+"( )?","g"),A,w,u,D=CKEDITOR.dom.walker.invisible(1),C=function(){function a(c){return function(a){var b=a.editor.createRange();b.moveToClosestEditablePosition(a.selected,c)&&a.editor.getSelection().selectRanges([b]);
|
|
433
433
|
return!1}}function c(a){return function(c){var b=c.editor,d=b.createRange(),e;if(!b.readOnly)return(e=d.moveToClosestEditablePosition(c.selected,a))||(e=d.moveToClosestEditablePosition(c.selected,!a)),e&&b.getSelection().selectRanges([d]),b.fire("saveSnapshot"),c.selected.remove(),e||(d.moveToElementEditablePosition(b.editable()),b.getSelection().selectRanges([d])),b.fire("saveSnapshot"),!1}}var b=a(),d=a(1);return{37:b,38:b,39:d,40:d,8:c(),46:c(1)}}();CKEDITOR.on("instanceCreated",function(a){function c(){var a=
|
|
434
|
-
b.getSelection();a&&a.removeAllRanges()}var b=a.editor;b.on("contentDom",function(){function a(){
|
|
435
|
-
!b.equals(
|
|
436
|
-
a.isCollapsed&&a.anchorNode==
|
|
437
|
-
"mousedown",function(){
|
|
438
|
-
a.data.$.button&&((a=b.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(y=b.window.getScrollPosition()))});
|
|
439
|
-
z.compareEndPoints("StartToStart",b)?"EndToEnd":"StartToStart",b);
|
|
440
|
-
(
|
|
441
|
-
"mouseup",function(){A&&k.call(b);A=0})}else
|
|
434
|
+
b.getSelection();a&&a.removeAllRanges()}var b=a.editor;b.on("contentDom",function(){function a(){x=new CKEDITOR.dom.selection(b.getSelection());x.lock()}function c(){h.removeListener("mouseup",c);p.removeListener("mouseup",c);var a=CKEDITOR.document.$.selection,b=a.createRange();"None"!=a.type&&b.parentElement()&&b.parentElement().ownerDocument==f.$&&b.select()}function d(a){var c,b;c=(c=this.document.getActive())?"input"===c.getName()||"textarea"===c.getName():!1;c||(c=this.getSelection(1),(b=e(c))&&
|
|
435
|
+
!b.equals(g)&&(c.selectElement(b),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=b.document,h=CKEDITOR.document,g=b.editable(),l=f.getBody(),p=f.getDocumentElement(),u=g.isInline(),q,x;CKEDITOR.env.gecko&&g.attachListener(g,"focus",function(a){a.removeListener();0!==q&&(a=b.getSelection().getNative())&&
|
|
436
|
+
a.isCollapsed&&a.anchorNode==g.$&&(a=b.createRange(),a.moveToElementEditStart(g),a.select())},null,null,-2);g.attachListener(g,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){if(q&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){q=b._.previousActive&&b._.previousActive.equals(f.getActive());var a=null!=b._.previousScrollTop&&b._.previousScrollTop!=g.$.scrollTop;CKEDITOR.env.webkit&&q&&a&&(g.$.scrollTop=b._.previousScrollTop)}b.unlockSelection(q);q=0},null,null,-1);g.attachListener(g,
|
|
437
|
+
"mousedown",function(){q=0});if(CKEDITOR.env.ie||CKEDITOR.env.gecko||u)v?g.attachListener(g,"beforedeactivate",a,null,null,-1):g.attachListener(b,"selectionCheck",a,null,null,-1),g.attachListener(g,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusout":"blur",function(){var a=x&&(x.isFake||2>x.getRanges().length);CKEDITOR.env.gecko&&!u&&a||(b.lockSelection(x),q=1)},null,null,-1),g.attachListener(g,"mousedown",function(){q=0});if(CKEDITOR.env.ie&&!u){var y;g.attachListener(g,"mousedown",function(a){2==
|
|
438
|
+
a.data.$.button&&((a=b.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(y=b.window.getScrollPosition()))});g.attachListener(g,"mouseup",function(a){2==a.data.$.button&&y&&(b.document.$.documentElement.scrollLeft=y.x,b.document.$.documentElement.scrollTop=y.y);y=null});if("BackCompat"!=f.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var w,z;p.on("mousedown",function(a){function c(a){a=a.data.$;if(w){var b=l.$.createTextRange();try{b.moveToPoint(a.clientX,a.clientY)}catch(d){}w.setEndPoint(0>
|
|
439
|
+
z.compareEndPoints("StartToStart",b)?"EndToEnd":"StartToStart",b);w.select()}}function b(){p.removeListener("mousemove",c);h.removeListener("mouseup",b);p.removeListener("mouseup",b);w.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y<p.$.clientHeight&&a.$.x<p.$.clientWidth){w=l.$.createTextRange();try{w.moveToPoint(a.$.clientX,a.$.clientY)}catch(d){}z=w.duplicate();p.on("mousemove",c);h.on("mouseup",b);p.on("mouseup",b)}})}if(7<CKEDITOR.env.version&&11>CKEDITOR.env.version)p.on("mousedown",function(a){a.data.getTarget().is("html")&&
|
|
440
|
+
(h.on("mouseup",c),p.on("mouseup",c))})}}g.attachListener(g,"selectionchange",m,b);g.attachListener(g,"keyup",k,b);g.attachListener(g,"touchstart",k,b);g.attachListener(g,"touchend",k,b);CKEDITOR.env.ie&&g.attachListener(g,"keydown",d,b);g.attachListener(g,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){b.forceNextSelectionCheck();b.selectionChange(1)});if(u&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var A;g.attachListener(g,"mousedown",function(){A=1});g.attachListener(f.getDocumentElement(),
|
|
441
|
+
"mouseup",function(){A&&k.call(b);A=0})}else g.attachListener(CKEDITOR.env.ie?g:f.getDocumentElement(),"mouseup",k,b);CKEDITOR.env.webkit&&g.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:g.hasFocus&&n(g)}},null,null,-1);g.attachListener(g,"keydown",t(b),null,null,-1)});b.on("setData",function(){b.unlockSelection();CKEDITOR.env.webkit&&c()});b.on("contentDomUnload",function(){b.unlockSelection()});if(CKEDITOR.env.ie9Compat)b.on("beforeDestroy",
|
|
442
442
|
c,null,null,9);b.on("dataReady",function(){delete b._.fakeSelection;delete b._.hiddenSelectionContainer;b.selectionChange(1)});b.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),c=b.editable().getLast(a);c&&c.hasAttribute("data-cke-hidden-sel")&&(c.remove(),CKEDITOR.env.gecko&&(a=b.editable().getFirst(a))&&a.is("br")&&a.getAttribute("_moz_editor_bogus_node")&&a.remove())},null,null,100);b.on("key",function(a){if("wysiwyg"==b.mode){var c=b.getSelection();if(c.isFake){var d=
|
|
443
|
-
C[a.data.keyCode];if(d)return d({editor:b,selected:c.getSelectedElement(),selection:c,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var c=a.editor;c.on("selectionChange",function(){var a=c.editable(),b=a.getCustomData("cke-fillingChar");b&&(b.getCustomData("ready")?(n(a),a.editor.fire("selectionCheck")):b.setCustomData("ready",1))},null,null,-1);c.on("beforeSetMode",function(){n(c.editable())},null,null,-1);c.on("getSnapshot",function(a){a.data&&(a.data=
|
|
444
|
-
c,null,20);c.on("toDataFormat",function(a){a.data.dataValue=
|
|
443
|
+
C[a.data.keyCode];if(d)return d({editor:b,selected:c.getSelectedElement(),selection:c,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var c=a.editor;c.on("selectionChange",function(){var a=c.editable(),b=a.getCustomData("cke-fillingChar");b&&(b.getCustomData("ready")?(n(a),a.editor.fire("selectionCheck")):b.setCustomData("ready",1))},null,null,-1);c.on("beforeSetMode",function(){n(c.editable())},null,null,-1);c.on("getSnapshot",function(a){a.data&&(a.data=p(a.data))},
|
|
444
|
+
c,null,20);c.on("toDataFormat",function(a){a.data.dataValue=p(a.data.dataValue)},null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(a){(a?m:k).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){return!this._.savedSelection&&!this._.fakeSelection||a?(a=this.editable())&&"wysiwyg"==this.mode?new CKEDITOR.dom.selection(a):null:this._.savedSelection||this._.fakeSelection};CKEDITOR.editor.prototype.getSelectedRanges=function(a){var c=this.getSelection();return c&&c.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 c=this._.savedSelection;return c?(c.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 c=a;a=a.root}var b=a instanceof CKEDITOR.dom.element;this.rev=c?c.rev:y++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=
|
|
447
447
|
b?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(c)return CKEDITOR.tools.extend(this._.cache,c._.cache),this.isFake=c.isFake,this.isLocked=c.isLocked,this;a=this.getNative();var d,e;if(a)if(a.getRangeAt)d=(e=a.rangeCount&&a.getRangeAt(0))&&new CKEDITOR.dom.node(e.commonAncestorContainer);else{try{e=a.createRange()}catch(f){}d=e&&CKEDITOR.dom.element.get(e.item&&e.item(0)||e.parentElement())}if(!d||d.type!=CKEDITOR.NODE_ELEMENT&&d.type!=CKEDITOR.NODE_TEXT||!this.root.equals(d)&&!this.root.contains(d))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 B={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:
|
|
448
|
+
CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var B={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:p,_createFillingCharSequenceNode:c,FILLING_CHAR_SEQUENCE:x});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==
|
|
449
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 c=CKEDITOR.SELECTION_NONE;try{var b=this.getNative(),d=b.type;"Text"==d&&(c=CKEDITOR.SELECTION_TEXT);"Control"==d&&(c=CKEDITOR.SELECTION_ELEMENT);b.createRange().parentElement()&&(c=CKEDITOR.SELECTION_TEXT)}catch(e){}return a.type=c}:function(){var a=this._.cache;if(a.type)return a.type;var c=
|
|
450
450
|
CKEDITOR.SELECTION_TEXT,b=this.getNative();if(!b||!b.rangeCount)c=CKEDITOR.SELECTION_NONE;else if(1==b.rangeCount){var b=b.getRangeAt(0),d=b.startContainer;d==b.endContainer&&1==d.nodeType&&1==b.endOffset-b.startOffset&&B[d.childNodes[b.startOffset].nodeName.toLowerCase()]&&(c=CKEDITOR.SELECTION_ELEMENT)}return a.type=c},getRanges:function(){var a=v?function(){function a(c){return(new CKEDITOR.dom.node(c)).getIndex()}var c=function(c,b){c=c.duplicate();c.collapse(b);var d=c.parentElement();if(!d.hasChildNodes())return{container:d,
|
|
451
|
-
offset:0};for(var e=d.children,f,
|
|
452
|
-
for(d=e.length;0<k&&0<d;)
|
|
451
|
+
offset:0};for(var e=d.children,f,h,k=c.duplicate(),g=0,l=e.length-1,m=-1,n,p;g<=l;)if(m=Math.floor((g+l)/2),f=e[m],k.moveToElementText(f),n=k.compareEndPoints("StartToStart",c),0<n)l=m-1;else if(0>n)g=m+1;else return{container:d,offset:a(f)};if(-1==m||m==e.length-1&&0>n){k.moveToElementText(d);k.setEndPoint("StartToStart",c);k=k.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!k)return f=e[e.length-1],f.nodeType!=CKEDITOR.NODE_TEXT?{container:d,offset:e.length}:{container:f,offset:f.nodeValue.length};
|
|
452
|
+
for(d=e.length;0<k&&0<d;)h=e[--d],h.nodeType==CKEDITOR.NODE_TEXT&&(p=h,k-=h.nodeValue.length);return{container:p,offset:-k}}k.collapse(0<n?!0:!1);k.setEndPoint(0<n?"StartToStart":"EndToStart",c);k=k.text.replace(/(\r\n|\r)/g,"\n").length;if(!k)return{container:d,offset:a(f)+(0<n?0:1)};for(;0<k;)try{h=f[0<n?"previousSibling":"nextSibling"],h.nodeType==CKEDITOR.NODE_TEXT&&(k-=h.nodeValue.length,p=h),f=h}catch(u){return{container:d,offset:a(f)}}return{container:p,offset:0<n?-k:p.nodeValue.length+k}};
|
|
453
453
|
return function(){var a=this.getNative(),b=a&&a.createRange(),d=this.getType();if(!a)return[];if(d==CKEDITOR.SELECTION_TEXT)return a=new CKEDITOR.dom.range(this.root),d=c(b,!0),a.setStart(new CKEDITOR.dom.node(d.container),d.offset),d=c(b),a.setEnd(new CKEDITOR.dom.node(d.container),d.offset),a.endContainer.getPosition(a.startContainer)&CKEDITOR.POSITION_PRECEDING&&a.endOffset<=a.startContainer.getIndex()&&a.collapse(),[a];if(d==CKEDITOR.SELECTION_ELEMENT){for(var d=[],e=0;e<b.length;e++){for(var f=
|
|
454
|
-
b.item(e),
|
|
455
|
-
return function(c){var b=this._.cache,d=b.ranges;d||(b.ranges=d=new CKEDITOR.dom.rangeList(a.call(this)));return c?
|
|
454
|
+
b.item(e),h=f.parentNode,k=0,a=new CKEDITOR.dom.range(this.root);k<h.childNodes.length&&h.childNodes[k]!=f;k++);a.setStart(new CKEDITOR.dom.node(h),k);a.setEnd(new CKEDITOR.dom.node(h),k+1);d.push(a)}return d}return[]}}():function(){var a=[],c,b=this.getNative();if(!b)return a;for(var d=0;d<b.rangeCount;d++){var e=b.getRangeAt(d);c=new CKEDITOR.dom.range(this.root);c.setStart(new CKEDITOR.dom.node(e.startContainer),e.startOffset);c.setEnd(new CKEDITOR.dom.node(e.endContainer),e.endOffset);a.push(c)}return a};
|
|
455
|
+
return function(c){var b=this._.cache,d=b.ranges;d||(b.ranges=d=new CKEDITOR.dom.rangeList(a.call(this)));return c?r(new CKEDITOR.dom.rangeList(d.slice())):d}}(),getStartElement:function(){var a=this._.cache;if(void 0!==a.startElement)return a.startElement;var c;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var b=this.getRanges()[0];if(b){if(b.collapsed)c=b.startContainer,c.type!=CKEDITOR.NODE_ELEMENT&&(c=c.getParent());else{for(b.optimize();c=
|
|
456
456
|
b.startContainer,b.startOffset==(c.getChildCount?c.getChildCount():c.getLength())&&!c.isBlockBoundary();)b.setStartAfter(c);c=b.startContainer;if(c.type!=CKEDITOR.NODE_ELEMENT)return c.getParent();if((c=c.getChild(b.startOffset))&&c.type==CKEDITOR.NODE_ELEMENT)for(b=c.getFirst();b&&b.type==CKEDITOR.NODE_ELEMENT;)c=b,b=b.getFirst();else c=b.startContainer}c=c.$}}return a.startElement=c?new CKEDITOR.dom.element(c):null},getSelectedElement:function(){var a=this._.cache;if(void 0!==a.selectedElement)return a.selectedElement;
|
|
457
457
|
var c=this,b=CKEDITOR.tools.tryThese(function(){return c.getNative().createRange().item(0)},function(){for(var a=c.getRanges()[0].clone(),b,d,e=2;e&&!((b=a.getEnclosedNode())&&b.type==CKEDITOR.NODE_ELEMENT&&B[b.getName()]&&(d=b));e--)a.shrink(CKEDITOR.SHRINK_ELEMENT);return d&&d.$});return a.selectedElement=b?new CKEDITOR.dom.element(b):null},getSelectedText:function(){var a=this._.cache;if(void 0!==a.selectedText)return a.selectedText;var c=this.getNative(),c=v?"Control"==c.type?"":c.createRange().text:
|
|
458
458
|
c.toString();return a.selectedText=c},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 c=this.getSelectedElement(),b=this.getRanges(),d=this.isFake;this.isLocked=0;this.reset();a&&(a=c||b[0]&&b[0].getCommonAncestor())&&a.getAscendant("body",1)&&((a=this.root.editor)&&a.plugins.tableselection&&a.plugins.tableselection.isSupportedEnvironment(a)&&l(b)?e.call(this,
|
|
459
459
|
b):d?this.fake(c):c&&2>b.length?this.selectElement(c):this.selectRanges(b))}},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 c=a._.hiddenSelectionContainer;if(c){var b=a.checkDirty();a.fire("lockSnapshot");c.remove();a.fire("unlockSnapshot");!b&&a.resetDirty()}delete a._.hiddenSelectionContainer}else CKEDITOR.warn("selection-fake-reset");this.rev=y++},selectElement:function(a){var c=new CKEDITOR.dom.range(this.root);
|
|
460
|
-
c.setStartBefore(a);c.setEndAfter(a);this.selectRanges([c])},selectRanges:function(a){var b=this.root.editor,f=b&&b._.hiddenSelectionContainer;this.reset();if(f)for(var f=this.root,
|
|
461
|
-
m.type==CKEDITOR.NODE_ELEMENT&&(
|
|
462
|
-
tr:1};1<a.length&&(b=a[a.length-1],a[0].setEnd(b.endContainer,b.endOffset));b=a[0];a=b.collapsed;var
|
|
463
|
-
|
|
464
|
-
b.setStartBefore(
|
|
465
|
-
m=m.getEnclosedNode(),b.isReadOnly()||m&&m.isReadOnly()))){
|
|
466
|
-
b.endOffset)}catch(z){if(0<=z.toString().indexOf("NS_ERROR_ILLEGAL_VALUE"))b.collapse(1),
|
|
460
|
+
c.setStartBefore(a);c.setEndAfter(a);this.selectRanges([c])},selectRanges:function(a){var b=this.root.editor,f=b&&b._.hiddenSelectionContainer;this.reset();if(f)for(var f=this.root,h,k=0;k<a.length;++k)h=a[k],h.endContainer.equals(f)&&(h.endOffset=Math.min(h.endOffset,f.getChildCount()));if(a.length)if(this.isLocked){var g=CKEDITOR.document.getActive();this.unlock();this.selectRanges(a);this.lock();g&&!g.equals(this.root)&&g.focus()}else{var m;a:{var p,u;if(1==a.length&&!(u=a[0]).collapsed&&(m=u.getEnclosedNode())&&
|
|
461
|
+
m.type==CKEDITOR.NODE_ELEMENT&&(u=u.clone(),u.shrink(CKEDITOR.SHRINK_ELEMENT,!0),(p=u.getEnclosedNode())&&p.type==CKEDITOR.NODE_ELEMENT&&(m=p),"false"==m.getAttribute("contenteditable")))break a;m=void 0}if(m)this.fake(m);else if(b&&b.plugins.tableselection&&b.plugins.tableselection.isSupportedEnvironment(b)&&l(a)&&!A&&!a[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored"))e.call(this,a);else{if(v){p=CKEDITOR.dom.walker.whitespaces(!0);m=/\ufeff|\u00a0/;u={table:1,tbody:1,
|
|
462
|
+
tr:1};1<a.length&&(b=a[a.length-1],a[0].setEnd(b.endContainer,b.endOffset));b=a[0];a=b.collapsed;var q,x,y;if((f=b.getEnclosedNode())&&f.type==CKEDITOR.NODE_ELEMENT&&f.getName()in B&&(!f.is("a")||!f.getText()))try{y=f.$.createControlRange();y.addElement(f.$);y.select();return}catch(w){}if(b.startContainer.type==CKEDITOR.NODE_ELEMENT&&b.startContainer.getName()in u||b.endContainer.type==CKEDITOR.NODE_ELEMENT&&b.endContainer.getName()in u)b.shrink(CKEDITOR.NODE_ELEMENT,!0),a=b.collapsed;y=b.createBookmark();
|
|
463
|
+
u=y.startNode;a||(g=y.endNode);y=b.document.$.body.createTextRange();y.moveToElementText(u.$);y.moveStart("character",1);g?(m=b.document.$.body.createTextRange(),m.moveToElementText(g.$),y.setEndPoint("EndToEnd",m),y.moveEnd("character",-1)):(q=u.getNext(p),x=u.hasAscendant("pre"),q=!(q&&q.getText&&q.getText().match(m))&&(x||!u.hasPrevious()||u.getPrevious().is&&u.getPrevious().is("br")),x=b.document.createElement("span"),x.setHtml("\x26#65279;"),x.insertBefore(u),q&&b.document.createText("").insertBefore(u));
|
|
464
|
+
b.setStartBefore(u);u.remove();a?(q?(y.moveStart("character",-1),y.select(),b.document.$.selection.clear()):y.select(),b.moveToPosition(x,CKEDITOR.POSITION_BEFORE_START),x.remove()):(b.setEndBefore(g),g.remove(),y.select())}else{g=this.getNative();if(!g)return;this.removeAllRanges();for(y=0;y<a.length;y++){if(y<a.length-1&&(q=a[y],x=a[y+1],m=q.clone(),m.setStart(q.endContainer,q.endOffset),m.setEnd(x.startContainer,x.startOffset),!m.collapsed&&(m.shrink(CKEDITOR.NODE_ELEMENT,!0),b=m.getCommonAncestor(),
|
|
465
|
+
m=m.getEnclosedNode(),b.isReadOnly()||m&&m.isReadOnly()))){x.setStart(q.startContainer,q.startOffset);a.splice(y--,1);continue}b=a[y];x=this.document.$.createRange();b.collapsed&&CKEDITOR.env.webkit&&d(b)&&(m=c(this.root),b.insertNode(m),(q=m.getNext())&&!m.getPrevious()&&q.type==CKEDITOR.NODE_ELEMENT&&"br"==q.getName()?(n(this.root),b.moveToPosition(q,CKEDITOR.POSITION_BEFORE_START)):b.moveToPosition(m,CKEDITOR.POSITION_AFTER_END));x.setStart(b.startContainer.$,b.startOffset);try{x.setEnd(b.endContainer.$,
|
|
466
|
+
b.endOffset)}catch(z){if(0<=z.toString().indexOf("NS_ERROR_ILLEGAL_VALUE"))b.collapse(1),x.setEnd(b.endContainer.$,b.endOffset);else throw z;}g.addRange(x)}}this.reset();this.root.fire("selectionchange")}}},fake:function(a,c){var b=this.root.editor;void 0===c&&a.hasAttribute("aria-label")&&(c=a.getAttribute("aria-label"));this.reset();q(b,c);var d=this._.cache,e=new CKEDITOR.dom.range(this.root);e.setStartBefore(a);e.setEndAfter(a);d.ranges=new CKEDITOR.dom.rangeList(e);d.selectedElement=d.startElement=
|
|
467
467
|
a;d.type=CKEDITOR.SELECTION_ELEMENT;d.selectedText=d.nativeSel=null;this.isFake=1;this.rev=y++;b._.fakeSelection=this;this.root.fire("selectionchange")},isHidden:function(){var a=this.getCommonAncestor();a&&a.type==CKEDITOR.NODE_TEXT&&(a=a.getParent());return!(!a||!a.data("cke-hidden-sel"))},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 c=[],b,d=0;d<a.length;d++){var e=new CKEDITOR.dom.range(this.root);e.moveToBookmark(a[d]);c.push(e)}a.isFake&&(b=l(c)?c[0]._getTableElement():c[0].getEnclosedNode(),b&&b.type==CKEDITOR.NODE_ELEMENT||(CKEDITOR.warn("selection-not-fake"),a.isFake=0));a.isFake&&!l(c)?this.fake(b):this.selectRanges(c);return this},getCommonAncestor:function(){var a=
|
|
469
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(c){}this.reset()}}}})();"use strict";CKEDITOR.STYLE_BLOCK=1;CKEDITOR.STYLE_INLINE=2;CKEDITOR.STYLE_OBJECT=3;(function(){function a(a,c){for(var b,d;(a=a.getParent())&&
|
|
470
|
-
!a.equals(c);)if(a.getAttribute("data-nostyle"))b=a;else if(!d){var e=a.getAttribute("contentEditable");"false"==e?b=a:"true"==e&&(d=1)}return b}function l(a,c,b,d){return(a.getPosition(c)|d)==d&&(!b.childRule||b.childRule(a))}function
|
|
471
|
-
CKEDITOR.dtd[d];n||(
|
|
472
|
-
|
|
473
|
-
(
|
|
474
|
-
1:B[E]=1);for(da in f.styles)!C[da]&&(fa=A.getStyle(da))&&(k.getStyle(da)==fa?z[da]=1:C[da]=1)}A=A.getParent()}for(E in D)k.removeAttribute(E);for(da in z)k.removeStyle(da);
|
|
475
|
-
!0)}}function f(a){function c(){for(var a=new CKEDITOR.dom.elementPath(d.getParent()),b=new CKEDITOR.dom.elementPath(m.getParent()),e=null,f=null,
|
|
476
|
-
e=this._.definition.alwaysRemoveElement;if(a.collapsed){for(var f=new CKEDITOR.dom.elementPath(d.getParent(),a.root),
|
|
477
|
-
else if(
|
|
478
|
-
a.getAttribute("contenteditable"))return c.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return c}function m(a){var c=a.getEnclosedNode()||a.getCommonAncestor(!1,!0);(a=(new CKEDITOR.dom.elementPath(c,a.root)).contains(this.element,1))&&!a.isReadOnly()&&
|
|
479
|
-
a.removeStyle(e)}}function
|
|
480
|
-
(e.is("pre")?((f=this._.enterMode==CKEDITOR.ENTER_BR?null:a.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&e.copyAttributes(f),d(e,f)):
|
|
481
|
-
" ");
|
|
482
|
-
d.setHtml(e),
|
|
470
|
+
!a.equals(c);)if(a.getAttribute("data-nostyle"))b=a;else if(!d){var e=a.getAttribute("contentEditable");"false"==e?b=a:"true"==e&&(d=1)}return b}function l(a,c,b,d){return(a.getPosition(c)|d)==d&&(!b.childRule||b.childRule(a))}function g(c){var b=c.document;if(c.collapsed)b=y(this,b),c.insertNode(b),c.moveToPosition(b,CKEDITOR.POSITION_BEFORE_END);else{var d=this.element,f=this._.definition,h,k=f.ignoreReadonly,m=k||f.includeReadonly;null==m&&(m=c.root.getCustomData("cke_includeReadonly"));var n=
|
|
471
|
+
CKEDITOR.dtd[d];n||(h=!0,n=CKEDITOR.dtd.span);c.enlarge(CKEDITOR.ENLARGE_INLINE,1);c.trim();var p=c.createBookmark(),u=p.startNode,q=p.endNode,x=u,v;if(!k){var w=c.getCommonAncestor(),k=a(u,w),w=a(q,w);k&&(x=k.getNextSourceNode(!0));w&&(q=w)}for(x.getPosition(q)==CKEDITOR.POSITION_FOLLOWING&&(x=0);x;){k=!1;if(x.equals(q))x=null,k=!0;else{var z=x.type==CKEDITOR.NODE_ELEMENT?x.getName():null,w=z&&"false"==x.getAttribute("contentEditable"),A=z&&x.getAttribute("data-nostyle");if(z&&x.data("cke-bookmark")||
|
|
472
|
+
x.type===CKEDITOR.NODE_COMMENT){x=x.getNextSourceNode(!0);continue}if(w&&m&&CKEDITOR.dtd.$block[z])for(var r=x,D=e(r),C=void 0,B=D.length,aa=0,r=B&&new CKEDITOR.dom.range(r.getDocument());aa<B;++aa){var C=D[aa],G=CKEDITOR.filter.instances[C.data("cke-filter")];if(G?G.check(this):1)r.selectNodeContents(C),g.call(this,r)}D=z?!n[z]||A?0:w&&!m?0:l(x,q,f,M):1;if(D)if(C=x.getParent(),D=f,B=d,aa=h,!C||!(C.getDtd()||CKEDITOR.dtd.span)[B]&&!aa||D.parentRule&&!D.parentRule(C))k=!0;else{if(v||z&&CKEDITOR.dtd.$removeEmpty[z]&&
|
|
473
|
+
(x.getPosition(q)|M)!=M||(v=c.clone(),v.setStartBefore(x)),z=x.type,z==CKEDITOR.NODE_TEXT||w||z==CKEDITOR.NODE_ELEMENT&&!x.getChildCount()){for(var z=x,K;(k=!z.getNext(H))&&(K=z.getParent(),n[K.getName()])&&l(K,u,f,I);)z=K;v.setEndAfter(z)}}else k=!0;x=x.getNextSourceNode(A||w)}if(k&&v&&!v.collapsed){for(var k=y(this,b),w=k.hasAttributes(),A=v.getCommonAncestor(),z={},D={},C={},B={},E,da,fa;k&&A;){if(A.getName()==d){for(E in f.attributes)!B[E]&&(fa=A.getAttribute(da))&&(k.getAttribute(E)==fa?D[E]=
|
|
474
|
+
1:B[E]=1);for(da in f.styles)!C[da]&&(fa=A.getStyle(da))&&(k.getStyle(da)==fa?z[da]=1:C[da]=1)}A=A.getParent()}for(E in D)k.removeAttribute(E);for(da in z)k.removeStyle(da);w&&!k.hasAttributes()&&(k=null);k?(v.extractContents().appendTo(k),v.insertNode(k),t.call(this,k),k.mergeSiblings(),CKEDITOR.env.ie||k.$.normalize()):(k=new CKEDITOR.dom.element("span"),v.extractContents().appendTo(k),v.insertNode(k),t.call(this,k),k.remove(!0));v=null}}c.moveToBookmark(p);c.shrink(CKEDITOR.SHRINK_TEXT);c.shrink(CKEDITOR.NODE_ELEMENT,
|
|
475
|
+
!0)}}function f(a){function c(){for(var a=new CKEDITOR.dom.elementPath(d.getParent()),b=new CKEDITOR.dom.elementPath(m.getParent()),e=null,f=null,h=0;h<a.elements.length;h++){var k=a.elements[h];if(k==a.block||k==a.blockLimit)break;n.checkElementRemovable(k,!0)&&(e=k)}for(h=0;h<b.elements.length;h++){k=b.elements[h];if(k==b.block||k==b.blockLimit)break;n.checkElementRemovable(k,!0)&&(f=k)}f&&m.breakParent(f);e&&d.breakParent(e)}a.enlarge(CKEDITOR.ENLARGE_INLINE,1);var b=a.createBookmark(),d=b.startNode,
|
|
476
|
+
e=this._.definition.alwaysRemoveElement;if(a.collapsed){for(var f=new CKEDITOR.dom.elementPath(d.getParent(),a.root),h,k=0,g;k<f.elements.length&&(g=f.elements[k])&&g!=f.block&&g!=f.blockLimit;k++)if(this.checkElementRemovable(g)){var l;!e&&a.collapsed&&(a.checkBoundaryOfElement(g,CKEDITOR.END)||(l=a.checkBoundaryOfElement(g,CKEDITOR.START)))?(h=g,h.match=l?"start":"end"):(g.mergeSiblings(),g.is(this.element)?q.call(this,g):r(g,A(this)[g.getName()]))}if(h){e=d;for(k=0;;k++){g=f.elements[k];if(g.equals(h))break;
|
|
477
|
+
else if(g.match)continue;else g=g.clone();g.append(e);e=g}e["start"==h.match?"insertBefore":"insertAfter"](h)}}else{var m=b.endNode,n=this;c();for(f=d;!f.equals(m);)h=f.getNextSourceNode(),f.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(f)&&(f.getName()==this.element?q.call(this,f):r(f,A(this)[f.getName()]),h.type==CKEDITOR.NODE_ELEMENT&&h.contains(d)&&(c(),h=d.getNext())),f=h}a.moveToBookmark(b);a.shrink(CKEDITOR.NODE_ELEMENT,!0)}function e(a){var c=[];a.forEach(function(a){if("true"==
|
|
478
|
+
a.getAttribute("contenteditable"))return c.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return c}function m(a){var c=a.getEnclosedNode()||a.getCommonAncestor(!1,!0);(a=(new CKEDITOR.dom.elementPath(c,a.root)).contains(this.element,1))&&!a.isReadOnly()&&x(a,this)}function k(a){var c=a.getCommonAncestor(!0,!0);if(a=(new CKEDITOR.dom.elementPath(c,a.root)).contains(this.element,1)){var c=this._.definition,b=c.attributes;if(b)for(var d in b)a.removeAttribute(d,b[d]);if(c.styles)for(var e in c.styles)c.styles.hasOwnProperty(e)&&
|
|
479
|
+
a.removeStyle(e)}}function h(a){var c=a.createBookmark(!0),b=a.createIterator();b.enforceRealBlocks=!0;this._.enterMode&&(b.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR);for(var e,f=a.document,h;e=b.getNextParagraph();)!e.isReadOnly()&&(b.activeFilter?b.activeFilter.check(this):1)&&(h=y(this,f,e),d(e,h));a.moveToBookmark(c)}function b(a){var c=a.createBookmark(1),b=a.createIterator();b.enforceRealBlocks=!0;b.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var e,f;e=b.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),d(e,f)):q.call(this,e));a.moveToBookmark(c)}function d(a,b){var d=!b;d&&(b=a.getDocument().createElement("div"),a.copyAttributes(b));var e=b&&b.is("pre"),f=a.is("pre"),h=!e&&f;if(e&&!f){f=b;(h=a.getBogus())&&h.remove();h=a.getHtml();h=n(h,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");h=h.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");h=h.replace(/([ \t\n\r]+| )/g,
|
|
481
|
+
" ");h=h.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var k=a.getDocument().createElement("div");k.append(f);f.$.outerHTML="\x3cpre\x3e"+h+"\x3c/pre\x3e";f.copyAttributes(k.getFirst());f=k.getFirst().remove()}else f.setHtml(h);b=f}else h?b=p(d?[a.getHtml()]:c(a),b):a.moveChildren(b);b.replace(a);if(e){var d=b,g;(g=d.getPrevious(E))&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("pre")&&(e=n(g.getHtml(),/\n$/,"")+"\n\n"+n(d.getHtml(),/^\n/,""),CKEDITOR.env.ie?d.$.outerHTML="\x3cpre\x3e"+e+"\x3c/pre\x3e":
|
|
482
|
+
d.setHtml(e),g.remove())}else d&&v(b)}function c(a){var c=[];n(a.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,c,b){return c+"\x3c/pre\x3e"+b+"\x3cpre\x3e"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(a,b){c.push(b)});return c}function n(a,c,b){var d="",e="";a=a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(a,c,b){c&&(d=c);b&&(e=b);return""});return d+a.replace(c,b)+e}function p(a,c){var b;
|
|
483
483
|
1<a.length&&(b=new CKEDITOR.dom.documentFragment(c.getDocument()));for(var d=0;d<a.length;d++){var e=a[d],e=e.replace(/(\r\n|\r)/g,"\n"),e=n(e,/^[ \t]*\n/,""),e=n(e,/\n$/,""),e=n(e,/^[ \t]+|[ \t]+$/g,function(a,c){return 1==a.length?"\x26nbsp;":c?" "+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(b){var f=c.clone();f.setHtml(e);
|
|
484
|
-
b.append(f)}else c.setHtml(e)}return b||c}function
|
|
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
|
|
486
|
-
f;if(f=a.getAttribute(e)){var
|
|
487
|
-
d&&!b.equals(d)&&d.type==CKEDITOR.NODE_ELEMENT&&d.mergeSiblings())}function y(a,c,b){var d;d=a.element;"*"==d&&(d="span");d=new CKEDITOR.dom.element(d,c);b&&b.copyAttributes(d);d=
|
|
488
|
-
return a}function z(a,c){for(var b in a)a[b]=a[b].replace(K,function(a,b){return c[b]})}function A(a){if(a._.overrides)return a._.overrides;var c=a._.overrides={},b=a._.definition.overrides;if(b){CKEDITOR.tools.isArray(b)||(b=[b]);for(var d=0;d<b.length;d++){var e=b[d],f,
|
|
489
|
-
c,b){var d=new CKEDITOR.dom.element("span");d[b?"setStyle":"setAttribute"](a,c);return d[b?"getStyle":"getAttribute"](a)}function
|
|
484
|
+
b.append(f)}else c.setHtml(e)}return b||c}function q(a,c){var b=this._.definition,d=b.attributes,b=b.styles,e=A(this)[a.getName()],f=CKEDITOR.tools.isEmpty(d)&&CKEDITOR.tools.isEmpty(b),h;for(h in d)if("class"!=h&&!this._.definition.fullMatch||a.getAttribute(h)==w(h,d[h]))c&&"data-"==h.slice(0,5)||(f=a.hasAttribute(h),a.removeAttribute(h));for(var k in b)this._.definition.fullMatch&&a.getStyle(k)!=w(k,b[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 t(a){for(var c=A(this),b=a.getElementsByTag(this.element),d,e=b.count();0<=--e;)d=b.getItem(e),d.isReadOnly()||q.call(this,d,!0);for(var f in c)if(f!=this.element)for(b=a.getElementsByTag(f),e=b.count()-1;0<=e;e--)d=b.getItem(e),d.isReadOnly()||r(d,c[f])}function r(a,c,b){if(c=c&&c.attributes)for(var d=0;d<c.length;d++){var e=c[d][0],
|
|
486
|
+
f;if(f=a.getAttribute(e)){var h=c[d][1];(null===h||h.test&&h.test(f)||"string"==typeof h&&f==h)&&a.removeAttribute(e)}}b||v(a)}function v(a,c){if(!a.hasAttributes()||c)if(CKEDITOR.dtd.$block[a.getName()]){var b=a.getPrevious(E),d=a.getNext(E);!b||b.type!=CKEDITOR.NODE_TEXT&&b.isBlockBoundary({br:1})||a.append("br",1);!d||d.type!=CKEDITOR.NODE_TEXT&&d.isBlockBoundary({br:1})||a.append("br");a.remove(!0)}else b=a.getFirst(),d=a.getLast(),a.remove(!0),b&&(b.type==CKEDITOR.NODE_ELEMENT&&b.mergeSiblings(),
|
|
487
|
+
d&&!b.equals(d)&&d.type==CKEDITOR.NODE_ELEMENT&&d.mergeSiblings())}function y(a,c,b){var d;d=a.element;"*"==d&&(d="span");d=new CKEDITOR.dom.element(d,c);b&&b.copyAttributes(d);d=x(d,a);c.getCustomData("doc_processing_style")&&d.hasAttribute("id")?d.removeAttribute("id"):c.setCustomData("doc_processing_style",1);return d}function x(a,c){var b=c._.definition,d=b.attributes,b=CKEDITOR.style.getStyleText(b);if(d)for(var e in d)a.setAttribute(e,d[e]);b&&a.setAttribute("style",b);a.getDocument().removeCustomData("doc_processing_style");
|
|
488
|
+
return a}function z(a,c){for(var b in a)a[b]=a[b].replace(K,function(a,b){return c[b]})}function A(a){if(a._.overrides)return a._.overrides;var c=a._.overrides={},b=a._.definition.overrides;if(b){CKEDITOR.tools.isArray(b)||(b=[b]);for(var d=0;d<b.length;d++){var e=b[d],f,h;"string"==typeof e?f=e.toLowerCase():(f=e.element?e.element.toLowerCase():a.element,h=e.attributes);e=c[f]||(c[f]={});if(h){var e=e.attributes=e.attributes||[],k;for(k in h)e.push([k.toLowerCase(),h[k]])}}}return c}function w(a,
|
|
489
|
+
c,b){var d=new CKEDITOR.dom.element("span");d[b?"setStyle":"setAttribute"](a,c);return d[b?"getStyle":"getAttribute"](a)}function u(a,c){function b(a,c){return"font-family"==c.toLowerCase()?a.replace(/["']/g,""):a}"string"==typeof a&&(a=CKEDITOR.tools.parseCssText(a));"string"==typeof c&&(c=CKEDITOR.tools.parseCssText(c,!0));for(var d in a)if(!(d in c)||b(c[d],d)!=b(a[d],d)&&"inherit"!=a[d]&&"inherit"!=c[d])return!1;return!0}function D(a,c,b){var d=a.getRanges();c=c?this.removeFromRange:this.applyToRange;
|
|
490
490
|
for(var e,f=d.createIterator();e=f.getNextRange();)c.call(this,e,b);a.selectRanges(d)}var C={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},B={a:1,blockquote:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},G=/\s*(?:;\s*|$)/,K=/#\((.+?)\)/g,H=CKEDITOR.dom.walker.bookmark(0,
|
|
491
491
|
1),E=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,c){if("string"==typeof a.type)return new CKEDITOR.style.customHandlers[a.type](a);var b=a.attributes;b&&b.style&&(a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(b.style)),delete b.style);c&&(a=CKEDITOR.tools.clone(a),z(a.attributes,c),z(a.styles,c));b=this.element=a.element?"string"==typeof a.element?a.element.toLowerCase():a.element:"*";this.type=a.type||(C[b]?CKEDITOR.STYLE_BLOCK:B[b]?CKEDITOR.STYLE_OBJECT:
|
|
492
492
|
CKEDITOR.STYLE_INLINE);"object"==typeof this.element&&(this.type=CKEDITOR.STYLE_OBJECT);this._={definition:a}};CKEDITOR.style.prototype={apply:function(a){if(a instanceof CKEDITOR.dom.document)return D.call(this,a.getSelection());if(this.checkApplicable(a.elementPath(),a)){var c=this._.enterMode;c||(this._.enterMode=a.activeEnterMode);D.call(this,a.getSelection(),0,a);this._.enterMode=c}},remove:function(a){if(a instanceof CKEDITOR.dom.document)return D.call(this,a.getSelection(),1);if(this.checkApplicable(a.elementPath(),
|
|
493
|
-
a)){var c=this._.enterMode;c||(this._.enterMode=a.activeEnterMode);D.call(this,a.getSelection(),1,a);this._.enterMode=c}},applyToRange:function(a){this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?
|
|
493
|
+
a)){var c=this._.enterMode;c||(this._.enterMode=a.activeEnterMode);D.call(this,a.getSelection(),1,a);this._.enterMode=c}},applyToRange:function(a){this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?g:this.type==CKEDITOR.STYLE_BLOCK?h:this.type==CKEDITOR.STYLE_OBJECT?m:null;return this.applyToRange(a)},removeFromRange:function(a){this.removeFromRange=this.type==CKEDITOR.STYLE_INLINE?f:this.type==CKEDITOR.STYLE_BLOCK?b:this.type==CKEDITOR.STYLE_OBJECT?k:null;return this.removeFromRange(a)},applyToObject:function(a){x(a,
|
|
494
494
|
this)},checkActive:function(a,c){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(a.block||a.blockLimit,!0,c);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var b=a.elements,d=0,e;d<b.length;d++)if(e=b[d],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,c))return!0}}return!1},checkApplicable:function(a,
|
|
495
495
|
c,b){c&&c instanceof CKEDITOR.filter&&(b=c);if(b&&!b.check(this))return!1;switch(this.type){case CKEDITOR.STYLE_OBJECT:return!!a.contains(this.element);case CKEDITOR.STYLE_BLOCK:return!!a.blockLimit.getDtd()[this.element]}return!0},checkElementMatch:function(a,c){var b=this._.definition;if(!a||!b.ignoreReadonly&&a.isReadOnly())return!1;var d=a.getName();if("string"==typeof this.element?d==this.element:d in this.element){if(!c&&!a.hasAttributes())return!0;if(d=b._AC)b=d;else{var d={},e=0,f=b.attributes;
|
|
496
|
-
if(f)for(var
|
|
496
|
+
if(f)for(var h in f)e++,d[h]=f[h];if(h=CKEDITOR.style.getStyleText(b))d.style||e++,d.style=h;d._length=e;b=b._AC=d}if(b._length){for(var k in b)if("_length"!=k)if(d=a.getAttribute(k)||"","style"==k?u(b[k],d):b[k]==d){if(!c)return!0}else if(c)return!1;if(c)return!0}else return!0}return!1},checkElementRemovable:function(a,c,b){if(this.checkElementMatch(a,c,b))return!0;if(c=A(this)[a.getName()]){var d;if(!(c=c.attributes))return!0;for(b=0;b<c.length;b++)if(d=c[b][0],d=a.getAttribute(d)){var e=c[b][1];
|
|
497
497
|
if(null===e)return!0;if("string"==typeof e){if(d==e)return!0}else if(e.test(d))return!0}}return!1},buildPreview:function(a){var c=this._.definition,b=[],d=c.element;"bdo"==d&&(d="span");var b=["\x3c",d],e=c.attributes;if(e)for(var f in e)b.push(" ",f,'\x3d"',e[f],'"');(e=CKEDITOR.style.getStyleText(c))&&b.push(' style\x3d"',e,'"');b.push("\x3e",a||c.name,"\x3c/",d,"\x3e");return b.join("")},getDefinition:function(){return this._.definition}};CKEDITOR.style.getStyleText=function(a){var c=a._ST;if(c)return c;
|
|
498
|
-
var c=a.styles,b=a.attributes&&a.attributes.style||"",d="";b.length&&(b=b.replace(G,";"));for(var e in c){var f=c[e],
|
|
498
|
+
var c=a.styles,b=a.attributes&&a.attributes.style||"",d="";b.length&&(b=b.replace(G,";"));for(var e in c){var f=c[e],h=(e+":"+f).replace(G,";");"inherit"==f?d+=h:b+=h}b.length&&(b=CKEDITOR.tools.normalizeCssText(b,!0));return a._ST=b+d};CKEDITOR.style.customHandlers={};CKEDITOR.style.addCustomHandler=function(a){var c=function(a){this._={definition:a};this.setup&&this.setup(a)};c.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),{assignedTo:CKEDITOR.STYLE_OBJECT},
|
|
499
499
|
a,!0);return this.customHandlers[a.type]=c};var M=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,I=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
|
-
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,
|
|
501
|
-
|
|
502
|
-
CKEDITOR.stylesSet.addExternal(f,
|
|
503
|
-
{path:a});if("undefined"!==typeof window.ES6Promise)return CKEDITOR.tools.promise=ES6Promise})}})();(function(){function a(a,e,m){a.once("selectionCheck",function(a){if(!l){var f=a.data.getRanges()[0];m.equals(f)?a.cancel():e.equals(f)&&(
|
|
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,
|
|
505
|
-
|
|
506
|
-
{},l={},
|
|
507
|
-
b.getAttribute("contenteditable")?k=b:!
|
|
508
|
-
return!0},contains:function(a,l,
|
|
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,g){CKEDITOR.stylesSet.addExternal(a,l,"");CKEDITOR.stylesSet.load(a,g)};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(a,l){var g=this._.styleStateChangeCallbacks;g||(g=this._.styleStateChangeCallbacks=[],this.on("selectionChange",function(a){for(var e=0;e<
|
|
501
|
+
g.length;e++){var l=g[e],k=l.style.checkActive(a.data.path,this)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;l.fn.call(this,k)}}));g.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,g=l.config.stylesCombo_stylesSet||l.config.stylesSet;if(!1===g)a(null);else if(g instanceof Array)l._.stylesDefinitions=g,a(g);else{g||(g="default");var g=g.split(":"),f=g[0];
|
|
502
|
+
CKEDITOR.stylesSet.addExternal(f,g[1]?g.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),"");CKEDITOR.stylesSet.load(f,function(e){l._.stylesDefinitions=e[f];a(l._.stylesDefinitions)})}}}});(function(){if(window.Promise)CKEDITOR.tools.promise=Promise;else{var a=CKEDITOR.getUrl("vendor/promise.js");if("function"===typeof window.define&&window.define.amd&&"function"===typeof window.require)return window.require([a],function(a){CKEDITOR.tools.promise=a});CKEDITOR.scriptLoader.load(a,function(l){if(!l)return CKEDITOR.error("no-vendor-lib",
|
|
503
|
+
{path:a});if("undefined"!==typeof window.ES6Promise)return CKEDITOR.tools.promise=ES6Promise})}})();(function(){function a(a,e,m){a.once("selectionCheck",function(a){if(!l){var f=a.data.getRanges()[0];m.equals(f)?a.cancel():e.equals(f)&&(g=!0)}},null,null,-1)}var l=!0,g=!1;CKEDITOR.dom.selection.setupEditorOptimization=function(a){a.on("selectionCheck",function(a){a.data&&!g&&a.data.optimizeInElementEnds();g=!1});a.on("contentDom",function(){var e=a.editable();e&&(e.attachListener(e,"keydown",function(a){this._.shiftPressed=
|
|
504
|
+
a.data.$.shiftKey},this),e.attachListener(e,"keyup",function(a){this._.shiftPressed=a.data.$.shiftKey},this))})};CKEDITOR.dom.selection.prototype.optimizeInElementEnds=function(){var f=this.getRanges()[0],e=this.root.editor,g;if(this.root.editor._.shiftPressed||this.isFake||f.isCollapsed||f.startContainer.equals(f.endContainer))g=!1;else if(0===f.endOffset)g=!0;else{g=f.startContainer.type===CKEDITOR.NODE_TEXT;var k=f.endContainer.type===CKEDITOR.NODE_TEXT,h=g?f.startContainer.getLength():f.startContainer.getChildCount();
|
|
505
|
+
g=f.startOffset===h||g^k}g&&(g=f.clone(),f.shrink(CKEDITOR.SHRINK_TEXT,!1,{skipBogus:!CKEDITOR.env.webkit}),l=!1,a(e,f,g),f.select(),l=!0)}})();CKEDITOR.dom.comment=function(a,l){"string"==typeof a&&(a=(l?l.$:document).createComment(a));CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"\x3c!--"+this.$.nodeValue+"--\x3e"}});"use strict";(function(){var a=
|
|
506
|
+
{},l={},g;for(g in CKEDITOR.dtd.$blockLimit)g in CKEDITOR.dtd.$list||(a[g]=1);for(g in CKEDITOR.dtd.$block)g in CKEDITOR.dtd.$blockLimit||g in CKEDITOR.dtd.$empty||(l[g]=1);CKEDITOR.dom.elementPath=function(f,e){var g=null,k=null,h=[],b=f,d;e=e||f.getDocument().getBody();b||(b=e);do if(b.type==CKEDITOR.NODE_ELEMENT){h.push(b);if(!this.lastElement&&(this.lastElement=b,b.is(CKEDITOR.dtd.$object)||"false"==b.getAttribute("contenteditable")))continue;if(b.equals(e))break;if(!k&&(d=b.getName(),"true"==
|
|
507
|
+
b.getAttribute("contenteditable")?k=b:!g&&l[d]&&(g=b),a[d])){if(d=!g&&"div"==d){a:{d=b.getChildren();for(var c=0,n=d.count();c<n;c++){var p=d.getItem(c);if(p.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[p.getName()]){d=!0;break a}}d=!1}d=!d}d?g=b:k=b}}while(b=b.getParent());k||(k=e);this.block=g;this.blockLimit=k;this.root=e;this.elements=h}})();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 g=0;g<l.length;g++)if(!l[g].equals(a[g]))return!1;
|
|
508
|
+
return!0},contains:function(a,l,g){var f=0,e;"string"==typeof a&&(e=function(e){return e.getName()==a});a instanceof CKEDITOR.dom.element?e=function(e){return e.equals(a)}:CKEDITOR.tools.isArray(a)?e=function(e){return-1<CKEDITOR.tools.indexOf(a,e.getName())}:"function"==typeof a?e=a:"object"==typeof a&&(e=function(e){return e.getName()in a});var m=this.elements,k=m.length;l&&(g?f+=1:--k);g&&(m=Array.prototype.slice.call(m,0),m.reverse());for(;f<k;f++)if(e(m[f]))return m[f];return null},isContextFor:function(a){var l;
|
|
509
509
|
return a in CKEDITOR.dtd.$block?(l=this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit,!!l.getDtd()[a]):!0},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}};CKEDITOR.dom.text=function(a,l){"string"==typeof a&&(a=(l?l.$:document).createTextNode(a));this.$=a};CKEDITOR.dom.text.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype,{type:CKEDITOR.NODE_TEXT,getLength:function(){return this.$.nodeValue.length},
|
|
510
|
-
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,
|
|
511
|
-
l){return"number"!=typeof l?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,l)}});(function(){function a(a,f,e){var l=a.serializable,k=f[e?"endContainer":"startContainer"],
|
|
512
|
-
f[
|
|
513
|
-
0;a[l+d+1];){var c=
|
|
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,g=l.childNodes.length,f=this.getLength(),e=this.getDocument(),m=new CKEDITOR.dom.text(this.$.splitText(a),e);l.childNodes.length==g&&(a>=f?(m=e.createText(""),m.insertAfter(this)):(a=e.createText(""),a.insertAfter(m),a.remove()));return m},substring:function(a,
|
|
511
|
+
l){return"number"!=typeof l?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,l)}});(function(){function a(a,f,e){var l=a.serializable,k=f[e?"endContainer":"startContainer"],h=e?"endOffset":"startOffset",b=l?f.document.getById(a.startNode):a.startNode;a=l?f.document.getById(a.endNode):a.endNode;k.equals(b.getPrevious())?(f.startOffset=f.startOffset-k.getLength()-a.getPrevious().getLength(),k=a.getNext()):k.equals(a.getPrevious())&&(f.startOffset-=k.getLength(),k=a.getNext());k.equals(b.getParent())&&
|
|
512
|
+
f[h]++;k.equals(a.getParent())&&f[h]++;f[e?"endContainer":"startContainer"]=k;return f}CKEDITOR.dom.rangeList=function(a){if(a instanceof CKEDITOR.dom.rangeList)return a;a?a instanceof CKEDITOR.dom.range&&(a=[a]):a=[];return CKEDITOR.tools.extend(a,l)};var l={createIterator:function(){var a=this,f=CKEDITOR.dom.walker.bookmark(),e=[],l;return{getNextRange:function(k){l=void 0===l?0:l+1;var h=a[l];if(h&&1<a.length){if(!l)for(var b=a.length-1;0<=b;b--)e.unshift(a[b].createBookmark(!0));if(k)for(var d=
|
|
513
|
+
0;a[l+d+1];){var c=h.document;k=0;b=c.getById(e[d].endNode);for(c=c.getById(e[d+1].startNode);;){b=b.getNextSourceNode(!1);if(c.equals(b))k=1;else if(f(b)||b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary())continue;break}if(!k)break;d++}for(h.moveToBookmark(e.shift());d--;)b=a[++l],b.moveToBookmark(e.shift()),h.setEnd(b.endContainer,b.endOffset)}return h}}},createBookmarks:function(g){for(var f=[],e,l=0;l<this.length;l++){f.push(e=this[l].createBookmark(g,!0));for(var k=l+1;k<this.length;k++)this[k]=
|
|
514
514
|
a(e,this[k]),this[k]=a(e,this[k],!0)}return f},createBookmarks2:function(a){for(var f=[],e=0;e<this.length;e++)f.push(this[e].createBookmark2(a));return f},moveToBookmarks:function(a){for(var f=0;f<this.length;f++)this[f].moveToBookmark(a[f])}}})();(function(){function a(){return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1]||"skins/"+CKEDITOR.skinName.split(",")[0]+"/")}function l(b){var c=CKEDITOR.skin["ua_"+b],e=CKEDITOR.env;if(c)for(var c=c.split(",").sort(function(a,c){return a>c?-1:1}),f=
|
|
515
|
-
0,
|
|
516
|
-
0;k<a.length;k++)if(CKEDITOR.env.webkit)for(f=0;f<c.length;f++){
|
|
517
|
-
getPath:function(a){return CKEDITOR.getUrl(l(a))},icons:{},addIcon:function(a,c,b,e){a=a.toLowerCase();this.icons[a]||(this.icons[a]={path:c,offset:b||0,bgsize:e||"16px"})},getIconStyle:function(a,c,b,e,f){var
|
|
518
|
-
{getUiColor:function(){return this.uiColor},setUiColor:function(a){var c=f(CKEDITOR.document);return(this.setUiColor=function(a){this.uiColor=a;var d=CKEDITOR.skin.chameleon,f="",k="";"function"==typeof d&&(f=d(this,"editor"),k=d(this,"panel"));a=[[b,a]];e([c],f,a);e(
|
|
519
|
-
if(!a.getById("cke_ui_color")){var d=f(a);
|
|
520
|
-
CKEDITOR.document);a.appendTo(CKEDITOR.document.getHead());try{var l=a.getComputedStyle("border-top-color"),
|
|
521
|
-
a[l][1]),CKEDITOR.add(a[l][0])})();CKEDITOR.skin.name="tao";CKEDITOR.skin.ua_editor="";CKEDITOR.skin.ua_dialog="";CKEDITOR.skin.chameleon=function(){var a=function(){return function(a,e){for(var
|
|
522
|
-
return function(e,
|
|
515
|
+
0,h;f<c.length;f++)if(h=c[f],e.ie&&(h.replace(/^ie/,"")==e.version||e.quirks&&"iequirks"==h)&&(h="ie"),e[h]){b+="_"+c[f];break}return CKEDITOR.getUrl(a()+b+".css")}function g(a,c){m[a]||(CKEDITOR.document.appendStyleSheet(l(a)),m[a]=1);c&&c()}function f(a){var c=a.getById(k);c||(c=a.getHead().append("style"),c.setAttribute("id",k),c.setAttribute("type","text/css"));return c}function e(a,c,b){var e,f,h;if(CKEDITOR.env.webkit)for(c=c.split("}").slice(0,-1),f=0;f<c.length;f++)c[f]=c[f].split("{");for(var k=
|
|
516
|
+
0;k<a.length;k++)if(CKEDITOR.env.webkit)for(f=0;f<c.length;f++){h=c[f][1];for(e=0;e<b.length;e++)h=h.replace(b[e][0],b[e][1]);a[k].$.sheet.addRule(c[f][0],h)}else{h=c;for(e=0;e<b.length;e++)h=h.replace(b[e][0],b[e][1]);CKEDITOR.env.ie&&11>CKEDITOR.env.version?a[k].$.styleSheet.cssText+=h:a[k].$.innerHTML+=h}}var m={};CKEDITOR.skin={path:a,loadPart:function(b,c){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a()+"skin.js"),function(){g(b,c)}):g(b,c)},
|
|
517
|
+
getPath:function(a){return CKEDITOR.getUrl(l(a))},icons:{},addIcon:function(a,c,b,e){a=a.toLowerCase();this.icons[a]||(this.icons[a]={path:c,offset:b||0,bgsize:e||"16px"})},getIconStyle:function(a,c,b,e,f){var h;a&&(a=a.toLowerCase(),c&&(h=this.icons[a+"-rtl"]),h||(h=this.icons[a]));a=b||h&&h.path||"";e=e||h&&h.offset;f=f||h&&h.bgsize||"16px";a&&(a=a.replace(/'/g,"\\'"));return a&&"background-image:url('"+CKEDITOR.getUrl(a)+"');background-position:0 "+e+"px;background-size:"+f+";"}};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,
|
|
518
|
+
{getUiColor:function(){return this.uiColor},setUiColor:function(a){var c=f(CKEDITOR.document);return(this.setUiColor=function(a){this.uiColor=a;var d=CKEDITOR.skin.chameleon,f="",k="";"function"==typeof d&&(f=d(this,"editor"),k=d(this,"panel"));a=[[b,a]];e([c],f,a);e(h,k,a)}).call(this,a)}});var k="cke_ui_color",h=[],b=/\$color/g;CKEDITOR.on("instanceLoaded",function(a){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var c=a.editor;a=function(a){a=(a.data[0]||a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();
|
|
519
|
+
if(!a.getById("cke_ui_color")){var d=f(a);h.push(d);c.on("destroy",function(){h=CKEDITOR.tools.array.filter(h,function(a){return d!==a})});(a=c.getUiColor())&&e([d],CKEDITOR.skin.chameleon(c,"panel"),[[b,a]])}};c.on("panelShow",a);c.on("menuShow",a);c.config.uiColor&&c.setUiColor(c.config.uiColor)}})})();(function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=!1;else{var a=CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"\x3e\x3c/div\x3e',
|
|
520
|
+
CKEDITOR.document);a.appendTo(CKEDITOR.document.getHead());try{var l=a.getComputedStyle("border-top-color"),g=a.getComputedStyle("border-right-color");CKEDITOR.env.hc=!(!l||l!=g)}catch(f){CKEDITOR.env.hc=!1}a.remove()}CKEDITOR.env.hc&&(CKEDITOR.env.cssClass+=" cke_hc");CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(a=CKEDITOR._.pending)for(delete CKEDITOR._.pending,l=0;l<a.length;l++)CKEDITOR.editor.prototype.constructor.apply(a[l][0],
|
|
521
|
+
a[l][1]),CKEDITOR.add(a[l][0])})();CKEDITOR.skin.name="tao";CKEDITOR.skin.ua_editor="";CKEDITOR.skin.ua_dialog="";CKEDITOR.skin.chameleon=function(){var a=function(){return function(a,e){for(var g=a.match(/[^#]./g),k=0;3>k;k++){var h=k,b;b=parseInt(g[k],16);b=("0"+(0>e?0|b*(1+e):0|b+(255-b)*e).toString(16)).slice(-2);g[h]=b}return"#"+g.join("")}}(),l=function(){var a=new CKEDITOR.template("background:#{to};background-image:-webkit-gradient(linear,lefttop,leftbottom,from({from}),to({to}));background-image:-moz-linear-gradient(top,{from},{to});background-image:-webkit-linear-gradient(top,{from},{to});background-image:-o-linear-gradient(top,{from},{to});background-image:-ms-linear-gradient(top,{from},{to});background-image:linear-gradient(top,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType\x3d0,startColorstr\x3d'{from}',endColorstr\x3d'{to}');");
|
|
522
|
+
return function(e,g){return a.output({from:e,to:g})}}(),g={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),
|
|
523
523
|
panel:new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")};
|
|
524
|
-
return function(f,e){var m=f.uiColor,m={id:"."+f.id,defaultBorder:a(m,-.1),defaultGradient:l(a(m,.9),m),lightGradient:l(a(m,1),a(m,.7)),mediumGradient:l(a(m,.8),a(m,.5)),ckeButtonOn:l(a(m,.6),a(m,.7)),ckeResizer:a(m,-.4),ckeToolbarSeparator:a(m,.5),ckeColorauto:a(m,.8),dialogBody:a(m,.7),dialogTabSelected:l("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:a(m,-.6),elementsPathBg:m,menubuttonIcon:a(m,.5),menubuttonIconHover:a(m,.3)};return
|
|
525
|
-
"}")}}();CKEDITOR.plugins.add("basicstyles",{init:function(a){var l=0,
|
|
526
|
-
a.styles["font-style"]}]],underline:["u",["span",function(a){return"underline"==a.styles["text-decoration"]}]],strike:["s","strike",["span",function(a){return"line-through"==a.styles["text-decoration"]}]],subscript:["sub"],superscript:["sup"]},e=a.config,m=a.lang.basicstyles;
|
|
527
|
-
"subscript",e.coreStyles_subscript);
|
|
524
|
+
return function(f,e){var m=f.uiColor,m={id:"."+f.id,defaultBorder:a(m,-.1),defaultGradient:l(a(m,.9),m),lightGradient:l(a(m,1),a(m,.7)),mediumGradient:l(a(m,.8),a(m,.5)),ckeButtonOn:l(a(m,.6),a(m,.7)),ckeResizer:a(m,-.4),ckeToolbarSeparator:a(m,.5),ckeColorauto:a(m,.8),dialogBody:a(m,.7),dialogTabSelected:l("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:a(m,-.6),elementsPathBg:m,menubuttonIcon:a(m,.5),menubuttonIconHover:a(m,.3)};return g[e].output(m).replace(/\[/g,"{").replace(/\]/g,
|
|
525
|
+
"}")}}();CKEDITOR.plugins.add("basicstyles",{init:function(a){var l=0,g=function(e,h,b,d){if(d){d=new CKEDITOR.style(d);var c=f[b];c.unshift(d);a.attachStyleStateChange(d,function(c){!a.readOnly&&a.getCommand(b).setState(c)});a.addCommand(b,new CKEDITOR.styleCommand(d,{contentForms:c}));a.ui.addButton&&a.ui.addButton(e,{label:h,command:b,toolbar:"basicstyles,"+(l+=10)})}},f={bold:["strong","b",["span",function(a){a=a.styles["font-weight"];return"bold"==a||700<=+a}]],italic:["em","i",["span",function(a){return"italic"==
|
|
526
|
+
a.styles["font-style"]}]],underline:["u",["span",function(a){return"underline"==a.styles["text-decoration"]}]],strike:["s","strike",["span",function(a){return"line-through"==a.styles["text-decoration"]}]],subscript:["sub"],superscript:["sup"]},e=a.config,m=a.lang.basicstyles;g("Bold",m.bold,"bold",e.coreStyles_bold);g("Italic",m.italic,"italic",e.coreStyles_italic);g("Underline",m.underline,"underline",e.coreStyles_underline);g("Strike",m.strike,"strike",e.coreStyles_strike);g("Subscript",m.subscript,
|
|
527
|
+
"subscript",e.coreStyles_subscript);g("Superscript",m.superscript,"superscript",e.coreStyles_superscript);a.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+85,"underline"]])}});CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"};CKEDITOR.config.coreStyles_italic={element:"em",overrides:"i"};CKEDITOR.config.coreStyles_underline={element:"u"};CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"};CKEDITOR.config.coreStyles_subscript={element:"sub"};
|
|
528
528
|
CKEDITOR.config.coreStyles_superscript={element:"sup"};(function(){function a(a,b,d,e){if(!a.isReadOnly()&&!a.equals(d.editable())){CKEDITOR.dom.element.setMarker(e,a,"bidi_processed",1);e=a;for(var f=d.editable();(e=e.getParent())&&!e.equals(f);)if(e.getCustomData("bidi_processed")){a.removeStyle("direction");a.removeAttribute("dir");return}e="useComputedState"in d.config?d.config.useComputedState:1;(e?a.getComputedStyle("direction"):a.getStyle("direction")||a.hasAttribute("dir"))!=b&&(a.removeStyle("direction"),
|
|
529
529
|
e?(a.removeAttribute("dir"),b!=a.getComputedStyle("direction")&&a.setAttribute("dir",b)):a.setAttribute("dir",b),d.forceNextSelectionCheck())}}function l(a,b,d){var e=a.getCommonAncestor(!1,!0);a=a.clone();a.enlarge(d==CKEDITOR.ENTER_BR?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);if(a.checkBoundaryOfElement(e,CKEDITOR.START)&&a.checkBoundaryOfElement(e,CKEDITOR.END)){for(var f;e&&e.type==CKEDITOR.NODE_ELEMENT&&(f=e.getParent())&&1==f.getChildCount()&&!(e.getName()in b);)e=
|
|
530
|
-
f;return e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in b&&e}}function
|
|
531
|
-
e.type==CKEDITOR.NODE_ELEMENT&&(d=e);d&&(b=b?d.getComputedStyle("direction"):d.getStyle("direction")||d.getAttribute("dir"),a.getCommand("bidirtl").setState("rtl"==b?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF),a.getCommand("bidiltr").setState("ltr"==b?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF));b=(c.block||c.blockLimit||a.editable()).getDirection(1);b!=(a._.selDir||a.lang.dir)&&(a._.selDir=b,a.fire("contentDirChanged",b))},exec:function(b){var d=b.getSelection(),f=b.config.enterMode,
|
|
532
|
-
if(
|
|
533
|
-
a.getPosition(
|
|
534
|
-
return function(f,
|
|
535
|
-
m,{td:1});CKEDITOR.plugins.add("bidi",{init:function(a){function b(d,e,f,
|
|
536
|
-
"add":"remove")+"Class";var d=a.ui.space(a.config.toolbarLocation);if(d)d[b]("cke_mixed_dir_content")})}}});for(var
|
|
537
|
-
k.getParent().getName())for(b=k;b=b.getNext();)if(b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()){k.move(b,!0);break}if(
|
|
538
|
-
m.shift(),e.insertNode(
|
|
539
|
-
new CKEDITOR.dom.documentFragment(a.document);
|
|
540
|
-
k,"blockquote_moveout",!0))}CKEDITOR.dom.element.clearAllMarkers(b);
|
|
541
|
-
c&&(n=b.getChild(d));d++)if(n.type==CKEDITOR.NODE_ELEMENT&&n.isBlockBoundary()){b=!1;break a}b=!0}b&&e.remove()}if(a.config.enterMode==CKEDITOR.ENTER_BR)for(e=!0;
|
|
542
|
-
e&&
|
|
543
|
-
toolbar:"blocks,10"}))}})})();CKEDITOR.plugins.add("dialogui",{onLoad:function(){var a=function(a){this._||(this._={});this._["default"]=this._.initValue=a["default"]||"";this._.required=a.required||!1;for(var d=[this._],c=1;c<arguments.length;c++)d.push(arguments[c]);d.push(!0);CKEDITOR.tools.extend.apply(CKEDITOR.tools,d);return this._},l={build:function(a,d,c){return new CKEDITOR.ui.dialog.textInput(a,d,c)}},
|
|
530
|
+
f;return e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in b&&e}}function g(c){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,c){var b=a.config.useComputedState,d,b=void 0===b||b;if(!b){d=c.lastElement;for(var e=a.editable();d&&!(d.getName()in k||d.equals(e));){var f=d.getParent();if(!f)break;d=f}}d=d||c.block||c.blockLimit;d.equals(a.editable())&&(e=a.getSelection().getRanges()[0].getEnclosedNode())&&
|
|
531
|
+
e.type==CKEDITOR.NODE_ELEMENT&&(d=e);d&&(b=b?d.getComputedStyle("direction"):d.getStyle("direction")||d.getAttribute("dir"),a.getCommand("bidirtl").setState("rtl"==b?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF),a.getCommand("bidiltr").setState("ltr"==b?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF));b=(c.block||c.blockLimit||a.editable()).getDirection(1);b!=(a._.selDir||a.lang.dir)&&(a._.selDir=b,a.fire("contentDirChanged",b))},exec:function(b){var d=b.getSelection(),f=b.config.enterMode,h=d.getRanges();
|
|
532
|
+
if(h&&h.length){for(var k={},g=d.createBookmarks(),h=h.createIterator(),y,x=0;y=h.getNextRange(1);){var z=y.getEnclosedNode();z&&(!z||z.type==CKEDITOR.NODE_ELEMENT&&z.getName()in m)||(z=l(y,e,f));z&&a(z,c,b,k);var A=new CKEDITOR.dom.walker(y),w=g[x].startNode,u=g[x++].endNode;A.evaluator=function(a){var c=f==CKEDITOR.ENTER_P?"p":"div",b;if(b=(a?a.type==CKEDITOR.NODE_ELEMENT:!1)&&a.getName()in e){if(c=a.is(c))c=(c=a.getParent())?c.type==CKEDITOR.NODE_ELEMENT:!1;b=!(c&&a.getParent().is("blockquote"))}return!!(b&&
|
|
533
|
+
a.getPosition(w)&CKEDITOR.POSITION_FOLLOWING&&(a.getPosition(u)&CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_CONTAINS)==CKEDITOR.POSITION_PRECEDING)};for(;z=A.next();)a(z,c,b,k);y=y.createIterator();for(y.enlargeBr=f!=CKEDITOR.ENTER_BR;z=y.getNextParagraph(f==CKEDITOR.ENTER_P?"p":"div");)a(z,c,b,k)}CKEDITOR.dom.element.clearAllMarkers(k);b.forceNextSelectionCheck();d.selectBookmarks(g);b.focus()}}}}function f(a){var b=a==h.setAttribute,d=a==h.removeAttribute,e=/\bdirection\s*:\s*(.*?)\s*(:?$|;)/;
|
|
534
|
+
return function(f,h){if(!this.isReadOnly()){var k;if(k=f==(b||d?"dir":"direction")||"style"==f&&(d||e.test(h))){a:{k=this;for(var g=k.getDocument().getBody().getParent();k;){if(k.equals(g)){k=!1;break a}k=k.getParent()}k=!0}k=!k}if(k&&(k=this.getDirection(1),g=a.apply(this,arguments),k!=this.getDirection(1)))return this.getDocument().fire("dirChanged",this),g}return a.apply(this,arguments)}}var e={table:1,ul:1,ol:1,blockquote:1,div:1},m={},k={};CKEDITOR.tools.extend(m,e,{tr:1,p:1,div:1,li:1});CKEDITOR.tools.extend(k,
|
|
535
|
+
m,{td:1});CKEDITOR.plugins.add("bidi",{init:function(a){function b(d,e,f,h,k){a.addCommand(f,new CKEDITOR.command(a,h));a.ui.addButton&&a.ui.addButton(d,{label:e,command:f,toolbar:"bidi,"+k})}if(!a.blockless){var d=a.lang.bidi;b("BidiLtr",d.ltr,"bidiltr",g("ltr"),10);b("BidiRtl",d.rtl,"bidirtl",g("rtl"),20);a.on("contentDom",function(){a.document.on("dirChanged",function(b){a.fire("dirChanged",{node:b.data,dir:b.data.getDirection(1)})})});a.on("contentDirChanged",function(b){b=(a.lang.dir!=b.data?
|
|
536
|
+
"add":"remove")+"Class";var d=a.ui.space(a.config.toolbarLocation);if(d)d[b]("cke_mixed_dir_content")})}}});for(var h=CKEDITOR.dom.element.prototype,b=["setStyle","removeStyle","setAttribute","removeAttribute"],d=0;d<b.length;d++)h[b[d]]=CKEDITOR.tools.override(h[b[d]],f)})();(function(){var a={exec:function(a){var g=a.getCommand("blockquote").state,f=a.getSelection(),e=f&&f.getRanges()[0];if(e){var m=f.createBookmarks();if(CKEDITOR.env.ie){var k=m[0].startNode,h=m[0].endNode,b;if(k&&"blockquote"==
|
|
537
|
+
k.getParent().getName())for(b=k;b=b.getNext();)if(b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()){k.move(b,!0);break}if(h&&"blockquote"==h.getParent().getName())for(b=h;b=b.getPrevious();)if(b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()){h.move(b);break}}var d=e.createIterator();d.enlargeBr=a.config.enterMode!=CKEDITOR.ENTER_BR;if(g==CKEDITOR.TRISTATE_OFF){for(k=[];g=d.getNextParagraph();)k.push(g);1>k.length&&(g=a.document.createElement(a.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),h=
|
|
538
|
+
m.shift(),e.insertNode(g),g.append(new CKEDITOR.dom.text("",a.document)),e.moveToBookmark(h),e.selectNodeContents(g),e.collapse(!0),h=e.createBookmark(),k.push(g),m.unshift(h));b=k[0].getParent();e=[];for(h=0;h<k.length;h++)g=k[h],b=b.getCommonAncestor(g.getParent());for(g={table:1,tbody:1,tr:1,ol:1,ul:1};g[b.getName()];)b=b.getParent();for(h=null;0<k.length;){for(g=k.shift();!g.getParent().equals(b);)g=g.getParent();g.equals(h)||e.push(g);h=g}for(;0<e.length;)if(g=e.shift(),"blockquote"==g.getName()){for(h=
|
|
539
|
+
new CKEDITOR.dom.documentFragment(a.document);g.getFirst();)h.append(g.getFirst().remove()),k.push(h.getLast());h.replace(g)}else k.push(g);e=a.document.createElement("blockquote");for(e.insertBefore(k[0]);0<k.length;)g=k.shift(),e.append(g)}else if(g==CKEDITOR.TRISTATE_ON){h=[];for(b={};g=d.getNextParagraph();){for(k=e=null;g.getParent();){if("blockquote"==g.getParent().getName()){e=g.getParent();k=g;break}g=g.getParent()}e&&k&&!k.getCustomData("blockquote_moveout")&&(h.push(k),CKEDITOR.dom.element.setMarker(b,
|
|
540
|
+
k,"blockquote_moveout",!0))}CKEDITOR.dom.element.clearAllMarkers(b);g=[];k=[];for(b={};0<h.length;)d=h.shift(),e=d.getParent(),d.getPrevious()?d.getNext()?(d.breakParent(d.getParent()),k.push(d.getNext())):d.remove().insertAfter(e):d.remove().insertBefore(e),e.getCustomData("blockquote_processed")||(k.push(e),CKEDITOR.dom.element.setMarker(b,e,"blockquote_processed",!0)),g.push(d);CKEDITOR.dom.element.clearAllMarkers(b);for(h=k.length-1;0<=h;h--){e=k[h];a:{b=e;for(var d=0,c=b.getChildCount(),n=void 0;d<
|
|
541
|
+
c&&(n=b.getChild(d));d++)if(n.type==CKEDITOR.NODE_ELEMENT&&n.isBlockBoundary()){b=!1;break a}b=!0}b&&e.remove()}if(a.config.enterMode==CKEDITOR.ENTER_BR)for(e=!0;g.length;)if(d=g.shift(),"div"==d.getName()){h=new CKEDITOR.dom.documentFragment(a.document);!e||!d.getPrevious()||d.getPrevious().type==CKEDITOR.NODE_ELEMENT&&d.getPrevious().isBlockBoundary()||h.append(a.document.createElement("br"));for(e=d.getNext()&&!(d.getNext().type==CKEDITOR.NODE_ELEMENT&&d.getNext().isBlockBoundary());d.getFirst();)d.getFirst().remove().appendTo(h);
|
|
542
|
+
e&&h.append(a.document.createElement("br"));h.replace(d);e=!1}}f.selectBookmarks(m);a.focus()}},refresh:function(a,g){this.setState(a.elementPath(g.block||g.blockLimit).contains("blockquote",1)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)},context:"blockquote",allowedContent:"blockquote",requiredContent:"blockquote"};CKEDITOR.plugins.add("blockquote",{init:function(l){l.blockless||(l.addCommand("blockquote",a),l.ui.addButton&&l.ui.addButton("Blockquote",{label:l.lang.blockquote.toolbar,command:"blockquote",
|
|
543
|
+
toolbar:"blocks,10"}))}})})();CKEDITOR.plugins.add("dialogui",{onLoad:function(){var a=function(a){this._||(this._={});this._["default"]=this._.initValue=a["default"]||"";this._.required=a.required||!1;for(var d=[this._],c=1;c<arguments.length;c++)d.push(arguments[c]);d.push(!0);CKEDITOR.tools.extend.apply(CKEDITOR.tools,d);return this._},l={build:function(a,d,c){return new CKEDITOR.ui.dialog.textInput(a,d,c)}},g={build:function(a,d,c){return new CKEDITOR.ui.dialog[d.type](a,d,c)}},f={isChanged:function(){return this.getValue()!=
|
|
544
544
|
this.getInitValue()},reset:function(a){this.setValue(this.getInitValue(),a)},setInitValue:function(){this._.initValue=this.getValue()},resetInitValue:function(){this._.initValue=this._["default"]},getInitValue:function(){return this._.initValue}},e=CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onChange:function(a,d){this._.domOnChangeRegistered||(a.on("load",function(){this.getInputElement().on("change",function(){a.parts.dialog.isVisible()&&this.fire("change",{value:this.getValue()})},
|
|
545
|
-
this)},this),this._.domOnChangeRegistered=!0);this.on("change",d)}},!0),m=/^on([A-Z]\w+)/,k=function(a){for(var d in a)(m.test(d)||"title"==d||"type"==d)&&delete a[d];return a},
|
|
546
|
-
"_label";this._.children=[];var
|
|
545
|
+
this)},this),this._.domOnChangeRegistered=!0);this.on("change",d)}},!0),m=/^on([A-Z]\w+)/,k=function(a){for(var d in a)(m.test(d)||"title"==d||"type"==d)&&delete a[d];return a},h=function(a){a=a.data.getKeystroke();a==CKEDITOR.SHIFT+CKEDITOR.ALT+36?this.setDirectionMarker("ltr"):a==CKEDITOR.SHIFT+CKEDITOR.ALT+35&&this.setDirectionMarker("rtl")};CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{labeledElement:function(b,d,c,e){if(!(4>arguments.length)){var f=a.call(this,d);f.labelId=CKEDITOR.tools.getNextId()+
|
|
546
|
+
"_label";this._.children=[];var h={role:d.role||"presentation"};d.includeLabel&&(h["aria-labelledby"]=f.labelId);CKEDITOR.ui.dialog.uiElement.call(this,b,d,c,"div",null,h,function(){var a=[],c=d.required?" cke_required":"";"horizontal"!=d.labelLayout?a.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label'+c+'" ',' id\x3d"'+f.labelId+'"',f.inputId?' for\x3d"'+f.inputId+'"':"",(d.labelStyle?' style\x3d"'+d.labelStyle+'"':"")+"\x3e",d.label,"\x3c/label\x3e",'\x3cdiv class\x3d"cke_dialog_ui_labeled_content"',
|
|
547
547
|
d.controlStyle?' style\x3d"'+d.controlStyle+'"':"",' role\x3d"presentation"\x3e',e.call(this,b,d),"\x3c/div\x3e"):(c={type:"hbox",widths:d.widths,padding:0,children:[{type:"html",html:'\x3clabel class\x3d"cke_dialog_ui_labeled_label'+c+'" id\x3d"'+f.labelId+'" for\x3d"'+f.inputId+'"'+(d.labelStyle?' style\x3d"'+d.labelStyle+'"':"")+"\x3e"+CKEDITOR.tools.htmlEncode(d.label)+"\x3c/label\x3e"},{type:"html",html:'\x3cspan class\x3d"cke_dialog_ui_labeled_content"'+(d.controlStyle?' style\x3d"'+d.controlStyle+
|
|
548
|
-
'"':"")+"\x3e"+e.call(this,b,d)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,c,a));return a.join("")})}},textInput:function(b,d,c){if(!(3>arguments.length)){a.call(this,d);var e=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",f={"class":"cke_dialog_ui_input_"+d.type,id:e,type:d.type};d.validate&&(this.validate=d.validate);d.maxLength&&(f.maxlength=d.maxLength);d.size&&(f.size=d.size);d.inputStyle&&(f.style=d.inputStyle);var k=this,
|
|
549
|
-
function(a){13==a.data.getKeystroke()&&(
|
|
548
|
+
'"':"")+"\x3e"+e.call(this,b,d)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,c,a));return a.join("")})}},textInput:function(b,d,c){if(!(3>arguments.length)){a.call(this,d);var e=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",f={"class":"cke_dialog_ui_input_"+d.type,id:e,type:d.type};d.validate&&(this.validate=d.validate);d.maxLength&&(f.maxlength=d.maxLength);d.size&&(f.size=d.size);d.inputStyle&&(f.style=d.inputStyle);var k=this,g=!1;b.on("load",function(){k.getInputElement().on("keydown",
|
|
549
|
+
function(a){13==a.data.getKeystroke()&&(g=!0)});k.getInputElement().on("keyup",function(a){13==a.data.getKeystroke()&&g&&(b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0),g=!1);k.bidi&&h.call(k,a)},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,b,d,c,function(){var a=['\x3cdiv class\x3d"cke_dialog_ui_input_',d.type,'" role\x3d"presentation"'];d.width&&a.push('style\x3d"width:'+d.width+'" ');a.push("\x3e\x3cinput ");f["aria-labelledby"]=this._.labelId;this._.required&&
|
|
550
550
|
(f["aria-required"]=this._.required);for(var c in f)a.push(c+'\x3d"'+f[c]+'" ');a.push(" /\x3e\x3c/div\x3e");return a.join("")})}},textarea:function(b,d,c){if(!(3>arguments.length)){a.call(this,d);var e=this,f=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",k={};d.validate&&(this.validate=d.validate);k.rows=d.rows||5;k.cols=d.cols||20;k["class"]="cke_dialog_ui_input_textarea "+(d["class"]||"");"undefined"!=typeof d.inputStyle&&(k.style=d.inputStyle);d.dir&&(k.dir=d.dir);if(e.bidi)b.on("load",
|
|
551
|
-
function(){e.getInputElement().on("keyup",
|
|
552
|
-
d,c){if(!(3>arguments.length)){var e=a.call(this,d,{"default":!!d["default"]});d.validate&&(this.validate=d.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,d,c,"span",null,null,function(){var a=CKEDITOR.tools.extend({},d,{id:d.id?d.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),c=[],f=CKEDITOR.tools.getNextId()+"_label",
|
|
553
|
-
e.checkbox=new CKEDITOR.ui.dialog.uiElement(b,a,c,"input",null,
|
|
554
|
-
b,d,c,function(){for(var a=[],c=[],
|
|
555
|
-
(A.style=A.inputStyle);A.keyboardFocusable=!0;e.push(new CKEDITOR.ui.dialog.uiElement(b,A,D,"input",null,
|
|
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({},d);delete f.style;var
|
|
557
|
-
CKEDITOR.tools.htmlEncode(d.label)+"\x3c/span\x3e")}},select:function(b,d,c){if(!(3>arguments.length)){var e=a.call(this,d);d.validate&&(this.validate=d.validate);e.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,d,c,function(){var a=CKEDITOR.tools.extend({},d,{id:d.id?d.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),c=[],f=[],
|
|
558
|
-
d.type,'" role\x3d"presentation"');d.width&&c.push('style\x3d"width:'+d.width+'" ');c.push("\x3e");void 0!==d.size&&(
|
|
559
|
-
|
|
560
|
-
e.frameId,'" title\x3d"',d.label,'" src\x3d"javascript:void('];a.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");a.push(')"\x3e\x3c/iframe\x3e');return a.join("")})}},fileButton:function(b,d,c){var e=this;if(!(3>arguments.length)){a.call(this,d);d.validate&&(this.validate=d.validate);var f=CKEDITOR.tools.extend({},d),
|
|
561
|
-
d["for"];a=
|
|
562
|
-
this.focus=function(){("function"==typeof l?l:m).call(this);this.fire("focus")};f.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,e,f,k,"span",null,null,"");k=k.join("").match(a);
|
|
563
|
-
[];
|
|
551
|
+
function(){e.getInputElement().on("keyup",h)},e);CKEDITOR.ui.dialog.labeledElement.call(this,b,d,c,function(){k["aria-labelledby"]=this._.labelId;this._.required&&(k["aria-required"]=this._.required);var a=['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',f,'" '],c;for(c in k)a.push(c+'\x3d"'+CKEDITOR.tools.htmlEncode(k[c])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(e._["default"]),"\x3c/textarea\x3e\x3c/div\x3e");return a.join("")})}},checkbox:function(b,
|
|
552
|
+
d,c){if(!(3>arguments.length)){var e=a.call(this,d,{"default":!!d["default"]});d.validate&&(this.validate=d.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,d,c,"span",null,null,function(){var a=CKEDITOR.tools.extend({},d,{id:d.id?d.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),c=[],f=CKEDITOR.tools.getNextId()+"_label",h={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":f};k(a);d["default"]&&(h.checked="checked");"undefined"!=typeof a.inputStyle&&(a.style=a.inputStyle);
|
|
553
|
+
e.checkbox=new CKEDITOR.ui.dialog.uiElement(b,a,c,"input",null,h);c.push(' \x3clabel id\x3d"',f,'" for\x3d"',h.id,'"'+(d.labelStyle?' style\x3d"'+d.labelStyle+'"':"")+"\x3e",CKEDITOR.tools.htmlEncode(d.label),"\x3c/label\x3e");return c.join("")})}},radio:function(b,d,c){if(!(3>arguments.length)){a.call(this,d);this._["default"]||(this._["default"]=this._.initValue=d.items[0][1]);d.validate&&(this.validate=d.validate);var e=[],f=this;d.role="radiogroup";d.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this,
|
|
554
|
+
b,d,c,function(){for(var a=[],c=[],h=(d.id?d.id:CKEDITOR.tools.getNextId())+"_radio",g=0;g<d.items.length;g++){var l=d.items[g],m=void 0!==l[2]?l[2]:l[0],z=void 0!==l[1]?l[1]:l[0],A=CKEDITOR.tools.getNextId()+"_radio_input",w=A+"_label",A=CKEDITOR.tools.extend({},d,{id:A,title:null,type:null},!0),m=CKEDITOR.tools.extend({},A,{title:m},!0),u={type:"radio","class":"cke_dialog_ui_radio_input",name:h,value:z,"aria-labelledby":w},D=[];f._["default"]==z&&(u.checked="checked");k(A);k(m);"undefined"!=typeof A.inputStyle&&
|
|
555
|
+
(A.style=A.inputStyle);A.keyboardFocusable=!0;e.push(new CKEDITOR.ui.dialog.uiElement(b,A,D,"input",null,u));D.push(" ");new CKEDITOR.ui.dialog.uiElement(b,m,D,"label",null,{id:w,"for":u.id},l[0]);a.push(D.join(""))}new CKEDITOR.ui.dialog.hbox(b,e,a,c);return c.join("")});this._.children=e}},button:function(b,d,c){if(arguments.length){"function"==typeof d&&(d=d(b.getParentEditor()));a.call(this,d,{disabled:d.disabled||!1});CKEDITOR.event.implementOn(this);var e=this;b.on("load",function(){var a=this.getElement();
|
|
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({},d);delete f.style;var h=CKEDITOR.tools.getNextId()+"_label";CKEDITOR.ui.dialog.uiElement.call(this,b,f,c,"a",null,{style:d.style,href:"javascript:void(0)",title:d.label,hidefocus:"true","class":d["class"],role:"button","aria-labelledby":h},'\x3cspan id\x3d"'+h+'" class\x3d"cke_dialog_ui_button"\x3e'+
|
|
557
|
+
CKEDITOR.tools.htmlEncode(d.label)+"\x3c/span\x3e")}},select:function(b,d,c){if(!(3>arguments.length)){var e=a.call(this,d);d.validate&&(this.validate=d.validate);e.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,d,c,function(){var a=CKEDITOR.tools.extend({},d,{id:d.id?d.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),c=[],f=[],h={id:e.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};c.push('\x3cdiv class\x3d"cke_dialog_ui_input_',
|
|
558
|
+
d.type,'" role\x3d"presentation"');d.width&&c.push('style\x3d"width:'+d.width+'" ');c.push("\x3e");void 0!==d.size&&(h.size=d.size);void 0!==d.multiple&&(h.multiple=d.multiple);k(a);for(var g=0,l;g<d.items.length&&(l=d.items[g]);g++)f.push('\x3coption value\x3d"',CKEDITOR.tools.htmlEncode(void 0!==l[1]?l[1]:l[0]).replace(/"/g,"\x26quot;"),'" /\x3e ',CKEDITOR.tools.htmlEncode(l[0]));"undefined"!=typeof a.inputStyle&&(a.style=a.inputStyle);e.select=new CKEDITOR.ui.dialog.uiElement(b,a,c,"select",null,
|
|
559
|
+
h,f.join(""));c.push("\x3c/div\x3e");return c.join("")})}},file:function(b,d,c){if(!(3>arguments.length)){void 0===d["default"]&&(d["default"]="");var e=CKEDITOR.tools.extend(a.call(this,d),{definition:d,buttons:[]});d.validate&&(this.validate=d.validate);b.on("load",function(){CKEDITOR.document.getById(e.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,d,c,function(){e.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var a=['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"',
|
|
560
|
+
e.frameId,'" title\x3d"',d.label,'" src\x3d"javascript:void('];a.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");a.push(')"\x3e\x3c/iframe\x3e');return a.join("")})}},fileButton:function(b,d,c){var e=this;if(!(3>arguments.length)){a.call(this,d);d.validate&&(this.validate=d.validate);var f=CKEDITOR.tools.extend({},d),h=f.onClick;f.className=(f.className?f.className+" ":"")+"cke_dialog_ui_button";f.onClick=function(a){var c=
|
|
561
|
+
d["for"];a=h?h.call(this,a):!1;!1!==a&&("xhr"!==a&&b.getContentElement(c[0],c[1]).submit(),this.disable())};b.on("load",function(){b.getContentElement(d["for"][0],d["for"][1])._.buttons.push(e)});CKEDITOR.ui.dialog.button.call(this,b,f,c)}},html:function(){var a=/^\s*<[\w:]+\s+([^>]*)?>/,d=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,c=/\/$/;return function(e,f,h){if(!(3>arguments.length)){var k=[],g=f.html;"\x3c"!=g.charAt(0)&&(g="\x3cspan\x3e"+g+"\x3c/span\x3e");var l=f.focus;if(l){var m=this.focus;
|
|
562
|
+
this.focus=function(){("function"==typeof l?l:m).call(this);this.fire("focus")};f.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,e,f,k,"span",null,null,"");k=k.join("").match(a);g=g.match(d)||["","",""];c.test(g[1])&&(g[1]=g[1].slice(0,-1),g[2]="/"+g[2]);h.push([g[1]," ",k[1]||"",g[2]].join(""))}}}(),fieldset:function(a,d,c,e,f){var h=f.label;this._={children:d};CKEDITOR.ui.dialog.uiElement.call(this,a,f,e,"fieldset",null,null,function(){var a=
|
|
563
|
+
[];h&&a.push("\x3clegend"+(f.labelStyle?' style\x3d"'+f.labelStyle+'"':"")+"\x3e"+h+"\x3c/legend\x3e");for(var b=0;b<c.length;b++)a.push(c[b]);return a.join("")})}},!0);CKEDITOR.ui.dialog.html.prototype=new CKEDITOR.ui.dialog.uiElement;CKEDITOR.ui.dialog.labeledElement.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setLabel:function(a){var d=CKEDITOR.document.getById(this._.labelId);1>d.getChildCount()?(new CKEDITOR.dom.text(a,CKEDITOR.document)).appendTo(d):d.getChild(0).$.nodeValue=
|
|
564
564
|
a;return this},getLabel:function(){var a=CKEDITOR.document.getById(this._.labelId);return!a||1>a.getChildCount()?"":a.getChild(0).getText()},eventProcessors:e},!0);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return this._.disabled?!1:this.fire("click",{dialog:this._.dialog})},enable:function(){this._.disabled=!1;var a=this.getElement();a&&a.removeClass("cke_disabled")},disable:function(){this._.disabled=!0;this.getElement().addClass("cke_disabled")},
|
|
565
565
|
isVisible:function(){return this.getElement().getFirst().isVisible()},isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(a,d){this.on("click",function(){d.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)},
|
|
566
566
|
focus:function(){var a=this.selectParentTab();setTimeout(function(){var d=a.getInputElement();d&&d.$.focus()},0)},select:function(){var a=this.selectParentTab();setTimeout(function(){var d=a.getInputElement();d&&(d.$.focus(),d.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(a){if(this.bidi){var d=a&&a.charAt(0);(d=""==d?"ltr":""==d?"rtl":null)&&(a=a.slice(1));this.setDirectionMarker(d)}a||(a="");return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)},
|
|
@@ -571,162 +571,162 @@ d){if(!CKEDITOR.env.ie||8<CKEDITOR.env.version)return e.onChange.apply(this,argu
|
|
|
571
571
|
e.getValue()==a;!d&&this.fire("change",{value:a})},getValue:function(){for(var a=this._.children,d=0;d<a.length;d++)if(a[d].getElement().$.checked)return a[d].getValue();return null},accessKeyUp:function(){var a=this._.children,d;for(d=0;d<a.length;d++)if(a[d].getElement().$.checked){a[d].getElement().focus();return}a[0].getElement().focus()},eventProcessors:{onChange:function(a,d){if(!CKEDITOR.env.ie||8<CKEDITOR.env.version)return e.onChange.apply(this,arguments);a.on("load",function(){for(var a=
|
|
572
572
|
this._.children,b=this,d=0;d<a.length;d++)a[d].getElement().on("propertychange",function(a){a=a.data.$;"checked"==a.propertyName&&this.$.checked&&b.fire("change",{value:this.getAttribute("value")})})},this);this.on("change",d);return null}}},f,!0);CKEDITOR.ui.dialog.file.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,f,{getInputElement:function(){var a=CKEDITOR.document.getById(this._.frameId).getFrameDocument();return 0<a.$.forms.length?new CKEDITOR.dom.element(a.$.forms[0].elements[0]):
|
|
573
573
|
this.getElement()},submit:function(){this.getInputElement().getParent().$.submit();return this},getAction:function(){return this.getInputElement().getParent().$.action},registerEvents:function(a){var d=/^on([A-Z]\w+)/,c,e=function(a,c,b,d){a.on("formLoaded",function(){a.getInputElement().on(b,d,a)})},f;for(f in a)if(c=f.match(d))this.eventProcessors[f]?this.eventProcessors[f].call(this,this._.dialog,a[f]):e(this,this._.dialog,c[1].toLowerCase(),a[f]);return this},reset:function(){function a(){c.$.open();
|
|
574
|
-
var b="";e.size&&(b=e.size-(CKEDITOR.env.ie?7:0));var m=d.frameId+"_input";c.$.write(['\x3chtml dir\x3d"'+
|
|
575
|
-
'\x3c/label\x3e\x3cinput style\x3d"width:100%" id\x3d"',m,'" aria-labelledby\x3d"',d.labelId,'" type\x3d"file" name\x3d"',CKEDITOR.tools.htmlEncode(e.id||"cke_upload"),'" size\x3d"',CKEDITOR.tools.htmlEncode(0<b?b:""),'" /\x3e\x3c/form\x3e\x3c/body\x3e\x3c/html\x3e\x3cscript\x3e',CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"","window.parent.CKEDITOR.tools.callFunction("+
|
|
576
|
-
c.$.close();for(b=0;b<f.length;b++)f[b].enable()}var d=this._,c=CKEDITOR.document.getById(d.frameId).getFrameDocument(),e=d.definition,f=d.buttons,
|
|
574
|
+
var b="";e.size&&(b=e.size-(CKEDITOR.env.ie?7:0));var m=d.frameId+"_input";c.$.write(['\x3chtml dir\x3d"'+g+'" lang\x3d"'+l+'"\x3e\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e\x3cbody style\x3d"margin: 0; overflow: hidden; background: transparent;"\x3e','\x3cform enctype\x3d"multipart/form-data" method\x3d"POST" dir\x3d"'+g+'" lang\x3d"'+l+'" action\x3d"',CKEDITOR.tools.htmlEncode(e.action),'"\x3e\x3clabel id\x3d"',d.labelId,'" for\x3d"',m,'" style\x3d"display:none"\x3e',CKEDITOR.tools.htmlEncode(e.label),
|
|
575
|
+
'\x3c/label\x3e\x3cinput style\x3d"width:100%" id\x3d"',m,'" aria-labelledby\x3d"',d.labelId,'" type\x3d"file" name\x3d"',CKEDITOR.tools.htmlEncode(e.id||"cke_upload"),'" size\x3d"',CKEDITOR.tools.htmlEncode(0<b?b:""),'" /\x3e\x3c/form\x3e\x3c/body\x3e\x3c/html\x3e\x3cscript\x3e',CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"","window.parent.CKEDITOR.tools.callFunction("+h+");","window.onbeforeunload \x3d function() {window.parent.CKEDITOR.tools.callFunction("+k+")}","\x3c/script\x3e"].join(""));
|
|
576
|
+
c.$.close();for(b=0;b<f.length;b++)f[b].enable()}var d=this._,c=CKEDITOR.document.getById(d.frameId).getFrameDocument(),e=d.definition,f=d.buttons,h=this.formLoadedNumber,k=this.formUnloadNumber,g=d.dialog._.editor.lang.dir,l=d.dialog._.editor.langCode;h||(h=this.formLoadedNumber=CKEDITOR.tools.addFunction(function(){this.fire("formLoaded")},this),k=this.formUnloadNumber=CKEDITOR.tools.addFunction(function(){this.getInputElement().clearCustomData()},this),this.getDialog()._.editor.on("destroy",function(){CKEDITOR.tools.removeFunction(h);
|
|
577
577
|
CKEDITOR.tools.removeFunction(k)}));CKEDITOR.env.gecko?setTimeout(a,500):a()},getValue:function(){return this.getInputElement().$.value||""},setInitValue:function(){this._.initValue=""},eventProcessors:{onChange:function(a,d){this._.domOnChangeRegistered||(this.on("formLoaded",function(){this.getInputElement().on("change",function(){this.fire("change",{value:this.getValue()})},this)},this),this._.domOnChangeRegistered=!0);this.on("change",d)}},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.fileButton.prototype=
|
|
578
|
-
new CKEDITOR.ui.dialog.button;CKEDITOR.ui.dialog.fieldset.prototype=CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);CKEDITOR.dialog.addUIElement("text",l);CKEDITOR.dialog.addUIElement("password",l);CKEDITOR.dialog.addUIElement("tel",l);CKEDITOR.dialog.addUIElement("textarea",
|
|
579
|
-
|
|
580
|
-
!0;a._.tabs[a._.currentTabId][0].focus();a._.currentFocusIndex=-1}function l(){for(var a=this._.tabIdList.length,c=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId)+a,b=c-1;b>c-a;b--)if(this._.tabs[this._.tabIdList[b%a]][0].$.offsetHeight)return this._.tabIdList[b%a];return null}function
|
|
578
|
+
new CKEDITOR.ui.dialog.button;CKEDITOR.ui.dialog.fieldset.prototype=CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);CKEDITOR.dialog.addUIElement("text",l);CKEDITOR.dialog.addUIElement("password",l);CKEDITOR.dialog.addUIElement("tel",l);CKEDITOR.dialog.addUIElement("textarea",g);CKEDITOR.dialog.addUIElement("checkbox",g);CKEDITOR.dialog.addUIElement("radio",g);CKEDITOR.dialog.addUIElement("button",g);CKEDITOR.dialog.addUIElement("select",g);CKEDITOR.dialog.addUIElement("file",g);CKEDITOR.dialog.addUIElement("fileButton",
|
|
579
|
+
g);CKEDITOR.dialog.addUIElement("html",g);CKEDITOR.dialog.addUIElement("fieldset",{build:function(a,d,c){for(var e=d.children,f,h=[],k=[],g=0;g<e.length&&(f=e[g]);g++){var l=[];h.push(l);k.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a,f,l))}return new CKEDITOR.ui.dialog[d.type](a,k,h,c,d)}})}});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
|
+
!0;a._.tabs[a._.currentTabId][0].focus();a._.currentFocusIndex=-1}function l(){for(var a=this._.tabIdList.length,c=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId)+a,b=c-1;b>c-a;b--)if(this._.tabs[this._.tabIdList[b%a]][0].$.offsetHeight)return this._.tabIdList[b%a];return null}function g(){for(var a=this._.tabIdList.length,c=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),b=c+1;b<c+a;b++)if(this._.tabs[this._.tabIdList[b%a]][0].$.offsetHeight)return this._.tabIdList[b%a];
|
|
581
581
|
return null}function f(a,c){for(var b=a.$.getElementsByTagName("input"),d=0,e=b.length;d<e;d++){var f=new CKEDITOR.dom.element(b[d]);"text"==f.getAttribute("type").toLowerCase()&&(c?(f.setAttribute("value",f.getCustomData("fake_value")||""),f.removeCustomData("fake_value")):(f.setCustomData("fake_value",f.getAttribute("value")),f.setAttribute("value","")))}}function e(a,c){var b=this.getInputElement();b&&(a?b.removeAttribute("aria-invalid"):b.setAttribute("aria-invalid",!0));a||(this.select?this.select():
|
|
582
582
|
this.focus());c&&alert(c);this.fire("validated",{valid:a,msg:c})}function m(){var a=this.getInputElement();a&&a.removeAttribute("aria-invalid")}function k(a){var c=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",K).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":""})),b=c.getChild([0,0,0,0,0]),d=b.getChild(0),
|
|
583
583
|
e=b.getChild(1);a.plugins.clipboard&&CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(b);!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(b.getParent()));d.unselectable();e.unselectable();return{element:c,
|
|
584
|
-
parts:{dialog:c.getChild(0),title:d,close:e,tabs:b.getChild(2),contents:b.getChild([3,0,0,0]),footer:b.getChild([3,0,1,0])}}}function
|
|
585
|
-
function b(a){function c(){a.layout()}var b=CKEDITOR.document.getWindow();b.on("resize",c);a.on("hide",function(){b.removeListener("resize",c)})}function d(a,b){this.dialog=a;for(var d=b.contents,e=0,f;f=d[e];e++)d[e]=f&&new c(a,f);CKEDITOR.tools.extend(this,b)}function c(a,c){this._={dialog:a};CKEDITOR.tools.extend(this,c)}function n(a){function c(b){var
|
|
586
|
-
k[3]<
|
|
587
|
-
|
|
588
|
-
a)}function
|
|
589
|
-
e==CKEDITOR.DIALOG_RESIZE_BOTH)
|
|
590
|
-
a.getParentEditor(),
|
|
591
|
-
|
|
592
|
-
c+" cke_resizer_"+f.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(f.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+
|
|
593
|
-
a._.viewportRatio=f}function
|
|
584
|
+
parts:{dialog:c.getChild(0),title:d,close:e,tabs:b.getChild(2),contents:b.getChild([3,0,0,0]),footer:b.getChild([3,0,1,0])}}}function h(a,c,b){this.element=c;this.focusIndex=b;this.tabIndex=0;this.isFocusable=function(){return!c.getAttribute("disabled")&&c.isVisible()};this.focus=function(){a._.currentFocusIndex=this.focusIndex;this.element.focus()};c.on("keydown",function(a){a.data.getKeystroke()in{32:1,13:1}&&this.fire("click")});c.on("focus",function(){this.fire("mouseover")});c.on("blur",function(){this.fire("mouseout")})}
|
|
585
|
+
function b(a){function c(){a.layout()}var b=CKEDITOR.document.getWindow();b.on("resize",c);a.on("hide",function(){b.removeListener("resize",c)})}function d(a,b){this.dialog=a;for(var d=b.contents,e=0,f;f=d[e];e++)d[e]=f&&new c(a,f);CKEDITOR.tools.extend(this,b)}function c(a,c){this._={dialog:a};CKEDITOR.tools.extend(this,c)}function n(a){function c(b){var g=a.getSize(),l=a.parts.dialog.getParent().getClientSize(),m=b.data.$.screenX,n=b.data.$.screenY,u=m-d.x,p=n-d.y;d={x:m,y:n};e.x+=u;e.y+=p;m=e.x+
|
|
586
|
+
k[3]<h?-k[3]:e.x-k[1]>l.width-g.width-h?l.width-g.width+("rtl"==f.lang.dir?0:k[1]):e.x;g=e.y+k[0]<h?-k[0]:e.y-k[2]>l.height-g.height-h?l.height-g.height+k[2]:e.y;m=Math.floor(m);g=Math.floor(g);a.move(m,g,1);b.data.preventDefault()}function b(){CKEDITOR.document.removeListener("mousemove",c);CKEDITOR.document.removeListener("mouseup",b);if(CKEDITOR.env.ie6Compat){var a=B.getChild(0).getFrameDocument();a.removeListener("mousemove",c);a.removeListener("mouseup",b)}}var d=null,e=null,f=a.getParentEditor(),
|
|
587
|
+
h=f.config.dialog_magnetDistance,k=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof h&&(h=20);a.parts.title.on("mousedown",function(f){if(!a._.moved){var h=a._.element;h.getFirst().setStyle("position","absolute");h.removeStyle("display");a._.moved=!0;a.layout()}d={x:f.data.$.screenX,y:f.data.$.screenY};CKEDITOR.document.on("mousemove",c);CKEDITOR.document.on("mouseup",b);e=a.getPosition();CKEDITOR.env.ie6Compat&&(h=B.getChild(0).getFrameDocument(),h.on("mousemove",c),h.on("mouseup",b));f.data.preventDefault()},
|
|
588
|
+
a)}function p(a){function c(b){var n="rtl"==f.lang.dir,u=m.width,p=m.height,x=u+(b.data.$.screenX-l.x)*(n?-1:1)*(a._.moved?1:2),y=p+(b.data.$.screenY-l.y)*(a._.moved?1:2),v=a._.element.getFirst(),v=n&&parseInt(v.getComputedStyle("right"),10),w=a.getPosition();w.x=w.x||0;w.y=w.y||0;w.y+y>g.height&&(y=g.height-w.y);(n?v:w.x)+x>g.width&&(x=g.width-(n?v:w.x));y=Math.floor(y);x=Math.floor(x);if(e==CKEDITOR.DIALOG_RESIZE_WIDTH||e==CKEDITOR.DIALOG_RESIZE_BOTH)u=Math.max(d.minWidth||0,x-h);if(e==CKEDITOR.DIALOG_RESIZE_HEIGHT||
|
|
589
|
+
e==CKEDITOR.DIALOG_RESIZE_BOTH)p=Math.max(d.minHeight||0,y-k);a.resize(u,p);a._.moved&&q(a,a._.position.x,a._.position.y);a._.moved||a.layout();b.data.preventDefault()}function b(){CKEDITOR.document.removeListener("mouseup",b);CKEDITOR.document.removeListener("mousemove",c);n&&(n.remove(),n=null);if(CKEDITOR.env.ie6Compat){var a=B.getChild(0).getFrameDocument();a.removeListener("mouseup",b);a.removeListener("mousemove",c)}}var d=a.definition,e=d.resizable;if(e!=CKEDITOR.DIALOG_RESIZE_NONE){var f=
|
|
590
|
+
a.getParentEditor(),h,k,g,l,m,n,u=CKEDITOR.tools.addFunction(function(d){function e(a){return a.isVisible()}m=a.getSize();var f=a.parts.contents,u=f.$.getElementsByTagName("iframe").length,p=!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks);u&&(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=m.height-a.parts.contents.getFirst(e).getSize("height",p);
|
|
591
|
+
h=m.width-a.parts.contents.getFirst(e).getSize("width",1);l={x:d.screenX,y:d.screenY};g=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",c);CKEDITOR.document.on("mouseup",b);CKEDITOR.env.ie6Compat&&(f=B.getChild(0).getFrameDocument(),f.on("mousemove",c),f.on("mouseup",b));d.preventDefault&&d.preventDefault()});a.on("load",function(){var c="";e==CKEDITOR.DIALOG_RESIZE_WIDTH?c=" cke_resizer_horizontal":e==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(c=" cke_resizer_vertical");c=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer'+
|
|
592
|
+
c+" cke_resizer_"+f.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(f.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+u+', event )"\x3e'+("ltr"==f.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(c,1)});f.on("destroy",function(){CKEDITOR.tools.removeFunction(u)})}}function q(a,c,b){var d=a.parts.dialog.getParent().getClientSize(),e=a.getSize(),f=a._.viewportRatio,h=Math.max(d.width-e.width,0),d=Math.max(d.height-e.height,0);f.width=h?c/h:f.width;f.height=d?b/d:f.height;
|
|
593
|
+
a._.viewportRatio=f}function t(a){a.data.preventDefault(1)}function r(a){var c=a.config,b=CKEDITOR.skinName||a.config.skin,d=c.dialog_backgroundCoverColor||("moono-lisa"==b?"black":"white"),b=c.dialog_backgroundCoverOpacity,e=c.baseFloatZIndex,c=CKEDITOR.tools.genKey(d,b,e),f=I[c];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: "+d,'" class\x3d"cke_dialog_background_cover"\x3e'],CKEDITOR.env.ie6Compat&&(d="\x3chtml\x3e\x3cbody style\x3d\\'background-color:"+d+";\\'\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( '"+d+"' );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!==b?b:.5),f.on("keydown",
|
|
596
|
-
(c=J[(c?"CTRL+":"")+(b?"ALT+":"")+(d?"SHIFT+":"")+e])&&c.length&&(c=c[c.length-1],c.keydown&&c.keydown.call(c.uiElement,c.dialog,c.key),a.data.preventDefault())}function
|
|
597
|
-
dialog:c,key:b,keyup:e||a.accessKeyUp,keydown:d||a.accessKeyDown})}function A(a){for(var c in J){for(var b=J[c],d=b.length-1;0<=d;d--)b[d].dialog!=a&&b[d].uiElement!=a||b.splice(d,1);0===b.length&&delete J[c]}}function
|
|
595
|
+
e.push("\x3c/div\x3e"),f=CKEDITOR.dom.element.createFromHtml(e.join("")),f.setOpacity(void 0!==b?b:.5),f.on("keydown",t),f.on("keypress",t),f.on("keyup",t),f.appendTo(CKEDITOR.document.getBody()),I[c]=f);a.focusManager.add(f);B=f;CKEDITOR.env.mac&&CKEDITOR.env.webkit||f.focus()}function v(a){CKEDITOR.document.getBody().removeClass("cke_dialog_open");B&&(a.focusManager.remove(B),B.hide())}function y(a){var c=a.data.$.ctrlKey||a.data.$.metaKey,b=a.data.$.altKey,d=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);
|
|
596
|
+
(c=J[(c?"CTRL+":"")+(b?"ALT+":"")+(d?"SHIFT+":"")+e])&&c.length&&(c=c[c.length-1],c.keydown&&c.keydown.call(c.uiElement,c.dialog,c.key),a.data.preventDefault())}function x(a){var c=a.data.$.ctrlKey||a.data.$.metaKey,b=a.data.$.altKey,d=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);(c=J[(c?"CTRL+":"")+(b?"ALT+":"")+(d?"SHIFT+":"")+e])&&c.length&&(c=c[c.length-1],c.keyup&&(c.keyup.call(c.uiElement,c.dialog,c.key),a.data.preventDefault()))}function z(a,c,b,d,e){(J[b]||(J[b]=[])).push({uiElement:a,
|
|
597
|
+
dialog:c,key:b,keyup:e||a.accessKeyUp,keydown:d||a.accessKeyDown})}function A(a){for(var c in J){for(var b=J[c],d=b.length-1;0<=d;d--)b[d].dialog!=a&&b[d].uiElement!=a||b.splice(d,1);0===b.length&&delete J[c]}}function w(a,c){a._.accessKeyMap[c]&&a.selectPage(a._.accessKeyMap[c])}function u(){}var D=CKEDITOR.tools.cssLength,C,B,G=!CKEDITOR.env.ie||CKEDITOR.env.edge,K='\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(c,b){function f(){var a=
|
|
600
|
-
|
|
601
|
-
l.call(
|
|
602
|
-
-1,
|
|
599
|
+
CKEDITOR.dialog=function(c,b){function f(){var a=r._.focusList;a.sort(function(a,c){return a.tabIndex!=c.tabIndex?c.tabIndex-a.tabIndex:a.focusIndex-c.focusIndex});for(var c=a.length,b=0;b<c;b++)a[b].focusIndex=b}function h(a){var c=r._.focusList;a=a||0;if(!(1>c.length)){var b=r._.currentFocusIndex;r._.tabBarMode&&0>a&&(b=0);try{c[b].getInputElement().$.blur()}catch(d){}var e=b,f=1<r._.pageCount;do{e+=a;if(f&&!r._.tabBarMode&&(e==c.length||-1==e)){r._.tabBarMode=!0;r._.tabs[r._.currentTabId][0].focus();
|
|
600
|
+
r._.currentFocusIndex=-1;return}e=(e+c.length)%c.length;if(e==b)break}while(a&&!c[e].isFocusable());c[e].focus();"text"==c[e].type&&c[e].select()}}function u(b){if(r==CKEDITOR.dialog._.currentTop){var d=b.data.getKeystroke(),e="rtl"==c.lang.dir,f=[37,38,39,40];A=D=0;if(9==d||d==CKEDITOR.SHIFT+9)h(d==CKEDITOR.SHIFT+9?-1:1),A=1;else if(d==CKEDITOR.ALT+121&&!r._.tabBarMode&&1<r.getPageCount())a(r),A=1;else if(-1!=CKEDITOR.tools.indexOf(f,d)&&r._.tabBarMode)d=-1!=CKEDITOR.tools.indexOf([e?39:37,38],d)?
|
|
601
|
+
l.call(r):g.call(r),r.selectPage(d),r._.tabs[d][0].focus(),A=1;else if(13!=d&&32!=d||!r._.tabBarMode)if(13==d)d=b.data.getTarget(),d.is("a","button","select","textarea")||d.is("input")&&"button"==d.$.type||((d=this.getButton("ok"))&&CKEDITOR.tools.setTimeout(d.click,0,d),A=1),D=1;else if(27==d)(d=this.getButton("cancel"))?CKEDITOR.tools.setTimeout(d.click,0,d):!1!==this.fire("cancel",{hide:!0}).hide&&this.hide(),D=1;else return;else this.selectPage(this._.currentTabId),this._.tabBarMode=!1,this._.currentFocusIndex=
|
|
602
|
+
-1,h(1),A=1;x(b)}}function x(a){A?a.data.preventDefault(1):D&&a.data.stopPropagation()}var y=CKEDITOR.dialog._.dialogDefinitions[b],v=CKEDITOR.tools.clone(C),w=c.config.dialog_buttonsOrder||"OS",z=c.lang.dir,q={},A,D;("OS"==w&&CKEDITOR.env.mac||"rtl"==w&&"ltr"==z||"ltr"==w&&"rtl"==z)&&v.buttons.reverse();y=CKEDITOR.tools.extend(y(c),v);y=CKEDITOR.tools.clone(y);y=new d(this,y);v=k(c);this._={editor:c,element:v.element,name:b,model:null,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},
|
|
603
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=v.parts;CKEDITOR.tools.setTimeout(function(){c.fire("ariaWidget",this.parts.contents)},0,this);v={top:0,visibility:"hidden"};CKEDITOR.env.ie6Compat&&(v.position="absolute");v["rtl"==z?"right":"left"]=0;this.parts.dialog.setStyles(v);CKEDITOR.event.call(this);this.definition=y=CKEDITOR.fire("dialogDefinition",
|
|
604
|
-
{name:b,definition:y,dialog:this},c).definition;if(!("removeDialogTabs"in c._)&&c.config.removeDialogTabs){v=c.config.removeDialogTabs.split(";");for(z=0;z<v.length;z++)if(
|
|
605
|
-
function(a){c.fire("saveSnapshot");setTimeout(function(){c.fire("saveSnapshot")},0);!1===y.onOk.call(this,a)&&(a.data.hide=!1)});this.state=CKEDITOR.DIALOG_STATE_IDLE;if(y.onCancel)this.on("cancel",function(a){!1===y.onCancel.call(this,a)&&(a.data.hide=!1)});var
|
|
606
|
-
e.call(c,!d,"string"==typeof b?b:void 0);return d}})},this,null,0);this.on("cancel",function(a){
|
|
607
|
-
|
|
608
|
-
1,y.onFocus?(a=y.onFocus.call(this))&&a.focus():
|
|
609
|
-
a(this),c.data.preventDefault())},this);z=[];
|
|
604
|
+
{name:b,definition:y,dialog:this},c).definition;if(!("removeDialogTabs"in c._)&&c.config.removeDialogTabs){v=c.config.removeDialogTabs.split(";");for(z=0;z<v.length;z++)if(w=v[z].split(":"),2==w.length){var B=w[0];q[B]||(q[B]=[]);q[B].push(w[1])}c._.removeDialogTabs=q}if(c._.removeDialogTabs&&(q=c._.removeDialogTabs[b]))for(z=0;z<q.length;z++)y.removeContents(q[z]);if(y.onLoad)this.on("load",y.onLoad);if(y.onShow)this.on("show",y.onShow);if(y.onHide)this.on("hide",y.onHide);if(y.onOk)this.on("ok",
|
|
605
|
+
function(a){c.fire("saveSnapshot");setTimeout(function(){c.fire("saveSnapshot")},0);!1===y.onOk.call(this,a)&&(a.data.hide=!1)});this.state=CKEDITOR.DIALOG_STATE_IDLE;if(y.onCancel)this.on("cancel",function(a){!1===y.onCancel.call(this,a)&&(a.data.hide=!1)});var r=this,t=function(a){var c=r._.contents,b=!1,d;for(d in c)for(var e in c[d])if(b=a.call(this,c[d][e]))return};this.on("ok",function(a){t(function(c){if(c.validate){var b=c.validate(this),d="string"==typeof b||!1===b;d&&(a.data.hide=!1,a.stop());
|
|
606
|
+
e.call(c,!d,"string"==typeof b?b:void 0);return d}})},this,null,0);this.on("cancel",function(a){t(function(b){if(b.isChanged())return c.config.dialog_noConfirmCancel||confirm(c.lang.common.confirmCancel)||(a.data.hide=!1),!0})},this,null,0);this.parts.close.on("click",function(a){!1!==this.fire("cancel",{hide:!0}).hide&&this.hide();a.data.preventDefault()},this);this.changeFocus=h;var G=this._.element;c.focusManager.add(G,1);this.on("show",function(){G.on("keydown",u,this);if(CKEDITOR.env.gecko)G.on("keypress",
|
|
607
|
+
x,this)});this.on("hide",function(){G.removeListener("keydown",u);CKEDITOR.env.gecko&&G.removeListener("keypress",x);t(function(a){m.apply(a)})});this.on("iframeAdded",function(a){(new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown",u,this,null,0)});this.on("show",function(){f();var a=1<r._.pageCount;c.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,y.onFocus?(a=y.onFocus.call(this))&&a.focus():h(1))},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on("load",function(){var a=this.getElement(),c=a.getFirst();c.remove();c.appendTo(a)},this);n(this);p(this);(new CKEDITOR.dom.text(y.title,CKEDITOR.document)).appendTo(this.parts.title);for(z=0;z<y.contents.length;z++)(q=y.contents[z])&&this.addPage(q);this.parts.tabs.on("click",function(c){var b=c.data.getTarget();b.hasClass("cke_dialog_tab")&&(b=b.$.id,this.selectPage(b.substring(4,b.lastIndexOf("_"))),
|
|
609
|
+
a(this),c.data.preventDefault())},this);z=[];q=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:y.buttons},z).getChild();this.parts.footer.setHtml(z.join(""));for(z=0;z<q.length;z++)this._.buttons[q[z].id]=q[z]};CKEDITOR.dialog.prototype={destroy:function(){this.hide();this._.element.remove()},resize:function(a,c){if(!this._.contentSize||this._.contentSize.width!=a||this._.contentSize.height!=c){CKEDITOR.dialog.fire("resize",
|
|
610
610
|
{dialog:this,width:a,height:c},this._.editor);this.fire("resize",{width:a,height:c},this._.editor);this.parts.contents.setStyles({width:a+"px",height:c+"px"});if("rtl"==this._.editor.lang.dir&&this._.position){var b=this.parts.dialog.getParent().getClientSize().width;this._.position.x=b-this._.contentSize.width-parseInt(this._.element.getFirst().getStyle("right"),10)}this._.contentSize={width:a,height:c}}},getSize:function(){var a=this._.element.getFirst();return{width:a.$.offsetWidth||0,height:a.$.offsetHeight||
|
|
611
|
-
0}},move:function(a,c,b){var d=this._.element.getFirst(),e="rtl"==this._.editor.lang.dir;CKEDITOR.env.ie&&d.setStyle("zoom","100%");var f=this.parts.dialog.getParent().getClientSize(),
|
|
611
|
+
0}},move:function(a,c,b){var d=this._.element.getFirst(),e="rtl"==this._.editor.lang.dir;CKEDITOR.env.ie&&d.setStyle("zoom","100%");var f=this.parts.dialog.getParent().getClientSize(),h=this.getSize(),k=this._.viewportRatio,g=Math.max(f.width-h.width,0),f=Math.max(f.height-h.height,0);this._.position&&this._.position.x==a&&this._.position.y==c?(a=Math.floor(g*k.width),c=Math.floor(f*k.height)):q(this,a,c);this._.position={x:a,y:c};e&&(a=g-a);c={top:(0<c?c:0)+"px"};c[e?"right":"left"]=(0<a?a:0)+"px";
|
|
612
612
|
d.setStyles(c);b&&(this._.moved=1)},getPosition:function(){return CKEDITOR.tools.extend({},this._.position)},show:function(){var a=this._.element,c=this.definition,d=CKEDITOR.document.getBody(),e=this._.editor.config.baseFloatZIndex;a.getParent()&&a.getParent().equals(d)?a.setStyle("display",G?"flex":"block"):a.appendTo(d);this.resize(this._.contentSize&&this._.contentSize.width||c.width||c.minWidth,this._.contentSize&&this._.contentSize.height||c.height||c.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",d.$.style.zIndex),CKEDITOR.dialog._.currentTop=this);a.on("keydown",y);a.on("keyup",
|
|
615
|
-
|
|
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,d=this._.parentDialog.getElement().getFirst(),d.$.style.zIndex-=
|
|
614
|
+
Math.floor(e/2),this._.parentDialog.getElement().setStyle("z-index",d.$.style.zIndex),CKEDITOR.dialog._.currentTop=this);a.on("keydown",y);a.on("keyup",x);this._.hasFocus=!1;for(var f in c.contents)if(c.contents[f]){var a=c.contents[f],e=this._.tabs[a.id],d=a.requiredContent,h=0;if(e){for(var k in this._.contents[a.id]){var g=this._.contents[a.id][k];"hbox"!=g.type&&"vbox"!=g.type&&g.getInputElement()&&(g.requiredContent&&!this._.editor.activeFilter.check(g.requiredContent)?g.disable():(g.enable(),
|
|
615
|
+
h++))}!h||d&&!this._.editor.activeFilter.check(d)?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 c=this.getSize(),b=CKEDITOR.document.getWindow().getViewPaneSize(),d;this._.moved&&this._.position?(d=this._.position.x,c=this._.position.y):(d=(b.width-c.width)/2,c=(b.height-c.height)/2);CKEDITOR.env.ie6Compat||(a.setStyle("position","absolute"),a.removeStyle("margin"));d=Math.floor(d);c=Math.floor(c);this.move(d,c)}},foreach:function(a){for(var c in this._.contents)for(var b in this._.contents[c])a.call(this,this._.contents[c][b]);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(c){c.setup&&c.setup.apply(c,a)})},commitContent:function(){var a=arguments;this.foreach(function(c){CKEDITOR.env.ie&&this._.currentFocusIndex==c.focusIndex&&c.getInputElement().$.blur();c.commit&&c.commit.apply(c,a)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{});this._.editor.fire("dialogHide",this);this.selectPage(this._.tabIdList[0]);
|
|
618
618
|
var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility","hidden");for(A(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var c=this._.parentDialog.getElement().getFirst();this._.parentDialog.getElement().removeStyle("z-index");c.setStyle("z-index",parseInt(c.$.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",y);a.removeListener("keyup",
|
|
620
|
-
'"':"",d=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents",children:a.elements,expand:!!a.expand,padding:a.padding,style:a.style||"width: 100%;"},c),e=this._.contents[a.id]={},f=d.getChild(),
|
|
619
|
+
10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",y);a.removeListener("keyup",x);var b=this._.editor;b.focus();setTimeout(function(){b.focusManager.unlock();CKEDITOR.env.iOS&&b.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 c=[],b=a.label?' title\x3d"'+CKEDITOR.tools.htmlEncode(a.label)+
|
|
620
|
+
'"':"",d=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents",children:a.elements,expand:!!a.expand,padding:a.padding,style:a.style||"width: 100%;"},c),e=this._.contents[a.id]={},f=d.getChild(),h=0;d=f.shift();)d.notAllowed||"hbox"==d.type||"vbox"==d.type||h++,e[d.id]=d,"function"==typeof d.getChild&&f.push.apply(f,d.getChild());h||(a.hidden=!0);c=CKEDITOR.dom.element.createFromHtml(c.join(""));c.setAttribute("role","tabpanel");c.setStyle("min-height",
|
|
621
621
|
"100%");d=CKEDITOR.env;e="cke_"+a.id+"_"+CKEDITOR.tools.getNextNumber();b=CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"',0<this._.pageCount?" cke_last":"cke_first",b,a.hidden?' style\x3d"display:none"':"",' id\x3d"',e,'"',d.gecko&&!d.hc?"":' href\x3d"javascript:void(0)"',' tabIndex\x3d"-1" hidefocus\x3d"true" role\x3d"tab"\x3e',a.label,"\x3c/a\x3e"].join(""));c.setAttribute("aria-labelledby",e);this._.tabs[a.id]=[b,c];this._.tabIdList.push(a.id);!a.hidden&&this._.pageCount++;
|
|
622
|
-
this._.lastTab=b;this.updateStyle();c.setAttribute("name",a.id);c.appendTo(this.parts.contents);b.unselectable();this.parts.tabs.append(b);a.accessKey&&(z(this,this,"CTRL+"+a.accessKey,
|
|
622
|
+
this._.lastTab=b;this.updateStyle();c.setAttribute("name",a.id);c.appendTo(this.parts.contents);b.unselectable();this.parts.tabs.append(b);a.accessKey&&(z(this,this,"CTRL+"+a.accessKey,u,w),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 c in this._.tabs){var b=this._.tabs[c][0],d=this._.tabs[c][1];c!=a&&(b.removeClass("cke_dialog_tab_selected"),
|
|
623
623
|
b.removeAttribute("aria-selected"),d.hide());d.setAttribute("aria-hidden",c!=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 c=
|
|
624
624
|
this._.tabs[a]&&this._.tabs[a][0];c&&1!=this._.pageCount&&c.isVisible()&&(a==this._.currentTabId&&this.selectPage(l.call(this)),c.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,c){var b=this._.contents[a];return b&&b[c]},getValueOf:function(a,c){return this.getContentElement(a,c).getValue()},
|
|
625
625
|
setValueOf:function(a,c,b){return this.getContentElement(a,c).setValue(b)},getButton:function(a){return this._.buttons[a]},click:function(a){return this._.buttons[a].click()},disableButton:function(a){return this._.buttons[a].disable()},enableButton:function(a){return this._.buttons[a].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},addFocusable:function(a,
|
|
626
|
-
c){if("undefined"==typeof c)c=this._.focusList.length,this._.focusList.push(new
|
|
626
|
+
c){if("undefined"==typeof c)c=this._.focusList.length,this._.focusList.push(new h(this,a,c));else{this._.focusList.splice(c,0,new h(this,a,c));for(var b=c+1;b<this._.focusList.length;b++)this._.focusList[b].focusIndex++}},setState:function(a){if(this.state!=a){this.state=a;if(a==CKEDITOR.DIALOG_STATE_BUSY){if(!this.parts.spinner){var c=this.getParentEditor().lang.dir,b={attributes:{"class":"cke_dialog_spinner"},styles:{"float":"rtl"==c?"right":"left"}};b.styles["margin-"+("rtl"==c?"left":"right")]=
|
|
627
627
|
"8px";this.parts.spinner=CKEDITOR.document.createElement("div",b);this.parts.spinner.setHtml("\x26#8987;");this.parts.spinner.appendTo(this.parts.title,1)}this.parts.spinner.show();this.getButton("ok").disable()}else a==CKEDITOR.DIALOG_STATE_IDLE&&(this.parts.spinner&&this.parts.spinner.hide(),this.getButton("ok").enable());this.fire("state",a)}},getModel:function(a){return this._.model?this._.model:this.definition.getModel?this.definition.getModel(a):null},setModel:function(a){this._.model=a},getMode:function(a){if(this.definition.getMode)return this.definition.getMode(a);
|
|
628
628
|
a=this.getModel(a);return!a||a instanceof CKEDITOR.dom.element&&!a.getParent()?CKEDITOR.dialog.CREATION_MODE:CKEDITOR.dialog.EDITING_MODE}};CKEDITOR.tools.extend(CKEDITOR.dialog,{CREATION_MODE:0,EDITING_MODE:1,add:function(a,c){this._.dialogDefinitions[a]&&"function"!=typeof c||(this._.dialogDefinitions[a]=c)},exists:function(a){return!!this._.dialogDefinitions[a]},getCurrent:function(){return CKEDITOR.dialog._.currentTop},isTabEnabled:function(a,c,b){a=a.config.removeDialogTabs;return!(a&&a.match(new RegExp("(?:^|;)"+
|
|
629
629
|
c+":"+b+"(?:$|;)","i")))},okButton:function(){var a=function(a,c){c=c||{};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()}},c,!0)};a.type="button";a.override=function(c){return CKEDITOR.tools.extend(function(b){return a(b,c)},{type:"button"},!0)};return a}(),cancelButton:function(){var a=function(a,c){c=c||{};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()}},c,!0)};a.type="button";a.override=function(c){return CKEDITOR.tools.extend(function(b){return a(b,c)},{type:"button"},!0)};return a}(),addUIElement:function(a,c){this._.uiElementBuilders[a]=c}});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 H=function(a,c,b){for(var d=0,e;e=a[d];d++)if(e.id==c||b&&e[b]&&(e=H(e[b],c,b)))return e;return null},E=function(a,c,b,d,e){if(b){for(var f=0,
|
|
631
|
+
C={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]};var H=function(a,c,b){for(var d=0,e;e=a[d];d++)if(e.id==c||b&&e[b]&&(e=H(e[b],c,b)))return e;return null},E=function(a,c,b,d,e){if(b){for(var f=0,h;h=a[f];f++){if(h.id==b)return a.splice(f,0,c),c;if(d&&h[d]&&(h=E(h[d],c,b,d,!0)))return h}if(e)return null}a.push(c);return c},M=function(a,c,b){for(var d=0,e;e=a[d];d++){if(e.id==c)return a.splice(d,1);if(b&&e[b]&&(e=M(e[b],
|
|
632
632
|
c,b)))return e}return null};d.prototype={getContents:function(a){return H(this.contents,a)},getButton:function(a){return H(this.buttons,a)},addContents:function(a,c){return E(this.contents,a,c)},addButton:function(a,c){return E(this.buttons,a,c)},removeContents:function(a){M(this.contents,a)},removeButton:function(a){M(this.buttons,a)}};c.prototype={get:function(a){return H(this.elements,a,"children")},add:function(a,c){return E(this.elements,a,c,"children")},remove:function(a){M(this.elements,a,
|
|
633
|
-
"children")}};var I={},J={};(function(){CKEDITOR.ui.dialog={uiElement:function(a,c,b,d,e,f,
|
|
634
|
-
1);c.disabled&&(
|
|
635
|
-
for(
|
|
636
|
-
function(a){return function(){return c.getValue.call(this,a.call(this))}}));CKEDITOR.event.implementOn(this);this.registerEvents(c);this.accessKeyUp&&this.accessKeyDown&&c.accessKey&&z(this,a,"CTRL+"+c.accessKey);var
|
|
637
|
-
b&&this.removeClass(b)})}});CKEDITOR.tools.extend(this,c);this.keyboardFocusable&&(this.tabIndex=c.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(
|
|
639
|
-
0<d.length&&a.push('style\x3d"'+d.join("; ")+'" ');a.push("\x3e",b[
|
|
640
|
-
c.push("width:"+D(
|
|
641
|
-
CKEDITOR.env.quirks&&f[d].align&&
|
|
633
|
+
"children")}};var I={},J={};(function(){CKEDITOR.ui.dialog={uiElement:function(a,c,b,d,e,f,h){if(!(4>arguments.length)){var k=(d.call?d(c):d)||"div",g=["\x3c",k," "],l=(e&&e.call?e(c):e)||{},m=(f&&f.call?f(c):f)||{},n=(h&&h.call?h.call(this,a,c):h)||"",u=this.domId=m.id||CKEDITOR.tools.getNextId()+"_uiElement";c.requiredContent&&!a.getParentEditor().filter.check(c.requiredContent)&&(l.display="none",this.notAllowed=!0);m.id=u;var x={};c.type&&(x["cke_dialog_ui_"+c.type]=1);c.className&&(x[c.className]=
|
|
634
|
+
1);c.disabled&&(x.cke_disabled=1);for(var p=m["class"]&&m["class"].split?m["class"].split(" "):[],u=0;u<p.length;u++)p[u]&&(x[p[u]]=1);p=[];for(u in x)p.push(u);m["class"]=p.join(" ");c.title&&(m.title=c.title);x=(c.style||"").split(";");c.align&&(p=c.align,l["margin-left"]="left"==p?0:"auto",l["margin-right"]="right"==p?0:"auto");for(u in l)x.push(u+":"+l[u]);c.hidden&&x.push("display:none");for(u=x.length-1;0<=u;u--)""===x[u]&&x.splice(u,1);0<x.length&&(m.style=(m.style?m.style+"; ":"")+x.join("; "));
|
|
635
|
+
for(u in m)g.push(u+'\x3d"'+CKEDITOR.tools.htmlEncode(m[u])+'" ');g.push("\x3e",n,"\x3c/",k,"\x3e");b.push(g.join(""));(this._||(this._={})).dialog=a;"boolean"==typeof c.isChanged&&(this.isChanged=function(){return c.isChanged});"function"==typeof c.isChanged&&(this.isChanged=c.isChanged);"function"==typeof c.setValue&&(this.setValue=CKEDITOR.tools.override(this.setValue,function(a){return function(b){a.call(this,c.setValue.call(this,b))}}));"function"==typeof c.getValue&&(this.getValue=CKEDITOR.tools.override(this.getValue,
|
|
636
|
+
function(a){return function(){return c.getValue.call(this,a.call(this))}}));CKEDITOR.event.implementOn(this);this.registerEvents(c);this.accessKeyUp&&this.accessKeyDown&&c.accessKey&&z(this,a,"CTRL+"+c.accessKey);var y=this;a.on("load",function(){var c=y.getInputElement();if(c){var b=y.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&8>CKEDITOR.env.version?"cke_dialog_ui_focused":"";c.on("focus",function(){a._.tabBarMode=!1;a._.hasFocus=!0;y.fire("focus");b&&this.addClass(b)});c.on("blur",function(){y.fire("blur");
|
|
637
|
+
b&&this.removeClass(b)})}});CKEDITOR.tools.extend(this,c);this.keyboardFocusable&&(this.tabIndex=c.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=y.focusIndex}))}},hbox:function(a,c,b,d,e){if(!(4>arguments.length)){this._||(this._={});var f=this._.children=c,h=e&&e.widths||null,k=e&&e.height||null,g,l={role:"presentation"};e&&e.align&&(l.align=e.align);CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"hbox"},d,"table",{},l,function(){var a=
|
|
638
|
+
['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];for(g=0;g<b.length;g++){var c="cke_dialog_ui_hbox_child",d=[];0===g&&(c="cke_dialog_ui_hbox_first");g==b.length-1&&(c="cke_dialog_ui_hbox_last");a.push('\x3ctd class\x3d"',c,'" role\x3d"presentation" ');h?h[g]&&d.push("width:"+D(h[g])):d.push("width:"+Math.floor(100/b.length)+"%");k&&d.push("height:"+D(k));e&&void 0!==e.padding&&d.push("padding:"+D(e.padding));CKEDITOR.env.ie&&CKEDITOR.env.quirks&&f[g].align&&d.push("text-align:"+f[g].align);
|
|
639
|
+
0<d.length&&a.push('style\x3d"'+d.join("; ")+'" ');a.push("\x3e",b[g],"\x3c/td\x3e")}a.push("\x3c/tr\x3e\x3c/tbody\x3e");return a.join("")})}},vbox:function(a,c,b,d,e){if(!(3>arguments.length)){this._||(this._={});var f=this._.children=c,h=e&&e.width||null,k=e&&e.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"vbox"},d,"div",null,{role:"presentation"},function(){var c=['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" '];c.push('style\x3d"');e&&e.expand&&c.push("height:100%;");
|
|
640
|
+
c.push("width:"+D(h||"100%"),";");CKEDITOR.env.webkit&&c.push("float:none;");c.push('"');c.push('align\x3d"',CKEDITOR.tools.htmlEncode(e&&e.align||("ltr"==a.getParentEditor().lang.dir?"left":"right")),'" ');c.push("\x3e\x3ctbody\x3e");for(var d=0;d<b.length;d++){var g=[];c.push('\x3ctr\x3e\x3ctd role\x3d"presentation" ');h&&g.push("width:"+D(h||"100%"));k?g.push("height:"+D(k[d])):e&&e.expand&&g.push("height:"+Math.floor(100/b.length)+"%");e&&void 0!==e.padding&&g.push("padding:"+D(e.padding));CKEDITOR.env.ie&&
|
|
641
|
+
CKEDITOR.env.quirks&&f[d].align&&g.push("text-align:"+f[d].align);0<g.length&&c.push('style\x3d"',g.join("; "),'" ');c.push(' class\x3d"cke_dialog_ui_vbox_child"\x3e',b[d],"\x3c/td\x3e\x3c/tr\x3e")}c.push("\x3c/tbody\x3e\x3c/table\x3e");return c.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,c){this.getInputElement().setValue(a);
|
|
642
642
|
!c&&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 c=
|
|
643
643
|
/^on([A-Z]\w+)/,b,d=function(a,c,b,d){c.on("load",function(){a.getInputElement().on(b,d,a)})},e;for(e in a)if(b=e.match(c))this.eventProcessors[e]?this.eventProcessors[e].call(this,this._.dialog,a[e]):d(this,this._.dialog,b[1].toLowerCase(),a[e]);return this},eventProcessors:{onLoad:function(a,c){a.on("load",c,this)},onShow:function(a,c){a.on("show",c,this)},onHide:function(a,c){a.on("hide",c,this)}},accessKeyDown:function(){this.focus()},accessKeyUp:function(){},disable:function(){var a=this.getElement();
|
|
644
644
|
this.getInputElement().setAttribute("disabled","true");a.addClass("cke_disabled")},enable:function(){var a=this.getElement();this.getInputElement().removeAttribute("disabled");a.removeClass("cke_disabled")},isEnabled:function(){return!this.getElement().hasClass("cke_disabled")},isVisible:function(){return this.getInputElement().isVisible()},isFocusable:function(){return this.isEnabled()&&this.isVisible()?!0:!1}};CKEDITOR.ui.dialog.hbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,
|
|
645
|
-
{getChild:function(a){if(1>arguments.length)return this._.children.concat();a.splice||(a=[a]);return 2>a.length?this._.children[a[0]]:this._.children[a[0]]&&this._.children[a[0]].getChild?this._.children[a[0]].getChild(a.slice(1,a.length)):null}},!0);CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox;(function(){var a={build:function(a,c,b){for(var d=c.children,e,f=[],
|
|
646
|
-
|
|
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 c=this&&this.getValue?this.getValue():a[0],b,d=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]&&(b=a[f],f++);f<a.length&&"number"==typeof a[f]&&(d=a[f]);var
|
|
648
|
-
e[f](c):
|
|
645
|
+
{getChild:function(a){if(1>arguments.length)return this._.children.concat();a.splice||(a=[a]);return 2>a.length?this._.children[a[0]]:this._.children[a[0]]&&this._.children[a[0]].getChild?this._.children[a[0]].getChild(a.slice(1,a.length)):null}},!0);CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox;(function(){var a={build:function(a,c,b){for(var d=c.children,e,f=[],h=[],k=0;k<d.length&&(e=d[k]);k++){var g=[];f.push(g);h.push(CKEDITOR.dialog._.uiElementBuilders[e.type].build(a,e,g))}return new CKEDITOR.ui.dialog[c.type](a,
|
|
646
|
+
h,f,b,c)}};CKEDITOR.dialog.addUIElement("hbox",a);CKEDITOR.dialog.addUIElement("vbox",a)})();CKEDITOR.dialogCommand=function(a,c){this.dialogName=a;CKEDITOR.tools.extend(this,c,!0)};CKEDITOR.dialogCommand.prototype={exec:function(a){var c=this.tabId;a.openDialog(this.dialogName,function(a){c&&a.selectPage(c)})},canUndo:!1,editorFocus:1};(function(){var a=/^([a]|[^a])+$/,c=/^\d*$/,b=/^\d*(?:\.\d+)?$/,d=/^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,e=/^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,
|
|
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 c=this&&this.getValue?this.getValue():a[0],b,d=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]&&(b=a[f],f++);f<a.length&&"number"==typeof a[f]&&(d=a[f]);var h=d==CKEDITOR.VALIDATE_AND?!0:!1;for(f=0;f<e.length;f++)h=d==CKEDITOR.VALIDATE_AND?h&&
|
|
648
|
+
e[f](c):h||e[f](c);return h?!0:b}},regex:function(a,c){return function(b){b=this&&this.getValue?this.getValue():b;return a.test(b)?!0:c}},notEmpty:function(c){return this.regex(a,c)},integer:function(a){return this.regex(c,a)},number:function(a){return this.regex(b,a)},cssLength:function(a){return this.functions(function(a){return e.test(CKEDITOR.tools.trim(a))},a)},htmlLength:function(a){return this.functions(function(a){return d.test(CKEDITOR.tools.trim(a))},a)},inlineStyle:function(a){return this.functions(function(a){return f.test(CKEDITOR.tools.trim(a))},
|
|
649
649
|
a)},equals:function(a,c){return this.functions(function(c){return c==a},c)},notEqual:function(a,c){return this.functions(function(c){return c!=a},c)}};CKEDITOR.on("instanceDestroyed",function(a){if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)){for(var c;c=CKEDITOR.dialog._.currentTop;)c.hide();for(var b in I)I[b].remove();I={}}a=a.editor._.storedDialogs;for(var d in a)a[d].destroy()})})();CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(a,c,b){var d=null,e=CKEDITOR.dialog._.dialogDefinitions[a];
|
|
650
|
-
null===CKEDITOR.dialog._.currentTop&&
|
|
650
|
+
null===CKEDITOR.dialog._.currentTop&&r(this);if("function"==typeof e)e=this._.storedDialogs||(this._.storedDialogs={}),d=e[a]||(e[a]=new CKEDITOR.dialog(this,a)),d.setModel(b),c&&c.call(d,d),d.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,c,b)},this,0,1)}CKEDITOR.skin.loadPart("dialog");if(d)d.once("hide",function(){d.setModel(null)},null,null,999);return d}})})();var ka=!1;CKEDITOR.plugins.add("dialog",{requires:"dialogui",init:function(a){ka||(CKEDITOR.document.appendStyleSheet(this.path+"styles/dialog.css"),ka=!0);a.on("doubleclick",function(l){l.data.dialog&&a.openDialog(l.data.dialog)},null,null,999)}});"use strict";(function(){function a(a,f){CKEDITOR.tools.extend(this,f,{editor:a,id:"cke-"+CKEDITOR.tools.getUniqueId(),
|
|
652
652
|
area:a._.notificationArea});f.type||(this.type="info");this.element=this._createElement();a.plugins.clipboard&&CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(this.element)}function l(a){var f=this;this.editor=a;this.notifications=[];this.element=this._createElement();this._uiBuffer=CKEDITOR.tools.eventsBuffer(10,this._layout,this);this._changeBuffer=CKEDITOR.tools.eventsBuffer(500,this._layout,this);a.on("destroy",function(){f._removeListeners();f.element.remove()})}CKEDITOR.plugins.add("notification",
|
|
653
|
-
{init:function(a){function f(a){var f=new CKEDITOR.dom.element("div");f.setStyles({position:"fixed","margin-left":"-9999px"});f.setAttributes({"aria-live":"assertive","aria-atomic":"true"});f.setText(a);CKEDITOR.document.getBody().append(f);setTimeout(function(){f.remove()},100)}a._.notificationArea=new l(a);a.showNotification=function(e,f,k){var
|
|
654
|
-
e.data.keyCode){var l=a._.notificationArea.notifications;l.length&&(f(a.lang.notification.closed),l[l.length-1].hide(),e.cancel())}})}});a.prototype={show:function(){!1!==this.editor.fire("notificationShow",{notification:this})&&(this.area.add(this),this._hideAfterTimeout())},update:function(a){var f=!0;!1===this.editor.fire("notificationUpdate",{notification:this,options:a})&&(f=!1);var e=this.element,l=e.findOne(".cke_notification_message"),k=e.findOne(".cke_notification_progress"),
|
|
655
|
-
a.progress&&"progress"!=this.type&&(
|
|
653
|
+
{init:function(a){function f(a){var f=new CKEDITOR.dom.element("div");f.setStyles({position:"fixed","margin-left":"-9999px"});f.setAttributes({"aria-live":"assertive","aria-atomic":"true"});f.setText(a);CKEDITOR.document.getBody().append(f);setTimeout(function(){f.remove()},100)}a._.notificationArea=new l(a);a.showNotification=function(e,f,k){var h,b;"progress"==f?h=k:b=k;e=new CKEDITOR.plugins.notification(a,{message:e,type:f,progress:h,duration:b});e.show();return e};a.on("key",function(e){if(27==
|
|
654
|
+
e.data.keyCode){var l=a._.notificationArea.notifications;l.length&&(f(a.lang.notification.closed),l[l.length-1].hide(),e.cancel())}})}});a.prototype={show:function(){!1!==this.editor.fire("notificationShow",{notification:this})&&(this.area.add(this),this._hideAfterTimeout())},update:function(a){var f=!0;!1===this.editor.fire("notificationUpdate",{notification:this,options:a})&&(f=!1);var e=this.element,l=e.findOne(".cke_notification_message"),k=e.findOne(".cke_notification_progress"),h=a.type;e.removeAttribute("role");
|
|
655
|
+
a.progress&&"progress"!=this.type&&(h="progress");h&&(e.removeClass(this._getClass()),e.removeAttribute("aria-label"),this.type=h,e.addClass(this._getClass()),e.setAttribute("aria-label",this.type),"progress"!=this.type||k?"progress"!=this.type&&k&&k.remove():(k=this._createProgressElement(),k.insertBefore(l)));void 0!==a.message&&(this.message=a.message,l.setHtml(this.message));void 0!==a.progress&&(this.progress=a.progress,k&&k.setStyle("width",this._getPercentageProgress()));f&&a.important&&(e.setAttribute("role",
|
|
656
656
|
"alert"),this.isVisible()||this.area.add(this));this.duration=a.duration;this._hideAfterTimeout()},hide:function(){!1!==this.editor.fire("notificationHide",{notification:this})&&this.area.remove(this)},isVisible:function(){return 0<=CKEDITOR.tools.indexOf(this.area.notifications,this)},_createElement:function(){var a=this,f,e,l=this.editor.lang.common.close;f=new CKEDITOR.dom.element("div");f.addClass("cke_notification");f.addClass(this._getClass());f.setAttributes({id:this.id,role:"alert","aria-label":this.type});
|
|
657
657
|
"progress"==this.type&&f.append(this._createProgressElement());e=new CKEDITOR.dom.element("p");e.addClass("cke_notification_message");e.setHtml(this.message);f.append(e);e=CKEDITOR.dom.element.createFromHtml('\x3ca class\x3d"cke_notification_close" href\x3d"javascript:void(0)" title\x3d"'+l+'" role\x3d"button" tabindex\x3d"-1"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e');f.append(e);e.on("click",function(){a.editor.focus();a.hide()});return f},_getClass:function(){return"progress"==
|
|
658
658
|
this.type?"cke_notification_info":"cke_notification_"+this.type},_createProgressElement:function(){var a=new CKEDITOR.dom.element("span");a.addClass("cke_notification_progress");a.setStyle("width",this._getPercentageProgress());return a},_getPercentageProgress:function(){return Math.round(100*(this.progress||0))+"%"},_hideAfterTimeout:function(){var a=this,f;this._hideTimeoutId&&clearTimeout(this._hideTimeoutId);if("number"==typeof this.duration)f=this.duration;else if("info"==this.type||"success"==
|
|
659
659
|
this.type)f="number"==typeof this.editor.config.notification_duration?this.editor.config.notification_duration:5E3;f&&(a._hideTimeoutId=setTimeout(function(){a.hide()},f))}};l.prototype={add:function(a){this.notifications.push(a);this.element.append(a.element);1==this.element.getChildCount()&&(CKEDITOR.document.getBody().append(this.element),this._attachListeners());this._layout()},remove:function(a){var f=CKEDITOR.tools.indexOf(this.notifications,a);0>f||(this.notifications.splice(f,1),a.element.remove(),
|
|
660
660
|
this.element.getChildCount()||(this._removeListeners(),this.element.remove()))},_createElement:function(){var a=this.editor,f=a.config,e=new CKEDITOR.dom.element("div");e.addClass("cke_notifications_area");e.setAttribute("id","cke_notifications_area_"+a.name);e.setStyle("z-index",f.baseFloatZIndex-2);return e},_attachListeners:function(){var a=CKEDITOR.document.getWindow(),f=this.editor;a.on("scroll",this._uiBuffer.input);a.on("resize",this._uiBuffer.input);f.on("change",this._changeBuffer.input);
|
|
661
|
-
f.on("floatingSpaceLayout",this._layout,this,null,20);f.on("blur",this._layout,this,null,20)},_removeListeners:function(){var a=CKEDITOR.document.getWindow(),f=this.editor;a.removeListener("scroll",this._uiBuffer.input);a.removeListener("resize",this._uiBuffer.input);f.removeListener("change",this._changeBuffer.input);f.removeListener("floatingSpaceLayout",this._layout);f.removeListener("blur",this._layout)},_layout:function(){function a(){f.setStyle("left",y(
|
|
662
|
-
this.editor,l=e.ui.contentsElement.getClientRect(),k=e.ui.contentsElement.getDocumentPosition(),
|
|
663
|
-
10));e.toolbar&&(
|
|
664
|
-
f.setStyle("left",y(
|
|
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",y(x+l.width-n-p))}var f=this.element,e=
|
|
662
|
+
this.editor,l=e.ui.contentsElement.getClientRect(),k=e.ui.contentsElement.getDocumentPosition(),h,b,d=f.getClientRect(),c,n=this._notificationWidth,p=this._notificationMargin;c=CKEDITOR.document.getWindow();var q=c.getScrollPosition(),t=c.getViewPaneSize(),r=CKEDITOR.document.getBody(),v=r.getDocumentPosition(),y=CKEDITOR.tools.cssLength;n&&p||(c=this.element.getChild(0),n=this._notificationWidth=c.getClientRect().width,p=this._notificationMargin=parseInt(c.getComputedStyle("margin-left"),10)+parseInt(c.getComputedStyle("margin-right"),
|
|
663
|
+
10));e.toolbar&&(h=e.ui.space(e.config.toolbarLocation),b=h.getClientRect());h&&h.isVisible()&&b.bottom>l.top&&b.bottom<l.bottom-d.height?f.setStyles({position:"fixed",top:y(b.bottom)}):0<l.top?f.setStyles({position:"absolute",top:y(k.y)}):k.y+l.height-d.height>q.y?f.setStyles({position:"fixed",top:0}):f.setStyles({position:"absolute",top:y(k.y+l.height-d.height)});var x="fixed"==f.getStyle("position")?l.left:"static"!=r.getComputedStyle("position")?k.x-v.x:k.x;l.width<n+p?k.x+n+p>q.x+t.width?a():
|
|
664
|
+
f.setStyle("left",y(x)):k.x+n+p>q.x+t.width?f.setStyle("left",y(x)):k.x+l.width/2+n/2+p>q.x+t.width?f.setStyle("left",y(x-k.x+q.x+t.width-n-p)):0>l.left+l.width-n-p?a():0>l.left+l.width/2-n/2?f.setStyle("left",y(x-k.x+q.x)):f.setStyle("left",y(x+l.width/2-n/2-p/2))}};CKEDITOR.plugins.notification=a})();(function(){var a='\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"';
|
|
665
665
|
CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(a+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(a+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var l="";CKEDITOR.env.ie&&(l='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var a=a+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+l+'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"')+
|
|
666
|
-
'\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',
|
|
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,l){function k(){var c=a.mode;c&&(c=this.modes[c]?void 0!==
|
|
668
|
-
c,this.setState(c),this.refresh&&this.refresh())}var
|
|
669
|
-
(c=!1!==
|
|
670
|
-
"on":n.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");var z;if(this.directional)a.on("contentDirChanged",function(c){var b=CKEDITOR.document.getById(this._.id),d=b.getFirst();c=c.data;c!=a.lang.dir?b.addClass("cke_"+c):b.removeClass("cke_ltr").removeClass("cke_rtl");d.setAttribute("style",CKEDITOR.skin.getIconStyle(z,"rtl"==c,this.icon,this.iconOffset))},this);n?(
|
|
671
|
-
null,
|
|
672
|
-
"").replace("'",""),hasArrow:"string"===typeof this.hasArrow&&this.hasArrow||(this.hasArrow?"true":"false"),keydownFn:v,focusFn:y,clickFn:
|
|
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',g=CKEDITOR.addTemplate("buttonArrow",'\x3cspan class\x3d"cke_button_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":"")+"\x3c/span\x3e"),f=CKEDITOR.addTemplate("button",a);CKEDITOR.plugins.add("button",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON,
|
|
667
|
+
CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(f){f.execCommand(a.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}};CKEDITOR.ui.button.prototype={render:function(a,l){function k(){var c=a.mode;c&&(c=this.modes[c]?void 0!==h[c]?h[c]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,c=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:
|
|
668
|
+
c,this.setState(c),this.refresh&&this.refresh())}var h=null,b=CKEDITOR.env,d=this._.id=CKEDITOR.tools.getNextId(),c="",n=this.command,p,q,t;this._.editor=a;var r={id:d,button:this,editor:a,focus:function(){CKEDITOR.document.getById(d).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())}),y=CKEDITOR.tools.addFunction(function(a){var c;r.onfocus&&
|
|
669
|
+
(c=!1!==r.onfocus(r,new CKEDITOR.dom.event(a)));return c}),x=0;r.clickFn=p=CKEDITOR.tools.addFunction(function(){x&&(a.unlockSelection(1),x=0);r.execute();b.iOS&&a.focus()});this.modes?(h={},a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(h[a.mode]=this._.state)},this),a.on("activeFilterChange",k,this),a.on("mode",k,this),!this.readOnly&&a.on("readOnly",k,this)):n&&(n=a.getCommand(n))&&(n.on("state",function(){this.setState(n.state)},this),c+=n.state==CKEDITOR.TRISTATE_ON?
|
|
670
|
+
"on":n.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");var z;if(this.directional)a.on("contentDirChanged",function(c){var b=CKEDITOR.document.getById(this._.id),d=b.getFirst();c=c.data;c!=a.lang.dir?b.addClass("cke_"+c):b.removeClass("cke_ltr").removeClass("cke_rtl");d.setAttribute("style",CKEDITOR.skin.getIconStyle(z,"rtl"==c,this.icon,this.iconOffset))},this);n?(q=a.getCommandKeystroke(n))&&(t=CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard,q)):c+="off";q=this.name||this.command;var A=
|
|
671
|
+
null,w=this.icon;z=q;this.icon&&!/\./.test(this.icon)?(z=this.icon,w=null):(this.icon&&(A=this.icon),CKEDITOR.env.hidpi&&this.iconHiDpi&&(A=this.iconHiDpi));A?(CKEDITOR.skin.addIcon(A,A),w=null):A=z;c={id:d,name:q,iconName:z,label:this.label,cls:(this.hasArrow?"cke_button_expandable ":"")+(this.className||""),state:c,ariaDisabled:"disabled"==c?"true":"false",title:this.title+(t?" ("+t.display+")":""),ariaShortcut:t?a.lang.common.keyboardShortcut+" "+t.aria:"",titleJs:b.gecko&&!b.hc?"":(this.title||
|
|
672
|
+
"").replace("'",""),hasArrow:"string"===typeof this.hasArrow&&this.hasArrow||(this.hasArrow?"true":"false"),keydownFn:v,focusFn:y,clickFn:p,style:CKEDITOR.skin.getIconStyle(A,"rtl"==a.lang.dir,w,this.iconOffset),arrowHtml:this.hasArrow?g.output():""};f.output(c,l);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 c=
|
|
674
|
-
k(),b=CKEDITOR.tools.clone(a.config.toolbarGroups)||l(a),d=0;d<b.length;d++){var
|
|
675
|
-
1:a.order<c.order?-1:1});return c}function
|
|
674
|
+
k(),b=CKEDITOR.tools.clone(a.config.toolbarGroups)||l(a),d=0;d<b.length;d++){var g=b[d];if("/"!=g){"string"==typeof g&&(g=b[d]={name:g});var m,v=g.groups;if(v)for(var y=0;y<v.length;y++)m=v[y],(m=c[m])&&h(g,m);(m=c[g.name])&&h(g,m)}}return b}function k(){var c={},b,d,f;for(b in a.ui.items)d=a.ui.items[b],f=d.toolbar||"others",f=f.split(","),d=f[0],f=parseInt(f[1]||-1,10),c[d]||(c[d]=[]),c[d].push({name:b,order:f});for(d in c)c[d]=c[d].sort(function(a,c){return a.order==c.order?0:0>c.order?-1:0>a.order?
|
|
675
|
+
1:a.order<c.order?-1:1});return c}function h(c,b){if(b.length){c.items?c.items.push(a.ui.create("-")):c.items=[];for(var f;f=b.shift();)f="string"==typeof f?f:f.name,d&&-1!=CKEDITOR.tools.indexOf(d,f)||(f=a.ui.create(f))&&a.addFeature(f)&&c.items.push(f)}}function b(a){var c=[],b,d,e;for(b=0;b<a.length;++b)d=a[b],e={},"/"==d?c.push(d):CKEDITOR.tools.isArray(d)?(h(e,CKEDITOR.tools.clone(d)),c.push(e)):d.items&&(h(e,CKEDITOR.tools.clone(d.items)),e.name=d.name,c.push(e));return c}var d=a.config.removeButtons,
|
|
676
676
|
d=d&&d.split(","),c=a.config.toolbar;"string"==typeof c&&(c=a.config["toolbar_"+c]);return a.toolbar=c?b(c):f()}function l(a){return a._.toolbarGroups||(a._.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"forms"},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},
|
|
677
|
-
"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var
|
|
678
|
-
{requires:"button",init:function(e){var l,k=function(a,b){var d,c="rtl"==e.lang.dir,f=e.config.toolbarGroupCycling,
|
|
679
|
-
f&&(d=a.toolbar.items[0]);while(d&&!d.focus);d?d.focus():k(a,9);return!1;case 40:return a.button&&a.button.hasArrow?a.execute():k(a,40==b?
|
|
680
|
-
d=['\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,c,l;e.config.toolbarCanCollapse&&e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&d.push('\x3cspan class\x3d"cke_toolbox_main"'+(b?"\x3e":' style\x3d"display:none"\x3e'));for(var m=e.toolbox.toolbars,
|
|
681
|
-
|
|
682
|
-
if(!y){v=CKEDITOR.tools.getNextId();y={id:v,items:[]};
|
|
677
|
+
"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var g=function(){this.toolbars=[];this.focusCommandExecuted=!1};g.prototype.focus=function(){for(var a=0,f;f=this.toolbars[a++];)for(var k=0,h;h=f.items[k++];)if(h.focus){h.focus();return}};var f={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(a){a.toolbox&&(a.toolbox.focusCommandExecuted=!0,CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){a.toolbox.focus()},100):a.toolbox.focus())}};CKEDITOR.plugins.add("toolbar",
|
|
678
|
+
{requires:"button",init:function(e){var l,k=function(a,b){var d,c="rtl"==e.lang.dir,f=e.config.toolbarGroupCycling,g=c?37:39,c=c?39:37,f=void 0===f||f;switch(b){case 9:case CKEDITOR.SHIFT+9:for(;!d||!d.items.length;)if(d=9==b?(d?d.next:a.toolbar.next)||e.toolbox.toolbars[0]:(d?d.previous:a.toolbar.previous)||e.toolbox.toolbars[e.toolbox.toolbars.length-1],d.items.length)for(a=d.items[l?d.items.length-1:0];a&&!a.focus;)(a=l?a.previous:a.next)||(d=0);a&&a.focus();return!1;case g:d=a;do d=d.next,!d&&
|
|
679
|
+
f&&(d=a.toolbar.items[0]);while(d&&!d.focus);d?d.focus():k(a,9);return!1;case 40:return a.button&&a.button.hasArrow?a.execute():k(a,40==b?g:c),!1;case c:case 38:d=a;do d=d.previous,!d&&f&&(d=a.toolbar.items[a.toolbar.items.length-1]);while(d&&!d.focus);d?d.focus():(l=1,k(a,CKEDITOR.SHIFT+9),l=0);return!1;case 27:return e.focus(),!1;case 13:case 32:return a.execute(),!1}return!0};e.on("uiSpace",function(f){if(f.data.space==e.config.toolbarLocation){f.removeListener();e.toolbox=new g;var b=CKEDITOR.tools.getNextId(),
|
|
680
|
+
d=['\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,c,l;e.config.toolbarCanCollapse&&e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&d.push('\x3cspan class\x3d"cke_toolbox_main"'+(b?"\x3e":' style\x3d"display:none"\x3e'));for(var m=e.toolbox.toolbars,q=a(e),t=q.length,
|
|
681
|
+
r=0;r<t;r++){var v,y=0,x,z=q[r],A="/"!==z&&("/"===q[r+1]||r==t-1),w;if(z)if(c&&(d.push("\x3c/span\x3e"),l=c=0),"/"===z)d.push('\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e');else{w=z.items||z;for(var u=0;u<w.length;u++){var D=w[u],C;if(D){var B=function(a){a=a.render(e,d);G=y.items.push(a)-1;0<G&&(a.previous=y.items[G-1],a.previous.next=a);a.toolbar=y;a.onkey=k;a.onfocus=function(){e.toolbox.focusCommandExecuted||e.focus()}};if(D.type==CKEDITOR.UI_SEPARATOR)l=c&&D;else{C=!1!==D.canGroup;
|
|
682
|
+
if(!y){v=CKEDITOR.tools.getNextId();y={id:v,items:[]};x=z.name&&(e.lang.toolbar.toolbarGroups[z.name]||z.name);d.push('\x3cspan id\x3d"',v,'" class\x3d"cke_toolbar'+(A?' cke_toolbar_last"':'"'),x?' aria-labelledby\x3d"'+v+'_label"':"",' role\x3d"toolbar"\x3e');x&&d.push('\x3cspan id\x3d"',v,'_label" class\x3d"cke_voice_label"\x3e',x,"\x3c/span\x3e");d.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e');var G=m.push(y)-1;0<G&&(y.previous=m[G-1],y.previous.next=y)}C?c||(d.push('\x3cspan class\x3d"cke_toolgroup" role\x3d"presentation"\x3e'),
|
|
683
683
|
c=1):c&&(d.push("\x3c/span\x3e"),c=0);l&&(B(l),l=0);B(D)}}}c&&(d.push("\x3c/span\x3e"),l=c=0);y&&d.push('\x3cspan class\x3d"cke_toolbar_end"\x3e\x3c/span\x3e\x3c/span\x3e')}}e.config.toolbarCanCollapse&&d.push("\x3c/span\x3e");if(e.config.toolbarCanCollapse&&e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var K=CKEDITOR.tools.addFunction(function(){e.execCommand("toolbarCollapse")});e.on("destroy",function(){CKEDITOR.tools.removeFunction(K)});e.addCommand("toolbarCollapse",{readOnly:1,exec:function(a){var c=
|
|
684
|
-
a.ui.space("toolbar_collapser"),b=c.getPrevious(),d=a.ui.space("contents"),e=b.getParent(),f=parseInt(d.$.style.height,10),
|
|
684
|
+
a.ui.space("toolbar_collapser"),b=c.getPrevious(),d=a.ui.space("contents"),e=b.getParent(),f=parseInt(d.$.style.height,10),h=e.$.offsetHeight,k=c.hasClass("cke_toolbox_collapser_min");k?(b.show(),c.removeClass("cke_toolbox_collapser_min"),c.setAttribute("title",a.lang.toolbar.toolbarCollapse)):(b.hide(),c.addClass("cke_toolbox_collapser_min"),c.setAttribute("title",a.lang.toolbar.toolbarExpand));c.getFirst().setText(k?"▲":"◀");d.setStyle("height",f-(e.$.offsetHeight-h)+"px");a.fire("resize",{outerHeight:a.container.$.offsetHeight,
|
|
685
685
|
contentsHeight:d.$.offsetHeight,outerWidth:a.container.$.offsetWidth})},modes:{wysiwyg:1,source:1}});e.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?189:109),"toolbarCollapse");d.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||d.push(" cke_toolbox_collapser_min");d.push('" onclick\x3d"CKEDITOR.tools.callFunction('+K+')"\x3e','\x3cspan class\x3d"cke_arrow"\x3e\x26#9650;\x3c/span\x3e',
|
|
686
686
|
"\x3c/a\x3e")}d.push("\x3c/span\x3e");f.data.html+=d.join("")}});e.on("destroy",function(){if(this.toolbox){var a,b=0,d,c,e;for(a=this.toolbox.toolbars;b<a.length;b++)for(c=a[b].items,d=0;d<c.length;d++)e=c[d],e.clickFn&&CKEDITOR.tools.removeFunction(e.clickFn),e.keyDownFn&&CKEDITOR.tools.removeFunction(e.keyDownFn)}});e.on("uiReady",function(){var a=e.ui.space("toolbox");a&&e.focusManager.add(a,1)});e.addCommand("toolbarFocus",f);e.setKeystroke(CKEDITOR.ALT+121,"toolbarFocus");e.ui.add("-",CKEDITOR.UI_SEPARATOR,
|
|
687
|
-
{});e.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(a,b){b.push('\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e');return{}}}}})}});CKEDITOR.ui.prototype.addToolbarGroup=function(a,f,k){var
|
|
688
|
-
return}f=null}f&&(f=CKEDITOR.tools.indexOf(
|
|
689
|
-
return a.fire("paste",b)}function l(c){function b(){var a=c.editable();if(CKEDITOR.plugins.clipboard.isCustomCopyCutSupported){var d=function(a){c.getSelection().isCollapsed()||(c.readOnly&&"cut"==a.name||C.initPasteDataTransfer(a,c),a.data.preventDefault())};a.on("copy",d);a.on("cut",d);a.on("cut",function(){c.readOnly||c.extractSelectedHtml()},null,null,999)}a.on(C.mainPasteEvent,function(a){"beforepaste"==C.mainPasteEvent&&B||
|
|
690
|
-
(f(),a.data.preventDefault(),
|
|
691
|
-
67,exec:function(){"cut"==this.type&&
|
|
692
|
-
c._.forcePasteDialog=!1;c.fire("afterCommandExec",{name:"paste",command:e,returnValue:!!b})}b="undefined"!==typeof b&&null!==b?b:{};var e=this,f="undefined"!==typeof b.notification?b.notification:!0,
|
|
693
|
-
"allow-word"!==c.config.forcePasteAsPlainText?c._.nextPasteType=
|
|
694
|
-
c.getSelection(),b,d,e;a.getType()==CKEDITOR.SELECTION_ELEMENT&&(b=a.getSelectedElement())&&(d=a.getRanges()[0],e=c.document.createText(""),e.insertBefore(b),d.setStartBefore(e),d.setEndAfter(b),a.selectRanges([d]),setTimeout(function(){b.getParent()&&(e.remove(),a.selectElement(b))},0))}}function l(a,b){var d=c.document,e=c.editable(),f=function(a){a.cancel()},
|
|
687
|
+
{});e.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(a,b){b.push('\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e');return{}}}}})}});CKEDITOR.ui.prototype.addToolbarGroup=function(a,f,k){var h=l(this.editor),b=0===f,d={name:a};if(k){if(k=CKEDITOR.tools.search(h,function(a){return a.name==k})){!k.groups&&(k.groups=[]);if(f&&(f=CKEDITOR.tools.indexOf(k.groups,f),0<=f)){k.groups.splice(f+1,0,a);return}b?k.groups.splice(0,0,a):k.groups.push(a);
|
|
688
|
+
return}f=null}f&&(f=CKEDITOR.tools.indexOf(h,function(a){return a.name==f}));b?h.splice(0,0,a):"number"==typeof f?h.splice(f+1,0,d):h.push(a)}})();CKEDITOR.UI_SEPARATOR="separator";CKEDITOR.config.toolbarLocation="top";"use strict";(function(){function a(a,b,d){b.type||(b.type="auto");if(d&&!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(c){function b(){var a=c.editable();if(CKEDITOR.plugins.clipboard.isCustomCopyCutSupported){var d=function(a){c.getSelection().isCollapsed()||(c.readOnly&&"cut"==a.name||C.initPasteDataTransfer(a,c),a.data.preventDefault())};a.on("copy",d);a.on("cut",d);a.on("cut",function(){c.readOnly||c.extractSelectedHtml()},null,null,999)}a.on(C.mainPasteEvent,function(a){"beforepaste"==C.mainPasteEvent&&B||w(a)});"beforepaste"==C.mainPasteEvent&&(a.on("paste",function(a){G||
|
|
690
|
+
(f(),a.data.preventDefault(),w(a),k("paste"))}),a.on("contextmenu",h,null,null,0),a.on("beforepaste",function(a){!a.data||a.data.$.ctrlKey||a.data.$.shiftKey||h()},null,null,0));a.on("beforecut",function(){!B&&g(c)});var e;a.attachListener(CKEDITOR.env.ie?a:c.document.getDocumentElement(),"mouseup",function(){e=setTimeout(u,0)});c.on("destroy",function(){clearTimeout(e)});a.on("keyup",u)}function d(a){return{type:a,canUndo:"cut"==a,startDisabled:!0,fakeKeystroke:"cut"==a?CKEDITOR.CTRL+88:CKEDITOR.CTRL+
|
|
691
|
+
67,exec:function(){"cut"==this.type&&g();var a;var b=this.type;if(CKEDITOR.env.ie)a=k(b);else try{a=c.document.$.execCommand(b,!1,null)}catch(d){a=!1}a||c.showNotification(c.lang.clipboard[this.type+"Error"]);return a}}}function e(){return{canUndo:!1,async:!0,fakeKeystroke:CKEDITOR.CTRL+86,exec:function(c,b){function d(b,h){h="undefined"!==typeof h?h:!0;b?(b.method="paste",b.dataTransfer||(b.dataTransfer=C.initPasteDataTransfer()),a(c,b,h)):f&&!c._.forcePasteDialog&&c.showNotification(g,"info",c.config.clipboard_notificationDuration);
|
|
692
|
+
c._.forcePasteDialog=!1;c.fire("afterCommandExec",{name:"paste",command:e,returnValue:!!b})}b="undefined"!==typeof b&&null!==b?b:{};var e=this,f="undefined"!==typeof b.notification?b.notification:!0,h=b.type,k=CKEDITOR.tools.keystrokeToString(c.lang.common.keyboard,c.getCommandKeystroke(this)),g="string"===typeof f?f:c.lang.clipboard.pasteNotification.replace(/%1/,'\x3ckbd aria-label\x3d"'+k.aria+'"\x3e'+k.display+"\x3c/kbd\x3e"),k="string"===typeof b?b:b.dataValue;h&&!0!==c.config.forcePasteAsPlainText&&
|
|
693
|
+
"allow-word"!==c.config.forcePasteAsPlainText?c._.nextPasteType=h:delete c._.nextPasteType;"string"===typeof k?d({dataValue:k}):c.getClipboardData(d)}}}function f(){G=1;setTimeout(function(){G=0},100)}function h(){B=1;setTimeout(function(){B=0},10)}function k(a){var b=c.document,d=b.getBody(),e=!1,f=function(){e=!0};d.on(a,f);7<CKEDITOR.env.version?b.$.execCommand(a):b.$.selection.createRange().execCommand(a);d.removeListener(a,f);return e}function g(){if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var a=
|
|
694
|
+
c.getSelection(),b,d,e;a.getType()==CKEDITOR.SELECTION_ELEMENT&&(b=a.getSelectedElement())&&(d=a.getRanges()[0],e=c.document.createText(""),e.insertBefore(b),d.setStartBefore(e),d.setEndAfter(b),a.selectRanges([d]),setTimeout(function(){b.getParent()&&(e.remove(),a.selectElement(b))},0))}}function l(a,b){var d=c.document,e=c.editable(),f=function(a){a.cancel()},h;if(!d.getById("cke_pastebin")){var k=c.getSelection(),g=k.createBookmarks();CKEDITOR.env.ie&&k.root.fire("selectionchange");var m=new CKEDITOR.dom.element(!CKEDITOR.env.webkit&&
|
|
695
695
|
!e.is("body")||CKEDITOR.env.ie?"div":"body",d);m.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var n=0,d=d.getWindow();CKEDITOR.env.webkit?(e.append(m),m.addClass("cke_editable"),e.is("body")||(n="static"!=e.getComputedStyle("position")?e:CKEDITOR.dom.element.get(e.$.offsetParent),n=n.getDocumentPosition().y)):e.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(m);m.setStyles({position:"absolute",top:d.getScrollPosition().y-n+10+"px",width:"1px",height:Math.max(1,d.getViewPaneSize().height-
|
|
696
|
-
20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&m.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text"));(n=m.getParent().isReadOnly())?(m.setOpacity(0),m.setAttribute("contenteditable",!0)):m.setStyle("ltr"==c.config.contentsLangDirection?"left":"right","-10000px");c.on("selectionChange",f,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)
|
|
697
|
-
(
|
|
698
|
-
method:"paste"}),!1;c.focus();f();var a=c.focusManager;a.lock();if(c.editable().fire(C.mainPasteEvent)&&!k("paste"))return a.unlock(),!1;a.unlock();return!0}function A(a){if("wysiwyg"==c.mode)switch(a.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:a=c.editable();f();"paste"==C.mainPasteEvent&&a.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:c.fire("saveSnapshot"),setTimeout(function(){c.fire("saveSnapshot")},50)}}function
|
|
699
|
-
dataTransfer:C.initPasteDataTransfer(b)};d.dataTransfer.cacheData();var e=!1!==c.fire("beforePaste",d);e&&C.canClipboardApiBeTrusted(d.dataTransfer,c)?(b.data.preventDefault(),setTimeout(function(){a(c,d)},0)):l(b,function(b){d.dataValue=b.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");e&&a(c,d)})}function
|
|
700
|
-
c.getSelection(),b=b&&b.getRanges()[0];if((c.readOnly||b&&b.checkReadOnly())&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;a=c.getSelection();b=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==b.length&&b[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var C=CKEDITOR.plugins.clipboard,B=0,G=0;(function(){c.on("key",A);c.on("contentDom",b);c.on("selectionChange",
|
|
696
|
+
20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&m.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text"));(n=m.getParent().isReadOnly())?(m.setOpacity(0),m.setAttribute("contenteditable",!0)):m.setStyle("ltr"==c.config.contentsLangDirection?"left":"right","-10000px");c.on("selectionChange",f,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)h=e.once("blur",f,null,null,-100);n&&m.focus();n=new CKEDITOR.dom.range(m);n.selectNodeContents(m);var u=n.select();CKEDITOR.env.ie&&
|
|
697
|
+
(h=e.once("blur",function(){c.lockSelection(u)}));var x=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=x);h&&h.removeListener();CKEDITOR.env.ie&&e.focus();k.selectBookmarks(g);m.remove();var a;CKEDITOR.env.webkit&&(a=m.getFirst())&&a.is&&a.hasClass("Apple-style-span")&&(m=a);c.removeListener("selectionChange",f);b(m.getHtml())},0)}}function m(){if("paste"==C.mainPasteEvent)return c.fire("beforePaste",{type:"auto",
|
|
698
|
+
method:"paste"}),!1;c.focus();f();var a=c.focusManager;a.lock();if(c.editable().fire(C.mainPasteEvent)&&!k("paste"))return a.unlock(),!1;a.unlock();return!0}function A(a){if("wysiwyg"==c.mode)switch(a.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:a=c.editable();f();"paste"==C.mainPasteEvent&&a.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:c.fire("saveSnapshot"),setTimeout(function(){c.fire("saveSnapshot")},50)}}function w(b){var d={type:"auto",method:"paste",
|
|
699
|
+
dataTransfer:C.initPasteDataTransfer(b)};d.dataTransfer.cacheData();var e=!1!==c.fire("beforePaste",d);e&&C.canClipboardApiBeTrusted(d.dataTransfer,c)?(b.data.preventDefault(),setTimeout(function(){a(c,d)},0)):l(b,function(b){d.dataValue=b.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");e&&a(c,d)})}function u(){if("wysiwyg"==c.mode){var a=D("paste");c.getCommand("cut").setState(D("cut"));c.getCommand("copy").setState(D("copy"));c.getCommand("paste").setState(a);c.fire("pasteState",a)}}function D(a){var b=
|
|
700
|
+
c.getSelection(),b=b&&b.getRanges()[0];if((c.readOnly||b&&b.checkReadOnly())&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;a=c.getSelection();b=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==b.length&&b[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var C=CKEDITOR.plugins.clipboard,B=0,G=0;(function(){c.on("key",A);c.on("contentDom",b);c.on("selectionChange",u);if(c.contextMenu){c.contextMenu.addListener(function(){return{cut:D("cut"),
|
|
701
701
|
copy:D("copy"),paste:D("paste")}});var a=null;c.on("menuShow",function(){a&&(a.removeListener(),a=null);var b=c.contextMenu.findItemByCommandName("paste");b&&b.element&&(a=b.element.on("touchend",function(){c._.forcePasteDialog=!0}))})}if(c.ui.addButton)c.once("instanceReady",function(){c._.pasteButtons&&CKEDITOR.tools.array.forEach(c._.pasteButtons,function(a){if(a=c.ui.get(a))if(a=CKEDITOR.document.getById(a._.id))a.on("touchend",function(){c._.forcePasteDialog=!0})})})})();(function(){function a(b,
|
|
702
|
-
d,e,f,
|
|
703
|
-
b({type:
|
|
702
|
+
d,e,f,h){var k=c.lang.clipboard[d];c.addCommand(d,e);c.ui.addButton&&c.ui.addButton(b,{label:k,command:d,toolbar:"clipboard,"+f});c.addMenuItems&&c.addMenuItem(d,{label:k,command:d,group:"clipboard",order:h})}a("Cut","cut",d("cut"),10,1);a("Copy","copy",d("copy"),20,4);a("Paste","paste",e(),30,8);c._.pasteButtons||(c._.pasteButtons=[]);c._.pasteButtons.push("Paste")})();c.getClipboardData=function(a,b){function d(a){a.removeListener();a.cancel();b(a.data)}function e(a){a.removeListener();a.cancel();
|
|
703
|
+
b({type:h,dataValue:a.data.dataValue,dataTransfer:a.data.dataTransfer,method:"paste"})}var f=!1,h="auto";b||(b=a,a=null);c.on("beforePaste",function(a){a.removeListener();f=!0;h=a.data.type},null,null,1E3);c.on("paste",d,null,null,0);!1===m()&&(c.removeListener("paste",d),c._.forcePasteDialog&&f&&c.fire("pasteDialog")?(c.on("pasteDialogCommit",e),c.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",e);a.data._.committed||b(null)})):b(null))}}function g(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 d(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 d(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 d(a.length/4)})+"\x3c/p\x3e"));return k(a,b)}function e(a){function b(){var a={},c;for(c in CKEDITOR.dtd)"$"!=c.charAt(0)&&"div"!=c&&"span"!=c&&(a[c]=1);return a}var d={};return{get:function(e){return"plain-text"==e?d.plainText||(d.plainText=new CKEDITOR.filter(a,
|
|
707
707
|
"br")):"semantic-content"==e?((e=d.semanticContent)||(e=new CKEDITOR.filter(a,{}),e.allow({$1:{elements:b(),attributes:!0,styles:!1,classes:!1}}),e=d.semanticContent=e),e):e?new CKEDITOR.filter(a,e):null}}}function m(a,b,d){b=CKEDITOR.htmlParser.fragment.fromHtml(b);var e=new CKEDITOR.htmlParser.basicWriter;d.applyTo(b,!0,!1,a.activeEnterMode);b.writeHtml(e);return e.getHtml()}function k(a,b){a.enterMode==CKEDITOR.ENTER_BR?b=b.replace(/(<\/p><p>)+/g,function(a){return CKEDITOR.tools.repeat("\x3cbr\x3e",
|
|
708
|
-
a.length/7*2)}).replace(/<\/?p>/g,""):a.enterMode==CKEDITOR.ENTER_DIV&&(b=b.replace(/<(\/)?p>/g,"\x3c$1div\x3e"));return b}function
|
|
709
|
-
function e(d,f){d.select();a(c,{dataTransfer:f,method:"drop"},1);b.resetDragDataTransfer()}function f(a,b,d){var e={$:a.data.$,target:a.data.getTarget()};b&&(e.dragRange=b);d&&(e.dropRange=d);!1===c.fire(a.name,e)&&a.data.preventDefault()}function
|
|
710
|
-
k.attachListener(
|
|
711
|
-
b.initDragDataTransfer,b,null,1);k.attachListener(c,"dragend",b.resetDragDataTransfer,b,null,100);k.attachListener(
|
|
712
|
-
a.data.getTarget();if(!d.isReadOnly()||d.type==CKEDITOR.NODE_ELEMENT&&d.is("html")){var d=b.getRangeAtDropPosition(a,c),e=b.dragRange;d&&f(a,e,d)}}},null,null,9999);k.attachListener(c,"drop",b.initDragDataTransfer,b,null,1);k.attachListener(c,"drop",function(a){if(a=a.data){var f=a.dropRange,
|
|
713
|
-
null,null,9999)})}var d;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",init:function(a){function d(a){if(!a||
|
|
714
|
-
if(CKEDITOR.env.gecko){var
|
|
715
|
-
|
|
708
|
+
a.length/7*2)}).replace(/<\/?p>/g,""):a.enterMode==CKEDITOR.ENTER_DIV&&(b=b.replace(/<(\/)?p>/g,"\x3c$1div\x3e"));return b}function h(a){a.data.preventDefault();a.data.$.dataTransfer.dropEffect="none"}function b(c){var b=CKEDITOR.plugins.clipboard;c.on("contentDom",function(){function d(b,e,f){e.select();a(c,{dataTransfer:f,method:"drop"},1);f.sourceEditor.fire("saveSnapshot");f.sourceEditor.editable().extractHtmlFromRange(b);f.sourceEditor.getSelection().selectRanges([b]);f.sourceEditor.fire("saveSnapshot")}
|
|
709
|
+
function e(d,f){d.select();a(c,{dataTransfer:f,method:"drop"},1);b.resetDragDataTransfer()}function f(a,b,d){var e={$:a.data.$,target:a.data.getTarget()};b&&(e.dragRange=b);d&&(e.dropRange=d);!1===c.fire(a.name,e)&&a.data.preventDefault()}function h(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());return a.getChildCount()}var k=c.editable(),g=CKEDITOR.plugins.clipboard.getDropTarget(c),l=c.ui.space("top"),m=c.ui.space("bottom");b.preventDefaultDropOnElement(l);b.preventDefaultDropOnElement(m);
|
|
710
|
+
k.attachListener(g,"dragstart",f);k.attachListener(c,"dragstart",b.resetDragDataTransfer,b,null,1);k.attachListener(c,"dragstart",function(a){b.initDragDataTransfer(a,c)},null,null,2);k.attachListener(c,"dragstart",function(){var a=b.dragRange=c.getSelection().getRanges()[0];CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(b.dragStartContainerChildCount=a?h(a.startContainer):null,b.dragEndContainerChildCount=a?h(a.endContainer):null)},null,null,100);k.attachListener(g,"dragend",f);k.attachListener(c,"dragend",
|
|
711
|
+
b.initDragDataTransfer,b,null,1);k.attachListener(c,"dragend",b.resetDragDataTransfer,b,null,100);k.attachListener(g,"dragover",function(a){if(CKEDITOR.env.edge)a.data.preventDefault();else{var c=a.data.getTarget();c&&c.is&&c.is("html")?a.data.preventDefault():CKEDITOR.env.ie&&CKEDITOR.plugins.clipboard.isFileApiSupported&&a.data.$.dataTransfer.types.contains("Files")&&a.data.preventDefault()}});k.attachListener(g,"drop",function(a){if(!a.data.$.defaultPrevented&&(a.data.preventDefault(),!c.readOnly)){var d=
|
|
712
|
+
a.data.getTarget();if(!d.isReadOnly()||d.type==CKEDITOR.NODE_ELEMENT&&d.is("html")){var d=b.getRangeAtDropPosition(a,c),e=b.dragRange;d&&f(a,e,d)}}},null,null,9999);k.attachListener(c,"drop",b.initDragDataTransfer,b,null,1);k.attachListener(c,"drop",function(a){if(a=a.data){var f=a.dropRange,h=a.dragRange,k=a.dataTransfer;k.getTransferType(c)==CKEDITOR.DATA_TRANSFER_INTERNAL?setTimeout(function(){b.internalDrop(h,f,k,c)},0):k.getTransferType(c)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?d(h,f,k):e(f,k)}},
|
|
713
|
+
null,null,9999)})}var d;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",init:function(a){function d(a){if(!a||r===a.id)return!1;var c=a.getTypes(),c=1===c.length&&"Files"===c[0];a=1===a.getFilesCount();return c&&a}var h,k=e(a);a.config.forcePasteAsPlainText?h="plain-text":a.config.pasteFilter?h=a.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in a.config||(h="semantic-content");a.pasteFilter=k.get(h);l(a);b(a);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));
|
|
714
|
+
if(CKEDITOR.env.gecko){var t=["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&&d(f)&&(f=f.getFile(0),-1!=CKEDITOR.tools.indexOf(t,f.type))){var h=new FileReader;h.addEventListener("load",function(){b.data.dataValue='\x3cimg src\x3d"'+h.result+'" /\x3e';a.fire("paste",b.data)},!1);h.addEventListener("abort",function(){a.fire("paste",b.data)},!1);h.addEventListener("error",function(){a.fire("paste",b.data)},!1);h.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 d=b.data.dataTransfer,e=d.getData("text/html");if(e)b.data.dataValue=e,b.data.type="html";else if(e=d.getData("text/plain"))b.data.dataValue=a.editable().transformPlainTextToHtml(e),b.data.type="text"}},null,null,1);a.on("paste",function(a){var c=a.data.dataValue,b=CKEDITOR.dtd.$block;-1<c.indexOf("Apple-")&&(c=c.replace(/<span class="Apple-converted-space"> <\/span>/gi,
|
|
716
716
|
" "),"html"!=a.data.type&&(c=c.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(a,c){return c.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;")})),-1<c.indexOf('\x3cbr class\x3d"Apple-interchange-newline"\x3e')&&(a.data.startsWithEOL=1,a.data.preSniffing="html",c=c.replace(/<br class="Apple-interchange-newline">/,"")),c=c.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(c.match(/^<[^<]+cke_(editable|contents)/i)){var d,e,f=new CKEDITOR.dom.element("div");for(f.setHtml(c);1==f.getChildCount()&&
|
|
717
717
|
(d=f.getFirst())&&d.type==CKEDITOR.NODE_ELEMENT&&(d.hasClass("cke_editable")||d.hasClass("cke_contents"));)f=e=d;e&&(c=e.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?c=c.replace(/^ (?: |\r\n)?<(\w+)/g,function(c,d){return d.toLowerCase()in b?(a.data.preSniffing="html","\x3c"+d):c}):CKEDITOR.env.webkit?c=c.replace(/<\/(\w+)><div><br><\/div>$/,function(c,d){return d in b?(a.data.endsWithEOL=1,"\x3c/"+d+"\x3e"):c}):CKEDITOR.env.gecko&&(c=c.replace(/(\s)<br>$/,"$1"));a.data.dataValue=c},null,
|
|
718
|
-
null,3);a.on("paste",function(b){b=b.data;var d=a._.nextPasteType||b.type,e=b.dataValue,
|
|
719
|
-
e);b.endsWithEOL&&(e+='\x3cbr data-cke-eol\x3d"1"\x3e');"auto"==d&&(d="html"==
|
|
718
|
+
null,3);a.on("paste",function(b){b=b.data;var d=a._.nextPasteType||b.type,e=b.dataValue,h,l=a.config.clipboard_defaultContentType||"html",n=b.dataTransfer.getTransferType(a)==CKEDITOR.DATA_TRANSFER_EXTERNAL,u=!0===a.config.forcePasteAsPlainText;h="html"==d||"html"==b.preSniffing?"html":g(e);delete a._.nextPasteType;"htmlifiedtext"==h&&(e=f(a.config,e));if("text"==d&&"html"==h)e=m(a,e,k.get("plain-text"));else if(n&&a.pasteFilter&&!b.dontFilter||u)e=m(a,e,a.pasteFilter);b.startsWithEOL&&(e='\x3cbr data-cke-eol\x3d"1"\x3e'+
|
|
719
|
+
e);b.endsWithEOL&&(e+='\x3cbr data-cke-eol\x3d"1"\x3e');"auto"==d&&(d="html"==h||"html"==l?"html":"text");b.type=d;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,d){a.ui.addButton&&(a.ui.addButton(b,d),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,d,e){function f(a,c,d){var e=a;e.type==CKEDITOR.NODE_TEXT&&(e=a.getParent());if(e.equals(c)&&
|
|
722
|
-
d!=c.getChildCount())return a=b.startContainer.getChild(b.startOffset-1),c=b.startContainer.getChild(b.startOffset),a&&a.type==CKEDITOR.NODE_TEXT&&c&&c.type==CKEDITOR.NODE_TEXT&&(d=a.getLength(),a.setText(a.getText()+c.getText()),c.remove(),b.setStart(a,d),b.collapse(!0)),!0}var
|
|
723
|
-
return a.endContainer.equals(d)&&a.endOffset<=e||a.startContainer.getParent().equals(d)&&a.startContainer.getIndex()<e||a.endContainer.getParent().equals(d)&&a.endContainer.getIndex()<e?!0:!1},internalDrop:function(c,b,d,e){var f=CKEDITOR.plugins.clipboard,
|
|
724
|
-
b))||(k=c.createBookmark(!1));f=b.clone().createBookmark(!1);
|
|
725
|
-
b){var d=a.data.$,e=d.clientX,f=d.clientY,
|
|
726
|
-
if(document.body.createTextRange){b.focus();d=b.document.getBody().$.createTextRange();try{for(var
|
|
727
|
-
"html"==C.getName())return
|
|
722
|
+
d!=c.getChildCount())return a=b.startContainer.getChild(b.startOffset-1),c=b.startContainer.getChild(b.startOffset),a&&a.type==CKEDITOR.NODE_TEXT&&c&&c.type==CKEDITOR.NODE_TEXT&&(d=a.getLength(),a.setText(a.getText()+c.getText()),c.remove(),b.setStart(a,d),b.collapse(!0)),!0}var h=b.startContainer;"number"==typeof e&&"number"==typeof d&&h.type==CKEDITOR.NODE_ELEMENT&&(f(a.startContainer,h,d)||f(a.endContainer,h,e))},isDropRangeAffectedByDragRange:function(a,b){var d=b.startContainer,e=b.endOffset;
|
|
723
|
+
return a.endContainer.equals(d)&&a.endOffset<=e||a.startContainer.getParent().equals(d)&&a.startContainer.getIndex()<e||a.endContainer.getParent().equals(d)&&a.endContainer.getIndex()<e?!0:!1},internalDrop:function(c,b,d,e){var f=CKEDITOR.plugins.clipboard,h=e.editable(),k,g;e.fire("saveSnapshot");e.fire("lockSnapshot",{dontUpdate:1});CKEDITOR.env.ie&&10>CKEDITOR.env.version&&this.fixSplitNodesAfterDrop(c,b,f.dragStartContainerChildCount,f.dragEndContainerChildCount);(g=this.isDropRangeAffectedByDragRange(c,
|
|
724
|
+
b))||(k=c.createBookmark(!1));f=b.clone().createBookmark(!1);g&&(k=c.createBookmark(!1));c=k.startNode;b=k.endNode;g=f.startNode;b&&c.getPosition(g)&CKEDITOR.POSITION_PRECEDING&&b.getPosition(g)&CKEDITOR.POSITION_FOLLOWING&&g.insertBefore(c);c=e.createRange();c.moveToBookmark(k);h.extractHtmlFromRange(c,1);b=e.createRange();f.startNode.getCommonAncestor(h)||(f=e.getSelection().createBookmarks()[0]);b.moveToBookmark(f);a(e,{dataTransfer:d,method:"drop",range:b},1);e.fire("unlockSnapshot")},getRangeAtDropPosition:function(a,
|
|
725
|
+
b){var d=a.data.$,e=d.clientX,f=d.clientY,h=b.getSelection(!0).getRanges()[0],k=b.createRange();if(a.data.testRange)return a.data.testRange;if(document.caretRangeFromPoint&&b.document.$.caretRangeFromPoint(e,f))d=b.document.$.caretRangeFromPoint(e,f),k.setStart(CKEDITOR.dom.node(d.startContainer),d.startOffset),k.collapse(!0);else if(d.rangeParent)k.setStart(CKEDITOR.dom.node(d.rangeParent),d.rangeOffset),k.collapse(!0);else{if(CKEDITOR.env.ie&&8<CKEDITOR.env.version&&h&&b.editable().hasFocus)return h;
|
|
726
|
+
if(document.body.createTextRange){b.focus();d=b.document.getBody().$.createTextRange();try{for(var g=!1,l=0;20>l&&!g;l++){if(!g)try{d.moveToPoint(e,f-l),g=!0}catch(m){}if(!g)try{d.moveToPoint(e,f+l),g=!0}catch(A){}}if(g){var w="cke-temp-"+(new Date).getTime();d.pasteHTML('\x3cspan id\x3d"'+w+'"\x3e\x3c/span\x3e');var u=b.document.getById(w);k.moveToPosition(u,CKEDITOR.POSITION_BEFORE_START);u.remove()}else{var D=b.document.$.elementFromPoint(e,f),C=new CKEDITOR.dom.element(D),B;if(C.equals(b.editable())||
|
|
727
|
+
"html"==C.getName())return h&&h.startContainer&&!h.startContainer.equals(b.editable())?h:null;B=C.getClientRect();e<B.left?k.setStartAt(C,CKEDITOR.POSITION_AFTER_START):k.setStartAt(C,CKEDITOR.POSITION_BEFORE_END);k.collapse(!0)}}catch(G){return null}}else return null}return k},initDragDataTransfer:function(a,b){var d=a.data.$?a.data.$.dataTransfer:null,e=new this.dataTransfer(d,b);"dragstart"===a.name&&e.storeId();d?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 d=a.data.$.clipboardData,e=new this.dataTransfer(d,b);"copy"!==a.name&&"cut"!==a.name||e.storeId();this.copyCutData&&e.id==this.copyCutData.id?(e=this.copyCutData,e.$=d):this.copyCutData=e;return e}return new this.dataTransfer(null,b)}return new this.dataTransfer(CKEDITOR.env.edge&&a&&a.data.$&&
|
|
729
|
-
a.data.$.clipboardData||null,b)},preventDefaultDropOnElement:function(a){a&&a.on("dragover",
|
|
729
|
+
a.data.$.clipboardData||null,b)},preventDefaultDropOnElement:function(a){a&&a.on("dragover",h)}};d=CKEDITOR.plugins.clipboard.isCustomDataTypesSupported?"cke/id":"Text";CKEDITOR.plugins.clipboard.dataTransfer=function(a,b){a&&(this.$=a);this._={metaRegExp:/^<meta.*?>/i,bodyRegExp:/<body(?:[\s\S]*?)>([\s\S]*)<\/body>/i,fragmentRegExp:/\s*\x3c!--StartFragment--\x3e|\x3c!--EndFragment--\x3e\s*/g,data:{},files:[],nativeHtmlCache:"",normalizeType:function(a){a=a.toLowerCase();return"text"==a||"text/plain"==
|
|
730
730
|
a?"Text":"url"==a?"URL":a}};this._.fallbackDataTransfer=new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this);this.id=this.getData(d);this.id||(this.id="Text"==d?"":"cke-"+CKEDITOR.tools.getUniqueId());b&&(this.sourceEditor=b,this.setData("text/html",b.getSelectedHtml(1)),"Text"==d||this.getData("text/plain")||this.setData("text/plain",b.getSelection().getSelectedText()))};CKEDITOR.DATA_TRANSFER_INTERNAL=1;CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2;CKEDITOR.DATA_TRANSFER_EXTERNAL=3;CKEDITOR.plugins.clipboard.dataTransfer.prototype=
|
|
731
731
|
{getData:function(a,b){a=this._.normalizeType(a);var d="text/html"==a&&b?this._.nativeHtmlCache:this._.data[a];if(void 0===d||null===d||""===d){if(this._.fallbackDataTransfer.isRequired())d=this._.fallbackDataTransfer.getData(a,b);else try{d=this.$.getData(a)||""}catch(e){d=""}"text/html"!=a||b||(d=this._stripHtml(d))}"Text"==a&&CKEDITOR.env.gecko&&this.getFilesCount()&&"file://"==d.substring(0,7)&&(d="");if("string"===typeof d)var f=d.indexOf("\x3c/html\x3e"),d=-1!==f?d.substring(0,f+7):d;return d},
|
|
732
732
|
setData:function(a,b){a=this._.normalizeType(a);"text/html"==a?(this._.data[a]=this._stripHtml(b),this._.nativeHtmlCache=b):this._.data[a]=b;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||"URL"==a||"Text"==a)if("Text"==d&&"Text"==a&&(this.id=b),this._.fallbackDataTransfer.isRequired())this._.fallbackDataTransfer.setData(a,b);else try{this.$.setData(a,b)}catch(e){}},storeId:function(){"Text"!==d&&this.setData(d,this.id)},getTransferType:function(a){return this.sourceEditor?this.sourceEditor==
|
|
@@ -735,416 +735,419 @@ e){this._.files=[];if(this.$.files&&this.$.files.length)for(d=0;d<this.$.files.l
|
|
|
735
735
|
void 0},isEmpty:function(){var a={},b;if(this.getFilesCount())return!1;CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(this._.data),function(b){a[b]=1});if(this.$)if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(var e=0;e<this.$.types.length;e++)a[this.$.types[e]]=1}else a.Text=1,a.URL=1;"Text"!=d&&(a[d]=0);for(b in a)if(a[b]&&""!==this.getData(b))return!1;return!0},getTypes:function(){return this.$&&this.$.types?[].slice.call(this.$.types):[]},_getImageFromClipboard:function(){var a;
|
|
736
736
|
try{if(this.$&&this.$.items&&this.$.items[0]&&(a=this.$.items[0].getAsFile())&&a.type)return a}catch(b){}},_stripHtml:function(a){if(a&&a.length){a=a.replace(this._.metaRegExp,"");var b=this._.bodyRegExp.exec(a);b&&b.length&&(a=b[1],a=a.replace(this._.fragmentRegExp,""))}return a}};CKEDITOR.plugins.clipboard.fallbackDataTransfer=function(a){this._dataTransfer=a;this._customDataFallbackType="text/html"};CKEDITOR.plugins.clipboard.fallbackDataTransfer._isCustomMimeTypeSupported=null;CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes=
|
|
737
737
|
[];CKEDITOR.plugins.clipboard.fallbackDataTransfer.prototype={isRequired:function(){var a=CKEDITOR.plugins.clipboard.fallbackDataTransfer,b=this._dataTransfer.$;if(null===a._isCustomMimeTypeSupported)if(b){a._isCustomMimeTypeSupported=!1;if(CKEDITOR.env.edge&&17<=CKEDITOR.env.version)return!0;try{b.setData("cke/mimetypetest","cke test value"),a._isCustomMimeTypeSupported="cke test value"===b.getData("cke/mimetypetest"),b.clearData("cke/mimetypetest")}catch(d){}}else return!1;return!a._isCustomMimeTypeSupported},
|
|
738
|
-
getData:function(a,b){var d=this._getData(this._customDataFallbackType,!0);if(b)return d;var d=this._extractDataComment(d),e=null,e=a===this._customDataFallbackType?d.content:d.data&&d.data[a]?d.data[a]:this._getData(a,!0);return null!==e?e:""},setData:function(a,b){var d=a===this._customDataFallbackType;d&&(b=this._applyDataComment(b,this._getFallbackTypeData()));var e=b,f=this._dataTransfer.$;try{f.setData(a,e),d&&(this._dataTransfer._.nativeHtmlCache=e)}catch(
|
|
739
|
-
CKEDITOR.plugins.clipboard.fallbackDataTransfer;-1===CKEDITOR.tools.indexOf(d._customTypes,a)&&d._customTypes.push(a);var d=this._getFallbackTypeContent(),k=this._getFallbackTypeData();k[a]=e;try{e=this._applyDataComment(d,k),f.setData(this._customDataFallbackType,e),this._dataTransfer._.nativeHtmlCache=e}catch(
|
|
738
|
+
getData:function(a,b){var d=this._getData(this._customDataFallbackType,!0);if(b)return d;var d=this._extractDataComment(d),e=null,e=a===this._customDataFallbackType?d.content:d.data&&d.data[a]?d.data[a]:this._getData(a,!0);return null!==e?e:""},setData:function(a,b){var d=a===this._customDataFallbackType;d&&(b=this._applyDataComment(b,this._getFallbackTypeData()));var e=b,f=this._dataTransfer.$;try{f.setData(a,e),d&&(this._dataTransfer._.nativeHtmlCache=e)}catch(h){if(this._isUnsupportedMimeTypeError(h)){d=
|
|
739
|
+
CKEDITOR.plugins.clipboard.fallbackDataTransfer;-1===CKEDITOR.tools.indexOf(d._customTypes,a)&&d._customTypes.push(a);var d=this._getFallbackTypeContent(),k=this._getFallbackTypeData();k[a]=e;try{e=this._applyDataComment(d,k),f.setData(this._customDataFallbackType,e),this._dataTransfer._.nativeHtmlCache=e}catch(g){e=""}}}return e},_getData:function(a,b){var d=this._dataTransfer._.data;if(!b&&d[a])return d[a];try{return this._dataTransfer.$.getData(a)}catch(e){return null}},_getFallbackTypeContent:function(){var a=
|
|
740
740
|
this._dataTransfer._.data[this._customDataFallbackType];a||(a=this._extractDataComment(this._getData(this._customDataFallbackType,!0)).content);return a},_getFallbackTypeData:function(){var a=CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes,b=this._extractDataComment(this._getData(this._customDataFallbackType,!0)).data||{},d=this._dataTransfer._.data;CKEDITOR.tools.array.forEach(a,function(a){void 0!==d[a]?b[a]=d[a]:void 0!==b[a]&&(b[a]=b[a])},this);return b},_isUnsupportedMimeTypeError:function(a){return a.message&&
|
|
741
741
|
-1!==a.message.search(/element not found/gi)},_extractDataComment:function(a){var b={data:null,content:a||""};if(a&&16<a.length){var d;(d=/\x3c!--cke-data:(.*?)--\x3e/g.exec(a))&&d[1]&&(b.data=JSON.parse(decodeURIComponent(d[1])),b.content=a.replace(d[0],""))}return b},_applyDataComment:function(a,b){var d="";b&&CKEDITOR.tools.object.keys(b).length&&(d="\x3c!--cke-data:"+encodeURIComponent(JSON.stringify(b))+"--\x3e");return d+(a&&a.length?a:"")}}})();CKEDITOR.config.clipboard_notificationDuration=
|
|
742
|
-
1E4;CKEDITOR.plugins.add("panelbutton",{requires:"button",onLoad:function(){function a(a){var
|
|
743
|
-
this.hasArrow="listbox";this.click=a;this._={panelDefinition:
|
|
744
|
-
|
|
742
|
+
1E4;CKEDITOR.plugins.add("panelbutton",{requires:"button",onLoad:function(){function a(a){var g=this._;g.state!=CKEDITOR.TRISTATE_DISABLED&&(this.createPanel(a),g.on?g.panel.hide():g.panel.showBlock(this._.id,this.document.getById(this._.id),4))}CKEDITOR.ui.panelButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(l){var g=l.panel||{};delete l.panel;this.base(l);this.document=g.parent&&g.parent.getDocument()||CKEDITOR.document;g.block={attributes:g.attributes};g.toolbarRelated=!0;
|
|
743
|
+
this.hasArrow="listbox";this.click=a;this._={panelDefinition:g}},statics:{handler:{create:function(a){return new CKEDITOR.ui.panelButton(a)}}},proto:{createPanel:function(a){var g=this._;if(!g.panel){var f=this._.panelDefinition,e=this._.panelDefinition.block,m=f.parent||CKEDITOR.document.getBody(),k=this._.panel=new CKEDITOR.ui.floatPanel(a,m,f),f=k.addBlock(g.id,e),h=this,b=a.getCommand(this.command);k.onShow=function(){h.className&&this.element.addClass(h.className+"_panel");h.setState(CKEDITOR.TRISTATE_ON);
|
|
744
|
+
g.on=1;h.editorFocus&&a.focus();if(h.onOpen)h.onOpen()};k.onHide=function(d){h.className&&this.element.getFirst().removeClass(h.className+"_panel");!h.modes&&b?h.setStateFromCommand(b):h.setState(h.modes&&h.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);g.on=0;if(!d&&h.onClose)h.onClose()};k.onEscape=function(){k.hide(1);h.document.getById(g.id).focus()};if(this.onBlock)this.onBlock(k,f);f.onHide=function(){g.on=0;!h.modes&&h.command?h.setStateFromCommand(b):h.setState(CKEDITOR.TRISTATE_OFF)}}},
|
|
745
745
|
setStateFromCommand:function(a){this.setState(a.state)}}})},beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_PANELBUTTON,CKEDITOR.ui.panelButton.handler)}});CKEDITOR.UI_PANELBUTTON="panelbutton";(function(){CKEDITOR.plugins.add("panel",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_PANEL,CKEDITOR.ui.panel.handler)}});CKEDITOR.UI_PANEL="panel";CKEDITOR.ui.panel=function(a,e){e&&CKEDITOR.tools.extend(this,e);CKEDITOR.tools.extend(this,{className:"",css:[]});this.id=CKEDITOR.tools.getNextId();
|
|
746
746
|
this.document=a;this.isFramed=this.forceIFrame||this.css.length;this._={blocks:{}}};CKEDITOR.ui.panel.handler={create:function(a){return new CKEDITOR.ui.panel(a)}};var a=CKEDITOR.addTemplate("panel",'\x3cdiv lang\x3d"{langCode}" id\x3d"{id}" dir\x3d{dir} class\x3d"cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style\x3d"z-index:{z-index}" role\x3d"presentation"\x3e{frame}\x3c/div\x3e'),l=CKEDITOR.addTemplate("panel-frame",'\x3ciframe id\x3d"{id}" class\x3d"cke_panel_frame" role\x3d"presentation" frameborder\x3d"0" src\x3d"{src}"\x3e\x3c/iframe\x3e'),
|
|
747
|
-
|
|
748
|
-
this.getHolderElement=function(){var a=this._.holder;if(!a){if(this.isFramed){var a=this.document.getById(this.id+"_frame"),b=a.getParent(),a=a.getFrameDocument();CKEDITOR.env.iOS&&b.setStyles({overflow:"scroll","-webkit-overflow-scrolling":"touch"});b=CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function(){this.isLoaded=!0;if(this.onLoad)this.onLoad()},this));a.write(
|
|
747
|
+
g=CKEDITOR.addTemplate("panel-frame-inner",'\x3c!DOCTYPE html\x3e\x3chtml class\x3d"cke_panel_container {env}" dir\x3d"{dir}" lang\x3d"{langCode}"\x3e\x3chead\x3e{css}\x3c/head\x3e\x3cbody class\x3d"cke_{dir}" style\x3d"margin:0;padding:0" onload\x3d"{onload}"\x3e\x3c/body\x3e\x3c/html\x3e');CKEDITOR.ui.panel.prototype={render:function(f,e){var m={editorId:f.id,id:this.id,langCode:f.langCode,dir:f.lang.dir,cls:this.className,frame:"",env:CKEDITOR.env.cssClass,"z-index":f.config.baseFloatZIndex+1};
|
|
748
|
+
this.getHolderElement=function(){var a=this._.holder;if(!a){if(this.isFramed){var a=this.document.getById(this.id+"_frame"),b=a.getParent(),a=a.getFrameDocument();CKEDITOR.env.iOS&&b.setStyles({overflow:"scroll","-webkit-overflow-scrolling":"touch"});b=CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function(){this.isLoaded=!0;if(this.onLoad)this.onLoad()},this));a.write(g.output(CKEDITOR.tools.extend({css:CKEDITOR.tools.buildStyleHtml(this.css),onload:"window.parent.CKEDITOR.tools.callFunction("+
|
|
749
749
|
b+");"},m)));a.getWindow().$.CKEDITOR=CKEDITOR;a.on("keydown",function(a){var b=a.data.getKeystroke(),e=this.document.getById(this.id).getAttribute("dir");if("input"!==a.data.getTarget().getName()||37!==b&&39!==b)this._.onKeyDown&&!1===this._.onKeyDown(b)?"input"===a.data.getTarget().getName()&&32===b||a.data.preventDefault():(27==b||b==("rtl"==e?39:37))&&this.onEscape&&!1===this.onEscape(b)&&a.data.preventDefault()},this);a=a.getBody();a.unselectable();CKEDITOR.env.air&&CKEDITOR.tools.callFunction(b)}else a=
|
|
750
750
|
this.document.getById(this.id);this._.holder=a}return a};if(this.isFramed){var k=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())":"";m.frame=l.output({id:this.id+"_frame",src:k})}k=a.output(m);e&&e.push(k);return k},addBlock:function(a,e){e=this._.blocks[a]=e instanceof CKEDITOR.ui.panel.block?e:new CKEDITOR.ui.panel.block(this.getHolderElement(),e);
|
|
751
|
-
this._.currentBlock||this.showBlock(a);return e},getBlock:function(a){return this._.blocks[a]},showBlock:function(a){a=this._.blocks[a];var e=this._.currentBlock,
|
|
751
|
+
this._.currentBlock||this.showBlock(a);return e},getBlock:function(a){return this._.blocks[a]},showBlock:function(a){a=this._.blocks[a];var e=this._.currentBlock,g=!this.forceIFrame||CKEDITOR.env.ie?this._.holder:this.document.getById(this.id+"_frame");e&&e.hide();this._.currentBlock=a;CKEDITOR.fire("ariaWidget",g);a._.focusIndex=-1;this._.onKeyDown=a.onKeyDown&&CKEDITOR.tools.bind(a.onKeyDown,a);a.show();return a},destroy:function(){this.element&&this.element.remove()}};CKEDITOR.ui.panel.block=CKEDITOR.tools.createClass({$:function(a,
|
|
752
752
|
e){this.element=a.append(a.getDocument().createElement("div",{attributes:{tabindex:-1,"class":"cke_panel_block"},styles:{display:"none"}}));e&&CKEDITOR.tools.extend(this,e);this.element.setAttributes({role:this.attributes.role||"presentation","aria-label":this.attributes["aria-label"],title:this.attributes.title||this.attributes["aria-label"]});this.keys={};this._.focusIndex=-1;this.element.disableContextMenu()},_:{markItem:function(a){-1!=a&&(a=this._.getItems().getItem(this._.focusIndex=a),CKEDITOR.env.webkit&&
|
|
753
|
-
a.getDocument().getWindow().focus(),a.focus(),this.onMark&&this.onMark(a))},markFirstDisplayed:function(a){for(var e=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&"none"==a.getStyle("display")},
|
|
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
|
|
755
|
-
|
|
756
|
-
e.getUniqueId(),a.lang.dir,a.uiColor||"",m.css||"",k||"");var
|
|
757
|
-
f,e,l||0);var b=l.element,d=b.getFirst(),c=this;b.disableContextMenu();this.element=b;this._={editor:
|
|
758
|
-
showBlock:function(a,f,e,l,k,
|
|
759
|
-
{x:0,y:0},
|
|
753
|
+
a.getDocument().getWindow().focus(),a.focus(),this.onMark&&this.onMark(a))},markFirstDisplayed:function(a){for(var e=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&"none"==a.getStyle("display")},g=this._.getItems(),k,h,b=g.count()-1;0<=b;b--)if(k=g.getItem(b),k.getAscendant(e)||(h=k,this._.focusIndex=b),"true"==k.getAttribute("aria-selected")){h=k;this._.focusIndex=b;break}h&&(a&&a(),CKEDITOR.env.webkit&&h.getDocument().getWindow().focus(),h.focus(),this.onMark&&this.onMark(h))},getItems:function(){return this.element.find("a,input")}},
|
|
754
|
+
proto:{show:function(){this.element.setStyle("display","")},hide:function(){this.onHide&&!0===this.onHide.call(this)||this.element.setStyle("display","none")},onKeyDown:function(a,e){var g=this.keys[a];switch(g){case "next":for(var k=this._.focusIndex,g=this._.getItems(),h;h=g.getItem(++k);)if(h.getAttribute("_cke_focus")&&h.$.offsetWidth){this._.focusIndex=k;h.focus(!0);break}return h||e?!1:(this._.focusIndex=-1,this.onKeyDown(a,1));case "prev":k=this._.focusIndex;for(g=this._.getItems();0<k&&(h=
|
|
755
|
+
g.getItem(--k));){if(h.getAttribute("_cke_focus")&&h.$.offsetWidth){this._.focusIndex=k;h.focus(!0);break}h=null}return h||e?!1:(this._.focusIndex=g.count(),this.onKeyDown(a,1));case "click":case "mouseup":return k=this._.focusIndex,(h=0<=k&&this._.getItems().getItem(k))&&h.fireEventHandler(g,{button:CKEDITOR.tools.normalizeMouseButton(CKEDITOR.MOUSE_BUTTON_LEFT,!0)}),!1}return!0}}})})();CKEDITOR.plugins.add("floatpanel",{requires:"panel"});(function(){function a(a,f,e,m,k){k=CKEDITOR.tools.genKey(f.getUniqueId(),
|
|
756
|
+
e.getUniqueId(),a.lang.dir,a.uiColor||"",m.css||"",k||"");var h=l[k];h||(h=l[k]=new CKEDITOR.ui.panel(f,m),h.element=e.append(CKEDITOR.dom.element.createFromHtml(h.render(a),f)),h.element.setStyles({display:"none",position:"absolute"}));return h}var l={};CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(g,f,e,l){function k(){c.hide()}e.forceIFrame=1;e.toolbarRelated&&g.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(f=CKEDITOR.document.getById("cke_"+g.name));var h=f.getDocument();l=a(g,h,
|
|
757
|
+
f,e,l||0);var b=l.element,d=b.getFirst(),c=this;b.disableContextMenu();this.element=b;this._={editor:g,panel:l,parentElement:f,definition:e,document:h,iframe:d,children:[],dir:g.lang.dir,showBlockParams:null,markFirst:void 0!==e.markFirst?e.markFirst:!0};g.on("mode",k);g.on("resize",k);h.getWindow().on("resize",function(){this.reposition()},this)},proto:{addBlock:function(a,f){return this._.panel.addBlock(a,f)},addListBlock:function(a,f){return this._.panel.addListBlock(a,f)},getBlock:function(a){return this._.panel.getBlock(a)},
|
|
758
|
+
showBlock:function(a,f,e,l,k,h){var b=this._.panel,d=b.showBlock(a);this._.showBlockParams=[].slice.call(arguments);this.allowBlur(!1);var c=this._.editor.editable();this._.returnFocus=c.hasFocus?c:new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);this._.hideTimeout=0;var n=this.element,c=this._.iframe,c=CKEDITOR.env.ie&&!CKEDITOR.env.edge?c:new CKEDITOR.dom.window(c.$.contentWindow),p=n.getDocument(),q=this._.parentElement.getPositionedAncestor(),t=f.getDocumentPosition(p),p=q?q.getDocumentPosition(p):
|
|
759
|
+
{x:0,y:0},r="rtl"==this._.dir,v=t.x+(l||0)-p.x,y=t.y+(k||0)-p.y;!r||1!=e&&4!=e?r||2!=e&&3!=e||(v+=f.$.offsetWidth-1):v+=f.$.offsetWidth;if(3==e||4==e)y+=f.$.offsetHeight-1;this._.panel._.offsetParentId=f.getId();n.setStyles({top:y+"px",left:0,display:""});n.setOpacity(0);n.getFirst().removeStyle("width");this._.editor.focusManager.add(c);this._.blurSet||(CKEDITOR.event.useCapture=!0,c.on("blur",function(a){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),c.on("focus",function(){this._.focused=!0;this.hideChild();this.allowBlur(!0)},this),CKEDITOR.env.iOS&&(c.on("touchstart",function(){clearTimeout(this._.hideTimeout)},this),c.on("touchend",function(){this._.hideTimeout=0;this.focus()},this)),CKEDITOR.event.useCapture=!1,this._.blurSet=1);b.onEscape=CKEDITOR.tools.bind(function(a){if(this.onEscape&&
|
|
761
761
|
!1===this.onEscape(a))return!1},this);CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.tools.bind(function(){var a=n;a.removeStyle("width");if(d.autoSize){var c=d.element.getDocument(),c=(CKEDITOR.env.webkit||CKEDITOR.env.edge?d.element:c.getBody()).$.scrollWidth;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&0<c&&(c+=(a.$.offsetWidth||0)-(a.$.clientWidth||0)+3);a.setStyle("width",c+10+"px");c=d.element.$.scrollHeight;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&0<c&&(c+=(a.$.offsetHeight||0)-(a.$.clientHeight||
|
|
762
|
-
0)+3);a.setStyle("height",c+"px");b._.currentBlock.element.setStyle("display","none").removeStyle("display")}else a.removeStyle("height");
|
|
762
|
+
0)+3);a.setStyle("height",c+"px");b._.currentBlock.element.setStyle("display","none").removeStyle("display")}else a.removeStyle("height");r&&(v-=n.$.offsetWidth);n.setStyle("left",v+"px");var c=b.element.getWindow(),a=n.$.getBoundingClientRect(),c=c.getViewPaneSize(),e=a.width||a.right-a.left,f=a.height||a.bottom-a.top,k=r?a.right:c.width-a.left,g=r?c.width-a.right:a.left;r?k<e&&(v=g>e?v+e:c.width>e?v-a.left:v-a.right+c.width):k<e&&(v=g>e?v-e:c.width>e?v-a.right+c.width:v-a.left);e=a.top;c.height-
|
|
763
763
|
a.top<f&&(y=e>f?y-f:c.height>f?y-a.bottom+c.height:y-a.top);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&((c=a=n.$.offsetParent&&new CKEDITOR.dom.element(n.$.offsetParent))&&"html"==c.getName()&&(c=c.getDocument().getBody()),c&&"rtl"==c.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:y+"px",left:v+"px"});n.setOpacity(1);
|
|
764
|
+
n.setStyles({top:y+"px",left:v+"px"});n.setOpacity(1);h&&h()},this);b.isLoaded?a():b.onLoad=a;CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus();d.element.focus();CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=a);this.allowBlur(!0);this._.markFirst&&(CKEDITOR.env.ie?CKEDITOR.tools.setTimeout(function(){d.markFirstDisplayed?d.markFirstDisplayed():d._.markFirstDisplayed()},0):d.markFirstDisplayed?d.markFirstDisplayed():
|
|
765
765
|
d._.markFirstDisplayed());this._.editor.fire("panelShow",this)},0,this)},CKEDITOR.env.air?200:0,this);this.visible=1;this.onShow&&this.onShow.call(this)},reposition:function(){var a=this._.showBlockParams;this.visible&&this._.showBlockParams&&(this.hide(),this.showBlock.apply(this,a))},focus:function(){if(CKEDITOR.env.webkit){var a=CKEDITOR.document.getActive();a&&!a.equals(this._.iframe)&&a.$.blur()}(this._.lastFocused||this._.iframe.getFrameDocument().getWindow()).focus()},blur:function(){var a=
|
|
766
766
|
this._.iframe.getFrameDocument().getActive();a&&a.is("a")&&(this._.lastFocused=a)},hide:function(a){if(this.visible&&(!this.onHide||!0!==this.onHide.call(this))){this.hideChild();CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur();this.element.setStyle("display","none");this.visible=0;this.element.getFirst().removeCustomData("activePanel");if(a=a&&this._.returnFocus)CKEDITOR.env.webkit&&a.type&&a.getWindow().$.focus(),a.focus();delete this._.lastFocused;this._.showBlockParams=
|
|
767
|
-
null;this._.editor.fire("panelHide",this)}},allowBlur:function(a){var f=this._.panel;void 0!==a&&(f.allowBlur=a);return f.allowBlur},showAsChild:function(a,f,e,l,k,
|
|
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 d=b.name,f=b.type,l=b.title,
|
|
769
|
-
f+"Style"]),y=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!==k.colorButton_enableAutomatic&&this._.panel._.iframe.getFrameDocument().getById(y).setStyle("background-color",d);if(c=b&&b.getRanges()[0]){for(var b=new CKEDITOR.dom.walker(c),
|
|
773
|
-
"#"+m(d));
|
|
774
|
-
f(a)};var
|
|
775
|
-
z,'"\x3e\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e\x3ctr\x3e\x3ctd colspan\x3d"'+y+'" align\x3d"center"\x3e\x3cspan class\x3d"cke_colorbox" id\x3d"',
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
d.getItem(e);f.removeAttribute("aria-selected");b&&b==m(f.getAttribute("data-value"))&&f.setAttribute("aria-selected",!0)}}function m(a){return CKEDITOR.tools.normalizeHex("#"+CKEDITOR.tools.convertRgbToHex(a||"")).replace(/#/g,"")}var k=a.config,
|
|
767
|
+
null;this._.editor.fire("panelHide",this)}},allowBlur:function(a){var f=this._.panel;void 0!==a&&(f.allowBlur=a);return f.allowBlur},showAsChild:function(a,f,e,l,k,h){if(this._.activeChild!=a||a._.panel._.offsetParentId!=e.getId())this.hideChild(),a.onHide=CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){this._.focused||this.hide()},0,this)},this),this._.activeChild=a,this._.focused=!1,a.showBlock(f,e,l,k,h),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 d=b.name,f=b.type,l=b.title,t=b.order,r=b.commandName;b=b.contentTransformations||{};var v=new CKEDITOR.style(k["colorButton_"+
|
|
769
|
+
f+"Style"]),y=CKEDITOR.tools.getNextId()+"_colorBox",x={type:f},z=new CKEDITOR.style(k["colorButton_"+f+"Style"],{color:"inherit"}),A;a.addCommand(r,{contextSensitive:!0,exec:function(a,b){if(!a.readOnly){var c=b.newStyle;a.removeStyle(z);a.focus();c&&a.applyStyle(c);a.fire("saveSnapshot")}},refresh:function(a,b){z.checkApplicable(b,a,a.activeFilter)?z.checkActive(b,a)?this.setState(CKEDITOR.TRISTATE_ON):this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)}});a.ui.add(d,
|
|
770
|
+
CKEDITOR.UI_PANELBUTTON,{label:l,title:l,command:r,editorFocus:0,toolbar:"colors,"+t,allowedContent:v,requiredContent:v,contentTransformations:b,panel:{css:CKEDITOR.skin.getPath("editor"),attributes:{role:"listbox","aria-label":h.panelTitle}},select:function(a){var b=k.colorButton_colors.split(",");a=CKEDITOR.tools.array.find(b,a);a=m(a);e(A,a);A._.markFirstDisplayed()},onBlock:function(b,c){A=c;c.autoSize=!0;c.element.addClass("cke_colorblock");c.element.setHtml(g({type:f,colorBoxId:y,colorData:x,
|
|
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!==k.colorButton_enableAutomatic&&this._.panel._.iframe.getFrameDocument().getById(y).setStyle("background-color",d);if(c=b&&b.getRanges()[0]){for(var b=new CKEDITOR.dom.walker(c),h=c.collapsed?c.startContainer:b.next(),c="";h;){h.type!==CKEDITOR.NODE_ELEMENT&&(h=h.getParent());h=m(h.getComputedStyle("back"==f?"background-color":"color"));c=c||h;if(c!==h){c="";break}h=b.next()}"transparent"==c&&(c="");"fore"==f&&(x.automaticTextColor=
|
|
773
|
+
"#"+m(d));x.selectionColor=c?"#"+c:"";e(A,c)}return d}})}function g(b){function d(b){b=b&&new CKEDITOR.style(A,{color:b});a.execCommand(m,{newStyle:b})}var e=b.type,g=b.colorBoxId,l=b.colorData,m=b.commandName;b=[];var v=k.colorButton_colors.split(","),y=k.colorButton_colorsPerRow||6,x=a.plugins.colordialog&&!1!==k.colorButton_enableMore,z=v.length+(x?2:1),A=a.config["colorButton_"+e+"Style"];A.childRule="back"==e?function(a){return f(a)}:function(a){return!(a.is("a")||a.getElementsByTag("a").count())||
|
|
774
|
+
f(a)};var w=CKEDITOR.tools.addFunction(function(b){a.focus();a.fire("saveSnapshot");"?"==b?a.getColorFromDialog(function(a){a&&d(a)},null,l):d(b&&"#"+b)});!1!==k.colorButton_enableAutomatic&&b.push('\x3ca class\x3d"cke_colorauto" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',h.auto,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',w,",null,'",e,"');return false;\" href\x3d\"javascript:void('",h.auto,'\')" role\x3d"option" aria-posinset\x3d"1" aria-setsize\x3d"',
|
|
775
|
+
z,'"\x3e\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e\x3ctr\x3e\x3ctd colspan\x3d"'+y+'" align\x3d"center"\x3e\x3cspan class\x3d"cke_colorbox" id\x3d"',g,'"\x3e\x3c/span\x3e',h.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(g=0;g<v.length;g++){0===g%y&&b.push("\x3c/tr\x3e\x3ctr\x3e");var u=v[g].split("/"),D=u[0],C=u[1]||D;b.push('\x3ctd\x3e\x3ca class\x3d"cke_colorbox" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
|
|
776
|
+
u[1]?D:a.lang.colorbutton.colors[C]||C,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',w,",'",C,"','",e,"'); return false;\" href\x3d\"javascript:void('",C,'\')" data-value\x3d"'+C+'" role\x3d"option" aria-posinset\x3d"',g+2,'" aria-setsize\x3d"',z,'"\x3e\x3cspan class\x3d"cke_colorbox" style\x3d"background-color:#',C,'"\x3e\x3c/span\x3e\x3c/a\x3e\x3c/td\x3e')}x&&b.push('\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d"'+y+'" align\x3d"center"\x3e\x3ca class\x3d"cke_colormore" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
|
|
777
|
+
h.more,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',w,",'?','",e,"');return false;\" href\x3d\"javascript:void('",h.more,"')\"",' role\x3d"option" aria-posinset\x3d"',z,'" aria-setsize\x3d"',z,'"\x3e',h.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 d=a._.getItems(),e=0;e<d.count();e++){var f=
|
|
778
|
+
d.getItem(e);f.removeAttribute("aria-selected");b&&b==m(f.getAttribute("data-value"))&&f.setAttribute("aria-selected",!0)}}function m(a){return CKEDITOR.tools.normalizeHex("#"+CKEDITOR.tools.convertRgbToHex(a||"")).replace(/#/g,"")}var k=a.config,h=a.lang.colorbutton;if(!CKEDITOR.env.hc){l({name:"TextColor",type:"fore",commandName:"textColor",title:h.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,d=a.config.colorButton_normalizeBackground;if(void 0===d||d)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 d=(new CKEDITOR.style(a.config.colorButton_backStyle,{color:b.styles.background})).getDefinition();b.name=d.element;
|
|
780
|
-
b.styles=d.styles;b.attributes=d.attributes||{};return b}}]];l({name:"BGColor",type:"back",commandName:"bgColor",title:
|
|
781
|
-
CKEDITOR.config.colorButton_backStyle={element:"span",styles:{"background-color":"#(color)"}};CKEDITOR.plugins.colordialog={requires:"dialog",init:function(a){var l=new CKEDITOR.dialogCommand("colordialog");l.editorFocus=!1;a.addCommand("colordialog",l);CKEDITOR.dialog.add("colordialog",this.path+"dialogs/colordialog.js");a.getColorFromDialog=function(
|
|
782
|
-
a);
|
|
783
|
-
c.onLoad=a;"function"==typeof a&&a.call(this)}})}})}}};CKEDITOR.plugins.add("colordialog",CKEDITOR.plugins.colordialog);(function(){function a(a,e,b,d){var c=new CKEDITOR.dom.walker(a);if(a=a.startContainer.getAscendant(e,!0)||a.endContainer.getAscendant(e,!0))if(b(a),d)return;for(;a=c.next();)if(a=a.getAscendant(e,!0))if(b(a),d)break}function l(a,e){var b={ul:"ol",ol:"ul"};return-1!==f(e,function(d){return d.element===a||d.element===b[a]})}function
|
|
784
|
-
a;this.filter=new CKEDITOR.filter(a,a.config.copyFormatting_allowRules);!0===a.config.copyFormatting_allowRules&&(this.filter.disabled=!0);a.config.copyFormatting_disallowRules&&this.filter.disallow(a.config.copyFormatting_disallowRules)}var f=CKEDITOR.tools.indexOf,e=CKEDITOR.tools.getMouseButton,m=!1;CKEDITOR.plugins.add("copyformatting",{lang:"az,de,en,it,ja,nb,nl,oc,pl,pt-br,ru,sv,tr,zh,zh-cn",icons:"copyformatting",hidpi:!0,init:function(a){var
|
|
785
|
-
m||(CKEDITOR.document.appendStyleSheet(this.path+"styles/copyformatting.css"),m=!0);a.addContentsCss&&a.addContentsCss(this.path+"styles/copyformatting.css");a.copyFormatting=new
|
|
780
|
+
b.styles=d.styles;b.attributes=d.attributes||{};return b}}]];l({name:"BGColor",type:"back",commandName:"bgColor",title:h.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(g,f,e){var l,k,h,b;l=function(a){h(this);a="ok"==a.name?this.getValueOf("picker","selectedColor"):null;/^[0-9a-f]{3}([0-9a-f]{3})?$/i.test(a)&&(a="#"+
|
|
782
|
+
a);g.call(f,a)};k=function(a){e&&(a.data=e)};h=function(a){a.removeListener("ok",l);a.removeListener("cancel",l);a.removeListener("show",k)};b=function(a){a.on("ok",l);a.on("cancel",l);a.on("show",k,null,null,5)};a.execCommand("colordialog");if(a._.storedDialogs&&a._.storedDialogs.colordialog)b(a._.storedDialogs.colordialog);else CKEDITOR.on("dialogDefinition",function(a){if("colordialog"==a.data.name){var c=a.data.definition;a.removeListener();c.onLoad=CKEDITOR.tools.override(c.onLoad,function(a){return function(){b(this);
|
|
783
|
+
c.onLoad=a;"function"==typeof a&&a.call(this)}})}})}}};CKEDITOR.plugins.add("colordialog",CKEDITOR.plugins.colordialog);(function(){function a(a,e,b,d){var c=new CKEDITOR.dom.walker(a);if(a=a.startContainer.getAscendant(e,!0)||a.endContainer.getAscendant(e,!0))if(b(a),d)return;for(;a=c.next();)if(a=a.getAscendant(e,!0))if(b(a),d)break}function l(a,e){var b={ul:"ol",ol:"ul"};return-1!==f(e,function(d){return d.element===a||d.element===b[a]})}function g(a){this.styles=null;this.sticky=!1;this.editor=
|
|
784
|
+
a;this.filter=new CKEDITOR.filter(a,a.config.copyFormatting_allowRules);!0===a.config.copyFormatting_allowRules&&(this.filter.disabled=!0);a.config.copyFormatting_disallowRules&&this.filter.disallow(a.config.copyFormatting_disallowRules)}var f=CKEDITOR.tools.indexOf,e=CKEDITOR.tools.getMouseButton,m=!1;CKEDITOR.plugins.add("copyformatting",{lang:"az,de,en,it,ja,nb,nl,oc,pl,pt-br,ru,sv,tr,zh,zh-cn",icons:"copyformatting",hidpi:!0,init:function(a){var h=CKEDITOR.plugins.copyformatting;h._addScreenReaderContainer();
|
|
785
|
+
m||(CKEDITOR.document.appendStyleSheet(this.path+"styles/copyformatting.css"),m=!0);a.addContentsCss&&a.addContentsCss(this.path+"styles/copyformatting.css");a.copyFormatting=new h.state(a);a.addCommand("copyFormatting",h.commands.copyFormatting);a.addCommand("applyFormatting",h.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"),d=a.editable(),
|
|
786
786
|
c=d.isInline()?d:a.document,f=a.ui.get("CopyFormatting");d.attachListener(c,"mouseup",function(c){e(c)===CKEDITOR.MOUSE_BUTTON_LEFT&&b.state===CKEDITOR.TRISTATE_ON&&a.execCommand("applyFormatting")});d.attachListener(CKEDITOR.document,"mouseup",function(c){e(c)!==CKEDITOR.MOUSE_BUTTON_LEFT||b.state!==CKEDITOR.TRISTATE_ON||d.contains(c.data.getTarget())||a.execCommand("copyFormatting")});f&&(c=CKEDITOR.document.getById(f._.id),d.attachListener(c,"dblclick",function(){a.execCommand("copyFormatting",
|
|
787
787
|
{sticky:!0})}),d.attachListener(c,"mouseup",function(a){a.data.stopPropagation()}))});a.config.copyFormatting_keystrokeCopy&&a.setKeystroke(a.config.copyFormatting_keystrokeCopy,"copyFormatting");a.on("key",function(b){var d=a.getCommand("copyFormatting");b=b.data.domEvent;b.getKeystroke&&27===b.getKeystroke()&&d.state===CKEDITOR.TRISTATE_ON&&a.execCommand("copyFormatting")});a.copyFormatting.on("extractFormatting",function(b){var d=b.data.element;if(d.contains(a.editable())||d.equals(a.editable()))return b.cancel();
|
|
788
|
-
d=
|
|
789
|
-
b.editor):c[m].remove(b.editor):l(e.element,b.data.styles)&&
|
|
790
|
-
d._applyStylesToTextContext(b.editor,b.data.range,b.data.styles)},null,null,999)}});
|
|
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,d=a.copyFormatting,c=e?"keystrokeHandler"==e.from:!1,f=e?e.sticky||c:!1,
|
|
792
|
-
l.removeClass("cke_copyformatting_disabled"),l.removeClass("cke_copyformatting_tableresize_cursor"),b._putScreenReaderMessage(a,"canceled"),b._detachPasteKeystrokeHandler(a),this.setState(CKEDITOR.TRISTATE_OFF);d.styles=b._extractStylesFromElement(a,a.elementPath().lastElement);this.setState(CKEDITOR.TRISTATE_ON);c||(
|
|
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"),d=e?"keystrokeHandler"==e.from:!1,c=CKEDITOR.plugins.copyformatting,f=a.copyFormatting,
|
|
794
|
-
null,
|
|
788
|
+
d=h._convertElementToStyleDef(d);if(!a.copyFormatting.filter.check(new CKEDITOR.style(d),!0,!0))return b.cancel();b.data.styleDef=d});a.copyFormatting.on("applyFormatting",function(b){if(!b.data.preventFormatStripping){var d=b.data.range,c=h._extractStylesFromRange(a,d),e=h._determineContext(d),g,m;if(a.copyFormatting._isContextAllowed(e))for(m=0;m<c.length;m++)e=c[m],g=d.createBookmark(),-1===f(h.preservedElements,e.element)?CKEDITOR.env.webkit&&!CKEDITOR.env.chrome?c[m].removeFromRange(b.data.range,
|
|
789
|
+
b.editor):c[m].remove(b.editor):l(e.element,b.data.styles)&&h._removeStylesFromElementInRange(d,e.element),d.moveToBookmark(g)}});a.copyFormatting.on("applyFormatting",function(b){var d=CKEDITOR.plugins.copyformatting,c=d._determineContext(b.data.range);"list"===c&&a.copyFormatting._isContextAllowed("list")?d._applyStylesToListContext(b.editor,b.data.range,b.data.styles):"table"===c&&a.copyFormatting._isContextAllowed("table")?d._applyStylesToTableContext(b.editor,b.data.range,b.data.styles):a.copyFormatting._isContextAllowed("text")&&
|
|
790
|
+
d._applyStylesToTextContext(b.editor,b.data.range,b.data.styles)},null,null,999)}});g.prototype._isContextAllowed=function(a){var e=this.editor.config.copyFormatting_allowedContexts;return!0===e||-1!==f(e,a)};CKEDITOR.event.implementOn(g.prototype);CKEDITOR.plugins.copyformatting={state:g,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,d=a.copyFormatting,c=e?"keystrokeHandler"==e.from:!1,f=e?e.sticky||c:!1,g=b._getCursorContainer(a),l=CKEDITOR.document.getDocumentElement();if(this.state===CKEDITOR.TRISTATE_ON)return d.styles=null,d.sticky=!1,g.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);d.styles=b._extractStylesFromElement(a,a.elementPath().lastElement);this.setState(CKEDITOR.TRISTATE_ON);c||(g.addClass("cke_copyformatting_active"),l.addClass("cke_copyformatting_tableresize_cursor"),a.config.copyFormatting_outerCursor&&l.addClass("cke_copyformatting_disabled"));d.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"),d=e?"keystrokeHandler"==e.from:!1,c=CKEDITOR.plugins.copyformatting,f=a.copyFormatting,g=c._getCursorContainer(a),l=CKEDITOR.document.getDocumentElement();if(d&&!f.styles)return c._putScreenReaderMessage(a,"failed"),c._detachPasteKeystrokeHandler(a),!1;d=c._applyFormat(a,f.styles);f.sticky||(f.styles=
|
|
794
|
+
null,g.removeClass("cke_copyformatting_active"),l.removeClass("cke_copyformatting_disabled"),l.removeClass("cke_copyformatting_tableresize_cursor"),b.setState(CKEDITOR.TRISTATE_OFF),c._detachPasteKeystrokeHandler(a));c._putScreenReaderMessage(a,d?"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={},d=[];do if(e.type===CKEDITOR.NODE_ELEMENT&&!e.hasAttribute("data-cke-bookmark")&&(b.element=e,a.copyFormatting.fire("extractFormatting",b,a)&&b.styleDef&&d.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 d},_extractStylesFromRange:function(a,e){for(var b=[],d=new CKEDITOR.dom.walker(e),c;c=d.next();)b=b.concat(CKEDITOR.plugins.copyformatting._extractStylesFromElement(a,c));return b},_removeStylesFromElementInRange:function(a,e){for(var b=-1!==f(["ol","ul","table"],e),d=new CKEDITOR.dom.walker(a),c;c=d.next();)if(c=c.getAscendant(e,!0))if(c.removeAttributes(c.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 d(a,c){var k=a,
|
|
798
|
-
CKEDITOR.NODE_TEXT;)k=!m||c||
|
|
799
|
-
(
|
|
800
|
-
!0)||a.endContainer.getAscendant(b,!0))return!0;for(;c=d.next();)if(c.getAscendant(b,!0))return!0}return e({ul:1,ol:1})?"list":e("table")?"table":"text"},_applyStylesToTextContext:function(a,e,b){var d=CKEDITOR.plugins.copyformatting,c=d.excludedAttributesFromInlineTransform,
|
|
801
|
-
e._.definition.element="span",l=0;l<c.length;l++)e._.definition.attributes[c[l]]&&delete e._.definition.attributes[c[l]];e.apply(a)}},_applyStylesToListContext:function(e,f,b){var d,c,
|
|
802
|
-
[d]),f.moveToBookmark(c)},_applyStylesToTableContext:function(e,
|
|
803
|
-
|
|
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 d(a,c){var k=a,g=/\s/g,l="p br ol ul li td th div caption body".split(" "),m=!1,u=!1,n,p;do{for(n=e(k,c);!n&&k.getParent();){k=k.getParent();if(-1!==f(l,k.getName())){u=m=!0;break}n=e(k,c)}if(n&&n.getName&&-1!==f(l,n.getName())){m=!0;break}k=n}while(k&&k.getStyle&&("none"==k.getStyle("display")||!k.getText()));for(k||(k=a);k.type!==
|
|
798
|
+
CKEDITOR.NODE_TEXT;)k=!m||c||u?k.getChild(0):k.getChild(k.getChildCount()-1);for(l=b(k);null!=(u=g.exec(l))&&(p=u.index,c););if("number"!==typeof p&&!m)return d(k,c);if(m)c?p=0:(g=/([\.\b]*$)/,p=(u=g.exec(l))?u.index:l.length);else if(c&&(p+=1,p>l.length))return d(k);return{node:k,offset:p}}var c=/\b\w+\b/ig,g,l,m,t,r;m=t=r=a.startContainer;for(g=b(m);null!=(l=c.exec(g));)if(l.index+l[0].length>=a.startOffset)return a=l.index,c=l.index+l[0].length,0===l.index&&(l=d(m,!0),t=l.node,a=l.offset),c>=g.length&&
|
|
799
|
+
(g=d(m),r=g.node,c=g.offset),{startNode:t,startOffset:a,endNode:r,endOffset:c};return null},_filterStyles:function(a){var e=CKEDITOR.tools.isEmpty,b=[],d,c;for(c=0;c<a.length;c++)d=a[c]._.definition,-1!==CKEDITOR.tools.indexOf(CKEDITOR.plugins.copyformatting.inlineBoundary,d.element)&&(d.element=a[c].element="span"),"span"===d.element&&e(d.attributes)&&e(d.styles)||b.push(a[c]);return b},_determineContext:function(a){function e(b){var d=new CKEDITOR.dom.walker(a),c;if(a.startContainer.getAscendant(b,
|
|
800
|
+
!0)||a.endContainer.getAscendant(b,!0))return!0;for(;c=d.next();)if(c.getAscendant(b,!0))return!0}return e({ul:1,ol:1})?"list":e("table")?"table":"text"},_applyStylesToTextContext:function(a,e,b){var d=CKEDITOR.plugins.copyformatting,c=d.excludedAttributesFromInlineTransform,g,l;CKEDITOR.env.webkit&&!CKEDITOR.env.chrome&&a.getSelection().selectRanges([e]);for(g=0;g<b.length;g++)if(e=b[g],-1===f(d.excludedElementsFromInlineTransform,e.element)){if(-1!==f(d.elementsForInlineTransform,e.element))for(e.element=
|
|
801
|
+
e._.definition.element="span",l=0;l<c.length;l++)e._.definition.attributes[c[l]]&&delete e._.definition.attributes[c[l]];e.apply(a)}},_applyStylesToListContext:function(e,f,b){var d,c,g;for(g=0;g<b.length;g++)d=b[g],c=f.createBookmark(),"ol"===d.element||"ul"===d.element?a(f,{ul:1,ol:1},function(a){var b=d;a.getName()!==b.element&&a.renameNode(b.element);b.applyToObject(a)},!0):"li"===d.element?a(f,"li",function(a){d.applyToObject(a)}):CKEDITOR.plugins.copyformatting._applyStylesToTextContext(e,f,
|
|
802
|
+
[d]),f.moveToBookmark(c)},_applyStylesToTableContext:function(e,h,b){function d(a,b){a.getName()!==b.element&&(b=b.getDefinition(),b.element=a.getName(),b=new CKEDITOR.style(b));b.applyToObject(a)}var c,g,l;for(l=0;l<b.length;l++)c=b[l],g=h.createBookmark(),-1!==f(["table","tr"],c.element)?a(h,c.element,function(a){c.applyToObject(a)}):-1!==f(["td","th"],c.element)?a(h,{td:1,th:1},function(a){d(a,c)}):-1!==f(["thead","tbody"],c.element)?a(h,{thead:1,tbody:1},function(a){d(a,c)}):CKEDITOR.plugins.copyformatting._applyStylesToTextContext(e,
|
|
803
|
+
h,[c]),h.moveToBookmark(g)},_applyFormat:function(a,e){var b=a.getSelection().getRanges()[0],d=CKEDITOR.plugins.copyformatting,c,f;if(!b)return!1;if(b.collapsed){f=a.getSelection().createBookmarks();if(!(c=d._getSelectedWordOffset(b)))return;b=a.createRange();b.setStart(c.startNode,c.startOffset);b.setEnd(c.endNode,c.endOffset);b.select()}e=d._filterStyles(e);if(!a.copyFormatting.fire("applyFormatting",{styles:e,range:b,preventFormatStripping:!1},a))return!1;f&&a.getSelection().selectBookmarks(f);
|
|
804
804
|
return!0},_putScreenReaderMessage:function(a,e){var b=this._getScreenReaderContainer();b&&b.setText(a.lang.copyformatting.notification[e])},_addScreenReaderContainer:function(){if(this._getScreenReaderContainer())return this._getScreenReaderContainer();if(!CKEDITOR.env.ie6Compat&&!CKEDITOR.env.ie7Compat)return CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_screen_reader_only cke_copyformatting_notification"\x3e\x3cdiv aria-live\x3d"polite"\x3e\x3c/div\x3e\x3c/div\x3e')).getChild(0)},
|
|
805
805
|
_getScreenReaderContainer:function(){if(!CKEDITOR.env.ie6Compat&&!CKEDITOR.env.ie7Compat)return CKEDITOR.document.getBody().findOne(".cke_copyformatting_notification div[aria-live]")},_attachPasteKeystrokeHandler:function(a){var e=a.config.copyFormatting_keystrokePaste;e&&(this._initialKeystrokePasteCommand=a.keystrokeHandler.keystrokes[e],a.setKeystroke(e,"applyFormatting"))},_detachPasteKeystrokeHandler:function(a){var e=a.config.copyFormatting_keystrokePaste;e&&a.setKeystroke(e,this._initialKeystrokePasteCommand||
|
|
806
806
|
!1)}};CKEDITOR.config.copyFormatting_outerCursor=!0;CKEDITOR.config.copyFormatting_allowRules="b s u i em strong span p div td th ol ul li(*)[*]{*}";CKEDITOR.config.copyFormatting_disallowRules="*[data-cke-widget*,data-widget*,data-cke-realelement](cke_widget*)";CKEDITOR.config.copyFormatting_allowedContexts=!0;CKEDITOR.config.copyFormatting_keystrokeCopy=CKEDITOR.CTRL+CKEDITOR.SHIFT+67;CKEDITOR.config.copyFormatting_keystrokePaste=CKEDITOR.CTRL+CKEDITOR.SHIFT+86})();CKEDITOR.plugins.add("menu",{requires:"floatpanel",
|
|
807
|
-
beforeInit:function(a){for(var l=a.config.menu_groups.split(","),
|
|
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"',
|
|
809
|
-
CKEDITOR.env.gecko&&(l+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;" ondragstart\x3d"return false;"');CKEDITOR.env.ie&&(
|
|
807
|
+
beforeInit:function(a){for(var l=a.config.menu_groups.split(","),g=a._.menuGroups={},f=a._.menuItems={},e=0;e<l.length;e++)g[l[e]]=e+1;a.addMenuGroup=function(a,e){g[a]=e||100};a.addMenuItem=function(a,e){g[e.group]&&(f[a]=new CKEDITOR.menuItem(this,a,e))};a.addMenuItems=function(a){for(var e in a)this.addMenuItem(e,a[e])};a.getMenuItem=function(a){return f[a]};a.removeMenuItem=function(a){delete f[a]}}});(function(){function a(a){a.sort(function(a,b){return a.group<b.group?-1:a.group>b.group?1:a.order<
|
|
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"',g="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(l+=' onkeypress\x3d"return false;"');
|
|
809
|
+
CKEDITOR.env.gecko&&(l+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;" ondragstart\x3d"return false;"');CKEDITOR.env.ie&&(g='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"'+g+'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:{}}),d=b.block.attributes=b.attributes||{};!d.role&&(d.role="menu");this._.panelDefinition=b},_:{onShow:function(){var a=this.editor.getSelection(),e=a&&a.getStartElement(),b=this.editor.elementPath(),d=this._.listeners;this.removeAll();for(var c=0;c<d.length;c++){var f=d[c](e,a,b);if(f)for(var
|
|
811
|
+
e.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level-1,block:{}}),d=b.block.attributes=b.attributes||{};!d.role&&(d.role="menu");this._.panelDefinition=b},_:{onShow:function(){var a=this.editor.getSelection(),e=a&&a.getStartElement(),b=this.editor.elementPath(),d=this._.listeners;this.removeAll();for(var c=0;c<d.length;c++){var f=d[c](e,a,b);if(f)for(var g in f){var l=this.editor.getMenuItem(g);!l||l.command&&!this.editor.getCommand(l.command).state||(l.state=f[g],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
|
-
this));for(var d in b){var c=this.editor.getMenuItem(d);c&&(c.state=b[d],e.add(c))}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,d){if(!this.parent&&(this._.onShow(),!this.items.length))return;f=f||("rtl"==this.editor.lang.dir?2:1);var c=this.items,
|
|
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
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
findItemByCommandName:function(a){var e=CKEDITOR.tools.array.filter(this.items,function(b){return a===b.command});return e.length?(e=e[0],{item:e,element:this._.element.findOne("."+e.className)}):null}}});CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(a,e,b){CKEDITOR.tools.extend(this,b,{order:0,className:"cke_menubutton__"+e});this.group=a._.menuGroups[this.group];this.editor=a;this.name=e},proto:{render:function(a,
|
|
819
|
-
this.state,
|
|
820
|
-
|
|
821
|
-
this.icon?null:this.icon,this.iconOffset),shortcutHtml:
|
|
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
|
|
823
|
-
!0);b&&"false"==b.getAttribute("contenteditable")&&
|
|
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",
|
|
813
|
+
this));for(var d in b){var c=this.editor.getMenuItem(d);c&&(c.state=b[d],e.add(c))}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,d){if(!this.parent&&(this._.onShow(),!this.items.length))return;f=f||("rtl"==this.editor.lang.dir?2:1);var c=this.items,g=this.editor,
|
|
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 t=m.keys;
|
|
815
|
+
t[40]="next";t[9]="next";t[38]="prev";t[CKEDITOR.SHIFT+9]="prev";t["rtl"==g.lang.dir?37:39]=CKEDITOR.env.ie?"mouseup":"click";t[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(t[13]="mouseup");m=this._.element=m.element;t=m.getDocument();t.getBody().setStyle("overflow","hidden");t.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
|
+
g.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(c);for(var t=g.elementPath(),t=['\x3cdiv class\x3d"cke_menu'+(t&&t.direction()!=g.lang.dir?" cke_mixed_dir_content":"")+'" role\x3d"presentation"\x3e'],
|
|
817
|
+
r=c.length,v=r&&c[0].group,y=0;y<r;y++){var x=c[y];v!=x.group&&(t.push('\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'),v=x.group);x.render(this,y,t)}t.push("\x3c/div\x3e");m.setHtml(t.join(""));CKEDITOR.ui.fire("ready",this);this.parent?this.parent._.panel.showAsChild(l,this.id,e,f,b,d):l.showBlock(this.id,e,f,b,d);g.fire("menuShow",[l])},addListener:function(a){this._.listeners.push(a)},hide:function(a){this._.onHide&&this._.onHide();this._.panel&&this._.panel.hide(a)},
|
|
818
|
+
findItemByCommandName:function(a){var e=CKEDITOR.tools.array.filter(this.items,function(b){return a===b.command});return e.length?(e=e[0],{item:e,element:this._.element.findOne("."+e.className)}):null}}});CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(a,e,b){CKEDITOR.tools.extend(this,b,{order:0,className:"cke_menubutton__"+e});this.group=a._.menuGroups[this.group];this.editor=a;this.name=e},proto:{render:function(a,h,b){var d=a.id+String(h),c="undefined"==typeof this.state?CKEDITOR.TRISTATE_OFF:
|
|
819
|
+
this.state,g="",l=this.editor,q,t,r=c==CKEDITOR.TRISTATE_ON?"on":c==CKEDITOR.TRISTATE_DISABLED?"disabled":"off";this.role in{menuitemcheckbox:1,menuitemradio:1}&&(g=' aria-checked\x3d"'+(c==CKEDITOR.TRISTATE_ON?"true":"false")+'"');var v=this.getItems,y="\x26#"+("rtl"==this.editor.lang.dir?"9668":"9658")+";",x=this.name;this.icon&&!/\./.test(this.icon)&&(x=this.icon);this.command&&(q=l.getCommand(this.command),(q=l.getCommandKeystroke(q))&&(t=CKEDITOR.tools.keystrokeToString(l.lang.common.keyboard,
|
|
820
|
+
q)));q=CKEDITOR.tools.htmlEncodeAttr(this.label);a={id:d,name:this.name,iconName:x,label:this.label,attrLabel:q,cls:this.className||"",state:r,hasPopup:v?"true":"false",disabled:c==CKEDITOR.TRISTATE_DISABLED,title:q+(t?" ("+t.display+")":""),ariaShortcut:t?l.lang.common.keyboardShortcut+" "+t.aria:"",href:"javascript:void('"+(q||"").replace("'")+"')",hoverFn:a._.itemOverFn,moveOutFn:a._.itemOutFn,clickFn:a._.itemClickFn,index:h,iconStyle:CKEDITOR.skin.getIconStyle(x,"rtl"==this.editor.lang.dir,x==
|
|
821
|
+
this.icon?null:this.icon,this.iconOffset),shortcutHtml:t?m.output({shortcut:t.display}):"",arrowHtml:v?e.output({label:y}):"",role:this.role?this.role:"menuitem",ariaChecked:g};f.output(a,b)}}})})();CKEDITOR.config.menu_groups="clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div";CKEDITOR.plugins.add("contextmenu",{requires:"menu",onLoad:function(){CKEDITOR.plugins.contextMenu=CKEDITOR.tools.createClass({base:CKEDITOR.menu,
|
|
822
|
+
$:function(a){this.base.call(this,a,{panel:{css:a.config.contextmenu_contentsCss,className:"cke_menu_panel",attributes:{"aria-label":a.lang.contextmenu.options}}})},proto:{addTarget:function(a,l){function g(){e=!1}var f,e;a.on("contextmenu",function(a){a=a.data;var h=CKEDITOR.env.webkit?f:CKEDITOR.env.mac?a.$.metaKey:a.$.ctrlKey;if(!l||!h)if(a.preventDefault(),!e){if(CKEDITOR.env.mac&&CKEDITOR.env.webkit){var h=this.editor,b=(new CKEDITOR.dom.elementPath(a.getTarget(),h.editable())).contains(function(a){return a.hasAttribute("contenteditable")},
|
|
823
|
+
!0);b&&"false"==b.getAttribute("contenteditable")&&h.getSelection().fake(b)}var b=a.getTarget().getDocument(),d=a.getTarget().getDocument().getDocumentElement(),h=!b.equals(CKEDITOR.document),b=b.getWindow().getScrollPosition(),c=h?a.$.clientX:a.$.pageX||b.x+a.$.clientX,g=h?a.$.clientY:a.$.pageY||b.y+a.$.clientY;CKEDITOR.tools.setTimeout(function(){this.open(d,null,c,g)},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
|
+
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",g),a.on("contextmenu",g))},open:function(a,l,g,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,g,f))}}})},beforeInit:function(a){var l=
|
|
825
825
|
a.contextMenu=new CKEDITOR.plugins.contextMenu(a);a.on("contentDom",function(){l.addTarget(a.editable(),!1!==a.config.browserContextMenuOnCtrl)});a.addCommand("contextMenu",{exec:function(a){var f=0,e=0,l=a.getSelection().getRanges(),l=l[l.length-1].getClientRects(a.editable().isInline());if(l=l[l.length-1])f=l["rtl"===a.lang.dir?"left":"right"],e=l.bottom;a.contextMenu.open(a.document.getBody().getParent(),null,f,e)}});a.setKeystroke(CKEDITOR.SHIFT+121,"contextMenu");a.setKeystroke(CKEDITOR.CTRL+
|
|
826
|
-
CKEDITOR.SHIFT+121,"contextMenu")}});(function(){function a(a){return 20<a.length?!1:(a=a.replace(/[\n|\t]*/g,"").toLowerCase())&&"\x3cbr\x3e"!=a&&"\x3cp\x3e\x26nbsp;\x3cbr\x3e\x3c/p\x3e"!=a&&"\x3cp\x3e\x3cbr\x3e\x3c/p\x3e"!=a&&"\x3cp\x3e\x26nbsp;\x3c/p\x3e"!=a&&"\x26nbsp;"!=a&&" "!=a&&"\x26nbsp;\x3cbr\x3e"!=a&&" \x3cbr\x3e"!=a?!1:!0}function l(f){var k=f.editor,
|
|
827
|
-
!
|
|
826
|
+
CKEDITOR.SHIFT+121,"contextMenu")}});(function(){function a(a){return 20<a.length?!1:(a=a.replace(/[\n|\t]*/g,"").toLowerCase())&&"\x3cbr\x3e"!=a&&"\x3cp\x3e\x26nbsp;\x3cbr\x3e\x3c/p\x3e"!=a&&"\x3cp\x3e\x3cbr\x3e\x3c/p\x3e"!=a&&"\x3cp\x3e\x26nbsp;\x3c/p\x3e"!=a&&"\x26nbsp;"!=a&&" "!=a&&"\x26nbsp;\x3cbr\x3e"!=a&&" \x3cbr\x3e"!=a?!1:!0}function l(f){var k=f.editor,h=k.editable?k.editable():"wysiwyg"==k.mode?k.document&&k.document.getBody():k.textarea,b=f.listenerData;if(h){if("wysiwyg"==k.mode){if(CKEDITOR.dialog._.currentTop||
|
|
827
|
+
!h)return;a(h.getHtml())&&(h.setHtml(b),h.addClass("placeholder"))}"source"==k.mode&&(e?"mode"==f.name&&h.setAttribute("placeholder",b):a(h.getValue())&&(h.setValue(b),h.addClass("placeholder")))}}function g(a){a=a.editor;var e=a.editable?a.editable():"wysiwyg"==a.mode?a.document&&a.document.getBody():a.textarea;if(e){if("wysiwyg"==a.mode){if(!e.hasClass("placeholder"))return;e.removeClass("placeholder");if(CKEDITOR.dtd[e.getName()].p){e.setHtml("\x3cp\x3e\x3cbr/\x3e\x3c/p\x3e");var f=new CKEDITOR.dom.range(a.document);
|
|
828
828
|
f.moveToElementEditablePosition(e.getFirst(),!0);a.getSelection().selectRanges([f])}else e.setHtml(" ")}"source"==a.mode&&e.hasClass("placeholder")&&(e.removeClass("placeholder"),e.setValue(""))}}function f(a){return a?a.getAttribute("lang")||f(a.getParent()):null}var e="placeholder"in document.createElement("textarea");CKEDITOR.plugins.add("confighelper",{getPlaceholderCss:function(){return".placeholder{ color: #999; }"},onLoad:function(){CKEDITOR.addCss&&CKEDITOR.addCss(this.getPlaceholderCss())},
|
|
829
|
-
init:function(m){m.on("mode",function(a){a.editor.focusManager.hasFocus=!1});var k=m.element.getAttribute("placeholder")||m.config.placeholder;if(k){m.addCss&&m.addCss(this.getPlaceholderCss());var
|
|
830
|
-
m.editable?m.editable():"wysiwyg"==m.mode?m.document&&m.document.getBody():m.textarea;b&&b.hasClass("placeholder")&&(a.data.dataValue="")});m.on("setData",function(b){if(!(CKEDITOR.dialog._.currentTop||"source"==m.mode&&e)){var c=m.editable?m.editable():"wysiwyg"==m.mode?m.document&&m.document.getBody():m.textarea;c&&(a(b.data.dataValue)?l(b):c.hasClass("placeholder")&&c.removeClass("placeholder"))}});m.on("blur",l,null,k);m.on("mode",l,null,k);m.on("focus",
|
|
829
|
+
init:function(m){m.on("mode",function(a){a.editor.focusManager.hasFocus=!1});var k=m.element.getAttribute("placeholder")||m.config.placeholder;if(k){m.addCss&&m.addCss(this.getPlaceholderCss());var h=CKEDITOR.document.getHead().append("style");h.setAttribute("type","text/css");CKEDITOR.env.ie&&11>CKEDITOR.env.version?h.$.styleSheet.cssText="textarea.placeholder { color: #999; font-style: italic; }":h.$.innerHTML="textarea.placeholder { color: #999; font-style: italic; }";m.on("getData",function(a){var b=
|
|
830
|
+
m.editable?m.editable():"wysiwyg"==m.mode?m.document&&m.document.getBody():m.textarea;b&&b.hasClass("placeholder")&&(a.data.dataValue="")});m.on("setData",function(b){if(!(CKEDITOR.dialog._.currentTop||"source"==m.mode&&e)){var c=m.editable?m.editable():"wysiwyg"==m.mode?m.document&&m.document.getBody():m.textarea;c&&(a(b.data.dataValue)?l(b):c.hasClass("placeholder")&&c.removeClass("placeholder"))}});m.on("blur",l,null,k);m.on("mode",l,null,k);m.on("focus",g);m.on("beforeModeUnload",g)}(k=m.config.contentsLanguage||
|
|
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"}[k.toLowerCase()]);var b=function(a){if("object"==typeof a)return a;a=a.split(";");var b={},e;for(e=0;e<a.length;e++){var f=
|
|
832
|
-
a[e].split(":");if(3==f.length){var
|
|
833
|
-
"hideDialogFields"in m._||!m.config.hideDialogFields||(m._.hideDialogFields=b(m.config.hideDialogFields));if(m._.hideDialogFields&&(e=m._.hideDialogFields[c]))for(
|
|
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,
|
|
835
|
-
return l},createAdvancedTab:function(f,e,m){e||(e=
|
|
836
|
-
setup:a,commit:l}),
|
|
837
|
-
|
|
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
|
|
839
|
-
{afterInit:function(l){function
|
|
832
|
+
a[e].split(":");if(3==f.length){var h=f[0],g=f[1],f=f[2];b[h]||(b[h]={});b[h][g]||(b[h][g]=[]);b[h][g].push(f)}}return b};CKEDITOR.on("dialogDefinition",function(a){if(m==a.editor){var c=a.data.name;a=a.data.definition;var e,f,h,g,k;"tableProperties"==c&&"table"==c;"removeDialogFields"in m._||!m.config.removeDialogFields||(m._.removeDialogFields=b(m.config.removeDialogFields));if(m._.removeDialogFields&&(e=m._.removeDialogFields[c]))for(h in e)for(g=e[h],k=a.getContents(h),f=0;f<g.length;f++)k.remove(g[f]);
|
|
833
|
+
"hideDialogFields"in m._||!m.config.hideDialogFields||(m._.hideDialogFields=b(m.config.hideDialogFields));if(m._.hideDialogFields&&(e=m._.hideDialogFields[c]))for(h in e)for(g=e[h],k=a.getContents(h),f=0;f<g.length;f++)k.get(g[f]).hidden=!0;if(m.config.dialogFieldsDefaultValues&&(e=m.config.dialogFieldsDefaultValues[c]))for(h in e){g=e[h];k=a.getContents(h);for(var l in g)(c=k.get(l))&&(c["default"]=g[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,g=this.getValue();g?a.setAttribute(e,g):a.removeAttribute(e,g)}}var g={id:1,dir:1,classes:1,styles:1};CKEDITOR.plugins.add("dialogadvtab",{requires:"dialog",allowedContent:function(a){a||(a=g);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=g);var k=f.lang.common,h={id:"advanced",label:k.advancedTab,title:k.advancedTab,elements:[{type:"vbox",padding:1,children:[]}]},b=[];if(e.id||e.dir)e.id&&b.push({id:"advId",att:"id",type:"text",requiredContent:m?m+"[id]":null,label:k.id,setup:a,commit:l}),e.dir&&b.push({id:"advLangDir",att:"dir",type:"select",requiredContent:m?m+"[dir]":null,label:k.langDir,"default":"",style:"width:100%",items:[[k.notSet,""],[k.langDirLTR,"ltr"],[k.langDirRTL,"rtl"]],
|
|
836
|
+
setup:a,commit:l}),h.elements[0].children.push({type:"hbox",widths:["50%","50%"],children:[].concat(b)});if(e.styles||e.classes)b=[],e.styles&&b.push({id:"advStyles",att:"style",type:"text",requiredContent:m?m+"{cke-xyz}":null,label:k.styles,"default":"",validate:CKEDITOR.dialog.validate.inlineStyle(k.invalidInlineStyle),onChange:function(){},getStyle:function(a,b){var e=this.getValue().match(new RegExp("(?:^|;)\\s*"+a+"\\s*:\\s*([^;]*)","i"));return e?e[1]:b},updateStyle:function(a,b){var e=this.getValue(),
|
|
837
|
+
h=f.document.createElement("span");h.setAttribute("style",e);h.setStyle(a,b);e=CKEDITOR.tools.normalizeCssText(h.getAttribute("style"));this.setValue(e,1)},setup:a,commit:l}),e.classes&&b.push({type:"hbox",widths:["45%","55%"],children:[{id:"advCSSClasses",att:"class",type:"text",requiredContent:m?m+"(cke-xyz)":null,label:k.cssClasses,"default":"",setup:a,commit:l}]}),h.elements[0].children.push({type:"hbox",widths:["50%","50%"],children:[].concat(b)});return h}})})();(function(){function a(a,g){var f=
|
|
838
|
+
{},e=[],m={nbsp:" ",shy:"",gt:"\x3e",lt:"\x3c",amp:"\x26",apos:"'",quot:'"'};a=a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(a,b){var h=g?"\x26"+b+";":m[b];f[h]=g?m[b]:"\x26"+b+";";e.push(h);return""});a=a.replace(/,$/,"");if(!g&&a){a=a.split(",");var k=document.createElement("div"),h;k.innerHTML="\x26"+a.join(";\x26")+";";h=k.innerHTML;k=null;for(k=0;k<h.length;k++){var b=h.charAt(k);f[b]="\x26"+a[k]+";";e.push(b)}}f.regex=e.join(g?"|":"");return f}CKEDITOR.plugins.add("entities",
|
|
839
|
+
{afterInit:function(l){function g(a){return b[a]}function f(a){return"force"!=e.entities_processNumerical&&k[a]?k[a]:"\x26#"+a.charCodeAt(0)+";"}var e=l.config;if(l=(l=l.dataProcessor)&&l.htmlFilter){var m=[];!1!==e.basicEntities&&m.push("nbsp,gt,lt,amp");e.entities&&(m.length&&m.push("quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro"),
|
|
840
840
|
e.entities_latin&&m.push("Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml"),e.entities_greek&&m.push("Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv"),
|
|
841
|
-
e.entities_additional&&m.push(e.entities_additional));var k=a(m.join(",")),
|
|
842
|
-
CKEDITOR.config.entities_additional="#39";(function(){function a(a){var e=a.config,m=a.fire("uiSpace",{space:"top",html:""}).html,k=function(){function c(a,d,e){b.setStyle(d,
|
|
843
|
-
0,D=e.floatSpacePinnedOffsetY||0;return function(c){if(m=a.editable()){var n=c&&"focus"==c.name;n&&b.show();a.fire("floatingSpaceLayout",{show:n});b.removeStyle("left");b.removeStyle("right");
|
|
844
|
-
"rtl"==e.contentsLangDirection?"right":"left":c-v.left>v.right-c?"left":"right",
|
|
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(
|
|
841
|
+
e.entities_additional&&m.push(e.entities_additional));var k=a(m.join(",")),h=k.regex?"["+k.regex+"]":"a^";delete k.regex;e.entities&&e.entities_processNumerical&&(h="[^ -~]|"+h);var h=new RegExp(h,"g"),b=a("nbsp,gt,lt,amp,shy",!0),d=new RegExp(b.regex,"g");l.addRules({text:function(a){return a.replace(d,g).replace(h,f)}},{applyToAll:!0,excludeNestedEditable:!0})}}})})();CKEDITOR.config.basicEntities=!0;CKEDITOR.config.entities=!0;CKEDITOR.config.entities_latin=!0;CKEDITOR.config.entities_greek=!0;
|
|
842
|
+
CKEDITOR.config.entities_additional="#39";(function(){function a(a){var e=a.config,m=a.fire("uiSpace",{space:"top",html:""}).html,k=function(){function c(a,d,e){b.setStyle(d,g(e));b.setStyle("position",a)}function d(a){var b=m.getDocumentPosition();switch(a){case "top":c("absolute","top",b.y-x-w);break;case "pin":c("fixed","top",D);break;case "bottom":c("absolute","top",b.y+(v.height||v.bottom-v.top)+w)}h=a}var h,m,r,v,y,x,z,A=e.floatSpaceDockedOffsetX||0,w=e.floatSpaceDockedOffsetY||0,u=e.floatSpacePinnedOffsetX||
|
|
843
|
+
0,D=e.floatSpacePinnedOffsetY||0;return function(c){if(m=a.editable()){var n=c&&"focus"==c.name;n&&b.show();a.fire("floatingSpaceLayout",{show:n});b.removeStyle("left");b.removeStyle("right");r=b.getClientRect();v=m.getClientRect();y=l.getViewPaneSize();x=r.height;z="pageXOffset"in l.$?l.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft;h?(x+w<=v.top?d("top"):x+w>y.height-v.bottom?d("pin"):d("bottom"),c=y.width/2,c=e.floatSpacePreferRight?"right":0<v.left&&v.right<y.width&&v.width>r.width?
|
|
844
|
+
"rtl"==e.contentsLangDirection?"right":"left":c-v.left>v.right-c?"left":"right",r.width>y.width?(c="left",n=0):(n="left"==c?0<v.left?v.left:0:v.right<y.width?y.width-v.right:0,n+r.width>y.width&&(c="left"==c?"right":"left",n=0)),b.setStyle(c,g(("pin"==h?u:A)+n+("pin"==h?0:"left"==c?z:-z)))):(h="pin",d("pin"),k(c))}}}();if(m){var h=new CKEDITOR.template('\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" title\x3d"'+
|
|
845
|
+
(CKEDITOR.env.gecko?" ":"")+'" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"'+(a.title?' aria-labelledby\x3d"cke_{name}_arialbl"':" ")+"\x3e"+(a.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':" ")+'\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),b=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(h.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}))),d=CKEDITOR.tools.eventsBuffer(500,k),c=CKEDITOR.tools.eventsBuffer(100,k);b.unselectable();b.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){k(b);a.on("change",d.input);l.on("scroll",c.input);l.on("resize",c.input)});a.on("blur",function(){b.hide();a.removeListener("change",
|
|
847
|
-
d.input);l.removeListener("scroll",c.input);l.removeListener("resize",c.input)});a.on("destroy",function(){l.removeListener("scroll",c.input);l.removeListener("resize",c.input);b.clearCustomData();b.remove()});a.focusManager.hasFocus&&b.show();a.focusManager.add(b,1)}}var l=CKEDITOR.document.getWindow(),
|
|
847
|
+
d.input);l.removeListener("scroll",c.input);l.removeListener("resize",c.input)});a.on("destroy",function(){l.removeListener("scroll",c.input);l.removeListener("resize",c.input);b.clearCustomData();b.remove()});a.focusManager.hasFocus&&b.show();a.focusManager.add(b,1)}}var l=CKEDITOR.document.getWindow(),g=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(f){f.on("loaded",function(){a(this)},null,null,20)}})})();CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var a=
|
|
848
848
|
CKEDITOR.addTemplate("panel-list",'\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),l=CKEDITOR.addTemplate("panel-list-item",'\x3cli id\x3d"{id}" class\x3d"cke_panel_listItem" role\x3dpresentation\x3e\x3ca id\x3d"{id}_option" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"{title}" draggable\x3d"false" ondragstart\x3d"return false;" href\x3d"javascript:void(\'{val}\')" onclick\x3d"{onclick}CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'),
|
|
849
|
-
|
|
850
|
-
(
|
|
851
|
-
delete this._.started}},getClick:function(){this._.click||(this._.click=CKEDITOR.tools.addFunction(function(a){var f=this.toggle(a);if(this.onClick)this.onClick(a,f)},this));return this._.click}},proto:{add:function(a,
|
|
852
|
-
"",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(k||a),text:
|
|
853
|
-
this.element.getDocument().getById(this._.groups[a]))&&a.getNext();a&&(a.setStyle("display","none"),f&&"ul"==f.getName()&&f.setStyle("display","none"))},hideItem:function(a){this.element.getDocument().getById(this._.items[a]).setStyle("display","none")},showAll:function(){var a=this._.items,f=this._.groups,
|
|
854
|
-
"")},mark:function(a){this.multiSelect||this.unmarkAll();a=this._.items[a];var f=this.element.getDocument().getById(a);f.addClass("cke_selected");this.element.getDocument().getById(a+"_option").setAttribute("aria-selected",!0);this.onMark&&this.onMark(f)},markFirstDisplayed:function(){var a=this;this._.markFirstDisplayed(function(){a.multiSelect||a.unmarkAll()})},unmark:function(a){var f=this.element.getDocument();a=this._.items[a];var
|
|
855
|
-
this.onUnmark&&this.onUnmark(
|
|
856
|
-
f.getItem(++
|
|
849
|
+
g=CKEDITOR.addTemplate("panel-list-group",'\x3ch1 id\x3d"{id}" draggable\x3d"false" ondragstart\x3d"return false;" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'),f=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(a,f){return this.addBlock(a,new CKEDITOR.ui.listBlock(this.getHolderElement(),f))};CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(a,f){f=f||{};var g=f.attributes||(f.attributes={});(this.multiSelect=!!f.multiSelect)&&
|
|
850
|
+
(g["aria-multiselectable"]=!0);!g.role&&(g.role="listbox");this.base.apply(this,arguments);this.element.setAttribute("role",g.role);g=this.keys;g[40]="next";g[9]="next";g[38]="prev";g[CKEDITOR.SHIFT+9]="prev";g[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(g[13]="mouseup");this._.pendingHtml=[];this._.pendingList=[];this._.items={};this._.groups={}},_:{close:function(){if(this._.started){var e=a.output({items:this._.pendingList.join("")});this._.pendingList=[];this._.pendingHtml.push(e);
|
|
851
|
+
delete this._.started}},getClick:function(){this._.click||(this._.click=CKEDITOR.tools.addFunction(function(a){var f=this.toggle(a);if(this.onClick)this.onClick(a,f)},this));return this._.click}},proto:{add:function(a,g,k){var h=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0);this._.items[a]=h;var b;b=CKEDITOR.tools.htmlEncodeAttr(a).replace(f,"\\'");a={id:h,val:b,onclick:CKEDITOR.env.ie?'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26':
|
|
852
|
+
"",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(k||a),text:g||a};this._.pendingList.push(l.output(a))},startGroup:function(a){this._.close();var f=CKEDITOR.tools.getNextId();this._.groups[a]=f;this._.pendingHtml.push(g.output({id:f,label:a}))},commit:function(){this._.close();this.element.appendHtml(this._.pendingHtml.join(""));delete this._.size;this._.pendingHtml=[]},toggle:function(a){var f=this.isMarked(a);f?this.unmark(a):this.mark(a);return!f},hideGroup:function(a){var f=(a=
|
|
853
|
+
this.element.getDocument().getById(this._.groups[a]))&&a.getNext();a&&(a.setStyle("display","none"),f&&"ul"==f.getName()&&f.setStyle("display","none"))},hideItem:function(a){this.element.getDocument().getById(this._.items[a]).setStyle("display","none")},showAll:function(){var a=this._.items,f=this._.groups,g=this.element.getDocument(),h;for(h in a)g.getById(a[h]).setStyle("display","");for(var b in f)a=g.getById(f[b]),h=a.getNext(),a.setStyle("display",""),h&&"ul"==h.getName()&&h.setStyle("display",
|
|
854
|
+
"")},mark:function(a){this.multiSelect||this.unmarkAll();a=this._.items[a];var f=this.element.getDocument().getById(a);f.addClass("cke_selected");this.element.getDocument().getById(a+"_option").setAttribute("aria-selected",!0);this.onMark&&this.onMark(f)},markFirstDisplayed:function(){var a=this;this._.markFirstDisplayed(function(){a.multiSelect||a.unmarkAll()})},unmark:function(a){var f=this.element.getDocument();a=this._.items[a];var g=f.getById(a);g.removeClass("cke_selected");f.getById(a+"_option").removeAttribute("aria-selected");
|
|
855
|
+
this.onUnmark&&this.onUnmark(g)},unmarkAll:function(){var a=this._.items,f=this.element.getDocument(),g;for(g in a){var h=a[g];f.getById(h).removeClass("cke_selected");f.getById(h+"_option").removeAttribute("aria-selected")}this.onUnmark&&this.onUnmark()},isMarked:function(a){return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")},focus:function(a){this._.focusIndex=-1;var f=this.element.getElementsByTag("a"),g,h=-1;if(a)for(g=this.element.getDocument().getById(this._.items[a]).getFirst();a=
|
|
856
|
+
f.getItem(++h);){if(a.equals(g)){this._.focusIndex=h;break}}else this.element.focus();g&&setTimeout(function(){g.focus()},0)}}})}});CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler)}});(function(){var a='\x3cspan id\x3d"{id}" class\x3d"cke_combo cke_combo__{name} {cls}" role\x3d"presentation"\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_combo_label"\x3e{label}\x3c/span\x3e\x3ca class\x3d"cke_combo_button" title\x3d"{title}" tabindex\x3d"-1"'+
|
|
857
857
|
(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-haspopup\x3d"listbox"',l="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(a+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(a+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');CKEDITOR.env.ie&&(l='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var a=a+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+
|
|
858
|
-
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"),
|
|
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"),g=CKEDITOR.addTemplate("combo",a);CKEDITOR.UI_RICHCOMBO="richcombo";CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(a){CKEDITOR.tools.extend(this,
|
|
859
859
|
a,{canGroup:!1,title:a.label,modes:{wysiwyg:1},editorFocus:1});a=this.panel||{};delete this.panel;this.id=CKEDITOR.tools.getNextNumber();this.document=a.parent&&a.parent.getDocument()||CKEDITOR.document;a.className="cke_combopanel";a.block={multiSelect:a.multiSelect,attributes:a.attributes};a.toolbarRelated=!0;this._={panelDefinition:a,items:{},listeners:[]}},proto:{renderHtml:function(a){var e=[];this.render(a,e);return e.join("")},render:function(a,e){function l(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var b=
|
|
860
|
-
this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;a.readOnly&&!this.readOnly&&(b=CKEDITOR.TRISTATE_DISABLED);this.setState(b);this.setValue("");b!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var k=CKEDITOR.env,
|
|
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:c};this._.listeners.push(a.on("activeFilterChange",l,this));this._.listeners.push(a.on("mode",l,this));this._.listeners.push(a.on("selectionChange",l,this));!this.readOnly&&this._.listeners.push(a.on("readOnly",l,this));var
|
|
862
|
-
b);break;default:
|
|
863
|
-
|
|
864
|
-
d.onClick.call(d,a,e);b.hide()};this._.panel=b;this._.list=e;b.getBlock(this.id).onHide=function(){d._.on=0;d.setState(CKEDITOR.TRISTATE_OFF)};this.init&&this.init()}},setValue:function(a,e){this._.value=a;var
|
|
865
|
-
hideItem:function(a){this._.list.hideItem(a)},hideGroup:function(a){this._.list.hideGroup(a)},showAll:function(){this._.list.showAll()},add:function(a,e,
|
|
860
|
+
this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;a.readOnly&&!this.readOnly&&(b=CKEDITOR.TRISTATE_DISABLED);this.setState(b);this.setValue("");b!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var k=CKEDITOR.env,h,b,d="cke_"+this.id,c=CKEDITOR.tools.addFunction(function(c){b&&(a.unlockSelection(1),b=0);h.execute(c)},this),n=this;h={id:d,combo:this,focus:function(){CKEDITOR.document.getById(d).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:c};this._.listeners.push(a.on("activeFilterChange",l,this));this._.listeners.push(a.on("mode",l,this));this._.listeners.push(a.on("selectionChange",l,this));!this.readOnly&&this._.listeners.push(a.on("readOnly",l,this));var p=CKEDITOR.tools.addFunction(function(a,b){a=new CKEDITOR.dom.event(a);var d=a.getKeystroke();switch(d){case 13:case 32:case 40:CKEDITOR.tools.callFunction(c,
|
|
862
|
+
b);break;default:h.onkey(h,d)}a.preventDefault()}),q=CKEDITOR.tools.addFunction(function(){h.onfocus&&h.onfocus()});b=0;h.keyDownFn=p;k={id:d,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:k.gecko&&!k.hc?"":(this.title||"").replace("'",""),keydownFn:p,focusFn:q,clickFn:c};g.output(k,e);if(this.onRender)this.onRender();return h},createPanel:function(a){if(!this._.panel){var e=this._.panelDefinition,g=this._.panelDefinition.block,k=e.parent||CKEDITOR.document.getBody(),
|
|
863
|
+
h="cke_combopanel__"+this.name,b=new CKEDITOR.ui.floatPanel(a,k,e),e=b.addListBlock(this.id,g),d=this;b.onShow=function(){this.element.addClass(h);d.setState(CKEDITOR.TRISTATE_ON);d._.on=1;d.editorFocus&&!a.focusManager.hasFocus&&a.focus();if(d.onOpen)d.onOpen()};b.onHide=function(b){this.element.removeClass(h);d.setState(d.modes&&d.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);d._.on=0;if(!b&&d.onClose)d.onClose()};b.onEscape=function(){b.hide(1)};e.onClick=function(a,e){d.onClick&&
|
|
864
|
+
d.onClick.call(d,a,e);b.hide()};this._.panel=b;this._.list=e;b.getBlock(this.id).onHide=function(){d._.on=0;d.setState(CKEDITOR.TRISTATE_OFF)};this.init&&this.init()}},setValue:function(a,e){this._.value=a;var g=this.document.getById("cke_"+this.id+"_text");g&&(a||e?g.removeClass("cke_combo_inlinelabel"):(e=this.label,g.addClass("cke_combo_inlinelabel")),g.setText("undefined"!=typeof e?e:a))},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(a){this._.list.mark(a)},
|
|
865
|
+
hideItem:function(a){this._.list.hideItem(a)},hideGroup:function(a){this._.list.hideGroup(a)},showAll:function(){this._.list.showAll()},add:function(a,e,g){this._.items[a]=g||a;this._.list.add(a,e,g)},startGroup:function(a){this._.list.startGroup(a)},commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this));this._.committed=1},setState:function(a){if(this._.state!=a){var e=this.document.getById("cke_"+this.id);e.setState(a,"cke_combo");a==CKEDITOR.TRISTATE_DISABLED?
|
|
866
866
|
e.setAttribute("aria-disabled",!0):e.removeAttribute("aria-disabled");this._.state=a}},getState:function(){return this._.state},enable:function(){this._.state==CKEDITOR.TRISTATE_DISABLED&&this.setState(this._.lastState)},disable:function(){this._.state!=CKEDITOR.TRISTATE_DISABLED&&(this._.lastState=this._.state,this.setState(CKEDITOR.TRISTATE_DISABLED))},destroy:function(){CKEDITOR.tools.array.forEach(this._.listeners,function(a){a.removeListener()});this._.listeners=[]},select:function(a){if(!CKEDITOR.tools.isEmpty(this._.items))for(var e in this._.items)if(a({value:e,
|
|
867
|
-
text:this._.items[e]})){this.setValue(e);break}}},statics:{handler:{create:function(a){return new CKEDITOR.ui.richCombo(a)}}}});CKEDITOR.ui.prototype.addRichCombo=function(a,e){this.add(a,CKEDITOR.UI_RICHCOMBO,e)}})();(function(){function a(a,
|
|
868
|
-
f=void 0===c;if(d||c)if(d&&e.collapsed&&l({editor:a,range:e,style:d}),f)a.removeStyle(d);else{if(e=d)e=d instanceof CKEDITOR.style&&c instanceof CKEDITOR.style?CKEDITOR.style.getStyleText(d.getDefinition())===CKEDITOR.style.getStyleText(c.getDefinition()):!1,e=!e;e&&a.removeStyle(d);a.applyStyle(c)}},refresh:function(a,c){b.checkApplicable(c,a,a.activeFilter)||this.setState(CKEDITOR.TRISTATE_DISABLED)}});c=a.getCommand(
|
|
869
|
-
command:
|
|
870
|
-
a.attributes.align,delete a.attributes.align);a.attributes.face&&(a.styles["font-family"]=a.attributes.face,delete a.attributes.face)}}]]:null,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(k.contentsCss),multiSelect:!1,attributes:{"aria-label":
|
|
871
|
-
{newStyle:d.getStyle(b),oldStyle:d.getStyle(c)});a.fire("saveSnapshot")},onRender:function(){a.on("selectionChange",function(b){var c=this.getValue();(b=d.getMatchingValue(a,b.data.path))?b!=c&&this.setValue(b):this.setValue("",
|
|
872
|
-
CKEDITOR.START);c=k.checkBoundaryOfElement(a,CKEDITOR.END);if(d&&c){for(d=k.createBookmark();b=a.getFirst();)b.insertBefore(a);a.remove();k.moveToBookmark(d)}else d||c?k.moveToPosition(a,d?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_END):(k.splitElement(a),k.moveToPosition(a,CKEDITOR.POSITION_AFTER_END)),
|
|
873
|
-
CKEDITOR.POSITION_AFTER_START);
|
|
874
|
-
this._.names[f];a.add(
|
|
867
|
+
text:this._.items[e]})){this.setValue(e);break}}},statics:{handler:{create:function(a){return new CKEDITOR.ui.richCombo(a)}}}});CKEDITOR.ui.prototype.addRichCombo=function(a,e){this.add(a,CKEDITOR.UI_RICHCOMBO,e)}})();(function(){function a(a,g){var k=a.config,h=g.lang,b=new CKEDITOR.style(g.styleDefinition),d=new f({entries:g.entries,styleVariable:g.styleVariable,styleDefinition:g.styleDefinition}),c;a.addCommand(g.commandName,{exec:function(a,b){var c=b.newStyle,d=b.oldStyle,e=a.getSelection().getRanges()[0],
|
|
868
|
+
f=void 0===c;if(d||c)if(d&&e.collapsed&&l({editor:a,range:e,style:d}),f)a.removeStyle(d);else{if(e=d)e=d instanceof CKEDITOR.style&&c instanceof CKEDITOR.style?CKEDITOR.style.getStyleText(d.getDefinition())===CKEDITOR.style.getStyleText(c.getDefinition()):!1,e=!e;e&&a.removeStyle(d);a.applyStyle(c)}},refresh:function(a,c){b.checkApplicable(c,a,a.activeFilter)||this.setState(CKEDITOR.TRISTATE_DISABLED)}});c=a.getCommand(g.commandName);a.ui.addRichCombo(g.comboName,{label:h.label,title:h.panelTitle,
|
|
869
|
+
command:g.commandName,toolbar:"styles,"+g.order,defaultValue:"cke-default",allowedContent:b,requiredContent:b,contentTransformations:"span"===g.styleDefinition.element?[[{element:"font",check:"span",left:function(a){return!!a.attributes.size||!!a.attributes.align||!!a.attributes.face},right:function(a){var b=" x-small small medium large x-large xx-large 48px".split(" ");a.name="span";a.attributes.size&&(a.styles["font-size"]=b[a.attributes.size],delete a.attributes.size);a.attributes.align&&(a.styles["text-align"]=
|
|
870
|
+
a.attributes.align,delete a.attributes.align);a.attributes.face&&(a.styles["font-family"]=a.attributes.face,delete a.attributes.face)}}]]:null,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(k.contentsCss),multiSelect:!1,attributes:{"aria-label":h.panelTitle}},init:function(){var b="("+a.lang.common.optionDefault+")";this.startGroup(h.panelTitle);this.add(this.defaultValue,b,b);d.addToCombo(this)},onClick:function(b){var c=this.getValue();a.focus();a.fire("saveSnapshot");a.execCommand(g.commandName,
|
|
871
|
+
{newStyle:d.getStyle(b),oldStyle:d.getStyle(c)});a.fire("saveSnapshot")},onRender:function(){a.on("selectionChange",function(b){var c=this.getValue();(b=d.getMatchingValue(a,b.data.path))?b!=c&&this.setValue(b):this.setValue("",g.defaultLabel)},this);c.on("state",function(){this.setState(c.state)},this)},refresh:function(){this.setState(c.state)}})}function l(a){var f=a.editor,k=a.range,h=a.style,b,d,c;b=f.elementPath();if(a=b.contains(function(a){return h.checkElementRemovable(a)})){d=k.checkBoundaryOfElement(a,
|
|
872
|
+
CKEDITOR.START);c=k.checkBoundaryOfElement(a,CKEDITOR.END);if(d&&c){for(d=k.createBookmark();b=a.getFirst();)b.insertBefore(a);a.remove();k.moveToBookmark(d)}else d||c?k.moveToPosition(a,d?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_END):(k.splitElement(a),k.moveToPosition(a,CKEDITOR.POSITION_AFTER_END)),g(k,b.elements.slice(),a);f.getSelection().selectRanges([k])}}function g(a,f,k){var h=f.pop();if(h){if(k)return g(a,f,h.equals(k)?null:k);k=h.clone();a.insertNode(k);a.moveToPosition(k,
|
|
873
|
+
CKEDITOR.POSITION_AFTER_START);g(a,f)}}var f=CKEDITOR.tools.createClass({$:function(a){var f=a.entries.split(";");this._.data={};this._.names=[];for(var g=0;g<f.length;g++){var h=f[g],b,d;h?(h=h.split("/"),b=h[0],h=h[1],d={},d[a.styleVariable]=h||b,this._.data[b]=new CKEDITOR.style(a.styleDefinition,d),this._.data[b]._.definition.name=b,this._.names.push(b)):(f.splice(g,1),g--)}},proto:{getStyle:function(a){return this._.data[a]},addToCombo:function(a){for(var f=0;f<this._.names.length;f++){var g=
|
|
874
|
+
this._.names[f];a.add(g,this.getStyle(g).buildPreview(),g)}},getMatchingValue:function(a,f){for(var g=f.elements,h=0,b;h<g.length;h++)if(b=g[h],b=this._.findMatchingStyleName(a,b))return b;return null}},_:{findMatchingStyleName:function(a,f){return CKEDITOR.tools.array.find(this._.names,function(g){return this.getStyle(g).checkElementMatch(f,!0,a)},this)}}});CKEDITOR.plugins.add("font",{requires:"richcombo",init:function(e){var f=e.config;a(e,{comboName:"Font",commandName:"font",styleVariable:"family",
|
|
875
875
|
lang:e.lang.font,entries:f.font_names,defaultLabel:f.font_defaultLabel,styleDefinition:f.font_style,order:30});a(e,{comboName:"FontSize",commandName:"fontSize",styleVariable:"size",lang:e.lang.font.fontSize,entries:f.fontSize_sizes,defaultLabel:f.fontSize_defaultLabel,styleDefinition:f.fontSize_style,order:40})}})})();CKEDITOR.config.font_names="Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif";
|
|
876
876
|
CKEDITOR.config.font_defaultLabel="";CKEDITOR.config.font_style={element:"span",styles:{"font-family":"#(family)"},overrides:[{element:"font",attributes:{face:null}}]};CKEDITOR.config.fontSize_sizes="8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px";CKEDITOR.config.fontSize_defaultLabel="";CKEDITOR.config.fontSize_style={element:"span",styles:{"font-size":"#(size)"},overrides:[{element:"font",attributes:{size:null}}]};CKEDITOR.plugins.add("format",
|
|
877
|
-
{requires:"richcombo",init:function(a){if(!a.blockless){for(var l=a.config,
|
|
878
|
-
init:function(){this.startGroup(
|
|
877
|
+
{requires:"richcombo",init:function(a){if(!a.blockless){for(var l=a.config,g=a.lang.format,f=l.format_tags.split(";"),e={},m=0,k=[],h=0;h<f.length;h++){var b=f[h],d=new CKEDITOR.style(l["format_"+b]);if(!a.filter.customConfig||a.filter.check(d))m++,e[b]=d,e[b]._.enterMode=a.config.enterMode,k.push(d)}0!==m&&a.ui.addRichCombo("Format",{label:g.label,title:g.panelTitle,toolbar:"styles,20",allowedContent:k,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(l.contentsCss),multiSelect:!1,attributes:{"aria-label":g.panelTitle}},
|
|
878
|
+
init:function(){this.startGroup(g.panelTitle);for(var a in e){var b=g["tag_"+a];this.add(a,e[a].buildPreview(b),b)}},onClick:function(b){a.focus();a.fire("saveSnapshot");b=e[b];var d=a.elementPath();b.checkActive(d,a)||a.applyStyle(b);setTimeout(function(){a.fire("saveSnapshot")},0)},onRender:function(){a.on("selectionChange",function(b){var d=this.getValue();b=b.data.path;this.refresh();for(var f in e)if(e[f].checkActive(b,a)){f!=d&&this.setValue(f,a.lang.format["tag_"+f]);return}this.setValue("")},
|
|
879
879
|
this)},onOpen:function(){this.showAll();for(var b in e)a.activeFilter.check(e[b])||this.hideItem(b)},refresh:function(){var b=a.elementPath();if(b){if(b.isContextFor("p"))for(var d in e)if(a.activeFilter.check(e[d]))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}}})}}});CKEDITOR.config.format_tags="p;h1;h2;h3;h4;h5;h6;pre;address;div";CKEDITOR.config.format_p={element:"p"};CKEDITOR.config.format_div={element:"div"};CKEDITOR.config.format_pre={element:"pre"};CKEDITOR.config.format_address={element:"address"};
|
|
880
|
-
CKEDITOR.config.format_h1={element:"h1"};CKEDITOR.config.format_h2={element:"h2"};CKEDITOR.config.format_h3={element:"h3"};CKEDITOR.config.format_h4={element:"h4"};CKEDITOR.config.format_h5={element:"h5"};CKEDITOR.config.format_h6={element:"h6"};(
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
this.
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
(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 q=f.getEnclosedNode();q&&q.type==CKEDITOR.NODE_ELEMENT&&q.getName()in e&&(f.setStartAt(q,CKEDITOR.POSITION_AFTER_START),f.setEndAt(q,CKEDITOR.POSITION_BEFORE_END),m=q)}m&&f.startContainer.type==CKEDITOR.NODE_ELEMENT&&f.startContainer.getName()in e&&(q=new CKEDITOR.dom.walker(f),q.evaluator=l,f.startContainer=
|
|
897
|
-
q.next());m&&f.endContainer.type==CKEDITOR.NODE_ELEMENT&&f.endContainer.getName()in e&&(q=new CKEDITOR.dom.walker(f),q.evaluator=l,f.endContainer=q.previous());if(m)return b(m)}return 0}function l(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is("li")}function h(a){return f(a)&&e(a)}var f=CKEDITOR.dom.walker.whitespaces(!0),e=CKEDITOR.dom.walker.bookmark(!1,!0),m=CKEDITOR.TRISTATE_DISABLED,k=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(e){function b(b){d.specificDefinition.apply(this,
|
|
880
|
+
CKEDITOR.config.format_h1={element:"h1"};CKEDITOR.config.format_h2={element:"h2"};CKEDITOR.config.format_h3={element:"h3"};CKEDITOR.config.format_h4={element:"h4"};CKEDITOR.config.format_h5={element:"h5"};CKEDITOR.config.format_h6={element:"h6"};CKEDITOR.plugins.add("htmlwriter",{init:function(a){var l=new CKEDITOR.htmlWriter;l.forceSimpleAmpersand=a.config.forceSimpleAmpersand;l.indentationChars=a.config.dataIndentationChars||"\t";a.dataProcessor.writer=l}});CKEDITOR.htmlWriter=CKEDITOR.tools.createClass({base:CKEDITOR.htmlParser.basicWriter,
|
|
881
|
+
$:function(){this.base();this.indentationChars="\t";this.selfClosingEnd=" /\x3e";this.lineBreakChars="\n";this.sortAttributes=1;this._.indent=0;this._.indentation="";this._.inPre=0;this._.rules={};var a=CKEDITOR.dtd,l;for(l in CKEDITOR.tools.extend({},a.$nonBodyContent,a.$block,a.$listItem,a.$tableContent))this.setRules(l,{indent:!a[l]["#"],breakBeforeOpen:1,breakBeforeClose:!a[l]["#"],breakAfterClose:1,needsSpace:l in a.$block&&!(l in{li:1,dt:1,dd:1})});this.setRules("br",{breakAfterOpen:1});this.setRules("title",
|
|
882
|
+
{indent:0,breakAfterOpen:0});this.setRules("style",{indent:0,breakBeforeClose:1});this.setRules("pre",{breakAfterOpen:1,indent:0})},proto:{openTag:function(a){var l=this._.rules[a];this._.afterCloser&&l&&l.needsSpace&&this._.needsSpace&&this._.output.push("\n");this._.indent?this.indentation():l&&l.breakBeforeOpen&&(this.lineBreak(),this.indentation());this._.output.push("\x3c",a);this._.afterCloser=0},openTagClose:function(a,l){var g=this._.rules[a];l?(this._.output.push(this.selfClosingEnd),g&&
|
|
883
|
+
g.breakAfterClose&&(this._.needsSpace=g.needsSpace)):(this._.output.push("\x3e"),g&&g.indent&&(this._.indentation+=this.indentationChars));g&&g.breakAfterOpen&&this.lineBreak();"pre"==a&&(this._.inPre=1)},attribute:function(a,l){"string"==typeof l&&(l=CKEDITOR.tools.htmlEncodeAttr(l),this.forceSimpleAmpersand&&(l=l.replace(/&/g,"\x26")));this._.output.push(" ",a,'\x3d"',l,'"')},closeTag:function(a){var l=this._.rules[a];l&&l.indent&&(this._.indentation=this._.indentation.substr(this.indentationChars.length));
|
|
884
|
+
this._.indent?this.indentation():l&&l.breakBeforeClose&&(this.lineBreak(),this.indentation());this._.output.push("\x3c/",a,"\x3e");"pre"==a&&(this._.inPre=0);l&&l.breakAfterClose&&(this.lineBreak(),this._.needsSpace=l.needsSpace);this._.afterCloser=1},text:function(a){this._.indent&&(this.indentation(),!this._.inPre&&(a=CKEDITOR.tools.ltrim(a)));this._.output.push(a)},comment:function(a){this._.indent&&this.indentation();this._.output.push("\x3c!--",a,"--\x3e")},lineBreak:function(){!this._.inPre&&
|
|
885
|
+
0<this._.output.length&&this._.output.push(this.lineBreakChars);this._.indent=1},indentation:function(){!this._.inPre&&this._.indentation&&this._.output.push(this._.indentation);this._.indent=0},reset:function(){this._.output=[];this._.indent=0;this._.indentation="";this._.afterCloser=0;this._.inPre=0;this._.needsSpace=0},setRules:function(a,l){var g=this._.rules[a];g?CKEDITOR.tools.extend(g,l,!0):this._.rules[a]=l}}});(function(){function a(a,e){var m,k;e.on("refresh",function(a){var b=[l],d;for(d in a.data.states)b.push(a.data.states[d]);
|
|
886
|
+
this.setState(CKEDITOR.tools.search(b,g)?g:l)},e,null,100);e.on("exec",function(e){m=a.getSelection();k=m.createBookmarks(1);e.data||(e.data={});e.data.done=!1},e,null,0);e.on("exec",function(){a.forceNextSelectionCheck();m.selectBookmarks(k)},e,null,100)}var l=CKEDITOR.TRISTATE_DISABLED,g=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indent",{init:function(f){var e=CKEDITOR.plugins.indent.genericDefinition;a(f,f.addCommand("indent",new e(!0)));a(f,f.addCommand("outdent",new e));f.ui.addButton&&(f.ui.addButton("Indent",
|
|
887
|
+
{label:f.lang.indent.indent,command:"indent",directional:!0,toolbar:"indent,20"}),f.ui.addButton("Outdent",{label:f.lang.indent.outdent,command:"outdent",directional:!0,toolbar:"indent,10"}));f.on("dirChanged",function(a){var e=f.createRange(),h=a.data.node;e.setStartBefore(h);e.setEndAfter(h);for(var b=new CKEDITOR.dom.walker(e),d;d=b.next();)if(d.type==CKEDITOR.NODE_ELEMENT)if(!d.equals(h)&&d.getDirection())e.setStartAfter(d),b=new CKEDITOR.dom.walker(e);else{var c=f.config.indentClasses;if(c)for(var g=
|
|
888
|
+
"ltr"==a.data.dir?["_rtl",""]:["","_rtl"],l=0;l<c.length;l++)d.hasClass(c[l]+g[0])&&(d.removeClass(c[l]+g[0]),d.addClass(c[l]+g[1]));c=d.getStyle("margin-right");g=d.getStyle("margin-left");c?d.setStyle("margin-left",c):d.removeStyle("margin-left");g?d.setStyle("margin-right",g):d.removeStyle("margin-right")}})}});CKEDITOR.plugins.indent={genericDefinition:function(a){this.isIndent=!!a;this.startDisabled=!this.isIndent},specificDefinition:function(a,e,g){this.name=e;this.editor=a;this.jobs={};this.enterBr=
|
|
889
|
+
a.config.enterMode==CKEDITOR.ENTER_BR;this.isIndent=!!g;this.relatedGlobal=g?"indent":"outdent";this.indentKey=g?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),d;for(d in e.jobs)b.on("exec",function(b){b.data.done||(a.fire("lockSnapshot"),e.execJob(a,d)&&(b.data.done=!0),a.fire("unlockSnapshot"),CKEDITOR.dom.element.clearAllMarkers(e.database))},this,null,d),b.on("refresh",function(b){b.data.states||
|
|
890
|
+
(b.data.states={});b.data.states[e.name+"@"+d]=e.refreshJob(a,d,b.data.path)},this,null,d);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 g=this.jobs[e];if(g.state!=l)return g.exec.call(this,a)},refreshJob:function(a,e,g){e=this.jobs[e];a.activeFilter.checkFeature(this)?e.state=e.refresh.call(this,a,g):e.state=l;return e.state},getContext:function(a){return a.contains(this.context)}}})();
|
|
891
|
+
(function(){function a(a){function b(b){for(var k=f.startContainer,l=f.endContainer;k&&!k.getParent().equals(b);)k=k.getParent();for(;l&&!l.getParent().equals(b);)l=l.getParent();if(!k||!l)return!1;for(var m=[],A=!1;!A;)k.equals(l)&&(A=!0),m.push(k),k=k.getNext();if(1>m.length)return!1;k=b.getParents(!0);for(l=0;l<k.length;l++)if(k[l].getName&&e[k[l].getName()]){b=k[l];break}for(var k=d.isIndent?1:-1,l=m[0],m=m[m.length-1],A=CKEDITOR.plugins.list.listToArray(b,c),w=A[m.getCustomData("listarray_index")].indent,
|
|
892
|
+
l=l.getCustomData("listarray_index");l<=m.getCustomData("listarray_index");l++)if(A[l].indent+=k,0<k){for(var u=A[l].parent,D=l-1;0<=D;D--)if(A[D].indent===k){u=A[D].parent;break}A[l].parent=new CKEDITOR.dom.element(u.getName(),u.getDocument())}for(l=m.getCustomData("listarray_index")+1;l<A.length&&A[l].indent>w;l++)A[l].indent+=k;k=CKEDITOR.plugins.list.arrayToList(A,c,null,a.config.enterMode,b.getDirection());if(!d.isIndent){var C;if((C=b.getParent())&&C.is("li"))for(var m=k.listNode.getChildren(),
|
|
893
|
+
B=[],r,l=m.count()-1;0<=l;l--)(r=m.getItem(l))&&r.is&&r.is("li")&&B.push(r)}k&&k.listNode.replace(b);if(B&&B.length)for(l=0;l<B.length;l++){for(r=b=B[l];(r=r.getNext())&&r.is&&r.getName()in e;)CKEDITOR.env.needsNbspFiller&&!b.getFirst(g)&&b.append(f.document.createText(" ")),b.append(r);b.insertAfter(C)}k&&a.fire("contentDomInvalidated");return!0}for(var d=this,c=this.database,e=this.context,f,k=a.getSelection(),k=(k&&k.getRanges()).createIterator();f=k.getNextRange();){for(var m=f.getCommonAncestor();m&&
|
|
894
|
+
(m.type!=CKEDITOR.NODE_ELEMENT||!e[m.getName()]);){if(a.editable().equals(m)){m=!1;break}m=m.getParent()}m||(m=f.startPath().contains(e))&&f.setEndAt(m,CKEDITOR.POSITION_BEFORE_END);if(!m){var 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 g(a){return f(a)&&e(a)}var f=CKEDITOR.dom.walker.whitespaces(!0),e=CKEDITOR.dom.walker.bookmark(!1,!0),m=CKEDITOR.TRISTATE_DISABLED,k=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(e){function b(b){d.specificDefinition.apply(this,
|
|
898
896
|
arguments);this.requiredContent=["ul","ol"];b.on("key",function(a){var d=b.elementPath();if("wysiwyg"==b.mode&&a.data.keyCode==this.indentKey&&d){var e=this.getContext(d);!e||this.isIndent&&CKEDITOR.plugins.indentList.firstItemInPath(this.context,d,e)||(b.execCommand(this.relatedGlobal),a.cancel())}},this);this.jobs[this.isIndent?10:30]={refresh:this.isIndent?function(a,b){var c=this.getContext(b),d=CKEDITOR.plugins.indentList.firstItemInPath(this.context,b,c);return c&&this.isIndent&&!d?k:m}:function(a,
|
|
899
897
|
b){return!this.getContext(b)||this.isIndent?m:k},exec:CKEDITOR.tools.bind(a,this)}}var d=CKEDITOR.plugins.indent;d.registerCommands(e,{indentlist:new b(e,"indentlist",!0),outdentlist:new b(e,"outdentlist")});CKEDITOR.tools.extend(b.prototype,d.specificDefinition.prototype,{context:{ol:1,ul:1}})}});CKEDITOR.plugins.indentList={};CKEDITOR.plugins.indentList.firstItemInPath=function(a,b,d){var c=b.contains(l);d||(d=b.contains(a));return d&&c&&c.equals(d.getFirst(l))}})();(function(){function a(a,e,b){if(!a.getCustomData("indent_processed")){var d=
|
|
900
898
|
this.editor,c=this.isIndent;if(e){d=a.$.className.match(this.classNameRegex);b=0;d&&(d=d[1],b=CKEDITOR.tools.indexOf(e,d)+1);if(0>(b+=c?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=d.config.indentOffset||40;isNaN(b)&&(b=0);b+=(c?1:-1)*f;if(0>b)return;b=Math.max(b,0);b=Math.ceil(b/f)*f;a.setStyle(e,b?b+(d.config.indentUnit||"px"):"");""===
|
|
901
|
-
a.getAttribute("style")&&a.removeAttribute("style")}CKEDITOR.dom.element.setMarker(this.database,a,"indent_processed",1)}}function l(a,e){return"ltr"==(e||a.getComputedStyle("direction"))?"margin-left":"margin-right"}var
|
|
899
|
+
a.getAttribute("style")&&a.removeAttribute("style")}CKEDITOR.dom.element.setMarker(this.database,a,"indent_processed",1)}}function l(a,e){return"ltr"==(e||a.getComputedStyle("direction"))?"margin-left":"margin-right"}var g=CKEDITOR.dtd.$listItem,f=CKEDITOR.dtd.$list,e=CKEDITOR.TRISTATE_DISABLED,m=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentblock",{requires:"indent",init:function(k){function h(){b.specificDefinition.apply(this,arguments);this.allowedContent={"div h1 h2 h3 h4 h5 h6 ol p pre ul":{propertiesOnly:!0,
|
|
902
900
|
styles:d?null:"margin-left,margin-right",classes:d||null}};this.contentTransformations=[["div: splitMarginShorthand"],["h1: splitMarginShorthand"],["h2: splitMarginShorthand"],["h3: splitMarginShorthand"],["h4: splitMarginShorthand"],["h5: splitMarginShorthand"],["h6: splitMarginShorthand"],["ol: splitMarginShorthand"],["p: splitMarginShorthand"],["pre: splitMarginShorthand"],["ul: splitMarginShorthand"]];this.enterBr&&(this.allowedContent.div=!0);this.requiredContent=(this.enterBr?"div":"p")+(d?
|
|
903
|
-
"("+d.join(",")+")":"{margin-left}");this.jobs={20:{refresh:function(a,b){var f=b.block||b.blockLimit;if(!f.is(
|
|
904
|
-
e&&e.getRanges()[0],
|
|
905
|
-
dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,p:1,pre:1,table:1},classNameRegex:d?new RegExp("(?:^|\\s+)("+d.join("|")+")(?\x3d$|\\s)"):null})}})})();CKEDITOR.plugins.add("taotab",{init:function(a){function l(a){var e,
|
|
906
|
-
a.getSelection(),m=e.getRanges(),k=new CKEDITOR.dom.text(e._.cache.nativeSel.focusNode),
|
|
907
|
-
a+4),m[0].setEnd(k,a+4);e.selectRanges([m[0]])}});a.ui.addButton("TaoTab",{label:a.lang.insertTab.button,command:"insertTab",icon:this.path+"images/taotab.png"})}});CKEDITOR.plugins.add("taountab",{init:function(a){a.addCommand("removeTab",{exec:function(a){var
|
|
908
|
-
e=
|
|
909
|
-
else{for(;!a.hasAttribute||!a.hasAttribute("align")&&!a.getStyle("text-align");){
|
|
901
|
+
"("+d.join(",")+")":"{margin-left}");this.jobs={20:{refresh:function(a,b){var f=b.block||b.blockLimit;if(!f.is(g))var h=f.getAscendant(g),f=h&&b.contains(h)||f;f.is(g)&&(f=f.getParent());if(this.enterBr||this.getContext(b)){if(d){var h=d,f=f.$.className.match(this.classNameRegex),k=this.isIndent,h=f?k?f[1]!=h.slice(-1):!0:k;return h?m:e}return this.isIndent?m:f?CKEDITOR[0>=(parseInt(f.getStyle(l(f)),10)||0)?"TRISTATE_DISABLED":"TRISTATE_OFF"]:e}return e},exec:function(b){var e=b.getSelection(),e=
|
|
902
|
+
e&&e.getRanges()[0],h;if(h=b.elementPath().contains(f))a.call(this,h,d);else for(e=e.createIterator(),b=b.config.enterMode,e.enforceRealBlocks=!0,e.enlargeBr=b!=CKEDITOR.ENTER_BR;h=e.getNextParagraph(b==CKEDITOR.ENTER_P?"p":"div");)h.isReadOnly()||a.call(this,h,d);return!0}}}}var b=CKEDITOR.plugins.indent,d=k.config.indentClasses;b.registerCommands(k,{indentblock:new h(k,"indentblock",!0),outdentblock:new h(k,"outdentblock")});CKEDITOR.tools.extend(h.prototype,b.specificDefinition.prototype,{context:{div:1,
|
|
903
|
+
dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,p:1,pre:1,table:1},classNameRegex:d?new RegExp("(?:^|\\s+)("+d.join("|")+")(?\x3d$|\\s)"):null})}})})();CKEDITOR.plugins.add("taotab",{init:function(a){function l(a){var e,g="";a=parseInt(a||4,10);for(e=0;e<a;e++)g+=String.fromCharCode(160);return g}function g(a){var e,l=[];for(e=0;e<a.childNodes.length;e++){var k=a.childNodes[e];k.nodeType===Node.TEXT_NODE?l.push(k):k.nodeType===Node.ELEMENT_NODE&&(l=l.concat(g(k)))}return l}a.addCommand("insertTab",{exec:function(a){var e=
|
|
904
|
+
a.getSelection(),m=e.getRanges(),k=new CKEDITOR.dom.text(e._.cache.nativeSel.focusNode),h=k.getText();if(null===h){k=g(m[0].root.$);a.insertHtml(l(4));a:{m=g(m[0].root.$);for(a=0;a<m.length;a++)if(!k[a]){m=m[a];break a}else if(!m[a].isEqualNode(k[a])){m=m[a];break a}m=void 0}k=new CKEDITOR.dom.text(m);m=e.getRanges();m[0].setStart(k,3);m[0].setEnd(k,3);e.selectRanges([m[0]]);m[0].setStart(k,4);m[0].setEnd(k,4)}else a=m[0].startOffset,k.setText([h.slice(0,a),l(4),h.slice(a)].join("")),m[0].setStart(k,
|
|
905
|
+
a+4),m[0].setEnd(k,a+4);e.selectRanges([m[0]])}});a.ui.addButton("TaoTab",{label:a.lang.insertTab.button,command:"insertTab",icon:this.path+"images/taotab.png"})}});CKEDITOR.plugins.add("taountab",{init:function(a){a.addCommand("removeTab",{exec:function(a){var g=a.getSelection();a=a.getSelection().getRanges();var f,e,m=new CKEDITOR.dom.text(g._.cache.nativeSel.focusNode),k=m.getText();if(null!==k){f=a[0].startOffset;a[0].setStart(m,Math.max(0,f-4));a[0].setEnd(m,Math.min(f+4,k.length));g.selectRanges([a[0]]);
|
|
906
|
+
e=g.getSelectedText();for(var h=0,b=-1,d=0;d<e.length;d++)if(" "===e.charAt(d)||e.charAt(d)===String.fromCharCode(160)){if(h||(b=d),h++,4===h)break}else h=0,b=-1;e=4===h?b:-1;0<=e&&(f=Math.max(0,f-4)+e,m.setText([k.slice(0,f),k.slice(f+4)].join("")));a[0].setStart(m,f);a[0].setEnd(m,f);g.selectRanges([a[0]])}}});a.ui.addButton("TaoUnTab",{label:a.lang.removeTab.button,command:"removeTab",icon:this.path+"images/taountab.png"})}});(function(){function a(a,e){e=void 0===e||e;var g;if(e)g=a.getComputedStyle("text-align");
|
|
907
|
+
else{for(;!a.hasAttribute||!a.hasAttribute("align")&&!a.getStyle("text-align");){g=a.getParent();if(!g)break;a=g}g=a.getStyle("text-align")||a.getAttribute("align")||""}g&&(g=g.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i,""));!g&&e&&(g="rtl"==a.getComputedStyle("direction")?"right":"left");return g}function l(a,e,g){this.editor=a;this.name=e;this.value=g;this.context="p";e=a.config.justifyClasses;var k=a.config.enterMode==CKEDITOR.ENTER_P?"p":"div";if(e){switch(g){case "left":this.cssClassName=
|
|
910
908
|
e[0];break;case "center":this.cssClassName=e[1];break;case "right":this.cssClassName=e[2];break;case "justify":this.cssClassName=e[3]}this.cssClassRegex=new RegExp("(?:^|\\s+)(?:"+e.join("|")+")(?\x3d$|\\s)");this.requiredContent=k+"("+this.cssClassName+")"}else this.requiredContent=k+"{text-align}";this.allowedContent={"caption div h1 h2 h3 h4 h5 h6 p pre td th li":{propertiesOnly:!0,styles:this.cssClassName?null:"text-align",classes:this.cssClassName||null}};a.config.enterMode==CKEDITOR.ENTER_BR&&
|
|
911
|
-
(this.allowedContent.div=!0)}function
|
|
912
|
-
"right"):"right"==b&&
|
|
913
|
-
|
|
914
|
-
this.cssClassName+")"):f.activeFilter.check(k+"{text-align}");
|
|
915
|
-
"justify");a.addCommand("justifyleft",e);a.addCommand("justifycenter",m);a.addCommand("justifyright",k);a.addCommand("justifyblock",
|
|
916
|
-
command:"justifyblock",toolbar:"align,40"}));a.on("dirChanged",
|
|
917
|
-
(new l(e)).rules;e=f.attributes;var b=
|
|
918
|
-
"data-cke-real-node-type":a.type,alt:d,title:d,align:a.getAttribute("align")||""};CKEDITOR.env.hc||(e.src=CKEDITOR.tools.transparentImageData);f&&(e["data-cke-real-element-type"]=f);b&&(e["data-cke-resizable"]=b,f=new l,b=a.getAttribute("width"),a=a.getAttribute("height"),b&&(f.rules.width=
|
|
919
|
-
c;c=new CKEDITOR.htmlParser.basicWriter;a.writeHtml(c);c=c.getHtml();e={"class":e,"data-cke-realelement":encodeURIComponent(c),"data-cke-real-node-type":a.type,alt:d,title:d,align:a.attributes.align||""};CKEDITOR.env.hc||(e.src=CKEDITOR.tools.transparentImageData);f&&(e["data-cke-real-element-type"]=f);b&&(e["data-cke-resizable"]=b,b=a.attributes,a=new l,f=b.width,b=b.height,void 0!==f&&(a.rules.width=
|
|
920
|
-
e)};CKEDITOR.editor.prototype.restoreRealElement=function(e){if(e.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var f=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(e.data("cke-realelement")),this.document);if(e.data("cke-resizable")){var
|
|
921
|
-
function l(a){for(var b=a.length,c=[],d,e=0;e<b;e++)d=a.charCodeAt(e),c.push(d);return"String.fromCharCode("+c.join(",")+")"}function
|
|
909
|
+
(this.allowedContent.div=!0)}function g(a){var e=a.editor,g=e.createRange();g.setStartBefore(a.data.node);g.setEndAfter(a.data.node);for(var k=new CKEDITOR.dom.walker(g),h;h=k.next();)if(h.type==CKEDITOR.NODE_ELEMENT)if(!h.equals(a.data.node)&&h.getDirection())g.setStartAfter(h),k=new CKEDITOR.dom.walker(g);else{var b=e.config.justifyClasses;b&&(h.hasClass(b[0])?(h.removeClass(b[0]),h.addClass(b[2])):h.hasClass(b[2])&&(h.removeClass(b[2]),h.addClass(b[0])));b=h.getStyle("text-align");"left"==b?h.setStyle("text-align",
|
|
910
|
+
"right"):"right"==b&&h.setStyle("text-align","left")}}l.prototype={exec:function(f){var e=f.getSelection(),g=f.config.enterMode;if(e){for(var k=e.createBookmarks(),h=e.getRanges(),b=this.cssClassName,d,c,l=f.config.useComputedState,l=void 0===l||l,p=h.length-1;0<=p;p--)for(d=h[p].createIterator(),d.enlargeBr=g!=CKEDITOR.ENTER_BR;c=d.getNextParagraph(g==CKEDITOR.ENTER_P?"p":"div");)if(!c.isReadOnly()){var q=c.getName(),t;t=f.activeFilter.check(q+"{text-align}");if((q=f.activeFilter.check(q+"("+b+")"))||
|
|
911
|
+
t){c.removeAttribute("align");c.removeStyle("text-align");var r=b&&(c.$.className=CKEDITOR.tools.ltrim(c.$.className.replace(this.cssClassRegex,""))),v=this.state==CKEDITOR.TRISTATE_OFF&&(!l||a(c,!0)!=this.value);b&&q?v?c.addClass(b):r||c.removeAttribute("class"):v&&t&&c.setStyle("text-align",this.value)}}f.focus();f.forceNextSelectionCheck();e.selectBookmarks(k)}},refresh:function(f,e){var g=e.block||e.blockLimit,k=g.getName(),h=g.equals(f.editable()),k=this.cssClassName?f.activeFilter.check(k+"("+
|
|
912
|
+
this.cssClassName+")"):f.activeFilter.check(k+"{text-align}");h&&!CKEDITOR.dtd.$list[e.lastElement.getName()]?this.setState(CKEDITOR.TRISTATE_OFF):!h&&k?this.setState(a(g,this.editor.config.useComputedState)==this.value?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)}};CKEDITOR.plugins.add("justify",{init:function(a){if(!a.blockless){var e=new l(a,"justifyleft","left"),m=new l(a,"justifycenter","center"),k=new l(a,"justifyright","right"),h=new l(a,"justifyblock",
|
|
913
|
+
"justify");a.addCommand("justifyleft",e);a.addCommand("justifycenter",m);a.addCommand("justifyright",k);a.addCommand("justifyblock",h);a.ui.addButton&&(a.ui.addButton("JustifyLeft",{label:a.lang.common.alignLeft,command:"justifyleft",toolbar:"align,10"}),a.ui.addButton("JustifyCenter",{label:a.lang.common.center,command:"justifycenter",toolbar:"align,20"}),a.ui.addButton("JustifyRight",{label:a.lang.common.alignRight,command:"justifyright",toolbar:"align,30"}),a.ui.addButton("JustifyBlock",{label:a.lang.common.justify,
|
|
914
|
+
command:"justifyblock",toolbar:"align,40"}));a.on("dirChanged",g)}}})})();(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,g=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=
|
|
915
|
+
(new l(e)).rules;e=f.attributes;var b=h.width,h=h.height;b&&(e.width=a(e.width,b));h&&(e.height=a(e.height,h))}return f}}};CKEDITOR.plugins.add("fakeobjects",{init:function(a){a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}","fakeobjects")},afterInit:function(a){(a=(a=a.dataProcessor)&&a.htmlFilter)&&a.addRules(e,{applyToAll:!0})}});CKEDITOR.editor.prototype.createFakeElement=function(a,e,f,b){var d=this.lang.fakeobjects,d=d[f]||d.unknown;e={"class":e,"data-cke-realelement":encodeURIComponent(a.getOuterHtml()),
|
|
916
|
+
"data-cke-real-node-type":a.type,alt:d,title:d,align:a.getAttribute("align")||""};CKEDITOR.env.hc||(e.src=CKEDITOR.tools.transparentImageData);f&&(e["data-cke-real-element-type"]=f);b&&(e["data-cke-resizable"]=b,f=new l,b=a.getAttribute("width"),a=a.getAttribute("height"),b&&(f.rules.width=g(b)),a&&(f.rules.height=g(a)),f.populate(e));return this.document.createElement("img",{attributes:e})};CKEDITOR.editor.prototype.createFakeParserElement=function(a,e,f,b){var d=this.lang.fakeobjects,d=d[f]||d.unknown,
|
|
917
|
+
c;c=new CKEDITOR.htmlParser.basicWriter;a.writeHtml(c);c=c.getHtml();e={"class":e,"data-cke-realelement":encodeURIComponent(c),"data-cke-real-node-type":a.type,alt:d,title:d,align:a.attributes.align||""};CKEDITOR.env.hc||(e.src=CKEDITOR.tools.transparentImageData);f&&(e["data-cke-real-element-type"]=f);b&&(e["data-cke-resizable"]=b,b=a.attributes,a=new l,f=b.width,b=b.height,void 0!==f&&(a.rules.width=g(f)),void 0!==b&&(a.rules.height=g(b)),a.populate(e));return new CKEDITOR.htmlParser.element("img",
|
|
918
|
+
e)};CKEDITOR.editor.prototype.restoreRealElement=function(e){if(e.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var f=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(e.data("cke-realelement")),this.document);if(e.data("cke-resizable")){var h=e.getStyle("width");e=e.getStyle("height");h&&f.setAttribute("width",a(f.getAttribute("width"),h));e&&f.setAttribute("height",a(f.getAttribute("height"),e))}return f}})();"use strict";(function(){function a(a){return a.replace(/'/g,"\\$\x26")}
|
|
919
|
+
function l(a){for(var b=a.length,c=[],d,e=0;e<b;e++)d=a.charCodeAt(e),c.push(d);return"String.fromCharCode("+c.join(",")+")"}function g(b,c){for(var d=b.plugins.link,e=d.compiledProtectionFunction.params,d=[d.compiledProtectionFunction.name,"("],f,h,g=0;g<e.length;g++)f=e[g].toLowerCase(),h=c[f],0<g&&d.push(","),d.push("'",h?a(encodeURIComponent(c[f])):"","'");d.push(")");return d.join("")}function f(a){a=a.config.emailProtection||"";var b;a&&"encode"!=a&&(b={},a.replace(/^([^(]+)\(([^)]+)\)$/,function(a,
|
|
922
920
|
c,d){b.name=c;b.params=[];d.replace(/[^,\s]+/g,function(a){b.params.push(a)})}));return b}CKEDITOR.plugins.add("link",{requires:"dialog,fakeobjects",onLoad:function(){function a(b){return c.replace(/%1/g,"rtl"==b?"right":"left").replace(/%2/g,"cke_contents_"+b)}var b="background:url("+CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png")+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",c=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+
|
|
923
921
|
b+"padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{"+b+"width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";CKEDITOR.addCss(a("ltr")+a("rtl"))},init:function(a){var b="a[!href]";CKEDITOR.dialog.isTabEnabled(a,"link","advanced")&&(b=b.replace("]",",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type,download]{*}(*)"));CKEDITOR.dialog.isTabEnabled(a,"link","target")&&(b=b.replace("]",",target,onclick]"));a.addCommand("link",new CKEDITOR.dialogCommand("link",{allowedContent:b,
|
|
924
922
|
requiredContent:"a[href]"}));a.addCommand("anchor",new CKEDITOR.dialogCommand("anchor",{allowedContent:"a[!name,id]",requiredContent:"a[name]"}));a.addCommand("unlink",new CKEDITOR.unlinkCommand);a.addCommand("removeAnchor",new CKEDITOR.removeAnchorCommand);a.setKeystroke(CKEDITOR.CTRL+76,"link");a.setKeystroke(CKEDITOR.CTRL+75,"link");a.ui.addButton&&(a.ui.addButton("Link",{label:a.lang.link.toolbar,command:"link",toolbar:"links,10"}),a.ui.addButton("Unlink",{label:a.lang.link.unlink,command:"unlink",
|
|
925
923
|
toolbar:"links,20"}),a.ui.addButton("Anchor",{label:a.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"}));CKEDITOR.dialog.add("link",this.path+"dialogs/link.js");CKEDITOR.dialog.add("anchor",this.path+"dialogs/anchor.js");a.on("doubleclick",function(b){var c=b.data.element.getAscendant({a:1,img:1},!0);c&&!c.isReadOnly()&&(c.is("a")?(b.data.dialog=!c.getAttribute("name")||c.getAttribute("href")&&c.getChildCount()?"link":"anchor",b.data.link=c):CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,
|
|
926
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",
|
|
927
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?
|
|
928
|
-
b.children.length?null:a.createFakeParserElement(b,"cke_anchor","anchor"):null}}});var b=a._.elementsPath&&a._.elementsPath.filters;b&&b.push(function(b,c){if("a"==c&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b)||b.getAttribute("name")&&(!b.getAttribute("href")||!b.getChildCount())))return"anchor"})}});var e=/^javascript:/,m=/^(?:mailto)(?:(?!\?(subject|body)=).)+/i,k=/subject=([^;?:@&=$,\/]*)/i,
|
|
929
|
-
n=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
|
|
930
|
-
rel:"advRel"};CKEDITOR.plugins.link={getSelectedLink:function(a,b){var c=a.getSelection(),d=c.getSelectedElement(),e=c.getRanges(),f=[],
|
|
926
|
+
b.children.length?null:a.createFakeParserElement(b,"cke_anchor","anchor"):null}}});var b=a._.elementsPath&&a._.elementsPath.filters;b&&b.push(function(b,c){if("a"==c&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b)||b.getAttribute("name")&&(!b.getAttribute("href")||!b.getChildCount())))return"anchor"})}});var e=/^javascript:/,m=/^(?:mailto)(?:(?!\?(subject|body)=).)+/i,k=/subject=([^;?:@&=$,\/]*)/i,h=/body=([^;?:@&=$,\/]*)/i,b=/^#(.*)$/,d=/^((?:http|https|ftp|news):\/\/)?(.*)$/,c=/^(_(?:self|top|parent|blank))$/,
|
|
927
|
+
n=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,p=/^javascript:([^(]+)\(([^)]+)\)$/,q=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,t=/(?:^|,)([^=]+)=(\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
|
+
rel:"advRel"};CKEDITOR.plugins.link={getSelectedLink:function(a,b){var c=a.getSelection(),d=c.getSelectedElement(),e=c.getRanges(),f=[],h;if(!b&&d&&d.is("a"))return d;for(d=0;d<e.length;d++)if(h=c.getRanges()[d],h.shrink(CKEDITOR.SHRINK_ELEMENT,!0,{skipBogus:!0}),(h=a.elementPath(h.getCommonAncestor()).contains("a",1))&&b)f.push(h);else if(h)return h;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"),
|
|
931
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}},
|
|
932
|
-
parseLinkAttributes:function(a,f){var
|
|
933
|
-
"").replace(/\\'/g,"'"),f=e(f),e=l.params[
|
|
934
|
-
D[2]);if(f){if(
|
|
935
|
-
(
|
|
936
|
-
m=encodeURIComponent(
|
|
937
|
-
"","', '"],n="resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "),f=n.length,k=function(a){c.target[a]&&n.push(a+"\x3d"+c.target[a])},
|
|
938
|
-
(e["data-cke-saved-name"]=e.name)}e["data-cke-saved-href"]&&(e.href=e["data-cke-saved-href"]);
|
|
930
|
+
parseLinkAttributes:function(a,f){var g=f&&(f.data("cke-saved-href")||f.getAttribute("href"))||"",l=a.plugins.link.compiledProtectionFunction,w=a.config.emailProtection,u={},D;g.match(e)&&("encode"==w?g=g.replace(n,function(a,b,c){c=c||"";return"mailto:"+String.fromCharCode.apply(String,b.split(","))+c.replace(/\\'/g,"'")}):w&&g.replace(p,function(a,b,c){if(b==l.name){u.type="email";a=u.email={};b=/(^')|('$)/g;c=c.match(/[^,\s]+/g);for(var d=c.length,e,f,h=0;h<d;h++)e=decodeURIComponent,f=c[h].replace(b,
|
|
931
|
+
"").replace(/\\'/g,"'"),f=e(f),e=l.params[h].toLowerCase(),a[e]=f;a.address=[a.name,a.domain].join("@")}}));if(!u.type)if(w=g.match(b))u.type="anchor",u.anchor={},u.anchor.name=u.anchor.id=w[1];else if(w=g.match(r))u.type="tel",u.tel=w[1];else if(w=g.match(m)){D=g.match(k);var g=g.match(h),C=u.email={};u.type="email";C.address=w[0].replace("mailto:","");D&&(C.subject=decodeURIComponent(D[1]));g&&(C.body=decodeURIComponent(g[1]))}else g&&(D=g.match(d))&&(u.type="url",u.url={},u.url.protocol=D[1],u.url.url=
|
|
932
|
+
D[2]);if(f){if(g=f.getAttribute("target"))u.target={type:g.match(c)?g:"frame",name:g};else if(g=(g=f.data("cke-pa-onclick")||f.getAttribute("onclick"))&&g.match(q))for(u.target={type:"popup",name:g[1]};w=t.exec(g[2]);)"yes"!=w[2]&&"1"!=w[2]||w[1]in{height:1,width:1,top:1,left:1}?isFinite(w[2])&&(u.target[w[1]]=w[2]):u.target[w[1]]=!0;null!==f.getAttribute("download")&&(u.download=!0);var g={},B;for(B in v)(w=f.getAttribute(B))&&(g[v[B]]=w);if(B=f.data("cke-saved-name")||g.advName)g.advName=B;CKEDITOR.tools.isEmpty(g)||
|
|
933
|
+
(u.advanced=g)}return u},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 h=c.email,f=h.address;switch(d){case "":case "encode":var k=encodeURIComponent(h.subject||""),
|
|
934
|
+
m=encodeURIComponent(h.body||""),h=[];k&&h.push("subject\x3d"+k);m&&h.push("body\x3d"+m);h=h.length?"?"+h.join("\x26"):"";"encode"==d?(d=["javascript:void(location.href\x3d'mailto:'+",l(f)],h&&d.push("+'",a(h),"'"),d.push(")")):d=["mailto:",f,h];break;default:d=f.split("@",2),h.name=d[0],h.domain=d[1],d=["javascript:",g(b,h)]}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
|
+
"","', '"],n="resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "),f=n.length,k=function(a){c.target[a]&&n.push(a+"\x3d"+c.target[a])},h=0;h<f;h++)n[h]+=c.target[n[h]]?"\x3dyes":"\x3dno";k("width");k("left");k("height");k("top");d.push(n.join(","),"'); return false;");e["data-cke-pa-onclick"]=d.join("")}else"notSet"!=c.target.type&&c.target.name&&(e.target=c.target.name);c.download&&(e.download="");if(c.advanced){for(var r in v)(d=c.advanced[v[r]])&&(e[r]=d);e.name&&
|
|
936
|
+
(e["data-cke-saved-name"]=e.name)}e["data-cke-saved-href"]&&(e.href=e["data-cke-saved-href"]);r={target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1,download:1};c.advanced&&CKEDITOR.tools.extend(r,v);for(var p in e)delete r[p];return{set:e,removed:CKEDITOR.tools.object.keys(r)}},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||
|
|
939
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),
|
|
940
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()?
|
|
941
|
-
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=[],
|
|
942
|
-
0;
|
|
943
|
-
e=c.listNode.getChildCount(),
|
|
944
|
-
0;
|
|
945
|
-
c.remove()),a.appendTo(
|
|
946
|
-
(f.push(
|
|
947
|
-
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"](
|
|
948
|
-
CKEDITOR.dtd.$block||a.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[a.getName()]["#"]}function
|
|
949
|
-
|
|
950
|
-
a.editable();d.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=function(a){return
|
|
951
|
-
CKEDITOR.plugins.list={listToArray:function(a,b,c,e,f){if(!d[a.getName()])return[];e||(e=0);c||(c=[]);for(var
|
|
952
|
-
b&&CKEDITOR.dom.element.setMarker(b,k,"listarray_index",c.length);c.push(l);for(var m=0,n=k.getChildCount(),
|
|
953
|
-
a[m];
|
|
954
|
-
|
|
955
|
-
1));else if(N.type==CKEDITOR.NODE_ELEMENT&&N.isBlockBoundary()){l&&!N.getDirection()&&N.setAttribute("dir",
|
|
956
|
-
S&&((E||
|
|
957
|
-
(CKEDITOR.dom.element.clearMarkers(b,a),a.getName()in CKEDITOR.dtd.$listItem&&(c=a,
|
|
958
|
-
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
|
|
959
|
-
CKEDITOR.ENTER_BR?n.appendBogus():
|
|
960
|
-
this.state==CKEDITOR.TRISTATE_OFF;
|
|
961
|
-
|
|
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=[],h=
|
|
940
|
+
0;h<b.contents.length;h++){var g=b.contents[h];(g=g.getAscendant("li",!0))&&!g.getCustomData("list_item_processed")&&(f.push(g),CKEDITOR.dom.element.setMarker(c,g,"list_item_processed",!0))}for(var g=b.root.getDocument(),k,l,h=0;h<f.length;h++){var m=f[h].getCustomData("listarray_index");k=e[m].parent;k.is(this.type)||(l=g.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
|
+
e=c.listNode.getChildCount(),h=0;h<e&&(n=c.listNode.getChild(h));h++)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 h=e.createElement("div");d[0].moveChildren&&d[0].moveChildren(h);d[0].append(h);d[0]=h}b=b.contents[0].getParent();for(h=0;h<d.length;h++)b=b.getCommonAncestor(d[h].getParent());a=a.config.useComputedState;var g,k;a=void 0===a||a;for(h=
|
|
942
|
+
0;h<d.length;h++)for(var l=d[h],m;m=l.getParent();){if(m.equals(b)){f.push(l);!k&&l.getDirection()&&(k=1);l=l.getDirection(a);null!==g&&(g=g&&g!=l?null:l);break}l=m}if(!(1>f.length)){d=f[f.length-1].getNext();h=e.createElement(this.type);for(c.push(h);f.length;)c=f.shift(),a=e.createElement("li"),l=c,l.is("pre")||t.test(l.getName())||"false"==l.getAttribute("contenteditable")?c.appendTo(a):(c.copyAttributes(a),g&&c.getDirection()&&(a.removeStyle("direction"),a.removeAttribute("dir")),c.moveChildren(a),
|
|
943
|
+
c.remove()),a.appendTo(h);g&&k&&h.setAttribute("dir",g);d?h.insertBefore(d):h.appendTo(b)}}function g(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=[],h=0;h<b.contents.length;h++){var g=b.contents[h];(g=g.getAscendant("li",!0))&&!g.getCustomData("list_item_processed")&&
|
|
944
|
+
(f.push(g),CKEDITOR.dom.element.setMarker(c,g,"list_item_processed",!0))}g=null;for(h=0;h<f.length;h++)g=f[h].getCustomData("listarray_index"),e[g].indent=-1;for(h=g+1;h<e.length;h++)if(e[h].indent>e[h-1].indent+1){f=e[h-1].indent+1-e[h].indent;for(g=e[h].indent;e[h]&&e[h].indent>=g;)e[h].indent+=f,h++;h--}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"](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"](p);d&&d.type==CKEDITOR.NODE_ELEMENT&&d.is(a.getName())&&(e(a,d,null,!c),a.remove(),a=d)}b();b(1)}function k(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.getName()in
|
|
946
|
+
CKEDITOR.dtd.$block||a.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[a.getName()]["#"]}function h(a,c,d){a.fire("saveSnapshot");d.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var f=d.extractContents();c.trim(!1,!0);var h=c.createBookmark(),g=new CKEDITOR.dom.elementPath(c.startContainer),k=g.block,g=g.lastElement.getAscendant("li",1)||k,l=new CKEDITOR.dom.elementPath(d.startContainer),n=l.contains(CKEDITOR.dtd.$listItem),l=l.contains(CKEDITOR.dtd.$list);k?(k=k.getBogus())&&k.remove():l&&(k=l.getPrevious(p))&&
|
|
947
|
+
q(k)&&k.remove();(k=f.getLast())&&k.type==CKEDITOR.NODE_ELEMENT&&k.is("br")&&k.remove();(k=c.startContainer.getChild(c.startOffset))?f.insertBefore(k):c.startContainer.append(f);n&&(f=b(n))&&(g.contains(n)?(e(f,n.getParent(),n),f.remove()):g.append(f));for(;d.checkStartOfBlock()&&d.checkEndOfBlock();){l=d.startPath();f=l.block;if(!f)break;f.is("li")&&(g=f.getParent(),f.equals(g.getLast(p))&&f.equals(g.getFirst(p))&&(f=g));d.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START);f.remove()}d=d.clone();f=
|
|
948
|
+
a.editable();d.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=function(a){return p(a)&&!q(a)};(d=d.next())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getName()in CKEDITOR.dtd.$list&&m(d);c.moveToBookmark(h);c.select();a.fire("saveSnapshot")}function b(a){return(a=a.getLast(p))&&a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in d?a:null}var d={ol:1,ul:1},c=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(),p=function(a){return!(c(a)||n(a))},q=CKEDITOR.dom.walker.bogus();
|
|
949
|
+
CKEDITOR.plugins.list={listToArray:function(a,b,c,e,f){if(!d[a.getName()])return[];e||(e=0);c||(c=[]);for(var h=0,g=a.getChildCount();h<g;h++){var k=a.getChild(h);k.type==CKEDITOR.NODE_ELEMENT&&k.getName()in CKEDITOR.dtd.$list&&CKEDITOR.plugins.list.listToArray(k,b,c,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",c.length);c.push(l);for(var m=0,n=k.getChildCount(),r;m<n;m++)r=k.getChild(m),r.type==CKEDITOR.NODE_ELEMENT&&d[r.getName()]?CKEDITOR.plugins.list.listToArray(r,b,c,e+1,l.grandparent):l.contents.push(r)}}return c},arrayToList:function(a,b,c,e,f){c||(c=0);if(!a||a.length<c+1)return null;for(var h,g=a[c].parent.getDocument(),k=new CKEDITOR.dom.documentFragment(g),l=null,m=c,r=Math.max(a[c].indent,0),q=null,t,E,M=e==CKEDITOR.ENTER_P?"p":"div";;){var I=
|
|
951
|
+
a[m];h=I.grandparent;t=I.element.getDirection(1);if(I.indent==r){l&&a[m].parent.getName()==l.getName()||(l=a[m].parent.clone(!1,1),f&&l.setAttribute("dir",f),k.append(l));q=l.append(I.element.clone(0,1));t!=l.getDirection(1)&&q.setAttribute("dir",t);for(h=0;h<I.contents.length;h++)q.append(I.contents[h].clone(1,1));m++}else if(I.indent==Math.max(r,0)+1)I=a[m-1].element.getDirection(1),m=CKEDITOR.plugins.list.arrayToList(a,null,m,e,I!=t?t:null),!q.getChildCount()&&CKEDITOR.env.needsNbspFiller&&7>=
|
|
952
|
+
g.$.documentMode&&q.append(g.createText(" ")),q.append(m.listNode),m=m.nextIndex;else if(-1==I.indent&&!c&&h){d[h.getName()]?(q=I.element.clone(!1,!0),t!=h.getDirection(1)&&q.setAttribute("dir",t)):q=new CKEDITOR.dom.documentFragment(g);var l=h.getDirection(1)!=t,J=I.element,F=J.getAttribute("class"),L=J.getAttribute("style"),P=q.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(e!=CKEDITOR.ENTER_BR||l||L||F),N,Y=I.contents.length,S;for(h=0;h<Y;h++)if(N=I.contents[h],n(N)&&1<Y)P?S=N.clone(1,1):q.append(N.clone(1,
|
|
953
|
+
1));else if(N.type==CKEDITOR.NODE_ELEMENT&&N.isBlockBoundary()){l&&!N.getDirection()&&N.setAttribute("dir",t);E=N;var Z=J.getAttribute("style");Z&&E.setAttribute("style",Z.replace(/([^;])$/,"$1;")+(E.getAttribute("style")||""));F&&N.addClass(F);E=null;S&&(q.append(S),S=null);q.append(N.clone(1,1))}else P?(E||(E=g.createElement(M),q.append(E),l&&E.setAttribute("dir",t)),L&&E.setAttribute("style",L),F&&E.setAttribute("class",F),S&&(E.append(S),S=null),E.append(N.clone(1,1))):q.append(N.clone(1,1));
|
|
954
|
+
S&&((E||q).append(S),S=null);q.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&m!=a.length-1&&(CKEDITOR.env.needsBrFiller&&(t=q.getLast())&&t.type==CKEDITOR.NODE_ELEMENT&&t.is("br")&&t.remove(),(t=q.getLast(p))&&t.type==CKEDITOR.NODE_ELEMENT&&t.is(CKEDITOR.dtd.$block)||q.append(g.createElement("br")));t=q.$.nodeName.toLowerCase();"div"!=t&&"p"!=t||q.appendBogus();k.append(q);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&&(c=a,g=f=e=void 0,e=c.getDirection()))){for(f=c.getParent();f&&!(g=f.getDirection());)f=f.getParent();e==g&&c.removeAttribute("dir")}a=a.getNextSourceNode()}return{listNode:k,nextIndex:m}}};var t=/^h[1-6]$/,r=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);f.prototype={exec:function(b){function c(a){return d[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 h=b.config,k=b.getSelection(),u=k&&k.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF){var n=b.editable();if(n.getFirst(p)){var r=1==u.length&&u[0];(h=r&&r.getEnclosedNode())&&h.is&&this.type==h.getName()&&this.setState(CKEDITOR.TRISTATE_ON)}else h.enterMode==
|
|
957
|
+
CKEDITOR.ENTER_BR?n.appendBogus():u[0].fixBlock(1,h.enterMode==CKEDITOR.ENTER_P?"p":"div"),k.selectRanges(u)}for(var h=k.createBookmarks(!0),n=[],B={},u=u.createIterator(),q=0;(r=u.getNextRange())&&++q;){var t=r.getBoundaryNodes(),H=t.startNode,E=t.endNode;H.type==CKEDITOR.NODE_ELEMENT&&"td"==H.getName()&&r.setStartAt(t.startNode,CKEDITOR.POSITION_AFTER_START);E.type==CKEDITOR.NODE_ELEMENT&&"td"==E.getName()&&r.setEndAt(t.endNode,CKEDITOR.POSITION_BEFORE_END);r=r.createIterator();for(r.forceBrBreak=
|
|
958
|
+
this.state==CKEDITOR.TRISTATE_OFF;t=r.getNextParagraph();)if(!t.getCustomData("list_block")&&!f(t)){CKEDITOR.dom.element.setMarker(B,t,"list_block",1);for(var M=b.elementPath(t),H=M.elements,E=0,M=M.blockLimit,I,J=H.length-1;0<=J&&(I=H[J]);J--)if(d[I.getName()]&&M.contains(I)){M.removeCustomData("list_group_object_"+q);(H=I.getCustomData("list_group_object"))?H.contents.push(t):(H={root:I,contents:[t]},n.push(H),CKEDITOR.dom.element.setMarker(B,I,"list_group_object",H));E=1;break}E||(E=M,E.getCustomData("list_group_object_"+
|
|
959
|
+
q)?E.getCustomData("list_group_object_"+q).contents.push(t):(H={root:E,contents:[t]},CKEDITOR.dom.element.setMarker(B,E,"list_group_object_"+q,H),n.push(H)))}}for(I=[];0<n.length;)H=n.shift(),this.state==CKEDITOR.TRISTATE_OFF?c(H)||(d[H.root.getName()]?a.call(this,b,H,B,I):l.call(this,b,H,I)):this.state==CKEDITOR.TRISTATE_ON&&d[H.root.getName()]&&!c(H)&&g.call(this,b,H,B);for(J=0;J<I.length;J++)m(I[J]);CKEDITOR.dom.element.clearAllMarkers(B);k.selectBookmarks(h);b.focus()},refresh:function(a,b){var c=
|
|
962
960
|
b.contains(d,1),e=b.blockLimit||b.root;c&&e.contains(c)?this.setState(c.is(this.type)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.plugins.add("list",{requires:"indentlist",init:function(a){a.blockless||(a.addCommand("numberedlist",new f("numberedlist","ol")),a.addCommand("bulletedlist",new f("bulletedlist","ul")),a.ui.addButton&&(a.ui.addButton("NumberedList",{label:a.lang.list.numberedlist,command:"numberedlist",directional:!0,toolbar:"list,10"}),a.ui.addButton("BulletedList",
|
|
963
|
-
{label:a.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),a.on("key",function(c){var e=c.data.domEvent.getKey(),f;if("wysiwyg"==a.mode&&e in{8:1,46:1}){var
|
|
964
|
-
CKEDITOR.START)&&(B=B.getParent())&&B.is("li")&&(B=b(B))?(f=B,B=B.getPrevious(
|
|
965
|
-
if(f)
|
|
966
|
-
(l=2),l&&B){
|
|
967
|
-
B.is(d)&&(B=B.getFirst(
|
|
961
|
+
{label:a.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),a.on("key",function(c){var e=c.data.domEvent.getKey(),f;if("wysiwyg"==a.mode&&e in{8:1,46:1}){var g=a.getSelection().getRanges()[0],l=g&&g.startPath();if(g&&g.collapsed){var m=8==e,n=a.editable(),r=new CKEDITOR.dom.walker(g.clone());r.evaluator=function(a){return p(a)&&!q(a)};r.guard=function(a,b){return!(b&&a.type==CKEDITOR.NODE_ELEMENT&&a.is("table"))};e=g.clone();if(m){var B;(B=l.contains(d))&&g.checkBoundaryOfElement(B,
|
|
962
|
+
CKEDITOR.START)&&(B=B.getParent())&&B.is("li")&&(B=b(B))?(f=B,B=B.getPrevious(p),e.moveToPosition(B&&q(B)?B:f,CKEDITOR.POSITION_BEFORE_START)):(r.range.setStartAt(n,CKEDITOR.POSITION_AFTER_START),r.range.setEnd(g.startContainer,g.startOffset),(B=r.previous())&&B.type==CKEDITOR.NODE_ELEMENT&&(B.getName()in d||B.is("li"))&&(B.is("li")||(r.range.selectNodeContents(B),r.reset(),r.evaluator=k,B=r.previous()),f=B,e.moveToElementEditEnd(f),e.moveToPosition(e.endPath().block,CKEDITOR.POSITION_BEFORE_END)));
|
|
963
|
+
if(f)h(a,e,g),c.cancel();else{var t=l.contains(d);t&&g.checkBoundaryOfElement(t,CKEDITOR.START)&&(f=t.getFirst(p),g.checkBoundaryOfElement(f,CKEDITOR.START)&&(B=t.getPrevious(p),b(f)?B&&(g.moveToElementEditEnd(B),g.select()):a.execCommand("outdent"),c.cancel()))}}else if(f=l.contains("li")){if(r.range.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),m=(n=f.getLast(p))&&k(n)?n:f,l=0,(B=r.next())&&B.type==CKEDITOR.NODE_ELEMENT&&B.getName()in d&&B.equals(n)?(l=1,B=r.next()):g.checkBoundaryOfElement(m,CKEDITOR.END)&&
|
|
964
|
+
(l=2),l&&B){g=g.clone();g.moveToElementEditStart(B);if(1==l&&(e.optimize(),!e.startContainer.equals(f))){for(f=e.startContainer;f.is(CKEDITOR.dtd.$inline);)t=f,f=f.getParent();t&&e.moveToPosition(t,CKEDITOR.POSITION_AFTER_END)}2==l&&(e.moveToPosition(e.endPath().block,CKEDITOR.POSITION_BEFORE_END),g.endPath().block&&g.moveToPosition(g.endPath().block,CKEDITOR.POSITION_AFTER_START));h(a,e,g);c.cancel()}}else r.range.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),(B=r.next())&&B.type==CKEDITOR.NODE_ELEMENT&&
|
|
965
|
+
B.is(d)&&(B=B.getFirst(p),l.block&&g.checkStartOfBlock()&&g.checkEndOfBlock()?(l.block.remove(),g.moveToElementEditStart(B),g.select()):b(B)?(g.moveToElementEditStart(B),g.select()):(g=g.clone(),g.moveToElementEditStart(B),h(a,e,g)),c.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]",
|
|
968
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,
|
|
969
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)&&
|
|
970
|
-
c.equals(b.getNext(function(a){return!(O(a)||Q(a)||
|
|
971
|
-
b.type==CKEDITOR.NODE_TEXT&&!O(b)||n(b)&&!
|
|
968
|
+
c.equals(b.getNext(function(a){return!(O(a)||Q(a)||p(a))}))}function l(a){this.upper=a[0];this.lower=a[1];this.set.apply(this,a.slice(2))}function g(a){var b=a.element;if(b&&n(b)&&(b=b.getAscendant(a.triggers,!0))&&a.editable.contains(b)){var c=k(b);if("true"==c.getAttribute("contenteditable"))return b;if(c.is(a.triggers))return c}return null}function f(a,b,c){A(a,b);A(a,c);a=b.size.bottom;c=c.size.top;return a&&c?0|(a+c)/2:a||c}function e(a,b,d){return b=b[d?"getPrevious":"getNext"](function(b){return b&&
|
|
969
|
+
b.type==CKEDITOR.NODE_TEXT&&!O(b)||n(b)&&!p(b)&&!c(a,b)})}function m(a,b,c){return a>b&&a<c}function k(a,b){if(a.data("cke-editable"))return null;for(b||(a=a.getParent());a&&!a.data("cke-editable");){if(a.hasAttribute("contenteditable"))return a;a=a.getParent()}return null}function h(a){var c=a.doc,d=G('\x3cspan contenteditable\x3d"false" data-cke-magic-line\x3d"1" style\x3d"'+ca+"position:absolute;border-top:1px dashed "+a.boxColor+'"\x3e\x3c/span\x3e',c),e=CKEDITOR.getUrl(this.path+"images/"+(K.hidpi?
|
|
972
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:ca+"height:17px;width:17px;"+(a.rtl?"left":"right")+":17px;background:url("+e+") center no-repeat "+a.boxColor+";cursor:pointer;"+(K.hc?"font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;":"")+(K.hidpi?
|
|
973
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"]})],
|
|
974
|
-
detach:function(){this.wrap.getParent()&&this.wrap.remove();return this},mouseNear:function(){A(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,
|
|
975
|
-
(a.inInlineMode?b.editable.left+b.editable.border.left:0),k.width=
|
|
972
|
+
detach:function(){this.wrap.getParent()&&this.wrap.remove();return this},mouseNear:function(){A(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,h=e||f,g=h.getParent(),k={};this.trigger=d;e&&A(a,e,!0);f&&A(a,f,!0);A(a,g,!0);a.inInlineMode&&w(a,!0);g.equals(c)?(k.left=b.scroll.x,k.right=-b.scroll.x,k.width=""):(k.left=h.size.left-h.size.margin.left+b.scroll.x-
|
|
973
|
+
(a.inInlineMode?b.editable.left+b.editable.border.left:0),k.width=h.size.outerWidth+h.size.margin.left+h.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(P)||m(k.top,b.scroll.y-15,b.scroll.y+5)?(k.top=a.inInlineMode?
|
|
976
974
|
0:b.scroll.y,this.look(P)):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,
|
|
977
975
|
c;b--;)(c=this.lineChildren[b]).setAttribute("style",c.base+c.looks[0|a/2]);this.oldLook=a}},wrap:new B("span",a.doc)});for(c=d.lineChildren.length;c--;)d.lineChildren[c].appendTo(d);d.look(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(I)?"insertBefore":"insertAfter"](c.is(I)?c.lower:c.upper)},!0);a.editor.focus();K.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();c.data.preventDefault(!0)});d.on("mousedown",
|
|
978
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;K.ie&&a.enterMode==CKEDITOR.ENTER_BR?f=a.doc.createText(S):(f=(f=k(a.element,!0))&&f.data("cke-enter-mode")||a.enterMode,f=new B(M[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 d(a,c){return{canUndo:!0,modes:{wysiwyg:1},
|
|
979
|
-
exec:function(){function d(e){var f=K.ie&&9>K.version?" ":S,
|
|
980
|
-
if(!
|
|
981
|
-
a.$}function
|
|
982
|
-
!b.is(ha)});if(!b)return!1;A(a,b);return c?b.size.top>a.mouse.y:b.size.bottom<a.mouse.y}function y(a){var b=a.editable,d=a.mouse,e=a.view,f=a.triggerOffset;
|
|
983
|
-
0,b.size.top+f)?(a=a.inInlineMode||0===e.scroll.y?P:Y,new l([null,b,I,L,a])):
|
|
984
|
-
v(a,f,
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
b){a.view||(a.view={});var c=a.view;if(!(!b&&c&&c.date>new Date-ba)){var d=a.win,c=d.getScrollPosition(),d=d.getViewPaneSize();C(a.view,{scroll:{x:c.x,y:c.y,width:a.doc.$.documentElement.scrollWidth-d.width,height:a.doc.$.documentElement.scrollHeight-d.height},pane:{width:d.width,height:d.height,bottom:d.height+c.y},date:+new Date},!0)}}function D(a,b,c,d){for(var e=d,f=d,
|
|
988
|
-
!k&&
|
|
989
|
-
v,D,B;m.isRelevant=function(a){return n(a)&&!c(m,a)&&!
|
|
990
|
-
(m.line.detach(),a.once("getData",function(){m.line.attach()},null,null,1E3))},null,null,0),k.attachListener(m.inInlineMode?n:n.getWindow().getFrame(),"mouseout",function(b){if("wysiwyg"==a.mode)if(m.inInlineMode){var c=b.data.$.clientX;b=b.data.$.clientY;
|
|
991
|
-
0}),k.attachListener(k,"keydown",function(b){if("wysiwyg"==a.mode)switch(b.data.getKeystroke()){case 2228240:case 16:m.hiddenMode=1,m.line.detach()}}),k.attachListener(m.inInlineMode?k:n,"mousemove",function(b){D=!0;if("wysiwyg"==a.mode&&!a.readOnly&&!B){var c={x:b.data.$.clientX,y:b.data.$.clientY};B=setTimeout(function(){m.mouse=c;B=m.trigger=null;
|
|
992
|
-
m.line.attach().place():(m.trigger=null,m.line.detach()),D=!1)},30)}}),k.attachListener(
|
|
993
|
-
d(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:c,getAscendantTrigger:
|
|
994
|
-
triggerEdge:
|
|
995
|
-
ea="\x3cspan\x3e"+S+"\x3c/span\x3e";M[CKEDITOR.ENTER_BR]="br";M[CKEDITOR.ENTER_P]="p";M[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,d,e){if(!b.mouse)return null;var f=b.doc,
|
|
996
|
-
|
|
997
|
-
else
|
|
998
|
-
b){return!(b&&b.type==CKEDITOR.NODE_TEXT||Q(b)||
|
|
999
|
-
e){return CKEDITOR.tools.array.filter(a,function(a){return a.canHandle(e)}).sort(function(a,d){return a.priority===d.priority?0:a.priority-d.priority})}function l(a,e){var b=a.shift();b&&b.handle(e,function(){l(a,e)})}function
|
|
1000
|
-
0===a.length)return!0;d=CKEDITOR.tools.array.filter(a,function(a){return-1===CKEDITOR.tools.array.indexOf(e,a)});if(0<d.length)for(c=0;c<d.length;c++)(function(a){CKEDITOR.scriptLoader.queue(a,function(c){c&&e.push(a);++b===d.length&&f()})})(d[c]);return 0===d.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(
|
|
1001
|
-
|
|
1002
|
-
k;b&&(a=b(a,c));CKEDITOR.tools.array.forEach(e,function(b){
|
|
977
|
+
exec:function(){function d(e){var f=K.ie&&9>K.version?" ":S,h=a.hotNode&&a.hotNode.getText()==f&&a.element.equals(a.hotNode)&&a.lastCmdDirection===!!c;b(a,function(b){h&&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});K.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=k(b))&&"false"==f.getAttribute("contenteditable")&&(b=f);a.element=b;f=e(a,b,!c);var h;n(f)&&f.is(a.triggers)&&f.is(W)&&(!e(a,f,!c)||(h=e(a,f,!c))&&n(h)&&h.is(a.triggers))?d(f):(h=g(a,b),n(h)&&(e(a,h,!c)?(b=e(a,h,!c))&&n(b)&&b.is(a.triggers)&&d(h):d(h)))}}}()}}function c(a,b){if(!b||b.type!=CKEDITOR.NODE_ELEMENT||!b.$)return!1;var c=a.line;return c.wrap.equals(b)||c.wrap.contains(b)}function n(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&
|
|
979
|
+
a.$}function p(a){if(!n(a))return!1;var b;(b=q(a))||(n(a)?(b={left:1,right:1,center:1},b=!(!b[a.getComputedStyle("float")]&&!b[a.getAttribute("align")])):b=!1);return b}function q(a){return!!{absolute:1,fixed:1}[a.getComputedStyle("position")]}function t(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(ha)});if(!b)return!1;A(a,b);return c?b.size.top>a.mouse.y:b.size.bottom<a.mouse.y}function y(a){var b=a.editable,d=a.mouse,e=a.view,f=a.triggerOffset;w(a);var h=d.y>(a.inInlineMode?e.editable.top+e.editable.height/2:Math.min(e.editable.height,e.pane.height)/2),b=b[h?"getLast":"getFirst"](function(a){return!(O(a)||Q(a))});if(!b)return null;c(a,b)&&(b=a.line.wrap[h?"getPrevious":"getNext"](function(a){return!(O(a)||Q(a))}));if(!n(b)||p(b)||!t(a,b))return null;A(a,b);return!h&&0<=b.size.top&&m(d.y,
|
|
981
|
+
0,b.size.top+f)?(a=a.inInlineMode||0===e.scroll.y?P:Y,new l([null,b,I,L,a])):h&&b.size.bottom<=e.pane.height&&m(d.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,L,a])):null}function x(a){var b=a.mouse,c=a.view,d=a.triggerOffset,f=g(a);if(!f)return null;A(a,f);var d=Math.min(d,0|f.size.outerHeight/2),h=[],k,u;if(m(b.y,f.size.top-1,f.size.top+d))u=!1;else if(m(b.y,f.size.bottom-d,f.size.bottom+1))u=!0;else return null;if(p(f)||
|
|
982
|
+
v(a,f,u)||f.getParent().is(Z))return null;var r=e(a,f,!u);if(r){if(r&&r.type==CKEDITOR.NODE_TEXT)return null;if(n(r)){if(p(r)||!t(a,r)||r.getParent().is(Z))return null;h=[r,f][u?"reverse":"concat"]().concat([F,L])}}else f.equals(a.editable[u?"getLast":"getFirst"](a.isRelevant))?(w(a),u&&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=P)):k=Y,h=[null,f][u?"reverse":"concat"]().concat([u?J:I,L,k,f.equals(a.editable[u?"getLast":"getFirst"](a.isRelevant))?
|
|
983
|
+
u?N:P:Y]);return 0 in h?new l(h):null}function z(a,b,c,d){for(var e=b.getDocumentPosition(),f={},h={},g={},k={},l=U.length;l--;)f[U[l]]=parseInt(b.getComputedStyle.call(b,"border-"+U[l]+"-width"),10)||0,g[U[l]]=parseInt(b.getComputedStyle.call(b,"padding-"+U[l]),10)||0,h[U[l]]=parseInt(b.getComputedStyle.call(b,"margin-"+U[l]),10)||0;c&&!d||u(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-(g.top+
|
|
984
|
+
g.bottom+f.top+f.bottom);k.width=k.outerWidth-(g.left+g.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:g,margin:h,ignoreScroll:c},k,!0)}function A(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-ba)return null;return C(b.size,z(a,b,c),{date:+new Date},!0)}function w(a,b){a.view.editable=z(a,a.editable,b,!0)}function u(a,
|
|
985
|
+
b){a.view||(a.view={});var c=a.view;if(!(!b&&c&&c.date>new Date-ba)){var d=a.win,c=d.getScrollPosition(),d=d.getViewPaneSize();C(a.view,{scroll:{x:c.x,y:c.y,width:a.doc.$.documentElement.scrollWidth-d.width,height:a.doc.$.documentElement.scrollHeight-d.height},pane:{width:d.width,height:d.height,bottom:d.height+c.y},date:+new Date},!0)}}function D(a,b,c,d){for(var e=d,f=d,h=0,g=!1,k=!1,m=a.view.pane.height,u=a.mouse;u.y+h<m&&0<u.y-h;){g||(g=b(e,d));k||(k=b(f,d));!g&&0<u.y-h&&(e=c(a,{x:u.x,y:u.y-h}));
|
|
986
|
+
!k&&u.y+h<m&&(f=c(a,{x:u.x,y:u.y+h}));if(g&&k)break;h+=2}return new l([e,f,null,null])}CKEDITOR.plugins.add("magicline",{init:function(a){var f=a.config,k=f.magicline_triggerOffset||30,m={editor:a,enterMode:f.enterMode,triggerOffset:k,holdDistance:0|k*(f.magicline_holdDistance||.5),boxColor:f.magicline_color||"#ff0000",rtl:"rtl"==f.contentsLangDirection,tabuList:["data-cke-hidden-sel"].concat(f.magicline_tabuList||[]),triggers:f.magicline_everywhere?T:{table:1,hr:1,div:1,ul:1,ol:1,dl:1,form:1,blockquote:1}},
|
|
987
|
+
v,D,B;m.isRelevant=function(a){return n(a)&&!c(m,a)&&!p(a)};a.on("contentDom",function(){var k=a.editable(),n=a.document,p=a.window;C(m,{editable:k,inInlineMode:k.isInline(),doc:n,win:p,hotNode:null},!0);m.boundary=m.inInlineMode?m.editable:m.doc.getDocumentElement();k.is(E.$inline)||(m.inInlineMode&&!q(k)&&k.setStyles({position:"relative",top:null,left:null}),h.call(this,m),u(m),k.attachListener(a,"beforeUndoImage",function(){m.line.detach()}),k.attachListener(a,"beforeGetData",function(){m.line.wrap.getParent()&&
|
|
988
|
+
(m.line.detach(),a.once("getData",function(){m.line.attach()},null,null,1E3))},null,null,0),k.attachListener(m.inInlineMode?n:n.getWindow().getFrame(),"mouseout",function(b){if("wysiwyg"==a.mode)if(m.inInlineMode){var c=b.data.$.clientX;b=b.data.$.clientY;u(m);w(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(B),B=null,m.line.detach())}else clearTimeout(B),B=null,m.line.detach()}),k.attachListener(k,"keyup",function(){m.hiddenMode=
|
|
989
|
+
0}),k.attachListener(k,"keydown",function(b){if("wysiwyg"==a.mode)switch(b.data.getKeystroke()){case 2228240:case 16:m.hiddenMode=1,m.line.detach()}}),k.attachListener(m.inInlineMode?k:n,"mousemove",function(b){D=!0;if("wysiwyg"==a.mode&&!a.readOnly&&!B){var c={x:b.data.$.clientX,y:b.data.$.clientY};B=setTimeout(function(){m.mouse=c;B=m.trigger=null;u(m);D&&!m.hiddenMode&&a.focusManager.hasFocus&&!m.line.mouseNear()&&(m.element=X(m,!0))&&((m.trigger=y(m)||x(m)||R(m))&&!r(m,m.trigger.upper||m.trigger.lower)?
|
|
990
|
+
m.line.attach().place():(m.trigger=null,m.line.detach()),D=!1)},30)}}),k.attachListener(p,"scroll",function(){"wysiwyg"==a.mode&&(m.line.detach(),K.webkit&&(m.hiddenMode=1,clearTimeout(v),v=setTimeout(function(){m.mouseDown||(m.hiddenMode=0)},50)))}),k.attachListener(H?n:p,"mousedown",function(){"wysiwyg"==a.mode&&(m.line.detach(),m.hiddenMode=1,m.mouseDown=1)}),k.attachListener(H?n:p,"mouseup",function(){m.hiddenMode=0;m.mouseDown=0}),a.addCommand("accessPreviousSpace",d(m)),a.addCommand("accessNextSpace",
|
|
991
|
+
d(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:c,getAscendantTrigger:g,getNonEmptyNeighbour:e,getSize:z,that:m,
|
|
992
|
+
triggerEdge:x,triggerEditable:y,triggerExpand:R})},this)}});var C=CKEDITOR.tools.extend,B=CKEDITOR.dom.element,G=B.createFromHtml,K=CKEDITOR.env,H=CKEDITOR.env.ie&&9>CKEDITOR.env.version,E=CKEDITOR.dtd,M={},I=128,J=64,F=32,L=16,P=4,N=2,Y=1,S=" ",Z=E.$listItem,ha=E.$tableContent,W=C({},E.$nonEditable,E.$empty),T=E.$block,ba=100,ca="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",V=ca+"border-color:transparent;display:block;border-style:solid;",
|
|
993
|
+
ea="\x3cspan\x3e"+S+"\x3c/span\x3e";M[CKEDITOR.ENTER_BR]="br";M[CKEDITOR.ENTER_P]="p";M[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,d,e){if(!b.mouse)return null;var f=b.doc,h=b.line.wrap;e=e||b.mouse;var g=a(f,e);d&&c(b,g)&&(h.hide(),g=a(f,e),h.show());return!g||
|
|
994
|
+
g.type!=CKEDITOR.NODE_ELEMENT||!g.$||K.ie&&9>K.version&&!b.boundary.equals(g)&&!b.boundary.contains(g)?null:g}}(),O=CKEDITOR.dom.walker.whitespaces(),Q=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),R=function(){function b(c){var e=c.element,h,g,k;if(!n(e)||e.contains(c.editable)||e.isReadOnly())return null;k=D(c,function(a,b){return!b.equals(a)},function(a,b){return X(a,!0,b)},e);h=k.upper;g=k.lower;if(a(c,h,g))return k.set(F,8);if(h&&e.contains(h))for(;!h.getParent().equals(e);)h=h.getParent();
|
|
995
|
+
else h=e.getFirst(function(a){return d(c,a)});if(g&&e.contains(g))for(;!g.getParent().equals(e);)g=g.getParent();else g=e.getLast(function(a){return d(c,a)});if(!h||!g)return null;A(c,h);A(c,g);if(!m(c.mouse.y,h.size.top,g.size.bottom))return null;for(var e=Number.MAX_VALUE,l,u,w,r;g&&!g.equals(h)&&(u=h.getNext(c.isRelevant));)l=Math.abs(f(c,h,u)-c.mouse.y),l<e&&(e=l,w=h,r=u),h=u,A(c,h);if(!w||!r||!m(c.mouse.y,w.size.top,r.size.bottom))return null;k.upper=w;k.lower=r;return k.set(F,8)}function d(a,
|
|
996
|
+
b){return!(b&&b.type==CKEDITOR.NODE_TEXT||Q(b)||p(b)||c(a,b)||b.type==CKEDITOR.NODE_ELEMENT&&b.$&&b.is("br"))}return function(c){var d=b(c),e;if(e=d){e=d.upper;var f=d.lower;e=!e||!f||p(f)||p(e)||f.equals(e)||e.equals(f)||f.contains(e)||e.contains(f)?!1:t(c,e)&&t(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
|
+
e){return CKEDITOR.tools.array.filter(a,function(a){return a.canHandle(e)}).sort(function(a,d){return a.priority===d.priority?0:a.priority-d.priority})}function l(a,e){var b=a.shift();b&&b.handle(e,function(){l(a,e)})}function g(a){var e=CKEDITOR.tools.array.reduce(a,function(a,d){return CKEDITOR.tools.array.isArray(d.filters)?a.concat(d.filters):a},[]);return CKEDITOR.tools.array.filter(e,function(a,d){return CKEDITOR.tools.array.indexOf(e,a)===d})}function f(a,f){var b=0,d,c;if(!CKEDITOR.tools.array.isArray(a)||
|
|
998
|
+
0===a.length)return!0;d=CKEDITOR.tools.array.filter(a,function(a){return-1===CKEDITOR.tools.array.indexOf(e,a)});if(0<d.length)for(c=0;c<d.length;c++)(function(a){CKEDITOR.scriptLoader.queue(a,function(c){c&&e.push(a);++b===d.length&&f()})})(d[c]);return 0===d.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(h){var b=a(this.handlers,
|
|
999
|
+
h),d;if(0!==b.length){d=g(b);d=f(d,function(){return e.fire("paste",h.data)});if(!d)return h.cancel();l(b,h)}},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,c){var f=new CKEDITOR.htmlParser.basicWriter,g=new CKEDITOR.htmlParser.filter,
|
|
1000
|
+
k;b&&(a=b(a,c));CKEDITOR.tools.array.forEach(e,function(b){g.addRules(b(a,c,g))});k=CKEDITOR.htmlParser.fragment.fromHtml(a);g.applyTo(k);k.writeHtml(f);return f.getHtml()}},getClipboardData:function(a,e){var b;return CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||"text/html"===e?(b=a.dataTransfer.getData(e,!0))||"text/html"!==e?b:a.dataValue:null},getConfigValue:function(a,e){if(a&&a.config){var b=CKEDITOR.tools,d=a.config,c=b.object.keys(d),f=["pasteTools_"+e,"pasteFromWord_"+e,"pasteFromWord"+
|
|
1003
1001
|
b.capitalize(e,!0)],f=b.array.find(f,function(a){return-1!==b.array.indexOf(c,a)});return d[f]}},getContentGeneratorName:function(a){if((a=/<meta\s+name=["']?generator["']?\s+content=["']?(\w+)/gi.exec(a))&&a.length)return a=a[1].toLowerCase(),0===a.indexOf("microsoft")?"microsoft":0===a.indexOf("libreoffice")?"libreoffice":"unknown"}};CKEDITOR.pasteFilters={}})();(function(){CKEDITOR.plugins.add("pastefromlibreoffice",{requires:"pastetools",isSupportedEnvironment:function(){var a=CKEDITOR.env.ie&&
|
|
1004
|
-
11>=CKEDITOR.env.version;return!(CKEDITOR.env.webkit&&!CKEDITOR.env.chrome)&&!a},init:function(a){if(this.isSupportedEnvironment()){var l=CKEDITOR.plugins.getPath("pastetools"),
|
|
1005
|
-
!1},handle:function(f,e){var
|
|
1006
|
-
b,d=[];if(e&&a.editor.filter.check("img[src]")&&(b=e.extractTagsFromHtml(a.data.dataValue),0!==b.length&&(e=e.extractFromRtf(a.data.dataTransfer["text/rtf"]),0!==e.length&&(CKEDITOR.tools.array.forEach(e,function(a){d.push(a.type?"data:"+a.type+";base64,"+CKEDITOR.tools.convertBytesToBase64(CKEDITOR.tools.convertHexStringToBytes(a.hex)):null)},this),b.length===d.length))))for(e=0;e<b.length;e++)0===b[e].indexOf("file://")&&d[e]&&(a.data.dataValue=a.data.dataValue.replace(b[e],d[e]))}var
|
|
1007
|
-
e=this.path,m=void 0===a.config.pasteFromWord_inlineImages?!0:a.config.pasteFromWord_inlineImages,f=[CKEDITOR.getUrl(f+"filter/common.js"),CKEDITOR.getUrl(e+"filter/default.js")];a.addCommand("pastefromword",{canUndo:!1,async:!0,exec:function(a,e){
|
|
1008
|
-
a.pasteTools.register({filters:a.config.pasteFromWordCleanupFile?[a.config.pasteFromWordCleanupFile]:f,canHandle:function(a){a=CKEDITOR.plugins.pastetools.getClipboardData(a.data,"text/html");var e=CKEDITOR.plugins.pastetools.getContentGeneratorName(a),b=/(class="?Mso|style=["'][^"]*?\bmso\-|w:WordDocument|<o:\w+>|<\/font>)/,e=e?"microsoft"===e:b.test(a);return a&&(
|
|
1009
|
-
"text/rtf"),d={dataValue:d,dataTransfer:{"text/rtf":c}};if(!1!==a.fire("pasteFromWord",d)||
|
|
1010
|
-
m)a.on("afterPasteFromWord",l)}})})();(function(){var a={canUndo:!1,async:!0,exec:function(a,
|
|
1011
|
-
notification:m?f:!1})}};CKEDITOR.plugins.add("pastetext",{requires:"clipboard",init:function(l){var
|
|
1002
|
+
11>=CKEDITOR.env.version;return!(CKEDITOR.env.webkit&&!CKEDITOR.env.chrome)&&!a},init:function(a){if(this.isSupportedEnvironment()){var l=CKEDITOR.plugins.getPath("pastetools"),g=this.path;a.pasteTools.register({priority:100,filters:[CKEDITOR.getUrl(l+"filter/common.js"),CKEDITOR.getUrl(l+"filter/image.js"),CKEDITOR.getUrl(g+"filter/default.js")],canHandle:function(a){a=a.data;return(a=a.dataTransfer.getData("text/html",!0)||a.dataValue)?"libreoffice"===CKEDITOR.plugins.pastetools.getContentGeneratorName(a):
|
|
1003
|
+
!1},handle:function(f,e){var g=f.data,k=g.dataValue||CKEDITOR.plugins.pastetools.getClipboardData(g,"text/html");g.dontFilter=!0;k=CKEDITOR.pasteFilters.image(k,a,CKEDITOR.plugins.pastetools.getClipboardData(g,"text/rtf"));g.dataValue=CKEDITOR.pasteFilters.libreoffice(k,a);!0===a.config.forcePasteAsPlainText&&(g.type="text");e()}})}}})})();(function(){CKEDITOR.plugins.add("pastefromword",{requires:"pastetools",init:function(a){function l(a){var e=CKEDITOR.plugins.pastefromword&&CKEDITOR.plugins.pastefromword.images,
|
|
1004
|
+
b,d=[];if(e&&a.editor.filter.check("img[src]")&&(b=e.extractTagsFromHtml(a.data.dataValue),0!==b.length&&(e=e.extractFromRtf(a.data.dataTransfer["text/rtf"]),0!==e.length&&(CKEDITOR.tools.array.forEach(e,function(a){d.push(a.type?"data:"+a.type+";base64,"+CKEDITOR.tools.convertBytesToBase64(CKEDITOR.tools.convertHexStringToBytes(a.hex)):null)},this),b.length===d.length))))for(e=0;e<b.length;e++)0===b[e].indexOf("file://")&&d[e]&&(a.data.dataValue=a.data.dataValue.replace(b[e],d[e]))}var g=0,f=CKEDITOR.plugins.getPath("pastetools"),
|
|
1005
|
+
e=this.path,m=void 0===a.config.pasteFromWord_inlineImages?!0:a.config.pasteFromWord_inlineImages,f=[CKEDITOR.getUrl(f+"filter/common.js"),CKEDITOR.getUrl(e+"filter/default.js")];a.addCommand("pastefromword",{canUndo:!1,async:!0,exec:function(a,e){g=1;a.execCommand("paste",{type:"html",notification:e&&"undefined"!==typeof e.notification?e.notification:!0})}});CKEDITOR.plugins.clipboard.addPasteButton(a,"PasteFromWord",{label:a.lang.pastefromword.toolbar,command:"pastefromword",toolbar:"clipboard,50"});
|
|
1006
|
+
a.pasteTools.register({filters:a.config.pasteFromWordCleanupFile?[a.config.pasteFromWordCleanupFile]:f,canHandle:function(a){a=CKEDITOR.plugins.pastetools.getClipboardData(a.data,"text/html");var e=CKEDITOR.plugins.pastetools.getContentGeneratorName(a),b=/(class="?Mso|style=["'][^"]*?\bmso\-|w:WordDocument|<o:\w+>|<\/font>)/,e=e?"microsoft"===e:b.test(a);return a&&(g||e)},handle:function(e,f){var b=e.data,d=CKEDITOR.plugins.pastetools.getClipboardData(b,"text/html"),c=CKEDITOR.plugins.pastetools.getClipboardData(b,
|
|
1007
|
+
"text/rtf"),d={dataValue:d,dataTransfer:{"text/rtf":c}};if(!1!==a.fire("pasteFromWord",d)||g){b.dontFilter=!0;if(g||!a.config.pasteFromWordPromptCleanup||confirm(a.lang.pastefromword.confirmCleanup))d.dataValue=CKEDITOR.cleanWord(d.dataValue,a),a.fire("afterPasteFromWord",d),b.dataValue=d.dataValue,!0===a.config.forcePasteAsPlainText?b.type="text":CKEDITOR.plugins.clipboard.isCustomCopyCutSupported||"allow-word"!==a.config.forcePasteAsPlainText||(b.type="html");g=0;f()}}});if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported&&
|
|
1008
|
+
m)a.on("afterPasteFromWord",l)}})})();(function(){var a={canUndo:!1,async:!0,exec:function(a,g){var f=a.lang,e=CKEDITOR.tools.keystrokeToString(f.common.keyboard,a.getCommandKeystroke(CKEDITOR.env.ie?a.commands.paste:this)),m=g&&"undefined"!==typeof g.notification?g.notification:!g||!g.from||"keystrokeHandler"===g.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
|
+
notification:m?f:!1})}};CKEDITOR.plugins.add("pastetext",{requires:"clipboard",init:function(l){var g=CKEDITOR.env.safari?CKEDITOR.CTRL+CKEDITOR.ALT+CKEDITOR.SHIFT+86:CKEDITOR.CTRL+CKEDITOR.SHIFT+86;l.addCommand("pastetext",a);l.setKeystroke(g,"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",
|
|
1012
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,
|
|
1013
|
-
"|")+")$","i")),
|
|
1014
|
-
a.elementPath(b),d=c.elements,e=1,
|
|
1015
|
-
a.fire("removeFormatCleanup",c))),c=
|
|
1016
|
-
CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign";CKEDITOR.plugins.add("resize",{init:function(a){function l(e){var
|
|
1017
|
-
|
|
1018
|
-
"horizontal"==f.resize_dir)&&f.resize_minWidth!=f.resize_maxWidth,c=("both"==f.resize_dir||"vertical"==f.resize_dir)&&f.resize_minHeight!=f.resize_maxHeight,n=CKEDITOR.tools.addFunction(function(c){k||(k=a.getResizable());b={width:k.$.offsetWidth||0,height:k.$.offsetHeight||0};
|
|
1019
|
-
(a.document.on("mousemove",l),a.document.on("mouseup",
|
|
1020
|
-
m?"◢":"◣")+"\x3c/span\x3e";"ltr"==m&&"ltr"==f?b.data.html+=
|
|
1021
|
-
a.focus();else{if(
|
|
1011
|
+
"|")+")$","i")),g=a._.removeAttributes||(a._.removeAttributes=a.config.removeFormatAttributes.split(",")),f=CKEDITOR.plugins.removeformat.filter,e=a.getSelection().getRanges().createIterator(),m=function(a){return a.type==CKEDITOR.NODE_ELEMENT},k=[],h;h=e.getNextRange();){var b=h.createBookmark();h=a.createRange();h.setStartBefore(b.startNode);b.endNode&&h.setEndAfter(b.endNode);h.collapsed||h.enlarge(CKEDITOR.ENLARGE_ELEMENT);var d=h.createBookmark(),c=d.startNode,n=d.endNode,p=function(b){for(var c=
|
|
1012
|
+
a.elementPath(b),d=c.elements,e=1,h;(h=d[e])&&!h.equals(c.block)&&!h.equals(c.blockLimit);e++)l.test(h.getName())&&f(a,h)&&b.breakParent(h)};p(c);if(n)for(p(n),c=c.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);c&&!c.equals(n);)if(c.isReadOnly()){if(c.getPosition(n)&CKEDITOR.POSITION_CONTAINS)break;c=c.getNext(m)}else p=c.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),"img"==c.getName()&&c.data("cke-realelement")||c.hasAttribute("data-cke-bookmark")||!f(a,c)||(l.test(c.getName())?c.remove(1):(c.removeAttributes(g),
|
|
1013
|
+
a.fire("removeFormatCleanup",c))),c=p;d.startNode.remove();d.endNode&&d.endNode.remove();h.moveToBookmark(b);k.push(h)}a.forceNextSelectionCheck();a.getSelection().selectRanges(k)}}},filter:function(a,l){for(var g=a._.removeFormatFilters||[],f=0;f<g.length;f++)if(!1===g[f](l))return!1;return!0}};CKEDITOR.editor.prototype.addRemoveFormatFilter=function(a){this._.removeFormatFilters||(this._.removeFormatFilters=[]);this._.removeFormatFilters.push(a)};CKEDITOR.config.removeFormatTags="b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var";
|
|
1014
|
+
CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign";CKEDITOR.plugins.add("resize",{init:function(a){function l(e){var g=b.width,k=b.height,l=g+(e.data.$.screenX-h.x)*("rtl"==m?-1:1);e=k+(e.data.$.screenY-h.y);d&&(g=Math.max(f.resize_minWidth,Math.min(l,f.resize_maxWidth)));c&&(k=Math.max(f.resize_minHeight,Math.min(e,f.resize_maxHeight)));a.resize(d?g:null,k)}function g(){CKEDITOR.document.removeListener("mousemove",l);CKEDITOR.document.removeListener("mouseup",
|
|
1015
|
+
g);a.document&&(a.document.removeListener("mousemove",l),a.document.removeListener("mouseup",g))}var f=a.config,e=a.ui.spaceId("resizer"),m=a.element?a.element.getDirection(1):"ltr";!f.resize_dir&&(f.resize_dir="vertical");void 0===f.resize_maxWidth&&(f.resize_maxWidth=3E3);void 0===f.resize_maxHeight&&(f.resize_maxHeight=3E3);void 0===f.resize_minWidth&&(f.resize_minWidth=750);void 0===f.resize_minHeight&&(f.resize_minHeight=250);if(!1!==f.resize_enabled){var k=null,h,b,d=("both"==f.resize_dir||
|
|
1016
|
+
"horizontal"==f.resize_dir)&&f.resize_minWidth!=f.resize_maxWidth,c=("both"==f.resize_dir||"vertical"==f.resize_dir)&&f.resize_minHeight!=f.resize_maxHeight,n=CKEDITOR.tools.addFunction(function(c){k||(k=a.getResizable());b={width:k.$.offsetWidth||0,height:k.$.offsetHeight||0};h={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",g);a.document&&
|
|
1017
|
+
(a.document.on("mousemove",l),a.document.on("mouseup",g));c.preventDefault&&c.preventDefault()});a.on("destroy",function(){CKEDITOR.tools.removeFunction(n)});a.on("uiSpace",function(b){if("bottom"==b.data.space){var f="";d&&!c&&(f=" cke_resizer_horizontal");!d&&c&&(f=" cke_resizer_vertical");var h='\x3cspan id\x3d"'+e+'" class\x3d"cke_resizer'+f+" cke_resizer_"+m+'" title\x3d"'+CKEDITOR.tools.htmlEncode(a.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+n+', event)"\x3e'+("ltr"==
|
|
1018
|
+
m?"◢":"◣")+"\x3c/span\x3e";"ltr"==m&&"ltr"==f?b.data.html+=h:b.data.html=h+b.data.html}},a,null,100);a.on("maximize",function(b){a.ui.space("resizer")[b.data==CKEDITOR.TRISTATE_ON?"hide":"show"]()})}}});(function(){CKEDITOR.plugins.add("selectall",{init:function(a){a.addCommand("selectAll",{modes:{wysiwyg:1,source:1},exec:function(a){var g=a.editable();if(g.is("textarea"))a=g.$,CKEDITOR.env.ie&&a.createTextRange?a.createTextRange().execCommand("SelectAll"):(a.selectionStart=0,a.selectionEnd=a.value.length),
|
|
1019
|
+
a.focus();else{if(g.is("body"))a.document.$.execCommand("SelectAll",!1,null);else{var f=a.createRange();f.selectNodeContents(g);f.select()}a.forceNextSelectionCheck();a.selectionChange()}},canUndo:!1});a.ui.addButton&&a.ui.addButton("SelectAll",{label:a.lang.selectall.toolbar,command:"selectAll",toolbar:"selection,10"})}})})();(function(){function a(a,f,e){var m,k;if(e="string"==typeof e?CKEDITOR.document.getById(e):new CKEDITOR.dom.element(e))if(m=a.fire("uiSpace",{space:f,html:""}).html)a.on("uiSpace",
|
|
1022
1020
|
function(a){a.data.space==f&&a.cancel()},null,null,1),k=e.append(CKEDITOR.dom.element.createFromHtml(l.output({id:a.id,name:a.name,langDir:a.lang.dir,langCode:a.langCode,space:f,spaceId:a.ui.spaceId(f),content:m}))),e.getCustomData("cke_hasshared")?k.hide():e.setCustomData("cke_hasshared",1),k.unselectable(),k.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()}),a.focusManager.add(k,1),a.on("focus",function(){for(var a=0,b,d=e.getChildren();b=d.getItem(a);a++)b.type==
|
|
1023
1021
|
CKEDITOR.NODE_ELEMENT&&!b.equals(k)&&b.hasClass("cke_shared")&&b.hide();k.show()}),a.on("destroy",function(){k.remove()})}var l=CKEDITOR.addTemplate("sharedcontainer",'\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_shared cke_detached cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" title\x3d"'+(CKEDITOR.env.gecko?" ":"")+'" lang\x3d"{langCode}" role\x3d"presentation"\x3e\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{spaceId}" class\x3d"cke_{space}" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e');
|
|
1024
|
-
CKEDITOR.plugins.add("sharedspace",{init:function(
|
|
1022
|
+
CKEDITOR.plugins.add("sharedspace",{init:function(g){g.on("loaded",function(){var f=g.config.sharedSpaces;if(f)for(var e in f)a(g,e,f[e])},null,null,9)}})})();(function(){CKEDITOR.plugins.add("sourcearea",{init:function(l){function g(){var a=e&&this.equals(CKEDITOR.document.getActive());this.hide();this.setStyle("height",this.getParent().$.clientHeight+"px");this.setStyle("width",this.getParent().$.clientWidth+"px");this.show();a&&this.focus()}if(l.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var f=
|
|
1025
1023
|
CKEDITOR.plugins.sourcearea;l.addMode("source",function(e){var f=l.ui.space("contents").getDocument().createElement("textarea");f.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",l.config.sourceAreaTabSize||4)));f.setAttribute("dir","ltr");f.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu");l.ui.space("contents").append(f);f=l.editable(new a(l,
|
|
1026
|
-
f));f.setData(l.getData(1));CKEDITOR.env.ie&&(f.attachListener(l,"resize",
|
|
1024
|
+
f));f.setData(l.getData(1));CKEDITOR.env.ie&&(f.attachListener(l,"resize",g,f),f.attachListener(CKEDITOR.document.getWindow(),"resize",g,f),CKEDITOR.tools.setTimeout(g,0,f));l.fire("ariaWidget",this);e()});l.addCommand("source",f.commands.source);l.ui.addButton&&l.ui.addButton("Source",{label:l.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"});l.on("mode",function(){l.getCommand("source").setState("source"==l.mode?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});var e=CKEDITOR.env.ie&&9==
|
|
1027
1025
|
CKEDITOR.env.version}}});var a=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(a){this.setValue(a);this.status="ready";this.editor.fire("dataReady")},getData:function(){return this.getValue()},insertHtml:function(){},insertElement:function(){},insertText:function(){},setReadOnly:function(a){this[(a?"set":"remove")+"Attribute"]("readOnly","readonly")},detach:function(){a.baseProto.detach.call(this);this.clearCustomData();this.remove()}}})})();CKEDITOR.plugins.sourcearea=
|
|
1028
1026
|
{commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(a){"wysiwyg"==a.mode&&a.fire("saveSnapshot");a.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);a.setMode("source"==a.mode?"wysiwyg":"source")},canUndo:!1}}};CKEDITOR.plugins.add("specialchar",{availableLangs:{af:1,ar:1,az:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,en:1,"en-au":1,"en-ca":1,"en-gb":1,eo:1,es:1,"es-mx":1,et:1,eu:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,he:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,
|
|
1029
|
-
lt:1,lv:1,nb:1,nl:1,no:1,oc:1,pl:1,pt:1,"pt-br":1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,"sr-latn":1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},requires:"dialog",init:function(a){var l=this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js");a.addCommand("specialchar",{exec:function(){var
|
|
1030
|
-
l.langEntries[
|
|
1031
|
-
(function(){CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(a){var l=a.config,
|
|
1032
|
-
c+1E3*(d==CKEDITOR.STYLE_OBJECT?1:d==CKEDITOR.STYLE_BLOCK?2:3),f[b]=
|
|
1033
|
-
b=d),this.add(f,a.type==CKEDITOR.STYLE_OBJECT?f:a.buildPreview(),f);this.commit()},onClick:function(e){a.focus();a.fire("saveSnapshot");e=f[e];var
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
th:1},1)){var
|
|
1037
|
-
new CKEDITOR.dom.element(d.insertRow(-1),f.document),c=0,l=b.length;c<l;c++)d.append((new CKEDITOR.dom.element(b[c],f.document)).clone(!1,!1)).appendBogus();
|
|
1038
|
-
|
|
1039
|
-
void 0===l?this.getTabIndex():l,f,e,m,k,
|
|
1040
|
-
|
|
1041
|
-
(m=b,k=
|
|
1042
|
-
(a.plugins.dialogadvtab?"table"+a.plugins.dialogadvtab.allowedContent():""),requiredContent:"table",contentTransformations:[["table{width}: sizeToStyle","table[width]: sizeToAttribute"],["td: splitBorderShorthand"],[{element:"table",right:function(a){if(a.styles){var e;if(a.styles.border)e=CKEDITOR.tools.style.parse.border(a.styles.border);else if(CKEDITOR.env.ie&&8===CKEDITOR.env.version){var
|
|
1043
|
-
|
|
1044
|
-
"th")||
|
|
1027
|
+
lt:1,lv:1,nb:1,nl:1,no:1,oc:1,pl:1,pt:1,"pt-br":1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,"sr-latn":1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},requires:"dialog",init:function(a){var l=this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js");a.addCommand("specialchar",{exec:function(){var g=a.langCode,g=l.availableLangs[g]?g:l.availableLangs[g.replace(/-.*/,"")]?g.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(l.path+"dialogs/lang/"+g+".js"),function(){CKEDITOR.tools.extend(a.lang.specialchar,
|
|
1028
|
+
l.langEntries[g]);a.openDialog("specialchar")})},modes:{wysiwyg:1},canUndo:!1});a.ui.addButton&&a.ui.addButton("SpecialChar",{label:a.lang.specialchar.toolbar,command:"specialchar",toolbar:"insert,50"})}});CKEDITOR.config.specialChars="! \x26quot; # $ % \x26amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; \x26lt; \x3d \x26gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x26euro; \x26lsquo; \x26rsquo; \x26ldquo; \x26rdquo; \x26ndash; \x26mdash; \x26iexcl; \x26cent; \x26pound; \x26curren; \x26yen; \x26brvbar; \x26sect; \x26uml; \x26copy; \x26ordf; \x26laquo; \x26not; \x26reg; \x26macr; \x26deg; \x26sup2; \x26sup3; \x26acute; \x26micro; \x26para; \x26middot; \x26cedil; \x26sup1; \x26ordm; \x26raquo; \x26frac14; \x26frac12; \x26frac34; \x26iquest; \x26Agrave; \x26Aacute; \x26Acirc; \x26Atilde; \x26Auml; \x26Aring; \x26AElig; \x26Ccedil; \x26Egrave; \x26Eacute; \x26Ecirc; \x26Euml; \x26Igrave; \x26Iacute; \x26Icirc; \x26Iuml; \x26ETH; \x26Ntilde; \x26Ograve; \x26Oacute; \x26Ocirc; \x26Otilde; \x26Ouml; \x26times; \x26Oslash; \x26Ugrave; \x26Uacute; \x26Ucirc; \x26Uuml; \x26Yacute; \x26THORN; \x26szlig; \x26agrave; \x26aacute; \x26acirc; \x26atilde; \x26auml; \x26aring; \x26aelig; \x26ccedil; \x26egrave; \x26eacute; \x26ecirc; \x26euml; \x26igrave; \x26iacute; \x26icirc; \x26iuml; \x26eth; \x26ntilde; \x26ograve; \x26oacute; \x26ocirc; \x26otilde; \x26ouml; \x26divide; \x26oslash; \x26ugrave; \x26uacute; \x26ucirc; \x26uuml; \x26yacute; \x26thorn; \x26yuml; \x26OElig; \x26oelig; \x26#372; \x26#374 \x26#373 \x26#375; \x26sbquo; \x26#8219; \x26bdquo; \x26hellip; \x26trade; \x26#9658; \x26bull; \x26rarr; \x26rArr; \x26hArr; \x26diams; \x26asymp;".split(" ");
|
|
1029
|
+
(function(){CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(a){var l=a.config,g=a.lang.stylescombo,f={},e=[],m=[];a.on("stylesSet",function(g){if(g=g.data.styles){for(var h,b,d,c=0,n=g.length;c<n;c++)(h=g[c],a.blockless&&h.element in CKEDITOR.dtd.$block||"string"==typeof h.type&&!CKEDITOR.style.customHandlers[h.type]||(b=h.name,h=new CKEDITOR.style(h),a.filter.customConfig&&!a.filter.check(h)))||(h._name=b,h._.enterMode=l.enterMode,h._.type=d=h.assignedTo||h.type,h._.weight=
|
|
1030
|
+
c+1E3*(d==CKEDITOR.STYLE_OBJECT?1:d==CKEDITOR.STYLE_BLOCK?2:3),f[b]=h,e.push(h),m.push(h));e.sort(function(a,b){return a._.weight-b._.weight})}});a.ui.addRichCombo("Styles",{label:g.label,title:g.panelTitle,toolbar:"styles,10",allowedContent:m,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(l.contentsCss),multiSelect:!0,attributes:{"aria-label":g.panelTitle}},init:function(){var a,f,b,d,c,l;c=0;for(l=e.length;c<l;c++)a=e[c],f=a._name,d=a._.type,d!=b&&(this.startGroup(g["panelTitle"+String(d)]),
|
|
1031
|
+
b=d),this.add(f,a.type==CKEDITOR.STYLE_OBJECT?f:a.buildPreview(),f);this.commit()},onClick:function(e){a.focus();a.fire("saveSnapshot");e=f[e];var h=a.elementPath();if(e.group&&e.removeStylesFromSameGroup(a))a.applyStyle(e);else a[e.checkActive(h,a)?"removeStyle":"applyStyle"](e);a.fire("saveSnapshot")},onRender:function(){a.on("selectionChange",function(e){var h=this.getValue();e=e.data.path.elements;for(var b=0,d=e.length,c;b<d;b++){c=e[b];for(var g in f)if(f[g].checkElementRemovable(c,!0,a)){g!=
|
|
1032
|
+
h&&this.setValue(g);return}}this.setValue("")},this)},onOpen:function(){var e=a.getSelection(),e=e.getSelectedElement()||e.getStartElement()||a.editable(),e=a.elementPath(e),h=[0,0,0,0];this.showAll();this.unmarkAll();for(var b in f){var d=f[b],c=d._.type;d.checkApplicable(e,a,a.activeFilter)?h[c]++:this.hideItem(b);d.checkActive(e,a)&&this.mark(b)}h[CKEDITOR.STYLE_BLOCK]||this.hideGroup(g["panelTitle"+String(CKEDITOR.STYLE_BLOCK)]);h[CKEDITOR.STYLE_INLINE]||this.hideGroup(g["panelTitle"+String(CKEDITOR.STYLE_INLINE)]);
|
|
1033
|
+
h[CKEDITOR.STYLE_OBJECT]||this.hideGroup(g["panelTitle"+String(CKEDITOR.STYLE_OBJECT)])},refresh:function(){var e=a.elementPath();if(e){for(var h in f)if(f[h].checkApplicable(e,a,a.activeFilter))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}},reset:function(){f={};e=[]}})}})})();(function(){function a(a){return{editorFocus:!1,canUndo:!1,modes:{wysiwyg:1},exec:function(f){if(f.editable().hasFocus){var g=f.getSelection(),h;if(h=(new CKEDITOR.dom.elementPath(g.getCommonAncestor(),g.root)).contains({td:1,
|
|
1034
|
+
th:1},1)){var g=f.createRange(),b=CKEDITOR.tools.tryThese(function(){var b=h.getParent().$.cells[h.$.cellIndex+(a?-1:1)];b.parentNode.parentNode;return b},function(){var b=h.getParent(),b=b.getAscendant("table").$.rows[b.$.rowIndex+(a?-1:1)];return b.cells[a?b.cells.length-1:0]});if(b||a)if(b)b=new CKEDITOR.dom.element(b),g.moveToElementEditStart(b),g.checkStartOfBlock()&&g.checkEndOfBlock()||g.selectNodeContents(b);else return!0;else{for(var d=h.getAscendant("table").$,b=h.getParent().$.cells,d=
|
|
1035
|
+
new CKEDITOR.dom.element(d.insertRow(-1),f.document),c=0,l=b.length;c<l;c++)d.append((new CKEDITOR.dom.element(b[c],f.document)).clone(!1,!1)).appendBogus();g.moveToElementEditStart(d)}g.select(!0);return!0}}return!1}}}var l={editorFocus:!1,modes:{wysiwyg:1,source:1}},g={exec:function(a){a.container.focusNext(!0,a.tabIndex)}},f={exec:function(a){a.container.focusPrevious(!0,a.tabIndex)}};CKEDITOR.plugins.add("tab",{init:function(e){for(var m=!1!==e.config.enableTabKeyTools,k=e.config.tabSpaces||0,
|
|
1036
|
+
h="";k--;)h+=" ";if(h)e.on("key",function(a){9==a.data.keyCode&&(e.insertText(h),a.cancel())});if(m)e.on("key",function(a){(9==a.data.keyCode&&e.execCommand("selectNextCell")||a.data.keyCode==CKEDITOR.SHIFT+9&&e.execCommand("selectPreviousCell"))&&a.cancel()});e.addCommand("blur",CKEDITOR.tools.extend(g,l));e.addCommand("blurBack",CKEDITOR.tools.extend(f,l));e.addCommand("selectNextCell",a());e.addCommand("selectPreviousCell",a(!0))}})})();CKEDITOR.dom.element.prototype.focusNext=function(a,l){var g=
|
|
1037
|
+
void 0===l?this.getTabIndex():l,f,e,m,k,h,b;if(0>=g)for(h=this.getNextSourceNode(a,CKEDITOR.NODE_ELEMENT);h;){if(h.isVisible()&&0===h.getTabIndex()){m=h;break}h=h.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT)}else for(h=this.getDocument().getBody().getFirst();h=h.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!f)if(!e&&h.equals(this)){if(e=!0,a){if(!(h=h.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;f=1}}else e&&!this.contains(h)&&(f=1);if(h.isVisible()&&!(0>(b=h.getTabIndex()))){if(f&&b==g){m=
|
|
1038
|
+
h;break}b>g&&(!m||!k||b<k)?(m=h,k=b):m||0!==b||(m=h,k=b)}}m&&m.focus()};CKEDITOR.dom.element.prototype.focusPrevious=function(a,l){for(var g=void 0===l?this.getTabIndex():l,f,e,m,k=0,h,b=this.getDocument().getBody().getLast();b=b.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!f)if(!e&&b.equals(this)){if(e=!0,a){if(!(b=b.getPreviousSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;f=1}}else e&&!this.contains(b)&&(f=1);if(b.isVisible()&&!(0>(h=b.getTabIndex())))if(0>=g){if(f&&0===h){m=b;break}h>k&&
|
|
1039
|
+
(m=b,k=h)}else{if(f&&h==g){m=b;break}h<g&&(!m||h>k)&&(m=b,k=h)}}m&&m.focus()};CKEDITOR.plugins.add("table",{requires:"dialog",init:function(a){function l(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,f){this.setState(f.contains("table",1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}if(!a.blockless){var g=a.lang.table;a.addCommand("table",new CKEDITOR.dialogCommand("table",{context:"table",allowedContent:"table{width,height,border-collapse}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];td{border*,background-color,vertical-align,width,height}[colspan,rowspan];"+
|
|
1040
|
+
(a.plugins.dialogadvtab?"table"+a.plugins.dialogadvtab.allowedContent():""),requiredContent:"table",contentTransformations:[["table{width}: sizeToStyle","table[width]: sizeToAttribute"],["td: splitBorderShorthand"],[{element:"table",right:function(a){if(a.styles){var e;if(a.styles.border)e=CKEDITOR.tools.style.parse.border(a.styles.border);else if(CKEDITOR.env.ie&&8===CKEDITOR.env.version){var g=a.styles;g["border-left"]&&g["border-left"]===g["border-right"]&&g["border-right"]===g["border-top"]&&
|
|
1041
|
+
g["border-top"]===g["border-bottom"]&&(e=CKEDITOR.tools.style.parse.border(g["border-top"]))}e&&e.style&&"solid"===e.style&&e.width&&0!==parseFloat(e.width)&&(a.attributes.border=1);"collapse"==a.styles["border-collapse"]&&(a.attributes.cellspacing=0)}}}]]}));a.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",l()));a.addCommand("tableDelete",l({exec:function(a){var e=a.elementPath().contains("table",1);if(e){var g=e.getParent(),k=a.editable();1!=g.getChildCount()||g.is("td",
|
|
1042
|
+
"th")||g.equals(k)||(e=g);a=a.createRange();a.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);e.remove();a.select()}}}));a.ui.addButton&&a.ui.addButton("Table",{label:g.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:g.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:g.deleteTable,command:"tableDelete",group:"table",
|
|
1045
1043
|
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,
|
|
1046
|
-
a,"selected_cell",!0),e.push(a))}var e=[],f={};if(!a)return e;for(var
|
|
1047
|
-
return e}function l(b,c){for(var d=
|
|
1048
|
-
e.append(l),l=l.$);k+=l.colSpan-1}c?e.insertBefore(g):e.insertAfter(g);return e}function
|
|
1049
|
-
(--B.$.rowSpan,p==b&&(p=f[b+1],p[n-1]?B.insertAfter(new CKEDITOR.dom.element(p[n-1])):(new CKEDITOR.dom.element(e.$.rows[b+1])).append(B,1)));n+=B.$.colSpan-1}d.push(m)}f=e.$.rows;c[0].moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);
|
|
1050
|
-
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=
|
|
1051
|
-
k=
|
|
1052
|
-
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],
|
|
1053
|
-
p+=
|
|
1054
|
-
c.getRanges(),f=a(c),
|
|
1055
|
-
f.length-1;0<=c;c--)b(f[c]);
|
|
1056
|
-
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,d,e){var f=a(b),
|
|
1057
|
-
10)||1;
|
|
1058
|
-
E||!F||F.isBlockBoundary&&F.isBlockBoundary({br:1})||(E=M.getLast(CKEDITOR.dom.walker.whitespaces(!0)),!E||E.is&&E.is("br")||M.append("br")),p.moveChildren(M)),d?p.remove():p.setHtml(""));E=J}if(e)return
|
|
1059
|
-
e.length)return!1;if(d)return!0;var e=e[0],f=e.getParent(),
|
|
1060
|
-
f.appendBogus();e.$.rowSpan=n;f.$.rowSpan=m;1==n&&e.removeAttribute("rowSpan");1==m&&f.removeAttribute("rowSpan");return f}function
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
right:function(a){a.styles["background-color"]=
|
|
1064
|
-
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=
|
|
1044
|
+
a,"selected_cell",!0),e.push(a))}var e=[],f={};if(!a)return e;for(var h=a.getRanges(),g=0;g<h.length;g++){var k=h[g];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);
|
|
1045
|
+
return e}function l(b,c){for(var d=t(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(),
|
|
1046
|
+
e.append(l),l=l.$);k+=l.colSpan-1}c?e.insertBefore(g):e.insertAfter(g);return e}function g(b){if(b instanceof CKEDITOR.dom.selection){var c=b.getRanges(),d=a(b),e=d[0].getAscendant("table"),f=CKEDITOR.tools.buildTableMap(e),h=d[0].getParent().$.rowIndex,d=d[d.length-1],k=d.getParent().$.rowIndex+d.$.rowSpan-1,d=[];b.reset();for(b=h;b<=k;b++){for(var l=f[b],m=new CKEDITOR.dom.element(e.$.rows[b]),n=0;n<l.length;n++){var B=new CKEDITOR.dom.element(l[n]),p=B.getParent().$.rowIndex;1==B.$.rowSpan?B.remove():
|
|
1047
|
+
(--B.$.rowSpan,p==b&&(p=f[b+1],p[n-1]?B.insertAfter(new CKEDITOR.dom.element(p[n-1])):(new CKEDITOR.dom.element(e.$.rows[b+1])).append(B,1)));n+=B.$.colSpan-1}d.push(m)}f=e.$.rows;c[0].moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);h=new CKEDITOR.dom.element(f[k+1]||(0<h?f[h-1]:null)||e.$.parentNode);for(b=d.length;0<=b;b--)g(d[b]);return e.$.parentNode?h:(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=
|
|
1048
|
+
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=t(b)?b:a(b),f=d[0].getAscendant("table"),h=e(d,1),d=e(d),g=c?h:d,k=CKEDITOR.tools.buildTableMap(f),f=[],h=[],d=[],l=k.length,m=0;m<l;m++){var n=c?k[m][g-1]:k[m][g+1];f.push(k[m][g]);h.push(n)}for(m=0;m<l;m++)f[m]&&(1<f[m].colSpan&&h[m]==f[m]?(k=f[m],k.colSpan+=1):(g=new CKEDITOR.dom.element(f[m]),
|
|
1049
|
+
k=g.clone(),k.removeAttribute("colSpan"),k.appendBogus(),k[c?"insertBefore":"insertAfter"].call(k,g),d.push(k),k=k.$),m+=k.rowSpan-1);return d}function k(b){function c(a){var b=a.getRanges(),d,e;if(1!==b.length)return a;b=b[0];if(b.collapsed||0!==b.endOffset)return a;d=b.endContainer;e=d.getName().toLowerCase();if("td"!==e&&"th"!==e)return a;for((e=d.getPrevious())||(e=d.getParent().getPrevious().getLast());e.type!==CKEDITOR.NODE_TEXT&&"br"!==e.getName().toLowerCase();)if(e=e.getLast(),!e)return a;
|
|
1050
|
+
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],h=e[e.length-1],e=f.getAscendant("table"),g=CKEDITOR.tools.buildTableMap(e),k,l,m=[];b.reset();var n=0;for(b=g.length;n<b;n++)for(var p=0,q=g[n].length;p<q;p++)void 0===k&&g[n][p]==f.$&&(k=p),g[n][p]==h.$&&(l=p);for(n=k;n<=l;n++)for(p=0;p<g.length;p++)h=g[p],f=new CKEDITOR.dom.element(e.$.rows[p]),h=new CKEDITOR.dom.element(h[n]),h.$&&(1==h.$.colSpan?h.remove():--h.$.colSpan,
|
|
1051
|
+
p+=h.$.rowSpan-1,f.$.cells.length||m.push(f));k=g[0].length-1>l?new CKEDITOR.dom.element(g[0][l+1]):k&&-1!==g[0][k-1].cellIndex?new CKEDITOR.dom.element(g[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 h(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(c){if(c instanceof CKEDITOR.dom.selection){var e=
|
|
1052
|
+
c.getRanges(),f=a(c),h=f[0]&&f[0].getAscendant("table"),g;a:{var k=0;g=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);g=n;break a}CKEDITOR.dom.element.clearAllMarkers(l);k=f[0].getParent();(k=k.getPrevious())?g=k.getLast():(k=f[g].getParent(),g=(k=k.getNext())?k.getChild(0):null)}c.reset();for(c=
|
|
1053
|
+
f.length-1;0<=c;c--)b(f[c]);g?d(g,!0):h&&(e[0].moveToPosition(h,CKEDITOR.POSITION_BEFORE_START),e[0].select(),h.remove())}else c instanceof CKEDITOR.dom.element&&(e=c.getParent(),1==e.getChildCount()?e.remove():c.remove())}function d(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 c(a,b,c){a=a[b];
|
|
1054
|
+
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,d,e){var f=a(b),h;if((d?1!=f.length:2>f.length)||(h=b.getCommonAncestor())&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("table"))return!1;b=f[0];h=b.getAscendant("table");var g=CKEDITOR.tools.buildTableMap(h),k=g.length,l=g[0].length,m=b.getParent().$.rowIndex,n=c(g,m,b),p;if(d){var q;try{var t=parseInt(b.getAttribute("rowspan"),10)||1;p=parseInt(b.getAttribute("colspan"),
|
|
1055
|
+
10)||1;q=g["up"==d?m-t:"down"==d?m+t:m]["left"==d?n-p:"right"==d?n+p:n]}catch(H){return!1}if(!q||b.$==q)return!1;f["up"==d||"left"==d?"unshift":"push"](new CKEDITOR.dom.element(q))}d=b.getDocument();var E=m,t=q=0,M=!e&&new CKEDITOR.dom.documentFragment(d),I=0;for(d=0;d<f.length;d++){p=f[d];var J=p.getParent(),F=p.getFirst(),L=p.$.colSpan,P=p.$.rowSpan,J=J.$.rowIndex,N=c(g,J,p),I=I+L*P,t=Math.max(t,N-n+L);q=Math.max(q,J-m+P);e||(L=p,(P=L.getBogus())&&P.remove(),L.trim(),p.getChildren().count()&&(J==
|
|
1056
|
+
E||!F||F.isBlockBoundary&&F.isBlockBoundary({br:1})||(E=M.getLast(CKEDITOR.dom.walker.whitespaces(!0)),!E||E.is&&E.is("br")||M.append("br")),p.moveChildren(M)),d?p.remove():p.setHtml(""));E=J}if(e)return q*t==I;M.moveChildren(b);b.appendBogus();t>=l?b.removeAttribute("rowSpan"):b.$.rowSpan=q;q>=k?b.removeAttribute("colSpan"):b.$.colSpan=t;e=new CKEDITOR.dom.nodeList(h.$.rows);f=e.count();for(d=f-1;0<=d;d--)h=e.getItem(d),h.$.cells.length||(h.remove(),f++);return b}function p(b,d){var e=a(b);if(1<
|
|
1057
|
+
e.length)return!1;if(d)return!0;var e=e[0],f=e.getParent(),h=f.getAscendant("table"),g=CKEDITOR.tools.buildTableMap(h),k=f.$.rowIndex,l=c(g,k,e),m=e.$.rowSpan,n;if(1<m){n=Math.ceil(m/2);for(var m=Math.floor(m/2),f=k+n,h=new CKEDITOR.dom.element(h.$.rows[f]),g=c(g,f),p,f=e.clone(),k=0;k<g.length;k++)if(p=g[k],p.parentNode==h.$&&k>l){f.insertBefore(new CKEDITOR.dom.element(p));break}else p=null;p||h.append(f)}else for(m=n=1,h=f.clone(),h.insertAfter(f),h.append(f=e.clone()),p=c(g,k),l=0;l<p.length;l++)p[l].rowSpan++;
|
|
1058
|
+
f.appendBogus();e.$.rowSpan=n;f.$.rowSpan=m;1==n&&e.removeAttribute("rowSpan");1==m&&f.removeAttribute("rowSpan");return f}function q(b,d){var e=a(b);if(1<e.length)return!1;if(d)return!0;var e=e[0],f=e.getParent(),h=f.getAscendant("table"),h=CKEDITOR.tools.buildTableMap(h),g=c(h,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<h.length;m++){var n=h[m];l.push(n[g]);1<n[g].rowSpan&&(m+=n[g].rowSpan-1)}for(h=0;h<l.length;h++)l[h].colSpan++}h=e.clone();
|
|
1059
|
+
h.insertAfter(e);h.appendBogus();e.$.colSpan=f;h.$.colSpan=k;1==f&&e.removeAttribute("colSpan");1==k&&h.removeAttribute("colSpan");return h}var t=CKEDITOR.tools.isArray;CKEDITOR.plugins.tabletools={requires:"table,dialog,contextmenu",init:function(c){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 d=c.addCommand(a,b);c.addFeature(d)}var t=c.lang.table,
|
|
1060
|
+
z=CKEDITOR.tools.style.parse,A="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:A,contentTransformations:[[{element:"td",left:function(a){return a.styles.background&&z.background(a.styles.background).color},
|
|
1061
|
+
right:function(a){a.styles["background-color"]=z.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)});
|
|
1062
|
+
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=g(a))&&d(a)}}));f("rowInsertBefore",e({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);l(b,!0)}}));
|
|
1065
1063
|
f("rowInsertAfter",e({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);l(b)}}));f("columnDelete",e({requiredContent:"table",exec:function(a){a=a.getSelection();(a=k(a))&&d(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",
|
|
1066
1064
|
e({allowedContent:"td[colspan,rowspan]",requiredContent:"td[colspan,rowspan]",exec:function(a,b){b.cell=n(a.getSelection());d(b.cell,!0)}}));f("cellMergeRight",e({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a,b){b.cell=n(a.getSelection(),"right");d(b.cell,!0)}}));f("cellMergeDown",e({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(a,b){b.cell=n(a.getSelection(),"down");d(b.cell,!0)}}));f("cellVerticalSplit",e({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",
|
|
1067
|
-
exec:function(a){d(
|
|
1068
|
-
{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:
|
|
1065
|
+
exec:function(a){d(q(a.getSelection()))}}));f("cellHorizontalSplit",e({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a){d(p(a.getSelection()))}}));f("cellInsertBefore",e({requiredContent:"table",exec:function(a){a=a.getSelection();h(a,!0)}}));f("cellInsertAfter",e({requiredContent:"table",exec:function(a){a=a.getSelection();h(a)}}));c.addMenuItems&&c.addMenuItems({tablecell:{label:t.cell.menu,group:"tablecell",order:1,getItems:function(){var b=c.getSelection(),d=a(b),b=
|
|
1066
|
+
{tablecell_insertBefore:CKEDITOR.TRISTATE_OFF,tablecell_insertAfter:CKEDITOR.TRISTATE_OFF,tablecell_delete:CKEDITOR.TRISTATE_OFF,tablecell_merge:n(b,null,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_right:n(b,"right",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_down:n(b,"down",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_vertical:q(b,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_horizontal:p(b,!0)?CKEDITOR.TRISTATE_OFF:
|
|
1069
1067
|
CKEDITOR.TRISTATE_DISABLED};c.filter.check(A)&&(b.tablecell_properties=0<d.length?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);return b}},tablecell_insertBefore:{label:t.cell.insertBefore,group:"tablecell",command:"cellInsertBefore",order:5},tablecell_insertAfter:{label:t.cell.insertAfter,group:"tablecell",command:"cellInsertAfter",order:10},tablecell_delete:{label:t.cell.deleteCell,group:"tablecell",command:"cellDelete",order:15},tablecell_merge:{label:t.cell.merge,group:"tablecell",command:"cellMerge",
|
|
1070
1068
|
order:16},tablecell_merge_right:{label:t.cell.mergeRight,group:"tablecell",command:"cellMergeRight",order:17},tablecell_merge_down:{label:t.cell.mergeDown,group:"tablecell",command:"cellMergeDown",order:18},tablecell_split_horizontal:{label:t.cell.splitHorizontal,group:"tablecell",command:"cellHorizontalSplit",order:19},tablecell_split_vertical:{label:t.cell.splitVertical,group:"tablecell",command:"cellVerticalSplit",order:20},tablecell_properties:{label:t.cell.title,group:"tablecellproperties",command:"cellProperties",
|
|
1071
1069
|
order:21},tablerow:{label:t.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:t.row.insertBefore,group:"tablerow",command:"rowInsertBefore",order:5},tablerow_insertAfter:{label:t.row.insertAfter,group:"tablerow",command:"rowInsertAfter",order:10},tablerow_delete:{label:t.row.deleteRow,group:"tablerow",command:"rowDelete",order:15},
|
|
1072
1070
|
tablecolumn:{label:t.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:t.column.insertBefore,group:"tablecolumn",command:"columnInsertBefore",order:5},tablecolumn_insertAfter:{label:t.column.insertAfter,group:"tablecolumn",command:"columnInsertAfter",order:10},tablecolumn_delete:{label:t.column.deleteColumn,group:"tablecolumn",
|
|
1073
|
-
command:"columnDelete",order:15}});c.contextMenu&&c.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,
|
|
1074
|
-
e:-1;var m=-1,k=[];for(l=l||0;l<=f;l++){m++;!k[m]&&(k[m]=[]);for(var
|
|
1075
|
-
e=c.getAscendant("table"),f=CKEDITOR.tools.buildTableMap(d),
|
|
1076
|
-
return k}function
|
|
1077
|
-
a.getSelection().reset())}function e(a,b){var c=[],d,e;for(e=0;e<b.length;e++)d=a.createRange(),d.setStartBefore(b[e]),d.setEndAfter(b[e]),c.push(d);a.getSelection().selectRanges(c)}function m(a){var b=a.editable().find(".cke_table-faked-selection");1>b.count()||(b=l(b.getItem(0),b.getItem(b.count()-1)),e(a,b))}function k(b,c,d){var
|
|
1078
|
-
c||
|
|
1071
|
+
command:"columnDelete",order:15}});c.contextMenu&&c.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,g,f,e){a=a.$.rows;g=g||0;f="number"===typeof f?f:a.length-1;e="number"===typeof e?
|
|
1072
|
+
e:-1;var m=-1,k=[];for(l=l||0;l<=f;l++){m++;!k[m]&&(k[m]=[]);for(var h=-1,b=g;b<=(-1===e?a[l].cells.length-1:e);b++){var d=a[l].cells[b];if(!d)break;for(h++;k[m][h];)h++;for(var c=isNaN(d.colSpan)?1:d.colSpan,d=isNaN(d.rowSpan)?1:d.rowSpan,n=0;n<d&&!(l+n>f);n++){k[m+n]||(k[m+n]=[]);for(var p=0;p<c;p++)k[m+n][h+p]=a[l].cells[b]}h+=c-1;if(-1!==e&&h>=e)break}}return k};(function(){function a(a){return CKEDITOR.plugins.widget&&CKEDITOR.plugins.widget.isDomWidget(a)}function l(a,c){var d=a.getAscendant("table"),
|
|
1073
|
+
e=c.getAscendant("table"),f=CKEDITOR.tools.buildTableMap(d),h=b(a),g=b(c),k=[],l={},m,n;d.contains(e)&&(c=c.getAscendant({td:1,th:1}),g=b(c));h>g&&(d=h,h=g,g=d,d=a,a=c,c=d);for(d=0;d<f[h].length;d++)if(a.$===f[h][d]){m=d;break}for(d=0;d<f[g].length;d++)if(c.$===f[g][d]){n=d;break}m>n&&(d=m,m=n,n=d);for(d=h;d<=g;d++)for(h=m;h<=n;h++)e=new CKEDITOR.dom.element(f[d][h]),e.$&&!e.getCustomData("selected_cell")&&(k.push(e),CKEDITOR.dom.element.setMarker(l,e,"selected_cell",!0));CKEDITOR.dom.element.clearAllMarkers(l);
|
|
1074
|
+
return k}function g(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()&&
|
|
1075
|
+
a.getSelection().reset())}function e(a,b){var c=[],d,e;for(e=0;e<b.length;e++)d=a.createRange(),d.setStartBefore(b[e]),d.setEndAfter(b[e]),c.push(d);a.getSelection().selectRanges(c)}function m(a){var b=a.editable().find(".cke_table-faked-selection");1>b.count()||(b=l(b.getItem(0),b.getItem(b.count()-1)),e(a,b))}function k(b,c,d){var h=y(b.getSelection(!0));c=c.is("table")?null:c;var g;(g=r.active&&!r.first)&&!(g=c)&&(g=b.getSelection().getRanges(),g=1<h.length||g[0]&&!g[0].collapsed?!0:!1);if(g)r.first=
|
|
1076
|
+
c||h[0],r.dirty=c?!1:1!==h.length;else if(r.active&&c&&r.first.getAscendant("table").equals(c.getAscendant("table"))){h=l(r.first,c);if(!r.dirty&&1===h.length&&!a(d.data.getTarget()))return f(b,"mouseup"===d.name);r.dirty=!0;r.last=c;e(b,h)}}function h(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===
|
|
1079
1077
|
c.length&&c[0]._getTableElement()&&c[0]._getTableElement().is("table")&&(e=c[0]._getTableElement());e=y(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 d(b){function c(a,b){return a&&b?a.equals(b)||a.contains(b)||b.contains(a)||
|
|
1080
|
-
a.getCommonAncestor(b).is(
|
|
1081
|
-
b.editor||b.listenerData.editor,n=l.getSelection(1),p=
|
|
1082
|
-
CKEDITOR.MOUSE_BUTTON_LEFT&&(e(b.data.getTarget())||c(p,
|
|
1078
|
+
a.getCommonAncestor(b).is(v):!1}function e(a){return!a.getAscendant("table",!0)&&a.getDocument().equals(l.document)}function h(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=
|
|
1079
|
+
b.editor||b.listenerData.editor,n=l.getSelection(1),p=g(l),q=b.data.getTarget(),t=q&&q.getAscendant({td:1,th:1},!0),q=q&&q.getAscendant("table",!0),v={table:1,thead:1,tbody:1,tfoot:1,tr:1,td:1,th:1};q&&q.hasAttribute("data-cke-tableselection-ignored")||(h(b,n,p,q)&&f(l,!0),!r.active&&"mousedown"===b.name&&CKEDITOR.tools.getMouseButton(b)===CKEDITOR.MOUSE_BUTTON_LEFT&&q&&(r={active:!0},CKEDITOR.document.on("mouseup",d,null,{editor:l})),(t||q)&&k(l,t||q,b),"mouseup"===b.name&&(CKEDITOR.tools.getMouseButton(b)===
|
|
1080
|
+
CKEDITOR.MOUSE_BUTTON_LEFT&&(e(b.data.getTarget())||c(p,q))&&m(l),r={active:!1},CKEDITOR.document.removeListener("mouseup",d)))}}function c(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,h=a.createRange(),g=f.getDocumentElement().$,
|
|
1083
1081
|
k=CKEDITOR.env.ie&&9>CKEDITOR.env.version,l=a.blockless||CKEDITOR.env.ie?"span":"div",m,n,p,q;f.getById("cke_table_copybin")||(m=f.createElement(l),n=f.createElement(l),n.setAttributes({id:"cke_table_copybin","data-cke-temp":"1"}),m.setStyles({position:"absolute",width:"1px",height:"1px",overflow:"hidden"}),m.setStyle("ltr"==a.config.contentsLangDirection?"left":"right","-5000px"),m.setHtml(a.getSelectedHtml(!0)),a.fire("lockSnapshot"),n.append(m),a.editable().append(n),q=a.on("selectionChange",c,
|
|
1084
|
-
null,null,0),k&&(p=
|
|
1085
|
-
b,c){a.on("beforeCommandExec",function(c){-1!==CKEDITOR.tools.array.indexOf(b,c.data.name)&&(c.data.selectedCells=y(a.getSelection()))});a.on("afterCommandExec",function(d){-1!==CKEDITOR.tools.array.indexOf(b,d.data.name)&&c(a,d.data)})}var
|
|
1086
|
-
a[0];this.cells.last=a[a.length-1];this.rows.first=a[0].getAscendant("tr");this.rows.last=this.cells.last.getAscendant("tr")};
|
|
1087
|
-
|
|
1088
|
-
a)return;for(var d=this.cells,e=d.all,f=b(d.first),
|
|
1089
|
-
CKEDITOR.tools.array.map(a,function(a){return a.length},0))}var d=a.editor,f=d.getSelection(),
|
|
1090
|
-
b=void 0,b=!b;return b?!1:!0})(f,
|
|
1082
|
+
null,null,0),k&&(p=g.scrollTop),h.selectNodeContents(m),h.select(),k&&(g.scrollTop=p),setTimeout(function(){n.remove();d.selectBookmarks(e);q.removeListener();a.fire("unlockSnapshot");b&&(a.extractSelectedHtml(),a.fire("saveSnapshot"))},100))}function p(a){var b=a.editor||a.sender.editor,c=b.getSelection();c.isInTable()&&(c.getRanges()[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored")||n(b,"cut"===a.name))}function q(a){this._reset();a&&this.setSelectedCells(a)}function t(a,
|
|
1083
|
+
b,c){a.on("beforeCommandExec",function(c){-1!==CKEDITOR.tools.array.indexOf(b,c.data.name)&&(c.data.selectedCells=y(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,y,x,z,A;q.prototype={};q.prototype._reset=function(){this.cells={first:null,last:null,all:[]};this.rows={first:null,last:null}};q.prototype.setSelectedCells=function(a){this._reset();a=a.slice(0);this._arraySortByDOMOrder(a);this.cells.all=a;this.cells.first=
|
|
1084
|
+
a[0];this.cells.last=a[a.length-1];this.rows.first=a[0].getAscendant("tr");this.rows.last=this.cells.last.getAscendant("tr")};q.prototype.getTableMap=function(){var a=x(this.cells.first),c;a:{c=this.cells.last;var d=c.getAscendant("table"),e=b(c),d=CKEDITOR.tools.buildTableMap(d),f;for(f=0;f<d[e].length;f++)if((new CKEDITOR.dom.element(d[e][f])).equals(c)){c=f;break a}c=void 0}return CKEDITOR.tools.buildTableMap(this._getTable(),b(this.rows.first),a,b(this.rows.last),c)};q.prototype._getTable=function(){return this.rows.first.getAscendant("table")};
|
|
1085
|
+
q.prototype.insertRow=function(a,b,c){if("undefined"===typeof a)a=1;else if(0>=a)return;for(var d=this.cells.first.$.cellIndex,e=this.cells.last.$.cellIndex,f=c?[]:this.cells.all,h,g=0;g<a;g++)h=z(c?this.cells.all:f,b),h=CKEDITOR.tools.array.filter(h.find("td, th").toArray(),function(a){return c?!0:a.$.cellIndex>=d&&a.$.cellIndex<=e}),f=b?h.concat(f):f.concat(h);this.setSelectedCells(f)};q.prototype.insertColumn=function(a){function c(a){a=b(a);return a>=f&&a<=h}if("undefined"===typeof a)a=1;else if(0>=
|
|
1086
|
+
a)return;for(var d=this.cells,e=d.all,f=b(d.first),h=b(d.last),d=0;d<a;d++)e=e.concat(CKEDITOR.tools.array.filter(A(e),c));this.setSelectedCells(e)};q.prototype.emptyCells=function(a){a=a||this.cells.all;for(var b=0;b<a.length;b++)a[b].setHtml("")};q.prototype._arraySortByDOMOrder=function(a){a.sort(function(a,b){return a.getPosition(b)&CKEDITOR.POSITION_PRECEDING?-1:1})};var w={onPaste:function(a){function b(a){var c=d.createRange();c.selectNodeContents(a);c.select()}function c(a){return Math.max.apply(null,
|
|
1087
|
+
CKEDITOR.tools.array.map(a,function(a){return a.length},0))}var d=a.editor,f=d.getSelection(),h=y(f),g=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)):
|
|
1088
|
+
b=void 0,b=!b;return b?!1:!0})(f,h,k,g)&&(h=h[0].getAscendant("table"),m=new q(y(f,h)),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(),g?(m.insertRow(1,1===g,!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,
|
|
1091
1089
|
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=
|
|
1092
|
-
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=
|
|
1093
|
-
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)&&
|
|
1094
|
-
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(),
|
|
1095
|
-
!0),m=k.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l),n=!1,p=function(a){return!k.contains(a)&&a.is&&a.is("td","th")};m&&!p(m);)m=m.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l);!m&&
|
|
1096
|
-
e=CKEDITOR.tools.extend({table:1},CKEDITOR.dtd.$tableContent);delete e.td;delete e.th;return function(e){var f=e.data.getKey(),
|
|
1097
|
-
13){for(e=0;e<l.length;e++)b(l[e]);(e=c(m,l))?l=e:l[0].moveToElementEditablePosition(m);
|
|
1098
|
-
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;y=v.getSelectedCells;
|
|
1099
|
-
"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",d,null,f);b.attachListener(e,"mousemove",d,null,f);b.attachListener(e,"mouseup",d,null,f);b.attachListener(b,"dragstart",c);b.attachListener(a,"selectionCheck",
|
|
1100
|
-
!CKEDITOR.plugins.clipboard.isCustomCopyCutSupported&&(b.attachListener(b,"cut",
|
|
1101
|
-
{exec:function(a){var
|
|
1102
|
-
(a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"math" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),
|
|
1103
|
-
|
|
1104
|
-
(a.plugins.dialogadvtab?"table"+a.plugins.dialogadvtab.allowedContent():""),requiredContent:"table"}));a.addCommand("taoqtitableProperties",new CKEDITOR.dialogCommand("taoqtitableProperties"));l&&a.ui.addButton&&a.ui.addButton("TaoQtiTable",{label:
|
|
1105
|
-
{init:function(a){var l=new CKEDITOR.style({element:"span",attributes:{"class":"txt-underline"}}),
|
|
1106
|
-
{init:function(a){function l(a){a=a.getSelection().getNative();var c;if(c=null!==a)if(c=a.getRangeAt(0),!(c=a&&a.isCollapsed&&!e(a.getRangeAt(c.startContainer))))if(a=!a.isCollapsed&&a.getRangeAt(0)){b=!1;
|
|
1107
|
-
c.nodeName.toLowerCase();-1===
|
|
1108
|
-
b;a.addCommand("insertTaoTooltip",{exec:function(a){var b=a.config.taoQtiItem,e=a.getSelection(),f=e.getNative(),
|
|
1109
|
-
function(){k(a)})});a.ui.addButton("TaoTooltip",{label:a.lang.insertTaoTooltip.button,command:"insertTaoTooltip",icon:this.path+"images/taotooltip.png"})}});CKEDITOR.plugins.add("taohighlight",{init:function(a){var l=new CKEDITOR.style({element:"span",attributes:{"class":"txt-highlight"}}),
|
|
1110
|
-
{label:a.lang.spanHighlight.button,command:"spanHighlight",icon:this.path+"images/taohighlight.png"})}});CKEDITOR.plugins.add("taoqtiinclude",{init:function(a){a.addCommand("insertQtiInclude",{exec:function(a){var
|
|
1111
|
-
icon:this.path+"images/taoqtiimage.png"})}});CKEDITOR.plugins.add("taoqtiprintedvariable",{init:function(a){a.addCommand("insertQtiPrintedVariable",{exec:function(a){var
|
|
1112
|
-
"images/taoqtiprintedvariable.png"})}});"
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
"")
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
undo:
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
null}
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
(
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
this.
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
"";
|
|
1143
|
-
"
|
|
1144
|
-
"
|
|
1145
|
-
l
|
|
1146
|
-
|
|
1147
|
-
h.
|
|
1148
|
-
|
|
1090
|
+
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=x(a.cells.first),f=a._getTable(),h={},g,k,l,m;for(l=0;l<c.length;l++)for(g=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&&
|
|
1091
|
+
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)&&g.equals(d.getParent())?k.insertAfter(d):0<e?g.$.cells[e]?k.insertAfter(new CKEDITOR.dom.element(g.$.cells[e])):g.append(k):g.append(k,!0);CKEDITOR.dom.element.setMarker(h,k,"processed",!0)}else k.getCustomData("processed")&&d&&d.remove();CKEDITOR.dom.element.clearAllMarkers(h)}};CKEDITOR.plugins.tableselection={getCellsBetween:l,keyboardIntegration:function(a){function b(a){var c=a.getEnclosedNode();
|
|
1092
|
+
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(),h=CKEDITOR.dom.range.mergeRanges(d);CKEDITOR.tools.array.forEach(h,function(a){a.enlarge(CKEDITOR.ENLARGE_ELEMENT)});var g=h[0].getBoundaryNodes(),k=g.startNode,g=g.endNode;if(k&&k.is&&k.is(e)){for(var l=k.getAscendant("table",
|
|
1093
|
+
!0),m=k.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l),n=!1,p=function(a){return!k.contains(a)&&a.is&&a.is("td","th")};m&&!p(m);)m=m.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l);!m&&g&&g.is&&!g.is("table")&&g.getNext()&&(m=g.getNext().findOne("td, th"),n=!0);if(m)f["moveToElementEdit"+(n?"Start":"End")](m);else f.setStartBefore(k.getAscendant("table",!0)),f.collapse(!0);h[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},
|
|
1094
|
+
e=CKEDITOR.tools.extend({table:1},CKEDITOR.dtd.$tableContent);delete e.td;delete e.th;return function(e){var f=e.data.getKey(),h=e.data.getKeystroke(),g,k=37===f||38==f,l,m,n;if(d[f]&&!a.readOnly&&(g=a.getSelection())&&g.isInTable()&&g.isFake){l=g.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),g.selectRanges([l[0]]);else if(13!==f||13===h||h===CKEDITOR.SHIFT+
|
|
1095
|
+
13){for(e=0;e<l.length;e++)b(l[e]);(e=c(m,l))?l=e:l[0].moveToElementEditablePosition(m);g.selectRanges(l);13===f&&a.plugins.enterkey?(a.fire("lockSnapshot"),13===h?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=
|
|
1096
|
+
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;y=v.getSelectedCells;x=v.getCellColIndex;z=v.insertRow;A=v.insertColumn;CKEDITOR.document.appendStyleSheet(this.path+
|
|
1097
|
+
"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",d,null,f);b.attachListener(e,"mousemove",d,null,f);b.attachListener(e,"mouseup",d,null,f);b.attachListener(b,"dragstart",c);b.attachListener(a,"selectionCheck",h);CKEDITOR.plugins.tableselection.keyboardIntegration(a);CKEDITOR.plugins.clipboard&&
|
|
1098
|
+
!CKEDITOR.plugins.clipboard.isCustomCopyCutSupported&&(b.attachListener(b,"cut",p),b.attachListener(b,"copy",p))}),a.on("paste",w.onPaste,w),t(a,"rowInsertBefore rowInsertAfter columnInsertBefore columnInsertAfter cellInsertBefore cellInsertAfter".split(" "),function(a,b){e(a,b.selectedCells)}),t(a,["cellMerge","cellMergeRight","cellMergeDown"],function(a,b){e(a,[b.commandData.cell])}),t(a,["cellDelete"],function(a){f(a,!0)}))}})})();CKEDITOR.plugins.add("taoqtiimage",{init:function(a){a.addCommand("insertQtiImage",
|
|
1099
|
+
{exec:function(a){var g=a.config.taoQtiItem;"function"===typeof g.insert&&(a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"img" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),g.insert.call(a))}});a.ui.addButton("TaoQtiImage",{label:a.lang.insertQtiImage.button,command:"insertQtiImage",icon:this.path+"images/taoqtiimage.png"})}});CKEDITOR.plugins.add("taoqtimaths",{init:function(a){a.addCommand("insertQtiMaths",{exec:function(a){var g=a.config.taoQtiItem;"function"===typeof g.insert&&
|
|
1100
|
+
(a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"math" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),g.insert.call(a))}});a.ui.addButton("TaoQtiMaths",{label:a.lang.insertQtiMaths.button,command:"insertQtiMaths",icon:this.path+"images/taoqtimaths.png"})}});CKEDITOR.plugins.add("taoqtimedia",{init:function(a){a.addCommand("insertQtiMedia",{exec:function(a){var g=a.config.taoQtiItem;"function"===typeof g.insert&&(a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"object" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),
|
|
1101
|
+
g.insert.call(a))}});a.ui.addButton("TaoQtiMedia",{label:a.lang.insertQtiMedia.button,command:"insertQtiMedia",icon:this.path+"images/taoqtimedia.png"})}});CKEDITOR.plugins.add("taoqtitable",{requires:"dialog",icons:this.path+"images/taoqtitable.png",hidpi:!1,init:function(a){var l=!0;if("table"===a.element.getAttribute("data-qti-class"))l=!1;else if(a.blockless)return;var g=a.lang.table;a.addCommand("taoqtitable",new CKEDITOR.dialogCommand("taoqtitable",{context:"table",allowedContent:"table[summary];caption tbody thead tfoot;th td tr[scope];"+
|
|
1102
|
+
(a.plugins.dialogadvtab?"table"+a.plugins.dialogadvtab.allowedContent():""),requiredContent:"table"}));a.addCommand("taoqtitableProperties",new CKEDITOR.dialogCommand("taoqtitableProperties"));l&&a.ui.addButton&&a.ui.addButton("TaoQtiTable",{label:g.toolbar,command:"taoqtitable",toolbar:"insert,30",icon:this.path+"images/taoqtitable.png"});CKEDITOR.dialog.add("taoqtitable",this.path+"dialogs/taoqtitable.js");CKEDITOR.dialog.add("taoqtitableProperties",this.path+"dialogs/taoqtitable.js")}});CKEDITOR.plugins.add("taounderline",
|
|
1103
|
+
{init:function(a){var l=new CKEDITOR.style({element:"span",attributes:{"class":"txt-underline"}}),g=["u",["span",function(a){return"underline"==a.styles["text-decoration"]}]];g.unshift(l);a.attachStyleStateChange(l,function(f){!a.readOnly&&a.getCommand("spanUnderline").setState(f)});a.addCommand("spanUnderline",new CKEDITOR.styleCommand(l,{contentForms:g}));a.ui.addButton("TaoUnderline",{label:a.lang.spanUnderline.button,command:"spanUnderline",icon:this.path+"images/taounderline.png"})}});CKEDITOR.plugins.add("taotooltip",
|
|
1104
|
+
{init:function(a){function l(a){a=a.getSelection().getNative();var c;if(c=null!==a)if(c=a.getRangeAt(0),!(c=a&&a.isCollapsed&&!e(a.getRangeAt(c.startContainer))))if(a=!a.isCollapsed&&a.getRangeAt(0)){b=!1;g(a.cloneContents());if(c=""!==a.toString().trim()){c=f(a.startContainer);var h=f(a.endContainer);c=c.isSameNode(h)}c=c&&!b&&!e(a.startContainer)}else c=!1;return c}function g(a){a=a.childNodes;var c,e;for(e=0;e<a.length;e++)if(c=a[e],!b&&c.nodeType===window.Node.ELEMENT_NODE){var f=c.nodeName&&
|
|
1105
|
+
c.nodeName.toLowerCase();-1===h.indexOf(f)?b=!0:g(c)}}function f(a){return a.nodeType===window.Node.TEXT_NODE?a.parentNode:a}function e(a){return(new CKEDITOR.dom.element(a)).getAscendant(function(a){return a.$&&a.$.dataset&&"_tooltip"===a.$.dataset.qtiClass})}function m(a){a=a.getRanges()[0].extractContents().$;return new CKEDITOR.dom.element(a)}function k(a){var b=a.getCommand("insertTaoTooltip");b&&(l(a)?b.setState(CKEDITOR.TRISTATE_OFF):b.setState(CKEDITOR.TRISTATE_DISABLED))}var h="b strong i em s sub sup u".split(" "),
|
|
1106
|
+
b;a.addCommand("insertTaoTooltip",{exec:function(a){var b=a.config.taoQtiItem,e=a.getSelection(),f=e.getNative(),h;l(a)&&"function"===typeof b.insert&&(h=new CKEDITOR.dom.element("span",a.document),h.setAttributes({"data-new":!0,"data-qti-class":"_tooltip","class":"widget-box"}),f&&f.isCollapsed?h.appendHtml("\x26nbsp;"):h.append(m(e)),a.insertElement(h),b.insert.call(a,h.$))}});a.on("instanceReady",function(){var b=a.editable();b.attachListener(b,"mouseup",function(){k(a)});b.attachListener(b,"keyup",
|
|
1107
|
+
function(){k(a)})});a.ui.addButton("TaoTooltip",{label:a.lang.insertTaoTooltip.button,command:"insertTaoTooltip",icon:this.path+"images/taotooltip.png"})}});CKEDITOR.plugins.add("taohighlight",{init:function(a){var l=new CKEDITOR.style({element:"span",attributes:{"class":"txt-highlight"}}),g=["span"];g.unshift(l);a.attachStyleStateChange(l,function(f){!a.readOnly&&a.getCommand("spanHighlight").setState(f)});a.addCommand("spanHighlight",new CKEDITOR.styleCommand(l,{contentForms:g}));a.ui.addButton("TaoHighlight",
|
|
1108
|
+
{label:a.lang.spanHighlight.button,command:"spanHighlight",icon:this.path+"images/taohighlight.png"})}});CKEDITOR.plugins.add("taoqtiinclude",{init:function(a){a.addCommand("insertQtiInclude",{exec:function(a){var g=a.config.taoQtiItem;"function"===typeof g.insert&&(a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"include" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),g.insert.call(a))}});a.ui.addButton("TaoQtiInclude",{label:a.lang.insertQtiInclude.button,command:"insertQtiInclude",
|
|
1109
|
+
icon:this.path+"images/taoqtiimage.png"})}});CKEDITOR.plugins.add("taoqtiprintedvariable",{init:function(a){a.addCommand("insertQtiPrintedVariable",{exec:function(a){var g=a.config.taoQtiItem;"function"===typeof g.insert&&(a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"printedVariable" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),g.insert.call(a))}});a.ui.addButton("TaoQtiPrintedVariable",{label:a.lang.insertQtiPrintedVariable.button,command:"insertQtiPrintedVariable",icon:this.path+
|
|
1110
|
+
"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 g(a){return a.nodeType===window.Node.TEXT_NODE?a.parentNode:a}function f(a){return null!==a.getAscendant("ruby")}function e(a){var d=a.getSelection();a=d.getNative();var c;if(c=null!==a)c=!(d&&d.isCollapsed())&&d.getRanges()[0]&&!f(d.getRanges()[0].startContainer);if(d=c)if(a=!a.isCollapsed&&a.getRangeAt(0)){h=
|
|
1111
|
+
!1;var d=a.cloneContents().childNodes,e;for(e=0;e<d.length;e++)if(c=d[e],!h&&c.nodeType!==window.Node.TEXT_NODE){h=!0;break}if(d=""!==a.toString().trim())d=g(a.startContainer),a=g(a.endContainer),d=d.isSameNode(a);d=d&&!h}else d=!1;return d}function m(b,d,c){b=b.getAscendant("ruby");var e=b.find("rb"),f=b.find("rt");if(e.$.length&&!f.$.length||d&&e.$.length&&f.$.length&&!f.$[0].innerText.trim())return a.fire("saveSnapshot"),a.fire("lockSnapshot"),rbHtml=new CKEDITOR.dom.element.createFromHtml(e.$[0].innerHTML),
|
|
1112
|
+
rbHtml.replace(b),d||(d=new CKEDITOR.dom.range(a.document),d.selectNodeContents(rbHtml),c.selectRanges([d])),a.fire("unlockSnapshot"),!0}function k(a){var d=a.getCommand("rubyFurigana"),c=a.getSelection(),h=c.getRanges()[0].startContainer;d&&(e(a)?d.setState(CKEDITOR.TRISTATE_OFF):c.getRanges()[0]&&f(h)?m(h,!1,c)?d.setState(CKEDITOR.TRISTATE_DISABLED):d.setState(CKEDITOR.TRISTATE_ON):d.setState(CKEDITOR.TRISTATE_DISABLED))}var h;a.addCommand("rubyFurigana",{exec:function(a){var d=a.getSelection(),
|
|
1113
|
+
c=d.getRanges()[0],h=c.startContainer,g,q,t;f(h)?(g=h.getAscendant("ruby"),q=g.find("rb"),t=g.find("rt"),!m(h,!0)&&q.$.length&&t.$.length&&h.getParent().$===t.$[0]&&null===h.$.nextSibling&&c.endOffset+1>=h.$.length&&(c=new CKEDITOR.dom.range(a.document),g.$.nextSibling?(t=new CKEDITOR.dom.text(CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE),t.insertAfter(g),c.moveToElementEditablePosition(t)):c.moveToClosestEditablePosition(g,!0),d.selectRanges([c]),k(a))):e(a)&&(a.fire("saveSnapshot"),a.fire("lockSnapshot"),
|
|
1114
|
+
g=new CKEDITOR.dom.element("ruby",a.document),q=new CKEDITOR.dom.element("rb",a.document),q.append(l(d)),t=new CKEDITOR.dom.element("rt",a.document),t.appendHtml("\x26nbsp;"),g.append(q),g.append(t),a.insertElement(g),c=new CKEDITOR.dom.range(a.document),c.moveToElementEditablePosition(t),a.getSelection().selectRanges([c]),k(a),a.fire("unlockSnapshot"))}});a.on("instanceReady",function(){var b=a.editable();a.getCommand("rubyFurigana").setState(CKEDITOR.TRISTATE_DISABLED);b.attachListener(b,"mouseup",
|
|
1115
|
+
function(){k(a)});b.attachListener(b,"keyup",function(){k(a)})});a.ui.addButton("TaoFurigana",{label:a.lang.rubyFurigana.button,command:"rubyFurigana",icon:this.path+"images/taofurigana.png"})}});"use strict";(function(){function a(a,d){return CKEDITOR.tools.array.reduce(d,function(a,b){return b(a)},a)}var l=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],g={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(a){function d(a){e.enabled&&!1!==a.data.command.canUndo&&e.save()}function c(){e.enabled=
|
|
1116
|
+
a.readOnly?!1:"wysiwyg"==a.mode;e.onChange()}var e=a.undoManager=new f(a),h=e.editingHandler=new k(e),g=a.addCommand("undo",{exec:function(){e.undo()&&(a.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),m=a.addCommand("redo",{exec:function(){e.redo()&&(a.selectionChange(),this.fire("afterRedo"))},startDisabled:!0,canUndo:!1});a.setKeystroke([[l[0],"undo"],[l[1],"redo"],[l[2],"redo"]]);e.onChange=function(){g.setState(e.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);
|
|
1117
|
+
m.setState(e.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)};a.on("beforeCommandExec",d);a.on("afterCommandExec",d);a.on("saveSnapshot",function(a){e.save(a.data&&a.data.contentOnly)});a.on("contentDom",h.attachListeners,h);a.on("instanceReady",function(){a.fire("saveSnapshot")});a.on("beforeModeUnload",function(){"wysiwyg"==a.mode&&e.save(!0)});a.on("mode",c);a.on("readOnly",c);a.ui.addButton&&(a.ui.addButton("Undo",{label:a.lang.undo.undo,command:"undo",toolbar:"undo,10"}),a.ui.addButton("Redo",
|
|
1118
|
+
{label:a.lang.undo.redo,command:"redo",toolbar:"undo,20"}));a.resetUndo=function(){e.reset();a.fire("saveSnapshot")};a.on("updateSnapshot",function(){e.currentImage&&e.update()});a.on("lockSnapshot",function(a){a=a.data;e.lock(a&&a.dontUpdate,a&&a.forceUpdate)});a.on("unlockSnapshot",e.unlock,e)}});CKEDITOR.plugins.undo={};var f=CKEDITOR.plugins.undo.UndoManager=function(a){this.strokesRecorded=[0,0];this.locked=null;this.previousKeyGroup=-1;this.limit=a.config.undoStackSize||20;this.strokesLimit=
|
|
1119
|
+
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,d){var c=f.getKeyGroup(a),e=this.strokesRecorded[c]+1;d=d||e>=this.strokesLimit;this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange());d?(e=0,this.editor.fire("saveSnapshot")):this.editor.fire("change");this.strokesRecorded[c]=e;this.previousKeyGroup=c},keyGroupChanged:function(a){return f.getKeyGroup(a)!=
|
|
1120
|
+
this.previousKeyGroup},reset:function(){this.snapshots=[];this.index=-1;this.currentImage=null;this.hasRedo=this.hasUndo=!1;this.locked=null;this.resetType()},resetType:function(){this.strokesRecorded=[0,0];this.typing=!1;this.previousKeyGroup=-1},refreshState:function(){this.hasUndo=!!this.getNextImage(!0);this.hasRedo=!!this.getNextImage(!1);this.resetType();this.onChange()},save:function(a,d,c){var f=this.editor;if(this.locked||"ready"!=f.status||"wysiwyg"!=f.mode)return!1;var h=f.editable();if(!h||
|
|
1121
|
+
"ready"!=h.status)return!1;h=this.snapshots;d||(d=new e(f));if(!1===d.contents)return!1;if(this.currentImage)if(d.equalsContent(this.currentImage)){if(a||d.equalsSelection(this.currentImage))return!1}else!1!==c&&f.fire("change");h.splice(this.index+1,h.length-this.index-1);h.length==this.limit&&h.shift();this.index=h.push(d)-1;this.currentImage=d;!1!==c&&this.refreshState();return!0},restoreImage:function(a){var d=this.editor,c;a.bookmarks&&(d.focus(),c=d.getSelection());this.locked={level:999};this.editor.loadSnapshot(a.contents);
|
|
1122
|
+
a.bookmarks?c.selectBookmarks(a.bookmarks):CKEDITOR.env.ie&&(c=this.editor.document.getBody().$.createTextRange(),c.collapse(!0),c.select());this.locked=null;this.index=a.index;this.currentImage=this.snapshots[this.index];this.update();this.refreshState();d.fire("change")},getNextImage:function(a){var d=this.snapshots,c=this.currentImage,e;if(c)if(a)for(e=this.index-1;0<=e;e--){if(a=d[e],!c.equalsContent(a))return a.index=e,a}else for(e=this.index+1;e<d.length;e++)if(a=d[e],!c.equalsContent(a))return a.index=
|
|
1123
|
+
e,a;return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){if(this.undoable()){this.save(!0);var a=this.getNextImage(!0);if(a)return this.restoreImage(a),!0}return!1},redo:function(){if(this.redoable()&&(this.save(!0),this.redoable())){var a=this.getNextImage(!1);if(a)return this.restoreImage(a),!0}return!1},update:function(a){if(!this.locked){a||(a=new e(this.editor));for(var d=this.index,c=this.snapshots;0<d&&this.currentImage.equalsContent(c[d-
|
|
1124
|
+
1]);)--d;c.splice(d,this.index-d+1,a);this.index=d;this.currentImage=a}},updateSelection:function(a){if(!this.snapshots.length)return!1;var d=this.snapshots,c=d[d.length-1];return c.equalsContent(a)&&!c.equalsSelection(a)?(this.currentImage=d[d.length-1]=a,!0):!1},lock:function(a,d){if(this.locked)this.locked.level++;else if(a)this.locked={level:1};else{var c=null;if(d)c=!0;else{var f=new e(this.editor,!0);this.currentImage&&this.currentImage.equalsContent(f)&&(c=f)}this.locked={update:c,level:1}}},
|
|
1125
|
+
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 d=new e(this.editor,!0);a.equalsContent(d)||this.update()}}},addFilterRule:function(a){this._filterRules.push(a)}};f.navigationKeyCodes={37:1,38:1,39:1,40:1,36:1,35:1,33:1,34:1};f.keyGroups={PRINTABLE:0,FUNCTIONAL:1};f.isNavigationKey=function(a){return!!f.navigationKeyCodes[a]};f.getKeyGroup=function(a){var d=f.keyGroups;return g[a]?d.FUNCTIONAL:d.PRINTABLE};f.getOppositeKeyGroup=
|
|
1126
|
+
function(a){var d=f.keyGroups;return a==d.FUNCTIONAL?d.PRINTABLE:d.FUNCTIONAL};f.ieFunctionalKeysBug=function(a){return CKEDITOR.env.ie&&f.getKeyGroup(a)==f.keyGroups.FUNCTIONAL};var e=CKEDITOR.plugins.undo.Image=function(b,d){this.editor=b;b.fire("beforeUndoImage");var c=b.getSnapshot();c&&(this.contents=a(c,b.undoManager._filterRules));d||(this.bookmarks=(c=c&&b.getSelection())&&c.createBookmarks2(!0));b.fire("afterUndoImage")},m=/\b(?:href|src|name)="[^"]*?"/gi;e.prototype={equalsContent:function(a){var d=
|
|
1127
|
+
this.contents;a=a.contents;CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)&&(d=d.replace(m,""),a=a.replace(m,""));return d!=a?!1:!0},equalsSelection:function(a){var d=this.bookmarks;a=a.bookmarks;if(d||a){if(!d||!a||d.length!=a.length)return!1;for(var c=0;c<d.length;c++){var e=d[c],f=a[c];if(e.startOffset!=f.startOffset||e.endOffset!=f.endOffset||!CKEDITOR.tools.arrayCompare(e.start,f.start)||!CKEDITOR.tools.arrayCompare(e.end,f.end))return!1}}return!0}};var k=CKEDITOR.plugins.undo.NativeEditingHandler=
|
|
1128
|
+
function(a){this.undoManager=a;this.ignoreInputEvent=!1;this.keyEventsStack=new h;this.lastKeydownImage=null};k.prototype={onKeydown:function(a){var d=a.data.getKey();if(229!==d)if(-1<CKEDITOR.tools.indexOf(l,a.data.getKeystroke()))a.data.preventDefault();else if(this.keyEventsStack.cleanUp(a),a=this.undoManager,this.keyEventsStack.getLast(d)||this.keyEventsStack.push(d),this.lastKeydownImage=new e(a.editor),f.isNavigationKey(d)||this.undoManager.keyGroupChanged(d))if(a.strokesRecorded[0]||a.strokesRecorded[1])a.save(!1,
|
|
1129
|
+
this.lastKeydownImage,!1),a.resetType()},onInput:function(){if(this.ignoreInputEvent)this.ignoreInputEvent=!1;else{var a=this.keyEventsStack.getLast();a||(a=this.keyEventsStack.push(0));this.keyEventsStack.increment(a.keyCode);this.keyEventsStack.getTotalInputs()>=this.undoManager.strokesLimit&&(this.undoManager.type(a.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(a){var d=this.undoManager;a=a.data.getKey();var c=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(a);
|
|
1130
|
+
if(!(f.ieFunctionalKeysBug(a)&&this.lastKeydownImage&&this.lastKeydownImage.equalsContent(new e(d.editor,!0))))if(0<c)d.type(a);else if(f.isNavigationKey(a))this.onNavigationKey(!0)},onNavigationKey:function(a){var d=this.undoManager;!a&&d.save(!0,null,!1)||d.updateSelection(new e(d.editor));d.resetType()},ignoreInputEventListener:function(){this.ignoreInputEvent=!0},activateInputEventListener:function(){this.ignoreInputEvent=!1},attachListeners:function(){var a=this.undoManager.editor,d=a.editable(),
|
|
1131
|
+
c=this;d.attachListener(d,"keydown",function(a){c.onKeydown(a);if(f.ieFunctionalKeysBug(a.data.getKey()))c.onInput()},null,null,999);d.attachListener(d,CKEDITOR.env.ie?"keypress":"input",c.onInput,c,null,999);d.attachListener(d,"keyup",c.onKeyup,c,null,999);d.attachListener(d,"paste",c.ignoreInputEventListener,c,null,999);d.attachListener(d,"drop",c.ignoreInputEventListener,c,null,999);a.on("afterPaste",c.activateInputEventListener,c,null,999);d.attachListener(d.isInline()?d:a.document.getDocumentElement(),
|
|
1132
|
+
"click",function(){c.onNavigationKey()},null,null,999);d.attachListener(this.undoManager.editor,"blur",function(){c.keyEventsStack.remove(9)},null,null,999)}};var h=CKEDITOR.plugins.undo.KeyEventsStack=function(){this.stack=[]};h.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 d=this.stack.length;d--;)if(this.stack[d].keyCode==a)return d;return-1},getLast:function(a){a=this.getLastIndex(a);
|
|
1133
|
+
return-1!=a?this.stack[a]:null},increment:function(a){this.getLast(a).inputs++},remove:function(a){a=this.getLastIndex(a);-1!=a&&this.stack.splice(a,1)},resetInputs:function(a){if("number"==typeof a)this.getLast(a).inputs=0;else for(a=this.stack.length;a--;)this.stack[a].inputs=0},getTotalInputs:function(){for(var a=this.stack.length,d=0;a--;)d+=this.stack[a].inputs;return d},cleanUp:function(a){a=a.data.$;a.ctrlKey||a.metaKey||this.remove(17);a.shiftKey||this.remove(16);a.altKey||this.remove(18)}}})();
|
|
1134
|
+
(function(){function a(a){function f(a){var b=!1;c.attachListener(c,"keydown",function(){var c=h.getBody().getElementsByTag(a);if(!b){for(var d=0;d<c.count();d++)c.getItem(d).setCustomData("retain",!0);b=!0}},null,null,1);c.attachListener(c,"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,d=h.getElementById("cke_actscrpt");
|
|
1135
|
+
d&&d.parentNode.removeChild(d);(d=h.getElementById("cke_shimscrpt"))&&d.parentNode.removeChild(d);(d=h.getElementById("cke_basetagscrpt"))&&d.parentNode.removeChild(d);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 c=this;CKEDITOR.env.ie&&!CKEDITOR.env.edge&&h.getDocumentElement().addClass(h.$.compatMode);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&
|
|
1136
|
+
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&&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=
|
|
1137
|
+
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=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);
|
|
1138
|
+
b.data("cke-title",b.getText());CKEDITOR.env.ie&&(g.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready");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 c=a.getSelection().getSelectedElement();c&&(b&&(b.detachEvent("onresizestart",g),b=null),c.$.attachEvent("onresizestart",
|
|
1139
|
+
g),b=c.$)})}function g(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var h=a.document.$;h.execCommand("enableObjectResizing",!1,!a.config.disableObjectResizing);h.execCommand("enableInlineTableEditing",!1,!a.config.disableNativeTableHandles)}catch(b){}else CKEDITOR.env.ie&&11>CKEDITOR.env.version&&a.config.disableObjectResizing&&f(a)}function g(){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 "+
|
|
1140
|
+
g+"[contenteditable\x3dfalse]");a.push(f.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(a.push("html{height:100% !important}"),a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));a.push("html{cursor:text;*cursor:auto}");a.push("img,input,textarea{cursor:default}");return a.join("\n")}var f;CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",
|
|
1141
|
+
requiredContent:"body"});a.addMode("wysiwyg",function(g){function k(c){c&&c.removeListener();a.isDestroyed()||a.isDetached()||(a.editable(new f(a,b.$.contentWindow.document.body)),a.setData(a.getData(1),g))}var h="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",h=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent(h)+"}())":"",b=CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"'+
|
|
1142
|
+
h+'" frameBorder\x3d"0"\x3e\x3c/iframe\x3e');b.setStyles({width:"100%",height:"100%"});b.addClass("cke_wysiwyg_frame").addClass("cke_reset");h=a.ui.space("contents");h.append(b);var d=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.gecko;if(d)b.on("load",k);var c=a.title,l=a.fire("ariaEditorHelpLabel",{}).label;c&&(CKEDITOR.env.ie&&l&&(c+=", "+l),b.setAttribute("title",c));if(l){var c=CKEDITOR.tools.getNextId(),p=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+c+'" class\x3d"cke_voice_label"\x3e'+
|
|
1143
|
+
l+"\x3c/span\x3e");h.append(p,1);b.setAttribute("aria-describedby",c)}a.on("beforeModeUnload",function(a){a.removeListener();p&&p.remove()});b.setAttributes({tabIndex:a.tabIndex,allowTransparency:"true"});!d&&k();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=
|
|
1144
|
+
CKEDITOR.tools.addFunction(function(e){CKEDITOR.tools.setTimeout(a,0,this,e)},this);this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(a,f){var k=this.editor;if(f)this.setHtml(a),this.fixInitialSelection(),k.fire("dataReady");else{this._.isLoadingData=!0;k._.dataStore={id:1};var h=k.config,b=h.fullPage,d=h.docType,c=CKEDITOR.tools.buildStyleHtml(g()).replace(/<style>/,'\x3cstyle data-cke-temp\x3d"1"\x3e');b||(c+=CKEDITOR.tools.buildStyleHtml(k.config.contentsCss));
|
|
1145
|
+
var l=h.baseHref?'\x3cbase href\x3d"'+h.baseHref+'" data-cke-temp\x3d"1" /\x3e':"";b&&(a=a.replace(/<!DOCTYPE[^>]*>/i,function(a){k.docType=d=a;return""}).replace(/<\?xml\s[^\?]*\?>/i,function(a){k.xmlDeclaration=a;return""}));a=k.dataProcessor.toHtml(a);b?(/<body[\s|>]/.test(a)||(a="\x3cbody\x3e"+a),/<html[\s|>]/.test(a)||(a="\x3chtml\x3e"+a+"\x3c/html\x3e"),/<head[\s|>]/.test(a)?/<title[\s|>]/.test(a)||(a=a.replace(/<head[^>]*>/,"$\x26\x3ctitle\x3e\x3c/title\x3e")):a=a.replace(/<html[^>]*>/,"$\x26\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e"),
|
|
1146
|
+
l&&(a=a.replace(/<head[^>]*?>/,"$\x26"+l)),a=a.replace(/<\/head\s*>/,c+"$\x26"),a=d+a):a=h.docType+'\x3chtml dir\x3d"'+h.contentsLangDirection+'" lang\x3d"'+(h.contentsLanguage||k.langCode)+'"\x3e\x3chead\x3e\x3ctitle\x3e'+this._.docTitle+"\x3c/title\x3e"+l+c+"\x3c/head\x3e\x3cbody"+(h.bodyId?' id\x3d"'+h.bodyId+'"':"")+(h.bodyClass?' class\x3d"'+h.bodyClass+'"':"")+"\x3e"+a+"\x3c/body\x3e\x3c/html\x3e";CKEDITOR.env.gecko&&(a=a.replace(/<body/,'\x3cbody contenteditable\x3d"true" '),2E4>CKEDITOR.env.version&&
|
|
1147
|
+
(a=a.replace(/<body[^>]*>/,"$\x26\x3c!-- cke-content-start --\x3e")));h='\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&&(h+='\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e');
|
|
1148
|
+
l&&CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(h+='\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');a=a.replace(/(?=\s*<\/(:?head)>)/,h);this.clearCustomData();this.clearListeners();k.fire("contentDomUnload");var p=this.getDocument();try{p.write(a)}catch(q){setTimeout(function(){p.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();a=this.editor;var f=a.config,g=f.fullPage,h=g&&a.docType,b=g&&a.xmlDeclaration,
|
|
1149
|
+
d=this.getDocument(),g=g?d.getDocumentElement().getOuterHtml():d.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,g=a.document,a=a.container.findOne("iframe.cke_wysiwyg_frame");f.baseProto.detach.call(this);this.clearCustomData(this._.expandoNumber);
|
|
1150
|
+
g.getDocumentElement().clearCustomData();CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);a&&(a.clearCustomData(),(g=a.removeCustomData("onResize"))&&g.removeListener(),a.isDetached()||a.remove())}}})})();CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;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,specialchar,stylescombo,tab,table,tabletools,tableselection,taoqtiimage,taoqtimaths,taoqtimedia,taoqtitable,taounderline,taotooltip,taohighlight,taoqtiinclude,taoqtiprintedvariable,taofurigana,undo,wysiwygarea";
|
|
1151
|
+
CKEDITOR.config.skin="tao";(function(){var a=function(a,g){var f=CKEDITOR.getUrl("plugins/"+g);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,,justifyblock,1344,,justifycenter,1368,,justifyleft,1392,,justifyright,1416,,anchor-rtl,1440,,anchor,1464,,link,1488,,unlink,1512,,bulletedlist-rtl,1536,,bulletedlist,1560,,numberedlist-rtl,1584,,numberedlist,1608,,mathjax,1632,,maximize,1656,,newpage-rtl,1680,,newpage,1704,,pagebreak-rtl,1728,,pagebreak,1752,,pastefromword-rtl,1776,,pastefromword,1800,,pastetext-rtl,1824,,pastetext,1848,,placeholder,1872,,preview-rtl,1896,,preview,1920,,print,1944,,removeformat,1968,,save,1992,,selectall,2016,,showblocks-rtl,2040,,showblocks,2064,,smiley,2088,,source-rtl,2112,,source,2136,,sourcedialog-rtl,2160,,sourcedialog,2184,,specialchar,2208,,table,2232,,language,2256,,templates-rtl,2280,,templates,2304,,uicolor,2328,,redo-rtl,2352,,redo,2376,,undo-rtl,2400,,undo,2424,,simplebox,4896,auto",
|
|
1149
1152
|
"icons_hidpi.png"):a("about,0,auto,bold,24,auto,italic,48,auto,strike,72,auto,subscript,96,auto,superscript,120,auto,underline,144,auto,bidiltr,168,auto,bidirtl,192,auto,blockquote,216,auto,copy-rtl,240,auto,copy,264,auto,cut-rtl,288,auto,cut,312,auto,paste-rtl,336,auto,paste,360,auto,codesnippet,384,auto,bgcolor,408,auto,textcolor,432,auto,copyformatting,456,auto,creatediv,480,auto,docprops-rtl,504,auto,docprops,528,auto,easyimagealigncenter,552,auto,easyimagealignleft,576,auto,easyimagealignright,600,auto,easyimagealt,624,auto,easyimagefull,648,auto,easyimageside,672,auto,easyimageupload,696,auto,embed,720,auto,embedsemantic,744,auto,emojipanel,768,auto,find-rtl,792,auto,find,816,auto,replace,840,auto,flash,864,auto,button,888,auto,checkbox,912,auto,form,936,auto,hiddenfield,960,auto,imagebutton,984,auto,radio,1008,auto,select-rtl,1032,auto,select,1056,auto,textarea-rtl,1080,auto,textarea,1104,auto,textfield-rtl,1128,auto,textfield,1152,auto,horizontalrule,1176,auto,iframe,1200,auto,image,1224,auto,indent-rtl,1248,auto,indent,1272,auto,outdent-rtl,1296,auto,outdent,1320,auto,justifyblock,1344,auto,justifycenter,1368,auto,justifyleft,1392,auto,justifyright,1416,auto,anchor-rtl,1440,auto,anchor,1464,auto,link,1488,auto,unlink,1512,auto,bulletedlist-rtl,1536,auto,bulletedlist,1560,auto,numberedlist-rtl,1584,auto,numberedlist,1608,auto,mathjax,1632,auto,maximize,1656,auto,newpage-rtl,1680,auto,newpage,1704,auto,pagebreak-rtl,1728,auto,pagebreak,1752,auto,pastefromword-rtl,1776,auto,pastefromword,1800,auto,pastetext-rtl,1824,auto,pastetext,1848,auto,placeholder,1872,auto,preview-rtl,1896,auto,preview,1920,auto,print,1944,auto,removeformat,1968,auto,save,1992,auto,selectall,2016,auto,showblocks-rtl,2040,auto,showblocks,2064,auto,smiley,2088,auto,source-rtl,2112,auto,source,2136,auto,sourcedialog-rtl,2160,auto,sourcedialog,2184,auto,specialchar,2208,auto,table,2232,auto,language,2256,auto,templates-rtl,2280,auto,templates,2304,auto,uicolor,2328,auto,redo-rtl,2352,auto,redo,2376,auto,undo-rtl,2400,auto,undo,2424,auto,simplebox,2448,auto",
|
|
1150
1153
|
"icons.png")})()}})();
|