diff --git a/CHANGELOG b/CHANGELOG index 4d3e68750..2b3b72ed9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -48,6 +48,7 @@ Other: - Renamed and cleaned up static direcories. - Used jsonfield as required package. Removed jsonfield code. - Added new package backports.ssl_match_hostname for portable build script. +- Use app "django-ckeditor-updated" to render WYSIWYG HTML editors Version 1.5.1 (2014-03-31) diff --git a/README.rst b/README.rst index 571adcc66..286ae4d7a 100644 --- a/README.rst +++ b/README.rst @@ -261,6 +261,8 @@ OpenSlides uses the following projects or parts of them: * `Django `_, License: BSD +* `Django CKeditor `_, License: BSD + * `django-jsonfield `_, License: MIT diff --git a/extras/win32-portable/create_portable.txt b/extras/win32-portable/create_portable.txt index 690fdf716..6d11325f4 100644 --- a/extras/win32-portable/create_portable.txt +++ b/extras/win32-portable/create_portable.txt @@ -7,7 +7,7 @@ How to create a new portable Windows distribution of OpenSlides: 2. Install all required python packages (see requirements_production.txt): - easy_install -Z django backports.ssl_match_hostname beautifulsoup4 bleach django-haystack django-mptt jsonfield natsort reportlab roman setuptools sockjs_tornado tornado whoosh + easy_install -Z django backports.ssl_match_hostname beautifulsoup4 bleach django-ckeditor-updated django-haystack django-mptt jsonfield natsort reportlab roman setuptools sockjs_tornado tornado whoosh 3. Install pywin32 from binary installer: diff --git a/extras/win32-portable/licenses/django-ckeditor b/extras/win32-portable/licenses/django-ckeditor new file mode 100644 index 000000000..3982829e5 --- /dev/null +++ b/extras/win32-portable/licenses/django-ckeditor @@ -0,0 +1,24 @@ +Copyright (c) Shaun Sephton +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Shaun Sephton nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL SHAUN SEPHTON BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/extras/win32-portable/prepare_portable.py b/extras/win32-portable/prepare_portable.py index 4675f76a1..234ab5e6c 100755 --- a/extras/win32-portable/prepare_portable.py +++ b/extras/win32-portable/prepare_portable.py @@ -72,6 +72,9 @@ SITE_PACKAGES = { r"^django/contrib/webdesign/", ] }, + "django_ckeditor_updated": { + "copy": ["ckeditor"], + }, "django-haystack": { "copy": ["haystack"], }, diff --git a/openslides/agenda/forms.py b/openslides/agenda/forms.py index 839cfeed6..a503d6b93 100644 --- a/openslides/agenda/forms.py +++ b/openslides/agenda/forms.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re +from ckeditor.widgets import CKEditorWidget from django import forms from django.utils.translation import ugettext_lazy @@ -32,6 +33,7 @@ class ItemForm(CleanHtmlFormMixin, CssClassMixin, forms.ModelForm): class Meta: model = Item fields = ('item_number', 'title', 'text', 'comment', 'type', 'duration', 'parent', 'speaker_list_closed') + widgets = {'text': CKEditorWidget(config_name='images')} class RelatedItemForm(ItemForm): diff --git a/openslides/agenda/templates/agenda/edit.html b/openslides/agenda/templates/agenda/edit.html index 4cffd87b6..1d50f8fa9 100644 --- a/openslides/agenda/templates/agenda/edit.html +++ b/openslides/agenda/templates/agenda/edit.html @@ -13,23 +13,6 @@ – {{ block.super }} {% endblock %} -{% block header %} - {{ block.super }} - -{% endblock %} - -{% block javascript %} - {{ block.super }} - - - -{% endblock %} - {% block content %}

{% if item %} diff --git a/openslides/core/static/css/ckeditor.css b/openslides/core/static/css/ckeditor.css deleted file mode 100644 index e8f580992..000000000 --- a/openslides/core/static/css/ckeditor.css +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -body.ckeditor_html -{ - /* Font */ - font-family: sans-serif, Arial, Verdana, "Trebuchet MS"; - font-size: 12px; - - /* Text color */ - color: #333; - - /* Remove the background color to make it transparent */ - background-color: #fff; - - margin: 20px; -} - -.ckeditor_html.cke_editable -{ - font-size: 13px; - line-height: 1.6em; -} - -.ckeditor_html blockquote -{ - font-style: italic; - font-family: Georgia, Times, "Times New Roman", serif; - padding: 2px 0; - border-style: solid; - border-color: #ccc; - border-width: 0; -} - -.ckeditor_html .cke_contents_ltr blockquote -{ - padding-left: 20px; - padding-right: 8px; - border-left-width: 5px; -} - -.ckeditor_html .cke_contents_rtl blockquote -{ - padding-left: 8px; - padding-right: 20px; - border-right-width: 5px; -} - -.ckeditor_html a -{ - color: #0782C1; -} - -.ckeditor_html ol,.ckeditor_html ul,.ckeditor_html dl -{ - /* IE7: reset rtl list margin. (#7334) */ - *margin-right: 0px; - /* preserved spaces for list items with text direction other than the list. (#6249,#8049)*/ - padding: 0 40px; -} - -.ckeditor_html h1,.ckeditor_html h2,.ckeditor_html h3,.ckeditor_html h4,.ckeditor_html h5,.ckeditor_html h6 -{ - font-weight: normal; - line-height: 1.2em; -} - -.ckeditor_html hr -{ - border: 0px; - border-top: 1px solid #ccc; -} - -.ckeditor_html img.right { - border: 1px solid #ccc; - float: right; - margin-left: 15px; - padding: 5px; -} - -.ckeditor_html img.left { - border: 1px solid #ccc; - float: left; - margin-right: 15px; - padding: 5px; -} - -.ckeditor_html img:hover { - opacity: .9; - filter: alpha(opacity = 90); -} - -.ckeditor_html pre -{ - white-space: pre-wrap; /* CSS 2.1 */ - word-wrap: break-word; /* IE7 */ - border: dotted 1px gray; padding: 10px; -} - -.ckeditor_html .marker { - background-color: Yellow; -} - -.cke_dialog_contents textarea { - font-family: Courier New, monospace; - font-size: 14px; -} diff --git a/openslides/core/static/js/ckeditor/CHANGES.md b/openslides/core/static/js/ckeditor/CHANGES.md deleted file mode 100644 index f4cdd21e4..000000000 --- a/openslides/core/static/js/ckeditor/CHANGES.md +++ /dev/null @@ -1,185 +0,0 @@ -CKEditor 4 Changelog -==================== - -## CKEditor 4.2 - -**Important Notes:** - -* Dropped compatibility support for Internet Explorer 7 and Firefox 3.6. - -* Both the Basic and the Standard distribution packages will not contain the new [indentblock](http://ckeditor.com/addon/indentblock) plugin. Because of this the [Advanced Content Filter](http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter) might remove block indentations from existing contents. If you want to prevent this, either [add an appropriate ACF rule to your filter](http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules) or create a custom build based on the Basic/Standard package and add the indentblock plugin in [CKBuilder](http://ckeditor.com/builder). - -Fixed issues: - -* [#10027](http://dev.ckeditor.com/ticket/10027): Separated list and block indentation into two plugins: [indentlist](http://ckeditor.com/addon/indentlist) and [indentblock](http://ckeditor.com/addon/indentblock). -* [#8244](http://dev.ckeditor.com/ticket/8244): Use *(Shift+)Tab* to indent and outdent lists. -* [#10599](http://dev.ckeditor.com/ticket/10599): [Indent](http://ckeditor.com/addon/indent) plugin is no longer required by the [list](http://ckeditor.com/addon/list) plugin. -* [#10281](http://dev.ckeditor.com/ticket/10281): The [jQuery Adapter](http://docs.ckeditor.com/#!/guide/dev_jquery) is now available. Several jQuery-related issues fixed: [#8261](http://dev.ckeditor.com/ticket/8261), [#9077](http://dev.ckeditor.com/ticket/9077), [#8710](http://dev.ckeditor.com/ticket/8710), [#8530](http://dev.ckeditor.com/ticket/8530), [#9019](http://dev.ckeditor.com/ticket/9019), [#6181](http://dev.ckeditor.com/ticket/6181), [#7876](http://dev.ckeditor.com/ticket/7876), [#6906](http://dev.ckeditor.com/ticket/6906). -* [#10042](http://dev.ckeditor.com/ticket/10042): Introduced [config.title](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-title) setting to change the human-readable title of the editor. -* [#10370](http://dev.ckeditor.com/ticket/10370): Inconsistency in data events between framed and inline editors. -* [#9794](http://dev.ckeditor.com/ticket/9794): Added [onChange](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-change) event. -* [#9923](http://dev.ckeditor.com/ticket/9923): HiDPI support in the editor UI. HiDPI icons for [Moono skin](http://ckeditor.com/addon/moono) added. -* [#8031](http://dev.ckeditor.com/ticket/8031): Handle `required` attributes on `");return""+encodeURIComponent(a)+""})}function g(a){return a.replace(D,function(a,b){return decodeURIComponent(b)})} -function p(a){return a.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g,function(a){return"<\!--"+A+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\>"})}function v(a){return a.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)})}function u(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 m(a, -b){for(var c=[],d=b.config.protectedSource,g=b._.dataStore||(b._.dataStore={id:1}),e=/<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,d=[//gi,//gi].concat(d),a=a.replace(/<\!--[\s\S]*?--\>/g,function(a){return"<\!--{cke_tempcomment}"+(c.push(a)-1)+"--\>"}),f=0;f"});a=a.replace(e,function(a,b,d){return"<\!--"+ -A+(b?"{C}":"")+encodeURIComponent(c[d]).replace(/--/g,"%2D%2D")+"--\>"});return a.replace(/(['"]).*?\1/g,function(a){return a.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g,function(a,b){g[g.id]=decodeURIComponent(b);return"{cke_protected_"+g.id++ +"}"})})}CKEDITOR.htmlDataProcessor=function(a){var d,e,f=this;this.editor=a;this.dataFilter=d=new CKEDITOR.htmlParser.filter;this.htmlFilter=e=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;d.addRules(s);d.addRules(b(a, -"data"));e.addRules(C);e.addRules(b(a,"html"));a.on("toHtml",function(b){var b=b.data,d=b.dataValue,d=m(d,a),d=k(d,G),d=q(d),d=k(d,I),d=d.replace(Q,"$1cke:$2"),d=d.replace(F,""),d=CKEDITOR.env.opera?d:d.replace(/(]*>)(\r\n|\n)/g,"$1$2$2"),e=b.context||a.editable().getName(),f;if(CKEDITOR.env.ie&&CKEDITOR.env.version<9&&e=="pre"){e="div";d="
"+d+"
";f=1}e=a.document.createElement(e);e.setHtml("a"+d);d=e.getHtml().substr(1);d=d.replace(RegExp(" data-cke-"+CKEDITOR.rnd+ -"-","ig")," ");f&&(d=d.replace(/^
|<\/pre>$/gi,""));d=d.replace(L,"$1$2");d=g(d);d=v(d);b.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(d,b.context,b.fixForBody===false?false:c(a.config))},null,null,5);a.on("toHtml",function(a){a.data.dataValue.filterChildren(f.dataFilter,true)},null,null,10);a.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=p(b)},null,null,15);a.on("toDataFormat",function(b){b.data.dataValue=
-CKEDITOR.htmlParser.fragment.fromHtml(b.data.dataValue,a.editable().getName(),c(a.config))},null,null,5);a.on("toDataFormat",function(a){a.data.dataValue.filterChildren(f.htmlFilter,true)},null,null,10);a.on("toDataFormat",function(b){var c=b.data.dataValue,d=f.writer;d.reset();c.writeChildrenHtml(d);c=d.getHtml(true);c=v(c);c=u(c,a);b.data.dataValue=c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,b,c,d){var g=this.editor;!b&&b!==null&&(b=g.editable().getName());return g.fire("toHtml",
-{dataValue:a,context:b,fixForBody:c,dontFilter:!!d}).dataValue},toDataFormat:function(a){return this.editor.fire("toDataFormat",{dataValue:a}).dataValue}};var E=/(?: |\xa0)$/,A="{cke_protected}",r=CKEDITOR.dtd,x=["caption","colgroup","col","thead","tfoot","tbody"],z=CKEDITOR.tools.extend({},r.$blockLimit,r.$block),s={elements:{},attributeNames:[[/^on/,"data-cke-pa-on"]]},C={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,g=0;g-1&&d>-1&&c!=d)){c=l(a);d=l(b)}return c>d?1:-1})},embed:function(a){var b=a.parent;if(b&&b.name=="object"){var c=
-b.attributes.width,b=b.attributes.height;c&&(a.attributes.width=c);b&&(a.attributes.height=b)}},param:function(a){a.children=[];a.isEmpty=true;return a},a:function(a){if(!a.children.length&&!a.attributes.name&&!a.attributes["data-cke-saved-name"])return false},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];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&&j(a,b=new CKEDITOR.htmlParser.text);b.value=a.attributes["data-cke-title"]||""}},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||false}}};if(CKEDITOR.env.ie)C.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})};for(var y in{input:1,
-textarea:1}){s.elements[y]=n;C.elements[y]=o}var t=/<(a|area|img|input|source)\b([^>]*)>/gi,w=/\s(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,I=/(?:])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,G=/(])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,D=/([^<]*)<\/cke:encoded>/gi,Q=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,L=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,F=/]*?)\/?>(?!\s*<\/cke:\1)/gi})();
-"use strict";CKEDITOR.htmlParser.element=function(b,c){this.name=b;this.attributes=c||{};this.children=[];var a=b||"",e=a.match(/^cke:(.*)/);e&&(a=e[1]);a=!(!CKEDITOR.dtd.$nonBodyContent[a]&&!CKEDITOR.dtd.$block[a]&&!CKEDITOR.dtd.$listItem[a]&&!CKEDITOR.dtd.$tableContent[a]&&!(CKEDITOR.dtd.$nonEditable[a]||a=="br"));this.isEmpty=!!CKEDITOR.dtd.$empty[b];this.isUnknown=!CKEDITOR.dtd[b];this._={isBlockLike:a,hasInlineStarted:this.isEmpty||!a}};
-CKEDITOR.htmlParser.cssStyle=function(b){var c={};((b instanceof CKEDITOR.htmlParser.element?b.attributes.style:b)||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,b,d){b=="font-family"&&(d=d.replace(/["']/g,""));c[b.toLowerCase()]=d});return{rules:c,populate:function(a){var b=this.toString();if(b)a instanceof CKEDITOR.dom.element?a.setAttribute("style",b):a instanceof CKEDITOR.htmlParser.element?a.attributes.style=b:a.style=b},toString:function(){var a=[],b;
-for(b in c)c[b]&&a.push(b,":",c[b],";");return a.join("")}}};
-(function(){var b=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){var b=this,c,h;if(!b.parent)a.onRoot(b);for(;;){c=b.name;if(!(h=a.onElementName(c))){this.remove();return false}b.name=h;if(!(b=a.onElement(b))){this.remove();return false}if(b!==
-this){this.replaceWith(b);return false}if(b.name==c)break;if(b.type!=CKEDITOR.NODE_ELEMENT){this.replaceWith(b);return false}if(!b.name){this.replaceWithChildren();return false}}c=b.attributes;var f,j;for(f in c){j=f;for(h=c[f];;)if(j=a.onAttributeName(f))if(j!=f){delete c[f];f=j}else break;else{delete c[f];break}j&&((h=a.onAttribute(b,j,h))===false?delete c[j]:c[j]=h)}b.isEmpty||this.filterChildren(a);return true},filterChildren:c.filterChildren,writeHtml:function(a,c){c&&this.filter(c);var d=this.name,
-h=[],f=this.attributes,j,i;a.openTag(d,f);for(j in f)h.push([j,f[j]]);a.sortAttributes&&h.sort(b);j=0;for(i=h.length;j'+e.getValue()+"",CKEDITOR.document);
-b.insertAfter(e);e.hide();e.$.form&&a._attachToForm()}else a.setData(b.getHtml(),null,true);a.on("loaded",function(){a.fire("uiReady");a.editable(b);a.container=b;a.setData(a.getData(1));a.resetDirty();a.fire("contentDom");a.mode="wysiwyg";a.fire("mode");a.status="ready";a.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,a)},null,null,1E4);a.on("destroy",function(){if(e){a.container.clearCustomData();a.container.remove();e.show()}a.element.clearCustomData();delete a.element});return a};
-CKEDITOR.inlineAll=function(){var b,c,a;for(a in CKEDITOR.dtd.$editable)for(var e=CKEDITOR.document.getElementsByTag(a),d=0,h=e.count();d{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(e.output({id:a.id,name:b,langDir:a.lang.dir,langCode:a.langCode,voiceLabel:[a.lang.editor,a.name].join(", "),topHtml:i?''+i+"":"",contentId:a.ui.spaceId("contents"),bottomHtml:l?''+l+"":"",outerEl:CKEDITOR.env.ie?"span":"div"}));if(j==CKEDITOR.ELEMENT_MODE_REPLACE){c.hide();
-b.insertAfter(c)}else c.append(b);a.container=b;i&&a.ui.space("top").unselectable();l&&a.ui.space("bottom").unselectable();c=a.config.width;j=a.config.height;c&&b.setStyle("width",CKEDITOR.tools.cssLength(c));j&&a.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(j));b.disableContextMenu();CKEDITOR.env.webkit&&b.on("focus",function(){a.focus()});a.fireOnce("uiReady")}CKEDITOR.replace=function(a,c){return b(a,c,null,CKEDITOR.ELEMENT_MODE_REPLACE)};CKEDITOR.appendTo=function(a,c,e){return b(a,
-c,e,CKEDITOR.ELEMENT_MODE_APPENDTO)};CKEDITOR.replaceAll=function(){for(var a=document.getElementsByTagName("textarea"),b=0;b",i="",a=f+a.replace(e,function(){return i+f})+i}a=a.replace(/\n/g,"
");b||(a=a.replace(RegExp("
(?=)"),function(a){return d.repeat(a,2)}));a=a.replace(/^ | $/g," ");a=a.replace(/(>|\s) /g,function(a,b){return b+" "}).replace(/ (?=<)/g," ");n(this,"text",a)},insertElement:function(b){h(this);for(var c=this.editor,d=c.config.enterMode, -g=c.getSelection(),e=g.getRanges(),i=b.getName(),j=CKEDITOR.dtd.$block[i],m,n,l,r=e.length-1;r>=0;r--){m=e[r];if(!m.checkReadOnly()){m.deleteContents(1);n=!r&&b||b.clone(1);var x,z;if(j)for(;(x=m.getCommonAncestor(0,1))&&(z=CKEDITOR.dtd[x.getName()])&&(!z||!z[i]);)if(x.getName()in CKEDITOR.dtd.span)m.splitElement(x);else if(m.checkStartOfBlock()&&m.checkEndOfBlock()){m.setStartBefore(x);m.collapse(true);x.remove()}else m.splitBlock(d==CKEDITOR.ENTER_DIV?"div":"p",c.editable());m.insertNode(n);l|| -(l=n)}}if(l){m.moveToPosition(l,CKEDITOR.POSITION_AFTER_END);if(j)if((b=l.getNext(a))&&b.type==CKEDITOR.NODE_ELEMENT&&b.is(CKEDITOR.dtd.$block))b.getDtd()["#"]?m.moveToElementEditStart(b):m.moveToElementEditEnd(l);else if(!b&&d!=CKEDITOR.ENTER_BR){b=m.fixBlock(true,d==CKEDITOR.ENTER_DIV?"div":"p");m.moveToElementEditStart(b)}}g.selectRanges([m]);f(this,CKEDITOR.env.opera)},setData:function(a,b){!b&&this.editor.dataProcessor&&(a=this.editor.dataProcessor.toHtml(a));this.setHtml(a);this.editor.fire("dataReady")}, -getData:function(a){var b=this.getHtml();!a&&this.editor.dataProcessor&&(b=this.editor.dataProcessor.toDataFormat(b));return b},setReadOnly:function(a){this.setAttribute("contenteditable",!a)},detach:function(){this.removeClass("cke_editable");var a=this.editor;this._.detach();delete a.document;delete a.window},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},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(j,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(a){CKEDITOR.env.opera&&CKEDITOR.document.getActive().equals(this.isInline()?this:this.getWindow().getFrame())?a.cancel():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.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 e=a.config.contentsLangDirection;this.getDirection(1)!=e&&this.changeAttr("dir",e);var g=CKEDITOR.getCss();if(g){e=b.getHead();if(!e.getCustomData("stylesheet")){g=b.appendStyleText(g);g=new CKEDITOR.dom.element(g.ownerNode||g.owningElement);e.setCustomData("stylesheet",g);g.data("cke-temp",1)}}e= -b.getCustomData("stylesheet_ref")||0;b.setCustomData("stylesheet_ref",e+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){var a=a.data,b=a.getTarget();b.is("a")&&(a.$.button!=2&&b.isReadOnly())&&a.preventDefault()});this.attachListener(a,"key",function(b){if(a.readOnly)return true;var c=b.data.keyCode,g;if(c in{8:1,46:1}){var e=a.getSelection(),b=e.getRanges()[0],f=b.startPath(),k,h,j,c=c==8;if(e=d(e)){a.fire("saveSnapshot"); -b.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);e.remove();b.select();a.fire("saveSnapshot");g=1}else if(b.collapsed)if((k=f.block)&&b[c?"checkStartOfBlock":"checkEndOfBlock"]()&&(j=k[c?"getPrevious":"getNext"](i))&&j.is("table")){a.fire("saveSnapshot");b[c?"checkEndOfBlock":"checkStartOfBlock"]()&&k.remove();b["moveToElementEdit"+(c?"End":"Start")](j);b.select();a.fire("saveSnapshot");g=1}else if(f.blockLimit&&f.blockLimit.is("td")&&(h=f.blockLimit.getAscendant("table"))&&b.checkBoundaryOfElement(h, -c?CKEDITOR.START:CKEDITOR.END)&&(j=h[c?"getPrevious":"getNext"](i))){a.fire("saveSnapshot");b["moveToElementEdit"+(c?"End":"Start")](j);b.checkStartOfBlock()&&b.checkEndOfBlock()?j.remove():b.select();a.fire("saveSnapshot");g=1}else if((h=f.contains(["td","th","caption"]))&&b.checkBoundaryOfElement(h,c?CKEDITOR.START:CKEDITOR.END))g=1}return!g});CKEDITOR.env.ie&&this.attachListener(this,"click",c);!CKEDITOR.env.ie&&!CKEDITOR.env.opera&&this.attachListener(this,"mousedown",function(b){var c=b.data.getTarget(); -if(c.is("img","hr","input","textarea","select")){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(j,"")){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()})}}}},_:{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());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()}}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 j=/(^|]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,i=CKEDITOR.dom.walker.whitespaces(true),l=CKEDITOR.dom.walker.bookmark(false,true);CKEDITOR.on("instanceLoaded",function(a){var c=a.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(a){if(!c.readOnly){var d=c.getSelection();if(d&&!d.isLocked){d=c.checkDirty();c.fire("lockSnapshot");b(a);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);if(c=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents")){var d=CKEDITOR.tools.getNextId(),e=CKEDITOR.dom.element.createFromHtml(''+this.lang.common.editorHelp+"");c.append(e);a.changeAttr("aria-describedby",d)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}"); -var n=function(){function b(a){return a.type==CKEDITOR.NODE_ELEMENT}function c(a,d){var g,e,f,h,k=[],m=d.range.startContainer;g=d.range.startPath();for(var m=i[m.getName()],p=0,j=a.getChildren(),n=j.count(),l=-1,v=-1,E=0,A=g.contains(i.$list);p-1)k[l].firstNotAllowed=1;if(v>-1)k[v].lastNotAllowed=1;return k}function d(a,c){var g=[],e=a.getChildren(),f=e.count(),h,m=0,p=i[c],j=!a.is(i.$inline)||a.is("br");for(j&&g.push(" ");m ",s.document);s.insertNode(w);s.setStartAfter(w)}I=new CKEDITOR.dom.elementPath(s.startContainer);l.endPath=G=new CKEDITOR.dom.elementPath(s.endContainer);if(!s.collapsed){var t=G.block||G.blockLimit,Q=s.getCommonAncestor(); -t&&(!t.equals(Q)&&!t.contains(Q)&&s.checkEndOfBlock())&&l.zombies.push(t);s.deleteContents()}for(;(D=b(s.startContainer)&&s.startContainer.getChild(s.startOffset-1))&&b(D)&&D.isBlockBoundary()&&I.contains(D);)s.moveToPosition(D,CKEDITOR.POSITION_BEFORE_END);e(s,l.blockLimit,I,G);if(w){s.setEndBefore(w);s.collapse();w.remove()}w=s.startPath();if(t=w.contains(g,false,1)){s.splitElement(t);l.inlineStylesRoot=t;l.inlineStylesPeak=w.lastElement}w=s.createBookmark();(t=w.startNode.getPrevious(a))&&b(t)&& -g(t)&&y.push(t);(t=w.startNode.getNext(a))&&b(t)&&g(t)&&y.push(t);for(t=w.startNode;(t=t.getParent())&&g(t);)y.push(t);s.moveToBookmark(w);if(w=z){w=l.range;if(l.type=="text"&&l.inlineStylesRoot){D=l.inlineStylesPeak;s=D.getDocument().createText("{cke-peak}");for(y=l.inlineStylesRoot.getParent();!D.equals(y);){s=s.appendTo(D.clone());D=D.getParent()}z=s.getOuterHtml().split("{cke-peak}").join(z)}D=l.blockLimit.getName();if(/^\s+|\s+$/.test(z)&&"span"in CKEDITOR.dtd[D])var L=' ', -z=L+z+L;z=l.editor.dataProcessor.toHtml(z,null,false,l.dontFilter);D=w.document.createElement("body");D.setHtml(z);if(L){D.getFirst().remove();D.getLast().remove()}if((L=w.startPath().block)&&!(L.getChildCount()==1&&L.getBogus()))a:{var F;if(D.getChildCount()==1&&b(F=D.getFirst())&&F.is(j)){L=F.getElementsByTag("*");w=0;for(y=L.count();w0;else{B=F.startPath();if(!G.isBlock&&(N=l.editor.config.enterMode!=CKEDITOR.ENTER_BR&&l.editor.config.autoParagraph!==false?l.editor.config.enterMode==CKEDITOR.ENTER_DIV?"div":"p":false)&&!B.block&&B.blockLimit&&B.blockLimit.equals(F.root)){N=L.createElement(N);!CKEDITOR.env.ie&&N.appendBogus();F.insertNode(N);!CKEDITOR.env.ie&&(J=N.getBogus())&&J.remove();F.moveToPosition(N,CKEDITOR.POSITION_BEFORE_END)}if((B= -F.startPath().block)&&!B.equals(H)){if(J=B.getBogus()){J.remove();D.push(B)}H=B}G.firstNotAllowed&&(s=1);if(s&&G.isElement){B=F.startContainer;for(K=null;B&&!i[B.getName()][G.name];){if(B.equals(z)){B=null;break}K=B;B=B.getParent()}if(B){if(K){O=F.splitElement(K);l.zombies.push(O);l.zombies.push(K)}}else{K=z.getName();P=!w;B=w==I.length-1;K=d(G.node,K);for(var M=[],R=K.length,T=0,U=void 0,V=0,W=-1;T1&&h&&h.intersectsNode(c.$)){d=[e.anchorOffset,e.focusOffset];h=e.focusNode==c.$&&e.focusOffset>0;e.anchorNode==c.$&&e.anchorOffset>0&&d[0]--;h&&d[1]--;var i;h=e;if(!h.isCollapsed){i=h.getRangeAt(0);i.setStart(h.anchorNode,h.anchorOffset);i.setEnd(h.focusNode,h.focusOffset);i=i.collapsed}i&&d.unshift(d.pop())}}c.setText(f(c.getText()));if(d){c=e.getRangeAt(0);c.setStart(c.startContainer,d[0]);c.setEnd(c.startContainer,d[1]);e.removeAllRanges();e.addRange(c)}}}function f(a){return a.replace(/\u200B( )?/g, -function(a){return a[1]?" ":""})}function j(a,b,c){var d=a.on("focus",function(a){a.cancel()},null,null,-100);if(CKEDITOR.env.ie)var e=a.getDocument().on("selectionchange",function(a){a.cancel()},null,null,-100);else{var f=new CKEDITOR.dom.range(a);f.moveToElementEditStart(a);var h=a.getDocument().$.createRange();h.setStart(f.startContainer.$,f.startOffset);h.collapse(1);b.removeAllRanges();b.addRange(h)}c&&a.focus();d.removeListener();e&&e.removeListener()}var i,l,n=CKEDITOR.dom.walker.invisible(1); -CKEDITOR.on("instanceCreated",function(a){function d(){var a=e.getSelection();a&&a.removeAllRanges()}var e=a.editor;e.define("selectionChange",{errorProof:1});e.on("contentDom",function(){var a=e.document,d=CKEDITOR.document,g=e.editable(),f=a.getBody(),k=a.getDocumentElement(),i=g.isInline(),j;CKEDITOR.env.gecko&&g.attachListener(g,"focus",function(a){a.removeListener();if(j!==0){a=e.getSelection().getNative();if(a.isCollapsed&&a.anchorNode==g.$){a=e.createRange();a.moveToElementEditStart(g);a.select()}}}, -null,null,-2);g.attachListener(g,"focus",function(){e.unlockSelection(j);j=0},null,null,-1);g.attachListener(g,"mousedown",function(){j=0});if(CKEDITOR.env.ie||CKEDITOR.env.opera||i){var l,n=function(){l=e.getSelection(1);l.lock()};o?g.attachListener(g,"beforedeactivate",n,null,null,-1):g.attachListener(e,"selectionCheck",n,null,null,-1);g.attachListener(g,"blur",function(){e.lockSelection(l);j=1},null,null,-1)}if(CKEDITOR.env.ie&&!i){var q;g.attachListener(g,"mousedown",function(a){a.data.$.button== -2&&e.document.$.selection.type=="None"&&(q=e.window.getScrollPosition())});g.attachListener(g,"mouseup",function(a){if(a.data.$.button==2&&q){e.document.$.documentElement.scrollLeft=q.x;e.document.$.documentElement.scrollTop=q.y}q=null});if(a.$.compatMode!="BackCompat"){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)k.on("mousedown",function(a){function b(a){a=a.data.$;if(e){var c=f.$.createTextRange();try{c.moveToPoint(a.x,a.y)}catch(d){}e.setEndPoint(h.compareEndPoints("StartToStart",c)<0?"EndToEnd": -"StartToStart",c);e.select()}}function c(){k.removeListener("mousemove",b);d.removeListener("mouseup",c);k.removeListener("mouseup",c);e.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y7){k.on("mousedown",function(a){if(a.data.getTarget().is("html")){d.on("mouseup",y);k.on("mouseup", -y)}});var y=function(){d.removeListener("mouseup",y);k.removeListener("mouseup",y);var b=CKEDITOR.document.$.selection,c=b.createRange();b.type!="None"&&c.parentElement().ownerDocument==a.$&&c.select()}}}}g.attachListener(g,"selectionchange",b,e);g.attachListener(g,"keyup",c,e);g.attachListener(g,"focus",function(){e.forceNextSelectionCheck();e.selectionChange(1)});if(i?CKEDITOR.env.webkit||CKEDITOR.env.gecko:CKEDITOR.env.opera){var t;g.attachListener(g,"mousedown",function(){t=1});g.attachListener(a.getDocumentElement(), -"mouseup",function(){t&&c.call(e);t=0})}else g.attachListener(CKEDITOR.env.ie?g:a.getDocumentElement(),"mouseup",c,e);CKEDITOR.env.webkit&&g.attachListener(a,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:h(g)}},null,null,-1)});e.on("contentDomUnload",e.forceNextSelectionCheck,e);e.on("dataReady",function(){e.selectionChange(1)});CKEDITOR.env.ie9Compat&&e.on("beforeDestroy",d,null,null,9);CKEDITOR.env.webkit&&e.on("setData", -d);e.on("contentDomUnload",function(){e.unlockSelection()})});CKEDITOR.on("instanceReady",function(a){var b=a.editor;if(CKEDITOR.env.webkit){b.on("selectionChange",function(){var a=b.editable(),c=d(a);c&&(c.getCustomData("ready")?h(a):c.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){h(b.editable())},null,null,-1);var c,e,a=function(){var a=b.editable();if(a)if(a=d(a)){var h=b.document.$.defaultView.getSelection();h.type=="Caret"&&h.anchorNode==a.$&&(e=1);c=a.getText();a.setText(f(c))}}, -i=function(){var a=b.editable();if(a)if(a=d(a)){a.setText(c);if(e){b.document.$.defaultView.getSelection().setPosition(a.$,a.getLength());e=0}}};b.on("beforeUndoImage",a);b.on("afterUndoImage",i);b.on("beforeGetData",a,null,null,0);b.on("getData",i)}});CKEDITOR.editor.prototype.selectionChange=function(a){(a?b:c).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){if(this._.savedSelection&&!a)return this._.savedSelection;return(a=this.editable())?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 o=typeof window.getSelection!="function";CKEDITOR.dom.selection=function(a){var b=a instanceof CKEDITOR.dom.element;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=a=b?a:this.document.getBody(); -this.isLocked=0;this._={cache:{}};b=o?this.document.$.selection:this.document.getWindow().$.getSelection();if(CKEDITOR.env.webkit)(b.type=="None"&&this.document.getActive().equals(a)||b.type=="Caret"&&b.anchorNode.nodeType==CKEDITOR.NODE_DOCUMENT)&&j(a,b);else if(CKEDITOR.env.gecko)b&&(this.document.getActive().equals(a)&&b.anchorNode&&b.anchorNode.nodeType==CKEDITOR.NODE_DOCUMENT)&&j(a,b,true);else if(CKEDITOR.env.ie){var c;try{c=this.document.getActive()}catch(d){}if(o)b.type=="None"&&(c&&c.equals(this.document.getDocumentElement()))&& -j(a,null,true);else{(b=b&&b.anchorNode)&&(b=new CKEDITOR.dom.node(b));c&&(c.equals(this.document.getDocumentElement())&&b&&(a.equals(b)||a.contains(b)))&&j(a,null,true)}}c=this.getNative();var e,f;if(c)if(c.getRangeAt)e=(f=c.rangeCount&&c.getRangeAt(0))&&new CKEDITOR.dom.node(f.commonAncestorContainer);else{try{f=c.createRange()}catch(h){}e=f&&CKEDITOR.dom.element.get(f.item&&f.item(0)||f.parentElement())}if(!e||!a.equals(e)&&!a.contains(e)){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 q={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=o?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:o?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&&q[d.childNodes[c.startOffset].nodeName.toLowerCase()])b=CKEDITOR.SELECTION_ELEMENT}return a.type=b},getRanges:function(){var a=o?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(),e=d.ownerDocument;if(!d.hasChildNodes())return{container:d,offset:0};for(var f=d.children,h,i,k=b.duplicate(),j=0,l=f.length-1,n=-1,t,o;j<=l;){n=Math.floor((j+l)/2);h=f[n];k.moveToElementText(h); -t=k.compareEndPoints("StartToStart",b);if(t>0)l=n-1;else if(t<0)j=n+1;else{if(CKEDITOR.env.ie9Compat&&h.tagName=="BR"){f=e.defaultView.getSelection();return{container:f[c?"anchorNode":"focusNode"],offset:f[c?"anchorOffset":"focusOffset"]}}return{container:d,offset:a(h)}}}if(n==-1||n==f.length-1&&t<0){k.moveToElementText(d);k.setEndPoint("StartToStart",b);e=k.text.replace(/(\r\n|\r)/g,"\n").length;f=d.childNodes;if(!e){h=f[f.length-1];return h.nodeType!=CKEDITOR.NODE_TEXT?{container:d,offset:f.length}: -{container:h,offset:h.nodeValue.length}}for(d=f.length;e>0&&d>0;){i=f[--d];if(i.nodeType==CKEDITOR.NODE_TEXT){o=i;e=e-i.nodeValue.length}}return{container:o,offset:-e}}k.collapse(t>0?true:false);k.setEndPoint(t>0?"StartToStart":"EndToStart",b);e=k.text.replace(/(\r\n|\r)/g,"\n").length;if(!e)return{container:d,offset:a(h)+(t>0?0:1)};for(;e>0;)try{i=h[t>0?"previousSibling":"nextSibling"];if(i.nodeType==CKEDITOR.NODE_TEXT){e=e-i.nodeValue.length;o=i}h=i}catch(p){return{container:d,offset:a(h)}}return{container:o, -offset:t>0?-e:o.nodeValue.length+e}};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;e=b.getLength()?l.setStartAfter(b):l.setStartBefore(b));h&&h.type==CKEDITOR.NODE_TEXT&&(j?l.setEndAfter(h):l.setEndBefore(h));b=new CKEDITOR.dom.walker(l);b.evaluator=function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&a.isReadOnly()){var b=f.clone();f.setEndBefore(a);f.collapsed&&d.splice(e--,1);if(!(a.getPosition(l.endContainer)&CKEDITOR.POSITION_CONTAINS)){b.setStartAfter(a);b.collapsed|| -d.splice(e+1,0,b)}return true}return false};b.next()}}return c.ranges}}(),getStartElement:function(){var a=this._.cache;if(a.startElement!==void 0)return a.startElement;var b;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var c=this.getRanges()[0];if(c){if(c.collapsed){b=c.startContainer;b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent())}else{for(c.optimize();;){b=c.startContainer;if(c.startOffset==(b.getChildCount?b.getChildCount(): -b.getLength())&&!b.isBlockBoundary())c.setStartAfter(b);else break}b=c.startContainer;if(b.type!=CKEDITOR.NODE_ELEMENT)return b.getParent();b=b.getChild(c.startOffset);if(!b||b.type!=CKEDITOR.NODE_ELEMENT)b=c.startContainer;else for(c=b.getFirst();c&&c.type==CKEDITOR.NODE_ELEMENT;){b=c;c=c.getFirst()}}b=b.$}}return a.startElement=b?new CKEDITOR.dom.element(b):null},getSelectedElement:function(){var a=this._.cache;if(a.selectedElement!==void 0)return a.selectedElement;var b=this,c=CKEDITOR.tools.tryThese(function(){return b.getNative().createRange().item(0)}, -function(){for(var a=b.getRanges()[0],c,d,e=2;e&&(!(c=a.getEnclosedNode())||!(c.type==CKEDITOR.NODE_ELEMENT&&q[c.getName()]&&(d=c)));e--)a.shrink(CKEDITOR.SHRINK_ELEMENT);return d.$});return a.selectedElement=c?new CKEDITOR.dom.element(c):null},getSelectedText:function(){var a=this._.cache;if(a.selectedText!==void 0)return a.selectedText;var b=this.getNative(),b=o?b.type=="Control"?"":b.createRange().text:b.toString();return a.selectedText=b},lock:function(){this.getRanges();this.getStartElement(); -this.getSelectedElement();this.getSelectedText();this._.cache.nativeSel=null;this.isLocked=1},unlock:function(a){if(this.isLocked){if(a)var b=this.getSelectedElement(),c=!b&&this.getRanges();this.isLocked=0;this.reset();if(a)(a=b||c[0]&&c[0].getCommonAncestor())&&a.getAscendant("body",1)&&(b?this.selectElement(b):this.selectRanges(c))}},reset:function(){this._.cache={}},selectElement:function(a){var b=new CKEDITOR.dom.range(this.root);b.setStartBefore(a);b.setEndAfter(a);this.selectRanges([b])},selectRanges:function(a){if(a.length)if(this.isLocked){var b= -CKEDITOR.document.getActive();this.unlock();this.selectRanges(a);this.lock();!b.equals(this.root)&&b.focus()}else{if(o){var c=CKEDITOR.dom.walker.whitespaces(true),d=/\ufeff|\u00a0/,f={table:1,tbody:1,tr:1};if(a.length>1){b=a[a.length-1];a[0].setEnd(b.endContainer,b.endOffset)}var b=a[0],a=b.collapsed,i,j,l,n=b.getEnclosedNode();if(n&&n.type==CKEDITOR.NODE_ELEMENT&&n.getName()in q&&(!n.is("a")||!n.getText()))try{l=n.$.createControlRange();l.addElement(n.$);l.select();return}catch(x){}(b.startContainer.type== -CKEDITOR.NODE_ELEMENT&&b.startContainer.getName()in f||b.endContainer.type==CKEDITOR.NODE_ELEMENT&&b.endContainer.getName()in f)&&b.shrink(CKEDITOR.NODE_ELEMENT,true);l=b.createBookmark();var f=l.startNode,z;if(!a)z=l.endNode;l=b.document.$.body.createTextRange();l.moveToElementText(f.$);l.moveStart("character",1);if(z){d=b.document.$.body.createTextRange();d.moveToElementText(z.$);l.setEndPoint("EndToEnd",d);l.moveEnd("character",-1)}else{i=f.getNext(c);j=f.hasAscendant("pre");i=!(i&&i.getText&& -i.getText().match(d))&&(j||!f.hasPrevious()||f.getPrevious().is&&f.getPrevious().is("br"));j=b.document.createElement("span");j.setHtml("");j.insertBefore(f);i&&b.document.createText("").insertBefore(f)}b.setStartBefore(f);f.remove();if(a){if(i){l.moveStart("character",-1);l.select();b.document.$.selection.clear()}else l.select();b.moveToPosition(j,CKEDITOR.POSITION_BEFORE_START);j.remove()}else{b.setEndBefore(z);z.remove();l.select()}}else{z=this.getNative();if(!z)return;if(CKEDITOR.env.opera){b= -this.document.$.createRange();b.selectNodeContents(this.root.$);z.addRange(b)}this.removeAllRanges();for(d=0;d=0){b.collapse(1);l.setEnd(b.endContainer.$,b.endOffset)}else throw s;}z.addRange(l)}}this.reset();this.root.fire("selectionchange")}},createBookmarks:function(a){return this.getRanges().createBookmarks(a)},createBookmarks2:function(a){return this.getRanges().createBookmarks2(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 h=a.getDocument().createElement("div");h.append(e);e.$.outerHTML="
"+f+"
";e.copyAttributes(h.getFirst());e=h.getFirst().remove()}else e.setHtml(f);b=e}else f?b=n(c?[a.getHtml()]:i(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,j;if((j=c.getPrevious(y))&&j.is&&j.is("pre")){d=l(j.getHtml(),/\n$/,"")+ -"\n\n"+l(c.getHtml(),/^\n/,"");CKEDITOR.env.ie?c.$.outerHTML="
"+d+"
":c.setHtml(d);j.remove()}}else c&&g(b)}function i(a){a.getName();var b=[];l(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 l(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 n(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 o(a){var b=this._.definition,c=b.attributes,b=b.styles,d=m(this)[a.getName()],e=CKEDITOR.tools.isEmpty(c)&&CKEDITOR.tools.isEmpty(b),f;for(f in c)if(!((f=="class"||this._.definition.fullMatch)&&a.getAttribute(f)!=E(f,c[f]))){e=a.hasAttribute(f);a.removeAttribute(f)}for(var h in b)if(!(this._.definition.fullMatch&&a.getStyle(h)!=E(h,b[h],true))){e=e||!!a.getStyle(h);a.removeStyle(h)}k(a,d,r[a.getName()]);
-e&&(this._.definition.alwaysRemoveElement?g(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==CKEDITOR.ENTER_BR&&!a.hasAttributes()?g(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function q(a){for(var b=m(this),c=a.getElementsByTag(this.element),d=c.count();--d>=0;)o.call(this,c.getItem(d));for(var e in b)if(e!=this.element){c=a.getElementsByTag(e);for(d=c.count()-1;d>=0;d--){var f=c.getItem(d);k(f,b[e])}}}function k(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(z,";"));for(var e in b){var f=b[e],g=(e+":"+f).replace(z,";");f=="inherit"?d=d+g:c=c+g}c.length&&(c=CKEDITOR.tools.normalizeCssText(c,true));return a._ST=c+d}})();CKEDITOR.styleCommand=function(b,c){this.requiredContent=this.allowedContent=this.style=b;CKEDITOR.tools.extend(this,c,true)};
-CKEDITOR.styleCommand.prototype.exec=function(b){b.focus();this.state==CKEDITOR.TRISTATE_OFF?b.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&b.removeStyle(this.style)};CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet");CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet);CKEDITOR.loadStylesSet=function(b,c,a){CKEDITOR.stylesSet.addExternal(b,c,"");CKEDITOR.stylesSet.load(b,a)};
-CKEDITOR.editor.prototype.getStylesSet=function(b){if(this._.stylesDefinitions)b(this._.stylesDefinitions);else{var c=this,a=c.config.stylesCombo_stylesSet||c.config.stylesSet;if(a===false)b(null);else if(a instanceof Array){c._.stylesDefinitions=a;b(a)}else{a||(a="default");var a=a.split(":"),e=a[0];CKEDITOR.stylesSet.addExternal(e,a[1]?a.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),"");CKEDITOR.stylesSet.load(e,function(a){c._.stylesDefinitions=a[e];b(c._.stylesDefinitions)})}}};
-CKEDITOR.dom.comment=function(b,c){typeof b=="string"&&(b=(c?c.$:document).createComment(b));CKEDITOR.dom.domObject.call(this,b)};CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"<\!--"+this.$.nodeValue+"--\>"}});
-(function(){var b={},c;for(c in CKEDITOR.dtd.$blockLimit)c in CKEDITOR.dtd.$list||(b[c]=1);var a={};for(c in CKEDITOR.dtd.$block)c in CKEDITOR.dtd.$blockLimit||c in CKEDITOR.dtd.$empty||(a[c]=1);CKEDITOR.dom.elementPath=function(c,d){var h=null,f=null,j=[],d=d||c.getDocument().getBody(),i=c;do if(i.type==CKEDITOR.NODE_ELEMENT){j.push(i);if(!this.lastElement){this.lastElement=i;if(i.is(CKEDITOR.dtd.$object))continue}var l=i.getName();if(!f){!h&&a[l]&&(h=i);if(b[l]){var n;if(n=!h){if(l=l=="div"){a:{l=
-i.getChildren();n=0;for(var o=l.count();n-1}:typeof b=="function"?e=b:typeof b=="object"&&(e=
-function(a){return a.getName()in b});var d=this.elements,h=d.length;c&&h--;if(a){d=Array.prototype.slice.call(d,0);d.reverse()}for(c=0;c=e){h=d.createText("");h.insertAfter(this)}else{b=d.createText("");b.insertAfter(h);b.remove()}return h},substring:function(b,
-c){return typeof c!="number"?this.$.nodeValue.substr(b):this.$.nodeValue.substring(b,c)}});
-(function(){function b(a,b,c){var h=a.serializable,f=b[c?"endContainer":"startContainer"],j=c?"endOffset":"startOffset",i=h?b.document.getById(a.startNode):a.startNode,a=h?b.document.getById(a.endNode):a.endNode;if(f.equals(i.getPrevious())){b.startOffset=b.startOffset-f.getLength()-a.getPrevious().getLength();f=a.getNext()}else if(f.equals(a.getPrevious())){b.startOffset=b.startOffset-f.getLength();f=a.getNext()}f.equals(i.getParent())&&b[j]++;f.equals(a.getParent())&&b[j]++;b[c?"endContainer":"startContainer"]=
-f;return b}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,c)};var c={createIterator:function(){var a=this,b=CKEDITOR.dom.walker.bookmark(),c=[],h;return{getNextRange:function(f){h=h==void 0?0:h+1;var j=a[h];if(j&&a.length>1){if(!h)for(var i=a.length-1;i>=0;i--)c.unshift(a[i].createBookmark(true));if(f)for(var l=0;a[h+l+1];){for(var n=j.document,f=0,i=n.getById(c[l].endNode),n=n.getById(c[l+
-1].startNode);;){i=i.getNextSourceNode(false);if(n.equals(i))f=1;else if(b(i)||i.type==CKEDITOR.NODE_ELEMENT&&i.isBlockBoundary())continue;break}if(!f)break;l++}for(j.moveToBookmark(c.shift());l--;){i=a[++h];i.moveToBookmark(c.shift());j.setEnd(i.endContainer,i.endOffset)}}return j}}},createBookmarks:function(a){for(var c=[],d,h=0;hb?-1:1}),e=0,f;e',CKEDITOR.document);b.appendTo(CKEDITOR.document.getHead());try{CKEDITOR.env.hc=b.getComputedStyle("border-top-color")==b.getComputedStyle("border-right-color")}catch(c){CKEDITOR.env.hc=false}b.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(b=CKEDITOR._.pending){delete CKEDITOR._.pending;for(var a=0;ac;c++){var f=a,h=c,d;d=parseInt(a[c],16);d=("0"+(0>e?0|d*(1+e):0|d+(255-d)*e).toString(16)).slice(-2);f[h]=d}return"#"+a.join("")}}(),c=function(){var b=new CKEDITOR.template("background:#{to};background-image:-webkit-gradient(linear,lefttop,leftbottom,from({from}),to({to}));background-image:-moz-linear-gradient(top,{from},{to});background-image:-webkit-linear-gradient(top,{from},{to});background-image:-o-linear-gradient(top,{from},{to});background-image:-ms-linear-gradient(top,{from},{to});background-image:linear-gradient(top,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0,startColorstr='{from}',endColorstr='{to}');");return function(c,
-a){return b.output({from:c,to:a})}}(),f={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),
-panel:new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")};
-return function(g,e){var a=g.uiColor,a={id:"."+g.id,defaultBorder:b(a,-0.1),defaultGradient:c(b(a,0.9),a),lightGradient:c(b(a,1),b(a,0.7)),mediumGradient:c(b(a,0.8),b(a,0.5)),ckeButtonOn:c(b(a,0.6),b(a,0.7)),ckeResizer:b(a,-0.4),ckeToolbarSeparator:b(a,0.5),ckeColorauto:b(a,0.8),dialogBody:b(a,0.7),dialogTabSelected:c("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:b(a,-0.6),elementsPathBg:a,menubuttonIcon:b(a,0.5),menubuttonIconHover:b(a,0.3)};return f[e].output(a).replace(/\[/g,
-"{").replace(/\]/g,"}")}}();CKEDITOR.plugins.add("dialogui",{onLoad:function(){var i=function(b){this._||(this._={});this._["default"]=this._.initValue=b["default"]||"";this._.required=b.required||!1;for(var a=[this._],d=1;darguments.length)){var c=i.call(this,a);c.labelId=CKEDITOR.tools.getNextId()+"_label";this._.children=[];CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"div",null,{role:"presentation"},function(){var f=[],d=a.required?" cke_required":"";"horizontal"!=
-a.labelLayout?f.push('",'"):(d={type:"hbox",widths:a.widths,padding:0,children:[{type:"html",html:'