Socket
Socket
Sign inDemoInstall

signature_pad

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

signature_pad - npm Package Compare versions

Comparing version 1.6.0-beta.6 to 1.6.0-beta.7

13

dist/signature_pad.js
/*!
* Signature Pad v1.6.0-beta.6
* Signature Pad v1.6.0-beta.7
* https://github.com/szimek/signature_pad

@@ -490,2 +490,13 @@ *

var body = svg.innerHTML;
// IE hack for missing innerHTML property on SVG elements
if (body === undefined) {
var paths = svg.childNodes;
var serializer = new XMLSerializer();
body = '';
for (var i = 0; i < paths.length; i += 1) {
body += serializer.serializeToString(paths[i]);
}
}
var footer = '</svg>';

@@ -492,0 +503,0 @@ var data = header + body + footer;

2

dist/signature_pad.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.SignaturePad=e()}(this,function(){"use strict";function t(t,e,i){this.x=t,this.y=e,this.time=i||(new Date).getTime()}function e(t,e,i,o){this.startPoint=t,this.control1=e,this.control2=i,this.endPoint=o}function i(t,e){var i=this,o=e||{};this.velocityFilterWeight=o.velocityFilterWeight||.7,this.minWidth=o.minWidth||.5,this.maxWidth=o.maxWidth||2.5,this.dotSize=o.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=o.penColor||"black",this.backgroundColor=o.backgroundColor||"rgba(0,0,0,0)",this.onBegin=o.onBegin,this.onEnd=o.onEnd,this._canvas=t,this._ctx=t.getContext("2d"),this.clear(),this._handleMouseDown=function(t){1===t.which&&(i._mouseButtonDown=!0,i._strokeBegin(t))},this._handleMouseMove=function(t){i._mouseButtonDown&&i._strokeUpdate(t)},this._handleMouseUp=function(t){1===t.which&&i._mouseButtonDown&&(i._mouseButtonDown=!1,i._strokeEnd(t))},this._handleTouchStart=function(t){if(1===t.targetTouches.length){var e=t.changedTouches[0];i._strokeBegin(e)}},this._handleTouchMove=function(t){t.preventDefault();var e=t.targetTouches[0];i._strokeUpdate(e)},this._handleTouchEnd=function(t){var e=t.target===i._canvas;e&&(t.preventDefault(),i._strokeEnd(t))},this.on()}return t.prototype.velocityFrom=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):1},t.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},e.prototype.length=function(){for(var t=10,e=0,i=void 0,o=void 0,n=0;n<=t;n+=1){var s=n/t,r=this._point(s,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),h=this._point(s,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(n>0){var a=r-i,c=h-o;e+=Math.sqrt(a*a+c*c)}i=r,o=h}return e},e.prototype._point=function(t,e,i,o,n){return e*(1-t)*(1-t)*(1-t)+3*i*(1-t)*(1-t)*t+3*o*(1-t)*t*t+n*t*t*t},i.prototype.clear=function(){var t=this._ctx,e=this._canvas;t.fillStyle=this.backgroundColor,t.clearRect(0,0,e.width,e.height),t.fillRect(0,0,e.width,e.height),this._data=[],this._reset(),this._isEmpty=!0},i.prototype.fromDataURL=function(t){var e=this,i=new Image,o=window.devicePixelRatio||1,n=this._canvas.width/o,s=this._canvas.height/o;this._reset(),i.src=t,i.onload=function(){e._ctx.drawImage(i,0,0,n,s)},this._isEmpty=!1},i.prototype.toDataURL=function(t){var e;switch(t){case"image/svg+xml":return this._toSVG();default:for(var i=arguments.length,o=Array(i>1?i-1:0),n=1;n<i;n++)o[n-1]=arguments[n];return(e=this._canvas).toDataURL.apply(e,[t].concat(o))}},i.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()},i.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)},i.prototype.isEmpty=function(){return this._isEmpty},i.prototype._strokeBegin=function(t){this._data.push([]),this._reset(),this._strokeUpdate(t),"function"==typeof this.onBegin&&this.onBegin(t)},i.prototype._strokeUpdate=function(t){var e=t.clientX,i=t.clientY,o=this._createPoint(e,i),n=this._addPoint(o),s=n.curve,r=n.widths;s&&r&&this._drawCurve(s,r.start,r.end),this._data[this._data.length-1].push({x:o.x,y:o.y,time:o.time})},i.prototype._strokeEnd=function(t){var e=this.points.length>2,i=this.points[0];!e&&i&&this._drawDot(i),"function"==typeof this.onEnd&&this.onEnd(t)},i.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)},i.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)},i.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor},i.prototype._createPoint=function(e,i,o){var n=this._canvas.getBoundingClientRect();return new t(e-n.left,i-n.top,o||(new Date).getTime())},i.prototype._addPoint=function(t){var i=this.points,o=void 0;if(i.push(t),i.length>2){3===i.length&&i.unshift(i[0]),o=this._calculateCurveControlPoints(i[0],i[1],i[2]);var n=o.c2;o=this._calculateCurveControlPoints(i[1],i[2],i[3]);var s=o.c1,r=new e(i[1],n,s,i[2]),h=this._calculateCurveWidths(r);return i.shift(),{curve:r,widths:h}}return{}},i.prototype._calculateCurveControlPoints=function(e,i,o){var n=e.x-i.x,s=e.y-i.y,r=i.x-o.x,h=i.y-o.y,a={x:(e.x+i.x)/2,y:(e.y+i.y)/2},c={x:(i.x+o.x)/2,y:(i.y+o.y)/2},u=Math.sqrt(n*n+s*s),d=Math.sqrt(r*r+h*h),l=a.x-c.x,v=a.y-c.y,_=d/(u+d),p={x:c.x+l*_,y:c.y+v*_},y=i.x-p.x,f=i.y-p.y;return{c1:new t(a.x+y,a.y+f),c2:new t(c.x+y,c.y+f)}},i.prototype._calculateCurveWidths=function(t){var e=t.startPoint,i=t.endPoint,o={start:null,end:null},n=this.velocityFilterWeight*i.velocityFrom(e)+(1-this.velocityFilterWeight)*this._lastVelocity,s=this._strokeWidth(n);return o.start=this._lastWidth,o.end=s,this._lastVelocity=n,this._lastWidth=s,o},i.prototype._strokeWidth=function(t){return Math.max(this.maxWidth/(t+1),this.minWidth)},i.prototype._drawPoint=function(t,e,i){var o=this._ctx;o.moveTo(t,e),o.arc(t,e,i,0,2*Math.PI,!1),this._isEmpty=!1},i.prototype._drawCurve=function(t,e,i){var o=this._ctx,n=i-e,s=Math.floor(t.length());o.beginPath();for(var r=0;r<s;r+=1){var h=r/s,a=h*h,c=a*h,u=1-h,d=u*u,l=d*u,v=l*t.startPoint.x;v+=3*d*h*t.control1.x,v+=3*u*a*t.control2.x,v+=c*t.endPoint.x;var _=l*t.startPoint.y;_+=3*d*h*t.control1.y,_+=3*u*a*t.control2.y,_+=c*t.endPoint.y;var p=e+c*n;this._drawPoint(v,_,p)}o.closePath(),o.fill()},i.prototype._drawDot=function(t){var e=this._ctx,i="function"==typeof this.dotSize?this.dotSize():this.dotSize;e.beginPath(),this._drawPoint(t.x,t.y,i),e.closePath(),e.fill()},i.prototype._fromData=function(e,i,o){for(var n=0;n<e.length;n+=1){var s=e[n];if(s.length>1)for(var r=0;r<s.length;r+=1){var h=s[r],a=new t(h.x,h.y,h.time);if(0===r)this._reset(),this._addPoint(a);else if(r!==s.length-1){var c=this._addPoint(a),u=c.curve,d=c.widths;u&&d&&i(u,d)}}else{this._reset();var l=s[0];o(l)}}},i.prototype._toSVG=function(){var t=this,e=this._data,i=this._canvas,o=0,n=0,s=i.width,r=i.height,h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttributeNS(null,"width",i.width),h.setAttributeNS(null,"height",i.height),this._fromData(e,function(e,i){var o=document.createElementNS("http;//www.w3.org/2000/svg","path");if(!(isNaN(e.control1.x)||isNaN(e.control1.y)||isNaN(e.control2.x)||isNaN(e.control2.y))){var n="M "+e.startPoint.x.toFixed(3)+","+e.startPoint.y.toFixed(3)+" "+("C "+e.control1.x.toFixed(3)+","+e.control1.y.toFixed(3)+" ")+(e.control2.x.toFixed(3)+","+e.control2.y.toFixed(3)+" ")+(e.endPoint.x.toFixed(3)+","+e.endPoint.y.toFixed(3));o.setAttribute("d",n),o.setAttributeNS(null,"stroke-width",(2.25*i.end).toFixed(3)),o.setAttributeNS(null,"stroke",t.penColor),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"stroke-linecap","round"),h.appendChild(o)}},function(e){var i=document.createElementNS("http://www.w3.org/2000/svg","circle"),o="function"==typeof t.dotSize?t.dotSize():t.dotSize;i.setAttributeNS(null,"r",o),i.setAttributeNS(null,"cx",e.x),i.setAttributeNS(null,"cy",e.y),i.setAttributeNS(null,"fill",t.penColor),h.appendChild(i)});var a="data:image/svg+xml;base64,",c='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="'+o+" "+n+" "+s+" "+r+'">',u=h.innerHTML,d="</svg>",l=c+u+d;return a+btoa(l)},i.prototype.fromData=function(t){var e=this;this.clear(),this._fromData(t,function(t,i){return e._drawCurve(t,i.start,i.end)},function(t){return e._drawDot(t)})},i.prototype.toData=function(){return this._data},i});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.SignaturePad=e()}(this,function(){"use strict";function t(t,e,i){this.x=t,this.y=e,this.time=i||(new Date).getTime()}function e(t,e,i,o){this.startPoint=t,this.control1=e,this.control2=i,this.endPoint=o}function i(t,e){var i=this,o=e||{};this.velocityFilterWeight=o.velocityFilterWeight||.7,this.minWidth=o.minWidth||.5,this.maxWidth=o.maxWidth||2.5,this.dotSize=o.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=o.penColor||"black",this.backgroundColor=o.backgroundColor||"rgba(0,0,0,0)",this.onBegin=o.onBegin,this.onEnd=o.onEnd,this._canvas=t,this._ctx=t.getContext("2d"),this.clear(),this._handleMouseDown=function(t){1===t.which&&(i._mouseButtonDown=!0,i._strokeBegin(t))},this._handleMouseMove=function(t){i._mouseButtonDown&&i._strokeUpdate(t)},this._handleMouseUp=function(t){1===t.which&&i._mouseButtonDown&&(i._mouseButtonDown=!1,i._strokeEnd(t))},this._handleTouchStart=function(t){if(1===t.targetTouches.length){var e=t.changedTouches[0];i._strokeBegin(e)}},this._handleTouchMove=function(t){t.preventDefault();var e=t.targetTouches[0];i._strokeUpdate(e)},this._handleTouchEnd=function(t){var e=t.target===i._canvas;e&&(t.preventDefault(),i._strokeEnd(t))},this.on()}return t.prototype.velocityFrom=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):1},t.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},e.prototype.length=function(){for(var t=10,e=0,i=void 0,o=void 0,n=0;n<=t;n+=1){var s=n/t,r=this._point(s,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),h=this._point(s,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(n>0){var a=r-i,c=h-o;e+=Math.sqrt(a*a+c*c)}i=r,o=h}return e},e.prototype._point=function(t,e,i,o,n){return e*(1-t)*(1-t)*(1-t)+3*i*(1-t)*(1-t)*t+3*o*(1-t)*t*t+n*t*t*t},i.prototype.clear=function(){var t=this._ctx,e=this._canvas;t.fillStyle=this.backgroundColor,t.clearRect(0,0,e.width,e.height),t.fillRect(0,0,e.width,e.height),this._data=[],this._reset(),this._isEmpty=!0},i.prototype.fromDataURL=function(t){var e=this,i=new Image,o=window.devicePixelRatio||1,n=this._canvas.width/o,s=this._canvas.height/o;this._reset(),i.src=t,i.onload=function(){e._ctx.drawImage(i,0,0,n,s)},this._isEmpty=!1},i.prototype.toDataURL=function(t){var e;switch(t){case"image/svg+xml":return this._toSVG();default:for(var i=arguments.length,o=Array(i>1?i-1:0),n=1;n<i;n++)o[n-1]=arguments[n];return(e=this._canvas).toDataURL.apply(e,[t].concat(o))}},i.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()},i.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)},i.prototype.isEmpty=function(){return this._isEmpty},i.prototype._strokeBegin=function(t){this._data.push([]),this._reset(),this._strokeUpdate(t),"function"==typeof this.onBegin&&this.onBegin(t)},i.prototype._strokeUpdate=function(t){var e=t.clientX,i=t.clientY,o=this._createPoint(e,i),n=this._addPoint(o),s=n.curve,r=n.widths;s&&r&&this._drawCurve(s,r.start,r.end),this._data[this._data.length-1].push({x:o.x,y:o.y,time:o.time})},i.prototype._strokeEnd=function(t){var e=this.points.length>2,i=this.points[0];!e&&i&&this._drawDot(i),"function"==typeof this.onEnd&&this.onEnd(t)},i.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)},i.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)},i.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor},i.prototype._createPoint=function(e,i,o){var n=this._canvas.getBoundingClientRect();return new t(e-n.left,i-n.top,o||(new Date).getTime())},i.prototype._addPoint=function(t){var i=this.points,o=void 0;if(i.push(t),i.length>2){3===i.length&&i.unshift(i[0]),o=this._calculateCurveControlPoints(i[0],i[1],i[2]);var n=o.c2;o=this._calculateCurveControlPoints(i[1],i[2],i[3]);var s=o.c1,r=new e(i[1],n,s,i[2]),h=this._calculateCurveWidths(r);return i.shift(),{curve:r,widths:h}}return{}},i.prototype._calculateCurveControlPoints=function(e,i,o){var n=e.x-i.x,s=e.y-i.y,r=i.x-o.x,h=i.y-o.y,a={x:(e.x+i.x)/2,y:(e.y+i.y)/2},c={x:(i.x+o.x)/2,y:(i.y+o.y)/2},u=Math.sqrt(n*n+s*s),l=Math.sqrt(r*r+h*h),d=a.x-c.x,v=a.y-c.y,_=l/(u+l),p={x:c.x+d*_,y:c.y+v*_},f=i.x-p.x,y=i.y-p.y;return{c1:new t(a.x+f,a.y+y),c2:new t(c.x+f,c.y+y)}},i.prototype._calculateCurveWidths=function(t){var e=t.startPoint,i=t.endPoint,o={start:null,end:null},n=this.velocityFilterWeight*i.velocityFrom(e)+(1-this.velocityFilterWeight)*this._lastVelocity,s=this._strokeWidth(n);return o.start=this._lastWidth,o.end=s,this._lastVelocity=n,this._lastWidth=s,o},i.prototype._strokeWidth=function(t){return Math.max(this.maxWidth/(t+1),this.minWidth)},i.prototype._drawPoint=function(t,e,i){var o=this._ctx;o.moveTo(t,e),o.arc(t,e,i,0,2*Math.PI,!1),this._isEmpty=!1},i.prototype._drawCurve=function(t,e,i){var o=this._ctx,n=i-e,s=Math.floor(t.length());o.beginPath();for(var r=0;r<s;r+=1){var h=r/s,a=h*h,c=a*h,u=1-h,l=u*u,d=l*u,v=d*t.startPoint.x;v+=3*l*h*t.control1.x,v+=3*u*a*t.control2.x,v+=c*t.endPoint.x;var _=d*t.startPoint.y;_+=3*l*h*t.control1.y,_+=3*u*a*t.control2.y,_+=c*t.endPoint.y;var p=e+c*n;this._drawPoint(v,_,p)}o.closePath(),o.fill()},i.prototype._drawDot=function(t){var e=this._ctx,i="function"==typeof this.dotSize?this.dotSize():this.dotSize;e.beginPath(),this._drawPoint(t.x,t.y,i),e.closePath(),e.fill()},i.prototype._fromData=function(e,i,o){for(var n=0;n<e.length;n+=1){var s=e[n];if(s.length>1)for(var r=0;r<s.length;r+=1){var h=s[r],a=new t(h.x,h.y,h.time);if(0===r)this._reset(),this._addPoint(a);else if(r!==s.length-1){var c=this._addPoint(a),u=c.curve,l=c.widths;u&&l&&i(u,l)}}else{this._reset();var d=s[0];o(d)}}},i.prototype._toSVG=function(){var t=this,e=this._data,i=this._canvas,o=0,n=0,s=i.width,r=i.height,h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttributeNS(null,"width",i.width),h.setAttributeNS(null,"height",i.height),this._fromData(e,function(e,i){var o=document.createElementNS("http;//www.w3.org/2000/svg","path");if(!(isNaN(e.control1.x)||isNaN(e.control1.y)||isNaN(e.control2.x)||isNaN(e.control2.y))){var n="M "+e.startPoint.x.toFixed(3)+","+e.startPoint.y.toFixed(3)+" "+("C "+e.control1.x.toFixed(3)+","+e.control1.y.toFixed(3)+" ")+(e.control2.x.toFixed(3)+","+e.control2.y.toFixed(3)+" ")+(e.endPoint.x.toFixed(3)+","+e.endPoint.y.toFixed(3));o.setAttribute("d",n),o.setAttributeNS(null,"stroke-width",(2.25*i.end).toFixed(3)),o.setAttributeNS(null,"stroke",t.penColor),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"stroke-linecap","round"),h.appendChild(o)}},function(e){var i=document.createElementNS("http://www.w3.org/2000/svg","circle"),o="function"==typeof t.dotSize?t.dotSize():t.dotSize;i.setAttributeNS(null,"r",o),i.setAttributeNS(null,"cx",e.x),i.setAttributeNS(null,"cy",e.y),i.setAttributeNS(null,"fill",t.penColor),h.appendChild(i)});var a="data:image/svg+xml;base64,",c='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="'+o+" "+n+" "+s+" "+r+'">',u=h.innerHTML;if(void 0===u){var l=h.childNodes,d=new XMLSerializer;u="";for(var v=0;v<l.length;v+=1)u+=d.serializeToString(l[v])}var _="</svg>",p=c+u+_;return a+btoa(p)},i.prototype.fromData=function(t){var e=this;this.clear(),this._fromData(t,function(t,i){return e._drawCurve(t,i.start,i.end)},function(t){return e._drawDot(t)})},i.prototype.toData=function(){return this._data},i});
/*!
* Signature Pad v1.6.0-beta.6
* Signature Pad v1.6.0-beta.7
* https://github.com/szimek/signature_pad

@@ -490,2 +490,13 @@ *

var body = svg.innerHTML;
// IE hack for missing innerHTML property on SVG elements
if (body === undefined) {
var paths = svg.childNodes;
var serializer = new XMLSerializer();
body = '';
for (var i = 0; i < paths.length; i += 1) {
body += serializer.serializeToString(paths[i]);
}
}
var footer = '</svg>';

@@ -492,0 +503,0 @@ var data = header + body + footer;

{
"name": "signature_pad",
"description": "Library for drawing smooth signatures.",
"version": "1.6.0-beta.6",
"version": "1.6.0-beta.7",
"homepage": "https://github.com/szimek/signature_pad",

@@ -6,0 +6,0 @@ "author": {

@@ -13,8 +13,17 @@ Signature Pad [![Code Climate](https://d25lcipzij17d.cloudfront.net/badge.svg?id=js&type=6&v=1.5.3&x2=0)](https://www.npmjs.com/package/signature_pad) [![Code Climate](https://codeclimate.com/github/szimek/signature_pad.png)](https://codeclimate.com/github/szimek/signature_pad)

## Installation
You can install the latest release using [Bower](http://bower.io/) - `bower install signature_pad`.
You can install the latest release using npm:
```bash
npm install --save signature_pad
```
or Yarn:
```bash
yarn add signature_pad
```
You can also download the latest release from GitHub [releases page](https://github.com/szimek/signature_pad/releases) or go to the latest release tag (e.g. [v1.5.2](https://github.com/szimek/signature_pad/tree/v1.5.2)) and download `signature_pad.js` or `signature_pad.min.js` files directly.
You can also add it directly to your page using `<script>` tag:
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/signature_pad/1.5.3/signature_pad.min.js"></script>
```
You can select a different version at [https://cdnjs.com/libraries/signature_pad](https://cdnjs.com/libraries/signature_pad).
The master branch can contain undocumented or backward compatibility breaking changes.
## Usage

@@ -21,0 +30,0 @@ ### API

@@ -418,3 +418,14 @@ import Point from './point';

const header = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${minX} ${minY} ${maxX} ${maxY}">`;
const body = svg.innerHTML;
let body = svg.innerHTML;
// IE hack for missing innerHTML property on SVG elements
if (body === undefined) {
const paths = svg.childNodes;
const serializer = new XMLSerializer();
body = '';
for (let i = 0; i < paths.length; i += 1) {
body += serializer.serializeToString(paths[i]);
}
}
const footer = '</svg>';

@@ -421,0 +432,0 @@ const data = header + body + footer;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc