jsdoc3/jsdoc — pull request #365 by mathematicalcoffee (2013-03-20 06:44:52+00:00)
Title: Add @listens (#273)

Added a `@listens` tag (#273).

Example:

```javascript
/** An event.
* @event MyEvent
*/
/** A handler
* (could also do @listens event:MyEvent)
* @listens MyEvent
*/
function handler() {
}
```

All this does is add a `doclet.listens` to the `handler` doclet, containing the longname of the event it listens to (`event:MyEvent` in this case).

Then, in `templateHelper.js` there is a function `addEventListeners`.
This adds an array `doclet.listeners` to all events listing all the functions that `@listen` to it.

In `publish.js` we call `addEventListeners(taffied_data)` to do the above.

Then in the default template we add:

* a 'Listens to events:' section to anything with a `.listens` property, linking to the events we `@listen` to
* a 'Listeners of this event' section to any event that has something that `@listens` to it, linking to all the things that `@listen` to us.