From b2babd9502c070ab677872d9d83a3ddac716a593 Mon Sep 17 00:00:00 2001 From: Xaver Date: Tue, 19 Dec 2023 16:52:15 +0100 Subject: [PATCH 1/6] inline iro.js and rangetouch.js --- wled00/data/index.htm | 46 +++---------------------------------------- wled00/data/index.js | 16 ++++++++++++++- 2 files changed, 18 insertions(+), 44 deletions(-) diff --git a/wled00/data/index.htm b/wled00/data/index.htm index 8dd26b7b7..fead9f1ba 100644 --- a/wled00/data/index.htm +++ b/wled00/data/index.htm @@ -7,49 +7,7 @@ WLED - + @@ -378,6 +336,8 @@
+ + diff --git a/wled00/data/index.js b/wled00/data/index.js index 3fed6d20e..9b4d0f0af 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -15,6 +15,7 @@ var pcMode = false, pcModeA = false, lastw = 0, wW; var simplifiedUI = false; var tr = 7; var d = document; +const ranges = RangeTouch.setup('input[type="range"]', {}); var palettesData; var fxdata = []; var pJson = {}, eJson = {}, lJson = {}; @@ -23,7 +24,7 @@ var pN = "", pI = 0, pNum = 0; var pmt = 1, pmtLS = 0, pmtLast = 0; var lastinfo = {}; var isM = false, mw = 0, mh=0; -var ws, cpick, ranges, wsRpt=0; +var ws, cpick, wsRpt=0; var cfg = { theme:{base:"dark", bg:{url:"", rnd: false, rndGrayscale: false, rndBlur: false}, alpha:{bg:0.6,tab:0.8}, color:{bg:""}}, comp :{colors:{picker: true, rgb: false, quick: true, hex: false}, @@ -39,6 +40,19 @@ var hol = [ [0,0,1,1,"https://images.alphacoders.com/119/1198800.jpg"] // new year ]; +cpick = new iro.ColorPicker("#picker", { + width: 260, + wheelLightness: false, + wheelAngle: 270, + wheelDirection: "clockwise", + layout: [{ + component: iro.ui.Wheel, + options: {} + }] +}); +cpick.on("input:end", () => {setColor(1);}); +cpick.on("color:change", () => {updatePSliders()}); + function handleVisibilityChange() {if (!d.hidden && new Date () - lastUpdate > 3000) requestJson();} function sCol(na, col) {d.documentElement.style.setProperty(na, col);} function gId(c) {return d.getElementById(c);} From 5cd8f5681e29849c51495973953d5f7125d62606 Mon Sep 17 00:00:00 2001 From: Woody Date: Tue, 19 Dec 2023 20:41:56 +0100 Subject: [PATCH 2/6] Remove unused feedback function This was probably forgotten to remove in commit d6c0642a02ab2c43391ebb7db3ef353f21cbe5fb --- wled00/data/index.htm | 1 - 1 file changed, 1 deletion(-) diff --git a/wled00/data/index.htm b/wled00/data/index.htm index fead9f1ba..60737030c 100644 --- a/wled00/data/index.htm +++ b/wled00/data/index.htm @@ -7,7 +7,6 @@ WLED - From 0a91d60677b527205d76d0ad6fbfbb8088d9c083 Mon Sep 17 00:00:00 2001 From: Woody Date: Tue, 19 Dec 2023 21:12:07 +0100 Subject: [PATCH 3/6] add onload event to body --- wled00/data/index.htm | 2 +- wled00/data/index.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wled00/data/index.htm b/wled00/data/index.htm index 60737030c..f261409ce 100644 --- a/wled00/data/index.htm +++ b/wled00/data/index.htm @@ -9,7 +9,7 @@ WLED - +
Loading WLED UI...
diff --git a/wled00/data/index.js b/wled00/data/index.js index 9b4d0f0af..b33ea53ed 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -24,7 +24,7 @@ var pN = "", pI = 0, pNum = 0; var pmt = 1, pmtLS = 0, pmtLast = 0; var lastinfo = {}; var isM = false, mw = 0, mh=0; -var ws, cpick, wsRpt=0; +var ws, wsRpt=0; var cfg = { theme:{base:"dark", bg:{url:"", rnd: false, rndGrayscale: false, rndBlur: false}, alpha:{bg:0.6,tab:0.8}, color:{bg:""}}, comp :{colors:{picker: true, rgb: false, quick: true, hex: false}, @@ -40,7 +40,7 @@ var hol = [ [0,0,1,1,"https://images.alphacoders.com/119/1198800.jpg"] // new year ]; -cpick = new iro.ColorPicker("#picker", { +var cpick = new iro.ColorPicker("#picker", { width: 260, wheelLightness: false, wheelAngle: 270, @@ -50,8 +50,6 @@ cpick = new iro.ColorPicker("#picker", { options: {} }] }); -cpick.on("input:end", () => {setColor(1);}); -cpick.on("color:change", () => {updatePSliders()}); function handleVisibilityChange() {if (!d.hidden && new Date () - lastUpdate > 3000) requestJson();} function sCol(na, col) {d.documentElement.style.setProperty(na, col);} @@ -274,6 +272,8 @@ function onLoad() selectSlot(0); updateTablinks(0); + cpick.on("input:end", () => {setColor(1);}); + cpick.on("color:change", () => {updatePSliders()}); pmtLS = localStorage.getItem('wledPmt'); // Load initial data From 1140f5f6cbd1adb3ef1f9b3c76c7422fc64d2687 Mon Sep 17 00:00:00 2001 From: Woody Date: Tue, 19 Dec 2023 21:18:33 +0100 Subject: [PATCH 4/6] Update version to 2312190 --- wled00/wled.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/wled.h b/wled00/wled.h index 6204a3d78..868403d3d 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2312160 +#define VERSION 2312190 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG From 201daf8ff3be9aa479050895e874134b10d13248 Mon Sep 17 00:00:00 2001 From: Woody Date: Tue, 19 Dec 2023 22:40:24 +0100 Subject: [PATCH 5/6] Remove /iro.js and /rangetouch.js --- tools/cdata.js | 10 ---------- wled00/wled_server.cpp | 16 ---------------- 2 files changed, 26 deletions(-) diff --git a/tools/cdata.js b/tools/cdata.js index 09816f959..bb9854608 100644 --- a/tools/cdata.js +++ b/tools/cdata.js @@ -380,16 +380,6 @@ const char PAGE_dmxmap[] PROGMEM = R"=====()====="; file: "favicon.ico", name: "favicon", method: "binary", - }, - { - file: "iro.js", - name: "iroJs", - method: "gzip" - }, - { - file: "rangetouch.js", - name: "rangetouchJs", - method: "gzip" } ], "wled00/html_other.h" diff --git a/wled00/wled_server.cpp b/wled00/wled_server.cpp index f5152fe99..7d9d1a1ec 100644 --- a/wled00/wled_server.cpp +++ b/wled00/wled_server.cpp @@ -254,22 +254,6 @@ void initServer() size_t len, bool final) {handleUpload(request, filename, index, data, len, final);} ); - server.on("/iro.js", HTTP_GET, [](AsyncWebServerRequest *request){ - if (handleIfNoneMatchCacheHeader(request)) return; - AsyncWebServerResponse *response = request->beginResponse_P(200, "application/javascript", iroJs, iroJs_length); - response->addHeader(FPSTR(s_content_enc),"gzip"); - setStaticContentCacheHeaders(response); - request->send(response); - }); - - server.on("/rangetouch.js", HTTP_GET, [](AsyncWebServerRequest *request){ - if (handleIfNoneMatchCacheHeader(request)) return; - AsyncWebServerResponse *response = request->beginResponse_P(200, "application/javascript", rangetouchJs, rangetouchJs_length); - response->addHeader(FPSTR(s_content_enc),"gzip"); - setStaticContentCacheHeaders(response); - request->send(response); - }); - createEditHandler(correctPIN); #ifndef WLED_DISABLE_OTA From 86d2998dc061b3f9d6788a9df1cb65cc0efdc0e0 Mon Sep 17 00:00:00 2001 From: Xaver Date: Wed, 20 Dec 2023 11:30:28 +0100 Subject: [PATCH 6/6] Add reference to old loading of iro.js and rangetouch.js --- wled00/data/index.htm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wled00/data/index.htm b/wled00/data/index.htm index f261409ce..ae685bdb9 100644 --- a/wled00/data/index.htm +++ b/wled00/data/index.htm @@ -335,6 +335,11 @@
+ +