From a485b535957ff47639efe5c088f2f1dfee714f78 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 2 Jul 2009 17:19:51 +0000 Subject: [PATCH] move opacity control to jPicker git-svn-id: http://svg-edit.googlecode.com/svn/trunk@254 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/jpicker/images/bar-opacity.png | Bin 0 -> 1849 bytes editor/jpicker/images/map-opacity.png | Bin 0 -> 139 bytes editor/jpicker/images/rangearrows2.gif | Bin 0 -> 93 bytes editor/jpicker/jpicker.css | 47 +++++++++++----- editor/jpicker/jpicker.js | 2 +- editor/svg-editor.html | 30 +---------- editor/svg-editor.js | 72 +++++++++++++++++-------- 7 files changed, 85 insertions(+), 66 deletions(-) create mode 100644 editor/jpicker/images/bar-opacity.png create mode 100644 editor/jpicker/images/map-opacity.png create mode 100644 editor/jpicker/images/rangearrows2.gif diff --git a/editor/jpicker/images/bar-opacity.png b/editor/jpicker/images/bar-opacity.png new file mode 100644 index 0000000000000000000000000000000000000000..1470bfd1f8ab1a2bc7e82a10e4e8d9c869e52d30 GIT binary patch literal 1849 zcmV-92gdk`P)uz+DFm9lF#ek>&GVjjC=dx zd%^q;@88GI=05`Yy7|xT=H?%Lf3^=>wBM|KIQ`Sj&)oc($oE*EOuxJGUDkfHy$92x zR}ZImP3!~rE|WG@Ml}5pe2am+OvZzI2SHy5^R9FleG5sue-}<>1btcP$m@rRY%FBx z)+d?|7HlxHM>anzJ$L;oeP-*iYR6ps{ql3Wz$ka#&787x6fOoQOh$`jJnz^j7SReP zsEmWn9M}Xim} zJ2R5(Ov#!myP#lq)q1UFKr6DGeSVDxk_Qa;*O=rardQe{%>2Y@MSlz0BTVfvcZ8Wc zPQ+v42y>5SezW}Z{AR}*3FnZtNBYS)9ZN9vNZKi4`jK!FzI{yVV~#V(>?6{TC7eUW zNl=ilvfpU@m-ydpBb|V~@98oEY{;D9e2P1Iv=b>96apuLLN+BGM8l;-nNGG_vw=jB z4iN0tw zVErj>6c7nv3goR~k65s^S7hC&=J4;1d7jT5^E{vL_JiRB?OA`^F-O%O4l{P`aG2B@ z`5%}V6Q=a?(X}(^AC1queC9B#IZnm*hvN(mjuFU@`}n>c$^76j{UHs$W8&wS6X$>l zGsAt~CQRz*KV#Zx{YId_$M@%R@@)OhaR!F~638Ff2PRIyMEzsJ^x6FB+8^JC<1}o; ze|&pnAJzB_#)r3WB?CB{daPom9fo%0_z2C8oH6AYzGVV!lp`}1JDpE&*_>V=kSROE zXOTKXfLL8>tenQ6!S!6-%@SQ?X?~S%S1CRPJy1LeuowE4k~QER5I|J`PAZ}!RUkl# z%F(KHGQ+G2Zie;6NZFjLZ!ig%NH~H{Hyt@w&B>DVS|J%bvM&nKJYiEEZ=SO{D^ zA>(O6{&u00E6nB`e^RanW^6+gX-`TwnGen0m9bNnZ6o-oO z_ZRB~D*5OBX1{Ce&(s;P(C=)p{v152ZTIK=BU!&$Kjy|CPCqlI_UHJ~IXaX6(fE=4 z)%YytZwvN6g7vox{Od5^Ek%&N(X@K=jO1g(GqAzDU0O+ti*X{duRC63Lxfr4d|42vjzN`TE5B|K)9%hL zlt8}Y164s7FYu@CUA`j#tn6M_6NwavG_&=aWjhhMDi)%^JZA>ky%+7IU2%|!q@PL( zvLR4ea0bdQ&xSYXZeUj2i3vKZ)<>xgP_oji2*Dk~{rUV`IESHwnl`JD9d zesa#~&xxZt04D8O9ReoIXcMMAELKxTFp}@j`hml&2Lmb2aWQcM2=pJ-S@_z2I{l8M zj=^&RbDhA!iKjY&?3_8${{yGO$)}!US9Kf*2MhXho{zI%H0Sib&cN3psOR`FtxjUK z&c%v46RH1|9Kg!Ge}1*%UwHVKz(1$>|B5)7j`^u&Pnwz>oj`>(>aS jpPwhotNJUGfy02oX)8y=1{2rcK#dHZu6{1-oD!M<2x%(! literal 0 HcmV?d00001 diff --git a/editor/jpicker/images/rangearrows2.gif b/editor/jpicker/images/rangearrows2.gif new file mode 100644 index 0000000000000000000000000000000000000000..fdeb54a104447e77b99b7c42b199ad0d85a970a4 GIT binary patch literal 93 zcmZ?wbhEHb&^6s2AQ_8e46`C?&-1$jD#~0B3n3t){q=t;}}if(z<0){z=0;}else{if(z>r){z=r;}}v=Math.floor(q/t*m.mxX);s=Math.floor(z/r*m.mxY);m.x=v;m.y=s;if(m.mxX==m.mnX){q=0;}if(m.mxY==m.mnY){z=0;}m.setArrowPosition(q,z);d.isFunction(m.valuesChanged)&&m.valuesChanged(m);};d.extend(true,m,{settings:p,x:0,y:0,mnX:0,mxX:0,mnY:100,mxY:100,valuesChanged:d.isFunction(arguments[2])&&arguments[2]||null,setPositioningVariables:function(r){var q=m.settings.map;k.w=q&&q.width||k.width();k.h=q&&q.height||k.height();m.MinX=0;m.MinY=0;m.MaxX=k.w;m.MaxY=k.h;},setArrowPositionFromValues:function(t){m.setPositioningVariables();var w=0,v=0,u=m.mnX,r=m.mxX,s=m.mnY,q=m.mxY,A=m.x,z=m.y;if(u!=r){if(A==u){w=0;}else{if(A==r){w=k.w;}else{if(u<1){r+=Math.abs(u)+1;}if(A<1){A+=1;}w=A/r*k.w;if(parseInt(w)==(r-1)){w=r;}else{w=parseInt(w);}if(u<1){w-=Math.abs(u)-1;}}}}if(s!=q){if(z==s){v=0;}else{if(z==q){v=k.h;}else{if(s<1){q+=Math.abs(s)+1;}if(z<1){z+=1;}v=z/q*k.h;if(parseInt(v)==(q-1)){v=q;}else{v=parseInt(v);}if(s<1){v-=Math.abs(s)-1;}}}}m.setArrowPosition(w,v);},setArrowPosition:function(q,v){var u=k.w,s=k.h,t=o.w,r=o.h;if(q<0){q=0;}else{if(q>u){q=u;}}if(v<0){v=0;}else{if(v>s){v=s;}}if(t>u){q=(u>>1)-(t>>1);}else{q-=t>>1;}if(r>s){v=(s>>1)-(r>>1);}else{v-=r>>1;}o.css({left:q+"px",top:v+"px"});},destroy:function(){d(document).unbind("mouseup",l).unbind("mousemove",h);k.unbind("mousedown",n);k=null;o=null;m.valuesChanged=null;}});o.src=m.settings.arrow&&m.settings.arrow.image;o.w=m.settings.arrow&&m.settings.arrow.width||o.width();o.h=m.settings.arrow&&m.settings.arrow.height||o.height();m.setPositioningVariables();k.bind("mousedown",n);m.setArrowPositionFromValues();d.isFunction(m.valuesChanged)&&m.valuesChanged(m);},a=function(h){var r=this,u=function(w){if(w.target.value==""){return;}v(w);r.setValuesFromHsv();d.isFunction(r.valuesChanged)&&r.valuesChanged(r);},n=function(w){if(w.target.value==""){return;}j(w);r.setValuesFromRgb();d.isFunction(r.valuesChanged)&&r.valuesChanged(r);},g=function(w){if(w.target.value==""){r.setValuesFromRgb();}},p=function(w){if(w.target.value==""){r.setValuesFromHsv();}},t=function(w){if(w.target.value==""){return;}s(w);r.setValuesFromHex();d.isFunction(r.valuesChanged)&&r.valuesChanged(r);},q=function(w){if(w.target.value==""){r.setValuesFromHsv();}},j=function(w){if(!l(w)){return w;}o.red.val(m(o.red.val(),0,255));o.green.val(m(o.green.val(),0,255));o.blue.val(m(o.blue.val(),0,255));},v=function(w){if(!l(w)){return w;}o.hue.val(m(o.hue.val(),0,360));o.saturation.val(m(o.saturation.val(),0,100));o.value.val(m(o.value.val(),0,100));},s=function(w){if(!l(w)){return w;}o.hex.val(o.hex.val().replace(/[^a-fA-F0-9]/g,"0").toLowerCase().substring(0,6));},l=function(w){switch(w.keyCode){case 9:case 16:case 29:case 37:case 38:case 40:return false;case"c".charCodeAt():case"v".charCodeAt():if(w.ctrlKey){return false;}}return true;},m=function(y,x,w){if(y==""||isNaN(y)){return x;}y=parseInt(y);if(y>w){return w;}if(y4){k=l.substring(4,l.length);l=l.substring(0,4);}if(l.length>2){j=l.substring(2,l.length);l=l.substring(0,2);}if(l.length>0){h=l.substring(0,l.length);}}return{r:this.hexToInt(k),g:this.hexToInt(j),b:this.hexToInt(h)};},validateHex:function(g){g=g.toLowerCase().replace(/[^a-f0-9]/g,"0");if(g.length>6){g=g.substring(0,6);}return g;},rgbToHex:function(g){return this.intToHex(g.r)+this.intToHex(g.g)+this.intToHex(g.b);},intToHex:function(h){var g=parseInt(h).toString(16);if(g.length==1){g=("0"+g);}return g.toLowerCase();},hexToInt:function(g){return parseInt(g,16);},rgbToHsv:function(l){var o=l.r/255,n=l.g/255,j=l.b/255,k={h:0,s:0,v:0},m=0,h=0,p;if(o>=n&&o>=j){h=o;m=n>j?j:n;}else{if(n>=j&&n>=o){h=n;m=o>j?j:o;}else{h=j;m=n>o?o:n;}}k.v=h;k.s=h?(h-m)/h:0;if(!k.s){k.h=0;}else{p=h-m;if(o==h){k.h=(n-j)/p;}else{if(n==h){k.h=2+(j-o)/p;}else{k.h=4+(o-n)/p;}}k.h=parseInt(k.h*60);if(k.h<0){k.h+=360;}}k.s=parseInt(k.s*100);k.v=parseInt(k.v*100);return k;},hsvToRgb:function(m){var o={r:0,g:0,b:0},l=m.h,w=m.s,r=m.v;if(w==0){if(r==0){o.r=o.g=o.b=0;}else{o.r=o.g=o.b=parseInt(r*255/100);}}else{if(l==360){l=0;}l/=60;w=w/100;r=r/100;var k=parseInt(l),n=l-k,j=r*(1-w),g=r*(1-(w*n)),u=r*(1-(w*(1-n)));switch(k){case 0:o.r=r;o.g=u;o.b=j;break;case 1:o.r=g;o.g=r;o.b=j;break;case 2:o.r=j;o.g=r;o.b=u;break;case 3:o.r=j;o.g=g;o.b=r;break;case 4:o.r=u;o.g=j;o.b=r;break;case 5:o.r=r;o.g=j;o.b=g;break;}o.r=parseInt(o.r*255);o.g=parseInt(o.g*255);o.b=parseInt(o.b*255);}return o;}}};var e=d.jPicker.Color,b=d.jPicker.List,f=d.jPicker.ColorMethods;d.fn.jPicker=function(h){var g=arguments;return this.each(function(){var u=d(this),R=u.attr("id"),v=d.extend(true,{},d.fn.jPicker.defaults,h);if(!R){alert("Container element must have an id attribute to maintain unique id strings for sub-elements.");return;}if(u.get(0).nodeName.toLowerCase()=="input"){d.extend(true,v,{window:{bindToInput:true,expandable:true,input:u}});if(f.validateHex(u.val())){v.color.active=new e({hex:u.val()});v.color.current=new e({hex:u.val()});}}if(v.window.expandable){u.after('   ');}else{v.window.liveUpdate=false;}var N=parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters,al=null,ak=null,M=null,L=null,K=null,J=null,O=null,U=null,an=null,ac=null,ad=null,ae=null,F=null,D=null,S=null,am=null,I=null,H=null,aj=null,ah=null,x=null,k=null,ag=null,V=null,aa=null,m=null,z=null,s=null,af=function(ar){G.active=am.color;var at=G.active,au=o.clientPath,aq=function(av){W(av,100);av.css({backgroundColor:"",backgroundImage:"none",filter:""});};aq(al);aq(ak);aq(M);aq(L);aq(K);aq(J);U.add(an).add(ac).add(ad).add(ae).add(F).removeAttr("checked");switch(ar){case"h":U.attr("checked",true);al.css({backgroundColor:"#"+at.hex});ak.css({backgroundColor:"transparent"});r(ak,au+"map-hue.png");W(ak,100);r(J,au+"bar-hue.png");D.mxX=100;D.mxY=100;S.mxY=360;break;case"s":an.attr("checked",true);r(al,au+"map-saturation.png");r(ak,au+"map-saturation-overlay.png");W(ak,0);w(K,at.hex);r(J,au+"bar-saturation.png");D.mxX=360;D.mxY=100;S.mxY=100;break;case"v":ac.attr("checked",true);w(al,"000");r(ak,au+"map-brightness.png");K.css({backgroundColor:"#"+at.hex});r(J,au+"bar-brightness.png");D.mxX=360;D.mxY=100;S.mxY=100;break;case"r":ad.attr("checked",true);r(ak,au+"map-red-max.png");r(al,au+"map-red-min.png");r(J,au+"bar-red-tl.png");r(K,au+"bar-red-tr.png");r(L,au+"bar-red-br.png");r(M,au+"bar-red-bl.png");break;case"g":ae.attr("checked",true);r(ak,au+"map-green-max.png");r(al,au+"map-green-min.png");r(J,au+"bar-green-tl.png");r(K,au+"bar-green-tr.png");r(L,au+"bar-green-br.png");r(M,au+"bar-green-bl.png");break;case"b":F.attr("checked",true);r(ak,au+"map-blue-max.png");r(al,au+"map-blue-min.png");r(J,au+"bar-blue-tl.png");r(K,au+"bar-blue-tr.png");r(L,au+"bar-blue-br.png");r(M,au+"bar-blue-bl.png");break;default:throw ("Invalid Mode");break;}switch(ar){case"h":case"s":case"v":D.mnX=1;D.mnY=1;S.mnY=1;break;case"r":case"g":case"b":D.mnX=0;D.mnY=0;S.mnY=0;D.mxX=255;D.mxY=255;S.mxY=255;break;}G.mode=ar;t();ai();T();if(ab.expandable&&ab.liveUpdate){m.css({backgroundColor:"#"+at.hex});if(ab.bindToInput){ab.input.val(at.hex).css({backgroundColor:"#"+at.hex,color:at.v>75?"#000000":"#ffffff"});}}d.isFunction(u.liveCallback)&&u.liveCallback(at);},l=function(){t();Z();G.active=am.color;var aq=G.active;if(ab.expandable&&ab.liveUpdate){m.css({backgroundColor:"#"+aq.hex});if(ab.bindToInput){ab.input.val(am.fields.hex.val()).css({backgroundColor:"#"+aq.hex,color:aq.v>75?"#000000":"#ffffff"});}}d.isFunction(u.liveCallback)&&u.liveCallback(aq);},y=function(){if(!am||!D||!S){return;}G.active=am.color;var aq=am.fields,ar=G.active;switch(G.mode){case"h":aq.saturation.val(D.x);aq.value.val(100-D.y);break;case"s":aq.hue.val(D.x);aq.value.val(100-D.y);break;case"v":aq.hue.val(D.x);aq.saturation.val(100-D.y);break;case"r":aq.blue.val(D.x);aq.green.val(255-D.y);break;case"g":aq.blue.val(D.x);aq.red.val(255-D.y);break;case"b":aq.red.val(D.x);aq.green.val(255-D.y);break;}switch(G.mode){case"h":case"s":case"v":am.setValuesFromHsv();break;case"r":case"g":case"b":am.setValuesFromRgb();break;}Z();if(ab.expandable&&ab.liveUpdate){m.css({backgroundColor:"#"+ar.hex});if(ab.bindToInput){ab.input.val(ar.hex).css({backgroundColor:"#"+ar.hex,color:ar.v>75?"#000000":"#ffffff"});}}d.isFunction(u.liveCallback)&&u.liveCallback(ar);},ap=function(){if(!am||!D||!S){return;}G.active=am.color;var aq=am.fields,ar=G.active;switch(G.mode){case"h":aq.hue.val(360-S.y);break;case"s":aq.saturation.val(100-S.y);break;case"v":aq.value.val(100-S.y);break;case"r":aq.red.val(255-S.y);break;case"g":aq.green.val(255-S.y);break;case"b":aq.blue.val(255-S.y);break;}switch(G.mode){case"h":case"s":case"v":am.setValuesFromHsv();break;case"r":case"g":case"b":am.setValuesFromRgb();break;}Z();if(ab.expandable&&ab.liveUpdate){m.css({backgroundColor:"#"+ar.hex});if(ab.bindToInput){ab.input.val(ar.hex).css({backgroundColor:"#"+ar.hex,color:ar.v>75?"#000000":"#ffffff"});}}d.isFunction(u.liveCallback)&&u.liveCallback(ar);},t=function(){G.active=am.color;var au=0,at=G.active;switch(u.settings.color.mode){case"h":au=360-at.h;break;case"s":au=100-at.s;break;case"v":au=100-at.v;break;case"r":au=255-at.r;break;case"g":au=255-at.g;break;case"b":au=255-at.b;break;}S.y=au;S.setArrowPositionFromValues();var ar=0,aq=0;switch(u.settings.color.mode){case"h":ar=at.s;aq=100-at.v;break;case"s":ar=at.h;aq=100-at.v;break;case"v":ar=at.h;aq=100-at.s;break;case"r":ar=at.b;aq=256-at.g;break;case"g":ar=at.b;aq=256-at.r;break;case"b":ar=at.r;aq=256-at.g;break;}D.x=ar;D.y=aq;D.setArrowPositionFromValues();},Z=function(){ao();ai();T();},ao=function(){try{x.css({backgroundColor:"#"+am.color.hex});}catch(aq){}},ai=function(){if(!G||!am){return;}G.active=am.color;var ar=G.active;switch(G.mode){case"h":var aq=new e({h:ar.h,s:100,v:100});w(al,aq.hex);break;case"s":W(ak,100-ar.s);break;case"v":W(ak,ar.v);break;case"r":W(ak,ar.r/256*100);break;case"g":W(ak,ar.g/256*100);break;case"b":W(ak,ar.b/256*100);break;}},T=function(){if(!G||!am){return;}G.active=am.color;var av=G.active,ay=G.mode,aA=am.fields;switch(ay){case"h":break;case"s":var aw=new e({h:av.h,s:100,v:av.v});w(K,aw.hex);break;case"v":var az=new e({h:av.h,s:av.s,v:100});w(K,az.hex);break;case"r":case"g":case"b":var ax=0,aB=0;if(ay=="r"){ax=aA.blue.val();aB=aA.green.val();}else{if(ay=="g"){ax=aA.blue.val();aB=aA.red.val();}else{if(ay=="b"){ax=aA.red.val();aB=aA.green.val();}}}var aq=ax/256*100,au=aB/256*100,at=(256-ax)/256*100,ar=(256-aB)/256*100;W(J,au>at?at:au);W(K,au>aq?aq:au);W(L,ar>aq?aq:ar);W(M,ar>at?at:ar);break;}},w=function(aq,at){try{aq.css({backgroundColor:"#"+at});}catch(ar){}},r=function(aq,ar){if(ar.indexOf("png")&&this.isLessThanIE7){aq.attr("pngSrc",ar);aq.css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ar+"')"});}else{aq.css({backgroundImage:"url("+ar+")"});}},W=function(ar,aq){if(aq==0){ar.css({display:"none"});return;}else{if(aq<100){ar.css({display:""});if(this.isLessThanIE7){var at=ar.attr("pngSrc");if(at!=null&&at.indexOf("map-hue")==-1){ar.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+at+"') progid:DXImageTransform.Microsoft.Alpha(opacity="+aq+")"});}}else{ar.css({opacity:aq/100});}}else{if(aq==100){ar.css({display:""});if(this.isLessThanIE7){var at=ar.attr("pngSrc");if(at!=null&&at.indexOf("map-hue")==-1){ar.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+at+"')"});}}else{ar.css({opacity:""});}}}}},B=function(){am.fields.hex.val(G.current.hex);am.setValuesFromHex();d.isFunction(am.valuesChanged)&&am.valuesChanged(am);},A=function(aq){af(aq.target.value);},X=function(){B();},q=function(){B();ab.expandable&&u.hide();d.isFunction(u.cancelCallback)&&u.cancelCallback();},Q=function(){var aq=G.active;G.current=new e({hex:aq.hex});k.css({backgroundColor:"#"+aq.hex});if(ab.expandable){m.css({backgroundColor:"#"+aq.hex});if(ab.bindToInput){ab.input.val(aq.hex).css({backgroundColor:"#"+aq.hex,color:aq.v>75?"#000000":"#ffffff"});}}d.isFunction(u.commitCallback)&&u.commitCallback(aq);},n=function(){Q();ab.expandable&&u.hide();},Y=function(){u.show();},P=function(at){var aq=ab.element,ar=ab.page;I=parseInt(O.css("left"));H=parseInt(O.css("top"));aj=at.pageX;ah=at.pageY;d(document).bind("mousemove",j).bind("mouseup",p);at.stopPropagation();at.preventDefault();return false;},j=function(aq){O.css({left:I-(aj-aq.pageX)+"px",top:H-(ah-aq.pageY)+"px"});aq.stopPropagation();aq.preventDefault();return false;},p=function(aq){d(document).unbind("mousemove",j).unbind("mouseup",p);aq.stopPropagation();aq.preventDefault();return false;},C=function(aq){am.fields.hex.val(u.settings.window.input.val());am.bindedHexKeyUp(aq);},E=function(aq){am.fields.hex.val(G.quickList[aq.data.i].hex);am.setValuesFromHex();d.isFunction(am.valuesChanged)&&am.valuesChanged(am);};d.extend(true,u,{id:u.attr("id"),settings:v,color:null,icon:null,commitCallback:d.isFunction(g[1])&&g[1]||null,liveCallback:d.isFunction(g[2])&&g[2]||null,cancelCallback:d.isFunction(g[3])&&g[3]||null,show:function(){if(document.all){var aq=false;for(i=0;i0){for(i=0;i>1)-268)-d("#"+R+"_jPicker_Picker").offset().left+"px":ab.position.x,position:"absolute",top:ab.position.y=="top"?"-320px":ab.position.y=="center"?"-148px":ab.position.y=="bottom"?"25px":ab.position.y});}if((typeof(G.active)).toString().toLowerCase()=="string"){G.active=new e({hex:G.active.substring(1)});}if((typeof(G.current)).toString().toLowerCase()=="string"){G.current=new e({hex:G.current.substring(1)});}O.html(''+(ab.expandable?'':"")+'
  
    
new
  
current

 
°
%
%
 
#:
');U=d("#"+u.id+"_jPicker_HueRadio",O);an=d("#"+u.id+"_jPicker_SaturationRadio",O);ac=d("#"+u.id+"_jPicker_BrightnessRadio",O);ad=d("#"+u.id+"_jPicker_RedRadio",O);ae=d("#"+u.id+"_jPicker_GreenRadio",O);F=d("#"+u.id+"_jPicker_BlueRadio",O);al=d("#"+u.id+"_jPicker_ColorMap_l1",O);ak=d("#"+u.id+"_jPicker_ColorMap_l2",O);M=d("#"+u.id+"_jPicker_ColorBar_l1",O);L=d("#"+u.id+"_jPicker_ColorBar_l2",O);K=d("#"+u.id+"_jPicker_ColorBar_l3",O);J=d("#"+u.id+"_jPicker_ColorBar_l4",O);x=d("#"+u.id+"_jPicker_Active",O).css({backgroundColor:"#"+G.active.hex});k=d("#"+u.id+"_jPicker_Current",O).css({backgroundColor:"#"+G.current.hex});ag=d("#"+u.id+"_jPicker_Ok",O);V=d("#"+u.id+"_jPicker_Cancel",O);aa=d("#"+u.id+"_jPicker_Grid",O);u.color=d("#"+u.id+"_jPicker_Color");u.icon=d("#"+u.id+"_jPicker_Icon");am=new a(u.id,l);D=new c(u.id+"_jPicker_ColorMap",{map:{width:o.colorMap.width,height:o.colorMap.height},arrow:{image:o.clientPath+o.colorMap.arrow.file,width:o.colorMap.arrow.width,height:o.colorMap.arrow.height}},y);S=new c(u.id+"_jPicker_ColorBar",{map:{width:o.colorBar.width,height:o.colorBar.height},arrow:{image:o.clientPath+o.colorBar.arrow.file,width:o.colorBar.arrow.width,height:o.colorBar.arrow.height}},ap);if(ab.expandable){m=d("#"+u.id+"_jPicker_Color").css({backgroundColor:"#"+G.current.hex});z=d("#"+u.id+"_jPicker_Icon").css({backgroundImage:"url("+o.clientPath+o.picker.file+")"}).bind("click",Y);if(ab.bindToInput){ab.input.bind("keyup",C).bind("change",C);}}U.add(an).add(ac).add(ad).add(ae).add(F).bind("click",A);k.bind("click",X);V.bind("click",q);ag.bind("click",n);if(ab.expandable){s=d("#"+u.id+"_jPicker_MoveBar",O).bind("mousedown",P);}if(G.quickList&&G.quickList.length>0){aa.html("");for(i=0;i ');d("#"+u.id+"_jPicker_Grid_"+i,O).css({backgroundColor:"#"+G.quickList[i].hex}).bind("click",{i:i},E);}}af(G.mode);am.fields.hex.val(S.hex);am.setValuesFromHex();t();Z();Q();d.isFunction(u.commitCallback)&&u.commitCallback(G.current);if(!ab.expandable){u.show();}b.push(u);});};d.fn.jPicker.defaults={window:{position:{x:"screenCenter",y:"top"},expandable:false,liveUpdate:true},color:{mode:"h",current:new e({hex:"ffffff"}),active:new e({hex:"ffc000"}),quickList:[new e({h:360,s:33,v:100}),new e({h:360,s:66,v:100}),new e({h:360,s:100,v:100}),new e({h:360,s:100,v:75}),new e({h:360,s:100,v:50}),new e({h:180,s:0,v:100}),new e({h:30,s:33,v:100}),new e({h:30,s:66,v:100}),new e({h:30,s:100,v:100}),new e({h:30,s:100,v:75}),new e({h:30,s:100,v:50}),new e({h:180,s:0,v:90}),new e({h:60,s:33,v:100}),new e({h:60,s:66,v:100}),new e({h:60,s:100,v:100}),new e({h:60,s:100,v:75}),new e({h:60,s:100,v:50}),new e({h:180,s:0,v:80}),new e({h:90,s:33,v:100}),new e({h:90,s:66,v:100}),new e({h:90,s:100,v:100}),new e({h:90,s:100,v:75}),new e({h:90,s:100,v:50}),new e({h:180,s:0,v:70}),new e({h:120,s:33,v:100}),new e({h:120,s:66,v:100}),new e({h:120,s:100,v:100}),new e({h:120,s:100,v:75}),new e({h:120,s:100,v:50}),new e({h:180,s:0,v:60}),new e({h:150,s:33,v:100}),new e({h:150,s:66,v:100}),new e({h:150,s:100,v:100}),new e({h:150,s:100,v:75}),new e({h:150,s:100,v:50}),new e({h:180,s:0,v:50}),new e({h:180,s:33,v:100}),new e({h:180,s:66,v:100}),new e({h:180,s:100,v:100}),new e({h:180,s:100,v:75}),new e({h:180,s:100,v:50}),new e({h:180,s:0,v:40}),new e({h:210,s:33,v:100}),new e({h:210,s:66,v:100}),new e({h:210,s:100,v:100}),new e({h:210,s:100,v:75}),new e({h:210,s:100,v:50}),new e({h:180,s:0,v:30}),new e({h:240,s:33,v:100}),new e({h:240,s:66,v:100}),new e({h:240,s:100,v:100}),new e({h:240,s:100,v:75}),new e({h:240,s:100,v:50}),new e({h:180,s:0,v:20}),new e({h:270,s:33,v:100}),new e({h:270,s:66,v:100}),new e({h:270,s:100,v:100}),new e({h:270,s:100,v:75}),new e({h:270,s:100,v:50}),new e({h:180,s:0,v:10}),new e({h:300,s:33,v:100}),new e({h:300,s:66,v:100}),new e({h:300,s:100,v:100}),new e({h:300,s:100,v:75}),new e({h:300,s:100,v:50}),new e({h:180,s:0,v:0}),new e({h:330,s:33,v:100}),new e({h:330,s:66,v:100}),new e({h:330,s:100,v:100}),new e({h:330,s:100,v:75}),new e({h:330,s:100,v:50})]},images:{clientPath:"/jPicker/images/",colorMap:{width:256,height:256,arrow:{file:"mappoint.gif",width:15,height:15}},colorBar:{width:20,height:256,arrow:{file:"rangearrows.gif",width:40,height:9}},picker:{file:"picker.gif",width:25,height:24}}};})(jQuery); \ No newline at end of file +(function(e,a){var d=function(h,q){var n=this,l=e("#"+h),p=e("#"+h+"_Arrow"),o=function(r){k(r);e(document).bind("mousemove",j).bind("mouseup",m);r.stopPropagation();r.preventDefault();return false;},j=function(r){k(r);r.stopPropagation();r.preventDefault();return false;},m=function(r){e(document).unbind("mouseup",m).unbind("mousemove",j);r.stopPropagation();r.preventDefault();return false;},k=function(v){var z=l.offset(),r=v.pageX-z.left-parseInt(l.css("border-left-width")),A=v.pageY-z.top-parseInt(l.css("border-top-width")),u=l.w,s=l.h,w,t;if(r<0){r=0;}else{if(r>u){r=u;}}if(A<0){A=0;}else{if(A>s){A=s;}}w=Math.floor(r/u*n.mxX);t=Math.floor(A/s*n.mxY);n.x=w;n.y=t;if(n.mxX==n.mnX){r=0;}if(n.mxY==n.mnY){A=0;}n.setArrowPosition(r,A);e.isFunction(n.valuesChanged)&&n.valuesChanged(n);};e.extend(true,n,{settings:q,x:0,y:0,mnX:0,mxX:0,mnY:100,mxY:100,valuesChanged:e.isFunction(arguments[2])&&arguments[2]||null,setPositioningVariables:function(s){var r=n.settings.map;l.w=r&&r.width||l.width();l.h=r&&r.height||l.height();n.MinX=0;n.MinY=0;n.MaxX=l.w;n.MaxY=l.h;},setArrowPositionFromValues:function(u){n.setPositioningVariables();var z=0,w=0,v=n.mnX,s=n.mxX,t=n.mnY,r=n.mxY,B=n.x,A=n.y;if(v!=s){if(B==v){z=0;}else{if(B==s){z=l.w;}else{if(v<1){s+=Math.abs(v)+1;}if(B<1){B+=1;}z=B/s*l.w;if(parseInt(z)==(s-1)){z=s;}else{z=parseInt(z);}if(v<1){z-=Math.abs(v)-1;}}}}if(t!=r){if(A==t){w=0;}else{if(A==r){w=l.h;}else{if(t<1){r+=Math.abs(t)+1;}if(A<1){A+=1;}w=A/r*l.h;if(parseInt(w)==(r-1)){w=r;}else{w=parseInt(w);}if(t<1){w-=Math.abs(t)-1;}}}}n.setArrowPosition(z,w);},setArrowPosition:function(r,w){var v=l.w,t=l.h,u=p.w,s=p.h;if(r<0){r=0;}else{if(r>v){r=v;}}if(w<0){w=0;}else{if(w>t){w=t;}}if(u>v){r=(v>>1)-(u>>1);}else{r-=u>>1;}if(s>t){w=(t>>1)-(s>>1);}else{w-=s>>1;}p.css({left:r+"px",top:w+"px"});},destroy:function(){e(document).unbind("mouseup",m).unbind("mousemove",j);l.unbind("mousedown",o);l=null;p=null;n.valuesChanged=null;}});p.src=n.settings.arrow&&n.settings.arrow.image;p.w=n.settings.arrow&&n.settings.arrow.width||p.width();p.h=n.settings.arrow&&n.settings.arrow.height||p.height();n.setPositioningVariables();l.bind("mousedown",o);n.setArrowPositionFromValues();e.isFunction(n.valuesChanged)&&n.valuesChanged(n);},b=function(t){var m=this,y=function(A){if(A.target.value==""){return;}s(A);m.setValuesFromHsv();e.isFunction(m.valuesChanged)&&m.valuesChanged(m);},r=function(A){if(A.target.value==""){return;}p(A);m.setValuesFromRgb();e.isFunction(m.valuesChanged)&&m.valuesChanged(m);},q=function(A){if(A.target.value==""){return;}l(A);w.a=A.target.value;e.isFunction(m.valuesChanged)&&m.valuesChanged(m);},v=function(A){if(A.target.value==""){m.setValuesFromRgb();}},k=function(A){if(A.target.value==""){m.setValuesFromHsv();}},n=function(A){if(A.target.value==""){u.alpha.val(100);}},z=function(A){if(A.target.value==""){return;}x(A);m.setValuesFromHex();e.isFunction(m.valuesChanged)&&m.valuesChanged(m);},j=function(A){if(A.target.value==""){m.setValuesFromHsv();}},p=function(A){if(!o(A)){return A;}u.red.val(h(u.red.val(),0,255));u.green.val(h(u.green.val(),0,255));u.blue.val(h(u.blue.val(),0,255));},l=function(A){if(!o(A)){return A;}u.alpha.val(h(u.alpha.val(),0,100));},s=function(A){if(!o(A)){return A;}u.hue.val(h(u.hue.val(),0,360));u.saturation.val(h(u.saturation.val(),0,100));u.value.val(h(u.value.val(),0,100));},x=function(A){if(!o(A)){return A;}u.hex.val(u.hex.val().replace(/[^a-fA-F0-9]/g,"0").toLowerCase().substring(0,6));},o=function(A){switch(A.keyCode){case 9:case 16:case 29:case 37:case 38:case 40:return false;case"c".charCodeAt():case"v".charCodeAt():if(A.ctrlKey){return false;}}return true;},h=function(C,B,A){if(C==""||isNaN(C)){return B;}C=parseInt(C);if(C>A){return A;}if(C4){k=l.substring(4,l.length);l=l.substring(0,4);}if(l.length>2){j=l.substring(2,l.length);l=l.substring(0,2);}if(l.length>0){h=l.substring(0,l.length);}}return{r:this.hexToInt(k),g:this.hexToInt(j),b:this.hexToInt(h)};},validateHex:function(h){h=h.toLowerCase().replace(/[^a-f0-9]/g,"0");if(h.length>6){h=h.substring(0,6);}return h;},rgbToHex:function(h){return this.intToHex(h.r)+this.intToHex(h.g)+this.intToHex(h.b);},intToHex:function(j){var h=parseInt(j).toString(16);if(h.length==1){h=("0"+h);}return h.toLowerCase();},hexToInt:function(h){return parseInt(h,16);},rgbToHsv:function(l){var o=l.r/255,n=l.g/255,j=l.b/255,k={h:0,s:0,v:0},m=0,h=0,p;if(o>=n&&o>=j){h=o;m=n>j?j:n;}else{if(n>=j&&n>=o){h=n;m=o>j?j:o;}else{h=j;m=n>o?o:n;}}k.v=h;k.s=h?(h-m)/h:0;if(!k.s){k.h=0;}else{p=h-m;if(o==h){k.h=(n-j)/p;}else{if(n==h){k.h=2+(j-o)/p;}else{k.h=4+(o-n)/p;}}k.h=parseInt(k.h*60);if(k.h<0){k.h+=360;}}k.s=parseInt(k.s*100);k.v=parseInt(k.v*100);return k;},hsvToRgb:function(n){var r={r:0,g:0,b:0},m=n.h,x=n.s,u=n.v;if(x==0){if(u==0){r.r=r.g=r.b=0;}else{r.r=r.g=r.b=parseInt(u*255/100);}}else{if(m==360){m=0;}m/=60;x=x/100;u=u/100;var l=parseInt(m),o=m-l,k=u*(1-x),j=u*(1-(x*o)),w=u*(1-(x*(1-o)));switch(l){case 0:r.r=u;r.g=w;r.b=k;break;case 1:r.r=j;r.g=u;r.b=k;break;case 2:r.r=k;r.g=u;r.b=w;break;case 3:r.r=k;r.g=j;r.b=u;break;case 4:r.r=w;r.g=k;r.b=u;break;case 5:r.r=u;r.g=k;r.b=j;break;}r.r=parseInt(r.r*255);r.g=parseInt(r.g*255);r.b=parseInt(r.b*255);}return r;}}};var f=e.jPicker.Color,c=e.jPicker.List,g=e.jPicker.ColorMethods;e.fn.jPicker=function(j){var h=arguments;return this.each(function(){var w=e(this),X=w.attr("id"),x=e.extend(true,{},e.fn.jPicker.defaults,j);if(!X){alert("Container element must have an id attribute to maintain unique id strings for sub-elements.");return;}if(w.get(0).nodeName.toLowerCase()=="input"){e.extend(true,x,{window:{bindToInput:true,expandable:true,input:w}});if(g.validateHex(w.val())){x.color.active=new f({hex:w.val(),a:x.color.active.a});x.color.current=new f({hex:w.val(),a:x.color.current.a});}}if(x.window.expandable){w.after('   ');}else{x.window.liveUpdate=false;}var T=parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters,av=null,au=null,at=null,R=null,Q=null,P=null,O=null,aA=null,S=null,ar=null,I=null,H=null,U=null,aa=null,ax=null,ai=null,ak=null,am=null,J=null,F=null,Y=null,K=null,aw=null,N=null,M=null,aq=null,ao=null,z=null,l=null,an=null,ab=null,ag=null,n=null,B=null,u=null,al=function(aC){L.active=aw.color;var aD=L.active,aE=p.clientPath,aB=function(aF){ac(aF,100);aF.css({backgroundColor:"",backgroundImage:"none",filter:""});};aB(av);aB(au);aB(R);aB(Q);aB(P);aB(O);aa.add(ax).add(ai).add(ak).add(am).add(J).removeAttr("checked");switch(aC){case"h":aa.attr("checked",true);av.css({backgroundColor:"#"+aD.hex});au.css({backgroundColor:"transparent"});t(au,aE+"map-hue.png");ac(au,100);t(O,aE+"bar-hue.png");F.mxX=100;F.mxY=100;Y.mxY=360;break;case"s":ax.attr("checked",true);t(av,aE+"map-saturation.png");t(au,aE+"map-saturation-overlay.png");ac(au,0);y(P,aD.hex);t(O,aE+"bar-saturation.png");F.mxX=360;F.mxY=100;Y.mxY=100;break;case"v":ai.attr("checked",true);y(av,"000");t(au,aE+"map-brightness.png");P.css({backgroundColor:"#"+aD.hex});t(O,aE+"bar-brightness.png");F.mxX=360;F.mxY=100;Y.mxY=100;break;case"r":ak.attr("checked",true);t(au,aE+"map-red-max.png");t(av,aE+"map-red-min.png");t(O,aE+"bar-red-tl.png");t(P,aE+"bar-red-tr.png");t(Q,aE+"bar-red-br.png");t(R,aE+"bar-red-bl.png");break;case"g":am.attr("checked",true);t(au,aE+"map-green-max.png");t(av,aE+"map-green-min.png");t(O,aE+"bar-green-tl.png");t(P,aE+"bar-green-tr.png");t(Q,aE+"bar-green-br.png");t(R,aE+"bar-green-bl.png");break;case"b":J.attr("checked",true);t(au,aE+"map-blue-max.png");t(av,aE+"map-blue-min.png");t(O,aE+"bar-blue-tl.png");t(P,aE+"bar-blue-tr.png");t(Q,aE+"bar-blue-br.png");t(R,aE+"bar-blue-bl.png");break;default:throw ("Invalid Mode");break;}switch(aC){case"h":case"s":case"v":F.mnX=1;F.mnY=1;Y.mnY=1;break;case"r":case"g":case"b":F.mnX=0;F.mnY=0;Y.mnY=0;F.mxX=255;F.mxY=255;Y.mxY=255;break;}L.mode=aC;v();ap();Z();if(ah.expandable&&ah.liveUpdate){n.css({backgroundColor:"#"+aD.hex});if(ah.bindToInput){ah.input.val(aD.hex).css({backgroundColor:"#"+aD.hex,color:aD.v>75?"#000000":"#ffffff"});}}e.isFunction(w.liveCallback)&&w.liveCallback(aD);},m=function(){v();af();L.active=aw.color;var aB=L.active;if(ah.expandable&&ah.liveUpdate){n.css({backgroundColor:"#"+aB.hex});if(ah.bindToInput){ah.input.val(aw.fields.hex.val()).css({backgroundColor:"#"+aB.hex,color:aB.v>75?"#000000":"#ffffff"});}}e.isFunction(w.liveCallback)&&w.liveCallback(aB);},A=function(){if(!aw||!F||!Y||!K){return;}L.active=aw.color;var aB=aw.fields,aC=L.active;switch(L.mode){case"h":aB.saturation.val(F.x);aB.value.val(100-F.y);break;case"s":aB.hue.val(F.x);aB.value.val(100-F.y);break;case"v":aB.hue.val(F.x);aB.saturation.val(100-F.y);break;case"r":aB.blue.val(F.x);aB.green.val(255-F.y);break;case"g":aB.blue.val(F.x);aB.red.val(255-F.y);break;case"b":aB.red.val(F.x);aB.green.val(255-F.y);break;}switch(L.mode){case"h":case"s":case"v":aw.setValuesFromHsv();break;case"r":case"g":case"b":aw.setValuesFromRgb();break;}af();if(ah.expandable&&ah.liveUpdate){n.css({backgroundColor:"#"+aC.hex});if(ah.bindToInput){ah.input.val(aC.hex).css({backgroundColor:"#"+aC.hex,color:aC.v>75?"#000000":"#ffffff"});}}e.isFunction(w.liveCallback)&&w.liveCallback(aC);},aj=function(){if(!aw||!F||!Y||!K){return;}L.active=aw.color;var aB=aw.fields,aC=L.active;switch(L.mode){case"h":aB.hue.val(360-Y.y);break;case"s":aB.saturation.val(100-Y.y);break;case"v":aB.value.val(100-Y.y);break;case"r":aB.red.val(255-Y.y);break;case"g":aB.green.val(255-Y.y);break;case"b":aB.blue.val(255-Y.y);break;}switch(L.mode){case"h":case"s":case"v":aw.setValuesFromHsv();break;case"r":case"g":case"b":aw.setValuesFromRgb();break;}af();if(ah.expandable&&ah.liveUpdate){n.css({backgroundColor:"#"+aC.hex});if(ah.bindToInput){ah.input.val(aC.hex).css({backgroundColor:"#"+aC.hex,color:aC.v>75?"#000000":"#ffffff"});}}e.isFunction(w.liveCallback)&&w.liveCallback(aC);},s=function(){if(!aw||!F||!Y||!K){return;}L.active=aw.color;var aB=aw.fields,aC=L.active;aB.alpha.val(K.x);aw.setAlphaFromValue();af();e.isFunction(w.liveCallback)&&w.liveCallback(L.active);},v=function(){L.active=aw.color;var aE=0,aD=L.active;switch(w.settings.color.mode){case"h":aE=360-aD.h;break;case"s":aE=100-aD.s;break;case"v":aE=100-aD.v;break;case"r":aE=255-aD.r;break;case"g":aE=255-aD.g;break;case"b":aE=255-aD.b;break;}Y.y=aE;K.x=aD.a;Y.setArrowPositionFromValues();K.setArrowPositionFromValues();var aC=0,aB=0;switch(w.settings.color.mode){case"h":aC=aD.s;aB=100-aD.v;break;case"s":aC=aD.h;aB=100-aD.v;break;case"v":aC=aD.h;aB=100-aD.s;break;case"r":aC=aD.b;aB=256-aD.g;break;case"g":aC=aD.b;aB=256-aD.r;break;case"b":aC=aD.r;aB=256-aD.g;break;}F.x=aC;F.y=aB;F.setArrowPositionFromValues();},af=function(){az();ap();Z();ay();},az=function(){try{z.css({backgroundColor:"#"+aw.color.hex});}catch(aB){}},ap=function(){if(!L||!aw){return;}L.active=aw.color;var aB=L.active;switch(L.mode){case"h":y(av,new f({h:aB.h,s:100,v:100}).hex);break;case"s":ac(au,100-aB.s);break;case"v":ac(au,aB.v);break;case"r":ac(au,aB.r/256*100);break;case"g":ac(au,aB.g/256*100);break;case"b":ac(au,aB.b/256*100);break;}ac(at,100-aB.a);},Z=function(){if(!L||!aw){return;}L.active=aw.color;var aF=L.active,aI=L.mode,aK=aw.fields;switch(aI){case"h":break;case"s":var aG=new f({h:aF.h,s:100,v:aF.v});y(P,aG.hex);break;case"v":var aJ=new f({h:aF.h,s:aF.s,v:100});y(P,aJ.hex);break;case"r":case"g":case"b":var aH=0,aL=0;if(aI=="r"){aH=aK.blue.val();aL=aK.green.val();}else{if(aI=="g"){aH=aK.blue.val();aL=aK.red.val();}else{if(aI=="b"){aH=aK.red.val();aL=aK.green.val();}}}var aB=aH/256*100,aE=aL/256*100,aD=(256-aH)/256*100,aC=(256-aL)/256*100;ac(O,aE>aD?aD:aE);ac(P,aE>aB?aB:aE);ac(Q,aC>aB?aB:aC);ac(R,aC>aD?aD:aC);break;}},ay=function(){y(I,aw.color.hex);},y=function(aB,aD){try{aB.css({backgroundColor:"#"+aD});}catch(aC){}},t=function(aB,aC){if(aC.indexOf("png")&&this.isLessThanIE7){aB.attr("pngSrc",aC);aB.css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aC+"')"});}else{aB.css({backgroundImage:"url("+aC+")"});}},ac=function(aC,aB){if(aB==0){aC.css({display:"none"});return;}else{if(aB<100){aC.css({display:""});if(this.isLessThanIE7){var aD=aC.attr("pngSrc");if(aD!=null&&aD.indexOf("map-hue")==-1){aC.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aD+"') progid:DXImageTransform.Microsoft.Alpha(opacity="+aB+")"});}}else{aC.css({opacity:aB/100});}}else{if(aB==100){aC.css({display:""});if(this.isLessThanIE7){var aD=aC.attr("pngSrc");if(aD!=null&&aD.indexOf("map-hue")==-1){aC.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aD+"')"});}}else{aC.css({opacity:""});}}}}},D=function(){aw.fields.hex.val(L.current.hex);aw.fields.alpha.val(L.current.a);aw.setValuesFromHex();aw.setAlphaFromValue();e.isFunction(aw.valuesChanged)&&aw.valuesChanged(aw);},C=function(aB){al(aB.target.value);},ad=function(){D();},r=function(){D();ah.expandable&&w.hide();e.isFunction(w.cancelCallback)&&w.cancelCallback();},W=function(){var aB=L.active;L.current=new f({hex:aB.hex});L.current.a=aB.a;l.css({backgroundColor:"#"+aB.hex});if(ah.expandable){n.css({backgroundColor:"#"+aB.hex});if(ah.bindToInput){ah.input.val(aB.hex).css({backgroundColor:"#"+aB.hex,color:aB.v>75?"#000000":"#ffffff"});}}e.isFunction(w.commitCallback)&&w.commitCallback(aB);},o=function(){W();ah.expandable&&w.hide();},ae=function(){w.show();},V=function(aD){var aB=ah.element,aC=ah.page;N=parseInt(U.css("left"));M=parseInt(U.css("top"));aq=aD.pageX;ao=aD.pageY;e(document).bind("mousemove",k).bind("mouseup",q);aD.stopPropagation();aD.preventDefault();return false;},k=function(aB){U.css({left:N-(aq-aB.pageX)+"px",top:M-(ao-aB.pageY)+"px"});aB.stopPropagation();aB.preventDefault();return false;},q=function(aB){e(document).unbind("mousemove",k).unbind("mouseup",q);aB.stopPropagation();aB.preventDefault();return false;},E=function(aB){aw.fields.hex.val(w.settings.window.input.val());aw.bindedHexKeyUp(aB);},G=function(aB){aw.fields.hex.val(L.quickList[aB.data.i].hex);aw.fields.alpha.val(L.quickList[aB.data.i].a);aw.setValuesFromHex();aw.setAlphaFromValue();e.isFunction(aw.valuesChanged)&&aw.valuesChanged(aw);};e.extend(true,w,{id:w.attr("id"),settings:x,color:null,icon:null,commitCallback:e.isFunction(h[1])&&h[1]||null,liveCallback:e.isFunction(h[2])&&h[2]||null,cancelCallback:e.isFunction(h[3])&&h[3]||null,show:function(){if(document.all){var aB=false;for(i=0;i0){for(i=0;i>1)-259)-e("#"+X+"_jPicker_Picker").offset().left+"px":ah.position.x,position:"absolute",top:ah.position.y=="top"?"-340px":ah.position.y=="center"?"-153px":ah.position.y=="bottom"?"25px":ah.position.y});}if((typeof(L.active)).toString().toLowerCase()=="string"){L.active=new f({hex:L.active.substring(1)});}if((typeof(L.current)).toString().toLowerCase()=="string"){L.current=new f({hex:L.current.substring(1)});}if(!L.alphaSupport){L.current.a=L.active.a=100;}U.html(''+(ah.expandable?'':"")+'
   
    
new
  
current

 
°
%
%
 
  
% 
');aa=e("#"+w.id+"_jPicker_HueRadio",U);ax=e("#"+w.id+"_jPicker_SaturationRadio",U);ai=e("#"+w.id+"_jPicker_BrightnessRadio",U);ak=e("#"+w.id+"_jPicker_RedRadio",U);am=e("#"+w.id+"_jPicker_GreenRadio",U);J=e("#"+w.id+"_jPicker_BlueRadio",U);av=e("#"+w.id+"_jPicker_ColorMap_l1",U);au=e("#"+w.id+"_jPicker_ColorMap_l2",U);at=e("#"+w.id+"_jPicker_ColorMap_l3",U);R=e("#"+w.id+"_jPicker_ColorBar_l1",U);Q=e("#"+w.id+"_jPicker_ColorBar_l2",U);P=e("#"+w.id+"_jPicker_ColorBar_l3",U);O=e("#"+w.id+"_jPicker_ColorBar_l4",U);I=e("#"+w.id+"_jPicker_AlphaBar_l1",U);H=e("#"+w.id+"_jPicker_AlphaBar_l2",U);aA=e("#"+w.id+"_jPicker_EnableAlpha",U);S=e("#"+w.id+"_jPicker_AlphaCheckbox",U);ar=e("#"+w.id+"_jPicker_AlphaBar",U);z=e("#"+w.id+"_jPicker_Active",U).css({backgroundColor:"#"+L.active.hex});l=e("#"+w.id+"_jPicker_Current",U).css({backgroundColor:"#"+L.current.hex});an=e("#"+w.id+"_jPicker_Ok",U);ab=e("#"+w.id+"_jPicker_Cancel",U);ag=e("#"+w.id+"_jPicker_Grid",U);w.color=e("#"+w.id+"_jPicker_Color");w.icon=e("#"+w.id+"_jPicker_Icon");aw=new b(w.id,m);F=new d(w.id+"_jPicker_ColorMap",{map:{width:p.colorMap.width,height:p.colorMap.height},arrow:{image:p.clientPath+p.colorMap.arrow.file,width:p.colorMap.arrow.width,height:p.colorMap.arrow.height}},A);Y=new d(w.id+"_jPicker_ColorBar",{map:{width:p.colorBar.width,height:p.colorBar.height},arrow:{image:p.clientPath+p.colorBar.arrow.file,width:p.colorBar.arrow.width,height:p.colorBar.arrow.height}},aj);K=new d(w.id+"_jPicker_AlphaBar",{map:{width:p.alphaBar.width,height:p.alphaBar.height},arrow:{image:p.clientPath+p.alphaBar.arrow.file,width:p.alphaBar.arrow.width,height:p.alphaBar.arrow.height}},s);K.mnX=0;K.mxX=100;t(H,p.clientPath+"bar-opacity.png");t(at,p.clientPath+"map-opacity.png");if(L.alphaSupport){aA.hide();ar.show();e("td.jPicker_OpacityCol *",U).show();}else{S.bind("click",function(){aA.hide();ar.show();e("td.jPicker_OpacityCol *",U).show();});}if(ah.expandable){n=e("#"+w.id+"_jPicker_Color").css({backgroundColor:"#"+L.current.hex});B=e("#"+w.id+"_jPicker_Icon").css({backgroundImage:"url("+p.clientPath+p.picker.file+")"}).bind("click",ae);if(ah.bindToInput){ah.input.bind("keyup",E).bind("change",E);}}aa.add(ax).add(ai).add(ak).add(am).add(J).bind("click",C);l.bind("click",ad);ab.bind("click",r);an.bind("click",o);if(ah.expandable){u=e("#"+w.id+"_jPicker_MoveBar",U).bind("mousedown",V);}if(L.quickList&&L.quickList.length>0){ag.html("");for(i=0;i ');e("#"+w.id+"_jPicker_Grid_"+i,U).css({backgroundColor:"#"+L.quickList[i].hex}).bind("click",{i:i},G);}}al(L.mode);aw.fields.hex.val(Y.hex);aw.setValuesFromHex();aw.setAlphaFromValue();v();af();if(!ah.expandable){w.show();}c.push(w);});};e.fn.jPicker.defaults={window:{position:{x:"screenCenter",y:"top"},expandable:false,liveUpdate:true},color:{mode:"h",current:new f({hex:"ffc000"}),active:new f({hex:"ffc000"}),alphaSupport:false,quickList:[new f({h:360,s:33,v:100}),new f({h:360,s:66,v:100}),new f({h:360,s:100,v:100}),new f({h:360,s:100,v:75}),new f({h:360,s:100,v:50}),new f({h:180,s:0,v:100}),new f({h:30,s:33,v:100}),new f({h:30,s:66,v:100}),new f({h:30,s:100,v:100}),new f({h:30,s:100,v:75}),new f({h:30,s:100,v:50}),new f({h:180,s:0,v:90}),new f({h:60,s:33,v:100}),new f({h:60,s:66,v:100}),new f({h:60,s:100,v:100}),new f({h:60,s:100,v:75}),new f({h:60,s:100,v:50}),new f({h:180,s:0,v:80}),new f({h:90,s:33,v:100}),new f({h:90,s:66,v:100}),new f({h:90,s:100,v:100}),new f({h:90,s:100,v:75}),new f({h:90,s:100,v:50}),new f({h:180,s:0,v:70}),new f({h:120,s:33,v:100}),new f({h:120,s:66,v:100}),new f({h:120,s:100,v:100}),new f({h:120,s:100,v:75}),new f({h:120,s:100,v:50}),new f({h:180,s:0,v:60}),new f({h:150,s:33,v:100}),new f({h:150,s:66,v:100}),new f({h:150,s:100,v:100}),new f({h:150,s:100,v:75}),new f({h:150,s:100,v:50}),new f({h:180,s:0,v:50}),new f({h:180,s:33,v:100}),new f({h:180,s:66,v:100}),new f({h:180,s:100,v:100}),new f({h:180,s:100,v:75}),new f({h:180,s:100,v:50}),new f({h:180,s:0,v:40}),new f({h:210,s:33,v:100}),new f({h:210,s:66,v:100}),new f({h:210,s:100,v:100}),new f({h:210,s:100,v:75}),new f({h:210,s:100,v:50}),new f({h:180,s:0,v:30}),new f({h:240,s:33,v:100}),new f({h:240,s:66,v:100}),new f({h:240,s:100,v:100}),new f({h:240,s:100,v:75}),new f({h:240,s:100,v:50}),new f({h:180,s:0,v:20}),new f({h:270,s:33,v:100}),new f({h:270,s:66,v:100}),new f({h:270,s:100,v:100}),new f({h:270,s:100,v:75}),new f({h:270,s:100,v:50}),new f({h:180,s:0,v:10}),new f({h:300,s:33,v:100}),new f({h:300,s:66,v:100}),new f({h:300,s:100,v:100}),new f({h:300,s:100,v:75}),new f({h:300,s:100,v:50}),new f({h:180,s:0,v:0}),new f({h:330,s:33,v:100}),new f({h:330,s:66,v:100}),new f({h:330,s:100,v:100}),new f({h:330,s:100,v:75}),new f({h:330,s:100,v:50})]},images:{clientPath:"/jPicker/images/",colorMap:{width:256,height:256,arrow:{file:"mappoint.gif",width:15,height:15}},colorBar:{width:20,height:256,arrow:{file:"rangearrows.gif",width:40,height:9}},alphaBar:{width:256,height:20,arrow:{file:"rangearrows2.gif",width:9,height:40}},picker:{file:"picker.gif",width:25,height:24}}};})(jQuery,"1.0.6"); \ No newline at end of file diff --git a/editor/svg-editor.html b/editor/svg-editor.html index 4fdf877d..640bf6b6 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -162,37 +162,11 @@ fill:
- - - +
N/A
stroke:
- - - +
100 %