Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions resource-bundles/lcins1_pdfjs.resource/web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,20 @@
<button id="secondaryPresentationMode" class="secondaryToolbarButton presentationMode visibleLargeView" title="Switch to Presentation Mode" tabindex="51" data-l10n-id="presentation_mode">
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
</button>

<!-- Commented by KK
<button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file">
<span data-l10n-id="open_file_label">Open</span>
<!-- readded by PteC 1-->
<button id="secondaryDownload" class="secondaryToolbarButton download visibleMediumView" title="Download" tabindex="54" data-l10n-id="download">
<span data-l10n-id="download_label">Download</span>
</button>

<button id="secondaryPrint" class="secondaryToolbarButton print visibleMediumView" title="Print" tabindex="53" data-l10n-id="print">
<span data-l10n-id="print_label">Print</span>
</button>

<button id="secondaryDownload" class="secondaryToolbarButton download visibleMediumView" title="Download" tabindex="54" data-l10n-id="download">
<span data-l10n-id="download_label">Download</span>

<!-- Commented by KK
<button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file">
<span data-l10n-id="open_file_label">Open</span>
</button>



<a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark visibleSmallView" title="Current view (copy or open in new window)" tabindex="55" data-l10n-id="bookmark">
<span data-l10n-id="bookmark_label">Current View</span>
Expand Down Expand Up @@ -198,17 +199,18 @@
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
</button>

<!-- Commented by KK
<button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="32" data-l10n-id="open_file">
<span data-l10n-id="open_file_label">Open</span>
<!-- readded by PteC 2-->
<button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download">
<span data-l10n-id="download_label">Download</span>
</button>

<button id="print" class="toolbarButton print hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print">
<span data-l10n-id="print_label">Print</span>
</button>

<button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download">
<span data-l10n-id="download_label">Download</span>

<!-- Commented by KK
<button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="32" data-l10n-id="open_file">
<span data-l10n-id="open_file_label">Open</span>
</button>
<a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="35" data-l10n-id="bookmark">
<span data-l10n-id="bookmark_label">Current View</span>
Expand Down
18 changes: 12 additions & 6 deletions resource-bundles/lcins1_pdfjs.resource/web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7442,7 +7442,8 @@ var PDFViewerApplication = {
}

var url = this.url.split('#')[0];
var filename = getPDFFileNameFromURL(url);
// use documents title if exists otherwise do the magic
var filename =PDFViewerApplication.documentInfo.Title ? PDFViewerApplication.documentInfo.Title + '.pdf' : getPDFFileNameFromURL(url);
var downloadManager = new DownloadManager();
downloadManager.onerror = function (err) {
// This error won't really be helpful because it's likely the
Expand Down Expand Up @@ -7978,7 +7979,7 @@ function webViewerInitialized() {

var PDFJS = pdfjsLib.PDFJS;

if (PDFViewerApplication.preferencePdfBugEnabled) {
if (PDFViewerApplication.preferencePdfBugEnabled) {
// Special debugging flags in the hash section of the URL.
var hash = document.location.hash.substring(1);
var hashParams = parseQueryString(hash);
Expand Down Expand Up @@ -8115,8 +8116,10 @@ function webViewerInitialized() {
appConfig.toolbar.presentationModeButton.addEventListener('click',
SecondaryToolbar.presentationModeClick.bind(SecondaryToolbar));

/*
appConfig.toolbar.openFile.addEventListener('click',
SecondaryToolbar.openFileClick.bind(SecondaryToolbar));
*/

appConfig.toolbar.print.addEventListener('click',
SecondaryToolbar.printClick.bind(SecondaryToolbar));
Expand All @@ -8125,7 +8128,7 @@ function webViewerInitialized() {
SecondaryToolbar.downloadClick.bind(SecondaryToolbar));


if (file && file.lastIndexOf('file:', 0) === 0) {
if (file && file.lastIndexOf('file:', 0) === 0) {
// file:-scheme. Load the contents in the main thread because QtWebKit
// cannot load file:-URLs in a Web Worker. file:-URLs are usually loaded
// very quickly, so there is no need to set up progress event listeners.
Expand Down Expand Up @@ -8277,9 +8280,12 @@ window.addEventListener('updateviewarea', function (evt) {
}
var href =
PDFViewerApplication.pdfLinkService.getAnchorUrl(location.pdfOpenParams);
PDFViewerApplication.appConfig.toolbar.viewBookmark.href = href;
PDFViewerApplication.appConfig.secondaryToolbar.viewBookmark.href = href;

if(PDFViewerApplication.appConfig.toolbar.viewBookmark) {
PDFViewerApplication.appConfig.toolbar.viewBookmark.href = href;
}
if(PDFViewerApplication.appConfig.secondaryToolbar.viewBookmark) {
PDFViewerApplication.appConfig.secondaryToolbar.viewBookmark.href = href;
}
// Update the current bookmark in the browsing history.
PDFViewerApplication.pdfHistory.updateCurrentBookmark(location.pdfOpenParams,
location.pageNumber);
Expand Down
Binary file added resource-bundles/res.zip
Binary file not shown.
Binary file modified src/staticresources/lcins1_pdfjs.resource
Binary file not shown.