Commit 246774e5 authored by Daniel Kullmann's avatar Daniel Kullmann

Replaces the remaining calls to jQuery with vanilla JS

parent 3eb45533
Pipeline #171202777 passed with stage
in 38 seconds
......@@ -27,7 +27,6 @@
}
</style>
<script src="./lib/jquery.min.js"></script>
<script src="./lib/Chart.bundle.js"></script>
<script src="./lib/hammerjs.js"></script>
<script src="./lib/chartjs-plugin-zoom.js"></script>
......
This diff is collapsed.
......@@ -84,13 +84,18 @@ function toggleCountrySelection() {
}
function addCountry(sCountry) {
$("#"+sCountry).attr("checked", true);
var oCountryElement = document.getElementById(sCountry);
if (oCountryElement) {
oCountryElement.checked = true;
}
aCountries = [];
$("input[name=country]").each((iIndex, oElement) => {
var aCountryCheckboxes = document.getElementsByName("country");
for (var i = 0; i < aCountryCheckboxes.length; i++) {
var oElement = aCountryCheckboxes.item(i);
if (oElement.checked) {
aCountries.push(oElement.id);
}
});
}
updatePlots();
}
......@@ -127,10 +132,8 @@ function createCountryList(mCountries) {
}
window.onload = function() {
var mPlotOptions = {};
$.ajax({
"url": "./data.json?t="+new Date().getTime(),
"success": function(oResponse) {
fetch("./data.json?t="+new Date().getTime()).then(oResponse => {
oResponse.json().then(oResponse => {
oData = oResponse;
document.getElementById("now").innerText = oData.now;
var aAverageWindowTexts = document.getElementsByClassName("average-window");
......@@ -148,6 +151,6 @@ window.onload = function() {
addCountry("DEU");
}
toggleCountrySelection();
}
});
});
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment