From 8fd6cbe52954b8e7002a2c203d8adfc9d5876e61 Mon Sep 17 00:00:00 2001 From: Mark MacKay Date: Wed, 25 Jul 2012 18:02:29 -0500 Subject: [PATCH] source editor no longer brreaks stuff --- editor/svg-editor.css | 2 +- editor/svg-editor.js | 14 - editor/svgcanvas.js | 4 - editor/svgedit.compiled.css | 2 +- editor/svgedit.compiled.js | 1151 +++++++++++++++--------------- editor/temp.css | 2 +- method-draw/svg-editor.css | 2 +- method-draw/svg-editor.js | 14 - method-draw/svgcanvas.js | 4 - method-draw/svgedit.compiled.css | 2 +- method-draw/svgedit.compiled.js | 1151 +++++++++++++++--------------- method-draw/temp.css | 2 +- 12 files changed, 1156 insertions(+), 1194 deletions(-) diff --git a/editor/svg-editor.css b/editor/svg-editor.css index d4a3d75..b3a531c 100644 --- a/editor/svg-editor.css +++ b/editor/svg-editor.css @@ -715,7 +715,7 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), } input[type=submit]:hover, button:hover {background: #2F84C1;} - input[type=submit]:active, button:active {padding: 6px 10px 4px 10px; box-shadow: inset 0 2px 2px rgba(0,0,0,0.2); border-bottom: solid rgba(255,255,255,0.1) 1px;} + input[type=submit]:active, button:active { box-shadow: inset 0 2px 2px rgba(0,0,0,0.2); border-bottom: solid rgba(255,255,255,0.1) 1px;} #tools_left { diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 87543ec..b1f17ed 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -724,8 +724,6 @@ } $('#cur_context_panel').toggle(!!context).html(link_str); - - updateTitle(); } // Makes sure the current selected paint is available to work with @@ -2558,7 +2556,6 @@ svgCanvas.clearSelection(); hideSourceEditor(); zoomImage(); - updateTitle(); prepPaints(); } @@ -2573,17 +2570,6 @@ setSelectMode(); }; - var updateTitle = function(title) { - title = title || svgCanvas.getDocumentTitle(); - var new_title = orig_title + (title?': ' + title:''); - - // Remove title update with current context info, isn't really necessary -// if(cur_context) { -// new_title = new_title + cur_context; -// } - $('title:first').text(new_title); - } - function setBackground(color, url) { // if(color == curPrefs.bkgd_color && url == curPrefs.bkgd_url) return; $.pref('bkgd_color', color); diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index efa6738..b51a118 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -2736,7 +2736,6 @@ var getMouseTarget = this.getMouseTarget = function(evt) { if (evt.originalEvent.touches && evt.originalEvent.touches.length > 1) return; if (!started) return; if(evt.button === 1 || canvas.spaceKey) return; - var selected = selectedElements[0], pt = transformPoint( evt.pageX, evt.pageY, root_sctm ), mouse_x = pt.x * current_zoom, @@ -2769,7 +2768,6 @@ var getMouseTarget = this.getMouseTarget = function(evt) { } if(evt.shiftKey) { var xya = snapToAngle(start_x,start_y,x,y); x=xya.x; y=xya.y; } - if (dx != 0 || dy != 0) { var len = selectedElements.length; for (var i = 0; i < len; ++i) { @@ -3862,7 +3860,6 @@ var textActions = canvas.textActions = function() { // TODO: Find way to block native selection }, mouseMove: function(mouse_x, mouse_y) { - if (evt.originalEvent.touches && evt.originalEvent.touches.length > 1) return; var pt = screenToPt(mouse_x, mouse_y); setEndSelectionFromPoint(pt.x, pt.y); }, @@ -4372,7 +4369,6 @@ var pathActions = canvas.pathActions = function() { } }, mouseMove: function(evt, mouse_x, mouse_y) { - if (evt.originalEvent.touches && evt.originalEvent.touches.length > 1) return; hasMoved = true; if(current_mode === "path") { if(!drawn_path) return; diff --git a/editor/svgedit.compiled.css b/editor/svgedit.compiled.css index f4df7af..748085e 100644 --- a/editor/svgedit.compiled.css +++ b/editor/svgedit.compiled.css @@ -212,7 +212,7 @@ input[type=text].tuco,input[type=number].tuco{width:150px} input[type=submit],input[type=button],button{background:#4f80ff;color:#fff;border-radius:3px;padding:7px 17px;border:0;line-height:140%;font-size:14px;font-weight:bold;font-family:sans-serif} input[type=submit]:hover,button:hover{box-shadow:inset 0 3px 10px rgba(255,255,255,0.1),inset 0 -3px 10px rgba(0,0,0,0.2)} input[type=submit]:hover,button:hover{background:#2f84c1} -input[type=submit]:active,button:active{padding:6px 10px 4px 10px;box-shadow:inset 0 2px 2px rgba(0,0,0,0.2);border-bottom:solid rgba(255,255,255,0.1) 1px} +input[type=submit]:active,button:active{box-shadow:inset 0 2px 2px rgba(0,0,0,0.2);border-bottom:solid rgba(255,255,255,0.1) 1px} #tools_left{position:absolute;border-right:0;width:50px;top:30px;left:0;background:#2f2f2c;z-index:4} #workarea.wireframe #svgcontent *{fill:none;stroke:#000;stroke-width:1px;stroke-opacity:1.0;stroke-dasharray:0;opacity:1;pointer-events:stroke;vector-effect:non-scaling-stroke;filter:none} #workarea.wireframe #svgcontent text{fill:#000;stroke:none} diff --git a/editor/svgedit.compiled.js b/editor/svgedit.compiled.js index 7804722..69f5379 100644 --- a/editor/svgedit.compiled.js +++ b/editor/svgedit.compiled.js @@ -1,105 +1,105 @@ -function touchHandler(a){var p=a.changedTouches,g=p[0],c="";switch(a.type){case "touchstart":c="mousedown";break;case "touchmove":c="mousemove";break;case "touchend":c="mouseup";break;default:return}var m=document.createEvent("MouseEvent");m.initMouseEvent(c,true,true,window,1,g.screenX,g.screenY,g.clientX,g.clientY,false,false,false,false,0,null);if(p.length<2){g.target.dispatchEvent(m);a.preventDefault()}};(function(a){function p(g){if(typeof g.data==="string"){var c=g.handler,m=g.data.toLowerCase().split(" ");g.handler=function(s){if(!(this!==s.target&&(/textarea|select/i.test(s.target.nodeName)||s.target.type==="text"))){var b=s.type!=="keypress"&&a.hotkeys.specialKeys[s.which],f=String.fromCharCode(s.which).toLowerCase(),d="",k={};if(s.altKey&&b!=="alt")d+="alt+";if(s.ctrlKey&&b!=="ctrl")d+="ctrl+";if(s.metaKey&&!s.ctrlKey&&b!=="meta")d+="meta+";if(s.shiftKey&&b!=="shift")d+="shift+";if(b)k[d+b]= -true;else{k[d+f]=true;k[d+a.hotkeys.shiftNums[f]]=true;if(d==="shift+")k[a.hotkeys.shiftNums[f]]=true}b=0;for(f=m.length;b","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:p}})})(jQuery);(function(a,p){function g(da){return typeof da==="string"}function c(da){var W=d.call(arguments,1);return function(){return da.apply(this,W.concat(d.call(arguments)))}}function m(da,W,Z,oa,ra){var ma;if(oa!==f){W=Z.match(da?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);Z=W[3]||"";if(ra===2&&g(oa))oa=oa.replace(da?X:ba,"");else{ma=o(W[2]);oa=g(oa)?o[da?ia:P](oa):oa;oa=ra===2?oa:ra===1?a.extend({},oa,ma):a.extend({},ma,oa);oa=q(oa);if(da)oa=oa.replace(ta,k)}da=W[1]+(da?"#":oa||!W[1]?"?":"")+oa+Z}else da= -W(Z!==f?Z:p[qa][ga]);return da}function s(da,W,Z){if(W===f||typeof W==="boolean"){Z=W;W=q[da?ia:P]()}else W=g(W)?W.replace(da?X:ba,""):W;return o(W,Z)}function b(da,W,Z,oa){if(!g(Z)&&typeof Z!=="object"){oa=Z;Z=W;W=f}return this.each(function(){var ra=a(this),ma=W||S()[(this.nodeName||"").toLowerCase()]||"",na=ma&&ra.attr(ma)||"";ra.attr(ma,q[da](na,Z,oa))})}var f,d=Array.prototype.slice,k=decodeURIComponent,q=a.param,B,o,J,U=a.bbq=a.bbq||{},M,I,S,Y=a.event.special,P="querystring",ia="fragment",qa= -"location",ga="href",ba=/^.*\?|#.*$/g,X=/^.*\#/,ta,ka={};q[P]=c(m,0,function(da){return da.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});q[ia]=B=c(m,1,function(da){return da.replace(/^[^#]*#?(.*)$/,"$1")});B.noEscape=function(da){da=da||"";da=a.map(da.split(""),encodeURIComponent);ta=RegExp(da.join("|"),"g")};B.noEscape(",/");a.deparam=o=function(da,W){var Z={},oa={"true":true,"false":false,"null":null};a.each(da.replace(/\+/g," ").split("&"),function(ra,ma){var na=ma.split("="),Ca=k(na[0]),Ga=Z,Ja= -0,Da=Ca.split("]["),La=Da.length-1;if(/\[/.test(Da[0])&&/\]$/.test(Da[La])){Da[La]=Da[La].replace(/\]$/,"");Da=Da.shift().split("[").concat(Da);La=Da.length-1}else La=0;if(na.length===2){na=k(na[1]);if(W)na=na&&!isNaN(na)?+na:na==="undefined"?f:oa[na]!==f?oa[na]:na;if(La)for(;Ja<=La;Ja++){Ca=Da[Ja]===""?Ga.length:Da[Ja];Ga=Ga[Ca]=Ja').hide().insertAfter("body")[0].contentWindow; -I=function(){return c(U.document[b][f])};M=function(S,Y){if(S!==Y){var P=U.document;P.open().close();P[b].hash="#"+S}};M(c())}}var o={},J,U,M,I;o.start=function(){if(!J){var S=c();M||B();(function Y(){var P=c(),ia=I(S);if(P!==S){M(S=P,ia);a(p).trigger("hashchange")}else if(ia!==S)p[b][f]=p[b][f].replace(/#.*/,"")+"#"+ia;J=setTimeout(Y,a.hashchangeDelay)})()}};o.stop=function(){if(!U){J&&clearTimeout(J);J=0}};return o}()})(jQuery,this);(function(a){var p={},g;a.svgIcons=function(c,m){function s(da,W){if(da!=="ajax"){if(S)return;var Z=(U=ga[0].contentDocument)&&U.getElementById("svg_eof");if(!Z&&!(W&&Z)){Y++;if(Y<50)setTimeout(s,20);else{f();S=true}return}S=true}J=a(U.firstChild).children();if(m.no_img)setTimeout(function(){I||b()},500);else{Z=qa+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";M=a(new Image).attr({src:Z,width:0,height:0}).appendTo("body").load(function(){b(true)}).error(function(){b()})}} -function b(da,W){if(!I){if(m.no_img)da=false;if(da){var Z=a(document.createElement("div"));Z.hide().appendTo("body")}if(W){var oa=m.fallback_path?m.fallback_path:"";a.each(W,function(La,Oa){a("#"+La);var Ba=a(new Image).attr({"class":"svg_icon",src:oa+Oa,width:B,height:o,alt:"icon"});ka(Ba,La)})}else for(var ra=J.length,ma=0;ma0&&!da)za=g(za,Ba,true);ta(a(this),za,Oa)})});if(!W){da&&Z.remove();ga&&ga.remove();M&&M.remove()}m.resize&&a.resizeSvgIcons(m.resize);I=true;m.callback&&m.callback(p)}}function f(){if(c.indexOf(".svgz")!=-1){var da=c.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg");a.svgIcons(da,m)}else m.fallback&&b(false,m.fallback)} -function d(da){if(window.btoa)return window.btoa(da);var W=Array(Math.floor((da.length+2)/3)*4),Z,oa,ra,ma,na,Ca,Ga=0,Ja=0;do{Z=da.charCodeAt(Ga++);oa=da.charCodeAt(Ga++);ra=da.charCodeAt(Ga++);ma=Z>>2;Z=(Z&3)<<4|oa>>4;na=(oa&15)<<2|ra>>6;Ca=ra&63;if(isNaN(oa))na=Ca=64;else if(isNaN(ra))Ca=64;W[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(ma);W[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Z);W[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(na); -W[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Ca)}while(Ga-1&&P.indexOf("Chrome/");var qa="data:image/svg+xml;charset=utf-8;base64,";if(m.svgz){var ga=a('').appendTo("body").hide();try{U=ga[0].contentDocument;ga.load(s); -s(0,true)}catch(ba){f()}}else{var X=new DOMParser;a.ajax({url:c,dataType:"string",success:function(da){if(da){U=X.parseFromString(da,"text/xml");a(function(){s("ajax")})}else a(f)},error:function(da){if(window.opera)a(function(){f()});else if(da.responseText){U=X.parseFromString(da.responseText,"text/xml");U.childNodes.length||a(f);a(function(){s("ajax")})}else a(f)}})}var ta=function(da,W,Z,oa){ia&&W.css("visibility","hidden");if(m.replace){oa&&W.attr("id",Z);(Z=da.attr("class"))&&W.attr("class", -"svg_icon "+Z);da.replaceWith(W)}else da.append(W);ia&&setTimeout(function(){W.removeAttr("style")},1)},ka=function(da,W){if(m.id_match===undefined||m.id_match!==false)ta(holder,da,W,true);p[W]=da};g=function(da,W){var Z=da.find("defs");if(!Z.length)return da;Z=ia?Z.find("*").filter(function(){return!!this.id}):Z.find("[id]");var oa=da[0].getElementsByTagName("*"),ra=oa.length;Z.each(function(ma){var na=this.id;a(U).find("#"+na);this.id=ma="x"+na+W+ma;na="url(#"+na+")";var Ca="url(#"+ma+")";for(ma= -0;ma","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:p}})})(jQuery);(function(a,p){function g(da){return typeof da==="string"}function c(da){var V=d.call(arguments,1);return function(){return da.apply(this,V.concat(d.call(arguments)))}}function n(da,V,Z,oa,qa){var ma;if(oa!==f){V=Z.match(da?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);Z=V[3]||"";if(qa===2&&g(oa))oa=oa.replace(da?W:ba,"");else{ma=o(V[2]);oa=g(oa)?o[da?ia:O](oa):oa;oa=qa===2?oa:qa===1?a.extend({},oa,ma):a.extend({},ma,oa);oa=q(oa);if(da)oa=oa.replace(sa,l)}da=V[1]+(da?"#":oa||!V[1]?"?":"")+oa+Z}else da= +V(Z!==f?Z:p[pa][fa]);return da}function s(da,V,Z){if(V===f||typeof V==="boolean"){Z=V;V=q[da?ia:O]()}else V=g(V)?V.replace(da?W:ba,""):V;return o(V,Z)}function b(da,V,Z,oa){if(!g(Z)&&typeof Z!=="object"){oa=Z;Z=V;V=f}return this.each(function(){var qa=a(this),ma=V||Q()[(this.nodeName||"").toLowerCase()]||"",na=ma&&qa.attr(ma)||"";qa.attr(ma,q[da](na,Z,oa))})}var f,d=Array.prototype.slice,l=decodeURIComponent,q=a.param,B,o,K,T=a.bbq=a.bbq||{},M,J,Q,Y=a.event.special,O="querystring",ia="fragment",pa= +"location",fa="href",ba=/^.*\?|#.*$/g,W=/^.*\#/,sa,ka={};q[O]=c(n,0,function(da){return da.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});q[ia]=B=c(n,1,function(da){return da.replace(/^[^#]*#?(.*)$/,"$1")});B.noEscape=function(da){da=da||"";da=a.map(da.split(""),encodeURIComponent);sa=RegExp(da.join("|"),"g")};B.noEscape(",/");a.deparam=o=function(da,V){var Z={},oa={"true":true,"false":false,"null":null};a.each(da.replace(/\+/g," ").split("&"),function(qa,ma){var na=ma.split("="),Aa=l(na[0]),Fa=Z,Ia= +0,Ca=Aa.split("]["),Ka=Ca.length-1;if(/\[/.test(Ca[0])&&/\]$/.test(Ca[Ka])){Ca[Ka]=Ca[Ka].replace(/\]$/,"");Ca=Ca.shift().split("[").concat(Ca);Ka=Ca.length-1}else Ka=0;if(na.length===2){na=l(na[1]);if(V)na=na&&!isNaN(na)?+na:na==="undefined"?f:oa[na]!==f?oa[na]:na;if(Ka)for(;Ia<=Ka;Ia++){Aa=Ca[Ia]===""?Fa.length:Ca[Ia];Fa=Fa[Aa]=Ia').hide().insertAfter("body")[0].contentWindow; +J=function(){return c(T.document[b][f])};M=function(Q,Y){if(Q!==Y){var O=T.document;O.open().close();O[b].hash="#"+Q}};M(c())}}var o={},K,T,M,J;o.start=function(){if(!K){var Q=c();M||B();(function Y(){var O=c(),ia=J(Q);if(O!==Q){M(Q=O,ia);a(p).trigger("hashchange")}else if(ia!==Q)p[b][f]=p[b][f].replace(/#.*/,"")+"#"+ia;K=setTimeout(Y,a.hashchangeDelay)})()}};o.stop=function(){if(!T){K&&clearTimeout(K);K=0}};return o}()})(jQuery,this);(function(a){var p={},g;a.svgIcons=function(c,n){function s(da,V){if(da!=="ajax"){if(Q)return;var Z=(T=fa[0].contentDocument)&&T.getElementById("svg_eof");if(!Z&&!(V&&Z)){Y++;if(Y<50)setTimeout(s,20);else{f();Q=true}return}Q=true}K=a(T.firstChild).children();if(n.no_img)setTimeout(function(){J||b()},500);else{Z=pa+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";M=a(new Image).attr({src:Z,width:0,height:0}).appendTo("body").load(function(){b(true)}).error(function(){b()})}} +function b(da,V){if(!J){if(n.no_img)da=false;if(da){var Z=a(document.createElement("div"));Z.hide().appendTo("body")}if(V){var oa=n.fallback_path?n.fallback_path:"";a.each(V,function(Ka,Na){a("#"+Ka);var za=a(new Image).attr({"class":"svg_icon",src:oa+Na,width:B,height:o,alt:"icon"});ka(za,Ka)})}else for(var qa=K.length,ma=0;ma0&&!da)ya=g(ya,za,true);sa(a(this),ya,Na)})});if(!V){da&&Z.remove();fa&&fa.remove();M&&M.remove()}n.resize&&a.resizeSvgIcons(n.resize);J=true;n.callback&&n.callback(p)}}function f(){if(c.indexOf(".svgz")!=-1){var da=c.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg");a.svgIcons(da,n)}else n.fallback&&b(false,n.fallback)} +function d(da){if(window.btoa)return window.btoa(da);var V=Array(Math.floor((da.length+2)/3)*4),Z,oa,qa,ma,na,Aa,Fa=0,Ia=0;do{Z=da.charCodeAt(Fa++);oa=da.charCodeAt(Fa++);qa=da.charCodeAt(Fa++);ma=Z>>2;Z=(Z&3)<<4|oa>>4;na=(oa&15)<<2|qa>>6;Aa=qa&63;if(isNaN(oa))na=Aa=64;else if(isNaN(qa))Aa=64;V[Ia++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(ma);V[Ia++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Z);V[Ia++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(na); +V[Ia++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Aa)}while(Fa-1&&O.indexOf("Chrome/");var pa="data:image/svg+xml;charset=utf-8;base64,";if(n.svgz){var fa=a('').appendTo("body").hide();try{T=fa[0].contentDocument;fa.load(s); +s(0,true)}catch(ba){f()}}else{var W=new DOMParser;a.ajax({url:c,dataType:"string",success:function(da){if(da){T=W.parseFromString(da,"text/xml");a(function(){s("ajax")})}else a(f)},error:function(da){if(window.opera)a(function(){f()});else if(da.responseText){T=W.parseFromString(da.responseText,"text/xml");T.childNodes.length||a(f);a(function(){s("ajax")})}else a(f)}})}var sa=function(da,V,Z,oa){ia&&V.css("visibility","hidden");if(n.replace){oa&&V.attr("id",Z);(Z=da.attr("class"))&&V.attr("class", +"svg_icon "+Z);da.replaceWith(V)}else da.append(V);ia&&setTimeout(function(){V.removeAttr("style")},1)},ka=function(da,V){if(n.id_match===undefined||n.id_match!==false)sa(holder,da,V,true);p[V]=da};g=function(da,V){var Z=da.find("defs");if(!Z.length)return da;Z=ia?Z.find("*").filter(function(){return!!this.id}):Z.find("[id]");var oa=da[0].getElementsByTagName("*"),qa=oa.length;Z.each(function(ma){var na=this.id;a(T).find("#"+na);this.id=ma="x"+na+V+ma;na="url(#"+na+")";var Aa="url(#"+ma+")";for(ma= +0;ma=0;jQuery.fn.jGraduate=function(c){var m= -arguments;return this.each(function(){function s(la,ca,ja,O,T){var ea=T||a("stop",{"stop-color":ca,"stop-opacity":ja,offset:la},X);if(T){ca=T.getAttribute("stop-color");ja=T.getAttribute("stop-opacity");la=T.getAttribute("offset")}else X.appendChild(ea);if(ja===null)ja=1;T=a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:"url(#jGraduate_trans)",transform:"translate("+(10+la*ia)+", 26)"},rb);var Ha= -a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:ca,"fill-opacity":ja,transform:"translate("+(10+la*ia)+", 26)",stroke:"#000","stroke-width":1.5},rb);$(Ha).mousedown(function(Pa){b(this);Sa=jb;S.mousemove(k).mouseup(f);wa=$a.offset();Pa.preventDefault();return false}).data("stop",ea).data("bg",T).dblclick(function(){$("div.jGraduate_LightBox").show();for(var Pa=this,Xa=+ea.getAttribute("stop-opacity")|| -1,fb=ea.getAttribute("stop-color")||1,ob=(parseFloat(Xa)*255).toString(16);ob.length<2;)ob="0"+ob;ca=fb.substr(1)+ob;$("#"+o+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:B.images.clientPath},color:{active:ca,alphaSupport:true}},function(Wa){fb=Wa.val("hex")?"#"+Wa.val("hex"):"none";Xa=Wa.val("a")!==null?Wa.val("a")/256:1;Pa.setAttribute("fill",fb);Pa.setAttribute("fill-opacity",Xa);ea.setAttribute("stop-color", -fb);ea.setAttribute("stop-opacity",Xa);$("div.jGraduate_LightBox").hide();$("#"+o+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();$("#"+o+"_jGraduate_stopPicker").hide()})});$(X).find("stop").each(function(){var Pa=$(this);if(+this.getAttribute("offset")>la){if(!ca){var Xa=this.getAttribute("stop-color"),fb=this.getAttribute("stop-opacity");ea.setAttribute("stop-color",Xa);Ha.setAttribute("fill",Xa);ea.setAttribute("stop-opacity",fb===null?1:fb);Ha.setAttribute("fill-opacity", -fb===null?1:fb)}Pa.before(ea);return false}});O&&b(Ha);return ea}function b(la){jb&&jb.setAttribute("stroke","#000");la.setAttribute("stroke","blue");jb=la;jb.parentNode.appendChild(jb)}function f(){S.unbind("mousemove",k);if(Ea.getAttribute("display")!=="none"){Ea.setAttribute("display","none");var la=$(jb),ca=la.data("stop");la=la.data("bg");$([jb,ca,la]).remove()}Sa=null}function d(){var la=Ta?"rotate("+Ta+","+Fa+","+lb+") ":"";hb===1&&Ma===1?X.removeAttribute("gradientTransform"):X.setAttribute("gradientTransform", -la+"translate("+-Fa*(hb-1)+","+-lb*(Ma-1)+") scale("+hb+","+Ma+")")}function k(la){var ca=la.pageX-wa.left;la=la.pageY-wa.top;ca=ca<10?10:ca>ia+10?ia+10:ca;var ja="translate("+ca+", 26)";if(la<-60||la>130){Ea.setAttribute("display","block");Ea.setAttribute("transform",ja)}else Ea.setAttribute("display","none");Sa.setAttribute("transform",ja);$.data(Sa,"bg").setAttribute("transform",ja);$.data(Sa,"stop").setAttribute("offset",(ca-10)/ia);var O=0;$(X).find("stop").each(function(){var T=this.getAttribute("offset"), -ea=$(this);if(T
  • Solid Color
  • Linear Gradient
  • Radial Gradient
  • ');var Y=$(J+"> .jGraduate_colPick"),P=$(J+"> .jGraduate_gradPick");P.html('

    '+B.window.pickerTitle+'

    =0;jQuery.fn.jGraduate=function(c){var n= +arguments;return this.each(function(){function s(la,ca,ja,N,R){var ea=R||a("stop",{"stop-color":ca,"stop-opacity":ja,offset:la},W);if(R){ca=R.getAttribute("stop-color");ja=R.getAttribute("stop-opacity");la=R.getAttribute("offset")}else W.appendChild(ea);if(ja===null)ja=1;R=a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:"url(#jGraduate_trans)",transform:"translate("+(10+la*ia)+", 26)"},qb);var Ga= +a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:ca,"fill-opacity":ja,transform:"translate("+(10+la*ia)+", 26)",stroke:"#000","stroke-width":1.5},qb);$(Ga).mousedown(function(Oa){b(this);Ra=ib;Q.mousemove(l).mouseup(f);va=$a.offset();Oa.preventDefault();return false}).data("stop",ea).data("bg",R).dblclick(function(){$("div.jGraduate_LightBox").show();for(var Oa=this,Ya=+ea.getAttribute("stop-opacity")|| +1,db=ea.getAttribute("stop-color")||1,nb=(parseFloat(Ya)*255).toString(16);nb.length<2;)nb="0"+nb;ca=db.substr(1)+nb;$("#"+o+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:B.images.clientPath},color:{active:ca,alphaSupport:true}},function(Xa){db=Xa.val("hex")?"#"+Xa.val("hex"):"none";Ya=Xa.val("a")!==null?Xa.val("a")/256:1;Oa.setAttribute("fill",db);Oa.setAttribute("fill-opacity",Ya);ea.setAttribute("stop-color", +db);ea.setAttribute("stop-opacity",Ya);$("div.jGraduate_LightBox").hide();$("#"+o+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();$("#"+o+"_jGraduate_stopPicker").hide()})});$(W).find("stop").each(function(){var Oa=$(this);if(+this.getAttribute("offset")>la){if(!ca){var Ya=this.getAttribute("stop-color"),db=this.getAttribute("stop-opacity");ea.setAttribute("stop-color",Ya);Ga.setAttribute("fill",Ya);ea.setAttribute("stop-opacity",db===null?1:db);Ga.setAttribute("fill-opacity", +db===null?1:db)}Oa.before(ea);return false}});N&&b(Ga);return ea}function b(la){ib&&ib.setAttribute("stroke","#000");la.setAttribute("stroke","blue");ib=la;ib.parentNode.appendChild(ib)}function f(){Q.unbind("mousemove",l);if(Da.getAttribute("display")!=="none"){Da.setAttribute("display","none");var la=$(ib),ca=la.data("stop");la=la.data("bg");$([ib,ca,la]).remove()}Ra=null}function d(){var la=Ua?"rotate("+Ua+","+Ea+","+kb+") ":"";fb===1&&La===1?W.removeAttribute("gradientTransform"):W.setAttribute("gradientTransform", +la+"translate("+-Ea*(fb-1)+","+-kb*(La-1)+") scale("+fb+","+La+")")}function l(la){var ca=la.pageX-va.left;la=la.pageY-va.top;ca=ca<10?10:ca>ia+10?ia+10:ca;var ja="translate("+ca+", 26)";if(la<-60||la>130){Da.setAttribute("display","block");Da.setAttribute("transform",ja)}else Da.setAttribute("display","none");Ra.setAttribute("transform",ja);$.data(Ra,"bg").setAttribute("transform",ja);$.data(Ra,"stop").setAttribute("offset",(ca-10)/ia);var N=0;$(W).find("stop").each(function(){var R=this.getAttribute("offset"), +ea=$(this);if(R
  • Solid Color
  • Linear Gradient
  • Radial Gradient
  • ');var Y=$(K+"> .jGraduate_colPick"),O=$(K+"> .jGraduate_gradPick");O.html('

    '+B.window.pickerTitle+'


    ');var ia=256,qa=ia-0,ga=ia-0,ba,X,ta,ka={};$(".jGraduate_SliderBar").width(145);var da=$("#"+o+"_jGraduate_GradContainer")[0],W=a("svg",{id:o+"_jgraduate_svg",width:ia,height:ia,xmlns:p.svg},da);ba=ba||q.paint.type;var Z=X=q.paint[ba],oa=q.paint.alpha,ra=ba==="solidColor";switch(ba){case "solidColor":case "linearGradient":if(!ra){X.id=o+"_lg_jgraduate_grad"; -Z=X=W.appendChild(X)}a("radialGradient",{id:o+"_rg_jgraduate_grad"},W);if(ba==="linearGradient")break;case "radialGradient":if(!ra){X.id=o+"_rg_jgraduate_grad";Z=X=W.appendChild(X)}a("linearGradient",{id:o+"_lg_jgraduate_grad"},W)}if(ra){Z=X=$("#"+o+"_lg_jgraduate_grad")[0];I=q.paint[ba];s(0,"#"+I,1);var ma=typeof B.newstop;if(ma==="string")switch(B.newstop){case "same":s(1,"#"+I,1);break;case "inverse":ma="";for(var na=0;na<6;na+=2){I.substr(na,2);var Ca=(255-parseInt(I.substr(na,2),16)).toString(16); -if(Ca.length<2)Ca=0+Ca;ma+=Ca}s(1,"#"+ma,1);break;case "white":s(1,"#ffffff",1);break;case "black":s(1,"#000000",1)}else if(ma==="object")s(1,B.newstop.color||"#"+I,"opac"in B.newstop?B.newstop.opac:1)}I=parseFloat(Z.getAttribute("x1")||0);ma=parseFloat(Z.getAttribute("y1")||0);na=parseFloat(Z.getAttribute("x2")||1);Ca=parseFloat(Z.getAttribute("y2")||0);var Ga=parseFloat(Z.getAttribute("cx")||0.5),Ja=parseFloat(Z.getAttribute("cy")||0.5),Da=parseFloat(Z.getAttribute("fx")||Ga),La=parseFloat(Z.getAttribute("fy")|| -Ja);ta=a("rect",{id:o+"_jgraduate_rect",x:0,y:0,width:qa,height:ga,fill:"url(#"+o+"_jgraduate_grad)","fill-opacity":oa/100},W);var Oa=$("
    ").attr({"class":"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:ma*ia,left:I*ia}).data("coord","start").appendTo(da),Ba=Oa.clone().text(2).css({top:Ca*ia,left:na*ia}).attr("title","End stop").data("coord","end").appendTo(da),za=$("
    ").attr({"class":"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:Ja*ia,left:Ga* -ia}).data("coord","center").appendTo(da),Ia=za.clone().text("F").css({top:La*ia,left:Da*ia,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(da);Ia[0].id=o+"_jGraduate_focusCoord";$(J+" .grad_coord");$.each(["x1","y1","x2","y2","cx","cy","fx","fy"],function(la,ca){var ja=X.getAttribute(ca),O=isNaN(ca[1]);ja||(ja=O?"0.5":ca==="x2"?"1.0":"0.0");ka[ca]=$("#"+o+"_jGraduate_"+ca).val(ja).change(function(){if(isNaN(parseFloat(this.value))||this.value<0)this.value=0;else if(this.value> -1)this.value=1;if(!(ca[0]==="f"&&!kb))if(O&&ba==="radialGradient"||!O&&ba==="linearGradient")X.setAttribute(ca,this.value);var T=O?ca[0]==="c"?za:Ia:ca[1]==="1"?Oa:Ba,ea=ca.indexOf("x")>=0?"left":"top";T.css(ea,this.value*ia)}).change()});var xa,rb,$a=$("#"+o+"_jGraduate_StopSlider"),jb,Ua,Sa,Ea=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},Ua),wa,hb=1,Ma=1,Ta=0,Fa=Ga,lb=Ja;Ua=a("svg",{width:"100%",height:45},$a[0]);da=a("pattern",{width:16, -height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},Ua);a("image",{width:16,height:16},da).setAttributeNS(p.xlink,"xlink:href",B.images.clientPath+"map-opacity.png");$(Ua).on("click touchstart",function(la){wa=$a.offset();if(la.target.tagName!=="path"){var ca=la.pageX-wa.left-8;ca=ca<10?10:ca>ia+10?ia+10:ca;s(ca/ia,0,0,true);la.stopPropagation()}});$(Ua).mouseover(function(){Ua.appendChild(Ea)});rb=a("g",{},Ua);a("line",{x1:10,y1:15,x2:ia+10,y2:15,"stroke-width":2,stroke:"#000"},Ua);var tb= -P.find(".jGraduate_spreadMethod").change(function(){X.setAttribute("spreadMethod",$(this).val())}),Ya=null,bb=function(la){var ca=la.pageX-nb.left,ja=la.pageY-nb.top;ca=ca<0?0:ca>ia?ia:ca;ja=ja<0?0:ja>ia?ia:ja;Ya.css("left",ca).css("top",ja);ca=ca/qa;ja=ja/ga;var O=Ya.data("coord"),T=X;switch(O){case "start":ka.x1.val(ca);ka.y1.val(ja);T.setAttribute("x1",ca);T.setAttribute("y1",ja);break;case "end":ka.x2.val(ca);ka.y2.val(ja);T.setAttribute("x2",ca);T.setAttribute("y2",ja);break;case "center":ka.cx.val(ca); -ka.cy.val(ja);T.setAttribute("cx",ca);T.setAttribute("cy",ja);Fa=ca;lb=ja;d();break;case "focus":ka.fx.val(ca);ka.fy.val(ja);T.setAttribute("fx",ca);T.setAttribute("fy",ja);d()}la.preventDefault()},Cb=function(){Ya=null;S.unbind("mousemove",bb).unbind("mouseup",Cb)};xa=X.getElementsByTagNameNS(p.svg,"stop");if(ua<2){for(;ua<2;){X.appendChild(document.createElementNS(p.svg,"stop"));++ua}xa=X.getElementsByTagNameNS(p.svg,"stop")}var ua=xa.length;for(na=0;na99.5)O=99.5;if(O>0)Ma=1-O/100;else hb=-(O/100)-1;T=145*((O+100)/ -2)/100;ea&&d();break;case "angle":Ta=O;T=Ta/180;T+=0.5;T*=145;ea&&d()}if(T>145)T=145;else if(T<0)T=0;ja.css({"margin-left":T-5})}).change()});var ub=function(la){var ca=la.pageX-gb.offset.left-parseInt(gb.parent.css("border-left-width"));if(ca>145)ca=145;if(ca<=0)ca=0;var ja=ca-5;ca/=145;switch(gb.type){case "radius":ca=Math.pow(ca*2,2.5);if(ca>0.98&&ca<1.02)ca=1;if(ca<=0.01)ca=0.01;X.setAttribute("r",ca);break;case "opacity":q.paint.alpha=parseInt(ca*100);ta.setAttribute("fill-opacity",ca);break; -case "ellip":Ma=hb=1;if(ca<0.5){ca/=0.5;hb=ca<=0?0.01:ca}else if(ca>0.5){ca/=0.5;ca=2-ca;Ma=ca<=0?0.01:ca}d();ca-=1;if(Ma===ca+1)ca=Math.abs(ca);break;case "angle":ca-=0.5;Ta=ca*=180;d();ca/=100}gb.elem.css({"margin-left":ja});ca=Math.round(ca*100);gb.input.val(ca);la.preventDefault()},vb=function(){S.unbind("mousemove",ub).unbind("mouseup",vb);gb=null};for(P=(q.paint.alpha*255/100).toString(16);P.length<2;)P="0"+P;P=P.split(".")[0];I=q.paint.solidColor=="none"?"":q.paint.solidColor+P;ra||(I=xa[0].getAttribute("stop-color")); -$.extend($.fn.jPicker.defaults.window,{alphaSupport:true,effects:{type:"show",speed:0}});Y.jPicker({window:{title:B.window.pickerTitle},images:{clientPath:B.images.clientPath},color:{active:I,alphaSupport:true}},function(la){q.paint.type="solidColor";q.paint.alpha=la.val("ahex")?Math.round(la.val("a")/255*100):100;q.paint.solidColor=la.val("hex")?la.val("hex"):"none";q.paint.radialGradient=null;U()},null,function(){M()});var xb=$(J+" .jGraduate_tabs li");xb.on("click touchstart",function(){xb.removeClass("jGraduate_tab_current"); -$(this).addClass("jGraduate_tab_current");$(J+" > div").hide();var la=$(this).attr("data-type");$(J+" .jGraduate_gradPick").show();if(la==="rg"||la==="lg"){$(".jGraduate_"+la+"_field").show();$(".jGraduate_"+(la==="lg"?"rg":"lg")+"_field").hide();$("#"+o+"_jgraduate_rect")[0].setAttribute("fill","url(#"+o+"_"+la+"_jgraduate_grad)");ba=la==="lg"?"linearGradient":"radialGradient";$("#"+o+"_jGraduate_OpacInput").val(q.paint.alpha).change();var ca=$("#"+o+"_"+la+"_jgraduate_grad")[0];if(X!==ca){var ja= -$(X).find("stop");$(ca).empty().append(ja);X=ca;ca=tb.val();X.setAttribute("spreadMethod",ca)}kb=la==="rg"&&X.getAttribute("fx")!=null&&!(Ga==Da&&Ja==La);$("#"+o+"_jGraduate_focusCoord").toggle(kb);if(kb)$("#"+o+"_jGraduate_match_ctr")[0].checked=false}else{$(J+" .jGraduate_gradPick").hide();$(J+" .jGraduate_colPick").show()}});$(J+" > div").hide();xb.removeClass("jGraduate_tab_current");var Ab;switch(q.paint.type){case "linearGradient":Ab=$(J+" .jGraduate_tab_lingrad");break;case "radialGradient":Ab= -$(J+" .jGraduate_tab_radgrad");break;default:Ab=$(J+" .jGraduate_tab_color")}q.show();setTimeout(function(){Ab.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})();jQuery&&function(){var a=$(window),p=$(document);$.extend($.fn,{contextMenu:function(g,c){if(g.menu==undefined)return false;if(g.inSpeed==undefined)g.inSpeed=150;if(g.outSpeed==undefined)g.outSpeed=75;if(g.inSpeed==0)g.inSpeed=-1;if(g.outSpeed==0)g.outSpeed=-1;$(this).each(function(){var m=$(this),s=$(m).offset(),b=$("#"+g.menu);b.addClass("contextMenu");$(this).bind("mousedown",function(d){$(this).on("mouseup",function(k){var q=$(this);q.unbind("mouseup");$(".contextMenu").hide();if(d.button===2|| -g.allowLeft||d.ctrlKey&&svgedit.browser.isMac())svgedit.browser.isTouch()||f(k,d,q)})});svgedit.browser.isTouch()&&$(this).bind("taphold",function(d){var k=$(this);k.unbind("mouseup");f(d,d,k)});var f=function(d,k,q){if(typeof k=="undefined")k=d;d.stopPropagation();if(m.hasClass("disabled")||k.altKey)return false;var B=d.pageX,o=d.pageY;if(svgedit.browser.isTouch()){B=d.originalEvent.touches[0].pageX;o=d.originalEvent.touches[0].pageY}d=a.width()-b.width();k=a.height()-b.height();if(B>d-15)B=d-15; -if(o>k-30)o=k-30;if(svgedit.browser.isTouch())o-=b.height()/2;p.unbind("click");b.css({top:o,left:B}).fadeIn(g.inSpeed);b.find("A").mouseover(function(){b.find("LI.hover").removeClass("hover");$(this).parent().addClass("hover")}).mouseout(function(){b.find("LI.hover").removeClass("hover")});p.keypress(function(J){switch(J.keyCode){case 38:if(b.find("LI.hover").length){b.find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover");b.find("LI.hover").length||b.find("LI:last").addClass("hover")}else b.find("LI:last").addClass("hover"); +o+'_jGraduate_Ok" class="jGraduate_Ok" value="OK"/>
    ');var ia=256,pa=ia-0,fa=ia-0,ba,W,sa,ka={};$(".jGraduate_SliderBar").width(145);var da=$("#"+o+"_jGraduate_GradContainer")[0],V=a("svg",{id:o+"_jgraduate_svg",width:ia,height:ia,xmlns:p.svg},da);ba=ba||q.paint.type;var Z=W=q.paint[ba],oa=q.paint.alpha,qa=ba==="solidColor";switch(ba){case "solidColor":case "linearGradient":if(!qa){W.id=o+"_lg_jgraduate_grad"; +Z=W=V.appendChild(W)}a("radialGradient",{id:o+"_rg_jgraduate_grad"},V);if(ba==="linearGradient")break;case "radialGradient":if(!qa){W.id=o+"_rg_jgraduate_grad";Z=W=V.appendChild(W)}a("linearGradient",{id:o+"_lg_jgraduate_grad"},V)}if(qa){Z=W=$("#"+o+"_lg_jgraduate_grad")[0];J=q.paint[ba];s(0,"#"+J,1);var ma=typeof B.newstop;if(ma==="string")switch(B.newstop){case "same":s(1,"#"+J,1);break;case "inverse":ma="";for(var na=0;na<6;na+=2){J.substr(na,2);var Aa=(255-parseInt(J.substr(na,2),16)).toString(16); +if(Aa.length<2)Aa=0+Aa;ma+=Aa}s(1,"#"+ma,1);break;case "white":s(1,"#ffffff",1);break;case "black":s(1,"#000000",1)}else if(ma==="object")s(1,B.newstop.color||"#"+J,"opac"in B.newstop?B.newstop.opac:1)}J=parseFloat(Z.getAttribute("x1")||0);ma=parseFloat(Z.getAttribute("y1")||0);na=parseFloat(Z.getAttribute("x2")||1);Aa=parseFloat(Z.getAttribute("y2")||0);var Fa=parseFloat(Z.getAttribute("cx")||0.5),Ia=parseFloat(Z.getAttribute("cy")||0.5),Ca=parseFloat(Z.getAttribute("fx")||Fa),Ka=parseFloat(Z.getAttribute("fy")|| +Ia);sa=a("rect",{id:o+"_jgraduate_rect",x:0,y:0,width:pa,height:fa,fill:"url(#"+o+"_jgraduate_grad)","fill-opacity":oa/100},V);var Na=$("
    ").attr({"class":"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:ma*ia,left:J*ia}).data("coord","start").appendTo(da),za=Na.clone().text(2).css({top:Aa*ia,left:na*ia}).attr("title","End stop").data("coord","end").appendTo(da),ya=$("
    ").attr({"class":"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:Ia*ia,left:Fa* +ia}).data("coord","center").appendTo(da),Ha=ya.clone().text("F").css({top:Ka*ia,left:Ca*ia,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(da);Ha[0].id=o+"_jGraduate_focusCoord";$(K+" .grad_coord");$.each(["x1","y1","x2","y2","cx","cy","fx","fy"],function(la,ca){var ja=W.getAttribute(ca),N=isNaN(ca[1]);ja||(ja=N?"0.5":ca==="x2"?"1.0":"0.0");ka[ca]=$("#"+o+"_jGraduate_"+ca).val(ja).change(function(){if(isNaN(parseFloat(this.value))||this.value<0)this.value=0;else if(this.value> +1)this.value=1;if(!(ca[0]==="f"&&!jb))if(N&&ba==="radialGradient"||!N&&ba==="linearGradient")W.setAttribute(ca,this.value);var R=N?ca[0]==="c"?ya:Ha:ca[1]==="1"?Na:za,ea=ca.indexOf("x")>=0?"left":"top";R.css(ea,this.value*ia)}).change()});var wa,qb,$a=$("#"+o+"_jGraduate_StopSlider"),ib,Va,Ra,Da=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},Va),va,fb=1,La=1,Ua=0,Ea=Fa,kb=Ia;Va=a("svg",{width:"100%",height:45},$a[0]);da=a("pattern",{width:16, +height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},Va);a("image",{width:16,height:16},da).setAttributeNS(p.xlink,"xlink:href",B.images.clientPath+"map-opacity.png");$(Va).on("click touchstart",function(la){va=$a.offset();if(la.target.tagName!=="path"){var ca=la.pageX-va.left-8;ca=ca<10?10:ca>ia+10?ia+10:ca;s(ca/ia,0,0,true);la.stopPropagation()}});$(Va).mouseover(function(){Va.appendChild(Da)});qb=a("g",{},Va);a("line",{x1:10,y1:15,x2:ia+10,y2:15,"stroke-width":2,stroke:"#000"},Va);var sb= +O.find(".jGraduate_spreadMethod").change(function(){W.setAttribute("spreadMethod",$(this).val())}),Za=null,bb=function(la){var ca=la.pageX-mb.left,ja=la.pageY-mb.top;ca=ca<0?0:ca>ia?ia:ca;ja=ja<0?0:ja>ia?ia:ja;Za.css("left",ca).css("top",ja);ca=ca/pa;ja=ja/fa;var N=Za.data("coord"),R=W;switch(N){case "start":ka.x1.val(ca);ka.y1.val(ja);R.setAttribute("x1",ca);R.setAttribute("y1",ja);break;case "end":ka.x2.val(ca);ka.y2.val(ja);R.setAttribute("x2",ca);R.setAttribute("y2",ja);break;case "center":ka.cx.val(ca); +ka.cy.val(ja);R.setAttribute("cx",ca);R.setAttribute("cy",ja);Ea=ca;kb=ja;d();break;case "focus":ka.fx.val(ca);ka.fy.val(ja);R.setAttribute("fx",ca);R.setAttribute("fy",ja);d()}la.preventDefault()},Cb=function(){Za=null;Q.unbind("mousemove",bb).unbind("mouseup",Cb)};wa=W.getElementsByTagNameNS(p.svg,"stop");if(ta<2){for(;ta<2;){W.appendChild(document.createElementNS(p.svg,"stop"));++ta}wa=W.getElementsByTagNameNS(p.svg,"stop")}var ta=wa.length;for(na=0;na99.5)N=99.5;if(N>0)La=1-N/100;else fb=-(N/100)-1;R=145*((N+100)/ +2)/100;ea&&d();break;case "angle":Ua=N;R=Ua/180;R+=0.5;R*=145;ea&&d()}if(R>145)R=145;else if(R<0)R=0;ja.css({"margin-left":R-5})}).change()});var tb=function(la){var ca=la.pageX-eb.offset.left-parseInt(eb.parent.css("border-left-width"));if(ca>145)ca=145;if(ca<=0)ca=0;var ja=ca-5;ca/=145;switch(eb.type){case "radius":ca=Math.pow(ca*2,2.5);if(ca>0.98&&ca<1.02)ca=1;if(ca<=0.01)ca=0.01;W.setAttribute("r",ca);break;case "opacity":q.paint.alpha=parseInt(ca*100);sa.setAttribute("fill-opacity",ca);break; +case "ellip":La=fb=1;if(ca<0.5){ca/=0.5;fb=ca<=0?0.01:ca}else if(ca>0.5){ca/=0.5;ca=2-ca;La=ca<=0?0.01:ca}d();ca-=1;if(La===ca+1)ca=Math.abs(ca);break;case "angle":ca-=0.5;Ua=ca*=180;d();ca/=100}eb.elem.css({"margin-left":ja});ca=Math.round(ca*100);eb.input.val(ca);la.preventDefault()},ub=function(){Q.unbind("mousemove",tb).unbind("mouseup",ub);eb=null};for(O=(q.paint.alpha*255/100).toString(16);O.length<2;)O="0"+O;O=O.split(".")[0];J=q.paint.solidColor=="none"?"":q.paint.solidColor+O;qa||(J=wa[0].getAttribute("stop-color")); +$.extend($.fn.jPicker.defaults.window,{alphaSupport:true,effects:{type:"show",speed:0}});Y.jPicker({window:{title:B.window.pickerTitle},images:{clientPath:B.images.clientPath},color:{active:J,alphaSupport:true}},function(la){q.paint.type="solidColor";q.paint.alpha=la.val("ahex")?Math.round(la.val("a")/255*100):100;q.paint.solidColor=la.val("hex")?la.val("hex"):"none";q.paint.radialGradient=null;T()},null,function(){M()});var wb=$(K+" .jGraduate_tabs li");wb.on("click touchstart",function(){wb.removeClass("jGraduate_tab_current"); +$(this).addClass("jGraduate_tab_current");$(K+" > div").hide();var la=$(this).attr("data-type");$(K+" .jGraduate_gradPick").show();if(la==="rg"||la==="lg"){$(".jGraduate_"+la+"_field").show();$(".jGraduate_"+(la==="lg"?"rg":"lg")+"_field").hide();$("#"+o+"_jgraduate_rect")[0].setAttribute("fill","url(#"+o+"_"+la+"_jgraduate_grad)");ba=la==="lg"?"linearGradient":"radialGradient";$("#"+o+"_jGraduate_OpacInput").val(q.paint.alpha).change();var ca=$("#"+o+"_"+la+"_jgraduate_grad")[0];if(W!==ca){var ja= +$(W).find("stop");$(ca).empty().append(ja);W=ca;ca=sb.val();W.setAttribute("spreadMethod",ca)}jb=la==="rg"&&W.getAttribute("fx")!=null&&!(Fa==Ca&&Ia==Ka);$("#"+o+"_jGraduate_focusCoord").toggle(jb);if(jb)$("#"+o+"_jGraduate_match_ctr")[0].checked=false}else{$(K+" .jGraduate_gradPick").hide();$(K+" .jGraduate_colPick").show()}});$(K+" > div").hide();wb.removeClass("jGraduate_tab_current");var Ab;switch(q.paint.type){case "linearGradient":Ab=$(K+" .jGraduate_tab_lingrad");break;case "radialGradient":Ab= +$(K+" .jGraduate_tab_radgrad");break;default:Ab=$(K+" .jGraduate_tab_color")}q.show();setTimeout(function(){Ab.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})();jQuery&&function(){var a=$(window),p=$(document);$.extend($.fn,{contextMenu:function(g,c){if(g.menu==undefined)return false;if(g.inSpeed==undefined)g.inSpeed=150;if(g.outSpeed==undefined)g.outSpeed=75;if(g.inSpeed==0)g.inSpeed=-1;if(g.outSpeed==0)g.outSpeed=-1;$(this).each(function(){var n=$(this),s=$(n).offset(),b=$("#"+g.menu);b.addClass("contextMenu");$(this).bind("mousedown",function(d){$(this).on("mouseup",function(l){var q=$(this);q.unbind("mouseup");$(".contextMenu").hide();if(d.button===2|| +g.allowLeft||d.ctrlKey&&svgedit.browser.isMac())svgedit.browser.isTouch()||f(l,d,q)})});svgedit.browser.isTouch()&&$(this).bind("taphold",function(d){var l=$(this);l.unbind("mouseup");f(d,d,l)});var f=function(d,l,q){if(typeof l=="undefined")l=d;d.stopPropagation();if(n.hasClass("disabled")||l.altKey)return false;var B=d.pageX,o=d.pageY;if(svgedit.browser.isTouch()){B=d.originalEvent.touches[0].pageX;o=d.originalEvent.touches[0].pageY}d=a.width()-b.width();l=a.height()-b.height();if(B>d-15)B=d-15; +if(o>l-30)o=l-30;if(svgedit.browser.isTouch())o-=b.height()/2;p.unbind("click");b.css({top:o,left:B}).fadeIn(g.inSpeed);b.find("A").mouseover(function(){b.find("LI.hover").removeClass("hover");$(this).parent().addClass("hover")}).mouseout(function(){b.find("LI.hover").removeClass("hover")});p.keypress(function(K){switch(K.keyCode){case 38:if(b.find("LI.hover").length){b.find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover");b.find("LI.hover").length||b.find("LI:last").addClass("hover")}else b.find("LI:last").addClass("hover"); break;case 40:if(b.find("LI.hover").length==0)b.find("LI:first").addClass("hover");else{b.find("LI.hover").removeClass("hover").nextAll("LI:not(.disabled)").eq(0).addClass("hover");b.find("LI.hover").length||b.find("LI:first").addClass("hover")}break;case 13:b.find("LI.hover A").trigger("click");break;case 27:p.trigger("click")}});b.find("A").unbind("mouseup");b.find("LI:not(.disabled) A").mouseup(function(){p.unbind("click").unbind("keypress");$(".contextMenu").hide();c&&c($(this).attr("href").substr(1), -$(q),{x:B-s.left,y:o-s.top,docX:B,docY:o});return false});setTimeout(function(){p.click(function(){p.unbind("click").unbind("keypress");b.fadeOut(g.outSpeed);return false})},0)};if($.browser.mozilla)$("#"+g.menu).each(function(){$(this).css({MozUserSelect:"none"})});else $.browser.msie?$("#"+g.menu).each(function(){$(this).bind("selectstart.disableTextSelect",function(){return false})}):$("#"+g.menu).each(function(){$(this).bind("mousedown.disableTextSelect",function(){return false})});$(m).add($("UL.contextMenu")).bind("contextmenu", -function(){return false})});return $(this)},disableContextMenuItems:function(g){if(g==undefined){$(this).find("LI").addClass("disabled");return $(this)}$(this).each(function(){if(g!=undefined)for(var c=g.split(","),m=0;m=0,s=p.indexOf("Gecko/")>=0,b=p.indexOf("MSIE")>=0,f=p.indexOf("Chrome/")>=0,d=p.indexOf("Windows")>=0,k=p.indexOf("Macintosh")>= -0,q="ontouchstart"in window,B=!!g.querySelector,o=!!document.evaluate,J=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","path");qa.setAttribute("d","M0,0 10,10");var ga=qa.pathSegList;qa=qa.createSVGPathSegLinetoAbs(5,5);try{ga.replaceItem(qa,0);return true}catch(ba){}return false}(),U=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","path");qa.setAttribute("d","M0,0 10,10");var ga=qa.pathSegList;qa=qa.createSVGPathSegLinetoAbs(5,5);try{ga.insertItemBefore(qa, -0);return true}catch(ba){}return false}(),M=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","svg"),ga=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(qa);ga.setAttribute("x",5);qa.appendChild(ga);var ba=document.createElementNS("http://www.w3.org/2000/svg","text");ba.textContent="a";ga.appendChild(ba);ga=ba.getStartPositionOfChar(0).x;document.documentElement.removeChild(qa);return ga===0}(),I=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg", -"svg");document.documentElement.appendChild(qa);var ga=document.createElementNS("http://www.w3.org/2000/svg","path");ga.setAttribute("d","M0,0 C0,0 10,10 10,0");qa.appendChild(ga);ga=ga.getBBox();document.documentElement.removeChild(qa);return ga.height>4&&ga.height<5}(),S=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(qa);var ga=document.createElementNS("http://www.w3.org/2000/svg","path");ga.setAttribute("d","M0,0 10,0");var ba= -document.createElementNS("http://www.w3.org/2000/svg","path");ba.setAttribute("d","M5,0 15,0");var X=document.createElementNS("http://www.w3.org/2000/svg","g");X.appendChild(ga);X.appendChild(ba);qa.appendChild(X);ga=X.getBBox();document.documentElement.removeChild(qa);return ga.width==15}(),Y=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","rect");qa.setAttribute("x",0.1);(qa=qa.cloneNode(false).getAttribute("x").indexOf(",")==-1)||$.alert("NOTE: This version of Opera is known to contain bugs in SVG-edit.\n\t\tPlease upgrade to the latest version in which the problems have been fixed."); -return qa}(),P=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","rect");qa.setAttribute("style","vector-effect:non-scaling-stroke");return qa.style.vectorEffect==="non-scaling-stroke"}(),ia=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","rect").transform.baseVal,ga=g.createSVGTransform();qa.appendItem(ga);return qa.getItem(0)==ga}();svgedit.browser.isOpera=function(){return c};svgedit.browser.isWebkit=function(){return m};svgedit.browser.isGecko=function(){return s}; -svgedit.browser.isIE=function(){return b};svgedit.browser.isChrome=function(){return f};svgedit.browser.isWindows=function(){return d};svgedit.browser.isMac=function(){return k};svgedit.browser.isTouch=function(){return q};svgedit.browser.supportsSelectors=function(){return B};svgedit.browser.supportsXpath=function(){return o};svgedit.browser.supportsPathReplaceItem=function(){return J};svgedit.browser.supportsPathInsertItemBefore=function(){return U};svgedit.browser.supportsPathBBox=function(){return I}; -svgedit.browser.supportsHVLineContainerBBox=function(){return S};svgedit.browser.supportsGoodTextCharPos=function(){return M};svgedit.browser.supportsEditableText=function(){return c};svgedit.browser.supportsGoodDecimals=function(){return Y};svgedit.browser.supportsNonScalingStroke=function(){return P};svgedit.browser.supportsNativeTransformLists=function(){return ia}}else window.location="browser-not-supported.html"})();svgedit=svgedit||{}; -(function(){if(!svgedit.transformlist)svgedit.transformlist={};var a=document.createElementNS("http://www.w3.org/2000/svg","svg"),p={};svgedit.transformlist.SVGTransformList=function(g){this._elem=g||null;this._xforms=[];this._update=function(){var c="";a.createSVGMatrix();for(var m=0;m=0)return this._xforms[c];throw{code:1};};this.insertItemBefore=function(c,m){var s=null;if(m>=0)if(m=0){this._removeFromOtherLists(c);s=this._xforms[m]=c;this._list._update()}return s};this.removeItem=function(c){if(c=0){for(var m=this._xforms[c],s=Array(this.numberOfItems- -1),b=0;b=0,s=p.indexOf("Gecko/")>=0,b=p.indexOf("MSIE")>=0,f=p.indexOf("Chrome/")>=0,d=p.indexOf("Windows")>=0,l=p.indexOf("Macintosh")>= +0,q="ontouchstart"in window,B=!!g.querySelector,o=!!document.evaluate,K=function(){var pa=document.createElementNS("http://www.w3.org/2000/svg","path");pa.setAttribute("d","M0,0 10,10");var fa=pa.pathSegList;pa=pa.createSVGPathSegLinetoAbs(5,5);try{fa.replaceItem(pa,0);return true}catch(ba){}return false}(),T=function(){var pa=document.createElementNS("http://www.w3.org/2000/svg","path");pa.setAttribute("d","M0,0 10,10");var fa=pa.pathSegList;pa=pa.createSVGPathSegLinetoAbs(5,5);try{fa.insertItemBefore(pa, +0);return true}catch(ba){}return false}(),M=function(){var pa=document.createElementNS("http://www.w3.org/2000/svg","svg"),fa=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(pa);fa.setAttribute("x",5);pa.appendChild(fa);var ba=document.createElementNS("http://www.w3.org/2000/svg","text");ba.textContent="a";fa.appendChild(ba);fa=ba.getStartPositionOfChar(0).x;document.documentElement.removeChild(pa);return fa===0}(),J=function(){var pa=document.createElementNS("http://www.w3.org/2000/svg", +"svg");document.documentElement.appendChild(pa);var fa=document.createElementNS("http://www.w3.org/2000/svg","path");fa.setAttribute("d","M0,0 C0,0 10,10 10,0");pa.appendChild(fa);fa=fa.getBBox();document.documentElement.removeChild(pa);return fa.height>4&&fa.height<5}(),Q=function(){var pa=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(pa);var fa=document.createElementNS("http://www.w3.org/2000/svg","path");fa.setAttribute("d","M0,0 10,0");var ba= +document.createElementNS("http://www.w3.org/2000/svg","path");ba.setAttribute("d","M5,0 15,0");var W=document.createElementNS("http://www.w3.org/2000/svg","g");W.appendChild(fa);W.appendChild(ba);pa.appendChild(W);fa=W.getBBox();document.documentElement.removeChild(pa);return fa.width==15}(),Y=function(){var pa=document.createElementNS("http://www.w3.org/2000/svg","rect");pa.setAttribute("x",0.1);(pa=pa.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 pa}(),O=function(){var pa=document.createElementNS("http://www.w3.org/2000/svg","rect");pa.setAttribute("style","vector-effect:non-scaling-stroke");return pa.style.vectorEffect==="non-scaling-stroke"}(),ia=function(){var pa=document.createElementNS("http://www.w3.org/2000/svg","rect").transform.baseVal,fa=g.createSVGTransform();pa.appendItem(fa);return pa.getItem(0)==fa}();svgedit.browser.isOpera=function(){return c};svgedit.browser.isWebkit=function(){return n};svgedit.browser.isGecko=function(){return s}; +svgedit.browser.isIE=function(){return b};svgedit.browser.isChrome=function(){return f};svgedit.browser.isWindows=function(){return d};svgedit.browser.isMac=function(){return l};svgedit.browser.isTouch=function(){return q};svgedit.browser.supportsSelectors=function(){return B};svgedit.browser.supportsXpath=function(){return o};svgedit.browser.supportsPathReplaceItem=function(){return K};svgedit.browser.supportsPathInsertItemBefore=function(){return T};svgedit.browser.supportsPathBBox=function(){return J}; +svgedit.browser.supportsHVLineContainerBBox=function(){return Q};svgedit.browser.supportsGoodTextCharPos=function(){return M};svgedit.browser.supportsEditableText=function(){return c};svgedit.browser.supportsGoodDecimals=function(){return Y};svgedit.browser.supportsNonScalingStroke=function(){return O};svgedit.browser.supportsNativeTransformLists=function(){return ia}}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"),p={};svgedit.transformlist.SVGTransformList=function(g){this._elem=g||null;this._xforms=[];this._update=function(){var c="";a.createSVGMatrix();for(var n=0;n=0)return this._xforms[c];throw{code:1};};this.insertItemBefore=function(c,n){var s=null;if(n>=0)if(n=0){this._removeFromOtherLists(c);s=this._xforms[n]=c;this._list._update()}return s};this.removeItem=function(c){if(c=0){for(var n=this._xforms[c],s=Array(this.numberOfItems- +1),b=0;b1;)c=p[g-1].multiply(c);if(Math.abs(c.a)<1.0E-14)c.a=0;if(Math.abs(c.b)<1.0E-14)c.b=0;if(Math.abs(c.c)<1.0E-14)c.c=0;if(Math.abs(c.d)< -1.0E-14)c.d=0;if(Math.abs(c.e)<1.0E-14)c.e=0;if(Math.abs(c.f)<1.0E-14)c.f=0;return c};svgedit.math.hasMatrixTransform=function(p){if(!p)return false;for(var g=p.numberOfItems;g--;){var c=p.getItem(g);if(c.type==1&&!svgedit.math.isIdentity(c.matrix))return true}return false};svgedit.math.transformBox=function(p,g,c,m,s){var b={x:p,y:g},f={x:p+c,y:g};c={x:p+c,y:g+m};p={x:p,y:g+m};g=svgedit.math.transformPoint;b=g(b.x,b.y,s);var d=m=b.x,k=b.y,q=b.y;f=g(f.x,f.y,s);m=Math.min(m,f.x);d=Math.max(d,f.x); -k=Math.min(k,f.y);q=Math.max(q,f.y);p=g(p.x,p.y,s);m=Math.min(m,p.x);d=Math.max(d,p.x);k=Math.min(k,p.y);q=Math.max(q,p.y);c=g(c.x,c.y,s);m=Math.min(m,c.x);d=Math.max(d,c.x);k=Math.min(k,c.y);q=Math.max(q,c.y);return{tl:b,tr:f,bl:p,br:c,aabox:{x:m,y:k,width:d-m,height:q-k}}};svgedit.math.transformListToTransform=function(p,g,c){if(p==null)return a.createSVGTransformFromMatrix(a.createSVGMatrix());g=g==undefined?0:g;c=c==undefined?p.numberOfItems-1:c;g=parseInt(g);c=parseInt(c);if(g>c){var m=c;c=g; -g=m}m=a.createSVGMatrix();for(g=g;g<=c;++g){var s=g>=0&&gc){var n=c;c=g; +g=n}n=a.createSVGMatrix();for(g=g;g<=c;++g){var s=g>=0&&gp.x&&g.yp.y}})();svgedit=svgedit||{}; -(function(){if(!svgedit.units)svgedit.units={};var a=["x","x1","cx","rx","width"],p=["y","y1","cy","ry","height"],g=$.merge(["r","radius"],a);$.merge(g,p);var c,m={px:1};svgedit.units.init=function(b){c=b;b=document.createElementNS("http://www.w3.org/2000/svg","svg");document.body.appendChild(b);var f=document.createElementNS("http://www.w3.org/2000/svg","rect");f.setAttribute("width","1em");f.setAttribute("height","1ex");f.setAttribute("x","1in");b.appendChild(f);f=f.getBBox();document.body.removeChild(b); -b=f.x;m.em=f.width;m.ex=f.height;m["in"]=b;m.cm=b/2.54;m.mm=b/25.4;m.pt=b/72;m.pc=b/6;m["%"]=0};svgedit.units.getTypeMap=function(){return m};svgedit.units.shortFloat=function(b){var f=c.getRoundDigits();if(isNaN(b)){if($.isArray(b))return svgedit.units.shortFloat(b[0])+","+svgedit.units.shortFloat(b[1])}else return+(+b).toFixed(f);return parseFloat(b).toFixed(f)-0};svgedit.units.convertUnit=function(b,f){f=f||c.getBaseUnit();return svgedit.unit.shortFloat(b/m[f])};svgedit.units.setUnitAttr=function(b, -f,d){isNaN(d)||b.getAttribute(f);b.setAttribute(f,d)};var s={line:["x1","x2","y1","y2"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],foreignObject:["x","y","width","height"],rect:["x","y","width","height"],image:["x","y","width","height"],use:["x","y","width","height"],text:["x","y"]};svgedit.units.convertAttrs=function(b){var f=b.tagName,d=c.getBaseUnit();if(f=s[f])for(var k=f.length,q=0;q=0?d*k:p.indexOf(b)>=0?d*q:d*Math.sqrt(k*k+q*q)/Math.sqrt(2)}else{k=f.substr(-2);d=f.substr(0,f.length-2);return d*m[k]}};svgedit.units.isValidUnit=function(b,f,d){var k=false;if(g.indexOf(b)>=0)if(isNaN(f)){f=f.toLowerCase();$.each(m,function(o){if(!k)if(RegExp("^-?[\\d\\.]+"+o+"$").test(f))k=true})}else k=true;else if(b=="id"){b=false;try{var q=c.getElement(f); -b=q==null||q===d}catch(B){}return b}else k=true;return k}})();svgedit=svgedit||{}; -(function(){function a(b){if(svgedit.browser.supportsHVLineContainerBBox())try{return b.getBBox()}catch(f){}var d=$.data(b,"ref"),k=null;if(d){var q=$(d).children().clone().attr("visibility","hidden");$(s).append(q);k=q.filter("line, path")}else k=$(b).find("line, path");var B=false;if(k.length){k.each(function(){var o=this.getBBox();if(!o.width||!o.height)B=true});if(B){b=d?q:$(b).children();ret=getStrokedBBox(b)}else ret=b.getBBox()}else ret=b.getBBox();d&&q.remove();return ret}if(!svgedit.utilities)svgedit.utilities= -{};var p="a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use".split(","),g=null,c=null,m=null,s=null;svgedit.utilities.init=function(b){g=b;c=b.getDOMDocument();m=b.getDOMContainer();s=b.getSVGRoot()};svgedit.utilities.toXml=function(b){return $("

    ").text(b).html()};svgedit.utilities.fromXml=function(b){return $("

    ").html(b).text()};svgedit.utilities.encode64=function(b){b=svgedit.utilities.convertToXMLReferences(b);if(window.btoa)return window.btoa(b); -var f=Array(Math.floor((b.length+2)/3)*4),d,k,q,B,o,J,U=0,M=0;do{d=b.charCodeAt(U++);k=b.charCodeAt(U++);q=b.charCodeAt(U++);B=d>>2;d=(d&3)<<4|k>>4;o=(k&15)<<2|q>>6;J=q&63;if(isNaN(k))o=J=64;else if(isNaN(q))J=64;f[M++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(B);f[M++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d);f[M++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(o);f[M++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(J)}while(U< -b.length);return f.join("")};svgedit.utilities.decode64=function(b){if(window.atob)return window.atob(b);var f="",d,k,q="",B,o="",J=0;b=b.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(J++));k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(J++));B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(J++));o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(J++)); -d=d<<2|k>>4;k=(k&15)<<4|B>>2;q=(B&3)<<6|o;f+=String.fromCharCode(d);if(B!=64)f+=String.fromCharCode(k);if(o!=64)f+=String.fromCharCode(q)}while(J127)f+="&#"+k+";"}return f};svgedit.utilities.text2xml=function(b){if(b.indexOf("=0)b=b.replace(/<(\/?)svg:/g,"<$1").replace("xmlns:svg","xmlns");var f;try{var d=window.DOMParser? -new DOMParser:new ActiveXObject("Microsoft.XMLDOM");d.async=false}catch(k){throw Error("XML Parser could not be instantiated");}try{f=d.loadXML?d.loadXML(b)?d:false:d.parseFromString(b,"text/xml")}catch(q){throw Error("Error parsing XML string");}return f};svgedit.utilities.bboxToObj=function(b){return{x:b.x,y:b.y,width:b.width,height:b.height}};svgedit.utilities.walkTree=function(b,f){if(b&&b.nodeType==1){f(b);for(var d=b.childNodes.length;d--;)svgedit.utilities.walkTree(b.childNodes.item(d),f)}}; +(function(){if(!svgedit.units)svgedit.units={};var a=["x","x1","cx","rx","width"],p=["y","y1","cy","ry","height"],g=$.merge(["r","radius"],a);$.merge(g,p);var c,n={px:1};svgedit.units.init=function(b){c=b;b=document.createElementNS("http://www.w3.org/2000/svg","svg");document.body.appendChild(b);var f=document.createElementNS("http://www.w3.org/2000/svg","rect");f.setAttribute("width","1em");f.setAttribute("height","1ex");f.setAttribute("x","1in");b.appendChild(f);f=f.getBBox();document.body.removeChild(b); +b=f.x;n.em=f.width;n.ex=f.height;n["in"]=b;n.cm=b/2.54;n.mm=b/25.4;n.pt=b/72;n.pc=b/6;n["%"]=0};svgedit.units.getTypeMap=function(){return n};svgedit.units.shortFloat=function(b){var f=c.getRoundDigits();if(isNaN(b)){if($.isArray(b))return svgedit.units.shortFloat(b[0])+","+svgedit.units.shortFloat(b[1])}else return+(+b).toFixed(f);return parseFloat(b).toFixed(f)-0};svgedit.units.convertUnit=function(b,f){f=f||c.getBaseUnit();return svgedit.unit.shortFloat(b/n[f])};svgedit.units.setUnitAttr=function(b, +f,d){isNaN(d)||b.getAttribute(f);b.setAttribute(f,d)};var s={line:["x1","x2","y1","y2"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],foreignObject:["x","y","width","height"],rect:["x","y","width","height"],image:["x","y","width","height"],use:["x","y","width","height"],text:["x","y"]};svgedit.units.convertAttrs=function(b){var f=b.tagName,d=c.getBaseUnit();if(f=s[f])for(var l=f.length,q=0;q=0?d*l:p.indexOf(b)>=0?d*q:d*Math.sqrt(l*l+q*q)/Math.sqrt(2)}else{l=f.substr(-2);d=f.substr(0,f.length-2);return d*n[l]}};svgedit.units.isValidUnit=function(b,f,d){var l=false;if(g.indexOf(b)>=0)if(isNaN(f)){f=f.toLowerCase();$.each(n,function(o){if(!l)if(RegExp("^-?[\\d\\.]+"+o+"$").test(f))l=true})}else l=true;else if(b=="id"){b=false;try{var q=c.getElement(f); +b=q==null||q===d}catch(B){}return b}else l=true;return l}})();svgedit=svgedit||{}; +(function(){function a(b){if(svgedit.browser.supportsHVLineContainerBBox())try{return b.getBBox()}catch(f){}var d=$.data(b,"ref"),l=null;if(d){var q=$(d).children().clone().attr("visibility","hidden");$(s).append(q);l=q.filter("line, path")}else l=$(b).find("line, path");var B=false;if(l.length){l.each(function(){var o=this.getBBox();if(!o.width||!o.height)B=true});if(B){b=d?q:$(b).children();ret=getStrokedBBox(b)}else ret=b.getBBox()}else ret=b.getBBox();d&&q.remove();return ret}if(!svgedit.utilities)svgedit.utilities= +{};var p="a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use".split(","),g=null,c=null,n=null,s=null;svgedit.utilities.init=function(b){g=b;c=b.getDOMDocument();n=b.getDOMContainer();s=b.getSVGRoot()};svgedit.utilities.toXml=function(b){return $("

    ").text(b).html()};svgedit.utilities.fromXml=function(b){return $("

    ").html(b).text()};svgedit.utilities.encode64=function(b){b=svgedit.utilities.convertToXMLReferences(b);if(window.btoa)return window.btoa(b); +var f=Array(Math.floor((b.length+2)/3)*4),d,l,q,B,o,K,T=0,M=0;do{d=b.charCodeAt(T++);l=b.charCodeAt(T++);q=b.charCodeAt(T++);B=d>>2;d=(d&3)<<4|l>>4;o=(l&15)<<2|q>>6;K=q&63;if(isNaN(l))o=K=64;else if(isNaN(q))K=64;f[M++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(B);f[M++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d);f[M++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(o);f[M++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(K)}while(T< +b.length);return f.join("")};svgedit.utilities.decode64=function(b){if(window.atob)return window.atob(b);var f="",d,l,q="",B,o="",K=0;b=b.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(K++));l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(K++));B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(K++));o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(K++)); +d=d<<2|l>>4;l=(l&15)<<4|B>>2;q=(B&3)<<6|o;f+=String.fromCharCode(d);if(B!=64)f+=String.fromCharCode(l);if(o!=64)f+=String.fromCharCode(q)}while(K127)f+="&#"+l+";"}return f};svgedit.utilities.text2xml=function(b){if(b.indexOf("=0)b=b.replace(/<(\/?)svg:/g,"<$1").replace("xmlns:svg","xmlns");var f;try{var d=window.DOMParser? +new DOMParser:new ActiveXObject("Microsoft.XMLDOM");d.async=false}catch(l){throw Error("XML Parser could not be instantiated");}try{f=d.loadXML?d.loadXML(b)?d:false:d.parseFromString(b,"text/xml")}catch(q){throw Error("Error parsing XML string");}return f};svgedit.utilities.bboxToObj=function(b){return{x:b.x,y:b.y,width:b.width,height:b.height}};svgedit.utilities.walkTree=function(b,f){if(b&&b.nodeType==1){f(b);for(var d=b.childNodes.length;d--;)svgedit.utilities.walkTree(b.childNodes.item(d),f)}}; svgedit.utilities.walkTreePost=function(b,f){if(b&&b.nodeType==1){for(var d=b.childNodes.length;d--;)svgedit.utilities.walkTree(b.childNodes.item(d),f);f(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,f){b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f)};svgedit.utilities.findDefs=function(b){b=g.getSVGContent().documentElement;var f=b.getElementsByTagNameNS("http://www.w3.org/2000/svg","defs");return f=f.length>0?f[0]:b.insertBefore(b.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),b.firstChild.nextSibling)};svgedit.utilities.getPathBBox=function(b){var f=b.pathSegList,d=f.numberOfItems;b=[[],[]];var k=f.getItem(0), -q=[k.x,k.y];for(k=0;k0?f[0]:b.insertBefore(b.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),b.firstChild.nextSibling)};svgedit.utilities.getPathBBox=function(b){var f=b.pathSegList,d=f.numberOfItems;b=[[],[]];var l=f.getItem(0), +q=[l.x,l.y];for(l=0;l= -0){var k=d.split(":");b[k[1]]=p[k[0]]}else b[d]=d=="xmlns"?"http://www.w3.org/2000/xmlns/":null});c[m]=b});svgedit.sanitize.getNSMap=function(){return a};svgedit.sanitize.sanitizeSvg=function(m){if(m.nodeType==3){m.nodeValue=m.nodeValue.replace(/^\s+|\s+$/g,"");m.nodeValue.length||m.parentNode.removeChild(m)}if(m.nodeType==1){var s=m.parentNode;if(m.ownerDocument&&s){var b=g[m.nodeName],f=c[m.nodeName];if(b!=undefined){for(var d=[],k=m.attributes.length;k--;){var q=m.attributes.item(k),B=q.nodeName, -o=q.localName,J=q.namespaceURI;if(!(f.hasOwnProperty(o)&&J==f[o]&&J!="http://www.w3.org/2000/xmlns/")&&!(J=="http://www.w3.org/2000/xmlns/"&&a[q.nodeValue])){B.indexOf("se:")==0&&d.push([B,q.nodeValue]);m.removeAttributeNS(J,o)}if(svgedit.browser.isGecko())switch(B){case "transform":case "gradientTransform":case "patternTransform":o=q.nodeValue.replace(/(\d)-/g,"$1 -");m.setAttribute(B,o)}if(B=="style"){q=q.nodeValue.split(";");for(B=q.length;B--;){o=q[B].split(":");b.indexOf(o[0])>=0&&m.setAttribute(o[0], -o[1])}m.removeAttribute("style")}}$.each(d,function(U,M){m.setAttributeNS("http://svg-edit.googlecode.com",M[0],M[1])});if((k=svgedit.utilities.getHref(m))&&["filter","linearGradient","pattern","radialGradient","textPath","use"].indexOf(m.nodeName)>=0)if(k[0]!="#"){svgedit.utilities.setHref(m,"");m.removeAttributeNS("http://www.w3.org/1999/xlink","href")}if(m.nodeName=="use"&&!svgedit.utilities.getHref(m))s.removeChild(m);else{$.each(["clip-path","fill","filter","marker-end","marker-mid","marker-start", -"mask","stroke"],function(U,M){var I=m.getAttribute(M);if(I)if((I=svgedit.utilities.getUrlFromAttr(I))&&I[0]!=="#"){m.setAttribute(M,"");m.removeAttribute(M)}});for(k=m.childNodes.length;k--;)svgedit.sanitize.sanitizeSvg(m.childNodes.item(k))}}else{for(b=[];m.hasChildNodes();)b.push(s.insertBefore(m.firstChild,m));s.removeChild(m);for(k=b.length;k--;)svgedit.sanitize.sanitizeSvg(b[k])}}}}})();svgedit=svgedit||{}; +"height","width"],msqrt:[],mstyle:["displaystyle","mathbackground","mathcolor","mathvariant","scriptlevel"],msub:[],msubsup:[],msup:[],mtable:["align","columnalign","columnlines","columnspacing","displaystyle","equalcolumns","equalrows","frame","rowalign","rowlines","rowspacing","width"],mtd:["columnalign","columnspan","rowalign","rowspan"],mtext:[],mtr:["columnalign","rowalign"],munder:[],munderover:[],none:[],semantics:[]},c={};$.each(g,function(n,s){var b={};$.each(s,function(f,d){if(d.indexOf(":")>= +0){var l=d.split(":");b[l[1]]=p[l[0]]}else b[d]=d=="xmlns"?"http://www.w3.org/2000/xmlns/":null});c[n]=b});svgedit.sanitize.getNSMap=function(){return a};svgedit.sanitize.sanitizeSvg=function(n){if(n.nodeType==3){n.nodeValue=n.nodeValue.replace(/^\s+|\s+$/g,"");n.nodeValue.length||n.parentNode.removeChild(n)}if(n.nodeType==1){var s=n.parentNode;if(n.ownerDocument&&s){var b=g[n.nodeName],f=c[n.nodeName];if(b!=undefined){for(var d=[],l=n.attributes.length;l--;){var q=n.attributes.item(l),B=q.nodeName, +o=q.localName,K=q.namespaceURI;if(!(f.hasOwnProperty(o)&&K==f[o]&&K!="http://www.w3.org/2000/xmlns/")&&!(K=="http://www.w3.org/2000/xmlns/"&&a[q.nodeValue])){B.indexOf("se:")==0&&d.push([B,q.nodeValue]);n.removeAttributeNS(K,o)}if(svgedit.browser.isGecko())switch(B){case "transform":case "gradientTransform":case "patternTransform":o=q.nodeValue.replace(/(\d)-/g,"$1 -");n.setAttribute(B,o)}if(B=="style"){q=q.nodeValue.split(";");for(B=q.length;B--;){o=q[B].split(":");b.indexOf(o[0])>=0&&n.setAttribute(o[0], +o[1])}n.removeAttribute("style")}}$.each(d,function(T,M){n.setAttributeNS("http://svg-edit.googlecode.com",M[0],M[1])});if((l=svgedit.utilities.getHref(n))&&["filter","linearGradient","pattern","radialGradient","textPath","use"].indexOf(n.nodeName)>=0)if(l[0]!="#"){svgedit.utilities.setHref(n,"");n.removeAttributeNS("http://www.w3.org/1999/xlink","href")}if(n.nodeName=="use"&&!svgedit.utilities.getHref(n))s.removeChild(n);else{$.each(["clip-path","fill","filter","marker-end","marker-mid","marker-start", +"mask","stroke"],function(T,M){var J=n.getAttribute(M);if(J)if((J=svgedit.utilities.getUrlFromAttr(J))&&J[0]!=="#"){n.setAttribute(M,"");n.removeAttribute(M)}});for(l=n.childNodes.length;l--;)svgedit.sanitize.sanitizeSvg(n.childNodes.item(l))}}else{for(b=[];n.hasChildNodes();)b.push(s.insertBefore(n.firstChild,n));s.removeChild(n);for(l=b.length;l--;)svgedit.sanitize.sanitizeSvg(b[l])}}}}})();svgedit=svgedit||{}; (function(){if(!svgedit.history)svgedit.history={};svgedit.history.HistoryEventTypes={BEFORE_APPLY:"before_apply",AFTER_APPLY:"after_apply",BEFORE_UNAPPLY:"before_unapply",AFTER_UNAPPLY:"after_unapply"};svgedit.history.MoveElementCommand=function(a,p,g,c){this.elem=a;this.text=c?"Move "+a.tagName+" to "+c:"Move "+a.tagName;this.oldNextSibling=p;this.oldParent=g;this.newNextSibling=a.nextSibling;this.newParent=a.parentNode};svgedit.history.MoveElementCommand.type=function(){return"svgedit.history.MoveElementCommand"};svgedit.history.MoveElementCommand.prototype.type= svgedit.history.MoveElementCommand.type;svgedit.history.MoveElementCommand.prototype.getText=function(){return this.text};svgedit.history.MoveElementCommand.prototype.apply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);this.elem=this.newParent.insertBefore(this.elem,this.newNextSibling);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_APPLY,this)};svgedit.history.MoveElementCommand.prototype.unapply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY, this);this.elem=this.oldParent.insertBefore(this.elem,this.oldNextSibling);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY,this)};svgedit.history.MoveElementCommand.prototype.elements=function(){return[this.elem]};svgedit.history.InsertElementCommand=function(a,p){this.elem=a;this.text=p||"Create "+a.tagName;this.parent=a.parentNode;this.nextSibling=this.elem.nextSibling};svgedit.history.InsertElementCommand.type=function(){return"svgedit.history.InsertElementCommand"};svgedit.history.InsertElementCommand.prototype.type= @@ -134,395 +134,394 @@ function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APP this)};svgedit.history.BatchCommand.prototype.elements=function(){for(var a=[],p=this.stack.length;p--;)for(var g=this.stack[p].elements(),c=g.length;c--;)a.indexOf(g[c])==-1&&a.push(g[c]);return a};svgedit.history.BatchCommand.prototype.addSubCommand=function(a){this.stack.push(a)};svgedit.history.BatchCommand.prototype.isEmpty=function(){return this.stack.length==0};svgedit.history.UndoManager=function(a){this.handler_=a||null;this.undoStackPointer=0;this.undoStack=[];this.undoChangeStackPointer= -1;this.undoableChangeStack=[]};svgedit.history.UndoManager.prototype.resetUndoStack=function(){this.undoStack=[];this.undoStackPointer=0};svgedit.history.UndoManager.prototype.getUndoStackSize=function(){return this.undoStackPointer};svgedit.history.UndoManager.prototype.getRedoStackSize=function(){return this.undoStack.length-this.undoStackPointer};svgedit.history.UndoManager.prototype.getNextUndoCommandText=function(){return this.undoStackPointer>0?this.undoStack[this.undoStackPointer-1].getText(): ""};svgedit.history.UndoManager.prototype.getNextRedoCommandText=function(){return this.undoStackPointer0&&this.undoStack[--this.undoStackPointer].unapply(this.handler_)};svgedit.history.UndoManager.prototype.redo=function(){this.undoStackPointer0&&this.undoStack[this.undoStackPointer++].apply(this.handler_)}; -svgedit.history.UndoManager.prototype.addCommandToHistory=function(a){if(this.undoStackPointer0)this.undoStack=this.undoStack.splice(0,this.undoStackPointer);this.undoStack.push(a);this.undoStackPointer=this.undoStack.length};svgedit.history.UndoManager.prototype.beginUndoableChange=function(a,p){for(var g=++this.undoChangeStackPointer,c=p.length,m=Array(c),s=Array(c);c--;){var b=p[c];if(b!=null){s[c]=b;m[c]=b.getAttribute(a)}}this.undoableChangeStack[g]= -{attrName:a,oldValues:m,elements:s}};svgedit.history.UndoManager.prototype.finishUndoableChange=function(){for(var a=this.undoChangeStackPointer--,p=this.undoableChangeStack[a],g=p.elements.length,c=p.attrName,m=new svgedit.history.BatchCommand("Change "+c);g--;){var s=p.elements[g];if(s!=null){var b={};b[c]=p.oldValues[g];b[c]!=s.getAttribute(c)&&m.addSubCommand(new svgedit.history.ChangeElementCommand(s,b,c))}}this.undoableChangeStack[a]=null;return m}})();svgedit=svgedit||{}; -(function(){if(!svgedit.select)svgedit.select={};var a,p,g;svgedit.select.Selector=function(c,m){this.id=c;this.selectedElement=m;this.locked=true;this.selectorGroup=a.createSVGElement({element:"g",attr:{id:"selectorGroup"+this.id}});this.selectorRect=this.selectorGroup.appendChild(a.createSVGElement({element:"path",attr:{id:"selectedBox"+this.id,fill:"none",stroke:"#4F80FF","stroke-width":"1","shape-rendering":"crispEdges",style:"pointer-events:none"}}));svgedit.browser.isTouch()&&this.selectorRect.setAttribute("stroke-opacity", -0.3);this.gripCoords={nw:null,n:null,ne:null,e:null,se:null,s:null,sw:null,w:null};this.reset(this.selectedElement)};svgedit.select.Selector.prototype.reset=function(c){this.locked=true;this.selectedElement=c;this.resize();this.selectorGroup.setAttribute("display","inline")};svgedit.select.Selector.prototype.updateGripCursors=function(c){var m=[];c=Math.round(c/45);if(c<0)c+=8;for(var s in g.selectorGrips)m.push(s);for(;c>0;){m.push(m.shift());c--}c=0;for(s in g.selectorGrips){g.selectorGrips[s].setAttribute("style", -"cursor:"+m[c]+"-resize");c++}};svgedit.select.Selector.prototype.showGrips=function(c){g.selectorGripsGroup.setAttribute("display",c?"inline":"none");var m=this.selectedElement;this.hasGrips=c;if(m&&c){this.selectorGroup.appendChild(g.selectorGripsGroup);this.updateGripCursors(svgedit.utilities.getRotationAngle(m))}};svgedit.select.Selector.prototype.resize=function(){var c=this.selectorRect,m=g,s=m.selectorGrips,b=this.selectedElement,f=b.getAttribute("stroke-width"),d=a.currentZoom(),k=1/d;if(b.getAttribute("stroke")!== -"none"&&!isNaN(f))k+=f/2;var q=b.tagName;if(q==="text")k+=2/d;f=svgedit.transformlist.getTransformList(b);f=svgedit.math.transformListToTransform(f).matrix;f.e*=d;f.f*=d;var B=svgedit.utilities.getBBox(b);if(q==="g"&&!$.data(b,"gsvg"))if(q=a.getStrokedBBox(b.childNodes))B=q;q=B.x;var o=B.y,J=B.width;B=B.height;k*=d;d=svgedit.math.transformBox(q*d,o*d,J*d,B*d,f);f=d.aabox;q=f.x-k;o=f.y-k;J=f.width+k*2;var U=f.height+k*2;f=q+J/2;B=o+U/2;if(b=svgedit.utilities.getRotationAngle(b)){q=a.svgRoot().createSVGTransform(); -q.setRotate(-b,f,B);q=q.matrix;d.tl=svgedit.math.transformPoint(d.tl.x,d.tl.y,q);d.tr=svgedit.math.transformPoint(d.tr.x,d.tr.y,q);d.bl=svgedit.math.transformPoint(d.bl.x,d.bl.y,q);d.br=svgedit.math.transformPoint(d.br.x,d.br.y,q);q=d.tl;J=q.x;U=q.y;var M=q.x,I=q.y;q=Math.min;o=Math.max;J=q(J,q(d.tr.x,q(d.bl.x,d.br.x)))-k;U=q(U,q(d.tr.y,q(d.bl.y,d.br.y)))-k;M=o(M,o(d.tr.x,o(d.bl.x,d.br.x)))+k;I=o(I,o(d.tr.y,o(d.bl.y,d.br.y)))+k;q=J;o=U;J=M-J;U=I-U}k=a.svgRoot().suspendRedraw(100);c.setAttribute("d", -"M"+q+","+o+" L"+(q+J)+","+o+" "+(q+J)+","+(o+U)+" "+q+","+(o+U)+"z");this.selectorGroup.setAttribute("transform",b?"rotate("+[b,f,B].join(",")+")":"");if(svgedit.browser.isTouch()){q-=15.75;o-=15.75}else{q-=4;o-=4}this.gripCoords={nw:[q,o].map(Math.round),ne:[q+J,o].map(Math.round),sw:[q,o+U].map(Math.round),se:[q+J,o+U].map(Math.round),n:[q+J/2,o].map(Math.round),w:[q,o+U/2].map(Math.round),e:[q+J,o+U/2].map(Math.round),s:[q+J/2,o+U].map(Math.round)};for(var S in this.gripCoords){c=this.gripCoords[S]; -s[S].setAttribute("x",c[0]);s[S].setAttribute("y",c[1])}this.rotateCoords={nw:[q,o],ne:[q+J+8,o],sw:[q,o+U+8],se:[q+J+8,o+U+8]};for(S in this.rotateCoords){c=this.rotateCoords[S];m.rotateGrips[S].setAttribute("cx",c[0]);m.rotateGrips[S].setAttribute("cy",c[1])}a.svgRoot().unsuspendRedraw(k)};svgedit.select.SelectorManager=function(){this.rubberBandBox=this.selectorParentGroup=null;this.selectors=[];this.selectorMap={};this.selectorGrips={nw:null,n:null,ne:null,e:null,se:null,s:null,sw:null,w:null}; +svgedit.history.UndoManager.prototype.addCommandToHistory=function(a){if(this.undoStackPointer0)this.undoStack=this.undoStack.splice(0,this.undoStackPointer);this.undoStack.push(a);this.undoStackPointer=this.undoStack.length};svgedit.history.UndoManager.prototype.beginUndoableChange=function(a,p){for(var g=++this.undoChangeStackPointer,c=p.length,n=Array(c),s=Array(c);c--;){var b=p[c];if(b!=null){s[c]=b;n[c]=b.getAttribute(a)}}this.undoableChangeStack[g]= +{attrName:a,oldValues:n,elements:s}};svgedit.history.UndoManager.prototype.finishUndoableChange=function(){for(var a=this.undoChangeStackPointer--,p=this.undoableChangeStack[a],g=p.elements.length,c=p.attrName,n=new svgedit.history.BatchCommand("Change "+c);g--;){var s=p.elements[g];if(s!=null){var b={};b[c]=p.oldValues[g];b[c]!=s.getAttribute(c)&&n.addSubCommand(new svgedit.history.ChangeElementCommand(s,b,c))}}this.undoableChangeStack[a]=null;return n}})();svgedit=svgedit||{}; +(function(){if(!svgedit.select)svgedit.select={};var a,p,g;svgedit.select.Selector=function(c,n){this.id=c;this.selectedElement=n;this.locked=true;this.selectorGroup=a.createSVGElement({element:"g",attr:{id:"selectorGroup"+this.id}});this.selectorRect=this.selectorGroup.appendChild(a.createSVGElement({element:"path",attr:{id:"selectedBox"+this.id,fill:"none",stroke:"#4F80FF","stroke-width":"1","shape-rendering":"crispEdges",style:"pointer-events:none"}}));svgedit.browser.isTouch()&&this.selectorRect.setAttribute("stroke-opacity", +0.3);this.gripCoords={nw:null,n:null,ne:null,e:null,se:null,s:null,sw:null,w:null};this.reset(this.selectedElement)};svgedit.select.Selector.prototype.reset=function(c){this.locked=true;this.selectedElement=c;this.resize();this.selectorGroup.setAttribute("display","inline")};svgedit.select.Selector.prototype.updateGripCursors=function(c){var n=[];c=Math.round(c/45);if(c<0)c+=8;for(var s in g.selectorGrips)n.push(s);for(;c>0;){n.push(n.shift());c--}c=0;for(s in g.selectorGrips){g.selectorGrips[s].setAttribute("style", +"cursor:"+n[c]+"-resize");c++}};svgedit.select.Selector.prototype.showGrips=function(c){g.selectorGripsGroup.setAttribute("display",c?"inline":"none");var n=this.selectedElement;this.hasGrips=c;if(n&&c){this.selectorGroup.appendChild(g.selectorGripsGroup);this.updateGripCursors(svgedit.utilities.getRotationAngle(n))}};svgedit.select.Selector.prototype.resize=function(){var c=this.selectorRect,n=g,s=n.selectorGrips,b=this.selectedElement,f=b.getAttribute("stroke-width"),d=a.currentZoom(),l=1/d;if(b.getAttribute("stroke")!== +"none"&&!isNaN(f))l+=f/2;var q=b.tagName;if(q==="text")l+=2/d;f=svgedit.transformlist.getTransformList(b);f=svgedit.math.transformListToTransform(f).matrix;f.e*=d;f.f*=d;var B=svgedit.utilities.getBBox(b);if(q==="g"&&!$.data(b,"gsvg"))if(q=a.getStrokedBBox(b.childNodes))B=q;q=B.x;var o=B.y,K=B.width;B=B.height;l*=d;d=svgedit.math.transformBox(q*d,o*d,K*d,B*d,f);f=d.aabox;q=f.x-l;o=f.y-l;K=f.width+l*2;var T=f.height+l*2;f=q+K/2;B=o+T/2;if(b=svgedit.utilities.getRotationAngle(b)){q=a.svgRoot().createSVGTransform(); +q.setRotate(-b,f,B);q=q.matrix;d.tl=svgedit.math.transformPoint(d.tl.x,d.tl.y,q);d.tr=svgedit.math.transformPoint(d.tr.x,d.tr.y,q);d.bl=svgedit.math.transformPoint(d.bl.x,d.bl.y,q);d.br=svgedit.math.transformPoint(d.br.x,d.br.y,q);q=d.tl;K=q.x;T=q.y;var M=q.x,J=q.y;q=Math.min;o=Math.max;K=q(K,q(d.tr.x,q(d.bl.x,d.br.x)))-l;T=q(T,q(d.tr.y,q(d.bl.y,d.br.y)))-l;M=o(M,o(d.tr.x,o(d.bl.x,d.br.x)))+l;J=o(J,o(d.tr.y,o(d.bl.y,d.br.y)))+l;q=K;o=T;K=M-K;T=J-T}l=a.svgRoot().suspendRedraw(100);c.setAttribute("d", +"M"+q+","+o+" L"+(q+K)+","+o+" "+(q+K)+","+(o+T)+" "+q+","+(o+T)+"z");this.selectorGroup.setAttribute("transform",b?"rotate("+[b,f,B].join(",")+")":"");if(svgedit.browser.isTouch()){q-=15.75;o-=15.75}else{q-=4;o-=4}this.gripCoords={nw:[q,o].map(Math.round),ne:[q+K,o].map(Math.round),sw:[q,o+T].map(Math.round),se:[q+K,o+T].map(Math.round),n:[q+K/2,o].map(Math.round),w:[q,o+T/2].map(Math.round),e:[q+K,o+T/2].map(Math.round),s:[q+K/2,o+T].map(Math.round)};for(var Q in this.gripCoords){c=this.gripCoords[Q]; +s[Q].setAttribute("x",c[0]);s[Q].setAttribute("y",c[1])}this.rotateCoords={nw:[q,o],ne:[q+K+8,o],sw:[q,o+T+8],se:[q+K+8,o+T+8]};for(Q in this.rotateCoords){c=this.rotateCoords[Q];n.rotateGrips[Q].setAttribute("cx",c[0]);n.rotateGrips[Q].setAttribute("cy",c[1])}a.svgRoot().unsuspendRedraw(l)};svgedit.select.SelectorManager=function(){this.rubberBandBox=this.selectorParentGroup=null;this.selectors=[];this.selectorMap={};this.selectorGrips={nw:null,n:null,ne:null,e:null,se:null,s:null,sw:null,w:null}; this.selectorGripsGroup=null;this.rotateGrips={nw:null,ne:null,se:null,sw:null};this.initGroup()};svgedit.select.SelectorManager.prototype.initGroup=function(){this.selectorParentGroup&&this.selectorParentGroup.parentNode&&this.selectorParentGroup.parentNode.removeChild(this.selectorParentGroup);this.selectorParentGroup=a.createSVGElement({element:"g",attr:{id:"selectorParentGroup"}});this.selectorGripsGroup=a.createSVGElement({element:"g",attr:{display:"none"}});this.selectorParentGroup.appendChild(this.selectorGripsGroup); -a.svgRoot().appendChild(this.selectorParentGroup);this.selectorMap={};this.selectors=[];this.rubberBandBox=null;for(var c in this.rotateGrips){var m=a.createSVGElement({element:"circle",attr:{id:"selectorGrip_rotate_"+c,fill:"#000",r:8,stroke:"#000","fill-opacity":0,"stroke-opacity":0,"stroke-width":0,style:"cursor:url("+p.imgPath+"rotate.png) 12 12, auto;"}});$.data(m,"dir",c);$.data(m,"type","rotate");this.rotateGrips[c]=this.selectorGripsGroup.appendChild(m)}for(c in this.selectorGrips){m=a.createSVGElement({element:"rect", -attr:{id:"selectorGrip_resize_"+c,width:8,height:8,fill:"#4F80FF",stroke:"rgba(0,0,0,0)","stroke-width":1,style:"cursor:"+c+"-resize","pointer-events":"all"}});if(svgedit.browser.isTouch()){m.setAttribute("width",30.5);m.setAttribute("height",30.5);m.setAttribute("fill-opacity",0.3)}$.data(m,"dir",c);$.data(m,"type","resize");this.selectorGrips[c]=this.selectorGripsGroup.appendChild(m)}if(!$("#canvasBackground").length){c=p.dimensions;c=a.createSVGElement({element:"svg",attr:{id:"canvasBackground", -width:c[0],height:c[1],x:0,y:0,overflow:svgedit.browser.isWebkit()?"none":"visible",style:"pointer-events:none"}});m=a.createSVGElement({element:"defs",attr:{id:"placeholder_defs"}});var s=a.createSVGElement({element:"pattern",attr:{id:"checkerPattern",patternUnits:"userSpaceOnUse",x:0,y:0,width:20,height:20,viewBox:"0 0 10 10"}}),b=a.createSVGElement({element:"rect",attr:{x:0,y:0,width:10,height:10,fill:"#fff"}}),f=a.createSVGElement({element:"rect",attr:{x:0,y:0,width:5,height:5,fill:"#eee"}}), -d=a.createSVGElement({element:"rect",attr:{x:5,y:5,width:5,height:5,fill:"#eee"}}),k=a.createSVGElement({element:"rect",attr:{width:"100%",height:"100%",x:0,y:0,"stroke-width":1,stroke:"#000",fill:"url(#checkerPattern)",style:"pointer-events:none"}});c.appendChild(m);m.appendChild(s);s.appendChild(b);s.appendChild(f);s.appendChild(d);c.appendChild(k);a.svgRoot().insertBefore(c,a.svgContent())}};svgedit.select.SelectorManager.prototype.requestSelector=function(c){if(c==null)return null;var m=this.selectors.length; -if(typeof this.selectorMap[c.id]=="object"){this.selectorMap[c.id].locked=true;return this.selectorMap[c.id]}for(var s=0;s element";this.svgElem_=c;this.obj_num=0;this.idPrefix=m||"svg_";this.releasedNums=[];this.all_layers=[];this.current_layer=null;this.nonce_= +a.svgRoot().appendChild(this.selectorParentGroup);this.selectorMap={};this.selectors=[];this.rubberBandBox=null;for(var c in this.rotateGrips){var n=a.createSVGElement({element:"circle",attr:{id:"selectorGrip_rotate_"+c,fill:"#000",r:8,stroke:"#000","fill-opacity":0,"stroke-opacity":0,"stroke-width":0,style:"cursor:url("+p.imgPath+"rotate.png) 12 12, auto;"}});$.data(n,"dir",c);$.data(n,"type","rotate");this.rotateGrips[c]=this.selectorGripsGroup.appendChild(n)}for(c in this.selectorGrips){n=a.createSVGElement({element:"rect", +attr:{id:"selectorGrip_resize_"+c,width:8,height:8,fill:"#4F80FF",stroke:"rgba(0,0,0,0)","stroke-width":1,style:"cursor:"+c+"-resize","pointer-events":"all"}});if(svgedit.browser.isTouch()){n.setAttribute("width",30.5);n.setAttribute("height",30.5);n.setAttribute("fill-opacity",0.3)}$.data(n,"dir",c);$.data(n,"type","resize");this.selectorGrips[c]=this.selectorGripsGroup.appendChild(n)}if(!$("#canvasBackground").length){c=p.dimensions;c=a.createSVGElement({element:"svg",attr:{id:"canvasBackground", +width:c[0],height:c[1],x:0,y:0,overflow:svgedit.browser.isWebkit()?"none":"visible",style:"pointer-events:none"}});n=a.createSVGElement({element:"defs",attr:{id:"placeholder_defs"}});var s=a.createSVGElement({element:"pattern",attr:{id:"checkerPattern",patternUnits:"userSpaceOnUse",x:0,y:0,width:20,height:20,viewBox:"0 0 10 10"}}),b=a.createSVGElement({element:"rect",attr:{x:0,y:0,width:10,height:10,fill:"#fff"}}),f=a.createSVGElement({element:"rect",attr:{x:0,y:0,width:5,height:5,fill:"#eee"}}), +d=a.createSVGElement({element:"rect",attr:{x:5,y:5,width:5,height:5,fill:"#eee"}}),l=a.createSVGElement({element:"rect",attr:{width:"100%",height:"100%",x:0,y:0,"stroke-width":1,stroke:"#000",fill:"url(#checkerPattern)",style:"pointer-events:none"}});c.appendChild(n);n.appendChild(s);s.appendChild(b);s.appendChild(f);s.appendChild(d);c.appendChild(l);a.svgRoot().insertBefore(c,a.svgContent())}};svgedit.select.SelectorManager.prototype.requestSelector=function(c){if(c==null)return null;var n=this.selectors.length; +if(typeof this.selectorMap[c.id]=="object"){this.selectorMap[c.id].locked=true;return this.selectorMap[c.id]}for(var s=0;s element";this.svgElem_=c;this.obj_num=0;this.idPrefix=n||"svg_";this.releasedNums=[];this.all_layers=[];this.current_layer=null;this.nonce_= "";var s=this.svgElem_.getAttributeNS("http://svg-edit.googlecode.com","nonce");if(s&&g!=p.NEVER_RANDOMIZE)this.nonce_=s;else g==p.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_}; svgedit.draw.Drawing.prototype.setNonce=function(c){this.svgElem_.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:se","http://svg-edit.googlecode.com");this.svgElem_.setAttributeNS("http://svg-edit.googlecode.com","se:nonce",c);this.nonce_=c};svgedit.draw.Drawing.prototype.clearNonce=function(){this.nonce_=""};svgedit.draw.Drawing.prototype.getId=function(){return this.nonce_?this.idPrefix+this.nonce_+"_"+this.obj_num:this.idPrefix+this.obj_num};svgedit.draw.Drawing.prototype.getNextId=function(){var c= -this.obj_num,m=false;if(this.releasedNums.length>0){this.obj_num=this.releasedNums.pop();m=true}else this.obj_num++;for(var s=this.getId();this.getElem_(s);){if(m){this.obj_num=c;m=false}this.obj_num++;s=this.getId()}if(m)this.obj_num=c;return s};svgedit.draw.Drawing.prototype.releaseId=function(c){var m=this.idPrefix+(this.nonce_?this.nonce_+"_":"");if(typeof c!="string"||c.indexOf(m)!=0)return false;c=parseInt(c.substr(m.length));if(typeof c!="number"||c<=0||this.releasedNums.indexOf(c)!=-1)return false; -this.releasedNums.push(c);return true};svgedit.draw.Drawing.prototype.getNumLayers=function(){return this.all_layers.length};svgedit.draw.Drawing.prototype.hasLayer=function(c){for(var m=0;m=0&&c1){var c=this.current_layer.parentNode.removeChild(this.current_layer);this.identifyLayers();return c}return null};svgedit.draw.Drawing.prototype.identifyLayers=function(){this.all_layers=[];for(var c=this.svgElem_.childNodes.length,m=[],s=[],b=null,f=false,d=0;d0||!f){for(d=1;s.indexOf("Layer "+d)>=0;)d++;s="Layer "+d;b=c.createElementNS("http://www.w3.org/2000/svg","g");f=c.createElementNS("http://www.w3.org/2000/svg","title");f.textContent=s; -b.appendChild(f);for(f=0;f1))for(var s=0;s0){this.obj_num=this.releasedNums.pop();n=true}else this.obj_num++;for(var s=this.getId();this.getElem_(s);){if(n){this.obj_num=c;n=false}this.obj_num++;s=this.getId()}if(n)this.obj_num=c;return s};svgedit.draw.Drawing.prototype.releaseId=function(c){var n=this.idPrefix+(this.nonce_?this.nonce_+"_":"");if(typeof c!="string"||c.indexOf(n)!=0)return false;c=parseInt(c.substr(n.length));if(typeof c!="number"||c<=0||this.releasedNums.indexOf(c)!=-1)return false; +this.releasedNums.push(c);return true};svgedit.draw.Drawing.prototype.getNumLayers=function(){return this.all_layers.length};svgedit.draw.Drawing.prototype.hasLayer=function(c){for(var n=0;n=0&&c1){var c=this.current_layer.parentNode.removeChild(this.current_layer);this.identifyLayers();return c}return null};svgedit.draw.Drawing.prototype.identifyLayers=function(){this.all_layers=[];for(var c=this.svgElem_.childNodes.length,n=[],s=[],b=null,f=false,d=0;d0||!f){for(d=1;s.indexOf("Layer "+d)>=0;)d++;s="Layer "+d;b=c.createElementNS("http://www.w3.org/2000/svg","g");f=c.createElementNS("http://www.w3.org/2000/svg","title");f.textContent=s; +b.appendChild(f);for(f=0;f1))for(var s=0;s0){f=U0){f=T element";this.elem=f;this.segs=[];this.selected_pts=[];svgedit.path.path=this;this.init()};svgedit.path.Path.prototype.init=function(){$(svgedit.path.getGripContainer()).find("*").attr("display","none");var f=this.elem.pathSegList,d=f.numberOfItems;this.segs=[];this.selected_pts=[];this.first_seg=null;for(var k=0;k=d?null:f[k+1],J=k-1<0?null:f[k-1];if(B.type===2){if(J&&J.type!==1){o=f[q];o.next=f[q+1];o.next.prev=o;o.addGrip()}q=k}else if(o&&o.type===1){B.next=f[q+1];B.next.prev=B;B.mate=f[q];B.addGrip();if(this.first_seg==null)this.first_seg=B}else if(o){if(B.type!==1){B.addGrip();if(o&&o.type!==2){B.next=o;B.next.prev=B}}}else if(B.type!==1){o=f[q];o.next=f[q+1];o.next.prev=o;o.addGrip();B.addGrip();if(!this.first_seg)this.first_seg=f[q]}}return this};svgedit.path.Path.prototype.eachSeg=function(f){for(var d= -this.segs.length,k=0;k element";this.elem=f;this.segs=[];this.selected_pts=[];svgedit.path.path=this;this.init()};svgedit.path.Path.prototype.init=function(){$(svgedit.path.getGripContainer()).find("*").attr("display","none");var f=this.elem.pathSegList,d=f.numberOfItems;this.segs=[];this.selected_pts=[];this.first_seg=null;for(var l=0;l=d?null:f[l+1],K=l-1<0?null:f[l-1];if(B.type===2){if(K&&K.type!==1){o=f[q];o.next=f[q+1];o.next.prev=o;o.addGrip()}q=l}else if(o&&o.type===1){B.next=f[q+1];B.next.prev=B;B.mate=f[q];B.addGrip();if(this.first_seg==null)this.first_seg=B}else if(o){if(B.type!==1){B.addGrip();if(o&&o.type!==2){B.next=o;B.next.prev=B}}}else if(B.type!==1){o=f[q];o.next=f[q+1];o.next.prev=o;o.addGrip();B.addGrip();if(!this.first_seg)this.first_seg=f[q]}}return this};svgedit.path.Path.prototype.eachSeg=function(f){for(var d= +this.segs.length,l=0;l').documentElement, -true);a.appendChild(d);var k=f.createElementNS(c,"svg");(b.clearSvgContentElement=function(){for(;k.firstChild;)k.removeChild(k.firstChild);$(k).attr({id:"svgcontent",width:s[0],height:s[1],x:s[0],y:s[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(d);var e=f.createComment(" Created with Method Draw - http://github.com/duopixel/Method-Draw/ ");k.appendChild(e)})();var q="svg_";b.setIdPrefix= -function(e){q=e};b.current_drawing_=new svgedit.draw.Drawing(k,q);var B=b.getCurrentDrawing=function(){return b.current_drawing_},o=1,J=null,U={shape:{fill:(m.initFill.color=="none"?"":"#")+m.initFill.color,fill_paint:null,fill_opacity:m.initFill.opacity,stroke:"#"+m.initStroke.color,stroke_paint:null,stroke_opacity:m.initStroke.opacity,stroke_width:m.initStroke.width,stroke_dasharray:"none",stroke_linejoin:"miter",stroke_linecap:"butt",opacity:m.initOpacity}};U.text=$.extend(true,{},U.shape);$.extend(U.text, -{fill:"#000000",stroke_width:0,font_size:24,font_family:"Helvetica, Arial, sans-serif"});var M=U.shape,I=Array(1),S=this.addSvgElementFromJson=function(e){var h=svgedit.utilities.getElem(e.attr.id),l=B().getCurrentLayer();if(h&&e.element!=h.tagName){l.removeChild(h);h=null}if(!h){h=f.createElementNS(c,e.element);if(l)(J||l).appendChild(h)}e.curStyles&&svgedit.utilities.assignAttributes(h,{fill:M.fill,stroke:M.stroke,"stroke-width":M.stroke_width,"stroke-dasharray":M.stroke_dasharray,"stroke-linejoin":M.stroke_linejoin, -"stroke-linecap":M.stroke_linecap,"stroke-opacity":M.stroke_opacity,"fill-opacity":M.fill_opacity,opacity:M.opacity/2,style:"pointer-events:inherit"},100);svgedit.utilities.assignAttributes(h,e.attr,100);svgedit.utilities.cleanupElement(h);return h},Y=b.getTransformList=svgedit.transformlist.getTransformList,P=svgedit.math.transformPoint,ia=b.matrixMultiply=svgedit.math.matrixMultiply,qa=b.hasMatrixTransform=svgedit.math.hasMatrixTransform,ga=b.transformListToTransform=svgedit.math.transformListToTransform, -ba=svgedit.math.snapToAngle,X=svgedit.math.getMatrix;svgedit.units.init({getBaseUnit:function(){return m.baseUnit},getElement:svgedit.utilities.getElem,getHeight:function(){return k.getAttribute("height")/o},getWidth:function(){return k.getAttribute("width")/o},getRoundDigits:function(){return hb.round_digits}});var ta=b.convertToNum=svgedit.units.convertToNum;svgedit.utilities.init({getDOMDocument:function(){return f},getDOMContainer:function(){return a},getSVGRoot:function(){return d},getSelectedElements:function(){return I}, -getSVGContent:function(){return k}});var ka=b.getUrlFromAttr=svgedit.utilities.getUrlFromAttr,da=b.getHref=svgedit.utilities.getHref,W=b.setHref=svgedit.utilities.setHref,Z=svgedit.utilities.getPathBBox;b.getBBox=svgedit.utilities.getBBox;var oa=b.getRotationAngle=svgedit.utilities.getRotationAngle,ra=b.getElem=svgedit.utilities.getElem,ma=b.assignAttributes=svgedit.utilities.assignAttributes,na=this.cleanupElement=svgedit.utilities.cleanupElement,Ca=svgedit.sanitize.getNSMap(),Ga=b.sanitizeSvg=svgedit.sanitize.sanitizeSvg, -Ja=svgedit.history.MoveElementCommand,Da=svgedit.history.InsertElementCommand,La=svgedit.history.RemoveElementCommand,Oa=svgedit.history.ChangeElementCommand,Ba=svgedit.history.BatchCommand;b.undoMgr=new svgedit.history.UndoManager({handleHistoryEvent:function(e,h){var l=svgedit.history.HistoryEventTypes;if(e==l.BEFORE_UNAPPLY||e==l.BEFORE_APPLY)b.clearSelection();else if(e==l.AFTER_APPLY||e==l.AFTER_UNAPPLY){var z=h.elements();b.pathActions.clear();O("changed",z);z=h.type();l=e==l.AFTER_APPLY;if(z== -Ja.type()){l=l?h.newParent:h.oldParent;l==k&&b.identifyLayers()}else if(z==Da.type()||z==La.type()){h.parent==k&&b.identifyLayers();if(z==Da.type())l&&Ua(h.elem);else l||Ua(h.elem);h.elem.tagName==="use"&&Nb(h.elem)}else if(z==Oa.type()){h.elem.tagName=="title"&&h.elem.parentNode.parentNode==k&&b.identifyLayers();l=l?h.newValues:h.oldValues;l.stdDeviation&&b.setBlurOffsets(h.elem.parentNode,l.stdDeviation);if(h.elem.tagName==="use"&&svgedit.browser.isWebkit()){z=h.elem;if(!z.getAttribute("x")&&!z.getAttribute("y")){l= -z.parentNode;var v=z.nextSibling;l.removeChild(z);l.insertBefore(z,v)}}}}}});var za=function(e){b.undoMgr.addCommandToHistory(e)};svgedit.select.init(m,{createSVGElement:function(e){return b.addSvgElementFromJson(e)},svgRoot:function(){return d},svgContent:function(){return k},currentZoom:function(){return o},getStrokedBBox:function(e){return b.getStrokedBBox([e])}});var Ia=this.selectorManager=svgedit.select.getSelectorManager();svgedit.path.init({getCurrentZoom:function(){return o},getSVGRoot:function(){return d}}); -svgedit.utilities.snapToGrid=function(e){var h=m.snappingStep,l=m.baseUnit;if(l!=="px")h*=svgedit.units.getTypeMap()[l];return e=Math.round(e/h)*h};var xa=svgedit.utilities.snapToGrid,rb={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"},$a=["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"],jb=$.data, -Ua=function(e){var h=$(e).attr($a),l;for(l in h){var z=h[l];if(z&&z.indexOf("url(")===0){z=ka(z).substr(1);if(!ra(z)){mb().appendChild(zb[z]);delete zb[z]}}}e=e.getElementsByTagName("*");if(e.length){h=0;for(l=e.length;h=0)D=E=b.convertToPath(H,true);else if(H.tagName=="rect"){var L=H.getAttribute("rx"),N=H.getAttribute("ry");if(L||N)D=E=b.convertToPath(H,true)}if(!E){var n=H.cloneNode(true),w=document.createElementNS(c,"g"),C=H.parentNode;C.appendChild(w);w.appendChild(n);D=svgedit.utilities.bboxToObj(w.getBBox());C.removeChild(w)}}return D}catch(K){console.log(H,K);return null}},l;$.each(e,function(){if(!l)if(this.parentNode)l=h(this)}); -if(l==null)return null;var z=l.x+l.width,v=l.y+l.height,G=l.x,A=l.y,u=function(H){var D=H.getAttribute("stroke-width"),E=0;if(H.getAttribute("stroke")!="none"&&!isNaN(D))E+=D/2;return E},F=[];$.each(e,function(H,D){var E=h(D);if(E){var L=u(D);G=Math.min(G,E.x-L);A=Math.min(A,E.y-L);F.push(E)}});l.x=G;l.y=A;$.each(e,function(H,D){var E=F[H];if(E&&D.nodeType==1){var L=u(D);z=Math.max(z,E.x+E.width+L);v=Math.max(v,E.y+E.height+L)}});l.width=z-G;l.height=v-A;return l};var vb=this.getVisibleElements=function(e){e|| -(e=$(k).children());e.find("#canvas_background").length&&e.splice(0,1);var h=[];$(e).children().each(function(l,z){try{z.getBBox()&&h.push(z)}catch(v){}});return h.reverse()},xb=this.getVisibleElementsAndBBoxes=function(e){e||(e=$(k).children());var h=[];$(e).children().each(function(l,z){try{z.getBBox()&&h.push({elem:z,bbox:getStrokedBBox([z])})}catch(v){}});return h.reverse()},Ab=this.groupSvgElem=function(e){var h=document.createElementNS(c,"g");e.parentNode.replaceChild(h,e);$(h).append(e).data("gsvg", -e)[0].id=ja()},la=function(e){var h=document.createElementNS(e.namespaceURI,e.nodeName);h.removeAttribute("id");$.each(e.attributes,function(z,v){v.localName!="-moz-math-font-style"&&h.setAttributeNS(v.namespaceURI,v.nodeName,v.nodeValue)});if(svgedit.browser.isWebkit()&&e.nodeName=="path"){var l=Ka.convertPath(e);h.setAttribute("d",l)}$.each(e.childNodes,function(z,v){switch(v.nodeType){case 1:h.appendChild(la(v));break;case 3:h.textContent=v.nodeValue}});if($(e).data("gsvg"))$(h).data("gsvg",h.firstChild); -else if($(e).data("symbol")){e=$(e).data("symbol");$(h).data("ref",e).data("symbol",e)}else h.tagName=="image"&&qb(h);h.id=ja();return h},ca,ja,O;(function(e){var h={};ca=e.getId=function(){return B().getId()};ja=e.getNextId=function(){return B().getNextId()};O=e.call=function(l,z){if(h[l])return h[l](this,z)};e.bind=function(l,z){var v=h[l];h[l]=z;return v}})(b);this.prepareSvg=function(e){this.sanitizeSvg(e.documentElement);e=e.getElementsByTagNameNS(c,"path");for(var h=0,l=e.length;h -0&&v.getItem(0).type==4&&v.removeItem(0);if(e!=0){G=P(G,A,ga(v).matrix);A=d.createSVGTransform();A.setRotate(e,G.x,G.y);v.numberOfItems?v.insertItemBefore(A,0):v.appendItem(A)}else v.numberOfItems==0&&l.removeAttribute("transform");if(!h){v=l.getAttribute("transform");l.setAttribute("transform",z);db("transform",v,I);O("changed",I)}ra("pathpointgrip_container");l=Ia.requestSelector(I[0]);l.resize();l.updateGripCursors(e)};var Ha=this.recalculateAllSelectedDimensions=function(){for(var e=new Ba(lb== -"none"?"position":"size"),h=I.length;h--;){var l=Wa(I[h]);l&&e.addSubCommand(l)}if(!e.isEmpty()){za(e);O("changed",I)}},Pa=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],Xa=function(e){console.log([e.a,e.b,e.c,e.d,e.e,e.f])},fb=this.remapElement=function(e,h,l){var z=m.gridSnapping&&e.parentNode.parentNode.localName==="svg",v=function(){if(z)for(var E in h)h[E]=xa(h[E]);ma(e,h,1E3,true)};box=svgedit.utilities.getBBox(e);for(var G=0;G<2;G++){var A=G===0?"fill":"stroke", -u=e.getAttribute(A);if(u&&u.indexOf("url(")===0)if(l.a<0||l.d<0){u=T(u).cloneNode(true);if(l.a<0){var F=u.getAttribute("x1"),H=u.getAttribute("x2");u.setAttribute("x1",-(F-1));u.setAttribute("x2",-(H-1))}if(l.d<0){F=u.getAttribute("y1");H=u.getAttribute("y2");u.setAttribute("y1",-(F-1));u.setAttribute("y2",-(H-1))}u.id=ja();mb().appendChild(u);e.setAttribute(A,"url(#"+u.id+")")}}G=e.tagName;if(G==="g"||G==="text"||G==="use")if(l.a==1&&l.b==0&&l.c==0&&l.d==1&&(l.e!=0||l.f!=0)){A=ga(e).matrix;A=ia(A.inverse(), -l,A);h.x=parseFloat(h.x)+A.e;h.y=parseFloat(h.y)+A.f}else{A=Y(e);u=d.createSVGTransform();u.setMatrix(ia(ga(A).matrix,l));A.clear();A.appendItem(u)}switch(G){case "foreignObject":case "rect":case "image":if(G==="image"&&(l.a<0||l.d<0)){A=Y(e);u=d.createSVGTransform();u.setMatrix(ia(ga(A).matrix,l));A.clear();A.appendItem(u)}else{A=P(h.x,h.y,l);h.width=l.a*h.width;h.height=l.d*h.height;h.x=A.x+Math.min(0,h.width);h.y=A.y+Math.min(0,h.height);h.width=Math.abs(h.width);h.height=Math.abs(h.height)}v(); -break;case "ellipse":G=P(h.cx,h.cy,l);h.cx=G.x;h.cy=G.y;h.rx=l.a*h.rx;h.ry=l.d*h.ry;h.rx=Math.abs(h.rx);h.ry=Math.abs(h.ry);v();break;case "circle":G=P(h.cx,h.cy,l);h.cx=G.x;h.cy=G.y;G=svgedit.math.transformBox(box.x,box.y,box.width,box.height,l);h.r=Math.min((G.tr.x-G.tl.x)/2,(G.bl.y-G.tl.y)/2);if(h.r)h.r=Math.abs(h.r);v();break;case "line":A=P(h.x1,h.y1,l);F=P(h.x2,h.y2,l);h.x1=A.x;h.y1=A.y;h.x2=F.x;h.y2=F.y;case "text":l=e.querySelectorAll("tspan");for(G=l.length;G--;){A=ta("x",e.getAttribute("x")); -u=ta("x",l[G].getAttribute("x"));F=ta("y",e.getAttribute("y"));H=ta("y",l[G].getAttribute("y"));var D={};if(!isNaN(A)&&!isNaN(u)&&A!=0&&u!=0&&h.x)D.x=h.x-(A-u);if(!isNaN(F)&&!isNaN(H)&&F!=0&&H!=0&&h.y)D.y=h.y-(F-H);if(D.x||D.y)ma(l[G],D,1E3,true)}v();break;case "use":v();break;case "g":(v=$(e).data("gsvg"))&&ma(v,h,1E3,true);break;case "polyline":case "polygon":v=h.points.length;for(G=0;G0){for(var l=h.numberOfItems;l--;){var z=h.getItem(l);if(z.type===0)h.removeItem(l);else if(z.type=== -1)svgedit.math.isIdentity(z.matrix)&&h.removeItem(l);else z.type===4&&z.angle===0&&h.removeItem(l)}if(h.numberOfItems===1&&oa(e))return null}if(!h||h.numberOfItems==0){e.removeAttribute("transform");return null}if(h){l=h.numberOfItems;for(var v=[];l--;){z=h.getItem(l);if(z.type===1)v.push([z.matrix,l]);else if(v.length)v=[]}if(v.length===2){l=d.createSVGTransformFromMatrix(ia(v[1][0],v[0][0]));h.removeItem(v[0][1]);h.removeItem(v[1][1]);h.insertItemBefore(l,v[1][1])}l=h.numberOfItems;if(l>=2&&h.getItem(l- -2).type===1&&h.getItem(l-1).type===2){v=d.createSVGTransform();z=ia(h.getItem(l-2).matrix,h.getItem(l-1).matrix);v.setMatrix(z);h.removeItem(l-2);h.removeItem(l-2);h.appendItem(v)}}switch(e.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 G=$(e).data("gsvg");l=new Ba("Transform");var A={},u=null;z=[];switch(e.tagName){case "line":z=["x1","y1", -"x2","y2"];break;case "circle":z=["cx","cy","r"];break;case "ellipse":z=["cx","cy","rx","ry"];break;case "foreignObject":case "rect":case "image":z=["width","height","x","y"];break;case "use":case "text":case "tspan":z=["x","y"];break;case "polygon":case "polyline":u={};u.points=e.getAttribute("points");v=e.points;var F=v.numberOfItems;A.points=Array(F);for(var H=0;H1.0E-10?Math.sin(H)/(1-Math.cos(H)):2/H;for(H=0;H=3&&h.getItem(N-2).type==3&&h.getItem(N-3).type==2&&h.getItem(N-1).type==2){H=3;var w=h.getItem(N-3).matrix,C=h.getItem(N-2).matrix,K=h.getItem(N-1).matrix;F=e.childNodes;for(D=F.length;D--;){var R=F.item(D);z=G=0;if(R.nodeType==1){var Q=Y(R);if(Q){z=ga(Q).matrix;G=oa(R);var V=Ta,aa=[];Ta=R.getAttribute("transform");if(G||qa(Q)){var fa= -d.createSVGTransform();fa.setMatrix(ia(w,C,K,z));Q.clear();Q.appendItem(fa);aa.push(fa)}else{G=ia(z.inverse(),K,z);fa=d.createSVGMatrix();fa.e=-G.e;fa.f=-G.f;z=ia(fa.inverse(),z.inverse(),w,C,K,z,G.inverse());var pa=d.createSVGTransform(),sa=d.createSVGTransform(),Za=d.createSVGTransform();pa.setTranslate(G.e,G.f);sa.setScale(z.a,z.d);Za.setTranslate(fa.e,fa.f);Q.appendItem(Za);Q.appendItem(sa);Q.appendItem(pa);aa.push(Za);aa.push(sa);aa.push(pa)}l.addSubCommand(Wa(R));Ta=V}}}h.removeItem(N-1);h.removeItem(N- -2);h.removeItem(N-3)}else if(N>=3&&h.getItem(N-1).type==1){H=3;z=ga(h).matrix;fa=d.createSVGTransform();fa.setMatrix(z);h.clear();h.appendItem(fa)}else if((N==1||N>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){H=2;G=ga(h).matrix;h.removeItem(0);z=ga(h).matrix.inverse();z=ia(z,G);G=z.e;z=z.f;if(G!=0||z!=0){F=e.childNodes;D=F.length;for(N=[];D--;){R=F.item(D);if(R.nodeType==1){if(R.getAttribute("clip-path")){V=R.getAttribute("clip-path");if(N.indexOf(V)===-1){ob(V,G,z);N.push(V)}}V=Ta;Ta=R.getAttribute("transform"); -if(Q=Y(R)){w=d.createSVGTransform();w.setTranslate(G,z);Q.numberOfItems?Q.insertItemBefore(w,0):Q.appendItem(w);l.addSubCommand(Wa(R));Q=e.getElementsByTagNameNS(c,"use");R="#"+R.id;for(w=Q.length;w--;){C=Q.item(w);if(R==da(C)){K=d.createSVGTransform();K.setTranslate(-G,-z);Y(C).insertItemBefore(K,0);l.addSubCommand(Wa(C))}}Ta=V}}}N=[];Ta=V}}else if(N==1&&h.getItem(0).type==1&&!v){H=1;z=h.getItem(0).matrix;F=e.childNodes;for(D=F.length;D--;){R=F.item(D);if(R.nodeType==1){V=Ta;Ta=R.getAttribute("transform"); -if(Q=Y(R)){G=ia(z,ga(Q).matrix);N=d.createSVGTransform();N.setMatrix(G);Q.clear();Q.appendItem(N,0);l.addSubCommand(Wa(R));Ta=V;V=R.getAttribute("stroke-width");R.getAttribute("stroke")!=="none"&&!isNaN(V)&&R.setAttribute("stroke-width",V*((Math.abs(G.a)+Math.abs(G.d))/2))}}}h.clear()}else{if(v){E=d.createSVGTransform();E.setRotate(v,L.x,L.y);h.numberOfItems?h.insertItemBefore(E,0):h.appendItem(E)}h.numberOfItems==0&&e.removeAttribute("transform");return null}if(H==2){if(v){L={x:E.x+n.e,y:E.y+n.f}; -E=d.createSVGTransform();E.setRotate(v,L.x,L.y);h.numberOfItems?h.insertItemBefore(E,0):h.appendItem(E)}}else if(H==3){z=ga(h).matrix;n=d.createSVGTransform();n.setRotate(v,E.x,E.y);n=n.matrix;E=d.createSVGTransform();E.setRotate(v,L.x,L.y);L=E.matrix.inverse();V=z.inverse();L=ia(V,L,n,z);G=L.e;z=L.f;if(G!=0||z!=0){F=e.childNodes;for(D=F.length;D--;){R=F.item(D);if(R.nodeType==1){V=Ta;Ta=R.getAttribute("transform");Q=Y(R);w=d.createSVGTransform();w.setTranslate(G,z);Q.numberOfItems?Q.insertItemBefore(w, -0):Q.appendItem(w);l.addSubCommand(Wa(R));Ta=V}}}if(v)h.numberOfItems?h.insertItemBefore(E,0):h.appendItem(E)}}else{v=svgedit.utilities.getBBox(e);if(!v&&e.tagName!="path")return null;z=d.createSVGMatrix();if(G=oa(e)){E={x:v.x+v.width/2,y:v.y+v.height/2};L=P(v.x+v.width/2,v.y+v.height/2,ga(h).matrix);H=G*Math.PI/180;F=Math.abs(H)>1.0E-10?Math.sin(H)/(1-Math.cos(H)):2/H;for(H=0;H=3&&h.getItem(N-2).type==3&&h.getItem(N-3).type==2&&h.getItem(N-1).type==2){H=3;z=ga(h,N-3,N-1).matrix;h.removeItem(N-1);h.removeItem(N-2);h.removeItem(N-3)}else if(N== -4&&h.getItem(N-1).type==1){H=3;z=ga(h).matrix;fa=d.createSVGTransform();fa.setMatrix(z);h.clear();h.appendItem(fa);z=d.createSVGMatrix()}else if((N==1||N>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){H=2;n=h.getItem(0).matrix;V=ga(h,1).matrix;v=V.inverse();z=ia(v,n,V);h.removeItem(0)}else if(N==1&&h.getItem(0).type==1&&!G){z=ga(h).matrix;switch(e.tagName){case "line":A=$(e).attr(["x1","y1","x2","y2"]);case "polyline":case "polygon":A.points=e.getAttribute("points");if(A.points){v=e.points;F=v.numberOfItems; -A.points=Array(F);for(H=0;H1&&v.showGrips(false)}}}O("selected",I);h||I.length==1?Ia.requestSelector(I[0]).showGrips(true):Ia.requestSelector(I[0]).showGrips(false);for(I.sort(function(G,A){if(G&&A&&G.compareDocumentPosition)return 3- -(A.compareDocumentPosition(G)&6);else if(G==null)return 1});I[0]==null;)I.shift(0)}},Bb=this.selectOnly=function(e,h){Qa(true);wb(e,h)};this.removeFromSelection=function(e){if(I[0]!=null)if(e.length!=0){var h=Array(I.length);j=0;len=I.length;for(var l=0;l=0&&e.id!="svgcanvas")for(;e.nodeName!="foreignObject";){e=e.parentNode;if(!e)return d}var h=B().getCurrentLayer();if([d,a,k,h].indexOf(e)>=0)return d;if($(e).closest("#selectorParentGroup").length)return Ia.selectorParentGroup;for(;e.parentNode!==(J||h);)e=e.parentNode;return e};(function(){var e=null,h=null,l=null,z= -null,v=null,G={},A={minx:null,miny:null,maxx:null,maxy:null};$(a).mousedown(function(u){if(!(u.originalEvent.touches&&u.originalEvent.touches>1)){var F=u.button===2;sb=k.getScreenCTM().inverse();var H=P(u.pageX,u.pageY,sb),D=H.x*o;H=H.y*o;u.preventDefault();if(F)Fa="select";D=D/o;H=H/o;var E=Kb(u);if(E.tagName==="a"&&E.childNodes.length===1)E=E.firstChild;var L=z=h=D,N=v=l=H;if(m.gridSnapping){D=xa(D);H=xa(H);h=xa(h);l=xa(l)}if(E==Ia.selectorParentGroup&&I[0]!=null){E=u.target;var n=jb(E,"type"); -if(n=="rotate"){Fa="rotate";current_rotate_mode=jb(E,"dir")}else if(n=="resize"){Fa="resize";lb=jb(E,"dir")}E=I[0]}Ta=E.getAttribute("transform");n=Y(E);switch(Fa){case "select":Ma=true;lb="none";if(F)Ma=false;if(E!=d){if(I.indexOf(E)==-1){u.shiftKey||Qa(true);wb([E]);Cb=E;Ka.clear()}if(!F)for(F=0;F1))if(Ma)if(!(u.button===1||b.spaceKey)){var F=I[0],H=P(u.pageX,u.pageY, -sb),D=H.x*o;H=H.y*o;var E=ra(ca()),L=x=D/o,N=y=H/o;if(m.gridSnapping){x=xa(x);y=xa(y)}u.preventDefault();switch(Fa){case "select":if(I[0]!==null){L=x-h;var n=y-l;if(m.gridSnapping){L=xa(L);n=xa(n)}if(u.shiftKey){var w=ba(h,l,x,y);x=w.x;y=w.y}if(L!=0||n!=0){w=I.length;for(N=0;N0&&b.removeFromSelection(E);L.length>0&&wb(L); -break;case "resize":E=Y(F);L=(C=qa(E))?G:svgedit.utilities.getBBox(F);w=L.x;N=L.y;var K=L.width,R=L.height;L=x-h;n=y-l;if(m.gridSnapping){L=xa(L);n=xa(n);R=xa(R);K=xa(K)}var Q=oa(F);if(Q){var V=Math.sqrt(L*L+n*n);n=Math.atan2(n,L)-Q*Math.PI/180;L=V*Math.cos(n);n=V*Math.sin(n)}if(lb.indexOf("n")==-1&&lb.indexOf("s")==-1)n=0;if(lb.indexOf("e")==-1&&lb.indexOf("w")==-1)L=0;var aa=V=0,fa=R?(R+n)/R:1,pa=K?(K+L)/K:1;if(lb.indexOf("n")>=0){fa=R?(R-n)/R:1;aa=R}if(lb.indexOf("w")>=0){pa=K?(K-L)/K:1;V=K}L= -d.createSVGTransform();n=d.createSVGTransform();K=d.createSVGTransform();if(m.gridSnapping){w=xa(w);V=xa(V);N=xa(N);aa=xa(aa)}L.setTranslate(-(w+V),-(N+aa));if(u.shiftKey)if(pa==1)pa=fa;else fa=pa;n.setScale(pa,fa);K.setTranslate(w+V,N+aa);if(C){C=Q?1:0;E.replaceItem(L,2+C);E.replaceItem(n,1+C);E.replaceItem(K,0+C)}else{C=E.numberOfItems;E.replaceItem(K,C-3);E.replaceItem(n,C-2);E.replaceItem(L,C-1)}Ia.requestSelector(F).resize();O("transition",I);break;case "zoom":L*=o;N*=o;ma(ua,{x:Math.min(z*o, -L),y:Math.min(v*o,N),width:Math.abs(L-z*o),height:Math.abs(N-v*o)},100);break;case "text":ma(E,{x:x,y:y},1E3);break;case "line":L=null;window.opera||d.suspendRedraw(1E3);if(m.gridSnapping){x=xa(x);y=xa(y)}C=x;w=y;if(u.shiftKey){w=ba(h,l,C,w);C=w.x;w=w.y}E.setAttributeNS(null,"x2",C);E.setAttributeNS(null,"y2",w);window.opera||d.unsuspendRedraw(L);break;case "foreignObject":case "square":case "rect":case "image":L=Math.abs(x-h);C=Math.abs(y-l);if(Fa=="square"||u.shiftKey){L=C=Math.max(L,C);w=hl?l+N:l-N}if(u.altKey){C=h;w=l;N=Math.abs(x-C);n=u.shiftKey?N:Math.abs(y-w)}E.setAttributeNS(null,"rx",N);E.setAttributeNS(null,"ry",n);E.setAttributeNS(null,"cx",C);E.setAttributeNS(null,"cy",w);window.opera||d.unsuspendRedraw(L);break;case "fhellipse":case "fhrect":A.minx=Math.min(L,A.minx);A.maxx=Math.max(L,A.maxx);A.miny=Math.min(N,A.miny);A.maxy=Math.max(N,A.maxy);case "fhpath":e+=+L+","+N+" ";E.setAttributeNS(null,"points",e);break; -case "path":case "pathedit":x*=o;y*=o;if(m.gridSnapping){x=xa(x);y=xa(y);h=xa(h);l=xa(l)}if(u.shiftKey){if(C=svgedit.path.path){E=C.dragging?C.dragging[0]:h;C=C.dragging?C.dragging[1]:l}else{E=h;C=l}w=ba(E,C,x,y);x=w.x;y=w.y}if(ua&&ua.getAttribute("display")!=="none"){L*=o;N*=o;ma(ua,{x:Math.min(z*o,L),y:Math.min(v*o,N),width:Math.abs(L-z*o),height:Math.abs(N-v*o)},100)}Ka.mouseMove(u,x,y);break;case "textedit":x*=o;y*=o;ib.mouseMove(D,H);break;case "rotate":L=svgedit.utilities.getBBox(F);C=L.x+L.width/ -2;w=L.y+L.height/2;E=X(F);E=P(C,w,E);C=E.x;w=E.y;E=L.x;N=L.y;if(current_rotate_mode=="nw")E=L.x+L.width;if(current_rotate_mode=="se")N=L.y+L.height;if(current_rotate_mode=="sw"){E=L.x+L.width;N=L.y+L.height}compensation_angle=(Math.atan2(w-N,C-E)*(180/Math.PI)-90)%360;Q=(Math.atan2(w-y,C-x)*(180/Math.PI)-90)%360;Q+=compensation_angle;if(m.gridSnapping)Q=xa(Q);if(u.shiftKey)Q=Math.round(Q/45)*45;b.setRotationAngle(Q<-180?360+Q:Q,true);O("transition",I)}pb("mouseMove",{event:u,mouse_x:D,mouse_y:H,selected:F})}}).click(function(u){u.preventDefault(); -return false}).dblclick(function(u){var F=u.target.parentNode;if(F!==J){var H=Kb(u),D=H.tagName;if(D==="text"&&Fa!=="textedit"){u=P(u.pageX,u.pageY,sb);ib.select(H,u.x,u.y)}if((D==="g"||D==="a")&&oa(H)){Ib(H);H=I[0];Qa(true)}J&&Lb();F.tagName!=="g"&&F.tagName!=="a"||F===B().getCurrentLayer()||H===Ia.selectorParentGroup||Sb(H)}}).mouseup(function(u){b.addClone=false;window.removeEventListener("keyup",b.removeClone);if(u.button!==2){var F=Cb;Cb=null;if(Ma){var H=P(u.pageX,u.pageY,sb),D=H.x*o;H=H.y* -o;var E=D/o,L=H/o,N=ra(ca()),n=false;Ma=false;switch(Fa){case "resize":case "multiselect":if(ua!=null){ua.setAttribute("display","none");nb=[]}Fa="select";case "select":if(I[0]!=null){if(I[1]==null){D=I[0];switch(D.tagName){case "g":case "use":case "image":case "foreignObject":break;default:bb.fill=D.getAttribute("fill");bb.fill_opacity=D.getAttribute("fill-opacity");bb.stroke=D.getAttribute("stroke");bb.stroke_opacity=D.getAttribute("stroke-opacity");bb.stroke_width=D.getAttribute("stroke-width"); -bb.stroke_dasharray=D.getAttribute("stroke-dasharray");bb.stroke_linejoin=D.getAttribute("stroke-linejoin");bb.stroke_linecap=D.getAttribute("stroke-linecap")}if(D.tagName=="text"){Ya.font_size=D.getAttribute("font-size");Ya.font_family=D.getAttribute("font-family")}Ia.requestSelector(D).showGrips(true)}Ha();if(E!=z||L!=v){u=I.length;for(D=0;D=0?F.indexOf(",",E+1)>=0:F.indexOf(" ",F.indexOf(" ")+1)>=0)N=Ka.smoothPolylineIntoPath(N); -break;case "line":F=$(N).attr(["x1","x2","y1","y2"]);n=F.x1!=F.x2||F.y1!=F.y2;break;case "foreignObject":case "square":case "rect":case "image":F=$(N).attr(["width","height"]);n=F.width!=0||F.height!=0||Fa==="image";break;case "circle":n=N.getAttribute("r")!=0;break;case "ellipse":F=$(N).attr(["rx","ry"]);n=F.rx!=null||F.ry!=null;break;case "fhellipse":if(A.maxx-A.minx>0&&A.maxy-A.miny>0){N=S({element:"ellipse",curStyles:true,attr:{cx:(A.minx+A.maxx)/2,cy:(A.miny+A.maxy)/2,rx:(A.maxx-A.minx)/2,ry:(A.maxy- -A.miny)/2,id:ca()}});O("changed",[N]);n=true}break;case "fhrect":if(A.maxx-A.minx>0&&A.maxy-A.miny>0){N=S({element:"rect",curStyles:true,attr:{x:A.minx,y:A.miny,width:A.maxx-A.minx,height:A.maxy-A.miny,id:ca()}});O("changed",[N]);n=true}break;case "text":n=true;Bb([N]);ib.start(N);break;case "path":N=null;Ma=true;F=Ka.mouseUp(u,N,D,H);N=F.element;n=F.keep;break;case "pathedit":n=true;N=null;Ka.mouseUp(u);break;case "textedit":n=false;N=null;ib.mouseUp(u,D,H);break;case "rotate":n=true;N=null;Fa="select"; -F=b.undoMgr.finishUndoableChange();F.isEmpty()||za(F);Ha();O("changed",I)}D=pb("mouseUp",{event:u,mouse_x:D,mouse_y:H},true);$.each(D,function(K,R){if(R){n=R.keep||n;N=R.element;Ma=R.started||Ma}});if(!n&&N!=null){B().releaseId(ca());N.parentNode.removeChild(N);N=null;for(D=u.target;D.parentNode.parentNode.tagName=="g";)D=D.parentNode;if((Fa!="path"||!drawn_path)&&D.parentNode.id!="selectorParentGroup"&&D.id!="svgcanvas"&&D.id!="svgroot"){b.setMode("select");Bb([D],true)}}else if(N!=null){b.addedNew= -true;u=0.2;var w;if(false.beginElement&&N.getAttribute("opacity")!=M.opacity){w=$(false).clone().attr({to:M.opacity,dur:u}).appendTo(N);try{w[0].beginElement()}catch(C){}}else u=0;setTimeout(function(){w&&w.remove();N.setAttribute("opacity",M.opacity);N.setAttribute("style","pointer-events:inherit");na(N);if(Fa==="path")Ka.toEditMode(N);else m.selectNew&&Bb([N],true);za(new Da(N));O("changed",[N])},u*1E3)}Ta=null}}});$(a).bind("mousewheel DOMMouseScroll",function(u){if(u.shiftKey){u.preventDefault(); -sb=k.getScreenCTM().inverse();var F=P(u.pageX,u.pageY,sb);F={x:F.x,y:F.y,width:0,height:0};if(u.wheelDelta)if(u.wheelDelta>=120)F.factor=2;else{if(u.wheelDelta<=-120)F.factor=0.5}else if(u.detail)if(u.detail>0)F.factor=0.5;else if(u.detail<0)F.factor=2;F.factor&&O("zoomed",F)}})})();var qb=function(e){$(e).click(function(h){h.preventDefault()})},ib=b.textActions=function(){function e(Q){var V=H.value==="";$(H).focus();if(!arguments.length)if(V)Q=0;else{if(H.selectionEnd!==H.selectionStart)return; -Q=H.selectionEnd}var aa;aa=N[Q];V||H.setSelectionRange(Q,Q);D=ra("text_cursor");if(!D){D=document.createElementNS(c,"line");ma(D,{id:"text_cursor",stroke:"#333","stroke-width":1});D=ra("selectorParentGroup").appendChild(D)}L||(L=setInterval(function(){var fa=D.getAttribute("display")==="none";D.setAttribute("display",fa?"inline":"none")},600));V=G(aa.x,n.y);aa=G(aa.x,n.y+n.height);ma(D,{x1:V.x,y1:V.y,x2:aa.x,y2:aa.y,visibility:"visible",display:"inline"});E&&E.setAttribute("d","")}function h(Q,V, -aa){if(Q===V)e(V);else{aa||H.setSelectionRange(Q,V);E=ra("text_selectblock");if(!E){E=document.createElementNS(c,"path");ma(E,{id:"text_selectblock",fill:"green",opacity:0.5,style:"pointer-events:none"});ra("selectorParentGroup").appendChild(E)}Q=N[Q];var fa=N[V];D.setAttribute("visibility","hidden");V=G(Q.x,n.y);aa=G(Q.x+(fa.x-Q.x),n.y);var pa=G(Q.x,n.y+n.height);Q=G(Q.x+(fa.x-Q.x),n.y+n.height);ma(E,{d:"M"+V.x+","+V.y+" L"+aa.x+","+aa.y+" "+Q.x+","+Q.y+" "+pa.x+","+pa.y+"z",display:"inline"})}} -function l(Q,V){var aa=d.createSVGPoint();aa.x=Q;aa.y=V;if(N.length==1)return 0;aa=F.getCharNumAtPosition(aa);if(aa<0){aa=N.length-2;if(Q<=N[0].x)aa=0}else if(aa>=N.length-2)aa=N.length-2;var fa=N[aa];Q>fa.x+fa.width/2&&aa++;return aa}function z(Q,V,aa){var fa=H.selectionStart;Q=l(Q,V);h(Math.min(fa,Q),Math.max(fa,Q),!aa)}function v(Q,V){var aa={x:Q,y:V};aa.x/=o;aa.y/=o;if(w){var fa=P(aa.x,aa.y,w.inverse());aa.x=fa.x;aa.y=fa.y}return aa}function G(Q,V){var aa={x:Q,y:V};if(w){var fa=P(aa.x,aa.y,w); -aa.x=fa.x;aa.y=fa.y}aa.x*=o;aa.y*=o;return aa}function A(Q){h(0,F.textContent.length);$(this).unbind(Q)}function u(Q){if(R&&F){var V=P(Q.pageX,Q.pageY,sb);V=v(V.x*o,V.y*o);V=l(V.x,V.y);var aa=F.textContent,fa=aa.substr(0,V).replace(/[a-z0-9]+$/i,"").length;aa=aa.substr(V).match(/^[a-z0-9]+/i);h(fa,(aa?aa[0].length:0)+V);$(Q.target).click(A);setTimeout(function(){$(Q.target).unbind("click",A)},300)}}var F,H,D,E,L,N=[],n,w,C,K,R;return{select:function(Q,V,aa){F=Q;ib.toEditMode(V,aa)},start:function(Q){F= -Q;ib.toEditMode()},mouseDown:function(Q,V,aa,fa){Q=v(aa,fa);H.focus();e(l(Q.x,Q.y));C=aa;K=fa},mouseMove:function(Q,V){if(!(evt.originalEvent.touches&&evt.originalEvent.touches.length>1)){var aa=v(Q,V);z(aa.x,aa.y)}},mouseUp:function(Q,V,aa){var fa=v(V,aa);z(fa.x,fa.y,true);Q.target!==F&&VC-2&&aaK-2&&ib.toSelectMode(true)},setCursor:e,toEditMode:function(Q,V){R=false;Fa="textedit";Ia.requestSelector(F).showGrips(false);Ia.requestSelector(F);ib.init();$(F).css("cursor","text");if(arguments.length){var aa= -v(Q,V);e(l(aa.x,aa.y))}else e();setTimeout(function(){R=true},300)},toSelectMode:function(Q){Fa="select";clearInterval(L);L=null;E&&$(E).attr("display","none");D&&$(D).attr("visibility","hidden");$(F).css("cursor","move");if(Q){Qa();$(F).css("cursor","move");O("selected",[F]);wb([F],true)}F&&!F.textContent.length&&b.deleteSelectedElements();$(H).blur();F=false},setInputElem:function(Q){H=Q},clear:function(){Fa=="textedit"&&ib.toSelectMode()},init:function(){if(F){if(!F.parentNode){F=I[0];Ia.requestSelector(F).showGrips(false)}var Q= -F.textContent.length,V=F.getAttribute("transform");n=svgedit.utilities.getBBox(F);w=V?X(F):null;N=Array(Q);H.focus();$(F).unbind("dblclick",u).dblclick(u);if(!Q)var aa={x:n.x+n.width/2,width:0};for(V=0;V=0&&this.selected_pts.push(F)}this.selected_pts.sort();u=this.selected_pts.length; -for(A=Array(u);u--;){H=this.segs[this.selected_pts[u]];H.select(true);A[u]=H.ptgrip}Ka.canDeleteNodes=true;Ka.closed_subpath=this.subpathIsClosed(this.selected_pts[0]);O("selected",A)};var v=h=null,G=false;return{mouseDown:function(A,u,F,H){if(Fa==="path"){mouse_x=F;mouse_y=H;H=mouse_x/o;u=mouse_y/o;F=ra("path_stretch_line");l=[H,u];if(m.gridSnapping){H=xa(H);u=xa(u);mouse_x=xa(mouse_x);mouse_y=xa(mouse_y)}if(!F){F=document.createElementNS(c,"path");ma(F,{id:"path_stretch_line",stroke:"#22C","stroke-width":"0.5", -fill:"none"});F=ra("selectorParentGroup").appendChild(F)}F.setAttribute("display","inline");var D=null;if(v){D=v.pathSegList;for(var E=D.numberOfItems,L=6/o,N=false;E;){E--;var n=D.getItem(E),w=n.x;n=n.y;if(H>=w-L&&H<=w+L&&u>=n-L&&u<=n+L){N=true;break}}L=ca();svgedit.path.removePath_(L);L=ra(L);w=D.numberOfItems;if(N){if(E<=1&&w>=2){H=D.getItem(0).x;u=D.getItem(0).y;A=F.pathSegList.getItem(1);A=A.pathSegType===4?v.createSVGPathSegLinetoAbs(H,u):v.createSVGPathSegCurvetoCubicAbs(H,u,A.x1/o,A.y1/o, -H,u);H=v.createSVGPathSegClosePath();D.appendItem(A);D.appendItem(H)}else if(w<3)return D=false;$(F).remove();element=L;v=null;Ma=false;if(e){svgedit.path.path.matrix&&fb(L,{},svgedit.path.path.matrix.inverse());F=L.getAttribute("d");A=$(svgedit.path.path.elem).attr("d");$(svgedit.path.path.elem).attr("d",A+F);$(L).remove();svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();svgedit.path.path.init();Ka.toEditMode(svgedit.path.path.elem);svgedit.path.path.selectPt();return false}}else{if(!$.contains(a, -Kb(A))){console.log("Clicked outside canvas");return false}D=v.pathSegList.numberOfItems;E=v.pathSegList.getItem(D-1);L=E.x;E=E.y;if(A.shiftKey){A=ba(L,E,H,u);H=A.x;u=A.y}A=F.pathSegList.getItem(1);A=A.pathSegType===4?v.createSVGPathSegLinetoAbs(gb(H),gb(u)):v.createSVGPathSegCurvetoCubicAbs(gb(H),gb(u),A.x1/o,A.y1/o,A.x2/o,A.y2/o);v.pathSegList.appendItem(A);H*=o;u*=o;F.setAttribute("d",["M",H,u,H,u].join(" "));F=D;if(e)F+=svgedit.path.path.segs.length;svgedit.path.addPointGrip(F,H,u)}}else{d_attr= -"M"+H+","+u+" ";v=S({element:"path",curStyles:true,attr:{d:d_attr,id:ja(),opacity:M.opacity/2}});F.setAttribute("d",["M",mouse_x,mouse_y,mouse_x,mouse_y].join(" "));F=e?svgedit.path.path.segs.length:0;svgedit.path.addPointGrip(F,mouse_x,mouse_y)}}else if(svgedit.path.path){svgedit.path.path.storeD();L=A.target.id;if(L.substr(0,14)=="pathpointgrip_"){u=svgedit.path.path.cur_pt=parseInt(L.substr(14));svgedit.path.path.dragging=[F,H];D=svgedit.path.path.segs[u];if(A.shiftKey)D.selected?svgedit.path.path.removePtFromSelection(u): -svgedit.path.path.addPtsToSelection(u);else{if(svgedit.path.path.selected_pts.length<=1||!D.selected)svgedit.path.path.clearSelection();svgedit.path.path.addPtsToSelection(u)}}else if(L.indexOf("ctrlpointgrip_")==0){svgedit.path.path.dragging=[F,H];A=L.split("_")[1].split("c");u=A[0]-0;svgedit.path.path.selectPt(u,A[1]-0)}if(!svgedit.path.path.dragging){if(ua==null)ua=Ia.getRubberBandBox();ma(ua,{x:F*o,y:H*o,width:0,height:0,display:"inline"},100)}}},mouseMove:function(A,u,F){if(!(A.originalEvent.touches&& -A.originalEvent.touches.length>1)){G=true;if(Fa==="path"){if(v){var H=v.pathSegList;A=H.numberOfItems-1;if(l){var D=svgedit.path.addCtrlGrip("1c1"),E=svgedit.path.addCtrlGrip("0c2");E.getAttribute("cx");E.getAttribute("cy");D.setAttribute("cx",u);D.setAttribute("cy",F);D.setAttribute("display","inline");D=l[0];var L=l[1];H.getItem(A);var N=D+(D-u/o),n=L+(L-F/o);E.setAttribute("cx",N*o);E.setAttribute("cy",n*o);E.setAttribute("display","inline");E=svgedit.path.getCtrlLine(1);var w=svgedit.path.getCtrlLine(2); -ma(E,{x1:u,y1:F,x2:D*o,y2:L*o,display:"inline"});ma(w,{x1:N*o,y1:n*o,x2:D*o,y2:L*o,display:"inline"});if(A===0)z=[u,F];else{H=H.getItem(A-1);u=H.x;F=H.y;if(H.pathSegType===6){u+=u-H.x2;F+=F-H.y2}else if(z){u=z[0]/o;F=z[1]/o}svgedit.path.replacePathSeg(6,A,[D,L,u,F,N,n],v)}}else if(D=ra("path_stretch_line")){A=H.getItem(A);if(A.pathSegType===6)svgedit.path.replacePathSeg(6,1,[u,F,(A.x+(A.x-A.x2))*o,(A.y+(A.y-A.y2))*o,u,F],D);else z?svgedit.path.replacePathSeg(6,1,[u,F,z[0],z[1],u,F],D):svgedit.path.replacePathSeg(4, -1,[u,F],D)}}}else if(svgedit.path.path.dragging){D=svgedit.path.getPointFromGrip({x:svgedit.path.path.dragging[0],y:svgedit.path.path.dragging[1]},svgedit.path.path);L=svgedit.path.getPointFromGrip({x:u,y:F},svgedit.path.path);A=L.x-D.x;D=L.y-D.y;svgedit.path.path.dragging=[u,F];svgedit.path.path.dragctrl?svgedit.path.path.moveCtrl(A,D):svgedit.path.path.movePts(A,D)}else{svgedit.path.path.selected_pts=[];svgedit.path.path.eachSeg(function(){if(this.next||this.prev){var C=ua.getBBox(),K=svgedit.path.getGripPt(this); -C=svgedit.math.rectsIntersect(C,{x:K.x,y:K.y,width:0,height:0});this.select(C);C&&svgedit.path.path.selected_pts.push(this.index)}})}}},mouseUp:function(A,u){if(Fa==="path"){l=null;if(!v){u=ra(ca());Ma=false;z=null}return{keep:true,element:u}}if(svgedit.path.path.dragging){var F=svgedit.path.path.cur_pt;svgedit.path.path.dragging=false;svgedit.path.path.dragctrl=false;svgedit.path.path.update();G&&svgedit.path.path.endChanges("Move path point(s)");!A.shiftKey&&!G&&svgedit.path.path.selectPt(F)}else if(ua&& -ua.getAttribute("display")!="none"){ua.setAttribute("display","none");ua.getAttribute("width")<=2&&ua.getAttribute("height")<=2&&Ka.toSelectMode(A.target)}else Ka.toSelectMode(A.target);G=false},toEditMode:function(A){svgedit.path.path=svgedit.path.getPath_(A);Fa="pathedit";Qa();svgedit.path.path.show(true).update();svgedit.path.path.oldbbox=svgedit.utilities.getBBox(svgedit.path.path.elem);e=false},toSelectMode:function(A){var u=A==svgedit.path.path.elem;Fa="select";svgedit.path.path.show(false); -h=false;Qa();svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();if(u){O("selected",[A]);wb([A],true)}},addSubPath:function(A){if(A){Fa="path";e=true}else{Ka.clear(true);Ka.toEditMode(svgedit.path.path.elem)}},select:function(A){if(h===A){Ka.toEditMode(A);Fa="pathedit"}else h=A},reorient:function(){var A=I[0];if(A)if(oa(A)!=0){var u=new Ba("Reorient path"),F={d:A.getAttribute("d"),transform:A.getAttribute("transform")};u.addSubCommand(new Oa(A,F));Qa();this.resetOrientation(A);za(u);svgedit.path.getPath_(A).show(false).matrix= -null;this.clear();wb([A],true);O("changed",I)}},clear:function(){h=null;if(v){var A=ra(ca());$(ra("path_stretch_line")).remove();$(A).remove();$(ra("pathpointgrip_container")).find("*").attr("display","none");v=z=null;Ma=false}else Fa=="pathedit"&&this.toSelectMode();svgedit.path.path&&svgedit.path.path.init().show(false)},resetOrientation:function(A){if(A==null||A.nodeName!="path")return false;var u=Y(A),F=ga(u).matrix;u.clear();A.removeAttribute("transform");u=A.pathSegList;for(var H=u.numberOfItems, -D=0;D0){L=H.getItem(D-1).pathSegType;if(L===2){E(D-1,1);F();break}else if(L===1&&H.numberOfItems-1===D){E(D,1);F();break}}}return false};F();if(svgedit.path.path.elem.pathSegList.numberOfItems<= -1){Ka.toSelectMode(svgedit.path.path.elem);b.deleteSelectedElements()}else{svgedit.path.path.init();svgedit.path.path.clearSelection();if(window.opera){A=$(svgedit.path.path.elem);A.attr("d",A.attr("d"))}svgedit.path.path.endChanges("Delete path node(s)")}}},smoothPolylineIntoPath:function(A){var u=A.points,F=u.numberOfItems;if(F>=4){var H=u.getItem(0),D=null;A=[];A.push(["M",H.x,",",H.y," C"].join(""));for(var E=1;E<=F-4;E+=3){var L=u.getItem(E),N=u.getItem(E+1),n=u.getItem(E+2);if(D)if((H=svgedit.path.smoothControlPoints(D, -L,H))&&H.length==2){L=A[A.length-1].split(",");L[2]=H[0].x;L[3]=H[0].y;A[A.length-1]=L.join(",");L=H[1]}A.push([L.x,L.y,N.x,N.y,n.x,n.y].join(","));H=n;D=N}for(A.push("L");E0;);Ka.clear(true);$.each(k.childNodes,function(l,z){l&&z.nodeType===8&&z.data.indexOf("Created with")>=0&&k.insertBefore(z,k.firstChild)});if(J){Lb();Bb([J])}var e= -[];$(k).find("g:data(gsvg)").each(function(){for(var l=this.attributes,z=l.length,v=0;v=0;F--){u=A.item(F);E=z(u.nodeValue);if(!(L.indexOf(u.localName)>=0))if(E!="")if(E.indexOf("pointer-events")!==0)if(!(u.localName==="class"&&E.indexOf("se_")===0)){l.push(" ");if(u.localName==="d")E=Ka.convertPath(e,true);if(isNaN(E)){if(G.test(E))E= -svgedit.units.shortFloat(E)+v}else E=svgedit.units.shortFloat(E);if(hb.apply&&e.nodeName==="image"&&u.localName==="href"&&hb.images&&hb.images==="embed"){var N=Sa[E];if(N)E=N}if(!u.namespaceURI||u.namespaceURI==c||Ca[u.namespaceURI]){l.push(u.nodeName);l.push('="');l.push(E);l.push('"')}}}}if(e.hasChildNodes()){l.push(">");h++;A=false;for(F=0;F");break;case 8:l.push("\n");l.push(Array(h+1).join(" "));l.push("