From 80c584e701454a1de478da8ed0d79e9383b83b8c Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Thu, 15 Sep 2011 14:16:02 +0100 Subject: [PATCH] JSLinting --- js/front.js | 26 +++++++++++++++----------- js/gateway.js | 4 ++-- node/app.js | 4 ++-- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/js/front.js b/js/front.js index ba6ceac..ce921cf 100644 --- a/js/front.js +++ b/js/front.js @@ -81,10 +81,10 @@ kiwi.front = { // Add the resizer for the userlist $('
').appendTo('#kiwi'); - $('#nicklist_resize').draggable({axis: "x", drag: function() { - var t = $(this); - - var new_width = $(document).width() - parseInt(t.css('left'), 10); + $('#nicklist_resize').draggable({axis: "x", drag: function () { + var t = $(this), + new_width = $(document).width() - parseInt(t.css('left'), 10); + new_width = new_width - parseInt($('#kiwi .userlist').css('margin-left'), 10); new_width = new_width - parseInt($('#kiwi .userlist').css('margin-right'), 10); @@ -204,7 +204,7 @@ kiwi.front = { }, doLayoutSize: function () { - var kiwi, toolbars, ul, n_top, n_bottom; + var kiwi, toolbars, ul, n_top, n_bottom, nl; kiwi = $('#kiwi'); if (kiwi.width() < 330 && !kiwi.hasClass('small_kiwi')) { @@ -225,8 +225,8 @@ kiwi.front = { $('#kiwi .windows').css({top: n_top + 'px', bottom: n_bottom + 'px'}); ul.css({top: n_top + 'px', bottom: n_bottom + 'px'}); - var nl = $('#nicklist_resize'); - nl.css({top: n_top + 'px', bottom: n_bottom + 'px', left: $(document).width()-ul.outerWidth(true)}); + nl = $('#nicklist_resize'); + nl.css({top: n_top + 'px', bottom: n_bottom + 'px', left: $(document).width() - ul.outerWidth(true)}); }, @@ -345,7 +345,9 @@ kiwi.front = { case '/k': case '/kick': - if (typeof parts[1] === 'undefined') return; + if (typeof parts[1] === 'undefined') { + return; + } kiwi.gateway.raw('KICK ' + kiwi.front.cur_channel.name + ' ' + msg.split(' ', 2)[1]); break; @@ -568,8 +570,8 @@ kiwi.front = { if (kiwi.front.nickStripPrefix($(this).text()) === data.effected_nick) { if (data.mode.split('')[0] === '+') { - for (i in kiwi.gateway.user_prefixes) { - if (kiwi.gateway.user_prefixes[i].mode == data.mode.split('')[1]) { + for (i = 0; i < kiwi.gateway.user_prefixes.length; i++) { + if (kiwi.gateway.user_prefixes[i].mode === data.mode.split('')[1]) { new_nick_text = kiwi.gateway.user_prefixes[i].symbol + data.effected_nick; break; } @@ -1366,7 +1368,9 @@ Tabview.prototype.close = function () { Tabview.prototype.setUserlistWidth = function (new_width) { var w, u; - if (typeof new_width === 'number') this.userlist_width = new_width; + if (typeof new_width === 'number') { + this.userlist_width = new_width; + } w = $('#windows'); u = $('#kiwi .userlist'); diff --git a/js/gateway.js b/js/gateway.js index 1f30647..b8719bb 100644 --- a/js/gateway.js +++ b/js/gateway.js @@ -1,5 +1,5 @@ -/*jslint browser: true, confusion: true, sloppy: true, maxerr: 50, indent: 4 */ -/*globals io, $, kiwi_server */ +/*jslint devel: true, browser: true, confusion: true, sloppy: true, maxerr: 50, indent: 4 */ +/*globals io, $, kiwi, kiwi_server */ kiwi.gateway = { revision: 16, diff --git a/node/app.js b/node/app.js index a8a9999..5f33851 100644 --- a/node/app.js +++ b/node/app.js @@ -1,4 +1,4 @@ -/*jslint continue: true, forin: true, regexp: true, undef: false, node: true, nomen: true, plusplus: true, maxerr: 50, indent: 4 */ +/*jslint sloppy: true, continue: true, forin: true, regexp: true, undef: false, node: true, nomen: true, plusplus: true, maxerr: 50, indent: 4 */ /*globals kiwi_root */ var tls = null; var net = null; @@ -197,7 +197,7 @@ this.parseIRCMessage = function (websocket, ircSocket, data) { channel = parts[1]; num_users = parts[2]; modes = msg.trailing.split(' ', 1); - topic = msg.trailing.substring(msg.trailing.indexOf(' ')+1); + topic = msg.trailing.substring(msg.trailing.indexOf(' ') + 1); websocket.sendClientEvent('list_channel', { server: '', -- 2.25.1