From 0107dabb2dd48b3f3649246820c58cb6d94aaa97 Mon Sep 17 00:00:00 2001 From: David Cormier Date: Sun, 9 Feb 2014 19:33:35 -0500 Subject: [PATCH] Fix jshint errors --- js/glowingbear.js | 5 ++--- js/websockets.js | 16 ++++++++-------- js/weechat.js | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index fbf462a..c7815ed 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -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, - }) + }); }; diff --git a/js/websockets.js b/js/websockets.js index ae1249b..be989b9 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -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 - } + }; + }]); diff --git a/js/weechat.js b/js/weechat.js index 959a72d..a66d7b7 100644 --- a/js/weechat.js +++ b/js/weechat.js @@ -604,7 +604,7 @@ */ WeeChatProtocol.setId = function(id, command) { return '(' + id + ') ' + command; - } + }; /** * Formats a command.