 Issue 29321206:
  Issue 2383 - Added links to options page sidebar  (Closed)
    
  
    Issue 29321206:
  Issue 2383 - Added links to options page sidebar  (Closed) 
  | 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,15 @@ | 
| return document.getElementById(id); | 
| } | 
| + function getDocLink(link, callback) | 
| + { | 
| + ext.backgroundPage.sendMessage({ | 
| 
saroyanm
2015/06/29 15:59:17
nit: please place the opening curly bracket in the
 
Thomas Greiner
2015/06/29 16:34:11
I changed it but seeing that it's done differently
 
saroyanm
2015/06/29 18:40:41
Good point, will create ticket for that.
 | 
| + type: "app.get", | 
| + what: "doclink", | 
| + link: link | 
| + }, callback); | 
| + } | 
| + | 
| ext.onMessage.addListener(function(message) | 
| { | 
| switch (message.type) |