From e6c3d2fde947b720f8b2e87f213b71b42bb003ce Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Thu, 25 Feb 2021 20:17:07 +0000 Subject: [PATCH] 01_FHEMWEB.pm: the default style is renamed to f11 (Forum #90983) git-svn-id: https://svn.fhem.de/fhem/trunk@23825 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/01_FHEMWEB.pm | 44 +++++++++++++++++++++----------------- fhem/www/pgm2/f18style.css | 1 + 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index cb56f98ce..3ef3096cb 100644 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -795,6 +795,18 @@ FW_serveSpecial($$$$) return FW_returnFileAsStream("$dir/$fname", "", $FW_RETTYPE, 0, $cacheable); } +sub +FW_setStylesheet() +{ + $FW_sp = AttrVal($FW_wname, "stylesheetPrefix", "f18"); + $FW_sp = "" if($FW_sp eq "default"); + $FW_sp =~ s/^f11//; # Compatibility, #90983 + $FW_ss = ($FW_sp =~ m/smallscreen/); + $FW_tp = ($FW_sp =~ m/smallscreen|touchpad/); + @FW_iconDirs = grep { $_ } split(":", AttrVal($FW_wname, "iconPath", + "${FW_sp}:fhemSVG:openautomation:default")); +} + sub FW_answerCall($) { @@ -805,12 +817,7 @@ FW_answerCall($) $FW_RETTYPE = "text/html; charset=$FW_encoding"; $MW_dir = "$attr{global}{modpath}/FHEM"; - $FW_sp = AttrVal($FW_wname, "stylesheetPrefix", "f18"); - $FW_ss = ($FW_sp =~ m/smallscreen/); - $FW_tp = ($FW_sp =~ m/smallscreen|touchpad/); - my $spDir = ($FW_sp eq "default" ? "" : "$FW_sp:"); - @FW_iconDirs = grep { $_ } split(":", AttrVal($FW_wname, "iconPath", - "${spDir}fhemSVG:openautomation:default")); + FW_setStylesheet(); @FW_fhemwebjs = ("fhemweb.js"); push(@FW_fhemwebjs, "$FW_sp.js") if(-r "$FW_dir/pgm2/$FW_sp.js"); @@ -2418,18 +2425,21 @@ FW_style($$) FW_pO $end; } elsif($a[1] eq "select") { - my @fl = grep { $_ !~ m/(floorplan|dashboard)/ } - FW_fileList("$FW_cssdir/.*style.css"); + my %smap= ( ""=>"f11", "touchpad"=>"f11touchpad", + "smallscreen"=>"f11smallscreen"); + my @fl = map { $_ =~ s/style.css//; $smap{$_} ? $smap{$_} : $_ } + grep { $_ !~ m/(svg_|floorplan|dashboard)/ } + FW_fileList("$FW_cssdir/.*style.css"); FW_addContent($start); FW_pO "