|
|
|
@ -233,6 +233,9 @@ var PDFView = {
@@ -233,6 +233,9 @@ var PDFView = {
|
|
|
|
|
Preferences.get('sidebarViewOnLoad').then(function resolved(value) { |
|
|
|
|
self.preferenceSidebarViewOnLoad = value; |
|
|
|
|
}), |
|
|
|
|
Preferences.get('pdfBugEnabled').then(function resolved(value) { |
|
|
|
|
self.preferencesPdfBugEnabled = value; |
|
|
|
|
}), |
|
|
|
|
Preferences.get('disableTextLayer').then(function resolved(value) { |
|
|
|
|
if (PDFJS.disableTextLayer === true) { |
|
|
|
|
return; |
|
|
|
@ -1555,7 +1558,7 @@ var PDFView = {
@@ -1555,7 +1558,7 @@ var PDFView = {
|
|
|
|
|
var params = {}; |
|
|
|
|
for (var i = 0, ii = parts.length; i < ii; ++i) { |
|
|
|
|
var param = parts[i].split('='); |
|
|
|
|
var key = param[0]; |
|
|
|
|
var key = param[0].toLowerCase(); |
|
|
|
|
var value = param.length > 1 ? param[1] : null; |
|
|
|
|
params[decodeURIComponent(key)] = decodeURIComponent(value); |
|
|
|
|
} |
|
|
|
@ -1765,72 +1768,60 @@ function webViewerInitialized() {
@@ -1765,72 +1768,60 @@ function webViewerInitialized() {
|
|
|
|
|
//document.getElementById('secondaryOpenFile').setAttribute('hidden', 'true');
|
|
|
|
|
//#endif
|
|
|
|
|
|
|
|
|
|
//#if !(FIREFOX || MOZCENTRAL)
|
|
|
|
|
var locale = PDFJS.locale || navigator.language; |
|
|
|
|
//#endif
|
|
|
|
|
|
|
|
|
|
//#if !PRODUCTION
|
|
|
|
|
if (true) { |
|
|
|
|
//#else
|
|
|
|
|
//if (PDFView.preferencesPdfBugEnabled) {
|
|
|
|
|
//#endif
|
|
|
|
|
// Special debugging flags in the hash section of the URL.
|
|
|
|
|
var hash = document.location.hash.substring(1); |
|
|
|
|
var hashParams = PDFView.parseQueryString(hash); |
|
|
|
|
|
|
|
|
|
if ('disableWorker' in hashParams) { |
|
|
|
|
PDFJS.disableWorker = (hashParams['disableWorker'] === 'true'); |
|
|
|
|
if ('disableworker' in hashParams) { |
|
|
|
|
PDFJS.disableWorker = (hashParams['disableworker'] === 'true'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ('disableRange' in hashParams) { |
|
|
|
|
PDFJS.disableRange = (hashParams['disableRange'] === 'true'); |
|
|
|
|
if ('disablerange' in hashParams) { |
|
|
|
|
PDFJS.disableRange = (hashParams['disablerange'] === 'true'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ('disableAutoFetch' in hashParams) { |
|
|
|
|
PDFJS.disableAutoFetch = (hashParams['disableAutoFetch'] === 'true'); |
|
|
|
|
if ('disableautofetch' in hashParams) { |
|
|
|
|
PDFJS.disableAutoFetch = (hashParams['disableautofetch'] === 'true'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ('disableFontFace' in hashParams) { |
|
|
|
|
PDFJS.disableFontFace = (hashParams['disableFontFace'] === 'true'); |
|
|
|
|
if ('disablefontface' in hashParams) { |
|
|
|
|
PDFJS.disableFontFace = (hashParams['disablefontface'] === 'true'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ('disableHistory' in hashParams) { |
|
|
|
|
PDFJS.disableHistory = (hashParams['disableHistory'] === 'true'); |
|
|
|
|
if ('disablehistory' in hashParams) { |
|
|
|
|
PDFJS.disableHistory = (hashParams['disablehistory'] === 'true'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ('webgl' in hashParams) { |
|
|
|
|
PDFJS.disableWebGL = (hashParams['webgl'] !== 'true'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ('useOnlyCssZoom' in hashParams) { |
|
|
|
|
PDFJS.useOnlyCssZoom = (hashParams['useOnlyCssZoom'] === 'true'); |
|
|
|
|
if ('useonlycsszoom' in hashParams) { |
|
|
|
|
PDFJS.useOnlyCssZoom = (hashParams['useonlycsszoom'] === 'true'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ('verbosity' in hashParams) { |
|
|
|
|
PDFJS.verbosity = hashParams['verbosity'] | 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ('ignoreCurrentPositionOnZoom' in hashParams) { |
|
|
|
|
if ('ignorecurrentpositiononzoom' in hashParams) { |
|
|
|
|
IGNORE_CURRENT_POSITION_ON_ZOOM = |
|
|
|
|
(hashParams['ignoreCurrentPositionOnZoom'] === 'true'); |
|
|
|
|
(hashParams['ignorecurrentpositiononzoom'] === 'true'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//#if !PRODUCTION
|
|
|
|
|
if ('disableBcmaps' in hashParams && hashParams['disableBcmaps']) { |
|
|
|
|
if ('disablebcmaps' in hashParams && hashParams['disablebcmaps']) { |
|
|
|
|
PDFJS.cMapUrl = '../external/cmaps/'; |
|
|
|
|
PDFJS.cMapPacked = false; |
|
|
|
|
} |
|
|
|
|
//#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#if !(FIREFOX || MOZCENTRAL)
|
|
|
|
|
var locale = PDFJS.locale || navigator.language; |
|
|
|
|
if ('locale' in hashParams) { |
|
|
|
|
locale = hashParams['locale']; |
|
|
|
|
} |
|
|
|
|
mozL10n.setLanguage(locale); |
|
|
|
|
//#endif
|
|
|
|
|
//#if (FIREFOX || MOZCENTRAL)
|
|
|
|
|
//if (!PDFView.supportsDocumentFonts) {
|
|
|
|
|
// PDFJS.disableFontFace = true;
|
|
|
|
|
// console.warn(mozL10n.get('web_fonts_disabled', null,
|
|
|
|
|
// 'Web fonts are disabled: unable to use embedded PDF fonts.'));
|
|
|
|
|
//}
|
|
|
|
|
//#endif
|
|
|
|
|
|
|
|
|
|
if ('textLayer' in hashParams) { |
|
|
|
|
switch (hashParams['textLayer']) { |
|
|
|
|
if ('textlayer' in hashParams) { |
|
|
|
|
switch (hashParams['textlayer']) { |
|
|
|
|
case 'off': |
|
|
|
|
PDFJS.disableTextLayer = true; |
|
|
|
|
break; |
|
|
|
@ -1838,22 +1829,29 @@ function webViewerInitialized() {
@@ -1838,22 +1829,29 @@ function webViewerInitialized() {
|
|
|
|
|
case 'shadow': |
|
|
|
|
case 'hover': |
|
|
|
|
var viewer = document.getElementById('viewer'); |
|
|
|
|
viewer.classList.add('textLayer-' + hashParams['textLayer']); |
|
|
|
|
viewer.classList.add('textLayer-' + hashParams['textlayer']); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//#if !(FIREFOX || MOZCENTRAL)
|
|
|
|
|
if ('pdfBug' in hashParams) { |
|
|
|
|
//#else
|
|
|
|
|
//if ('pdfBug' in hashParams && FirefoxCom.requestSync('pdfBugEnabled')) {
|
|
|
|
|
//#endif
|
|
|
|
|
if ('pdfbug' in hashParams) { |
|
|
|
|
PDFJS.pdfBug = true; |
|
|
|
|
var pdfBug = hashParams['pdfBug']; |
|
|
|
|
var pdfBug = hashParams['pdfbug']; |
|
|
|
|
var enabled = pdfBug.split(','); |
|
|
|
|
PDFBug.enable(enabled); |
|
|
|
|
PDFBug.init(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//#if !(FIREFOX || MOZCENTRAL)
|
|
|
|
|
mozL10n.setLanguage(locale); |
|
|
|
|
//#endif
|
|
|
|
|
//#if (FIREFOX || MOZCENTRAL)
|
|
|
|
|
//if (!PDFView.supportsDocumentFonts) {
|
|
|
|
|
// PDFJS.disableFontFace = true;
|
|
|
|
|
// console.warn(mozL10n.get('web_fonts_disabled', null,
|
|
|
|
|
// 'Web fonts are disabled: unable to use embedded PDF fonts.'));
|
|
|
|
|
//}
|
|
|
|
|
//#endif
|
|
|
|
|
|
|
|
|
|
if (!PDFView.supportsPrinting) { |
|
|
|
|
document.getElementById('print').classList.add('hidden'); |
|
|
|
|