You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2007/02/06 06:01:49 UTC

svn commit: r503984 [5/29] - in /tapestry/tapestry4/trunk: ./ tapestry-examples/TimeTracker/src/context/WEB-INF/ tapestry-framework/ tapestry-framework/src/java/org/apache/tapestry/asset/ tapestry-framework/src/java/org/apache/tapestry/dojo/ tapestry-f...

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/flash6_gateway.swf
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/flash6_gateway.swf?view=auto&rev=503984
==============================================================================
Binary file - no diff available.

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/flash6_gateway.swf
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/iframe_history.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/iframe_history.html?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/iframe_history.html (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/iframe_history.html Mon Feb  5 21:01:25 2007
@@ -0,0 +1,84 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+	<title></title>
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
+	<script type="text/javascript">
+	// <!--
+	var noInit = false;
+	var domain = "";
+	// document.domain = "localhost";
+	
+	function defineParams(sparams){
+		if(sparams){
+			var ss = (sparams.indexOf("&amp;") >= 0) ? "&amp;" : "&";
+			sparams = sparams.split(ss);
+			for(var x=0; x<sparams.length; x++){
+				var tp = sparams[x].split("=");
+				if(typeof window[tp[0]] != "undefined"){
+					window[tp[0]] = ((tp[1]=="true")||(tp[1]=="false")) ? eval(tp[1]) : tp[1];
+				}
+			}
+		}
+	}
+	
+	function init(){
+		// parse the query string if there is one to try to get params that
+		// we can act on. Also allow params to be in a fragment identifier.
+		var query = null;
+		var frag = null;
+		var url = document.location.href;
+		var hashIndex = url.indexOf("#");
+		
+		//Extract fragment identifier
+		if(hashIndex != -1){
+			frag = url.substring(hashIndex + 1, url.length);
+			url = url.substring(0, hashIndex);
+		}
+
+		//Extract querystring
+		var parts = url.split("?");
+		if(parts.length == 2){
+			query = parts[1];
+		}
+
+		defineParams(query);
+		defineParams(frag);
+
+		if(noInit){ return; }
+		if(domain.length > 0){
+			document.domain = domain;
+		}
+		var hasParentDojo = false;
+		try{
+			hasParentDojo = window.parent != window && window.parent["dojo"];
+		}catch(e){
+			alert("Initializing iframe_history.html failed. If you are using a cross-domain Dojo build,"
+				+ " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"
+				+ " to the path on your domain to iframe_history.html");
+			throw e;
+		}
+
+		if(hasParentDojo){
+			//Set the page title so IE history shows up with a somewhat correct name.
+			document.title = window.parent.document.title;
+			
+			//Notify parent that we are loaded.
+			var pdj = window.parent.dojo;
+			if(pdj["undo"] && pdj["undo"]["browser"]){
+				pdj.undo.browser.iframeLoaded(null, window.location);
+			}
+		}
+
+	}
+	// -->
+	</script>
+</head>
+<body onload="try{ init(); }catch(e){ alert(e); }">
+	<h4>The Dojo Toolkit -- iframe_history.html</h4>
+
+	<p>This file is used in Dojo's back/fwd button management.</p>
+</body>
+</html>

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/AdapterRegistry.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/AdapterRegistry.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/AdapterRegistry.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/AdapterRegistry.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,6 @@
+
+dojo.provide("dojo.AdapterRegistry");dojo.require("dojo.lang.func");dojo.AdapterRegistry = function( returnWrappers){this.pairs = [];this.returnWrappers = returnWrappers || false;}
+dojo.lang.extend(dojo.AdapterRegistry, {register: function(name, check,  wrap, directReturn, override){var type = (override) ? "unshift" : "push";this.pairs[type]([name, check, wrap, directReturn]);},match: function(){for(var i = 0; i < this.pairs.length; i++){var pair = this.pairs[i];if(pair[1].apply(this, arguments)){if((pair[3])||(this.returnWrappers)){return pair[2];}else{return pair[2].apply(this, arguments);}}
+}
+throw new Error("No match found");},unregister: function(name){for(var i = 0; i < this.pairs.length; i++){var pair = this.pairs[i];if(pair[0] == name){this.pairs.splice(i, 1);return true;}}
+return false;}});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/Deferred.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/Deferred.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/Deferred.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/Deferred.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,17 @@
+
+dojo.provide("dojo.Deferred");dojo.require("dojo.lang.func");dojo.Deferred = function( canceller){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.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;},makeCalled: function() {var deferred = new dojo.Deferred();deferred.callback();return deferred;},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(){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.Deferred)){this.results[0].cancel();}},_pause: function(){this.paused++;},_unpause: function(){this.paused--;if ((this.paused == 0) && (this.fired >= 0)) {this._fire();}},_continue: function(res){this._resback(res);this._unpause();},_resback: function(res){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){this._check();this._resback(res);},errback: function(res){this._check();if(!(res instanceof Error)){res = new Error(res);}
+this._resback(res);},addBoth: function(cb, cbfn){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){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){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, cbfn);},addCallbacks: function (cb, eb) {this.chain.push([cb, eb])
+if (this.fired >= 0) {this._fire();}
+return this;},_fire: function(){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) {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.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)){res.addBoth(cb);}}
+});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/DeferredList.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/DeferredList.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/DeferredList.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/DeferredList.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,6 @@
+
+dojo.require("dojo.Deferred");dojo.provide("dojo.DeferredList");dojo.DeferredList = function (list,  fireOnOneCallback,  fireOnOneErrback,  consumeErrors,  canceller) {this.list = list;this.resultList = new Array(this.list.length);this.chain = [];this.id = this._nextId();this.fired = -1;this.paused = 0;this.results = [null, null];this.canceller = canceller;this.silentlyCancelled = false;if (this.list.length === 0 && !fireOnOneCallback) {this.callback(this.resultList);}
+this.finishedCount = 0;this.fireOnOneCallback = fireOnOneCallback;this.fireOnOneErrback = fireOnOneErrback;this.consumeErrors = consumeErrors;var index = 0;var _this = this;dojo.lang.forEach(this.list, function(d) {var _index = index;d.addCallback(function(r) { _this._cbDeferred(_index, true, r) });d.addErrback(function(r) { _this._cbDeferred(_index, false, r) });index++;});};dojo.inherits(dojo.DeferredList, dojo.Deferred);dojo.lang.extend(dojo.DeferredList, {_cbDeferred: function (index, succeeded, result) {this.resultList[index] = [succeeded, result];this.finishedCount += 1;if (this.fired !== 0) {if (succeeded && this.fireOnOneCallback) {this.callback([index, result]);} else if (!succeeded && this.fireOnOneErrback) {this.errback(result);} else if (this.finishedCount == this.list.length) {this.callback(this.resultList);}}
+if (!succeeded && this.consumeErrors) {result = null;}
+return result;},gatherResults: function (deferredList) {var d = new dojo.DeferredList(deferredList, false, true, false);d.addCallback(function (results) {var ret = [];for (var i = 0; i < results.length; i++) {ret.push(results[i][1]);}
+return ret;});return d;}});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/a11y.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/a11y.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/a11y.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/a11y.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,7 @@
+
+dojo.provide("dojo.a11y");dojo.require("dojo.uri.*");dojo.require("dojo.html.common");dojo.a11y = {imgPath:dojo.uri.moduleUri("dojo.widget", "templates/images"),doAccessibleCheck: true,accessible: null,checkAccessible: function(){if(this.accessible === null){this.accessible = false;if(this.doAccessibleCheck == true){this.accessible = this.testAccessible();}}
+return this.accessible;},testAccessible: function(){this.accessible = false;if (dojo.render.html.ie || dojo.render.html.mozilla){var div = document.createElement("div");div.style.backgroundImage = "url(\"" + this.imgPath + "/tab_close.gif\")";dojo.body().appendChild(div);var bkImg = null;if (window.getComputedStyle  ) {var cStyle = getComputedStyle(div, "");bkImg = cStyle.getPropertyValue("background-image");}else{bkImg = div.currentStyle.backgroundImage;}
+var bUseImgElem = false;if (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)" )) {this.accessible = true;}
+dojo.body().removeChild(div);}
+return this.accessible;},setAccessible: function( bAccessible) {this.accessible=bAccessible;},setCheckAccessible: function( bTest){this.doAccessibleCheck = bTest;},setAccessibleMode: function(){if (this.accessible === null){if (this.checkAccessible()){dojo.render.html.prefixes.unshift("a11y");}}
+return this.accessible;}};
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/behavior/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/behavior/__package__.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/behavior/__package__.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/behavior/__package__.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,3 @@
+
+dojo.kwCompoundRequire({common: [ "dojo.behavior.common" ]
+});dojo.provide("dojo.behavior.*");
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/behavior/common.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/behavior/common.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/behavior/common.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/behavior/common.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,15 @@
+
+dojo.provide("dojo.behavior.common");dojo.require("dojo.event.*");dojo.require("dojo.query");dojo.require("dojo.experimental");dojo.experimental("dojo.behavior");dojo.behavior = new function(){function arrIn(obj, name){if(!obj[name]){ obj[name] = []; }
+return obj[name];}
+var _inc = 0;function forIn(obj, scope, func){var tmpObj = {};for(var x in obj){if(typeof tmpObj[x] == "undefined"){if(!func){scope(obj[x], x);}else{func.call(scope, obj[x], x);}}
+}}
+this.behaviors = {};this.add = function(behaviorObj){var tmpObj = {};forIn(behaviorObj, this, function(behavior, name){var tBehavior = arrIn(this.behaviors, name);if(typeof tBehavior["id"] != "number"){tBehavior.id = _inc++;}
+var cversion = [];tBehavior.push(cversion);if((dojo.lang.isString(behavior))||(dojo.lang.isFunction(behavior))){behavior = { found: behavior };}
+forIn(behavior, function(rule, ruleName){arrIn(cversion, ruleName).push(rule);});});}
+this.apply = function(){dojo.profile.start("dojo.behavior.apply");forIn(this.behaviors, function(tBehavior, id){var elems = dojo.query(id);dojo.lang.forEach(elems,function(elem){var runFrom = 0;var bid = "_dj_behavior_"+tBehavior.id;if(typeof elem[bid] == "number"){runFrom = elem[bid];if(runFrom == (tBehavior.length-1)){return;}}
+for(var x=runFrom, tver; tver = tBehavior[x]; x++){forIn(tver, function(ruleSet, ruleSetName){if(dojo.lang.isArray(ruleSet)){dojo.lang.forEach(ruleSet, function(action){dojo.behavior.applyToNode(elem, action, ruleSetName);});}});}
+elem[bid] = tBehavior.length-1;}
+);});dojo.profile.end("dojo.behavior.apply");}
+this.applyToNode = function(node, action, ruleSetName){if(typeof action == "string"){dojo.event.topic.registerPublisher(action, node, ruleSetName);}else if(typeof action == "function"){if(ruleSetName == "found"){action(node);}else{dojo.event.connect(node, ruleSetName, action);}}else{action.srcObj = node;action.srcFunc = ruleSetName;dojo.event.kwConnect(action);}}
+}
+dojo.addOnLoad(dojo.behavior, "apply");
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/behavior/form.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/behavior/form.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/behavior/form.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/behavior/form.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,36 @@
+
+dojo.provide("dojo.behavior.form");dojo.require("dojo.html.style");dojo.require("dojo.event.*");dojo.require("dojo.html.selection");dojo.require("dojo.experimental");dojo.experimental("dojo.behavior.form");dojo.behavior.form=new function(){this.titleClass="title";this.processing={};function equals(val1, val2){if (val1 && val1.length > 0 && val2 && val2.length > 0
+&& val1.toLowerCase() == val2.toLowerCase()){return true;}
+return false;}
+this.decorateInputTitles = function(node){var elms=node.getElementsByTagName("input");if(!elms){return;}
+var forms={};for(var i=0;i<elms.length;i++){var title=elms[i].getAttribute("title");if (!title || title.length <= 0 || dj_undef("form", elms[i])) { continue; }
+var formId = elms[i].form.getAttribute("id");if(!formId){formId = elms[i].form.getAttribute("name");}
+if(!formId) { continue; }
+if(!forms[formId]){ forms[formId] = elms[i].form; }
+if (!this.decorateInput(elms[i], title)) {continue;}
+dojo.event.browser.addListener(elms[i], "onfocus", dojo.lang.hitch(this, this.nodeFocused));dojo.event.browser.addListener(elms[i], "onblur", dojo.lang.hitch(this, this.nodeBlurred));dojo.event.browser.addListener(elms[i], "onkeyup", dojo.lang.hitch(this, this.nodeKeyPressed));}
+for (var f in forms){dojo.event.connect("before", forms[f], "onsubmit", dojo.lang.hitch(this, this.clearDecorations));}}
+this.decorateInput = function(node, title){var currVal=node.value;if (!title) {title=node.getAttribute("title");}
+if(!title) {return;}
+if (!equals(currVal,title) && currVal.length > 0) {return false;}
+if(!dojo.html.hasClass(node, this.titleClass)){dojo.html.prependClass(node, this.titleClass);}
+node.value=title;return true;}
+this.nodeFocused = function(evt){if(!evt){return;}
+var node=evt.target;node.removeAttribute("prevesc");dojo.html.removeClass(node, this.titleClass);var value=node.value;var title=node.getAttribute("title");if (!equals(value,title) && value.length > 0){return;}
+node.value="";}
+this.nodeBlurred = function(evt){if(!evt){return;}
+var node=evt.target;if (this.processing[node]){this.cleanupBlurProcess(node);return;}
+this.checkNodeValue(node);this.decorateInput(node);}
+this.nodeKeyPressed = function(evt){if(!evt){return;}
+var node=evt.target;if (evt.keyCode == evt.KEY_ESCAPE) {this.checkNodeValue(node);} else if (this.processing[node]){this.cleanupBlurProcess(node);return;} else {return;}
+node.blur();}
+this.checkNodeValue = function(node){if (!node.getAttribute("prevesc")){var value=node.value;var title=node.getAttribute("title");if (value && value.length > 0 && !equals(value,title)){node.setAttribute("prevesc","1");node.value="";this.processing[node]=true;node.blur();}}
+}
+this.cleanupBlurProcess = function(node){delete this.processing[node];setTimeout(function(){node.focus();}, 10);}
+this.clearDecorations = function(evt){if(!evt){return;}
+var form=evt.target;if(!form) { return; }
+var elms=form.getElementsByTagName("input");for(var i=0;i<elms.length;i++){if (dj_undef("value", elms[i])) {continue;}
+var title=elms[i].getAttribute("title");if (!title || title.length <= 0) { continue; }
+var value=elms[i].value;if (equals(value,title)){elms[i].value="";}
+dojo.event.browser.removeListener(elms[i], "onfocus", dojo.lang.hitch(this, this.nodeFocused));dojo.event.browser.removeListener(elms[i], "onblur", dojo.lang.hitch(this, this.nodeBlurred));dojo.event.browser.removeListener(elms[i], "onkeyup", dojo.lang.hitch(this, this.nodeBlurred));}}
+}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/bootstrap1.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/bootstrap1.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/bootstrap1.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/bootstrap1.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,37 @@
+
+var dj_global = this;var dj_currentContext = this;function dj_undef( name,  object){return (typeof (object || dj_currentContext)[name] == "undefined");}
+if(dj_undef("djConfig", this)){var djConfig = {};}
+if(dj_undef("dojo", this)){var dojo = {};}
+dojo.global = function(){return dj_currentContext;}
+dojo.locale  = djConfig.locale;dojo.version = {major: 0, minor: 4, patch: 1, flag: "+",revision: Number("$Rev: 6986 $".match(/[0-9]+/)[0]),toString: function(){with(dojo.version){return major + "." + minor + "." + patch + flag + " (" + revision + ")";}}
+}
+dojo.getObject = function(name, create, obj, returnWrapper){var tobj, tprop;if(typeof name != "string"){return undefined;}
+tobj = obj;if(!tobj){ tobj = dojo.global(); }
+var parts=name.split("."), i=0, lobj, tmp, tname;do{lobj = tobj;tname = parts[i];tmp = tobj[parts[i]];if((create)&&(!tmp)){tmp = tobj[parts[i]] = {};}
+tobj = tmp;i++;}while(i<parts.length && tobj);tprop = tobj;tobj = lobj;return (returnWrapper) ? { obj: tobj, prop: tname } : tprop;}
+dojo.exists = function(name, obj){if(typeof obj == "string"){dojo.deprecated("dojo.exists(obj, name)", "use dojo.exists(name, obj, create)", "0.6");var tmp = name;name = obj;obj = tmp;}
+return (!!dojo.getObject(name, false, obj));}
+dojo.evalProp = function(name, object, create){dojo.deprecated("dojo.evalProp", "just use hash syntax. Sheesh.", "0.6");return object[name] || (create ? (object[name]={}) : undefined);}
+dojo.parseObjPath = function( path,  context,  create){dojo.deprecated("dojo.parseObjPath", "use dojo.getObject(path, create, context, true)", "0.6");return dojo.getObject(path, create, context, true);}
+dojo.evalObjPath = function(path, create){dojo.deprecated("dojo.evalObjPath", "use dojo.getObject(path, create)", "0.6");return dojo.getObject(path, create);}
+dojo.errorToString = function( exception){return (exception["message"]||exception["description"]||exception);}
+dojo.raise = function( message,  exception){if(exception){message = message + ": "+dojo.errorToString(exception);}else{message = dojo.errorToString(message);}
+try{if(djConfig.isDebug){dojo.hostenv.println("FATAL exception raised: "+message);}}catch(e){}
+throw exception || Error(message);}
+dojo.debug = function(){};dojo.debugShallow = function(obj){};dojo.profile = {start: function(){},end: function(){},stop: function(){},dump: function(){}};function dj_eval( scriptFragment){return dj_global.eval ? dj_global.eval(scriptFragment) : eval(scriptFragment);}
+dojo.unimplemented = function( funcname,  extra){var message = "'" + funcname + "' not implemented";if(extra != null){ message += " " + extra; }
+dojo.raise(message);}
+dojo.deprecated = function( behaviour,  extra,  removal){var message = "DEPRECATED: " + behaviour;if(extra){ message += " " + extra; }
+if(removal){ message += " -- will be removed in version: " + removal; }
+dojo.debug(message);}
+dojo.render = (function(){function vscaffold(prefs, names){var tmp = {capable: false,support: {builtin: false,plugin: false
+},prefixes: prefs
+};for(var i=0; i<names.length; i++){tmp[names[i]] = false;}
+return tmp;}
+return {name: "",ver: dojo.version,os: { win: false, linux: false, osx: false },html: vscaffold(["html"], ["ie", "opera", "khtml", "safari", "moz"]),svg: vscaffold(["svg"], ["corel", "adobe", "batik"]),vml: vscaffold(["vml"], ["ie"]),swf: vscaffold(["Swf", "Flash", "Mm"], ["mm"]),swt: vscaffold(["Swt"], ["ibm"])
+};})();dojo.hostenv = (function(){var config = {isDebug: false,allowQueryConfig: false,baseScriptUri: "",baseRelativePath: "",libraryScriptUri: "",iePreventClobber: false,ieClobberMinimal: true,preventBackButtonFix: true,delayMozLoadingFix: false,searchIds: [],parseWidgets: true
+};if(typeof djConfig == "undefined"){djConfig = config;}else{for(var option in config){if(typeof djConfig[option] == "undefined"){djConfig[option] = config[option];}}
+}
+return {name_: '(unset)',version_: '(unset)',getName: function(){return this.name_;},getVersion: function(){return this.version_;},getText: function( uri){dojo.unimplemented('getText', "uri=" + uri);}};})();dojo.hostenv.getBaseScriptUri = function(){if(djConfig.baseScriptUri.length){return djConfig.baseScriptUri;}
+var uri = new String(djConfig.libraryScriptUri||djConfig.baseRelativePath);if(!uri){dojo.raise("Nothing returned by getLibraryScriptUri(): " + uri);}
+djConfig.baseScriptUri = djConfig.baseRelativePath;return djConfig.baseScriptUri;}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/browser_debug.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/browser_debug.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/browser_debug.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/browser_debug.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,16 @@
+
+dojo.provide("dojo.browser_debug");dojo.hostenv.loadedUris.push("../src/bootstrap1.js");dojo.hostenv.loadedUris.push("../src/loader.js");dojo.hostenv.loadedUris.push("../src/hostenv_browser.js");dojo.hostenv._loadedUrisListStart = dojo.hostenv.loadedUris.length;function removeComments(contents){contents = new String((!contents) ? "" : contents);dojo.clobberLastObject = function(objpath){if(objpath.indexOf('.') == -1){if(!dj_undef(objpath, dj_global)){delete dj_global[objpath];}
+return true;}
+var syms = objpath.split(/\./);var base = dojo.getObject(syms.slice(0, -1).join("."), false);var child = syms[syms.length-1];if(!dj_undef(child, base)){delete base[child];return true;}
+return false;}
+var removals = [];function zip(arr){var ret = [];var seen = {};for(var x=0; x<arr.length; x++){if(!seen[arr[x]]){ret.push(arr[x]);seen[arr[x]] = true;}}
+return ret;}
+var old_dj_eval = dj_eval;dj_eval = function(){ return true; }
+dojo.hostenv.oldLoadUri = dojo.hostenv.loadUri;dojo.hostenv.loadUri = function(uri, cb ){if(dojo.hostenv.loadedUris[uri]){return true;}
+try{var text = this.getText(uri, null, true);if(!text) { return false; }
+if(cb){var expr = old_dj_eval('('+text+')');cb(expr);}else {var requires = dojo.hostenv.getRequiresAndProvides(text);eval(requires.join(";"));dojo.hostenv.loadedUris.push(uri);dojo.hostenv.loadedUris[uri] = true;var delayRequires = dojo.hostenv.getDelayRequiresAndProvides(text);eval(delayRequires.join(";"));}}catch(e){alert(e);}
+return true;}
+dojo.hostenv._writtenIncludes = {};dojo.hostenv.writeIncludes = function(willCallAgain){for(var x=removals.length-1; x>=0; x--){dojo.clobberLastObject(removals[x]);}
+var depList = [];var seen = dojo.hostenv._writtenIncludes;for(var x=0; x<dojo.hostenv.loadedUris.length; x++){var curi = dojo.hostenv.loadedUris[x];if(!seen[curi]){seen[curi] = true;depList.push(curi);}}
+dojo.hostenv._global_omit_module_check = true;for(var x= dojo.hostenv._loadedUrisListStart; x<depList.length; x++){document.write("<script type='text/javascript' src='"+depList[x]+"'></script>");}
+document.write("<script type='text/javascript'>dojo.hostenv._global_omit_module_check = false;</script>");dojo.hostenv._loadedUrisListStart = 0;if (!willCallAgain) {dj_eval = old_dj_eval;dojo.hostenv.loadUri = dojo.hostenv.oldLoadUri;}}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/browser_debug_xd.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/browser_debug_xd.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/browser_debug_xd.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/browser_debug_xd.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,5 @@
+
+dojo.provide("dojo.browser_debug_xd");dojo.nonDebugProvide = dojo.provide;dojo.provide = function(resourceName){var dbgQueue = dojo.hostenv["xdDebugQueue"];if(dbgQueue && dbgQueue.length > 0 && resourceName == dbgQueue["currentResourceName"]){window.setTimeout("dojo.hostenv.xdDebugFileLoaded('" + resourceName + "')", 1);}
+dojo.nonDebugProvide.apply(dojo, arguments);}
+dojo.hostenv.xdDebugFileLoaded = function(resourceName){var dbgQueue = this.xdDebugQueue;if(resourceName && resourceName == dbgQueue.currentResourceName){dbgQueue.shift();}
+if(dbgQueue.length == 0){dbgQueue.currentResourceName = null;this.xdNotifyLoaded();}else{dbgQueue.currentResourceName = dbgQueue[0].resourceName;var element = document.createElement("script");element.type = "text/javascript";element.src = dbgQueue[0].resourcePath;document.getElementsByTagName("head")[0].appendChild(element);}}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/cal/iCalendar.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/cal/iCalendar.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/cal/iCalendar.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/cal/iCalendar.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,93 @@
+
+dojo.provide("dojo.cal.iCalendar");dojo.require("dojo.lang.common");dojo.require("dojo.cal.textDirectory");dojo.require("dojo.date.common");dojo.require("dojo.date.serialize");dojo.cal.iCalendar.fromText =  function (text) {var properties = dojo.cal.textDirectory.tokenise(text);var calendars = [];for (var i = 0, begun = false; i < properties.length; i++) {var prop = properties[i];if (!begun) {if (prop.name == 'BEGIN' && prop.value == 'VCALENDAR') {begun = true;var calbody = [];}} else if (prop.name == 'END' && prop.value == 'VCALENDAR') {calendars.push(new dojo.cal.iCalendar.VCalendar(calbody));begun = false;} else {calbody.push(prop);}}
+return calendars;}
+dojo.cal.iCalendar.Component = function ( body ) {if (!this.name) {this.name = "COMPONENT"
+}
+this.properties = [];this.components = [];if (body) {for (var i = 0, context = ''; i < body.length; i++) {if (context == '') {if (body[i].name == 'BEGIN') {context = body[i].value;var childprops = [];} else {this.addProperty(new dojo.cal.iCalendar.Property(body[i]));}} else if (body[i].name == 'END' && body[i].value == context) {if (context=="VEVENT") {this.addComponent(new dojo.cal.iCalendar.VEvent(childprops));} else if (context=="VTIMEZONE") {this.addComponent(new dojo.cal.iCalendar.VTimeZone(childprops));} else if (context=="VTODO") {this.addComponent(new dojo.cal.iCalendar.VTodo(childprops));} else if (context=="VJOURNAL") {this.addComponent(new dojo.cal.iCalendar.VJournal(childprops));} else if (context=="VFREEBUSY") {this.addComponent(new dojo.cal.iCalendar.VFreeBusy(childprops));} else if (context=="STANDARD") {this.addComponent(new dojo.cal.iCalendar.Standard(childprops));} else if (context=="DAYLIGHT") {this.addComponent(new dojo.cal.iCalendar.Daylight(childprops))
 ;} else if (context=="VALARM") {this.addComponent(new dojo.cal.iCalendar.VAlarm(childprops));}else {dojo.unimplemented("dojo.cal.iCalendar." + context);}
+context = '';} else {childprops.push(body[i]);}}
+if (this._ValidProperties) {this.postCreate();}}
+}
+dojo.extend(dojo.cal.iCalendar.Component, {addProperty: function (prop) {this.properties.push(prop);this[prop.name.toLowerCase()] = prop;},addComponent: function (prop) {this.components.push(prop);},postCreate: function() {for (var x=0; x<this._ValidProperties.length; x++) {var evtProperty = this._ValidProperties[x];var found = false;for (var y=0; y<this.properties.length; y++) {var prop = this.properties[y];var propName = prop.name.toLowerCase();if (dojo.lang.isArray(evtProperty)) {var alreadySet = false;for (var z=0; z<evtProperty.length; z++) {var evtPropertyName = evtProperty[z].name.toLowerCase();if((this[evtPropertyName])  && (evtPropertyName != propName )) {alreadySet=true;}}
+if (!alreadySet) {this[propName] = prop;}} else {if (propName == evtProperty.name.toLowerCase()) {found = true;if (evtProperty.occurance == 1){this[propName] = prop;} else {found = true;if (!dojo.lang.isArray(this[propName])) {this[propName] = [];}
+this[propName].push(prop);}}
+}}
+if (evtProperty.required && !found) {dojo.debug("iCalendar - " + this.name + ": Required Property not found: " + evtProperty.name);}}
+if (dojo.lang.isArray(this.rrule)) {for(var x=0; x<this.rrule.length; x++) {var rule = this.rrule[x].value;this.rrule[x].cache = function() {};var temp = rule.split(";");for (var y=0; y<temp.length; y++) {var pair = temp[y].split("=");var key = pair[0].toLowerCase();var val = pair[1];if ((key == "freq") || (key=="interval") || (key=="until")) {this.rrule[x][key]= val;} else {var valArray = val.split(",");this.rrule[x][key] = valArray;}}
+}
+this.recurring = true;}},toString: function () {return "[iCalendar.Component; " + this.name + ", " + this.properties.length +
+" properties, " + this.components.length + " components]";}});dojo.cal.iCalendar.Property = function (prop) {this.name = prop.name;this.group = prop.group;this.params = prop.params;this.value = prop.value;}
+dojo.extend(dojo.cal.iCalendar.Property, {toString: function () {return "[iCalenday.Property; " + this.name + ": " + this.value + "]";}});var _P = function (n, oc, req) {return {name: n, required: (req) ? true : false,occurance: (oc == '*' || !oc) ? -1 : oc}}
+dojo.cal.iCalendar.VCalendar = function ( calbody) {this.name = "VCALENDAR";this.recurring = [];this.nonRecurringEvents = function(){};dojo.cal.iCalendar.Component.call(this, calbody);}
+dojo.inherits(dojo.cal.iCalendar.VCalendar, dojo.cal.iCalendar.Component);dojo.extend(dojo.cal.iCalendar.VCalendar, {addComponent: function (prop) {this.components.push(prop);if (prop.name.toLowerCase() == "vevent") {if (prop.rrule) {this.recurring.push(prop);} else {var startDate = prop.getDate();var month = startDate.getMonth() + 1;var dateString= month + "-" + startDate.getDate() + "-" + startDate.getFullYear();if (!dojo.lang.isArray(this[dateString])) {this.nonRecurringEvents[dateString] = [];}
+this.nonRecurringEvents[dateString].push(prop);}}
+},preComputeRecurringEvents: function(until) {var calculatedEvents = function(){};for(var x=0; x<this.recurring.length; x++) {var dates = this.recurring[x].getDates(until);for (var y=0; y<dates.length;y++) {var month = dates[y].getMonth() + 1;var dateStr = month + "-" + dates[y].getDate() + "-" + dates[y].getFullYear();if (!dojo.lang.isArray(calculatedEvents[dateStr])) {calculatedEvents[dateStr] = [];}
+if (!dojo.lang.inArray(calculatedEvents[dateStr], this.recurring[x])) {calculatedEvents[dateStr].push(this.recurring[x]);}}
+}
+this.recurringEvents = calculatedEvents;},getEvents: function( date) {var events = [];var recur = [];var nonRecur = [];var month = date.getMonth() + 1;var dateStr= month + "-" + date.getDate() + "-" + date.getFullYear();if (dojo.lang.isArray(this.nonRecurringEvents[dateStr])) {nonRecur= this.nonRecurringEvents[dateStr];dojo.debug("Number of nonRecurring Events: " + nonRecur.length);}
+if (dojo.lang.isArray(this.recurringEvents[dateStr])) {recur= this.recurringEvents[dateStr];}
+events = recur.concat(nonRecur);if (events.length > 0) {return events;}
+return null;}});var StandardProperties = [
+_P("dtstart", 1, true), _P("tzoffsetto", 1, true), _P("tzoffsetfrom", 1, true),_P("comment"), _P("rdate"), _P("rrule"), _P("tzname")
+];dojo.cal.iCalendar.Standard = function ( body) {this.name = "STANDARD";this._ValidProperties = StandardProperties;dojo.cal.iCalendar.Component.call(this, body);}
+dojo.inherits(dojo.cal.iCalendar.Standard, dojo.cal.iCalendar.Component);var DaylightProperties = [
+_P("dtstart", 1, true), _P("tzoffsetto", 1, true), _P("tzoffsetfrom", 1, true),_P("comment"), _P("rdate"), _P("rrule"), _P("tzname")
+];dojo.cal.iCalendar.Daylight = function ( body) {this.name = "DAYLIGHT";this._ValidProperties = DaylightProperties;dojo.cal.iCalendar.Component.call(this, body);}
+dojo.inherits(dojo.cal.iCalendar.Daylight, dojo.cal.iCalendar.Component);var VEventProperties = [
+_P("class", 1), _P("created", 1), _P("description", 1), _P("dtstart", 1),_P("geo", 1), _P("last-mod", 1), _P("location", 1), _P("organizer", 1),_P("priority", 1), _P("dtstamp", 1), _P("seq", 1), _P("status", 1),_P("summary", 1), _P("transp", 1), _P("uid", 1), _P("url", 1), _P("recurid", 1),[_P("dtend", 1), _P("duration", 1)],_P("attach"), _P("attendee"), _P("categories"), _P("comment"), _P("contact"),_P("exdate"), _P("exrule"), _P("rstatus"), _P("related"), _P("resources"),_P("rdate"), _P("rrule")
+];dojo.cal.iCalendar.VEvent = function ( body) {this._ValidProperties = VEventProperties;this.name = "VEVENT";dojo.cal.iCalendar.Component.call(this, body);this.recurring = false;this.startDate = dojo.date.fromIso8601(this.dtstart.value);}
+dojo.inherits(dojo.cal.iCalendar.VEvent, dojo.cal.iCalendar.Component);dojo.extend(dojo.cal.iCalendar.VEvent, {getDates: function(until) {var dtstart = this.getDate();var recurranceSet = [];var weekdays=["su","mo","tu","we","th","fr","sa"];var order = {"daily": 1, "weekly": 2, "monthly": 3, "yearly": 4,"byday": 1, "bymonthday": 1, "byweekno": 2, "bymonth": 3, "byyearday": 4};for (var x=0; x<this.rrule.length; x++) {var rrule = this.rrule[x];var freq = rrule.freq.toLowerCase();var interval = 1;if (rrule.interval > interval) {interval = rrule.interval;}
+var set = [];var freqInt = order[freq];if (rrule.until) {var tmpUntil = dojo.date.fromIso8601(rrule.until);} else {var tmpUntil = until
+}
+if (tmpUntil > until) {tmpUntil = until
+}
+if (dtstart<tmpUntil) {var expandingRules = function(){};var cullingRules = function(){};expandingRules.length=0;cullingRules.length =0;switch(freq) {case "yearly":
+var nextDate = new Date(dtstart);set.push(nextDate);while(nextDate < tmpUntil) {nextDate.setYear(nextDate.getFullYear()+interval);tmpDate = new Date(nextDate);if(tmpDate < tmpUntil) {set.push(tmpDate);}}
+break;case "monthly":
+nextDate = new Date(dtstart);set.push(nextDate);while(nextDate < tmpUntil) {nextDate.setMonth(nextDate.getMonth()+interval);var tmpDate = new Date(nextDate);if (tmpDate < tmpUntil) {set.push(tmpDate);}}
+break;case "weekly":
+nextDate = new Date(dtstart);set.push(nextDate);while(nextDate < tmpUntil) {nextDate.setDate(nextDate.getDate()+(7*interval));var tmpDate = new Date(nextDate);if (tmpDate < tmpUntil) {set.push(tmpDate);}}
+break;case "daily":
+nextDate = new Date(dtstart);set.push(nextDate);while(nextDate < tmpUntil) {nextDate.setDate(nextDate.getDate()+interval);var tmpDate = new Date(nextDate);if (tmpDate < tmpUntil) {set.push(tmpDate);}}
+break;}
+if ((rrule["bymonth"]) && (order["bymonth"]<freqInt)){for (var z=0; z<rrule["bymonth"].length; z++) {if (z==0) {for (var zz=0; zz < set.length; zz++) {set[zz].setMonth(rrule["bymonth"][z]-1);}} else {var subset=[];for (var zz=0; zz < set.length; zz++) {var newDate = new Date(set[zz]);newDate.setMonth(rrule[z]);subset.push(newDate);}
+tmp = set.concat(subset);set = tmp;}}
+}
+if (rrule["byweekno"] && !rrule["bymonth"]) {dojo.debug("TODO: no support for byweekno yet");}
+if (rrule["byyearday"] && !rrule["bymonth"] && !rrule["byweekno"] ) {if (rrule["byyearday"].length > 1) {var regex = "([+-]?)([0-9]{1,3})";for (var z=1; x<rrule["byyearday"].length; z++) {var regexResult = rrule["byyearday"][z].match(regex);if (z==1) {for (var zz=0; zz < set.length; zz++) {if (regexResult[1] == "-") {dojo.date.setDayOfYear(set[zz],366-regexResult[2]);} else {dojo.date.setDayOfYear(set[zz],regexResult[2]);}}
+}else {var subset=[];for (var zz=0; zz < set.length; zz++) {var newDate = new Date(set[zz]);if (regexResult[1] == "-") {dojo.date.setDayOfYear(newDate,366-regexResult[2]);} else {dojo.date.setDayOfYear(newDate,regexResult[2]);}
+subset.push(newDate);}
+tmp = set.concat(subset);set = tmp;}}
+}}
+if (rrule["bymonthday"]  && (order["bymonthday"]<freqInt)) {if (rrule["bymonthday"].length > 0) {var regex = "([+-]?)([0-9]{1,3})";for (var z=0; z<rrule["bymonthday"].length; z++) {var regexResult = rrule["bymonthday"][z].match(regex);if (z==0) {for (var zz=0; zz < set.length; zz++) {if (regexResult[1] == "-") {if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {set[zz].setDate(dojo.date.getDaysInMonth(set[zz]) - regexResult[2]);}} else {if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {set[zz].setDate(regexResult[2]);}}
+}}else {var subset=[];for (var zz=0; zz < set.length; zz++) {var newDate = new Date(set[zz]);if (regexResult[1] == "-") {if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {newDate.setDate(dojo.date.getDaysInMonth(set[zz]) - regexResult[2]);}} else {if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {newDate.setDate(regexResult[2]);}}
+subset.push(newDate);}
+tmp = set.concat(subset);set = tmp;}}
+}}
+if (rrule["byday"]  && (order["byday"]<freqInt)) {if (rrule["bymonth"]) {if (rrule["byday"].length > 0) {var regex = "([+-]?)([0-9]{0,1}?)([A-Za-z]{1,2})";for (var z=0; z<rrule["byday"].length; z++) {var regexResult = rrule["byday"][z].match(regex);var occurance = regexResult[2];var day = regexResult[3].toLowerCase();if (z==0) {for (var zz=0; zz < set.length; zz++) {if (regexResult[1] == "-") {var numDaysFound = 0;var lastDayOfMonth = dojo.date.getDaysInMonth(set[zz]);var daysToSubtract = 1;set[zz].setDate(lastDayOfMonth);if (weekdays[set[zz].getDay()] == day) {numDaysFound++;daysToSubtract=7;}
+daysToSubtract = 1;while (numDaysFound < occurance) {set[zz].setDate(set[zz].getDate()-daysToSubtract);if (weekdays[set[zz].getDay()] == day) {numDaysFound++;daysToSubtract=7;}}
+} else {if (occurance) {var numDaysFound=0;set[zz].setDate(1);var daysToAdd=1;if(weekdays[set[zz].getDay()] == day) {numDaysFound++;daysToAdd=7;}
+while(numDaysFound < occurance) {set[zz].setDate(set[zz].getDate()+daysToAdd);if(weekdays[set[zz].getDay()] == day) {numDaysFound++;daysToAdd=7;}}
+} else {var numDaysFound=0;var subset = [];lastDayOfMonth = new Date(set[zz]);var daysInMonth = dojo.date.getDaysInMonth(set[zz]);lastDayOfMonth.setDate(daysInMonth);set[zz].setDate(1);if (weekdays[set[zz].getDay()] == day) {numDaysFound++;}
+var tmpDate = new Date(set[zz]);daysToAdd = 1;while(tmpDate.getDate() < lastDayOfMonth) {if (weekdays[tmpDate.getDay()] == day) {numDaysFound++;if (numDaysFound==1) {set[zz] = tmpDate;} else {subset.push(tmpDate);tmpDate = new Date(tmpDate);daysToAdd=7;tmpDate.setDate(tmpDate.getDate() + daysToAdd);}} else {tmpDate.setDate(tmpDate.getDate() + daysToAdd);}}
+var t = set.concat(subset);set = t;}}
+}}else {var subset=[];for (var zz=0; zz < set.length; zz++) {var newDate = new Date(set[zz]);if (regexResult[1] == "-") {if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {newDate.setDate(dojo.date.getDaysInMonth(set[zz]) - regexResult[2]);}} else {if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {newDate.setDate(regexResult[2]);}}
+subset.push(newDate);}
+tmp = set.concat(subset);set = tmp;}}
+}} else {dojo.debug("TODO: byday within a yearly rule without a bymonth");}}
+dojo.debug("TODO: Process BYrules for units larger than frequency");var tmp = recurranceSet.concat(set);recurranceSet = tmp;}}
+recurranceSet.push(dtstart);return recurranceSet;},getDate: function() {return dojo.date.fromIso8601(this.dtstart.value);}});var VTimeZoneProperties = [
+_P("tzid", 1, true), _P("last-mod", 1), _P("tzurl", 1)
+];dojo.cal.iCalendar.VTimeZone = function ( body) {this.name = "VTIMEZONE";this._ValidProperties = VTimeZoneProperties;dojo.cal.iCalendar.Component.call(this, body);}
+dojo.inherits(dojo.cal.iCalendar.VTimeZone, dojo.cal.iCalendar.Component);var VTodoProperties = [
+_P("class", 1), _P("completed", 1), _P("created", 1), _P("description", 1),_P("dtstart", 1), _P("geo", 1), _P("last-mod", 1), _P("location", 1),_P("organizer", 1), _P("percent", 1), _P("priority", 1), _P("dtstamp", 1),_P("seq", 1), _P("status", 1), _P("summary", 1), _P("uid", 1), _P("url", 1),_P("recurid", 1),[_P("due", 1), _P("duration", 1)],_P("attach"), _P("attendee"), _P("categories"), _P("comment"), _P("contact"),_P("exdate"), _P("exrule"), _P("rstatus"), _P("related"), _P("resources"),_P("rdate"), _P("rrule")
+];dojo.cal.iCalendar.VTodo= function ( body) {this.name = "VTODO";this._ValidProperties = VTodoProperties;dojo.cal.iCalendar.Component.call(this, body);}
+dojo.inherits(dojo.cal.iCalendar.VTodo, dojo.cal.iCalendar.Component);var VJournalProperties = [
+_P("class", 1), _P("created", 1), _P("description", 1), _P("dtstart", 1),_P("last-mod", 1), _P("organizer", 1), _P("dtstamp", 1), _P("seq", 1),_P("status", 1), _P("summary", 1), _P("uid", 1), _P("url", 1), _P("recurid", 1),_P("attach"), _P("attendee"), _P("categories"), _P("comment"), _P("contact"),_P("exdate"), _P("exrule"), _P("related"), _P("rstatus"), _P("rdate"), _P("rrule")
+];dojo.cal.iCalendar.VJournal= function ( body) {this.name = "VJOURNAL";this._ValidProperties = VJournalProperties;dojo.cal.iCalendar.Component.call(this, body);}
+dojo.inherits(dojo.cal.iCalendar.VJournal, dojo.cal.iCalendar.Component);var VFreeBusyProperties = [
+_P("contact"), _P("dtstart", 1), _P("dtend"), _P("duration"),_P("organizer", 1), _P("dtstamp", 1), _P("uid", 1), _P("url", 1),_P("attendee"), _P("comment"), _P("freebusy"), _P("rstatus")
+];dojo.cal.iCalendar.VFreeBusy= function ( body) {this.name = "VFREEBUSY";this._ValidProperties = VFreeBusyProperties;dojo.cal.iCalendar.Component.call(this, body);}
+dojo.inherits(dojo.cal.iCalendar.VFreeBusy, dojo.cal.iCalendar.Component);var VAlarmProperties = [
+[_P("action", 1, true), _P("trigger", 1, true), [_P("duration", 1), _P("repeat", 1)],_P("attach", 1)],[_P("action", 1, true), _P("description", 1, true), _P("trigger", 1, true),[_P("duration", 1), _P("repeat", 1)]],[_P("action", 1, true), _P("description", 1, true), _P("trigger", 1, true),_P("summary", 1, true), _P("attendee", "*", true),[_P("duration", 1), _P("repeat", 1)],_P("attach", 1)],[_P("action", 1, true), _P("attach", 1, true), _P("trigger", 1, true),[_P("duration", 1), _P("repeat", 1)],_P("description", 1)]
+];dojo.cal.iCalendar.VAlarm= function ( body) {this.name = "VALARM";this._ValidProperties = VAlarmProperties;dojo.cal.iCalendar.Component.call(this, body);}
+dojo.inherits(dojo.cal.iCalendar.VAlarm, dojo.cal.iCalendar.Component);
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/cal/textDirectory.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/cal/textDirectory.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/cal/textDirectory.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/cal/textDirectory.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,11 @@
+
+dojo.provide("dojo.cal.textDirectory");dojo.require("dojo.string");dojo.cal.textDirectory.Property = function(line){var left = dojo.string.trim(line.substring(0, line.indexOf(':')));var right = dojo.string.trim(line.substr(line.indexOf(':') + 1));var parameters = dojo.string.splitEscaped(left,';');this.name = parameters[0];parameters.splice(0, 1);this.params = [];var arr;for(var i = 0; i < parameters.length; i++){arr = parameters[i].split("=");var key = dojo.string.trim(arr[0].toUpperCase());if(arr.length == 1){ this.params.push([key]); continue; }
+var values = dojo.string.splitEscaped(arr[1],',');for(var j = 0; j < values.length; j++){if(dojo.string.trim(values[j]) != ''){this.params.push([key, dojo.string.trim(values[j])]);}}
+}
+if(this.name.indexOf('.') > 0){arr = this.name.split('.');this.group = arr[0];this.name = arr[1];}
+this.value = right;}
+dojo.cal.textDirectory.tokenise = function(text){var nText = dojo.string.normalizeNewlines(text,"\n").
+replace(/\n[ \t]/g, '').
+replace(/\x00/g, '');var lines = nText.split("\n");var properties = [];for(var i = 0; i < lines.length; i++){if(dojo.string.trim(lines[i]) == ''){ continue; }
+var prop = new dojo.cal.textDirectory.Property(lines[i]);properties.push(prop);}
+return properties;}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Axis.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Axis.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Axis.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Axis.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,23 @@
+
+dojo.provide("dojo.charting.Axis");dojo.require("dojo.lang.common");dojo.charting.Axis = function(label, scale, labels){var id = "dojo-charting-axis-"+dojo.charting.Axis.count++;this.getId=function(){ return id; };this.setId=function(key){ id = key; };this.scale = scale || "linear";this.label = label || "";this.showLabel = true;this.showLabels = true;this.showLines = false;this.showTicks = false;this.range = { upper:100, lower:0 };this.origin = "min";this._origin = null;this.labels = labels || [];this._labels = [];this.nodes={ main: null, axis: null, label: null, labels: null, lines: null, ticks: null };this._rerender = false;};dojo.charting.Axis.count = 0;dojo.extend(dojo.charting.Axis, {getCoord: function(
+val, 
+plotArea, 
+plot
+){val = parseFloat(val, 10);var area = plotArea.getArea();if(plot.axisX == this){var offset = 0 - this.range.lower;var min = this.range.lower + offset;var max = this.range.upper + offset;val += offset;return (val*((area.right-area.left)/max))+area.left;} else {var max = this.range.upper;var min = this.range.lower;var offset = 0;if(min<0){offset += Math.abs(min);}
+max += offset; min += offset; val += offset;var pmin = area.bottom;var pmax = area.top;return (((pmin-pmax)/(max-min))*(max-val))+pmax;}},initializeOrigin: function(drawAgainst, plane){if(this._origin == null){this._origin = this.origin;}
+if(isNaN(this._origin)){if(this._origin.toLowerCase() == "max"){this.origin = drawAgainst.range[(plane=="y")?"upper":"lower"]; 
+}
+else if (this._origin.toLowerCase() == "min"){this.origin = drawAgainst.range[(plane=="y")?"lower":"upper"]; 
+}
+else { this.origin=0; }}
+},initializeLabels: function(){this._labels = [];if(this.labels.length == 0){this.showLabels = false;this.showLines = false;this.showTicks = false;} else {if(this.labels[0].label && this.labels[0].value != null){for(var i=0; i<this.labels.length; i++){this._labels.push(this.labels[i]);}}
+else if(!isNaN(this.labels[0])){for(var i=0; i<this.labels.length; i++){this._labels.push({ label: this.labels[i], value: this.labels[i] });}}
+else {var a = [];for(var i=0; i<this.labels.length; i++){a.push(this.labels[i]);}
+var s=a.shift();this._labels.push({ label: s, value: this.range.lower });if(a.length>0){var s=a.pop();this._labels.push({ label: s, value: this.range.upper });}
+if(a.length>0){var range = this.range.upper - this.range.lower;var step = range / (this.labels.length-1);for(var i=1; i<=a.length; i++){this._labels.push({label: a[i-1],value: this.range.lower+(step*i)
+});}}
+}}
+},initialize: function(plotArea, plot, drawAgainst, plane){this.destroy();this.initializeOrigin(drawAgainst, plane);this.initializeLabels();var node = this.render(plotArea, plot, drawAgainst, plane);return node;},destroy: function(){for(var p in this.nodes){while(this.nodes[p] && this.nodes[p].childNodes.length > 0){this.nodes[p].removeChild(this.nodes[p].childNodes[0]);}
+if(this.nodes[p] && this.nodes[p].parentNode){this.nodes[p].parentNode.removeChild(this.nodes[p]);}
+this.nodes[p] = null;}}
+});dojo.requireIf(dojo.render.svg.capable, "dojo.charting.svg.Axis");dojo.requireIf(dojo.render.vml.capable, "dojo.charting.vml.Axis");
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Chart.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Chart.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Chart.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Chart.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,13 @@
+
+dojo.provide("dojo.charting.Chart");dojo.require("dojo.lang.common");dojo.require("dojo.charting.PlotArea");dojo.charting.Chart = function(
+node, 
+title, 
+description
+){this.node = node || null;this.title = title || "Chart";this.description = description || "";this.plotAreas = [];};dojo.extend(dojo.charting.Chart, {addPlotArea: function(obj, doRender){if(obj.x!=null && obj.left==null){ obj.left = obj.x; }
+if(obj.y!=null && obj.top==null){ obj.top = obj.y; }
+this.plotAreas.push(obj);if(doRender){ this.render(); }},onInitialize:function(chart){ },onRender:function(chart){ },onDestroy:function(chart){ },initialize: function(){if(!this.node){dojo.raise("dojo.charting.Chart.initialize: there must be a root node defined for the Chart."); 
+}
+this.destroy();this.render();this.onInitialize(this);},render:function(){if(this.node.style.position != "absolute"){this.node.style.position = "relative";}
+for(var i=0; i<this.plotAreas.length; i++){var area = this.plotAreas[i].plotArea;var node = area.initialize();node.style.position = "absolute";node.style.top = this.plotAreas[i].top + "px";node.style.left = this.plotAreas[i].left + "px";this.node.appendChild(node);area.render();}},destroy: function(){for(var i=0; i<this.plotAreas.length; i++){this.plotAreas[i].plotArea.destroy();};while(this.node && this.node.childNodes && this.node.childNodes.length > 0){this.node.removeChild(this.node.childNodes[0]); 
+}}
+});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Plot.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Plot.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Plot.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Plot.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,16 @@
+
+dojo.provide("dojo.charting.Plot");dojo.require("dojo.lang.common");dojo.require("dojo.charting.Axis");dojo.require("dojo.charting.Series");dojo.charting.RenderPlotSeries = { Singly:"single", Grouped:"grouped" };dojo.charting.Plot = function(
+xaxis, 
+yaxis, 
+series
+){var id = "dojo-charting-plot-"+dojo.charting.Plot.count++;this.getId=function(){ return id; };this.setId=function(key){ id = key; };this.axisX = null;this.axisY = null;this.series = [];this.dataNode = null;this.renderType = dojo.charting.RenderPlotSeries.Singly;if(xaxis){this.setAxis(xaxis,"x");}
+if(yaxis){this.setAxis(yaxis,"y");}
+if(series){for(var i=0; i<series.length; i++){ this.addSeries(series[i]); }}
+}
+dojo.charting.Plot.count=0;dojo.extend(dojo.charting.Plot, {addSeries: function(
+series,plotter
+){if(series.plotter){this.series.push(series);} else {this.series.push({data: series,plotter: plotter || dojo.charting.Plotters["Default"]
+});}},setAxis: function(axis, which){if(which.toLowerCase()=="x"){ this.axisX = axis; }
+else if(which.toLowerCase()=="y"){ this.axisY = axis; }},getRanges: function(){var xmin, xmax, ymin, ymax;xmin=ymin=Number.MAX_VALUE;xmax=ymax=Number.MIN_VALUE;for(var i=0; i<this.series.length; i++){var values = this.series[i].data.evaluate();for(var j=0; j<values.length; j++){var comp=values[j];xmin=Math.min(comp.x, xmin);ymin=Math.min(comp.y, ymin);xmax=Math.max(comp.x, xmax);ymax=Math.max(comp.y, ymax);}}
+return {x:{ upper: xmax, lower:xmin },y:{ upper: ymax, lower:ymin },toString:function(){return "[ x:"+xmax+" - "+xmin+", y:"+ymax+" - "+ymin+"]";}};},destroy: function(){var node=this.dataNode;while(node && node.childNodes && node.childNodes.length > 0){node.removeChild(node.childNodes[0]);}
+this.dataNode=null;}});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/PlotArea.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/PlotArea.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/PlotArea.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/PlotArea.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,27 @@
+
+dojo.provide("dojo.charting.PlotArea");dojo.require("dojo.lang.common");dojo.require("dojo.gfx.color");dojo.require("dojo.gfx.color.hsl");dojo.require("dojo.charting.Plot");dojo.charting.PlotArea = function(){var id="dojo-charting-plotarea-"+dojo.charting.PlotArea.count++;this.getId=function(){ return id; };this.setId=function(key){ id = key; };this.areaType = "standard";this.plots = [];this.size={ width:600, height:400 };this.padding={ top:10, right:10, bottom:20, left:20 };this.nodes = {main:null,area:null,background: null,axes: null,plots: null
+};this._color = { h: 140, s: 120, l: 120, step: 27 };};dojo.charting.PlotArea.count = 0;dojo.extend(dojo.charting.PlotArea, {nextColor: function(){var rgb=dojo.gfx.color.hsl2rgb(this._color.h, this._color.s, this._color.l);this._color.h = (this._color.h + this._color.step)%360;while(this._color.h < 140){this._color.h += this._color.step; 
+}
+return dojo.gfx.color.rgb2hex(rgb[0], rgb[1], rgb[2]);},getArea:function(){return {left: this.padding.left,right: this.size.width - this.padding.right,top: this.padding.top,bottom: this.size.height - this.padding.bottom,toString:function(){var a=[ this.top, this.right, this.bottom, this.left ];return "["+a.join()+"]";}};},getAxes: function(){var axes={};for(var i=0; i<this.plots.length; i++){var plot=this.plots[i];axes[plot.axisX.getId()] = {axis: plot.axisX,drawAgainst: plot.axisY,plot: plot,plane: "x"
+};axes[plot.axisY.getId()] = {axis: plot.axisY,drawAgainst: plot.axisX,plot: plot,plane: "y"
+};}
+return axes;},getLegendInfo: function(){var a=[];for(var i=0; i<this.plots.length; i++){for(var j=0; j<this.plots[i].series.length; j++){var data = this.plots[i].series[j].data;a.push({ label:data.label, color:data.color });}}
+return a;},setAxesRanges: function(){var ranges={};var axes={};for(var i=0; i<this.plots.length; i++){var plot = this.plots[i];var ranges=plot.getRanges();var x=ranges.x;var y=ranges.y;var ax, ay;if(!axes[plot.axisX.getId()]){axes[plot.axisX.getId()]=plot.axisX;ranges[plot.axisX.getId()]={upper: x.upper, lower:x.lower};}
+ax=ranges[plot.axisX.getId()];ax.upper=Math.max(ax.upper, x.upper);ax.lower=Math.min(ax.lower, x.lower);if(!axes[plot.axisY.getId()]){axes[plot.axisY.getId()]=plot.axisY;ranges[plot.axisY.getId()]={upper: y.upper, lower:y.lower};}
+ay=ranges[plot.axisY.getId()];ay.upper=Math.max(ay.upper, y.upper);ay.lower=Math.min(ay.lower, y.lower);}
+for(var p in axes){axes[p].range=ranges[p];}},render: function(kwArgs, applyToData){if(!this.nodes.main
+|| !this.nodes.area 
+|| !this.nodes.background 
+|| !this.nodes.plots 
+|| !this.nodes.axes
+){ this.initialize(); }
+this.resize();for(var i=0; i<this.plots.length; i++){var plot=this.plots[i];if(plot.dataNode){this.nodes.plots.removeChild(plot.dataNode);}
+var target = this.initializePlot(plot);switch(plot.renderType){case dojo.charting.RenderPlotSeries.Grouped:{if(plot.series[0]){target.appendChild(plot.series[0].plotter(this, plot, kwArgs, applyToData));}
+break;}
+case dojo.charting.RenderPlotSeries.Singly:
+default: {for(var j=0; j<plot.series.length; j++){var series = plot.series[j];var data = series.data.evaluate(kwArgs);target.appendChild(series.plotter(data, this, plot, applyToData));}}
+}
+this.nodes.plots.appendChild(target);}},destroy: function(){for(var i=0; i<this.plots.length; i++){this.plots[i].destroy();};for(var p in this.nodes){var node=this.nodes[p];if(!node) continue;if(!node.childNodes) continue;while(node.childNodes.length > 0){node.removeChild(node.childNodes[0]); 
+}
+this.nodes[p]=null;}}
+});dojo.requireIf(dojo.render.svg.capable, "dojo.charting.svg.PlotArea");dojo.requireIf(dojo.render.vml.capable, "dojo.charting.vml.PlotArea");
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Plotters.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Plotters.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Plotters.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Plotters.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,2 @@
+
+dojo.provide("dojo.charting.Plotters");dojo.requireIf(dojo.render.svg.capable, "dojo.charting.svg.Plotters");dojo.requireIf(dojo.render.vml.capable, "dojo.charting.vml.Plotters");
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/README.txt
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/README.txt?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/README.txt (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/README.txt Mon Feb  5 21:01:25 2007
@@ -0,0 +1,46 @@
+Dojo Charting Engine
+=========================================================================
+The Dojo Charting Engine is a (fairly) complex object structure, designed
+to provide as much flexibility as possible in terms of chart construction.
+To this end, the engine details the following structure:
+
+Chart
+---PlotArea[]
+------Plot[]
+---------Axis (axisX)
+---------Axis (axisY)
+---------Series[]
+
+
+A Chart object is the main entity; it is the entire graphic.  A Chart may
+have any number of PlotArea objects, which are the basic canvas against 
+which data is plotted.  A PlotArea may have any number of Plot objects,
+which is a container representing up to 2 axes and any number of series
+to be plotted against those axes; a Series represents a binding against
+two fields from a data source (initial rev, this data source is always of
+type dojo.collections.Store but this will probably change once dojo.data
+is in production).
+
+The point of this structure is to allow for as much flexibility as possible
+in terms of what kinds of charts can be represented by the engine.  The
+current plan is to accomodate up to analytical financial charts, which tend
+to have 3 plot areas and any number of different types of axes on each one.
+
+The main exception to this is the pie chart, which will have it's own
+custom codebase.  Also, 3D charts are not accounted for at this time,
+although the only thing that will probably need to be altered to make
+that work would be Plot and Series (to accomodate the additional Z axis).
+
+Finally, a Plot will render its series[] through the use of Plotters, which
+are custom methods to render specific types of charts.
+-------------------------------------------------------------------------
+In terms of widgets, the basic concept is that there is a central, super-
+flexible Chart widget (Chart, oddly enough), and then any number of preset
+chart type widgets, that are basically built to serve a simple, easy 
+purpose.  For instance, if someone just needs to plot a series of lines,
+they would be better off using the LineChart widget; but if someone needed
+to plot a combo chart, that has 2 Y Axes (one linear, one log) against the
+same X Axis, using lines and areas, then they will want to use a Chart widget.
+Note also that unlike other widgets, the Charting engine *can* be called
+directly from script *without* the need for the actual widget engine to be
+loaded; the Chart widgets are thin wrappers around the charting engine.
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Series.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Series.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Series.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/Series.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,33 @@
+
+dojo.provide("dojo.charting.Series");dojo.require("dojo.lang.common");dojo.require("dojo.charting.Plotters");dojo.charting.Series = function(kwArgs){var args = kwArgs || { length:1 };this.dataSource = args.dataSource || null;this.bindings = { };this.color = args.color;this.label = args.label;if(args.bindings){for(var p in args.bindings){this.addBinding(p, args.bindings[p]);}}
+};dojo.extend(dojo.charting.Series, {bind:function(src, bindings){this.dataSource = src;this.bindings = bindings;},addBinding:function(name, binding){this.bindings[name] = binding;},evaluate:function(kwArgs){var ret = [];var a = this.dataSource.getData();var l = a.length;var start = 0;var end = l;if(kwArgs){if(kwArgs.between){for(var i=0; i<l; i++){var fld = this.dataSource.getField(a[i], kwArgs.between.field);if(fld>=kwArgs.between.low && fld<=kwArgs.between.high){var o = { src: a[i], series: this };for(var p in this.bindings){o[p] = this.dataSource.getField(a[i], this.bindings[p]);}
+ret.push(o);}}
+}
+else if(kwArgs.from || kwArgs.length){if(kwArgs.from){start = Math.max(kwArgs.from,0);if(kwArgs.to){end = Math.min(kwArgs.to, end);}} else {if(kwArgs.length < 0){start = Math.max((end + length),0);} else {end = Math.min((start + length), end);}}
+for(var i=start; i<end; i++){var o = { src: a[i], series: this };for(var p in this.bindings){o[p] = this.dataSource.getField(a[i], this.bindings[p]);}
+ret.push(o);}}
+} else {for(var i=start; i<end; i++){var o = { src: a[i], series: this };for(var p in this.bindings){o[p] = this.dataSource.getField(a[i], this.bindings[p]);}
+ret.push(o);}}
+if(ret.length>0 && typeof(ret[0].x) != "undefined"){ret.sort(function(a,b){if(a.x > b.x) return 1;if(a.x < b.x) return -1;return 0;});}
+return ret;},trends:{createRange: function(values, len){var idx = values.length-1;var length = (len||values.length);return { "index": idx, "length": length, "start":Math.max(idx-length,0) };},mean: function(values, len){var range = this.createRange(values, len);if(range.index<0){ return 0; }
+var total = 0;var count = 0;for(var i=range.index; i>=range.start; i--){total += values[i].y; 
+count++;}
+total /= Math.max(count,1);return total;},variance: function(values,len){var range = this.createRange(values,len);if(range.index < 0){ return 0; }
+var total = 0;var square = 0;var count = 0;for(var i=range.index; i>=range.start; i--){total += values[i].y;square += Math.pow(values[i].y, 2);count++;}
+return (square/count)-Math.pow(total/count,2);},standardDeviation: function(values, len){return Math.sqrt(this.getVariance(values, len));},max: function(values, len){var range = this.createRange(values, len);if(range.index < 0){ return 0; }
+var max = Number.MIN_VALUE;for (var i=range.index; i>=range.start; i--){max = Math.max(values[i].y,max);}
+return max;},min: function(values, len){var range=this.createRange(values, len);if(range.index < 0){ return 0; }
+var min = Number.MAX_VALUE;for(var i=range.index; i>=range.start; i--){min = Math.min(values[i].y, min);}
+return min;},median: function(values, len){var range = this.createRange(values, len);if(range.index<0){ return 0; }
+var a = [];for (var i=range.index; i>=range.start; i--){var b=false;for(var j=0; j<a.length; j++){if(values[i].y == a[j]){b = true;break;}}
+if(!b){a.push(values[i].y); 
+}}
+a.sort();if(a.length > 0){return a[Math.ceil(a.length / 2)];}
+return 0;},mode: function(values, len){var range=this.createRange(values, len);if(range.index<0){ return 0; }
+var o = {};var ret = 0
+var median = Number.MIN_VALUE;for(var i=range.index; i>=range.start; i--){if (!o[values[i].y]){o[values[i].y] = 1;} else {o[values[i].y]++;}}
+for(var p in o){if(median < o[p]){median = o[p]; 
+ret=p; 
+}}
+return ret;}}
+});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/__package__.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/__package__.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/__package__.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,2 @@
+
+dojo.provide("dojo.charting.*");
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/svg/Axis.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/svg/Axis.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/svg/Axis.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/svg/Axis.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,40 @@
+
+dojo.provide("dojo.charting.svg.Axis");dojo.require("dojo.lang.common");if(dojo.render.svg.capable){dojo.extend(dojo.charting.Axis, {renderLines: function(
+plotArea, 
+plot, 
+plane
+){if(this.nodes.lines){while(this.nodes.lines.childNodes.length > 0){this.nodes.lines.removeChild(this.nodes.lines.childNodes[0]);}
+if(this.nodes.lines.parentNode){this.nodes.lines.parentNode.removeChild(this.nodes.lines);this.nodes.lines = null;}}
+var area = plotArea.getArea();var g = this.nodes.lines = document.createElementNS(dojo.svg.xmlns.svg, "g");g.setAttribute("id", this.getId()+"-lines");for(var i=0; i<this._labels.length; i++){if (this._labels[i].value == this.origin){ continue; }
+var v = this.getCoord(this._labels[i].value, plotArea, plot);var l=document.createElementNS(dojo.svg.xmlns.svg, "line");l.setAttribute("style","stroke:#999;stroke-width:1px;stroke-dasharray:1,4;");if(plane == "x"){l.setAttribute("y1",area.top);l.setAttribute("y2",area.bottom);l.setAttribute("x1",v);l.setAttribute("x2",v);}
+else if (plane == "y"){l.setAttribute("y1",v);l.setAttribute("y2",v);l.setAttribute("x1",area.left);l.setAttribute("x2",area.right);}
+g.appendChild(l);}
+return g;},renderTicks: function(
+plotArea, 
+plot, 
+plane,coord
+){if(this.nodes.ticks){while(this.nodes.ticks.childNodes.length > 0){this.nodes.ticks.removeChild(this.nodes.ticks.childNodes[0]);}
+if(this.nodes.ticks.parentNode){this.nodes.ticks.parentNode.removeChild(this.nodes.ticks);this.nodes.ticks = null;}}
+var g = this.nodes.ticks = document.createElementNS(dojo.svg.xmlns.svg, "g");g.setAttribute("id", this.getId()+"-ticks");for(var i=0; i<this._labels.length; i++){var v = this.getCoord(this._labels[i].value, plotArea, plot);var l=document.createElementNS(dojo.svg.xmlns.svg, "line");l.setAttribute("style","stroke:#000;stroke-width:1pt;");if(plane == "x"){l.setAttribute("y1",coord);l.setAttribute("y2",coord+3);l.setAttribute("x1",v);l.setAttribute("x2",v);}
+else if (plane == "y"){l.setAttribute("y1",v);l.setAttribute("y2",v);l.setAttribute("x1",coord-2);l.setAttribute("x2",coord+2);}
+g.appendChild(l);}
+return g;},renderLabels: function(
+plotArea, 
+plot, 
+plane,coord,textSize,anchor
+){function createLabel(label, x, y, textSize, anchor){var text = document.createElementNS(dojo.svg.xmlns.svg, "text");text.setAttribute("x", x);text.setAttribute("y", (plane=="x"?y:y+2));text.setAttribute("style", "text-anchor:"+anchor+";font-family:sans-serif;font-size:"+textSize+"px;fill:#000;");text.appendChild(document.createTextNode(label));return text;};if(this.nodes.labels){while(this.nodes.labels.childNodes.length > 0){this.nodes.labels.removeChild(this.nodes.labels.childNodes[0]);}
+if(this.nodes.labels.parentNode){this.nodes.labels.parentNode.removeChild(this.nodes.labels);this.nodes.labels = null;}}
+var g = this.nodes.labels = document.createElementNS(dojo.svg.xmlns.svg, "g");g.setAttribute("id", this.getId()+"-labels");for(var i=0; i<this._labels.length; i++){var v = this.getCoord(this._labels[i].value, plotArea, plot);if(plane == "x"){g.appendChild(createLabel(this._labels[i].label, v, coord, textSize, anchor));}
+else if (plane == "y"){g.appendChild(createLabel(this._labels[i].label, coord, v, textSize, anchor));}}
+return g;},render: function(
+plotArea, 
+plot,drawAgainst,plane
+){if(!this._rerender && this.nodes.main){return this.nodes.main;}
+this._rerender = false;var area = plotArea.getArea();var stroke = 1;var style = "stroke:#000;stroke-width:"+stroke+"px;";var textSize=10;var coord = drawAgainst.getCoord(this.origin, plotArea, plot);this.nodes.main = document.createElementNS(dojo.svg.xmlns.svg, "g");var g = this.nodes.main;g.setAttribute("id", this.getId());var line = this.nodes.axis = document.createElementNS(dojo.svg.xmlns.svg, "line");if(plane == "x"){line.setAttribute("y1", coord);line.setAttribute("y2", coord);line.setAttribute("x1", area.left-stroke);line.setAttribute("x2", area.right+stroke);line.setAttribute("style", style);var y = coord+textSize+2;if(this.showLines){g.appendChild(this.renderLines(plotArea, plot, plane, y));}
+if(this.showTicks){g.appendChild(this.renderTicks(plotArea, plot, plane, coord));}
+if(this.showLabels){g.appendChild(this.renderLabels(plotArea, plot, plane, y, textSize, "middle"));}
+if(this.showLabel && this.label){var x = plotArea.size.width/2;var text = document.createElementNS(dojo.svg.xmlns.svg, "text");text.setAttribute("x", x);text.setAttribute("y", (coord + (textSize*2) + (textSize/2)));text.setAttribute("style", "text-anchor:middle;font-family:sans-serif;font-weight:bold;font-size:"+(textSize+2)+"px;fill:#000;");text.appendChild(document.createTextNode(this.label));g.appendChild(text);}} else {line.setAttribute("x1", coord);line.setAttribute("x2", coord);line.setAttribute("y1", area.top);line.setAttribute("y2", area.bottom);line.setAttribute("style", style);var isMax = this.origin == drawAgainst.range.upper;var x = coord + (isMax?4:-4);var anchor = isMax?"start":"end";if(this.showLines){g.appendChild(this.renderLines(plotArea, plot, plane, x));}
+if(this.showTicks){g.appendChild(this.renderTicks(plotArea, plot, plane, coord));}
+if(this.showLabels){g.appendChild(this.renderLabels(plotArea, plot, plane, x, textSize, anchor));}
+if(this.showLabel && this.label){var x = isMax?(coord+(textSize*2)+(textSize/2)):(coord-(textSize*4));var y = plotArea.size.height / 2;var text = document.createElementNS(dojo.svg.xmlns.svg, "text");text.setAttribute("x", x);text.setAttribute("y", y);text.setAttribute("transform", "rotate(90, " + x + ", " + y + ")");text.setAttribute("style", "text-anchor:middle;font-family:sans-serif;font-weight:bold;font-size:"+(textSize+2)+"px;fill:#000;");text.appendChild(document.createTextNode(this.label));g.appendChild(text);}}
+g.appendChild(line);return g;}});}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/svg/PlotArea.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/svg/PlotArea.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/svg/PlotArea.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/charting/svg/PlotArea.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,6 @@
+
+dojo.provide("dojo.charting.svg.PlotArea");dojo.require("dojo.lang.common");if(dojo.render.svg.capable){dojo.require("dojo.svg");dojo.extend(dojo.charting.PlotArea, {resize: function(){var area = this.getArea();this.nodes.area.setAttribute("width", this.size.width);this.nodes.area.setAttribute("height", this.size.height);var rect = this.nodes.area.getElementsByTagName("rect")[0];rect.setAttribute("x", area.left);rect.setAttribute("y", area.top);rect.setAttribute("width", area.right-area.left);rect.setAttribute("height", area.bottom-area.top);this.nodes.background.setAttribute("width", this.size.width);this.nodes.background.setAttribute("height", this.size.height);if(this.nodes.plots){this.nodes.area.removeChild(this.nodes.plots);this.nodes.plots = null;}
+this.nodes.plots = document.createElementNS(dojo.svg.xmlns.svg, "g");this.nodes.plots.setAttribute("id", this.getId()+"-plots");this.nodes.plots.setAttribute("style","clip-path:url(#"+this.getId()+"-clip);");this.nodes.area.appendChild(this.nodes.plots);for(var i=0; i<this.plots.length; i++){this.nodes.plots.appendChild(this.initializePlot(this.plots[i]));}
+if(this.nodes.axes){this.nodes.area.removeChild(this.nodes.axes);this.nodes.axes = null;}
+this.nodes.axes = document.createElementNS(dojo.svg.xmlns.svg, "g");this.nodes.axes.setAttribute("id", this.getId()+"-axes");this.nodes.area.appendChild(this.nodes.axes);var axes = this.getAxes();for(var p in axes){var obj = axes[p];this.nodes.axes.appendChild(obj.axis.initialize(this, obj.plot, obj.drawAgainst, obj.plane));}},initializePlot: function(plot){plot.destroy();plot.dataNode = document.createElementNS(dojo.svg.xmlns.svg, "g");plot.dataNode.setAttribute("id", plot.getId());return plot.dataNode;},initialize: function(){this.destroy();this.nodes.main = document.createElement("div");this.nodes.area = document.createElementNS(dojo.svg.xmlns.svg, "svg");this.nodes.area.setAttribute("id", this.getId());this.nodes.main.appendChild(this.nodes.area);var defs = document.createElementNS(dojo.svg.xmlns.svg, "defs");var clip = document.createElementNS(dojo.svg.xmlns.svg, "clipPath");clip.setAttribute("id",this.getId()+"-clip");var rect = document.createElementNS(dojo.svg.xmlns.
 svg, "rect");
+clip.appendChild(rect);defs.appendChild(clip);this.nodes.area.appendChild(defs);this.nodes.background = document.createElementNS(dojo.svg.xmlns.svg, "rect");this.nodes.background.setAttribute("id", this.getId()+"-background");this.nodes.background.setAttribute("fill", "#fff");this.nodes.area.appendChild(this.nodes.background);this.resize();return this.nodes.main;}});}