JSLinting
authorJack Allnutt <m2ys4u@Gmail.com>
Thu, 15 Sep 2011 13:16:02 +0000 (14:16 +0100)
committerJack Allnutt <m2ys4u@Gmail.com>
Thu, 15 Sep 2011 13:16:02 +0000 (14:16 +0100)
js/front.js
js/gateway.js
node/app.js

index ba6ceacfcb95d0929448bfe3dbcd90094deecf60..ce921cffd3cc17faf660acaea725c3ba9f24f6f1 100644 (file)
@@ -81,10 +81,10 @@ kiwi.front = {
 
         // Add the resizer for the userlist
         $('<div id="nicklist_resize" style="position:absolute; cursor:w-resize; width:5px;"></div>').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');
index 1f30647694476d46492c15385e2c90b8fab111c9..b8719bb98e2ab3254b3727d846eac6c32f3a083e 100644 (file)
@@ -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,
index a8a9999621718dcba40ea8d909b5c966edd268a4..5f33851eeeee2f6a1e98ed8019d40366c16acef9 100644 (file)
@@ -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: '',