Source code

Revision control

Other Tools

1
<?xml version="1.0"?>
2
<!-- This Source Code Form is subject to the terms of the Mozilla Public
3
- License, v. 2.0. If a copy of the MPL was not distributed with this
4
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
5
6
7
<!DOCTYPE page [
8
<!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd">
9
%extensionsDTD;
10
]>
11
12
<!-- import-globals-from extensions.js -->
13
14
<bindings id="addonBindings"
18
xmlns:html="http://www.w3.org/1999/xhtml">
19
20
21
<!-- Category item - an item in the category list. -->
22
<binding id="category"
24
<content align="center">
25
<xul:image anonid="icon" class="category-icon"/>
26
<xul:label anonid="name" class="category-name" crop="end" flex="1" xbl:inherits="value=name"/>
27
<xul:label anonid="badge" class="category-badge" xbl:inherits="value=count"/>
28
</content>
29
30
<implementation>
31
<constructor><![CDATA[
32
if (!this.hasAttribute("count"))
33
this.setAttribute("count", 0);
34
]]></constructor>
35
36
<property name="badgeCount">
37
<getter><![CDATA[
38
return this.getAttribute("count");
39
]]></getter>
40
<setter><![CDATA[
41
if (this.getAttribute("count") == val)
42
return;
43
44
this.setAttribute("count", val);
45
var event = document.createEvent("Events");
46
event.initEvent("CategoryBadgeUpdated", true, true);
47
this.dispatchEvent(event);
48
]]></setter>
49
</property>
50
</implementation>
51
</binding>
52
</bindings>