You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2006/01/31 08:44:03 UTC

svn commit: r373750 [11/22] - in /jakarta/tapestry/trunk: ./ examples/AjaxWorkbench/src/context/WEB-INF/ examples/AjaxWorkbench/src/context/css/ examples/AjaxWorkbench/src/java/org/apache/tapestry/ajaxworkbench/components/ framework/src/descriptor/META...

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/Deferred.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/Deferred.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/Deferred.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/Deferred.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,372 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.rpc.Deferred");
+dojo.require("dojo.lang.func");
+
+dojo.rpc.Deferred = function(/* optional */ canceller){
+	/*
+	NOTE: this namespace and documentation are imported wholesale 
+		from MochiKit
+
+	Encapsulates a sequence of callbacks in response to a value that
+	may not yet be available.  This is modeled after the Deferred class
+	from Twisted <http://twistedmatrix.com>.
+
+	Why do we want this?  JavaScript has no threads, and even if it did,
+	threads are hard.  Deferreds are a way of abstracting non-blocking
+	events, such as the final response to an XMLHttpRequest.
+
+	The sequence of callbacks is internally represented as a list
+	of 2-tuples containing the callback/errback pair.  For example,
+	the following call sequence::
+
+		var d = new Deferred();
+		d.addCallback(myCallback);
+		d.addErrback(myErrback);
+		d.addBoth(myBoth);
+		d.addCallbacks(myCallback, myErrback);
+
+	is translated into a Deferred with the following internal
+	representation::
+
+		[
+			[myCallback, null],
+			[null, myErrback],
+			[myBoth, myBoth],
+			[myCallback, myErrback]
+		]
+
+	The Deferred also keeps track of its current status (fired).
+	Its status may be one of three things:
+
+		-1: no value yet (initial condition)
+		0: success
+		1: error
+
+	A Deferred will be in the error state if one of the following
+	three conditions are met:
+
+		1. The result given to callback or errback is "instanceof" Error
+		2. The previous callback or errback raised an exception while
+		   executing
+		3. The previous callback or errback returned a value "instanceof"
+			Error
+
+	Otherwise, the Deferred will be in the success state.  The state of
+	the Deferred determines the next element in the callback sequence to
+	run.
+
+	When a callback or errback occurs with the example deferred chain,
+	something equivalent to the following will happen (imagine that
+	exceptions are caught and returned)::
+
+		// d.callback(result) or d.errback(result)
+		if(!(result instanceof Error)){
+			result = myCallback(result);
+		}
+		if(result instanceof Error){
+			result = myErrback(result);
+		}
+		result = myBoth(result);
+		if(result instanceof Error){
+			result = myErrback(result);
+		}else{
+			result = myCallback(result);
+		}
+
+	The result is then stored away in case another step is added to the
+	callback sequence.	Since the Deferred already has a value available,
+	any new callbacks added will be called immediately.
+
+	There are two other "advanced" details about this implementation that
+	are useful:
+
+	Callbacks are allowed to return Deferred instances themselves, so you
+	can build complicated sequences of events with ease.
+
+	The creator of the Deferred may specify a canceller.  The canceller
+	is a function that will be called if Deferred.cancel is called before
+	the Deferred fires.	 You can use this to implement clean aborting of
+	an XMLHttpRequest, etc.	 Note that cancel will fire the deferred with
+	a CancelledError (unless your canceller returns another kind of
+	error), so the errbacks should be prepared to handle that error for
+	cancellable Deferreds.
+
+	*/
+	
+	this.chain = [];
+	this.id = this._nextId();
+	this.fired = -1;
+	this.paused = 0;
+	this.results = [null, null];
+	this.canceller = canceller;
+	this.silentlyCancelled = false;
+};
+
+dojo.lang.extend(dojo.rpc.Deferred, {
+	getFunctionFromArgs: function(){
+		var a = arguments;
+		if((a[0])&&(!a[1])){
+			if(dojo.lang.isFunction(a[0])){
+				return a[0];
+			}else if(dojo.lang.isString(a[0])){
+				return dj_global[a[0]];
+			}
+		}else if((a[0])&&(a[1])){
+			return dojo.lang.hitch(a[0], a[1]);
+		}
+		return null;
+	},
+
+	repr: function(){
+		var state;
+		if(this.fired == -1){
+			state = 'unfired';
+		}else if(this.fired == 0){
+			state = 'success';
+		} else {
+			state = 'error';
+		}
+		return 'Deferred(' + this.id + ', ' + state + ')';
+	},
+
+	toString: dojo.lang.forward("repr"),
+
+	_nextId: (function(){
+		var n = 1;
+		return function(){ return n++; };
+	})(),
+
+	cancel: function(){
+		/***
+		Cancels a Deferred that has not yet received a value, or is
+		waiting on another Deferred as its value.
+
+		If a canceller is defined, the canceller is called. If the
+		canceller did not return an error, or there was no canceller,
+		then the errback chain is started with CancelledError.
+		***/
+		if(this.fired == -1){
+			if (this.canceller){
+				this.canceller(this);
+			}else{
+				this.silentlyCancelled = true;
+			}
+			if(this.fired == -1){
+				this.errback(new Error(this.repr()));
+			}
+		}else if(	(this.fired == 0)&&
+					(this.results[0] instanceof dojo.rpc.Deferred)){
+			this.results[0].cancel();
+		}
+	},
+			
+
+	_pause: function(){
+		// Used internally to signal that it's waiting on another Deferred
+		this.paused++;
+	},
+
+	_unpause: function(){
+		// Used internally to signal that it's no longer waiting on
+		// another Deferred.
+		this.paused--;
+		if ((this.paused == 0) && (this.fired >= 0)) {
+			this._fire();
+		}
+	},
+
+	_continue: function(res){
+		// Used internally when a dependent deferred fires.
+		this._resback(res);
+		this._unpause();
+	},
+
+	_resback: function(res){
+		// The primitive that means either callback or errback
+		this.fired = ((res instanceof Error) ? 1 : 0);
+		this.results[this.fired] = res;
+		this._fire();
+	},
+
+	_check: function(){
+		if(this.fired != -1){
+			if(!this.silentlyCancelled){
+				dojo.raise("already called!");
+			}
+			this.silentlyCancelled = false;
+			return;
+		}
+	},
+
+	callback: function(res){
+		/*
+		Begin the callback sequence with a non-error value.
+		
+		callback or errback should only be called once on a given
+		Deferred.
+		*/
+		this._check();
+		this._resback(res);
+	},
+
+	errback: function(res){
+		// Begin the callback sequence with an error result.
+		this._check();
+		if(!(res instanceof Error)){
+			res = new Error(res);
+		}
+		this._resback(res);
+	},
+
+	addBoth: function(cb, cbfn){
+		/*
+		Add the same function as both a callback and an errback as the
+		next element on the callback sequence.	This is useful for code
+		that you want to guarantee to run, e.g. a finalizer.
+		*/
+		var enclosed = this.getFunctionFromArgs(cb, cbfn);
+		if(arguments.length > 2){
+			enclosed = dojo.lang.curryArguments(null, enclosed, arguments, 2);
+		}
+		return this.addCallbacks(enclosed, enclosed);
+	},
+
+	addCallback: function(cb, cbfn){
+		// Add a single callback to the end of the callback sequence.
+		var enclosed = this.getFunctionFromArgs(cb, cbfn);
+		if(arguments.length > 2){
+			enclosed = dojo.lang.curryArguments(null, enclosed, arguments, 2);
+		}
+		return this.addCallbacks(enclosed, null);
+	},
+
+	addErrback: function(cb, cbfn){
+		// Add a single callback to the end of the callback sequence.
+		var enclosed = this.getFunctionFromArgs(cb, cbfn);
+		if(arguments.length > 2){
+			enclosed = dojo.lang.curryArguments(null, enclosed, arguments, 2);
+		}
+		return this.addCallbacks(null, enclosed);
+		return this.addCallbacks(null, fn);
+	},
+
+	addCallbacks: function (cb, eb) {
+		// Add separate callback and errback to the end of the callback
+		// sequence.
+		this.chain.push([cb, eb])
+		if (this.fired >= 0) {
+			this._fire();
+		}
+		return this;
+	},
+
+	_fire: function(){
+		// Used internally to exhaust the callback sequence when a result
+		// is available.
+		var chain = this.chain;
+		var fired = this.fired;
+		var res = this.results[fired];
+		var self = this;
+		var cb = null;
+		while (chain.length > 0 && this.paused == 0) {
+			// Array
+			var pair = chain.shift();
+			var f = pair[fired];
+			if (f == null) {
+				continue;
+			}
+			try {
+				res = f(res);
+				fired = ((res instanceof Error) ? 1 : 0);
+				if(res instanceof dojo.rpc.Deferred) {
+					cb = function(res){
+						self._continue(res);
+					}
+					this._pause();
+				}
+			}catch(err){
+				fired = 1;
+				res = err;
+			}
+		}
+		this.fired = fired;
+		this.results[fired] = res;
+		if((cb)&&(this.paused)){
+			// this is for "tail recursion" in case the dependent
+			// deferred is already fired
+			res.addBoth(cb);
+		}
+	}
+});
+
+/*
+dojo.lang.extend(dojo.rpc.Deferred, {
+	
+	getFunctionFromArgs: function(){
+		var a = arguments;
+		if((a[0])&&(!a[1])){
+			if(dojo.lang.isFunction(a[0])){
+				return a[0];
+			}else if(dojo.lang.isString(a[0])){
+				return dj_global[a[0]];
+			}
+		}else if((a[0])&&(a[1])){
+			return dojo.lang.hitch(a[0], a[1]);
+		}
+		return null;
+	},
+
+	addCallback: function(cb, cbfn){
+		var enclosed = this.getFunctionFromArgs(cb, cbfn)
+		if(enclosed){
+			this._callbacks.push(enclosed);
+			if(this.results){
+				enclosed(this.results);
+			}
+		}else{
+			dojo.raise("Deferred: object supplied to addCallback is not a function");
+		}
+	},
+
+	addErrback: function(eb, ebfn){
+		var enclosed = this.getFunctionFromArgs(eb, ebfn)
+		if(enclosed){
+			this._errbacks.push(enclosed);
+			if(this.error){
+				enclosed(this.error);
+			}	
+		}else{
+			dojo.raise("Deferred: object supplied to addErrback is not a function");
+		}
+	},
+
+	addBoth: function(cb, eb){
+		this.addCallback(cb);
+		this.addErrback(eb);
+	},
+
+	callback: function(results){
+		this.results = results;
+		dojo.lang.forEach(this._callbacks, function(func){
+			func(results);
+		});
+	},
+
+	errback: function(error){
+		this.error = error;
+		dojo.lang.forEach(this._errbacks, function(func){
+			func(error);
+		});
+	}
+
+});
+*/

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/JotService.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/JotService.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/JotService.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/JotService.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,40 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.rpc.JotService");
+dojo.require("dojo.rpc.RpcService");
+dojo.require("dojo.rpc.JsonService");
+dojo.require("dojo.json");
+
+dojo.rpc.JotService = function(){
+	this.serviceUrl = "/_/jsonrpc";
+}
+
+dojo.inherits(dojo.rpc.JotService, dojo.rpc.JsonService);
+
+dojo.lang.extend(dojo.rpc.JotService, {
+	bind: function(method, parameters, deferredRequestHandler){
+		dojo.io.bind({
+			url: this.serviceUrl,
+			content: {
+				json: this.createRequest(method, parameters)
+			},
+			method: "POST",
+			mimetype: "text/json",
+			load: this.resultCallback(deferredRequestHandler),
+			preventCache: true
+		});
+	},
+
+	createRequest: function(method, params){
+		var req = { "params": params, "method": method, "id": this.lastSubmissionId++ };
+		return dojo.json.serialize(req);
+	}
+});

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/JsonService.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/JsonService.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/JsonService.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/JsonService.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,97 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.rpc.JsonService");
+dojo.require("dojo.rpc.RpcService");
+dojo.require("dojo.io.*");
+dojo.require("dojo.json");
+dojo.require("dojo.lang");
+
+dojo.rpc.JsonService = function(args){
+	// passing just the URL isn't terribly useful. It's expected that at
+	// various times folks will want to specify:
+	//	- just the serviceUrl (for use w/ remoteCall())
+	//	- the text of the SMD to evaluate
+	// 	- a raw SMD object
+	//	- the SMD URL
+	if(args){
+		if(dojo.lang.isString(args)){
+			// we assume it's an SMD file to be processed, since this was the
+			// earlier function signature
+
+			// FIXME: also accept dojo.uri.Uri objects?
+			this.connect(args);
+		}else{
+			// otherwise we assume it's an arguments object with the following
+			// (optional) properties:
+			//	- serviceUrl
+			//	- strictArgChecks
+			//	- smdUrl
+			//	- smdStr
+			//	- smdObj
+			if(args["smdUrl"]){
+				this.connect(args.smdUrl);
+			}
+			if(args["smdStr"]){
+				this.processSmd(dj_eval("("+args.smdStr+")"));
+			}
+			if(args["smdObj"]){
+				this.processSmd(args.smdObj);
+			}
+			if(args["serviceUrl"]){
+				this.serviceUrl = args.serviceUrl;
+			}
+			if(args["strictArgChecks"]){
+				this.strictArgChecks = args.strictArgChecks;
+			}
+		}
+	}
+}
+
+dojo.inherits(dojo.rpc.JsonService, dojo.rpc.RpcService);
+
+dojo.lang.extend(dojo.rpc.JsonService, {
+
+	bustCache: false,
+
+	lastSubmissionId: 0,
+
+	callRemote: function(method, params){
+		var deferred = new dojo.rpc.Deferred();
+		this.bind(method, params, deferred);
+		return deferred;
+	},
+
+	bind: function(method, parameters, deferredRequestHandler){
+		dojo.io.bind({
+			url: this.serviceUrl,
+			postContent: this.createRequest(method, parameters),
+			method: "POST",
+			mimetype: "text/json",
+			load: this.resultCallback(deferredRequestHandler),
+			preventCache:this.bustCache 
+		});
+	},
+
+	createRequest: function(method, params){
+		var req = { "params": params, "method": method, "id": this.lastSubmissionId++ };
+		var data = dojo.json.serialize(req);
+		dojo.debug("JsonService: JSON-RPC Request: " + data);
+		return data;
+	},
+
+	parseResults: function(obj){
+		if(obj["result"]){
+			return obj["result"];
+		}else{
+			return obj;
+		}
+	}
+});

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/RpcService.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/RpcService.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/RpcService.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/RpcService.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,114 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.rpc.RpcService");
+dojo.require("dojo.io.*");
+dojo.require("dojo.json");
+dojo.require("dojo.lang.func");
+dojo.require("dojo.rpc.Deferred");
+
+dojo.rpc.RpcService = function(url){
+	// summary
+	// constructor for rpc base class
+	if(url){
+		this.connect(url);
+	}
+}
+
+dojo.lang.extend(dojo.rpc.RpcService, {
+
+	strictArgChecks: true,
+	serviceUrl: "",
+
+	parseResults: function(obj){
+		// summary
+		// parse the results coming back from an rpc request.  
+   		// this base implementation, just returns the full object
+		// subclasses should parse and only return the actual results
+		return obj;
+	},
+
+	errorCallback: function(/* dojo.rpc.Deferred */ deferredRequestHandler){
+		// summary
+		// create callback that calls the Deferres errback method
+		return function(type, obj, e){
+			deferredRequestHandler.errback(e);
+		}
+	},
+
+	resultCallback: function(/* dojo.rpc.Deferred */ deferredRequestHandler){
+		// summary
+		// create callback that calls the Deferred's callback method
+		var tf = dojo.lang.hitch(this, 
+			function(type, obj, e){
+				var results = this.parseResults(obj);
+				deferredRequestHandler.callback(results); 
+			}
+		);
+		return tf;
+	},
+
+
+	generateMethod: function(/* string */ method, /* array */ parameters){
+		// summary
+		// generate the local bind methods for the remote object
+		var _this = this;
+		return function(){
+			var deferredRequestHandler = new dojo.rpc.Deferred();
+
+			// if params weren't specified, then we can assume it's varargs
+			if(
+				(!_this.strictArgChecks)||
+				(
+					(parameters != null)&&
+					(arguments.length != parameters.length)
+				)
+			){
+				dojo.raise("Invalid number of parameters for remote method.");
+				// put error stuff here, no enough params
+			} else {
+				_this.bind(method, arguments, deferredRequestHandler);
+			}
+
+			return deferredRequestHandler;
+		};
+	},
+
+	processSmd: function(/*json */object){
+
+		// summary
+		// callback method for reciept of a smd object.  Parse the smd and generate functions based on the description
+		dojo.debug("RpcService: Processing returned SMD.");
+		for(var n = 0; n < object.methods.length; n++){
+			dojo.debug("RpcService: Creating Method: this.", object.methods[n].name, "()");
+  			this[object.methods[n].name] = this.generateMethod(object.methods[n].name,object.methods[n].parameters);
+			if (dojo.lang.isFunction(this[object.methods[n].name])) {
+				dojo.debug("RpcService: Successfully created", object.methods[n].name, "()");
+			} else {
+				dojo.debug("RpcService: Failed to create", object.methods[n].name, "()");
+			}
+		}
+
+		this.serviceUrl = object.serviceUrl||object.serviceURL;
+		dojo.debug("RpcService: Dojo RpcService is ready for use.");
+	},
+
+	connect: function(/* string */smdUrl){
+		// summary
+		// connect to a remote url and retrieve a smd object
+		dojo.debug("RpcService: Attempting to load SMD document from:", smdUrl);
+		dojo.io.bind({
+			url: smdUrl,
+			mimetype: "text/json",
+			load: dojo.lang.hitch(this, function(type, object, e){ return this.processSmd(object); }),
+			sync: true
+		});		
+	}
+});

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/__package__.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/__package__.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/__package__.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/rpc/__package__.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,14 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.hostenv.conditionalLoadModule({
+	common: ["dojo.rpc.JsonService", false, false]
+});
+dojo.hostenv.moduleLoaded("dojo.rpc.*");

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/selection.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/selection.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/selection.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/selection.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,425 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.selection");
+dojo.require("dojo.lang.array");
+dojo.require("dojo.lang.func");
+dojo.require("dojo.math");
+
+dojo.selection.Selection = function(items, isCollection) {
+	this.items = [];
+	this.selection = [];
+	this._pivotItems = [];
+	this.clearItems();
+
+	if(items) {
+		if(isCollection) {
+			this.setItemsCollection(items);
+		} else {
+			this.setItems(items);
+		}
+	}
+}
+dojo.lang.extend(dojo.selection.Selection, {
+	items: null, // items to select from, order matters for growable selections
+
+	selection: null, // items selected, aren't stored in order (see sorted())
+	lastSelected: null, // last item selected
+
+	allowImplicit: true, // if true, grow selection will start from 0th item when nothing is selected
+	length: 0, // number of *selected* items
+
+	// if true, the selection is treated as an in-order and can grow by ranges, not just by single item
+	isGrowable: true,
+
+	_pivotItems: null, // stack of pivot items
+	_pivotItem: null, // item we grow selections from, top of stack
+
+	// event handlers
+	onSelect: function(item) {},
+	onDeselect: function(item) {},
+	onSelectChange: function(item, selected) {},
+
+	_find: function(item, inSelection) {
+		if(inSelection) {
+			return dojo.lang.find(item, this.selection);
+		} else {
+			return dojo.lang.find(item, this.items);
+		}
+	},
+
+	isSelectable: function(item) {
+		// user-customizable, will filter items through this
+		return true;
+	},
+
+	setItems: function(/* ... */) {
+		this.clearItems();
+		this.addItems.call(this, arguments);
+	},
+
+	// this is in case you have an active collection array-like object
+	// (i.e. getElementsByTagName collection) that manages its own order
+	// and item list
+	setItemsCollection: function(collection) {
+		this.items = collection;
+	},
+
+	addItems: function(/* ... */) {
+		var args = dojo.lang.unnest(arguments);
+		for(var i = 0; i < args.length; i++) {
+			this.items.push(args[i]);
+		}
+	},
+
+	addItemsAt: function(item, before /* ... */) {
+		if(this.items.length == 0) { // work for empy case
+			return this.addItems(dojo.lang.toArray(arguments, 2));
+		}
+
+		if(!this.isItem(item)) {
+			item = this.items[item];
+		}
+		if(!item) { throw new Error("addItemsAt: item doesn't exist"); }
+		var idx = this._find(item);
+		if(idx > 0 && before) { idx--; }
+		for(var i = 2; i < arguments.length; i++) {
+			if(!this.isItem(arguments[i])) {
+				this.items.splice(idx++, 0, arguments[i]);
+			}
+		}
+	},
+
+	removeItem: function(item) {
+		// remove item
+		var idx = this._find(item);
+		if(idx > -1) {
+			this.items.splice(i, 1);
+		}
+		// remove from selection
+		// FIXME: do we call deselect? I don't think so because this isn't how
+		// you usually want to deselect an item. For example, if you deleted an
+		// item, you don't really want to deselect it -- you want it gone. -DS
+		id = this._find(item, true);
+		if(idx > -1) {
+			this.selection.splice(i, 1);
+		}
+	},
+
+	clearItems: function() {
+		this.items = [];
+		this.deselectAll();
+	},
+
+	isItem: function(item) {
+		return this._find(item) > -1;
+	},
+
+	isSelected: function(item) {
+		return this._find(item, true) > -1;
+	},
+
+	/**
+	 * allows you to filter item in or out of the selection
+	 * depending on the current selection and action to be taken
+	**/
+	selectFilter: function(item, selection, add, grow) {
+		return true;
+	},
+
+	/**
+	 * update -- manages selections, most selecting should be done here
+	 *  item => item which may be added/grown to/only selected/deselected
+	 *  add => behaves like ctrl in windows selection world
+	 *  grow => behaves like shift
+	 *  noToggle => if true, don't toggle selection on item
+	**/
+	update: function(item, add, grow, noToggle) {
+		if(!this.isItem(item)) { return false; }
+
+		if(this.isGrowable && grow) {
+			if(!this.isSelected(item)
+				&& this.selectFilter(item, this.selection, false, true)) {
+				this.grow(item);
+				this.lastSelected = item;
+			}
+		} else if(add) {
+			if(this.selectFilter(item, this.selection, true, false)) {
+				if(noToggle) {
+					if(this.select(item)) {
+						this.lastSelected = item;
+					}
+				} else if(this.toggleSelected(item)) {
+					this.lastSelected = item;
+				}
+			}
+		} else {
+			this.deselectAll();
+			this.select(item);
+		}
+
+		this.length = this.selection.length;
+	},
+
+	/**
+	 * Grow a selection.
+	 *  toItem => which item to grow selection to
+	 *  fromItem => which item to start the growth from (it won't be selected)
+	 *
+	 * Any items in (fromItem, lastSelected] that aren't part of
+	 * (fromItem, toItem] will be deselected
+	**/
+	grow: function(toItem, fromItem) {
+		if(!this.isGrowable) { return; }
+
+		if(arguments.length == 1) {
+			fromItem = this._pivotItem;
+			if(!fromItem && this.allowImplicit) {
+				fromItem = this.items[0];
+			}
+		}
+		if(!toItem || !fromItem) { return false; }
+
+		var fromIdx = this._find(fromItem);
+
+		// get items to deselect (fromItem, lastSelected]
+		var toDeselect = {};
+		var lastIdx = -1;
+		if(this.lastSelected) {
+			lastIdx = this._find(this.lastSelected);
+			var step = fromIdx < lastIdx ? -1 : 1;
+			var range = dojo.math.range(lastIdx, fromIdx, step);
+			for(var i = 0; i < range.length; i++) {
+				toDeselect[range[i]] = true;
+			}
+		}
+
+		// add selection (fromItem, toItem]
+		var toIdx = this._find(toItem);
+		var step = fromIdx < toIdx ? -1 : 1;
+		var shrink = lastIdx >= 0 && step == 1 ? lastIdx < toIdx : lastIdx > toIdx;
+		var range = dojo.math.range(toIdx, fromIdx, step);
+		if(range.length) {
+			for(var i = range.length-1; i >= 0; i--) {
+				var item = this.items[range[i]];
+				if(this.selectFilter(item, this.selection, false, true)) {
+					if(this.select(item, true) || shrink) {
+						this.lastSelected = item;
+					}
+					if(range[i] in toDeselect) {
+						delete toDeselect[range[i]];
+					}
+				}
+			}
+		} else {
+			this.lastSelected = fromItem;
+		}
+
+		// now deselect...
+		for(var i in toDeselect) {
+			if(this.items[i] == this.lastSelected) {
+				dbg("oops!");
+			}
+			this.deselect(this.items[i]);
+		}
+
+		// make sure everything is all kosher after selections+deselections
+		this._updatePivot();
+	},
+
+	/**
+	 * Grow selection upwards one item from lastSelected
+	**/
+	growUp: function() {
+		if(!this.isGrowable) { return; }
+
+		var idx = this._find(this.lastSelected) - 1;
+		while(idx >= 0) {
+			if(this.selectFilter(this.items[idx], this.selection, false, true)) {
+				this.grow(this.items[idx]);
+				break;
+			}
+			idx--;
+		}
+	},
+
+	/**
+	 * Grow selection downwards one item from lastSelected
+	**/
+	growDown: function() {
+		if(!this.isGrowable) { return; }
+
+		var idx = this._find(this.lastSelected);
+		if(idx < 0 && this.allowImplicit) {
+			this.select(this.items[0]);
+			idx = 0;
+		}
+		idx++;
+		while(idx > 0 && idx < this.items.length) {
+			if(this.selectFilter(this.items[idx], this.selection, false, true)) {
+				this.grow(this.items[idx]);
+				break;
+			}
+			idx++;
+		}
+	},
+
+	toggleSelected: function(item, noPivot) {
+		if(this.isItem(item)) {
+			if(this.select(item, noPivot)) { return 1; }
+			if(this.deselect(item)) { return -1; }
+		}
+		return 0;
+	},
+
+	select: function(item, noPivot) {
+		if(this.isItem(item) && !this.isSelected(item)
+			&& this.isSelectable(item)) {
+			this.selection.push(item);
+			this.lastSelected = item;
+			this.onSelect(item);
+			this.onSelectChange(item, true);
+			if(!noPivot) {
+				this._addPivot(item);
+			}
+			return true;
+		}
+		return false;
+	},
+
+	deselect: function(item) {
+		var idx = this._find(item, true);
+		if(idx > -1) {
+			this.selection.splice(idx, 1);
+			this.onDeselect(item);
+			this.onSelectChange(item, false);
+			if(item == this.lastSelected) {
+				this.lastSelected = null;
+			}
+
+			this._removePivot(item);
+
+			return true;
+		}
+		return false;
+	},
+
+	selectAll: function() {
+		for(var i = 0; i < this.items.length; i++) {
+			this.select(this.items[i]);
+		}
+	},
+
+	deselectAll: function() {
+		while(this.selection && this.selection.length) {
+			this.deselect(this.selection[0]);
+		}
+	},
+
+	selectNext: function() {
+		var idx = this._find(this.lastSelected);
+		while(idx > -1 && ++idx < this.items.length) {
+			if(this.isSelectable(this.items[idx])) {
+				this.deselectAll();
+				this.select(this.items[idx]);
+				return true;
+			}
+		}
+		return false;
+	},
+
+	selectPrevious: function() {
+		//debugger;
+		var idx = this._find(this.lastSelected);
+		while(idx-- > 0) {
+			if(this.isSelectable(this.items[idx])) {
+				this.deselectAll();
+				this.select(this.items[idx]);
+				return true;
+			}
+		}
+		return false;
+	},
+
+	// select first selectable item
+	selectFirst: function() {
+		this.deselectAll();
+		var idx = 0;
+		while(this.items[idx] && !this.select(this.items[idx])) {
+			idx++;
+		}
+		return this.items[idx] ? true : false;
+	},
+
+	// select last selectable item
+	selectLast: function() {
+		this.deselectAll();
+		var idx = this.items.length-1;
+		while(this.items[idx] && !this.select(this.items[idx])) {
+			idx--;
+		}
+		return this.items[idx] ? true : false;
+	},
+
+	_addPivot: function(item, andClear) {
+		this._pivotItem = item;
+		if(andClear) {
+			this._pivotItems = [item];
+		} else {
+			this._pivotItems.push(item);
+		}
+	},
+
+	_removePivot: function(item) {
+		var i = dojo.lang.find(item, this._pivotItems);
+		if(i > -1) {
+			this._pivotItems.splice(i, 1);
+			this._pivotItem = this._pivotItems[this._pivotItems.length-1];
+		}
+
+		this._updatePivot();
+	},
+
+	_updatePivot: function() {
+		if(this._pivotItems.length == 0) {
+			if(this.lastSelected) {
+				this._addPivot(this.lastSelected);
+			}
+		}
+	},
+
+	sorted: function() {
+		return dojo.lang.toArray(this.selection).sort(
+			dojo.lang.hitch(this, function(a, b) {
+				var A = this._find(a), B = this._find(b);
+				if(A > B) {
+					return 1;
+				} else if(A < B) {
+					return -1;
+				} else {
+					return 0;
+				}
+			})
+		);
+	},
+
+	// remove any items from the selection that are no longer in this.items
+	updateSelected: function() {
+		for(var i = 0; i < this.selection.length; i++) {
+			if(this._find(this.selection[i]) < 0) {
+				var removed = this.selection.splice(i, 1);
+
+				this._removePivot(removed[0]);
+			}
+		}
+
+		this.length = this.selection.length;
+	}
+});

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,72 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+// FIXME: should we require JSON here?
+dojo.require("dojo.lang.*");
+dojo.provide("dojo.storage");
+dojo.provide("dojo.storage.StorageProvider");
+
+dojo.storage = new function(){
+	this.provider = null;
+
+	// similar API as with dojo.io.addTransport()
+	this.setProvider = function(obj){
+		this.provider = obj;
+	}
+
+	this.set = function(key, value, namespace){
+		// FIXME: not very expressive, doesn't have a way of indicating queuing
+		if(!this.provider){
+			return false;
+		}
+		return this.provider.set(key, value, namespace);
+	}
+
+	this.get = function(key, namespace){
+		if(!this.provider){
+			return false;
+		}
+		return this.provider.get(key, namespace);
+	}
+
+	this.remove = function(key, namespace){
+		return this.provider.remove(key, namespace);
+	}
+}
+
+dojo.storage.StorageProvider = function(){
+}
+
+dojo.lang.extend(dojo.storage.StorageProvider, {
+	namespace: "*",
+	initialized: false,
+
+	free: function(){
+		dojo.unimplemented("dojo.storage.StorageProvider.free");
+		return 0;
+	},
+
+	freeK: function(){
+		return dojo.math.round(this.free()/1024, 0);
+	},
+
+	set: function(key, value, namespace){
+		dojo.unimplemented("dojo.storage.StorageProvider.set");
+	},
+
+	get: function(key, namespace){
+		dojo.unimplemented("dojo.storage.StorageProvider.get");
+	},
+
+	remove: function(key, value, namespace){
+		dojo.unimplemented("dojo.storage.StorageProvider.set");
+	}
+
+});

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/Storage.as
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/Storage.as?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/Storage.as (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/Storage.as Mon Jan 30 23:42:27 2006
@@ -0,0 +1,51 @@
+import flash.external.ExternalInterface;
+
+class Storage {
+	static var app : Storage;
+	var store: SharedObject;
+	static var started: Boolean = false;
+	
+	public function Storage(){
+		ExternalInterface.addCallback("set", null, set);
+		ExternalInterface.addCallback("get", null, get);
+		ExternalInterface.addCallback("free", null, free);
+	}
+
+	public function set(key, value, namespace){
+		var primeForReHide = false;
+		store = SharedObject.getLocal(namespace);
+		store.onStatus = function(status){
+			// ExternalInterface.call("alert", status.code == "SharedObject.Flush.Failed");
+			// ExternalInterface.call("alert", status.code == "SharedObject.Flush.Success");
+			if(primeForReHide){
+				primeForReHide = false;
+				ExternalInterface.call("dojo.storage.provider.hideStore");
+			}
+		}
+		store.data[key] = value;
+		var ret = store.flush();
+		if(typeof ret == "string"){
+			ExternalInterface.call("dojo.storage.provider.unHideStore");
+			primeForReHide = true;
+		}
+		return store.getSize(namespace);
+	}
+
+	public function get(key, namespace){
+		store = SharedObject.getLocal(namespace);
+		return store.data[key];
+	}
+
+	public function free(namespace){
+		return SharedObject.getDiskUsage(namespace);
+	}
+
+	static function main(mc){
+		app = new Storage();
+		if(!started){
+			ExternalInterface.call("dojo.storage.provider.storageOnLoad");
+			started = true;
+		}
+	}
+}
+

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/Storage.swf
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/Storage.swf?rev=373750&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/Storage.swf
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/__package__.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/__package__.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/__package__.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/__package__.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,17 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.hostenv.conditionalLoadModule({
+	common: ["dojo.storage"],
+	browser: ["dojo.storage.browser"],
+	dashboard: ["dojo.storage.dashboard"]
+});
+dojo.hostenv.moduleLoaded("dojo.storage.*");
+

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/browser.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/browser.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/browser.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/browser.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,102 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.storage.browser");
+dojo.require("dojo.storage");
+dojo.require("dojo.uri.*");
+
+dojo.storage.browser.StorageProvider = function(){
+	this.initialized = false;
+	this.flash = null;
+	this.backlog = [];
+}
+
+dojo.inherits(	dojo.storage.browser.StorageProvider, 
+				dojo.storage.StorageProvider);
+
+dojo.lang.extend(dojo.storage.browser.StorageProvider, {
+	storageOnLoad: function(){
+		this.initialized = true;
+		this.hideStore();
+		while(this.backlog.length){
+			this.set.apply(this, this.backlog.shift());
+		}
+	},
+
+	unHideStore: function(){
+		var container = dojo.byId("dojo-storeContainer");
+		with(container.style){
+			position = "absolute";
+			overflow = "visible";
+			width = "215px";
+			height = "138px";
+			// FIXME: make these positions dependent on screen size/scrolling!
+			left = "30px"; 
+			top = "30px";
+			visiblity = "visible";
+			zIndex = "20";
+			border = "1px solid black";
+		}
+	},
+
+	hideStore: function(status){
+		var container = dojo.byId("dojo-storeContainer");
+		with(container.style){
+			left = "-300px";
+			top = "-300px";
+		}
+	},
+
+	set: function(key, value, ns){
+		if(!this.initialized){
+			this.backlog.push([key, value, ns]);
+			return "pending";
+		}
+		return this.flash.set(key, value, ns||this.namespace);
+	},
+
+	get: function(key, ns){
+		return this.flash.get(key, ns||this.namespace);
+	},
+
+	writeStorage: function(){
+		var swfloc = dojo.uri.dojoUri("src/storage/Storage.swf").toString();
+		// alert(swfloc);
+		var storeParts = [
+			'<div id="dojo-storeContainer"',
+				'style="position: absolute; left: -300px; top: -300px;">'];
+		if(dojo.render.html.ie){
+			storeParts.push('<object');
+			storeParts.push('	style="border: 1px solid black;"');
+			storeParts.push('	classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
+			storeParts.push('	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
+			storeParts.push('	width="215" height="138" id="dojoStorage">');
+			storeParts.push('	<param name="movie" value="'+swfloc+'">');
+			storeParts.push('	<param name="quality" value="high">');
+			storeParts.push('</object>');
+		}else{
+			storeParts.push('<embed src="'+swfloc+'" width="215" height="138" ');
+			storeParts.push('	quality="high" ');
+			storeParts.push('	pluginspage="http://www.macromedia.com/go/getflashplayer" ');
+			storeParts.push('	type="application/x-shockwave-flash" ');
+			storeParts.push('	name="dojoStorage">');
+			storeParts.push('</embed>');
+		}
+		storeParts.push('</div>');
+		document.write(storeParts.join(""));
+	}
+});
+
+dojo.storage.setProvider(new dojo.storage.browser.StorageProvider());
+dojo.storage.provider.writeStorage();
+
+dojo.addOnLoad(function(){
+	dojo.storage.provider.flash = (dojo.render.html.ie) ? window["dojoStorage"] : document["dojoStorage"];
+});

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/dashboard.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/dashboard.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/dashboard.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/dashboard.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,52 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.require("dojo.storage");
+dojo.require("dojo.json");
+dojo.provide("dojo.storage.dashboard");
+
+dojo.storage.dashboard.StorageProvider = function(){
+	this.initialized = false;
+}
+
+dojo.inherits(dojo.storage.dashboard.StorageProvider, dojo.storage.StorageProvider);
+
+dojo.lang.extend(dojo.storage.dashboard.StorageProvider, {
+	storageOnLoad: function(){
+		this.initialized = true;
+	},
+
+	set: function(key, value, ns){
+		if (ns && widget.system){
+			widget.system("/bin/mkdir " + ns);
+			var system = widget.system("/bin/echo " + value + " >" + ns + "/" + key);
+			if(system.errorString){
+				return false;
+			}
+			return true;
+		}
+
+		return widget.setPreferenceForKey(dojo.json.serialize(value), key);
+	},
+
+	get: function(key, ns){
+		if (ns && widget.system) {
+			var system = widget.system("/bin/cat " + ns + "/" + key);
+			if(system.errorString){
+				return "";
+			}
+			return system.outputString;
+		}
+
+		return dojo.json.evalJSON(widget.preferenceForKey(key));
+	}
+});
+
+dojo.storage.setProvider(new dojo.storage.dashboard.StorageProvider());
\ No newline at end of file

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/storage.sh
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/storage.sh?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/storage.sh (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/storage/storage.sh Mon Jan 30 23:42:27 2006
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+mtasc -version 8 -swf Storage.swf -main -header 215:138:10 Storage.as 

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,12 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.string");
+dojo.require("dojo.string.common");

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/Builder.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/Builder.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/Builder.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/Builder.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,105 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.string.Builder");
+dojo.require("dojo.string");
+
+// NOTE: testing shows that direct "+=" concatenation is *much* faster on
+// Spidermoneky and Rhino, while arr.push()/arr.join() style concatenation is
+// significantly quicker on IE (Jscript/wsh/etc.).
+
+dojo.string.Builder = function(str){
+	this.arrConcat = (dojo.render.html.capable && dojo.render.html["ie"]);
+
+	var a = [];
+	var b = str || "";
+	var length = this.length = b.length;
+
+	if(this.arrConcat){
+		if(b.length > 0){
+			a.push(b);
+		}
+		b = "";
+	}
+
+	this.toString = this.valueOf = function(){ 
+		return (this.arrConcat) ? a.join("") : b;
+	};
+
+	this.append = function(s){
+		if(this.arrConcat){
+			a.push(s);
+		}else{
+			b+=s;
+		}
+		length += s.length;
+		this.length = length;
+		return this;
+	};
+
+	this.clear = function(){
+		a = [];
+		b = "";
+		length = this.length = 0;
+		return this;
+	};
+
+	this.remove = function(f,l){
+		var s = ""; 
+		if(this.arrConcat){
+			b = a.join(""); 
+		}
+		a=[];
+		if(f>0){
+			s = b.substring(0, (f-1));
+		}
+		b = s + b.substring(f + l); 
+		length = this.length = b.length; 
+		if(this.arrConcat){
+			a.push(b);
+			b="";
+		}
+		return this;
+	};
+
+	this.replace = function(o,n){
+		if(this.arrConcat){
+			b = a.join(""); 
+		}
+		a = []; 
+		b = b.replace(o,n); 
+		length = this.length = b.length; 
+		if(this.arrConcat){
+			a.push(b);
+			b="";
+		}
+		return this;
+	};
+
+	this.insert = function(idx,s){
+		if(this.arrConcat){
+			b = a.join(""); 
+		}
+		a=[];
+		if(idx == 0){
+			b = s + b;
+		}else{
+			var t = b.split("");
+			t.splice(idx,0,s);
+			b = t.join("")
+		}
+		length = this.length = b.length; 
+		if(this.arrConcat){
+			a.push(b); 
+			b="";
+		}
+		return this;
+	};
+};

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/__package__.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/__package__.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/__package__.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/__package__.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,19 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.hostenv.conditionalLoadModule({
+	common: [
+		"dojo.string",
+		"dojo.string.common",
+		"dojo.string.extras",
+		"dojo.string.Builder"
+	]
+});
+dojo.hostenv.moduleLoaded("dojo.string.*");

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/common.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/common.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/common.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/common.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,87 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.string.common");
+
+dojo.require("dojo.string");
+
+/**
+ * Trim whitespace from 'str'. If 'wh' > 0,
+ * only trim from start, if 'wh' < 0, only trim
+ * from end, otherwise trim both ends
+ */
+dojo.string.trim = function(str, wh){
+	if(!str.replace){ return str; }
+	if(!str.length){ return str; }
+	var re = (wh > 0) ? (/^\s+/) : (wh < 0) ? (/\s+$/) : (/^\s+|\s+$/g);
+	return str.replace(re, "");
+}
+
+/**
+ * Trim whitespace at the beginning of 'str'
+ */
+dojo.string.trimStart = function(str) {
+	return dojo.string.trim(str, 1);
+}
+
+/**
+ * Trim whitespace at the end of 'str'
+ */
+dojo.string.trimEnd = function(str) {
+	return dojo.string.trim(str, -1);
+}
+
+/**
+ * Return 'str' repeated 'count' times, optionally
+ * placing 'separator' between each rep
+ */
+dojo.string.repeat = function(str, count, separator) {
+	var out = "";
+	for(var i = 0; i < count; i++) {
+		out += str;
+		if(separator && i < count - 1) {
+			out += separator;
+		}
+	}
+	return out;
+}
+
+/**
+ * Pad 'str' to guarantee that it is at least 'len' length
+ * with the character 'c' at either the start (dir=1) or
+ * end (dir=-1) of the string
+ */
+dojo.string.pad = function(str, len/*=2*/, c/*='0'*/, dir/*=1*/) {
+	var out = String(str);
+	if(!c) {
+		c = '0';
+	}
+	if(!dir) {
+		dir = 1;
+	}
+	while(out.length < len) {
+		if(dir > 0) {
+			out = c + out;
+		} else {
+			out += c;
+		}
+	}
+	return out;
+}
+
+/** same as dojo.string.pad(str, len, c, 1) */
+dojo.string.padLeft = function(str, len, c) {
+	return dojo.string.pad(str, len, c, 1);
+}
+
+/** same as dojo.string.pad(str, len, c, -1) */
+dojo.string.padRight = function(str, len, c) {
+	return dojo.string.pad(str, len, c, -1);
+}

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/extras.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/extras.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/extras.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/string/extras.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,208 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.string.extras");
+
+dojo.require("dojo.string.common");
+dojo.require("dojo.lang");
+
+/**
+ * Parameterized string function
+ * str - formatted string with %{values} to be replaces
+ * pairs - object of name: "value" value pairs
+ * killExtra - remove all remaining %{values} after pairs are inserted
+ */
+dojo.string.paramString = function(str, pairs, killExtra) {
+	for(var name in pairs) {
+		var re = new RegExp("\\%\\{" + name + "\\}", "g");
+		str = str.replace(re, pairs[name]);
+	}
+
+	if(killExtra) { str = str.replace(/%\{([^\}\s]+)\}/g, ""); }
+	return str;
+}
+
+/** Uppercases the first letter of each word */
+dojo.string.capitalize = function (str) {
+	if (!dojo.lang.isString(str)) { return ""; }
+	if (arguments.length == 0) { str = this; }
+	var words = str.split(' ');
+	var retval = "";
+	var len = words.length;
+	for (var i=0; i<len; i++) {
+		var word = words[i];
+		word = word.charAt(0).toUpperCase() + word.substring(1, word.length);
+		retval += word;
+		if (i < len-1)
+			retval += " ";
+	}
+	
+	return new String(retval);
+}
+
+/**
+ * Return true if the entire string is whitespace characters
+ */
+dojo.string.isBlank = function (str) {
+	if(!dojo.lang.isString(str)) { return true; }
+	return (dojo.string.trim(str).length == 0);
+}
+
+dojo.string.encodeAscii = function(str) {
+	if(!dojo.lang.isString(str)) { return str; }
+	var ret = "";
+	var value = escape(str);
+	var match, re = /%u([0-9A-F]{4})/i;
+	while((match = value.match(re))) {
+		var num = Number("0x"+match[1]);
+		var newVal = escape("&#" + num + ";");
+		ret += value.substring(0, match.index) + newVal;
+		value = value.substring(match.index+match[0].length);
+	}
+	ret += value.replace(/\+/g, "%2B");
+	return ret;
+}
+
+dojo.string.escape = function(type, str) {
+	var args = [];
+	for(var i = 1; i < arguments.length; i++) { args.push(arguments[i]); }
+	switch(type.toLowerCase()) {
+		case "xml":
+		case "html":
+		case "xhtml":
+			return dojo.string.escapeXml.apply(this, args);
+		case "sql":
+			return dojo.string.escapeSql.apply(this, args);
+		case "regexp":
+		case "regex":
+			return dojo.string.escapeRegExp.apply(this, args);
+		case "javascript":
+		case "jscript":
+		case "js":
+			return dojo.string.escapeJavaScript.apply(this, args);
+		case "ascii":
+			// so it's encode, but it seems useful
+			return dojo.string.encodeAscii.apply(this, args);
+		default:
+			return str;
+	}
+}
+
+dojo.string.escapeXml = function(str, noSingleQuotes) {
+	str = str.replace(/&/gm, "&amp;").replace(/</gm, "&lt;")
+		.replace(/>/gm, "&gt;").replace(/"/gm, "&quot;");
+	if(!noSingleQuotes) { str = str.replace(/'/gm, "&#39;"); }
+	return str;
+}
+
+dojo.string.escapeSql = function(str) {
+	return str.replace(/'/gm, "''");
+}
+
+dojo.string.escapeRegExp = function(str) {
+	return str.replace(/\\/gm, "\\\\").replace(/([\f\b\n\t\r])/gm, "\\$1");
+}
+
+dojo.string.escapeJavaScript = function(str) {
+	return str.replace(/(["'\f\b\n\t\r])/gm, "\\$1");
+}
+// TODO: make an HTML version
+dojo.string.summary = function(str, len) {
+	if(!len || str.length <= len) {
+		return str;
+	} else {
+		return str.substring(0, len).replace(/\.+$/, "") + "...";
+	}
+}
+
+/**
+ * Returns true if 'str' ends with 'end'
+ */
+dojo.string.endsWith = function(str, end, ignoreCase) {
+	if(ignoreCase) {
+		str = str.toLowerCase();
+		end = end.toLowerCase();
+	}
+	return str.lastIndexOf(end) == str.length - end.length;
+}
+
+/**
+ * Returns true if 'str' ends with any of the arguments[2 -> n]
+ */
+dojo.string.endsWithAny = function(str /* , ... */) {
+	for(var i = 1; i < arguments.length; i++) {
+		if(dojo.string.endsWith(str, arguments[i])) {
+			return true;
+		}
+	}
+	return false;
+}
+
+/**
+ * Returns true if 'str' starts with 'start'
+ */
+dojo.string.startsWith = function(str, start, ignoreCase) {
+	if(ignoreCase) {
+		str = str.toLowerCase();
+		start = start.toLowerCase();
+	}
+	return str.indexOf(start) == 0;
+}
+
+/**
+ * Returns true if 'str' starts with any of the arguments[2 -> n]
+ */
+dojo.string.startsWithAny = function(str /* , ... */) {
+	for(var i = 1; i < arguments.length; i++) {
+		if(dojo.string.startsWith(str, arguments[i])) {
+			return true;
+		}
+	}
+	return false;
+}
+
+/**
+ * Returns true if 'str' starts with any of the arguments 2 -> n
+ */
+dojo.string.has = function(str /* , ... */) {
+	for(var i = 1; i < arguments.length; i++) {
+		if(str.indexOf(arguments[i] > -1)) {
+			return true;
+		}
+	}
+	return false;
+}
+
+dojo.string.normalizeNewlines = function (text,newlineChar) {
+	if (newlineChar == "\n") {
+		text = text.replace(/\r\n/g, "\n");
+		text = text.replace(/\r/g, "\n");
+	} else if (newlineChar == "\r") {
+		text = text.replace(/\r\n/g, "\r");
+		text = text.replace(/\n/g, "\r");
+	} else {
+		text = text.replace(/([^\r])\n/g, "$1\r\n");
+		text = text.replace(/\r([^\n])/g, "\r\n$1");
+	}
+	return text;
+}
+
+dojo.string.splitEscaped = function (str,charac) {
+	var components = [];
+	for (var i = 0, prevcomma = 0; i < str.length; i++) {
+		if (str.charAt(i) == '\\') { i++; continue; }
+		if (str.charAt(i) == charac) {
+			components.push(str.substring(prevcomma, i));
+			prevcomma = i + 1;
+		}
+	}
+	components.push(str.substr(prevcomma));
+	return components;
+}

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/style.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/style.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/style.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/style.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,583 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.style");
+dojo.require("dojo.graphics.color");
+
+// values: content-box, border-box
+dojo.style.boxSizing = {
+	marginBox: "margin-box",
+	borderBox: "border-box",
+	paddingBox: "padding-box",
+	contentBox: "content-box"
+};
+
+dojo.style.getBoxSizing = function(node) {
+	node = dojo.byId(node);
+	if (dojo.render.html.ie || dojo.render.html.opera){ 
+		var cm = document["compatMode"];
+		if (cm == "BackCompat" || cm == "QuirksMode"){ 
+			return dojo.style.boxSizing.borderBox; 
+		}else{
+			return dojo.style.boxSizing.contentBox; 
+		}
+	}else{
+		if(arguments.length == 0){ node = document.documentElement; }
+		var sizing = dojo.style.getStyle(node, "-moz-box-sizing");
+		if(!sizing){ sizing = dojo.style.getStyle(node, "box-sizing"); }
+		return (sizing ? sizing : dojo.style.boxSizing.contentBox);
+	}
+}
+
+/*
+
+The following several function use the dimensions shown below
+
+    +-------------------------+
+    |  margin                 |
+    | +---------------------+ |
+    | |  border             | |
+    | | +-----------------+ | |
+    | | |  padding        | | |
+    | | | +-------------+ | | |
+    | | | |   content   | | | |
+    | | | +-------------+ | | |
+    | | +-|-------------|-+ | |
+    | +-|-|-------------|-|-+ |
+    +-|-|-|-------------|-|-|-+
+    | | | |             | | | |
+    | | | |<- content ->| | | |
+    | |<------ inner ------>| |
+    |<-------- outer -------->|
+    +-------------------------+
+
+    * content-box
+
+    |m|b|p|             |p|b|m|
+    | |<------ offset ----->| |
+    | | |<---- client --->| | |
+    | | | |<-- width -->| | | |
+
+    * border-box
+
+    |m|b|p|             |p|b|m|
+    | |<------ offset ----->| |
+    | | |<---- client --->| | |
+    | |<------ width ------>| |
+*/
+
+/*
+	Notes:
+
+	General:
+		- Uncomputable values are returned as NaN.
+		- setOuterWidth/Height return *false* if the outer size could not be computed, otherwise *true*.
+		- I (sjmiles) know no way to find the calculated values for auto-margins. 
+		- All returned values are floating point in 'px' units. If a non-zero computed style value is not specified in 'px', NaN is returned.
+
+	FF:
+		- styles specified as '0' (unitless 0) show computed as '0pt'.
+
+	IE:
+		- clientWidth/Height are unreliable (0 unless the object has 'layout').
+		- margins must be specified in px, or 0 (in any unit) for any sizing function to work. Otherwise margins detect as 'auto'.
+		- padding can be empty or, if specified, must be in px, or 0 (in any unit) for any sizing function to work.
+
+	Safari:
+		- Safari defaults padding values to 'auto'.
+
+	See the unit tests for examples of (un)computable values in a given browser.
+
+*/
+
+// FIXME: these work for most elements (e.g. DIV) but not all (e.g. TEXTAREA)
+
+dojo.style.isBorderBox = function(node) {
+	return (dojo.style.getBoxSizing(node) == dojo.style.boxSizing.borderBox);
+}
+
+dojo.style.getUnitValue = function (node, cssSelector, autoIsZero){
+	node = dojo.byId(node);
+	var result = { value: 0, units: 'px' };
+	var s = dojo.style.getComputedStyle(node, cssSelector);
+	if (s == '' || (s == 'auto' && autoIsZero)){ return result; }
+	if (dojo.lang.isUndefined(s)){ 
+		result.value = NaN;
+	}else{
+		// FIXME: is regex inefficient vs. parseInt or some manual test? 
+		var match = s.match(/([\d.]+)([a-z%]*)/i);
+		if (!match){
+			result.value = NaN;
+		}else{
+			result.value = Number(match[1]);
+			result.units = match[2].toLowerCase();
+		}
+	}
+	return result;		
+}
+
+dojo.style.getPixelValue = function (node, cssSelector, autoIsZero){
+	node = dojo.byId(node);
+	var result = dojo.style.getUnitValue(node, cssSelector, autoIsZero);
+	// FIXME: there is serious debate as to whether or not this is the right solution
+	if(isNaN(result.value)){ return 0; }
+	// FIXME: code exists for converting other units to px (see Dean Edward's IE7) 
+	// but there are cross-browser complexities
+	if((result.value)&&(result.units != 'px')){ return NaN; }
+	return result.value;
+}
+
+dojo.style.getNumericStyle = dojo.style.getPixelValue; // backward compat
+
+dojo.style.isPositionAbsolute = function(node){
+	node = dojo.byId(node);
+	return (dojo.style.getComputedStyle(node, 'position') == 'absolute');
+}
+
+dojo.style.getMarginWidth = function(node){
+	node = dojo.byId(node);
+	var autoIsZero = dojo.style.isPositionAbsolute(node);
+	var left = dojo.style.getPixelValue(node, "margin-left", autoIsZero);
+	var right = dojo.style.getPixelValue(node, "margin-right", autoIsZero);
+	return left + right;
+}
+
+dojo.style.getBorderWidth = function(node){
+	node = dojo.byId(node);
+	var left = (dojo.style.getStyle(node, 'border-left-style') == 'none' ? 0 : dojo.style.getPixelValue(node, "border-left-width"));
+	var right = (dojo.style.getStyle(node, 'border-right-style') == 'none' ? 0 : dojo.style.getPixelValue(node, "border-right-width"));
+	return left + right;
+}
+
+dojo.style.getPaddingWidth = function(node){
+	node = dojo.byId(node);
+	var left = dojo.style.getPixelValue(node, "padding-left", true);
+	var right = dojo.style.getPixelValue(node, "padding-right", true);
+	return left + right;
+}
+
+dojo.style.getContentWidth = function (node){
+	node = dojo.byId(node);
+	return node.offsetWidth - dojo.style.getPaddingWidth(node) - dojo.style.getBorderWidth(node);
+}
+
+dojo.style.getInnerWidth = function (node){
+	node = dojo.byId(node);
+	return node.offsetWidth;
+}
+
+dojo.style.getOuterWidth = function (node){
+	node = dojo.byId(node);
+	return dojo.style.getInnerWidth(node) + dojo.style.getMarginWidth(node);
+}
+
+dojo.style.setOuterWidth = function (node, pxWidth){
+	node = dojo.byId(node);
+	if (!dojo.style.isBorderBox(node)){
+		pxWidth -= dojo.style.getPaddingWidth(node) + dojo.style.getBorderWidth(node);
+	}
+	pxWidth -= dojo.style.getMarginWidth(node);
+	if (!isNaN(pxWidth) && pxWidth > 0){
+		node.style.width = pxWidth + 'px';
+		return true;
+	}else return false;
+}
+
+// FIXME: these aliases are actually the preferred names
+dojo.style.getContentBoxWidth = dojo.style.getContentWidth;
+dojo.style.getBorderBoxWidth = dojo.style.getInnerWidth;
+dojo.style.getMarginBoxWidth = dojo.style.getOuterWidth;
+dojo.style.setMarginBoxWidth = dojo.style.setOuterWidth;
+
+dojo.style.getMarginHeight = function(node){
+	node = dojo.byId(node);
+	var autoIsZero = dojo.style.isPositionAbsolute(node);
+	var top = dojo.style.getPixelValue(node, "margin-top", autoIsZero);
+	var bottom = dojo.style.getPixelValue(node, "margin-bottom", autoIsZero);
+	return top + bottom;
+}
+
+dojo.style.getBorderHeight = function(node){
+	node = dojo.byId(node);
+	var top = (dojo.style.getStyle(node, 'border-top-style') == 'none' ? 0 : dojo.style.getPixelValue(node, "border-top-width"));
+	var bottom = (dojo.style.getStyle(node, 'border-bottom-style') == 'none' ? 0 : dojo.style.getPixelValue(node, "border-bottom-width"));
+	return top + bottom;
+}
+
+dojo.style.getPaddingHeight = function(node){
+	node = dojo.byId(node);
+	var top = dojo.style.getPixelValue(node, "padding-top", true);
+	var bottom = dojo.style.getPixelValue(node, "padding-bottom", true);
+	return top + bottom;
+}
+
+dojo.style.getContentHeight = function (node){
+	node = dojo.byId(node);
+	return node.offsetHeight - dojo.style.getPaddingHeight(node) - dojo.style.getBorderHeight(node);
+}
+
+dojo.style.getInnerHeight = function (node){
+	node = dojo.byId(node);
+	return node.offsetHeight; // FIXME: does this work?
+}
+
+dojo.style.getOuterHeight = function (node){
+	node = dojo.byId(node);
+	return dojo.style.getInnerHeight(node) + dojo.style.getMarginHeight(node);
+}
+
+dojo.style.setOuterHeight = function (node, pxHeight){
+	node = dojo.byId(node);
+	if (!dojo.style.isBorderBox(node)){
+		pxHeight -= dojo.style.getPaddingHeight(node) + dojo.style.getBorderHeight(node);
+	}
+	pxHeight -= dojo.style.getMarginHeight(node);
+	if (!isNaN(pxHeight) && pxHeight > 0){
+		node.style.height = pxHeight + 'px';
+		return true;
+	}else return false;
+}
+
+dojo.style.setContentWidth = function(node, pxWidth){
+	node = dojo.byId(node);
+	if (dojo.style.isBorderBox(node)){
+		pxWidth += dojo.style.getPaddingWidth(node) + dojo.style.getBorderWidth(node);
+	}
+
+	if (!isNaN(pxWidth) && pxWidth > 0){
+		node.style.width = pxWidth + 'px';
+		return true;
+	}else return false;
+}
+
+dojo.style.setContentHeight = function(node, pxHeight){
+	node = dojo.byId(node);
+	if (dojo.style.isBorderBox(node)){
+		pxHeight += dojo.style.getPaddingHeight(node) + dojo.style.getBorderHeight(node);
+	}
+
+	if (!isNaN(pxHeight) && pxHeight > 0){
+		node.style.height = pxHeight + 'px';
+		return true;
+	}else return false;
+}
+
+// FIXME: these aliases are actually the preferred names
+dojo.style.getContentBoxHeight = dojo.style.getContentHeight;
+dojo.style.getBorderBoxHeight = dojo.style.getInnerHeight;
+dojo.style.getMarginBoxHeight = dojo.style.getOuterHeight;
+dojo.style.setMarginBoxHeight = dojo.style.setOuterHeight;
+
+dojo.style.getTotalOffset = function (node, type, includeScroll){
+	node = dojo.byId(node);
+	var typeStr = (type=="top") ? "offsetTop" : "offsetLeft";
+	var typeScroll = (type=="top") ? "scrollTop" : "scrollLeft";
+	
+	var coord = (type=="top") ? "y" : "x";
+	var offset = 0;
+	if(node["offsetParent"]){
+		
+		// in Safari, if the node is an absolutly positioned child of the body
+		// and the body has a margin the offset of the child and the body
+		// contain the body's margins, so we need to end at the body
+		if (dojo.render.html.safari
+			&& node.style.getPropertyValue("position") == "absolute"
+			&& node.parentNode == document.body)
+		{
+			var endNode = document.body;
+		} else {
+			var endNode = document.body.parentNode;
+		}
+		
+		if(includeScroll && node.parentNode != document.body) {
+			offset -= dojo.style.sumAncestorProperties(node, typeScroll);
+		}
+		// FIXME: this is known not to work sometimes on IE 5.x since nodes
+		// soemtimes need to be "tickled" before they will display their
+		// offset correctly
+		do {
+			offset += node[typeStr];
+			node = node.offsetParent;
+		} while (node != endNode && node != null);
+	}else if(node[coord]){
+		offset += node[coord];
+	}
+	return offset;
+}
+
+dojo.style.sumAncestorProperties = function (node, prop) {
+	node = dojo.byId(node);
+	if (!node) { return 0; } // FIXME: throw an error?
+	
+	var retVal = 0;
+	while (node) {
+		var val = node[prop];
+		if (val) {
+			retVal += val - 0;
+		}
+		node = node.parentNode;
+	}
+	return retVal;
+}
+
+dojo.style.totalOffsetLeft = function (node, includeScroll){
+	node = dojo.byId(node);
+	return dojo.style.getTotalOffset(node, "left", includeScroll);
+}
+
+dojo.style.getAbsoluteX = dojo.style.totalOffsetLeft;
+
+dojo.style.totalOffsetTop = function (node, includeScroll){
+	node = dojo.byId(node);
+	return dojo.style.getTotalOffset(node, "top", includeScroll);
+}
+
+dojo.style.getAbsoluteY = dojo.style.totalOffsetTop;
+
+dojo.style.getAbsolutePosition = function(node, includeScroll) {
+	node = dojo.byId(node);
+	var position = [
+		dojo.style.getAbsoluteX(node, includeScroll),
+		dojo.style.getAbsoluteY(node, includeScroll)
+	];
+	position.x = position[0];
+	position.y = position[1];
+	return position;
+}
+
+dojo.style.styleSheet = null;
+
+// FIXME: this is a really basic stub for adding and removing cssRules, but
+// it assumes that you know the index of the cssRule that you want to add 
+// or remove, making it less than useful.  So we need something that can 
+// search for the selector that you you want to remove.
+dojo.style.insertCssRule = function (selector, declaration, index) {
+	if (!dojo.style.styleSheet) {
+		if (document.createStyleSheet) { // IE
+			dojo.style.styleSheet = document.createStyleSheet();
+		} else if (document.styleSheets[0]) { // rest
+			// FIXME: should create a new style sheet here
+			// fall back on an exsiting style sheet
+			dojo.style.styleSheet = document.styleSheets[0];
+		} else { return null; } // fail
+	}
+
+	if (arguments.length < 3) { // index may == 0
+		if (dojo.style.styleSheet.cssRules) { // W3
+			index = dojo.style.styleSheet.cssRules.length;
+		} else if (dojo.style.styleSheet.rules) { // IE
+			index = dojo.style.styleSheet.rules.length;
+		} else { return null; } // fail
+	}
+
+	if (dojo.style.styleSheet.insertRule) { // W3
+		var rule = selector + " { " + declaration + " }";
+		return dojo.style.styleSheet.insertRule(rule, index);
+	} else if (dojo.style.styleSheet.addRule) { // IE
+		return dojo.style.styleSheet.addRule(selector, declaration, index);
+	} else { return null; } // fail
+}
+
+dojo.style.removeCssRule = function (index){
+	if(!dojo.style.styleSheet){
+		dojo.debug("no stylesheet defined for removing rules");
+		return false;
+	}
+	if(dojo.render.html.ie){
+		if(!index){
+			index = dojo.style.styleSheet.rules.length;
+			dojo.style.styleSheet.removeRule(index);
+		}
+	}else if(document.styleSheets[0]){
+		if(!index){
+			index = dojo.style.styleSheet.cssRules.length;
+		}
+		dojo.style.styleSheet.deleteRule(index);
+	}
+	return true;
+}
+
+dojo.style.getBackgroundColor = function (node) {
+	node = dojo.byId(node);
+	var color;
+	do{
+		color = dojo.style.getStyle(node, "background-color");
+		// Safari doesn't say "transparent"
+		if(color.toLowerCase() == "rgba(0, 0, 0, 0)") { color = "transparent"; }
+		if(node == document.getElementsByTagName("body")[0]) { node = null; break; }
+		node = node.parentNode;
+	}while(node && dojo.lang.inArray(color, ["transparent", ""]));
+
+	if( color == "transparent" ) {
+		color = [255, 255, 255, 0];
+	} else {
+		color = dojo.graphics.color.extractRGB(color);
+	}
+	return color;
+}
+
+dojo.style.getComputedStyle = function (node, cssSelector, inValue) {
+	node = dojo.byId(node);
+	var value = inValue;
+	if (node.style.getPropertyValue) { // W3
+		value = node.style.getPropertyValue(cssSelector);
+	}
+	if(!value) {
+		if (document.defaultView) { // gecko
+			var cs = document.defaultView.getComputedStyle(node, "");
+			if (cs) { 
+				value = cs.getPropertyValue(cssSelector);
+			} 
+		} else if (node.currentStyle) { // IE
+			value = node.currentStyle[dojo.style.toCamelCase(cssSelector)];
+		} 
+	}
+	
+	return value;
+}
+
+dojo.style.getStyle = function (node, cssSelector) {
+	node = dojo.byId(node);
+	var camelCased = dojo.style.toCamelCase(cssSelector);
+	var value = node.style[camelCased]; // dom-ish
+	return (value ? value : dojo.style.getComputedStyle(node, cssSelector, value));
+}
+
+dojo.style.toCamelCase = function (selector) {
+	var arr = selector.split('-'), cc = arr[0];
+	for(var i = 1; i < arr.length; i++) {
+		cc += arr[i].charAt(0).toUpperCase() + arr[i].substring(1);
+	}
+	return cc;		
+}
+
+dojo.style.toSelectorCase = function (selector) {
+	return selector.replace(/([A-Z])/g, "-$1" ).toLowerCase() ;
+}
+
+/* float between 0.0 (transparent) and 1.0 (opaque) */
+dojo.style.setOpacity = function setOpacity (node, opacity, dontFixOpacity) {
+	node = dojo.byId(node);
+	var h = dojo.render.html;
+	if(!dontFixOpacity){
+		if( opacity >= 1.0){
+			if(h.ie){
+				dojo.style.clearOpacity(node);
+				return;
+			}else{
+				opacity = 0.999999;
+			}
+		}else if( opacity < 0.0){ opacity = 0; }
+	}
+	if(h.ie){
+		if(node.nodeName.toLowerCase() == "tr"){
+			// FIXME: is this too naive? will we get more than we want?
+			var tds = node.getElementsByTagName("td");
+			for(var x=0; x<tds.length; x++){
+				tds[x].style.filter = "Alpha(Opacity="+opacity*100+")";
+			}
+		}
+		node.style.filter = "Alpha(Opacity="+opacity*100+")";
+	}else if(h.moz){
+		node.style.opacity = opacity; // ffox 1.0 directly supports "opacity"
+		node.style.MozOpacity = opacity;
+	}else if(h.safari){
+		node.style.opacity = opacity; // 1.3 directly supports "opacity"
+		node.style.KhtmlOpacity = opacity;
+	}else{
+		node.style.opacity = opacity;
+	}
+}
+	
+dojo.style.getOpacity = function getOpacity (node){
+	node = dojo.byId(node);
+	if(dojo.render.html.ie){
+		var opac = (node.filters && node.filters.alpha &&
+			typeof node.filters.alpha.opacity == "number"
+			? node.filters.alpha.opacity : 100) / 100;
+	}else{
+		var opac = node.style.opacity || node.style.MozOpacity ||
+			node.style.KhtmlOpacity || 1;
+	}
+	return opac >= 0.999999 ? 1.0 : Number(opac);
+}
+
+dojo.style.clearOpacity = function clearOpacity (node) {
+	node = dojo.byId(node);
+	var h = dojo.render.html;
+	if(h.ie){
+		if( node.filters && node.filters.alpha ) {
+			node.style.filter = ""; // FIXME: may get rid of other filter effects
+		}
+	}else if(h.moz){
+		node.style.opacity = 1;
+		node.style.MozOpacity = 1;
+	}else if(h.safari){
+		node.style.opacity = 1;
+		node.style.KhtmlOpacity = 1;
+	}else{
+		node.style.opacity = 1;
+	}
+}
+
+dojo.style.isVisible = function(node){
+	node = dojo.byId(node);
+	// FIXME: this should also look at visibility!
+	return dojo.style.getComputedStyle(node||this.domNode, "display") != "none";
+}
+
+dojo.style.show  = function(node){
+	node = dojo.byId(node);
+	if(node.style){
+		node.style.display = dojo.lang.inArray(['tr', 'td', 'th'], node.tagName.toLowerCase()) ? "" : "block";
+	}
+}
+
+dojo.style.hide = function(node){
+	node = dojo.byId(node);
+	if(node.style){
+		node.style.display = "none";
+	}
+}
+
+dojo.style.toggleVisible = function(node) {
+	if(dojo.style.isVisible(node)) {
+		dojo.style.hide(node);
+		return false;
+	} else {
+		dojo.style.show(node);
+		return true;
+	}
+}
+
+// in: coordinate array [x,y,w,h] or dom node
+// return: coordinate array
+dojo.style.toCoordinateArray = function(coords, includeScroll) {
+	if(dojo.lang.isArray(coords)){
+		// coords is already an array (of format [x,y,w,h]), just return it
+		while ( coords.length < 4 ) { coords.push(0); }
+		while ( coords.length > 4 ) { coords.pop(); }
+		var ret = coords;
+	} else {
+		// coords is an dom object (or dom object id); return it's coordinates
+		var node = dojo.byId(coords);
+		var ret = [
+			dojo.style.getAbsoluteX(node, includeScroll),
+			dojo.style.getAbsoluteY(node, includeScroll),
+			dojo.style.getInnerWidth(node),
+			dojo.style.getInnerHeight(node)
+		];
+	}
+	ret.x = ret[0];
+	ret.y = ret[1];
+	ret.w = ret[2];
+	ret.h = ret[3];
+	return ret;
+};

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/svg.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/svg.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/svg.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/svg.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,277 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.svg");
+dojo.require("dojo.lang");
+dojo.require("dojo.dom");
+
+dojo.lang.mixin(dojo.svg, dojo.dom);
+
+/**
+ *	The Graphics object.  Hopefully gives the user a way into
+ *	XPlatform rendering functions supported correctly and incorrectly.
+**/
+dojo.svg.graphics = dojo.svg.g = new function(d){
+	this.suspend = function(){
+		try { d.documentElement.suspendRedraw(0); } catch(e){ }
+	};
+	this.resume = function(){
+		try { d.documentElement.unsuspendRedraw(0); } catch(e){ }
+	};
+	this.force = function(){
+		try { d.documentElement.forceRedraw(); } catch(e){ }
+	};
+}(document);
+
+/**
+ *	The Animations control object.  Hopefully gives the user a way into
+ *	XPlatform animation functions supported correctly and incorrectly.
+**/
+dojo.svg.animations = dojo.svg.anim = new function(d){
+	this.arePaused = function(){
+		try {
+			return d.documentElement.animationsPaused();
+		} catch(e){
+			return false;
+		}
+	} ;
+	this.pause = function(){
+		try { d.documentElement.pauseAnimations(); } catch(e){ }
+	};
+	this.resume = function(){
+		try { d.documentElement.unpauseAnimations(); } catch(e){ }
+	};
+}(document);
+
+/**
+ *	signatures from dojo.style.
+ */
+dojo.svg.toCamelCase = function(selector){
+	var arr = selector.split('-'), cc = arr[0];
+	for(var i = 1; i < arr.length; i++) {
+		cc += arr[i].charAt(0).toUpperCase() + arr[i].substring(1);
+	}
+	return cc;		
+};
+dojo.svg.toSelectorCase = function (selector) {
+	return selector.replace(/([A-Z])/g, "-$1" ).toLowerCase() ;
+};
+dojo.svg.getStyle = function(node, cssSelector){
+	return document.defaultView.getComputedStyle(node, cssSelector);
+};
+dojo.svg.getNumericStyle = function(node, cssSelector){
+	return parseFloat(dojo.svg.getStyle(node, cssSelector));
+};
+
+/**
+ *	alpha channel operations
+ */
+dojo.svg.getOpacity = function(node){
+	return Math.min(1.0, dojo.svg.getNumericStyle(node, "fill-opacity"));
+};
+dojo.svg.setOpacity = function(node, opacity){
+	node.setAttributeNS(this.xmlns.svg, "fill-opacity", opacity);
+	node.setAttributeNS(this.xmlns.svg, "stroke-opacity", opacity);
+};
+dojo.svg.clearOpacity = function(node){
+	node.setAttributeNS(this.xmlns.svg, "fill-opacity", "1.0");
+	node.setAttributeNS(this.xmlns.svg, "stroke-opacity", "1.0");
+};
+
+/**
+ *	Coordinates and dimensions.
+ */
+dojo.svg.getCoords = function(node){
+	if (node.getBBox) {
+		var box = node.getBBox();
+		return { x: box.x, y: box.y };
+	}
+	return null;
+};
+dojo.svg.setCoords = function(node, coords){
+	var p = dojo.svg.getCoords();
+	if (!p) return;
+	var dx = p.x - coords.x;
+	var dy = p.y - coords.y;
+	dojo.svg.translate(node, dx, dy);
+};
+dojo.svg.getDimensions = function(node){
+	if (node.getBBox){
+		var box = node.getBBox();
+		return { width: box.width, height : box.height };
+	}
+	return null;
+};
+dojo.svg.setDimensions = function(node, dim){
+	//	will only support shape-based and container elements; path-based elements are ignored.
+	if (node.width){
+		node.width.baseVal.value = dim.width;
+		node.height.baseVal.vaule = dim.height;
+	}
+	else if (node.r){
+		node.r.baseVal.value = Math.min(dim.width, dim.height)/2;
+	}
+	else if (node.rx){
+		node.rx.baseVal.value = dim.width/2;
+		node.ry.baseVal.value = dim.height/2;
+	}
+};
+
+/**
+ *	Transformations.
+ */
+dojo.svg.translate = function(node, dx, dy){
+	if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
+		var t = node.ownerSVGElement.createSVGTransform();
+		t.setTranslate(dx, dy);
+		node.transform.baseVal.appendItem(t);
+	}
+};
+dojo.svg.scale = function(node, scaleX, scaleY){
+	if (!scaleY) var scaleY = scaleX;
+	if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
+		var t = node.ownerSVGElement.createSVGTransform();
+		t.setScale(scaleX, scaleY);
+		node.transform.baseVal.appendItem(t);
+	}
+};
+dojo.svg.rotate = function(node, ang, cx, cy){
+	if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
+		var t = node.ownerSVGElement.createSVGTransform();
+		if (!cx) t.setMatrix(t.matrix.rotate(ang));
+		else t.setRotate(ang, cx, cy);
+		node.transform.baseVal.appendItem(t);
+	}
+};
+dojo.svg.skew = function(node, ang, axis){
+	var dir = axis || "x";
+	if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
+		var t = node.ownerSVGElement.createSVGTransform();
+		if (dir != "x") t.setSkewY(ang);
+		else t.setSkewX(ang);
+		node.transform.baseVal.appendItem(t);
+	}
+};
+dojo.svg.flip = function(node, axis){
+	var dir = axis || "x";
+	if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
+		var t = node.ownerSVGElement.createSVGTransform();
+		t.setMatrix((dir != "x") ? t.matrix.flipY() : t.matrix.flipX());
+		node.transform.baseVal.appendItem(t);
+	}
+};
+dojo.svg.invert = function(node){
+	if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
+		var t = node.ownerSVGElement.createSVGTransform();
+		t.setMatrix(t.matrix.inverse());
+		node.transform.baseVal.appendItem(t);
+	}
+};
+dojo.svg.applyMatrix = function(node, a, b, c, d, e, f){
+	if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
+		var m;
+		if (b){
+			var m = node.ownerSVGElement.createSVGMatrix();
+			m.a = a;
+			m.b = b;
+			m.c = c;
+			m.d = d;
+			m.e = e;
+			m.f = f;
+		} else m = a;
+		var t = node.ownerSVGElement.createSVGTransform();
+		t.setMatrix(m);
+		node.transform.baseVal.appendItem(t);
+	}
+};
+
+/**
+ *	Grouping and z-index operations.
+ */
+dojo.svg.group = function(nodes){
+	//	expect an array of nodes, attaches the group to the parent of the first node.
+	var p = nodes.item(0).parentNode;
+	var g = document.createElementNS(this.xmlns.svg, "g");
+	for (var i = 0; i < nodes.length; i++) g.appendChild(nodes.item(i));
+	p.appendChild(g);
+	return g;
+};
+dojo.svg.ungroup = function(g){
+	//	puts the children of the group on the same level as group was.
+	var p = g.parentNode;
+	while (g.childNodes.length > 0) p.appendChild(g.childNodes.item(0));
+	p.removeChild(g);
+};
+//	if the node is part of a group, return the group, else return null.
+dojo.svg.getGroup = function(node){
+	//	if the node is part of a group, return the group, else return null.
+	var a = this.getAncestors(node);
+	for (var i = 0; i < a.length; i++){
+		if (a[i].nodeType == this.ELEMENT_NODE && a[i].nodeName.toLowerCase() == "g")
+			return a[i];
+	}
+	return null;
+};
+dojo.svg.bringToFront = function(node){
+	var n = this.getGroup(node) || node;
+	n.ownerSVGElement.appendChild(n);
+};
+dojo.svg.sendToBack = function(node){
+	var n = this.getGroup(node) || node;
+	n.ownerSVGElement.insertBefore(n, n.ownerSVGElement.firstChild);
+};
+//	TODO: possibly push node up a level in the DOM if it's at the beginning or end of the childNodes list.
+dojo.svg.bringForward = function(node){
+	var n = this.getGroup(node) || node;
+	if (this.getLastChildElement(n.parentNode) != n){
+		this.insertAfter(n, this.getNextSiblingElement(n), true);
+	}
+};
+dojo.svg.sendBackward = function(node){
+	var n = this.getGroup(node) || node;
+	if (this.getFirstChildElement(n.parentNode) != n){
+		this.insertBefore(n, this.getPreviousSiblingElement(n), true);
+	}
+};
+//	modded to account for FF 1.5 mixed environment, will try ASVG first, then w3 standard.
+dojo.dom.createNodesFromText = function (txt, wrap){
+	var docFrag;
+	if (window.parseXML) docFrag = parseXML(txt, window.document);
+	else if (window.DOMParser) docFrag = (new DOMParser()).parseFromString(txt, "text/xml");
+	else dojo.raise("dojo.dom.createNodesFromText: environment does not support XML parsing");
+	docFrag.normalize();
+	if(wrap){ 
+		var ret = [docFrag.firstChild.cloneNode(true)];
+		return ret;
+	}
+	var nodes = [];
+	for(var x=0; x<docFrag.childNodes.length; x++){
+		nodes.push(docFrag.childNodes.item(x).cloneNode(true));
+	}
+	// tn.style.display = "none";
+	return nodes;
+}
+
+// FIXME: this should be removed after 0.2 release
+if(!dojo.evalObjPath("dojo.dom.createNodesFromText")) {
+	dojo.dom.createNodesFromText = function() {
+		dojo.deprecated("dojo.dom.createNodesFromText", "use dojo.svg.createNodesFromText instead");
+		dojo.svg.createNodesFromText.apply(dojo.html, arguments);
+	}
+}
+
+//	IE INLINE FIX
+/*
+if (dojo.render.html.ie && dojo.render.svg.adobe){
+	document.write("<object id=\"AdobeSVG\" classid=\"clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2\"></object>");
+	document.write("<?import namespace=\"svg\" urn=\"http://www.w3.org/2000/svg\" implementation=\"#AdobeSVG\"?>");
+}
+*/
+// vim:ts=4:noet:tw=0:

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/Builder.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/Builder.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/Builder.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/Builder.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,16 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.text.Builder");
+dojo.require("dojo.string.Builder");
+
+dj_deprecated("dojo.text.Builder is deprecated, use dojo.string.Builder instead");
+
+dojo.text.Builder = dojo.string.Builder;

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/String.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/String.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/String.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/String.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,15 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dj_deprecated("dojo.text.String is being replaced by dojo.string");
+dojo.require("dojo.string");
+
+dojo.text = dojo.string;
+dojo.provide("dojo.text.String");

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/Text.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/Text.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/Text.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/Text.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,15 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dj_deprecated("dojo.text.Text is being replaced by dojo.string");
+dojo.require("dojo.string");
+
+dojo.text = dojo.string;
+dojo.provide("dojo.text.Text");

Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/__package__.js
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/__package__.js?rev=373750&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/__package__.js (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ajax/dojo/src/text/__package__.js Mon Jan 30 23:42:27 2006
@@ -0,0 +1,17 @@
+/*
+	Copyright (c) 2004-2005, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.hostenv.conditionalLoadModule({
+	common: [
+		"dojo.text.String",
+		"dojo.text.Builder"
+	]
+});
+dojo.hostenv.moduleLoaded("dojo.text.*");



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org