mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 391861 - Indicate what the text area in the DM is for (searching). Patch by Michael Ventnor <ventnor.bugzilla@yahoo.com.au>. r=mano
This commit is contained in:
parent
368c3fa564
commit
6b2cc7c702
@ -46,3 +46,5 @@
|
||||
<!ENTITY activeDownloads.label "Active">
|
||||
<!ENTITY completedDownloads.label "Completed">
|
||||
<!ENTITY searchResults.label "Search Results">
|
||||
|
||||
<!ENTITY searchBox.label "Search...">
|
||||
|
@ -765,6 +765,22 @@ function performSearch() {
|
||||
buildDownloadListWithSearch(document.getElementById("searchbox").value);
|
||||
}
|
||||
|
||||
function onSearchboxBlur() {
|
||||
var searchbox = document.getElementById("searchbox");
|
||||
if (searchbox.value == "") {
|
||||
searchbox.setAttribute("empty", "true");
|
||||
searchbox.value = searchbox.getAttribute("defaultValue");
|
||||
}
|
||||
}
|
||||
|
||||
function onSearchboxFocus() {
|
||||
var searchbox = document.getElementById("searchbox");
|
||||
if (searchbox.hasAttribute("empty")) {
|
||||
searchbox.value = "";
|
||||
searchbox.removeAttribute("empty");
|
||||
}
|
||||
}
|
||||
|
||||
// we should be using real URLs all the time, but until
|
||||
// bug 239948 is fully fixed, this will do...
|
||||
function getLocalFileFromNativePathOrUrl(aPathOrUrl)
|
||||
|
@ -170,7 +170,9 @@
|
||||
|
||||
<hbox id="search">
|
||||
<textbox type="timed" timeout="500" id="searchbox"
|
||||
oncommand="performSearch();"/>
|
||||
oncommand="performSearch();" empty="true"
|
||||
value="&searchBox.label;" defaultValue="&searchBox.label;"
|
||||
onblur="onSearchboxBlur();" onfocus="onSearchboxFocus();"/>
|
||||
<spacer flex="1"/>
|
||||
<!-- TODO get advanced search working (Bug 390491)
|
||||
<button label="Advanced Search"/>
|
||||
|
@ -89,3 +89,7 @@ richlistitem[type="download"] button,
|
||||
-moz-margin-end: 15px;
|
||||
-moz-margin-start: 5px;
|
||||
}
|
||||
|
||||
#searchbox[empty] {
|
||||
color: GrayText;
|
||||
}
|
||||
|
@ -88,3 +88,7 @@ richlistitem[type="download"] .name {
|
||||
-moz-margin-end: 15px;
|
||||
-moz-margin-start: 5px;
|
||||
}
|
||||
|
||||
#searchbox[empty] {
|
||||
color: GrayText;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user