cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r604277 - in /cocoon/branches/BRANCH_2_1_X: src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/AjaxForm.js status.xml
Date Fri, 14 Dec 2007 19:50:14 GMT
Author: antonio
Date: Fri Dec 14 11:50:13 2007
New Revision: 604277

URL: http://svn.apache.org/viewvc?rev=604277&view=rev
Log:

<action dev="AG" type="fix" fixes-bug="COCOON-2052" due-to="Robin Wyles" due-to-email="rob@robinwyles.com">
  Forms: Allow Ajax submission of forms with empty upload field.
</action>

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/AjaxForm.js
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/AjaxForm.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/AjaxForm.js?rev=604277&r1=604276&r2=604277&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/AjaxForm.js
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/AjaxForm.js
Fri Dec 14 11:50:13 2007
@@ -48,13 +48,13 @@
         var form = this.domNode;                                /* the form node */
         var mimetype = "text/xml";                              /* the default mime-type
*/
         if (!params) params = {};                               /* create if not passed */
-        
+
         // TODO: should CForm's onSubmit handlers be called for Ajax events ?
         //if (cocoon.forms.callOnSubmitHandlers(form)) == false) return; /* call CForm's
onSubmit handlers */
-        
+
         // Provide feedback that something is happening.
         document.body.style.cursor = "wait";
-        
+
         // The "ajax-action" attribute specifies an alternate submit location used in Ajax
mode.
         // This allows to use Ajax in the portal where forms are normally posted to the portal
URL.
         var uri = form.getAttribute("ajax-action");
@@ -82,7 +82,7 @@
         // Avoid the use of widget.lastClickTarget as it may already be out of date
         if (form[name]) form[name].disabled = true;
     },
-        
+
     /**
      * Handle the server's BrowserUpdate response.
      * Update the part of the form referenced by ids in the reponse.
@@ -100,7 +100,7 @@
                 return;
             }
             // add the continue handler for CForms
-            updater.handlers['continue'] = function() { widget._continue(); } 
+            updater.handlers['continue'] = function() { widget._continue(); }
             // Handle browser update directives
             updater.processResponse(data);
         } else if (type == "error") {
@@ -109,7 +109,7 @@
             dojo.debug("WARNING: dojo.io.bind returned an unhandled state : " + type);
         }
     },
-    
+
     /**
      * Handle the server continue message.
      * The server is signalling in a BrowserUpdate response that the CForm is finished.
@@ -130,7 +130,7 @@
             div.innerHTML = content;
             document.body.appendChild(div);
             div.firstChild.submit();
-        } else {            
+        } else {
             // Redirect to the form's action URL
             var contParam = '?cocoon-ajax-continue=true';
             if (form.elements["continuation-id"]) {
@@ -151,7 +151,7 @@
     var inputs = node.getElementsByTagName("input");
     dojo.lang.forEach(inputs, function(input){
         if(hasFile){ return; }
-        if(input.getAttribute("type")=="file" && !input.disabled){
+        if(input.getAttribute("type")=="file" && !input.disabled && input.value){
             hasFile = true;
         }
     });

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/status.xml?rev=604277&r1=604276&r2=604277&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Fri Dec 14 11:50:13 2007
@@ -182,6 +182,9 @@
 
   <changes>
   <release version="2.1.11" date="TBD">
+    <action dev="AG" type="fix" fixes-bug="COCOON-2052" due-to="Robin Wyles" due-to-email="rob@robinwyles.com">
+      Forms: Allow Ajax submission of forms with empty upload field.
+    </action>
     <action dev="CZ" type="add">
       Portal: New SiteProfileManager providing the same profile to several users based on
a configured key.
     </action>



Mime
View raw message