Skip to content

Commit 9ac79a8

Browse files
committed
Merge branch 'master' of https://github.com/mozilla/pdf.js
2 parents ef5aadb + e5b5c94 commit 9ac79a8

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

l10n/da/viewer.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ missing_file_error=Manglende PDF-fil
116116
# Nogle almindelige typer er f.eks.: "Check", "Text", "Comment" og "Note"
117117
text_annotation_type=[{{type}} Kommentar]
118118
request_password=PDF filen er beskyttet med et kodeord:
119+
invalid_password=Ugyldigt kodeord.
119120

120121
printing_not_supported=Advarsel: Denne browser er ikke fuldt understøttet ved udskrift.
121122
printing_not_ready=Advarsel: PDF-filen er ikke helt klar til udskrivning.

l10n/en-US/viewer.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ missing_file_error=Missing PDF file.
116116
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
117117
text_annotation_type=[{{type}} Annotation]
118118
request_password=PDF is protected by a password:
119+
invalid_password=Invalid Password.
119120

120121
printing_not_supported=Warning: Printing is not fully supported by this browser.
121122
printing_not_ready=Warning: The PDF is not fully loaded for printing.

l10n/pl/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@ request_password=Plik PDF jest chroniony przez hasło:
120120
printing_not_supported=Ostrzeżenie: Drukowanie nie jest w pełni obsługiwane przez tę przeglądarkę.
121121
printing_not_ready=Ostrzeżenie: Plik PDF nie jest całkowicie wczytany do drukowania.
122122
web_fonts_disabled=Web fonty są nieaktywne. Nie można korzystać z osadzonych czcionek w plikach PDF.
123-
web_colors_disabled=Kolory WWW są nieaktywne.
123+
document_colors_disabled=Dokumenty PDF nie mają pozwolenia na korzystanie z ich własnych kolorów: \'Pozwalaj stronom stosować inne kolory niż ustawione tutaj\' nie jest aktywne w przeglądarce.

l10n/zh-TW/viewer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ request_password=PDF檔案受密碼保護:
110110
printing_not_supported=警告:這個瀏覽器不完全支援列印。
111111
printing_not_ready=警告:PDF檔案未完全加載以進行打印。
112112
web_fonts_disabled=禁止使用網路字型:無法使用嵌入PDF檔案的字型。
113-
web_colors_disabled=網絡顏色已被停用
113+
document_colors_disabled=PDF文件不容許使用自己的顏色:瀏覽器的 “容許頁面選擇自己的顏色“ 選項已被停用

web/viewer.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,9 +1057,16 @@ var PDFView = {
10571057
},
10581058
function getDocumentError(message, exception) {
10591059
if (exception && exception.name === 'PasswordException') {
1060-
if (exception.code === 'needpassword') {
1060+
if (exception.code === 'needpassword' ||
1061+
exception.code === 'incorrectpassword') {
10611062
var promptString = mozL10n.get('request_password', null,
10621063
'PDF is protected by a password:');
1064+
1065+
if (exception.code === 'incorrectpassword') {
1066+
promptString += '\n' + mozL10n.get('invalid_password', null,
1067+
'Invalid Password.');
1068+
}
1069+
10631070
password = prompt(promptString);
10641071
if (password && password.length > 0) {
10651072
return PDFView.open(url, scale, password);
@@ -2261,10 +2268,16 @@ var PageView = function pageView(container, id, scale,
22612268
return;
22622269
}
22632270

2264-
if (scale && scale !== PDFView.currentScale)
2271+
if (scale && scale !== PDFView.currentScale) {
22652272
PDFView.parseScale(scale, true, true);
2266-
else if (PDFView.currentScale === UNKNOWN_SCALE)
2273+
} else if (PDFView.currentScale === UNKNOWN_SCALE) {
22672274
PDFView.parseScale(DEFAULT_SCALE, true, true);
2275+
}
2276+
2277+
if (scale === 'page-fit' && !dest[4]) {
2278+
scrollIntoView(div);
2279+
return;
2280+
}
22682281

22692282
var boundingRect = [
22702283
this.viewport.convertToViewportPoint(x, y),

0 commit comments

Comments
 (0)