wavded/humane-js — pull request #29 by wnadeau (2012-07-28 18:19:10+00:00)
Title: add WebkitNotification/Mountain Lion NotificationCenter support (with graceful fallback)

With Mountain Lion and the Notification Center out and all (and maybe other OS's have a similar native hook-in), I figured it might be worth adding support for webkit's notification API.

I'm pretty unfamiliar with this style of javascript, so I apologize in advance if there's any egregious styling mistakes. (I did my best to conform, feel free to let me know of anything)

Managing webkitNotification permissions seemed like it was beyond the scope of the project, so I haven't included any permissions management stuff (other than a basic check to be sure we have permissions)

It's also not enabled by default, and it automatically falls back to the traditional style if the browser doesn't support it or permissions have been rejected.

There are some API differences between humane and webkitNotifications, such as the lack of HTML support in a webkit message's content, and webkit messages have a 'title' attribute. Luckily, there is some similarity with regard to callbacks.

So there is still work to be done in terms of a common interface between the humane message object and the webkit implementation.

Anyway, I figured it was worth starting the conversation here.