From ad9909ced92630962d696b88c9b788c1d6dc3b25 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 24 Sep 2011 13:20:14 +0000 Subject: [PATCH] Massive smallscreen optimiztions. git-svn-id: https://svn.fhem.de/fhem/trunk@1021 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/docs/commandref.html | 43 +- fhem/webfrontend/pgm2/01_FHEMWEB.pm | 631 +++++++++----------- fhem/webfrontend/pgm2/back.png | Bin 0 -> 2673 bytes fhem/webfrontend/pgm2/style.css | 17 +- fhem/webfrontend/pgm2/style_smallscreen.css | 52 +- fhem/webfrontend/pgm2/style_touchpad.css | 40 +- 6 files changed, 368 insertions(+), 415 deletions(-) create mode 100644 fhem/webfrontend/pgm2/back.png diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html index 1fb9e6e74..cbd68243d 100644 --- a/fhem/docs/commandref.html +++ b/fhem/docs/commandref.html @@ -2000,7 +2000,6 @@ A line ending with \ will be concatenated with the next one, so long lines The fhem module will emulate a CUL device, so the CUL_HM module can be used to define HomeMatic devices.

- In order to use it with fhem you must disable the encryption first with the "HomeMatic Lan Interface Configurator" (which is part of the supplied Windows software), by selecting the device, "Change IP Settings", @@ -2693,8 +2692,10 @@ A line ending with \ will be concatenated with the next one, so long lines humidity $h
actuator $vp %
desired-temp: $t
+ tempList$wd: hh:mm $t hh:mm $t ...
ValveErrorPosition $dname: $vep %
ValveOffset $dname: $of %
+ windowopentemp-$tchan: $t (sensor:$tdev)
  • HM-CC-VD:
    actuator $vp %
    actuator:movement_open
    @@ -2744,6 +2745,11 @@ A line ending with \ will be concatenated with the next one, so long lines T: $t H: $h
    temperature $t
    humidity $h
    +
  • WDC7000
    + T: $t H: $h AP: $ap
    + temperature $t
    + humidity $h
    + airpress $ap
  • winMatic
    contact closed
    contact open
    @@ -5936,9 +5942,6 @@ href="http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=29870">U module implements 2 drivers in one. It is the "physical" part for the EnOcean module.

    - Note: this module requires the Device::SerialPort or Win32::SerialPort module. -

    - Define
    @@ -6364,7 +6361,11 @@ href="http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=29870">U
  • hiddenroom
    - Komma separated list of rooms to "hide", i.e. not to show. + Komma separated list of rooms to "hide", i.e. not to show. Special + values are input and detail, in which case no input areas or link to + the detailed views are shown (although they still can be addressed + through url manipulation). The list can also contain values from the + additional "Howto/Wiki/FAQ" block.

  • diff --git a/fhem/webfrontend/pgm2/01_FHEMWEB.pm b/fhem/webfrontend/pgm2/01_FHEMWEB.pm index 60d4e6a7d..a19107d34 100755 --- a/fhem/webfrontend/pgm2/01_FHEMWEB.pm +++ b/fhem/webfrontend/pgm2/01_FHEMWEB.pm @@ -15,11 +15,11 @@ sub FW_doDetail($); sub FW_fatal($); sub FW_fileList($); sub FW_logWrapper($); -sub FW_makeTable($$$$$$$$); +sub FW_makeEdit($$$); +sub FW_makeTable($$); sub FW_ReadIcons(); sub FW_roomOverview($); sub FW_select($$$); -sub FW_showArchive($); sub FW_showLog($); sub FW_showRoom(); sub FW_showWeblink($$$); @@ -31,7 +31,6 @@ sub FW_updateHashes(); sub FW_zoomLink($$$); sub pF($@); sub pH(@); -sub pHJava(@); sub pHPlain(@); sub pO(@); @@ -39,7 +38,7 @@ use vars qw($FW_dir); # moddir (./FHEM), needed by SVG use vars qw($FW_ME); # webname (default is fhem), needed by 97_GROUP use vars qw($FW_ss); # is smallscreen, needed by 97_GROUP/95_VIEW use vars qw($FW_tp); # is touchpad (iPad / etc) -use vars qw(%FW_types);# device types, for sorting, for 97_GROUP/95_VIEW +use vars qw(%FW_types);# device types, for 97_GROUP/95_VIEW my $zlib_loaded; my $try_zlib = 1; @@ -65,6 +64,7 @@ my %FW_types; # device types, for sorting my $FW_wname; # Web instance name my @FW_zoom; # "qday", "day","week","month","year" my %FW_zoom; # the same as @FW_zoom +my %FW_hiddenroom; # hash of hidden rooms ##################################### @@ -380,7 +380,6 @@ FW_AnswerCall($) $cmd !~ /^showlog/ && $cmd !~ /^logwrapper/ && $cmd !~ /^toweblink/ && - $cmd !~ /^showarchive/ && $cmd !~ /^style / && $cmd !~ /^edit/); @@ -445,7 +444,12 @@ FW_AnswerCall($) $FW_cmdret =~ s//>/g; pO "
    "; - pO "
    $FW_cmdret
    "; + $FW_cmdret = "
    $FW_cmdret
    " if($FW_cmdret =~ m/\n/); + if($FW_ss) { + pO "
    $FW_cmdret
    "; + } else { + pO $FW_cmdret; + } pO "
    "; } @@ -454,7 +458,6 @@ FW_AnswerCall($) FW_doDetail($FW_detail) if($FW_detail); FW_showRoom() if($FW_room && !$FW_detail); FW_logWrapper($cmd) if($cmd =~ /^logwrapper/); - FW_showArchive($cmd) if($cmd =~ m/^showarchive/); pO ""; return 0; } @@ -493,9 +496,9 @@ FW_digestCgi($) if($p eq "data") { $FW_data = $v; } } - $cmd.=" $dev{$c}" if($dev{$c}); - $cmd.=" $arg{$c}" if($arg{$c}); - $cmd.=" $val{$c}" if($val{$c}); + $cmd.=" $dev{$c}" if(defined($dev{$c})); + $cmd.=" $arg{$c}" if(defined($arg{$c})); + $cmd.=" $val{$c}" if(defined($val{$c})); return $cmd; } @@ -528,60 +531,46 @@ FW_updateHashes() ############################## sub -FW_makeTable($$$$$$$$) +FW_makeTable($$) { - my($d,$t,$header,$hash,$clist,$ccmd,$makelink,$cmd) = (@_); + my($name, $hash) = (@_); - return if(!$hash && !$clist); - - $t = "EM" if($t =~ m/^EM.*$/); # EMWZ,EMEM,etc. - $t = "KS300" if($t eq "HMS"); - pO " "; - - # Header - pO " "; - foreach my $h (split(",", $header)) { - pO ""; - } - pO ""; - if($clist) { - pO ""; - my @al = map { s/[:;].*//;$_ } split(" ", $clist); - pO ""; - pO ""; - pO ""; - pO ""; - } + return if(!$hash || !int(keys %{$hash})); + pO "
    $h
    " . FW_select("arg.$ccmd$d",\@al,undef) . "" . FW_textfield("val.$ccmd$d", 20) . "" . - FW_submit("cmd.$ccmd$d", $ccmd) . - FW_hidden("dev.$ccmd$d", $d) . - "
    "; my $row = 1; - foreach my $v (sort keys %{$hash}) { - my $r = ref($hash->{$v}); - next if($r && ($r ne "HASH" || !defined($hash->{$v}{VAL}))); - pF " ", $row?"odd":"even"; - $row = ($row+1)%2; - if($makelink && $FW_reldoc) { - # no pH, want to open extra browser - pO ""; - } else { - pO ""; - } + foreach my $n (sort keys %{$hash}) { + my $r = ref($hash->{$n}); + next if($r && ($r ne "HASH" || !defined($hash->{$n}{VAL}))); + pF " ", ($row&1)?"odd":"even"; + $row++; + + my $val = $hash->{$n}; + + if($n eq "DEF" && !$FW_hiddenroom{"input"}) { + FW_makeEdit($name, $n, $val); - if(ref($hash->{$v})) { - pO ""; - pO "" if($hash->{$v}{TIME}); } else { - if($v eq "DEF") { - FW_makeEdit($d, $t, "modify", $hash->{$v}); + + pO ""; + if(ref($val)) { + my ($v, $t) = ($val->{VAL}, $val->{TIME}); + if($FW_ss) { + $t = ($t ? "
    $t
    " : ""); + pO ""; + + } else { + $t = "" if(!$t); + pO ""; + + } + } else { - pO ""; - } - } + pO ""; - pH "cmd.$d=$cmd $d $v&detail=$d", $cmd, 1 - if($cmd); + } + + } pO ""; } @@ -592,42 +581,16 @@ FW_makeTable($$$$$$$$) ############################## sub -FW_showArchive($) +FW_makeSelect($$$) { - my ($arg) = @_; - my (undef, $d) = split(" ", $arg); - - my $fn = $defs{$d}{logfile}; - if($fn =~ m,^(.+)/([^/]+)$,) { - $fn = $2; - } - $fn = AttrVal($d, "archivedir", "") . "/" . $fn; - my $t = $defs{$d}{TYPE}; - - pO "
    "; - pO "
    $v$v
    $hash->{$v}{VAL}$hash->{$v}{TIME}
    $n
    $v$t
    $v$t$hash->{$v}
    $val
    "; - pO "", $row?"odd":"even"; - $row = ($row+1)%2; - if(!defined($l)) { - pH "cmd=logwrapper $d text $f", "text", 1; - } else { - foreach my $ln (split(",", $l)) { - my ($lt, $name) = split(":", $ln); - $name = $lt if(!$name); - pH "cmd=logwrapper $d $lt $f", $name, 1; - } - } - pO ""; - } - - pO "
    "; - - my $row = 0; - my $l = AttrVal($d, "logtype", undef); - foreach my $f (FW_fileList($fn)) { - pF "
    $f
    "; - pO "
    "; - pO ""; + my ($d, $cmd, $list) = @_; + return if(!$list || $FW_hiddenroom{input}); + my @al = map { s/[:;].*//;$_ } split(" ", $list); + pO FW_submit("cmd.$cmd$d", $cmd) . + " $d" . + FW_hidden("dev.$cmd$d", $d); + pO FW_select("arg.$cmd$d",\@al,undef); + pO FW_textfield("val.$cmd$d", 30); } @@ -640,83 +603,96 @@ FW_doDetail($) pO "
    "; pO FW_hidden("detail", $d); - $FW_room = AttrVal($d, "room", undef); - $FW_room = $1 if($FW_room && $FW_room =~ m/^([^,]*),/); # Get first of a Multi-Room my $t = $defs{$d}{TYPE}; pO "
    "; pO "
    "; - pH "cmd=delete $d", "Delete $d"; + FW_makeSelect($d, "set", getAllSets($d)); + FW_makeTable($d, $defs{$d}); + pO "Readings" if($defs{$d}{READINGS}); + FW_makeTable($d, $defs{$d}{READINGS}); + FW_makeSelect($d, "attr", getAllAttr($d)); + FW_makeTable($d, $attr{$d}); - my $pgm = "Javascript:" . - "s=document.getElementById('edit').style;". - "s.display = s.display=='none' ? 'block' : 'none';". - "s=document.getElementById('disp').style;". - "s.display = s.display=='none' ? 'block' : 'none';"; - pHJava $pgm, "Modify $d"; - pH "room=$FW_room", "Back:$FW_room" if($FW_ss); + if($t eq "FileLog" ) { + pO " "; + my $row = 1; + foreach my $f (FW_fileList($defs{$d}{logfile})) { + my $nr; + foreach my $ln (split(",", AttrVal($d, "logtype", "text"))) { + my ($lt, $name) = split(":", $ln); + $name = $lt if(!$name); + pF " ", ($row&1)?"odd":"even"; + pF "", ($nr ? "" : $f); + pH "cmd=logwrapper $d $lt $f", + "
    $name
    ", 1, "dval"; + pO ""; + $nr++; $row++; + } + } + pO "
    %s
    "; + } - pO "
    "; - FW_makeTable($d, $t, - "State,Value,Measured", - $defs{$d}{READINGS}, getAllSets($d), "set", 0, undef); - FW_makeTable($d, $t, "Internal,Value", - $defs{$d}, "", undef, 0, undef); - FW_makeTable($d, $t, - "Attribute,Value,Action", - $attr{$d}, getAllAttr($d), "attr", 1, - $d eq "global" ? "" : "deleteattr"); pO "
    "; FW_showWeblink($d, $defs{$d}{LINK}, $defs{$d}{WLTYPE}) if($t eq "weblink"); + pO "
    "; + pH "$FW_reldoc#${t}", "Device specific help"; + pO "

    "; pO "
    "; pO "
    "; + } ############## -# Room overview +# Header, Zoom-Icons & list of rooms at the left. sub FW_roomOverview($) { my ($cmd) = @_; + foreach my $r (split(",",AttrVal($FW_wname, "hiddenroom", ""))) { + $FW_hiddenroom{$r} = 1; + } + + ############## + # LOGO + if($FW_detail && $FW_ss) { + $FW_room = AttrVal($FW_detail, "room", undef); + $FW_room = $1 if($FW_room && $FW_room =~ m/^([^,]*),/); + $FW_room = "" if(!$FW_room); + pHPlain "room=$FW_room", + "
    "; + pO "
    $FW_detail details
    "; + return; + + } else { + my $logo = $FW_ss ? "fhem_smallscreen.png" : "fhem.png"; + pO "
    "; + + } + + ############## # HEADER pO "
    "; pO "
    "; pO '"; - FW_zoomLink("zoom=-1", "Zoom-in.png", "zoom in"); - FW_zoomLink("zoom=1", "Zoom-out.png","zoom out"); - FW_zoomLink("off=-1", "Prev.png", "prev"); - FW_zoomLink("off=1", "Next.png", "next"); - } - } - } - pO FW_textfield("cmd", $FW_ss ? 15 : 40) if(!$tf_done); + pO FW_hidden("room", "$FW_room") if($FW_room); + pO FW_textfield("cmd", $FW_ss ? 25 : 40); pO "
    '; - my $tf_done; - if($FW_room) { - pO FW_hidden("room", "$FW_room"); - # plots navigation buttons - if(!$FW_detail || $defs{$FW_detail}{TYPE} eq "weblink") { - if(FW_calcWeblink(undef,undef)) { - pO FW_textfield("cmd", $FW_ss ? 15 : 40); - $tf_done = 1; - pO "  
    "; pO "
    "; pO "
    "; - ############## - # LOGO - my $logo = $FW_ss ? "fhem_smallscreen.png" : "fhem.png"; - pO "
    "; - ############## # MENU my (@list1, @list2); push(@list1, ""); push(@list2, ""); + + ######################## + # FW Extensions if(defined($data{FWEXT})) { foreach my $k (sort keys %{$data{FWEXT}}) { my $h = $data{FWEXT}{$k}; @@ -728,41 +704,43 @@ FW_roomOverview($) } $FW_room = "" if(!$FW_room); - my %hiddenroom; - foreach my $r (split(",",AttrVal($FW_wname, "hiddenroom", ""))) { - $hiddenroom{$r} = 1; - } + ########################## + # Rooms and other links foreach my $r (sort keys %FW_rooms) { - next if($r eq "hidden" || $hiddenroom{$r}); + next if($r eq "hidden" || $FW_hiddenroom{$r}); push @list1, $r; push @list2, "$FW_ME?room=$r"; } - push(@list1, "Everything"); push(@list2, "$FW_ME?room=all"); - push(@list1, ""); push(@list2, ""); - push(@list1, "Howto"); push(@list2, "$FW_ME/HOWTO.html"); - push(@list1, "Wiki"); push(@list2, "http://fhemwiki.de"); - push(@list1, "FAQ"); push(@list2, "$FW_ME/faq.html"); - push(@list1, "Details"); push(@list2, "$FW_ME/commandref.html"); - push(@list1, "Examples"); push(@list2, "$FW_ME/cmd=style%20examples"); - push(@list1, "Edit files"); push(@list2, "$FW_ME/cmd=style%20list"); - push(@list1, ""); push(@list2, ""); + my @list = ( + "Everything", "$FW_ME?room=all", + "", "", + "Howto", "$FW_ME/HOWTO.html", + "Wiki", "http://fhemwiki.de", + "FAQ", "$FW_ME/faq.html", + "Details", "$FW_ME/commandref.html", + "Examples", "$FW_ME/cmd=style%20examples", + "Edit files", "$FW_ME/cmd=style%20list", + "", ""); + my $lastname = ","; # Avoid double "". + for(my $idx = 0; $idx < @list; $idx+= 2) { + next if($FW_hiddenroom{$list[$idx]} || $list[$idx] eq $lastname); + push @list1, $list[$idx]; + push @list2, $list[$idx+1]; + $lastname = $list[$idx]; + } + pO "
    "; pO ""; if($FW_ss) { # Make a selection sensitive dropdown list - pO " "; + pO " "; } else { @@ -770,7 +748,7 @@ FW_roomOverview($) my ($l1, $l2) = ($list1[$idx], $list2[$idx]); if(!$l1) { pO "
    "; + pO "
    " if($idx); - pO "
    " if($idx); - pO " " + pO " "; pO "
    " if($idx", $l1 eq $FW_room ? " class=\"sel\"" : ""; @@ -790,143 +768,128 @@ FW_roomOverview($) ######################## -# Generate the html output: i.e present the data +# Show the overview of devices in one room sub FW_showRoom() { + return if(!$FW_room); + # (re-) list the icons FW_ReadIcons(); pO "
    "; pO "
    "; - pO "
    \n
    "; # Need for equal width of subtables + pO " "; - foreach my $type (sort keys %FW_types) { - - ################# - # Check if there is a device of this type in the room - if($FW_room && $FW_room ne "all") { - next if(!grep { $FW_rooms{$FW_room}{$_} } keys %{$FW_types{$type}} ); - } + my @list = ($FW_room eq "all" ? keys %defs : keys %{$FW_rooms{$FW_room}}); + my $rf = ($FW_room ? "&room=$FW_room" : ""); # stay in the room - my $rf = ($FW_room ? "&room=$FW_room" : ""); # stay in the room + my $row=1; + foreach my $d (sort @list) { + next if(IsIgnored($d)); + my $type = $defs{$d}{TYPE}; + next if(!$type || $type eq "weblink"); - ############################ - # Print the table headers - my @roomDevs = grep { $FW_room && ($FW_room eq "all" || - $FW_rooms{$FW_room}{$_}) } - sort keys %{$FW_types{$type}}; - my $allSets = " " . getAllSets($roomDevs[0]) . " "; + my $allSets = " " . getAllSets($d) . " "; my $hasOnOff = ($allSets =~ m/ on / && $allSets =~ m/ off /); if(!$hasOnOff) { # Check the eventMap - my $em = AttrVal($roomDevs[0], "eventMap", "") . " "; + my $em = AttrVal($d, "eventMap", "") . " "; $hasOnOff = ($em =~ m/:on / && $em =~ m/:off /); } + pF " ", ($row&1)?"odd":"even"; + + if($FW_hiddenroom{detail}) { + pO ""; - my $th; - my $id = "class=\"block\""; - if($hasOnOff) { - $th = "$type
    $d
    StateSet to"; - } elsif($allSets =~ m/ desired-temp /) { - $th = "DeviceMeasuredSet to"; - } elsif($type eq "at") { $th = "Scheduled commands (at)"; - } elsif($type eq "weblink") { $th = ""; $id = ""; } else { - $th = $type; + pH "detail=$d", $d, 1, "col1"; + } - pO " "; - pO " " if($th && !$FW_ss); - my $row=1; - foreach my $d (@roomDevs) { - next if($FW_room && $FW_room ne "all" && - !$FW_rooms{$FW_room}{$d}); + $row++; - pF " ", $row?"odd":"even"; - $row = ($row+1)%2; - my $v = $defs{$d}{STATE}; + my $state = $defs{$d}{STATE}; + $state = "" if(!defined($state)); + my $txt = $state; + if(defined(AttrVal($d, "showtime", undef))) { + $txt = $defs{$d}{READINGS}{state}{TIME}; + + } elsif($allSets =~ m/ desired-temp /) { + $txt = ReadingsVal($d, "measured-temp", ""); + $txt =~ s/ .*//; + $txt .= "°" + + } else { + my $icon; + $icon = FW_dev2image($d); + $txt = "\"$txt\"/" if($icon); + + } + + pO "
    $th
    "; + pO ""; if($hasOnOff) { - my $iv = $v; # icon value - my $iname = ""; - - if(defined(AttrVal($d, "showtime", undef))) { - $v = $defs{$d}{READINGS}{state}{TIME}; - } elsif($iv) { - $iname = FW_dev2image($d); - } - $v = "" if(!defined($v)); - - pH "detail=$d", $d, 1; - if($iname) { - pO ""; - } else { - pO ""; - } - if($allSets) { - pH "cmd.$d=set $d on$rf", ReplaceEventMap($d, "on", 1), 1; - pH "cmd.$d=set $d off$rf", ReplaceEventMap($d, "off", 1), 1; - } + pH "cmd.$d=set $d on$rf", ReplaceEventMap($d, "on", 1), 1, "col2"; + pH "cmd.$d=set $d off$rf", ReplaceEventMap($d, "off", 1), 1, "col2"; } elsif($allSets =~ m/ desired-temp /) { - $v = ReadingsVal($d, "measured-temp", ""); - - $v =~ s/ .*//; - pH "detail=$d", $d, 1; - pO ""; - - $v = sprintf("%2.1f", int(2*$v)/2) if($v =~ m/[0-9.-]/); + $txt = ReadingsVal($d, "measured-temp", ""); + $txt =~ s/ .*//; + $txt = sprintf("%2.1f", int(2*$txt)/2) if($txt =~ m/[0-9.-]/); my @tv = map { ($_.".0", $_+0.5) } (5..30); shift(@tv); # 5.0 is not valid - $v = int($v*20)/$v if($v =~ m/^[0-9].$/); - - - pO ""; - - } elsif($type eq "FileLog") { - - pH "detail=$d", $d, 1; - pO ""; - if(defined(AttrVal($d, "archivedir", undef))) { - pH "cmd=showarchive $d", "archive", 1; - } - - foreach my $f (FW_fileList($defs{$d}{logfile})) { - pF " "; - pF " ", $row?"odd":"even"; - $row = ($row+1)%2; - foreach my $ln (split(",", AttrVal($d, "logtype", "text"))) { - my ($lt, $name) = split(":", $ln); - $name = $lt if(!$name); - pH "cmd=logwrapper $d $lt $f", $name, 1; - } - } - - } elsif($type eq "weblink") { - - pO ""; - - } else { - - pH "detail=$d", $d, 1; - pO ""; + $txt = int($txt*20)/$txt if($txt =~ m/^[0-9].$/); + pO ""; } - pO " "; + pO "
    " if(!$FW_ss); + # align needed for FireFox + $txt = "
    $txt
    " if($FW_ss); + if($hasOnOff) { + pHPlain "cmd.$d=set $d ".($state eq "on" ? "off":"on").$rf, $txt, 0; + } else { + pO $txt; + } + + if(!$FW_ss) { + pO "
    $v$v°" . - FW_hidden("arg.$d", "desired-temp") . - FW_hidden("dev.$d", $d) . - FW_select("val.$d", \@tv, ReadingsVal($d, "desired-temp", $v)) . - FW_submit("cmd.$d", "set") . - "$v
    $f"; - FW_showWeblink($d, $defs{$d}{LINK}, $defs{$d}{WLTYPE}); - pO "$v". + FW_hidden("arg.$d", "desired-temp") . + FW_hidden("dev.$d", $d) . + FW_select("val.$d", \@tv, ReadingsVal($d, "desired-temp", $txt)) . + "". + FW_submit("cmd.$d", "set"). + "
    "; } - pO "
    "; + pO ""; + } + pO "

    "; + + # Now the weblinks + my $buttonsDisplayed; + foreach my $d (sort @list) { + next if(IsIgnored($d)); + my $type = $defs{$d}{TYPE}; + next if(!$type || $type ne "weblink"); + + # plots navigation buttons + if(!$buttonsDisplayed && + $defs{$d}{WLTYPE} eq "fileplot" && + !AttrVal($d, "fixedrange", undef)) { + + pO "
    "; + $buttonsDisplayed = 1; + FW_zoomLink("zoom=-1", "Zoom-in.png", "zoom in"); + FW_zoomLink("zoom=1", "Zoom-out.png","zoom out"); + FW_zoomLink("off=-1", "Prev.png", "prev"); + FW_zoomLink("off=1", "Next.png", "next"); + pO "
    "; + } + + FW_showWeblink($d, $defs{$d}{LINK}, $defs{$d}{WLTYPE}); pO "
    "; # Empty line } - pO "
    "; pO ""; pO ""; } @@ -976,7 +939,9 @@ FW_logWrapper($) $cnt =~ s/>/>/g; pO "
    "; + pO "
    " if($FW_ss); pO "
    $cnt
    "; + pO "
    " if($FW_ss); pO "
    "; } else { @@ -995,6 +960,7 @@ FW_logWrapper($) pO ""; } + pO "
    "; pH "cmd=toweblink $d:$type:$file", "Convert to weblink"; pO "
    "; @@ -1230,9 +1196,9 @@ FW_select($$$) foreach my $v (@{$va}) { if($def && $v eq $def) { - $s .= ""; + $s .= "\n"; } else { - $s .= ""; + $s .= "\n"; } } $s .= ""; @@ -1244,31 +1210,11 @@ sub FW_textfield($$) { my ($n, $z) = @_; + return if($FW_hiddenroom{input}); my $s = ""; return $s; } -################## -# Multiline (for some types of widgets) editor with submit -sub -FW_makeEdit($$$$) -{ - my ($name, $type, $cmd, $val) = @_; - pO ""; - pO "
    "; - my $eval = $val; - $eval =~ s,\\\n,\n,g; - my $ncols = $FW_ss ? 40 : 60; - - pO ""; - pO "
    " . FW_submit("cmd.${cmd}$name", "$cmd $name"); - pO "
    "; - $eval = "
    $eval
    " if($eval =~ m/\n/); - pO "
    $eval
    "; - pO ""; -} - ################## sub FW_submit($$) @@ -1324,11 +1270,9 @@ FW_zoomLink($$$) } - - pO ""; + pO "  "; pHPlain "$cmd", "\"$alt\""; - pO ""; } ################## @@ -1341,21 +1285,6 @@ FW_calcWeblink($$) my $pm = AttrVal($d,"plotmode",$FW_plotmode); return if($pm eq "gnuplot"); - - if(!$d) { - my $cnt = 0; - foreach my $d (sort keys %defs ) { - next if($defs{$d}{TYPE} ne "weblink"); - next if($defs{$d}{WLTYPE} ne "fileplot"); - next if(!$FW_room || ($FW_room ne "all" && !$FW_rooms{$FW_room}{$d})); - - next if(AttrVal($d, "fixedrange", undef)); - next if($pm eq "gnuplot"); - $cnt++; - } - return $cnt; - } - return if(!$defs{$wl}); my $fr = AttrVal($wl, "fixedrange", undef); @@ -1542,7 +1471,9 @@ FW_style($$) sub pO(@) { - $FW_RET .= shift; + my $arg = shift; + return if(!defined($arg)); + $FW_RET .= $arg; $FW_RET .= "\n"; } @@ -1551,32 +1482,25 @@ pO(@) sub pH(@) { - my ($link, $txt, $td) = @_; + my ($link, $txt, $td, $class) = @_; pO "" if($td); $link = ($link =~ m,^/,) ? $link : "$FW_ME?$link"; - if($FW_ss || $FW_tp) { - my $sp = "  "; - pO "
    $sp$txt$sp
    "; + $class = " class=\"$class\"" if($class); + $class = "" if(!defined($class)); + + if($FW_ss) { # No pointer change if using onClick + pO "
    $txt
    "; + + } elsif($FW_tp) { + pO "
    $txt
    "; + } else { pO "$txt"; } pO "" if($td); } -sub -pHJava(@) -{ - my ($link, $txt) = @_; - - if($FW_ss || $FW_tp) { - my $sp = "  "; - pO "
    $sp$txt$sp
    "; - } else { - pO "$txt"; - } -} - sub pHPlain(@) { @@ -1607,7 +1531,7 @@ sub fC($) { my ($cmd) = @_; - #Log 0, "Calling $cmd"; +Log 0, "Calling $cmd"; my $ret = AnalyzeCommand(undef, $cmd); return $ret; } @@ -1706,20 +1630,53 @@ FW_ReadIcons() sub FW_dev2image($) { - my ($d) = @_; - my $iname = ""; - return $iname if(!$d || !$defs{$d}); + my ($name) = @_; + my $icon = ""; + return $icon if(!$name || !$defs{$name}); - my ($type, $iv) = ($defs{$d}{TYPE}, $defs{$d}{STATE}); - return $iname if(!$type || !$iv); + my ($type, $state) = ($defs{$name}{TYPE}, $defs{$name}{STATE}); + return $icon if(!$type || !$state); - $iv =~ s/ .*//; # Want to be able to have icons for "on-for-timer xxx" - $iname = $FW_icons{$iv} if($FW_icons{$iv}); # on.png - $iname = $FW_icons{$type} if($FW_icons{$type}); # FS20.png - $iname = $FW_icons{"$type.$iv"} if($FW_icons{"$type.$iv"}); # FS20.on.png - $iname = $FW_icons{$d} if($FW_icons{$d}); # lamp.png - $iname = $FW_icons{"$d.$iv"} if($FW_icons{"$d.$iv"}); # lamp.on.png - return $iname; + $state =~ s/ .*//; # Want to be able to have icons for "on-for-timer xxx" + $icon = $FW_icons{$state} if($FW_icons{$state}); # on.png + $icon = $FW_icons{$type} if($FW_icons{$type}); # FS20.png + $icon = $FW_icons{"$type.$state"} if($FW_icons{"$type.$state"}); # FS20.on.png + $icon = $FW_icons{$name} if($FW_icons{$name}); # lamp.png + $icon = $FW_icons{"$name.$state"} if($FW_icons{"$name.$state"}); # lamp.on.png + return $icon; +} + +sub +FW_makeEdit($$$) +{ + my ($name, $n, $val) = @_; + + # Toggle Edit-Window visibility script. + my $pgm = "Javascript:" . + "s=document.getElementById('edit').style;". + "s.display = s.display=='none' ? 'block' : 'none';". + "s=document.getElementById('disp').style;". + "s.display = s.display=='none' ? 'block' : 'none';"; + pO ""; + pO "$n"; + pO ""; + + $val =~ s,\\\n,\n,g; + my $eval = $val; + $eval = "
    $eval
    " if($eval =~ m/\n/); + pO ""; + pO "
    $eval
    "; + pO ""; + + pO ""; + pO "
    "; + my $cmd = "modify"; + my $ncols = $FW_ss ? 30 : 60; + pO ""; + pO "
    " . FW_submit("cmd.${cmd}$name", "$cmd $name"); + pO "
    "; + pO ""; } 1; diff --git a/fhem/webfrontend/pgm2/back.png b/fhem/webfrontend/pgm2/back.png new file mode 100644 index 0000000000000000000000000000000000000000..6adc70de3e3c4fd14cd38af92abf79f111ed7f5d GIT binary patch literal 2673 zcmV-%3Xb)OP)4Tx0C)j~RL^S@K@|QrZmG~B2wH0nvUrdpNm;9CMbtL^5n^i$+aIn^?(HA4aZWV5ov6ELTdbo0FI&wK{O>*+w4vx20?>!`FrQsdJlnHR>OPy zcd~b_n$otK2Za4V;76L-DzNVtaSB-y0*E}{p()372;bw_^6ZZ}PI-92wGS&j#91PI zKs7DSe@(bk%_Y-7gGe}(^>I=@oY#w#*Bu9GZf3^F5WP>3rn}7Ut74&?PWBFvy`A)a zPP5)V!Xd&78LdA?xQ(9mjMYElVd13a#D+Z_7&Y|xU=_C-srWU*6kiZcC!$nw*)9$7 zn6CX+@=AhmkT}X@VSsa5NKe;HZuq)~1$`#h6R+ZTR#D-3j}vF!)ZOnz+5)dI4jl{{ z44Mr{P!L4~VVJN`K!!XTF*LGrKO?IK8z<8w`3e3jI8lUGNUta*C8 zn(P`s>{pjD=7Kek#B;Fw@hxAK%$F&Q6vg9J^Xf~4by_hu-=A!MJ3Znq&n~srbFGPs zH&&aMXZ>nO`|hf|ljc?VPhR!${AbO?W8x_>CU%PFA&Hm8F7cAsOREdwU~R_;ot1_u z(ruCYB-LPGn!NQdT|ZlRy+(fw^-+`=%+gee_kY4FWHg<*4sZI8+sFJD270UUORdLHO0nA4V) z%{fwsET5CQ>B?eK%uw4yQc~9?*JVo2}ze(;aRcp*ceL#HUJSllrgm5wQKR zQu+C;QrUh^8rFfA`ftFz{YAidi-`aL010qNS#tmZFv0)vCuBE{d;#~-~OHGb_%@w$G^sIcTvRJU>O&c zd*Cqa?US-1jIZB;yf%w+RR9|AI8()Y`f-^Ni&+T`blbhM49KPr?8mO%<1ogt(|lsB zHRS>SQveEF$5q=5up)pu-gNzlTZiXd1HTBJMrh|fTyaIq-u&Y|*gQUpZnp>L0(lU? zP&3|C6=kRy&Er$Qwex&)kY!v62mQgF!IHRdgatf3065e&Of1OqJ!UOVNMUZuSU4G0s+bZ%{Fvi)gUE|oZZ=4nz#=Hw_Re6arFbDa|yYo1|2xQiS zmiamy11LCY$d2JPh$d%8@!5IgivT8)I-s&JL0waxG$urH0I zA39xHNQH?9wA3gc2$-}Y2!d4r-k{g*PmBmRbwqy7G&)W&4ZkS9@MX6Bnih6Uj?lH> z2fZrZs+f`(fdR{tbk3hUFk&2ZU+7wiObD@+iRL%M5uHI{~exprR zYpg9@9MsiG2**CR*X~bo;l7J}(EaRnc+#4Nhh&Xf7HVV_3{67~k60%dYDFr~xw%VP! z4>+o|tGZu5tk;+J>$?`FR5LWLea#sYKNlmLLl6G!ndtn4U~~&h3#%1U70}%T&?l@) z2Tm_}pazuoe9J2pSVI>C5<`nulBZ(Xw1VD8*@bPwu}J%~Z%2Ig0rgR8ln%+*Bbb8k ztZ;!{M+#YfuIFf3sXeW6{Tq99Ue{9%sdQHW{&Fb3#OutD_{D#+R&=f*{>zVnfBy?C zKBSBx2zsLeK_IHIPidt{h5M>AmY&aEM`n^{Q`Nc7Io+37w*UD4f!|rv;l zrWD^ZK`LRAl>PWW8{RWix?L0A(RKeexW*haREJhAKr>nk-ANUWuY)tX-2Rb38Ku zpx)YlBeEmB2WGgf%q8@wpgAOF`|gN!SK0~$5r)Fx^y}yK_+~|uft4eyaU1WN~pYu*sx7czabVbi?>cLM3P(&zj@~K&Obj8 zzp4$o)To?XvFRTWAun{1m($s)$K*7vd(N%Fi1Om>yOMPl0ybU6Iza#_z`9v0o?wJe zUulMoO)jtK>T;`Z#jARt-kI)+bFgySVdUGYYNs92ghXL;MCxoW`!zOUcCBHd_T_PM!Nb1truB?MVVCQiK-q5 zoYM=@C%Ax5lN3&0u3Z*DEkOSnDKD5I3$Oet-pS(l5Uo4Mm}}fgfBrKn@SX(R%{?7W fYXx6_zuNeJ`4;b)a1lye00000NkvXXu0mjfIo26I literal 0 HcmV?d00001 diff --git a/fhem/webfrontend/pgm2/style.css b/fhem/webfrontend/pgm2/style.css index 28eca6345..76c9d9318 100644 --- a/fhem/webfrontend/pgm2/style.css +++ b/fhem/webfrontend/pgm2/style.css @@ -1,21 +1,20 @@ -body { background-color: #FFFFE7;} +body { background-color: #FFFFE7; font-family:Arial, sans-serif; font-size:16px;} +input { font-family:Arial, sans-serif; font-size:16px; } +select { font-family:Arial, sans-serif; font-size:16px; } #logo { position:absolute; top:10px; left:20px; width:140px; } #menu { position:absolute; top:120px;left:20px; width:140px; } #hdr { position:absolute; top:10px; left:180px; } #content { position:absolute; top:50px; left:180px; bottom:20px; right:10px; } a { color: #278727; } +img { border-style: none; } -table.block { border:1px solid gray; width: 100%; background: #F8F8E0; } +.wide { width:100%; } + +table.block { border:1px solid gray; background: #F8F8E0; } table.block tr.odd { background: #F0F0D8; } table.block tr.sel { background: #F0F0D8; } table { -moz-border-radius:8px; border-radius:8px; } -table#room { background: #D7FFFF; } +table#room { border:1px solid gray; width: 100%; background: #D7FFFF; } table#room tr.sel { background: #A0FFFF; } - -/* Customize specific devices */ -/* -table#FS20 { background: #FF8080; } -table#FS20 tr.odd { background: #E08080; } -*/ diff --git a/fhem/webfrontend/pgm2/style_smallscreen.css b/fhem/webfrontend/pgm2/style_smallscreen.css index 8096d9bb2..222384d8d 100644 --- a/fhem/webfrontend/pgm2/style_smallscreen.css +++ b/fhem/webfrontend/pgm2/style_smallscreen.css @@ -1,39 +1,51 @@ -body { background-color: #FFFFE7; } +body { background-color: #FFFFE7; + font-family:Arial, sans-serif; font-size:24px; + } +textarea { font-family:Arial, sans-serif; font-size:16px} +input { font-family:Arial, sans-serif; font-size:16px} +select { font-family:Arial, sans-serif; font-size:16px} +#back { position:absolute; top: 2px; left:18px; } #logo { position:absolute; top: 2px; left: 2px; } #menu { position:absolute; top: 2px; left:65px; } #hdr { position:absolute; top:40px; left:65px; } -#content { position:absolute; top:85px; left: 5px; } +#content { position:absolute; top:85px; left: 0px; right: 0px;} a { color: #278727; } +img { border-style: none; } -div.href { /* Push buttons */ - padding:0; border:1px solid gray; height:1.5em; - - -moz-border-radius:0.5em; border-radius:0.5em; +div.col1 { width: 188px; height: 30px; white-space: nowrap; } +div.col2 { width: 108px; height: 30px; + -webkit-box-pack: center; -moz-box-pack: center; box-pack: center; + white-space: wrap; + font-size:16px; +} +div.col1, div.col2 { + overflow: hidden; text-overflow: ellipsis; + padding-top: 10px; padding-bottom: 10px; + padding-left: 5px; padding-right: 5px; display: -webkit-box; -webkit-box-align: center; display: -moz-box; -moz-box-align: center; background-image:-webkit-gradient(linear, right top, right bottom, - color-stop(0%,#fffff7), color-stop(49%,#ffffc7)); - background-image:-moz-linear-gradient(top, #fffff7, #ffffc7); - background-image:-o-linear-gradient(top, #fffff7, #ffffc7); - - -webkit-box-shadow: 0 0.15em 0.15em rgba(0,0,0, .5); - -moz-box-shadow: 0 0.15em 0.15em rgba(0,0,0, .5); - box-shadow: 0 0.15em 0.15em rgba(0,0,0, .5); + color-stop(0%,#fffff7), color-stop(100%,#ffffb7)); + background-image:-moz-linear-gradient(top, #fffff7, #ffffb7); + background-image:-o-linear-gradient(top, #fffff7, #ffffb7); } -table.block { border:1px solid gray; width: 100%; background: #F8F8E0; } +div.dname, div.dval { + width: 152px; + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + font-size:16px; +} +div.tiny { font-size:10px; } + +table.block { width: 320px; background: #F8F8E0; border-spacing:0px; } +table.block tr { border:1px solid gray; border-spacing:0px; } table.block tr.odd { background: #F0F0D8; } table.block tr.sel { background: #F0F0D8; } +table.block td { width: 150px; }; table { -moz-border-radius:8px; border-radius:8px; } table#room { background: #D7FFFF; } table#room tr.sel { background: #A0FFFF; } - -/* Customize specific devices */ -/* -table#FS20 { background: #FF8080; } -table#FS20 tr.odd { background: #E08080; } -*/ diff --git a/fhem/webfrontend/pgm2/style_touchpad.css b/fhem/webfrontend/pgm2/style_touchpad.css index 7577bfbd0..c4c454457 100644 --- a/fhem/webfrontend/pgm2/style_touchpad.css +++ b/fhem/webfrontend/pgm2/style_touchpad.css @@ -1,39 +1,23 @@ -body { background-color: #FFFFE7;} +body { background-color: #FFFFE7; + font-family:Arial, sans-serif; font-size:16px; + } +textarea { font-family:Arial, sans-serif; font-size:16px} +input { font-family:Arial, sans-serif; font-size:16px} +select { font-family:Arial, sans-serif; font-size:16px} #logo { position:absolute; top:10px; left:10px; width:100px; } #menu { position:absolute; top:120px;left:10px; width:100px; } -#hdr { position:absolute; top:10px; left:120px; } -#content { position:absolute; top:50px; left:120px; bottom:20px; right:10px; } +#hdr { position:absolute; top:10px; left:140px; } +#content { position:absolute; top:50px; left:140px; bottom:20px; right:10px; } a { color: #278727; } -div.href { /* Push buttons */ - padding:0; border:1px solid gray; height:1.5em; - - -moz-border-radius:0.5em; border-radius:0.5em; - - display: -webkit-box; -webkit-box-align: center; - display: -moz-box; -moz-box-align: center; - - background-image:-webkit-gradient(linear, right top, right bottom, - color-stop(0%,#fffff7), color-stop(49%,#ffffc7)); - background-image:-moz-linear-gradient(top, #fffff7, #ffffc7); - background-image:-o-linear-gradient(top, #fffff7, #ffffc7); - - -webkit-box-shadow: 0 0.15em 0.15em rgba(0,0,0, .5); - -moz-box-shadow: 0 0.15em 0.15em rgba(0,0,0, .5); - box-shadow: 0 0.15em 0.15em rgba(0,0,0, .5); -} - table.block { border:1px solid gray; width: 100%; background: #F8F8E0; } table.block tr.odd { background: #F0F0D8; } table.block tr.sel { background: #F0F0D8; } table { -moz-border-radius:8px; border-radius:8px; } -table#room { background: #D7FFFF; } -table#room tr.sel { background: #A0FFFF; } +.col1, .col2 { padding: 8px; } +.dname, .dval { padding: 0px; font-size: 14px; } -/* Customize specific devices */ -/* -table#FS20 { background: #FF8080; } -table#FS20 tr.odd { background: #E08080; } -*/ +table#room { border:1px solid gray; width: 100%; background: #D7FFFF; } +table#room tr.sel { background: #A0FFFF; }