PageSourceSearch

https://www.staffsolve.com/wp-content/themes/the-simple/js/pathformer.js?ver=1

js staffsolve.com collected 2026-10-06 19:15:23 UTC 2,699 bytes, 1 lines download raw bytes

1"use strict";function Pathformer(a){if("undefined"==typeof a)throw new Error('Pathformer [constructor]: "element" parameter is required');if(a.constructor===String&&(a=document.getElementById(a),!a))throw new Error('Pathformer [constructor]: "element" parameter is not related to an existing ID');if(!(a.constructor instanceof window.SVGElement||/^svg$/i.test(a.nodeName)))throw new Error('Pathformer [constructor]: "element" parameter must be a string or a SVGelement');this.el=a,this.scan(a)}Pathformer.prototype.TYPES=["line","ellipse","circle","polygon","polyline","rect"],Pathformer.prototype.ATTR_WATCH=["cx","cy","points","r","rx","ry","x","x1","x2","y","y1","y2"],Pathformer.prototype.scan=function(a){for(var b,c,d,e,f=a.querySelectorAll(this.TYPES.join(",")),g=0;g<f.length;g++)c=f[g],b=this[c.tagName.toLowerCase()+"ToPath"],d=b(this.parseAttr(c.attributes)),e=this.pathMaker(c,d),c.parentNode.replaceChild(e,c)},Pathformer.prototype.lineToPath=function(a){var b={};return b.d="M"+a.x1+","+a.y1+"L"+a.x2+","+a.y2,b},Pathformer.prototype.rectToPath=function(a){var b={},c=parseFloat(a.x)||0,d=parseFloat(a.y)||0,e=parseFloat(a.width)||0,f=parseFloat(a.height)||0;return b.d="M"+c+" "+d+" ",b.d+="L"+(c+e)+" "+d+" ",b.d+="L"+(c+e)+" "+(d+f)+" ",b.d+="L"+c+" "+(d+f)+" Z",b},Pathformer.prototype.polylineToPath=function(a){var b,c,d={},e=a.points.trim().split(" ");if(a.points.indexOf(",")===-1){var f=[];for(b=0;b<e.length;b+=2)f.push(e[b]+","+e[b+1]);e=f}for(c="M"+e[0],b=1;b<e.length;b++)e[b].indexOf(",")!==-1&&(c+="L"+e[b]);return d.d=c,d},Pathformer.prototype.polygonToPath=function(a){var b=Pathformer.prototype.polylineToPath(a);return b.d+="Z",b},Pathformer.prototype.ellipseToPath=function(a){var b=a.cx-a.rx,c=a.cy,d=parseFloat(a.cx)+parseFloat(a.rx),e=a.cy,f={};return f.d="M"+b+","+c+"A"+a.rx+","+a.ry+" 0,1,1 "+d+","+e+"A"+a.rx+","+a.ry+" 0,1,1 "+b+","+e,f},Pathformer.prototype.circleToPath=function(a){var b={},c=a.cx-a.r,d=a.cy,e=parseFloat(a.cx)+parseFloat(a.r),f=a.cy;return b.d="M"+c+","+d+"A"+a.r+","+a.r+" 0,1,1 "+e+","+f+"A"+a.r+","+a.r+" 0,1,1 "+c+","+f,b},Pathformer.prototype.pathMaker=function(a,b){var c,d,e=document.createElementNS("http://www.w3.org/2000/svg","path");for(c=0;c<a.attributes.length;c++)d=a.attributes[c],this.ATTR_WATCH.indexOf(d.name)===-1&&e.setAttribute(d.name,d.value);for(c in b)e.setAttribute(c,b[c]);return e},Pathformer.prototype.parseAttr=function(a){for(var b,c={},d=0;d<a.length;d++){if(b=a[d],this.ATTR_WATCH.indexOf(b.name)!==-1&&b.value.indexOf("%")!==-1)throw new Error("Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into 'path' tags. Please use 'viewBox'.");c[b.name]=b.value}return c};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.