GM script: Link to referenced image

Mar 20, 2006 19:42

I wrote a Greasemonkey script that will attempt to link references in comments to images in posts. So if someone has posted ten images, a comment like "I like the second to last picture" will contain a link back up to the ninth image. Like this:


Read more... )

Leave a comment

ex_ga_woo March 20 2006, 22:01:47 UTC
Modified it to provide thumbnails of the images being linked to. (

Doesn't work well for "first n": Thumnail of only the first image is created, though it works for "last n". I tried to find out what's wrong, but it looked as if I'll have to change those regexps. So I gave up.

P.S: Script uses your namespace and script name, so it will over-ride your script if installed.

P.P.S: Means nothing that I uploaded it to userscripts.org. It's still your copyright. I just don't have webspace anywhere else :D

Reply

malesca March 20 2006, 22:07:57 UTC
That's a great idea. I don't mind my scripts being modified and re-distributed, but perhaps you could rename the script and modify the description, so there isn't two scripts on userscripts.org that appear to be similar? Call it "LiveJournal link to referenced image, with thumbnails" or something.

I might well incorporate something like that in a future version of the script, if you don't mind. Though I think I'll make the thumbnail appear in some sort of tooltip.

Reply

malesca March 20 2006, 22:08:54 UTC
"aren't two scripts that appear to be identical", rather...

Reply

ex_ga_woo March 20 2006, 22:36:31 UTC
I was hoping you'd say that you're going to include thumbnails in your script right now. So that I could delete the script I uploaded. Which is why I didn't even bother changing the name of the script. Or fix that "first n" problem I'm having. Anyway, I've changed the name and namespace now. And I'm not tagging the script; so not many will land on that page anyway.

Reply

malesca March 21 2006, 12:33:09 UTC
ex_ga_woo March 21 2006, 12:46:07 UTC
Thanks!

P.S: Although I was also hoping that you would remove dependence of the script on that icon on your server :D

Reply

malesca March 21 2006, 12:49:25 UTC
Well, you could remove the icon, or put it on your server and point the URL there instead.

I wanted to use data:URI for the icon, but I couldn't get it working with background images, and I felt using a non-embedded icon was the lesser of two evils (the other being having the icon as an
... )

Reply

malesca March 21 2006, 12:50:39 UTC
"as an
... )

Reply

ex_ga_woo March 21 2006, 12:54:36 UTC
Well, you could remove the icon, or put it on your server and point the URL there instead.

Yes, of course. My intention was to be able to update what I have with the latest version without having to merge it with my changes each time. But yeah, not everyone wants the same things as me always. I guess, sometimes, I do have to keep modify code :D

Reply

malesca March 22 2006, 12:41:02 UTC
I figured out how to get data:URI working with background images (had to sneak it in through the DOM rather than innerHTMLing it with everything else). Modified code at userscripts.org.

Reply


Leave a comment

Up