Shopify/dashing — pull request #164 by cjolly (2013-07-15 00:52:13+00:00)
Title: complete application messages using event names

Don't want to step on anyone's toes, but I think this feature is awesome and wanted to take it to the finish line!

* completes @pvande's #13 pull req using event names
* rebased against master
* maintain dashboard reload functionality
* maintain backward compatibility of `send_event`

Perhaps in version 2.0 there should be a unified `post /events` path which would handle both widget and dashboard events since the code and end result is so similar, all SSEs would have an `event: foo`. Your data payload could just specific a type, id, and data and the `eventListener` would take care of the rest.

In any case, tried to keep these changes backward compatible so it would be suitable for a 1.x release.

__Reload dashboard:__
`curl -i -d '{ "auth_token": "YOUR_AUTH_TOKEN", "event": "reload"}' http://localhost:3030/dashboards/sample`

__Simple idea for "changing the channel" on a dashboard TV:__
application.coffee
```coffeescript
Dashing.on 'changeChannel', (data) ->
console.log "Changing channel to: #{data.location}"
window.location = data.location
```

`curl -i -d '{ "auth_token": "YOUR_AUTH_TOKEN", "event": "changeChannel", "location": "/sampletv"}' http://localhost:3030/dashboards/sample`