FHEMWEB: adding floorplan specific iconPath

git-svn-id: https://svn.fhem.de/fhem/trunk@4585 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2014-01-07 11:41:18 +00:00
parent 597bcae45d
commit dddc5d159c
2 changed files with 14 additions and 3 deletions

View File

@@ -410,6 +410,10 @@ FW_answerCall($)
$FW_tp = ($FW_sp =~ m/smallscreen|touchpad/); $FW_tp = ($FW_sp =~ m/smallscreen|touchpad/);
@FW_iconDirs = grep { $_ } split(":", AttrVal($FW_wname, "iconPath", @FW_iconDirs = grep { $_ } split(":", AttrVal($FW_wname, "iconPath",
"$FW_sp:default:fhemSVG:openautomation")); "$FW_sp:default:fhemSVG:openautomation"));
if($arg =~ m,$FW_ME/floorplan/([a-z0-9.:_]+),i) { # FLOORPLAN: special icondir
unshift @FW_iconDirs, $1;
FW_readIcons($1);
}
# /icons/... => current state of ... # /icons/... => current state of ...
# also used for static images: unintended, but too late to change # also used for static images: unintended, but too late to change
@@ -1814,7 +1818,7 @@ FW_readIconsFrom($$)
my $ldir = ($subdir ? "$dir/$subdir" : $dir); my $ldir = ($subdir ? "$dir/$subdir" : $dir);
my @entries; my @entries;
if(opendir(DH, "$FW_icondir/$ldir")) { if(opendir(DH, "$FW_icondir/$ldir")) {
@entries= sort readdir(DH); # assures order: .gif .ico .jpg .png @entries= sort readdir(DH); # assures order: .gif .ico .jpg .png .svg
closedir(DH); closedir(DH);
} }
@@ -2018,6 +2022,10 @@ FW_Notify($$)
$FW_tp = ($FW_sp =~ m/smallscreen|touchpad/); $FW_tp = ($FW_sp =~ m/smallscreen|touchpad/);
@FW_iconDirs = grep { $_ } split(":", AttrVal($FW_wname, "iconPath", @FW_iconDirs = grep { $_ } split(":", AttrVal($FW_wname, "iconPath",
"$FW_sp:default:fhemSVG:openautomation")); "$FW_sp:default:fhemSVG:openautomation"));
if($h->{iconPath}) {
unshift @FW_iconDirs, $h->{iconPath};
FW_readIcons($h->{iconPath});
}
my ($allSet, $cmdlist, $txt) = FW_devState($dn, "", \%extPage); my ($allSet, $cmdlist, $txt) = FW_devState($dn, "", \%extPage);
($FW_wname, $FW_ME, $FW_ss, $FW_tp, $FW_subdir) = @old; ($FW_wname, $FW_ME, $FW_ss, $FW_tp, $FW_subdir) = @old;

View File

@@ -99,8 +99,11 @@ FW_longpoll()
filter=sa[i].substring(7); filter=sa[i].substring(7);
} }
} }
if(filter == "" && document.getElementById("floorplan")) // floorplan special if(filter == "" && document.getElementById("floorplan")) { //floorplan special
filter=".*"; var name = document.getElementsByTagName("body")[0].getAttribute("id");
name = name.substring(0,name.length-5);
filter=".*;iconPath="+name;
}
var query = document.location.pathname+"?XHR=1"+ var query = document.location.pathname+"?XHR=1"+
"&inform=type=status;filter="+filter+ "&inform=type=status;filter="+filter+