I'm not thrilled with adding a generic notification scheme at this point. It seems we need a clear client-side contract between XBlocks and their runtime, and we'll have to document it so that XBlock authors will know how to do this for themselves. Having a very vague contract means that it will be hard to change the code as we won't know what notifications any particular XBlock is depending upon. It will also be hard for other runtimes to know which notifications to implement.

As a short term fix to get ORA going this is okay, but I'd like to make it clear that this isn't a supported feature. Could you add a note to the comments to indicate that this is just provisional.

In the long term, I'd like to see us have defined events that the XBlock will send, along with an event handler mechanism. I don't have experience with writing custom JavaScript events to know whether we should roll our own mechanism, or if we can adopt an existing scheme. For example, I came across this, but I don't know how good an approach it is:

http://www.sitepoint.com/javascript-custom-events/