33_readingsGroup.pm: fixed layout for widgets
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@7524 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -605,6 +605,7 @@ readingsGroup_2html($;$)
|
|||||||
$ret .= "<td $value_columns><div $cell_style0 $name_style class=\"dname\">$txt</div></td>" if( $show_names );
|
$ret .= "<td $value_columns><div $cell_style0 $name_style class=\"dname\">$txt</div></td>" if( $show_names );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
my $webCmdFn = 0;
|
||||||
my $cmd = lookup2($hash->{helper}{commands},$name,$d,$txt);
|
my $cmd = lookup2($hash->{helper}{commands},$name,$d,$txt);
|
||||||
|
|
||||||
if( $cmd && $cmd =~ m/^([\w-]*):(\S*)?(\s\S*)?$/ ) {
|
if( $cmd && $cmd =~ m/^([\w-]*):(\S*)?(\s\S*)?$/ ) {
|
||||||
@@ -632,20 +633,16 @@ readingsGroup_2html($;$)
|
|||||||
last if(defined($htmlTxt));
|
last if(defined($htmlTxt));
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $htmlTxt =~ m/<td colspan='2'>(.*)<\/td>/s ) {
|
if( $htmlTxt && $htmlTxt =~ m/^<td>(.*)<\/td>$/ ) {
|
||||||
$txt = $1;
|
$htmlTxt = $1;
|
||||||
|
}
|
||||||
|
|
||||||
my $a = AttrVal($name, "alias", $name);
|
if( $htmlTxt ) {
|
||||||
my $room = AttrVal($name, "room", "");
|
|
||||||
my $group = AttrVal($name, "group", "");
|
|
||||||
my $mapped = lookup($hash->{helper}{mapping},$name,$a,$set,"",$room,$group,$cell_row,undef);
|
|
||||||
if( defined($mapped) ) {
|
|
||||||
$txt =~ s/$set /$mapped /;
|
|
||||||
}
|
|
||||||
} elsif( $htmlTxt ) {
|
|
||||||
$txt = $htmlTxt;
|
$txt = $htmlTxt;
|
||||||
|
$webCmdFn = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
($txt,undef) = readingsGroup_makeLink($txt,undef,$cmd) if( !$webCmdFn );
|
||||||
}
|
}
|
||||||
|
|
||||||
my $informid = "";
|
my $informid = "";
|
||||||
@@ -798,21 +795,15 @@ readingsGroup_2html($;$)
|
|||||||
last if(defined($htmlTxt));
|
last if(defined($htmlTxt));
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $htmlTxt =~ m/$name-$set/ ) {
|
if( $htmlTxt && $htmlTxt =~ m/^<td>(.*)<\/td>$/ ) {
|
||||||
$htmlTxt =~ s/$name-$set/$d-$name.$n/g;
|
$htmlTxt = $1;
|
||||||
|
}
|
||||||
|
if( $htmlTxt && $htmlTxt =~ m/class='fhemWidget'/ ) {
|
||||||
|
$htmlTxt =~ s/class='fhemWidget'/class='fhemWidget' informId='$d-$name.$n'/;
|
||||||
$informid = "";
|
$informid = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $htmlTxt && $htmlTxt =~ m/<td colspan='2'>(.*)<\/td>/s ) {
|
if( $htmlTxt ) {
|
||||||
$v = $1;
|
|
||||||
|
|
||||||
my $mapped = lookup($hash->{helper}{mapping},$name,$a,$set,"",$room,$group,$cell_row,undef);
|
|
||||||
if( defined($mapped) ) {
|
|
||||||
$v =~ s/$set /$mapped /;
|
|
||||||
}
|
|
||||||
$v =~ s/(.*) // if( !$informid );
|
|
||||||
$webCmdFn = 1;
|
|
||||||
} elsif( $htmlTxt ) {
|
|
||||||
$v = $htmlTxt;
|
$v = $htmlTxt;
|
||||||
$webCmdFn = 1;
|
$webCmdFn = 1;
|
||||||
}
|
}
|
||||||
@@ -1170,7 +1161,7 @@ readingsGroup_Attr($$$;$)
|
|||||||
delete $hash->{alwaysTrigger};
|
delete $hash->{alwaysTrigger};
|
||||||
}
|
}
|
||||||
|
|
||||||
} elsif( grep { $attrName eq $_ } @mapping_attrs ) {
|
} elsif( grep { $_ =~ m/$attrName(:.*)?/ } @mapping_attrs ) {
|
||||||
my $hash = $defs{$name};
|
my $hash = $defs{$name};
|
||||||
|
|
||||||
if( $cmd eq "set" ) {
|
if( $cmd eq "set" ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user