Browse Source

PDF.js version 1.8.337 - See mozilla/pdf.js@595ee1232dee3525201672b54b2e72cd7dbf33ff

master v1.8.337
pdfjsbot 8 years ago
parent
commit
2bd83ccce8
  1. 2
      bower.json
  2. 12
      build/pdf.combined.js
  3. 2
      build/pdf.combined.js.map
  4. 12
      build/pdf.js
  5. 2
      build/pdf.js.map
  6. 6
      build/pdf.min.js
  7. 4
      build/pdf.worker.js
  8. 2
      build/pdf.worker.js.map
  9. 4
      lib/display/api.js
  10. 4
      lib/display/global.js
  11. 4
      lib/pdf.js
  12. 4
      lib/pdf.worker.js
  13. 54
      lib/web/hand_tool.js
  14. 119
      lib/web/interfaces.js
  15. 95
      lib/web/secondary_toolbar.js
  16. 2
      package.json

2
bower.json

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

12
build/pdf.combined.js

@ -12779,8 +12779,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.333'; exports.version = version = '1.8.337';
exports.build = build = '3923c4a6'; exports.build = build = '595ee123';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;
@ -28185,8 +28185,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.333'; PDFJS.version = '1.8.337';
PDFJS.build = '3923c4a6'; PDFJS.build = '595ee123';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -43772,8 +43772,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.333'; var pdfjsVersion = '1.8.337';
var pdfjsBuild = '3923c4a6'; var pdfjsBuild = '595ee123';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(26); var pdfjsDisplayGlobal = __w_pdfjs_require__(26);
var pdfjsDisplayAPI = __w_pdfjs_require__(10); var pdfjsDisplayAPI = __w_pdfjs_require__(10);

2
build/pdf.combined.js.map

File diff suppressed because one or more lines are too long

12
build/pdf.js

@ -3486,8 +3486,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.333'; exports.version = version = '1.8.337';
exports.build = build = '3923c4a6'; exports.build = build = '595ee123';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;
@ -5460,8 +5460,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.333'; PDFJS.version = '1.8.337';
PDFJS.build = '3923c4a6'; PDFJS.build = '595ee123';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -7956,8 +7956,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.333'; var pdfjsVersion = '1.8.337';
var pdfjsBuild = '3923c4a6'; var pdfjsBuild = '595ee123';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(9); var pdfjsDisplayGlobal = __w_pdfjs_require__(9);
var pdfjsDisplayAPI = __w_pdfjs_require__(3); var pdfjsDisplayAPI = __w_pdfjs_require__(3);

2
build/pdf.js.map

File diff suppressed because one or more lines are too long

6
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

4
build/pdf.worker.js vendored

@ -37137,8 +37137,8 @@ exports.Type1Parser = Type1Parser;
"use strict"; "use strict";
var pdfjsVersion = '1.8.333'; var pdfjsVersion = '1.8.337';
var pdfjsBuild = '3923c4a6'; var pdfjsBuild = '595ee123';
var pdfjsCoreWorker = __w_pdfjs_require__(8); var pdfjsCoreWorker = __w_pdfjs_require__(8);
{ {
__w_pdfjs_require__(19); __w_pdfjs_require__(19);

2
build/pdf.worker.js.map vendored

File diff suppressed because one or more lines are too long

4
lib/display/api.js

@ -1405,8 +1405,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.333'; exports.version = version = '1.8.337';
exports.build = build = '3923c4a6'; exports.build = build = '595ee123';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;

4
lib/display/global.js

@ -39,8 +39,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.333'; PDFJS.version = '1.8.337';
PDFJS.build = '3923c4a6'; PDFJS.build = '595ee123';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {

4
lib/pdf.js

@ -14,8 +14,8 @@
*/ */
'use strict'; 'use strict';
var pdfjsVersion = '1.8.333'; var pdfjsVersion = '1.8.337';
var pdfjsBuild = '3923c4a6'; var pdfjsBuild = '595ee123';
var pdfjsSharedUtil = require('./shared/util.js'); var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayGlobal = require('./display/global.js'); var pdfjsDisplayGlobal = require('./display/global.js');
var pdfjsDisplayAPI = require('./display/api.js'); var pdfjsDisplayAPI = require('./display/api.js');

4
lib/pdf.worker.js vendored

@ -14,8 +14,8 @@
*/ */
'use strict'; 'use strict';
var pdfjsVersion = '1.8.333'; var pdfjsVersion = '1.8.337';
var pdfjsBuild = '3923c4a6'; var pdfjsBuild = '595ee123';
var pdfjsCoreWorker = require('./core/worker.js'); var pdfjsCoreWorker = require('./core/worker.js');
{ {
require('./core/network.js'); require('./core/network.js');

54
lib/web/hand_tool.js

@ -19,17 +19,26 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.HandTool = undefined; exports.HandTool = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _grab_to_pan = require('./grab_to_pan'); var _grab_to_pan = require('./grab_to_pan');
var _ui_utils = require('./ui_utils'); var _ui_utils = require('./ui_utils');
var HandTool = function HandToolClosure() { function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function HandTool(options) {
var HandTool = function () {
function HandTool(_ref) {
var _this = this; var _this = this;
this.container = options.container; var container = _ref.container,
this.eventBus = options.eventBus; eventBus = _ref.eventBus,
var preferences = options.preferences; preferences = _ref.preferences;
_classCallCheck(this, HandTool);
this.container = container;
this.eventBus = eventBus;
this.wasActive = false; this.wasActive = false;
this.handTool = new _grab_to_pan.GrabToPan({ this.handTool = new _grab_to_pan.GrabToPan({
element: this.container, element: this.container,
@ -38,11 +47,12 @@ var HandTool = function HandToolClosure() {
} }
}); });
this.eventBus.on('togglehandtool', this.toggle.bind(this)); this.eventBus.on('togglehandtool', this.toggle.bind(this));
Promise.all([_ui_utils.localized, preferences.get('enableHandToolOnLoad')]).then(function (values) { var enableOnLoad = preferences.get('enableHandToolOnLoad');
Promise.all([_ui_utils.localized, enableOnLoad]).then(function (values) {
if (values[1] === true) { if (values[1] === true) {
_this.handTool.activate(); _this.handTool.activate();
} }
}).catch(function rejected(reason) {}); }).catch(function (reason) {});
this.eventBus.on('presentationmodechanged', function (evt) { this.eventBus.on('presentationmodechanged', function (evt) {
if (evt.switchInProgress) { if (evt.switchInProgress) {
return; return;
@ -54,26 +64,36 @@ var HandTool = function HandToolClosure() {
} }
}); });
} }
HandTool.prototype = {
get isActive() { _createClass(HandTool, [{
return !!this.handTool.active; key: 'toggle',
}, value: function toggle() {
toggle: function HandTool_toggle() {
this.handTool.toggle(); this.handTool.toggle();
}, }
enterPresentationMode: function HandTool_enterPresentationMode() { }, {
key: 'enterPresentationMode',
value: function enterPresentationMode() {
if (this.isActive) { if (this.isActive) {
this.wasActive = true; this.wasActive = true;
this.handTool.deactivate(); this.handTool.deactivate();
} }
}, }
exitPresentationMode: function HandTool_exitPresentationMode() { }, {
key: 'exitPresentationMode',
value: function exitPresentationMode() {
if (this.wasActive) { if (this.wasActive) {
this.wasActive = false; this.wasActive = false;
this.handTool.activate(); this.handTool.activate();
} }
} }
}; }, {
key: 'isActive',
get: function get() {
return !!this.handTool.active;
}
}]);
return HandTool; return HandTool;
}(); }();
exports.HandTool = HandTool; exports.HandTool = HandTool;

119
lib/web/interfaces.js

@ -18,37 +18,96 @@ var _createClass = function () { function defineProperties(target, props) { for
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function IPDFLinkService() {} var IPDFLinkService = function () {
IPDFLinkService.prototype = { function IPDFLinkService() {
get page() {}, _classCallCheck(this, IPDFLinkService);
set page(value) {},
navigateTo: function navigateTo(dest) {},
getDestinationHash: function getDestinationHash(dest) {},
getAnchorUrl: function getAnchorUrl(hash) {},
setHash: function setHash(hash) {},
executeNamedAction: function executeNamedAction(action) {},
cachePageRef: function cachePageRef(pageNum, pageRef) {}
};
function IPDFHistory() {}
IPDFHistory.prototype = {
forward: function forward() {},
back: function back() {},
push: function push(params) {},
updateNextHashParam: function updateNextHashParam(hash) {}
};
function IRenderableView() {}
IRenderableView.prototype = {
get renderingId() {},
get renderingState() {},
draw: function draw() {},
resume: function resume() {}
};
function IPDFTextLayerFactory() {}
IPDFTextLayerFactory.prototype = {
createTextLayerBuilder: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport) {
var enhanceTextSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
} }
};
_createClass(IPDFLinkService, [{
key: 'navigateTo',
value: function navigateTo(dest) {}
}, {
key: 'getDestinationHash',
value: function getDestinationHash(dest) {}
}, {
key: 'getAnchorUrl',
value: function getAnchorUrl(hash) {}
}, {
key: 'setHash',
value: function setHash(hash) {}
}, {
key: 'executeNamedAction',
value: function executeNamedAction(action) {}
}, {
key: 'cachePageRef',
value: function cachePageRef(pageNum, pageRef) {}
}, {
key: 'page',
get: function get() {},
set: function set(value) {}
}]);
return IPDFLinkService;
}();
var IPDFHistory = function () {
function IPDFHistory() {
_classCallCheck(this, IPDFHistory);
}
_createClass(IPDFHistory, [{
key: 'forward',
value: function forward() {}
}, {
key: 'back',
value: function back() {}
}, {
key: 'push',
value: function push(params) {}
}, {
key: 'updateNextHashParam',
value: function updateNextHashParam(hash) {}
}]);
return IPDFHistory;
}();
var IRenderableView = function () {
function IRenderableView() {
_classCallCheck(this, IRenderableView);
}
_createClass(IRenderableView, [{
key: 'draw',
value: function draw() {}
}, {
key: 'resume',
value: function resume() {}
}, {
key: 'renderingId',
get: function get() {}
}, {
key: 'renderingState',
get: function get() {}
}]);
return IRenderableView;
}();
var IPDFTextLayerFactory = function () {
function IPDFTextLayerFactory() {
_classCallCheck(this, IPDFTextLayerFactory);
}
_createClass(IPDFTextLayerFactory, [{
key: 'createTextLayerBuilder',
value: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport) {
var enhanceTextSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
}
}]);
return IPDFTextLayerFactory;
}();
var IPDFAnnotationLayerFactory = function () { var IPDFAnnotationLayerFactory = function () {
function IPDFAnnotationLayerFactory() { function IPDFAnnotationLayerFactory() {

95
lib/web/secondary_toolbar.js

@ -19,10 +19,16 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.SecondaryToolbar = undefined; exports.SecondaryToolbar = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _ui_utils = require('./ui_utils'); var _ui_utils = require('./ui_utils');
var SecondaryToolbar = function SecondaryToolbarClosure() { function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var SecondaryToolbar = function () {
function SecondaryToolbar(options, mainContainer, eventBus) { function SecondaryToolbar(options, mainContainer, eventBus) {
_classCallCheck(this, SecondaryToolbar);
this.toolbar = options.toolbar; this.toolbar = options.toolbar;
this.toggleButton = options.toggleButton; this.toggleButton = options.toggleButton;
this.toolbarButtonContainer = options.toolbarButtonContainer; this.toolbarButtonContainer = options.toolbarButtonContainer;
@ -87,31 +93,37 @@ var SecondaryToolbar = function SecondaryToolbarClosure() {
this._bindHandToolListener(options.toggleHandToolButton); this._bindHandToolListener(options.toggleHandToolButton);
this.eventBus.on('resize', this._setMaxHeight.bind(this)); this.eventBus.on('resize', this._setMaxHeight.bind(this));
} }
SecondaryToolbar.prototype = {
get isOpen() { _createClass(SecondaryToolbar, [{
return this.opened; key: 'setPageNumber',
}, value: function setPageNumber(pageNumber) {
setPageNumber: function SecondaryToolbar_setPageNumber(pageNumber) {
this.pageNumber = pageNumber; this.pageNumber = pageNumber;
this._updateUIState(); this._updateUIState();
}, }
setPagesCount: function SecondaryToolbar_setPagesCount(pagesCount) { }, {
key: 'setPagesCount',
value: function setPagesCount(pagesCount) {
this.pagesCount = pagesCount; this.pagesCount = pagesCount;
this._updateUIState(); this._updateUIState();
}, }
reset: function SecondaryToolbar_reset() { }, {
key: 'reset',
value: function reset() {
this.pageNumber = 0; this.pageNumber = 0;
this.pagesCount = 0; this.pagesCount = 0;
this._updateUIState(); this._updateUIState();
}, }
_updateUIState: function SecondaryToolbar_updateUIState() { }, {
var items = this.items; key: '_updateUIState',
items.firstPage.disabled = this.pageNumber <= 1; value: function _updateUIState() {
items.lastPage.disabled = this.pageNumber >= this.pagesCount; this.items.firstPage.disabled = this.pageNumber <= 1;
items.pageRotateCw.disabled = this.pagesCount === 0; this.items.lastPage.disabled = this.pageNumber >= this.pagesCount;
items.pageRotateCcw.disabled = this.pagesCount === 0; this.items.pageRotateCw.disabled = this.pagesCount === 0;
}, this.items.pageRotateCcw.disabled = this.pagesCount === 0;
_bindClickListeners: function SecondaryToolbar_bindClickListeners() { }
}, {
key: '_bindClickListeners',
value: function _bindClickListeners() {
var _this = this; var _this = this;
this.toggleButton.addEventListener('click', this.toggle.bind(this)); this.toggleButton.addEventListener('click', this.toggle.bind(this));
@ -135,14 +147,16 @@ var SecondaryToolbar = function SecondaryToolbarClosure() {
for (var button in this.buttons) { for (var button in this.buttons) {
_loop(button); _loop(button);
} }
}, }
_bindHandToolListener: function SecondaryToolbar_bindHandToolListener(toggleHandToolButton) { }, {
key: '_bindHandToolListener',
value: function _bindHandToolListener(toggleHandToolButton) {
var isHandToolActive = false; var isHandToolActive = false;
this.eventBus.on('handtoolchanged', function (e) { this.eventBus.on('handtoolchanged', function (evt) {
if (isHandToolActive === e.isActive) { if (isHandToolActive === evt.isActive) {
return; return;
} }
isHandToolActive = e.isActive; isHandToolActive = evt.isActive;
if (isHandToolActive) { if (isHandToolActive) {
toggleHandToolButton.title = _ui_utils.mozL10n.get('hand_tool_disable.title', null, 'Disable hand tool'); toggleHandToolButton.title = _ui_utils.mozL10n.get('hand_tool_disable.title', null, 'Disable hand tool');
toggleHandToolButton.firstElementChild.textContent = _ui_utils.mozL10n.get('hand_tool_disable_label', null, 'Disable hand tool'); toggleHandToolButton.firstElementChild.textContent = _ui_utils.mozL10n.get('hand_tool_disable_label', null, 'Disable hand tool');
@ -151,8 +165,10 @@ var SecondaryToolbar = function SecondaryToolbarClosure() {
toggleHandToolButton.firstElementChild.textContent = _ui_utils.mozL10n.get('hand_tool_enable_label', null, 'Enable hand tool'); toggleHandToolButton.firstElementChild.textContent = _ui_utils.mozL10n.get('hand_tool_enable_label', null, 'Enable hand tool');
} }
}); });
}, }
open: function SecondaryToolbar_open() { }, {
key: 'open',
value: function open() {
if (this.opened) { if (this.opened) {
return; return;
} }
@ -160,23 +176,29 @@ var SecondaryToolbar = function SecondaryToolbarClosure() {
this._setMaxHeight(); this._setMaxHeight();
this.toggleButton.classList.add('toggled'); this.toggleButton.classList.add('toggled');
this.toolbar.classList.remove('hidden'); this.toolbar.classList.remove('hidden');
}, }
close: function SecondaryToolbar_close() { }, {
key: 'close',
value: function close() {
if (!this.opened) { if (!this.opened) {
return; return;
} }
this.opened = false; this.opened = false;
this.toolbar.classList.add('hidden'); this.toolbar.classList.add('hidden');
this.toggleButton.classList.remove('toggled'); this.toggleButton.classList.remove('toggled');
}, }
toggle: function SecondaryToolbar_toggle() { }, {
key: 'toggle',
value: function toggle() {
if (this.opened) { if (this.opened) {
this.close(); this.close();
} else { } else {
this.open(); this.open();
} }
}, }
_setMaxHeight: function SecondaryToolbar_setMaxHeight() { }, {
key: '_setMaxHeight',
value: function _setMaxHeight() {
if (!this.opened) { if (!this.opened) {
return; return;
} }
@ -187,7 +209,14 @@ var SecondaryToolbar = function SecondaryToolbarClosure() {
this.toolbarButtonContainer.setAttribute('style', 'max-height: ' + (this.containerHeight - _ui_utils.SCROLLBAR_PADDING) + 'px;'); this.toolbarButtonContainer.setAttribute('style', 'max-height: ' + (this.containerHeight - _ui_utils.SCROLLBAR_PADDING) + 'px;');
this.previousContainerHeight = this.containerHeight; this.previousContainerHeight = this.containerHeight;
} }
}; }, {
key: 'isOpen',
get: function get() {
return this.opened;
}
}]);
return SecondaryToolbar; return SecondaryToolbar;
}(); }();
exports.SecondaryToolbar = SecondaryToolbar; exports.SecondaryToolbar = SecondaryToolbar;

2
package.json

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

Loading…
Cancel
Save