diff --git a/fhem/www/pgm2/fhemweb_iconLabel.js b/fhem/www/pgm2/fhemweb_iconLabel.js index 57047d1c1..d828f50ea 100644 --- a/fhem/www/pgm2/fhemweb_iconLabel.js +++ b/fhem/www/pgm2/fhemweb_iconLabel.js @@ -58,6 +58,8 @@ FW_IconLabelCreate(elName, devName, vArr, currVal, set, params, cmd) if(ilast > 0) { //text only with color if (vArr[i+1] && vArr[i+1].indexOf("@") == 0) { col = vArr[i+1].replace(/@/,''); + if( col.match(/^[A-F0-9]{6}$/)) + col = "#"+col; $(newEl).find("span").html(arg+"") .attr("style","color: "+col+" !important; padding:0.0em 0.3em ") .attr("title",arg); @@ -72,6 +74,8 @@ FW_IconLabelCreate(elName, devName, vArr, currVal, set, params, cmd) }); } else if (vArr[i+1] && vArr[i+1].indexOf("@") > 0) { //text or image with color ico = vArr[i+1].split("@"); + if( ico[1] && ico[1].match(/^[A-F0-9]{6}$/)) + ico[1] = "#"+ico[1]; FW_cmd(FW_root+"?cmd={FW_makeImage('"+vArr[i+1]+"','"+arg+"')}&XHR=1",function(data){ data = data.replace(/\n$/,''); $(newEl).find("span").html((vArr[i+1] == data ? ico[0] : data )+"") diff --git a/fhem/www/pgm2/fhemweb_iconRadio.js b/fhem/www/pgm2/fhemweb_iconRadio.js index 321c7abb7..b2e577557 100644 --- a/fhem/www/pgm2/fhemweb_iconRadio.js +++ b/fhem/www/pgm2/fhemweb_iconRadio.js @@ -153,6 +153,7 @@ FW_iconRadioCreate(elName, devName, vArr, currVal, set, params, cmd) If <icon> is no icon name, the text will be displayed, otherwise the icon. If nothing is specified, the reference value will be displayed.
+
=end html =begin html_DE @@ -198,6 +199,7 @@ FW_iconRadioCreate(elName, devName, vArr, currVal, set, params, cmd) angezeigt, sonst das Icon. Wird <icon> nicht angegeben, wird der Vergleichwert angezeigt.
+
=end html_DE =cut */ diff --git a/fhem/www/pgm2/fhemweb_iconSwitch.js b/fhem/www/pgm2/fhemweb_iconSwitch.js index 013f30f07..f3b617846 100644 --- a/fhem/www/pgm2/fhemweb_iconSwitch.js +++ b/fhem/www/pgm2/fhemweb_iconSwitch.js @@ -92,6 +92,8 @@ FW_iconSwitchCreate(elName, devName, vArr, currVal, set, params, cmd) } if (vArr[i+1] && vArr[i+1].indexOf("@") == 0) { //text only with color col = vArr[i+1].replace(/@/,''); + if( col.match(/^[A-F0-9]{6}$/)) + col = "#"+col; $(newEl).find("span").html(vArr[i]+"") .attr("style","color: "+col+" !important; padding:0.0em 0.3em ") .attr("title",arg); @@ -107,6 +109,8 @@ FW_iconSwitchCreate(elName, devName, vArr, currVal, set, params, cmd) }); } else if (vArr[i+1] && vArr[i+1].indexOf("@") > 0) { //text or image with color ico = vArr[i+1].split("@"); + if( ico[1] && ico[1].match(/^[A-F0-9]{6}$/)) + ico[1] = "#"+ico[1]; FW_cmd(FW_root+"?cmd={FW_makeImage('"+vArr[i+1]+"','"+arg+"')}&XHR=1",function(data){ data = data.replace(/\n$/,''); $(newEl).find("span").html((vArr[i+1] == data ? ico[0] : data )+"")