A few jQueryish ideas I’m playing with
~ 4. August 2010 ~
I was sort of taken with a post from Smashing Magazine that I found who knows how—probably a tweet from Webdesigner Depot—on creating fancy bookmarklets with the jQuery library (jQuery being, hm, let’s say a bunch of impossibly complex code that allows you to accomplish animations and other fun stuff without working too hard). The post shows a bookmarklet that pulls text the user has selected—if none is selected the user is prompted for text—and uses that text to perform a search in Wikipedia. The result shows in an iframe that in AJAX-y style sits in a fancy box that appears to rest on top of the current page. When you click outside of the box, the iframe retracts and disappears. So, yeah, cool.
I think this sort of thing is actually very useful. You highlight the title of a book and look it up in the catalog without leaving the current page (I do this with OpenSearch plugins all the time). So I adapted it to search our library catalog, which worked great, but then I tried to do a bit more. Our catalog does not respond well to punctuation (unless it’s part of special query syntax, which most users don’t know how to use), so I tried to automatically remove colons, question marks, and a few other things. This is the realm of regular expressions, which I sort of begin to understand, and JavaScript, which I have been trying (and generally failing) to get a better grip on this summer. The result is actually working in some cases but not others—if no text is selected and you enter a query in the box, everything goes well, but if you have text selected it doesn’t work. Alas.
Somewhat simpler, at least in theory, was making a bookmarklet to point to the D2L widget. This worked great, but then I tried other browsers. Firefox no problem, Chrome very nice, but IE 7? Not good. Demo of both:
(If Flash version doesn’t display in your browser, try this version)
This is of course all apart from the question of who would actually use a bookmarklet… In general I think they are great things, and can provide a cross-browser alternative to browser plugins. I’m a big fan of Diigo’s “diigolet” bookmarklet, which gives you most of the functionality of its Firefox plugin without the invasiveness (leave my Google searches alone!).
And then one more thing: a page to present some of the YouTube vids I’ve been making and intend to continue doing as quickly as I can over the next year. Sending people to our YouTube channel is ok, but my assumption was that YouTube’s API was going to make it easy to whip something up that would automate the display process on the library website, allowing people to select by tag etc. But while there are a lot of options out there for presenting your content, such as the official Google video bar and custom player, and various third-party gadgets and widgets and so on, I’m not really finding the flexible thing that I want readymade, nor have I taken the plunge of really learning to work with the API myself (and with such primitive programming ability I might not be able to do anything with it anyway).
So I’m intending to work from a model I found that allows users to choose from a list and view without leaving the page. The problem is that the list will have to be created and updated manually; at least, I can’t think of a way not to do it manually.