iosscripts / iosslider

iosslider is a jQuery plugin which allows you to integrate a customizable, cross-browser content slider into your web presence. Designed for use as a content slider, website banner, or image gallery.
http://iosscripts.com/iosslider
432 stars 103 forks source link

Javascript error when concat+minified by external minifiers #336

Closed SGudbrandsson closed 10 years ago

SGudbrandsson commented 10 years ago

Hi.

I found a bug in the iosslider minified javascript code, jquery.iosslider.min.js. The bug presents itself when the minified code is being concatenated and minified by external minifiers.

The bug appears twice in the minified version of the code: "- -1_T" turns into "--1_T"

To fix this manually, I replaced the following code: "- -1*T" -> "+T"

Cheers, Siggy

marcwhitbread commented 10 years ago

Where in the code does this issue occur?

SGudbrandsson commented 10 years ago

https://github.com/iosscripts/iosslider/blob/master/_src/jquery.iosslider.min.js

I suspect that this has to do with this code, "-1 -", found on the following lines in https://github.com/iosscripts/iosslider/blob/master/_src/jquery.iosslider.js: 194 289 1539 1656 2229

marcwhitbread commented 10 years ago

Which minifier causes these issues? Closure does not produce these problems.

SGudbrandsson commented 10 years ago

JSMin (which is the default minifier in W3 Total Cache for WordPress). You can test it here: http://fmarcia.info/jsmin/test.html

marcwhitbread commented 10 years ago

Good to know. I will run some tests against this minifier as well and see if I can iron out the issues.

SGudbrandsson commented 10 years ago

Awesome, thanks :+1: