Simplifying the UI API

Simplifying the UI API

Hey John,
I polished and finished more implementation of the UI API (disable/enable, destroy, remove, all working nicely with class names / themeing) yesterday. However it came to my (and Richard's) mind, that we seriously have to make the API *way* easier.
I have worked half of my day on a api draft. I'll continue with the resulting pseudo-code:
There is no naming instances anymore (that's stupid, nobody will use it) and later retrieving it via $.get(). Instead, we would make use of jquerish selectors, that will get dynamically expanded with more methods. Think of the following situation (it's all tested in real code, it would work, somehow)
1.) The module (in my example resizables), needs to register itself at the end of the file via
    //Register the module
    $.ui.register("resizable");
2.) This will then add a expression for the module, so one can do $("div:resizable") to get a set of jquery elements that are resizable.
3.) Now the tricky part: For these expressions, jQuery appends a additional set of functions to the resulting query. That would be the following (for now): enable,disable,destroy and very important, the instance must be attached.
4.) With this API, the user has a seamless jquery experience. This doesn't break the chain in any way and allows for great UI usability. The user could to the following:
$("div").resizable(); //Make all div's resizable
$("div:resizable").disable(); //Disable all resizables
var someInstanceValue = $("div:resizable:eq(0)").instance.innerInstanceValue //Direct access to the instance, for the people who need it
Please answer soon, since I would need your help with this one.
Thanks,
Paul<br clear="all">
--
--
Paul Bakaus