!import
1 <?xml version="1.0"?>
2
3
4 <!DOCTYPE bindings [
5 <!ENTITY % downloadDTD SYSTEM "chrome://mozapps/locale/downloads/downloads.dtd" >
6 %downloadDTD;
7 ]>
8
9 <bindings id="downloadBindings"
10 xmlns="http://www.mozilla.org/xbl"
11 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
12 xmlns:xbl="http://www.mozilla.org/xbl">
13
14 <binding id="download-base" extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
15 <resources>
16 <stylesheet src="chrome://mozapps/skin/downloads/downloads.css"/>
17 </resources>
18 <implementation>
19 <property name="paused">
get_paused
20 <getter>
21 <![CDATA[
22 return parseInt(this.getAttribute("state")) == Components.interfaces.nsIDownloadManager.DOWNLOAD_PAUSED;
23 ]]>
24 </getter>
25 </property>
26 <property name="openable">
get_openable
27 <getter>
28 <![CDATA[
29 return parseInt(this.getAttribute("state")) == Components.interfaces.nsIDownloadManager.DOWNLOAD_FINISHED;
30 ]]>
31 </getter>
32 </property>
33 <property name="inProgress">
get_inProgress
34 <getter>
35 <![CDATA[
36 var state = parseInt(this.getAttribute("state"));
37 const dl = Components.interfaces.nsIDownloadManager;
38 return state == dl.DOWNLOAD_NOTSTARTED ||
39 state == dl.DOWNLOAD_QUEUED ||
40 state == dl.DOWNLOAD_DOWNLOADING ||
41 state == dl.DOWNLOAD_PAUSED ||
42 state == dl.DOWNLOAD_SCANNING;
43 ]]>
44 </getter>
45 </property>
46 <property name="removable">
get_removable
47 <getter>
48 <![CDATA[
49 var state = parseInt(this.getAttribute("state"));
50 const dl = Components.interfaces.nsIDownloadManager;
51 return state == dl.DOWNLOAD_FINISHED ||
52 state == dl.DOWNLOAD_CANCELED ||
53 state == dl.DOWNLOAD_BLOCKED_PARENTAL ||
54 state == dl.DOWNLOAD_BLOCKED_POLICY ||
55 state == dl.DOWNLOAD_DIRTY ||
56 state == dl.DOWNLOAD_FAILED;
57 ]]>
58 </getter>
59 </property>
60 <property name="buttons">
get_buttons
61 <getter>
62 <![CDATA[
63 var startEl = document.getAnonymousNodes(this);
64 if (!startEl.length)
65 startEl = [this];
66
67 const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
68 return startEl[0].getElementsByTagNameNS(XULNS, "button");
69 ]]>
70 </getter>
71 </property>
72 </implementation>
73 </binding>
74
75 <binding id="download-starting" extends="chrome://mozapps/content/downloads/download.xml#download-base">
76 <content>
77 <xul:hbox flex="1">
78 <xul:vbox pack="center">
79 <xul:image class="downloadTypeIcon" validate="always"
80 xbl:inherits="src=image"/>
81 </xul:vbox>
82 <xul:vbox pack="start" flex="1">
83 <xul:label xbl:inherits="value=target,tooltiptext=target"
84 crop="center" class="name"/>
85 <xul:progressmeter mode="normal" value="0" flex="1"
86 anonid="progressmeter"/>
87 <xul:label value="&starting.label;" class="status"/>
88 <xul:spacer flex="1"/>
89 </xul:vbox>
90 <xul:vbox pack="center">
91 <xul:button class="cancel mini-button" tooltiptext="&cmd.cancel.label;"
92 cmd="cmd_cancel" ondblclick="event.stopPropagation();"
93 oncommand="performCommand('cmd_cancel', this);"/>
94 </xul:vbox>
95 </xul:hbox>
96 </content>
97 </binding>
98
99 <binding id="download-downloading" extends="chrome://mozapps/content/downloads/download.xml#download-base">
100 <content>
101 <xul:hbox flex="1" class="downloadContentBox">
102 <xul:vbox pack="center">
103 <xul:image class="downloadTypeIcon" validate="always"
104 xbl:inherits="src=image"/>
105 </xul:vbox>
106 <xul:vbox flex="1">
107 <xul:label xbl:inherits="value=target,tooltiptext=target"
108 crop="center" flex="2" class="name"/>
109 <xul:hbox>
110 <xul:vbox flex="1">
111 <xul:progressmeter mode="normal" value="0" flex="1"
112 anonid="progressmeter"
113 xbl:inherits="value=progress,mode=progressmode"/>
114 </xul:vbox>
115 <xul:button class="pause mini-button" tooltiptext="&cmd.pause.label;"
116 cmd="cmd_pause" ondblclick="event.stopPropagation();"
117 oncommand="performCommand('cmd_pause', this);"/>
118 <xul:button class="cancel mini-button" tooltiptext="&cmd.cancel.label;"
119 cmd="cmd_cancel" ondblclick="event.stopPropagation();"
120 oncommand="performCommand('cmd_cancel', this);"/>
121 </xul:hbox>
122 <xul:label xbl:inherits="value=status,tooltiptext=statusTip" flex="1"
123 crop="right" class="status"/>
124 <xul:spacer flex="1"/>
125 </xul:vbox>
126 </xul:hbox>
127 </content>
128 </binding>
129
130 <binding id="download-paused" extends="chrome://mozapps/content/downloads/download.xml#download-base">
131 <content>
132 <xul:hbox flex="1">
133 <xul:vbox pack="center">
134 <xul:image class="downloadTypeIcon" validate="always"
135 xbl:inherits="src=image"/>
136 </xul:vbox>
137 <xul:vbox flex="1">
138 <xul:label xbl:inherits="value=target,tooltiptext=target"
139 crop="center" flex="2" class="name"/>
140 <xul:hbox>
141 <xul:vbox flex="1">
142 <xul:progressmeter mode="normal" value="0" flex="1"
143 anonid="progressmeter"
144 xbl:inherits="value=progress,mode=progressmode"/>
145 </xul:vbox>
146 <xul:button class="resume mini-button" tooltiptext="&cmd.resume.label;"
147 cmd="cmd_resume" ondblclick="event.stopPropagation();"
148 oncommand="performCommand('cmd_resume', this);"/>
149 <xul:button class="cancel mini-button" tooltiptext="&cmd.cancel.label;"
150 cmd="cmd_cancel" ondblclick="event.stopPropagation();"
151 oncommand="performCommand('cmd_cancel', this);"/>
152 </xul:hbox>
153 <xul:label xbl:inherits="value=status,tooltiptext=statusTip" flex="1"
154 crop="right" class="status"/>
155 <xul:spacer flex="1"/>
156 </xul:vbox>
157 </xul:hbox>
158 </content>
159 </binding>
160
161 <binding id="download-done" extends="chrome://mozapps/content/downloads/download.xml#download-base">
162 <content>
163 <xul:hbox flex="1">
164 <xul:vbox pack="center">
165 <xul:image class="downloadTypeIcon" validate="always"
166 xbl:inherits="src=image"/>
167 </xul:vbox>
168 <xul:vbox pack="start" flex="1">
169 <xul:hbox align="center" flex="1">
170 <xul:label xbl:inherits="value=target,tooltiptext=target"
171 crop="center" flex="1" class="name"/>
172 <xul:label xbl:inherits="value=dateTime,tooltiptext=dateTimeTip"
173 class="dateTime"/>
174 </xul:hbox>
175 <xul:hbox align="center" flex="1">
176 <xul:label xbl:inherits="value=status,tooltiptext=statusTip"
177 crop="end" flex="1" class="status"/>
178 </xul:hbox>
179 </xul:vbox>
180 </xul:hbox>
181 </content>
182 </binding>
183
184 <binding id="download-canceled" extends="chrome://mozapps/content/downloads/download.xml#download-base">
185 <content>
186 <xul:hbox flex="1">
187 <xul:vbox pack="center">
188 <xul:image class="downloadTypeIcon" validate="always"
189 xbl:inherits="src=image"/>
190 </xul:vbox>
191 <xul:vbox pack="start" flex="1">
192 <xul:hbox align="center" flex="1">
193 <xul:label xbl:inherits="value=target,tooltiptext=target"
194 crop="center" flex="1" class="name"/>
195 <xul:label xbl:inherits="value=dateTime,tooltiptext=dateTimeTip"
196 class="dateTime"/>
197 </xul:hbox>
198 <xul:hbox align="center" flex="1">
199 <xul:label xbl:inherits="value=status,tooltiptext=statusTip"
200 crop="end" flex="1" class="status"/>
201 <xul:button class="retry mini-button" tooltiptext="&cmd.retry.label;"
202 cmd="cmd_retry" ondblclick="event.stopPropagation();"
203 oncommand="performCommand('cmd_retry', this);"/>
204 </xul:hbox>
205 </xul:vbox>
206 </xul:hbox>
207 </content>
208 </binding>
209
210 <binding id="download-failed" extends="chrome://mozapps/content/downloads/download.xml#download-base">
211 <content>
212 <xul:hbox flex="1">
213 <xul:vbox pack="center">
214 <xul:image class="downloadTypeIcon" validate="always"
215 xbl:inherits="src=image"/>
216 </xul:vbox>
217 <xul:vbox pack="start" flex="1">
218 <xul:hbox align="center" flex="1">
219 <xul:label xbl:inherits="value=target,tooltiptext=target"
220 crop="center" flex="1" class="name"/>
221 <xul:label xbl:inherits="value=dateTime,tooltiptext=dateTimeTip"
222 class="dateTime"/>
223 </xul:hbox>
224 <xul:hbox align="center" flex="1">
225 <xul:label xbl:inherits="value=status,tooltiptext=statusTip"
226 crop="end" flex="1" class="status"/>
227 <xul:button class="retry mini-button" tooltiptext="&cmd.retry.label;"
228 cmd="cmd_retry" ondblclick="event.stopPropagation();"
229 oncommand="performCommand('cmd_retry', this);"/>
230 </xul:hbox>
231 </xul:vbox>
232 </xul:hbox>
233 </content>
234 </binding>
235
236 <binding id="download-blocked-parental" extends="chrome://mozapps/content/downloads/download.xml#download-base">
237 <content>
238 <xul:hbox flex="1">
239 <xul:vbox pack="center">
240 <xul:image class="downloadTypeIcon blockedIcon"/>
241 </xul:vbox>
242 <xul:vbox pack="start" flex="1">
243 <xul:hbox align="center" flex="1">
244 <xul:label xbl:inherits="value=target,tooltiptext=target"
245 crop="center" flex="1" class="name"/>
246 <xul:label xbl:inherits="value=dateTime,tooltiptext=dateTimeTip"
247 class="dateTime"/>
248 </xul:hbox>
249 <xul:hbox align="center" flex="1">
250 <xul:label xbl:inherits="value=status,tooltiptext=statusTip"
251 crop="end" flex="1" class="status"/>
252 </xul:hbox>
253 </xul:vbox>
254 </xul:hbox>
255 </content>
256 </binding>
257
258 <binding id="download-blocked-policy" extends="chrome://mozapps/content/downloads/download.xml#download-base">
259 <content>
260 <xul:hbox flex="1">
261 <xul:vbox pack="center">
262 <xul:image class="downloadTypeIcon blockedIcon"/>
263 </xul:vbox>
264 <xul:vbox pack="start" flex="1">
265 <xul:hbox align="center" flex="1">
266 <xul:label xbl:inherits="value=target,tooltiptext=target"
267 crop="center" flex="1" class="name"/>
268 <xul:label xbl:inherits="value=dateTime,tooltiptext=dateTimeTip"
269 class="dateTime"/>
270 </xul:hbox>
271 <xul:hbox align="center" flex="1">
272 <xul:label xbl:inherits="value=status,tooltiptext=statusTip"
273 crop="end" flex="1" class="status"/>
274 </xul:hbox>
275 </xul:vbox>
276 </xul:hbox>
277 </content>
278 </binding>
279
280 <binding id="download-scanning" extends="chrome://mozapps/content/downloads/download.xml#download-base">
281 <content>
282 <xul:hbox flex="1">
283 <xul:vbox pack="center">
284 <xul:image class="downloadTypeIcon" validate="always"
285 xbl:inherits="src=image"/>
286 </xul:vbox>
287 <xul:vbox pack="start" flex="1">
288 <xul:label xbl:inherits="value=target,tooltiptext=target"
289 crop="center" flex="2" class="name"/>
290 <xul:hbox>
291 <xul:vbox flex="1">
292 <xul:progressmeter mode="undetermined" flex="1" />
293 </xul:vbox>
294 </xul:hbox>
295 <xul:label value="&scanning.label;" class="status"/>
296 <xul:spacer flex="1"/>
297 </xul:vbox>
298 </xul:hbox>
299 </content>
300 </binding>
301
302 <binding id="download-dirty" extends="chrome://mozapps/content/downloads/download.xml#download-base">
303 <content>
304 <xul:hbox flex="1">
305 <xul:vbox pack="center">
306 <xul:image class="downloadTypeIcon blockedIcon"/>
307 </xul:vbox>
308 <xul:vbox pack="start" flex="1">
309 <xul:hbox align="center" flex="1">
310 <xul:label xbl:inherits="value=target,tooltiptext=target"
311 crop="center" flex="1" class="name"/>
312 <xul:label xbl:inherits="value=dateTime,tooltiptext=dateTimeTip"
313 class="dateTime"/>
314 </xul:hbox>
315 <xul:hbox align="center" flex="1">
316 <xul:label xbl:inherits="value=status,tooltiptext=statusTip"
317 crop="end" flex="1" class="status"/>
318 </xul:hbox>
319 </xul:vbox>
320 </xul:hbox>
321 </content>
322 </binding>
323
324 </bindings>