mirror of
https://github.com/rn10950/RetroZilla.git
synced 2024-11-15 04:00:12 +01:00
225 lines
7.4 KiB
XML
225 lines
7.4 KiB
XML
|
<?xml version="1.0"?>
|
||
|
|
||
|
<!-- ***** BEGIN LICENSE BLOCK *****
|
||
|
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||
|
-
|
||
|
- The contents of this file are subject to the Mozilla Public License Version
|
||
|
- 1.1 (the "License"); you may not use this file except in compliance with
|
||
|
- the License. You may obtain a copy of the License at
|
||
|
- http://www.mozilla.org/MPL/
|
||
|
-
|
||
|
- Software distributed under the License is distributed on an "AS IS" basis,
|
||
|
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||
|
- for the specific language governing rights and limitations under the
|
||
|
- License.
|
||
|
-
|
||
|
- The Original Code is Mozilla XForms support.
|
||
|
-
|
||
|
- The Initial Developer of the Original Code is
|
||
|
- IBM Corporation.
|
||
|
- Portions created by the Initial Developer are Copyright (C) 2005
|
||
|
- the Initial Developer. All Rights Reserved.
|
||
|
-
|
||
|
- Contributor(s):
|
||
|
- Doron Rosenberg <doronr@us.ibm.com>
|
||
|
- Olli Pettay <Olli.Pettay@helsinki.fi>
|
||
|
- Alexander Surkov <surkov@dc.baikal.ru>
|
||
|
-
|
||
|
- Alternatively, the contents of this file may be used under the terms of
|
||
|
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||
|
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||
|
- in which case the provisions of the GPL or the LGPL are applicable instead
|
||
|
- of those above. If you wish to allow use of your version of this file only
|
||
|
- under the terms of either the GPL or the LGPL, and not to allow others to
|
||
|
- use your version of this file under the terms of the MPL, indicate your
|
||
|
- decision by deleting the provisions above and replace them with the notice
|
||
|
- and other provisions required by the GPL or the LGPL. If you do not delete
|
||
|
- the provisions above, a recipient may use your version of this file under
|
||
|
- the terms of any one of the MPL, the GPL or the LGPL.
|
||
|
-
|
||
|
- ***** END LICENSE BLOCK ***** -->
|
||
|
|
||
|
<!-- SELECT CONTROLS FOR XHTML
|
||
|
This file contains xforms select controls implementations for XHTML.
|
||
|
-->
|
||
|
|
||
|
|
||
|
<bindings id="xformsSelectBindingsForXHTML"
|
||
|
xmlns="http://www.mozilla.org/xbl"
|
||
|
xmlns:html="http://www.w3.org/1999/xhtml"
|
||
|
xmlns:xbl="http://www.mozilla.org/xbl"
|
||
|
xmlns:xforms="http://www.w3.org/2002/xforms"
|
||
|
xmlns:mozType="http://www.mozilla.org/projects/xforms/2005/type">
|
||
|
|
||
|
|
||
|
<!-- SELECT/SELECT1 CONTROLS
|
||
|
The section contains xforms select/select1 controls implementations for XHTML.
|
||
|
All controls are inherited from interface bindings realized in select.xml.
|
||
|
|
||
|
XXX: select of minimal appearance is not implemented (see bug 332928).
|
||
|
|
||
|
select1 of minimal appearance is implemented in select1.xml file.
|
||
|
select/select1 of appearance="full" is implemented in selects-xhtml.xml file.
|
||
|
-->
|
||
|
|
||
|
<!-- SELECT APPEARANCE='COMPACT' : <DEFAULT> -->
|
||
|
<binding id="xformswidget-select-compact"
|
||
|
extends="chrome://xforms/content/select.xml#xformswidget-select-base">
|
||
|
<content>
|
||
|
<html:span class="label-container">
|
||
|
<children includes="label"/>
|
||
|
</html:span>
|
||
|
<html:span anonid="control"
|
||
|
xbl:inherits="style, accesskey, mozType:tabindex=tabindex"/>
|
||
|
<children/>
|
||
|
</content>
|
||
|
</binding>
|
||
|
|
||
|
<!-- SELECT1 APPEARANCE='COMPACT' : <DEFAULT> -->
|
||
|
<binding id="xformswidget-select1-compact"
|
||
|
extends="chrome://xforms/content/select.xml#xformswidget-select1-base">
|
||
|
<content>
|
||
|
<html:label>
|
||
|
<html:span class="label-container">
|
||
|
<children includes="label"/>
|
||
|
</html:span>
|
||
|
<html:span anonid="control"
|
||
|
xbl:inherits="style, accesskey, mozType:tabindex=tabindex"/>
|
||
|
<children/>
|
||
|
</html:label>
|
||
|
</content>
|
||
|
</binding>
|
||
|
|
||
|
|
||
|
<!-- CONTROL WIDGETS FOR SELECT/SELECT1 CONTROLS
|
||
|
All control widgets are underlying controls for select/select1 and serve to
|
||
|
realize functionality needed for select/select1 work in XHTML context. Thease
|
||
|
widgets are inherited from 'controlwidget-base' binding and implement the
|
||
|
interface what base widget for xforms select/select1 controls ask for. You can
|
||
|
find interface description in 'select.xml' file.
|
||
|
-->
|
||
|
|
||
|
|
||
|
<!-- CONTROL WIDGETS FOR SELECT CONTROLS
|
||
|
The section contains underlying widgets implementations needed for select
|
||
|
controls.
|
||
|
-->
|
||
|
|
||
|
<!-- CONTROL WIDGET FOR SELECT APPEARANCE='COMPACT' -->
|
||
|
<binding id="controlwidget-select-compact"
|
||
|
extends="chrome://xforms/content/select.xml#controlwidget-base">
|
||
|
|
||
|
<content>
|
||
|
<html:select xbl:inherits="style, accesskey, disabled=readonly, tabindex=mozType:tabindex"
|
||
|
class="xf-value" multiple="true" size="5" anonid="control"/>
|
||
|
</content>
|
||
|
|
||
|
<implementation>
|
||
|
<method name="removeAllItems">
|
||
|
<body>
|
||
|
for (var i = this.control.childNodes.length; i > 0; i--) {
|
||
|
this.control.removeChild(this.control.childNodes[i-1]);
|
||
|
}
|
||
|
</body>
|
||
|
</method>
|
||
|
|
||
|
<method name="appendItem">
|
||
|
<parameter name="aLabel"/>
|
||
|
<parameter name="aValue"/>
|
||
|
<parameter name="aGroup"/>
|
||
|
<body>
|
||
|
var item = document.createElementNS(this.XHTML_NS, "option");
|
||
|
item.setAttribute("value", aValue);
|
||
|
|
||
|
if (aLabel) {
|
||
|
item.appendChild(aLabel.cloneNode(true));
|
||
|
}
|
||
|
|
||
|
if (aGroup) {
|
||
|
aGroup.appendChild(item);
|
||
|
} else {
|
||
|
this.control.appendChild(item);
|
||
|
}
|
||
|
return item;
|
||
|
</body>
|
||
|
</method>
|
||
|
|
||
|
<method name="appendGroup">
|
||
|
<parameter name="aLabel"/>
|
||
|
<parameter name="aGroup"/>
|
||
|
<body>
|
||
|
var item = document.createElementNS(this.XHTML_NS, "optgroup");
|
||
|
if (aLabel) {
|
||
|
item.appendChild(aLabel.cloneNode(true));
|
||
|
}
|
||
|
if (aGroup) {
|
||
|
aGroup.appendChild(item);
|
||
|
} else {
|
||
|
this.control.appendChild(item);
|
||
|
}
|
||
|
return item;
|
||
|
</body>
|
||
|
</method>
|
||
|
|
||
|
<method name="addItemToSelection">
|
||
|
<parameter name="aItem"/>
|
||
|
<body>
|
||
|
aItem.selected = true;
|
||
|
</body>
|
||
|
</method>
|
||
|
|
||
|
<method name="removeItemFromSelection">
|
||
|
<parameter name="aItem"/>
|
||
|
<body>
|
||
|
aItem.selected = false;
|
||
|
</body>
|
||
|
</method>
|
||
|
|
||
|
<method name="isItemSelected">
|
||
|
<parameter name="aItem"/>
|
||
|
<body>
|
||
|
return aItem.selected;
|
||
|
</body>
|
||
|
</method>
|
||
|
</implementation>
|
||
|
|
||
|
<handlers>
|
||
|
<handler event="focus" phase="capturing">
|
||
|
this.dispatchDOMUIEvent("DOMFocusIn");
|
||
|
</handler>
|
||
|
|
||
|
<handler event="blur" phase="capturing">
|
||
|
this.updateInstanceData(false);
|
||
|
this.dispatchDOMUIEvent("DOMFocusOut");
|
||
|
</handler>
|
||
|
|
||
|
<handler event="change">
|
||
|
this.updateInstanceData(true);
|
||
|
</handler>
|
||
|
|
||
|
<!--
|
||
|
XXX: since xforms:label can include arbitrary elements then 'focus',
|
||
|
'blur' and 'change' events should be listen from 'xhtml:select'
|
||
|
element only.
|
||
|
-->
|
||
|
</handlers>
|
||
|
</binding>
|
||
|
|
||
|
|
||
|
<!-- CONTROL WIDGETS FOR SELECT1 CONTROLS
|
||
|
The section contains underlying widgets implementations needed for select1
|
||
|
controls.
|
||
|
-->
|
||
|
|
||
|
<!-- CONTROL WIDGET FOR SELECT1 APPEARANCE='COMPACT' -->
|
||
|
<binding id="controlwidget-select1-compact"
|
||
|
extends="#controlwidget-select-compact">
|
||
|
<content>
|
||
|
<html:select xbl:inherits="style, accesskey, disabled=readonly, tabindex=mozType:tabindex"
|
||
|
class="xf-value" size="5" anonid="control"/>
|
||
|
</content>
|
||
|
</binding>
|
||
|
|
||
|
</bindings>
|
||
|
|