Bug 1109854 - Fix the string displayed above the one-off search buttons whwhen the search field is empty, r=florian.

This commit is contained in:
Abdelrhman Ahmed 2015-01-11 20:51:11 +01:00
parent bad6d827b8
commit 7899af9e6e
2 changed files with 24 additions and 6 deletions

View File

@ -988,13 +988,18 @@
</xul:treecols>
<xul:treechildren class="autocomplete-treebody"/>
</xul:tree>
<xul:hbox anonid="search-panel-one-offs-header"
<xul:deck anonid="search-panel-one-offs-header"
selectedIndex="0"
class="search-panel-header search-panel-current-input"
xbl:inherits="hidden=showonlysettings">
<xul:label anonid="searchbar-oneoffheader-before" value="&searchFor.label;"/>
<xul:label anonid="searchbar-oneoffheader-searchtext" flex="1" crop="end" class="search-panel-input-value"/>
<xul:label anonid="searchbar-oneoffheader-after" flex="10000" value="&searchWith.label;"/>
</xul:hbox>
<xul:label anonid="searchbar-oneoffheader-search" value="&searchWithHeader.label;"/>
<xul:hbox anonid="search-panel-searchforwith"
class="search-panel-current-input">
<xul:label anonid="searchbar-oneoffheader-before" value="&searchFor.label;"/>
<xul:label anonid="searchbar-oneoffheader-searchtext" flex="1" crop="end" class="search-panel-input-value"/>
<xul:label anonid="searchbar-oneoffheader-after" flex="10000" value="&searchWith.label;"/>
</xul:hbox>
</xul:deck>
<xul:description anonid="search-panel-one-offs"
class="search-panel-one-offs"
xbl:inherits="hidden=showonlysettings"/>
@ -1059,12 +1064,20 @@
let headerSearchText =
document.getAnonymousElementByAttribute(this, "anonid",
"searchbar-oneoffheader-searchtext");
let headerPanel =
document.getAnonymousElementByAttribute(this, "anonid",
"search-panel-one-offs-header");
let textbox = searchbar.textbox;
let self = this;
let inputHandler = function() {
headerSearchText.setAttribute("value", textbox.value);
if (textbox.value)
if (textbox.value) {
self.removeAttribute("showonlysettings");
headerPanel.selectedIndex = 1;
}
else {
headerPanel.selectedIndex = 0;
}
};
textbox.addEventListener("input", inputHandler);
this.addEventListener("popuphiding", function hiding() {

View File

@ -422,6 +422,11 @@ These should match what Safari and other Apple applications use on OS X Lion. --
search providers: "Search for <used typed keywords> with:" -->
<!ENTITY searchFor.label "Search for ">
<!ENTITY searchWith.label " with:">
<!-- LOCALIZATION NOTE (searchWithHeader.label):
The wording of this string should be as close as possible to
searchFor.label and searchWith.label. This string will be used instead of
them when the user has not typed any keyword. -->
<!ENTITY searchWithHeader.label "Search with:">
<!ENTITY changeSearchSettings.button "Change Search Settings">
<!ENTITY tabView.commandkey "e">