fixing rect_rx problem
parent
67bd9735d8
commit
0f53d9f137
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<f;b++)if(k[m[b]])return c.apply(this,arguments)}}}}a.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",
|
||||
106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta",219:"[",221:"]"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};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<La?Ga[Ca]||(Da[Ja+1]&&isNaN(Da[Ja+1])?{}:[]):na}else if(a.isArray(Z[Ca]))Z[Ca].push(na);else Z[Ca]=Z[Ca]!==f?[Z[Ca],na]:na}else if(Ca)Z[Ca]=X?f:""});return Z};o[P]=c(s,
|
||||
0);o[ia]=J=c(s,1);a.elemUrlAttr||(a.elemUrlAttr=function(da){return a.extend(ka,da)})({a:ga,base:ga,iframe:"src",img:"src",input:"src",form:"action",link:ga,script:"src"});S=a.elemUrlAttr;a.fn[P]=c(b,P);a.fn[ia]=c(b,ia);U.pushState=M=function(da,X){if(g(da)&&/^#/.test(da)&&X===f)X=2;var Z=da!==f;Z=B(p[qa][ga],Z?da:{},Z?X:2);p[qa][ga]=Z+(/#/.test(Z)?"":"#")};U.getState=I=function(da,X){return da===f||typeof da==="boolean"?J(da):J(X)[da]};U.removeState=function(da){var X={};if(da!==f){X=I();a.each(a.isArray(da)?
|
||||
da:arguments,function(Z,oa){delete X[oa]})}M(X,2)};Y.hashchange=a.extend(Y.hashchange,{add:function(da){function X(oa){var ra=oa[ia]=B();oa.getState=function(ma,na){return ma===f||typeof ma==="boolean"?o(ra,ma):o(ra,na)[ma]};Z.apply(this,arguments)}var Z;if(a.isFunction(da)){Z=da;return X}else{Z=da.handler;da.handler=X}}})})(jQuery,this);
|
||||
106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta",219:"[",221:"]"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};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<La?Ga[Ca]||(Da[Ja+1]&&isNaN(Da[Ja+1])?{}:[]):na}else if(a.isArray(Z[Ca]))Z[Ca].push(na);else Z[Ca]=Z[Ca]!==f?[Z[Ca],na]:na}else if(Ca)Z[Ca]=W?f:""});return Z};o[P]=c(s,
|
||||
0);o[ia]=J=c(s,1);a.elemUrlAttr||(a.elemUrlAttr=function(da){return a.extend(ka,da)})({a:ga,base:ga,iframe:"src",img:"src",input:"src",form:"action",link:ga,script:"src"});S=a.elemUrlAttr;a.fn[P]=c(b,P);a.fn[ia]=c(b,ia);U.pushState=M=function(da,W){if(g(da)&&/^#/.test(da)&&W===f)W=2;var Z=da!==f;Z=B(p[qa][ga],Z?da:{},Z?W:2);p[qa][ga]=Z+(/#/.test(Z)?"":"#")};U.getState=I=function(da,W){return da===f||typeof da==="boolean"?J(da):J(W)[da]};U.removeState=function(da){var W={};if(da!==f){W=I();a.each(a.isArray(da)?
|
||||
da:arguments,function(Z,oa){delete W[oa]})}M(W,2)};Y.hashchange=a.extend(Y.hashchange,{add:function(da){function W(oa){var ra=oa[ia]=B();oa.getState=function(ma,na){return ma===f||typeof ma==="boolean"?o(ra,ma):o(ra,na)[ma]};Z.apply(this,arguments)}var Z;if(a.isFunction(da)){Z=da;return W}else{Z=da.handler;da.handler=W}}})})(jQuery,this);
|
||||
(function(a,p,g){function c(B){B=B||p[b][f];return B.replace(/^[^#]*#?(.*)$/,"$1")}var m,s=a.event.special,b="location",f="href",d=document.documentMode,k=a.browser.msie&&(d===g||d<8),q="onhashchange"in p&&!k;a.hashchangeDelay=100;s.hashchange=a.extend(s.hashchange,{setup:function(){if(q)return false;a(m.start)},teardown:function(){if(q)return false;a(m.stop)}});m=function(){function B(){M=I=function(S){return S};if(k){U=a('<iframe src="javascript:0"/>').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;ma<ra;ma++){var na=J[ma],Ca=na.id;if(Ca==="svg_eof")break;a("#"+Ca);na=na.getElementsByTagNameNS(k,"svg")[0];var Ga=document.createElementNS(k,"svg");Ga.setAttributeNS(k,"viewBox",
|
||||
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,W){if(da!=="ajax"){if(S)return;var Z=(U=ga[0].contentDocument)&&U.getElementById("svg_eof");if(!Z&&!(W&&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,W){if(!I){if(m.no_img)da=false;if(da){var Z=a(document.createElement("div"));Z.hide().appendTo("body")}if(W){var oa=m.fallback_path?m.fallback_path:"";a.each(W,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;ma<ra;ma++){var na=J[ma],Ca=na.id;if(Ca==="svg_eof")break;a("#"+Ca);na=na.getElementsByTagNameNS(k,"svg")[0];var Ga=document.createElementNS(k,"svg");Ga.setAttributeNS(k,"viewBox",
|
||||
[0,0,B,o].join(" "));var Ja=na.getAttribute("width"),Da=na.getAttribute("height");na.removeAttribute("width");na.removeAttribute("height");na.getAttribute("viewBox")||na.setAttribute("viewBox",[0,0,Ja,Da].join(" "));Ga.setAttribute("xmlns",k);Ga.setAttribute("width",B);Ga.setAttribute("height",o);Ga.setAttribute("xmlns:xlink",q);Ga.setAttribute("class","svg_icon");ia||(na=na.cloneNode(true));Ga.appendChild(na);if(da){ia||Ga.cloneNode(true);Z.empty().append(Ga);na=qa+d(Z.html());na=a(new Image).attr({"class":"svg_icon",
|
||||
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(!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<da.length);return X.join("")}var k="http://www.w3.org/2000/svg",q="http://www.w3.org/1999/xlink",B=m.w?m.w:24,o=m.h?m.h:24,J,U,M,I=false,S=false,Y=0,P=navigator.userAgent,ia=!!window.opera;P.indexOf("Safari/")>-1&&P.indexOf("Chrome/");var qa="data:image/svg+xml;charset=utf-8;base64,";if(m.svgz){var ga=a('<object data="'+c+'" type=image/svg+xml>').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<da.length);return W.join("")}var k="http://www.w3.org/2000/svg",q="http://www.w3.org/1999/xlink",B=m.w?m.w:24,o=m.h?m.h:24,J,U,M,I=false,S=false,Y=0,P=navigator.userAgent,ia=!!window.opera;P.indexOf("Safari/")>-1&&P.indexOf("Chrome/");var qa="data:image/svg+xml;charset=utf-8;base64,";if(m.svgz){var ga=a('<object data="'+c+'" type=image/svg+xml>').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<ra;ma++){var Ga=oa[ma];Ga.getAttribute("fill")===na&&Ga.setAttribute("fill",Ca);Ga.getAttribute("stroke")===na&&Ga.setAttribute("stroke",Ca);Ga.getAttribute("filter")===na&&Ga.setAttribute("filter",Ca)}});return da}};a.getSvgIcon=function(c,m){var s=p[c];if(m&&s)s=g(s,0,true).clone(true);return s};a.resizeSvgIcons=function(c){var m=!a(".svg_icon:first").length;a.each(c,function(s,b){var f=a.isArray(b),d=f?b[0]:b,k=f?b[1]:b;if(m)s=s.replace(/\.svg_icon/g,"svg");a(s).each(function(){this.setAttribute("width",
|
||||
d);this.setAttribute("height",k);if(window.opera&&window.widget){this.parentNode.style.width=d+"px";this.parentNode.style.height=k+"px"}})})}})(jQuery);(function(){function a(c,m,s){c=document.createElementNS(p.svg,c);if(g)for(var b in m)c.setAttribute(b,m[b]);else for(b in m){var f=m[b],d=c[b];if(d&&d.constructor==="SVGLength")d.baseVal.value=f;else c.setAttribute(b,f)}s&&s.appendChild(c);return c}var p={svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink"};if(!window.console)window.console=new function(){this.log=function(){};this.dir=function(){}};$.jGraduate={Paint:function(c){c=c||{};this.alpha=isNaN(c.alpha)?100:c.alpha;if(c.copy){this.type=
|
||||
c.copy.type;this.alpha=c.copy.alpha;this.radialGradient=this.linearGradient=this.solidColor=null;switch(this.type){case "solidColor":this.solidColor=c.copy.solidColor;break;case "linearGradient":this.linearGradient=c.copy.linearGradient.cloneNode(true);break;case "radialGradient":this.radialGradient=c.copy.radialGradient.cloneNode(true)}}else if(c.linearGradient){this.type="linearGradient";this.radialGradient=this.solidColor=null;this.linearGradient=c.linearGradient.cloneNode(true)}else if(c.radialGradient){this.type=
|
||||
"radialGradient";this.linearGradient=this.solidColor=null;this.radialGradient=c.radialGradient.cloneNode(true)}else if(c.solidColor){this.type="solidColor";this.solidColor=c.solidColor}else{this.type="none";this.radialGradient=this.linearGradient=this.solidColor=null}}};jQuery.fn.jGraduateDefaults={paint:new $.jGraduate.Paint,window:{pickerTitle:"Drag markers to pick a paint"},images:{clientPath:"images/"},newstop:"inverse"};var g=navigator.userAgent.indexOf("Gecko/")>=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(T<O){ea.prev().before(ea);xa=$(W).find("stop")}O=T})}var q=$(this),B=$.extend(true,{},jQuery.fn.jGraduateDefaults,c),o=q.attr("id"),J="#"+q.attr("id")+" ";if(J){var U=function(){switch(q.paint.type){case "radialGradient":q.paint.linearGradient=null;break;case "linearGradient":q.paint.radialGradient=null;break;case "solidColor":q.paint.radialGradient=q.paint.linearGradient=null}$.isFunction(q.okCallback)&&q.okCallback(q.paint);q.hide()},M=function(){$.isFunction(q.cancelCallback)&&q.cancelCallback();
|
||||
fb);ea.setAttribute("stop-opacity",Xa);$("div.jGraduate_LightBox").hide();$("#"+o+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();$("#"+o+"_jGraduate_stopPicker").hide()})});$(X).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?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<O){ea.prev().before(ea);xa=$(X).find("stop")}O=T})}var q=$(this),B=$.extend(true,{},jQuery.fn.jGraduateDefaults,c),o=q.attr("id"),J="#"+q.attr("id")+" ";if(J){var U=function(){switch(q.paint.type){case "radialGradient":q.paint.linearGradient=null;break;case "linearGradient":q.paint.radialGradient=null;break;case "solidColor":q.paint.radialGradient=q.paint.linearGradient=null}$.isFunction(q.okCallback)&&q.okCallback(q.paint);q.hide()},M=function(){$.isFunction(q.cancelCallback)&&q.cancelCallback();
|
||||
q.hide()};$.extend(true,q,{paint:new $.jGraduate.Paint({copy:B.paint}),okCallback:$.isFunction(m[1])&&m[1]||null,cancelCallback:$.isFunction(m[2])&&m[2]||null});q.position();var I=null,S=$(window);if(q.paint.type=="none")q.paint=$.jGraduate.Paint({solidColor:"ffffff"});q.addClass("jGraduate_Picker");q.html('<ul class="jGraduate_tabs"><li class="jGraduate_tab_color jGraduate_tab_current" data-type="col">Solid Color</li><li class="jGraduate_tab_lingrad" data-type="lg">Linear Gradient</li><li class="jGraduate_tab_radgrad" data-type="rg">Radial Gradient</li></ul><div class="jGraduate_colPick"></div><div class="jGraduate_gradPick"></div><div class="jGraduate_LightBox"></div><div id="'+
|
||||
o+'_jGraduate_stopPicker" class="jGraduate_stopPicker"></div>');var Y=$(J+"> .jGraduate_colPick"),P=$(J+"> .jGraduate_gradPick");P.html('<div id="'+o+'_jGraduate_Swatch" class="jGraduate_Swatch"><h2 class="jGraduate_Title">'+B.window.pickerTitle+'</h2><div id="'+o+'_jGraduate_GradContainer" class="jGraduate_GradContainer"></div><div id="'+o+'_jGraduate_StopSlider" class="jGraduate_StopSlider"></div></div><div class="jGraduate_Form jGraduate_Points jGraduate_lg_field"><div class="jGraduate_StopSection"><label class="jGraduate_Form_Heading">Begin Point</label><div class="jGraduate_Form_Section"><label>x:</label><input type="text" id="'+
|
||||
o+'_jGraduate_x1" size="3" title="Enter starting x value between 0.0 and 1.0"/><label> y:</label><input type="text" id="'+o+'_jGraduate_y1" size="3" title="Enter starting y value between 0.0 and 1.0"/></div></div><div class="jGraduate_StopSection"><label class="jGraduate_Form_Heading">End Point</label><div class="jGraduate_Form_Section"><label>x:</label><input type="text" id="'+o+'_jGraduate_x2" size="3" title="Enter ending x value between 0.0 and 1.0"/><label> y:</label><input type="text" id="'+
|
||||
|
@ -34,25 +34,25 @@ o+'_jGraduate_match_ctr"/></label><br/><label>x:</label><input type="text" id="'
|
|||
o+'_jGraduate_Radius" class="jGraduate_SliderBar jGraduate_Radius" title="Click to set radius"><img id="'+o+'_jGraduate_RadiusArrows" class="jGraduate_RadiusArrows" src="'+B.images.clientPath+'rangearrows2.gif"></div><label><input type="text" id="'+o+'_jGraduate_RadiusInput" size="3" value="100"/>%</label></div><div class="jGraduate_Slider jGraduate_EllipField jGraduate_rg_field"><label class="prelabel">Ellip:</label><div id="'+o+'_jGraduate_Ellip" class="jGraduate_SliderBar jGraduate_Ellip" title="Click to set Ellip"><img id="'+
|
||||
o+'_jGraduate_EllipArrows" class="jGraduate_EllipArrows" src="'+B.images.clientPath+'rangearrows2.gif"></div><label><input type="text" id="'+o+'_jGraduate_EllipInput" size="3" value="0"/>%</label></div><div class="jGraduate_Slider jGraduate_AngleField jGraduate_rg_field"><label class="prelabel">Angle:</label><div id="'+o+'_jGraduate_Angle" class="jGraduate_SliderBar jGraduate_Angle" title="Click to set Angle"><img id="'+o+'_jGraduate_AngleArrows" class="jGraduate_AngleArrows" src="'+B.images.clientPath+
|
||||
'rangearrows2.gif"></div><label><input type="text" id="'+o+'_jGraduate_AngleInput" size="3" value="0"/>\u00ba </label></div><div class="jGraduate_Slider jGraduate_OpacField"><label class="prelabel">Opac:</label><div id="'+o+'_jGraduate_Opac" class="jGraduate_SliderBar jGraduate_Opac" title="Click to set Opac"><img id="'+o+'_jGraduate_OpacArrows" class="jGraduate_OpacArrows" src="'+B.images.clientPath+'rangearrows2.gif"></div><label><input type="text" id="'+o+'_jGraduate_OpacInput" size="3" value="100"/>%</label></div></div><div class="jGraduate_OkCancel"><input type="button" id="'+
|
||||
o+'_jGraduate_Ok" class="jGraduate_Ok" value="OK"/><input type="button" id="'+o+'_jGraduate_Cancel" class="jGraduate_Cancel" value="Cancel"/></div>');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"/><input type="button" id="'+o+'_jGraduate_Cancel" class="jGraduate_Cancel" value="Cancel"/></div>');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=$("<div/>").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=$("<div/>").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=$("<div/>").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=$("<div/>").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;na<ua;na++)s(0,0,0,0,xa[na]);tb.val(W.getAttribute("spreadMethod")||
|
||||
"pad");var nb,kb=false;ta.setAttribute("fill-opacity",oa/100);$("#"+o+" div.grad_coord").mousedown(function(la){la.preventDefault();Ya=$(this);Ya.offset();nb=Ya.parent().offset();S.mousemove(bb).mouseup(Cb)});$("#"+o+"_jGraduate_Ok").bind("click touchstart",function(){q.paint.type=ba;q.paint[ba]=W.cloneNode(true);q.paint.solidColor=null;U()});$("#"+o+"_jGraduate_Cancel").bind("click touchstart",function(){M()});if(ba==="radialGradient")if(kb)Ia.show();else{Ia.hide();ka.fx.val("");ka.fy.val("")}$("#"+
|
||||
o+"_jGraduate_match_ctr")[0].checked=!kb;var zb,pb;$("#"+o+"_jGraduate_match_ctr").change(function(){kb=!this.checked;Ia.toggle(kb);ka.fx.val("");ka.fy.val("");var la=W;if(kb){var ca=zb||0.5,ja=pb||0.5;la.setAttribute("fx",ca);la.setAttribute("fy",ja);ka.fx.val(ca);ka.fy.val(ja)}else{zb=la.getAttribute("fx");pb=la.getAttribute("fy");la.removeAttribute("fx");la.removeAttribute("fy")}});xa=W.getElementsByTagNameNS(p.svg,"stop");ua=xa.length;if(ua<2){for(;ua<2;){W.appendChild(document.createElementNS(p.svg,
|
||||
"stop"));++ua}xa=W.getElementsByTagNameNS(p.svg,"stop")}var gb;oa=P=0;if(ba==="radialGradient"){X=W.gradientTransform.baseVal;if(X.numberOfItems===2){ua=X.getItem(0);X=X.getItem(1);if(ua.type===2&&X.type===3){ua=X.matrix;if(ua.a!==1)P=Math.round(-(1-ua.a)*100);else if(ua.d!==1)P=Math.round((1-ua.d)*100)}}else if(X.numberOfItems===3){da=X.getItem(0);ua=X.getItem(1);X=X.getItem(2);if(da.type===4&&ua.type===2&&X.type===3){oa=Math.round(da.angle);ua=X.matrix;if(ua.a!==1)P=Math.round(-(1-ua.a)*100);else if(ua.d!==
|
||||
1)P=Math.round((1-ua.d)*100)}}}P={radius:{handle:"#"+o+"_jGraduate_RadiusArrows",input:"#"+o+"_jGraduate_RadiusInput",val:(W.getAttribute("r")||0.5)*100},opacity:{handle:"#"+o+"_jGraduate_OpacArrows",input:"#"+o+"_jGraduate_OpacInput",val:q.paint.alpha||100},ellip:{handle:"#"+o+"_jGraduate_EllipArrows",input:"#"+o+"_jGraduate_EllipInput",val:P},angle:{handle:"#"+o+"_jGraduate_AngleArrows",input:"#"+o+"_jGraduate_AngleInput",val:oa}};$.each(P,function(la,ca){var ja=$(ca.handle);ja.mousedown(function(O){var T=
|
||||
ja.parent();gb={type:la,elem:ja,input:$(ca.input),parent:T,offset:T.offset()};S.mousemove(ub).mouseup(vb);O.preventDefault()});$(ca.input).val(ca.val).change(function(){var O=+this.value,T=0,ea=ba==="radialGradient";switch(la){case "radius":ea&&W.setAttribute("r",O/100);T=Math.pow(O/100,0.4)/2*145;break;case "opacity":q.paint.alpha=O;ta.setAttribute("fill-opacity",O/100);T=O*1.45;break;case "ellip":hb=Ma=1;if(O===0){T=72.5;break}if(O>99.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;na<ua;na++)s(0,0,0,0,xa[na]);tb.val(X.getAttribute("spreadMethod")||
|
||||
"pad");var nb,kb=false;ta.setAttribute("fill-opacity",oa/100);$("#"+o+" div.grad_coord").mousedown(function(la){la.preventDefault();Ya=$(this);Ya.offset();nb=Ya.parent().offset();S.mousemove(bb).mouseup(Cb)});$("#"+o+"_jGraduate_Ok").bind("click touchstart",function(){q.paint.type=ba;q.paint[ba]=X.cloneNode(true);q.paint.solidColor=null;U()});$("#"+o+"_jGraduate_Cancel").bind("click touchstart",function(){M()});if(ba==="radialGradient")if(kb)Ia.show();else{Ia.hide();ka.fx.val("");ka.fy.val("")}$("#"+
|
||||
o+"_jGraduate_match_ctr")[0].checked=!kb;var zb,pb;$("#"+o+"_jGraduate_match_ctr").change(function(){kb=!this.checked;Ia.toggle(kb);ka.fx.val("");ka.fy.val("");var la=X;if(kb){var ca=zb||0.5,ja=pb||0.5;la.setAttribute("fx",ca);la.setAttribute("fy",ja);ka.fx.val(ca);ka.fy.val(ja)}else{zb=la.getAttribute("fx");pb=la.getAttribute("fy");la.removeAttribute("fx");la.removeAttribute("fy")}});xa=X.getElementsByTagNameNS(p.svg,"stop");ua=xa.length;if(ua<2){for(;ua<2;){X.appendChild(document.createElementNS(p.svg,
|
||||
"stop"));++ua}xa=X.getElementsByTagNameNS(p.svg,"stop")}var gb;oa=P=0;if(ba==="radialGradient"){W=X.gradientTransform.baseVal;if(W.numberOfItems===2){ua=W.getItem(0);W=W.getItem(1);if(ua.type===2&&W.type===3){ua=W.matrix;if(ua.a!==1)P=Math.round(-(1-ua.a)*100);else if(ua.d!==1)P=Math.round((1-ua.d)*100)}}else if(W.numberOfItems===3){da=W.getItem(0);ua=W.getItem(1);W=W.getItem(2);if(da.type===4&&ua.type===2&&W.type===3){oa=Math.round(da.angle);ua=W.matrix;if(ua.a!==1)P=Math.round(-(1-ua.a)*100);else if(ua.d!==
|
||||
1)P=Math.round((1-ua.d)*100)}}}P={radius:{handle:"#"+o+"_jGraduate_RadiusArrows",input:"#"+o+"_jGraduate_RadiusInput",val:(X.getAttribute("r")||0.5)*100},opacity:{handle:"#"+o+"_jGraduate_OpacArrows",input:"#"+o+"_jGraduate_OpacInput",val:q.paint.alpha||100},ellip:{handle:"#"+o+"_jGraduate_EllipArrows",input:"#"+o+"_jGraduate_EllipInput",val:P},angle:{handle:"#"+o+"_jGraduate_AngleArrows",input:"#"+o+"_jGraduate_AngleInput",val:oa}};$.each(P,function(la,ca){var ja=$(ca.handle);ja.mousedown(function(O){var T=
|
||||
ja.parent();gb={type:la,elem:ja,input:$(ca.input),parent:T,offset:T.offset()};S.mousemove(ub).mouseup(vb);O.preventDefault()});$(ca.input).val(ca.val).change(function(){var O=+this.value,T=0,ea=ba==="radialGradient";switch(la){case "radius":ea&&X.setAttribute("r",O/100);T=Math.pow(O/100,0.4)/2*145;break;case "opacity":q.paint.alpha=O;ta.setAttribute("fill-opacity",O/100);T=O*1.45;break;case "ellip":hb=Ma=1;if(O===0){T=72.5;break}if(O>99.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 <a href='http://opera.com'>latest version</a> 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 <a href='http://opera.com'>latest version</a> 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;F<I.length;++F)if(I[F]!=null){var w=Y(I[F]);w.numberOfItems?w.insertItemBefore(d.createSVGTransform(),0):w.appendItem(d.createSVGTransform())}}else if(!F){Qa();Fa="multiselect";if(ua==null)ua=Ia.getRubberBandBox();
|
||||
z*=o;v*=o;ma(ua,{x:z,y:v,width:0,height:0,display:"inline"},100)}break;case "zoom":Ma=true;if(ua==null)ua=Ia.getRubberBandBox();ma(ua,{x:L*o,y:L*o,width:0,height:0,display:"inline"},100);break;case "resize":Ma=true;h=D;l=H;G=svgedit.utilities.getBBox($("#selectedBox0")[0]);var C={};$.each(G,function(K,R){C[K]=R/o});G=C;F=oa(E)?1:0;if(qa(n)){n.insertItemBefore(d.createSVGTransform(),F);n.insertItemBefore(d.createSVGTransform(),F);n.insertItemBefore(d.createSVGTransform(),F)}else{n.appendItem(d.createSVGTransform());
|
||||
n.appendItem(d.createSVGTransform());n.appendItem(d.createSVGTransform());if(svgedit.browser.supportsNonScalingStroke()){if(D=svgedit.browser.isChrome())w=function(K){var R=K.getAttributeNS(null,"stroke");K.removeAttributeNS(null,"stroke");setTimeout(function(){K.setAttributeNS(null,"stroke",R)},1)};E.style.vectorEffect="non-scaling-stroke";D&&w(E);H=E.getElementsByTagName("*");L=H.length;for(F=0;F<L;F++){H[F].style.vectorEffect="non-scaling-stroke";D&&w(H[F])}}}break;case "fhellipse":case "fhrect":case "fhpath":Ma=
|
||||
true;e=L+","+N+" ";w=M.stroke_width==0?1:M.stroke_width;S({element:"polyline",curStyles:true,attr:{points:e,id:ja(),fill:"none",opacity:M.opacity/2,"stroke-linecap":"round",style:"pointer-events:none"}});A.minx=L;A.maxx=L;A.miny=N;A.maxy=N;break;case "image":Ma=true;w=S({element:"image",attr:{x:D,y:H,width:0,height:0,id:ja(),opacity:M.opacity/2,style:"pointer-events:inherit"}});X(w,Ea);qb(w);break;case "square":case "rect":Ma=true;h=D;l=H;S({element:"rect",curStyles:true,attr:{x:D,y:H,width:0,height:0,
|
||||
true;e=L+","+N+" ";w=M.stroke_width==0?1:M.stroke_width;S({element:"polyline",curStyles:true,attr:{points:e,id:ja(),fill:"none",opacity:M.opacity/2,"stroke-linecap":"round",style:"pointer-events:none"}});A.minx=L;A.maxx=L;A.miny=N;A.maxy=N;break;case "image":Ma=true;w=S({element:"image",attr:{x:D,y:H,width:0,height:0,id:ja(),opacity:M.opacity/2,style:"pointer-events:inherit"}});W(w,Ea);qb(w);break;case "square":case "rect":Ma=true;h=D;l=H;S({element:"rect",curStyles:true,attr:{x:D,y:H,width:0,height:0,
|
||||
id:ja(),opacity:M.opacity/2}});break;case "line":Ma=true;w=M.stroke_width==0?1:M.stroke_width;S({element:"line",curStyles:true,attr:{x1:D,y1:H,x2:D,y2:H,id:ja(),stroke:M.stroke,"stroke-width":w,"stroke-dasharray":M.stroke_dasharray,"stroke-linejoin":M.stroke_linejoin,"stroke-linecap":M.stroke_linecap,"stroke-opacity":M.stroke_opacity,fill:"none",opacity:M.opacity/2,style:"pointer-events:none"}});break;case "circle":Ma=true;S({element:"circle",curStyles:true,attr:{cx:D,cy:H,r:0,id:ja(),opacity:M.opacity/
|
||||
2}});break;case "ellipse":Ma=true;S({element:"ellipse",curStyles:true,attr:{cx:D,cy:H,rx:0,ry:0,id:ja(),opacity:M.opacity/2}});break;case "text":Ma=true;S({element:"text",curStyles:true,attr:{x:D,y:H,id:ja(),fill:Ya.fill,"stroke-width":Ya.stroke_width,"font-size":Ya.font_size,"font-family":Ya.font_family,"text-anchor":"left","xml:space":"preserve",opacity:M.opacity}});break;case "path":case "pathedit":h*=o;l*=o;Ka.mouseDown(u,E,h,l);Ma=true;break;case "textedit":h*=o;l*=o;ib.mouseDown(u,E,h,l);Ma=
|
||||
true;break;case "rotate":Ma=true;b.undoMgr.beginUndoableChange("transform",I);document.getElementById("workarea").className="rotate"}w=pb("mouseDown",{event:u,start_x:h,start_y:l,selectedElements:I},true);$.each(w,function(K,R){if(R&&R.started)Ma=true});if(Fa)document.getElementById("workarea").className=Fa=="resize"?u.target.style.cursor:Fa}}).mousemove(function(u){if(!(u.originalEvent.touches&&u.originalEvent.touches.length>1))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=l<y?l:l-C}else{w=Math.min(h,x);N=Math.min(l,y)}if(u.altKey){L*=2;C*=2;w=h-L/2;N=l-C/2}if(m.gridSnapping){L=xa(L);C=xa(C);w=xa(w);N=xa(N)}ma(E,{width:L,height:C,x:w,y:N},1E3);break;case "circle":L=$(E).attr(["cx","cy"]);C=L.cx;w=L.cy;L=Math.sqrt((x-C)*(x-C)+(y-w)*(y-w));if(m.gridSnapping)L=xa(L);E.setAttributeNS(null,"r",L);break;case "ellipse":L=$(E).attr(["cx","cy"]);C=Math.abs(h+(x-h)/2);w=Math.abs(l+(y-l)/2);L=null;window.opera||d.suspendRedraw(1E3);if(m.gridSnapping){x=xa(x);C=xa(C);y=xa(y);
|
||||
w=xa(w)}N=Math.abs(h-C);n=Math.abs(l-w);if(u.shiftKey){n=N;w=y>l?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;D<u;++D){if(I[D]==null)break;I[D].firstChild||Ia.requestSelector(I[D]).resize()}}else{D=u.target;if(I[0].nodeName==="path"&&I[1]==null)Ka.select(I[0]);else u.shiftKey&&
|
||||
|
@ -274,7 +274,7 @@ function l(Q,V){var aa=d.createSVGPoint();aa.x=Q;aa.y=V;if(N.length==1)return 0;
|
|||
aa.x=fa.x;aa.y=fa.y}aa.x*=o;aa.y*=o;return aa}function A(Q){h(0,F.textContent.length);$(this).unbind(Q)}function u(Q){if(R&&F){var V=P(Q.pageX,Q.pageY,sb);V=v(V.x*o,V.y*o);V=l(V.x,V.y);var aa=F.textContent,fa=aa.substr(0,V).replace(/[a-z0-9]+$/i,"").length;aa=aa.substr(V).match(/^[a-z0-9]+/i);h(fa,(aa?aa[0].length:0)+V);$(Q.target).click(A);setTimeout(function(){$(Q.target).unbind("click",A)},300)}}var F,H,D,E,L,N=[],n,w,C,K,R;return{select:function(Q,V,aa){F=Q;ib.toEditMode(V,aa)},start:function(Q){F=
|
||||
Q;ib.toEditMode()},mouseDown:function(Q,V,aa,fa){Q=v(aa,fa);H.focus();e(l(Q.x,Q.y));C=aa;K=fa},mouseMove:function(Q,V){if(!(evt.originalEvent.touches&&evt.originalEvent.touches.length>1)){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&&V<C+2&&V>C-2&&aa<K+2&&aa>K-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<Q;V++){var fa=F.getStartPositionOfChar(V);aa=F.getEndPositionOfChar(V);if(!svgedit.browser.supportsGoodTextCharPos()){var pa=b.contentW*o;fa.x-=pa;aa.x-=pa;fa.x/=o;aa.x/=o}N[V]={x:fa.x,y:n.y,width:aa.x-fa.x,height:n.height}}N.push({x:aa.x,width:0});h(H.selectionStart,H.selectionEnd,true)}}}}(),Ka=
|
||||
F.textContent.length,V=F.getAttribute("transform");n=svgedit.utilities.getBBox(F);w=V?X(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<Q;V++){var fa=F.getStartPositionOfChar(V);aa=F.getEndPositionOfChar(V);if(!svgedit.browser.supportsGoodTextCharPos()){var pa=b.contentW*o;fa.x-=pa;aa.x-=pa;fa.x/=o;aa.x/=o}N[V]={x:fa.x,y:n.y,width:aa.x-fa.x,height:n.height}}N.push({x:aa.x,width:0});h(H.selectionStart,H.selectionEnd,true)}}}}(),Ka=
|
||||
b.pathActions=function(){var e=false,h,l,z;svgedit.path.Path.prototype.endChanges=function(A){if(svgedit.browser.isWebkit()){var u=this.elem;u.setAttribute("d",Ka.convertPath(u))}A=new Oa(this.elem,{d:this.last_d},A);za(A);O("changed",[this.elem])};svgedit.path.Path.prototype.addPtsToSelection=function(A){$.isArray(A)||(A=[A]);for(var u=0;u<A.length;u++){var F=A[u],H=this.segs[F];H.ptgrip&&this.selected_pts.indexOf(F)==-1&&F>=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<n.length;u++){var w=n[u];v.setAttribute(w.nodeName,w.nodeValue)}v.id=ja();tb[h]={symbol:v,xform:G};mb().appendChild(v);z.addSubCommand(new Da(v))}var C=
|
||||
f.createElementNS(c,"use");C.id=ja();X(C,"#"+v.id);(J||B().getCurrentLayer()).appendChild(C);z.addSubCommand(new Da(C));Qa();C.setAttribute("transform",G);Wa(C);$(C).data("symbol",v).data("ref",v);wb([C]);za(z);O("changed",[k])}catch(K){console.log(K);return false}return true};var Gb=b.identifyLayers=function(){Lb();B().identifyLayers()};this.createLayer=function(e){var h=new Ba("Create Layer");e=B().createLayer(e);h.addSubCommand(new Da(e));za(h);Qa();O("changed",[e])};this.cloneLayer=function(e){var h=
|
||||
f.createElementNS(c,"use");C.id=ja();W(C,"#"+v.id);(J||B().getCurrentLayer()).appendChild(C);z.addSubCommand(new Da(C));Qa();C.setAttribute("transform",G);Wa(C);$(C).data("symbol",v).data("ref",v);wb([C]);za(z);O("changed",[k])}catch(K){console.log(K);return false}return true};var Gb=b.identifyLayers=function(){Lb();B().identifyLayers()};this.createLayer=function(e){var h=new Ba("Create Layer");e=B().createLayer(e);h.addSubCommand(new Da(e));za(h);Qa();O("changed",[e])};this.cloneLayer=function(e){var h=
|
||||
new Ba("Duplicate Layer"),l=f.createElementNS(c,"g"),z=f.createElementNS(c,"title");z.textContent=e;l.appendChild(z);z=B().getCurrentLayer();$(z).after(l);z=z.childNodes;for(var v=0;v<z.length;v++){var G=z[v];G.localName!="title"&&l.appendChild(la(G))}Qa();Gb();h.addSubCommand(new Da(l));za(h);b.setCurrentLayer(e);O("changed",[l])};this.deleteCurrentLayer=function(){var e=B().getCurrentLayer(),h=e.nextSibling,l=e.parentNode;if(e=B().deleteCurrentLayer()){var z=new Ba("Delete Layer");z.addSubCommand(new La(e,
|
||||
h,l));za(z);Qa();O("changed",[l]);return true}return false};this.setCurrentLayer=function(e){(e=B().setCurrentLayer(svgedit.utilities.toXml(e)))&&Qa();return e};this.renameCurrentLayer=function(e){var h=B();if(h.current_layer){var l=h.current_layer;if(!b.setCurrentLayer(e)){for(var z=new Ba("Rename Layer"),v=0;v<h.getNumLayers();++v)if(h.all_layers[v][1]==l)break;var G=h.getLayerName(v);h.all_layers[v][0]=svgedit.utilities.toXml(e);var A=l.childNodes.length;for(v=0;v<A;++v){var u=l.childNodes.item(v);
|
||||
if(u&&u.tagName=="title"){for(;u.firstChild;)u.removeChild(u.firstChild);u.textContent=e;z.addSubCommand(new Oa(u,{"#text":G}));za(z);O("changed",[l]);return true}}}h.current_layer=l}return false};this.setCurrentLayerPosition=function(e){var h=B();if(h.current_layer&&e>=0&&e<h.getNumLayers()){for(var l=0;l<h.getNumLayers();++l)if(h.all_layers[l][1]==h.current_layer)break;if(l==h.getNumLayers())return false;if(l!=e){var z=null,v=h.current_layer.nextSibling;if(e>l){if(e<h.getNumLayers()-1)z=h.all_layers[e+
|
||||
|
@ -347,18 +347,18 @@ height:"200%"},100);else if(!svgedit.browser.isWebkit()){v.removeAttribute("x");
|
|||
0){A.removeAttribute("filter");F.addSubCommand(new Oa(A,H))}else{db("filter","url(#"+u+"_blur)");F.addSubCommand(new Oa(A,H));b.setBlurOffsets(l,v);h=F;b.undoMgr.beginUndoableChange("stdDeviation",[l?l.firstChild:null]);if(G){b.setBlurNoUndo(v);e()}}}}})();this.getBold=function(){var e=I[0];if(e!=null&&e.tagName=="text"&&I[1]==null)return e.getAttribute("font-weight")=="bold";return false};this.setBold=function(e){var h=I[0];if(h!=null&&h.tagName=="text"&&I[1]==null)db("font-weight",e?"bold":"normal");
|
||||
I[0].textContent||ib.setCursor()};this.getItalic=function(){var e=I[0];if(e!=null&&e.tagName=="text"&&I[1]==null)return e.getAttribute("font-style")=="italic";return false};this.setItalic=function(e){var h=I[0];if(h!=null&&h.tagName=="text"&&I[1]==null)db("font-style",e?"italic":"normal");I[0].textContent||ib.setCursor()};this.getFontFamily=function(){return Ya.font_family};this.setFontFamily=function(e){Ya.font_family=e;db("font-family",e);I[0]&&!I[0].textContent&&ib.setCursor()};this.setFontColor=
|
||||
function(e){Ya.fill=e;db("fill",e)};this.getFontSize=function(){return Ya.fill};this.getFontSize=function(){return Ya.font_size};this.setFontSize=function(e){Ya.font_size=e;db("font-size",e);I[0].textContent||ib.setCursor()};this.getText=function(){var e=I[0];if(e==null)return"";return e.textContent};this.setTextContent=function(e){db("#text",e);ib.init(e);ib.setCursor()};this.setImageURL=function(e){var h=I[0];if(h){var l=$(h).attr(["width","height"]);l=!l.width||!l.height;var z=da(h);if(z!==e)l=
|
||||
true;else if(!l)return;var v=new Ba("Change Image URL");X(h,e);v.addSubCommand(new Oa(h,{"#href":z}));l?$(new Image).load(function(){var G=$(h).attr(["width","height"]);$(h).attr({width:this.width,height:this.height});Ia.requestSelector(h).resize();v.addSubCommand(new Oa(h,G));za(v);O("changed",[h])}).attr("src",e):za(v)}};this.setLinkURL=function(e){var h=I[0];if(h){if(h.tagName!=="a"){h=$(h).parents("a");if(h.length)h=h[0];else return}var l=da(h);if(l!==e){var z=new Ba("Change Link URL");X(h,e);
|
||||
true;else if(!l)return;var v=new Ba("Change Image URL");W(h,e);v.addSubCommand(new Oa(h,{"#href":z}));l?$(new Image).load(function(){var G=$(h).attr(["width","height"]);$(h).attr({width:this.width,height:this.height});Ia.requestSelector(h).resize();v.addSubCommand(new Oa(h,G));za(v);O("changed",[h])}).attr("src",e):za(v)}};this.setLinkURL=function(e){var h=I[0];if(h){if(h.tagName!=="a"){h=$(h).parents("a");if(h.length)h=h[0];else return}var l=da(h);if(l!==e){var z=new Ba("Change Link URL");W(h,e);
|
||||
z.addSubCommand(new Oa(h,{"#href":l}));za(z)}}};this.elementsAreSame=function(e){return!e.length||e[0]==null?null:I.every(function(h){return h&&I[0]?h.nodeName==I[0].nodeName:null})};this.setRectRadius=function(e){b.elementsAreSame(I)&&I[0].tagName=="rect"&&I.forEach(function(h){var l=h.getAttribute("rx");if(l!=e){h.setAttribute("rx",e);h.setAttribute("ry",e);za(new Oa(h,{rx:l,ry:l},"Radius"));O("changed",[h])}})};this.makeHyperlink=function(e){b.groupSelectedElements("a",e)};this.removeHyperlink=
|
||||
function(){b.ungroupSelectedElement()};this.setSegType=function(e){Ka.setSegType(e)};this.convertToPath=function(e,h){if(e==null)$.each(I,function(R,Q){Q&&b.convertToPath(Q)});else{if(!h)var l=new Ba("Convert element to Path");var z=h?{}:{fill:M.fill,"fill-opacity":M.fill_opacity,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,opacity:M.opacity,visibility:"hidden"};
|
||||
$.each(["marker-start","marker-end","marker-mid","filter","clip-path"],function(){if(e.getAttribute(this))z[this]=e.getAttribute(this)});var v=S({element:"path",attr:z}),G=e.getAttribute("transform");G&&v.setAttribute("transform",G);var A=e.id,u=e.parentNode;e.nextSibling?u.insertBefore(v,e):u.appendChild(v);var F="",H=function(R){$.each(R,function(Q,V){var aa=V[1];F+=V[0];for(var fa=0;fa<aa.length;fa+=2)F+=aa[fa]+","+aa[fa+1]+" "})},D=1.81;switch(e.tagName){case "ellipse":case "circle":var E=$(e).attr(["rx",
|
||||
"ry","cx","cy"]),L=E.cx,N=E.cy,n=E.rx;E=E.ry;if(e.tagName=="circle")n=E=$(e).attr("r");H([["M",[L-n,N]],["C",[L-n,N-E/D,L-n/D,N-E,L,N-E]],["C",[L+n/D,N-E,L+n,N-E/D,L+n,N]],["C",[L+n,N+E/D,L+n/D,N+E,L,N+E]],["C",[L-n/D,N+E,L-n,N+E/D,L-n,N]],["Z",[]]]);break;case "path":F=e.getAttribute("d");break;case "line":E=$(e).attr(["x1","y1","x2","y2"]);F="M"+E.x1+","+E.y1+"L"+E.x2+","+E.y2;break;case "polyline":case "polygon":F="M"+e.getAttribute("points");break;case "rect":E=$(e).attr(["rx","ry"]);n=E.rx;E=
|
||||
E.ry;var w=e.getBBox();L=w.x;N=w.y;var C=w.width;w=w.height;D=4-D;!n&&!E?H([["M",[L,N]],["L",[L+C,N]],["L",[L+C,N+w]],["L",[L,N+w]],["L",[L,N]],["Z",[]]]):H([["M",[L,N+E]],["C",[L,N+E/D,L+n/D,N,L+n,N]],["L",[L+C-n,N]],["C",[L+C-n/D,N,L+C,N+E/D,L+C,N+E]],["L",[L+C,N+w-E]],["C",[L+C,N+w-E/D,L+C-n/D,N+w,L+C-n,N+w]],["L",[L+n,N+w]],["C",[L+n/D,N+w,L,N+w-E/D,L,N+w-E]],["L",[L,N+E]],["Z",[]]]);break;default:v.parentNode.removeChild(v)}F&&v.setAttribute("d",F);if(h){Ka.resetOrientation(v);l=false;try{l=
|
||||
v.getBBox()}catch(K){}v.parentNode.removeChild(v);return l}else{if(G){G=Y(v);qa(G)&&Ka.resetOrientation(v)}l.addSubCommand(new La(e,e.nextSibling,u));l.addSubCommand(new Da(v));Qa();e.parentNode.removeChild(e);v.setAttribute("id",A);v.removeAttribute("visibility");wb([v],true);za(l)}}};var Db=this.changeSelectedAttributeNoUndo=function(e,h,l){var z=d.suspendRedraw(1E3);Fa=="pathedit"&&Ka.moveNode(e,h);l=l||I;for(var v=l.length,G=["g","polyline","path"];v--;){var A=l[v];if(A!=null){Fa==="textedit"&&
|
||||
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"?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;z<h;++z){var v=I[z];if(v==null)break;var G=v.parentNode,A=v;Ia.releaseSelector(A);svgedit.path.removePath_(A.id);if(G.tagName==="a"&&G.childNodes.length===1){A=G;G=G.parentNode}var u=A.nextSibling;A=G.removeChild(A);l.push(v);I[z]=null;e.addSubCommand(new La(A,u,G))}e.isEmpty()||za(e);O("changed",l);Qa()};this.cutSelectedElements=function(){for(var e=new Ba("Cut Elements"),h=I.length,l=[],z=0;z<h;++z){var v=I[z];if(v==null)break;var G=v.parentNode,A=v;Ia.releaseSelector(A);svgedit.path.removePath_(A.id);
|
||||
var u=A.nextSibling;A=G.removeChild(A);l.push(v);I[z]=null;e.addSubCommand(new La(A,u,G))}e.isEmpty()||za(e);O("changed",l);Qa();b.clipBoard=l};this.copySelectedElements=function(){b.clipBoard=$.merge([],I)};this.pasteElements=function(){var e=b.clipBoard,h=e.length;if(h){for(var l=[],z=new Ba("Paste elements");h--;){var v=e[h];if(v){var G=la(v);if(!ra(v.id))G.id=v.id;l.push(G);(J||B().getCurrentLayer()).appendChild(G);z.addSubCommand(new Da(G))}}svgCanvas.clearSelection();setTimeout(function(){Bb(l)},
|
||||
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"&&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;F<z;F++){var N=l[F];if(N.nodeType===1){if(D.opacity!==null&&D.opacity!==1){N.getAttribute("opacity");var n=Math.round((N.getAttribute("opacity")||1)*D.opacity*100)/100;db("opacity",n,[N])}if(D.filter){var w=n=this.getBlur(N);L||(L=this.getBlur(e));
|
||||
if(n)n=L-0+(n-0);else if(n===0)n=L;if(w)E=T(N.getAttribute("filter"));else if(E){E=la(E);mb().appendChild(E)}else E=T(D.filter);E.id=N.id+"_"+(E.firstChild.tagName==="feGaussianBlur"?"blur":"filter");db("filter","url(#"+E.id+")",[N]);if(n){db("stdDeviation",n,[E.firstChild]);b.setBlurOffsets(E,n)}}n=Y(N);if(~N.tagName.indexOf("Gradient"))n=null;if(n)if(N.tagName!=="defs")if(G.numberOfItems){if(H&&G.numberOfItems==1){var C=G.getItem(0).matrix,K=d.createSVGMatrix();if(w=oa(N))K=n.getItem(0).matrix;
|
||||
var R=svgedit.utilities.getBBox(N),Q=ga(n).matrix,V=P(R.x+R.width/2,R.y+R.height/2,Q);R=H+w;Q=d.createSVGTransform();Q.setRotate(R,V.x,V.y);C=ia(C,K,Q.matrix.inverse());w&&n.removeItem(0);if(R)n.numberOfItems?n.insertItemBefore(Q,0):n.appendItem(Q);if(C.e||C.f){w=d.createSVGTransform();w.setTranslate(C.e,C.f);n.numberOfItems?n.insertItemBefore(w,0):n.appendItem(w)}}else{w=N.getAttribute("transform");C={};C.transform=w?w:"";w=d.createSVGTransform();C=ga(n).matrix;K=C.inverse();C=ia(K,A,C);w.setMatrix(C);
|
||||
|
@ -371,7 +371,7 @@ h,false);za(z)}return A};this.alignSelectedElements=function(e,h){var l=[],z=Num
|
|||
F=l[D].height}break;case "largest":if((e=="l"||e=="c"||e=="r")&&(u==Number.MIN_VALUE||u<l[D].width)||(e=="t"||e=="m"||e=="b")&&(F==Number.MIN_VALUE||F<l[D].height)){z=l[D].x;G=l[D].y;v=l[D].x+l[D].width;A=l[D].y+l[D].height;u=l[D].width;F=l[D].height}break;default:if(l[D].x<z)z=l[D].x;if(l[D].y<G)G=l[D].y;if(l[D].x+l[D].width>v)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<H;++D){if(I[D]==null)break;
|
||||
var E=l[D];u[D]=0;F[D]=0;switch(e){case "l":u[D]=z-E.x;break;case "c":u[D]=(z+v)/2-(E.x+E.width/2);break;case "r":u[D]=v-(E.x+E.width);break;case "t":F[D]=G-E.y;break;case "m":F[D]=(G+A)/2-(E.y+E.height/2);break;case "b":F[D]=A-(E.y+E.height)}}this.moveSelectedElements(u,F)}};this.contentW=Eb().w;this.contentH=Eb().h;this.updateCanvas=function(e,h){d.setAttribute("width",e);d.setAttribute("height",h);var l=$("#canvasBackground")[0],z=k.getAttribute("x"),v=k.getAttribute("y"),G=e/2-this.contentW*o/
|
||||
2,A=h/2-this.contentH*o/2;ma(k,{width:this.contentW*o,height:this.contentH*o,x:G,y:A,viewBox:"0 0 "+this.contentW+" "+this.contentH});ma(l,{width:k.getAttribute("width"),height:k.getAttribute("height"),x:G,y:A});(l=ra("background_image"))&&ma(l,{width:"100%",height:"100%"});Ia.selectorParentGroup.setAttribute("transform","translate("+G+","+A+")");return{x:G,y:A,old_x:z,old_y:v,d_x:G-z,d_y:A-v}};this.setBackground=function(e,h){var l=ra("canvasBackground"),z=$(l).find("rect")[0],v=ra("background_image");
|
||||
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"})}X(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",
|
||||
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("<p>"+R.replace(/\n/g,"</p><p>")+"</p>").toggleClass("prompt",K=="prompt");w.empty();var aa=a('<input type="button" value="'+uiStrings.common.ok+'">').appendTo(w);K!="alert"&&a('<input type="button" value="'+uiStrings.common.cancel+'">').appendTo(w).on("click, touchstart",function(){n.hide();Q(false)});if(K=="prompt"){var fa=a('<input type="text">').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("<div>",{"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<V;Q++){var aa=R[Q].getAttribute("stroke-width");if(Q===0)K=aa;else if(K!==aa)K=null}a("#stroke_width").val(K===null?"":K);c.paintBox.fill.update(true);c.paintBox.stroke.update(true);break;default:c.paintBox.fill.update(true);c.paintBox.stroke.update(true);a("#stroke_width").val(W.getAttribute("stroke-width")||1);a("#stroke_style").val(W.getAttribute("stroke-dasharray")||"none");K=W.getAttribute("stroke-linejoin")||"miter";a("#linejoin_"+K).length!=
|
||||
0&&d(a("#linejoin_"+K)[0]);K=W.getAttribute("stroke-linecap")||"butt";a("#linecap_"+K).length!=0&&d(a("#linecap_"+K)[0])}if(W!=null){K=(W.getAttribute("opacity")||1)*100;a("#group_opacity").val(K);a("#opac_slider").slider("option","value",K);a("#elem_id").val(W.id)}}a("#path_node_panel").toggle(C);a("#tools_bottom_2,#tools_bottom_3").toggle(!C);if(C){a(".tool_button_current").removeClass("tool_button_current").addClass("tool_button");a("#tool_select").addClass("tool_button_current").removeClass("tool_button");
|
||||
db("#tool_select","select_node");ta=false;if(w.length)W=w[0]}else{if(w[0]){C=g.selectorManager.requestSelector(w[0]);C.reset(w[0]);C.selectorRect.setAttribute("display","inline")}db("#tool_select","select")}Ba();g.runExtensions("selectedChanged",{elems:w,selectedElement:W,multiselected:ta})});g.bind("transition",function(n,w){var C=g.getMode(),K=w[0];if(K){ta=w.length>=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<w.length;++K){var R=w[K];if(R&&R.tagName==="svg")H();else if(R&&W&&W.parentNode==null)W=R}c.show_save_warning=true;Ba();if(W&&C==="select"){c.paintBox.fill.update();c.paintBox.stroke.update()}g.runExtensions("elementChanged",{elems:w})});g.bind("saved",function(n,w){c.show_save_warning=false;w='<?xml version="1.0"?>\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<V;Q++){var aa=R[Q].getAttribute("stroke-width");if(Q===0)K=aa;else if(K!==aa)K=null}a("#stroke_width").val(K===null?"":K);c.paintBox.fill.update(true);c.paintBox.stroke.update(true);break;default:c.paintBox.fill.update(true);c.paintBox.stroke.update(true);a("#stroke_width").val(X.getAttribute("stroke-width")||1);a("#stroke_style").val(X.getAttribute("stroke-dasharray")||"none");K=X.getAttribute("stroke-linejoin")||"miter";a("#linejoin_"+K).length!=
|
||||
0&&d(a("#linejoin_"+K)[0]);K=X.getAttribute("stroke-linecap")||"butt";a("#linecap_"+K).length!=0&&d(a("#linecap_"+K)[0])}if(X!=null){K=(X.getAttribute("opacity")||1)*100;a("#group_opacity").val(K);a("#opac_slider").slider("option","value",K);a("#elem_id").val(X.id)}}a("#path_node_panel").toggle(C);a("#tools_bottom_2,#tools_bottom_3").toggle(!C);if(C){a(".tool_button_current").removeClass("tool_button_current").addClass("tool_button");a("#tool_select").addClass("tool_button_current").removeClass("tool_button");
|
||||
db("#tool_select","select_node");ta=false;if(w.length)X=w[0]}else{if(w[0]){C=g.selectorManager.requestSelector(w[0]);C.reset(w[0]);C.selectorRect.setAttribute("display","inline")}db("#tool_select","select")}Ba();g.runExtensions("selectedChanged",{elems:w,selectedElement:X,multiselected:ta})});g.bind("transition",function(n,w){var C=g.getMode(),K=w[0];if(K){ta=w.length>=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<w.length;++K){var R=w[K];if(R&&R.tagName==="svg")H();else if(R&&X&&X.parentNode==null)X=R}c.show_save_warning=true;Ba();if(X&&C==="select"){c.paintBox.fill.update();c.paintBox.stroke.update()}g.runExtensions("elementChanged",{elems:w})});g.bind("saved",function(n,w){c.show_save_warning=false;w='<?xml version="1.0"?>\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("<defs")!==-1){Q+="\n\n"+uiStrings.notification.defsFailOnSave;a.pref("save_notice_done","all");R="all"}else a.pref("save_notice_done","part");else a.pref("save_notice_done","all");R!=="part"&&K.alert(Q)}}});g.bind("exported",function(n,
|
||||
w){var C=w.issues;a("#export_canvas").length||a("<canvas>",{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='<a href="#" data-root="y">'+g.getCurrentDrawing().getCurrentLayerName()+"</a>";a(w).parentsUntil("#svgcontent > g").andSelf().each(function(){if(this.id){K+=" > "+this.id;C+=this!==w?' > <a href="#">'+this.id+"</a>":" > "+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='<a href="#" data-root="y">'+g.getCurrentDrawing().getCurrentLayerName()+"</a>";a(w).parentsUntil("#svgcontent > g").andSelf().each(function(){if(this.id){K+=" > "+this.id;C+=this!==w?' > <a href="#">'+this.id+"</a>":" > "+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("<div>",{id:ha.panel}).appendTo("#tools_top").hide());switch(ha.type){case "tool_button":var va='<div class="tool_button">'+ha.id+"</div>",Na=a(va).appendTo(Ra);ha.events&&a.each(ha.events,function(Va,cb){a(Na).bind(Va,cb)});break;case "select":va=
|
||||
"<label"+eb+'><select id="'+ha.id+'">';a.each(ha.options,function(Va,cb){va+='<option value="'+Va+'"'+(Va==ha.defval?" selected":"")+">"+cb+"</option>"});va+="</select></label>";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='<div id="'+ha.id+'" class="dropdown toolset" title="'+ha.title+'"><div id="cur_'+ha.id+'" class="icon_label"></div><button></button></div>';eb=a('<ul id="'+ha.id+'_opts"></ul>').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="<label"+eb+'><span id="'+ha.id+'_label">'+ha.label+':</span><input id="'+ha.id+'" title="'+ha.title+'" size="'+(ha.size||"4")+'" value="'+(ha.defval||"")+'" type="text"/></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<Jb)Na.children().eq(Va).before(ab);else{Na.append(ab);Ra.reverse()}}sa||ab.append(eb);ha.list||a.each(ha.events,function(yb,Hb){if(yb=="click")if(ha.type=="mode"){ha.includeWith?ab.bind(yb,Hb):ab.bind(yb,function(){$a(ab)&&Hb()});if(ha.key){a(document).bind("keydown",ha.key,Hb);ha.title&&ab.attr("title",
|
||||
ha.title+" ["+ha.key+"]")}}else ab.bind(yb,Hb);else ab.bind(yb,Hb)});ra(Za)});a.each(aa,function(){Ea(this.elem,this.list,this.callback,{seticon:true})});if(sa)Q=false;a.svgIcons(sa,{w:27,h:27,id_match:false,no_img:!B,fallback:fa,placement:pa,callback:function(){s.iconsize&&s.iconsize!="m"&&C();Q=true;V()}})}V()});g.textActions.setInputElem(a("#text")[0]);var za='<div class="palette_item" data-rgb="none"></div>';a.each(["#000000","#3f3f3f","#7f7f7f","#bfbfbf","#ffffff","#ff0000","#ff7f00","#ffff00",
|
||||
"#7fff00","#00ff00","#00ff7f","#00ffff","#007fff","#0000ff","#7f00ff","#ff00ff","#ff007f","#7f0000","#7f3f00","#7f7f00","#3f7f00","#007f00","#007f3f","#007f7f","#003f7f","#00007f","#3f007f","#7f007f","#7f003f","#ffaaaa","#ffd4aa","#ffffaa","#d4ffaa","#aaffaa","#aaffd4","#aaffff","#aad4ff"],function(n,w){za+='<div class="palette_item" style="background-color: '+w+';" data-rgb="'+w+'"></div>'});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("<p/>").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("<p/>").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('<input type="hidden">');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,<title>"+n+"</title><h1>"+n+"</h1>")}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('<style id="wireframe_rules"></style>').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('<style id="tool_size_rules"></style>').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('<svg xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%"\t\t\t\t\tfill="#'+K.color+'" opacity="'+K.opacity+'"/>\t\t\t\t\t<defs><linearGradient id="gradbox_"/></defs></svg>',"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<pa;fa++){var sa=aa[fa].getAttribute(Q);
|
||||
if(fa===0)V=sa;else if(V!==sa){V=null;break}}if(V===null){aa=null;return}aa=V;V=1;break;default:V=parseFloat(W.getAttribute(Q+"-opacity"));if(isNaN(V))V=1;aa=Q==="fill"?"black":"none";aa=W.getAttribute(Q)||aa}if(R){g.setColor(Q,aa,true);g.setPaintOpacity(Q,V,true)}V*=100;this.setPaint(Ja(aa,V,Q))}};this.prep=function(){switch(this.paint.type){case "linearGradient":case "radialGradient":var R=new a.jGraduate.Paint({copy:this.paint});g.setPaint(w,R)}}};c.paintBox.fill=new q("#fill_color","fill");c.paintBox.stroke=
|
||||
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(X){var Q=this.type;switch(X.tagName){case "use":case "image":case "foreignObject":return;case "g":case "a":for(var V=null,aa=X.getElementsByTagName("*"),fa=0,pa=aa.length;fa<pa;fa++){var sa=aa[fa].getAttribute(Q);
|
||||
if(fa===0)V=sa;else if(V!==sa){V=null;break}}if(V===null){aa=null;return}aa=V;V=1;break;default:V=parseFloat(X.getAttribute(Q+"-opacity"));if(isNaN(V))V=1;aa=Q==="fill"?"black":"none";aa=X.getAttribute(Q)||aa}if(R){g.setColor(Q,aa,true);g.setPaintOpacity(Q,V,true)}V*=100;this.setPaint(Ja(aa,V,Q))}};this.prep=function(){switch(this.paint.type){case "linearGradient":case "radialGradient":var R=new a.jGraduate.Paint({copy:this.paint});g.setPaint(w,R)}}};c.paintBox.fill=new q("#fill_color","fill");c.paintBox.stroke=
|
||||
new q("#stroke_color","stroke");c.paintBox.canvas=new q("#canvas_color","canvas");a("#stroke_width").val(curConfig.initStroke.width);a("#group_opacity").val(curConfig.initOpacity*100);q=c.paintBox.fill.rect.cloneNode(false);q.setAttribute("style","vector-effect:non-scaling-stroke");var A=q.style.vectorEffect==="non-scaling-stroke";q.removeAttribute("style");q=c.paintBox.fill.rect.ownerDocument.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur");typeof q.stdDeviationX==="undefined"&&a("#tool_blur").hide();
|
||||
a(q).remove();setTimeout(function(){g.embedImage("images/placeholder.svg",function(n){if(!n){a("#image_save_opts [value=embed]").attr("disabled","disabled");a("#image_save_opts input").val(["ref"]);s.img_save="ref";a("#image_opt_embed").css("color","#666").attr("title",uiStrings.notification.featNotSupported)}})},1E3);a("#tool_fill").click(function(){if(a("#tool_fill").hasClass("active"))G(a("#fill_color"));else{a("#tool_fill").addClass("active");a("#tool_stroke").removeClass("active")}});a("#tool_stroke").on("click",
|
||||
function(){if(a("#tool_stroke").hasClass("active"))G(a("#stroke_color"));else{a("#tool_stroke").addClass("active");a("#tool_fill").removeClass("active")}});a("#tool_canvas").on("click touchstart",function(){G(a("#canvas_color"))});a("#tool_stroke").on("touchstart",function(){a("#tool_stroke").addClass("active");a("#tool_fill").removeClass("active");G(a("#stroke_color"))});a("#tool_fill").on("touchstart",function(){a("#tool_fill").addClass("active");a("#tool_stroke").removeClass("active");G(a("#fill_color"))});
|
||||
|
@ -486,7 +486,7 @@ step:1,callback:changeAttribute,cursor:false});a("#ellipse_cx").dragInput({min:0
|
|||
max:null,step:1,callback:changeAttribute,cursor:false});a("#selected_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#path_node_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#path_node_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#image_width").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#line_x1").dragInput({min:null,max:null,step:1,callback:changeAttribute,
|
||||
cursor:false});a("#line_x2").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#line_y1").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#line_y2").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#path_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#path_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#rect_x").dragInput({min:null,max:null,
|
||||
step:1,callback:changeAttribute,cursor:false});a("#rect_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#g_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#g_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#image_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#text_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#text_x").dragInput({min:null,
|
||||
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&&W&&["line","polyline"].indexOf(W.nodeName)>=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<g.length;c+=1)g[c]=this._trimAlignValue(g[c]);return g},_trimAlignValue:function(p){if(p<=this._valueMin())return this._valueMin();if(p>=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;Z<ia.length;Z++)ia[Z].call(d,d,X)},ga=function(X){var Z=b.offset();Y={l:Z.left|0,t:Z.top|0};clearTimeout(P);P=setTimeout(function(){ta.call(d,X)},0);a(document).bind("mousemove",ba).bind("mouseup",W);X.preventDefault()},ba=function(X){clearTimeout(P);P=setTimeout(function(){ta.call(d,
|
||||
X)},0);X.stopPropagation();X.preventDefault();return false},W=function(X){a(document).unbind("mouseup",W).unbind("mousemove",ba);X.stopPropagation();X.preventDefault();return false},ta=function(X){var Z=X.pageX-Y.l;X=X.pageY-Y.t;var oa=b.w,ra=b.h;if(Z<0)Z=0;else if(Z>oa)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(ma<q)ma=q;else if(ma>B)ma=B;if(I!=ma){I=ma;ra=true}}if(na!=null){if(na<J)na=J;else if(na>U)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;Z<ia.length;Z++)ia[Z].call(d,d,W)},ga=function(W){var Z=b.offset();Y={l:Z.left|0,t:Z.top|0};clearTimeout(P);P=setTimeout(function(){ta.call(d,W)},0);a(document).bind("mousemove",ba).bind("mouseup",X);W.preventDefault()},ba=function(W){clearTimeout(P);P=setTimeout(function(){ta.call(d,
|
||||
W)},0);W.stopPropagation();W.preventDefault();return false},X=function(W){a(document).unbind("mouseup",X).unbind("mousemove",ba);W.stopPropagation();W.preventDefault();return false},ta=function(W){var Z=W.pageX-Y.l;W=W.pageY-Y.t;var oa=b.w,ra=b.h;if(Z<0)Z=0;else if(Z>oa)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(ma<q)ma=q;else if(ma>B)ma=B;if(I!=ma){I=ma;ra=true}}if(na!=null){if(na<J)na=J;else if(na>U)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(ka<da)return da;return ka},ta=function(ka,da){var X=ka.val("all");if(da!=B.get(0))B.val(X!=null?X.r:"");if(da!=o.get(0))o.val(X!=null?X.g:"");if(da!=J.get(0))J.val(X!=null?X.b:"");if(U&&da!=U.get(0))U.val(X!=null?Math.precision(X.a*100/255,k):"");if(da!=M.get(0))M.val(X!=
|
||||
null?X.h:"");if(da!=I.get(0))I.val(X!=null?X.s:"");if(da!=S.get(0))S.val(X!=null?X.v:"");if(da!=Y.get(0)&&(d&&da!=d.get(0)||!d))Y.val(X!=null?X.hex:"");if(d&&da!=d.get(0)&&da!=Y.get(0))d.val(X!=null?X.hex:"");if(P&&da!=P.get(0))P.val(X!=null?X.ahex.substring(6):"")};a.extend(true,q,{destroy:function(){B.add(o).add(J).add(U).add(M).add(I).add(S).add(Y).add(d).add(P).unbind("keyup",qa).unbind("blur",ga);B.add(o).add(J).add(U).add(M).add(I).add(S).unbind("keydown",ia);f.unbind(ta);P=Y=S=I=M=U=J=o=B=
|
||||
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},X=function(ka,da,W){if(ka==""||isNaN(ka))return da;if(ka>W)return W;if(ka<da)return da;return ka},ta=function(ka,da){var W=ka.val("all");if(da!=B.get(0))B.val(W!=null?W.r:"");if(da!=o.get(0))o.val(W!=null?W.g:"");if(da!=J.get(0))J.val(W!=null?W.b:"");if(U&&da!=U.get(0))U.val(W!=null?Math.precision(W.a*100/255,k):"");if(da!=M.get(0))M.val(W!=
|
||||
null?W.h:"");if(da!=I.get(0))I.val(W!=null?W.s:"");if(da!=S.get(0))S.val(W!=null?W.v:"");if(da!=Y.get(0)&&(d&&da!=d.get(0)||!d))Y.val(W!=null?W.hex:"");if(d&&da!=d.get(0)&&da!=Y.get(0))d.val(W!=null?W.hex:"");if(P&&da!=P.get(0))P.val(W!=null?W.ahex.substring(6):"")};a.extend(true,q,{destroy:function(){B.add(o).add(J).add(U).add(M).add(I).add(S).add(Y).add(d).add(P).unbind("keyup",qa).unbind("blur",ga);B.add(o).add(J).add(U).add(M).add(I).add(S).unbind("keydown",ia);f.unbind(ta);P=Y=S=I=M=U=J=o=B=
|
||||
null}});B.add(o).add(J).add(U).add(M).add(I).add(S).add(Y).add(d).add(P).bind("keyup",qa).bind("blur",ga);B.add(o).add(J).add(U).add(M).add(I).add(S).bind("keydown",ia);f.bind(ta)};a.jPicker={List:[],Color:function(b){var f=this,d,k,q,B,o,J,U,M=[],I=function(Y){for(var P=0;P<M.length;P++)M[P].call(f,f,Y)},S=function(Y,P,ia){if(P===undefined){if(Y===undefined||Y==null||Y=="")Y="all";if(d==null)return null;switch(Y.toLowerCase()){case "ahex":return s.rgbaToHex({r:d,g:k,b:q,a:B});case "hex":return S("ahex").substring(0,
|
||||
6);case "all":return{r:d,g:k,b:q,a:B,h:o,s:J,v:U,hex:S.call(f,"hex"),ahex:S.call(f,"ahex")};default:P={};for(var qa=0;qa<Y.length;qa++)switch(Y.charAt(qa)){case "r":if(Y.length==1)P=d;else P.r=d;break;case "g":if(Y.length==1)P=k;else P.g=k;break;case "b":if(Y.length==1)P=q;else P.b=q;break;case "a":if(Y.length==1)P=B;else P.a=B;break;case "h":if(Y.length==1)P=o;else P.h=o;break;case "s":if(Y.length==1)P=J;else P.s=J;break;case "v":if(Y.length==1)P=U;else P.v=U}return P=={}?S.call(f,"all"):P}}if(!(ia!=
|
||||
null&&ia==f)){var ga=false;if(Y==null)Y="";if(P==null){if(d!=null){d=null;ga=true}if(k!=null){k=null;ga=true}if(q!=null){q=null;ga=true}if(B!=null){B=null;ga=true}if(o!=null){o=null;ga=true}if(J!=null){J=null;ga=true}if(U!=null){U=null;ga=true}ga&&I.call(f,ia||f)}else switch(Y.toLowerCase()){case "ahex":case "hex":P=s.hexToRgba(P&&(P.ahex||P.hex)||P||"00000000");S.call(f,"rgba",{r:P.r,g:P.g,b:P.b,a:Y=="ahex"?P.a:B!=null?B:255},ia);break;default:if(P&&(P.ahex!=null||P.hex!=null)){S.call(f,"ahex",P.ahex||
|
||||
P.hex||"00000000",ia);break}var ba={},W=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;qa<Y.length;qa++)switch(Y.charAt(qa)){case "r":if(ta)continue;W=true;ba.r=P&&P.r&&P.r|0||P&&P|0||0;if(ba.r<0)ba.r=
|
||||
0;else if(ba.r>255)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;qa<Y.length;qa++)switch(Y.charAt(qa)){case "r":if(ta)continue;X=true;ba.r=P&&P.r&&P.r|0||P&&P|0||0;if(ba.r<0)ba.r=
|
||||
0;else if(ba.r>255)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('<span class="jPicker"><span class="Icon"><span class="Color"> </span><span class="Alpha"> </span><span class="Image" title="Click To Open Color Picker"> </span><span class="Container"> </span></span></span>');
|
||||
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("<iframe/>");B.prev().css({width:T.width(),height:B.height(),opacity:0,position:"absolute",left:B.css("left"),top:B.css("top")})}};if(k.window.expandable){a(document.body).children("div.jPicker.Container").css({zIndex:10});B.css({zIndex:20})}switch(k.window.effects.type){case "fade":B.fadeIn(k.window.effects.speed.show,O);break;case "slide":B.slideDown(k.window.effects.speed.show,
|
||||
O);break;default:B.show(k.window.effects.speed.show,O)}},xb=function(){var O=function(){k.window.expandable&&B.css({zIndex:10});!k.window.expandable||a.support.boxModel||B.prev().remove()};switch(k.window.effects.type){case "fade":B.fadeOut(k.window.effects.speed.hide,O);break;case "slide":B.slideUp(k.window.effects.speed.hide,O);break;default:B.hide(k.window.effects.speed.hide,O)}},Ab=function(){var O=k.window,T=O.expandable?a(d).next().find(".Container:first"):null;B=O.expandable?a("<div/>"):a(d);
|
||||
|
@ -638,14 +638,14 @@ la.clientPath+la.colorMap.arrow.file+'" class="Arrow"/></div></td><td rowspan="9
|
|||
"")+'" title="'+ca.tooltips.alpha.textbox+'"/> %':" ")+'</td></tr><tr class="Hex"><td colspan="2" class="Text"><label title="'+ca.tooltips.hex.textbox+'">#:<input type="text" maxlength="6" class="Hex" value="'+(ea!=null?ea.hex:"")+'"/></label>'+(O.alphaSupport?'<input type="text" maxlength="2" class="AHex" value="'+(ea!=null?ea.ahex.substring(6):"")+'" title="'+ca.tooltips.hex.alpha+'"/></td>':" ")+"</tr></tbody></table>";if(O.expandable){B.html(Ha);a(document.body).children("div.jPicker.Container").length==
|
||||
0?a(document.body).prepend(B):a(document.body).children("div.jPicker.Container:last").after(B);B.mousedown(function(){a(document.body).children("div.jPicker.Container").css({zIndex:10});B.css({zIndex:20})});B.css({left:O.position.x=="left"?T.offset().left-530-(O.position.y=="center"?25:0)+"px":O.position.x=="center"?T.offset().left-260+"px":O.position.x=="right"?T.offset().left-10+(O.position.y=="center"?25:0)+"px":O.position.x=="screenCenter"?(a(document).width()>>1)-260+"px":T.offset().left+parseInt(O.position.x)+
|
||||
"px",position:"absolute",top:O.position.y=="top"?T.offset().top-312+"px":O.position.y=="center"?T.offset().top-156+"px":O.position.y=="bottom"?T.offset().top+25+"px":T.offset().top+parseInt(O.position.y)+"px"})}else{B=a(d);B.html(Ha)}Ha=B.find("tbody:first");o=Ha.find("div.Map:first");J=Ha.find("div.Bar:first");var Pa=o.find("span"),Xa=J.find("span");U=Pa.filter(".Map1:first");M=Pa.filter(".Map2:first");I=Pa.filter(".Map3:first");S=Xa.filter(".Map1:first");Y=Xa.filter(".Map2:first");P=Xa.filter(".Map3:first");
|
||||
ia=Xa.filter(".Map4:first");qa=Xa.filter(".Map5:first");ga=Xa.filter(".Map6:first");ba=new p(o,{map:{width:la.colorMap.width,height:la.colorMap.height},arrow:{image:la.clientPath+la.colorMap.arrow.file,width:la.colorMap.arrow.width,height:la.colorMap.arrow.height}});ba.bind(za);W=new p(J,{map:{width:la.colorBar.width,height:la.colorBar.height},arrow:{image:la.clientPath+la.colorBar.arrow.file,width:la.colorBar.arrow.width,height:la.colorBar.arrow.height}});W.bind(Ia);ta=new g(Ha,ja.active,O.expandable&&
|
||||
ia=Xa.filter(".Map4:first");qa=Xa.filter(".Map5:first");ga=Xa.filter(".Map6:first");ba=new p(o,{map:{width:la.colorMap.width,height:la.colorMap.height},arrow:{image:la.clientPath+la.colorMap.arrow.file,width:la.colorMap.arrow.width,height:la.colorMap.arrow.height}});ba.bind(za);X=new p(J,{map:{width:la.colorBar.width,height:la.colorBar.height},arrow:{image:la.clientPath+la.colorBar.arrow.file,width:la.colorBar.arrow.width,height:la.colorBar.arrow.height}});X.bind(Ia);ta=new g(Ha,ja.active,O.expandable&&
|
||||
O.bindToInput?O.input:null,O.alphaPrecision);Pa=ea!=null?ea.hex:null;var fb=Ha.find(".Preview");Xa=Ha.find(".Button");oa=fb.find(".Active:first").css({backgroundColor:Pa&&"#"+Pa||"transparent"});ra=fb.find(".Current:first").css({backgroundColor:Pa&&"#"+Pa||"transparent"}).bind("click",Fa);wa.call(d,ra,Math.precision(ja.current.val("a")*100)/255,4);ma=Xa.find(".Ok:first").bind("click touchstart",tb);na=Xa.find(".Cancel:first").bind("click touchstart",lb);Ca=Xa.find(".Grid:first");setTimeout(function(){Sa.call(d,
|
||||
U,la.clientPath+"Maps.png");Sa.call(d,M,la.clientPath+"Maps.png");Sa.call(d,I,la.clientPath+"map-opacity.png");Sa.call(d,S,la.clientPath+"Bars.png");Sa.call(d,Y,la.clientPath+"Bars.png");Sa.call(d,P,la.clientPath+"Bars.png");Sa.call(d,ia,la.clientPath+"Bars.png");Sa.call(d,qa,la.clientPath+"bar-opacity.png");Sa.call(d,ga,la.clientPath+"AlphaBar.png");Sa.call(d,fb.find("div:last"),la.clientPath+"preview-opacity.png")},0);Ha.find("td.Radio input").bind("click touchstart",Ta);if(ja.quickList&&ja.quickList.length>
|
||||
0){Xa="";for(i=0;i<ja.quickList.length;i++){if((typeof ja.quickList[i]).toString().toLowerCase()=="string")ja.quickList[i]=new c({hex:ja.quickList[i]});var ob=ja.quickList[i].val("a"),Wa=ja.quickList[i].val("ahex");if(!O.alphaSupport&&Wa)Wa=Wa.substring(0,6)+"ff";var sb=ja.quickList[i].val("hex");Xa+='<span class="QuickColor"'+(Wa&&' title="#'+Wa+'"'||"")+' style="background-color:'+(sb&&"#"+sb||"")+";"+(sb?"":"background-image:url("+la.clientPath+"NoColor.png)")+(O.alphaSupport&&ob&&ob<255?";opacity:"+
|
||||
Math.precision(ob/255,4)+";filter:Alpha(opacity="+Math.precision(ob/2.55,4)+")":"")+'"> </span>'}Sa.call(d,Ca,la.clientPath+"bar-opacity.png");Ca.html(Xa);Ca.find(".QuickColor").click(zb)}Oa.call(d,k.color.mode);ja.active.bind(Ba);a.isFunction(gb)&&ja.active.bind(gb);ja.current.bind(bb);if(O.expandable){d.icon=T.parents(".Icon:first");Ga=d.icon.find(".Color:first").css({backgroundColor:Pa&&"#"+Pa||"transparent"});Ja=d.icon.find(".Alpha:first");Sa.call(d,Ja,la.clientPath+"bar-opacity.png");wa.call(d,
|
||||
Ja,Math.precision((255-(ea!=null?ea.a:0))*100/255,4));Da=d.icon.find(".Image:first").css({backgroundImage:"url('"+la.clientPath+la.picker.file+"')"}).bind("click",Ya);if(O.bindToInput&&O.updateInputColor)O.input.css({backgroundColor:Pa&&"#"+Pa||"transparent",color:ea==null||ea.v>75?"#000000":"#ffffff"});La=Ha.find(".Move:first").bind("mousedown",ua);ja.active.bind(Cb)}else vb.call(d)},la=k.images,ca=k.localization,ja={active:(typeof k.color.active).toString().toLowerCase()=="string"?new c({ahex:!k.window.alphaSupport&&
|
||||
k.color.active?k.color.active.substring(0,6)+"ff":k.color.active}):new c({ahex:!k.window.alphaSupport&&k.color.active.val("ahex")?k.color.active.val("ahex").substring(0,6)+"ff":k.color.active.val("ahex")}),current:(typeof k.color.active).toString().toLowerCase()=="string"?new c({ahex:!k.window.alphaSupport&&k.color.active?k.color.active.substring(0,6)+"ff":k.color.active}):new c({ahex:!k.window.alphaSupport&&k.color.active.val("ahex")?k.color.active.val("ahex").substring(0,6)+"ff":k.color.active.val("ahex")}),
|
||||
quickList:k.color.quickList};a.extend(true,d,{commitCallback:pb,liveCallback:gb,cancelCallback:ub,color:ja,show:vb,hide:xb,destroy:function(){B.find("td.Radio input touchstart").unbind("click",Ta);ra.unbind("click touchstart",Fa);na.unbind("click touchstart",lb);ma.unbind("click touchstart",tb);if(k.window.expandable){Da.unbind("click",Ya);La.unbind("mousedown",ua);d.icon=null}B.find(".QuickColor").unbind("click",zb);ga=qa=ia=P=Y=S=I=M=U=J=o=null;ba.destroy();ba=null;W.destroy();W=null;ta.destroy();
|
||||
quickList:k.color.quickList};a.extend(true,d,{commitCallback:pb,liveCallback:gb,cancelCallback:ub,color:ja,show:vb,hide:xb,destroy:function(){B.find("td.Radio input touchstart").unbind("click",Ta);ra.unbind("click touchstart",Fa);na.unbind("click touchstart",lb);ma.unbind("click touchstart",tb);if(k.window.expandable){Da.unbind("click",Ya);La.unbind("mousedown",ua);d.icon=null}B.find(".QuickColor").unbind("click",zb);ga=qa=ia=P=Y=S=I=M=U=J=o=null;ba.destroy();ba=null;X.destroy();X=null;ta.destroy();
|
||||
gb=ub=pb=Ca=na=ma=ra=oa=ta=null;B.html("");for(i=0;i<m.length;i++)m[i]==d&&m.splice(i,1)}});m.push(d);setTimeout(function(){Ab.call(d)},0)})};a.fn.jPicker.defaults={window:{title:null,effects:{type:"slide",speed:{show:"slow",hide:"fast"}},position:{x:"screenCenter",y:"top"},expandable:false,liveUpdate:true,alphaSupport:false,alphaPrecision:0,updateInputColor:true},color:{mode:"h",active:new c({ahex:"#ffcc00ff"}),quickList:[new c({h:360,s:33,v:100}),new c({h:360,s:66,v:100}),new c({h:360,s:100,v:100}),
|
||||
new c({h:360,s:100,v:75}),new c({h:360,s:100,v:50}),new c({h:180,s:0,v:100}),new c({h:30,s:33,v:100}),new c({h:30,s:66,v:100}),new c({h:30,s:100,v:100}),new c({h:30,s:100,v:75}),new c({h:30,s:100,v:50}),new c({h:180,s:0,v:90}),new c({h:60,s:33,v:100}),new c({h:60,s:66,v:100}),new c({h:60,s:100,v:100}),new c({h:60,s:100,v:75}),new c({h:60,s:100,v:50}),new c({h:180,s:0,v:80}),new c({h:90,s:33,v:100}),new c({h:90,s:66,v:100}),new c({h:90,s:100,v:100}),new c({h:90,s:100,v:75}),new c({h:90,s:100,v:50}),
|
||||
new c({h:180,s:0,v:70}),new c({h:120,s:33,v:100}),new c({h:120,s:66,v:100}),new c({h:120,s:100,v:100}),new c({h:120,s:100,v:75}),new c({h:120,s:100,v:50}),new c({h:180,s:0,v:60}),new c({h:150,s:33,v:100}),new c({h:150,s:66,v:100}),new c({h:150,s:100,v:100}),new c({h:150,s:100,v:75}),new c({h:150,s:100,v:50}),new c({h:180,s:0,v:50}),new c({h:180,s:33,v:100}),new c({h:180,s:66,v:100}),new c({h:180,s:100,v:100}),new c({h:180,s:100,v:75}),new c({h:180,s:100,v:50}),new c({h:180,s:0,v:40}),new c({h:210,
|
||||
|
@ -676,9 +676,9 @@ times:"m1.00089,73.36786l72.36697,-72.36697l76.87431,76.87368l76.87431,-76.87368
|
|||
$("#tools_shapelib > *").wrapAll(M);var I=$("#tools_shapelib_show");p("basic");$("#shape_buttons").mouseup(function(Y){Y=$(Y.target).closest("div.tool_button");if(Y.length){var P=Y.children().clone().attr({width:24,height:24});I.children(":not(.flyout_arrow_horiz)").remove();I.append(P).attr("data-curopt","#"+Y[0].id).mouseup();s.setMode(U);m=Y[0].id.substr((U+"_").length);c=J.data[m];$(".tools_flyout").fadeOut()}});M=$('<div id="shape_cats">');var S="";$.each(B,function(Y,P){S+="<div data-cat="+
|
||||
Y+">"+P+"</div>"});M.html(S).children().bind("mouseup",function(){var Y=$(this);Y.siblings().removeClass("current");Y.addClass("current");p(Y.attr("data-cat"));return false});M.children().eq(0).addClass("current");$("#tools_shapelib").prepend(M);I.mouseup(function(){s.setMode(c?U:"select")});$("#tool_shapelib").remove();M=$("#tools_shapelib").height();$("#tools_shapelib").css({"margin-top":-(M/2),"margin-left":3})},mouseDown:function(M){if(s.getMode()===U){var I=f=M.start_x;M=d=M.start_y;var S=s.getStyle();
|
||||
b=s.addSvgElementFromJson({element:"path",curStyles:true,attr:{d:c,id:s.getNextId(),opacity:S.opacity/2,style:"pointer-events:none"}});b.setAttribute("d",c);if(/[a-z]/.test(c)){c=J.data[m]=s.pathActions.convertPath(b);b.setAttribute("d",c);s.pathActions.fixEnd(b)}b.setAttribute("transform","translate("+I+","+M+") scale(0.005) translate("+-I+","+-M+")");s.recalculateDimensions(b);s.getTransformList(b);q=b.getBBox();totalScale={sx:1,sy:1};return{started:true}}},mouseMove:function(M){if(s.getMode()===
|
||||
U){var I=s.getZoom(),S=M.event,Y=M.mouse_x/I,P=M.mouse_y/I;M=s.getTransformList(b);var ia=b.getBBox();I=ia.x;var qa=ia.y,ga=ia.width,ba=ia.height,W=Y-f,ta=P-d,ka={x:Math.min(f,Y),y:Math.min(d,P),width:Math.abs(Y-f),height:Math.abs(P-d)},da=ia=0;ba=ba?(ba+ta)/ba:1;ga=ga?(ga+W)/ga:1;ga=ka.width/q.width;ba=ka.height/q.height;ga=ga||1;ba=ba||1;if(Y<f)ia=q.width;if(P<d)da=q.height;Y=k.createSVGTransform();P=k.createSVGTransform();ka=k.createSVGTransform();Y.setTranslate(-(I+ia),-(qa+da));if(S.shiftKey){replaced=
|
||||
true;S=Math.min(Math.abs(ga),Math.abs(ba));ga=S*(ga<0?-1:1);ba=S*(ba<0?-1:1);if(totalScale.sx!=totalScale.sy){S=totalScale.sx>totalScale.sy?1:totalScale.sx/totalScale.sy;W=totalScale.sy>totalScale.sx?1:totalScale.sy/totalScale.sx;ga*=W;ba*=S;console.log(S,W)}}totalScale.sx*=ga;totalScale.sy*=ba;P.setScale(ga,ba);ka.setTranslate(I+ia,qa+da);M.appendItem(ka);M.appendItem(P);M.appendItem(Y);s.recalculateDimensions(b);q=b.getBBox()}},mouseUp:function(M){if(s.getMode()===U){if(M.mouse_x==f&&M.mouse_y==
|
||||
d)return{keep:false,element:b,started:false};s.setMode("select");return{keep:true,element:b,started:false}}}}});(function(){for(var a=0,p=["ms","moz","webkit","o"],g=0;g<p.length&&!window.requestAnimationFrame;++g){window.requestAnimationFrame=window[p[g]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[p[g]+"CancelAnimationFrame"]||window[p[g]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame)window.requestAnimationFrame=function(c){var m=(new Date).getTime(),s=Math.max(0,16-(m-a)),b=window.setTimeout(function(){c(m+s)},s);a=m+s;return b};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
|
||||
U){var I=s.getZoom(),S=M.event,Y=M.mouse_x/I,P=M.mouse_y/I;M=s.getTransformList(b);var ia=b.getBBox();I=ia.x;var qa=ia.y,ga=ia.width,ba=ia.height,X=Y-f,ta=P-d,ka={x:Math.min(f,Y),y:Math.min(d,P),width:Math.abs(Y-f),height:Math.abs(P-d)},da=ia=0;ba=ba?(ba+ta)/ba:1;ga=ga?(ga+X)/ga:1;ga=ka.width/q.width;ba=ka.height/q.height;ga=ga||1;ba=ba||1;if(Y<f)ia=q.width;if(P<d)da=q.height;Y=k.createSVGTransform();P=k.createSVGTransform();ka=k.createSVGTransform();Y.setTranslate(-(I+ia),-(qa+da));if(S.shiftKey){replaced=
|
||||
true;S=Math.min(Math.abs(ga),Math.abs(ba));ga=S*(ga<0?-1:1);ba=S*(ba<0?-1:1);if(totalScale.sx!=totalScale.sy){S=totalScale.sx>totalScale.sy?1:totalScale.sx/totalScale.sy;ga*=totalScale.sy>totalScale.sx?1:totalScale.sy/totalScale.sx;ba*=S}}totalScale.sx*=ga;totalScale.sy*=ba;P.setScale(ga,ba);ka.setTranslate(I+ia,qa+da);M.appendItem(ka);M.appendItem(P);M.appendItem(Y);s.recalculateDimensions(b);q=b.getBBox()}},mouseUp:function(M){if(s.getMode()===U){if(M.mouse_x==f&&M.mouse_y==d)return{keep:false,
|
||||
element:b,started:false};s.setMode("select");return{keep:true,element:b,started:false}}}}});(function(){for(var a=0,p=["ms","moz","webkit","o"],g=0;g<p.length&&!window.requestAnimationFrame;++g){window.requestAnimationFrame=window[p[g]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[p[g]+"CancelAnimationFrame"]||window[p[g]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame)window.requestAnimationFrame=function(c){var m=(new Date).getTime(),s=Math.max(0,16-(m-a)),b=window.setTimeout(function(){c(m+s)},s);a=m+s;return b};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
|
||||
function(c){clearTimeout(c)}})();(function(a){function p(o){var J=o.originalEvent;if(!J.touches||J.targetTouches.length===1&&J.touches.length===1){b.call(this,o);o=a(this);o.bind(q,g);o.bind(k,c)}else{clearTimeout(B);s.call(this)}}function g(o){if(B!=null){var J=o.originalEvent;o=J.changedTouches?J.changedTouches[0].pageX:J.pageX;J=J.changedTouches?J.changedTouches[0].pageY:J.pageY;var U=a(this).data("taphold.point");o=o-U.x;J=J-U.y;if(Math.sqrt(o*o+J*J)>d){clearTimeout(B);s.call(this)}}}function c(){clearTimeout(B);s.call(this)}
|
||||
function m(o){s.call(this);a(this).data("taphold.handler").call(this,o)}function s(){B=null;a(this).unbind(q,g);a(this).unbind(k,c)}function b(o){if(B==null){var J=this;B=setTimeout(function(){m.call(J,o)},f);var U=o.originalEvent,M={};M.x=U.changedTouches?U.changedTouches[0].pageX:U.pageX;M.y=U.changedTouches?U.changedTouches[0].pageY:U.pageY;a(this).data("taphold.point",M)}}var f=1E3,d=5,k="touchend",q="touchmove",B=null;a.event.special.taphold={setup:function(){},add:function(o){a(this).data("taphold.handler",
|
||||
o.handler);o.data?a(this).bind("touchstart",o.data,p):a(this).bind("touchstart",p)},remove:function(o){clearTimeout(B);s.call(this);o.data?a(this).unbind("touchstart",o.data,p):a(this).unbind("touchstart",p)},teardown:function(){}}})(jQuery);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<f;b++)if(k[m[b]])return c.apply(this,arguments)}}}}a.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",
|
||||
106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta",219:"[",221:"]"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};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<La?Ga[Ca]||(Da[Ja+1]&&isNaN(Da[Ja+1])?{}:[]):na}else if(a.isArray(Z[Ca]))Z[Ca].push(na);else Z[Ca]=Z[Ca]!==f?[Z[Ca],na]:na}else if(Ca)Z[Ca]=X?f:""});return Z};o[P]=c(s,
|
||||
0);o[ia]=J=c(s,1);a.elemUrlAttr||(a.elemUrlAttr=function(da){return a.extend(ka,da)})({a:ga,base:ga,iframe:"src",img:"src",input:"src",form:"action",link:ga,script:"src"});S=a.elemUrlAttr;a.fn[P]=c(b,P);a.fn[ia]=c(b,ia);U.pushState=M=function(da,X){if(g(da)&&/^#/.test(da)&&X===f)X=2;var Z=da!==f;Z=B(p[qa][ga],Z?da:{},Z?X:2);p[qa][ga]=Z+(/#/.test(Z)?"":"#")};U.getState=I=function(da,X){return da===f||typeof da==="boolean"?J(da):J(X)[da]};U.removeState=function(da){var X={};if(da!==f){X=I();a.each(a.isArray(da)?
|
||||
da:arguments,function(Z,oa){delete X[oa]})}M(X,2)};Y.hashchange=a.extend(Y.hashchange,{add:function(da){function X(oa){var ra=oa[ia]=B();oa.getState=function(ma,na){return ma===f||typeof ma==="boolean"?o(ra,ma):o(ra,na)[ma]};Z.apply(this,arguments)}var Z;if(a.isFunction(da)){Z=da;return X}else{Z=da.handler;da.handler=X}}})})(jQuery,this);
|
||||
106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta",219:"[",221:"]"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};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<La?Ga[Ca]||(Da[Ja+1]&&isNaN(Da[Ja+1])?{}:[]):na}else if(a.isArray(Z[Ca]))Z[Ca].push(na);else Z[Ca]=Z[Ca]!==f?[Z[Ca],na]:na}else if(Ca)Z[Ca]=W?f:""});return Z};o[P]=c(s,
|
||||
0);o[ia]=J=c(s,1);a.elemUrlAttr||(a.elemUrlAttr=function(da){return a.extend(ka,da)})({a:ga,base:ga,iframe:"src",img:"src",input:"src",form:"action",link:ga,script:"src"});S=a.elemUrlAttr;a.fn[P]=c(b,P);a.fn[ia]=c(b,ia);U.pushState=M=function(da,W){if(g(da)&&/^#/.test(da)&&W===f)W=2;var Z=da!==f;Z=B(p[qa][ga],Z?da:{},Z?W:2);p[qa][ga]=Z+(/#/.test(Z)?"":"#")};U.getState=I=function(da,W){return da===f||typeof da==="boolean"?J(da):J(W)[da]};U.removeState=function(da){var W={};if(da!==f){W=I();a.each(a.isArray(da)?
|
||||
da:arguments,function(Z,oa){delete W[oa]})}M(W,2)};Y.hashchange=a.extend(Y.hashchange,{add:function(da){function W(oa){var ra=oa[ia]=B();oa.getState=function(ma,na){return ma===f||typeof ma==="boolean"?o(ra,ma):o(ra,na)[ma]};Z.apply(this,arguments)}var Z;if(a.isFunction(da)){Z=da;return W}else{Z=da.handler;da.handler=W}}})})(jQuery,this);
|
||||
(function(a,p,g){function c(B){B=B||p[b][f];return B.replace(/^[^#]*#?(.*)$/,"$1")}var m,s=a.event.special,b="location",f="href",d=document.documentMode,k=a.browser.msie&&(d===g||d<8),q="onhashchange"in p&&!k;a.hashchangeDelay=100;s.hashchange=a.extend(s.hashchange,{setup:function(){if(q)return false;a(m.start)},teardown:function(){if(q)return false;a(m.stop)}});m=function(){function B(){M=I=function(S){return S};if(k){U=a('<iframe src="javascript:0"/>').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;ma<ra;ma++){var na=J[ma],Ca=na.id;if(Ca==="svg_eof")break;a("#"+Ca);na=na.getElementsByTagNameNS(k,"svg")[0];var Ga=document.createElementNS(k,"svg");Ga.setAttributeNS(k,"viewBox",
|
||||
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,W){if(da!=="ajax"){if(S)return;var Z=(U=ga[0].contentDocument)&&U.getElementById("svg_eof");if(!Z&&!(W&&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,W){if(!I){if(m.no_img)da=false;if(da){var Z=a(document.createElement("div"));Z.hide().appendTo("body")}if(W){var oa=m.fallback_path?m.fallback_path:"";a.each(W,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;ma<ra;ma++){var na=J[ma],Ca=na.id;if(Ca==="svg_eof")break;a("#"+Ca);na=na.getElementsByTagNameNS(k,"svg")[0];var Ga=document.createElementNS(k,"svg");Ga.setAttributeNS(k,"viewBox",
|
||||
[0,0,B,o].join(" "));var Ja=na.getAttribute("width"),Da=na.getAttribute("height");na.removeAttribute("width");na.removeAttribute("height");na.getAttribute("viewBox")||na.setAttribute("viewBox",[0,0,Ja,Da].join(" "));Ga.setAttribute("xmlns",k);Ga.setAttribute("width",B);Ga.setAttribute("height",o);Ga.setAttribute("xmlns:xlink",q);Ga.setAttribute("class","svg_icon");ia||(na=na.cloneNode(true));Ga.appendChild(na);if(da){ia||Ga.cloneNode(true);Z.empty().append(Ga);na=qa+d(Z.html());na=a(new Image).attr({"class":"svg_icon",
|
||||
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(!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<da.length);return X.join("")}var k="http://www.w3.org/2000/svg",q="http://www.w3.org/1999/xlink",B=m.w?m.w:24,o=m.h?m.h:24,J,U,M,I=false,S=false,Y=0,P=navigator.userAgent,ia=!!window.opera;P.indexOf("Safari/")>-1&&P.indexOf("Chrome/");var qa="data:image/svg+xml;charset=utf-8;base64,";if(m.svgz){var ga=a('<object data="'+c+'" type=image/svg+xml>').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<da.length);return W.join("")}var k="http://www.w3.org/2000/svg",q="http://www.w3.org/1999/xlink",B=m.w?m.w:24,o=m.h?m.h:24,J,U,M,I=false,S=false,Y=0,P=navigator.userAgent,ia=!!window.opera;P.indexOf("Safari/")>-1&&P.indexOf("Chrome/");var qa="data:image/svg+xml;charset=utf-8;base64,";if(m.svgz){var ga=a('<object data="'+c+'" type=image/svg+xml>').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<ra;ma++){var Ga=oa[ma];Ga.getAttribute("fill")===na&&Ga.setAttribute("fill",Ca);Ga.getAttribute("stroke")===na&&Ga.setAttribute("stroke",Ca);Ga.getAttribute("filter")===na&&Ga.setAttribute("filter",Ca)}});return da}};a.getSvgIcon=function(c,m){var s=p[c];if(m&&s)s=g(s,0,true).clone(true);return s};a.resizeSvgIcons=function(c){var m=!a(".svg_icon:first").length;a.each(c,function(s,b){var f=a.isArray(b),d=f?b[0]:b,k=f?b[1]:b;if(m)s=s.replace(/\.svg_icon/g,"svg");a(s).each(function(){this.setAttribute("width",
|
||||
d);this.setAttribute("height",k);if(window.opera&&window.widget){this.parentNode.style.width=d+"px";this.parentNode.style.height=k+"px"}})})}})(jQuery);(function(){function a(c,m,s){c=document.createElementNS(p.svg,c);if(g)for(var b in m)c.setAttribute(b,m[b]);else for(b in m){var f=m[b],d=c[b];if(d&&d.constructor==="SVGLength")d.baseVal.value=f;else c.setAttribute(b,f)}s&&s.appendChild(c);return c}var p={svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink"};if(!window.console)window.console=new function(){this.log=function(){};this.dir=function(){}};$.jGraduate={Paint:function(c){c=c||{};this.alpha=isNaN(c.alpha)?100:c.alpha;if(c.copy){this.type=
|
||||
c.copy.type;this.alpha=c.copy.alpha;this.radialGradient=this.linearGradient=this.solidColor=null;switch(this.type){case "solidColor":this.solidColor=c.copy.solidColor;break;case "linearGradient":this.linearGradient=c.copy.linearGradient.cloneNode(true);break;case "radialGradient":this.radialGradient=c.copy.radialGradient.cloneNode(true)}}else if(c.linearGradient){this.type="linearGradient";this.radialGradient=this.solidColor=null;this.linearGradient=c.linearGradient.cloneNode(true)}else if(c.radialGradient){this.type=
|
||||
"radialGradient";this.linearGradient=this.solidColor=null;this.radialGradient=c.radialGradient.cloneNode(true)}else if(c.solidColor){this.type="solidColor";this.solidColor=c.solidColor}else{this.type="none";this.radialGradient=this.linearGradient=this.solidColor=null}}};jQuery.fn.jGraduateDefaults={paint:new $.jGraduate.Paint,window:{pickerTitle:"Drag markers to pick a paint"},images:{clientPath:"images/"},newstop:"inverse"};var g=navigator.userAgent.indexOf("Gecko/")>=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(T<O){ea.prev().before(ea);xa=$(W).find("stop")}O=T})}var q=$(this),B=$.extend(true,{},jQuery.fn.jGraduateDefaults,c),o=q.attr("id"),J="#"+q.attr("id")+" ";if(J){var U=function(){switch(q.paint.type){case "radialGradient":q.paint.linearGradient=null;break;case "linearGradient":q.paint.radialGradient=null;break;case "solidColor":q.paint.radialGradient=q.paint.linearGradient=null}$.isFunction(q.okCallback)&&q.okCallback(q.paint);q.hide()},M=function(){$.isFunction(q.cancelCallback)&&q.cancelCallback();
|
||||
fb);ea.setAttribute("stop-opacity",Xa);$("div.jGraduate_LightBox").hide();$("#"+o+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();$("#"+o+"_jGraduate_stopPicker").hide()})});$(X).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?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<O){ea.prev().before(ea);xa=$(X).find("stop")}O=T})}var q=$(this),B=$.extend(true,{},jQuery.fn.jGraduateDefaults,c),o=q.attr("id"),J="#"+q.attr("id")+" ";if(J){var U=function(){switch(q.paint.type){case "radialGradient":q.paint.linearGradient=null;break;case "linearGradient":q.paint.radialGradient=null;break;case "solidColor":q.paint.radialGradient=q.paint.linearGradient=null}$.isFunction(q.okCallback)&&q.okCallback(q.paint);q.hide()},M=function(){$.isFunction(q.cancelCallback)&&q.cancelCallback();
|
||||
q.hide()};$.extend(true,q,{paint:new $.jGraduate.Paint({copy:B.paint}),okCallback:$.isFunction(m[1])&&m[1]||null,cancelCallback:$.isFunction(m[2])&&m[2]||null});q.position();var I=null,S=$(window);if(q.paint.type=="none")q.paint=$.jGraduate.Paint({solidColor:"ffffff"});q.addClass("jGraduate_Picker");q.html('<ul class="jGraduate_tabs"><li class="jGraduate_tab_color jGraduate_tab_current" data-type="col">Solid Color</li><li class="jGraduate_tab_lingrad" data-type="lg">Linear Gradient</li><li class="jGraduate_tab_radgrad" data-type="rg">Radial Gradient</li></ul><div class="jGraduate_colPick"></div><div class="jGraduate_gradPick"></div><div class="jGraduate_LightBox"></div><div id="'+
|
||||
o+'_jGraduate_stopPicker" class="jGraduate_stopPicker"></div>');var Y=$(J+"> .jGraduate_colPick"),P=$(J+"> .jGraduate_gradPick");P.html('<div id="'+o+'_jGraduate_Swatch" class="jGraduate_Swatch"><h2 class="jGraduate_Title">'+B.window.pickerTitle+'</h2><div id="'+o+'_jGraduate_GradContainer" class="jGraduate_GradContainer"></div><div id="'+o+'_jGraduate_StopSlider" class="jGraduate_StopSlider"></div></div><div class="jGraduate_Form jGraduate_Points jGraduate_lg_field"><div class="jGraduate_StopSection"><label class="jGraduate_Form_Heading">Begin Point</label><div class="jGraduate_Form_Section"><label>x:</label><input type="text" id="'+
|
||||
o+'_jGraduate_x1" size="3" title="Enter starting x value between 0.0 and 1.0"/><label> y:</label><input type="text" id="'+o+'_jGraduate_y1" size="3" title="Enter starting y value between 0.0 and 1.0"/></div></div><div class="jGraduate_StopSection"><label class="jGraduate_Form_Heading">End Point</label><div class="jGraduate_Form_Section"><label>x:</label><input type="text" id="'+o+'_jGraduate_x2" size="3" title="Enter ending x value between 0.0 and 1.0"/><label> y:</label><input type="text" id="'+
|
||||
|
@ -34,25 +34,25 @@ o+'_jGraduate_match_ctr"/></label><br/><label>x:</label><input type="text" id="'
|
|||
o+'_jGraduate_Radius" class="jGraduate_SliderBar jGraduate_Radius" title="Click to set radius"><img id="'+o+'_jGraduate_RadiusArrows" class="jGraduate_RadiusArrows" src="'+B.images.clientPath+'rangearrows2.gif"></div><label><input type="text" id="'+o+'_jGraduate_RadiusInput" size="3" value="100"/>%</label></div><div class="jGraduate_Slider jGraduate_EllipField jGraduate_rg_field"><label class="prelabel">Ellip:</label><div id="'+o+'_jGraduate_Ellip" class="jGraduate_SliderBar jGraduate_Ellip" title="Click to set Ellip"><img id="'+
|
||||
o+'_jGraduate_EllipArrows" class="jGraduate_EllipArrows" src="'+B.images.clientPath+'rangearrows2.gif"></div><label><input type="text" id="'+o+'_jGraduate_EllipInput" size="3" value="0"/>%</label></div><div class="jGraduate_Slider jGraduate_AngleField jGraduate_rg_field"><label class="prelabel">Angle:</label><div id="'+o+'_jGraduate_Angle" class="jGraduate_SliderBar jGraduate_Angle" title="Click to set Angle"><img id="'+o+'_jGraduate_AngleArrows" class="jGraduate_AngleArrows" src="'+B.images.clientPath+
|
||||
'rangearrows2.gif"></div><label><input type="text" id="'+o+'_jGraduate_AngleInput" size="3" value="0"/>\u00ba </label></div><div class="jGraduate_Slider jGraduate_OpacField"><label class="prelabel">Opac:</label><div id="'+o+'_jGraduate_Opac" class="jGraduate_SliderBar jGraduate_Opac" title="Click to set Opac"><img id="'+o+'_jGraduate_OpacArrows" class="jGraduate_OpacArrows" src="'+B.images.clientPath+'rangearrows2.gif"></div><label><input type="text" id="'+o+'_jGraduate_OpacInput" size="3" value="100"/>%</label></div></div><div class="jGraduate_OkCancel"><input type="button" id="'+
|
||||
o+'_jGraduate_Ok" class="jGraduate_Ok" value="OK"/><input type="button" id="'+o+'_jGraduate_Cancel" class="jGraduate_Cancel" value="Cancel"/></div>');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"/><input type="button" id="'+o+'_jGraduate_Cancel" class="jGraduate_Cancel" value="Cancel"/></div>');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=$("<div/>").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=$("<div/>").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=$("<div/>").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=$("<div/>").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;na<ua;na++)s(0,0,0,0,xa[na]);tb.val(W.getAttribute("spreadMethod")||
|
||||
"pad");var nb,kb=false;ta.setAttribute("fill-opacity",oa/100);$("#"+o+" div.grad_coord").mousedown(function(la){la.preventDefault();Ya=$(this);Ya.offset();nb=Ya.parent().offset();S.mousemove(bb).mouseup(Cb)});$("#"+o+"_jGraduate_Ok").bind("click touchstart",function(){q.paint.type=ba;q.paint[ba]=W.cloneNode(true);q.paint.solidColor=null;U()});$("#"+o+"_jGraduate_Cancel").bind("click touchstart",function(){M()});if(ba==="radialGradient")if(kb)Ia.show();else{Ia.hide();ka.fx.val("");ka.fy.val("")}$("#"+
|
||||
o+"_jGraduate_match_ctr")[0].checked=!kb;var zb,pb;$("#"+o+"_jGraduate_match_ctr").change(function(){kb=!this.checked;Ia.toggle(kb);ka.fx.val("");ka.fy.val("");var la=W;if(kb){var ca=zb||0.5,ja=pb||0.5;la.setAttribute("fx",ca);la.setAttribute("fy",ja);ka.fx.val(ca);ka.fy.val(ja)}else{zb=la.getAttribute("fx");pb=la.getAttribute("fy");la.removeAttribute("fx");la.removeAttribute("fy")}});xa=W.getElementsByTagNameNS(p.svg,"stop");ua=xa.length;if(ua<2){for(;ua<2;){W.appendChild(document.createElementNS(p.svg,
|
||||
"stop"));++ua}xa=W.getElementsByTagNameNS(p.svg,"stop")}var gb;oa=P=0;if(ba==="radialGradient"){X=W.gradientTransform.baseVal;if(X.numberOfItems===2){ua=X.getItem(0);X=X.getItem(1);if(ua.type===2&&X.type===3){ua=X.matrix;if(ua.a!==1)P=Math.round(-(1-ua.a)*100);else if(ua.d!==1)P=Math.round((1-ua.d)*100)}}else if(X.numberOfItems===3){da=X.getItem(0);ua=X.getItem(1);X=X.getItem(2);if(da.type===4&&ua.type===2&&X.type===3){oa=Math.round(da.angle);ua=X.matrix;if(ua.a!==1)P=Math.round(-(1-ua.a)*100);else if(ua.d!==
|
||||
1)P=Math.round((1-ua.d)*100)}}}P={radius:{handle:"#"+o+"_jGraduate_RadiusArrows",input:"#"+o+"_jGraduate_RadiusInput",val:(W.getAttribute("r")||0.5)*100},opacity:{handle:"#"+o+"_jGraduate_OpacArrows",input:"#"+o+"_jGraduate_OpacInput",val:q.paint.alpha||100},ellip:{handle:"#"+o+"_jGraduate_EllipArrows",input:"#"+o+"_jGraduate_EllipInput",val:P},angle:{handle:"#"+o+"_jGraduate_AngleArrows",input:"#"+o+"_jGraduate_AngleInput",val:oa}};$.each(P,function(la,ca){var ja=$(ca.handle);ja.mousedown(function(O){var T=
|
||||
ja.parent();gb={type:la,elem:ja,input:$(ca.input),parent:T,offset:T.offset()};S.mousemove(ub).mouseup(vb);O.preventDefault()});$(ca.input).val(ca.val).change(function(){var O=+this.value,T=0,ea=ba==="radialGradient";switch(la){case "radius":ea&&W.setAttribute("r",O/100);T=Math.pow(O/100,0.4)/2*145;break;case "opacity":q.paint.alpha=O;ta.setAttribute("fill-opacity",O/100);T=O*1.45;break;case "ellip":hb=Ma=1;if(O===0){T=72.5;break}if(O>99.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;na<ua;na++)s(0,0,0,0,xa[na]);tb.val(X.getAttribute("spreadMethod")||
|
||||
"pad");var nb,kb=false;ta.setAttribute("fill-opacity",oa/100);$("#"+o+" div.grad_coord").mousedown(function(la){la.preventDefault();Ya=$(this);Ya.offset();nb=Ya.parent().offset();S.mousemove(bb).mouseup(Cb)});$("#"+o+"_jGraduate_Ok").bind("click touchstart",function(){q.paint.type=ba;q.paint[ba]=X.cloneNode(true);q.paint.solidColor=null;U()});$("#"+o+"_jGraduate_Cancel").bind("click touchstart",function(){M()});if(ba==="radialGradient")if(kb)Ia.show();else{Ia.hide();ka.fx.val("");ka.fy.val("")}$("#"+
|
||||
o+"_jGraduate_match_ctr")[0].checked=!kb;var zb,pb;$("#"+o+"_jGraduate_match_ctr").change(function(){kb=!this.checked;Ia.toggle(kb);ka.fx.val("");ka.fy.val("");var la=X;if(kb){var ca=zb||0.5,ja=pb||0.5;la.setAttribute("fx",ca);la.setAttribute("fy",ja);ka.fx.val(ca);ka.fy.val(ja)}else{zb=la.getAttribute("fx");pb=la.getAttribute("fy");la.removeAttribute("fx");la.removeAttribute("fy")}});xa=X.getElementsByTagNameNS(p.svg,"stop");ua=xa.length;if(ua<2){for(;ua<2;){X.appendChild(document.createElementNS(p.svg,
|
||||
"stop"));++ua}xa=X.getElementsByTagNameNS(p.svg,"stop")}var gb;oa=P=0;if(ba==="radialGradient"){W=X.gradientTransform.baseVal;if(W.numberOfItems===2){ua=W.getItem(0);W=W.getItem(1);if(ua.type===2&&W.type===3){ua=W.matrix;if(ua.a!==1)P=Math.round(-(1-ua.a)*100);else if(ua.d!==1)P=Math.round((1-ua.d)*100)}}else if(W.numberOfItems===3){da=W.getItem(0);ua=W.getItem(1);W=W.getItem(2);if(da.type===4&&ua.type===2&&W.type===3){oa=Math.round(da.angle);ua=W.matrix;if(ua.a!==1)P=Math.round(-(1-ua.a)*100);else if(ua.d!==
|
||||
1)P=Math.round((1-ua.d)*100)}}}P={radius:{handle:"#"+o+"_jGraduate_RadiusArrows",input:"#"+o+"_jGraduate_RadiusInput",val:(X.getAttribute("r")||0.5)*100},opacity:{handle:"#"+o+"_jGraduate_OpacArrows",input:"#"+o+"_jGraduate_OpacInput",val:q.paint.alpha||100},ellip:{handle:"#"+o+"_jGraduate_EllipArrows",input:"#"+o+"_jGraduate_EllipInput",val:P},angle:{handle:"#"+o+"_jGraduate_AngleArrows",input:"#"+o+"_jGraduate_AngleInput",val:oa}};$.each(P,function(la,ca){var ja=$(ca.handle);ja.mousedown(function(O){var T=
|
||||
ja.parent();gb={type:la,elem:ja,input:$(ca.input),parent:T,offset:T.offset()};S.mousemove(ub).mouseup(vb);O.preventDefault()});$(ca.input).val(ca.val).change(function(){var O=+this.value,T=0,ea=ba==="radialGradient";switch(la){case "radius":ea&&X.setAttribute("r",O/100);T=Math.pow(O/100,0.4)/2*145;break;case "opacity":q.paint.alpha=O;ta.setAttribute("fill-opacity",O/100);T=O*1.45;break;case "ellip":hb=Ma=1;if(O===0){T=72.5;break}if(O>99.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 <a href='http://opera.com'>latest version</a> 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 <a href='http://opera.com'>latest version</a> 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;F<I.length;++F)if(I[F]!=null){var w=Y(I[F]);w.numberOfItems?w.insertItemBefore(d.createSVGTransform(),0):w.appendItem(d.createSVGTransform())}}else if(!F){Qa();Fa="multiselect";if(ua==null)ua=Ia.getRubberBandBox();
|
||||
z*=o;v*=o;ma(ua,{x:z,y:v,width:0,height:0,display:"inline"},100)}break;case "zoom":Ma=true;if(ua==null)ua=Ia.getRubberBandBox();ma(ua,{x:L*o,y:L*o,width:0,height:0,display:"inline"},100);break;case "resize":Ma=true;h=D;l=H;G=svgedit.utilities.getBBox($("#selectedBox0")[0]);var C={};$.each(G,function(K,R){C[K]=R/o});G=C;F=oa(E)?1:0;if(qa(n)){n.insertItemBefore(d.createSVGTransform(),F);n.insertItemBefore(d.createSVGTransform(),F);n.insertItemBefore(d.createSVGTransform(),F)}else{n.appendItem(d.createSVGTransform());
|
||||
n.appendItem(d.createSVGTransform());n.appendItem(d.createSVGTransform());if(svgedit.browser.supportsNonScalingStroke()){if(D=svgedit.browser.isChrome())w=function(K){var R=K.getAttributeNS(null,"stroke");K.removeAttributeNS(null,"stroke");setTimeout(function(){K.setAttributeNS(null,"stroke",R)},1)};E.style.vectorEffect="non-scaling-stroke";D&&w(E);H=E.getElementsByTagName("*");L=H.length;for(F=0;F<L;F++){H[F].style.vectorEffect="non-scaling-stroke";D&&w(H[F])}}}break;case "fhellipse":case "fhrect":case "fhpath":Ma=
|
||||
true;e=L+","+N+" ";w=M.stroke_width==0?1:M.stroke_width;S({element:"polyline",curStyles:true,attr:{points:e,id:ja(),fill:"none",opacity:M.opacity/2,"stroke-linecap":"round",style:"pointer-events:none"}});A.minx=L;A.maxx=L;A.miny=N;A.maxy=N;break;case "image":Ma=true;w=S({element:"image",attr:{x:D,y:H,width:0,height:0,id:ja(),opacity:M.opacity/2,style:"pointer-events:inherit"}});X(w,Ea);qb(w);break;case "square":case "rect":Ma=true;h=D;l=H;S({element:"rect",curStyles:true,attr:{x:D,y:H,width:0,height:0,
|
||||
true;e=L+","+N+" ";w=M.stroke_width==0?1:M.stroke_width;S({element:"polyline",curStyles:true,attr:{points:e,id:ja(),fill:"none",opacity:M.opacity/2,"stroke-linecap":"round",style:"pointer-events:none"}});A.minx=L;A.maxx=L;A.miny=N;A.maxy=N;break;case "image":Ma=true;w=S({element:"image",attr:{x:D,y:H,width:0,height:0,id:ja(),opacity:M.opacity/2,style:"pointer-events:inherit"}});W(w,Ea);qb(w);break;case "square":case "rect":Ma=true;h=D;l=H;S({element:"rect",curStyles:true,attr:{x:D,y:H,width:0,height:0,
|
||||
id:ja(),opacity:M.opacity/2}});break;case "line":Ma=true;w=M.stroke_width==0?1:M.stroke_width;S({element:"line",curStyles:true,attr:{x1:D,y1:H,x2:D,y2:H,id:ja(),stroke:M.stroke,"stroke-width":w,"stroke-dasharray":M.stroke_dasharray,"stroke-linejoin":M.stroke_linejoin,"stroke-linecap":M.stroke_linecap,"stroke-opacity":M.stroke_opacity,fill:"none",opacity:M.opacity/2,style:"pointer-events:none"}});break;case "circle":Ma=true;S({element:"circle",curStyles:true,attr:{cx:D,cy:H,r:0,id:ja(),opacity:M.opacity/
|
||||
2}});break;case "ellipse":Ma=true;S({element:"ellipse",curStyles:true,attr:{cx:D,cy:H,rx:0,ry:0,id:ja(),opacity:M.opacity/2}});break;case "text":Ma=true;S({element:"text",curStyles:true,attr:{x:D,y:H,id:ja(),fill:Ya.fill,"stroke-width":Ya.stroke_width,"font-size":Ya.font_size,"font-family":Ya.font_family,"text-anchor":"left","xml:space":"preserve",opacity:M.opacity}});break;case "path":case "pathedit":h*=o;l*=o;Ka.mouseDown(u,E,h,l);Ma=true;break;case "textedit":h*=o;l*=o;ib.mouseDown(u,E,h,l);Ma=
|
||||
true;break;case "rotate":Ma=true;b.undoMgr.beginUndoableChange("transform",I);document.getElementById("workarea").className="rotate"}w=pb("mouseDown",{event:u,start_x:h,start_y:l,selectedElements:I},true);$.each(w,function(K,R){if(R&&R.started)Ma=true});if(Fa)document.getElementById("workarea").className=Fa=="resize"?u.target.style.cursor:Fa}}).mousemove(function(u){if(!(u.originalEvent.touches&&u.originalEvent.touches.length>1))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=l<y?l:l-C}else{w=Math.min(h,x);N=Math.min(l,y)}if(u.altKey){L*=2;C*=2;w=h-L/2;N=l-C/2}if(m.gridSnapping){L=xa(L);C=xa(C);w=xa(w);N=xa(N)}ma(E,{width:L,height:C,x:w,y:N},1E3);break;case "circle":L=$(E).attr(["cx","cy"]);C=L.cx;w=L.cy;L=Math.sqrt((x-C)*(x-C)+(y-w)*(y-w));if(m.gridSnapping)L=xa(L);E.setAttributeNS(null,"r",L);break;case "ellipse":L=$(E).attr(["cx","cy"]);C=Math.abs(h+(x-h)/2);w=Math.abs(l+(y-l)/2);L=null;window.opera||d.suspendRedraw(1E3);if(m.gridSnapping){x=xa(x);C=xa(C);y=xa(y);
|
||||
w=xa(w)}N=Math.abs(h-C);n=Math.abs(l-w);if(u.shiftKey){n=N;w=y>l?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;D<u;++D){if(I[D]==null)break;I[D].firstChild||Ia.requestSelector(I[D]).resize()}}else{D=u.target;if(I[0].nodeName==="path"&&I[1]==null)Ka.select(I[0]);else u.shiftKey&&
|
||||
|
@ -274,7 +274,7 @@ function l(Q,V){var aa=d.createSVGPoint();aa.x=Q;aa.y=V;if(N.length==1)return 0;
|
|||
aa.x=fa.x;aa.y=fa.y}aa.x*=o;aa.y*=o;return aa}function A(Q){h(0,F.textContent.length);$(this).unbind(Q)}function u(Q){if(R&&F){var V=P(Q.pageX,Q.pageY,sb);V=v(V.x*o,V.y*o);V=l(V.x,V.y);var aa=F.textContent,fa=aa.substr(0,V).replace(/[a-z0-9]+$/i,"").length;aa=aa.substr(V).match(/^[a-z0-9]+/i);h(fa,(aa?aa[0].length:0)+V);$(Q.target).click(A);setTimeout(function(){$(Q.target).unbind("click",A)},300)}}var F,H,D,E,L,N=[],n,w,C,K,R;return{select:function(Q,V,aa){F=Q;ib.toEditMode(V,aa)},start:function(Q){F=
|
||||
Q;ib.toEditMode()},mouseDown:function(Q,V,aa,fa){Q=v(aa,fa);H.focus();e(l(Q.x,Q.y));C=aa;K=fa},mouseMove:function(Q,V){if(!(evt.originalEvent.touches&&evt.originalEvent.touches.length>1)){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&&V<C+2&&V>C-2&&aa<K+2&&aa>K-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<Q;V++){var fa=F.getStartPositionOfChar(V);aa=F.getEndPositionOfChar(V);if(!svgedit.browser.supportsGoodTextCharPos()){var pa=b.contentW*o;fa.x-=pa;aa.x-=pa;fa.x/=o;aa.x/=o}N[V]={x:fa.x,y:n.y,width:aa.x-fa.x,height:n.height}}N.push({x:aa.x,width:0});h(H.selectionStart,H.selectionEnd,true)}}}}(),Ka=
|
||||
F.textContent.length,V=F.getAttribute("transform");n=svgedit.utilities.getBBox(F);w=V?X(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<Q;V++){var fa=F.getStartPositionOfChar(V);aa=F.getEndPositionOfChar(V);if(!svgedit.browser.supportsGoodTextCharPos()){var pa=b.contentW*o;fa.x-=pa;aa.x-=pa;fa.x/=o;aa.x/=o}N[V]={x:fa.x,y:n.y,width:aa.x-fa.x,height:n.height}}N.push({x:aa.x,width:0});h(H.selectionStart,H.selectionEnd,true)}}}}(),Ka=
|
||||
b.pathActions=function(){var e=false,h,l,z;svgedit.path.Path.prototype.endChanges=function(A){if(svgedit.browser.isWebkit()){var u=this.elem;u.setAttribute("d",Ka.convertPath(u))}A=new Oa(this.elem,{d:this.last_d},A);za(A);O("changed",[this.elem])};svgedit.path.Path.prototype.addPtsToSelection=function(A){$.isArray(A)||(A=[A]);for(var u=0;u<A.length;u++){var F=A[u],H=this.segs[F];H.ptgrip&&this.selected_pts.indexOf(F)==-1&&F>=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<n.length;u++){var w=n[u];v.setAttribute(w.nodeName,w.nodeValue)}v.id=ja();tb[h]={symbol:v,xform:G};mb().appendChild(v);z.addSubCommand(new Da(v))}var C=
|
||||
f.createElementNS(c,"use");C.id=ja();X(C,"#"+v.id);(J||B().getCurrentLayer()).appendChild(C);z.addSubCommand(new Da(C));Qa();C.setAttribute("transform",G);Wa(C);$(C).data("symbol",v).data("ref",v);wb([C]);za(z);O("changed",[k])}catch(K){console.log(K);return false}return true};var Gb=b.identifyLayers=function(){Lb();B().identifyLayers()};this.createLayer=function(e){var h=new Ba("Create Layer");e=B().createLayer(e);h.addSubCommand(new Da(e));za(h);Qa();O("changed",[e])};this.cloneLayer=function(e){var h=
|
||||
f.createElementNS(c,"use");C.id=ja();W(C,"#"+v.id);(J||B().getCurrentLayer()).appendChild(C);z.addSubCommand(new Da(C));Qa();C.setAttribute("transform",G);Wa(C);$(C).data("symbol",v).data("ref",v);wb([C]);za(z);O("changed",[k])}catch(K){console.log(K);return false}return true};var Gb=b.identifyLayers=function(){Lb();B().identifyLayers()};this.createLayer=function(e){var h=new Ba("Create Layer");e=B().createLayer(e);h.addSubCommand(new Da(e));za(h);Qa();O("changed",[e])};this.cloneLayer=function(e){var h=
|
||||
new Ba("Duplicate Layer"),l=f.createElementNS(c,"g"),z=f.createElementNS(c,"title");z.textContent=e;l.appendChild(z);z=B().getCurrentLayer();$(z).after(l);z=z.childNodes;for(var v=0;v<z.length;v++){var G=z[v];G.localName!="title"&&l.appendChild(la(G))}Qa();Gb();h.addSubCommand(new Da(l));za(h);b.setCurrentLayer(e);O("changed",[l])};this.deleteCurrentLayer=function(){var e=B().getCurrentLayer(),h=e.nextSibling,l=e.parentNode;if(e=B().deleteCurrentLayer()){var z=new Ba("Delete Layer");z.addSubCommand(new La(e,
|
||||
h,l));za(z);Qa();O("changed",[l]);return true}return false};this.setCurrentLayer=function(e){(e=B().setCurrentLayer(svgedit.utilities.toXml(e)))&&Qa();return e};this.renameCurrentLayer=function(e){var h=B();if(h.current_layer){var l=h.current_layer;if(!b.setCurrentLayer(e)){for(var z=new Ba("Rename Layer"),v=0;v<h.getNumLayers();++v)if(h.all_layers[v][1]==l)break;var G=h.getLayerName(v);h.all_layers[v][0]=svgedit.utilities.toXml(e);var A=l.childNodes.length;for(v=0;v<A;++v){var u=l.childNodes.item(v);
|
||||
if(u&&u.tagName=="title"){for(;u.firstChild;)u.removeChild(u.firstChild);u.textContent=e;z.addSubCommand(new Oa(u,{"#text":G}));za(z);O("changed",[l]);return true}}}h.current_layer=l}return false};this.setCurrentLayerPosition=function(e){var h=B();if(h.current_layer&&e>=0&&e<h.getNumLayers()){for(var l=0;l<h.getNumLayers();++l)if(h.all_layers[l][1]==h.current_layer)break;if(l==h.getNumLayers())return false;if(l!=e){var z=null,v=h.current_layer.nextSibling;if(e>l){if(e<h.getNumLayers()-1)z=h.all_layers[e+
|
||||
|
@ -347,18 +347,18 @@ height:"200%"},100);else if(!svgedit.browser.isWebkit()){v.removeAttribute("x");
|
|||
0){A.removeAttribute("filter");F.addSubCommand(new Oa(A,H))}else{db("filter","url(#"+u+"_blur)");F.addSubCommand(new Oa(A,H));b.setBlurOffsets(l,v);h=F;b.undoMgr.beginUndoableChange("stdDeviation",[l?l.firstChild:null]);if(G){b.setBlurNoUndo(v);e()}}}}})();this.getBold=function(){var e=I[0];if(e!=null&&e.tagName=="text"&&I[1]==null)return e.getAttribute("font-weight")=="bold";return false};this.setBold=function(e){var h=I[0];if(h!=null&&h.tagName=="text"&&I[1]==null)db("font-weight",e?"bold":"normal");
|
||||
I[0].textContent||ib.setCursor()};this.getItalic=function(){var e=I[0];if(e!=null&&e.tagName=="text"&&I[1]==null)return e.getAttribute("font-style")=="italic";return false};this.setItalic=function(e){var h=I[0];if(h!=null&&h.tagName=="text"&&I[1]==null)db("font-style",e?"italic":"normal");I[0].textContent||ib.setCursor()};this.getFontFamily=function(){return Ya.font_family};this.setFontFamily=function(e){Ya.font_family=e;db("font-family",e);I[0]&&!I[0].textContent&&ib.setCursor()};this.setFontColor=
|
||||
function(e){Ya.fill=e;db("fill",e)};this.getFontSize=function(){return Ya.fill};this.getFontSize=function(){return Ya.font_size};this.setFontSize=function(e){Ya.font_size=e;db("font-size",e);I[0].textContent||ib.setCursor()};this.getText=function(){var e=I[0];if(e==null)return"";return e.textContent};this.setTextContent=function(e){db("#text",e);ib.init(e);ib.setCursor()};this.setImageURL=function(e){var h=I[0];if(h){var l=$(h).attr(["width","height"]);l=!l.width||!l.height;var z=da(h);if(z!==e)l=
|
||||
true;else if(!l)return;var v=new Ba("Change Image URL");X(h,e);v.addSubCommand(new Oa(h,{"#href":z}));l?$(new Image).load(function(){var G=$(h).attr(["width","height"]);$(h).attr({width:this.width,height:this.height});Ia.requestSelector(h).resize();v.addSubCommand(new Oa(h,G));za(v);O("changed",[h])}).attr("src",e):za(v)}};this.setLinkURL=function(e){var h=I[0];if(h){if(h.tagName!=="a"){h=$(h).parents("a");if(h.length)h=h[0];else return}var l=da(h);if(l!==e){var z=new Ba("Change Link URL");X(h,e);
|
||||
true;else if(!l)return;var v=new Ba("Change Image URL");W(h,e);v.addSubCommand(new Oa(h,{"#href":z}));l?$(new Image).load(function(){var G=$(h).attr(["width","height"]);$(h).attr({width:this.width,height:this.height});Ia.requestSelector(h).resize();v.addSubCommand(new Oa(h,G));za(v);O("changed",[h])}).attr("src",e):za(v)}};this.setLinkURL=function(e){var h=I[0];if(h){if(h.tagName!=="a"){h=$(h).parents("a");if(h.length)h=h[0];else return}var l=da(h);if(l!==e){var z=new Ba("Change Link URL");W(h,e);
|
||||
z.addSubCommand(new Oa(h,{"#href":l}));za(z)}}};this.elementsAreSame=function(e){return!e.length||e[0]==null?null:I.every(function(h){return h&&I[0]?h.nodeName==I[0].nodeName:null})};this.setRectRadius=function(e){b.elementsAreSame(I)&&I[0].tagName=="rect"&&I.forEach(function(h){var l=h.getAttribute("rx");if(l!=e){h.setAttribute("rx",e);h.setAttribute("ry",e);za(new Oa(h,{rx:l,ry:l},"Radius"));O("changed",[h])}})};this.makeHyperlink=function(e){b.groupSelectedElements("a",e)};this.removeHyperlink=
|
||||
function(){b.ungroupSelectedElement()};this.setSegType=function(e){Ka.setSegType(e)};this.convertToPath=function(e,h){if(e==null)$.each(I,function(R,Q){Q&&b.convertToPath(Q)});else{if(!h)var l=new Ba("Convert element to Path");var z=h?{}:{fill:M.fill,"fill-opacity":M.fill_opacity,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,opacity:M.opacity,visibility:"hidden"};
|
||||
$.each(["marker-start","marker-end","marker-mid","filter","clip-path"],function(){if(e.getAttribute(this))z[this]=e.getAttribute(this)});var v=S({element:"path",attr:z}),G=e.getAttribute("transform");G&&v.setAttribute("transform",G);var A=e.id,u=e.parentNode;e.nextSibling?u.insertBefore(v,e):u.appendChild(v);var F="",H=function(R){$.each(R,function(Q,V){var aa=V[1];F+=V[0];for(var fa=0;fa<aa.length;fa+=2)F+=aa[fa]+","+aa[fa+1]+" "})},D=1.81;switch(e.tagName){case "ellipse":case "circle":var E=$(e).attr(["rx",
|
||||
"ry","cx","cy"]),L=E.cx,N=E.cy,n=E.rx;E=E.ry;if(e.tagName=="circle")n=E=$(e).attr("r");H([["M",[L-n,N]],["C",[L-n,N-E/D,L-n/D,N-E,L,N-E]],["C",[L+n/D,N-E,L+n,N-E/D,L+n,N]],["C",[L+n,N+E/D,L+n/D,N+E,L,N+E]],["C",[L-n/D,N+E,L-n,N+E/D,L-n,N]],["Z",[]]]);break;case "path":F=e.getAttribute("d");break;case "line":E=$(e).attr(["x1","y1","x2","y2"]);F="M"+E.x1+","+E.y1+"L"+E.x2+","+E.y2;break;case "polyline":case "polygon":F="M"+e.getAttribute("points");break;case "rect":E=$(e).attr(["rx","ry"]);n=E.rx;E=
|
||||
E.ry;var w=e.getBBox();L=w.x;N=w.y;var C=w.width;w=w.height;D=4-D;!n&&!E?H([["M",[L,N]],["L",[L+C,N]],["L",[L+C,N+w]],["L",[L,N+w]],["L",[L,N]],["Z",[]]]):H([["M",[L,N+E]],["C",[L,N+E/D,L+n/D,N,L+n,N]],["L",[L+C-n,N]],["C",[L+C-n/D,N,L+C,N+E/D,L+C,N+E]],["L",[L+C,N+w-E]],["C",[L+C,N+w-E/D,L+C-n/D,N+w,L+C-n,N+w]],["L",[L+n,N+w]],["C",[L+n/D,N+w,L,N+w-E/D,L,N+w-E]],["L",[L,N+E]],["Z",[]]]);break;default:v.parentNode.removeChild(v)}F&&v.setAttribute("d",F);if(h){Ka.resetOrientation(v);l=false;try{l=
|
||||
v.getBBox()}catch(K){}v.parentNode.removeChild(v);return l}else{if(G){G=Y(v);qa(G)&&Ka.resetOrientation(v)}l.addSubCommand(new La(e,e.nextSibling,u));l.addSubCommand(new Da(v));Qa();e.parentNode.removeChild(e);v.setAttribute("id",A);v.removeAttribute("visibility");wb([v],true);za(l)}}};var Db=this.changeSelectedAttributeNoUndo=function(e,h,l){var z=d.suspendRedraw(1E3);Fa=="pathedit"&&Ka.moveNode(e,h);l=l||I;for(var v=l.length,G=["g","polyline","path"];v--;){var A=l[v];if(A!=null){Fa==="textedit"&&
|
||||
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"?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;z<h;++z){var v=I[z];if(v==null)break;var G=v.parentNode,A=v;Ia.releaseSelector(A);svgedit.path.removePath_(A.id);if(G.tagName==="a"&&G.childNodes.length===1){A=G;G=G.parentNode}var u=A.nextSibling;A=G.removeChild(A);l.push(v);I[z]=null;e.addSubCommand(new La(A,u,G))}e.isEmpty()||za(e);O("changed",l);Qa()};this.cutSelectedElements=function(){for(var e=new Ba("Cut Elements"),h=I.length,l=[],z=0;z<h;++z){var v=I[z];if(v==null)break;var G=v.parentNode,A=v;Ia.releaseSelector(A);svgedit.path.removePath_(A.id);
|
||||
var u=A.nextSibling;A=G.removeChild(A);l.push(v);I[z]=null;e.addSubCommand(new La(A,u,G))}e.isEmpty()||za(e);O("changed",l);Qa();b.clipBoard=l};this.copySelectedElements=function(){b.clipBoard=$.merge([],I)};this.pasteElements=function(){var e=b.clipBoard,h=e.length;if(h){for(var l=[],z=new Ba("Paste elements");h--;){var v=e[h];if(v){var G=la(v);if(!ra(v.id))G.id=v.id;l.push(G);(J||B().getCurrentLayer()).appendChild(G);z.addSubCommand(new Da(G))}}svgCanvas.clearSelection();setTimeout(function(){Bb(l)},
|
||||
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"&&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;F<z;F++){var N=l[F];if(N.nodeType===1){if(D.opacity!==null&&D.opacity!==1){N.getAttribute("opacity");var n=Math.round((N.getAttribute("opacity")||1)*D.opacity*100)/100;db("opacity",n,[N])}if(D.filter){var w=n=this.getBlur(N);L||(L=this.getBlur(e));
|
||||
if(n)n=L-0+(n-0);else if(n===0)n=L;if(w)E=T(N.getAttribute("filter"));else if(E){E=la(E);mb().appendChild(E)}else E=T(D.filter);E.id=N.id+"_"+(E.firstChild.tagName==="feGaussianBlur"?"blur":"filter");db("filter","url(#"+E.id+")",[N]);if(n){db("stdDeviation",n,[E.firstChild]);b.setBlurOffsets(E,n)}}n=Y(N);if(~N.tagName.indexOf("Gradient"))n=null;if(n)if(N.tagName!=="defs")if(G.numberOfItems){if(H&&G.numberOfItems==1){var C=G.getItem(0).matrix,K=d.createSVGMatrix();if(w=oa(N))K=n.getItem(0).matrix;
|
||||
var R=svgedit.utilities.getBBox(N),Q=ga(n).matrix,V=P(R.x+R.width/2,R.y+R.height/2,Q);R=H+w;Q=d.createSVGTransform();Q.setRotate(R,V.x,V.y);C=ia(C,K,Q.matrix.inverse());w&&n.removeItem(0);if(R)n.numberOfItems?n.insertItemBefore(Q,0):n.appendItem(Q);if(C.e||C.f){w=d.createSVGTransform();w.setTranslate(C.e,C.f);n.numberOfItems?n.insertItemBefore(w,0):n.appendItem(w)}}else{w=N.getAttribute("transform");C={};C.transform=w?w:"";w=d.createSVGTransform();C=ga(n).matrix;K=C.inverse();C=ia(K,A,C);w.setMatrix(C);
|
||||
|
@ -371,7 +371,7 @@ h,false);za(z)}return A};this.alignSelectedElements=function(e,h){var l=[],z=Num
|
|||
F=l[D].height}break;case "largest":if((e=="l"||e=="c"||e=="r")&&(u==Number.MIN_VALUE||u<l[D].width)||(e=="t"||e=="m"||e=="b")&&(F==Number.MIN_VALUE||F<l[D].height)){z=l[D].x;G=l[D].y;v=l[D].x+l[D].width;A=l[D].y+l[D].height;u=l[D].width;F=l[D].height}break;default:if(l[D].x<z)z=l[D].x;if(l[D].y<G)G=l[D].y;if(l[D].x+l[D].width>v)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<H;++D){if(I[D]==null)break;
|
||||
var E=l[D];u[D]=0;F[D]=0;switch(e){case "l":u[D]=z-E.x;break;case "c":u[D]=(z+v)/2-(E.x+E.width/2);break;case "r":u[D]=v-(E.x+E.width);break;case "t":F[D]=G-E.y;break;case "m":F[D]=(G+A)/2-(E.y+E.height/2);break;case "b":F[D]=A-(E.y+E.height)}}this.moveSelectedElements(u,F)}};this.contentW=Eb().w;this.contentH=Eb().h;this.updateCanvas=function(e,h){d.setAttribute("width",e);d.setAttribute("height",h);var l=$("#canvasBackground")[0],z=k.getAttribute("x"),v=k.getAttribute("y"),G=e/2-this.contentW*o/
|
||||
2,A=h/2-this.contentH*o/2;ma(k,{width:this.contentW*o,height:this.contentH*o,x:G,y:A,viewBox:"0 0 "+this.contentW+" "+this.contentH});ma(l,{width:k.getAttribute("width"),height:k.getAttribute("height"),x:G,y:A});(l=ra("background_image"))&&ma(l,{width:"100%",height:"100%"});Ia.selectorParentGroup.setAttribute("transform","translate("+G+","+A+")");return{x:G,y:A,old_x:z,old_y:v,d_x:G-z,d_y:A-v}};this.setBackground=function(e,h){var l=ra("canvasBackground"),z=$(l).find("rect")[0],v=ra("background_image");
|
||||
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"})}X(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",
|
||||
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("<p>"+R.replace(/\n/g,"</p><p>")+"</p>").toggleClass("prompt",K=="prompt");w.empty();var aa=a('<input type="button" value="'+uiStrings.common.ok+'">').appendTo(w);K!="alert"&&a('<input type="button" value="'+uiStrings.common.cancel+'">').appendTo(w).on("click, touchstart",function(){n.hide();Q(false)});if(K=="prompt"){var fa=a('<input type="text">').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("<div>",{"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<V;Q++){var aa=R[Q].getAttribute("stroke-width");if(Q===0)K=aa;else if(K!==aa)K=null}a("#stroke_width").val(K===null?"":K);c.paintBox.fill.update(true);c.paintBox.stroke.update(true);break;default:c.paintBox.fill.update(true);c.paintBox.stroke.update(true);a("#stroke_width").val(W.getAttribute("stroke-width")||1);a("#stroke_style").val(W.getAttribute("stroke-dasharray")||"none");K=W.getAttribute("stroke-linejoin")||"miter";a("#linejoin_"+K).length!=
|
||||
0&&d(a("#linejoin_"+K)[0]);K=W.getAttribute("stroke-linecap")||"butt";a("#linecap_"+K).length!=0&&d(a("#linecap_"+K)[0])}if(W!=null){K=(W.getAttribute("opacity")||1)*100;a("#group_opacity").val(K);a("#opac_slider").slider("option","value",K);a("#elem_id").val(W.id)}}a("#path_node_panel").toggle(C);a("#tools_bottom_2,#tools_bottom_3").toggle(!C);if(C){a(".tool_button_current").removeClass("tool_button_current").addClass("tool_button");a("#tool_select").addClass("tool_button_current").removeClass("tool_button");
|
||||
db("#tool_select","select_node");ta=false;if(w.length)W=w[0]}else{if(w[0]){C=g.selectorManager.requestSelector(w[0]);C.reset(w[0]);C.selectorRect.setAttribute("display","inline")}db("#tool_select","select")}Ba();g.runExtensions("selectedChanged",{elems:w,selectedElement:W,multiselected:ta})});g.bind("transition",function(n,w){var C=g.getMode(),K=w[0];if(K){ta=w.length>=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<w.length;++K){var R=w[K];if(R&&R.tagName==="svg")H();else if(R&&W&&W.parentNode==null)W=R}c.show_save_warning=true;Ba();if(W&&C==="select"){c.paintBox.fill.update();c.paintBox.stroke.update()}g.runExtensions("elementChanged",{elems:w})});g.bind("saved",function(n,w){c.show_save_warning=false;w='<?xml version="1.0"?>\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<V;Q++){var aa=R[Q].getAttribute("stroke-width");if(Q===0)K=aa;else if(K!==aa)K=null}a("#stroke_width").val(K===null?"":K);c.paintBox.fill.update(true);c.paintBox.stroke.update(true);break;default:c.paintBox.fill.update(true);c.paintBox.stroke.update(true);a("#stroke_width").val(X.getAttribute("stroke-width")||1);a("#stroke_style").val(X.getAttribute("stroke-dasharray")||"none");K=X.getAttribute("stroke-linejoin")||"miter";a("#linejoin_"+K).length!=
|
||||
0&&d(a("#linejoin_"+K)[0]);K=X.getAttribute("stroke-linecap")||"butt";a("#linecap_"+K).length!=0&&d(a("#linecap_"+K)[0])}if(X!=null){K=(X.getAttribute("opacity")||1)*100;a("#group_opacity").val(K);a("#opac_slider").slider("option","value",K);a("#elem_id").val(X.id)}}a("#path_node_panel").toggle(C);a("#tools_bottom_2,#tools_bottom_3").toggle(!C);if(C){a(".tool_button_current").removeClass("tool_button_current").addClass("tool_button");a("#tool_select").addClass("tool_button_current").removeClass("tool_button");
|
||||
db("#tool_select","select_node");ta=false;if(w.length)X=w[0]}else{if(w[0]){C=g.selectorManager.requestSelector(w[0]);C.reset(w[0]);C.selectorRect.setAttribute("display","inline")}db("#tool_select","select")}Ba();g.runExtensions("selectedChanged",{elems:w,selectedElement:X,multiselected:ta})});g.bind("transition",function(n,w){var C=g.getMode(),K=w[0];if(K){ta=w.length>=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<w.length;++K){var R=w[K];if(R&&R.tagName==="svg")H();else if(R&&X&&X.parentNode==null)X=R}c.show_save_warning=true;Ba();if(X&&C==="select"){c.paintBox.fill.update();c.paintBox.stroke.update()}g.runExtensions("elementChanged",{elems:w})});g.bind("saved",function(n,w){c.show_save_warning=false;w='<?xml version="1.0"?>\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("<defs")!==-1){Q+="\n\n"+uiStrings.notification.defsFailOnSave;a.pref("save_notice_done","all");R="all"}else a.pref("save_notice_done","part");else a.pref("save_notice_done","all");R!=="part"&&K.alert(Q)}}});g.bind("exported",function(n,
|
||||
w){var C=w.issues;a("#export_canvas").length||a("<canvas>",{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='<a href="#" data-root="y">'+g.getCurrentDrawing().getCurrentLayerName()+"</a>";a(w).parentsUntil("#svgcontent > g").andSelf().each(function(){if(this.id){K+=" > "+this.id;C+=this!==w?' > <a href="#">'+this.id+"</a>":" > "+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='<a href="#" data-root="y">'+g.getCurrentDrawing().getCurrentLayerName()+"</a>";a(w).parentsUntil("#svgcontent > g").andSelf().each(function(){if(this.id){K+=" > "+this.id;C+=this!==w?' > <a href="#">'+this.id+"</a>":" > "+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("<div>",{id:ha.panel}).appendTo("#tools_top").hide());switch(ha.type){case "tool_button":var va='<div class="tool_button">'+ha.id+"</div>",Na=a(va).appendTo(Ra);ha.events&&a.each(ha.events,function(Va,cb){a(Na).bind(Va,cb)});break;case "select":va=
|
||||
"<label"+eb+'><select id="'+ha.id+'">';a.each(ha.options,function(Va,cb){va+='<option value="'+Va+'"'+(Va==ha.defval?" selected":"")+">"+cb+"</option>"});va+="</select></label>";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='<div id="'+ha.id+'" class="dropdown toolset" title="'+ha.title+'"><div id="cur_'+ha.id+'" class="icon_label"></div><button></button></div>';eb=a('<ul id="'+ha.id+'_opts"></ul>').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="<label"+eb+'><span id="'+ha.id+'_label">'+ha.label+':</span><input id="'+ha.id+'" title="'+ha.title+'" size="'+(ha.size||"4")+'" value="'+(ha.defval||"")+'" type="text"/></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<Jb)Na.children().eq(Va).before(ab);else{Na.append(ab);Ra.reverse()}}sa||ab.append(eb);ha.list||a.each(ha.events,function(yb,Hb){if(yb=="click")if(ha.type=="mode"){ha.includeWith?ab.bind(yb,Hb):ab.bind(yb,function(){$a(ab)&&Hb()});if(ha.key){a(document).bind("keydown",ha.key,Hb);ha.title&&ab.attr("title",
|
||||
ha.title+" ["+ha.key+"]")}}else ab.bind(yb,Hb);else ab.bind(yb,Hb)});ra(Za)});a.each(aa,function(){Ea(this.elem,this.list,this.callback,{seticon:true})});if(sa)Q=false;a.svgIcons(sa,{w:27,h:27,id_match:false,no_img:!B,fallback:fa,placement:pa,callback:function(){s.iconsize&&s.iconsize!="m"&&C();Q=true;V()}})}V()});g.textActions.setInputElem(a("#text")[0]);var za='<div class="palette_item" data-rgb="none"></div>';a.each(["#000000","#3f3f3f","#7f7f7f","#bfbfbf","#ffffff","#ff0000","#ff7f00","#ffff00",
|
||||
"#7fff00","#00ff00","#00ff7f","#00ffff","#007fff","#0000ff","#7f00ff","#ff00ff","#ff007f","#7f0000","#7f3f00","#7f7f00","#3f7f00","#007f00","#007f3f","#007f7f","#003f7f","#00007f","#3f007f","#7f007f","#7f003f","#ffaaaa","#ffd4aa","#ffffaa","#d4ffaa","#aaffaa","#aaffd4","#aaffff","#aad4ff"],function(n,w){za+='<div class="palette_item" style="background-color: '+w+';" data-rgb="'+w+'"></div>'});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("<p/>").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("<p/>").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('<input type="hidden">');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,<title>"+n+"</title><h1>"+n+"</h1>")}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('<style id="wireframe_rules"></style>').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('<style id="tool_size_rules"></style>').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('<svg xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%"\t\t\t\t\tfill="#'+K.color+'" opacity="'+K.opacity+'"/>\t\t\t\t\t<defs><linearGradient id="gradbox_"/></defs></svg>',"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<pa;fa++){var sa=aa[fa].getAttribute(Q);
|
||||
if(fa===0)V=sa;else if(V!==sa){V=null;break}}if(V===null){aa=null;return}aa=V;V=1;break;default:V=parseFloat(W.getAttribute(Q+"-opacity"));if(isNaN(V))V=1;aa=Q==="fill"?"black":"none";aa=W.getAttribute(Q)||aa}if(R){g.setColor(Q,aa,true);g.setPaintOpacity(Q,V,true)}V*=100;this.setPaint(Ja(aa,V,Q))}};this.prep=function(){switch(this.paint.type){case "linearGradient":case "radialGradient":var R=new a.jGraduate.Paint({copy:this.paint});g.setPaint(w,R)}}};c.paintBox.fill=new q("#fill_color","fill");c.paintBox.stroke=
|
||||
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(X){var Q=this.type;switch(X.tagName){case "use":case "image":case "foreignObject":return;case "g":case "a":for(var V=null,aa=X.getElementsByTagName("*"),fa=0,pa=aa.length;fa<pa;fa++){var sa=aa[fa].getAttribute(Q);
|
||||
if(fa===0)V=sa;else if(V!==sa){V=null;break}}if(V===null){aa=null;return}aa=V;V=1;break;default:V=parseFloat(X.getAttribute(Q+"-opacity"));if(isNaN(V))V=1;aa=Q==="fill"?"black":"none";aa=X.getAttribute(Q)||aa}if(R){g.setColor(Q,aa,true);g.setPaintOpacity(Q,V,true)}V*=100;this.setPaint(Ja(aa,V,Q))}};this.prep=function(){switch(this.paint.type){case "linearGradient":case "radialGradient":var R=new a.jGraduate.Paint({copy:this.paint});g.setPaint(w,R)}}};c.paintBox.fill=new q("#fill_color","fill");c.paintBox.stroke=
|
||||
new q("#stroke_color","stroke");c.paintBox.canvas=new q("#canvas_color","canvas");a("#stroke_width").val(curConfig.initStroke.width);a("#group_opacity").val(curConfig.initOpacity*100);q=c.paintBox.fill.rect.cloneNode(false);q.setAttribute("style","vector-effect:non-scaling-stroke");var A=q.style.vectorEffect==="non-scaling-stroke";q.removeAttribute("style");q=c.paintBox.fill.rect.ownerDocument.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur");typeof q.stdDeviationX==="undefined"&&a("#tool_blur").hide();
|
||||
a(q).remove();setTimeout(function(){g.embedImage("images/placeholder.svg",function(n){if(!n){a("#image_save_opts [value=embed]").attr("disabled","disabled");a("#image_save_opts input").val(["ref"]);s.img_save="ref";a("#image_opt_embed").css("color","#666").attr("title",uiStrings.notification.featNotSupported)}})},1E3);a("#tool_fill").click(function(){if(a("#tool_fill").hasClass("active"))G(a("#fill_color"));else{a("#tool_fill").addClass("active");a("#tool_stroke").removeClass("active")}});a("#tool_stroke").on("click",
|
||||
function(){if(a("#tool_stroke").hasClass("active"))G(a("#stroke_color"));else{a("#tool_stroke").addClass("active");a("#tool_fill").removeClass("active")}});a("#tool_canvas").on("click touchstart",function(){G(a("#canvas_color"))});a("#tool_stroke").on("touchstart",function(){a("#tool_stroke").addClass("active");a("#tool_fill").removeClass("active");G(a("#stroke_color"))});a("#tool_fill").on("touchstart",function(){a("#tool_fill").addClass("active");a("#tool_stroke").removeClass("active");G(a("#fill_color"))});
|
||||
|
@ -486,7 +486,7 @@ step:1,callback:changeAttribute,cursor:false});a("#ellipse_cx").dragInput({min:0
|
|||
max:null,step:1,callback:changeAttribute,cursor:false});a("#selected_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#path_node_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#path_node_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#image_width").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#line_x1").dragInput({min:null,max:null,step:1,callback:changeAttribute,
|
||||
cursor:false});a("#line_x2").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#line_y1").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#line_y2").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#path_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#path_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#rect_x").dragInput({min:null,max:null,
|
||||
step:1,callback:changeAttribute,cursor:false});a("#rect_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#g_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#g_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#image_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#text_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#text_x").dragInput({min:null,
|
||||
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&&W&&["line","polyline"].indexOf(W.nodeName)>=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<g.length;c+=1)g[c]=this._trimAlignValue(g[c]);return g},_trimAlignValue:function(p){if(p<=this._valueMin())return this._valueMin();if(p>=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;Z<ia.length;Z++)ia[Z].call(d,d,X)},ga=function(X){var Z=b.offset();Y={l:Z.left|0,t:Z.top|0};clearTimeout(P);P=setTimeout(function(){ta.call(d,X)},0);a(document).bind("mousemove",ba).bind("mouseup",W);X.preventDefault()},ba=function(X){clearTimeout(P);P=setTimeout(function(){ta.call(d,
|
||||
X)},0);X.stopPropagation();X.preventDefault();return false},W=function(X){a(document).unbind("mouseup",W).unbind("mousemove",ba);X.stopPropagation();X.preventDefault();return false},ta=function(X){var Z=X.pageX-Y.l;X=X.pageY-Y.t;var oa=b.w,ra=b.h;if(Z<0)Z=0;else if(Z>oa)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(ma<q)ma=q;else if(ma>B)ma=B;if(I!=ma){I=ma;ra=true}}if(na!=null){if(na<J)na=J;else if(na>U)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;Z<ia.length;Z++)ia[Z].call(d,d,W)},ga=function(W){var Z=b.offset();Y={l:Z.left|0,t:Z.top|0};clearTimeout(P);P=setTimeout(function(){ta.call(d,W)},0);a(document).bind("mousemove",ba).bind("mouseup",X);W.preventDefault()},ba=function(W){clearTimeout(P);P=setTimeout(function(){ta.call(d,
|
||||
W)},0);W.stopPropagation();W.preventDefault();return false},X=function(W){a(document).unbind("mouseup",X).unbind("mousemove",ba);W.stopPropagation();W.preventDefault();return false},ta=function(W){var Z=W.pageX-Y.l;W=W.pageY-Y.t;var oa=b.w,ra=b.h;if(Z<0)Z=0;else if(Z>oa)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(ma<q)ma=q;else if(ma>B)ma=B;if(I!=ma){I=ma;ra=true}}if(na!=null){if(na<J)na=J;else if(na>U)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(ka<da)return da;return ka},ta=function(ka,da){var X=ka.val("all");if(da!=B.get(0))B.val(X!=null?X.r:"");if(da!=o.get(0))o.val(X!=null?X.g:"");if(da!=J.get(0))J.val(X!=null?X.b:"");if(U&&da!=U.get(0))U.val(X!=null?Math.precision(X.a*100/255,k):"");if(da!=M.get(0))M.val(X!=
|
||||
null?X.h:"");if(da!=I.get(0))I.val(X!=null?X.s:"");if(da!=S.get(0))S.val(X!=null?X.v:"");if(da!=Y.get(0)&&(d&&da!=d.get(0)||!d))Y.val(X!=null?X.hex:"");if(d&&da!=d.get(0)&&da!=Y.get(0))d.val(X!=null?X.hex:"");if(P&&da!=P.get(0))P.val(X!=null?X.ahex.substring(6):"")};a.extend(true,q,{destroy:function(){B.add(o).add(J).add(U).add(M).add(I).add(S).add(Y).add(d).add(P).unbind("keyup",qa).unbind("blur",ga);B.add(o).add(J).add(U).add(M).add(I).add(S).unbind("keydown",ia);f.unbind(ta);P=Y=S=I=M=U=J=o=B=
|
||||
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},X=function(ka,da,W){if(ka==""||isNaN(ka))return da;if(ka>W)return W;if(ka<da)return da;return ka},ta=function(ka,da){var W=ka.val("all");if(da!=B.get(0))B.val(W!=null?W.r:"");if(da!=o.get(0))o.val(W!=null?W.g:"");if(da!=J.get(0))J.val(W!=null?W.b:"");if(U&&da!=U.get(0))U.val(W!=null?Math.precision(W.a*100/255,k):"");if(da!=M.get(0))M.val(W!=
|
||||
null?W.h:"");if(da!=I.get(0))I.val(W!=null?W.s:"");if(da!=S.get(0))S.val(W!=null?W.v:"");if(da!=Y.get(0)&&(d&&da!=d.get(0)||!d))Y.val(W!=null?W.hex:"");if(d&&da!=d.get(0)&&da!=Y.get(0))d.val(W!=null?W.hex:"");if(P&&da!=P.get(0))P.val(W!=null?W.ahex.substring(6):"")};a.extend(true,q,{destroy:function(){B.add(o).add(J).add(U).add(M).add(I).add(S).add(Y).add(d).add(P).unbind("keyup",qa).unbind("blur",ga);B.add(o).add(J).add(U).add(M).add(I).add(S).unbind("keydown",ia);f.unbind(ta);P=Y=S=I=M=U=J=o=B=
|
||||
null}});B.add(o).add(J).add(U).add(M).add(I).add(S).add(Y).add(d).add(P).bind("keyup",qa).bind("blur",ga);B.add(o).add(J).add(U).add(M).add(I).add(S).bind("keydown",ia);f.bind(ta)};a.jPicker={List:[],Color:function(b){var f=this,d,k,q,B,o,J,U,M=[],I=function(Y){for(var P=0;P<M.length;P++)M[P].call(f,f,Y)},S=function(Y,P,ia){if(P===undefined){if(Y===undefined||Y==null||Y=="")Y="all";if(d==null)return null;switch(Y.toLowerCase()){case "ahex":return s.rgbaToHex({r:d,g:k,b:q,a:B});case "hex":return S("ahex").substring(0,
|
||||
6);case "all":return{r:d,g:k,b:q,a:B,h:o,s:J,v:U,hex:S.call(f,"hex"),ahex:S.call(f,"ahex")};default:P={};for(var qa=0;qa<Y.length;qa++)switch(Y.charAt(qa)){case "r":if(Y.length==1)P=d;else P.r=d;break;case "g":if(Y.length==1)P=k;else P.g=k;break;case "b":if(Y.length==1)P=q;else P.b=q;break;case "a":if(Y.length==1)P=B;else P.a=B;break;case "h":if(Y.length==1)P=o;else P.h=o;break;case "s":if(Y.length==1)P=J;else P.s=J;break;case "v":if(Y.length==1)P=U;else P.v=U}return P=={}?S.call(f,"all"):P}}if(!(ia!=
|
||||
null&&ia==f)){var ga=false;if(Y==null)Y="";if(P==null){if(d!=null){d=null;ga=true}if(k!=null){k=null;ga=true}if(q!=null){q=null;ga=true}if(B!=null){B=null;ga=true}if(o!=null){o=null;ga=true}if(J!=null){J=null;ga=true}if(U!=null){U=null;ga=true}ga&&I.call(f,ia||f)}else switch(Y.toLowerCase()){case "ahex":case "hex":P=s.hexToRgba(P&&(P.ahex||P.hex)||P||"00000000");S.call(f,"rgba",{r:P.r,g:P.g,b:P.b,a:Y=="ahex"?P.a:B!=null?B:255},ia);break;default:if(P&&(P.ahex!=null||P.hex!=null)){S.call(f,"ahex",P.ahex||
|
||||
P.hex||"00000000",ia);break}var ba={},W=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;qa<Y.length;qa++)switch(Y.charAt(qa)){case "r":if(ta)continue;W=true;ba.r=P&&P.r&&P.r|0||P&&P|0||0;if(ba.r<0)ba.r=
|
||||
0;else if(ba.r>255)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;qa<Y.length;qa++)switch(Y.charAt(qa)){case "r":if(ta)continue;X=true;ba.r=P&&P.r&&P.r|0||P&&P|0||0;if(ba.r<0)ba.r=
|
||||
0;else if(ba.r>255)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('<span class="jPicker"><span class="Icon"><span class="Color"> </span><span class="Alpha"> </span><span class="Image" title="Click To Open Color Picker"> </span><span class="Container"> </span></span></span>');
|
||||
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("<iframe/>");B.prev().css({width:T.width(),height:B.height(),opacity:0,position:"absolute",left:B.css("left"),top:B.css("top")})}};if(k.window.expandable){a(document.body).children("div.jPicker.Container").css({zIndex:10});B.css({zIndex:20})}switch(k.window.effects.type){case "fade":B.fadeIn(k.window.effects.speed.show,O);break;case "slide":B.slideDown(k.window.effects.speed.show,
|
||||
O);break;default:B.show(k.window.effects.speed.show,O)}},xb=function(){var O=function(){k.window.expandable&&B.css({zIndex:10});!k.window.expandable||a.support.boxModel||B.prev().remove()};switch(k.window.effects.type){case "fade":B.fadeOut(k.window.effects.speed.hide,O);break;case "slide":B.slideUp(k.window.effects.speed.hide,O);break;default:B.hide(k.window.effects.speed.hide,O)}},Ab=function(){var O=k.window,T=O.expandable?a(d).next().find(".Container:first"):null;B=O.expandable?a("<div/>"):a(d);
|
||||
|
@ -638,14 +638,14 @@ la.clientPath+la.colorMap.arrow.file+'" class="Arrow"/></div></td><td rowspan="9
|
|||
"")+'" title="'+ca.tooltips.alpha.textbox+'"/> %':" ")+'</td></tr><tr class="Hex"><td colspan="2" class="Text"><label title="'+ca.tooltips.hex.textbox+'">#:<input type="text" maxlength="6" class="Hex" value="'+(ea!=null?ea.hex:"")+'"/></label>'+(O.alphaSupport?'<input type="text" maxlength="2" class="AHex" value="'+(ea!=null?ea.ahex.substring(6):"")+'" title="'+ca.tooltips.hex.alpha+'"/></td>':" ")+"</tr></tbody></table>";if(O.expandable){B.html(Ha);a(document.body).children("div.jPicker.Container").length==
|
||||
0?a(document.body).prepend(B):a(document.body).children("div.jPicker.Container:last").after(B);B.mousedown(function(){a(document.body).children("div.jPicker.Container").css({zIndex:10});B.css({zIndex:20})});B.css({left:O.position.x=="left"?T.offset().left-530-(O.position.y=="center"?25:0)+"px":O.position.x=="center"?T.offset().left-260+"px":O.position.x=="right"?T.offset().left-10+(O.position.y=="center"?25:0)+"px":O.position.x=="screenCenter"?(a(document).width()>>1)-260+"px":T.offset().left+parseInt(O.position.x)+
|
||||
"px",position:"absolute",top:O.position.y=="top"?T.offset().top-312+"px":O.position.y=="center"?T.offset().top-156+"px":O.position.y=="bottom"?T.offset().top+25+"px":T.offset().top+parseInt(O.position.y)+"px"})}else{B=a(d);B.html(Ha)}Ha=B.find("tbody:first");o=Ha.find("div.Map:first");J=Ha.find("div.Bar:first");var Pa=o.find("span"),Xa=J.find("span");U=Pa.filter(".Map1:first");M=Pa.filter(".Map2:first");I=Pa.filter(".Map3:first");S=Xa.filter(".Map1:first");Y=Xa.filter(".Map2:first");P=Xa.filter(".Map3:first");
|
||||
ia=Xa.filter(".Map4:first");qa=Xa.filter(".Map5:first");ga=Xa.filter(".Map6:first");ba=new p(o,{map:{width:la.colorMap.width,height:la.colorMap.height},arrow:{image:la.clientPath+la.colorMap.arrow.file,width:la.colorMap.arrow.width,height:la.colorMap.arrow.height}});ba.bind(za);W=new p(J,{map:{width:la.colorBar.width,height:la.colorBar.height},arrow:{image:la.clientPath+la.colorBar.arrow.file,width:la.colorBar.arrow.width,height:la.colorBar.arrow.height}});W.bind(Ia);ta=new g(Ha,ja.active,O.expandable&&
|
||||
ia=Xa.filter(".Map4:first");qa=Xa.filter(".Map5:first");ga=Xa.filter(".Map6:first");ba=new p(o,{map:{width:la.colorMap.width,height:la.colorMap.height},arrow:{image:la.clientPath+la.colorMap.arrow.file,width:la.colorMap.arrow.width,height:la.colorMap.arrow.height}});ba.bind(za);X=new p(J,{map:{width:la.colorBar.width,height:la.colorBar.height},arrow:{image:la.clientPath+la.colorBar.arrow.file,width:la.colorBar.arrow.width,height:la.colorBar.arrow.height}});X.bind(Ia);ta=new g(Ha,ja.active,O.expandable&&
|
||||
O.bindToInput?O.input:null,O.alphaPrecision);Pa=ea!=null?ea.hex:null;var fb=Ha.find(".Preview");Xa=Ha.find(".Button");oa=fb.find(".Active:first").css({backgroundColor:Pa&&"#"+Pa||"transparent"});ra=fb.find(".Current:first").css({backgroundColor:Pa&&"#"+Pa||"transparent"}).bind("click",Fa);wa.call(d,ra,Math.precision(ja.current.val("a")*100)/255,4);ma=Xa.find(".Ok:first").bind("click touchstart",tb);na=Xa.find(".Cancel:first").bind("click touchstart",lb);Ca=Xa.find(".Grid:first");setTimeout(function(){Sa.call(d,
|
||||
U,la.clientPath+"Maps.png");Sa.call(d,M,la.clientPath+"Maps.png");Sa.call(d,I,la.clientPath+"map-opacity.png");Sa.call(d,S,la.clientPath+"Bars.png");Sa.call(d,Y,la.clientPath+"Bars.png");Sa.call(d,P,la.clientPath+"Bars.png");Sa.call(d,ia,la.clientPath+"Bars.png");Sa.call(d,qa,la.clientPath+"bar-opacity.png");Sa.call(d,ga,la.clientPath+"AlphaBar.png");Sa.call(d,fb.find("div:last"),la.clientPath+"preview-opacity.png")},0);Ha.find("td.Radio input").bind("click touchstart",Ta);if(ja.quickList&&ja.quickList.length>
|
||||
0){Xa="";for(i=0;i<ja.quickList.length;i++){if((typeof ja.quickList[i]).toString().toLowerCase()=="string")ja.quickList[i]=new c({hex:ja.quickList[i]});var ob=ja.quickList[i].val("a"),Wa=ja.quickList[i].val("ahex");if(!O.alphaSupport&&Wa)Wa=Wa.substring(0,6)+"ff";var sb=ja.quickList[i].val("hex");Xa+='<span class="QuickColor"'+(Wa&&' title="#'+Wa+'"'||"")+' style="background-color:'+(sb&&"#"+sb||"")+";"+(sb?"":"background-image:url("+la.clientPath+"NoColor.png)")+(O.alphaSupport&&ob&&ob<255?";opacity:"+
|
||||
Math.precision(ob/255,4)+";filter:Alpha(opacity="+Math.precision(ob/2.55,4)+")":"")+'"> </span>'}Sa.call(d,Ca,la.clientPath+"bar-opacity.png");Ca.html(Xa);Ca.find(".QuickColor").click(zb)}Oa.call(d,k.color.mode);ja.active.bind(Ba);a.isFunction(gb)&&ja.active.bind(gb);ja.current.bind(bb);if(O.expandable){d.icon=T.parents(".Icon:first");Ga=d.icon.find(".Color:first").css({backgroundColor:Pa&&"#"+Pa||"transparent"});Ja=d.icon.find(".Alpha:first");Sa.call(d,Ja,la.clientPath+"bar-opacity.png");wa.call(d,
|
||||
Ja,Math.precision((255-(ea!=null?ea.a:0))*100/255,4));Da=d.icon.find(".Image:first").css({backgroundImage:"url('"+la.clientPath+la.picker.file+"')"}).bind("click",Ya);if(O.bindToInput&&O.updateInputColor)O.input.css({backgroundColor:Pa&&"#"+Pa||"transparent",color:ea==null||ea.v>75?"#000000":"#ffffff"});La=Ha.find(".Move:first").bind("mousedown",ua);ja.active.bind(Cb)}else vb.call(d)},la=k.images,ca=k.localization,ja={active:(typeof k.color.active).toString().toLowerCase()=="string"?new c({ahex:!k.window.alphaSupport&&
|
||||
k.color.active?k.color.active.substring(0,6)+"ff":k.color.active}):new c({ahex:!k.window.alphaSupport&&k.color.active.val("ahex")?k.color.active.val("ahex").substring(0,6)+"ff":k.color.active.val("ahex")}),current:(typeof k.color.active).toString().toLowerCase()=="string"?new c({ahex:!k.window.alphaSupport&&k.color.active?k.color.active.substring(0,6)+"ff":k.color.active}):new c({ahex:!k.window.alphaSupport&&k.color.active.val("ahex")?k.color.active.val("ahex").substring(0,6)+"ff":k.color.active.val("ahex")}),
|
||||
quickList:k.color.quickList};a.extend(true,d,{commitCallback:pb,liveCallback:gb,cancelCallback:ub,color:ja,show:vb,hide:xb,destroy:function(){B.find("td.Radio input touchstart").unbind("click",Ta);ra.unbind("click touchstart",Fa);na.unbind("click touchstart",lb);ma.unbind("click touchstart",tb);if(k.window.expandable){Da.unbind("click",Ya);La.unbind("mousedown",ua);d.icon=null}B.find(".QuickColor").unbind("click",zb);ga=qa=ia=P=Y=S=I=M=U=J=o=null;ba.destroy();ba=null;W.destroy();W=null;ta.destroy();
|
||||
quickList:k.color.quickList};a.extend(true,d,{commitCallback:pb,liveCallback:gb,cancelCallback:ub,color:ja,show:vb,hide:xb,destroy:function(){B.find("td.Radio input touchstart").unbind("click",Ta);ra.unbind("click touchstart",Fa);na.unbind("click touchstart",lb);ma.unbind("click touchstart",tb);if(k.window.expandable){Da.unbind("click",Ya);La.unbind("mousedown",ua);d.icon=null}B.find(".QuickColor").unbind("click",zb);ga=qa=ia=P=Y=S=I=M=U=J=o=null;ba.destroy();ba=null;X.destroy();X=null;ta.destroy();
|
||||
gb=ub=pb=Ca=na=ma=ra=oa=ta=null;B.html("");for(i=0;i<m.length;i++)m[i]==d&&m.splice(i,1)}});m.push(d);setTimeout(function(){Ab.call(d)},0)})};a.fn.jPicker.defaults={window:{title:null,effects:{type:"slide",speed:{show:"slow",hide:"fast"}},position:{x:"screenCenter",y:"top"},expandable:false,liveUpdate:true,alphaSupport:false,alphaPrecision:0,updateInputColor:true},color:{mode:"h",active:new c({ahex:"#ffcc00ff"}),quickList:[new c({h:360,s:33,v:100}),new c({h:360,s:66,v:100}),new c({h:360,s:100,v:100}),
|
||||
new c({h:360,s:100,v:75}),new c({h:360,s:100,v:50}),new c({h:180,s:0,v:100}),new c({h:30,s:33,v:100}),new c({h:30,s:66,v:100}),new c({h:30,s:100,v:100}),new c({h:30,s:100,v:75}),new c({h:30,s:100,v:50}),new c({h:180,s:0,v:90}),new c({h:60,s:33,v:100}),new c({h:60,s:66,v:100}),new c({h:60,s:100,v:100}),new c({h:60,s:100,v:75}),new c({h:60,s:100,v:50}),new c({h:180,s:0,v:80}),new c({h:90,s:33,v:100}),new c({h:90,s:66,v:100}),new c({h:90,s:100,v:100}),new c({h:90,s:100,v:75}),new c({h:90,s:100,v:50}),
|
||||
new c({h:180,s:0,v:70}),new c({h:120,s:33,v:100}),new c({h:120,s:66,v:100}),new c({h:120,s:100,v:100}),new c({h:120,s:100,v:75}),new c({h:120,s:100,v:50}),new c({h:180,s:0,v:60}),new c({h:150,s:33,v:100}),new c({h:150,s:66,v:100}),new c({h:150,s:100,v:100}),new c({h:150,s:100,v:75}),new c({h:150,s:100,v:50}),new c({h:180,s:0,v:50}),new c({h:180,s:33,v:100}),new c({h:180,s:66,v:100}),new c({h:180,s:100,v:100}),new c({h:180,s:100,v:75}),new c({h:180,s:100,v:50}),new c({h:180,s:0,v:40}),new c({h:210,
|
||||
|
@ -676,9 +676,9 @@ times:"m1.00089,73.36786l72.36697,-72.36697l76.87431,76.87368l76.87431,-76.87368
|
|||
$("#tools_shapelib > *").wrapAll(M);var I=$("#tools_shapelib_show");p("basic");$("#shape_buttons").mouseup(function(Y){Y=$(Y.target).closest("div.tool_button");if(Y.length){var P=Y.children().clone().attr({width:24,height:24});I.children(":not(.flyout_arrow_horiz)").remove();I.append(P).attr("data-curopt","#"+Y[0].id).mouseup();s.setMode(U);m=Y[0].id.substr((U+"_").length);c=J.data[m];$(".tools_flyout").fadeOut()}});M=$('<div id="shape_cats">');var S="";$.each(B,function(Y,P){S+="<div data-cat="+
|
||||
Y+">"+P+"</div>"});M.html(S).children().bind("mouseup",function(){var Y=$(this);Y.siblings().removeClass("current");Y.addClass("current");p(Y.attr("data-cat"));return false});M.children().eq(0).addClass("current");$("#tools_shapelib").prepend(M);I.mouseup(function(){s.setMode(c?U:"select")});$("#tool_shapelib").remove();M=$("#tools_shapelib").height();$("#tools_shapelib").css({"margin-top":-(M/2),"margin-left":3})},mouseDown:function(M){if(s.getMode()===U){var I=f=M.start_x;M=d=M.start_y;var S=s.getStyle();
|
||||
b=s.addSvgElementFromJson({element:"path",curStyles:true,attr:{d:c,id:s.getNextId(),opacity:S.opacity/2,style:"pointer-events:none"}});b.setAttribute("d",c);if(/[a-z]/.test(c)){c=J.data[m]=s.pathActions.convertPath(b);b.setAttribute("d",c);s.pathActions.fixEnd(b)}b.setAttribute("transform","translate("+I+","+M+") scale(0.005) translate("+-I+","+-M+")");s.recalculateDimensions(b);s.getTransformList(b);q=b.getBBox();totalScale={sx:1,sy:1};return{started:true}}},mouseMove:function(M){if(s.getMode()===
|
||||
U){var I=s.getZoom(),S=M.event,Y=M.mouse_x/I,P=M.mouse_y/I;M=s.getTransformList(b);var ia=b.getBBox();I=ia.x;var qa=ia.y,ga=ia.width,ba=ia.height,W=Y-f,ta=P-d,ka={x:Math.min(f,Y),y:Math.min(d,P),width:Math.abs(Y-f),height:Math.abs(P-d)},da=ia=0;ba=ba?(ba+ta)/ba:1;ga=ga?(ga+W)/ga:1;ga=ka.width/q.width;ba=ka.height/q.height;ga=ga||1;ba=ba||1;if(Y<f)ia=q.width;if(P<d)da=q.height;Y=k.createSVGTransform();P=k.createSVGTransform();ka=k.createSVGTransform();Y.setTranslate(-(I+ia),-(qa+da));if(S.shiftKey){replaced=
|
||||
true;S=Math.min(Math.abs(ga),Math.abs(ba));ga=S*(ga<0?-1:1);ba=S*(ba<0?-1:1);if(totalScale.sx!=totalScale.sy){S=totalScale.sx>totalScale.sy?1:totalScale.sx/totalScale.sy;W=totalScale.sy>totalScale.sx?1:totalScale.sy/totalScale.sx;ga*=W;ba*=S;console.log(S,W)}}totalScale.sx*=ga;totalScale.sy*=ba;P.setScale(ga,ba);ka.setTranslate(I+ia,qa+da);M.appendItem(ka);M.appendItem(P);M.appendItem(Y);s.recalculateDimensions(b);q=b.getBBox()}},mouseUp:function(M){if(s.getMode()===U){if(M.mouse_x==f&&M.mouse_y==
|
||||
d)return{keep:false,element:b,started:false};s.setMode("select");return{keep:true,element:b,started:false}}}}});(function(){for(var a=0,p=["ms","moz","webkit","o"],g=0;g<p.length&&!window.requestAnimationFrame;++g){window.requestAnimationFrame=window[p[g]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[p[g]+"CancelAnimationFrame"]||window[p[g]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame)window.requestAnimationFrame=function(c){var m=(new Date).getTime(),s=Math.max(0,16-(m-a)),b=window.setTimeout(function(){c(m+s)},s);a=m+s;return b};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
|
||||
U){var I=s.getZoom(),S=M.event,Y=M.mouse_x/I,P=M.mouse_y/I;M=s.getTransformList(b);var ia=b.getBBox();I=ia.x;var qa=ia.y,ga=ia.width,ba=ia.height,X=Y-f,ta=P-d,ka={x:Math.min(f,Y),y:Math.min(d,P),width:Math.abs(Y-f),height:Math.abs(P-d)},da=ia=0;ba=ba?(ba+ta)/ba:1;ga=ga?(ga+X)/ga:1;ga=ka.width/q.width;ba=ka.height/q.height;ga=ga||1;ba=ba||1;if(Y<f)ia=q.width;if(P<d)da=q.height;Y=k.createSVGTransform();P=k.createSVGTransform();ka=k.createSVGTransform();Y.setTranslate(-(I+ia),-(qa+da));if(S.shiftKey){replaced=
|
||||
true;S=Math.min(Math.abs(ga),Math.abs(ba));ga=S*(ga<0?-1:1);ba=S*(ba<0?-1:1);if(totalScale.sx!=totalScale.sy){S=totalScale.sx>totalScale.sy?1:totalScale.sx/totalScale.sy;ga*=totalScale.sy>totalScale.sx?1:totalScale.sy/totalScale.sx;ba*=S}}totalScale.sx*=ga;totalScale.sy*=ba;P.setScale(ga,ba);ka.setTranslate(I+ia,qa+da);M.appendItem(ka);M.appendItem(P);M.appendItem(Y);s.recalculateDimensions(b);q=b.getBBox()}},mouseUp:function(M){if(s.getMode()===U){if(M.mouse_x==f&&M.mouse_y==d)return{keep:false,
|
||||
element:b,started:false};s.setMode("select");return{keep:true,element:b,started:false}}}}});(function(){for(var a=0,p=["ms","moz","webkit","o"],g=0;g<p.length&&!window.requestAnimationFrame;++g){window.requestAnimationFrame=window[p[g]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[p[g]+"CancelAnimationFrame"]||window[p[g]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame)window.requestAnimationFrame=function(c){var m=(new Date).getTime(),s=Math.max(0,16-(m-a)),b=window.setTimeout(function(){c(m+s)},s);a=m+s;return b};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
|
||||
function(c){clearTimeout(c)}})();(function(a){function p(o){var J=o.originalEvent;if(!J.touches||J.targetTouches.length===1&&J.touches.length===1){b.call(this,o);o=a(this);o.bind(q,g);o.bind(k,c)}else{clearTimeout(B);s.call(this)}}function g(o){if(B!=null){var J=o.originalEvent;o=J.changedTouches?J.changedTouches[0].pageX:J.pageX;J=J.changedTouches?J.changedTouches[0].pageY:J.pageY;var U=a(this).data("taphold.point");o=o-U.x;J=J-U.y;if(Math.sqrt(o*o+J*J)>d){clearTimeout(B);s.call(this)}}}function c(){clearTimeout(B);s.call(this)}
|
||||
function m(o){s.call(this);a(this).data("taphold.handler").call(this,o)}function s(){B=null;a(this).unbind(q,g);a(this).unbind(k,c)}function b(o){if(B==null){var J=this;B=setTimeout(function(){m.call(J,o)},f);var U=o.originalEvent,M={};M.x=U.changedTouches?U.changedTouches[0].pageX:U.pageX;M.y=U.changedTouches?U.changedTouches[0].pageY:U.pageY;a(this).data("taphold.point",M)}}var f=1E3,d=5,k="touchend",q="touchmove",B=null;a.event.special.taphold={setup:function(){},add:function(o){a(this).data("taphold.handler",
|
||||
o.handler);o.data?a(this).bind("touchstart",o.data,p):a(this).bind("touchstart",p)},remove:function(o){clearTimeout(B);s.call(this);o.data?a(this).unbind("touchstart",o.data,p):a(this).unbind("touchstart",p)},teardown:function(){}}})(jQuery);
|
||||
|
|
Loading…
Reference in New Issue