浏览代码

PDF.js version 1.9.534 - See mozilla/pdf.js@c8b5ba277af0464227724486262d14ea4c5a384c

pdfjsbot 7 年之前
父节点
当前提交
365e406451

+ 1 - 1
bower.json

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

+ 6 - 6
build/pdf.combined.js

@@ -13443,8 +13443,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
 }();
 var version, build;
 {
-  exports.version = version = '1.9.530';
-  exports.build = build = 'd1089a28';
+  exports.version = version = '1.9.534';
+  exports.build = build = 'c8b5ba27';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
@@ -29207,8 +29207,8 @@ exports.SVGGraphics = SVGGraphics;
 "use strict";
 
 
-var pdfjsVersion = '1.9.530';
-var pdfjsBuild = 'd1089a28';
+var pdfjsVersion = '1.9.534';
+var pdfjsBuild = 'c8b5ba27';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayGlobal = __w_pdfjs_require__(98);
 var pdfjsDisplayAPI = __w_pdfjs_require__(55);
@@ -35070,8 +35070,8 @@ if (!_global_scope2.default.PDFJS) {
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '1.9.530';
-  PDFJS.build = 'd1089a28';
+  PDFJS.version = '1.9.534';
+  PDFJS.build = 'c8b5ba27';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {

文件差异内容过多而无法显示
+ 0 - 0
build/pdf.combined.js.map


+ 6 - 6
build/pdf.js

@@ -4173,8 +4173,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
 }();
 var version, build;
 {
-  exports.version = version = '1.9.530';
-  exports.build = build = 'd1089a28';
+  exports.version = version = '1.9.534';
+  exports.build = build = 'c8b5ba27';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
@@ -7052,8 +7052,8 @@ exports.SVGGraphics = SVGGraphics;
 "use strict";
 
 
-var pdfjsVersion = '1.9.530';
-var pdfjsBuild = 'd1089a28';
+var pdfjsVersion = '1.9.534';
+var pdfjsBuild = 'c8b5ba27';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayGlobal = __w_pdfjs_require__(82);
 var pdfjsDisplayAPI = __w_pdfjs_require__(48);
@@ -12915,8 +12915,8 @@ if (!_global_scope2.default.PDFJS) {
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '1.9.530';
-  PDFJS.build = 'd1089a28';
+  PDFJS.version = '1.9.534';
+  PDFJS.build = 'c8b5ba27';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {

文件差异内容过多而无法显示
+ 0 - 0
build/pdf.js.map


文件差异内容过多而无法显示
+ 0 - 0
build/pdf.min.js


+ 2 - 2
build/pdf.worker.js

@@ -24512,8 +24512,8 @@ exports.getUnicodeForGlyph = getUnicodeForGlyph;
 "use strict";
 
 
-var pdfjsVersion = '1.9.530';
-var pdfjsBuild = 'd1089a28';
+var pdfjsVersion = '1.9.534';
+var pdfjsBuild = 'c8b5ba27';
 var pdfjsCoreWorker = __w_pdfjs_require__(62);
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 

文件差异内容过多而无法显示
+ 0 - 0
build/pdf.worker.js.map


+ 2 - 2
lib/display/api.js

@@ -1581,8 +1581,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
 }();
 var version, build;
 {
-  exports.version = version = '1.9.530';
-  exports.build = build = 'd1089a28';
+  exports.version = version = '1.9.534';
+  exports.build = build = 'c8b5ba27';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;

+ 2 - 2
lib/display/global.js

@@ -45,8 +45,8 @@ if (!_global_scope2.default.PDFJS) {
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '1.9.530';
-  PDFJS.build = 'd1089a28';
+  PDFJS.version = '1.9.534';
+  PDFJS.build = 'c8b5ba27';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {

+ 2 - 2
lib/pdf.js

@@ -14,8 +14,8 @@
  */
 'use strict';
 
-var pdfjsVersion = '1.9.530';
-var pdfjsBuild = 'd1089a28';
+var pdfjsVersion = '1.9.534';
+var pdfjsBuild = 'c8b5ba27';
 var pdfjsSharedUtil = require('./shared/util.js');
 var pdfjsDisplayGlobal = require('./display/global.js');
 var pdfjsDisplayAPI = require('./display/api.js');

+ 2 - 2
lib/pdf.worker.js

@@ -14,7 +14,7 @@
  */
 'use strict';
 
-var pdfjsVersion = '1.9.530';
-var pdfjsBuild = 'd1089a28';
+var pdfjsVersion = '1.9.534';
+var pdfjsBuild = 'c8b5ba27';
 var pdfjsCoreWorker = require('./core/worker.js');
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

+ 23 - 27
lib/web/pdf_history.js

@@ -31,7 +31,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
 
 var HASH_CHANGE_TIMEOUT = 1000;
 var POSITION_UPDATED_THRESHOLD = 50;
-var UPDATE_VIEWAREA_TIMEOUT = 2000;
+var UPDATE_VIEWAREA_TIMEOUT = 1000;
 function getCurrentHash() {
   return document.location.hash;
 }
@@ -125,6 +125,8 @@ var PDFHistory = function () {
   }, {
     key: 'push',
     value: function push(_ref2) {
+      var _this2 = this;
+
       var namedDest = _ref2.namedDest,
           explicitDest = _ref2.explicitDest,
           pageNumber = _ref2.pageNumber;
@@ -155,6 +157,12 @@ var PDFHistory = function () {
         hash: hash,
         page: pageNumber
       }, forceReplace);
+      if (!this._popStateInProgress) {
+        this._popStateInProgress = true;
+        Promise.resolve().then(function () {
+          _this2._popStateInProgress = false;
+        });
+      }
     }
   }, {
     key: 'pushCurrentPosition',
@@ -262,6 +270,10 @@ var PDFHistory = function () {
     value: function _updateInternalState(destination, uid) {
       var removeTemporary = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
 
+      if (this._updateViewareaTimeout) {
+        clearTimeout(this._updateViewareaTimeout);
+        this._updateViewareaTimeout = null;
+      }
       if (removeTemporary && destination && destination.temporary) {
         delete destination.temporary;
       }
@@ -273,7 +285,7 @@ var PDFHistory = function () {
   }, {
     key: '_updateViewarea',
     value: function _updateViewarea(_ref3) {
-      var _this2 = this;
+      var _this3 = this;
 
       var location = _ref3.location;
 
@@ -294,17 +306,17 @@ var PDFHistory = function () {
       }
       if (UPDATE_VIEWAREA_TIMEOUT > 0) {
         this._updateViewareaTimeout = setTimeout(function () {
-          if (!_this2._popStateInProgress) {
-            _this2._tryPushCurrentPosition(true);
+          if (!_this3._popStateInProgress) {
+            _this3._tryPushCurrentPosition(true);
           }
-          _this2._updateViewareaTimeout = null;
+          _this3._updateViewareaTimeout = null;
         }, UPDATE_VIEWAREA_TIMEOUT);
       }
     }
   }, {
     key: '_popState',
     value: function _popState(_ref4) {
-      var _this3 = this;
+      var _this4 = this;
 
       var state = _ref4.state;
 
@@ -335,25 +347,9 @@ var PDFHistory = function () {
           name: 'hashchange',
           delay: HASH_CHANGE_TIMEOUT
         }).then(function () {
-          _this3._blockHashChange--;
+          _this4._blockHashChange--;
         });
       }
-      if (state.uid < this._currentUid && this._position && this._destination) {
-        var shouldGoBack = false;
-        if (this._destination.temporary) {
-          this._pushOrReplaceState(this._position);
-          shouldGoBack = true;
-        } else if (this._destination.page && this._destination.page !== this._position.first && this._destination.page !== this._position.page) {
-          this._pushOrReplaceState(this._destination);
-          this._pushOrReplaceState(this._position);
-          shouldGoBack = true;
-        }
-        if (shouldGoBack) {
-          this._currentUid = state.uid;
-          window.history.back();
-          return;
-        }
-      }
       var destination = state.destination;
       this._updateInternalState(destination, state.uid, true);
       if (destination.dest) {
@@ -364,13 +360,13 @@ var PDFHistory = function () {
         this.linkService.page = destination.page;
       }
       Promise.resolve().then(function () {
-        _this3._popStateInProgress = false;
+        _this4._popStateInProgress = false;
       });
     }
   }, {
     key: '_bindEvents',
     value: function _bindEvents() {
-      var _this4 = this;
+      var _this5 = this;
 
       var _boundEvents = this._boundEvents,
           eventBus = this.eventBus;
@@ -378,8 +374,8 @@ var PDFHistory = function () {
       _boundEvents.updateViewarea = this._updateViewarea.bind(this);
       _boundEvents.popState = this._popState.bind(this);
       _boundEvents.pageHide = function (evt) {
-        if (!_this4._destination) {
-          _this4._tryPushCurrentPosition();
+        if (!_this5._destination) {
+          _this5._tryPushCurrentPosition();
         }
       };
       eventBus.on('updateviewarea', _boundEvents.updateViewarea);

+ 1 - 1
package.json

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

+ 23 - 27
web/pdf_viewer.js

@@ -3131,7 +3131,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
 
 var HASH_CHANGE_TIMEOUT = 1000;
 var POSITION_UPDATED_THRESHOLD = 50;
-var UPDATE_VIEWAREA_TIMEOUT = 2000;
+var UPDATE_VIEWAREA_TIMEOUT = 1000;
 function getCurrentHash() {
   return document.location.hash;
 }
@@ -3225,6 +3225,8 @@ var PDFHistory = function () {
   }, {
     key: 'push',
     value: function push(_ref2) {
+      var _this2 = this;
+
       var namedDest = _ref2.namedDest,
           explicitDest = _ref2.explicitDest,
           pageNumber = _ref2.pageNumber;
@@ -3255,6 +3257,12 @@ var PDFHistory = function () {
         hash: hash,
         page: pageNumber
       }, forceReplace);
+      if (!this._popStateInProgress) {
+        this._popStateInProgress = true;
+        Promise.resolve().then(function () {
+          _this2._popStateInProgress = false;
+        });
+      }
     }
   }, {
     key: 'pushCurrentPosition',
@@ -3362,6 +3370,10 @@ var PDFHistory = function () {
     value: function _updateInternalState(destination, uid) {
       var removeTemporary = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
 
+      if (this._updateViewareaTimeout) {
+        clearTimeout(this._updateViewareaTimeout);
+        this._updateViewareaTimeout = null;
+      }
       if (removeTemporary && destination && destination.temporary) {
         delete destination.temporary;
       }
@@ -3373,7 +3385,7 @@ var PDFHistory = function () {
   }, {
     key: '_updateViewarea',
     value: function _updateViewarea(_ref3) {
-      var _this2 = this;
+      var _this3 = this;
 
       var location = _ref3.location;
 
@@ -3394,17 +3406,17 @@ var PDFHistory = function () {
       }
       if (UPDATE_VIEWAREA_TIMEOUT > 0) {
         this._updateViewareaTimeout = setTimeout(function () {
-          if (!_this2._popStateInProgress) {
-            _this2._tryPushCurrentPosition(true);
+          if (!_this3._popStateInProgress) {
+            _this3._tryPushCurrentPosition(true);
           }
-          _this2._updateViewareaTimeout = null;
+          _this3._updateViewareaTimeout = null;
         }, UPDATE_VIEWAREA_TIMEOUT);
       }
     }
   }, {
     key: '_popState',
     value: function _popState(_ref4) {
-      var _this3 = this;
+      var _this4 = this;
 
       var state = _ref4.state;
 
@@ -3435,25 +3447,9 @@ var PDFHistory = function () {
           name: 'hashchange',
           delay: HASH_CHANGE_TIMEOUT
         }).then(function () {
-          _this3._blockHashChange--;
+          _this4._blockHashChange--;
         });
       }
-      if (state.uid < this._currentUid && this._position && this._destination) {
-        var shouldGoBack = false;
-        if (this._destination.temporary) {
-          this._pushOrReplaceState(this._position);
-          shouldGoBack = true;
-        } else if (this._destination.page && this._destination.page !== this._position.first && this._destination.page !== this._position.page) {
-          this._pushOrReplaceState(this._destination);
-          this._pushOrReplaceState(this._position);
-          shouldGoBack = true;
-        }
-        if (shouldGoBack) {
-          this._currentUid = state.uid;
-          window.history.back();
-          return;
-        }
-      }
       var destination = state.destination;
       this._updateInternalState(destination, state.uid, true);
       if (destination.dest) {
@@ -3464,13 +3460,13 @@ var PDFHistory = function () {
         this.linkService.page = destination.page;
       }
       Promise.resolve().then(function () {
-        _this3._popStateInProgress = false;
+        _this4._popStateInProgress = false;
       });
     }
   }, {
     key: '_bindEvents',
     value: function _bindEvents() {
-      var _this4 = this;
+      var _this5 = this;
 
       var _boundEvents = this._boundEvents,
           eventBus = this.eventBus;
@@ -3478,8 +3474,8 @@ var PDFHistory = function () {
       _boundEvents.updateViewarea = this._updateViewarea.bind(this);
       _boundEvents.popState = this._popState.bind(this);
       _boundEvents.pageHide = function (evt) {
-        if (!_this4._destination) {
-          _this4._tryPushCurrentPosition();
+        if (!_this5._destination) {
+          _this5._tryPushCurrentPosition();
         }
       };
       eventBus.on('updateviewarea', _boundEvents.updateViewarea);

文件差异内容过多而无法显示
+ 0 - 0
web/pdf_viewer.js.map


部分文件因为文件数量过多而无法显示