diff --git a/editor/extensions/ext-shapes.js b/editor/extensions/ext-shapes.js index 69e7958..1390c19 100644 --- a/editor/extensions/ext-shapes.js +++ b/editor/extensions/ext-shapes.js @@ -328,7 +328,6 @@ svgEditor.addExtension("shapes", function() { var multiplierY = (totalScale.sy > totalScale.sx) ? 1 : totalScale.sy/totalScale.sx; sx *= multiplierY sy *= multiplierX - console.log(multiplierX, multiplierY); } } totalScale.sx *= sx; diff --git a/editor/svg-editor.js b/editor/svg-editor.js index fddb5d5..151e90a 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -1501,7 +1501,8 @@ ellipse: ['cx','cy','rx','ry'], line: ['x1','y1','x2','y2'], text: ['x', 'y'], - 'use': [] + 'use': [], + path : [] }; var el_name = elem.tagName; diff --git a/editor/svgedit.compiled.js b/editor/svgedit.compiled.js index d42f7e3..64291d5 100644 --- a/editor/svgedit.compiled.js +++ b/editor/svgedit.compiled.js @@ -1,31 +1,31 @@ function touchHandler(a){var p=a.changedTouches,g=p[0],c="";switch(a.type){case "touchstart":c="mousedown";break;case "touchmove":c="mousemove";break;case "touchend":c="mouseup";break;default:return}var m=document.createEvent("MouseEvent");m.initMouseEvent(c,true,true,window,1,g.screenX,g.screenY,g.clientX,g.clientY,false,false,false,false,0,null);if(p.length<2){g.target.dispatchEvent(m);a.preventDefault()}};(function(a){function p(g){if(typeof g.data==="string"){var c=g.handler,m=g.data.toLowerCase().split(" ");g.handler=function(s){if(!(this!==s.target&&(/textarea|select/i.test(s.target.nodeName)||s.target.type==="text"))){var b=s.type!=="keypress"&&a.hotkeys.specialKeys[s.which],f=String.fromCharCode(s.which).toLowerCase(),d="",k={};if(s.altKey&&b!=="alt")d+="alt+";if(s.ctrlKey&&b!=="ctrl")d+="ctrl+";if(s.metaKey&&!s.ctrlKey&&b!=="meta")d+="meta+";if(s.shiftKey&&b!=="shift")d+="shift+";if(b)k[d+b]= true;else{k[d+f]=true;k[d+a.hotkeys.shiftNums[f]]=true;if(d==="shift+")k[a.hotkeys.shiftNums[f]]=true}b=0;for(f=m.length;b","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:p}})})(jQuery);(function(a,p){function g(da){return typeof da==="string"}function c(da){var X=d.call(arguments,1);return function(){return da.apply(this,X.concat(d.call(arguments)))}}function m(da,X,Z,oa,ra){var ma;if(oa!==f){X=Z.match(da?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);Z=X[3]||"";if(ra===2&&g(oa))oa=oa.replace(da?W:ba,"");else{ma=o(X[2]);oa=g(oa)?o[da?ia:P](oa):oa;oa=ra===2?oa:ra===1?a.extend({},oa,ma):a.extend({},ma,oa);oa=q(oa);if(da)oa=oa.replace(ta,k)}da=X[1]+(da?"#":oa||!X[1]?"?":"")+oa+Z}else da= -X(Z!==f?Z:p[qa][ga]);return da}function s(da,X,Z){if(X===f||typeof X==="boolean"){Z=X;X=q[da?ia:P]()}else X=g(X)?X.replace(da?W:ba,""):X;return o(X,Z)}function b(da,X,Z,oa){if(!g(Z)&&typeof Z!=="object"){oa=Z;Z=X;X=f}return this.each(function(){var ra=a(this),ma=X||S()[(this.nodeName||"").toLowerCase()]||"",na=ma&&ra.attr(ma)||"";ra.attr(ma,q[da](na,Z,oa))})}var f,d=Array.prototype.slice,k=decodeURIComponent,q=a.param,B,o,J,U=a.bbq=a.bbq||{},M,I,S,Y=a.event.special,P="querystring",ia="fragment",qa= -"location",ga="href",ba=/^.*\?|#.*$/g,W=/^.*\#/,ta,ka={};q[P]=c(m,0,function(da){return da.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});q[ia]=B=c(m,1,function(da){return da.replace(/^[^#]*#?(.*)$/,"$1")});B.noEscape=function(da){da=da||"";da=a.map(da.split(""),encodeURIComponent);ta=RegExp(da.join("|"),"g")};B.noEscape(",/");a.deparam=o=function(da,X){var Z={},oa={"true":true,"false":false,"null":null};a.each(da.replace(/\+/g," ").split("&"),function(ra,ma){var na=ma.split("="),Ca=k(na[0]),Ga=Z,Ja= -0,Da=Ca.split("]["),La=Da.length-1;if(/\[/.test(Da[0])&&/\]$/.test(Da[La])){Da[La]=Da[La].replace(/\]$/,"");Da=Da.shift().split("[").concat(Da);La=Da.length-1}else La=0;if(na.length===2){na=k(na[1]);if(X)na=na&&!isNaN(na)?+na:na==="undefined"?f:oa[na]!==f?oa[na]:na;if(La)for(;Ja<=La;Ja++){Ca=Da[Ja]===""?Ga.length:Da[Ja];Ga=Ga[Ca]=Ja","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:p}})})(jQuery);(function(a,p){function g(da){return typeof da==="string"}function c(da){var W=d.call(arguments,1);return function(){return da.apply(this,W.concat(d.call(arguments)))}}function m(da,W,Z,oa,ra){var ma;if(oa!==f){W=Z.match(da?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);Z=W[3]||"";if(ra===2&&g(oa))oa=oa.replace(da?X:ba,"");else{ma=o(W[2]);oa=g(oa)?o[da?ia:P](oa):oa;oa=ra===2?oa:ra===1?a.extend({},oa,ma):a.extend({},ma,oa);oa=q(oa);if(da)oa=oa.replace(ta,k)}da=W[1]+(da?"#":oa||!W[1]?"?":"")+oa+Z}else da= +W(Z!==f?Z:p[qa][ga]);return da}function s(da,W,Z){if(W===f||typeof W==="boolean"){Z=W;W=q[da?ia:P]()}else W=g(W)?W.replace(da?X:ba,""):W;return o(W,Z)}function b(da,W,Z,oa){if(!g(Z)&&typeof Z!=="object"){oa=Z;Z=W;W=f}return this.each(function(){var ra=a(this),ma=W||S()[(this.nodeName||"").toLowerCase()]||"",na=ma&&ra.attr(ma)||"";ra.attr(ma,q[da](na,Z,oa))})}var f,d=Array.prototype.slice,k=decodeURIComponent,q=a.param,B,o,J,U=a.bbq=a.bbq||{},M,I,S,Y=a.event.special,P="querystring",ia="fragment",qa= +"location",ga="href",ba=/^.*\?|#.*$/g,X=/^.*\#/,ta,ka={};q[P]=c(m,0,function(da){return da.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});q[ia]=B=c(m,1,function(da){return da.replace(/^[^#]*#?(.*)$/,"$1")});B.noEscape=function(da){da=da||"";da=a.map(da.split(""),encodeURIComponent);ta=RegExp(da.join("|"),"g")};B.noEscape(",/");a.deparam=o=function(da,W){var Z={},oa={"true":true,"false":false,"null":null};a.each(da.replace(/\+/g," ").split("&"),function(ra,ma){var na=ma.split("="),Ca=k(na[0]),Ga=Z,Ja= +0,Da=Ca.split("]["),La=Da.length-1;if(/\[/.test(Da[0])&&/\]$/.test(Da[La])){Da[La]=Da[La].replace(/\]$/,"");Da=Da.shift().split("[").concat(Da);La=Da.length-1}else La=0;if(na.length===2){na=k(na[1]);if(W)na=na&&!isNaN(na)?+na:na==="undefined"?f:oa[na]!==f?oa[na]:na;if(La)for(;Ja<=La;Ja++){Ca=Da[Ja]===""?Ga.length:Da[Ja];Ga=Ga[Ca]=Ja').hide().insertAfter("body")[0].contentWindow; -I=function(){return c(U.document[b][f])};M=function(S,Y){if(S!==Y){var P=U.document;P.open().close();P[b].hash="#"+S}};M(c())}}var o={},J,U,M,I;o.start=function(){if(!J){var S=c();M||B();(function Y(){var P=c(),ia=I(S);if(P!==S){M(S=P,ia);a(p).trigger("hashchange")}else if(ia!==S)p[b][f]=p[b][f].replace(/#.*/,"")+"#"+ia;J=setTimeout(Y,a.hashchangeDelay)})()}};o.stop=function(){if(!U){J&&clearTimeout(J);J=0}};return o}()})(jQuery,this);(function(a){var p={},g;a.svgIcons=function(c,m){function s(da,X){if(da!=="ajax"){if(S)return;var Z=(U=ga[0].contentDocument)&&U.getElementById("svg_eof");if(!Z&&!(X&&Z)){Y++;if(Y<50)setTimeout(s,20);else{f();S=true}return}S=true}J=a(U.firstChild).children();if(m.no_img)setTimeout(function(){I||b()},500);else{Z=qa+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";M=a(new Image).attr({src:Z,width:0,height:0}).appendTo("body").load(function(){b(true)}).error(function(){b()})}} -function b(da,X){if(!I){if(m.no_img)da=false;if(da){var Z=a(document.createElement("div"));Z.hide().appendTo("body")}if(X){var oa=m.fallback_path?m.fallback_path:"";a.each(X,function(La,Oa){a("#"+La);var Ba=a(new Image).attr({"class":"svg_icon",src:oa+Oa,width:B,height:o,alt:"icon"});ka(Ba,La)})}else for(var ra=J.length,ma=0;ma0&&!da)za=g(za,Ba,true);ta(a(this),za,Oa)})});if(!X){da&&Z.remove();ga&&ga.remove();M&&M.remove()}m.resize&&a.resizeSvgIcons(m.resize);I=true;m.callback&&m.callback(p)}}function f(){if(c.indexOf(".svgz")!=-1){var da=c.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg");a.svgIcons(da,m)}else m.fallback&&b(false,m.fallback)} -function d(da){if(window.btoa)return window.btoa(da);var X=Array(Math.floor((da.length+2)/3)*4),Z,oa,ra,ma,na,Ca,Ga=0,Ja=0;do{Z=da.charCodeAt(Ga++);oa=da.charCodeAt(Ga++);ra=da.charCodeAt(Ga++);ma=Z>>2;Z=(Z&3)<<4|oa>>4;na=(oa&15)<<2|ra>>6;Ca=ra&63;if(isNaN(oa))na=Ca=64;else if(isNaN(ra))Ca=64;X[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(ma);X[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Z);X[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(na); -X[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Ca)}while(Ga-1&&P.indexOf("Chrome/");var qa="data:image/svg+xml;charset=utf-8;base64,";if(m.svgz){var ga=a('').appendTo("body").hide();try{U=ga[0].contentDocument;ga.load(s); -s(0,true)}catch(ba){f()}}else{var W=new DOMParser;a.ajax({url:c,dataType:"string",success:function(da){if(da){U=W.parseFromString(da,"text/xml");a(function(){s("ajax")})}else a(f)},error:function(da){if(window.opera)a(function(){f()});else if(da.responseText){U=W.parseFromString(da.responseText,"text/xml");U.childNodes.length||a(f);a(function(){s("ajax")})}else a(f)}})}var ta=function(da,X,Z,oa){ia&&X.css("visibility","hidden");if(m.replace){oa&&X.attr("id",Z);(Z=da.attr("class"))&&X.attr("class", -"svg_icon "+Z);da.replaceWith(X)}else da.append(X);ia&&setTimeout(function(){X.removeAttr("style")},1)},ka=function(da,X){if(m.id_match===undefined||m.id_match!==false)ta(holder,da,X,true);p[X]=da};g=function(da,X){var Z=da.find("defs");if(!Z.length)return da;Z=ia?Z.find("*").filter(function(){return!!this.id}):Z.find("[id]");var oa=da[0].getElementsByTagName("*"),ra=oa.length;Z.each(function(ma){var na=this.id;a(U).find("#"+na);this.id=ma="x"+na+X+ma;na="url(#"+na+")";var Ca="url(#"+ma+")";for(ma= +src:na})}else na=g(a(Ga),ma);ka(na,Ca)}m.placement&&a.each(m.placement,function(La,Oa){p[Oa]&&a(La).each(function(Ba){var za=p[Oa].clone();if(Ba>0&&!da)za=g(za,Ba,true);ta(a(this),za,Oa)})});if(!W){da&&Z.remove();ga&&ga.remove();M&&M.remove()}m.resize&&a.resizeSvgIcons(m.resize);I=true;m.callback&&m.callback(p)}}function f(){if(c.indexOf(".svgz")!=-1){var da=c.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg");a.svgIcons(da,m)}else m.fallback&&b(false,m.fallback)} +function d(da){if(window.btoa)return window.btoa(da);var W=Array(Math.floor((da.length+2)/3)*4),Z,oa,ra,ma,na,Ca,Ga=0,Ja=0;do{Z=da.charCodeAt(Ga++);oa=da.charCodeAt(Ga++);ra=da.charCodeAt(Ga++);ma=Z>>2;Z=(Z&3)<<4|oa>>4;na=(oa&15)<<2|ra>>6;Ca=ra&63;if(isNaN(oa))na=Ca=64;else if(isNaN(ra))Ca=64;W[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(ma);W[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Z);W[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(na); +W[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Ca)}while(Ga-1&&P.indexOf("Chrome/");var qa="data:image/svg+xml;charset=utf-8;base64,";if(m.svgz){var ga=a('').appendTo("body").hide();try{U=ga[0].contentDocument;ga.load(s); +s(0,true)}catch(ba){f()}}else{var X=new DOMParser;a.ajax({url:c,dataType:"string",success:function(da){if(da){U=X.parseFromString(da,"text/xml");a(function(){s("ajax")})}else a(f)},error:function(da){if(window.opera)a(function(){f()});else if(da.responseText){U=X.parseFromString(da.responseText,"text/xml");U.childNodes.length||a(f);a(function(){s("ajax")})}else a(f)}})}var ta=function(da,W,Z,oa){ia&&W.css("visibility","hidden");if(m.replace){oa&&W.attr("id",Z);(Z=da.attr("class"))&&W.attr("class", +"svg_icon "+Z);da.replaceWith(W)}else da.append(W);ia&&setTimeout(function(){W.removeAttr("style")},1)},ka=function(da,W){if(m.id_match===undefined||m.id_match!==false)ta(holder,da,W,true);p[W]=da};g=function(da,W){var Z=da.find("defs");if(!Z.length)return da;Z=ia?Z.find("*").filter(function(){return!!this.id}):Z.find("[id]");var oa=da[0].getElementsByTagName("*"),ra=oa.length;Z.each(function(ma){var na=this.id;a(U).find("#"+na);this.id=ma="x"+na+W+ma;na="url(#"+na+")";var Ca="url(#"+ma+")";for(ma= 0;ma=0;jQuery.fn.jGraduate=function(c){var m= -arguments;return this.each(function(){function s(la,ca,ja,O,T){var ea=T||a("stop",{"stop-color":ca,"stop-opacity":ja,offset:la},W);if(T){ca=T.getAttribute("stop-color");ja=T.getAttribute("stop-opacity");la=T.getAttribute("offset")}else W.appendChild(ea);if(ja===null)ja=1;T=a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:"url(#jGraduate_trans)",transform:"translate("+(10+la*ia)+", 26)"},rb);var Ha= +arguments;return this.each(function(){function s(la,ca,ja,O,T){var ea=T||a("stop",{"stop-color":ca,"stop-opacity":ja,offset:la},X);if(T){ca=T.getAttribute("stop-color");ja=T.getAttribute("stop-opacity");la=T.getAttribute("offset")}else X.appendChild(ea);if(ja===null)ja=1;T=a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:"url(#jGraduate_trans)",transform:"translate("+(10+la*ia)+", 26)"},rb);var Ha= a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:ca,"fill-opacity":ja,transform:"translate("+(10+la*ia)+", 26)",stroke:"#000","stroke-width":1.5},rb);$(Ha).mousedown(function(Pa){b(this);Sa=jb;S.mousemove(k).mouseup(f);wa=$a.offset();Pa.preventDefault();return false}).data("stop",ea).data("bg",T).dblclick(function(){$("div.jGraduate_LightBox").show();for(var Pa=this,Xa=+ea.getAttribute("stop-opacity")|| 1,fb=ea.getAttribute("stop-color")||1,ob=(parseFloat(Xa)*255).toString(16);ob.length<2;)ob="0"+ob;ca=fb.substr(1)+ob;$("#"+o+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:B.images.clientPath},color:{active:ca,alphaSupport:true}},function(Wa){fb=Wa.val("hex")?"#"+Wa.val("hex"):"none";Xa=Wa.val("a")!==null?Wa.val("a")/256:1;Pa.setAttribute("fill",fb);Pa.setAttribute("fill-opacity",Xa);ea.setAttribute("stop-color", -fb);ea.setAttribute("stop-opacity",Xa);$("div.jGraduate_LightBox").hide();$("#"+o+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();$("#"+o+"_jGraduate_stopPicker").hide()})});$(W).find("stop").each(function(){var Pa=$(this);if(+this.getAttribute("offset")>la){if(!ca){var Xa=this.getAttribute("stop-color"),fb=this.getAttribute("stop-opacity");ea.setAttribute("stop-color",Xa);Ha.setAttribute("fill",Xa);ea.setAttribute("stop-opacity",fb===null?1:fb);Ha.setAttribute("fill-opacity", -fb===null?1:fb)}Pa.before(ea);return false}});O&&b(Ha);return ea}function b(la){jb&&jb.setAttribute("stroke","#000");la.setAttribute("stroke","blue");jb=la;jb.parentNode.appendChild(jb)}function f(){S.unbind("mousemove",k);if(Ea.getAttribute("display")!=="none"){Ea.setAttribute("display","none");var la=$(jb),ca=la.data("stop");la=la.data("bg");$([jb,ca,la]).remove()}Sa=null}function d(){var la=Ta?"rotate("+Ta+","+Fa+","+lb+") ":"";hb===1&&Ma===1?W.removeAttribute("gradientTransform"):W.setAttribute("gradientTransform", -la+"translate("+-Fa*(hb-1)+","+-lb*(Ma-1)+") scale("+hb+","+Ma+")")}function k(la){var ca=la.pageX-wa.left;la=la.pageY-wa.top;ca=ca<10?10:ca>ia+10?ia+10:ca;var ja="translate("+ca+", 26)";if(la<-60||la>130){Ea.setAttribute("display","block");Ea.setAttribute("transform",ja)}else Ea.setAttribute("display","none");Sa.setAttribute("transform",ja);$.data(Sa,"bg").setAttribute("transform",ja);$.data(Sa,"stop").setAttribute("offset",(ca-10)/ia);var O=0;$(W).find("stop").each(function(){var T=this.getAttribute("offset"), -ea=$(this);if(Tla){if(!ca){var Xa=this.getAttribute("stop-color"),fb=this.getAttribute("stop-opacity");ea.setAttribute("stop-color",Xa);Ha.setAttribute("fill",Xa);ea.setAttribute("stop-opacity",fb===null?1:fb);Ha.setAttribute("fill-opacity", +fb===null?1:fb)}Pa.before(ea);return false}});O&&b(Ha);return ea}function b(la){jb&&jb.setAttribute("stroke","#000");la.setAttribute("stroke","blue");jb=la;jb.parentNode.appendChild(jb)}function f(){S.unbind("mousemove",k);if(Ea.getAttribute("display")!=="none"){Ea.setAttribute("display","none");var la=$(jb),ca=la.data("stop");la=la.data("bg");$([jb,ca,la]).remove()}Sa=null}function d(){var la=Ta?"rotate("+Ta+","+Fa+","+lb+") ":"";hb===1&&Ma===1?X.removeAttribute("gradientTransform"):X.setAttribute("gradientTransform", +la+"translate("+-Fa*(hb-1)+","+-lb*(Ma-1)+") scale("+hb+","+Ma+")")}function k(la){var ca=la.pageX-wa.left;la=la.pageY-wa.top;ca=ca<10?10:ca>ia+10?ia+10:ca;var ja="translate("+ca+", 26)";if(la<-60||la>130){Ea.setAttribute("display","block");Ea.setAttribute("transform",ja)}else Ea.setAttribute("display","none");Sa.setAttribute("transform",ja);$.data(Sa,"bg").setAttribute("transform",ja);$.data(Sa,"stop").setAttribute("offset",(ca-10)/ia);var O=0;$(X).find("stop").each(function(){var T=this.getAttribute("offset"), +ea=$(this);if(T
  • Solid Color
  • Linear Gradient
  • Radial Gradient
  • ');var Y=$(J+"> .jGraduate_colPick"),P=$(J+"> .jGraduate_gradPick");P.html('

    '+B.window.pickerTitle+'


    ');var ia=256,qa=ia-0,ga=ia-0,ba,W,ta,ka={};$(".jGraduate_SliderBar").width(145);var da=$("#"+o+"_jGraduate_GradContainer")[0],X=a("svg",{id:o+"_jgraduate_svg",width:ia,height:ia,xmlns:p.svg},da);ba=ba||q.paint.type;var Z=W=q.paint[ba],oa=q.paint.alpha,ra=ba==="solidColor";switch(ba){case "solidColor":case "linearGradient":if(!ra){W.id=o+"_lg_jgraduate_grad"; -Z=W=X.appendChild(W)}a("radialGradient",{id:o+"_rg_jgraduate_grad"},X);if(ba==="linearGradient")break;case "radialGradient":if(!ra){W.id=o+"_rg_jgraduate_grad";Z=W=X.appendChild(W)}a("linearGradient",{id:o+"_lg_jgraduate_grad"},X)}if(ra){Z=W=$("#"+o+"_lg_jgraduate_grad")[0];I=q.paint[ba];s(0,"#"+I,1);var ma=typeof B.newstop;if(ma==="string")switch(B.newstop){case "same":s(1,"#"+I,1);break;case "inverse":ma="";for(var na=0;na<6;na+=2){I.substr(na,2);var Ca=(255-parseInt(I.substr(na,2),16)).toString(16); +o+'_jGraduate_Ok" class="jGraduate_Ok" value="OK"/>');var ia=256,qa=ia-0,ga=ia-0,ba,X,ta,ka={};$(".jGraduate_SliderBar").width(145);var da=$("#"+o+"_jGraduate_GradContainer")[0],W=a("svg",{id:o+"_jgraduate_svg",width:ia,height:ia,xmlns:p.svg},da);ba=ba||q.paint.type;var Z=X=q.paint[ba],oa=q.paint.alpha,ra=ba==="solidColor";switch(ba){case "solidColor":case "linearGradient":if(!ra){X.id=o+"_lg_jgraduate_grad"; +Z=X=W.appendChild(X)}a("radialGradient",{id:o+"_rg_jgraduate_grad"},W);if(ba==="linearGradient")break;case "radialGradient":if(!ra){X.id=o+"_rg_jgraduate_grad";Z=X=W.appendChild(X)}a("linearGradient",{id:o+"_lg_jgraduate_grad"},W)}if(ra){Z=X=$("#"+o+"_lg_jgraduate_grad")[0];I=q.paint[ba];s(0,"#"+I,1);var ma=typeof B.newstop;if(ma==="string")switch(B.newstop){case "same":s(1,"#"+I,1);break;case "inverse":ma="";for(var na=0;na<6;na+=2){I.substr(na,2);var Ca=(255-parseInt(I.substr(na,2),16)).toString(16); if(Ca.length<2)Ca=0+Ca;ma+=Ca}s(1,"#"+ma,1);break;case "white":s(1,"#ffffff",1);break;case "black":s(1,"#000000",1)}else if(ma==="object")s(1,B.newstop.color||"#"+I,"opac"in B.newstop?B.newstop.opac:1)}I=parseFloat(Z.getAttribute("x1")||0);ma=parseFloat(Z.getAttribute("y1")||0);na=parseFloat(Z.getAttribute("x2")||1);Ca=parseFloat(Z.getAttribute("y2")||0);var Ga=parseFloat(Z.getAttribute("cx")||0.5),Ja=parseFloat(Z.getAttribute("cy")||0.5),Da=parseFloat(Z.getAttribute("fx")||Ga),La=parseFloat(Z.getAttribute("fy")|| -Ja);ta=a("rect",{id:o+"_jgraduate_rect",x:0,y:0,width:qa,height:ga,fill:"url(#"+o+"_jgraduate_grad)","fill-opacity":oa/100},X);var Oa=$("
    ").attr({"class":"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:ma*ia,left:I*ia}).data("coord","start").appendTo(da),Ba=Oa.clone().text(2).css({top:Ca*ia,left:na*ia}).attr("title","End stop").data("coord","end").appendTo(da),za=$("
    ").attr({"class":"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:Ja*ia,left:Ga* -ia}).data("coord","center").appendTo(da),Ia=za.clone().text("F").css({top:La*ia,left:Da*ia,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(da);Ia[0].id=o+"_jGraduate_focusCoord";$(J+" .grad_coord");$.each(["x1","y1","x2","y2","cx","cy","fx","fy"],function(la,ca){var ja=W.getAttribute(ca),O=isNaN(ca[1]);ja||(ja=O?"0.5":ca==="x2"?"1.0":"0.0");ka[ca]=$("#"+o+"_jGraduate_"+ca).val(ja).change(function(){if(isNaN(parseFloat(this.value))||this.value<0)this.value=0;else if(this.value> -1)this.value=1;if(!(ca[0]==="f"&&!kb))if(O&&ba==="radialGradient"||!O&&ba==="linearGradient")W.setAttribute(ca,this.value);var T=O?ca[0]==="c"?za:Ia:ca[1]==="1"?Oa:Ba,ea=ca.indexOf("x")>=0?"left":"top";T.css(ea,this.value*ia)}).change()});var xa,rb,$a=$("#"+o+"_jGraduate_StopSlider"),jb,Ua,Sa,Ea=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},Ua),wa,hb=1,Ma=1,Ta=0,Fa=Ga,lb=Ja;Ua=a("svg",{width:"100%",height:45},$a[0]);da=a("pattern",{width:16, +Ja);ta=a("rect",{id:o+"_jgraduate_rect",x:0,y:0,width:qa,height:ga,fill:"url(#"+o+"_jgraduate_grad)","fill-opacity":oa/100},W);var Oa=$("
    ").attr({"class":"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:ma*ia,left:I*ia}).data("coord","start").appendTo(da),Ba=Oa.clone().text(2).css({top:Ca*ia,left:na*ia}).attr("title","End stop").data("coord","end").appendTo(da),za=$("
    ").attr({"class":"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:Ja*ia,left:Ga* +ia}).data("coord","center").appendTo(da),Ia=za.clone().text("F").css({top:La*ia,left:Da*ia,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(da);Ia[0].id=o+"_jGraduate_focusCoord";$(J+" .grad_coord");$.each(["x1","y1","x2","y2","cx","cy","fx","fy"],function(la,ca){var ja=X.getAttribute(ca),O=isNaN(ca[1]);ja||(ja=O?"0.5":ca==="x2"?"1.0":"0.0");ka[ca]=$("#"+o+"_jGraduate_"+ca).val(ja).change(function(){if(isNaN(parseFloat(this.value))||this.value<0)this.value=0;else if(this.value> +1)this.value=1;if(!(ca[0]==="f"&&!kb))if(O&&ba==="radialGradient"||!O&&ba==="linearGradient")X.setAttribute(ca,this.value);var T=O?ca[0]==="c"?za:Ia:ca[1]==="1"?Oa:Ba,ea=ca.indexOf("x")>=0?"left":"top";T.css(ea,this.value*ia)}).change()});var xa,rb,$a=$("#"+o+"_jGraduate_StopSlider"),jb,Ua,Sa,Ea=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},Ua),wa,hb=1,Ma=1,Ta=0,Fa=Ga,lb=Ja;Ua=a("svg",{width:"100%",height:45},$a[0]);da=a("pattern",{width:16, height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},Ua);a("image",{width:16,height:16},da).setAttributeNS(p.xlink,"xlink:href",B.images.clientPath+"map-opacity.png");$(Ua).on("click touchstart",function(la){wa=$a.offset();if(la.target.tagName!=="path"){var ca=la.pageX-wa.left-8;ca=ca<10?10:ca>ia+10?ia+10:ca;s(ca/ia,0,0,true);la.stopPropagation()}});$(Ua).mouseover(function(){Ua.appendChild(Ea)});rb=a("g",{},Ua);a("line",{x1:10,y1:15,x2:ia+10,y2:15,"stroke-width":2,stroke:"#000"},Ua);var tb= -P.find(".jGraduate_spreadMethod").change(function(){W.setAttribute("spreadMethod",$(this).val())}),Ya=null,bb=function(la){var ca=la.pageX-nb.left,ja=la.pageY-nb.top;ca=ca<0?0:ca>ia?ia:ca;ja=ja<0?0:ja>ia?ia:ja;Ya.css("left",ca).css("top",ja);ca=ca/qa;ja=ja/ga;var O=Ya.data("coord"),T=W;switch(O){case "start":ka.x1.val(ca);ka.y1.val(ja);T.setAttribute("x1",ca);T.setAttribute("y1",ja);break;case "end":ka.x2.val(ca);ka.y2.val(ja);T.setAttribute("x2",ca);T.setAttribute("y2",ja);break;case "center":ka.cx.val(ca); -ka.cy.val(ja);T.setAttribute("cx",ca);T.setAttribute("cy",ja);Fa=ca;lb=ja;d();break;case "focus":ka.fx.val(ca);ka.fy.val(ja);T.setAttribute("fx",ca);T.setAttribute("fy",ja);d()}la.preventDefault()},Cb=function(){Ya=null;S.unbind("mousemove",bb).unbind("mouseup",Cb)};xa=W.getElementsByTagNameNS(p.svg,"stop");if(ua<2){for(;ua<2;){W.appendChild(document.createElementNS(p.svg,"stop"));++ua}xa=W.getElementsByTagNameNS(p.svg,"stop")}var ua=xa.length;for(na=0;na99.5)O=99.5;if(O>0)Ma=1-O/100;else hb=-(O/100)-1;T=145*((O+100)/ -2)/100;ea&&d();break;case "angle":Ta=O;T=Ta/180;T+=0.5;T*=145;ea&&d()}if(T>145)T=145;else if(T<0)T=0;ja.css({"margin-left":T-5})}).change()});var ub=function(la){var ca=la.pageX-gb.offset.left-parseInt(gb.parent.css("border-left-width"));if(ca>145)ca=145;if(ca<=0)ca=0;var ja=ca-5;ca/=145;switch(gb.type){case "radius":ca=Math.pow(ca*2,2.5);if(ca>0.98&&ca<1.02)ca=1;if(ca<=0.01)ca=0.01;W.setAttribute("r",ca);break;case "opacity":q.paint.alpha=parseInt(ca*100);ta.setAttribute("fill-opacity",ca);break; +P.find(".jGraduate_spreadMethod").change(function(){X.setAttribute("spreadMethod",$(this).val())}),Ya=null,bb=function(la){var ca=la.pageX-nb.left,ja=la.pageY-nb.top;ca=ca<0?0:ca>ia?ia:ca;ja=ja<0?0:ja>ia?ia:ja;Ya.css("left",ca).css("top",ja);ca=ca/qa;ja=ja/ga;var O=Ya.data("coord"),T=X;switch(O){case "start":ka.x1.val(ca);ka.y1.val(ja);T.setAttribute("x1",ca);T.setAttribute("y1",ja);break;case "end":ka.x2.val(ca);ka.y2.val(ja);T.setAttribute("x2",ca);T.setAttribute("y2",ja);break;case "center":ka.cx.val(ca); +ka.cy.val(ja);T.setAttribute("cx",ca);T.setAttribute("cy",ja);Fa=ca;lb=ja;d();break;case "focus":ka.fx.val(ca);ka.fy.val(ja);T.setAttribute("fx",ca);T.setAttribute("fy",ja);d()}la.preventDefault()},Cb=function(){Ya=null;S.unbind("mousemove",bb).unbind("mouseup",Cb)};xa=X.getElementsByTagNameNS(p.svg,"stop");if(ua<2){for(;ua<2;){X.appendChild(document.createElementNS(p.svg,"stop"));++ua}xa=X.getElementsByTagNameNS(p.svg,"stop")}var ua=xa.length;for(na=0;na99.5)O=99.5;if(O>0)Ma=1-O/100;else hb=-(O/100)-1;T=145*((O+100)/ +2)/100;ea&&d();break;case "angle":Ta=O;T=Ta/180;T+=0.5;T*=145;ea&&d()}if(T>145)T=145;else if(T<0)T=0;ja.css({"margin-left":T-5})}).change()});var ub=function(la){var ca=la.pageX-gb.offset.left-parseInt(gb.parent.css("border-left-width"));if(ca>145)ca=145;if(ca<=0)ca=0;var ja=ca-5;ca/=145;switch(gb.type){case "radius":ca=Math.pow(ca*2,2.5);if(ca>0.98&&ca<1.02)ca=1;if(ca<=0.01)ca=0.01;X.setAttribute("r",ca);break;case "opacity":q.paint.alpha=parseInt(ca*100);ta.setAttribute("fill-opacity",ca);break; case "ellip":Ma=hb=1;if(ca<0.5){ca/=0.5;hb=ca<=0?0.01:ca}else if(ca>0.5){ca/=0.5;ca=2-ca;Ma=ca<=0?0.01:ca}d();ca-=1;if(Ma===ca+1)ca=Math.abs(ca);break;case "angle":ca-=0.5;Ta=ca*=180;d();ca/=100}gb.elem.css({"margin-left":ja});ca=Math.round(ca*100);gb.input.val(ca);la.preventDefault()},vb=function(){S.unbind("mousemove",ub).unbind("mouseup",vb);gb=null};for(P=(q.paint.alpha*255/100).toString(16);P.length<2;)P="0"+P;P=P.split(".")[0];I=q.paint.solidColor=="none"?"":q.paint.solidColor+P;ra||(I=xa[0].getAttribute("stop-color")); $.extend($.fn.jPicker.defaults.window,{alphaSupport:true,effects:{type:"show",speed:0}});Y.jPicker({window:{title:B.window.pickerTitle},images:{clientPath:B.images.clientPath},color:{active:I,alphaSupport:true}},function(la){q.paint.type="solidColor";q.paint.alpha=la.val("ahex")?Math.round(la.val("a")/255*100):100;q.paint.solidColor=la.val("hex")?la.val("hex"):"none";q.paint.radialGradient=null;U()},null,function(){M()});var xb=$(J+" .jGraduate_tabs li");xb.on("click touchstart",function(){xb.removeClass("jGraduate_tab_current"); -$(this).addClass("jGraduate_tab_current");$(J+" > div").hide();var la=$(this).attr("data-type");$(J+" .jGraduate_gradPick").show();if(la==="rg"||la==="lg"){$(".jGraduate_"+la+"_field").show();$(".jGraduate_"+(la==="lg"?"rg":"lg")+"_field").hide();$("#"+o+"_jgraduate_rect")[0].setAttribute("fill","url(#"+o+"_"+la+"_jgraduate_grad)");ba=la==="lg"?"linearGradient":"radialGradient";$("#"+o+"_jGraduate_OpacInput").val(q.paint.alpha).change();var ca=$("#"+o+"_"+la+"_jgraduate_grad")[0];if(W!==ca){var ja= -$(W).find("stop");$(ca).empty().append(ja);W=ca;ca=tb.val();W.setAttribute("spreadMethod",ca)}kb=la==="rg"&&W.getAttribute("fx")!=null&&!(Ga==Da&&Ja==La);$("#"+o+"_jGraduate_focusCoord").toggle(kb);if(kb)$("#"+o+"_jGraduate_match_ctr")[0].checked=false}else{$(J+" .jGraduate_gradPick").hide();$(J+" .jGraduate_colPick").show()}});$(J+" > div").hide();xb.removeClass("jGraduate_tab_current");var Ab;switch(q.paint.type){case "linearGradient":Ab=$(J+" .jGraduate_tab_lingrad");break;case "radialGradient":Ab= +$(this).addClass("jGraduate_tab_current");$(J+" > div").hide();var la=$(this).attr("data-type");$(J+" .jGraduate_gradPick").show();if(la==="rg"||la==="lg"){$(".jGraduate_"+la+"_field").show();$(".jGraduate_"+(la==="lg"?"rg":"lg")+"_field").hide();$("#"+o+"_jgraduate_rect")[0].setAttribute("fill","url(#"+o+"_"+la+"_jgraduate_grad)");ba=la==="lg"?"linearGradient":"radialGradient";$("#"+o+"_jGraduate_OpacInput").val(q.paint.alpha).change();var ca=$("#"+o+"_"+la+"_jgraduate_grad")[0];if(X!==ca){var ja= +$(X).find("stop");$(ca).empty().append(ja);X=ca;ca=tb.val();X.setAttribute("spreadMethod",ca)}kb=la==="rg"&&X.getAttribute("fx")!=null&&!(Ga==Da&&Ja==La);$("#"+o+"_jGraduate_focusCoord").toggle(kb);if(kb)$("#"+o+"_jGraduate_match_ctr")[0].checked=false}else{$(J+" .jGraduate_gradPick").hide();$(J+" .jGraduate_colPick").show()}});$(J+" > div").hide();xb.removeClass("jGraduate_tab_current");var Ab;switch(q.paint.type){case "linearGradient":Ab=$(J+" .jGraduate_tab_lingrad");break;case "radialGradient":Ab= $(J+" .jGraduate_tab_radgrad");break;default:Ab=$(J+" .jGraduate_tab_color")}q.show();setTimeout(function(){Ab.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})();jQuery&&function(){var a=$(window),p=$(document);$.extend($.fn,{contextMenu:function(g,c){if(g.menu==undefined)return false;if(g.inSpeed==undefined)g.inSpeed=150;if(g.outSpeed==undefined)g.outSpeed=75;if(g.inSpeed==0)g.inSpeed=-1;if(g.outSpeed==0)g.outSpeed=-1;$(this).each(function(){var m=$(this),s=$(m).offset(),b=$("#"+g.menu);b.addClass("contextMenu");$(this).bind("mousedown",function(d){$(this).on("mouseup",function(k){var q=$(this);q.unbind("mouseup");$(".contextMenu").hide();if(d.button===2|| g.allowLeft||d.ctrlKey&&svgedit.browser.isMac())svgedit.browser.isTouch()||f(k,d,q)})});svgedit.browser.isTouch()&&$(this).bind("taphold",function(d){var k=$(this);k.unbind("mouseup");f(d,d,k)});var f=function(d,k,q){if(typeof k=="undefined")k=d;d.stopPropagation();if(m.hasClass("disabled")||k.altKey)return false;var B=d.pageX,o=d.pageY;if(svgedit.browser.isTouch()){B=d.originalEvent.touches[0].pageX;o=d.originalEvent.touches[0].pageY}d=a.width()-b.width();k=a.height()-b.height();if(B>d-15)B=d-15; if(o>k-30)o=k-30;if(svgedit.browser.isTouch())o-=b.height()/2;p.unbind("click");b.css({top:o,left:B}).fadeIn(g.inSpeed);b.find("A").mouseover(function(){b.find("LI.hover").removeClass("hover");$(this).parent().addClass("hover")}).mouseout(function(){b.find("LI.hover").removeClass("hover")});p.keypress(function(J){switch(J.keyCode){case 38:if(b.find("LI.hover").length){b.find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover");b.find("LI.hover").length||b.find("LI:last").addClass("hover")}else b.find("LI:last").addClass("hover"); @@ -64,7 +64,7 @@ function(){return false})});return $(this)},disableContextMenuItems:function(g){ 0,q="ontouchstart"in window,B=!!g.querySelector,o=!!document.evaluate,J=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","path");qa.setAttribute("d","M0,0 10,10");var ga=qa.pathSegList;qa=qa.createSVGPathSegLinetoAbs(5,5);try{ga.replaceItem(qa,0);return true}catch(ba){}return false}(),U=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","path");qa.setAttribute("d","M0,0 10,10");var ga=qa.pathSegList;qa=qa.createSVGPathSegLinetoAbs(5,5);try{ga.insertItemBefore(qa, 0);return true}catch(ba){}return false}(),M=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","svg"),ga=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(qa);ga.setAttribute("x",5);qa.appendChild(ga);var ba=document.createElementNS("http://www.w3.org/2000/svg","text");ba.textContent="a";ga.appendChild(ba);ga=ba.getStartPositionOfChar(0).x;document.documentElement.removeChild(qa);return ga===0}(),I=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg", "svg");document.documentElement.appendChild(qa);var ga=document.createElementNS("http://www.w3.org/2000/svg","path");ga.setAttribute("d","M0,0 C0,0 10,10 10,0");qa.appendChild(ga);ga=ga.getBBox();document.documentElement.removeChild(qa);return ga.height>4&&ga.height<5}(),S=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(qa);var ga=document.createElementNS("http://www.w3.org/2000/svg","path");ga.setAttribute("d","M0,0 10,0");var ba= -document.createElementNS("http://www.w3.org/2000/svg","path");ba.setAttribute("d","M5,0 15,0");var W=document.createElementNS("http://www.w3.org/2000/svg","g");W.appendChild(ga);W.appendChild(ba);qa.appendChild(W);ga=W.getBBox();document.documentElement.removeChild(qa);return ga.width==15}(),Y=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","rect");qa.setAttribute("x",0.1);(qa=qa.cloneNode(false).getAttribute("x").indexOf(",")==-1)||$.alert("NOTE: This version of Opera is known to contain bugs in SVG-edit.\n\t\tPlease upgrade to the latest version in which the problems have been fixed."); +document.createElementNS("http://www.w3.org/2000/svg","path");ba.setAttribute("d","M5,0 15,0");var X=document.createElementNS("http://www.w3.org/2000/svg","g");X.appendChild(ga);X.appendChild(ba);qa.appendChild(X);ga=X.getBBox();document.documentElement.removeChild(qa);return ga.width==15}(),Y=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","rect");qa.setAttribute("x",0.1);(qa=qa.cloneNode(false).getAttribute("x").indexOf(",")==-1)||$.alert("NOTE: This version of Opera is known to contain bugs in SVG-edit.\n\t\tPlease upgrade to the latest version in which the problems have been fixed."); return qa}(),P=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","rect");qa.setAttribute("style","vector-effect:non-scaling-stroke");return qa.style.vectorEffect==="non-scaling-stroke"}(),ia=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","rect").transform.baseVal,ga=g.createSVGTransform();qa.appendItem(ga);return qa.getItem(0)==ga}();svgedit.browser.isOpera=function(){return c};svgedit.browser.isWebkit=function(){return m};svgedit.browser.isGecko=function(){return s}; svgedit.browser.isIE=function(){return b};svgedit.browser.isChrome=function(){return f};svgedit.browser.isWindows=function(){return d};svgedit.browser.isMac=function(){return k};svgedit.browser.isTouch=function(){return q};svgedit.browser.supportsSelectors=function(){return B};svgedit.browser.supportsXpath=function(){return o};svgedit.browser.supportsPathReplaceItem=function(){return J};svgedit.browser.supportsPathInsertItemBefore=function(){return U};svgedit.browser.supportsPathBBox=function(){return I}; svgedit.browser.supportsHVLineContainerBBox=function(){return S};svgedit.browser.supportsGoodTextCharPos=function(){return M};svgedit.browser.supportsEditableText=function(){return c};svgedit.browser.supportsGoodDecimals=function(){return Y};svgedit.browser.supportsNonScalingStroke=function(){return P};svgedit.browser.supportsNativeTransformLists=function(){return ia}}else window.location="browser-not-supported.html"})();svgedit=svgedit||{}; @@ -200,8 +200,8 @@ true);a.appendChild(d);var k=f.createElementNS(c,"svg");(b.clearSvgContentElemen function(e){q=e};b.current_drawing_=new svgedit.draw.Drawing(k,q);var B=b.getCurrentDrawing=function(){return b.current_drawing_},o=1,J=null,U={shape:{fill:(m.initFill.color=="none"?"":"#")+m.initFill.color,fill_paint:null,fill_opacity:m.initFill.opacity,stroke:"#"+m.initStroke.color,stroke_paint:null,stroke_opacity:m.initStroke.opacity,stroke_width:m.initStroke.width,stroke_dasharray:"none",stroke_linejoin:"miter",stroke_linecap:"butt",opacity:m.initOpacity}};U.text=$.extend(true,{},U.shape);$.extend(U.text, {fill:"#000000",stroke_width:0,font_size:24,font_family:"Helvetica, Arial, sans-serif"});var M=U.shape,I=Array(1),S=this.addSvgElementFromJson=function(e){var h=svgedit.utilities.getElem(e.attr.id),l=B().getCurrentLayer();if(h&&e.element!=h.tagName){l.removeChild(h);h=null}if(!h){h=f.createElementNS(c,e.element);if(l)(J||l).appendChild(h)}e.curStyles&&svgedit.utilities.assignAttributes(h,{fill:M.fill,stroke:M.stroke,"stroke-width":M.stroke_width,"stroke-dasharray":M.stroke_dasharray,"stroke-linejoin":M.stroke_linejoin, "stroke-linecap":M.stroke_linecap,"stroke-opacity":M.stroke_opacity,"fill-opacity":M.fill_opacity,opacity:M.opacity/2,style:"pointer-events:inherit"},100);svgedit.utilities.assignAttributes(h,e.attr,100);svgedit.utilities.cleanupElement(h);return h},Y=b.getTransformList=svgedit.transformlist.getTransformList,P=svgedit.math.transformPoint,ia=b.matrixMultiply=svgedit.math.matrixMultiply,qa=b.hasMatrixTransform=svgedit.math.hasMatrixTransform,ga=b.transformListToTransform=svgedit.math.transformListToTransform, -ba=svgedit.math.snapToAngle,W=svgedit.math.getMatrix;svgedit.units.init({getBaseUnit:function(){return m.baseUnit},getElement:svgedit.utilities.getElem,getHeight:function(){return k.getAttribute("height")/o},getWidth:function(){return k.getAttribute("width")/o},getRoundDigits:function(){return hb.round_digits}});var ta=b.convertToNum=svgedit.units.convertToNum;svgedit.utilities.init({getDOMDocument:function(){return f},getDOMContainer:function(){return a},getSVGRoot:function(){return d},getSelectedElements:function(){return I}, -getSVGContent:function(){return k}});var ka=b.getUrlFromAttr=svgedit.utilities.getUrlFromAttr,da=b.getHref=svgedit.utilities.getHref,X=b.setHref=svgedit.utilities.setHref,Z=svgedit.utilities.getPathBBox;b.getBBox=svgedit.utilities.getBBox;var oa=b.getRotationAngle=svgedit.utilities.getRotationAngle,ra=b.getElem=svgedit.utilities.getElem,ma=b.assignAttributes=svgedit.utilities.assignAttributes,na=this.cleanupElement=svgedit.utilities.cleanupElement,Ca=svgedit.sanitize.getNSMap(),Ga=b.sanitizeSvg=svgedit.sanitize.sanitizeSvg, +ba=svgedit.math.snapToAngle,X=svgedit.math.getMatrix;svgedit.units.init({getBaseUnit:function(){return m.baseUnit},getElement:svgedit.utilities.getElem,getHeight:function(){return k.getAttribute("height")/o},getWidth:function(){return k.getAttribute("width")/o},getRoundDigits:function(){return hb.round_digits}});var ta=b.convertToNum=svgedit.units.convertToNum;svgedit.utilities.init({getDOMDocument:function(){return f},getDOMContainer:function(){return a},getSVGRoot:function(){return d},getSelectedElements:function(){return I}, +getSVGContent:function(){return k}});var ka=b.getUrlFromAttr=svgedit.utilities.getUrlFromAttr,da=b.getHref=svgedit.utilities.getHref,W=b.setHref=svgedit.utilities.setHref,Z=svgedit.utilities.getPathBBox;b.getBBox=svgedit.utilities.getBBox;var oa=b.getRotationAngle=svgedit.utilities.getRotationAngle,ra=b.getElem=svgedit.utilities.getElem,ma=b.assignAttributes=svgedit.utilities.assignAttributes,na=this.cleanupElement=svgedit.utilities.cleanupElement,Ca=svgedit.sanitize.getNSMap(),Ga=b.sanitizeSvg=svgedit.sanitize.sanitizeSvg, Ja=svgedit.history.MoveElementCommand,Da=svgedit.history.InsertElementCommand,La=svgedit.history.RemoveElementCommand,Oa=svgedit.history.ChangeElementCommand,Ba=svgedit.history.BatchCommand;b.undoMgr=new svgedit.history.UndoManager({handleHistoryEvent:function(e,h){var l=svgedit.history.HistoryEventTypes;if(e==l.BEFORE_UNAPPLY||e==l.BEFORE_APPLY)b.clearSelection();else if(e==l.AFTER_APPLY||e==l.AFTER_UNAPPLY){var z=h.elements();b.pathActions.clear();O("changed",z);z=h.type();l=e==l.AFTER_APPLY;if(z== Ja.type()){l=l?h.newParent:h.oldParent;l==k&&b.identifyLayers()}else if(z==Da.type()||z==La.type()){h.parent==k&&b.identifyLayers();if(z==Da.type())l&&Ua(h.elem);else l||Ua(h.elem);h.elem.tagName==="use"&&Nb(h.elem)}else if(z==Oa.type()){h.elem.tagName=="title"&&h.elem.parentNode.parentNode==k&&b.identifyLayers();l=l?h.newValues:h.oldValues;l.stdDeviation&&b.setBlurOffsets(h.elem.parentNode,l.stdDeviation);if(h.elem.tagName==="use"&&svgedit.browser.isWebkit()){z=h.elem;if(!z.getAttribute("x")&&!z.getAttribute("y")){l= z.parentNode;var v=z.nextSibling;l.removeChild(z);l.insertBefore(z,v)}}}}}});var za=function(e){b.undoMgr.addCommandToHistory(e)};svgedit.select.init(m,{createSVGElement:function(e){return b.addSvgElementFromJson(e)},svgRoot:function(){return d},svgContent:function(){return k},currentZoom:function(){return o},getStrokedBBox:function(e){return b.getStrokedBBox([e])}});var Ia=this.selectorManager=svgedit.select.getSelectorManager();svgedit.path.init({getCurrentZoom:function(){return o},getSVGRoot:function(){return d}}); @@ -246,7 +246,7 @@ null,v=null,G={},A={minx:null,miny:null,maxx:null,maxy:null};$(a).mousedown(func if(n=="rotate"){Fa="rotate";current_rotate_mode=jb(E,"dir")}else if(n=="resize"){Fa="resize";lb=jb(E,"dir")}E=I[0]}Ta=E.getAttribute("transform");n=Y(E);switch(Fa){case "select":Ma=true;lb="none";if(F)Ma=false;if(E!=d){if(I.indexOf(E)==-1){u.shiftKey||Qa(true);wb([E]);Cb=E;Ka.clear()}if(!F)for(F=0;F1))if(Ma)if(!(u.button===1||b.spaceKey)){var F=I[0],H=P(u.pageX,u.pageY, @@ -258,7 +258,7 @@ L),y:Math.min(v*o,N),width:Math.abs(L-z*o),height:Math.abs(N-v*o)},100);break;ca h-L;N=ll?l+N:l-N}if(u.altKey){C=h;w=l;N=Math.abs(x-C);n=u.shiftKey?N:Math.abs(y-w)}E.setAttributeNS(null,"rx",N);E.setAttributeNS(null,"ry",n);E.setAttributeNS(null,"cx",C);E.setAttributeNS(null,"cy",w);window.opera||d.unsuspendRedraw(L);break;case "fhellipse":case "fhrect":A.minx=Math.min(L,A.minx);A.maxx=Math.max(L,A.maxx);A.miny=Math.min(N,A.miny);A.maxy=Math.max(N,A.maxy);case "fhpath":e+=+L+","+N+" ";E.setAttributeNS(null,"points",e);break; case "path":case "pathedit":x*=o;y*=o;if(m.gridSnapping){x=xa(x);y=xa(y);h=xa(h);l=xa(l)}if(u.shiftKey){if(C=svgedit.path.path){E=C.dragging?C.dragging[0]:h;C=C.dragging?C.dragging[1]:l}else{E=h;C=l}w=ba(E,C,x,y);x=w.x;y=w.y}if(ua&&ua.getAttribute("display")!=="none"){L*=o;N*=o;ma(ua,{x:Math.min(z*o,L),y:Math.min(v*o,N),width:Math.abs(L-z*o),height:Math.abs(N-v*o)},100)}Ka.mouseMove(u,x,y);break;case "textedit":x*=o;y*=o;ib.mouseMove(D,H);break;case "rotate":L=svgedit.utilities.getBBox(F);C=L.x+L.width/ -2;w=L.y+L.height/2;E=W(F);E=P(C,w,E);C=E.x;w=E.y;E=L.x;N=L.y;if(current_rotate_mode=="nw")E=L.x+L.width;if(current_rotate_mode=="se")N=L.y+L.height;if(current_rotate_mode=="sw"){E=L.x+L.width;N=L.y+L.height}compensation_angle=(Math.atan2(w-N,C-E)*(180/Math.PI)-90)%360;Q=(Math.atan2(w-y,C-x)*(180/Math.PI)-90)%360;Q+=compensation_angle;if(m.gridSnapping)Q=xa(Q);if(u.shiftKey)Q=Math.round(Q/45)*45;b.setRotationAngle(Q<-180?360+Q:Q,true);O("transition",I)}pb("mouseMove",{event:u,mouse_x:D,mouse_y:H,selected:F})}}).click(function(u){u.preventDefault(); +2;w=L.y+L.height/2;E=X(F);E=P(C,w,E);C=E.x;w=E.y;E=L.x;N=L.y;if(current_rotate_mode=="nw")E=L.x+L.width;if(current_rotate_mode=="se")N=L.y+L.height;if(current_rotate_mode=="sw"){E=L.x+L.width;N=L.y+L.height}compensation_angle=(Math.atan2(w-N,C-E)*(180/Math.PI)-90)%360;Q=(Math.atan2(w-y,C-x)*(180/Math.PI)-90)%360;Q+=compensation_angle;if(m.gridSnapping)Q=xa(Q);if(u.shiftKey)Q=Math.round(Q/45)*45;b.setRotationAngle(Q<-180?360+Q:Q,true);O("transition",I)}pb("mouseMove",{event:u,mouse_x:D,mouse_y:H,selected:F})}}).click(function(u){u.preventDefault(); return false}).dblclick(function(u){var F=u.target.parentNode;if(F!==J){var H=Kb(u),D=H.tagName;if(D==="text"&&Fa!=="textedit"){u=P(u.pageX,u.pageY,sb);ib.select(H,u.x,u.y)}if((D==="g"||D==="a")&&oa(H)){Ib(H);H=I[0];Qa(true)}J&&Lb();F.tagName!=="g"&&F.tagName!=="a"||F===B().getCurrentLayer()||H===Ia.selectorParentGroup||Sb(H)}}).mouseup(function(u){b.addClone=false;window.removeEventListener("keyup",b.removeClone);if(u.button!==2){var F=Cb;Cb=null;if(Ma){var H=P(u.pageX,u.pageY,sb),D=H.x*o;H=H.y* o;var E=D/o,L=H/o,N=ra(ca()),n=false;Ma=false;switch(Fa){case "resize":case "multiselect":if(ua!=null){ua.setAttribute("display","none");nb=[]}Fa="select";case "select":if(I[0]!=null){if(I[1]==null){D=I[0];switch(D.tagName){case "g":case "use":case "image":case "foreignObject":break;default:bb.fill=D.getAttribute("fill");bb.fill_opacity=D.getAttribute("fill-opacity");bb.stroke=D.getAttribute("stroke");bb.stroke_opacity=D.getAttribute("stroke-opacity");bb.stroke_width=D.getAttribute("stroke-width"); bb.stroke_dasharray=D.getAttribute("stroke-dasharray");bb.stroke_linejoin=D.getAttribute("stroke-linejoin");bb.stroke_linecap=D.getAttribute("stroke-linecap")}if(D.tagName=="text"){Ya.font_size=D.getAttribute("font-size");Ya.font_family=D.getAttribute("font-family")}Ia.requestSelector(D).showGrips(true)}Ha();if(E!=z||L!=v){u=I.length;for(D=0;D1)){var aa=v(Q,V);z(aa.x,aa.y)}},mouseUp:function(Q,V,aa){var fa=v(V,aa);z(fa.x,fa.y,true);Q.target!==F&&VC-2&&aaK-2&&ib.toSelectMode(true)},setCursor:e,toEditMode:function(Q,V){R=false;Fa="textedit";Ia.requestSelector(F).showGrips(false);Ia.requestSelector(F);ib.init();$(F).css("cursor","text");if(arguments.length){var aa= v(Q,V);e(l(aa.x,aa.y))}else e();setTimeout(function(){R=true},300)},toSelectMode:function(Q){Fa="select";clearInterval(L);L=null;E&&$(E).attr("display","none");D&&$(D).attr("visibility","hidden");$(F).css("cursor","move");if(Q){Qa();$(F).css("cursor","move");O("selected",[F]);wb([F],true)}F&&!F.textContent.length&&b.deleteSelectedElements();$(H).blur();F=false},setInputElem:function(Q){H=Q},clear:function(){Fa=="textedit"&&ib.toSelectMode()},init:function(){if(F){if(!F.parentNode){F=I[0];Ia.requestSelector(F).showGrips(false)}var Q= -F.textContent.length,V=F.getAttribute("transform");n=svgedit.utilities.getBBox(F);w=V?W(F):null;N=Array(Q);H.focus();$(F).unbind("dblclick",u).dblclick(u);if(!Q)var aa={x:n.x+n.width/2,width:0};for(V=0;V=0&&this.selected_pts.push(F)}this.selected_pts.sort();u=this.selected_pts.length; for(A=Array(u);u--;){H=this.segs[this.selected_pts[u]];H.select(true);A[u]=H.ptgrip}Ka.canDeleteNodes=true;Ka.closed_subpath=this.subpathIsClosed(this.selected_pts[0]);O("selected",A)};var v=h=null,G=false;return{mouseDown:function(A,u,F,H){if(Fa==="path"){mouse_x=F;mouse_y=H;H=mouse_x/o;u=mouse_y/o;F=ra("path_stretch_line");l=[H,u];if(m.gridSnapping){H=xa(H);u=xa(u);mouse_x=xa(mouse_x);mouse_y=xa(mouse_y)}if(!F){F=document.createElementNS(c,"path");ma(F,{id:"path_stretch_line",stroke:"#22C","stroke-width":"0.5", fill:"none"});F=ra("selectorParentGroup").appendChild(F)}F.setAttribute("display","inline");var D=null;if(v){D=v.pathSegList;for(var E=D.numberOfItems,L=6/o,N=false;E;){E--;var n=D.getItem(E),w=n.x;n=n.y;if(H>=w-L&&H<=w+L&&u>=n-L&&u<=n+L){N=true;break}}L=ca();svgedit.path.removePath_(L);L=ra(L);w=D.numberOfItems;if(N){if(E<=1&&w>=2){H=D.getItem(0).x;u=D.getItem(0).y;A=F.pathSegList.getItem(1);A=A.pathSegType===4?v.createSVGPathSegLinetoAbs(H,u):v.createSVGPathSegCurvetoCubicAbs(H,u,A.x1/o,A.y1/o, @@ -320,7 +320,7 @@ G.find("linearGradient, radialGradient, pattern").appendTo(mb());Nb(G);Pb(G[0]); ja()});if(F){var D=getStrokedBBox();u.width=D.width+D.x;u.height=D.height+D.y}if(u.width<=0)u.width=100;if(u.height<=0)u.height=100;G.attr(u);this.contentW=u.width;this.contentH=u.height;l.addSubCommand(new Da(k));var E=G.attr(["width","height"]);l.addSubCommand(new Oa(d,E));o=1;svgedit.transformlist.resetListMap();Qa();svgedit.path.clearData();d.appendChild(Ia.selectorParentGroup);za(l);O("changed",[k])}catch(L){console.log(L);return false}return true};this.importSvgString=function(e){try{var h= svgedit.utilities.encode64(e.length+e).substr(0,32),l=false;if(tb[h])if($(tb[h].symbol).parents("#svgroot").length)l=true;var z=new Ba("Import SVG");if(l)var v=tb[h].symbol,G=tb[h].xform;else{var A=svgedit.utilities.text2xml(e);this.prepareSvg(A);var u;u=f.adoptNode?f.adoptNode(A.documentElement):f.importNode(A.documentElement,true);Ob(u);var F=ta("width",u.getAttribute("width")),H=ta("height",u.getAttribute("height")),D=u.getAttribute("viewBox"),E=D?D.split(" "):[0,0,F,H];for(e=0;e<4;++e)E[e]=+E[e]; k.getAttribute("width");var L=+k.getAttribute("height");G=H>F?"scale("+L/3/E[3]+")":"scale("+L/3/E[2]+")";G="translate(0) "+G+" translate(0)";v=f.createElementNS(c,"symbol");var N=mb();for(svgedit.browser.isGecko()&&$(u).find("linearGradient, radialGradient, pattern").appendTo(N);u.firstChild;)v.appendChild(u.firstChild);var n=u.attributes;for(u=0;u=0&&el){if(e=0){var u=getStrokedBBox([A]);b.moveSelectedElements((e==="x"?h-u.x:0)*o,(e==="y"?h-u.y:0)*o,true)}else{u=e==="#text"?A.textContent:A.getAttribute(e);if(u==null)u="";if(u!==String(h)){if(e=="#text"){svgedit.utilities.getBBox(A);A.textContent=h}else e=="#href"?X(A,h):A.setAttribute(e,h);I.indexOf(A)>=0&&setTimeout(function(){A.parentNode&&Ia.requestSelector(A).resize()},0);u=oa(A);if(u!=0&&e!="transform")for(var F= +e!=="#text"&&A.textContent.length&&ib.toSelectMode(A);if((e==="x"||e==="y")&&G.indexOf(A.tagName)>=0){var u=getStrokedBBox([A]);b.moveSelectedElements((e==="x"?h-u.x:0)*o,(e==="y"?h-u.y:0)*o,true)}else{u=e==="#text"?A.textContent:A.getAttribute(e);if(u==null)u="";if(u!==String(h)){if(e=="#text"){svgedit.utilities.getBBox(A);A.textContent=h}else e=="#href"?W(A,h):A.setAttribute(e,h);I.indexOf(A)>=0&&setTimeout(function(){A.parentNode&&Ia.requestSelector(A).resize()},0);u=oa(A);if(u!=0&&e!="transform")for(var F= Y(A),H=F.numberOfItems;H--;)if(F.getItem(H).type==4){F.removeItem(H);var D=svgedit.utilities.getBBox(A),E=P(D.x+D.width/2,D.y+D.height/2,ga(F).matrix);D=E.x;E=E.y;var L=d.createSVGTransform();L.setRotate(u,D,E);F.insertItemBefore(L,H);break}}}}}d.unsuspendRedraw(z)},db=this.changeSelectedAttribute=function(e,h,l){l=l||I;b.undoMgr.beginUndoableChange(e,l);Db(e,h,l);e=b.undoMgr.finishUndoableChange();e.isEmpty()||za(e)};this.deleteSelectedElements=function(){for(var e=new Ba("Delete Elements"),h=I.length, l=[],z=0;z1)l=arguments[1];break;default:e="g";h="Group Elements"}h=new Ba(h);var z=S({element:e,attr:{id:ja()}});e==="a"&&X(z,l);h.addSubCommand(new Da(z));for(l=I.length;l--;){var v=I[l];if(v!=null){if(v.parentNode.tagName==="a"&&v.parentNode.childNodes.length===1)v=v.parentNode;var G=v.nextSibling,A=v.parentNode;z.appendChild(v);h.addSubCommand(new Ja(v, +100);za(z);O("changed",l)}};this.groupSelectedElements=function(e){e||(e="g");var h="";switch(e){case "a":h="Make hyperlink";var l="";if(arguments.length>1)l=arguments[1];break;default:e="g";h="Group Elements"}h=new Ba(h);var z=S({element:e,attr:{id:ja()}});e==="a"&&W(z,l);h.addSubCommand(new Da(z));for(l=I.length;l--;){var v=I[l];if(v!=null){if(v.parentNode.tagName==="a"&&v.parentNode.childNodes.length===1)v=v.parentNode;var G=v.nextSibling,A=v.parentNode;z.appendChild(v);h.addSubCommand(new Ja(v, G,A))}}h.isEmpty()||za(h);Bb([z],true)};var Ib=this.pushGroupProperties=function(e,h){var l=e.childNodes,z=l.length,v=e.getAttribute("transform"),G=Y(e),A=ga(G).matrix,u=new Ba("Push group properties"),F=0,H=oa(e),D=$(e).attr(["filter","opacity"]),E,L;for(F=0;Fv)v=l[D].x+l[D].width;if(l[D].y+l[D].height>A)A=l[D].y+l[D].height}}if(h=="page"){G=z=0;v=b.contentW;A=b.contentH}u=Array(H);F=Array(H);for(D=0;D=z.length)e=0;else if(e<0)e=z.length-1;l=z[e];break}Bb([l],true);O("selected", +z.setAttribute("fill",e);if(h){if(!v){v=f.createElementNS(c,"image");ma(v,{id:"background_image",width:"100%",height:"100%",preserveAspectRatio:"xMinYMin",style:"pointer-events:none"})}W(v,h);l.appendChild(v)}else v&&v.parentNode.removeChild(v)};this.cycleElement=function(e){var h=I[0],l=false,z=vb(J||B().getCurrentLayer());if(z.length){if(h==null){e=e?z.length-1:0;l=z[e]}else for(var v=z.length;v--;)if(z[v]==h){e=e?v-1:v+1;if(e>=z.length)e=0;else if(e<0)e=z.length-1;l=z[e];break}Bb([l],true);O("selected", I)}};this.clear();this.getPrivateMethods=function(){return{addCommandToHistory:za,setGradient:Rb,addSvgElementFromJson:S,assignAttributes:ma,BatchCommand:Ba,call:O,ChangeElementCommand:Oa,copyElem:la,ffClone:ea,findDefs:mb,findDuplicateGradient:Qb,getElem:ra,getId:ca,getIntersectionList:ub,getMouseTarget:Kb,getNextId:ja,getPathBBox:Z,getUrlFromAttr:ka,hasMatrixTransform:qa,identifyLayers:Gb,InsertElementCommand:Da,isIdentity:svgedit.math.isIdentity,logMatrix:Xa,matrixMultiply:ia,MoveElementCommand:Ja, preventClickDefault:qb,recalculateAllSelectedDimensions:Ha,recalculateDimensions:Wa,remapElement:fb,RemoveElementCommand:La,removeUnusedDefElems:Mb,round:gb,runExtensions:pb,sanitizeSvg:Ga,SVGEditTransformList:svgedit.transformlist.SVGTransformList,toString:toString,transformBox:svgedit.math.transformBox,transformListToTransform:ga,transformPoint:P,walkTree:svgedit.utilities.walkTree}}};(function(){document.addEventListener("touchstart",touchHandler,true);document.addEventListener("touchmove",touchHandler,true);document.addEventListener("touchend",touchHandler,true);document.addEventListener("touchcancel",touchHandler,true);if(!window.svgEditor)window.svgEditor=function(a){function p(d,k){var q=g.setSvgString(d)!==false;k=k||a.noop;q?k(true):a.alert(uiStrings.notification.errorLoadingSVG,function(){k(false)})}var g,c={},m=false;curConfig={canvas_expansion:1,dimensions:[580,400], initFill:{color:"fff",opacity:1},initStroke:{width:1.5,color:"000",opacity:1},initOpacity:1,imgPath:"images/",extPath:"extensions/",jGraduatePath:"jgraduate/images/",extensions:[],initTool:"select",wireframe:false,colorPickerCSS:false,gridSnapping:false,gridColor:"#000",baseUnit:"px",snappingStep:10,showRulers:svgedit.browser.isTouch()?false:true,show_outside_canvas:false,no_save_warning:true,initFont:"Helvetica, Arial, sans-serif"};uiStrings=c.uiStrings={common:{ok:"OK",cancel:"Cancel",key_up:"Up", @@ -394,29 +394,29 @@ function(n){a("#base_unit_container").css({top:n.pageY-10,left:n.pageX-50,displa 0;var B=navigator.userAgent.indexOf("AppleWebKit")>=0,o=q?"meta+":"ctrl+",J=g.pathActions,U=g.undoMgr,M=svgedit.utilities,I=curConfig.imgPath+"placeholder.svg",S=a("#workarea"),Y=a("#cmenu_canvas"),P=null,ia=1,qa="toolbars",ga="";q||a(".shortcut").each(function(){var n=a(this).text();a(this).text(n.split("\u2318").join("Ctrl+"))});(function(){a("#dialog_container").draggable({cancel:"#dialog_content, #dialog_buttons *",containment:"window"});var n=a("#dialog_box"),w=a("#dialog_buttons"),C=function(K, R,Q,V){a("#dialog_content").html("

    "+R.replace(/\n/g,"

    ")+"

    ").toggleClass("prompt",K=="prompt");w.empty();var aa=a('').appendTo(w);K!="alert"&&a('').appendTo(w).on("click, touchstart",function(){n.hide();Q(false)});if(K=="prompt"){var fa=a('').prependTo(w);fa.val(V||"");fa.bind("keydown","return",function(){aa.trigger("click touchstart")})}K=="process"&&aa.hide(); n.show();aa.on("click touchstart",function(){n.hide();var pa=K=="prompt"?fa.val():true;Q&&Q(pa)}).focus();K=="prompt"&&fa.focus()};a.alert=function(K,R){C("alert",K,R)};a.confirm=function(K,R){C("confirm",K,R)};a.process_cancel=function(K,R){C("process",K,R)};a.prompt=function(K,R,Q){C("prompt",K,Q,R)}})();var ba=function(){var n=a(".tool_button_current");if(n.length&&n[0].id!=="tool_select"){n.removeClass("tool_button_current").addClass("tool_button");a("#tool_select").addClass("tool_button_current").removeClass("tool_button")}g.setMode("select")}, -W=null,ta=false,ka=false,da="",X=function(n,w){var C=g.getResolution();a("#svgcanvas").position();var K=g.setBBoxZoom(w,S.width()-15,S.height()-15);if(K){var R=K.zoom;K=K.bbox;if(R<0.0010)xa({value:0.1});else{var Q=Date.now(),V=R-C.zoom;a("#zoom");var aa=C.zoom,fa=function(pa){pa=(pa-Q)/500;pa=Math.pow(pa-1,3)+1;g.setZoom(aa+V*pa);H();pa<1?requestAnimationFrame(fa):a("#zoom").val(R*100)};fa(Date.now());g.getMode()=="zoom"&&K.width&&ba();mb()}}};a("#cur_context_panel").delegate("a","click",function(){var n= +X=null,ta=false,ka=false,da="",W=function(n,w){var C=g.getResolution();a("#svgcanvas").position();var K=g.setBBoxZoom(w,S.width()-15,S.height()-15);if(K){var R=K.zoom;K=K.bbox;if(R<0.0010)xa({value:0.1});else{var Q=Date.now(),V=R-C.zoom;a("#zoom");var aa=C.zoom,fa=function(pa){pa=(pa-Q)/500;pa=Math.pow(pa-1,3)+1;g.setZoom(aa+V*pa);H();pa<1?requestAnimationFrame(fa):a("#zoom").val(R*100)};fa(Date.now());g.getMode()=="zoom"&&K.width&&ba();mb()}}};a("#cur_context_panel").delegate("a","click",function(){var n= a(this);n.attr("data-root")?g.leaveContext():g.setContext(n.text());return false});var Z=function(){c.paintBox.fill.prep();c.paintBox.stroke.prep()},oa={},ra=function(n){a.each(n,function(w,C){var K=a(w).children(),R=w+"_show",Q=a(R),V=false;K.addClass("tool_button").unbind("click mousedown mouseup").each(function(pa){var sa=C[pa];oa[sa.sel]=sa.fn;if(sa.isDefault)V=pa;pa=function(Za){var Aa=sa;if(Za.type==="keydown"){var ha=a(Aa.parent+"_show").hasClass("tool_button_current"),eb=a(Aa.parent+"_show").attr("data-curopt"); a.each(n[sa.parent],function(va,Na){if(Na.sel==eb)Aa=!Za.shiftKey||!ha?Na:n[sa.parent][va+1]||n[sa.parent][0]})}if(a(this).hasClass("disabled"))return false;$a(R)&&Aa.fn();var Ra=Aa.icon?a.getSvgIcon(Aa.icon,true):a(Aa.sel).children().eq(0).clone();Ra[0].setAttribute("width",Q.width());Ra[0].setAttribute("height",Q.height());Q.children(":not(.flyout_arrow_horiz)").remove();Q.append(Ra).attr("data-curopt",Aa.sel)};a(this).mouseup(pa);sa.key&&a(document).bind("keydown",sa.key[0]+" shift+"+sa.key[0], pa)});if(V)Q.attr("data-curopt",C[V].sel);else Q.attr("data-curopt")||Q.attr("data-curopt",C[0].sel);var aa,fa=a(R).position();a(w).css({left:fa.left+34,top:fa.top+77});Q.mousedown(function(pa){a("#tools_shapelib").is(":visible")&&$a(R,false);if(Q.hasClass("disabled"))return false;var sa=a(w),Za=fa.left+34,Aa=sa.width()*-1,ha=sa.data("shown_popop")?200:0;aa=setTimeout(function(){Q.data("isLibrary")?sa.css("left",Za).show():sa.css("left",Aa).show().animate({left:Za},150);sa.data("shown_popop",true)}, ha);pa.preventDefault()}).mouseup(function(){clearTimeout(aa);var pa=a(this).attr("data-curopt");if(Q.data("isLibrary")&&a(R.replace("_show","")).is(":visible"))$a(R,true);else $a(R)&&pa in oa&&oa[pa]()})});Ca()},ma=function(n,w){return a("
    ",{"class":"tools_flyout",id:n}).appendTo("#svg_editor").append(w)},na=function(){a(".tools_flyout").each(function(){var n=a("#"+this.id+"_show"),w=n.offset();n=n.outerWidth();a(this).css({left:(w.left+n)*ia,top:w.top})})},Ca=function(){a(".tools_flyout").each(function(){var n= a("#"+this.id+"_show");if(!n.data("isLibrary")){var w=[];a(this).children().each(function(){w.push(this.title)});n[0].title=w.join(" / ")}})},Ga,Ja=function(n,w,C){var K=null;if(n.indexOf("url(#")===0){n=(n=g.getRefElem(n))?n.cloneNode(true):a("#"+C+"_color defs *")[0];K={alpha:w};K[n.tagName]=n}else K=n.indexOf("#")===0?{alpha:w,solidColor:n.substr(1)}:{alpha:w,solidColor:"none"};return new a.jGraduate.Paint(K)},Da=g.getResolution();if(curConfig.baseUnit!=="px"){Da.w=svgedit.units.convertUnit(Da.w)+ curConfig.baseUnit;Da.h=svgedit.units.convertUnit(Da.h)+curConfig.baseUnit}var La=function(n){g.createLayer("background");cur_shape=g.addSvgElementFromJson({element:"rect",attr:{x:-1,y:-1,width:Da.w+2,height:Da.h+2,stroke:"none",id:"canvas_background",opacity:1,fill:n||"#fff",style:"pointer-events:none"}});g.setCurrentLayer("Layer 1");g.setCurrentLayerPosition("1")};document.getElementById("canvas_background")||La();document.getElementById("canvas_background").getAttribute("fill");var Oa=c.setImageURL= -function(n){n||(n=I);g.setImageURL(n);a("#image_url").val(n)},Ba=function(){var n=W;if(n!=null&&!n.parentNode)n=null;if(ta&&ta[0]!=null&&!ta[0].parentNode)ta=false;var w=g.getCurrentDrawing().getCurrentLayerName(),C=g.getMode(),K=curConfig.baseUnit!=="px"?curConfig.baseUnit:null,R=C=="pathedit",Q=a("#cmenu_canvas li");a(".context_panel").hide();a(".menu_item","#edit_menu").addClass("disabled");a(".menu_item","#object_menu").addClass("disabled");if(ta)(n=g.elementsAreSame(ta)?ta[0]:null)&&a("#tools_top").addClass("multiselected"); +function(n){n||(n=I);g.setImageURL(n);a("#image_url").val(n)},Ba=function(){var n=X;if(n!=null&&!n.parentNode)n=null;if(ta&&ta[0]!=null&&!ta[0].parentNode)ta=false;var w=g.getCurrentDrawing().getCurrentLayerName(),C=g.getMode(),K=curConfig.baseUnit!=="px"?curConfig.baseUnit:null,R=C=="pathedit",Q=a("#cmenu_canvas li");a(".context_panel").hide();a(".menu_item","#edit_menu").addClass("disabled");a(".menu_item","#object_menu").addClass("disabled");if(ta)(n=g.elementsAreSame(ta)?ta[0]:null)&&a("#tools_top").addClass("multiselected"); if(!n&&!ta){a("#tools_top").removeClass("multiselected");a("#stroke_panel").hide();a("#canvas_panel").show()}if(n!=null){a("#stroke_panel").show();var V=n.nodeName,aa=g.getRotationAngle(n);a("#angle").val(Math.round(aa));aa=g.getBlur(n);a("#blur").val(aa);if(!R&&C!="pathedit"){a("#selected_panel").show();a(".action_selected").removeClass("disabled");var fa,pa;if(["g","polyline","path"].indexOf(V)>=0)if(C=g.getStrokedBBox([n])){fa=C.x;pa=C.y}if(K){fa=svgedit.units.convertUnit(fa);pa=svgedit.units.convertUnit(pa)}a("#"+ V+"_x").val(Math.round(fa));a("#"+V+"_y").val(Math.round(pa));["image","text","path","g","use"].indexOf(V)==-1&&a(".action_path_convert_selected").removeClass("disabled");V==="path"&&a(".action_path_selected").removeClass("disabled")}else{a("#path_node_panel").show();a("#stroke_panel").hide();w=J.getNodePoint();a("#tool_add_subpath").removeClass("push_button_pressed").addClass("tool_button");a("#tool_node_delete").toggleClass("disabled",!J.canDeleteNodes);db("#tool_openclose_path",J.closed_subpath? "open_path":"close_path");if(w){R=a("#seg_type");if(K){w.x=svgedit.units.convertUnit(w.x);w.y=svgedit.units.convertUnit(w.y)}a("#path_node_x").val(Math.round(w.x));a("#path_node_y").val(Math.round(w.y));w.type?R.val(w.type).removeAttr("disabled"):R.val(4).attr("disabled","disabled")}return}K=null;if(sa==="a"){K=g.getHref(n);a("#g_panel").show()}if(n.parentNode.tagName==="a")if(!a(n).siblings().length){a("#a_panel").show();K=g.getHref(n.parentNode)}a("#tool_make_link, #tool_make_link").toggle(!K); -K&&a("#link_url").val(K);K={g:[],a:[],rect:["rx","width","height","x","y"],image:["width","height","x","y"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],line:["x1","y1","x2","y2"],text:["x","y"],use:[]};var sa=n.tagName;a(n).data("gsvg")&&a("#g_panel").show();sa=="path"&&a("#path_panel").show();if(K[sa]){K=K[sa];a("#"+sa+"_panel").show();sa=="rect"?a("#cornerRadiusLabel").show():a("#cornerRadiusLabel").hide();a.each(K,function(Za,Aa){var ha=n.getAttribute(Aa);if(curConfig.baseUnit!=="px"&& -n[Aa])ha=svgedit.units.convertUnit(n[Aa].baseVal.value);var eb=document.getElementById(sa+"_"+Aa);eb.value=Math.round(ha)||0;eb.getAttribute("data-cursor")==="true"&&a.fn.dragInput.updateCursor(eb)});if(sa=="text"){a("#text_panel").css("display","inline");g.getItalic()?a("#tool_italic").addClass("push_button_pressed").removeClass("tool_button"):a("#tool_italic").removeClass("push_button_pressed").addClass("tool_button");g.getBold()?a("#tool_bold").addClass("push_button_pressed").removeClass("tool_button"): +K&&a("#link_url").val(K);K={g:[],a:[],rect:["rx","width","height","x","y"],image:["width","height","x","y"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],line:["x1","y1","x2","y2"],text:["x","y"],use:[],path:[]};var sa=n.tagName;a(n).data("gsvg")&&a("#g_panel").show();sa=="path"&&a("#path_panel").show();if(K[sa]){K=K[sa];a("#"+sa+"_panel").show();sa=="rect"?a("#cornerRadiusLabel").show():a("#cornerRadiusLabel").hide();a.each(K,function(Za,Aa){var ha=n.getAttribute(Aa);if(curConfig.baseUnit!== +"px"&&n[Aa])ha=svgedit.units.convertUnit(n[Aa].baseVal.value);var eb=document.getElementById(sa+"_"+Aa);eb.value=Math.round(ha)||0;eb.getAttribute("data-cursor")==="true"&&a.fn.dragInput.updateCursor(eb)});if(sa=="text"){a("#text_panel").css("display","inline");g.getItalic()?a("#tool_italic").addClass("push_button_pressed").removeClass("tool_button"):a("#tool_italic").removeClass("push_button_pressed").addClass("tool_button");g.getBold()?a("#tool_bold").addClass("push_button_pressed").removeClass("tool_button"): a("#tool_bold").removeClass("push_button_pressed").addClass("tool_button");a("#font_family").val(n.getAttribute("font-family"));a("#font_size").val(n.getAttribute("font-size"));a("#text").val(n.textContent);g.addedNew&&setTimeout(function(){a("#text").focus().select()},100)}else if(sa=="image")Oa(g.getHref(n));else if(sa==="g"||sa==="use"){a("#container_panel").show();a(".action_group_selected").removeClass("disabled");g.getTitle()}}Q[(sa==="g"?"en":"dis")+"ableContextMenuItems"]("#ungroup");Q[(sa=== "g"||!ta?"dis":"en")+"ableContextMenuItems"]("#group")}else if(ta){a("#multiselected_panel").show();a(".action_multi_selected").removeClass("disabled");Q.enableContextMenuItems("#group").disableContextMenuItems("#ungroup")}else Q.disableContextMenuItems("#delete,#cut,#copy,#group,#ungroup,#move_front,#move_up,#move_down,#move_back");U.getUndoStackSize()>0?a("#tool_undo").removeClass("disabled"):a("#tool_undo").addClass("disabled");U.getRedoStackSize()>0?a("#tool_redo").removeClass("disabled"):a("#tool_redo").addClass("disabled"); -g.addedNew=false;if(n&&!R||ta){a("#selLayerNames").removeAttr("disabled").val(w);Y.enableContextMenuItems("#delete,#cut,#copy,#move_front,#move_up,#move_down,#move_back")}};a("#text").on("focus",function(){});a("#text").on("blur",function(){});g.bind("selected",function(n,w){var C=g.getMode();C==="select"&&ba();C=C=="pathedit";W=w.length==1||w[1]==null?w[0]:null;ta=w.length>=2&&w[1]!=null?w:false;if(W!=null)if(!C){if(W!=null)switch(W.tagName){case "use":case "image":case "foreignObject":break;case "g":case "a":for(var K= -null,R=W.getElementsByTagName("*"),Q=0,V=R.length;Q=2&&w[1]!=null?w:null;if(!ta)switch(C){case "rotate":C=g.getRotationAngle(K);a("#angle").val(Math.round(C));rotateCursor(C);a("#tool_reorient").toggleClass("disabled", -C==0)}g.runExtensions("elementTransition",{elems:w})}});g.bind("changed",function(n,w){var C=g.getMode();C==="select"&&ba();for(var K=0;K\n'+w;var C=navigator.userAgent;if(~C.indexOf("Chrome")&& +g.addedNew=false;if(n&&!R||ta){a("#selLayerNames").removeAttr("disabled").val(w);Y.enableContextMenuItems("#delete,#cut,#copy,#move_front,#move_up,#move_down,#move_back")}};a("#text").on("focus",function(){});a("#text").on("blur",function(){});g.bind("selected",function(n,w){var C=g.getMode();C==="select"&&ba();C=C=="pathedit";X=w.length==1||w[1]==null?w[0]:null;ta=w.length>=2&&w[1]!=null?w:false;if(X!=null)if(!C){if(X!=null)switch(X.tagName){case "use":case "image":case "foreignObject":break;case "g":case "a":for(var K= +null,R=X.getElementsByTagName("*"),Q=0,V=R.length;Q=2&&w[1]!=null?w:null;if(!ta)switch(C){case "rotate":C=g.getRotationAngle(K);a("#angle").val(Math.round(C));rotateCursor(C);a("#tool_reorient").toggleClass("disabled", +C==0)}g.runExtensions("elementTransition",{elems:w})}});g.bind("changed",function(n,w){var C=g.getMode();C==="select"&&ba();for(var K=0;K\n'+w;var C=navigator.userAgent;if(~C.indexOf("Chrome")&& a.browser.version>=533||~C.indexOf("MSIE"))Rb(0,true);else{var K=n.open("data:image/svg+xml;base64,"+M.encode64(w)),R=a.pref("save_notice_done");if(R!=="all"){var Q=uiStrings.notification.saveFromBrowser.replace("%s","SVG");if(C.indexOf("Gecko/")!==-1)if(w.indexOf("",{id:"export_canvas"}).hide().appendTo("body");var K=a("#export_canvas")[0];K.width=g.contentW;K.height=g.contentH;canvg(K,w.svg,{renderCallback:function(){var R=K.toDataURL("image/png");P.location.href=R;if(a.pref("export_notice_done")!=="all"){R=uiStrings.notification.saveFromBrowser.replace("%s","PNG");if(C.length)R+="\n\n"+uiStrings.notification.noteTheseIssues+"\n \u2022 "+C.join("\n \u2022 ");a.pref("export_notice_done","all");P.alert(R)}}})}); -g.bind("zoomed",X);g.bind("contextset",function(n,w){var C="";if(w){var K="";C=''+g.getCurrentDrawing().getCurrentLayerName()+"";a(w).parentsUntil("#svgcontent > g").andSelf().each(function(){if(this.id){K+=" > "+this.id;C+=this!==w?' > '+this.id+"":" > "+this.id}});da=K}else da=null;a("#cur_context_panel").toggle(!!w).html(C);Db()});g.bind("extension_added",function(n,w){function C(){if(Ga){clearTimeout(Ga);Ga=null}R||(Ga=setTimeout(function(){R=true; +g.bind("zoomed",W);g.bind("contextset",function(n,w){var C="";if(w){var K="";C=''+g.getCurrentDrawing().getCurrentLayerName()+"";a(w).parentsUntil("#svgcontent > g").andSelf().each(function(){if(this.id){K+=" > "+this.id;C+=this!==w?' > '+this.id+"":" > "+this.id}});da=K}else da=null;a("#cur_context_panel").toggle(!!w).html(C);Db()});g.bind("extension_added",function(n,w){function C(){if(Ga){clearTimeout(Ga);Ga=null}R||(Ga=setTimeout(function(){R=true; h(s.iconsize)},50))}var K=false,R=false,Q=true,V=function(){if(w.callback&&!K&&Q){K=true;w.callback()}},aa=[];w.context_tools&&a.each(w.context_tools,function(Aa,ha){var eb=ha.container_id?' id="'+ha.container_id+'"':"",Ra=a("#"+ha.panel);Ra.length||(Ra=a("
    ",{id:ha.panel}).appendTo("#tools_top").hide());switch(ha.type){case "tool_button":var va='
    '+ha.id+"
    ",Na=a(va).appendTo(Ra);ha.events&&a.each(ha.events,function(Va,cb){a(Na).bind(Va,cb)});break;case "select":va= "";var ya=a(va).appendTo(Ra).find("select");a.each(ha.events,function(Va,cb){a(ya).bind(Va,cb)});break;case "button-select":va='';eb=a('
      ').appendTo("#option_lists"); ha.colnum&&eb.addClass("optcols"+ha.colnum);a(va).appendTo(Ra).children();aa.push({elem:"#"+ha.id,list:"#"+ha.id+"_opts",title:ha.title,callback:ha.events.change,cur:"#cur_"+ha.id});break;case "input":va="'+ha.label+':';var ab=a(va).appendTo(Ra).find("input");ha.spindata&&ab.SpinButton(ha.spindata);ha.events&&a.each(ha.events,function(Va, @@ -427,8 +427,8 @@ a("#"+ha.list+"_opts").append(ab);if(ha.isDefault){a("#cur_"+ha.list).append(ab. Na[0].id]=[{sel:"#"+Ra,fn:ha.events.click,icon:ha.id,key:ha.key,isDefault:ha.includeWith?ha.includeWith.isDefault:0},Jb];Va="position"in ya?ya.position:"last";Jb=Na.children().length;if(!isNaN(Va)&&Va>=0&&Va
      '});a("#palette").append(za);var Ia=a("#tool_angle_indicator");a("#tool_reorient");rotateCursor=function(n){n= -"rotate("+n+"deg)";Ia.css({"-webkit-transform":n,"-moz-transform":n,"-o-transform":n,"-ms-transform":n,transform:n})};var xa=function(n){var w=n.value/100;if(w<0.0010)n.value=0.1;else{n=g.getZoom();X(window,{width:0,height:0,x:(S[0].scrollLeft+S.width()/2)/n,y:(S[0].scrollTop+S.height()/2)/n,zoom:w},true)}},rb=function(){window.opera&&a("

      ").hide().appendTo("body").remove()};a("#stroke_style").change(function(){g.setStrokeAttr("stroke-dasharray",a(this).val());a("#stroke_style_label").html(this.options[this.selectedIndex].text); -rb()});a("#seg_type").change(function(){g.setSegType(a(this).val());a("#seg_type_label").html(this.options[this.selectedIndex].text)});a("select").change(function(){a(this).blur()});a("#font_family").change(function(){g.setFontFamily(this.value)});a("#text").keyup(function(){g.setTextContent(this.value)});changeAttribute=function(n,w){var C=n.getAttribute("data-attr"),K=n.value;if(!svgedit.units.isValidUnit(C,K,W)){a.alert(uiStrings.notification.invalidAttrValGiven);n.value=W.getAttribute(C);return false}w? +"rotate("+n+"deg)";Ia.css({"-webkit-transform":n,"-moz-transform":n,"-o-transform":n,"-ms-transform":n,transform:n})};var xa=function(n){var w=n.value/100;if(w<0.0010)n.value=0.1;else{n=g.getZoom();W(window,{width:0,height:0,x:(S[0].scrollLeft+S.width()/2)/n,y:(S[0].scrollTop+S.height()/2)/n,zoom:w},true)}},rb=function(){window.opera&&a("

      ").hide().appendTo("body").remove()};a("#stroke_style").change(function(){g.setStrokeAttr("stroke-dasharray",a(this).val());a("#stroke_style_label").html(this.options[this.selectedIndex].text); +rb()});a("#seg_type").change(function(){g.setSegType(a(this).val());a("#seg_type_label").html(this.options[this.selectedIndex].text)});a("select").change(function(){a(this).blur()});a("#font_family").change(function(){g.setFontFamily(this.value)});a("#text").keyup(function(){g.setTextContent(this.value)});changeAttribute=function(n,w){var C=n.getAttribute("data-attr"),K=n.value;if(!svgedit.units.isValidUnit(C,K,X)){a.alert(uiStrings.notification.invalidAttrValGiven);n.value=X.getAttribute(C);return false}w? g.changeSelectedAttributeNoUndo(C,K):g.changeSelectedAttribute(C,K)};a("#palette").mouseover(function(){var n=a('');a(this).append(n);n.focus().remove()});a(".palette_item").on("mousedown touchstart touchmove",function(){var n=a("#tool_stroke").hasClass("active"),w=n?"stroke":"fill",C=a(this).attr("data-rgb"),K=null;if(C==="transparent"||C==="initial"||C==="#none"){C="none";K=new a.jGraduate.Paint}else K=new a.jGraduate.Paint({alpha:100,solidColor:C.substr(1)});c.paintBox[w].setPaint(K); if(n){g.setColor("stroke",C);C!="none"&&g.getStrokeOpacity()!=1&&g.setPaintOpacity("stroke",1)}else{g.setColor("fill",C);C!="none"&&g.getFillOpacity()!=1&&g.setPaintOpacity("fill",1)}}).bind("contextmenu",function(n){n.preventDefault()});a("#toggle_stroke_tools").toggle(function(){a(".stroke_tool").css("display","table-cell");a(this).addClass("expanded");v()},function(){a(".stroke_tool").css("display","none");a(this).removeClass("expanded");v()});var $a=function(n,w){if(a(n).hasClass("disabled"))return false; if(a(n).parent().hasClass("tools_flyout"))return true;var C=C||"normal";w||a(".tools_flyout").fadeOut(C);a("#styleoverrides").text("");a(".tool_button_current").removeClass("tool_button_current").addClass("tool_button");a(n).addClass("tool_button_current").removeClass("tool_button");return true};(function(){var n=null,w=null,C=S[0],K=false,R=false;a("#svgcanvas").bind("mousemove mouseup touchend",function(Q){if(K!==false){C.scrollLeft-=Q.clientX-n;C.scrollTop-=Q.clientY-w;n=Q.clientX;w=Q.clientY; @@ -440,14 +440,14 @@ a(n)[0].id+"-list");C||a("#option_lists").append(R);var Q=false;C&&a(n).addClass V=K.dropUp;V&&a(n).addClass("dropup");w.find("li").bind("mouseup",function(){if(K.seticon){db("#cur_"+R[0].id,a(this).children());a(this).addClass("current").siblings().removeClass("current")}C.apply(this,arguments)});a(window).mouseup(function(){if(!Q){R.removeClass("down");w.hide();w.css({top:0,left:0})}Q=false});w.height();a(n).bind("mousedown",function(){var aa=a(n).offset();if(V){aa.top-=w.height();aa.left+=8}else aa.top+=a(n).height();a(w).offset(aa);if(R.hasClass("down")){R.removeClass("down"); w.hide();w.css({top:0,left:0})}else{R.addClass("down");w.show();Q=true;return false}}).hover(function(){Q=true}).mouseout(function(){Q=false});K.multiclick&&w.mousedown(function(){Q=true})};a("#font_family_dropdown").change(function(){var n=this.options[this.selectedIndex].value,w=this.options[this.selectedIndex].text;a("#preview_font").html(w).css("font-family",n);a("#font_family").val(n).change()});a("div","#position_opts").each(function(){this.addEventListener("mouseup",function(){var n=this.id.replace("tool_pos", "").charAt(0);g.alignSelectedElements(n,"page")})});(function(){var n,w=function(){a(n).blur()};a("#svg_editor").find("button, select, input:not(#text)").focus(function(){n=this;qa="toolbars";S.mousedown(w)}).blur(function(){qa="canvas";S.unbind("mousedown",w);g.getMode()=="textedit"&&a("#text").focus()})})();var wa=function(){$a("#tool_select")&&g.setMode("select")},hb=function(){$a("#tool_fhpath")&&g.setMode("fhpath")},Ma=function(){$a("#tool_line")&&g.setMode("line")},Ta=function(){$a("#tool_rect")&& -g.setMode("rect")},Fa=function(){$a("#tool_ellipse")&&g.setMode("ellipse")},lb=function(){$a("#tool_image")&&g.setMode("image")},tb=function(){$a("#tool_zoom")&&g.setMode("zoom")},Ya=function(){if($a("#tool_zoom")){Fb();ba()}},bb=function(){$a("#tool_text")&&g.setMode("text")},Cb=function(){$a("#tool_path")&&g.setMode("path")},ua=function(){if(W!=null||ta)g.deleteSelectedElements()},nb=function(){if(W!=null||ta){window.event.type==="keydown"&&qb(a("#edit_menu"));g.cutSelectedElements()}},kb=function(){if(W!= -null||ta){window.event.type==="keydown"&&qb(a("#edit_menu"));g.copySelectedElements()}},zb=function(){window.event.type==="keydown"&&qb(a("#edit_menu"));var n=g.getZoom(),w=(S[0].scrollLeft+S.width()/2)/n-g.contentW;n=(S[0].scrollTop+S.height()/2)/n-g.contentH;g.pasteElements("point",w,n)},pb=function(){if(W!=null){window.event.type==="keydown"&&qb(a("#object_menu"));g.moveToTopSelectedElement()}},gb=function(){if(W!=null){window.event.type==="keydown"&&qb(a("#object_menu"));g.moveToBottomSelectedElement()}}, -ub=function(){if(W!=null){window.event.type==="keydown"&&qb(a("#object_menu"));g.moveUpDownSelected("Up")}},vb=function(){if(W!=null){window.event.type==="keydown"&&qb(a("#object_menu"));g.moveUpDownSelected("Down")}},xb=function(n){if(W!=null){window.event.type==="keydown"&&qb(a("#object_menu"));g.moveUpDownSelected(n)}},Ab=function(){if(W!=null){g.convertToPath();elems=g.getSelectedElems();g.selectorManager.requestSelector(elems[0]).selectorRect.setAttribute("display","none");g.setMode("pathedit"); -J.toEditMode(elems[0]);g.clearSelection()}},la=function(){W!=null&&J.reorient()},ca=function(){if(W!=null||ta)a.prompt(uiStrings.notification.enterNewLinkURL,"http://",function(n){n&&g.makeHyperlink(n)})},ja=function(n,w){if(W!=null||ta){if(curConfig.gridSnapping){var C=g.getZoom()*curConfig.snappingStep;n*=C;w*=C}a("input").blur();g.moveSelectedElements(n,w)}},O=function(){var n=!a("#tool_node_link").hasClass("checked");n?a("#tool_node_link").addClass("checked").find("input").attr("checked",true): +g.setMode("rect")},Fa=function(){$a("#tool_ellipse")&&g.setMode("ellipse")},lb=function(){$a("#tool_image")&&g.setMode("image")},tb=function(){$a("#tool_zoom")&&g.setMode("zoom")},Ya=function(){if($a("#tool_zoom")){Fb();ba()}},bb=function(){$a("#tool_text")&&g.setMode("text")},Cb=function(){$a("#tool_path")&&g.setMode("path")},ua=function(){if(X!=null||ta)g.deleteSelectedElements()},nb=function(){if(X!=null||ta){window.event.type==="keydown"&&qb(a("#edit_menu"));g.cutSelectedElements()}},kb=function(){if(X!= +null||ta){window.event.type==="keydown"&&qb(a("#edit_menu"));g.copySelectedElements()}},zb=function(){window.event.type==="keydown"&&qb(a("#edit_menu"));var n=g.getZoom(),w=(S[0].scrollLeft+S.width()/2)/n-g.contentW;n=(S[0].scrollTop+S.height()/2)/n-g.contentH;g.pasteElements("point",w,n)},pb=function(){if(X!=null){window.event.type==="keydown"&&qb(a("#object_menu"));g.moveToTopSelectedElement()}},gb=function(){if(X!=null){window.event.type==="keydown"&&qb(a("#object_menu"));g.moveToBottomSelectedElement()}}, +ub=function(){if(X!=null){window.event.type==="keydown"&&qb(a("#object_menu"));g.moveUpDownSelected("Up")}},vb=function(){if(X!=null){window.event.type==="keydown"&&qb(a("#object_menu"));g.moveUpDownSelected("Down")}},xb=function(n){if(X!=null){window.event.type==="keydown"&&qb(a("#object_menu"));g.moveUpDownSelected(n)}},Ab=function(){if(X!=null){g.convertToPath();elems=g.getSelectedElems();g.selectorManager.requestSelector(elems[0]).selectorRect.setAttribute("display","none");g.setMode("pathedit"); +J.toEditMode(elems[0]);g.clearSelection()}},la=function(){X!=null&&J.reorient()},ca=function(){if(X!=null||ta)a.prompt(uiStrings.notification.enterNewLinkURL,"http://",function(n){n&&g.makeHyperlink(n)})},ja=function(n,w){if(X!=null||ta){if(curConfig.gridSnapping){var C=g.getZoom()*curConfig.snappingStep;n*=C;w*=C}a("input").blur();g.moveSelectedElements(n,w)}},O=function(){var n=!a("#tool_node_link").hasClass("checked");n?a("#tool_node_link").addClass("checked").find("input").attr("checked",true): a("#tool_node_link").removeClass("checked").find("input").attr("checked",false);J.linkControlPoints(n)},T=function(){J.getNodePoint()&&J.clonePathNode()},ea=function(){J.getNodePoint()&&J.deletePathNode()},Ha=function(){var n=a("#tool_add_subpath"),w=!n.hasClass("push_button_pressed");w?n.addClass("push_button_pressed").removeClass("tool_button"):n.removeClass("push_button_pressed").addClass("tool_button");J.addSubPath(w)},Pa=function(){J.opencloseSubPath()},Xa=function(){g.cycleElement(1)},fb=function(){g.cycleElement(0)}, -ob=function(n,w){if(!(W==null||ta)){n||(w*=-1);var C=a("#angle").val()*1+w;g.setRotationAngle(C);Ba()}},Wa=function(){var n=curConfig.dimensions;a.confirm(uiStrings.notification.QwantToClear,function(w){if(w){ba();g.clear();g.setResolution(n[0],n[1]);H(true);Fb();Ba();Z();g.runExtensions("onNewDocument")}})},sb=function(){g.setBold(!g.getBold());Ba();return false},Qa=function(){g.setItalic(!g.getItalic());Ba();return false},wb=function(){if(!b.pngsave){var n=uiStrings.notification.loadingImage;P= +ob=function(n,w){if(!(X==null||ta)){n||(w*=-1);var C=a("#angle").val()*1+w;g.setRotationAngle(C);Ba()}},Wa=function(){var n=curConfig.dimensions;a.confirm(uiStrings.notification.QwantToClear,function(w){if(w){ba();g.clear();g.setResolution(n[0],n[1]);H(true);Fb();Ba();Z();g.runExtensions("onNewDocument")}})},sb=function(){g.setBold(!g.getBold());Ba();return false},Qa=function(){g.setItalic(!g.getItalic());Ba();return false},wb=function(){if(!b.pngsave){var n=uiStrings.notification.loadingImage;P= window.open("data:text/html;charset=utf-8,"+n+"

      "+n+"

      ")}window.canvg?g.rasterExport():a.getScript("canvg/rgbcolor.js",function(){a.getScript("canvg/canvg.js",function(){g.rasterExport()})})},Bb=function(){g.open()},Kb=function(){},qb=function(n){var w=n.prev();w.css("background","#09f");setTimeout(function(){w.css("background","")},200)},ib=function(){if(U.getUndoStackSize()>0){window.event.type==="keydown"&&qb(a("#edit_menu"));U.undo()}},Ka=function(){if(U.getRedoStackSize()> -0){window.event.type==="keydown"&&qb(a("#edit_menu"));U.redo()}},Mb=function(){if(ta)g.groupSelectedElements();else W&&g.ungroupSelectedElement()},Ob=function(){window.event.type==="keydown"&&qb(a("#edit_menu"));g.cloneSelectedElements(20,20)},Nb=function(){var n=this.id.replace("tool_align","").charAt(0);g.alignSelectedElements(n,a("#align_relative_to").val())},Pb=function(){var n=document.querySelector("#tool_stroke rect"),w=document.querySelector("#tool_fill rect"),C=w.getAttribute("fill"),K=n.getAttribute("fill"); +0){window.event.type==="keydown"&&qb(a("#edit_menu"));U.redo()}},Mb=function(){if(ta)g.groupSelectedElements();else X&&g.ungroupSelectedElement()},Ob=function(){window.event.type==="keydown"&&qb(a("#edit_menu"));g.cloneSelectedElements(20,20)},Nb=function(){var n=this.id.replace("tool_align","").charAt(0);g.alignSelectedElements(n,a("#align_relative_to").val())},Pb=function(){var n=document.querySelector("#tool_stroke rect"),w=document.querySelector("#tool_fill rect"),C=w.getAttribute("fill"),K=n.getAttribute("fill"); n=parseFloat(n.getAttribute("stroke-opacity"));if(isNaN(n))n=100;w=parseFloat(w.getAttribute("fill-opacity"));if(isNaN(w))w=100;K=Ja(K,n,"stroke");C=Ja(C,w,"fill");c.paintBox.fill.setPaint(K,true);c.paintBox.stroke.setPaint(C,true)},Fb=function(n){var w=g.getResolution();n=n?w.zoom*n:1;a("#zoom").val(n*100);g.setZoom(n);mb();H(true)},Gb=function(){!a("#tool_wireframe").hasClass("push_button_pressed")?a("#tool_wireframe").addClass("push_button_pressed"):a("#tool_wireframe").removeClass("push_button_pressed"); S.toggleClass("wireframe");if(!A){var n=a("#wireframe_rules");n.length?n.empty():a('').appendTo("head");mb()}},Lb=function(){var n=!a("#tool_snap").hasClass("push_button_pressed");n?a("#tool_snap").addClass("push_button_pressed"):a("#tool_snap").removeClass("push_button_pressed");curConfig.gridSnapping=n},Sb=function(){window.self!=window.top&&top.exports.setEditorFocus(false)},Eb=function(){if(a("#tool_rulers").hasClass("push_button_pressed")){a("#tool_rulers").removeClass("push_button_pressed"); a("#show_rulers").attr("checked",false);curConfig.showRulers=false}else{a("#tool_rulers").addClass("push_button_pressed");a("#show_rulers").attr("checked",true);curConfig.showRulers=true}a("#rulers").toggle(!!curConfig.showRulers)},mb=function(){if(!A){var n="#workarea.wireframe #svgcontent * { stroke-width: "+1/g.getZoom()+"px; }";a("#wireframe_rules").text(S.hasClass("wireframe")?n:"")}},Rb=function(n,w){if(!ka){ka=true;a("#save_output_btns").toggle(!!w);a("#tool_source_back").toggle(!w);var C= @@ -457,12 +457,12 @@ a(this),R=K.outerWidth()*(w-1),Q=K.outerHeight()*(w-1),V=0;V<4;V++){var aa=C[V], K=1;K=typeof n=="number"?n:{s:0.75,m:1,l:1.25,xl:1.5}[n];c.tool_scale=ia=K;na();var R=C.parents(":hidden");R.css("visibility","hidden").show();e(C,K);R.css("visibility","visible").hide();C=a("#tool_size_rules");if(C.length)C.empty();else C=a('').appendTo("head");if(n!="m"){var Q="";a.each(cssResizeRules,function(V,aa){V="#svg_editor "+V.replace(/,/g,", #svg_editor");Q+=V+"{";a.each(aa,function(fa,pa){if(typeof pa==="number")var sa=pa*K+"px";else if(pa[n]||pa.all)sa= pa[n]||pa.all;Q+=fa+":"+sa+";"});Q+="}"});R="-"+Ib.toLowerCase()+"-";Q+="#tools_top .toolset, #editor_panel > *, #history_panel > *,\t\t\t\t#main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\t\t\t\t#g_panel > *, #tool_font_size > *, .tools_flyout{"+R+"transform: scale("+K+");} #svg_editor div.toolset .toolset {"+R+"transform: scale(1); margin: 1px !important;} #svg_editor .ui-slider {"+R+"transform: scale("+1/K+");}";C.text(Q)}na()}},l=function(){a("#dialog_box").hide(); if(ka){if(ka)ga!==a("#svg_source_textarea").val()?a.confirm(uiStrings.notification.QignoreSourceChanges,function(n){n&&z()}):z();v()}else da&&g.leaveContext()},z=function(){a("#svg_source_editor").hide();ka=false;a("#svg_source_textarea").blur()};a(window).width();a(window).height();var v=a.noop;a(window).resize(function(){H()});(function(){S.scroll(function(){if(a("#ruler_x").length!=0)a("#ruler_x")[0].scrollLeft=S[0].scrollLeft;if(a("#ruler_y").length!=0)a("#ruler_y")[0].scrollTop=S[0].scrollTop})})(); -a("#url_notice").click(function(){a.alert(this.title)});a("#change_image_url").click(function(){var n=g.getHref(W);n=n.indexOf("data:")===0?"":n;a.prompt(uiStrings.notification.enterNewImgURL,n,function(w){w&&Oa(w)})});var G=function(n){var w=n[0].id=="stroke_color"?"stroke":"fill",C=n[0].id=="canvas_color";if(C)w="canvas";var K=c.paintBox[w].paint;n=w=="stroke"?"Pick a Stroke Paint and Opacity":"Pick a Fill Paint and Opacity";C=C?{right:200,top:50}:{left:45,bottom:50};a("#color_picker").draggable({cancel:".jGraduate_tabs, .jGraduate_colPick, .jGraduate_gradPick, .jPicker", +a("#url_notice").click(function(){a.alert(this.title)});a("#change_image_url").click(function(){var n=g.getHref(X);n=n.indexOf("data:")===0?"":n;a.prompt(uiStrings.notification.enterNewImgURL,n,function(w){w&&Oa(w)})});var G=function(n){var w=n[0].id=="stroke_color"?"stroke":"fill",C=n[0].id=="canvas_color";if(C)w="canvas";var K=c.paintBox[w].paint;n=w=="stroke"?"Pick a Stroke Paint and Opacity":"Pick a Fill Paint and Opacity";C=C?{right:200,top:50}:{left:45,bottom:50};a("#color_picker").draggable({cancel:".jGraduate_tabs, .jGraduate_colPick, .jGraduate_gradPick, .jPicker", containment:"window"}).css(C).jGraduate({paint:K,window:{pickerTitle:n},images:{clientPath:curConfig.jGraduatePath},newstop:"inverse"},function(R){K=new a.jGraduate.Paint(R);c.paintBox[w].setPaint(K);g.setPaint(w,K);a("#color_picker").hide()},function(){a("#color_picker").hide()})};q=function(n,w){var C=document.getElementById("canvas_background"),K={color:"fff",opacity:1};if(w=="stroke")K=curConfig.initStroke;if(w=="fill")K=curConfig.initFill;if(w=="canvas"&&C)if(C=C.getAttribute("fill").match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))K= {color:("0"+parseInt(C[1],10).toString(16)).slice(-2)+("0"+parseInt(C[2],10).toString(16)).slice(-2)+("0"+parseInt(C[3],10).toString(16)).slice(-2),opacity:1};C=(new DOMParser).parseFromString('\t\t\t\t\t',"text/xml").documentElement;C=a(n)[0].appendChild(document.importNode(C,true));w==="canvas"?C.setAttribute("width",60.5): C.setAttribute("width","100%");this.rect=C.firstChild;this.defs=C.getElementsByTagName("defs")[0];this.grad=this.defs.firstChild;this.paint=new a.jGraduate.Paint({solidColor:K.color});this.type=w;this.setPaint=function(R,Q){this.paint=R;var V="none",aa=R.type,fa=R.alpha/100;switch(aa){case "solidColor":V=R[aa]=="none"||R[aa]=="one"?"none":"#"+R[aa];break;case "linearGradient":case "radialGradient":this.defs.removeChild(this.grad);this.grad=this.defs.appendChild(R[aa]);V="url(#"+(this.grad.id="gradbox_"+ -this.type)+")"}this.rect.setAttribute("fill",V);this.rect.setAttribute("opacity",fa);if(Q){g.setColor(this.type,V,true);g.setPaintOpacity(this.type,fa,true)}if(this.type=="canvas")(aa=document.getElementById("canvas_background"))?aa.setAttribute("fill",V):La(V)};this.update=function(R){if(W){var Q=this.type;switch(W.tagName){case "use":case "image":case "foreignObject":return;case "g":case "a":for(var V=null,aa=W.getElementsByTagName("*"),fa=0,pa=aa.length;fa=0)w=n.value=1;g.setStrokeWidth(w)},cursor:true,smallStep:0.1,start:1.5});a("#angle").dragInput({min:-180,max:180, +max:null,step:1,callback:changeAttribute,cursor:false});a("#image_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#rect_rx").dragInput({min:0,max:100,step:1,callback:function(n){g.setRectRadius(n.value)},cursor:true});a("#stroke_width").dragInput({min:0,max:99,step:1,callback:function(n){var w=n.value;if(w==0&&X&&["line","polyline"].indexOf(X.nodeName)>=0)w=n.value=1;g.setStrokeWidth(w)},cursor:true,smallStep:0.1,start:1.5});a("#angle").dragInput({min:-180,max:180, step:1,callback:function(n){g.setRotationAngle(n.value);rotateCursor(n.value);a("#tool_reorient").toggleClass("disabled",n.value==0)},cursor:false});a("#font_size").dragInput({min:1,max:250,step:1,callback:function(n){g.setFontSize(n.value)},cursor:true,stepfunc:function(n,w){var C=n.value-0,K=C+w,R=K>=C;if(w===0)return C;return C>=24?R?Math.round(C*1.1):Math.round(C/1.1):C<=1?R?C*2:C/2:K}});a("#group_opacity").dragInput({min:0,max:100,step:5,callback:function(n,w){if(w==null)w=n.value;a("#group_opacity").val(w); if(!n||!n.handle)a("#opac_slider").slider("option","value",w);g.setOpacity(w/100)},cursor:true,start:100});a("#blur").dragInput({min:0,max:10,step:0.1,callback:function(n){val=n.value;a("#blur").val(val);window.event.type=="mouseup"?g.setBlur(val,true):g.setBlurNoUndo(val)},cursor:true,start:0});a("#zoom").val(g.getZoom()*100);a("#workarea").contextMenu({menu:"cmenu_canvas",inSpeed:0},function(n){switch(n){case "delete":ua();break;case "cut":nb();break;case "copy":kb();break;case "paste":g.pasteElements(); break;case "paste_in_place":g.pasteElements("in_place");break;case "group":g.groupSelectedElements();break;case "ungroup":g.ungroupSelectedElement();break;case "move_front":pb();break;case "move_up":xb("Up");break;case "move_down":xb("Down");break;case "move_back":gb();break;default:svgedit.contextmenu&&svgedit.contextmenu.hasCustomHandler(n)&&svgedit.contextmenu.getCustomHandler(n).call()}});a(".contextMenu li").mousedown(function(n){n.preventDefault()});a("#cmenu_canvas li").disableContextMenu(); @@ -580,51 +580,51 @@ this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui return g=this._trimAlignValue(g)}g=this.options.values.slice();for(c=0;c=this._valueMax())return this._valueMax();var g=this.options.step>0?this.options.step:1,c=(p-this._valueMin())%g;p=p-c;Math.abs(c)*2>=g&&(p+=c>0?g:-g);return parseFloat(p.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var p= this.options.range,g=this.options,c=this,m=this._animateOff?false:g.animate,s,b={},f,d,k,q;this.options.values&&this.options.values.length?this.handles.each(function(B){s=(c.values(B)-c._valueMin())/(c._valueMax()-c._valueMin())*100;b[c.orientation==="horizontal"?"left":"bottom"]=s+"%";a(this).stop(1,1)[m?"animate":"css"](b,g.animate);c.options.range===true&&(c.orientation==="horizontal"?(B===0&&c.range.stop(1,1)[m?"animate":"css"]({left:s+"%"},g.animate),B===1&&c.range[m?"animate":"css"]({width:s- f+"%"},{queue:false,duration:g.animate})):(B===0&&c.range.stop(1,1)[m?"animate":"css"]({bottom:s+"%"},g.animate),B===1&&c.range[m?"animate":"css"]({height:s-f+"%"},{queue:false,duration:g.animate})));f=s}):(d=this.value(),k=this._valueMin(),q=this._valueMax(),s=q!==k?(d-k)/(q-k)*100:0,b[c.orientation==="horizontal"?"left":"bottom"]=s+"%",this.handle.stop(1,1)[m?"animate":"css"](b,g.animate),p==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[m?"animate":"css"]({width:s+"%"},g.animate), -p==="max"&&this.orientation==="horizontal"&&this.range[m?"animate":"css"]({width:100-s+"%"},{queue:false,duration:g.animate}),p==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[m?"animate":"css"]({height:s+"%"},g.animate),p==="max"&&this.orientation==="vertical"&&this.range[m?"animate":"css"]({height:100-s+"%"},{queue:false,duration:g.animate}))}});a.extend(a.ui.slider,{version:"1.8.17"})})(jQuery);(function(a){Math.precision=function(b,f){if(f===undefined)f=0;return Math.round(b*Math.pow(10,f))/Math.pow(10,f)};var p=function(b,f){var d=this,k=b.find("img:first"),q=0,B=100,o=100,J=0,U=100,M=100,I=0,S=0,Y,P,ia=[],qa=function(X){for(var Z=0;Zoa)Z=oa;if(X<0)X=0;else if(X>ra)X=ra;ka.call(d,"xy",{x:Z/oa*o+q,y:X/ra*M+J})},ka=function(X,Z,oa){if(Z===undefined){if(X===undefined||X==null)X="xy";switch(X.toLowerCase()){case "x":return I;case "y":return S;default:return{x:I,y:S}}}if(!(oa!= -null&&oa==d)){var ra=false,ma,na;if(X==null)X="xy";switch(X.toLowerCase()){case "x":ma=Z&&(Z.x&&Z.x|0||Z|0)||0;break;case "y":na=Z&&(Z.y&&Z.y|0||Z|0)||0;break;default:ma=Z&&Z.x&&Z.x|0||0;na=Z&&Z.y&&Z.y|0||0}if(ma!=null){if(maB)ma=B;if(I!=ma){I=ma;ra=true}}if(na!=null){if(naU)na=U;if(S!=na){S=na;ra=true}}ra&&qa.call(d,oa||d)}},da=function(X){a.isFunction(X)&&ia.push(X)};a.extend(true,d,{val:ka,range:function(X,Z){if(Z===undefined){if(X===undefined||X==null)X="all"; -switch(X.toLowerCase()){case "minx":return q;case "maxx":return B;case "rangex":return{minX:q,maxX:B,rangeX:o};case "miny":return J;case "maxy":return U;case "rangey":return{minY:J,maxY:U,rangeY:M};default:return{minX:q,maxX:B,rangeX:o,minY:J,maxY:U,rangeY:M}}}var oa,ra,ma,na;if(X==null)X="all";switch(X.toLowerCase()){case "minx":oa=Z&&(Z.minX&&Z.minX|0||Z|0)||0;break;case "maxx":ra=Z&&(Z.maxX&&Z.maxX|0||Z|0)||0;break;case "rangex":oa=Z&&Z.minX&&Z.minX|0||0;ra=Z&&Z.maxX&&Z.maxX|0||0;break;case "miny":ma= -Z&&(Z.minY&&Z.minY|0||Z|0)||0;break;case "maxy":na=Z&&(Z.maxY&&Z.maxY|0||Z|0)||0;break;case "rangey":ma=Z&&Z.minY&&Z.minY|0||0;na=Z&&Z.maxY&&Z.maxY|0||0;break;default:oa=Z&&Z.minX&&Z.minX|0||0;ra=Z&&Z.maxX&&Z.maxX|0||0;ma=Z&&Z.minY&&Z.minY|0||0;na=Z&&Z.maxY&&Z.maxY|0||0}if(oa!=null&&q!=oa){q=oa;o=B-q}if(ra!=null&&B!=ra){B=ra;o=B-q}if(ma!=null&&J!=ma){J=ma;M=U-J}if(na!=null&&U!=na){U=na;M=U-J}},bind:da,unbind:function(X){if(a.isFunction(X))for(var Z;(Z=a.inArray(X,ia))!=-1;)ia.splice(Z,1)},destroy:function(){a(document).unbind("mouseup", -W).unbind("mousemove",ba);b.unbind("mousedown",ga);ia=k=b=null}});k.src=f.arrow&&f.arrow.image;k.w=f.arrow&&f.arrow.width||k.width();k.h=f.arrow&&f.arrow.height||k.height();b.w=f.map&&f.map.width||b.width();b.h=f.map&&f.map.height||b.height();b.bind("mousedown",ga);da.call(d,function(){var X=0,Z=0,oa=b.w,ra=b.h,ma=k.w,na=k.h;setTimeout(function(){if(o>0)X=I==B?oa:I/o*oa|0;if(M>0)Z=S==U?ra:S/M*ra|0;if(ma>=oa)X=(oa>>1)-(ma>>1);else X-=ma>>1;if(na>=ra)Z=(ra>>1)-(na>>1);else Z-=na>>1;k.css({left:X+"px", -top:Z+"px"})},0)})},g=function(b,f,d,k){var q=this;b=b.find("td.Text input");var B=b.eq(3),o=b.eq(4),J=b.eq(5),U=b.length>7?b.eq(6):null,M=b.eq(0),I=b.eq(1),S=b.eq(2),Y=b.eq(b.length>7?7:6),P=b.length>7?b.eq(8):null,ia=function(ka){if(!(ka.target.value==""&&ka.target!=Y.get(0)&&(d!=null&&ka.target!=d.get(0)||d==null))){if(!ba(ka))return ka;switch(ka.target){case B.get(0):switch(ka.keyCode){case 38:B.val(W.call(q,(B.val()<<0)+1,0,255));f.val("r",B.val(),ka.target);return false;case 40:B.val(W.call(q, -(B.val()<<0)-1,0,255));f.val("r",B.val(),ka.target);return false}break;case o.get(0):switch(ka.keyCode){case 38:o.val(W.call(q,(o.val()<<0)+1,0,255));f.val("g",o.val(),ka.target);return false;case 40:o.val(W.call(q,(o.val()<<0)-1,0,255));f.val("g",o.val(),ka.target);return false}break;case J.get(0):switch(ka.keyCode){case 38:J.val(W.call(q,(J.val()<<0)+1,0,255));f.val("b",J.val(),ka.target);return false;case 40:J.val(W.call(q,(J.val()<<0)-1,0,255));f.val("b",J.val(),ka.target);return false}break; -case U&&U.get(0):switch(ka.keyCode){case 38:U.val(W.call(q,parseFloat(U.val())+1,0,100));f.val("a",Math.precision(U.val()*255/100,k),ka.target);return false;case 40:U.val(W.call(q,parseFloat(U.val())-1,0,100));f.val("a",Math.precision(U.val()*255/100,k),ka.target);return false}break;case M.get(0):switch(ka.keyCode){case 38:M.val(W.call(q,(M.val()<<0)+1,0,360));f.val("h",M.val(),ka.target);return false;case 40:M.val(W.call(q,(M.val()<<0)-1,0,360));f.val("h",M.val(),ka.target);return false}break;case I.get(0):switch(ka.keyCode){case 38:I.val(W.call(q, -(I.val()<<0)+1,0,100));f.val("s",I.val(),ka.target);return false;case 40:I.val(W.call(q,(I.val()<<0)-1,0,100));f.val("s",I.val(),ka.target);return false}break;case S.get(0):switch(ka.keyCode){case 38:S.val(W.call(q,(S.val()<<0)+1,0,100));f.val("v",S.val(),ka.target);return false;case 40:S.val(W.call(q,(S.val()<<0)-1,0,100));f.val("v",S.val(),ka.target);return false}}}},qa=function(ka){if(!(ka.target.value==""&&ka.target!=Y.get(0)&&(d!=null&&ka.target!=d.get(0)||d==null))){if(!ba(ka))return ka;switch(ka.target){case B.get(0):B.val(W.call(q, -B.val(),0,255));f.val("r",B.val(),ka.target);break;case o.get(0):o.val(W.call(q,o.val(),0,255));f.val("g",o.val(),ka.target);break;case J.get(0):J.val(W.call(q,J.val(),0,255));f.val("b",J.val(),ka.target);break;case U&&U.get(0):U.val(W.call(q,U.val(),0,100));f.val("a",Math.precision(U.val()*255/100,k),ka.target);break;case M.get(0):M.val(W.call(q,M.val(),0,360));f.val("h",M.val(),ka.target);break;case I.get(0):I.val(W.call(q,I.val(),0,100));f.val("s",I.val(),ka.target);break;case S.get(0):S.val(W.call(q, +p==="max"&&this.orientation==="horizontal"&&this.range[m?"animate":"css"]({width:100-s+"%"},{queue:false,duration:g.animate}),p==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[m?"animate":"css"]({height:s+"%"},g.animate),p==="max"&&this.orientation==="vertical"&&this.range[m?"animate":"css"]({height:100-s+"%"},{queue:false,duration:g.animate}))}});a.extend(a.ui.slider,{version:"1.8.17"})})(jQuery);(function(a){Math.precision=function(b,f){if(f===undefined)f=0;return Math.round(b*Math.pow(10,f))/Math.pow(10,f)};var p=function(b,f){var d=this,k=b.find("img:first"),q=0,B=100,o=100,J=0,U=100,M=100,I=0,S=0,Y,P,ia=[],qa=function(W){for(var Z=0;Zoa)Z=oa;if(W<0)W=0;else if(W>ra)W=ra;ka.call(d,"xy",{x:Z/oa*o+q,y:W/ra*M+J})},ka=function(W,Z,oa){if(Z===undefined){if(W===undefined||W==null)W="xy";switch(W.toLowerCase()){case "x":return I;case "y":return S;default:return{x:I,y:S}}}if(!(oa!= +null&&oa==d)){var ra=false,ma,na;if(W==null)W="xy";switch(W.toLowerCase()){case "x":ma=Z&&(Z.x&&Z.x|0||Z|0)||0;break;case "y":na=Z&&(Z.y&&Z.y|0||Z|0)||0;break;default:ma=Z&&Z.x&&Z.x|0||0;na=Z&&Z.y&&Z.y|0||0}if(ma!=null){if(maB)ma=B;if(I!=ma){I=ma;ra=true}}if(na!=null){if(naU)na=U;if(S!=na){S=na;ra=true}}ra&&qa.call(d,oa||d)}},da=function(W){a.isFunction(W)&&ia.push(W)};a.extend(true,d,{val:ka,range:function(W,Z){if(Z===undefined){if(W===undefined||W==null)W="all"; +switch(W.toLowerCase()){case "minx":return q;case "maxx":return B;case "rangex":return{minX:q,maxX:B,rangeX:o};case "miny":return J;case "maxy":return U;case "rangey":return{minY:J,maxY:U,rangeY:M};default:return{minX:q,maxX:B,rangeX:o,minY:J,maxY:U,rangeY:M}}}var oa,ra,ma,na;if(W==null)W="all";switch(W.toLowerCase()){case "minx":oa=Z&&(Z.minX&&Z.minX|0||Z|0)||0;break;case "maxx":ra=Z&&(Z.maxX&&Z.maxX|0||Z|0)||0;break;case "rangex":oa=Z&&Z.minX&&Z.minX|0||0;ra=Z&&Z.maxX&&Z.maxX|0||0;break;case "miny":ma= +Z&&(Z.minY&&Z.minY|0||Z|0)||0;break;case "maxy":na=Z&&(Z.maxY&&Z.maxY|0||Z|0)||0;break;case "rangey":ma=Z&&Z.minY&&Z.minY|0||0;na=Z&&Z.maxY&&Z.maxY|0||0;break;default:oa=Z&&Z.minX&&Z.minX|0||0;ra=Z&&Z.maxX&&Z.maxX|0||0;ma=Z&&Z.minY&&Z.minY|0||0;na=Z&&Z.maxY&&Z.maxY|0||0}if(oa!=null&&q!=oa){q=oa;o=B-q}if(ra!=null&&B!=ra){B=ra;o=B-q}if(ma!=null&&J!=ma){J=ma;M=U-J}if(na!=null&&U!=na){U=na;M=U-J}},bind:da,unbind:function(W){if(a.isFunction(W))for(var Z;(Z=a.inArray(W,ia))!=-1;)ia.splice(Z,1)},destroy:function(){a(document).unbind("mouseup", +X).unbind("mousemove",ba);b.unbind("mousedown",ga);ia=k=b=null}});k.src=f.arrow&&f.arrow.image;k.w=f.arrow&&f.arrow.width||k.width();k.h=f.arrow&&f.arrow.height||k.height();b.w=f.map&&f.map.width||b.width();b.h=f.map&&f.map.height||b.height();b.bind("mousedown",ga);da.call(d,function(){var W=0,Z=0,oa=b.w,ra=b.h,ma=k.w,na=k.h;setTimeout(function(){if(o>0)W=I==B?oa:I/o*oa|0;if(M>0)Z=S==U?ra:S/M*ra|0;if(ma>=oa)W=(oa>>1)-(ma>>1);else W-=ma>>1;if(na>=ra)Z=(ra>>1)-(na>>1);else Z-=na>>1;k.css({left:W+"px", +top:Z+"px"})},0)})},g=function(b,f,d,k){var q=this;b=b.find("td.Text input");var B=b.eq(3),o=b.eq(4),J=b.eq(5),U=b.length>7?b.eq(6):null,M=b.eq(0),I=b.eq(1),S=b.eq(2),Y=b.eq(b.length>7?7:6),P=b.length>7?b.eq(8):null,ia=function(ka){if(!(ka.target.value==""&&ka.target!=Y.get(0)&&(d!=null&&ka.target!=d.get(0)||d==null))){if(!ba(ka))return ka;switch(ka.target){case B.get(0):switch(ka.keyCode){case 38:B.val(X.call(q,(B.val()<<0)+1,0,255));f.val("r",B.val(),ka.target);return false;case 40:B.val(X.call(q, +(B.val()<<0)-1,0,255));f.val("r",B.val(),ka.target);return false}break;case o.get(0):switch(ka.keyCode){case 38:o.val(X.call(q,(o.val()<<0)+1,0,255));f.val("g",o.val(),ka.target);return false;case 40:o.val(X.call(q,(o.val()<<0)-1,0,255));f.val("g",o.val(),ka.target);return false}break;case J.get(0):switch(ka.keyCode){case 38:J.val(X.call(q,(J.val()<<0)+1,0,255));f.val("b",J.val(),ka.target);return false;case 40:J.val(X.call(q,(J.val()<<0)-1,0,255));f.val("b",J.val(),ka.target);return false}break; +case U&&U.get(0):switch(ka.keyCode){case 38:U.val(X.call(q,parseFloat(U.val())+1,0,100));f.val("a",Math.precision(U.val()*255/100,k),ka.target);return false;case 40:U.val(X.call(q,parseFloat(U.val())-1,0,100));f.val("a",Math.precision(U.val()*255/100,k),ka.target);return false}break;case M.get(0):switch(ka.keyCode){case 38:M.val(X.call(q,(M.val()<<0)+1,0,360));f.val("h",M.val(),ka.target);return false;case 40:M.val(X.call(q,(M.val()<<0)-1,0,360));f.val("h",M.val(),ka.target);return false}break;case I.get(0):switch(ka.keyCode){case 38:I.val(X.call(q, +(I.val()<<0)+1,0,100));f.val("s",I.val(),ka.target);return false;case 40:I.val(X.call(q,(I.val()<<0)-1,0,100));f.val("s",I.val(),ka.target);return false}break;case S.get(0):switch(ka.keyCode){case 38:S.val(X.call(q,(S.val()<<0)+1,0,100));f.val("v",S.val(),ka.target);return false;case 40:S.val(X.call(q,(S.val()<<0)-1,0,100));f.val("v",S.val(),ka.target);return false}}}},qa=function(ka){if(!(ka.target.value==""&&ka.target!=Y.get(0)&&(d!=null&&ka.target!=d.get(0)||d==null))){if(!ba(ka))return ka;switch(ka.target){case B.get(0):B.val(X.call(q, +B.val(),0,255));f.val("r",B.val(),ka.target);break;case o.get(0):o.val(X.call(q,o.val(),0,255));f.val("g",o.val(),ka.target);break;case J.get(0):J.val(X.call(q,J.val(),0,255));f.val("b",J.val(),ka.target);break;case U&&U.get(0):U.val(X.call(q,U.val(),0,100));f.val("a",Math.precision(U.val()*255/100,k),ka.target);break;case M.get(0):M.val(X.call(q,M.val(),0,360));f.val("h",M.val(),ka.target);break;case I.get(0):I.val(X.call(q,I.val(),0,100));f.val("s",I.val(),ka.target);break;case S.get(0):S.val(X.call(q, S.val(),0,100));f.val("v",S.val(),ka.target);break;case Y.get(0):Y.val(Y.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6));d&&d.val(Y.val());f.val("hex",Y.val()!=""?Y.val():null,ka.target);break;case d&&d.get(0):d.val(d.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6));Y.val(d.val());f.val("hex",d.val()!=""?d.val():null,ka.target);break;case P&&P.get(0):P.val(P.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,2));f.val("a",P.val()!=null?parseInt(P.val(),16): null,ka.target)}}},ga=function(ka){if(f.val()!=null)switch(ka.target){case B.get(0):B.val(f.val("r"));break;case o.get(0):o.val(f.val("g"));break;case J.get(0):J.val(f.val("b"));break;case U&&U.get(0):U.val(Math.precision(f.val("a")*100/255,k));break;case M.get(0):M.val(f.val("h"));break;case I.get(0):I.val(f.val("s"));break;case S.get(0):S.val(f.val("v"));break;case Y.get(0):case d&&d.get(0):Y.val(f.val("hex"));d&&d.val(f.val("hex"));break;case P&&P.get(0):P.val(f.val("ahex").substring(6))}},ba= -function(ka){switch(ka.keyCode){case 9:case 16:case 29:case 37:case 39:return false;case "c".charCodeAt():case "v".charCodeAt():if(ka.ctrlKey)return false}return true},W=function(ka,da,X){if(ka==""||isNaN(ka))return da;if(ka>X)return X;if(kaW)return W;if(ka255)ba.r=255;if(d!=ba.r){d=ba.r;ga=true}break;case "g":if(ta)continue;W=true;ba.g=P&&P.g&&P.g|0||P&&P|0||0;if(ba.g<0)ba.g=0;else if(ba.g>255)ba.g=255;if(k!=ba.g){k=ba.g;ga=true}break;case "b":if(ta)continue;W=true;ba.b=P&&P.b&&P.b|0||P&&P|0||0;if(ba.b<0)ba.b=0;else if(ba.b>255)ba.b=255;if(q!=ba.b){q=ba.b;ga=true}break;case "a":ba.a=P&&P.a!=null?P.a|0:P!=null?P|0:255;if(ba.a<0)ba.a=0;else if(ba.a>255)ba.a=255;if(B!=ba.a){B=ba.a;ga=true}break;case "h":if(W)continue;ta=true;ba.h=P&&P.h&& -P.h|0||P&&P|0||0;if(ba.h<0)ba.h=0;else if(ba.h>360)ba.h=360;if(o!=ba.h){o=ba.h;ga=true}break;case "s":if(W)continue;ta=true;ba.s=P&&P.s!=null?P.s|0:P!=null?P|0:100;if(ba.s<0)ba.s=0;else if(ba.s>100)ba.s=100;if(J!=ba.s){J=ba.s;ga=true}break;case "v":if(W)continue;ta=true;ba.v=P&&P.v!=null?P.v|0:P!=null?P|0:100;if(ba.v<0)ba.v=0;else if(ba.v>100)ba.v=100;if(U!=ba.v){U=ba.v;ga=true}}if(ga){if(W){d=d||0;k=k||0;q=q||0;P=s.rgbToHsv({r:d,g:k,b:q});o=P.h;J=P.s;U=P.v}else if(ta){o=o||0;J=J!=null?J:100;U=U!= +P.hex||"00000000",ia);break}var ba={},X=false,ta=false;if(P.r!==undefined&&!Y.indexOf("r")==-1)Y+="r";if(P.g!==undefined&&!Y.indexOf("g")==-1)Y+="g";if(P.b!==undefined&&!Y.indexOf("b")==-1)Y+="b";if(P.a!==undefined&&!Y.indexOf("a")==-1)Y+="a";if(P.h!==undefined&&!Y.indexOf("h")==-1)Y+="h";if(P.s!==undefined&&!Y.indexOf("s")==-1)Y+="s";if(P.v!==undefined&&!Y.indexOf("v")==-1)Y+="v";for(qa=0;qa255)ba.r=255;if(d!=ba.r){d=ba.r;ga=true}break;case "g":if(ta)continue;X=true;ba.g=P&&P.g&&P.g|0||P&&P|0||0;if(ba.g<0)ba.g=0;else if(ba.g>255)ba.g=255;if(k!=ba.g){k=ba.g;ga=true}break;case "b":if(ta)continue;X=true;ba.b=P&&P.b&&P.b|0||P&&P|0||0;if(ba.b<0)ba.b=0;else if(ba.b>255)ba.b=255;if(q!=ba.b){q=ba.b;ga=true}break;case "a":ba.a=P&&P.a!=null?P.a|0:P!=null?P|0:255;if(ba.a<0)ba.a=0;else if(ba.a>255)ba.a=255;if(B!=ba.a){B=ba.a;ga=true}break;case "h":if(X)continue;ta=true;ba.h=P&&P.h&& +P.h|0||P&&P|0||0;if(ba.h<0)ba.h=0;else if(ba.h>360)ba.h=360;if(o!=ba.h){o=ba.h;ga=true}break;case "s":if(X)continue;ta=true;ba.s=P&&P.s!=null?P.s|0:P!=null?P|0:100;if(ba.s<0)ba.s=0;else if(ba.s>100)ba.s=100;if(J!=ba.s){J=ba.s;ga=true}break;case "v":if(X)continue;ta=true;ba.v=P&&P.v!=null?P.v|0:P!=null?P|0:100;if(ba.v<0)ba.v=0;else if(ba.v>100)ba.v=100;if(U!=ba.v){U=ba.v;ga=true}}if(ga){if(X){d=d||0;k=k||0;q=q||0;P=s.rgbToHsv({r:d,g:k,b:q});o=P.h;J=P.s;U=P.v}else if(ta){o=o||0;J=J!=null?J:100;U=U!= null?U:100;P=s.hsvToRgb({h:o,s:J,v:U});d=P.r;k=P.g;q=P.b}B=B!=null?B:255;I.call(f,ia||f)}}}};a.extend(true,f,{val:S,bind:function(Y){a.isFunction(Y)&&M.push(Y)},unbind:function(Y){if(a.isFunction(Y))for(var P;(P=a.inArray(Y,M))!=-1;)M.splice(P,1)},destroy:function(){M=null}});if(b)if(b.ahex!=null)S("ahex",b);else if(b.hex!=null)S((b.a!=null?"a":"")+"hex",b.a!=null?{ahex:b.hex+s.intToHex(b.a)}:b);else if(b.r!=null&&b.g!=null&&b.b!=null)S("rgb"+(b.a!=null?"a":""),b);else if(b.h!=null&&b.s!=null&&b.v!= null)S("hsv"+(b.a!=null?"a":""),b)},ColorMethods:{hexToRgba:function(b){b=this.validateHex(b);if(b=="")return{r:null,g:null,b:null,a:null};var f="00",d="00",k="00",q="255";if(b.length==6)b+="ff";if(b.length>6){f=b.substring(0,2);d=b.substring(2,4);k=b.substring(4,6);q=b.substring(6,b.length)}else{if(b.length>4){f=b.substring(4,b.length);b=b.substring(0,4)}if(b.length>2){d=b.substring(2,b.length);b=b.substring(0,2)}if(b.length>0)k=b.substring(0,b.length)}return{r:this.hexToInt(f),g:this.hexToInt(d), b:this.hexToInt(k),a:this.hexToInt(q)}},validateHex:function(b){if(typeof b=="object")return"";b=b.toLowerCase().replace(/[^a-f0-9]/g,"");if(b.length>8)b=b.substring(0,8);return b},rgbaToHex:function(b){return this.intToHex(b.r)+this.intToHex(b.g)+this.intToHex(b.b)+this.intToHex(b.a)},intToHex:function(b){b=(b|0).toString(16);if(b.length==1)b="0"+b;return b.toLowerCase()},hexToInt:function(b){return parseInt(b,16)},rgbToHsv:function(b){var f=b.r/255,d=b.g/255;b=b.b/255;var k={h:0,s:0,v:0},q=0,B= 0;if(f>=d&&f>=b){B=f;q=d>b?b:d}else if(d>=b&&d>=f){B=d;q=f>b?b:f}else{B=b;q=d>f?f:d}k.v=B;k.s=B?(B-q)/B:0;if(k.s){q=B-q;k.h=f==B?(d-b)/q:d==B?2+(b-f)/q:4+(f-d)/q;k.h=parseInt(k.h*60);if(k.h<0)k.h+=360}else k.h=0;k.s=k.s*100|0;k.v=k.v*100|0;return k},hsvToRgb:function(b){var f={r:0,g:0,b:0,a:100},d=b.h,k=b.s;b=b.v;if(k==0)f.r=b==0?f.g=f.b=0:f.g=f.b=b*255/100|0;else{if(d==360)d=0;d/=60;k/=100;b/=100;var q=d|0,B=d-q;d=b*(1-k);var o=b*(1-k*B);k=b*(1-k*(1-B));switch(q){case 0:f.r=b;f.g=k;f.b=d;break;case 1:f.r= o;f.g=b;f.b=d;break;case 2:f.r=d;f.g=b;f.b=k;break;case 3:f.r=d;f.g=o;f.b=b;break;case 4:f.r=k;f.g=d;f.b=b;break;case 5:f.r=b;f.g=d;f.b=o}f.r=f.r*255|0;f.g=f.g*255|0;f.b=f.b*255|0}return f}}};var c=a.jPicker.Color,m=a.jPicker.List,s=a.jPicker.ColorMethods;a.fn.jPicker=function(b){var f=arguments;return this.each(function(){var d=this,k=a.extend(true,{},a.fn.jPicker.defaults,b);if(a(d).get(0).nodeName.toLowerCase()=="input"){a.extend(true,k,{window:{bindToInput:true,expandable:true,input:a(d)}});if(a(d).val()== ""){k.color.active=new c({hex:null});k.color.current=new c({hex:null})}else if(s.validateHex(a(d).val())){k.color.active=new c({hex:a(d).val(),a:k.color.active.val("a")});k.color.current=new c({hex:a(d).val(),a:k.color.active.val("a")})}}if(k.window.expandable)a(d).after('    '); -else k.window.liveUpdate=false;var q=parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters,B=null,o=null,J=null,U=null,M=null,I=null,S=null,Y=null,P=null,ia=null,qa=null,ga=null,ba=null,W=null,ta=null,ka=null,da=null,X=null,Z=null,oa=null,ra=null,ma=null,na=null,Ca=null,Ga=null,Ja=null,Da=null,La=null,Oa=function(O){var T=ja.active,ea=T.val("hex"),Ha,Pa;k.color.mode=O;switch(O){case "h":setTimeout(function(){Ua.call(d,o,"transparent");Ea.call(d,U,0);wa.call(d,U,100);Ea.call(d, -M,260);wa.call(d,M,100);Ua.call(d,J,"transparent");Ea.call(d,S,0);wa.call(d,S,100);Ea.call(d,Y,260);wa.call(d,Y,100);Ea.call(d,P,260);wa.call(d,P,100);Ea.call(d,ia,260);wa.call(d,ia,100);Ea.call(d,ga,260);wa.call(d,ga,100)},0);ba.range("all",{minX:0,maxX:100,minY:0,maxY:100});W.range("rangeY",{minY:0,maxY:360});if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("s"),y:100-T.val("v")},ba);W.val("y",360-T.val("h"),W);break;case "s":setTimeout(function(){Ua.call(d,o,"transparent");Ea.call(d,U,-260);Ea.call(d, -M,-520);Ea.call(d,S,-260);Ea.call(d,Y,-520);Ea.call(d,ga,260);wa.call(d,ga,100)},0);ba.range("all",{minX:0,maxX:360,minY:0,maxY:100});W.range("rangeY",{minY:0,maxY:100});if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("h"),y:100-T.val("v")},ba);W.val("y",100-T.val("s"),W);break;case "v":setTimeout(function(){Ua.call(d,o,"000000");Ea.call(d,U,-780);Ea.call(d,M,260);Ua.call(d,J,ea);Ea.call(d,S,-520);Ea.call(d,Y,260);wa.call(d,Y,100);Ea.call(d,ga,260);wa.call(d,ga,100)},0);ba.range("all",{minX:0,maxX:360, -minY:0,maxY:100});W.range("rangeY",{minY:0,maxY:100});if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("h"),y:100-T.val("s")},ba);W.val("y",100-T.val("v"),W);break;case "r":Ha=-1040;Pa=-780;ba.range("all",{minX:0,maxX:255,minY:0,maxY:255});W.range("rangeY",{minY:0,maxY:255});if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("b"),y:255-T.val("g")},ba);W.val("y",255-T.val("r"),W);break;case "g":Ha=-1560;Pa=-1820;ba.range("all",{minX:0,maxX:255,minY:0,maxY:255});W.range("rangeY",{minY:0,maxY:255}); -if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("b"),y:255-T.val("r")},ba);W.val("y",255-T.val("g"),W);break;case "b":Ha=-2080;Pa=-2860;ba.range("all",{minX:0,maxX:255,minY:0,maxY:255});W.range("rangeY",{minY:0,maxY:255});if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("r"),y:255-T.val("g")},ba);W.val("y",255-T.val("b"),W);break;case "a":setTimeout(function(){Ua.call(d,o,"transparent");Ea.call(d,U,-260);Ea.call(d,M,-520);Ea.call(d,S,260);Ea.call(d,Y,260);wa.call(d,Y,100);Ea.call(d,ga,0);wa.call(d, -ga,100)},0);ba.range("all",{minX:0,maxX:360,minY:0,maxY:100});W.range("rangeY",{minY:0,maxY:255});if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("h"),y:100-T.val("v")},ba);W.val("y",255-T.val("a"),W);break;default:throw"Invalid Mode";}switch(O){case "s":case "v":case "a":setTimeout(function(){wa.call(d,U,100);wa.call(d,S,100);Ea.call(d,P,260);wa.call(d,P,100);Ea.call(d,ia,260);wa.call(d,ia,100)},0);break;case "r":case "g":case "b":setTimeout(function(){Ua.call(d,o,"transparent");Ua.call(d,J,"transparent"); -wa.call(d,S,100);wa.call(d,U,100);Ea.call(d,U,Ha);Ea.call(d,M,Ha-260);Ea.call(d,S,Pa-780);Ea.call(d,Y,Pa-520);Ea.call(d,P,Pa);Ea.call(d,ia,Pa-260);Ea.call(d,ga,260);wa.call(d,ga,100)},0)}T.val("ahex")!=null&&Ba.call(d,T)},Ba=function(O,T){if(T==null||T!=W&&T!=ba)xa.call(d,O,T);setTimeout(function(){rb.call(d,O);$a.call(d,O);jb.call(d,O)},0)},za=function(O,T){var ea=ja.active;if(!(T!=ba&&ea.val()==null)){var Ha=O.val("all");switch(k.color.mode){case "h":ea.val("sv",{s:Ha.x,v:100-Ha.y},T);break;case "s":case "a":ea.val("hv", -{h:Ha.x,v:100-Ha.y},T);break;case "v":ea.val("hs",{h:Ha.x,s:100-Ha.y},T);break;case "r":ea.val("gb",{g:255-Ha.y,b:Ha.x},T);break;case "g":ea.val("rb",{r:255-Ha.y,b:Ha.x},T);break;case "b":ea.val("rg",{r:Ha.x,g:255-Ha.y},T)}}},Ia=function(O,T){var ea=ja.active;if(!(T!=W&&ea.val()==null))switch(k.color.mode){case "h":ea.val("h",{h:360-O.val("y")},T);break;case "s":ea.val("s",{s:100-O.val("y")},T);break;case "v":ea.val("v",{v:100-O.val("y")},T);break;case "r":ea.val("r",{r:255-O.val("y")},T);break;case "g":ea.val("g", +else k.window.liveUpdate=false;var q=parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters,B=null,o=null,J=null,U=null,M=null,I=null,S=null,Y=null,P=null,ia=null,qa=null,ga=null,ba=null,X=null,ta=null,ka=null,da=null,W=null,Z=null,oa=null,ra=null,ma=null,na=null,Ca=null,Ga=null,Ja=null,Da=null,La=null,Oa=function(O){var T=ja.active,ea=T.val("hex"),Ha,Pa;k.color.mode=O;switch(O){case "h":setTimeout(function(){Ua.call(d,o,"transparent");Ea.call(d,U,0);wa.call(d,U,100);Ea.call(d, +M,260);wa.call(d,M,100);Ua.call(d,J,"transparent");Ea.call(d,S,0);wa.call(d,S,100);Ea.call(d,Y,260);wa.call(d,Y,100);Ea.call(d,P,260);wa.call(d,P,100);Ea.call(d,ia,260);wa.call(d,ia,100);Ea.call(d,ga,260);wa.call(d,ga,100)},0);ba.range("all",{minX:0,maxX:100,minY:0,maxY:100});X.range("rangeY",{minY:0,maxY:360});if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("s"),y:100-T.val("v")},ba);X.val("y",360-T.val("h"),X);break;case "s":setTimeout(function(){Ua.call(d,o,"transparent");Ea.call(d,U,-260);Ea.call(d, +M,-520);Ea.call(d,S,-260);Ea.call(d,Y,-520);Ea.call(d,ga,260);wa.call(d,ga,100)},0);ba.range("all",{minX:0,maxX:360,minY:0,maxY:100});X.range("rangeY",{minY:0,maxY:100});if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("h"),y:100-T.val("v")},ba);X.val("y",100-T.val("s"),X);break;case "v":setTimeout(function(){Ua.call(d,o,"000000");Ea.call(d,U,-780);Ea.call(d,M,260);Ua.call(d,J,ea);Ea.call(d,S,-520);Ea.call(d,Y,260);wa.call(d,Y,100);Ea.call(d,ga,260);wa.call(d,ga,100)},0);ba.range("all",{minX:0,maxX:360, +minY:0,maxY:100});X.range("rangeY",{minY:0,maxY:100});if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("h"),y:100-T.val("s")},ba);X.val("y",100-T.val("v"),X);break;case "r":Ha=-1040;Pa=-780;ba.range("all",{minX:0,maxX:255,minY:0,maxY:255});X.range("rangeY",{minY:0,maxY:255});if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("b"),y:255-T.val("g")},ba);X.val("y",255-T.val("r"),X);break;case "g":Ha=-1560;Pa=-1820;ba.range("all",{minX:0,maxX:255,minY:0,maxY:255});X.range("rangeY",{minY:0,maxY:255}); +if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("b"),y:255-T.val("r")},ba);X.val("y",255-T.val("g"),X);break;case "b":Ha=-2080;Pa=-2860;ba.range("all",{minX:0,maxX:255,minY:0,maxY:255});X.range("rangeY",{minY:0,maxY:255});if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("r"),y:255-T.val("g")},ba);X.val("y",255-T.val("b"),X);break;case "a":setTimeout(function(){Ua.call(d,o,"transparent");Ea.call(d,U,-260);Ea.call(d,M,-520);Ea.call(d,S,260);Ea.call(d,Y,260);wa.call(d,Y,100);Ea.call(d,ga,0);wa.call(d, +ga,100)},0);ba.range("all",{minX:0,maxX:360,minY:0,maxY:100});X.range("rangeY",{minY:0,maxY:255});if(T.val("ahex")==null)break;ba.val("xy",{x:T.val("h"),y:100-T.val("v")},ba);X.val("y",255-T.val("a"),X);break;default:throw"Invalid Mode";}switch(O){case "s":case "v":case "a":setTimeout(function(){wa.call(d,U,100);wa.call(d,S,100);Ea.call(d,P,260);wa.call(d,P,100);Ea.call(d,ia,260);wa.call(d,ia,100)},0);break;case "r":case "g":case "b":setTimeout(function(){Ua.call(d,o,"transparent");Ua.call(d,J,"transparent"); +wa.call(d,S,100);wa.call(d,U,100);Ea.call(d,U,Ha);Ea.call(d,M,Ha-260);Ea.call(d,S,Pa-780);Ea.call(d,Y,Pa-520);Ea.call(d,P,Pa);Ea.call(d,ia,Pa-260);Ea.call(d,ga,260);wa.call(d,ga,100)},0)}T.val("ahex")!=null&&Ba.call(d,T)},Ba=function(O,T){if(T==null||T!=X&&T!=ba)xa.call(d,O,T);setTimeout(function(){rb.call(d,O);$a.call(d,O);jb.call(d,O)},0)},za=function(O,T){var ea=ja.active;if(!(T!=ba&&ea.val()==null)){var Ha=O.val("all");switch(k.color.mode){case "h":ea.val("sv",{s:Ha.x,v:100-Ha.y},T);break;case "s":case "a":ea.val("hv", +{h:Ha.x,v:100-Ha.y},T);break;case "v":ea.val("hs",{h:Ha.x,s:100-Ha.y},T);break;case "r":ea.val("gb",{g:255-Ha.y,b:Ha.x},T);break;case "g":ea.val("rb",{r:255-Ha.y,b:Ha.x},T);break;case "b":ea.val("rg",{r:Ha.x,g:255-Ha.y},T)}}},Ia=function(O,T){var ea=ja.active;if(!(T!=X&&ea.val()==null))switch(k.color.mode){case "h":ea.val("h",{h:360-O.val("y")},T);break;case "s":ea.val("s",{s:100-O.val("y")},T);break;case "v":ea.val("v",{v:100-O.val("y")},T);break;case "r":ea.val("r",{r:255-O.val("y")},T);break;case "g":ea.val("g", {g:255-O.val("y")},T);break;case "b":ea.val("b",{b:255-O.val("y")},T);break;case "a":ea.val("a",255-O.val("y"),T)}},xa=function(O,T){if(T!=ba)switch(k.color.mode){case "h":var ea=O.val("sv");ba.val("xy",{x:ea!=null?ea.s:100,y:100-(ea!=null?ea.v:100)},T);break;case "s":case "a":ea=O.val("hv");ba.val("xy",{x:ea&&ea.h||0,y:100-(ea!=null?ea.v:100)},T);break;case "v":ea=O.val("hs");ba.val("xy",{x:ea&&ea.h||0,y:100-(ea!=null?ea.s:100)},T);break;case "r":ea=O.val("bg");ba.val("xy",{x:ea&&ea.b||0,y:255-(ea&& -ea.g||0)},T);break;case "g":ea=O.val("br");ba.val("xy",{x:ea&&ea.b||0,y:255-(ea&&ea.r||0)},T);break;case "b":ea=O.val("rg");ba.val("xy",{x:ea&&ea.r||0,y:255-(ea&&ea.g||0)},T)}if(T!=W)switch(k.color.mode){case "h":W.val("y",360-(O.val("h")||0),T);break;case "s":ea=O.val("s");W.val("y",100-(ea!=null?ea:100),T);break;case "v":ea=O.val("v");W.val("y",100-(ea!=null?ea:100),T);break;case "r":W.val("y",255-(O.val("r")||0),T);break;case "g":W.val("y",255-(O.val("g")||0),T);break;case "b":W.val("y",255-(O.val("b")|| -0),T);break;case "a":ea=O.val("a");W.val("y",255-(ea!=null?ea:255),T)}},rb=function(O){try{var T=O.val("all");oa.css({backgroundColor:T&&"#"+T.hex||"transparent"});wa.call(d,oa,T&&Math.precision(T.a*100/255,4)||0)}catch(ea){}},$a=function(O){switch(k.color.mode){case "h":Ua.call(d,o,(new c({h:O.val("h")||0,s:100,v:100})).val("hex"));break;case "s":case "a":var T=O.val("s");wa.call(d,M,100-(T!=null?T:100));break;case "v":T=O.val("v");wa.call(d,U,T!=null?T:100);break;case "r":wa.call(d,M,Math.precision((O.val("r")|| +ea.g||0)},T);break;case "g":ea=O.val("br");ba.val("xy",{x:ea&&ea.b||0,y:255-(ea&&ea.r||0)},T);break;case "b":ea=O.val("rg");ba.val("xy",{x:ea&&ea.r||0,y:255-(ea&&ea.g||0)},T)}if(T!=X)switch(k.color.mode){case "h":X.val("y",360-(O.val("h")||0),T);break;case "s":ea=O.val("s");X.val("y",100-(ea!=null?ea:100),T);break;case "v":ea=O.val("v");X.val("y",100-(ea!=null?ea:100),T);break;case "r":X.val("y",255-(O.val("r")||0),T);break;case "g":X.val("y",255-(O.val("g")||0),T);break;case "b":X.val("y",255-(O.val("b")|| +0),T);break;case "a":ea=O.val("a");X.val("y",255-(ea!=null?ea:255),T)}},rb=function(O){try{var T=O.val("all");oa.css({backgroundColor:T&&"#"+T.hex||"transparent"});wa.call(d,oa,T&&Math.precision(T.a*100/255,4)||0)}catch(ea){}},$a=function(O){switch(k.color.mode){case "h":Ua.call(d,o,(new c({h:O.val("h")||0,s:100,v:100})).val("hex"));break;case "s":case "a":var T=O.val("s");wa.call(d,M,100-(T!=null?T:100));break;case "v":T=O.val("v");wa.call(d,U,T!=null?T:100);break;case "r":wa.call(d,M,Math.precision((O.val("r")|| 0)/255*100,4));break;case "g":wa.call(d,M,Math.precision((O.val("g")||0)/255*100,4));break;case "b":wa.call(d,M,Math.precision((O.val("b")||0)/255*100))}O=O.val("a");wa.call(d,I,Math.precision((255-(O||0))*100/255,4))},jb=function(O){switch(k.color.mode){case "h":var T=O.val("a");wa.call(d,qa,Math.precision((255-(T||0))*100/255,4));break;case "s":T=O.val("hva");var ea=new c({h:T&&T.h||0,s:100,v:T!=null?T.v:100});Ua.call(d,J,ea.val("hex"));wa.call(d,Y,100-(T!=null?T.v:100));wa.call(d,qa,Math.precision((255- (T&&T.a||0))*100/255,4));break;case "v":T=O.val("hsa");ea=new c({h:T&&T.h||0,s:T!=null?T.s:100,v:100});Ua.call(d,J,ea.val("hex"));wa.call(d,qa,Math.precision((255-(T&&T.a||0))*100/255,4));break;case "r":case "g":case "b":ea=T=0;O=O.val("rgba");if(k.color.mode=="r"){T=O&&O.b||0;ea=O&&O.g||0}else if(k.color.mode=="g"){T=O&&O.b||0;ea=O&&O.r||0}else if(k.color.mode=="b"){T=O&&O.r||0;ea=O&&O.g||0}var Ha=ea>T?T:ea;wa.call(d,Y,T>ea?Math.precision((T-ea)/(255-ea)*100,4):0);wa.call(d,P,ea>T?Math.precision((ea- T)/(255-T)*100,4):0);wa.call(d,ia,Math.precision(Ha/255*100,4));wa.call(d,qa,Math.precision((255-(O&&O.a||0))*100/255,4));break;case "a":T=O.val("a");Ua.call(d,J,O.val("hex")||"000000");wa.call(d,qa,T!=null?0:100);wa.call(d,ga,T!=null?100:0)}},Ua=function(O,T){O.css({backgroundColor:T&&T.length==6&&"#"+T||"transparent"})},Sa=function(O,T){if(q&&(T.indexOf("AlphaBar.png")!=-1||T.indexOf("Bars.png")!=-1||T.indexOf("Maps.png")!=-1)){O.attr("pngSrc",T);O.css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ T+"', sizingMethod='scale')"})}else O.css({backgroundImage:"url('"+T+"')"})},Ea=function(O,T){O.css({top:T+"px"})},wa=function(O,T){O.css({visibility:T>0?"visible":"hidden"});if(T>0&&T<100)if(q){var ea=O.attr("pngSrc");ea!=null&&(ea.indexOf("AlphaBar.png")!=-1||ea.indexOf("Bars.png")!=-1||ea.indexOf("Maps.png")!=-1)?O.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ea+"', sizingMethod='scale') progid:DXImageTransform.Microsoft.Alpha(opacity="+T+")"}):O.css({opacity:Math.precision(T/ 100,4)})}else O.css({opacity:Math.precision(T/100,4)});else if(T==0||T==100)if(q){ea=O.attr("pngSrc");ea!=null&&(ea.indexOf("AlphaBar.png")!=-1||ea.indexOf("Bars.png")!=-1||ea.indexOf("Maps.png")!=-1)?O.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ea+"', sizingMethod='scale')"}):O.css({opacity:""})}else O.css({opacity:""})},hb=function(){ja.active.val("ahex",ja.current.val("ahex"))},Ma=function(){ja.current.val("ahex",ja.active.val("ahex"))},Ta=function(O){a(this).parents("tbody:first").find('input:radio[value!="'+ O.target.value+'"]').removeAttr("checked");Oa.call(d,O.target.value)},Fa=function(){hb.call(d)},lb=function(){hb.call(d);k.window.expandable&&xb.call(d);a.isFunction(ub)&&ub.call(d,ja.active,na)},tb=function(){Ma.call(d);k.window.expandable&&xb.call(d);a.isFunction(pb)&&pb.call(d,ja.active,ma)},Ya=function(){vb.call(d)},bb=function(O){var T=O.val("hex");ra.css({backgroundColor:T&&"#"+T||"transparent"});wa.call(d,ra,Math.precision((O.val("a")||0)*100/255,4))},Cb=function(O){var T=O.val("hex");O=O.val("va"); -Ga.css({backgroundColor:T&&"#"+T||"transparent"});wa.call(d,Ja,Math.precision((255-(O&&O.a||0))*100/255,4));if(k.window.bindToInput&&k.window.updateInputColor)k.window.input.css({backgroundColor:T&&"#"+T||"transparent",color:O==null||O.v>75?"#000000":"#ffffff"})},ua=function(O){ka=parseInt(B.css("left"));da=parseInt(B.css("top"));X=O.pageX;Z=O.pageY;a(document).bind("mousemove",nb).bind("mouseup",kb);O.preventDefault()},nb=function(O){B.css({left:ka-(X-O.pageX)+"px",top:da-(Z-O.pageY)+"px"});k.window.expandable&& +Ga.css({backgroundColor:T&&"#"+T||"transparent"});wa.call(d,Ja,Math.precision((255-(O&&O.a||0))*100/255,4));if(k.window.bindToInput&&k.window.updateInputColor)k.window.input.css({backgroundColor:T&&"#"+T||"transparent",color:O==null||O.v>75?"#000000":"#ffffff"})},ua=function(O){ka=parseInt(B.css("left"));da=parseInt(B.css("top"));W=O.pageX;Z=O.pageY;a(document).bind("mousemove",nb).bind("mouseup",kb);O.preventDefault()},nb=function(O){B.css({left:ka-(W-O.pageX)+"px",top:da-(Z-O.pageY)+"px"});k.window.expandable&& !a.support.boxModel&&B.prev().css({left:B.css("left"),top:B.css("top")});O.stopPropagation();O.preventDefault();return false},kb=function(O){a(document).unbind("mousemove",nb).unbind("mouseup",kb);O.stopPropagation();O.preventDefault();return false},zb=function(O){O.preventDefault();O.stopPropagation();ja.active.val("ahex",a(this).attr("title")||null,O.target);return false},pb=a.isFunction(f[1])&&f[1]||null,gb=a.isFunction(f[2])&&f[2]||null,ub=a.isFunction(f[3])&&f[3]||null,vb=function(){ja.current.val("ahex", ja.active.val("ahex"));var O=function(){if(!(!k.window.expandable||a.support.boxModel)){var T=B.find("table:first");B.before("