]> source.dussan.org Git - nextcloud-server.git/commitdiff
some styling changes for the pdf viewer
authorRobin Appelman <icewind1991@gmail.com>
Tue, 27 Dec 2011 13:09:22 +0000 (14:09 +0100)
committerRobin Appelman <icewind1991@gmail.com>
Tue, 27 Dec 2011 13:09:22 +0000 (14:09 +0100)
apps/files_pdfviewer/css/viewer.css
apps/files_pdfviewer/js/viewer.js

index a4aad0addc1cb2c4c8349038b026b816d881dd3c..cbab9e70dc2bec93fab008630234ea852833df91 100755 (executable)
   display: none;
 }
 
-/* === Toolbar === */
-#controls2 {
-  padding-top:2.8em;
-  width: 100%;
-  white-space:nowrap;
-  overflow: hidden;
-}
-
 .separator {
   display: inline;
   border-left: 1px solid #d3d3d3;
@@ -222,7 +214,7 @@ canvas {
 
 #viewer {
   /*overflow:auto;*/
-  margin: 44px 0px 0px 0px;
+  margin: 6.3em 0 0 0;
   margin-right:12.5em;
   padding: 8px 0px;
   position:static;
index 2bdc55785885e190de11f5e01eb2e44d930ee719..94aae4e5ac2c64a38a2316e151a9bd9ed6da9587 100755 (executable)
@@ -5,27 +5,27 @@ function hidePDFviewer() {
   $('#controls').html(oldcode);
   $("#viewer").remove();
   $("#loading").remove()
-  $("#controls").css({top:"3.5em",height:"2.8em",zIndex:200});
   document.title = lastTitle;
 }
 function showPDFviewer(dir,filename){
        if(!viewer_is_shown){
-                $("#editor").hide();
-                var url = OC.filePath('files','ajax','download.php')+'?files='+encodeURIComponent(filename)+"&dir="+encodeURIComponent(dir);
-                $('table').hide();
-                function im(path) { return OC.filePath('files_pdfviewer','js','pdfjs/web/images/'+path); }
-                oldcode = $("#controls").html();
-                $("#controls").empty();
-                $("#controls").html('&nbsp;&nbsp;<div id="controls2" style="display:inline;">      <button id="previous" onclick="PDFView.page--;" oncontextmenu="return false;">        <img src="'+im('go-up.svg')+'" align="top" height="10"/>        Previous      </button>      <button id="next" onclick="PDFView.page++;" oncontextmenu="return false;">        <img src="'+im('go-down.svg')+'" align="top" height="10"/>        Next      </button>      <div class="separator"></div>      <input style="width:25px;" type="number" id="pageNumber" onchange="PDFView.page = this.value;" value="1" size="4" min="1" />      <span>/</span>      <span id="numPages">--</span>      <div class="separator"></div>      <button id="zoomOut" title="Zoom Out" onclick="PDFView.zoomOut();" oncontextmenu="return false;">        <img src="'+im('zoom-out.svg')+'" align="top" height="10"/>      </button>      <button id="zoomIn" title="Zoom In" onclick="PDFView.zoomIn();" oncontextmenu="return false;">        <img src="'+im('zoom-in.svg')+'" align="top" height="10"/>      </button>      <div class="separator"></div>      <select id="scaleSelect" onchange="PDFView.parseScale(this.value);" oncontextmenu="return false;">        <option id="customScaleOption" value="custom"></option>        <option value="0.5">50%</option>        <option value="0.75">75%</option>        <option value="1">100%</option>        <option value="1.25" selected="selected">125%</option>        <option value="1.5">150%</option>        <option value="2">200%</option>        <option id="pageWidthOption" value="page-width">Page Width</option>        <option id="pageFitOption" value="page-fit">Page Fit</option>      </select>      <div class="separator"></div>      <button id="print" onclick="window.print();" oncontextmenu="return false;">        <img src="'+im('document-print.svg')+'" align="top" height="10"/>        Print      </button>      <button id="download" title="Download" onclick="PDFView.download();" oncontextmenu="return false;">        <img src="'+im('download.svg')+'" align="top" height="10"/>        Download      </button><button id="close" title="Close viewer" onclick="hidePDFviewer();" oncontextmenu="return false;">x</button>       <span id="info">--</span>    </div>');
-                    oldcontent = $("#content").html();
-                    $("#content").html(oldcontent+'<div id="loading">Loading... 0%</div>    <div id="viewer"></div>');
-                    $("#controls").css({top:"0px",height:"3.5em",zIndex:200});
-                  lastTitle = document.title;
-                  PDFView.Ptitle = filename;
-                  PDFView.open(url,1.00);
-                  $("#pageWidthOption").attr("selected","selected");
-                  $("header").css({zIndex:0});
-                  viewer_is_shown = true;
+               $("#editor").hide();
+               var url = OC.filePath('files','ajax','download.php')+'?files='+encodeURIComponent(filename)+"&dir="+encodeURIComponent(dir);
+               $('table').hide();
+               function im(path) { return OC.filePath('files_pdfviewer','js','pdfjs/web/images/'+path); }
+               oldcode = $("#controls").html();
+               $("#controls").empty();
+               $("#controls").html('<button id="previous" onclick="PDFView.page--;" oncontextmenu="return false;"><img src="'+im('go-up.svg')+'" align="top" height="10"/>Previous</button><button id="next" onclick="PDFView.page++;" oncontextmenu="return false;"><img src="'+im('go-down.svg')+'" align="top" height="10"/>Next</button><div class="separator"></div><input style="width:25px;" type="number" id="pageNumber" onchange="PDFView.page = this.value;" value="1" size="4" min="1" /><span>/</span><span id="numPages">--</span><div class="separator"></div><button id="zoomOut" title="Zoom Out" onclick="PDFView.zoomOut();" oncontextmenu="return false;"><img src="'+im('zoom-out.svg')+'" align="top" height="10"/></button><button id="zoomIn" title="Zoom In" onclick="PDFView.zoomIn();" oncontextmenu="return false;"><img src="'+im('zoom-in.svg')+
+                       '" align="top" height="10"/></button><div class="separator"></div><select id="scaleSelect" onchange="PDFView.parseScale(this.value);" oncontextmenu="return false;"><option id="customScaleOption" value="custom"></option><option value="0.5">50%</option><option value="0.75">75%</option><option value="1">100%</option><option value="1.25" selected="selected">125%</option><option value="1.5">150%</option><option value="2">200%</option><option id="pageWidthOption" value="page-width">Page Width</option><option id="pageFitOption" value="page-fit">Page Fit</option></select><div class="separator"></div><button id="print" onclick="window.print();" oncontextmenu="return false;"><img src="'+im('document-print.svg')+'" align="top" height="10"/>Print</button><button id="download" title="Download" onclick="PDFView.download();" oncontextmenu="return false;">'+
+                       '<img src="'+im('download.svg')+'" align="top" height="10"/>Download</button><button id="close" title="Close viewer" onclick="hidePDFviewer();" oncontextmenu="return false;">x</button><span id="info">--</span></div>');
+               oldcontent = $("#content").html();
+               $("#content").html(oldcontent+'<div id="loading">Loading... 0%</div>    <div id="viewer"></div>');
+               lastTitle = document.title;
+               PDFView.Ptitle = filename;
+               PDFView.open(url,1.00);
+               $("#pageWidthOption").attr("selected","selected");
+               $("header").css({zIndex:0});
+               viewer_is_shown = true;
        }
 }