ckeditor.js
上传用户:netsea168
上传日期:2022-07-22
资源大小:4652k
文件大小:259k
- });var Q=M.clone();Q.setHtml(P);N.append(Q);}return N;};function w(L,M){var N=L.getHtml();N=u(N,/(?:^[ tnr]+)|(?:[ tnr]+$)/g,'');N=N.replace(/[ trn]*(<br[^>]*>)[ trn]*/gi,'$1');N=N.replace(/([ tnr]+| )/g,' ');N=N.replace(/<brb[^>]*>/gi,'n');if(c){var O=L.getDocument().createElement('div');O.append(M);M.$.outerHTML='<pre>'+N+'</pre>';M=O.getFirst().remove();}else M.setHtml(N);return M;};function x(L,M){var N=L._.definition,O=N.attributes,P=N.styles,Q=I(L);function R(){for(var T in O){if(T=='class'&&M.getAttribute(T)!=O[T])continue;M.removeAttribute(T);}};R();for(var S in P)M.removeStyle(S);O=Q[M.getName()];if(O)R();A(M);};function y(L,M){var N=L._.definition,O=N.attributes,P=N.styles,Q=I(L),R=M.getElementsByTag(L.element);for(var S=R.count();--S>=0;)x(L,R.getItem(S));for(var T in Q)if(T!=L.element){R=M.getElementsByTag(T);for(S=R.count()-1;S>=0;S--){var U=R.getItem(S);z(U,Q[T]);}}};function z(L,M){var N=M&&M.attributes;if(N)for(var O=0;O<N.length;O++){var P=N[O][0],Q;if(Q=L.getAttribute(P)){var R=N[O][1];if(R===null||R.test&&R.test(Q)||typeof R=='string'&&Q==R)L.removeAttribute(P);}}A(L);};function A(L){if(!L.hasAttributes()){var M=L.getFirst(),N=L.getLast();L.remove(true);if(M){B(M);if(N&&!M.equals(N))B(N);}}};function B(L){if(!L||L.type!=1||!f.$removeEmpty[L.getName()])return;C(L,L.getNext(),true);C(L,L.getPrevious());};function C(L,M,N){if(M&&M.type==1){var O=M.getAttribute('_fck_bookmark');if(O)M=N?M.getNext():M.getPrevious();if(M&&M.type==1&&L.isIdentical(M)){var P=N?L.getLast():L.getFirst();if(O)(N?M.getPrevious():M.getNext()).move(L,!N);M.moveChildren(L,!N);M.remove();if(P)B(P);}}};function D(L,M){var N,O=L._.definition,P=L.element;if(P=='*')P='span';N=new h(P,M);return E(N,L);};function E(L,M){var N=M._.definition,O=N.attributes,P=a.style.getStyleText(N);if(O)for(var Q in O)L.setAttribute(Q,O[Q]);if(P)L.setAttribute('style',P);return L;};var F=/#((.+?))/g;function G(L,M){for(var N in L)L[N]=L[N].replace(F,function(O,P){return M[P];});};function H(L){var M=L._AC;if(M)return M;M={};var N=0,O=L.attributes;if(O)for(var P in O){N++;M[P]=O[P];}var Q=a.style.getStyleText(L);if(Q){if(!M.style)N++;M.style=Q;}M._length=N;return L._AC=M;};function I(L){if(L._.overrides)return L._.overrides;var M=L._.overrides={},N=L._.definition.overrides;if(N){if(!e.isArray(N))N=[N];for(var O=0;O<N.length;O++){var P=N[O],Q,R,S;if(typeof P=='string')Q=P.toLowerCase();else{Q=P.element?P.element.toLowerCase():L.element;S=P.attributes;}R=M[Q]||(M[Q]={});if(S){var T=R.attributes=R.attributes||[];
- for(var U in S)T.push([U.toLowerCase(),S[U]]);}}}return M;};function J(L,M){var N;if(M!==false){var O=new h('span');O.setAttribute('style',L);N=O.getAttribute('style');}else N=L;return N.replace(/s*([;:])s*/,'$1').replace(/([^s;])$/,'$1;').toLowerCase();};function K(L,M){var N=L.getSelection(),O=N.getRanges(),P=M?this.removeFromRange:this.applyToRange;for(var Q=0;Q<O.length;Q++)P.call(this,O[Q]);N.selectRanges(O);};})();a.styleCommand=function(l){this.style=l;};a.styleCommand.prototype.exec=function(l){var n=this;l.focus();var m=l.document;if(m)if(n.state==2)n.style.apply(m);else if(n.state==1)n.style.remove(m);return!!m;};j.add('domiterator');(function(){var l=function(n){var o=this;if(arguments.length<1)return;o.range=n;o.forceBrBreak=false;o.enlargeBr=true;o.enforceRealBlocks=false;o._||(o._={});},m=/^[rnt ]+$/;l.prototype={getNextParagraph:function(n){var O=this;var o,p,q,r,s;if(!O._.lastNode){p=O.range.clone();p.enlarge(O.forceBrBreak||!O.enlargeBr?3:2);var t=new d.walker(p),u=d.walker.bookmark(true,true);t.evaluator=u;O._.nextNode=t.next();t=new d.walker(p);t.evaluator=u;var v=t.previous();O._.lastNode=v.getNextSourceNode(true);if(O._.lastNode&&O._.lastNode.type==3&&!e.trim(O._.lastNode.getText())&&O._.lastNode.getParent().isBlockBoundary()){var w=new d.range(p.document);w.moveToPosition(O._.lastNode,4);if(w.checkEndOfBlock()){var x=new d.elementPath(w.endContainer),y=x.block||x.blockLimit;O._.lastNode=y.getNextSourceNode(true);}}if(!O._.lastNode){O._.lastNode=O._.docEndMarker=p.document.createText('');O._.lastNode.insertAfter(v);}p=null;}var z=O._.nextNode;v=O._.lastNode;O._.nextNode=null;while(z){var A=false,B=z.type!=1,C=false;if(!B){var D=z.getName();if(z.isBlockBoundary(O.forceBrBreak&&{br:1})){if(D=='br')B=true;else if(!p&&!z.getChildCount()&&D!='hr'){o=z;q=z.equals(v);break;}if(p){p.setEndAt(z,3);if(D!='br')O._.nextNode=z;}A=true;}else{if(z.getFirst()){if(!p){p=new d.range(O.range.document);p.setStartAt(z,3);}z=z.getFirst();continue;}B=true;}}else if(z.type==3)if(m.test(z.getText()))B=false;if(B&&!p){p=new d.range(O.range.document);p.setStartAt(z,3);}q=(!A||B)&&(z.equals(v));if(p&&!A)while(!z.getNext()&&!q){var E=z.getParent();if(E.isBlockBoundary(O.forceBrBreak&&{br:1})){A=true;q=q||E.equals(v);break;}z=E;B=true;q=z.equals(v);C=true;}if(B)p.setEndAt(z,4);z=z.getNextSourceNode(C,null,v);q=!z;if((A||q)&&(p)){var F=p.getBoundaryNodes(),G=new d.elementPath(p.startContainer),H=new d.elementPath(p.endContainer);if(F.startNode.equals(F.endNode)&&F.startNode.getParent().equals(G.blockLimit)&&F.startNode.type==1&&F.startNode.getAttribute('_fck_bookmark')){p=null;
- O._.nextNode=null;}else break;}if(q)break;}if(!o){if(!p){O._.docEndMarker&&O._.docEndMarker.remove();O._.nextNode=null;return null;}G=new d.elementPath(p.startContainer);var I=G.blockLimit,J={div:1,th:1,td:1};o=G.block;if(!o&&!O.enforceRealBlocks&&J[I.getName()]&&p.checkStartOfBlock()&&p.checkEndOfBlock())o=I;else if(!o||O.enforceRealBlocks&&o.getName()=='li'){o=O.range.document.createElement(n||'p');p.extractContents().appendTo(o);o.trim();p.insertNode(o);r=s=true;}else if(o.getName()!='li'){if(!p.checkStartOfBlock()||!p.checkEndOfBlock()){o=o.clone(false);p.extractContents().appendTo(o);o.trim();var K=p.splitBlock();r=!K.wasStartOfBlock;s=!K.wasEndOfBlock;p.insertNode(o);}}else if(!q)O._.nextNode=o.equals(v)?null:p.getBoundaryNodes().endNode.getNextSourceNode(true,null,v);}if(r){var L=o.getPrevious();if(L&&L.type==1)if(L.getName()=='br')L.remove();else if(L.getLast()&&L.getLast().$.nodeName.toLowerCase()=='br')L.getLast().remove();}if(s){var M=d.walker.bookmark(false,true),N=o.getLast();if(N&&N.type==1&&N.getName()=='br')if(c||N.getPrevious(M)||N.getNext(M))N.remove();}if(!O._.nextNode)O._.nextNode=q||o.equals(v)?null:o.getNextSourceNode(true,null,v);return o;}};d.range.prototype.createIterator=function(){return new l(this);};})();j.add('panelbutton',{requires:['button'],beforeInit:function(l){l.ui.addHandler(4,k.panelButton.handler);}});a.UI_PANELBUTTON=4;(function(){var l=function(m){var o=this;var n=o._;if(n.state==0)return;o.createPanel(m);if(n.on){n.panel.hide();return;}n.panel.showBlock(o._.id,o.document.getById(o._.id),4);};k.panelButton=e.createClass({base:k.button,$:function(m){var o=this;var n=m.panel;delete m.panel;o.base(m);o.document=n&&n.parent&&n.parent.getDocument()||a.document;o.hasArrow=true;o.click=l;o._={panelDefinition:n};},statics:{handler:{create:function(m){return new k.panelButton(m);}}},proto:{createPanel:function(m){var n=this._;if(n.panel)return;var o=this._.panelDefinition||{},p=o.parent||a.document.getBody(),q=this._.panel=new k.floatPanel(m,p,o),r=this;q.onShow=function(){if(r.className)this.element.getFirst().addClass(r.className+'_panel');n.oldState=r._.state;r.setState(1);n.on=1;if(r.onOpen)r.onOpen();};q.onHide=function(){if(r.className)this.element.getFirst().removeClass(r.className+'_panel');r.setState(n.oldState);n.on=0;if(r.onClose)r.onClose();};q.onEscape=function(){q.hide();r.document.getById(n.id).focus();};if(this.onBlock)this.onBlock(q,n.id);q.getBlock(n.id).onHide=function(){n.on=0;r.setState(2);};}}});})();j.add('floatpanel',{requires:['panel']});
- (function(){var l={},m=false;function n(o,p,q,r,s){var t=p.getUniqueId()+'-'+q.getUniqueId()+'-'+o.skinName+'-'+o.lang.dir+(o.uiColor&&'-'+o.uiColor||'')+(r.css&&'-'+r.css||'')+(s&&'-'+s||''),u=l[t];if(!u){u=l[t]=new k.panel(p,r);u.element=q.append(h.createFromHtml(u.renderHtml(o),p));u.element.setStyles({display:'none',position:'absolute'});}return u;};k.floatPanel=e.createClass({$:function(o,p,q,r){q.forceIFrame=true;var s=p.getDocument(),t=n(o,s,p,q,r||0),u=t.element,v=u.getFirst().getFirst();this.element=u;this._={panel:t,parentElement:p,definition:q,document:s,iframe:v,children:[],dir:o.lang.dir};},proto:{addBlock:function(o,p){return this._.panel.addBlock(o,p);},addListBlock:function(o,p){return this._.panel.addListBlock(o,p);},getBlock:function(o){return this._.panel.getBlock(o);},showBlock:function(o,p,q,r,s){var t=this._.panel,u=t.showBlock(o);this.allowBlur(false);m=true;var v=this.element,w=this._.iframe,x=this._.definition,y=p.getDocumentPosition(v.getDocument()),z=this._.dir=='rtl',A=y.x+(r||0),B=y.y+(s||0);if(z&&(q==1||q==4)||!z&&(q==2||q==3))A+=p.$.offsetWidth-1;if(q==3||q==4)B+=p.$.offsetHeight-1;this._.panel._.offsetParentId=p.getId();v.setStyles({top:B+'px',left:'-3000px',visibility:'hidden',opacity:'0',display:''});if(!this._.blurSet){var C=c?w:new d.window(w.$.contentWindow);a.event.useCapture=true;C.on('blur',function(D){var G=this;if(c&&!G.allowBlur())return;var E=D.data.getTarget(),F=E.getWindow&&E.getWindow();if(F&&F.equals(C))return;if(G.visible&&!G._.activeChild&&!m)G.hide();},this);C.on('focus',function(){this._.focused=true;this.hideChild();this.allowBlur(true);},this);a.event.useCapture=false;this._.blurSet=1;}t.onEscape=e.bind(function(){this.onEscape&&this.onEscape();},this);e.setTimeout(function(){if(z)A-=v.$.offsetWidth;v.setStyles({left:A+'px',visibility:'',opacity:'1'});if(u.autoSize){function D(){var E=v.getFirst(),F=u.element.$.scrollHeight;if(c&&b.quirks&&F>0)F+=(E.$.offsetHeight||0)-(E.$.clientHeight||0);E.setStyle('height',F+'px');t._.currentBlock.element.setStyle('display','none').removeStyle('display');};if(t.isLoaded)D();else t.onLoad=D;}else v.getFirst().removeStyle('height');e.setTimeout(function(){if(x.voiceLabel)if(b.gecko){var E=w.getParent();E.setAttribute('role','region');E.setAttribute('title',x.voiceLabel);w.setAttribute('role','region');w.setAttribute('title',' ');}if(c&&b.quirks)w.focus();else w.$.contentWindow.focus();if(c&&!b.quirks)this.allowBlur(true);},0,this);},0,this);this.visible=1;if(this.onShow)this.onShow.call(this);
- m=false;},hide:function(){var o=this;if(o.visible&&(!o.onHide||o.onHide.call(o)!==true)){o.hideChild();o.element.setStyle('display','none');o.visible=0;}},allowBlur:function(o){var p=this._.panel;if(o!=undefined)p.allowBlur=o;return p.allowBlur;},showAsChild:function(o,p,q,r,s,t){if(this._.activeChild==o&&o._.panel._.offsetParentId==q.getId())return;this.hideChild();o.onHide=e.bind(function(){e.setTimeout(function(){if(!this._.focused)this.hide();},0,this);},this);this._.activeChild=o;this._.focused=false;o.showBlock(p,q,r,s,t);if(b.ie7Compat||b.ie8&&b.ie6Compat)setTimeout(function(){o.element.getChild(0).$.style.cssText+='';},100);},hideChild:function(){var o=this._.activeChild;if(o){delete o.onHide;delete this._.activeChild;o.hide();}}}});})();j.add('menu',{beforeInit:function(l){var m=l.config.menu_groups.split(','),n={};for(var o=0;o<m.length;o++)n[m[o]]=o+1;l._.menuGroups=n;l._.menuItems={};},requires:['floatpanel']});e.extend(a.editor.prototype,{addMenuGroup:function(l,m){this._.menuGroups[l]=m||100;},addMenuItem:function(l,m){if(this._.menuGroups[m.group])this._.menuItems[l]=new a.menuItem(this,l,m);},addMenuItems:function(l){for(var m in l)this.addMenuItem(m,l[m]);},getMenuItem:function(l){return this._.menuItems[l];}});(function(){a.menu=e.createClass({$:function(m,n){var o=this;o.id='cke_'+e.getNextNumber();o.editor=m;o.items=[];o._.level=n||1;},_:{showSubMenu:function(m){var s=this;var n=s._.subMenu,o=s.items[m],p=o.getItems&&o.getItems();if(!p){s._.panel.hideChild();return;}if(n)n.removeAll();else{n=s._.subMenu=new a.menu(s.editor,s._.level+1);n.parent=s;n.onClick=e.bind(s.onClick,s);}for(var q in p)n.add(s.editor.getMenuItem(q));var r=s._.panel.getBlock(s.id).element.getDocument().getById(s.id+String(m));n.show(r,2);}},proto:{add:function(m){if(!m.order)m.order=this.items.length;this.items.push(m);},removeAll:function(){this.items=[];},show:function(m,n,o,p){var q=this.items,r=this.editor,s=this._.panel,t=this._.element;if(!s){s=this._.panel=new k.floatPanel(this.editor,a.document.getBody(),{css:[a.getUrl(r.skinPath+'editor.css')],level:this._.level-1,className:r.skinClass+' cke_contextmenu'},this._.level);s.onEscape=e.bind(function(){this.onEscape&&this.onEscape();this.hide();},this);s.onHide=e.bind(function(){this.onHide&&this.onHide();},this);var u=s.addBlock(this.id);u.autoSize=true;var v=u.keys;v[40]='next';v[9]='next';v[38]='prev';v[2000+9]='prev';v[32]='click';v[39]='click';t=this._.element=u.element;t.addClass(r.skinClass);var w=t.getDocument();
- w.getBody().setStyle('overflow','hidden');w.getElementsByTag('html').getItem(0).setStyle('overflow','hidden');this._.itemOverFn=e.addFunction(function(C){var D=this;clearTimeout(D._.showSubTimeout);D._.showSubTimeout=e.setTimeout(D._.showSubMenu,r.config.menu_subMenuDelay,D,[C]);},this);this._.itemOutFn=e.addFunction(function(C){clearTimeout(this._.showSubTimeout);},this);this._.itemClickFn=e.addFunction(function(C){var E=this;var D=E.items[C];if(D.state==0){E.hide();return;}if(D.getItems)E._.showSubMenu(C);else E.onClick&&E.onClick(D);},this);}l(q);var x=['<div class="cke_menu">'],y=q.length,z=y&&q[0].group;for(var A=0;A<y;A++){var B=q[A];if(z!=B.group){x.push('<div class="cke_menuseparator"></div>');z=B.group;}B.render(this,A,x);}x.push('</div>');t.setHtml(x.join(''));if(this.parent)this.parent._.panel.showAsChild(s,this.id,m,n,o,p);else s.showBlock(this.id,m,n,o,p);},hide:function(){this._.panel&&this._.panel.hide();}}});function l(m){m.sort(function(n,o){if(n.group<o.group)return-1;else if(n.group>o.group)return 1;return n.order<o.order?-1:n.order>o.order?1:0;});};})();a.menuItem=e.createClass({$:function(l,m,n){var o=this;e.extend(o,n,{order:0,className:'cke_button_'+m});o.group=l._.menuGroups[o.group];o.editor=l;o.name=m;},proto:{render:function(l,m,n){var t=this;var o=l.id+String(m),p=typeof t.state=='undefined'?2:t.state,q=' cke_'+(p==1?'on':p==0?'disabled':'off'),r=t.label;if(p==0)r=t.editor.lang.common.unavailable.replace('%1',r);if(t.className)q+=' '+t.className;n.push('<span class="cke_menuitem"><a id="',o,'" class="',q,'" href="javascript:void('',(t.label||'').replace("'",''),'')" title="',t.label,'" tabindex="-1"_cke_focus=1 hidefocus="true"');if(b.opera||b.gecko&&b.mac)n.push(' onkeypress="return false;"');if(b.gecko)n.push(' onblur="this.style.cssText = this.style.cssText;"');var s=(t.iconOffset||0)*(-16);n.push(' onmouseover="CKEDITOR.tools.callFunction(',l._.itemOverFn,',',m,');" onmouseout="CKEDITOR.tools.callFunction(',l._.itemOutFn,',',m,');" onclick="CKEDITOR.tools.callFunction(',l._.itemClickFn,',',m,'); return false;"><span class="cke_icon_wrapper"><span class="cke_icon"'+(t.icon?' style="background-image:url('+a.getUrl(t.icon)+');background-position:0 '+s+'px;"></span>':'')+'></span></span>'+'<span class="cke_label">');if(t.getItems)n.push('<span class="cke_menuarrow"></span>');n.push(r,'</span></a></span>');}}});i.menu_subMenuDelay=400;i.menu_groups='clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea';
- (function(){function l(){var v=this;try{var s=v.getSelection();if(!s)return;var t=s.getStartElement(),u=new d.elementPath(t);if(!u.compare(v._.selectionPreviousPath)){v._.selectionPreviousPath=u;v.fire('selectionChange',{selection:s,path:u,element:t});}}catch(w){}};var m,n;function o(){n=true;if(m)return;p.call(this);m=e.setTimeout(p,200,this);};function p(){m=null;if(n){e.setTimeout(l,0,this);n=false;}};var q={exec:function(s){switch(s.mode){case 'wysiwyg':s.document.$.execCommand('SelectAll',false,null);break;case 'source':}},canUndo:false};j.add('selection',{init:function(s){s.on('contentDom',function(){var t=s.document;if(c){var u,v;t.on('focusin',function(){if(u){try{u.select();}catch(y){}u=null;}});s.window.on('focus',function(){v=true;x();});s.document.on('beforedeactivate',function(){v=false;s.document.$.execCommand('Unselect');});t.on('mousedown',w);t.on('mouseup',function(){v=true;setTimeout(function(){x(true);},0);});t.on('keydown',w);t.on('keyup',function(){v=true;x();});t.on('selectionchange',x);function w(){v=false;};function x(y){if(v){var z=s.document,A=z&&z.$.selection;if(y&&A&&A.type=='None')if(!z.$.queryCommandEnabled('InsertImage')){e.setTimeout(x,50,this,true);return;}u=A&&A.createRange();o.call(s);}};}else{t.on('mouseup',o,s);t.on('keyup',o,s);}});s.addCommand('selectAll',q);s.ui.addButton('SelectAll',{label:s.lang.selectAll,command:'selectAll'});s.selectionChange=o;}});a.editor.prototype.getSelection=function(){return this.document&&this.document.getSelection();};a.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath;};g.prototype.getSelection=function(){var s=new d.selection(this);return!s||s.isInvalid?null:s;};a.SELECTION_NONE=1;a.SELECTION_TEXT=2;a.SELECTION_ELEMENT=3;d.selection=function(s){var v=this;var t=s.getCustomData('cke_locked_selection');if(t)return t;v.document=s;v.isLocked=false;v._={cache:{}};if(c){var u=v.getNative().createRange();if(!u||u.item&&u.item(0).ownerDocument!=v.document.$||u.parentElement&&u.parentElement().ownerDocument!=v.document.$)v.isInvalid=true;}return v;};var r={img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,th:1,thead:1,tfoot:1};d.selection.prototype={getNative:c?function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.$.selection);}:function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.getWindow().$.getSelection());},getType:c?function(){var s=this._.cache;
- if(s.type)return s.type;var t=1;try{var u=this.getNative(),v=u.type;if(v=='Text')t=2;if(v=='Control')t=3;if(u.createRange().parentElement)t=2;}catch(w){}return s.type=t;}:function(){var s=this._.cache;if(s.type)return s.type;var t=2,u=this.getNative();if(!u)t=1;else if(u.rangeCount==1){var v=u.getRangeAt(0),w=v.startContainer;if(w==v.endContainer&&w.nodeType==1&&v.endOffset-v.startOffset==1&&r[w.childNodes[v.startOffset].nodeName.toLowerCase()])t=3;}return s.type=t;},getRanges:c?(function(){var s=function(t,u){t=t.duplicate();t.collapse(u);var v=t.parentElement(),w=v.childNodes,x;for(var y=0;y<w.length;y++){var z=w[y];if(z.nodeType==1){x=t.duplicate();x.moveToElementText(z);x.collapse();var A=x.compareEndPoints('StartToStart',t);if(A>0)break;else if(A===0)return{container:v,offset:y};x=null;}}if(!x){x=t.duplicate();x.moveToElementText(v);x.collapse(false);}x.setEndPoint('StartToStart',t);var B=x.text.replace(/(rn|r)/g,'n').length;while(B>0)B-=w[--y].nodeValue.length;if(B===0)return{container:v,offset:y};else return{container:w[y],offset:-B};};return function(){var E=this;var t=E._.cache;if(t.ranges)return t.ranges;var u=E.getNative(),v=u&&u.createRange(),w=E.getType(),x;if(!u)return[];if(w==2){x=new d.range(E.document);var y=s(v,true);x.setStart(new d.node(y.container),y.offset);y=s(v);x.setEnd(new d.node(y.container),y.offset);return t.ranges=[x];}else if(w==3){var z=E._.cache.ranges=[];for(var A=0;A<v.length;A++){var B=v.item(A),C=B.parentNode,D=0;x=new d.range(E.document);for(;D<C.childNodes.length&&C.childNodes[D]!=B;D++){}x.setStart(new d.node(C),D);x.setEnd(new d.node(C),D+1);z.push(x);}return z;}return t.ranges=[];};})():function(){var s=this._.cache;if(s.ranges)return s.ranges;var t=[],u=this.getNative();if(!u)return[];for(var v=0;v<u.rangeCount;v++){var w=u.getRangeAt(v),x=new d.range(this.document);x.setStart(new d.node(w.startContainer),w.startOffset);x.setEnd(new d.node(w.endContainer),w.endOffset);t.push(x);}return s.ranges=t;},getStartElement:function(){var z=this;var s=z._.cache;if(s.startElement!==undefined)return s.startElement;var t,u=z.getNative();switch(z.getType()){case 3:return z.getSelectedElement();case 2:var v=z.getRanges()[0];if(v)if(!v.collapsed){v.optimize();for(;;){var w=v.startContainer,x=v.startOffset;if(x==(w.getChildCount?w.getChildCount():w.getLength()))v.setStartAfter(w);else break;}t=v.startContainer;if(t.type!=1)return t.getParent();t=t.getChild(v.startOffset);if(!t||t.type!=1)return v.startContainer;var y=t.getFirst();
- while(y&&y.type==1){t=y;y=y.getFirst();}return t;}if(c){v=u.createRange();v.collapse(true);t=v.parentElement();}else{t=u.anchorNode;if(t.nodeType!=1)t=t.parentNode;}}return s.startElement=t?new h(t):null;},getSelectedElement:function(){var s=this._.cache;if(s.selectedElement!==undefined)return s.selectedElement;var t;if(this.getType()==3){var u=this.getNative();if(c)try{t=u.createRange().item(0);}catch(w){}else{var v=u.getRangeAt(0);t=v.startContainer.childNodes[v.startOffset];}}return s.selectedElement=t?new h(t):null;},lock:function(){var s=this;s.getRanges();s.getStartElement();s.getSelectedElement();s._.cache.nativeSel={};s.isLocked=true;s.document.setCustomData('cke_locked_selection',s);},unlock:function(s){var x=this;var t=x.document,u=t.getCustomData('cke_locked_selection');if(u){t.setCustomData('cke_locked_selection',null);if(s){var v=u.getSelectedElement(),w=!v&&u.getRanges();x.isLocked=false;x.reset();t.getBody().focus();if(v)x.selectElement(v);else x.selectRanges(w);}}if(!u||!s){x.isLocked=false;x.reset();}},reset:function(){this._.cache={};},selectElement:function(s){var v=this;if(v.isLocked){var t=new d.range(v.document);t.setStartBefore(s);t.setEndAfter(s);v._.cache.selectedElement=s;v._.cache.startElement=s;v._.cache.ranges=[t];v._.cache.type=3;return;}if(c){v.getNative().empty();try{t=v.document.$.body.createControlRange();t.addElement(s.$);t.select();}catch(w){t=v.document.$.body.createTextRange();t.moveToElementText(s.$);t.select();}v.reset();}else{t=v.document.$.createRange();t.selectNode(s.$);var u=v.getNative();u.removeAllRanges();u.addRange(t);v.reset();}},selectRanges:function(s){var y=this;if(y.isLocked){y._.cache.selectedElement=null;y._.cache.startElement=s[0].getTouchedStartNode();y._.cache.ranges=s;y._.cache.type=2;return;}if(c){if(s[0])s[0].select();y.reset();}else{var t=y.getNative();t.removeAllRanges();for(var u=0;u<s.length;u++){var v=s[u],w=y.document.$.createRange(),x=v.startContainer;if(v.collapsed&&b.gecko&&b.version<10900&&x.type==1&&!x.getChildCount())x.appendText('');w.setStart(x.$,v.startOffset);w.setEnd(v.endContainer.$,v.endOffset);t.addRange(w);}y.reset();}},createBookmarks:function(s){var t=[],u=this.getRanges(),v=u.length,w;for(var x=0;x<v;x++){t.push(w=u[x].createBookmark(s,true));s=w.serializable;var y=s?this.document.getById(w.startNode):w.startNode,z=s?this.document.getById(w.endNode):w.endNode;for(var A=x+1;A<v;A++){var B=u[A],C=B.startContainer,D=B.endContainer;C.equals(y.getParent())&&B.startOffset++;C.equals(z.getParent())&&B.startOffset++;
- D.equals(y.getParent())&&B.endOffset++;D.equals(z.getParent())&&B.endOffset++;}}return t;},createBookmarks2:function(s){var t=[],u=this.getRanges();for(var v=0;v<u.length;v++)t.push(u[v].createBookmark2(s));return t;},selectBookmarks:function(s){var t=[];for(var u=0;u<s.length;u++){var v=new d.range(this.document);v.moveToBookmark(s[u]);t.push(v);}this.selectRanges(t);return this;}};})();d.range.prototype.select=c?function(l){var u=this;var m=u.collapsed,n,o,p=u.createBookmark(),q=p.startNode,r;if(!m)r=p.endNode;var s=u.document.$.body.createTextRange();s.moveToElementText(q.$);s.moveStart('character',1);if(r){var t=u.document.$.body.createTextRange();t.moveToElementText(r.$);s.setEndPoint('EndToEnd',t);s.moveEnd('character',-1);}else{n=l||!q.hasPrevious()||q.getPrevious().is&&q.getPrevious().is('br');o=u.document.createElement('span');o.setHtml('');o.insertBefore(q);if(n)u.document.createText('').insertBefore(q);}u.setStartBefore(q);q.remove();if(m){if(n){s.moveStart('character',-1);s.select();u.document.$.selection.clear();}else s.select();o.remove();}else{u.setEndBefore(r);r.remove();s.select();}}:function(){var o=this;var l=o.startContainer;if(o.collapsed&&l.type==1&&!l.getChildCount())l.append(new d.text(''));var m=o.document.$.createRange();m.setStart(l.$,o.startOffset);try{m.setEnd(o.endContainer.$,o.endOffset);}catch(p){if(p.toString().indexOf('NS_ERROR_ILLEGAL_VALUE')>=0){o.collapse(true);m.setEnd(o.endContainer.$,o.endOffset);}else throw p;}var n=o.document.getSelection().getNative();n.removeAllRanges();n.addRange(m);};(function(){var l={elements:{$:function(m){var n=m.attributes._cke_realelement,o=n&&new a.htmlParser.fragment.fromHtml(decodeURIComponent(n)),p=o&&o.children[0];if(p){var q=m.attributes.style;if(q){var r=/(?:^|s)widths*:s*(d+)/.exec(q),s=r&&r[1];r=/(?:^|s)heights*:s*(d+)/.exec(q);var t=r&&r[1];if(s)p.attributes.width=s;if(t)p.attributes.height=t;}}return p;}}};j.add('fakeobjects',{requires:['htmlwriter'],afterInit:function(m){var n=m.dataProcessor,o=n&&n.htmlFilter;if(o)o.addRules(l);}});})();a.editor.prototype.createFakeElement=function(l,m,n,o){var p=this.lang.fakeobjects,q={'class':m,src:a.getUrl('images/spacer.gif'),_cke_realelement:encodeURIComponent(l.getOuterHtml()),alt:p[n]||p.unknown};if(n)q._cke_real_element_type=n;if(o)q._cke_resizable=o;return this.document.createElement('img',{attributes:q});};a.editor.prototype.createFakeParserElement=function(l,m,n,o){var p=new a.htmlParser.basicWriter();l.writeHtml(p);
- var q=p.getHtml(),r=this.lang.fakeobjects,s={'class':m,src:a.getUrl('images/spacer.gif'),_cke_realelement:encodeURIComponent(q),alt:r[n]||r.unknown};if(n)s._cke_real_element_type=n;if(o)s._cke_resizable=o;return new a.htmlParser.element('img',s);};a.editor.prototype.restoreRealElement=function(l){var m=decodeURIComponent(l.getAttribute('_cke_realelement'));return h.createFromHtml(m,this.document);};j.add('richcombo',{requires:['floatpanel','listblock','button'],beforeInit:function(l){l.ui.addHandler(3,k.richCombo.handler);}});a.UI_RICHCOMBO=3;k.richCombo=e.createClass({$:function(l){var n=this;e.extend(n,l,{title:l.label,modes:{wysiwyg:1}});var m=n.panel||{};delete n.panel;n.id=e.getNextNumber();n.document=m&&m.parent&&m.parent.getDocument()||a.document;m.className=(m.className||'')+(' cke_rcombopanel');n._={panelDefinition:m,items:{},state:2};},statics:{handler:{create:function(l){return new k.richCombo(l);}}},proto:{renderHtml:function(l){var m=[];this.render(l,m);return m.join('');},render:function(l,m){var n='cke_'+this.id,o=e.addFunction(function(r){var u=this;var s=u._;if(s.state==0)return;u.createPanel(l);if(s.on){s.panel.hide();return;}if(!s.committed){s.list.commit();s.committed=1;}var t=u.getValue();if(t)s.list.mark(t);else s.list.unmarkAll();s.panel.showBlock(u.id,new h(r),4);},this),p={id:n,combo:this,focus:function(){var r=a.document.getById(n).getChild(1);r.focus();},execute:o};l.on('mode',function(){this.setState(this.modes[l.mode]?2:0);},this);var q=e.addFunction(function(r,s){r=new d.event(r);var t=r.getKeystroke();switch(t){case 13:case 32:case 40:e.callFunction(o,s);break;default:p.onkey(p,t);}r.preventDefault();});m.push('<span class="cke_rcombo">','<span id=',n);if(this.className)m.push(' class="',this.className,' cke_off"');m.push('><span class=cke_label>',this.label,'</span><a hidefocus=true title="',this.title,'" tabindex="-1" href="javascript:void('',this.label,"')"");if(b.opera||b.gecko&&b.mac)m.push(' onkeypress="return false;"');if(b.gecko)m.push(' onblur="this.style.cssText = this.style.cssText;"');m.push(' onkeydown="CKEDITOR.tools.callFunction( ',q,', event, this );" onclick="CKEDITOR.tools.callFunction(',o,', this); return false;"><span><span class="cke_accessibility">'+(this.voiceLabel?this.voiceLabel+' ':'')+'</span>'+'<span id="'+n+'_text" class="cke_text cke_inline_label">'+this.label+'</span>'+'</span>'+'<span class=cke_openbutton></span>'+'</a>'+'</span>'+'</span>');if(this.onRender)this.onRender();return p;},createPanel:function(l){if(this._.panel)return;
- var m=this._.panelDefinition,n=m.parent||a.document.getBody(),o=new k.floatPanel(l,n,m),p=o.addListBlock(this.id,this.multiSelect),q=this;o.onShow=function(){if(q.className)this.element.getFirst().addClass(q.className+'_panel');q.setState(1);p.focus(!q.multiSelect&&q.getValue());q._.on=1;if(q.onOpen)q.onOpen();};o.onHide=function(){if(q.className)this.element.getFirst().removeClass(q.className+'_panel');q.setState(2);q._.on=0;if(q.onClose)q.onClose();};o.onEscape=function(){o.hide();q.document.getById('cke_'+q.id).getFirst().getNext().focus();};p.onClick=function(r,s){q.document.getWindow().focus();if(q.onClick)q.onClick.call(q,r,s);if(s)q.setValue(r,q._.items[r]);else q.setValue('');o.hide();};this._.panel=o;this._.list=p;o.getBlock(this.id).onHide=function(){q._.on=0;q.setState(2);};if(this.init)this.init();},setValue:function(l,m){var o=this;o._.value=l;var n=o.document.getById('cke_'+o.id+'_text');if(!l){m=o.label;n.addClass('cke_inline_label');}else n.removeClass('cke_inline_label');n.setHtml(typeof m!='undefined'?m:l);},getValue:function(){return this._.value||'';},unmarkAll:function(){this._.list.unmarkAll();},mark:function(l){this._.list.mark(l);},hideItem:function(l){this._.list.hideItem(l);},hideGroup:function(l){this._.list.hideGroup(l);},showAll:function(){this._.list.showAll();},add:function(l,m,n){this._.items[l]=n||l;this._.list.add(l,m,n);},startGroup:function(l){this._.list.startGroup(l);},commit:function(){this._.list.commit();},setState:function(l){var m=this;if(m._.state==l)return;m.document.getById('cke_'+m.id).setState(l);m._.state=l;}}});k.prototype.addRichCombo=function(l,m){this.add(l,3,m);};j.add('htmlwriter');a.htmlWriter=e.createClass({base:a.htmlParser.basicWriter,$:function(){var n=this;n.base();n.indentationChars='t';n.selfClosingEnd=' />';n.lineBreakChars='n';n.forceSimpleAmpersand=false;n.sortAttributes=true;n._.indent=false;n._.indentation='';n._.rules={};var l=f;for(var m in e.extend({},l.$block,l.$listItem,l.$tableContent))n.setRules(m,{indent:true,breakBeforeOpen:true,breakAfterOpen:true,breakBeforeClose:!l[m]['#'],breakAfterClose:true});n.setRules('br',{breakAfterOpen:true});n.setRules('pre',{indent:false});},proto:{openTag:function(l,m){var o=this;var n=o._.rules[l];if(o._.indent)o.indentation();else if(n&&n.breakBeforeOpen){o.lineBreak();o.indentation();}o._.output.push('<',l);},openTagClose:function(l,m){var o=this;var n=o._.rules[l];if(m)o._.output.push(o.selfClosingEnd);else{o._.output.push('>');if(n&&n.indent)o._.indentation+=o.indentationChars;
- }if(n&&n.breakAfterOpen)o.lineBreak();},attribute:function(l,m){if(this.forceSimpleAmpersand)m=m.replace(/&/,'&');this._.output.push(' ',l,'="',m,'"');},closeTag:function(l){var n=this;var m=n._.rules[l];if(m&&m.indent)n._.indentation=n._.indentation.substr(n.indentationChars.length);if(n._.indent)n.indentation();else if(m&&m.breakBeforeClose){n.lineBreak();n.indentation();}n._.output.push('</',l,'>');if(m&&m.breakAfterClose)n.lineBreak();},text:function(l){if(this._.indent){this.indentation();l=e.ltrim(l);}this._.output.push(l);},comment:function(l){if(this._.indent)this.indentation();this._.output.push('<!--',l,'-->');},lineBreak:function(){var l=this;if(l._.output.length>0)l._.output.push(l.lineBreakChars);l._.indent=true;},indentation:function(){this._.output.push(this._.indentation);this._.indent=false;},setRules:function(l,m){this._.rules[l]=m;}}});j.add('menubutton',{requires:['button','contextmenu'],beforeInit:function(l){l.ui.addHandler(5,k.menuButton.handler);}});a.UI_MENUBUTTON=5;(function(){var l=function(m){var n=this._;if(n.state===0)return;n.previousState=n.state;var o=n.menu;if(!o){o=n.menu=new j.contextMenu(m);o.onHide=e.bind(function(){this.setState(n.previousState);},this);if(this.onMenu)o.addListener(this.onMenu);}if(n.on){o.hide();return;}this.setState(1);o.show(a.document.getById(this._.id),4);};k.menuButton=e.createClass({base:k.button,$:function(m){var n=m.panel;delete m.panel;this.base(m);this.hasArrow=true;this.click=l;},statics:{handler:{create:function(m){return new k.menuButton(m);}}}});})();j.add('dialog',{requires:['dialogui']});a.DIALOG_RESIZE_NONE=0;a.DIALOG_RESIZE_WIDTH=1;a.DIALOG_RESIZE_HEIGHT=2;a.DIALOG_RESIZE_BOTH=3;(function(){function l(J){return!!this._.tabs[J][0].$.offsetHeight;};function m(){var N=this;var J=N._.currentTabId,K=N._.tabIdList.length,L=e.indexOf(N._.tabIdList,J)+K;for(var M=L-1;M>L-K;M--)if(l.call(N,N._.tabIdList[M%K]))return N._.tabIdList[M%K];return null;};function n(){var N=this;var J=N._.currentTabId,K=N._.tabIdList.length,L=e.indexOf(N._.tabIdList,J);for(var M=L+1;M<L+K;M++)if(l.call(N,N._.tabIdList[M%K]))return N._.tabIdList[M%K];return null;};var o={};a.dialog=function(J,K){var L=a.dialog._.dialogDefinitions[K];if(!L){console.log('Error: The dialog "'+K+'" is not defined.');return;}L=e.extend(L(J),q);L=e.clone(L);L=new u(this,L);this.definition=L=a.fire('dialogDefinition',{name:K,definition:L},J).definition;var M=a.document,N=J.theme.buildDialog(J);this._={editor:J,element:N.element,name:K,contentSize:{width:0,height:0},size:{width:0,height:0},updateSize:false,contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:false,focusList:[],currentFocusIndex:0,hasFocus:false};
- this.parts=N.parts;this.parts.dialog.setStyles({position:b.ie6Compat?'absolute':'fixed',top:0,left:0,visibility:'hidden'});a.event.call(this);if(L.onLoad)this.on('load',L.onLoad);if(L.onShow)this.on('show',L.onShow);if(L.onHide)this.on('hide',L.onHide);if(L.onOk)this.on('ok',function(X){if(L.onOk.call(this,X)===false)X.data.hide=false;});if(L.onCancel)this.on('cancel',function(X){if(L.onCancel.call(this,X)===false)X.data.hide=false;});var O=this,P=function(X){var Y=O._.contents,Z=false;for(var aa in Y)for(var ab in Y[aa]){Z=X.call(this,Y[aa][ab]);if(Z)return;}};this.on('ok',function(X){P(function(Y){if(Y.validate){var Z=Y.validate(this);if(typeof Z=='string'){alert(Z);Z=false;}if(Z===false){if(Y.select)Y.select();else Y.focus();X.data.hide=false;X.stop();return true;}}});},this,null,0);this.on('cancel',function(X){P(function(Y){if(Y.isChanged()){if(!confirm(J.lang.common.confirmCancel))X.data.hide=false;return true;}});},this,null,0);this.parts.close.on('click',function(X){if(this.fire('cancel',{hide:true}).hide!==false)this.hide();},this);function Q(X){var Y=O._.focusList,Z=X?1:-1;if(Y.length<1)return;var aa=(O._.currentFocusIndex+Z+Y.length)%(Y.length);while(!Y[aa].isFocusable()){aa=(aa+Z+Y.length)%(Y.length);if(aa==O._.currentFocusIndex)break;}Y[aa].focus();};function R(X){if(O!=a.dialog._.currentTop)return;var Y=X.data.getKeystroke(),Z=false;if(Y==9||Y==2000+9){var aa=Y==2000+9;if(O._.tabBarMode){var ab=aa?m.call(O):n.call(O);O.selectPage(ab);O._.tabs[ab][0].focus();}else Q(!aa);Z=true;}else if(Y==4000+121&&!O._.tabBarMode){O._.tabBarMode=true;O._.tabs[O._.currentTabId][0].focus();Z=true;}else if((Y==37||Y==39)&&(O._.tabBarMode)){ab=Y==37?m.call(O):n.call(O);O.selectPage(ab);O._.tabs[ab][0].focus();Z=true;}if(Z){X.stop();X.data.preventDefault();}};this.on('show',function(){a.document.on('keydown',R,this,null,0);if(b.ie6Compat){var X=z.getChild(0).getFrameDocument();X.on('keydown',R,this,null,0);}});this.on('hide',function(){a.document.removeListener('keydown',R);});this.on('iframeAdded',function(X){var Y=new g(X.data.iframe.$.contentWindow.document);Y.on('keydown',R,this,null,0);});this.on('show',function(){var aa=this;if(!aa._.hasFocus){aa._.currentFocusIndex=-1;Q(true);if(aa._.editor.mode=='wysiwyg'&&c){var X=J.document.$.selection,Y=X.createRange();if(Y)if(Y.parentElement&&Y.parentElement().ownerDocument==J.document.$||Y.item&&Y.item(0).ownerDocument==J.document.$){var Z=document.body.createTextRange();Z.moveToElementText(aa.getElement().getFirst().$);
- Z.collapse(true);Z.select();}}}},this,null,4294967295);if(b.ie6Compat)this.on('load',function(X){var Y=this.getElement(),Z=Y.getFirst();Z.remove();Z.appendTo(Y);},this);w(this);x(this);new d.text(L.title,a.document).appendTo(this.parts.title);for(var S=0;S<L.contents.length;S++)this.addPage(L.contents[S]);var T=/cke_dialog_tab(s|$|_)/,U=/cke_dialog_tab(s|$)/;this.parts.tabs.on('click',function(X){var ac=this;var Y=X.data.getTarget(),Z=Y,aa,ab;if(!(T.test(Y.$.className)||Y.getName()=='a'))return;aa=Y.$.id.substr(0,Y.$.id.lastIndexOf('_'));ac.selectPage(aa);if(ac._.tabBarMode){ac._.tabBarMode=false;ac._.currentFocusIndex=-1;Q(true);}X.data.preventDefault();},this);var V=[],W=a.dialog._.uiElementBuilders.hbox.build(this,{type:'hbox',className:'cke_dialog_footer_buttons',widths:[],children:L.buttons},V).getChild();this.parts.footer.setHtml(V.join(''));for(S=0;S<W.length;S++)this._.buttons[W[S].id]=W[S];a.skins.load(J,'dialog');};function p(J,K,L){this.element=K;this.focusIndex=L;this.isFocusable=function(){return true;};this.focus=function(){J._.currentFocusIndex=this.focusIndex;this.element.focus();};K.on('keydown',function(M){if(M.data.getKeystroke() in {32:1,13:1})this.fire('click');});K.on('focus',function(){this.fire('mouseover');});K.on('blur',function(){this.fire('mouseout');});};a.dialog.prototype={resize:(function(){return function(J,K){var L=this;if(L._.contentSize&&L._.contentSize.width==J&&L._.contentSize.height==K)return;a.dialog.fire('resize',{dialog:L,skin:L._.editor.skinName,width:J,height:K},L._.editor);L._.contentSize={width:J,height:K};L._.updateSize=true;};})(),getSize:function(){var L=this;if(!L._.updateSize)return L._.size;var J=L._.element.getFirst(),K=L._.size={width:J.$.offsetWidth||0,height:J.$.offsetHeight||0};L._.updateSize=!K.width||!K.height;return K;},move:(function(){var J;return function(K,L){var O=this;var M=O._.element.getFirst();if(J===undefined)J=M.getComputedStyle('position')=='fixed';if(J&&O._.position&&O._.position.x==K&&O._.position.y==L)return;O._.position={x:K,y:L};if(!J){var N=a.document.getWindow().getScrollPosition();K+=N.x;L+=N.y;}M.setStyles({left:(K>0?K:0)+('px'),top:(L>0?L:0)+('px')});};})(),getPosition:function(){return e.extend({},this._.position);},show:function(){if(this._.editor.mode=='wysiwyg'&&c)this._.editor.getSelection().lock();var J=this._.element,K=this.definition;if(!(J.getParent()&&J.getParent().equals(a.document.getBody())))J.appendTo(a.document.getBody());else return;if(b.gecko&&b.version<10900){var L=this.parts.dialog;
- L.setStyle('position','absolute');setTimeout(function(){L.setStyle('position','fixed');},0);}this.resize(K.minWidth,K.minHeight);this.selectPage(this.definition.contents[0].id);this.reset();if(a.dialog._.currentZIndex===null)a.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex;this._.element.getFirst().setStyle('z-index',a.dialog._.currentZIndex+=10);if(a.dialog._.currentTop===null){a.dialog._.currentTop=this;this._.parentDialog=null;A(this._.editor);a.document.on('keydown',D);a.document.on('keyup',E);}else{this._.parentDialog=a.dialog._.currentTop;var M=this._.parentDialog.getElement().getFirst();M.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);a.dialog._.currentTop=this;}F(this,this,'x1b',null,function(){this.getButton('cancel')&&this.getButton('cancel').click();});this._.hasFocus=false;e.setTimeout(function(){var N=a.document.getWindow().getViewPaneSize(),O=this.getSize();this.move((N.width-K.minWidth)/(2),(N.height-O.height)/(2));this.parts.dialog.setStyle('visibility','');this.fireOnce('load',{});this.fire('show',{});this.foreach(function(P){P.setInitValue&&P.setInitValue();});},100,this);},foreach:function(J){var M=this;for(var K in M._.contents)for(var L in M._.contents[K])J(M._.contents[K][L]);return M;},reset:(function(){var J=function(K){if(K.reset)K.reset();};return function(){this.foreach(J);return this;};})(),setupContent:function(){var J=arguments;this.foreach(function(K){if(K.setup)K.setup.apply(K,J);});},commitContent:function(){var J=arguments;this.foreach(function(K){if(K.commit)K.commit.apply(K,J);});},hide:function(){this.fire('hide',{});var J=this._.element;if(!J.getParent())return;J.remove();this.parts.dialog.setStyle('visibility','hidden');G(this);if(!this._.parentDialog)B();else{var K=this._.parentDialog.getElement().getFirst();K.setStyle('z-index',parseInt(K.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2));}a.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){a.dialog._.currentZIndex=null;a.document.removeListener('keydown',D);a.document.removeListener('keyup',E);var L=this._.editor;L.focus();if(L.mode=='wysiwyg'&&c)L.getSelection().unlock(true);}else a.dialog._.currentZIndex-=10;this.foreach(function(M){M.resetInitValue&&M.resetInitValue();});},addPage:function(J){var T=this;var K=[],L=J.label?' title="'+e.htmlEncode(J.label)+'"':'',M=J.elements,N=a.dialog._.uiElementBuilders.vbox.build(T,{type:'vbox',className:'cke_dialog_page_contents',children:J.elements,expand:!!J.expand,padding:J.padding,style:J.style||'width: 100%; height: 100%;'},K),O=h.createFromHtml(K.join('')),P=h.createFromHtml(['<a class="cke_dialog_tab"',T._.pageCount>0?' cke_last':'cke_first',L,!!J.hidden?' style="display:none"':'',' id="',J.id+'_',e.getNextNumber(),'" href="javascript:void(0)"',' hidefocus="true">',J.label,'</a>'].join(''));
- if(T._.pageCount===0)T.parts.dialog.addClass('cke_single_page');else T.parts.dialog.removeClass('cke_single_page');T._.tabs[J.id]=[P,O];T._.tabIdList.push(J.id);T._.pageCount++;T._.lastTab=P;var Q=T._.contents[J.id]={},R,S=N.getChild();while(R=S.shift()){Q[R.id]=R;if(typeof R.getChild=='function')S.push.apply(S,R.getChild());}O.setAttribute('name',J.id);O.appendTo(T.parts.contents);P.unselectable();T.parts.tabs.append(P);if(J.accessKey){F(T,T,'CTRL+'+J.accessKey,I,H);T._.accessKeyMap['CTRL+'+J.accessKey]=J.id;}},selectPage:function(J){var O=this;for(var K in O._.tabs){var L=O._.tabs[K][0],M=O._.tabs[K][1];if(K!=J){L.removeClass('cke_dialog_tab_selected');M.hide();}}var N=O._.tabs[J];N[0].addClass('cke_dialog_tab_selected');N[1].show();O._.currentTabId=J;O._.currentTabIndex=e.indexOf(O._.tabIdList,J);},hidePage:function(J){var K=this._.tabs[J]&&this._.tabs[J][0];if(!K)return;K.hide();},showPage:function(J){var K=this._.tabs[J]&&this._.tabs[J][0];if(!K)return;K.show();},getElement:function(){return this._.element;},getName:function(){return this._.name;},getContentElement:function(J,K){return this._.contents[J][K];},getValueOf:function(J,K){return this.getContentElement(J,K).getValue();},setValueOf:function(J,K,L){return this.getContentElement(J,K).setValue(L);},getButton:function(J){return this._.buttons[J];},click:function(J){return this._.buttons[J].click();},disableButton:function(J){return this._.buttons[J].disable();},enableButton:function(J){return this._.buttons[J].enable();},getPageCount:function(){return this._.pageCount;},getParentEditor:function(){return this._.editor;},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement();},addFocusable:function(J,K){var M=this;if(typeof K=='undefined'){K=M._.focusList.length;M._.focusList.push(new p(M,J,K));}else{M._.focusList.splice(K,0,new p(M,J,K));for(var L=K+1;L<M._.focusList.length;L++)M._.focusList[L].focusIndex++;}}};e.extend(a.dialog,{add:function(J,K){if(!this._.dialogDefinitions[J]||typeof K=='function')this._.dialogDefinitions[J]=K;},exists:function(J){return!!this._.dialogDefinitions[J];},getCurrent:function(){return a.dialog._.currentTop;},okButton:(function(){var J=function(K,L){L=L||{};return e.extend({id:'ok',type:'button',label:K.lang.common.ok,'class':'cke_dialog_ui_button_ok',onClick:function(M){var N=M.data.dialog;if(N.fire('ok',{hide:true}).hide!==false)N.hide();}},L,true);};J.type='button';J.override=function(K){return e.extend(function(L){return J(L,K);
- },{type:'button'},true);};return J;})(),cancelButton:(function(){var J=function(K,L){L=L||{};return e.extend({id:'cancel',type:'button',label:K.lang.common.cancel,'class':'cke_dialog_ui_button_cancel',onClick:function(M){var N=M.data.dialog;if(N.fire('cancel',{hide:true}).hide!==false)N.hide();}},L,true);};J.type='button';J.override=function(K){return e.extend(function(L){return J(L,K);},{type:'button'},true);};return J;})(),addUIElement:function(J,K){this._.uiElementBuilders[J]=K;}});a.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};a.event.implementOn(a.dialog);a.event.implementOn(a.dialog.prototype,true);var q={resizable:0,minWidth:600,minHeight:400,buttons:[a.dialog.okButton,a.dialog.cancelButton]},r=function(J,K,L){for(var M=0,N;N=J[M];M++){if(N.id==K)return N;if(L&&N[L]){var O=r(N[L],K,L);if(O)return O;}}return null;},s=function(J,K,L,M,N){if(L){for(var O=0,P;P=J[O];O++){if(P.id==L){J.splice(O,0,K);return K;}if(M&&P[M]){var Q=s(P[M],K,L,M,true);if(Q)return Q;}}if(N)return null;}J.push(K);return K;},t=function(J,K,L){for(var M=0,N;N=J[M];M++){if(N.id==K)return J.splice(M,1);if(L&&N[L]){var O=t(N[L],K,L);if(O)return O;}}return null;},u=function(J,K){this.dialog=J;var L=K.contents;for(var M=0,N;N=L[M];M++)L[M]=new v(J,N);e.extend(this,K);};u.prototype={getContents:function(J){return r(this.contents,J);},getButton:function(J){return r(this.buttons,J);},addContents:function(J,K){return s(this.contents,J,K);},addButton:function(J,K){return s(this.buttons,J,K);},removeContents:function(J){t(this.contents,J);},removeButton:function(J){t(this.buttons,J);}};function v(J,K){this._={dialog:J};e.extend(this,K);};v.prototype={get:function(J){return r(this.elements,J,'children');},add:function(J,K){return s(this.elements,J,K,'children');},remove:function(J){t(this.elements,J,'children');}};function w(J){var K=null,L=null,M=J.getElement().getFirst(),N=J.getParentEditor(),O=N.config.dialog_magnetDistance,P=o[N.skinName].margins||[0,0,0,0];function Q(S){var T=J.getSize(),U=a.document.getWindow().getViewPaneSize(),V=S.data.$.screenX,W=S.data.$.screenY,X=V-K.x,Y=W-K.y,Z,aa;K={x:V,y:W};L.x+=X;L.y+=Y;if(L.x+P[3]<O)Z=-P[3];else if(L.x-P[1]>U.width-T.width-O)Z=U.width-T.width+P[1];else Z=L.x;if(L.y+P[0]<O)aa=-P[0];else if(L.y-P[2]>U.height-T.height-O)aa=U.height-T.height+P[2];else aa=L.y;J.move(Z,aa);S.data.preventDefault();};function R(S){a.document.removeListener('mousemove',Q);a.document.removeListener('mouseup',R);if(b.ie6Compat){var T=z.getChild(0).getFrameDocument();
- T.removeListener('mousemove',Q);T.removeListener('mouseup',R);}};J.parts.title.on('mousedown',function(S){J._.updateSize=true;K={x:S.data.$.screenX,y:S.data.$.screenY};a.document.on('mousemove',Q);a.document.on('mouseup',R);L=J.getPosition();if(b.ie6Compat){var T=z.getChild(0).getFrameDocument();T.on('mousemove',Q);T.on('mouseup',R);}S.data.preventDefault();},J);};function x(J){var K=J.definition,L=K.minWidth||0,M=K.minHeight||0,N=K.resizable,O=o[J.getParentEditor().skinName].margins||[0,0,0,0];function P(aa,ab){aa.y+=ab;};function Q(aa,ab){aa.x2+=ab;};function R(aa,ab){aa.y2+=ab;};function S(aa,ab){aa.x+=ab;};var T=null,U=null,V=J._.editor.config.magnetDistance,W=['tl','t','tr','l','r','bl','b','br'];function X(aa){var ab=aa.listenerData.part,ac=J.getSize();U=J.getPosition();e.extend(U,{x2:U.x+ac.width,y2:U.y+ac.height});T={x:aa.data.$.screenX,y:aa.data.$.screenY};a.document.on('mousemove',Y,J,{part:ab});a.document.on('mouseup',Z,J,{part:ab});if(b.ie6Compat){var ad=z.getChild(0).getFrameDocument();ad.on('mousemove',Y,J,{part:ab});ad.on('mouseup',Z,J,{part:ab});}aa.data.preventDefault();};function Y(aa){var ab=aa.data.$.screenX,ac=aa.data.$.screenY,ad=ab-T.x,ae=ac-T.y,af=a.document.getWindow().getViewPaneSize(),ag=aa.listenerData.part;if(ag.search('t')!=-1)P(U,ae);if(ag.search('l')!=-1)S(U,ad);if(ag.search('b')!=-1)R(U,ae);if(ag.search('r')!=-1)Q(U,ad);T={x:ab,y:ac};var ah,ai,aj,ak;if(U.x+O[3]<V)ah=-O[3];else if(ag.search('l')!=-1&&U.x2-U.x<L+V)ah=U.x2-L;else ah=U.x;if(U.y+O[0]<V)ai=-O[0];else if(ag.search('t')!=-1&&U.y2-U.y<M+V)ai=U.y2-M;else ai=U.y;if(U.x2-O[1]>af.width-V)aj=af.width+O[1];else if(ag.search('r')!=-1&&U.x2-U.x<L+V)aj=U.x+L;else aj=U.x2;if(U.y2-O[2]>af.height-V)ak=af.height+O[2];else if(ag.search('b')!=-1&&U.y2-U.y<M+V)ak=U.y+M;else ak=U.y2;J.move(ah,ai);J.resize(aj-ah,ak-ai);aa.data.preventDefault();};function Z(aa){a.document.removeListener('mouseup',Z);a.document.removeListener('mousemove',Y);if(b.ie6Compat){var ab=z.getChild(0).getFrameDocument();ab.removeListener('mouseup',Z);ab.removeListener('mousemove',Y);}};};var y,z,A=function(J){var K=a.document.getWindow();if(!z){var L=['<div style="position: ',b.ie6Compat?'absolute':'fixed','; z-index: ',J.config.baseFloatZIndex,'; top: 0px; left: 0px; ','background-color: ',J.config.dialog_backgroundCoverColor,'" id="cke_dialog_background_cover">'];if(b.ie6Compat){var M=b.isCustomDomain();L.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:');L.push(M?"void((function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})())':"''");
- L.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>');}L.push('</div>');z=h.createFromHtml(L.join(''));}var N=z,O=function(){var R=K.getViewPaneSize();N.setStyles({width:R.width+'px',height:R.height+'px'});},P=function(){var R=K.getScrollPosition(),S=a.dialog._.currentTop;N.setStyles({left:R.x+'px',top:R.y+'px'});do{var T=S.getPosition();S.move(T.x,T.y);}while(S=S._.parentDialog)};y=O;K.on('resize',O);O();if(b.ie6Compat){var Q=function(){P();arguments.callee.prevScrollHandler.apply(this,arguments);};K.$.setTimeout(function(){Q.prevScrollHandler=window.onscroll||(function(){});window.onscroll=Q;},0);P();}N.setOpacity(J.config.dialog_backgroundCoverOpacity);N.appendTo(a.document.getBody());},B=function(){if(!z)return;var J=a.document.getWindow();z.remove();J.removeListener('resize',y);if(b.ie6Compat)J.$.setTimeout(function(){var K=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=K||null;},0);y=null;},C={},D=function(J){var K=J.data.$.ctrlKey||J.data.$.metaKey,L=J.data.$.altKey,M=J.data.$.shiftKey,N=String.fromCharCode(J.data.$.keyCode),O=C[(K?'CTRL+':'')+(L?'ALT+':'')+(M?'SHIFT+':'')+N];if(!O||!O.length)return;O=O[O.length-1];O.keydown&&O.keydown.call(O.uiElement,O.dialog,O.key);J.data.preventDefault();},E=function(J){var K=J.data.$.ctrlKey||J.data.$.metaKey,L=J.data.$.altKey,M=J.data.$.shiftKey,N=String.fromCharCode(J.data.$.keyCode),O=C[(K?'CTRL+':'')+(L?'ALT+':'')+(M?'SHIFT+':'')+N];if(!O||!O.length)return;O=O[O.length-1];O.keyup&&O.keyup.call(O.uiElement,O.dialog,O.key);J.data.preventDefault();},F=function(J,K,L,M,N){var O=C[L]||(C[L]=[]);O.push({uiElement:J,dialog:K,key:L,keyup:N||J.accessKeyUp,keydown:M||J.accessKeyDown});},G=function(J){for(var K in C){var L=C[K];for(var M=L.length-1;M>=0;M--)if(L[M].dialog==J||L[M].uiElement==J)L.splice(M,1);if(L.length===0)delete C[K];}},H=function(J,K){if(J._.accessKeyMap[K])J.selectPage(J._.accessKeyMap[K]);},I=function(J,K){};(function(){k.dialog={uiElement:function(J,K,L,M,N,O,P){if(arguments.length<4)return;var Q=(M.call?M(K):M)||('div'),R=['<',Q,' '],S=(N&&N.call?N(K):N)||({}),T=(O&&O.call?O(K):O)||({}),U=(P&&P.call?P(J,K):P)||(''),V=this.domId=T.id||e.getNextNumber()+'_uiElement',W=this.id=K.id,X;T.id=V;var Y={};if(K.type)Y['cke_dialog_ui_'+K.type]=1;if(K.className)Y[K.className]=1;var Z=T['class']&&T['class'].split?T['class'].split(' '):[];for(X=0;X<Z.length;X++)if(Z[X])Y[Z[X]]=1;var aa=[];for(X in Y)aa.push(X);
- T['class']=aa.join(' ');if(K.title)T.title=K.title;var ab=(K.style||'').split(';');for(X in S)ab.push(X+':'+S[X]);if(K.hidden)ab.push('display:none');for(X=ab.length-1;X>=0;X--)if(ab[X]==='')ab.splice(X,1);if(ab.length>0)T.style=(T.style?T.style+'; ':'')+(ab.join('; '));for(X in T)R.push(X+'="'+e.htmlEncode(T[X])+'" ');R.push('>',U,'</',Q,'>');L.push(R.join(''));(this._||(this._={})).dialog=J;if(typeof K.isChanged=='boolean')this.isChanged=function(){return K.isChanged;};if(typeof K.isChanged=='function')this.isChanged=K.isChanged;a.event.implementOn(this);this.registerEvents(K);if(this.accessKeyUp&&this.accessKeyDown&&K.accessKey)F(this,J,'CTRL+'+K.accessKey);var ac=this;J.on('load',function(){if(ac.getInputElement())ac.getInputElement().on('focus',function(){J._.tabBarMode=false;J._.hasFocus=true;ac.fire('focus');},ac);});if(this.keyboardFocusable){this.focusIndex=J._.focusList.push(this)-1;this.on('focus',function(){J._.currentFocusIndex=ac.focusIndex;});}e.extend(this,K);},hbox:function(J,K,L,M,N){if(arguments.length<4)return;this._||(this._={});var O=this._.children=K,P=N&&N.widths||null,Q=N&&N.height||null,R={},S,T=function(){var U=['<tbody><tr class="cke_dialog_ui_hbox">'];for(S=0;S<L.length;S++){var V='cke_dialog_ui_hbox_child',W=[];if(S===0)V='cke_dialog_ui_hbox_first';if(S==L.length-1)V='cke_dialog_ui_hbox_last';U.push('<td class="',V,'" ');if(P){if(P[S])W.push('width:'+e.cssLength(P[S]));}else W.push('width:'+Math.floor(100/L.length)+'%');if(Q)W.push('height:'+e.cssLength(Q));if(N&&N.padding!=undefined)W.push('padding:'+e.cssLength(N.padding));if(W.length>0)U.push('style="'+W.join('; ')+'" ');U.push('>',L[S],'</td>');}U.push('</tr></tbody>');return U.join('');};k.dialog.uiElement.call(this,J,N||{type:'hbox'},M,'table',R,N&&N.align&&{align:N.align}||null,T);},vbox:function(J,K,L,M,N){if(arguments.length<3)return;this._||(this._={});var O=this._.children=K,P=N&&N.width||null,Q=N&&N.heights||null,R=function(){var S=['<table cellspacing="0" border="0" '];S.push('style="');if(N&&N.expand)S.push('height:100%;');S.push('width:'+e.cssLength(P||'100%'),';');S.push('"');S.push('align="',e.htmlEncode(N&&N.align||(J.getParentEditor().lang.dir=='ltr'?'left':'right')),'" ');S.push('><tbody>');for(var T=0;T<L.length;T++){var U=[];S.push('<tr><td ');if(P)U.push('width:'+e.cssLength(P||'100%'));if(Q)U.push('height:'+e.cssLength(Q[T]));else if(N&&N.expand)U.push('height:'+Math.floor(100/L.length)+'%');if(N&&N.padding!=undefined)U.push('padding:'+e.cssLength(N.padding));
- if(U.length>0)S.push('style="',U.join('; '),'" ');S.push(' class="cke_dialog_ui_vbox_child">',L[T],'</td></tr>');}S.push('</tbody></table>');return S.join('');};k.dialog.uiElement.call(this,J,N||{type:'vbox'},M,'div',null,null,R);}};})();k.dialog.uiElement.prototype={getElement:function(){return a.document.getById(this.domId);},getInputElement:function(){return this.getElement();},getDialog:function(){return this._.dialog;},setValue:function(J){this.getInputElement().setValue(J);this.fire('change',{value:J});return this;},getValue:function(){return this.getInputElement().getValue();},isChanged:function(){return false;},selectParentTab:function(){var M=this;var J=M.getInputElement(),K=J,L;while((K=K.getParent())&&(K.$.className.search('cke_dialog_page_contents')==-1)){}if(!K)return M;L=K.getAttribute('name');if(M._.dialog._.currentTabId!=L)M._.dialog.selectPage(L);return M;},focus:function(){this.selectParentTab().getInputElement().focus();return this;},registerEvents:function(J){var K=/^on([A-Z]w+)/,L,M=function(O,P,Q,R){P.on('load',function(){O.getInputElement().on(Q,R,O);});};for(var N in J){if(!(L=N.match(K)))continue;if(this.eventProcessors[N])this.eventProcessors[N].call(this,this._.dialog,J[N]);else M(this,this._.dialog,L[1].toLowerCase(),J[N]);}return this;},eventProcessors:{onLoad:function(J,K){J.on('load',K,this);},onShow:function(J,K){J.on('show',K,this);},onHide:function(J,K){J.on('hide',K,this);}},accessKeyDown:function(J,K){this.focus();},accessKeyUp:function(J,K){},disable:function(){var J=this.getInputElement();J.setAttribute('disabled','true');J.addClass('cke_disabled');},enable:function(){var J=this.getInputElement();J.removeAttribute('disabled');J.removeClass('cke_disabled');},isEnabled:function(){return!this.getInputElement().getAttribute('disabled');},isVisible:function(){return!!this.getInputElement().$.offsetHeight;},isFocusable:function(){if(!this.isEnabled()||!this.isVisible())return false;return true;}};k.dialog.hbox.prototype=e.extend(new k.dialog.uiElement(),{getChild:function(J){var K=this;if(arguments.length<1)return K._.children.concat();if(!J.splice)J=[J];if(J.length<2)return K._.children[J[0]];else return K._.children[J[0]]&&K._.children[J[0]].getChild?K._.children[J[0]].getChild(J.slice(1,J.length)):null;}},true);k.dialog.vbox.prototype=new k.dialog.hbox();(function(){var J={build:function(K,L,M){var N=L.children,O,P=[],Q=[];for(var R=0;R<N.length&&(O=N[R]);R++){var S=[];P.push(S);Q.push(a.dialog._.uiElementBuilders[O.type].build(K,O,S));
- }return new k.dialog[L.type](K,Q,P,M,L);}};a.dialog.addUIElement('hbox',J);a.dialog.addUIElement('vbox',J);})();a.dialogCommand=function(J){this.dialogName=J;};a.dialogCommand.prototype={exec:function(J){J.openDialog(this.dialogName);},canUndo:false};(function(){var J=/^([a]|[^a])+$/,K=/^d*$/,L=/^d*(?:.d+)?$/;a.VALIDATE_OR=1;a.VALIDATE_AND=2;a.dialog.validate={functions:function(){return function(){var S=this;var M=S&&S.getValue?S.getValue():arguments[0],N=undefined,O=2,P=[],Q;for(Q=0;Q<arguments.length;Q++)if(typeof arguments[Q]=='function')P.push(arguments[Q]);else break;if(Q<arguments.length&&typeof arguments[Q]=='string'){N=arguments[Q];Q++;}if(Q<arguments.length&&typeof arguments[Q]=='number')O=arguments[Q];var R=O==2?true:false;for(Q=0;Q<P.length;Q++)if(O==2)R=R&&P[Q](M);else R=R||P[Q](M);if(!R){if(N!==undefined)alert(N);if(S&&(S.select||S.focus))S.select||S.focus();return false;}return true;};},regex:function(M,N){return function(){var P=this;var O=P&&P.getValue?P.getValue():arguments[0];if(!M.test(O)){if(N!==undefined)alert(N);if(P&&(P.select||P.focus))if(P.select)P.select();else P.focus();return false;}return true;};},notEmpty:function(M){return this.regex(J,M);},integer:function(M){return this.regex(K,M);},number:function(M){return this.regex(L,M);},equals:function(M,N){return this.functions(function(O){return O==M;},N);},notEqual:function(M,N){return this.functions(function(O){return O!=M;},N);}};})();a.skins.add=(function(){var J=a.skins.add;return function(K,L){o[K]={margins:L.margins};return J.apply(this,arguments);};})();})();e.extend(a.editor.prototype,{openDialog:function(l){var m=a.dialog._.dialogDefinitions[l];if(typeof m=='function'){var n=this._.storedDialogs||(this._.storedDialogs={}),o=n[l]||(n[l]=new a.dialog(this,l));o.show();return o;}else if(m=='failed')throw new Error('[CKEDITOR.dialog.openDialog] Dialog "'+l+'" failed when loading definition.');var p=a.document.getBody(),q=p.$.style.cursor,r=this;p.setStyle('cursor','wait');a.scriptLoader.load(a.getUrl(m),function(){if(typeof a.dialog._.dialogDefinitions[l]!='function')a.dialog._.dialogDefinitions[l]='failed';r.openDialog(l);p.setStyle('cursor',q);});return null;}});i.dialog_backgroundCoverColor='white';i.dialog_backgroundCoverOpacity=0.5;i.dialog_magnetDistance=20;(function(){var l=function(n,o){return n._.modes&&n._.modes[o||n.mode];},m;j.add('editingblock',{init:function(n){if(!n.config.editingBlock)return;n.on('themeSpace',function(o){if(o.data.space=='contents')o.data.html+='<br>';
- });n.on('themeLoaded',function(){n.fireOnce('editingBlockReady');});n.on('uiReady',function(){n.setMode(n.config.startupMode);});n.on('afterSetData',function(){if(!m){function o(){m=true;l(n).loadData(n.getData());m=false;};if(n.mode)o();else n.on('mode',function(){o();n.removeListener('mode',arguments.callee);});}});n.on('beforeGetData',function(){if(!m&&n.mode){m=true;n.setData(l(n).getData());m=false;}});n.on('getSnapshot',function(o){if(n.mode)o.data=l(n).getSnapshotData();});n.on('loadSnapshot',function(o){if(n.mode)l(n).loadSnapshotData(o.data);});n.on('mode',function(o){o.removeListener();var p=n.container;if(b.webkit&&b.version<528){var q=n.config.tabIndex||n.element.getAttribute('tabindex')||0;p=p.append(h.createFromHtml('<input tabindex="'+q+'"'+' style="position:absolute; left:-10000">'));}p.on('focus',function(){n.focus();});if(n.config.startupFocus)n.focus();setTimeout(function(){n.fireOnce('instanceReady');a.fire('instanceReady',null,n);});});}});a.editor.prototype.mode='';a.editor.prototype.addMode=function(n,o){o.name=n;(this._.modes||(this._.modes={}))[n]=o;};a.editor.prototype.setMode=function(n){var o,p=this.getThemeSpace('contents'),q=this.checkDirty();if(this.mode){if(n==this.mode)return;this.fire('beforeModeUnload');var r=l(this);o=r.getData();r.unload(p);this.mode='';}p.setHtml('');var s=l(this,n);if(!s)throw '[CKEDITOR.editor.setMode] Unknown mode "'+n+'".';if(!q)this.on('mode',function(){this.resetDirty();this.removeListener('mode',arguments.callee);});s.load(p,typeof o!='string'?this.getData():o);};a.editor.prototype.focus=function(){var n=l(this);if(n)n.focus();};})();i.startupMode='wysiwyg';i.startupFocus=false;i.editingBlock=true;j.add('panel',{beforeInit:function(l){l.ui.addHandler(2,k.panel.handler);}});a.UI_PANEL=2;k.panel=function(l,m){var n=this;if(m)e.extend(n,m);e.extend(n,{className:'',css:[]});n.id=e.getNextNumber();n.document=l;n._={blocks:{}};};k.panel.handler={create:function(l){return new k.panel(l);}};k.panel.prototype={renderHtml:function(l){var m=[];this.render(l,m);return m.join('');},render:function(l,m){var o=this;var n='cke_'+o.id;m.push('<div class="',l.skinClass,'" lang="',l.langCode,'" style="display:none;z-index:'+(l.config.baseFloatZIndex+1)+'">'+'<div'+' id=',n,' dir=',l.lang.dir,' class="cke_panel cke_',l.lang.dir);if(o.className)m.push(' ',o.className);m.push('">');if(o.forceIFrame||o.css.length){m.push('<iframe id="',n,'_frame" frameborder="0" src="javascript:void(');m.push(b.isCustomDomain()?"(function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})()':'0');
- m.push(')"></iframe>');}m.push('</div></div>');return n;},getHolderElement:function(){var l=this._.holder;if(!l){if(this.forceIFrame||this.css.length){var m=this.document.getById('cke_'+this.id+'_frame'),n=m.getParent(),o=n.getAttribute('dir'),p=n.getParent().getAttribute('class'),q=n.getParent().getAttribute('lang'),r=m.getFrameDocument();r.$.open();if(b.isCustomDomain())r.$.domain=document.domain;var s=e.addFunction(e.bind(function(u){this.isLoaded=true;if(this.onLoad)this.onLoad();},this));r.$.write('<!DOCTYPE html><html dir="'+o+'" class="'+p+'_container" lang="'+q+'">'+'<head>'+'<style>.'+p+'_container{visibility:hidden}</style>'+'</head>'+'<body class="cke_'+o+' cke_panel_frame '+b.cssClass+'" style="margin:0;padding:0"'+' onload="( window.CKEDITOR || window.parent.CKEDITOR ).tools.callFunction('+s+');">'+'</body>'+'<link type="text/css" rel=stylesheet href="'+this.css.join('"><link type="text/css" rel="stylesheet" href="')+'">'+'</html>');r.$.close();var t=r.getWindow();t.$.CKEDITOR=a;r.on('keydown',function(u){var w=this;var v=u.data.getKeystroke();if(w._.onKeyDown&&w._.onKeyDown(v)===false){u.data.preventDefault();return;}if(v==27)w.onEscape&&w.onEscape();},this);l=r.getBody();}else l=this.document.getById('cke_'+this.id);this._.holder=l;}return l;},addBlock:function(l,m){var n=this;m=n._.blocks[l]=m||new k.panel.block(n.getHolderElement());if(!n._.currentBlock)n.showBlock(l);return m;},getBlock:function(l){return this._.blocks[l];},showBlock:function(l){var p=this;var m=p._.blocks,n=m[l],o=p._.currentBlock;if(o)o.hide();p._.currentBlock=n;n._.focusIndex=-1;p._.onKeyDown=n.onKeyDown&&e.bind(n.onKeyDown,n);n.show();return n;}};k.panel.block=e.createClass({$:function(l){this.element=l.append(l.getDocument().createElement('div',{attributes:{'class':'cke_panel_block'},styles:{display:'none'}}));this.keys={};this._.focusIndex=-1;},_:{},proto:{show:function(){this.element.setStyle('display','');},hide:function(){var l=this;if(!l.onHide||l.onHide.call(l)!==true)l.element.setStyle('display','none');},onKeyDown:function(l){var q=this;var m=q.keys[l];switch(m){case 'next':var n=q._.focusIndex,o=q.element.getElementsByTag('a'),p;while(p=o.getItem(++n))if(p.getAttribute('_cke_focus')&&p.$.offsetWidth){q._.focusIndex=n;p.focus();break;}return false;case 'prev':n=q._.focusIndex;o=q.element.getElementsByTag('a');while(n>0&&(p=o.getItem(--n)))if(p.getAttribute('_cke_focus')&&p.$.offsetWidth){q._.focusIndex=n;p.focus();break;}return false;case 'click':n=q._.focusIndex;
- p=n>=0&&q.element.getElementsByTag('a').getItem(n);if(p)p.$.click?p.$.click():p.$.onclick();return false;}return true;}}});j.add('listblock',{requires:['panel'],onLoad:function(){k.panel.prototype.addListBlock=function(l,m){return this.addBlock(l,new k.listBlock(this.getHolderElement(),m));};k.listBlock=e.createClass({base:k.panel.block,$:function(l,m){var o=this;o.base(l);o.multiSelect=!!m;var n=o.keys;n[40]='next';n[9]='next';n[38]='prev';n[2000+9]='prev';n[32]='click';o._.pendingHtml=[];o._.items={};o._.groups={};},_:{close:function(){if(this._.started){this._.pendingHtml.push('</ul>');delete this._.started;}},getClick:function(){if(!this._.click)this._.click=e.addFunction(function(l){var n=this;var m=true;if(n.multiSelect)m=n.toggle(l);else n.mark(l);if(n.onClick)n.onClick(l,m);},this);return this._.click;}},proto:{add:function(l,m,n){var q=this;var o=q._.pendingHtml,p='cke_'+e.getNextNumber();if(!q._.started){o.push('<ul class=cke_panel_list>');q._.started=1;}q._.items[l]=p;o.push('<li id=',p,' class=cke_panel_listItem><a _cke_focus=1 hidefocus=true title="',n||l,'" href="javascript:void('',l,'')" onclick="CKEDITOR.tools.callFunction(',q._.getClick(),",'",l,"'); return false;">",m||l,'</a></li>');},startGroup:function(l){this._.close();var m='cke_'+e.getNextNumber();this._.groups[l]=m;this._.pendingHtml.push('<h1 id=',m,' class=cke_panel_grouptitle>',l,'</h1>');},commit:function(){var l=this;l._.close();l.element.appendHtml(l._.pendingHtml.join(''));l._.pendingHtml=[];},toggle:function(l){var m=this.isMarked(l);if(m)this.unmark(l);else this.mark(l);return!m;},hideGroup:function(l){var m=this.element.getDocument().getById(this._.groups[l]),n=m&&m.getNext();if(m){m.setStyle('display','none');if(n&&n.getName()=='ul')n.setStyle('display','none');}},hideItem:function(l){this.element.getDocument().getById(this._.items[l]).setStyle('display','none');},showAll:function(){var l=this._.items,m=this._.groups,n=this.element.getDocument();for(var o in l)n.getById(l[o]).setStyle('display','');for(var p in m){var q=n.getById(m[p]),r=q.getNext();q.setStyle('display','');if(r&&r.getName()=='ul')r.setStyle('display','');}},mark:function(l){var m=this;if(!m.multiSelect)m.unmarkAll();m.element.getDocument().getById(m._.items[l]).addClass('cke_selected');},unmark:function(l){this.element.getDocument().getById(this._.items[l]).removeClass('cke_selected');},unmarkAll:function(){var l=this._.items,m=this.element.getDocument();for(var n in l)m.getById(l[n]).removeClass('cke_selected');
- },isMarked:function(l){return this.element.getDocument().getById(this._.items[l]).hasClass('cke_selected');},focus:function(l){this._.focusIndex=-1;if(l){var m=this.element.getDocument().getById(this._.items[l]).getFirst(),n=this.element.getElementsByTag('a'),o,p=-1;while(o=n.getItem(++p))if(o.equals(m)){this._.focusIndex=p;break;}setTimeout(function(){m.focus();},0);}}}});}});j.add('dialogui');(function(){var l=function(s){var v=this;v._||(v._={});v._['default']=v._.initValue=s['default']||'';var t=[v._];for(var u=1;u<arguments.length;u++)t.push(arguments[u]);t.push(true);e.extend.apply(e,t);return v._;},m={build:function(s,t,u){return new k.dialog.textInput(s,t,u);}},n={build:function(s,t,u){return new k.dialog[t.type](s,t,u);}},o={isChanged:function(){return this.getValue()!=this.getInitValue();},reset:function(){this.setValue(this.getInitValue());},setInitValue:function(){this._.initValue=this.getValue();},resetInitValue:function(){this._.initValue=this._['default'];},getInitValue:function(){return this._.initValue;}},p=e.extend({},k.dialog.uiElement.prototype.eventProcessors,{onChange:function(s,t){if(!this._.domOnChangeRegistered){s.on('load',function(){this.getInputElement().on('change',function(){this.fire('change',{value:this.getValue()});},this);},this);this._.domOnChangeRegistered=true;}this.on('change',t);}},true),q=/^on([A-Z]w+)/,r=function(s){for(var t in s)if(q.test(t)||t=='title'||t=='type')delete s[t];return s;};e.extend(k.dialog,{labeledElement:function(s,t,u,v){if(arguments.length<4)return;var w=l.call(this,t);w.labelId=e.getNextNumber()+'_label';var x=this._.children=[],y=function(){var z=[];if(t.labelLayout!='horizontal')z.push('<div class="cke_dialog_ui_labeled_label" id="',w.labelId,'" >',t.label,'</div>','<div class="cke_dialog_ui_labeled_content">',v(s,t),'</div>');else{var A={type:'hbox',widths:t.widths,padding:0,children:[{type:'html',html:'<span class="cke_dialog_ui_labeled_label" id="'+w.labelId+'">'+e.htmlEncode(t.label)+'</span>'},{type:'html',html:'<span class="cke_dialog_ui_labeled_content">'+v(s,t)+'</span>'}]};a.dialog._.uiElementBuilders.hbox.build(s,A,z);}return z.join('');};k.dialog.uiElement.call(this,s,t,u,'div',null,null,y);},textInput:function(s,t,u){if(arguments.length<3)return;l.call(this,t);var v=this._.inputId=e.getNextNumber()+'_textInput',w={'class':'cke_dialog_ui_input_'+t.type,id:v,type:'text'},x;if(t.validate)this.validate=t.validate;if(t.maxLength)w.maxlength=t.maxLength;if(t.size)w.size=t.size;var y=this,z=false;
- s.on('load',function(){y.getInputElement().on('keydown',function(B){if(B.data.getKeystroke()==13)z=true;});y.getInputElement().on('keyup',function(B){if(B.data.getKeystroke()==13&&z){s.getButton('ok')&&s.getButton('ok').click();z=false;}},null,null,1000);});var A=function(){var B=['<div class="cke_dialog_ui_input_',t.type,'"'];if(t.width)B.push('style="width:'+t.width+'" ');B.push('><input ');for(var C in w)B.push(C+'="'+w[C]+'" ');B.push(' /></div>');return B.join('');};k.dialog.labeledElement.call(this,s,t,u,A);},textarea:function(s,t,u){if(arguments.length<3)return;l.call(this,t);var v=this,w=this._.inputId=e.getNextNumber()+'_textarea',x={};if(t.validate)this.validate=t.validate;x.rows=t.rows||5;x.cols=t.cols||20;var y=function(){var z=['<div class="cke_dialog_ui_input_textarea"><textarea class="cke_dialog_ui_input_textarea" id="',w,'" '];for(var A in x)z.push(A+'="'+e.htmlEncode(x[A])+'" ');z.push('>',e.htmlEncode(v._['default']),'</textarea></div>');return z.join('');};k.dialog.labeledElement.call(this,s,t,u,y);},checkbox:function(s,t,u){if(arguments.length<3)return;var v=l.call(this,t,{'default':!!t['default']});if(t.validate)this.validate=t.validate;var w=function(){var x=e.extend({},t,{id:t.id?t.id+'_checkbox':e.getNextNumber()+'_checkbox'},true),y=[],z={'class':'cke_dialog_ui_checkbox_input',type:'checkbox'};r(x);if(t['default'])z.checked='checked';v.checkbox=new k.dialog.uiElement(s,x,y,'input',null,z);y.push(' <label for="',z.id,'">',e.htmlEncode(t.label),'</label>');return y.join('');};k.dialog.uiElement.call(this,s,t,u,'span',null,null,w);},radio:function(s,t,u){if(arguments.length<3)return;l.call(this,t);if(!this._['default'])this._['default']=this._.initValue=t.items[0][1];if(t.validate)this.validate=t.valdiate;var v=[],w=this,x=function(){var y=[],z=[],A={'class':'cke_dialog_ui_radio_item'},B=t.id?t.id+'_radio':e.getNextNumber()+'_radio';for(var C=0;C<t.items.length;C++){var D=t.items[C],E=D[2]!==undefined?D[2]:D[0],F=D[1]!==undefined?D[1]:D[0],G=e.extend({},t,{id:e.getNextNumber()+'_radio_input',title:null,type:null},true),H=e.extend({},G,{id:null,title:E},true),I={type:'radio','class':'cke_dialog_ui_radio_input',name:B,value:F},J=[];if(w._['default']==F)I.checked='checked';r(G);r(H);v.push(new k.dialog.uiElement(s,G,J,'input',null,I));J.push(' ');new k.dialog.uiElement(s,H,J,'label',null,{'for':I.id},D[0]);y.push(J.join(''));}new k.dialog.hbox(s,[],y,z);return z.join('');};k.dialog.labeledElement.call(this,s,t,u,x);this._.children=v;},button:function(s,t,u){if(!arguments.length)return;
- if(typeof t=='function')t=t(s.getParentEditor());l.call(this,t,{disabled:t.disabled||false});a.event.implementOn(this);var v=this;s.on('load',function(x){var y=this.getElement();(function(){y.on('click',function(z){v.fire('click',{dialog:v.getDialog()});z.data.preventDefault();});})();y.unselectable();},this);var w=e.extend({},t);delete w.style;k.dialog.uiElement.call(this,s,w,u,'a',null,{style:t.style,href:'javascript:void(0)',title:t.label,hidefocus:'true','class':t['class']},'<span class="cke_dialog_ui_button">'+e.htmlEncode(t.label)+'</span>');},select:function(s,t,u){if(arguments.length<3)return;var v=l.call(this,t);if(t.validate)this.validate=t.validate;var w=function(){var x=e.extend({},t,{id:t.id?t.id+'_select':e.getNextNumber()+'_select'},true),y=[],z=[],A={'class':'cke_dialog_ui_input_select'};if(t.size!=undefined)A.size=t.size;if(t.multiple!=undefined)A.multiple=t.multiple;r(x);for(var B=0,C;B<t.items.length&&(C=t.items[B]);B++)z.push('<option value="',e.htmlEncode(C[1]!==undefined?C[1]:C[0]),'" /> ',e.htmlEncode(C[0]));v.select=new k.dialog.uiElement(s,x,y,'select',null,A,z.join(''));return y.join('');};k.dialog.labeledElement.call(this,s,t,u,w);},file:function(s,t,u){if(arguments.length<3)return;if(t['default']===undefined)t['default']='';var v=e.extend(l.call(this,t),{definition:t,buttons:[]});if(t.validate)this.validate=t.validate;var w=function(){v.frameId=e.getNextNumber()+'_fileInput';var x=c&&document.domain!=window.location.hostname,y=['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" id="',v.frameId,'" title="',t.label,'" src="javascript:void('];y.push(x?"(function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})()':'0');y.push(')"></iframe>');return y.join('');};s.on('load',function(){var x=a.document.getById(v.frameId),y=x.getParent();y.addClass('cke_dialog_ui_input_file');});k.dialog.labeledElement.call(this,s,t,u,w);},fileButton:function(s,t,u){if(arguments.length<3)return;var v=l.call(this,t),w=this;if(t.validate)this.validate=t.validate;var x=e.extend({},t),y=x.onClick;x.className=(x.className?x.className+' ':'')+('cke_dialog_ui_button');x.onClick=function(z){var A=t['for'];if(!y||y.call(this,z)!==false){s.getContentElement(A[0],A[1]).submit();this.disable();}};s.on('load',function(){s.getContentElement(t['for'][0],t['for'][1])._.buttons.push(w);});k.dialog.button.call(this,s,x,u);},html:(function(){var s=/^s*<[w:]+s+([^>]*)?>/,t=/^(s*<[w:]+(?:s+[^>]*)?)((?:.|r|n)+)$/,u=//$/;
- return function(v,w,x){if(arguments.length<3)return;var y=[],z,A=w.html,B,C;if(A.charAt(0)!='<')A='<span>'+A+'</span>';if(w.focus){var D=this.focus;this.focus=function(){D.call(this);w.focus.call(this);this.fire('focus');};if(w.isFocusable){var E=this.isFocusable;this.isFocusable=E;}this.keyboardFocusable=true;}k.dialog.uiElement.call(this,v,w,y,'span',null,null,'');z=y.join('');B=z.match(s);C=A.match(t)||['','',''];if(u.test(C[1])){C[1]=C[1].slice(0,-1);C[2]='/'+C[2];}x.push([C[1],' ',B[1]||'',C[2]].join(''));};})()},true);k.dialog.html.prototype=new k.dialog.uiElement();k.dialog.labeledElement.prototype=e.extend(new k.dialog.uiElement(),{setLabel:function(s){var t=a.document.getById(this._.labelId);if(t.getChildCount()<1)new d.text(s,a.document).appendTo(t);else t.getChild(0).$.nodeValue=s;return this;},getLabel:function(){var s=a.document.getById(this._.labelId);if(!s||s.getChildCount()<1)return '';else return s.getChild(0).getText();},eventProcessors:p},true);k.dialog.button.prototype=e.extend(new k.dialog.uiElement(),{click:function(){var s=this;if(!s._.disabled)return s.fire('click',{dialog:s._.dialog});s.getElement().$.blur();return false;},enable:function(){this._.disabled=false;var s=this.getElement();s&&s.removeClass('disabled');},disable:function(){this._.disabled=true;this.getElement().addClass('disabled');},isVisible:function(){return!!this.getElement().$.firstChild.offsetHeight;},isEnabled:function(){return!this._.disabled;},eventProcessors:e.extend({},k.dialog.uiElement.prototype.eventProcessors,{onClick:function(s,t){this.on('click',t);}},true),accessKeyUp:function(){this.click();},accessKeyDown:function(){this.focus();},keyboardFocusable:true},true);k.dialog.textInput.prototype=e.extend(new k.dialog.labeledElement(),{getInputElement:function(){return a.document.getById(this._.inputId);},focus:function(){var s=this.selectParentTab();setTimeout(function(){var t=s.getInputElement();t&&t.$.focus();},0);},select:function(){var s=this.selectParentTab();setTimeout(function(){var t=s.getInputElement();if(t){t.$.focus();t.$.select();}},0);},accessKeyUp:function(){this.select();},setValue:function(s){s=s||'';return k.dialog.uiElement.prototype.setValue.call(this,s);},keyboardFocusable:true},o,true);k.dialog.textarea.prototype=new k.dialog.textInput();k.dialog.select.prototype=e.extend(new k.dialog.labeledElement(),{getInputElement:function(){return this._.select.getElement();},add:function(s,t,u){var v=new h('option',this.getDialog().getParentEditor().document),w=this.getInputElement().$;
- v.$.text=s;v.$.value=t===undefined||t===null?s:t;if(u===undefined||u===null){if(c)w.add(v.$);else w.add(v.$,null);}else w.add(v.$,u);return this;},remove:function(s){var t=this.getInputElement().$;t.remove(s);return this;},clear:function(){var s=this.getInputElement().$;while(s.length>0)s.remove(0);return this;},keyboardFocusable:true},o,true);k.dialog.checkbox.prototype=e.extend(new k.dialog.uiElement(),{getInputElement:function(){return this._.checkbox.getElement();},setValue:function(s){this.getInputElement().$.checked=s;this.fire('change',{value:s});},getValue:function(){return this.getInputElement().$.checked;},accessKeyUp:function(){this.setValue(!this.getValue());},eventProcessors:{onChange:function(s,t){if(!c)return p.onChange.apply(this,arguments);else{s.on('load',function(){var u=this._.checkbox.getElement();u.on('propertychange',function(v){v=v.data.$;if(v.propertyName=='checked')this.fire('change',{value:u.$.checked});},this);},this);this.on('change',t);}return null;}},keyboardFocusable:true},o,true);k.dialog.radio.prototype=e.extend(new k.dialog.uiElement(),{setValue:function(s){var t=this._.children,u;for(var v=0;v<t.length&&(u=t[v]);v++)u.getElement().$.checked=u.getValue()==s;this.fire('change',{value:s});},getValue:function(){var s=this._.children;for(var t=0;t<s.length;t++)if(s[t].getElement().$.checked)return s[t].getValue();return null;},accessKeyUp:function(){var s=this._.children,t;for(t=0;t<s.length;t++)if(s[t].getElement().$.checked){s[t].getElement().focus();return;}s[0].getElement().focus();},eventProcessors:{onChange:function(s,t){if(!c)return p.onChange.apply(this,arguments);else{s.on('load',function(){var u=this._.children,v=this;for(var w=0;w<u.length;w++){var x=u[w].getElement();x.on('propertychange',function(y){y=y.data.$;if(y.propertyName=='checked'&&this.$.checked)v.fire('change',{value:this.getAttribute('value')});});}},this);this.on('change',t);}return null;}},keyboardFocusable:true},o,true);k.dialog.file.prototype=e.extend(new k.dialog.labeledElement(),o,{getInputElement:function(){var s=a.document.getById(this._.frameId).getFrameDocument();return s.$.forms.length>0?new h(s.$.forms[0].elements[0]):this.getElement();},submit:function(){this.getInputElement().getParent().$.submit();return this;},getAction:function(s){return this.getInputElement().getParent().$.action;},reset:function(){var s=a.document.getById(this._.frameId),t=s.getFrameDocument(),u=this._.definition,v=this._.buttons;function w(){t.$.open();if(b.isCustomDomain())t.$.domain=document.domain;
- var x='';if(u.size)x=u.size-(c?7:0);t.$.write(['<html><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">','<form enctype="multipart/form-data" method="POST" action="',e.htmlEncode(u.action),'">','<input type="file" name="',e.htmlEncode(u.id||'cke_upload'),'" size="',e.htmlEncode(x>0?x:''),'" />','</form>','</body></html>'].join(''));t.$.close();for(var y=0;y<v.length;y++)v[y].enable();};if(b.gecko)setTimeout(w,500);else w();},getValue:function(){return '';},eventProcessors:p,keyboardFocusable:true},true);k.dialog.fileButton.prototype=new k.dialog.button();a.dialog.addUIElement('text',m);a.dialog.addUIElement('password',m);a.dialog.addUIElement('textarea',n);a.dialog.addUIElement('checkbox',n);a.dialog.addUIElement('radio',n);a.dialog.addUIElement('button',n);a.dialog.addUIElement('select',n);a.dialog.addUIElement('file',n);a.dialog.addUIElement('fileButton',n);a.dialog.addUIElement('html',n);})();a.skins.add('kama',(function(){var l=[];if(c&&b.version<7)l.push('icons.png','images/sprites_ie6.png','images/dialog_sides.gif');return{preload:l,editor:{css:['editor.css']},dialog:{css:['dialog.css']},templates:{css:['templates.css']},margins:[0,0,0,0],init:function(m){if(m.config.width&&!isNaN(m.config.width))m.config.width-=12;var n;function o(q){if(!n)return null;var r=n.append('style'),s='/* UI Color Support */.cke_skin_kama .cke_menuitem .cke_icon_wrapper{tbackground-color: $color !important;tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:active .cke_icon_wrapper{tbackground-color: $color !important;tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover .cke_label,.cke_skin_kama .cke_menuitem a:focus .cke_label,.cke_skin_kama .cke_menuitem a:active .cke_label{tbackground-color: $color !important;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_label{tbackground-color: transparent !important;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_icon_wrapper{tbackground-color: $color !important;tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a.cke_disabled .cke_icon_wrapper{tbackground-color: $color !important;tborder-color: $color !important;}.cke_skin_kama .cke_menuseparator{tbackground-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover,.cke_skin_kama .cke_menuitem a:focus,.cke_skin_kama .cke_menuitem a:active{tbackground-color: $color !important;}';
- r.setAttribute('type','text/css');var t=/$color/g;if(b.webkit){s=s.split('}').slice(0,-1);for(var u in s)s[u]=s[u].split('{');}return(o=function(v){if(b.webkit)for(var w in s)r.$.sheet.addRule(s[w][0],s[w][1].replace(t,v));else{var x=s.replace(t,v);if(c)r.$.styleSheet.cssText=x;else r.setHtml(x);}})(q);};e.extend(m,{uiColor:null,getUiColor:function(){return this.uiColor;},setUiColor:function(q){var r=a.document.getHead().append('style'),s='#cke_'+m.name.replace('.','\.'),t=[s+' .cke_wrapper',s+'_dialog .cke_dialog_contents',s+'_dialog a.cke_dialog_tab',s+'_dialog .cke_dialog_footer'].join(','),u='background-color: $color !important;';r.setAttribute('type','text/css');return(this.setUiColor=function(v){var w=u.replace('$color',v);m.uiColor=v;if(c)r.$.styleSheet.cssText=t+'{'+w+'}';else if(b.webkit)r.$.sheet.addRule(t,w);else r.setHtml(t+'{'+w+'}');o(v);})(q);}});if(a.menu){var p=a.menu.prototype.show;a.menu.prototype.show=function(){p.apply(this,arguments);if(!n&&m==this.editor){n=this._.element.getDocument().getHead();o(m.getUiColor());}};}if(m.config.uiColor)m.setUiColor(m.config.uiColor);}};})());if(a.dialog)a.dialog.on('resize',function(l){var m=l.data,n=m.width,o=m.height,p=m.dialog,q=p.parts.contents,r=!b.quirks;if(m.skin!='kama')return;q.setStyles(c||b.gecko&&b.version<10900?{width:n+'px',height:o+'px'}:{'min-width':n+'px','min-height':o+'px'});if(!c)return;setTimeout(function(){var s=q.getParent(),t=s.getParent(),u=t.getChild(2);u.setStyle('width',s.$.offsetWidth+'px');u=t.getChild(7);u.setStyle('width',s.$.offsetWidth-28+'px');u=t.getChild(4);u.setStyle('height',s.$.offsetHeight-31-14+'px');u=t.getChild(5);u.setStyle('height',s.$.offsetHeight-31-14+'px');},100);});a.themes.add('default',(function(){return{build:function(l,m){var n=l.name,o=l.element,p=l.elementMode;if(!o||p==0)return;if(p==1)o.hide();var q=l.fire('themeSpace',{space:'top',html:''}).html,r=l.fire('themeSpace',{space:'contents',html:''}).html,s=l.fireOnce('themeSpace',{space:'bottom',html:''}).html,t=r&&l.config.height,u=l.config.tabIndex||l.element.getAttribute('tabindex')||0;if(!r)t='auto';else if(!isNaN(t))t+='px';var v='',w=l.config.width;if(w){if(!isNaN(w))w+='px';v+='width: '+w+';';}var x=h.createFromHtml(['<span id="cke_',n,'" onmousedown="return false;" class="',l.skinClass,'" dir="',l.lang.dir,'" title="',b.gecko?' ':'','" lang="',l.langCode,'" tabindex="'+u+'"'+(v?' style="'+v+'"':'')+'>'+'<span class="',b.cssClass,'"><span class="cke_wrapper cke_',l.lang.dir,'"><table class="cke_editor" border="0" cellspacing="0" cellpadding="0"><tbody><tr',q?'':' style="display:none"','><td id="cke_top_',n,'" class="cke_top">',q,'</td></tr><tr',r?'':' style="display:none"','><td id="cke_contents_',n,'" class="cke_contents" style="height:',t,'">',r,'</td></tr><tr',s?'':' style="display:none"','><td id="cke_bottom_',n,'" class="cke_bottom">',s,'</td></tr></tbody></table><style>.',l.skinClass,'{visibility:hidden;}</style></span></span></span>'].join(''));
- x.getChild([0,0,0,0,0]).unselectable();x.getChild([0,0,0,0,2]).unselectable();if(p==1)x.insertAfter(o);else o.append(x);l.container=x;l.fireOnce('themeLoaded');l.fireOnce('uiReady');},buildDialog:function(l){var m=e.getNextNumber(),n=h.createFromHtml(['<div id="cke_'+l.name.replace('.','\.')+'_dialog" class="cke_skin_',l.skinName,'" dir="',l.lang.dir,'" lang="',l.langCode,'"><div class="cke_dialog',' '+b.cssClass,' cke_',l.lang.dir,'" style="position:absolute"><div class="%body"><div id="%title#" class="%title"></div><div id="%close_button#" class="%close_button"><span>X</span></div><div id="%tabs#" class="%tabs"></div><div id="%contents#" class="%contents"></div><div id="%footer#" class="%footer"></div></div><div id="%tl#" class="%tl"></div><div id="%tc#" class="%tc"></div><div id="%tr#" class="%tr"></div><div id="%ml#" class="%ml"></div><div id="%mr#" class="%mr"></div><div id="%bl#" class="%bl"></div><div id="%bc#" class="%bc"></div><div id="%br#" class="%br"></div></div>',c?'':'<style>.cke_dialog{visibility:hidden;}</style>','</div>'].join('').replace(/#/g,'_'+m).replace(/%/g,'cke_dialog_')),o=n.getChild([0,0]);o.getChild(0).unselectable();o.getChild(1).unselectable();return{element:n,parts:{dialog:n.getChild(0),title:o.getChild(0),close:o.getChild(1),tabs:o.getChild(2),contents:o.getChild(3),footer:o.getChild(4)}};},destroy:function(l){var m=l.container;if(c){m.setStyle('display','none');var n=document.body.createTextRange();n.moveToElementText(m.$);try{n.select();}catch(o){}}if(m)m.remove();if(l.elementMode==1){l.element.show();delete l.element;}}};})());a.editor.prototype.getThemeSpace=function(l){var m='cke_'+l,n=this._[m]||(this._[m]=a.document.getById(m+'_'+this.name));return n;};a.editor.prototype.resize=function(l,m,n,o){var p=/^d+$/;if(p.test(l))l+='px';var q=a.document.getById('cke_contents_'+this.name),r=o?q.getAscendant('table').getParent():q.getAscendant('table').getParent().getParent().getParent();b.webkit&&r.setStyle('display','none');r.setStyle('width',l);if(b.webkit){r.$.offsetWidth;r.setStyle('display','');}var s=n?0:(r.$.offsetHeight||0)-(q.$.clientHeight||0);q.setStyle('height',Math.max(m-s,0)+'px');this.fire('resize');};a.editor.prototype.getResizable=function(){return this.container.getChild([0,0]);};})();