new idea to reduce stack buffer usage

the JS string can be shortened, by putting the usermod into a variable `ux` that is used instead of repeating the string 'Aduioreactive'.

For now its just an experiment, to see if the idea works on several browsers.
This commit is contained in:
Frank
2024-07-01 02:46:14 +02:00
parent f3cbe75506
commit 9803cecee2

View File

@@ -2723,7 +2723,8 @@ class AudioReactive : public Usermod {
void appendConfigData()
{
oappend(SET_F("addInfo('AudioReactive:help',0,'<button onclick=\"location.href=&quot;https://mm.kno.wled.ge/soundreactive/Sound-Settings&quot;\" type=\"button\">?</button>');"));
oappend(SET_F("ux='AudioReactive';")); // fingers crossed that "ux" isn't already used as JS var, html post parameter or css style
oappend(SET_F("addInfo(ux+':help',0,'<button onclick=\"location.href=&quot;https://mm.kno.wled.ge/soundreactive/Sound-Settings&quot;\" type=\"button\">?</button>');"));
#ifdef ARDUINO_ARCH_ESP32
//WLEDMM: add defaults
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) // -S3/-S2/-C3 don't support analog audio