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:
sdwilsh@shawnwilsher.com 2007-08-14 16:18:15 -07:00
parent 368c3fa564
commit 6b2cc7c702
5 changed files with 29 additions and 1 deletions

View File

@ -46,3 +46,5 @@
<!ENTITY activeDownloads.label "Active">
<!ENTITY completedDownloads.label "Completed">
<!ENTITY searchResults.label "Search Results">
<!ENTITY searchBox.label "Search...">

View File

@ -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)

View File

@ -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"/>

View File

@ -89,3 +89,7 @@ richlistitem[type="download"] button,
-moz-margin-end: 15px;
-moz-margin-start: 5px;
}
#searchbox[empty] {
color: GrayText;
}

View File

@ -88,3 +88,7 @@ richlistitem[type="download"] .name {
-moz-margin-end: 15px;
-moz-margin-start: 5px;
}
#searchbox[empty] {
color: GrayText;
}