Browse Source

PDF.js version 1.1.527

master v1.1.527
Pdf Bot 9 years ago
parent
commit
73d2133a7e
  1. 2
      bower.json
  2. 58
      build/pdf.combined.js
  3. 67
      build/pdf.js
  4. 45
      build/pdf.worker.js
  5. 2
      package.json

2
bower.json

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

58
build/pdf.combined.js

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.1.523'; PDFJS.version = '1.1.527';
PDFJS.build = 'd89fde0'; PDFJS.build = '2096a2a';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -340,6 +340,38 @@ function shadow(obj, prop, value) {
} }
PDFJS.shadow = shadow; PDFJS.shadow = shadow;
var LinkTarget = PDFJS.LinkTarget = {
NONE: 0, // Default value.
SELF: 1,
BLANK: 2,
PARENT: 3,
TOP: 4,
};
var LinkTargetStringMap = [
'',
'_self',
'_blank',
'_parent',
'_top'
];
function isExternalLinkTargetSet() {
switch (PDFJS.externalLinkTarget) {
case LinkTarget.NONE:
return false;
case LinkTarget.SELF:
case LinkTarget.BLANK:
case LinkTarget.PARENT:
case LinkTarget.TOP:
return true;
}
warn('PDFJS.externalLinkTarget is invalid: ' + PDFJS.externalLinkTarget);
// Reset the external link target, to suppress further warnings.
PDFJS.externalLinkTarget = LinkTarget.NONE;
return false;
}
PDFJS.isExternalLinkTargetSet = isExternalLinkTargetSet;
var PasswordResponses = PDFJS.PasswordResponses = { var PasswordResponses = PDFJS.PasswordResponses = {
NEED_PASSWORD: 1, NEED_PASSWORD: 1,
INCORRECT_PASSWORD: 2 INCORRECT_PASSWORD: 2
@ -1747,14 +1779,27 @@ PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ?
16777216 : PDFJS.maxCanvasPixels); 16777216 : PDFJS.maxCanvasPixels);
/** /**
* Opens external links in a new window if enabled. The default behavior opens * (Deprecated) Opens external links in a new window if enabled.
* external links in the PDF.js window. * The default behavior opens external links in the PDF.js window.
* @var {boolean} * @var {boolean}
*/ */
PDFJS.openExternalLinksInNewWindow = ( PDFJS.openExternalLinksInNewWindow = (
PDFJS.openExternalLinksInNewWindow === undefined ? PDFJS.openExternalLinksInNewWindow === undefined ?
false : PDFJS.openExternalLinksInNewWindow); false : PDFJS.openExternalLinksInNewWindow);
/**
* Specifies the |target| attribute for external links.
* The constants from PDFJS.LinkTarget should be used:
* - NONE [default]
* - SELF
* - BLANK
* - PARENT
* - TOP
* @var {number}
*/
PDFJS.externalLinkTarget = (PDFJS.externalLinkTarget === undefined ?
PDFJS.LinkTarget.NONE : PDFJS.externalLinkTarget);
/** /**
* Determines if we can eval strings as JS. Primarily used to improve * Determines if we can eval strings as JS. Primarily used to improve
* performance for font rendering. * performance for font rendering.
@ -6850,8 +6895,9 @@ var AnnotationUtils = (function AnnotationUtilsClosure() {
var link = document.createElement('a'); var link = document.createElement('a');
link.href = link.title = item.url || ''; link.href = link.title = item.url || '';
if (item.url && PDFJS.openExternalLinksInNewWindow) {
link.target = '_blank'; if (item.url && isExternalLinkTargetSet()) {
link.target = LinkTargetStringMap[PDFJS.externalLinkTarget];
} }
container.appendChild(link); container.appendChild(link);

67
build/pdf.js

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.1.523'; PDFJS.version = '1.1.527';
PDFJS.build = 'd89fde0'; PDFJS.build = '2096a2a';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -340,6 +340,47 @@ function shadow(obj, prop, value) {
} }
PDFJS.shadow = shadow; PDFJS.shadow = shadow;
var LinkTarget = PDFJS.LinkTarget = {
NONE: 0, // Default value.
SELF: 1,
BLANK: 2,
PARENT: 3,
TOP: 4,
};
var LinkTargetStringMap = [
'',
'_self',
'_blank',
'_parent',
'_top'
];
function isExternalLinkTargetSet() {
if (PDFJS.openExternalLinksInNewWindow) {
warn('PDFJS.openExternalLinksInNewWindow is deprecated, ' +
'use PDFJS.externalLinkTarget instead.');
if (PDFJS.externalLinkTarget === LinkTarget.NONE) {
PDFJS.externalLinkTarget = LinkTarget.BLANK;
}
// Reset the deprecated parameter, to suppress further warnings.
PDFJS.openExternalLinksInNewWindow = false;
}
switch (PDFJS.externalLinkTarget) {
case LinkTarget.NONE:
return false;
case LinkTarget.SELF:
case LinkTarget.BLANK:
case LinkTarget.PARENT:
case LinkTarget.TOP:
return true;
}
warn('PDFJS.externalLinkTarget is invalid: ' + PDFJS.externalLinkTarget);
// Reset the external link target, to suppress further warnings.
PDFJS.externalLinkTarget = LinkTarget.NONE;
return false;
}
PDFJS.isExternalLinkTargetSet = isExternalLinkTargetSet;
var PasswordResponses = PDFJS.PasswordResponses = { var PasswordResponses = PDFJS.PasswordResponses = {
NEED_PASSWORD: 1, NEED_PASSWORD: 1,
INCORRECT_PASSWORD: 2 INCORRECT_PASSWORD: 2
@ -1747,14 +1788,27 @@ PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ?
16777216 : PDFJS.maxCanvasPixels); 16777216 : PDFJS.maxCanvasPixels);
/** /**
* Opens external links in a new window if enabled. The default behavior opens * (Deprecated) Opens external links in a new window if enabled.
* external links in the PDF.js window. * The default behavior opens external links in the PDF.js window.
* @var {boolean} * @var {boolean}
*/ */
PDFJS.openExternalLinksInNewWindow = ( PDFJS.openExternalLinksInNewWindow = (
PDFJS.openExternalLinksInNewWindow === undefined ? PDFJS.openExternalLinksInNewWindow === undefined ?
false : PDFJS.openExternalLinksInNewWindow); false : PDFJS.openExternalLinksInNewWindow);
/**
* Specifies the |target| attribute for external links.
* The constants from PDFJS.LinkTarget should be used:
* - NONE [default]
* - SELF
* - BLANK
* - PARENT
* - TOP
* @var {number}
*/
PDFJS.externalLinkTarget = (PDFJS.externalLinkTarget === undefined ?
PDFJS.LinkTarget.NONE : PDFJS.externalLinkTarget);
/** /**
* Determines if we can eval strings as JS. Primarily used to improve * Determines if we can eval strings as JS. Primarily used to improve
* performance for font rendering. * performance for font rendering.
@ -6894,8 +6948,9 @@ var AnnotationUtils = (function AnnotationUtilsClosure() {
var link = document.createElement('a'); var link = document.createElement('a');
link.href = link.title = item.url || ''; link.href = link.title = item.url || '';
if (item.url && PDFJS.openExternalLinksInNewWindow) {
link.target = '_blank'; if (item.url && isExternalLinkTargetSet()) {
link.target = LinkTargetStringMap[PDFJS.externalLinkTarget];
} }
container.appendChild(link); container.appendChild(link);

45
build/pdf.worker.js vendored

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.1.523'; PDFJS.version = '1.1.527';
PDFJS.build = 'd89fde0'; PDFJS.build = '2096a2a';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -340,6 +340,47 @@ function shadow(obj, prop, value) {
} }
PDFJS.shadow = shadow; PDFJS.shadow = shadow;
var LinkTarget = PDFJS.LinkTarget = {
NONE: 0, // Default value.
SELF: 1,
BLANK: 2,
PARENT: 3,
TOP: 4,
};
var LinkTargetStringMap = [
'',
'_self',
'_blank',
'_parent',
'_top'
];
function isExternalLinkTargetSet() {
if (PDFJS.openExternalLinksInNewWindow) {
warn('PDFJS.openExternalLinksInNewWindow is deprecated, ' +
'use PDFJS.externalLinkTarget instead.');
if (PDFJS.externalLinkTarget === LinkTarget.NONE) {
PDFJS.externalLinkTarget = LinkTarget.BLANK;
}
// Reset the deprecated parameter, to suppress further warnings.
PDFJS.openExternalLinksInNewWindow = false;
}
switch (PDFJS.externalLinkTarget) {
case LinkTarget.NONE:
return false;
case LinkTarget.SELF:
case LinkTarget.BLANK:
case LinkTarget.PARENT:
case LinkTarget.TOP:
return true;
}
warn('PDFJS.externalLinkTarget is invalid: ' + PDFJS.externalLinkTarget);
// Reset the external link target, to suppress further warnings.
PDFJS.externalLinkTarget = LinkTarget.NONE;
return false;
}
PDFJS.isExternalLinkTargetSet = isExternalLinkTargetSet;
var PasswordResponses = PDFJS.PasswordResponses = { var PasswordResponses = PDFJS.PasswordResponses = {
NEED_PASSWORD: 1, NEED_PASSWORD: 1,
INCORRECT_PASSWORD: 2 INCORRECT_PASSWORD: 2

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.1.523", "version": "1.1.527",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [
"Mozilla", "Mozilla",

Loading…
Cancel
Save