NWEvents: handlers, listeners and delegates

NWEvents 1.2.4 is the latest stable version on Google Code, it was released 2012/01/01.

If you prefer, you can also download the latest stable sources of NWEvents-1.2.4.js from the GitHub repository.

You can follow improvements and new developments versions directly on the GitHub repository, currently NWEvents 1.2.4.

Capturing and Bubbling emulation for IE and other browser

Previous versions of NWEvents did implement this feature only for "focus" and "blur" events (probably the most useful), however the current version implements a more generic solution for all form events, and that could be extended to other events too.

Javascript event delegation completely integrated in NWEvents

The above emulation achievements has allowed us to make event delegation the strongest addition we have made to our NWEvents project. The full CSS3 engine part, NWMatcher is now an independent module that can be loaded on demand as an option, to comply with full CSS3 Selectors. NWEvents have a self-contained minimal matcher for simple selectos like "div#list", "ul.menu" and so on. It is also possible to specify the same targets but in a more powerful way like this:

div#list is equivalent to { tagName: 'div', id: 'list' }
ul.menu is equivalent to { tagName: 'ul', className: 'menu' }
Using javascript Object { ... } syntax instead of a simple string will let us write more powerful matching rules, without the need of a complex parser, in fact we can test any property we want using this syntax. Remember, both syntax are accepted and really useful.

We will still miss all of the descendant, ancestor, siblings operators and pseudos etc...but we have enough ammunitions for the most useful cases, if not, we will need to resort to load a full CSS3 capable engine like NWMatcher.

General features of the event manager

Things that get fixed in browsers failing the W3C specs or UI usability expectations:

Properties/Methods added to browsers failing the W3C specs:

The test cases

Other test cases

Javascript event delegation bound to CSS3 complex selectors is now possible using NWMatcher.

This Event Manager was an absolute need for me in the development of this WEB application.

A complete documentation does not yet exists. Hope to be able to write it and publish as time permits.

Some wiki pages about method names, parameters and usage have been added in the Google Code repository.

Related works on Javascript event delegation

Reading material I found inspiring