From 32f54c32728b589a6f3615cde13af3167fec65fb Mon Sep 17 00:00:00 2001 From: Jonas Date: Fri, 3 May 2013 17:50:18 +0200 Subject: [PATCH 1/4] Fixes issue 3076 --- web/viewer.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/viewer.js b/web/viewer.js index ee93ebff2..ca4666304 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -2236,10 +2236,16 @@ var PageView = function pageView(container, id, scale, return; } - if (scale && scale !== PDFView.currentScale) + if (scale && scale !== PDFView.currentScale) { PDFView.parseScale(scale, true, true); - else if (PDFView.currentScale === UNKNOWN_SCALE) + } else if (PDFView.currentScale === UNKNOWN_SCALE) { PDFView.parseScale(DEFAULT_SCALE, true, true); + } + + if (scale === 'page-fit' && !dest[4]) { + scrollIntoView(div); + return; + } var boundingRect = [ this.viewport.convertToViewportPoint(x, y), From f1f72105b9c689ede0be02f3e7c901cabe307b27 Mon Sep 17 00:00:00 2001 From: piotrex Date: Mon, 6 May 2013 20:21:51 +0300 Subject: [PATCH 2/4] Translated "document_colors_disabled" to PL --- l10n/pl/viewer.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n/pl/viewer.properties b/l10n/pl/viewer.properties index 159d4e040..9aa576f3a 100644 --- a/l10n/pl/viewer.properties +++ b/l10n/pl/viewer.properties @@ -120,4 +120,4 @@ request_password=Plik PDF jest chroniony przez hasło: printing_not_supported=Ostrzeżenie: Drukowanie nie jest w pełni obsługiwane przez tę przeglądarkę. printing_not_ready=Ostrzeżenie: Plik PDF nie jest całkowicie wczytany do drukowania. web_fonts_disabled=Web fonty są nieaktywne. Nie można korzystać z osadzonych czcionek w plikach PDF. -web_colors_disabled=Kolory WWW są nieaktywne. +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. From e64800540f9a216dd472404d9cf80b2afd7d7733 Mon Sep 17 00:00:00 2001 From: Xavier fung Date: Tue, 7 May 2013 09:36:42 +0800 Subject: [PATCH 3/4] Update translation --- l10n/zh-TW/viewer.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n/zh-TW/viewer.properties b/l10n/zh-TW/viewer.properties index 95a886ea7..1ff8ad603 100644 --- a/l10n/zh-TW/viewer.properties +++ b/l10n/zh-TW/viewer.properties @@ -110,4 +110,4 @@ request_password=PDF檔案受密碼保護: printing_not_supported=警告:這個瀏覽器不完全支援列印。 printing_not_ready=警告:PDF檔案未完全加載以進行打印。 web_fonts_disabled=禁止使用網路字型:無法使用嵌入PDF檔案的字型。 -web_colors_disabled=網絡顏色已被停用。 +document_colors_disabled=PDF文件不容許使用自己的顏色:瀏覽器的 “容許頁面選擇自己的顏色“ 選項已被停用。 From 297c305150354d575978b9d211709b6eb89377ac Mon Sep 17 00:00:00 2001 From: Jakob Miland Date: Sun, 7 Apr 2013 17:26:35 +0200 Subject: [PATCH 4/4] Ask for password on failed decryption --- l10n/da/viewer.properties | 1 + l10n/en-US/viewer.properties | 1 + web/viewer.js | 9 ++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/l10n/da/viewer.properties b/l10n/da/viewer.properties index c710189ac..b419caf01 100644 --- a/l10n/da/viewer.properties +++ b/l10n/da/viewer.properties @@ -103,5 +103,6 @@ loading_error=Der skete en fejl under indlæsningen af PDF-filen # Nogle almindelige typer er f.eks.: "Check", "Text", "Comment" og "Note" text_annotation_type=[{{type}} Kommentar] request_password=PDF filen er beskyttet med et kodeord: +invalid_password=Ugyldigt kodeord. printing_not_supported=Advarsel: Denne browser er ikke fuldt understøttet ved udskrift diff --git a/l10n/en-US/viewer.properties b/l10n/en-US/viewer.properties index 99f4ff305..06e68864f 100644 --- a/l10n/en-US/viewer.properties +++ b/l10n/en-US/viewer.properties @@ -119,6 +119,7 @@ missing_file_error=Missing PDF file. # Some common types are e.g.: "Check", "Text", "Comment", "Note" text_annotation_type=[{{type}} Annotation] request_password=PDF is protected by a password: +invalid_password=Invalid Password. printing_not_supported=Warning: Printing is not fully supported by this browser. printing_not_ready=Warning: The PDF is not fully loaded for printing. diff --git a/web/viewer.js b/web/viewer.js index cd55bf304..0751d43f6 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -1008,9 +1008,16 @@ var PDFView = { }, function getDocumentError(message, exception) { if (exception && exception.name === 'PasswordException') { - if (exception.code === 'needpassword') { + if (exception.code === 'needpassword' || + exception.code === 'incorrectpassword') { var promptString = mozL10n.get('request_password', null, 'PDF is protected by a password:'); + + if (exception.code === 'incorrectpassword') { + promptString += '\n' + mozL10n.get('invalid_password', null, + 'Invalid Password.'); + } + password = prompt(promptString); if (password && password.length > 0) { return PDFView.open(url, scale, password);