From bfc9264abed7ef43e92c011e4c2059ac48ce0f7a Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Sun, 17 Jan 2016 11:34:22 +0000 Subject: [PATCH] 01_FHEMWEB.pm: better style reloading when changing styles (Forum #47581) git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@10552 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/01_FHEMWEB.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 83819f054..9663c6f0a 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -111,6 +111,7 @@ my $FW_jsonp; # jasonp answer (sending function calls to the client) my $FW_headerlines; # my $FW_chash; # client fhem hash my $FW_encoding="UTF-8"; +my $FW_styleStamp=time(); ##################################### @@ -806,7 +807,7 @@ FW_answerCall($) ######################## # CSS my $cssTemplate = ""; - FW_pO sprintf($cssTemplate, "pgm2/style.css"); + FW_pO sprintf($cssTemplate, "pgm2/style.css?v=$FW_styleStamp"); FW_pO sprintf($cssTemplate, "pgm2/jquery-ui.min.css"); map { FW_pO sprintf($cssTemplate, $_); } split(" ", AttrVal($FW_wname, "CssFiles", "")); @@ -1904,6 +1905,8 @@ FW_style($$) } else { CommandAttr(undef, "$FW_wname stylesheetPrefix $a[2]"); } + $FW_styleStamp = time(); + $FW_RET =~ s,/style.css\?v=\d+,/style.css?v=$FW_styleStamp,; FW_pO "${start}Reload the page in the browser.$end"; } elsif($a[1] eq "edit") {