From 749903d4766584522a2817ee260ea46eb77c287b Mon Sep 17 00:00:00 2001 From: Jens Maus Date: Fri, 16 Oct 2026 21:12:24 +0000 Subject: [PATCH] webui: update the header logo and message dots only on changes This applies OpenCCU rootfs patch 0153-WebUI-Fix-ImproveImgUpdates.patch: - header.htm contains both the normal and the red header logo; the red one is hidden by default. SwitchOnFlashLight() and SwitchOffFlashLight() only toggle the "hidden" class instead of reloading the logo image. - setAlarmMessageCount() and setServiceMessageCount() only update the message text and the dot image if they actually changed. --- src/webui/www/ise/htm/header.htm | 5 ++- src/webui/www_source/ise/js/functions.js | 40 +++++++++++------------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/webui/www/ise/htm/header.htm b/src/webui/www/ise/htm/header.htm index f010df8c..40d08193 100644 --- a/src/webui/www/ise/htm/header.htm +++ b/src/webui/www/ise/htm/header.htm @@ -7,7 +7,10 @@ - + + + + diff --git a/src/webui/www_source/ise/js/functions.js b/src/webui/www_source/ise/js/functions.js index af6b28f3..243484f0 100644 --- a/src/webui/www_source/ise/js/functions.js +++ b/src/webui/www_source/ise/js/functions.js @@ -154,37 +154,31 @@ resetReGaSaveButton = function () { }; setAlarmMessageCount = function (count) { - if ($("msgAlarms")) { - //$("msgAlarms").innerHTML = "${Alarmmeldungen} (" + count + ")"; - $("msgAlarms").innerHTML = translateKey('alarmMsg') + " (" + count + ")"; - - } - if (count === 0) { - if ($("imgAlarms")) { - $("imgAlarms").src = "/ise/img/dot/green.png"; + const newMsg = translateKey('alarmMsg') + " (" + count + ")"; + if ($("msgAlarms").innerHTML !== newMsg) { + $("msgAlarms").innerHTML = newMsg; } } - else { - if ($("imgAlarms")) { - $("imgAlarms").src = "/ise/img/dot/red.png"; + if ($("imgAlarms")) { + const newImg = (count === 0 ? '/ise/img/dot/green.png' : '/ise/img/dot/red.png'); + if ($("imgAlarms").getAttribute('src') !== newImg) { + $("imgAlarms").src = newImg; } } }; setServiceMessageCount = function (count) { if ($("msgServices")) { - $("msgServices").innerHTML = translateKey('serviceMsg') + " (" + count + ")"; - - } - if (count === 0) { - if ($("imgServices")) { - $("imgServices").src = "/ise/img/dot/green.png"; + const newMsg = translateKey('serviceMsg') + " (" + count + ")"; + if ($("msgServices").innerHTML !== newMsg) { + $("msgServices").innerHTML = newMsg; } } - else { - if ($("imgServices")) { - $("imgServices").src = "/ise/img/dot/yellow.png"; + if ($("imgServices")) { + const newImg = (count === 0 ? '/ise/img/dot/green.png' : '/ise/img/dot/yellow.png'); + if ($("imgServices").getAttribute('src') !== newImg) { + $("imgServices").src = newImg; } } }; @@ -2262,12 +2256,14 @@ StopFlashing = function() SwitchOnFlashLight = function() { - if ($("headerLogo")) { $("headerLogo").src = "/ise/img/homematic_logo_small_red.png"; } + if ($("headerLogo")) { $("headerLogo").classList.add('hidden'); } + if ($("headerLogoRed")) { $("headerLogoRed").classList.remove('hidden'); } }; SwitchOffFlashLight = function() { - if ($("headerLogo")) { $("headerLogo").src = "/ise/img/homematic_logo_small.png"; } + if ($("headerLogo")) { $("headerLogo").classList.remove('hidden'); } + if ($("headerLogoRed")) { $("headerLogoRed").classList.add('hidden'); } }; getAjaxLoadElem = function() {