Bug 1349744 - Help button moved to bottom left corner.
MozReview-Commit-ID: 1kPmGxrgWtt
--- a/browser/components/preferences/in-content/advanced.xul
+++ b/browser/components/preferences/in-content/advanced.xul
@@ -49,17 +49,16 @@
<stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
#endif
<hbox id="header-advanced"
class="header"
hidden="true"
data-category="paneAdvanced">
<label class="header-name" flex="1">&paneUpdates.title;</label>
- <html:a class="help-button" target="_blank" aria-label="&helpButton.label;"></html:a>
</hbox>
<!-- Update -->
#ifdef MOZ_UPDATER
<groupbox id="updateApp" align="start" data-category="paneAdvanced" hidden="true">
<caption><label>&updateApplication.label;</label></caption>
<radiogroup id="updateRadioGroup" align="start">
<radio id="autoDesktop"
--- a/browser/components/preferences/in-content/applications.xul
+++ b/browser/components/preferences/in-content/applications.xul
@@ -59,17 +59,16 @@
<key key="&focusSearch2.key;" modifiers="accel" id="focusSearch2" oncommand=";"/>
</keyset>
<hbox id="header-applications"
class="header"
hidden="true"
data-category="paneApplications">
<label class="header-name" flex="1">&paneDownloadLinks.title;</label>
- <html:a class="help-button" target="_blank" aria-label="&helpButton.label;"></html:a>
</hbox>
<vbox id="applicationsContent"
data-category="paneApplications"
hidden="true"
flex="1">
<!--Downloads-->
--- a/browser/components/preferences/in-content/containers.xul
+++ b/browser/components/preferences/in-content/containers.xul
@@ -21,18 +21,16 @@
<label class="text-link" id="backContainersLink" value="&backLink.label;" />
</hbox>
<hbox id="header-containers"
class="header"
hidden="true"
data-category="paneContainers">
<label class="header-name" flex="1">&paneContainers.title;</label>
- <button class="help-button"
- aria-label="&helpButton.label;"/>
</hbox>
<!-- Containers -->
<groupbox id="browserContainersGroup" data-category="paneContainers" hidden="true">
<vbox id="browserContainersbox">
<richlistbox id="containersView" orient="vertical" persist="lastSelectedType"
flex="1">
--- a/browser/components/preferences/in-content/findInPage.js
+++ b/browser/components/preferences/in-content/findInPage.js
@@ -226,22 +226,19 @@ var gSearchResultsPane = {
if (!resultsFound) {
let noResultsEl = document.querySelector(".no-results-message");
noResultsEl.hidden = false;
let strings = this.strings;
document.getElementById("sorry-message").textContent =
strings.getFormattedString("searchResults.sorryMessage", [query]);
-
let brandName = document.getElementById("bundleBrand").getString("brandShortName");
document.getElementById("need-help").innerHTML =
strings.getFormattedString("searchResults.needHelp", [brandName]);
-
- document.getElementById("need-help-link").setAttribute("href", getHelpLinkURL("search"));
}
} else {
this.searchResultsCategory.hidden = true;
document.getElementById("sorry-message").textContent = "";
// Going back to General when cleared
gotoPref("paneGeneral");
}
},
--- a/browser/components/preferences/in-content/main.xul
+++ b/browser/components/preferences/in-content/main.xul
@@ -182,17 +182,16 @@
#endif
</preferences>
<hbox id="header-general"
class="header"
hidden="true"
data-category="paneGeneral">
<label class="header-name" flex="1">&paneGeneral.title;</label>
- <html:a class="help-button" target="_blank" aria-label="&helpButton.label;"></html:a>
</hbox>
<!-- Startup -->
<groupbox id="startupGroup"
data-category="paneGeneral"
hidden="true">
<caption><label>&startup.label;</label></caption>
--- a/browser/components/preferences/in-content/preferences.js
+++ b/browser/components/preferences/in-content/preferences.js
@@ -81,24 +81,16 @@ function init_all() {
init_dynamic_padding();
var initFinished = new CustomEvent("Initialized", {
"bubbles": true,
"cancelable": true
});
document.dispatchEvent(initFinished);
- categories = categories.querySelectorAll("richlistitem.category");
- for (let category of categories) {
- let name = internalPrefCategoryNameToFriendlyName(category.value);
- let helpSelector = `#header-${name} > .help-button`;
- let helpButton = document.querySelector(helpSelector);
- helpButton.setAttribute("href", getHelpLinkURL(category.getAttribute("helpTopic")));
- }
-
// Wait until initialization of all preferences are complete before
// notifying observers that the UI is now ready.
Services.obs.notifyObservers(window, "advanced-pane-loaded", null);
}
// Make the space above the categories list shrink on low window heights
function init_dynamic_padding() {
let categories = document.getElementById("categories");
@@ -150,16 +142,19 @@ function gotoPref(aCategory) {
if (gLastHash == category)
return;
let item = categories.querySelector(".category[value=" + category + "]");
if (!item) {
category = kDefaultCategoryInternalName;
item = categories.querySelector(".category[value=" + category + "]");
}
+ let helpButton = document.querySelector(".help-button");
+ helpButton.setAttribute("href", getHelpLinkURL(item.getAttribute("helpTopic")));
+
try {
init_category_if_required(category);
} catch (ex) {
Cu.reportError("Error initializing preference category " + category + ": " + ex);
throw ex;
}
let friendlyName = internalPrefCategoryNameToFriendlyName(category);
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content/preferences.xul
@@ -163,16 +163,18 @@
<keyset>
<!-- Disable the findbar because it doesn't work properly.
Remove this keyset once bug 1094240 ("disablefastfind" attribute
broken in e10s mode) is fixed. -->
<key key="&focusSearch1.key;" modifiers="accel" id="focusSearch1" oncommand=";"/>
</keyset>
+ <html:a class="help-button" target="_blank" aria-label="&helpButton2.label;">&helpButton2.label;</html:a>
+
<vbox class="main-content" flex="1">
<hbox pack="end">
<textbox type="search" id="searchInput" placeholder="&searchInput.label;" hidden="true"/>
</hbox>
<prefpane id="mainPrefPane">
#include searchResults.xul
#include main.xul
#include privacy.xul
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -158,17 +158,16 @@
<stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
<hbox id="header-privacy"
class="header"
hidden="true"
data-category="panePrivacy">
<label class="header-name" flex="1">&panePrivacySecurity.title;</label>
- <html:a class="help-button" target="_blank" aria-label="&helpButton.label;"></html:a>
</hbox>
<!-- History -->
<groupbox id="historyGroup" data-category="panePrivacy" hidden="true">
<caption><label>&history.label;</label></caption>
<hbox align="center">
<label id="historyModeLabel"
--- a/browser/components/preferences/in-content/searchResults.xul
+++ b/browser/components/preferences/in-content/searchResults.xul
@@ -4,15 +4,14 @@
<stringbundle id="searchResultBundle" src="chrome://browser/locale/preferences/preferences.properties"/>
<hbox id="header-searchResults"
class="header"
hidden="true"
data-category="paneSearchResults">
<label class="header-name" flex="1">&paneSearchResults.title;</label>
- <html:a class="help-button" target="_blank" aria-label="&helpButton.label;"></html:a>
</hbox>
<groupbox class="no-results-message" align="start" data-category="paneSearchResults" hidden="true">
<label id="sorry-message"></label>
<label id="need-help"></label>
</groupbox>
--- a/browser/components/preferences/in-content/sync.xul
+++ b/browser/components/preferences/in-content/sync.xul
@@ -28,17 +28,16 @@
<script type="application/javascript"
src="chrome://browser/content/preferences/in-content/sync.js"/>
<hbox id="header-sync"
class="header"
hidden="true"
data-category="paneSync">
<label class="header-name" flex="1">&paneSync1.title;</label>
- <html:a class="help-button text-link" target="_blank" aria-label="&helpButton.label;"></html:a>
</hbox>
<deck id="weavePrefsDeck" data-category="paneSync" hidden="true">
<vbox id="noFxaAccount">
<hbox>
<vbox id="fxaContentWrapper">
<groupbox id="noFxaGroup">
<vbox>
--- a/browser/locales/en-US/chrome/browser/preferences/preferences.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/preferences.dtd
@@ -18,11 +18,11 @@
<!ENTITY paneDownloadLinks.title "Downloads & Links">
<!ENTITY panePrivacySecurity.title "Privacy & Security">
<!ENTITY paneContainers.title "Container Tabs">
<!ENTITY paneUpdates.title "Updates">
<!-- LOCALIZATION NOTE (paneSync1.title): This should match syncBrand.fxAccount.label in ../syncBrand.dtd -->
<!ENTITY paneSync1.title "Firefox Account">
-<!ENTITY helpButton.label "Help">
+<!ENTITY helpButton2.label "Firefox Support">
-<!ENTITY searchInput.label "Search">
+<!ENTITY searchInput.label "Search">
--- a/browser/themes/shared/incontentprefs/preferences.inc.css
+++ b/browser/themes/shared/incontentprefs/preferences.inc.css
@@ -92,16 +92,19 @@ treecol {
#category-search-results > .category-icon {
list-style-image: url("chrome://browser/skin/preferences/in-content/icons.svg#searchResults");
}
@media (max-width: 800px) {
.category-name {
display: none;
}
+ .help-button {
+ font-size: 0 !important;
+ }
}
/* header */
.header {
display: flex;
align-items: center;
justify-content: space-between;
}
@@ -549,8 +552,26 @@ description > html|a {
}
.iOSLink {
background-image: url("chrome://browser/skin/fxa/ios@2x.png");
}
.fxaFirefoxLogo {
list-style-image: url(chrome://browser/skin/fxa/logo@2x.png);
}
}
+
+.help-button {
+ position: fixed;
+ left: 0;
+ bottom: 39px;
+ font-size: 13px;
+ line-height: 13px;
+ height: 14px;
+ background-position: 15px;
+ padding-inline-start: 35px;
+ white-space: nowrap;
+}
+
+.help-button:link,
+.help-button:visited {
+ color: var(--in-content-category-text);
+ text-decoration: none;
+}