Bug 494200: Simplify header of Get-addons section, r=mfinkle

This commit is contained in:
Vivien Nicolas 2009-06-23 12:23:48 -04:00
parent 9ff596ded3
commit 15002e4591
4 changed files with 20 additions and 35 deletions

View File

@ -142,6 +142,10 @@ richlistitem[selected="true"].section-header {
background-color: lightgray;
}
richlistitem[typeName="message"] {
border-bottom: 0px;
}
richlistitem[typeName="download"] {
-moz-binding: url("chrome://browser/content/bindings/downloads.xml#download-downloading");
}

View File

@ -173,7 +173,7 @@
<popupset id="mainPopupSet">
</popupset>
<!-- stupid stack needs to be in a box. not sure why -->
<box>
<stack id="browser-container" flex="1">
@ -314,18 +314,10 @@
<richlistitem id="addons-local" class="section-header" align="center">
<label value="&addonsLocal.label;" flex="1"/>
</richlistitem>
<richlistitem id="addons-repo" class="section-header" orient="vertical" pack="center">
<hbox>
<label value="&addonsRepo.label;" flex="1"/>
<radiogroup id="addons-repo-mode" oncommand="ExtensionsView.toggleMode();">
<radio label="&addonsRecommended.label;" value="recommended" selected="true"/>
<radio label="&addonsSearch.label;" value="search"/>
</radiogroup>
</hbox>
<hbox id="addons-search-box" pack="end" collapsed="true">
<textbox id="addons-search-text" emptytext="&addonsSearch.emptytext;" type="search" searchbutton="false"
oncommand="ExtensionsView.getAddonsFromRepo(this.value);"/>
</hbox>
<richlistitem id="addons-repo" class="section-header" orient="horizontal" align="center">
<label value="&addonsRepo.label;" flex="1"/>
<textbox id="addons-search-text" emptytext="&addonsSearch.emptytext;" type="search" searchbutton="false"
oncommand="ExtensionsView.getAddonsFromRepo(this.value);"/>
</richlistitem>
</richlistbox>
</notificationbox>

View File

@ -385,18 +385,6 @@ var ExtensionsView = {
return (uri && (scheme == "http" || scheme == "https" || scheme == "ftp"));
},
toggleMode: function ev_toggleMode() {
let mode = document.getElementById("addons-repo-mode");
if (mode.value == "search") {
document.getElementById("addons-search-box").collapsed = false;
document.getElementById("addons-search-text").value = "";
}
else {
document.getElementById("addons-search-box").collapsed = true;
this.getAddonsFromRepo("");
}
},
displaySectionMessage: function ev_displaySectionMessage(aSection, aMessage, aButtonLabel, aHideThrobber) {
let item = document.createElement("richlistitem");
item.setAttribute("typeName", "message");
@ -407,11 +395,10 @@ var ExtensionsView = {
item.setAttribute("hidebutton", "true");
item.setAttribute("hidethrobber", aHideThrobber);
let section = this._localItem;
if (aSection == "repo")
section = this._repoItem;
this._list.insertBefore(item, section.nextSibling);
this._list.appendChild(item);
else
this._list.insertBefore(item, this._repoItem)
},
getAddonsFromRepo: function ev_getAddonsFromRepo(aTerms) {
@ -441,10 +428,9 @@ var ExtensionsView = {
displaySearchResults: function ev_displaySearchResults(aAddons, aTotalResults, aIsRecommended) {
this.clearSection("repo");
let strings = document.getElementById("bundle_browser");
if (aAddons.length == 0) {
let strings = document.getElementById("bundle_browser");
this.displaySectionMessage("repo", strings.getString("addonsSearchNone.label"),
strings.getString("addonsSearchNone.button"), true);
this.displaySectionMessage("repo", strings.getString("addonsSearchNone.label"), null, true);
return;
}
@ -472,6 +458,9 @@ var ExtensionsView = {
listitem.setAttribute("xpiHash", addon.xpiHash);
this._list.appendChild(listitem);
}
if (!aIsRecommended)
this.displaySectionMessage("repo", null, strings.getString("addonsSearchSuccess.button"), true);
},
showPage: function ev_showPage(aItem) {
@ -483,8 +472,8 @@ var ExtensionsView = {
},
resetSearch: function ev_resetSearch() {
document.getElementById("addons-repo-mode").value = "recommended";
this.toggleMode();
document.getElementById("addons-search-text").value = "";
this.getAddonsFromRepo("");
}
};

View File

@ -9,9 +9,9 @@ addonsLocalNone.label=No add-ons installed
addonsSearchStart.label=Searching for add-ons…
addonsSearchStart.button=Cancel
addonsSearchNone.label=No matches found
addonsSearchNone.button=OK
addonsSearchFail.label=%S couldn't retrieve add-ons
addonsSearchFail.button=OK
addonsSearchSuccess.button=Clear search
# Download Manager
# LOCALIZATION NOTE (Status): — is the "em dash" (long dash)