Skip to content

Commit

Permalink
Update pdf.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Oct 29, 2023
1 parent b9da6db commit 1c50426
Show file tree
Hide file tree
Showing 121 changed files with 31,491 additions and 506 deletions.
26 changes: 9 additions & 17 deletions build/pdf.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -865,10 +865,10 @@ class TextAnnotationElement extends AnnotationElement {
this.container.classList.add("textAnnotation");
const image = document.createElement("img");
image.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg";
image.dataset.l10nId = "pdfjs-text-annotation-type";
image.dataset.l10nArgs = JSON.stringify({
image.setAttribute("data-l10n-id", "pdfjs-text-annotation-type");
image.setAttribute("data-l10n-args", JSON.stringify({
type: this.data.name
});
}));
if (!this.data.popupRef && this.hasPopupData) {
this._createPopup();
}
Expand All @@ -892,11 +892,7 @@ class WidgetAnnotationElement extends AnnotationElement {
}
}
_getKeyModifier(event) {
const {
isWin,
isMac
} = util.FeatureTest.platform;
return isWin && event.ctrlKey || isMac && event.metaKey;
return util.FeatureTest.platform.isMac ? event.metaKey : event.ctrlKey;
}
_setEventListener(element, elementData, baseName, eventName, valueGetter) {
if (baseName.includes("mouse")) {
Expand Down Expand Up @@ -1841,11 +1837,11 @@ class PopupElement {
if (this.#dateObj) {
const modificationDate = document.createElement("span");
modificationDate.classList.add("popupDate");
modificationDate.dataset.l10nId = "pdfjs-annotation-date-string";
modificationDate.dataset.l10nArgs = JSON.stringify({
modificationDate.setAttribute("data-l10n-id", "pdfjs-annotation-date-string");
modificationDate.setAttribute("data-l10n-args", JSON.stringify({
date: this.#dateObj.toLocaleDateString(),
time: this.#dateObj.toLocaleTimeString()
});
}));
header.append(modificationDate);
}
const contentsObj = this.#contentsObj;
Expand Down Expand Up @@ -2368,14 +2364,12 @@ class AnnotationLayer {
div,
accessibilityManager,
annotationCanvasMap,
l10n,
page,
viewport
}) {
this.div = div;
this.#accessibilityManager = accessibilityManager;
this.#annotationCanvasMap = annotationCanvasMap;
this.l10n = l10n;
this.page = page;
this.viewport = viewport;
this.zIndex = 0;
Expand Down Expand Up @@ -4524,7 +4518,7 @@ class InternalRenderTask {
}
}
const version = '4.0.0';
const build = 'da186d1';
const build = '80612f3';

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });
Expand Down Expand Up @@ -15379,7 +15373,7 @@ _display_api_js__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.t


const pdfjsVersion = '4.0.0';
const pdfjsBuild = 'da186d1';
const pdfjsBuild = '80612f3';

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });
Expand Down Expand Up @@ -16414,12 +16408,10 @@ class FeatureTest {
static get platform() {
if (typeof navigator === "undefined") {
return shadow(this, "platform", {
isWin: false,
isMac: false
});
}
return shadow(this, "platform", {
isWin: navigator.platform.includes("Win"),
isMac: navigator.platform.includes("Mac")
});
}
Expand Down
2 changes: 1 addition & 1 deletion build/pdf.mjs.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/pdf.sandbox.mjs

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions build/pdf.worker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,10 @@ class FeatureTest {
static get platform() {
if (typeof navigator === "undefined") {
return shadow(this, "platform", {
isWin: false,
isMac: false
});
}
return shadow(this, "platform", {
isWin: navigator.platform.includes("Win"),
isMac: navigator.platform.includes("Mac")
});
}
Expand Down Expand Up @@ -38578,13 +38576,13 @@ class Catalog {
return shadow(this, "optionalContentConfig", null);
}
const groups = [];
const groupRefs = [];
const groupRefs = new RefSet();
for (const groupRef of groupsData) {
if (!(groupRef instanceof Ref)) {
if (!(groupRef instanceof Ref) || groupRefs.has(groupRef)) {
continue;
}
groupRefs.push(groupRef);
const group = this.xref.fetchIfRef(groupRef);
groupRefs.put(groupRef);
const group = this.xref.fetch(groupRef);
groups.push({
id: groupRef.toString(),
name: typeof group.get("Name") === "string" ? stringToPDFString(group.get("Name")) : null,
Expand All @@ -38609,7 +38607,7 @@ class Catalog {
if (!(value instanceof Ref)) {
continue;
}
if (contentGroupRefs.includes(value)) {
if (contentGroupRefs.has(value)) {
onParsed.push(value.toString());
}
}
Expand All @@ -38622,7 +38620,7 @@ class Catalog {
}
const order = [];
for (const value of refs) {
if (value instanceof Ref && contentGroupRefs.includes(value)) {
if (value instanceof Ref && contentGroupRefs.has(value)) {
parsedOrderRefs.put(value);
order.push(value.toString());
continue;
Expand Down Expand Up @@ -50887,6 +50885,9 @@ class Annotation {
}
setFlags(flags) {
this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0;
if (this.flags & AnnotationFlag.INVISIBLE && this.constructor.name !== "Annotation") {
this.flags ^= AnnotationFlag.INVISIBLE;
}
}
hasFlag(flag) {
return this._hasFlag(this.flags, flag);
Expand Down Expand Up @@ -51521,7 +51522,7 @@ class WidgetAnnotation extends Annotation {
return !!(this.data.fieldFlags & flag);
}
_isViewable(flags) {
return !this._hasFlag(flags, AnnotationFlag.INVISIBLE);
return true;
}
mustBeViewed(annotationStorage, renderForms) {
if (renderForms) {
Expand Down Expand Up @@ -52386,7 +52387,7 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
}
}
_processRadioButton(params) {
this.data.fieldValue = this.data.buttonValue = null;
this.data.buttonValue = null;
const fieldParent = params.dict.get("Parent");
if (fieldParent instanceof Dict) {
this.parent = params.dict.getRaw("Parent");
Expand Down Expand Up @@ -56964,7 +56965,7 @@ if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" &&
;// CONCATENATED MODULE: ./src/pdf.worker.js

const pdfjsVersion = '4.0.0';
const pdfjsBuild = 'da186d1';
const pdfjsBuild = '80612f3';

var __webpack_exports__WorkerMessageHandler = __webpack_exports__.WorkerMessageHandler;
export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler };
Expand Down
2 changes: 1 addition & 1 deletion build/pdf.worker.mjs.map

Large diffs are not rendered by default.

225 changes: 225 additions & 0 deletions web/locale/ach/viewer.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.


## Main toolbar buttons (tooltips and alt text for images)

pdfjs-previous-button =
.title = Pot buk mukato
pdfjs-previous-button-label = Mukato
pdfjs-next-button =
.title = Pot buk malubo
pdfjs-next-button-label = Malubo
# .title: Tooltip for the pageNumber input.
pdfjs-page-input =
.title = Pot buk
# Variables:
# $pagesCount (Number) - the total number of pages in the document
# This string follows an input field with the number of the page currently displayed.
pdfjs-of-pages = pi { $pagesCount }
# Variables:
# $pageNumber (Number) - the currently visible page
# $pagesCount (Number) - the total number of pages in the document
pdfjs-page-of-pages = ({ $pageNumber } me { $pagesCount })
pdfjs-zoom-out-button =
.title = Jwik Matidi
pdfjs-zoom-out-button-label = Jwik Matidi
pdfjs-zoom-in-button =
.title = Kwot Madit
pdfjs-zoom-in-button-label = Kwot Madit
pdfjs-zoom-select =
.title = Kwoti
pdfjs-presentation-mode-button =
.title = Lokke i kit me tyer
pdfjs-presentation-mode-button-label = Kit me tyer
pdfjs-open-file-button =
.title = Yab Pwail
pdfjs-open-file-button-label = Yab
pdfjs-print-button =
.title = Go
pdfjs-print-button-label = Go
## Secondary toolbar and context menu

pdfjs-tools-button =
.title = Gintic
pdfjs-tools-button-label = Gintic
pdfjs-first-page-button =
.title = Cit i pot buk mukwongo
pdfjs-first-page-button-label = Cit i pot buk mukwongo
pdfjs-last-page-button =
.title = Cit i pot buk magiko
pdfjs-last-page-button-label = Cit i pot buk magiko
pdfjs-page-rotate-cw-button =
.title = Wire i tung lacuc
pdfjs-page-rotate-cw-button-label = Wire i tung lacuc
pdfjs-page-rotate-ccw-button =
.title = Wire i tung lacam
pdfjs-page-rotate-ccw-button-label = Wire i tung lacam
pdfjs-cursor-text-select-tool-button =
.title = Cak gitic me yero coc
pdfjs-cursor-text-select-tool-button-label = Gitic me yero coc
pdfjs-cursor-hand-tool-button =
.title = Cak gitic me cing
pdfjs-cursor-hand-tool-button-label = Gitic cing
## Document properties dialog

pdfjs-document-properties-button =
.title = Jami me gin acoya…
pdfjs-document-properties-button-label = Jami me gin acoya…
pdfjs-document-properties-file-name = Nying pwail:
pdfjs-document-properties-file-size = Dit pa pwail:
# Variables:
# $size_kb (Number) - the PDF file size in kilobytes
# $size_b (Number) - the PDF file size in bytes
pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes)
# Variables:
# $size_mb (Number) - the PDF file size in megabytes
# $size_b (Number) - the PDF file size in bytes
pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes)
pdfjs-document-properties-title = Wiye:
pdfjs-document-properties-author = Ngat mucoyo:
pdfjs-document-properties-subject = Subjek:
pdfjs-document-properties-keywords = Lok mapire tek:
pdfjs-document-properties-creation-date = Nino dwe me cwec:
pdfjs-document-properties-modification-date = Nino dwe me yub:
# Variables:
# $date (Date) - the creation/modification date of the PDF file
# $time (Time) - the creation/modification time of the PDF file
pdfjs-document-properties-date-string = { $date }, { $time }
pdfjs-document-properties-creator = Lacwec:
pdfjs-document-properties-producer = Layub PDF:
pdfjs-document-properties-version = Kit PDF:
pdfjs-document-properties-page-count = Kwan me pot buk:
pdfjs-document-properties-page-size = Dit pa potbuk:
pdfjs-document-properties-page-size-unit-inches = i
pdfjs-document-properties-page-size-unit-millimeters = mm
pdfjs-document-properties-page-size-orientation-portrait = atir
pdfjs-document-properties-page-size-orientation-landscape = arii
pdfjs-document-properties-page-size-name-a-three = A3
pdfjs-document-properties-page-size-name-a-four = A4
pdfjs-document-properties-page-size-name-letter = Waraga
pdfjs-document-properties-page-size-name-legal = Cik
## Variables:
## $width (Number) - the width of the (current) page
## $height (Number) - the height of the (current) page
## $unit (String) - the unit of measurement of the (current) page
## $name (String) - the name of the (current) page
## $orientation (String) - the orientation of the (current) page

pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation })
pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation })
##

pdfjs-document-properties-linearized-yes = Eyo
pdfjs-document-properties-linearized-no = Pe
pdfjs-document-properties-close-button = Lor
## Print

pdfjs-print-progress-message = Yubo coc me agoya…
# Variables:
# $progress (Number) - percent value
pdfjs-print-progress-percent = { $progress }%
pdfjs-print-progress-close-button = Juki
pdfjs-printing-not-supported = Ciko: Layeny ma pe teno goyo liweng.
pdfjs-printing-not-ready = Ciko: PDF pe ocane weng me agoya.
## Tooltips and alt text for side panel toolbar buttons

pdfjs-toggle-sidebar-button =
.title = Lok gintic ma inget
pdfjs-toggle-sidebar-button-label = Lok gintic ma inget
pdfjs-document-outline-button =
.title = Nyut Wiyewiye me Gin acoya (dii-kiryo me yaro/kano jami weng)
pdfjs-document-outline-button-label = Pek pa gin acoya
pdfjs-attachments-button =
.title = Nyut twec
pdfjs-attachments-button-label = Twec
pdfjs-thumbs-button =
.title = Nyut cal
pdfjs-thumbs-button-label = Cal
pdfjs-findbar-button =
.title = Nong iye gin acoya
pdfjs-findbar-button-label = Nong
## Thumbnails panel item (tooltip and alt text for images)

# Variables:
# $page (Number) - the page number
pdfjs-thumb-page-title =
.title = Pot buk { $page }
# Variables:
# $page (Number) - the page number
pdfjs-thumb-page-canvas =
.aria-label = Cal me pot buk { $page }
## Find panel button title and messages

pdfjs-find-input =
.title = Nong
.placeholder = Nong i dokumen…
pdfjs-find-previous-button =
.title = Nong timme pa lok mukato
pdfjs-find-previous-button-label = Mukato
pdfjs-find-next-button =
.title = Nong timme pa lok malubo
pdfjs-find-next-button-label = Malubo
pdfjs-find-highlight-checkbox = Ket Lanyut I Weng
pdfjs-find-match-case-checkbox-label = Lok marwate
pdfjs-find-reached-top = Oo iwi gin acoya, omede ki i tere
pdfjs-find-reached-bottom = Oo i agiki me gin acoya, omede ki iwiye
pdfjs-find-not-found = Lok pe ononge
## Predefined zoom values

pdfjs-page-scale-width = Lac me iye pot buk
pdfjs-page-scale-fit = Porre me pot buk
pdfjs-page-scale-auto = Kwot pire kene
pdfjs-page-scale-actual = Dite kikome
# Variables:
# $scale (Number) - percent value for page scale
pdfjs-page-scale-percent = { $scale }%
## PDF page


## Loading indicator messages

pdfjs-loading-error = Bal otime kun cano PDF.
pdfjs-invalid-file-error = Pwail me PDF ma pe atir onyo obale woko.
pdfjs-missing-file-error = Pwail me PDF tye ka rem.
pdfjs-unexpected-response-error = Lagam mape kigeno pa lapok tic.
pdfjs-rendering-error = Bal otime i kare me nyuto pot buk.
## Annotations

# .alt: This is used as a tooltip.
# Variables:
# $type (String) - an annotation type from a list defined in the PDF spec
# (32000-1:2008 Table 169 – Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
pdfjs-text-annotation-type =
.alt = [{ $type } Lok angea manok]
## Password

pdfjs-password-label = Ket mung me donyo me yabo pwail me PDF man.
pdfjs-password-invalid = Mung me donyo pe atir. Tim ber i tem doki.
pdfjs-password-ok-button = OK
pdfjs-password-cancel-button = Juki
pdfjs-web-fonts-disabled = Kijuko dit pa coc me kakube woko: pe romo tic ki dit pa coc me PDF ma kiketo i kine.
## Editing


## Alt-text dialog


## Editor resizers
## This is used in an aria label to help to understand the role of the resizer.

Loading

0 comments on commit 1c50426

Please sign in to comment.