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:
Jonas Jenwald 2016-03-03 13:26:51 +01:00
parent b63ef7a8b6
commit f3f825cc71
3 changed files with 32 additions and 12 deletions

View file

@ -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');