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

View file

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

View file

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