cbeyls / slimbox

The ultimate lightweight Lightbox clone
http://www.digitalia.be/software/slimbox2
50 stars 24 forks source link

Images with spaces in the name break Slimbox2 #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In Firefox, the following code will cause Slimbox 2.03 to display no image:

var pics = [["galleries/1/Summer field.jpg"]];  
jQuery.slimbox(pics, 0);

It will just show an empty box.  

The fix is add quotes in line 187 of slimbox2.js as follows:

$(image).css({backgroundImage: "url('" + activeURL + "')", visibility:
"hidden", display: ""});

Original issue reported on code.google.com by elmo...@gmail.com on 28 Mar 2010 at 3:09

GoogleCodeExporter commented 9 years ago
The right fix is: fix the URL. Spaces must be replaced by %20 or _.
The javascript can fix your URLs automatically by calling escape() or encodeURI 
in the 
autoload code block.

Original comment by christophe.beyls@gmail.com on 20 Apr 2010 at 2:10

GoogleCodeExporter commented 9 years ago
@christophe.beyls I am very interested in implementing your code fix. Where is 
the autoload code block you mention?

Also, a note to the Slimbox developers: This issue was identified over a year 
ago. Why has it not been included in the core? I realize the "easy fix" is to 
not upload images with spaces, but I am using this for WordPress clients with 
limited skills or can't be bothered going through all their photos to change 
them ahead of time.

Original comment by zoinksgr...@gmail.com on 25 Aug 2011 at 3:05