From 4cec234c09e7b3913a6b6b560c9ce6d9949f1e9a Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 12 May 2012 11:06:43 +0000 Subject: [PATCH] smallstyle slider prep and eventMap Status fix git-svn-id: https://svn.fhem.de/fhem/trunk@1558 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/webfrontend/pgm2/01_FHEMWEB.pm | 8 ++++---- fhem/webfrontend/pgm2/smallscreenstyle.css | 10 +++++----- fhem/webfrontend/pgm2/style.css | 4 +++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/fhem/webfrontend/pgm2/01_FHEMWEB.pm b/fhem/webfrontend/pgm2/01_FHEMWEB.pm index 616b724d3..c5d35b646 100755 --- a/fhem/webfrontend/pgm2/01_FHEMWEB.pm +++ b/fhem/webfrontend/pgm2/01_FHEMWEB.pm @@ -2074,7 +2074,6 @@ FW_devState($$) $state = "" if(!defined($state)); $hasOnOff = (!$webCmd && $allSets =~ m/\bon\b/ && $allSets =~ m/\boff\b/); - my $txt = $state; if(defined(AttrVal($d, "showtime", undef))) { my $v = $defs{$d}{READINGS}{state}{TIME}; @@ -2094,14 +2093,15 @@ FW_devState($$) } $txt = "
$txt
"; - if($webCmd) { my @a = split(":", $webCmd); $link = "cmd.$d=set $d $a[0]"; $cmdlist = $webCmd; } elsif($hasOnOff && !$cmdlist) { - $link = "cmd.$d=set $d ".($state eq "on" ? "off":"on"); + my (undef, $nstate) = ReplaceEventMap($d, [$d, $state], 0); + $nstate = $state if(!defined($nstate)); + $link = "cmd.$d=set $d " . ($nstate eq "on" ? "off" : "on"); $cmdlist = "on:off"; } @@ -2120,7 +2120,7 @@ FW_devState($$) $txt = "$txt"; } elsif($FW_ss || $FW_tp) { - $txt = "$txt"; + $txt ="$txt"; } else { $txt = "$txt"; diff --git a/fhem/webfrontend/pgm2/smallscreenstyle.css b/fhem/webfrontend/pgm2/smallscreenstyle.css index 2bfb7f75b..5e4131752 100644 --- a/fhem/webfrontend/pgm2/smallscreenstyle.css +++ b/fhem/webfrontend/pgm2/smallscreenstyle.css @@ -60,9 +60,9 @@ div#block { border:1px solid gray; background: #F8F8E0; padding:0.7em; } div#dist { padding-top:0.3em; } -.set,.attr { margin-bottom:5px; float:left; } -.slider { float:right; width:250px; height:26px; background:#F0F0D8; - margin-left:10px; -moz-border-radius:8px; border-radius:8px; } -.handle { position:absolute; cursor:pointer; width:50px; height:20px; line-height:20px; +.set,.attr { margin-bottom:5px; float:left;} +.slider { float:right; width:320px; height:26px; } +.set .slider { background:#F0F0D8; } +.handle { position:relative; cursor:pointer; width:50px; + height:20px; line-height:20px; user-select:none; border:3px solid; color:#278727; text-align:center; } -.downText { margin-top:2px; } diff --git a/fhem/webfrontend/pgm2/style.css b/fhem/webfrontend/pgm2/style.css index de40b430d..1e57a1834 100644 --- a/fhem/webfrontend/pgm2/style.css +++ b/fhem/webfrontend/pgm2/style.css @@ -35,6 +35,8 @@ a img { border-style:none; } .slider { float:right; width:250px; height:26px; } .set .slider { margin-left:10px; background:#F0F0D8; -moz-border-radius:8px; border-radius:8px; } -.handle { position:relative; cursor:pointer; width:50px; height:20px; line-height:20px; +.handle { position:relative; cursor:pointer; width:50px; + height:20px; line-height:20px; + -moz-user-select:none; user-select:none; border:3px solid; color:#278727; text-align:center; } .downText { margin-top:2px; }