Indention fixed

This commit is contained in:
Kai Lauterbach 2023-05-05 10:19:46 +02:00
parent 84dd924a1d
commit fe8b70a5b9

View file

@ -257,20 +257,20 @@ links.forEach(function(link) {
}); });
function createTable() { function createTable() {
var table = document.createElement("table"); var table = document.createElement("table");
// Headerzeile // Headerzeile
var headerRow = document.createElement("tr"); var headerRow = document.createElement("tr");
var headers = ["Stunde", "Minute", "ch1", "ch2", "ch3", "ch4"]; var headers = ["Stunde", "Minute", "ch1", "ch2", "ch3", "ch4"];
for (var i = 0; i < headers.length; i++) { for (var i = 0; i < headers.length; i++) {
var header = document.createElement("th"); var header = document.createElement("th");
header.innerHTML = headers[i]; header.innerHTML = headers[i];
headerRow.appendChild(header); headerRow.appendChild(header);
} }
table.appendChild(headerRow); table.appendChild(headerRow);
// Inhaltszeilen // Inhaltszeilen
for (var row = 0; row < 10; row++) { for (var row = 0; row < 10; row++) {
var contentRow = document.createElement("tr"); var contentRow = document.createElement("tr");
// Spalte "Stunde" // Spalte "Stunde"
@ -306,14 +306,14 @@ for (var row = 0; row < 10; row++) {
} }
table.appendChild(contentRow); table.appendChild(contentRow);
} }
// Button // Button
var button = document.createElement("button"); var button = document.createElement("button");
button.innerHTML = "Save"; button.innerHTML = "Save";
button.classList.add("pure-button"); button.classList.add("pure-button");
button.classList.add("pure-button-primary"); button.classList.add("pure-button-primary");
button.onclick = function() { button.onclick = function() {
var data = []; var data = [];
var rows = table.getElementsByTagName("tr"); var rows = table.getElementsByTagName("tr");
@ -337,11 +337,11 @@ button.onclick = function() {
xhr.open("POST", "http://{{IP_ADDRESS}}/tc_data_save?data=" + encodeURIComponent(json), true); xhr.open("POST", "http://{{IP_ADDRESS}}/tc_data_save?data=" + encodeURIComponent(json), true);
xhr.send(); xhr.send();
}; };
var container = document.getElementById("table-container"); var container = document.getElementById("table-container");
container.innerHTML = ""; container.innerHTML = "";
container.classList.add("pure-form"); container.classList.add("pure-form");
container.appendChild(table); container.appendChild(table);
container.appendChild(button); container.appendChild(button);
} }