Merge pull request #3060 from saebekassebil/fixpassword
Ask for password on failed decryption
This commit is contained in:
commit
e5b5c94925
@ -116,6 +116,7 @@ missing_file_error=Manglende PDF-fil
|
|||||||
# Nogle almindelige typer er f.eks.: "Check", "Text", "Comment" og "Note"
|
# Nogle almindelige typer er f.eks.: "Check", "Text", "Comment" og "Note"
|
||||||
text_annotation_type=[{{type}} Kommentar]
|
text_annotation_type=[{{type}} Kommentar]
|
||||||
request_password=PDF filen er beskyttet med et kodeord:
|
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.
|
printing_not_supported=Advarsel: Denne browser er ikke fuldt understøttet ved udskrift.
|
||||||
printing_not_ready=Advarsel: PDF-filen er ikke helt klar til udskrivning.
|
printing_not_ready=Advarsel: PDF-filen er ikke helt klar til udskrivning.
|
||||||
|
@ -116,6 +116,7 @@ missing_file_error=Missing PDF file.
|
|||||||
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
|
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
|
||||||
text_annotation_type=[{{type}} Annotation]
|
text_annotation_type=[{{type}} Annotation]
|
||||||
request_password=PDF is protected by a password:
|
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_supported=Warning: Printing is not fully supported by this browser.
|
||||||
printing_not_ready=Warning: The PDF is not fully loaded for printing.
|
printing_not_ready=Warning: The PDF is not fully loaded for printing.
|
||||||
|
@ -1057,9 +1057,16 @@ var PDFView = {
|
|||||||
},
|
},
|
||||||
function getDocumentError(message, exception) {
|
function getDocumentError(message, exception) {
|
||||||
if (exception && exception.name === 'PasswordException') {
|
if (exception && exception.name === 'PasswordException') {
|
||||||
if (exception.code === 'needpassword') {
|
if (exception.code === 'needpassword' ||
|
||||||
|
exception.code === 'incorrectpassword') {
|
||||||
var promptString = mozL10n.get('request_password', null,
|
var promptString = mozL10n.get('request_password', null,
|
||||||
'PDF is protected by a password:');
|
'PDF is protected by a password:');
|
||||||
|
|
||||||
|
if (exception.code === 'incorrectpassword') {
|
||||||
|
promptString += '\n' + mozL10n.get('invalid_password', null,
|
||||||
|
'Invalid Password.');
|
||||||
|
}
|
||||||
|
|
||||||
password = prompt(promptString);
|
password = prompt(promptString);
|
||||||
if (password && password.length > 0) {
|
if (password && password.length > 0) {
|
||||||
return PDFView.open(url, scale, password);
|
return PDFView.open(url, scale, password);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user