I've been needing to write about the technology behind LibraryH3lp, but, as these things inevitably go, I've been too busy creating that technology to have much opportunity to get meta. As a compromise, I've decided to do a short post about the most visible piece of the system---that little chat box sitting in the sidebar.
The first thing that stands out about this widget is that it's written in JavaScript. As you may know, most (not all) XMPP chat widgets out there currently are made using Flash. And everybody chooses Flash for a very good reason: it's easier. Quite a bit easier, in fact. So, did I have some specific motivation for bucking the trend or was I just being contrary? (It's been known to happen.)
Well, here's one reason: accessibility for patrons with visual disabilities. I'm not good with screen readers, so I can't really say how well this widget works (compared to what alternatives, I don't know), but with Pam's help I was able to muddle through and determine that at least it does work. It needs real testing by someone who actually knows what he or she is doing, but it's looking promising. That's a big plus.
And here's another reason: portability. Arguments about the relative portability of JavaScript vs. Flash can go on forever. In a nutshell, Flash gives you better "write once run everywhere" (a big part of the reason it's easier to write a Flash widget), but JavaScript gives you more "everywhere". Flash may or may not ever come to the iPhone and other portable devices, but I know this widget works today. (I also have grand hopes that it will work on the Wii, but so far haven't had the opportunity to test it.)
Those are two solid reasons that I know you librarian types care about, but I'm a programmer type, so my real reasons are, perhaps, a bit twisted. I chose to do a JavaScript widget fundamentally because it's hackable.
I don't mean hackable in the scary bad-guys-are-going-to-steal-your-identity sense, I mean hackable in the you-can-do-what-you-want-with-it sense. It's designed from the ground-up to be as open a system as I can make it: the HTML is as purely minimal as I could make it (there's a little cruft that was necessary to make it layout correctly on IE6, alas), everything about the look-and-feel---even the layout of the boxes---is controlled by CSS and you can completely substitute your own CSS, and the JavaScript is open, with server-side APIs to the n-th degree.
Here's the idea: I can make certain things simple, but I have to make choices about what's simple and what's not-so-simple. (I can't make everything simple because that would involve both telepathy and clairvoyance, and if I had those skills I wouldn't be wasting my time programming.) Since my choices aren't going to be right for everybody, I don't want you to be limited by my own lack of imagination and foresight. And so, I did my best to create the hackable widget.
At this point there are only about half-a-dozen people outside of UNC using the widget, and most of them haven't yet gone public with it. But one of them has, quite independently of me, taken me up on the hackability challenge. They've not only written their own CSS, but they've dug in to the APIs and written their own JavaScript for it.
Oh, man! I'm still geeking out about it!
I'm striving to apply the openness principle to the design of the rest of the system too. As a quick example, the web-console back end that you'll use to manage the queuing and routing is designed entirely around RESTful resources. This will translate into an API that anyone can use to write custom clients or mashups for librarian use, in addition to customizing the UI for patron use.
Before closing this post I want to emphasize that little bit up in the header that says "open-source." No, I don't have a nice prepackaged download available as of yet, and no the code is not checked in to the Google Code project (I use Git, they use Subversion, it's this whole big culture-clash thing). If you're my target audience, however, I don't expect that to stop you. It's JavaScript---again, another reason not to go with Flash---I'm sure you're perfectly capable of choosing "view source" and going from there. It's GPL3: take it, run with it, have fun, send me patches.
And, lastly, just so no one overestimates my contribution, this widget is built on top of JSJaC and jQuery, both of which are totally awesome libraries that I just can't say enough good things about.
Happy Hacking!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment