Fix jshint errors

This commit is contained in:
David Cormier 2014-02-09 19:33:35 -05:00
parent 81054f06bd
commit 0107dabb2d
3 changed files with 11 additions and 12 deletions

View file

@ -241,7 +241,6 @@ function($rootScope,
var connect = function (host, port, passwd, ssl, noCompression) {
var proto = ssl ? 'wss' : 'ws';
var url = proto + "://" + host + ":" + port + "/weechat";
var binaryType = "arraybuffer";
var onopen = function () {
@ -344,7 +343,7 @@ function($rootScope,
protocol.setId = function(id, message) {
return '(' + id + ') ' + message;
}
};
ngWebsockets.connect(url,
protocol,
@ -354,7 +353,7 @@ function($rootScope,
'onclose': onclose,
'onmessage': onmessage,
'onerror': onerror,
})
});
};

View file

@ -96,21 +96,20 @@ function($rootScope, $q) {
/*
* Receives a message on the websocket
*/
var message = protocol.parse(evt.data)
var message = protocol.parse(evt.data);
if (_.has(callbacks, message.id)) {
// see if it's bound to one of the callbacks
var promise = callbacks[message.id];
promise.cb.resolve(message)
promise.cb.resolve(message);
delete(callbacks[message.id]);
} else {
// otherwise emit it
$rootScope.$emit('onMessage', message)
//handlers.handleEvent(message);
$rootScope.$emit('onMessage', message);
}
$rootScope.commands.push("RECV: " + evt.data + " TYPE:" + evt.type);
$rootScope.$apply();
}
};
var connect = function(url,
protocol,
@ -123,16 +122,17 @@ function($rootScope, $q) {
}
ws.onmessage = onmessage;
}
};
var disconnect = function() {
ws.close();
}
};
return {
send: send,
sendAll: sendAll,
connect: connect,
disconnect: disconnect
}
};
}]);

View file

@ -604,7 +604,7 @@
*/
WeeChatProtocol.setId = function(id, command) {
return '(' + id + ') ' + command;
}
};
/**
* Formats a command.