diff --git a/FHEM/95_FLOORPLAN.pm b/FHEM/95_FLOORPLAN.pm index 6919f8702..3ebb9640c 100644 --- a/FHEM/95_FLOORPLAN.pm +++ b/FHEM/95_FLOORPLAN.pm @@ -33,6 +33,7 @@ # 0022: longpoll by Matthias Gehre (November 27, 2012) # 0023: longpoll updates readings also - by Matthias Gehre; FW_longpoll is now a global variable (January 21, 2013) # 0024: fix for readings longpoll, added js-extension from Dirk (February 16, 2013) +# 0025: Added fp_viewport-attribute from (March 03, 2013) # ################################################################ # @@ -127,6 +128,7 @@ my %FW_zoom; # copied from FHEMWEB - using local version to my @FW_zoom; # copied from FHEMWEB - using local version to avoid global variable # $FW_subdir # from FHEMWEB: path of floorplan-subdir - enables reusability of FHEMWEB-routines for sub-URLS like floorplan # $FW_cname # from FHEMWEB: Current connection name +my $FP_viewport; # Define width for touchpad device #------------------------------------------------------------------------------- sub @@ -134,12 +136,13 @@ FLOORPLAN_Initialize($) { my ($hash) = @_; $hash->{DefFn} = "FP_define"; - $hash->{AttrList} = "loglevel:0,1,2,3,4,5,6 refresh fp_arrange:1,detail,WEB,0 commandfield:1,0 fp_default:1,0 stylesheet fp_noMenu:1,0 fp_backgroundimg fp_setbutton:1,0"; + $hash->{AttrList} = "loglevel:0,1,2,3,4,5,6 refresh fp_arrange:1,detail,WEB,0 commandfield:1,0 fp_default:1,0 stylesheet fp_noMenu:1,0 fp_backgroundimg fp_setbutton:1,0 fp_viewport"; # fp_arrange : show addtl. menu for attr fp_ .... # commandfield : shows an fhem-commandline inputfield on floorplan # fp_default : set for ONE floorplan. If set, floorplan-startscreen is skipped. # fp_stylesheetPrefix : e.g. for darkstyle, set value dark -> uses darkfloorplanstyle.css # fp_noMenu : suppresses display of the floorplan-menu on the floorplan + # fp_viewport : define a viewport for mobile devices # CGI my $name = "floorplan"; @@ -206,6 +209,7 @@ FP_CGI(){ if ($FP_name) { # a floorplan-name is part of URL $FP_arrange = AttrVal($FP_name, "fp_arrange", 0) if ($FP_name); # set arrange mode + $FP_viewport = AttrVal($FP_name, "fp_viewport", "width=768") if ($FP_name); # viewport definition if(!defined($defs{$FP_name})){ $FW_RET = "ERROR: Floorplan $FP_name not defined \n"; # check for typo in URL return ("text/plain; charset=$FW_encoding", $FW_RET); @@ -322,7 +326,7 @@ FP_htmlHeader($) { if($FW_ss) { FW_pO ""; } elsif($FW_tp) { - FW_pO ""; + FW_pO ""; } } # refresh-value @@ -846,7 +850,11 @@ FP_input(@) - + +
  • fp_viewport
    + Allows usage of a user-defined viewport-value for touchpad.
    + Default-viewport-value is "width=768". +
  • Inherited from FHEMWEB
    The following attributes are inherited from the underlying FHEMWEB instance: