Add JSHint stuff. [skip ci]

This commit is contained in:
James Cole
2015-05-24 18:22:41 +02:00
parent 285b77dcb7
commit 8daccbfbb4
13 changed files with 112 additions and 58 deletions

View File

@@ -1,3 +1,4 @@
/* globals google */
google.setOnLoadCallback(drawChart);
@@ -12,13 +13,20 @@ function drawChart() {
}
function getBoxAmounts() {
"use strict";
var boxes = ['in', 'out', 'bills-unpaid', 'bills-paid'];
for (x in boxes) {
for (var x in boxes) {
var box = boxes[x];
$.getJSON('/json/box/' + box).success(function (data) {
$('#box-' + data.box).html(data.amount);
}).fail(function () {
console.log('Failed to get box!')
});
$.getJSON('/json/box/' + box).success(putData).fail(failData);
}
}
function putData(data) {
"use strict";
$('#box-' + data.box).html(data.amount);
}
function failData() {
"use strict";
console.log('Failed to get box!');
}