diff --git a/src/static/js/timeslider.js b/src/static/js/timeslider.js index 109b6a0ac..95be76d7a 100644 --- a/src/static/js/timeslider.js +++ b/src/static/js/timeslider.js @@ -84,7 +84,7 @@ SocketClient("AuthenticatedSocketClient", //make sure we have a token this.token = readCookie("token"); - if(this.token == null) + if(this.token === null) { this.token = "t." + randomString(); createCookie("token", this.token, 60); @@ -92,6 +92,7 @@ SocketClient("AuthenticatedSocketClient", this.padID = padID; this.sessionID = decodeURIComponent(readCookie("sessionID")); this.password = readCookie("password"); + this.handlers = {}; this._super(baseurl); }, @@ -162,7 +163,6 @@ AuthenticatedSocketClient("TimesliderClient", { //instance init: function (baseurl, padID) { this._super(baseurl, padID); - this.handlers = {}; }, onConnect: function (callback) { @@ -247,38 +247,6 @@ function init(baseURL) { $("#ui-slider-handle").css('left', $("#ui-slider-bar").width() - 2); }); -/* - //build up the socket io connection - socket = io.connect(url, {resource: resource}); - - //send the ready message once we're connected - socket.on('connect', function() - { - sendSocketMsg("CLIENT_READY", {}); - }); - - socket.on('disconnect', function() - { - BroadcastSlider.showReconnectUI(); - }); - - //route the incoming messages - socket.on('message', function(message) - { - //if(window.console) console.log(message); - - if(message.type == "CLIENT_VARS") - { - handleClientVars(message); - } - else if(message.accessStatus) - { - $("body").html("