mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 10:46:53 +00:00
fhemweb_iconLabel.js, fhemweb_iconSwitch.js: improved color handling
git-svn-id: https://svn.fhem.de/fhem/trunk@15224 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
29e0487052
commit
30f89f9024
@ -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 )+"")
|
||||
|
@ -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.<br>
|
||||
</li>
|
||||
<br>
|
||||
=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.<br>
|
||||
</li>
|
||||
<br>
|
||||
=end html_DE
|
||||
=cut
|
||||
*/
|
||||
|
@ -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 )+"")
|
||||
|
Loading…
x
Reference in New Issue
Block a user