Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: options.js

Issue 29321206: Issue 2383 - Added links to options page sidebar (Closed)
Patch Set: Created June 29, 2015, 4:31 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « options.html ('k') | skin/options.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options.js
===================================================================
--- a/options.js
+++ b/options.js
@@ -325,7 +325,6 @@
var buttonText = ext.i18n.getMessage("options_button_add");
languagesTemplate.content.querySelector(".button-add span").textContent = buttonText;
- updateShareLink();
populateLists();
var tabList = document.querySelectorAll("#main-navigation-tabs li");
@@ -346,17 +345,29 @@
searchStyle.innerHTML = "#all-lang-table li:not([data-search*=\"" + this.value.toLowerCase() + "\"]) { display: none; }";
}
- // Update version number in navigation sidebar
+ // Initialize navigation sidebar
ext.backgroundPage.sendMessage(
{
- method: "app.get",
+ type: "app.get",
what: "addonVersion"
},
function(addonVersion)
{
E("abp-version").textContent = addonVersion;
});
-
+ getDocLink("releases", function(link)
+ {
+ E("link-version").setAttribute("href", link);
+ });
+
+ getDocLink("contribute", function(link)
+ {
+ document.querySelector("#tab-contribute a").setAttribute("href", link);
+ });
+
+ updateShareLink();
+
+ // Initialize interactive UI elements
var placeholderValue = ext.i18n.getMessage("options_dialog_language_find");
E("find-language").setAttribute("placeholder", placeholderValue);
E("add-blocking-list").addEventListener("click", function()
@@ -620,6 +631,16 @@
return document.getElementById(id);
}
+ function getDocLink(link, callback)
+ {
+ ext.backgroundPage.sendMessage(
+ {
+ type: "app.get",
+ what: "doclink",
+ link: link
+ }, callback);
+ }
+
ext.onMessage.addListener(function(message)
{
switch (message.type)
« no previous file with comments | « options.html ('k') | skin/options.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld