Merge pull request #420 from glowing-bear/use-strict

[PLS TEST] Use strict
This commit is contained in:
David Cormier 2014-09-17 09:44:32 -04:00
commit 933af6a983
12 changed files with 100 additions and 55 deletions

View file

@ -1,3 +1,6 @@
(function() {
'use strict';
var weechat = angular.module('weechat');
weechat.factory('connection',
@ -7,7 +10,7 @@ weechat.factory('connection',
models,
ngWebsockets) {
protocol = new weeChat.Protocol();
var protocol = new weeChat.Protocol();
// Takes care of the connection and websocket hooks
@ -120,7 +123,7 @@ weechat.factory('connection',
* Handles websocket disconnection
*/
$log.info("Disconnected from relay");
failCallbacks('disconnection');
ngWebsockets.failCallbacks('disconnection');
$rootScope.connected = false;
$rootScope.$emit('relayDisconnect');
if (ssl && evt.code === 1006) {
@ -142,16 +145,11 @@ weechat.factory('connection',
$rootScope.lastError = Date.now();
if (evt.type === "error" && this.readyState !== 1) {
failCallbacks('error');
ngWebsockets.failCallbacks('error');
$rootScope.errorMessage = true;
}
};
protocol.setId = function(id, message) {
return '(' + id + ') ' + message;
};
try {
ngWebsockets.connect(url,
protocol,
@ -275,3 +273,4 @@ weechat.factory('connection',
requestNicklist: requestNicklist
};
}]);
})();