From b943702c34d4266db1a442127fbfddfd4f7baaef Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Tue, 7 Jan 2014 11:41:18 +0000 Subject: [PATCH] FHEMWEB: adding floorplan specific iconPath git-svn-id: https://svn.fhem.de/fhem/trunk@4585 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/01_FHEMWEB.pm | 10 +++++++++- fhem/www/pgm2/fhemweb.js | 7 +++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 3e92ff5eb..836d5908e 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -410,6 +410,10 @@ FW_answerCall($) $FW_tp = ($FW_sp =~ m/smallscreen|touchpad/); @FW_iconDirs = grep { $_ } split(":", AttrVal($FW_wname, "iconPath", "$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 ... # also used for static images: unintended, but too late to change @@ -1814,7 +1818,7 @@ FW_readIconsFrom($$) my $ldir = ($subdir ? "$dir/$subdir" : $dir); my @entries; 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); } @@ -2018,6 +2022,10 @@ FW_Notify($$) $FW_tp = ($FW_sp =~ m/smallscreen|touchpad/); @FW_iconDirs = grep { $_ } split(":", AttrVal($FW_wname, "iconPath", "$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); ($FW_wname, $FW_ME, $FW_ss, $FW_tp, $FW_subdir) = @old; diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js index 845e9c0f2..3377850c5 100644 --- a/fhem/www/pgm2/fhemweb.js +++ b/fhem/www/pgm2/fhemweb.js @@ -99,8 +99,11 @@ FW_longpoll() filter=sa[i].substring(7); } } - if(filter == "" && document.getElementById("floorplan")) // floorplan special - filter=".*"; + if(filter == "" && document.getElementById("floorplan")) { //floorplan special + 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"+ "&inform=type=status;filter="+filter+