X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=plugins%2Fcolordialog%2Fdialogs%2Fcolordialog.js;h=ce203786d64ca6f2251a472300b2d04c82f30e11;hp=0600b5d1bfcf0dc92d8c87abf5a1ec84f66a0345;hb=f8fc585c18d287eb325c575596d183122486b641;hpb=8665a7c6c60586526e32e8941fe2896739b6ebfb diff --git a/plugins/colordialog/dialogs/colordialog.js b/plugins/colordialog/dialogs/colordialog.js index 0600b5d..ce20378 100644 --- a/plugins/colordialog/dialogs/colordialog.js +++ b/plugins/colordialog/dialogs/colordialog.js @@ -3,4 +3,5 @@ Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ -CKEDITOR.dialog.add('colordialog',function(a){var b=CKEDITOR.dom.element,c=CKEDITOR.document,d=CKEDITOR.tools,e=a.lang.colordialog,f;function g(){return{type:'html',html:' '};};var h=new b('table');k();var i=function(r){var s=new b(r.data.getTarget()).getAttribute('title');c.getById(o).setStyle('background-color',s);c.getById(p).setHtml(s);},j=function(r){var s=new b(r.data.getTarget()).getAttribute('title');f.getContentElement('picker','selectedColor').setValue(s);};function k(){var r=['00','33','66','99','cc','ff'];function s(x,y){for(var z=x;z'+h.getHtml()+'',onLoad:function(){var r=CKEDITOR.document.getById(this.domId);r.on('mouseover',i);r.on('click',j);}},g(),{type:'vbox',padding:0,widths:['70%','5%','25%'],children:[{type:'html',html:''+e.highlight+'\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t
 
\t\t\t\t\t\t\t\t\t\t\t\t'+e.selected+'\t\t\t\t\t\t\t\t\t\t\t\t
'},{type:'text',id:'selectedColor',style:'width: 74px',onChange:function(){try{c.getById(q).setStyle('background-color',this.getValue());}catch(r){l();}}},g(),{type:'button',id:'clear',style:'margin-top: 5px',label:e.clear,onClick:l}]}]}]}]};}); +CKEDITOR.dialog.add('colordialog',function(a){var b=CKEDITOR.dom.element,c=CKEDITOR.document,d=CKEDITOR.tools,e=a.lang.colordialog,f;function g(){return{type:'html',html:' '};};function h(){c.getById(w).removeStyle('background-color');f.getContentElement('picker','selectedColor').setValue('');};function i(x){if(!(x instanceof CKEDITOR.dom.event))x=new CKEDITOR.dom.event(x);var y=x.getTarget(),z;if(y.getName()=='a'&&(z=y.getChild(0).getHtml()))f.getContentElement('picker','selectedColor').setValue(z);};function j(x){if(!(x instanceof CKEDITOR.dom.event))x=x.data;var y=x.getTarget(),z;if(y.getName()=='a'&&(z=y.getChild(0).getHtml())){c.getById(u).setStyle('background-color',z);c.getById(v).setHtml(z);}};function k(){c.getById(u).removeStyle('background-color');c.getById(v).setHtml(' ');};var l=d.addFunction(k),m=i,n=CKEDITOR.tools.addFunction(m),o=j,p=k,q=CKEDITOR.tools.addFunction(function(x){x=new CKEDITOR.dom.event(x);var y=x.getTarget(),z,A,B=x.getKeystroke(),C=a.lang.dir=='rtl';switch(B){case 38:if(z=y.getParent().getParent().getPrevious()){A=z.getChild([y.getParent().getIndex(),0]);A.focus();p(x,y);o(x,A);}x.preventDefault();break;case 40:if(z=y.getParent().getParent().getNext()){A=z.getChild([y.getParent().getIndex(),0]);if(A&&A.type==1){A.focus();p(x,y);o(x,A);}}x.preventDefault();break;case 32:m(x);x.preventDefault();break;case C?37:39:if(z=y.getParent().getNext()){A=z.getChild(0);if(A.type==1){A.focus();p(x,y);o(x,A);x.preventDefault(true);}else p(null,y);}else if(z=y.getParent().getParent().getNext()){A=z.getChild([0,0]);if(A&&A.type==1){A.focus();p(x,y);o(x,A);x.preventDefault(true);}else p(null,y);}break;case C?39:37:if(z=y.getParent().getPrevious()){A=z.getChild(0);A.focus();p(x,y);o(x,A);x.preventDefault(true);}else if(z=y.getParent().getParent().getPrevious()){A=z.getLast().getChild(0);A.focus();p(x,y);o(x,A);x.preventDefault(true);}else p(null,y);break;default:return;}});function r(){var x=['00','33','66','99','cc','ff'];function y(D,E){for(var F=D;F'+E+'',CKEDITOR.document)); +};y(0,0);y(3,0);y(0,3);y(3,3);var A=s.$.insertRow(-1);for(var B=0;B<6;B++)z(A,'#'+x[B]+x[B]+x[B]);for(var C=0;C<12;C++)z(A,'#000000');};var s=new b('table');r();var t=function(x){return x+CKEDITOR.tools.getNextNumber();},u=t('hicolor'),v=t('hicolortext'),w=t('selhicolor');return{title:e.title,minWidth:360,minHeight:220,onLoad:function(){f=this;},contents:[{id:'picker',label:e.title,accessKey:'I',elements:[{type:'hbox',padding:0,widths:['70%','10%','30%'],children:[{type:'html',html:''+s.getHtml()+'
'+''+e.options+'',onLoad:function(){var x=CKEDITOR.document.getById(this.domId);x.on('mouseover',j);},focus:function(){var x=this.getElement().getElementsByTag('a').getItem(0);x.focus();}},g(),{type:'vbox',padding:0,widths:['70%','5%','25%'],children:[{type:'html',html:''+e.highlight+'\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t
 
'+e.selected+'\t\t\t\t\t\t\t\t\t\t\t\t
'},{type:'text',label:e.selected,labelStyle:'display:none',id:'selectedColor',style:'width: 74px',onChange:function(){try{c.getById(w).setStyle('background-color',this.getValue());}catch(x){h();}}},g(),{type:'button',id:'clear',style:'margin-top: 5px',label:e.clear,onClick:h}]}]}]}]};});