# wp-stateless/2.3.2/lib/classes/compatibility/js/shortpixel.js

WP-Stateless – Google Cloud Storage, version 2.3.2. 18 lines.

- Page: https://pluginprobe.com/plugins/wp-stateless/2.3.2/code/lib/classes/compatibility/js/shortpixel.js
- Raw: https://pluginprobe.com/plugins/wp-stateless/2.3.2/raw/lib/classes/compatibility/js/shortpixel.js
- Modified: 2019-12-26T05:14:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-stateless/2.3.2/code/lib/classes/compatibility/js/shortpixel.js#L10-L20`.

```javascript
/**
 * Overriding sliderUpdate() function of shortpixel-image-optimiser\res\js\short-pixel.js
 * We need to replace sites url with GCS url 
 */

// backing up original function
var _bk_sliderUpdate = sliderUpdate;

// overriding the original function
sliderUpdate = function sliderUpdate(id, thumb, bkThumb, percent, filename) {
  // replacing sites url with GCS url.
  thumb = thumb.replace(
    _stateless_short_pixel.baseurl,
    _stateless_short_pixel.bucketLink
  );
  // using original function aftr altering thumb url.
  _bk_sliderUpdate(id, thumb, bkThumb, percent, filename);
};
```
