mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Various improvements for GoToR
actions
- Add support for the 'NewWindow' property. - Ensure that destinations are applied to the *remote* document, instead of the current one. - Handle the `F` entry being a standard string, instead of a dictionary.
This commit is contained in:
parent
b63ef7a8b6
commit
f3f825cc71
3 changed files with 32 additions and 12 deletions
|
@ -114,15 +114,15 @@ var LinkTargetStringMap = [
|
|||
/**
|
||||
* @typedef ExternalLinkParameters
|
||||
* @typedef {Object} ExternalLinkParameters
|
||||
* @property {string} url
|
||||
* @property {LinkTarget} target
|
||||
* @property {string} rel
|
||||
* @property {string} url - An absolute URL.
|
||||
* @property {LinkTarget} target - The link target.
|
||||
* @property {string} rel - The link relationship.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Adds various attributes (href, title, target, rel) to hyperlinks.
|
||||
* @param {HTMLLinkElement} link - The link element.
|
||||
* @param {ExternalLinkParameters} params - An object with the properties.
|
||||
* @param {ExternalLinkParameters} params
|
||||
*/
|
||||
function addLinkAttributes(link, params) {
|
||||
var url = params && params.url;
|
||||
|
@ -134,7 +134,7 @@ function addLinkAttributes(link, params) {
|
|||
target = getDefaultSetting('externalLinkTarget');
|
||||
}
|
||||
link.target = LinkTargetStringMap[target];
|
||||
// Strip referrer from the URL.
|
||||
|
||||
var rel = params.rel;
|
||||
if (typeof rel === 'undefined') {
|
||||
rel = getDefaultSetting('externalLinkRel');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue