struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r750768 - in /struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources: org/apache/struts2/static/jqueryUtils.js template/jquery/validation.js
Date Fri, 06 Mar 2009 04:43:42 GMT
Author: wesw
Date: Fri Mar  6 04:43:42 2009
New Revision: 750768

URL: http://svn.apache.org/viewvc?rev=750768&view=rev
Log:
jquery-ifying javascript files

Modified:
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/struts2/static/jqueryUtils.js
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/validation.js

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/struts2/static/jqueryUtils.js
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/struts2/static/jqueryUtils.js?rev=750768&r1=750767&r2=750768&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/struts2/static/jqueryUtils.js
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/struts2/static/jqueryUtils.js
Fri Mar  6 04:43:42 2009
@@ -50,6 +50,7 @@
   }
 };
 
+/*
 StrutsJQueryUtils.firstElement  = function(parentNode, tagName) {
   var node = parentNode.firstChild;
   while(node && node.nodeType != 1){
@@ -85,7 +86,7 @@
   }
   return node;  
 };
-
+*/
 StrutsJQueryUtils.addOnLoad = function(func) {
   $().ready(func);
 };

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/validation.js
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/validation.js?rev=750768&r1=750767&r2=750768&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/validation.js
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/validation.js
Fri Mar  6 04:43:42 2009
@@ -41,6 +41,16 @@
 }
 
 function addErrorJquery(e, errorText) {
+    var parentRow = $(e).parent("tr").get(0);
+    $(parentRow).before(
+        $("<tr></tr>").attr("errorFor", e).html(
+            $("<td></td>").attr("colspan", "2").html(
+                $("<span></span>").addClass("errorMessage").html(errorText)
+                    )
+                )
+            );
+    $("label[for="+ e +"]").addClass('errorLabel');
+    /*
     try {
         var row = (e.type ? e : e[0]);
         while(row.nodeName.toUpperCase() != "TR") {
@@ -73,4 +83,5 @@
     } catch (e) {
         alert(e);
     }
+    */
 }



Mime
View raw message