bug 2896 : added the Enter key submission capture into the view template
This commit is contained in:
parent
b1e6c98600
commit
2f909cf9fc
|
@ -15,8 +15,8 @@
|
||||||
Transform ADL into velocity view templates
|
Transform ADL into velocity view templates
|
||||||
|
|
||||||
$Author: dmcnicol $
|
$Author: dmcnicol $
|
||||||
$Revision: 1.52 $
|
$Revision: 1.53 $
|
||||||
$Date: 2009-05-05 08:25:53 $
|
$Date: 2009-05-05 11:21:19 $
|
||||||
-->
|
-->
|
||||||
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
|
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
|
||||||
Whitespace (or lack of it) is significant! -->
|
Whitespace (or lack of it) is significant! -->
|
||||||
|
@ -381,7 +381,7 @@
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<form method="post" onsubmit="invokeSubmitHandlers( this);return trapEnterSubmissions(event, this);" class="tabbed">
|
<form method="post" onsubmit="return trapEnterSubmissions(event, this);invokeSubmitHandlers(this);" onkeypress="trapKeyPress(event, this)" class="tabbed">
|
||||||
<xsl:attribute name="action">
|
<xsl:attribute name="action">
|
||||||
<xsl:value-of select="concat( $form/@name, 'SubmitHandler.rails')"/>
|
<xsl:value-of select="concat( $form/@name, 'SubmitHandler.rails')"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
|
@ -1447,6 +1447,23 @@
|
||||||
var siteRoot = '<xsl:value-of select='$site-root'/>';
|
var siteRoot = '<xsl:value-of select='$site-root'/>';
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
var enterPressed = false;
|
||||||
|
|
||||||
|
function trapKeyPress(event, form){
|
||||||
|
if(event.which == 13){
|
||||||
|
enterPressed = true;
|
||||||
|
} else {
|
||||||
|
enterPressed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function trapEnterSubmissions(event, form){
|
||||||
|
if(enterPressed){
|
||||||
|
enterPressed = false; //we have trapped this, can stand down
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function performInitialisation()
|
function performInitialisation()
|
||||||
{
|
{
|
||||||
#if ( $instance)
|
#if ( $instance)
|
||||||
|
@ -1469,23 +1486,6 @@
|
||||||
var validator = new Validation('<xsl:value-of select="$form/@name"/>', {immediate : true, useTitles : true});
|
var validator = new Validation('<xsl:value-of select="$form/@name"/>', {immediate : true, useTitles : true});
|
||||||
}
|
}
|
||||||
|
|
||||||
var enterPressed = false;
|
|
||||||
|
|
||||||
function trapKeyPress(event, form){
|
|
||||||
if(event.which == 13){
|
|
||||||
enterPressed = true;
|
|
||||||
} else {
|
|
||||||
enterPressed = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function trapEnterSubmissions(event, form){
|
|
||||||
if(enterPressed){
|
|
||||||
enterPressed = false; //we have trapped this, can stand down
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<xsl:for-each select="//adl:typedef">
|
<xsl:for-each select="//adl:typedef">
|
||||||
<xsl:variable name="errormsg">
|
<xsl:variable name="errormsg">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
|
@ -1787,7 +1787,7 @@
|
||||||
Auto generated Velocity macro for <xsl:value-of select="@name"/>,
|
Auto generated Velocity macro for <xsl:value-of select="@name"/>,
|
||||||
generated from ADL.
|
generated from ADL.
|
||||||
|
|
||||||
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.52 $', 10)"/>
|
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.53 $', 10)"/>
|
||||||
Generation parameters were:
|
Generation parameters were:
|
||||||
area-name: <xsl:value-of select="$area-name"/>
|
area-name: <xsl:value-of select="$area-name"/>
|
||||||
default-url: <xsl:value-of select="$default-url"/>
|
default-url: <xsl:value-of select="$default-url"/>
|
||||||
|
|
Loading…
Reference in a new issue