From 7b030a39d50c190d2b70c9a6533c96b93fbaa242 Mon Sep 17 00:00:00 2001 From: lumapu Date: Wed, 6 Mar 2024 00:02:11 +0100 Subject: [PATCH] 0.8.91 * fix javascript issues #1480 --- scripts/htmlPreprocessorDefines.py | 19 ++++++++++--------- src/CHANGES.md | 3 +++ src/defines.h | 2 +- src/web/html/api.js | 4 +++- src/web/html/includes/nav.html | 3 ++- src/web/html/setup.html | 3 ++- 6 files changed, 21 insertions(+), 13 deletions(-) diff --git a/scripts/htmlPreprocessorDefines.py b/scripts/htmlPreprocessorDefines.py index 8fa54fa4..f8230a90 100644 --- a/scripts/htmlPreprocessorDefines.py +++ b/scripts/htmlPreprocessorDefines.py @@ -14,23 +14,24 @@ def check(inp, lst, pattern): x = re.findall(pattern, line) if len(x) > 0: if line.find("ENDIF_") != -1: - if q.empty(): - error("missing open statement!") - if q.get() != x[0]: - error("wrong close statement!") - keep = True + if not q.empty(): + e = q.get() + if e[0] == x[0]: + keep = e[1] elif line.find("IF_") != -1: - q.put(x[0]) + q.put((x[0], keep)) if keep is True: keep = x[0] in lst elif line.find("E") != -1: if q.empty(): - error("missing open statement!") - keep = not keep + error("(ELSE) missing open statement!") + e = q.get() + q.put(e) + if e[1] is True: + keep = not keep else: if keep is True: out.append(line) - return out def conv(inp, lst): diff --git a/src/CHANGES.md b/src/CHANGES.md index 71a8fa16..876e7f93 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,8 @@ # Development Changes +## 0.8.91 - 2024-03-05 +* fix javascript issues #1480 + ## 0.8.90 - 2024-03-05 * added preprocessor defines to HTML (from platform.ini) to reduce the HTML in size if modules aren't enabled * auto build minimal English versions of ESP8266 and ESP32 diff --git a/src/defines.h b/src/defines.h index 5f156cbb..0d1509cc 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 90 +#define VERSION_PATCH 91 //------------------------------------- typedef struct { diff --git a/src/web/html/api.js b/src/web/html/api.js index 5cce4206..1b51699c 100644 --- a/src/web/html/api.js +++ b/src/web/html/api.js @@ -84,10 +84,12 @@ function topnav() { } function parseNav(obj) { - for(i = 0; i < 13; i++) { + for(i = 0; i < 14; i++) { if(i == 2) continue; var l = document.getElementById("nav"+i); + if(null == l) + continue if(12 == i) { if(obj.cst_lnk.length > 0) { l.href = obj.cst_lnk diff --git a/src/web/html/includes/nav.html b/src/web/html/includes/nav.html index c0d6c470..4718e257 100644 --- a/src/web/html/includes/nav.html +++ b/src/web/html/includes/nav.html @@ -17,7 +17,8 @@ System REST API - {#NAV_DOCUMENTATION} + {#NAV_DOCUMENTATION} + Website {#NAV_ABOUT} Custom Link diff --git a/src/web/html/setup.html b/src/web/html/setup.html index 3536fee3..b6b8929e 100644 --- a/src/web/html/setup.html +++ b/src/web/html/setup.html @@ -1090,7 +1090,6 @@ /*IF_PLUGIN_DISPLAY*/ function parseDisplay(obj, type, system) { - var pinList = esp8266pins; /*IF_ESP32*/ var pinList = esp32pins; /*IF_ESP32-S2*/ @@ -1102,6 +1101,8 @@ /*IF_ESP32-C3*/ pinList = esp32c3pins; /*ENDIF_ESP32-C3*/ + /*ELSE*/ + var pinList = esp8266pins; /*ENDIF_ESP32*/ for(var i of ["disp_pwr"])