X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=plugins%2Fcolordialog%2Fdialogs%2Fcolordialog.js;h=e5e04e590ad7cc00c550fe90756564e7fa4d5365;hp=a82192b6e9cf9053d69edf6b554c6a38bf85f237;hb=614511639979907ceb0da3614122a4d8eb963ad4;hpb=039a051ccf3901311661022a30afd60fc38130c9 diff --git a/plugins/colordialog/dialogs/colordialog.js b/plugins/colordialog/dialogs/colordialog.js index a82192b..e5e04e5 100644 --- a/plugins/colordialog/dialogs/colordialog.js +++ b/plugins/colordialog/dialogs/colordialog.js @@ -3,5 +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,g={type:'html',html:' '};function h(){c.getById(w).removeStyle('background-color');f.getContentElement('picker','selectedColor').setValue('');};function i(y){if(!(y instanceof CKEDITOR.dom.event))y=new CKEDITOR.dom.event(y);var z=y.getTarget(),A;if(z.getName()=='a'&&(A=z.getChild(0).getHtml()))f.getContentElement('picker','selectedColor').setValue(A);};function j(y){if(!(y instanceof CKEDITOR.dom.event))y=y.data;var z=y.getTarget(),A;if(z.getName()=='a'&&(A=z.getChild(0).getHtml())){c.getById(u).setStyle('background-color',A);c.getById(v).setHtml(A);}};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(y){y=new CKEDITOR.dom.event(y);var z=y.getTarget(),A,B,C=y.getKeystroke(),D=a.lang.dir=='rtl';switch(C){case 38:if(A=z.getParent().getParent().getPrevious()){B=A.getChild([z.getParent().getIndex(),0]);B.focus();p(y,z);o(y,B);}y.preventDefault();break;case 40:if(A=z.getParent().getParent().getNext()){B=A.getChild([z.getParent().getIndex(),0]);if(B&&B.type==1){B.focus();p(y,z);o(y,B);}}y.preventDefault();break;case 32:m(y);y.preventDefault();break;case D?37:39:if(A=z.getParent().getNext()){B=A.getChild(0);if(B.type==1){B.focus();p(y,z);o(y,B);y.preventDefault(true);}else p(null,z);}else if(A=z.getParent().getParent().getNext()){B=A.getChild([0,0]);if(B&&B.type==1){B.focus();p(y,z);o(y,B);y.preventDefault(true);}else p(null,z);}break;case D?39:37:if(A=z.getParent().getPrevious()){B=A.getChild(0);B.focus();p(y,z);o(y,B);y.preventDefault(true);}else if(A=z.getParent().getParent().getPrevious()){B=A.getLast().getChild(0);B.focus();p(y,z);o(y,B);y.preventDefault(true);}else p(null,z);break;default:return;}});function r(){var y=['00','33','66','99','cc','ff'];function z(E,F){for(var G=E;G'+F+' ',CKEDITOR.document)); -};z(0,0);z(3,0);z(0,3);z(3,3);var B=s.$.insertRow(-1);for(var C=0;C<6;C++)A(B,'#'+y[C]+y[C]+y[C]);for(var D=0;D<12;D++)A(B,'#000000');};var s=new b('table');r();var t=function(y){return CKEDITOR.tools.getNextId()+'_'+y;},u=t('hicolor'),v=t('hicolortext'),w=t('selhicolor'),x=t('color_table_label');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 y=CKEDITOR.document.getById(this.domId);y.on('mouseover',j);},focus:function(){var y=this.getElement().getElementsByTag('a').getItem(0);y.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(y){h();}}},g,{type:'button',id:'clear',style:'margin-top: 5px',label:e.clear,onClick:h}]}]}]}]};}); +CKEDITOR.dialog.add('colordialog',function(a){var b=CKEDITOR.dom.element,c=CKEDITOR.document,d=CKEDITOR.tools,e=a.lang.colordialog,f,g={type:'html',html:' '};function h(){c.getById(x).removeStyle('background-color');f.getContentElement('picker','selectedColor').setValue('');};function i(z){if(!(z instanceof CKEDITOR.dom.event))z=new CKEDITOR.dom.event(z);var A=z.getTarget(),B;if(A.getName()=='a'&&(B=A.getChild(0).getHtml()))f.getContentElement('picker','selectedColor').setValue(B);};function j(z){if(!(z instanceof CKEDITOR.dom.event))z=z.data;var A=z.getTarget(),B;if(A.getName()=='a'&&(B=A.getChild(0).getHtml())){c.getById(v).setStyle('background-color',B);c.getById(w).setHtml(B);}};function k(){c.getById(v).removeStyle('background-color');c.getById(w).setHtml(' ');};var l=d.addFunction(k),m=i,n=CKEDITOR.tools.addFunction(m),o=j,p=k,q=CKEDITOR.tools.addFunction(function(z){z=new CKEDITOR.dom.event(z);var A=z.getTarget(),B,C,D=z.getKeystroke(),E=a.lang.dir=='rtl';switch(D){case 38:if(B=A.getParent().getParent().getPrevious()){C=B.getChild([A.getParent().getIndex(),0]);C.focus();p(z,A);o(z,C);}z.preventDefault();break;case 40:if(B=A.getParent().getParent().getNext()){C=B.getChild([A.getParent().getIndex(),0]);if(C&&C.type==1){C.focus();p(z,A);o(z,C);}}z.preventDefault();break;case 32:m(z);z.preventDefault();break;case E?37:39:if(B=A.getParent().getNext()){C=B.getChild(0);if(C.type==1){C.focus();p(z,A);o(z,C);z.preventDefault(true);}else p(null,A);}else if(B=A.getParent().getParent().getNext()){C=B.getChild([0,0]);if(C&&C.type==1){C.focus();p(z,A);o(z,C);z.preventDefault(true);}else p(null,A);}break;case E?39:37:if(B=A.getParent().getPrevious()){C=B.getChild(0);C.focus();p(z,A);o(z,C);z.preventDefault(true);}else if(B=A.getParent().getParent().getPrevious()){C=B.getLast().getChild(0);C.focus();p(z,A);o(z,C);z.preventDefault(true);}else p(null,A);break;default:return;}});function r(){var z=['00','33','66','99','cc','ff'];function A(F,G){for(var H=F;H'+G+' ',CKEDITOR.document)); +};A(0,0);A(3,0);A(0,3);A(3,3);var C=s.$.insertRow(-1);for(var D=0;D<6;D++)B(C,'#'+z[D]+z[D]+z[D]);for(var E=0;E<12;E++)B(C,'#000000');};var s=new b('table');r();var t=s.getHtml(),u=function(z){return CKEDITOR.tools.getNextId()+'_'+z;},v=u('hicolor'),w=u('hicolortext'),x=u('selhicolor'),y=u('color_table_label');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:''+(!CKEDITOR.env.webkit?t:'')+'
'+e.options+'',onLoad:function(){var z=CKEDITOR.document.getById(this.domId);z.on('mouseover',j);CKEDITOR.env.webkit&&z.setHtml(t);},focus:function(){var z=this.getElement().getElementsByTag('a').getItem(0);z.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(x).setStyle('background-color',this.getValue());}catch(z){h();}}},g,{type:'button',id:'clear',style:'margin-top: 5px',label:e.clear,onClick:h}]}]}]}]};});