struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r751086 - in /struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources: org/apache/struts2/static/ template/jquery-simple/ template/jquery/
Date Fri, 06 Mar 2009 21:43:25 GMT
Author: wesw
Date: Fri Mar  6 21:43:24 2009
New Revision: 751086

URL: http://svn.apache.org/viewvc?rev=751086&view=rev
Log:
Creating a jquery-simple theme

Added:
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/empty.ftl
      - copied unchanged from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/empty.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-close-validate.ftl
      - copied, changed from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-close.ftl
  (contents, props changed)
      - copied, changed from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-validate.ftl
  (props changed)
      - copied unchanged from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-validate.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form.ftl
      - copied, changed from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/head.ftl
      - copied, changed from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/reset.ftl
      - copied, changed from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/reset.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/submit-close.ftl
      - copied, changed from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit-close.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/submit.ftl
      - copied, changed from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/text.ftl
      - copied, changed from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/text.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close.ftl
Removed:
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-validate.ftl
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/form-close-validate.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/reset.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit-close.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/text.ftl
    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=751086&r1=751085&r2=751086&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 21:43:24 2009
@@ -43,8 +43,7 @@
   if(errors.fieldErrors) {
     for(var fieldName in errors.fieldErrors) {
       for(var i = 0; i < errors.fieldErrors[fieldName].length; i++) {
-        addErrorJquery( $("input[name=\""+fieldName+"\"]").attr("id"),
-                 errors.fieldErrors[fieldName][i]);
+        addError( $("input[name=\""+fieldName+"\"]").attr("id"), errors.fieldErrors[fieldName][i]);
       }
     }
   }
@@ -61,3 +60,11 @@
     element.attachEvent('on' + name, observer);
   }
 };
+
+StrutsJQueryUtils.keyValueizeForm = function(formId) {
+    var formData = { };
+    $("#"+formId).find("input").each( function() {
+      formData[$(this).attr('name')] = $(this).val();
+    });
+    return formData ;
+};

Copied: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-close-validate.ftl
(from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl)
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-close-validate.ftl?p2=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-close-validate.ftl&p1=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl&r1=751038&r2=751086&rev=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-close-validate.ftl
Fri Mar  6 21:43:24 2009
@@ -1,6 +1,6 @@
 <#--
 /*
- * $Id: form-close-validate.ftl 720258 2008-11-24 19:05:16Z musachy $
+ * $Id$
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -20,63 +20,19 @@
  * under the License.
  */
 -->
-<#if parameters.validate?default(true) == true>
+<#if parameters.ajaxResult?default(true) == true>
 <script type="text/javascript">
 <#--TODO add tests for funky datatypes like Date obj returned from the datepicker
     TODO consider ids that contain a period... valid for struts, invalid for jquery
     -->
     function validateForm_${parameters.id}() {
-        var formData = {'struts.enableJSONValidation': true};
-        $("#${parameters.id}").find(":input").each( function() {
-            formData[$(this).attr('name')] = $(this).val();
-        });
-<#--
-        // var formData = $("#${parameters.id}").serialize() + '&struts.enableJSONValidation=true';
-
-var debugStr = "";
-jQuery.each(formData, function(i, val) {
-    debugStr = debugStr + i + "=>" + val + ", ";
-});
-alert("formData = " + debugStr); -->
-
+        var formData = StrutsJQueryUtils.keyValueizeForm("${parameters.id}");
 <#if parameters.method?contains("post") >
-        $.post("${parameters.action}", formData, validateFormCb_${parameters.id} );
+        $.post("${parameters.action}", formData, ${parameters.ajaxResultHandler} );
 <#else>
-        $.get("${parameters.action}", formData, validateFormCb_${parameters.id} );
+        $.get("${parameters.action}", formData, ${parameters.ajaxResultHandler} );
 </#if>
         return false;
     }
-
-    function validateFormCb_${parameters.id}( responseText, textStatus ) {
-        
-        //clear previous validation errors, if any
-        StrutsJQueryUtils.clearValidationErrors("${parameters.id}");
-
-        //get errors from response
-        var errorsObject = StrutsJQueryUtils.getValidationErrors(responseText);
-
-        //show errors, if any
-        if(errorsObject && errorsObject.fieldErrors) {
-            StrutsJQueryUtils.showValidationErrors("${parameters.id}", errorsObject);
-        }
-        else {
-<#if (parameters.ajaxResult?default(false) == true ) && parameters.method?contains("post")>
-            var formData = { };
-            $("#${parameters.id}").find(":input").each( function() {
-                formData[$(this).attr('name')] = $(this).val();
-            });
-            $.post("${parameters.action}", formData, ${parameters.ajaxResultHandler} );
-<#elseif (parameters.ajaxResult?default(false) == true )>
-            var formData = { };
-            $("#${parameters.id}").find(":input").each( function() {
-                formData[$(this).attr('name')] = $(this).val();
-            });
-            $.get("${parameters.action}", formData, ${parameters.ajaxResultHandler} );
-<#else>
-            var form = document.getElementById("${parameters.id}");
-            form.submit();
-</#if>
-        }
-    }
 </script>
 </#if>
\ No newline at end of file

Copied: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-close.ftl
(from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close.ftl)
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-close.ftl?p2=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-close.ftl&p1=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close.ftl&r1=751038&r2=751086&rev=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-close.ftl
Fri Mar  6 21:43:24 2009
@@ -21,9 +21,8 @@
  */
  TODO Need to check on elements like inputtransferselect and doubleselect
 -->
-<#include "/${parameters.templateDir}/xhtml/control-close.ftl" />
 <#include "/${parameters.templateDir}/simple/form-close.ftl" />
-<#include "/${parameters.templateDir}/jquery/form-close-validate.ftl" />
+<#include "/${parameters.templateDir}/jquery-simple/form-close-validate.ftl" />
 <#if parameters.focusElement?if_exists != "">
 <script type="text/javascript">
     StrutsUtils.addOnLoad(function() {

Propchange: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-close.ftl
------------------------------------------------------------------------------
    svn:keywords = on

Propchange: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form-validate.ftl
------------------------------------------------------------------------------
    svn:keywords = on

Copied: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form.ftl
(from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form.ftl)
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form.ftl?p2=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form.ftl&p1=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form.ftl&r1=751038&r2=751086&rev=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/form.ftl
Fri Mar  6 21:43:24 2009
@@ -1,6 +1,6 @@
 <#--
 /*
- * $Id: form.ftl 720258 2008-11-24 19:05:16Z musachy $
+ * $Id$
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -20,7 +20,7 @@
  * under the License.
  */
 -->
-<#include "/${parameters.templateDir}/jquery/form-validate.ftl" />
+<#include "/${parameters.templateDir}/jquery-simple/form-validate.ftl" />
 <#include "/${parameters.templateDir}/simple/form-common.ftl" />
 <#if parameters.validate?default(true) == true>
   onreset="${parameters.onreset?default('clearErrorMessages(\'${parameters.id}\');clearErrorLabels(\'${parameters.id}\');')}"
@@ -29,5 +29,4 @@
   onreset="${parameters.onreset?html}"
   </#if>
 </#if>
->
-<#include "/${parameters.templateDir}/xhtml/control.ftl" />
\ No newline at end of file
+>
\ No newline at end of file

Copied: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/head.ftl
(from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl)
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/head.ftl?p2=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/head.ftl&p1=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl&r1=751038&r2=751086&rev=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/head.ftl
Fri Mar  6 21:43:24 2009
@@ -20,7 +20,6 @@
  * under the License.
  */
 -->
-<link rel="stylesheet" href="<@s.url value='/struts/xhtml/styles.css' includeParams='none'
encode='false' />" type="text/css"/>
 <script src="${base}/struts/jqueryUtils.js" type="text/javascript"></script>
 
 <script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js" type="text/javascript"></script>

Copied: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/reset.ftl
(from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/reset.ftl)
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/reset.ftl?p2=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/reset.ftl&p1=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/reset.ftl&r1=751038&r2=751086&rev=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/reset.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/reset.ftl
Fri Mar  6 21:43:24 2009
@@ -20,12 +20,4 @@
  * under the License.
  */
 -->
-<tr>
-    <td colspan="2"><div <#rt/>
-<#if parameters.align??>
-    align="${parameters.align?html}"<#t/>
-</#if>
-><#t/>
-<#include "/${parameters.templateDir}/simple/reset.ftl" />
-</div><#t/>
-<#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" />
+<#include "/${parameters.templateDir}/simple/reset.ftl" />
\ No newline at end of file

Copied: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/submit-close.ftl
(from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit-close.ftl)
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/submit-close.ftl?p2=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/submit-close.ftl&p1=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit-close.ftl&r1=751038&r2=751086&rev=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit-close.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/submit-close.ftl
Fri Mar  6 21:43:24 2009
@@ -1,3 +1 @@
-<#include "/${parameters.templateDir}/simple/submit-close.ftl" />
-</div><#t/>
-<#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" />
+<#include "/${parameters.templateDir}/simple/submit-close.ftl" />
\ No newline at end of file

Copied: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/submit.ftl
(from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit.ftl)
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/submit.ftl?p2=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/submit.ftl&p1=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit.ftl&r1=751038&r2=751086&rev=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/submit.ftl
Fri Mar  6 21:43:24 2009
@@ -20,10 +20,4 @@
  * under the License.
  */
 -->
-<tr>
-    <td colspan="2"><div <#rt/>
-<#if parameters.align??>
-    align="${parameters.align?html}"<#t/>
-</#if>
-><#t/>
 <#include "/${parameters.templateDir}/simple/submit.ftl" />

Copied: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/text.ftl
(from r751038, struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/text.ftl)
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/text.ftl?p2=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/text.ftl&p1=struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/text.ftl&r1=751038&r2=751086&rev=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/text.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/text.ftl
Fri Mar  6 21:43:24 2009
@@ -20,6 +20,4 @@
  * under the License.
  */
 -->
-<#include "/${parameters.templateDir}/xhtml/controlheader.ftl" />
 <#include "/${parameters.templateDir}/simple/text.ftl" />
-<#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" />

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl?rev=751086&r1=751085&r2=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl
Fri Mar  6 21:43:24 2009
@@ -26,19 +26,8 @@
     TODO consider ids that contain a period... valid for struts, invalid for jquery
     -->
     function validateForm_${parameters.id}() {
-        var formData = {'struts.enableJSONValidation': true};
-        $("#${parameters.id}").find(":input").each( function() {
-            formData[$(this).attr('name')] = $(this).val();
-        });
-<#--
-        // var formData = $("#${parameters.id}").serialize() + '&struts.enableJSONValidation=true';
-
-var debugStr = "";
-jQuery.each(formData, function(i, val) {
-    debugStr = debugStr + i + "=>" + val + ", ";
-});
-alert("formData = " + debugStr); -->
-
+        var formData = StrutsJQueryUtils.keyValueizeForm("${parameters.id}");
+        formData['struts.enableJSONValidation'] = true;
 <#if parameters.method?contains("post") >
         $.post("${parameters.action}", formData, validateFormCb_${parameters.id} );
 <#else>
@@ -61,16 +50,10 @@
         }
         else {
 <#if (parameters.ajaxResult?default(false) == true ) && parameters.method?contains("post")>
-            var formData = { };
-            $("#${parameters.id}").find(":input").each( function() {
-                formData[$(this).attr('name')] = $(this).val();
-            });
+            var formData = StrutsJQueryUtils.keyValueizeForm("${parameters.id}");;
             $.post("${parameters.action}", formData, ${parameters.ajaxResultHandler} );
 <#elseif (parameters.ajaxResult?default(false) == true )>
-            var formData = { };
-            $("#${parameters.id}").find(":input").each( function() {
-                formData[$(this).attr('name')] = $(this).val();
-            });
+            var formData = StrutsJQueryUtils.keyValueizeForm("${parameters.id}");
             $.get("${parameters.action}", formData, ${parameters.ajaxResultHandler} );
 <#else>
             var form = document.getElementById("${parameters.id}");

Added: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close.ftl
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close.ftl?rev=751086&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close.ftl
(added)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close.ftl
Fri Mar  6 21:43:24 2009
@@ -0,0 +1,35 @@
+<#--
+/*
+ * $Id: form-close.ftl 590812 2007-10-31 20:32:54Z apetrelli $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+ TODO Need to check on elements like inputtransferselect and doubleselect
+-->
+<#include "/${parameters.templateDir}/xhtml/control-close.ftl" />
+<#include "/${parameters.templateDir}/jquery/form-close-validate.ftl" />
+<#if parameters.focusElement?if_exists != "">
+<script type="text/javascript">
+    StrutsUtils.addOnLoad(function() {
+        var element = document.getElementById("${parameters.focusElement?html}");
+        if(element) {
+            element.focus();
+        }
+    });
+</script>
+</#if>

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form.ftl
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form.ftl?rev=751086&r1=751085&r2=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form.ftl
Fri Mar  6 21:43:24 2009
@@ -20,14 +20,5 @@
  * under the License.
  */
 -->
-<#include "/${parameters.templateDir}/jquery/form-validate.ftl" />
-<#include "/${parameters.templateDir}/simple/form-common.ftl" />
-<#if parameters.validate?default(true) == true>
-  onreset="${parameters.onreset?default('clearErrorMessages(\'${parameters.id}\');clearErrorLabels(\'${parameters.id}\');')}"
-<#else>
-  <#if parameters.onreset??>
-  onreset="${parameters.onreset?html}"
-  </#if>
-</#if>
->
+<#include "/${parameters.templateDir}/jquery-simple/form.ftl" />
 <#include "/${parameters.templateDir}/xhtml/control.ftl" />
\ No newline at end of file

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl?rev=751086&r1=751085&r2=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl
Fri Mar  6 21:43:24 2009
@@ -21,6 +21,4 @@
  */
 -->
 <link rel="stylesheet" href="<@s.url value='/struts/xhtml/styles.css' includeParams='none'
encode='false' />" type="text/css"/>
-<script src="${base}/struts/jqueryUtils.js" type="text/javascript"></script>
-
-<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js" type="text/javascript"></script>
+<#include "/${parameters.templateDir}/jquery-simple/head.ftl" />

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/reset.ftl
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/reset.ftl?rev=751086&r1=751085&r2=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/reset.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/reset.ftl
Fri Mar  6 21:43:24 2009
@@ -26,6 +26,6 @@
     align="${parameters.align?html}"<#t/>
 </#if>
 ><#t/>
-<#include "/${parameters.templateDir}/simple/reset.ftl" />
+<#include "/${parameters.templateDir}/jquery-simple/reset.ftl" />
 </div><#t/>
 <#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" />

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit-close.ftl
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit-close.ftl?rev=751086&r1=751085&r2=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit-close.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit-close.ftl
Fri Mar  6 21:43:24 2009
@@ -1,3 +1,3 @@
-<#include "/${parameters.templateDir}/simple/submit-close.ftl" />
+<#include "/${parameters.templateDir}/jquery-simple/submit-close.ftl" />
 </div><#t/>
 <#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" />

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit.ftl
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit.ftl?rev=751086&r1=751085&r2=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/submit.ftl
Fri Mar  6 21:43:24 2009
@@ -26,4 +26,4 @@
     align="${parameters.align?html}"<#t/>
 </#if>
 ><#t/>
-<#include "/${parameters.templateDir}/simple/submit.ftl" />
+<#include "/${parameters.templateDir}/jquery-simple/submit.ftl" />

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/text.ftl
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/text.ftl?rev=751086&r1=751085&r2=751086&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/text.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/text.ftl
Fri Mar  6 21:43:24 2009
@@ -21,5 +21,5 @@
  */
 -->
 <#include "/${parameters.templateDir}/xhtml/controlheader.ftl" />
-<#include "/${parameters.templateDir}/simple/text.ftl" />
+<#include "/${parameters.templateDir}/jquery-simple/text.ftl" />
 <#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" />

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=751086&r1=751085&r2=751086&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 21:43:24 2009
@@ -32,7 +32,7 @@
 }
 
 function clearErrorLabelsJquery(form) {
-    $("#"+form).find(".errorLabel").removeClass("errorLabel");
+    $("#"+form).find(".errorLabel").toggleClass("errorLabel");
 }
 
 function addError(e, errorText) {



Mime
View raw message