Archived Comments (locked)

in
Subscribe to Archived Comments 6 posts, 4 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
kyle1 User

Really great script! I really can't believe Flickr hasn't integrated this feature themselves... I made a couple of little tweaks that maybe you or someone else will find useful.

Changed the XPath line to this so that the prev/next links come use the current "context" (photostream, set, pool, etc.):

var links = document.evaluate("//a[@class='currentContextLink']/ancestor::div[starts-with(@class,'ContextTop')]//a[@class='contextThumbLink']/@href", document, null, XPathResult.ANY_TYPE, null);

Added a check in case it is the first or last picture in a group (forward and back point to the same place):
// the second link is the next image URL
var nextURL = links.iterateNext().value;

// if there are only two links, then the second one was actually the link to the photostream
if (links.iterateNext() == null) 
	nextURL = previousURL;

and added key.preventDefault() to prevent j and k from activating Firefox's "search as you type" deal:
// go previous
if(unicode == left || unicode == j || unicode == d)
{
	key.preventDefault();
	this.location.href = previousURL;
}
// go next
if(unicode == right || unicode == k || unicode == f)
{
	key.preventDefault();
	this.location.href = nextURL;		
}

Thanks! :)

 
Ben McMath Script's Author

Was able to fix it for FF2 and FF3. Thanks for the feedback and if anyone else finds any issues, feel free to leave a comment.

 
Ben McMath Script's Author

Built and tested on FF 3.0.3 I'll see about updating for FF2

 
Neewb Scriptwright

Can't this one to work on FF 2.0.0.17... I am running 8 other Flickr scripts though; one or more of them might be interfering with your script. But I turned off the other 7 scripts with only yours active and it still doesn't seem to work?

 
Ben McMath Script's Author

There are several sites that allow keyboard navigation through images. FFFFound, Facebook, The Big Picture. I was surprised that flickr doesn't allow this and even more that no one had written a script to add this functionality. I set out to write one. Right now it only will flip through the photostream, but hope to add other functionality later.
J or Right arrow keys will advance to the next photo, K and Left arrow key will advance to the previous image.
Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel