goldfire/howler.js — pull request #106 by digitaltonic (2013-12-20 15:27:16+00:00)
Title: Supercharged events

Hi James,

I'm starting to integrate Howler into a reasonably large scale Singe Page Javascript App, and rather than create yet another library, I decided to enhance yours.

The itch I needed to scratch was an enhancement the howl event system. I needed to allow an execution context to be set when a callback is fired, amongst other things. I believe I've achieved this in a backwards compatible way - as your existing test harness still works, however I really have no idea if I've broken anything major.

I've added some unit tests to cover my changes to the events, so this leads me onto a few opinionated things I've added.

1.) I've added JSHint, and a .jshintrc file, to establish strict rules about code hygiene etc - these are geared towards the existing code base.
2.) I've added Karma, Mocha, Chai and Sinon to execute my unit tests, and to provide some code coverage
3.) To facilitate regression testing, I've ripped off the example page from your blog, and put that into test/quick-play.html along with the sounds.
4.) To execute everything I've added the Grunt task runner, and I've updated the readme with instructions on how to use it

Other notes:

On lines 166-170 of howler.js, creating the blank function is probably now redundant, as it created new event categories on the fly.