|
|
@ -1330,18 +1330,6 @@ let PDFViewerApplication = { |
|
|
|
window.addEventListener('hashchange', _boundEvents.windowHashChange); |
|
|
|
window.addEventListener('hashchange', _boundEvents.windowHashChange); |
|
|
|
window.addEventListener('beforeprint', _boundEvents.windowBeforePrint); |
|
|
|
window.addEventListener('beforeprint', _boundEvents.windowBeforePrint); |
|
|
|
window.addEventListener('afterprint', _boundEvents.windowAfterPrint); |
|
|
|
window.addEventListener('afterprint', _boundEvents.windowAfterPrint); |
|
|
|
if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) { |
|
|
|
|
|
|
|
_boundEvents.windowChange = (evt) => { |
|
|
|
|
|
|
|
let files = evt.target.files; |
|
|
|
|
|
|
|
if (!files || files.length === 0) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
eventBus.dispatch('fileinputchange', { |
|
|
|
|
|
|
|
fileInput: evt.target, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
window.addEventListener('change', _boundEvents.windowChange); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
unbindEvents() { |
|
|
|
unbindEvents() { |
|
|
@ -1396,10 +1384,6 @@ let PDFViewerApplication = { |
|
|
|
window.removeEventListener('hashchange', _boundEvents.windowHashChange); |
|
|
|
window.removeEventListener('hashchange', _boundEvents.windowHashChange); |
|
|
|
window.removeEventListener('beforeprint', _boundEvents.windowBeforePrint); |
|
|
|
window.removeEventListener('beforeprint', _boundEvents.windowBeforePrint); |
|
|
|
window.removeEventListener('afterprint', _boundEvents.windowAfterPrint); |
|
|
|
window.removeEventListener('afterprint', _boundEvents.windowAfterPrint); |
|
|
|
if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) { |
|
|
|
|
|
|
|
window.removeEventListener('change', _boundEvents.windowChange); |
|
|
|
|
|
|
|
_boundEvents.windowChange = null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_boundEvents.windowResize = null; |
|
|
|
_boundEvents.windowResize = null; |
|
|
|
_boundEvents.windowHashChange = null; |
|
|
|
_boundEvents.windowHashChange = null; |
|
|
@ -1492,6 +1476,16 @@ function webViewerInitialized() { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
fileInput.value = null; |
|
|
|
fileInput.value = null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fileInput.addEventListener('change', function(evt) { |
|
|
|
|
|
|
|
let files = evt.target.files; |
|
|
|
|
|
|
|
if (!files || files.length === 0) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
PDFViewerApplication.eventBus.dispatch('fileinputchange', { |
|
|
|
|
|
|
|
fileInput: evt.target, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
appConfig.toolbar.openFile.setAttribute('hidden', 'true'); |
|
|
|
appConfig.toolbar.openFile.setAttribute('hidden', 'true'); |
|
|
|
appConfig.secondaryToolbar.openFileButton.setAttribute('hidden', 'true'); |
|
|
|
appConfig.secondaryToolbar.openFileButton.setAttribute('hidden', 'true'); |
|
|
@ -1859,9 +1853,11 @@ function webViewerPresentationMode() { |
|
|
|
PDFViewerApplication.requestPresentationMode(); |
|
|
|
PDFViewerApplication.requestPresentationMode(); |
|
|
|
} |
|
|
|
} |
|
|
|
function webViewerOpenFile() { |
|
|
|
function webViewerOpenFile() { |
|
|
|
|
|
|
|
if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) { |
|
|
|
let openFileInputName = PDFViewerApplication.appConfig.openFileInputName; |
|
|
|
let openFileInputName = PDFViewerApplication.appConfig.openFileInputName; |
|
|
|
document.getElementById(openFileInputName).click(); |
|
|
|
document.getElementById(openFileInputName).click(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
function webViewerPrint() { |
|
|
|
function webViewerPrint() { |
|
|
|
window.print(); |
|
|
|
window.print(); |
|
|
|
} |
|
|
|
} |
|
|
|