2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

devStateIcon {}: returned html may contain newlines

Color for SVG: multiple fill lines accepted


git-svn-id: https://svn.fhem.de/fhem/trunk@3374 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-06-30 19:54:49 +00:00
parent 5d7984eb3c
commit 87229473f6

View File

@ -125,7 +125,8 @@ FHEMWEB_Initialize($)
###############
# Initialize internal structures
map { addToAttrList($_) } ( "webCmd", "icon", "devStateIcon", "sortby", "devStateStyle");
map { addToAttrList($_) } ( "webCmd", "icon", "devStateIcon",
"sortby", "devStateStyle");
InternalTimer(time()+60, "FW_closeOldClients", 0, 0);
$FW_dir = "$attr{global}{modpath}/www";
@ -2079,9 +2080,9 @@ FW_makeImage(@)
if($col) {
$col =~ s/@//;
$col = "#$col" if($col =~ m/^([A-F0-9]{6})$/);
$data =~ s/fill="#000000"/fill="$col"/;
$data =~ s/fill="#000000"/fill="$col"/g;
} else {
$data =~ s/fill="#000000"//;
$data =~ s/fill="#000000"//g;
}
return $data;
} else {
@ -2263,7 +2264,7 @@ FW_dev2image($)
if(defined($devStateIcon) && $devStateIcon =~ m/^{.*}$/) {
my ($html, $link) = eval $devStateIcon;
Log 1, "devStateIcon $name: $@" if($@);
return ($html, $link, 1) if(defined($html) && $html =~ m/^<.*>$/);
return ($html, $link, 1) if(defined($html) && $html =~ m/^<.*>$/s);
$devStateIcon = $html;
}