From 015b154e8fc6e2f84634f61451599a17a0447296 Mon Sep 17 00:00:00 2001 From: justme-1968 Date: Sun, 14 Dec 2014 21:00:54 +0000 Subject: [PATCH] 33_readingsGroup.pm: added direct show/hide js and command git-svn-id: https://svn.fhem.de/fhem/trunk@7217 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/33_readingsGroup.pm | 24 +++++++++++++++++------- fhem/www/pgm2/fhemweb_readingsGroup.js | 25 +++++++++++++++---------- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/fhem/FHEM/33_readingsGroup.pm b/fhem/FHEM/33_readingsGroup.pm index 9b2a3193e..fb045a719 100644 --- a/fhem/FHEM/33_readingsGroup.pm +++ b/fhem/FHEM/33_readingsGroup.pm @@ -370,9 +370,9 @@ readingsGroup_makeLink($$$) } sub -readingsGroup_2html($) +readingsGroup_2html($;$) { - my($hash) = @_; + my($hash,$extPage) = @_; $hash = $defs{$hash} if( ref($hash) ne 'HASH' ); return undef if( !$hash ); @@ -432,7 +432,9 @@ readingsGroup_2html($) my $devices = $hash->{DEVICES}; - my $group = AttrVal( $d, "group", undef ); + my $group; + $group = $extPage->{group} if( $extPage ); + $group = AttrVal( $d, "group", undef ) if( !$group ); $group = "" if( !$group ); $group =~ s/,/_/g; @@ -840,13 +842,13 @@ readingsGroup_2html($) sub readingsGroup_detailFn() { - my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn. + my ($FW_wname, $d, $room, $extPage) = @_; # extPage is set for summaryFn. my $hash = $defs{$d}; $hash->{mayBeVisible} = 1; - return readingsGroup_2html($d); + return readingsGroup_2html($d,$extPage); } sub @@ -1081,7 +1083,7 @@ readingsGroup_Set($@) { my ($hash, $name, $cmd, $param, @a) = @_; - my $list = "visibility:toggle,toggle2"; + my $list = "visibility:toggle,toggle2,show,hide"; if( $cmd eq "refresh" ) { readingsGroup_updateDevices($hash); @@ -1258,6 +1260,14 @@ readingsGroup_Attr($$$;$) Set
@@ -1357,7 +1367,7 @@ readingsGroup_Attr($$$;$) hidden -> default state is hidden but can be expanded
hideable -> default state is visible but can be hidden

- if set to collapsed or collapsible will recognise the specials <->,<+> and <+-> as the first elements of + if set to collapsed or collapsible will recognise the specials <->,<+> and <+-> as the first elements of a line to add a + or - symbol to this line. clicking on the + or - symbol will toggle between expanded and collapsed state. if a readingsGroup is expanded then all others in the same group will be collapsed.