From 139d32a86d23dfe4fcaef28ff40e143f443e6cbb Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 5 May 2020 15:53:16 +0200 Subject: [PATCH] Optimize ESP32 webserver --- tasmota/xdrv_01_webserver.ino | 60 ++++++++++------------------------- 1 file changed, 17 insertions(+), 43 deletions(-) diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 6246377be..fa9b35232 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -246,13 +246,15 @@ const char HTTP_SCRIPT_MODULE_TEMPLATE[] PROGMEM = "q.appendChild(o);" "}" "function ot(g,s){" // g = id and name, s = value - "var p,l,t=qs('#h'+g),u=s&0x001f;" + "var a=s&0xffe0,b=0,c,p,l,t=qs('#h'+g),u=s&0x001f;" "l=t.options.length;" // Remove current options "for(i=l;i;i--){p=t.options[i-1].parentNode;p.removeChild(t.options[i-1]);}" + "l=hs.length;" // Find max indexes for s + "for(i=0;i>=5;" // Add options - "for(i=1;i<=hs[s];i++){ce((i<10)?(' '+i):i,t);}" + "for(i=1;i<=b;i++){ce((i<10)?(' '+i):i,t);}" "eb('h'+g).value=u+1;" // Set selected value - "t.style.visibility=(hs[s]>0)?'':'hidden';" + "t.style.visibility=(b>0)?'':'hidden';" "}" "function sk(s,g){" // s = value, g = id and name "var o=os.replace(/}2/g,\"