Thursday, July 10th, 2008

Ojay 0.2: easy keyboarding, a validation DSL, and two new UI widgets

Category: JavaScript, Yahoo!

James Coglan has updated Ojay, the chaining wrapper for YUI that we posted on a few months back.

The new release features really simple keyboard and form scripting and couple of new UI widgets, a new event system and a stack of other improvements:

Ojay.Forms. By far the biggest new package, Ojay.Forms sorts out a real pain point for me in terms of app development. It does two things: it provides unobtrusive replacements for the YAHOO.widget.Button family of classes, and it provides a DSL for handling form validation and Ajax submission.

Ojay.Keyboard. The new keyboard package is an abstraction over YAHOO.util.KeyListener that lets you say what mean without worrying about character codes, for example:

Ojay.Keyboard.listen(document, 'ALT SHIFT S', function() {
    // handle key press

It lets you group sets of keyboard commands together so you can make context-sensitive keyboard controls, and gives you easy access to enable/disable key events and their default browser responses. Not much more to say except that you should check out the documentation.

We have two new UI packages, Ojay.Overlay and Ojay.Paginator. Overlay gives you a bunch of classes for positioning content on top of the document, producing lightbox effects and the like, and Paginator implements the content slider effect that’s got a lot of attention recently, including the ability to lazy-load pages of content via Ajax, and easy integration with Ojay.History. Both packages come with a collection of events to allow your code to react to changes to the components, just like you would for DOM elements.

Speaking of events, this release introduces Ojay.Observable, a JS.Class module that allows any class to support the on() method used for listening to events. This module underlies the custom events published by all the Ojay components. More information and examples are in the documentation.

Posted by Dion Almaer at 10:41 am

3.3 rating from 23 votes


Comments feed TrackBack URI

This is exciting to me because I grew up in Canton, Ohio–home of the O’Jays.

As someone who has become addicted to chaining, it’s nice to see the concept spreading.

Comment by Nosredna — July 10, 2008

It looks great.wonderful effort.looks more like do you think you can come up with some thing like jrails a drop replacement for prototype + scriptapulous….
THnks Once Again

Comment by cooolbasha — August 10, 2008

Leave a comment

You must be logged in to post a comment.