From e5bbcba07d8108308f52281bc001cba74e6a2e54 Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Mon, 23 Feb 2015 21:20:56 +0000 Subject: [PATCH] 55_InfoPanel.pm: updated git-svn-id: https://svn.fhem.de/fhem/trunk@8077 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/55_InfoPanel.pm | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/55_InfoPanel.pm b/fhem/FHEM/55_InfoPanel.pm index e036defac..e3638d96a 100644 --- a/fhem/FHEM/55_InfoPanel.pm +++ b/fhem/FHEM/55_InfoPanel.pm @@ -46,7 +46,7 @@ # - added: break condition for includes # ############################################## -# $Id: 55_InfoPanel.pm 7990 2015-02-14 22:28:21Z betateilchen $ +# $Id: 55_InfoPanel.pm 8013 2015-02-16 22:40:14Z betateilchen $ package main; use strict; @@ -618,6 +618,21 @@ sub btIP_itemText { return $output; } +sub btIP_lpItemText { + my ($id,$x,$y,$text,%params)= @_; + return unless(defined($text)); + $id = ($id eq '-') ? createUniqueId() : $id; + my $color = substr($params{rgb},0,6); + + my $output = "
\n". + "
$text
\n". + "
\n"; + $defs{$params{name}}{fhem}{div} .= $output; + return ""; +} + sub btIP_itemTextBox { my ($id,$x,$y,$boxwidth,$boxheight,$text,$link,%params)= @_; return unless(defined($text)); @@ -1146,6 +1161,15 @@ sub btIP_evalLayout { $svg .= btIP_itemText($id,$x,$y,$text,%params); } + when("lptext") { + ($id,$x,$y,$text)= split("[ \t]+", $def, 4); + ($x,$y)= btIP_xy($x,$y,%params); + $params{xx} = $x; + $params{yy} = $y; + $text= AnalyzePerlCommand(undef, $text); + $svg .= btIP_lpItemText($id,$x,$y,$text,%params); + } + when("textbox") { ($id,$x,$y,$boxwidth,$boxheight,$link,$text)= split("[ \t]+", $def, 7); ($x,$y)= btIP_xy($x,$y,%params); @@ -1302,10 +1326,12 @@ sub btIP_returnHTML { my $refresh = AttrVal($name, 'refresh', 60); my $title = AttrVal($name, 'title', $name); - + my $gen = 'generated="'.(time()-1).'"'; my $code = btIP_HTMLHead($name,$title,$refresh); - $code .= "\n". + $code .= "\n". + "
\n". btIP_returnSVG($name)."\n
\n"; $code .= $defs{$name}{fhem}{div} if($defs{$name}{fhem}{div}); @@ -1344,6 +1370,7 @@ sub btIP_getScript { } # $scripts .= sprintf($jsTemplate,"/fhem/pgm2/cordova-2.3.0.js"); # $scripts .= sprintf($jsTemplate,"/fhem/pgm2/webviewcontrol.js"); + $scripts .= sprintf($jsTemplate,"/fhem/pgm2/fhemweb.js"); $scripts =~ s/script>/script>\n/g; return $scripts; }