From 38bb3fd7e251fa0b6a77bfb41b8c40e8b0ceb387 Mon Sep 17 00:00:00 2001 From: lumapu Date: Sun, 16 Oct 2022 22:51:55 +0200 Subject: [PATCH] fix #334 added button to index if ntp timeserver was not reachable --- tools/esp8266/defines.h | 2 +- tools/esp8266/html/api.js | 10 ++++++---- tools/esp8266/html/index.html | 33 +++++++++++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/tools/esp8266/defines.h b/tools/esp8266/defines.h index ece45946..7e6f1b77 100644 --- a/tools/esp8266/defines.h +++ b/tools/esp8266/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 5 -#define VERSION_PATCH 19 +#define VERSION_PATCH 20 //------------------------------------- diff --git a/tools/esp8266/html/api.js b/tools/esp8266/html/api.js index 04476f3a..c896c42b 100644 --- a/tools/esp8266/html/api.js +++ b/tools/esp8266/html/api.js @@ -41,13 +41,14 @@ function lbl(htmlfor, val, cl=null, id=null) { return e; } -function inp(name, val, max=32, cl=["text"], id=null) { +function inp(name, val, max=32, cl=["text"], id=null, type=null) { e = document.createElement('input'); e.classList.add(...cl); e.name = name; e.value = val; - e.maxLength = max; + if(null != type) e.maxLength = max; if(null != id) e.id = id; + if(null != type) e.type = type; return e; } @@ -71,9 +72,10 @@ function div(cl) { return e; } -function span(val, cl) { +function span(val, cl=null, id=null) { e = document.createElement('span'); e.innerHTML = val; - e.classList.add(...cl); + if(null != cl) e.classList.add(...cl); + if(null != id) e.id = id; return e; } diff --git a/tools/esp8266/html/index.html b/tools/esp8266/html/index.html index 8bb68c01..01185a14 100644 --- a/tools/esp8266/html/index.html +++ b/tools/esp8266/html/index.html @@ -47,9 +47,29 @@