diff options
author | Timo Tijhof <krinklemail@gmail.com> | 2015-04-02 01:13:19 +0100 |
---|---|---|
committer | Timo Tijhof <krinklemail@gmail.com> | 2015-06-29 14:04:02 +0100 |
commit | 4be9f749cc19cb766d104f99a94ffcf9c3959a46 (patch) | |
tree | 6b6bec8d441408e4d78cab23f872cbf6b0b90a88 /etc | |
parent | af8ff837d54143e05ce10339ca0018cc449119ae (diff) | |
download | zuul-4be9f749cc19cb766d104f99a94ffcf9c3959a46.tar.gz |
Status: Fix JSHint violations and commit settings
> jquery.zuul.js:19: Use the function form of "use strict".
> jquery.zuul.js:42: 'options' is already defined.
> jquery.zuul.js:619: 'app' is already defined.
> jquery.zuul.js:645: Missing semicolon.
> jquery.zuul.js:900: Missing semicolon.
> jquery.zuul.js:704: 'x' is defined but never used.
> zuul.app.js:22: 'default_layout' is not defined.
> zuul.app.js:37: '$container' is not defined.
> zuul.app.js:38: '$container' is not defined.
> zuul.app.js:38: 'default_layout' is not defined.
> zuul.app.js:20: 'zuul_build_dom' is defined but never used.
> zuul.app.js:42: 'zuul_start' is defined but never used.
Change-Id: I65b86f004ef1bb09651cd916630267ca297b2492
Diffstat (limited to 'etc')
-rw-r--r-- | etc/status/.jshintignore | 1 | ||||
-rw-r--r-- | etc/status/.jshintrc | 21 | ||||
-rw-r--r-- | etc/status/public_html/jquery.zuul.js | 15 | ||||
-rw-r--r-- | etc/status/public_html/zuul.app.js | 6 |
4 files changed, 34 insertions, 9 deletions
diff --git a/etc/status/.jshintignore b/etc/status/.jshintignore new file mode 100644 index 000000000..218f297df --- /dev/null +++ b/etc/status/.jshintignore @@ -0,0 +1 @@ +public_html/lib diff --git a/etc/status/.jshintrc b/etc/status/.jshintrc new file mode 100644 index 000000000..15bd571e7 --- /dev/null +++ b/etc/status/.jshintrc @@ -0,0 +1,21 @@ +{ + "bitwise": true, + "eqeqeq": true, + "forin": true, + "latedef": true, + "newcap": true, + "noarg": true, + "noempty": true, + "nonew": true, + "undef": true, + "unused": true, + + "strict": false, + "laxbreak": true, + "browser": true, + + "predef": [ + "jQuery", + "zuul" + ] +} diff --git a/etc/status/public_html/jquery.zuul.js b/etc/status/public_html/jquery.zuul.js index 40a5d4dce..61b25c7b0 100644 --- a/etc/status/public_html/jquery.zuul.js +++ b/etc/status/public_html/jquery.zuul.js @@ -16,9 +16,10 @@ // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations // under the License. -'use strict'; (function ($) { + 'use strict'; + function set_cookie(name, value) { document.cookie = name + '=' + value + '; path=/'; } @@ -39,7 +40,7 @@ } $.zuul = function(options) { - var options = $.extend({ + options = $.extend({ 'enabled': true, 'graphite_url': '', 'source': 'status.json', @@ -72,7 +73,7 @@ hideGrid: true, target: [ "color(stats.gauges.zuul.pipeline." + pipeline_name - + ".current_changes, '6b8182')" + + ".current_changes, '6b8182')" ] }); } @@ -616,7 +617,7 @@ var app = { schedule: function (app) { - var app = app || this; + app = app || this; if (!options.enabled) { setTimeout(function() {app.schedule(app);}, 5000); return; @@ -642,7 +643,7 @@ this.emit('update-start'); var app = this; - var $msg = $(options.msg_id) + var $msg = $(options.msg_id); xhr = $.getJSON(options.source) .done(function (data) { if ('message' in data) { @@ -701,7 +702,7 @@ var newimg = new Image(); var parts = url.split('#'); newimg.src = parts[0] + '#' + new Date().getTime(); - $(newimg).load(function (x) { + $(newimg).load(function () { zuul_sparkline_urls[name] = newimg.src; }); }); @@ -897,5 +898,5 @@ app: app, jq: $jq }; - } + }; }(jQuery)); diff --git a/etc/status/public_html/zuul.app.js b/etc/status/public_html/zuul.app.js index 640437b00..6321af804 100644 --- a/etc/status/public_html/zuul.app.js +++ b/etc/status/public_html/zuul.app.js @@ -17,9 +17,11 @@ // License for the specific language governing permissions and limitations // under the License. +/*exported zuul_build_dom, zuul_start */ + function zuul_build_dom($, container) { // Build a default-looking DOM - default_layout = '<div class="container">' + var default_layout = '<div class="container">' + '<h1>Zuul Status</h1>' + '<p>Real-time status monitor of Zuul, the pipeline manager between Gerrit and Workers.</p>' + '<div class="zuul-container" id="zuul-container">' @@ -34,7 +36,7 @@ function zuul_build_dom($, container) { $(function ($) { // DOM ready - $container = $(container); + var $container = $(container); $container.html(default_layout); }); } |