diff --git a/docs/HISTORY.txt b/docs/HISTORY.txt index d5c03849..5bf8ccb7 100644 --- a/docs/HISTORY.txt +++ b/docs/HISTORY.txt @@ -4,6 +4,9 @@ Changelog 4.3.0b3 (unreleased) -------------------- +- Update to CKeditor 4.5.3 + [gotcha] + - Update to CKeditor 4.4.8 [gotcha] diff --git a/src/collective/ckeditor/_src/ckeditor/CHANGES.md b/src/collective/ckeditor/_src/ckeditor/CHANGES.md index d209fa96..e780b7f1 100644 --- a/src/collective/ckeditor/_src/ckeditor/CHANGES.md +++ b/src/collective/ckeditor/_src/ckeditor/CHANGES.md @@ -1,6 +1,205 @@ CKEditor 4 Changelog ==================== +## CKEditor 4.5.3 + +New Features: + +* [#13501](http://dev.ckeditor.com/ticket/13501): Added the [`config.fileTools_defaultFileName`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-fileTools_defaultFileName) option to allow setting a default filen ame for paste uploads. +* [#13603](http://dev.ckeditor.com/ticket/13603): Added support for uploading dropped BMP images. + +Fixed Issues: + +* [#13590](http://dev.ckeditor.com/ticket/13590): Fixed: Various issues related to the [Paste from Word](http://ckeditor.com/addon/pastefromword) feature. Fixes also: + * [#11215](http://dev.ckeditor.com/ticket/11215), + * [#8780](http://dev.ckeditor.com/ticket/8780), + * [#12762](http://dev.ckeditor.com/ticket/12762). +* [#13386](http://dev.ckeditor.com/ticket/13386): [Edge] Fixed: Issues with selecting and editing images. +* [#13568](http://dev.ckeditor.com/ticket/13568): Fixed: The [`editor.getSelectedHtml()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getSelectedHtml) method returns invalid results for entire content selection. +* [#13453](http://dev.ckeditor.com/ticket/13453): Fixed: Drag&drop of entire editor content throws an error. +* [#13465](http://dev.ckeditor.com/ticket/13465): Fixed: Error is thrown and the widget is lost on drag&drop if it is the only content of the editor. +* [#13414](http://dev.ckeditor.com/ticket/13414): Fixed: Content auto paragraphing in a nested editable despite editor configuration. +* [#13429](http://dev.ckeditor.com/ticket/13429): Fixed: Incorrect selection after content insertion by the [Auto Embed](http://ckeditor.com/addon/autoembed) plugin. +* [#13388](http://dev.ckeditor.com/ticket/13388): Fixed: [Table Resize](http://ckeditor.com/addon/tableresize) integration with [Undo](http://ckeditor.com/addon/undo) is broken. + +Other Changes: + +* [#13637](https://dev.ckeditor.com/ticket/13637): Several icons were refactored. +* Updated [Bender.js](https://github.com/benderjs/benderjs) to 0.3.0 and introduced the ability to run tests via HTTPs ([#13265](https://dev.ckeditor.com/ticket/13265)). + +## CKEditor 4.5.2 + +Fixed Issues: + +* [#13609](http://dev.ckeditor.com/ticket/13609): [Edge] Fixed: The browser crashes when switching to the source mode. Thanks to [Andrew Williams and Mark Smeed](http://webxsolution.com/)! +* [PR#201](https://github.com/ckeditor/ckeditor-dev/pull/201): Fixed: Buttons in the toolbar configurator cause form submission. Thanks to [colemanw](https://github.com/colemanw)! +* [#13422](http://dev.ckeditor.com/ticket/13422): Fixed: A monospaced font should be used in the `");return""+encodeURIComponent(a)+""})}function l(a){return a.replace(K,function(a,b){return decodeURIComponent(b)})}function n(a){return a.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g,function(a){return"<\!--"+ -r+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\>"})}function q(a){return a.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)})}function p(a,b){var c=b._.dataStore;return a.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return c&&c[b]||""})}function o(a,b){for(var c=[],d=b.config.protectedSource,e=b._.dataStore||(b._.dataStore={id:1}),f=/<\!--\{cke_temp(comment)?\}(\d*?)--\>/g, -d=[/|$)/gi,//gi,//gi].concat(d),a=a.replace(/<\!--[\s\S]*?--\>/g,function(a){return"<\!--{cke_tempcomment}"+(c.push(a)-1)+"--\>"}),g=0;g"});a=a.replace(f,function(a,b,d){return"<\!--"+r+(b?"{C}":"")+encodeURIComponent(c[d]).replace(/--/g,"%2D%2D")+"--\>"});a=a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g, -function(a){return a.replace(/<\!--\{cke_protected\}([^>]*)--\>/g,function(a,b){e[e.id]=decodeURIComponent(b);return"{cke_protected_"+e.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,d,e){return"<"+c+d+">"+p(q(e),b)+""})}CKEDITOR.htmlDataProcessor=function(b){var c,d,e=this;this.editor=b;this.dataFilter=c=new CKEDITOR.htmlParser.filter;this.htmlFilter=d=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;c.addRules(u); -c.addRules(w,{applyToAll:true});c.addRules(a(b,"data"),{applyToAll:true});d.addRules(s);d.addRules(x,{applyToAll:true});d.addRules(a(b,"html"),{applyToAll:true});b.on("toHtml",function(a){var a=a.data,c=a.dataValue,d,c=o(c,b),c=k(c,C),c=j(c),c=k(c,F),c=c.replace(G,"$1cke:$2"),c=c.replace(D,""),c=c.replace(/(]*>)(\r\n|\n)/g,"$1$2$2"),c=c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");d=a.context||b.editable().getName();var e;if(CKEDITOR.env.ie&& -CKEDITOR.env.version<9&&d=="pre"){d="div";c="
"+c+"
";e=1}d=b.document.createElement(d);d.setHtml("a"+c);c=d.getHtml().substr(1);c=c.replace(RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");e&&(c=c.replace(/^
|<\/pre>$/gi,""));c=c.replace(E,"$1$2");c=l(c);c=q(c);d=a.fixForBody===false?false:f(a.enterMode,b.config.autoParagraph);c=CKEDITOR.htmlParser.fragment.fromHtml(c,a.context,d);if(d){e=c;if(!e.children.length&&CKEDITOR.dtd[e.name][d]){d=new CKEDITOR.htmlParser.element(d);e.add(d)}}a.dataValue=
-c},null,null,5);b.on("toHtml",function(a){a.data.filter.applyTo(a.data.dataValue,true,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(e.dataFilter,true)},null,null,10);b.on("toHtml",function(a){var a=a.data,b=a.dataValue,c=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(c);b=c.getHtml(true);a.dataValue=n(b)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&
-(c=c.replace(/^
/i,""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,f(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(e.htmlFilter,true)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,false,true)},null,null,11);b.on("toDataFormat",function(a){var c=a.data.dataValue,d=e.writer;d.reset();c.writeChildrenHtml(d);c=d.getHtml(true);c=q(c);c=p(c,b);a.data.dataValue= -c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,b,c,d){var e=this.editor,f,g,h;if(b&&typeof b=="object"){f=b.context;c=b.fixForBody;d=b.dontFilter;g=b.filter;h=b.enterMode}else f=b;!f&&f!==null&&(f=e.editable().getName());return e.fire("toHtml",{dataValue:a,context:f,fixForBody:c,dontFilter:d,filter:g||e.filter,enterMode:h||e.enterMode}).dataValue},toDataFormat:function(a,b){var c,d,e;if(b){c=b.context;d=b.filter;e=b.enterMode}!c&&c!==null&&(c=this.editor.editable().getName()); -return this.editor.fire("toDataFormat",{dataValue:a,filter:d||this.editor.filter,context:c,enterMode:e||this.editor.enterMode}).dataValue}};var m=/(?: |\xa0)$/,r="{cke_protected}",v=CKEDITOR.dtd,t=["caption","colgroup","col","thead","tfoot","tbody"],z=CKEDITOR.tools.extend({},v.$blockLimit,v.$block),u={elements:{input:d,textarea:d}},w={attributeNames:[[/^on/,"data-cke-pa-on"],[/^data-cke-expando$/,""]]},s={elements:{embed:function(a){var b=a.parent;if(b&&b.name=="object"){var c=b.attributes.width, -b=b.attributes.height;if(c)a.attributes.width=c;if(b)a.attributes.height=b}},a:function(a){if(!a.children.length&&!a.attributes.name&&!a.attributes["data-cke-saved-name"])return false}}},x={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return false;for(var c=["name","href","src"],d,e=0;e-1&&d>-1&&c!=d)){c=a.parent?a.getIndex():-1;d=b.parent?b.getIndex():-1}return c>d?1:-1})},param:function(a){a.children=[];a.isEmpty=true;return a},span:function(a){a.attributes["class"]=="Apple-style-span"&&delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck; -delete a.attributes.contenteditable},style:function(a){var b=a.children[0];if(b&&b.value)b.value=CKEDITOR.tools.trim(b.value);if(!a.attributes.type)a.attributes.type="text/css"},title:function(a){var b=a.children[0];!b&&i(a,b=new CKEDITOR.htmlParser.text);b.value=a.attributes["data-cke-title"]||""},input:h,textarea:h},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||false}}};if(CKEDITOR.env.ie)x.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g, -function(a){return a.toLowerCase()})};var y=/<(a|area|img|input|source)\b([^>]*)>/gi,A=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,B=/^(href|src|name)$/i,F=/(?:])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,C=/(])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,K=/([^<]*)<\/cke:encoded>/gi,G=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,E=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,D=/]*?)\/?>(?!\s*<\/cke:\1)/gi}(), -"use strict",CKEDITOR.htmlParser.element=function(a,f){this.name=a;this.attributes=f||{};this.children=[];var c=a||"",e=c.match(/^cke:(.*)/);e&&(c=e[1]);c=!(!CKEDITOR.dtd.$nonBodyContent[c]&&!CKEDITOR.dtd.$block[c]&&!CKEDITOR.dtd.$listItem[c]&&!CKEDITOR.dtd.$tableContent[c]&&!(CKEDITOR.dtd.$nonEditable[c]||c=="br"));this.isEmpty=!!CKEDITOR.dtd.$empty[a];this.isUnknown=!CKEDITOR.dtd[a];this._={isBlockLike:c,hasInlineStarted:this.isEmpty||!c}},CKEDITOR.htmlParser.cssStyle=function(a){var f={};((a instanceof -CKEDITOR.htmlParser.element?a.attributes.style:a)||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,e,b){e=="font-family"&&(b=b.replace(/["']/g,""));f[e.toLowerCase()]=b});return{rules:f,populate:function(a){var e=this.toString();if(e)a instanceof CKEDITOR.dom.element?a.setAttribute("style",e):a instanceof CKEDITOR.htmlParser.element?a.attributes.style=e:a.style=e},toString:function(){var a=[],e;for(e in f)f[e]&&a.push(e,":",f[e],";");return a.join("")}}},function(){function a(a){return function(b){return b.type== -CKEDITOR.NODE_ELEMENT&&(typeof a=="string"?b.name==a:b.name in a)}}var f=function(a,b){a=a[0];b=b[0];return ab?1:0},c=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:c.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a,b){var c=this,f,d,b=c.getFilterContext(b);if(b.off)return true;if(!c.parent)a.onRoot(b,c);for(;;){f=c.name; -if(!(d=a.onElementName(b,f))){this.remove();return false}c.name=d;if(!(c=a.onElement(b,c))){this.remove();return false}if(c!==this){this.replaceWith(c);return false}if(c.name==f)break;if(c.type!=CKEDITOR.NODE_ELEMENT){this.replaceWith(c);return false}if(!c.name){this.replaceWithChildren();return false}}f=c.attributes;var h,j;for(h in f){j=h;for(d=f[h];;)if(j=a.onAttributeName(b,h))if(j!=h){delete f[h];h=j}else break;else{delete f[h];break}j&&((d=a.onAttribute(b,c,j,d))===false?delete f[j]:f[j]=d)}c.isEmpty|| -this.filterChildren(a,false,b);return true},filterChildren:c.filterChildren,writeHtml:function(a,b){b&&this.filter(b);var c=this.name,i=[],d=this.attributes,h,j;a.openTag(c,d);for(h in d)i.push([h,d[h]]);a.sortAttributes&&i.sort(f);h=0;for(j=i.length;h0)this.children[a-1].next=null;this.parent.add(c,this.getIndex()+1);return c},addClass:function(a){if(!this.hasClass(a)){var b=this.attributes["class"]||"";this.attributes["class"]=b+(b?" ":"")+a}},removeClass:function(a){var b=this.attributes["class"];if(b)(b= -CKEDITOR.tools.trim(b.replace(RegExp("(?:\\s+|^)"+a+"(?:\\s+|$)")," ")))?this.attributes["class"]=b:delete this.attributes["class"]},hasClass:function(a){var b=this.attributes["class"];return!b?false:RegExp("(?:^|\\s)"+a+"(?=\\s|$)").test(b)},getFilterContext:function(a){var b=[];a||(a={off:false,nonEditable:false,nestedEditable:false});!a.off&&this.attributes["data-cke-processor"]=="off"&&b.push("off",true);!a.nonEditable&&this.attributes.contenteditable=="false"?b.push("nonEditable",true):a.nonEditable&& -(!a.nestedEditable&&this.attributes.contenteditable=="true")&&b.push("nestedEditable",true);if(b.length)for(var a=CKEDITOR.tools.copy(a),c=0;c'+ -e.getValue()+"",CKEDITOR.document);a.insertAfter(e);e.hide();e.$.form&&c._attachToForm()}else c.setData(a.getHtml(),null,true);c.on("loaded",function(){c.fire("uiReady");c.editable(a);c.container=a;c.setData(c.getData(1));c.resetDirty();c.fire("contentDom");c.mode="wysiwyg";c.fire("mode");c.status="ready";c.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,c)},null,null,1E4);c.on("destroy",function(){if(e){c.container.clearCustomData();c.container.remove();e.show()}c.element.clearCustomData(); -delete c.element});return c};CKEDITOR.inlineAll=function(){var a,f,c;for(c in CKEDITOR.dtd.$editable)for(var e=CKEDITOR.document.getElementsByTag(c),b=0,g=e.count();b"+(a.title?'{voiceLabel}':"")+'<{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation">{bottomHtml}'), -b=CKEDITOR.dom.element.createFromHtml(j.output({id:a.id,name:b,langDir:a.lang.dir,langCode:a.langCode,voiceLabel:a.title,topHtml:d?''+d+"":"",contentId:a.ui.spaceId("contents"),bottomHtml:h?''+h+"":"",outerEl:CKEDITOR.env.ie?"span":"div"}));if(f==CKEDITOR.ELEMENT_MODE_REPLACE){c.hide();b.insertAfter(c)}else c.append(b); -a.container=b;d&&a.ui.space("top").unselectable();h&&a.ui.space("bottom").unselectable();c=a.config.width;f=a.config.height;c&&b.setStyle("width",CKEDITOR.tools.cssLength(c));f&&a.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(f));b.disableContextMenu();CKEDITOR.env.webkit&&b.on("focus",function(){a.focus()});a.fireOnce("uiReady")}CKEDITOR.replace=function(c,b){return a(c,b,null,CKEDITOR.ELEMENT_MODE_REPLACE)};CKEDITOR.appendTo=function(c,b,f){return a(c,b,f,CKEDITOR.ELEMENT_MODE_APPENDTO)}; -CKEDITOR.replaceAll=function(){for(var a=document.getElementsByTagName("textarea"),b=0;b",h="",a=g+a.replace(f,function(){return h+g})+h}a=a.replace(/\n/g,"
");b||(a=a.replace(RegExp("
(?=)"),function(a){return e.repeat(a,2)}));a=a.replace(/^ | $/g," ");a=a.replace(/(>|\s) /g,function(a,b){return b+" "}).replace(/ (?=<)/g," ");p(this,"text",a)},insertElement:function(a,b){b?this.insertElementIntoRange(a,b):this.insertElementIntoSelection(a)},insertElementIntoRange:function(a,b){var c=this.editor,d=c.config.enterMode,e=a.getName(),f=CKEDITOR.dtd.$block[e]; -if(b.checkReadOnly())return false;b.deleteContents(1);b.startContainer.type==CKEDITOR.NODE_ELEMENT&&b.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})&&o(b);var g,h;if(f)for(;(g=b.getCommonAncestor(0,1))&&(h=CKEDITOR.dtd[g.getName()])&&(!h||!h[e]);)if(g.getName()in CKEDITOR.dtd.span)b.splitElement(g);else if(b.checkStartOfBlock()&&b.checkEndOfBlock()){b.setStartBefore(g);b.collapse(true);g.remove()}else b.splitBlock(d==CKEDITOR.ENTER_DIV?"div":"p",c.editable());b.insertNode(a);return true}, -insertElementIntoSelection:function(a){d(this);var b=this.editor,c=b.activeEnterMode,b=b.getSelection(),f=b.getRanges()[0],g=a.getName(),g=CKEDITOR.dtd.$block[g];if(this.insertElementIntoRange(a,f)){f.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);if(g)if((g=a.getNext(function(a){return e(a)&&!k(a)}))&&g.type==CKEDITOR.NODE_ELEMENT&&g.is(CKEDITOR.dtd.$block))g.getDtd()["#"]?f.moveToElementEditStart(g):f.moveToElementEditEnd(a);else if(!g&&c!=CKEDITOR.ENTER_BR){g=f.fixBlock(true,c==CKEDITOR.ENTER_DIV? -"div":"p");f.moveToElementEditStart(g)}}b.selectRanges([f]);h(this)},setData:function(a,b){b||(a=this.editor.dataProcessor.toHtml(a));this.setHtml(a);this.fixInitialSelection();if(this.status=="unloaded")this.status="ready";this.editor.fire("dataReady")},getData:function(a){var b=this.getHtml();a||(b=this.editor.dataProcessor.toDataFormat(b));return b},setReadOnly:function(a){this.setAttribute("contenteditable",!a)},detach:function(){this.removeClass("cke_editable");this.status="detached";var a=this.editor; -this._.detach();delete a.document;delete a.window},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},fixInitialSelection:function(){function a(){var b=c.getDocument().$,d=b.getSelection(),e;if(d.anchorNode&&d.anchorNode==c.$)e=true;else if(CKEDITOR.env.webkit){var f=c.getDocument().getActive();f&&(f.equals(c)&&!d.anchorNode)&&(e=true)}if(e){e=new CKEDITOR.dom.range(c);e.moveToElementEditStart(c);b=b.createRange();b.setStart(e.startContainer.$,e.startOffset);b.collapse(true); -d.removeAllRanges();d.addRange(b)}}function b(){var a=c.getDocument().$,d=a.selection,e=c.getDocument().getActive();if(d.type=="None"&&e.equals(c)){d=new CKEDITOR.dom.range(c);a=a.body.createTextRange();d.moveToElementEditStart(c);d=d.startContainer;d.type!=CKEDITOR.NODE_ELEMENT&&(d=d.getParent());a.moveToElementText(d.$);a.collapse(true);a.select()}}var c=this;if(CKEDITOR.env.ie&&(CKEDITOR.env.version<9||CKEDITOR.env.quirks)){if(this.hasFocus){this.focus();b()}}else if(this.hasFocus){this.focus(); -a()}else this.once("focus",function(){a()},null,null,-999)},setup:function(){var a=this.editor;this.attachListener(a,"beforeGetData",function(){var b=this.getData();this.is("textarea")||a.config.ignoreEmptyParagraph!==false&&(b=b.replace(l,function(a,b){return b}));a.setData(b,null,1)},this);this.attachListener(a,"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(a,"afterSetData",function(){this.setData(a.getData(1))},this);this.attachListener(a,"loadSnapshot",function(a){this.setData(a.data, -1)},this);this.attachListener(a,"beforeFocus",function(){var b=a.getSelection();(b=b&&b.getNative())&&b.type=="Control"||this.focus()},this);this.attachListener(a,"insertHtml",function(a){this.insertHtml(a.data.dataValue,a.data.mode)},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");this.attachClass(a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE? -"cke_editable_inline":a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE||a.elementMode==CKEDITOR.ELEMENT_MODE_APPENDTO?"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=false},null,null,-1);this.on("focus",function(){this.hasFocus=true},null,null,-1);a.focusManager.add(this);if(this.equals(CKEDITOR.document.getActive())){this.hasFocus=true; -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 b=a.document;this.changeAttr("spellcheck",!a.config.disableNativeSpellChecker);var d=a.config.contentsLangDirection;this.getDirection(1)!=d&&this.changeAttr("dir",d);var f=CKEDITOR.getCss();if(f){d=b.getHead();if(!d.getCustomData("stylesheet")){f=b.appendStyleText(f);f=new CKEDITOR.dom.element(f.ownerNode|| -f.owningElement);d.setCustomData("stylesheet",f);f.data("cke-temp",1)}}d=b.getCustomData("stylesheet_ref")||0;b.setCustomData("stylesheet_ref",d+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){var a=a.data,b=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&(a.$.button!=2&&b.isReadOnly())&&a.preventDefault()});var h={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return true;var c=b.data.domEvent.getKey(), -d;if(c in h){var b=a.getSelection(),e,f=b.getRanges()[0],j=f.startPath(),i,k,l,c=c==8;if(CKEDITOR.env.ie&&CKEDITOR.env.version<11&&(e=b.getSelectedElement())||(e=g(b))){a.fire("saveSnapshot");f.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);e.remove();f.select();a.fire("saveSnapshot");d=1}else if(f.collapsed)if((i=j.block)&&(l=i[c?"getPrevious":"getNext"](n))&&l.type==CKEDITOR.NODE_ELEMENT&&l.is("table")&&f[c?"checkStartOfBlock":"checkEndOfBlock"]()){a.fire("saveSnapshot");f[c?"checkEndOfBlock": -"checkStartOfBlock"]()&&i.remove();f["moveToElementEdit"+(c?"End":"Start")](l);f.select();a.fire("saveSnapshot");d=1}else if(j.blockLimit&&j.blockLimit.is("td")&&(k=j.blockLimit.getAscendant("table"))&&f.checkBoundaryOfElement(k,c?CKEDITOR.START:CKEDITOR.END)&&(l=k[c?"getPrevious":"getNext"](n))){a.fire("saveSnapshot");f["moveToElementEdit"+(c?"End":"Start")](l);f.checkStartOfBlock()&&f.checkEndOfBlock()?l.remove():f.select();a.fire("saveSnapshot");d=1}else if((k=j.contains(["td","th","caption"]))&& -f.checkBoundaryOfElement(k,c?CKEDITOR.START:CKEDITOR.END))d=1}return!d});a.blockless&&(CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)&&this.attachListener(this,"keyup",function(b){if(b.data.getKeystroke()in h&&!this.getFirst(e)){this.appendBogus();b=a.createRange();b.moveToPosition(this,CKEDITOR.POSITION_AFTER_START);b.select()}});this.attachListener(this,"dblclick",function(b){if(a.readOnly)return false;b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this, -"click",c);CKEDITOR.env.ie||this.attachListener(this,"mousedown",function(b){var c=b.data.getTarget();if(c.is("img","hr","input","textarea","select")&&!c.isReadOnly()){a.getSelection().selectElement(c);c.is("input","textarea","select")&&b.data.preventDefault()}});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(b.data.$.button==2){b=b.data.getTarget();if(!b.getOuterHtml().replace(l,"")){var c=a.createRange();c.moveToElementEditStart(b);c.select(true)}}});if(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 true;b=b.data.domEvent.getKey();if(b in h){var c=b==8,d=a.getSelection().getRanges()[0],b=d.startPath();if(d.collapsed){var e;a:{var f=b.block;if(f)if(d[c?"checkStartOfBlock":"checkEndOfBlock"]())if(!d.moveToClosestEditablePosition(f, -!c)||!d.collapsed)e=false;else{if(d.startContainer.type==CKEDITOR.NODE_ELEMENT){var g=d.startContainer.getChild(d.startOffset-(c?1:0));if(g&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("hr")){a.fire("saveSnapshot");g.remove();e=true;break a}}if((d=d.startPath().block)&&(!d||!d.contains(f))){a.fire("saveSnapshot");var i;(i=(c?d:f).getBogus())&&i.remove();e=a.getSelection();i=e.createBookmarks();(c?f:d).moveChildren(c?d:f,false);b.lastElement.mergeSiblings();j(f,d,!c);e.selectBookmarks(i);e=true}}else e=false; -else e=false}if(!e)return}else{c=d;e=b.block;i=c.endPath().block;if(!e||!i||e.equals(i))b=false;else{a.fire("saveSnapshot");(f=e.getBogus())&&f.remove();c.deleteContents();if(i.getParent()){i.moveChildren(e,false);b.lastElement.mergeSiblings();j(e,i,true)}c=a.getSelection().getRanges()[0];c.collapse(1);c.select();b=true}if(!b)return}a.getSelection().scrollIntoView();a.fire("saveSnapshot");return false}},this,null,100)}}},_:{detach:function(){this.editor.setData(this.editor.getData(),0,1);this.clearListeners(); -this.restoreAttrs();var a;if(a=this.removeCustomData("classes"))for(;a.length;)this.removeClass(a.pop());if(!this.is("textarea")){a=this.getDocument();var b=a.getHead();if(b.getCustomData("stylesheet")){var c=a.getCustomData("stylesheet_ref");if(--c)a.setCustomData("stylesheet_ref",c);else{a.removeCustomData("stylesheet_ref");b.removeCustomData("stylesheet").remove()}}}this.editor.fire("contentDomUnload");delete this.editor}}});CKEDITOR.editor.prototype.editable=function(a){var b=this._.editable; -if(b&&a)return 0;if(arguments.length)b=this._.editable=a?a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,a):(b&&b.detach(),null);return b};var k=CKEDITOR.dom.walker.bogus(),l=/(^|]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,n=CKEDITOR.dom.walker.whitespaces(true),q=CKEDITOR.dom.walker.bookmark(false,true);CKEDITOR.on("instanceLoaded",function(b){var c=b.editor;c.on("insertElement",function(a){a=a.data;if(a.type== -CKEDITOR.NODE_ELEMENT&&(a.is("input")||a.is("textarea"))){a.getAttribute("contentEditable")!="false"&&a.data("cke-editable",a.hasAttribute("contenteditable")?"true":"1");a.setAttribute("contentEditable",false)}});c.on("selectionChange",function(b){if(!c.readOnly){var d=c.getSelection();if(d&&!d.isLocked){d=c.checkDirty();c.fire("lockSnapshot");a(b);c.fire("unlockSnapshot");!d&&c.resetDirty()}}})});CKEDITOR.on("instanceCreated",function(a){var b=a.editor;b.on("mode",function(){var a=b.editable();if(a&& -a.isInline()){var c=b.title;a.changeAttr("role","textbox");a.changeAttr("aria-label",c);c&&a.changeAttr("title",c);var d=b.fire("ariaEditorHelpLabel",{}).label;if(d)if(c=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents")){var e=CKEDITOR.tools.getNextId(),d=CKEDITOR.dom.element.createFromHtml(''+d+"");c.append(d);a.changeAttr("aria-describedby",e)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}"); -var p=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(c,d){var e,f,g,h,i=[],k=d.range.startContainer;e=d.range.startPath();for(var k=j[k.getName()],l=0,p=c.getChildren(),v=p.count(),u=-1,n=-1,z=0,q=e.contains(j.$list);l-1)i[u].firstNotAllowed=1;if(n>-1)i[n].lastNotAllowed=1;return i}function c(b,d){var e=[],f=b.getChildren(),g=f.count(),h,i=0,k=j[d],l=!b.is(j.$inline)||b.is("br");for(l&&e.push(" ");i ",o.document);o.insertNode(D);o.setStartAfter(D)}J=new CKEDITOR.dom.elementPath(o.startContainer);n.endPath=N=new CKEDITOR.dom.elementPath(o.endContainer);if(!o.collapsed){var E=N.block||N.blockLimit,S=o.getCommonAncestor();E&&(!E.equals(S)&& -!E.contains(S)&&o.checkEndOfBlock())&&n.zombies.push(E);o.deleteContents()}for(;(H=a(o.startContainer)&&o.startContainer.getChild(o.startOffset-1))&&a(H)&&H.isBlockBoundary()&&J.contains(H);)o.moveToPosition(H,CKEDITOR.POSITION_BEFORE_END);f(o,n.blockLimit,J,N);if(D){o.setEndBefore(D);o.collapse();D.remove()}D=o.startPath();if(E=D.contains(d,false,1)){o.splitElement(E);n.inlineStylesRoot=E;n.inlineStylesPeak=D.lastElement}D=o.createBookmark();(E=D.startNode.getPrevious(e))&&a(E)&&d(E)&&G.push(E); -(E=D.startNode.getNext(e))&&a(E)&&d(E)&&G.push(E);for(E=D.startNode;(E=E.getParent())&&d(E);)G.push(E);o.moveToBookmark(D);if(D=q){D=n.range;if(n.type=="text"&&n.inlineStylesRoot){H=n.inlineStylesPeak;o=H.getDocument().createText("{cke-peak}");for(G=n.inlineStylesRoot.getParent();!H.equals(G);){o=o.appendTo(H.clone());H=H.getParent()}q=o.getOuterHtml().split("{cke-peak}").join(q)}H=n.blockLimit.getName();if(/^\s+|\s+$/.test(q)&&"span"in CKEDITOR.dtd[H])var O=' ', -q=O+q+O;q=n.editor.dataProcessor.toHtml(q,{context:null,fixForBody:false,dontFilter:n.dontFilter,filter:n.editor.activeFilter,enterMode:n.editor.activeEnterMode});H=D.document.createElement("body");H.setHtml(q);if(O){H.getFirst().remove();H.getLast().remove()}if((O=D.startPath().block)&&!(O.getChildCount()==1&&O.getBogus()))a:{var M;if(H.getChildCount()==1&&a(M=H.getFirst())&&M.is(l)){O=M.getElementsByTag("*");D=0;for(G=O.count();D0;else{I=M.startPath();if(!N.isBlock&&i(n.editor,I.block,I.blockLimit)&&(Q=n.editor.activeEnterMode!=CKEDITOR.ENTER_BR&&n.editor.config.autoParagraph!==false?n.editor.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p":false)){Q=O.createElement(Q);Q.appendBogus();M.insertNode(Q);CKEDITOR.env.needsBrFiller&&(P=Q.getBogus())&& -P.remove();M.moveToPosition(Q,CKEDITOR.POSITION_BEFORE_END)}if((I=M.startPath().block)&&!I.equals(L)){if(P=I.getBogus()){P.remove();H.push(I)}L=I}N.firstNotAllowed&&(o=1);if(o&&N.isElement){I=M.startContainer;for(R=null;I&&!j[I.getName()][N.name];){if(I.equals(q)){I=null;break}R=I;I=I.getParent()}if(I){if(R){T=M.splitElement(R);n.zombies.push(T);n.zombies.push(R)}}else{R=q.getName();X=!D;I=D==J.length-1;R=c(N.node,R);for(var U=[],V=R.length,W=0,Z=void 0,Y=0,$=-1;W0;){d=a.getItem(b);if(!CKEDITOR.tools.trim(d.getHtml())){d.appendBogus();CKEDITOR.env.ie&&(CKEDITOR.env.version<9&&d.getChildCount())&& -d.getFirst().remove()}}}return function(d){var e=d.startContainer,f=e.getAscendant("table",1),g=false;c(f.getElementsByTag("td"));c(f.getElementsByTag("th"));f=d.clone();f.setStart(e,0);f=a(f).lastBackward();if(!f){f=d.clone();f.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);f=a(f).lastForward();g=true}f||(f=e);if(f.is("table")){d.setStartAt(f,CKEDITOR.POSITION_BEFORE_START);d.collapse(true);f.remove()}else{f.is({tbody:1,thead:1,tfoot:1})&&(f=b(f,"tr",g));f.is("tr")&&(f=b(f,f.getParent().is("thead")?"th": -"td",g));(e=f.getBogus())&&e.remove();d.moveToPosition(f,g?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END)}}}()}(),function(){function a(){var a=this._.fakeSelection,b;if(a){b=this.getSelection(1);if(!b||!b.isHidden()){a.reset();a=0}}if(!a){a=b||this.getSelection(1);if(!a||a.getType()==CKEDITOR.SELECTION_NONE)return}this.fire("selectionCheck",a);b=this.elementPath();if(!b.compare(this._.selectionPreviousPath)){if(CKEDITOR.env.webkit)this._.previousActive=this.document.getActive();this._.selectionPreviousPath= -b;this.fire("selectionChange",{selection:a,path:b})}}function f(){p=true;if(!q){c.call(this);q=CKEDITOR.tools.setTimeout(c,200,this)}}function c(){q=null;if(p){CKEDITOR.tools.setTimeout(a,0,this);p=false}}function e(a){return o(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?true:false}function b(a){function b(c,d){return!c||c.type==CKEDITOR.NODE_TEXT?false:a.clone()["moveToElementEdit"+(d?"End":"Start")](c)}if(!(a.root instanceof CKEDITOR.editable))return false;var c=a.startContainer, -d=a.getPreviousNode(e,null,c),f=a.getNextNode(e,null,c);return b(d)||b(f,1)||!d&&!f&&!(c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary()&&c.getBogus())?true:false}function g(a){return a.getCustomData("cke-fillingChar")}function i(a,b){var c=a&&a.removeCustomData("cke-fillingChar");if(c){if(b!==false){var e,f=a.getDocument().getSelection().getNative(),g=f&&f.type!="None"&&f.getRangeAt(0);if(c.getLength()>1&&g&&g.intersectsNode(c.$)){e=h(f);g=f.focusNode==c.$&&f.focusOffset>0;f.anchorNode==c.$&&f.anchorOffset> -0&&e[0].offset--;g&&e[1].offset--}}c.setText(d(c.getText()));e&&j(a.getDocument().$,e)}}function d(a){return a.replace(/\u200B( )?/g,function(a){return a[1]?" ":""})}function h(a){return[{node:a.anchorNode,offset:a.anchorOffset},{node:a.focusNode,offset:a.focusOffset}]}function j(a,b){var c=a.getSelection(),d=a.createRange();d.setStart(b[0].node,b[0].offset);d.collapse(true);c.removeAllRanges();c.addRange(d);c.extend(b[1].node,b[1].offset)}function k(a){var b=CKEDITOR.dom.element.createFromHtml('
 
',a.document);a.fire("lockSnapshot");a.editable().append(b);var c=a.getSelection(1),d=a.createRange(),e=c.root.on("selectionchange",function(a){a.cancel()},null,null,0);d.setStartAt(b,CKEDITOR.POSITION_AFTER_START);d.setEndAt(b,CKEDITOR.POSITION_BEFORE_END);c.selectRanges([d]);e.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=b}function l(a){var b={37:1,39:1,8:1,46:1};return function(c){var d= -c.data.getKeystroke();if(b[d]){var e=a.getSelection().getRanges(),f=e[0];if(e.length==1&&f.collapsed)if((d=f[d<38?"getPreviousEditableNode":"getNextEditableNode"]())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getAttribute("contenteditable")=="false"){a.getSelection().fake(d);c.data.preventDefault();c.cancel()}}}}function n(a){for(var b=0;b=d.getLength()?h.setStartAfter(d):h.setStartBefore(d));e&&e.type==CKEDITOR.NODE_TEXT&&(g?h.setEndAfter(e):h.setEndBefore(e));d=new CKEDITOR.dom.walker(h);d.evaluator=function(d){if(d.type==CKEDITOR.NODE_ELEMENT&&d.isReadOnly()){var e=c.clone(); -c.setEndBefore(d);c.collapsed&&a.splice(b--,1);if(!(d.getPosition(h.endContainer)&CKEDITOR.POSITION_CONTAINS)){e.setStartAfter(d);e.collapsed||a.splice(b+1,0,e)}return true}return false};d.next()}}return a}var q,p,o=CKEDITOR.dom.walker.invisible(1),m=function(){function a(b){return function(a){var c=a.editor.createRange();c.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([c]);return false}}function b(a){return function(b){var c=b.editor,d=c.createRange(),e;if(!(e= -d.moveToClosestEditablePosition(b.selected,a)))e=d.moveToClosestEditablePosition(b.selected,!a);e&&c.getSelection().selectRanges([d]);c.fire("saveSnapshot");b.selected.remove();if(!e){d.moveToElementEditablePosition(c.editable());c.getSelection().selectRanges([d])}c.fire("saveSnapshot");return false}}var c=a(),d=a(1);return{37:c,38:c,39:d,40:d,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(b){function c(){var a=d.getSelection();a&&a.removeAllRanges()}var d=b.editor;d.on("contentDom",function(){function b(){n= -new CKEDITOR.dom.selection(d.getSelection());n.lock()}function c(){g.removeListener("mouseup",c);k.removeListener("mouseup",c);var a=CKEDITOR.document.$.selection,b=a.createRange();a.type!="None"&&b.parentElement().ownerDocument==e.$&&b.select()}var e=d.document,g=CKEDITOR.document,h=d.editable(),j=e.getBody(),k=e.getDocumentElement(),m=h.isInline(),p,n;CKEDITOR.env.gecko&&h.attachListener(h,"focus",function(a){a.removeListener();if(p!==0)if((a=d.getSelection().getNative())&&a.isCollapsed&&a.anchorNode== -h.$){a=d.createRange();a.moveToElementEditStart(h);a.select()}},null,null,-2);h.attachListener(h,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){p&&CKEDITOR.env.webkit&&(p=d._.previousActive&&d._.previousActive.equals(e.getActive()));d.unlockSelection(p);p=0},null,null,-1);h.attachListener(h,"mousedown",function(){p=0});if(CKEDITOR.env.ie||m){r?h.attachListener(h,"beforedeactivate",b,null,null,-1):h.attachListener(d,"selectionCheck",b,null,null,-1);h.attachListener(h,CKEDITOR.env.webkit?"DOMFocusOut": -"blur",function(){d.lockSelection(n);p=1},null,null,-1);h.attachListener(h,"mousedown",function(){p=0})}if(CKEDITOR.env.ie&&!m){var v;h.attachListener(h,"mousedown",function(a){if(a.data.$.button==2){a=d.document.getSelection();if(!a||a.getType()==CKEDITOR.SELECTION_NONE)v=d.window.getScrollPosition()}});h.attachListener(h,"mouseup",function(a){if(a.data.$.button==2&&v){d.document.$.documentElement.scrollLeft=v.x;d.document.$.documentElement.scrollTop=v.y}v=null});if(e.$.compatMode!="BackCompat"){if(CKEDITOR.env.ie7Compat|| -CKEDITOR.env.ie6Compat)k.on("mousedown",function(a){function b(a){a=a.data.$;if(d){var c=j.$.createTextRange();try{c.moveToPoint(a.clientX,a.clientY)}catch(e){}d.setEndPoint(f.compareEndPoints("StartToStart",c)<0?"EndToEnd":"StartToStart",c);d.select()}}function c(){k.removeListener("mousemove",b);g.removeListener("mouseup",c);k.removeListener("mouseup",c);d.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y7&&CKEDITOR.env.version<11)k.on("mousedown",function(a){if(a.data.getTarget().is("html")){g.on("mouseup",c);k.on("mouseup",c)}})}}h.attachListener(h,"selectionchange",a,d);h.attachListener(h,"keyup",f,d);h.attachListener(h,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){d.forceNextSelectionCheck();d.selectionChange(1)});if(m&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var o; -h.attachListener(h,"mousedown",function(){o=1});h.attachListener(e.getDocumentElement(),"mouseup",function(){o&&f.call(d);o=0})}else h.attachListener(CKEDITOR.env.ie?h:e.getDocumentElement(),"mouseup",f,d);CKEDITOR.env.webkit&&h.attachListener(e,"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:i(h)}},null,null,-1);h.attachListener(h,"keydown",l(d),null,null,-1)});d.on("setData",function(){d.unlockSelection();CKEDITOR.env.webkit&& -c()});d.on("contentDomUnload",function(){d.unlockSelection()});if(CKEDITOR.env.ie9Compat)d.on("beforeDestroy",c,null,null,9);d.on("dataReady",function(){delete d._.fakeSelection;delete d._.hiddenSelectionContainer;d.selectionChange(1)});d.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=d.editable().getLast(a);if(b&&b.hasAttribute("data-cke-hidden-sel")){b.remove();if(CKEDITOR.env.gecko)(a=d.editable().getFirst(a))&&(a.is("br")&&a.getAttribute("_moz_editor_bogus_node"))&& -a.remove()}},null,null,100);d.on("key",function(a){if(d.mode=="wysiwyg"){var b=d.getSelection();if(b.isFake){var c=m[a.data.keyCode];if(c)return c({editor:d,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});CKEDITOR.on("instanceReady",function(a){function b(){var a=e.editable();if(a)if(a=g(a)){var c=e.document.$.getSelection();if(c.type!="None"&&(c.anchorNode==a.$||c.focusNode==a.$))k=h(c);f=a.getText();a.setText(d(f))}}function c(){var a=e.editable();if(a)if(a=g(a)){a.setText(f);if(k){j(e.document.$, -k);k=null}}}var e=a.editor,f,k;if(CKEDITOR.env.webkit){e.on("selectionChange",function(){var a=e.editable(),b=g(a);b&&(b.getCustomData("ready")?i(a):b.setCustomData("ready",1))},null,null,-1);e.on("beforeSetMode",function(){i(e.editable())},null,null,-1);e.on("beforeUndoImage",b);e.on("afterUndoImage",c);e.on("beforeGetData",b,null,null,0);e.on("getData",c)}});CKEDITOR.editor.prototype.selectionChange=function(b){(b?a:f).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){if((this._.savedSelection|| -this._.fakeSelection)&&!a)return this._.savedSelection||this._.fakeSelection;return(a=this.editable())&&this.mode=="wysiwyg"?new CKEDITOR.dom.selection(a):null};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);if(a.getType()!=CKEDITOR.SELECTION_NONE){!a.isLocked&&a.lock();this._.savedSelection=a;return true}return false};CKEDITOR.editor.prototype.unlockSelection=function(a){var b=this._.savedSelection;if(b){b.unlock(a);delete this._.savedSelection;return true}return false}; -CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath};CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};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;var r=typeof window.getSelection!= -"function",v=1;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection)var b=a,a=a.root;var c=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:v++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=c?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(b){CKEDITOR.tools.extend(this._.cache,b._.cache);this.isFake=b.isFake;this.isLocked=b.isLocked;return this}var a=this.getNative(),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=CKEDITOR.SELECTION_NONE;this._.cache.startElement=null;this._.cache.selectedElement=null;this._.cache.selectedText="";this._.cache.ranges=new CKEDITOR.dom.rangeList}return this};var t={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.dom.selection.prototype={getNative:function(){return this._.cache.nativeSel!==void 0?this._.cache.nativeSel:this._.cache.nativeSel=r?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:r?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var c=this.getNative(),d=c.type;if(d=="Text")b=CKEDITOR.SELECTION_TEXT;if(d=="Control")b= -CKEDITOR.SELECTION_ELEMENT;if(c.createRange().parentElement())b=CKEDITOR.SELECTION_TEXT}catch(e){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_TEXT,c=this.getNative();if(!c||!c.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(c.rangeCount==1){var c=c.getRangeAt(0),d=c.startContainer;if(d==c.endContainer&&d.nodeType==1&&c.endOffset-c.startOffset==1&&t[d.childNodes[c.startOffset].nodeName.toLowerCase()])b=CKEDITOR.SELECTION_ELEMENT}return a.type=b},getRanges:function(){var a= -r?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,c){b=b.duplicate();b.collapse(c);var d=b.parentElement();if(!d.hasChildNodes())return{container:d,offset:0};for(var e=d.children,f,g,h=b.duplicate(),j=0,i=e.length-1,k=-1,m,l;j<=i;){k=Math.floor((j+i)/2);f=e[k];h.moveToElementText(f);m=h.compareEndPoints("StartToStart",b);if(m>0)i=k-1;else if(m<0)j=k+1;else return{container:d,offset:a(f)}}if(k==-1||k==e.length-1&&m<0){h.moveToElementText(d);h.setEndPoint("StartToStart", -b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!h){f=e[e.length-1];return f.nodeType!=CKEDITOR.NODE_TEXT?{container:d,offset:e.length}:{container:f,offset:f.nodeValue.length}}for(d=e.length;h>0&&d>0;){g=e[--d];if(g.nodeType==CKEDITOR.NODE_TEXT){l=g;h=h-g.nodeValue.length}}return{container:l,offset:-h}}h.collapse(m>0?true:false);h.setEndPoint(m>0?"StartToStart":"EndToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;if(!h)return{container:d,offset:a(f)+(m>0?0:1)};for(;h>0;)try{g= -f[m>0?"previousSibling":"nextSibling"];if(g.nodeType==CKEDITOR.NODE_TEXT){h=h-g.nodeValue.length;l=g}f=g}catch(p){return{container:d,offset:a(f)}}return{container:l,offset:m>0?-h:l.nodeValue.length+h}};return function(){var a=this.getNative(),c=a&&a.createRange(),d=this.getType();if(!a)return[];if(d==CKEDITOR.SELECTION_TEXT){a=new CKEDITOR.dom.range(this.root);d=b(c,true);a.setStart(new CKEDITOR.dom.node(d.container),d.offset);d=b(c);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();return[a]}if(d==CKEDITOR.SELECTION_ELEMENT){for(var d=[],e=0;e1){g=a[a.length-1];a[0].setEnd(g.endContainer,g.endOffset)}g=a[0];var a=g.collapsed,k,m,l;if((d=g.getEnclosedNode())&&d.type== -CKEDITOR.NODE_ELEMENT&&d.getName()in t&&(!d.is("a")||!d.getText()))try{l=d.$.createControlRange();l.addElement(d.$);l.select();return}catch(p){}if(g.startContainer.type==CKEDITOR.NODE_ELEMENT&&g.startContainer.getName()in c||g.endContainer.type==CKEDITOR.NODE_ELEMENT&&g.endContainer.getName()in c){g.shrink(CKEDITOR.NODE_ELEMENT,true);a=g.collapsed}l=g.createBookmark();c=l.startNode;if(!a)f=l.endNode;l=g.document.$.body.createTextRange();l.moveToElementText(c.$);l.moveStart("character",1);if(f){h= -g.document.$.body.createTextRange();h.moveToElementText(f.$);l.setEndPoint("EndToEnd",h);l.moveEnd("character",-1)}else{k=c.getNext(j);m=c.hasAscendant("pre");k=!(k&&k.getText&&k.getText().match(h))&&(m||!c.hasPrevious()||c.getPrevious().is&&c.getPrevious().is("br"));m=g.document.createElement("span");m.setHtml("");m.insertBefore(c);k&&g.document.createText("").insertBefore(c)}g.setStartBefore(c);c.remove();if(a){if(k){l.moveStart("character",-1);l.select();g.document.$.selection.clear()}else l.select(); -g.moveToPosition(m,CKEDITOR.POSITION_BEFORE_START);m.remove()}else{g.setEndBefore(f);f.remove();l.select()}}else{f=this.getNative();if(!f)return;this.removeAllRanges();for(l=0;l= -0){g.collapse(1);m.setEnd(g.endContainer.$,g.endOffset)}else throw n;}f.addRange(m)}}this.reset();this.root.fire("selectionchange")}}},fake:function(a){var b=this.root.editor;this.reset();k(b);var c=this._.cache,d=new CKEDITOR.dom.range(this.root);d.setStartBefore(a);d.setEndAfter(a);c.ranges=new CKEDITOR.dom.rangeList(d);c.selectedElement=c.startElement=a;c.type=CKEDITOR.SELECTION_ELEMENT;c.selectedText=c.nativeSel=null;this.isFake=1;this.rev=v++;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"))},createBookmarks:function(a){a=this.getRanges().createBookmarks(a);this.isFake&&(a.isFake=1);return a},createBookmarks2:function(a){a=this.getRanges().createBookmarks2(a);this.isFake&&(a.isFake=1);return a},selectBookmarks:function(a){for(var b=[],c=0;c]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+| )/g, -" ");f=f.replace(/]*>/gi,"\n");if(CKEDITOR.env.ie){var g=a.getDocument().createElement("div");g.append(e);e.$.outerHTML="
"+f+"
";e.copyAttributes(g.getFirst());e=g.getFirst().remove()}else e.setHtml(f);b=e}else f?b=l(c?[a.getHtml()]:j(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,h;if((h=c.getPrevious(B))&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("pre")){d=k(h.getHtml(),/\n$/,"")+"\n\n"+k(c.getHtml(),/^\n/,"");CKEDITOR.env.ie?c.$.outerHTML="
"+d+"
":c.setHtml(d);h.remove()}}else c&& -o(b)}function j(a){var b=[];k(a.getOuterHtml(),/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"
"+c+"
"}).replace(/([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function k(a,b,c){var d="",e="",a=a.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi,function(a,b,c){b&&(d=b);c&&(e=c);return""});return d+a.replace(b,c)+e}function l(a,b){var c;a.length>1&&(c=new CKEDITOR.dom.documentFragment(b.getDocument()));
-for(var d=0;d"),e=e.replace(/[ \t]{2,}/g,function(a){return CKEDITOR.tools.repeat(" ",a.length-1)+" "});if(c){var f=b.clone();f.setHtml(e);c.append(f)}else b.setHtml(e)}return c||b}function n(a,b){var c=this._.definition,
-d=c.attributes,c=c.styles,e=t(this)[a.getName()],f=CKEDITOR.tools.isEmpty(d)&&CKEDITOR.tools.isEmpty(c),g;for(g in d)if(!((g=="class"||this._.definition.fullMatch)&&a.getAttribute(g)!=z(g,d[g]))&&!(b&&g.slice(0,5)=="data-")){f=a.hasAttribute(g);a.removeAttribute(g)}for(var h in c)if(!(this._.definition.fullMatch&&a.getStyle(h)!=z(h,c[h],true))){f=f||!!a.getStyle(h);a.removeStyle(h)}p(a,e,w[a.getName()]);f&&(this._.definition.alwaysRemoveElement?o(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==
-CKEDITOR.ENTER_BR&&!a.hasAttributes()?o(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function q(a){for(var b=t(this),c=a.getElementsByTag(this.element),d,e=c.count();--e>=0;){d=c.getItem(e);d.isReadOnly()||n.call(this,d,true)}for(var f in b)if(f!=this.element){c=a.getElementsByTag(f);for(e=c.count()-1;e>=0;e--){d=c.getItem(e);d.isReadOnly()||p(d,b[f])}}}function p(a,b,c){if(b=b&&b.attributes)for(var d=0;d",a||b.name,"");return c.join("")},getDefinition:function(){return this._.definition}};CKEDITOR.style.getStyleText=function(a){var b=a._ST;if(b)return b;var b=a.styles,c=
-a.attributes&&a.attributes.style||"",d="";c.length&&(c=c.replace(x,";"));for(var e in b){var f=b[e],g=(e+":"+f).replace(x,";");f=="inherit"?d=d+g:c=c+g}c.length&&(c=CKEDITOR.tools.normalizeCssText(c,true));return a._ST=c+d};CKEDITOR.style.customHandlers={};CKEDITOR.style.addCustomHandler=function(a){var b=function(a){this._={definition:a};this.setup&&this.setup(a)};b.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),{assignedTo:CKEDITOR.STYLE_OBJECT},a,true);
-return this.customHandlers[a.type]=b};var F=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,C=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED}(),CKEDITOR.styleCommand=function(a,f){this.requiredContent=this.allowedContent=this.style=a;CKEDITOR.tools.extend(this,f,true)},CKEDITOR.styleCommand.prototype.exec=function(a){a.focus();this.state==CKEDITOR.TRISTATE_OFF?a.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&
-a.removeStyle(this.style)},CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet"),CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet),CKEDITOR.loadStylesSet=function(a,f,c){CKEDITOR.stylesSet.addExternal(a,f,"");CKEDITOR.stylesSet.load(a,c)},CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(a,f){var c=this._.styleStateChangeCallbacks;if(!c){c=this._.styleStateChangeCallbacks=[];this.on("selectionChange",function(a){for(var b=
-0;b"}}),"use strict",function(){var a={},f={},c;for(c in CKEDITOR.dtd.$blockLimit)c in CKEDITOR.dtd.$list||(a[c]=1);for(c in CKEDITOR.dtd.$block)c in CKEDITOR.dtd.$blockLimit||c in CKEDITOR.dtd.$empty||(f[c]=1);CKEDITOR.dom.elementPath=function(c,b){var g=null,i=null,d=[],h=c,j,b=b||c.getDocument().getBody();do if(h.type==CKEDITOR.NODE_ELEMENT){d.push(h);if(!this.lastElement){this.lastElement=h;if(h.is(CKEDITOR.dtd.$object)||h.getAttribute("contenteditable")=="false")continue}if(h.equals(b))break;
-if(!i){j=h.getName();h.getAttribute("contenteditable")=="true"?i=h:!g&&f[j]&&(g=h);if(a[j]){var k;if(k=!g){if(j=j=="div"){a:{j=h.getChildren();k=0;for(var l=j.count();k-1}:typeof a=="function"?e=a:typeof a=="object"&&(e=function(b){return b.getName()in a});var b=this.elements,g=b.length;f&&g--;if(c){b=Array.prototype.slice.call(b,
-0);b.reverse()}for(f=0;f=e){g=b.createText("");g.insertAfter(this)}else{a=b.createText("");a.insertAfter(g);a.remove()}return g},substring:function(a,
-f){return typeof f!="number"?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,f)}}),function(){function a(a,e,b){var f=a.serializable,i=e[b?"endContainer":"startContainer"],d=b?"endOffset":"startOffset",h=f?e.document.getById(a.startNode):a.startNode,a=f?e.document.getById(a.endNode):a.endNode;if(i.equals(h.getPrevious())){e.startOffset=e.startOffset-i.getLength()-a.getPrevious().getLength();i=a.getNext()}else if(i.equals(a.getPrevious())){e.startOffset=e.startOffset-i.getLength();i=a.getNext()}i.equals(h.getParent())&&
-e[d]++;i.equals(a.getParent())&&e[d]++;e[b?"endContainer":"startContainer"]=i;return e}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,f)};var f={createIterator:function(){var a=this,e=CKEDITOR.dom.walker.bookmark(),b=[],f;return{getNextRange:function(i){f=f===void 0?0:f+1;var d=a[f];if(d&&a.length>1){if(!f)for(var h=a.length-1;h>=0;h--)b.unshift(a[h].createBookmark(true));if(i)for(var j=
-0;a[f+j+1];){for(var k=d.document,i=0,h=k.getById(b[j].endNode),k=k.getById(b[j+1].startNode);;){h=h.getNextSourceNode(false);if(k.equals(h))i=1;else if(e(h)||h.type==CKEDITOR.NODE_ELEMENT&&h.isBlockBoundary())continue;break}if(!i)break;j++}for(d.moveToBookmark(b.shift());j--;){h=a[++f];h.moveToBookmark(b.shift());d.setEnd(h.endContainer,h.endOffset)}}return d}}},createBookmarks:function(c){for(var e=[],b,f=0;fb?-1:1}),e=
-0,f;e',CKEDITOR.document);a.appendTo(CKEDITOR.document.getHead());try{var f=a.getComputedStyle("border-top-color"),
-c=a.getComputedStyle("border-right-color");CKEDITOR.env.hc=!!(f&&f==c)}catch(e){CKEDITOR.env.hc=false}a.remove()}if(CKEDITOR.env.hc)CKEDITOR.env.cssClass=CKEDITOR.env.cssClass+" cke_hc";CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(a=CKEDITOR._.pending){delete CKEDITOR._.pending;for(f=0;f0)for(var g=0;g=0;b--)if(a==o[b].name){o.splice(b,1);return}for(var g=[],e=[],d=t;d!=p&&d.name!=a;){d._.isBlockLike||e.unshift(d);g.push(d);d=d.returnPoint||d.parent}if(d!=
+p){for(b=0;b0?this.children[b-1]:null;if(e){if(a._.isBlockLike&&e.type==CKEDITOR.NODE_TEXT){e.value=CKEDITOR.tools.rtrim(e.value);if(e.value.length===
+0){this.children.pop();this.add(a);return}}e.next=a}a.previous=e;a.parent=this;this.children.splice(b,0,a);if(!this._.hasInlineStarted)this._.hasInlineStarted=a.type==CKEDITOR.NODE_TEXT||a.type==CKEDITOR.NODE_ELEMENT&&!a._.isBlockLike},filter:function(a,b){b=this.getFilterContext(b);a.onRoot(b,this);this.filterChildren(a,false,b)},filterChildren:function(a,b,e){if(this.childrenFilteredBy!=a.id){e=this.getFilterContext(e);if(b&&!this.parent)a.onRoot(e,this);this.childrenFilteredBy=a.id;for(b=0;b=0&&a
+7||d.name in CKEDITOR.dtd.tr||d.name in CKEDITOR.dtd.$listItem))h=false;else{h=b(d);h=!h||d.name=="form"&&h.name=="input"}h&&d.add(g(a))}}}function f(a,b){if((!l||CKEDITOR.env.needsBrFiller)&&a.type==CKEDITOR.NODE_ELEMENT&&a.name=="br"&&!a.attributes["data-cke-eol"])return true;var c;if(a.type==CKEDITOR.NODE_TEXT&&(c=a.value.match(o))){if(c.index){(new CKEDITOR.htmlParser.text(a.value.substring(0,c.index))).insertBefore(a);a.value=c[0]}if(!CKEDITOR.env.needsBrFiller&&l&&(!b||a.parent.name in v))return true;
+if(!l)if((c=a.previous)&&c.name=="br"||!c||k(c))return true}return false}var j={elements:{}},l=c=="html",v=CKEDITOR.tools.extend({},u),n;for(n in v)"#"in t[n]||delete v[n];for(n in v)j.elements[n]=h(l,a.config.fillEmptyBlocks);j.root=h(l,false);j.elements.br=function(a){return function(b){if(b.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var c=b.attributes;if("data-cke-bogus"in c||"data-cke-eol"in c)delete c["data-cke-bogus"];else{for(c=b.next;c&&d(c);)c=c.next;var h=e(b);!c&&k(b.parent)?i(b.parent,
+g(a)):k(c)&&(h&&!k(h))&&g(a).insertBefore(c)}}}}(l);return j}function f(a,b){return a!=CKEDITOR.ENTER_BR&&b!==false?a==CKEDITOR.ENTER_DIV?"div":"p":false}function b(a){for(a=a.children[a.children.length-1];a&&d(a);)a=a.previous;return a}function e(a){for(a=a.previous;a&&d(a);)a=a.previous;return a}function d(a){return a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(a.value)||a.type==CKEDITOR.NODE_ELEMENT&&a.attributes["data-cke-bookmark"]}function k(a){return a&&(a.type==CKEDITOR.NODE_ELEMENT&&a.name in
+u||a.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function i(a,b){var c=a.children[a.children.length-1];a.children.push(b);b.parent=a;if(c){c.next=b;b.previous=c}}function h(a){a=a.attributes;a.contenteditable!="false"&&(a["data-cke-editable"]=a.contenteditable?"true":1);a.contenteditable="false"}function j(a){a=a.attributes;switch(a["data-cke-editable"]){case "true":a.contenteditable="true";break;case "1":delete a.contenteditable}}function c(a){return a.replace(y,function(a,b,c){return"<"+b+c.replace(B,
+function(a,b){return A.test(b)&&c.indexOf("data-cke-saved-"+b)==-1?" data-cke-saved-"+a+" data-cke-"+CKEDITOR.rnd+"-"+a:a})+">"})}function g(a,b){return a.replace(b,function(a,b,c){a.indexOf("/g,">")+"");return""+encodeURIComponent(a)+""})}function l(a){return a.replace(F,function(a,b){return decodeURIComponent(b)})}function r(a){return a.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g,function(a){return"<\!--"+
+s+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\>"})}function m(a){return a.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)})}function n(a,b){var c=b._.dataStore;return a.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return c&&c[b]||""})}function p(a,b){for(var c=[],g=b.config.protectedSource,e=b._.dataStore||(b._.dataStore={id:1}),d=/<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,
+g=[/|$)/gi,//gi,//gi].concat(g),a=a.replace(/<\!--[\s\S]*?--\>/g,function(a){return"<\!--{cke_tempcomment}"+(c.push(a)-1)+"--\>"}),h=0;h"});a=a.replace(d,function(a,b,g){return"<\!--"+s+(b?"{C}":"")+encodeURIComponent(c[g]).replace(/--/g,"%2D%2D")+"--\>"});a=a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g,
+function(a){return a.replace(/<\!--\{cke_protected\}([^>]*)--\>/g,function(a,b){e[e.id]=decodeURIComponent(b);return"{cke_protected_"+e.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,g,e){return"<"+c+g+">"+n(m(e),b)+""})}CKEDITOR.htmlDataProcessor=function(b){var e,d,h=this;this.editor=b;this.dataFilter=e=new CKEDITOR.htmlParser.filter;this.htmlFilter=d=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;e.addRules(w);
+e.addRules(v,{applyToAll:true});e.addRules(a(b,"data"),{applyToAll:true});d.addRules(q);d.addRules(z,{applyToAll:true});d.addRules(a(b,"html"),{applyToAll:true});b.on("toHtml",function(a){var a=a.data,e=a.dataValue,d,e=p(e,b),e=g(e,C),e=c(e),e=g(e,D),e=e.replace(E,"$1cke:$2"),e=e.replace(L,""),e=e.replace(/(]*>)(\r\n|\n)/g,"$1$2$2"),e=e.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");d=a.context||b.editable().getName();var h;if(CKEDITOR.env.ie&&
+CKEDITOR.env.version<9&&d=="pre"){d="div";e="
"+e+"
";h=1}d=b.document.createElement(d);d.setHtml("a"+e);e=d.getHtml().substr(1);e=e.replace(RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");h&&(e=e.replace(/^
|<\/pre>$/gi,""));e=e.replace(H,"$1$2");e=l(e);e=m(e);d=a.fixForBody===false?false:f(a.enterMode,b.config.autoParagraph);e=CKEDITOR.htmlParser.fragment.fromHtml(e,a.context,d);if(d){h=e;if(!h.children.length&&CKEDITOR.dtd[h.name][d]){d=new CKEDITOR.htmlParser.element(d);h.add(d)}}a.dataValue=
+e},null,null,5);b.on("toHtml",function(a){a.data.filter.applyTo(a.data.dataValue,true,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(h.dataFilter,true)},null,null,10);b.on("toHtml",function(a){var a=a.data,b=a.dataValue,c=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(c);b=c.getHtml(true);a.dataValue=r(b)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&
+(c=c.replace(/^
/i,""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,f(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(h.htmlFilter,true)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,false,true)},null,null,11);b.on("toDataFormat",function(a){var c=a.data.dataValue,g=h.writer;g.reset();c.writeChildrenHtml(g);c=g.getHtml(true);c=m(c);c=n(c,b);a.data.dataValue= +c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,b,c,g){var e=this.editor,d,h,f,k;if(b&&typeof b=="object"){d=b.context;c=b.fixForBody;g=b.dontFilter;h=b.filter;f=b.enterMode;k=b.protectedWhitespaces}else d=b;!d&&d!==null&&(d=e.editable().getName());return e.fire("toHtml",{dataValue:a,context:d,fixForBody:c,dontFilter:g,filter:h||e.filter,enterMode:f||e.enterMode,protectedWhitespaces:k}).dataValue},toDataFormat:function(a,b){var c,g,e;if(b){c=b.context;g=b.filter;e=b.enterMode}!c&& +c!==null&&(c=this.editor.editable().getName());return this.editor.fire("toDataFormat",{dataValue:a,filter:g||this.editor.filter,context:c,enterMode:e||this.editor.enterMode}).dataValue}};var o=/(?: |\xa0)$/,s="{cke_protected}",t=CKEDITOR.dtd,x=["caption","colgroup","col","thead","tfoot","tbody"],u=CKEDITOR.tools.extend({},t.$blockLimit,t.$block),w={elements:{input:h,textarea:h}},v={attributeNames:[[/^on/,"data-cke-pa-on"],[/^data-cke-expando$/,""]]},q={elements:{embed:function(a){var b=a.parent; +if(b&&b.name=="object"){var c=b.attributes.width,b=b.attributes.height;if(c)a.attributes.width=c;if(b)a.attributes.height=b}},a:function(a){if(!a.children.length&&!a.attributes.name&&!a.attributes["data-cke-saved-name"])return false}}},z={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return false;for(var c=["name","href","src"],g,e=0;e-1&&g>-1&&c!=g)){c=a.parent?a.getIndex():-1;g=b.parent?b.getIndex():-1}return c>g?1:-1})},param:function(a){a.children=[];a.isEmpty=true;return a},span:function(a){a.attributes["class"]=="Apple-style-span"&&delete a.name},html:function(a){delete a.attributes.contenteditable; +delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck;delete a.attributes.contenteditable},style:function(a){var b=a.children[0];if(b&&b.value)b.value=CKEDITOR.tools.trim(b.value);if(!a.attributes.type)a.attributes.type="text/css"},title:function(a){var b=a.children[0];!b&&i(a,b=new CKEDITOR.htmlParser.text);b.value=a.attributes["data-cke-title"]||""},input:j,textarea:j},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||false}}}; +if(CKEDITOR.env.ie)z.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})};var y=/<(a|area|img|input|source)\b([^>]*)>/gi,B=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,A=/^(href|src|name)$/i,D=/(?:])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,C=/(])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,F=/([^<]*)<\/cke:encoded>/gi,E=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,H=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi, +L=/]*?)\/?>(?!\s*<\/cke:\1)/gi}(),"use strict",CKEDITOR.htmlParser.element=function(a,f){this.name=a;this.attributes=f||{};this.children=[];var b=a||"",e=b.match(/^cke:(.*)/);e&&(b=e[1]);b=!(!CKEDITOR.dtd.$nonBodyContent[b]&&!CKEDITOR.dtd.$block[b]&&!CKEDITOR.dtd.$listItem[b]&&!CKEDITOR.dtd.$tableContent[b]&&!(CKEDITOR.dtd.$nonEditable[b]||b=="br"));this.isEmpty=!!CKEDITOR.dtd.$empty[a];this.isUnknown=!CKEDITOR.dtd[a];this._={isBlockLike:b,hasInlineStarted:this.isEmpty||!b}}, +CKEDITOR.htmlParser.cssStyle=function(a){var f={};((a instanceof CKEDITOR.htmlParser.element?a.attributes.style:a)||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,e,d){e=="font-family"&&(d=d.replace(/["']/g,""));f[e.toLowerCase()]=d});return{rules:f,populate:function(a){var e=this.toString();if(e)a instanceof CKEDITOR.dom.element?a.setAttribute("style",e):a instanceof CKEDITOR.htmlParser.element?a.attributes.style=e:a.style=e},toString:function(){var a=[],e; +for(e in f)f[e]&&a.push(e,":",f[e],";");return a.join("")}}},function(){function a(a){return function(b){return b.type==CKEDITOR.NODE_ELEMENT&&(typeof a=="string"?b.name==a:b.name in a)}}var f=function(a,b){a=a[0];b=b[0];return ab?1:0},b=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:b.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a, +b){var f=this,i,h,b=f.getFilterContext(b);if(b.off)return true;if(!f.parent)a.onRoot(b,f);for(;;){i=f.name;if(!(h=a.onElementName(b,i))){this.remove();return false}f.name=h;if(!(f=a.onElement(b,f))){this.remove();return false}if(f!==this){this.replaceWith(f);return false}if(f.name==i)break;if(f.type!=CKEDITOR.NODE_ELEMENT){this.replaceWith(f);return false}if(!f.name){this.replaceWithChildren();return false}}i=f.attributes;var j,c;for(j in i){c=j;for(h=i[j];;)if(c=a.onAttributeName(b,j))if(c!=j){delete i[j]; +j=c}else break;else{delete i[j];break}c&&((h=a.onAttribute(b,f,c,h))===false?delete i[c]:i[c]=h)}f.isEmpty||this.filterChildren(a,false,b);return true},filterChildren:b.filterChildren,writeHtml:function(a,b){b&&this.filter(b);var k=this.name,i=[],h=this.attributes,j,c;a.openTag(k,h);for(j in h)i.push([j,h[j]]);a.sortAttributes&&i.sort(f);j=0;for(c=i.length;j0)this.children[a-1].next=null;this.parent.add(f,this.getIndex()+1);return f},addClass:function(a){if(!this.hasClass(a)){var b=this.attributes["class"]||"";this.attributes["class"]=b+(b?" ": +"")+a}},removeClass:function(a){var b=this.attributes["class"];if(b)(b=CKEDITOR.tools.trim(b.replace(RegExp("(?:\\s+|^)"+a+"(?:\\s+|$)")," ")))?this.attributes["class"]=b:delete this.attributes["class"]},hasClass:function(a){var b=this.attributes["class"];return!b?false:RegExp("(?:^|\\s)"+a+"(?=\\s|$)").test(b)},getFilterContext:function(a){var b=[];a||(a={off:false,nonEditable:false,nestedEditable:false});!a.off&&this.attributes["data-cke-processor"]=="off"&&b.push("off",true);!a.nonEditable&&this.attributes.contenteditable== +"false"?b.push("nonEditable",true):a.nonEditable&&(!a.nestedEditable&&this.attributes.contenteditable=="true")&&b.push("nestedEditable",true);if(b.length)for(var a=CKEDITOR.tools.copy(a),f=0;f'+e.getValue()+"",CKEDITOR.document);a.insertAfter(e);e.hide();e.$.form&&b._attachToForm()}else b.setData(a.getHtml(),null,true);b.on("loaded",function(){b.fire("uiReady");b.editable(a);b.container=a;b.ui.contentsElement=a;b.setData(b.getData(1));b.resetDirty();b.fire("contentDom");b.mode="wysiwyg";b.fire("mode");b.status="ready";b.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,b)},null,null,1E4);b.on("destroy",function(){if(e){b.container.clearCustomData(); +b.container.remove();e.show()}b.element.clearCustomData();delete b.element});return b};CKEDITOR.inlineAll=function(){var a,f,b;for(b in CKEDITOR.dtd.$editable)for(var e=CKEDITOR.document.getElementsByTag(b),d=0,k=e.count();d"+(a.title?'{voiceLabel}':"")+'<{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation">{bottomHtml}'), +b=CKEDITOR.dom.element.createFromHtml(c.output({id:a.id,name:b,langDir:a.lang.dir,langCode:a.langCode,voiceLabel:a.title,topHtml:h?''+h+"":"",contentId:a.ui.spaceId("contents"),bottomHtml:j?''+j+"":"",outerEl:CKEDITOR.env.ie?"span":"div"}));if(i==CKEDITOR.ELEMENT_MODE_REPLACE){f.hide();b.insertAfter(f)}else f.append(b); +a.container=b;a.ui.contentsElement=a.ui.space("contents");h&&a.ui.space("top").unselectable();j&&a.ui.space("bottom").unselectable();f=a.config.width;i=a.config.height;f&&b.setStyle("width",CKEDITOR.tools.cssLength(f));i&&a.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(i));b.disableContextMenu();CKEDITOR.env.webkit&&b.on("focus",function(){a.focus()});a.fireOnce("uiReady")}CKEDITOR.replace=function(b,d){return a(b,d,null,CKEDITOR.ELEMENT_MODE_REPLACE)};CKEDITOR.appendTo=function(b, +d,f){return a(b,d,f,CKEDITOR.ELEMENT_MODE_APPENDTO)};CKEDITOR.replaceAll=function(){for(var a=document.getElementsByTagName("textarea"),b=0;b'+g+""); +c.append(g);a.changeAttr("aria-describedby",d)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");var n=CKEDITOR.dom.walker.whitespaces(true),p=CKEDITOR.dom.walker.bookmark(false,true),o=CKEDITOR.dom.walker.empty(),s=CKEDITOR.dom.walker.bogus(),t=/(^|]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,x=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT} +function b(c,g){var d,e,f,h,i=[],k=g.range.startContainer;d=g.range.startPath();for(var k=j[k.getName()],l=0,o=c.getChildren(),n=o.count(),s=-1,m=-1,E=0,u=d.contains(j.$list);l-1)i[s].firstNotAllowed=1;if(m>-1)i[m].lastNotAllowed=1;return i}function c(b,g){var d=[],e=b.getChildren(),f=e.count(),h,i=0,k=j[g],l=!b.is(j.$inline)||b.is("br");for(l&&d.push(" ");i ",n.document);n.insertNode(p);n.setStartAfter(p)}t=new CKEDITOR.dom.elementPath(n.startContainer);i.endPath=r=new CKEDITOR.dom.elementPath(n.endContainer);if(!n.collapsed){var u=r.block||r.blockLimit,x=n.getCommonAncestor();u&&(!u.equals(x)&&!u.contains(x)&&n.checkEndOfBlock())&&i.zombies.push(u);n.deleteContents()}for(;(w=a(n.startContainer)&& +n.startContainer.getChild(n.startOffset-1))&&a(w)&&w.isBlockBoundary()&&t.contains(w);)n.moveToPosition(w,CKEDITOR.POSITION_BEFORE_END);e(n,i.blockLimit,t,r);if(p){n.setEndBefore(p);n.collapse();p.remove()}p=n.startPath();if(u=p.contains(d,false,1)){n.splitElement(u);i.inlineStylesRoot=u;i.inlineStylesPeak=p.lastElement}p=n.createBookmark();(u=p.startNode.getPrevious(h))&&a(u)&&d(u)&&m.push(u);(u=p.startNode.getNext(h))&&a(u)&&d(u)&&m.push(u);for(u=p.startNode;(u=u.getParent())&&d(u);)m.push(u);n.moveToBookmark(p); +if(p=s){p=i.range;if(i.type=="text"&&i.inlineStylesRoot){w=i.inlineStylesPeak;n=w.getDocument().createText("{cke-peak}");for(m=i.inlineStylesRoot.getParent();!w.equals(m);){n=n.appendTo(w.clone());w=w.getParent()}s=n.getOuterHtml().split("{cke-peak}").join(s)}w=i.blockLimit.getName();if(/^\s+|\s+$/.test(s)&&"span"in CKEDITOR.dtd[w])var O=' ',s=O+s+O;s=i.editor.dataProcessor.toHtml(s,{context:null,fixForBody:false,protectedWhitespaces:!!O,dontFilter:i.dontFilter, +filter:i.editor.activeFilter,enterMode:i.editor.activeEnterMode});w=p.document.createElement("body");w.setHtml(s);if(O){w.getFirst().remove();w.getLast().remove()}if((O=p.startPath().block)&&!(O.getChildCount()==1&&O.getBogus()))a:{var J;if(w.getChildCount()==1&&a(J=w.getFirst())&&J.is(k)&&!J.hasAttribute("contenteditable")){O=J.getElementsByTag("*");p=0;for(m=O.count();p0;else{G=J.startPath();if(!r.isBlock&&g(i.editor,G.block,G.blockLimit)&&(C=l(i.editor))){C=p.createElement(C);C.appendBogus();J.insertNode(C);CKEDITOR.env.needsBrFiller&&(P=C.getBogus())&&P.remove();J.moveToPosition(C,CKEDITOR.POSITION_BEFORE_END)}if((G=J.startPath().block)&&!G.equals(Q)){if(P=G.getBogus()){P.remove();O.push(G)}Q=G}r.firstNotAllowed&&(u=1);if(u&&r.isElement){G= +J.startContainer;for(V=null;G&&!j[G.getName()][r.name];){if(G.equals(w)){G=null;break}V=G;G=G.getParent()}if(G){if(V){W=J.splitElement(V);i.zombies.push(W);i.zombies.push(V)}}else{V=w.getName();$=!m;G=m==n.length-1;V=c(r.node,V);for(var T=[],aa=V.length,Y=0,X=void 0,ba=0,ea=-1;Y0;){g=a.getItem(b);if(!CKEDITOR.tools.trim(g.getHtml())){g.appendBogus();CKEDITOR.env.ie&&(CKEDITOR.env.version<9&&g.getChildCount())&&g.getFirst().remove()}}} +return function(g){var d=g.startContainer,e=d.getAscendant("table",1),f=false;c(e.getElementsByTag("td"));c(e.getElementsByTag("th"));e=g.clone();e.setStart(d,0);e=a(e).lastBackward();if(!e){e=g.clone();e.setEndAt(d,CKEDITOR.POSITION_BEFORE_END);e=a(e).lastForward();f=true}e||(e=d);if(e.is("table")){g.setStartAt(e,CKEDITOR.POSITION_BEFORE_START);g.collapse(true);e.remove()}else{e.is({tbody:1,thead:1,tfoot:1})&&(e=b(e,"tr",f));e.is("tr")&&(e=b(e,e.getParent().is("thead")?"th":"td",f));(d=e.getBogus())&& +d.remove();g.moveToPosition(e,f?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END)}}}();a={detect:function(a,b){var c=a.range,g=c.clone(),d=c.clone(),e=new CKEDITOR.dom.elementPath(c.startContainer,b),f=new CKEDITOR.dom.elementPath(c.endContainer,b);g.collapse(1);d.collapse();if(e.block&&g.checkBoundaryOfElement(e.block,CKEDITOR.END)){c.setStartAfter(e.block);a.prependEolBr=1}if(f.block&&d.checkBoundaryOfElement(f.block,CKEDITOR.START)){c.setEndBefore(f.block);a.appendEolBr=1}},fix:function(a, +b){var c=b.getDocument(),g;if(a.appendEolBr){g=this.createEolBr(c);a.fragment.append(g)}a.prependEolBr&&(!g||g.getPrevious())&&a.fragment.append(this.createEolBr(c),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}};f={exclude:function(a){var b=a.range.getBoundaryNodes(),c=b.startNode;(b=b.endNode)&&(s(b)&&(!c||!c.equals(b)))&&a.range.setEndBefore(b)}};e={rebuild:function(a,b){var c=a.range,g=c.getCommonAncestor(),d=new CKEDITOR.dom.elementPath(g,b),e=new CKEDITOR.dom.elementPath(c.startContainer, +b),c=new CKEDITOR.dom.elementPath(c.endContainer,b),f;g.type==CKEDITOR.NODE_TEXT&&(g=g.getParent());if(d.blockLimit.is({tr:1,table:1})){var h=d.contains("table").getParent();f=function(a){return!a.equals(h)}}else if(d.block&&d.block.is(CKEDITOR.dtd.$listItem)){e=e.contains(CKEDITOR.dtd.$list);c=c.contains(CKEDITOR.dtd.$list);if(!e.equals(c)){var i=d.contains(CKEDITOR.dtd.$list).getParent();f=function(a){return!a.equals(i)}}}f||(f=function(a){return!a.equals(d.block)&&!a.equals(d.blockLimit)});this.rebuildFragment(a, +b,g,f)},rebuildFragment:function(a,b,c,g){for(var d;c&&!c.equals(b)&&g(c);){d=c.clone(0,1);a.fragment.appendTo(d);a.fragment=d;c=c.getParent()}}};b={shrink:function(a){var a=a.range,b=a.startContainer,c=a.endContainer,g=a.startOffset,d=a.endOffset;b.type==CKEDITOR.NODE_ELEMENT&&(b.equals(c)&&b.is("tr")&&++g==d)&&a.shrink(CKEDITOR.SHRINK_TEXT)}};var w=function(){function a(b,c){var g=b.getParent();if(g.is(CKEDITOR.dtd.$inline))b[c?"insertBefore":"insertAfter"](g)}function b(c,g,d){a(g);a(d,1);for(var e;e= +d.getNext();){e.insertAfter(g);g=e}o(c)&&c.remove()}function c(a,b){var g=new CKEDITOR.dom.range(a);g.setStartAfter(b.startNode);g.setEndBefore(b.endNode);return g}return{list:{detectMerge:function(a,b){var g=c(b,a.bookmark),d=g.startPath(),e=g.endPath(),f=d.contains(CKEDITOR.dtd.$list),h=e.contains(CKEDITOR.dtd.$list);a.mergeList=f&&h&&f.getParent().equals(h.getParent())&&!f.equals(h);a.mergeListItems=d.block&&e.block&&d.block.is(CKEDITOR.dtd.$listItem)&&e.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList|| +a.mergeListItems){g=g.clone();g.setStartBefore(a.bookmark.startNode);g.setEndAfter(a.bookmark.endNode);a.mergeListBookmark=g.createBookmark()}},merge:function(a,c){if(a.mergeListBookmark){var g=a.mergeListBookmark.startNode,d=a.mergeListBookmark.endNode,e=new CKEDITOR.dom.elementPath(g,c),f=new CKEDITOR.dom.elementPath(d,c);if(a.mergeList){var h=e.contains(CKEDITOR.dtd.$list),i=f.contains(CKEDITOR.dtd.$list);if(!h.equals(i)){i.moveChildren(h);i.remove()}}if(a.mergeListItems){e=e.contains(CKEDITOR.dtd.$listItem); +f=f.contains(CKEDITOR.dtd.$listItem);e.equals(f)||b(f,g,d)}g.remove();d.remove()}}},block:{detectMerge:function(a,b){if(!a.tableContentsRanges&&!a.mergeListBookmark){var c=new CKEDITOR.dom.range(b);c.setStartBefore(a.bookmark.startNode);c.setEndAfter(a.bookmark.endNode);a.mergeBlockBookmark=c.createBookmark()}},merge:function(a,c){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var g=a.mergeBlockBookmark.startNode,d=a.mergeBlockBookmark.endNode,e=new CKEDITOR.dom.elementPath(g,c),f=new CKEDITOR.dom.elementPath(d, +c),e=e.block,f=f.block;e&&(f&&!e.equals(f))&&b(f,g,d);g.remove();d.remove()}}},table:function(){function a(c){var d=[],e,f=new CKEDITOR.dom.walker(c),h=c.startPath().contains(g),i=c.endPath().contains(g),j={};f.guard=function(a,f){if(a.type==CKEDITOR.NODE_ELEMENT){var k="visited_"+(f?"out":"in");if(a.getCustomData(k))return;CKEDITOR.dom.element.setMarker(j,a,k,1)}if(f&&h&&a.equals(h)){e=c.clone();e.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);d.push(e)}else if(!f&&i&&a.equals(i)){e=c.clone();e.setStartAt(i, +CKEDITOR.POSITION_AFTER_START);d.push(e)}else if(!f&&a.type==CKEDITOR.NODE_ELEMENT&&a.is(g)&&(!h||b(a,h))&&(!i||b(a,i))){e=c.clone();e.selectNodeContents(a);d.push(e)}};f.lastForward();CKEDITOR.dom.element.clearAllMarkers(j);return d}function b(a,c){var g=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,d=a.getPosition(c);return d===CKEDITOR.POSITION_IDENTICAL?false:(d&g)===0}var g={td:1,th:1,caption:1};return{detectPurge:function(a){var b=a.range,c=b.clone();c.enlarge(CKEDITOR.ENLARGE_ELEMENT); +var c=new CKEDITOR.dom.walker(c),d=0;c.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(g)&&++d};c.checkForward();if(d>1){var c=b.startPath().contains("table"),e=b.endPath().contains("table");if(c&&e&&b.checkBoundaryOfElement(c,CKEDITOR.START)&&b.checkBoundaryOfElement(e,CKEDITOR.END)){b=a.range.clone();b.setStartBefore(c);b.setEndAfter(e);a.purgeTableBookmark=b.createBookmark()}}},detectRanges:function(d,e){var f=c(e,d.bookmark),h=f.clone(),i,j,k=f.getCommonAncestor();k.is(CKEDITOR.dtd.$tableContent)&& +!k.is(g)&&(k=k.getAscendant("table",true));j=k;k=new CKEDITOR.dom.elementPath(f.startContainer,j);j=new CKEDITOR.dom.elementPath(f.endContainer,j);k=k.contains("table");j=j.contains("table");if(k||j){if(k&&j&&b(k,j)){d.tableSurroundingRange=h;h.setStartAt(k,CKEDITOR.POSITION_AFTER_END);h.setEndAt(j,CKEDITOR.POSITION_BEFORE_START);h=f.clone();h.setEndAt(k,CKEDITOR.POSITION_AFTER_END);i=f.clone();i.setStartAt(j,CKEDITOR.POSITION_BEFORE_START);i=a(h).concat(a(i))}else if(k){if(!j){d.tableSurroundingRange= +h;h.setStartAt(k,CKEDITOR.POSITION_AFTER_END);f.setEndAt(k,CKEDITOR.POSITION_AFTER_END)}}else{d.tableSurroundingRange=h;h.setEndAt(j,CKEDITOR.POSITION_BEFORE_START);f.setStartAt(j,CKEDITOR.POSITION_AFTER_START)}d.tableContentsRanges=i?i:a(f)}},deleteRanges:function(a){for(var b;b=a.tableContentsRanges.pop();){b.extractContents();o(b.startContainer)&&b.startContainer.appendBogus()}a.tableSurroundingRange&&a.tableSurroundingRange.extractContents()},purge:function(a){if(a.purgeTableBookmark){var b=a.doc, +c=a.range.clone(),b=b.createElement("p");b.insertBefore(a.purgeTableBookmark.startNode);c.moveToBookmark(a.purgeTableBookmark);c.deleteContents();a.range.moveToPosition(b,CKEDITOR.POSITION_AFTER_START)}}}}(),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,true)},autoParagraph:function(a,b){var c= +b.startPath(),d;if(g(a,c.block,c.blockLimit)&&(d=l(a))){d=b.document.createElement(d);d.appendBogus();b.insertNode(d);b.moveToPosition(d,CKEDITOR.POSITION_AFTER_START)}}}}()}(),function(){function a(){var a=this._.fakeSelection,b;if(a){b=this.getSelection(1);if(!b||!b.isHidden()){a.reset();a=0}}if(!a){a=b||this.getSelection(1);if(!a||a.getType()==CKEDITOR.SELECTION_NONE)return}this.fire("selectionCheck",a);b=this.elementPath();if(!b.compare(this._.selectionPreviousPath)){if(CKEDITOR.env.webkit)this._.previousActive= +this.document.getActive();this._.selectionPreviousPath=b;this.fire("selectionChange",{selection:a,path:b})}}function f(){n=true;if(!m){b.call(this);m=CKEDITOR.tools.setTimeout(b,200,this)}}function b(){m=null;if(n){CKEDITOR.tools.setTimeout(a,0,this);n=false}}function e(a){return p(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?true:false}function d(a){function b(c,g){return!c||c.type==CKEDITOR.NODE_TEXT?false:a.clone()["moveToElementEdit"+(g?"End":"Start")](c)}if(!(a.root instanceof +CKEDITOR.editable))return false;var c=a.startContainer,g=a.getPreviousNode(e,null,c),d=a.getNextNode(e,null,c);return b(g)||b(d,1)||!g&&!d&&!(c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary()&&c.getBogus())?true:false}function k(a){return a.getCustomData("cke-fillingChar")}function i(a,b){var g=a&&a.removeCustomData("cke-fillingChar");if(g){if(b!==false){var d,e=a.getDocument().getSelection().getNative(),f=e&&e.type!="None"&&e.getRangeAt(0);if(g.getLength()>1&&f&&f.intersectsNode(g.$)){d=j(e);f= +e.focusNode==g.$&&e.focusOffset>0;e.anchorNode==g.$&&e.anchorOffset>0&&d[0].offset--;f&&d[1].offset--}}g.setText(h(g.getText()));d&&c(a.getDocument().$,d)}}function h(a){return a.replace(/\u200B( )?/g,function(a){return a[1]?" ":""})}function j(a){return[{node:a.anchorNode,offset:a.anchorOffset},{node:a.focusNode,offset:a.focusOffset}]}function c(a,b){var c=a.getSelection(),g=a.createRange();g.setStart(b[0].node,b[0].offset);g.collapse(true);c.removeAllRanges();c.addRange(g);c.extend(b[1].node,b[1].offset)} +function g(a){var b=CKEDITOR.dom.element.createFromHtml('
 
',a.document);a.fire("lockSnapshot");a.editable().append(b);var c=a.getSelection(1),g=a.createRange(),d=c.root.on("selectionchange",function(a){a.cancel()},null,null,0);g.setStartAt(b,CKEDITOR.POSITION_AFTER_START);g.setEndAt(b,CKEDITOR.POSITION_BEFORE_END);c.selectRanges([g]);d.removeListener();a.fire("unlockSnapshot"); +a._.hiddenSelectionContainer=b}function l(a){var b={37:1,39:1,8:1,46:1};return function(c){var g=c.data.getKeystroke();if(b[g]){var d=a.getSelection().getRanges(),e=d[0];if(d.length==1&&e.collapsed)if((g=e[g<38?"getPreviousEditableNode":"getNextEditableNode"]())&&g.type==CKEDITOR.NODE_ELEMENT&&g.getAttribute("contenteditable")=="false"){a.getSelection().fake(g);c.data.preventDefault();c.cancel()}}}}function r(a){for(var b=0;b=g.getLength()?h.setStartAfter(g):h.setStartBefore(g));d&&d.type==CKEDITOR.NODE_TEXT&&(f?h.setEndAfter(d):h.setEndBefore(d));g=new CKEDITOR.dom.walker(h); +g.evaluator=function(g){if(g.type==CKEDITOR.NODE_ELEMENT&&g.isReadOnly()){var d=c.clone();c.setEndBefore(g);c.collapsed&&a.splice(b--,1);if(!(g.getPosition(h.endContainer)&CKEDITOR.POSITION_CONTAINS)){d.setStartAfter(g);d.collapsed||a.splice(b+1,0,d)}return true}return false};g.next()}}return a}var m,n,p=CKEDITOR.dom.walker.invisible(1),o=function(){function a(b){return function(a){var c=a.editor.createRange();c.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([c]); +return false}}function b(a){return function(b){var c=b.editor,g=c.createRange(),d;if(!(d=g.moveToClosestEditablePosition(b.selected,a)))d=g.moveToClosestEditablePosition(b.selected,!a);d&&c.getSelection().selectRanges([g]);c.fire("saveSnapshot");b.selected.remove();if(!d){g.moveToElementEditablePosition(c.editable());c.getSelection().selectRanges([g])}c.fire("saveSnapshot");return false}}var c=a(),g=a(1);return{37:c,38:c,39:g,40:g,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(b){function c(){var a= +g.getSelection();a&&a.removeAllRanges()}var g=b.editor;g.on("contentDom",function(){function b(){m=new CKEDITOR.dom.selection(g.getSelection());m.lock()}function c(){e.removeListener("mouseup",c);k.removeListener("mouseup",c);var a=CKEDITOR.document.$.selection,b=a.createRange();a.type!="None"&&b.parentElement().ownerDocument==d.$&&b.select()}var d=g.document,e=CKEDITOR.document,h=g.editable(),j=d.getBody(),k=d.getDocumentElement(),o=h.isInline(),n,m;CKEDITOR.env.gecko&&h.attachListener(h,"focus", +function(a){a.removeListener();if(n!==0)if((a=g.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==h.$){a=g.createRange();a.moveToElementEditStart(h);a.select()}},null,null,-2);h.attachListener(h,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){n&&CKEDITOR.env.webkit&&(n=g._.previousActive&&g._.previousActive.equals(d.getActive()));g.unlockSelection(n);n=0},null,null,-1);h.attachListener(h,"mousedown",function(){n=0});if(CKEDITOR.env.ie||o){s?h.attachListener(h,"beforedeactivate",b,null, +null,-1):h.attachListener(g,"selectionCheck",b,null,null,-1);h.attachListener(h,CKEDITOR.env.webkit?"DOMFocusOut":"blur",function(){g.lockSelection(m);n=1},null,null,-1);h.attachListener(h,"mousedown",function(){n=0})}if(CKEDITOR.env.ie&&!o){var t;h.attachListener(h,"mousedown",function(a){if(a.data.$.button==2){a=g.document.getSelection();if(!a||a.getType()==CKEDITOR.SELECTION_NONE)t=g.window.getScrollPosition()}});h.attachListener(h,"mouseup",function(a){if(a.data.$.button==2&&t){g.document.$.documentElement.scrollLeft= +t.x;g.document.$.documentElement.scrollTop=t.y}t=null});if(d.$.compatMode!="BackCompat"){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)k.on("mousedown",function(a){function b(a){a=a.data.$;if(g){var c=j.$.createTextRange();try{c.moveToPoint(a.clientX,a.clientY)}catch(d){}g.setEndPoint(h.compareEndPoints("StartToStart",c)<0?"EndToEnd":"StartToStart",c);g.select()}}function c(){k.removeListener("mousemove",b);e.removeListener("mouseup",c);k.removeListener("mouseup",c);g.select()}a=a.data;if(a.getTarget().is("html")&& +a.$.y7&&CKEDITOR.env.version<11)k.on("mousedown",function(a){if(a.data.getTarget().is("html")){e.on("mouseup",c);k.on("mouseup",c)}})}}h.attachListener(h,"selectionchange",a,g);h.attachListener(h,"keyup",f,g);h.attachListener(h,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){g.forceNextSelectionCheck(); +g.selectionChange(1)});if(o&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var r;h.attachListener(h,"mousedown",function(){r=1});h.attachListener(d.getDocumentElement(),"mouseup",function(){r&&f.call(g);r=0})}else h.attachListener(CKEDITOR.env.ie?h:d.getDocumentElement(),"mouseup",f,g);CKEDITOR.env.webkit&&h.attachListener(d,"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:i(h)}},null,null,-1);h.attachListener(h,"keydown",l(g), +null,null,-1)});g.on("setData",function(){g.unlockSelection();CKEDITOR.env.webkit&&c()});g.on("contentDomUnload",function(){g.unlockSelection()});if(CKEDITOR.env.ie9Compat)g.on("beforeDestroy",c,null,null,9);g.on("dataReady",function(){delete g._.fakeSelection;delete g._.hiddenSelectionContainer;g.selectionChange(1)});g.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=g.editable().getLast(a);if(b&&b.hasAttribute("data-cke-hidden-sel")){b.remove();if(CKEDITOR.env.gecko)(a= +g.editable().getFirst(a))&&(a.is("br")&&a.getAttribute("_moz_editor_bogus_node"))&&a.remove()}},null,null,100);g.on("key",function(a){if(g.mode=="wysiwyg"){var b=g.getSelection();if(b.isFake){var c=o[a.data.keyCode];if(c)return c({editor:g,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});CKEDITOR.on("instanceReady",function(a){function b(){var a=d.editable();if(a)if(a=k(a)){var c=d.document.$.getSelection();if(c.type!="None"&&(c.anchorNode==a.$||c.focusNode==a.$))f=j(c);e=a.getText(); +a.setText(h(e))}}function g(){var a=d.editable();if(a)if(a=k(a)){a.setText(e);if(f){c(d.document.$,f);f=null}}}var d=a.editor,e,f;if(CKEDITOR.env.webkit){d.on("selectionChange",function(){var a=d.editable(),b=k(a);b&&(b.getCustomData("ready")?i(a):b.setCustomData("ready",1))},null,null,-1);d.on("beforeSetMode",function(){i(d.editable())},null,null,-1);d.on("beforeUndoImage",b);d.on("afterUndoImage",g);d.on("beforeGetData",b,null,null,0);d.on("getData",g)}});CKEDITOR.editor.prototype.selectionChange= +function(b){(b?a:f).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){if((this._.savedSelection||this._.fakeSelection)&&!a)return this._.savedSelection||this._.fakeSelection;return(a=this.editable())&&this.mode=="wysiwyg"?new CKEDITOR.dom.selection(a):null};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);if(a.getType()!=CKEDITOR.SELECTION_NONE){!a.isLocked&&a.lock();this._.savedSelection=a;return true}return false};CKEDITOR.editor.prototype.unlockSelection= +function(a){var b=this._.savedSelection;if(b){b.unlock(a);delete this._.savedSelection;return true}return false};CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath};CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};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;var s=typeof window.getSelection!="function",t=1;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection)var b=a,a=a.root;var c=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:t++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=c?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(b){CKEDITOR.tools.extend(this._.cache,b._.cache);this.isFake=b.isFake;this.isLocked= +b.isLocked;return this}var a=this.getNative(),g,d;if(a)if(a.getRangeAt)g=(d=a.rangeCount&&a.getRangeAt(0))&&new CKEDITOR.dom.node(d.commonAncestorContainer);else{try{d=a.createRange()}catch(e){}g=d&&CKEDITOR.dom.element.get(d.item&&d.item(0)||d.parentElement())}if(!g||!(g.type==CKEDITOR.NODE_ELEMENT||g.type==CKEDITOR.NODE_TEXT)||!this.root.equals(g)&&!this.root.contains(g)){this._.cache.type=CKEDITOR.SELECTION_NONE;this._.cache.startElement=null;this._.cache.selectedElement=null;this._.cache.selectedText= +"";this._.cache.ranges=new CKEDITOR.dom.rangeList}return this};var x={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.dom.selection.prototype={getNative:function(){return this._.cache.nativeSel!==void 0?this._.cache.nativeSel:this._.cache.nativeSel=s?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:s?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE; +try{var c=this.getNative(),g=c.type;if(g=="Text")b=CKEDITOR.SELECTION_TEXT;if(g=="Control")b=CKEDITOR.SELECTION_ELEMENT;if(c.createRange().parentElement())b=CKEDITOR.SELECTION_TEXT}catch(d){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_TEXT,c=this.getNative();if(!c||!c.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(c.rangeCount==1){var c=c.getRangeAt(0),g=c.startContainer;if(g==c.endContainer&&g.nodeType==1&&c.endOffset-c.startOffset==1&&x[g.childNodes[c.startOffset].nodeName.toLowerCase()])b= +CKEDITOR.SELECTION_ELEMENT}return a.type=b},getRanges:function(){var a=s?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,c){b=b.duplicate();b.collapse(c);var g=b.parentElement();if(!g.hasChildNodes())return{container:g,offset:0};for(var d=g.children,e,h,f=b.duplicate(),i=0,j=d.length-1,k=-1,l,o;i<=j;){k=Math.floor((i+j)/2);e=d[k];f.moveToElementText(e);l=f.compareEndPoints("StartToStart",b);if(l>0)j=k-1;else if(l<0)i=k+1;else return{container:g,offset:a(e)}}if(k== +-1||k==d.length-1&&l<0){f.moveToElementText(g);f.setEndPoint("StartToStart",b);f=f.text.replace(/(\r\n|\r)/g,"\n").length;d=g.childNodes;if(!f){e=d[d.length-1];return e.nodeType!=CKEDITOR.NODE_TEXT?{container:g,offset:d.length}:{container:e,offset:e.nodeValue.length}}for(g=d.length;f>0&&g>0;){h=d[--g];if(h.nodeType==CKEDITOR.NODE_TEXT){o=h;f=f-h.nodeValue.length}}return{container:o,offset:-f}}f.collapse(l>0?true:false);f.setEndPoint(l>0?"StartToStart":"EndToStart",b);f=f.text.replace(/(\r\n|\r)/g, +"\n").length;if(!f)return{container:g,offset:a(e)+(l>0?0:1)};for(;f>0;)try{h=e[l>0?"previousSibling":"nextSibling"];if(h.nodeType==CKEDITOR.NODE_TEXT){f=f-h.nodeValue.length;o=h}e=h}catch(n){return{container:g,offset:a(e)}}return{container:o,offset:l>0?-f:o.nodeValue.length+f}};return function(){var a=this.getNative(),c=a&&a.createRange(),g=this.getType();if(!a)return[];if(g==CKEDITOR.SELECTION_TEXT){a=new CKEDITOR.dom.range(this.root);g=b(c,true);a.setStart(new CKEDITOR.dom.node(g.container),g.offset); +g=b(c);a.setEnd(new CKEDITOR.dom.node(g.container),g.offset);a.endContainer.getPosition(a.startContainer)&CKEDITOR.POSITION_PRECEDING&&a.endOffset<=a.startContainer.getIndex()&&a.collapse();return[a]}if(g==CKEDITOR.SELECTION_ELEMENT){for(var g=[],d=0;d1){f=a[a.length-1];a[0].setEnd(f.endContainer,f.endOffset)}f=a[0];var a=f.collapsed,k,l,o;if((c=f.getEnclosedNode())&&c.type==CKEDITOR.NODE_ELEMENT&&c.getName()in x&&(!c.is("a")||!c.getText()))try{o=c.$.createControlRange();o.addElement(c.$);o.select();return}catch(n){}if(f.startContainer.type==CKEDITOR.NODE_ELEMENT&&f.startContainer.getName()in b||f.endContainer.type==CKEDITOR.NODE_ELEMENT&&f.endContainer.getName()in b){f.shrink(CKEDITOR.NODE_ELEMENT,true);a=f.collapsed}o= +f.createBookmark();b=o.startNode;if(!a)e=o.endNode;o=f.document.$.body.createTextRange();o.moveToElementText(b.$);o.moveStart("character",1);if(e){h=f.document.$.body.createTextRange();h.moveToElementText(e.$);o.setEndPoint("EndToEnd",h);o.moveEnd("character",-1)}else{k=b.getNext(j);l=b.hasAscendant("pre");k=!(k&&k.getText&&k.getText().match(h))&&(l||!b.hasPrevious()||b.getPrevious().is&&b.getPrevious().is("br"));l=f.document.createElement("span");l.setHtml("");l.insertBefore(b);k&&f.document.createText("").insertBefore(b)}f.setStartBefore(b); +b.remove();if(a){if(k){o.moveStart("character",-1);o.select();f.document.$.selection.clear()}else o.select();f.moveToPosition(l,CKEDITOR.POSITION_BEFORE_START);l.remove()}else{f.setEndBefore(e);e.remove();o.select()}}else{e=this.getNative();if(!e)return;this.removeAllRanges();for(o=0;o=0){f.collapse(1);l.setEnd(f.endContainer.$,f.endOffset)}else throw m;}e.addRange(l)}}this.reset();this.root.fire("selectionchange")}}},fake:function(a){var b=this.root.editor;this.reset();g(b);var c=this._.cache,d=new CKEDITOR.dom.range(this.root);d.setStartBefore(a);d.setEndAfter(a);c.ranges=new CKEDITOR.dom.rangeList(d);c.selectedElement=c.startElement=a;c.type=CKEDITOR.SELECTION_ELEMENT; +c.selectedText=c.nativeSel=null;this.isFake=1;this.rev=t++;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"))},createBookmarks:function(a){a=this.getRanges().createBookmarks(a);this.isFake&&(a.isFake=1);return a},createBookmarks2:function(a){a=this.getRanges().createBookmarks2(a);this.isFake&&(a.isFake=1);return a},selectBookmarks:function(a){for(var b= +[],c,g=0;g]*>)[ \t\r\n]*/gi,"$1");h=h.replace(/([ \t\n\r]+| )/g," ");h=h.replace(/]*>/gi,"\n");if(CKEDITOR.env.ie){var j=a.getDocument().createElement("div");j.append(f);f.$.outerHTML="
"+h+"
";f.copyAttributes(j.getFirst());f=j.getFirst().remove()}else f.setHtml(h); +b=f}else h?b=l(d?[a.getHtml()]:c(a),b):a.moveChildren(b);b.replace(a);if(e){var d=b,i;if((i=d.getPrevious(A))&&i.type==CKEDITOR.NODE_ELEMENT&&i.is("pre")){e=g(i.getHtml(),/\n$/,"")+"\n\n"+g(d.getHtml(),/^\n/,"");CKEDITOR.env.ie?d.$.outerHTML="
"+e+"
":d.setHtml(e);i.remove()}}else d&&p(b)}function c(a){var b=[];g(a.getOuterHtml(),/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"
"+c+"
"}).replace(/([\s\S]*?)<\/pre>/gi,function(a,
+c){b.push(c)});return b}function g(a,b,c){var g="",d="",a=a.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi,function(a,b,c){b&&(g=b);c&&(d=c);return""});return g+a.replace(b,c)+d}function l(a,b){var c;a.length>1&&(c=new CKEDITOR.dom.documentFragment(b.getDocument()));for(var d=0;d"),e=e.replace(/[ \t]{2,}/g,function(a){return CKEDITOR.tools.repeat(" ",a.length-1)+" "});if(c){var f=b.clone();f.setHtml(e);c.append(f)}else b.setHtml(e)}return c||b}function r(a,b){var c=this._.definition,g=c.attributes,c=c.styles,d=x(this)[a.getName()],e=CKEDITOR.tools.isEmpty(g)&&CKEDITOR.tools.isEmpty(c),f;for(f in g)if(!((f=="class"||this._.definition.fullMatch)&&a.getAttribute(f)!=u(f,g[f]))&&!(b&&f.slice(0,
+5)=="data-")){e=a.hasAttribute(f);a.removeAttribute(f)}for(var h in c)if(!(this._.definition.fullMatch&&a.getStyle(h)!=u(h,c[h],true))){e=e||!!a.getStyle(h);a.removeStyle(h)}n(a,d,v[a.getName()]);e&&(this._.definition.alwaysRemoveElement?p(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==CKEDITOR.ENTER_BR&&!a.hasAttributes()?p(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function m(a){for(var b=x(this),c=a.getElementsByTag(this.element),g,d=c.count();--d>=0;){g=c.getItem(d);
+g.isReadOnly()||r.call(this,g,true)}for(var e in b)if(e!=this.element){c=a.getElementsByTag(e);for(d=c.count()-1;d>=0;d--){g=c.getItem(d);g.isReadOnly()||n(g,b[e])}}}function n(a,b,c){if(b=b&&b.attributes)for(var g=0;g",a||b.name,"");return c.join("")},getDefinition:function(){return this._.definition}};CKEDITOR.style.getStyleText=function(a){var b=a._ST;if(b)return b;var b=a.styles,c=a.attributes&&a.attributes.style||"",g="";c.length&&(c=c.replace(z,";"));for(var d in b){var e=b[d],f=(d+":"+e).replace(z,";");e=="inherit"?g=g+f:c=c+f}c.length&&(c=CKEDITOR.tools.normalizeCssText(c,true));return a._ST=c+g};CKEDITOR.style.customHandlers={};
+CKEDITOR.style.addCustomHandler=function(a){var b=function(a){this._={definition:a};this.setup&&this.setup(a)};b.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),{assignedTo:CKEDITOR.STYLE_OBJECT},a,true);return this.customHandlers[a.type]=b};var D=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,C=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED}(),CKEDITOR.styleCommand=function(a,f){this.requiredContent=
+this.allowedContent=this.style=a;CKEDITOR.tools.extend(this,f,true)},CKEDITOR.styleCommand.prototype.exec=function(a){a.focus();this.state==CKEDITOR.TRISTATE_OFF?a.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&a.removeStyle(this.style)},CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet"),CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet),CKEDITOR.loadStylesSet=function(a,f,b){CKEDITOR.stylesSet.addExternal(a,f,"");CKEDITOR.stylesSet.load(a,
+b)},CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(a,f){var b=this._.styleStateChangeCallbacks;if(!b){b=this._.styleStateChangeCallbacks=[];this.on("selectionChange",function(a){for(var d=0;d"}}),"use strict",function(){var a={},f={},b;for(b in CKEDITOR.dtd.$blockLimit)b in CKEDITOR.dtd.$list||(a[b]=1);for(b in CKEDITOR.dtd.$block)b in CKEDITOR.dtd.$blockLimit||b in CKEDITOR.dtd.$empty||(f[b]=1);CKEDITOR.dom.elementPath=function(b,d){var k=null,i=null,h=[],j=b,c,d=d||b.getDocument().getBody();
+do if(j.type==CKEDITOR.NODE_ELEMENT){h.push(j);if(!this.lastElement){this.lastElement=j;if(j.is(CKEDITOR.dtd.$object)||j.getAttribute("contenteditable")=="false")continue}if(j.equals(d))break;if(!i){c=j.getName();j.getAttribute("contenteditable")=="true"?i=j:!k&&f[c]&&(k=j);if(a[c]){var g;if(g=!k){if(c=c=="div"){a:{c=j.getChildren();g=0;for(var l=c.count();g-1}:typeof a=="function"?e=a:typeof a=="object"&&(e=function(b){return b.getName()in a});var d=this.elements,k=d.length;f&&k--;if(b){d=Array.prototype.slice.call(d,0);d.reverse()}for(f=0;f=e){k=d.createText("");k.insertAfter(this)}else{a=d.createText("");a.insertAfter(k);a.remove()}return k},substring:function(a,f){return typeof f!="number"?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,f)}}),function(){function a(a,e,d){var f=a.serializable,i=e[d?"endContainer":"startContainer"],h=d?"endOffset":"startOffset",j=f?e.document.getById(a.startNode):a.startNode,a=f?e.document.getById(a.endNode):a.endNode;if(i.equals(j.getPrevious())){e.startOffset=
+e.startOffset-i.getLength()-a.getPrevious().getLength();i=a.getNext()}else if(i.equals(a.getPrevious())){e.startOffset=e.startOffset-i.getLength();i=a.getNext()}i.equals(j.getParent())&&e[h]++;i.equals(a.getParent())&&e[h]++;e[d?"endContainer":"startContainer"]=i;return e}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,f)};var f={createIterator:function(){var a=this,e=CKEDITOR.dom.walker.bookmark(),
+d=[],f;return{getNextRange:function(i){f=f===void 0?0:f+1;var h=a[f];if(h&&a.length>1){if(!f)for(var j=a.length-1;j>=0;j--)d.unshift(a[j].createBookmark(true));if(i)for(var c=0;a[f+c+1];){for(var g=h.document,i=0,j=g.getById(d[c].endNode),g=g.getById(d[c+1].startNode);;){j=j.getNextSourceNode(false);if(g.equals(j))i=1;else if(e(j)||j.type==CKEDITOR.NODE_ELEMENT&&j.isBlockBoundary())continue;break}if(!i)break;c++}for(h.moveToBookmark(d.shift());c--;){j=a[++f];j.moveToBookmark(d.shift());h.setEnd(j.endContainer,
+j.endOffset)}}return h}}},createBookmarks:function(b){for(var e=[],d,f=0;fb?-1:1}),e=0,f;e',CKEDITOR.document);a.appendTo(CKEDITOR.document.getHead());try{var f=a.getComputedStyle("border-top-color"),b=a.getComputedStyle("border-right-color");CKEDITOR.env.hc=!!(f&&f==b)}catch(e){CKEDITOR.env.hc=false}a.remove()}if(CKEDITOR.env.hc)CKEDITOR.env.cssClass=CKEDITOR.env.cssClass+" cke_hc";CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");
+CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(a=CKEDITOR._.pending){delete CKEDITOR._.pending;for(f=0;f",c.label,"",'");else{e={type:"hbox",widths:c.widths,padding:0,children:[{type:"html",html:'"},{type:"html",html:'"+f.call(this,b,c)+""}]};CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,e,a)}return a.join("")})}},textInput:function(b,c,e){if(!(arguments.length<3)){a.call(this,c);var f=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",g={"class":"cke_dialog_ui_input_"+
-c.type,id:f,type:c.type};if(c.validate)this.validate=c.validate;if(c.maxLength)g.maxlength=c.maxLength;if(c.size)g.size=c.size;if(c.inputStyle)g.style=c.inputStyle;var i=this,q=false;b.on("load",function(){i.getInputElement().on("keydown",function(a){a.data.getKeystroke()==13&&(q=true)});i.getInputElement().on("keyup",function(a){if(a.data.getKeystroke()==13&&q){b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0);q=false}},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,
-b,c,e,function(){var a=['");return a.join("")})}},textarea:function(b,c,e){if(!(arguments.length<3)){a.call(this,c);var f=this,g=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",i={};if(c.validate)this.validate=c.validate;
-i.rows=c.rows||5;i.cols=c.cols||20;i["class"]="cke_dialog_ui_input_textarea "+(c["class"]||"");if(typeof c.inputStyle!="undefined")i.style=c.inputStyle;if(c.dir)i.dir=c.dir;CKEDITOR.ui.dialog.labeledElement.call(this,b,c,e,function(){i["aria-labelledby"]=this._.labelId;this._.required&&(i["aria-required"]=this._.required);var a=['");return a.join("")})}},checkbox:function(b,c,e){if(!(arguments.length<3)){var f=a.call(this,c,{"default":!!c["default"]});if(c.validate)this.validate=c.validate;CKEDITOR.ui.dialog.uiElement.call(this,b,c,e,"span",null,null,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},true),e=[],g=CKEDITOR.tools.getNextId()+"_label",j={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":g};i(a);if(c["default"])j.checked=
-"checked";if(typeof a.inputStyle!="undefined")a.style=a.inputStyle;f.checkbox=new CKEDITOR.ui.dialog.uiElement(b,a,e,"input",null,j);e.push(' ");return e.join("")})}},radio:function(b,c,e){if(!(arguments.length<3)){a.call(this,c);if(!this._["default"])this._["default"]=this._.initValue=c.items[0][1];if(c.validate)this.validate=c.validate;var f=[],g=this;c.role="radiogroup";
-c.includeLabel=true;CKEDITOR.ui.dialog.labeledElement.call(this,b,c,e,function(){for(var a=[],e=[],j=(c.id?c.id:CKEDITOR.tools.getNextId())+"_radio",o=0;o'+CKEDITOR.tools.htmlEncode(c.label)+"")}},select:function(b,c,e){if(!(arguments.length<3)){var f=a.call(this,c);if(c.validate)this.validate=c.validate;f.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,c,e,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_select":CKEDITOR.tools.getNextId()+"_select"},true),e=[],g=[],j={id:f.inputId,"class":"cke_dialog_ui_input_select",
-"aria-labelledby":this._.labelId};e.push('");return e.join("")})}},file:function(b,c,e){if(!(arguments.length<3)){c["default"]===void 0&&(c["default"]="");var f=CKEDITOR.tools.extend(a.call(this,c),{definition:c,buttons:[]});if(c.validate)this.validate=c.validate;b.on("load",function(){CKEDITOR.document.getById(f.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,c,e,function(){f.frameId=CKEDITOR.tools.getNextId()+
-"_fileInput";var a=['');return a.join("")})}},fileButton:function(b,c,e){var f=this;if(!(arguments.length<3)){a.call(this,c);if(c.validate)this.validate=c.validate;var g=CKEDITOR.tools.extend({},
-c),i=g.onClick;g.className=(g.className?g.className+" ":"")+"cke_dialog_ui_button";g.onClick=function(a){var e=c["for"];if(!i||i.call(this,a)!==false){b.getContentElement(e[0],e[1]).submit();this.disable()}};b.on("load",function(){b.getContentElement(c["for"][0],c["for"][1])._.buttons.push(f)});CKEDITOR.ui.dialog.button.call(this,b,g,e)}},html:function(){var a=/^\s*<[\w:]+\s+([^>]*)?>/,b=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,c=/\/$/;return function(e,f,g){if(!(arguments.length<3)){var i=[],
-p=f.html;p.charAt(0)!="<"&&(p=""+p+"");var o=f.focus;if(o){var m=this.focus;this.focus=function(){(typeof o=="function"?o:m).call(this);this.fire("focus")};if(f.isFocusable)this.isFocusable=this.isFocusable;this.keyboardFocusable=true}CKEDITOR.ui.dialog.uiElement.call(this,e,f,i,"span",null,null,"");i=i.join("").match(a);p=p.match(b)||["","",""];if(c.test(p[1])){p[1]=p[1].slice(0,-1);p[2]="/"+p[2]}g.push([p[1]," ",i[1]||"",p[2]].join(""))}}}(),fieldset:function(a,b,c,e,f){var g=f.label;
-this._={children:b};CKEDITOR.ui.dialog.uiElement.call(this,a,f,e,"fieldset",null,null,function(){var a=[];g&&a.push(""+g+"");for(var b=0;b0;)a.remove(0);return this},keyboardFocusable:true},e,true);CKEDITOR.ui.dialog.checkbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getInputElement:function(){return this._.checkbox.getElement()},setValue:function(a,b){this.getInputElement().$.checked=a;!b&&this.fire("change",{value:a})},getValue:function(){return this.getInputElement().$.checked},
-accessKeyUp:function(){this.setValue(!this.getValue())},eventProcessors:{onChange:function(a,c){if(!CKEDITOR.env.ie||CKEDITOR.env.version>8)return b.onChange.apply(this,arguments);a.on("load",function(){var a=this._.checkbox.getElement();a.on("propertychange",function(b){b=b.data.$;b.propertyName=="checked"&&this.fire("change",{value:a.$.checked})},this)},this);this.on("change",c);return null}},keyboardFocusable:true},e,true);CKEDITOR.ui.dialog.radio.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,
-{setValue:function(a,b){for(var c=this._.children,e,f=0;f0?new CKEDITOR.dom.element(a.$.forms[0].elements[0]):this.getElement()},submit:function(){this.getInputElement().getParent().$.submit();return this},getAction:function(){return this.getInputElement().getParent().$.action},registerEvents:function(a){var b=/^on([A-Z]\w+)/,c,e=function(a,b,c,d){a.on("formLoaded",function(){a.getInputElement().on(c,d,a)})},f;for(f in a)if(c=f.match(b))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();var d="";e.size&&(d=e.size-(CKEDITOR.env.ie?7:0));var r=b.frameId+"_input";c.$.write(['','
+ + + + + + +

+ CKEditor Samples » Replace Textarea with a "DIV-based" editor +

+
+ This sample is not maintained anymore. Check out the brand new samples in CKEditor SDK. +
+
+
+

+ This editor is using a <div> element-based editing area, provided by the Divarea plugin. +

+
+CKEDITOR.replace( 'textarea_id', {
+	extraPlugins: 'divarea'
+});
+
+ + +

+ +

+
+ + + diff --git a/src/collective/ckeditor/_src/ckeditor/samples/divreplace.html b/src/collective/ckeditor/_src/ckeditor/samples/old/divreplace.html similarity index 92% rename from src/collective/ckeditor/_src/ckeditor/samples/divreplace.html rename to src/collective/ckeditor/_src/ckeditor/samples/old/divreplace.html index 388f5a94..87f44db9 100644 --- a/src/collective/ckeditor/_src/ckeditor/samples/divreplace.html +++ b/src/collective/ckeditor/_src/ckeditor/samples/old/divreplace.html @@ -7,7 +7,7 @@ Replace DIV — CKEditor Sample - +