Kris-B / nanoSLIDER4GS

nanoSLIDER plugin for GetSimple CMS
5 stars 1 forks source link

Spaces in captions #9

Open FasterThanMyShadow opened 10 years ago

FasterThanMyShadow commented 10 years ago

Hi Kris,

You mention that spaces in captions should be replaced with underscores. However, there seems to be a bug in nanoslider.js, line 43. You use replace('',' '), but that only replaces the first underscore in the string. You need to replace this with replace(//g,' ') to replace all underscores with a space.

I am using version 1.2.0.

Cheers.

Joes

lulis commented 10 years ago

See the problem here too. You can replace replace("_"," ") by split("_").join(" ") as its normally faster, as sugested in http://stackoverflow.com/a/1145525

FasterThanMyShadow commented 10 years ago

OK, thanks for letting me know.

Joes

On 12 Mar 2014, at 15:19, lulis notifications@github.com wrote:

See the problem here too. You can replace replace(""," ") by split("").join(" ") as its normally faster, as sugested in http://stackoverflow.com/a/1145525

— Reply to this email directly or view it on GitHub.

MarcoVezzani commented 10 years ago

I too also had this issue, I fixed it by amending the code like this: captions=params.listCaptions.replace(new RegExp("_", "g"),' ').split('|');