From f7c2e68887c4cea24bbcd29c9e1fd13212a9c7f3 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 2 Nov 2014 00:36:55 -0400 Subject: [PATCH] jshint --- src/js/dashboard.js | 6 ++++-- src/js/info.js | 2 ++ src/js/messaging-handlers.js | 2 +- src/js/settings.js | 3 +++ src/js/tab.js | 2 +- src/js/udom.js | 4 +++- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/js/dashboard.js b/src/js/dashboard.js index b8a4580..d58462d 100644 --- a/src/js/dashboard.js +++ b/src/js/dashboard.js @@ -19,6 +19,8 @@ Home: https://github.com/gorhill/uMatrix */ +/* global uDom */ + /******************************************************************************/ (function() { @@ -30,13 +32,13 @@ var loadDashboardPanel = function(hash) { uDom('.tabButton').forEach(function(button){ button.toggleClass('selected', button.attr('data-dashboard-panel-url') === url); }); -} +}; /******************************************************************************/ var onTabClickHandler = function() { loadDashboardPanel(window.location.hash); -} +}; /******************************************************************************/ diff --git a/src/js/info.js b/src/js/info.js index 74cb100..9c46b1a 100644 --- a/src/js/info.js +++ b/src/js/info.js @@ -19,6 +19,8 @@ Home: https://github.com/gorhill/uMatrix */ +/* global messaging, uDom */ + /******************************************************************************/ (function() { diff --git a/src/js/messaging-handlers.js b/src/js/messaging-handlers.js index 8b17450..4ad19ec 100644 --- a/src/js/messaging-handlers.js +++ b/src/js/messaging-handlers.js @@ -444,7 +444,7 @@ var onMessage = function(request, sender, callback) { response = { temporaryRules: µm.tMatrix.toString(), permanentRules: µm.pMatrix.toString() - } + }; break; case 'setUserRules': diff --git a/src/js/settings.js b/src/js/settings.js index 530dc99..37ec23f 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -19,6 +19,9 @@ Home: https://github.com/gorhill/uMatrix */ +/* global messaging, uDom */ +/* jshint multistr: true */ + /******************************************************************************/ (function() { diff --git a/src/js/tab.js b/src/js/tab.js index b528d67..1918b1b 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -78,7 +78,7 @@ return 'http://' + uri.scheme + '-scheme/'; } return ''; -} +}; /******************************************************************************/ diff --git a/src/js/udom.js b/src/js/udom.js index 2391260..d6668d5 100644 --- a/src/js/udom.js +++ b/src/js/udom.js @@ -229,9 +229,11 @@ DOMList.prototype.toArray = function() { /******************************************************************************/ DOMList.prototype.forEach = function(fn) { - for ( var i = 0; i < this.nodes.length; i++ ) { + var n = this.nodes.length; + for ( var i = 0; i < n; i++ ) { fn(this.at(i), i); } + return this; }; /******************************************************************************/