mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Merge pull request #18492 from calixteman/new_stamp_dialog
[Editor] Implement the new alt text flow (bug 1909604)
This commit is contained in:
commit
8f45374881
22 changed files with 1366 additions and 91 deletions
32
web/app.js
32
web/app.js
|
@ -64,6 +64,7 @@ import { AltTextManager } from "web-alt_text_manager";
|
|||
import { AnnotationEditorParams } from "web-annotation_editor_params";
|
||||
import { CaretBrowsingMode } from "./caret_browsing.js";
|
||||
import { DownloadManager } from "web-download_manager";
|
||||
import { NewAltTextManager } from "web-new_alt_text_manager";
|
||||
import { OverlayManager } from "./overlay_manager.js";
|
||||
import { PasswordPrompt } from "./password_prompt.js";
|
||||
import { PDFAttachmentViewer } from "web-pdf_attachment_viewer";
|
||||
|
@ -205,6 +206,14 @@ const PDFViewerApplication = {
|
|||
if (mode) {
|
||||
document.documentElement.classList.add(mode);
|
||||
}
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING")) {
|
||||
if (AppOptions.get("enableFakeMLManager")) {
|
||||
this.mlManager =
|
||||
MLManager.getFakeMLManager?.({
|
||||
enableGuessAltText: AppOptions.get("enableGuessAltText"),
|
||||
}) || null;
|
||||
}
|
||||
}
|
||||
} else if (AppOptions.get("enableAltText")) {
|
||||
// We want to load the image-to-text AI engine as soon as possible.
|
||||
this.mlManager = new MLManager({
|
||||
|
@ -433,14 +442,21 @@ const PDFViewerApplication = {
|
|||
foreground: AppOptions.get("pageColorsForeground"),
|
||||
}
|
||||
: null;
|
||||
const altTextManager = appConfig.altTextDialog
|
||||
? new AltTextManager(
|
||||
appConfig.altTextDialog,
|
||||
container,
|
||||
this.overlayManager,
|
||||
eventBus
|
||||
)
|
||||
: null;
|
||||
let altTextManager;
|
||||
if (AppOptions.get("enableUpdatedAddImage")) {
|
||||
altTextManager = appConfig.newAltTextDialog
|
||||
? new NewAltTextManager(appConfig.newAltTextDialog, this.overlayManager)
|
||||
: null;
|
||||
} else {
|
||||
altTextManager = appConfig.altTextDialog
|
||||
? new AltTextManager(
|
||||
appConfig.altTextDialog,
|
||||
container,
|
||||
this.overlayManager,
|
||||
eventBus
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
const enableHWA = AppOptions.get("enableHWA");
|
||||
const pdfViewer = new PDFViewer({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue