зеркало из https://github.com/mozilla/pjs.git
Bug 553143 - Make it easier to view all add-ons (recommended and search results) [r=vingtetun]
This commit is contained in:
Родитель
22868d3696
Коммит
c57f11d501
|
@ -225,4 +225,18 @@
|
|||
</content>
|
||||
</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>
|
||||
|
|
|
@ -130,6 +130,10 @@ richlistitem[typeName="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"] {
|
||||
-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);
|
||||
} 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) {
|
||||
|
@ -623,6 +648,12 @@ var ExtensionsView = {
|
|||
this.getAddonsFromRepo("");
|
||||
},
|
||||
|
||||
showMoreResults: function ev_showMoreResults(aItem) {
|
||||
let uri = aItem.getAttribute("url");
|
||||
if (uri)
|
||||
BrowserUI.newTab(uri);
|
||||
},
|
||||
|
||||
observe: function ev_observe(aSubject, aTopic, aData) {
|
||||
if (!document)
|
||||
return;
|
||||
|
|
|
@ -8,6 +8,10 @@ addonsSearchNone.button=Try Again
|
|||
addonsSearchFail.label=%S couldn't retrieve add-ons
|
||||
addonsSearchFail.button=OK
|
||||
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
|
||||
|
||||
|
|
|
@ -403,6 +403,12 @@ toolbarbutton.page-button {
|
|||
-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 {
|
||||
color: gray;
|
||||
}
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 2.6 KiB |
|
@ -16,6 +16,7 @@ chrome.jar:
|
|||
images/weave.png (images/weave.png)
|
||||
images/aboutBackground.png (images/aboutBackground.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/arrowright-16.png (images/arrowright-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 {
|
||||
color: gray;
|
||||
}
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 2.6 KiB |
|
@ -16,6 +16,7 @@ chrome.jar:
|
|||
images/weave.png (images/weave.png)
|
||||
images/panel-shadow.png (images/panel-shadow.png)
|
||||
images/aboutBackground.png (images/aboutBackground.png)
|
||||
images/addons-32.png (images/addons-32.png)
|
||||
images/arrowleft-16.png (images/arrowleft-16.png)
|
||||
images/arrowright-16.png (images/arrowright-16.png)
|
||||
images/arrowup-16.png (images/arrowup-16.png)
|
||||
|
|
Загрузка…
Ссылка в новой задаче