Script Summary: Quickly look up selected text in Wikiqedia, Wiktionary or Wikiquote.
This script allows you to select text on a web page and, with just one click, use it to check for an article on Wikipedia. When you select a section of text a small pop-up appears at the top right of the window with a quote of the selection and image links to Wikipedia, Wiktionary and Wikiquote. This probably only saves five or six clicks but somehow this seems a lot less troublesome. The pop-up also provides alternative links that will open the results in a new window or tab (depending on your browser settings).
The script tests for selected text in two ways: it waits passively for a mouseUp event (as when you release the mouse button after a selection drag) and also actively tests for selections once every two seconds. This allows you to make a rough selection with a mouse drag and then extent the selection area with Shift+Arrow Keys and then just wait a moment for the quote to update. Once the mouse is over the pop-up the selected text is locked so that miss-clicks won't leave you having to make the selection again.
The script automatically truncates long selections and ignores very long selections so selecting all the text on a page won't cause problems. To close the pop-up just deselect the text by clicking once anywhere else on the page.
v1.0 - 5th October 2006