Launch update methods asynchronously
This commit is contained in:
parent
b6f204a15e
commit
1651b2f4ef
|
@ -12,32 +12,38 @@ function colourRepo(repo_json, label, container_id) {
|
||||||
$(container_id).find(repoLabel).addClass(bg_class);
|
$(container_id).find(repoLabel).addClass(bg_class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function stringRequests() {
|
||||||
window.addEventListener("DOMContentLoaded", function () {
|
|
||||||
$('[data-json-string-request]').each(function (index, element) {
|
$('[data-json-string-request]').each(function (index, element) {
|
||||||
$.getJSON($(this).attr("data-json-string-request"), function (data) {
|
$.getJSON($(this).attr("data-json-string-request"), function (data) {
|
||||||
console.log(index);
|
|
||||||
$(element).html(data['data']);
|
$(element).html(data['data']);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}, false);
|
function colourRepos() {
|
||||||
|
|
||||||
window.addEventListener("DOMContentLoaded", function () {
|
|
||||||
const container = $('#repo-container');
|
const container = $('#repo-container');
|
||||||
|
|
||||||
$.getJSON(`/repo-list.json`, function (repo_list) {
|
$.getJSON(`/repo-list.json`, function (repo_list) {
|
||||||
repo_list.labels.forEach(function (repo_label) {
|
repo_list.labels.forEach(function (repo_label) {
|
||||||
$.getJSON(`/repo/${repo_label}.json`, function (repo_json) {
|
$.getJSON(`/repo/${repo_label}.json`, function (repo_json) {
|
||||||
colourRepo(repo_json, repo_label, container);
|
colourRepo(repo_json, repo_label, container);
|
||||||
})
|
})
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function createGraphs() {
|
||||||
|
$.getJSON(`/repo-list.json`, function (repo_list) {
|
||||||
|
repo_list.labels.forEach(function (repo_label) {
|
||||||
$.getJSON(`/repo/${repo_label}/monthly-size.json`, function (repo_size_json) {
|
$.getJSON(`/repo/${repo_label}/monthly-size.json`, function (repo_size_json) {
|
||||||
draw_time_series_graph(`repo-${repo_label}-size-graph`, repo_size_json.repo,
|
draw_time_series_graph(`repo-${repo_label}-size-graph`, repo_size_json.repo,
|
||||||
repo_size_json.dates, repo_size_json.units);
|
repo_size_json.dates, repo_size_json.units);
|
||||||
})
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("DOMContentLoaded", function () {
|
||||||
|
setTimeout(createGraphs, 0);
|
||||||
|
setTimeout(colourRepos, 0);
|
||||||
|
setTimeout(stringRequests, 0);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user