changeset 647:63f40df40236

svg-edit: updated compiled version
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 06 Feb 2015 08:41:20 +0100
parents 815a86c7fbf1
children 2f092fcc3999
files htdocs/svg-edit/editor/svgedit.compiled.js
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/htdocs/svg-edit/editor/svgedit.compiled.js	Fri Feb 06 08:38:57 2015 +0100
+++ b/htdocs/svg-edit/editor/svgedit.compiled.js	Fri Feb 06 08:41:20 2015 +0100
@@ -32,14 +32,14 @@
 6|192,p&63|128);else if((p&63488)!=55296)v=String.fromCharCode(p>>12|224,p>>6&63|128,p&63|128);else{if((p&64512)!=55296)throw new RangeError("Unmatched trail surrogate at "+A);v=g.charCodeAt(++A);if((v&64512)!=56320)throw new RangeError("Unmatched lead surrogate at "+(A-1));p=((p&1023)<<10)+(v&1023)+65536;v=String.fromCharCode(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}if(v!==null){if(D>w)q+=g.slice(w,D);q+=v;w=D=A+1}}if(D>w)q+=g.slice(w,u);return q};svgedit.utilities.convertToXMLReferences=function(g){var q,
 w="";for(q=0;q<g.length;q++){var D=g.charCodeAt(q);if(D<128)w+=g[q];else if(D>127)w+="&#"+D+";"}return w};svgedit.utilities.text2xml=function(g){if(g.indexOf("<svg:svg")>=0)g=g.replace(/<(\/?)svg:/g,"<$1").replace("xmlns:svg","xmlns");var q,w;try{w=window.DOMParser?new DOMParser:new ActiveXObject("Microsoft.XMLDOM");w.async=false}catch(D){throw Error("XML Parser could not be instantiated");}try{q=w.loadXML?w.loadXML(g)?w:false:w.parseFromString(g,"text/xml")}catch(u){throw Error("Error parsing XML string");
 }return q};svgedit.utilities.bboxToObj=function(g){return{x:g.x,y:g.y,width:g.width,height:g.height}};svgedit.utilities.walkTree=function(g,q){if(g&&g.nodeType==1){q(g);for(var w=g.childNodes.length;w--;)svgedit.utilities.walkTree(g.childNodes.item(w),q)}};svgedit.utilities.walkTreePost=function(g,q){if(g&&g.nodeType==1){for(var w=g.childNodes.length;w--;)svgedit.utilities.walkTree(g.childNodes.item(w),q);q(g)}};svgedit.utilities.getUrlFromAttr=function(g){if(g){if(g.indexOf('url("')===0)return g.substring(5,
-g.indexOf('"',6));if(g.indexOf("url('")===0)return g.substring(5,g.indexOf("'",6));if(g.indexOf("url(")===0)return g.substring(4,g.indexOf(")"))}return null};svgedit.utilities.getHref=function(g){return g.getAttributeNS(I.XLINK,"href")};svgedit.utilities.setHref=function(g,q){g.setAttributeNS(I.XLINK,"xlink:href",q);g.setAttributeNS(I.XLINK,"target","_blank")};svgedit.utilities.findDefs=function(){var g=c.getSVGContent(),q=g.getElementsByTagNameNS(I.SVG,"defs");if(q.length>0)q=q[0];else{q=g.ownerDocument.createElementNS(I.SVG,
-"defs");g.firstChild?g.insertBefore(q,g.firstChild.nextSibling):g.appendChild(q)}return q};svgedit.utilities.getPathBBox=function(g){var q=g.pathSegList,w=q.numberOfItems;g=[[],[]];var D=q.getItem(0),u=[D.x,D.y];for(D=0;D<w;D++){var A=q.getItem(D);if(typeof A.x!=="undefined"){g[0].push(u[0]);g[1].push(u[1]);if(A.x1){var p=[A.x1,A.y1],v=[A.x2,A.y2],t=[A.x,A.y],m;for(m=0;m<2;m++){A=function(fa){return Math.pow(1-fa,3)*u[m]+3*Math.pow(1-fa,2)*fa*p[m]+3*(1-fa)*Math.pow(fa,2)*v[m]+Math.pow(fa,3)*t[m]};
-var L=6*u[m]-12*p[m]+6*v[m],R=-3*u[m]+9*p[m]-9*v[m]+3*t[m],da=3*p[m]-3*u[m];if(R==0){if(L!=0){L=-da/L;0<L&&L<1&&g[m].push(A(L))}}else{da=Math.pow(L,2)-4*da*R;if(!(da<0)){var qa=(-L+Math.sqrt(da))/(2*R);0<qa&&qa<1&&g[m].push(A(qa));L=(-L-Math.sqrt(da))/(2*R);0<L&&L<1&&g[m].push(A(L))}}}u=t}else{g[0].push(A.x);g[1].push(A.y)}}}q=Math.min.apply(null,g[0]);w=Math.max.apply(null,g[0])-q;D=Math.min.apply(null,g[1]);g=Math.max.apply(null,g[1])-D;return{x:q,y:D,width:w,height:g}};svgedit.utilities.getBBox=
-function(g){var q=g||c.geSelectedElements()[0];if(g.nodeType!=1)return null;g=null;var w=q.nodeName;switch(w){case "text":if(q.textContent===""){q.textContent="a";g=q.getBBox();q.textContent=""}else try{g=q.getBBox()}catch(D){}break;case "path":if(svgedit.browser.supportsPathBBox())try{g=q.getBBox()}catch(u){}else g=svgedit.utilities.getPathBBox(q);break;case "g":case "a":g=a(q);break;default:if(w==="use")g=a(q,true);if(w==="use"||w==="foreignObject"&&svgedit.browser.isWebkit()){g||(g=q.getBBox());
-w={};w.width=g.width;w.height=g.height;w.x=g.x+parseFloat(q.getAttribute("x")||0);w.y=g.y+parseFloat(q.getAttribute("y")||0);g=w}else if(~o.indexOf(w))try{g=q.getBBox()}catch(A){q=$(q).closest("foreignObject");if(q.length)try{g=q[0].getBBox()}catch(p){g=null}else g=null}}if(g)g=svgedit.utilities.bboxToObj(g);return g};svgedit.utilities.getRotationAngle=function(g,q){var w=g||c.getSelectedElements()[0];w=svgedit.transformlist.getTransformList(w);if(!w)return 0;var D=w.numberOfItems,u;for(u=0;u<D;++u){var A=
-w.getItem(u);if(A.type==4)return q?A.angle*Math.PI/180:A.angle}return 0};svgedit.utilities.getRefElem=function(g){return svgedit.utilities.getElem(svgedit.utilities.getUrlFromAttr(g).substr(1))};svgedit.utilities.getElem=svgedit.browser.supportsSelectors()?function(g){return e.querySelector("#"+g)}:svgedit.browser.supportsXpath()?function(g){return h.evaluate('svg:svg[@id="svgroot"]//svg:*[@id="'+g+'"]',s,function(){return svgedit.NS.SVG},9,null).singleNodeValue}:function(g){return $(e).find("[id="+
-g+"]")[0]};svgedit.utilities.assignAttributes=function(g,q,w,D){w||(w=0);svgedit.browser.isOpera()||e.suspendRedraw(w);for(var u in q)if(w=u.substr(0,4)==="xml:"?I.XML:u.substr(0,6)==="xlink:"?I.XLINK:null)g.setAttributeNS(w,u,q[u]);else D?svgedit.units.setUnitAttr(g,u,q[u]):g.setAttribute(u,q[u]);svgedit.browser.isOpera()||e.unsuspendRedraw(null)};svgedit.utilities.cleanupElement=function(g){var q=e.suspendRedraw(60),w={"fill-opacity":1,"stop-opacity":1,opacity:1,stroke:"none","stroke-dasharray":"none",
-"stroke-linejoin":"miter","stroke-linecap":"butt","stroke-opacity":1,"stroke-width":1,rx:0,ry:0},D;for(D in w){var u=w[D];g.getAttribute(D)==u&&g.removeAttribute(D)}e.unsuspendRedraw(q)};svgedit.utilities.snapToGrid=function(g){var q=c.getSnappingStep(),w=c.getBaseUnit();if(w!=="px")q*=svgedit.units.getTypeMap()[w];return g=Math.round(g/q)*q};svgedit.utilities.preg_quote=function(g,q){return String(g).replace(RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(q||"")+"-]","g"),"\\$&")}})();(function(){if(!svgedit.sanitize)svgedit.sanitize={};var a=svgedit.NS,I=svgedit.getReverseNS(),o={a:["class","clip-path","clip-rule","fill","fill-opacity","fill-rule","filter","id","mask","opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","style","systemLanguage","target","transform","xlink:href","xlink:title"],circle:["class","clip-path","clip-rule","cx","cy","fill","fill-opacity","fill-rule","filter","id",
+g.indexOf('"',6));if(g.indexOf("url('")===0)return g.substring(5,g.indexOf("'",6));if(g.indexOf("url(")===0)return g.substring(4,g.indexOf(")"))}return null};svgedit.utilities.getHref=function(g){return g.getAttributeNS(I.XLINK,"href")};svgedit.utilities.setHref=function(g,q){g.setAttributeNS(I.XLINK,"xlink:href",q)};svgedit.utilities.findDefs=function(){var g=c.getSVGContent(),q=g.getElementsByTagNameNS(I.SVG,"defs");if(q.length>0)q=q[0];else{q=g.ownerDocument.createElementNS(I.SVG,"defs");g.firstChild?
+g.insertBefore(q,g.firstChild.nextSibling):g.appendChild(q)}return q};svgedit.utilities.getPathBBox=function(g){var q=g.pathSegList,w=q.numberOfItems;g=[[],[]];var D=q.getItem(0),u=[D.x,D.y];for(D=0;D<w;D++){var A=q.getItem(D);if(typeof A.x!=="undefined"){g[0].push(u[0]);g[1].push(u[1]);if(A.x1){var p=[A.x1,A.y1],v=[A.x2,A.y2],t=[A.x,A.y],m;for(m=0;m<2;m++){A=function(fa){return Math.pow(1-fa,3)*u[m]+3*Math.pow(1-fa,2)*fa*p[m]+3*(1-fa)*Math.pow(fa,2)*v[m]+Math.pow(fa,3)*t[m]};var L=6*u[m]-12*p[m]+
+6*v[m],R=-3*u[m]+9*p[m]-9*v[m]+3*t[m],da=3*p[m]-3*u[m];if(R==0){if(L!=0){L=-da/L;0<L&&L<1&&g[m].push(A(L))}}else{da=Math.pow(L,2)-4*da*R;if(!(da<0)){var qa=(-L+Math.sqrt(da))/(2*R);0<qa&&qa<1&&g[m].push(A(qa));L=(-L-Math.sqrt(da))/(2*R);0<L&&L<1&&g[m].push(A(L))}}}u=t}else{g[0].push(A.x);g[1].push(A.y)}}}q=Math.min.apply(null,g[0]);w=Math.max.apply(null,g[0])-q;D=Math.min.apply(null,g[1]);g=Math.max.apply(null,g[1])-D;return{x:q,y:D,width:w,height:g}};svgedit.utilities.getBBox=function(g){var q=g||
+c.geSelectedElements()[0];if(g.nodeType!=1)return null;g=null;var w=q.nodeName;switch(w){case "text":if(q.textContent===""){q.textContent="a";g=q.getBBox();q.textContent=""}else try{g=q.getBBox()}catch(D){}break;case "path":if(svgedit.browser.supportsPathBBox())try{g=q.getBBox()}catch(u){}else g=svgedit.utilities.getPathBBox(q);break;case "g":case "a":g=a(q);break;default:if(w==="use")g=a(q,true);if(w==="use"||w==="foreignObject"&&svgedit.browser.isWebkit()){g||(g=q.getBBox());w={};w.width=g.width;
+w.height=g.height;w.x=g.x+parseFloat(q.getAttribute("x")||0);w.y=g.y+parseFloat(q.getAttribute("y")||0);g=w}else if(~o.indexOf(w))try{g=q.getBBox()}catch(A){q=$(q).closest("foreignObject");if(q.length)try{g=q[0].getBBox()}catch(p){g=null}else g=null}}if(g)g=svgedit.utilities.bboxToObj(g);return g};svgedit.utilities.getRotationAngle=function(g,q){var w=g||c.getSelectedElements()[0];w=svgedit.transformlist.getTransformList(w);if(!w)return 0;var D=w.numberOfItems,u;for(u=0;u<D;++u){var A=w.getItem(u);
+if(A.type==4)return q?A.angle*Math.PI/180:A.angle}return 0};svgedit.utilities.getRefElem=function(g){return svgedit.utilities.getElem(svgedit.utilities.getUrlFromAttr(g).substr(1))};svgedit.utilities.getElem=svgedit.browser.supportsSelectors()?function(g){return e.querySelector("#"+g)}:svgedit.browser.supportsXpath()?function(g){return h.evaluate('svg:svg[@id="svgroot"]//svg:*[@id="'+g+'"]',s,function(){return svgedit.NS.SVG},9,null).singleNodeValue}:function(g){return $(e).find("[id="+g+"]")[0]};
+svgedit.utilities.assignAttributes=function(g,q,w,D){w||(w=0);svgedit.browser.isOpera()||e.suspendRedraw(w);for(var u in q)if(w=u.substr(0,4)==="xml:"?I.XML:u.substr(0,6)==="xlink:"?I.XLINK:null)g.setAttributeNS(w,u,q[u]);else D?svgedit.units.setUnitAttr(g,u,q[u]):g.setAttribute(u,q[u]);svgedit.browser.isOpera()||e.unsuspendRedraw(null)};svgedit.utilities.cleanupElement=function(g){var q=e.suspendRedraw(60),w={"fill-opacity":1,"stop-opacity":1,opacity:1,stroke:"none","stroke-dasharray":"none","stroke-linejoin":"miter",
+"stroke-linecap":"butt","stroke-opacity":1,"stroke-width":1,rx:0,ry:0},D;for(D in w){var u=w[D];g.getAttribute(D)==u&&g.removeAttribute(D)}e.unsuspendRedraw(q)};svgedit.utilities.snapToGrid=function(g){var q=c.getSnappingStep(),w=c.getBaseUnit();if(w!=="px")q*=svgedit.units.getTypeMap()[w];return g=Math.round(g/q)*q};svgedit.utilities.preg_quote=function(g,q){return String(g).replace(RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(q||"")+"-]","g"),"\\$&")}})();(function(){if(!svgedit.sanitize)svgedit.sanitize={};var a=svgedit.NS,I=svgedit.getReverseNS(),o={a:["class","clip-path","clip-rule","fill","fill-opacity","fill-rule","filter","id","mask","opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","style","systemLanguage","target","transform","xlink:href","xlink:title"],circle:["class","clip-path","clip-rule","cx","cy","fill","fill-opacity","fill-rule","filter","id",
 "mask","opacity","r","requiredFeatures","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","style","systemLanguage","transform"],clipPath:["class","clipPathUnits","id"],defs:[],style:["type"],desc:[],ellipse:["class","clip-path","clip-rule","cx","cy","fill","fill-opacity","fill-rule","filter","id","mask","opacity","requiredFeatures","rx","ry","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin",
 "stroke-miterlimit","stroke-opacity","stroke-width","style","systemLanguage","transform"],feGaussianBlur:["class","color-interpolation-filters","id","requiredFeatures","stdDeviation"],filter:["class","color-interpolation-filters","filterRes","filterUnits","height","id","primitiveUnits","requiredFeatures","width","x","xlink:href","y"],foreignObject:["class","font-size","height","id","opacity","requiredFeatures","style","transform","width","x","y"],g:["class","clip-path","clip-rule","id","display",
 "fill","fill-opacity","fill-rule","filter","mask","opacity","requiredFeatures","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","style","systemLanguage","transform","font-family","font-size","font-style","font-weight","text-anchor"],image:["class","clip-path","clip-rule","filter","height","id","mask","opacity","requiredFeatures","style","systemLanguage","transform","width","x","xlink:href","xlink:title","y"],line:["class",