Merge "Status: Fix JSHint violations and commit settings"

This commit is contained in:
Jenkins 2015-07-01 09:00:04 +00:00 committed by Gerrit Code Review
commit aa40a8524f
4 changed files with 34 additions and 9 deletions

1
etc/status/.jshintignore Normal file
View File

@ -0,0 +1 @@
public_html/lib

21
etc/status/.jshintrc Normal file
View File

@ -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"
]
}

View File

@ -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) {
@ -704,7 +705,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;
});
});
@ -900,5 +901,5 @@
app: app,
jq: $jq
};
}
};
}(jQuery));

View File

@ -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);
});
}