2007-03-22 10:30:00 -07:00
|
|
|
<?xml version="1.0"?>
|
2010-05-06 11:12:59 -07:00
|
|
|
<!-- ***** 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>
|
2010-08-27 22:29:05 -07:00
|
|
|
- David Dahl <ddahl@mozilla.com>
|
2010-05-06 11:12:59 -07:00
|
|
|
-
|
|
|
|
- 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;
|
2007-03-22 10:30:00 -07:00
|
|
|
]>
|
|
|
|
|
|
|
|
<bindings id="addonBindings"
|
|
|
|
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">
|
|
|
|
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<!-- Rating - displays current/average rating, allows setting user rating -->
|
|
|
|
<binding id="rating">
|
|
|
|
<content>
|
|
|
|
<xul:image class="star"
|
|
|
|
onmouseover="document.getBindingParent(this)._hover(1);"
|
|
|
|
onclick="document.getBindingParent(this).userRating = 1;"/>
|
|
|
|
<xul:image class="star"
|
|
|
|
onmouseover="document.getBindingParent(this)._hover(2);"
|
|
|
|
onclick="document.getBindingParent(this).userRating = 2;"/>
|
|
|
|
<xul:image class="star"
|
|
|
|
onmouseover="document.getBindingParent(this)._hover(3);"
|
|
|
|
onclick="document.getBindingParent(this).userRating = 3;"/>
|
|
|
|
<xul:image class="star"
|
|
|
|
onmouseover="document.getBindingParent(this)._hover(4);"
|
|
|
|
onclick="document.getBindingParent(this).userRating = 4;"/>
|
|
|
|
<xul:image class="star"
|
|
|
|
onmouseover="document.getBindingParent(this)._hover(5);"
|
|
|
|
onclick="document.getBindingParent(this).userRating = 5;"/>
|
|
|
|
</content>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<implementation>
|
|
|
|
<constructor><![CDATA[
|
|
|
|
this._updateStars();
|
|
|
|
]]></constructor>
|
|
|
|
|
|
|
|
<property name="stars" readonly="true">
|
|
|
|
<getter><![CDATA[
|
|
|
|
return document.getAnonymousNodes(this);
|
|
|
|
]]></getter>
|
|
|
|
</property>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<property name="averageRating">
|
|
|
|
<getter><![CDATA[
|
|
|
|
if (this.hasAttribute("averagerating"))
|
|
|
|
return this.getAttribute("averagerating");
|
|
|
|
return -1;
|
|
|
|
]]></getter>
|
|
|
|
<setter><![CDATA[
|
|
|
|
this.setAttribute("averagerating", val);
|
|
|
|
if (this.showRating == "average")
|
|
|
|
this._updateStars();
|
|
|
|
]]></setter>
|
|
|
|
</property>
|
2010-04-29 10:37:34 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<property name="userRating">
|
|
|
|
<getter><![CDATA[
|
|
|
|
if (this.hasAttribute("userrating"))
|
|
|
|
return this.getAttribute("userrating");
|
|
|
|
return -1;
|
|
|
|
]]></getter>
|
|
|
|
<setter><![CDATA[
|
|
|
|
if (this.showRating != "user")
|
|
|
|
return;
|
|
|
|
this.setAttribute("userrating", val);
|
|
|
|
if (this.showRating == "user")
|
|
|
|
this._updateStars();
|
|
|
|
]]></setter>
|
2010-05-01 11:04:44 -07:00
|
|
|
</property>
|
2010-04-29 10:37:34 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<property name="showRating">
|
|
|
|
<getter><![CDATA[
|
|
|
|
if (this.hasAttribute("showrating"))
|
|
|
|
return this.getAttribute("showrating");
|
|
|
|
return "average";
|
|
|
|
]]></getter>
|
|
|
|
<setter><![CDATA[
|
|
|
|
if (val != "average" || val != "user")
|
|
|
|
throw new Error("Invalid value");
|
|
|
|
this.setAttribute("showrating", val);
|
|
|
|
this._updateStars();
|
|
|
|
]]></setter>
|
|
|
|
</property>
|
|
|
|
|
|
|
|
<method name="_updateStars">
|
|
|
|
<body><![CDATA[
|
|
|
|
var stars = this.stars;
|
|
|
|
var rating = this[this.showRating + "Rating"];
|
|
|
|
// average ratings can be non-whole numbers, round them so they
|
|
|
|
// match to their closest star
|
|
|
|
rating = Math.round(rating);
|
|
|
|
for (let i = 0; i < stars.length; i++)
|
|
|
|
stars[i].setAttribute("on", rating > i);
|
|
|
|
]]></body>
|
2010-04-29 10:37:34 -07:00
|
|
|
</method>
|
2010-05-06 11:12:59 -07:00
|
|
|
|
|
|
|
<method name="_hover">
|
|
|
|
<parameter name="aScore"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
if (this.showRating != "user")
|
|
|
|
return;
|
|
|
|
var stars = this.stars;
|
|
|
|
for (let i = 0; i < stars.length; i++)
|
|
|
|
stars[i].setAttribute("on", i <= (aScore -1));
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
</implementation>
|
|
|
|
|
|
|
|
<handlers>
|
2010-05-06 11:12:59 -07:00
|
|
|
<handler event="mouseout">
|
|
|
|
this._updateStars();
|
2007-03-22 10:30:00 -07:00
|
|
|
</handler>
|
|
|
|
</handlers>
|
|
|
|
</binding>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<!-- Download progress - shows graphical progress of download and any
|
|
|
|
related status message. -->
|
|
|
|
<binding id="download-progress">
|
2007-03-22 10:30:00 -07:00
|
|
|
<content>
|
2010-05-06 11:12:59 -07:00
|
|
|
<xul:stack flex="1">
|
|
|
|
<xul:hbox flex="1">
|
|
|
|
<xul:hbox class="start-cap"/>
|
|
|
|
<xul:progressmeter anonid="progress" class="progress" flex="1"
|
|
|
|
min="0" max="100"/>
|
|
|
|
<xul:hbox class="end-cap"/>
|
|
|
|
</xul:hbox>
|
|
|
|
<xul:hbox class="status-container">
|
2010-10-15 10:00:03 -07:00
|
|
|
<xul:button anonid="pause-btn" class="pause"
|
2010-05-06 11:12:59 -07:00
|
|
|
tooltiptext="&progress.pause.tooltip;"/>
|
|
|
|
<xul:spacer flex="1"/>
|
|
|
|
<xul:label anonid="status" class="status"/>
|
|
|
|
<xul:spacer flex="1"/>
|
2010-10-15 10:00:03 -07:00
|
|
|
<xul:button anonid="cancel-btn" class="cancel"
|
2010-05-06 11:12:59 -07:00
|
|
|
tooltiptext="&progress.cancel.tooltip;"/>
|
|
|
|
</xul:hbox>
|
|
|
|
</xul:stack>
|
2007-03-22 10:30:00 -07:00
|
|
|
</content>
|
2010-05-06 11:12:59 -07:00
|
|
|
|
|
|
|
<implementation>
|
|
|
|
<constructor><![CDATA[
|
|
|
|
var progress = 0;
|
|
|
|
if (this.hasAttribute("progress"))
|
|
|
|
progress = parseInt(this.getAttribute("progress"));
|
|
|
|
this.progress = progress;
|
|
|
|
]]></constructor>
|
|
|
|
|
|
|
|
<field name="_progress">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "progress");
|
|
|
|
</field>
|
|
|
|
<field name="_pause">
|
2010-10-15 10:00:03 -07:00
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "pause-btn");
|
2010-05-06 11:12:59 -07:00
|
|
|
</field>
|
|
|
|
<field name="_cancel">
|
2010-10-15 10:00:03 -07:00
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "cancel-btn");
|
2010-05-06 11:12:59 -07:00
|
|
|
</field>
|
|
|
|
<field name="_status">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "status");
|
|
|
|
</field>
|
|
|
|
|
|
|
|
<property name="progress">
|
|
|
|
<getter><![CDATA[
|
|
|
|
return this._progress.value;
|
|
|
|
]]></getter>
|
|
|
|
<setter><![CDATA[
|
|
|
|
this._progress.value = val;
|
|
|
|
if (val == this._progress.max)
|
|
|
|
this.setAttribute("complete", true);
|
2010-10-06 17:20:06 -07:00
|
|
|
else
|
|
|
|
this.removeAttribute("complete");
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></setter>
|
|
|
|
</property>
|
|
|
|
|
|
|
|
<property name="maxProgress">
|
|
|
|
<getter><![CDATA[
|
|
|
|
return this._progress.max;
|
|
|
|
]]></getter>
|
|
|
|
<setter><![CDATA[
|
|
|
|
if (val == -1) {
|
|
|
|
this._progress.mode = "undetermined";
|
2010-12-06 16:28:49 -08:00
|
|
|
} else {
|
|
|
|
this._progress.mode = "determined";
|
|
|
|
this._progress.max = val;
|
2008-11-02 04:13:48 -08:00
|
|
|
}
|
2010-12-06 16:28:49 -08:00
|
|
|
this.setAttribute("mode", this._progress.mode);
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></setter>
|
|
|
|
</property>
|
|
|
|
|
|
|
|
<property name="status">
|
|
|
|
<getter><![CDATA[
|
|
|
|
return this._status.value;
|
|
|
|
]]></getter>
|
|
|
|
<setter><![CDATA[
|
|
|
|
this._status.value = val;
|
|
|
|
]]></setter>
|
2007-03-22 10:30:00 -07:00
|
|
|
</property>
|
|
|
|
</implementation>
|
|
|
|
</binding>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
|
|
|
|
<!-- Sorters - displays and controls the sort state of a list. -->
|
|
|
|
<binding id="sorters">
|
|
|
|
<content orient="horizontal">
|
2010-10-15 10:00:03 -07:00
|
|
|
<xul:button anonid="name-btn" class="sorter"
|
2010-05-06 11:12:59 -07:00
|
|
|
label="&sort.name.label;" tooltiptext="&sort.name.tooltip;"
|
|
|
|
oncommand="this.parentNode._handleChange('name');"/>
|
2010-10-15 10:00:03 -07:00
|
|
|
<xul:button anonid="date-btn" class="sorter"
|
2010-05-06 11:12:59 -07:00
|
|
|
label="&sort.dateUpdated.label;"
|
|
|
|
tooltiptext="&sort.dateUpdated.tooltip;"
|
2010-11-30 14:18:00 -08:00
|
|
|
oncommand="this.parentNode._handleChange('updateDate');"/>
|
2010-10-15 10:00:03 -07:00
|
|
|
<xul:button anonid="relevance-btn" class="sorter" hidden="true"
|
2010-08-27 15:01:36 -07:00
|
|
|
label="&sort.relevance.label;"
|
|
|
|
tooltiptext="&sort.relevance.tooltip;"
|
|
|
|
oncommand="this.parentNode._handleChange('relevancescore');"/>
|
2007-03-22 10:30:00 -07:00
|
|
|
</content>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<implementation>
|
|
|
|
<constructor><![CDATA[
|
|
|
|
if (!this.hasAttribute("sortby"))
|
|
|
|
this.setAttribute("sortby", "name");
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-08-27 15:01:36 -07:00
|
|
|
if (this.getAttribute("showrelevance") == "true")
|
|
|
|
this._btnRelevance.hidden = false;
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
this._refreshState();
|
|
|
|
]]></constructor>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<field name="handler">null</field>
|
|
|
|
<field name="_btnName">
|
2010-10-15 10:00:03 -07:00
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "name-btn");
|
2010-05-06 11:12:59 -07:00
|
|
|
</field>
|
|
|
|
<field name="_btnDate">
|
2010-10-15 10:00:03 -07:00
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "date-btn");
|
2010-05-06 11:12:59 -07:00
|
|
|
</field>
|
2010-08-27 15:01:36 -07:00
|
|
|
<field name="_btnRelevance">
|
2010-10-15 10:00:03 -07:00
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "relevance-btn");
|
2010-08-27 15:01:36 -07:00
|
|
|
</field>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<property name="sortBy">
|
|
|
|
<getter><![CDATA[
|
|
|
|
return this.getAttribute("sortby");
|
|
|
|
]]></getter>
|
|
|
|
<setter><![CDATA[
|
2010-07-19 16:01:23 -07:00
|
|
|
if (val != this.sortBy) {
|
|
|
|
this.setAttribute("sortBy", val);
|
|
|
|
this._refreshState();
|
|
|
|
}
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></setter>
|
2010-04-29 10:37:34 -07:00
|
|
|
</property>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<property name="ascending">
|
|
|
|
<getter><![CDATA[
|
2010-07-19 16:01:23 -07:00
|
|
|
return (this.getAttribute("ascending") == "true");
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></getter>
|
|
|
|
<setter><![CDATA[
|
2010-07-19 16:01:23 -07:00
|
|
|
val = !!val;
|
|
|
|
if (val != this.ascending) {
|
|
|
|
this.setAttribute("ascending", val);
|
|
|
|
this._refreshState();
|
|
|
|
}
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></setter>
|
|
|
|
</property>
|
|
|
|
|
2010-07-19 16:01:23 -07:00
|
|
|
<method name="setSort">
|
2010-05-06 11:12:59 -07:00
|
|
|
<parameter name="aSort"/>
|
2010-07-19 16:01:23 -07:00
|
|
|
<parameter name="aAscending"/>
|
2010-05-06 11:12:59 -07:00
|
|
|
<body><![CDATA[
|
2010-07-19 16:01:23 -07:00
|
|
|
var sortChanged = false;
|
|
|
|
if (aSort != this.sortBy) {
|
|
|
|
this.setAttribute("sortby", aSort);
|
|
|
|
sortChanged = true;
|
|
|
|
}
|
2010-06-16 20:13:54 -07:00
|
|
|
|
2010-07-19 16:01:23 -07:00
|
|
|
aAscending = !!aAscending;
|
|
|
|
if (this.ascending != aAscending) {
|
|
|
|
this.setAttribute("ascending", aAscending);
|
|
|
|
sortChanged = true;
|
2010-05-06 11:12:59 -07:00
|
|
|
}
|
2008-01-28 09:11:48 -08:00
|
|
|
|
2010-07-19 16:01:23 -07:00
|
|
|
if (sortChanged)
|
|
|
|
this._refreshState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="_handleChange">
|
|
|
|
<parameter name="aSort"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
const ASCENDING_SORT_FIELDS = ["name"];
|
2008-01-28 09:11:48 -08:00
|
|
|
|
2010-07-19 16:01:23 -07:00
|
|
|
// Toggle ascending if sort by is not changing, otherwise
|
|
|
|
// name sorting defaults to ascending, others to descending
|
|
|
|
if (aSort == this.sortBy)
|
|
|
|
this.ascending = !this.ascending;
|
|
|
|
else
|
|
|
|
this.setSort(aSort, ASCENDING_SORT_FIELDS.indexOf(aSort) >= 0);
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></body>
|
|
|
|
</method>
|
2008-03-28 23:37:30 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="_refreshState">
|
|
|
|
<body><![CDATA[
|
|
|
|
var sortBy = this.sortBy;
|
|
|
|
var checkState = this.ascending ? 2 : 1;
|
2008-03-16 15:07:42 -07:00
|
|
|
|
2010-10-06 17:20:06 -07:00
|
|
|
if (sortBy == "name") {
|
2010-05-06 11:12:59 -07:00
|
|
|
this._btnName.checkState = checkState;
|
2010-10-06 17:20:06 -07:00
|
|
|
this._btnName.checked = true;
|
|
|
|
} else {
|
2010-05-06 11:12:59 -07:00
|
|
|
this._btnName.checkState = 0;
|
2010-10-06 17:20:06 -07:00
|
|
|
this._btnName.checked = false;
|
|
|
|
}
|
2008-01-28 09:11:48 -08:00
|
|
|
|
2010-11-30 14:18:00 -08:00
|
|
|
if (sortBy == "updateDate") {
|
2010-05-06 11:12:59 -07:00
|
|
|
this._btnDate.checkState = checkState;
|
2010-10-06 17:20:06 -07:00
|
|
|
this._btnDate.checked = true;
|
|
|
|
} else {
|
2010-05-06 11:12:59 -07:00
|
|
|
this._btnDate.checkState = 0;
|
2010-10-06 17:20:06 -07:00
|
|
|
this._btnDate.checked = false;
|
|
|
|
}
|
2008-01-28 09:11:48 -08:00
|
|
|
|
2010-10-06 17:20:06 -07:00
|
|
|
if (sortBy == "relevancescore") {
|
2010-08-27 15:01:36 -07:00
|
|
|
this._btnRelevance.checkState = checkState;
|
2010-10-06 17:20:06 -07:00
|
|
|
this._btnRelevance.checked = true;
|
|
|
|
} else {
|
2010-08-27 15:01:36 -07:00
|
|
|
this._btnRelevance.checkState = 0;
|
2010-10-06 17:20:06 -07:00
|
|
|
this._btnRelevance.checked = false;
|
|
|
|
}
|
2008-01-28 09:11:48 -08:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
if (this.handler && "onSortChanged" in this.handler)
|
|
|
|
this.handler.onSortChanged(sortBy, this.ascending);
|
|
|
|
]]></body>
|
2010-05-01 11:04:44 -07:00
|
|
|
</method>
|
2010-05-06 11:12:59 -07:00
|
|
|
</implementation>
|
|
|
|
</binding>
|
2010-04-29 10:37:34 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
|
|
|
|
<!-- Categories list - displays the list of categories on the left pane. -->
|
|
|
|
<binding id="categories-list"
|
|
|
|
extends="chrome://global/content/bindings/richlistbox.xml#richlistbox">
|
|
|
|
<implementation>
|
|
|
|
<!-- This needs to be overridden to allow the fancy animation while not
|
|
|
|
allowing that item to be selected when hiding. -->
|
|
|
|
<method name="_canUserSelect">
|
|
|
|
<parameter name="aItem"/>
|
2008-01-28 09:11:48 -08:00
|
|
|
<body>
|
|
|
|
<![CDATA[
|
2010-05-06 11:12:59 -07:00
|
|
|
if (aItem.hasAttribute("disabled") &&
|
|
|
|
aItem.getAttribute("disabled") == "true")
|
|
|
|
return false;
|
|
|
|
var style = document.defaultView.getComputedStyle(aItem, "");
|
|
|
|
return style.display != "none" && style.visibility == "visible";
|
2008-01-28 09:11:48 -08:00
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
|
|
|
</implementation>
|
|
|
|
</binding>
|
2010-05-06 11:12:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
<!-- Category item - an item in the category list. -->
|
|
|
|
<binding id="category"
|
|
|
|
extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
|
2010-06-18 14:10:13 -07:00
|
|
|
<content align="center">
|
2010-05-06 11:12:59 -07:00
|
|
|
<xul:image anonid="icon" class="category-icon"/>
|
|
|
|
<xul:label anonid="name" class="category-name" flex="1" xbl:inherits="value=name"/>
|
|
|
|
<xul:label anonid="badge" class="category-badge" xbl:inherits="value=count"/>
|
|
|
|
</content>
|
|
|
|
|
|
|
|
<implementation>
|
|
|
|
<constructor><![CDATA[
|
|
|
|
if (!this.hasAttribute("count"))
|
|
|
|
this.setAttribute("count", 0);
|
|
|
|
]]></constructor>
|
|
|
|
|
|
|
|
<property name="badgeCount">
|
|
|
|
<getter><![CDATA[
|
|
|
|
return this.getAttribute("count");
|
|
|
|
]]></getter>
|
|
|
|
<setter><![CDATA[
|
2010-06-02 02:13:03 -07:00
|
|
|
if (this.getAttribute("count") == val)
|
|
|
|
return;
|
|
|
|
|
|
|
|
this.setAttribute("count", val);
|
|
|
|
var event = document.createEvent("Events");
|
|
|
|
event.initEvent("CategoryBadgeUpdated", true, true);
|
|
|
|
this.dispatchEvent(event);
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></setter>
|
|
|
|
</property>
|
|
|
|
</implementation>
|
|
|
|
</binding>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Creator link - Name of a user/developer, providing a link if relevant. -->
|
|
|
|
<binding id="creator-link">
|
|
|
|
<content>
|
|
|
|
<xul:label anonid="label" value="&addon.createdBy.label;"/>
|
|
|
|
<xul:label anonid="creator-link" class="creator-link text-link"/>
|
|
|
|
<xul:label anonid="creator-name" class="creator-name"/>
|
2008-01-28 09:11:48 -08:00
|
|
|
</content>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<implementation>
|
|
|
|
<constructor><![CDATA[
|
|
|
|
if (this.hasAttribute("nameonly") &&
|
|
|
|
this.getAttribute("nameonly") == "true") {
|
|
|
|
this._label.hidden = true;
|
|
|
|
}
|
|
|
|
]]></constructor>
|
|
|
|
|
|
|
|
<field name="_label">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "label");
|
2010-04-29 10:37:34 -07:00
|
|
|
</field>
|
2010-05-06 11:12:59 -07:00
|
|
|
<field name="_creatorLink">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "creator-link");
|
|
|
|
</field>
|
|
|
|
<field name="_creatorName">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "creator-name");
|
2008-01-28 09:11:48 -08:00
|
|
|
</field>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="setCreator">
|
2010-09-01 09:57:48 -07:00
|
|
|
<parameter name="aCreator"/>
|
|
|
|
<parameter name="aHomepageURL"/>
|
2010-05-06 11:12:59 -07:00
|
|
|
<body><![CDATA[
|
2010-09-01 09:57:48 -07:00
|
|
|
if (!aCreator) {
|
2010-05-06 11:12:59 -07:00
|
|
|
this.collapsed = true;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.collapsed = false;
|
2010-09-01 09:57:48 -07:00
|
|
|
var url = aCreator.url || aHomepageURL;
|
|
|
|
var showLink = !!url;
|
2010-05-06 11:12:59 -07:00
|
|
|
if (showLink) {
|
2010-09-01 09:57:48 -07:00
|
|
|
this._creatorLink.value = aCreator.name;
|
|
|
|
this._creatorLink.href = url;
|
2010-05-06 11:12:59 -07:00
|
|
|
} else {
|
2010-09-01 09:57:48 -07:00
|
|
|
this._creatorName.value = aCreator.name;
|
2010-05-06 11:12:59 -07:00
|
|
|
}
|
|
|
|
this._creatorLink.hidden = !showLink;
|
|
|
|
this._creatorName.hidden = showLink;
|
|
|
|
]]></body>
|
2008-01-28 09:11:48 -08:00
|
|
|
</method>
|
|
|
|
</implementation>
|
|
|
|
</binding>
|
|
|
|
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<!-- Install status - Displays the status of an install/upgrade. -->
|
|
|
|
<binding id="install-status">
|
2008-01-28 09:11:48 -08:00
|
|
|
<content>
|
2010-05-06 11:12:59 -07:00
|
|
|
<xul:label anonid="message"/>
|
|
|
|
<xul:progressmeter anonid="progress" class="download-progress"/>
|
2010-10-15 10:00:03 -07:00
|
|
|
<xul:button anonid="install-remote-btn" hidden="true"
|
2010-10-06 17:20:06 -07:00
|
|
|
class="addon-control install" label="&addon.install.label;"
|
2010-07-19 16:01:23 -07:00
|
|
|
tooltiptext="&addon.install.tooltip;"
|
|
|
|
oncommand="document.getBindingParent(this).installRemote();"/>
|
2010-10-15 10:00:03 -07:00
|
|
|
<xul:button anonid="restart-install-btn" hidden="true"
|
2010-10-06 17:20:06 -07:00
|
|
|
class="addon-control install" label="&addon.install.label;"
|
2010-05-06 11:12:59 -07:00
|
|
|
tooltiptext="&addon.install.tooltip;"
|
|
|
|
oncommand="document.getBindingParent(this).restartInstall();"/>
|
2008-01-28 09:11:48 -08:00
|
|
|
</content>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<implementation>
|
|
|
|
<constructor><![CDATA[
|
|
|
|
if (this.mInstall)
|
|
|
|
this.initWithInstall(this.mInstall);
|
|
|
|
else if (this.mControl.mAddon.install)
|
|
|
|
this.initWithInstall(this.mControl.mAddon.install);
|
|
|
|
else if (this.mAddon)
|
|
|
|
this.refreshState();
|
|
|
|
]]></constructor>
|
|
|
|
|
|
|
|
<destructor><![CDATA[
|
|
|
|
if (this.mInstall)
|
|
|
|
this.mInstall.removeListener(this);
|
|
|
|
]]></destructor>
|
|
|
|
|
|
|
|
<field name="_message">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "message");
|
|
|
|
</field>
|
|
|
|
<field name="_progress">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "progress");
|
|
|
|
</field>
|
2010-07-19 16:01:23 -07:00
|
|
|
<field name="_installRemote">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
2010-10-15 10:00:03 -07:00
|
|
|
"install-remote-btn");
|
2010-07-19 16:01:23 -07:00
|
|
|
</field>
|
2010-05-06 11:12:59 -07:00
|
|
|
<field name="_restartNeeded">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"restart-needed");
|
|
|
|
</field>
|
|
|
|
<field name="_restartInstall">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
2010-10-15 10:00:03 -07:00
|
|
|
"restart-install-btn");
|
2010-05-06 11:12:59 -07:00
|
|
|
</field>
|
|
|
|
<field name="_undo">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
2010-10-15 10:00:03 -07:00
|
|
|
"undo-btn");
|
2010-05-06 11:12:59 -07:00
|
|
|
</field>
|
2008-01-28 09:11:48 -08:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="initWithInstall">
|
|
|
|
<parameter name="aInstall"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
if (this.mInstall) {
|
|
|
|
this.mInstall.removeListener(this);
|
|
|
|
this.mInstall = null;
|
|
|
|
}
|
|
|
|
this.mInstall = aInstall;
|
|
|
|
this.refreshState();
|
|
|
|
this.mInstall.addListener(this);
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2008-01-28 09:11:48 -08:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="refreshState">
|
|
|
|
<body><![CDATA[
|
2010-07-19 16:01:23 -07:00
|
|
|
var showInstallRemote = false;
|
2010-05-06 11:12:59 -07:00
|
|
|
var showRestartInstall = false;
|
|
|
|
|
|
|
|
if (this.mInstall) {
|
|
|
|
|
|
|
|
switch (this.mInstall.state) {
|
|
|
|
case AddonManager.STATE_AVAILABLE:
|
2010-07-19 16:01:23 -07:00
|
|
|
if (this.mControl.getAttribute("remote") != "true")
|
|
|
|
break;
|
|
|
|
|
|
|
|
this._progress.hidden = true;
|
|
|
|
showInstallRemote = true;
|
2010-05-06 11:12:59 -07:00
|
|
|
break;
|
|
|
|
case AddonManager.STATE_DOWNLOADING:
|
|
|
|
this.showMessage("installDownloading");
|
|
|
|
break;
|
|
|
|
case AddonManager.STATE_CHECKING:
|
|
|
|
this.showMessage("installVerifying");
|
|
|
|
break;
|
|
|
|
case AddonManager.STATE_DOWNLOADED:
|
|
|
|
this.showMessage("installDownloaded");
|
|
|
|
break;
|
|
|
|
case AddonManager.STATE_DOWNLOAD_FAILED:
|
|
|
|
// XXXunf expose what error occured (bug 553487)
|
|
|
|
this.showMessage("installDownloadFailed", true);
|
|
|
|
break;
|
|
|
|
case AddonManager.STATE_INSTALLING:
|
|
|
|
this.showMessage("installInstalling");
|
|
|
|
break;
|
|
|
|
case AddonManager.STATE_INSTALL_FAILED:
|
|
|
|
// XXXunf expose what error occured (bug 553487)
|
|
|
|
this.showMessage("installFailed", true);
|
|
|
|
break;
|
|
|
|
case AddonManager.STATE_CANCELLED:
|
|
|
|
this.showMessage("installCancelled", true);
|
|
|
|
showRestartInstall = true;
|
|
|
|
break;
|
|
|
|
}
|
2008-01-28 09:11:48 -08:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
}
|
2008-01-28 09:11:48 -08:00
|
|
|
|
2010-07-19 16:01:23 -07:00
|
|
|
this._installRemote.hidden = !showInstallRemote;
|
2010-05-06 11:12:59 -07:00
|
|
|
this._restartInstall.hidden = !showRestartInstall;
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="showMessage">
|
|
|
|
<parameter name="aMsgId"/>
|
|
|
|
<parameter name="aHideProgress"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
this._message.setAttribute("hidden", !aHideProgress);
|
2010-10-06 17:20:06 -07:00
|
|
|
this._progress.setAttribute("hidden", !!aHideProgress);
|
2010-05-06 11:12:59 -07:00
|
|
|
|
|
|
|
var msg = gStrings.ext.GetStringFromName(aMsgId);
|
|
|
|
if (aHideProgress)
|
|
|
|
this._message.value = msg;
|
|
|
|
else
|
|
|
|
this._progress.status = msg;
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-07-19 16:01:23 -07:00
|
|
|
<method name="installRemote">
|
|
|
|
<body><![CDATA[
|
|
|
|
if (this.mControl.getAttribute("remote") != "true")
|
|
|
|
return;
|
|
|
|
|
2010-10-19 14:12:29 -07:00
|
|
|
if (this.mControl.mAddon.eula) {
|
2010-10-06 17:20:06 -07:00
|
|
|
var data = {
|
|
|
|
addon: this.mControl.mAddon,
|
2010-10-19 14:12:29 -07:00
|
|
|
accepted: false
|
|
|
|
};
|
|
|
|
window.openDialog("chrome://mozapps/content/extensions/eula.xul", "_blank",
|
2010-10-06 17:20:06 -07:00
|
|
|
"chrome,dialog,modal,centerscreen,resizable=no", data);
|
|
|
|
if (!data.accepted)
|
2010-10-19 14:12:29 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-07-19 16:01:23 -07:00
|
|
|
delete this.mControl.mAddon;
|
|
|
|
this.mControl.mInstall = this.mInstall;
|
|
|
|
this.mControl.setAttribute("status", "installing");
|
|
|
|
this.mInstall.install();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="restartInstall">
|
|
|
|
<body><![CDATA[
|
|
|
|
this.mInstall.install();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="undoAction">
|
|
|
|
<body><![CDATA[
|
|
|
|
if (!this.mAddon)
|
|
|
|
return;
|
|
|
|
var pending = this.mAddon.pendingOperations;
|
|
|
|
if (pending & AddonManager.PENDING_ENABLE)
|
|
|
|
this.mAddon.userDisabled = true;
|
|
|
|
else if (pending & AddonManager.PENDING_DISABLE)
|
|
|
|
this.mAddon.userDisabled = false;
|
|
|
|
this.refreshState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="onDownloadStarted">
|
|
|
|
<body><![CDATA[
|
|
|
|
this.refreshState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="onDownloadEnded">
|
|
|
|
<body><![CDATA[
|
|
|
|
this.refreshState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="onDownloadFailed">
|
|
|
|
<body><![CDATA[
|
|
|
|
this.refreshState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="onDownloadProgress">
|
|
|
|
<body><![CDATA[
|
|
|
|
this._progress.maxProgress = this.mInstall.maxProgress;
|
|
|
|
this._progress.progress = this.mInstall.progress;
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="onInstallStarted">
|
|
|
|
<body><![CDATA[
|
2010-10-06 17:20:06 -07:00
|
|
|
this._progress.progress = 0;
|
2010-05-06 11:12:59 -07:00
|
|
|
this.refreshState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="onInstallEnded">
|
|
|
|
<body><![CDATA[
|
|
|
|
this.refreshState();
|
2010-10-06 10:14:46 -07:00
|
|
|
if ("onInstallCompleted" in this.mControl)
|
|
|
|
this.mControl.onInstallCompleted();
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></body>
|
|
|
|
</method>
|
2010-04-29 10:37:34 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="onInstallFailed">
|
|
|
|
<body><![CDATA[
|
|
|
|
this.refreshState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
</implementation>
|
2007-03-22 10:30:00 -07:00
|
|
|
</binding>
|
|
|
|
|
2010-04-29 10:37:34 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<!-- Addon - base - parent binding of any item representing an addon. -->
|
|
|
|
<binding id="addon-base"
|
|
|
|
extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
|
|
|
|
<implementation>
|
|
|
|
<method name="hasPermission">
|
|
|
|
<parameter name="aPerm"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
var perm = AddonManager["PERM_CAN_" + aPerm.toUpperCase()];
|
|
|
|
return !!(this.mAddon.permissions & perm);
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-07-26 12:42:06 -07:00
|
|
|
<method name="opRequiresRestart">
|
|
|
|
<parameter name="aOperation"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
var operation = AddonManager["OP_NEEDS_RESTART_" + aOperation.toUpperCase()];
|
|
|
|
return !!(this.mAddon.operationsRequiringRestart & operation);
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="isPending">
|
|
|
|
<parameter name="aAction"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
var action = AddonManager["PENDING_" + aAction.toUpperCase()];
|
|
|
|
return !!(this.mAddon.pendingOperations & action);
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2010-07-26 12:42:06 -07:00
|
|
|
|
|
|
|
<method name="onUninstalled">
|
|
|
|
<body><![CDATA[
|
|
|
|
this.parentNode.removeChild(this);
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2010-05-06 11:12:59 -07:00
|
|
|
</implementation>
|
2010-05-01 11:04:44 -07:00
|
|
|
</binding>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
|
2010-06-02 02:13:03 -07:00
|
|
|
<!-- Addon - generic - A normal addon item, or an update to one -->
|
2010-05-06 11:12:59 -07:00
|
|
|
<binding id="addon-generic"
|
|
|
|
extends="chrome://mozapps/content/extensions/extensions.xml#addon-base">
|
2010-05-01 11:04:44 -07:00
|
|
|
<content>
|
2010-08-23 10:46:05 -07:00
|
|
|
<xul:hbox anonid="warning-container" align="center"
|
|
|
|
class="warning">
|
|
|
|
<xul:image class="warning-icon"/>
|
|
|
|
<xul:label anonid="warning" flex="1"/>
|
|
|
|
<xul:label anonid="warning-link" class="text-link"/>
|
|
|
|
<xul:spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
|
|
|
|
</xul:hbox>
|
|
|
|
<xul:hbox anonid="error-container" align="center"
|
|
|
|
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" align="center"
|
|
|
|
class="pending">
|
|
|
|
<xul:image class="pending-icon"/>
|
|
|
|
<xul:label anonid="pending" flex="1"/>
|
2010-10-15 10:00:03 -07:00
|
|
|
<xul:button anonid="restart-btn" class="button-link"
|
2010-08-23 10:46:05 -07:00
|
|
|
label="&addon.restartNow.label;"
|
|
|
|
oncommand="document.getBindingParent(this).restart();"/>
|
2010-10-15 10:00:03 -07:00
|
|
|
<xul:button anonid="undo-btn" class="button-link"
|
2010-09-01 10:31:12 -07:00
|
|
|
label="&addon.undoAction.label;"
|
|
|
|
tooltipText="&addon.undoAction.tooltip;"
|
2010-08-23 10:46:05 -07:00
|
|
|
oncommand="document.getBindingParent(this).undo();"/>
|
|
|
|
<xul:spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
|
|
|
|
</xul:hbox>
|
2010-10-06 15:05:50 -07:00
|
|
|
|
|
|
|
<xul:hbox>
|
2010-10-06 17:20:06 -07:00
|
|
|
<xul:vbox align="center" pack="start" class="icon-container">
|
2010-10-06 15:05:50 -07:00
|
|
|
<xul:image anonid="icon" class="icon"/>
|
2010-05-01 11:04:44 -07:00
|
|
|
</xul:vbox>
|
2010-10-06 15:05:50 -07:00
|
|
|
<xul:vbox flex="1">
|
|
|
|
<xul:hbox align="start">
|
|
|
|
<xul:vbox flex="1">
|
|
|
|
<xul:hbox class="name-container" align="end">
|
|
|
|
<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 -->
|
2010-09-10 01:20:12 -07:00
|
|
|
</xul:hbox>
|
2010-10-06 15:05:50 -07:00
|
|
|
<xul:label anonid="creator" class="creator"/>
|
2010-09-10 01:20:12 -07:00
|
|
|
</xul:vbox>
|
2010-10-06 17:20:06 -07:00
|
|
|
<xul:label anonid="date-updated" class="date-updated"
|
|
|
|
unknown="&addon.unknownDate;"/>
|
2010-05-06 11:12:59 -07:00
|
|
|
</xul:hbox>
|
2010-10-06 15:05:50 -07:00
|
|
|
|
|
|
|
<xul:hbox flex="1" align="end">
|
|
|
|
<xul:vbox flex="1">
|
|
|
|
<xul:hbox align="center" class="description-container">
|
|
|
|
<xul:label flex="1" anonid="description" class="description" crop="end"/>
|
2010-10-15 10:00:03 -07:00
|
|
|
<xul:button anonid="details-btn" class="details button-link"
|
2010-10-06 15:05:50 -07:00
|
|
|
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;"/>
|
2010-10-06 17:20:06 -07:00
|
|
|
<xul:vbox anonid="relnotes" class="relnotes"/>
|
2010-10-06 15:05:50 -07:00
|
|
|
</xul:vbox>
|
|
|
|
<xul:hbox pack="start">
|
2010-10-15 10:00:03 -07:00
|
|
|
<xul:button anonid="relnotes-toggle-btn" class="relnotes-toggle"
|
2010-10-06 15:05:50 -07:00
|
|
|
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:vbox>
|
|
|
|
<xul:hbox class="status-container" pack="end">
|
|
|
|
<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" align="end">
|
|
|
|
<xul:checkbox anonid="include-update" class="include-update"
|
|
|
|
label="&addon.includeUpdate.label;" checked="true"
|
|
|
|
oncommand="document.getBindingParent(this).onIncludeUpdateChanged();"/>
|
|
|
|
<xul:hbox align="center">
|
|
|
|
<xul:label class="update-available-notice"
|
|
|
|
value="&addon.updateAvailable.label;"/>
|
2010-10-06 17:20:06 -07:00
|
|
|
<xul:button anonid="update-btn" class="addon-control update"
|
2010-10-06 15:05:50 -07:00
|
|
|
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">
|
2010-10-06 17:20:06 -07:00
|
|
|
<xul:button anonid="preferences-btn"
|
|
|
|
class="addon-control preferences"
|
2010-08-27 22:29:05 -07:00
|
|
|
#ifdef XP_WIN
|
2010-10-06 15:05:50 -07:00
|
|
|
label="&cmd.showPreferencesWin.label;"
|
|
|
|
tooltiptext="&cmd.showPreferencesWin.tooltip;"
|
2010-08-27 22:29:05 -07:00
|
|
|
#else
|
2010-10-06 15:05:50 -07:00
|
|
|
label="&cmd.showPreferencesUnix.label;"
|
|
|
|
tooltiptext="&cmd.showPreferencesUnix.tooltip;"
|
2010-08-27 22:29:05 -07:00
|
|
|
#endif
|
2010-10-06 15:05:50 -07:00
|
|
|
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>
|
2010-06-02 02:13:03 -07:00
|
|
|
</xul:hbox>
|
2010-08-23 10:46:05 -07:00
|
|
|
</xul:vbox>
|
|
|
|
</xul:hbox>
|
2007-03-22 10:30:00 -07:00
|
|
|
</content>
|
|
|
|
|
|
|
|
<implementation>
|
2010-05-06 11:12:59 -07:00
|
|
|
<constructor><![CDATA[
|
|
|
|
this._installStatus.mControl = this;
|
|
|
|
|
|
|
|
this.setAttribute("contextmenu", "addonitem-popup");
|
|
|
|
|
|
|
|
this._showStatus("none");
|
|
|
|
|
2010-10-18 11:11:05 -07:00
|
|
|
this._initWithAddon(this.mAddon);
|
2010-06-02 02:13:03 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
gEventManager.registerAddonListener(this, this.mAddon.id);
|
|
|
|
]]></constructor>
|
|
|
|
|
|
|
|
<destructor><![CDATA[
|
|
|
|
gEventManager.unregisterAddonListener(this, this.mAddon.id);
|
|
|
|
]]></destructor>
|
|
|
|
|
2010-08-23 10:46:05 -07:00
|
|
|
<field name="_warningContainer">
|
2010-05-06 11:12:59 -07:00
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
2010-08-23 10:46:05 -07:00
|
|
|
"warning-container");
|
2010-05-06 11:12:59 -07:00
|
|
|
</field>
|
2010-08-23 10:46:05 -07:00
|
|
|
<field name="_warning">
|
2010-05-06 11:12:59 -07:00
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
2010-08-23 10:46:05 -07:00
|
|
|
"warning");
|
2010-05-06 11:12:59 -07:00
|
|
|
</field>
|
2010-08-23 10:46:05 -07:00
|
|
|
<field name="_warningLink">
|
2010-05-06 11:12:59 -07:00
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
2010-08-23 10:46:05 -07:00
|
|
|
"warning-link");
|
2010-05-06 11:12:59 -07:00
|
|
|
</field>
|
2010-08-23 10:46:05 -07:00
|
|
|
<field name="_errorContainer">
|
2010-05-06 11:12:59 -07:00
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
2010-08-23 10:46:05 -07:00
|
|
|
"error-container");
|
2010-05-06 11:12:59 -07:00
|
|
|
</field>
|
2010-08-23 10:46:05 -07:00
|
|
|
<field name="_error">
|
2010-05-06 11:12:59 -07:00
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
2010-08-23 10:46:05 -07:00
|
|
|
"error");
|
|
|
|
</field>
|
|
|
|
<field name="_errorLink">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"error-link");
|
|
|
|
</field>
|
|
|
|
<field name="_pendingContainer">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"pending-container");
|
|
|
|
</field>
|
|
|
|
<field name="_pending">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"pending");
|
|
|
|
</field>
|
|
|
|
<field name="_infoContainer">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"info-container");
|
2010-05-06 11:12:59 -07:00
|
|
|
</field>
|
2010-08-23 10:46:05 -07:00
|
|
|
<field name="_info">
|
2010-05-06 11:12:59 -07:00
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
2010-08-23 10:46:05 -07:00
|
|
|
"info");
|
|
|
|
</field>
|
|
|
|
<field name="_creator">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"creator");
|
2010-05-06 11:12:59 -07:00
|
|
|
</field>
|
2010-06-28 12:43:53 -07:00
|
|
|
<field name="_version">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "version");
|
|
|
|
</field>
|
2010-05-06 11:12:59 -07:00
|
|
|
<field name="_icon">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "icon");
|
|
|
|
</field>
|
|
|
|
<field name="_dateUpdated">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"date-updated");
|
|
|
|
</field>
|
|
|
|
<field name="_description">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"description");
|
|
|
|
</field>
|
2010-06-23 16:35:21 -07:00
|
|
|
<field name="_preferencesBtn">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"preferences-btn");
|
|
|
|
</field>
|
2010-05-06 11:12:59 -07:00
|
|
|
<field name="_enableBtn">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"enable-btn");
|
|
|
|
</field>
|
|
|
|
<field name="_disableBtn">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"disable-btn");
|
|
|
|
</field>
|
|
|
|
<field name="_removeBtn">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"remove-btn");
|
|
|
|
</field>
|
2010-06-02 02:13:03 -07:00
|
|
|
<field name="_updateBtn">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"update-btn");
|
|
|
|
</field>
|
2010-05-06 11:12:59 -07:00
|
|
|
<field name="_controlContainer">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"control-container");
|
|
|
|
</field>
|
|
|
|
<field name="_installStatus">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"install-status");
|
|
|
|
</field>
|
|
|
|
<field name="_checkingUpdate">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"checking-update");
|
|
|
|
</field>
|
2010-06-02 02:13:03 -07:00
|
|
|
<field name="_updateAvailable">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"update-available");
|
|
|
|
</field>
|
2010-09-10 01:20:12 -07:00
|
|
|
<field name="_includeUpdate">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"include-update");
|
|
|
|
</field>
|
2010-06-02 02:13:03 -07:00
|
|
|
<field name="_relNotesLoaded">false</field>
|
|
|
|
<field name="_relNotesToggle">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
2010-10-15 10:00:03 -07:00
|
|
|
"relnotes-toggle-btn");
|
2010-06-02 02:13:03 -07:00
|
|
|
</field>
|
|
|
|
<field name="_relNotesLoading">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"relnotes-loading");
|
|
|
|
</field>
|
|
|
|
<field name="_relNotesError">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"relnotes-error");
|
|
|
|
</field>
|
|
|
|
<field name="_relNotesContainer">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"relnotes-container");
|
|
|
|
</field>
|
|
|
|
<field name="_relNotes">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"relnotes");
|
|
|
|
</field>
|
2010-05-06 11:12:59 -07:00
|
|
|
|
|
|
|
<property name="userDisabled">
|
|
|
|
<getter><![CDATA[
|
|
|
|
return this.mAddon.userDisabled;
|
|
|
|
]]></getter>
|
|
|
|
<setter><![CDATA[
|
|
|
|
this.mAddon.userDisabled = val;
|
|
|
|
]]></setter>
|
|
|
|
</property>
|
|
|
|
|
2010-09-10 01:20:12 -07:00
|
|
|
<property name="includeUpdate">
|
|
|
|
<getter><![CDATA[
|
|
|
|
return this._includeUpdate.checked && !!this.mManualUpdate;
|
|
|
|
]]></getter>
|
|
|
|
<setter><![CDATA[
|
|
|
|
//XXXunf Eventually, we'll want to persist this for individual
|
|
|
|
// updates - see bug 594619.
|
|
|
|
this._includeUpdate.checked = !!val;
|
|
|
|
]]></setter>
|
|
|
|
</property>
|
|
|
|
|
2010-10-18 11:11:05 -07:00
|
|
|
<method name="_initWithAddon">
|
|
|
|
<parameter name="aAddon"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
this.mAddon = aAddon;
|
|
|
|
|
|
|
|
this._installStatus.mAddon = this.mAddon;
|
|
|
|
this._updateDates();
|
|
|
|
this._updateState();
|
|
|
|
|
|
|
|
this.setAttribute("name", aAddon.name);
|
|
|
|
|
|
|
|
var iconURL = this.mAddon.iconURL;
|
|
|
|
if (iconURL)
|
|
|
|
this._icon.src = iconURL;
|
|
|
|
else
|
|
|
|
this._icon.src = null;
|
|
|
|
|
|
|
|
if (this.mAddon.version)
|
|
|
|
this._version.value = this.mAddon.version;
|
|
|
|
else
|
|
|
|
this._version.hidden = true;
|
|
|
|
|
|
|
|
this._creator.setCreator(this.mAddon.creator);
|
|
|
|
|
|
|
|
if (this.mAddon.description)
|
|
|
|
this._description.value = this.mAddon.description;
|
|
|
|
else
|
|
|
|
this._description.hidden = true;
|
|
|
|
|
2010-10-29 12:05:08 -07:00
|
|
|
if (!("applyBackgroundUpdates" in this.mAddon) ||
|
|
|
|
(this.mAddon.applyBackgroundUpdates == AddonManager.AUTOUPDATE_DISABLE ||
|
|
|
|
(this.mAddon.applyBackgroundUpdates == AddonManager.AUTOUPDATE_DEFAULT &&
|
|
|
|
!AddonManager.autoUpdateDefault))) {
|
2010-10-18 11:11:05 -07:00
|
|
|
var self = this;
|
|
|
|
AddonManager.getAllInstalls(function(aInstallsList) {
|
|
|
|
// This can return after the binding has been destroyed,
|
|
|
|
// so try to detect that and return early
|
|
|
|
if (!("onNewInstall" in self))
|
|
|
|
return;
|
|
|
|
for (let i = 0; i < aInstallsList.length; i++) {
|
|
|
|
let install = aInstallsList[i];
|
|
|
|
if (install.existingAddon &&
|
|
|
|
install.existingAddon.id == self.mAddon.id &&
|
|
|
|
install.state == AddonManager.STATE_AVAILABLE) {
|
|
|
|
self.onNewInstall(install);
|
|
|
|
self.onIncludeUpdateChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="_showStatus">
|
|
|
|
<parameter name="aType"/>
|
|
|
|
<body><![CDATA[
|
2010-06-02 02:13:03 -07:00
|
|
|
this._controlContainer.hidden = aType != "none" &&
|
|
|
|
!(aType == "update-available" && !this.hasAttribute("upgrade"));
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
this._installStatus.hidden = aType != "progress";
|
|
|
|
if (aType == "progress")
|
|
|
|
this._installStatus.refreshState();
|
|
|
|
this._checkingUpdate.hidden = aType != "checking-update";
|
2010-06-02 02:13:03 -07:00
|
|
|
this._updateAvailable.hidden = aType != "update-available";
|
|
|
|
this._relNotesToggle.hidden = !(this.mManualUpdate ?
|
|
|
|
this.mManualUpdate.releaseNotesURI :
|
|
|
|
this.mAddon.releaseNotesURI);
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="_updateDates">
|
|
|
|
<body><![CDATA[
|
|
|
|
function formatDate(aDate) {
|
|
|
|
return Cc["@mozilla.org/intl/scriptabledateformat;1"]
|
|
|
|
.getService(Ci.nsIScriptableDateFormat)
|
|
|
|
.FormatDate("",
|
|
|
|
Ci.nsIScriptableDateFormat.dateFormatLong,
|
|
|
|
aDate.getFullYear(),
|
|
|
|
aDate.getMonth() + 1,
|
|
|
|
aDate.getDate()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2010-11-30 14:18:00 -08:00
|
|
|
if (this.mAddon.updateDate)
|
2010-05-06 11:12:59 -07:00
|
|
|
this._dateUpdated.value = formatDate(this.mAddon.updateDate);
|
2010-11-30 14:18:00 -08:00
|
|
|
else
|
2010-05-06 11:12:59 -07:00
|
|
|
this._dateUpdated.value = this._dateUpdated.getAttribute("unknown");
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="_updateState">
|
|
|
|
<body><![CDATA[
|
2010-08-23 10:46:05 -07:00
|
|
|
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");
|
|
|
|
|
2010-10-06 10:18:38 -07:00
|
|
|
var isUpgrade = this.hasAttribute("upgrade");
|
|
|
|
|
|
|
|
if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED) {
|
2010-08-23 10:46:05 -07:00
|
|
|
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");
|
|
|
|
this._errorLink.href = Services.urlFormatter.formatURLPref("extensions.blocklist.detailsURL");
|
|
|
|
this._errorLink.hidden = false;
|
2010-10-06 10:18:38 -07:00
|
|
|
} else if (!isUpgrade && !this.mAddon.isCompatible) {
|
2010-08-23 10:46:05 -07:00
|
|
|
this.setAttribute("notification", "warning");
|
|
|
|
this._warning.textContent = gStrings.ext.formatStringFromName(
|
|
|
|
"notification.incompatible",
|
|
|
|
[this.mAddon.name, gStrings.brandShortName, gStrings.appVersion], 3
|
|
|
|
);
|
|
|
|
this._warningLink.hidden = true;
|
2010-10-06 10:18:38 -07:00
|
|
|
} else if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED) {
|
2010-08-23 10:46:05 -07:00
|
|
|
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");
|
|
|
|
this._warningLink.href = Services.urlFormatter.formatURLPref("extensions.blocklist.detailsURL");
|
|
|
|
this._warningLink.hidden = false;
|
2010-10-06 10:18:38 -07:00
|
|
|
} else if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_OUTDATED) {
|
2010-09-01 09:58:42 -07:00
|
|
|
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;
|
2010-08-23 10:46:05 -07:00
|
|
|
} else {
|
|
|
|
this.removeAttribute("notification");
|
|
|
|
}
|
|
|
|
}
|
2010-05-06 11:12:59 -07:00
|
|
|
|
2010-06-23 16:35:21 -07:00
|
|
|
this._preferencesBtn.hidden = !this.mAddon.optionsURL;
|
|
|
|
|
2010-07-29 10:35:34 -07:00
|
|
|
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);
|
2010-08-23 10:46:05 -07:00
|
|
|
} else {
|
2010-07-29 10:35:34 -07:00
|
|
|
this._removeBtn.hidden = true;
|
|
|
|
}
|
2010-05-06 11:12:59 -07:00
|
|
|
|
2010-08-23 10:46:05 -07:00
|
|
|
this.setAttribute("active", this.mAddon.isActive);
|
2010-07-19 16:01:23 -07:00
|
|
|
|
2010-08-23 10:46:05 -07:00
|
|
|
var showProgress = this.mAddon.install &&
|
|
|
|
this.mAddon.install.state != AddonManager.STATE_INSTALLED;
|
2010-07-19 16:01:23 -07:00
|
|
|
this._showStatus(showProgress ? "progress" : "none");
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-06-02 02:13:03 -07:00
|
|
|
<method name="_updateUpgradeInfo">
|
|
|
|
<body><![CDATA[
|
2010-10-06 10:17:37 -07:00
|
|
|
// Only update the version string if we're displaying the upgrade info
|
|
|
|
if (this.hasAttribute("upgrade"))
|
|
|
|
this._version.value = this.mManualUpdate.version;
|
2010-06-02 02:13:03 -07:00
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="_fetchReleaseNotes">
|
|
|
|
<parameter name="aURI"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
var self = this;
|
|
|
|
if (!aURI || this._relNotesLoaded) {
|
|
|
|
sendToggleEvent();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var relNotesData = null, transformData = null;
|
|
|
|
|
|
|
|
this._relNotesLoaded = true;
|
|
|
|
this._relNotesLoading.hidden = false;
|
|
|
|
this._relNotesError.hidden = true;
|
|
|
|
|
|
|
|
function sendToggleEvent() {
|
|
|
|
var event = document.createEvent("Events");
|
|
|
|
event.initEvent("RelNotesToggle", true, true);
|
|
|
|
self.dispatchEvent(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
function showRelNotes() {
|
|
|
|
if (!relNotesData || !transformData)
|
|
|
|
return;
|
|
|
|
|
|
|
|
self._relNotesLoading.hidden = true;
|
|
|
|
|
|
|
|
var processor = Components.classes["@mozilla.org/document-transformer;1?type=xslt"]
|
|
|
|
.createInstance(Components.interfaces.nsIXSLTProcessor);
|
|
|
|
processor.flags |= Components.interfaces.nsIXSLTProcessorPrivate.DISABLE_ALL_LOADS;
|
|
|
|
|
|
|
|
processor.importStylesheet(transformData);
|
|
|
|
var fragment = processor.transformToFragment(relNotesData, document);
|
|
|
|
self._relNotes.appendChild(fragment);
|
|
|
|
if (self.hasAttribute("show-relnotes")) {
|
|
|
|
var container = self._relNotesContainer;
|
|
|
|
container.style.height = container.scrollHeight + "px";
|
|
|
|
}
|
|
|
|
sendToggleEvent();
|
|
|
|
}
|
|
|
|
|
|
|
|
function handleError() {
|
|
|
|
dataReq.abort();
|
|
|
|
styleReq.abort();
|
|
|
|
self._relNotesLoading.hidden = true;
|
|
|
|
self._relNotesError.hidden = false;
|
|
|
|
self._relNotesLoaded = false; // allow loading to be re-tried
|
|
|
|
sendToggleEvent();
|
|
|
|
}
|
|
|
|
|
|
|
|
function handleResponse(aEvent) {
|
|
|
|
var req = aEvent.target;
|
|
|
|
if (req.responseXML &&
|
|
|
|
req.responseXML.documentElement.namespaceURI != XMLURI_PARSE_ERROR) {
|
|
|
|
if (req == dataReq)
|
|
|
|
relNotesData = req.responseXML;
|
|
|
|
else
|
|
|
|
transformData = req.responseXML;
|
|
|
|
showRelNotes();
|
|
|
|
} else {
|
|
|
|
handleError();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var dataReq = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
|
|
|
|
.createInstance(Components.interfaces.nsIXMLHttpRequest);
|
|
|
|
dataReq.open("GET", aURI.spec, true);
|
|
|
|
dataReq.addEventListener("load", handleResponse, false);
|
|
|
|
dataReq.addEventListener("error", handleError, false);
|
|
|
|
dataReq.send(null);
|
|
|
|
|
|
|
|
var styleReq = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
|
|
|
|
.createInstance(Components.interfaces.nsIXMLHttpRequest);
|
|
|
|
styleReq.open("GET", UPDATES_RELEASENOTES_TRANSFORMFILE, true);
|
|
|
|
styleReq.addEventListener("load", handleResponse, false);
|
|
|
|
styleReq.addEventListener("error", handleError, false);
|
|
|
|
styleReq.send(null);
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="toggleReleaseNotes">
|
|
|
|
<body><![CDATA[
|
|
|
|
if (this.hasAttribute("show-relnotes")) {
|
|
|
|
this._relNotesContainer.style.height = "0px";
|
|
|
|
this.removeAttribute("show-relnotes");
|
|
|
|
this._relNotesToggle.setAttribute(
|
|
|
|
"label",
|
|
|
|
this._relNotesToggle.getAttribute("showlabel")
|
|
|
|
);
|
|
|
|
this._relNotesToggle.setAttribute(
|
|
|
|
"tooltiptext",
|
|
|
|
this._relNotesToggle.getAttribute("showtooltip")
|
|
|
|
);
|
|
|
|
var event = document.createEvent("Events");
|
|
|
|
event.initEvent("RelNotesToggle", true, true);
|
|
|
|
this.dispatchEvent(event);
|
|
|
|
} else {
|
|
|
|
this._relNotesContainer.style.height = this._relNotesContainer.scrollHeight +
|
|
|
|
"px";
|
|
|
|
this.setAttribute("show-relnotes", true);
|
|
|
|
this._relNotesToggle.setAttribute(
|
|
|
|
"label",
|
|
|
|
this._relNotesToggle.getAttribute("hidelabel")
|
|
|
|
);
|
|
|
|
this._relNotesToggle.setAttribute(
|
|
|
|
"tooltiptext",
|
|
|
|
this._relNotesToggle.getAttribute("hidetooltip")
|
|
|
|
);
|
|
|
|
var uri = this.mManualUpdate ?
|
|
|
|
this.mManualUpdate.releaseNotesURI :
|
|
|
|
this.mAddon.releaseNotesURI;
|
|
|
|
this._fetchReleaseNotes(uri);
|
|
|
|
}
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-08-23 10:46:05 -07:00
|
|
|
<method name="restart">
|
|
|
|
<body><![CDATA[
|
|
|
|
gViewController.commands["cmd_restartApp"].doCommand();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="undo">
|
|
|
|
<body><![CDATA[
|
2010-09-01 09:57:48 -07:00
|
|
|
gViewController.commands["cmd_cancelOperation"].doCommand(this.mAddon);
|
2010-08-23 10:46:05 -07:00
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="uninstall">
|
|
|
|
<body><![CDATA[
|
2010-07-26 12:42:06 -07:00
|
|
|
// If uninstalling does not require a restart then just disable it
|
|
|
|
// and show the undo UI.
|
|
|
|
if (!this.opRequiresRestart("uninstall")) {
|
|
|
|
this.setAttribute("wasDisabled", this.mAddon.userDisabled);
|
2010-08-23 10:46:05 -07:00
|
|
|
|
|
|
|
// We must set userDisabled to true first, this will call
|
|
|
|
// _updateState which will clear any pending attribute set.
|
2010-07-26 12:42:06 -07:00
|
|
|
this.mAddon.userDisabled = true;
|
2010-08-23 10:46:05 -07:00
|
|
|
|
|
|
|
// This won't update any other add-on manager views (bug 582002)
|
|
|
|
this.setAttribute("pending", "uninstall");
|
2010-07-26 12:42:06 -07:00
|
|
|
} else {
|
|
|
|
this.mAddon.uninstall();
|
|
|
|
}
|
2010-08-23 10:46:05 -07:00
|
|
|
]]></body>
|
2010-05-06 11:12:59 -07:00
|
|
|
</method>
|
|
|
|
|
2010-06-23 16:35:21 -07:00
|
|
|
<method name="showPreferences">
|
|
|
|
<body><![CDATA[
|
|
|
|
gViewController.doCommand("cmd_showItemPreferences", this.mAddon);
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-06-02 02:13:03 -07:00
|
|
|
<method name="upgrade">
|
|
|
|
<body><![CDATA[
|
|
|
|
var install = this.mManualUpdate;
|
|
|
|
delete this.mManualUpdate;
|
|
|
|
install.install();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="showInDetailView">
|
|
|
|
<body><![CDATA[
|
|
|
|
gViewController.loadView("addons://detail/" +
|
|
|
|
encodeURIComponent(this.mAddon.id));
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-09-10 01:20:12 -07:00
|
|
|
<method name="onIncludeUpdateChanged">
|
|
|
|
<body><![CDATA[
|
|
|
|
var event = document.createEvent("Events");
|
|
|
|
event.initEvent("IncludeUpdateChanged", true, true);
|
|
|
|
this.dispatchEvent(event);
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="onEnabling">
|
|
|
|
<body><![CDATA[
|
|
|
|
this._updateState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onEnabled">
|
|
|
|
<body><![CDATA[
|
|
|
|
this._updateState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onDisabling">
|
|
|
|
<body><![CDATA[
|
|
|
|
this._updateState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onDisabled">
|
|
|
|
<body><![CDATA[
|
|
|
|
this._updateState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onUninstalling">
|
|
|
|
<parameter name="aRestartRequired"/>
|
|
|
|
<body><![CDATA[
|
2010-11-03 11:21:47 -07:00
|
|
|
this._updateState();
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onOperationCancelled">
|
|
|
|
<body><![CDATA[
|
|
|
|
this._updateState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onNoUpdateAvailable">
|
|
|
|
<body><![CDATA[
|
|
|
|
this._showStatus("none");
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onCheckingUpdate">
|
|
|
|
<body><![CDATA[
|
|
|
|
this._showStatus("checking-update");
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onCompatibilityUpdateAvailable">
|
|
|
|
<body><![CDATA[
|
|
|
|
this._updateState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-10-18 11:11:05 -07:00
|
|
|
<method name="onExternalInstall">
|
|
|
|
<parameter name="aAddon"/>
|
|
|
|
<parameter name="aExistingAddon"/>
|
|
|
|
<parameter name="aNeedsRestart"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
if (aExistingAddon.id != this.mAddon.id)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// If the install completed without needing a restart then switch to
|
|
|
|
// using the new Addon
|
|
|
|
if (!aNeedsRestart)
|
|
|
|
this._initWithAddon(aAddon);
|
|
|
|
else
|
|
|
|
this._updateState();
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="onNewInstall">
|
2010-06-02 02:13:03 -07:00
|
|
|
<parameter name="aInstall"/>
|
|
|
|
<body><![CDATA[
|
2010-09-13 23:56:54 -07:00
|
|
|
if (this.mAddon.applyBackgroundUpdates == AddonManager.AUTOUPDATE_ENABLE)
|
|
|
|
return;
|
|
|
|
if (this.mAddon.applyBackgroundUpdates == AddonManager.AUTOUPDATE_DEFAULT &&
|
|
|
|
AddonManager.autoUpdateDefault)
|
|
|
|
return;
|
|
|
|
|
|
|
|
this.mManualUpdate = aInstall;
|
|
|
|
this._showStatus("update-available");
|
|
|
|
this._updateUpgradeInfo();
|
2010-06-02 02:13:03 -07:00
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onDownloadStarted">
|
|
|
|
<parameter name="aInstall"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
this._showStatus("progress");
|
|
|
|
this._installStatus.initWithInstall(aInstall);
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onInstallStarted">
|
2010-05-06 11:12:59 -07:00
|
|
|
<parameter name="aInstall"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
this._showStatus("progress");
|
|
|
|
this._installStatus.initWithInstall(aInstall);
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onInstallEnded">
|
2010-10-18 11:11:05 -07:00
|
|
|
<parameter name="aInstall"/>
|
|
|
|
<parameter name="aAddon"/>
|
2010-05-06 11:12:59 -07:00
|
|
|
<body><![CDATA[
|
2010-10-18 11:11:05 -07:00
|
|
|
// If the install completed without needing a restart then switch to
|
|
|
|
// using the new Addon
|
|
|
|
if (!(aAddon.pendingOperations & AddonManager.PENDING_INSTALL))
|
|
|
|
this._initWithAddon(aAddon);
|
|
|
|
else
|
|
|
|
this._updateState();
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></body>
|
|
|
|
</method>
|
2007-03-22 10:30:00 -07:00
|
|
|
</implementation>
|
|
|
|
|
|
|
|
<handlers>
|
2010-05-06 11:12:59 -07:00
|
|
|
<handler event="click" button="0" clickcount="2"><![CDATA[
|
|
|
|
this.showInDetailView();
|
|
|
|
]]></handler>
|
2007-03-22 10:30:00 -07:00
|
|
|
</handlers>
|
|
|
|
</binding>
|
|
|
|
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<!-- Addon - uninstalled - An uninstalled addon that can be re-installed. -->
|
|
|
|
<binding id="addon-uninstalled"
|
|
|
|
extends="chrome://mozapps/content/extensions/extensions.xml#addon-base">
|
2007-03-22 10:30:00 -07:00
|
|
|
<content>
|
2010-08-23 10:46:05 -07:00
|
|
|
<xul:hbox class="pending" align="center">
|
|
|
|
<xul:image class="pending-icon"/>
|
|
|
|
<xul:label anonid="notice" flex="1"/>
|
|
|
|
<xul:button anonid="restart-btn" class="button-link"
|
|
|
|
label="&addon.restartNow.label;"
|
|
|
|
command="cmd_restartApp"/>
|
2010-05-06 11:12:59 -07:00
|
|
|
<xul:button anonid="undo-btn" class="button-link"
|
2010-09-01 10:31:12 -07:00
|
|
|
label="&addon.undoRemove.label;"
|
|
|
|
tooltiptext="&addon.undoRemove.tooltip;"
|
2010-05-06 11:12:59 -07:00
|
|
|
oncommand="document.getBindingParent(this).cancelUninstall();"/>
|
2010-08-23 10:46:05 -07:00
|
|
|
<xul:spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
|
2010-05-06 11:12:59 -07:00
|
|
|
</xul:hbox>
|
2007-03-22 10:30:00 -07:00
|
|
|
</content>
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<implementation>
|
|
|
|
<constructor><![CDATA[
|
2010-08-23 10:46:05 -07:00
|
|
|
this._notice.textContent = gStrings.ext.formatStringFromName("uninstallNotice",
|
|
|
|
[this.mAddon.name],
|
|
|
|
1);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
if (!this.isPending("uninstall"))
|
|
|
|
this._restartBtn.setAttribute("hidden", true);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
gEventManager.registerAddonListener(this, this.mAddon.id);
|
|
|
|
]]></constructor>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<destructor><![CDATA[
|
|
|
|
gEventManager.unregisterAddonListener(this, this.mAddon.id);
|
|
|
|
]]></destructor>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<field name="_notice" readonly="true">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "notice");
|
|
|
|
</field>
|
|
|
|
<field name="_restartBtn" readonly="true">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "restart-btn");
|
|
|
|
</field>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="cancelUninstall">
|
|
|
|
<body><![CDATA[
|
2010-07-26 12:42:06 -07:00
|
|
|
// This assumes that disabling does not require a restart when
|
|
|
|
// uninstalling doesn't. Things will still work if not, the add-on
|
|
|
|
// will just still be active until finally getting uninstalled.
|
|
|
|
|
|
|
|
if (this.isPending("uninstall"))
|
|
|
|
this.mAddon.cancelUninstall();
|
|
|
|
else if (this.getAttribute("wasDisabled") != "true")
|
|
|
|
this.mAddon.userDisabled = false;
|
|
|
|
|
2010-08-23 10:46:05 -07:00
|
|
|
this.removeAttribute("pending");
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></body>
|
|
|
|
</method>
|
2007-06-30 10:17:03 -07:00
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<method name="onOperationCancelled">
|
|
|
|
<body><![CDATA[
|
|
|
|
if (!this.isPending("uninstall"))
|
2010-08-23 10:46:05 -07:00
|
|
|
this.removeAttribute("pending");
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></body>
|
|
|
|
</method>
|
2010-10-18 11:11:05 -07:00
|
|
|
|
|
|
|
<method name="onExternalInstall">
|
|
|
|
<parameter name="aAddon"/>
|
|
|
|
<parameter name="aExistingAddon"/>
|
|
|
|
<parameter name="aNeedsRestart"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
if (aExistingAddon.id != this.mAddon.id)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Make sure any newly installed add-on has the correct disabled state
|
|
|
|
if (this.hasAttribute("wasDisabled"))
|
|
|
|
aAddon.userDisabled = this.getAttribute("wasDisabled") == "true";
|
|
|
|
|
|
|
|
// If the install completed without needing a restart then switch to
|
|
|
|
// using the new Addon
|
|
|
|
if (!aNeedsRestart)
|
|
|
|
this.mAddon = aAddon;
|
|
|
|
|
|
|
|
this.removeAttribute("pending");
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onInstallStarted">
|
|
|
|
<parameter name="aInstall"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
// Make sure any newly installed add-on has the correct disabled state
|
|
|
|
if (this.hasAttribute("wasDisabled"))
|
|
|
|
aInstall.addon.userDisabled = this.getAttribute("wasDisabled") == "true";
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="onInstallEnded">
|
|
|
|
<parameter name="aInstall"/>
|
|
|
|
<parameter name="aAddon"/>
|
|
|
|
<body><![CDATA[
|
|
|
|
// If the install completed without needing a restart then switch to
|
|
|
|
// using the new Addon
|
|
|
|
if (!(aAddon.pendingOperations & AddonManager.PENDING_INSTALL))
|
|
|
|
this.mAddon = aAddon;
|
|
|
|
|
|
|
|
this.removeAttribute("pending");
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2010-05-06 11:12:59 -07:00
|
|
|
</implementation>
|
2007-03-22 10:30:00 -07:00
|
|
|
</binding>
|
|
|
|
|
|
|
|
|
2010-05-06 11:12:59 -07:00
|
|
|
<!-- Addon - installing - an addon item that is currently being installed -->
|
|
|
|
<binding id="addon-installing"
|
|
|
|
extends="chrome://mozapps/content/extensions/extensions.xml#addon-base">
|
2007-03-22 10:30:00 -07:00
|
|
|
<content>
|
2010-08-23 10:46:05 -07:00
|
|
|
<xul:vbox pack="center">
|
|
|
|
<xul:vbox align="center" pack="center" class="icon-container">
|
|
|
|
<xul:image anonid="icon" class="icon"/>
|
|
|
|
</xul:vbox>
|
|
|
|
</xul:vbox>
|
2010-05-06 11:12:59 -07:00
|
|
|
<xul:label anonid="name" class="name"/>
|
|
|
|
<xul:spacer flex="1"/>
|
|
|
|
<xul:hbox anonid="install-status" class="install-status"/>
|
2008-11-02 04:13:48 -08:00
|
|
|
</content>
|
|
|
|
|
|
|
|
<implementation>
|
2010-05-06 11:12:59 -07:00
|
|
|
<constructor><![CDATA[
|
|
|
|
this._installStatus.mControl = this;
|
2010-08-23 10:46:05 -07:00
|
|
|
this._installStatus.mInstall = this.mInstall;
|
2010-05-06 11:12:59 -07:00
|
|
|
this.refreshInfo();
|
|
|
|
]]></constructor>
|
|
|
|
|
|
|
|
<field name="_icon">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "icon");
|
2010-04-29 10:37:34 -07:00
|
|
|
</field>
|
2010-05-06 11:12:59 -07:00
|
|
|
<field name="_name">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid", "name");
|
|
|
|
</field>
|
|
|
|
<field name="_installStatus">
|
|
|
|
document.getAnonymousElementByAttribute(this, "anonid",
|
|
|
|
"install-status");
|
|
|
|
</field>
|
|
|
|
|
|
|
|
<method name="onInstallCompleted">
|
|
|
|
<body><![CDATA[
|
2010-08-23 10:46:05 -07:00
|
|
|
this.mAddon = this.mInstall.addon;
|
|
|
|
this.setAttribute("name", this.mAddon.name);
|
2010-09-28 10:29:24 -07:00
|
|
|
this.setAttribute("value", this.mAddon.id);
|
2010-08-23 10:46:05 -07:00
|
|
|
this.setAttribute("status", "installed");
|
2010-05-06 11:12:59 -07:00
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="refreshInfo">
|
|
|
|
<body><![CDATA[
|
|
|
|
this.mAddon = this.mAddon || this.mInstall.addon;
|
|
|
|
if (this.mAddon) {
|
2010-06-02 02:13:03 -07:00
|
|
|
this._icon.src = this.mAddon.iconURL ||
|
|
|
|
(this.mInstall ? this.mInstall.iconURL : "");
|
2010-05-06 11:12:59 -07:00
|
|
|
this._name.value = this.mAddon.name;
|
|
|
|
} else {
|
|
|
|
this._icon.src = this.mInstall.iconURL;
|
|
|
|
// AddonInstall.name isn't always available - fallback to filename
|
|
|
|
if (this.mInstall.name) {
|
|
|
|
this._name.value = this.mInstall.name;
|
|
|
|
} else {
|
|
|
|
var url = Components.classes["@mozilla.org/network/standard-url;1"]
|
|
|
|
.createInstance(Components.interfaces.nsIStandardURL);
|
2010-07-01 20:36:50 -07:00
|
|
|
url.init(url.URLTYPE_STANDARD, 80, this.mInstall.sourceURI.spec,
|
2010-05-06 11:12:59 -07:00
|
|
|
null, null);
|
|
|
|
url.QueryInterface(Components.interfaces.nsIURL);
|
|
|
|
this._name.value = url.fileName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]]></body>
|
|
|
|
</method>
|
2008-11-02 04:13:48 -08:00
|
|
|
</implementation>
|
|
|
|
</binding>
|
|
|
|
|
2010-09-01 09:57:48 -07:00
|
|
|
<binding id="detail-row">
|
|
|
|
<content>
|
|
|
|
<xul:label class="detail-row-label" xbl:inherits="value=label"/>
|
|
|
|
<xul:label class="detail-row-value" xbl:inherits="value"/>
|
|
|
|
</content>
|
|
|
|
|
|
|
|
<implementation>
|
|
|
|
<property name="value">
|
|
|
|
<getter><![CDATA[
|
|
|
|
return this.getAttribute("value");
|
|
|
|
]]></getter>
|
|
|
|
<setter><![CDATA[
|
|
|
|
if (!val)
|
|
|
|
this.removeAttribute("value");
|
|
|
|
else
|
|
|
|
this.setAttribute("value", val);
|
|
|
|
]]></setter>
|
|
|
|
</property>
|
|
|
|
</implementation>
|
|
|
|
</binding>
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
</bindings>
|