Bug: slimbox fails on images with brackets in the filename

58 views
Skip to first unread message

Robin

unread,
Jan 31, 2012, 10:34:26 PM1/31/12
to Slimbox
Slimbox fails to display images that have brackets in the filename,
eg. "example(2).jpg"
Filenames such as this are quite common, because Windows automatically
adds (number) when duplicate file names are detected during a paste
operation.
Hopefully this bug will be a fairly easy fix.

Gina Jääskeläinen

unread,
Jan 31, 2012, 10:41:18 PM1/31/12
to slimbox...@googlegroups.com
You need to use HTML entities in the slimbox title names where "special" characters are needed:

( left parenthesis
) right parenthesis

Try these out.


--
You received this message because you are subscribed to the Google Groups "Slimbox" group.
To post to this group, send email to slimbox...@googlegroups.com.
To unsubscribe from this group, send email to slimbox-suppo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/slimbox-support?hl=en.




--
Gina Jaaskelainen

p:  02 4782 9169
m: 0450 513 475
a:  2/209 great western hwy katoomba 2780

Robin

unread,
Feb 1, 2012, 5:21:28 PM2/1/12
to Slimbox
I'm talking about the image filenames, not their title attributes.

And if you are saying I could write some code to replace characters in
my page with their HTML entity equivalents - well, yes, I could do
that, but much better to fix the Slimbox code so all users don't have
to solve this bug for themselves.


On Feb 1, 4:41 pm, Gina Jääskeläinen <gina.jaaskelai...@iinet.net.au>
wrote:
> e:  gina.jaaskelai...@iinet.net.au
> t:   gina on twitter <http://twitter.com/#!/ginamtheresa>
> w:  ginamtheresa.wordpress.com

Robin

unread,
Feb 1, 2012, 5:57:52 PM2/1/12
to Slimbox
For those wanting to roll their own fix for this, you need to replace
parenthesis characters in filenames with their URL-encoded equivalents
(not their HTML-entity equivalents). Reference here:
http://www.w3schools.com/tags/ref_urlencode.asp

Here is the code I have used:

$("a[rel^='lightbox']").each(function() {
$(this).attr("href", function(index, old) {
return old.replace("(", "%28").replace(")", "%29");
});
});

Would be nice to see this built into Slimbox though.


On Feb 1, 4:41 pm, Gina Jääskeläinen <gina.jaaskelai...@iinet.net.au>
wrote:
Reply all
Reply to author
Forward
0 new messages