ckeditor_rails 4.5.2 → 4.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bc071ae156f352ccae04d4f0ef53162da9ea427
4
- data.tar.gz: b060bea7f02aa743f9ccc1de55d9da3f7e5bc688
3
+ metadata.gz: f59aa4bda7e61f08f20d658e68f5f1d5881f42dc
4
+ data.tar.gz: 6379324bd9e1d9809ba3e202598299ed0b7e477f
5
5
  SHA512:
6
- metadata.gz: d36395cb46a9688d5b529f5c7179143e43818388450134c8dd13fdfb3dca6db36e233fd11e2b84a4c9f56318e693198c358649806f4d68a97443524c84a68450
7
- data.tar.gz: 08099f33b5cd55099700f084aeeb53948a7e291194653f2c5a0ea82caded15487c32141011bb70c01c8651fba42b4e48ad15f35f457b8fdf54ee2bc9b1ef9dde
6
+ metadata.gz: fd642bff5370c3a833c7ebf8057e5f97cd08010a7102c57909498e3c4005c5d49d944018f41111c29fa71150174ba8d05f1ed6dff10dfb290edae10925be458c
7
+ data.tar.gz: e6a3986f43a0d23c118e8f290f5622a6b0075a9cebd510e71b6c93d1182e019a76962681e53d27ae3f9ef7510494e4ff0f62e4d054b8c995c66ef472c17a1438
data/README.md CHANGED
@@ -110,7 +110,7 @@ Ckeditor::Rails.configure do |config|
110
110
  # or set as black list: config.default_plugins - %w[about a11yhelp]
111
111
  config.assets_plugins = nil
112
112
 
113
- # default is nil for all skins, or set as %w[moon]
113
+ # default is nil for all skins, or set as %w[moono]
114
114
  config.assets_skins = nil
115
115
  end
116
116
  ```
@@ -144,6 +144,14 @@ https://github.com/rails/turbolinks/#opting-out-of-turbolinks
144
144
  ...
145
145
  </div>
146
146
 
147
+ #### Asset Compilation Process Does Not Produce JS and/or CSS Files
148
+
149
+ If you observe an issue (especially in Heroku environment) where asset compilation process skips JS and or CSS files, try adding the following line to `app/environments/production.rb` (or config file for the environment where you observe the issue):
150
+
151
+ ``` ruby
152
+ config.assets.precompile += ['ckeditor/*']
153
+ ```
154
+
147
155
  ## License
148
156
 
149
157
  CKEditor use [CKEditor license](http://ckeditor.com/license).
@@ -1,6 +1,6 @@
1
1
  module Ckeditor
2
2
  module Rails
3
- VERSION = '4.5.2'
4
- EDITOR_VERSION = '4.5.2'
3
+ VERSION = '4.5.3'
4
+ EDITOR_VERSION = '4.5.3'
5
5
  end
6
6
  end
@@ -1,6 +1,32 @@
1
1
  CKEditor 4 Changelog
2
2
  ====================
3
3
 
4
+ ## CKEditor 4.5.3
5
+
6
+ New Features:
7
+
8
+ * [#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.
9
+ * [#13603](http://dev.ckeditor.com/ticket/13603): Added support for uploading dropped BMP images.
10
+
11
+ Fixed Issues:
12
+
13
+ * [#13590](http://dev.ckeditor.com/ticket/13590): Fixed: Various issues related to the [Paste from Word](http://ckeditor.com/addon/pastefromword) feature. Fixes also:
14
+ * [#11215](http://dev.ckeditor.com/ticket/11215),
15
+ * [#8780](http://dev.ckeditor.com/ticket/8780),
16
+ * [#12762](http://dev.ckeditor.com/ticket/12762).
17
+ * [#13386](http://dev.ckeditor.com/ticket/13386): [Edge] Fixed: Issues with selecting and editing images.
18
+ * [#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.
19
+ * [#13453](http://dev.ckeditor.com/ticket/13453): Fixed: Drag&drop of entire editor content throws an error.
20
+ * [#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.
21
+ * [#13414](http://dev.ckeditor.com/ticket/13414): Fixed: Content auto paragraphing in a nested editable despite editor configuration.
22
+ * [#13429](http://dev.ckeditor.com/ticket/13429): Fixed: Incorrect selection after content insertion by the [Auto Embed](http://ckeditor.com/addon/autoembed) plugin.
23
+ * [#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.
24
+
25
+ Other Changes:
26
+
27
+ * [#13637](https://dev.ckeditor.com/ticket/13637): Several icons were refactored.
28
+ * 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)).
29
+
4
30
  ## CKEditor 4.5.2
5
31
 
6
32
  Fixed Issues:
@@ -41,6 +41,10 @@ The following libraries are included in CKEditor under the MIT license (see Appe
41
41
  * PicoModal (included in `samples/js/sf.js`) - Copyright (c) 2012 James Frasca.
42
42
  * CodeMirror (included in the samples) - Copyright (C) 2014 by Marijn Haverbeke <marijnh@gmail.com> and others.
43
43
 
44
+ Parts of code taken from the following libraries are included in CKEditor under the MIT license (see Appendix D):
45
+
46
+ * jQuery (inspired the domReady function, ckeditor_base.js) - Copyright (c) 2011 John Resig, http://jquery.com/
47
+
44
48
  The following libraries are included in CKEditor under the SIL Open Font License, Version 1.1 (see Appendix E):
45
49
 
46
50
  * Font Awesome (included in the toolbar configurator) - Copyright (C) 2012 by Dave Gandy.
@@ -2,14 +2,14 @@
2
2
  Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
3
3
  For licensing, see LICENSE.md or http://ckeditor.com/license
4
4
  */
5
- (function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,d={timestamp:"F74C",version:"4.5.2",revision:"09b0cca",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var b=window.CKEDITOR_BASEPATH||"";if(!b)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var i=c[d].src.match(a);if(i){b=i[1];break}}-1==b.indexOf(":/")&&"//"!=b.slice(0,2)&&(b=0===b.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+
5
+ (function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,d={timestamp:"F7J9",version:"4.5.3",revision:"6c70c82",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var b=window.CKEDITOR_BASEPATH||"";if(!b)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var i=c[d].src.match(a);if(i){b=i[1];break}}-1==b.indexOf(":/")&&"//"!=b.slice(0,2)&&(b=0===b.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+
6
6
  b:location.href.match(/^[^\?]*\/(?:)/)[0]+b);if(!b)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return b}(),getUrl:function(a){-1==a.indexOf(":/")&&0!==a.indexOf("/")&&(a=this.basePath+a);this.timestamp&&("/"!=a.charAt(a.length-1)&&!/[&?]t=/.test(a))&&(a+=(0<=a.indexOf("?")?"&":"?")+"t="+this.timestamp);return a},domReady:function(){function a(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",
7
7
  a,!1),b()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",a),b())}catch(c){}}function b(){for(var a;a=c.shift();)a()}var c=[];return function(b){function d(){try{document.documentElement.doScroll("left")}catch(g){setTimeout(d,1);return}a()}c.push(b);"complete"===document.readyState&&setTimeout(a,1);if(1==c.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",
8
8
  a);window.attachEvent("onload",a);b=!1;try{b=!window.frameElement}catch(n){}document.documentElement.doScroll&&b&&d()}}}()},b=window.CKEDITOR_GETURL;if(b){var c=d.getUrl;d.getUrl=function(a){return b.call(d,a)||c.call(d,a)}}return d}());
9
9
  CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(a){var d=CKEDITOR.event.prototype,b;for(b in d)a[b]==null&&(a[b]=d[b])},CKEDITOR.event.prototype=function(){function a(a){var e=d(this);return e[a]||(e[a]=new b(a))}var d=function(a){a=a.getPrivate&&a.getPrivate()||a._||(a._={});return a.events||(a.events={})},b=function(a){this.name=a;this.listeners=[]};b.prototype={getListenerIndex:function(a){for(var b=0,d=this.listeners;b<d.length;b++)if(d[b].fn==a)return b;return-1}};
10
- return{define:function(b,d){var f=a.call(this,b);CKEDITOR.tools.extend(f,d,true)},on:function(b,d,f,h,i){function j(a,g,B,i){a={name:b,sender:this,editor:a,data:g,listenerData:h,stop:B,cancel:i,removeListener:n};return d.call(f,a)===false?false:a.data}function n(){B.removeListener(b,d)}var g=a.call(this,b);if(g.getListenerIndex(d)<0){g=g.listeners;f||(f=this);isNaN(i)&&(i=10);var B=this;j.fn=d;j.priority=i;for(var s=g.length-1;s>=0;s--)if(g[s].priority<=i){g.splice(s+1,0,j);return{removeListener:n}}g.unshift(j)}return{removeListener:n}},
11
- once:function(){var a=Array.prototype.slice.call(arguments),b=a[1];a[1]=function(a){a.removeListener();return b.apply(this,arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,b=function(){a=1},f=0,h=function(){f=1};return function(i,j,n){var g=d(this)[i],i=a,B=f;a=f=0;if(g){var s=g.listeners;if(s.length)for(var s=s.slice(0),z,o=0;o<s.length;o++){if(g.errorProof)try{z=
12
- s[o].call(this,n,j,b,h)}catch(p){}else z=s[o].call(this,n,j,b,h);z===false?f=1:typeof z!="undefined"&&(j=z);if(a||f)break}}j=f?false:typeof j=="undefined"?true:j;a=i;f=B;return j}}(),fireOnce:function(a,b,f){b=this.fire(a,b,f);delete d(this)[a];return b},removeListener:function(a,b){var f=d(this)[a];if(f){var h=f.getListenerIndex(b);h>=0&&f.listeners.splice(h,1)}},removeAllListeners:function(){var a=d(this),b;for(b in a)delete a[b]},hasListeners:function(a){return(a=d(this)[a])&&a.listeners.length>
10
+ return{define:function(b,d){var f=a.call(this,b);CKEDITOR.tools.extend(f,d,true)},on:function(b,d,f,h,i){function j(a,g,A,i){a={name:b,sender:this,editor:a,data:g,listenerData:h,stop:A,cancel:i,removeListener:n};return d.call(f,a)===false?false:a.data}function n(){A.removeListener(b,d)}var g=a.call(this,b);if(g.getListenerIndex(d)<0){g=g.listeners;f||(f=this);isNaN(i)&&(i=10);var A=this;j.fn=d;j.priority=i;for(var r=g.length-1;r>=0;r--)if(g[r].priority<=i){g.splice(r+1,0,j);return{removeListener:n}}g.unshift(j)}return{removeListener:n}},
11
+ once:function(){var a=Array.prototype.slice.call(arguments),b=a[1];a[1]=function(a){a.removeListener();return b.apply(this,arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,b=function(){a=1},f=0,h=function(){f=1};return function(i,j,n){var g=d(this)[i],i=a,A=f;a=f=0;if(g){var r=g.listeners;if(r.length)for(var r=r.slice(0),y,o=0;o<r.length;o++){if(g.errorProof)try{y=
12
+ r[o].call(this,n,j,b,h)}catch(q){}else y=r[o].call(this,n,j,b,h);y===false?f=1:typeof y!="undefined"&&(j=y);if(a||f)break}}j=f?false:typeof j=="undefined"?true:j;a=i;f=A;return j}}(),fireOnce:function(a,b,f){b=this.fire(a,b,f);delete d(this)[a];return b},removeListener:function(a,b){var f=d(this)[a];if(f){var h=f.getListenerIndex(b);h>=0&&f.listeners.splice(h,1)}},removeAllListeners:function(){var a=d(this),b;for(b in a)delete a[b]},hasListeners:function(a){return(a=d(this)[a])&&a.listeners.length>
13
13
  0}}}());CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]);CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=function(a,d){a in{instanceReady:1,loaded:1}&&(this[a]=true);return CKEDITOR.event.prototype.fire.call(this,a,d,this)},CKEDITOR.editor.prototype.fireOnce=function(a,d){a in{instanceReady:1,loaded:1}&&(this[a]=true);return CKEDITOR.event.prototype.fireOnce.call(this,a,d,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype));
14
14
  CKEDITOR.env||(CKEDITOR.env=function(){var a=navigator.userAgent.toLowerCase(),d=a.match(/edge[ \/](\d+.?\d*)/),b=a.indexOf("trident/")>-1,b=!(!d&&!b),b={ie:b,edge:!!d,webkit:!b&&a.indexOf(" applewebkit/")>-1,air:a.indexOf(" adobeair/")>-1,mac:a.indexOf("macintosh")>-1,quirks:document.compatMode=="BackCompat"&&(!document.documentMode||document.documentMode<10),mobile:a.indexOf("mobile")>-1,iOS:/(ipad|iphone|ipod)/.test(a),isCustomDomain:function(){if(!this.ie)return false;var a=document.domain,b=
15
15
  window.location.hostname;return a!=b&&a!="["+b+"]"},secure:location.protocol=="https:"};b.gecko=navigator.product=="Gecko"&&!b.webkit&&!b.ie;if(b.webkit)a.indexOf("chrome")>-1?b.chrome=true:b.safari=true;var c=0;if(b.ie){c=d?parseFloat(d[1]):b.quirks||!document.documentMode?parseFloat(a.match(/msie (\d+)/)[1]):document.documentMode;b.ie9Compat=c==9;b.ie8Compat=c==8;b.ie7Compat=c==7;b.ie6Compat=c<7||b.quirks}if(b.gecko)if(d=a.match(/rv:([\d\.]+)/)){d=d[1].split(".");c=d[0]*1E4+(d[1]||0)*100+(d[2]||
@@ -59,11 +59,11 @@ if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&b&&b(this,true)===false)return null;
59
59
  (e=(e||this).getParent());){if(b&&b(e,true)===false)return null;a=e.getPrevious()}return!a||b&&b(a)===false?null:d&&a.type!=d?a.getPreviousSourceNode(false,d,b):a},getPrevious:function(a){var d=this.$,b;do b=(d=d.previousSibling)&&d.nodeType!=10&&new CKEDITOR.dom.node(d);while(b&&a&&!a(b));return b},getNext:function(a){var d=this.$,b;do b=(d=d.nextSibling)&&new CKEDITOR.dom.node(d);while(b&&a&&!a(b));return b},getParent:function(a){var d=this.$.parentNode;return d&&(d.nodeType==CKEDITOR.NODE_ELEMENT||
60
60
  a&&d.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(d):null},getParents:function(a){var d=this,b=[];do b[a?"push":"unshift"](d);while(d=d.getParent());return b},getCommonAncestor:function(a){if(a.equals(this))return this;if(a.contains&&a.contains(this))return a;var d=this.contains?this:this.getParent();do if(d.contains(a))return d;while(d=d.getParent());return null},getPosition:function(a){var d=this.$,b=a.$;if(d.compareDocumentPosition)return d.compareDocumentPosition(b);if(d==
61
61
  b)return CKEDITOR.POSITION_IDENTICAL;if(this.type==CKEDITOR.NODE_ELEMENT&&a.type==CKEDITOR.NODE_ELEMENT){if(d.contains){if(d.contains(b))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(b.contains(d))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in d)return d.sourceIndex<0||b.sourceIndex<0?CKEDITOR.POSITION_DISCONNECTED:d.sourceIndex<b.sourceIndex?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING}for(var d=this.getAddress(),a=a.getAddress(),
62
- b=Math.min(d.length,a.length),c=0;c<=b-1;c++)if(d[c]!=a[c]){if(c<b)return d[c]<a[c]?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING;break}return d.length<a.length?CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING},getAscendant:function(a,d){var b=this.$,c,e;if(!d)b=b.parentNode;if(typeof a=="function"){e=true;c=a}else{e=false;c=function(b){b=typeof b.nodeName=="string"?b.nodeName.toLowerCase():"";return typeof a=="string"?b==
63
- a:b in a}}for(;b;){if(c(e?new CKEDITOR.dom.node(b):b))return new CKEDITOR.dom.node(b);try{b=b.parentNode}catch(f){b=null}}return null},hasAscendant:function(a,d){var b=this.$;if(!d)b=b.parentNode;for(;b;){if(b.nodeName&&b.nodeName.toLowerCase()==a)return true;b=b.parentNode}return false},move:function(a,d){a.append(this.remove(),d)},remove:function(a){var d=this.$,b=d.parentNode;if(b){if(a)for(;a=d.firstChild;)b.insertBefore(d.removeChild(a),d);b.removeChild(d)}return this},replace:function(a){this.insertBefore(a);
64
- a.remove()},trim:function(){this.ltrim();this.rtrim()},ltrim:function(){for(var a;this.getFirst&&(a=this.getFirst());){if(a.type==CKEDITOR.NODE_TEXT){var d=CKEDITOR.tools.ltrim(a.getText()),b=a.getLength();if(d){if(d.length<b){a.split(b-d.length);this.$.removeChild(this.$.firstChild)}}else{a.remove();continue}}break}},rtrim:function(){for(var a;this.getLast&&(a=this.getLast());){if(a.type==CKEDITOR.NODE_TEXT){var d=CKEDITOR.tools.rtrim(a.getText()),b=a.getLength();if(d){if(d.length<b){a.split(d.length);
65
- this.$.lastChild.parentNode.removeChild(this.$.lastChild)}}else{a.remove();continue}}break}if(CKEDITOR.env.needsBrFiller)(a=this.$.lastChild)&&(a.type==1&&a.nodeName.toLowerCase()=="br")&&a.parentNode.removeChild(a)},isReadOnly:function(a){var d=this;this.type!=CKEDITOR.NODE_ELEMENT&&(d=this.getParent());CKEDITOR.env.edge&&(d&&d.is("textarea"))&&(a=true);if(!a&&d&&typeof d.$.isContentEditable!="undefined")return!(d.$.isContentEditable||d.data("cke-editable"));for(;d;){if(d.data("cke-editable"))return false;
66
- if(d.hasAttribute("contenteditable"))return d.getAttribute("contenteditable")=="false";d=d.getParent()}return true}});CKEDITOR.dom.window=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.window.prototype=new CKEDITOR.dom.domObject;
62
+ b=Math.min(d.length,a.length),c=0;c<b;c++)if(d[c]!=a[c])return d[c]<a[c]?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING;return d.length<a.length?CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING},getAscendant:function(a,d){var b=this.$,c,e;if(!d)b=b.parentNode;if(typeof a=="function"){e=true;c=a}else{e=false;c=function(b){b=typeof b.nodeName=="string"?b.nodeName.toLowerCase():"";return typeof a=="string"?b==a:b in a}}for(;b;){if(c(e?
63
+ new CKEDITOR.dom.node(b):b))return new CKEDITOR.dom.node(b);try{b=b.parentNode}catch(f){b=null}}return null},hasAscendant:function(a,d){var b=this.$;if(!d)b=b.parentNode;for(;b;){if(b.nodeName&&b.nodeName.toLowerCase()==a)return true;b=b.parentNode}return false},move:function(a,d){a.append(this.remove(),d)},remove:function(a){var d=this.$,b=d.parentNode;if(b){if(a)for(;a=d.firstChild;)b.insertBefore(d.removeChild(a),d);b.removeChild(d)}return this},replace:function(a){this.insertBefore(a);a.remove()},
64
+ trim:function(){this.ltrim();this.rtrim()},ltrim:function(){for(var a;this.getFirst&&(a=this.getFirst());){if(a.type==CKEDITOR.NODE_TEXT){var d=CKEDITOR.tools.ltrim(a.getText()),b=a.getLength();if(d){if(d.length<b){a.split(b-d.length);this.$.removeChild(this.$.firstChild)}}else{a.remove();continue}}break}},rtrim:function(){for(var a;this.getLast&&(a=this.getLast());){if(a.type==CKEDITOR.NODE_TEXT){var d=CKEDITOR.tools.rtrim(a.getText()),b=a.getLength();if(d){if(d.length<b){a.split(d.length);this.$.lastChild.parentNode.removeChild(this.$.lastChild)}}else{a.remove();
65
+ continue}}break}if(CKEDITOR.env.needsBrFiller)(a=this.$.lastChild)&&(a.type==1&&a.nodeName.toLowerCase()=="br")&&a.parentNode.removeChild(a)},isReadOnly:function(a){var d=this;this.type!=CKEDITOR.NODE_ELEMENT&&(d=this.getParent());CKEDITOR.env.edge&&(d&&d.is("textarea"))&&(a=true);if(!a&&d&&typeof d.$.isContentEditable!="undefined")return!(d.$.isContentEditable||d.data("cke-editable"));for(;d;){if(d.data("cke-editable"))return false;if(d.hasAttribute("contenteditable"))return d.getAttribute("contenteditable")==
66
+ "false";d=d.getParent()}return true}});CKEDITOR.dom.window=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.window.prototype=new CKEDITOR.dom.domObject;
67
67
  CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype,{focus:function(){this.$.focus()},getViewPaneSize:function(){var a=this.$.document,d=a.compatMode=="CSS1Compat";return{width:(d?a.documentElement.clientWidth:a.body.clientWidth)||0,height:(d?a.documentElement.clientHeight:a.body.clientHeight)||0}},getScrollPosition:function(){var a=this.$;if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};a=a.document;return{x:a.documentElement.scrollLeft||a.body.scrollLeft||0,y:a.documentElement.scrollTop||
68
68
  a.body.scrollTop||0}},getFrame:function(){var a=this.$.frameElement;return a?new CKEDITOR.dom.element.get(a):null}});CKEDITOR.dom.document=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.document.prototype=new CKEDITOR.dom.domObject;
69
69
  CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype,{type:CKEDITOR.NODE_DOCUMENT,appendStyleSheet:function(a){if(this.$.createStyleSheet)this.$.createStyleSheet(a);else{var d=new CKEDITOR.dom.element("link");d.setAttributes({rel:"stylesheet",type:"text/css",href:a});this.getHead().append(d)}},appendStyleText:function(a){if(this.$.createStyleSheet){var d=this.$.createStyleSheet("");d.cssText=a}else{var b=new CKEDITOR.dom.element("style",this);b.append(new CKEDITOR.dom.text(a,this));this.getHead().append(b)}return d||
@@ -95,14 +95,14 @@ this.$.value!="on":!!this.$.value}return!c?false:c.specified}return CKEDITOR.env
95
95
  c,g){if(c&&c.type==CKEDITOR.NODE_ELEMENT){for(var d=[];c.data("cke-bookmark")||c.isEmptyInlineRemoveable();){d.push(c);c=g?c.getNext():c.getPrevious();if(!c||c.type!=CKEDITOR.NODE_ELEMENT)return}if(b.isIdentical(c)){for(var i=g?b.getLast():b.getFirst();d.length;)d.shift().move(b,!g);c.moveChildren(b,!g);c.remove();i&&i.type==CKEDITOR.NODE_ELEMENT&&i.mergeSiblings()}}}return function(b){if(b===false||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a")){a(this,this.getNext(),true);a(this,this.getPrevious())}}}(),
96
96
  show:function(){this.setStyles({display:"",visibility:""})},setAttribute:function(){var a=function(a,b){this.$.setAttribute(a,b);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(b,c){b=="class"?this.$.className=c:b=="style"?this.$.style.cssText=c:b=="tabindex"?this.$.tabIndex=c:b=="checked"?this.$.checked=c:b=="contenteditable"?a.call(this,"contentEditable",c):a.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(b,c){if(b==
97
97
  "src"&&c.match(/^http:\/\//))try{a.apply(this,arguments)}catch(g){}else a.apply(this,arguments);return this}:a}(),setAttributes:function(a){for(var b in a)this.setAttribute(b,a[b]);return this},setValue:function(a){this.$.value=a;return this},removeAttribute:function(){var a=function(a){this.$.removeAttribute(a)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){a=="class"?a="className":a=="tabindex"?a="tabIndex":a=="contenteditable"&&(a="contentEditable");this.$.removeAttribute(a)}:
98
- a}(),removeAttributes:function(a){if(CKEDITOR.tools.isArray(a))for(var b=0;b<a.length;b++)this.removeAttribute(a[b]);else for(b in a)a.hasOwnProperty(b)&&this.removeAttribute(b)},removeStyle:function(a){var b=this.$.style;if(!b.removeProperty&&(a=="border"||a=="margin"||a=="padding")){var c=["top","left","right","bottom"],g;a=="border"&&(g=["color","style","width"]);for(var b=[],d=0;d<c.length;d++)if(g)for(var s=0;s<g.length;s++)b.push([a,c[d],g[s]].join("-"));else b.push([a,c[d]].join("-"));for(a=
98
+ a}(),removeAttributes:function(a){if(CKEDITOR.tools.isArray(a))for(var b=0;b<a.length;b++)this.removeAttribute(a[b]);else for(b in a)a.hasOwnProperty(b)&&this.removeAttribute(b)},removeStyle:function(a){var b=this.$.style;if(!b.removeProperty&&(a=="border"||a=="margin"||a=="padding")){var c=["top","left","right","bottom"],g;a=="border"&&(g=["color","style","width"]);for(var b=[],d=0;d<c.length;d++)if(g)for(var r=0;r<g.length;r++)b.push([a,c[d],g[r]].join("-"));else b.push([a,c[d]].join("-"));for(a=
99
99
  0;a<b.length;a++)this.removeStyle(b[a])}else{b.removeProperty?b.removeProperty(a):b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a));this.$.style.cssText||this.removeAttribute("style")}},setStyle:function(a,b){this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]=b;return this},setStyles:function(a){for(var b in a)this.setStyle(b,a[b]);return this},setOpacity:function(a){if(CKEDITOR.env.ie&&CKEDITOR.env.version<9){a=Math.round(a*100);this.setStyle("filter",a>=100?"":"progid:DXImageTransform.Microsoft.Alpha(opacity="+
100
100
  a+")")}else this.setStyle("opacity",a)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var a,b=this.getElementsByTag("*"),c=0,g=b.count();c<g;c++){a=b.getItem(c);a.setAttribute("unselectable","on")}}},getPositionedAncestor:function(){for(var a=this;a.getName()!="html";){if(a.getComputedStyle("position")!="static")return a;a=a.getParent()}return null},getDocumentPosition:function(a){var b=0,
101
- c=0,g=this.getDocument(),d=g.getBody(),s=g.$.compatMode=="BackCompat";if(document.documentElement.getBoundingClientRect){var e=this.$.getBoundingClientRect(),o=g.$.documentElement,p=o.clientTop||d.$.clientTop||0,f=o.clientLeft||d.$.clientLeft||0,h=true;if(CKEDITOR.env.ie){h=g.getDocumentElement().contains(this);g=g.getBody().contains(this);h=s&&g||!s&&h}if(h){if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&CKEDITOR.env.version>=12){b=d.$.scrollLeft||o.scrollLeft;c=d.$.scrollTop||o.scrollTop}else{c=s?d.$:
102
- o;b=c.scrollLeft;c=c.scrollTop}b=e.left+b-f;c=e.top+c-p}}else{p=this;for(f=null;p&&!(p.getName()=="body"||p.getName()=="html");){b=b+(p.$.offsetLeft-p.$.scrollLeft);c=c+(p.$.offsetTop-p.$.scrollTop);if(!p.equals(this)){b=b+(p.$.clientLeft||0);c=c+(p.$.clientTop||0)}for(;f&&!f.equals(p);){b=b-f.$.scrollLeft;c=c-f.$.scrollTop;f=f.getParent()}f=p;p=(e=p.$.offsetParent)?new CKEDITOR.dom.element(e):null}}if(a){e=this.getWindow();p=a.getWindow();if(!e.equals(p)&&e.$.frameElement){a=(new CKEDITOR.dom.element(e.$.frameElement)).getDocumentPosition(a);
103
- b=b+a.x;c=c+a.y}}if(!document.documentElement.getBoundingClientRect&&CKEDITOR.env.gecko&&!s){b=b+(this.$.clientLeft?1:0);c=c+(this.$.clientTop?1:0)}return{x:b,y:c}},scrollIntoView:function(a){var b=this.getParent();if(b){do{(b.$.clientWidth&&b.$.clientWidth<b.$.scrollWidth||b.$.clientHeight&&b.$.clientHeight<b.$.scrollHeight)&&!b.is("body")&&this.scrollIntoParent(b,a,1);if(b.is("html")){var c=b.getWindow();try{var g=c.$.frameElement;g&&(b=new CKEDITOR.dom.element(g))}catch(d){}}}while(b=b.getParent())
104
- }},scrollIntoParent:function(a,b,c){var g,d,e,f;function o(b,c){if(/body|html/.test(a.getName()))a.getWindow().$.scrollBy(b,c);else{a.$.scrollLeft=a.$.scrollLeft+b;a.$.scrollTop=a.$.scrollTop+c}}function p(a,b){var c={x:0,y:0};if(!a.is(x?"body":"html")){var g=a.$.getBoundingClientRect();c.x=g.left;c.y=g.top}g=a.getWindow();if(!g.equals(b)){g=p(CKEDITOR.dom.element.get(g.$.frameElement),b);c.x=c.x+g.x;c.y=c.y+g.y}return c}function h(a,b){return parseInt(a.getComputedStyle("margin-"+b)||0,10)||0}!a&&
105
- (a=this.getWindow());e=a.getDocument();var x=e.$.compatMode=="BackCompat";a instanceof CKEDITOR.dom.window&&(a=x?e.getBody():e.getDocumentElement());e=a.getWindow();d=p(this,e);var u=p(a,e),C=this.$.offsetHeight;g=this.$.offsetWidth;var l=a.$.clientHeight,q=a.$.clientWidth;e=d.x-h(this,"left")-u.x||0;f=d.y-h(this,"top")-u.y||0;g=d.x+g+h(this,"right")-(u.x+q)||0;d=d.y+C+h(this,"bottom")-(u.y+l)||0;if(f<0||d>0)o(0,b===true?f:b===false?d:f<0?f:d);if(c&&(e<0||g>0))o(e<0?e:g,0)},setState:function(a,b,
101
+ c=0,g=this.getDocument(),d=g.getBody(),r=g.$.compatMode=="BackCompat";if(document.documentElement.getBoundingClientRect){var e=this.$.getBoundingClientRect(),o=g.$.documentElement,q=o.clientTop||d.$.clientTop||0,f=o.clientLeft||d.$.clientLeft||0,h=true;if(CKEDITOR.env.ie){h=g.getDocumentElement().contains(this);g=g.getBody().contains(this);h=r&&g||!r&&h}if(h){if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&CKEDITOR.env.version>=12){b=d.$.scrollLeft||o.scrollLeft;c=d.$.scrollTop||o.scrollTop}else{c=r?d.$:
102
+ o;b=c.scrollLeft;c=c.scrollTop}b=e.left+b-f;c=e.top+c-q}}else{q=this;for(f=null;q&&!(q.getName()=="body"||q.getName()=="html");){b=b+(q.$.offsetLeft-q.$.scrollLeft);c=c+(q.$.offsetTop-q.$.scrollTop);if(!q.equals(this)){b=b+(q.$.clientLeft||0);c=c+(q.$.clientTop||0)}for(;f&&!f.equals(q);){b=b-f.$.scrollLeft;c=c-f.$.scrollTop;f=f.getParent()}f=q;q=(e=q.$.offsetParent)?new CKEDITOR.dom.element(e):null}}if(a){e=this.getWindow();q=a.getWindow();if(!e.equals(q)&&e.$.frameElement){a=(new CKEDITOR.dom.element(e.$.frameElement)).getDocumentPosition(a);
103
+ b=b+a.x;c=c+a.y}}if(!document.documentElement.getBoundingClientRect&&CKEDITOR.env.gecko&&!r){b=b+(this.$.clientLeft?1:0);c=c+(this.$.clientTop?1:0)}return{x:b,y:c}},scrollIntoView:function(a){var b=this.getParent();if(b){do{(b.$.clientWidth&&b.$.clientWidth<b.$.scrollWidth||b.$.clientHeight&&b.$.clientHeight<b.$.scrollHeight)&&!b.is("body")&&this.scrollIntoParent(b,a,1);if(b.is("html")){var c=b.getWindow();try{var g=c.$.frameElement;g&&(b=new CKEDITOR.dom.element(g))}catch(d){}}}while(b=b.getParent())
104
+ }},scrollIntoParent:function(a,b,c){var g,d,e,f;function o(b,c){if(/body|html/.test(a.getName()))a.getWindow().$.scrollBy(b,c);else{a.$.scrollLeft=a.$.scrollLeft+b;a.$.scrollTop=a.$.scrollTop+c}}function q(a,b){var c={x:0,y:0};if(!a.is(w?"body":"html")){var g=a.$.getBoundingClientRect();c.x=g.left;c.y=g.top}g=a.getWindow();if(!g.equals(b)){g=q(CKEDITOR.dom.element.get(g.$.frameElement),b);c.x=c.x+g.x;c.y=c.y+g.y}return c}function h(a,b){return parseInt(a.getComputedStyle("margin-"+b)||0,10)||0}!a&&
105
+ (a=this.getWindow());e=a.getDocument();var w=e.$.compatMode=="BackCompat";a instanceof CKEDITOR.dom.window&&(a=w?e.getBody():e.getDocumentElement());e=a.getWindow();d=q(this,e);var v=q(a,e),B=this.$.offsetHeight;g=this.$.offsetWidth;var l=a.$.clientHeight,s=a.$.clientWidth;e=d.x-h(this,"left")-v.x||0;f=d.y-h(this,"top")-v.y||0;g=d.x+g+h(this,"right")-(v.x+s)||0;d=d.y+B+h(this,"bottom")-(v.y+l)||0;if(f<0||d>0)o(0,b===true?f:b===false?d:f<0?f:d);if(c&&(e<0||g>0))o(e<0?e:g,0)},setState:function(a,b,
106
106
  c){b=b||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(b+"_on");this.removeClass(b+"_off");this.removeClass(b+"_disabled");c&&this.setAttribute("aria-pressed",true);c&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(b+"_disabled");this.removeClass(b+"_off");this.removeClass(b+"_on");c&&this.setAttribute("aria-disabled",true);c&&this.removeAttribute("aria-pressed");break;default:this.addClass(b+"_off");this.removeClass(b+"_on");this.removeClass(b+
107
107
  "_disabled");c&&this.removeAttribute("aria-pressed");c&&this.removeAttribute("aria-disabled")}},getFrameDocument:function(){var a=this.$;try{a.contentWindow.document}catch(b){a.src=a.src}return a&&new CKEDITOR.dom.document(a.contentWindow.document)},copyAttributes:function(a,b){for(var c=this.$.attributes,b=b||{},g=0;g<c.length;g++){var d=c[g],e=d.nodeName.toLowerCase(),f;if(!(e in b))if(e=="checked"&&(f=this.getAttribute(e)))a.setAttribute(e,f);else if(!CKEDITOR.env.ie||this.hasAttribute(e)){f=this.getAttribute(e);
108
108
  if(f===null)f=d.nodeValue;a.setAttribute(e,f)}}if(this.$.style.cssText!=="")a.$.style.cssText=this.$.style.cssText},renameNode:function(a){if(this.getName()!=a){var b=this.getDocument(),a=new CKEDITOR.dom.element(a,b);this.copyAttributes(a);this.moveChildren(a);this.getParent(true)&&this.$.parentNode.replaceChild(a.$,this.$);a.$["data-cke-expando"]=this.$["data-cke-expando"];this.$=a.$;delete this.getName}},getChild:function(){function a(b,c){var g=b.childNodes;if(c>=0&&c<g.length)return g[c]}return function(b){var c=
@@ -112,9 +112,9 @@ a=this.$.querySelector(b(this,a));c();return a?new CKEDITOR.dom.element(a):null}
112
112
  function(a,b,d){if(typeof b=="number"){if(d&&(!CKEDITOR.env.ie||!CKEDITOR.env.quirks))b=b-c.call(this,a);this.setStyle(a,b+"px")}};CKEDITOR.dom.element.prototype.getSize=function(a,b){var d=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(a)],this.$["client"+CKEDITOR.tools.capitalize(a)])||0;b&&(d=d-c.call(this,a));return d}})();CKEDITOR.dom.documentFragment=function(a){a=a||CKEDITOR.document;this.$=a.type==CKEDITOR.NODE_DOCUMENT?a.$.createDocumentFragment():a};
113
113
  CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,insertAfterNode:function(a){a=a.$;a.parentNode.insertBefore(this.$,a.nextSibling)},getHtml:function(){var a=new CKEDITOR.dom.element("div");this.clone(1,1).appendTo(a);return a.getHtml().replace(/\s*data-cke-expando=".*?"/g,"")}},!0,{append:1,appendBogus:1,clone:1,getFirst:1,getHtml:1,getLast:1,getParent:1,getNext:1,getPrevious:1,appendTo:1,moveChildren:1,insertBefore:1,
114
114
  insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1});
115
- (function(){function a(a,b){var c=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(c.collapsed){this.end();return null}c.optimize()}var g,d=c.startContainer;g=c.endContainer;var e=c.startOffset,f=c.endOffset,h,i=this.guard,l=this.type,q=a?"getPreviousSourceNode":"getNextSourceNode";if(!a&&!this._.guardLTR){var k=g.type==CKEDITOR.NODE_ELEMENT?g:g.getParent(),m=g.type==CKEDITOR.NODE_ELEMENT?g.getChild(f):g.getNext();this._.guardLTR=function(a,b){return(!b||!k.equals(a))&&(!m||
116
- !a.equals(m))&&(a.type!=CKEDITOR.NODE_ELEMENT||!b||!a.equals(c.root))}}if(a&&!this._.guardRTL){var F=d.type==CKEDITOR.NODE_ELEMENT?d:d.getParent(),w=d.type==CKEDITOR.NODE_ELEMENT?e?d.getChild(e-1):null:d.getPrevious();this._.guardRTL=function(a,b){return(!b||!F.equals(a))&&(!w||!a.equals(w))&&(a.type!=CKEDITOR.NODE_ELEMENT||!b||!a.equals(c.root))}}var H=a?this._.guardRTL:this._.guardLTR;h=i?function(a,b){return H(a,b)===false?false:i(a,b)}:H;if(this.current)g=this.current[q](false,l,h);else{if(a)g.type==
117
- CKEDITOR.NODE_ELEMENT&&(g=f>0?g.getChild(f-1):h(g,true)===false?null:g.getPreviousSourceNode(true,l,h));else{g=d;if(g.type==CKEDITOR.NODE_ELEMENT&&!(g=g.getChild(e)))g=h(d,true)===false?null:d.getNextSourceNode(true,l,h)}g&&h(g)===false&&(g=null)}for(;g&&!this._.end;){this.current=g;if(!this.evaluator||this.evaluator(g)!==false){if(!b)return g}else if(b&&this.evaluator)return false;g=g[q](false,l,h)}this.end();return this.current=null}function d(b){for(var c,g=null;c=a.call(this,b);)g=c;return g}
115
+ (function(){function a(a,b){var c=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(c.collapsed){this.end();return null}c.optimize()}var g,d=c.startContainer;g=c.endContainer;var e=c.startOffset,f=c.endOffset,h,i=this.guard,l=this.type,s=a?"getPreviousSourceNode":"getNextSourceNode";if(!a&&!this._.guardLTR){var k=g.type==CKEDITOR.NODE_ELEMENT?g:g.getParent(),m=g.type==CKEDITOR.NODE_ELEMENT?g.getChild(f):g.getNext();this._.guardLTR=function(a,b){return(!b||!k.equals(a))&&(!m||
116
+ !a.equals(m))&&(a.type!=CKEDITOR.NODE_ELEMENT||!b||!a.equals(c.root))}}if(a&&!this._.guardRTL){var F=d.type==CKEDITOR.NODE_ELEMENT?d:d.getParent(),p=d.type==CKEDITOR.NODE_ELEMENT?e?d.getChild(e-1):null:d.getPrevious();this._.guardRTL=function(a,b){return(!b||!F.equals(a))&&(!p||!a.equals(p))&&(a.type!=CKEDITOR.NODE_ELEMENT||!b||!a.equals(c.root))}}var I=a?this._.guardRTL:this._.guardLTR;h=i?function(a,b){return I(a,b)===false?false:i(a,b)}:I;if(this.current)g=this.current[s](false,l,h);else{if(a)g.type==
117
+ CKEDITOR.NODE_ELEMENT&&(g=f>0?g.getChild(f-1):h(g,true)===false?null:g.getPreviousSourceNode(true,l,h));else{g=d;if(g.type==CKEDITOR.NODE_ELEMENT&&!(g=g.getChild(e)))g=h(d,true)===false?null:d.getNextSourceNode(true,l,h)}g&&h(g)===false&&(g=null)}for(;g&&!this._.end;){this.current=g;if(!this.evaluator||this.evaluator(g)!==false){if(!b)return g}else if(b&&this.evaluator)return false;g=g[s](false,l,h)}this.end();return this.current=null}function d(b){for(var c,g=null;c=a.call(this,b);)g=c;return g}
118
118
  CKEDITOR.dom.walker=CKEDITOR.tools.createClass({$:function(a){this.range=a;this._={}},proto:{end:function(){this._.end=1},next:function(){return a.call(this)},previous:function(){return a.call(this,1)},checkForward:function(){return a.call(this,0,1)!==false},checkBackward:function(){return a.call(this,1,1)!==false},lastForward:function(){return d.call(this)},lastBackward:function(){return d.call(this,1)},reset:function(){delete this.current;this._={}}}});var b={block:1,"list-item":1,table:1,"table-row-group":1,
119
119
  "table-header-group":1,"table-footer-group":1,"table-row":1,"table-column-group":1,"table-column":1,"table-cell":1,"table-caption":1},c={absolute:1,fixed:1};CKEDITOR.dom.element.prototype.isBlockBoundary=function(a){return this.getComputedStyle("float")=="none"&&!(this.getComputedStyle("position")in c)&&b[this.getComputedStyle("display")]?true:!!(this.is(CKEDITOR.dtd.$block)||a&&this.is(a))};CKEDITOR.dom.walker.blockBoundary=function(a){return function(b){return!(b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary(a))}};
120
120
  CKEDITOR.dom.walker.listItemBoundary=function(){return this.blockBoundary({br:1})};CKEDITOR.dom.walker.bookmark=function(a,b){function c(a){return a&&a.getName&&a.getName()=="span"&&a.data("cke-bookmark")}return function(g){var d,e;d=g&&g.type!=CKEDITOR.NODE_ELEMENT&&(e=g.getParent())&&c(e);d=a?d:d||c(g);return!!(b^d)}};CKEDITOR.dom.walker.whitespaces=function(a){return function(b){var c;b&&b.type==CKEDITOR.NODE_TEXT&&(c=!CKEDITOR.tools.trim(b.getText())||CKEDITOR.env.webkit&&b.getText()=="​");return!!(a^
@@ -123,11 +123,11 @@ c=c.getNext(b);g=g.isBlockBoundary()&&(!c||c.type==CKEDITOR.NODE_ELEMENT&&c.isBl
123
123
  CKEDITOR.dom.walker.ignored();CKEDITOR.dom.walker.empty=function(a){return function(b){for(var c=0,g=b.getChildCount();c<g;++c)if(!j(b.getChild(c)))return!!a;return!a}};var n=CKEDITOR.dom.walker.empty(),g=CKEDITOR.dom.walker.validEmptyBlockContainers=CKEDITOR.tools.extend(function(a){var b={},c;for(c in a)CKEDITOR.dtd[c]["#"]&&(b[c]=1);return b}(CKEDITOR.dtd.$block),{caption:1,td:1,th:1});CKEDITOR.dom.walker.editable=function(a){return function(b){return!!(a^(j(b)?0:b.type==CKEDITOR.NODE_TEXT||b.type==
124
124
  CKEDITOR.NODE_ELEMENT&&(b.is(CKEDITOR.dtd.$inline)||(b.is("hr")||b.getAttribute("contenteditable")=="false")||!CKEDITOR.env.needsBrFiller&&b.is(g)&&n(b))?1:0))}};CKEDITOR.dom.element.prototype.getBogus=function(){var a=this;do a=a.getPreviousSourceNode();while(h(a)||f(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$inline)&&!a.is(CKEDITOR.dtd.$empty));return a&&(CKEDITOR.env.needsBrFiller?a.is&&a.is("br"):a.getText&&e.test(a.getText()))?a:false}})();
125
125
  CKEDITOR.dom.range=function(a){this.endOffset=this.endContainer=this.startOffset=this.startContainer=null;this.collapsed=true;var d=a instanceof CKEDITOR.dom.document;this.document=d?a:a.getDocument();this.root=d?a.getBody():a};
126
- (function(){function a(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer.equals(a.endContainer)&&a.startOffset==a.endOffset}function d(a,b,c,d,o){function e(a,b,c,g){var k=c?a.getPrevious():a.getNext();if(g&&i)return k;if(l||g)b.append(a.clone(true,o),c);else{a.remove();n&&b.append(a)}return k}function f(){var a,b,c,g=Math.min(J.length,D.length);for(a=0;a<g;a++){b=J[a];c=D[a];if(!b.equals(c))return a}return a-1}function h(){var b=y-1,c=A&&K&&!q.equals(k);if(b<v-1||b<L-1||c){c?a.moveToPosition(k,
127
- CKEDITOR.POSITION_BEFORE_START):L==b+1&&H?a.moveToPosition(D[b],CKEDITOR.POSITION_BEFORE_END):a.moveToPosition(D[b+1],CKEDITOR.POSITION_BEFORE_START);if(d)if((b=J[b+1])&&b.type==CKEDITOR.NODE_ELEMENT){c=CKEDITOR.dom.element.createFromHtml('<span data-cke-bookmark="1" style="display:none">&nbsp;</span>',a.document);c.insertAfter(b);b.mergeSiblings(false);a.moveToBookmark({startNode:c})}}else a.collapse(true)}a.optimizeBookmark();var i=b===0,n=b==1,l=b==2,b=l||n,q=a.startContainer,k=a.endContainer,
128
- m=a.startOffset,F=a.endOffset,w,H,A,K,E,r;if(l&&k.type==CKEDITOR.NODE_TEXT&&q.equals(k)){q=a.document.createText(q.substring(m,F));c.append(q)}else{if(k.type==CKEDITOR.NODE_TEXT)l?r=true:k=k.split(F);else if(k.getChildCount()>0)if(F>=k.getChildCount()){k=k.getChild(F-1);H=true}else k=k.getChild(F);else K=H=true;if(q.type==CKEDITOR.NODE_TEXT)l?E=true:q.split(m);else if(q.getChildCount()>0)if(m===0){q=q.getChild(m);w=true}else q=q.getChild(m-1);else A=w=true;for(var J=q.getParents(),D=k.getParents(),
129
- y=f(),v=J.length-1,L=D.length-1,O=c,j,U,T,Z=-1,M=y;M<=v;M++){U=J[M];T=U.getNext();for(M==v&&!(U.equals(D[M])&&v<L)?w?e(U,O,false,A):E&&O.append(a.document.createText(U.substring(m))):b&&(j=O.append(U.clone(0,o)));T;){if(T.equals(k)){Z=M;break}if(T.equals(D[M])){Z=M;break}T=e(T,O)}O=j}O=c;for(M=y;M<=L;M++){c=D[M];T=c.getPrevious();if(!c.equals(J[M])){M==L&&!(c.equals(J[M])&&L<v)?H?e(c,O,false,K):r&&O.append(a.document.createText(c.substring(0,F))):b&&(j=O.append(c.clone(0,o)));if(M>Z)for(;T;)T=e(T,
130
- O,true);O=j}}l||h()}}function b(){var a=false,b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(true),d=CKEDITOR.dom.walker.bogus();return function(o){if(c(o)||b(o))return true;if(d(o)&&!a)return a=true;return o.type==CKEDITOR.NODE_TEXT&&(o.hasAscendant("pre")||CKEDITOR.tools.trim(o.getText()).length)||o.type==CKEDITOR.NODE_ELEMENT&&!o.is(f)?false:true}}function c(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(1);return function(d){return c(d)||b(d)?true:
126
+ (function(){function a(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer.equals(a.endContainer)&&a.startOffset==a.endOffset}function d(a,b,c,d,o){function e(a,b,c,g){var k=c?a.getPrevious():a.getNext();if(g&&i)return k;if(l||g)b.append(a.clone(true,o),c);else{a.remove();n&&b.append(a)}return k}function f(){var a,b,c,g=Math.min(K.length,C.length);for(a=0;a<g;a++){b=K[a];c=C[a];if(!b.equals(c))return a}return a-1}function h(){var b=x-1,c=z&&L&&!s.equals(k);if(b<D-1||b<G-1||c){c?a.moveToPosition(k,
127
+ CKEDITOR.POSITION_BEFORE_START):G==b+1&&I?a.moveToPosition(C[b],CKEDITOR.POSITION_BEFORE_END):a.moveToPosition(C[b+1],CKEDITOR.POSITION_BEFORE_START);if(d)if((b=K[b+1])&&b.type==CKEDITOR.NODE_ELEMENT){c=CKEDITOR.dom.element.createFromHtml('<span data-cke-bookmark="1" style="display:none">&nbsp;</span>',a.document);c.insertAfter(b);b.mergeSiblings(false);a.moveToBookmark({startNode:c})}}else a.collapse(true)}a.optimizeBookmark();var i=b===0,n=b==1,l=b==2,b=l||n,s=a.startContainer,k=a.endContainer,
128
+ m=a.startOffset,F=a.endOffset,p,I,z,L,E,u;if(l&&k.type==CKEDITOR.NODE_TEXT&&s.equals(k)){s=a.document.createText(s.substring(m,F));c.append(s)}else{if(k.type==CKEDITOR.NODE_TEXT)l?u=true:k=k.split(F);else if(k.getChildCount()>0)if(F>=k.getChildCount()){k=k.getChild(F-1);I=true}else k=k.getChild(F);else L=I=true;if(s.type==CKEDITOR.NODE_TEXT)l?E=true:s.split(m);else if(s.getChildCount()>0)if(m===0){s=s.getChild(m);p=true}else s=s.getChild(m-1);else z=p=true;for(var K=s.getParents(),C=k.getParents(),
129
+ x=f(),D=K.length-1,G=C.length-1,M=c,j,U,T,Z=-1,N=x;N<=D;N++){U=K[N];T=U.getNext();for(N==D&&!(U.equals(C[N])&&D<G)?p?e(U,M,false,z):E&&M.append(a.document.createText(U.substring(m))):b&&(j=M.append(U.clone(0,o)));T;){if(T.equals(C[N])){Z=N;break}T=e(T,M)}M=j}M=c;for(N=x;N<=G;N++){c=C[N];T=c.getPrevious();if(c.equals(K[N]))b&&(M=M.getChild(0));else{N==G&&!(c.equals(K[N])&&G<D)?I?e(c,M,false,L):u&&M.append(a.document.createText(c.substring(0,F))):b&&(j=M.append(c.clone(0,o)));if(N>Z)for(;T;)T=e(T,M,
130
+ true);M=j}}l||h()}}function b(){var a=false,b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(true),d=CKEDITOR.dom.walker.bogus();return function(o){if(c(o)||b(o))return true;if(d(o)&&!a)return a=true;return o.type==CKEDITOR.NODE_TEXT&&(o.hasAscendant("pre")||CKEDITOR.tools.trim(o.getText()).length)||o.type==CKEDITOR.NODE_ELEMENT&&!o.is(f)?false:true}}function c(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(1);return function(d){return c(d)||b(d)?true:
131
131
  !a&&h(d)||d.type==CKEDITOR.NODE_ELEMENT&&d.is(CKEDITOR.dtd.$removeEmpty)}}function e(a){return function(){var b;return this[a?"getPreviousNode":"getNextNode"](function(a){!b&&n(a)&&(b=a);return j(a)&&!(h(a)&&a.equals(b))})}}var f={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},h=CKEDITOR.dom.walker.bogus(),i=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,j=CKEDITOR.dom.walker.editable(),n=CKEDITOR.dom.walker.ignored(true);
132
132
  CKEDITOR.dom.range.prototype={clone:function(){var a=new CKEDITOR.dom.range(this.root);a._setStartContainer(this.startContainer);a.startOffset=this.startOffset;a._setEndContainer(this.endContainer);a.endOffset=this.endOffset;a.collapsed=this.collapsed;return a},collapse:function(a){if(a){this._setEndContainer(this.startContainer);this.endOffset=this.startOffset}else{this._setStartContainer(this.endContainer);this.startOffset=this.endOffset}this.collapsed=true},cloneContents:function(a){var b=new CKEDITOR.dom.documentFragment(this.document);
133
133
  this.collapsed||d(this,2,b,false,typeof a=="undefined"?true:a);return b},deleteContents:function(a){this.collapsed||d(this,0,null,a)},extractContents:function(a,b){var c=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||d(this,1,c,a,typeof b=="undefined"?true:b);return c},createBookmark:function(a){var b,c,d,o,e=this.collapsed;b=this.document.createElement("span");b.data("cke-bookmark",1);b.setStyle("display","none");b.setHtml("&nbsp;");if(a){d="cke_bm_"+CKEDITOR.tools.getNextNumber();
@@ -139,16 +139,16 @@ if(e>c)a=a.getChild(c);else if(e<1)a=a.getPreviousSourceNode();else{for(a=a.$;a.
139
139
  d=this.endContainer,c=c.equals(d)?a&&c.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?c.getChild(this.startOffset):c:c.getCommonAncestor(d);return b&&!c.is?c.getParent():c},optimize:function(){var a=this.startContainer,b=this.startOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setStartAfter(a):this.setStartBefore(a));a=this.endContainer;b=this.endOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setEndAfter(a):this.setEndBefore(a))},optimizeBookmark:function(){var a=
140
140
  this.startContainer,b=this.endContainer;a.is&&(a.is("span")&&a.data("cke-bookmark"))&&this.setStartAt(a,CKEDITOR.POSITION_BEFORE_START);b&&(b.is&&b.is("span")&&b.data("cke-bookmark"))&&this.setEndAt(b,CKEDITOR.POSITION_AFTER_END)},trim:function(a,b){var c=this.startContainer,d=this.startOffset,e=this.collapsed;if((!a||e)&&c&&c.type==CKEDITOR.NODE_TEXT){if(d)if(d>=c.getLength()){d=c.getIndex()+1;c=c.getParent()}else{var f=c.split(d),d=c.getIndex()+1,c=c.getParent();if(this.startContainer.equals(this.endContainer))this.setEnd(f,
141
141
  this.endOffset-this.startOffset);else if(c.equals(this.endContainer))this.endOffset=this.endOffset+1}else{d=c.getIndex();c=c.getParent()}this.setStart(c,d);if(e){this.collapse(true);return}}c=this.endContainer;d=this.endOffset;if(!b&&!e&&c&&c.type==CKEDITOR.NODE_TEXT){if(d){d>=c.getLength()||c.split(d);d=c.getIndex()+1}else d=c.getIndex();c=c.getParent();this.setEnd(c,d)}},enlarge:function(a,b){function c(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}var d=RegExp(/[^\s\ufeff]/);
142
- switch(a){case CKEDITOR.ENLARGE_INLINE:var e=1;case CKEDITOR.ENLARGE_ELEMENT:if(this.collapsed)break;var f=this.getCommonAncestor(),h=this.root,i,n,j,l,q,k=false,m,F;m=this.startContainer;var w=this.startOffset;if(m.type==CKEDITOR.NODE_TEXT){if(w){m=!CKEDITOR.tools.trim(m.substring(0,w)).length&&m;k=!!m}if(m&&!(l=m.getPrevious()))j=m.getParent()}else{w&&(l=m.getChild(w-1)||m.getLast());l||(j=m)}for(j=c(j);j||l;){if(j&&!l){!q&&j.equals(f)&&(q=true);if(e?j.isBlockBoundary():!h.contains(j))break;if(!k||
143
- j.getComputedStyle("display")!="inline"){k=false;q?i=j:this.setStartBefore(j)}l=j.getPrevious()}for(;l;){m=false;if(l.type==CKEDITOR.NODE_COMMENT)l=l.getPrevious();else{if(l.type==CKEDITOR.NODE_TEXT){F=l.getText();d.test(F)&&(l=null);m=/[\s\ufeff]$/.test(F)}else if((l.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||b&&l.is("br"))&&!l.data("cke-bookmark"))if(k&&CKEDITOR.dtd.$removeEmpty[l.getName()]){F=l.getText();if(d.test(F))l=null;else for(var w=l.$.getElementsByTagName("*"),H=0,A;A=w[H++];)if(!CKEDITOR.dtd.$removeEmpty[A.nodeName.toLowerCase()]){l=
144
- null;break}l&&(m=!!F.length)}else l=null;m&&(k?q?i=j:j&&this.setStartBefore(j):k=true);if(l){m=l.getPrevious();if(!j&&!m){j=l;l=null;break}l=m}else j=null}}j&&(j=c(j.getParent()))}m=this.endContainer;w=this.endOffset;j=l=null;q=k=false;var K=function(a,b){var c=new CKEDITOR.dom.range(h);c.setStart(a,b);c.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);var c=new CKEDITOR.dom.walker(c),g;for(c.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};g=c.next();){if(g.type!=CKEDITOR.NODE_TEXT)return false;
145
- F=g!=a?g.getText():g.substring(b);if(d.test(F))return false}return true};if(m.type==CKEDITOR.NODE_TEXT)if(CKEDITOR.tools.trim(m.substring(w)).length)k=true;else{k=!m.getLength();if(w==m.getLength()){if(!(l=m.getNext()))j=m.getParent()}else K(m,w)&&(j=m.getParent())}else(l=m.getChild(w))||(j=m);for(;j||l;){if(j&&!l){!q&&j.equals(f)&&(q=true);if(e?j.isBlockBoundary():!h.contains(j))break;if(!k||j.getComputedStyle("display")!="inline"){k=false;q?n=j:j&&this.setEndAfter(j)}l=j.getNext()}for(;l;){m=false;
146
- if(l.type==CKEDITOR.NODE_TEXT){F=l.getText();K(l,0)||(l=null);m=/^[\s\ufeff]/.test(F)}else if(l.type==CKEDITOR.NODE_ELEMENT){if((l.$.offsetWidth>0||b&&l.is("br"))&&!l.data("cke-bookmark"))if(k&&CKEDITOR.dtd.$removeEmpty[l.getName()]){F=l.getText();if(d.test(F))l=null;else{w=l.$.getElementsByTagName("*");for(H=0;A=w[H++];)if(!CKEDITOR.dtd.$removeEmpty[A.nodeName.toLowerCase()]){l=null;break}}l&&(m=!!F.length)}else l=null}else m=1;m&&k&&(q?n=j:this.setEndAfter(j));if(l){m=l.getNext();if(!j&&!m){j=l;
147
- l=null;break}l=m}else j=null}j&&(j=c(j.getParent()))}if(i&&n){f=i.contains(n)?n:i;this.setStartBefore(f);this.setEndAfter(f)}break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:j=new CKEDITOR.dom.range(this.root);h=this.root;j.setStartAt(h,CKEDITOR.POSITION_AFTER_START);j.setEnd(this.startContainer,this.startOffset);j=new CKEDITOR.dom.walker(j);var E,r,J=CKEDITOR.dom.walker.blockBoundary(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),D=null,y=function(a){if(a.type==
148
- CKEDITOR.NODE_ELEMENT&&a.getAttribute("contenteditable")=="false")if(D){if(D.equals(a)){D=null;return}}else D=a;else if(D)return;var b=J(a);b||(E=a);return b},e=function(a){var b=y(a);!b&&(a.is&&a.is("br"))&&(r=a);return b};j.guard=y;j=j.lastBackward();E=E||h;this.setStartAt(E,!E.is("br")&&(!j&&this.checkStartOfBlock()||j&&E.contains(j))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){j=this.clone();j=new CKEDITOR.dom.walker(j);var v=CKEDITOR.dom.walker.whitespaces(),
149
- L=CKEDITOR.dom.walker.bookmark();j.evaluator=function(a){return!v(a)&&!L(a)};if((j=j.previous())&&j.type==CKEDITOR.NODE_ELEMENT&&j.is("br"))break}j=this.clone();j.collapse();j.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);j=new CKEDITOR.dom.walker(j);j.guard=a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?e:y;E=D=r=null;j=j.lastForward();E=E||h;this.setEndAt(E,!j&&this.checkEndOfBlock()||j&&E.contains(j)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START);r&&this.setEndAfter(r)}},shrink:function(a,b,c){if(!this.collapsed){var a=
142
+ switch(a){case CKEDITOR.ENLARGE_INLINE:var e=1;case CKEDITOR.ENLARGE_ELEMENT:if(this.collapsed)break;var f=this.getCommonAncestor(),h=this.root,i,n,j,l,s,k=false,m,F;m=this.startContainer;var p=this.startOffset;if(m.type==CKEDITOR.NODE_TEXT){if(p){m=!CKEDITOR.tools.trim(m.substring(0,p)).length&&m;k=!!m}if(m&&!(l=m.getPrevious()))j=m.getParent()}else{p&&(l=m.getChild(p-1)||m.getLast());l||(j=m)}for(j=c(j);j||l;){if(j&&!l){!s&&j.equals(f)&&(s=true);if(e?j.isBlockBoundary():!h.contains(j))break;if(!k||
143
+ j.getComputedStyle("display")!="inline"){k=false;s?i=j:this.setStartBefore(j)}l=j.getPrevious()}for(;l;){m=false;if(l.type==CKEDITOR.NODE_COMMENT)l=l.getPrevious();else{if(l.type==CKEDITOR.NODE_TEXT){F=l.getText();d.test(F)&&(l=null);m=/[\s\ufeff]$/.test(F)}else if((l.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||b&&l.is("br"))&&!l.data("cke-bookmark"))if(k&&CKEDITOR.dtd.$removeEmpty[l.getName()]){F=l.getText();if(d.test(F))l=null;else for(var p=l.$.getElementsByTagName("*"),I=0,z;z=p[I++];)if(!CKEDITOR.dtd.$removeEmpty[z.nodeName.toLowerCase()]){l=
144
+ null;break}l&&(m=!!F.length)}else l=null;m&&(k?s?i=j:j&&this.setStartBefore(j):k=true);if(l){m=l.getPrevious();if(!j&&!m){j=l;l=null;break}l=m}else j=null}}j&&(j=c(j.getParent()))}m=this.endContainer;p=this.endOffset;j=l=null;s=k=false;var L=function(a,b){var c=new CKEDITOR.dom.range(h);c.setStart(a,b);c.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);var c=new CKEDITOR.dom.walker(c),g;for(c.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};g=c.next();){if(g.type!=CKEDITOR.NODE_TEXT)return false;
145
+ F=g!=a?g.getText():g.substring(b);if(d.test(F))return false}return true};if(m.type==CKEDITOR.NODE_TEXT)if(CKEDITOR.tools.trim(m.substring(p)).length)k=true;else{k=!m.getLength();if(p==m.getLength()){if(!(l=m.getNext()))j=m.getParent()}else L(m,p)&&(j=m.getParent())}else(l=m.getChild(p))||(j=m);for(;j||l;){if(j&&!l){!s&&j.equals(f)&&(s=true);if(e?j.isBlockBoundary():!h.contains(j))break;if(!k||j.getComputedStyle("display")!="inline"){k=false;s?n=j:j&&this.setEndAfter(j)}l=j.getNext()}for(;l;){m=false;
146
+ if(l.type==CKEDITOR.NODE_TEXT){F=l.getText();L(l,0)||(l=null);m=/^[\s\ufeff]/.test(F)}else if(l.type==CKEDITOR.NODE_ELEMENT){if((l.$.offsetWidth>0||b&&l.is("br"))&&!l.data("cke-bookmark"))if(k&&CKEDITOR.dtd.$removeEmpty[l.getName()]){F=l.getText();if(d.test(F))l=null;else{p=l.$.getElementsByTagName("*");for(I=0;z=p[I++];)if(!CKEDITOR.dtd.$removeEmpty[z.nodeName.toLowerCase()]){l=null;break}}l&&(m=!!F.length)}else l=null}else m=1;m&&k&&(s?n=j:this.setEndAfter(j));if(l){m=l.getNext();if(!j&&!m){j=l;
147
+ l=null;break}l=m}else j=null}j&&(j=c(j.getParent()))}if(i&&n){f=i.contains(n)?n:i;this.setStartBefore(f);this.setEndAfter(f)}break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:j=new CKEDITOR.dom.range(this.root);h=this.root;j.setStartAt(h,CKEDITOR.POSITION_AFTER_START);j.setEnd(this.startContainer,this.startOffset);j=new CKEDITOR.dom.walker(j);var E,u,K=CKEDITOR.dom.walker.blockBoundary(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),C=null,x=function(a){if(a.type==
148
+ CKEDITOR.NODE_ELEMENT&&a.getAttribute("contenteditable")=="false")if(C){if(C.equals(a)){C=null;return}}else C=a;else if(C)return;var b=K(a);b||(E=a);return b},e=function(a){var b=x(a);!b&&(a.is&&a.is("br"))&&(u=a);return b};j.guard=x;j=j.lastBackward();E=E||h;this.setStartAt(E,!E.is("br")&&(!j&&this.checkStartOfBlock()||j&&E.contains(j))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){j=this.clone();j=new CKEDITOR.dom.walker(j);var D=CKEDITOR.dom.walker.whitespaces(),
149
+ G=CKEDITOR.dom.walker.bookmark();j.evaluator=function(a){return!D(a)&&!G(a)};if((j=j.previous())&&j.type==CKEDITOR.NODE_ELEMENT&&j.is("br"))break}j=this.clone();j.collapse();j.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);j=new CKEDITOR.dom.walker(j);j.guard=a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?e:x;E=C=u=null;j=j.lastForward();E=E||h;this.setEndAt(E,!j&&this.checkEndOfBlock()||j&&E.contains(j)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START);u&&this.setEndAfter(u)}},shrink:function(a,b,c){if(!this.collapsed){var a=
150
150
  a||CKEDITOR.SHRINK_TEXT,d=this.clone(),e=this.startContainer,f=this.endContainer,h=this.startOffset,i=this.endOffset,j=1,n=1;if(e&&e.type==CKEDITOR.NODE_TEXT)if(h)if(h>=e.getLength())d.setStartAfter(e);else{d.setStartBefore(e);j=0}else d.setStartBefore(e);if(f&&f.type==CKEDITOR.NODE_TEXT)if(i)if(i>=f.getLength())d.setEndAfter(f);else{d.setEndAfter(f);n=0}else d.setEndBefore(f);var d=new CKEDITOR.dom.walker(d),l=CKEDITOR.dom.walker.bookmark();d.evaluator=function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?
151
- CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var q;d.guard=function(b,d){if(l(b))return true;if(a==CKEDITOR.SHRINK_ELEMENT&&b.type==CKEDITOR.NODE_TEXT||d&&b.equals(q)||c===false&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return false;!d&&b.type==CKEDITOR.NODE_ELEMENT&&(q=b);return true};if(j)(e=d[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(e,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);
151
+ CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var s;d.guard=function(b,d){if(l(b))return true;if(a==CKEDITOR.SHRINK_ELEMENT&&b.type==CKEDITOR.NODE_TEXT||d&&b.equals(s)||c===false&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return false;!d&&b.type==CKEDITOR.NODE_ELEMENT&&(s=b);return true};if(j)(e=d[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(e,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);
152
152
  if(n){d.reset();(d=d[a==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(d,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END)}return!(!j&&!n)}},insertNode:function(a){this.optimizeBookmark();this.trim(false,true);var b=this.startContainer,c=b.getChild(this.startOffset);c?a.insertBefore(c):b.append(a);a.getParent()&&a.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(a)},moveToPosition:function(a,b){this.setStartAt(a,b);this.collapse(true)},moveToRange:function(a){this.setStart(a.startContainer,
153
153
  a.startOffset);this.setEnd(a.endContainer,a.endOffset)},selectNodeContents:function(a){this.setStart(a,0);this.setEnd(a,a.type==CKEDITOR.NODE_TEXT?a.getLength():a.getChildCount())},setStart:function(b,c){if(b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]){c=b.getIndex();b=b.getParent()}this._setStartContainer(b);this.startOffset=c;if(!this.endContainer){this._setEndContainer(b);this.endOffset=c}a(this)},setEnd:function(b,c){if(b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]){c=
154
154
  b.getIndex()+1;b=b.getParent()}this._setEndContainer(b);this.endOffset=c;if(!this.startContainer){this._setStartContainer(b);this.startOffset=c}a(this)},setStartAfter:function(a){this.setStart(a.getParent(),a.getIndex()+1)},setStartBefore:function(a){this.setStart(a.getParent(),a.getIndex())},setEndAfter:function(a){this.setEnd(a.getParent(),a.getIndex()+1)},setEndBefore:function(a){this.setEnd(a.getParent(),a.getIndex())},setStartAt:function(b,c){switch(c){case CKEDITOR.POSITION_AFTER_START:this.setStart(b,
@@ -170,50 +170,50 @@ this.document),b,c,d,e=this.clone();e.optimize();if(d=e.startContainer.type==CKE
170
170
  CKEDITOR.POSITION_AFTER_END=4;CKEDITOR.ENLARGE_ELEMENT=1;CKEDITOR.ENLARGE_BLOCK_CONTENTS=2;CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS=3;CKEDITOR.ENLARGE_INLINE=4;CKEDITOR.START=1;CKEDITOR.END=2;CKEDITOR.SHRINK_ELEMENT=1;CKEDITOR.SHRINK_TEXT=2;"use strict";
171
171
  (function(){function a(a){if(!(arguments.length<1)){this.range=a;this.forceBrBreak=0;this.enlargeBr=1;this.enforceRealBlocks=0;this._||(this._={})}}function d(a){var b=[];a.forEach(function(a){if(a.getAttribute("contenteditable")=="true"){b.push(a);return false}},CKEDITOR.NODE_ELEMENT,true);return b}function b(a,c,e,f){a:{f==null&&(f=d(e));for(var h;h=f.shift();)if(h.getDtd().p){f={element:h,remaining:f};break a}f=null}if(!f)return 0;if((h=CKEDITOR.filter.instances[f.element.data("cke-filter")])&&
172
172
  !h.check(c))return b(a,c,e,f.remaining);c=new CKEDITOR.dom.range(f.element);c.selectNodeContents(f.element);c=c.createIterator();c.enlargeBr=a.enlargeBr;c.enforceRealBlocks=a.enforceRealBlocks;c.activeFilter=c.filter=h;a._.nestedEditable={element:f.element,container:e,remaining:f.remaining,iterator:c};return 1}function c(a,b,c){if(!b)return false;a=a.clone();a.collapse(!c);return a.checkBoundaryOfElement(b,c?CKEDITOR.START:CKEDITOR.END)}var e=/^[\r\n\t ]+$/,f=CKEDITOR.dom.walker.bookmark(false,true),
173
- h=CKEDITOR.dom.walker.whitespaces(true),i=function(a){return f(a)&&h(a)},j={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var d,h,s,z,o,a=a||"p";if(this._.nestedEditable){if(d=this._.nestedEditable.iterator.getNextParagraph(a)){this.activeFilter=this._.nestedEditable.iterator.activeFilter;return d}this.activeFilter=this.filter;if(b(this,a,this._.nestedEditable.container,this._.nestedEditable.remaining)){this.activeFilter=this._.nestedEditable.iterator.activeFilter;return this._.nestedEditable.iterator.getNextParagraph(a)}this._.nestedEditable=
174
- null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var p=this.range.clone();h=p.startPath();var t=p.endPath(),x=!p.collapsed&&c(p,h.block),u=!p.collapsed&&c(p,t.block,1);p.shrink(CKEDITOR.SHRINK_ELEMENT,true);x&&p.setStartAt(h.block,CKEDITOR.POSITION_BEFORE_END);u&&p.setEndAt(t.block,CKEDITOR.POSITION_AFTER_START);h=p.endContainer.hasAscendant("pre",true)||p.startContainer.hasAscendant("pre",true);p.enlarge(this.forceBrBreak&&!h||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
175
- CKEDITOR.ENLARGE_BLOCK_CONTENTS);if(!p.collapsed){h=new CKEDITOR.dom.walker(p.clone());t=CKEDITOR.dom.walker.bookmark(true,true);h.evaluator=t;this._.nextNode=h.next();h=new CKEDITOR.dom.walker(p.clone());h.evaluator=t;h=h.previous();this._.lastNode=h.getNextSourceNode(true,null,p.root);if(this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()){t=this.range.clone();t.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END);
176
- if(t.checkEndOfBlock()){t=new CKEDITOR.dom.elementPath(t.endContainer,t.root);this._.lastNode=(t.block||t.blockLimit).getNextSourceNode(true)}}if(!this._.lastNode||!p.root.contains(this._.lastNode)){this._.lastNode=this._.docEndMarker=p.document.createText("");this._.lastNode.insertAfter(h)}p=null}this._.started=1;h=p}t=this._.nextNode;p=this._.lastNode;for(this._.nextNode=null;t;){var x=0,u=t.hasAscendant("pre"),C=t.type!=CKEDITOR.NODE_ELEMENT,l=0;if(C)t.type==CKEDITOR.NODE_TEXT&&e.test(t.getText())&&
177
- (C=0);else{var q=t.getName();if(CKEDITOR.dtd.$block[q]&&t.getAttribute("contenteditable")=="false"){d=t;b(this,a,d);break}else if(t.isBlockBoundary(this.forceBrBreak&&!u&&{br:1})){if(q=="br")C=1;else if(!h&&!t.getChildCount()&&q!="hr"){d=t;s=t.equals(p);break}if(h){h.setEndAt(t,CKEDITOR.POSITION_BEFORE_START);if(q!="br")this._.nextNode=t}x=1}else{if(t.getFirst()){if(!h){h=this.range.clone();h.setStartAt(t,CKEDITOR.POSITION_BEFORE_START)}t=t.getFirst();continue}C=1}}if(C&&!h){h=this.range.clone();
178
- h.setStartAt(t,CKEDITOR.POSITION_BEFORE_START)}s=(!x||C)&&t.equals(p);if(h&&!x)for(;!t.getNext(i)&&!s;){q=t.getParent();if(q.isBlockBoundary(this.forceBrBreak&&!u&&{br:1})){x=1;C=0;s||q.equals(p);h.setEndAt(q,CKEDITOR.POSITION_BEFORE_END);break}t=q;C=1;s=t.equals(p);l=1}C&&h.setEndAt(t,CKEDITOR.POSITION_AFTER_END);t=this._getNextSourceNode(t,l,p);if((s=!t)||x&&h)break}if(!d){if(!h){this._.docEndMarker&&this._.docEndMarker.remove();return this._.nextNode=null}d=new CKEDITOR.dom.elementPath(h.startContainer,
179
- h.root);t=d.blockLimit;x={div:1,th:1,td:1};d=d.block;if(!d&&t&&!this.enforceRealBlocks&&x[t.getName()]&&h.checkStartOfBlock()&&h.checkEndOfBlock()&&!t.equals(h.root))d=t;else if(!d||this.enforceRealBlocks&&d.is(j)){d=this.range.document.createElement(a);h.extractContents().appendTo(d);d.trim();h.insertNode(d);z=o=true}else if(d.getName()!="li"){if(!h.checkStartOfBlock()||!h.checkEndOfBlock()){d=d.clone(false);h.extractContents().appendTo(d);d.trim();o=h.splitBlock();z=!o.wasStartOfBlock;o=!o.wasEndOfBlock;
180
- h.insertNode(d)}}else if(!s)this._.nextNode=d.equals(p)?null:this._getNextSourceNode(h.getBoundaryNodes().endNode,1,p)}if(z)(z=d.getPrevious())&&z.type==CKEDITOR.NODE_ELEMENT&&(z.getName()=="br"?z.remove():z.getLast()&&z.getLast().$.nodeName.toLowerCase()=="br"&&z.getLast().remove());if(o)(z=d.getLast())&&z.type==CKEDITOR.NODE_ELEMENT&&z.getName()=="br"&&(!CKEDITOR.env.needsBrFiller||z.getPrevious(f)||z.getNext(f))&&z.remove();if(!this._.nextNode)this._.nextNode=s||d.equals(p)||!p?null:this._getNextSourceNode(d,
181
- 1,p);return d},_getNextSourceNode:function(a,b,c){function d(a){return!(a.equals(c)||a.equals(e))}for(var e=this.range.root,a=a.getNextSourceNode(b,null,d);!f(a);)a=a.getNextSourceNode(b,null,d);return a}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}})();
173
+ h=CKEDITOR.dom.walker.whitespaces(true),i=function(a){return f(a)&&h(a)},j={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var d,h,r,y,o,a=a||"p";if(this._.nestedEditable){if(d=this._.nestedEditable.iterator.getNextParagraph(a)){this.activeFilter=this._.nestedEditable.iterator.activeFilter;return d}this.activeFilter=this.filter;if(b(this,a,this._.nestedEditable.container,this._.nestedEditable.remaining)){this.activeFilter=this._.nestedEditable.iterator.activeFilter;return this._.nestedEditable.iterator.getNextParagraph(a)}this._.nestedEditable=
174
+ null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var q=this.range.clone();h=q.startPath();var t=q.endPath(),w=!q.collapsed&&c(q,h.block),v=!q.collapsed&&c(q,t.block,1);q.shrink(CKEDITOR.SHRINK_ELEMENT,true);w&&q.setStartAt(h.block,CKEDITOR.POSITION_BEFORE_END);v&&q.setEndAt(t.block,CKEDITOR.POSITION_AFTER_START);h=q.endContainer.hasAscendant("pre",true)||q.startContainer.hasAscendant("pre",true);q.enlarge(this.forceBrBreak&&!h||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
175
+ CKEDITOR.ENLARGE_BLOCK_CONTENTS);if(!q.collapsed){h=new CKEDITOR.dom.walker(q.clone());t=CKEDITOR.dom.walker.bookmark(true,true);h.evaluator=t;this._.nextNode=h.next();h=new CKEDITOR.dom.walker(q.clone());h.evaluator=t;h=h.previous();this._.lastNode=h.getNextSourceNode(true,null,q.root);if(this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()){t=this.range.clone();t.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END);
176
+ if(t.checkEndOfBlock()){t=new CKEDITOR.dom.elementPath(t.endContainer,t.root);this._.lastNode=(t.block||t.blockLimit).getNextSourceNode(true)}}if(!this._.lastNode||!q.root.contains(this._.lastNode)){this._.lastNode=this._.docEndMarker=q.document.createText("");this._.lastNode.insertAfter(h)}q=null}this._.started=1;h=q}t=this._.nextNode;q=this._.lastNode;for(this._.nextNode=null;t;){var w=0,v=t.hasAscendant("pre"),B=t.type!=CKEDITOR.NODE_ELEMENT,l=0;if(B)t.type==CKEDITOR.NODE_TEXT&&e.test(t.getText())&&
177
+ (B=0);else{var s=t.getName();if(CKEDITOR.dtd.$block[s]&&t.getAttribute("contenteditable")=="false"){d=t;b(this,a,d);break}else if(t.isBlockBoundary(this.forceBrBreak&&!v&&{br:1})){if(s=="br")B=1;else if(!h&&!t.getChildCount()&&s!="hr"){d=t;r=t.equals(q);break}if(h){h.setEndAt(t,CKEDITOR.POSITION_BEFORE_START);if(s!="br")this._.nextNode=t}w=1}else{if(t.getFirst()){if(!h){h=this.range.clone();h.setStartAt(t,CKEDITOR.POSITION_BEFORE_START)}t=t.getFirst();continue}B=1}}if(B&&!h){h=this.range.clone();
178
+ h.setStartAt(t,CKEDITOR.POSITION_BEFORE_START)}r=(!w||B)&&t.equals(q);if(h&&!w)for(;!t.getNext(i)&&!r;){s=t.getParent();if(s.isBlockBoundary(this.forceBrBreak&&!v&&{br:1})){w=1;B=0;r||s.equals(q);h.setEndAt(s,CKEDITOR.POSITION_BEFORE_END);break}t=s;B=1;r=t.equals(q);l=1}B&&h.setEndAt(t,CKEDITOR.POSITION_AFTER_END);t=this._getNextSourceNode(t,l,q);if((r=!t)||w&&h)break}if(!d){if(!h){this._.docEndMarker&&this._.docEndMarker.remove();return this._.nextNode=null}d=new CKEDITOR.dom.elementPath(h.startContainer,
179
+ h.root);t=d.blockLimit;w={div:1,th:1,td:1};d=d.block;if(!d&&t&&!this.enforceRealBlocks&&w[t.getName()]&&h.checkStartOfBlock()&&h.checkEndOfBlock()&&!t.equals(h.root))d=t;else if(!d||this.enforceRealBlocks&&d.is(j)){d=this.range.document.createElement(a);h.extractContents().appendTo(d);d.trim();h.insertNode(d);y=o=true}else if(d.getName()!="li"){if(!h.checkStartOfBlock()||!h.checkEndOfBlock()){d=d.clone(false);h.extractContents().appendTo(d);d.trim();o=h.splitBlock();y=!o.wasStartOfBlock;o=!o.wasEndOfBlock;
180
+ h.insertNode(d)}}else if(!r)this._.nextNode=d.equals(q)?null:this._getNextSourceNode(h.getBoundaryNodes().endNode,1,q)}if(y)(y=d.getPrevious())&&y.type==CKEDITOR.NODE_ELEMENT&&(y.getName()=="br"?y.remove():y.getLast()&&y.getLast().$.nodeName.toLowerCase()=="br"&&y.getLast().remove());if(o)(y=d.getLast())&&y.type==CKEDITOR.NODE_ELEMENT&&y.getName()=="br"&&(!CKEDITOR.env.needsBrFiller||y.getPrevious(f)||y.getNext(f))&&y.remove();if(!this._.nextNode)this._.nextNode=r||d.equals(q)||!q?null:this._getNextSourceNode(d,
181
+ 1,q);return d},_getNextSourceNode:function(a,b,c){function d(a){return!(a.equals(c)||a.equals(e))}for(var e=this.range.root,a=a.getNextSourceNode(b,null,d);!f(a);)a=a.getNextSourceNode(b,null,d);return a}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}})();
182
182
  CKEDITOR.command=function(a,d){this.uiItems=[];this.exec=function(b){if(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())return false;this.editorFocus&&a.focus();return this.fire("exec")===false?true:d.exec.call(this,a,b)!==false};this.refresh=function(a,b){if(!this.readOnly&&a.readOnly)return true;if(this.context&&!b.isContextFor(this.context)){this.disable();return true}if(!this.checkAllowed(true)){this.disable();return true}this.startDisabled||this.enable();this.modes&&!this.modes[a.mode]&&
183
183
  this.disable();return this.fire("refresh",{editor:a,path:b})===false?true:d.refresh&&d.refresh.apply(this,arguments)!==false};var b;this.checkAllowed=function(c){return!c&&typeof b=="boolean"?b:b=a.activeFilter.checkFeature(this)};CKEDITOR.tools.extend(this,d,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!d.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)};
184
184
  CKEDITOR.command.prototype={enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(!this.preserveState||typeof this.previousState=="undefined"?CKEDITOR.TRISTATE_OFF:this.previousState)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(a){if(this.state==a||a!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return false;this.previousState=this.state;this.state=a;this.fire("state");return true},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?
185
185
  this.setState(CKEDITOR.TRISTATE_ON):this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.event.implementOn(CKEDITOR.command.prototype);CKEDITOR.ENTER_P=1;CKEDITOR.ENTER_BR=2;CKEDITOR.ENTER_DIV=3;
186
186
  CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"<!DOCTYPE html>",bodyId:"",bodyClass:"",fullPage:!1,height:200,extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1E4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]};
187
- (function(){function a(a,b,c,d,k){var e,m,a=[];for(e in b){m=b[e];m=typeof m=="boolean"?{}:typeof m=="function"?{match:m}:K(m);if(e.charAt(0)!="$")m.elements=e;if(c)m.featureName=c.toLowerCase();var f=m;f.elements=h(f.elements,/\s+/)||null;f.propertiesOnly=f.propertiesOnly||f.elements===true;var g=/\s*,\s*/,v=void 0;for(v in D){f[v]=h(f[v],g)||null;var w=f,r=y[v],o=h(f[y[v]],g),A=f[v],F=[],l=true,q=void 0;o?l=false:o={};for(q in A)if(q.charAt(0)=="!"){q=q.slice(1);F.push(q);o[q]=true;l=false}for(;q=
188
- F.pop();){A[q]=A["!"+q];delete A["!"+q]}w[r]=(l?false:o)||null}f.match=f.match||null;d.push(m);a.push(m)}for(var b=k.elements,k=k.generic,L,c=0,d=a.length;c<d;++c){e=K(a[c]);m=e.classes===true||e.styles===true||e.attributes===true;f=e;v=r=g=void 0;for(g in D)f[g]=x(f[g]);w=true;for(v in y){g=y[v];r=f[g];o=[];A=void 0;for(A in r)A.indexOf("*")>-1?o.push(RegExp("^"+A.replace(/\*/g,".*")+"$")):o.push(A);r=o;if(r.length){f[g]=r;w=false}}f.nothingRequired=w;f.noProperties=!(f.attributes||f.classes||f.styles);
189
- if(e.elements===true||e.elements===null)k[m?"unshift":"push"](e);else{f=e.elements;delete e.elements;for(L in f)if(b[L])b[L][m?"unshift":"push"](e);else b[L]=[e]}}}function d(a,c,d,k){if(!a.match||a.match(c))if(k||i(a,c)){if(!a.propertiesOnly)d.valid=true;if(!d.allAttributes)d.allAttributes=b(a.attributes,c.attributes,d.validAttributes);if(!d.allStyles)d.allStyles=b(a.styles,c.styles,d.validStyles);if(!d.allClasses){a=a.classes;c=c.classes;k=d.validClasses;if(a)if(a===true)a=true;else{for(var e=0,
187
+ (function(){function a(a,b,c,d,k){var e,m,a=[];for(e in b){m=b[e];m=typeof m=="boolean"?{}:typeof m=="function"?{match:m}:L(m);if(e.charAt(0)!="$")m.elements=e;if(c)m.featureName=c.toLowerCase();var f=m;f.elements=h(f.elements,/\s+/)||null;f.propertiesOnly=f.propertiesOnly||f.elements===true;var g=/\s*,\s*/,p=void 0;for(p in C){f[p]=h(f[p],g)||null;var D=f,u=x[p],o=h(f[x[p]],g),z=f[p],F=[],l=true,s=void 0;o?l=false:o={};for(s in z)if(s.charAt(0)=="!"){s=s.slice(1);F.push(s);o[s]=true;l=false}for(;s=
188
+ F.pop();){z[s]=z["!"+s];delete z["!"+s]}D[u]=(l?false:o)||null}f.match=f.match||null;d.push(m);a.push(m)}for(var b=k.elements,k=k.generic,G,c=0,d=a.length;c<d;++c){e=L(a[c]);m=e.classes===true||e.styles===true||e.attributes===true;f=e;p=u=g=void 0;for(g in C)f[g]=w(f[g]);D=true;for(p in x){g=x[p];u=f[g];o=[];z=void 0;for(z in u)z.indexOf("*")>-1?o.push(RegExp("^"+z.replace(/\*/g,".*")+"$")):o.push(z);u=o;if(u.length){f[g]=u;D=false}}f.nothingRequired=D;f.noProperties=!(f.attributes||f.classes||f.styles);
189
+ if(e.elements===true||e.elements===null)k[m?"unshift":"push"](e);else{f=e.elements;delete e.elements;for(G in f)if(b[G])b[G][m?"unshift":"push"](e);else b[G]=[e]}}}function d(a,c,d,k){if(!a.match||a.match(c))if(k||i(a,c)){if(!a.propertiesOnly)d.valid=true;if(!d.allAttributes)d.allAttributes=b(a.attributes,c.attributes,d.validAttributes);if(!d.allStyles)d.allStyles=b(a.styles,c.styles,d.validStyles);if(!d.allClasses){a=a.classes;c=c.classes;k=d.validClasses;if(a)if(a===true)a=true;else{for(var e=0,
190
190
  m=c.length,f;e<m;++e){f=c[e];k[f]||(k[f]=a(f))}a=false}else a=false;d.allClasses=a}}}function b(a,b,c){if(!a)return false;if(a===true)return true;for(var d in b)c[d]||(c[d]=a(d));return false}function c(a,b,c){if(!a.match||a.match(b)){if(a.noProperties)return false;c.hadInvalidAttribute=e(a.attributes,b.attributes)||c.hadInvalidAttribute;c.hadInvalidStyle=e(a.styles,b.styles)||c.hadInvalidStyle;a=a.classes;b=b.classes;if(a){for(var d=false,k=a===true,m=b.length;m--;)if(k||a(b[m])){b.splice(m,1);d=
191
191
  true}a=d}else a=false;c.hadInvalidClass=a||c.hadInvalidClass}}function e(a,b){if(!a)return false;var c=false,d=a===true,k;for(k in b)if(d||a(k)){delete b[k];c=true}return c}function f(a,b,c){if(a.disabled||a.customConfig&&!c||!b)return false;a._.cachedChecks={};return true}function h(a,b){if(!a)return false;if(a===true)return a;if(typeof a=="string"){a=E(a);return a=="*"?true:CKEDITOR.tools.convertArrayToObject(a.split(b))}if(CKEDITOR.tools.isArray(a))return a.length?CKEDITOR.tools.convertArrayToObject(a):
192
192
  false;var c={},d=0,k;for(k in a){c[k]=a[k];d++}return d?c:false}function i(a,b){if(a.nothingRequired)return true;var c,d,k,e;if(k=a.requiredClasses){e=b.classes;for(c=0;c<k.length;++c){d=k[c];if(typeof d=="string"){if(CKEDITOR.tools.indexOf(e,d)==-1)return false}else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(e,d))return false}}return j(b.styles,a.requiredStyles)&&j(b.attributes,a.requiredAttributes)}function j(a,b){if(!b)return true;for(var c=0,d;c<b.length;++c){d=b[c];if(typeof d=="string"){if(!(d in
193
- a))return false}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a,d))return false}return true}function n(a){if(!a)return{};for(var a=a.split(/\s*,\s*/).sort(),b={};a.length;)b[a.shift()]=r;return b}function g(a){for(var b,c,d,k,e={},m=1,a=E(a);b=a.match(v);){if(c=b[2]){d=B(c,"styles");k=B(c,"attrs");c=B(c,"classes")}else d=k=c=null;e["$"+m++]={elements:b[1],classes:c,styles:d,attributes:k};a=a.slice(b[0].length)}return e}function B(a,b){var c=a.match(L[b]);return c?E(c[1]):null}function s(a){var b=
194
- a.styleBackup=a.attributes.style,c=a.classBackup=a.attributes["class"];if(!a.styles)a.styles=CKEDITOR.tools.parseCssText(b||"",1);if(!a.classes)a.classes=c?c.split(/\s+/):[]}function z(a,b,k,e){var m=0,f;if(e.toHtml)b.name=b.name.replace(O,"$1");if(e.doCallbacks&&a.elementCallbacks){a:for(var g=a.elementCallbacks,v=0,w=g.length,r;v<w;++v)if(r=g[v](b)){f=r;break a}if(f)return f}if(e.doTransform)if(f=a._.transformations[b.name]){s(b);for(g=0;g<f.length;++g)q(a,b,f[g]);p(b)}if(e.doFilter){a:{g=b.name;
195
- v=a._;a=v.allowedRules.elements[g];f=v.allowedRules.generic;g=v.disallowedRules.elements[g];v=v.disallowedRules.generic;w=e.skipRequired;r={valid:false,validAttributes:{},validClasses:{},validStyles:{},allAttributes:false,allClasses:false,allStyles:false,hadInvalidAttribute:false,hadInvalidClass:false,hadInvalidStyle:false};var h,o;if(!a&&!f)a=null;else{s(b);if(g){h=0;for(o=g.length;h<o;++h)if(c(g[h],b,r)===false){a=null;break a}}if(v){h=0;for(o=v.length;h<o;++h)c(v[h],b,r)}if(a){h=0;for(o=a.length;h<
196
- o;++h)d(a[h],b,r,w)}if(f){h=0;for(o=f.length;h<o;++h)d(f[h],b,r,w)}a=r}}if(!a){k.push(b);return A}if(!a.valid){k.push(b);return A}o=a.validAttributes;var F=a.validStyles;f=a.validClasses;var g=b.attributes,l=b.styles,v=b.classes,w=b.classBackup,y=b.styleBackup,D,L,i=[];r=[];var H=/^data-cke-/;h=false;delete g.style;delete g["class"];delete b.classBackup;delete b.styleBackup;if(!a.allAttributes)for(D in g)if(!o[D])if(H.test(D)){if(D!=(L=D.replace(/^data-cke-saved-/,""))&&!o[L]){delete g[D];h=true}}else{delete g[D];
197
- h=true}if(!a.allStyles||a.hadInvalidStyle){for(D in l)a.allStyles||F[D]?i.push(D+":"+l[D]):h=true;if(i.length)g.style=i.sort().join("; ")}else if(y)g.style=y;if(!a.allClasses||a.hadInvalidClass){for(D=0;D<v.length;++D)(a.allClasses||f[v[D]])&&r.push(v[D]);r.length&&(g["class"]=r.sort().join(" "));w&&r.length<w.split(/\s+/).length&&(h=true)}else w&&(g["class"]=w);h&&(m=A);if(!e.skipFinalValidation&&!t(b)){k.push(b);return A}}if(e.toHtml)b.name=b.name.replace(aa,"cke:$1");return m}function o(a){var b=
198
- [],c;for(c in a)c.indexOf("*")>-1&&b.push(c.replace(/\*/g,".*"));return b.length?RegExp("^(?:"+b.join("|")+")$"):null}function p(a){var b=a.attributes,c;delete b.style;delete b["class"];if(c=CKEDITOR.tools.writeCssText(a.styles,true))b.style=c;a.classes.length&&(b["class"]=a.classes.sort().join(" "))}function t(a){switch(a.name){case "a":if(!a.children.length&&!a.attributes.name)return false;break;case "img":if(!a.attributes.src)return false}return true}function x(a){if(!a)return false;if(a===true)return true;
199
- var b=o(a);return function(c){return c in a||b&&c.match(b)}}function u(){return new CKEDITOR.htmlParser.element("br")}function C(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.name=="br"||H.$block[a.name])}function l(a,b,c){var d=a.name;if(H.$empty[d]||!a.children.length)if(d=="hr"&&b=="br")a.replaceWith(u());else{a.parent&&c.push({check:"it",el:a.parent});a.remove()}else if(H.$block[d]||d=="tr")if(b=="br"){if(a.previous&&!C(a.previous)){b=u();b.insertBefore(a)}if(a.next&&!C(a.next)){b=u();b.insertAfter(a)}a.replaceWithChildren()}else{var d=
200
- a.children,k;b:{k=H[b];for(var e=0,m=d.length,f;e<m;++e){f=d[e];if(f.type==CKEDITOR.NODE_ELEMENT&&!k[f.name]){k=false;break b}}k=true}if(k){a.name=b;a.attributes={};c.push({check:"parent-down",el:a})}else{k=a.parent;for(var e=k.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||k.name=="body",g,v,m=d.length;m>0;){f=d[--m];if(e&&(f.type==CKEDITOR.NODE_TEXT||f.type==CKEDITOR.NODE_ELEMENT&&H.$inline[f.name])){if(!g){g=new CKEDITOR.htmlParser.element(b);g.insertAfter(a);c.push({check:"parent-down",el:g})}g.add(f,
201
- 0)}else{g=null;v=H[k.name]||H.span;f.insertAfter(a);k.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(f.type==CKEDITOR.NODE_ELEMENT&&!v[f.name])&&c.push({check:"el-up",el:f})}}a.remove()}}else if(d in{style:1,script:1})a.remove();else{a.parent&&c.push({check:"it",el:a.parent});a.replaceWithChildren()}}function q(a,b,c){var d,k;for(d=0;d<c.length;++d){k=c[d];if((!k.check||a.check(k.check,false))&&(!k.left||k.left(b))){k.right(b,U);break}}}function k(a,b){var c=b.getDefinition(),d=c.attributes,k=c.styles,e,
202
- m,f,g;if(a.name!=c.element)return false;for(e in d)if(e=="class"){c=d[e].split(/\s+/);for(f=a.classes.join("|");g=c.pop();)if(f.indexOf(g)==-1)return false}else if(a.attributes[e]!=d[e])return false;for(m in k)if(a.styles[m]!=k[m])return false;return true}function m(a,b){var c,d;if(typeof a=="string")c=a;else if(a instanceof CKEDITOR.style)d=a;else{c=a[0];d=a[1]}return[{element:c,left:d,right:function(a,c){c.transform(a,b)}}]}function F(a){return function(b){return k(b,a)}}function w(a){return function(b,
203
- c){c[a](b)}}var H=CKEDITOR.dtd,A=1,K=CKEDITOR.tools.copy,E=CKEDITOR.tools.trim,r="cke-test",J=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2;CKEDITOR.filter=function(a){this.allowedContent=[];this.disallowedContent=[];this.elementCallbacks=null;this.disabled=false;this.editor=null;this.id=CKEDITOR.tools.getNextNumber();this._={allowedRules:{elements:{},generic:[]},disallowedRules:{elements:{},generic:[]},transformations:{},cachedTests:{}};CKEDITOR.filter.instances[this.id]=this;if(a instanceof CKEDITOR.editor){a=
204
- this.editor=a;this.customConfig=true;var b=a.config.allowedContent;if(b===true)this.disabled=true;else{if(!b)this.customConfig=false;this.allow(b,"config",1);this.allow(a.config.extraAllowedContent,"extra",1);this.allow(J[a.enterMode]+" "+J[a.shiftEnterMode],"default",1);this.disallow(a.config.disallowedContent)}}else{this.customConfig=false;this.allow(a,"default",1)}};CKEDITOR.filter.instances={};CKEDITOR.filter.prototype={allow:function(b,c,d){if(!f(this,b,d))return false;var k,e;if(typeof b=="string")b=
205
- g(b);else if(b instanceof CKEDITOR.style){if(b.toAllowedContentRules)return this.allow(b.toAllowedContentRules(this.editor),c,d);k=b.getDefinition();b={};d=k.attributes;b[k.element]=k={styles:k.styles,requiredStyles:k.styles&&CKEDITOR.tools.objectKeys(k.styles)};if(d){d=K(d);k.classes=d["class"]?d["class"].split(/\s+/):null;k.requiredClasses=k.classes;delete d["class"];k.attributes=d;k.requiredAttributes=d&&CKEDITOR.tools.objectKeys(d)}}else if(CKEDITOR.tools.isArray(b)){for(k=0;k<b.length;++k)e=
206
- this.allow(b[k],c,d);return e}a(this,b,c,this.allowedContent,this._.allowedRules);return true},applyTo:function(a,b,c,d){if(this.disabled)return false;var k=this,e=[],m=this.editor&&this.editor.config.protectedSource,f,g=false,v={doFilter:!c,doTransform:true,doCallbacks:true,toHtml:b};a.forEach(function(a){if(a.type==CKEDITOR.NODE_ELEMENT){if(a.attributes["data-cke-filter"]=="off")return false;if(!b||!(a.name=="span"&&~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-"))){f=z(k,
207
- a,e,v);if(f&A)g=true;else if(f&2)return false}}else if(a.type==CKEDITOR.NODE_COMMENT&&a.value.match(/^\{cke_protected\}(?!\{C\})/)){var c;a:{var d=decodeURIComponent(a.value.replace(/^\{cke_protected\}/,""));c=[];var w,h,r;if(m)for(h=0;h<m.length;++h)if((r=d.match(m[h]))&&r[0].length==d.length){c=true;break a}d=CKEDITOR.htmlParser.fragment.fromHtml(d);d.children.length==1&&(w=d.children[0]).type==CKEDITOR.NODE_ELEMENT&&z(k,w,c,v);c=!c.length}c||e.push(a)}},null,true);e.length&&(g=true);for(var w,
208
- a=[],d=J[d||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)],h;c=e.pop();)c.type==CKEDITOR.NODE_ELEMENT?l(c,d,a):c.remove();for(;w=a.pop();){c=w.el;if(c.parent){h=H[c.parent.name]||H.span;switch(w.check){case "it":H.$removeEmpty[c.name]&&!c.children.length?l(c,d,a):t(c)||l(c,d,a);break;case "el-up":c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!h[c.name]&&l(c,d,a);break;case "parent-down":c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!h[c.name]&&l(c.parent,d,a)}}}return g},checkFeature:function(a){if(this.disabled||
193
+ a))return false}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a,d))return false}return true}function n(a){if(!a)return{};for(var a=a.split(/\s*,\s*/).sort(),b={};a.length;)b[a.shift()]=u;return b}function g(a){for(var b,c,d,k,e={},m=1,a=E(a);b=a.match(D);){if(c=b[2]){d=A(c,"styles");k=A(c,"attrs");c=A(c,"classes")}else d=k=c=null;e["$"+m++]={elements:b[1],classes:c,styles:d,attributes:k};a=a.slice(b[0].length)}return e}function A(a,b){var c=a.match(G[b]);return c?E(c[1]):null}function r(a){var b=
194
+ a.styleBackup=a.attributes.style,c=a.classBackup=a.attributes["class"];if(!a.styles)a.styles=CKEDITOR.tools.parseCssText(b||"",1);if(!a.classes)a.classes=c?c.split(/\s+/):[]}function y(a,b,k,e){var m=0,f;if(e.toHtml)b.name=b.name.replace(M,"$1");if(e.doCallbacks&&a.elementCallbacks){a:for(var g=a.elementCallbacks,p=0,D=g.length,u;p<D;++p)if(u=g[p](b)){f=u;break a}if(f)return f}if(e.doTransform)if(f=a._.transformations[b.name]){r(b);for(g=0;g<f.length;++g)s(a,b,f[g]);q(b)}if(e.doFilter){a:{g=b.name;
195
+ p=a._;a=p.allowedRules.elements[g];f=p.allowedRules.generic;g=p.disallowedRules.elements[g];p=p.disallowedRules.generic;D=e.skipRequired;u={valid:false,validAttributes:{},validClasses:{},validStyles:{},allAttributes:false,allClasses:false,allStyles:false,hadInvalidAttribute:false,hadInvalidClass:false,hadInvalidStyle:false};var h,o;if(!a&&!f)a=null;else{r(b);if(g){h=0;for(o=g.length;h<o;++h)if(c(g[h],b,u)===false){a=null;break a}}if(p){h=0;for(o=p.length;h<o;++h)c(p[h],b,u)}if(a){h=0;for(o=a.length;h<
196
+ o;++h)d(a[h],b,u,D)}if(f){h=0;for(o=f.length;h<o;++h)d(f[h],b,u,D)}a=u}}if(!a){k.push(b);return z}if(!a.valid){k.push(b);return z}o=a.validAttributes;var F=a.validStyles;f=a.validClasses;var g=b.attributes,l=b.styles,p=b.classes,D=b.classBackup,x=b.styleBackup,C,G,i=[];u=[];var I=/^data-cke-/;h=false;delete g.style;delete g["class"];delete b.classBackup;delete b.styleBackup;if(!a.allAttributes)for(C in g)if(!o[C])if(I.test(C)){if(C!=(G=C.replace(/^data-cke-saved-/,""))&&!o[G]){delete g[C];h=true}}else{delete g[C];
197
+ h=true}if(!a.allStyles||a.hadInvalidStyle){for(C in l)a.allStyles||F[C]?i.push(C+":"+l[C]):h=true;if(i.length)g.style=i.sort().join("; ")}else if(x)g.style=x;if(!a.allClasses||a.hadInvalidClass){for(C=0;C<p.length;++C)(a.allClasses||f[p[C]])&&u.push(p[C]);u.length&&(g["class"]=u.sort().join(" "));D&&u.length<D.split(/\s+/).length&&(h=true)}else D&&(g["class"]=D);h&&(m=z);if(!e.skipFinalValidation&&!t(b)){k.push(b);return z}}if(e.toHtml)b.name=b.name.replace(aa,"cke:$1");return m}function o(a){var b=
198
+ [],c;for(c in a)c.indexOf("*")>-1&&b.push(c.replace(/\*/g,".*"));return b.length?RegExp("^(?:"+b.join("|")+")$"):null}function q(a){var b=a.attributes,c;delete b.style;delete b["class"];if(c=CKEDITOR.tools.writeCssText(a.styles,true))b.style=c;a.classes.length&&(b["class"]=a.classes.sort().join(" "))}function t(a){switch(a.name){case "a":if(!a.children.length&&!a.attributes.name)return false;break;case "img":if(!a.attributes.src)return false}return true}function w(a){if(!a)return false;if(a===true)return true;
199
+ var b=o(a);return function(c){return c in a||b&&c.match(b)}}function v(){return new CKEDITOR.htmlParser.element("br")}function B(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.name=="br"||I.$block[a.name])}function l(a,b,c){var d=a.name;if(I.$empty[d]||!a.children.length)if(d=="hr"&&b=="br")a.replaceWith(v());else{a.parent&&c.push({check:"it",el:a.parent});a.remove()}else if(I.$block[d]||d=="tr")if(b=="br"){if(a.previous&&!B(a.previous)){b=v();b.insertBefore(a)}if(a.next&&!B(a.next)){b=v();b.insertAfter(a)}a.replaceWithChildren()}else{var d=
200
+ a.children,k;b:{k=I[b];for(var e=0,m=d.length,f;e<m;++e){f=d[e];if(f.type==CKEDITOR.NODE_ELEMENT&&!k[f.name]){k=false;break b}}k=true}if(k){a.name=b;a.attributes={};c.push({check:"parent-down",el:a})}else{k=a.parent;for(var e=k.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||k.name=="body",g,p,m=d.length;m>0;){f=d[--m];if(e&&(f.type==CKEDITOR.NODE_TEXT||f.type==CKEDITOR.NODE_ELEMENT&&I.$inline[f.name])){if(!g){g=new CKEDITOR.htmlParser.element(b);g.insertAfter(a);c.push({check:"parent-down",el:g})}g.add(f,
201
+ 0)}else{g=null;p=I[k.name]||I.span;f.insertAfter(a);k.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(f.type==CKEDITOR.NODE_ELEMENT&&!p[f.name])&&c.push({check:"el-up",el:f})}}a.remove()}}else if(d in{style:1,script:1})a.remove();else{a.parent&&c.push({check:"it",el:a.parent});a.replaceWithChildren()}}function s(a,b,c){var d,k;for(d=0;d<c.length;++d){k=c[d];if((!k.check||a.check(k.check,false))&&(!k.left||k.left(b))){k.right(b,U);break}}}function k(a,b){var c=b.getDefinition(),d=c.attributes,k=c.styles,e,
202
+ m,f,g;if(a.name!=c.element)return false;for(e in d)if(e=="class"){c=d[e].split(/\s+/);for(f=a.classes.join("|");g=c.pop();)if(f.indexOf(g)==-1)return false}else if(a.attributes[e]!=d[e])return false;for(m in k)if(a.styles[m]!=k[m])return false;return true}function m(a,b){var c,d;if(typeof a=="string")c=a;else if(a instanceof CKEDITOR.style)d=a;else{c=a[0];d=a[1]}return[{element:c,left:d,right:function(a,c){c.transform(a,b)}}]}function F(a){return function(b){return k(b,a)}}function p(a){return function(b,
203
+ c){c[a](b)}}var I=CKEDITOR.dtd,z=1,L=CKEDITOR.tools.copy,E=CKEDITOR.tools.trim,u="cke-test",K=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2;CKEDITOR.filter=function(a){this.allowedContent=[];this.disallowedContent=[];this.elementCallbacks=null;this.disabled=false;this.editor=null;this.id=CKEDITOR.tools.getNextNumber();this._={allowedRules:{elements:{},generic:[]},disallowedRules:{elements:{},generic:[]},transformations:{},cachedTests:{}};CKEDITOR.filter.instances[this.id]=this;if(a instanceof CKEDITOR.editor){a=
204
+ this.editor=a;this.customConfig=true;var b=a.config.allowedContent;if(b===true)this.disabled=true;else{if(!b)this.customConfig=false;this.allow(b,"config",1);this.allow(a.config.extraAllowedContent,"extra",1);this.allow(K[a.enterMode]+" "+K[a.shiftEnterMode],"default",1);this.disallow(a.config.disallowedContent)}}else{this.customConfig=false;this.allow(a,"default",1)}};CKEDITOR.filter.instances={};CKEDITOR.filter.prototype={allow:function(b,c,d){if(!f(this,b,d))return false;var k,e;if(typeof b=="string")b=
205
+ g(b);else if(b instanceof CKEDITOR.style){if(b.toAllowedContentRules)return this.allow(b.toAllowedContentRules(this.editor),c,d);k=b.getDefinition();b={};d=k.attributes;b[k.element]=k={styles:k.styles,requiredStyles:k.styles&&CKEDITOR.tools.objectKeys(k.styles)};if(d){d=L(d);k.classes=d["class"]?d["class"].split(/\s+/):null;k.requiredClasses=k.classes;delete d["class"];k.attributes=d;k.requiredAttributes=d&&CKEDITOR.tools.objectKeys(d)}}else if(CKEDITOR.tools.isArray(b)){for(k=0;k<b.length;++k)e=
206
+ this.allow(b[k],c,d);return e}a(this,b,c,this.allowedContent,this._.allowedRules);return true},applyTo:function(a,b,c,d){if(this.disabled)return false;var k=this,e=[],m=this.editor&&this.editor.config.protectedSource,f,g=false,p={doFilter:!c,doTransform:true,doCallbacks:true,toHtml:b};a.forEach(function(a){if(a.type==CKEDITOR.NODE_ELEMENT){if(a.attributes["data-cke-filter"]=="off")return false;if(!b||!(a.name=="span"&&~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-"))){f=y(k,
207
+ a,e,p);if(f&z)g=true;else if(f&2)return false}}else if(a.type==CKEDITOR.NODE_COMMENT&&a.value.match(/^\{cke_protected\}(?!\{C\})/)){var c;a:{var d=decodeURIComponent(a.value.replace(/^\{cke_protected\}/,""));c=[];var D,h,u;if(m)for(h=0;h<m.length;++h)if((u=d.match(m[h]))&&u[0].length==d.length){c=true;break a}d=CKEDITOR.htmlParser.fragment.fromHtml(d);d.children.length==1&&(D=d.children[0]).type==CKEDITOR.NODE_ELEMENT&&y(k,D,c,p);c=!c.length}c||e.push(a)}},null,true);e.length&&(g=true);for(var D,
208
+ a=[],d=K[d||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)],h;c=e.pop();)c.type==CKEDITOR.NODE_ELEMENT?l(c,d,a):c.remove();for(;D=a.pop();){c=D.el;if(c.parent){h=I[c.parent.name]||I.span;switch(D.check){case "it":I.$removeEmpty[c.name]&&!c.children.length?l(c,d,a):t(c)||l(c,d,a);break;case "el-up":c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!h[c.name]&&l(c,d,a);break;case "parent-down":c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!h[c.name]&&l(c.parent,d,a)}}}return g},checkFeature:function(a){if(this.disabled||
209
209
  !a)return true;a.toFeature&&(a=a.toFeature(this.editor));return!a.requiredContent||this.check(a.requiredContent)},disable:function(){this.disabled=true},disallow:function(b){if(!f(this,b,true))return false;typeof b=="string"&&(b=g(b));a(this,b,null,this.disallowedContent,this._.disallowedRules);return true},addContentForms:function(a){if(!this.disabled&&a){var b,c,d=[],k;for(b=0;b<a.length&&!k;++b){c=a[b];if((typeof c=="string"||c instanceof CKEDITOR.style)&&this.check(c))k=c}if(k){for(b=0;b<a.length;++b)d.push(m(a[b],
210
210
  k));this.addTransformations(d)}}},addElementCallback:function(a){if(!this.elementCallbacks)this.elementCallbacks=[];this.elementCallbacks.push(a)},addFeature:function(a){if(this.disabled||!a)return true;a.toFeature&&(a=a.toFeature(this.editor));this.allow(a.allowedContent,a.name);this.addTransformations(a.contentTransformations);this.addContentForms(a.contentForms);return a.requiredContent&&(this.customConfig||this.disallowedContent.length)?this.check(a.requiredContent):true},addTransformations:function(a){var b,
211
- c;if(!this.disabled&&a){var d=this._.transformations,k;for(k=0;k<a.length;++k){b=a[k];var e=void 0,m=void 0,f=void 0,g=void 0,v=void 0,h=void 0;c=[];for(m=0;m<b.length;++m){f=b[m];if(typeof f=="string"){f=f.split(/\s*:\s*/);g=f[0];v=null;h=f[1]}else{g=f.check;v=f.left;h=f.right}if(!e){e=f;e=e.element?e.element:g?g.match(/^([a-z0-9]+)/i)[0]:e.left.getDefinition().element}v instanceof CKEDITOR.style&&(v=F(v));c.push({check:g==e?null:g,left:v,right:typeof h=="string"?w(h):h})}b=e;d[b]||(d[b]=[]);d[b].push(c)}}},
211
+ c;if(!this.disabled&&a){var d=this._.transformations,k;for(k=0;k<a.length;++k){b=a[k];var e=void 0,m=void 0,f=void 0,g=void 0,D=void 0,h=void 0;c=[];for(m=0;m<b.length;++m){f=b[m];if(typeof f=="string"){f=f.split(/\s*:\s*/);g=f[0];D=null;h=f[1]}else{g=f.check;D=f.left;h=f.right}if(!e){e=f;e=e.element?e.element:g?g.match(/^([a-z0-9]+)/i)[0]:e.left.getDefinition().element}D instanceof CKEDITOR.style&&(D=F(D));c.push({check:g==e?null:g,left:D,right:typeof h=="string"?p(h):h})}b=e;d[b]||(d[b]=[]);d[b].push(c)}}},
212
212
  check:function(a,b,c){if(this.disabled)return true;if(CKEDITOR.tools.isArray(a)){for(var d=a.length;d--;)if(this.check(a[d],b,c))return true;return false}var k,e;if(typeof a=="string"){e=a+"<"+(b===false?"0":"1")+(c?"1":"0")+">";if(e in this._.cachedChecks)return this._.cachedChecks[e];d=g(a).$1;k=d.styles;var m=d.classes;d.name=d.elements;d.classes=m=m?m.split(/\s*,\s*/):[];d.styles=n(k);d.attributes=n(d.attributes);d.children=[];m.length&&(d.attributes["class"]=m.join(" "));if(k)d.attributes.style=
213
- CKEDITOR.tools.writeCssText(d.styles);k=d}else{d=a.getDefinition();k=d.styles;m=d.attributes||{};if(k){k=K(k);m.style=CKEDITOR.tools.writeCssText(k,true)}else k={};k={name:d.element,attributes:m,classes:m["class"]?m["class"].split(/\s+/):[],styles:k,children:[]}}var m=CKEDITOR.tools.clone(k),f=[],v;if(b!==false&&(v=this._.transformations[k.name])){for(d=0;d<v.length;++d)q(this,k,v[d]);p(k)}z(this,m,f,{doFilter:true,doTransform:b!==false,skipRequired:!c,skipFinalValidation:!c});b=f.length>0?false:
214
- CKEDITOR.tools.objectCompare(k.attributes,m.attributes,true)?true:false;typeof a=="string"&&(this._.cachedChecks[e]=b);return b},getAllowedEnterMode:function(){var a=["p","div","br"],b={p:CKEDITOR.ENTER_P,div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR};return function(c,d){var k=a.slice(),e;if(this.check(J[c]))return c;for(d||(k=k.reverse());e=k.pop();)if(this.check(e))return b[e];return CKEDITOR.ENTER_BR}}(),destroy:function(){delete CKEDITOR.filter.instances[this.id];delete this._;delete this.allowedContent;
215
- delete this.disallowedContent}};var D={styles:1,attributes:1,classes:1},y={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},v=/^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,L={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},O=/^cke:(object|embed|param)$/,aa=/^(object|embed|param)$/,U=CKEDITOR.filter.transformationsTools={sizeToStyle:function(a){this.lengthToStyle(a,"width");this.lengthToStyle(a,
216
- "height")},sizeToAttribute:function(a){this.lengthToAttribute(a,"width");this.lengthToAttribute(a,"height")},lengthToStyle:function(a,b,c){c=c||b;if(!(c in a.styles)){var d=a.attributes[b];if(d){/^\d+$/.test(d)&&(d=d+"px");a.styles[c]=d}}delete a.attributes[b]},lengthToAttribute:function(a,b,c){c=c||b;if(!(c in a.attributes)){var d=a.styles[b],k=d&&d.match(/^(\d+)(?:\.\d*)?px$/);k?a.attributes[c]=k[1]:d==r&&(a.attributes[c]=r)}delete a.styles[b]},alignmentToStyle:function(a){if(!("float"in a.styles)){var b=
213
+ CKEDITOR.tools.writeCssText(d.styles);k=d}else{d=a.getDefinition();k=d.styles;m=d.attributes||{};if(k){k=L(k);m.style=CKEDITOR.tools.writeCssText(k,true)}else k={};k={name:d.element,attributes:m,classes:m["class"]?m["class"].split(/\s+/):[],styles:k,children:[]}}var m=CKEDITOR.tools.clone(k),f=[],p;if(b!==false&&(p=this._.transformations[k.name])){for(d=0;d<p.length;++d)s(this,k,p[d]);q(k)}y(this,m,f,{doFilter:true,doTransform:b!==false,skipRequired:!c,skipFinalValidation:!c});b=f.length>0?false:
214
+ CKEDITOR.tools.objectCompare(k.attributes,m.attributes,true)?true:false;typeof a=="string"&&(this._.cachedChecks[e]=b);return b},getAllowedEnterMode:function(){var a=["p","div","br"],b={p:CKEDITOR.ENTER_P,div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR};return function(c,d){var k=a.slice(),e;if(this.check(K[c]))return c;for(d||(k=k.reverse());e=k.pop();)if(this.check(e))return b[e];return CKEDITOR.ENTER_BR}}(),destroy:function(){delete CKEDITOR.filter.instances[this.id];delete this._;delete this.allowedContent;
215
+ delete this.disallowedContent}};var C={styles:1,attributes:1,classes:1},x={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},D=/^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,G={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},M=/^cke:(object|embed|param)$/,aa=/^(object|embed|param)$/,U=CKEDITOR.filter.transformationsTools={sizeToStyle:function(a){this.lengthToStyle(a,"width");this.lengthToStyle(a,
216
+ "height")},sizeToAttribute:function(a){this.lengthToAttribute(a,"width");this.lengthToAttribute(a,"height")},lengthToStyle:function(a,b,c){c=c||b;if(!(c in a.styles)){var d=a.attributes[b];if(d){/^\d+$/.test(d)&&(d=d+"px");a.styles[c]=d}}delete a.attributes[b]},lengthToAttribute:function(a,b,c){c=c||b;if(!(c in a.attributes)){var d=a.styles[b],k=d&&d.match(/^(\d+)(?:\.\d*)?px$/);k?a.attributes[c]=k[1]:d==u&&(a.attributes[c]=u)}delete a.styles[b]},alignmentToStyle:function(a){if(!("float"in a.styles)){var b=
217
217
  a.attributes.align;if(b=="left"||b=="right")a.styles["float"]=b}delete a.attributes.align},alignmentToAttribute:function(a){if(!("align"in a.attributes)){var b=a.styles["float"];if(b=="left"||b=="right")a.attributes.align=b}delete a.styles["float"]},matchesStyle:k,transform:function(a,b){if(typeof b=="string")a.name=b;else{var c=b.getDefinition(),d=c.styles,k=c.attributes,e,m,f,g;a.name=c.element;for(e in k)if(e=="class"){c=a.classes.join("|");for(f=k[e].split(/\s+/);g=f.pop();)c.indexOf(g)==-1&&
218
218
  a.classes.push(g)}else a.attributes[e]=k[e];for(m in d)a.styles[m]=d[m]}}}})();
219
219
  (function(){CKEDITOR.focusManager=function(a){if(a.focusManager)return a.focusManager;this.hasFocus=false;this.currentActive=null;this._={editor:a};return this};CKEDITOR.focusManager._={blurDelay:200};CKEDITOR.focusManager.prototype={focus:function(a){this._.timer&&clearTimeout(this._.timer);if(a)this.currentActive=a;if(!this.hasFocus&&!this._.locked){(a=CKEDITOR.currentInstance)&&a.focusManager.blur(1);this.hasFocus=true;(a=this._.editor.container)&&a.addClass("cke_focus");this._.editor.fire("focus")}},
@@ -223,34 +223,34 @@ d.blur);a.removeListener("focus",d.focus)}}})();CKEDITOR.keystrokeHandler=functi
223
223
  (function(){var a,d=function(b){var b=b.data,d=b.getKeystroke(),f=this.keystrokes[d],h=this._.editor;a=h.fire("key",{keyCode:d,domEvent:b})===false;if(!a){f&&(a=h.execCommand(f,{from:"keystrokeHandler"})!==false);a||(a=!!this.blockedKeystrokes[d])}a&&b.preventDefault(true);return!a},b=function(b){if(a){a=false;b.data.preventDefault(true)}};CKEDITOR.keystrokeHandler.prototype={attach:function(a){a.on("keydown",d,this);if(CKEDITOR.env.gecko&&CKEDITOR.env.mac)a.on("keypress",b,this)}}})();
224
224
  (function(){CKEDITOR.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,"en-au":1,"en-ca":1,"en-gb":1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,"fr-ca":1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,"pt-br":1,pt:1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,"sr-latn":1,sr:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,"zh-cn":1,zh:1},rtl:{ar:1,fa:1,he:1,ku:1,ug:1},load:function(a,d,b){if(!a||!CKEDITOR.lang.languages[a])a=this.detect(d,
225
225
  a);var c=this,d=function(){c[a].dir=c.rtl[a]?"rtl":"ltr";b(a,c[a])};this[a]?d():CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+a+".js"),d,this)},detect:function(a,d){var b=this.languages,d=d||navigator.userLanguage||navigator.language||a,c=d.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),e=c[1],c=c[2];b[e+"-"+c]?e=e+"-"+c:b[e]||(e=null);CKEDITOR.lang.detect=e?function(){return e}:function(a){return a};return e||a}}})();
226
- CKEDITOR.scriptLoader=function(){var a={},d={};return{load:function(b,c,e,f){var h=typeof b=="string";h&&(b=[b]);e||(e=CKEDITOR);var i=b.length,j=[],n=[],g=function(a){c&&(h?c.call(e,a):c.call(e,j,n))};if(i===0)g(true);else{var B=function(a,b){(b?j:n).push(a);if(--i<=0){f&&CKEDITOR.document.getDocumentElement().removeStyle("cursor");g(b)}},s=function(b,c){a[b]=1;var e=d[b];delete d[b];for(var f=0;f<e.length;f++)e[f](b,c)},z=function(b){if(a[b])B(b,true);else{var e=d[b]||(d[b]=[]);e.push(B);if(!(e.length>
227
- 1)){var f=new CKEDITOR.dom.element("script");f.setAttributes({type:"text/javascript",src:b});if(c)if(CKEDITOR.env.ie&&CKEDITOR.env.version<11)f.$.onreadystatechange=function(){if(f.$.readyState=="loaded"||f.$.readyState=="complete"){f.$.onreadystatechange=null;s(b,true)}};else{f.$.onload=function(){setTimeout(function(){s(b,true)},0)};f.$.onerror=function(){s(b,false)}}f.appendTo(CKEDITOR.document.getHead())}}};f&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var o=0;o<i;o++)z(b[o])}},
226
+ CKEDITOR.scriptLoader=function(){var a={},d={};return{load:function(b,c,e,f){var h=typeof b=="string";h&&(b=[b]);e||(e=CKEDITOR);var i=b.length,j=[],n=[],g=function(a){c&&(h?c.call(e,a):c.call(e,j,n))};if(i===0)g(true);else{var A=function(a,b){(b?j:n).push(a);if(--i<=0){f&&CKEDITOR.document.getDocumentElement().removeStyle("cursor");g(b)}},r=function(b,c){a[b]=1;var e=d[b];delete d[b];for(var f=0;f<e.length;f++)e[f](b,c)},y=function(b){if(a[b])A(b,true);else{var e=d[b]||(d[b]=[]);e.push(A);if(!(e.length>
227
+ 1)){var f=new CKEDITOR.dom.element("script");f.setAttributes({type:"text/javascript",src:b});if(c)if(CKEDITOR.env.ie&&CKEDITOR.env.version<11)f.$.onreadystatechange=function(){if(f.$.readyState=="loaded"||f.$.readyState=="complete"){f.$.onreadystatechange=null;r(b,true)}};else{f.$.onload=function(){setTimeout(function(){r(b,true)},0)};f.$.onerror=function(){r(b,false)}}f.appendTo(CKEDITOR.document.getHead())}}};f&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var o=0;o<i;o++)y(b[o])}},
228
228
  queue:function(){function a(){var b;(b=c[0])&&this.load(b.scriptUrl,b.callback,CKEDITOR,0)}var c=[];return function(d,f){var h=this;c.push({scriptUrl:d,callback:function(){f&&f.apply(this,arguments);c.shift();a.call(h)}});c.length==1&&a.call(this)}}()}}();CKEDITOR.resourceManager=function(a,d){this.basePath=a;this.fileName=d;this.registered={};this.loaded={};this.externals={};this._={waitingList:{}}};
229
229
  CKEDITOR.resourceManager.prototype={add:function(a,d){if(this.registered[a])throw'[CKEDITOR.resourceManager.add] The resource name "'+a+'" is already registered.';var b=this.registered[a]=d||{};b.name=a;b.path=this.getPath(a);CKEDITOR.fire(a+CKEDITOR.tools.capitalize(this.fileName)+"Ready",b);return this.get(a)},get:function(a){return this.registered[a]||null},getPath:function(a){var d=this.externals[a];return CKEDITOR.getUrl(d&&d.dir||this.basePath+a+"/")},getFilePath:function(a){var d=this.externals[a];
230
230
  return CKEDITOR.getUrl(this.getPath(a)+(d?d.file:this.fileName+".js"))},addExternal:function(a,d,b){for(var a=a.split(","),c=0;c<a.length;c++){var e=a[c];b||(d=d.replace(/[^\/]+$/,function(a){b=a;return""}));this.externals[e]={dir:d,file:b||this.fileName+".js"}}},load:function(a,d,b){CKEDITOR.tools.isArray(a)||(a=a?[a]:[]);for(var c=this.loaded,e=this.registered,f=[],h={},i={},j=0;j<a.length;j++){var n=a[j];if(n)if(!c[n]&&!e[n]){var g=this.getFilePath(n);f.push(g);g in h||(h[g]=[]);h[g].push(n)}else i[n]=
231
231
  this.get(n)}CKEDITOR.scriptLoader.load(f,function(a,e){if(e.length)throw'[CKEDITOR.resourceManager.load] Resource name "'+h[e[0]].join(",")+'" was not found at "'+e[0]+'".';for(var f=0;f<a.length;f++)for(var g=h[a[f]],j=0;j<g.length;j++){var n=g[j];i[n]=this.get(n);c[n]=1}d.call(b,i)},this)}};CKEDITOR.plugins=new CKEDITOR.resourceManager("plugins/","plugin");
232
- CKEDITOR.plugins.load=CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var d={};return function(b,c,e){var f={},h=function(b){a.call(this,b,function(a){CKEDITOR.tools.extend(f,a);var b=[],g;for(g in a){var i=a[g],s=i&&i.requires;if(!d[g]){if(i.icons)for(var z=i.icons.split(","),o=z.length;o--;)CKEDITOR.skin.addIcon(z[o],i.path+"icons/"+(CKEDITOR.env.hidpi&&i.hidpi?"hidpi/":"")+z[o]+".png");d[g]=1}if(s){s.split&&(s=s.split(","));for(i=0;i<s.length;i++)f[s[i]]||b.push(s[i])}}if(b.length)h.call(this,
232
+ CKEDITOR.plugins.load=CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var d={};return function(b,c,e){var f={},h=function(b){a.call(this,b,function(a){CKEDITOR.tools.extend(f,a);var b=[],g;for(g in a){var i=a[g],r=i&&i.requires;if(!d[g]){if(i.icons)for(var y=i.icons.split(","),o=y.length;o--;)CKEDITOR.skin.addIcon(y[o],i.path+"icons/"+(CKEDITOR.env.hidpi&&i.hidpi?"hidpi/":"")+y[o]+".png");d[g]=1}if(r){r.split&&(r=r.split(","));for(i=0;i<r.length;i++)f[r[i]]||b.push(r[i])}}if(b.length)h.call(this,
233
233
  b);else{for(g in f){i=f[g];if(i.onLoad&&!i.onLoad._called){i.onLoad()===false&&delete f[g];i.onLoad._called=1}}c&&c.call(e||window,f)}},this)};h.call(this,b)}});CKEDITOR.plugins.setLang=function(a,d,b){var c=this.get(a),a=c.langEntries||(c.langEntries={}),c=c.lang||(c.lang=[]);c.split&&(c=c.split(","));CKEDITOR.tools.indexOf(c,d)==-1&&c.push(d);a[d]=b};CKEDITOR.ui=function(a){if(a.ui)return a.ui;this.items={};this.instances={};this.editor=a;this._={handlers:{}};return this};
234
234
  CKEDITOR.ui.prototype={add:function(a,d,b){b.name=a.toLowerCase();var c=this.items[a]={type:d,command:b.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(c,b)},get:function(a){return this.instances[a]},create:function(a){var d=this.items[a],b=d&&this._.handlers[d.type],c=d&&d.command&&this.editor.getCommand(d.command),b=b&&b.create.apply(this,d.args);this.instances[a]=b;c&&c.uiItems.push(b);if(b&&!b.type)b.type=d.type;return b},addHandler:function(a,d){this._.handlers[a]=
235
235
  d},space:function(a){return CKEDITOR.document.getById(this.spaceId(a))},spaceId:function(a){return this.editor.id+"_"+a}};CKEDITOR.event.implementOn(CKEDITOR.ui);
236
236
  (function(){function a(a,c,f){CKEDITOR.event.call(this);a=a&&CKEDITOR.tools.clone(a);if(c!==void 0){if(c instanceof CKEDITOR.dom.element){if(!f)throw Error("One of the element modes must be specified.");}else throw Error("Expect element of type CKEDITOR.dom.element.");if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&f==CKEDITOR.ELEMENT_MODE_INLINE)throw Error("Inline element mode is not supported on IE quirks.");if(!(f==CKEDITOR.ELEMENT_MODE_INLINE?c.is(CKEDITOR.dtd.$editable)||c.is("textarea"):f==CKEDITOR.ELEMENT_MODE_REPLACE?
237
237
  !c.is(CKEDITOR.dtd.$nonBodyContent):1))throw Error('The specified element mode is not supported on element: "'+c.getName()+'".');this.element=c;this.elementMode=f;this.name=this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO&&(c.getId()||c.getNameAtt())}else this.elementMode=CKEDITOR.ELEMENT_MODE_NONE;this._={};this.commands={};this.templates={};this.name=this.name||d();this.id=CKEDITOR.tools.getNextId();this.status="unloaded";this.config=CKEDITOR.tools.prototypedCopy(CKEDITOR.config);this.ui=new CKEDITOR.ui(this);
238
238
  this.focusManager=new CKEDITOR.focusManager(this);this.keystrokeHandler=new CKEDITOR.keystrokeHandler(this);this.on("readOnly",b);this.on("selectionChange",function(a){e(this,a.data.path)});this.on("activeFilterChange",function(){e(this,this.elementPath(),true)});this.on("mode",b);this.on("instanceReady",function(){this.config.startupFocus&&this.focus()});CKEDITOR.fire("instanceCreated",null,this);CKEDITOR.add(this);CKEDITOR.tools.setTimeout(function(){h(this,a)},0,this)}function d(){do var a="editor"+
239
- ++s;while(CKEDITOR.instances[a]);return a}function b(){var a=this.commands,b;for(b in a)c(this,a[b])}function c(a,b){b[b.startDisabled?"disable":a.readOnly&&!b.readOnly?"disable":b.modes[a.mode]?"enable":"disable"]()}function e(a,b,c){if(b){var d,e,f=a.commands;for(e in f){d=f[e];(c||d.contextSensitive)&&d.refresh(a,b)}}}function f(a){var b=a.config.customConfig;if(!b)return false;var b=CKEDITOR.getUrl(b),c=z[b]||(z[b]={});if(c.fn){c.fn.call(a,a.config);(CKEDITOR.getUrl(a.config.customConfig)==b||
239
+ ++r;while(CKEDITOR.instances[a]);return a}function b(){var a=this.commands,b;for(b in a)c(this,a[b])}function c(a,b){b[b.startDisabled?"disable":a.readOnly&&!b.readOnly?"disable":b.modes[a.mode]?"enable":"disable"]()}function e(a,b,c){if(b){var d,e,f=a.commands;for(e in f){d=f[e];(c||d.contextSensitive)&&d.refresh(a,b)}}}function f(a){var b=a.config.customConfig;if(!b)return false;var b=CKEDITOR.getUrl(b),c=y[b]||(y[b]={});if(c.fn){c.fn.call(a,a.config);(CKEDITOR.getUrl(a.config.customConfig)==b||
240
240
  !f(a))&&a.fireOnce("customConfigLoaded")}else CKEDITOR.scriptLoader.queue(b,function(){c.fn=CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){};f(a)});return true}function h(a,b){a.on("customConfigLoaded",function(){if(b){if(b.on)for(var c in b.on)a.on(c,b.on[c]);CKEDITOR.tools.extend(a.config,b,true);delete a.config.on}c=a.config;a.readOnly=c.readOnly?true:a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.is("textarea")?a.element.hasAttribute("disabled")||a.element.hasAttribute("readonly"):
241
241
  a.element.isReadOnly():a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?a.element.hasAttribute("disabled")||a.element.hasAttribute("readonly"):false;a.blockless=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?!(a.element.is("textarea")||CKEDITOR.dtd[a.element.getName()].p):false;a.tabIndex=c.tabIndex||a.element&&a.element.getAttribute("tabindex")||0;a.activeEnterMode=a.enterMode=a.blockless?CKEDITOR.ENTER_BR:c.enterMode;a.activeShiftEnterMode=a.shiftEnterMode=a.blockless?CKEDITOR.ENTER_BR:c.shiftEnterMode;
242
242
  if(c.skin)CKEDITOR.skinName=c.skin;a.fireOnce("configLoaded");a.dataProcessor=new CKEDITOR.htmlDataProcessor(a);a.filter=a.activeFilter=new CKEDITOR.filter(a);i(a)});if(b&&b.customConfig!=null)a.config.customConfig=b.customConfig;f(a)||a.fireOnce("customConfigLoaded")}function i(a){CKEDITOR.skin.loadPart("editor",function(){j(a)})}function j(a){CKEDITOR.lang.load(a.config.language,a.config.defaultLanguage,function(b,c){var d=a.config.title;a.langCode=b;a.lang=CKEDITOR.tools.prototypedCopy(c);a.title=
243
243
  typeof d=="string"||d===false?d:[a.lang.editor,a.name].join(", ");if(!a.config.contentsLangDirection)a.config.contentsLangDirection=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.getDirection(1):a.lang.dir;a.fire("langLoaded");n(a)})}function n(a){a.getStylesSet(function(b){a.once("loaded",function(){a.fire("stylesSet",{styles:b})},null,null,1);g(a)})}function g(a){var b=a.config,c=b.plugins,d=b.extraPlugins,e=b.removePlugins;if(d)var f=RegExp("(?:^|,)(?:"+d.replace(/\s*,\s*/g,"|")+")(?=,|$)",
244
- "g"),c=c.replace(f,""),c=c+(","+d);if(e)var g=RegExp("(?:^|,)(?:"+e.replace(/\s*,\s*/g,"|")+")(?=,|$)","g"),c=c.replace(g,"");CKEDITOR.env.air&&(c=c+",adobeair");CKEDITOR.plugins.load(c.split(","),function(c){var d=[],e=[],f=[];a.plugins=c;for(var h in c){var i=c[h],A=i.lang,j=null,E=i.requires,r;CKEDITOR.tools.isArray(E)&&(E=E.join(","));if(E&&(r=E.match(g)))for(;E=r.pop();)CKEDITOR.tools.setTimeout(function(a,b){throw Error('Plugin "'+a.replace(",","")+'" cannot be removed from the plugins list, because it\'s required by "'+
245
- b+'" plugin.');},0,null,[E,h]);if(A&&!a.lang[h]){A.split&&(A=A.split(","));if(CKEDITOR.tools.indexOf(A,a.langCode)>=0)j=a.langCode;else{j=a.langCode.replace(/-.*/,"");j=j!=a.langCode&&CKEDITOR.tools.indexOf(A,j)>=0?j:CKEDITOR.tools.indexOf(A,"en")>=0?"en":A[0]}if(!i.langEntries||!i.langEntries[j])f.push(CKEDITOR.getUrl(i.path+"lang/"+j+".js"));else{a.lang[h]=i.langEntries[j];j=null}}e.push(j);d.push(i)}CKEDITOR.scriptLoader.load(f,function(){for(var c=["beforeInit","init","afterInit"],f=0;f<c.length;f++)for(var g=
246
- 0;g<d.length;g++){var v=d[g];f===0&&(e[g]&&v.lang&&v.langEntries)&&(a.lang[v.name]=v.langEntries[e[g]]);if(v[c[f]])v[c[f]](a)}a.fireOnce("pluginsLoaded");b.keystrokes&&a.setKeystroke(a.config.keystrokes);for(g=0;g<a.config.blockedKeystrokes.length;g++)a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[g]]=1;a.status="loaded";a.fireOnce("loaded");CKEDITOR.fire("instanceLoaded",null,a)})})}function B(){var a=this.element;if(a&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var b=this.getData();
247
- this.config.htmlEncodeOutput&&(b=CKEDITOR.tools.htmlEncode(b));a.is("textarea")?a.setValue(b):a.setHtml(b);return true}return false}a.prototype=CKEDITOR.editor.prototype;CKEDITOR.editor=a;var s=0,z={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{addCommand:function(a,b){b.name=a.toLowerCase();var d=new CKEDITOR.command(this,b);this.mode&&c(this,d);return this.commands[a]=d},_attachToForm:function(){function a(d){b.updateElement();b._.required&&(!c.getValue()&&b.fire("required")===false)&&d.data.preventDefault()}
248
- var b=this,c=b.element,d=new CKEDITOR.dom.element(c.$.form);if(c.is("textarea")&&d){d.on("submit",a);if(d.$.submit&&d.$.submit.call&&d.$.submit.apply)d.$.submit=CKEDITOR.tools.override(d.$.submit,function(b){return function(){a();b.apply?b.apply(this):b()}});b.on("destroy",function(){d.removeListener("submit",a)})}},destroy:function(a){this.fire("beforeDestroy");!a&&B.call(this);this.editable(null);this.filter.destroy();delete this.filter;delete this.activeFilter;this.status="destroyed";this.fire("destroy");
244
+ "g"),c=c.replace(f,""),c=c+(","+d);if(e)var g=RegExp("(?:^|,)(?:"+e.replace(/\s*,\s*/g,"|")+")(?=,|$)","g"),c=c.replace(g,"");CKEDITOR.env.air&&(c=c+",adobeair");CKEDITOR.plugins.load(c.split(","),function(c){var d=[],e=[],f=[];a.plugins=c;for(var p in c){var h=c[p],z=h.lang,i=null,j=h.requires,u;CKEDITOR.tools.isArray(j)&&(j=j.join(","));if(j&&(u=j.match(g)))for(;j=u.pop();)CKEDITOR.tools.setTimeout(function(a,b){throw Error('Plugin "'+a.replace(",","")+'" cannot be removed from the plugins list, because it\'s required by "'+
245
+ b+'" plugin.');},0,null,[j,p]);if(z&&!a.lang[p]){z.split&&(z=z.split(","));if(CKEDITOR.tools.indexOf(z,a.langCode)>=0)i=a.langCode;else{i=a.langCode.replace(/-.*/,"");i=i!=a.langCode&&CKEDITOR.tools.indexOf(z,i)>=0?i:CKEDITOR.tools.indexOf(z,"en")>=0?"en":z[0]}if(!h.langEntries||!h.langEntries[i])f.push(CKEDITOR.getUrl(h.path+"lang/"+i+".js"));else{a.lang[p]=h.langEntries[i];i=null}}e.push(i);d.push(h)}CKEDITOR.scriptLoader.load(f,function(){for(var c=["beforeInit","init","afterInit"],f=0;f<c.length;f++)for(var g=
246
+ 0;g<d.length;g++){var p=d[g];f===0&&(e[g]&&p.lang&&p.langEntries)&&(a.lang[p.name]=p.langEntries[e[g]]);if(p[c[f]])p[c[f]](a)}a.fireOnce("pluginsLoaded");b.keystrokes&&a.setKeystroke(a.config.keystrokes);for(g=0;g<a.config.blockedKeystrokes.length;g++)a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[g]]=1;a.status="loaded";a.fireOnce("loaded");CKEDITOR.fire("instanceLoaded",null,a)})})}function A(){var a=this.element;if(a&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var b=this.getData();
247
+ this.config.htmlEncodeOutput&&(b=CKEDITOR.tools.htmlEncode(b));a.is("textarea")?a.setValue(b):a.setHtml(b);return true}return false}a.prototype=CKEDITOR.editor.prototype;CKEDITOR.editor=a;var r=0,y={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{addCommand:function(a,b){b.name=a.toLowerCase();var d=new CKEDITOR.command(this,b);this.mode&&c(this,d);return this.commands[a]=d},_attachToForm:function(){function a(d){b.updateElement();b._.required&&(!c.getValue()&&b.fire("required")===false)&&d.data.preventDefault()}
248
+ var b=this,c=b.element,d=new CKEDITOR.dom.element(c.$.form);if(c.is("textarea")&&d){d.on("submit",a);if(d.$.submit&&d.$.submit.call&&d.$.submit.apply)d.$.submit=CKEDITOR.tools.override(d.$.submit,function(b){return function(){a();b.apply?b.apply(this):b()}});b.on("destroy",function(){d.removeListener("submit",a)})}},destroy:function(a){this.fire("beforeDestroy");!a&&A.call(this);this.editable(null);this.filter.destroy();delete this.filter;delete this.activeFilter;this.status="destroyed";this.fire("destroy");
249
249
  this.removeAllListeners();CKEDITOR.remove(this);CKEDITOR.fire("instanceDestroyed",null,this)},elementPath:function(a){if(!a){a=this.getSelection();if(!a)return null;a=a.getStartElement()}return a?new CKEDITOR.dom.elementPath(a,this.editable()):null},createRange:function(){var a=this.editable();return a?new CKEDITOR.dom.range(a):null},execCommand:function(a,b){var c=this.getCommand(a),d={name:a,commandData:b,command:c};if(c&&c.state!=CKEDITOR.TRISTATE_DISABLED&&this.fire("beforeCommandExec",d)!==false){d.returnValue=
250
250
  c.exec(d.commandData);if(!c.async&&this.fire("afterCommandExec",d)!==false)return d.returnValue}return false},getCommand:function(a){return this.commands[a]},getData:function(a){!a&&this.fire("beforeGetData");var b=this._.data;if(typeof b!="string")b=(b=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?b.is("textarea")?b.getValue():b.getHtml():"";b={dataValue:b};!a&&this.fire("getData",b);return b.dataValue},getSnapshot:function(){var a=this.fire("getSnapshot");if(typeof a!="string")a=
251
251
  (a=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?a.is("textarea")?a.getValue():a.getHtml():"";return a},loadSnapshot:function(a){this.fire("loadSnapshot",a)},setData:function(a,b,c){var d=true,e=b;if(b&&typeof b=="object"){c=b.internal;e=b.callback;d=!b.noSnapshot}!c&&d&&this.fire("saveSnapshot");if(e||!c)this.once("dataReady",function(a){!c&&d&&this.fire("saveSnapshot");e&&e.call(a.editor)});a={dataValue:a};!c&&this.fire("setData",a);this._.data=a.dataValue;!c&&this.fire("afterSetData",
252
252
  a)},setReadOnly:function(a){a=a==null||a;if(this.readOnly!=a){this.readOnly=a;this.keystrokeHandler.blockedKeystrokes[8]=+a;this.editable().setReadOnly(a);this.fire("readOnly")}},insertHtml:function(a,b,c){this.fire("insertHtml",{dataValue:a,mode:b,range:c})},insertText:function(a){this.fire("insertText",a)},insertElement:function(a){this.fire("insertElement",a)},getSelectedHtml:function(a){var b=this.editable(),c=this.getSelection(),c=c&&c.getRanges();if(!b||!c||c.length===0)return null;b=b.getHtmlFromRange(c[0]);
253
- return a?b.getHtml():b},extractSelectedHtml:function(a,b){var c=this.editable(),d=this.getSelection().getRanges();if(!c||d.length===0)return null;d=d[0];c=c.extractHtmlFromRange(d,b);b||this.getSelection().selectRanges([d]);return a?c.getHtml():c},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return this.status=="ready"&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return B.call(this)},setKeystroke:function(){for(var a=
253
+ return a?b.getHtml():b},extractSelectedHtml:function(a,b){var c=this.editable(),d=this.getSelection().getRanges();if(!c||d.length===0)return null;d=d[0];c=c.extractHtmlFromRange(d,b);b||this.getSelection().selectRanges([d]);return a?c.getHtml():c},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return this.status=="ready"&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return A.call(this)},setKeystroke:function(){for(var a=
254
254
  this.keystrokeHandler.keystrokes,b=CKEDITOR.tools.isArray(arguments[0])?arguments[0]:[[].slice.call(arguments,0)],c,d,e=b.length;e--;){c=b[e];d=0;if(CKEDITOR.tools.isArray(c)){d=c[1];c=c[0]}d?a[c]=d:delete a[c]}},addFeature:function(a){return this.filter.addFeature(a)},setActiveFilter:function(a){if(!a)a=this.filter;if(this.activeFilter!==a){this.activeFilter=a;this.fire("activeFilterChange");a===this.filter?this.setActiveEnterMode(null,null):this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode),
255
255
  a.getAllowedEnterMode(this.shiftEnterMode,true))}},setActiveEnterMode:function(a,b){a=a?this.blockless?CKEDITOR.ENTER_BR:a:this.enterMode;b=b?this.blockless?CKEDITOR.ENTER_BR:b:this.shiftEnterMode;if(this.activeEnterMode!=a||this.activeShiftEnterMode!=b){this.activeEnterMode=a;this.activeShiftEnterMode=b;this.fire("activeEnterModeChange")}},showNotification:function(a){alert(a)}})})();CKEDITOR.ELEMENT_MODE_NONE=0;CKEDITOR.ELEMENT_MODE_REPLACE=1;CKEDITOR.ELEMENT_MODE_APPENDTO=2;
256
256
  CKEDITOR.ELEMENT_MODE_INLINE=3;CKEDITOR.htmlParser=function(){this._={htmlPartsRegex:/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\>)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}};
@@ -266,13 +266,13 @@ CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlPar
266
266
  (function(){CKEDITOR.htmlParser.text=function(a){this.value=a;this._={isBlockLike:false}};CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(a,d){if(!(this.value=a.onText(d,this.value,this))){this.remove();return false}},writeHtml:function(a,d){d&&this.filter(d);a.text(this.value)}})})();"use strict";
267
267
  (function(){CKEDITOR.htmlParser.cdata=function(a){this.value=a};CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(a){a.write(this.value)}})})();"use strict";CKEDITOR.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:true,hasInlineStarted:false}};
268
268
  (function(){function a(a){return a.attributes["data-cke-survive"]?false:a.name=="a"&&a.attributes.href||CKEDITOR.dtd.$removeEmpty[a.name]}var d=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),b={ol:1,ul:1},c=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),e={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=
269
- function(f,h,i){function j(a){var b;if(t.length>0)for(var c=0;c<t.length;c++){var d=t[c],e=d.name,f=CKEDITOR.dtd[e],g=u.name&&CKEDITOR.dtd[u.name];if((!g||g[e])&&(!a||!f||f[a]||!CKEDITOR.dtd[a])){if(!b){n();b=1}d=d.clone();d.parent=u;u=d;t.splice(c,1);c--}else if(e==u.name){B(u,u.parent,1);c--}}}function n(){for(;x.length;)B(x.shift(),u)}function g(a){if(a._.isBlockLike&&a.name!="pre"&&a.name!="textarea"){var b=a.children.length,c=a.children[b-1],d;if(c&&c.type==CKEDITOR.NODE_TEXT)(d=CKEDITOR.tools.rtrim(c.value))?
270
- c.value=d:a.children.length=b-1}}function B(b,c,d){var c=c||u||p,e=u;if(b.previous===void 0){if(s(c,b)){u=c;o.onTagOpen(i,{});b.returnPoint=c=u}g(b);(!a(b)||b.children.length)&&c.add(b);b.name=="pre"&&(l=false);b.name=="textarea"&&(C=false)}if(b.returnPoint){u=b.returnPoint;delete b.returnPoint}else u=d?c:e}function s(a,b){if((a==p||a.name=="body")&&i&&(!a.name||CKEDITOR.dtd[a.name][i])){var c,d;return(c=b.attributes&&(d=b.attributes["data-cke-real-element-type"])?d:b.name)&&c in CKEDITOR.dtd.$inline&&
271
- !(c in CKEDITOR.dtd.head)&&!b.isOrphan||b.type==CKEDITOR.NODE_TEXT}}function z(a,b){return a in CKEDITOR.dtd.$listItem||a in CKEDITOR.dtd.$tableContent?a==b||a=="dt"&&b=="dd"||a=="dd"&&b=="dt":false}var o=new CKEDITOR.htmlParser,p=h instanceof CKEDITOR.htmlParser.element?h:typeof h=="string"?new CKEDITOR.htmlParser.element(h):new CKEDITOR.htmlParser.fragment,t=[],x=[],u=p,C=p.name=="textarea",l=p.name=="pre";o.onTagOpen=function(e,k,f,g){k=new CKEDITOR.htmlParser.element(e,k);if(k.isUnknown&&f)k.isEmpty=
272
- true;k.isOptionalClose=g;if(a(k))t.push(k);else{if(e=="pre")l=true;else{if(e=="br"&&l){u.add(new CKEDITOR.htmlParser.text("\n"));return}e=="textarea"&&(C=true)}if(e=="br")x.push(k);else{for(;;){g=(f=u.name)?CKEDITOR.dtd[f]||(u._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):c;if(!k.isUnknown&&!u.isUnknown&&!g[e])if(u.isOptionalClose)o.onTagClose(f);else if(e in b&&f in b){f=u.children;(f=f[f.length-1])&&f.name=="li"||B(f=new CKEDITOR.htmlParser.element("li"),u);!k.returnPoint&&(k.returnPoint=u);
273
- u=f}else if(e in CKEDITOR.dtd.$listItem&&!z(e,f))o.onTagOpen(e=="li"?"ul":"dl",{},0,1);else if(f in d&&!z(e,f)){!k.returnPoint&&(k.returnPoint=u);u=u.parent}else{f in CKEDITOR.dtd.$inline&&t.unshift(u);if(u.parent)B(u,u.parent,1);else{k.isOrphan=1;break}}else break}j(e);n();k.parent=u;k.isEmpty?B(k):u=k}}};o.onTagClose=function(a){for(var b=t.length-1;b>=0;b--)if(a==t[b].name){t.splice(b,1);return}for(var c=[],d=[],e=u;e!=p&&e.name!=a;){e._.isBlockLike||d.unshift(e);c.push(e);e=e.returnPoint||e.parent}if(e!=
274
- p){for(b=0;b<c.length;b++){var f=c[b];B(f,f.parent)}u=e;e._.isBlockLike&&n();B(e,e.parent);if(e==u)u=u.parent;t=t.concat(d)}a=="body"&&(i=false)};o.onText=function(a){if((!u._.hasInlineStarted||x.length)&&!l&&!C){a=CKEDITOR.tools.ltrim(a);if(a.length===0)return}var b=u.name,f=b?CKEDITOR.dtd[b]||(u._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):c;if(!C&&!f["#"]&&b in d){o.onTagOpen(e[b]||"");o.onText(a)}else{n();j();!l&&!C&&(a=a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," "));a=new CKEDITOR.htmlParser.text(a);
275
- if(s(u,a))this.onTagOpen(i,{},0,1);u.add(a)}};o.onCDATA=function(a){u.add(new CKEDITOR.htmlParser.cdata(a))};o.onComment=function(a){n();j();u.add(new CKEDITOR.htmlParser.comment(a))};o.parse(f);for(n();u!=p;)B(u,u.parent,1);g(p);return p};CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(a,b){isNaN(b)&&(b=this.children.length);var c=b>0?this.children[b-1]:null;if(c){if(a._.isBlockLike&&c.type==CKEDITOR.NODE_TEXT){c.value=CKEDITOR.tools.rtrim(c.value);if(c.value.length===
269
+ function(f,h,i){function j(a){var b;if(t.length>0)for(var c=0;c<t.length;c++){var d=t[c],e=d.name,f=CKEDITOR.dtd[e],g=v.name&&CKEDITOR.dtd[v.name];if((!g||g[e])&&(!a||!f||f[a]||!CKEDITOR.dtd[a])){if(!b){n();b=1}d=d.clone();d.parent=v;v=d;t.splice(c,1);c--}else if(e==v.name){A(v,v.parent,1);c--}}}function n(){for(;w.length;)A(w.shift(),v)}function g(a){if(a._.isBlockLike&&a.name!="pre"&&a.name!="textarea"){var b=a.children.length,c=a.children[b-1],d;if(c&&c.type==CKEDITOR.NODE_TEXT)(d=CKEDITOR.tools.rtrim(c.value))?
270
+ c.value=d:a.children.length=b-1}}function A(b,c,d){var c=c||v||q,e=v;if(b.previous===void 0){if(r(c,b)){v=c;o.onTagOpen(i,{});b.returnPoint=c=v}g(b);(!a(b)||b.children.length)&&c.add(b);b.name=="pre"&&(l=false);b.name=="textarea"&&(B=false)}if(b.returnPoint){v=b.returnPoint;delete b.returnPoint}else v=d?c:e}function r(a,b){if((a==q||a.name=="body")&&i&&(!a.name||CKEDITOR.dtd[a.name][i])){var c,d;return(c=b.attributes&&(d=b.attributes["data-cke-real-element-type"])?d:b.name)&&c in CKEDITOR.dtd.$inline&&
271
+ !(c in CKEDITOR.dtd.head)&&!b.isOrphan||b.type==CKEDITOR.NODE_TEXT}}function y(a,b){return a in CKEDITOR.dtd.$listItem||a in CKEDITOR.dtd.$tableContent?a==b||a=="dt"&&b=="dd"||a=="dd"&&b=="dt":false}var o=new CKEDITOR.htmlParser,q=h instanceof CKEDITOR.htmlParser.element?h:typeof h=="string"?new CKEDITOR.htmlParser.element(h):new CKEDITOR.htmlParser.fragment,t=[],w=[],v=q,B=q.name=="textarea",l=q.name=="pre";o.onTagOpen=function(e,k,f,g){k=new CKEDITOR.htmlParser.element(e,k);if(k.isUnknown&&f)k.isEmpty=
272
+ true;k.isOptionalClose=g;if(a(k))t.push(k);else{if(e=="pre")l=true;else{if(e=="br"&&l){v.add(new CKEDITOR.htmlParser.text("\n"));return}e=="textarea"&&(B=true)}if(e=="br")w.push(k);else{for(;;){g=(f=v.name)?CKEDITOR.dtd[f]||(v._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):c;if(!k.isUnknown&&!v.isUnknown&&!g[e])if(v.isOptionalClose)o.onTagClose(f);else if(e in b&&f in b){f=v.children;(f=f[f.length-1])&&f.name=="li"||A(f=new CKEDITOR.htmlParser.element("li"),v);!k.returnPoint&&(k.returnPoint=v);
273
+ v=f}else if(e in CKEDITOR.dtd.$listItem&&!y(e,f))o.onTagOpen(e=="li"?"ul":"dl",{},0,1);else if(f in d&&!y(e,f)){!k.returnPoint&&(k.returnPoint=v);v=v.parent}else{f in CKEDITOR.dtd.$inline&&t.unshift(v);if(v.parent)A(v,v.parent,1);else{k.isOrphan=1;break}}else break}j(e);n();k.parent=v;k.isEmpty?A(k):v=k}}};o.onTagClose=function(a){for(var b=t.length-1;b>=0;b--)if(a==t[b].name){t.splice(b,1);return}for(var c=[],d=[],e=v;e!=q&&e.name!=a;){e._.isBlockLike||d.unshift(e);c.push(e);e=e.returnPoint||e.parent}if(e!=
274
+ q){for(b=0;b<c.length;b++){var f=c[b];A(f,f.parent)}v=e;e._.isBlockLike&&n();A(e,e.parent);if(e==v)v=v.parent;t=t.concat(d)}a=="body"&&(i=false)};o.onText=function(a){if((!v._.hasInlineStarted||w.length)&&!l&&!B){a=CKEDITOR.tools.ltrim(a);if(a.length===0)return}var b=v.name,f=b?CKEDITOR.dtd[b]||(v._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):c;if(!B&&!f["#"]&&b in d){o.onTagOpen(e[b]||"");o.onText(a)}else{n();j();!l&&!B&&(a=a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," "));a=new CKEDITOR.htmlParser.text(a);
275
+ if(r(v,a))this.onTagOpen(i,{},0,1);v.add(a)}};o.onCDATA=function(a){v.add(new CKEDITOR.htmlParser.cdata(a))};o.onComment=function(a){n();j();v.add(new CKEDITOR.htmlParser.comment(a))};o.parse(f);for(n();v!=q;)A(v,v.parent,1);g(q);return q};CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(a,b){isNaN(b)&&(b=this.children.length);var c=b>0?this.children[b-1]:null;if(c){if(a._.isBlockLike&&c.type==CKEDITOR.NODE_TEXT){c.value=CKEDITOR.tools.rtrim(c.value);if(c.value.length===
276
276
  0){this.children.pop();this.add(a);return}}c.next=a}a.previous=c;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,c){if(this.childrenFilteredBy!=a.id){c=this.getFilterContext(c);if(b&&!this.parent)a.onRoot(c,this);this.childrenFilteredBy=a.id;for(b=0;b<this.children.length;b++)this.children[b].filter(a,
277
277
  c)===false&&b--}},writeHtml:function(a,b){b&&this.filter(b);this.writeChildrenHtml(a)},writeChildrenHtml:function(a,b,c){var d=this.getFilterContext();if(c&&!this.parent&&b)b.onRoot(d,this);b&&this.filterChildren(b,false,d);b=0;c=this.children;for(d=c.length;b<d;b++)c[b].writeHtml(a)},forEach:function(a,b,c){if(!c&&(!b||this.type==b))var d=a(this);if(d!==false)for(var c=this.children,e=0;e<c.length;e++){d=c[e];d.type==CKEDITOR.NODE_ELEMENT?d.forEach(a,b):(!b||d.type==b)&&a(d)}},getFilterContext:function(a){return a||
278
278
  {}}}})();"use strict";
@@ -280,28 +280,28 @@ c)===false&&b--}},writeHtml:function(a,b){b&&this.filter(b);this.writeChildrenHt
280
280
  c)e=c.priority;typeof e!="number"&&(e=10);typeof c!="object"&&(c={});a.elementNames&&this.elementNameRules.addMany(a.elementNames,e,c);a.attributeNames&&this.attributeNameRules.addMany(a.attributeNames,e,c);a.elements&&d(this.elementsRules,a.elements,e,c);a.attributes&&d(this.attributesRules,a.attributes,e,c);a.text&&this.textRules.add(a.text,e,c);a.comment&&this.commentRules.add(a.comment,e,c);a.root&&this.rootRules.add(a.root,e,c)},applyTo:function(a){a.filter(this)},onElementName:function(a,c){return this.elementNameRules.execOnName(a,
281
281
  c)},onAttributeName:function(a,c){return this.attributeNameRules.execOnName(a,c)},onText:function(a,c,d){return this.textRules.exec(a,c,d)},onComment:function(a,c,d){return this.commentRules.exec(a,c,d)},onRoot:function(a,c){return this.rootRules.exec(a,c)},onElement:function(a,c){for(var d=[this.elementsRules["^"],this.elementsRules[c.name],this.elementsRules.$],f,h=0;h<3;h++)if(f=d[h]){f=f.exec(a,c,this);if(f===false)return null;if(f&&f!=c)return this.onNode(a,f);if(c.parent&&!c.name)break}return c},
282
282
  onNode:function(a,c){var d=c.type;return d==CKEDITOR.NODE_ELEMENT?this.onElement(a,c):d==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(a,c.value)):d==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,c.value)):null},onAttribute:function(a,c,d,f){return(d=this.attributesRules[d])?d.exec(a,f,c,this):f}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,c,d){this.rules.splice(this.findIndex(c),0,{value:a,priority:c,options:d})},addMany:function(a,
283
- c,d){for(var f=[this.findIndex(c),0],h=0,i=a.length;h<i;h++)f.push({value:a[h],priority:c,options:d});this.rules.splice.apply(this.rules,f)},findIndex:function(a){for(var c=this.rules,d=c.length-1;d>=0&&a<c[d].priority;)d--;return d+1},exec:function(a,c){var d=c instanceof CKEDITOR.htmlParser.node||c instanceof CKEDITOR.htmlParser.fragment,f=Array.prototype.slice.call(arguments,1),h=this.rules,i=h.length,j,n,g,B;for(B=0;B<i;B++){if(d){j=c.type;n=c.name}g=h[B];if(!(a.nonEditable&&!g.options.applyToAll||
283
+ c,d){for(var f=[this.findIndex(c),0],h=0,i=a.length;h<i;h++)f.push({value:a[h],priority:c,options:d});this.rules.splice.apply(this.rules,f)},findIndex:function(a){for(var c=this.rules,d=c.length-1;d>=0&&a<c[d].priority;)d--;return d+1},exec:function(a,c){var d=c instanceof CKEDITOR.htmlParser.node||c instanceof CKEDITOR.htmlParser.fragment,f=Array.prototype.slice.call(arguments,1),h=this.rules,i=h.length,j,n,g,A;for(A=0;A<i;A++){if(d){j=c.type;n=c.name}g=h[A];if(!(a.nonEditable&&!g.options.applyToAll||
284
284
  a.nestedEditable&&g.options.excludeNestedEditable)){g=g.value.apply(null,f);if(g===false||d&&g&&(g.name!=n||g.type!=j))return g;g!=null&&(f[0]=c=g)}}return c},execOnName:function(a,c){for(var d=0,f=this.rules,h=f.length,i;c&&d<h;d++){i=f[d];!(a.nonEditable&&!i.options.applyToAll||a.nestedEditable&&i.options.excludeNestedEditable)&&(c=c.replace(i.value[0],i.value[1]))}return c}}})();
285
- (function(){function a(a,d){function k(a){return a||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text(" "):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function g(a,d){return function(e){if(e.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var g=[],v=b(e),r,h;if(v)for(m(v,1)&&g.push(v);v;){if(f(v)&&(r=c(v))&&m(r))if((h=c(r))&&!f(h))g.push(r);else{k(w).insertAfter(r);r.remove()}v=v.previous}for(v=0;v<g.length;v++)g[v].remove();if(g=!a||(typeof d=="function"?d(e):d)!==false)if(!w&&!CKEDITOR.env.needsBrFiller&&
286
- e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)g=false;else if(!w&&!CKEDITOR.env.needsBrFiller&&(document.documentMode>7||e.name in CKEDITOR.dtd.tr||e.name in CKEDITOR.dtd.$listItem))g=false;else{g=b(e);g=!g||e.name=="form"&&g.name=="input"}g&&e.add(k(a))}}}function m(a,b){if((!w||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(t))){if(c.index){(new CKEDITOR.htmlParser.text(a.value.substring(0,
287
- c.index))).insertBefore(a);a.value=c[0]}if(!CKEDITOR.env.needsBrFiller&&w&&(!b||a.parent.name in A))return true;if(!w)if((c=a.previous)&&c.name=="br"||!c||f(c))return true}return false}var r={elements:{}},w=d=="html",A=CKEDITOR.tools.extend({},l),D;for(D in A)"#"in u[D]||delete A[D];for(D in A)r.elements[D]=g(w,a.config.fillEmptyBlocks);r.root=g(w,false);r.elements.br=function(a){return function(b){if(b.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var d=b.attributes;if("data-cke-bogus"in d||"data-cke-eol"in
288
- d)delete d["data-cke-bogus"];else{for(d=b.next;d&&e(d);)d=d.next;var g=c(b);!d&&f(b.parent)?h(b.parent,k(a)):f(d)&&(g&&!f(g))&&k(a).insertBefore(d)}}}}(w);return r}function d(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&&e(a);)a=a.previous;return a}function c(a){for(a=a.previous;a&&e(a);)a=a.previous;return a}function e(a){return a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(a.value)||a.type==CKEDITOR.NODE_ELEMENT&&
285
+ (function(){function a(a,d){function k(a){return a||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text(" "):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function g(a,d){return function(e){if(e.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var g=[],p=b(e),D,h;if(p)for(m(p,1)&&g.push(p);p;){if(f(p)&&(D=c(p))&&m(D))if((h=c(D))&&!f(h))g.push(D);else{k(u).insertAfter(D);D.remove()}p=p.previous}for(p=0;p<g.length;p++)g[p].remove();if(g=!a||(typeof d=="function"?d(e):d)!==false)if(!u&&!CKEDITOR.env.needsBrFiller&&
286
+ e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)g=false;else if(!u&&!CKEDITOR.env.needsBrFiller&&(document.documentMode>7||e.name in CKEDITOR.dtd.tr||e.name in CKEDITOR.dtd.$listItem))g=false;else{g=b(e);g=!g||e.name=="form"&&g.name=="input"}g&&e.add(k(a))}}}function m(a,b){if((!u||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(t))){if(c.index){(new CKEDITOR.htmlParser.text(a.value.substring(0,
287
+ c.index))).insertBefore(a);a.value=c[0]}if(!CKEDITOR.env.needsBrFiller&&u&&(!b||a.parent.name in z))return true;if(!u)if((c=a.previous)&&c.name=="br"||!c||f(c))return true}return false}var p={elements:{}},u=d=="html",z=CKEDITOR.tools.extend({},l),C;for(C in z)"#"in v[C]||delete z[C];for(C in z)p.elements[C]=g(u,a.config.fillEmptyBlocks);p.root=g(u,false);p.elements.br=function(a){return function(b){if(b.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var d=b.attributes;if("data-cke-bogus"in d||"data-cke-eol"in
288
+ d)delete d["data-cke-bogus"];else{for(d=b.next;d&&e(d);)d=d.next;var g=c(b);!d&&f(b.parent)?h(b.parent,k(a)):f(d)&&(g&&!f(g))&&k(a).insertBefore(d)}}}}(u);return p}function d(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&&e(a);)a=a.previous;return a}function c(a){for(a=a.previous;a&&e(a);)a=a.previous;return a}function e(a){return a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(a.value)||a.type==CKEDITOR.NODE_ELEMENT&&
289
289
  a.attributes["data-cke-bookmark"]}function f(a){return a&&(a.type==CKEDITOR.NODE_ELEMENT&&a.name in l||a.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function h(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 i(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}}
290
- function n(a){return a.replace(w,function(a,b,c){return"<"+b+c.replace(H,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("<textarea")===0&&(a=b+z(c).replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</textarea>");return"<cke:encoded>"+encodeURIComponent(a)+"</cke:encoded>"})}function B(a){return a.replace(r,function(a,b){return decodeURIComponent(b)})}function s(a){return a.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g,
291
- function(a){return"<\!--"+x+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\>"})}function z(a){return a.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)})}function o(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=[],d=b.config.protectedSource,k=b._.dataStore||(b._.dataStore=
292
- {id:1}),e=/<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,d=[/<script[\s\S]*?(<\/script>|$)/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(d),a=a.replace(/<\!--[\s\S]*?--\>/g,function(a){return"<\!--{cke_tempcomment}"+(c.push(a)-1)+"--\>"}),f=0;f<d.length;f++)a=a.replace(d[f],function(a){a=a.replace(e,function(a,b,d){return c[d]});return/cke_temp(comment)?/.test(a)?a:"<\!--{cke_temp}"+(c.push(a)-1)+"--\>"});a=a.replace(e,function(a,b,d){return"<\!--"+x+(b?"{C}":"")+encodeURIComponent(c[d]).replace(/--/g,
293
- "%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){k[k.id]=decodeURIComponent(b);return"{cke_protected_"+k.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,d,k){return"<"+c+d+">"+o(z(k),b)+"</"+c+">"})}CKEDITOR.htmlDataProcessor=function(b){var c,e,f=this;this.editor=b;this.dataFilter=c=new CKEDITOR.htmlParser.filter;
294
- this.htmlFilter=e=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;c.addRules(q);c.addRules(k,{applyToAll:true});c.addRules(a(b,"data"),{applyToAll:true});e.addRules(m);e.addRules(F,{applyToAll:true});e.addRules(a(b,"html"),{applyToAll:true});b.on("toHtml",function(a){var a=a.data,c=a.dataValue,k,c=p(c,b),c=g(c,E),c=n(c),c=g(c,K),c=c.replace(J,"$1cke:$2"),c=c.replace(y,"<cke:$1$2></cke:$1>"),c=c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2"),c=c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,
295
- "$1data-cke-"+CKEDITOR.rnd+"-$2");k=a.context||b.editable().getName();var e;if(CKEDITOR.env.ie&&CKEDITOR.env.version<9&&k=="pre"){k="div";c="<pre>"+c+"</pre>";e=1}k=b.document.createElement(k);k.setHtml("a"+c);c=k.getHtml().substr(1);c=c.replace(RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");e&&(c=c.replace(/^<pre>|<\/pre>$/gi,""));c=c.replace(D,"$1$2");c=B(c);c=z(c);k=a.fixForBody===false?false:d(a.enterMode,b.config.autoParagraph);c=CKEDITOR.htmlParser.fragment.fromHtml(c,a.context,k);if(k){e=c;
290
+ function n(a){return a.replace(p,function(a,b,c){return"<"+b+c.replace(I,function(a,b){return z.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("<textarea")===0&&(a=b+y(c).replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</textarea>");return"<cke:encoded>"+encodeURIComponent(a)+"</cke:encoded>"})}function A(a){return a.replace(u,function(a,b){return decodeURIComponent(b)})}function r(a){return a.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g,
291
+ function(a){return"<\!--"+w+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\>"})}function y(a){return a.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)})}function o(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 q(a,b){for(var c=[],d=b.config.protectedSource,k=b._.dataStore||(b._.dataStore=
292
+ {id:1}),e=/<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,d=[/<script[\s\S]*?(<\/script>|$)/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(d),a=a.replace(/<\!--[\s\S]*?--\>/g,function(a){return"<\!--{cke_tempcomment}"+(c.push(a)-1)+"--\>"}),f=0;f<d.length;f++)a=a.replace(d[f],function(a){a=a.replace(e,function(a,b,d){return c[d]});return/cke_temp(comment)?/.test(a)?a:"<\!--{cke_temp}"+(c.push(a)-1)+"--\>"});a=a.replace(e,function(a,b,d){return"<\!--"+w+(b?"{C}":"")+encodeURIComponent(c[d]).replace(/--/g,
293
+ "%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){k[k.id]=decodeURIComponent(b);return"{cke_protected_"+k.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,d,k){return"<"+c+d+">"+o(y(k),b)+"</"+c+">"})}CKEDITOR.htmlDataProcessor=function(b){var c,e,f=this;this.editor=b;this.dataFilter=c=new CKEDITOR.htmlParser.filter;
294
+ this.htmlFilter=e=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;c.addRules(s);c.addRules(k,{applyToAll:true});c.addRules(a(b,"data"),{applyToAll:true});e.addRules(m);e.addRules(F,{applyToAll:true});e.addRules(a(b,"html"),{applyToAll:true});b.on("toHtml",function(a){var a=a.data,c=a.dataValue,k,c=q(c,b),c=g(c,E),c=n(c),c=g(c,L),c=c.replace(K,"$1cke:$2"),c=c.replace(x,"<cke:$1$2></cke:$1>"),c=c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2"),c=c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,
295
+ "$1data-cke-"+CKEDITOR.rnd+"-$2");k=a.context||b.editable().getName();var e;if(CKEDITOR.env.ie&&CKEDITOR.env.version<9&&k=="pre"){k="div";c="<pre>"+c+"</pre>";e=1}k=b.document.createElement(k);k.setHtml("a"+c);c=k.getHtml().substr(1);c=c.replace(RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");e&&(c=c.replace(/^<pre>|<\/pre>$/gi,""));c=c.replace(C,"$1$2");c=A(c);c=y(c);k=a.fixForBody===false?false:d(a.enterMode,b.config.autoParagraph);c=CKEDITOR.htmlParser.fragment.fromHtml(c,a.context,k);if(k){e=c;
296
296
  if(!e.children.length&&CKEDITOR.dtd[e.name][k]){k=new CKEDITOR.htmlParser.element(k);e.add(k)}}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(f.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=
297
- s(b)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(c=c.replace(/^<br *\/?>/i,""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,d(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(f.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=
298
- a.data.dataValue,d=f.writer;d.reset();c.writeChildrenHtml(d);c=d.getHtml(true);c=z(c);c=o(c,b);a.data.dataValue=c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,b,c,d){var k=this.editor,e,f,g,m;if(b&&typeof b=="object"){e=b.context;c=b.fixForBody;d=b.dontFilter;f=b.filter;g=b.enterMode;m=b.protectedWhitespaces}else e=b;!e&&e!==null&&(e=k.editable().getName());return k.fire("toHtml",{dataValue:a,context:e,fixForBody:c,dontFilter:d,filter:f||k.filter,enterMode:g||k.enterMode,
299
- protectedWhitespaces:m}).dataValue},toDataFormat:function(a,b){var c,d,k;if(b){c=b.context;d=b.filter;k=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:k||this.editor.enterMode}).dataValue}};var t=/(?:&nbsp;|\xa0)$/,x="{cke_protected}",u=CKEDITOR.dtd,C=["caption","colgroup","col","thead","tfoot","tbody"],l=CKEDITOR.tools.extend({},u.$blockLimit,u.$block),q={elements:{input:i,textarea:i}},
297
+ r(b)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(c=c.replace(/^<br *\/?>/i,""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,d(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(f.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=
298
+ a.data.dataValue,d=f.writer;d.reset();c.writeChildrenHtml(d);c=d.getHtml(true);c=y(c);c=o(c,b);a.data.dataValue=c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,b,c,d){var k=this.editor,e,f,g,m;if(b&&typeof b=="object"){e=b.context;c=b.fixForBody;d=b.dontFilter;f=b.filter;g=b.enterMode;m=b.protectedWhitespaces}else e=b;!e&&e!==null&&(e=k.editable().getName());return k.fire("toHtml",{dataValue:a,context:e,fixForBody:c,dontFilter:d,filter:f||k.filter,enterMode:g||k.enterMode,
299
+ protectedWhitespaces:m}).dataValue},toDataFormat:function(a,b){var c,d,k;if(b){c=b.context;d=b.filter;k=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:k||this.editor.enterMode}).dataValue}};var t=/(?:&nbsp;|\xa0)$/,w="{cke_protected}",v=CKEDITOR.dtd,B=["caption","colgroup","col","thead","tfoot","tbody"],l=CKEDITOR.tools.extend({},v.$blockLimit,v.$block),s={elements:{input:i,textarea:i}},
300
300
  k={attributeNames:[[/^on/,"data-cke-pa-on"],[/^data-cke-expando$/,""]]},m={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}}},F={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=
301
- a.attributes;if(b){if(b["data-cke-temp"])return false;for(var c=["name","href","src"],d,k=0;k<c.length;k++){d="data-cke-saved-"+c[k];d in b&&delete b[c[k]]}}return a},table:function(a){a.children.slice(0).sort(function(a,b){var c,d;if(a.type==CKEDITOR.NODE_ELEMENT&&b.type==a.type){c=CKEDITOR.tools.indexOf(C,a.name);d=CKEDITOR.tools.indexOf(C,b.name)}if(!(c>-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},
301
+ a.attributes;if(b){if(b["data-cke-temp"])return false;for(var c=["name","href","src"],d,k=0;k<c.length;k++){d="data-cke-saved-"+c[k];d in b&&delete b[c[k]]}}return a},table:function(a){a.children.slice(0).sort(function(a,b){var c,d;if(a.type==CKEDITOR.NODE_ELEMENT&&b.type==a.type){c=CKEDITOR.tools.indexOf(B,a.name);d=CKEDITOR.tools.indexOf(B,b.name)}if(!(c>-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},
302
302
  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&&h(a,b=new CKEDITOR.htmlParser.text);b.value=a.attributes["data-cke-title"]||
303
- ""},input:j,textarea:j},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||false}}};if(CKEDITOR.env.ie)F.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})};var w=/<(a|area|img|input|source)\b([^>]*)>/gi,H=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,A=/^(href|src|name)$/i,K=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,E=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,
304
- r=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,J=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,D=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,y=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi})();"use strict";
303
+ ""},input:j,textarea:j},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||false}}};if(CKEDITOR.env.ie)F.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})};var p=/<(a|area|img|input|source)\b([^>]*)>/gi,I=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,z=/^(href|src|name)$/i,L=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,E=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,
304
+ u=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,K=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,C=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,x=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi})();"use strict";
305
305
  CKEDITOR.htmlParser.element=function(a,d){this.name=a;this.attributes=d||{};this.children=[];var b=a||"",c=b.match(/^cke:(.*)/);c&&(b=c[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}};
306
306
  CKEDITOR.htmlParser.cssStyle=function(a){var d={};((a instanceof CKEDITOR.htmlParser.element?a.attributes.style:a)||"").replace(/&quot;/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,c,e){c=="font-family"&&(e=e.replace(/["']/g,""));d[c.toLowerCase()]=e});return{rules:d,populate:function(a){var c=this.toString();if(c)a instanceof CKEDITOR.dom.element?a.setAttribute("style",c):a instanceof CKEDITOR.htmlParser.element?a.attributes.style=c:a.style=c},toString:function(){var a=[],c;
307
307
  for(c in d)d[c]&&a.push(c,":",d[c],";");return a.join("")}}};
@@ -330,145 +330,146 @@ a=="wysiwyg"&&d.fire("saveSnapshot");setTimeout(function(){d.fire("mode");b&&b.c
330
330
  0),b=d?b+g:b;j.setStyle("height",i+"px");n&&(n.style.width="100%");this.fire("resize",{outerHeight:b,contentsHeight:i,outerWidth:a||h.getSize("width")})};CKEDITOR.editor.prototype.getResizable=function(a){return a?this.ui.space("contents"):this.container};CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&CKEDITOR.replaceAll(CKEDITOR.replaceClass)})})();CKEDITOR.config.startupMode="wysiwyg";
331
331
  (function(){var a,d,b,c;function e(a){var b=a.editor,c=a.data.path,d=c.blockLimit,e=a.data.selection,h=e.getRanges()[0],l;if(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)if(e=f(e,c)){e.appendBogus();l=CKEDITOR.env.ie}if(g(b,c.block,d)&&h.collapsed&&!h.getCommonAncestor().isReadOnly()){c=h.clone();c.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);d=new CKEDITOR.dom.walker(c);d.guard=function(a){return!i(a)||a.type==CKEDITOR.NODE_COMMENT||a.isReadOnly()};if(!d.checkForward()||c.checkStartOfBlock()&&
332
332
  c.checkEndOfBlock()){b=h.fixBlock(true,b.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p");if(!CKEDITOR.env.needsBrFiller)(b=b.getFirst(i))&&(b.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(b.getText()).match(/^(?:&nbsp;|\xa0)$/))&&b.remove();l=1;a.cancel()}}l&&h.select()}function f(a,b){if(a.isFake)return 0;var c=b.block||b.blockLimit,d=c&&c.getLast(i);if(c&&c.isBlockBoundary()&&(!d||!(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()))&&!c.is("pre")&&!c.getBogus())return c}function h(a){var b=a.data.getTarget();
333
- if(b.is("input")){b=b.getAttribute("type");(b=="submit"||b=="reset")&&a.data.preventDefault()}}function i(a){return o(a)&&p(a)}function j(a,b){return function(c){var d=c.data.$.toElement||c.data.$.fromElement||c.data.$.relatedTarget,d=d&&d.nodeType==CKEDITOR.NODE_ELEMENT?new CKEDITOR.dom.element(d):null;(!d||!b.equals(d)&&!b.contains(d))&&a.call(this,c)}}function n(a){function b(a){return function(b,d){d&&(b.type==CKEDITOR.NODE_ELEMENT&&b.is(e))&&(c=b);if(!d&&i(b)&&(!a||!x(b)))return false}}var c,
334
- d=a.getRanges()[0],a=a.root,e={table:1,ul:1,ol:1,dl:1};if(d.startPath().contains(e)){var g=d.clone();g.collapse(1);g.setStartAt(a,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(g);a.guard=b();a.checkBackward();if(c){g=d.clone();g.collapse();g.setEndAt(c,CKEDITOR.POSITION_AFTER_END);a=new CKEDITOR.dom.walker(g);a.guard=b(true);c=false;a.checkForward();return c}}return null}function g(a,b,c){return a.config.autoParagraph!==false&&a.activeEnterMode!=CKEDITOR.ENTER_BR&&a.editable().equals(c)&&
335
- !b||b&&b.getAttribute("contenteditable")=="true"}function B(a){return a.activeEnterMode!=CKEDITOR.ENTER_BR&&a.config.autoParagraph!==false?a.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p":false}function s(a){var b=a.editor;b.getSelection().scrollIntoView();setTimeout(function(){b.fire("saveSnapshot")},0)}function z(a,b,c){for(var d=a.getCommonAncestor(b),b=a=c?b:a;(a=a.getParent())&&!d.equals(a)&&a.getChildCount()==1;)b=a;b.remove()}CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,
333
+ if(b.is("input")){b=b.getAttribute("type");(b=="submit"||b=="reset")&&a.data.preventDefault()}}function i(a){return o(a)&&q(a)}function j(a,b){return function(c){var d=c.data.$.toElement||c.data.$.fromElement||c.data.$.relatedTarget,d=d&&d.nodeType==CKEDITOR.NODE_ELEMENT?new CKEDITOR.dom.element(d):null;(!d||!b.equals(d)&&!b.contains(d))&&a.call(this,c)}}function n(a){function b(a){return function(b,d){d&&(b.type==CKEDITOR.NODE_ELEMENT&&b.is(e))&&(c=b);if(!d&&i(b)&&(!a||!w(b)))return false}}var c,
334
+ d=a.getRanges()[0],a=a.root,e={table:1,ul:1,ol:1,dl:1};if(d.startPath().contains(e)){var g=d.clone();g.collapse(1);g.setStartAt(a,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(g);a.guard=b();a.checkBackward();if(c){g=d.clone();g.collapse();g.setEndAt(c,CKEDITOR.POSITION_AFTER_END);a=new CKEDITOR.dom.walker(g);a.guard=b(true);c=false;a.checkForward();return c}}return null}function g(a,b,c){return a.config.autoParagraph!==false&&a.activeEnterMode!=CKEDITOR.ENTER_BR&&(a.editable().equals(c)&&
335
+ !b||b&&b.getAttribute("contenteditable")=="true")}function A(a){return a.activeEnterMode!=CKEDITOR.ENTER_BR&&a.config.autoParagraph!==false?a.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p":false}function r(a){var b=a.editor;b.getSelection().scrollIntoView();setTimeout(function(){b.fire("saveSnapshot")},0)}function y(a,b,c){for(var d=a.getCommonAncestor(b),b=a=c?b:a;(a=a.getParent())&&!d.equals(a)&&a.getChildCount()==1;)b=a;b.remove()}CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,
336
336
  $:function(a,b){this.base(b.$||b);this.editor=a;this.status="unloaded";this.hasFocus=false;this.setup()},proto:{focus:function(){var a;if(CKEDITOR.env.webkit&&!this.hasFocus){a=this.editor._.previousActive||this.getDocument().getActive();if(this.contains(a)){a.focus();return}}try{this.$[CKEDITOR.env.ie&&this.getDocument().equals(CKEDITOR.document)?"setActive":"focus"]()}catch(b){if(!CKEDITOR.env.ie)throw b;}if(CKEDITOR.env.safari&&!this.isInline()){a=CKEDITOR.document.getActive();a.equals(this.getWindow().getFrame())||
337
337
  this.getWindow().focus()}},on:function(a,b){var c=Array.prototype.slice.call(arguments,0);if(CKEDITOR.env.ie&&/^focus|blur$/.exec(a)){a=a=="focus"?"focusin":"focusout";b=j(b,this);c[0]=a;c[1]=b}return CKEDITOR.dom.element.prototype.on.apply(this,c)},attachListener:function(a){!this._.listeners&&(this._.listeners=[]);var b=Array.prototype.slice.call(arguments,1),b=a.on.apply(a,b);this._.listeners.push(b);return b},clearListeners:function(){var a=this._.listeners;try{for(;a.length;)a.pop().removeListener()}catch(b){}},
338
338
  restoreAttrs:function(){var a=this._.attrChanges,b,c;for(c in a)if(a.hasOwnProperty(c)){b=a[c];b!==null?this.setAttribute(c,b):this.removeAttribute(c)}},attachClass:function(a){var b=this.getCustomData("classes");if(!this.hasClass(a)){!b&&(b=[]);b.push(a);this.setCustomData("classes",b);this.addClass(a)}},changeAttr:function(a,b){var c=this.getAttribute(a);if(b!==c){!this._.attrChanges&&(this._.attrChanges={});a in this._.attrChanges||(this._.attrChanges[a]=c);this.setAttribute(a,b)}},insertText:function(a){this.editor.focus();
339
- this.insertHtml(this.transformPlainTextToHtml(a),"text")},transformPlainTextToHtml:function(a){var b=this.editor.getSelection().getStartElement().hasAscendant("pre",true)?CKEDITOR.ENTER_BR:this.editor.activeEnterMode;return CKEDITOR.tools.transformPlainTextToHtml(a,b)},insertHtml:function(a,b,c){var d=this.editor;d.focus();d.fire("saveSnapshot");c||(c=d.getSelection().getRanges()[0]);C(this,b||"html",a,c);c.select();s(this);this.editor.fire("afterInsertHtml",{})},insertHtmlIntoRange:function(a,b,
340
- c){C(this,c||"html",a,b);this.editor.fire("afterInsertHtml",{intoRange:b})},insertElement:function(a,b){var c=this.editor;c.focus();c.fire("saveSnapshot");var d=c.activeEnterMode,c=c.getSelection(),e=a.getName(),e=CKEDITOR.dtd.$block[e];b||(b=c.getRanges()[0]);if(this.insertElementIntoRange(a,b)){b.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);if(e)if((e=a.getNext(function(a){return i(a)&&!x(a)}))&&e.type==CKEDITOR.NODE_ELEMENT&&e.is(CKEDITOR.dtd.$block))e.getDtd()["#"]?b.moveToElementEditStart(e):
341
- b.moveToElementEditEnd(a);else if(!e&&d!=CKEDITOR.ENTER_BR){e=b.fixBlock(true,d==CKEDITOR.ENTER_DIV?"div":"p");b.moveToElementEditStart(e)}}c.selectRanges([b]);s(this)},insertElementIntoSelection:function(a){this.insertElement(a)},insertElementIntoRange:function(a,b){var c=this.editor,d=c.config.enterMode,e=a.getName(),g=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})&&
339
+ this.insertHtml(this.transformPlainTextToHtml(a),"text")},transformPlainTextToHtml:function(a){var b=this.editor.getSelection().getStartElement().hasAscendant("pre",true)?CKEDITOR.ENTER_BR:this.editor.activeEnterMode;return CKEDITOR.tools.transformPlainTextToHtml(a,b)},insertHtml:function(a,b,c){var d=this.editor;d.focus();d.fire("saveSnapshot");c||(c=d.getSelection().getRanges()[0]);B(this,b||"html",a,c);c.select();r(this);this.editor.fire("afterInsertHtml",{})},insertHtmlIntoRange:function(a,b,
340
+ c){B(this,c||"html",a,b);this.editor.fire("afterInsertHtml",{intoRange:b})},insertElement:function(a,b){var c=this.editor;c.focus();c.fire("saveSnapshot");var d=c.activeEnterMode,c=c.getSelection(),e=a.getName(),e=CKEDITOR.dtd.$block[e];b||(b=c.getRanges()[0]);if(this.insertElementIntoRange(a,b)){b.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);if(e)if((e=a.getNext(function(a){return i(a)&&!w(a)}))&&e.type==CKEDITOR.NODE_ELEMENT&&e.is(CKEDITOR.dtd.$block))e.getDtd()["#"]?b.moveToElementEditStart(e):
341
+ b.moveToElementEditEnd(a);else if(!e&&d!=CKEDITOR.ENTER_BR){e=b.fixBlock(true,d==CKEDITOR.ENTER_DIV?"div":"p");b.moveToElementEditStart(e)}}c.selectRanges([b]);r(this)},insertElementIntoSelection:function(a){this.insertElement(a)},insertElementIntoRange:function(a,b){var c=this.editor,d=c.config.enterMode,e=a.getName(),g=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})&&
342
342
  l(b);var f,h;if(g)for(;(f=b.getCommonAncestor(0,1))&&(h=CKEDITOR.dtd[f.getName()])&&(!h||!h[e]);)if(f.getName()in CKEDITOR.dtd.span)b.splitElement(f);else if(b.checkStartOfBlock()&&b.checkEndOfBlock()){b.setStartBefore(f);b.collapse(true);f.remove()}else b.splitBlock(d==CKEDITOR.ENTER_DIV?"div":"p",c.editable());b.insertNode(a);return true},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")},
343
343
  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==
344
344
  c.$)e=true;else if(CKEDITOR.env.webkit){var k=c.getDocument().getActive();k&&(k.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;
345
345
  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)},getHtmlFromRange:function(e){if(e.collapsed)return new CKEDITOR.dom.documentFragment(e.document);e={doc:this.getDocument(),range:e.clone()};a.detect(e,this);d.exclude(e);b.shrink(e);e.fragment=
346
- e.range.cloneContents();c.rebuild(e,this);a.fix(e,this);return new CKEDITOR.dom.documentFragment(e.fragment.$)},extractHtmlFromRange:function(a,b){var c=q,d={range:a,doc:a.document},e=this.getHtmlFromRange(a);if(a.collapsed){a.optimize();return e}a.enlarge(CKEDITOR.ENLARGE_INLINE,1);c.table.detectPurge(d);d.bookmark=a.createBookmark();delete d.range;var g=this.editor.createRange();g.moveToPosition(d.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);d.targetBookmark=g.createBookmark();c.list.detectMerge(d,
347
- this);c.table.detectRanges(d,this);c.block.detectMerge(d,this);if(d.tableContentsRanges){c.table.deleteRanges(d);a.moveToBookmark(d.bookmark);d.range=a}else{a.moveToBookmark(d.bookmark);d.range=a;a.extractContents(c.detectExtractMerge(d))}a.moveToBookmark(d.targetBookmark);a.optimize();c.fixUneditableRangePosition(a);c.list.merge(d,this);c.table.purge(d,this);c.block.merge(d,this);if(b){c=a.startPath();if(a.checkStartOfBlock()&&a.checkEndOfBlock()&&c.block&&!a.root.equals(c.block)){a.moveToPosition(c.block,
348
- CKEDITOR.POSITION_BEFORE_START);c.block.remove()}}else{c.autoParagraph(this.editor,a);t(a.startContainer)&&a.startContainer.appendBogus()}a.startContainer.mergeSiblings();return e},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(u,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,
349
- "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,a.data.range)},this);this.attachListener(a,"insertElement",function(a){this.insertElement(a.data)},this);this.attachListener(a,"insertText",
350
- function(a){this.insertText(a.data)},this);this.setReadOnly(a.readOnly);this.attachClass("cke_editable");a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?this.attachClass("cke_editable_inline"):(a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE||a.elementMode==CKEDITOR.ELEMENT_MODE_APPENDTO)&&this.attachClass("cke_editable_themed");this.attachClass("cke_contents_"+a.config.contentsLangDirection);a.keystrokeHandler.blockedKeystrokes[8]=+a.readOnly;a.keystrokeHandler.attach(this);this.on("blur",function(){this.hasFocus=
351
- 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 c=a.config.contentsLangDirection;this.getDirection(1)!=
352
- c&&this.changeAttr("dir",c);var d=CKEDITOR.getCss();if(d){c=b.getHead();if(!c.getCustomData("stylesheet")){d=b.appendStyleText(d);d=new CKEDITOR.dom.element(d.ownerNode||d.owningElement);c.setCustomData("stylesheet",d);d.data("cke-temp",1)}}c=b.getCustomData("stylesheet_ref")||0;b.setCustomData("stylesheet_ref",c+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");
353
- b&&(a.$.button!=2&&b.isReadOnly())&&a.preventDefault()});var e={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 e){var b=a.getSelection(),g,f=b.getRanges()[0],h=f.startPath(),m,l,w,c=c==8;if(CKEDITOR.env.ie&&CKEDITOR.env.version<11&&(g=b.getSelectedElement())||(g=n(b))){a.fire("saveSnapshot");f.moveToPosition(g,CKEDITOR.POSITION_BEFORE_START);g.remove();f.select();a.fire("saveSnapshot");d=1}else if(f.collapsed)if((m=h.block)&&(w=
354
- m[c?"getPrevious":"getNext"](o))&&w.type==CKEDITOR.NODE_ELEMENT&&w.is("table")&&f[c?"checkStartOfBlock":"checkEndOfBlock"]()){a.fire("saveSnapshot");f[c?"checkEndOfBlock":"checkStartOfBlock"]()&&m.remove();f["moveToElementEdit"+(c?"End":"Start")](w);f.select();a.fire("saveSnapshot");d=1}else if(h.blockLimit&&h.blockLimit.is("td")&&(l=h.blockLimit.getAscendant("table"))&&f.checkBoundaryOfElement(l,c?CKEDITOR.START:CKEDITOR.END)&&(w=l[c?"getPrevious":"getNext"](o))){a.fire("saveSnapshot");f["moveToElementEdit"+
355
- (c?"End":"Start")](w);f.checkStartOfBlock()&&f.checkEndOfBlock()?w.remove():f.select();a.fire("saveSnapshot");d=1}else if((l=h.contains(["td","th","caption"]))&&f.checkBoundaryOfElement(l,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 e&&!this.getFirst(i)){this.appendBogus();b=a.createRange();b.moveToPosition(this,CKEDITOR.POSITION_AFTER_START);b.select()}});this.attachListener(this,
356
- "dblclick",function(b){if(a.readOnly)return false;b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this,"click",h);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=
357
- b.data.getTarget();if(!b.getOuterHtml().replace(u,"")){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 e){var c=
358
- b==8,d=a.getSelection().getRanges()[0],b=d.startPath();if(d.collapsed){var g;a:{var f=b.block;if(f)if(d[c?"checkStartOfBlock":"checkEndOfBlock"]())if(!d.moveToClosestEditablePosition(f,!c)||!d.collapsed)g=false;else{if(d.startContainer.type==CKEDITOR.NODE_ELEMENT){var h=d.startContainer.getChild(d.startOffset-(c?1:0));if(h&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("hr")){a.fire("saveSnapshot");h.remove();g=true;break a}}if((d=d.startPath().block)&&(!d||!d.contains(f))){a.fire("saveSnapshot");var m;(m=
359
- (c?d:f).getBogus())&&m.remove();g=a.getSelection();m=g.createBookmarks();(c?f:d).moveChildren(c?d:f,false);b.lastElement.mergeSiblings();z(f,d,!c);g.selectBookmarks(m);g=true}}else g=false;else g=false}if(!g)return}else{c=d;g=b.block;m=c.endPath().block;if(!g||!m||g.equals(m))b=false;else{a.fire("saveSnapshot");(f=g.getBogus())&&f.remove();c.enlarge(CKEDITOR.ENLARGE_INLINE);c.deleteContents();if(m.getParent()){m.moveChildren(g,false);b.lastElement.mergeSiblings();z(g,m,true)}c=a.getSelection().getRanges()[0];
360
- c.collapse(1);c.optimize();c.startContainer.getHtml()===""&&c.startContainer.appendBogus();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=
361
- 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};CKEDITOR.on("instanceLoaded",function(a){var b=a.editor;b.on("insertElement",
362
- 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)}});b.on("selectionChange",function(a){if(!b.readOnly){var c=b.getSelection();if(c&&!c.isLocked){c=b.checkDirty();b.fire("lockSnapshot");e(a);b.fire("unlockSnapshot");!c&&b.resetDirty()}}})});CKEDITOR.on("instanceCreated",function(a){var b=a.editor;b.on("mode",
363
- 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('<span id="'+e+'" class="cke_voice_label">'+d+"</span>");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}");
364
- var o=CKEDITOR.dom.walker.whitespaces(true),p=CKEDITOR.dom.walker.bookmark(false,true),t=CKEDITOR.dom.walker.empty(),x=CKEDITOR.dom.walker.bogus(),u=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,C=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(c,d){var e,g,f,r,l=[],w=d.range.startContainer;e=d.range.startPath();for(var w=h[w.getName()],i=0,j=c.getChildren(),q=j.count(),A=-1,J=-1,H=0,F=e.contains(h.$list);i<
365
- q;++i){e=j.getItem(i);if(a(e)){f=e.getName();if(F&&f in CKEDITOR.dtd.$list)l=l.concat(b(e,d));else{r=!!w[f];if(f=="br"&&e.data("cke-eol")&&(!i||i==q-1)){H=(g=i?l[i-1].node:j.getItem(i+1))&&(!a(g)||!g.is("br"));g=g&&a(g)&&h.$block[g.getName()]}A==-1&&!r&&(A=i);r||(J=i);l.push({isElement:1,isLineBreak:H,isBlock:e.isBlockBoundary(),hasBlockSibling:g,node:e,name:f,allowed:r});g=H=0}}else l.push({isElement:0,node:e,allowed:1})}if(A>-1)l[A].firstNotAllowed=1;if(J>-1)l[J].lastNotAllowed=1;return l}function c(b,
366
- d){var e=[],g=b.getChildren(),f=g.count(),r,l=0,m=h[d],w=!b.is(h.$inline)||b.is("br");for(w&&e.push(" ");l<f;l++){r=g.getItem(l);a(r)&&!r.is(m)?e=e.concat(c(r,d)):e.push(r)}w&&e.push(" ");return e}function d(b){return b&&a(b)&&(b.is(h.$removeEmpty)||b.is("a")&&!b.isBlockBoundary())}function e(b,c,d,g){var f=b.clone(),h,r;f.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);if((h=(new CKEDITOR.dom.walker(f)).next())&&a(h)&&l[h.getName()]&&(r=h.getPrevious())&&a(r)&&!r.getParent().equals(b.startContainer)&&d.contains(r)&&
367
- g.contains(h)&&h.isIdentical(r)){h.moveChildren(r);h.remove();e(b,c,d,g)}}function f(b,c){function d(b,c){if(c.isBlock&&c.isElement&&!c.node.is("br")&&a(b)&&b.is("br")){b.remove();return 1}}var e=c.endContainer.getChild(c.endOffset),g=c.endContainer.getChild(c.endOffset-1);e&&d(e,b[b.length-1]);if(g&&d(g,b[0])){c.setEnd(c.endContainer,c.endOffset-1);c.collapse()}}var h=CKEDITOR.dtd,l={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},r={p:1,div:1,h1:1,h2:1,h3:1,h4:1,
368
- h5:1,h6:1},j=CKEDITOR.tools.extend({},h.$inline);delete j.br;return function(l,y,v,q){var n=l.editor,o=false;if(y=="unfiltered_html"){y="html";o=true}if(!q.checkReadOnly()){var E=(new CKEDITOR.dom.elementPath(q.startContainer,q.root)).blockLimit||q.root,l={type:y,dontFilter:o,editable:l,editor:n,range:q,blockLimit:E,mergeCandidates:[],zombies:[]},y=l.range,q=l.mergeCandidates,s,p;if(l.type=="text"&&y.shrink(CKEDITOR.SHRINK_ELEMENT,true,false)){s=CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>",
369
- y.document);y.insertNode(s);y.setStartAfter(s)}o=new CKEDITOR.dom.elementPath(y.startContainer);l.endPath=E=new CKEDITOR.dom.elementPath(y.endContainer);if(!y.collapsed){var n=E.block||E.blockLimit,z=y.getCommonAncestor();n&&(!n.equals(z)&&!n.contains(z)&&y.checkEndOfBlock())&&l.zombies.push(n);y.deleteContents()}for(;(p=a(y.startContainer)&&y.startContainer.getChild(y.startOffset-1))&&a(p)&&p.isBlockBoundary()&&o.contains(p);)y.moveToPosition(p,CKEDITOR.POSITION_BEFORE_END);e(y,l.blockLimit,o,E);
370
- if(s){y.setEndBefore(s);y.collapse();s.remove()}s=y.startPath();if(n=s.contains(d,false,1)){y.splitElement(n);l.inlineStylesRoot=n;l.inlineStylesPeak=s.lastElement}s=y.createBookmark();(n=s.startNode.getPrevious(i))&&a(n)&&d(n)&&q.push(n);(n=s.startNode.getNext(i))&&a(n)&&d(n)&&q.push(n);for(n=s.startNode;(n=n.getParent())&&d(n);)q.push(n);y.moveToBookmark(s);if(s=v){s=l.range;if(l.type=="text"&&l.inlineStylesRoot){p=l.inlineStylesPeak;y=p.getDocument().createText("{cke-peak}");for(q=l.inlineStylesRoot.getParent();!p.equals(q);){y=
371
- y.appendTo(p.clone());p=p.getParent()}v=y.getOuterHtml().split("{cke-peak}").join(v)}p=l.blockLimit.getName();if(/^\s+|\s+$/.test(v)&&"span"in CKEDITOR.dtd[p])var u='<span data-cke-marker="1">&nbsp;</span>',v=u+v+u;v=l.editor.dataProcessor.toHtml(v,{context:null,fixForBody:false,protectedWhitespaces:!!u,dontFilter:l.dontFilter,filter:l.editor.activeFilter,enterMode:l.editor.activeEnterMode});p=s.document.createElement("body");p.setHtml(v);if(u){p.getFirst().remove();p.getLast().remove()}if((u=s.startPath().block)&&
372
- !(u.getChildCount()==1&&u.getBogus()))a:{var t;if(p.getChildCount()==1&&a(t=p.getFirst())&&t.is(r)&&!t.hasAttribute("contenteditable")){u=t.getElementsByTag("*");s=0;for(q=u.count();s<q;s++){y=u.getItem(s);if(!y.is(j))break a}t.moveChildren(t.getParent(1));t.remove()}}l.dataWrapper=p;s=v}if(s){t=l.range;s=t.document;var G;p=l.blockLimit;var q=0,I,u=[],x,C,v=n=0,N,V,y=t.startContainer,o=l.endPath.elements[0],W,E=o.getPosition(y),z=!!o.getCommonAncestor(y)&&E!=CKEDITOR.POSITION_IDENTICAL&&!(E&CKEDITOR.POSITION_CONTAINS+
373
- CKEDITOR.POSITION_IS_CONTAINED),y=b(l.dataWrapper,l);for(f(y,t);q<y.length;q++){E=y[q];if(G=E.isLineBreak){G=t;N=p;var Q=void 0,S=void 0;if(E.hasBlockSibling)G=1;else{Q=G.startContainer.getAscendant(h.$block,1);if(!Q||!Q.is({div:1,p:1}))G=0;else{S=Q.getPosition(N);if(S==CKEDITOR.POSITION_IDENTICAL||S==CKEDITOR.POSITION_CONTAINS)G=0;else{N=G.splitElement(Q);G.moveToPosition(N,CKEDITOR.POSITION_AFTER_START);G=1}}}}if(G)v=q>0;else{G=t.startPath();if(!E.isBlock&&g(l.editor,G.block,G.blockLimit)&&(C=B(l.editor))){C=
374
- s.createElement(C);C.appendBogus();t.insertNode(C);CKEDITOR.env.needsBrFiller&&(I=C.getBogus())&&I.remove();t.moveToPosition(C,CKEDITOR.POSITION_BEFORE_END)}if((G=t.startPath().block)&&!G.equals(x)){if(I=G.getBogus()){I.remove();u.push(G)}x=G}E.firstNotAllowed&&(n=1);if(n&&E.isElement){G=t.startContainer;for(N=null;G&&!h[G.getName()][E.name];){if(G.equals(p)){G=null;break}N=G;G=G.getParent()}if(G){if(N){V=t.splitElement(N);l.zombies.push(V);l.zombies.push(N)}}else{N=p.getName();W=!q;G=q==y.length-
375
- 1;N=c(E.node,N);for(var Q=[],S=N.length,R=0,P=void 0,X=0,$=-1;R<S;R++){P=N[R];if(P==" "){if(!X&&(!W||R)){Q.push(new CKEDITOR.dom.text(" "));$=Q.length}X=1}else{Q.push(P);X=0}}G&&$==Q.length&&Q.pop();W=Q}}if(W){for(;G=W.pop();)t.insertNode(G);W=0}else t.insertNode(E.node);if(E.lastNotAllowed&&q<y.length-1){(V=z?o:V)&&t.setEndAt(V,CKEDITOR.POSITION_AFTER_START);n=0}t.collapse()}}if(y.length!=1)I=false;else{I=y[0];I=I.isElement&&I.node.getAttribute("contenteditable")=="false"}if(I){v=true;G=y[0].node;
376
- t.setStartAt(G,CKEDITOR.POSITION_BEFORE_START);t.setEndAt(G,CKEDITOR.POSITION_AFTER_END)}l.dontMoveCaret=v;l.bogusNeededBlocks=u}I=l.range;var Y;V=l.bogusNeededBlocks;for(W=I.createBookmark();x=l.zombies.pop();)if(x.getParent()){C=I.clone();C.moveToElementEditStart(x);C.removeEmptyBlocksAtEnd()}if(V)for(;x=V.pop();)CKEDITOR.env.needsBrFiller?x.appendBogus():x.append(I.document.createText(" "));for(;x=l.mergeCandidates.pop();)x.mergeSiblings();I.moveToBookmark(W);if(!l.dontMoveCaret){for(x=a(I.startContainer)&&
377
- I.startContainer.getChild(I.startOffset-1);x&&a(x)&&!x.is(h.$empty);){if(x.isBlockBoundary())I.moveToPosition(x,CKEDITOR.POSITION_BEFORE_END);else{if(d(x)&&x.getHtml().match(/(\s|&nbsp;)$/g)){Y=null;break}Y=I.clone();Y.moveToPosition(x,CKEDITOR.POSITION_BEFORE_END)}x=x.getLast(i)}Y&&I.moveToRange(Y)}}}}(),l=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return false;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$tableContent)};b.evaluator=function(a){return a.type==
378
- CKEDITOR.NODE_ELEMENT};return b}function b(a,c,d){c=a.getDocument().createElement(c);a.append(c,d);return c}function c(a){var b=a.count(),d;for(b;b-- >0;){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,g=e.getAscendant("table",1),f=false;c(g.getElementsByTag("td"));c(g.getElementsByTag("th"));g=d.clone();g.setStart(e,0);g=a(g).lastBackward();if(!g){g=
379
- d.clone();g.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);g=a(g).lastForward();f=true}g||(g=e);if(g.is("table")){d.setStartAt(g,CKEDITOR.POSITION_BEFORE_START);d.collapse(true);g.remove()}else{g.is({tbody:1,thead:1,tfoot:1})&&(g=b(g,"tr",f));g.is("tr")&&(g=b(g,g.getParent().is("thead")?"th":"td",f));(e=g.getBogus())&&e.remove();d.moveToPosition(g,f?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END)}}}();a={detect:function(a,b){var c=a.range,d=c.clone(),e=c.clone(),g=new CKEDITOR.dom.elementPath(c.startContainer,
380
- b),f=new CKEDITOR.dom.elementPath(c.endContainer,b);d.collapse(1);e.collapse();if(g.block&&d.checkBoundaryOfElement(g.block,CKEDITOR.END)){c.setStartAfter(g.block);a.prependEolBr=1}if(f.block&&e.checkBoundaryOfElement(f.block,CKEDITOR.START)){c.setEndBefore(f.block);a.appendEolBr=1}},fix:function(a,b){var c=b.getDocument(),d;if(a.appendEolBr){d=this.createEolBr(c);a.fragment.append(d)}a.prependEolBr&&(!d||d.getPrevious())&&a.fragment.append(this.createEolBr(c),1)},createEolBr:function(a){return a.createElement("br",
381
- {attributes:{"data-cke-eol":1}})}};d={exclude:function(a){var b=a.range.getBoundaryNodes(),c=b.startNode;(b=b.endNode)&&(x(b)&&(!c||!c.equals(b)))&&a.range.setEndBefore(b)}};c={rebuild:function(a,b){var c=a.range,d=c.getCommonAncestor(),e=new CKEDITOR.dom.elementPath(d,b),g=new CKEDITOR.dom.elementPath(c.startContainer,b),c=new CKEDITOR.dom.elementPath(c.endContainer,b),f;d.type==CKEDITOR.NODE_TEXT&&(d=d.getParent());if(e.blockLimit.is({tr:1,table:1})){var h=e.contains("table").getParent();f=function(a){return!a.equals(h)}}else if(e.block&&
382
- e.block.is(CKEDITOR.dtd.$listItem)){g=g.contains(CKEDITOR.dtd.$list);c=c.contains(CKEDITOR.dtd.$list);if(!g.equals(c)){var r=e.contains(CKEDITOR.dtd.$list).getParent();f=function(a){return!a.equals(r)}}}f||(f=function(a){return!a.equals(e.block)&&!a.equals(e.blockLimit)});this.rebuildFragment(a,b,d,f)},rebuildFragment:function(a,b,c,d){for(var e;c&&!c.equals(b)&&d(c);){e=c.clone(0,1);a.fragment.appendTo(e);a.fragment=e;c=c.getParent()}}};b={shrink:function(a){var a=a.range,b=a.startContainer,c=a.endContainer,
383
- d=a.startOffset,e=a.endOffset;b.type==CKEDITOR.NODE_ELEMENT&&(b.equals(c)&&b.is("tr")&&++d==e)&&a.shrink(CKEDITOR.SHRINK_TEXT)}};var q=function(){function a(b,c){var d=b.getParent();if(d.is(CKEDITOR.dtd.$inline))b[c?"insertBefore":"insertAfter"](d)}function b(c,d,e){a(d);a(e,1);for(var g;g=e.getNext();){g.insertAfter(d);d=g}t(c)&&c.remove()}function c(a,b){var d=new CKEDITOR.dom.range(a);d.setStartAfter(b.startNode);d.setEndBefore(b.endNode);return d}return{list:{detectMerge:function(a,b){var d=c(b,
384
- a.bookmark),e=d.startPath(),g=d.endPath(),f=e.contains(CKEDITOR.dtd.$list),h=g.contains(CKEDITOR.dtd.$list);a.mergeList=f&&h&&f.getParent().equals(h.getParent())&&!f.equals(h);a.mergeListItems=e.block&&g.block&&e.block.is(CKEDITOR.dtd.$listItem)&&g.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList||a.mergeListItems){d=d.clone();d.setStartBefore(a.bookmark.startNode);d.setEndAfter(a.bookmark.endNode);a.mergeListBookmark=d.createBookmark()}},merge:function(a,c){if(a.mergeListBookmark){var d=a.mergeListBookmark.startNode,
385
- e=a.mergeListBookmark.endNode,g=new CKEDITOR.dom.elementPath(d,c),f=new CKEDITOR.dom.elementPath(e,c);if(a.mergeList){var h=g.contains(CKEDITOR.dtd.$list),k=f.contains(CKEDITOR.dtd.$list);if(!h.equals(k)){k.moveChildren(h);k.remove()}}if(a.mergeListItems){g=g.contains(CKEDITOR.dtd.$listItem);f=f.contains(CKEDITOR.dtd.$listItem);g.equals(f)||b(f,d,e)}d.remove();e.remove()}}},block:{detectMerge:function(a,b){if(!a.tableContentsRanges&&!a.mergeListBookmark){var c=new CKEDITOR.dom.range(b);c.setStartBefore(a.bookmark.startNode);
386
- c.setEndAfter(a.bookmark.endNode);a.mergeBlockBookmark=c.createBookmark()}},merge:function(a,c){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var d=a.mergeBlockBookmark.startNode,e=a.mergeBlockBookmark.endNode,g=new CKEDITOR.dom.elementPath(d,c),f=new CKEDITOR.dom.elementPath(e,c),g=g.block,f=f.block;g&&(f&&!g.equals(f))&&b(f,d,e);d.remove();e.remove()}}},table:function(){function a(c){var e=[],g,f=new CKEDITOR.dom.walker(c),h=c.startPath().contains(d),k=c.endPath().contains(d),l={};f.guard=function(a,
387
- f){if(a.type==CKEDITOR.NODE_ELEMENT){var m="visited_"+(f?"out":"in");if(a.getCustomData(m))return;CKEDITOR.dom.element.setMarker(l,a,m,1)}if(f&&h&&a.equals(h)){g=c.clone();g.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);e.push(g)}else if(!f&&k&&a.equals(k)){g=c.clone();g.setStartAt(k,CKEDITOR.POSITION_AFTER_START);e.push(g)}else if(!f&&a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&(!h||b(a,h))&&(!k||b(a,k))){g=c.clone();g.selectNodeContents(a);e.push(g)}};f.lastForward();CKEDITOR.dom.element.clearAllMarkers(l);
388
- return e}function b(a,c){var d=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,e=a.getPosition(c);return e===CKEDITOR.POSITION_IDENTICAL?false:(e&d)===0}var d={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),e=0;c.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&++e};c.checkForward();if(e>1){var c=b.startPath().contains("table"),g=b.endPath().contains("table");if(c&&g&&b.checkBoundaryOfElement(c,
389
- CKEDITOR.START)&&b.checkBoundaryOfElement(g,CKEDITOR.END)){b=a.range.clone();b.setStartBefore(c);b.setEndAfter(g);a.purgeTableBookmark=b.createBookmark()}}},detectRanges:function(e,g){var f=c(g,e.bookmark),h=f.clone(),k,l,m=f.getCommonAncestor();m.is(CKEDITOR.dtd.$tableContent)&&!m.is(d)&&(m=m.getAscendant("table",true));l=m;m=new CKEDITOR.dom.elementPath(f.startContainer,l);l=new CKEDITOR.dom.elementPath(f.endContainer,l);m=m.contains("table");l=l.contains("table");if(m||l){if(m&&l&&b(m,l)){e.tableSurroundingRange=
390
- h;h.setStartAt(m,CKEDITOR.POSITION_AFTER_END);h.setEndAt(l,CKEDITOR.POSITION_BEFORE_START);h=f.clone();h.setEndAt(m,CKEDITOR.POSITION_AFTER_END);k=f.clone();k.setStartAt(l,CKEDITOR.POSITION_BEFORE_START);k=a(h).concat(a(k))}else if(m){if(!l){e.tableSurroundingRange=h;h.setStartAt(m,CKEDITOR.POSITION_AFTER_END);f.setEndAt(m,CKEDITOR.POSITION_AFTER_END)}}else{e.tableSurroundingRange=h;h.setEndAt(l,CKEDITOR.POSITION_BEFORE_START);f.setStartAt(l,CKEDITOR.POSITION_AFTER_START)}e.tableContentsRanges=k?
391
- k:a(f)}},deleteRanges:function(a){for(var b;b=a.tableContentsRanges.pop();){b.extractContents();t(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)&&
392
- 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=B(a))){d=b.document.createElement(d);d.appendBogus();b.insertNode(d);b.moveToPosition(d,CKEDITOR.POSITION_AFTER_START)}}}}()})();
393
- (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 d(){o=true;if(!z){b.call(this);z=CKEDITOR.tools.setTimeout(b,
394
- 200,this)}}function b(){z=null;if(o){CKEDITOR.tools.setTimeout(a,0,this);o=false}}function c(a){return p(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?true:false}function e(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 d=a.startContainer,e=a.getPreviousNode(c,null,d),g=a.getNextNode(c,null,d);return b(e)||b(g,1)||!e&&!g&&!(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()&&
346
+ e.range.cloneContents();c.rebuild(e,this);a.fix(e,this);return new CKEDITOR.dom.documentFragment(e.fragment.$)},extractHtmlFromRange:function(a,b){var c=s,d={range:a,doc:a.document},e=this.getHtmlFromRange(a);if(a.collapsed){a.optimize();return e}a.enlarge(CKEDITOR.ENLARGE_INLINE,1);c.table.detectPurge(d);d.bookmark=a.createBookmark();delete d.range;var g=this.editor.createRange();g.moveToPosition(d.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);d.targetBookmark=g.createBookmark();c.list.detectMerge(d,
347
+ this);c.table.detectRanges(d,this);c.block.detectMerge(d,this);if(d.tableContentsRanges){c.table.deleteRanges(d);a.moveToBookmark(d.bookmark);d.range=a}else{a.moveToBookmark(d.bookmark);d.range=a;a.extractContents(c.detectExtractMerge(d))}a.moveToBookmark(d.targetBookmark);a.optimize();c.fixUneditableRangePosition(a);c.list.merge(d,this);c.table.purge(d,this);c.block.merge(d,this);if(b){c=a.startPath();if(d=a.checkStartOfBlock())if(d=a.checkEndOfBlock())if(d=c.block)if(d=!a.root.equals(c.block)){a:{var d=
348
+ c.block.getElementsByTag("span"),g=0,f;if(d)for(;f=d.getItem(g++);)if(!q(f)){d=true;break a}d=false}d=!d}if(d){a.moveToPosition(c.block,CKEDITOR.POSITION_BEFORE_START);c.block.remove()}}else{c.autoParagraph(this.editor,a);t(a.startContainer)&&a.startContainer.appendBogus()}a.startContainer.mergeSiblings();return e},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(v,function(a,
349
+ 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,
350
+ a.data.range)},this);this.attachListener(a,"insertElement",function(a){this.insertElement(a.data)},this);this.attachListener(a,"insertText",function(a){this.insertText(a.data)},this);this.setReadOnly(a.readOnly);this.attachClass("cke_editable");a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?this.attachClass("cke_editable_inline"):(a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE||a.elementMode==CKEDITOR.ELEMENT_MODE_APPENDTO)&&this.attachClass("cke_editable_themed");this.attachClass("cke_contents_"+a.config.contentsLangDirection);
351
+ 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=
352
+ a.document;this.changeAttr("spellcheck",!a.config.disableNativeSpellChecker);var c=a.config.contentsLangDirection;this.getDirection(1)!=c&&this.changeAttr("dir",c);var d=CKEDITOR.getCss();if(d){c=b.getHead();if(!c.getCustomData("stylesheet")){d=b.appendStyleText(d);d=new CKEDITOR.dom.element(d.ownerNode||d.owningElement);c.setCustomData("stylesheet",d);d.data("cke-temp",1)}}c=b.getCustomData("stylesheet_ref")||0;b.setCustomData("stylesheet_ref",c+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);
353
+ 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 e={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 e){var b=a.getSelection(),g,f=b.getRanges()[0],h=f.startPath(),m,p,l,c=c==8;if(CKEDITOR.env.ie&&CKEDITOR.env.version<11&&(g=b.getSelectedElement())||(g=n(b))){a.fire("saveSnapshot");f.moveToPosition(g,
354
+ CKEDITOR.POSITION_BEFORE_START);g.remove();f.select();a.fire("saveSnapshot");d=1}else if(f.collapsed)if((m=h.block)&&(l=m[c?"getPrevious":"getNext"](o))&&l.type==CKEDITOR.NODE_ELEMENT&&l.is("table")&&f[c?"checkStartOfBlock":"checkEndOfBlock"]()){a.fire("saveSnapshot");f[c?"checkEndOfBlock":"checkStartOfBlock"]()&&m.remove();f["moveToElementEdit"+(c?"End":"Start")](l);f.select();a.fire("saveSnapshot");d=1}else if(h.blockLimit&&h.blockLimit.is("td")&&(p=h.blockLimit.getAscendant("table"))&&f.checkBoundaryOfElement(p,
355
+ c?CKEDITOR.START:CKEDITOR.END)&&(l=p[c?"getPrevious":"getNext"](o))){a.fire("saveSnapshot");f["moveToElementEdit"+(c?"End":"Start")](l);f.checkStartOfBlock()&&f.checkEndOfBlock()?l.remove():f.select();a.fire("saveSnapshot");d=1}else if((p=h.contains(["td","th","caption"]))&&f.checkBoundaryOfElement(p,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 e&&!this.getFirst(i)){this.appendBogus();
356
+ 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",h);(!CKEDITOR.env.ie||CKEDITOR.env.edge)&&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",
357
+ "select")&&b.data.preventDefault()}});CKEDITOR.env.edge&&this.attachListener(this,"mouseup",function(b){(b=b.data.getTarget())&&b.is("img")&&a.getSelection().selectElement(b)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(b.data.$.button==2){b=b.data.getTarget();if(!b.getOuterHtml().replace(v,"")){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")&&
358
+ 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 e){var c=b==8,d=a.getSelection().getRanges()[0],b=d.startPath();if(d.collapsed){var g;a:{var f=b.block;if(f)if(d[c?"checkStartOfBlock":"checkEndOfBlock"]())if(!d.moveToClosestEditablePosition(f,!c)||!d.collapsed)g=false;else{if(d.startContainer.type==
359
+ CKEDITOR.NODE_ELEMENT){var h=d.startContainer.getChild(d.startOffset-(c?1:0));if(h&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("hr")){a.fire("saveSnapshot");h.remove();g=true;break a}}if((d=d.startPath().block)&&(!d||!d.contains(f))){a.fire("saveSnapshot");var m;(m=(c?d:f).getBogus())&&m.remove();g=a.getSelection();m=g.createBookmarks();(c?f:d).moveChildren(c?d:f,false);b.lastElement.mergeSiblings();y(f,d,!c);g.selectBookmarks(m);g=true}}else g=false;else g=false}if(!g)return}else{c=d;g=b.block;m=c.endPath().block;
360
+ if(!g||!m||g.equals(m))b=false;else{a.fire("saveSnapshot");(f=g.getBogus())&&f.remove();c.enlarge(CKEDITOR.ENLARGE_INLINE);c.deleteContents();if(m.getParent()){m.moveChildren(g,false);b.lastElement.mergeSiblings();y(g,m,true)}c=a.getSelection().getRanges()[0];c.collapse(1);c.optimize();c.startContainer.getHtml()===""&&c.startContainer.appendBogus();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(),
361
+ 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=
362
+ 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};CKEDITOR.on("instanceLoaded",function(a){var b=a.editor;b.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)}});b.on("selectionChange",
363
+ function(a){if(!b.readOnly){var c=b.getSelection();if(c&&!c.isLocked){c=b.checkDirty();b.fire("lockSnapshot");e(a);b.fire("unlockSnapshot");!c&&b.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?
364
+ "top":"contents")){var e=CKEDITOR.tools.getNextId(),d=CKEDITOR.dom.element.createFromHtml('<span id="'+e+'" class="cke_voice_label">'+d+"</span>");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 o=CKEDITOR.dom.walker.whitespaces(true),q=CKEDITOR.dom.walker.bookmark(false,true),t=CKEDITOR.dom.walker.empty(),w=CKEDITOR.dom.walker.bogus(),v=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,
365
+ B=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(c,d){var e,g,f,u,l=[],p=d.range.startContainer;e=d.range.startPath();for(var p=h[p.getName()],i=0,j=c.getChildren(),s=j.count(),z=-1,K=-1,I=0,F=e.contains(h.$list);i<s;++i){e=j.getItem(i);if(a(e)){f=e.getName();if(F&&f in CKEDITOR.dtd.$list)l=l.concat(b(e,d));else{u=!!p[f];if(f=="br"&&e.data("cke-eol")&&(!i||i==s-1)){I=(g=i?l[i-1].node:j.getItem(i+1))&&(!a(g)||!g.is("br"));g=g&&a(g)&&h.$block[g.getName()]}z==-1&&!u&&(z=i);
366
+ u||(K=i);l.push({isElement:1,isLineBreak:I,isBlock:e.isBlockBoundary(),hasBlockSibling:g,node:e,name:f,allowed:u});g=I=0}}else l.push({isElement:0,node:e,allowed:1})}if(z>-1)l[z].firstNotAllowed=1;if(K>-1)l[K].lastNotAllowed=1;return l}function c(b,d){var e=[],g=b.getChildren(),f=g.count(),u,l=0,m=h[d],p=!b.is(h.$inline)||b.is("br");for(p&&e.push(" ");l<f;l++){u=g.getItem(l);a(u)&&!u.is(m)?e=e.concat(c(u,d)):e.push(u)}p&&e.push(" ");return e}function d(b){return b&&a(b)&&(b.is(h.$removeEmpty)||b.is("a")&&
367
+ !b.isBlockBoundary())}function e(b,c,d,g){var f=b.clone(),h,u;f.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);if((h=(new CKEDITOR.dom.walker(f)).next())&&a(h)&&l[h.getName()]&&(u=h.getPrevious())&&a(u)&&!u.getParent().equals(b.startContainer)&&d.contains(u)&&g.contains(h)&&h.isIdentical(u)){h.moveChildren(u);h.remove();e(b,c,d,g)}}function f(b,c){function d(b,c){if(c.isBlock&&c.isElement&&!c.node.is("br")&&a(b)&&b.is("br")){b.remove();return 1}}var e=c.endContainer.getChild(c.endOffset),g=c.endContainer.getChild(c.endOffset-
368
+ 1);e&&d(e,b[b.length-1]);if(g&&d(g,b[0])){c.setEnd(c.endContainer,c.endOffset-1);c.collapse()}}var h=CKEDITOR.dtd,l={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},u={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},j=CKEDITOR.tools.extend({},h.$inline);delete j.br;return function(l,x,s,G){var n=l.editor,o=false;if(x=="unfiltered_html"){x="html";o=true}if(!G.checkReadOnly()){var E=(new CKEDITOR.dom.elementPath(G.startContainer,G.root)).blockLimit||G.root,l={type:x,dontFilter:o,
369
+ editable:l,editor:n,range:G,blockLimit:E,mergeCandidates:[],zombies:[]},x=l.range,G=l.mergeCandidates,r,q;if(l.type=="text"&&x.shrink(CKEDITOR.SHRINK_ELEMENT,true,false)){r=CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>",x.document);x.insertNode(r);x.setStartAfter(r)}o=new CKEDITOR.dom.elementPath(x.startContainer);l.endPath=E=new CKEDITOR.dom.elementPath(x.endContainer);if(!x.collapsed){var n=E.block||E.blockLimit,y=x.getCommonAncestor();n&&(!n.equals(y)&&!n.contains(y)&&x.checkEndOfBlock())&&
370
+ l.zombies.push(n);x.deleteContents()}for(;(q=a(x.startContainer)&&x.startContainer.getChild(x.startOffset-1))&&a(q)&&q.isBlockBoundary()&&o.contains(q);)x.moveToPosition(q,CKEDITOR.POSITION_BEFORE_END);e(x,l.blockLimit,o,E);if(r){x.setEndBefore(r);x.collapse();r.remove()}r=x.startPath();if(n=r.contains(d,false,1)){x.splitElement(n);l.inlineStylesRoot=n;l.inlineStylesPeak=r.lastElement}r=x.createBookmark();(n=r.startNode.getPrevious(i))&&a(n)&&d(n)&&G.push(n);(n=r.startNode.getNext(i))&&a(n)&&d(n)&&
371
+ G.push(n);for(n=r.startNode;(n=n.getParent())&&d(n);)G.push(n);x.moveToBookmark(r);if(r=s){r=l.range;if(l.type=="text"&&l.inlineStylesRoot){q=l.inlineStylesPeak;x=q.getDocument().createText("{cke-peak}");for(G=l.inlineStylesRoot.getParent();!q.equals(G);){x=x.appendTo(q.clone());q=q.getParent()}s=x.getOuterHtml().split("{cke-peak}").join(s)}q=l.blockLimit.getName();if(/^\s+|\s+$/.test(s)&&"span"in CKEDITOR.dtd[q])var v='<span data-cke-marker="1">&nbsp;</span>',s=v+s+v;s=l.editor.dataProcessor.toHtml(s,
372
+ {context:null,fixForBody:false,protectedWhitespaces:!!v,dontFilter:l.dontFilter,filter:l.editor.activeFilter,enterMode:l.editor.activeEnterMode});q=r.document.createElement("body");q.setHtml(s);if(v){q.getFirst().remove();q.getLast().remove()}if((v=r.startPath().block)&&!(v.getChildCount()==1&&v.getBogus()))a:{var t;if(q.getChildCount()==1&&a(t=q.getFirst())&&t.is(u)&&!t.hasAttribute("contenteditable")){v=t.getElementsByTag("*");r=0;for(G=v.count();r<G;r++){x=v.getItem(r);if(!x.is(j))break a}t.moveChildren(t.getParent(1));
373
+ t.remove()}}l.dataWrapper=q;r=s}if(r){t=l.range;r=t.document;var H;q=l.blockLimit;var G=0,J,v=[],w,B,s=n=0,O,V,x=t.startContainer,o=l.endPath.elements[0],W,E=o.getPosition(x),y=!!o.getCommonAncestor(x)&&E!=CKEDITOR.POSITION_IDENTICAL&&!(E&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED),x=b(l.dataWrapper,l);for(f(x,t);G<x.length;G++){E=x[G];if(H=E.isLineBreak){H=t;O=q;var Q=void 0,S=void 0;if(E.hasBlockSibling)H=1;else{Q=H.startContainer.getAscendant(h.$block,1);if(!Q||!Q.is({div:1,p:1}))H=
374
+ 0;else{S=Q.getPosition(O);if(S==CKEDITOR.POSITION_IDENTICAL||S==CKEDITOR.POSITION_CONTAINS)H=0;else{O=H.splitElement(Q);H.moveToPosition(O,CKEDITOR.POSITION_AFTER_START);H=1}}}}if(H)s=G>0;else{H=t.startPath();if(!E.isBlock&&g(l.editor,H.block,H.blockLimit)&&(B=A(l.editor))){B=r.createElement(B);B.appendBogus();t.insertNode(B);CKEDITOR.env.needsBrFiller&&(J=B.getBogus())&&J.remove();t.moveToPosition(B,CKEDITOR.POSITION_BEFORE_END)}if((H=t.startPath().block)&&!H.equals(w)){if(J=H.getBogus()){J.remove();
375
+ v.push(H)}w=H}E.firstNotAllowed&&(n=1);if(n&&E.isElement){H=t.startContainer;for(O=null;H&&!h[H.getName()][E.name];){if(H.equals(q)){H=null;break}O=H;H=H.getParent()}if(H){if(O){V=t.splitElement(O);l.zombies.push(V);l.zombies.push(O)}}else{O=q.getName();W=!G;H=G==x.length-1;O=c(E.node,O);for(var Q=[],S=O.length,R=0,P=void 0,X=0,$=-1;R<S;R++){P=O[R];if(P==" "){if(!X&&(!W||R)){Q.push(new CKEDITOR.dom.text(" "));$=Q.length}X=1}else{Q.push(P);X=0}}H&&$==Q.length&&Q.pop();W=Q}}if(W){for(;H=W.pop();)t.insertNode(H);
376
+ W=0}else t.insertNode(E.node);if(E.lastNotAllowed&&G<x.length-1){(V=y?o:V)&&t.setEndAt(V,CKEDITOR.POSITION_AFTER_START);n=0}t.collapse()}}if(x.length!=1)J=false;else{J=x[0];J=J.isElement&&J.node.getAttribute("contenteditable")=="false"}if(J){s=true;H=x[0].node;t.setStartAt(H,CKEDITOR.POSITION_BEFORE_START);t.setEndAt(H,CKEDITOR.POSITION_AFTER_END)}l.dontMoveCaret=s;l.bogusNeededBlocks=v}J=l.range;var Y;V=l.bogusNeededBlocks;for(W=J.createBookmark();w=l.zombies.pop();)if(w.getParent()){B=J.clone();
377
+ B.moveToElementEditStart(w);B.removeEmptyBlocksAtEnd()}if(V)for(;w=V.pop();)CKEDITOR.env.needsBrFiller?w.appendBogus():w.append(J.document.createText(" "));for(;w=l.mergeCandidates.pop();)w.mergeSiblings();J.moveToBookmark(W);if(!l.dontMoveCaret){for(w=a(J.startContainer)&&J.startContainer.getChild(J.startOffset-1);w&&a(w)&&!w.is(h.$empty);){if(w.isBlockBoundary())J.moveToPosition(w,CKEDITOR.POSITION_BEFORE_END);else{if(d(w)&&w.getHtml().match(/(\s|&nbsp;)$/g)){Y=null;break}Y=J.clone();Y.moveToPosition(w,
378
+ CKEDITOR.POSITION_BEFORE_END)}w=w.getLast(i)}Y&&J.moveToRange(Y)}}}}(),l=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return false;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$tableContent)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT};return b}function b(a,c,d){c=a.getDocument().createElement(c);a.append(c,d);return c}function c(a){var b=a.count(),d;for(b;b-- >0;){d=a.getItem(b);if(!CKEDITOR.tools.trim(d.getHtml())){d.appendBogus();
379
+ CKEDITOR.env.ie&&(CKEDITOR.env.version<9&&d.getChildCount())&&d.getFirst().remove()}}}return function(d){var e=d.startContainer,g=e.getAscendant("table",1),f=false;c(g.getElementsByTag("td"));c(g.getElementsByTag("th"));g=d.clone();g.setStart(e,0);g=a(g).lastBackward();if(!g){g=d.clone();g.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);g=a(g).lastForward();f=true}g||(g=e);if(g.is("table")){d.setStartAt(g,CKEDITOR.POSITION_BEFORE_START);d.collapse(true);g.remove()}else{g.is({tbody:1,thead:1,tfoot:1})&&(g=
380
+ b(g,"tr",f));g.is("tr")&&(g=b(g,g.getParent().is("thead")?"th":"td",f));(e=g.getBogus())&&e.remove();d.moveToPosition(g,f?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END)}}}();a={detect:function(a,b){var c=a.range,d=c.clone(),e=c.clone(),g=new CKEDITOR.dom.elementPath(c.startContainer,b),f=new CKEDITOR.dom.elementPath(c.endContainer,b);d.collapse(1);e.collapse();if(g.block&&d.checkBoundaryOfElement(g.block,CKEDITOR.END)){c.setStartAfter(g.block);a.prependEolBr=1}if(f.block&&e.checkBoundaryOfElement(f.block,
381
+ CKEDITOR.START)){c.setEndBefore(f.block);a.appendEolBr=1}},fix:function(a,b){var c=b.getDocument(),d;if(a.appendEolBr){d=this.createEolBr(c);a.fragment.append(d)}a.prependEolBr&&(!d||d.getPrevious())&&a.fragment.append(this.createEolBr(c),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}};d={exclude:function(a){var b=a.range.getBoundaryNodes(),c=b.startNode;(b=b.endNode)&&(w(b)&&(!c||!c.equals(b)))&&a.range.setEndBefore(b)}};c={rebuild:function(a,b){var c=a.range,
382
+ d=c.getCommonAncestor(),e=new CKEDITOR.dom.elementPath(d,b),g=new CKEDITOR.dom.elementPath(c.startContainer,b),c=new CKEDITOR.dom.elementPath(c.endContainer,b),f;d.type==CKEDITOR.NODE_TEXT&&(d=d.getParent());if(e.blockLimit.is({tr:1,table:1})){var h=e.contains("table").getParent();f=function(a){return!a.equals(h)}}else if(e.block&&e.block.is(CKEDITOR.dtd.$listItem)){g=g.contains(CKEDITOR.dtd.$list);c=c.contains(CKEDITOR.dtd.$list);if(!g.equals(c)){var l=e.contains(CKEDITOR.dtd.$list).getParent();
383
+ f=function(a){return!a.equals(l)}}}f||(f=function(a){return!a.equals(e.block)&&!a.equals(e.blockLimit)});this.rebuildFragment(a,b,d,f)},rebuildFragment:function(a,b,c,d){for(var e;c&&!c.equals(b)&&d(c);){e=c.clone(0,1);a.fragment.appendTo(e);a.fragment=e;c=c.getParent()}}};b={shrink:function(a){var a=a.range,b=a.startContainer,c=a.endContainer,d=a.startOffset,e=a.endOffset;b.type==CKEDITOR.NODE_ELEMENT&&(b.equals(c)&&b.is("tr")&&++d==e)&&a.shrink(CKEDITOR.SHRINK_TEXT)}};var s=function(){function a(b,
384
+ c){var d=b.getParent();if(d.is(CKEDITOR.dtd.$inline))b[c?"insertBefore":"insertAfter"](d)}function b(c,d,e){a(d);a(e,1);for(var g;g=e.getNext();){g.insertAfter(d);d=g}t(c)&&c.remove()}function c(a,b){var d=new CKEDITOR.dom.range(a);d.setStartAfter(b.startNode);d.setEndBefore(b.endNode);return d}return{list:{detectMerge:function(a,b){var d=c(b,a.bookmark),e=d.startPath(),g=d.endPath(),f=e.contains(CKEDITOR.dtd.$list),h=g.contains(CKEDITOR.dtd.$list);a.mergeList=f&&h&&f.getParent().equals(h.getParent())&&
385
+ !f.equals(h);a.mergeListItems=e.block&&g.block&&e.block.is(CKEDITOR.dtd.$listItem)&&g.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList||a.mergeListItems){d=d.clone();d.setStartBefore(a.bookmark.startNode);d.setEndAfter(a.bookmark.endNode);a.mergeListBookmark=d.createBookmark()}},merge:function(a,c){if(a.mergeListBookmark){var d=a.mergeListBookmark.startNode,e=a.mergeListBookmark.endNode,g=new CKEDITOR.dom.elementPath(d,c),f=new CKEDITOR.dom.elementPath(e,c);if(a.mergeList){var h=g.contains(CKEDITOR.dtd.$list),
386
+ k=f.contains(CKEDITOR.dtd.$list);if(!h.equals(k)){k.moveChildren(h);k.remove()}}if(a.mergeListItems){g=g.contains(CKEDITOR.dtd.$listItem);f=f.contains(CKEDITOR.dtd.$listItem);g.equals(f)||b(f,d,e)}d.remove();e.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 d=
387
+ a.mergeBlockBookmark.startNode,e=a.mergeBlockBookmark.endNode,g=new CKEDITOR.dom.elementPath(d,c),f=new CKEDITOR.dom.elementPath(e,c),g=g.block,f=f.block;g&&(f&&!g.equals(f))&&b(f,d,e);d.remove();e.remove()}}},table:function(){function a(c){var e=[],g,f=new CKEDITOR.dom.walker(c),h=c.startPath().contains(d),k=c.endPath().contains(d),l={};f.guard=function(a,f){if(a.type==CKEDITOR.NODE_ELEMENT){var m="visited_"+(f?"out":"in");if(a.getCustomData(m))return;CKEDITOR.dom.element.setMarker(l,a,m,1)}if(f&&
388
+ h&&a.equals(h)){g=c.clone();g.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);e.push(g)}else if(!f&&k&&a.equals(k)){g=c.clone();g.setStartAt(k,CKEDITOR.POSITION_AFTER_START);e.push(g)}else if(!f&&a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&(!h||b(a,h))&&(!k||b(a,k))){g=c.clone();g.selectNodeContents(a);e.push(g)}};f.lastForward();CKEDITOR.dom.element.clearAllMarkers(l);return e}function b(a,c){var d=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,e=a.getPosition(c);return e===CKEDITOR.POSITION_IDENTICAL?
389
+ false:(e&d)===0}var d={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),e=0;c.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&++e};c.checkForward();if(e>1){var c=b.startPath().contains("table"),g=b.endPath().contains("table");if(c&&g&&b.checkBoundaryOfElement(c,CKEDITOR.START)&&b.checkBoundaryOfElement(g,CKEDITOR.END)){b=a.range.clone();b.setStartBefore(c);b.setEndAfter(g);a.purgeTableBookmark=
390
+ b.createBookmark()}}},detectRanges:function(e,g){var f=c(g,e.bookmark),h=f.clone(),k,l,m=f.getCommonAncestor();m.is(CKEDITOR.dtd.$tableContent)&&!m.is(d)&&(m=m.getAscendant("table",true));l=m;m=new CKEDITOR.dom.elementPath(f.startContainer,l);l=new CKEDITOR.dom.elementPath(f.endContainer,l);m=m.contains("table");l=l.contains("table");if(m||l){if(m&&l&&b(m,l)){e.tableSurroundingRange=h;h.setStartAt(m,CKEDITOR.POSITION_AFTER_END);h.setEndAt(l,CKEDITOR.POSITION_BEFORE_START);h=f.clone();h.setEndAt(m,
391
+ CKEDITOR.POSITION_AFTER_END);k=f.clone();k.setStartAt(l,CKEDITOR.POSITION_BEFORE_START);k=a(h).concat(a(k))}else if(m){if(!l){e.tableSurroundingRange=h;h.setStartAt(m,CKEDITOR.POSITION_AFTER_END);f.setEndAt(m,CKEDITOR.POSITION_AFTER_END)}}else{e.tableSurroundingRange=h;h.setEndAt(l,CKEDITOR.POSITION_BEFORE_START);f.setStartAt(l,CKEDITOR.POSITION_AFTER_START)}e.tableContentsRanges=k?k:a(f)}},deleteRanges:function(a){for(var b;b=a.tableContentsRanges.pop();){b.extractContents();t(b.startContainer)&&
392
+ 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))},
393
+ 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=A(a))){d=b.document.createElement(d);d.appendBogus();b.insertNode(d);b.moveToPosition(d,CKEDITOR.POSITION_AFTER_START)}}}}()})();
394
+ (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 d(){o=true;if(!y){b.call(this);y=CKEDITOR.tools.setTimeout(b,
395
+ 200,this)}}function b(){y=null;if(o){CKEDITOR.tools.setTimeout(a,0,this);o=false}}function c(a){return q(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?true:false}function e(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 d=a.startContainer,e=a.getPreviousNode(c,null,d),g=a.getNextNode(c,null,d);return b(e)||b(g,1)||!e&&!g&&!(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()&&
395
396
  d.getBogus())?true:false}function f(a){return a.getCustomData("cke-fillingChar")}function h(a,b){var c=a&&a.removeCustomData("cke-fillingChar");if(c){if(b!==false){var d,e=a.getDocument().getSelection().getNative(),g=e&&e.type!="None"&&e.getRangeAt(0);if(c.getLength()>1&&g&&g.intersectsNode(c.$)){d=j(e);g=e.focusNode==c.$&&e.focusOffset>0;e.anchorNode==c.$&&e.anchorOffset>0&&d[0].offset--;g&&d[1].offset--}}c.setText(i(c.getText()));d&&n(a.getDocument().$,d)}}function i(a){return a.replace(/\u200B( )?/g,
396
397
  function(a){return a[1]?" ":""})}function j(a){return[{node:a.anchorNode,offset:a.anchorOffset},{node:a.focusNode,offset:a.focusOffset}]}function n(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 g(a){var b=CKEDITOR.dom.element.createFromHtml('<div data-cke-hidden-sel="1" data-cke-temp="1" style="'+(CKEDITOR.env.ie?"display:none":"position:fixed;top:0;left:-1000px")+'">&nbsp;</div>',
397
- 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 B(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(),g=e[0];if(e.length==
398
- 1&&g.collapsed)if((d=g[d<38?"getPreviousEditableNode":"getNextEditableNode"]())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getAttribute("contenteditable")=="false"){a.getSelection().fake(d);c.data.preventDefault();c.cancel()}}}}function s(a){for(var b=0;b<a.length;b++){var c=a[b];c.getCommonAncestor().isReadOnly()&&a.splice(b,1);if(!c.collapsed){if(c.startContainer.isReadOnly())for(var d=c.startContainer,e;d;){if((e=d.type==CKEDITOR.NODE_ELEMENT)&&d.is("body")||!d.isReadOnly())break;e&&d.getAttribute("contentEditable")==
398
+ 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 A(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(),g=e[0];if(e.length==
399
+ 1&&g.collapsed)if((d=g[d<38?"getPreviousEditableNode":"getNextEditableNode"]())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getAttribute("contenteditable")=="false"){a.getSelection().fake(d);c.data.preventDefault();c.cancel()}}}}function r(a){for(var b=0;b<a.length;b++){var c=a[b];c.getCommonAncestor().isReadOnly()&&a.splice(b,1);if(!c.collapsed){if(c.startContainer.isReadOnly())for(var d=c.startContainer,e;d;){if((e=d.type==CKEDITOR.NODE_ELEMENT)&&d.is("body")||!d.isReadOnly())break;e&&d.getAttribute("contentEditable")==
399
400
  "false"&&c.setStartAfter(d);d=d.getParent()}d=c.startContainer;e=c.endContainer;var g=c.startOffset,f=c.endOffset,h=c.clone();d&&d.type==CKEDITOR.NODE_TEXT&&(g>=d.getLength()?h.setStartAfter(d):h.setStartBefore(d));e&&e.type==CKEDITOR.NODE_TEXT&&(f?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);
400
- e.collapsed||a.splice(b+1,0,e)}return true}return false};d.next()}}return a}var z,o,p=CKEDITOR.dom.walker.invisible(1),t=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]);
401
- 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=e.getSelection();a&&a.removeAllRanges()}var e=b.editor;e.on("contentDom",function(){function b(){D=new CKEDITOR.dom.selection(e.getSelection());D.lock()}function c(){f.removeListener("mouseup",c);j.removeListener("mouseup",
402
- c);var a=CKEDITOR.document.$.selection,b=a.createRange();a.type!="None"&&b.parentElement().ownerDocument==g.$&&b.select()}var g=e.document,f=CKEDITOR.document,l=e.editable(),i=g.getBody(),j=g.getDocumentElement(),r=l.isInline(),q,D;CKEDITOR.env.gecko&&l.attachListener(l,"focus",function(a){a.removeListener();if(q!==0)if((a=e.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==l.$){a=e.createRange();a.moveToElementEditStart(l);a.select()}},null,null,-2);l.attachListener(l,CKEDITOR.env.webkit?
403
- "DOMFocusIn":"focus",function(){q&&CKEDITOR.env.webkit&&(q=e._.previousActive&&e._.previousActive.equals(g.getActive()));e.unlockSelection(q);q=0},null,null,-1);l.attachListener(l,"mousedown",function(){q=0});if(CKEDITOR.env.ie||r){x?l.attachListener(l,"beforedeactivate",b,null,null,-1):l.attachListener(e,"selectionCheck",b,null,null,-1);l.attachListener(l,CKEDITOR.env.webkit?"DOMFocusOut":"blur",function(){e.lockSelection(D);q=1},null,null,-1);l.attachListener(l,"mousedown",function(){q=0})}if(CKEDITOR.env.ie&&
404
- !r){var y;l.attachListener(l,"mousedown",function(a){if(a.data.$.button==2){a=e.document.getSelection();if(!a||a.getType()==CKEDITOR.SELECTION_NONE)y=e.window.getScrollPosition()}});l.attachListener(l,"mouseup",function(a){if(a.data.$.button==2&&y){e.document.$.documentElement.scrollLeft=y.x;e.document.$.documentElement.scrollTop=y.y}y=null});if(g.$.compatMode!="BackCompat"){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)j.on("mousedown",function(a){function b(a){a=a.data.$;if(d){var c=i.$.createTextRange();
401
+ e.collapsed||a.splice(b+1,0,e)}return true}return false};d.next()}}return a}var y,o,q=CKEDITOR.dom.walker.invisible(1),t=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]);
402
+ 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=e.getSelection();a&&a.removeAllRanges()}var e=b.editor;e.on("contentDom",function(){function b(){C=new CKEDITOR.dom.selection(e.getSelection());C.lock()}function c(){f.removeListener("mouseup",c);j.removeListener("mouseup",
403
+ c);var a=CKEDITOR.document.$.selection,b=a.createRange();a.type!="None"&&b.parentElement().ownerDocument==g.$&&b.select()}var g=e.document,f=CKEDITOR.document,l=e.editable(),i=g.getBody(),j=g.getDocumentElement(),u=l.isInline(),s,C;CKEDITOR.env.gecko&&l.attachListener(l,"focus",function(a){a.removeListener();if(s!==0)if((a=e.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==l.$){a=e.createRange();a.moveToElementEditStart(l);a.select()}},null,null,-2);l.attachListener(l,CKEDITOR.env.webkit?
404
+ "DOMFocusIn":"focus",function(){s&&CKEDITOR.env.webkit&&(s=e._.previousActive&&e._.previousActive.equals(g.getActive()));e.unlockSelection(s);s=0},null,null,-1);l.attachListener(l,"mousedown",function(){s=0});if(CKEDITOR.env.ie||u){w?l.attachListener(l,"beforedeactivate",b,null,null,-1):l.attachListener(e,"selectionCheck",b,null,null,-1);l.attachListener(l,CKEDITOR.env.webkit?"DOMFocusOut":"blur",function(){e.lockSelection(C);s=1},null,null,-1);l.attachListener(l,"mousedown",function(){s=0})}if(CKEDITOR.env.ie&&
405
+ !u){var x;l.attachListener(l,"mousedown",function(a){if(a.data.$.button==2){a=e.document.getSelection();if(!a||a.getType()==CKEDITOR.SELECTION_NONE)x=e.window.getScrollPosition()}});l.attachListener(l,"mouseup",function(a){if(a.data.$.button==2&&x){e.document.$.documentElement.scrollLeft=x.x;e.document.$.documentElement.scrollTop=x.y}x=null});if(g.$.compatMode!="BackCompat"){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)j.on("mousedown",function(a){function b(a){a=a.data.$;if(d){var c=i.$.createTextRange();
405
406
  try{c.moveToPoint(a.clientX,a.clientY)}catch(e){}d.setEndPoint(g.compareEndPoints("StartToStart",c)<0?"EndToEnd":"StartToStart",c);d.select()}}function c(){j.removeListener("mousemove",b);f.removeListener("mouseup",c);j.removeListener("mouseup",c);d.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y<j.$.clientHeight&&a.$.x<j.$.clientWidth){var d=i.$.createTextRange();try{d.moveToPoint(a.$.clientX,a.$.clientY)}catch(e){}var g=d.duplicate();j.on("mousemove",b);f.on("mouseup",c);j.on("mouseup",c)}});
406
- if(CKEDITOR.env.version>7&&CKEDITOR.env.version<11)j.on("mousedown",function(a){if(a.data.getTarget().is("html")){f.on("mouseup",c);j.on("mouseup",c)}})}}l.attachListener(l,"selectionchange",a,e);l.attachListener(l,"keyup",d,e);l.attachListener(l,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){e.forceNextSelectionCheck();e.selectionChange(1)});if(r&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var v;l.attachListener(l,"mousedown",function(){v=1});l.attachListener(g.getDocumentElement(),"mouseup",
407
- function(){v&&d.call(e);v=0})}else l.attachListener(CKEDITOR.env.ie?l:g.getDocumentElement(),"mouseup",d,e);CKEDITOR.env.webkit&&l.attachListener(g,"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(l)}},null,null,-1);l.attachListener(l,"keydown",B(e),null,null,-1)});e.on("setData",function(){e.unlockSelection();CKEDITOR.env.webkit&&c()});e.on("contentDomUnload",function(){e.unlockSelection()});if(CKEDITOR.env.ie9Compat)e.on("beforeDestroy",
407
+ if(CKEDITOR.env.version>7&&CKEDITOR.env.version<11)j.on("mousedown",function(a){if(a.data.getTarget().is("html")){f.on("mouseup",c);j.on("mouseup",c)}})}}l.attachListener(l,"selectionchange",a,e);l.attachListener(l,"keyup",d,e);l.attachListener(l,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){e.forceNextSelectionCheck();e.selectionChange(1)});if(u&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var n;l.attachListener(l,"mousedown",function(){n=1});l.attachListener(g.getDocumentElement(),"mouseup",
408
+ function(){n&&d.call(e);n=0})}else l.attachListener(CKEDITOR.env.ie?l:g.getDocumentElement(),"mouseup",d,e);CKEDITOR.env.webkit&&l.attachListener(g,"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(l)}},null,null,-1);l.attachListener(l,"keydown",A(e),null,null,-1)});e.on("setData",function(){e.unlockSelection();CKEDITOR.env.webkit&&c()});e.on("contentDomUnload",function(){e.unlockSelection()});if(CKEDITOR.env.ie9Compat)e.on("beforeDestroy",
408
409
  c,null,null,9);e.on("dataReady",function(){delete e._.fakeSelection;delete e._.hiddenSelectionContainer;e.selectionChange(1)});e.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=e.editable().getLast(a);if(b&&b.hasAttribute("data-cke-hidden-sel")){b.remove();if(CKEDITOR.env.gecko)(a=e.editable().getFirst(a))&&(a.is("br")&&a.getAttribute("_moz_editor_bogus_node"))&&a.remove()}},null,null,100);e.on("key",function(a){if(e.mode=="wysiwyg"){var b=e.getSelection();
409
410
  if(b.isFake){var c=t[a.data.keyCode];if(c)return c({editor:e,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});CKEDITOR.on("instanceReady",function(a){function b(){var a=d.editable();if(a)if(a=f(a)){var c=d.document.$.getSelection();if(c.type!="None"&&(c.anchorNode==a.$||c.focusNode==a.$))g=j(c);e=a.getText();a.setText(i(e))}}function c(){var a=d.editable();if(a)if(a=f(a)){a.setText(e);if(g){n(d.document.$,g);g=null}}}var d=a.editor,e,g;if(CKEDITOR.env.webkit){d.on("selectionChange",
410
411
  function(){var a=d.editable(),b=f(a);b&&(b.getCustomData("ready")?h(a):b.setCustomData("ready",1))},null,null,-1);d.on("beforeSetMode",function(){h(d.editable())},null,null,-1);d.on("beforeUndoImage",b);d.on("afterUndoImage",c);d.on("beforeGetData",b,null,null,0);d.on("getData",c)}});CKEDITOR.editor.prototype.selectionChange=function(b){(b?a:d).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){if((this._.savedSelection||this._.fakeSelection)&&!a)return this._.savedSelection||this._.fakeSelection;
411
412
  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};
412
- 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 x=typeof window.getSelection!="function",u=1;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection)var b=
413
- a,a=a.root;var c=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:u++;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(g){}d=e&&CKEDITOR.dom.element.get(e.item&&
414
- 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 C={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=
415
- {getNative:function(){return this._.cache.nativeSel!==void 0?this._.cache.nativeSel:this._.cache.nativeSel=x?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:x?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;
416
- 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&&C[d.childNodes[c.startOffset].nodeName.toLowerCase()])b=CKEDITOR.SELECTION_ELEMENT}return a.type=b},getRanges:function(){var a=x?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,c){b=b.duplicate();b.collapse(c);
417
- var d=b.parentElement();if(!d.hasChildNodes())return{container:d,offset:0};for(var e=d.children,g,f,h=b.duplicate(),r=0,l=e.length-1,k=-1,i,j;r<=l;){k=Math.floor((r+l)/2);g=e[k];h.moveToElementText(g);i=h.compareEndPoints("StartToStart",b);if(i>0)l=k-1;else if(i<0)r=k+1;else return{container:d,offset:a(g)}}if(k==-1||k==e.length-1&&i<0){h.moveToElementText(d);h.setEndPoint("StartToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!h){g=e[e.length-1];return g.nodeType!=CKEDITOR.NODE_TEXT?
418
- {container:d,offset:e.length}:{container:g,offset:g.nodeValue.length}}for(d=e.length;h>0&&d>0;){f=e[--d];if(f.nodeType==CKEDITOR.NODE_TEXT){j=f;h=h-f.nodeValue.length}}return{container:j,offset:-h}}h.collapse(i>0?true:false);h.setEndPoint(i>0?"StartToStart":"EndToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;if(!h)return{container:d,offset:a(g)+(i>0?0:1)};for(;h>0;)try{f=g[i>0?"previousSibling":"nextSibling"];if(f.nodeType==CKEDITOR.NODE_TEXT){h=h-f.nodeValue.length;j=f}g=f}catch(n){return{container:d,
419
- offset:a(g)}}return{container:j,offset:i>0?-h:j.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==
413
+ 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 w=typeof window.getSelection!="function",v=1;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection)var b=
414
+ 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(g){}d=e&&CKEDITOR.dom.element.get(e.item&&
415
+ 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 B={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.dom.selection.prototype=
416
+ {getNative:function(){return this._.cache.nativeSel!==void 0?this._.cache.nativeSel:this._.cache.nativeSel=w?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:w?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var 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;
417
+ 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&&B[d.childNodes[c.startOffset].nodeName.toLowerCase()])b=CKEDITOR.SELECTION_ELEMENT}return a.type=b},getRanges:function(){var a=w?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,c){b=b.duplicate();b.collapse(c);
418
+ var d=b.parentElement();if(!d.hasChildNodes())return{container:d,offset:0};for(var e=d.children,g,f,h=b.duplicate(),l=0,k=e.length-1,i=-1,j,n;l<=k;){i=Math.floor((l+k)/2);g=e[i];h.moveToElementText(g);j=h.compareEndPoints("StartToStart",b);if(j>0)k=i-1;else if(j<0)l=i+1;else return{container:d,offset:a(g)}}if(i==-1||i==e.length-1&&j<0){h.moveToElementText(d);h.setEndPoint("StartToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!h){g=e[e.length-1];return g.nodeType!=CKEDITOR.NODE_TEXT?
419
+ {container:d,offset:e.length}:{container:g,offset:g.nodeValue.length}}for(d=e.length;h>0&&d>0;){f=e[--d];if(f.nodeType==CKEDITOR.NODE_TEXT){n=f;h=h-f.nodeValue.length}}return{container:n,offset:-h}}h.collapse(j>0?true:false);h.setEndPoint(j>0?"StartToStart":"EndToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;if(!h)return{container:d,offset:a(g)+(j>0?0:1)};for(;h>0;)try{f=g[j>0?"previousSibling":"nextSibling"];if(f.nodeType==CKEDITOR.NODE_TEXT){h=h-f.nodeValue.length;n=f}g=f}catch(o){return{container:d,
420
+ offset:a(g)}}return{container:n,offset:j>0?-h:n.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==
420
421
  CKEDITOR.SELECTION_ELEMENT){for(var d=[],e=0;e<c.length;e++){for(var g=c.item(e),f=g.parentNode,h=0,a=new CKEDITOR.dom.range(this.root);h<f.childNodes.length&&f.childNodes[h]!=g;h++);a.setStart(new CKEDITOR.dom.node(f),h);a.setEnd(new CKEDITOR.dom.node(f),h+1);d.push(a)}return d}return[]}}():function(){var a=[],b,c=this.getNative();if(!c)return a;for(var d=0;d<c.rangeCount;d++){var e=c.getRangeAt(d);b=new CKEDITOR.dom.range(this.root);b.setStart(new CKEDITOR.dom.node(e.startContainer),e.startOffset);
421
- b.setEnd(new CKEDITOR.dom.node(e.endContainer),e.endOffset);a.push(b)}return a};return function(b){var c=this._.cache,d=c.ranges;if(!d)c.ranges=d=new CKEDITOR.dom.rangeList(a.call(this));return!b?d:s(new CKEDITOR.dom.rangeList(d.slice()))}}(),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=
422
+ b.setEnd(new CKEDITOR.dom.node(e.endContainer),e.endOffset);a.push(b)}return a};return function(b){var c=this._.cache,d=c.ranges;if(!d)c.ranges=d=new CKEDITOR.dom.rangeList(a.call(this));return!b?d:r(new CKEDITOR.dom.rangeList(d.slice()))}}(),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=
422
423
  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):
423
- 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].clone(),c,d,e=2;e&&(!(c=a.getEnclosedNode())||!(c.type==CKEDITOR.NODE_ELEMENT&&C[c.getName()]&&(d=c)));e--)a.shrink(CKEDITOR.SHRINK_ELEMENT);return d&&d.$});return a.selectedElement=c?new CKEDITOR.dom.element(c):null},getSelectedText:function(){var a=this._.cache;
424
- if(a.selectedText!==void 0)return a.selectedText;var b=this.getNative(),b=x?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(),d=this.isFake;this.isLocked=0;this.reset();if(a)(a=b||c[0]&&c[0].getCommonAncestor())&&a.getAscendant("body",
425
- 1)&&(d?this.fake(b):b?this.selectElement(b):this.selectRanges(c))}},reset:function(){this._.cache={};this.isFake=0;var a=this.root.editor;if(a&&a._.fakeSelection&&this.rev==a._.fakeSelection.rev){delete a._.fakeSelection;var b=a._.hiddenSelectionContainer;if(b){var c=a.checkDirty();a.fire("lockSnapshot");b.remove();a.fire("unlockSnapshot");!c&&a.resetDirty()}delete a._.hiddenSelectionContainer}this.rev=u++},selectElement:function(a){var b=new CKEDITOR.dom.range(this.root);b.setStartBefore(a);b.setEndAfter(a);
424
+ 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].clone(),c,d,e=2;e&&(!(c=a.getEnclosedNode())||!(c.type==CKEDITOR.NODE_ELEMENT&&B[c.getName()]&&(d=c)));e--)a.shrink(CKEDITOR.SHRINK_ELEMENT);return d&&d.$});return a.selectedElement=c?new CKEDITOR.dom.element(c):null},getSelectedText:function(){var a=this._.cache;
425
+ if(a.selectedText!==void 0)return a.selectedText;var b=this.getNative(),b=w?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(),d=this.isFake;this.isLocked=0;this.reset();if(a)(a=b||c[0]&&c[0].getCommonAncestor())&&a.getAscendant("body",
426
+ 1)&&(d?this.fake(b):b?this.selectElement(b):this.selectRanges(c))}},reset:function(){this._.cache={};this.isFake=0;var a=this.root.editor;if(a&&a._.fakeSelection&&this.rev==a._.fakeSelection.rev){delete a._.fakeSelection;var b=a._.hiddenSelectionContainer;if(b){var c=a.checkDirty();a.fire("lockSnapshot");b.remove();a.fire("unlockSnapshot");!c&&a.resetDirty()}delete a._.hiddenSelectionContainer}this.rev=v++},selectElement:function(a){var b=new CKEDITOR.dom.range(this.root);b.setStartBefore(a);b.setEndAfter(a);
426
427
  this.selectRanges([b])},selectRanges:function(a){var b=this.root.editor,b=b&&b._.hiddenSelectionContainer;this.reset();if(b)for(var b=this.root,c,d=0;d<a.length;++d){c=a[d];if(c.endContainer.equals(b))c.endOffset=Math.min(c.endOffset,b.getChildCount())}if(a.length)if(this.isLocked){var g=CKEDITOR.document.getActive();this.unlock();this.selectRanges(a);this.lock();g&&!g.equals(this.root)&&g.focus()}else{var f;a:{var i,j;if(a.length==1&&!(j=a[0]).collapsed&&(f=j.getEnclosedNode())&&f.type==CKEDITOR.NODE_ELEMENT){j=
427
- j.clone();j.shrink(CKEDITOR.SHRINK_ELEMENT,true);if((i=j.getEnclosedNode())&&i.type==CKEDITOR.NODE_ELEMENT)f=i;if(f.getAttribute("contenteditable")=="false")break a}f=void 0}if(f)this.fake(f);else{if(x){j=CKEDITOR.dom.walker.whitespaces(true);i=/\ufeff|\u00a0/;b={table:1,tbody:1,tr:1};if(a.length>1){f=a[a.length-1];a[0].setEnd(f.endContainer,f.endOffset)}f=a[0];var a=f.collapsed,n,o,r;if((c=f.getEnclosedNode())&&c.type==CKEDITOR.NODE_ELEMENT&&c.getName()in C&&(!c.is("a")||!c.getText()))try{r=c.$.createControlRange();
428
- r.addElement(c.$);r.select();return}catch(J){}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}r=f.createBookmark();b=r.startNode;if(!a)g=r.endNode;r=f.document.$.body.createTextRange();r.moveToElementText(b.$);r.moveStart("character",1);if(g){i=f.document.$.body.createTextRange();i.moveToElementText(g.$);r.setEndPoint("EndToEnd",i);r.moveEnd("character",
429
- -1)}else{n=b.getNext(j);o=b.hasAscendant("pre");n=!(n&&n.getText&&n.getText().match(i))&&(o||!b.hasPrevious()||b.getPrevious().is&&b.getPrevious().is("br"));o=f.document.createElement("span");o.setHtml("&#65279;");o.insertBefore(b);n&&f.document.createText("").insertBefore(b)}f.setStartBefore(b);b.remove();if(a){if(n){r.moveStart("character",-1);r.select();f.document.$.selection.clear()}else r.select();f.moveToPosition(o,CKEDITOR.POSITION_BEFORE_START);o.remove()}else{f.setEndBefore(g);g.remove();
430
- r.select()}}else{g=this.getNative();if(!g)return;this.removeAllRanges();for(r=0;r<a.length;r++){if(r<a.length-1){n=a[r];o=a[r+1];i=n.clone();i.setStart(n.endContainer,n.endOffset);i.setEnd(o.startContainer,o.startOffset);if(!i.collapsed){i.shrink(CKEDITOR.NODE_ELEMENT,true);f=i.getCommonAncestor();i=i.getEnclosedNode();if(f.isReadOnly()||i&&i.isReadOnly()){o.setStart(n.startContainer,n.startOffset);a.splice(r--,1);continue}}}f=a[r];o=this.document.$.createRange();if(f.collapsed&&CKEDITOR.env.webkit&&
431
- e(f)){n=this.root;h(n,false);i=n.getDocument().createText("​");n.setCustomData("cke-fillingChar",i);f.insertNode(i);if((n=i.getNext())&&!i.getPrevious()&&n.type==CKEDITOR.NODE_ELEMENT&&n.getName()=="br"){h(this.root);f.moveToPosition(n,CKEDITOR.POSITION_BEFORE_START)}else f.moveToPosition(i,CKEDITOR.POSITION_AFTER_END)}o.setStart(f.startContainer.$,f.startOffset);try{o.setEnd(f.endContainer.$,f.endOffset)}catch(D){if(D.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")>=0){f.collapse(1);o.setEnd(f.endContainer.$,
432
- f.endOffset)}else throw D;}g.addRange(o)}}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=u++;b._.fakeSelection=this;this.root.fire("selectionchange")},isHidden:function(){var a=this.getCommonAncestor();
428
+ j.clone();j.shrink(CKEDITOR.SHRINK_ELEMENT,true);if((i=j.getEnclosedNode())&&i.type==CKEDITOR.NODE_ELEMENT)f=i;if(f.getAttribute("contenteditable")=="false")break a}f=void 0}if(f)this.fake(f);else{if(w){j=CKEDITOR.dom.walker.whitespaces(true);i=/\ufeff|\u00a0/;b={table:1,tbody:1,tr:1};if(a.length>1){f=a[a.length-1];a[0].setEnd(f.endContainer,f.endOffset)}f=a[0];var a=f.collapsed,n,o,u;if((c=f.getEnclosedNode())&&c.type==CKEDITOR.NODE_ELEMENT&&c.getName()in B&&(!c.is("a")||!c.getText()))try{u=c.$.createControlRange();
429
+ u.addElement(c.$);u.select();return}catch(K){}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}u=f.createBookmark();b=u.startNode;if(!a)g=u.endNode;u=f.document.$.body.createTextRange();u.moveToElementText(b.$);u.moveStart("character",1);if(g){i=f.document.$.body.createTextRange();i.moveToElementText(g.$);u.setEndPoint("EndToEnd",i);u.moveEnd("character",
430
+ -1)}else{n=b.getNext(j);o=b.hasAscendant("pre");n=!(n&&n.getText&&n.getText().match(i))&&(o||!b.hasPrevious()||b.getPrevious().is&&b.getPrevious().is("br"));o=f.document.createElement("span");o.setHtml("&#65279;");o.insertBefore(b);n&&f.document.createText("").insertBefore(b)}f.setStartBefore(b);b.remove();if(a){if(n){u.moveStart("character",-1);u.select();f.document.$.selection.clear()}else u.select();f.moveToPosition(o,CKEDITOR.POSITION_BEFORE_START);o.remove()}else{f.setEndBefore(g);g.remove();
431
+ u.select()}}else{g=this.getNative();if(!g)return;this.removeAllRanges();for(u=0;u<a.length;u++){if(u<a.length-1){n=a[u];o=a[u+1];i=n.clone();i.setStart(n.endContainer,n.endOffset);i.setEnd(o.startContainer,o.startOffset);if(!i.collapsed){i.shrink(CKEDITOR.NODE_ELEMENT,true);f=i.getCommonAncestor();i=i.getEnclosedNode();if(f.isReadOnly()||i&&i.isReadOnly()){o.setStart(n.startContainer,n.startOffset);a.splice(u--,1);continue}}}f=a[u];o=this.document.$.createRange();if(f.collapsed&&CKEDITOR.env.webkit&&
432
+ e(f)){n=this.root;h(n,false);i=n.getDocument().createText("​");n.setCustomData("cke-fillingChar",i);f.insertNode(i);if((n=i.getNext())&&!i.getPrevious()&&n.type==CKEDITOR.NODE_ELEMENT&&n.getName()=="br"){h(this.root);f.moveToPosition(n,CKEDITOR.POSITION_BEFORE_START)}else f.moveToPosition(i,CKEDITOR.POSITION_AFTER_END)}o.setStart(f.startContainer.$,f.startOffset);try{o.setEnd(f.endContainer.$,f.endOffset)}catch(C){if(C.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")>=0){f.collapse(1);o.setEnd(f.endContainer.$,
433
+ f.endOffset)}else throw C;}g.addRange(o)}}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=v++;b._.fakeSelection=this;this.root.fire("selectionchange")},isHidden:function(){var a=this.getCommonAncestor();
433
434
  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,d=0;d<a.length;d++){var e=new CKEDITOR.dom.range(this.root);e.moveToBookmark(a[d]);b.push(e)}if(a.isFake){c=b[0].getEnclosedNode();if(!c||c.type!=CKEDITOR.NODE_ELEMENT)a.isFake=
434
- 0}a.isFake?this.fake(c):this.selectRanges(b);return this},getCommonAncestor:function(){var a=this.getRanges();return!a.length?null:a[0].startContainer.getCommonAncestor(a[a.length-1].endContainer)},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var a=this.getNative();try{a&&a[x?"empty":"removeAllRanges"]()}catch(b){}this.reset()}}}})();"use strict";CKEDITOR.STYLE_BLOCK=1;
435
+ 0}a.isFake?this.fake(c):this.selectRanges(b);return this},getCommonAncestor:function(){var a=this.getRanges();return!a.length?null:a[0].startContainer.getCommonAncestor(a[a.length-1].endContainer)},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var a=this.getNative();try{a&&a[w?"empty":"removeAllRanges"]()}catch(b){}this.reset()}}}})();"use strict";CKEDITOR.STYLE_BLOCK=1;
435
436
  CKEDITOR.STYLE_INLINE=2;CKEDITOR.STYLE_OBJECT=3;
436
437
  (function(){function a(a,b){for(var c,d;a=a.getParent();){if(a.equals(b))break;if(a.getAttribute("data-nostyle"))c=a;else if(!d){var e=a.getAttribute("contentEditable");e=="false"?c=a:e=="true"&&(d=1)}}return c}function d(b){var e=b.document;if(b.collapsed){e=t(this,e);b.insertNode(e);b.moveToPosition(e,CKEDITOR.POSITION_BEFORE_END)}else{var g=this.element,f=this._.definition,h,i=f.ignoreReadonly,j=i||f.includeReadonly;j==null&&(j=b.root.getCustomData("cke_includeReadonly"));var k=CKEDITOR.dtd[g];
437
- if(!k){h=true;k=CKEDITOR.dtd.span}b.enlarge(CKEDITOR.ENLARGE_INLINE,1);b.trim();var l=b.createBookmark(),n=l.startNode,o=l.endNode,m=n,s;if(!i){var p=b.getCommonAncestor(),i=a(n,p),p=a(o,p);i&&(m=i.getNextSourceNode(true));p&&(o=p)}for(m.getPosition(o)==CKEDITOR.POSITION_FOLLOWING&&(m=0);m;){i=false;if(m.equals(o)){m=null;i=true}else{var q=m.type==CKEDITOR.NODE_ELEMENT?m.getName():null,p=q&&m.getAttribute("contentEditable")=="false",u=q&&m.getAttribute("data-nostyle");if(q&&m.data("cke-bookmark")){m=
438
- m.getNextSourceNode(true);continue}if(p&&j&&CKEDITOR.dtd.$block[q])for(var w=m,B=c(w),x=void 0,A=B.length,C=0,w=A&&new CKEDITOR.dom.range(w.getDocument());C<A;++C){var x=B[C],F=CKEDITOR.filter.instances[x.data("cke-filter")];if(F?F.check(this):1){w.selectNodeContents(x);d.call(this,w)}}B=q?!k[q]||u?0:p&&!j?0:(m.getPosition(o)|K)==K&&(!f.childRule||f.childRule(m)):1;if(B)if((B=m.getParent())&&((B.getDtd()||CKEDITOR.dtd.span)[g]||h)&&(!f.parentRule||f.parentRule(B))){if(!s&&(!q||!CKEDITOR.dtd.$removeEmpty[q]||
439
- (m.getPosition(o)|K)==K)){s=b.clone();s.setStartBefore(m)}q=m.type;if(q==CKEDITOR.NODE_TEXT||p||q==CKEDITOR.NODE_ELEMENT&&!m.getChildCount()){for(var q=m,S;(i=!q.getNext(H))&&(S=q.getParent(),k[S.getName()])&&(S.getPosition(n)|E)==E&&(!f.childRule||f.childRule(S));)q=S;s.setEndAfter(q)}}else i=true;else i=true;m=m.getNextSourceNode(u||p)}if(i&&s&&!s.collapsed){for(var i=t(this,e),p=i.hasAttributes(),u=s.getCommonAncestor(),q={},B={},x={},A={},R,P,X;i&&u;){if(u.getName()==g){for(R in f.attributes)if(!A[R]&&
440
- (X=u.getAttribute(P)))i.getAttribute(R)==X?B[R]=1:A[R]=1;for(P in f.styles)if(!x[P]&&(X=u.getStyle(P)))i.getStyle(P)==X?q[P]=1:x[P]=1}u=u.getParent()}for(R in B)i.removeAttribute(R);for(P in q)i.removeStyle(P);p&&!i.hasAttributes()&&(i=null);if(i){s.extractContents().appendTo(i);s.insertNode(i);z.call(this,i);i.mergeSiblings();CKEDITOR.env.ie||i.$.normalize()}else{i=new CKEDITOR.dom.element("span");s.extractContents().appendTo(i);s.insertNode(i);z.call(this,i);i.remove(true)}s=null}}b.moveToBookmark(l);
438
+ if(!k){h=true;k=CKEDITOR.dtd.span}b.enlarge(CKEDITOR.ENLARGE_INLINE,1);b.trim();var l=b.createBookmark(),n=l.startNode,o=l.endNode,m=n,r;if(!i){var q=b.getCommonAncestor(),i=a(n,q),q=a(o,q);i&&(m=i.getNextSourceNode(true));q&&(o=q)}for(m.getPosition(o)==CKEDITOR.POSITION_FOLLOWING&&(m=0);m;){i=false;if(m.equals(o)){m=null;i=true}else{var p=m.type==CKEDITOR.NODE_ELEMENT?m.getName():null,q=p&&m.getAttribute("contentEditable")=="false",s=p&&m.getAttribute("data-nostyle");if(p&&m.data("cke-bookmark")){m=
439
+ m.getNextSourceNode(true);continue}if(q&&j&&CKEDITOR.dtd.$block[p])for(var v=m,A=c(v),w=void 0,z=A.length,B=0,v=z&&new CKEDITOR.dom.range(v.getDocument());B<z;++B){var w=A[B],F=CKEDITOR.filter.instances[w.data("cke-filter")];if(F?F.check(this):1){v.selectNodeContents(w);d.call(this,v)}}A=p?!k[p]||s?0:q&&!j?0:(m.getPosition(o)|L)==L&&(!f.childRule||f.childRule(m)):1;if(A)if((A=m.getParent())&&((A.getDtd()||CKEDITOR.dtd.span)[g]||h)&&(!f.parentRule||f.parentRule(A))){if(!r&&(!p||!CKEDITOR.dtd.$removeEmpty[p]||
440
+ (m.getPosition(o)|L)==L)){r=b.clone();r.setStartBefore(m)}p=m.type;if(p==CKEDITOR.NODE_TEXT||q||p==CKEDITOR.NODE_ELEMENT&&!m.getChildCount()){for(var p=m,S;(i=!p.getNext(I))&&(S=p.getParent(),k[S.getName()])&&(S.getPosition(n)|E)==E&&(!f.childRule||f.childRule(S));)p=S;r.setEndAfter(p)}}else i=true;else i=true;m=m.getNextSourceNode(s||q)}if(i&&r&&!r.collapsed){for(var i=t(this,e),q=i.hasAttributes(),s=r.getCommonAncestor(),p={},A={},w={},z={},R,P,X;i&&s;){if(s.getName()==g){for(R in f.attributes)if(!z[R]&&
441
+ (X=s.getAttribute(P)))i.getAttribute(R)==X?A[R]=1:z[R]=1;for(P in f.styles)if(!w[P]&&(X=s.getStyle(P)))i.getStyle(P)==X?p[P]=1:w[P]=1}s=s.getParent()}for(R in A)i.removeAttribute(R);for(P in p)i.removeStyle(P);q&&!i.hasAttributes()&&(i=null);if(i){r.extractContents().appendTo(i);r.insertNode(i);y.call(this,i);i.mergeSiblings();CKEDITOR.env.ie||i.$.normalize()}else{i=new CKEDITOR.dom.element("span");r.extractContents().appendTo(i);r.insertNode(i);y.call(this,i);i.remove(true)}r=null}}b.moveToBookmark(l);
441
442
  b.shrink(CKEDITOR.SHRINK_TEXT);b.shrink(CKEDITOR.NODE_ELEMENT,true)}}function b(a){function b(){for(var a=new CKEDITOR.dom.elementPath(d.getParent()),c=new CKEDITOR.dom.elementPath(j.getParent()),e=null,g=null,f=0;f<a.elements.length;f++){var h=a.elements[f];if(h==a.block||h==a.blockLimit)break;k.checkElementRemovable(h,true)&&(e=h)}for(f=0;f<c.elements.length;f++){h=c.elements[f];if(h==c.block||h==c.blockLimit)break;k.checkElementRemovable(h,true)&&(g=h)}g&&j.breakParent(g);e&&d.breakParent(e)}a.enlarge(CKEDITOR.ENLARGE_INLINE,
442
- 1);var c=a.createBookmark(),d=c.startNode;if(a.collapsed){for(var e=new CKEDITOR.dom.elementPath(d.getParent(),a.root),g,f=0,h;f<e.elements.length&&(h=e.elements[f]);f++){if(h==e.block||h==e.blockLimit)break;if(this.checkElementRemovable(h)){var i;if(a.collapsed&&(a.checkBoundaryOfElement(h,CKEDITOR.END)||(i=a.checkBoundaryOfElement(h,CKEDITOR.START)))){g=h;g.match=i?"start":"end"}else{h.mergeSiblings();h.is(this.element)?s.call(this,h):o(h,C(this)[h.getName()])}}}if(g){h=d;for(f=0;;f++){i=e.elements[f];
443
- if(i.equals(g))break;else if(i.match)continue;else i=i.clone();i.append(h);h=i}h[g.match=="start"?"insertBefore":"insertAfter"](g)}}else{var j=c.endNode,k=this;b();for(e=d;!e.equals(j);){g=e.getNextSourceNode();if(e.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(e)){e.getName()==this.element?s.call(this,e):o(e,C(this)[e.getName()]);if(g.type==CKEDITOR.NODE_ELEMENT&&g.contains(d)){b();g=d.getNext()}}e=g}}a.moveToBookmark(c);a.shrink(CKEDITOR.NODE_ELEMENT,true)}function c(a){var b=[];a.forEach(function(a){if(a.getAttribute("contenteditable")==
444
- "true"){b.push(a);return false}},CKEDITOR.NODE_ELEMENT,true);return b}function e(a){var b=a.getEnclosedNode()||a.getCommonAncestor(false,true);(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1))&&!a.isReadOnly()&&x(a,this)}function f(a){var b=a.getCommonAncestor(true,true);if(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1)){var b=this._.definition,c=b.attributes;if(c)for(var d in c)a.removeAttribute(d,c[d]);if(b.styles)for(var e in b.styles)b.styles.hasOwnProperty(e)&&
443
+ 1);var c=a.createBookmark(),d=c.startNode;if(a.collapsed){for(var e=new CKEDITOR.dom.elementPath(d.getParent(),a.root),g,f=0,h;f<e.elements.length&&(h=e.elements[f]);f++){if(h==e.block||h==e.blockLimit)break;if(this.checkElementRemovable(h)){var i;if(a.collapsed&&(a.checkBoundaryOfElement(h,CKEDITOR.END)||(i=a.checkBoundaryOfElement(h,CKEDITOR.START)))){g=h;g.match=i?"start":"end"}else{h.mergeSiblings();h.is(this.element)?r.call(this,h):o(h,B(this)[h.getName()])}}}if(g){h=d;for(f=0;;f++){i=e.elements[f];
444
+ if(i.equals(g))break;else if(i.match)continue;else i=i.clone();i.append(h);h=i}h[g.match=="start"?"insertBefore":"insertAfter"](g)}}else{var j=c.endNode,k=this;b();for(e=d;!e.equals(j);){g=e.getNextSourceNode();if(e.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(e)){e.getName()==this.element?r.call(this,e):o(e,B(this)[e.getName()]);if(g.type==CKEDITOR.NODE_ELEMENT&&g.contains(d)){b();g=d.getNext()}}e=g}}a.moveToBookmark(c);a.shrink(CKEDITOR.NODE_ELEMENT,true)}function c(a){var b=[];a.forEach(function(a){if(a.getAttribute("contenteditable")==
445
+ "true"){b.push(a);return false}},CKEDITOR.NODE_ELEMENT,true);return b}function e(a){var b=a.getEnclosedNode()||a.getCommonAncestor(false,true);(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1))&&!a.isReadOnly()&&w(a,this)}function f(a){var b=a.getCommonAncestor(true,true);if(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1)){var b=this._.definition,c=b.attributes;if(c)for(var d in c)a.removeAttribute(d,c[d]);if(b.styles)for(var e in b.styles)b.styles.hasOwnProperty(e)&&
445
446
  a.removeStyle(e)}}function h(a){var b=a.createBookmark(true),c=a.createIterator();c.enforceRealBlocks=true;if(this._.enterMode)c.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var d,e=a.document,g;d=c.getNextParagraph();)if(!d.isReadOnly()&&(c.activeFilter?c.activeFilter.check(this):1)){g=t(this,e,d);j(d,g)}a.moveToBookmark(b)}function i(a){var b=a.createBookmark(1),c=a.createIterator();c.enforceRealBlocks=true;c.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var d,e;d=c.getNextParagraph();)if(this.checkElementRemovable(d))if(d.is("pre")){(e=
446
- this._.enterMode==CKEDITOR.ENTER_BR?null:a.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&d.copyAttributes(e);j(d,e)}else s.call(this,d);a.moveToBookmark(b)}function j(a,b){var c=!b;if(c){b=a.getDocument().createElement("div");a.copyAttributes(b)}var d=b&&b.is("pre"),e=a.is("pre"),f=!d&&e;if(d&&!e){e=b;(f=a.getBogus())&&f.remove();f=a.getHtml();f=g(f,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");f=f.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+|&nbsp;)/g,
447
- " ");f=f.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var h=a.getDocument().createElement("div");h.append(e);e.$.outerHTML="<pre>"+f+"</pre>";e.copyAttributes(h.getFirst());e=h.getFirst().remove()}else e.setHtml(f);b=e}else f?b=B(c?[a.getHtml()]:n(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,i;if((i=c.getPrevious(A))&&i.type==CKEDITOR.NODE_ELEMENT&&i.is("pre")){d=g(i.getHtml(),/\n$/,"")+"\n\n"+g(c.getHtml(),/^\n/,"");CKEDITOR.env.ie?c.$.outerHTML="<pre>"+d+"</pre>":c.setHtml(d);i.remove()}}else c&&
448
- p(b)}function n(a){var b=[];g(a.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"</pre>"+c+"<pre>"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function g(a,b,c){var d="",e="",a=a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<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 B(a,b){var c;a.length>1&&(c=new CKEDITOR.dom.documentFragment(b.getDocument()));
449
- for(var d=0;d<a.length;d++){var e=a[d],e=e.replace(/(\r\n|\r)/g,"\n"),e=g(e,/^[ \t]*\n/,""),e=g(e,/\n$/,""),e=g(e,/^[ \t]+|[ \t]+$/g,function(a,b){return a.length==1?"&nbsp;":b?" "+CKEDITOR.tools.repeat("&nbsp;",a.length-1):CKEDITOR.tools.repeat("&nbsp;",a.length-1)+" "}),e=e.replace(/\n/g,"<br>"),e=e.replace(/[ \t]{2,}/g,function(a){return CKEDITOR.tools.repeat("&nbsp;",a.length-1)+" "});if(c){var f=b.clone();f.setHtml(e);c.append(f)}else b.setHtml(e)}return c||b}function s(a,b){var c=this._.definition,
450
- d=c.attributes,c=c.styles,e=C(this)[a.getName()],g=CKEDITOR.tools.isEmpty(d)&&CKEDITOR.tools.isEmpty(c),f;for(f in d)if(!((f=="class"||this._.definition.fullMatch)&&a.getAttribute(f)!=l(f,d[f]))&&!(b&&f.slice(0,5)=="data-")){g=a.hasAttribute(f);a.removeAttribute(f)}for(var h in c)if(!(this._.definition.fullMatch&&a.getStyle(h)!=l(h,c[h],true))){g=g||!!a.getStyle(h);a.removeStyle(h)}o(a,e,k[a.getName()]);g&&(this._.definition.alwaysRemoveElement?p(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==
451
- CKEDITOR.ENTER_BR&&!a.hasAttributes()?p(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function z(a){for(var b=C(this),c=a.getElementsByTag(this.element),d,e=c.count();--e>=0;){d=c.getItem(e);d.isReadOnly()||s.call(this,d,true)}for(var g in b)if(g!=this.element){c=a.getElementsByTag(g);for(e=c.count()-1;e>=0;e--){d=c.getItem(e);d.isReadOnly()||o(d,b[g])}}}function o(a,b,c){if(b=b&&b.attributes)for(var d=0;d<b.length;d++){var e=b[d][0],g;if(g=a.getAttribute(e)){var f=b[d][1];(f===null||
452
- f.test&&f.test(g)||typeof f=="string"&&g==f)&&a.removeAttribute(e)}}c||p(a)}function p(a,b){if(!a.hasAttributes()||b)if(CKEDITOR.dtd.$block[a.getName()]){var c=a.getPrevious(A),d=a.getNext(A);c&&(c.type==CKEDITOR.NODE_TEXT||!c.isBlockBoundary({br:1}))&&a.append("br",1);d&&(d.type==CKEDITOR.NODE_TEXT||!d.isBlockBoundary({br:1}))&&a.append("br");a.remove(true)}else{c=a.getFirst();d=a.getLast();a.remove(true);if(c){c.type==CKEDITOR.NODE_ELEMENT&&c.mergeSiblings();d&&(!c.equals(d)&&d.type==CKEDITOR.NODE_ELEMENT)&&
453
- d.mergeSiblings()}}}function t(a,b,c){var d;d=a.element;d=="*"&&(d="span");d=new CKEDITOR.dom.element(d,b);c&&c.copyAttributes(d);d=x(d,a);b.getCustomData("doc_processing_style")&&d.hasAttribute("id")?d.removeAttribute("id"):b.setCustomData("doc_processing_style",1);return d}function x(a,b){var c=b._.definition,d=c.attributes,c=CKEDITOR.style.getStyleText(c);if(d)for(var e in d)a.setAttribute(e,d[e]);c&&a.setAttribute("style",c);return a}function u(a,b){for(var c in a)a[c]=a[c].replace(w,function(a,
454
- c){return b[c]})}function C(a){if(a._.overrides)return a._.overrides;var b=a._.overrides={},c=a._.definition.overrides;if(c){CKEDITOR.tools.isArray(c)||(c=[c]);for(var d=0;d<c.length;d++){var e=c[d],g,f;if(typeof e=="string")g=e.toLowerCase();else{g=e.element?e.element.toLowerCase():a.element;f=e.attributes}e=b[g]||(b[g]={});if(f){var e=e.attributes=e.attributes||[],h;for(h in f)e.push([h.toLowerCase(),f[h]])}}}return b}function l(a,b,c){var d=new CKEDITOR.dom.element("span");d[c?"setStyle":"setAttribute"](a,
455
- b);return d[c?"getStyle":"getAttribute"](a)}function q(a,b,c){for(var d=a.document,e=a.getRanges(),b=b?this.removeFromRange:this.applyToRange,g,f=e.createIterator();g=f.getNextRange();)b.call(this,g,c);a.selectRanges(e);d.removeCustomData("doc_processing_style")}var k={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},m=
456
- {a:1,blockquote:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},F=/\s*(?:;\s*|$)/,w=/#\((.+?)\)/g,H=CKEDITOR.dom.walker.bookmark(0,1),A=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,b){if(typeof a.type=="string")return new CKEDITOR.style.customHandlers[a.type](a);var c=a.attributes;if(c&&c.style){a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(c.style));delete c.style}if(b){a=CKEDITOR.tools.clone(a);u(a.attributes,
457
- b);u(a.styles,b)}c=this.element=a.element?typeof a.element=="string"?a.element.toLowerCase():a.element:"*";this.type=a.type||(k[c]?CKEDITOR.STYLE_BLOCK:m[c]?CKEDITOR.STYLE_OBJECT:CKEDITOR.STYLE_INLINE);if(typeof this.element=="object")this.type=CKEDITOR.STYLE_OBJECT;this._={definition:a}};CKEDITOR.style.prototype={apply:function(a){if(a instanceof CKEDITOR.dom.document)return q.call(this,a.getSelection());if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;if(!b)this._.enterMode=a.activeEnterMode;
458
- q.call(this,a.getSelection(),0,a);this._.enterMode=b}},remove:function(a){if(a instanceof CKEDITOR.dom.document)return q.call(this,a.getSelection(),1);if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;if(!b)this._.enterMode=a.activeEnterMode;q.call(this,a.getSelection(),1,a);this._.enterMode=b}},applyToRange:function(a){this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?d:this.type==CKEDITOR.STYLE_BLOCK?h:this.type==CKEDITOR.STYLE_OBJECT?e:null;return this.applyToRange(a)},removeFromRange:function(a){this.removeFromRange=
459
- this.type==CKEDITOR.STYLE_INLINE?b:this.type==CKEDITOR.STYLE_BLOCK?i:this.type==CKEDITOR.STYLE_OBJECT?f:null;return this.removeFromRange(a)},applyToObject:function(a){x(a,this)},checkActive:function(a,b){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(a.block||a.blockLimit,true,b);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var c=a.elements,d=0,e;d<c.length;d++){e=c[d];if(!(this.type==CKEDITOR.STYLE_INLINE&&(e==a.block||e==a.blockLimit))){if(this.type==
447
+ this._.enterMode==CKEDITOR.ENTER_BR?null:a.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&d.copyAttributes(e);j(d,e)}else r.call(this,d);a.moveToBookmark(b)}function j(a,b){var c=!b;if(c){b=a.getDocument().createElement("div");a.copyAttributes(b)}var d=b&&b.is("pre"),e=a.is("pre"),f=!d&&e;if(d&&!e){e=b;(f=a.getBogus())&&f.remove();f=a.getHtml();f=g(f,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");f=f.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+|&nbsp;)/g,
448
+ " ");f=f.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var h=a.getDocument().createElement("div");h.append(e);e.$.outerHTML="<pre>"+f+"</pre>";e.copyAttributes(h.getFirst());e=h.getFirst().remove()}else e.setHtml(f);b=e}else f?b=A(c?[a.getHtml()]:n(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,i;if((i=c.getPrevious(z))&&i.type==CKEDITOR.NODE_ELEMENT&&i.is("pre")){d=g(i.getHtml(),/\n$/,"")+"\n\n"+g(c.getHtml(),/^\n/,"");CKEDITOR.env.ie?c.$.outerHTML="<pre>"+d+"</pre>":c.setHtml(d);i.remove()}}else c&&
449
+ q(b)}function n(a){var b=[];g(a.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"</pre>"+c+"<pre>"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function g(a,b,c){var d="",e="",a=a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<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 A(a,b){var c;a.length>1&&(c=new CKEDITOR.dom.documentFragment(b.getDocument()));
450
+ for(var d=0;d<a.length;d++){var e=a[d],e=e.replace(/(\r\n|\r)/g,"\n"),e=g(e,/^[ \t]*\n/,""),e=g(e,/\n$/,""),e=g(e,/^[ \t]+|[ \t]+$/g,function(a,b){return a.length==1?"&nbsp;":b?" "+CKEDITOR.tools.repeat("&nbsp;",a.length-1):CKEDITOR.tools.repeat("&nbsp;",a.length-1)+" "}),e=e.replace(/\n/g,"<br>"),e=e.replace(/[ \t]{2,}/g,function(a){return CKEDITOR.tools.repeat("&nbsp;",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,
451
+ d=c.attributes,c=c.styles,e=B(this)[a.getName()],g=CKEDITOR.tools.isEmpty(d)&&CKEDITOR.tools.isEmpty(c),f;for(f in d)if(!((f=="class"||this._.definition.fullMatch)&&a.getAttribute(f)!=l(f,d[f]))&&!(b&&f.slice(0,5)=="data-")){g=a.hasAttribute(f);a.removeAttribute(f)}for(var h in c)if(!(this._.definition.fullMatch&&a.getStyle(h)!=l(h,c[h],true))){g=g||!!a.getStyle(h);a.removeStyle(h)}o(a,e,k[a.getName()]);g&&(this._.definition.alwaysRemoveElement?q(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==
452
+ CKEDITOR.ENTER_BR&&!a.hasAttributes()?q(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function y(a){for(var b=B(this),c=a.getElementsByTag(this.element),d,e=c.count();--e>=0;){d=c.getItem(e);d.isReadOnly()||r.call(this,d,true)}for(var g in b)if(g!=this.element){c=a.getElementsByTag(g);for(e=c.count()-1;e>=0;e--){d=c.getItem(e);d.isReadOnly()||o(d,b[g])}}}function o(a,b,c){if(b=b&&b.attributes)for(var d=0;d<b.length;d++){var e=b[d][0],g;if(g=a.getAttribute(e)){var f=b[d][1];(f===null||
453
+ f.test&&f.test(g)||typeof f=="string"&&g==f)&&a.removeAttribute(e)}}c||q(a)}function q(a,b){if(!a.hasAttributes()||b)if(CKEDITOR.dtd.$block[a.getName()]){var c=a.getPrevious(z),d=a.getNext(z);c&&(c.type==CKEDITOR.NODE_TEXT||!c.isBlockBoundary({br:1}))&&a.append("br",1);d&&(d.type==CKEDITOR.NODE_TEXT||!d.isBlockBoundary({br:1}))&&a.append("br");a.remove(true)}else{c=a.getFirst();d=a.getLast();a.remove(true);if(c){c.type==CKEDITOR.NODE_ELEMENT&&c.mergeSiblings();d&&(!c.equals(d)&&d.type==CKEDITOR.NODE_ELEMENT)&&
454
+ d.mergeSiblings()}}}function t(a,b,c){var d;d=a.element;d=="*"&&(d="span");d=new CKEDITOR.dom.element(d,b);c&&c.copyAttributes(d);d=w(d,a);b.getCustomData("doc_processing_style")&&d.hasAttribute("id")?d.removeAttribute("id"):b.setCustomData("doc_processing_style",1);return d}function w(a,b){var c=b._.definition,d=c.attributes,c=CKEDITOR.style.getStyleText(c);if(d)for(var e in d)a.setAttribute(e,d[e]);c&&a.setAttribute("style",c);return a}function v(a,b){for(var c in a)a[c]=a[c].replace(p,function(a,
455
+ c){return b[c]})}function B(a){if(a._.overrides)return a._.overrides;var b=a._.overrides={},c=a._.definition.overrides;if(c){CKEDITOR.tools.isArray(c)||(c=[c]);for(var d=0;d<c.length;d++){var e=c[d],g,f;if(typeof e=="string")g=e.toLowerCase();else{g=e.element?e.element.toLowerCase():a.element;f=e.attributes}e=b[g]||(b[g]={});if(f){var e=e.attributes=e.attributes||[],h;for(h in f)e.push([h.toLowerCase(),f[h]])}}}return b}function l(a,b,c){var d=new CKEDITOR.dom.element("span");d[c?"setStyle":"setAttribute"](a,
456
+ b);return d[c?"getStyle":"getAttribute"](a)}function s(a,b,c){for(var d=a.document,e=a.getRanges(),b=b?this.removeFromRange:this.applyToRange,g,f=e.createIterator();g=f.getNextRange();)b.call(this,g,c);a.selectRanges(e);d.removeCustomData("doc_processing_style")}var k={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},m=
457
+ {a:1,blockquote:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},F=/\s*(?:;\s*|$)/,p=/#\((.+?)\)/g,I=CKEDITOR.dom.walker.bookmark(0,1),z=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,b){if(typeof a.type=="string")return new CKEDITOR.style.customHandlers[a.type](a);var c=a.attributes;if(c&&c.style){a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(c.style));delete c.style}if(b){a=CKEDITOR.tools.clone(a);v(a.attributes,
458
+ b);v(a.styles,b)}c=this.element=a.element?typeof a.element=="string"?a.element.toLowerCase():a.element:"*";this.type=a.type||(k[c]?CKEDITOR.STYLE_BLOCK:m[c]?CKEDITOR.STYLE_OBJECT:CKEDITOR.STYLE_INLINE);if(typeof this.element=="object")this.type=CKEDITOR.STYLE_OBJECT;this._={definition:a}};CKEDITOR.style.prototype={apply:function(a){if(a instanceof CKEDITOR.dom.document)return s.call(this,a.getSelection());if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;if(!b)this._.enterMode=a.activeEnterMode;
459
+ s.call(this,a.getSelection(),0,a);this._.enterMode=b}},remove:function(a){if(a instanceof CKEDITOR.dom.document)return s.call(this,a.getSelection(),1);if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;if(!b)this._.enterMode=a.activeEnterMode;s.call(this,a.getSelection(),1,a);this._.enterMode=b}},applyToRange:function(a){this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?d:this.type==CKEDITOR.STYLE_BLOCK?h:this.type==CKEDITOR.STYLE_OBJECT?e:null;return this.applyToRange(a)},removeFromRange:function(a){this.removeFromRange=
460
+ this.type==CKEDITOR.STYLE_INLINE?b:this.type==CKEDITOR.STYLE_BLOCK?i:this.type==CKEDITOR.STYLE_OBJECT?f:null;return this.removeFromRange(a)},applyToObject:function(a){w(a,this)},checkActive:function(a,b){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(a.block||a.blockLimit,true,b);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var c=a.elements,d=0,e;d<c.length;d++){e=c[d];if(!(this.type==CKEDITOR.STYLE_INLINE&&(e==a.block||e==a.blockLimit))){if(this.type==
460
461
  CKEDITOR.STYLE_OBJECT){var g=e.getName();if(!(typeof this.element=="string"?g==this.element:g in this.element))continue}if(this.checkElementRemovable(e,true,b))return true}}}return false},checkApplicable:function(a,b,c){b&&b instanceof CKEDITOR.filter&&(c=b);if(c&&!c.check(this))return false;switch(this.type){case CKEDITOR.STYLE_OBJECT:return!!a.contains(this.element);case CKEDITOR.STYLE_BLOCK:return!!a.blockLimit.getDtd()[this.element]}return true},checkElementMatch:function(a,b){var c=this._.definition;
461
462
  if(!a||!c.ignoreReadonly&&a.isReadOnly())return false;var d=a.getName();if(typeof this.element=="string"?d==this.element:d in this.element){if(!b&&!a.hasAttributes())return true;if(d=c._AC)c=d;else{var d={},e=0,g=c.attributes;if(g)for(var f in g){e++;d[f]=g[f]}if(f=CKEDITOR.style.getStyleText(c)){d.style||e++;d.style=f}d._length=e;c=c._AC=d}if(c._length){for(var h in c)if(h!="_length"){e=a.getAttribute(h)||"";if(h=="style")a:{d=c[h];typeof d=="string"&&(d=CKEDITOR.tools.parseCssText(d));typeof e==
462
- "string"&&(e=CKEDITOR.tools.parseCssText(e,true));f=void 0;for(f in d)if(!(f in e&&(e[f]==d[f]||d[f]=="inherit"||e[f]=="inherit"))){d=false;break a}d=true}else d=c[h]==e;if(d){if(!b)return true}else if(b)return false}if(b)return true}else return true}return false},checkElementRemovable:function(a,b,c){if(this.checkElementMatch(a,b,c))return true;if(b=C(this)[a.getName()]){var d;if(!(b=b.attributes))return true;for(c=0;c<b.length;c++){d=b[c][0];if(d=a.getAttribute(d)){var e=b[c][1];if(e===null)return true;
463
+ "string"&&(e=CKEDITOR.tools.parseCssText(e,true));f=void 0;for(f in d)if(!(f in e&&(e[f]==d[f]||d[f]=="inherit"||e[f]=="inherit"))){d=false;break a}d=true}else d=c[h]==e;if(d){if(!b)return true}else if(b)return false}if(b)return true}else return true}return false},checkElementRemovable:function(a,b,c){if(this.checkElementMatch(a,b,c))return true;if(b=B(this)[a.getName()]){var d;if(!(b=b.attributes))return true;for(c=0;c<b.length;c++){d=b[c][0];if(d=a.getAttribute(d)){var e=b[c][1];if(e===null)return true;
463
464
  if(typeof e=="string"){if(d==e)return true}else if(e.test(d))return true}}}return false},buildPreview:function(a){var b=this._.definition,c=[],d=b.element;d=="bdo"&&(d="span");var c=["<",d],e=b.attributes;if(e)for(var g in e)c.push(" ",g,'="',e[g],'"');(e=CKEDITOR.style.getStyleText(b))&&c.push(' style="',e,'"');c.push(">",a||b.name,"</",d,">");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=
464
465
  a.attributes&&a.attributes.style||"",d="";c.length&&(c=c.replace(F,";"));for(var e in b){var g=b[e],f=(e+":"+g).replace(F,";");g=="inherit"?d=d+f:c=c+f}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);
465
- return this.customHandlers[a.type]=b};var K=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,E=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED})();CKEDITOR.styleCommand=function(a,d){this.requiredContent=this.allowedContent=this.style=a;CKEDITOR.tools.extend(this,d,true)};
466
+ return this.customHandlers[a.type]=b};var L=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,E=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED})();CKEDITOR.styleCommand=function(a,d){this.requiredContent=this.allowedContent=this.style=a;CKEDITOR.tools.extend(this,d,true)};
466
467
  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,d,b){CKEDITOR.stylesSet.addExternal(a,d,"");CKEDITOR.stylesSet.load(a,b)};
467
468
  CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(a,d){var b=this._.styleStateChangeCallbacks;if(!b){b=this._.styleStateChangeCallbacks=[];this.on("selectionChange",function(a){for(var d=0;d<b.length;d++){var f=b[d],h=f.style.checkActive(a.data.path,this)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;f.fn.call(this,h)}})}b.push({style:a,fn:d})},applyStyle:function(a){a.apply(this)},removeStyle:function(a){a.remove(this)},getStylesSet:function(a){if(this._.stylesDefinitions)a(this._.stylesDefinitions);
468
469
  else{var d=this,b=d.config.stylesCombo_stylesSet||d.config.stylesSet;if(b===false)a(null);else if(b instanceof Array){d._.stylesDefinitions=b;a(b)}else{b||(b="default");var b=b.split(":"),c=b[0];CKEDITOR.stylesSet.addExternal(c,b[1]?b.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),"");CKEDITOR.stylesSet.load(c,function(b){d._.stylesDefinitions=b[c];a(d._.stylesDefinitions)})}}}});
469
470
  CKEDITOR.dom.comment=function(a,d){typeof a=="string"&&(a=(d?d.$:document).createComment(a));CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"<\!--"+this.$.nodeValue+"--\>"}});"use strict";
470
471
  (function(){var a={},d={},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||(d[b]=1);CKEDITOR.dom.elementPath=function(b,e){var f=null,h=null,i=[],j=b,n,e=e||b.getDocument().getBody();do if(j.type==CKEDITOR.NODE_ELEMENT){i.push(j);if(!this.lastElement){this.lastElement=j;if(j.is(CKEDITOR.dtd.$object)||j.getAttribute("contenteditable")=="false")continue}if(j.equals(e))break;if(!h){n=j.getName();
471
- j.getAttribute("contenteditable")=="true"?h=j:!f&&d[n]&&(f=j);if(a[n]){var g;if(g=!f){if(n=n=="div"){a:{n=j.getChildren();g=0;for(var B=n.count();g<B;g++){var s=n.getItem(g);if(s.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[s.getName()]){n=true;break a}}n=false}n=!n}g=n}g?f=j:h=j}}}while(j=j.getParent());h||(h=e);this.block=f;this.blockLimit=h;this.root=e;this.elements=i}})();
472
+ j.getAttribute("contenteditable")=="true"?h=j:!f&&d[n]&&(f=j);if(a[n]){var g;if(g=!f){if(n=n=="div"){a:{n=j.getChildren();g=0;for(var A=n.count();g<A;g++){var r=n.getItem(g);if(r.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[r.getName()]){n=true;break a}}n=false}n=!n}g=n}g?f=j:h=j}}}while(j=j.getParent());h||(h=e);this.block=f;this.blockLimit=h;this.root=e;this.elements=i}})();
472
473
  CKEDITOR.dom.elementPath.prototype={compare:function(a){var d=this.elements,a=a&&a.elements;if(!a||d.length!=a.length)return false;for(var b=0;b<d.length;b++)if(!d[b].equals(a[b]))return false;return true},contains:function(a,d,b){var c;typeof a=="string"&&(c=function(b){return b.getName()==a});a instanceof CKEDITOR.dom.element?c=function(b){return b.equals(a)}:CKEDITOR.tools.isArray(a)?c=function(b){return CKEDITOR.tools.indexOf(a,b.getName())>-1}:typeof a=="function"?c=a:typeof a=="object"&&(c=
473
474
  function(b){return b.getName()in a});var e=this.elements,f=e.length;d&&f--;if(b){e=Array.prototype.slice.call(e,0);e.reverse()}for(d=0;d<f;d++)if(c(e[d]))return e[d];return null},isContextFor:function(a){var d;if(a in CKEDITOR.dtd.$block){d=this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit;return!!d.getDtd()[a]}return true},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}};
474
475
  CKEDITOR.dom.text=function(a,d){typeof a=="string"&&(a=(d?d.$:document).createTextNode(a));this.$=a};CKEDITOR.dom.text.prototype=new CKEDITOR.dom.node;
@@ -621,46 +622,47 @@ tr:1,ol:1,ul:1};a[d.getName()];)d=d.getParent();for(b=null;0<e.length;){for(a=e.
621
622
  for(d={};a=f.getNextParagraph();){for(e=c=null;a.getParent();){if("blockquote"==a.getParent().getName()){c=a.getParent();e=a;break}a=a.getParent()}c&&(e&&!e.getCustomData("blockquote_moveout"))&&(b.push(e),CKEDITOR.dom.element.setMarker(d,e,"blockquote_moveout",!0))}CKEDITOR.dom.element.clearAllMarkers(d);a=[];e=[];for(d={};0<b.length;)f=b.shift(),c=f.getParent(),f.getPrevious()?f.getNext()?(f.breakParent(f.getParent()),e.push(f.getNext())):f.remove().insertAfter(c):f.remove().insertBefore(c),c.getCustomData("blockquote_processed")||
622
623
  (e.push(c),CKEDITOR.dom.element.setMarker(d,c,"blockquote_processed",!0)),a.push(f);CKEDITOR.dom.element.clearAllMarkers(d);for(b=e.length-1;0<=b;b--){c=e[b];a:{d=c;for(var f=0,k=d.getChildCount(),j=void 0;f<k&&(j=d.getChild(f));f++)if(j.type==CKEDITOR.NODE_ELEMENT&&j.isBlockBoundary()){d=!1;break a}d=!0}d&&c.remove()}if(g.config.enterMode==CKEDITOR.ENTER_BR)for(c=!0;a.length;)if(f=a.shift(),"div"==f.getName()){b=new CKEDITOR.dom.documentFragment(g.document);c&&(f.getPrevious()&&!(f.getPrevious().type==
623
624
  CKEDITOR.NODE_ELEMENT&&f.getPrevious().isBlockBoundary()))&&b.append(g.document.createElement("br"));for(c=f.getNext()&&!(f.getNext().type==CKEDITOR.NODE_ELEMENT&&f.getNext().isBlockBoundary());f.getFirst();)f.getFirst().remove().appendTo(b);c&&b.append(g.document.createElement("br"));b.replace(f);c=!1}}i.selectBookmarks(h);g.focus()}},refresh:function(g,a){this.setState(g.elementPath(a.block||a.blockLimit).contains("blockquote",1)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)},context:"blockquote",
624
- allowedContent:"blockquote",requiredContent:"blockquote"};CKEDITOR.plugins.add("blockquote",{init:function(g){g.blockless||(g.addCommand("blockquote",k),g.ui.addButton&&g.ui.addButton("Blockquote",{label:g.lang.blockquote.toolbar,command:"blockquote",toolbar:"blocks,10"}))}})})();(function(){function o(b,a,c){a.type||(a.type="auto");if(c&&!1===b.fire("beforePaste",a)||!a.dataValue&&a.dataTransfer.isEmpty())return!1;a.dataValue||(a.dataValue="");if(CKEDITOR.env.gecko&&"drop"==a.method&&b.toolbox)b.once("afterPaste",function(){b.toolbox.focus()});return b.fire("paste",a)}function v(b){function a(){var a=b.editable();if(CKEDITOR.plugins.clipboard.isCustomCopyCutSupported){var d=function(a){l.initPasteDataTransfer(a,b);a.data.preventDefault()};a.on("copy",d);a.on("cut",d);a.on("cut",
625
- function(){b.extractSelectedHtml()},null,null,999)}a.on(l.mainPasteEvent,function(b){"beforepaste"==l.mainPasteEvent&&m||i(b)});"beforepaste"==l.mainPasteEvent&&(a.on("paste",function(a){r||(e(),a.data.preventDefault(),i(a),f("paste")||b.openDialog("paste"))}),a.on("contextmenu",g,null,null,0),a.on("beforepaste",function(b){b.data&&(!b.data.$.ctrlKey&&!b.data.$.shiftKey)&&g()},null,null,0));a.on("beforecut",function(){!m&&h(b)});var c;a.attachListener(CKEDITOR.env.ie?a:b.document.getDocumentElement(),
625
+ allowedContent:"blockquote",requiredContent:"blockquote"};CKEDITOR.plugins.add("blockquote",{init:function(g){g.blockless||(g.addCommand("blockquote",k),g.ui.addButton&&g.ui.addButton("Blockquote",{label:g.lang.blockquote.toolbar,command:"blockquote",toolbar:"blocks,10"}))}})})();(function(){function o(b,a,c){a.type||(a.type="auto");if(c&&!1===b.fire("beforePaste",a)||!a.dataValue&&a.dataTransfer.isEmpty())return!1;a.dataValue||(a.dataValue="");if(CKEDITOR.env.gecko&&"drop"==a.method&&b.toolbox)b.once("afterPaste",function(){b.toolbox.focus()});return b.fire("paste",a)}function v(b){function a(){var a=b.editable();if(CKEDITOR.plugins.clipboard.isCustomCopyCutSupported){var d=function(a){k.initPasteDataTransfer(a,b);a.data.preventDefault()};a.on("copy",d);a.on("cut",d);a.on("cut",
626
+ function(){b.extractSelectedHtml()},null,null,999)}a.on(k.mainPasteEvent,function(b){"beforepaste"==k.mainPasteEvent&&m||l(b)});"beforepaste"==k.mainPasteEvent&&(a.on("paste",function(a){r||(e(),a.data.preventDefault(),l(a),f("paste")||b.openDialog("paste"))}),a.on("contextmenu",g,null,null,0),a.on("beforepaste",function(b){b.data&&(!b.data.$.ctrlKey&&!b.data.$.shiftKey)&&g()},null,null,0));a.on("beforecut",function(){!m&&h(b)});var c;a.attachListener(CKEDITOR.env.ie?a:b.document.getDocumentElement(),
626
627
  "mouseup",function(){c=setTimeout(function(){p()},0)});b.on("destroy",function(){clearTimeout(c)});a.on("keyup",p)}function c(a){return{type:a,canUndo:"cut"==a,startDisabled:!0,exec:function(){"cut"==this.type&&h();var a;var d=this.type;if(CKEDITOR.env.ie)a=f(d);else try{a=b.document.$.execCommand(d,!1,null)}catch(c){a=!1}a||b.showNotification(b.lang.clipboard[this.type+"Error"]);return a}}}function d(){return{canUndo:!1,async:!0,exec:function(b,a){var d=function(a,d){a&&o(b,a,!!d);b.fire("afterCommandExec",
627
- {name:"paste",command:c,returnValue:!!a})},c=this;"string"==typeof a?d({dataValue:a,method:"paste",dataTransfer:l.initPasteDataTransfer()},1):b.getClipboardData(d)}}}function e(){r=1;setTimeout(function(){r=0},100)}function g(){m=1;setTimeout(function(){m=0},10)}function f(a){var d=b.document,c=d.getBody(),e=!1,f=function(){e=!0};c.on(a,f);7<CKEDITOR.env.version?d.$.execCommand(a):d.$.selection.createRange().execCommand(a);c.removeListener(a,f);return e}function h(){if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var a=
628
- b.getSelection(),d,c,e;if(a.getType()==CKEDITOR.SELECTION_ELEMENT&&(d=a.getSelectedElement()))c=a.getRanges()[0],e=b.document.createText(""),e.insertBefore(d),c.setStartBefore(e),c.setEndAfter(d),a.selectRanges([c]),setTimeout(function(){d.getParent()&&(e.remove(),a.selectElement(d))},0)}}function j(a,d){var c=b.document,e=b.editable(),f=function(b){b.cancel()},n;if(!c.getById("cke_pastebin")){var g=b.getSelection(),h=g.createBookmarks();CKEDITOR.env.ie&&g.root.fire("selectionchange");var k=new CKEDITOR.dom.element((CKEDITOR.env.webkit||
629
- e.is("body"))&&!CKEDITOR.env.ie?"body":"div",c);k.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var i=0,c=c.getWindow();CKEDITOR.env.webkit?(e.append(k),k.addClass("cke_editable"),e.is("body")||(i="static"!=e.getComputedStyle("position")?e:CKEDITOR.dom.element.get(e.$.offsetParent),i=i.getDocumentPosition().y)):e.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(k);k.setStyles({position:"absolute",top:c.getScrollPosition().y-i+10+"px",width:"1px",height:Math.max(1,c.getViewPaneSize().height-
630
- 20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&k.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text"));(i=k.getParent().isReadOnly())?(k.setOpacity(0),k.setAttribute("contenteditable",!0)):k.setStyle("ltr"==b.config.contentsLangDirection?"left":"right","-1000px");b.on("selectionChange",f,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)n=e.once("blur",f,null,null,-100);i&&k.focus();i=new CKEDITOR.dom.range(k);i.selectNodeContents(k);var j=i.select();CKEDITOR.env.ie&&
631
- (n=e.once("blur",function(){b.lockSelection(j)}));var p=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){if(CKEDITOR.env.webkit)CKEDITOR.document.getBody().$.scrollTop=p;n&&n.removeListener();CKEDITOR.env.ie&&e.focus();g.selectBookmarks(h);k.remove();var a;if(CKEDITOR.env.webkit&&(a=k.getFirst())&&a.is&&a.hasClass("Apple-style-span"))k=a;b.removeListener("selectionChange",f);d(k.getHtml())},0)}}function s(){if("paste"==l.mainPasteEvent)return b.fire("beforePaste",{type:"auto",
632
- method:"paste"}),!1;b.focus();e();var a=b.focusManager;a.lock();if(b.editable().fire(l.mainPasteEvent)&&!f("paste"))return a.unlock(),!1;a.unlock();return!0}function n(a){if("wysiwyg"==b.mode)switch(a.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:a=b.editable();e();"paste"==l.mainPasteEvent&&a.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:b.fire("saveSnapshot"),setTimeout(function(){b.fire("saveSnapshot")},50)}}function i(a){var d={type:"auto",method:"paste",
633
- dataTransfer:l.initPasteDataTransfer(a)};d.dataTransfer.cacheData();var c=!1!==b.fire("beforePaste",d);c&&l.canClipboardApiBeTrusted(d.dataTransfer,b)?(a.data.preventDefault(),setTimeout(function(){o(b,d)},0)):j(a,function(a){d.dataValue=a.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");c&&o(b,d)})}function p(){if("wysiwyg"==b.mode){var a=q("paste");b.getCommand("cut").setState(q("cut"));b.getCommand("copy").setState(q("copy"));b.getCommand("paste").setState(a);b.fire("pasteState",a)}}function q(a){if(t&&
634
- a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;var a=b.getSelection(),d=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==d.length&&d[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var l=CKEDITOR.plugins.clipboard,m=0,r=0,t=0;(function(){b.on("key",n);b.on("contentDom",a);b.on("selectionChange",function(b){t=b.data.selection.getRanges()[0].checkReadOnly();p()});b.contextMenu&&b.contextMenu.addListener(function(b,a){t=a.getRanges()[0].checkReadOnly();
635
- return{cut:q("cut"),copy:q("copy"),paste:q("paste")}})})();(function(){function a(d,c,e,f,n){var g=b.lang.clipboard[c];b.addCommand(c,e);b.ui.addButton&&b.ui.addButton(d,{label:g,command:c,toolbar:"clipboard,"+f});b.addMenuItems&&b.addMenuItem(c,{label:g,command:c,group:"clipboard",order:n})}a("Cut","cut",c("cut"),10,1);a("Copy","copy",c("copy"),20,4);a("Paste","paste",d(),30,8)})();b.getClipboardData=function(a,d){function c(a){a.removeListener();a.cancel();d(a.data)}function e(a){a.removeListener();
636
- a.cancel();i=!0;d({type:g,dataValue:a.data,method:"paste"})}function f(){this.customTitle=a&&a.title}var n=!1,g="auto",i=!1;d||(d=a,a=null);b.on("paste",c,null,null,0);b.on("beforePaste",function(a){a.removeListener();n=true;g=a.data.type},null,null,1E3);!1===s()&&(b.removeListener("paste",c),n&&b.fire("pasteDialog",f)?(b.on("pasteDialogCommit",e),b.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",e);setTimeout(function(){i||d(null)},10)})):d(null))}}function w(b){if(CKEDITOR.env.webkit){if(!b.match(/^[^<]*$/g)&&
637
- !b.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!b.match(/^([^<]|<br( ?\/)?>)*$/gi)&&!b.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!b.match(/^([^<]|<br( ?\/)?>)*$/gi))return"html"}else return"html";return"htmlifiedtext"}function x(b,a){function c(a){return CKEDITOR.tools.repeat("</p><p>",~~(a/2))+(1==a%2?"<br>":"")}a=a.replace(/\s+/g," ").replace(/> +</g,"><").replace(/<br ?\/>/gi,"<br>");a=a.replace(/<\/?[A-Z]+>/g,
638
- function(a){return a.toLowerCase()});if(a.match(/^[^<]$/))return a;CKEDITOR.env.webkit&&-1<a.indexOf("<div>")&&(a=a.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g,"<br>").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g,"<div></div>"),a.match(/<div>(<br>|)<\/div>/)&&(a="<p>"+a.replace(/(<div>(<br>|)<\/div>)+/g,function(a){return c(a.split("</div><div>").length+1)})+"</p>"),a=a.replace(/<\/div><div>/g,"<br>"),a=a.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&b.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&
639
- (a=a.replace(/^<br><br>$/,"<br>")),-1<a.indexOf("<br><br>")&&(a="<p>"+a.replace(/(<br>){2,}/g,function(a){return c(a.length/4)})+"</p>"));return y(b,a)}function z(){function b(){var a={},b;for(b in CKEDITOR.dtd)"$"!=b.charAt(0)&&("div"!=b&&"span"!=b)&&(a[b]=1);return a}var a,c;return{get:function(d){if("plain-text"==d)return a||(a=new CKEDITOR.filter("br"));if("semantic-content"==d){if(!(d=c))d=new CKEDITOR.filter,d.allow({$1:{elements:b(),attributes:!0,styles:!1,classes:!1}}),d=c=d;return d}return d?
640
- new CKEDITOR.filter(d):null}}}function u(b,a,c){var a=CKEDITOR.htmlParser.fragment.fromHtml(a),d=new CKEDITOR.htmlParser.basicWriter;c.applyTo(a,!0,!1,b.activeEnterMode);a.writeHtml(d);return d.getHtml()}function y(b,a){b.enterMode==CKEDITOR.ENTER_BR?a=a.replace(/(<\/p><p>)+/g,function(a){return CKEDITOR.tools.repeat("<br>",2*(a.length/7))}).replace(/<\/?p>/g,""):b.enterMode==CKEDITOR.ENTER_DIV&&(a=a.replace(/<(\/)?p>/g,"<$1div>"));return a}function A(b){b.data.preventDefault();b.data.$.dataTransfer.dropEffect=
628
+ {name:"paste",command:c,returnValue:!!a})},c=this;"string"==typeof a?d({dataValue:a,method:"paste",dataTransfer:k.initPasteDataTransfer()},1):b.getClipboardData(d)}}}function e(){r=1;setTimeout(function(){r=0},100)}function g(){m=1;setTimeout(function(){m=0},10)}function f(a){var d=b.document,c=d.getBody(),e=!1,f=function(){e=!0};c.on(a,f);7<CKEDITOR.env.version?d.$.execCommand(a):d.$.selection.createRange().execCommand(a);c.removeListener(a,f);return e}function h(){if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var a=
629
+ b.getSelection(),d,c,e;if(a.getType()==CKEDITOR.SELECTION_ELEMENT&&(d=a.getSelectedElement()))c=a.getRanges()[0],e=b.document.createText(""),e.insertBefore(d),c.setStartBefore(e),c.setEndAfter(d),a.selectRanges([c]),setTimeout(function(){d.getParent()&&(e.remove(),a.selectElement(d))},0)}}function i(a,d){var c=b.document,e=b.editable(),f=function(b){b.cancel()},n;if(!c.getById("cke_pastebin")){var g=b.getSelection(),h=g.createBookmarks();CKEDITOR.env.ie&&g.root.fire("selectionchange");var j=new CKEDITOR.dom.element((CKEDITOR.env.webkit||
630
+ e.is("body"))&&!CKEDITOR.env.ie?"body":"div",c);j.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var l=0,c=c.getWindow();CKEDITOR.env.webkit?(e.append(j),j.addClass("cke_editable"),e.is("body")||(l="static"!=e.getComputedStyle("position")?e:CKEDITOR.dom.element.get(e.$.offsetParent),l=l.getDocumentPosition().y)):e.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(j);j.setStyles({position:"absolute",top:c.getScrollPosition().y-l+10+"px",width:"1px",height:Math.max(1,c.getViewPaneSize().height-
631
+ 20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&j.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text"));(l=j.getParent().isReadOnly())?(j.setOpacity(0),j.setAttribute("contenteditable",!0)):j.setStyle("ltr"==b.config.contentsLangDirection?"left":"right","-1000px");b.on("selectionChange",f,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)n=e.once("blur",f,null,null,-100);l&&j.focus();l=new CKEDITOR.dom.range(j);l.selectNodeContents(j);var i=l.select();CKEDITOR.env.ie&&
632
+ (n=e.once("blur",function(){b.lockSelection(i)}));var p=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){if(CKEDITOR.env.webkit)CKEDITOR.document.getBody().$.scrollTop=p;n&&n.removeListener();CKEDITOR.env.ie&&e.focus();g.selectBookmarks(h);j.remove();var a;if(CKEDITOR.env.webkit&&(a=j.getFirst())&&a.is&&a.hasClass("Apple-style-span"))j=a;b.removeListener("selectionChange",f);d(j.getHtml())},0)}}function s(){if("paste"==k.mainPasteEvent)return b.fire("beforePaste",{type:"auto",
633
+ method:"paste"}),!1;b.focus();e();var a=b.focusManager;a.lock();if(b.editable().fire(k.mainPasteEvent)&&!f("paste"))return a.unlock(),!1;a.unlock();return!0}function n(a){if("wysiwyg"==b.mode)switch(a.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:a=b.editable();e();"paste"==k.mainPasteEvent&&a.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:b.fire("saveSnapshot"),setTimeout(function(){b.fire("saveSnapshot")},50)}}function l(a){var d={type:"auto",method:"paste",
634
+ dataTransfer:k.initPasteDataTransfer(a)};d.dataTransfer.cacheData();var c=!1!==b.fire("beforePaste",d);c&&k.canClipboardApiBeTrusted(d.dataTransfer,b)?(a.data.preventDefault(),setTimeout(function(){o(b,d)},0)):i(a,function(a){d.dataValue=a.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");c&&o(b,d)})}function p(){if("wysiwyg"==b.mode){var a=q("paste");b.getCommand("cut").setState(q("cut"));b.getCommand("copy").setState(q("copy"));b.getCommand("paste").setState(a);b.fire("pasteState",a)}}function q(a){if(t&&
635
+ a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;var a=b.getSelection(),d=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==d.length&&d[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var k=CKEDITOR.plugins.clipboard,m=0,r=0,t=0;(function(){b.on("key",n);b.on("contentDom",a);b.on("selectionChange",function(b){t=b.data.selection.getRanges()[0].checkReadOnly();p()});b.contextMenu&&b.contextMenu.addListener(function(b,a){t=a.getRanges()[0].checkReadOnly();
636
+ return{cut:q("cut"),copy:q("copy"),paste:q("paste")}})})();(function(){function a(d,c,e,f,n){var g=b.lang.clipboard[c];b.addCommand(c,e);b.ui.addButton&&b.ui.addButton(d,{label:g,command:c,toolbar:"clipboard,"+f});b.addMenuItems&&b.addMenuItem(c,{label:g,command:c,group:"clipboard",order:n})}a("Cut","cut",c("cut"),10,1);a("Copy","copy",c("copy"),20,4);a("Paste","paste",d(),30,8)})();b.getClipboardData=function(a,d){function c(b){b.removeListener();b.cancel();d(b.data)}function e(b){b.removeListener();
637
+ b.cancel();h=!0;d({type:g,dataValue:b.data,method:"paste"})}function f(){this.customTitle=a&&a.title}var n=!1,g="auto",h=!1;d||(d=a,a=null);b.on("paste",c,null,null,0);b.on("beforePaste",function(b){b.removeListener();n=true;g=b.data.type},null,null,1E3);!1===s()&&(b.removeListener("paste",c),n&&b.fire("pasteDialog",f)?(b.on("pasteDialogCommit",e),b.on("dialogHide",function(b){b.removeListener();b.data.removeListener("pasteDialogCommit",e);setTimeout(function(){h||d(null)},10)})):d(null))}}function w(b){if(CKEDITOR.env.webkit){if(!b.match(/^[^<]*$/g)&&
638
+ !b.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!b.match(/^([^<]|<br( ?\/)?>)*$/gi)&&!b.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!b.match(/^([^<]|<br( ?\/)?>)*$/gi))return"html"}else return"html";return"htmlifiedtext"}function x(b,a){function c(b){return CKEDITOR.tools.repeat("</p><p>",~~(b/2))+(1==b%2?"<br>":"")}a=a.replace(/\s+/g," ").replace(/> +</g,"><").replace(/<br ?\/>/gi,"<br>");a=a.replace(/<\/?[A-Z]+>/g,
639
+ function(b){return b.toLowerCase()});if(a.match(/^[^<]$/))return a;CKEDITOR.env.webkit&&-1<a.indexOf("<div>")&&(a=a.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g,"<br>").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g,"<div></div>"),a.match(/<div>(<br>|)<\/div>/)&&(a="<p>"+a.replace(/(<div>(<br>|)<\/div>)+/g,function(b){return c(b.split("</div><div>").length+1)})+"</p>"),a=a.replace(/<\/div><div>/g,"<br>"),a=a.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&b.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&
640
+ (a=a.replace(/^<br><br>$/,"<br>")),-1<a.indexOf("<br><br>")&&(a="<p>"+a.replace(/(<br>){2,}/g,function(b){return c(b.length/4)})+"</p>"));return y(b,a)}function z(){function b(){var b={},a;for(a in CKEDITOR.dtd)"$"!=a.charAt(0)&&("div"!=a&&"span"!=a)&&(b[a]=1);return b}var a,c;return{get:function(d){if("plain-text"==d)return a||(a=new CKEDITOR.filter("br"));if("semantic-content"==d){if(!(d=c))d=new CKEDITOR.filter,d.allow({$1:{elements:b(),attributes:!0,styles:!1,classes:!1}}),d=c=d;return d}return d?
641
+ new CKEDITOR.filter(d):null}}}function u(b,a,c){var a=CKEDITOR.htmlParser.fragment.fromHtml(a),d=new CKEDITOR.htmlParser.basicWriter;c.applyTo(a,!0,!1,b.activeEnterMode);a.writeHtml(d);return d.getHtml()}function y(b,a){b.enterMode==CKEDITOR.ENTER_BR?a=a.replace(/(<\/p><p>)+/g,function(b){return CKEDITOR.tools.repeat("<br>",2*(b.length/7))}).replace(/<\/?p>/g,""):b.enterMode==CKEDITOR.ENTER_DIV&&(a=a.replace(/<(\/)?p>/g,"<$1div>"));return a}function A(b){b.data.preventDefault();b.data.$.dataTransfer.dropEffect=
641
642
  "none"}function B(b){var a=CKEDITOR.plugins.clipboard;b.on("contentDom",function(){function c(a,d,c){d.select();o(b,{dataTransfer:c,method:"drop"},1);c.sourceEditor.fire("saveSnapshot");c.sourceEditor.editable().extractHtmlFromRange(a);c.sourceEditor.getSelection().selectRanges([a]);c.sourceEditor.fire("saveSnapshot")}function d(d,c){d.select();o(b,{dataTransfer:c,method:"drop"},1);a.resetDragDataTransfer()}function e(a,d,c){var e={$:a.data.$,target:a.data.getTarget()};d&&(e.dragRange=d);c&&(e.dropRange=
642
- c);!1===b.fire(a.name,e)&&a.data.preventDefault()}function g(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());return a.getChildCount()}var f=b.editable(),h=CKEDITOR.plugins.clipboard.getDropTarget(b),j=b.ui.space("top"),s=b.ui.space("bottom");a.preventDefaultDropOnElement(j);a.preventDefaultDropOnElement(s);f.attachListener(h,"dragstart",e);f.attachListener(b,"dragstart",a.resetDragDataTransfer,a,null,1);f.attachListener(b,"dragstart",function(d){a.initDragDataTransfer(d,b);d=a.dragRange=b.getSelection().getRanges()[0];
643
- CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(a.dragStartContainerChildCount=d?g(d.startContainer):null,a.dragEndContainerChildCount=d?g(d.endContainer):null)},null,null,2);f.attachListener(h,"dragend",e);f.attachListener(b,"dragend",a.initDragDataTransfer,a,null,1);f.attachListener(b,"dragend",a.resetDragDataTransfer,a,null,100);f.attachListener(h,"dragover",function(a){var b=a.data.getTarget();b&&b.is&&b.is("html")?a.data.preventDefault():CKEDITOR.env.ie&&(CKEDITOR.plugins.clipboard.isFileApiSupported&&
644
- a.data.$.dataTransfer.types.contains("Files"))&&a.data.preventDefault()});f.attachListener(h,"drop",function(d){d.data.preventDefault();var c=d.data.getTarget();if(!c.isReadOnly()||c.type==CKEDITOR.NODE_ELEMENT&&c.is("html")){var c=a.getRangeAtDropPosition(d,b),f=a.dragRange;c&&e(d,f,c)}});f.attachListener(b,"drop",a.initDragDataTransfer,a,null,1);f.attachListener(b,"drop",function(e){if(e=e.data){var f=e.dropRange,g=e.dragRange,h=e.dataTransfer;h.getTransferType(b)==CKEDITOR.DATA_TRANSFER_INTERNAL?
643
+ c);!1===b.fire(a.name,e)&&a.data.preventDefault()}function g(b){b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent());return b.getChildCount()}var f=b.editable(),h=CKEDITOR.plugins.clipboard.getDropTarget(b),i=b.ui.space("top"),s=b.ui.space("bottom");a.preventDefaultDropOnElement(i);a.preventDefaultDropOnElement(s);f.attachListener(h,"dragstart",e);f.attachListener(b,"dragstart",a.resetDragDataTransfer,a,null,1);f.attachListener(b,"dragstart",function(d){a.initDragDataTransfer(d,b);d=a.dragRange=b.getSelection().getRanges()[0];
644
+ CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(a.dragStartContainerChildCount=d?g(d.startContainer):null,a.dragEndContainerChildCount=d?g(d.endContainer):null)},null,null,2);f.attachListener(h,"dragend",e);f.attachListener(b,"dragend",a.initDragDataTransfer,a,null,1);f.attachListener(b,"dragend",a.resetDragDataTransfer,a,null,100);f.attachListener(h,"dragover",function(b){var a=b.data.getTarget();a&&a.is&&a.is("html")?b.data.preventDefault():CKEDITOR.env.ie&&(CKEDITOR.plugins.clipboard.isFileApiSupported&&
645
+ b.data.$.dataTransfer.types.contains("Files"))&&b.data.preventDefault()});f.attachListener(h,"drop",function(d){d.data.preventDefault();var c=d.data.getTarget();if(!c.isReadOnly()||c.type==CKEDITOR.NODE_ELEMENT&&c.is("html")){var c=a.getRangeAtDropPosition(d,b),f=a.dragRange;c&&e(d,f,c)}});f.attachListener(b,"drop",a.initDragDataTransfer,a,null,1);f.attachListener(b,"drop",function(e){if(e=e.data){var f=e.dropRange,g=e.dragRange,h=e.dataTransfer;h.getTransferType(b)==CKEDITOR.DATA_TRANSFER_INTERNAL?
645
646
  setTimeout(function(){a.internalDrop(g,f,h,b)},0):h.getTransferType(b)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?c(g,f,h):d(f,h)}},null,null,9999)})}CKEDITOR.plugins.add("clipboard",{requires:"dialog",init:function(b){var a,c=z();b.config.forcePasteAsPlainText?a="plain-text":b.config.pasteFilter?a=b.config.pasteFilter:CKEDITOR.env.webkit&&!("pasteFilter"in b.config)&&(a="semantic-content");b.pasteFilter=c.get(a);v(b);B(b);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));b.on("paste",
646
- function(a){a.data.dataTransfer||(a.data.dataTransfer=new CKEDITOR.plugins.clipboard.dataTransfer);if(!a.data.dataValue){var c=a.data.dataTransfer,g=c.getData("text/html");if(g)a.data.dataValue=g,a.data.type="html";else if(g=c.getData("text/plain"))a.data.dataValue=b.editable().transformPlainTextToHtml(g),a.data.type="text"}},null,null,1);b.on("paste",function(a){var b=a.data.dataValue,c=CKEDITOR.dtd.$block;-1<b.indexOf("Apple-")&&(b=b.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi,
647
- " "),"html"!=a.data.type&&(b=b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g,"&nbsp;&nbsp; &nbsp;")})),-1<b.indexOf('<br class="Apple-interchange-newline">')&&(a.data.startsWithEOL=1,a.data.preSniffing="html",b=b.replace(/<br class="Apple-interchange-newline">/,"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(b.match(/^<[^<]+cke_(editable|contents)/i)){var f,h,j=new CKEDITOR.dom.element("div");for(j.setHtml(b);1==j.getChildCount()&&(f=
648
- j.getFirst())&&f.type==CKEDITOR.NODE_ELEMENT&&(f.hasClass("cke_editable")||f.hasClass("cke_contents"));)j=h=f;h&&(b=h.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?b=b.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g,function(b,f){if(f.toLowerCase()in c){a.data.preSniffing="html";return"<"+f}return b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)><div><br><\/div>$/,function(b,f){if(f in c){a.data.endsWithEOL=1;return"</"+f+">"}return b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)<br>$/,"$1"));a.data.dataValue=b},null,
649
- null,3);b.on("paste",function(a){var a=a.data,e=a.type,g=a.dataValue,f,h=b.config.clipboard_defaultContentType||"html",j=a.dataTransfer.getTransferType(b);f="html"==e||"html"==a.preSniffing?"html":w(g);"htmlifiedtext"==f&&(g=x(b.config,g));"text"==e&&"html"==f?g=u(b,g,c.get("plain-text")):j==CKEDITOR.DATA_TRANSFER_EXTERNAL&&(b.pasteFilter&&!a.dontFilter)&&(g=u(b,g,b.pasteFilter));a.startsWithEOL&&(g='<br data-cke-eol="1">'+g);a.endsWithEOL&&(g+='<br data-cke-eol="1">');"auto"==e&&(e="html"==f||"html"==
647
+ function(a){a.data.dataTransfer||(a.data.dataTransfer=new CKEDITOR.plugins.clipboard.dataTransfer);if(!a.data.dataValue){var c=a.data.dataTransfer,g=c.getData("text/html");if(g)a.data.dataValue=g,a.data.type="html";else if(g=c.getData("text/plain"))a.data.dataValue=b.editable().transformPlainTextToHtml(g),a.data.type="text"}},null,null,1);b.on("paste",function(b){var a=b.data.dataValue,c=CKEDITOR.dtd.$block;-1<a.indexOf("Apple-")&&(a=a.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi,
648
+ " "),"html"!=b.data.type&&(a=a.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g,"&nbsp;&nbsp; &nbsp;")})),-1<a.indexOf('<br class="Apple-interchange-newline">')&&(b.data.startsWithEOL=1,b.data.preSniffing="html",a=a.replace(/<br class="Apple-interchange-newline">/,"")),a=a.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(a.match(/^<[^<]+cke_(editable|contents)/i)){var f,h,i=new CKEDITOR.dom.element("div");for(i.setHtml(a);1==i.getChildCount()&&(f=
649
+ i.getFirst())&&f.type==CKEDITOR.NODE_ELEMENT&&(f.hasClass("cke_editable")||f.hasClass("cke_contents"));)i=h=f;h&&(a=h.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?a=a.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g,function(a,f){if(f.toLowerCase()in c){b.data.preSniffing="html";return"<"+f}return a}):CKEDITOR.env.webkit?a=a.replace(/<\/(\w+)><div><br><\/div>$/,function(a,f){if(f in c){b.data.endsWithEOL=1;return"</"+f+">"}return a}):CKEDITOR.env.gecko&&(a=a.replace(/(\s)<br>$/,"$1"));b.data.dataValue=a},null,
650
+ null,3);b.on("paste",function(a){var a=a.data,e=a.type,g=a.dataValue,f,h=b.config.clipboard_defaultContentType||"html",i=a.dataTransfer.getTransferType(b);f="html"==e||"html"==a.preSniffing?"html":w(g);"htmlifiedtext"==f&&(g=x(b.config,g));"text"==e&&"html"==f?g=u(b,g,c.get("plain-text")):i==CKEDITOR.DATA_TRANSFER_EXTERNAL&&(b.pasteFilter&&!a.dontFilter)&&(g=u(b,g,b.pasteFilter));a.startsWithEOL&&(g='<br data-cke-eol="1">'+g);a.endsWithEOL&&(g+='<br data-cke-eol="1">');"auto"==e&&(e="html"==f||"html"==
650
651
  h?"html":"text");a.type=e;a.dataValue=g;delete a.preSniffing;delete a.startsWithEOL;delete a.endsWithEOL},null,null,6);b.on("paste",function(a){a=a.data;a.dataValue&&(b.insertHtml(a.dataValue,a.type,a.range),setTimeout(function(){b.fire("afterPaste")},0))},null,null,1E3);b.on("pasteDialog",function(a){setTimeout(function(){b.openDialog("paste",a.data)},0)})}});CKEDITOR.plugins.clipboard={isCustomCopyCutSupported:!CKEDITOR.env.ie&&!CKEDITOR.env.iOS,isCustomDataTypesSupported:!CKEDITOR.env.ie,isFileApiSupported:!CKEDITOR.env.ie||
651
652
  9<CKEDITOR.env.version,mainPasteEvent:CKEDITOR.env.ie&&!CKEDITOR.env.edge?"beforepaste":"paste",canClipboardApiBeTrusted:function(b,a){return b.getTransferType(a)!=CKEDITOR.DATA_TRANSFER_EXTERNAL||CKEDITOR.env.chrome&&!b.isEmpty()||CKEDITOR.env.gecko&&(b.getData("text/html")||b.getFilesCount())?!0:!1},getDropTarget:function(b){var a=b.editable();return CKEDITOR.env.ie&&9>CKEDITOR.env.version||a.isInline()?a:b.document},fixSplitNodesAfterDrop:function(b,a,c,d){function e(b,c,d){var e=b;e.type==CKEDITOR.NODE_TEXT&&
652
653
  (e=b.getParent());if(e.equals(c)&&d!=c.getChildCount())return b=a,c=b.startContainer.getChild(b.startOffset-1),d=b.startContainer.getChild(b.startOffset),c&&(c.type==CKEDITOR.NODE_TEXT&&d&&d.type==CKEDITOR.NODE_TEXT)&&(e=c.getLength(),c.setText(c.getText()+d.getText()),d.remove(),b.setStart(c,e),b.collapse(!0)),!0}var g=a.startContainer;!("number"!=typeof d||"number"!=typeof c)&&(g.type==CKEDITOR.NODE_ELEMENT&&!e(b.startContainer,g,c))&&e(b.endContainer,g,d)},isDropRangeAffectedByDragRange:function(b,
653
654
  a){var c=a.startContainer,d=a.endOffset;return b.endContainer.equals(c)&&b.endOffset<=d||b.startContainer.getParent().equals(c)&&b.startContainer.getIndex()<d||b.endContainer.getParent().equals(c)&&b.endContainer.getIndex()<d?!0:!1},internalDrop:function(b,a,c,d){var e=CKEDITOR.plugins.clipboard,g=d.editable(),f,h;d.fire("saveSnapshot");d.fire("lockSnapshot",{dontUpdate:1});CKEDITOR.env.ie&&10>CKEDITOR.env.version&&this.fixSplitNodesAfterDrop(b,a,e.dragStartContainerChildCount,e.dragEndContainerChildCount);
654
- (h=this.isDropRangeAffectedByDragRange(b,a))||(f=b.createBookmark(1));e=a.clone().createBookmark(1);h&&(f=b.createBookmark(1));b=d.createRange();b.moveToBookmark(f);g.extractHtmlFromRange(b,1);a=d.createRange();a.moveToBookmark(e);o(d,{dataTransfer:c,method:"drop",range:a},1);d.fire("unlockSnapshot")},getRangeAtDropPosition:function(b,a){var c=b.data.$,d=c.clientX,e=c.clientY,g=a.getSelection(!0).getRanges()[0],f=a.createRange();if(b.data.testRange)return b.data.testRange;if(document.caretRangeFromPoint)c=
655
- a.document.$.caretRangeFromPoint(d,e),f.setStart(CKEDITOR.dom.node(c.startContainer),c.startOffset),f.collapse(!0);else if(c.rangeParent)f.setStart(CKEDITOR.dom.node(c.rangeParent),c.rangeOffset),f.collapse(!0);else{if(CKEDITOR.env.ie&&8<CKEDITOR.env.version&&g&&a.editable().hasFocus)return g;if(document.body.createTextRange){a.focus();c=a.document.getBody().$.createTextRange();try{for(var h=!1,j=0;20>j&&!h;j++){if(!h)try{c.moveToPoint(d,e-j),h=!0}catch(m){}if(!h)try{c.moveToPoint(d,e+j),h=!0}catch(n){}}if(h){var i=
656
- "cke-temp-"+(new Date).getTime();c.pasteHTML('<span id="'+i+'">​</span>');var p=a.document.getById(i);f.moveToPosition(p,CKEDITOR.POSITION_BEFORE_START);p.remove()}else{var q=a.document.$.elementFromPoint(d,e),l=new CKEDITOR.dom.element(q),o;if(!l.equals(a.editable())&&"html"!=l.getName())o=l.getClientRect(),d<o.left?f.setStartAt(l,CKEDITOR.POSITION_AFTER_START):f.setStartAt(l,CKEDITOR.POSITION_BEFORE_END),f.collapse(!0);else return g&&g.startContainer&&!g.startContainer.equals(a.editable())?g:null}}catch(r){return null}}else return null}return f},
657
- initDragDataTransfer:function(b,a){var c=b.data.$?b.data.$.dataTransfer:null,d=new this.dataTransfer(c,a);c?this.dragData&&d.id==this.dragData.id?d=this.dragData:this.dragData=d:this.dragData?d=this.dragData:this.dragData=d;b.data.dataTransfer=d},resetDragDataTransfer:function(){this.dragData=null},initPasteDataTransfer:function(b,a){if(this.isCustomCopyCutSupported&&b&&b.data&&b.data.$){var c=new this.dataTransfer(b.data.$.clipboardData,a);this.copyCutData&&c.id==this.copyCutData.id?(c=this.copyCutData,
658
- c.$=b.data.$.clipboardData):this.copyCutData=c;return c}return new this.dataTransfer(null,a)},preventDefaultDropOnElement:function(b){b&&b.on("dragover",A)}};var m=CKEDITOR.plugins.clipboard.isCustomDataTypesSupported?"cke/id":"Text";CKEDITOR.plugins.clipboard.dataTransfer=function(b,a){b&&(this.$=b);this._={metaRegExp:/^<meta.*?>/,bodyRegExp:/<body(?:[\s\S]*?)>([\s\S]*)<\/body>/,fragmentRegExp:/<\!--(?:Start|End)Fragment--\>/g,data:{},files:[],normalizeType:function(a){a=a.toLowerCase();return a==
659
- "text"||a=="text/plain"?"Text":a=="url"?"URL":a}};this.id=this.getData(m);this.id||(this.id="Text"==m?"":"cke-"+CKEDITOR.tools.getUniqueId());if("Text"!=m)try{this.$.setData(m,this.id)}catch(c){}a&&(this.sourceEditor=a,this.setData("text/html",a.getSelectedHtml(1)),"Text"!=m&&!this.getData("text/plain")&&this.setData("text/plain",a.getSelection().getSelectedText()))};CKEDITOR.DATA_TRANSFER_INTERNAL=1;CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2;CKEDITOR.DATA_TRANSFER_EXTERNAL=3;CKEDITOR.plugins.clipboard.dataTransfer.prototype=
660
- {getData:function(b){var b=this._.normalizeType(b),a=this._.data[b];if(void 0===a||null===a||""===a)try{a=this.$.getData(b)}catch(c){}if(void 0===a||null===a||""===a)a="";if("text/html"==b){if(a=a.replace(this._.metaRegExp,""),(b=this._.bodyRegExp.exec(a))&&b.length)a=b[1],a=a.replace(this._.fragmentRegExp,"")}else"Text"==b&&(CKEDITOR.env.gecko&&this.getFilesCount()&&"file://"==a.substring(0,7))&&(a="");return a},setData:function(b,a){b=this._.normalizeType(b);this._.data[b]=a;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||
661
- !("URL"!=b&&"Text"!=b)){"Text"==m&&"Text"==b&&(this.id=a);try{this.$.setData(b,a)}catch(c){}}},getTransferType:function(b){return this.sourceEditor?this.sourceEditor==b?CKEDITOR.DATA_TRANSFER_INTERNAL:CKEDITOR.DATA_TRANSFER_CROSS_EDITORS:CKEDITOR.DATA_TRANSFER_EXTERNAL},cacheData:function(){function b(b){var b=a._.normalizeType(b),c=a.getData(b);c&&(a._.data[b]=c)}if(this.$){var a=this,c,d;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(c=0;c<this.$.types.length;c++)b(this.$.types[c])}else b("Text"),
662
- b("URL");d=this._getImageFromClipboard();if(this.$&&this.$.files||d){this._.files=[];for(c=0;c<this.$.files.length;c++)this._.files.push(this.$.files[c]);0===this._.files.length&&d&&this._.files.push(d)}}},getFilesCount:function(){return this._.files.length?this._.files.length:this.$&&this.$.files&&this.$.files.length?this.$.files.length:this._getImageFromClipboard()?1:0},getFile:function(b){return this._.files.length?this._.files[b]:this.$&&this.$.files&&this.$.files.length?this.$.files[b]:0===b?
663
- this._getImageFromClipboard():void 0},isEmpty:function(){var b={},a;if(this.getFilesCount())return!1;for(a in this._.data)b[a]=1;if(this.$)if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(var c=0;c<this.$.types.length;c++)b[this.$.types[c]]=1}else b.Text=1,b.URL=1;"Text"!=m&&(b[m]=0);for(a in b)if(b[a]&&""!==this.getData(a))return!1;return!0},_getImageFromClipboard:function(){var b;if(this.$&&this.$.items&&this.$.items[0])try{if((b=this.$.items[0].getAsFile())&&b.type)return b}catch(a){}}}})();(function(){var c='<a id="{id}" class="cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href=\"javascript:void('{titleJs}')\"")+' title="{title}" tabindex="-1" hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="{hasArrow}" aria-disabled="{ariaDisabled}"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(c+=' onkeypress="return false;"');CKEDITOR.env.gecko&&(c+=' onblur="this.style.cssText = this.style.cssText;"');var c=c+(' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" '+
655
+ (h=this.isDropRangeAffectedByDragRange(b,a))||(f=b.createBookmark(!1));e=a.clone().createBookmark(!1);h&&(f=b.createBookmark(!1));b=f.startNode;h=f.endNode;var i=e.startNode;h&&b.getPosition(i)==CKEDITOR.POSITION_PRECEDING&&h.getPosition(i)==CKEDITOR.POSITION_FOLLOWING?(d.getSelection().selectRanges([a]),b.remove(),h.remove(),i.remove()):(b=d.createRange(),b.moveToBookmark(f),g.extractHtmlFromRange(b,1),a=d.createRange(),a.moveToBookmark(e),o(d,{dataTransfer:c,method:"drop",range:a},1));d.fire("unlockSnapshot")},
656
+ getRangeAtDropPosition:function(b,a){var c=b.data.$,d=c.clientX,e=c.clientY,g=a.getSelection(!0).getRanges()[0],f=a.createRange();if(b.data.testRange)return b.data.testRange;if(document.caretRangeFromPoint)c=a.document.$.caretRangeFromPoint(d,e),f.setStart(CKEDITOR.dom.node(c.startContainer),c.startOffset),f.collapse(!0);else if(c.rangeParent)f.setStart(CKEDITOR.dom.node(c.rangeParent),c.rangeOffset),f.collapse(!0);else{if(CKEDITOR.env.ie&&8<CKEDITOR.env.version&&g&&a.editable().hasFocus)return g;
657
+ if(document.body.createTextRange){a.focus();c=a.document.getBody().$.createTextRange();try{for(var h=!1,i=0;20>i&&!h;i++){if(!h)try{c.moveToPoint(d,e-i),h=!0}catch(m){}if(!h)try{c.moveToPoint(d,e+i),h=!0}catch(n){}}if(h){var l="cke-temp-"+(new Date).getTime();c.pasteHTML('<span id="'+l+'">​</span>');var p=a.document.getById(l);f.moveToPosition(p,CKEDITOR.POSITION_BEFORE_START);p.remove()}else{var q=a.document.$.elementFromPoint(d,e),k=new CKEDITOR.dom.element(q),o;if(!k.equals(a.editable())&&"html"!=
658
+ k.getName())o=k.getClientRect(),d<o.left?f.setStartAt(k,CKEDITOR.POSITION_AFTER_START):f.setStartAt(k,CKEDITOR.POSITION_BEFORE_END),f.collapse(!0);else return g&&g.startContainer&&!g.startContainer.equals(a.editable())?g:null}}catch(r){return null}}else return null}return f},initDragDataTransfer:function(b,a){var c=b.data.$?b.data.$.dataTransfer:null,d=new this.dataTransfer(c,a);c?this.dragData&&d.id==this.dragData.id?d=this.dragData:this.dragData=d:this.dragData?d=this.dragData:this.dragData=d;b.data.dataTransfer=
659
+ d},resetDragDataTransfer:function(){this.dragData=null},initPasteDataTransfer:function(b,a){if(this.isCustomCopyCutSupported&&b&&b.data&&b.data.$){var c=new this.dataTransfer(b.data.$.clipboardData,a);this.copyCutData&&c.id==this.copyCutData.id?(c=this.copyCutData,c.$=b.data.$.clipboardData):this.copyCutData=c;return c}return new this.dataTransfer(null,a)},preventDefaultDropOnElement:function(b){b&&b.on("dragover",A)}};var m=CKEDITOR.plugins.clipboard.isCustomDataTypesSupported?"cke/id":"Text";CKEDITOR.plugins.clipboard.dataTransfer=
660
+ function(b,a){b&&(this.$=b);this._={metaRegExp:/^<meta.*?>/,bodyRegExp:/<body(?:[\s\S]*?)>([\s\S]*)<\/body>/,fragmentRegExp:/<\!--(?:Start|End)Fragment--\>/g,data:{},files:[],normalizeType:function(a){a=a.toLowerCase();return a=="text"||a=="text/plain"?"Text":a=="url"?"URL":a}};this.id=this.getData(m);this.id||(this.id="Text"==m?"":"cke-"+CKEDITOR.tools.getUniqueId());if("Text"!=m)try{this.$.setData(m,this.id)}catch(c){}a&&(this.sourceEditor=a,this.setData("text/html",a.getSelectedHtml(1)),"Text"!=
661
+ m&&!this.getData("text/plain")&&this.setData("text/plain",a.getSelection().getSelectedText()))};CKEDITOR.DATA_TRANSFER_INTERNAL=1;CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2;CKEDITOR.DATA_TRANSFER_EXTERNAL=3;CKEDITOR.plugins.clipboard.dataTransfer.prototype={getData:function(b){var b=this._.normalizeType(b),a=this._.data[b];if(void 0===a||null===a||""===a)try{a=this.$.getData(b)}catch(c){}if(void 0===a||null===a||""===a)a="";if("text/html"==b){if(a=a.replace(this._.metaRegExp,""),(b=this._.bodyRegExp.exec(a))&&
662
+ b.length)a=b[1],a=a.replace(this._.fragmentRegExp,"")}else"Text"==b&&(CKEDITOR.env.gecko&&this.getFilesCount()&&"file://"==a.substring(0,7))&&(a="");return a},setData:function(b,a){b=this._.normalizeType(b);this._.data[b]=a;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||!("URL"!=b&&"Text"!=b)){"Text"==m&&"Text"==b&&(this.id=a);try{this.$.setData(b,a)}catch(c){}}},getTransferType:function(b){return this.sourceEditor?this.sourceEditor==b?CKEDITOR.DATA_TRANSFER_INTERNAL:CKEDITOR.DATA_TRANSFER_CROSS_EDITORS:
663
+ CKEDITOR.DATA_TRANSFER_EXTERNAL},cacheData:function(){function b(b){var b=a._.normalizeType(b),c=a.getData(b);c&&(a._.data[b]=c)}if(this.$){var a=this,c,d;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(c=0;c<this.$.types.length;c++)b(this.$.types[c])}else b("Text"),b("URL");d=this._getImageFromClipboard();if(this.$&&this.$.files||d){this._.files=[];for(c=0;c<this.$.files.length;c++)this._.files.push(this.$.files[c]);0===this._.files.length&&d&&this._.files.push(d)}}},
664
+ getFilesCount:function(){return this._.files.length?this._.files.length:this.$&&this.$.files&&this.$.files.length?this.$.files.length:this._getImageFromClipboard()?1:0},getFile:function(b){return this._.files.length?this._.files[b]:this.$&&this.$.files&&this.$.files.length?this.$.files[b]:0===b?this._getImageFromClipboard():void 0},isEmpty:function(){var b={},a;if(this.getFilesCount())return!1;for(a in this._.data)b[a]=1;if(this.$)if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(var c=
665
+ 0;c<this.$.types.length;c++)b[this.$.types[c]]=1}else b.Text=1,b.URL=1;"Text"!=m&&(b[m]=0);for(a in b)if(b[a]&&""!==this.getData(a))return!1;return!0},_getImageFromClipboard:function(){var b;if(this.$&&this.$.items&&this.$.items[0])try{if((b=this.$.items[0].getAsFile())&&b.type)return b}catch(a){}}}})();(function(){var c='<a id="{id}" class="cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href=\"javascript:void('{titleJs}')\"")+' title="{title}" tabindex="-1" hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="{hasArrow}" aria-disabled="{ariaDisabled}"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(c+=' onkeypress="return false;"');CKEDITOR.env.gecko&&(c+=' onblur="this.style.cssText = this.style.cssText;"');var c=c+(' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" '+
664
666
  (CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span class="cke_button_icon cke_button__{iconName}_icon" style="{style}"'),c=c+'>&nbsp;</span><span id="{id}_label" class="cke_button_label cke_button__{name}_label" aria-hidden="false">{label}</span>{arrowHtml}</a>',o=CKEDITOR.addTemplate("buttonArrow",'<span class="cke_button_arrow">'+(CKEDITOR.env.hc?"&#9660;":"")+"</span>"),p=CKEDITOR.addTemplate("button",c);CKEDITOR.plugins.add("button",
665
667
  {beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(b){b.execCommand(a.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}};CKEDITOR.ui.button.prototype={render:function(a,b){function c(){var e=a.mode;e&&(e=this.modes[e]?void 0!==i[e]?i[e]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,
666
668
  e=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:e,this.setState(e),this.refresh&&this.refresh())}var j=CKEDITOR.env,k=this._.id=CKEDITOR.tools.getNextId(),f="",g=this.command,l;this._.editor=a;var d={id:k,button:this,editor:a,focus:function(){CKEDITOR.document.getById(k).focus()},execute:function(){this.button.click(a)},attach:function(a){this.button.attach(a)}},q=CKEDITOR.tools.addFunction(function(a){if(d.onkey)return a=new CKEDITOR.dom.event(a),!1!==d.onkey(d,a.getKeystroke())}),r=CKEDITOR.tools.addFunction(function(a){var b;
@@ -943,7 +945,7 @@ g={overflow:CKEDITOR.env.webkit?"":"hidden",width:0,height:0};b.getDocumentEleme
943
945
  e();g=h.getDocumentPosition();h.setStyles({left:-1*g.x+"px",top:-1*g.y+"px"});CKEDITOR.env.gecko&&r(a)}else if(this.state==CKEDITOR.TRISTATE_ON){c.removeListener("resize",e);for(var d=[g,h],n=0;n<d.length;n++)q(d[n],d[n].getCustomData("maximize_saved_styles")),d[n].removeCustomData("maximize_saved_styles");for(d=a.container;d=d.getParent();)q(d,d.getCustomData("maximize_saved_styles")),d.removeCustomData("maximize_saved_styles");CKEDITOR.env.ie?setTimeout(function(){c.$.scrollTo(m.x,m.y)},0):c.$.scrollTo(m.x,
944
946
  m.y);h.removeClass("cke_maximized");CKEDITOR.env.webkit&&(h.setStyle("display","inline"),setTimeout(function(){h.setStyle("display","block")},0));a.fire("resize",{outerHeight:a.container.$.offsetHeight,contentsHeight:g.$.offsetHeight,outerWidth:a.container.$.offsetWidth})}this.toggleState();if(d=this.uiItems[0])g=this.state==CKEDITOR.TRISTATE_OFF?f.maximize.maximize:f.maximize.minimize,d=CKEDITOR.document.getById(d._.id),d.getChild(1).setHtml(g),d.setAttribute("title",g),d.setAttribute("href",'javascript:void("'+
945
947
  g+'");');"wysiwyg"==a.mode?j?(CKEDITOR.env.gecko&&r(a),a.getSelection().selectRanges(j),(i=a.getSelection().getStartElement())&&i.scrollIntoView(!0)):c.$.scrollTo(k.x,k.y):(j&&(i.selectionStart=j[0],i.selectionEnd=j[1]),i.scrollLeft=k[0],i.scrollTop=k[1]);j=k=null;l=this.state;a.fire("maximize",this.state)},canUndo:!1});a.ui.addButton&&a.ui.addButton("Maximize",{label:f.maximize.maximize,command:"maximize",toolbar:"tools,10"});a.on("mode",function(){var b=a.getCommand("maximize");b.setState(b.state==
946
- CKEDITOR.TRISTATE_DISABLED?CKEDITOR.TRISTATE_DISABLED:l)},null,null,100)}}})})();CKEDITOR.plugins.add("newpage",{init:function(a){a.addCommand("newpage",{modes:{wysiwyg:1,source:1},exec:function(b){var a=this;b.setData(b.config.newpage_html||"",function(){b.focus();setTimeout(function(){b.fire("afterCommandExec",{name:"newpage",command:a});b.selectionChange()},200)})},async:!0});a.ui.addButton&&a.ui.addButton("NewPage",{label:a.lang.newpage.toolbar,command:"newpage",toolbar:"document,20"})}});(function(){function e(a){return{"aria-label":a,"class":"cke_pagebreak",contenteditable:"false","data-cke-display-name":"pagebreak","data-cke-pagebreak":1,style:"page-break-after: always",title:a}}CKEDITOR.plugins.add("pagebreak",{requires:"fakeobjects",onLoad:function(){var a=("background:url("+CKEDITOR.getUrl(this.path+"images/pagebreak.gif")+") no-repeat center center;clear:both;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;padding:0;height:5px;cursor:default;").replace(/;/g,
948
+ CKEDITOR.TRISTATE_DISABLED?CKEDITOR.TRISTATE_DISABLED:l)},null,null,100)}}})})();CKEDITOR.plugins.add("newpage",{init:function(a){a.addCommand("newpage",{modes:{wysiwyg:1,source:1},exec:function(b){var a=this;b.setData(b.config.newpage_html||"",function(){b.focus();setTimeout(function(){b.fire("afterCommandExec",{name:"newpage",command:a});b.selectionChange()},200)})},async:!0});a.ui.addButton&&a.ui.addButton("NewPage",{label:a.lang.newpage.toolbar,command:"newpage",toolbar:"document,20"})}});(function(){function e(a){return{"aria-label":a,"class":"cke_pagebreak",contenteditable:"false","data-cke-display-name":"pagebreak","data-cke-pagebreak":1,style:"page-break-after: always",title:a}}CKEDITOR.plugins.add("pagebreak",{requires:"fakeobjects",onLoad:function(){var a=("background:url("+CKEDITOR.getUrl(this.path+"images/pagebreak.gif")+") no-repeat center center;clear:both;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;padding:0;height:7px;cursor:default;").replace(/;/g,
947
949
  " !important;");CKEDITOR.addCss("div.cke_pagebreak{"+a+"}")},init:function(a){a.blockless||(a.addCommand("pagebreak",CKEDITOR.plugins.pagebreakCmd),a.ui.addButton&&a.ui.addButton("PageBreak",{label:a.lang.pagebreak.toolbar,command:"pagebreak",toolbar:"insert,70"}),CKEDITOR.env.webkit&&a.on("contentDom",function(){a.document.on("click",function(b){b=b.data.getTarget();b.is("div")&&b.hasClass("cke_pagebreak")&&a.getSelection().selectElement(b)})}))},afterInit:function(a){function b(f){CKEDITOR.tools.extend(f.attributes,
948
950
  e(a.lang.pagebreak.alt),!0);f.children.length=0}var c=a.dataProcessor,g=c&&c.dataFilter,c=c&&c.htmlFilter,h=/page-break-after\s*:\s*always/i,i=/display\s*:\s*none/i;c&&c.addRules({attributes:{"class":function(a,b){var c=a.replace("cke_pagebreak","");if(c!=a){var d=CKEDITOR.htmlParser.fragment.fromHtml('<span style="display: none;">&nbsp;</span>').children[0];b.children.length=0;b.add(d);d=b.attributes;delete d["aria-label"];delete d.contenteditable;delete d.title}return c}}},{applyToAll:!0,priority:5});
949
951
  g&&g.addRules({elements:{div:function(a){if(a.attributes["data-cke-pagebreak"])b(a);else if(h.test(a.attributes.style)){var c=a.children[0];c&&("span"==c.name&&i.test(c.attributes.style))&&b(a)}}}})}});CKEDITOR.plugins.pagebreakCmd={exec:function(a){var b=a.document.createElement("div",{attributes:e(a.lang.pagebreak.alt)});a.insertElement(b)},context:"div",allowedContent:{div:{styles:"!page-break-after"},span:{match:function(a){return(a=a.parent)&&"div"==a.name&&a.styles&&a.styles["page-break-after"]},