Bug 832995 - Update pdf.js to version 0.7.82. r=bdahl

This commit is contained in:
Ryan VanderMeulen 2013-01-23 18:08:15 -05:00
parent a0008b7336
commit 4e0a4a3ecf
5 changed files with 575 additions and 333 deletions

View File

@ -1,4 +1,4 @@
This is the pdf.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 0.7.28
Current extension version is: 0.7.82

File diff suppressed because it is too large Load Diff

View File

@ -967,16 +967,19 @@ a:focus > .thumbnail > .thumbnailSelectionRing,
-moz-user-select:none;
}
.outlineItem > .outlineItems {
html[dir='ltr'] .outlineItem > .outlineItems {
margin-left: 20px;
}
html[dir='rtl'] .outlineItem > .outlineItems {
margin-right: 20px;
}
.outlineItem > a {
text-decoration: none;
display: inline-block;
min-width: 95%;
height: 20px;
padding: 2px 0 0 10px;
height: auto;
margin-bottom: 1px;
border-radius: 2px;
color: hsla(0,0%,100%,.8);
@ -984,7 +987,15 @@ a:focus > .thumbnail > .thumbnailSelectionRing,
line-height: 15px;
-moz-user-select:none;
cursor: default;
white-space: nowrap;
white-space: normal;
}
html[dir='ltr'] .outlineItem > a {
padding: 2px 0 5px 10px;
}
html[dir='rtl'] .outlineItem > a {
padding: 2px 10px 5px 0;
}
.outlineItem > a:hover {

View File

@ -751,6 +751,7 @@ var PDFView = {
mouseScrollTimeStamp: 0,
mouseScrollDelta: 0,
lastScroll: 0,
previousPageNumber: 1,
// called once when the document is loaded
initialize: function pdfViewInitialize() {
@ -873,12 +874,14 @@ var PDFView = {
event.initUIEvent('pagechange', false, false, window, 0);
if (!(0 < val && val <= pages.length)) {
this.previousPageNumber = val;
event.pageNumber = this.page;
window.dispatchEvent(event);
return;
}
pages[val - 1].updateStats();
this.previousPageNumber = currentPageNumber;
currentPageNumber = val;
event.pageNumber = val;
window.dispatchEvent(event);
@ -1169,8 +1172,9 @@ var PDFView = {
* and optionally a 'stack' property.
*/
error: function pdfViewError(message, moreInfo) {
var moreInfoText = mozL10n.get('error_build', {build: PDFJS.build},
'PDF.JS Build: {{build}}') + '\n';
var moreInfoText = mozL10n.get('error_version_info',
{version: PDFJS.version || '?', build: PDFJS.build || '?'},
'PDF.js v{{version}} (build: {{build}})') + '\n';
if (moreInfo) {
moreInfoText +=
mozL10n.get('error_message', {message: moreInfo.message},
@ -1308,7 +1312,8 @@ var PDFView = {
// Provides some basic debug information
console.log('PDF ' + pdfDocument.fingerprint + ' [' +
info.PDFFormatVersion + ' ' + (info.Producer || '-') +
' / ' + (info.Creator || '-') + ']');
' / ' + (info.Creator || '-') + ']' +
(PDFJS.version ? ' (PDF.js: ' + PDFJS.version + ')' : ''));
var pdfTitle;
if (metadata) {
@ -1476,12 +1481,21 @@ var PDFView = {
switch (view) {
case 'thumbs':
var wasOutlineViewVisible = thumbsView.classList.contains('hidden');
thumbsButton.classList.add('toggled');
outlineButton.classList.remove('toggled');
thumbsView.classList.remove('hidden');
outlineView.classList.add('hidden');
PDFView.renderHighestPriority();
if (wasOutlineViewVisible) {
// Ensure that the thumbnail of the current page is visible
// when switching from the outline view.
scrollIntoView(document.getElementById('thumbnailContainer' +
this.page));
}
break;
case 'outline':
@ -2208,6 +2222,12 @@ var ThumbnailView = function thumbnailView(container, pdfPage, id) {
div.id = 'thumbnailContainer' + id;
div.className = 'thumbnail';
if (id === 1) {
// Highlight the thumbnail of the first page when no page number is
// specified (or exists in cache) when the document is loaded.
div.classList.add('selected');
}
var ring = document.createElement('div');
ring.className = 'thumbnailSelectionRing';
ring.style.width = canvasWidth + 'px';
@ -3044,7 +3064,7 @@ window.addEventListener('scalechange', function scalechange(evt) {
window.addEventListener('pagechange', function pagechange(evt) {
var page = evt.pageNumber;
if (document.getElementById('pageNumber').value != page) {
if (PDFView.previousPageNumber !== page) {
document.getElementById('pageNumber').value = page;
var selected = document.querySelector('.thumbnail.selected');
if (selected)
@ -3172,7 +3192,7 @@ window.addEventListener('keydown', function keydown(evt) {
case 38: // up arrow
case 33: // pg up
case 8: // backspace
if (!PDFView.isFullscreen) {
if (!PDFView.isFullscreen && PDFView.currentScaleValue !== 'page-fit') {
break;
}
// in fullscreen mode falls throw here
@ -3189,7 +3209,7 @@ window.addEventListener('keydown', function keydown(evt) {
case 40: // down arrow
case 34: // pg down
case 32: // spacebar
if (!PDFView.isFullscreen) {
if (!PDFView.isFullscreen && PDFView.currentScaleValue !== 'page-fit') {
break;
}
// in fullscreen mode falls throw here

View File

@ -86,9 +86,9 @@ find_not_found=Phrase not found
error_more_info=More Information
error_less_info=Less Information
error_close=Close
# LOCALIZATION NOTE (error_build): "{{build}}" will be replaced by the PDF.JS
# build ID.
error_build=PDF.JS Build: {{build}}
# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
# replaced by the PDF.JS version and build ID.
error_version_info=PDF.js v{{version}} (build: {{build}})
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
# english string describing the error.
error_message=Message: {{message}}