handler/TimesliderMessageHandler: use jshint

This commit is contained in:
booo 2011-12-22 13:30:56 +01:00
parent e7b2a2b3b9
commit 11568b1278

View file

@ -39,7 +39,7 @@ var socketio;
exports.setSocketIO = function(socket_io) exports.setSocketIO = function(socket_io)
{ {
socketio=socket_io; socketio=socket_io;
} };
/** /**
* Handles the connection of a new user * Handles the connection of a new user
@ -48,7 +48,7 @@ exports.setSocketIO = function(socket_io)
exports.handleConnect = function(client) exports.handleConnect = function(client)
{ {
} };
/** /**
* Handles the disconnection of a user * Handles the disconnection of a user
@ -57,7 +57,7 @@ exports.handleConnect = function(client)
exports.handleDisconnect = function(client) exports.handleDisconnect = function(client)
{ {
} };
/** /**
* Handles a message from a user * Handles a message from a user
@ -80,11 +80,11 @@ exports.handleMessage = function(client, message)
{ {
messageLogger.warn("Dropped message, unknown Message Type: '" + message.type + "'"); messageLogger.warn("Dropped message, unknown Message Type: '" + message.type + "'");
} }
} };
function handleClientReady(client, message) function handleClientReady(client, message)
{ {
if(message.padId == null) if(!message.padId)
{ {
messageLogger.warn("Dropped message, changeset request has no padId!"); messageLogger.warn("Dropped message, changeset request has no padId!");
return; return;
@ -96,7 +96,7 @@ function handleClientReady(client, message)
ERR(err); ERR(err);
client.json.send({type: "CLIENT_VARS", data: clientVars}); client.json.send({type: "CLIENT_VARS", data: clientVars});
}) });
} }
/** /**
@ -105,27 +105,27 @@ function handleClientReady(client, message)
function handleChangesetRequest(client, message) function handleChangesetRequest(client, message)
{ {
//check if all ok //check if all ok
if(message.data == null) if(!message.data)
{ {
messageLogger.warn("Dropped message, changeset request has no data!"); messageLogger.warn("Dropped message, changeset request has no data!");
return; return;
} }
if(message.padId == null) if(!message.padId)
{ {
messageLogger.warn("Dropped message, changeset request has no padId!"); messageLogger.warn("Dropped message, changeset request has no padId!");
return; return;
} }
if(message.data.granularity == null) if(!message.data.granularity)
{ {
messageLogger.warn("Dropped message, changeset request has no granularity!"); messageLogger.warn("Dropped message, changeset request has no granularity!");
return; return;
} }
if(message.data.start == null) if(!message.data.start)
{ {
messageLogger.warn("Dropped message, changeset request has no start!"); messageLogger.warn("Dropped message, changeset request has no start!");
return; return;
} }
if(message.data.requestID == null) if(!message.data.requestID)
{ {
messageLogger.warn("Dropped message, changeset request has no requestID!"); messageLogger.warn("Dropped message, changeset request has no requestID!");
return; return;
@ -301,7 +301,7 @@ function getChangesetInfo(padId, startNum, endNum, granularity, callback)
compositesChangesetNeeded.push({start: compositeStart, end: compositeEnd}); compositesChangesetNeeded.push({start: compositeStart, end: compositeEnd});
//add the t1 time we need //add the t1 time we need
revTimesNeeded.push(compositeStart == 0 ? 0 : compositeStart - 1); revTimesNeeded.push(compositeStart === 0 ? 0 : compositeStart - 1);
//add the t2 time we need //add the t2 time we need
revTimesNeeded.push(compositeEnd - 1); revTimesNeeded.push(compositeEnd - 1);
@ -372,7 +372,7 @@ function getChangesetInfo(padId, startNum, endNum, granularity, callback)
var backwards2 = Changeset.moveOpsToNewPool(backwards, pad.apool(), apool); var backwards2 = Changeset.moveOpsToNewPool(backwards, pad.apool(), apool);
var t1, t2; var t1, t2;
if (compositeStart == 0) if (compositeStart === 0)
{ {
t1 = revisionDate[0]; t1 = revisionDate[0];
} }