Update gradients.js

Bug: hook did not work on multiple gradients. 
Why: "".replace(str, ) only replaces first occurence
Fix: Use regex as an argument to "".replace

This fixed multiple gradients for me.
Merge pull request #40 from atotic/patch-1

Update gradients.js