[extensions-web] js: First steps to making JSLint happy



commit 29bb9498563a5be7937ec55971b6d39a29f2ebe7
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Mar 30 23:13:27 2012 -0400

    js: First steps to making JSLint happy
    
    Add a modeline and put "use strict"; in function scope

 sweettooth/static/js/dbus.js                   |    4 +++-
 sweettooth/static/js/diff.js                   |    4 +++-
 sweettooth/static/js/extensionUtils.js         |    3 ++-
 sweettooth/static/js/extensions.js             |    3 ++-
 sweettooth/static/js/fsui.js                   |    3 ++-
 sweettooth/static/js/hashParamUtils.js         |    4 +++-
 sweettooth/static/js/main.js                   |    7 +++++--
 sweettooth/static/js/messages.js               |    4 +++-
 sweettooth/static/js/modal.js                  |    4 +++-
 sweettooth/static/js/paginator.js              |    3 ++-
 sweettooth/static/js/paginatorUtils.js         |    4 +++-
 sweettooth/static/js/review-main.js            |    4 +++-
 sweettooth/static/js/review.js                 |    3 ++-
 sweettooth/static/js/switch.js                 |    3 ++-
 sweettooth/static/js/templates.js              |    3 ++-
 sweettooth/static/js/uploader.js               |    4 +++-
 sweettooth/static/js/versions/1/main.js        |    4 +++-
 sweettooth/static/js/versions/2/main.js        |    4 +++-
 sweettooth/static/js/versions/3/main.js        |    4 +++-
 sweettooth/static/js/versions/4/main.js        |    4 +++-
 sweettooth/static/js/versions/common/common.js |    4 +++-
 sweettooth/static/js/versions/dummy/main.js    |    4 +++-
 22 files changed, 61 insertions(+), 23 deletions(-)
---
diff --git a/sweettooth/static/js/dbus.js b/sweettooth/static/js/dbus.js
index 0a26c90..baeca74 100644
--- a/sweettooth/static/js/dbus.js
+++ b/sweettooth/static/js/dbus.js
@@ -1,4 +1,4 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 // We need to abuse the plugin system so that we can defer the
 // load completion until our dynamically built requirement is
@@ -9,6 +9,8 @@
 
 define({
     load: function(name, req, onLoad, config) {
+        "use strict";
+
         req(['jquery'], function ($) {
             if (!('SweetTooth' in window)) {
                 try {
diff --git a/sweettooth/static/js/diff.js b/sweettooth/static/js/diff.js
index f6d9727..4c187be 100644
--- a/sweettooth/static/js/diff.js
+++ b/sweettooth/static/js/diff.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery'], function($) {
+    "use strict";
+
     var exports = {};
 
     // Each table row has four columns:
diff --git a/sweettooth/static/js/extensionUtils.js b/sweettooth/static/js/extensionUtils.js
index 9eb2be7..3b18d51 100644
--- a/sweettooth/static/js/extensionUtils.js
+++ b/sweettooth/static/js/extensionUtils.js
@@ -1,6 +1,7 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define([], function() {
+    "use strict";
 
     var exports = {};
 
diff --git a/sweettooth/static/js/extensions.js b/sweettooth/static/js/extensions.js
index fe1bf89..87e6508 100644
--- a/sweettooth/static/js/extensions.js
+++ b/sweettooth/static/js/extensions.js
@@ -1,8 +1,9 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery', 'messages', 'dbus!_', 'extensionUtils', 'templates',
         'paginator', 'switch', 'jquery.tipsy'],
 function($, messages, dbusProxy, extensionUtils, templates) {
+    "use strict";
 
     var ExtensionState = extensionUtils.ExtensionState;
 
diff --git a/sweettooth/static/js/fsui.js b/sweettooth/static/js/fsui.js
index 6ed211c..5bcaa63 100644
--- a/sweettooth/static/js/fsui.js
+++ b/sweettooth/static/js/fsui.js
@@ -1,10 +1,11 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 // FSUI is short for "Filtering and Sorting UI", which contains
 // controls for filtering and sorting the extensions list
 
 define(['jquery', 'dbus!_', 'hashParamUtils', 'modal'],
 function($, dbusProxy, hashParamUtils, modal) {
+    "use strict";
 
     function makeDropdownLink(text) {
         return $('<a>', {'class': 'fsui-dropdown-link'}).
diff --git a/sweettooth/static/js/hashParamUtils.js b/sweettooth/static/js/hashParamUtils.js
index 0c258d5..f7cea30 100644
--- a/sweettooth/static/js/hashParamUtils.js
+++ b/sweettooth/static/js/hashParamUtils.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(["jquery"], function($) {
+    "use strict";
+
     var exports = {};
 
     var getHashParams = exports.getHashParams = function() {
diff --git a/sweettooth/static/js/main.js b/sweettooth/static/js/main.js
index 3c16408..5d666d4 100644
--- a/sweettooth/static/js/main.js
+++ b/sweettooth/static/js/main.js
@@ -1,9 +1,12 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery', 'messages', 'modal',
          'extensions', 'uploader', 'fsui',
          'jquery.cookie', 'jquery.jeditable',
-         'jquery.timeago', 'jquery.raty'], function($, messages, modal) {
+         'jquery.timeago', 'jquery.raty'],
+function($, messages, modal) {
+    "use strict";
+
     if (!$.ajaxSettings.headers)
         $.ajaxSettings.headers = {};
 
diff --git a/sweettooth/static/js/messages.js b/sweettooth/static/js/messages.js
index 2bcc199..b092e6c 100644
--- a/sweettooth/static/js/messages.js
+++ b/sweettooth/static/js/messages.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery'], function($) {
+    "use strict";
+
     var exports = {};
 
     var $container = $('#message_container');
diff --git a/sweettooth/static/js/modal.js b/sweettooth/static/js/modal.js
index ebf8ed7..aef6b5c 100644
--- a/sweettooth/static/js/modal.js
+++ b/sweettooth/static/js/modal.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery'], function($) {
+    "use strict";
+
     var exports = {};
 
     // jQuery doesn't support events in the capturing phase natively.
diff --git a/sweettooth/static/js/paginator.js b/sweettooth/static/js/paginator.js
index 5646b2c..c168d5d 100644
--- a/sweettooth/static/js/paginator.js
+++ b/sweettooth/static/js/paginator.js
@@ -1,6 +1,7 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery', 'hashParamUtils', 'paginatorUtils', 'dbus!_', 'templates'], function($, hashParamUtils, paginatorUtils, dbusProxy, templates) {
+    "use strict";
 
     $.fn.paginatorify = function(context) {
         if (!this.length)
diff --git a/sweettooth/static/js/paginatorUtils.js b/sweettooth/static/js/paginatorUtils.js
index e493736..61ebe7a 100644
--- a/sweettooth/static/js/paginatorUtils.js
+++ b/sweettooth/static/js/paginatorUtils.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery', 'hashParamUtils'], function($, hashParamUtils) {
+    "use strict";
+
     var exports = {};
 
     function makeLink(pageNumber, styleClass, text) {
diff --git a/sweettooth/static/js/review-main.js b/sweettooth/static/js/review-main.js
index 96cdeb0..7c6a628 100644
--- a/sweettooth/static/js/review-main.js
+++ b/sweettooth/static/js/review-main.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery', 'main', 'review'], function($) {
+    "use strict";
+
     $(document).ready(function() {
         $("#files").reviewify(false);
         $("#diff").reviewify(true);
diff --git a/sweettooth/static/js/review.js b/sweettooth/static/js/review.js
index c66775e..a8f7e68 100644
--- a/sweettooth/static/js/review.js
+++ b/sweettooth/static/js/review.js
@@ -1,6 +1,7 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery', 'diff'], function($, diff) {
+    "use strict";
 
     var REVIEW_URL_BASE = '/review/ajax';
 
diff --git a/sweettooth/static/js/switch.js b/sweettooth/static/js/switch.js
index 163d8fb..ff60a18 100644
--- a/sweettooth/static/js/switch.js
+++ b/sweettooth/static/js/switch.js
@@ -1,6 +1,7 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery'], function($) {
+    "use strict";
 
     function getSides($elem, $slider) {
         var bl = parseInt($elem.css('borderLeftWidth')) + parseInt($slider.css('borderLeftWidth'));
diff --git a/sweettooth/static/js/templates.js b/sweettooth/static/js/templates.js
index e3f54f4..3a24daf 100644
--- a/sweettooth/static/js/templates.js
+++ b/sweettooth/static/js/templates.js
@@ -1,6 +1,7 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['templates/templatedata', 'mustache'], function(templatedata) {
+    "use strict";
 
     var exports = {};
     var partials = exports._P = {};
diff --git a/sweettooth/static/js/uploader.js b/sweettooth/static/js/uploader.js
index 872643f..7228c31 100644
--- a/sweettooth/static/js/uploader.js
+++ b/sweettooth/static/js/uploader.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery'], function($) {
+    "use strict";
+
     $.fn.uploadify = function(url) {
         var $elem = $(this), $input = $elem.find('input');
         if ($elem.data('uploader'))
diff --git a/sweettooth/static/js/versions/1/main.js b/sweettooth/static/js/versions/1/main.js
index e08161c..2cac412 100644
--- a/sweettooth/static/js/versions/1/main.js
+++ b/sweettooth/static/js/versions/1/main.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery', 'dbus!API', 'versions/common/common'], function($, API, common) {
+    "use strict";
+
     var proxy = {
         IsDummy: false,
 
diff --git a/sweettooth/static/js/versions/2/main.js b/sweettooth/static/js/versions/2/main.js
index aaccc90..ffe8dff 100644
--- a/sweettooth/static/js/versions/2/main.js
+++ b/sweettooth/static/js/versions/2/main.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery', 'dbus!API', 'versions/common/common'], function($, API, common) {
+    "use strict";
+
     var proxy = {
         IsDummy: false,
 
diff --git a/sweettooth/static/js/versions/3/main.js b/sweettooth/static/js/versions/3/main.js
index 4a1ee0c..8542e74 100644
--- a/sweettooth/static/js/versions/3/main.js
+++ b/sweettooth/static/js/versions/3/main.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery', 'dbus!API', 'versions/common/common'], function($, API, common) {
+    "use strict";
+
     var proxy = {
         IsDummy: false,
 
diff --git a/sweettooth/static/js/versions/4/main.js b/sweettooth/static/js/versions/4/main.js
index 1975db4..947b26a 100644
--- a/sweettooth/static/js/versions/4/main.js
+++ b/sweettooth/static/js/versions/4/main.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery', 'dbus!API', 'versions/common/common'], function($, API, common) {
+    "use strict";
+
     var proxy = {
         IsDummy: false,
 
diff --git a/sweettooth/static/js/versions/common/common.js b/sweettooth/static/js/versions/common/common.js
index c5bdf57..c5b6a9d 100644
--- a/sweettooth/static/js/versions/common/common.js
+++ b/sweettooth/static/js/versions/common/common.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery', 'dbus!API'], function($, API) {
+    "use strict";
+
     function _makePromise(result) {
         // Make a new completed promise -- when we move the plugin
         // over to async, we can remove this.
diff --git a/sweettooth/static/js/versions/dummy/main.js b/sweettooth/static/js/versions/dummy/main.js
index 1125895..83b2f6c 100644
--- a/sweettooth/static/js/versions/dummy/main.js
+++ b/sweettooth/static/js/versions/dummy/main.js
@@ -1,6 +1,8 @@
-"use strict";
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery'], function($) {
+    "use strict";
+
     var proxy = {
         IsDummy: true,
         ShellVersion: undefined,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]