Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 <?xml version="1.0"?>
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/. -->
7 <!DOCTYPE bindings [
8 <!ENTITY % checkboxDTD SYSTEM "chrome://browser/locale/checkbox.dtd">
9 %checkboxDTD;
10 ]>
12 <bindings
13 xmlns="http://www.mozilla.org/xbl"
14 xmlns:xbl="http://www.mozilla.org/xbl"
15 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
17 <binding id="checkbox-radio" display="xul:box" extends="chrome://global/content/bindings/checkbox.xml#checkbox-baseline">
18 <content>
19 <xul:radiogroup anonid="group" xbl:inherits="disabled">
20 <xul:radio anonid="on" class="checkbox-radio-on" label="&checkbox.yes.label;" xbl:inherits="label=onlabel"/>
21 <xul:radio anonid="off" class="checkbox-radio-off" label="&checkbox.no.label;" xbl:inherits="label=offlabel"/>
22 </xul:radiogroup>
23 </content>
24 <implementation>
25 <constructor><![CDATA[
26 this.setChecked(this.checked);
27 ]]></constructor>
29 <field name="_group">
30 document.getAnonymousElementByAttribute(this, "anonid", "group");
31 </field>
33 <field name="_on">
34 document.getAnonymousElementByAttribute(this, "anonid", "on");
35 </field>
37 <field name="_off">
38 document.getAnonymousElementByAttribute(this, "anonid", "off");
39 </field>
41 <property name="onlabel"
42 onget="return this._on.label"
43 onset="this._on.label=val"/>
45 <property name="offlabel"
46 onget="return this._off.label"
47 onset="this._off.label=val"/>
49 <method name="setChecked">
50 <parameter name="aValue"/>
51 <body>
52 <![CDATA[
53 var change = (aValue != this.checked);
54 if (aValue) {
55 this.setAttribute("checked", "true");
56 this._group.selectedItem = this._on;
57 }
58 else {
59 this.removeAttribute("checked");
60 this._group.selectedItem = this._off;
61 }
63 if (change) {
64 var event = document.createEvent("Events");
65 event.initEvent("CheckboxStateChange", true, true);
66 this.dispatchEvent(event);
67 }
68 return aValue;
69 ]]>
70 </body>
71 </method>
72 </implementation>
73 </binding>
75 </bindings>