Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <!-- ***** BEGIN LICENSE BLOCK *****
- - Version: MPL 1.1/GPL 2.0/LGPL 2.1
- -
- - The contents of this file are subject to the Mozilla Public License Version
- - 1.1 (the "License"); you may not use this file except in compliance with
- - the License. You may obtain a copy of the License at
- - http://www.mozilla.org/MPL/
- -
- - Software distributed under the License is distributed on an "AS IS" basis,
- - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- - for the specific language governing rights and limitations under the
- - License.
- -
- - The Original Code is the Extension Manager UI.
- -
- - The Initial Developer of the Original Code is
- - the Mozilla Foundation.
- - Portions created by the Initial Developer are Copyright (C) 2010
- - the Initial Developer. All Rights Reserved.
- -
- - Contributor(s):
- - Blair McBride <bmcbride@mozilla.com>
- - David Dahl <ddahl@mozilla.com>
- -
- - Alternatively, the contents of this file may be used under the terms of
- - either the GNU General Public License Version 2 or later (the "GPL"), or
- - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- - in which case the provisions of the GPL or the LGPL are applicable instead
- - of those above. If you wish to allow use of your version of this file only
- - under the terms of either the GPL or the LGPL, and not to allow others to
- - use your version of this file under the terms of the MPL, indicate your
- - decision by deleting the provisions above and replace them with the notice
- - and other provisions required by the LGPL or the GPL. If you do not delete
- - the provisions above, a recipient may use your version of this file under
- - the terms of any one of the MPL, the GPL or the LGPL.
- -
- - ***** END LICENSE BLOCK ***** -->
- <!DOCTYPE page [
- <!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd">
- %extensionsDTD;
- ]>
- <bindings id="AMD_addonBindings_override"
- xmlns="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:xbl="http://www.mozilla.org/xbl">
- <binding id="addon-generic-override"
- extends="chrome://mozapps/content/extensions/extensions.xml#addon-generic">
- <content>
- <xul:hbox class="content-container" align="center">
- <xul:vbox class="icon-container">
- <xul:image anonid="icon" class="icon"/>
- </xul:vbox>
- <xul:vbox class="content-inner-container" flex="1">
- <xul:hbox class="basicinfo-container">
- <xul:hbox class="name-container">
- <xul:label anonid="name" class="name" crop="end" flex="1"
- xbl:inherits="value=name,tooltiptext=name"/>
- <xul:label anonid="version" class="version"/>
- <xul:label class="disabled-postfix" value="&addon.disabled.postfix;"/>
- <xul:label class="update-postfix" value="&addon.update.postfix;"/>
- <xul:spacer flex="5000"/> <!-- Necessary to make the name crop -->
- </xul:hbox>
- <xul:label anonid="date-updated" class="date-updated"
- unknown="&addon.unknownDate;"/>
- </xul:hbox>
- <xul:hbox class="advancedinfo-container" flex="1">
- <xul:vbox class="description-outer-container" flex="1">
- <xul:hbox class="description-container">
- <xul:label anonid="description" class="description" crop="end" flex="1"/>
- <xul:button anonid="details-btn" class="details button-link"
- label="&addon.details.label;"
- tooltiptext="&addon.details.tooltip;"
- oncommand="document.getBindingParent(this).showInDetailView();"/>
- <xul:spacer flex="5000"/> <!-- Necessary to make the description crop -->
- </xul:hbox>
- <xul:vbox anonid="relnotes-container" class="relnotes-container">
- <xul:label class="relnotes-header" value="&addon.releaseNotes.label;"/>
- <xul:label anonid="relnotes-loading" value="&addon.loadingReleaseNotes.label;"/>
- <xul:label anonid="relnotes-error" hidden="true"
- value="&addon.errorLoadingReleaseNotes.label;"/>
- <xul:vbox anonid="relnotes" class="relnotes"/>
- </xul:vbox>
- <xul:hbox class="relnotes-toggle-container">
- <xul:button anonid="relnotes-toggle-btn" class="relnotes-toggle"
- hidden="true" label="&cmd.showReleaseNotes.label;"
- tooltiptext="&cmd.showReleaseNotes.tooltip;"
- showlabel="&cmd.showReleaseNotes.label;"
- showtooltip="&cmd.showReleaseNotes.tooltip;"
- hidelabel="&cmd.hideReleaseNotes.label;"
- hidetooltip="&cmd.hideReleaseNotes.tooltip;"
- oncommand="document.getBindingParent(this).toggleReleaseNotes();"/>
- </xul:hbox>
- </xul:vbox>
- </xul:hbox>
- </xul:vbox>
- <!-- The "wrong" indentation here is to reduce the size of the diff against
- the original extensions.xml, to make the file easier to update. -->
- <xul:vbox class="status-control-wrapper">
- <xul:hbox class="status-container">
- <xul:hbox anonid="checking-update" hidden="true">
- <xul:image class="spinner"/>
- <xul:label value="&addon.checkingForUpdates.label;"/>
- </xul:hbox>
- <xul:vbox anonid="update-available" class="update-available"
- hidden="true">
- <xul:checkbox anonid="include-update" class="include-update"
- label="&addon.includeUpdate.label;" checked="true"
- oncommand="document.getBindingParent(this).onIncludeUpdateChanged();"/>
- <xul:hbox class="update-info-container">
- <xul:label class="update-available-notice"
- value="&addon.updateAvailable.label;"/>
- <xul:button anonid="update-btn" class="addon-control update"
- label="&addon.updateNow.label;"
- tooltiptext="&addon.updateNow.tooltip;"
- oncommand="document.getBindingParent(this).upgrade();"/>
- </xul:hbox>
- </xul:vbox>
- <xul:hbox anonid="install-status" class="install-status"
- hidden="true"/>
- </xul:hbox>
- <xul:hbox anonid="control-container" class="control-container">
- <xul:button anonid="preferences-btn"
- class="addon-control preferences"
- label="&cmd.showPreferencesWin.label;"
- tooltiptext="&cmd.showPreferencesWin.tooltip;"
- oncommand="document.getBindingParent(this).showPreferences();"/>
- <xul:button anonid="enable-btn" class="addon-control enable"
- label="&cmd.enableAddon.label;"
- oncommand="document.getBindingParent(this).userDisabled = false;"/>
- <xul:button anonid="disable-btn" class="addon-control disable"
- label="&cmd.disableAddon.label;"
- oncommand="document.getBindingParent(this).userDisabled = true;"/>
- <xul:button anonid="remove-btn" class="addon-control remove"
- label="&cmd.uninstallAddon.label;"
- oncommand="document.getBindingParent(this).uninstall();"/>
- </xul:hbox>
- </xul:vbox>
- </xul:hbox>
- <xul:hbox anonid="warning-container"
- class="warning">
- <xul:image class="warning-icon"/>
- <xul:label anonid="warning" flex="1"/>
- <xul:label anonid="warning-link" class="text-link"/>
- <xul:button anonid="warning-btn" class="button-link"/>
- <xul:spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </xul:hbox>
- <xul:hbox anonid="error-container"
- class="error">
- <xul:image class="error-icon"/>
- <xul:label anonid="error" flex="1"/>
- <xul:label anonid="error-link" class="text-link"/>
- <xul:spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </xul:hbox>
- <xul:hbox anonid="pending-container"
- class="pending">
- <xul:image class="pending-icon"/>
- <xul:label anonid="pending" flex="1"/>
- <xul:button anonid="restart-btn" class="button-link"
- label="&addon.restartNow.label;"
- oncommand="document.getBindingParent(this).restart();"/>
- <xul:button anonid="undo-btn" class="button-link"
- label="&addon.undoAction.label;"
- tooltipText="&addon.undoAction.tooltip;"
- oncommand="document.getBindingParent(this).undo();"/>
- <xul:spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </xul:hbox>
- </content>
- <implementation>
- <method name="_updateState">
- <body><![CDATA[
- if (this.parentNode.selectedItem == this)
- gViewController.updateCommands();
- this.removeAttribute("AMD_notification");
- var pending = this.mAddon.pendingOperations;
- if (pending != AddonManager.PENDING_NONE) {
- this.removeAttribute("notification");
- var pending = null;
- ["enable", "disable", "install", "uninstall", "upgrade"].forEach(function(aOp) {
- if (this.isPending(aOp))
- pending = aOp;
- }, this);
- this.setAttribute("pending", pending);
- this._pending.textContent = gStrings.ext.formatStringFromName(
- "notification." + pending,
- [this.mAddon.name, gStrings.brandShortName], 2
- );
- } else {
- this.removeAttribute("pending");
- var isUpgrade = this.hasAttribute("upgrade");
- var install = this._installStatus.mInstall;
- if (install && install.state == AddonManager.STATE_DOWNLOAD_FAILED) {
- this.setAttribute("notification", "warning");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.downloadError",
- [this.mAddon.name], 1
- );
- this._warningBtn.label = gStrings.ext.GetStringFromName("notification.downloadError.retry");
- this._warningBtn.tooltipText = gStrings.ext.GetStringFromName("notification.downloadError.retry.tooltip");
- this._warningBtn.setAttribute("oncommand", "document.getBindingParent(this).retryInstall();");
- this._warningBtn.hidden = false;
- this._warningLink.hidden = true;
- } else if (install && install.state == AddonManager.STATE_INSTALL_FAILED) {
- this.setAttribute("notification", "warning");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.installError",
- [this.mAddon.name], 1
- );
- this._warningBtn.label = gStrings.ext.GetStringFromName("notification.installError.retry");
- this._warningBtn.tooltipText = gStrings.ext.GetStringFromName("notification.downloadError.retry.tooltip");
- this._warningBtn.setAttribute("oncommand", "document.getBindingParent(this).retryInstall();");
- this._warningBtn.hidden = false;
- this._warningLink.hidden = true;
- } else if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED) {
- this.setAttribute("notification", "error");
- this._error.textContent = gStrings.ext.formatStringFromName(
- "notification.blocked",
- [this.mAddon.name], 1
- );
- this._errorLink.value = gStrings.ext.GetStringFromName("notification.blocked.link");
- /* Classicish Add-on Manager: Bug 406026 changed the URL used for the link. Rather
- than ship two variants of cam_binding.xml just for this change, I'm instead going
- to fix it in JavaScript. The caveat is that I don't have a blocklisted extension
- handy, so I haven't been able to test this code. */
- if (this.mAddon.blocklistURL)
- this._errorLink.href = this.mAddon.blocklistURL;
- else
- this._errorLink.href = Services.urlFormatter.formatURLPref("extensions.blocklist.detailsURL");
- this._errorLink.hidden = false;
- } else if (!isUpgrade && !this.mAddon.isCompatible) {
- this.setAttribute("notification", "warning");
- this.setAttribute("AMD_notification", "incompatible");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.incompatible",
- [this.mAddon.name, gStrings.brandShortName, gStrings.appVersion], 3
- );
- this._warningLink.hidden = true;
- this._warningBtn.hidden = true;
- } else if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED) {
- this.setAttribute("notification", "warning");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.softblocked",
- [this.mAddon.name], 1
- );
- this._warningLink.value = gStrings.ext.GetStringFromName("notification.softblocked.link");
- /* Classicish Add-on Manager: As above. */
- if (this.mAddon.blocklistURL)
- this._warningLink.href = this.mAddon.blocklistURL;
- else
- this._warningLink.href = Services.urlFormatter.formatURLPref("extensions.blocklist.detailsURL");
- this._warningLink.hidden = false;
- this._warningBtn.hidden = true;
- } else if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_OUTDATED) {
- this.setAttribute("notification", "warning");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.outdated",
- [this.mAddon.name], 1
- );
- this._warningLink.value = gStrings.ext.GetStringFromName("notification.outdated.link");
- this._warningLink.href = Services.urlFormatter.formatURLPref("plugins.update.url");
- this._warningLink.hidden = false;
- this._warningBtn.hidden = true;
- } else {
- this.removeAttribute("notification");
- }
- }
- this._preferencesBtn.hidden = !this.mAddon.optionsURL;
- if (this.hasPermission("enable")) {
- this._enableBtn.hidden = false;
- let tooltip = gViewController.commands["cmd_enableItem"]
- .getTooltip(this.mAddon);
- this._enableBtn.setAttribute("tooltiptext", tooltip);
- } else {
- this._enableBtn.hidden = true;
- }
- if (this.hasPermission("disable")) {
- this._disableBtn.hidden = false;
- let tooltip = gViewController.commands["cmd_disableItem"]
- .getTooltip(this.mAddon);
- this._disableBtn.setAttribute("tooltiptext", tooltip);
- } else {
- this._disableBtn.hidden = true;
- }
- if (this.hasPermission("uninstall")) {
- this._removeBtn.hidden = false;
- let tooltip = gViewController.commands["cmd_uninstallItem"]
- .getTooltip(this.mAddon);
- this._removeBtn.setAttribute("tooltiptext", tooltip);
- } else {
- this._removeBtn.hidden = true;
- }
- this.setAttribute("active", this.mAddon.isActive);
- var showProgress = this.mAddon.purchaseURL || (this.mAddon.install &&
- this.mAddon.install.state != AddonManager.STATE_INSTALLED);
- this._showStatus(showProgress ? "progress" : "none");
- ]]></body>
- </method>
- </implementation>
- </binding>
- </bindings>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement