[api-minor] Add an option to PDFJS for specifying the |target| attribute of external links

Replaces `PDFJS.openExternalLinksInNewWindow` with a more generic configuration option.
*Note:* `PDFJS.openExternalLinksInNewWindow = true;` is equal to `PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK;`.
This commit is contained in:
Jonas Jenwald 2015-04-19 12:27:51 +02:00
parent d89fde05b0
commit 9ab896e307
3 changed files with 62 additions and 5 deletions

View file

@ -169,14 +169,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.