Bug 553143 - Make it easier to view all add-ons (recommended and search results) [r=vingtetun]

This commit is contained in:
Mark Finkle 2010-03-19 00:22:47 -04:00
Родитель 22868d3696
Коммит c57f11d501
10 изменённых файлов: 68 добавлений и 1 удалений

Просмотреть файл

@ -225,4 +225,18 @@
</content> </content>
</binding> </binding>
<binding id="extension-search-showmore" extends="chrome://browser/content/bindings.xml#richlistitem">
<content orient="vertical">
<xul:hbox align="start">
<xul:image class="addon-showmore-image" xbl:inherits="src=image"/>
<xul:vbox flex="1">
<xul:label class="title" xbl:inherits="value=title"/>
<xul:description class="normal" xbl:inherits="xbl:text=description" flex="1"/>
</xul:vbox>
<xul:spacer flex="1"/>
<xul:button label="&addonShowPage.label;" oncommand="ExtensionsView.showMoreResults(document.getBindingParent(this));"/>
</xul:hbox>
</content>
</binding>
</bindings> </bindings>

Просмотреть файл

@ -130,6 +130,10 @@ richlistitem[typeName="message"] {
-moz-binding: url("chrome://browser/content/bindings/extensions.xml#extension-message"); -moz-binding: url("chrome://browser/content/bindings/extensions.xml#extension-message");
} }
richlistitem[typeName="showmore"] {
-moz-binding: url("chrome://browser/content/bindings/extensions.xml#extension-search-showmore");
}
richlistitem[typeName="download"] { richlistitem[typeName="download"] {
-moz-binding: url("chrome://browser/content/bindings/downloads.xml#download-downloading"); -moz-binding: url("chrome://browser/content/bindings/downloads.xml#download-downloading");
} }

Просмотреть файл

@ -598,8 +598,33 @@ var ExtensionsView = {
} }
} }
if (!aIsRecommended) let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
if (!aIsRecommended) {
if (aTotalResults > aAddons.length) {
let showmore = document.createElement("richlistitem");
showmore.setAttribute("typeName", "showmore");
showmore.setAttribute("title", strings.getFormattedString("addonsSearchMore.label", [aTotalResults]));
showmore.setAttribute("description", strings.getFormattedString("addonsSearchMore.description", [aAddons.length]));
let url = gPrefService.getCharPref("extensions.getAddons.search.browseURL");
url = url.replace(/%TERMS%/g, encodeURIComponent(this.searchBox.value));
url = formatter.formatURL(url);
showmore.setAttribute("url", url);
this._list.appendChild(showmore);
}
this.displaySectionMessage("repo", null, strings.getString("addonsSearchSuccess2.button"), true); this.displaySectionMessage("repo", null, strings.getString("addonsSearchSuccess2.button"), true);
} else {
let showmore = document.createElement("richlistitem");
showmore.setAttribute("typeName", "showmore");
showmore.setAttribute("title", strings.getString("addonsBrowseAll.label"));
showmore.setAttribute("description", strings.getString("addonsBrowseAll.description"));
let url = formatter.formatURLPref("extensions.getAddons.browseAddons");
showmore.setAttribute("url", url);
this._list.appendChild(showmore);
}
}, },
showPage: function ev_showPage(aItem) { showPage: function ev_showPage(aItem) {
@ -623,6 +648,12 @@ var ExtensionsView = {
this.getAddonsFromRepo(""); this.getAddonsFromRepo("");
}, },
showMoreResults: function ev_showMoreResults(aItem) {
let uri = aItem.getAttribute("url");
if (uri)
BrowserUI.newTab(uri);
},
observe: function ev_observe(aSubject, aTopic, aData) { observe: function ev_observe(aSubject, aTopic, aData) {
if (!document) if (!document)
return; return;

Просмотреть файл

@ -8,6 +8,10 @@ addonsSearchNone.button=Try Again
addonsSearchFail.label=%S couldn't retrieve add-ons addonsSearchFail.label=%S couldn't retrieve add-ons
addonsSearchFail.button=OK addonsSearchFail.button=OK
addonsSearchSuccess2.button=Clear Search addonsSearchSuccess2.button=Clear Search
addonsSearchMore.label=Show all %S results
addonsSearchMore.description=If these %S results aren't what you're looking for, try this
addonsBrowseAll.label=Browse all add-ons
addonsBrowseAll.description=addons.mozilla.org has many to explore
addonsSearchEngine.description=Integrated Search addonsSearchEngine.description=Integrated Search

Просмотреть файл

@ -403,6 +403,12 @@ toolbarbutton.page-button {
-moz-image-region: rect(90px 78px 108px 0px); -moz-image-region: rect(90px 78px 108px 0px);
} }
.addon-showmore-image {
width: 32px;
height: 32px;
list-style-image: url("chrome://browser/skin/images/addons-32.png");
}
richlistitem[isDisabled="true"] .title { richlistitem[isDisabled="true"] .title {
color: gray; color: gray;
} }

Двоичные данные
mobile/themes/hildon/images/addons-32.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.6 KiB

Просмотреть файл

@ -16,6 +16,7 @@ chrome.jar:
images/weave.png (images/weave.png) images/weave.png (images/weave.png)
images/aboutBackground.png (images/aboutBackground.png) images/aboutBackground.png (images/aboutBackground.png)
images/panel-shadow.png (images/panel-shadow.png) images/panel-shadow.png (images/panel-shadow.png)
images/addons-32.png (images/addons-32.png)
images/arrowleft-16.png (images/arrowleft-16.png) images/arrowleft-16.png (images/arrowleft-16.png)
images/arrowright-16.png (images/arrowright-16.png) images/arrowright-16.png (images/arrowright-16.png)
images/arrowup-16.png (images/arrowup-16.png) images/arrowup-16.png (images/arrowup-16.png)

Просмотреть файл

@ -185,6 +185,12 @@ toolbarbutton.page-button {
} }
} }
.addon-showmore-image {
width: 32px;
height: 32px;
list-style-image: url("chrome://browser/skin/images/addons-32.png");
}
richlistitem[isDisabled="true"] .title { richlistitem[isDisabled="true"] .title {
color: gray; color: gray;
} }

Двоичные данные
mobile/themes/wince/images/addons-32.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.6 KiB

Просмотреть файл

@ -16,6 +16,7 @@ chrome.jar:
images/weave.png (images/weave.png) images/weave.png (images/weave.png)
images/panel-shadow.png (images/panel-shadow.png) images/panel-shadow.png (images/panel-shadow.png)
images/aboutBackground.png (images/aboutBackground.png) images/aboutBackground.png (images/aboutBackground.png)
images/addons-32.png (images/addons-32.png)
images/arrowleft-16.png (images/arrowleft-16.png) images/arrowleft-16.png (images/arrowleft-16.png)
images/arrowright-16.png (images/arrowright-16.png) images/arrowright-16.png (images/arrowright-16.png)
images/arrowup-16.png (images/arrowup-16.png) images/arrowup-16.png (images/arrowup-16.png)