Commit 410aba6f authored by Thomas Greiner's avatar Thomas Greiner

Issue 2383 - Added links to options page sidebar

parent 5fb201d3
......@@ -31,9 +31,9 @@
"description": "Share button in navigation sidebar",
"message": "Share"
},
"options_tab_donate": {
"description": "Donate button in navigation sidebar",
"message": "Donate"
"options_tab_contribute": {
"description": "Button in navigation sidebar to support Adblock Plus",
"message": "Support us"
},
"options_readMore": {
"description": "Read more element that shows tooltip with description",
......@@ -263,4 +263,4 @@
"description": "Language name shown in add language modal dialog",
"message": "Russian and Ukrainian"
}
}
\ No newline at end of file
}
......@@ -37,27 +37,30 @@
</div>
<ul id="main-navigation-tabs" class="tabs vertical">
<li id="tab-general" data-show="general" class="active">
<span class="i18n_options_tab_general"></span>
<a class="i18n_options_tab_general"></a>
<span class="icon"></span>
</li>
<li id="tab-advanced" data-show="advanced">
<span class="i18n_options_tab_advanced"></span>
<a class="i18n_options_tab_advanced"></a>
<span class="icon"></span>
</li>
<li id="tab-help" data-show="help">
<span class="i18n_options_tab_help"></span>
<a class="i18n_options_tab_help"></a>
<span class="icon"></span>
</li>
</ul>
<p class="nav-link">
<span class="i18n_options_version"></span> <span id="abp-version"></span>
</p>
<a id="link-version">
<span class="i18n_options_version"></span>
<span id="abp-version"></span>
</a>
<ul class="tabs vertical bottom">
<li id="tab-share">
<span class="i18n_options_tab_share"></span><span class="icon"></span>
<a class="i18n_options_tab_share"></a>
<span class="icon"></span>
</li>
<li id="tab-donate">
<span class="i18n_options_tab_donate"></span><span class="icon"></span>
<li id="tab-contribute">
<a class="i18n_options_tab_contribute"></a>
<span class="icon"></span>
</li>
</ul>
</div>
......@@ -310,4 +313,4 @@
</div>
</div>
</body>
</html>
\ No newline at end of file
</html>
......@@ -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)
......
......@@ -111,9 +111,11 @@ input[type="search"]::-webkit-search-cancel-button
display: flex;
}
.tabs li span:first-child
.tabs li a:first-child
{
flex: 1;
color: inherit;
text-decoration: none;
}
.tabs.vertical
......@@ -213,7 +215,7 @@ body[data-tab="help"] #tab-help
width: 16px;
}
#tab-donate .icon
#tab-contribute .icon
{
background-position: -30px -17px;
height: 16px;
......@@ -236,11 +238,18 @@ body[data-tab="help"] #tab-help
padding: 40px 0px 16px 0px;
}
.nav-link
#link-version
{
-moz-margin-start: 12px;
-webkit-margin-start: 12px;
display: flex;
margin: 12px 20px;
color: #3A7BA6;
text-decoration: none;
}
#abp-version
{
-moz-margin-start: 5px;
-webkit-margin-start: 5px;
}
#content-wrapper
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment