CKEDITOR.dialog.add("specialchar",function(o){var q,c=o.lang.specialchar,f=function(e){var d,e=e.data?e.data.getTarget():new CKEDITOR.dom.element(e);if("a"==e.getName()&&(d=e.getChild(0).getHtml())){e.removeClass("cke_light_background"),q.hide(),e=o.document.createElement("span"),e.setHtml(d),o.insertText(e.getText());}},b=CKEDITOR.tools.addFunction(f),h,p=function(i,d){var e,d=d||i.data.getTarget();"span"==d.getName()&&(d=d.getParent());if("a"==d.getName()&&(e=d.getChild(0).getHtml())){h&&r(null,h);var g=q.getContentElement("info","htmlPreview").getElement();q.getContentElement("info","charPreview").getElement().setHtml(e);g.setHtml(CKEDITOR.tools.htmlEncode(e));d.getParent().addClass("cke_light_background");h=d;}},r=function(e,d){d=d||e.data.getTarget();"span"==d.getName()&&(d=d.getParent());"a"==d.getName()&&(q.getContentElement("info","charPreview").getElement().setHtml("&nbsp;"),q.getContentElement("info","htmlPreview").getElement().setHtml("&nbsp;"),d.getParent().removeClass("cke_light_background"),h=void 0);},a=CKEDITOR.tools.addFunction(function(i){var i=new CKEDITOR.dom.event(i),d=i.getTarget(),e;e=i.getKeystroke();var g="rtl"==o.lang.dir;switch(e){case 38:if(e=d.getParent().getParent().getPrevious()){e=e.getChild([d.getParent().getIndex(),0]),e.focus(),r(null,d),p(null,e);}i.preventDefault();break;case 40:if(e=d.getParent().getParent().getNext()){if((e=e.getChild([d.getParent().getIndex(),0]))&&1==e.type){e.focus(),r(null,d),p(null,e);}}i.preventDefault();break;case 32:f({data:i});i.preventDefault();break;case g?37:39:if(e=d.getParent().getNext()){e=e.getChild(0),1==e.type?(e.focus(),r(null,d),p(null,e),i.preventDefault(!0)):r(null,d);}else{if(e=d.getParent().getParent().getNext()){(e=e.getChild([0,0]))&&1==e.type?(e.focus(),r(null,d),p(null,e),i.preventDefault(!0)):r(null,d);}}break;case g?39:37:(e=d.getParent().getPrevious())?(e=e.getChild(0),e.focus(),r(null,d),p(null,e),i.preventDefault(!0)):(e=d.getParent().getParent().getPrevious())?(e=e.getLast().getChild(0),e.focus(),r(null,d),p(null,e),i.preventDefault(!0)):r(null,d);}});return{title:c.title,minWidth:430,minHeight:280,buttons:[CKEDITOR.dialog.cancelButton],charColumns:17,onLoad:function(){for(var v=this.definition.charColumns,w=o.config.specialChars,x=CKEDITOR.tools.getNextId()+"_specialchar_table_label",s=['<table role="listbox" aria-labelledby="'+x+'" style="width: 320px; height: 100%; border-collapse: separate;" align="center" cellspacing="2" cellpadding="2" border="0">'],u=0,n=w.length,m,t;u<n;){s.push('<tr role="presentation">');for(var l=0;l<v;l++,u++){if(m=w[u]){m instanceof Array?(t=m[1],m=m[0]):(t=m.replace("&","").replace(";","").replace("#",""),t=c[t]||m);var i="cke_specialchar_label_"+u+"_"+CKEDITOR.tools.getNextNumber();s.push('<td class="cke_dark_background" style="cursor: default" role="presentation"><a href="javascript: void(0);" role="option" aria-posinset="'+(u+1)+'"',' aria-setsize="'+n+'"',' aria-labelledby="'+i+'"',' class="cke_specialchar" title="',CKEDITOR.tools.htmlEncode(t),'" onkeydown="CKEDITOR.tools.callFunction( '+a+', event, this )" onclick="CKEDITOR.tools.callFunction('+b+', this); return false;" tabindex="-1"><span style="margin: 0 auto;cursor: inherit">'+m+'</span><span class="cke_voice_label" id="'+i+'">'+t+"</span></a>");}else{s.push('<td class="cke_dark_background">&nbsp;');}s.push("</td>");}s.push("</tr>");}s.push("</tbody></table>",'<span id="'+x+'" class="cke_voice_label">'+c.options+"</span>");this.getContentElement("info","charContainer").getElement().setHtml(s.join(""));},contents:[{id:"info",label:o.lang.common.generalTab,title:o.lang.common.generalTab,padding:0,align:"top",elements:[{type:"hbox",align:"top",widths:["320px","90px"],children:[{type:"html",id:"charContainer",html:"",onMouseover:p,onMouseout:r,focus:function(){var d=this.getElement().getElementsByTag("a").getItem(0);setTimeout(function(){d.focus();p(null,d);},0);},onShow:function(){var d=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){d.focus();p(null,d);},0);},onLoad:function(d){q=d.sender;}},{type:"hbox",align:"top",widths:["100%"],children:[{type:"vbox",align:"top",children:[{type:"html",html:"<div></div>"},{type:"html",id:"charPreview",className:"cke_dark_background",style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:"<div>&nbsp;</div>"},{type:"html",id:"htmlPreview",className:"cke_dark_background",style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:"<div>&nbsp;</div>"}]}]}]}]}]};});