Browse Source

PDF.js version 1.8.550 - See mozilla/pdf.js@afb1cd7377fb3ad4446e6e66640ef42b4f89854b

master v1.8.550
pdfjsbot 8 years ago
parent
commit
3550c09e21
  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. 4
      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. 7
      lib/web/interfaces.js
  14. 198
      lib/web/pdf_link_service.js
  15. 2
      package.json
  16. 198
      web/pdf_viewer.js
  17. 2
      web/pdf_viewer.js.map

2
bower.json

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

12
build/pdf.combined.js

@ -13116,8 +13116,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.548'; exports.version = version = '1.8.550';
exports.build = build = 'ca3c08f1'; exports.build = build = 'afb1cd73';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;
@ -28627,8 +28627,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.548'; PDFJS.version = '1.8.550';
PDFJS.build = 'ca3c08f1'; PDFJS.build = 'afb1cd73';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -47254,8 +47254,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.548'; var pdfjsVersion = '1.8.550';
var pdfjsBuild = 'ca3c08f1'; var pdfjsBuild = 'afb1cd73';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(25); var pdfjsDisplayGlobal = __w_pdfjs_require__(25);
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

@ -3849,8 +3849,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.548'; exports.version = version = '1.8.550';
exports.build = build = 'ca3c08f1'; exports.build = build = 'afb1cd73';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;
@ -5905,8 +5905,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.548'; PDFJS.version = '1.8.550';
PDFJS.build = 'ca3c08f1'; PDFJS.build = 'afb1cd73';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -11444,8 +11444,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.548'; var pdfjsVersion = '1.8.550';
var pdfjsBuild = 'ca3c08f1'; var pdfjsBuild = 'afb1cd73';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(8); var pdfjsDisplayGlobal = __w_pdfjs_require__(8);
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

4
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

4
build/pdf.worker.js vendored

@ -40390,8 +40390,8 @@ exports.Type1Parser = Type1Parser;
"use strict"; "use strict";
var pdfjsVersion = '1.8.548'; var pdfjsVersion = '1.8.550';
var pdfjsBuild = 'ca3c08f1'; var pdfjsBuild = 'afb1cd73';
var pdfjsCoreWorker = __w_pdfjs_require__(8); var pdfjsCoreWorker = __w_pdfjs_require__(8);
{ {
__w_pdfjs_require__(18); __w_pdfjs_require__(18);

2
build/pdf.worker.js.map vendored

File diff suppressed because one or more lines are too long

4
lib/display/api.js

@ -1480,8 +1480,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.548'; exports.version = version = '1.8.550';
exports.build = build = 'ca3c08f1'; exports.build = build = 'afb1cd73';
} }
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.548'; PDFJS.version = '1.8.550';
PDFJS.build = 'ca3c08f1'; PDFJS.build = 'afb1cd73';
} }
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.548'; var pdfjsVersion = '1.8.550';
var pdfjsBuild = 'ca3c08f1'; var pdfjsBuild = 'afb1cd73';
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.548'; var pdfjsVersion = '1.8.550';
var pdfjsBuild = 'ca3c08f1'; var pdfjsBuild = 'afb1cd73';
var pdfjsCoreWorker = require('./core/worker.js'); var pdfjsCoreWorker = require('./core/worker.js');
{ {
require('./core/network.js'); require('./core/network.js');

7
lib/web/interfaces.js

@ -38,6 +38,13 @@ var IPDFLinkService = function () {
}, { }, {
key: 'executeNamedAction', key: 'executeNamedAction',
value: function executeNamedAction(action) {} value: function executeNamedAction(action) {}
}, {
key: 'onFileAttachmentAnnotation',
value: function onFileAttachmentAnnotation(_ref) {
var id = _ref.id,
filename = _ref.filename,
content = _ref.content;
}
}, { }, {
key: 'cachePageRef', key: 'cachePageRef',
value: function cachePageRef(pageNum, pageRef) {} value: function cachePageRef(pageNum, pageRef) {}

198
lib/web/pdf_link_service.js

@ -21,47 +21,54 @@ exports.SimpleLinkService = exports.PDFLinkService = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
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 _dom_events = require('./dom_events'); var _dom_events = require('./dom_events');
var _ui_utils = require('./ui_utils'); var _ui_utils = require('./ui_utils');
var PDFLinkService = function PDFLinkServiceClosure() { function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function PDFLinkService(options) {
options = options || {}; var PDFLinkService = function () {
this.eventBus = options.eventBus || (0, _dom_events.getGlobalEventBus)(); function PDFLinkService() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
eventBus = _ref.eventBus;
_classCallCheck(this, PDFLinkService);
this.eventBus = eventBus || (0, _dom_events.getGlobalEventBus)();
this.baseUrl = null; this.baseUrl = null;
this.pdfDocument = null; this.pdfDocument = null;
this.pdfViewer = null; this.pdfViewer = null;
this.pdfHistory = null; this.pdfHistory = null;
this._pagesRefCache = null; this._pagesRefCache = null;
} }
PDFLinkService.prototype = {
setDocument: function PDFLinkService_setDocument(pdfDocument, baseUrl) { _createClass(PDFLinkService, [{
key: 'setDocument',
value: function setDocument(pdfDocument, baseUrl) {
this.baseUrl = baseUrl; this.baseUrl = baseUrl;
this.pdfDocument = pdfDocument; this.pdfDocument = pdfDocument;
this._pagesRefCache = Object.create(null); this._pagesRefCache = Object.create(null);
}, }
setViewer: function PDFLinkService_setViewer(pdfViewer) { }, {
key: 'setViewer',
value: function setViewer(pdfViewer) {
this.pdfViewer = pdfViewer; this.pdfViewer = pdfViewer;
}, }
setHistory: function PDFLinkService_setHistory(pdfHistory) { }, {
key: 'setHistory',
value: function setHistory(pdfHistory) {
this.pdfHistory = pdfHistory; this.pdfHistory = pdfHistory;
}, }
get pagesCount() { }, {
return this.pdfDocument ? this.pdfDocument.numPages : 0; key: 'navigateTo',
}, value: function navigateTo(dest) {
get page() {
return this.pdfViewer.currentPageNumber;
},
set page(value) {
this.pdfViewer.currentPageNumber = value;
},
navigateTo: function navigateTo(dest) {
var _this = this; var _this = this;
var goToDestination = function goToDestination(_ref) { var goToDestination = function goToDestination(_ref2) {
var namedDest = _ref.namedDest, var namedDest = _ref2.namedDest,
explicitDest = _ref.explicitDest; explicitDest = _ref2.explicitDest;
var destRef = explicitDest[0], var destRef = explicitDest[0],
pageNumber = void 0; pageNumber = void 0;
@ -122,8 +129,10 @@ var PDFLinkService = function PDFLinkServiceClosure() {
} }
goToDestination(data); goToDestination(data);
}); });
}, }
getDestinationHash: function getDestinationHash(dest) { }, {
key: 'getDestinationHash',
value: function getDestinationHash(dest) {
if (typeof dest === 'string') { if (typeof dest === 'string') {
return this.getAnchorUrl('#' + escape(dest)); return this.getAnchorUrl('#' + escape(dest));
} }
@ -132,13 +141,17 @@ var PDFLinkService = function PDFLinkServiceClosure() {
return this.getAnchorUrl('#' + escape(str)); return this.getAnchorUrl('#' + escape(str));
} }
return this.getAnchorUrl(''); return this.getAnchorUrl('');
}, }
}, {
getAnchorUrl: function PDFLinkService_getAnchorUrl(anchor) { key: 'getAnchorUrl',
value: function getAnchorUrl(anchor) {
return (this.baseUrl || '') + anchor; return (this.baseUrl || '') + anchor;
}, }
setHash: function PDFLinkService_setHash(hash) { }, {
var pageNumber, dest; key: 'setHash',
value: function setHash(hash) {
var pageNumber = void 0,
dest = void 0;
if (hash.indexOf('=') >= 0) { if (hash.indexOf('=') >= 0) {
var params = (0, _ui_utils.parseQueryString)(hash); var params = (0, _ui_utils.parseQueryString)(hash);
if ('search' in params) { if ('search' in params) {
@ -171,12 +184,12 @@ var PDFLinkService = function PDFLinkServiceClosure() {
dest = [null, { name: zoomArg }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null]; dest = [null, { name: zoomArg }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null];
} else if (zoomArg === 'FitR') { } else if (zoomArg === 'FitR') {
if (zoomArgs.length !== 5) { if (zoomArgs.length !== 5) {
console.error('PDFLinkService_setHash: ' + 'Not enough parameters for \'FitR\'.'); console.error('PDFLinkService.setHash: Not enough parameters for "FitR".');
} else { } else {
dest = [null, { name: zoomArg }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0]; dest = [null, { name: zoomArg }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];
} }
} else { } else {
console.error('PDFLinkService_setHash: \'' + zoomArg + '\' is not a valid zoom value.'); console.error('PDFLinkService.setHash: "' + zoomArg + '" is not ' + 'a valid zoom value.');
} }
} }
} }
@ -197,7 +210,7 @@ var PDFLinkService = function PDFLinkServiceClosure() {
} }
} else { } else {
if (/^\d+$/.test(hash) && hash <= this.pagesCount) { if (/^\d+$/.test(hash) && hash <= this.pagesCount) {
console.warn('PDFLinkService_setHash: specifying a page number ' + 'directly after the hash symbol (#) is deprecated, ' + 'please use the "#page=' + hash + '" form instead.'); console.warn('PDFLinkService_setHash: specifying a page number ' + 'directly after the hash symbol (#) is deprecated, ' + ('please use the "#page=' + hash + '" form instead.'));
this.page = hash | 0; this.page = hash | 0;
} }
dest = unescape(hash); dest = unescape(hash);
@ -214,10 +227,12 @@ var PDFLinkService = function PDFLinkServiceClosure() {
this.navigateTo(dest); this.navigateTo(dest);
return; return;
} }
console.error('PDFLinkService_setHash: \'' + unescape(hash) + '\' is not a valid destination.'); console.error('PDFLinkService.setHash: "' + unescape(hash) + '" is not ' + 'a valid destination.');
} }
}, }
executeNamedAction: function PDFLinkService_executeNamedAction(action) { }, {
key: 'executeNamedAction',
value: function executeNamedAction(action) {
switch (action) { switch (action) {
case 'GoBack': case 'GoBack':
if (this.pdfHistory) { if (this.pdfHistory) {
@ -252,27 +267,51 @@ var PDFLinkService = function PDFLinkServiceClosure() {
source: this, source: this,
action: action action: action
}); });
}, }
onFileAttachmentAnnotation: function onFileAttachmentAnnotation() { }, {
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; key: 'onFileAttachmentAnnotation',
value: function onFileAttachmentAnnotation(_ref3) {
var id = _ref3.id,
filename = _ref3.filename,
content = _ref3.content;
this.eventBus.dispatch('fileattachmentannotation', { this.eventBus.dispatch('fileattachmentannotation', {
source: this, source: this,
id: params.id, id: id,
filename: params.filename, filename: filename,
content: params.content content: content
}); });
}, }
}, {
cachePageRef: function PDFLinkService_cachePageRef(pageNum, pageRef) { key: 'cachePageRef',
value: function cachePageRef(pageNum, pageRef) {
var refStr = pageRef.num + ' ' + pageRef.gen + ' R'; var refStr = pageRef.num + ' ' + pageRef.gen + ' R';
this._pagesRefCache[refStr] = pageNum; this._pagesRefCache[refStr] = pageNum;
}, }
_cachedPageNumber: function PDFLinkService_cachedPageNumber(pageRef) { }, {
key: '_cachedPageNumber',
value: function _cachedPageNumber(pageRef) {
var refStr = pageRef.num + ' ' + pageRef.gen + ' R'; var refStr = pageRef.num + ' ' + pageRef.gen + ' R';
return this._pagesRefCache && this._pagesRefCache[refStr] || null; return this._pagesRefCache && this._pagesRefCache[refStr] || null;
} }
}; }, {
key: 'pagesCount',
get: function get() {
return this.pdfDocument ? this.pdfDocument.numPages : 0;
}
}, {
key: 'page',
get: function get() {
return this.pdfViewer.currentPageNumber;
},
set: function set(value) {
this.pdfViewer.currentPageNumber = value;
}
}]);
return PDFLinkService;
}();
function isValidExplicitDestination(dest) { function isValidExplicitDestination(dest) {
if (!(dest instanceof Array)) { if (!(dest instanceof Array)) {
return false; return false;
@ -324,28 +363,51 @@ var PDFLinkService = function PDFLinkServiceClosure() {
} }
return true; return true;
} }
return PDFLinkService;
}(); var SimpleLinkService = function () {
var SimpleLinkService = function SimpleLinkServiceClosure() { function SimpleLinkService() {
function SimpleLinkService() {} _classCallCheck(this, SimpleLinkService);
SimpleLinkService.prototype = { }
get page() {
return 0; _createClass(SimpleLinkService, [{
}, key: 'navigateTo',
set page(value) {}, value: function navigateTo(dest) {}
navigateTo: function navigateTo(dest) {}, }, {
getDestinationHash: function getDestinationHash(dest) { key: 'getDestinationHash',
value: function getDestinationHash(dest) {
return '#'; return '#';
}, }
getAnchorUrl: function getAnchorUrl(hash) { }, {
key: 'getAnchorUrl',
value: function getAnchorUrl(hash) {
return '#'; return '#';
}
}, {
key: 'setHash',
value: function setHash(hash) {}
}, {
key: 'executeNamedAction',
value: function executeNamedAction(action) {}
}, {
key: 'onFileAttachmentAnnotation',
value: function onFileAttachmentAnnotation(_ref4) {
var id = _ref4.id,
filename = _ref4.filename,
content = _ref4.content;
}
}, {
key: 'cachePageRef',
value: function cachePageRef(pageNum, pageRef) {}
}, {
key: 'page',
get: function get() {
return 0;
}, },
setHash: function setHash(hash) {}, set: function set(value) {}
executeNamedAction: function executeNamedAction(action) {}, }]);
onFileAttachmentAnnotation: function onFileAttachmentAnnotation(params) {},
cachePageRef: function cachePageRef(pageNum, pageRef) {}
};
return SimpleLinkService; return SimpleLinkService;
}(); }();
exports.PDFLinkService = PDFLinkService; exports.PDFLinkService = PDFLinkService;
exports.SimpleLinkService = SimpleLinkService; exports.SimpleLinkService = SimpleLinkService;

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.8.548", "version": "1.8.550",
"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": [

198
web/pdf_viewer.js

@ -720,47 +720,54 @@ exports.SimpleLinkService = exports.PDFLinkService = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
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 _dom_events = __w_pdfjs_require__(2); var _dom_events = __w_pdfjs_require__(2);
var _ui_utils = __w_pdfjs_require__(1); var _ui_utils = __w_pdfjs_require__(1);
var PDFLinkService = function PDFLinkServiceClosure() { function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function PDFLinkService(options) {
options = options || {}; var PDFLinkService = function () {
this.eventBus = options.eventBus || (0, _dom_events.getGlobalEventBus)(); function PDFLinkService() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
eventBus = _ref.eventBus;
_classCallCheck(this, PDFLinkService);
this.eventBus = eventBus || (0, _dom_events.getGlobalEventBus)();
this.baseUrl = null; this.baseUrl = null;
this.pdfDocument = null; this.pdfDocument = null;
this.pdfViewer = null; this.pdfViewer = null;
this.pdfHistory = null; this.pdfHistory = null;
this._pagesRefCache = null; this._pagesRefCache = null;
} }
PDFLinkService.prototype = {
setDocument: function PDFLinkService_setDocument(pdfDocument, baseUrl) { _createClass(PDFLinkService, [{
key: 'setDocument',
value: function setDocument(pdfDocument, baseUrl) {
this.baseUrl = baseUrl; this.baseUrl = baseUrl;
this.pdfDocument = pdfDocument; this.pdfDocument = pdfDocument;
this._pagesRefCache = Object.create(null); this._pagesRefCache = Object.create(null);
}, }
setViewer: function PDFLinkService_setViewer(pdfViewer) { }, {
key: 'setViewer',
value: function setViewer(pdfViewer) {
this.pdfViewer = pdfViewer; this.pdfViewer = pdfViewer;
}, }
setHistory: function PDFLinkService_setHistory(pdfHistory) { }, {
key: 'setHistory',
value: function setHistory(pdfHistory) {
this.pdfHistory = pdfHistory; this.pdfHistory = pdfHistory;
}, }
get pagesCount() { }, {
return this.pdfDocument ? this.pdfDocument.numPages : 0; key: 'navigateTo',
}, value: function navigateTo(dest) {
get page() {
return this.pdfViewer.currentPageNumber;
},
set page(value) {
this.pdfViewer.currentPageNumber = value;
},
navigateTo: function navigateTo(dest) {
var _this = this; var _this = this;
var goToDestination = function goToDestination(_ref) { var goToDestination = function goToDestination(_ref2) {
var namedDest = _ref.namedDest, var namedDest = _ref2.namedDest,
explicitDest = _ref.explicitDest; explicitDest = _ref2.explicitDest;
var destRef = explicitDest[0], var destRef = explicitDest[0],
pageNumber = void 0; pageNumber = void 0;
@ -821,8 +828,10 @@ var PDFLinkService = function PDFLinkServiceClosure() {
} }
goToDestination(data); goToDestination(data);
}); });
}, }
getDestinationHash: function getDestinationHash(dest) { }, {
key: 'getDestinationHash',
value: function getDestinationHash(dest) {
if (typeof dest === 'string') { if (typeof dest === 'string') {
return this.getAnchorUrl('#' + escape(dest)); return this.getAnchorUrl('#' + escape(dest));
} }
@ -831,13 +840,17 @@ var PDFLinkService = function PDFLinkServiceClosure() {
return this.getAnchorUrl('#' + escape(str)); return this.getAnchorUrl('#' + escape(str));
} }
return this.getAnchorUrl(''); return this.getAnchorUrl('');
}, }
}, {
getAnchorUrl: function PDFLinkService_getAnchorUrl(anchor) { key: 'getAnchorUrl',
value: function getAnchorUrl(anchor) {
return (this.baseUrl || '') + anchor; return (this.baseUrl || '') + anchor;
}, }
setHash: function PDFLinkService_setHash(hash) { }, {
var pageNumber, dest; key: 'setHash',
value: function setHash(hash) {
var pageNumber = void 0,
dest = void 0;
if (hash.indexOf('=') >= 0) { if (hash.indexOf('=') >= 0) {
var params = (0, _ui_utils.parseQueryString)(hash); var params = (0, _ui_utils.parseQueryString)(hash);
if ('search' in params) { if ('search' in params) {
@ -870,12 +883,12 @@ var PDFLinkService = function PDFLinkServiceClosure() {
dest = [null, { name: zoomArg }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null]; dest = [null, { name: zoomArg }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null];
} else if (zoomArg === 'FitR') { } else if (zoomArg === 'FitR') {
if (zoomArgs.length !== 5) { if (zoomArgs.length !== 5) {
console.error('PDFLinkService_setHash: ' + 'Not enough parameters for \'FitR\'.'); console.error('PDFLinkService.setHash: Not enough parameters for "FitR".');
} else { } else {
dest = [null, { name: zoomArg }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0]; dest = [null, { name: zoomArg }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];
} }
} else { } else {
console.error('PDFLinkService_setHash: \'' + zoomArg + '\' is not a valid zoom value.'); console.error('PDFLinkService.setHash: "' + zoomArg + '" is not ' + 'a valid zoom value.');
} }
} }
} }
@ -896,7 +909,7 @@ var PDFLinkService = function PDFLinkServiceClosure() {
} }
} else { } else {
if (/^\d+$/.test(hash) && hash <= this.pagesCount) { if (/^\d+$/.test(hash) && hash <= this.pagesCount) {
console.warn('PDFLinkService_setHash: specifying a page number ' + 'directly after the hash symbol (#) is deprecated, ' + 'please use the "#page=' + hash + '" form instead.'); console.warn('PDFLinkService_setHash: specifying a page number ' + 'directly after the hash symbol (#) is deprecated, ' + ('please use the "#page=' + hash + '" form instead.'));
this.page = hash | 0; this.page = hash | 0;
} }
dest = unescape(hash); dest = unescape(hash);
@ -913,10 +926,12 @@ var PDFLinkService = function PDFLinkServiceClosure() {
this.navigateTo(dest); this.navigateTo(dest);
return; return;
} }
console.error('PDFLinkService_setHash: \'' + unescape(hash) + '\' is not a valid destination.'); console.error('PDFLinkService.setHash: "' + unescape(hash) + '" is not ' + 'a valid destination.');
} }
}, }
executeNamedAction: function PDFLinkService_executeNamedAction(action) { }, {
key: 'executeNamedAction',
value: function executeNamedAction(action) {
switch (action) { switch (action) {
case 'GoBack': case 'GoBack':
if (this.pdfHistory) { if (this.pdfHistory) {
@ -951,27 +966,51 @@ var PDFLinkService = function PDFLinkServiceClosure() {
source: this, source: this,
action: action action: action
}); });
}, }
onFileAttachmentAnnotation: function onFileAttachmentAnnotation() { }, {
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; key: 'onFileAttachmentAnnotation',
value: function onFileAttachmentAnnotation(_ref3) {
var id = _ref3.id,
filename = _ref3.filename,
content = _ref3.content;
this.eventBus.dispatch('fileattachmentannotation', { this.eventBus.dispatch('fileattachmentannotation', {
source: this, source: this,
id: params.id, id: id,
filename: params.filename, filename: filename,
content: params.content content: content
}); });
}, }
}, {
cachePageRef: function PDFLinkService_cachePageRef(pageNum, pageRef) { key: 'cachePageRef',
value: function cachePageRef(pageNum, pageRef) {
var refStr = pageRef.num + ' ' + pageRef.gen + ' R'; var refStr = pageRef.num + ' ' + pageRef.gen + ' R';
this._pagesRefCache[refStr] = pageNum; this._pagesRefCache[refStr] = pageNum;
}, }
_cachedPageNumber: function PDFLinkService_cachedPageNumber(pageRef) { }, {
key: '_cachedPageNumber',
value: function _cachedPageNumber(pageRef) {
var refStr = pageRef.num + ' ' + pageRef.gen + ' R'; var refStr = pageRef.num + ' ' + pageRef.gen + ' R';
return this._pagesRefCache && this._pagesRefCache[refStr] || null; return this._pagesRefCache && this._pagesRefCache[refStr] || null;
} }
}; }, {
key: 'pagesCount',
get: function get() {
return this.pdfDocument ? this.pdfDocument.numPages : 0;
}
}, {
key: 'page',
get: function get() {
return this.pdfViewer.currentPageNumber;
},
set: function set(value) {
this.pdfViewer.currentPageNumber = value;
}
}]);
return PDFLinkService;
}();
function isValidExplicitDestination(dest) { function isValidExplicitDestination(dest) {
if (!(dest instanceof Array)) { if (!(dest instanceof Array)) {
return false; return false;
@ -1023,29 +1062,52 @@ var PDFLinkService = function PDFLinkServiceClosure() {
} }
return true; return true;
} }
return PDFLinkService;
}(); var SimpleLinkService = function () {
var SimpleLinkService = function SimpleLinkServiceClosure() { function SimpleLinkService() {
function SimpleLinkService() {} _classCallCheck(this, SimpleLinkService);
SimpleLinkService.prototype = { }
get page() {
return 0; _createClass(SimpleLinkService, [{
}, key: 'navigateTo',
set page(value) {}, value: function navigateTo(dest) {}
navigateTo: function navigateTo(dest) {}, }, {
getDestinationHash: function getDestinationHash(dest) { key: 'getDestinationHash',
value: function getDestinationHash(dest) {
return '#'; return '#';
}, }
getAnchorUrl: function getAnchorUrl(hash) { }, {
key: 'getAnchorUrl',
value: function getAnchorUrl(hash) {
return '#'; return '#';
}
}, {
key: 'setHash',
value: function setHash(hash) {}
}, {
key: 'executeNamedAction',
value: function executeNamedAction(action) {}
}, {
key: 'onFileAttachmentAnnotation',
value: function onFileAttachmentAnnotation(_ref4) {
var id = _ref4.id,
filename = _ref4.filename,
content = _ref4.content;
}
}, {
key: 'cachePageRef',
value: function cachePageRef(pageNum, pageRef) {}
}, {
key: 'page',
get: function get() {
return 0;
}, },
setHash: function setHash(hash) {}, set: function set(value) {}
executeNamedAction: function executeNamedAction(action) {}, }]);
onFileAttachmentAnnotation: function onFileAttachmentAnnotation(params) {},
cachePageRef: function cachePageRef(pageNum, pageRef) {}
};
return SimpleLinkService; return SimpleLinkService;
}(); }();
exports.PDFLinkService = PDFLinkService; exports.PDFLinkService = PDFLinkService;
exports.SimpleLinkService = SimpleLinkService; exports.SimpleLinkService = SimpleLinkService;

2
web/pdf_viewer.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save