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