02_RSS: new attribute noscroll

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@9821 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2015-11-08 12:15:52 +00:00
parent 1e7bf8d1f8
commit 270ebb8e35
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- feature: 02_RSS: new attribute noscroll
- feature: 98_help: replace anchor links in help output with a working - feature: 98_help: replace anchor links in help output with a working
link to local commandref or fhem.de link to local commandref or fhem.de
- bugfix: 70_XBMC: reworked RPC ID generation - bugfix: 70_XBMC: reworked RPC ID generation

View File

@ -56,7 +56,7 @@ RSS_Initialize($) {
$hash->{DefFn} = "RSS_Define"; $hash->{DefFn} = "RSS_Define";
$hash->{UndefFn} = "RSS_Undefine"; $hash->{UndefFn} = "RSS_Undefine";
#$hash->{AttrFn} = "RSS_Attr"; #$hash->{AttrFn} = "RSS_Attr";
$hash->{AttrList} = "size bg bgcolor tmin refresh areas autoreread:1,0 viewport"; $hash->{AttrList} = "size bg bgcolor tmin refresh areas autoreread:1,0 viewport noscroll";
$hash->{SetFn} = "RSS_Set"; $hash->{SetFn} = "RSS_Set";
$hash->{NotifyFn} = "RSS_Notify"; $hash->{NotifyFn} = "RSS_Notify";
@ -299,11 +299,13 @@ RSS_returnHTML($) {
my $type = $defs{$name}{fhem}{style}; my $type = $defs{$name}{fhem}{style};
my $img= "$url/rss/$name.$type"; my $img= "$url/rss/$name.$type";
my $refresh= AttrVal($name, 'refresh', 60); my $refresh= AttrVal($name, 'refresh', 60);
my $noscroll= AttrVal($name, 'noscroll', 0);
my $overflow= $noscroll ? " style=\"overflow:hidden\"" : "";
my $areas= AttrVal($name, 'areas', ""); my $areas= AttrVal($name, 'areas', "");
my $embed= $defs{$name}{".embed"}; my $embed= $defs{$name}{".embed"};
my $r= (defined($refresh) && ($refresh> 0)) ? " onload=\"setTimeout(function(){reloadImage(\'img0\')},$refresh*1000);\"" : ""; my $r= (defined($refresh) && ($refresh> 0)) ? " onload=\"setTimeout(function(){reloadImage(\'img0\')},$refresh*1000);\"" : "";
my $code= RSS_HTMLHead($name, $refresh) . my $code= RSS_HTMLHead($name, $refresh) .
"<body topmargin=\"0\" leftmargin=\"0\" margin=\"0\" padding=\"0\">\n" . "<body topmargin=\"0\" leftmargin=\"0\" margin=\"0\" padding=\"0\"$overflow>\n" .
"<div id=\"rss_$name\" style=\"z-index:1;\" >\n" . "<div id=\"rss_$name\" style=\"z-index:1;\" >\n" .
"<img id=\"img0\" src=\"$img\" usemap=\"#map\"$r/>\n" . "<img id=\"img0\" src=\"$img\" usemap=\"#map\"$r/>\n" .
"<map name=\"map\" id=\"map\">\n$areas\n</map>\n" . "<map name=\"map\" id=\"map\">\n$areas\n</map>\n" .
@ -1006,6 +1008,8 @@ plotFromUrl(@)
Example: <code>attr FrameRSS viewport width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0</code><br> Example: <code>attr FrameRSS viewport width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0</code><br>
This scales the image to fit to the browser's viewport and inhibits zooming in or out on tablets. This scales the image to fit to the browser's viewport and inhibits zooming in or out on tablets.
</li><br> </li><br>
<li>noscroll</br>Suppresses scrollbars in browsers, if set to 1.
</li><br>
<li>areas<br>HTML code that goes into the image map.<br> <li>areas<br>HTML code that goes into the image map.<br>
Example: <code>attr FrameRSS areas &lt;area shape="rect" coords="0,0,200,200" href="http://fhem.de"/&gt;&lt;area shape="rect" coords="600,400,799,599" href="http://has:8083/fhem" target="_top"/&gt;</code> Example: <code>attr FrameRSS areas &lt;area shape="rect" coords="0,0,200,200" href="http://fhem.de"/&gt;&lt;area shape="rect" coords="600,400,799,599" href="http://has:8083/fhem" target="_top"/&gt;</code>
</li><br> </li><br>