-
Notifications
You must be signed in to change notification settings - Fork 220
/
button.xbl
78 lines (74 loc) · 4.38 KB
/
button.xbl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 Orbeon, Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU Lesser General Public License as published by the Free Software Foundation; either version
2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
-->
<xbl:xbl xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:xbl="http://www.w3.org/ns/xbl"
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
script-type="application/xhtml+xml">
<xbl:script type="text/javascript" src="/ops/yui/element/element-min.js"/>
<xbl:script type="text/javascript" src="/ops/yui/button/button-min.js"/>
<xbl:script type="text/javascript" src="/xbl/orbeon/button/button.js"/>
<xbl:binding id="fr-button" element="fr|button">
<xbl:resources>
<xbl:style src="/ops/yui/button/assets/skins/sam/button.css"/>
<xbl:style>
.xbl-fr-button { display: inline }
.xbl-fr-button .yui-button {
display: -moz-inline-box;
display: inline-block;
*zoom: 1;
*display: inline;
vertical-align: middle;
<!-- The following fixes:
[ #315153 ] IE 6/7: fr:button border is cut when in table with cellpadding="0"
http://forge.ow2.org/tracker/index.php?func=detail&aid=315153&group_id=168&atid=350207
This issue cannot be reproduced on IE8 in IE7 mode.
We only want to override the margin-bottom here, not other margins declared in button.css. -->
*margin-bottom: 1px;
}
</xbl:style>
</xbl:resources>
<xbl:template xxbl:transform="oxf:unsafe-xslt">
<!-- Group has complete single-node binding -->
<xforms:group class="yui-button yui-push-button{if (/fr:button/@class) then concat(' ', /fr:button/@class) else ''}"
xbl:attr="model context ref bind" xxbl:scope="outer" xsl:version="2.0">
<xhtml:span class="first-child">
<xsl:variable name="tabindex" select="/fr:button/@tabindex"/>
<xsl:if test="/fr:button/@tabindex">
<xhtml:span class="fr-button-tabindex" style="display: none">
<xsl:value-of select="/fr:button/@tabindex"/>
</xhtml:span>
</xsl:if>
<!-- Bind trigger so it can handle read-only -->
<xforms:trigger xbl:attr="xxforms:modal">
<xsl:if test="exists(/fr:button/(@ref, @bind))">
<xsl:attribute name="ref">.</xsl:attribute>
</xsl:if>
<xbl:content includes="xforms|label, xforms|help, xforms|hint"/>
<xxforms:script ev:event="xforms-enabled xxforms-iteration-moved" ev:target="#observer">YAHOO.xbl.fr.Button.instance(this).enabled();</xxforms:script>
<xxforms:script ev:event="xforms-readonly" ev:target="#observer">YAHOO.xbl.fr.Button.instance(this).readonly();</xxforms:script>
<xxforms:script ev:event="xforms-readwrite" ev:target="#observer">YAHOO.xbl.fr.Button.instance(this).readwrite();</xxforms:script>
</xforms:trigger>
</xhtml:span>
</xforms:group>
</xbl:template>
</xbl:binding>
</xbl:xbl>