Jump to content
Sign in to follow this  
Followers 2
paleolith

lightbox calls filtered out?

Recommended Posts

Recently I set up a cache I adopted (GC8413) to use lightbox calls in the description. For the HTML-initiated, lightbox is the JavaScript which gc.com uses to display photos in logs on the main cache page, with the overlay presentation and the ability to go from one photo to the next without reloading the page. This worked really nicely. I had a thumbnail for each photo, and if you clicked on the thumbnail it brought up the large photo in lightbox, and you could cycle through all the photos linked from the cache description. If you clicked on one of the spoiler text links, you could cycle through the spoiler photos in lightbox. Cool.

 

Tonight I decided to use the technique in another cache, and discovered that it has stopped working -- including it no longer works in the unmodified cache description where it was working before. It didn't take long to figure out the reason: gc.com is filtering out the rel and title attributes from links (the <a> tag) when it displays the links. I can see that the attributes are still there, because when I edit the listing, they are in the text. But they aren't displayed.

 

The description still works, but the thumbnails and links just link to pages with the image rather than bringing up the lightbox display.

 

I'm guessing that some link attributes permit abuse, and so a filter was put in place, and that for safety it allows a specific list rather than prohibiting a specific list. I don't know of any way that the rel and title attributes can be abused, so I'm hoping that maybe this is just something that didn't come up (since AFAIK I'm the only one using this technique) and that maybe it can be allowed again.

 

Edward

 

Edit: for example, the HTML submitted for the first image on the page is

 

<a href="http://img.geocaching.com/cache/a7ba7658-c26d-4cb7-bbe0-4d6740e34b6f.jpg" rel="lightbox[batmansbatcave]" title="Entrance to the Bat Cave"><img src="http://img.geocaching.com/cache/38210d94-8e41-49c8-a0e8-a0b4e88c6336.jpg" align="left"></a>

 

This is returned on the edit listing box, but the rel and title attributes are missing from the actual page display. The first gc.com-hosted image is a full size picture, and the second is a thumbnail.

Edited by paleolith

Share this post


Link to post

Javascript is not allowed in cache descriptions.

Share this post


Link to post
Javascript is not allowed in cache descriptions.

I don't have any JavaScript in the cache description.

 

Yes, the rel="lightbox" invokes JS, but it's JS that gc.com includes as part of every cache page. Not my JS, thus no ability to do anything that the gc.com-included JS doesn't already do. I have no way to alter the lightbox JS code used in the cache page. I also don't see any way to abuse lightbox that isn't already present in photos posted with logs. (As discussed in one or two other threads -- search on "lightbox" -- extremely large-dimension photos can be much larger than the browser window, and users who don't know the keyboard shortcuts can find it difficult to close the image. lightbox could be coded to eliminate this problem, but it's a minor one.)

 

This makes the "no JS in description" a rather ambiguous restriction.

 

Does it mean I am not allowed to write any JS? This makes total sense and is the way I've always taken it. Allowing users to code JS in descriptions would be insane. Just log in to myspace ...

 

Does it mean my HTML mustn't interact in any way with JS on the page? I can't assure that as long as gc.com uses JS on the page, so this can't be the meaning.

 

So the question is whether it means I mustn't intentionally invoke a feature which is already used extensively on cache pages. If TPTB decide this is the meaning, then of course I'll have to live with it. I'll be sad, though, because it will kill a way of making better-looking cache descriptions which is AFAIK totally safe.

 

Edward

Share this post


Link to post

GS has posted in other threads that they will fix the broken link and image attributes. (check the April 16th release notes thread) I believe they specifically mentioned fixing title and align.

 

Allowing rel would probably be fine too, but you'd probably have to get GS to whitelist it along with the other attribtues.

 

As paleolith mentioned, this isn't really javascript code - this is lightbox (which is javascript already on the page) interpreting an attribute (data, not code) on your link. It's actually a pretty slick idea to use in cache descriptions. I've often wanted the ability to lightbox between the image links on a description (as sometimes they don't appear in the 'Gallery')

Share this post


Link to post

Thanks, Ben. I've posted to that thread, which I should have known to look for and perhaps would have if I hadn't been too tired to be posting. :blink:

 

Edward

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 2

×
×
  • Create New...