Permalink
Browse files

Add in tweaks to the client js

  • Loading branch information...
1 parent 7d6e046 commit a33d5edc1c4cf88af0b234cd619fbc0d0734963e @Sutto committed Jul 24, 2011
Showing with 12 additions and 6 deletions.
  1. +3 −3 public/coffeescripts/pebble.coffee
  2. +9 −3 public/javascripts/pebble.js
@@ -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

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit a33d5ed

Please sign in to comment.