Bug 584348 - Update add-on button triggers no action on click/tap event [r=mbrubeck]

This commit is contained in:
Mark Finkle 2010-09-01 15:13:42 -04:00
Родитель 7e27b3ff97
Коммит b3bbef6ddd
2 изменённых файлов: 17 добавлений и 8 удалений

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

@ -175,13 +175,13 @@ pref("extensions.hideUpdateButton", false);
pref("extensions.update.url", "https://versioncheck.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%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%");
/* preferences for the Get Add-ons pane */
pref("extensions.getAddons.showPane", true);
pref("extensions.getAddons.browseAddons", "https://addons.mozilla.org/%LOCALE%/mobile/");
pref("extensions.getAddons.cache.enabled", true);
pref("extensions.getAddons.maxResults", 5);
pref("extensions.getAddons.recommended.browseURL", "https://addons.mozilla.org/%LOCALE%/mobile/recommended/");
pref("extensions.getAddons.recommended.url", "https://services.addons.mozilla.org/%LOCALE%/mobile/api/%API_VERSION%/list/featured/all/10/%OS%/%VERSION%");
pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/mobile/search?q=%TERMS%");
pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/mobile/api/%API_VERSION%/search/%TERMS%/all/10/%OS%/%VERSION%");
pref("extensions.getAddons.browseAddons", "https://addons.mozilla.org/%LOCALE%/mobile/");
/* blocklist preferences */
pref("extensions.blocklist.enabled", true);

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

@ -280,13 +280,17 @@ var ExtensionsView = {
let self = this;
AddonManager.getAddonsByTypes(["extension", "theme", "locale"], function(items) {
let anyUpdateable = false;
for (let i = 0; i < items.length; i++) {
let addon = items[i];
let appManaged = (addon.scope == AddonManager.SCOPE_APPLICATION);
let opType = self._getOpTypeForOperations(addon.pendingOperations);
let updateable = (addon.permissions & AddonManager.PERM_CAN_UPDATE) > 0;
let updateable = (addon.permissions & AddonManager.PERM_CAN_UPGRADE) > 0;
let uninstallable = (addon.permissions & AddonManager.PERM_CAN_UNINSTALL) > 0;
if (updateable)
anyUpdateable = true;
let listitem = self._createItem(addon, "local");
listitem.setAttribute("isDisabled", !addon.isActive);
listitem.setAttribute("appDisabled", addon.appDisabled);
@ -330,10 +334,11 @@ var ExtensionsView = {
self._list.insertBefore(listitem, self._repoItem);
}
if (engines.length + items.length == 0) {
if (engines.length + items.length == 0)
self.displaySectionMessage("local", strings.getString("addonsLocalNone.label"), null, true);
if (!anyUpdateable)
document.getElementById("addons-update-all").disabled = true;
}
});
},
@ -599,13 +604,15 @@ var ExtensionsView = {
return;
let json = aSubject.QueryInterface(Ci.nsISupportsString).data;
let addon = JSON.parse(json);
let update = JSON.parse(json);
let strings = Elements.browserBundle;
let element = this.getElementForAddon(addon.id);
let element = this.getElementForAddon(update.id);
if (!element)
return;
let addon = element.addon;
switch (aTopic) {
case "addon-update-started":
element.setAttribute("updateStatus", strings.getString("addonUpdate.checking"));
@ -615,11 +622,13 @@ var ExtensionsView = {
let statusMsg = null;
switch (aData) {
case "update":
statusMsg = strings.getFormattedString("addonUpdate.updating", [addon.version]);
statusMsg = strings.getFormattedString("addonUpdate.updating", [update.version]);
updateable = true;
break;
case "compatibility":
statusMsg = strings.getString("addonUpdate.compatibility");
if (addon.pendingOperations & AddonManager.PENDING_INSTALL || addon.pendingOperations & AddonManager.PENDING_UPGRADE)
updateable = true;
break;
case "error":
statusMsg = strings.getString("addonUpdate.error");