Author: hlship
Date: Thu Dec 20 18:55:25 2007
New Revision: 606090
URL: http://svn.apache.org/viewvc?rev=606090&view=rev
Log:
TAPESTRY-1942: Client side validation should be triggered when the user moves
out of a field
- Use Ben's latest images (with the drop shadows)
- Make use of Prototype's "dom:loaded" event, rather than observing the window
load event, for page initializations (doesn't have to wait for images to load)
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/DocumentHeadBuilderImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/default.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/error-bevel-left.png
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/error-bevel-right.png
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_script.txt
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/DocumentHeadBuilderImpl.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/DocumentHeadBuilderImpl.java?rev=606090&r1=606089&r2=606090&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/DocumentHeadBuilderImpl.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/DocumentHeadBuilderImpl.java
Thu Dec 20 18:55:25 2007
@@ -124,9 +124,9 @@
Element e = body.element("script", "type", "text/javascript");
e.raw("\n<!--\n");
- // This assumes that Prototype is available.
+ // This assumes that Prototype and tapestry.js is available.
- e.text("Event.observe(window, 'load', function() {\n");
+ e.text("Tapestry.onDOMLoaded(function() {\n");
e.text(_scriptBlock.toString());
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/default.css
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/default.css?rev=606090&r1=606089&r2=606090&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/default.css
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/default.css
Thu Dec 20 18:55:25 2007
@@ -342,19 +342,19 @@
background: transparent url( 'error-bevel-left.png' ) no-repeat;
display: block;
line-height: 33px;
- margin-left: -9px;
- padding: 0px 7pt 10px 22px;
+ margin-left: 0px;
+ padding: 0px 5px 10px 22px;
}
DIV.t-error-bevel {
background: transparent url( 'error-bevel-right.png' ) no-repeat scroll
top right;
+ cursor: pointer;
color: #FFF;
display: block;
float: left;
font: normal 12px arial, sans-serif;
height: 39px;
margin-right: 6px;
- padding-right: 25px;
+ padding-right: 29px;
text-decoration: none;
- cursor: pointer;
}
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/error-bevel-left.png
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/error-bevel-left.png?rev=606090&r1=606089&r2=606090&view=diff
==============================================================================
Binary files - no diff available.
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/error-bevel-right.png
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/error-bevel-right.png?rev=606090&r1=606089&r2=606090&view=diff
==============================================================================
Binary files - no diff available.
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js?rev=606090&r1=606089&r2=606090&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js
Thu Dec 20 18:55:25 2007
@@ -20,6 +20,15 @@
Zone : Class.create(),
+ // Adds a callback function that will be invoked when the DOM is loaded
(which
+ // occurs *before* window.onload, which has to wait for images and such to
load
+ // first. This simply observes the dom:loaded event on the document
object (support for
+ // which is provided by Prototype).
+ onDOMLoaded : function(callback)
+ {
+ document.observe("dom:loaded", callback);
+ },
+
registerForm : function(form, clientValidations)
{
form = $(form);
@@ -350,9 +359,11 @@
this.popup.absolutize();
- this.popup.observe("click", function()
+ this.popup.observe("click", function(event)
{
- new Effect.Fade(this.popup);
+ this.popup.hide();
+
+ event.stop();
}.bindAsEventListener(this));
}
@@ -476,7 +487,7 @@
// Find all elements marked with the "t-invisible" CSS class and hide() them,
so that
// Prototype's visible() method operates correctly.
-Event.observe(window, 'load', function()
+Tapestry.onDOMLoaded(function()
{
$$(".t-invisible").each(function(element)
{
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_script.txt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_script.txt?rev=606090&r1=606089&r2=606090&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_script.txt
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/internal/services/add_script.txt
Thu Dec 20 18:55:25 2007
@@ -1,6 +1,6 @@
<html><body><p>Ready to be updated with scripts.</p><script
type="text/javascript">
<!--
-Event.observe(window, 'load', function() {
+Tapestry.onDOMLoaded(function() {
doSomething();
doSomethingElse();
});