From 95310dafd4952f00db938c0181c2a75e2b33ad5f Mon Sep 17 00:00:00 2001 From: s1341 Date: Sat, 23 Nov 2013 19:53:10 +0200 Subject: [PATCH] handlers dict needs to be in AuthorizedClient; cleanup --- src/static/js/timeslider.js | 55 ++----------------------------------- 1 file changed, 2 insertions(+), 53 deletions(-) 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("

You have no permission to access this pad

"); - } else { - changesetLoader.handleMessageFromServer(message); - } - }); -*/ //get all the export links export_links = $('#export > .exportlink'); @@ -300,25 +268,6 @@ function init(baseURL) { }); } -//sends a message over the socket -function sendSocketMsg(type, data) -{ - var sessionID = decodeURIComponent(readCookie("sessionID")); - var password = readCookie("password"); - - var msg = { "component" : "pad", // FIXME: Remove this stupidity! - "type": type, - "data": data, - "padId": padId, - "token": token, - "sessionID": sessionID, - "password": password, - "protocolVersion": 2}; - - - socket.json.send(msg); -} - var fireWhenAllScriptsAreLoaded = []; exports.init = init;