From b2b5ebcae377be0e68037d1b4f635c62cc538d09 Mon Sep 17 00:00:00 2001 From: Mark MacKay Date: Sat, 14 Jul 2012 21:38:51 -0500 Subject: [PATCH] latest changes --- editor/svg-editor.js | 5 +- editor/svgedit.compiled.js | 764 +++++++++++---------- method-draw/extensions/ext-shapes.xml | 4 +- method-draw/extensions/eyedropper-icon.xml | 6 +- method-draw/extensions/eyedropper.png | Bin 718 -> 364 bytes method-draw/extensions/eyedropper.svg | 15 + method-draw/extensions/shapelib.png | Bin 0 -> 373 bytes method-draw/extensions/shapelib.svg | 10 + method-draw/images/align-bottom.png | Bin 291 -> 245 bytes method-draw/images/align-bottom.svg | 278 +------- method-draw/images/align-center.png | Bin 449 -> 245 bytes method-draw/images/align-center.svg | 253 +------ method-draw/images/align-left.png | Bin 305 -> 246 bytes method-draw/images/align-left.svg | 236 +------ method-draw/images/align-middle.png | Bin 459 -> 255 bytes method-draw/images/align-middle.svg | 251 +------ method-draw/images/align-right.png | Bin 339 -> 255 bytes method-draw/images/align-right.svg | 234 +------ method-draw/images/align-top.png | Bin 287 -> 243 bytes method-draw/images/align-top.svg | 234 +------ method-draw/images/ellipse.png | Bin 811 -> 370 bytes method-draw/images/ellipse.svg | 8 + method-draw/images/eye.png | Bin 750 -> 468 bytes method-draw/images/eye.svg | 1 + method-draw/images/image.png | Bin 900 -> 376 bytes method-draw/images/image.svg | 12 + method-draw/images/italic.png | Bin 2972 -> 438 bytes method-draw/images/italic.svg | 1 + method-draw/images/line.png | Bin 1026 -> 302 bytes method-draw/images/logo.png | Bin 3983 -> 247 bytes method-draw/images/path.png | Bin 854 -> 345 bytes method-draw/images/path.svg | 10 + method-draw/images/pencil.png | Bin 318 -> 409 bytes method-draw/images/pencil.svg | 11 + method-draw/images/polygon.png | Bin 881 -> 422 bytes method-draw/images/polygon.svg | 220 +----- method-draw/images/select.png | Bin 712 -> 344 bytes method-draw/images/select.svg | 10 + method-draw/images/square.png | Bin 422 -> 145 bytes method-draw/images/svg_edit_icons.svg | 67 +- method-draw/images/text.png | Bin 1032 -> 323 bytes method-draw/images/text.svg | 167 +---- method-draw/images/zoom.png | Bin 1197 -> 483 bytes method-draw/images/zoom.svg | 12 + method-draw/select.js | 6 +- method-draw/svg-editor.html | 4 +- method-draw/svg-editor.js | 57 +- method-draw/svgedit.compiled.js | 764 +++++++++++---------- 48 files changed, 958 insertions(+), 2682 deletions(-) create mode 100644 method-draw/extensions/eyedropper.svg create mode 100644 method-draw/extensions/shapelib.png create mode 100644 method-draw/extensions/shapelib.svg create mode 100644 method-draw/images/ellipse.svg create mode 100644 method-draw/images/eye.svg create mode 100644 method-draw/images/image.svg create mode 100644 method-draw/images/italic.svg create mode 100644 method-draw/images/path.svg create mode 100644 method-draw/images/pencil.svg create mode 100644 method-draw/images/select.svg create mode 100644 method-draw/images/zoom.svg diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 7ce67d7..f4bee92 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -65,7 +65,8 @@ snappingStep: 10, showRulers: true, show_outside_canvas: false, - no_save_warning: true + no_save_warning: true, + initFont: 'Sans-serif' }, uiStrings = Editor.uiStrings = { common: { @@ -4180,7 +4181,7 @@ // Standard shortcuts {key: modKey + 'shift+z', fn: clickRedo}, - {key: 'esc', fn: minimizeModal}, + {key: 'esc', fn: minimizeModal} ]; // Tooltips not directly associated with a single function diff --git a/editor/svgedit.compiled.js b/editor/svgedit.compiled.js index d862c5d..fc985e7 100644 --- a/editor/svgedit.compiled.js +++ b/editor/svgedit.compiled.js @@ -1,30 +1,30 @@ (function(a){function n(f){if(typeof f.data==="string"){var c=f.handler,m=f.data.toLowerCase().split(" ");f.handler=function(o){if(!(this!==o.target&&(/textarea|select/i.test(o.target.nodeName)||o.target.type==="text"))){var b=o.type!=="keypress"&&a.hotkeys.specialKeys[o.which],d=String.fromCharCode(o.which).toLowerCase(),e="",l={};if(o.altKey&&b!=="alt")e+="alt+";if(o.ctrlKey&&b!=="ctrl")e+="ctrl+";if(o.metaKey&&!o.ctrlKey&&b!=="meta")e+="meta+";if(o.shiftKey&&b!=="shift")e+="shift+";if(b)l[e+b]= true;else{l[e+d]=true;l[e+a.hotkeys.shiftNums[d]]=true;if(e==="shift+")l[a.hotkeys.shiftNums[d]]=true}b=0;for(d=m.length;b","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:n}})})(jQuery);(function(a,n){function f(ba){return typeof ba==="string"}function c(ba){var S=e.call(arguments,1);return function(){return ba.apply(this,S.concat(e.call(arguments)))}}function m(ba,S,U,sa,la){var oa;if(sa!==d){S=U.match(ba?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);U=S[3]||"";if(la===2&&f(sa))sa=sa.replace(ba?ea:ca,"");else{oa=p(S[2]);sa=f(sa)?p[ba?fa:O](sa):sa;sa=la===2?sa:la===1?a.extend({},sa,oa):a.extend({},oa,sa);sa=u(sa);if(ba)sa=sa.replace(ra,l)}ba=S[1]+(ba?"#":sa||!S[1]?"?":"")+sa+U}else ba= -S(U!==d?U:n[ua][ha]);return ba}function o(ba,S,U){if(S===d||typeof S==="boolean"){U=S;S=u[ba?fa:O]()}else S=f(S)?S.replace(ba?ea:ca,""):S;return p(S,U)}function b(ba,S,U,sa){if(!f(U)&&typeof U!=="object"){sa=U;U=S;S=d}return this.each(function(){var la=a(this),oa=S||da()[(this.nodeName||"").toLowerCase()]||"",Z=oa&&la.attr(oa)||"";la.attr(oa,u[ba](Z,U,sa))})}var d,e=Array.prototype.slice,l=decodeURIComponent,u=a.param,w,p,L,T=a.bbq=a.bbq||{},M,J,da,V=a.event.special,O="querystring",fa="fragment", -ua="location",ha="href",ca=/^.*\?|#.*$/g,ea=/^.*\#/,ra,qa={};u[O]=c(m,0,function(ba){return ba.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});u[fa]=w=c(m,1,function(ba){return ba.replace(/^[^#]*#?(.*)$/,"$1")});w.noEscape=function(ba){ba=ba||"";ba=a.map(ba.split(""),encodeURIComponent);ra=RegExp(ba.join("|"),"g")};w.noEscape(",/");a.deparam=p=function(ba,S){var U={},sa={"true":true,"false":false,"null":null};a.each(ba.replace(/\+/g," ").split("&"),function(la,oa){var Z=oa.split("="),Aa=l(Z[0]),Ka=U, -Ra=0,Na=Aa.split("]["),Sa=Na.length-1;if(/\[/.test(Na[0])&&/\]$/.test(Na[Sa])){Na[Sa]=Na[Sa].replace(/\]$/,"");Na=Na.shift().split("[").concat(Na);Sa=Na.length-1}else Sa=0;if(Z.length===2){Z=l(Z[1]);if(S)Z=Z&&!isNaN(Z)?+Z:Z==="undefined"?d:sa[Z]!==d?sa[Z]:Z;if(Sa)for(;Ra<=Sa;Ra++){Aa=Na[Ra]===""?Ka.length:Na[Ra];Ka=Ka[Aa]=Ra","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:n}})})(jQuery);(function(a,n){function f(ba){return typeof ba==="string"}function c(ba){var S=e.call(arguments,1);return function(){return ba.apply(this,S.concat(e.call(arguments)))}}function m(ba,S,U,sa,la){var oa;if(sa!==d){S=U.match(ba?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);U=S[3]||"";if(la===2&&f(sa))sa=sa.replace(ba?ea:ca,"");else{oa=p(S[2]);sa=f(sa)?p[ba?ga:O](sa):sa;sa=la===2?sa:la===1?a.extend({},sa,oa):a.extend({},oa,sa);sa=u(sa);if(ba)sa=sa.replace(ra,l)}ba=S[1]+(ba?"#":sa||!S[1]?"?":"")+sa+U}else ba= +S(U!==d?U:n[ta][ha]);return ba}function o(ba,S,U){if(S===d||typeof S==="boolean"){U=S;S=u[ba?ga:O]()}else S=f(S)?S.replace(ba?ea:ca,""):S;return p(S,U)}function b(ba,S,U,sa){if(!f(U)&&typeof U!=="object"){sa=U;U=S;S=d}return this.each(function(){var la=a(this),oa=S||da()[(this.nodeName||"").toLowerCase()]||"",Z=oa&&la.attr(oa)||"";la.attr(oa,u[ba](Z,U,sa))})}var d,e=Array.prototype.slice,l=decodeURIComponent,u=a.param,w,p,L,T=a.bbq=a.bbq||{},M,J,da,V=a.event.special,O="querystring",ga="fragment", +ta="location",ha="href",ca=/^.*\?|#.*$/g,ea=/^.*\#/,ra,pa={};u[O]=c(m,0,function(ba){return ba.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});u[ga]=w=c(m,1,function(ba){return ba.replace(/^[^#]*#?(.*)$/,"$1")});w.noEscape=function(ba){ba=ba||"";ba=a.map(ba.split(""),encodeURIComponent);ra=RegExp(ba.join("|"),"g")};w.noEscape(",/");a.deparam=p=function(ba,S){var U={},sa={"true":true,"false":false,"null":null};a.each(ba.replace(/\+/g," ").split("&"),function(la,oa){var Z=oa.split("="),Aa=l(Z[0]),Ka=U, +Ra=0,Na=Aa.split("]["),Sa=Na.length-1;if(/\[/.test(Na[0])&&/\]$/.test(Na[Sa])){Na[Sa]=Na[Sa].replace(/\]$/,"");Na=Na.shift().split("[").concat(Na);Sa=Na.length-1}else Sa=0;if(Z.length===2){Z=l(Z[1]);if(S)Z=Z&&!isNaN(Z)?+Z:Z==="undefined"?d:sa[Z]!==d?sa[Z]:Z;if(Sa)for(;Ra<=Sa;Ra++){Aa=Na[Ra]===""?Ka.length:Na[Ra];Ka=Ka[Aa]=Ra').hide().insertAfter("body")[0].contentWindow; -J=function(){return c(T.document[b][d])};M=function(da,V){if(da!==V){var O=T.document;O.open().close();O[b].hash="#"+da}};M(c())}}var p={},L,T,M,J;p.start=function(){if(!L){var da=c();M||w();(function V(){var O=c(),fa=J(da);if(O!==da){M(da=O,fa);a(n).trigger("hashchange")}else if(fa!==da)n[b][d]=n[b][d].replace(/#.*/,"")+"#"+fa;L=setTimeout(V,a.hashchangeDelay)})()}};p.stop=function(){if(!T){L&&clearTimeout(L);L=0}};return p}()})(jQuery,this);(function(a){var n={},f;a.svgIcons=function(c,m){function o(ba,S){if(ba!=="ajax"){if(da)return;var U=(T=ha[0].contentDocument)&&T.getElementById("svg_eof");if(!U&&!(S&&U)){V++;if(V<50)setTimeout(o,20);else{d();da=true}return}da=true}L=a(T.firstChild).children();if(m.no_img)setTimeout(function(){J||b()},500);else{U=ua+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";M=a(new Image).attr({src:U,width:0,height:0}).appendTo("body").load(function(){b(true)}).error(function(){b()})}} -function b(ba,S){if(!J){if(m.no_img)ba=false;if(ba){var U=a(document.createElement("div"));U.hide().appendTo("body")}if(S){var sa=m.fallback_path?m.fallback_path:"";a.each(S,function(Sa,Wa){a("#"+Sa);var Oa=a(new Image).attr({"class":"svg_icon",src:sa+Wa,width:w,height:p,alt:"icon"});qa(Oa,Sa)})}else for(var la=L.length,oa=0;oa0&&!ba)Ia=f(Ia,Oa,true);ra(a(this),Ia,Wa)})});if(!S){ba&&U.remove();ha&&ha.remove();M&&M.remove()}m.resize&&a.resizeSvgIcons(m.resize);J=true;m.callback&&m.callback(n)}}function d(){if(c.indexOf(".svgz")!=-1){var ba=c.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg");a.svgIcons(ba,m)}else m.fallback&&b(false,m.fallback)}function e(ba){if(window.btoa)return window.btoa(ba); +J=function(){return c(T.document[b][d])};M=function(da,V){if(da!==V){var O=T.document;O.open().close();O[b].hash="#"+da}};M(c())}}var p={},L,T,M,J;p.start=function(){if(!L){var da=c();M||w();(function V(){var O=c(),ga=J(da);if(O!==da){M(da=O,ga);a(n).trigger("hashchange")}else if(ga!==da)n[b][d]=n[b][d].replace(/#.*/,"")+"#"+ga;L=setTimeout(V,a.hashchangeDelay)})()}};p.stop=function(){if(!T){L&&clearTimeout(L);L=0}};return p}()})(jQuery,this);(function(a){var n={},f;a.svgIcons=function(c,m){function o(ba,S){if(ba!=="ajax"){if(da)return;var U=(T=ha[0].contentDocument)&&T.getElementById("svg_eof");if(!U&&!(S&&U)){V++;if(V<50)setTimeout(o,20);else{d();da=true}return}da=true}L=a(T.firstChild).children();if(m.no_img)setTimeout(function(){J||b()},500);else{U=ta+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";M=a(new Image).attr({src:U,width:0,height:0}).appendTo("body").load(function(){b(true)}).error(function(){b()})}} +function b(ba,S){if(!J){if(m.no_img)ba=false;if(ba){var U=a(document.createElement("div"));U.hide().appendTo("body")}if(S){var sa=m.fallback_path?m.fallback_path:"";a.each(S,function(Sa,Wa){a("#"+Sa);var Oa=a(new Image).attr({"class":"svg_icon",src:sa+Wa,width:w,height:p,alt:"icon"});pa(Oa,Sa)})}else for(var la=L.length,oa=0;oa0&&!ba)Ia=f(Ia,Oa,true);ra(a(this),Ia,Wa)})});if(!S){ba&&U.remove();ha&&ha.remove();M&&M.remove()}m.resize&&a.resizeSvgIcons(m.resize);J=true;m.callback&&m.callback(n)}}function d(){if(c.indexOf(".svgz")!=-1){var ba=c.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg");a.svgIcons(ba,m)}else m.fallback&&b(false,m.fallback)}function e(ba){if(window.btoa)return window.btoa(ba); var S=Array(Math.floor((ba.length+2)/3)*4),U,sa,la,oa,Z,Aa,Ka=0,Ra=0;do{U=ba.charCodeAt(Ka++);sa=ba.charCodeAt(Ka++);la=ba.charCodeAt(Ka++);oa=U>>2;U=(U&3)<<4|sa>>4;Z=(sa&15)<<2|la>>6;Aa=la&63;if(isNaN(sa))Z=Aa=64;else if(isNaN(la))Aa=64;S[Ra++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(oa);S[Ra++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(U);S[Ra++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Z);S[Ra++]= -"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Aa)}while(Ka-1&&O.indexOf("Chrome/");var ua="data:image/svg+xml;charset=utf-8;base64,";if(m.svgz){var ha=a('').appendTo("body").hide();try{T=ha[0].contentDocument;ha.load(o); -o(0,true)}catch(ca){d()}}else{var ea=new DOMParser;a.ajax({url:c,dataType:"string",success:function(ba){if(ba){T=ea.parseFromString(ba,"text/xml");a(function(){o("ajax")})}else a(d)},error:function(ba){if(window.opera)a(function(){d()});else if(ba.responseText){T=ea.parseFromString(ba.responseText,"text/xml");T.childNodes.length||a(d);a(function(){o("ajax")})}else a(d)}})}var ra=function(ba,S,U,sa){fa&&S.css("visibility","hidden");if(m.replace){sa&&S.attr("id",U);(U=ba.attr("class"))&&S.attr("class", -"svg_icon "+U);ba.replaceWith(S)}else ba.append(S);fa&&setTimeout(function(){S.removeAttr("style")},1)},qa=function(ba,S){if(m.id_match===undefined||m.id_match!==false)ra(holder,ba,S,true);n[S]=ba};f=function(ba,S){var U=ba.find("defs");if(!U.length)return ba;U=fa?U.find("*").filter(function(){return!!this.id}):U.find("[id]");var sa=ba[0].getElementsByTagName("*"),la=sa.length;U.each(function(oa){var Z=this.id;a(T).find("#"+Z);this.id=oa="x"+Z+S+oa;Z="url(#"+Z+")";var Aa="url(#"+oa+")";for(oa=0;oa< +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Aa)}while(Ka-1&&O.indexOf("Chrome/");var ta="data:image/svg+xml;charset=utf-8;base64,";if(m.svgz){var ha=a('').appendTo("body").hide();try{T=ha[0].contentDocument;ha.load(o); +o(0,true)}catch(ca){d()}}else{var ea=new DOMParser;a.ajax({url:c,dataType:"string",success:function(ba){if(ba){T=ea.parseFromString(ba,"text/xml");a(function(){o("ajax")})}else a(d)},error:function(ba){if(window.opera)a(function(){d()});else if(ba.responseText){T=ea.parseFromString(ba.responseText,"text/xml");T.childNodes.length||a(d);a(function(){o("ajax")})}else a(d)}})}var ra=function(ba,S,U,sa){ga&&S.css("visibility","hidden");if(m.replace){sa&&S.attr("id",U);(U=ba.attr("class"))&&S.attr("class", +"svg_icon "+U);ba.replaceWith(S)}else ba.append(S);ga&&setTimeout(function(){S.removeAttr("style")},1)},pa=function(ba,S){if(m.id_match===undefined||m.id_match!==false)ra(holder,ba,S,true);n[S]=ba};f=function(ba,S){var U=ba.find("defs");if(!U.length)return ba;U=ga?U.find("*").filter(function(){return!!this.id}):U.find("[id]");var sa=ba[0].getElementsByTagName("*"),la=sa.length;U.each(function(oa){var Z=this.id;a(T).find("#"+Z);this.id=oa="x"+Z+S+oa;Z="url(#"+Z+")";var Aa="url(#"+oa+")";for(oa=0;oa< la;oa++){var Ka=sa[oa];Ka.getAttribute("fill")===Z&&Ka.setAttribute("fill",Aa);Ka.getAttribute("stroke")===Z&&Ka.setAttribute("stroke",Aa);Ka.getAttribute("filter")===Z&&Ka.setAttribute("filter",Aa)}});return ba}};a.getSvgIcon=function(c,m){var o=n[c];if(m&&o)o=f(o,0,true).clone(true);return o};a.resizeSvgIcons=function(c){var m=!a(".svg_icon:first").length;a.each(c,function(o,b){var d=a.isArray(b),e=d?b[0]:b,l=d?b[1]:b;if(m)o=o.replace(/\.svg_icon/g,"svg");a(o).each(function(){this.setAttribute("width", e);this.setAttribute("height",l);if(window.opera&&window.widget){this.parentNode.style.width=e+"px";this.parentNode.style.height=l+"px"}})})}})(jQuery);(function(){function a(c,m,o){c=document.createElementNS(n.svg,c);if(f)for(var b in m)c.setAttribute(b,m[b]);else for(b in m){var d=m[b],e=c[b];if(e&&e.constructor==="SVGLength")e.baseVal.value=d;else c.setAttribute(b,d)}o&&o.appendChild(c);return c}var n={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 f=navigator.userAgent.indexOf("Gecko/")>=0;jQuery.fn.jGraduate=function(c){var m= -arguments;return this.each(function(){function o(ma,Y,na,K,N){var aa=N||a("stop",{"stop-color":Y,"stop-opacity":na,offset:ma},ea);if(N){Y=N.getAttribute("stop-color");na=N.getAttribute("stop-opacity");ma=N.getAttribute("offset")}else ea.appendChild(aa);if(na===null)na=1;N=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+ma*fa)+", 26)"},Cb);var Pa= -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:Y,"fill-opacity":na,transform:"translate("+(10+ma*fa)+", 26)",stroke:"#000","stroke-width":1.5},Cb);$(Pa).mousedown(function(Xa){b(this);Ya=lb;da.mousemove(l).mouseup(d);Ea=Mb.offset();Xa.preventDefault();return false}).data("stop",aa).data("bg",N).dblclick(function(){$("div.jGraduate_LightBox").show();for(var Xa=this,fb=+aa.getAttribute("stop-opacity")|| -1,nb=aa.getAttribute("stop-color")||1,Db=(parseFloat(fb)*255).toString(16);Db.length<2;)Db="0"+Db;Y=nb.substr(1)+Db;$("#"+p+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:w.images.clientPath},color:{active:Y,alphaSupport:true}},function(cb){nb=cb.val("hex")?"#"+cb.val("hex"):"none";fb=cb.val("a")!==null?cb.val("a")/256:1;Xa.setAttribute("fill",nb);Xa.setAttribute("fill-opacity",fb);aa.setAttribute("stop-color", -nb);aa.setAttribute("stop-opacity",fb);$("div.jGraduate_LightBox").hide();$("#"+p+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();$("#"+p+"_jGraduate_stopPicker").hide()})});$(ea).find("stop").each(function(){var Xa=$(this);if(+this.getAttribute("offset")>ma){if(!Y){var fb=this.getAttribute("stop-color"),nb=this.getAttribute("stop-opacity");aa.setAttribute("stop-color",fb);Pa.setAttribute("fill",fb);aa.setAttribute("stop-opacity",nb===null?1:nb);Pa.setAttribute("fill-opacity", -nb===null?1:nb)}Xa.before(aa);return false}});K&&b(Pa);return aa}function b(ma){lb&&lb.setAttribute("stroke","#000");ma.setAttribute("stroke","blue");lb=ma;lb.parentNode.appendChild(lb)}function d(){da.unbind("mousemove",l);if(La.getAttribute("display")!=="none"){La.setAttribute("display","none");var ma=$(lb),Y=ma.data("stop");ma=ma.data("bg");$([lb,Y,ma]).remove()}Ya=null}function e(){var ma=Za?"rotate("+Za+","+Ma+","+mb+") ":"";ob===1&&Ja===1?ea.removeAttribute("gradientTransform"):ea.setAttribute("gradientTransform", -ma+"translate("+-Ma*(ob-1)+","+-mb*(Ja-1)+") scale("+ob+","+Ja+")")}function l(ma){var Y=ma.pageX-Ea.left;ma=ma.pageY-Ea.top;Y=Y<10?10:Y>fa+10?fa+10:Y;var na="translate("+Y+", 26)";if(ma<-60||ma>130){La.setAttribute("display","block");La.setAttribute("transform",na)}else La.setAttribute("display","none");Ya.setAttribute("transform",na);$.data(Ya,"bg").setAttribute("transform",na);$.data(Ya,"stop").setAttribute("offset",(Y-10)/fa);var K=0;$(ea).find("stop").each(function(){var N=this.getAttribute("offset"), +arguments;return this.each(function(){function o(ma,Y,na,K,N){var aa=N||a("stop",{"stop-color":Y,"stop-opacity":na,offset:ma},ea);if(N){Y=N.getAttribute("stop-color");na=N.getAttribute("stop-opacity");ma=N.getAttribute("offset")}else ea.appendChild(aa);if(na===null)na=1;N=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+ma*ga)+", 26)"},Cb);var Pa= +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:Y,"fill-opacity":na,transform:"translate("+(10+ma*ga)+", 26)",stroke:"#000","stroke-width":1.5},Cb);$(Pa).mousedown(function(Xa){b(this);Ya=nb;da.mousemove(l).mouseup(d);Ea=Kb.offset();Xa.preventDefault();return false}).data("stop",aa).data("bg",N).dblclick(function(){$("div.jGraduate_LightBox").show();for(var Xa=this,hb=+aa.getAttribute("stop-opacity")|| +1,pb=aa.getAttribute("stop-color")||1,Db=(parseFloat(hb)*255).toString(16);Db.length<2;)Db="0"+Db;Y=pb.substr(1)+Db;$("#"+p+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:w.images.clientPath},color:{active:Y,alphaSupport:true}},function(cb){pb=cb.val("hex")?"#"+cb.val("hex"):"none";hb=cb.val("a")!==null?cb.val("a")/256:1;Xa.setAttribute("fill",pb);Xa.setAttribute("fill-opacity",hb);aa.setAttribute("stop-color", +pb);aa.setAttribute("stop-opacity",hb);$("div.jGraduate_LightBox").hide();$("#"+p+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();$("#"+p+"_jGraduate_stopPicker").hide()})});$(ea).find("stop").each(function(){var Xa=$(this);if(+this.getAttribute("offset")>ma){if(!Y){var hb=this.getAttribute("stop-color"),pb=this.getAttribute("stop-opacity");aa.setAttribute("stop-color",hb);Pa.setAttribute("fill",hb);aa.setAttribute("stop-opacity",pb===null?1:pb);Pa.setAttribute("fill-opacity", +pb===null?1:pb)}Xa.before(aa);return false}});K&&b(Pa);return aa}function b(ma){nb&&nb.setAttribute("stroke","#000");ma.setAttribute("stroke","blue");nb=ma;nb.parentNode.appendChild(nb)}function d(){da.unbind("mousemove",l);if(La.getAttribute("display")!=="none"){La.setAttribute("display","none");var ma=$(nb),Y=ma.data("stop");ma=ma.data("bg");$([nb,Y,ma]).remove()}Ya=null}function e(){var ma=Za?"rotate("+Za+","+Ma+","+ob+") ":"";qb===1&&Ja===1?ea.removeAttribute("gradientTransform"):ea.setAttribute("gradientTransform", +ma+"translate("+-Ma*(qb-1)+","+-ob*(Ja-1)+") scale("+qb+","+Ja+")")}function l(ma){var Y=ma.pageX-Ea.left;ma=ma.pageY-Ea.top;Y=Y<10?10:Y>ga+10?ga+10:Y;var na="translate("+Y+", 26)";if(ma<-60||ma>130){La.setAttribute("display","block");La.setAttribute("transform",na)}else La.setAttribute("display","none");Ya.setAttribute("transform",na);$.data(Ya,"bg").setAttribute("transform",na);$.data(Ya,"stop").setAttribute("offset",(Y-10)/ga);var K=0;$(ea).find("stop").each(function(){var N=this.getAttribute("offset"), aa=$(this);if(N
  • Solid Color
  • Linear Gradient
  • Radial Gradient
  • ');var V=$(L+"> .jGraduate_colPick"),O=$(L+"> .jGraduate_gradPick");O.html('

    '+w.window.pickerTitle+'


    ');var fa=256,ua=fa-0,ha=fa-0,ca,ea,ra,qa={};$(".jGraduate_SliderBar").width(145);var ba=$("#"+p+"_jGraduate_GradContainer")[0],S=a("svg",{id:p+"_jgraduate_svg",width:fa,height:fa,xmlns:n.svg},ba);ca=ca||u.paint.type;var U=ea=u.paint[ca],sa=u.paint.alpha,la=ca==="solidColor";switch(ca){case "solidColor":case "linearGradient":if(!la){ea.id=p+"_lg_jgraduate_grad"; +p+'_jGraduate_Ok" class="jGraduate_Ok" value="OK"/>');var ga=256,ta=ga-0,ha=ga-0,ca,ea,ra,pa={};$(".jGraduate_SliderBar").width(145);var ba=$("#"+p+"_jGraduate_GradContainer")[0],S=a("svg",{id:p+"_jgraduate_svg",width:ga,height:ga,xmlns:n.svg},ba);ca=ca||u.paint.type;var U=ea=u.paint[ca],sa=u.paint.alpha,la=ca==="solidColor";switch(ca){case "solidColor":case "linearGradient":if(!la){ea.id=p+"_lg_jgraduate_grad"; U=ea=S.appendChild(ea)}a("radialGradient",{id:p+"_rg_jgraduate_grad"},S);if(ca==="linearGradient")break;case "radialGradient":if(!la){ea.id=p+"_rg_jgraduate_grad";U=ea=S.appendChild(ea)}a("linearGradient",{id:p+"_lg_jgraduate_grad"},S)}if(la){U=ea=$("#"+p+"_lg_jgraduate_grad")[0];J=u.paint[ca];o(0,"#"+J,1);var oa=typeof w.newstop;if(oa==="string")switch(w.newstop){case "same":o(1,"#"+J,1);break;case "inverse":oa="";for(var Z=0;Z<6;Z+=2){J.substr(Z,2);var Aa=(255-parseInt(J.substr(Z,2),16)).toString(16); if(Aa.length<2)Aa=0+Aa;oa+=Aa}o(1,"#"+oa,1);break;case "white":o(1,"#ffffff",1);break;case "black":o(1,"#000000",1)}else if(oa==="object")o(1,w.newstop.color||"#"+J,"opac"in w.newstop?w.newstop.opac:1)}J=parseFloat(U.getAttribute("x1")||0);oa=parseFloat(U.getAttribute("y1")||0);Z=parseFloat(U.getAttribute("x2")||1);Aa=parseFloat(U.getAttribute("y2")||0);var Ka=parseFloat(U.getAttribute("cx")||0.5),Ra=parseFloat(U.getAttribute("cy")||0.5),Na=parseFloat(U.getAttribute("fx")||Ka),Sa=parseFloat(U.getAttribute("fy")|| -Ra);ra=a("rect",{id:p+"_jgraduate_rect",x:0,y:0,width:ua,height:ha,fill:"url(#"+p+"_jgraduate_grad)","fill-opacity":sa/100},S);var Wa=$("
    ").attr({"class":"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:oa*fa,left:J*fa}).data("coord","start").appendTo(ba),Oa=Wa.clone().text(2).css({top:Aa*fa,left:Z*fa}).attr("title","End stop").data("coord","end").appendTo(ba),Ia=$("
    ").attr({"class":"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:Ra*fa,left:Ka* -fa}).data("coord","center").appendTo(ba),Qa=Ia.clone().text("F").css({top:Sa*fa,left:Na*fa,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(ba);Qa[0].id=p+"_jGraduate_focusCoord";$(L+" .grad_coord");$.each(["x1","y1","x2","y2","cx","cy","fx","fy"],function(ma,Y){var na=ea.getAttribute(Y),K=isNaN(Y[1]);na||(na=K?"0.5":Y==="x2"?"1.0":"0.0");qa[Y]=$("#"+p+"_jGraduate_"+Y).val(na).change(function(){if(isNaN(parseFloat(this.value))||this.value<0)this.value=0;else if(this.value> -1)this.value=1;if(!(Y[0]==="f"&&!qb))if(K&&ca==="radialGradient"||!K&&ca==="linearGradient")ea.setAttribute(Y,this.value);var N=K?Y[0]==="c"?Ia:Qa:Y[1]==="1"?Wa:Oa,aa=Y.indexOf("x")>=0?"left":"top";N.css(aa,this.value*fa)}).change()});var Ga,Cb,Mb=$("#"+p+"_jGraduate_StopSlider"),lb,ab,Ya,La=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},ab),Ea,ob=1,Ja=1,Za=0,Ma=Ka,mb=Ra;ab=a("svg",{width:"100%",height:45},Mb[0]);ba=a("pattern",{width:16, -height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},ab);a("image",{width:16,height:16},ba).setAttributeNS(n.xlink,"xlink:href",w.images.clientPath+"map-opacity.png");$(ab).click(function(ma){Ea=Mb.offset();if(ma.target.tagName!=="path"){var Y=ma.pageX-Ea.left-8;Y=Y<10?10:Y>fa+10?fa+10:Y;o(Y/fa,0,0,true);ma.stopPropagation()}});$(ab).mouseover(function(){ab.appendChild(La)});Cb=a("g",{},ab);a("line",{x1:10,y1:15,x2:fa+10,y2:15,"stroke-width":2,stroke:"#000"},ab);var zb=O.find(".jGraduate_spreadMethod").change(function(){ea.setAttribute("spreadMethod", -$(this).val())}),eb=null,gb=function(ma){var Y=ma.pageX-wb.left,na=ma.pageY-wb.top;Y=Y<0?0:Y>fa?fa:Y;na=na<0?0:na>fa?fa:na;eb.css("left",Y).css("top",na);Y/=ua;na/=ha;var K=eb.data("coord"),N=ea;switch(K){case "start":qa.x1.val(Y);qa.y1.val(na);N.setAttribute("x1",Y);N.setAttribute("y1",na);break;case "end":qa.x2.val(Y);qa.y2.val(na);N.setAttribute("x2",Y);N.setAttribute("y2",na);break;case "center":qa.cx.val(Y);qa.cy.val(na);N.setAttribute("cx",Y);N.setAttribute("cy",na);Ma=Y;mb=na;e();break;case "focus":qa.fx.val(Y); -qa.fy.val(na);N.setAttribute("fx",Y);N.setAttribute("fy",na);e()}ma.preventDefault()},Nb=function(){eb=null;da.unbind("mousemove",gb).unbind("mouseup",Nb)};Ga=ea.getElementsByTagNameNS(n.svg,"stop");if(xa<2){for(;xa<2;){ea.appendChild(document.createElementNS(n.svg,"stop"));++xa}Ga=ea.getElementsByTagNameNS(n.svg,"stop")}var xa=Ga.length;for(Z=0;Z").attr({"class":"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:oa*ga,left:J*ga}).data("coord","start").appendTo(ba),Oa=Wa.clone().text(2).css({top:Aa*ga,left:Z*ga}).attr("title","End stop").data("coord","end").appendTo(ba),Ia=$("
    ").attr({"class":"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:Ra*ga,left:Ka* +ga}).data("coord","center").appendTo(ba),Qa=Ia.clone().text("F").css({top:Sa*ga,left:Na*ga,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(ba);Qa[0].id=p+"_jGraduate_focusCoord";$(L+" .grad_coord");$.each(["x1","y1","x2","y2","cx","cy","fx","fy"],function(ma,Y){var na=ea.getAttribute(Y),K=isNaN(Y[1]);na||(na=K?"0.5":Y==="x2"?"1.0":"0.0");pa[Y]=$("#"+p+"_jGraduate_"+Y).val(na).change(function(){if(isNaN(parseFloat(this.value))||this.value<0)this.value=0;else if(this.value> +1)this.value=1;if(!(Y[0]==="f"&&!rb))if(K&&ca==="radialGradient"||!K&&ca==="linearGradient")ea.setAttribute(Y,this.value);var N=K?Y[0]==="c"?Ia:Qa:Y[1]==="1"?Wa:Oa,aa=Y.indexOf("x")>=0?"left":"top";N.css(aa,this.value*ga)}).change()});var Ga,Cb,Kb=$("#"+p+"_jGraduate_StopSlider"),nb,ab,Ya,La=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},ab),Ea,qb=1,Ja=1,Za=0,Ma=Ka,ob=Ra;ab=a("svg",{width:"100%",height:45},Kb[0]);ba=a("pattern",{width:16, +height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},ab);a("image",{width:16,height:16},ba).setAttributeNS(n.xlink,"xlink:href",w.images.clientPath+"map-opacity.png");$(ab).click(function(ma){Ea=Kb.offset();if(ma.target.tagName!=="path"){var Y=ma.pageX-Ea.left-8;Y=Y<10?10:Y>ga+10?ga+10:Y;o(Y/ga,0,0,true);ma.stopPropagation()}});$(ab).mouseover(function(){ab.appendChild(La)});Cb=a("g",{},ab);a("line",{x1:10,y1:15,x2:ga+10,y2:15,"stroke-width":2,stroke:"#000"},ab);var xb=O.find(".jGraduate_spreadMethod").change(function(){ea.setAttribute("spreadMethod", +$(this).val())}),fb=null,ib=function(ma){var Y=ma.pageX-ub.left,na=ma.pageY-ub.top;Y=Y<0?0:Y>ga?ga:Y;na=na<0?0:na>ga?ga:na;fb.css("left",Y).css("top",na);Y/=ta;na/=ha;var K=fb.data("coord"),N=ea;switch(K){case "start":pa.x1.val(Y);pa.y1.val(na);N.setAttribute("x1",Y);N.setAttribute("y1",na);break;case "end":pa.x2.val(Y);pa.y2.val(na);N.setAttribute("x2",Y);N.setAttribute("y2",na);break;case "center":pa.cx.val(Y);pa.cy.val(na);N.setAttribute("cx",Y);N.setAttribute("cy",na);Ma=Y;ob=na;e();break;case "focus":pa.fx.val(Y); +pa.fy.val(na);N.setAttribute("fx",Y);N.setAttribute("fy",na);e()}ma.preventDefault()},Lb=function(){fb=null;da.unbind("mousemove",ib).unbind("mouseup",Lb)};Ga=ea.getElementsByTagNameNS(n.svg,"stop");if(xa<2){for(;xa<2;){ea.appendChild(document.createElementNS(n.svg,"stop"));++xa}Ga=ea.getElementsByTagNameNS(n.svg,"stop")}var xa=Ga.length;for(Z=0;Z99.5)K=99.5;if(K>0)Ja=1-K/100;else ob=-(K/100)-1;N=145*((K+100)/2)/100;aa&&e();break;case "angle":Za=K;N=Za/180;N+=0.5;N*=145;aa&&e()}if(N>145)N=145;else if(N<0)N=0;na.css({"margin-left":N-5})}).change()});var Gb=function(ma){var Y=ma.pageX- -kb.offset.left-parseInt(kb.parent.css("border-left-width"));if(Y>145)Y=145;if(Y<=0)Y=0;var na=Y-5;Y/=145;switch(kb.type){case "radius":Y=Math.pow(Y*2,2.5);if(Y>0.98&&Y<1.02)Y=1;if(Y<=0.01)Y=0.01;ea.setAttribute("r",Y);break;case "opacity":u.paint.alpha=parseInt(Y*100);ra.setAttribute("fill-opacity",Y);break;case "ellip":Ja=ob=1;if(Y<0.5){Y/=0.5;ob=Y<=0?0.01:Y}else if(Y>0.5){Y/=0.5;Y=2-Y;Ja=Y<=0?0.01:Y}e();Y-=1;if(Ja===Y+1)Y=Math.abs(Y);break;case "angle":Y-=0.5;Za=Y*=180;e();Y/=100}kb.elem.css({"margin-left":na}); -Y=Math.round(Y*100);kb.input.val(Y);ma.preventDefault()},Hb=function(){da.unbind("mousemove",Gb).unbind("mouseup",Hb);kb=null};for(O=(u.paint.alpha*255/100).toString(16);O.length<2;)O="0"+O;O=O.split(".")[0];J=u.paint.solidColor=="none"?"":u.paint.solidColor+O;la||(J=Ga[0].getAttribute("stop-color"));$.extend($.fn.jPicker.defaults.window,{alphaSupport:true,effects:{type:"show",speed:0}});V.jPicker({window:{title:w.window.pickerTitle},images:{clientPath:w.images.clientPath},color:{active:J,alphaSupport:true}}, -function(ma){u.paint.type="solidColor";u.paint.alpha=ma.val("ahex")?Math.round(ma.val("a")/255*100):100;u.paint.solidColor=ma.val("hex")?ma.val("hex"):"none";u.paint.radialGradient=null;T()},null,function(){M()});var Ob=$(L+" .jGraduate_tabs li");Ob.click(function(){Ob.removeClass("jGraduate_tab_current");$(this).addClass("jGraduate_tab_current");$(L+" > div").hide();var ma=$(this).attr("data-type");$(L+" .jGraduate_gradPick").show();if(ma==="rg"||ma==="lg"){$(".jGraduate_"+ma+"_field").show();$(".jGraduate_"+ -(ma==="lg"?"rg":"lg")+"_field").hide();$("#"+p+"_jgraduate_rect")[0].setAttribute("fill","url(#"+p+"_"+ma+"_jgraduate_grad)");ca=ma==="lg"?"linearGradient":"radialGradient";$("#"+p+"_jGraduate_OpacInput").val(u.paint.alpha).change();var Y=$("#"+p+"_"+ma+"_jgraduate_grad")[0];if(ea!==Y){var na=$(ea).find("stop");$(Y).empty().append(na);ea=Y;Y=zb.val();ea.setAttribute("spreadMethod",Y)}qb=ma==="rg"&&ea.getAttribute("fx")!=null&&!(Ka==Na&&Ra==Sa);$("#"+p+"_jGraduate_focusCoord").toggle(qb);if(qb)$("#"+ -p+"_jGraduate_match_ctr")[0].checked=false}else{$(L+" .jGraduate_gradPick").hide();$(L+" .jGraduate_colPick").show()}});$(L+" > div").hide();Ob.removeClass("jGraduate_tab_current");var Pb;switch(u.paint.type){case "linearGradient":Pb=$(L+" .jGraduate_tab_lingrad");break;case "radialGradient":Pb=$(L+" .jGraduate_tab_radgrad");break;default:Pb=$(L+" .jGraduate_tab_color")}u.show();setTimeout(function(){Pb.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})();$.fn.SpinButton=function(a){function n(f,c){for(var m=f[c],o=document.body;(f=f.offsetParent)&&f!=o;)if(!$.browser.msie||f.currentStyle.position!="relative")m+=f[c];return m}return this.each(function(){this.repeating=false;this.spinCfg={min:a&&!isNaN(parseFloat(a.min))?Number(a.min):null,max:a&&!isNaN(parseFloat(a.max))?Number(a.max):null,step:a&&a.step?Number(a.step):1,stepfunc:a&&a.stepfunc?a.stepfunc:false,page:a&&a.page?Number(a.page):10,upClass:a&&a.upClass?a.upClass:"up",downClass:a&&a.downClass? +0.5)*100},opacity:{handle:"#"+p+"_jGraduate_OpacArrows",input:"#"+p+"_jGraduate_OpacInput",val:u.paint.alpha||100},ellip:{handle:"#"+p+"_jGraduate_EllipArrows",input:"#"+p+"_jGraduate_EllipInput",val:O},angle:{handle:"#"+p+"_jGraduate_AngleArrows",input:"#"+p+"_jGraduate_AngleInput",val:sa}};$.each(O,function(ma,Y){var na=$(Y.handle);na.mousedown(function(K){var N=na.parent();mb={type:ma,elem:na,input:$(Y.input),parent:N,offset:N.offset()};da.mousemove(Gb).mouseup(Hb);K.preventDefault()});$(Y.input).val(Y.val).change(function(){var K= ++this.value,N=0,aa=ca==="radialGradient";switch(ma){case "radius":aa&&ea.setAttribute("r",K/100);N=Math.pow(K/100,0.4)/2*145;break;case "opacity":u.paint.alpha=K;ra.setAttribute("fill-opacity",K/100);N=K*1.45;break;case "ellip":qb=Ja=1;if(K===0){N=72.5;break}if(K>99.5)K=99.5;if(K>0)Ja=1-K/100;else qb=-(K/100)-1;N=145*((K+100)/2)/100;aa&&e();break;case "angle":Za=K;N=Za/180;N+=0.5;N*=145;aa&&e()}if(N>145)N=145;else if(N<0)N=0;na.css({"margin-left":N-5})}).change()});var Gb=function(ma){var Y=ma.pageX- +mb.offset.left-parseInt(mb.parent.css("border-left-width"));if(Y>145)Y=145;if(Y<=0)Y=0;var na=Y-5;Y/=145;switch(mb.type){case "radius":Y=Math.pow(Y*2,2.5);if(Y>0.98&&Y<1.02)Y=1;if(Y<=0.01)Y=0.01;ea.setAttribute("r",Y);break;case "opacity":u.paint.alpha=parseInt(Y*100);ra.setAttribute("fill-opacity",Y);break;case "ellip":Ja=qb=1;if(Y<0.5){Y/=0.5;qb=Y<=0?0.01:Y}else if(Y>0.5){Y/=0.5;Y=2-Y;Ja=Y<=0?0.01:Y}e();Y-=1;if(Ja===Y+1)Y=Math.abs(Y);break;case "angle":Y-=0.5;Za=Y*=180;e();Y/=100}mb.elem.css({"margin-left":na}); +Y=Math.round(Y*100);mb.input.val(Y);ma.preventDefault()},Hb=function(){da.unbind("mousemove",Gb).unbind("mouseup",Hb);mb=null};for(O=(u.paint.alpha*255/100).toString(16);O.length<2;)O="0"+O;O=O.split(".")[0];J=u.paint.solidColor=="none"?"":u.paint.solidColor+O;la||(J=Ga[0].getAttribute("stop-color"));$.extend($.fn.jPicker.defaults.window,{alphaSupport:true,effects:{type:"show",speed:0}});V.jPicker({window:{title:w.window.pickerTitle},images:{clientPath:w.images.clientPath},color:{active:J,alphaSupport:true}}, +function(ma){u.paint.type="solidColor";u.paint.alpha=ma.val("ahex")?Math.round(ma.val("a")/255*100):100;u.paint.solidColor=ma.val("hex")?ma.val("hex"):"none";u.paint.radialGradient=null;T()},null,function(){M()});var Mb=$(L+" .jGraduate_tabs li");Mb.click(function(){Mb.removeClass("jGraduate_tab_current");$(this).addClass("jGraduate_tab_current");$(L+" > div").hide();var ma=$(this).attr("data-type");$(L+" .jGraduate_gradPick").show();if(ma==="rg"||ma==="lg"){$(".jGraduate_"+ma+"_field").show();$(".jGraduate_"+ +(ma==="lg"?"rg":"lg")+"_field").hide();$("#"+p+"_jgraduate_rect")[0].setAttribute("fill","url(#"+p+"_"+ma+"_jgraduate_grad)");ca=ma==="lg"?"linearGradient":"radialGradient";$("#"+p+"_jGraduate_OpacInput").val(u.paint.alpha).change();var Y=$("#"+p+"_"+ma+"_jgraduate_grad")[0];if(ea!==Y){var na=$(ea).find("stop");$(Y).empty().append(na);ea=Y;Y=xb.val();ea.setAttribute("spreadMethod",Y)}rb=ma==="rg"&&ea.getAttribute("fx")!=null&&!(Ka==Na&&Ra==Sa);$("#"+p+"_jGraduate_focusCoord").toggle(rb);if(rb)$("#"+ +p+"_jGraduate_match_ctr")[0].checked=false}else{$(L+" .jGraduate_gradPick").hide();$(L+" .jGraduate_colPick").show()}});$(L+" > div").hide();Mb.removeClass("jGraduate_tab_current");var Nb;switch(u.paint.type){case "linearGradient":Nb=$(L+" .jGraduate_tab_lingrad");break;case "radialGradient":Nb=$(L+" .jGraduate_tab_radgrad");break;default:Nb=$(L+" .jGraduate_tab_color")}u.show();setTimeout(function(){Nb.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})();$.fn.SpinButton=function(a){function n(f,c){for(var m=f[c],o=document.body;(f=f.offsetParent)&&f!=o;)if(!$.browser.msie||f.currentStyle.position!="relative")m+=f[c];return m}return this.each(function(){this.repeating=false;this.spinCfg={min:a&&!isNaN(parseFloat(a.min))?Number(a.min):null,max:a&&!isNaN(parseFloat(a.max))?Number(a.max):null,step:a&&a.step?Number(a.step):1,stepfunc:a&&a.stepfunc?a.stepfunc:false,page:a&&a.page?Number(a.page):10,upClass:a&&a.upClass?a.upClass:"up",downClass:a&&a.downClass? a.downClass:"down",reset:a&&a.reset?a.reset:this.value,delay:a&&a.delay?Number(a.delay):500,interval:a&&a.interval?Number(a.interval):100,_btn_width:20,_direction:null,_delay:null,_repeat:null,callback:a&&a.callback?a.callback:null};this.spinCfg.smallStep=a&&a.smallStep?a.smallStep:this.spinCfg.step/2;this.adjustValue=function(f){f=isNaN(this.value)?this.spinCfg.reset:$.isFunction(this.spinCfg.stepfunc)?this.spinCfg.stepfunc(this,f):Number((Number(this.value)+Number(f)).toFixed(5));if(this.spinCfg.min!== null)f=Math.max(f,this.spinCfg.min);if(this.spinCfg.max!==null)f=Math.min(f,this.spinCfg.max);this.value=f;$.isFunction(this.spinCfg.callback)&&this.spinCfg.callback(this)};$(this).addClass(a&&a.spinClass?a.spinClass:"spin-button").mousemove(function(f){var c=f.pageX||f.x,m=f.pageY||f.y;f=f.target||f.srcElement;var o=svgEditor.tool_scale||1,b=$(f).height()/2;c=c>n(f,"offsetLeft")+f.offsetWidth*o-this.spinCfg._btn_width?m=0,o=n.indexOf("Gecko/")>=0,b=n.indexOf("MSIE")>=0,d=n.indexOf("Chrome/")>=0,e=n.indexOf("Windows")>=0,l=n.indexOf("Macintosh")>= -0,u="ontouchstart"in window,w=!!f.querySelector,p=!!document.evaluate,L=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","path");ua.setAttribute("d","M0,0 10,10");var ha=ua.pathSegList;ua=ua.createSVGPathSegLinetoAbs(5,5);try{ha.replaceItem(ua,0);return true}catch(ca){}return false}(),T=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","path");ua.setAttribute("d","M0,0 10,10");var ha=ua.pathSegList;ua=ua.createSVGPathSegLinetoAbs(5,5);try{ha.insertItemBefore(ua, -0);return true}catch(ca){}return false}(),M=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","svg"),ha=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(ua);ha.setAttribute("x",5);ua.appendChild(ha);var ca=document.createElementNS("http://www.w3.org/2000/svg","text");ca.textContent="a";ha.appendChild(ca);ha=ca.getStartPositionOfChar(0).x;document.documentElement.removeChild(ua);return ha===0}(),J=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg", -"svg");document.documentElement.appendChild(ua);var ha=document.createElementNS("http://www.w3.org/2000/svg","path");ha.setAttribute("d","M0,0 C0,0 10,10 10,0");ua.appendChild(ha);ha=ha.getBBox();document.documentElement.removeChild(ua);return ha.height>4&&ha.height<5}(),da=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(ua);var ha=document.createElementNS("http://www.w3.org/2000/svg","path");ha.setAttribute("d","M0,0 10,0");var ca= -document.createElementNS("http://www.w3.org/2000/svg","path");ca.setAttribute("d","M5,0 15,0");var ea=document.createElementNS("http://www.w3.org/2000/svg","g");ea.appendChild(ha);ea.appendChild(ca);ua.appendChild(ea);ha=ea.getBBox();document.documentElement.removeChild(ua);return ha.width==15}(),V=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","rect");ua.setAttribute("x",0.1);(ua=ua.cloneNode(false).getAttribute("x").indexOf(",")==-1)||$.alert("NOTE: This version of Opera is known to contain bugs in SVG-edit.\n\t\tPlease upgrade to the latest version in which the problems have been fixed."); -return ua}(),O=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","rect");ua.setAttribute("style","vector-effect:non-scaling-stroke");return ua.style.vectorEffect==="non-scaling-stroke"}(),fa=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","rect").transform.baseVal,ha=f.createSVGTransform();ua.appendItem(ha);return ua.getItem(0)==ha}();svgedit.browser.isOpera=function(){return c};svgedit.browser.isWebkit=function(){return m};svgedit.browser.isGecko=function(){return o}; +0,u="ontouchstart"in window,w=!!f.querySelector,p=!!document.evaluate,L=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","path");ta.setAttribute("d","M0,0 10,10");var ha=ta.pathSegList;ta=ta.createSVGPathSegLinetoAbs(5,5);try{ha.replaceItem(ta,0);return true}catch(ca){}return false}(),T=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","path");ta.setAttribute("d","M0,0 10,10");var ha=ta.pathSegList;ta=ta.createSVGPathSegLinetoAbs(5,5);try{ha.insertItemBefore(ta, +0);return true}catch(ca){}return false}(),M=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","svg"),ha=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(ta);ha.setAttribute("x",5);ta.appendChild(ha);var ca=document.createElementNS("http://www.w3.org/2000/svg","text");ca.textContent="a";ha.appendChild(ca);ha=ca.getStartPositionOfChar(0).x;document.documentElement.removeChild(ta);return ha===0}(),J=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg", +"svg");document.documentElement.appendChild(ta);var ha=document.createElementNS("http://www.w3.org/2000/svg","path");ha.setAttribute("d","M0,0 C0,0 10,10 10,0");ta.appendChild(ha);ha=ha.getBBox();document.documentElement.removeChild(ta);return ha.height>4&&ha.height<5}(),da=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(ta);var ha=document.createElementNS("http://www.w3.org/2000/svg","path");ha.setAttribute("d","M0,0 10,0");var ca= +document.createElementNS("http://www.w3.org/2000/svg","path");ca.setAttribute("d","M5,0 15,0");var ea=document.createElementNS("http://www.w3.org/2000/svg","g");ea.appendChild(ha);ea.appendChild(ca);ta.appendChild(ea);ha=ea.getBBox();document.documentElement.removeChild(ta);return ha.width==15}(),V=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","rect");ta.setAttribute("x",0.1);(ta=ta.cloneNode(false).getAttribute("x").indexOf(",")==-1)||$.alert("NOTE: This version of Opera is known to contain bugs in SVG-edit.\n\t\tPlease upgrade to the latest version in which the problems have been fixed."); +return ta}(),O=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","rect");ta.setAttribute("style","vector-effect:non-scaling-stroke");return ta.style.vectorEffect==="non-scaling-stroke"}(),ga=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","rect").transform.baseVal,ha=f.createSVGTransform();ta.appendItem(ha);return ta.getItem(0)==ha}();svgedit.browser.isOpera=function(){return c};svgedit.browser.isWebkit=function(){return m};svgedit.browser.isGecko=function(){return o}; svgedit.browser.isIE=function(){return b};svgedit.browser.isChrome=function(){return d};svgedit.browser.isWindows=function(){return e};svgedit.browser.isMac=function(){return l};svgedit.browser.isTouch=function(){return u};svgedit.browser.supportsSelectors=function(){return w};svgedit.browser.supportsXpath=function(){return p};svgedit.browser.supportsPathReplaceItem=function(){return L};svgedit.browser.supportsPathInsertItemBefore=function(){return T};svgedit.browser.supportsPathBBox=function(){return J}; -svgedit.browser.supportsHVLineContainerBBox=function(){return da};svgedit.browser.supportsGoodTextCharPos=function(){return M};svgedit.browser.supportsEditableText=function(){return c};svgedit.browser.supportsGoodDecimals=function(){return V};svgedit.browser.supportsNonScalingStroke=function(){return O};svgedit.browser.supportsNativeTransformLists=function(){return fa}}else window.location="browser-not-supported.html"})();svgedit=svgedit||{}; +svgedit.browser.supportsHVLineContainerBBox=function(){return da};svgedit.browser.supportsGoodTextCharPos=function(){return M};svgedit.browser.supportsEditableText=function(){return c};svgedit.browser.supportsGoodDecimals=function(){return V};svgedit.browser.supportsNonScalingStroke=function(){return O};svgedit.browser.supportsNativeTransformLists=function(){return ga}}else window.location="browser-not-supported.html"})();svgedit=svgedit||{}; (function(){if(!svgedit.transformlist)svgedit.transformlist={};var a=document.createElementNS("http://www.w3.org/2000/svg","svg"),n={};svgedit.transformlist.SVGTransformList=function(f){this._elem=f||null;this._xforms=[];this._update=function(){var c="";a.createSVGMatrix();for(var m=0;m>4;l=(l&15)<<4|w>>2;u=(w&3)<<6|p;d+=String.fromCharCode(e);if(w!=64)d+= new DOMParser:new ActiveXObject("Microsoft.XMLDOM");e.async=false}catch(l){throw Error("XML Parser could not be instantiated");}try{d=e.loadXML?e.loadXML(b)?e:false:e.parseFromString(b,"text/xml")}catch(u){throw Error("Error parsing XML string");}return d};svgedit.utilities.bboxToObj=function(b){return{x:b.x,y:b.y,width:b.width,height:b.height}};svgedit.utilities.walkTree=function(b,d){if(b&&b.nodeType==1){d(b);for(var e=b.childNodes.length;e--;)svgedit.utilities.walkTree(b.childNodes.item(e),d)}}; svgedit.utilities.walkTreePost=function(b,d){if(b&&b.nodeType==1){for(var e=b.childNodes.length;e--;)svgedit.utilities.walkTree(b.childNodes.item(e),d);d(b)}};svgedit.utilities.getUrlFromAttr=function(b){if(b)if(b.indexOf('url("')===0)return b.substring(5,b.indexOf('"',6));else if(b.indexOf("url('")===0)return b.substring(5,b.indexOf("'",6));else if(b.indexOf("url(")===0)return b.substring(4,b.indexOf(")"));return null};svgedit.utilities.getHref=function(b){return b.getAttributeNS("http://www.w3.org/1999/xlink", "href")};svgedit.utilities.setHref=function(b,d){b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d)};svgedit.utilities.findDefs=function(b){b=f.getSVGContent().documentElement;var d=b.getElementsByTagNameNS("http://www.w3.org/2000/svg","defs");return d=d.length>0?d[0]:b.insertBefore(b.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),b.firstChild.nextSibling)};svgedit.utilities.getPathBBox=function(b){var d=b.pathSegList,e=d.numberOfItems;b=[[],[]];var l=d.getItem(0), -u=[l.x,l.y];for(l=0;l element";this.svgElem_=c;this.obj_num=0;this.idPrefix=m||"svg_";this.releasedNums=[];this.all_layers=[];this.current_layer=null;this.nonce_= "";var o=this.svgElem_.getAttributeNS("http://svg-edit.googlecode.com","nonce");if(o&&f!=n.NEVER_RANDOMIZE)this.nonce_=o;else f==n.ALWAYS_RANDOMIZE&&this.setNonce(Math.floor(Math.random()*100001))};svgedit.draw.Drawing.prototype.getElem_=function(c){return this.svgElem_.querySelector?this.svgElem_.querySelector("#"+c):$(this.svgElem_).find("[id="+c+"]")[0]};svgedit.draw.Drawing.prototype.getSvgElem=function(){return this.svgElem_};svgedit.draw.Drawing.prototype.getNonce=function(){return this.nonce_}; @@ -195,325 +196,326 @@ dy-=newcy;r=Math.sqrt(dx*dx+dy*dy);theta=Math.atan2(dy,dx)-angle;return{x:(r*Mat 1;L=w.getItem(p);var T=L.pathSegType;if(T!=1){var M=b(L.x,L.y);M=[M.x,M.y];if(L.x1!=null&&L.x2!=null){c_vals1=b(L.x1,L.y1);c_vals2=b(L.x2,L.y2);M.splice(M.length,0,c_vals1.x,c_vals1.y,c_vals2.x,c_vals2.y)}svgedit.path.replacePathSeg(T,p,M)}}svgedit.utilities.getBBox(d);w=svgroot.createSVGTransform();d=svgedit.transformlist.getTransformList(d);w.setRotate(e*180/Math.PI,u,l);d.replaceItem(w,0)}};svgedit.path.clearData=function(){m={}}})();if(!window.console){window.console={};window.console.log=function(){};window.console.dir=function(){}}if(window.opera){window.console.log=function(a){opera.postError(a)};window.console.dir=function(){}} (function(){var a=jQuery.fn.attr;jQuery.fn.attr=function(n,f){var c=this.length;if(!c)return a.apply(this,arguments);for(var m=0;m').documentElement, +$.SvgCanvas=function(a,n){function f(g,h){for(var k=svgedit.utilities.getBBox(g),v=0;v<2;v++){var s=v===0?"fill":"stroke",E=g.getAttribute(s);if(E&&E.indexOf("url(")===0){E=N(E);if(E.tagName==="linearGradient"){var z=E.getAttribute("x1")||0,t=E.getAttribute("y1")||0,C=E.getAttribute("x2")||1,F=E.getAttribute("y2")||0;z=k.width*z+k.x;t=k.height*t+k.y;C=k.width*C+k.x;F=k.height*F+k.y;z=O(z,t,h);F=O(C,F,h);C={};C.x1=(z.x-k.x)/k.width;C.y1=(z.y-k.y)/k.height;C.x2=(F.x-k.x)/k.width;C.y2=(F.y-k.y)/k.height; +E=E.cloneNode(true);$(E).attr(C);E.id=na();vb().appendChild(E);g.setAttribute(s,"url(#"+E.id+")")}}}}var c="http://www.w3.org/2000/svg",m={show_outside_canvas:true,selectNew:true,dimensions:[640,480]};n&&$.extend(m,n);var o=m.dimensions,b=this,d=a.ownerDocument,e=d.importNode(svgedit.utilities.text2xml('').documentElement, true);a.appendChild(e);var l=d.createElementNS(c,"svg");(b.clearSvgContentElement=function(){for(;l.firstChild;)l.removeChild(l.firstChild);$(l).attr({id:"svgcontent",width:o[0],height:o[1],x:o[0],y:o[1],overflow:m.show_outside_canvas?"visible":"hidden",xmlns:c,"xmlns:se":"http://svg-edit.googlecode.com","xmlns:xlink":"http://www.w3.org/1999/xlink"}).appendTo(e);var g=d.createComment(" Created with Method Draw - http://github.com/duopixel/Method-Draw/ ");l.appendChild(g)})();var u="svg_";b.setIdPrefix= function(g){u=g};b.current_drawing_=new svgedit.draw.Drawing(l,u);var w=b.getCurrentDrawing=function(){return b.current_drawing_},p=1,L=null,T={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}};T.text=$.extend(true,{},T.shape);$.extend(T.text, {fill:"#000000",stroke_width:0,font_size:24,font_family:"Junction"});var M=T.shape,J=Array(1),da=this.addSvgElementFromJson=function(g){var h=svgedit.utilities.getElem(g.attr.id),k=w().getCurrentLayer();if(h&&g.element!=h.tagName){k.removeChild(h);h=null}if(!h){h=d.createElementNS(c,g.element);if(k)(L||k).appendChild(h)}g.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,g.attr,100);svgedit.utilities.cleanupElement(h);return h},V=b.getTransformList=svgedit.transformlist.getTransformList,O=svgedit.math.transformPoint,fa=b.matrixMultiply=svgedit.math.matrixMultiply,ua=b.hasMatrixTransform=svgedit.math.hasMatrixTransform,ha=b.transformListToTransform=svgedit.math.transformListToTransform, -ca=svgedit.math.snapToAngle,ea=svgedit.math.getMatrix;svgedit.units.init({getBaseUnit:function(){return m.baseUnit},getElement:svgedit.utilities.getElem,getHeight:function(){return l.getAttribute("height")/p},getWidth:function(){return l.getAttribute("width")/p},getRoundDigits:function(){return ob.round_digits}});var ra=b.convertToNum=svgedit.units.convertToNum;svgedit.utilities.init({getDOMDocument:function(){return d},getDOMContainer:function(){return a},getSVGRoot:function(){return e},getSelectedElements:function(){return J}, -getSVGContent:function(){return l}});var qa=b.getUrlFromAttr=svgedit.utilities.getUrlFromAttr,ba=b.getHref=svgedit.utilities.getHref,S=b.setHref=svgedit.utilities.setHref,U=svgedit.utilities.getPathBBox;b.getBBox=svgedit.utilities.getBBox;var sa=b.getRotationAngle=svgedit.utilities.getRotationAngle,la=b.getElem=svgedit.utilities.getElem,oa=b.assignAttributes=svgedit.utilities.assignAttributes,Z=this.cleanupElement=svgedit.utilities.cleanupElement,Aa=svgedit.sanitize.getNSMap(),Ka=b.sanitizeSvg=svgedit.sanitize.sanitizeSvg, +"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,g.attr,100);svgedit.utilities.cleanupElement(h);return h},V=b.getTransformList=svgedit.transformlist.getTransformList,O=svgedit.math.transformPoint,ga=b.matrixMultiply=svgedit.math.matrixMultiply,ta=b.hasMatrixTransform=svgedit.math.hasMatrixTransform,ha=b.transformListToTransform=svgedit.math.transformListToTransform, +ca=svgedit.math.snapToAngle,ea=svgedit.math.getMatrix;svgedit.units.init({getBaseUnit:function(){return m.baseUnit},getElement:svgedit.utilities.getElem,getHeight:function(){return l.getAttribute("height")/p},getWidth:function(){return l.getAttribute("width")/p},getRoundDigits:function(){return qb.round_digits}});var ra=b.convertToNum=svgedit.units.convertToNum;svgedit.utilities.init({getDOMDocument:function(){return d},getDOMContainer:function(){return a},getSVGRoot:function(){return e},getSelectedElements:function(){return J}, +getSVGContent:function(){return l}});var pa=b.getUrlFromAttr=svgedit.utilities.getUrlFromAttr,ba=b.getHref=svgedit.utilities.getHref,S=b.setHref=svgedit.utilities.setHref,U=svgedit.utilities.getPathBBox;b.getBBox=svgedit.utilities.getBBox;var sa=b.getRotationAngle=svgedit.utilities.getRotationAngle,la=b.getElem=svgedit.utilities.getElem,oa=b.assignAttributes=svgedit.utilities.assignAttributes,Z=this.cleanupElement=svgedit.utilities.cleanupElement,Aa=svgedit.sanitize.getNSMap(),Ka=b.sanitizeSvg=svgedit.sanitize.sanitizeSvg, Ra=svgedit.history.MoveElementCommand,Na=svgedit.history.InsertElementCommand,Sa=svgedit.history.RemoveElementCommand,Wa=svgedit.history.ChangeElementCommand,Oa=svgedit.history.BatchCommand;b.undoMgr=new svgedit.history.UndoManager({handleHistoryEvent:function(g,h){var k=svgedit.history.HistoryEventTypes;if(g==k.BEFORE_UNAPPLY||g==k.BEFORE_APPLY)b.clearSelection();else if(g==k.AFTER_APPLY||g==k.AFTER_UNAPPLY){var v=h.elements();b.pathActions.clear();K("changed",v);v=h.type();k=g==k.AFTER_APPLY;if(v== Ra.type()){k=k?h.newParent:h.oldParent;k==l&&b.identifyLayers()}else if(v==Na.type()||v==Sa.type()){h.parent==l&&b.identifyLayers();if(v==Na.type())k&&ab(h.elem);else k||ab(h.elem);h.elem.tagName==="use"&&cc(h.elem)}else if(v==Wa.type()){h.elem.tagName=="title"&&h.elem.parentNode.parentNode==l&&b.identifyLayers();k=k?h.newValues:h.oldValues;k.stdDeviation&&b.setBlurOffsets(h.elem.parentNode,k.stdDeviation);if(h.elem.tagName==="use"&&svgedit.browser.isWebkit()){v=h.elem;if(!v.getAttribute("x")&&!v.getAttribute("y")){k= v.parentNode;var s=v.nextSibling;k.removeChild(v);k.insertBefore(v,s)}}}}}});var Ia=function(g){b.undoMgr.addCommandToHistory(g)};svgedit.select.init(m,{createSVGElement:function(g){return b.addSvgElementFromJson(g)},svgRoot:function(){return e},svgContent:function(){return l},currentZoom:function(){return p},getStrokedBBox:function(g){return b.getStrokedBBox([g])}});var Qa=this.selectorManager=svgedit.select.getSelectorManager();svgedit.path.init({getCurrentZoom:function(){return p},getSVGRoot:function(){return e}}); -svgedit.utilities.snapToGrid=function(g){var h=m.snappingStep,k=m.baseUnit;if(k!=="px")h*=svgedit.units.getTypeMap()[k];return g=Math.round(g/h)*h};var Ga=svgedit.utilities.snapToGrid,Cb={exportNoBlur:"Blurred elements will appear as un-blurred",exportNoforeignObject:"foreignObject elements will not appear",exportNoDashArray:"Strokes will appear filled",exportNoText:"Text may not appear as expected"},Mb=["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"],lb=$.data, -ab=function(g){var h=$(g).attr(Mb),k;for(k in h){var v=h[k];if(v&&v.indexOf("url(")===0){v=qa(v).substr(1);if(!la(v)){xb().appendChild(Ab[v]);delete Ab[v]}}}g=g.getElementsByTagName("*");if(g.length){h=0;for(k=g.length;h=0)C=D=b.convertToPath(F,true);else if(F.tagName=="rect"){var H=F.getAttribute("rx"),G=F.getAttribute("ry");if(H||G)C=D=b.convertToPath(F,true)}if(!D){var P=F.cloneNode(true),R=document.createElementNS(c,"g"),W=F.parentNode;W.appendChild(R);R.appendChild(P);C=svgedit.utilities.bboxToObj(R.getBBox());W.removeChild(R)}}return C}catch(ta){console.log(F,ta);return null}},k;$.each(g,function(){if(!k)if(this.parentNode)k=h(this)}); -if(k==null)return null;var v=k.x+k.width,s=k.y+k.height,E=k.x,z=k.y,t=function(F){var C=F.getAttribute("stroke-width"),D=0;if(F.getAttribute("stroke")!="none"&&!isNaN(C))D+=C/2;return D},B=[];$.each(g,function(F,C){var D=h(C);if(D){var H=t(C);E=Math.min(E,D.x-H);z=Math.min(z,D.y-H);B.push(D)}});k.x=E;k.y=z;$.each(g,function(F,C){var D=B[F];if(D&&C.nodeType==1){var H=t(C);v=Math.max(v,D.x+D.width+H);s=Math.max(s,D.y+D.height+H)}});k.width=v-E;k.height=s-z;return k};var Hb=this.getVisibleElements=function(g){g|| -(g=$(l).children());var h=[];$(g).children().each(function(k,v){try{v.getBBox()&&h.push(v)}catch(s){}});return h.reverse()},Ob=this.getVisibleElementsAndBBoxes=function(g){g||(g=$(l).children());var h=[];$(g).children().each(function(k,v){try{v.getBBox()&&h.push({elem:v,bbox:getStrokedBBox([v])})}catch(s){}});return h.reverse()},Pb=this.groupSvgElem=function(g){var h=document.createElementNS(c,"g");g.parentNode.replaceChild(h,g);$(h).append(g).data("gsvg",g)[0].id=na()},ma=function(g){var h=document.createElementNS(g.namespaceURI, +svgedit.utilities.snapToGrid=function(g){var h=m.snappingStep,k=m.baseUnit;if(k!=="px")h*=svgedit.units.getTypeMap()[k];return g=Math.round(g/h)*h};var Ga=svgedit.utilities.snapToGrid,Cb={exportNoBlur:"Blurred elements will appear as un-blurred",exportNoforeignObject:"foreignObject elements will not appear",exportNoDashArray:"Strokes will appear filled",exportNoText:"Text may not appear as expected"},Kb=["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"],nb=$.data, +ab=function(g){var h=$(g).attr(Kb),k;for(k in h){var v=h[k];if(v&&v.indexOf("url(")===0){v=pa(v).substr(1);if(!la(v)){vb().appendChild(yb[v]);delete yb[v]}}}g=g.getElementsByTagName("*");if(g.length){h=0;for(k=g.length;h=0)B=D=b.convertToPath(F,true);else if(F.tagName=="rect"){var H=F.getAttribute("rx"),G=F.getAttribute("ry");if(H||G)B=D=b.convertToPath(F,true)}if(!D){var P=F.cloneNode(true),Q=document.createElementNS(c,"g"),W=F.parentNode;W.appendChild(Q);Q.appendChild(P);B=svgedit.utilities.bboxToObj(Q.getBBox());W.removeChild(Q)}}return B}catch(ua){console.log(F,ua);return null}},k;$.each(g,function(){if(!k)if(this.parentNode)k=h(this)}); +if(k==null)return null;var v=k.x+k.width,s=k.y+k.height,E=k.x,z=k.y,t=function(F){var B=F.getAttribute("stroke-width"),D=0;if(F.getAttribute("stroke")!="none"&&!isNaN(B))D+=B/2;return D},C=[];$.each(g,function(F,B){var D=h(B);if(D){var H=t(B);E=Math.min(E,D.x-H);z=Math.min(z,D.y-H);C.push(D)}});k.x=E;k.y=z;$.each(g,function(F,B){var D=C[F];if(D&&B.nodeType==1){var H=t(B);v=Math.max(v,D.x+D.width+H);s=Math.max(s,D.y+D.height+H)}});k.width=v-E;k.height=s-z;return k};var Hb=this.getVisibleElements=function(g){g|| +(g=$(l).children());var h=[];$(g).children().each(function(k,v){try{v.getBBox()&&h.push(v)}catch(s){}});return h.reverse()},Mb=this.getVisibleElementsAndBBoxes=function(g){g||(g=$(l).children());var h=[];$(g).children().each(function(k,v){try{v.getBBox()&&h.push({elem:v,bbox:getStrokedBBox([v])})}catch(s){}});return h.reverse()},Nb=this.groupSvgElem=function(g){var h=document.createElementNS(c,"g");g.parentNode.replaceChild(h,g);$(h).append(g).data("gsvg",g)[0].id=na()},ma=function(g){var h=document.createElementNS(g.namespaceURI, g.nodeName);h.removeAttribute("id");$.each(g.attributes,function(v,s){s.localName!="-moz-math-font-style"&&h.setAttributeNS(s.namespaceURI,s.nodeName,s.nodeValue)});if(svgedit.browser.isWebkit()&&g.nodeName=="path"){var k=Ua.convertPath(g);h.setAttribute("d",k)}$.each(g.childNodes,function(v,s){switch(s.nodeType){case 1:h.appendChild(ma(s));break;case 3:h.textContent=s.nodeValue}});if($(g).data("gsvg"))$(h).data("gsvg",h.firstChild);else if($(g).data("symbol")){g=$(g).data("symbol");$(h).data("ref", -g).data("symbol",g)}else h.tagName=="image"&&Ib(h);h.id=na();return h},Y,na,K;(function(g){var h={};Y=g.getId=function(){return w().getId()};na=g.getNextId=function(){return w().getNextId()};K=g.call=function(k,v){if(h[k])return h[k](this,v)};g.bind=function(k,v){var s=h[k];h[k]=v;return s}})(b);this.prepareSvg=function(g){this.sanitizeSvg(g.documentElement);g=g.getElementsByTagNameNS(c,"path");for(var h=0,k=g.length;h0&&s.getItem(0).type==4&&s.removeItem(0);if(g!=0){E=O(E,z,ha(s).matrix); -z=e.createSVGTransform();z.setRotate(g,E.x,E.y);s.numberOfItems?s.insertItemBefore(z,0):s.appendItem(z)}else s.numberOfItems==0&&k.removeAttribute("transform");if(!h){s=k.getAttribute("transform");k.setAttribute("transform",v);rb("transform",s,J);K("changed",J)}la("pathpointgrip_container");k=Qa.requestSelector(J[0]);k.resize();k.updateGripCursors(g)};var Pa=this.recalculateAllSelectedDimensions=function(){for(var g=new Oa(mb=="none"?"position":"size"),h=J.length;h--;){var k=cb(J[h]);k&&g.addSubCommand(k)}if(!g.isEmpty()){Ia(g); -K("changed",J)}},Xa=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],fb=function(g){console.log([g.a,g.b,g.c,g.d,g.e,g.f])},nb=this.remapElement=function(g,h,k){var v=m.gridSnapping&&g.parentNode.parentNode.localName==="svg",s=function(){if(v)for(var D in h)h[D]=Ga(h[D]);oa(g,h,1E3,true)};box=svgedit.utilities.getBBox(g);for(var E=0;E<2;E++){var z=E===0?"fill":"stroke",t=g.getAttribute(z);if(t&&t.indexOf("url(")===0)if(k.a<0||k.d<0){t=N(t).cloneNode(true);if(k.a<0){var B= -t.getAttribute("x1"),F=t.getAttribute("x2");t.setAttribute("x1",-(B-1));t.setAttribute("x2",-(F-1))}if(k.d<0){B=t.getAttribute("y1");F=t.getAttribute("y2");t.setAttribute("y1",-(B-1));t.setAttribute("y2",-(F-1))}t.id=na();xb().appendChild(t);g.setAttribute(z,"url(#"+t.id+")")}}E=g.tagName;if(E==="g"||E==="text"||E==="use")if(k.a==1&&k.b==0&&k.c==0&&k.d==1&&(k.e!=0||k.f!=0)){z=ha(g).matrix;z=fa(z.inverse(),k,z);h.x=parseFloat(h.x)+z.e;h.y=parseFloat(h.y)+z.f}else{z=V(g);t=e.createSVGTransform();t.setMatrix(fa(ha(z).matrix, -k));z.clear();z.appendItem(t)}switch(E){case "foreignObject":case "rect":case "image":if(E==="image"&&(k.a<0||k.d<0)){z=V(g);t=e.createSVGTransform();t.setMatrix(fa(ha(z).matrix,k));z.clear();z.appendItem(t)}else{z=O(h.x,h.y,k);h.width=k.a*h.width;h.height=k.d*h.height;h.x=z.x+Math.min(0,h.width);h.y=z.y+Math.min(0,h.height);h.width=Math.abs(h.width);h.height=Math.abs(h.height)}s();break;case "ellipse":E=O(h.cx,h.cy,k);h.cx=E.x;h.cy=E.y;h.rx=k.a*h.rx;h.ry=k.d*h.ry;h.rx=Math.abs(h.rx);h.ry=Math.abs(h.ry); -s();break;case "circle":E=O(h.cx,h.cy,k);h.cx=E.x;h.cy=E.y;E=svgedit.math.transformBox(box.x,box.y,box.width,box.height,k);h.r=Math.min((E.tr.x-E.tl.x)/2,(E.bl.y-E.tl.y)/2);if(h.r)h.r=Math.abs(h.r);s();break;case "line":z=O(h.x1,h.y1,k);B=O(h.x2,h.y2,k);h.x1=z.x;h.y1=z.y;h.x2=B.x;h.y2=B.y;case "text":k=g.querySelectorAll("tspan");for(E=k.length;E--;){z=ra("x",g.getAttribute("x"));t=ra("x",k[E].getAttribute("x"));B=ra("y",g.getAttribute("y"));F=ra("y",k[E].getAttribute("y"));var C={};if(!isNaN(z)&& -!isNaN(t)&&z!=0&&t!=0&&h.x)C.x=h.x-(z-t);if(!isNaN(B)&&!isNaN(F)&&B!=0&&F!=0&&h.y)C.y=h.y-(B-F);if(C.x||C.y)oa(k[E],C,1E3,true)}s();break;case "use":s();break;case "g":(s=$(g).data("gsvg"))&&oa(s,h,1E3,true);break;case "polyline":case "polygon":s=h.points.length;for(E=0;E0&&s.getItem(0).type==4&&s.removeItem(0);if(g!=0){E=O(E,z,ha(s).matrix); +z=e.createSVGTransform();z.setRotate(g,E.x,E.y);s.numberOfItems?s.insertItemBefore(z,0):s.appendItem(z)}else s.numberOfItems==0&&k.removeAttribute("transform");if(!h){s=k.getAttribute("transform");k.setAttribute("transform",v);db("transform",s,J);K("changed",J)}la("pathpointgrip_container");k=Qa.requestSelector(J[0]);k.resize();k.updateGripCursors(g)};var Pa=this.recalculateAllSelectedDimensions=function(){for(var g=new Oa(ob=="none"?"position":"size"),h=J.length;h--;){var k=cb(J[h]);k&&g.addSubCommand(k)}if(!g.isEmpty()){Ia(g); +K("changed",J)}},Xa=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],hb=function(g){console.log([g.a,g.b,g.c,g.d,g.e,g.f])},pb=this.remapElement=function(g,h,k){var v=m.gridSnapping&&g.parentNode.parentNode.localName==="svg",s=function(){if(v)for(var D in h)h[D]=Ga(h[D]);oa(g,h,1E3,true)};box=svgedit.utilities.getBBox(g);for(var E=0;E<2;E++){var z=E===0?"fill":"stroke",t=g.getAttribute(z);if(t&&t.indexOf("url(")===0)if(k.a<0||k.d<0){t=N(t).cloneNode(true);if(k.a<0){var C= +t.getAttribute("x1"),F=t.getAttribute("x2");t.setAttribute("x1",-(C-1));t.setAttribute("x2",-(F-1))}if(k.d<0){C=t.getAttribute("y1");F=t.getAttribute("y2");t.setAttribute("y1",-(C-1));t.setAttribute("y2",-(F-1))}t.id=na();vb().appendChild(t);g.setAttribute(z,"url(#"+t.id+")")}}E=g.tagName;if(E==="g"||E==="text"||E==="use")if(k.a==1&&k.b==0&&k.c==0&&k.d==1&&(k.e!=0||k.f!=0)){z=ha(g).matrix;z=ga(z.inverse(),k,z);h.x=parseFloat(h.x)+z.e;h.y=parseFloat(h.y)+z.f}else{z=V(g);t=e.createSVGTransform();t.setMatrix(ga(ha(z).matrix, +k));z.clear();z.appendItem(t)}switch(E){case "foreignObject":case "rect":case "image":if(E==="image"&&(k.a<0||k.d<0)){z=V(g);t=e.createSVGTransform();t.setMatrix(ga(ha(z).matrix,k));z.clear();z.appendItem(t)}else{z=O(h.x,h.y,k);h.width=k.a*h.width;h.height=k.d*h.height;h.x=z.x+Math.min(0,h.width);h.y=z.y+Math.min(0,h.height);h.width=Math.abs(h.width);h.height=Math.abs(h.height)}s();break;case "ellipse":E=O(h.cx,h.cy,k);h.cx=E.x;h.cy=E.y;h.rx=k.a*h.rx;h.ry=k.d*h.ry;h.rx=Math.abs(h.rx);h.ry=Math.abs(h.ry); +s();break;case "circle":E=O(h.cx,h.cy,k);h.cx=E.x;h.cy=E.y;E=svgedit.math.transformBox(box.x,box.y,box.width,box.height,k);h.r=Math.min((E.tr.x-E.tl.x)/2,(E.bl.y-E.tl.y)/2);if(h.r)h.r=Math.abs(h.r);s();break;case "line":z=O(h.x1,h.y1,k);C=O(h.x2,h.y2,k);h.x1=z.x;h.y1=z.y;h.x2=C.x;h.y2=C.y;case "text":k=g.querySelectorAll("tspan");for(E=k.length;E--;){z=ra("x",g.getAttribute("x"));t=ra("x",k[E].getAttribute("x"));C=ra("y",g.getAttribute("y"));F=ra("y",k[E].getAttribute("y"));var B={};if(!isNaN(z)&& +!isNaN(t)&&z!=0&&t!=0&&h.x)B.x=h.x-(z-t);if(!isNaN(C)&&!isNaN(F)&&C!=0&&F!=0&&h.y)B.y=h.y-(C-F);if(B.x||B.y)oa(k[E],B,1E3,true)}s();break;case "use":s();break;case "g":(s=$(g).data("gsvg"))&&oa(s,h,1E3,true);break;case "polyline":case "polygon":s=h.points.length;for(E=0;E0){for(var k=h.numberOfItems;k--;){var v=h.getItem(k);if(v.type===0)h.removeItem(k);else if(v.type===1)svgedit.math.isIdentity(v.matrix)&&h.removeItem(k);else v.type===4&&v.angle===0&&h.removeItem(k)}if(h.numberOfItems===1&&sa(g))return null}if(!h|| -h.numberOfItems==0){g.removeAttribute("transform");return null}if(h){k=h.numberOfItems;for(var s=[];k--;){v=h.getItem(k);if(v.type===1)s.push([v.matrix,k]);else if(s.length)s=[]}if(s.length===2){k=e.createSVGTransformFromMatrix(fa(s[1][0],s[0][0]));h.removeItem(s[0][1]);h.removeItem(s[1][1]);h.insertItemBefore(k,s[1][1])}k=h.numberOfItems;if(k>=2&&h.getItem(k-2).type===1&&h.getItem(k-1).type===2){s=e.createSVGTransform();v=fa(h.getItem(k-2).matrix,h.getItem(k-1).matrix);s.setMatrix(v);h.removeItem(k- +h.numberOfItems==0){g.removeAttribute("transform");return null}if(h){k=h.numberOfItems;for(var s=[];k--;){v=h.getItem(k);if(v.type===1)s.push([v.matrix,k]);else if(s.length)s=[]}if(s.length===2){k=e.createSVGTransformFromMatrix(ga(s[1][0],s[0][0]));h.removeItem(s[0][1]);h.removeItem(s[1][1]);h.insertItemBefore(k,s[1][1])}k=h.numberOfItems;if(k>=2&&h.getItem(k-2).type===1&&h.getItem(k-1).type===2){s=e.createSVGTransform();v=ga(h.getItem(k-2).matrix,h.getItem(k-1).matrix);s.setMatrix(v);h.removeItem(k- 2);h.removeItem(k-2);h.appendItem(s)}}switch(g.tagName){case "line":case "polyline":case "polygon":case "path":break;default:if(h.numberOfItems===1&&h.getItem(0).type===1||h.numberOfItems===2&&h.getItem(0).type===1&&h.getItem(0).type===4)return null}var E=$(g).data("gsvg");k=new Oa("Transform");var z={},t=null;v=[];switch(g.tagName){case "line":v=["x1","y1","x2","y2"];break;case "circle":v=["cx","cy","r"];break;case "ellipse":v=["cx","cy","rx","ry"];break;case "foreignObject":case "rect":case "image":v= -["width","height","x","y"];break;case "use":case "text":case "tspan":v=["x","y"];break;case "polygon":case "polyline":t={};t.points=g.getAttribute("points");s=g.points;var B=s.numberOfItems;z.points=Array(B);for(var F=0;F1.0E-10?Math.sin(F)/(1-Math.cos(F)):2/F;for(F=0;F=3&&h.getItem(G-2).type==3&&h.getItem(G-3).type==2&&h.getItem(G-1).type==2){F=3;var R=h.getItem(G-3).matrix,W=h.getItem(G-2).matrix,ta=h.getItem(G-1).matrix;B=g.childNodes;for(C=B.length;C--;){var wa=B.item(C);v=E=0;if(wa.nodeType==1){var ga=V(wa);if(ga){v=ha(ga).matrix;E=sa(wa);var ka=Za,pa=[];Za=wa.getAttribute("transform");if(E||ua(ga)){var za=e.createSVGTransform();za.setMatrix(fa(R,W,ta,v));ga.clear();ga.appendItem(za);pa.push(za)}else{E=fa(v.inverse(),ta,v);za=e.createSVGMatrix(); -za.e=-E.e;za.f=-E.f;v=fa(za.inverse(),v.inverse(),R,W,ta,v,E.inverse());var hb=e.createSVGTransform(),Eb=e.createSVGTransform(),Sb=e.createSVGTransform();hb.setTranslate(E.e,E.f);Eb.setScale(v.a,v.d);Sb.setTranslate(za.e,za.f);ga.appendItem(Sb);ga.appendItem(Eb);ga.appendItem(hb);pa.push(Sb);pa.push(Eb);pa.push(hb)}k.addSubCommand(cb(wa));Za=ka}}}h.removeItem(G-1);h.removeItem(G-2);h.removeItem(G-3)}else if(G>=3&&h.getItem(G-1).type==1){F=3;v=ha(h).matrix;za=e.createSVGTransform();za.setMatrix(v); -h.clear();h.appendItem(za)}else if((G==1||G>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){F=2;E=ha(h).matrix;h.removeItem(0);v=ha(h).matrix.inverse();v=fa(v,E);E=v.e;v=v.f;if(E!=0||v!=0){B=g.childNodes;C=B.length;for(G=[];C--;){wa=B.item(C);if(wa.nodeType==1){if(wa.getAttribute("clip-path")){ka=wa.getAttribute("clip-path");if(G.indexOf(ka)===-1){Db(ka,E,v);G.push(ka)}}ka=Za;Za=wa.getAttribute("transform");if(ga=V(wa)){R=e.createSVGTransform();R.setTranslate(E,v);ga.numberOfItems?ga.insertItemBefore(R, -0):ga.appendItem(R);k.addSubCommand(cb(wa));ga=g.getElementsByTagNameNS(c,"use");wa="#"+wa.id;for(R=ga.length;R--;){W=ga.item(R);if(wa==ba(W)){ta=e.createSVGTransform();ta.setTranslate(-E,-v);V(W).insertItemBefore(ta,0);k.addSubCommand(cb(W))}}Za=ka}}}G=[];Za=ka}}else if(G==1&&h.getItem(0).type==1&&!s){F=1;v=h.getItem(0).matrix;B=g.childNodes;for(C=B.length;C--;){wa=B.item(C);if(wa.nodeType==1){ka=Za;Za=wa.getAttribute("transform");if(ga=V(wa)){E=fa(v,ha(ga).matrix);G=e.createSVGTransform();G.setMatrix(E); -ga.clear();ga.appendItem(G,0);k.addSubCommand(cb(wa));Za=ka;ka=wa.getAttribute("stroke-width");wa.getAttribute("stroke")!=="none"&&!isNaN(ka)&&wa.setAttribute("stroke-width",ka*((Math.abs(E.a)+Math.abs(E.d))/2))}}}h.clear()}else{if(s){D=e.createSVGTransform();D.setRotate(s,H.x,H.y);h.numberOfItems?h.insertItemBefore(D,0):h.appendItem(D)}h.numberOfItems==0&&g.removeAttribute("transform");return null}if(F==2){if(s){H={x:D.x+P.e,y:D.y+P.f};D=e.createSVGTransform();D.setRotate(s,H.x,H.y);h.numberOfItems? -h.insertItemBefore(D,0):h.appendItem(D)}}else if(F==3){v=ha(h).matrix;P=e.createSVGTransform();P.setRotate(s,D.x,D.y);P=P.matrix;D=e.createSVGTransform();D.setRotate(s,H.x,H.y);H=D.matrix.inverse();ka=v.inverse();H=fa(ka,H,P,v);E=H.e;v=H.f;if(E!=0||v!=0){B=g.childNodes;for(C=B.length;C--;){wa=B.item(C);if(wa.nodeType==1){ka=Za;Za=wa.getAttribute("transform");ga=V(wa);R=e.createSVGTransform();R.setTranslate(E,v);ga.numberOfItems?ga.insertItemBefore(R,0):ga.appendItem(R);k.addSubCommand(cb(wa));Za= -ka}}}if(s)h.numberOfItems?h.insertItemBefore(D,0):h.appendItem(D)}}else{s=svgedit.utilities.getBBox(g);if(!s&&g.tagName!="path")return null;v=e.createSVGMatrix();if(E=sa(g)){D={x:s.x+s.width/2,y:s.y+s.height/2};H=O(s.x+s.width/2,s.y+s.height/2,ha(h).matrix);F=E*Math.PI/180;B=Math.abs(F)>1.0E-10?Math.sin(F)/(1-Math.cos(F)):2/F;for(F=0;F=3&&h.getItem(G-2).type==3&&h.getItem(G-3).type==2&&h.getItem(G-1).type==2){F=3;v=ha(h,G-3,G-1).matrix;h.removeItem(G-1);h.removeItem(G-2);h.removeItem(G-3)}else if(G==4&&h.getItem(G-1).type==1){F=3;v=ha(h).matrix; -za=e.createSVGTransform();za.setMatrix(v);h.clear();h.appendItem(za);v=e.createSVGMatrix()}else if((G==1||G>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){F=2;P=h.getItem(0).matrix;ka=ha(h,1).matrix;s=ka.inverse();v=fa(s,P,ka);h.removeItem(0)}else if(G==1&&h.getItem(0).type==1&&!E){v=ha(h).matrix;switch(g.tagName){case "line":z=$(g).attr(["x1","y1","x2","y2"]);case "polyline":case "polygon":z.points=g.getAttribute("points");if(z.points){s=g.points;B=s.numberOfItems;z.points=Array(B);for(F=0;F1.0E-10?Math.sin(F)/(1-Math.cos(F)):2/F;for(F=0;F=3&&h.getItem(G-2).type==3&&h.getItem(G-3).type==2&&h.getItem(G-1).type==2){F=3;var Q=h.getItem(G-3).matrix,W=h.getItem(G-2).matrix,ua=h.getItem(G-1).matrix;C=g.childNodes;for(B=C.length;B--;){var wa=C.item(B);v=E=0;if(wa.nodeType==1){var fa=V(wa);if(fa){v=ha(fa).matrix;E=sa(wa);var ka=Za,qa=[];Za=wa.getAttribute("transform");if(E||ta(fa)){var za=e.createSVGTransform();za.setMatrix(ga(Q,W,ua,v));fa.clear();fa.appendItem(za);qa.push(za)}else{E=ga(v.inverse(),ua,v);za=e.createSVGMatrix(); +za.e=-E.e;za.f=-E.f;v=ga(za.inverse(),v.inverse(),Q,W,ua,v,E.inverse());var jb=e.createSVGTransform(),zb=e.createSVGTransform(),Qb=e.createSVGTransform();jb.setTranslate(E.e,E.f);zb.setScale(v.a,v.d);Qb.setTranslate(za.e,za.f);fa.appendItem(Qb);fa.appendItem(zb);fa.appendItem(jb);qa.push(Qb);qa.push(zb);qa.push(jb)}k.addSubCommand(cb(wa));Za=ka}}}h.removeItem(G-1);h.removeItem(G-2);h.removeItem(G-3)}else if(G>=3&&h.getItem(G-1).type==1){F=3;v=ha(h).matrix;za=e.createSVGTransform();za.setMatrix(v); +h.clear();h.appendItem(za)}else if((G==1||G>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){F=2;E=ha(h).matrix;h.removeItem(0);v=ha(h).matrix.inverse();v=ga(v,E);E=v.e;v=v.f;if(E!=0||v!=0){C=g.childNodes;B=C.length;for(G=[];B--;){wa=C.item(B);if(wa.nodeType==1){if(wa.getAttribute("clip-path")){ka=wa.getAttribute("clip-path");if(G.indexOf(ka)===-1){Db(ka,E,v);G.push(ka)}}ka=Za;Za=wa.getAttribute("transform");if(fa=V(wa)){Q=e.createSVGTransform();Q.setTranslate(E,v);fa.numberOfItems?fa.insertItemBefore(Q, +0):fa.appendItem(Q);k.addSubCommand(cb(wa));fa=g.getElementsByTagNameNS(c,"use");wa="#"+wa.id;for(Q=fa.length;Q--;){W=fa.item(Q);if(wa==ba(W)){ua=e.createSVGTransform();ua.setTranslate(-E,-v);V(W).insertItemBefore(ua,0);k.addSubCommand(cb(W))}}Za=ka}}}G=[];Za=ka}}else if(G==1&&h.getItem(0).type==1&&!s){F=1;v=h.getItem(0).matrix;C=g.childNodes;for(B=C.length;B--;){wa=C.item(B);if(wa.nodeType==1){ka=Za;Za=wa.getAttribute("transform");if(fa=V(wa)){E=ga(v,ha(fa).matrix);G=e.createSVGTransform();G.setMatrix(E); +fa.clear();fa.appendItem(G,0);k.addSubCommand(cb(wa));Za=ka;ka=wa.getAttribute("stroke-width");wa.getAttribute("stroke")!=="none"&&!isNaN(ka)&&wa.setAttribute("stroke-width",ka*((Math.abs(E.a)+Math.abs(E.d))/2))}}}h.clear()}else{if(s){D=e.createSVGTransform();D.setRotate(s,H.x,H.y);h.numberOfItems?h.insertItemBefore(D,0):h.appendItem(D)}h.numberOfItems==0&&g.removeAttribute("transform");return null}if(F==2){if(s){H={x:D.x+P.e,y:D.y+P.f};D=e.createSVGTransform();D.setRotate(s,H.x,H.y);h.numberOfItems? +h.insertItemBefore(D,0):h.appendItem(D)}}else if(F==3){v=ha(h).matrix;P=e.createSVGTransform();P.setRotate(s,D.x,D.y);P=P.matrix;D=e.createSVGTransform();D.setRotate(s,H.x,H.y);H=D.matrix.inverse();ka=v.inverse();H=ga(ka,H,P,v);E=H.e;v=H.f;if(E!=0||v!=0){C=g.childNodes;for(B=C.length;B--;){wa=C.item(B);if(wa.nodeType==1){ka=Za;Za=wa.getAttribute("transform");fa=V(wa);Q=e.createSVGTransform();Q.setTranslate(E,v);fa.numberOfItems?fa.insertItemBefore(Q,0):fa.appendItem(Q);k.addSubCommand(cb(wa));Za= +ka}}}if(s)h.numberOfItems?h.insertItemBefore(D,0):h.appendItem(D)}}else{s=svgedit.utilities.getBBox(g);if(!s&&g.tagName!="path")return null;v=e.createSVGMatrix();if(E=sa(g)){D={x:s.x+s.width/2,y:s.y+s.height/2};H=O(s.x+s.width/2,s.y+s.height/2,ha(h).matrix);F=E*Math.PI/180;C=Math.abs(F)>1.0E-10?Math.sin(F)/(1-Math.cos(F)):2/F;for(F=0;F=3&&h.getItem(G-2).type==3&&h.getItem(G-3).type==2&&h.getItem(G-1).type==2){F=3;v=ha(h,G-3,G-1).matrix;h.removeItem(G-1);h.removeItem(G-2);h.removeItem(G-3)}else if(G==4&&h.getItem(G-1).type==1){F=3;v=ha(h).matrix; +za=e.createSVGTransform();za.setMatrix(v);h.clear();h.appendItem(za);v=e.createSVGMatrix()}else if((G==1||G>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){F=2;P=h.getItem(0).matrix;ka=ha(h,1).matrix;s=ka.inverse();v=ga(s,P,ka);h.removeItem(0)}else if(G==1&&h.getItem(0).type==1&&!E){v=ha(h).matrix;switch(g.tagName){case "line":z=$(g).attr(["x1","y1","x2","y2"]);case "polyline":case "polygon":z.points=g.getAttribute("points");if(z.points){s=g.points;C=s.numberOfItems;z.points=Array(C);for(F=0;F1&&s.showGrips(false)}}}K("selected",J);h||J.length==1?Qa.requestSelector(J[0]).showGrips(true):Qa.requestSelector(J[0]).showGrips(false);for(J.sort(function(E,z){if(E&&z&&E.compareDocumentPosition)return 3-(z.compareDocumentPosition(E)&6);else if(E==null)return 1});J[0]== -null;)J.shift(0)}},Qb=this.selectOnly=function(g,h){$a(true);Kb(g,h)};this.removeFromSelection=function(g){if(J[0]!=null)if(g.length!=0){var h=Array(J.length);j=0;len=J.length;for(var k=0;k=0&&g.id!="svgcanvas")for(;g.nodeName!="foreignObject";){g=g.parentNode;if(!g)return e}var h=w().getCurrentLayer();if([e,a,l,h].indexOf(g)>=0)return e;if($(g).closest("#selectorParentGroup").length)return Qa.selectorParentGroup;for(;g.parentNode!==(L||h);)g=g.parentNode;return g};(function(){var g=null,h=null,k=null,v=null,s=null,E={},z={minx:null,miny:null,maxx:null,maxy:null};$(a).mousedown(function(t){if(!(b.spaceKey|| -t.button===1)){var B=t.button===2;t.altKey&&svgCanvas.cloneSelectedElements(0,0);Fb=l.getScreenCTM().inverse();var F=O(t.pageX,t.pageY,Fb),C=F.x*p;F=F.y*p;t.preventDefault();if(B)Ma="select";C=C/p;F=F/p;var D=Zb(t);if(D.tagName==="a"&&D.childNodes.length===1)D=D.firstChild;var H=v=h=C,G=s=k=F;if(m.gridSnapping){C=Ga(C);F=Ga(F);h=Ga(h);k=Ga(k)}if(D==Qa.selectorParentGroup&&J[0]!=null){D=t.target;var P=lb(D,"type");if(P=="rotate"){Ma="rotate";current_rotate_mode=lb(D,"dir")}else if(P=="resize"){Ma= -"resize";mb=lb(D,"dir")}D=J[0]}Za=D.getAttribute("transform");P=V(D);switch(Ma){case "select":Ja=true;mb="none";if(B)Ja=false;if(D!=e){if(J.indexOf(D)==-1){t.shiftKey||$a(true);Kb([D]);Nb=D;Ua.clear()}if(!B)for(B=0;B0&&b.removeFromSelection(D);H.length>0&&Kb(H);break;case "resize":D=V(B);H=(R=ua(D))?E:svgedit.utilities.getBBox(B);G=H.x;W=H.y;var ta=H.width,wa=H.height;H=x-h;P=y-k;if(m.gridSnapping){H=Ga(H);P=Ga(P);wa=Ga(wa);ta=Ga(ta)}var ga=sa(B);if(ga){var ka=Math.sqrt(H*H+P*P);P=Math.atan2(P,H)-ga*Math.PI/180;H=ka*Math.cos(P);P=ka*Math.sin(P)}if(mb.indexOf("n")==-1&&mb.indexOf("s")==-1)P=0;if(mb.indexOf("e")==-1&&mb.indexOf("w")== --1)H=0;var pa=ka=0,za=wa?(wa+P)/wa:1,hb=ta?(ta+H)/ta:1;if(mb.indexOf("n")>=0){za=wa?(wa-P)/wa:1;pa=wa}if(mb.indexOf("w")>=0){hb=ta?(ta-H)/ta:1;ka=ta}H=e.createSVGTransform();P=e.createSVGTransform();ta=e.createSVGTransform();if(m.gridSnapping){G=Ga(G);ka=Ga(ka);W=Ga(W);pa=Ga(pa)}H.setTranslate(-(G+ka),-(W+pa));if(t.shiftKey)if(hb==1)hb=za;else za=hb;P.setScale(hb,za);ta.setTranslate(G+ka,W+pa);if(R){R=ga?1:0;D.replaceItem(H,2+R);D.replaceItem(P,1+R);D.replaceItem(ta,0+R)}else{R=D.numberOfItems;D.replaceItem(ta, -R-3);D.replaceItem(P,R-2);D.replaceItem(H,R-1)}Qa.requestSelector(B).resize();K("transition",J);break;case "zoom":H*=p;G*=p;oa(xa,{x:Math.min(v*p,H),y:Math.min(s*p,G),width:Math.abs(H-v*p),height:Math.abs(G-s*p)},100);break;case "text":oa(D,{x:x,y:y},1E3);break;case "line":H=null;window.opera||e.suspendRedraw(1E3);if(m.gridSnapping){x=Ga(x);y=Ga(y)}G=x;R=y;if(t.shiftKey){R=ca(h,k,G,R);G=R.x;R=R.y}D.setAttributeNS(null,"x2",G);D.setAttributeNS(null,"y2",R);window.opera||e.unsuspendRedraw(H);break; -case "foreignObject":case "square":case "rect":case "image":H=Math.abs(x-h);R=Math.abs(y-k);if(Ma=="square"||t.shiftKey){H=R=Math.max(H,R);G=hk?k+W:k-W}if(t.altKey){R=h;G=k;W=Math.abs(x-R);P=t.shiftKey?W:Math.abs(y-G)}D.setAttributeNS(null,"rx",W);D.setAttributeNS(null,"ry",P);D.setAttributeNS(null,"cx",R);D.setAttributeNS(null,"cy",G);window.opera||e.unsuspendRedraw(H);break;case "fhellipse":case "fhrect":z.minx=Math.min(H,z.minx);z.maxx=Math.max(H, -z.maxx);z.miny=Math.min(G,z.miny);z.maxy=Math.max(G,z.maxy);case "fhpath":g+=+H+","+G+" ";D.setAttributeNS(null,"points",g);break;case "path":case "pathedit":x*=p;y*=p;if(m.gridSnapping){x=Ga(x);y=Ga(y);h=Ga(h);k=Ga(k)}if(t.shiftKey){if(R=svgedit.path.path){D=R.dragging?R.dragging[0]:h;R=R.dragging?R.dragging[1]:k}else{D=h;R=k}R=ca(D,R,x,y);x=R.x;y=R.y}if(xa&&xa.getAttribute("display")!=="none"){H*=p;G*=p;oa(xa,{x:Math.min(v*p,H),y:Math.min(s*p,G),width:Math.abs(H-v*p),height:Math.abs(G-s*p)},100)}Ua.mouseMove(t, -x,y);break;case "textedit":x*=p;y*=p;pb.mouseMove(C,F);break;case "rotate":H=svgedit.utilities.getBBox(B);R=H.x+H.width/2;G=H.y+H.height/2;D=ea(B);D=O(R,G,D);R=D.x;G=D.y;D=H.x;W=H.y;if(current_rotate_mode=="nw")D=H.x+H.width;if(current_rotate_mode=="se")W=H.y+H.height;if(current_rotate_mode=="sw"){D=H.x+H.width;W=H.y+H.height}compensation_angle=(Math.atan2(G-W,R-D)*(180/Math.PI)-90)%360;ga=(Math.atan2(G-y,R-x)*(180/Math.PI)-90)%360;ga+=compensation_angle;if(m.gridSnapping)ga=Ga(ga);if(t.shiftKey)ga= -Math.round(ga/45)*45;b.setRotationAngle(ga<-180?360+ga:ga,true);K("transition",J)}sb("mouseMove",{event:t,mouse_x:C,mouse_y:F,selected:B})}}).click(function(t){t.preventDefault();return false}).dblclick(function(t){var B=t.target.parentNode;if(B!==L){var F=Zb(t),C=F.tagName;if(C==="text"&&Ma!=="textedit"){t=O(t.pageX,t.pageY,Fb);pb.select(F,t.x,t.y)}if((C==="g"||C==="a")&&sa(F)){Xb(F);F=J[0];$a(true)}L&&$b();B.tagName!=="g"&&B.tagName!=="a"||B===w().getCurrentLayer()||F===Qa.selectorParentGroup|| -lc(F)}}).mouseup(function(t){if(t.button!==2){var B=Nb;Nb=null;if(Ja){var F=O(t.pageX,t.pageY,Fb),C=F.x*p;F=F.y*p;var D=C/p,H=F/p,G=la(Y()),P=false;Ja=false;switch(Ma){case "resize":case "multiselect":if(xa!=null){xa.setAttribute("display","none");wb=[]}Ma="select";case "select":if(J[0]!=null){if(J[1]==null){C=J[0];switch(C.tagName){case "g":case "use":case "image":case "foreignObject":break;default:gb.fill=C.getAttribute("fill");gb.fill_opacity=C.getAttribute("fill-opacity");gb.stroke=C.getAttribute("stroke"); -gb.stroke_opacity=C.getAttribute("stroke-opacity");gb.stroke_width=C.getAttribute("stroke-width");gb.stroke_dasharray=C.getAttribute("stroke-dasharray");gb.stroke_linejoin=C.getAttribute("stroke-linejoin");gb.stroke_linecap=C.getAttribute("stroke-linecap")}if(C.tagName=="text"){eb.font_size=C.getAttribute("font-size");eb.font_family=C.getAttribute("font-family")}Qa.requestSelector(C).showGrips(true)}Pa();if(D!=v||H!=s){t=J.length;for(C=0;C=0?B.indexOf(",",D+1)>=0:B.indexOf(" ",B.indexOf(" ")+1)>=0)G=Ua.smoothPolylineIntoPath(G);break;case "line":B=$(G).attr(["x1","x2","y1","y2"]);P=B.x1!=B.x2||B.y1!=B.y2;break;case "foreignObject":case "square":case "rect":case "image":B=$(G).attr(["width","height"]);P=B.width!=0||B.height!=0||Ma==="image";break;case "circle":P=G.getAttribute("r")!=0;break;case "ellipse":B=$(G).attr(["rx","ry"]);P=B.rx!=null||B.ry!=null;break;case "fhellipse":if(z.maxx-z.minx>0&&z.maxy-z.miny>0){G=da({element:"ellipse", -curStyles:true,attr:{cx:(z.minx+z.maxx)/2,cy:(z.miny+z.maxy)/2,rx:(z.maxx-z.minx)/2,ry:(z.maxy-z.miny)/2,id:Y()}});K("changed",[G]);P=true}break;case "fhrect":if(z.maxx-z.minx>0&&z.maxy-z.miny>0){G=da({element:"rect",curStyles:true,attr:{x:z.minx,y:z.miny,width:z.maxx-z.minx,height:z.maxy-z.miny,id:Y()}});K("changed",[G]);P=true}break;case "text":P=true;Qb([G]);pb.start(G);break;case "path":G=null;Ja=true;B=Ua.mouseUp(t,G,C,F);G=B.element;P=B.keep;break;case "pathedit":P=true;G=null;Ua.mouseUp(t); -break;case "textedit":P=false;G=null;pb.mouseUp(t,C,F);break;case "rotate":P=true;G=null;Ma="select";B=b.undoMgr.finishUndoableChange();B.isEmpty()||Ia(B);Pa();K("changed",J)}C=sb("mouseUp",{event:t,mouse_x:C,mouse_y:F},true);$.each(C,function(ta,wa){if(wa){P=wa.keep||P;G=wa.element;Ja=wa.started||Ja}});if(!P&&G!=null){w().releaseId(Y());G.parentNode.removeChild(G);G=null;for(C=t.target;C.parentNode.parentNode.tagName=="g";)C=C.parentNode;if((Ma!="path"||!drawn_path)&&C.parentNode.id!="selectorParentGroup"&& -C.id!="svgcanvas"&&C.id!="svgroot"){b.setMode("select");Qb([C],true)}}else if(G!=null){b.addedNew=true;t=0.2;var R;if(false.beginElement&&G.getAttribute("opacity")!=M.opacity){R=$(false).clone().attr({to:M.opacity,dur:t}).appendTo(G);try{R[0].beginElement()}catch(W){}}else t=0;setTimeout(function(){R&&R.remove();G.setAttribute("opacity",M.opacity);G.setAttribute("style","pointer-events:inherit");Z(G);if(Ma==="path")Ua.toEditMode(G);else m.selectNew&&Qb([G],true);Ia(new Na(G));K("changed",[G])},t* -1E3)}Za=null}}});$(a).bind("mousewheel DOMMouseScroll",function(t){if(t.shiftKey){t.preventDefault();Fb=l.getScreenCTM().inverse();var B=O(t.pageX,t.pageY,Fb);B={x:B.x,y:B.y,width:0,height:0};if(t.wheelDelta)if(t.wheelDelta>=120)B.factor=2;else{if(t.wheelDelta<=-120)B.factor=0.5}else if(t.detail)if(t.detail>0)B.factor=0.5;else if(t.detail<0)B.factor=2;B.factor&&K("zoomed",B)}})})();var Ib=function(g){$(g).click(function(h){h.preventDefault()})},pb=b.textActions=function(){function g(ga){var ka=F.value=== -"";$(F).focus();if(!arguments.length)if(ka)ga=0;else{if(F.selectionEnd!==F.selectionStart)return;ga=F.selectionEnd}var pa;pa=G[ga];ka||F.setSelectionRange(ga,ga);C=la("text_cursor");if(!C){C=document.createElementNS(c,"line");oa(C,{id:"text_cursor",stroke:"#333","stroke-width":1});C=la("selectorParentGroup").appendChild(C)}H||(H=setInterval(function(){var za=C.getAttribute("display")==="none";C.setAttribute("display",za?"inline":"none")},600));ka=E(pa.x,P.y);pa=E(pa.x,P.y+P.height);oa(C,{x1:ka.x, -y1:ka.y,x2:pa.x,y2:pa.y,visibility:"visible",display:"inline"});D&&D.setAttribute("d","")}function h(ga,ka,pa){if(ga===ka)g(ka);else{pa||F.setSelectionRange(ga,ka);D=la("text_selectblock");if(!D){D=document.createElementNS(c,"path");oa(D,{id:"text_selectblock",fill:"green",opacity:0.5,style:"pointer-events:none"});la("selectorParentGroup").appendChild(D)}ga=G[ga];var za=G[ka];C.setAttribute("visibility","hidden");ka=E(ga.x,P.y);pa=E(ga.x+(za.x-ga.x),P.y);var hb=E(ga.x,P.y+P.height);ga=E(ga.x+(za.x- -ga.x),P.y+P.height);oa(D,{d:"M"+ka.x+","+ka.y+" L"+pa.x+","+pa.y+" "+ga.x+","+ga.y+" "+hb.x+","+hb.y+"z",display:"inline"})}}function k(ga,ka){var pa=e.createSVGPoint();pa.x=ga;pa.y=ka;if(G.length==1)return 0;pa=B.getCharNumAtPosition(pa);if(pa<0){pa=G.length-2;if(ga<=G[0].x)pa=0}else if(pa>=G.length-2)pa=G.length-2;var za=G[pa];ga>za.x+za.width/2&&pa++;return pa}function v(ga,ka,pa){var za=F.selectionStart;ga=k(ga,ka);h(Math.min(za,ga),Math.max(za,ga),!pa)}function s(ga,ka){var pa={x:ga,y:ka};pa.x/= -p;pa.y/=p;if(R){var za=O(pa.x,pa.y,R.inverse());pa.x=za.x;pa.y=za.y}return pa}function E(ga,ka){var pa={x:ga,y:ka};if(R){var za=O(pa.x,pa.y,R);pa.x=za.x;pa.y=za.y}pa.x*=p;pa.y*=p;return pa}function z(ga){h(0,B.textContent.length);$(this).unbind(ga)}function t(ga){if(wa&&B){var ka=O(ga.pageX,ga.pageY,Fb);ka=s(ka.x*p,ka.y*p);ka=k(ka.x,ka.y);var pa=B.textContent,za=pa.substr(0,ka).replace(/[a-z0-9]+$/i,"").length;pa=pa.substr(ka).match(/^[a-z0-9]+/i);h(za,(pa?pa[0].length:0)+ka);$(ga.target).click(z); -setTimeout(function(){$(ga.target).unbind("click",z)},300)}}var B,F,C,D,H,G=[],P,R,W,ta,wa;return{select:function(ga,ka,pa){B=ga;pb.toEditMode(ka,pa)},start:function(ga){B=ga;pb.toEditMode()},mouseDown:function(ga,ka,pa,za){ga=s(pa,za);F.focus();g(k(ga.x,ga.y));W=pa;ta=za},mouseMove:function(ga,ka){var pa=s(ga,ka);v(pa.x,pa.y)},mouseUp:function(ga,ka,pa){var za=s(ka,pa);v(za.x,za.y,true);ga.target!==B&&kaW-2&&pata-2&&pb.toSelectMode(true)},setCursor:g,toEditMode:function(ga,ka){wa= -false;Ma="textedit";Qa.requestSelector(B).showGrips(false);Qa.requestSelector(B);pb.init();$(B).css("cursor","text");if(arguments.length){var pa=s(ga,ka);g(k(pa.x,pa.y))}else g();setTimeout(function(){wa=true},300)},toSelectMode:function(ga){Ma="select";clearInterval(H);H=null;D&&$(D).attr("display","none");C&&$(C).attr("visibility","hidden");$(B).css("cursor","move");if(ga){$a();$(B).css("cursor","move");K("selected",[B]);Kb([B],true)}B&&!B.textContent.length&&b.deleteSelectedElements();$(F).blur(); -B=false},setInputElem:function(ga){F=ga},clear:function(){Ma=="textedit"&&pb.toSelectMode()},init:function(){if(B){if(!B.parentNode){B=J[0];Qa.requestSelector(B).showGrips(false)}var ga=B.textContent.length,ka=B.getAttribute("transform");P=svgedit.utilities.getBBox(B);R=ka?ea(B):null;G=Array(ga);F.focus();$(B).unbind("dblclick",t).dblclick(t);if(!ga)var pa={x:P.x+P.width/2,width:0};for(ka=0;ka=0&&this.selected_pts.push(B)}this.selected_pts.sort();t=this.selected_pts.length;for(z=Array(t);t--;){F=this.segs[this.selected_pts[t]];F.select(true);z[t]=F.ptgrip}Ua.canDeleteNodes=true;Ua.closed_subpath=this.subpathIsClosed(this.selected_pts[0]);K("selected",z)};var s=h=null,E=false;return{mouseDown:function(z,t,B,F){if(Ma==="path"){mouse_x=B;mouse_y=F;F=mouse_x/p;t=mouse_y/p;B=la("path_stretch_line"); -k=[F,t];if(m.gridSnapping){F=Ga(F);t=Ga(t);mouse_x=Ga(mouse_x);mouse_y=Ga(mouse_y)}if(!B){B=document.createElementNS(c,"path");oa(B,{id:"path_stretch_line",stroke:"#22C","stroke-width":"0.5",fill:"none"});B=la("selectorParentGroup").appendChild(B)}B.setAttribute("display","inline");var C=null;if(s){C=s.pathSegList;for(var D=C.numberOfItems,H=6/p,G=false;D;){D--;var P=C.getItem(D),R=P.x;P=P.y;if(F>=R-H&&F<=R+H&&t>=P-H&&t<=P+H){G=true;break}}H=Y();svgedit.path.removePath_(H);H=la(H);R=C.numberOfItems; -if(G){if(D<=1&&R>=2){F=C.getItem(0).x;t=C.getItem(0).y;z=B.pathSegList.getItem(1);z=z.pathSegType===4?s.createSVGPathSegLinetoAbs(F,t):s.createSVGPathSegCurvetoCubicAbs(F,t,z.x1/p,z.y1/p,F,t);F=s.createSVGPathSegClosePath();C.appendItem(z);C.appendItem(F)}else if(R<3)return C=false;$(B).remove();element=H;s=null;Ja=false;if(g){svgedit.path.path.matrix&&nb(H,{},svgedit.path.path.matrix.inverse());B=H.getAttribute("d");z=$(svgedit.path.path.elem).attr("d");$(svgedit.path.path.elem).attr("d",z+B);$(H).remove(); -svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();svgedit.path.path.init();Ua.toEditMode(svgedit.path.path.elem);svgedit.path.path.selectPt();return false}}else{if(!$.contains(a,Zb(z))){console.log("Clicked outside canvas");return false}C=s.pathSegList.numberOfItems;D=s.pathSegList.getItem(C-1);H=D.x;D=D.y;if(z.shiftKey){z=ca(H,D,F,t);F=z.x;t=z.y}z=B.pathSegList.getItem(1);z=z.pathSegType===4?s.createSVGPathSegLinetoAbs(kb(F),kb(t)):s.createSVGPathSegCurvetoCubicAbs(kb(F),kb(t),z.x1/p,z.y1/ -p,z.x2/p,z.y2/p);s.pathSegList.appendItem(z);F*=p;t*=p;B.setAttribute("d",["M",F,t,F,t].join(" "));B=C;if(g)B+=svgedit.path.path.segs.length;svgedit.path.addPointGrip(B,F,t)}}else{d_attr="M"+F+","+t+" ";s=da({element:"path",curStyles:true,attr:{d:d_attr,id:na(),opacity:M.opacity/2}});B.setAttribute("d",["M",mouse_x,mouse_y,mouse_x,mouse_y].join(" "));B=g?svgedit.path.path.segs.length:0;svgedit.path.addPointGrip(B,mouse_x,mouse_y)}}else if(svgedit.path.path){svgedit.path.path.storeD();H=z.target.id; -if(H.substr(0,14)=="pathpointgrip_"){t=svgedit.path.path.cur_pt=parseInt(H.substr(14));svgedit.path.path.dragging=[B,F];C=svgedit.path.path.segs[t];if(z.shiftKey)C.selected?svgedit.path.path.removePtFromSelection(t):svgedit.path.path.addPtsToSelection(t);else{if(svgedit.path.path.selected_pts.length<=1||!C.selected)svgedit.path.path.clearSelection();svgedit.path.path.addPtsToSelection(t)}}else if(H.indexOf("ctrlpointgrip_")==0){svgedit.path.path.dragging=[B,F];z=H.split("_")[1].split("c");t=z[0]- -0;svgedit.path.path.selectPt(t,z[1]-0)}if(!svgedit.path.path.dragging){if(xa==null)xa=Qa.getRubberBandBox();oa(xa,{x:B*p,y:F*p,width:0,height:0,display:"inline"},100)}}},mouseMove:function(z,t,B){E=true;if(Ma==="path"){if(s){var F=s.pathSegList;z=F.numberOfItems-1;if(k){var C=svgedit.path.addCtrlGrip("1c1"),D=svgedit.path.addCtrlGrip("0c2");D.getAttribute("cx");D.getAttribute("cy");C.setAttribute("cx",t);C.setAttribute("cy",B);C.setAttribute("display","inline");C=k[0];var H=k[1];F.getItem(z);var G= -C+(C-t/p),P=H+(H-B/p);D.setAttribute("cx",G*p);D.setAttribute("cy",P*p);D.setAttribute("display","inline");D=svgedit.path.getCtrlLine(1);var R=svgedit.path.getCtrlLine(2);oa(D,{x1:t,y1:B,x2:C*p,y2:H*p,display:"inline"});oa(R,{x1:G*p,y1:P*p,x2:C*p,y2:H*p,display:"inline"});if(z===0)v=[t,B];else{F=F.getItem(z-1);t=F.x;B=F.y;if(F.pathSegType===6){t+=t-F.x2;B+=B-F.y2}else if(v){t=v[0]/p;B=v[1]/p}svgedit.path.replacePathSeg(6,z,[C,H,t,B,G,P],s)}}else if(C=la("path_stretch_line")){z=F.getItem(z);if(z.pathSegType=== -6)svgedit.path.replacePathSeg(6,1,[t,B,(z.x+(z.x-z.x2))*p,(z.y+(z.y-z.y2))*p,t,B],C);else v?svgedit.path.replacePathSeg(6,1,[t,B,v[0],v[1],t,B],C):svgedit.path.replacePathSeg(4,1,[t,B],C)}}}else if(svgedit.path.path.dragging){C=svgedit.path.getPointFromGrip({x:svgedit.path.path.dragging[0],y:svgedit.path.path.dragging[1]},svgedit.path.path);H=svgedit.path.getPointFromGrip({x:t,y:B},svgedit.path.path);z=H.x-C.x;C=H.y-C.y;svgedit.path.path.dragging=[t,B];svgedit.path.path.dragctrl?svgedit.path.path.moveCtrl(z, -C):svgedit.path.path.movePts(z,C)}else{svgedit.path.path.selected_pts=[];svgedit.path.path.eachSeg(function(){if(this.next||this.prev){var W=xa.getBBox(),ta=svgedit.path.getGripPt(this);W=svgedit.math.rectsIntersect(W,{x:ta.x,y:ta.y,width:0,height:0});this.select(W);W&&svgedit.path.path.selected_pts.push(this.index)}})}},mouseUp:function(z,t){if(Ma==="path"){k=null;if(!s){t=la(Y());Ja=false;v=null}return{keep:true,element:t}}if(svgedit.path.path.dragging){var B=svgedit.path.path.cur_pt;svgedit.path.path.dragging= -false;svgedit.path.path.dragctrl=false;svgedit.path.path.update();E&&svgedit.path.path.endChanges("Move path point(s)");!z.shiftKey&&!E&&svgedit.path.path.selectPt(B)}else if(xa&&xa.getAttribute("display")!="none"){xa.setAttribute("display","none");xa.getAttribute("width")<=2&&xa.getAttribute("height")<=2&&Ua.toSelectMode(z.target)}else Ua.toSelectMode(z.target);E=false},toEditMode:function(z){svgedit.path.path=svgedit.path.getPath_(z);Ma="pathedit";$a();svgedit.path.path.show(true).update();svgedit.path.path.oldbbox= -svgedit.utilities.getBBox(svgedit.path.path.elem);g=false},toSelectMode:function(z){var t=z==svgedit.path.path.elem;Ma="select";svgedit.path.path.show(false);h=false;$a();svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();if(t){K("selected",[z]);Kb([z],true)}},addSubPath:function(z){if(z){Ma="path";g=true}else{Ua.clear(true);Ua.toEditMode(svgedit.path.path.elem)}},select:function(z){if(h===z){Ua.toEditMode(z);Ma="pathedit"}else h=z},reorient:function(){var z=J[0];if(z)if(sa(z)!=0){var t=new Oa("Reorient path"), -B={d:z.getAttribute("d"),transform:z.getAttribute("transform")};t.addSubCommand(new Wa(z,B));$a();this.resetOrientation(z);Ia(t);svgedit.path.getPath_(z).show(false).matrix=null;this.clear();Kb([z],true);K("changed",J)}},clear:function(){h=null;if(s){var z=la(Y());$(la("path_stretch_line")).remove();$(z).remove();$(la("pathpointgrip_container")).find("*").attr("display","none");s=v=null;Ja=false}else Ma=="pathedit"&&this.toSelectMode();svgedit.path.path&&svgedit.path.path.init().show(false)},resetOrientation:function(z){if(z== -null||z.nodeName!="path")return false;var t=V(z),B=ha(t).matrix;t.clear();z.removeAttribute("transform");t=z.pathSegList;for(var F=t.numberOfItems,C=0;C0){H=F.getItem(C-1).pathSegType;if(H===2){D(C-1,1);B();break}else if(H=== -1&&F.numberOfItems-1===C){D(C,1);B();break}}}return false};B();if(svgedit.path.path.elem.pathSegList.numberOfItems<=1){Ua.toSelectMode(svgedit.path.path.elem);b.deleteSelectedElements()}else{svgedit.path.path.init();svgedit.path.path.clearSelection();if(window.opera){z=$(svgedit.path.path.elem);z.attr("d",z.attr("d"))}svgedit.path.path.endChanges("Delete path node(s)")}}},smoothPolylineIntoPath:function(z){var t=z.points,B=t.numberOfItems;if(B>=4){var F=t.getItem(0),C=null;z=[];z.push(["M",F.x,",", -F.y," C"].join(""));for(var D=1;D<=B-4;D+=3){var H=t.getItem(D),G=t.getItem(D+1),P=t.getItem(D+2);if(C)if((F=svgedit.path.smoothControlPoints(C,H,F))&&F.length==2){H=z[z.length-1].split(",");H[2]=F[0].x;H[3]=F[0].y;z[z.length-1]=H.join(",");H=F[1]}z.push([H.x,H.y,G.x,G.y,P.x,P.y].join(","));F=P;C=G}for(z.push("L");D0;);Ua.clear(true);$.each(l.childNodes,function(k,v){k&&v.nodeType===8&&v.data.indexOf("Created with")>=0&&l.insertBefore(v,l.firstChild)});if(L){$b();Qb([L])}var g=[];$(l).find("g:data(gsvg)").each(function(){for(var k=this.attributes,v=k.length,s=0;s=0;B--){t=z.item(B); -D=v(t.nodeValue);if(!(H.indexOf(t.localName)>=0))if(D!="")if(D.indexOf("pointer-events")!==0)if(!(t.localName==="class"&&D.indexOf("se_")===0)){k.push(" ");if(t.localName==="d")D=Ua.convertPath(g,true);if(isNaN(D)){if(E.test(D))D=svgedit.units.shortFloat(D)+s}else D=svgedit.units.shortFloat(D);if(ob.apply&&g.nodeName==="image"&&t.localName==="href"&&ob.images&&ob.images==="embed"){var G=Ya[D];if(G)D=G}if(!t.namespaceURI||t.namespaceURI==c||Aa[t.namespaceURI]){k.push(t.nodeName);k.push('="');k.push(D); -k.push('"')}}}}if(g.hasChildNodes()){k.push(">");h++;z=false;for(B=0;B");break;case 8:k.push("\n");k.push(Array(h+1).join(" "));k.push(" + + + + + + + diff --git a/method-draw/extensions/shapelib.png b/method-draw/extensions/shapelib.png new file mode 100644 index 0000000000000000000000000000000000000000..3f62167ea1168705b6e8b8440c8b97f581f65eb7 GIT binary patch literal 373 zcmV-*0gC>KP)5)&`^p%T*9fBqIkk}RLmL={I9)=$9B zQ^6W&1Kp>9rAl21boe%`0jSX9Jk(t%ENurIcQMmd#BmpMTyfnA!wJ%8QM?~eMXSfe z*0^Ji6)qB5Lvv^WwfBs$ccd|CGu9^7i%_OE(rT1`U@TDS`p?LAITZK-l6?Ug1hj!% zX=DLipuXtKZqGf+3i8=!p~;j(Hgzbh8Unj8UO(2Fg}x*a0@{yTs4yG=w^7m|SdsH + + + + + + + diff --git a/method-draw/images/align-bottom.png b/method-draw/images/align-bottom.png index be5dfe54dcdbbe2f3c23e6ce9d24f97986672ad0..a2243beff97be2b6ea973e453783fa213b4c1f98 100644 GIT binary patch delta 229 zcmZ3?^p#PuGr-TCmrII^fq{Y7)59eQNK1n-2OE&=z49e=qM}qi*J}m_uGfrB-Mmpi zQJE6gh?3y^w370~qErUQl>DSr1-Hzi)bjkI>|zDyVAH~_kIjJUL_q4Ci&7IyGV}8k zLNaqx8I1Lf^$m@-X6e)c<^4Tf978-h-(EY&#ULQydeQpR|NVb*rnVePsw&TXc*Vqv z;Zg8Y@su++tT$CX?3*!%-(Ty!L~m^7w%*&)WkL50rHs>bB-#4yS5BJ1vY?{(tEt8r W9$ib;@*_aA89ZJ6T-G@yGywpZB~Hcw delta 275 zcmey$xR^gcyqV(DCY@~pS7I?ZihFJ6_|M~ylo>`ZH zyXWH7>mMKezhD38hKQk&@m?M6RTC6WKloq&zjONZu*A?SH}AGxby~#J)~Ic+x8Osm z36F>A)UBDOGK8PkNzopr01O&ykpKVy diff --git a/method-draw/images/align-bottom.svg b/method-draw/images/align-bottom.svg index 36f8efe..a2d2802 100644 --- a/method-draw/images/align-bottom.svg +++ b/method-draw/images/align-bottom.svg @@ -1,277 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/method-draw/images/align-center.png b/method-draw/images/align-center.png index d1f0c5bcb02a3725c8cd843461cecba94666d044..41b9f986fab313657962c0411162e500d833a29e 100644 GIT binary patch delta 229 zcmX@e{FPC$Gr-TCmrII^fq{Y7)59eQNK1n-2OE&=z49e=qM}qi*J}m_uGfrB-Mmpi zQJE6gh?3y^w370~qErUQl>DSr1-Hzi)bjkI>|zDyVAH~_kIjJUL_q4Ci&7IyGV}8k zLNaqx8I1K!^bL(P_KF+_%KLk|IEHw1zMbsJ$DqK$-2MOm=6kUoITM)6-la}jCehHR zA~kcfk7R3#wW7qg>?Ldl8}F=*UYw#h=h_dI@8!Mb{O|6q0`Xt0R4qN!nd delta 435 zcmV;k0Zjh&0l@&r&LmoGxtYUCs{x2#BDj@^b-*(U`S>8 z9)L@g<(zf^fJa0|p?BAPr(EsmwWHSv)z2B`+cgaL&rJg+9oYb>>hsYJswTNTU|4qh(vac6lBV zS!vU?DGI|(r?3od914xg(`nP?B2U*Uh5zIgGBS3)R%OYv(WYzDL$AxA@K4DT75N6> dYPqwt08$0RT`@#EQ2+n{2>?k&PDHLkV1kdXwRQji diff --git a/method-draw/images/align-center.svg b/method-draw/images/align-center.svg index ddf49fc..13dbcdb 100644 --- a/method-draw/images/align-center.svg +++ b/method-draw/images/align-center.svg @@ -1,252 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/method-draw/images/align-left.png b/method-draw/images/align-left.png index 41fa8bcc17f7cd052820fe2db5a80c1432e1940c..4d80d3e70655cbface158fb581a9860e176ac822 100644 GIT binary patch literal 246 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i1|)m0d4nJ zaJ>d$#-?uGD4?KBiEBhjaDG}zd16s2gJVj5QmTSmW>IQ+eo=O@f^)EG;nv4yKy@M@ zbVWbAo-U3d9-YZ42?;;WJE$LESt|K5Q!@6z zhpj!VoxWLnCeGQ=mT%A(#yB5jrB;V`|$sNJzG|S7#kZ~TYde%Q^p1cSN{F}JiRfhfi-r)=G|}Y z4W%S!&WxKT8tNgCTTq!P8mRZ`O`fp&$)n+UF$x(g`q~&BO?`Mwn4Hfih!q{`zw_jn zLr#%$hJmy=J9Ceo{@Ns&KZ$={-{xnN@Xa}=JVp8BxyqIzl}O9}88Vi$KC=~q#5Ss$ pzj|t;CibkIhll5Ez$`5WhOF1QQ`QQl>;^iX!PC{xWt~$(69CSQZSMd8 diff --git a/method-draw/images/align-left.svg b/method-draw/images/align-left.svg index b1a24a5..7cd364f 100644 --- a/method-draw/images/align-left.svg +++ b/method-draw/images/align-left.svg @@ -1,235 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/method-draw/images/align-middle.png b/method-draw/images/align-middle.png index f72bbb7995c57a8fbfadfa761886089aa98994fe..79b3ffd4a79fb8d308fea51e6280d979ece82dcf 100644 GIT binary patch delta 239 zcmX@j{GU;=Gr-TCmrII^fq{Y7)59eQNK1n-2OE&=z49e=qM}qi*J}m_uGfrB-Mmpi zQJE6gh?3y^w370~qErUQl>DSr1-Hzi)bjkI>|zDyVAH~_kIjJUL_q4Ci&7IyGV}8k zLNaqx8I1K!^bL(P_KF+_%13&-IEHw1zMbO8bwGiKMg7wM`pVyoywlwHS6B12G$u}F zII?U@>;i6W*VCVi?b$x(y*zj2hv!9~8q;5g5*l`T)hP!xvW`_WZxQ)4)AOe_plL&9G`;1?252n5L}S%O^{OOPlC$vgs!AtAw_ z2AM#DqfF7Mt?j*t<(9x&dfTLee^<39PoC4B+@2CCCGrT(#R`C{i_^1{cNvIk6hs(x z4iAnNGl^v&s&=a#33Yp&$c9>CmEp_a$9=uFmev_9PKxfxQj2v*mRhWmG_u@|TW(@9 z*k-T750*T$1nc4xPkRdxyk5d4)eXbH-85 zn!Iu4F9Sfg*O3+gwtoxuYhHIX8+NNr61kOc?*E;N%pXY74oNL0j5=}Kjxg$E7VGZi nIdRrC87tO(Mct6Rex_e{6XlDR4>d4D00000NkvXXu0mjfARe}$ diff --git a/method-draw/images/align-middle.svg b/method-draw/images/align-middle.svg index d2b42e6..519fb23 100644 --- a/method-draw/images/align-middle.svg +++ b/method-draw/images/align-middle.svg @@ -1,250 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/method-draw/images/align-right.png b/method-draw/images/align-right.png index 5ca99caa455df3ed511472b3cfccb2e0c232b645..232cbf70d57864c9b70b2dea91a401c1fda272c6 100644 GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i1|)m0d4nJ zaJ>d$#-?uGD4?KBiEBhjaDG}zd16s2gJVj5QmTSmW>IQ+eo=O@f^)EG;nv4yKy@M@ zbVWc*o-U3d9-VKe8FDcw@GuL1{2$*p*`m{R z>4GQErZo#WaXNS`O7T!J^u6{oJk0#NgzOZzfB$S3r-t9~P2TayW0#}cw6#n^>y}Ec p(>{G@&83Pzl{?q1b5^N4!pk~S*pz8q%0Zwd44$rjF6*2UngBErQ+EIW literal 339 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=f!eQwFr$;k>><~mw*_NBlZtMt0v!C*qnU#3zO2MCp)jWZctk) z$|B#=uVa7c_a|mglfq3NB1W8Ikt$r13N8k035jJW))i$4Y2N<(>rAiTY7ZWs-Yev@ z^zX@vtS^raXQc7fsoAGpyK0f4xu4za)sFkpHF5KJcPP&}owj||*Si;{R93zTRAc;n zL;2)1>urW_az(F8Gdzg%yMAp$)U&IGZ}R8OtyF7^oSB|{T(& eB_Yz!hQZ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/method-draw/images/align-top.png b/method-draw/images/align-top.png index 51bfc2ecd20e83881f17ea0da27730343e70ae4c..df59a3a9a44ae26ea36ca13aeb7b82d138a2700d 100644 GIT binary patch delta 227 zcmbQw^qEnyGr-TCmrII^fq{Y7)59eQNK1n-2OE&=z49e=qM}qi*J}m_uGfrB-Mmpi zQJE6gh?3y^w370~qErUQl>DSr1-Hzi)bjkI>|zDyVAH~_kIjJUL_q4Ci&7IyGV}8k zLNaqx8I1Lf^$m@-X6e)c<$XO}978-h-(C&mVh|8;y=cAZzplOZ3?a9RyXP-j{8NFU zaAS~<&?E*COHQ$yH|OrneO1+Nly+vu#;;YI;yzjYw{}Z*KUMc?(m&b78^3R0JTA+p Uu|r1A2xu~cr>mdKI;Vst08hY8v;Y7A delta 271 zcmey&IG;(eGr-TCmrII^fq{Y7)59eQNQ;3m2OE$)vL(lQqM}qi?{%Q;bw($R*%d%h z$r9IylHmNblJdl&REF~Ma=pyF?Be9af>gcyqV(DCY@~pS=6Jd|hFJ6_|M~ylo>`aS zaVyI+_W%F>OjTbpp|`ua5eOb$-!9L>o0^nZcVf}w{JkBGjSHtGsV{1BH7Pbc{Qv)d z$$$UaYK)K;D1-c>De)5JO(eeUg>hsoLJdR~NJOOZnJ0N1nL4VsWBFY_sId znQ>)h+dCgmQoj9Q(;_a;q$|98Pb`jKr66)!McOAPN0?h8Gjt{sgO+|yoMvoB6VRay Mp00i_>zopr06zO~{Qv*} diff --git a/method-draw/images/align-top.svg b/method-draw/images/align-top.svg index f314f32..8fa76ea 100644 --- a/method-draw/images/align-top.svg +++ b/method-draw/images/align-top.svg @@ -1,233 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/method-draw/images/ellipse.png b/method-draw/images/ellipse.png index 1402a2d8d39d8998fd569aa9681f97c77366e44d..003dd2414df5a0e7f511bc8d566e7f4fb9aa3365 100644 GIT binary patch literal 370 zcmV-&0ge8NP)#s zI__urGrI~La{?6>yP|N<2^E&$qj1FA>-sEXyRlhS!hZPyqsp$ffDFn^c16GkPyBk1 zpu7$;xxU9XL*0L2CuoBRcKf936{EXys4<`XOcAo?ydq&+68~?1Qr`j$0BXcjZ9n#9 Q0000007*qoM6N<$f;%OY8~^|S literal 811 zcmV+`1JwM9P)Px%7+cvCL6PNW+mBWf z75)RYX%j@WX&FI_b`fMu(gn%x*rH+zbR2u95p`zX>$yEGX4E2zBHH~-s;Wz7K?1%MC$Oixd5*b$Gnb?!;j z!gfLsf)EIR3xM-Q2?V~g2OQvnFk8gF?K@ZO-MOn7M9uRhssVr?2z0qrlD^}p<;&}U zAOMsGlv>nMetTBBl7&)$k^lhdI?{C<6Tremg#f@XjF0Jb`a?Q>pAZgf3Iqe^REaQ{ zk8&~cplYvVK@@O?S`)V)KlJZBdXNP$`Aw6H#p0NdV#BArm56WNTv)q0R!6oMV&BzX z%{P2ONC?JElO|^hQ-fEp)W6AOZUQ(DKrc7|0N?kA#c5jKle-h)b@dIZCE8?$Yt68BU6Cskcy4ZnJsNwhF5S59On%P41#kgC`gd2!!Rn)N p0A&DfRc8SV130#{ZI|%(@dXqN&!vsi4dDO)002ovPDHLkV1i?{d=vlx diff --git a/method-draw/images/ellipse.svg b/method-draw/images/ellipse.svg new file mode 100644 index 0000000..d2a60ea --- /dev/null +++ b/method-draw/images/ellipse.svg @@ -0,0 +1,8 @@ + + + + + + diff --git a/method-draw/images/eye.png b/method-draw/images/eye.png index 564a1a9714ff37aee1c8758109113e434eff7862..9cf312e780bc3b569a8d6575892231d27851693d 100644 GIT binary patch literal 468 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i1|)m0d4nJ za0`Jjzn8s8fokmInKbqsORb87~;|ScIw64!wLdz_G|XF^S%xzTA$w4{qNQ(wpb^vE1Ijz3H!#+IxcIDf37W`@nnJtkTqgeSPM%GUJ^BP3+6sp6+<{M5@kZ?H0dsiDaD% zrUyFTYO?&8w(aznyDXFcsQ+lc9I-1sp0!@<^rpAwcQ*&Ib{ZESV1LbJ#Fdh?_pUCx zmd8r7vYhvKb;TA6Dlv+zN((3%-r_<{9l!c`*#IS+a2+h#{d|z44$rjF6*2U FngIWmwax$l literal 750 zcmVWW=I5Rl}zuENrQ28Pt;CX(qKOcDU|M8F&Z%jVGSZA7t& zSX&s1bi|{*v*DgAz3ST9+K6Us3~0Q9*~BWe6PID=&0x|wWdf!IWgI(}6lv9v-FpSS zw1U9OL{Ex%ACuJL>=wxTZg0 zEf8`!jsrze5UvA~SqG-HeEY!{P)iC{?3#nq?S616TB~hnMW{0-6j9tLvf?&u+XiC{ z?O_E0jiYQZlqIojGL$5a1qk9N)mlxpmZq1W6gHT`ec`8K>j$jl3}`WfukS z{=!u2#P1a^U!H8Xl5T`7??NT1t zUc_pqB=&-xQ}oxwg~5^6HaUDuDLGXE;y3!@QP_pOFSc-kKKIu gX8xa5{%_a#2W_ovs9z>%07*qoM6N<$f|edvg8%>k diff --git a/method-draw/images/eye.svg b/method-draw/images/eye.svg new file mode 100644 index 0000000..7221582 --- /dev/null +++ b/method-draw/images/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/method-draw/images/image.png b/method-draw/images/image.png index 10f46719da836d4c5b4fbf39d247a7b510290073..cb907936dc678e3718f09df25308380c31fd9d06 100644 GIT binary patch literal 376 zcmV-;0f+vHP);Wj0C`}*> zK&~X9W&_X{ia=TsYAM;4ErbRKzIfdTB7o{X;IfQ`2#XFNC7wVaz7NC#Sk&bM;~bQ# z4S?8zT%W;%59;bf9O^)poCo6h literal 900 zcmV-~1AF|5P)l3YA1 zcv*r6gX9!Uh#>2Abwwj?7GsPi>YB`iJ!CUGe|x*Co`>maXEJD%Yi{_f~gJi>3G9@kg}P)Q>?)e3Fnm4dnN|5VOWW3#MapL3|hBvbJo>r$ztJN)v7ln>;n1Kkt*3aX- zaQ@^uJc`*$X;g}$lBEa{aL$oAhqXdzCfGGIF}f1(=(TUrYIiVEf~G@ddL9${aj*y& z6Bohpow~v9d2E)_>umGXWBZ6E%1o6t^&7QODYVwiR%icHr`g)tqEw1`>BZ-mnTj#S zuy)}BS_g*;@Uu_u<@-yQ@7xX z5x)Ftg=^O~s9nGQ;o^~_hXF$G{qfVEo_^ + + + + + + + + diff --git a/method-draw/images/italic.png b/method-draw/images/italic.png index 63485dea91b2c292b034a71dde338d09f7d875fe..82f9607b2b35848e0849d7642bfc6b014690b992 100644 GIT binary patch literal 438 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i1|)m0d4nJ za0`Jjzn8s8fokmInKbqDB$Vh7~;`+cG^YWLk2u9@q+&ku-$Cv zJHU~1fUD;Khb*I6LJN@hmd(KNCkJba>y`ADBc6dzSDZV#FZ&XgM8`t*s0D1-?k!O? z=u7K8HaT2ybq;F`_w0Wi8j+zhX2+z9DKOobUGdttC&O$)>8%G>y7f)C6>lB;uRfdm z{k?|M$tC&cnKyjadnEYX$IO{C{JB)~^cz6VmNfiqQjx9fPNho@ literal 2972 zcmV;N3uE+&P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0002TNklG4$Ig)bruz25LEZ1|Ji#7+&}#-dkp|x78wEK SOrUlE0000 \ No newline at end of file diff --git a/method-draw/images/line.png b/method-draw/images/line.png index 37975742e22eae6365ee19d06b3d042a75819f23..39318a18b89495179807e1b16d331d13e3bb9441 100644 GIT binary patch literal 302 zcmV+}0nz@6P)|L-{`OPY^nrjzPg93{IEfeU0%#UXe@9n08V1R^Gani5xt+!=WlIpZVv9E zUQspe`9~s8*=(wc`P3RRdKOaV%KXN)X-dUr4{Za)Vljh=hKT4*kH@3!z)*~0(cR?r zB9$Zjy7X6>aw!SSz|!ouI-ADGHUI!55{Yk!=sFSgSLT?xXm>a!2D<|J&xX(8=cymC zwyJNQzb*-KWdZr@O#*OnCxxY>8Zr!HLJ08*Gp}yVJ>1zDZEk9MC?n<4SMQ#6B@!#n zJMZs-+uIJ)WF&r>%yO|X%=>r>E&zC|G9C(rVso>z%yOPN`2}CS_+0kE<44l2dZ%&7 zdrwxg+Lr;inHkjpjQ~~vw3K3jK;SmN-(Ofy%`@Nln)&)`%vbu@xa?!^VXO;9TmW#m z>@C{On0Xn%IRI~zV(D~xjoG+-?8KwS;F))5=BFQl>@|#h`kR?tMU+kMXXeGNL#l02 z2OtiheM_v(VzC&ZPrv;{WC679_?lMPA`9R&fX$CjRn?PiZEZ=H>!2u_ z+Ei@G46YMG%sjW#fcHi+^H!*TX%I#4q`Tzg`07*qoM6N<$f|bzYlK=n! diff --git a/method-draw/images/logo.png b/method-draw/images/logo.png index 7c04931c3429ea744666949a0be7c11d3ebb57f1..04cfda5dd5f5427cc587083430c74dc9b3d52700 100644 GIT binary patch delta 218 zcmV<0044vAANK(viBL{Q4GJ0x0000DNk~Le0000G0000G2nGNE03Y-JVUZyxe*l?D zL_t(|+MLr(3VF-b&0RCwCVSqXGhRkq!)>eW1CCV_+` zG9*l57!+6x2?(nZ8jy%$14^sVGPJg?9#*gZ{-v#dvFujCwnhI3QBVOv2AQJWcH0ez z5sVB5WQ>pj2oN&WT=ibn-}hA|sfgMrLA`6;RMi{zIrp4>_PLQQW((p+I1+);V1%rf z;r6=QPVjg*9EMJ()6RQ*o_6Ne3lsR>AQy=>jLuz?nY#KOsasCU) zGXd!tKvg49nI1ic9s&Yq9j7(!y)u3zBf!}Uc&ZODpT;EwiM0tRy#y>L@OMLB16KEA z054X<4?ItxkLj(>l*FEcQl&LGPe!}FG~ieOy)OL0>d_u|+wiJ7#Fnf9QwPha#}@&c@GBf`x*BJo+y zRAl!pL~>RioUbf*X87HAGLI_G0f%*Q&-|f0FBANVW_mTPZ)f!W>k=g9F;&fBghGBO z;UEG5H@x0@r1uzvvG*;8Bcq3D5b#!y1B)m_Da06wD1I%JL`W%W5Fs^y z?t{leC+Uy`+^_qdz}v}8>j-{I_hGPbZW$I!&guC17MgZgg%na_tdTTEx@LWzB zqSmt%A4g*FCHODB4`0XzNhKRO?5H2u3ynEx2KQ=LGNA(#`p8p>n zODLe{Co}j7-b~r1HW2&?f-eJ_H}Y~NDp#2>I=zDYl$VfcDWN324d?W|U{ymn_WCC1 z_I?DW$%h1AOrdv4?%-qBa69s_)P34RMNP}+2c z&@!Q@J$CgB`Xs!J-hAMu7XbHO?exyIq|jQR!TDXpoX|s2?PJI^o6Q3x=#2iL{|Hsm zaYk$+sck#oJ-9z}bkq~P(0&UA{DdfY6KPYW--5#Plx6OB2waT<54Qntojk6xWN+jO z?%xT)I`8x6T@1WN!*^Aq6mkZ;&G9%t=LLho6yXw^)#hWYFF)CExgm?-3+@C)2=Eqi zruDWMc$OXYLKJ-PAmF0sBWe_Q3t(Y@+6F#E>e|4>KUAtM(7QZ5orhie*d_nbfEI6S zvQdDS^+--kS;DUi2_F6X_lL=3#DRl{EOI#fa2Cs`EltAE-|#*MIn(r$Ht@>%D0m+e zwsA9mhuV8P-UuQLvS_^hC(6z;?cH1Hpc(8PJy+Ea#ALIMVUj0AUpTDR7>&j{gTZ(s zk1tRZ1y4TpB<_3Q=a4C*x0Sq$MGJn3G!~mqg@Yh>%jQFvv_|s0kqT3x01lpH$Pi6E z!zQS-dAen)G4OPCfHAV3#qQWaZGkq?mV2l?y|}7|hTshb!+5jF{0F0K91xC#&Fl@% zMk3)?MO*Cm`K6JCBQbyByw+Q$PM(C|)-9-Au>x7ebLf3Cw4X?f^n9>}hzP!!;Ohup zQNP;rN))`GLTMe>_|##|o^?$3*`{d6iLWsr5|14=i|r1J*}BH-^%@fs6JfDfaPi`W z9KBxtqro8igMlCt5)!U>kp1(ca3(sDF={weR!Y5067^RzWC*^A343u{6ukQNVdEpS zzD2hA;+WQAzIhgSfSwOZ-$dCaqXp4vrW&*)na!3ZUa!wM@uw5(Yrh(-0PD+(+s4kAa%43;-f$AZvjT zKRr<+yyV5Ti-9x8v_q>Z*egi?0la1aJ&Tqp%f_KfNa>oL-4!pq_yY3t^O2gGihF0@ zgIV{?LQ_+-7V~wN>TvY)HUrLV*`l?PImHvB%P26(Ifz_l9Gns0!);){44!s*NKR|% z`RY@QG~gAQ{eXCcbTviOY%(D_%`nP_WYOz($?Srpq{Ma?-f`z0=+r5VjfGD$LQE~} z!eM-|ZXJ?Rl8`at7B(V&jUFR%8bYblX-~R_svYQ-?;LIh`P!F&v!{W}!2dFD9~5Ru zS6lTxUJt}{d)#0_I%T3UhszJ+(@#Hbcj15m1$b@Mt8h3RY%IK5b1z2ykt4Wp@F4Q0 zPJk^Vo%&sk?O6GsCJu$KU>Q{Fjm!gqHoAYJ#XPH$i)^#@Ww2pqiU2P%Q|5F1!rw-q zF$YW#Q|!d4VRbJ_cf0WNocrfu>5EHISy|b7@#rz5v1;`yh~)P9qPsMe@4Tahb_pp& z6+3q^!y;jYHq=5fXTm+`8F=&VN7%+PM^b=Ik9raFO9{M+1^`QT0}n;MLyM><>$Dat z(&aFEwyV)#yt$#iLE5ps1pj#d9~d!mIK!utc3Eyt4h9Sy2uFewx!Kt$d-PFMUbuio zeuaiPG5qG6p!z&ef*yoJG);9wGD=X=dZR(t0~Mcz@X6aX*u6=ChcUy*dFG$MZ$v9_{8Z)NP#OteHM?t|& z+Qqky9ix5L?ca~a&pyNPaIw2O_t62Ies2$|b{&Gx zDz>UKcOH z!KB_Hc9B_Ivc`-<;ndr4!?(`@!tB^%i+Ls2TPMnDB z+iyot0yn0mee+B8`Y-iB*I)n>cPA5e+Lm{=qIlXJ7&dIEcA~tz95ppH&@%@_R{Q)u zq^GB2$dDmWyk1=R_+#`T;O@o6$Q(Ty_L!%SojipTrKPZ#EL`@8My<&tgCRqQMDylM zC6+B)u1OQVd*3y8f$6CkiOhq)QQzMpiqz=QB8gRe@Xrs>(9ob6Kw*cB&KX(~kGXXW z!t}boz8=<$j4K{^`0!!O{Mjs&A1;T(>R{4^sjYXz=lc-(Hxn>!C1-rmr9 zEQ_lq3}3wDIZf62{Q=>q9(>n(fso%N-rEsVR{4h^ukoxwmIw38bd$w|S5_>?a2B5U zap=%zm^EXTrjKm4HZEqnDS8FWe{cam!}?HyoDt&K!ubnPvZJKk zxy;N=>ZuVB&*tdap_^zShL4ycP8pkxLg&}k*22~7YIot9)oW2vQ30FXrg>X5_ANvF zrWDbP5H07**RFJMw5n_T@9Ibc^d^HzV+lcbY}^~!+{|X;*{Z6lwAdG0DLc09z_ZUh zr~Ttkc-dmJV8Md<=-j1q%O)4LZ`+P~QmYVwr%#{eY8uh4dv~&!8-M-Fi&)2|hteTT zTK=6*($$Ln{f?ND*<@+ABS99L&8B{(pwBdRU=F(j!WaRbs}pp)-Ns3iC*cjM)A;ek z(Kq!b}JCmeWDVZjV3c=wkN@u4F+S4&+k3&uqO;K8Vvgdh(%8?!t9^ltHrgb+Vg%f zAI%hWq~m)Vn;YM-S**!)M6P%sbyfu>MYC98QOvHp0Ybl+3{h$nHA1jdFcbg{5tVeg ztdr*mAOqQ%nJs2bdW$6H>g=hjzch~d`)cemsC&0u&M?j8cj%f7o@!175nr4Y z5(W$~64AOMx>N@O2a0?KOnpQ*YzR4=t_>a*B3!$lZk7>>2T}k)fB^uT6D~{AsUS9n P00000NkvXXu0mjfXb^UU delta 830 zcmV-E1Ht^+0@em0iBL{Q4GJ0x0000DNk~Le0000O0000O2nGNE0N{5$_>mzee**YP zL_t(|+T>MVNK;W5KfBGL2%95|=*1FI7!E!51M2gJlni zgfL|<#Y~93%pP)65CjvyoWWpV^m;wp-QB&rxVZQTu@&uQ ztz2_a14xcUMzIt!f+0Y0NinbtSTLL2b}QR?`C;IEe>vQXf<$>jdqDUbE34n~KLhy))S25$7A?gkFD|vkf4u|8TO0A-* zZ&ahorItwGLQXLMsvktYe?e~tRNT+UUR&4T(yo^u{ae+z^Lzh#lqmy)y%$| zW&3*iMh_}9E5YE4!Kp@5Bc?p5OjVy=xda}I$3P?y!E`#^!K&eu~obMtW$4?Ev8ou57s8z8?@1Zvbr*I&&Nr>aLf9NIB!jeL;v%7-@ z0s-AY1hVw&df?eWfG8l&8t)o^wTAc745V)W?f2C!dzJzBg`=GlPQ{@Ld_Lckg-;7- z8tycR6*3~Q1SSEdgA2amW(5ezLh_pHHQb>Jnv6|!U0a>J@=|3+?=w{F=Yb5Q2+%W{ z0N&SLs43PELxV%-e^n~gc7_6*&9+)vR!UcCt5O3*_L~ZcG<_aYTxKqltre^l8H|RY z*XuQ>6l`p4)OX$QdS9+B#~=m)0~x@wtmq-{Io@;P9>shv>zg6i8$)jT|r_5&!@I07*qo IM6N<$f+xm*{{R30 diff --git a/method-draw/images/path.svg b/method-draw/images/path.svg new file mode 100644 index 0000000..11454a8 --- /dev/null +++ b/method-draw/images/path.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/method-draw/images/pencil.png b/method-draw/images/pencil.png index d3f1f6938dd0805eb252dc7f21cecdc8243b6285..789c0edce3a1d4d7d55920cc64755806a48227d9 100644 GIT binary patch literal 409 zcmV;K0cQS*P)#lX?0bL>+i7} z;@k$77R9xXnBaZiM

    sFF0@mx&ovMXI!Z$Miq<@894x_4ruI$dIC^_7&~Z;*a9?M zRV-DRg%*gM_loXm#1e6m*fYByE|hTVa$HKpid(Ciw9!HtCwoGCKr~m@_~`pk8h}m` zm=7g@)(%AX3cq!AurdJU9z+!lnvN^;A*8Dk^*(@7Cs}Q%3bWAO<_2WyLhst>LlX~L zd<(s*jM}uTfVNWqXB&p-Tc4$%5O(01X4^9b5KBOzHeNzMW(g>S9niKC$!|PlkBB)B zRV9g)48=SNG*_dQ&~h>T>t{&!fN1sO)#`KOLx2GQO}&QZ&xBbe00000NkvXXu0mjf D2!y9} literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^!XV7S1|*9D%+3HQmSQK*5Dp-y;YjHK@;M7UB8wRq zxP?HN@zUM8KR`j564!{5;QX|b^2DN42FH~Aq*MjB%%art{G#k)1?OPX!mW?Zfa-R5 zx;Tbd^v=C(&Bd%J!1h2fR$;lvbH$wJY{i>)HmPs?$ka4JZ9`^h;_NNUI$grdSARZS z^2zcsvxCI*JIcpi6rT(55=o0=P|#j_&s3w$>*@p7Yq#|kTUKBDH81GX;fR+fqNs1}oARQq3}^QAD8;V%vtIH6$8QG3*U4*EJ~q1o^aF#ZtDnm{ Hr-UW|myLNy diff --git a/method-draw/images/pencil.svg b/method-draw/images/pencil.svg new file mode 100644 index 0000000..e82a76c --- /dev/null +++ b/method-draw/images/pencil.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/method-draw/images/polygon.png b/method-draw/images/polygon.png index bcd640c2074d1c9df79c47958aaf4ff204667a0f..550ad29e3cb17663ac9ba75be91c9fa5e67d7f89 100644 GIT binary patch literal 422 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i1|)m0d4nJ za0`Jjzn8s8fokmInKbq$l&SX7~;{nciKh4CIg-}d)xbOIeH#| z(5^=17i@ipIQkB7^eqrR!p_C6>J=^Z-#V@;)9#b`k{kxb*!+a~yE11p?qcM#sLq(A z@~M)kbi;RsEu5B%nxx`;)!6TNABa1kd1>L|{_{;+9Yi@_g?_vpR{C)k2j|zb*N&>4 zn3|RyBK+hOW51!!QqD=LN*83i9iFeB>5{^br&;diZRHRim+JZ<)Y9SC&5A8etv`SB z-*DNtscpemZRL5dB_C@aJ9SF&y+l~_;RGu`9kmk^?DwqnjZ}e+%5s)>joh!@BG&5WY1|gE|H@b~cfqovjUQJ5!-~Pv)z4*} HQ$iB}nwg)o literal 881 zcmV-%1CIQOP)F%LDyl2U|j+J%UlE?m}4>B3DH_6LY`;}0lxmyJlNE5Ti}Qt(A-X=xS> z>LMat6j4D4LKPoLObm%O$-Uk@?({o@S8fuU*j5LQcP2CEeBXJ@870m+yUSr>cRVb{ zg(OMM&Oe2eAnP|VE}}z!bZIhP^!4@SdwP1Zm_NI1fRTZL0X3OS^5f%U-rwJ!!*4Hd z3*hz8(2#b1e$MrgPN(_c;9wDZul@&s67qI*bd(p1MP54;Md8E4!=&`)UjS^7U?32v zGh8m0xvHuHRMRv*Ha13z@BRkBW3gC1Oixc&875<;Qb{n+=kxsR>`Vxasi`S$Hk;o= z*WL`^VP|LO>eA9umGMfYA{fiE%yYRM&t|jy^z@V`5(yrQ#l-&n{5&A_ zB82Apy7qSvVDO4XqfrHF-y5}xAK`F#eQRq=ER4nwqAR1uIT(HWj=gSJkH6h+r_fM{ zR-q@8Hys@vtgWrB9-y_gm3cfKhKm*fqYYFAv)ODS3}g(KOw37Wjtj@y+uKWa{<%{ZcR()Q}Go88u!=V{5?$WSg6t3fMn~UN^ko#`$dkolr$p z0Z^~Ori@(3@Fa%T@G%q$bz|+uw&Su1n)Txl6?=-??M@*iGC&Iu86HwA7Yrn07p1D9 zJb;A*ar8mikNE?9?_=8waYC$@$5jYDJZTs_LAc`hCh*OGC;>3M8`r~^%9#7HY00000NkvXX Hu0mjfn% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Draw Rectangle - 2005-10-10 - - - Andreas Nilsson - - - - - draw - rectangle - square - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/method-draw/images/select.png b/method-draw/images/select.png index 1d741f16d9be7873e90807a246fd2a7dc5f6154a..f1f0fa352ffa4f7429285760f91d4fc7bc8bfc42 100644 GIT binary patch literal 344 zcmV-e0jK_nP)dTo=RlH;0}Pw!d^rH=1ira_MPOHSBX z61WPRrk9okx}1pu$tOt)NWO^@Knh8Y1ybk&1|A@t9LB(f9qQz;tw4&Yu23Mw_D%?p zBu)ljpa|>>gcKg1|8n*cAY4-wrVDh1PDx;Zl$Zvn&Q*=_eP&!hJ!F5TyC@6*vmZ0m zK%M1o#56|3*v-KEQgXOP?6$?7%h}9TW{;MOBgmZ#R<6W5EA~iPjSbxWmVD(}P(=PW qYIfB6z+z7j(*}K(D<*V&1Q-D75M1sq7&b}(0000YLhlf0l zewkRNd-@mcB<2V?NMoLO4 zk|YsIDQS$+jIsTBz|3xXRbWI!w6(QG?RHxd5gB8s*XyNH%1@r>6|&i^XWMqBSS&tW zsGCYDlVY)mYPE{ta44jdG6(_?5lW>J!Z3^hJX!iLl2Rs{o0}L62C>%qMHq%(o6Y9+ zRW+Np}ad2?Jj4`j40+dpWG4^pPRuMuZ)5TY- z)i559BLEK;1^`t4J^tn80M!M)Aq%+QXUiX6qehZKKEQAQ00006 diff --git a/method-draw/images/select.svg b/method-draw/images/select.svg new file mode 100644 index 0000000..9c4319d --- /dev/null +++ b/method-draw/images/select.svg @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/method-draw/images/square.png b/method-draw/images/square.png index 0ca71a67fc87ce95185844bb174c72c493e5361d..1fb63b49ccfcad04346405b2b840d67056d837e5 100644 GIT binary patch literal 145 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i1|)m0d}1UAcVy=fNW2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4eSNOS zIZsN@a(UhPn(N4lpU+<>-(vHy4$wH*RsM8dhEDsn{k>;aUwc|Fx_|ANt$R1j?%oIt OQwC30KbLh*2~7Y62&)|c diff --git a/method-draw/images/svg_edit_icons.svg b/method-draw/images/svg_edit_icons.svg index a06cde3..2815533 100644 --- a/method-draw/images/svg_edit_icons.svg +++ b/method-draw/images/svg_edit_icons.svg @@ -37,12 +37,10 @@ - + - + @@ -59,17 +57,6 @@ - - - - - - - - - - - - + @@ -139,11 +127,12 @@ - - + + @@ -158,27 +147,29 @@ - - - - - - - - + + + + + + + + + + @@ -242,7 +233,8 @@ x="0px" y="0px" width="27px" height="27px" > - + + @@ -252,13 +244,16 @@ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" x="0px" y="0px" width="27px" height="27px" > - + + - + diff --git a/method-draw/images/text.png b/method-draw/images/text.png index 5652e2fab90e54526c9e68185f81ebeba72cd2aa..4e00c0418a51165db720f14d2ccfa50684c44ed3 100644 GIT binary patch literal 323 zcmV-J0lfZ+P)}6^tC2tg&=HA13l|VfAV7ryL|TLo^g~03U~06dLR4Y%F-kBh0A14n zqywmwHu9lys({rpAg-rkLUcg)9bGf^sAZ#;jaoKp8GS7KKu^mKViCJQiX#{aH040m zJgADl2&{Q0;Ald?N_Tr~br>m@H3BVZAfa*dpHiPaAh8Z3s@;eUC?MCglmdVN0|4r7 VHk!@SoR0ti002ovPDHLkV1m)zc)b7s literal 1032 zcmV+j1o!)iP)5 zmBDWmRUF4Z-@aO;!%~Uh5eflo#9+|Ci33IwJ$cYzq8^k)1858f{tJy44<;ri znt0JafTSjJAjknvR4Jj`hCNK#?smI7JI{IZyv%O4&=!5kH#5JNd_VJj^WMx4=Nvmp z(kGIf@B3Tid7cY`U}0CUbB>)x5Cp5&u3dZn;K75VIp-Y47_MKxp7wgZmz;BdZRf4* z1eJ95(4j+nXJ==*dGjXLTJk){TFc?XhdF-yc;)u(+aCj8Z0GlONqgnoxpTEMusZ+Iw4`v)LreGLj_0TAKi0HJeQ{e3-SCIF1Y8 zgJ*&(mCEHaXU;^+%gbb0hB1cK)zzN0_G{+2X}$n%^q4Dmc~QqtMo5?`F3pQqh!)9G|D#*icl zl74s2tpOB8@lCtk?vH<1larH?q|bH)`@Vnmi8F4kJA)hhGz^H1&z04pmitgNhz>VCh^+S=M;Q517f{wpL+`M&?w zkt0XE8#iuXj6o8;UXNS1ZXxL@aGvK|>RPRaq!%Q;=$!j=_?^FZ^ypFd=+PrOoeq-N z+}tEdk{o!NT8=1+(t5ofm*I%xIOuk}mw-zifaiIi&&|z6i;IgRQ@7jg0v`hL4m!~9 z_k*G+MxHp1E6%x#k|sP!uS`u%J!h?@-EIS5tz|G6RDoZebAug}c%FABP16xL2m-3r zssrBkBwgOOZ(nVFeVs520Z7vn&-4BO`sFc;B*kNjBux}W@qMq?>y3AgIF4gUS0w3< zbM9qHJkd?Q1bzc1fS}xH0S?H4e}D-18Q3%CbCQ--_O{yCyW3ML8oM9XRlop!pf{%R zdIRWe>3NcZGF`Py8jfkAOl(RGfULX@=Ztf%0QeU>cpO_?W*5i+0000 - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - + + + + + + diff --git a/method-draw/images/zoom.png b/method-draw/images/zoom.png index c4fb6f17d28c480bded4224060cad418948e355b..db72e6e0ac422b15ad6a1c55236c97ccf23cf8a3 100644 GIT binary patch literal 483 zcmV<90UZ8`P)B-=%_ z9mya6f$bf2Ja9{X?)&>7D<~Qz6$QD8fu%EH?8r|98C{*JZ$?E!o-Kv71gXV<2CGma zoV?l_>iPd`2+)RgG)N_8eIeH~eHm6!`v-u%qwSvr;XOJD(ACrVmD@0gf%IL+WMeD# z=pw@AGM>~Ie;}+wDC{iuNJk`@p*~uU;f0CxepzsYN|Zq>lZRC=fTfIe}~WTJRs28Wrg@@@8{A_V$CWZq*Ggsl;ZkVExd zE6T<1wq*&NSB$*te8AN6EEtfT16*NW3anOR zQf&w@UFi)H1YAo&8VI=5+1!4!tSMJ>z|FMr7tlTq`wgCl44keivo$Qii)-^M#%VtS Z3;>Oko!Pee=5hc4002ovPDHLkV1kU~)TjUe literal 1197 zcmV;e1XBBnP)TcGaRX^-3#DbHv>mY0zUTGgeakw2WIM@|_vGZf zpXYnN=Q$6<9^=yGi`@Wv0dxXrG?zmFZUgWS4h;Q*rwq0OcnrWWBT-*n+bG=)4bCb@ zSs9=sk<6sSi;J<90Zi+683{j2Va10U1c>A$w&*&e_ls05H6l0J?PfVmBjE-`>{h z4kq-7p^AZsfpY@q1i=ZMj5#L)BZgo?kF>wk=4M>fn>OxJ+*?!EBm)T<)B#DvKm`yH z1m_0WOhB9WNdfYDO+J>GYA`lTcf2_8kQV0SsO2Ubd&a#xJ z(d9JDau>L=23<g<)P$#fb(VlOLhhr*GV@36y7 zg<}gN6jeY~I8;@Esv5~u!NCOw7le*OW$s`&5;LFrF0eng6r@)UmABfgTyV}Ih@f!e z!W2b7RRk=BQwR=Dgi?zlj(P2^%ZmX5;NJ=6zu)@f{@d@od1@moDz@URM zqf&?nU<_7;#JM+WPvkPorIFyjUI6{i)P!8#=K~!_Uv^I|Zcg8iJ_^S&T8a}#okNr# zu2J1b>a493larB9V5SLx<<6bE8H>d-@%_jTUHi37_SM&4b|{K+g$uR5p|M4JJs#&l zN4XsU9wbwlU??1mEXp$M;0`Qm5cii^#&0ppD3w6T2Z{G05|*ow)%so&-C14j8*$b$KLuM5}J*1W{`|P00000 LNkvXXu0mjfimWob diff --git a/method-draw/images/zoom.svg b/method-draw/images/zoom.svg new file mode 100644 index 0000000..8645dce --- /dev/null +++ b/method-draw/images/zoom.svg @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/method-draw/select.js b/method-draw/select.js index cd3311c..f2dac42 100644 --- a/method-draw/select.js +++ b/method-draw/select.js @@ -331,9 +331,11 @@ svgedit.select.SelectorManager.prototype.initGroup = function() { 'element': 'circle', 'attr': { 'id': 'selectorGrip_rotate_' + dir, - 'fill': 'transparent', + 'fill': '#000', 'r': 8, - 'stroke': 'transparent', + 'stroke': '#000', + "fill-opacity": 0, + "stroke-opacity": 0, 'stroke-width': 0, 'style': 'cursor:url(' + config_.imgPath + 'rotate.png) 12 12, auto;' } diff --git a/method-draw/svg-editor.html b/method-draw/svg-editor.html index 873821d..7528dab 100644 --- a/method-draw/svg-editor.html +++ b/method-draw/svg-editor.html @@ -147,6 +147,7 @@ $(function(){

    + @@ -173,7 +174,8 @@ $(function(){ diff --git a/method-draw/svg-editor.js b/method-draw/svg-editor.js index 20a1e8c..f4bee92 100644 --- a/method-draw/svg-editor.js +++ b/method-draw/svg-editor.js @@ -65,7 +65,8 @@ snappingStep: 10, showRulers: true, show_outside_canvas: false, - no_save_warning: true + no_save_warning: true, + initFont: 'Sans-serif' }, uiStrings = Editor.uiStrings = { common: { @@ -2101,7 +2102,6 @@ return false; } var closer = function(e){ - //Method of Action specific to detect when the iframe has focus if (top != self && !e.isTrigger) { if(typeof top.exports.setEditorFocus == 'function') { @@ -2113,10 +2113,14 @@ blinker(e); return; } + else { + $('#menu_bar').removeClass('active') + } if ($("#tools_shapelib").is(":visible") && !$(e.target).parents("#tools_shapelib_show, #tools_shapelib").length) $("#tools_shapelib").hide() if (e.target.nodeName.toLowerCase() != "input") $("input").blur(); } + } @@ -2466,19 +2470,21 @@ var cutSelected = function() { if (selectedElement != null || multiselected) { + if (window.event.type === "keydown") flash($('#edit_menu')); svgCanvas.cutSelectedElements(); } }; var copySelected = function() { if (selectedElement != null || multiselected) { + if (window.event.type === "keydown") flash($('#edit_menu')); svgCanvas.copySelectedElements(); } }; - var pasteInCenter = function() { - var zoom = svgCanvas.getZoom(); - + var pasteSelected = function() { + if (window.event.type === "keydown") flash($('#edit_menu')); + var zoom = svgCanvas.getZoom(); var x = (workarea[0].scrollLeft + workarea.width()/2)/zoom - svgCanvas.contentW; var y = (workarea[0].scrollTop + workarea.height()/2)/zoom - svgCanvas.contentH; svgCanvas.pasteElements('point', x, y); @@ -2486,30 +2492,35 @@ var moveToTopSelected = function() { if (selectedElement != null) { + if (window.event.type === "keydown") flash($('#object_menu')); svgCanvas.moveToTopSelectedElement(); } }; var moveToBottomSelected = function() { if (selectedElement != null) { + if (window.event.type === "keydown") flash($('#object_menu')); svgCanvas.moveToBottomSelectedElement(); } }; var moveUpSelected = function() { if (selectedElement != null) { + if (window.event.type === "keydown") flash($('#object_menu')); svgCanvas.moveUpDownSelected("Up"); } }; var moveDownSelected = function() { if (selectedElement != null) { + if (window.event.type === "keydown") flash($('#object_menu')); svgCanvas.moveUpDownSelected("Down"); } }; var moveUpDownSelected = function(dir) { if (selectedElement != null) { + if (window.event.type === "keydown") flash($('#object_menu')); svgCanvas.moveUpDownSelected(dir); } }; @@ -2548,6 +2559,7 @@ dx *= multi; dy *= multi; } + $('input').blur() svgCanvas.moveSelectedElements(dx,dy); } }; @@ -2765,6 +2777,11 @@ updateWireFrame(); } + var clickCanvasColor = function(){ + svgCanvas.clearSelection(); + $('#tool_canvas').trigger("click") + }; + var minimizeModal = function() { if (window.self != window.top) { //we're in an iframe @@ -3513,10 +3530,12 @@ if (type == "fill") cur = curConfig['initFill']; if (type == "canvas" && background) { var rgb = background.getAttribute("fill").match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); - var hex = ("0" + parseInt(rgb[1],10).toString(16)).slice(-2) + - ("0" + parseInt(rgb[2],10).toString(16)).slice(-2) + - ("0" + parseInt(rgb[3],10).toString(16)).slice(-2); - cur = {color: hex, opacity: 1} + if (rgb) { + var hex = ("0" + parseInt(rgb[1],10).toString(16)).slice(-2) + + ("0" + parseInt(rgb[2],10).toString(16)).slice(-2) + + ("0" + parseInt(rgb[3],10).toString(16)).slice(-2); + cur = {color: hex, opacity: 1} + } } @@ -4111,14 +4130,19 @@ {sel:'#tool_move_down', fn: moveDownSelected, evt:'click', key: [modKey+'down', true]}, {sel:'#tool_topath', fn: convertToPath, evt: 'click'}, {sel:'#tool_make_link,#tool_make_link_multi', fn: makeHyperlink, evt: 'click'}, - {sel:'#tool_undo', fn: clickUndo, evt: 'click'}, - {sel:'#tool_redo', fn: clickRedo, evt: 'click', key: ['Y', true]}, {sel:'#tool_clone,#tool_clone_multi', fn: clickClone, evt: 'click', key: [modKey + 'D', true]}, {sel:'#tool_group', fn: clickGroup, evt: 'click', key: [modKey + 'G', true]}, {sel:'#tool_ungroup', fn: clickGroup, evt: 'click', key: modKey + 'shift+G'}, {sel:'#tool_unlink_use', fn: clickGroup, evt: 'click'}, {sel:'[id^=tool_align]', fn: clickAlign, evt: 'click'}, - {sel:'#tool_switch', fn: clickSwitch, evt: 'click', key: ['X', true]}, + {sel:'#tool_switch', fn: clickSwitch, evt: 'click', key: ['shift+x', true]}, + {sel:'#tool_undo', fn: clickUndo, evt: 'click', key: modKey + 'z'}, + {sel:'#tool_redo', fn: clickRedo, evt: 'click', key: ['y', true]}, + {sel:'#tool_canvas_color_menu', fn: clickCanvasColor, evt: 'click'}, + {sel:'#tool_cut', fn: cutSelected, evt: 'click', key: modKey+'x'}, + {sel:'#tool_copy', fn: copySelected, evt: 'click', key: modKey+'c'}, + {sel:'#tool_paste', fn: pasteSelected, evt: 'click', key: modKey+'v'}, + // these two lines are required to make Opera work properly with the flyout mechanism // {sel:'#tools_rect_show', fn: clickRect, evt: 'click'}, // {sel:'#tools_ellipse_show', fn: clickEllipse, evt: 'click'}, @@ -4156,15 +4180,8 @@ {key: modKey + 'A', fn: function(){svgCanvas.selectAllInCurrentLayer();}}, // Standard shortcuts - {key: modKey + 'z', fn: clickUndo}, {key: modKey + 'shift+z', fn: clickRedo}, - {key: modKey + 'y', fn: clickRedo}, - {key: 'esc', fn: minimizeModal}, - {key: modKey+'x', fn: cutSelected}, - {key: modKey+'c', fn: copySelected}, - {key: modKey+'v', fn: pasteInCenter} - - + {key: 'esc', fn: minimizeModal} ]; // Tooltips not directly associated with a single function diff --git a/method-draw/svgedit.compiled.js b/method-draw/svgedit.compiled.js index d862c5d..fc985e7 100644 --- a/method-draw/svgedit.compiled.js +++ b/method-draw/svgedit.compiled.js @@ -1,30 +1,30 @@ (function(a){function n(f){if(typeof f.data==="string"){var c=f.handler,m=f.data.toLowerCase().split(" ");f.handler=function(o){if(!(this!==o.target&&(/textarea|select/i.test(o.target.nodeName)||o.target.type==="text"))){var b=o.type!=="keypress"&&a.hotkeys.specialKeys[o.which],d=String.fromCharCode(o.which).toLowerCase(),e="",l={};if(o.altKey&&b!=="alt")e+="alt+";if(o.ctrlKey&&b!=="ctrl")e+="ctrl+";if(o.metaKey&&!o.ctrlKey&&b!=="meta")e+="meta+";if(o.shiftKey&&b!=="shift")e+="shift+";if(b)l[e+b]= true;else{l[e+d]=true;l[e+a.hotkeys.shiftNums[d]]=true;if(e==="shift+")l[a.hotkeys.shiftNums[d]]=true}b=0;for(d=m.length;b","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:n}})})(jQuery);(function(a,n){function f(ba){return typeof ba==="string"}function c(ba){var S=e.call(arguments,1);return function(){return ba.apply(this,S.concat(e.call(arguments)))}}function m(ba,S,U,sa,la){var oa;if(sa!==d){S=U.match(ba?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);U=S[3]||"";if(la===2&&f(sa))sa=sa.replace(ba?ea:ca,"");else{oa=p(S[2]);sa=f(sa)?p[ba?fa:O](sa):sa;sa=la===2?sa:la===1?a.extend({},sa,oa):a.extend({},oa,sa);sa=u(sa);if(ba)sa=sa.replace(ra,l)}ba=S[1]+(ba?"#":sa||!S[1]?"?":"")+sa+U}else ba= -S(U!==d?U:n[ua][ha]);return ba}function o(ba,S,U){if(S===d||typeof S==="boolean"){U=S;S=u[ba?fa:O]()}else S=f(S)?S.replace(ba?ea:ca,""):S;return p(S,U)}function b(ba,S,U,sa){if(!f(U)&&typeof U!=="object"){sa=U;U=S;S=d}return this.each(function(){var la=a(this),oa=S||da()[(this.nodeName||"").toLowerCase()]||"",Z=oa&&la.attr(oa)||"";la.attr(oa,u[ba](Z,U,sa))})}var d,e=Array.prototype.slice,l=decodeURIComponent,u=a.param,w,p,L,T=a.bbq=a.bbq||{},M,J,da,V=a.event.special,O="querystring",fa="fragment", -ua="location",ha="href",ca=/^.*\?|#.*$/g,ea=/^.*\#/,ra,qa={};u[O]=c(m,0,function(ba){return ba.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});u[fa]=w=c(m,1,function(ba){return ba.replace(/^[^#]*#?(.*)$/,"$1")});w.noEscape=function(ba){ba=ba||"";ba=a.map(ba.split(""),encodeURIComponent);ra=RegExp(ba.join("|"),"g")};w.noEscape(",/");a.deparam=p=function(ba,S){var U={},sa={"true":true,"false":false,"null":null};a.each(ba.replace(/\+/g," ").split("&"),function(la,oa){var Z=oa.split("="),Aa=l(Z[0]),Ka=U, -Ra=0,Na=Aa.split("]["),Sa=Na.length-1;if(/\[/.test(Na[0])&&/\]$/.test(Na[Sa])){Na[Sa]=Na[Sa].replace(/\]$/,"");Na=Na.shift().split("[").concat(Na);Sa=Na.length-1}else Sa=0;if(Z.length===2){Z=l(Z[1]);if(S)Z=Z&&!isNaN(Z)?+Z:Z==="undefined"?d:sa[Z]!==d?sa[Z]:Z;if(Sa)for(;Ra<=Sa;Ra++){Aa=Na[Ra]===""?Ka.length:Na[Ra];Ka=Ka[Aa]=Ra","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:n}})})(jQuery);(function(a,n){function f(ba){return typeof ba==="string"}function c(ba){var S=e.call(arguments,1);return function(){return ba.apply(this,S.concat(e.call(arguments)))}}function m(ba,S,U,sa,la){var oa;if(sa!==d){S=U.match(ba?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);U=S[3]||"";if(la===2&&f(sa))sa=sa.replace(ba?ea:ca,"");else{oa=p(S[2]);sa=f(sa)?p[ba?ga:O](sa):sa;sa=la===2?sa:la===1?a.extend({},sa,oa):a.extend({},oa,sa);sa=u(sa);if(ba)sa=sa.replace(ra,l)}ba=S[1]+(ba?"#":sa||!S[1]?"?":"")+sa+U}else ba= +S(U!==d?U:n[ta][ha]);return ba}function o(ba,S,U){if(S===d||typeof S==="boolean"){U=S;S=u[ba?ga:O]()}else S=f(S)?S.replace(ba?ea:ca,""):S;return p(S,U)}function b(ba,S,U,sa){if(!f(U)&&typeof U!=="object"){sa=U;U=S;S=d}return this.each(function(){var la=a(this),oa=S||da()[(this.nodeName||"").toLowerCase()]||"",Z=oa&&la.attr(oa)||"";la.attr(oa,u[ba](Z,U,sa))})}var d,e=Array.prototype.slice,l=decodeURIComponent,u=a.param,w,p,L,T=a.bbq=a.bbq||{},M,J,da,V=a.event.special,O="querystring",ga="fragment", +ta="location",ha="href",ca=/^.*\?|#.*$/g,ea=/^.*\#/,ra,pa={};u[O]=c(m,0,function(ba){return ba.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});u[ga]=w=c(m,1,function(ba){return ba.replace(/^[^#]*#?(.*)$/,"$1")});w.noEscape=function(ba){ba=ba||"";ba=a.map(ba.split(""),encodeURIComponent);ra=RegExp(ba.join("|"),"g")};w.noEscape(",/");a.deparam=p=function(ba,S){var U={},sa={"true":true,"false":false,"null":null};a.each(ba.replace(/\+/g," ").split("&"),function(la,oa){var Z=oa.split("="),Aa=l(Z[0]),Ka=U, +Ra=0,Na=Aa.split("]["),Sa=Na.length-1;if(/\[/.test(Na[0])&&/\]$/.test(Na[Sa])){Na[Sa]=Na[Sa].replace(/\]$/,"");Na=Na.shift().split("[").concat(Na);Sa=Na.length-1}else Sa=0;if(Z.length===2){Z=l(Z[1]);if(S)Z=Z&&!isNaN(Z)?+Z:Z==="undefined"?d:sa[Z]!==d?sa[Z]:Z;if(Sa)for(;Ra<=Sa;Ra++){Aa=Na[Ra]===""?Ka.length:Na[Ra];Ka=Ka[Aa]=Ra').hide().insertAfter("body")[0].contentWindow; -J=function(){return c(T.document[b][d])};M=function(da,V){if(da!==V){var O=T.document;O.open().close();O[b].hash="#"+da}};M(c())}}var p={},L,T,M,J;p.start=function(){if(!L){var da=c();M||w();(function V(){var O=c(),fa=J(da);if(O!==da){M(da=O,fa);a(n).trigger("hashchange")}else if(fa!==da)n[b][d]=n[b][d].replace(/#.*/,"")+"#"+fa;L=setTimeout(V,a.hashchangeDelay)})()}};p.stop=function(){if(!T){L&&clearTimeout(L);L=0}};return p}()})(jQuery,this);(function(a){var n={},f;a.svgIcons=function(c,m){function o(ba,S){if(ba!=="ajax"){if(da)return;var U=(T=ha[0].contentDocument)&&T.getElementById("svg_eof");if(!U&&!(S&&U)){V++;if(V<50)setTimeout(o,20);else{d();da=true}return}da=true}L=a(T.firstChild).children();if(m.no_img)setTimeout(function(){J||b()},500);else{U=ua+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";M=a(new Image).attr({src:U,width:0,height:0}).appendTo("body").load(function(){b(true)}).error(function(){b()})}} -function b(ba,S){if(!J){if(m.no_img)ba=false;if(ba){var U=a(document.createElement("div"));U.hide().appendTo("body")}if(S){var sa=m.fallback_path?m.fallback_path:"";a.each(S,function(Sa,Wa){a("#"+Sa);var Oa=a(new Image).attr({"class":"svg_icon",src:sa+Wa,width:w,height:p,alt:"icon"});qa(Oa,Sa)})}else for(var la=L.length,oa=0;oa0&&!ba)Ia=f(Ia,Oa,true);ra(a(this),Ia,Wa)})});if(!S){ba&&U.remove();ha&&ha.remove();M&&M.remove()}m.resize&&a.resizeSvgIcons(m.resize);J=true;m.callback&&m.callback(n)}}function d(){if(c.indexOf(".svgz")!=-1){var ba=c.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg");a.svgIcons(ba,m)}else m.fallback&&b(false,m.fallback)}function e(ba){if(window.btoa)return window.btoa(ba); +J=function(){return c(T.document[b][d])};M=function(da,V){if(da!==V){var O=T.document;O.open().close();O[b].hash="#"+da}};M(c())}}var p={},L,T,M,J;p.start=function(){if(!L){var da=c();M||w();(function V(){var O=c(),ga=J(da);if(O!==da){M(da=O,ga);a(n).trigger("hashchange")}else if(ga!==da)n[b][d]=n[b][d].replace(/#.*/,"")+"#"+ga;L=setTimeout(V,a.hashchangeDelay)})()}};p.stop=function(){if(!T){L&&clearTimeout(L);L=0}};return p}()})(jQuery,this);(function(a){var n={},f;a.svgIcons=function(c,m){function o(ba,S){if(ba!=="ajax"){if(da)return;var U=(T=ha[0].contentDocument)&&T.getElementById("svg_eof");if(!U&&!(S&&U)){V++;if(V<50)setTimeout(o,20);else{d();da=true}return}da=true}L=a(T.firstChild).children();if(m.no_img)setTimeout(function(){J||b()},500);else{U=ta+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";M=a(new Image).attr({src:U,width:0,height:0}).appendTo("body").load(function(){b(true)}).error(function(){b()})}} +function b(ba,S){if(!J){if(m.no_img)ba=false;if(ba){var U=a(document.createElement("div"));U.hide().appendTo("body")}if(S){var sa=m.fallback_path?m.fallback_path:"";a.each(S,function(Sa,Wa){a("#"+Sa);var Oa=a(new Image).attr({"class":"svg_icon",src:sa+Wa,width:w,height:p,alt:"icon"});pa(Oa,Sa)})}else for(var la=L.length,oa=0;oa0&&!ba)Ia=f(Ia,Oa,true);ra(a(this),Ia,Wa)})});if(!S){ba&&U.remove();ha&&ha.remove();M&&M.remove()}m.resize&&a.resizeSvgIcons(m.resize);J=true;m.callback&&m.callback(n)}}function d(){if(c.indexOf(".svgz")!=-1){var ba=c.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg");a.svgIcons(ba,m)}else m.fallback&&b(false,m.fallback)}function e(ba){if(window.btoa)return window.btoa(ba); var S=Array(Math.floor((ba.length+2)/3)*4),U,sa,la,oa,Z,Aa,Ka=0,Ra=0;do{U=ba.charCodeAt(Ka++);sa=ba.charCodeAt(Ka++);la=ba.charCodeAt(Ka++);oa=U>>2;U=(U&3)<<4|sa>>4;Z=(sa&15)<<2|la>>6;Aa=la&63;if(isNaN(sa))Z=Aa=64;else if(isNaN(la))Aa=64;S[Ra++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(oa);S[Ra++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(U);S[Ra++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Z);S[Ra++]= -"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Aa)}while(Ka-1&&O.indexOf("Chrome/");var ua="data:image/svg+xml;charset=utf-8;base64,";if(m.svgz){var ha=a('').appendTo("body").hide();try{T=ha[0].contentDocument;ha.load(o); -o(0,true)}catch(ca){d()}}else{var ea=new DOMParser;a.ajax({url:c,dataType:"string",success:function(ba){if(ba){T=ea.parseFromString(ba,"text/xml");a(function(){o("ajax")})}else a(d)},error:function(ba){if(window.opera)a(function(){d()});else if(ba.responseText){T=ea.parseFromString(ba.responseText,"text/xml");T.childNodes.length||a(d);a(function(){o("ajax")})}else a(d)}})}var ra=function(ba,S,U,sa){fa&&S.css("visibility","hidden");if(m.replace){sa&&S.attr("id",U);(U=ba.attr("class"))&&S.attr("class", -"svg_icon "+U);ba.replaceWith(S)}else ba.append(S);fa&&setTimeout(function(){S.removeAttr("style")},1)},qa=function(ba,S){if(m.id_match===undefined||m.id_match!==false)ra(holder,ba,S,true);n[S]=ba};f=function(ba,S){var U=ba.find("defs");if(!U.length)return ba;U=fa?U.find("*").filter(function(){return!!this.id}):U.find("[id]");var sa=ba[0].getElementsByTagName("*"),la=sa.length;U.each(function(oa){var Z=this.id;a(T).find("#"+Z);this.id=oa="x"+Z+S+oa;Z="url(#"+Z+")";var Aa="url(#"+oa+")";for(oa=0;oa< +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Aa)}while(Ka-1&&O.indexOf("Chrome/");var ta="data:image/svg+xml;charset=utf-8;base64,";if(m.svgz){var ha=a('').appendTo("body").hide();try{T=ha[0].contentDocument;ha.load(o); +o(0,true)}catch(ca){d()}}else{var ea=new DOMParser;a.ajax({url:c,dataType:"string",success:function(ba){if(ba){T=ea.parseFromString(ba,"text/xml");a(function(){o("ajax")})}else a(d)},error:function(ba){if(window.opera)a(function(){d()});else if(ba.responseText){T=ea.parseFromString(ba.responseText,"text/xml");T.childNodes.length||a(d);a(function(){o("ajax")})}else a(d)}})}var ra=function(ba,S,U,sa){ga&&S.css("visibility","hidden");if(m.replace){sa&&S.attr("id",U);(U=ba.attr("class"))&&S.attr("class", +"svg_icon "+U);ba.replaceWith(S)}else ba.append(S);ga&&setTimeout(function(){S.removeAttr("style")},1)},pa=function(ba,S){if(m.id_match===undefined||m.id_match!==false)ra(holder,ba,S,true);n[S]=ba};f=function(ba,S){var U=ba.find("defs");if(!U.length)return ba;U=ga?U.find("*").filter(function(){return!!this.id}):U.find("[id]");var sa=ba[0].getElementsByTagName("*"),la=sa.length;U.each(function(oa){var Z=this.id;a(T).find("#"+Z);this.id=oa="x"+Z+S+oa;Z="url(#"+Z+")";var Aa="url(#"+oa+")";for(oa=0;oa< la;oa++){var Ka=sa[oa];Ka.getAttribute("fill")===Z&&Ka.setAttribute("fill",Aa);Ka.getAttribute("stroke")===Z&&Ka.setAttribute("stroke",Aa);Ka.getAttribute("filter")===Z&&Ka.setAttribute("filter",Aa)}});return ba}};a.getSvgIcon=function(c,m){var o=n[c];if(m&&o)o=f(o,0,true).clone(true);return o};a.resizeSvgIcons=function(c){var m=!a(".svg_icon:first").length;a.each(c,function(o,b){var d=a.isArray(b),e=d?b[0]:b,l=d?b[1]:b;if(m)o=o.replace(/\.svg_icon/g,"svg");a(o).each(function(){this.setAttribute("width", e);this.setAttribute("height",l);if(window.opera&&window.widget){this.parentNode.style.width=e+"px";this.parentNode.style.height=l+"px"}})})}})(jQuery);(function(){function a(c,m,o){c=document.createElementNS(n.svg,c);if(f)for(var b in m)c.setAttribute(b,m[b]);else for(b in m){var d=m[b],e=c[b];if(e&&e.constructor==="SVGLength")e.baseVal.value=d;else c.setAttribute(b,d)}o&&o.appendChild(c);return c}var n={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 f=navigator.userAgent.indexOf("Gecko/")>=0;jQuery.fn.jGraduate=function(c){var m= -arguments;return this.each(function(){function o(ma,Y,na,K,N){var aa=N||a("stop",{"stop-color":Y,"stop-opacity":na,offset:ma},ea);if(N){Y=N.getAttribute("stop-color");na=N.getAttribute("stop-opacity");ma=N.getAttribute("offset")}else ea.appendChild(aa);if(na===null)na=1;N=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+ma*fa)+", 26)"},Cb);var Pa= -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:Y,"fill-opacity":na,transform:"translate("+(10+ma*fa)+", 26)",stroke:"#000","stroke-width":1.5},Cb);$(Pa).mousedown(function(Xa){b(this);Ya=lb;da.mousemove(l).mouseup(d);Ea=Mb.offset();Xa.preventDefault();return false}).data("stop",aa).data("bg",N).dblclick(function(){$("div.jGraduate_LightBox").show();for(var Xa=this,fb=+aa.getAttribute("stop-opacity")|| -1,nb=aa.getAttribute("stop-color")||1,Db=(parseFloat(fb)*255).toString(16);Db.length<2;)Db="0"+Db;Y=nb.substr(1)+Db;$("#"+p+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:w.images.clientPath},color:{active:Y,alphaSupport:true}},function(cb){nb=cb.val("hex")?"#"+cb.val("hex"):"none";fb=cb.val("a")!==null?cb.val("a")/256:1;Xa.setAttribute("fill",nb);Xa.setAttribute("fill-opacity",fb);aa.setAttribute("stop-color", -nb);aa.setAttribute("stop-opacity",fb);$("div.jGraduate_LightBox").hide();$("#"+p+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();$("#"+p+"_jGraduate_stopPicker").hide()})});$(ea).find("stop").each(function(){var Xa=$(this);if(+this.getAttribute("offset")>ma){if(!Y){var fb=this.getAttribute("stop-color"),nb=this.getAttribute("stop-opacity");aa.setAttribute("stop-color",fb);Pa.setAttribute("fill",fb);aa.setAttribute("stop-opacity",nb===null?1:nb);Pa.setAttribute("fill-opacity", -nb===null?1:nb)}Xa.before(aa);return false}});K&&b(Pa);return aa}function b(ma){lb&&lb.setAttribute("stroke","#000");ma.setAttribute("stroke","blue");lb=ma;lb.parentNode.appendChild(lb)}function d(){da.unbind("mousemove",l);if(La.getAttribute("display")!=="none"){La.setAttribute("display","none");var ma=$(lb),Y=ma.data("stop");ma=ma.data("bg");$([lb,Y,ma]).remove()}Ya=null}function e(){var ma=Za?"rotate("+Za+","+Ma+","+mb+") ":"";ob===1&&Ja===1?ea.removeAttribute("gradientTransform"):ea.setAttribute("gradientTransform", -ma+"translate("+-Ma*(ob-1)+","+-mb*(Ja-1)+") scale("+ob+","+Ja+")")}function l(ma){var Y=ma.pageX-Ea.left;ma=ma.pageY-Ea.top;Y=Y<10?10:Y>fa+10?fa+10:Y;var na="translate("+Y+", 26)";if(ma<-60||ma>130){La.setAttribute("display","block");La.setAttribute("transform",na)}else La.setAttribute("display","none");Ya.setAttribute("transform",na);$.data(Ya,"bg").setAttribute("transform",na);$.data(Ya,"stop").setAttribute("offset",(Y-10)/fa);var K=0;$(ea).find("stop").each(function(){var N=this.getAttribute("offset"), +arguments;return this.each(function(){function o(ma,Y,na,K,N){var aa=N||a("stop",{"stop-color":Y,"stop-opacity":na,offset:ma},ea);if(N){Y=N.getAttribute("stop-color");na=N.getAttribute("stop-opacity");ma=N.getAttribute("offset")}else ea.appendChild(aa);if(na===null)na=1;N=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+ma*ga)+", 26)"},Cb);var Pa= +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:Y,"fill-opacity":na,transform:"translate("+(10+ma*ga)+", 26)",stroke:"#000","stroke-width":1.5},Cb);$(Pa).mousedown(function(Xa){b(this);Ya=nb;da.mousemove(l).mouseup(d);Ea=Kb.offset();Xa.preventDefault();return false}).data("stop",aa).data("bg",N).dblclick(function(){$("div.jGraduate_LightBox").show();for(var Xa=this,hb=+aa.getAttribute("stop-opacity")|| +1,pb=aa.getAttribute("stop-color")||1,Db=(parseFloat(hb)*255).toString(16);Db.length<2;)Db="0"+Db;Y=pb.substr(1)+Db;$("#"+p+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:w.images.clientPath},color:{active:Y,alphaSupport:true}},function(cb){pb=cb.val("hex")?"#"+cb.val("hex"):"none";hb=cb.val("a")!==null?cb.val("a")/256:1;Xa.setAttribute("fill",pb);Xa.setAttribute("fill-opacity",hb);aa.setAttribute("stop-color", +pb);aa.setAttribute("stop-opacity",hb);$("div.jGraduate_LightBox").hide();$("#"+p+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();$("#"+p+"_jGraduate_stopPicker").hide()})});$(ea).find("stop").each(function(){var Xa=$(this);if(+this.getAttribute("offset")>ma){if(!Y){var hb=this.getAttribute("stop-color"),pb=this.getAttribute("stop-opacity");aa.setAttribute("stop-color",hb);Pa.setAttribute("fill",hb);aa.setAttribute("stop-opacity",pb===null?1:pb);Pa.setAttribute("fill-opacity", +pb===null?1:pb)}Xa.before(aa);return false}});K&&b(Pa);return aa}function b(ma){nb&&nb.setAttribute("stroke","#000");ma.setAttribute("stroke","blue");nb=ma;nb.parentNode.appendChild(nb)}function d(){da.unbind("mousemove",l);if(La.getAttribute("display")!=="none"){La.setAttribute("display","none");var ma=$(nb),Y=ma.data("stop");ma=ma.data("bg");$([nb,Y,ma]).remove()}Ya=null}function e(){var ma=Za?"rotate("+Za+","+Ma+","+ob+") ":"";qb===1&&Ja===1?ea.removeAttribute("gradientTransform"):ea.setAttribute("gradientTransform", +ma+"translate("+-Ma*(qb-1)+","+-ob*(Ja-1)+") scale("+qb+","+Ja+")")}function l(ma){var Y=ma.pageX-Ea.left;ma=ma.pageY-Ea.top;Y=Y<10?10:Y>ga+10?ga+10:Y;var na="translate("+Y+", 26)";if(ma<-60||ma>130){La.setAttribute("display","block");La.setAttribute("transform",na)}else La.setAttribute("display","none");Ya.setAttribute("transform",na);$.data(Ya,"bg").setAttribute("transform",na);$.data(Ya,"stop").setAttribute("offset",(Y-10)/ga);var K=0;$(ea).find("stop").each(function(){var N=this.getAttribute("offset"), aa=$(this);if(N
  • Solid Color
  • Linear Gradient
  • Radial Gradient
  • ');var V=$(L+"> .jGraduate_colPick"),O=$(L+"> .jGraduate_gradPick");O.html('

    '+w.window.pickerTitle+'


    ');var fa=256,ua=fa-0,ha=fa-0,ca,ea,ra,qa={};$(".jGraduate_SliderBar").width(145);var ba=$("#"+p+"_jGraduate_GradContainer")[0],S=a("svg",{id:p+"_jgraduate_svg",width:fa,height:fa,xmlns:n.svg},ba);ca=ca||u.paint.type;var U=ea=u.paint[ca],sa=u.paint.alpha,la=ca==="solidColor";switch(ca){case "solidColor":case "linearGradient":if(!la){ea.id=p+"_lg_jgraduate_grad"; +p+'_jGraduate_Ok" class="jGraduate_Ok" value="OK"/>');var ga=256,ta=ga-0,ha=ga-0,ca,ea,ra,pa={};$(".jGraduate_SliderBar").width(145);var ba=$("#"+p+"_jGraduate_GradContainer")[0],S=a("svg",{id:p+"_jgraduate_svg",width:ga,height:ga,xmlns:n.svg},ba);ca=ca||u.paint.type;var U=ea=u.paint[ca],sa=u.paint.alpha,la=ca==="solidColor";switch(ca){case "solidColor":case "linearGradient":if(!la){ea.id=p+"_lg_jgraduate_grad"; U=ea=S.appendChild(ea)}a("radialGradient",{id:p+"_rg_jgraduate_grad"},S);if(ca==="linearGradient")break;case "radialGradient":if(!la){ea.id=p+"_rg_jgraduate_grad";U=ea=S.appendChild(ea)}a("linearGradient",{id:p+"_lg_jgraduate_grad"},S)}if(la){U=ea=$("#"+p+"_lg_jgraduate_grad")[0];J=u.paint[ca];o(0,"#"+J,1);var oa=typeof w.newstop;if(oa==="string")switch(w.newstop){case "same":o(1,"#"+J,1);break;case "inverse":oa="";for(var Z=0;Z<6;Z+=2){J.substr(Z,2);var Aa=(255-parseInt(J.substr(Z,2),16)).toString(16); if(Aa.length<2)Aa=0+Aa;oa+=Aa}o(1,"#"+oa,1);break;case "white":o(1,"#ffffff",1);break;case "black":o(1,"#000000",1)}else if(oa==="object")o(1,w.newstop.color||"#"+J,"opac"in w.newstop?w.newstop.opac:1)}J=parseFloat(U.getAttribute("x1")||0);oa=parseFloat(U.getAttribute("y1")||0);Z=parseFloat(U.getAttribute("x2")||1);Aa=parseFloat(U.getAttribute("y2")||0);var Ka=parseFloat(U.getAttribute("cx")||0.5),Ra=parseFloat(U.getAttribute("cy")||0.5),Na=parseFloat(U.getAttribute("fx")||Ka),Sa=parseFloat(U.getAttribute("fy")|| -Ra);ra=a("rect",{id:p+"_jgraduate_rect",x:0,y:0,width:ua,height:ha,fill:"url(#"+p+"_jgraduate_grad)","fill-opacity":sa/100},S);var Wa=$("
    ").attr({"class":"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:oa*fa,left:J*fa}).data("coord","start").appendTo(ba),Oa=Wa.clone().text(2).css({top:Aa*fa,left:Z*fa}).attr("title","End stop").data("coord","end").appendTo(ba),Ia=$("
    ").attr({"class":"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:Ra*fa,left:Ka* -fa}).data("coord","center").appendTo(ba),Qa=Ia.clone().text("F").css({top:Sa*fa,left:Na*fa,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(ba);Qa[0].id=p+"_jGraduate_focusCoord";$(L+" .grad_coord");$.each(["x1","y1","x2","y2","cx","cy","fx","fy"],function(ma,Y){var na=ea.getAttribute(Y),K=isNaN(Y[1]);na||(na=K?"0.5":Y==="x2"?"1.0":"0.0");qa[Y]=$("#"+p+"_jGraduate_"+Y).val(na).change(function(){if(isNaN(parseFloat(this.value))||this.value<0)this.value=0;else if(this.value> -1)this.value=1;if(!(Y[0]==="f"&&!qb))if(K&&ca==="radialGradient"||!K&&ca==="linearGradient")ea.setAttribute(Y,this.value);var N=K?Y[0]==="c"?Ia:Qa:Y[1]==="1"?Wa:Oa,aa=Y.indexOf("x")>=0?"left":"top";N.css(aa,this.value*fa)}).change()});var Ga,Cb,Mb=$("#"+p+"_jGraduate_StopSlider"),lb,ab,Ya,La=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},ab),Ea,ob=1,Ja=1,Za=0,Ma=Ka,mb=Ra;ab=a("svg",{width:"100%",height:45},Mb[0]);ba=a("pattern",{width:16, -height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},ab);a("image",{width:16,height:16},ba).setAttributeNS(n.xlink,"xlink:href",w.images.clientPath+"map-opacity.png");$(ab).click(function(ma){Ea=Mb.offset();if(ma.target.tagName!=="path"){var Y=ma.pageX-Ea.left-8;Y=Y<10?10:Y>fa+10?fa+10:Y;o(Y/fa,0,0,true);ma.stopPropagation()}});$(ab).mouseover(function(){ab.appendChild(La)});Cb=a("g",{},ab);a("line",{x1:10,y1:15,x2:fa+10,y2:15,"stroke-width":2,stroke:"#000"},ab);var zb=O.find(".jGraduate_spreadMethod").change(function(){ea.setAttribute("spreadMethod", -$(this).val())}),eb=null,gb=function(ma){var Y=ma.pageX-wb.left,na=ma.pageY-wb.top;Y=Y<0?0:Y>fa?fa:Y;na=na<0?0:na>fa?fa:na;eb.css("left",Y).css("top",na);Y/=ua;na/=ha;var K=eb.data("coord"),N=ea;switch(K){case "start":qa.x1.val(Y);qa.y1.val(na);N.setAttribute("x1",Y);N.setAttribute("y1",na);break;case "end":qa.x2.val(Y);qa.y2.val(na);N.setAttribute("x2",Y);N.setAttribute("y2",na);break;case "center":qa.cx.val(Y);qa.cy.val(na);N.setAttribute("cx",Y);N.setAttribute("cy",na);Ma=Y;mb=na;e();break;case "focus":qa.fx.val(Y); -qa.fy.val(na);N.setAttribute("fx",Y);N.setAttribute("fy",na);e()}ma.preventDefault()},Nb=function(){eb=null;da.unbind("mousemove",gb).unbind("mouseup",Nb)};Ga=ea.getElementsByTagNameNS(n.svg,"stop");if(xa<2){for(;xa<2;){ea.appendChild(document.createElementNS(n.svg,"stop"));++xa}Ga=ea.getElementsByTagNameNS(n.svg,"stop")}var xa=Ga.length;for(Z=0;Z").attr({"class":"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:oa*ga,left:J*ga}).data("coord","start").appendTo(ba),Oa=Wa.clone().text(2).css({top:Aa*ga,left:Z*ga}).attr("title","End stop").data("coord","end").appendTo(ba),Ia=$("
    ").attr({"class":"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:Ra*ga,left:Ka* +ga}).data("coord","center").appendTo(ba),Qa=Ia.clone().text("F").css({top:Sa*ga,left:Na*ga,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(ba);Qa[0].id=p+"_jGraduate_focusCoord";$(L+" .grad_coord");$.each(["x1","y1","x2","y2","cx","cy","fx","fy"],function(ma,Y){var na=ea.getAttribute(Y),K=isNaN(Y[1]);na||(na=K?"0.5":Y==="x2"?"1.0":"0.0");pa[Y]=$("#"+p+"_jGraduate_"+Y).val(na).change(function(){if(isNaN(parseFloat(this.value))||this.value<0)this.value=0;else if(this.value> +1)this.value=1;if(!(Y[0]==="f"&&!rb))if(K&&ca==="radialGradient"||!K&&ca==="linearGradient")ea.setAttribute(Y,this.value);var N=K?Y[0]==="c"?Ia:Qa:Y[1]==="1"?Wa:Oa,aa=Y.indexOf("x")>=0?"left":"top";N.css(aa,this.value*ga)}).change()});var Ga,Cb,Kb=$("#"+p+"_jGraduate_StopSlider"),nb,ab,Ya,La=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},ab),Ea,qb=1,Ja=1,Za=0,Ma=Ka,ob=Ra;ab=a("svg",{width:"100%",height:45},Kb[0]);ba=a("pattern",{width:16, +height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},ab);a("image",{width:16,height:16},ba).setAttributeNS(n.xlink,"xlink:href",w.images.clientPath+"map-opacity.png");$(ab).click(function(ma){Ea=Kb.offset();if(ma.target.tagName!=="path"){var Y=ma.pageX-Ea.left-8;Y=Y<10?10:Y>ga+10?ga+10:Y;o(Y/ga,0,0,true);ma.stopPropagation()}});$(ab).mouseover(function(){ab.appendChild(La)});Cb=a("g",{},ab);a("line",{x1:10,y1:15,x2:ga+10,y2:15,"stroke-width":2,stroke:"#000"},ab);var xb=O.find(".jGraduate_spreadMethod").change(function(){ea.setAttribute("spreadMethod", +$(this).val())}),fb=null,ib=function(ma){var Y=ma.pageX-ub.left,na=ma.pageY-ub.top;Y=Y<0?0:Y>ga?ga:Y;na=na<0?0:na>ga?ga:na;fb.css("left",Y).css("top",na);Y/=ta;na/=ha;var K=fb.data("coord"),N=ea;switch(K){case "start":pa.x1.val(Y);pa.y1.val(na);N.setAttribute("x1",Y);N.setAttribute("y1",na);break;case "end":pa.x2.val(Y);pa.y2.val(na);N.setAttribute("x2",Y);N.setAttribute("y2",na);break;case "center":pa.cx.val(Y);pa.cy.val(na);N.setAttribute("cx",Y);N.setAttribute("cy",na);Ma=Y;ob=na;e();break;case "focus":pa.fx.val(Y); +pa.fy.val(na);N.setAttribute("fx",Y);N.setAttribute("fy",na);e()}ma.preventDefault()},Lb=function(){fb=null;da.unbind("mousemove",ib).unbind("mouseup",Lb)};Ga=ea.getElementsByTagNameNS(n.svg,"stop");if(xa<2){for(;xa<2;){ea.appendChild(document.createElementNS(n.svg,"stop"));++xa}Ga=ea.getElementsByTagNameNS(n.svg,"stop")}var xa=Ga.length;for(Z=0;Z99.5)K=99.5;if(K>0)Ja=1-K/100;else ob=-(K/100)-1;N=145*((K+100)/2)/100;aa&&e();break;case "angle":Za=K;N=Za/180;N+=0.5;N*=145;aa&&e()}if(N>145)N=145;else if(N<0)N=0;na.css({"margin-left":N-5})}).change()});var Gb=function(ma){var Y=ma.pageX- -kb.offset.left-parseInt(kb.parent.css("border-left-width"));if(Y>145)Y=145;if(Y<=0)Y=0;var na=Y-5;Y/=145;switch(kb.type){case "radius":Y=Math.pow(Y*2,2.5);if(Y>0.98&&Y<1.02)Y=1;if(Y<=0.01)Y=0.01;ea.setAttribute("r",Y);break;case "opacity":u.paint.alpha=parseInt(Y*100);ra.setAttribute("fill-opacity",Y);break;case "ellip":Ja=ob=1;if(Y<0.5){Y/=0.5;ob=Y<=0?0.01:Y}else if(Y>0.5){Y/=0.5;Y=2-Y;Ja=Y<=0?0.01:Y}e();Y-=1;if(Ja===Y+1)Y=Math.abs(Y);break;case "angle":Y-=0.5;Za=Y*=180;e();Y/=100}kb.elem.css({"margin-left":na}); -Y=Math.round(Y*100);kb.input.val(Y);ma.preventDefault()},Hb=function(){da.unbind("mousemove",Gb).unbind("mouseup",Hb);kb=null};for(O=(u.paint.alpha*255/100).toString(16);O.length<2;)O="0"+O;O=O.split(".")[0];J=u.paint.solidColor=="none"?"":u.paint.solidColor+O;la||(J=Ga[0].getAttribute("stop-color"));$.extend($.fn.jPicker.defaults.window,{alphaSupport:true,effects:{type:"show",speed:0}});V.jPicker({window:{title:w.window.pickerTitle},images:{clientPath:w.images.clientPath},color:{active:J,alphaSupport:true}}, -function(ma){u.paint.type="solidColor";u.paint.alpha=ma.val("ahex")?Math.round(ma.val("a")/255*100):100;u.paint.solidColor=ma.val("hex")?ma.val("hex"):"none";u.paint.radialGradient=null;T()},null,function(){M()});var Ob=$(L+" .jGraduate_tabs li");Ob.click(function(){Ob.removeClass("jGraduate_tab_current");$(this).addClass("jGraduate_tab_current");$(L+" > div").hide();var ma=$(this).attr("data-type");$(L+" .jGraduate_gradPick").show();if(ma==="rg"||ma==="lg"){$(".jGraduate_"+ma+"_field").show();$(".jGraduate_"+ -(ma==="lg"?"rg":"lg")+"_field").hide();$("#"+p+"_jgraduate_rect")[0].setAttribute("fill","url(#"+p+"_"+ma+"_jgraduate_grad)");ca=ma==="lg"?"linearGradient":"radialGradient";$("#"+p+"_jGraduate_OpacInput").val(u.paint.alpha).change();var Y=$("#"+p+"_"+ma+"_jgraduate_grad")[0];if(ea!==Y){var na=$(ea).find("stop");$(Y).empty().append(na);ea=Y;Y=zb.val();ea.setAttribute("spreadMethod",Y)}qb=ma==="rg"&&ea.getAttribute("fx")!=null&&!(Ka==Na&&Ra==Sa);$("#"+p+"_jGraduate_focusCoord").toggle(qb);if(qb)$("#"+ -p+"_jGraduate_match_ctr")[0].checked=false}else{$(L+" .jGraduate_gradPick").hide();$(L+" .jGraduate_colPick").show()}});$(L+" > div").hide();Ob.removeClass("jGraduate_tab_current");var Pb;switch(u.paint.type){case "linearGradient":Pb=$(L+" .jGraduate_tab_lingrad");break;case "radialGradient":Pb=$(L+" .jGraduate_tab_radgrad");break;default:Pb=$(L+" .jGraduate_tab_color")}u.show();setTimeout(function(){Pb.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})();$.fn.SpinButton=function(a){function n(f,c){for(var m=f[c],o=document.body;(f=f.offsetParent)&&f!=o;)if(!$.browser.msie||f.currentStyle.position!="relative")m+=f[c];return m}return this.each(function(){this.repeating=false;this.spinCfg={min:a&&!isNaN(parseFloat(a.min))?Number(a.min):null,max:a&&!isNaN(parseFloat(a.max))?Number(a.max):null,step:a&&a.step?Number(a.step):1,stepfunc:a&&a.stepfunc?a.stepfunc:false,page:a&&a.page?Number(a.page):10,upClass:a&&a.upClass?a.upClass:"up",downClass:a&&a.downClass? +0.5)*100},opacity:{handle:"#"+p+"_jGraduate_OpacArrows",input:"#"+p+"_jGraduate_OpacInput",val:u.paint.alpha||100},ellip:{handle:"#"+p+"_jGraduate_EllipArrows",input:"#"+p+"_jGraduate_EllipInput",val:O},angle:{handle:"#"+p+"_jGraduate_AngleArrows",input:"#"+p+"_jGraduate_AngleInput",val:sa}};$.each(O,function(ma,Y){var na=$(Y.handle);na.mousedown(function(K){var N=na.parent();mb={type:ma,elem:na,input:$(Y.input),parent:N,offset:N.offset()};da.mousemove(Gb).mouseup(Hb);K.preventDefault()});$(Y.input).val(Y.val).change(function(){var K= ++this.value,N=0,aa=ca==="radialGradient";switch(ma){case "radius":aa&&ea.setAttribute("r",K/100);N=Math.pow(K/100,0.4)/2*145;break;case "opacity":u.paint.alpha=K;ra.setAttribute("fill-opacity",K/100);N=K*1.45;break;case "ellip":qb=Ja=1;if(K===0){N=72.5;break}if(K>99.5)K=99.5;if(K>0)Ja=1-K/100;else qb=-(K/100)-1;N=145*((K+100)/2)/100;aa&&e();break;case "angle":Za=K;N=Za/180;N+=0.5;N*=145;aa&&e()}if(N>145)N=145;else if(N<0)N=0;na.css({"margin-left":N-5})}).change()});var Gb=function(ma){var Y=ma.pageX- +mb.offset.left-parseInt(mb.parent.css("border-left-width"));if(Y>145)Y=145;if(Y<=0)Y=0;var na=Y-5;Y/=145;switch(mb.type){case "radius":Y=Math.pow(Y*2,2.5);if(Y>0.98&&Y<1.02)Y=1;if(Y<=0.01)Y=0.01;ea.setAttribute("r",Y);break;case "opacity":u.paint.alpha=parseInt(Y*100);ra.setAttribute("fill-opacity",Y);break;case "ellip":Ja=qb=1;if(Y<0.5){Y/=0.5;qb=Y<=0?0.01:Y}else if(Y>0.5){Y/=0.5;Y=2-Y;Ja=Y<=0?0.01:Y}e();Y-=1;if(Ja===Y+1)Y=Math.abs(Y);break;case "angle":Y-=0.5;Za=Y*=180;e();Y/=100}mb.elem.css({"margin-left":na}); +Y=Math.round(Y*100);mb.input.val(Y);ma.preventDefault()},Hb=function(){da.unbind("mousemove",Gb).unbind("mouseup",Hb);mb=null};for(O=(u.paint.alpha*255/100).toString(16);O.length<2;)O="0"+O;O=O.split(".")[0];J=u.paint.solidColor=="none"?"":u.paint.solidColor+O;la||(J=Ga[0].getAttribute("stop-color"));$.extend($.fn.jPicker.defaults.window,{alphaSupport:true,effects:{type:"show",speed:0}});V.jPicker({window:{title:w.window.pickerTitle},images:{clientPath:w.images.clientPath},color:{active:J,alphaSupport:true}}, +function(ma){u.paint.type="solidColor";u.paint.alpha=ma.val("ahex")?Math.round(ma.val("a")/255*100):100;u.paint.solidColor=ma.val("hex")?ma.val("hex"):"none";u.paint.radialGradient=null;T()},null,function(){M()});var Mb=$(L+" .jGraduate_tabs li");Mb.click(function(){Mb.removeClass("jGraduate_tab_current");$(this).addClass("jGraduate_tab_current");$(L+" > div").hide();var ma=$(this).attr("data-type");$(L+" .jGraduate_gradPick").show();if(ma==="rg"||ma==="lg"){$(".jGraduate_"+ma+"_field").show();$(".jGraduate_"+ +(ma==="lg"?"rg":"lg")+"_field").hide();$("#"+p+"_jgraduate_rect")[0].setAttribute("fill","url(#"+p+"_"+ma+"_jgraduate_grad)");ca=ma==="lg"?"linearGradient":"radialGradient";$("#"+p+"_jGraduate_OpacInput").val(u.paint.alpha).change();var Y=$("#"+p+"_"+ma+"_jgraduate_grad")[0];if(ea!==Y){var na=$(ea).find("stop");$(Y).empty().append(na);ea=Y;Y=xb.val();ea.setAttribute("spreadMethod",Y)}rb=ma==="rg"&&ea.getAttribute("fx")!=null&&!(Ka==Na&&Ra==Sa);$("#"+p+"_jGraduate_focusCoord").toggle(rb);if(rb)$("#"+ +p+"_jGraduate_match_ctr")[0].checked=false}else{$(L+" .jGraduate_gradPick").hide();$(L+" .jGraduate_colPick").show()}});$(L+" > div").hide();Mb.removeClass("jGraduate_tab_current");var Nb;switch(u.paint.type){case "linearGradient":Nb=$(L+" .jGraduate_tab_lingrad");break;case "radialGradient":Nb=$(L+" .jGraduate_tab_radgrad");break;default:Nb=$(L+" .jGraduate_tab_color")}u.show();setTimeout(function(){Nb.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})();$.fn.SpinButton=function(a){function n(f,c){for(var m=f[c],o=document.body;(f=f.offsetParent)&&f!=o;)if(!$.browser.msie||f.currentStyle.position!="relative")m+=f[c];return m}return this.each(function(){this.repeating=false;this.spinCfg={min:a&&!isNaN(parseFloat(a.min))?Number(a.min):null,max:a&&!isNaN(parseFloat(a.max))?Number(a.max):null,step:a&&a.step?Number(a.step):1,stepfunc:a&&a.stepfunc?a.stepfunc:false,page:a&&a.page?Number(a.page):10,upClass:a&&a.upClass?a.upClass:"up",downClass:a&&a.downClass? a.downClass:"down",reset:a&&a.reset?a.reset:this.value,delay:a&&a.delay?Number(a.delay):500,interval:a&&a.interval?Number(a.interval):100,_btn_width:20,_direction:null,_delay:null,_repeat:null,callback:a&&a.callback?a.callback:null};this.spinCfg.smallStep=a&&a.smallStep?a.smallStep:this.spinCfg.step/2;this.adjustValue=function(f){f=isNaN(this.value)?this.spinCfg.reset:$.isFunction(this.spinCfg.stepfunc)?this.spinCfg.stepfunc(this,f):Number((Number(this.value)+Number(f)).toFixed(5));if(this.spinCfg.min!== null)f=Math.max(f,this.spinCfg.min);if(this.spinCfg.max!==null)f=Math.min(f,this.spinCfg.max);this.value=f;$.isFunction(this.spinCfg.callback)&&this.spinCfg.callback(this)};$(this).addClass(a&&a.spinClass?a.spinClass:"spin-button").mousemove(function(f){var c=f.pageX||f.x,m=f.pageY||f.y;f=f.target||f.srcElement;var o=svgEditor.tool_scale||1,b=$(f).height()/2;c=c>n(f,"offsetLeft")+f.offsetWidth*o-this.spinCfg._btn_width?m=0,o=n.indexOf("Gecko/")>=0,b=n.indexOf("MSIE")>=0,d=n.indexOf("Chrome/")>=0,e=n.indexOf("Windows")>=0,l=n.indexOf("Macintosh")>= -0,u="ontouchstart"in window,w=!!f.querySelector,p=!!document.evaluate,L=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","path");ua.setAttribute("d","M0,0 10,10");var ha=ua.pathSegList;ua=ua.createSVGPathSegLinetoAbs(5,5);try{ha.replaceItem(ua,0);return true}catch(ca){}return false}(),T=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","path");ua.setAttribute("d","M0,0 10,10");var ha=ua.pathSegList;ua=ua.createSVGPathSegLinetoAbs(5,5);try{ha.insertItemBefore(ua, -0);return true}catch(ca){}return false}(),M=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","svg"),ha=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(ua);ha.setAttribute("x",5);ua.appendChild(ha);var ca=document.createElementNS("http://www.w3.org/2000/svg","text");ca.textContent="a";ha.appendChild(ca);ha=ca.getStartPositionOfChar(0).x;document.documentElement.removeChild(ua);return ha===0}(),J=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg", -"svg");document.documentElement.appendChild(ua);var ha=document.createElementNS("http://www.w3.org/2000/svg","path");ha.setAttribute("d","M0,0 C0,0 10,10 10,0");ua.appendChild(ha);ha=ha.getBBox();document.documentElement.removeChild(ua);return ha.height>4&&ha.height<5}(),da=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(ua);var ha=document.createElementNS("http://www.w3.org/2000/svg","path");ha.setAttribute("d","M0,0 10,0");var ca= -document.createElementNS("http://www.w3.org/2000/svg","path");ca.setAttribute("d","M5,0 15,0");var ea=document.createElementNS("http://www.w3.org/2000/svg","g");ea.appendChild(ha);ea.appendChild(ca);ua.appendChild(ea);ha=ea.getBBox();document.documentElement.removeChild(ua);return ha.width==15}(),V=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","rect");ua.setAttribute("x",0.1);(ua=ua.cloneNode(false).getAttribute("x").indexOf(",")==-1)||$.alert("NOTE: This version of Opera is known to contain bugs in SVG-edit.\n\t\tPlease upgrade to the latest version in which the problems have been fixed."); -return ua}(),O=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","rect");ua.setAttribute("style","vector-effect:non-scaling-stroke");return ua.style.vectorEffect==="non-scaling-stroke"}(),fa=function(){var ua=document.createElementNS("http://www.w3.org/2000/svg","rect").transform.baseVal,ha=f.createSVGTransform();ua.appendItem(ha);return ua.getItem(0)==ha}();svgedit.browser.isOpera=function(){return c};svgedit.browser.isWebkit=function(){return m};svgedit.browser.isGecko=function(){return o}; +0,u="ontouchstart"in window,w=!!f.querySelector,p=!!document.evaluate,L=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","path");ta.setAttribute("d","M0,0 10,10");var ha=ta.pathSegList;ta=ta.createSVGPathSegLinetoAbs(5,5);try{ha.replaceItem(ta,0);return true}catch(ca){}return false}(),T=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","path");ta.setAttribute("d","M0,0 10,10");var ha=ta.pathSegList;ta=ta.createSVGPathSegLinetoAbs(5,5);try{ha.insertItemBefore(ta, +0);return true}catch(ca){}return false}(),M=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","svg"),ha=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(ta);ha.setAttribute("x",5);ta.appendChild(ha);var ca=document.createElementNS("http://www.w3.org/2000/svg","text");ca.textContent="a";ha.appendChild(ca);ha=ca.getStartPositionOfChar(0).x;document.documentElement.removeChild(ta);return ha===0}(),J=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg", +"svg");document.documentElement.appendChild(ta);var ha=document.createElementNS("http://www.w3.org/2000/svg","path");ha.setAttribute("d","M0,0 C0,0 10,10 10,0");ta.appendChild(ha);ha=ha.getBBox();document.documentElement.removeChild(ta);return ha.height>4&&ha.height<5}(),da=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(ta);var ha=document.createElementNS("http://www.w3.org/2000/svg","path");ha.setAttribute("d","M0,0 10,0");var ca= +document.createElementNS("http://www.w3.org/2000/svg","path");ca.setAttribute("d","M5,0 15,0");var ea=document.createElementNS("http://www.w3.org/2000/svg","g");ea.appendChild(ha);ea.appendChild(ca);ta.appendChild(ea);ha=ea.getBBox();document.documentElement.removeChild(ta);return ha.width==15}(),V=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","rect");ta.setAttribute("x",0.1);(ta=ta.cloneNode(false).getAttribute("x").indexOf(",")==-1)||$.alert("NOTE: This version of Opera is known to contain bugs in SVG-edit.\n\t\tPlease upgrade to the latest version in which the problems have been fixed."); +return ta}(),O=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","rect");ta.setAttribute("style","vector-effect:non-scaling-stroke");return ta.style.vectorEffect==="non-scaling-stroke"}(),ga=function(){var ta=document.createElementNS("http://www.w3.org/2000/svg","rect").transform.baseVal,ha=f.createSVGTransform();ta.appendItem(ha);return ta.getItem(0)==ha}();svgedit.browser.isOpera=function(){return c};svgedit.browser.isWebkit=function(){return m};svgedit.browser.isGecko=function(){return o}; svgedit.browser.isIE=function(){return b};svgedit.browser.isChrome=function(){return d};svgedit.browser.isWindows=function(){return e};svgedit.browser.isMac=function(){return l};svgedit.browser.isTouch=function(){return u};svgedit.browser.supportsSelectors=function(){return w};svgedit.browser.supportsXpath=function(){return p};svgedit.browser.supportsPathReplaceItem=function(){return L};svgedit.browser.supportsPathInsertItemBefore=function(){return T};svgedit.browser.supportsPathBBox=function(){return J}; -svgedit.browser.supportsHVLineContainerBBox=function(){return da};svgedit.browser.supportsGoodTextCharPos=function(){return M};svgedit.browser.supportsEditableText=function(){return c};svgedit.browser.supportsGoodDecimals=function(){return V};svgedit.browser.supportsNonScalingStroke=function(){return O};svgedit.browser.supportsNativeTransformLists=function(){return fa}}else window.location="browser-not-supported.html"})();svgedit=svgedit||{}; +svgedit.browser.supportsHVLineContainerBBox=function(){return da};svgedit.browser.supportsGoodTextCharPos=function(){return M};svgedit.browser.supportsEditableText=function(){return c};svgedit.browser.supportsGoodDecimals=function(){return V};svgedit.browser.supportsNonScalingStroke=function(){return O};svgedit.browser.supportsNativeTransformLists=function(){return ga}}else window.location="browser-not-supported.html"})();svgedit=svgedit||{}; (function(){if(!svgedit.transformlist)svgedit.transformlist={};var a=document.createElementNS("http://www.w3.org/2000/svg","svg"),n={};svgedit.transformlist.SVGTransformList=function(f){this._elem=f||null;this._xforms=[];this._update=function(){var c="";a.createSVGMatrix();for(var m=0;m>4;l=(l&15)<<4|w>>2;u=(w&3)<<6|p;d+=String.fromCharCode(e);if(w!=64)d+= new DOMParser:new ActiveXObject("Microsoft.XMLDOM");e.async=false}catch(l){throw Error("XML Parser could not be instantiated");}try{d=e.loadXML?e.loadXML(b)?e:false:e.parseFromString(b,"text/xml")}catch(u){throw Error("Error parsing XML string");}return d};svgedit.utilities.bboxToObj=function(b){return{x:b.x,y:b.y,width:b.width,height:b.height}};svgedit.utilities.walkTree=function(b,d){if(b&&b.nodeType==1){d(b);for(var e=b.childNodes.length;e--;)svgedit.utilities.walkTree(b.childNodes.item(e),d)}}; svgedit.utilities.walkTreePost=function(b,d){if(b&&b.nodeType==1){for(var e=b.childNodes.length;e--;)svgedit.utilities.walkTree(b.childNodes.item(e),d);d(b)}};svgedit.utilities.getUrlFromAttr=function(b){if(b)if(b.indexOf('url("')===0)return b.substring(5,b.indexOf('"',6));else if(b.indexOf("url('")===0)return b.substring(5,b.indexOf("'",6));else if(b.indexOf("url(")===0)return b.substring(4,b.indexOf(")"));return null};svgedit.utilities.getHref=function(b){return b.getAttributeNS("http://www.w3.org/1999/xlink", "href")};svgedit.utilities.setHref=function(b,d){b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d)};svgedit.utilities.findDefs=function(b){b=f.getSVGContent().documentElement;var d=b.getElementsByTagNameNS("http://www.w3.org/2000/svg","defs");return d=d.length>0?d[0]:b.insertBefore(b.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),b.firstChild.nextSibling)};svgedit.utilities.getPathBBox=function(b){var d=b.pathSegList,e=d.numberOfItems;b=[[],[]];var l=d.getItem(0), -u=[l.x,l.y];for(l=0;l element";this.svgElem_=c;this.obj_num=0;this.idPrefix=m||"svg_";this.releasedNums=[];this.all_layers=[];this.current_layer=null;this.nonce_= "";var o=this.svgElem_.getAttributeNS("http://svg-edit.googlecode.com","nonce");if(o&&f!=n.NEVER_RANDOMIZE)this.nonce_=o;else f==n.ALWAYS_RANDOMIZE&&this.setNonce(Math.floor(Math.random()*100001))};svgedit.draw.Drawing.prototype.getElem_=function(c){return this.svgElem_.querySelector?this.svgElem_.querySelector("#"+c):$(this.svgElem_).find("[id="+c+"]")[0]};svgedit.draw.Drawing.prototype.getSvgElem=function(){return this.svgElem_};svgedit.draw.Drawing.prototype.getNonce=function(){return this.nonce_}; @@ -195,325 +196,326 @@ dy-=newcy;r=Math.sqrt(dx*dx+dy*dy);theta=Math.atan2(dy,dx)-angle;return{x:(r*Mat 1;L=w.getItem(p);var T=L.pathSegType;if(T!=1){var M=b(L.x,L.y);M=[M.x,M.y];if(L.x1!=null&&L.x2!=null){c_vals1=b(L.x1,L.y1);c_vals2=b(L.x2,L.y2);M.splice(M.length,0,c_vals1.x,c_vals1.y,c_vals2.x,c_vals2.y)}svgedit.path.replacePathSeg(T,p,M)}}svgedit.utilities.getBBox(d);w=svgroot.createSVGTransform();d=svgedit.transformlist.getTransformList(d);w.setRotate(e*180/Math.PI,u,l);d.replaceItem(w,0)}};svgedit.path.clearData=function(){m={}}})();if(!window.console){window.console={};window.console.log=function(){};window.console.dir=function(){}}if(window.opera){window.console.log=function(a){opera.postError(a)};window.console.dir=function(){}} (function(){var a=jQuery.fn.attr;jQuery.fn.attr=function(n,f){var c=this.length;if(!c)return a.apply(this,arguments);for(var m=0;m').documentElement, +$.SvgCanvas=function(a,n){function f(g,h){for(var k=svgedit.utilities.getBBox(g),v=0;v<2;v++){var s=v===0?"fill":"stroke",E=g.getAttribute(s);if(E&&E.indexOf("url(")===0){E=N(E);if(E.tagName==="linearGradient"){var z=E.getAttribute("x1")||0,t=E.getAttribute("y1")||0,C=E.getAttribute("x2")||1,F=E.getAttribute("y2")||0;z=k.width*z+k.x;t=k.height*t+k.y;C=k.width*C+k.x;F=k.height*F+k.y;z=O(z,t,h);F=O(C,F,h);C={};C.x1=(z.x-k.x)/k.width;C.y1=(z.y-k.y)/k.height;C.x2=(F.x-k.x)/k.width;C.y2=(F.y-k.y)/k.height; +E=E.cloneNode(true);$(E).attr(C);E.id=na();vb().appendChild(E);g.setAttribute(s,"url(#"+E.id+")")}}}}var c="http://www.w3.org/2000/svg",m={show_outside_canvas:true,selectNew:true,dimensions:[640,480]};n&&$.extend(m,n);var o=m.dimensions,b=this,d=a.ownerDocument,e=d.importNode(svgedit.utilities.text2xml('').documentElement, true);a.appendChild(e);var l=d.createElementNS(c,"svg");(b.clearSvgContentElement=function(){for(;l.firstChild;)l.removeChild(l.firstChild);$(l).attr({id:"svgcontent",width:o[0],height:o[1],x:o[0],y:o[1],overflow:m.show_outside_canvas?"visible":"hidden",xmlns:c,"xmlns:se":"http://svg-edit.googlecode.com","xmlns:xlink":"http://www.w3.org/1999/xlink"}).appendTo(e);var g=d.createComment(" Created with Method Draw - http://github.com/duopixel/Method-Draw/ ");l.appendChild(g)})();var u="svg_";b.setIdPrefix= function(g){u=g};b.current_drawing_=new svgedit.draw.Drawing(l,u);var w=b.getCurrentDrawing=function(){return b.current_drawing_},p=1,L=null,T={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}};T.text=$.extend(true,{},T.shape);$.extend(T.text, {fill:"#000000",stroke_width:0,font_size:24,font_family:"Junction"});var M=T.shape,J=Array(1),da=this.addSvgElementFromJson=function(g){var h=svgedit.utilities.getElem(g.attr.id),k=w().getCurrentLayer();if(h&&g.element!=h.tagName){k.removeChild(h);h=null}if(!h){h=d.createElementNS(c,g.element);if(k)(L||k).appendChild(h)}g.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,g.attr,100);svgedit.utilities.cleanupElement(h);return h},V=b.getTransformList=svgedit.transformlist.getTransformList,O=svgedit.math.transformPoint,fa=b.matrixMultiply=svgedit.math.matrixMultiply,ua=b.hasMatrixTransform=svgedit.math.hasMatrixTransform,ha=b.transformListToTransform=svgedit.math.transformListToTransform, -ca=svgedit.math.snapToAngle,ea=svgedit.math.getMatrix;svgedit.units.init({getBaseUnit:function(){return m.baseUnit},getElement:svgedit.utilities.getElem,getHeight:function(){return l.getAttribute("height")/p},getWidth:function(){return l.getAttribute("width")/p},getRoundDigits:function(){return ob.round_digits}});var ra=b.convertToNum=svgedit.units.convertToNum;svgedit.utilities.init({getDOMDocument:function(){return d},getDOMContainer:function(){return a},getSVGRoot:function(){return e},getSelectedElements:function(){return J}, -getSVGContent:function(){return l}});var qa=b.getUrlFromAttr=svgedit.utilities.getUrlFromAttr,ba=b.getHref=svgedit.utilities.getHref,S=b.setHref=svgedit.utilities.setHref,U=svgedit.utilities.getPathBBox;b.getBBox=svgedit.utilities.getBBox;var sa=b.getRotationAngle=svgedit.utilities.getRotationAngle,la=b.getElem=svgedit.utilities.getElem,oa=b.assignAttributes=svgedit.utilities.assignAttributes,Z=this.cleanupElement=svgedit.utilities.cleanupElement,Aa=svgedit.sanitize.getNSMap(),Ka=b.sanitizeSvg=svgedit.sanitize.sanitizeSvg, +"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,g.attr,100);svgedit.utilities.cleanupElement(h);return h},V=b.getTransformList=svgedit.transformlist.getTransformList,O=svgedit.math.transformPoint,ga=b.matrixMultiply=svgedit.math.matrixMultiply,ta=b.hasMatrixTransform=svgedit.math.hasMatrixTransform,ha=b.transformListToTransform=svgedit.math.transformListToTransform, +ca=svgedit.math.snapToAngle,ea=svgedit.math.getMatrix;svgedit.units.init({getBaseUnit:function(){return m.baseUnit},getElement:svgedit.utilities.getElem,getHeight:function(){return l.getAttribute("height")/p},getWidth:function(){return l.getAttribute("width")/p},getRoundDigits:function(){return qb.round_digits}});var ra=b.convertToNum=svgedit.units.convertToNum;svgedit.utilities.init({getDOMDocument:function(){return d},getDOMContainer:function(){return a},getSVGRoot:function(){return e},getSelectedElements:function(){return J}, +getSVGContent:function(){return l}});var pa=b.getUrlFromAttr=svgedit.utilities.getUrlFromAttr,ba=b.getHref=svgedit.utilities.getHref,S=b.setHref=svgedit.utilities.setHref,U=svgedit.utilities.getPathBBox;b.getBBox=svgedit.utilities.getBBox;var sa=b.getRotationAngle=svgedit.utilities.getRotationAngle,la=b.getElem=svgedit.utilities.getElem,oa=b.assignAttributes=svgedit.utilities.assignAttributes,Z=this.cleanupElement=svgedit.utilities.cleanupElement,Aa=svgedit.sanitize.getNSMap(),Ka=b.sanitizeSvg=svgedit.sanitize.sanitizeSvg, Ra=svgedit.history.MoveElementCommand,Na=svgedit.history.InsertElementCommand,Sa=svgedit.history.RemoveElementCommand,Wa=svgedit.history.ChangeElementCommand,Oa=svgedit.history.BatchCommand;b.undoMgr=new svgedit.history.UndoManager({handleHistoryEvent:function(g,h){var k=svgedit.history.HistoryEventTypes;if(g==k.BEFORE_UNAPPLY||g==k.BEFORE_APPLY)b.clearSelection();else if(g==k.AFTER_APPLY||g==k.AFTER_UNAPPLY){var v=h.elements();b.pathActions.clear();K("changed",v);v=h.type();k=g==k.AFTER_APPLY;if(v== Ra.type()){k=k?h.newParent:h.oldParent;k==l&&b.identifyLayers()}else if(v==Na.type()||v==Sa.type()){h.parent==l&&b.identifyLayers();if(v==Na.type())k&&ab(h.elem);else k||ab(h.elem);h.elem.tagName==="use"&&cc(h.elem)}else if(v==Wa.type()){h.elem.tagName=="title"&&h.elem.parentNode.parentNode==l&&b.identifyLayers();k=k?h.newValues:h.oldValues;k.stdDeviation&&b.setBlurOffsets(h.elem.parentNode,k.stdDeviation);if(h.elem.tagName==="use"&&svgedit.browser.isWebkit()){v=h.elem;if(!v.getAttribute("x")&&!v.getAttribute("y")){k= v.parentNode;var s=v.nextSibling;k.removeChild(v);k.insertBefore(v,s)}}}}}});var Ia=function(g){b.undoMgr.addCommandToHistory(g)};svgedit.select.init(m,{createSVGElement:function(g){return b.addSvgElementFromJson(g)},svgRoot:function(){return e},svgContent:function(){return l},currentZoom:function(){return p},getStrokedBBox:function(g){return b.getStrokedBBox([g])}});var Qa=this.selectorManager=svgedit.select.getSelectorManager();svgedit.path.init({getCurrentZoom:function(){return p},getSVGRoot:function(){return e}}); -svgedit.utilities.snapToGrid=function(g){var h=m.snappingStep,k=m.baseUnit;if(k!=="px")h*=svgedit.units.getTypeMap()[k];return g=Math.round(g/h)*h};var Ga=svgedit.utilities.snapToGrid,Cb={exportNoBlur:"Blurred elements will appear as un-blurred",exportNoforeignObject:"foreignObject elements will not appear",exportNoDashArray:"Strokes will appear filled",exportNoText:"Text may not appear as expected"},Mb=["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"],lb=$.data, -ab=function(g){var h=$(g).attr(Mb),k;for(k in h){var v=h[k];if(v&&v.indexOf("url(")===0){v=qa(v).substr(1);if(!la(v)){xb().appendChild(Ab[v]);delete Ab[v]}}}g=g.getElementsByTagName("*");if(g.length){h=0;for(k=g.length;h=0)C=D=b.convertToPath(F,true);else if(F.tagName=="rect"){var H=F.getAttribute("rx"),G=F.getAttribute("ry");if(H||G)C=D=b.convertToPath(F,true)}if(!D){var P=F.cloneNode(true),R=document.createElementNS(c,"g"),W=F.parentNode;W.appendChild(R);R.appendChild(P);C=svgedit.utilities.bboxToObj(R.getBBox());W.removeChild(R)}}return C}catch(ta){console.log(F,ta);return null}},k;$.each(g,function(){if(!k)if(this.parentNode)k=h(this)}); -if(k==null)return null;var v=k.x+k.width,s=k.y+k.height,E=k.x,z=k.y,t=function(F){var C=F.getAttribute("stroke-width"),D=0;if(F.getAttribute("stroke")!="none"&&!isNaN(C))D+=C/2;return D},B=[];$.each(g,function(F,C){var D=h(C);if(D){var H=t(C);E=Math.min(E,D.x-H);z=Math.min(z,D.y-H);B.push(D)}});k.x=E;k.y=z;$.each(g,function(F,C){var D=B[F];if(D&&C.nodeType==1){var H=t(C);v=Math.max(v,D.x+D.width+H);s=Math.max(s,D.y+D.height+H)}});k.width=v-E;k.height=s-z;return k};var Hb=this.getVisibleElements=function(g){g|| -(g=$(l).children());var h=[];$(g).children().each(function(k,v){try{v.getBBox()&&h.push(v)}catch(s){}});return h.reverse()},Ob=this.getVisibleElementsAndBBoxes=function(g){g||(g=$(l).children());var h=[];$(g).children().each(function(k,v){try{v.getBBox()&&h.push({elem:v,bbox:getStrokedBBox([v])})}catch(s){}});return h.reverse()},Pb=this.groupSvgElem=function(g){var h=document.createElementNS(c,"g");g.parentNode.replaceChild(h,g);$(h).append(g).data("gsvg",g)[0].id=na()},ma=function(g){var h=document.createElementNS(g.namespaceURI, +svgedit.utilities.snapToGrid=function(g){var h=m.snappingStep,k=m.baseUnit;if(k!=="px")h*=svgedit.units.getTypeMap()[k];return g=Math.round(g/h)*h};var Ga=svgedit.utilities.snapToGrid,Cb={exportNoBlur:"Blurred elements will appear as un-blurred",exportNoforeignObject:"foreignObject elements will not appear",exportNoDashArray:"Strokes will appear filled",exportNoText:"Text may not appear as expected"},Kb=["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"],nb=$.data, +ab=function(g){var h=$(g).attr(Kb),k;for(k in h){var v=h[k];if(v&&v.indexOf("url(")===0){v=pa(v).substr(1);if(!la(v)){vb().appendChild(yb[v]);delete yb[v]}}}g=g.getElementsByTagName("*");if(g.length){h=0;for(k=g.length;h=0)B=D=b.convertToPath(F,true);else if(F.tagName=="rect"){var H=F.getAttribute("rx"),G=F.getAttribute("ry");if(H||G)B=D=b.convertToPath(F,true)}if(!D){var P=F.cloneNode(true),Q=document.createElementNS(c,"g"),W=F.parentNode;W.appendChild(Q);Q.appendChild(P);B=svgedit.utilities.bboxToObj(Q.getBBox());W.removeChild(Q)}}return B}catch(ua){console.log(F,ua);return null}},k;$.each(g,function(){if(!k)if(this.parentNode)k=h(this)}); +if(k==null)return null;var v=k.x+k.width,s=k.y+k.height,E=k.x,z=k.y,t=function(F){var B=F.getAttribute("stroke-width"),D=0;if(F.getAttribute("stroke")!="none"&&!isNaN(B))D+=B/2;return D},C=[];$.each(g,function(F,B){var D=h(B);if(D){var H=t(B);E=Math.min(E,D.x-H);z=Math.min(z,D.y-H);C.push(D)}});k.x=E;k.y=z;$.each(g,function(F,B){var D=C[F];if(D&&B.nodeType==1){var H=t(B);v=Math.max(v,D.x+D.width+H);s=Math.max(s,D.y+D.height+H)}});k.width=v-E;k.height=s-z;return k};var Hb=this.getVisibleElements=function(g){g|| +(g=$(l).children());var h=[];$(g).children().each(function(k,v){try{v.getBBox()&&h.push(v)}catch(s){}});return h.reverse()},Mb=this.getVisibleElementsAndBBoxes=function(g){g||(g=$(l).children());var h=[];$(g).children().each(function(k,v){try{v.getBBox()&&h.push({elem:v,bbox:getStrokedBBox([v])})}catch(s){}});return h.reverse()},Nb=this.groupSvgElem=function(g){var h=document.createElementNS(c,"g");g.parentNode.replaceChild(h,g);$(h).append(g).data("gsvg",g)[0].id=na()},ma=function(g){var h=document.createElementNS(g.namespaceURI, g.nodeName);h.removeAttribute("id");$.each(g.attributes,function(v,s){s.localName!="-moz-math-font-style"&&h.setAttributeNS(s.namespaceURI,s.nodeName,s.nodeValue)});if(svgedit.browser.isWebkit()&&g.nodeName=="path"){var k=Ua.convertPath(g);h.setAttribute("d",k)}$.each(g.childNodes,function(v,s){switch(s.nodeType){case 1:h.appendChild(ma(s));break;case 3:h.textContent=s.nodeValue}});if($(g).data("gsvg"))$(h).data("gsvg",h.firstChild);else if($(g).data("symbol")){g=$(g).data("symbol");$(h).data("ref", -g).data("symbol",g)}else h.tagName=="image"&&Ib(h);h.id=na();return h},Y,na,K;(function(g){var h={};Y=g.getId=function(){return w().getId()};na=g.getNextId=function(){return w().getNextId()};K=g.call=function(k,v){if(h[k])return h[k](this,v)};g.bind=function(k,v){var s=h[k];h[k]=v;return s}})(b);this.prepareSvg=function(g){this.sanitizeSvg(g.documentElement);g=g.getElementsByTagNameNS(c,"path");for(var h=0,k=g.length;h0&&s.getItem(0).type==4&&s.removeItem(0);if(g!=0){E=O(E,z,ha(s).matrix); -z=e.createSVGTransform();z.setRotate(g,E.x,E.y);s.numberOfItems?s.insertItemBefore(z,0):s.appendItem(z)}else s.numberOfItems==0&&k.removeAttribute("transform");if(!h){s=k.getAttribute("transform");k.setAttribute("transform",v);rb("transform",s,J);K("changed",J)}la("pathpointgrip_container");k=Qa.requestSelector(J[0]);k.resize();k.updateGripCursors(g)};var Pa=this.recalculateAllSelectedDimensions=function(){for(var g=new Oa(mb=="none"?"position":"size"),h=J.length;h--;){var k=cb(J[h]);k&&g.addSubCommand(k)}if(!g.isEmpty()){Ia(g); -K("changed",J)}},Xa=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],fb=function(g){console.log([g.a,g.b,g.c,g.d,g.e,g.f])},nb=this.remapElement=function(g,h,k){var v=m.gridSnapping&&g.parentNode.parentNode.localName==="svg",s=function(){if(v)for(var D in h)h[D]=Ga(h[D]);oa(g,h,1E3,true)};box=svgedit.utilities.getBBox(g);for(var E=0;E<2;E++){var z=E===0?"fill":"stroke",t=g.getAttribute(z);if(t&&t.indexOf("url(")===0)if(k.a<0||k.d<0){t=N(t).cloneNode(true);if(k.a<0){var B= -t.getAttribute("x1"),F=t.getAttribute("x2");t.setAttribute("x1",-(B-1));t.setAttribute("x2",-(F-1))}if(k.d<0){B=t.getAttribute("y1");F=t.getAttribute("y2");t.setAttribute("y1",-(B-1));t.setAttribute("y2",-(F-1))}t.id=na();xb().appendChild(t);g.setAttribute(z,"url(#"+t.id+")")}}E=g.tagName;if(E==="g"||E==="text"||E==="use")if(k.a==1&&k.b==0&&k.c==0&&k.d==1&&(k.e!=0||k.f!=0)){z=ha(g).matrix;z=fa(z.inverse(),k,z);h.x=parseFloat(h.x)+z.e;h.y=parseFloat(h.y)+z.f}else{z=V(g);t=e.createSVGTransform();t.setMatrix(fa(ha(z).matrix, -k));z.clear();z.appendItem(t)}switch(E){case "foreignObject":case "rect":case "image":if(E==="image"&&(k.a<0||k.d<0)){z=V(g);t=e.createSVGTransform();t.setMatrix(fa(ha(z).matrix,k));z.clear();z.appendItem(t)}else{z=O(h.x,h.y,k);h.width=k.a*h.width;h.height=k.d*h.height;h.x=z.x+Math.min(0,h.width);h.y=z.y+Math.min(0,h.height);h.width=Math.abs(h.width);h.height=Math.abs(h.height)}s();break;case "ellipse":E=O(h.cx,h.cy,k);h.cx=E.x;h.cy=E.y;h.rx=k.a*h.rx;h.ry=k.d*h.ry;h.rx=Math.abs(h.rx);h.ry=Math.abs(h.ry); -s();break;case "circle":E=O(h.cx,h.cy,k);h.cx=E.x;h.cy=E.y;E=svgedit.math.transformBox(box.x,box.y,box.width,box.height,k);h.r=Math.min((E.tr.x-E.tl.x)/2,(E.bl.y-E.tl.y)/2);if(h.r)h.r=Math.abs(h.r);s();break;case "line":z=O(h.x1,h.y1,k);B=O(h.x2,h.y2,k);h.x1=z.x;h.y1=z.y;h.x2=B.x;h.y2=B.y;case "text":k=g.querySelectorAll("tspan");for(E=k.length;E--;){z=ra("x",g.getAttribute("x"));t=ra("x",k[E].getAttribute("x"));B=ra("y",g.getAttribute("y"));F=ra("y",k[E].getAttribute("y"));var C={};if(!isNaN(z)&& -!isNaN(t)&&z!=0&&t!=0&&h.x)C.x=h.x-(z-t);if(!isNaN(B)&&!isNaN(F)&&B!=0&&F!=0&&h.y)C.y=h.y-(B-F);if(C.x||C.y)oa(k[E],C,1E3,true)}s();break;case "use":s();break;case "g":(s=$(g).data("gsvg"))&&oa(s,h,1E3,true);break;case "polyline":case "polygon":s=h.points.length;for(E=0;E0&&s.getItem(0).type==4&&s.removeItem(0);if(g!=0){E=O(E,z,ha(s).matrix); +z=e.createSVGTransform();z.setRotate(g,E.x,E.y);s.numberOfItems?s.insertItemBefore(z,0):s.appendItem(z)}else s.numberOfItems==0&&k.removeAttribute("transform");if(!h){s=k.getAttribute("transform");k.setAttribute("transform",v);db("transform",s,J);K("changed",J)}la("pathpointgrip_container");k=Qa.requestSelector(J[0]);k.resize();k.updateGripCursors(g)};var Pa=this.recalculateAllSelectedDimensions=function(){for(var g=new Oa(ob=="none"?"position":"size"),h=J.length;h--;){var k=cb(J[h]);k&&g.addSubCommand(k)}if(!g.isEmpty()){Ia(g); +K("changed",J)}},Xa=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],hb=function(g){console.log([g.a,g.b,g.c,g.d,g.e,g.f])},pb=this.remapElement=function(g,h,k){var v=m.gridSnapping&&g.parentNode.parentNode.localName==="svg",s=function(){if(v)for(var D in h)h[D]=Ga(h[D]);oa(g,h,1E3,true)};box=svgedit.utilities.getBBox(g);for(var E=0;E<2;E++){var z=E===0?"fill":"stroke",t=g.getAttribute(z);if(t&&t.indexOf("url(")===0)if(k.a<0||k.d<0){t=N(t).cloneNode(true);if(k.a<0){var C= +t.getAttribute("x1"),F=t.getAttribute("x2");t.setAttribute("x1",-(C-1));t.setAttribute("x2",-(F-1))}if(k.d<0){C=t.getAttribute("y1");F=t.getAttribute("y2");t.setAttribute("y1",-(C-1));t.setAttribute("y2",-(F-1))}t.id=na();vb().appendChild(t);g.setAttribute(z,"url(#"+t.id+")")}}E=g.tagName;if(E==="g"||E==="text"||E==="use")if(k.a==1&&k.b==0&&k.c==0&&k.d==1&&(k.e!=0||k.f!=0)){z=ha(g).matrix;z=ga(z.inverse(),k,z);h.x=parseFloat(h.x)+z.e;h.y=parseFloat(h.y)+z.f}else{z=V(g);t=e.createSVGTransform();t.setMatrix(ga(ha(z).matrix, +k));z.clear();z.appendItem(t)}switch(E){case "foreignObject":case "rect":case "image":if(E==="image"&&(k.a<0||k.d<0)){z=V(g);t=e.createSVGTransform();t.setMatrix(ga(ha(z).matrix,k));z.clear();z.appendItem(t)}else{z=O(h.x,h.y,k);h.width=k.a*h.width;h.height=k.d*h.height;h.x=z.x+Math.min(0,h.width);h.y=z.y+Math.min(0,h.height);h.width=Math.abs(h.width);h.height=Math.abs(h.height)}s();break;case "ellipse":E=O(h.cx,h.cy,k);h.cx=E.x;h.cy=E.y;h.rx=k.a*h.rx;h.ry=k.d*h.ry;h.rx=Math.abs(h.rx);h.ry=Math.abs(h.ry); +s();break;case "circle":E=O(h.cx,h.cy,k);h.cx=E.x;h.cy=E.y;E=svgedit.math.transformBox(box.x,box.y,box.width,box.height,k);h.r=Math.min((E.tr.x-E.tl.x)/2,(E.bl.y-E.tl.y)/2);if(h.r)h.r=Math.abs(h.r);s();break;case "line":z=O(h.x1,h.y1,k);C=O(h.x2,h.y2,k);h.x1=z.x;h.y1=z.y;h.x2=C.x;h.y2=C.y;case "text":k=g.querySelectorAll("tspan");for(E=k.length;E--;){z=ra("x",g.getAttribute("x"));t=ra("x",k[E].getAttribute("x"));C=ra("y",g.getAttribute("y"));F=ra("y",k[E].getAttribute("y"));var B={};if(!isNaN(z)&& +!isNaN(t)&&z!=0&&t!=0&&h.x)B.x=h.x-(z-t);if(!isNaN(C)&&!isNaN(F)&&C!=0&&F!=0&&h.y)B.y=h.y-(C-F);if(B.x||B.y)oa(k[E],B,1E3,true)}s();break;case "use":s();break;case "g":(s=$(g).data("gsvg"))&&oa(s,h,1E3,true);break;case "polyline":case "polygon":s=h.points.length;for(E=0;E0){for(var k=h.numberOfItems;k--;){var v=h.getItem(k);if(v.type===0)h.removeItem(k);else if(v.type===1)svgedit.math.isIdentity(v.matrix)&&h.removeItem(k);else v.type===4&&v.angle===0&&h.removeItem(k)}if(h.numberOfItems===1&&sa(g))return null}if(!h|| -h.numberOfItems==0){g.removeAttribute("transform");return null}if(h){k=h.numberOfItems;for(var s=[];k--;){v=h.getItem(k);if(v.type===1)s.push([v.matrix,k]);else if(s.length)s=[]}if(s.length===2){k=e.createSVGTransformFromMatrix(fa(s[1][0],s[0][0]));h.removeItem(s[0][1]);h.removeItem(s[1][1]);h.insertItemBefore(k,s[1][1])}k=h.numberOfItems;if(k>=2&&h.getItem(k-2).type===1&&h.getItem(k-1).type===2){s=e.createSVGTransform();v=fa(h.getItem(k-2).matrix,h.getItem(k-1).matrix);s.setMatrix(v);h.removeItem(k- +h.numberOfItems==0){g.removeAttribute("transform");return null}if(h){k=h.numberOfItems;for(var s=[];k--;){v=h.getItem(k);if(v.type===1)s.push([v.matrix,k]);else if(s.length)s=[]}if(s.length===2){k=e.createSVGTransformFromMatrix(ga(s[1][0],s[0][0]));h.removeItem(s[0][1]);h.removeItem(s[1][1]);h.insertItemBefore(k,s[1][1])}k=h.numberOfItems;if(k>=2&&h.getItem(k-2).type===1&&h.getItem(k-1).type===2){s=e.createSVGTransform();v=ga(h.getItem(k-2).matrix,h.getItem(k-1).matrix);s.setMatrix(v);h.removeItem(k- 2);h.removeItem(k-2);h.appendItem(s)}}switch(g.tagName){case "line":case "polyline":case "polygon":case "path":break;default:if(h.numberOfItems===1&&h.getItem(0).type===1||h.numberOfItems===2&&h.getItem(0).type===1&&h.getItem(0).type===4)return null}var E=$(g).data("gsvg");k=new Oa("Transform");var z={},t=null;v=[];switch(g.tagName){case "line":v=["x1","y1","x2","y2"];break;case "circle":v=["cx","cy","r"];break;case "ellipse":v=["cx","cy","rx","ry"];break;case "foreignObject":case "rect":case "image":v= -["width","height","x","y"];break;case "use":case "text":case "tspan":v=["x","y"];break;case "polygon":case "polyline":t={};t.points=g.getAttribute("points");s=g.points;var B=s.numberOfItems;z.points=Array(B);for(var F=0;F1.0E-10?Math.sin(F)/(1-Math.cos(F)):2/F;for(F=0;F=3&&h.getItem(G-2).type==3&&h.getItem(G-3).type==2&&h.getItem(G-1).type==2){F=3;var R=h.getItem(G-3).matrix,W=h.getItem(G-2).matrix,ta=h.getItem(G-1).matrix;B=g.childNodes;for(C=B.length;C--;){var wa=B.item(C);v=E=0;if(wa.nodeType==1){var ga=V(wa);if(ga){v=ha(ga).matrix;E=sa(wa);var ka=Za,pa=[];Za=wa.getAttribute("transform");if(E||ua(ga)){var za=e.createSVGTransform();za.setMatrix(fa(R,W,ta,v));ga.clear();ga.appendItem(za);pa.push(za)}else{E=fa(v.inverse(),ta,v);za=e.createSVGMatrix(); -za.e=-E.e;za.f=-E.f;v=fa(za.inverse(),v.inverse(),R,W,ta,v,E.inverse());var hb=e.createSVGTransform(),Eb=e.createSVGTransform(),Sb=e.createSVGTransform();hb.setTranslate(E.e,E.f);Eb.setScale(v.a,v.d);Sb.setTranslate(za.e,za.f);ga.appendItem(Sb);ga.appendItem(Eb);ga.appendItem(hb);pa.push(Sb);pa.push(Eb);pa.push(hb)}k.addSubCommand(cb(wa));Za=ka}}}h.removeItem(G-1);h.removeItem(G-2);h.removeItem(G-3)}else if(G>=3&&h.getItem(G-1).type==1){F=3;v=ha(h).matrix;za=e.createSVGTransform();za.setMatrix(v); -h.clear();h.appendItem(za)}else if((G==1||G>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){F=2;E=ha(h).matrix;h.removeItem(0);v=ha(h).matrix.inverse();v=fa(v,E);E=v.e;v=v.f;if(E!=0||v!=0){B=g.childNodes;C=B.length;for(G=[];C--;){wa=B.item(C);if(wa.nodeType==1){if(wa.getAttribute("clip-path")){ka=wa.getAttribute("clip-path");if(G.indexOf(ka)===-1){Db(ka,E,v);G.push(ka)}}ka=Za;Za=wa.getAttribute("transform");if(ga=V(wa)){R=e.createSVGTransform();R.setTranslate(E,v);ga.numberOfItems?ga.insertItemBefore(R, -0):ga.appendItem(R);k.addSubCommand(cb(wa));ga=g.getElementsByTagNameNS(c,"use");wa="#"+wa.id;for(R=ga.length;R--;){W=ga.item(R);if(wa==ba(W)){ta=e.createSVGTransform();ta.setTranslate(-E,-v);V(W).insertItemBefore(ta,0);k.addSubCommand(cb(W))}}Za=ka}}}G=[];Za=ka}}else if(G==1&&h.getItem(0).type==1&&!s){F=1;v=h.getItem(0).matrix;B=g.childNodes;for(C=B.length;C--;){wa=B.item(C);if(wa.nodeType==1){ka=Za;Za=wa.getAttribute("transform");if(ga=V(wa)){E=fa(v,ha(ga).matrix);G=e.createSVGTransform();G.setMatrix(E); -ga.clear();ga.appendItem(G,0);k.addSubCommand(cb(wa));Za=ka;ka=wa.getAttribute("stroke-width");wa.getAttribute("stroke")!=="none"&&!isNaN(ka)&&wa.setAttribute("stroke-width",ka*((Math.abs(E.a)+Math.abs(E.d))/2))}}}h.clear()}else{if(s){D=e.createSVGTransform();D.setRotate(s,H.x,H.y);h.numberOfItems?h.insertItemBefore(D,0):h.appendItem(D)}h.numberOfItems==0&&g.removeAttribute("transform");return null}if(F==2){if(s){H={x:D.x+P.e,y:D.y+P.f};D=e.createSVGTransform();D.setRotate(s,H.x,H.y);h.numberOfItems? -h.insertItemBefore(D,0):h.appendItem(D)}}else if(F==3){v=ha(h).matrix;P=e.createSVGTransform();P.setRotate(s,D.x,D.y);P=P.matrix;D=e.createSVGTransform();D.setRotate(s,H.x,H.y);H=D.matrix.inverse();ka=v.inverse();H=fa(ka,H,P,v);E=H.e;v=H.f;if(E!=0||v!=0){B=g.childNodes;for(C=B.length;C--;){wa=B.item(C);if(wa.nodeType==1){ka=Za;Za=wa.getAttribute("transform");ga=V(wa);R=e.createSVGTransform();R.setTranslate(E,v);ga.numberOfItems?ga.insertItemBefore(R,0):ga.appendItem(R);k.addSubCommand(cb(wa));Za= -ka}}}if(s)h.numberOfItems?h.insertItemBefore(D,0):h.appendItem(D)}}else{s=svgedit.utilities.getBBox(g);if(!s&&g.tagName!="path")return null;v=e.createSVGMatrix();if(E=sa(g)){D={x:s.x+s.width/2,y:s.y+s.height/2};H=O(s.x+s.width/2,s.y+s.height/2,ha(h).matrix);F=E*Math.PI/180;B=Math.abs(F)>1.0E-10?Math.sin(F)/(1-Math.cos(F)):2/F;for(F=0;F=3&&h.getItem(G-2).type==3&&h.getItem(G-3).type==2&&h.getItem(G-1).type==2){F=3;v=ha(h,G-3,G-1).matrix;h.removeItem(G-1);h.removeItem(G-2);h.removeItem(G-3)}else if(G==4&&h.getItem(G-1).type==1){F=3;v=ha(h).matrix; -za=e.createSVGTransform();za.setMatrix(v);h.clear();h.appendItem(za);v=e.createSVGMatrix()}else if((G==1||G>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){F=2;P=h.getItem(0).matrix;ka=ha(h,1).matrix;s=ka.inverse();v=fa(s,P,ka);h.removeItem(0)}else if(G==1&&h.getItem(0).type==1&&!E){v=ha(h).matrix;switch(g.tagName){case "line":z=$(g).attr(["x1","y1","x2","y2"]);case "polyline":case "polygon":z.points=g.getAttribute("points");if(z.points){s=g.points;B=s.numberOfItems;z.points=Array(B);for(F=0;F1.0E-10?Math.sin(F)/(1-Math.cos(F)):2/F;for(F=0;F=3&&h.getItem(G-2).type==3&&h.getItem(G-3).type==2&&h.getItem(G-1).type==2){F=3;var Q=h.getItem(G-3).matrix,W=h.getItem(G-2).matrix,ua=h.getItem(G-1).matrix;C=g.childNodes;for(B=C.length;B--;){var wa=C.item(B);v=E=0;if(wa.nodeType==1){var fa=V(wa);if(fa){v=ha(fa).matrix;E=sa(wa);var ka=Za,qa=[];Za=wa.getAttribute("transform");if(E||ta(fa)){var za=e.createSVGTransform();za.setMatrix(ga(Q,W,ua,v));fa.clear();fa.appendItem(za);qa.push(za)}else{E=ga(v.inverse(),ua,v);za=e.createSVGMatrix(); +za.e=-E.e;za.f=-E.f;v=ga(za.inverse(),v.inverse(),Q,W,ua,v,E.inverse());var jb=e.createSVGTransform(),zb=e.createSVGTransform(),Qb=e.createSVGTransform();jb.setTranslate(E.e,E.f);zb.setScale(v.a,v.d);Qb.setTranslate(za.e,za.f);fa.appendItem(Qb);fa.appendItem(zb);fa.appendItem(jb);qa.push(Qb);qa.push(zb);qa.push(jb)}k.addSubCommand(cb(wa));Za=ka}}}h.removeItem(G-1);h.removeItem(G-2);h.removeItem(G-3)}else if(G>=3&&h.getItem(G-1).type==1){F=3;v=ha(h).matrix;za=e.createSVGTransform();za.setMatrix(v); +h.clear();h.appendItem(za)}else if((G==1||G>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){F=2;E=ha(h).matrix;h.removeItem(0);v=ha(h).matrix.inverse();v=ga(v,E);E=v.e;v=v.f;if(E!=0||v!=0){C=g.childNodes;B=C.length;for(G=[];B--;){wa=C.item(B);if(wa.nodeType==1){if(wa.getAttribute("clip-path")){ka=wa.getAttribute("clip-path");if(G.indexOf(ka)===-1){Db(ka,E,v);G.push(ka)}}ka=Za;Za=wa.getAttribute("transform");if(fa=V(wa)){Q=e.createSVGTransform();Q.setTranslate(E,v);fa.numberOfItems?fa.insertItemBefore(Q, +0):fa.appendItem(Q);k.addSubCommand(cb(wa));fa=g.getElementsByTagNameNS(c,"use");wa="#"+wa.id;for(Q=fa.length;Q--;){W=fa.item(Q);if(wa==ba(W)){ua=e.createSVGTransform();ua.setTranslate(-E,-v);V(W).insertItemBefore(ua,0);k.addSubCommand(cb(W))}}Za=ka}}}G=[];Za=ka}}else if(G==1&&h.getItem(0).type==1&&!s){F=1;v=h.getItem(0).matrix;C=g.childNodes;for(B=C.length;B--;){wa=C.item(B);if(wa.nodeType==1){ka=Za;Za=wa.getAttribute("transform");if(fa=V(wa)){E=ga(v,ha(fa).matrix);G=e.createSVGTransform();G.setMatrix(E); +fa.clear();fa.appendItem(G,0);k.addSubCommand(cb(wa));Za=ka;ka=wa.getAttribute("stroke-width");wa.getAttribute("stroke")!=="none"&&!isNaN(ka)&&wa.setAttribute("stroke-width",ka*((Math.abs(E.a)+Math.abs(E.d))/2))}}}h.clear()}else{if(s){D=e.createSVGTransform();D.setRotate(s,H.x,H.y);h.numberOfItems?h.insertItemBefore(D,0):h.appendItem(D)}h.numberOfItems==0&&g.removeAttribute("transform");return null}if(F==2){if(s){H={x:D.x+P.e,y:D.y+P.f};D=e.createSVGTransform();D.setRotate(s,H.x,H.y);h.numberOfItems? +h.insertItemBefore(D,0):h.appendItem(D)}}else if(F==3){v=ha(h).matrix;P=e.createSVGTransform();P.setRotate(s,D.x,D.y);P=P.matrix;D=e.createSVGTransform();D.setRotate(s,H.x,H.y);H=D.matrix.inverse();ka=v.inverse();H=ga(ka,H,P,v);E=H.e;v=H.f;if(E!=0||v!=0){C=g.childNodes;for(B=C.length;B--;){wa=C.item(B);if(wa.nodeType==1){ka=Za;Za=wa.getAttribute("transform");fa=V(wa);Q=e.createSVGTransform();Q.setTranslate(E,v);fa.numberOfItems?fa.insertItemBefore(Q,0):fa.appendItem(Q);k.addSubCommand(cb(wa));Za= +ka}}}if(s)h.numberOfItems?h.insertItemBefore(D,0):h.appendItem(D)}}else{s=svgedit.utilities.getBBox(g);if(!s&&g.tagName!="path")return null;v=e.createSVGMatrix();if(E=sa(g)){D={x:s.x+s.width/2,y:s.y+s.height/2};H=O(s.x+s.width/2,s.y+s.height/2,ha(h).matrix);F=E*Math.PI/180;C=Math.abs(F)>1.0E-10?Math.sin(F)/(1-Math.cos(F)):2/F;for(F=0;F=3&&h.getItem(G-2).type==3&&h.getItem(G-3).type==2&&h.getItem(G-1).type==2){F=3;v=ha(h,G-3,G-1).matrix;h.removeItem(G-1);h.removeItem(G-2);h.removeItem(G-3)}else if(G==4&&h.getItem(G-1).type==1){F=3;v=ha(h).matrix; +za=e.createSVGTransform();za.setMatrix(v);h.clear();h.appendItem(za);v=e.createSVGMatrix()}else if((G==1||G>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){F=2;P=h.getItem(0).matrix;ka=ha(h,1).matrix;s=ka.inverse();v=ga(s,P,ka);h.removeItem(0)}else if(G==1&&h.getItem(0).type==1&&!E){v=ha(h).matrix;switch(g.tagName){case "line":z=$(g).attr(["x1","y1","x2","y2"]);case "polyline":case "polygon":z.points=g.getAttribute("points");if(z.points){s=g.points;C=s.numberOfItems;z.points=Array(C);for(F=0;F1&&s.showGrips(false)}}}K("selected",J);h||J.length==1?Qa.requestSelector(J[0]).showGrips(true):Qa.requestSelector(J[0]).showGrips(false);for(J.sort(function(E,z){if(E&&z&&E.compareDocumentPosition)return 3-(z.compareDocumentPosition(E)&6);else if(E==null)return 1});J[0]== -null;)J.shift(0)}},Qb=this.selectOnly=function(g,h){$a(true);Kb(g,h)};this.removeFromSelection=function(g){if(J[0]!=null)if(g.length!=0){var h=Array(J.length);j=0;len=J.length;for(var k=0;k=0&&g.id!="svgcanvas")for(;g.nodeName!="foreignObject";){g=g.parentNode;if(!g)return e}var h=w().getCurrentLayer();if([e,a,l,h].indexOf(g)>=0)return e;if($(g).closest("#selectorParentGroup").length)return Qa.selectorParentGroup;for(;g.parentNode!==(L||h);)g=g.parentNode;return g};(function(){var g=null,h=null,k=null,v=null,s=null,E={},z={minx:null,miny:null,maxx:null,maxy:null};$(a).mousedown(function(t){if(!(b.spaceKey|| -t.button===1)){var B=t.button===2;t.altKey&&svgCanvas.cloneSelectedElements(0,0);Fb=l.getScreenCTM().inverse();var F=O(t.pageX,t.pageY,Fb),C=F.x*p;F=F.y*p;t.preventDefault();if(B)Ma="select";C=C/p;F=F/p;var D=Zb(t);if(D.tagName==="a"&&D.childNodes.length===1)D=D.firstChild;var H=v=h=C,G=s=k=F;if(m.gridSnapping){C=Ga(C);F=Ga(F);h=Ga(h);k=Ga(k)}if(D==Qa.selectorParentGroup&&J[0]!=null){D=t.target;var P=lb(D,"type");if(P=="rotate"){Ma="rotate";current_rotate_mode=lb(D,"dir")}else if(P=="resize"){Ma= -"resize";mb=lb(D,"dir")}D=J[0]}Za=D.getAttribute("transform");P=V(D);switch(Ma){case "select":Ja=true;mb="none";if(B)Ja=false;if(D!=e){if(J.indexOf(D)==-1){t.shiftKey||$a(true);Kb([D]);Nb=D;Ua.clear()}if(!B)for(B=0;B0&&b.removeFromSelection(D);H.length>0&&Kb(H);break;case "resize":D=V(B);H=(R=ua(D))?E:svgedit.utilities.getBBox(B);G=H.x;W=H.y;var ta=H.width,wa=H.height;H=x-h;P=y-k;if(m.gridSnapping){H=Ga(H);P=Ga(P);wa=Ga(wa);ta=Ga(ta)}var ga=sa(B);if(ga){var ka=Math.sqrt(H*H+P*P);P=Math.atan2(P,H)-ga*Math.PI/180;H=ka*Math.cos(P);P=ka*Math.sin(P)}if(mb.indexOf("n")==-1&&mb.indexOf("s")==-1)P=0;if(mb.indexOf("e")==-1&&mb.indexOf("w")== --1)H=0;var pa=ka=0,za=wa?(wa+P)/wa:1,hb=ta?(ta+H)/ta:1;if(mb.indexOf("n")>=0){za=wa?(wa-P)/wa:1;pa=wa}if(mb.indexOf("w")>=0){hb=ta?(ta-H)/ta:1;ka=ta}H=e.createSVGTransform();P=e.createSVGTransform();ta=e.createSVGTransform();if(m.gridSnapping){G=Ga(G);ka=Ga(ka);W=Ga(W);pa=Ga(pa)}H.setTranslate(-(G+ka),-(W+pa));if(t.shiftKey)if(hb==1)hb=za;else za=hb;P.setScale(hb,za);ta.setTranslate(G+ka,W+pa);if(R){R=ga?1:0;D.replaceItem(H,2+R);D.replaceItem(P,1+R);D.replaceItem(ta,0+R)}else{R=D.numberOfItems;D.replaceItem(ta, -R-3);D.replaceItem(P,R-2);D.replaceItem(H,R-1)}Qa.requestSelector(B).resize();K("transition",J);break;case "zoom":H*=p;G*=p;oa(xa,{x:Math.min(v*p,H),y:Math.min(s*p,G),width:Math.abs(H-v*p),height:Math.abs(G-s*p)},100);break;case "text":oa(D,{x:x,y:y},1E3);break;case "line":H=null;window.opera||e.suspendRedraw(1E3);if(m.gridSnapping){x=Ga(x);y=Ga(y)}G=x;R=y;if(t.shiftKey){R=ca(h,k,G,R);G=R.x;R=R.y}D.setAttributeNS(null,"x2",G);D.setAttributeNS(null,"y2",R);window.opera||e.unsuspendRedraw(H);break; -case "foreignObject":case "square":case "rect":case "image":H=Math.abs(x-h);R=Math.abs(y-k);if(Ma=="square"||t.shiftKey){H=R=Math.max(H,R);G=hk?k+W:k-W}if(t.altKey){R=h;G=k;W=Math.abs(x-R);P=t.shiftKey?W:Math.abs(y-G)}D.setAttributeNS(null,"rx",W);D.setAttributeNS(null,"ry",P);D.setAttributeNS(null,"cx",R);D.setAttributeNS(null,"cy",G);window.opera||e.unsuspendRedraw(H);break;case "fhellipse":case "fhrect":z.minx=Math.min(H,z.minx);z.maxx=Math.max(H, -z.maxx);z.miny=Math.min(G,z.miny);z.maxy=Math.max(G,z.maxy);case "fhpath":g+=+H+","+G+" ";D.setAttributeNS(null,"points",g);break;case "path":case "pathedit":x*=p;y*=p;if(m.gridSnapping){x=Ga(x);y=Ga(y);h=Ga(h);k=Ga(k)}if(t.shiftKey){if(R=svgedit.path.path){D=R.dragging?R.dragging[0]:h;R=R.dragging?R.dragging[1]:k}else{D=h;R=k}R=ca(D,R,x,y);x=R.x;y=R.y}if(xa&&xa.getAttribute("display")!=="none"){H*=p;G*=p;oa(xa,{x:Math.min(v*p,H),y:Math.min(s*p,G),width:Math.abs(H-v*p),height:Math.abs(G-s*p)},100)}Ua.mouseMove(t, -x,y);break;case "textedit":x*=p;y*=p;pb.mouseMove(C,F);break;case "rotate":H=svgedit.utilities.getBBox(B);R=H.x+H.width/2;G=H.y+H.height/2;D=ea(B);D=O(R,G,D);R=D.x;G=D.y;D=H.x;W=H.y;if(current_rotate_mode=="nw")D=H.x+H.width;if(current_rotate_mode=="se")W=H.y+H.height;if(current_rotate_mode=="sw"){D=H.x+H.width;W=H.y+H.height}compensation_angle=(Math.atan2(G-W,R-D)*(180/Math.PI)-90)%360;ga=(Math.atan2(G-y,R-x)*(180/Math.PI)-90)%360;ga+=compensation_angle;if(m.gridSnapping)ga=Ga(ga);if(t.shiftKey)ga= -Math.round(ga/45)*45;b.setRotationAngle(ga<-180?360+ga:ga,true);K("transition",J)}sb("mouseMove",{event:t,mouse_x:C,mouse_y:F,selected:B})}}).click(function(t){t.preventDefault();return false}).dblclick(function(t){var B=t.target.parentNode;if(B!==L){var F=Zb(t),C=F.tagName;if(C==="text"&&Ma!=="textedit"){t=O(t.pageX,t.pageY,Fb);pb.select(F,t.x,t.y)}if((C==="g"||C==="a")&&sa(F)){Xb(F);F=J[0];$a(true)}L&&$b();B.tagName!=="g"&&B.tagName!=="a"||B===w().getCurrentLayer()||F===Qa.selectorParentGroup|| -lc(F)}}).mouseup(function(t){if(t.button!==2){var B=Nb;Nb=null;if(Ja){var F=O(t.pageX,t.pageY,Fb),C=F.x*p;F=F.y*p;var D=C/p,H=F/p,G=la(Y()),P=false;Ja=false;switch(Ma){case "resize":case "multiselect":if(xa!=null){xa.setAttribute("display","none");wb=[]}Ma="select";case "select":if(J[0]!=null){if(J[1]==null){C=J[0];switch(C.tagName){case "g":case "use":case "image":case "foreignObject":break;default:gb.fill=C.getAttribute("fill");gb.fill_opacity=C.getAttribute("fill-opacity");gb.stroke=C.getAttribute("stroke"); -gb.stroke_opacity=C.getAttribute("stroke-opacity");gb.stroke_width=C.getAttribute("stroke-width");gb.stroke_dasharray=C.getAttribute("stroke-dasharray");gb.stroke_linejoin=C.getAttribute("stroke-linejoin");gb.stroke_linecap=C.getAttribute("stroke-linecap")}if(C.tagName=="text"){eb.font_size=C.getAttribute("font-size");eb.font_family=C.getAttribute("font-family")}Qa.requestSelector(C).showGrips(true)}Pa();if(D!=v||H!=s){t=J.length;for(C=0;C=0?B.indexOf(",",D+1)>=0:B.indexOf(" ",B.indexOf(" ")+1)>=0)G=Ua.smoothPolylineIntoPath(G);break;case "line":B=$(G).attr(["x1","x2","y1","y2"]);P=B.x1!=B.x2||B.y1!=B.y2;break;case "foreignObject":case "square":case "rect":case "image":B=$(G).attr(["width","height"]);P=B.width!=0||B.height!=0||Ma==="image";break;case "circle":P=G.getAttribute("r")!=0;break;case "ellipse":B=$(G).attr(["rx","ry"]);P=B.rx!=null||B.ry!=null;break;case "fhellipse":if(z.maxx-z.minx>0&&z.maxy-z.miny>0){G=da({element:"ellipse", -curStyles:true,attr:{cx:(z.minx+z.maxx)/2,cy:(z.miny+z.maxy)/2,rx:(z.maxx-z.minx)/2,ry:(z.maxy-z.miny)/2,id:Y()}});K("changed",[G]);P=true}break;case "fhrect":if(z.maxx-z.minx>0&&z.maxy-z.miny>0){G=da({element:"rect",curStyles:true,attr:{x:z.minx,y:z.miny,width:z.maxx-z.minx,height:z.maxy-z.miny,id:Y()}});K("changed",[G]);P=true}break;case "text":P=true;Qb([G]);pb.start(G);break;case "path":G=null;Ja=true;B=Ua.mouseUp(t,G,C,F);G=B.element;P=B.keep;break;case "pathedit":P=true;G=null;Ua.mouseUp(t); -break;case "textedit":P=false;G=null;pb.mouseUp(t,C,F);break;case "rotate":P=true;G=null;Ma="select";B=b.undoMgr.finishUndoableChange();B.isEmpty()||Ia(B);Pa();K("changed",J)}C=sb("mouseUp",{event:t,mouse_x:C,mouse_y:F},true);$.each(C,function(ta,wa){if(wa){P=wa.keep||P;G=wa.element;Ja=wa.started||Ja}});if(!P&&G!=null){w().releaseId(Y());G.parentNode.removeChild(G);G=null;for(C=t.target;C.parentNode.parentNode.tagName=="g";)C=C.parentNode;if((Ma!="path"||!drawn_path)&&C.parentNode.id!="selectorParentGroup"&& -C.id!="svgcanvas"&&C.id!="svgroot"){b.setMode("select");Qb([C],true)}}else if(G!=null){b.addedNew=true;t=0.2;var R;if(false.beginElement&&G.getAttribute("opacity")!=M.opacity){R=$(false).clone().attr({to:M.opacity,dur:t}).appendTo(G);try{R[0].beginElement()}catch(W){}}else t=0;setTimeout(function(){R&&R.remove();G.setAttribute("opacity",M.opacity);G.setAttribute("style","pointer-events:inherit");Z(G);if(Ma==="path")Ua.toEditMode(G);else m.selectNew&&Qb([G],true);Ia(new Na(G));K("changed",[G])},t* -1E3)}Za=null}}});$(a).bind("mousewheel DOMMouseScroll",function(t){if(t.shiftKey){t.preventDefault();Fb=l.getScreenCTM().inverse();var B=O(t.pageX,t.pageY,Fb);B={x:B.x,y:B.y,width:0,height:0};if(t.wheelDelta)if(t.wheelDelta>=120)B.factor=2;else{if(t.wheelDelta<=-120)B.factor=0.5}else if(t.detail)if(t.detail>0)B.factor=0.5;else if(t.detail<0)B.factor=2;B.factor&&K("zoomed",B)}})})();var Ib=function(g){$(g).click(function(h){h.preventDefault()})},pb=b.textActions=function(){function g(ga){var ka=F.value=== -"";$(F).focus();if(!arguments.length)if(ka)ga=0;else{if(F.selectionEnd!==F.selectionStart)return;ga=F.selectionEnd}var pa;pa=G[ga];ka||F.setSelectionRange(ga,ga);C=la("text_cursor");if(!C){C=document.createElementNS(c,"line");oa(C,{id:"text_cursor",stroke:"#333","stroke-width":1});C=la("selectorParentGroup").appendChild(C)}H||(H=setInterval(function(){var za=C.getAttribute("display")==="none";C.setAttribute("display",za?"inline":"none")},600));ka=E(pa.x,P.y);pa=E(pa.x,P.y+P.height);oa(C,{x1:ka.x, -y1:ka.y,x2:pa.x,y2:pa.y,visibility:"visible",display:"inline"});D&&D.setAttribute("d","")}function h(ga,ka,pa){if(ga===ka)g(ka);else{pa||F.setSelectionRange(ga,ka);D=la("text_selectblock");if(!D){D=document.createElementNS(c,"path");oa(D,{id:"text_selectblock",fill:"green",opacity:0.5,style:"pointer-events:none"});la("selectorParentGroup").appendChild(D)}ga=G[ga];var za=G[ka];C.setAttribute("visibility","hidden");ka=E(ga.x,P.y);pa=E(ga.x+(za.x-ga.x),P.y);var hb=E(ga.x,P.y+P.height);ga=E(ga.x+(za.x- -ga.x),P.y+P.height);oa(D,{d:"M"+ka.x+","+ka.y+" L"+pa.x+","+pa.y+" "+ga.x+","+ga.y+" "+hb.x+","+hb.y+"z",display:"inline"})}}function k(ga,ka){var pa=e.createSVGPoint();pa.x=ga;pa.y=ka;if(G.length==1)return 0;pa=B.getCharNumAtPosition(pa);if(pa<0){pa=G.length-2;if(ga<=G[0].x)pa=0}else if(pa>=G.length-2)pa=G.length-2;var za=G[pa];ga>za.x+za.width/2&&pa++;return pa}function v(ga,ka,pa){var za=F.selectionStart;ga=k(ga,ka);h(Math.min(za,ga),Math.max(za,ga),!pa)}function s(ga,ka){var pa={x:ga,y:ka};pa.x/= -p;pa.y/=p;if(R){var za=O(pa.x,pa.y,R.inverse());pa.x=za.x;pa.y=za.y}return pa}function E(ga,ka){var pa={x:ga,y:ka};if(R){var za=O(pa.x,pa.y,R);pa.x=za.x;pa.y=za.y}pa.x*=p;pa.y*=p;return pa}function z(ga){h(0,B.textContent.length);$(this).unbind(ga)}function t(ga){if(wa&&B){var ka=O(ga.pageX,ga.pageY,Fb);ka=s(ka.x*p,ka.y*p);ka=k(ka.x,ka.y);var pa=B.textContent,za=pa.substr(0,ka).replace(/[a-z0-9]+$/i,"").length;pa=pa.substr(ka).match(/^[a-z0-9]+/i);h(za,(pa?pa[0].length:0)+ka);$(ga.target).click(z); -setTimeout(function(){$(ga.target).unbind("click",z)},300)}}var B,F,C,D,H,G=[],P,R,W,ta,wa;return{select:function(ga,ka,pa){B=ga;pb.toEditMode(ka,pa)},start:function(ga){B=ga;pb.toEditMode()},mouseDown:function(ga,ka,pa,za){ga=s(pa,za);F.focus();g(k(ga.x,ga.y));W=pa;ta=za},mouseMove:function(ga,ka){var pa=s(ga,ka);v(pa.x,pa.y)},mouseUp:function(ga,ka,pa){var za=s(ka,pa);v(za.x,za.y,true);ga.target!==B&&kaW-2&&pata-2&&pb.toSelectMode(true)},setCursor:g,toEditMode:function(ga,ka){wa= -false;Ma="textedit";Qa.requestSelector(B).showGrips(false);Qa.requestSelector(B);pb.init();$(B).css("cursor","text");if(arguments.length){var pa=s(ga,ka);g(k(pa.x,pa.y))}else g();setTimeout(function(){wa=true},300)},toSelectMode:function(ga){Ma="select";clearInterval(H);H=null;D&&$(D).attr("display","none");C&&$(C).attr("visibility","hidden");$(B).css("cursor","move");if(ga){$a();$(B).css("cursor","move");K("selected",[B]);Kb([B],true)}B&&!B.textContent.length&&b.deleteSelectedElements();$(F).blur(); -B=false},setInputElem:function(ga){F=ga},clear:function(){Ma=="textedit"&&pb.toSelectMode()},init:function(){if(B){if(!B.parentNode){B=J[0];Qa.requestSelector(B).showGrips(false)}var ga=B.textContent.length,ka=B.getAttribute("transform");P=svgedit.utilities.getBBox(B);R=ka?ea(B):null;G=Array(ga);F.focus();$(B).unbind("dblclick",t).dblclick(t);if(!ga)var pa={x:P.x+P.width/2,width:0};for(ka=0;ka=0&&this.selected_pts.push(B)}this.selected_pts.sort();t=this.selected_pts.length;for(z=Array(t);t--;){F=this.segs[this.selected_pts[t]];F.select(true);z[t]=F.ptgrip}Ua.canDeleteNodes=true;Ua.closed_subpath=this.subpathIsClosed(this.selected_pts[0]);K("selected",z)};var s=h=null,E=false;return{mouseDown:function(z,t,B,F){if(Ma==="path"){mouse_x=B;mouse_y=F;F=mouse_x/p;t=mouse_y/p;B=la("path_stretch_line"); -k=[F,t];if(m.gridSnapping){F=Ga(F);t=Ga(t);mouse_x=Ga(mouse_x);mouse_y=Ga(mouse_y)}if(!B){B=document.createElementNS(c,"path");oa(B,{id:"path_stretch_line",stroke:"#22C","stroke-width":"0.5",fill:"none"});B=la("selectorParentGroup").appendChild(B)}B.setAttribute("display","inline");var C=null;if(s){C=s.pathSegList;for(var D=C.numberOfItems,H=6/p,G=false;D;){D--;var P=C.getItem(D),R=P.x;P=P.y;if(F>=R-H&&F<=R+H&&t>=P-H&&t<=P+H){G=true;break}}H=Y();svgedit.path.removePath_(H);H=la(H);R=C.numberOfItems; -if(G){if(D<=1&&R>=2){F=C.getItem(0).x;t=C.getItem(0).y;z=B.pathSegList.getItem(1);z=z.pathSegType===4?s.createSVGPathSegLinetoAbs(F,t):s.createSVGPathSegCurvetoCubicAbs(F,t,z.x1/p,z.y1/p,F,t);F=s.createSVGPathSegClosePath();C.appendItem(z);C.appendItem(F)}else if(R<3)return C=false;$(B).remove();element=H;s=null;Ja=false;if(g){svgedit.path.path.matrix&&nb(H,{},svgedit.path.path.matrix.inverse());B=H.getAttribute("d");z=$(svgedit.path.path.elem).attr("d");$(svgedit.path.path.elem).attr("d",z+B);$(H).remove(); -svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();svgedit.path.path.init();Ua.toEditMode(svgedit.path.path.elem);svgedit.path.path.selectPt();return false}}else{if(!$.contains(a,Zb(z))){console.log("Clicked outside canvas");return false}C=s.pathSegList.numberOfItems;D=s.pathSegList.getItem(C-1);H=D.x;D=D.y;if(z.shiftKey){z=ca(H,D,F,t);F=z.x;t=z.y}z=B.pathSegList.getItem(1);z=z.pathSegType===4?s.createSVGPathSegLinetoAbs(kb(F),kb(t)):s.createSVGPathSegCurvetoCubicAbs(kb(F),kb(t),z.x1/p,z.y1/ -p,z.x2/p,z.y2/p);s.pathSegList.appendItem(z);F*=p;t*=p;B.setAttribute("d",["M",F,t,F,t].join(" "));B=C;if(g)B+=svgedit.path.path.segs.length;svgedit.path.addPointGrip(B,F,t)}}else{d_attr="M"+F+","+t+" ";s=da({element:"path",curStyles:true,attr:{d:d_attr,id:na(),opacity:M.opacity/2}});B.setAttribute("d",["M",mouse_x,mouse_y,mouse_x,mouse_y].join(" "));B=g?svgedit.path.path.segs.length:0;svgedit.path.addPointGrip(B,mouse_x,mouse_y)}}else if(svgedit.path.path){svgedit.path.path.storeD();H=z.target.id; -if(H.substr(0,14)=="pathpointgrip_"){t=svgedit.path.path.cur_pt=parseInt(H.substr(14));svgedit.path.path.dragging=[B,F];C=svgedit.path.path.segs[t];if(z.shiftKey)C.selected?svgedit.path.path.removePtFromSelection(t):svgedit.path.path.addPtsToSelection(t);else{if(svgedit.path.path.selected_pts.length<=1||!C.selected)svgedit.path.path.clearSelection();svgedit.path.path.addPtsToSelection(t)}}else if(H.indexOf("ctrlpointgrip_")==0){svgedit.path.path.dragging=[B,F];z=H.split("_")[1].split("c");t=z[0]- -0;svgedit.path.path.selectPt(t,z[1]-0)}if(!svgedit.path.path.dragging){if(xa==null)xa=Qa.getRubberBandBox();oa(xa,{x:B*p,y:F*p,width:0,height:0,display:"inline"},100)}}},mouseMove:function(z,t,B){E=true;if(Ma==="path"){if(s){var F=s.pathSegList;z=F.numberOfItems-1;if(k){var C=svgedit.path.addCtrlGrip("1c1"),D=svgedit.path.addCtrlGrip("0c2");D.getAttribute("cx");D.getAttribute("cy");C.setAttribute("cx",t);C.setAttribute("cy",B);C.setAttribute("display","inline");C=k[0];var H=k[1];F.getItem(z);var G= -C+(C-t/p),P=H+(H-B/p);D.setAttribute("cx",G*p);D.setAttribute("cy",P*p);D.setAttribute("display","inline");D=svgedit.path.getCtrlLine(1);var R=svgedit.path.getCtrlLine(2);oa(D,{x1:t,y1:B,x2:C*p,y2:H*p,display:"inline"});oa(R,{x1:G*p,y1:P*p,x2:C*p,y2:H*p,display:"inline"});if(z===0)v=[t,B];else{F=F.getItem(z-1);t=F.x;B=F.y;if(F.pathSegType===6){t+=t-F.x2;B+=B-F.y2}else if(v){t=v[0]/p;B=v[1]/p}svgedit.path.replacePathSeg(6,z,[C,H,t,B,G,P],s)}}else if(C=la("path_stretch_line")){z=F.getItem(z);if(z.pathSegType=== -6)svgedit.path.replacePathSeg(6,1,[t,B,(z.x+(z.x-z.x2))*p,(z.y+(z.y-z.y2))*p,t,B],C);else v?svgedit.path.replacePathSeg(6,1,[t,B,v[0],v[1],t,B],C):svgedit.path.replacePathSeg(4,1,[t,B],C)}}}else if(svgedit.path.path.dragging){C=svgedit.path.getPointFromGrip({x:svgedit.path.path.dragging[0],y:svgedit.path.path.dragging[1]},svgedit.path.path);H=svgedit.path.getPointFromGrip({x:t,y:B},svgedit.path.path);z=H.x-C.x;C=H.y-C.y;svgedit.path.path.dragging=[t,B];svgedit.path.path.dragctrl?svgedit.path.path.moveCtrl(z, -C):svgedit.path.path.movePts(z,C)}else{svgedit.path.path.selected_pts=[];svgedit.path.path.eachSeg(function(){if(this.next||this.prev){var W=xa.getBBox(),ta=svgedit.path.getGripPt(this);W=svgedit.math.rectsIntersect(W,{x:ta.x,y:ta.y,width:0,height:0});this.select(W);W&&svgedit.path.path.selected_pts.push(this.index)}})}},mouseUp:function(z,t){if(Ma==="path"){k=null;if(!s){t=la(Y());Ja=false;v=null}return{keep:true,element:t}}if(svgedit.path.path.dragging){var B=svgedit.path.path.cur_pt;svgedit.path.path.dragging= -false;svgedit.path.path.dragctrl=false;svgedit.path.path.update();E&&svgedit.path.path.endChanges("Move path point(s)");!z.shiftKey&&!E&&svgedit.path.path.selectPt(B)}else if(xa&&xa.getAttribute("display")!="none"){xa.setAttribute("display","none");xa.getAttribute("width")<=2&&xa.getAttribute("height")<=2&&Ua.toSelectMode(z.target)}else Ua.toSelectMode(z.target);E=false},toEditMode:function(z){svgedit.path.path=svgedit.path.getPath_(z);Ma="pathedit";$a();svgedit.path.path.show(true).update();svgedit.path.path.oldbbox= -svgedit.utilities.getBBox(svgedit.path.path.elem);g=false},toSelectMode:function(z){var t=z==svgedit.path.path.elem;Ma="select";svgedit.path.path.show(false);h=false;$a();svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();if(t){K("selected",[z]);Kb([z],true)}},addSubPath:function(z){if(z){Ma="path";g=true}else{Ua.clear(true);Ua.toEditMode(svgedit.path.path.elem)}},select:function(z){if(h===z){Ua.toEditMode(z);Ma="pathedit"}else h=z},reorient:function(){var z=J[0];if(z)if(sa(z)!=0){var t=new Oa("Reorient path"), -B={d:z.getAttribute("d"),transform:z.getAttribute("transform")};t.addSubCommand(new Wa(z,B));$a();this.resetOrientation(z);Ia(t);svgedit.path.getPath_(z).show(false).matrix=null;this.clear();Kb([z],true);K("changed",J)}},clear:function(){h=null;if(s){var z=la(Y());$(la("path_stretch_line")).remove();$(z).remove();$(la("pathpointgrip_container")).find("*").attr("display","none");s=v=null;Ja=false}else Ma=="pathedit"&&this.toSelectMode();svgedit.path.path&&svgedit.path.path.init().show(false)},resetOrientation:function(z){if(z== -null||z.nodeName!="path")return false;var t=V(z),B=ha(t).matrix;t.clear();z.removeAttribute("transform");t=z.pathSegList;for(var F=t.numberOfItems,C=0;C0){H=F.getItem(C-1).pathSegType;if(H===2){D(C-1,1);B();break}else if(H=== -1&&F.numberOfItems-1===C){D(C,1);B();break}}}return false};B();if(svgedit.path.path.elem.pathSegList.numberOfItems<=1){Ua.toSelectMode(svgedit.path.path.elem);b.deleteSelectedElements()}else{svgedit.path.path.init();svgedit.path.path.clearSelection();if(window.opera){z=$(svgedit.path.path.elem);z.attr("d",z.attr("d"))}svgedit.path.path.endChanges("Delete path node(s)")}}},smoothPolylineIntoPath:function(z){var t=z.points,B=t.numberOfItems;if(B>=4){var F=t.getItem(0),C=null;z=[];z.push(["M",F.x,",", -F.y," C"].join(""));for(var D=1;D<=B-4;D+=3){var H=t.getItem(D),G=t.getItem(D+1),P=t.getItem(D+2);if(C)if((F=svgedit.path.smoothControlPoints(C,H,F))&&F.length==2){H=z[z.length-1].split(",");H[2]=F[0].x;H[3]=F[0].y;z[z.length-1]=H.join(",");H=F[1]}z.push([H.x,H.y,G.x,G.y,P.x,P.y].join(","));F=P;C=G}for(z.push("L");D0;);Ua.clear(true);$.each(l.childNodes,function(k,v){k&&v.nodeType===8&&v.data.indexOf("Created with")>=0&&l.insertBefore(v,l.firstChild)});if(L){$b();Qb([L])}var g=[];$(l).find("g:data(gsvg)").each(function(){for(var k=this.attributes,v=k.length,s=0;s=0;B--){t=z.item(B); -D=v(t.nodeValue);if(!(H.indexOf(t.localName)>=0))if(D!="")if(D.indexOf("pointer-events")!==0)if(!(t.localName==="class"&&D.indexOf("se_")===0)){k.push(" ");if(t.localName==="d")D=Ua.convertPath(g,true);if(isNaN(D)){if(E.test(D))D=svgedit.units.shortFloat(D)+s}else D=svgedit.units.shortFloat(D);if(ob.apply&&g.nodeName==="image"&&t.localName==="href"&&ob.images&&ob.images==="embed"){var G=Ya[D];if(G)D=G}if(!t.namespaceURI||t.namespaceURI==c||Aa[t.namespaceURI]){k.push(t.nodeName);k.push('="');k.push(D); -k.push('"')}}}}if(g.hasChildNodes()){k.push(">");h++;z=false;for(B=0;B");break;case 8:k.push("\n");k.push(Array(h+1).join(" "));k.push("