cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: r330514 - in /cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms: generation/ resources/ resources/js/ resources/mattkruse-lib/
Date Thu, 03 Nov 2005 08:58:29 GMT
Author: sylvain
Date: Thu Nov  3 00:58:23 2005
New Revision: 330514

URL: http://svn.apache.org/viewcvs?rev=330514&view=rev
Log:
Fix issue COCOON-1672: help popups don't work with Ajax

Modified:
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/forms-lib.js
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/mattkruse-lib/PopupWindow.js

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml?rev=330514&r1=330513&r2=330514&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml Thu Nov
 3 00:58:23 2005
@@ -237,6 +237,10 @@
 	      <jx:evalBody/>
           <jx:set var="cformsDummy" value="${cformsHelper.popWidget()}"/>
 	  </jx:if>
+    </jx:macro>
+    
+    <jx:macro name="tree-nodes" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:set var="treeNodesBody" value="${macro.body}"/>
       <!-- Generate tree-management hidden fields here, i.e. inside the block element
            that should have been produced by <ft:tree> (used by bu:replace) -->
       <fi:field id="${widget.fullName}:action">
@@ -245,10 +249,6 @@
       <fi:field id="${widget.fullName}:path">
         <fi:styling type="hidden"/>
       </fi:field>
-    </jx:macro>
-    
-    <jx:macro name="tree-nodes" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
-      <jx:set var="treeNodesBody" value="${macro.body}"/>
       <jx:choose>
         <jx:when test="${treeWidget.isRootVisible()}">
           <!-- set current widget for root node -->

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl?rev=330514&r1=330513&r2=330514&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
Thu Nov  3 00:58:23 2005
@@ -67,15 +67,12 @@
       | 
       +-->
   <xsl:template match="fi:help">
-    <xsl:variable name="id" select="generate-id()"/>
-    <div class="forms-help" id="help{$id}" style="visibility:hidden; position:absolute;">
-    	<span style="float:right"><a href="#" onClick="helpWin{$id}.hidePopup();return
false;"><img align="top" alt="close" src="{$resources-uri}/forms/img/close.gif" height="6"
width="6"/></a></span>
+    <xsl:variable name="id" select="concat(../@id, ':help')"/>
+    <div class="forms-help" id="{$id}" style="visibility:hidden; position:absolute;">
+    	<span style="float:right"><a href="#" onClick="document.getElementById('{$id}').style.visibility
= 'hidden';return false;"><img align="top" alt="close" src="{$resources-uri}/forms/img/close.gif"
height="6" width="6"/></a></span>
       <xsl:apply-templates select="node()"/>
     </div>
-    <script type="text/javascript">
-      var helpWin<xsl:value-of select="$id"/> = forms_createPopupWindow('help<xsl:value-of
select="$id"/>');
-    </script>
-    <a id="{$id}" name="{$id}" href="#" onclick="helpWin{$id}.showPopup('{$id}');return
false;">
+    <a id="{$id}-a" href="#" onclick="forms_createPopupWindow('{$id}').showPopup('{$id}-a');return
false;">
       <!-- TODO: i18n key for helppopup -->
       <img src="{$resources-uri}/forms/img/help.gif" alt="helppopup"/>
     </a>

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl?rev=330514&r1=330513&r2=330514&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl
Thu Nov  3 00:58:23 2005
@@ -52,7 +52,7 @@
                        fi:field[fi:datatype[@type='date'][fi:convertor/@variant='date']][not(fi:styling/@type)][not(fi:selection-list)]
|
                        fi:aggregatefield[fi:datatype[@type='date'][fi:convertor/@variant='date']][not(fi:styling/@type)][not(fi:selection-list)]
                        ">
-    <xsl:variable name="id" select="generate-id()"/>
+    <xsl:variable name="id" select="concat(@id, ':cal')"/>
     
     <xsl:variable name="format">
       <xsl:choose>

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js?rev=330514&r1=330513&r2=330514&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js Thu Nov
 3 00:58:23 2005
@@ -118,9 +118,9 @@
         if (input.tagName.toLowerCase() == "select" && input.multiple) {
             var name = encodeURIComponent(input.name);
             var options = input.options;
-            for (i in options) {
+            for (var i = 0; i < options.length; i++) {
                 if (options[i].selected) {
-                    result += "&" + name + "=" + encodeURIComponent(options[i].value)
+                    result += "&" + name + "=" + encodeURIComponent(options[i].value);
                 }
             }
             // don't use the default fallback

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/forms-lib.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/forms-lib.js?rev=330514&r1=330513&r2=330514&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/forms-lib.js (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/forms-lib.js Thu Nov
 3 00:58:23 2005
@@ -27,8 +27,8 @@
     for (var i = 0; i < forms_onloadHandlers.length; i++) {
         forms_onloadHandlers[i].forms_onload();
     }
-    // Clear it (we no more need them)
-    forms_onloadHandlers = null;
+    // Reset it (we no more need them)
+    forms_onloadHandlers = new Array();
 }
 
 // Handlers that are to be called in form's "onsubmit" event

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/mattkruse-lib/PopupWindow.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/mattkruse-lib/PopupWindow.js?rev=330514&r1=330513&r2=330514&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/mattkruse-lib/PopupWindow.js
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/mattkruse-lib/PopupWindow.js
Thu Nov  3 00:58:23 2005
@@ -189,7 +189,7 @@
 					}
 				}
 			var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*']
) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all &&
!navigator.taintEnabled );
-			this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");
+			this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"/*+anchorname*/,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");
 			}
 		this.refresh();
 		}



Mime
View raw message