|
|
@ -949,14 +949,26 @@ var PDFView = { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var loadingErrorMessage = mozL10n.get('loading_error', null, |
|
|
|
|
|
|
|
'An error occurred while loading the PDF.'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (exception && exception.name === 'InvalidPDFException') { |
|
|
|
|
|
|
|
// change error message also for other builds
|
|
|
|
|
|
|
|
var loadingErrorMessage = mozL10n.get('invalid_file_error', null, |
|
|
|
|
|
|
|
'Invalid or corrupted PDF file.'); |
|
|
|
|
|
|
|
//#if B2G
|
|
|
|
|
|
|
|
// window.alert(loadingErrorMessage);
|
|
|
|
|
|
|
|
// return window.close();
|
|
|
|
|
|
|
|
//#endif
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var loadingIndicator = document.getElementById('loading'); |
|
|
|
var loadingIndicator = document.getElementById('loading'); |
|
|
|
loadingIndicator.textContent = mozL10n.get('loading_error_indicator', |
|
|
|
loadingIndicator.textContent = mozL10n.get('loading_error_indicator', |
|
|
|
null, 'Error'); |
|
|
|
null, 'Error'); |
|
|
|
var moreInfo = { |
|
|
|
var moreInfo = { |
|
|
|
message: message |
|
|
|
message: message |
|
|
|
}; |
|
|
|
}; |
|
|
|
self.error(mozL10n.get('loading_error', null, |
|
|
|
self.error(loadingErrorMessage, moreInfo); |
|
|
|
'An error occurred while loading the PDF.'), moreInfo); |
|
|
|
|
|
|
|
self.loading = false; |
|
|
|
self.loading = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
function getDocumentProgress(progressData) { |
|
|
|
function getDocumentProgress(progressData) { |
|
|
|