Facebook photo album keyboard navigation

Last update on Nov 18, 2007

Makes facebook photo albums keyboard navigable: n/p for next and previous pages, c for jumping to the comment box and t for showing/hiding the tagging box. (Conflicts with "Find As You Type" in Firefox)

New version 2007-11-18:
Now with Swedish localization. Edit script source (Manage user scripts... > Edit) and change variable swedish to true.

Ja, bakåt / nästa är fel men b- och n-tangenterna sitter så fint ihop.




You could comment on this script if you were logged in.

9 comments Feed-icon

1 point
login to vote
Mattias Blom script's author
Posted Aug 26, 2007

Updated, now "p" goes to Previous photo and "n" to Next photo. I wonder how I could have missed that one? I guess I have been looking through albums backwards for some time now.

1 point
login to vote
engtech scriptwright
Posted Aug 25, 2007

Yay! :)

1 point
login to vote
Mattias Blom script's author
Posted Aug 24, 2007

I caved..., Now t toggles the tagging ui on and off. I didn't want to start messing with 'enter' since you use enter if you type in a person not on facebook. And yes, the code got ugly and will break on minor changes in the facebook setup. The eventlistener thing didn't work since I didn't want to hook into mouse clicks but rather "click" programmatically. So I got the onclick-code from getAttribute and eval'ed it with unsafewindow. But hey, it works right now!

1 point
login to vote
engtech scriptwright
Posted Aug 23, 2007

I was thinking that hitting T would be the same as clicking the Tag this photo button. Couldn't you set up an event for 'T' click that finds the 'tag this' link and sends it an onclick event?

1 point
login to vote
Mattias Blom script's author
Posted Aug 22, 2007

...and mouse action is required for tagging so maybe adding t for tagging wouldn't help that much, other than the consistency.

1 point
login to vote
Mattias Blom script's author
Posted Aug 22, 2007

I don't think I can fix that as easily. The tag ui is displayed using javascript (show_tagging_ui) and the anchor is id-less and it's place in the dom varies depending on whether it's your photo or not. That means headaches and clutter and I'm not going down that road. =) Feel free though...

1 point
login to vote
engtech scriptwright
Posted Aug 22, 2007

't' to start tagging and 'enter' to finish tagging would be good as well. :)

1 point
login to vote
Mattias Blom script's author
Posted Aug 22, 2007

Nice idea. The "Comment Jump" is added.

I was thinking about adding shortcuts for "next" in search results and other places. But those elements don't have id:s so getting that to work would clutter my minimalistic approach! =)

1 point
login to vote
engtech scriptwright
Posted Aug 22, 2007

nice one... I was thinking about writing something like this.

It would be nice if 'c' jumped to the comment field.

You could comment on this script if you were logged in.