From a3d84c8c0a30f5b761c37f6f2c805346d0009acd Mon Sep 17 00:00:00 2001 From: Daniel Beauchamp Date: Mon, 17 Sep 2012 11:16:31 -0400 Subject: Added a debug mode that lets you see all messages coming in. --- javascripts/dashing.coffee | 3 +++ 1 file changed, 3 insertions(+) (limited to 'javascripts') diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee index 964cf2c..528ae2c 100644 --- a/javascripts/dashing.coffee +++ b/javascripts/dashing.coffee @@ -81,6 +81,7 @@ Dashing.AnimatedValue = Dashing.widgets = widgets = {} Dashing.lastEvents = lastEvents = {} +Dashing.debugMode = false source = new EventSource('/events') source.addEventListener 'open', (e) -> @@ -93,6 +94,8 @@ source.addEventListener 'error', (e)-> source.addEventListener 'message', (e) => data = JSON.parse(e.data) + if Dashing.debugMode + console.log("Received data for #{data.id}", data) lastEvents[data.id] = data if widgets[data.id]?.length > 0 for widget in widgets[data.id] -- cgit v1.2.3