layout | title | previous | next |
---|---|---|---|
article |
The libraries we use |
quick-install |
development |
The major JavaScript libraries we use are YUI, JS.Class and Ojay. These libraries handle the core areas of modern web client-side development: DOM traversal and manipulation, event handling, Ajax, and animation.
JS.Class facilitates object-oriented design in JavaScript. Its main use within our code is providing abstractions---primarily modules and classes, as seen in the Ruby programming language---that allow us to express common JavaScript design patterns in a structured and maintainable fashion. Many of our in-house libraries start with a line like this one:
var LibraryObject = new JS.Class({...
YUI, or the Yahoo! User Interface Library, is the foundation on which Ojay is built. It provides a rigorously tested cross-browser framework for querying and manipulating the DOM, animation, sending and receiving HTTP requests, and other common tasks such as parsing JSON. Its extensive set of utilities for everything from history management to keyboard listening and mouse tracking are used both in Ojay, and directly in client projects.
Ojay provides a more usable and intuitive interface to YUI's functionality. It also addresses several specific needs which other DOM libraries do not. Perhaps most importantly, it allows one to straightforwardly express chains of operations that include asynchronous behaviour, without explicitly defining complex nested callbacks.
Ojay includes several fairly generic interface elements: accordions, overlays, carousels and tabs. With the addition of some appropriate CSS, these packages allow one to compose rich and complex user interfaces from a simple underlying HTML representation.
In addition to the major libraries listed above, we also employ a number of specialised in-house and third-party libraries. These do things like supplement HTML's occasional limitations, wrap external APIs like Google Maps, YouTube and Flickr, and provide specialised user interface components. All of our these libraries are available from our GitHub account.
SWFObject lets you embed Flash objects into HTML pages with a minimum of fuss. We use this everywhere we need to include Flash videos, adverts, video players and so on. It's called directly in client projects, and also by our YouTube player library.
It's not possible to upload multiple files from the same form in HTML. SWFUpload works around this limitation by using Flash to upload files. MultiUpload wraps an HTML GUI around SWFUpload.
We have two libraries for interfacing with Google Maps: LocationPicker and MapNavigation. MapNavigation allows to you to unobtrusively create a Google Maps interface from existing navigational items in an HTML document, while LocationPicker is a utility to help people enter geographic data into web forms.