brinley / jSignature

jQuery plugin for adding web signature functionality
http://www.unbolt.net/jSignature
694 stars 529 forks source link

Force simplify function to be stored always in windows object #141

Closed osharper closed 7 years ago

osharper commented 7 years ago

jSignature uses simplify lib to process signature input and make svg, however it is implemented by directly including minified version in their code.

It works fine in there world where there no npm and modular systems, but guys who made simplify live in a bit more modern world and have this code for compliancy with modular systems https://github.com/mourner/simplify-js/blob/master/simplify.js#L116

So, when we use jSignature in within some module system, it stores simplify function in module object rather than in window, but jSignature expects it to be in window https://github.com/brinley/jSignature/blob/master/src/plugins/jSignature.CompressorSVG.js#L330

brinley commented 7 years ago

Did you minify the latest simplifyjs and update into CompressorSVG or did you just add those module/window change to the respective minified code?

osharper commented 7 years ago

the second one. If I make the first thing, it would run in the same error obviously, simplify-js still contains code for modular env cases, so I have to edit simplify-js, minify it and then embed to jSignature code again. But it's very simple to recognize what one should change in minified code in this case, so I just edited it

brinley commented 7 years ago

I've reminified the minified files through the proper process in https://github.com/brinley/jSignature/tree/osharper-master. Can you sanity check and we can merge?

osharper commented 7 years ago

yep, I think everything is perfect. thanks for a quick feedback. Why don't you merge npm-ified fork by a @technical-team as well? https://github.com/brinley/jSignature/compare/master...technical-team:master

brinley commented 7 years ago

@osharper Will you beable to help review and test if I pulled that npm-ified fork?