Index: new-options.js |
=================================================================== |
--- a/new-options.js |
+++ b/new-options.js |
@@ -550,17 +550,6 @@ |
}); |
} |
- function openDocLink(id) |
- { |
- getDocLink(id, (link) => |
- { |
- if (id == "share-general") |
- openSharePopup(link); |
- else |
- location.href = link; |
- }); |
- } |
- |
function switchTab(id) |
{ |
location.hash = id; |
@@ -652,11 +641,6 @@ |
openDialog(dialog); |
break; |
} |
- case "open-doclink": { |
- let doclink = findParentData(element, "doclink", false); |
- openDocLink(doclink); |
- break; |
- } |
case "remove-filter": |
ext.backgroundPage.sendMessage({ |
type: "filters.remove", |
@@ -684,8 +668,7 @@ |
}); |
break; |
case "switch-tab": |
- let tabId = findParentData(element, "tab", false); |
- switchTab(tabId); |
+ switchTab(element.getAttribute("href").substr(1)); |
break; |
case "toggle-disable-subscription": |
ext.backgroundPage.sendMessage({ |
@@ -798,10 +781,12 @@ |
if (element.getAttribute("role") == "tab") |
{ |
+ let parent = element.parentElement; |
if (key == "ArrowLeft" || key == "ArrowUp") |
- element = element.previousElementSibling || container.lastElementChild; |
+ parent = parent.previousElementSibling || container.lastElementChild; |
else if (key == "ArrowRight" || key == "ArrowDown") |
- element = element.nextElementSibling || container.firstElementChild; |
+ parent = parent.nextElementSibling || container.firstElementChild; |
+ element = parent.firstElementChild; |
} |
let actions = container.getAttribute("data-action").split(","); |
@@ -823,11 +808,9 @@ |
let previousTab = tabList.querySelector("[aria-selected]"); |
previousTab.removeAttribute("aria-selected"); |
- previousTab.setAttribute("tabindex", -1); |
- let tab = tabList.querySelector("li[data-tab='" + tabId + "']"); |
+ let tab = tabList.querySelector("a[href='#" + tabId + "']"); |
tab.setAttribute("aria-selected", true); |
- tab.setAttribute("tabindex", 0); |
let tabContentId = tab.getAttribute("aria-controls"); |
let tabContent = document.getElementById(tabContentId); |
@@ -867,14 +850,10 @@ |
}, |
(addonVersion) => |
{ |
- E("abp-version").textContent = addonVersion; |
- }); |
- getDocLink("releases", (link) => |
- { |
- E("link-version").setAttribute("href", link); |
+ E("abp-version").textContent = getMessage("options_dialog_about_version", |
+ [addonVersion]); |
}); |
- updateShareLink(); |
updateTooltips(); |
// Initialize interactive UI elements |
@@ -888,6 +867,11 @@ |
E("whitelisting-add-button").disabled = !e.target.value; |
}, false); |
+ |
+ getDocLink("contribute", (link) => |
+ { |
+ E("contribute").href = link; |
+ }); |
getDocLink("acceptable_ads_criteria", (link) => |
{ |
setLinks("enable-aa-description", link); |
@@ -1163,7 +1147,6 @@ |
case "added": |
filter[timestampUI] = Date.now(); |
updateFilter(filter); |
- updateShareLink(); |
break; |
case "loaded": |
populateLists(); |
@@ -1176,7 +1159,6 @@ |
removeCustomFilter(filter.text); |
delete filtersMap[filter.text]; |
- updateShareLink(); |
break; |
} |
} |
@@ -1244,7 +1226,6 @@ |
break; |
} |
- updateShareLink(); |
} |
function hidePref(key, value) |
@@ -1305,30 +1286,6 @@ |
checkbox.setAttribute("aria-checked", value); |
} |
- function updateShareLink() |
- { |
- let shareResources = [ |
- "https://facebook.com/plugins/like.php?", |
- "https://platform.twitter.com/widgets/", |
- "https://apis.google.com/se/0/_/+1/fastbutton?" |
- ]; |
- let isAnyBlocked = false; |
- let checksRemaining = shareResources.length; |
- |
- function onResult(isBlocked) |
- { |
- isAnyBlocked |= isBlocked; |
- if (!--checksRemaining) |
- { |
- // Hide the share tab if a script on the share page would be blocked |
- E("tab-share").hidden = isAnyBlocked; |
- } |
- } |
- |
- for (let sharedResource of shareResources) |
- checkShareResource(sharedResource, onResult); |
- } |
- |
function getMessages(id) |
{ |
let messages = []; |