{:uriI"file:///Users/matthewchang/work/call9/push_routes/vendor/assets/javascripts/push_routes_socket_io.js.erb?type=application/javascript&pipeline=debug&id=17e530f3174fda79d6bf7ddd7c47a345e6a0a9309827527c1e90043b488f73b8:ET:load_pathI"I/Users/matthewchang/work/call9/push_routes/vendor/assets/javascripts;T: filenameI"f/Users/matthewchang/work/call9/push_routes/vendor/assets/javascripts/push_routes_socket_io.js.erb;T: nameI"push_routes_socket_io;T:logical_pathI"#push_routes_socket_io.debug.js;T:content_typeI"application/javascript;T: sourceI"//TODO: configurable accross the application var PushRoutes = { socket: null, init: function(server,user_id,auth_token,callback) { var self = this; self.socket = io.connect(server, {secure: true}); self.socket.on('connect', function() { self.socket.connected = true; console.log("Connecting Socket"); self.socket.on('disconnect',function() { self.socket.connected = false; console.log('Socket Disconnected'); }); self.socket.on('unauthorized', function(err){ console.log("Authentication was rejected:", err.message); }); self.socket.on('authenticated', function() { console.log("Authentication successful"); }); self.socket.emit("authentication",{user_id: user_id, authentication_token: auth_token}, function(error,message) { console.log(error); console.log(message); }); }) }, subscriptions: {}, subscribe: function(route,on_update) { this.subscriptions[route] = on_update; this.register_subscription(route,on_update); }, register_subscription: function(route,on_update) { if(this.socket && this.socket.connected) { this.socket.on(route,function(message) { on_update(message); }); this.socket.emit("subscribe",route,function() { console.log("Subscribed to "+route); }); } else { console.log("Socket not connected"); } }, unsubscribe: function(route) { delete this.subscriptions[route]; } } ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"hprocessors:type=application/javascript&file_type=application/javascript&engines=.erb&pipeline=debug;TTI"tfile-digest:///Users/matthewchang/work/call9/push_routes/vendor/assets/javascripts/push_routes_socket_io.js.erb;TTI"gprocessors:type=application/javascript&file_type=application/javascript&engines=.erb&pipeline=self;TTF: linkso;;}F: included[I"file:///Users/matthewchang/work/call9/push_routes/vendor/assets/javascripts/push_routes_socket_io.js.erb?type=application/javascript&pipeline=self&id=1fa9df439a906b5a038072a43ee5b5d1aaf1606bce33ec8c22dc5f40f0123ed5;T: charsetI" utf-8;F: digest"%Va` Z{ #gn>: lengthi:dependencies_digest"%,@ ?37똖+b^(_ط2:idI"E17e530f3174fda79d6bf7ddd7c47a345e6a0a9309827527c1e90043b488f73b8;F: mtimel+ 0V