X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=plugins%2Fspecialchar%2Fdialogs%2Fspecialchar.js;h=77c0553521ab462684795a52cc5bee54b8f1f437;hp=c54487565cc994e2f5df36d015cfc61005a73903;hb=c6e377a02b54abc07129d72b632763c727476a15;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6 diff --git a/plugins/specialchar/dialogs/specialchar.js b/plugins/specialchar/dialogs/specialchar.js index c544875..77c0553 100644 --- a/plugins/specialchar/dialogs/specialchar.js +++ b/plugins/specialchar/dialogs/specialchar.js @@ -4,4 +4,4 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('specialchar',function(a){var b,c=function(i){var j,k;if(i.data)j=i.data.getTarget();else j=new CKEDITOR.dom.element(i);if(j.getName()=='a'&&(k=j.getChild(0).getHtml())){j.removeClass('cke_light_background');b.hide();a.insertHtml(k);}},d=CKEDITOR.tools.addFunction(c),e,f=function(i,j){var k;j=j||i.data.getTarget();if(j.getName()=='span')j=j.getParent();if(j.getName()=='a'&&(k=j.getChild(0).getHtml())){if(e)g(null,e);var l=b.getContentElement('info','htmlPreview').getElement();b.getContentElement('info','charPreview').getElement().setHtml(k);l.setHtml(CKEDITOR.tools.htmlEncode(k));j.getParent().addClass('cke_light_background');e=j;}},g=function(i,j){j=j||i.data.getTarget();if(j.getName()=='span')j=j.getParent();if(j.getName()=='a'){b.getContentElement('info','charPreview').getElement().setHtml(' ');b.getContentElement('info','htmlPreview').getElement().setHtml(' ');j.getParent().removeClass('cke_light_background');e=undefined;}},h=CKEDITOR.tools.addFunction(function(i){i=new CKEDITOR.dom.event(i);var j=i.getTarget(),k,l,m=i.getKeystroke();switch(m){case 39:if(k=j.getParent().getNext()){l=k.getChild(0);if(l.type==1){l.focus();g(null,j);f(null,l);}}i.preventDefault();break;case 37:if(k=j.getParent().getPrevious()){l=k.getChild(0);l.focus();g(null,j);f(null,l);}i.preventDefault();break;case 38:if(k=j.getParent().getParent().getPrevious()){l=k.getChild([j.getParent().getIndex(),0]);l.focus();g(null,j);f(null,l);}i.preventDefault();break;case 40:if(k=j.getParent().getParent().getNext()){l=k.getChild([j.getParent().getIndex(),0]);if(l&&l.type==1){l.focus();g(null,j);f(null,l);}}i.preventDefault();break;case 32:c({data:i});i.preventDefault();break;case 9:if(k=j.getParent().getNext()){l=k.getChild(0);if(l.type==1){l.focus();g(null,j);f(null,l);i.preventDefault(true);}else g(null,j);}else if(k=j.getParent().getParent().getNext()){l=k.getChild([0,0]);if(l&&l.type==1){l.focus();g(null,j);f(null,l);i.preventDefault(true);}else g(null,j);}break;case CKEDITOR.SHIFT+9:if(k=j.getParent().getPrevious()){l=k.getChild(0);l.focus();g(null,j);f(null,l);i.preventDefault(true);}else if(k=j.getParent().getParent().getPrevious()){l=k.getLast().getChild(0);l.focus();g(null,j);f(null,l);i.preventDefault(true);}else g(null,j);break;default:return;}});return{title:a.lang.specialChar.title,minWidth:430,minHeight:280,buttons:[CKEDITOR.dialog.cancelButton],charColumns:17,chars:['!','"','#','$','%','&',"'",'(',')','*','+','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[',']','^','_','`','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','{','|','}','~','€','‘','’','’','“','”','–','—','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','®','¯','°','±','²','³','´','µ','¶','·','¸','¹','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ü','ý','þ','ÿ','Œ','œ','Ŵ','Ŷ','ŵ','ŷ','‚','‛','„','…','™','►','•','→','⇒','⇔','♦','≈'],onLoad:function(){var i=this.definition.charColumns,j=this.definition.chars,k=[''],l=0; -while(l');for(var m=0;m'+''+j[l]+'');else k.push('');}k.push('');}k.push('
 ');k.push('
');this.getContentElement('info','charContainer').getElement().setHtml(k.join(''));},contents:[{id:'info',label:a.lang.common.generalTab,title:a.lang.common.generalTab,padding:0,align:'top',elements:[{type:'hbox',align:'top',widths:['320px','90px'],children:[{type:'html',id:'charContainer',html:'',onMouseover:f,onMouseout:g,focus:function(){var i=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){i.focus();f(null,i);});},onShow:function(){var i=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){i.focus();f(null,i);});},onLoad:function(i){b=i.sender;}},{type:'hbox',align:'top',widths:['100%'],children:[{type:'vbox',align:'top',children:[{type:'html',html:'
'},{type:'html',id:'charPreview',style:"border:1px solid #eeeeee;background-color:#EAEAD1;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'
 
'},{type:'html',id:'htmlPreview',style:"border:1px solid #eeeeee;background-color:#EAEAD1;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'
 
'}]}]}]}]}]};}); +while(l');for(var m=0;m'+''+j[l]+'');else k.push(' ');k.push('');}k.push('');}k.push('');this.getContentElement('info','charContainer').getElement().setHtml(k.join(''));},contents:[{id:'info',label:a.lang.common.generalTab,title:a.lang.common.generalTab,padding:0,align:'top',elements:[{type:'hbox',align:'top',widths:['320px','90px'],children:[{type:'html',id:'charContainer',html:'',onMouseover:f,onMouseout:g,focus:function(){var i=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){i.focus();f(null,i);});},onShow:function(){var i=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){i.focus();f(null,i);});},onLoad:function(i){b=i.sender;}},{type:'hbox',align:'top',widths:['100%'],children:[{type:'vbox',align:'top',children:[{type:'html',html:'
'},{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:'
 
'},{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:'
 
'}]}]}]}]}]};});