supplemental patch for Bug 262575 - 'Visit Homepage' and 'Get More Extensions/Themes' in Extension and Theme manager should respect tabbed browsing preferences. r=sspitzer

This commit is contained in:
rob_strong%exchangecode.com 2006-07-21 22:10:36 +00:00
Родитель b690efe251
Коммит c7ff30b577
5 изменённых файлов: 11 добавлений и 8 удалений

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

@ -106,7 +106,7 @@ function init()
var extensionHomepage = document.getElementById("extensionHomepage"); var extensionHomepage = document.getElementById("extensionHomepage");
if (homepage) { if (homepage) {
extensionHomepage.setAttribute("onclick", "loadHomepage(\"" + homepage + "\");"); extensionHomepage.setAttribute("homepageURL", homepage);
extensionHomepage.setAttribute("tooltiptext", homepage); extensionHomepage.setAttribute("tooltiptext", homepage);
} }
else else
@ -137,8 +137,8 @@ function init()
acceptButton.label = extensionsStrings.getString("aboutWindowCloseButton"); acceptButton.label = extensionsStrings.getString("aboutWindowCloseButton");
} }
function loadHomepage(aURI) { function loadHomepage(aEvent) {
window.close(); window.close();
window.opener.openURL(aURI); window.opener.openURL(aEvent.target.getAttribute("homepageURL"));
} }

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

@ -62,7 +62,8 @@
<label id="extensionCreatorLabel" class="sectionTitle">&creator.label;</label> <label id="extensionCreatorLabel" class="sectionTitle">&creator.label;</label>
<hbox id="creatorBox" class="indent"> <hbox id="creatorBox" class="indent">
<label id="extensionCreator" flex="1" crop="right"/> <label id="extensionCreator" flex="1" crop="right"/>
<label id="extensionHomepage" class="text-link" value="&homepage.label;"/> <label id="extensionHomepage" onclick="loadHomepage(event);"
class="text-link" value="&homepage.label;"/>
</hbox> </hbox>
<label id="extensionDevelopers" class="sectionTitle">&developers.label;</label> <label id="extensionDevelopers" class="sectionTitle">&developers.label;</label>

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

@ -340,7 +340,7 @@ function showView(aView) {
: PREF_EXTENSIONS_GETMOREEXTENSIONSURL, : PREF_EXTENSIONS_GETMOREEXTENSIONSURL,
Components.interfaces.nsIPrefLocalizedString).data; Components.interfaces.nsIPrefLocalizedString).data;
getMoreURL = getMoreURL.replace(/%APPID%/g, gAppID); getMoreURL = getMoreURL.replace(/%APPID%/g, gAppID);
getMore.setAttribute("onclick", "openURL(\"" + getMoreURL + "\");"); getMore.setAttribute("getMoreURL", getMoreURL);
if (getMore.hidden) if (getMore.hidden)
getMore.hidden = false; getMore.hidden = false;
} }

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

@ -190,7 +190,8 @@
</xul:hbox> </xul:hbox>
<xul:hbox flex="1" class="blocklistedBox attention" align="center"> <xul:hbox flex="1" class="blocklistedBox attention" align="center">
<xul:label value="&blocklisted.label;" crop="end"/> <xul:label value="&blocklisted.label;" crop="end"/>
<xul:label anonid="blocklistMoreInfo" class="text-link" value="&moreInfo.label;"/> <xul:label anonid="blocklistMoreInfo" class="text-link" value="&moreInfo.label;"
onclick="openURL(this.getAttribute('moreInfoURL'));"/>
</xul:hbox> </xul:hbox>
</xul:vbox> </xul:vbox>
<xul:hbox anonid="selectedButtons" flex="1" class="selectedButtons"> <xul:hbox anonid="selectedButtons" flex="1" class="selectedButtons">
@ -232,8 +233,8 @@
var blocklistMoreInfo = document.getAnonymousElementByAttribute(this, "anonid", "blocklistMoreInfo"); var blocklistMoreInfo = document.getAnonymousElementByAttribute(this, "anonid", "blocklistMoreInfo");
var prefs = Components.classes["@mozilla.org/preferences-service;1"] var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch); .getService(Components.interfaces.nsIPrefBranch);
blocklistMoreInfo.setAttribute("onclick", "openURL(\"" + var url = prefs.getCharPref("extensions.blocklist.detailsURL");
prefs.getCharPref("extensions.blocklist.detailsURL") + "\");"); blocklistMoreInfo.setAttribute("moreInfoURL", url);
} catch(e) { } catch(e) {
blocklistMoreInfo.hidden = true; blocklistMoreInfo.hidden = true;
} }

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

@ -219,6 +219,7 @@
tooltiptext="&cmd.continue.tooltip;" tooltiptext="&cmd.continue.tooltip;"
command="cmd_restartApp"/> command="cmd_restartApp"/>
<label id="getMore" class="text-link" <label id="getMore" class="text-link"
onclick="openURL(this.getAttribute('getMoreURL'));"
valuethemes="&getThemes.label;" valuethemes="&getThemes.label;"
valueextensions="&getExtensions.label;" valueextensions="&getExtensions.label;"
tooltiptextthemes="&getThemes.tooltip;" tooltiptextthemes="&getThemes.tooltip;"