Documenting bound events as part of specifications

Documenting bound events as part of specifications

Here is something we should do in the future, and where time is available, add for existing components: Document all the events that are bound as part of the functional specification, including details of event-object properties that are read.

For example, Autocomplete binds, among various others, a keydown-event to the element, and checks the keyCode event property for various values.

This could make code reviews much more effective, and even better yet, would server as documentation on how to script a widget, that is, simulate user input via triggered events. As long as those event bindings are documented, we don't have to expose an explicit API for everything, eg. only the most important methods.

One thing I'd like to implement is a actual demo page: Take the ThemeRoller overview page, and write scripts to simulate user input on each widget. Or put a "Play" button on each demo page to show what the user can do with the widget.

It would also be very useful for developers building widgets on top of existing widgets. By overriding certain events and triggering others, you can achieve a lot of stuff that the API otherwise may not provide.