Metafilter Quoting Bookmarklet February 27, 2008 10:17 PM   Subscribe

Here's a little quoting bookmarklet for Metafilter threads that I thought folks might find useful. Highlight a text snippit you'd like to quote and click the bookmarklet. It'll format the snippit as a quote and paste it into the comment box for you.

Just drag the bookmarklet into your bookmarks bar in Safari or Firefox. I had cobbled together something like this for another forum that required usenet-style quoting and I thought it'd be fairly easy to adapt to Metafilter. I haven't tried greasemonkey or any of the other quoting solutions, so this might be similar. It quotes text with italics, the username (no @ symbol) and a link to the original comment. The username/link are omitted for short threads or in cases where authorship is unclear to the script.
posted by Jeff Howard to Feature Requests at 10:17 PM (32 comments total) 10 users marked this as a favorite

I designed this for Metafilter and Ask Metafilter; haven't tested it on the other subsites (including this one, sigh).
posted by Jeff Howard at 10:27 PM on February 27, 2008


Great idea, thanks! I just tried it in a couple of threads, and it's a bit finnicky. Any tips for getting it to be able to find the username? What portion of the comment should we hilight?
posted by !Jim at 10:58 PM on February 27, 2008


Works fine for me in the blue (Safari 3.0.4), seems not so happy with the grey.

!Jim, you may be running into the "short thread" feature?
posted by johnjoe at 11:00 PM on February 27, 2008


I put together a simple version (sans username) that works here in the grey. It's at the bottom of the download page.

Usernames are only quoted on longer threads. They don't seem necessary if there are only a few posts. On longer threads, the script searches through the page to find the first instance of the text you've quoted. If you only quote a very short snippit there's a good chance that it could appear multiple times on the page, so the script doesn't try to display the name. Longer phrases are more apt to be unique. The script only pulls in a username if you're quoting a phrase over 20 characters long.
posted by Jeff Howard at 11:14 PM on February 27, 2008


It works fine in Opera too, you just need to remove this bit of the code:
if (document.all){void(alert('This bookmarklet only works with Safari and Firefox.'));}else 
Easiest way to do it in Opera is to drag the link to your bookmarks folder (NOT as a toolbar shortcut), then right-click on the link and go into its properties. You'll see all the code there.
posted by spiderskull at 11:33 PM on February 27, 2008


Bug report: In firefox 2.0.012 on Ubuntu Linux, I get the highlighted text between italic brackets, but the username and link do not get added.

(also, consider using <em> brackets - standards compliance and all...)

also seconding the report that it doesn't work on the grey.
posted by chrisamiller at 11:51 PM on February 27, 2008


also seconding the report that it doesn't work on the grey.

Fixed so that it works on Metatalk and all the other subsites. (I didn't realize that the grey had a slightly different document structure). If you've already grabbed the bookmarklet, there's a new copy on the download page.

The username/link is omitted if the thread is shorter than 10 posts, or if you only quote a short phrase.
posted by Jeff Howard at 12:25 AM on February 28, 2008


Fixed so that it works on Metatalk and all the other subsites. (I didn't realize that the grey had a slightly different document structure). If you've already grabbed the bookmarklet, there's a new copy on the download page.

Awesome, it works! (Strange to see the i tag used instead of em, though.) Thanks so much for this, Jeff!
posted by sveskemus at 2:08 AM on February 28, 2008


Having recently been made aware of the <cite> tag, I am now a true believer. Why should our quotes be shouted by screen readers?
posted by flabdablet at 3:10 AM on February 28, 2008


That's not what the cite element is for. A special class of blockquote or q would be more appropriate.
posted by grouse at 3:50 AM on February 28, 2008


I'd rather the author of Metafilthy fixed the small bugs that have developed in that program.

Or perhaps he has and I just haven't updated?
posted by PeterMcDermott at 4:26 AM on February 28, 2008


That's not what the cite element is for.

Thanks for the link. I've been using it half-wrong (wrong on quotes, right on titles).
posted by johnofjack at 4:46 AM on February 28, 2008


Jeff Howard: Just drag the bookmarklet into your bookmarks bar in Safari or Firefox.

And on Safari, at least, if it's one of the first nine items in your bookmark bar, you can invoke it by typing Cmd-1 or Cmd-2 or etc.

Great utility, and thanks a great deal for writing it. I may hack at this a little to make it conform to my quoting style, but I'm going to use this a lot.
posted by ardgedee at 4:49 AM on February 28, 2008


the almighty Q.
posted by johnofjack at 4:51 AM on February 28, 2008


ardgedee: Great utility, and thanks a great deal for writing it.

Ditto. This is tres awesome, as the French say.
posted by allkindsoftime at 5:09 AM on February 28, 2008


flabdablet: "Why should our quotes be shouted by screen readers?"

That's why mefiquote defaults to the i tag, not em.
posted by Plutor at 5:21 AM on February 28, 2008


ardgedee: And on Safari, at least, if it's one of the first nine items in your bookmark bar, you can invoke it by typing Cmd-1 or Cmd-2 or etc.

This is awesome.
I still have to click my cursor back in the text box to continue writing my comment but I guess you can't have everything.
posted by chococat at 6:01 AM on February 28, 2008


This is awesome.

Seconded!
posted by evilcolonel at 7:08 AM on February 28, 2008


spiderskull: It works fine in Opera too, you just need to remove this bit of the code:

Huh....sure does. Thanks to both of you!
posted by inigo2 at 7:22 AM on February 28, 2008


> Highlight a text snippit you'd like to quote and click the bookmarklet.

Revised bookmarklet, lighly modifying Jeff's excellent work. Changes:
Removed browser check;
Link reformatted (as shown);
Focus is moved to the comment area, addressing chococat's request.

Note that none of these bookmarklets work elegantly with carriage returns in the quoted snippet. I don't know enough to guess whether this is a problem inherent in the medium.
posted by ardgedee at 7:27 AM on February 28, 2008


Interesting, on Win 98 (I know) and Win2k using Firefox 2.0.0.12, it works fine when quoting the original FPP, but when quoting any comment, it loses the username, the link and the colon. (it just italicizes it). Strange.

Still, a quite cool use of javascript.
posted by quin at 7:30 AM on February 28, 2008


This is awesome. Seconded!
Thirded!
posted by iamkimiam at 7:49 AM on February 28, 2008


ardgedee: none of these bookmarklets work elegantly with carriage returns in the quoted snippet. I don't know enough to guess whether this is a problem inherent in the medium

The bookmarklet collapses carriage returns in the quote to make it more compact. This can sometimes be a problem when the script tries to match authorship, and in those cases the script will fail to return the quote's author/link, but it'll still quote the text snippit.


chococat: I still have to click my cursor back in the text box to continue writing my comment but I guess you can't have everything.

I considered doing that automatically. It's certainly possible (as ardgedee demonstrates) but if you want to quote more than one snippet you lose context by jumping down to the text box. If that's not an issue then it's ideal for quoting single snippets.
posted by Jeff Howard at 9:00 AM on February 28, 2008


quin: when quoting any comment, it loses the username, the link and the colon. (it just italicizes it).

I haven't tested much on older Windows systems, but if the script can't determine the author for some reason then it'll at least give you the italicized text. You'll always get the text, even if you quote something weird that's not a comment.

note: Everyone needs a hug.
See?
posted by Jeff Howard at 9:06 AM on February 28, 2008


> The bookmarklet collapses carriage returns in the quote to make it more compact

Right, but inserting encoded carriage returns (eg, %0A) (to add air after the quote) breaks the script. I might be doing it wrong.
posted by ardgedee at 9:41 AM on February 28, 2008


Jeff Howard: Here's a little quoting bookmarklet for Metafilter threads that I thought folks might find useful. Highlight a text snippit you'd like to quote and click the bookmarklet. It'll format the snippit as a quote and paste it into the comment box for you.

You, sir, are awesome.
posted by mkultra at 11:34 AM on February 28, 2008


mkultra: You, sir, are awesome.

I'm going to have to concur with that.
posted by grouse at 12:00 PM on February 28, 2008


Jeff Howard: "Here's a little quoting bookmarklet for Metafilter threads that I thought folks might find useful. Highlight a text snippit you'd like to quote and click the bookmarklet. It'll format the snippit as a quote and paste it into the comment box for you.

Just drag the bookmarklet into your bookmarks bar in Safari or Firefox. I had cobbled together something like this for another forum that required usenet-style quoting and I thought it'd be fairly easy to adapt to Metafilter. I haven't tried greasemonkey or any of the other quoting solutions, so this might be similar. It quotes text with italics, the username (no @ symbol) and a link to the original comment. The username/link are omitted for short threads or in cases where authorship is unclear to the script.
"

So now we can easily paste huge, identifiable block quotes into our own posts! That is great!

Jeff Howard: "Here's a little quoting bookmarklet for Metafilter threads that I thought folks might find useful. Highlight a text snippit you'd like to quote and click the bookmarklet. It'll format the snippit as a quote and paste it into the comment box for you.

Just drag the bookmarklet into your bookmarks bar in Safari or Firefox. I had cobbled together something like this for another forum that required usenet-style quoting and I thought it'd be fairly easy to adapt to Metafilter. I haven't tried greasemonkey or any of the other quoting solutions, so this might be similar. It quotes text with italics, the username (no @ symbol) and a link to the original comment. The username/link are omitted for short threads or in cases where authorship is unclear to the script.
"

I can see people using this all the time especially here in Meta!

Jeff Howard: "Here's a little quoting bookmarklet for Metafilter threads that I thought folks might find useful. Highlight a text snippit you'd like to quote and click the bookmarklet. It'll format the snippit as a quote and paste it into the comment box for you.

Just drag the bookmarklet into your bookmarks bar in Safari or Firefox. I had cobbled together something like this for another forum that required usenet-style quoting and I thought it'd be fairly easy to adapt to Metafilter. I haven't tried greasemonkey or any of the other quoting solutions, so this might be similar. It quotes text with italics, the username (no @ symbol) and a link to the original comment. The username/link are omitted for short threads or in cases where authorship is unclear to the script.
"

Yes, it sure does work.

Jeff Howard: "Here's a little quoting bookmarklet for Metafilter threads that I thought folks might find useful. Highlight a text snippit you'd like to quote and click the bookmarklet. It'll format the snippit as a quote and paste it into the comment box for you.

Just drag the bookmarklet into your bookmarks bar in Safari or Firefox. I had cobbled together something like this for another forum that required usenet-style quoting and I thought it'd be fairly easy to adapt to Metafilter. I haven't tried greasemonkey or any of the other quoting solutions, so this might be similar. It quotes text with italics, the username (no @ symbol) and a link to the original comment. The username/link are omitted for short threads or in cases where authorship is unclear to the script.
"

It will probably change the tone and feel and plain old readability of discussion here. And not for the better.
posted by LarryC at 3:28 PM on February 28, 2008


LarryC: It will probably change the tone and feel and plain old readability of discussion here.

Like any other tool, this can be abused. More popular quoting utilities already exist that quote entire posts. This one is designed to decrease noise by making it possible to easily select only the relevant parts of a comment. I'm certainly not trying to promote indiscriminate quoting.

If things ever get out of hand, the bookmarklet can be disabled sitewide simply by changing an ID or two on the comment pages.
posted by Jeff Howard at 3:51 PM on February 28, 2008


It will probably change the tone and feel and plain old readability of discussion here. And not for the better.

OK, Grandpa.

Some kind of

if(document.getElementById(blah).value.indexOf(textToInsert) <>


might fix that.
posted by mkultra at 4:43 PM on February 28, 2008


Sorry, Jeff, I was just goofing around. Thanks for your work, I'll give it a try.
posted by LarryC at 4:50 PM on February 29, 2008


Hey, just an update, I am getting the quote, but not the user context when I use this in Safari 3.1.

And my javascript-foo isn't cool enough to fix it on my own.
posted by mrzarquon at 2:44 PM on March 20, 2008


« Older Frontpage favorites behavior   |   Tri it! You might like it! Newer »

You are not logged in, either login or create an account to post comments