cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jer...@apache.org
Subject svn commit: r694343 - in /cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax: dojo/ resources/org/apache/cocoon/ajax/resources/js/ resources/org/apache/cocoon/ajax/system/ samples/
Date Thu, 11 Sep 2008 16:37:37 GMT
Author: jeremy
Date: Thu Sep 11 09:37:27 2008
New Revision: 694343

URL: http://svn.apache.org/viewvc?rev=694343&view=rev
Log:
updating ajax block to work with Dojo 1.1.1

Added:
    cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/README   (with props)
    cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/build.properties   (with props)
Modified:
    cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/build.xml
    cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/BUHandler.js
    cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/FormUploadProgress.js
    cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/PartialLink.js
    cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/common.js
    cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/insertion.js
    cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/system/System.Upload.js
    cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/samples/linked-updater.xml

Added: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/README
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/README?rev=694343&view=auto
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/README (added)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/README Thu Sep 11 09:37:27 2008
@@ -0,0 +1,28 @@
+Tools to make a build of Dojo 1.1.1
+
+Currently Cocoon Forms defaults to accessing Dojo from Google CDN.
+If you would either like to serve a local Dojo, or you'd like to setup your own CDN, 
+you will need to build Dojo.
+
+This process is very easy :
+
+1. Downlaod a source release of Dojo :
+    eg. $ wget http://download.dojotoolkit.org/release-1.1.1/dojo-release-1.1.1-src.zip
+    
+2. Unpack the release
+    eg. $ unzip dojo-release-1.1.1-src.zip
+    
+3. Build the full set of locales in Dojo, to give you full formatting support in CForms
+    run the Ant build script in dojo release util/buildscripts/cldr/build.xml
+    
+4. Setup the build script in this directory
+    copy 'build.properties' to 'local.build.properties'
+    edit the 'dojo.home' property to the location of your dojo release directory
+
+5. Run the build script in this directory
+    $ ant
+
+6. Install the resulting Jar file in Cocoon 
+
+
+Please read also the comments in build.xml
\ No newline at end of file

Propchange: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/README
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/build.properties
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/build.properties?rev=694343&view=auto
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/build.properties (added)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/build.properties Thu Sep 11 09:37:27 2008
@@ -0,0 +1,62 @@
+
+# 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.
+
+#
+#  Sample build.properties for making builds of Dojo.
+#  copy this file to 'local.buid.properties' then edit as needed.
+#
+#  See dojo's util/buildscripts/jslib/buildUtils.js for docs on each supported parameter to the dojo build system.
+#
+#  You need to have downloaded and unpacked the Dojo 1.1.1 src release to use this : http://download.dojotoolkit.org/release-1.1.1/dojo-release-1.1.1-src.tar.gz
+#
+
+
+# Change this to the location of your src release of Dojo and uncomment the line
+#dojo.home=/Users/foobar/Downloads/dojo-release-1.1.1-src
+
+# clean the build directory before doing a release build
+dojo.action=clean,release
+
+# do not copy tests
+dojo.copyTests=false
+
+# optimise CSS, stripping comments etc.
+dojo.cssOptimize=comments
+
+# optimise layer scripts using Dojo's ShrinkSafe, but leave line breaks
+dojo.layerOptimize=shrinksafe.keepLines
+
+# you wish to make a build that will load from the local server
+dojo.loader=default
+
+# you wish to make a build that will be served from a different domain to the local server (i.e. setup your own CDN)
+#dojo.loader=xdomain
+
+# optimise scripts using Dojo's ShrinkSafe, but leave line breaks
+dojo.optimize=shrinksafe.keepLines
+
+# run the 'standard' profile in dojo: util/buildscripts/profiles/standard.profile.js
+dojo.profile=standard
+
+# run a custom profile (use instead of 'profile'), the path must be valid from the context of dojos util/buildscripts directory
+# TODO: currently untested and unsupported by build.xml
+# profileFile=../../../../../../../../../ajax/dojo/sample.custom.profile.js
+
+# assign a version number to your build
+dojo.version=1.1.1
+
+# the list of (all) locales you'd like compressed during the build (assumes you built the complete /cldr/ set, see dojo's util/buildscripts/cldr/build.xml)
+#dojo.localeList=aa,aa-dj,aa-er,af,af-na,am,ar,ar-dz,ar-jo,ar-lb,ar-ma,ar-qa,ar-sa,ar-sy,ar-tn,ar-ye,as,az,az-cyrl,be,bg,bn,bo,bs,byn,ca,cs,cy,da,de,de-at,de-be,de-ch,de-de,de-li,de-lu,el,el-cy,el-polyton,en,en-au,en-be,en-bw,en-bz,en-ca,en-gb,en-hk,en-ie,en-in,en-jm,en-mt,en-na,en-nz,en-ph,en-pk,en-sg,en-tt,en-us,en-us-posix,en-za,en-zw,eo,es,es-ar,es-cl,es-co,es-do,es-ec,es-es,es-gt,es-hn,es-mx,es-ni,es-pa,es-pe,es-pr,es-py,es-sv,es-us,es-uy,es-ve,et,eu,fa,fa-af,fi,fil,fo,fr,fr-be,fr-ca,fr-ch,fr-lu,ga,gez-et,gl,gu,gv,haw,he,hi,hr,hu,hy,hy-am-revised,id,ii,is,it,it-ch,it-it,ja,ja-jp,ka,kk,kl,km,kn,ko,ko-kr,kok,kw,lt,lv,mk,ml,mn,mr,ms,ms-bn,mt,nb,ne,nl,nl-be,nn,om,om-ke,pa,pa-arab,pa-pk,pl,ps,pt,pt-br,pt-pt,ro,ru,ru-ua,se-fi,sh,sh-cs,sh-yu,sk,sl,so,so-dj,so-et,so-ke,sq,sr,sr-ba,sr-cyrl-ba,sr-latn,sr-latn-cs,sr-latn-me,sr-latn-rs,sr-latn-yu,sv,sv-fi,sw,sw-ke,ta,te,th,ti,ti-er,tr,uk,ur,uz-af,uz-arab,uz-latn,vi,xh,zh,zh-cn,zh-hans-sg,zh-hant,zh-hant-hk,zh-hant-mo,zh-hk,zh-mo,zh
 -sg,zh-tw,zu

Propchange: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/build.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/build.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/build.xml?rev=694343&r1=694342&r2=694343&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/build.xml (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/dojo/build.xml Thu Sep 11 09:37:27 2008
@@ -16,15 +16,53 @@
   limitations under the License.
 -->
 <!-- Ant file to build the Dojo jar file.
-     You need to set the "dojo.home" property in a local.build.properties file in the
-     same directory as this file. This property should point to the location where the
-     Dojo sources are available (e.g. dojo.home=/home/foobar/dev/dojotoolkit.org/trunk)
+
+      This build file is intended for two purposes :
+      
+      1) to build the nano-dojo that is committed to and distributed with Cocoon
+         Since 2.1.12, by default, Cocoon uses the CDN at Google as the repository to serve 
+         Dojo 1.1.1 to browsers viewing your CForms pages. i.e. Dojo XDomain loading.
+         
+         This has several advantages :
+          We no longer have to distribute the fast-growing Dojo source with Cocoon.
+          If you are paying for your bandwidth, you don't have to pay for Dojo to be served.
+          Your users may already have dojo cached from this popular source.
+          Google serves Dojo with a far-future expires header.
+      
+        However, we cannot do without Dojo resources altogether.
+        Several components on some platforms require that certain resources 
+        are loaded from the same server as your forms.
+        eg. dojo/resources/blank.html
+      
+      2) to allow the user easy access to Dojo's build system for their own experimental purposes.
+         The kind of things you may be able to do :
+            Make custom builds of dojo to serve locally
+            Make custom builds of dojo to serve from your own CDN
+            Run custom build profiles to combine all the code required by one form into one js file
+
+
+      First you need to obtain one of dojo's src releases, currently: http://download.dojotoolkit.org/release-1.1.1/dojo-release-1.1.1-src.tar.gz
+      NB. You MUST build from a src release. You must NOT serve from a src release without first building from it.
+      
+      NB. Before building Dojo, you will most likely want to suplement the default locales that dojo builds in.
+          See the comments in dojo's util/buildscripts/cldr/build.xml
+      
+      To perform a build of Dojo, you need several properties setup.
+      As a starting point you may copy 'build.properties' to 'local.build.properties' and edit that to your needs.
+      
+      Targets :
+      
+        build: run dojo's build system
+        jar:   make a jar of a dojo build (default)
+        nano:  make a jar of a nano-build of dojo, to distribute with Cocoon
+
 
      @version $Id$
 -->
 
 <project name="build-dojo" default="jar">
 
+  <property name="build" location="build/org/apache/cocoon/dojotoolkit/resources"/>
 	<property file="local.build.properties"/>
 
 	<!-- Set dojo.revision to the date if unspecified -->
@@ -42,34 +80,65 @@
 	</target>
 
 	<target name="init" depends="check-dojo.home, check-dojo.revision">
-		<echo>dojo.home=${dojo.home}</echo>
-		<echo>dojo.revision=${dojo.revision}</echo>
+		<echo>dojo.home         ${dojo.home}</echo>
+		<echo>dojo.revision     ${dojo.revision}</echo>
+		<echo>dojo.profile      ${dojo.profile}</echo>
+		<echo>dojo.profileFile  ${dojo.profileFile}</echo>
+		<echo>dojo.optimize     ${dojo.optimize}</echo>
+		<echo>dojo.cssOptimize  ${dojo.cssOptimize}</echo>
+		<echo>dojo.loader       ${dojo.loader}</echo>
+	</target>
+	
+	<target name="build" depends="init">
+      <java jar="${dojo.home}/util/shrinksafe/custom_rhino.jar" 
+            dir="${dojo.home}/util/buildscripts" fork="true" failonerror="true">
+        <arg value="build.js"/> 
+        <arg value="profile=${dojo.profile}"/> 
+        <!--<arg value="profileFile=${dojo.profileFile}"/> TODO: how do you make this conditional? -->
+        <arg value="action=${dojo.action}"/>
+        <arg value="version=${dojo.version}"/> 
+        <arg value="releaseDir=${build}"/> 
+        <arg value="optimize=${dojo.optimize}"/> 
+        <arg value="layerOptimize=${dojo.layerOptimize}"/> 
+        <arg value="cssOptimize=${dojo.cssOptimize}"/> 
+        <arg value="loader=${dojo.loader}"/> 
+        <arg value="localeList=${dojo.localeList}"/> 
+        <arg value="copyTests=${dojo.copyTests}"/> 
+        <arg value="releaseName="/>
+      </java>
 	</target>
 
-	<target name="jar" depends="init">
-		<ant dir="${dojo.home}/buildscripts" target="release" inheritAll="false">
-			<property name="docless" value="true"/>
-			<property name="release_dir" location="build/org/apache/cocoon/dojo/resources"/>
-			<property name="revision" value="${dojo.revision}"/>
-			<property name="profile" value="widget"/>
-			<property name="version" value="0.4.3"/>
-		</ant>
+	<target name="jar" depends="build">
 
+    <!-- remove demos, useless files -->
 		<delete includeemptydirs="true">
-			<!-- remove demos, useless files and js sources (they're all packed in dojo.js) -->
-			<fileset dir="build/org/apache/cocoon/dojo/resources"
-			       includes="CHANGELOG, README, build.txt, dojo.js.uncompressed.js, DojoFileStorageProvider.jar"/>
-			<fileset dir="build/org/apache/cocoon/dojo/resources/demos"/>
-			<fileset dir="build/org/apache/cocoon/dojo/resources/release"/>
-			<fileset dir="build/org/apache/cocoon/dojo/resources/tests"/>
-
-			<!--<fileset dir="build/org/apache/cocoon/dojo/resources/src"
-				   includes="*.js, **/*.js"/>-->
-
+			<fileset dir="${build}/dojo" includes="changes.txt, build.txt"/>
+			<fileset dir="${build}/dijit/demos"/>
+			<fileset dir="${build}/dijit/bench"/>
 		</delete>
 
+    <!-- make a jar of the dojo build -->
 		<jar destfile="dojo-rsrc-${dojo.revision}.jar" basedir="build"/>
 
 		<echo>You can now replace the dojo lib in "lib/optional" with dojo-rsrc-${dojo.revision}.jar</echo>
 	</target>
+
+	<target name="nano" depends="init">
+
+    <!-- clean the build directory -->
+    <delete dir="build"/>
+    
+    <!-- copy in the required static resources for Cocoon to use a CDN for Dojo -->
+    <copy file="${dojo.home}/dojo/resources/blank.html" todir="${build}/dojo/resources"/>
+    <copy file="${dojo.home}/dojo/resources/iframe_history.html" todir="${build}/dojo/resources"/>
+    <copy file="${dojo.home}/dojo/resources/LICENSE" todir="${build}/dojo/resources"/>
+    <copy file="${dojo.home}/dojo/LICENSE" todir="${build}/dojo"/>
+
+    <!-- make a jar of the nano build -->
+		<jar destfile="nano-dojo-rsrc-${dojo.revision}.jar" basedir="build"/>
+
+		<echo>You can now replace the dojo lib in "lib/optional" with dojo-rsrc-${dojo.revision}.jar</echo>
+	</target>
+
+
 </project>

Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/BUHandler.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/BUHandler.js?rev=694343&r1=694342&r2=694343&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/BUHandler.js (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/BUHandler.js Thu Sep 11 09:37:27 2008
@@ -25,36 +25,30 @@
  */
 
 dojo.provide("cocoon.ajax.BUHandler");
-dojo.require("dojo.dom");
+
 dojo.require("cocoon.ajax.common");
 dojo.require("cocoon.ajax.insertion");
 
-cocoon.ajax.BUHandler = function() { };
-
-// Default highlight effect (none)
-cocoon.ajax.BUHandler.highlight = null;
-
-dojo.lang.extend(cocoon.ajax.BUHandler, {
-
+dojo.declare("cocoon.ajax.BUHandler", null, {
+	highlight: null, // Default highlight effect (none)
+	
     processResponse: function(doc) {
 		var base = doc.documentElement;
 
 		var nodes = [];
 		if (base.nodeName.toLowerCase() == "bu:document") {
 			nodes = base.childNodes;
-			dojo.debug("got response using: XMLHTTPTransport");
 		} else {
-			base = dojo.byId("browser-update", doc);
+			base = dojo.byId("browser-update", doc) || doc.getElementsByTagName("form")[0];
 			if (base) {
 				nodes = base.childNodes;
-				dojo.debug("got response using: IframeTransport");
 			} else {
 				this.handleError("No response data found", doc);
 			}
 		}
 		for (var i = 0; i < nodes.length; i++) {
 			var node = nodes[i];
-			if (node.nodeType == dojo.dom.ELEMENT_NODE) {
+			if (node.nodeType === 1 /*ELEMENT_NODE*/) {
 				var handler = node.nodeName.replace(/.*:/, "").toLowerCase();
 				if (handler == "textarea") handler = node.getAttribute("name");
 				var handlerFunc = this.handlers[handler];
@@ -79,7 +73,8 @@
 					doc.write(response.responseText);
 					doc.close();
 				} else if (response.childNodes) {
-					dojo.dom.copyChildren(doc,response);
+					dojo.require("dojox.data.dom"); // NB. Marked as experimental
+					dojox.data.dom.replaceChildren(doc,response.childNodes);
 				}
 			}
 		}
@@ -93,10 +88,17 @@
 				return;
 			}
 			// Get the first child element (the first child may be some text!)
-			var firstChild = dojo.dom.getFirstChildElement(element);
-			if (!firstChild && element.nodeName.toLowerCase() == "textarea")
-				firstChild = dojo.dom.createDocumentFromText(element.value).documentElement;
-
+			//var firstChild = dojo.dom.getFirstChildElement(element);
+			
+			var firstChild = element.firstChild;
+			while(firstChild && firstChild.nodeType != 1 /*ELEMENT_NODE*/){
+				firstChild = firstChild.nextSibling;
+			}
+			
+			if (!firstChild && element.nodeName.toLowerCase() == "textarea") {
+				dojo.require("dojox.data.dom"); // NB. Marked as experimental
+				firstChild = dojox.data.dom.createDocument(element.value).documentElement;
+			}
 			var oldElement = document.getElementById(id);
 
 			if (!oldElement) {
@@ -110,17 +112,21 @@
 			}
 
 			/* update the label */
-      var nextChild = dojo.dom.getNextSiblingElement(firstChild);
-      if (nextChild) {
-          cocoon.ajax.BUHandler.Helper.replaceLabel(nextChild);
-      }
+
+		    var nextChild = firstChild.nextSibling;
+            while (nextChild && nextChild.nodeType != 1 /*ELEMENT_NODE*/){
+                nextChild = nextChild.nextSibling;
+            }
+            if (nextChild) {
+              cocoon.ajax.BUHandler.Helper.replaceLabel(nextChild);
+            }
 		}
 	}
 });
 
 cocoon.ajax.BUHandler.Helper = function() { };
 
-dojo.lang.mixin(cocoon.ajax.BUHandler.Helper, {
+dojo.mixin(cocoon.ajax.BUHandler.Helper, {
     replaceLabel: function(element) {
           var oldElement = document.getElementById(element.getAttribute("id"));
           if (oldElement) {

Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/FormUploadProgress.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/FormUploadProgress.js?rev=694343&r1=694342&r2=694343&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/FormUploadProgress.js (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/FormUploadProgress.js Thu Sep 11 09:37:27 2008
@@ -15,140 +15,117 @@
  * limitations under the License.
  */
 
- /*
-    FormUploadProgress Widget
-
-    This is a Dojo Widget for Cocoon that monitors the progress of uploads from a form.
-
-    It works by sending periodical XMLHttp calls to Cocoon in the background, while the files are being uploaded.
-    Cocoon responds with JSON data which is used to draw the progress bar and status strings.
-
-    @version $Id$
+dojo.provide("cocoon.ajax.FormUploadProgress");
+dojo.require("dijit.ProgressBar");
 
+/**
+ * Ajax Upload Progress Bar Widget.
+ * A wrapper for dijit.ProgressBar that polls the server during uploads
+ * and displays the status in a ProgressBar
+ *
+ * NOTE: introduced in 2.1.?
+ *
+ * @version $Id$
  */
+dojo.declare("cocoon.ajax.FormUploadProgress", [dijit.ProgressBar], {	
 
-dojo.provide("cocoon.ajax.FormUploadProgress");
-dojo.require("dojo.event");
-dojo.require("dojo.widget.HtmlWidget");
-dojo.require("dojo.lang.timing.Timer");
-
-dojo.widget.defineWidget(
-    "cocoon.ajax.FormUploadProgress",
-    dojo.widget.HtmlWidget,
-    {
-        // override properties (these may be overridden by using the same-named attributes on the widget tag)
-        background: "#BFCCDF",      // the colour of the progress bar
-        color: "#336699",           // the colour of the text and border
-        ready: "Ready.",            // Strings the widget needs, that may require external i18n transformation
-        connecting: "Connecting ...",
-
-        // widget API properties
-        ns: "forms",
-        widgetType: "FormUploadProgress",
-        isContainer: true,
-        templateString: '<div class="FormUpload">' +
-                            '<div class="FormUploadUser" dojoAttachPoint="containerNode"></div>' +
-                            '<div class="FormUploadProgress" style="border:1px solid ${this.color};margin:2px;height: 16px;position:relative;">' +
-                                '<div style="width:0px;background:${this.background};position:absolute;top:0;left:0;width:0;right:0;" class="bar" dojoAttachPoint="barNode">&nbsp;</div>' +
-                                '<div style="color:${this.color};position:absolute;top:0;left:0;bottom:0;right:0;background:none;padding:2px;font-size:10px;overflow:hidden;" class="data" dojoAttachPoint="msgNode">${this.ready}</div>' +
-                            '</div>' +
-                         '</div>',
-
-        // DOM Nodes in the template
-        containerNode: null,   // the node containing the user content
-        msgNode: null,         // the node containing the progress status text
-        barNode: null,         // the progress bar node
-
-        // private properties
-        _form: null,           // this widget's form
-        _target: null,         // the form's *Form widget
-        _timer: null,          // timer for periodical updates
-        _busy: false,          // busy getting the status
-        _delay: 2000,          // 2 secs between status calls
-
-        // widget interface
-        postCreate: function(){
-            // work out where to attach the event listener
-            this._form = dojo.dom.getFirstAncestorByTag(this.domNode, "form");
-            if (this._form) {
-                var dojoId = this._form.getAttribute("dojoWidgetId");
-                var formWidget = dojo.widget.byId(dojoId);
-                if (formWidget) { // use the *Form Widget if there is one
-                    this._target = formWidget;
-                    dojo.event.connect("after", this._target, "submit", this, "_startUpload");
-                } else { // otherwise use the form itself
-                    dojo.event.connect("after", this._form, "onsubmit", this, "_startUpload");
-                }
-            } else {
-                throw new Error("The FormUploadProgress widget may only be used inside a form.");
-            }
-        },
-
-        // widget interface
-        destroy: function(){
-            if (this._target) {
-                dojo.event.disconnect("after", this._target, "submit", this, "_startUpload");
-            } else if (this._form) {
-                dojo.event.disconnect("after", this._form, "onsubmit", this, "_startUpload");
-            }
-        },
-
-        // private widget funtions
-
-        // event handler, should fire after the forms starts submitting
-        _startUpload: function(event) {
-            if (this._checkForActiveFile(this._form)) {
-                this._timer = new dojo.lang.timing.Timer(this._delay);
-                this._timer.onTick = dojo.lang.hitch(this, function() { this._getStatus() });
-                this._timer.onStart = this._timer.onTick;
-                this._timer.start();
-                this.msgNode.innerHTML = this.connecting;
-            }
-        },
-
-        // get the current upload status from Cocoon
-        _getStatus: function() {
-            if (this._busy) return; // only one request at a time
-            dojo.io.bind({
-                url: new dojo.uri.Uri(djConfig["baseRelativePath"], "../../../_cocoon/system/ajax/upload/status"),
-                mimetype: "text/json",
-                useCache: false,
-                handle: dojo.lang.hitch(this, function(type, data, evt) {
-                    if (type == "load") {
-                        this._update(data);
-                        this._busy = false;
-                    } else if (type == "error") {
-                        dojo.debug("FormUploadProgress - status request failed");
-                    }
-                }),
-            });
-            this._busy = true;
-        },
-
-        // perform the display update
-        _update: function(status) {
-            if (!status) return;
-            if (status.sent) {
-                if (status.finished) {
-                    this.barNode.style.width = "100%";
-                    this._timer.stop();
-                } else {
-                    this.barNode.style.width = status.percent + "%";
-                }
-            }
-            if (status.message) this.msgNode.innerHTML = status.message;
-        },
-
-        // look to see if there are active (file has been chosen) file-upload fields in the form
-        _checkForActiveFile: function(node) {
-            var hasFile = false;
-            var inputs = node.getElementsByTagName("input");
-            dojo.lang.forEach(inputs, function(input){
-                if(hasFile){ return; }
-                if(input.getAttribute("type")=="file" && input.value){
-                    hasFile = true;
-                }
-            });
-            return hasFile;
-        }
+  statusUri: dojo.moduleUrl("cocoon.ajax", "../../../system/ajax/upload/status").toString(), // this is not great
+
+  progress: "0%", // prime the progress bar to accept percentages
+  templateString: "<div class=\"FormUpload\"><div class=\"FormUploadUser\" dojoAttachPoint=\"containerNode\"></div><div class=\"dijitProgressBar dijitProgressBarEmpty\"\r\t><div waiRole=\"progressbar\" tabindex=\"0\" dojoAttachPoint=\"internalProgress\" class=\"dijitProgressBarFull\"\r\t\t><div class=\"dijitProgressBarTile\"></div\r\t\t><span style=\"visibility:hidden\">&nbsp;</span\r\t></div\r\t><div dojoAttachPoint=\"label\" class=\"dijitProgressBarLabel\" id=\"${id}_label\">&#160;</div\r\t><img dojoAttachPoint=\"inteterminateHighContrastImage\" class=\"dijitProgressBarIndeterminateHighContrastImage\"\r\t></img\r></div></div>",
+  
+  constructor: function() {
+    this.form = null;   // the form I am in
+    this.target = null; // the form widget
+    this.timer = null;  
+    this.busy = false;
+    this.delay = 2000;
+  }, 
+
+  // Widget interface
+  postCreate: function() {
+    this.inherited(arguments);
+    this.startedHidden = this.domNode.style.visibility !== "visible";
+    var el = this.domNode.parentNode
+    while (el && el.tagName && el.tagName.toLowerCase() !== "form") el = el.parentNode; // find my form
+    this.form = el && el.tagName && el.tagName.toLowerCase() === "form" ? el : null;
+    this.target = dijit.byNode(this.form);
+    if (this.target) {
+      this.afterSubmitSubscription = dojo.subscribe(this.target.getAfterSubmitTopic(), this, this.startUpload);
+    } else {
+      throw new Error("FormUploadProgress Error: ", "This may only be used inside a form widget.");
+    }    
+  },
+  
+  // Widget interface
+  destroy: function() {
+    this.inherited(arguments);
+    dojo.unsubscribe(this.afterSubmitSubscription);
+  },
+    
+  // event handler, should fire after the forms starts submitting
+  startUpload: function() {
+    if (this.checkForActiveFile(this.form)) {
+      if (this.startedHidden) {
+        this.domNode.style.visibility = "visible"; 
+        dojo.fadeIn({ duration: 500, node: this.domNode }).play();
+      }
+      this.indeterminate = true;
+      this.update({progress:"0%"});
+      this.timer = setTimeout(dojo.hitch(this, this.getStatus), this.delay);
+    }
+  },
+
+  // get the status of the file upload from the server
+  getStatus: function() {
+    if (this.busy) return; // only deal with one request at a time
+    dojo.xhrGet({
+      url: this.statusUri,
+      preventCache: true,
+      handleAs: "json-comment-filtered",
+      load: dojo.hitch(this, function(response) {
+        this.status = response;
+        this.busy = false;
+        this._update();
+      }),
+      error: dojo.hitch(this, function(){
+        console.error("FormUploadProgress Error: ", "Status request failed");
+      })
+    });
+    this.busy = true;
+  },
+  
+  // update the widget with the new data
+  _update: function() {
+    if (this.status) {
+      this.indeterminate = false;
+      if (this.status.finished) {
+        this.update({progress:"100%"});
+        if (this.startedHidden) 
+          dojo.fadeOut({ duration: 500, node: this.domNode }).play(5000); // fade after 5 secs
+        return;
+      } else if (this.status.percent) {
+        this.update({progress:this.status.percent + "%"});
+      }
+    }
+    this.timer = setTimeout(dojo.hitch(this, this.getStatus), this.delay);
+  },
+  
+  // ProgressBar interface - provide a status message
+  report: function() {
+    return this.status && this.status.message ? this.status.message : "";
+  },
+  
+  // look to see if there are active (file has been chosen) file-upload fields in the form
+  checkForActiveFile: function(node) {
+    var hasFile = false;
+    var inputs = node.getElementsByTagName("input");
+    dojo.forEach(inputs, function(input){
+      if (hasFile){ return; }
+      if (input.getAttribute("type") === "file" && input.value){
+        hasFile = true;
+      }
+    });
+    return hasFile;
+  }
 });

Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/PartialLink.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/PartialLink.js?rev=694343&r1=694342&r2=694343&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/PartialLink.js (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/PartialLink.js Thu Sep 11 09:37:27 2008
@@ -16,7 +16,7 @@
  */
 dojo.provide("cocoon.ajax.PartialLink");
 
-dojo.require("dojo.widget.DomWidget");
+dojo.require("dijit._Widget");
 dojo.require("cocoon.ajax.common");
 
 /**
@@ -25,33 +25,24 @@
  * @version $Id$
  */
 
-dojo.widget.defineWidget(
+dojo.declare(
     "cocoon.ajax.PartialLink",
-    dojo.widget.DomWidget,
+    dijit._Widget,
  {
-	// Properties
-	href: "",
-	target: "",
-
-	// Widget definition
-	ns: "forms",
-	widgetType: "PartialLink",
-    isContainer: false,
-    preventClobber: true, // don't clobber our node
-
-    fillInTemplate: function(args, frag) {
-
-	    if (this.target.indexOf("#") < 0) {
-	        dojo.debug("PartialLink: wrong value for 'target' attribute: " + this.target);
-	        return;
-	    }
-
-	    dojo.event.connect(this.domNode, "onclick", this, "onClick");
+    // Properties from HTML Attributes
+    href: "",   // String, the url from which to load the page fragment
+    target: "", // String, the ID of the element to be updated
+
+    postCreate: function() {
+        if (this.target.indexOf("#") < 0) {
+            console.debug("PartialLink: wrong value for 'target' attribute: " + this.target);
+            return;
+        }
+        dojo.connect(this.domNode, "onclick", this, "onClick");
     },
 
     onClick: function(event) {
         event.preventDefault();
-        var _this = this;
-        cocoon.ajax.update(_this.href, _this.target);
+        cocoon.ajax.update(this.href, this.target);
     }
 });

Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/common.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/common.js?rev=694343&r1=694342&r2=694343&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/common.js (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/common.js Thu Sep 11 09:37:27 2008
@@ -19,13 +19,11 @@
  * Frequently used Ajax functions
  */
 
-dojo.provide("cocoon.ajax");
 dojo.provide("cocoon.ajax.common");
 dojo.require("cocoon.ajax.insertion");
-dojo.require("dojo.lfx.html");
+dojo.require("dojox.fx");
 
-
-dojo.lang.mixin(cocoon.ajax, {
+dojo.mixin(cocoon.ajax, {
     /**
      * Update the current page with some remote content.
      * @param href the URL of the remote content
@@ -36,9 +34,8 @@
      *        precedence. If no insertion is speficied, it default to "inside".
      */
     update: function(href, target, insertion) {
-
         // If target is a string, parse it. Otherwise, assume it's an element
-        if (dojo.lang.isString(target)) {
+        if (dojo.isString(target)) {
             var split = target.split("#");
             if (split.length == 2) {
                 insertion = split[0];
@@ -48,18 +45,19 @@
             }
         }
 
-        if (dojo.lang.isString(insertion)) {
+        if (dojo.isString(insertion)) {
             insertion = cocoon.ajax.insertion[insertion];
         }
 
         insertion = insertion || cocoon.ajax.insertion.inside;
 
-        dojo.io.bind({
+        dojo.xhrGet({
 		    url: href,
-		    load: function(type, data, evt){
-		        insertion(target, data);
+		    load: function(response, args){
+		        insertion(target, response);
+		        return response;
 		    },
-		    mimetype: "text/plain"
+		    handleAs: "text"
 		    // TODO: add an error-handling function
 		});
 
@@ -68,15 +66,7 @@
     /**
      */
     periodicalUpdate: function(delay, href, target, insertion) {
-        dojo.require("dojo.lang.timing.Timer");
-        var timer = new dojo.lang.timing.Timer(delay);
-        timer.onTick = function() {
-            cocoon.ajax.update(href, target, insertion);
-        };
-
-        timer.onStart = timer.onTick;
-        timer.start();
-        return timer;
+        return setInterval(function(){cocoon.ajax.update(href, target, insertion)}, delay);
     },
 
     // Update effects. These function can be used to set cocoon.ajax.BUHandler.highlight
@@ -84,31 +74,31 @@
         // highlight effects - transition the background colour
         highlight: { // these are intended to look like a semi-opaque layer of colour over white
             yellow: function(node) {
-                dojo.lfx.html.highlight(node, [240, 238, 133], 1000).play(0);
+                dojox.fx.highlight({node: node, color: "#F0EE85", duration: 1000});
             },
             blue: function(node) {
-                dojo.lfx.html.highlight(node, [141, 133, 252], 1000).play(0);
+                dojox.fx.highlight({node: node, color: "#5685FC", duration: 1000});
             },
             red: function(node) {
-                dojo.lfx.html.highlight(node, [220, 133, 133], 1000).play(0);
+                 dojox.fx.highlight({node: node, color: "#DC8585", duration: 1000});
             },
             green: function(node) {
-                dojo.lfx.html.highlight(node, [159, 223, 133], 1000).play(0);
+                 dojox.fx.highlight({node: node, color: "#9FDF85", duration: 1000});
             },
             grey: function(node) {
-                dojo.lfx.html.highlight(node, [128, 128, 128], 1000).play(0);
+                dojox.fx.highlight({node: node, color: "#808080", duration: 1000});
             },
             purple: function(node) {
-                dojo.lfx.html.highlight(node, [197, 133, 220], 1000).play(0);
+                dojox.fx.highlight({node: node, color: "#C585DC", duration: 1000});
             },
             orange: function(node) {
-                dojo.lfx.html.highlight(node, [252, 202, 133], 1000).play(0);
+                dojox.fx.highlight({node: node, color: "#FCCA85", duration: 1000});
             }
         },
         blink: function(node) { // hide then show the node
-            var opacity = dojo.html.getOpacity(node);
-            dojo.html.setOpacity(node, 0.2);
-            setTimeout(function() {dojo.html.setOpacity(node, opacity);}, 600);
+            var opacity = dojo._getOpacity(node);
+            dojo._setOpacity(node, 0.2);
+            setTimeout(function() {dojo._setOpacity(node, opacity);}, 600);
         }
         // add more effects?
     }

Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/insertion.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/insertion.js?rev=694343&r1=694342&r2=694343&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/insertion.js (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/resources/js/insertion.js Thu Sep 11 09:37:27 2008
@@ -22,11 +22,11 @@
  */
 
 dojo.provide("cocoon.ajax.insertion");
-dojo.require("dojo.dom");
+dojo.provide("cocoon.ajax.insertionHelper");
+dojo.require("dojo.parser");
+dojo.require("dijit._base");
 
-cocoon.ajax.insertion = {};
-
-dojo.lang.mixin(cocoon.ajax.insertion, {
+dojo.mixin(cocoon.ajax.insertion, {
 
 	/**
 	 * Inserts before the reference node
@@ -81,7 +81,7 @@
             // Destroy and remove all children
             while (refElt.hasChildNodes()) {
                 var firstChild = refElt.firstChild;
-                if (firstChild.nodeType == dojo.dom.ELEMENT_NODE) {
+                if (firstChild.nodeType === 1 /*ELEMENT_NODE*/) {
                     cocoon.ajax.insertionHelper.destroy(firstChild);
                 }
                 refElt.removeChild(firstChild);
@@ -103,9 +103,7 @@
     }
 });
 
-cocoon.ajax.insertionHelper = {};
-
-dojo.lang.mixin(cocoon.ajax.insertionHelper, {
+dojo.mixin(cocoon.ajax.insertionHelper, {
 	/**
 	 * Imports an element into a document, taking care of using the correct implementation
 	 * so that the browser interprets it as displayable XML.
@@ -116,22 +114,22 @@
 	 * @return { element: <em>imported_element</em>, scripts: <em>array_of_script_text</em> }
 	 */
     importNode: function(node, targetDoc) {
-	    if(node.xml || dojo.lang.isString(node)) {
+	    if(node.xml || dojo.isString(node)) {
 	        // IE or text
-	        var text = dojo.lang.isString(node) ? node : node.xml;
+	        var text = dojo.isString(node) ? node : node.xml;
 	        var div = targetDoc.createElement("DIV");
 
 	        // Code below heavily inspired by the Prototype library
 	        var scriptExpr = "(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)";
-            var textWithoutScripts = text.replace(new RegExp(scriptExpr, 'img'), '');
+					var textWithoutScripts = text.replace(new RegExp(scriptExpr, 'img'), '');
 
-            // Internet Explorer can't handle empty <textarea .../> elements, so replace
-            // them with <textarea></textarea>
-            var textareaExpr = "(<textarea[^<]*)\/>";
-            var textAreaMatches = textWithoutScripts.match(textareaExpr);
-            var textFixed = textWithoutScripts.replace(new RegExp(textareaExpr, 'img'), "$1></textarea>");
+					// Internet Explorer can't handle empty <textarea .../> elements, so replace
+					// them with <textarea></textarea>
+					var textareaExpr = "(<textarea[^<]*)\/>";
+					var textAreaMatches = textWithoutScripts.match(textareaExpr);
+					var textFixed = textWithoutScripts.replace(new RegExp(textareaExpr, 'img'), "$1></textarea>");
 
-            // Update screen with removed scripts
+					// Update screen with removed scripts
 	        div.innerHTML = textFixed;
 
 	        var matchAll = new RegExp(scriptExpr, 'img');
@@ -143,7 +141,13 @@
 		            scripts.push(allMatches[i].match(matchOne)[1]);
 		        }
 		    }
-	        return { element: dojo.dom.getFirstChildElement(div), scripts: scripts };
+		    
+		    var firstChild = div.firstChild;
+				while(firstChild && firstChild.nodeType != 1 /*ELEMENT_NODE*/){
+					firstChild = firstChild.nextSibling;
+				}
+		    
+	      return { element: firstChild, scripts: scripts };
 
 	    } else {
 	        var scripts = new Array();
@@ -158,7 +162,7 @@
 	 */
 	_importDomNode: function(node, targetDoc, scripts) {
 	    switch(node.nodeType) {
-	        case dojo.dom.ELEMENT_NODE:
+	        case 1 /*ELEMENT_NODE*/:
 	            if (node.nodeName.toLowerCase() == "script") {
 	                // Collect scripts
 	                scripts.push(node.firstChild && node.firstChild.nodeValue);
@@ -180,79 +184,64 @@
 	            return element;
 	        break;
 
-	        case dojo.dom.TEXT_NODE:
+	        case 3 /*TEXT_NODE*/:
 	            return targetDoc.createTextNode(node.nodeValue);
 	        break;
 
-	        case dojo.dom.CDATA_SECTION_NODE:
+	        case 4 /*CDATA_SECTION_NODE*/:
 	            return targetDoc.createTextNode(node.nodeValue);
 	        break;
 	    }
 	},
 
 	_runScripts: function(imported) {
-        // Evaluate scripts
-        for (var i = 0; i < imported.scripts.length; i++) {
-            eval(imported.scripts[i]);
-        }
+			// Evaluate scripts
+			for (var i = 0; i < imported.scripts.length; i++) {
+					eval(imported.scripts[i]);
+			}
 	},
 
-    insert: function(refElt, content, insertFunc) {
-        refElt = dojo.byId(refElt, content);
-        var imports = this.importNode(content, refElt.ownerDocument);
-        insertFunc(refElt, imports.element);
-        this._runScripts(imports);
-        return this.parseDojoWidgets(imports.element);
-    },
-
-    destroy: function(element) {
-	    var widget = dojo.widget.byNode(element);
-	    if (widget) {
-	        // Dojo will destroy all its children
-	        widget.destroy(true, true);
-	    } else {
-	        // Recurse until we eventually find a widget
-	        var children = element.childNodes;
-	        for (var i = 0; i < children.length; i++) {
-	            var child = children[i];
-	            if (child.nodeType == dojo.dom.ELEMENT_NODE) {
-	                this.destroy(child);
-	            }
-	        }
-	    }
+	insert: function(refElt, content, insertFunc) {
+			refElt = dojo.byId(refElt, content);
+			var imports = this.importNode(content, refElt.ownerDocument);
+			insertFunc(refElt, imports.element);
+			this._runScripts(imports);
+			this.parseDojoWidgets(imports.element)
+			return imports.element;
 	},
-
+	
 	parseDojoWidgets: function(element) {
-	    // Find a parent widget (if any) so that Dojo can maintain its widget tree
-	    var parentWidget = this.findParentWidget(element);
-		var parser = new dojo.xml.Parse();
-
-		// FIXME: parser.parseElement() parses the _children_ of an element, whereas we want here
+		// parser parses the _children_ of an element, whereas we want here
 		// the element itself to be parsed. Parsing its parent is not an option as we don't want
 		// to parse the siblings. So place it in a temporary div that we'll trash afterwards.
 		var div = document.createElement("DIV");
 		element.parentNode.replaceChild(div, element);
 		div.appendChild(element);
-		var frag = parser.parseElement(div, null, true);
-		dojo.widget.getParser().createComponents(frag, parentWidget);
+		dojo.parser.parse(div)
 		// Get again the first child of the div, which may no more be the original one
 		// if it's a widget
 		element = div.firstChild;
 		div.parentNode.replaceChild(element, div);
-		parentWidget && parentWidget.onResized();
-
 		return element;
 	},
 
-	findParentWidget: function(element) {
-	    var parent = element.parentNode;
-	    var widget;
-	    while (parent && !widget) {
-	        var widget = dojo.widget.byNode(parent);
-	        if (widget) {
-	            return widget;
+  // recursively destroy nested Dojo Widgets
+  destroy: function(element) {
+	    var widget = dijit.byNode(element);
+	    if (widget) {
+	        // Dojo will destroy all its children
+	        // console.debug("insertion - destroying widget: " + widget.id);
+	        widget.destroyRecursive();
+	    } else {
+	        // Recurse until we eventually find a widget
+	        var children = element.childNodes;
+	        for (var i = 0; i < children.length; i++) {
+	            var child = children[i];
+	            if (child.nodeType === 1 /*ELEMENT_NODE*/) {
+	                // console.debug("insertion - recursing into element: " + child.tagName);
+	                this.destroy(child);
+	            }
 	        }
-	        parent = parent.parentNode;
 	    }
 	}
 });
\ No newline at end of file

Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/system/System.Upload.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/system/System.Upload.js?rev=694343&r1=694342&r2=694343&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/system/System.Upload.js (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/resources/org/apache/cocoon/ajax/system/System.Upload.js Thu Sep 11 09:37:27 2008
@@ -49,7 +49,7 @@
 
 */
 System.Upload.status = function(){
-    var json = "{}";
+    var json = "/* {} */"; // the pipeline sends text/json-comment-filtered as a security measure
     var i18n = null;
     var status = cocoon.session.getAttribute(MultipartParser.UPLOAD_STATUS_SESSION_ATTR);
     if (status instanceof Map && status.size() > 0) {
@@ -73,7 +73,7 @@
             tempMap.put("message", System.JSON.getI18nMessage("progress.sent", catalogue, [percent, sent, total, status.get("filename")]));
             tempMap.put("percent", percent);
         }
-        json = System.JSON.serializeMap(tempMap);
+        json = "/* " + System.JSON.serializeMap(tempMap) + " */"; // the pipeline sends text/json-comment-filtered as a security measure
     }
     cocoon.sendPage("send-json", {json: json});
 };

Modified: cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/samples/linked-updater.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/samples/linked-updater.xml?rev=694343&r1=694342&r2=694343&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/samples/linked-updater.xml (original)
+++ cocoon/branches/BRANCH_2_1_X-dojo1_1/src/blocks/ajax/samples/linked-updater.xml Thu Sep 11 09:37:27 2008
@@ -18,31 +18,28 @@
 <page>
   <title>Linked Updating</title>
   <!-- include ajax scripts -->
+  <script djConfig="isDebug: true, parseOnLoad: true" type="text/javascript" src="/_cocoon/resources/dojotoolkit/dojo/dojo.js"/>
   <script type="text/javascript">
-    // djConfig = { isDebug: true };
-  </script>
-  <script type="text/javascript" src="resources/dojo/dojo.js"/>
-  <!--<script type="text/javascript" src="_cocoon/resources/ajax/cocoon.js"/>-->
-  <script type="text/javascript">
-    dojo.require("dojo.widget.*");
-    dojo.registerModulePath("cocoon.ajax", "../ajax/js");
+    dojo.require("dojo.parser");
+    dojo.registerModulePath("cocoon.ajax", "../../ajax/js");
     dojo.require("cocoon.ajax.common");
-
-	function initTimer() {
-	    cocoon.ajax.periodicalUpdate(2000, "display-freememory", "freemem");
-	}
-	dojo.addOnLoad(initTimer);
-
-	function initClock() {
-  	cocoon.ajax.periodicalUpdate(1000, "display-clock", "clock");
-	}
-	dojo.addOnLoad(initClock);
-
-	function initClock1() {
-  	cocoon.ajax.periodicalUpdate(5000, "display-clock", "clock1");
-	}
- 	dojo.addOnLoad(initClock1);
-  dojo.debug("The current version of dojo is: ", dojo.version.toString());
+    dojo.require("cocoon.ajax.PartialLink");
+	
+	try{
+		dojo.addOnLoad(function() {
+			try{
+				cocoon.ajax.periodicalUpdate(2000, "display-freememory", "freemem");
+				cocoon.ajax.periodicalUpdate(1000, "display-clock", "clock");
+				cocoon.ajax.periodicalUpdate(5000, "display-clock", "clock1");
+				console.debug("The current version of dojo is: ", dojo.version.toString());
+			} catch (e) {
+				console.debug("Error in cocoon.ajax.periodicalUpdate : " + e);
+			}	
+			
+		});
+	} catch (e) {
+		console.debug("Error in dojo.addOnLoad : " + e);
+	}	
   </script>
 
 	<style>
@@ -57,12 +54,12 @@
 		<table width="100%">
 			<tr valign="top">
 				<td width="30%">
-					<a href="linked-updater-content-1" dojoType="ajax:PartialLink" target="replace#changeme">Click me to do a replace</a><br/>
-					<a href="linked-updater-content-2" dojoType="ajax:PartialLink" target="replace#changeme">Click me to do a different replace</a><br/>
-					<a href="linked-updater-content-3" dojoType="ajax:PartialLink" target="before#changeme">Click me to insert before</a><br/>
-					<a href="linked-updater-content-3" dojoType="ajax:PartialLink" target="top#changeme">Click me to insert at the top</a><br/>
-					<a href="linked-updater-content-3" dojoType="ajax:PartialLink" target="bottom#changeme">Click me to insert at the bottom</a><br/>
-					<a href="linked-updater-content-3" dojoType="ajax:PartialLink" target="after#changeme">Click me to insert after</a><br/>
+					<a href="linked-updater-content-1" dojoType="cocoon.ajax.PartialLink" target="replace#changeme">Click me to do a replace</a><br/>
+					<a href="linked-updater-content-2" dojoType="cocoon.ajax.PartialLink" target="replace#changeme">Click me to do a different replace</a><br/>
+					<a href="linked-updater-content-3" dojoType="cocoon.ajax.PartialLink" target="before#changeme">Click me to insert before</a><br/>
+					<a href="linked-updater-content-3" dojoType="cocoon.ajax.PartialLink" target="top#changeme">Click me to insert at the top</a><br/>
+					<a href="linked-updater-content-3" dojoType="cocoon.ajax.PartialLink" target="bottom#changeme">Click me to insert at the bottom</a><br/>
+					<a href="linked-updater-content-3" dojoType="cocoon.ajax.PartialLink" target="after#changeme">Click me to insert after</a><br/>
 					<p>Memory available on the server:
 					  <span id="freemem">[unknown]</span>
 					</p>



Mime
View raw message