|
|
|
@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
|
|
|
|
|
(typeof window !== 'undefined' ? window : this).PDFJS = {}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PDFJS.version = '1.1.523'; |
|
|
|
|
PDFJS.build = 'd89fde0'; |
|
|
|
|
PDFJS.version = '1.1.527'; |
|
|
|
|
PDFJS.build = '2096a2a'; |
|
|
|
|
|
|
|
|
|
(function pdfjsWrapper() { |
|
|
|
|
// Use strict in our context only - users might not want it
|
|
|
|
@ -340,6 +340,47 @@ function shadow(obj, prop, value) {
@@ -340,6 +340,47 @@ function shadow(obj, prop, value) {
|
|
|
|
|
} |
|
|
|
|
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 = { |
|
|
|
|
NEED_PASSWORD: 1, |
|
|
|
|
INCORRECT_PASSWORD: 2 |
|
|
|
@ -1747,14 +1788,27 @@ PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ?
@@ -1747,14 +1788,27 @@ PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ?
|
|
|
|
|
16777216 : PDFJS.maxCanvasPixels); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Opens external links in a new window if enabled. The default behavior opens |
|
|
|
|
* external links in the PDF.js window. |
|
|
|
|
* (Deprecated) Opens external links in a new window if enabled. |
|
|
|
|
* The default behavior opens external links in the PDF.js window. |
|
|
|
|
* @var {boolean} |
|
|
|
|
*/ |
|
|
|
|
PDFJS.openExternalLinksInNewWindow = ( |
|
|
|
|
PDFJS.openExternalLinksInNewWindow === undefined ? |
|
|
|
|
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 |
|
|
|
|
* performance for font rendering. |
|
|
|
@ -6894,8 +6948,9 @@ var AnnotationUtils = (function AnnotationUtilsClosure() {
@@ -6894,8 +6948,9 @@ var AnnotationUtils = (function AnnotationUtilsClosure() {
|
|
|
|
|
|
|
|
|
|
var link = document.createElement('a'); |
|
|
|
|
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); |
|
|
|
|