mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
01_FHEMWEB.pm: add viewport attribute, patch by MarcelK (Forum #62727)
git-svn-id: https://svn.fhem.de/fhem/trunk@12814 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
bb557f10e8
commit
7cf15f0e38
@ -180,6 +180,7 @@ FHEMWEB_Initialize($)
|
||||
stylesheetPrefix
|
||||
title
|
||||
touchpad:unused
|
||||
viewport
|
||||
webname
|
||||
);
|
||||
use warnings 'qw';
|
||||
@ -808,13 +809,15 @@ FW_answerCall($)
|
||||
if($FW_tp || $FW_ss) {
|
||||
my $icon = FW_iconPath("fhemicon_ios.png");
|
||||
$icon = $FW_ME."/images/".($icon ? $icon : "default/fhemicon_ios.png");
|
||||
my $viewport = '';
|
||||
if($FW_ss) {
|
||||
my $stf = $FW_userAgent =~ m/iPad|iPhone|iPod/ ? ",shrink-to-fit=no" :"";
|
||||
FW_pO "<meta name='viewport' ".
|
||||
"content='initial-scale=1.0,user-scalable=1$stf'/>";
|
||||
$viewport = "initial-scale=1.0,user-scalable=1$stf";
|
||||
} elsif($FW_tp) {
|
||||
FW_pO '<meta name="viewport" content="width=768"/>';
|
||||
$viewport = "width=768";
|
||||
}
|
||||
$viewport = AttrVal($FW_wname, "viewport", $viewport);
|
||||
FW_pO '<meta name="viewport" content="'.$viewport.'"/>' if ($viewport);
|
||||
FW_pO '<meta name="apple-mobile-web-app-capable" content="yes"/>';
|
||||
FW_pO '<meta name="mobile-web-app-capable" content="yes"/>'; # Forum #36183
|
||||
FW_pO '<link rel="apple-touch-icon" href="'.$icon.'"/>';
|
||||
@ -3569,6 +3572,14 @@ FW_widgetOverride($$)
|
||||
Sets the title of the page. If enclosed in {} the content is evaluated.
|
||||
</li><br>
|
||||
|
||||
<a name="viewport"></a>
|
||||
<li>viewport<br>
|
||||
Sets the "viewport" attribute in the HTML header. This can for
|
||||
example be used to force the width of the page or disable zooming.<br>
|
||||
Example: attr WEB viewport
|
||||
width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no
|
||||
</li><br>
|
||||
|
||||
<a name="webCmd"></a>
|
||||
<li>webCmd<br>
|
||||
Colon separated list of commands to be shown in the room overview for a
|
||||
@ -4288,6 +4299,14 @@ FW_widgetOverride($$)
|
||||
als Perl Ausdruck evaluiert.
|
||||
</li><br>
|
||||
|
||||
<a name="viewport"></a>
|
||||
<li>viewport<br>
|
||||
Setzt das "viewport" Attribut im HTML Header. Das kann benutzt
|
||||
werden um z.B. die Breite fest vorzugeben oder Zoomen zu verhindern.<br>
|
||||
Beispiel: attr WEB viewport
|
||||
width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no
|
||||
</li><br>
|
||||
|
||||
<a name="webCmd"></a>
|
||||
<li>webCmd<br>
|
||||
Durch Doppelpunkte getrennte Auflistung von Befehlen, die für ein
|
||||
|
Loading…
x
Reference in New Issue
Block a user