Item14044: format, width and height parameters for DOCUMENTVIEWER

pencil
Priority: Enhancement
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: DocumentViewerPlugin
Branches:
Reported By: MichaelTempest
Waiting For:
Last Change By: MichaelDaum
The DocumentViewerPlugin's %DOCUMENTVIEWER{...}% has undocumented parameters for the format ( portrait, landscape or screen ) and the height and width.

Firstly, these parameters should be documented.

Secondly, I propose that it should be possible to use any two of format, height and width (whereas the current implementation has format overriding height and width ). Here is a possible implementation:
    if ( $format eq 'portrait' ) {
      if ($params->{height}) {
         $height = $params->{height};
         $width = int(724 * $height / 1024);
      }
      else {
         $width = $params->{width} || 724;
         $height = int(1024 * $width / 724);
      }
    }
    elsif ( $format eq 'landscape' ) {
      if ($params->{height}) {
         $height = $params->{height};
         $width = int(1024 * $height / 724);
      }
      else {
         $width = $params->{width} || 1024;
         $height = int(724 * $width / 1024);
      }
    }
    elsif ( $format eq 'screen' ) {
      if ($params->{height}) {
         $height = $params->{height};
         $width = int(1024 * $height / 768);
      }
      else {
         $width = $params->{width} || 1024;
         $height = int(768 * $width / 1024);
      }
    }
    else {
        $width  = $params->{width}  || 724;
        $height = $params->{height} || 1024;
    }

-- MichaelTempest - 07 Apr 2016

Would you like to create a patch?

-- MichaelDaum - 12 Dec 2017
 

ItemTemplate edit

Summary format, width and height parameters for DOCUMENTVIEWER
ReportedBy MichaelTempest
Codebase 2.0.0 RC
SVN Range
AppliesTo Extension
Component DocumentViewerPlugin
Priority Enhancement
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r2 - 12 Dec 2017, MichaelDaum - This page was cached on 19 Sep 2019 - 04:29.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy