Update app.js
This commit is contained in:
parent
e751fd0f68
commit
244c528883
118
web/app.js
118
web/app.js
@ -404,10 +404,10 @@ const PDFViewerApplication = {
|
|||||||
const eventBus =
|
const eventBus =
|
||||||
typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")
|
typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")
|
||||||
? new FirefoxEventBus(
|
? new FirefoxEventBus(
|
||||||
AppOptions.get("allowedGlobalEvents"),
|
AppOptions.get("allowedGlobalEvents"),
|
||||||
externalServices,
|
externalServices,
|
||||||
AppOptions.get("isInAutomation")
|
AppOptions.get("isInAutomation")
|
||||||
)
|
)
|
||||||
: new EventBus();
|
: new EventBus();
|
||||||
this.eventBus = AppOptions.eventBus = eventBus;
|
this.eventBus = AppOptions.eventBus = eventBus;
|
||||||
|
|
||||||
@ -448,30 +448,30 @@ const PDFViewerApplication = {
|
|||||||
const annotationEditorMode = AppOptions.get("annotationEditorMode");
|
const annotationEditorMode = AppOptions.get("annotationEditorMode");
|
||||||
const pageColors =
|
const pageColors =
|
||||||
AppOptions.get("forcePageColors") ||
|
AppOptions.get("forcePageColors") ||
|
||||||
window.matchMedia("(forced-colors: active)").matches
|
window.matchMedia("(forced-colors: active)").matches
|
||||||
? {
|
? {
|
||||||
background: AppOptions.get("pageColorsBackground"),
|
background: AppOptions.get("pageColorsBackground"),
|
||||||
foreground: AppOptions.get("pageColorsForeground"),
|
foreground: AppOptions.get("pageColorsForeground"),
|
||||||
}
|
}
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
let altTextManager;
|
let altTextManager;
|
||||||
if (AppOptions.get("enableUpdatedAddImage")) {
|
if (AppOptions.get("enableUpdatedAddImage")) {
|
||||||
altTextManager = appConfig.newAltTextDialog
|
altTextManager = appConfig.newAltTextDialog
|
||||||
? new NewAltTextManager(
|
? new NewAltTextManager(
|
||||||
appConfig.newAltTextDialog,
|
appConfig.newAltTextDialog,
|
||||||
overlayManager,
|
overlayManager,
|
||||||
eventBus
|
eventBus
|
||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
altTextManager = appConfig.altTextDialog
|
altTextManager = appConfig.altTextDialog
|
||||||
? new AltTextManager(
|
? new AltTextManager(
|
||||||
appConfig.altTextDialog,
|
appConfig.altTextDialog,
|
||||||
container,
|
container,
|
||||||
overlayManager,
|
overlayManager,
|
||||||
eventBus
|
eventBus
|
||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -482,15 +482,15 @@ const PDFViewerApplication = {
|
|||||||
const signatureManager =
|
const signatureManager =
|
||||||
AppOptions.get("enableSignatureEditor") && appConfig.addSignatureDialog
|
AppOptions.get("enableSignatureEditor") && appConfig.addSignatureDialog
|
||||||
? new SignatureManager(
|
? new SignatureManager(
|
||||||
appConfig.addSignatureDialog,
|
appConfig.addSignatureDialog,
|
||||||
appConfig.editSignatureDialog,
|
appConfig.editSignatureDialog,
|
||||||
appConfig.annotationEditorParams?.editorSignatureAddSignature ||
|
appConfig.annotationEditorParams?.editorSignatureAddSignature ||
|
||||||
null,
|
null,
|
||||||
overlayManager,
|
overlayManager,
|
||||||
l10n,
|
l10n,
|
||||||
externalServices.createSignatureStorage(eventBus, abortSignal),
|
externalServices.createSignatureStorage(eventBus, abortSignal),
|
||||||
eventBus
|
eventBus
|
||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
const ltr = appConfig.viewerContainer
|
const ltr = appConfig.viewerContainer
|
||||||
@ -499,31 +499,31 @@ const PDFViewerApplication = {
|
|||||||
const commentManager =
|
const commentManager =
|
||||||
AppOptions.get("enableComment") && appConfig.editCommentDialog
|
AppOptions.get("enableComment") && appConfig.editCommentDialog
|
||||||
? new CommentManager(
|
? new CommentManager(
|
||||||
appConfig.editCommentDialog,
|
appConfig.editCommentDialog,
|
||||||
{
|
{
|
||||||
learnMoreUrl: AppOptions.get("commentLearnMoreUrl"),
|
learnMoreUrl: AppOptions.get("commentLearnMoreUrl"),
|
||||||
sidebar:
|
sidebar:
|
||||||
appConfig.annotationEditorParams?.editorCommentsSidebar || null,
|
appConfig.annotationEditorParams?.editorCommentsSidebar || null,
|
||||||
commentsList:
|
commentsList:
|
||||||
appConfig.annotationEditorParams?.editorCommentsSidebarList ||
|
appConfig.annotationEditorParams?.editorCommentsSidebarList ||
|
||||||
null,
|
null,
|
||||||
commentCount:
|
commentCount:
|
||||||
appConfig.annotationEditorParams?.editorCommentsSidebarCount ||
|
appConfig.annotationEditorParams?.editorCommentsSidebarCount ||
|
||||||
null,
|
null,
|
||||||
sidebarTitle:
|
sidebarTitle:
|
||||||
appConfig.annotationEditorParams?.editorCommentsSidebarTitle ||
|
appConfig.annotationEditorParams?.editorCommentsSidebarTitle ||
|
||||||
null,
|
null,
|
||||||
closeButton:
|
closeButton:
|
||||||
appConfig.annotationEditorParams
|
appConfig.annotationEditorParams
|
||||||
?.editorCommentsSidebarCloseButton || null,
|
?.editorCommentsSidebarCloseButton || null,
|
||||||
commentToolbarButton:
|
commentToolbarButton:
|
||||||
appConfig.toolbar?.editorCommentButton || null,
|
appConfig.toolbar?.editorCommentButton || null,
|
||||||
},
|
},
|
||||||
eventBus,
|
eventBus,
|
||||||
linkService,
|
linkService,
|
||||||
overlayManager,
|
overlayManager,
|
||||||
ltr
|
ltr
|
||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
const enableHWA = AppOptions.get("enableHWA"),
|
const enableHWA = AppOptions.get("enableHWA"),
|
||||||
@ -649,8 +649,8 @@ const PDFViewerApplication = {
|
|||||||
overlayManager,
|
overlayManager,
|
||||||
eventBus,
|
eventBus,
|
||||||
l10n,
|
l10n,
|
||||||
/* fileNameLookup = */ () => this._docFilename,
|
/* fileNameLookup = */() => this._docFilename,
|
||||||
/* titleLookup = */ () => this._docTitle
|
/* titleLookup = */() => this._docTitle
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -778,7 +778,7 @@ const PDFViewerApplication = {
|
|||||||
const params = parseQueryString(queryString);
|
const params = parseQueryString(queryString);
|
||||||
file = params.get("file") ?? AppOptions.get("defaultUrl");
|
file = params.get("file") ?? AppOptions.get("defaultUrl");
|
||||||
try {
|
try {
|
||||||
file = new URL(decodeURIComponent(file)).href;
|
file = new URL(file).href;
|
||||||
} catch {
|
} catch {
|
||||||
file = encodeURIComponent(file).replaceAll("%2F", "/");
|
file = encodeURIComponent(file).replaceAll("%2F", "/");
|
||||||
}
|
}
|
||||||
@ -957,7 +957,7 @@ const PDFViewerApplication = {
|
|||||||
this,
|
this,
|
||||||
"supportsPrinting",
|
"supportsPrinting",
|
||||||
AppOptions.get("supportsPrinting") &&
|
AppOptions.get("supportsPrinting") &&
|
||||||
PDFPrintServiceFactory.supportsPrinting
|
PDFPrintServiceFactory.supportsPrinting
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1726,9 +1726,9 @@ const PDFViewerApplication = {
|
|||||||
// Provides some basic debug information
|
// Provides some basic debug information
|
||||||
console.log(
|
console.log(
|
||||||
`PDF ${pdfDocument.fingerprints[0]} [${info.PDFFormatVersion} ` +
|
`PDF ${pdfDocument.fingerprints[0]} [${info.PDFFormatVersion} ` +
|
||||||
`${(metadata?.get("pdf:producer") || info.Producer || "-").trim()} / ` +
|
`${(metadata?.get("pdf:producer") || info.Producer || "-").trim()} / ` +
|
||||||
`${(metadata?.get("xmp:creatortool") || info.Creator || "-").trim()}` +
|
`${(metadata?.get("xmp:creatortool") || info.Creator || "-").trim()}` +
|
||||||
`] (PDF.js: ${version || "?"} [${build || "?"}])`
|
`] (PDF.js: ${version || "?"} [${build || "?"}])`
|
||||||
);
|
);
|
||||||
const pdfTitle = this._docTitle;
|
const pdfTitle = this._docTitle;
|
||||||
|
|
||||||
@ -2380,7 +2380,7 @@ const PDFViewerApplication = {
|
|||||||
document.blockUnblockOnload?.(false);
|
document.blockUnblockOnload?.(false);
|
||||||
|
|
||||||
// Ensure that this method is only ever run once.
|
// Ensure that this method is only ever run once.
|
||||||
this._unblockDocumentLoadEvent = () => {};
|
this._unblockDocumentLoadEvent = () => { };
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user