From 402b63d68088abfa4bd4052b4cc9d5c4fd8dc3f0 Mon Sep 17 00:00:00 2001 From: Kai Lauterbach Date: Fri, 5 May 2023 11:07:56 +0200 Subject: [PATCH] Input types of tc edit modified --- firmware/data/bottom.js | 26 ++++++++++++++++---------- firmware/html/bottom.js | 26 ++++++++++++++++---------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/firmware/data/bottom.js b/firmware/data/bottom.js index fe6a7d6..3d0c2f0 100644 --- a/firmware/data/bottom.js +++ b/firmware/data/bottom.js @@ -230,11 +230,14 @@ table.appendChild(headerRow); for (var row = 0; row < 10; row++) { var contentRow = document.createElement("tr"); var hourCell = document.createElement("td"); -var hourInput = document.createElement("input"); -hourInput.type = "number"; -hourInput.min = 0; -hourInput.max = 23; -hourCell.appendChild(hourInput); +var hourSelect = document.createElement("select"); +for (var hour = 0; hour <= 23; hour++) { +var option = document.createElement("option"); +option.value = hour; +option.text = hour.toString().padStart(2, "0"); +hourSelect.appendChild(option); +} +hourCell.appendChild(hourSelect); contentRow.appendChild(hourCell); var minuteCell = document.createElement("td"); var minuteSelect = document.createElement("select"); @@ -248,11 +251,14 @@ minuteCell.appendChild(minuteSelect); contentRow.appendChild(minuteCell); for (var channel = 1; channel <= 4; channel++) { var channelCell = document.createElement("td"); -var channelInput = document.createElement("input"); -channelInput.type = "number"; -channelInput.min = 0; -channelInput.max = 100; -channelCell.appendChild(channelInput); +var channelSelect = document.createElement("select"); +for (var i = 0; i <= 100; i++) { +var option = document.createElement("option"); +option.value = i; +option.text = i.toString(); +channelSelect.appendChild(option); +} +channelCell.appendChild(channelSelect); contentRow.appendChild(channelCell); } table.appendChild(contentRow); diff --git a/firmware/html/bottom.js b/firmware/html/bottom.js index 38d3db1..8f7b39e 100644 --- a/firmware/html/bottom.js +++ b/firmware/html/bottom.js @@ -279,11 +279,14 @@ function createTable() { // Spalte "Stunde" var hourCell = document.createElement("td"); - var hourInput = document.createElement("input"); - hourInput.type = "number"; - hourInput.min = 0; - hourInput.max = 23; - hourCell.appendChild(hourInput); + var hourSelect = document.createElement("select"); + for (var hour = 0; hour <= 23; hour++) { + var option = document.createElement("option"); + option.value = hour; + option.text = hour.toString().padStart(2, "0"); + hourSelect.appendChild(option); + } + hourCell.appendChild(hourSelect); contentRow.appendChild(hourCell); // Spalte "Minute" @@ -301,11 +304,14 @@ function createTable() { // Spalten "ch1" bis "ch4" for (var channel = 1; channel <= 4; channel++) { var channelCell = document.createElement("td"); - var channelInput = document.createElement("input"); - channelInput.type = "number"; - channelInput.min = 0; - channelInput.max = 100; - channelCell.appendChild(channelInput); + var channelSelect = document.createElement("select"); + for (var i = 0; i <= 100; i++) { + var option = document.createElement("option"); + option.value = i; + option.text = i.toString(); + channelSelect.appendChild(option); + } + channelCell.appendChild(channelSelect); contentRow.appendChild(channelCell); }