Skip to content

Commit

Permalink
Merge branch 'update_pdfjs_v4_7_76'
Browse files Browse the repository at this point in the history
  • Loading branch information
tamuratak committed Oct 7, 2024
2 parents 4df40a3 + 0d3e48f commit ada65ad
Show file tree
Hide file tree
Showing 71 changed files with 3,078 additions and 1,221 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@
"latex-utensils": "6.2.0",
"mathjax-full": "3.2.2",
"micromatch": "4.0.8",
"pdfjs-dist": "4.6.82",
"pdfjs-dist": "4.7.76",
"workerpool": "9.1.3",
"ws": "8.18.0"
},
Expand Down
2 changes: 1 addition & 1 deletion viewer/components/editviewerhtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function createForwardBackwardButtons() {
<span>Forward</span>
</button>
`
insertAfterEnd('sidebarToggle', elements)
insertAfterEnd('sidebarToggleButton', elements)
}

function createCheckBoxes() {
Expand Down
23 changes: 7 additions & 16 deletions viewer/components/pagetrimmer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,17 @@ export enum TrimMode {
TRIM_15 = 3,
}

const trimRule05 = { trimValue: 0.05, sheet: document.createElement('style') } as const
const trimRule10 = { trimValue: 0.10, sheet: document.createElement('style') } as const
const trimRule15 = { trimValue: 0.15, sheet: document.createElement('style') } as const
const trimRule05 = { trimValue: 0.05, sheet: new CSSStyleSheet() } as const
const trimRule10 = { trimValue: 0.10, sheet: new CSSStyleSheet() } as const
const trimRule15 = { trimValue: 0.15, sheet: new CSSStyleSheet() } as const
const trimValueAndSheet = [trimRule05, trimRule10, trimRule15] as const
trimValueAndSheet.forEach(({ trimValue, sheet }) => {
document.head.appendChild(sheet)
const left = -100 * trimValue
sheet.textContent = `
.page canvas {
left: ${left}%;
position: relative;
}
.page .textLayer {
left: ${left}%;
}
.page .annotationLayer {
left: ${left}%;
}
`
sheet.insertRule(`.page canvas { left: ${left}%; position: relative; }`)
sheet.insertRule(`.page .textLayer { left: ${left}%; }`)
sheet.insertRule(`.page .annotationLayer { left: ${left}%; }`)
sheet.disabled = true
document.adoptedStyleSheets.push(sheet)
})

function disableAllTrimRuleStylesheets() {
Expand Down
14 changes: 3 additions & 11 deletions viewer/components/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,15 @@ export function showToolbar(animate: boolean) {

export function hidePrintButton() {
if (isEmbedded) {
const dom = document.getElementById('print') as HTMLElement
const dom = document.getElementById('printButton') as HTMLElement
dom.style.display = 'none'
}
}

// Since the width of the selector of scaling depends on each locale,
// we have to set its `max-width` dynamically on initialization.
export function setCssRuleForToolbar() {
let styleSheet: CSSStyleSheet | undefined
for (const style of document.styleSheets) {
if (style.href && /latextoybox.css/.exec(style.href)) {
styleSheet = style
break
}
}
if (!styleSheet) {
return
}
const styleSheet = new CSSStyleSheet()
const scaleSelectContainer = document.getElementById('scaleSelectContainer') as HTMLElement
const scaleWidth = elementWidth(scaleSelectContainer)
const numPages = document.getElementById('numPages') as HTMLElement
Expand All @@ -64,4 +55,5 @@ export function setCssRuleForToolbar() {
const trimMaxWidth = 500 + numPagesWidth + printerButtonWidth
const trimRule = `@media all and (max-width: ${trimMaxWidth}px) { #trimSelectContainer { display: none; } }`
styleSheet.insertRule(trimRule)
document.adoptedStyleSheets.push(styleSheet)
}
17 changes: 9 additions & 8 deletions viewer/latextoybox.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@media all and (max-width: 1100px) {
#toolbarViewerMiddle {
display: table;
margin: auto;
left: auto;
position: inherit;
Expand Down Expand Up @@ -117,22 +116,24 @@ html[dir='rtl'] .findbar {
}

.toolbar {
position: absolute;
top: 0;
transition: all 0.2s cubic-bezier(.23,.96,.57,.99);
}

.toolbar.hide {
top: -32px;
opacity: 0;
transition-duration: 0.4s;
}

.toolbar.hide:hover {
#viewerContainer {
top: 0;
}

#viewerContainer {
top: 0;
.dropdownToolbarButton {
font-size: inherit;
}

.dropdownToolbarButton > select{
font-size: inherit;
}

#viewBookmark {
Expand All @@ -143,7 +144,7 @@ html[dir='rtl'] .findbar {
display: none !important;
}

#download {
#downloadButton {
display: none !important;
}

Expand Down
2 changes: 1 addition & 1 deletion viewer/latextoybox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { ViewerLoading } from './components/viewerloading.js'
import { LwEventBus } from './components/lweventbus.js'
import { PanelManagerConnection } from './components/panelmanagerconnection.js'
import { VolatileConfig } from './components/volatileconfig.js'
import { hidePrintButton, setCssRuleForToolbar } from './components/toolbar.js'
import { trimSelectElement, viewerContainer } from './components/constants.js'
import { hidePrintButton, setCssRuleForToolbar } from './components/toolbar.js'


declare const PDFViewerApplication: IPDFViewerApplication
Expand Down
25 changes: 23 additions & 2 deletions viewer/locale/ar/viewer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,6 @@ pdfjs-editor-stamp-button-label = أضِف أو حرّر الصور
pdfjs-editor-highlight-button =
.title = أبرِز
pdfjs-editor-highlight-button-label = أبرِز
pdfjs-highlight-floating-button =
.title = أبرِز
pdfjs-highlight-floating-button1 =
.title = أبرِز
.aria-label = أبرِز
Expand Down Expand Up @@ -376,6 +374,22 @@ pdfjs-editor-resizer-label-bottom-right = الزاوية اليُمنى السُ
pdfjs-editor-resizer-label-bottom-middle = أسفل الوسط - غيّر الحجم
pdfjs-editor-resizer-label-bottom-left = الزاوية اليُسرى السُفلية - غيّر الحجم
pdfjs-editor-resizer-label-middle-left = مُنتصف اليسار - غيّر الحجم
pdfjs-editor-resizer-top-left =
.aria-label = الزاوية اليُسرى العُليا — غيّر الحجم
pdfjs-editor-resizer-top-middle =
.aria-label = أعلى الوسط - غيّر الحجم
pdfjs-editor-resizer-top-right =
.aria-label = الزاوية اليُمنى العُليا - غيّر الحجم
pdfjs-editor-resizer-middle-right =
.aria-label = اليمين الأوسط - غيّر الحجم
pdfjs-editor-resizer-bottom-right =
.aria-label = الزاوية اليُمنى السُفلى - غيّر الحجم
pdfjs-editor-resizer-bottom-middle =
.aria-label = أسفل الوسط - غيّر الحجم
pdfjs-editor-resizer-bottom-left =
.aria-label = الزاوية اليُسرى السُفلية - غيّر الحجم
pdfjs-editor-resizer-middle-left =
.aria-label = مُنتصف اليسار - غيّر الحجم
## Color picker

Expand All @@ -402,3 +416,10 @@ pdfjs-editor-colorpicker-red =
pdfjs-editor-highlight-show-all-button-label = أظهِر الكل
pdfjs-editor-highlight-show-all-button =
.title = أظهِر الكل
## New alt-text dialog
## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy.


## Image alt-text settings

24 changes: 24 additions & 0 deletions viewer/locale/be/viewer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ pdfjs-document-properties-button-label = Уласцівасці дакумент
pdfjs-document-properties-file-name = Назва файла:
pdfjs-document-properties-file-size = Памер файла:
# Variables:
# $kb (Number) - the PDF file size in kilobytes
# $b (Number) - the PDF file size in bytes
pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } КБ ({ $b } байтаў)
# Variables:
# $mb (Number) - the PDF file size in megabytes
# $b (Number) - the PDF file size in bytes
pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } МБ ({ $b } байтаў)
# 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 } КБ ({ $size_b } байт)
Expand Down Expand Up @@ -374,6 +382,22 @@ pdfjs-editor-resizer-label-bottom-right = Правы ніжні кут — зм
pdfjs-editor-resizer-label-bottom-middle = Пасярэдзіне ўнізе — змяніць памер
pdfjs-editor-resizer-label-bottom-left = Левы ніжні кут — змяніць памер
pdfjs-editor-resizer-label-middle-left = Пасярэдзіне злева — змяніць памер
pdfjs-editor-resizer-top-left =
.aria-label = Верхні левы кут — змяніць памер
pdfjs-editor-resizer-top-middle =
.aria-label = Уверсе пасярэдзіне — змяніць памер
pdfjs-editor-resizer-top-right =
.aria-label = Верхні правы кут — змяніць памер
pdfjs-editor-resizer-middle-right =
.aria-label = Пасярэдзіне справа — змяніць памер
pdfjs-editor-resizer-bottom-right =
.aria-label = Правы ніжні кут — змяніць памер
pdfjs-editor-resizer-bottom-middle =
.aria-label = Пасярэдзіне ўнізе — змяніць памер
pdfjs-editor-resizer-bottom-left =
.aria-label = Левы ніжні кут — змяніць памер
pdfjs-editor-resizer-middle-left =
.aria-label = Пасярэдзіне злева — змяніць памер
## Color picker

Expand Down
16 changes: 16 additions & 0 deletions viewer/locale/bg/viewer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,22 @@ pdfjs-editor-resizer-label-bottom-right = Долен десен ъгъл — п
pdfjs-editor-resizer-label-bottom-middle = Долу в средата — преоразмеряване
pdfjs-editor-resizer-label-bottom-left = Долен ляв ъгъл — преоразмеряване
pdfjs-editor-resizer-label-middle-left = Ляво в средата — преоразмеряване
pdfjs-editor-resizer-top-left =
.aria-label = Горен ляв ъгъл — преоразмеряване
pdfjs-editor-resizer-top-middle =
.aria-label = Горе в средата — преоразмеряване
pdfjs-editor-resizer-top-right =
.aria-label = Горен десен ъгъл — преоразмеряване
pdfjs-editor-resizer-middle-right =
.aria-label = Дясно в средата — преоразмеряване
pdfjs-editor-resizer-bottom-right =
.aria-label = Долен десен ъгъл — преоразмеряване
pdfjs-editor-resizer-bottom-middle =
.aria-label = Долу в средата — преоразмеряване
pdfjs-editor-resizer-bottom-left =
.aria-label = Долен ляв ъгъл — преоразмеряване
pdfjs-editor-resizer-middle-left =
.aria-label = Ляво в средата — преоразмеряване
## Color picker

Expand Down
26 changes: 20 additions & 6 deletions viewer/locale/ca/viewer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ pdfjs-save-button-label = Desa
pdfjs-bookmark-button =
.title = Pàgina actual (mostra l'URL de la pàgina actual)
pdfjs-bookmark-button-label = Pàgina actual
# Used in Firefox for Android.
pdfjs-open-in-app-button =
.title = Obre en una aplicació
# Used in Firefox for Android.
# Length of the translation matters since we are in a mobile context, with limited screen estate.
pdfjs-open-in-app-button-label = Obre en una aplicació
## Secondary toolbar and context menu

Expand Down Expand Up @@ -277,6 +271,12 @@ pdfjs-editor-free-text-button-label = Text
pdfjs-editor-ink-button =
.title = Dibuixa
pdfjs-editor-ink-button-label = Dibuixa
## Remove button for the various kind of editor.


##

# Editor Parameters
pdfjs-editor-free-text-color-input = Color
pdfjs-editor-free-text-size-input = Mida
Expand All @@ -297,3 +297,17 @@ pdfjs-ink-canvas =
## Editor resizers
## This is used in an aria label to help to understand the role of the resizer.


## Color picker


## Show all highlights
## This is a toggle button to show/hide all the highlights.


## New alt-text dialog
## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy.


## Image alt-text settings

24 changes: 24 additions & 0 deletions viewer/locale/cs/viewer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ pdfjs-document-properties-button-label = Vlastnosti dokumentu…
pdfjs-document-properties-file-name = Název souboru:
pdfjs-document-properties-file-size = Velikost souboru:
# Variables:
# $kb (Number) - the PDF file size in kilobytes
# $b (Number) - the PDF file size in bytes
pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } kB ({ $b } bajtů)
# Variables:
# $mb (Number) - the PDF file size in megabytes
# $b (Number) - the PDF file size in bytes
pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bajtů)
# 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 } bajtů)
Expand Down Expand Up @@ -376,6 +384,22 @@ pdfjs-editor-resizer-label-bottom-right = Pravý dolní roh — změna velikosti
pdfjs-editor-resizer-label-bottom-middle = Střed dole — změna velikosti
pdfjs-editor-resizer-label-bottom-left = Levý dolní roh — změna velikosti
pdfjs-editor-resizer-label-middle-left = Vlevo uprostřed — změna velikosti
pdfjs-editor-resizer-top-left =
.aria-label = Levý horní roh — změna velikosti
pdfjs-editor-resizer-top-middle =
.aria-label = Horní střed — změna velikosti
pdfjs-editor-resizer-top-right =
.aria-label = Pravý horní roh — změna velikosti
pdfjs-editor-resizer-middle-right =
.aria-label = Vpravo uprostřed — změna velikosti
pdfjs-editor-resizer-bottom-right =
.aria-label = Pravý dolní roh — změna velikosti
pdfjs-editor-resizer-bottom-middle =
.aria-label = Střed dole — změna velikosti
pdfjs-editor-resizer-bottom-left =
.aria-label = Levý dolní roh — změna velikosti
pdfjs-editor-resizer-middle-left =
.aria-label = Vlevo uprostřed — změna velikosti
## Color picker

Expand Down
Loading

0 comments on commit ada65ad

Please sign in to comment.