!import
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
1 <?xml version="1.0"?>
2
3 <bindings id="progressmeterBindings"
4 xmlns="http://www.mozilla.org/xbl"
5 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
6 xmlns:xbl="http://www.mozilla.org/xbl">
7
8 <binding id="progressmeter">
9 <resources>
10 <stylesheet src="chrome://global/skin/progressmeter.css"/>
11 </resources>
12
13 <content>
14 <xul:spacer class="progress-bar" xbl:inherits="mode"/>
15 <xul:spacer class="progress-remainder" xbl:inherits="mode"/>
16 </content>
17
18 <implementation implements="nsIAccessibleProvider">
get_mode
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
set_mode
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
19 <property name="mode" onset="if (this.mode != val) this.setAttribute('mode', val); return val;"
20 onget="return this.getAttribute('mode');"/>
21
get_value
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
22 <property name="value" onget="return this.getAttribute('value') || '0';">
set_value
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
23 <setter><![CDATA[
24 var p = Math.round(val);
25 if (p < 0)
26 p = 0;
27 else if (p > 100)
28 p = 100;
29 var c = this.value;
30 if (p != c) {
31 var delta = p - c;
32 if (delta < 0)
33 delta = -delta;
34 if (delta > 3 || p == 0 || p == 100) {
35 this.setAttribute("value", p);
36 // Fire DOM event so that accessible value change events occur
37 var event = document.createEvent('Events');
38 event.initEvent('ValueChange', true, true);
39 this.dispatchEvent(event);
40 }
41 }
42
43 return val;
44 ]]></setter>
45 </property>
46
47 <property name="accessibleType" readonly="true">
get_accessibleType
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
48 <getter>
49 <![CDATA[
50 return Components.interfaces.nsIAccessibleProvider.XULProgressMeter;
51 ]]>
52 </getter>
53 </property>
54 </implementation>
55 </binding>
56
57 <binding id="progressmeter-undetermined"
58 extends="chrome://global/content/bindings/progressmeter.xml#progressmeter">
59 <content>
60 <xul:stack class="progress-remainder" flex="1" anonid="stack" style="overflow: -moz-hidden-unscrollable;">
61 <xul:spacer class="progress-bar" anonid="spacer" top="0" style="margin-right: -1000px;"/>
62 </xul:stack>
63 </content>
64
65 <implementation>
66 <method name="_init">
_init
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
67 <body><![CDATA[
68 var stack = document.getAnonymousElementByAttribute(this, "anonid", "stack");
69 var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");
70
71 var isLTR =
72 document.defaultView.getComputedStyle(this, null).direction == "ltr";
73
74 var position = isLTR ? 4 : -1;
nextStep
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
75 var interval = setInterval(function nextStep() {
76 try {
77 var width = stack.boxObject.width;
78 if (!width) {
79 // Maybe we've been removed from the document.
80 var currentNode = stack;
81 while (currentNode && currentNode != stack.ownerDocument) {
82 currentNode = currentNode.parentNode;
83 }
84 if (!currentNode) {
85 clearInterval(interval);
86 return;
87 }
88 }
89 width = width >> 2;
90 spacer.height = stack.boxObject.height;
91 spacer.width = width;
92 spacer.left = width * position;
93 if (isLTR) {
94 position += 15 / (width + 150);
95 if (position >= 4)
96 position = -1;
97 }
98 else {
99 position -= 15 / (width + 150);
100 if (position < 0)
101 position = 4;
102 }
103 } catch (e) {
104 clearInterval(interval);
105 }
106 }, 20);
107 ]]></body>
108 </method>
109
constructor
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
110 <constructor>this._init();</constructor>
111 </implementation>
112 </binding>
113
114 <binding id="progressmeter-periodic-redraw"
115 extends="chrome://global/content/bindings/progressmeter.xml#progressmeter">
116 <implementation>
117 <method name="_init">
_init
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
118 <body><![CDATA[
119 var step = 0;
120 var self = this;
nextStep
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
121 var interval = setInterval(function nextStep() {
122 try {
123 // Trigger redraw by changing the step attribute
124 step = (step + 1) % 2;
125 self.setAttribute('step', step);
126 } catch (e) {
127 clearInterval(interval);
128 }
129 }, 1000/30);
130 ]]></body>
131 </method>
constructor
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
132 <constructor>this._init();</constructor>
133 </implementation>
134 </binding>
135
136 </bindings>