| 1 |
/** |
| 2 |
* Overriding sliderUpdate() function of shortpixel-image-optimiser\res\js\short-pixel.js |
| 3 |
* We need to replace sites url with GCS url |
| 4 |
*/ |
| 5 |
|
| 6 |
// backing up original function |
| 7 |
var _bk_sliderUpdate = sliderUpdate; |
| 8 |
|
| 9 |
// overriding the original function |
| 10 |
sliderUpdate = function sliderUpdate(id, thumb, bkThumb, percent, filename) { |
| 11 |
// replacing sites url with GCS url. |
| 12 |
thumb = thumb.replace( |
| 13 |
_stateless_short_pixel.baseurl, |
| 14 |
_stateless_short_pixel.bucketLink |
| 15 |
); |
| 16 |
// using original function aftr altering thumb url. |
| 17 |
_bk_sliderUpdate(id, thumb, bkThumb, percent, filename); |
| 18 |
}; |