Adding a gallery viewer for attached images with TamperMonkey
After being pretty happy with my efforts at re-theming this forum, I decided to follow it up by seeing if I could add a gallery-style viewer for images attached to posts. Some prefer it the way it is, where each image opens in a new tab, but I find it tedious and it often discourages me from viewing all the images.
So I threw together this script to be used with TamperMonkey (I presume it'll work with GreaseMonkey as well, if you're a FireFox user, though perhaps it'll need a tweak or two). These are very useful browser extensions that let you execute arbitrary scripts against selected pages. So, after installing your chosen extension, follow the instructions to create a new script and paste in the following contents: Code:
And finally, save it. If it's working correctly, you should see a little "1" on the TamperMonkey badge when viewing this forum, and clicking on an attached image should open it in a lightbox, with the ability to navigate back and forth to all the images attached to that post. This greatly increases my enjoyment of the site. |
Nice!!!
|
So you are a white hat hacker?
I think the hacks are cool and make for a nice feature set for someone less experienced than you to try it out. |
Quote:
Nah, just temporarily seized by a "fix it" rather than "complain about it" attitude. I'll revert back soon enough. ;) |
It would be easy enough to modify this to have a single gallery for all the images in the thread, rather than one for each post. Actually, that's not quite right: the gallery could show all images on the current *page* of the thread.
If anyone wants that, let me know. Somehow I doubt I'll be getting crushed with requests though. :) |
All times are GMT -5. The time now is 01:26 AM. |
Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.