From 4b4252d91b084a2d83075b446a30a0985a3bb100 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 9 Nov 2018 12:00:36 +0100 Subject: [PATCH] Force to show scroll when a PDF is in landscape mode BT#15044 Issue reported here: https://github.com/kogmbh/ViewerJS/issues/111 --- main/inc/lib/javascript/ViewerJS/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/inc/lib/javascript/ViewerJS/index.html b/main/inc/lib/javascript/ViewerJS/index.html index 2eb1fd4736..8d7f65ac29 100644 --- a/main/inc/lib/javascript/ViewerJS/index.html +++ b/main/inc/lib/javascript/ViewerJS/index.html @@ -41,14 +41,14 @@ along with ViewerJS. If not, see . var ODFViewerPlugin_css="@namespace cursor url(urn:webodf:names:cursor);.caret {opacity: 0 !important;}";function ODFViewerPlugin(){function b(b){var a=document.createElement("script");a.async=!1;a.src="./webodf.js";a.type="text/javascript";a.onload=function(){runtime.loadClass("gui.HyperlinkClickHandler");runtime.loadClass("odf.OdfCanvas");runtime.loadClass("ops.Session");runtime.loadClass("gui.CaretManager");runtime.loadClass("gui.HyperlinkTooltipView");runtime.loadClass("gui.SessionController");runtime.loadClass("gui.SvgSelectionView");runtime.loadClass("gui.SelectionViewManager");runtime.loadClass("gui.ShadowCursor"); runtime.loadClass("gui.SessionView");b()};document.head.appendChild(a);a=document.createElementNS(document.head.namespaceURI,"style");a.setAttribute("media","screen, print, handheld, projection");a.setAttribute("type","text/css");a.appendChild(document.createTextNode(ODFViewerPlugin_css));document.head.appendChild(a)}var r=this,f=null,x=null,s=null,k=null;this.initialize=function(q,a){b(function(){var e,c,b,q,l,z,u,v;x=document.getElementById("canvas");f=new odf.OdfCanvas(x);f.load(a);f.addListener("statereadychange", function(){s=f.odfContainer().rootElement;k=f.odfContainer().getDocumentType(s);if("text"===k){f.enableAnnotations(!0,!1);e=new ops.Session(f);b=e.getOdtDocument();q=new gui.ShadowCursor(b);c=new gui.SessionController(e,"localuser",q,{});v=c.getEventManager();z=new gui.CaretManager(c,f.getViewport());l=new gui.SelectionViewManager(gui.SvgSelectionView);new gui.SessionView({caretAvatarsInitiallyVisible:!1},"localuser",e,c.getSessionConstraints(),z,l);l.registerCursor(q);u=new gui.HyperlinkTooltipView(f, -c.getHyperlinkClickHandler().getModifier);v.subscribe("mousemove",u.showTooltip);v.subscribe("mouseout",u.hideTooltip);var a=new ops.OpAddMember;a.init({memberid:"localuser",setProperties:{fillName:runtime.tr("Unknown Author"),color:"blue"}});e.enqueue([a]);c.insertLocalCursor()}r.onLoad()})})};this.isSlideshow=function(){return"presentation"===k};this.onLoad=function(){};this.fitToWidth=function(b){f.fitToWidth(b)};this.fitToHeight=function(b){f.fitToHeight(b)};this.fitToPage=function(b,a){f.fitToContainingElement(b, +c.getHyperlinkClickHandler().getModifier);v.subscribe("mousemove",u.showTooltip);v.subscribe("mouseout",u.hideTooltip);var a=new ops.OpAddMember;a.init({memberid:"localuser",setProperties:{fillName:runtime.tr("Unknown Author"),color:"blue"}});e.enqueue([a]);c.insertLocalCursor()}r.onLoad()})})};this.isSlideshow=function(){return false};this.onLoad=function(){};this.fitToWidth=function(b){f.fitToWidth(b)};this.fitToHeight=function(b){f.fitToHeight(b)};this.fitToPage=function(b,a){f.fitToContainingElement(b, a)};this.fitSmart=function(b){f.fitSmart(b)};this.getZoomLevel=function(){return f.getZoomLevel()};this.setZoomLevel=function(b){f.setZoomLevel(b)};this.getPages=function(){var b=Array.prototype.slice.call(s.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","page")),a=[],e,c;for(e=0;e=a&&c=a&&d=b}function x(d,a,b){var e=c[d.pageIndex],f=e.getElementsByTagName("canvas")[0],h=e.getElementsByTagName("div")[0],k="scale("+g+", "+g+")";e.style.width=a+"px";e.style.height=b+"px";f.width=a;f.height=b;h.style.width=a+"px";h.style.height=b+"px";CustomStyle.setProp("transform", h,k);CustomStyle.setProp("transformOrigin",h,"0% 0%");t[d.pageIndex]=t[d.pageIndex]===l.RUNNING?l.RUNNINGOUTDATED:l.BLANK}function s(d){var a,b;t[d.pageIndex]===l.BLANK&&(t[d.pageIndex]=l.RUNNING,a=c[d.pageIndex],b=B[d.pageIndex],a=a.getElementsByTagName("canvas")[0],d.render({canvasContext:a.getContext("2d"),textLayer:b,viewport:d.getViewport(g)}).promise.then(function(){t[d.pageIndex]===l.RUNNINGOUTDATED?(t[d.pageIndex]=l.BLANK,s(d)):t[d.pageIndex]=l.FINISHED}))}function k(){var d=!a.isSlideshow(); c.forEach(function(a){d&&(a.style.display="block");u.appendChild(a)});a.showPage(1);a.onLoad()}function q(d){var a,b,f,m,h,n;a=d.pageIndex+1;n=d.getViewport(g);h=document.createElement("div");h.id="pageContainer"+a;h.className="page";h.style.display="none";m=document.createElement("canvas");m.id="canvas"+a;b=document.createElement("div");b.className="textLayer";b.id="textLayer"+a;h.appendChild(m);h.appendChild(b);e[d.pageIndex]=d;c[d.pageIndex]=h;t[d.pageIndex]=l.BLANK;x(d,n.width,n.height);yViewerJS

Open Source document viewer for webpages, built with HTML and JavaScript.

Learn more and get your own copy on the ViewerJS website.

'+ (b?'

Using the '+d+' ('+e+") plugin to show you this document.

":"")+"

Version "+f+'

Supported by
NLnet Foundation

Made by
KO GmbH

';