From 8532b9dc68c5d566318ac756d4c978342bb256ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AF=E3=81=8A=E3=82=8A=E3=82=93?= Date: Sun, 16 Jun 2024 11:20:21 +0000 Subject: [PATCH 1/2] Fix: not saves numeric values --- index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index acb7a1d..c13fd3d 100644 --- a/index.html +++ b/index.html @@ -146,7 +146,13 @@ if (this.getAttribute("type") === "checkbox") { config[this.id] = this.checked; } else if (this.getAttribute("type") === "text") { - config[this.id] = this.value; + // get configu value type + let type = typeof (config[this.id]); + if (type === "number") { + config[this.id] = parseInt(this.value, 10); + } else { + config[this.id] = this.value; + } } else if (this.localName === "select") { let maybeNumeric = parseInt(this.value, 10); if (isNaN(maybeNumeric)) { From 83373031632d74cee7c396cd62d216adfcfbc217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AF=E3=81=8A=E3=82=8A=E3=82=93?= Date: Sun, 16 Jun 2024 11:26:32 +0000 Subject: [PATCH 2/2] fix #2