Bug 1390499 - Show all second level headers in Preferences search result r?jaws
--- a/browser/components/preferences/in-content-new/findInPage.js
+++ b/browser/components/preferences/in-content-new/findInPage.js
@@ -234,16 +234,21 @@ var gSearchResultsPane = {
gotoPref("paneSearchResults");
let resultsFound = false;
// Building the range for highlighted areas
let rootPreferencesChildren = document
.querySelectorAll("#mainPrefPane > *:not([data-hidden-from-search])");
+ // Show all second level headers in search result
+ for (let element of document.querySelectorAll("caption.search-header")) {
+ element.hidden = false;
+ }
+
if (subQuery) {
// Since the previous query is a subset of the current query,
// there is no need to check elements that is hidden already.
rootPreferencesChildren =
Array.prototype.filter.call(rootPreferencesChildren, el => !el.hidden);
}
// Mark all the children to check be visible to bind JS, Access Keys, etc,
@@ -313,16 +318,21 @@ var gSearchResultsPane = {
Services.telemetry.keyedScalarAdd("preferences.search_query", this.query, 1);
}, 1000);
}
}
} else {
document.getElementById("sorry-message").textContent = "";
// Going back to General when cleared
gotoPref("paneGeneral");
+
+ // Hide some special second level headers in normal view
+ for (let element of document.querySelectorAll("caption.search-header")) {
+ element.hidden = true;
+ }
}
window.dispatchEvent(new CustomEvent("PreferencesSearchCompleted", { detail: query }));
},
/**
* Finding leaf nodes and checking their content for words to search,
* It is a recursive function
--- a/browser/components/preferences/in-content-new/main.xul
+++ b/browser/components/preferences/in-content-new/main.xul
@@ -747,16 +747,18 @@
class="subcategory"
hidden="true"
data-category="paneGeneral">
<label class="header-name" flex="1">&updateApplication.label;</label>
</hbox>
<!-- Update -->
<groupbox id="updateApp" data-category="paneGeneral" hidden="true">
+ <caption class="search-header" hidden="true"><label>&updateApplication.label;</label></caption>
+
<label>&updateApplicationDescription.label;</label>
<hbox align="start">
<vbox flex="1">
<description>
&updateApplication.version.pre;<label id="version"/>&updateApplication.version.post;
<label id="releasenotes" class="learnMore text-link" hidden="true">&releaseNotes.link;</label>
</description>
<description id="distribution" class="text-blurb" hidden="true"/>
@@ -899,16 +901,18 @@
class="subcategory"
hidden="true"
data-category="paneGeneral">
<label class="header-name" flex="1">&performance.label;</label>
</hbox>
<!-- Performance -->
<groupbox id="performanceGroup" data-category="paneGeneral" hidden="true">
+ <caption class="search-header" hidden="true"><label>&performance.label;</label></caption>
+
<hbox align="center">
<checkbox id="useRecommendedPerformanceSettings"
label="&useRecommendedPerformanceSettings2.label;"
accesskey="&useRecommendedPerformanceSettings2.accesskey;"
preference="browser.preferences.defaultPerformanceSettings.enabled"/>
<label id="performanceSettingsLearnMore" class="learnMore text-link">&performanceSettingsLearnMore.label;</label>
</hbox>
<description class="indent">&useRecommendedPerformanceSettings2.description;</description>
@@ -941,16 +945,18 @@
class="subcategory"
hidden="true"
data-category="paneGeneral">
<label class="header-name" flex="1">&browsing.label;</label>
</hbox>
<!-- Browsing -->
<groupbox id="browsingGroup" data-category="paneGeneral" hidden="true">
+ <caption class="search-header" hidden="true"><label>&browsing.label;</label></caption>
+
<checkbox id="useAutoScroll"
label="&useAutoScroll.label;"
accesskey="&useAutoScroll.accesskey;"
preference="general.autoScroll"/>
<checkbox id="useSmoothScrolling"
label="&useSmoothScrolling.label;"
accesskey="&useSmoothScrolling.accesskey;"
preference="general.smoothScroll"/>
@@ -976,16 +982,18 @@
class="subcategory"
hidden="true"
data-category="paneGeneral">
<label class="header-name" flex="1">&networkProxy.label;</label>
</hbox>
<!-- Network Proxy-->
<groupbox id="connectionGroup" data-category="paneGeneral" hidden="true">
+ <caption class="search-header" hidden="true"><label>&networkProxy.label;</label></caption>
+
<hbox align="center">
<description flex="1" control="connectionSettings">&connectionDesc.label;</description>
<!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
<hbox>
<button id="connectionSettings"
class="accessory-button"
icon="network"
label="&connectionSettings.label;"
--- a/browser/components/preferences/in-content-new/privacy.xul
+++ b/browser/components/preferences/in-content-new/privacy.xul
@@ -531,16 +531,18 @@
class="subcategory"
hidden="true"
data-category="panePrivacy">
<label class="header-name" flex="1">&permissions.label;</label>
</hbox>
<!-- Permissions -->
<groupbox id="permissionsGroup" data-category="panePrivacy" hidden="true">
+ <caption class="search-header" hidden="true"><label>&permissions.label;</label></caption>
+
<grid>
<columns>
<column flex="1"/>
<column/>
</columns>
<rows>
<row id="locationSettingsRow" align="center">
<description flex="1">
@@ -672,21 +674,22 @@
data-category="panePrivacy"
data-subcategory="reports">
<label class="header-name" flex="1">&dataCollection.label;</label>
</hbox>
<!-- Firefox Data Collection and Use -->
#ifdef MOZ_DATA_REPORTING
<groupbox id="dataCollectionGroup" data-category="panePrivacy" data-subcategory="reports" hidden="true">
- <description>
- &dataCollectionDesc.label;<label id="dataCollectionPrivacyNotice" class="learnMore text-link">&dataCollectionPrivacyNotice.label;</label>
- </description>
+ <caption class="search-header" hidden="true"><label>&dataCollection.label;</label></caption>
<vbox>
+ <description>
+ &dataCollectionDesc.label;<label id="dataCollectionPrivacyNotice" class="learnMore text-link">&dataCollectionPrivacyNotice.label;</label>
+ </description>
<description flex="1">
<checkbox id="submitHealthReportBox" label="&enableHealthReport1.label;"
accesskey="&enableHealthReport1.accesskey;"/>
<label id="FHRLearnMore"
class="learnMore text-link">&healthReportLearnMore.label;</label>
</description>
#ifndef MOZ_TELEMETRY_REPORTING
<description id="TelemetryDisabledDesc" class="indent" control="telemetryGroup">&healthReportingDisabled.label;</description>