Skip to content

Commit

Permalink
Add in tweaks to the client js
Browse files Browse the repository at this point in the history
  • Loading branch information
Sutto committed Jul 24, 2011
1 parent 7d6e046 commit a33d5ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions public/coffeescripts/pebble.coffee
Expand Up @@ -33,13 +33,13 @@ class Pebble
connected: (callback) -> @on 'connect', callback
reconnected: (callback) -> @on 'reconnect', callback

receive: (channel, message) ->
@trigger channel, message
receive: (channel, message, opts = {}) ->
@trigger channel, message, opts

loadHistory: (channel, callback) ->
$.getJSON "/history/#{channel}", (data) =>
for message in data.reverse()
@receive channel, message
@receive channel, message, initial: true, loaded: (message is data[0])
callback() if callback instanceof Function

window['Pebble'] = Pebble
12 changes: 9 additions & 3 deletions public/javascripts/pebble.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a33d5ed

Please sign in to comment.