mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-21 07:56:03 +00:00
02_RSS: viewport configurable by attribute
git-svn-id: https://svn.fhem.de/fhem/trunk@9360 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2fb0007c7c
commit
c7c5325164
@ -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: viewport configurable by attribute
|
||||||
- change: 93_DbLog: removed use of perl's 'switch' feature.
|
- change: 93_DbLog: removed use of perl's 'switch' feature.
|
||||||
- change: 93_DbLog: removed string length limitation for SQLITE.
|
- change: 93_DbLog: removed string length limitation for SQLITE.
|
||||||
- bugfix: 93_DbLog: fixed ploteditor bug when DbLogType=History.
|
- bugfix: 93_DbLog: fixed ploteditor bug when DbLogType=History.
|
||||||
|
@ -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";
|
$hash->{AttrList} = "size bg bgcolor tmin refresh areas autoreread:1,0 viewport";
|
||||||
$hash->{SetFn} = "RSS_Set";
|
$hash->{SetFn} = "RSS_Set";
|
||||||
$hash->{NotifyFn} = "RSS_Notify";
|
$hash->{NotifyFn} = "RSS_Notify";
|
||||||
|
|
||||||
@ -275,13 +275,14 @@ RSS_HTMLHead($$) {
|
|||||||
my ($name,$refresh) = @_;
|
my ($name,$refresh) = @_;
|
||||||
|
|
||||||
my ($width,$height)= split(/x/, AttrVal($name,"size","800x600"));
|
my ($width,$height)= split(/x/, AttrVal($name,"size","800x600"));
|
||||||
|
my $viewportContent= AttrVal($name, "viewport", "");
|
||||||
|
|
||||||
|
|
||||||
my $doctype= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
|
my $doctype= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
|
||||||
my $xmlns= 'xmlns="http://www.w3.org/1999/xhtml"';
|
my $xmlns= 'xmlns="http://www.w3.org/1999/xhtml"';
|
||||||
my $scripts= RSS_getScript();
|
my $scripts= RSS_getScript();
|
||||||
my $viewport= "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0\"/>";
|
my $viewport= $viewportContent eq "" ? "" : "<meta name=\"viewport\" content=\"$viewportContent\"/>\n";
|
||||||
my $code= "$doctype\n<html $xmlns>\n<head>\n<title>$name</title>\n$viewport\n$scripts</head>\n";
|
my $code= "$doctype\n<html $xmlns>\n<head>\n<title>$name</title>\n$viewport$scripts</head>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1001,6 +1002,10 @@ plotFromUrl(@)
|
|||||||
no matter how frequently the RSS feed consumer accesses the page.</li><br>
|
no matter how frequently the RSS feed consumer accesses the page.</li><br>
|
||||||
<li>refresh <interval><br>Time in seconds after which the HTML page is automatically reloaded. Defaults to 60.
|
<li>refresh <interval><br>Time in seconds after which the HTML page is automatically reloaded. Defaults to 60.
|
||||||
Set <interval> to 0 to disable reloading.</li><br>
|
Set <interval> to 0 to disable reloading.</li><br>
|
||||||
|
<li>viewport<br>Adds a viewport directive to the HTML header.<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.
|
||||||
|
</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 <area shape="rect" coords="0,0,200,200" href="http://fhem.de"/><area shape="rect" coords="600,400,799,599" href="http://has:8083/fhem" target="_top"/></code>
|
Example: <code>attr FrameRSS areas <area shape="rect" coords="0,0,200,200" href="http://fhem.de"/><area shape="rect" coords="600,400,799,599" href="http://has:8083/fhem" target="_top"/></code>
|
||||||
</li><br>
|
</li><br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user