Browse Source

PDF.js version 2.0.347 - See mozilla/pdf.js@f1413a9096c10029689cfadfadc22971e95a9f53

master v2.0.347
pdfjsbot 7 years ago
parent
commit
532131cdc9
  1. 2
      bower.json
  2. 14
      build/pdf.js
  3. 2
      build/pdf.js.map
  4. 2
      build/pdf.min.js
  5. 6
      build/pdf.worker.js
  6. 2
      build/pdf.worker.js.map
  7. 2
      build/pdf.worker.min.js
  8. 2
      lib/core/worker.js
  9. 6
      lib/display/api.js
  10. 4
      lib/display/global.js
  11. 4
      lib/pdf.js
  12. 4
      lib/pdf.worker.js
  13. 3
      lib/web/pdf_thumbnail_view.js
  14. 30
      lib/web/pdf_thumbnail_viewer.js
  15. 2
      package.json

2
bower.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "pdfjs-dist",
"version": "2.0.345",
"version": "2.0.347",
"main": [
"build/pdf.js",
"build/pdf.worker.js"

14
build/pdf.js

@ -3299,7 +3299,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { @@ -3299,7 +3299,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
if (worker.destroyed) {
return Promise.reject(new Error('Worker was destroyed'));
}
var apiVersion = '2.0.345';
var apiVersion = '2.0.347';
source.disableRange = (0, _dom_utils.getDefaultSetting)('disableRange');
source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
@ -4698,8 +4698,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -4698,8 +4698,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
}();
var version, build;
{
exports.version = version = '2.0.345';
exports.build = build = '7bb06649';
exports.version = version = '2.0.347';
exports.build = build = 'f1413a90';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -7457,8 +7457,8 @@ exports.SVGGraphics = SVGGraphics; @@ -7457,8 +7457,8 @@ exports.SVGGraphics = SVGGraphics;
"use strict";
var pdfjsVersion = '2.0.345';
var pdfjsBuild = '7bb06649';
var pdfjsVersion = '2.0.347';
var pdfjsBuild = 'f1413a90';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(120);
var pdfjsDisplayAPI = __w_pdfjs_require__(58);
@ -12743,8 +12743,8 @@ if (!_global_scope2.default.PDFJS) { @@ -12743,8 +12743,8 @@ if (!_global_scope2.default.PDFJS) {
}
var PDFJS = _global_scope2.default.PDFJS;
{
PDFJS.version = '2.0.345';
PDFJS.build = '7bb06649';
PDFJS.version = '2.0.347';
PDFJS.build = 'f1413a90';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {

2
build/pdf.js.map

File diff suppressed because one or more lines are too long

2
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

6
build/pdf.worker.js vendored

@ -22295,8 +22295,8 @@ exports.PostScriptCompiler = PostScriptCompiler; @@ -22295,8 +22295,8 @@ exports.PostScriptCompiler = PostScriptCompiler;
"use strict";
var pdfjsVersion = '2.0.345';
var pdfjsBuild = '7bb06649';
var pdfjsVersion = '2.0.347';
var pdfjsBuild = 'f1413a90';
var pdfjsCoreWorker = __w_pdfjs_require__(74);
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
@ -22509,7 +22509,7 @@ var WorkerMessageHandler = { @@ -22509,7 +22509,7 @@ var WorkerMessageHandler = {
var cancelXHRs = null;
var WorkerTasks = [];
var apiVersion = docParams.apiVersion;
var workerVersion = '2.0.345';
var workerVersion = '2.0.347';
if (apiVersion !== null && apiVersion !== workerVersion) {
throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
}

2
build/pdf.worker.js.map vendored

File diff suppressed because one or more lines are too long

2
build/pdf.worker.min.js vendored

File diff suppressed because one or more lines are too long

2
lib/core/worker.js

@ -223,7 +223,7 @@ var WorkerMessageHandler = { @@ -223,7 +223,7 @@ var WorkerMessageHandler = {
var cancelXHRs = null;
var WorkerTasks = [];
var apiVersion = docParams.apiVersion;
var workerVersion = '2.0.345';
var workerVersion = '2.0.347';
if (apiVersion !== null && apiVersion !== workerVersion) {
throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
}

6
lib/display/api.js

@ -178,7 +178,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { @@ -178,7 +178,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
if (worker.destroyed) {
return Promise.reject(new Error('Worker was destroyed'));
}
var apiVersion = '2.0.345';
var apiVersion = '2.0.347';
source.disableRange = (0, _dom_utils.getDefaultSetting)('disableRange');
source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
@ -1577,8 +1577,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -1577,8 +1577,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
}();
var version, build;
{
exports.version = version = '2.0.345';
exports.build = build = '7bb06649';
exports.version = version = '2.0.347';
exports.build = build = 'f1413a90';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;

4
lib/display/global.js

@ -51,8 +51,8 @@ if (!_global_scope2.default.PDFJS) { @@ -51,8 +51,8 @@ if (!_global_scope2.default.PDFJS) {
}
var PDFJS = _global_scope2.default.PDFJS;
{
PDFJS.version = '2.0.345';
PDFJS.build = '7bb06649';
PDFJS.version = '2.0.347';
PDFJS.build = 'f1413a90';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {

4
lib/pdf.js

@ -21,8 +21,8 @@ @@ -21,8 +21,8 @@
*/
'use strict';
var pdfjsVersion = '2.0.345';
var pdfjsBuild = '7bb06649';
var pdfjsVersion = '2.0.347';
var pdfjsBuild = 'f1413a90';
var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayGlobal = require('./display/global.js');
var pdfjsDisplayAPI = require('./display/api.js');

4
lib/pdf.worker.js vendored

@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
*/
'use strict';
var pdfjsVersion = '2.0.345';
var pdfjsBuild = '7bb06649';
var pdfjsVersion = '2.0.347';
var pdfjsBuild = 'f1413a90';
var pdfjsCoreWorker = require('./core/worker.js');
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

3
lib/web/pdf_thumbnail_view.js

@ -117,9 +117,6 @@ var PDFThumbnailView = function () { @@ -117,9 +117,6 @@ var PDFThumbnailView = function () {
div.className = 'thumbnail';
div.setAttribute('data-page-number', this.id);
this.div = div;
if (id === 1) {
div.classList.add('selected');
}
var ring = document.createElement('div');
ring.className = 'thumbnailSelectionRing';
var borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH;

30
lib/web/pdf_thumbnail_viewer.js

@ -35,6 +35,7 @@ var _pdf_thumbnail_view = require('./pdf_thumbnail_view'); @@ -35,6 +35,7 @@ var _pdf_thumbnail_view = require('./pdf_thumbnail_view');
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var THUMBNAIL_SCROLL_MARGIN = -19;
var THUMBNAIL_SELECTED_CLASS = 'selected';
var PDFThumbnailViewer = function () {
function PDFThumbnailViewer(_ref) {
@ -71,14 +72,19 @@ var PDFThumbnailViewer = function () { @@ -71,14 +72,19 @@ var PDFThumbnailViewer = function () {
}
}, {
key: 'scrollThumbnailIntoView',
value: function scrollThumbnailIntoView(page) {
var selected = document.querySelector('.thumbnail.selected');
if (selected) {
selected.classList.remove('selected');
value: function scrollThumbnailIntoView(pageNumber) {
if (!this.pdfDocument) {
return;
}
var thumbnailView = this._thumbnails[pageNumber - 1];
if (!thumbnailView) {
console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');
return;
}
var thumbnail = document.querySelector('div.thumbnail[data-page-number="' + page + '"]');
if (thumbnail) {
thumbnail.classList.add('selected');
if (pageNumber !== this._currentPageNumber) {
var prevThumbnailView = this._thumbnails[this._currentPageNumber - 1];
prevThumbnailView.div.classList.remove(THUMBNAIL_SELECTED_CLASS);
thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);
}
var visibleThumbs = this._getVisibleThumbs();
var numVisibleThumbs = visibleThumbs.views.length;
@ -86,11 +92,11 @@ var PDFThumbnailViewer = function () { @@ -86,11 +92,11 @@ var PDFThumbnailViewer = function () {
var first = visibleThumbs.first.id;
var last = numVisibleThumbs > 1 ? visibleThumbs.last.id : first;
var shouldScroll = false;
if (page <= first || page >= last) {
if (pageNumber <= first || pageNumber >= last) {
shouldScroll = true;
} else {
visibleThumbs.views.some(function (view) {
if (view.id !== page) {
if (view.id !== pageNumber) {
return false;
}
shouldScroll = view.percent < 100;
@ -98,9 +104,10 @@ var PDFThumbnailViewer = function () { @@ -98,9 +104,10 @@ var PDFThumbnailViewer = function () {
});
}
if (shouldScroll) {
(0, _ui_utils.scrollIntoView)(thumbnail, { top: THUMBNAIL_SCROLL_MARGIN });
(0, _ui_utils.scrollIntoView)(thumbnailView.div, { top: THUMBNAIL_SCROLL_MARGIN });
}
}
this._currentPageNumber = pageNumber;
}
}, {
key: 'cleanup',
@ -111,6 +118,7 @@ var PDFThumbnailViewer = function () { @@ -111,6 +118,7 @@ var PDFThumbnailViewer = function () {
key: '_resetView',
value: function _resetView() {
this._thumbnails = [];
this._currentPageNumber = 1;
this._pageLabels = null;
this._pagesRotation = 0;
this._pagesRequests = [];
@ -144,6 +152,8 @@ var PDFThumbnailViewer = function () { @@ -144,6 +152,8 @@ var PDFThumbnailViewer = function () {
});
_this._thumbnails.push(thumbnail);
}
var thumbnailView = _this._thumbnails[_this._currentPageNumber - 1];
thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);
}).catch(function (reason) {
console.error('Unable to initialize thumbnail viewer', reason);
});

2
package.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "pdfjs-dist",
"version": "2.0.345",
"version": "2.0.347",
"main": "build/pdf.js",
"description": "Generic build of Mozilla's PDF.js library.",
"keywords": [

Loading…
Cancel
Save