roundcubemail-plugins-kolab/plugins/pdfviewer/pdfjs-viewer.diff
2014-01-20 16:48:30 +01:00

125 lines
6.2 KiB
Diff

--- viewer/viewer.html.orig 2014-01-20 16:22:49.000000000 +0100
+++ viewer/viewer.html 2014-01-20 16:38:37.000000000 +0100
@@ -31,12 +31,12 @@
<!-- This snippet is used in production, see Makefile -->
<link rel="resource" type="application/l10n" href="locale/locale.properties"/>
<script type="text/javascript" src="l10n.js"></script>
-<script type="text/javascript" src="../build/pdf.js"></script>
+<script type="text/javascript" src="pdf.min.js"></script>
<script type="text/javascript" src="debugger.js"></script>
- <script type="text/javascript" src="viewer.js"></script>
+ <script type="text/javascript" src="viewer.min.js"></script>
</head>
@@ -88,7 +88,7 @@
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
</button>
- <button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="19" data-l10n-id="open_file">
+ <button id="secondaryOpenFile" class="secondaryToolbarButton openFile hidden" title="Open File" tabindex="19" data-l10n-id="open_file">
<span data-l10n-id="open_file_label">Open</span>
</button>
@@ -96,11 +96,11 @@
<span data-l10n-id="print_label">Print</span>
</button>
- <button id="secondaryDownload" class="secondaryToolbarButton download visibleMediumView" title="Download" tabindex="21" data-l10n-id="download">
+ <button id="secondaryDownload" class="secondaryToolbarButton download hidden" title="Download" tabindex="21" data-l10n-id="download">
<span data-l10n-id="download_label">Download</span>
</button>
- <a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark visibleSmallView" title="Current view (copy or open in new window)" tabindex="22" data-l10n-id="bookmark">
+ <a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark hidden" title="Current view (copy or open in new window)" tabindex="22" data-l10n-id="bookmark">
<span data-l10n-id="bookmark_label">Current View</span>
</a>
@@ -159,7 +159,7 @@
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
</button>
- <button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="13" data-l10n-id="open_file">
+ <button id="openFile" class="toolbarButton openFile hidden" title="Open File" tabindex="13" data-l10n-id="open_file">
<span data-l10n-id="open_file_label">Open</span>
</button>
@@ -167,11 +167,11 @@
<span data-l10n-id="print_label">Print</span>
</button>
- <button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="15" data-l10n-id="download">
+ <button id="download" class="toolbarButton download hidden" title="Download" tabindex="15" data-l10n-id="download">
<span data-l10n-id="download_label">Download</span>
</button>
<!-- <div class="toolbarButtonSpacer"></div> -->
- <a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="16" data-l10n-id="bookmark">
+ <a href="#" id="viewBookmark" class="toolbarButton bookmark hidden" title="Current view (copy or open in new window)" tabindex="16" data-l10n-id="bookmark">
<span data-l10n-id="bookmark_label">Current View</span>
</a>
--- viewer/viewer.js.orig 2014-01-20 16:22:49.000000000 +0100
+++ viewer/viewer.js 2014-01-20 16:32:24.000000000 +0100
@@ -23,7 +23,7 @@
'use strict';
-var DEFAULT_URL = 'compressed.tracemonkey-pldi-09.pdf';
+var DEFAULT_URL = null;
var DEFAULT_SCALE = 'auto';
var DEFAULT_SCALE_DELTA = 1.1;
var UNKNOWN_SCALE = 0;
@@ -55,7 +55,7 @@
};
PDFJS.imageResourcesPath = './images/';
- PDFJS.workerSrc = '../build/pdf.worker.js';
+ PDFJS.workerSrc = 'pdf.worker.min.js';
var mozL10n = document.mozL10n || document.webL10n;
@@ -1581,9 +1581,9 @@
// (except for toggleHandTool, hand_tool.js is responsible for it):
{ element: this.presentationModeButton,
handler: this.presentationModeClick },
- { element: this.openFile, handler: this.openFileClick },
+ //{ element: this.openFile, handler: this.openFileClick },
{ element: this.print, handler: this.printClick },
- { element: this.download, handler: this.downloadClick },
+ //{ element: this.download, handler: this.downloadClick },
{ element: this.firstPage, handler: this.firstPageClick },
{ element: this.lastPage, handler: this.lastPageClick },
{ element: this.pageRotateCw, handler: this.pageRotateCwClick },
@@ -4806,8 +4806,8 @@
document.body.appendChild(fileInput);
if (!window.File || !window.FileReader || !window.FileList || !window.Blob) {
- document.getElementById('openFile').setAttribute('hidden', 'true');
- document.getElementById('secondaryOpenFile').setAttribute('hidden', 'true');
+ //document.getElementById('openFile').setAttribute('hidden', 'true');
+ //document.getElementById('secondaryOpenFile').setAttribute('hidden', 'true');
} else {
document.getElementById('fileInput').value = null;
}
@@ -4970,14 +4970,14 @@
document.getElementById('presentationMode').addEventListener('click',
SecondaryToolbar.presentationModeClick.bind(SecondaryToolbar));
- document.getElementById('openFile').addEventListener('click',
- SecondaryToolbar.openFileClick.bind(SecondaryToolbar));
+// document.getElementById('openFile').addEventListener('click',
+// SecondaryToolbar.openFileClick.bind(SecondaryToolbar));
document.getElementById('print').addEventListener('click',
SecondaryToolbar.printClick.bind(SecondaryToolbar));
- document.getElementById('download').addEventListener('click',
- SecondaryToolbar.downloadClick.bind(SecondaryToolbar));
+// document.getElementById('download').addEventListener('click',
+// SecondaryToolbar.downloadClick.bind(SecondaryToolbar));
PDFView.open(file, 0);