Skip to content

Commit

Permalink
Update pdf.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Apr 10, 2022
1 parent 9266776 commit 9959909
Show file tree
Hide file tree
Showing 21 changed files with 638 additions and 419 deletions.
256 changes: 177 additions & 79 deletions build/pdf.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/pdf.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/pdf.sandbox.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/pdf.sandbox.js.map

Large diffs are not rendered by default.

637 changes: 385 additions & 252 deletions build/pdf.worker.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/pdf.worker.js.map

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions web/debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
* limitations under the License.
*/

"use strict";
let opMap;

// eslint-disable-next-line no-var
var FontInspector = (function FontInspectorClosure() {
const FontInspector = (function FontInspectorClosure() {
let fonts;
let active = false;
const fontAttribute = "data-font-name";
Expand Down Expand Up @@ -154,12 +153,8 @@ var FontInspector = (function FontInspectorClosure() {
};
})();

let opMap;

// Manages all the page steppers.
//
// eslint-disable-next-line no-var
var StepperManager = (function StepperManagerClosure() {
const StepperManager = (function StepperManagerClosure() {
let steppers = [];
let stepperDiv = null;
let stepperControls = null;
Expand Down Expand Up @@ -451,8 +446,7 @@ const Stepper = (function StepperClosure() {
return Stepper;
})();

// eslint-disable-next-line no-var
var Stats = (function Stats() {
const Stats = (function Stats() {
let stats = [];
function clear(node) {
node.textContent = ""; // Remove any `node` contents from the DOM.
Expand Down Expand Up @@ -510,7 +504,7 @@ var Stats = (function Stats() {
})();

// Manages all the debugging tools.
window.PDFBug = (function PDFBugClosure() {
const PDFBug = (function PDFBugClosure() {
const panelWidth = 300;
const buttons = [];
let activePanel = null;
Expand Down Expand Up @@ -562,13 +556,13 @@ window.PDFBug = (function PDFBugClosure() {
container.style.right = panelWidth + "px";

// Initialize all the debugging tools.
for (const [i, tool] of this.tools.entries()) {
for (const tool of this.tools) {
const panel = document.createElement("div");
const panelButton = document.createElement("button");
panelButton.textContent = tool.name;
panelButton.addEventListener("click", event => {
event.preventDefault();
this.selectPanel(i);
this.selectPanel(tool);
});
controls.appendChild(panelButton);
panels.appendChild(panel);
Expand Down Expand Up @@ -609,3 +603,9 @@ window.PDFBug = (function PDFBugClosure() {
},
};
})();

globalThis.FontInspector = FontInspector;
globalThis.StepperManager = StepperManager;
globalThis.Stats = Stats;

export { PDFBug };
1 change: 1 addition & 0 deletions web/locale/be/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ find_next.title=Знайсці наступны выпадак выразу
find_next_label=Наступны
find_highlight=Падфарбаваць усе
find_match_case_label=Адрозніваць вялікія/малыя літары
find_match_diacritics_label=З улікам дыякрытык
find_entire_word_label=Словы цалкам
find_reached_top=Дасягнуты пачатак дакумента, працяг з канца
find_reached_bottom=Дасягнуты канец дакумента, працяг з пачатку
Expand Down
1 change: 1 addition & 0 deletions web/locale/eo/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ find_next.title=Serĉi la venontan aperon de la frazo
find_next_label=Antaŭen
find_highlight=Elstarigi ĉiujn
find_match_case_label=Distingi inter majuskloj kaj minuskloj
find_match_diacritics_label=Respekti supersignojn
find_entire_word_label=Tutaj vortoj
find_reached_top=Komenco de la dokumento atingita, daŭrigado ekde la fino
find_reached_bottom=Fino de la dokumento atingita, daŭrigado ekde la komenco
Expand Down
1 change: 1 addition & 0 deletions web/locale/id/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ find_next.title=Temukan lebih lanjut
find_next_label=Selanjutnya
find_highlight=Sorot semuanya
find_match_case_label=Cocokkan BESAR/kecil
find_match_diacritics_label=Pencocokan Diakritik
find_entire_word_label=Seluruh teks
find_reached_top=Sampai di awal dokumen, dilanjutkan dari bawah
find_reached_bottom=Sampai di akhir dokumen, dilanjutkan dari atas
Expand Down
1 change: 1 addition & 0 deletions web/locale/ja/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ find_next.title=現在より後の位置で指定文字列が現れる部分を
find_next_label=次へ
find_highlight=すべて強調表示
find_match_case_label=大文字/小文字を区別
find_match_diacritics_label=発音区別符号を区別
find_entire_word_label=単語一致
find_reached_top=文書先頭に到達したので末尾から続けて検索します
find_reached_bottom=文書末尾に到達したので先頭から続けて検索します
Expand Down
1 change: 1 addition & 0 deletions web/locale/kk/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ find_next.title=Осы сөздердің мәтіннен келесі кезд
find_next_label=Келесі
find_highlight=Барлығын түспен ерекшелеу
find_match_case_label=Регистрді ескеру
find_match_diacritics_label=Диакритиканы ескеру
find_entire_word_label=Сөздер толығымен
find_reached_top=Құжаттың басына жеттік, соңынан бастап жалғастырамыз
find_reached_bottom=Құжаттың соңына жеттік, басынан бастап жалғастырамыз
Expand Down
1 change: 1 addition & 0 deletions web/locale/nb-NO/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ find_next.title=Finn neste forekomst av frasen
find_next_label=Neste
find_highlight=Uthev alle
find_match_case_label=Skill store/små bokstaver
find_match_diacritics_label=Samsvar diakritiske tegn
find_entire_word_label=Hele ord
find_reached_top=Nådde toppen av dokumentet, fortsetter fra bunnen
find_reached_bottom=Nådde bunnen av dokumentet, fortsetter fra toppen
Expand Down
1 change: 1 addition & 0 deletions web/locale/nn-NO/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ find_next.title=Finn neste førekomst av frasen
find_next_label=Neste
find_highlight=Uthev alle
find_match_case_label=Skil store/små bokstavar
find_match_diacritics_label=Samsvar diakritiske teikn
find_entire_word_label=Heile ord
find_reached_top=Nådde toppen av dokumentet, fortset frå botnen
find_reached_bottom=Nådde botnen av dokumentet, fortset frå toppen
Expand Down
1 change: 1 addition & 0 deletions web/locale/pl/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ find_next.title=Znajdź następne wystąpienie tekstu
find_next_label=Następne
find_highlight=Wyróżnianie wszystkich
find_match_case_label=Rozróżnianie wielkości liter
find_match_diacritics_label=Rozróżnianie liter diakrytyzowanych
find_entire_word_label=Całe słowa
find_reached_top=Początek dokumentu. Wyszukiwanie od końca.
find_reached_bottom=Koniec dokumentu. Wyszukiwanie od początku.
Expand Down
22 changes: 22 additions & 0 deletions web/locale/tg/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@

# Main toolbar buttons (tooltips and alt text for images)
previous.title=Саҳифаи қаблӣ
previous_label=Қаблӣ
next.title=Саҳифаи навбатӣ
next_label=Навбатӣ

# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.
page.title=Саҳифа
# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number
# representing the total number of pages in the document.
of_pages=аз {{pagesCount}}
# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}"
# will be replaced by a number representing the currently visible page,
# respectively a number representing the total number of pages in the document.
page_of_pages=({{pageNumber}} аз {{pagesCount}})

zoom_out.title=Хурд кардан
zoom_out_label=Хурд кардан
Expand All @@ -38,6 +44,11 @@ bookmark_label=Намуди ҷорӣ

# Secondary toolbar and context menu
tools.title=Абзорҳо
tools_label=Абзорҳо
first_page.title=Ба саҳифаи аввал гузаред
first_page_label=Ба саҳифаи аввал гузаред
last_page.title=Ба саҳифаи охирин гузаред
last_page_label=Ба саҳифаи охирин гузаред



Expand All @@ -51,6 +62,12 @@ document_properties_kb={{size_kb}} КБ ({{size_b}} байт)
# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}"
# will be replaced by the PDF file size in megabytes, respectively in bytes.
document_properties_mb={{size_mb}} МБ ({{size_b}} байт)
document_properties_title=Сарлавҳа:
document_properties_author=Муаллиф:
document_properties_subject=Мавзӯъ:
document_properties_keywords=Калимаҳои калидӣ:
document_properties_creation_date=Санаи эҷод:
document_properties_modification_date=Санаи тағйирот:
# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}"
# will be replaced by the creation/modification date, and time, of the PDF file.
document_properties_date_string={{date}}, {{time}}
Expand Down Expand Up @@ -80,6 +97,7 @@ print_progress_close=Бекор кардан
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
toggle_sidebar.title=Фаъол кардани навори ҷонибӣ
attachments_label=Замимаҳо

# LOCALIZATION NOTE (page_landmark): "{{page}}" will be replaced by the page number.
# Thumbnails panel item (tooltip and alt text for images)
Expand All @@ -89,6 +107,9 @@ toggle_sidebar.title=Фаъол кардани навори ҷонибӣ
# number.

# Find panel button title and messages
find_previous_label=Қаблӣ
find_next_label=Навбатӣ
find_highlight=Ҳамаашро бо ранг ҷудо кардан
# LOCALIZATION NOTE (find_match_count): The supported plural forms are
# [one|two|few|many|other], with [other] as the default value.
# "{{current}}" and "{{total}}" will be replaced by a number representing the
Expand Down Expand Up @@ -135,5 +156,6 @@ missing_file_error=Файли PDF ғоиб аст.
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
password_label=Барои кушодани ин файли PDF ниҳонвожаро ворид кунед.
password_ok=ХУБ
password_cancel=Бекор кардан

1 change: 1 addition & 0 deletions web/locale/th/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ find_next.title=หาตำแหน่งถัดไปของวลี
find_next_label=ถัดไป
find_highlight=เน้นสีทั้งหมด
find_match_case_label=ตัวพิมพ์ใหญ่เล็กตรงกัน
find_match_diacritics_label=เครื่องหมายกำกับการออกเสียงตรงกัน
find_entire_word_label=ทั้งคำ
find_reached_top=ค้นหาถึงจุดเริ่มต้นของหน้า เริ่มค้นต่อจากด้านล่าง
find_reached_bottom=ค้นหาถึงจุดสิ้นสุดหน้า เริ่มค้นต่อจากด้านบน
Expand Down
5 changes: 3 additions & 2 deletions web/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -1378,10 +1378,11 @@ select {
.findbar > div {
height: 32px;
}
.findbar.wrapContainers > div {
.findbar.wrapContainers > div,
.findbar.wrapContainers > div#findbarMessageContainer > * {
clear: both;
}
.findbar.wrapContainers > div.findbarMessageContainer {
.findbar.wrapContainers > div#findbarMessageContainer {
height: auto;
}

Expand Down
6 changes: 2 additions & 4 deletions web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<div id="mainContainer">
<div class="findbar hidden doorHanger" id="findbar">
<div id="findbarInputContainer">
<input id="findInput" class="toolbarField" title="Find" placeholder="Find in document…" tabindex="91" data-l10n-id="find_input">
<input id="findInput" class="toolbarField" title="Find" placeholder="Find in document…" tabindex="91" data-l10n-id="find_input" aria-invalid="false">
<div class="splitToolbarButton">
<button id="findPrevious" class="toolbarButton findPrevious" title="Find the previous occurrence of the phrase" tabindex="92" data-l10n-id="find_previous">
<span data-l10n-id="find_previous_label">Previous</span>
Expand All @@ -113,10 +113,8 @@
<label for="findEntireWord" class="toolbarLabel" data-l10n-id="find_entire_word_label">Whole Words</label>
</div>

<div class="findbarMessageContainer">
<div id="findbarMessageContainer" aria-live="polite">
<span id="findResultsCount" class="toolbarLabel"></span>
</div>
<div class="findbarMessageContainer">
<span id="findMsg" class="toolbarLabel"></span>
</div>
</div> <!-- findbar -->
Expand Down
Loading

0 comments on commit 9959909

Please sign in to comment.