Bug 392084 - Add a get plugins link to the add-ons mgr. r=dtownsend

git-svn-id: svn://10.0.0.236/trunk@233815 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rob_strong%exchangecode.com 2007-09-04 00:03:41 +00:00
parent a9afe32ba2
commit e676293e55
5 changed files with 30 additions and 26 deletions

View File

@ -150,6 +150,7 @@ pref("extensions.update.interval", 86400); // Check for updates to Extensions a
// Non-symmetric (not shared by extensions) extension-specific [update] preferences
pref("extensions.getMoreExtensionsURL", "https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/%VERSION%/extensions/");
pref("extensions.getMoreThemesURL", "https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/%VERSION%/themes/");
pref("extensions.getMorePluginsURL", "https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/%VERSION%/plugins/");
pref("extensions.dss.enabled", false); // Dynamic Skin Switching
pref("extensions.dss.switchPending", false); // Non-dynamic switch pending after next
// restart.

View File

@ -109,9 +109,8 @@
<!ENTITY toBeUpdated.label "This add-on will be updated when &brandShortName; is restarted.">
<!ENTITY getExtensions.label "Get Extensions">
<!ENTITY getExtensions.tooltip "Get Extensions from addons.mozilla.org">
<!ENTITY getThemes.label "Get Themes">
<!ENTITY getThemes.tooltip "Get Themes from addons.mozilla.org">
<!ENTITY getPlugins.label "Get Plugins">
<!ENTITY previewNoThemeSelected.label "No Theme Selected">
<!ENTITY previewNoPreviewImage.label "This Theme does not have a Preview Image">
<!ENTITY moreInfo.label "More Information">

View File

@ -42,6 +42,7 @@ disableQueryMessage=Do you want to disable %S?
extensions.update.url=https://addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%
extensions.getMoreExtensionsURL=https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/%VERSION%/extensions/
extensions.getMoreThemesURL=https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/%VERSION%/themes/
extensions.getMorePluginsURL=https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/%VERSION%/plugins/
themesTitle=Themes
extensionsTitle=Extensions

View File

@ -70,6 +70,7 @@ const PREF_EM_CHECK_COMPATIBILITY = "extensions.checkCompatibility";
const PREF_EM_CHECK_UPDATE_SECURITY = "extensions.checkUpdateSecurity";
const PREF_EXTENSIONS_GETMORETHEMESURL = "extensions.getMoreThemesURL";
const PREF_EXTENSIONS_GETMOREEXTENSIONSURL = "extensions.getMoreExtensionsURL";
const PREF_EXTENSIONS_GETMOREPLUGINSURL = "extensions.getMorePluginsURL";
const PREF_EXTENSIONS_DSS_ENABLED = "extensions.dss.enabled";
const PREF_EXTENSIONS_DSS_SWITCHPENDING = "extensions.dss.switchPending";
const PREF_EXTENSIONS_HIDE_INSTALL_BTN = "extensions.hideInstallButton";
@ -275,6 +276,7 @@ function showView(aView) {
["updateURL", "?updateURL"],
["version", "?version"] ];
var prefURL;
var showInstallFile = true;
try {
showInstallFile = !gPref.getBoolPref(PREF_EXTENSIONS_HIDE_INSTALL_BTN);
@ -287,15 +289,18 @@ function showView(aView) {
var showContinue = false;
switch (aView) {
case "extensions":
prefURL = PREF_EXTENSIONS_GETMOREEXTENSIONSURL;
var types = [ [ ["type", nsIUpdateItem.TYPE_EXTENSION, "Integer"] ] ];
break;
case "themes":
prefURL = PREF_EXTENSIONS_GETMORETHEMESURL;
types = [ [ ["type", nsIUpdateItem.TYPE_THEME, "Integer"] ] ];
break;
case "locales":
types = [ [ ["type", nsIUpdateItem.TYPE_LOCALE, "Integer"] ] ];
break;
case "plugins":
prefURL = PREF_EXTENSIONS_GETMOREPLUGINSURL;
types = [ [ ["plugin", "true", null] ] ];
break;
case "updates":
@ -367,33 +372,30 @@ function showView(aView) {
break;
}
var showGetMore = false;
var getMore = document.getElementById("getMore");
if (prefURL) {
try {
getMore.setAttribute("value", getMore.getAttribute("value" + aView));
var getMoreURL = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter)
.formatURLPref(prefURL);
getMore.setAttribute("getMoreURL", getMoreURL);
showGetMore = getMoreURL == "about:blank" ? false : true;
}
catch (e) { }
}
getMore.hidden = !showGetMore;
var isThemes = aView == "themes";
var getMore = document.getElementById("getMore");
if (aView == "themes" || aView == "extensions") {
try {
var el = document.getElementById("installFileButton");
el.setAttribute("tooltiptext", el.getAttribute(isThemes ? "tooltiptextthemes" :
"tooltiptextaddons"));
el = document.getElementById("checkUpdatesAllButton");
el.setAttribute("tooltiptext", el.getAttribute(isThemes ? "tooltiptextthemes" :
"tooltiptextaddons"));
getMore.setAttribute("value", getMore.getAttribute(isThemes ? "valuethemes" :
"valueextensions"));
var getMorePref = isThemes ? PREF_EXTENSIONS_GETMORETHEMESURL : PREF_EXTENSIONS_GETMOREEXTENSIONSURL;
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
var getMoreURL = formatter.formatURLPref(getMorePref);
getMore.setAttribute("getMoreURL", getMoreURL);
if (getMore.hidden)
getMore.hidden = false;
}
catch (e) {
getMore.hidden = true;
}
}
else if (!getMore.hidden) {
getMore.hidden = true;
var el = document.getElementById("installFileButton");
el.setAttribute("tooltiptext", el.getAttribute(isThemes ? "tooltiptextthemes" :
"tooltiptextaddons"));
el = document.getElementById("checkUpdatesAllButton");
el.setAttribute("tooltiptext", el.getAttribute(isThemes ? "tooltiptextthemes" :
"tooltiptextaddons"));
}
document.getElementById("installFileButton").hidden = !showInstallFile;

View File

@ -218,6 +218,7 @@
<label id="getMore" class="text-link"
onclick="openURL(this.getAttribute('getMoreURL'));"
valuethemes="&getThemes.label;"
valueplugins="&getPlugins.label;"
valueextensions="&getExtensions.label;"/>
<spacer flex="1"/>
<button id="restartAppButton" label="&cmd.restartApp2.label;"