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 2006/06/10 16:27:54 UTC

svn commit: r413306 [15/17] - in /tapestry/tapestry4/trunk: examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/ framework/src/java/org/apache/tapestry/ framework/src/java/org/apache/tapestry/dojo/form/ framework/src/java/org/apache/tape...

Added: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/DocPane.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/DocPane.js?rev=413306&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/DocPane.js (added)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/DocPane.js Sat Jun 10 07:27:44 2006
@@ -0,0 +1,210 @@
+/*
+	Copyright (c) 2004-2006, 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.widget.html.DocPane");
+
+dojo.require("dojo.widget.*");
+dojo.require("dojo.io.*");
+dojo.require("dojo.event.*");
+dojo.require("dojo.widget.HtmlWidget");
+
+dojo.widget.html.DocPane = function(){
+	dojo.widget.HtmlWidget.call(this);
+
+	this.templatePath = dojo.uri.dojoUri("src/widget/templates/HtmlDocPane.html");
+	this.templateCssPath = dojo.uri.dojoUri("src/widget/templates/HtmlDocPane.css");
+	this.widgetType = "DocPane";
+	this.isContainer = true;
+
+	this.select;
+	this.result;
+	this.fn;
+	this.fnLink;
+	this.count;
+	this.row;
+	this.summary;
+	this.description;
+	this.variables;
+	this.vRow;
+	this.vLink;
+	this.vDesc;
+	this.parameters;
+	this.pRow;
+	this.pLink;
+	this.pDesc;
+	this.pOpt;
+	this.pType;
+	this.source;
+	this.sType;
+	this.sName;
+	this.sParams;
+	this.sPType;
+	this.sPTypeSave;
+	this.sPName;
+	this.sPNameSave;
+
+	dojo.event.topic.subscribe("/doc/results", this, "onDocResults");
+	dojo.event.topic.subscribe("/doc/functionDetail", this, "onDocSelectFunction");
+}
+
+dojo.inherits(dojo.widget.html.DocPane, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(dojo.widget.html.DocPane, {
+	fillInTemplate: function(){
+		this.homeSave = this.containerNode.cloneNode(true);
+		this.selectSave = dojo.dom.removeNode(this.select);
+		this.resultSave = dojo.dom.removeNode(this.result);
+		this.rowParent = this.row.parentNode;
+		this.rowSave = dojo.dom.removeNode(this.row);
+		this.vParent = this.vRow.parentNode;
+		this.vSave = dojo.dom.removeNode(this.vRow);
+		this.pParent = this.pRow.parentNode;
+		this.pSave = dojo.dom.removeNode(this.pRow);
+		this.sPTypeSave = dojo.dom.removeNode(this.sPType);
+		this.sPNameSave = dojo.dom.removeNode(this.sPName);
+	},
+
+	onDocSelectFunction: function(message){
+		var meta = message.meta;
+		if(meta){
+			var variables = meta.variables;
+			var this_variables = meta.this_variables;
+			var child_variables = meta.child_variables;
+			var parameters = meta.parameters;
+		}
+		var doc = message.doc;
+
+		var appends = [];
+		dojo.dom.removeChildren(this.domNode);
+		this.fn.innerHTML = message.name;
+		this.description.innerHTML = doc.description;
+
+		this.variables.style.display = "block";
+		var all = [];
+		if(variables){
+			all = variables;
+		}
+		if(this_variables){
+			all = all.concat(this_variables);
+		}
+		if(child_variables){
+			all = all.concat(child_variables);
+		}
+		if(!all.length){
+			this.variables.style.display = "none";
+		}else{
+			for(var i = 0, one; one = all[i]; i++){
+				this.vLink.innerHTML = one;
+				this.vDesc.parentNode.style.display = "none";
+				appends.push(this.vParent.appendChild(this.vSave.cloneNode(true)));
+			}
+		}
+		
+		this.sParams.innerHTML = "";
+		for(var param in parameters){
+			var paramType = parameters[param][0];
+			var paramName = parameters[param][1];
+			this.parameters.style.display = "block";		
+			this.pLink.innerHTML = paramName;
+			this.pOpt.style.display = "none";
+			if(parameters[param].opt){
+				this.pOpt.style.display = "inline";				
+			}
+			this.pType.parentNode.style.display = "none";
+			if(parameters[param][0]){
+				this.pType.parentNode.style.display = "inline";
+				this.pType.innerHTML = paramType;
+			}
+			this.pDesc.parentNode.style.display = "none";
+			if(doc.parameters[paramName] && doc.parameters[paramName].description){
+				this.pDesc.parentNode.style.display = "inline";
+				this.pDesc.innerHTML = doc.parameters[paramName].description;
+			}
+			appends.push(this.pParent.appendChild(this.pSave.cloneNode(true)));
+			
+			if(param > 0) {
+				this.sParams.appendChild(document.createTextNode(", "));
+			}
+			if(paramType){
+				dojo.debug(this.sPTypeSave);
+				this.sPTypeSave.innerHTML = paramType;
+				this.sParams.appendChild(this.sPTypeSave.cloneNode(true));
+				this.sParams.appendChild(document.createTextNode(" "));
+			}
+			dojo.debug(this.sPNameSave);
+			this.sPNameSave.innerHTML = paramName;
+			this.sParams.appendChild(this.sPNameSave.cloneNode(true))
+		}
+
+		if(message.returns){
+			this.sType.innerHTML = message.returns;
+		}else{
+			this.sType.innerHTML = "void";
+		}
+		
+		this.sName.innerHTML = message.name;
+		
+		dojo.dom.removeChildren(this.source);
+                this.source.appendChild(document.createTextNode("\n\r"));
+		this.source.appendChild(document.createTextNode(message.src.replace(/\n/g, "\r\n\t")));
+                this.source.appendChild(document.createTextNode("\n\r"));
+		
+		this.domNode.appendChild(this.selectSave.cloneNode(true));
+
+		for(var i = 0, append; append = appends[i]; i++){
+			dojo.dom.removeNode(append);
+		}
+	},
+
+	onDocResults: function(message){
+		var results = message.docResults;
+		
+		if(results.length == 1){
+			dojo.event.topic.publish("/doc/selectFunction", results[0]);
+			return;
+		}
+
+		dojo.dom.removeChildren(this.domNode);
+
+		this.count.innerHTML = results.length;
+		var appends = [];
+		for(var i = 0, row; row = results[i]; i++){
+			this.fnLink.innerHTML = row.name;
+			this.fnLink.href = "#" + row.name;
+			if(row.id){
+				this.fnLink.href = this.fnLink.href + "," + row.id;	
+			}
+			this.summary.parentNode.style.display = "none";
+			if(row.summary){
+				this.summary.parentNode.style.display = "inline";				
+				this.summary.innerHTML = row.summary;
+			}
+			appends.push(this.rowParent.appendChild(this.rowSave.cloneNode(true)));
+		}
+		
+		function makeSelect(x){
+			return function(e) {
+				dojo.event.topic.publish("/doc/selectFunction", x);
+			}
+		}
+
+		this.domNode.appendChild(this.resultSave.cloneNode(true));
+		var as = this.domNode.getElementsByTagName("a");
+		for(var i = 0, a; a = as[i]; i++){
+			dojo.event.connect(a, "onclick", makeSelect(results[i]));
+		}
+		
+		for(var i = 0, append; append = appends[i]; i++){
+			this.rowParent.removeChild(append);
+		}
+	}
+});
+
+dojo.widget.tags.addParseTreeHandler("dojo:DocPane");

Propchange: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/DocPane.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/DropdownButton.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/DropdownButton.js?rev=413306&r1=413305&r2=413306&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/DropdownButton.js (original)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/DropdownButton.js Sat Jun 10 07:27:44 2006
@@ -8,179 +8,179 @@
 		http://dojotoolkit.org/community/licensing.shtml
 */
 
-/* TODO:
- * - make the dropdown "smart" so it can't get cutoff on bottom of page, sides of page, etc.
- */
-
-dojo.provide("dojo.widget.html.DropdownButton");
-
-dojo.require("dojo.event.*");
-dojo.require("dojo.widget.*");
-dojo.require("dojo.widget.HtmlWidget");
-dojo.require("dojo.uri.Uri");
-dojo.require("dojo.dom");
-dojo.require("dojo.style");
-dojo.require("dojo.html");
-
-dojo.widget.html.DropdownButton = function() {
-	// mix in the button properties
-	dojo.widget.DropdownButton.call(this);
-	dojo.widget.HtmlWidget.call(this);
-}
-
-dojo.inherits(dojo.widget.html.DropdownButton, dojo.widget.HtmlWidget);
-
-dojo.lang.extend(dojo.widget.html.DropdownButton, {
-	
-	// In IE, event handlers on objects inside buttons don't work correctly, so
-	// we just set onClick on the button itself.
-	templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlDropDownButtonTemplate.html"),
-	templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlButtonTemplate.css"),
-
-	// attach points
-	button: null,
-	table: null,
-	labelCell: null,
-	borderCell: null,
-	arrowCell: null,
-	arrow: null,
-
-	fillInTemplate: function(args, frag) {
-		// input data (containing the anchor for the button itself, plus the
-		// thing to display when you push the down arrow)
-		var input = frag["dojo:"+this.widgetType.toLowerCase()]["nodeRef"];
-
-		// Recursively expand widgets inside of the <dojo:dropdownButton>
-		var parser = new dojo.xml.Parse();
-		var frag = parser.parseElement(input, null, true);
-		var ary = dojo.widget.getParser().createComponents(frag);
-
-		this.a = dojo.dom.getFirstChildElement(input);	// the button contents
-		this.menu = dojo.dom.getNextSiblingElement(this.a);	// the menu under the button
-		
-		this.disabled = dojo.html.hasClass(this.a, "disabled");
-		if( this.disabled ) {
-			dojo.html.addClass(this.button, "dojoDisabled");
-			this.domNode.setAttribute("disabled", "true");
-		}
-
-		dojo.html.disableSelection(this.a);
-		this.a.style["text-decoration"]="none";
-		this.labelCell.appendChild(this.a);
-
-		this.arrow.src =
-			dojo.uri.dojoUri("src/widget/templates/images/dropdownButtonsArrow" +
-			(this.disabled ? "-disabled" : "") + ".gif");
-
-		// Attach menu to body so that it appears above other buttons
-		this.menu.style.position="absolute";
-		this.menu.style.display="none";
-		this.menu.style["z-index"] = 99;
-		document.body.appendChild(this.menu);
-	},
-
-	postCreate: function() {
-		if ( dojo.render.html.ie ) {
-			// Compensate for IE's weird padding of button content, which seems to be relative
-			// to the length of the content
-			var contentWidth = dojo.style.getOuterWidth(this.table);
-			this.labelCell.style["left"] = "-" + (contentWidth / 10) + "px";
-			this.arrowCell.style["left"] = (contentWidth / 10) + "px";
-		}
-
-		// Make menu at least as wide as the button
-		var buttonWidth = dojo.style.getOuterWidth(this.button);
-		var menuWidth = dojo.style.getOuterWidth(this.menu);
-		if ( buttonWidth > menuWidth ) {
-			dojo.style.setOuterWidth(this.menu, buttonWidth);
-		}
-	},
-
-	// If someone clicks anywhere else on the screen (including another menu),
-	// then close this menu.
-	onCanvasMouseDown: function(e) {
-		if( !dojo.dom.isDescendantOf(e.target, this.button) &&
-			!dojo.dom.isDescendantOf(e.target, this.menu) ) {
-			this.hideMenu();
-		}
-	},
-
-	eventWasOverArrow: function(e) {
-		// want to use dojo.html.overElement() but also need to detect clicks
-		// on the area between the arrow and the edge of the button
-		var eventX = e.clientX;
-		var borderX = dojo.style.totalOffsetLeft(this.borderCell);
-		return (eventX > borderX );
-	},
-
-	onMouseOver: function(e) {
-		dojo.html.addClass(this.button, "dojoButtonHover");
-		dojo.html.removeClass(this.button, "dojoButtonNoHover");
-	},
-	
-	onMouseOut: function(e) {
-		dojo.html.removeClass(this.button, "dojoButtonHover");
-		dojo.html.addClass(this.button, "dojoButtonNoHover");
-	},
-
-	onClick: function(e) {
-		if ( this.eventWasOverArrow(e) ) {
-			this._onClickArrow();
-		} else {
-			this._onClickButton();
-		}
-	},
-
-	// Action when the user presses the button
-	_onClickButton: function(e) {
-		if ( this.a ) {
-			if ( this.a.click ) {
-				this.a.click();
-			} else if ( this.a.href ) {
-				location.href = this.a.href;
-			}
-		}
-	},
-
-	// Action when user presses the arrow
-	_onClickArrow: function() {
-		if ( this.menu.style.display == "none" ) {
-			this.showMenu();
-		} else {
-			this.hideMenu();
-		}
-	},
-	
-	showMenu: function() {
-		if ( this.disabled )
-			return;
-
-		// Position it accordingly, relative to screen root (since
-		// it's attached to document.body)
-		this.menu.style.left = dojo.style.totalOffsetLeft(this.button) + "px";
-		this.menu.style.top = dojo.style.totalOffsetTop(this.button) + dojo.style.getOuterHeight(this.button) + "px";
-
-		// Display the menu; do this funky code below to stop the menu from extending
-		// all the way to the right edge of the screen.
-		// TODO: retest simple display="" to confirm that it doesn't work.
-		try {
-			this.menu.style.display="table";	// mozilla
-		} catch(e) {
-			this.menu.style.display="block";	// IE
-		}
-
-		// If someone clicks somewhere else on the screen then close the menu
-		dojo.event.connect(document.documentElement, "onmousedown", this, "onCanvasMouseDown");
-		
-		// When someone clicks the menu, after the menu handles the event,
-		// close the menu (be careful not to close the menu too early or else
-		// the menu will never receive the event.)
-		dojo.event.connect(this.menu, "onclick", this, "hideMenu");
-	},
-
-	hideMenu: function() {
-		this.menu.style.display = "none";
-		dojo.event.disconnect(document.documentElement, "onmousedown", this, "onCanvasMouseDown");
-		dojo.event.disconnect(this.menu, "onclick", this, "hideMenu");
-	}
-});
+/* TODO:
+ * - make the dropdown "smart" so it can't get cutoff on bottom of page, sides of page, etc.
+ */
+
+dojo.provide("dojo.widget.html.DropdownButton");
+
+dojo.require("dojo.event.*");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.uri.Uri");
+dojo.require("dojo.dom");
+dojo.require("dojo.style");
+dojo.require("dojo.html");
+
+dojo.widget.html.DropdownButton = function() {
+	// mix in the button properties
+	dojo.widget.DropdownButton.call(this);
+	dojo.widget.HtmlWidget.call(this);
+}
+
+dojo.inherits(dojo.widget.html.DropdownButton, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(dojo.widget.html.DropdownButton, {
+	
+	// In IE, event handlers on objects inside buttons don't work correctly, so
+	// we just set onClick on the button itself.
+	templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlDropDownButtonTemplate.html"),
+	templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlButtonTemplate.css"),
+
+	// attach points
+	button: null,
+	table: null,
+	labelCell: null,
+	borderCell: null,
+	arrowCell: null,
+	arrow: null,
+
+	fillInTemplate: function(args, frag) {
+		// input data (containing the anchor for the button itself, plus the
+		// thing to display when you push the down arrow)
+		var input = frag["dojo:"+this.widgetType.toLowerCase()]["nodeRef"];
+
+		// Recursively expand widgets inside of the <dojo:dropdownButton>
+		var parser = new dojo.xml.Parse();
+		var frag = parser.parseElement(input, null, true);
+		var ary = dojo.widget.getParser().createComponents(frag);
+
+		this.a = dojo.dom.getFirstChildElement(input);	// the button contents
+		this.menu = dojo.dom.getNextSiblingElement(this.a);	// the menu under the button
+		
+		this.disabled = dojo.html.hasClass(this.a, "disabled");
+		if( this.disabled ) {
+			dojo.html.addClass(this.button, "dojoDisabled");
+			this.domNode.setAttribute("disabled", "true");
+		}
+
+		dojo.html.disableSelection(this.a);
+		this.a.style["text-decoration"]="none";
+		this.labelCell.appendChild(this.a);
+
+		this.arrow.src =
+			dojo.uri.dojoUri("src/widget/templates/images/dropdownButtonsArrow" +
+			(this.disabled ? "-disabled" : "") + ".gif");
+
+		// Attach menu to body so that it appears above other buttons
+		this.menu.style.position="absolute";
+		this.menu.style.display="none";
+		this.menu.style["z-index"] = 99;
+		document.body.appendChild(this.menu);
+	},
+
+	postCreate: function() {
+		if ( dojo.render.html.ie ) {
+			// Compensate for IE's weird padding of button content, which seems to be relative
+			// to the length of the content
+			var contentWidth = dojo.style.getOuterWidth(this.table);
+			this.labelCell.style["left"] = "-" + (contentWidth / 10) + "px";
+			this.arrowCell.style["left"] = (contentWidth / 10) + "px";
+		}
+
+		// Make menu at least as wide as the button
+		var buttonWidth = dojo.style.getOuterWidth(this.button);
+		var menuWidth = dojo.style.getOuterWidth(this.menu);
+		if ( buttonWidth > menuWidth ) {
+			dojo.style.setOuterWidth(this.menu, buttonWidth);
+		}
+	},
+
+	// If someone clicks anywhere else on the screen (including another menu),
+	// then close this menu.
+	onCanvasMouseDown: function(e) {
+		if( !dojo.dom.isDescendantOf(e.target, this.button) &&
+			!dojo.dom.isDescendantOf(e.target, this.menu) ) {
+			this.hideMenu();
+		}
+	},
+
+	eventWasOverArrow: function(e) {
+		// want to use dojo.html.overElement() but also need to detect clicks
+		// on the area between the arrow and the edge of the button
+		var eventX = e.clientX;
+		var borderX = dojo.style.totalOffsetLeft(this.borderCell);
+		return (eventX > borderX );
+	},
+
+	onMouseOver: function(e) {
+		dojo.html.addClass(this.button, "dojoButtonHover");
+		dojo.html.removeClass(this.button, "dojoButtonNoHover");
+	},
+	
+	onMouseOut: function(e) {
+		dojo.html.removeClass(this.button, "dojoButtonHover");
+		dojo.html.addClass(this.button, "dojoButtonNoHover");
+	},
+
+	onClick: function(e) {
+		if ( this.eventWasOverArrow(e) ) {
+			this._onClickArrow();
+		} else {
+			this._onClickButton();
+		}
+	},
+
+	// Action when the user presses the button
+	_onClickButton: function(e) {
+		if ( this.a ) {
+			if ( this.a.click ) {
+				this.a.click();
+			} else if ( this.a.href ) {
+				location.href = this.a.href;
+			}
+		}
+	},
+
+	// Action when user presses the arrow
+	_onClickArrow: function() {
+		if ( this.menu.style.display == "none" ) {
+			this.showMenu();
+		} else {
+			this.hideMenu();
+		}
+	},
+	
+	showMenu: function() {
+		if ( this.disabled )
+			return;
+
+		// Position it accordingly, relative to screen root (since
+		// it's attached to document.body)
+		this.menu.style.left = dojo.style.totalOffsetLeft(this.button) + "px";
+		this.menu.style.top = dojo.style.totalOffsetTop(this.button) + dojo.style.getOuterHeight(this.button) + "px";
+
+		// Display the menu; do this funky code below to stop the menu from extending
+		// all the way to the right edge of the screen.
+		// TODO: retest simple display="" to confirm that it doesn't work.
+		try {
+			this.menu.style.display="table";	// mozilla
+		} catch(e) {
+			this.menu.style.display="block";	// IE
+		}
+
+		// If someone clicks somewhere else on the screen then close the menu
+		dojo.event.connect(document.documentElement, "onmousedown", this, "onCanvasMouseDown");
+		
+		// When someone clicks the menu, after the menu handles the event,
+		// close the menu (be careful not to close the menu too early or else
+		// the menu will never receive the event.)
+		dojo.event.connect(this.menu, "onclick", this, "hideMenu");
+	},
+
+	hideMenu: function() {
+		this.menu.style.display = "none";
+		dojo.event.disconnect(document.documentElement, "onmousedown", this, "onCanvasMouseDown");
+		dojo.event.disconnect(this.menu, "onclick", this, "hideMenu");
+	}
+});

Modified: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/GoogleMap.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/GoogleMap.js?rev=413306&r1=413305&r2=413306&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/GoogleMap.js (original)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/GoogleMap.js Sat Jun 10 07:27:44 2006
@@ -8,191 +8,191 @@
 		http://dojotoolkit.org/community/licensing.shtml
 */
 
-dojo.provide("dojo.widget.html.GoogleMap");
-dojo.require("dojo.event.*");
-dojo.require("dojo.html");
-dojo.require("dojo.math");
-dojo.require("dojo.uri.Uri");
-dojo.require("dojo.widget.HtmlWidget");
-dojo.require("dojo.widget.GoogleMap");
-
-(function(){
-	var gkey = djConfig["gMapKey"]||djConfig["googleMapKey"];
-
-	//	the Google API key mechanism sucks.  We're hardcoding here for love and affection but I don't like it.
-	var uri=new dojo.uri.Uri(window.location.href);
-	if(uri.host=="www.dojotoolkit.org"){
-		gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hRqjp7ri2mNiOEYqetD3xnFHpt5rBSjszDd1sdufPyQKUTyCf_YxoIxvw";
-	}
-	else if(uri.host=="blog.dojotoolkit.org"){
-		gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hSkep6Av1xaMhVn3yCLkorJeXeLARQ6fammI_P3qSGleTJhoI5_1JmP_Q";
-	}
-	else if(uri.host=="archive.dojotoolkit.org"){
-		gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hTaQpDt0dyGLIHbXMPTzg1kWeAfwRTwZNyrUfbfxYE9yIvRivEjcXoDTg";
-	}
-	else if(uri.host=="dojotoolkit.org"){
-		gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hSaOaO_TgJ5c3mtQFnk5JO2zD5dZBRZk-ieqVs7BORREYNzAERmcJoEjQ";
-	}
-
-	if(!dojo.hostenv.post_load_){
-		var tag = "<scr"+"ipt src='http://maps.google.com/maps?file=api&amp;v=2&amp;key="+gkey+"'></scri"+"pt>";
-		if(!dj_global["GMap2"]){ // prevent multi-inclusion
-			document.write(tag);
-		}
-	}else{
-		dojo.debug("cannot initialize map system after the page has been loaded! Please either manually include the script block provided by Google in your page or require() the GoogleMap widget before onload has fired");
-	}
-})();
-
-dojo.widget.html.GoogleMap=function(){
-	dojo.widget.HtmlWidget.call(this);
-	dojo.widget.GoogleMap.call(this);
-
-	var gm=dojo.widget.GoogleMap;
-
-	this.map=null;
-	this.data=[];
-	this.datasrc="";
-	// FIXME: this is pehraps the stupidest way to specify this enum I can think of
-	this.controls=[gm.Controls.LargeMap,gm.Controls.Scale,gm.Controls.MapType];
-};
-dojo.inherits(dojo.widget.html.GoogleMap, dojo.widget.HtmlWidget);
-
-dojo.lang.extend(dojo.widget.html.GoogleMap, {
-	templatePath:null,
-	templateCssPath:null,
-
-	setControls:function(){
-		var c=dojo.widget.GoogleMap.Controls;
-		for(var i=0; i<this.controls.length; i++){
-			var type=this.controls[i];
-			switch(type){
-				case c.LargeMap:{
-					this.map.addControl(new GLargeMapControl());
-					break;
-				}
-				case c.SmallMap:{
-					this.map.addControl(new GSmallMapControl());
-					break;
-				}
-				case c.SmallZoom:{
-					this.map.addControl(new GSmallZoomControl());
-					break;
-				}
-				case c.Scale:{
-					this.map.addControl(new GScaleControl());
-					break;
-				}
-				case c.MapType:{
-					this.map.addControl(new GMapTypeControl());
-					break;
-				}
-				case c.Overview:{
-					this.map.addControl(new GOverviewMapControl());
-					break;
-				}
-				default:{
-					break;
-				}
-			}
-		}
-	},
-	
-	findCenter:function(bounds){
-		var clat=(bounds.getNorthEast().lat()+bounds.getSouthWest().lat())/2;
-		var clng=(bounds.getNorthEast().lng()+bounds.getSouthWest().lng())/2;
-		return (new GLatLng(clat,clng));
-	},
-
-	createPinpoint:function(pt,overlay){
-		var m=new GMarker(pt);
-		if(overlay){
-			GEvent.addListener(m,"click",function(){
-				m.openInfoWindowHtml("<div>"+overlay+"</div>");
-			});
-		}
-		return m;
-	},
-
-	parse:function(table){
-		this.data=[];
-
-		//	get the column indices
-		var h=table.getElementsByTagName("thead")[0];
-		if(!h){
-			return;
-		}
-
-		var a=[];
-		var cols=h.getElementsByTagName("td");
-		if(cols.length==0){
-			cols=h.getElementsByTagName("th");
-		}
-		for(var i=0; i<cols.length; i++){
-			var c=cols[i].innerHTML.toLowerCase();
-			if(c=="long") c="lng";
-			a.push(c);
-		}
-		
-		//	parse the data
-		var b=table.getElementsByTagName("tbody")[0];
-		if(!b){
-			return;
-		}
-		for(var i=0; i<b.childNodes.length; i++){
-			if(!(b.childNodes[i].nodeName&&b.childNodes[i].nodeName.toLowerCase()=="tr")){
-				continue;
-			}
-			var cells=b.childNodes[i].getElementsByTagName("td");
-			var o={};
-			for(var j=0; j<a.length; j++){
-				var col=a[j];
-				if(col=="lat"||col=="lng"){
-					o[col]=parseFloat(cells[j].innerHTML);					
-				}else{
-					o[col]=cells[j].innerHTML;
-				}
-			}
-			this.data.push(o);
-		}
-	},
-	render:function(){
-		var bounds=new GLatLngBounds();
-		var d=this.data;
-		var pts=[];
-		for(var i=0; i<d.length; i++){
-			bounds.extend(new GLatLng(d[i].lat,d[i].lng));
-		}
-
-		this.map.setCenter(this.findCenter(bounds), this.map.getBoundsZoomLevel(bounds));
-
-		for(var i=0; i<this.data.length; i++){
-			var p=new GLatLng(this.data[i].lat,this.data[i].lng);
-			var d=this.data[i].description||null;
-			var m=this.createPinpoint(p,d);
-			this.map.addOverlay(m);
-		}
-	},
-	
-
-	initialize:function(args, frag){
-		if(!GMap2){
-			dojo.raise("dojo.widget.GoogleMap: The Google Map script must be included (with a proper API key) in order to use this widget.");
-		}
-		if(this.datasrc){
-			this.parse(dojo.byId(this.datasrc));
-		}
-		else if(this.domNode.getElementsByTagName("table")[0]){
-			this.parse(this.domNode.getElementsByTagName("table")[0]);
-		}
-	},
-	postCreate:function(){
-		//	clean the domNode before creating the map.
-		while(this.domNode.childNodes.length>0){
-			this.domNode.removeChild(this.domNode.childNodes[0]);
-		}
-		this.map=new GMap2(this.domNode);
-		this.render();
-		this.setControls();
-	}
+dojo.provide("dojo.widget.html.GoogleMap");
+dojo.require("dojo.event.*");
+dojo.require("dojo.html");
+dojo.require("dojo.math");
+dojo.require("dojo.uri.Uri");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.GoogleMap");
+
+(function(){
+	var gkey = djConfig["gMapKey"]||djConfig["googleMapKey"];
+
+	//	the Google API key mechanism sucks.  We're hardcoding here for love and affection but I don't like it.
+	var uri=new dojo.uri.Uri(window.location.href);
+	if(uri.host=="www.dojotoolkit.org"){
+		gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hRqjp7ri2mNiOEYqetD3xnFHpt5rBSjszDd1sdufPyQKUTyCf_YxoIxvw";
+	}
+	else if(uri.host=="blog.dojotoolkit.org"){
+		gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hSkep6Av1xaMhVn3yCLkorJeXeLARQ6fammI_P3qSGleTJhoI5_1JmP_Q";
+	}
+	else if(uri.host=="archive.dojotoolkit.org"){
+		gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hTaQpDt0dyGLIHbXMPTzg1kWeAfwRTwZNyrUfbfxYE9yIvRivEjcXoDTg";
+	}
+	else if(uri.host=="dojotoolkit.org"){
+		gkey="ABQIAAAACUNdgv_7FGOmUslbm9l6_hSaOaO_TgJ5c3mtQFnk5JO2zD5dZBRZk-ieqVs7BORREYNzAERmcJoEjQ";
+	}
+
+	if(!dojo.hostenv.post_load_){
+		var tag = "<scr"+"ipt src='http://maps.google.com/maps?file=api&amp;v=2&amp;key="+gkey+"'></scri"+"pt>";
+		if(!dj_global["GMap2"]){ // prevent multi-inclusion
+			document.write(tag);
+		}
+	}else{
+		dojo.debug("cannot initialize map system after the page has been loaded! Please either manually include the script block provided by Google in your page or require() the GoogleMap widget before onload has fired");
+	}
+})();
+
+dojo.widget.html.GoogleMap=function(){
+	dojo.widget.HtmlWidget.call(this);
+	dojo.widget.GoogleMap.call(this);
+
+	var gm=dojo.widget.GoogleMap;
+
+	this.map=null;
+	this.data=[];
+	this.datasrc="";
+	// FIXME: this is pehraps the stupidest way to specify this enum I can think of
+	this.controls=[gm.Controls.LargeMap,gm.Controls.Scale,gm.Controls.MapType];
+};
+dojo.inherits(dojo.widget.html.GoogleMap, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(dojo.widget.html.GoogleMap, {
+	templatePath:null,
+	templateCssPath:null,
+
+	setControls:function(){
+		var c=dojo.widget.GoogleMap.Controls;
+		for(var i=0; i<this.controls.length; i++){
+			var type=this.controls[i];
+			switch(type){
+				case c.LargeMap:{
+					this.map.addControl(new GLargeMapControl());
+					break;
+				}
+				case c.SmallMap:{
+					this.map.addControl(new GSmallMapControl());
+					break;
+				}
+				case c.SmallZoom:{
+					this.map.addControl(new GSmallZoomControl());
+					break;
+				}
+				case c.Scale:{
+					this.map.addControl(new GScaleControl());
+					break;
+				}
+				case c.MapType:{
+					this.map.addControl(new GMapTypeControl());
+					break;
+				}
+				case c.Overview:{
+					this.map.addControl(new GOverviewMapControl());
+					break;
+				}
+				default:{
+					break;
+				}
+			}
+		}
+	},
+	
+	findCenter:function(bounds){
+		var clat=(bounds.getNorthEast().lat()+bounds.getSouthWest().lat())/2;
+		var clng=(bounds.getNorthEast().lng()+bounds.getSouthWest().lng())/2;
+		return (new GLatLng(clat,clng));
+	},
+
+	createPinpoint:function(pt,overlay){
+		var m=new GMarker(pt);
+		if(overlay){
+			GEvent.addListener(m,"click",function(){
+				m.openInfoWindowHtml("<div>"+overlay+"</div>");
+			});
+		}
+		return m;
+	},
+
+	parse:function(table){
+		this.data=[];
+
+		//	get the column indices
+		var h=table.getElementsByTagName("thead")[0];
+		if(!h){
+			return;
+		}
+
+		var a=[];
+		var cols=h.getElementsByTagName("td");
+		if(cols.length==0){
+			cols=h.getElementsByTagName("th");
+		}
+		for(var i=0; i<cols.length; i++){
+			var c=cols[i].innerHTML.toLowerCase();
+			if(c=="long") c="lng";
+			a.push(c);
+		}
+		
+		//	parse the data
+		var b=table.getElementsByTagName("tbody")[0];
+		if(!b){
+			return;
+		}
+		for(var i=0; i<b.childNodes.length; i++){
+			if(!(b.childNodes[i].nodeName&&b.childNodes[i].nodeName.toLowerCase()=="tr")){
+				continue;
+			}
+			var cells=b.childNodes[i].getElementsByTagName("td");
+			var o={};
+			for(var j=0; j<a.length; j++){
+				var col=a[j];
+				if(col=="lat"||col=="lng"){
+					o[col]=parseFloat(cells[j].innerHTML);					
+				}else{
+					o[col]=cells[j].innerHTML;
+				}
+			}
+			this.data.push(o);
+		}
+	},
+	render:function(){
+		var bounds=new GLatLngBounds();
+		var d=this.data;
+		var pts=[];
+		for(var i=0; i<d.length; i++){
+			bounds.extend(new GLatLng(d[i].lat,d[i].lng));
+		}
+
+		this.map.setCenter(this.findCenter(bounds), this.map.getBoundsZoomLevel(bounds));
+
+		for(var i=0; i<this.data.length; i++){
+			var p=new GLatLng(this.data[i].lat,this.data[i].lng);
+			var d=this.data[i].description||null;
+			var m=this.createPinpoint(p,d);
+			this.map.addOverlay(m);
+		}
+	},
+	
+
+	initialize:function(args, frag){
+		if(!GMap2){
+			dojo.raise("dojo.widget.GoogleMap: The Google Map script must be included (with a proper API key) in order to use this widget.");
+		}
+		if(this.datasrc){
+			this.parse(dojo.byId(this.datasrc));
+		}
+		else if(this.domNode.getElementsByTagName("table")[0]){
+			this.parse(this.domNode.getElementsByTagName("table")[0]);
+		}
+	},
+	postCreate:function(){
+		//	clean the domNode before creating the map.
+		while(this.domNode.childNodes.length>0){
+			this.domNode.removeChild(this.domNode.childNodes[0]);
+		}
+		this.map=new GMap2(this.domNode);
+		this.render();
+		this.setControls();
+	}
 });

Modified: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/LinkPane.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/LinkPane.js?rev=413306&r1=413305&r2=413306&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/LinkPane.js (original)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/LinkPane.js Sat Jun 10 07:27:44 2006
@@ -8,47 +8,47 @@
 		http://dojotoolkit.org/community/licensing.shtml
 */
 
-dojo.provide("dojo.widget.LinkPane");
-dojo.provide("dojo.widget.html.LinkPane");
-
-//
-// a div that loads from a URL.  (Similar to an iframe, but
-// it's in the same environment as the main window)
-//
-
-dojo.require("dojo.widget.LinkPane");
-dojo.require("dojo.widget.*");
-dojo.require("dojo.event.*");
-dojo.require("dojo.io.*");
-dojo.require("dojo.widget.ContentPane");
-dojo.require("dojo.html");
-dojo.require("dojo.style");
-dojo.require("dojo.dom");
-dojo.require("dojo.string");
-
-
-dojo.widget.html.LinkPane = function(){
-	dojo.widget.html.ContentPane.call(this);
-}
-
-dojo.inherits(dojo.widget.html.LinkPane, dojo.widget.html.ContentPane);
-
-dojo.lang.extend(dojo.widget.html.LinkPane, {
-	widgetType: "LinkPane",
-
-	// I'm using a template because the user may specify the input as
-	// <a href="foo.html">label</a>, in which case we need to get rid of the
-	// <a> because we don't want a link.
-	templateString: '<div class="dojoLinkPane"></div>',
-
-	fillInTemplate: function(args, frag){
-		var source = this.getFragNodeRef(frag);
-
-		// If user has specified node contents, they become the label
-		// (the link must be plain text)
-		this.label += source.innerHTML;
-
-		var source = this.getFragNodeRef(frag);
-		dojo.html.copyStyle(this.domNode, source);
-	}
+dojo.provide("dojo.widget.LinkPane");
+dojo.provide("dojo.widget.html.LinkPane");
+
+//
+// a div that loads from a URL.  (Similar to an iframe, but
+// it's in the same environment as the main window)
+//
+
+dojo.require("dojo.widget.LinkPane");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.event.*");
+dojo.require("dojo.io.*");
+dojo.require("dojo.widget.ContentPane");
+dojo.require("dojo.html");
+dojo.require("dojo.style");
+dojo.require("dojo.dom");
+dojo.require("dojo.string");
+
+
+dojo.widget.html.LinkPane = function(){
+	dojo.widget.html.ContentPane.call(this);
+}
+
+dojo.inherits(dojo.widget.html.LinkPane, dojo.widget.html.ContentPane);
+
+dojo.lang.extend(dojo.widget.html.LinkPane, {
+	widgetType: "LinkPane",
+
+	// I'm using a template because the user may specify the input as
+	// <a href="foo.html">label</a>, in which case we need to get rid of the
+	// <a> because we don't want a link.
+	templateString: '<div class="dojoLinkPane"></div>',
+
+	fillInTemplate: function(args, frag){
+		var source = this.getFragNodeRef(frag);
+
+		// If user has specified node contents, they become the label
+		// (the link must be plain text)
+		this.label += source.innerHTML;
+
+		var source = this.getFragNodeRef(frag);
+		dojo.html.copyStyle(this.domNode, source);
+	}
 });

Added: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Menu.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Menu.js?rev=413306&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Menu.js (added)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Menu.js Sat Jun 10 07:27:44 2006
@@ -0,0 +1,50 @@
+/*
+	Copyright (c) 2004-2006, 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.widget.Menu");
+dojo.provide("dojo.widget.html.Menu");
+
+/* HtmlMenu
+ ***********/
+ 
+dojo.widget.html.Menu = function(){
+	dojo.widget.html.Menu.superclass.constructor.call(this);
+	this.items = [];
+}
+dojo.inherits(dojo.widget.html.Menu, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(dojo.widget.html.Menu, {
+	widgetType: "Menu",
+	isContainer: true,
+
+	// copy children widgets output directly to parent (this node), to avoid
+	// errors trying to insert an <li> under a <div>
+	snarfChildDomOutput: true,
+
+	templateString: '<ul></ul>',
+	templateCssPath: dojo.uri.dojoUri("src/widget/templates/Menu.css"),
+	
+	fillInTemplate: function (args, frag){
+		//dojo.widget.HtmlMenu.superclass.fillInTemplate.apply(this, arguments);
+		this.domNode.className = "dojoMenu";
+	},
+	
+ 
+	_register: function (item ) {
+		dojo.event.connect(item, "onSelect", this, "onSelect");
+		this.items.push(item);
+	},
+
+	push: function (item) {
+		this.domNode.appendChild(item.domNode);
+		this._register(item);
+	}
+
+});

Propchange: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Menu.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/MenuItem.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/MenuItem.js?rev=413306&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/MenuItem.js (added)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/MenuItem.js Sat Jun 10 07:27:44 2006
@@ -0,0 +1,60 @@
+/*
+	Copyright (c) 2004-2006, 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.widget.html.MenuItem");
+
+/* HtmlMenuItem
+ ***************/
+
+dojo.widget.html.MenuItem = function(){
+	dojo.widget.HtmlWidget.call(this);
+}
+dojo.inherits(dojo.widget.html.MenuItem, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(dojo.widget.html.MenuItem, {
+	widgetType: "MenuItem",
+	templateString: '<li class="dojoMenuItem" dojoAttachEvent="onMouseOver; onMouseOut; onMouseDown; onMouseUp; onClick;"></li>',
+	title: "",
+
+	fillInTemplate: function(args, frag){
+		dojo.html.disableSelection(this.domNode);
+
+		if(!dojo.string.isBlank(this.title)){
+			this.domNode.appendChild(document.createTextNode(this.title));
+		}else{
+			this.domNode.appendChild(frag["dojo:"+this.widgetType.toLowerCase()]["nodeRef"]);
+		}
+	},
+	
+	onMouseOver: function(e){
+		dojo.html.addClass(this.domNode, "dojoMenuItemHover");
+	},
+	
+	onMouseOut: function(e){
+		dojo.html.removeClass(this.domNode, "dojoMenuItemHover");
+	},
+	
+	onClick: function(e){ this.onSelect(this, e); },
+	onMouseDown: function(e){},
+	onMouseUp: function(e){},
+	
+	// By default, when I am clicked, click the item inside of me
+	onSelect: function (item, e) {
+		var child = dojo.dom.getFirstChildElement(this.domNode);
+		if(child){
+			if(child.click){
+				child.click();
+			}else if(child.href){
+				location.href = child.href;
+			}
+		}
+	}
+});
+

Propchange: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/MenuItem.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/MonthlyCalendar.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/MonthlyCalendar.js?rev=413306&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/MonthlyCalendar.js (added)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/MonthlyCalendar.js Sat Jun 10 07:27:44 2006
@@ -0,0 +1,134 @@
+/*
+	Copyright (c) 2004-2006, 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.widget.html.MonthlyCalendar");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.html.DatePicker");
+dojo.require("dojo.widget.MonthlyCalendar");
+//dojo.require("dojo.widget.MonthlyCalendar.util");
+dojo.require("dojo.event.*");
+dojo.require("dojo.html");
+
+dojo.widget.html.MonthlyCalendar= function(){
+	dojo.widget.MonthlyCalendar.call(this);
+	//dojo.widget.html.DatePicker.call(this);
+	this.widgetType = "MonthlyCalendar";
+	this.templatePath =  dojo.uri.dojoUri("src/widget/templates/HtmlMonthlyCalendar.html");
+	this.templateCssPath = dojo.uri.dojoUri("src/widget/templates/HtmlMonthlyCalendar.css");
+
+	this.iCalendars = [];
+}
+
+dojo.inherits(dojo.widget.html.MonthlyCalendar, dojo.widget.html.DatePicker);
+
+dojo.lang.extend(dojo.widget.html.MonthlyCalendar, {
+	cache: function() {
+	},
+
+	addCalendar: function(/* dojo.iCalendar */ cal) {
+		dojo.debug("Adding Calendar");
+		this.iCalendars.push(cal);
+		dojo.debug("Starting init");
+		this.initUI()
+		dojo.debug("done init");
+	},
+
+	createDayContents: function(node,mydate) {
+		dojo.dom.removeChildren(node);
+		node.appendChild(document.createTextNode(mydate.getDate()));	
+			for(var x=0; x<this.iCalendars.length; x++) {
+				var evts = this.iCalendars[x].getEvents(mydate);
+				if ((dojo.lang.isArray(evts)) && (evts.length>0)) {
+				for(var y=0;y<evts.length;y++) {
+					var el = document.createElement("div");
+					dojo.html.addClass(el, "dojoMonthlyCalendarEvent");          
+					el.appendChild(document.createTextNode(evts[y].summary.value));
+					el.width = dojo.style.getContentWidth(node);
+					node.appendChild(el);
+				}
+			}
+		}
+	},
+
+	initUI: function() {
+		this.selectedIsUsed = false;
+		this.currentIsUsed = false;
+		var currentClassName = "";
+		var previousDate = new Date();
+		var calendarNodes = this.calendarDatesContainerNode.getElementsByTagName("td");
+		var currentCalendarNode;
+		// set hours of date such that there is no chance of rounding error due to 
+		// time change in local time zones
+		previousDate.setHours(8);
+		var nextDate = new Date(this.firstSaturday.year, this.firstSaturday.month, this.firstSaturday.date, 8);
+		var lastDay = new Date(this.firstSaturday.year, this.firstSaturday.month, this.firstSaturday.date + 42, 8);
+		
+		if (this.iCalendars.length > 0) {
+			for (var x=0; x<this.iCalendars.length;x++) {
+				this.iCalendars[x].preComputeRecurringEvents(lastDay);
+			}
+		}
+
+		if(this.firstSaturday.date < 7) {
+			// this means there are days to show from the previous month
+			var dayInWeek = 6;
+			for (var i=this.firstSaturday.date; i>0; i--) {
+				currentCalendarNode = calendarNodes.item(dayInWeek);
+				this.createDayContents(currentCalendarNode, nextDate);
+				
+				dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "current"));
+				dayInWeek--;
+				previousDate = nextDate;
+				nextDate = this.incrementDate(nextDate, false);
+			}
+			for(var i=dayInWeek; i>-1; i--) {
+				currentCalendarNode = calendarNodes.item(i);
+
+				this.createDayContents(currentCalendarNode, nextDate);
+
+				dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "previous"));
+				previousDate = nextDate;
+				nextDate = this.incrementDate(nextDate, false);				
+			}
+		} else {
+			nextDate.setDate(1);
+			for(var i=0; i<7; i++) {
+				currentCalendarNode = calendarNodes.item(i);
+				this.createDayContents(currentCalendarNode, nextDate);
+				dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "current"));
+				previousDate = nextDate;
+				nextDate = this.incrementDate(nextDate, true);				
+			}
+		}
+		previousDate.setDate(this.firstSaturday.date);
+		previousDate.setMonth(this.firstSaturday.month);
+		previousDate.setFullYear(this.firstSaturday.year);
+		nextDate = this.incrementDate(previousDate, true);
+		var count = 7;
+		currentCalendarNode = calendarNodes.item(count);
+		while((nextDate.getMonth() == previousDate.getMonth()) && (count<42)) {
+			this.createDayContents(currentCalendarNode, nextDate);
+			dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "current"));
+			currentCalendarNode = calendarNodes.item(++count);
+			previousDate = nextDate;
+			nextDate = this.incrementDate(nextDate, true);
+		}
+		
+		while(count < 42) {
+			this.createDayContents(currentCalendarNode, nextDate);
+			dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "next"));
+			currentCalendarNode = calendarNodes.item(++count);
+			previousDate = nextDate;
+			nextDate = this.incrementDate(nextDate, true);
+		}
+		this.setMonthLabel(this.firstSaturday.month);
+		this.setYearLabels(this.firstSaturday.year);
+	}	
+});

Propchange: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/MonthlyCalendar.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Show.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Show.js?rev=413306&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Show.js (added)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Show.js Sat Jun 10 07:27:44 2006
@@ -0,0 +1,177 @@
+/*
+	Copyright (c) 2004-2006, 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.widget.html.Show");
+
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.Show");
+dojo.require("dojo.uri.Uri");
+dojo.require("dojo.event");
+dojo.require("dojo.animation.Animation");
+dojo.require("dojo.math.curves");
+dojo.require("dojo.html");
+dojo.require("dojo.lang.common");
+dojo.require("dojo.lang.func");
+
+dojo.widget.defineWidget(
+	"dojo.widget.html.Show",
+	dojo.widget.HtmlWidget,
+	null,
+	"html",
+	function(){
+		dojo.widget.Show.call(this);
+	}
+);
+dojo.lang.extend(dojo.widget.html.Show, dojo.widget.Show.prototype);
+dojo.lang.extend(dojo.widget.html.Show, {
+	body: null,
+	nav: null,
+	hider: null,
+	select: null,
+	option: null,
+	inNav: false,
+	templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlShow.html"),
+	templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlShow.css"),
+	fillInTemplate: function(args, frag){
+		var source = this.getFragNodeRef(frag);
+		this.sourceNode = document.body.appendChild(source.cloneNode(true));
+		for(var i = 0, child; child = this.sourceNode.childNodes[i]; i++){
+			if(child.tagName && child.getAttribute("dojotype").toLowerCase() == "showslide"){
+				child.className = "dojoShowPrintSlide";
+				child.innerHTML = "<h1>" + child.title + "</h1>" + child.innerHTML;
+			}
+		}
+		this.sourceNode.className = "dojoShowPrint";
+		this.sourceNode.style.display = "none";
+		
+		dojo.event.connect(document, "onclick", this, "gotoSlideByEvent");
+		dojo.event.connect(document, "onkeypress", this, "gotoSlideByEvent");
+		dojo.event.connect(window, "onresize", this, "resizeWindow");
+		dojo.event.connect(this.nav, "onmousemove", this, "popUpNav");
+	},
+	postCreate: function(){		
+		this._slides = [];
+		for(var i = 0, child; child = this.children[i]; i++){
+			if(child.widgetType == "ShowSlide"){
+				this._slides.push(child);
+				this.option.text = child.title;
+				this.option.parentNode.insertBefore(this.option.cloneNode(true), this.option);
+			}
+		}
+		this.option.parentNode.removeChild(this.option);
+
+		document.body.style.display = "block";
+		this.resizeWindow();
+		this.gotoSlide(0);
+	},
+	gotoSlide: function(/*int*/ slide){
+		if(slide == this._slide){
+			return;
+		}
+
+		if(!this._slides[slide]){
+			// slide: string
+			for(var i = 0, child; child = this._slides[i]; i++){
+				if(child.title == slide){
+					slide = i;
+					break;
+				}
+			}
+		}
+		
+		if(!this._slides[slide]){
+			return;
+		}
+		
+		if(this._slide != -1){
+			while(this._slides[this._slide].previousAction()){}
+		}
+		
+		this._slide = slide;
+		this.select.selectedIndex = slide;
+		while(this.contentNode.hasChildNodes()){ this.contentNode.removeChild(this.contentNode.firstChild); }
+		this.contentNode.appendChild(this._slides[slide].domNode);
+	},
+	gotoSlideByEvent: function(/*Event*/ event){
+		var node = event.target;
+		var type = event.type;
+		if(type == "click"){
+			if(node.tagName == "OPTION"){
+				this.gotoSlide(node.index);
+			}else if(node.tagName == "SELECT"){
+				this.gotoSlide(node.selectedIndex);
+			}else if(node.tagName != "A"){
+				this.nextSlide(event);
+			}
+		}else if(type == "keypress"){
+			var key = event.keyCode;
+			var ch = event.charCode;
+			if(key == 63234 || key == 37){
+				this.previousSlide(event);
+			}else if(key == 63235 || key == 39 || ch == 32){
+				this.nextSlide(event);
+			}
+		}
+	},
+	nextSlide: function(/*Event?*/ event){
+		this.stopEvent(event);
+		return dojo.widget.Show.prototype.nextSlide.call(this, event);
+	},
+	previousSlide: function(/*Event?*/ event){
+		this.stopEvent(event);
+		return dojo.widget.Show.prototype.previousSlide.call(this, event);
+	},
+	stopEvent: function(/*Event*/ ev){
+		if(window.event){
+			ev.returnValue = false;
+			ev.cancelBubble = true;
+		}else{
+			ev.preventDefault();
+			ev.stopPropagation();
+		}
+	},
+	popUpNav: function(){
+		if(!this.inNav){
+			dojo.widget.Show.node = this.nav;
+			var anim = new dojo.animation.Animation(new dojo.math.curves.Line([5], [30]), 250, -1);
+			dojo.event.connect(anim, "onAnimate", function(e) {
+				dojo.widget.Show.node.style.height = e.x + "px";
+			});
+			dojo.event.connect(anim, "onEnd", function(e) {
+				dojo.widget.Show.node.style.height = e.x + "px";
+			});
+			anim.play(true);
+		}
+		clearTimeout(this.inNav);
+		this.inNav = setTimeout(dojo.lang.hitch(this, "hideNav"), 2000);
+	},
+	hideNav: function(){
+		clearTimeout(this.inNav);
+		this.inNav = false;
+
+		dojo.widget.Show.node = this.nav;
+		var anim = new dojo.animation.Animation(new dojo.math.curves.Line([30], [5]), 250, 1);
+		dojo.event.connect(anim, "onAnimate", function(e) {
+			dojo.widget.Show.node.style.height = e.x + "px";
+		});
+		dojo.event.connect(anim, "onEnd", function(e) {
+			dojo.widget.Show.node.style.height = e.x + "px";
+		});
+		anim.play(true);
+	},
+	resizeWindow: function(/*Event*/ ev){
+		document.body.style.height = "auto";
+		var h = Math.max(
+			document.documentElement.scrollHeight || document.body.scrollHeight,
+			dojo.html.getViewportHeight());
+		document.body.style.height = h + "px";
+	}
+});

Propchange: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Show.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/ShowAction.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/ShowAction.js?rev=413306&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/ShowAction.js (added)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/ShowAction.js Sat Jun 10 07:27:44 2006
@@ -0,0 +1,28 @@
+/*
+	Copyright (c) 2004-2006, 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.widget.html.ShowAction");
+
+dojo.require("dojo.widget.ShowAction");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.lang.common");
+
+dojo.widget.defineWidget(
+	"dojo.widget.html.ShowAction",
+	dojo.widget.HtmlWidget,
+	null,
+	"html",
+	function(){
+		dojo.widget.ShowAction.call(this);
+	}
+);
+dojo.lang.extend(dojo.widget.html.ShowAction, dojo.widget.ShowAction.prototype);
+dojo.lang.extend(dojo.widget.html.ShowAction, {
+});

Propchange: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/ShowAction.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/ShowSlide.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/ShowSlide.js?rev=413306&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/ShowSlide.js (added)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/ShowSlide.js Sat Jun 10 07:27:44 2006
@@ -0,0 +1,183 @@
+/*
+	Copyright (c) 2004-2006, 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.widget.html.ShowSlide");
+
+dojo.require("dojo.widget.*");
+dojo.require("dojo.lang.common");
+dojo.require("dojo.widget.ShowSlide");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.lfx.html");
+dojo.require("dojo.animation.Animation");
+dojo.require("dojo.graphics.color");
+
+dojo.widget.defineWidget(
+	"dojo.widget.html.ShowSlide",
+	dojo.widget.HtmlWidget,
+	null,
+	"html",
+	function(){
+		dojo.widget.ShowSlide.call(this);
+	}
+);
+dojo.lang.extend(dojo.widget.html.ShowSlide, dojo.widget.ShowSlide.prototype);
+dojo.lang.extend(dojo.widget.html.ShowSlide, {
+	htmlTitle: null,
+	templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlShowSlide.html"),
+	templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlShowSlide.css"),
+	fillInTemplate: function(){
+		this.htmlTitle.innerHTML = this.title;
+
+		this._components = {};
+		var nodes = this.containerNode.all ? this.containerNode.all : this.containerNode.getElementsByTagName('*');
+		for(var i = 0, node; node = nodes[i]; i++){
+			var as = node.getAttribute("as");
+			if(as){
+				if(!this._components[as]){
+					this._components[as] = [];
+				}
+				this._components[as].push(node);
+			}
+		}
+	},
+	postCreate: function(){
+		this._actions = [];
+		for(var i = 0, child; child = this.children[i]; i++){
+			if(child.widgetType == "ShowAction"){
+				this._actions.push(child);
+				var components = this._components[child.on];
+				for(var j = 0, component; component = components[j]; j++){
+					if(child.action && child.action != "remove"){
+						this.hideComponent(component);
+					}
+				}
+			}
+		}
+	},
+	previousAction: function(/*Event?*/ event){
+		this.stopEvent(event);
+
+		var action = this._actions[this._action];
+		if(!action){
+			return false;
+		}
+
+		var on = action.on;
+		while(action.on == on){
+			var components = this._components[on];
+			for(var i = 0, component; component = components[i]; i++){
+				if(action.action == "remove"){
+					if(component.style.display == "none"){
+						component.style.display = "";
+						component.style.visibility = "visible";
+						var exits = true;
+					}
+				}else if(action.action){
+					this.hideComponent(component);
+				}
+			}
+
+			--this._action;
+
+			if(exits){
+				return true;
+			}	
+
+			if(action.auto == "true"){
+				on = this._actions[this._action].on;
+			}
+
+			action = this._actions[this._action];
+			if(!action){
+				return false;
+			}
+		}
+		return true;
+	},
+	hideComponent: function(/*Node*/ component){
+		component.style.visibility = "hidden";
+		component.style.backgroundColor = "transparent";
+		var parent = component.parentNode;
+		if(parent.tagName == "LI"){
+			parent.oldType = parent.style.listStyleType;
+			parent.style.listStyleType = "none";
+		}
+	},
+	nextAction: function(/*Event?*/ event){
+		this.stopEvent(event);
+
+		if(!dojo.widget.ShowSlide.prototype.nextAction.call(this, event)){
+			return false;
+		}
+
+		var action = this._actions[this._action];
+		if(!action){
+			return false;
+		}
+		
+		var components = this._components[action.on];
+		for(var i = 0, component; component = components[i]; i++){
+			if(action.action){
+				var duration = action.duration || 1000;
+				if(action.action == "fade"){
+					dojo.style.setOpacity(component, 0);
+					dojo.lfx.html.fadeIn(component, duration).play(true);
+				}else if(action.action == "fly"){
+					var width = dojo.style.getMarginBoxWidth(component);
+					var position = dojo.style.getAbsolutePosition(component);
+					component.style.position = "relative";
+					component.style.left = -(width + position.x) + "px";
+					dojo.lfx.html.slideBy(component, [0, (width + position.x)], duration, -1, this.callWith).play(true);
+				}else if(action.action == "wipe"){
+					dojo.lfx.html.wipeIn(component, duration).play();
+				}else if(action.action == "color"){
+					var from = new dojo.graphics.color.Color(action.from).toRgb();
+					var to = new dojo.graphics.color.Color(action.to).toRgb();
+					var anim = new dojo.animation.Animation(new dojo.math.curves.Line(from, to), duration, 0);
+					node = component;
+					dojo.event.connect(anim, "onAnimate", function(e) {
+						node.style.color = "rgb(" + e.coordsAsInts().join(",") + ")";
+					});
+					anim.play(true);
+				}else if(action.action == "bgcolor"){
+					dojo.lfx.html.unhighlight(component, action.to, duration).play();
+				}else if(action.action == "remove"){
+					component.style.display = "none";
+				}
+				component.style.visibility = "visible";
+			}
+		}
+		
+		action = this._actions[this._action + 1];
+		if(action && action.auto == "true"){
+			this.nextAction();
+		}
+
+		return true;
+	},
+	callWith: function(/*Node*/ node){
+		var parent = node.parentNode;
+		if(parent.tagName == "LI"){
+			parent.style.listStyleType = parent.oldType;
+		}
+	},
+	stopEvent: function(/*Event*/ ev){
+		if(!ev){
+			return;
+		}
+		if(window.event){
+			ev.returnValue = false;
+			ev.cancelBubble = true;
+		}else{
+			ev.preventDefault();
+			ev.stopPropagation();
+		}
+	}
+});

Propchange: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/ShowSlide.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TaskBar.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TaskBar.js?rev=413306&r1=413305&r2=413306&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TaskBar.js (original)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TaskBar.js Sat Jun 10 07:27:44 2006
@@ -8,78 +8,78 @@
 		http://dojotoolkit.org/community/licensing.shtml
 */
 
-dojo.provide("dojo.widget.html.TaskBar");
-dojo.provide("dojo.widget.html.TaskBarItem");
-
-dojo.require("dojo.widget.*");
-dojo.require("dojo.widget.FloatingPane");
-dojo.require("dojo.widget.HtmlWidget");
-dojo.require("dojo.event");
-
-// Icon associated w/a floating pane
-dojo.widget.html.TaskBarItem = function(){
-	dojo.widget.TaskBarItem.call(this);
-	dojo.widget.HtmlWidget.call(this);
-}
-dojo.inherits(dojo.widget.html.TaskBarItem, dojo.widget.HtmlWidget);
-
-dojo.lang.extend(dojo.widget.html.TaskBarItem, {
-	// constructor arguments
-	iconSrc: '',
-	caption: 'Untitled',
-	window: null,
-	templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlTaskBarItemTemplate.html"),
-	templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlTaskBar.css"),
-
-	fillInTemplate: function() {
-		if ( this.iconSrc != '' ) {
-			var img = document.createElement("img");
-			img.src = this.iconSrc;
-			this.domNode.appendChild(img);
-		}
-		this.domNode.appendChild(document.createTextNode(this.caption));
-		dojo.html.disableSelection(this.domNode);
-	},
-
-	postCreate: function() {
-		this.window=dojo.widget.getWidgetById(this.windowId);
-		this.window.explodeSrc = this.domNode;
-		dojo.event.connect(this.window, "destroy", this, "destroy")
-	},
-
-	onClick: function() {
-		this.window.show();
-	}
-});
-
-// Collection of widgets in a bar, like Windows task bar
-dojo.widget.html.TaskBar = function(){
-
-	dojo.widget.html.FloatingPane.call(this);
-	dojo.widget.TaskBar.call(this);
-	this._addChildStack = [];
-}
-
-dojo.inherits(dojo.widget.html.TaskBar, dojo.widget.html.FloatingPane);
-
-dojo.lang.extend(dojo.widget.html.TaskBar, {
-
-	resizable: false,
-	titleBarDisplay: "none",
-
-	addChild: function(child) {
-		if(!this.containerNode){ 
-			this._addChildStack.push(child);
-		}else if(this._addChildStack.length > 0){
-			var oarr = this._addChildStack;
-			this._addChildStack = [];
-			dojo.lang.forEach(oarr, this.addChild, this);
-		}
-		var tbi = dojo.widget.createWidget("TaskBarItem",
-			{	windowId: child.widgetId, 
-				caption: child.title, 
-				iconSrc: child.iconSrc
-			});
-		dojo.widget.html.TaskBar.superclass.addChild.call(this,tbi);
-	}
-});
+dojo.provide("dojo.widget.html.TaskBar");
+dojo.provide("dojo.widget.html.TaskBarItem");
+
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.FloatingPane");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.event");
+
+// Icon associated w/a floating pane
+dojo.widget.html.TaskBarItem = function(){
+	dojo.widget.TaskBarItem.call(this);
+	dojo.widget.HtmlWidget.call(this);
+}
+dojo.inherits(dojo.widget.html.TaskBarItem, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(dojo.widget.html.TaskBarItem, {
+	// constructor arguments
+	iconSrc: '',
+	caption: 'Untitled',
+	window: null,
+	templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlTaskBarItemTemplate.html"),
+	templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlTaskBar.css"),
+
+	fillInTemplate: function() {
+		if ( this.iconSrc != '' ) {
+			var img = document.createElement("img");
+			img.src = this.iconSrc;
+			this.domNode.appendChild(img);
+		}
+		this.domNode.appendChild(document.createTextNode(this.caption));
+		dojo.html.disableSelection(this.domNode);
+	},
+
+	postCreate: function() {
+		this.window=dojo.widget.getWidgetById(this.windowId);
+		this.window.explodeSrc = this.domNode;
+		dojo.event.connect(this.window, "destroy", this, "destroy")
+	},
+
+	onClick: function() {
+		this.window.show();
+	}
+});
+
+// Collection of widgets in a bar, like Windows task bar
+dojo.widget.html.TaskBar = function(){
+
+	dojo.widget.html.FloatingPane.call(this);
+	dojo.widget.TaskBar.call(this);
+	this._addChildStack = [];
+}
+
+dojo.inherits(dojo.widget.html.TaskBar, dojo.widget.html.FloatingPane);
+
+dojo.lang.extend(dojo.widget.html.TaskBar, {
+
+	resizable: false,
+	titleBarDisplay: "none",
+
+	addChild: function(child) {
+		if(!this.containerNode){ 
+			this._addChildStack.push(child);
+		}else if(this._addChildStack.length > 0){
+			var oarr = this._addChildStack;
+			this._addChildStack = [];
+			dojo.lang.forEach(oarr, this.addChild, this);
+		}
+		var tbi = dojo.widget.createWidget("TaskBarItem",
+			{	windowId: child.widgetId, 
+				caption: child.title, 
+				iconSrc: child.iconSrc
+			});
+		dojo.widget.html.TaskBar.superclass.addChild.call(this,tbi);
+	}
+});

Added: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TimePicker.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TimePicker.js?rev=413306&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TimePicker.js (added)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TimePicker.js Sat Jun 10 07:27:44 2006
@@ -0,0 +1,249 @@
+/*
+	Copyright (c) 2004-2006, 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.widget.html.TimePicker");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.TimePicker");
+dojo.require("dojo.event.*");
+dojo.require("dojo.date");
+dojo.require("dojo.html");
+
+dojo.widget.html.TimePicker = function(){
+	dojo.widget.TimePicker.call(this);
+	dojo.widget.HtmlWidget.call(this);
+
+
+	var _this = this;
+	// selected time, JS Date object
+	this.time = "";
+	// set following flag to true if a default time should be set
+	this.useDefaultTime = false;
+	// set the following to true to set default minutes to current time, false to // use zero
+	this.useDefaultMinutes = false;
+	// rfc 3339 date
+	this.storedTime = "";
+	// time currently selected in the UI, stored in hours, minutes, seconds in the format that will be actually displayed
+	this.currentTime = {};
+	this.classNames = {
+		selectedTime: "selectedItem"
+	}
+	this.any = "any"
+	// dom node indecies for selected hour, minute, amPm, and "any time option"
+	this.selectedTime = {
+		hour: "",
+		minute: "",
+		amPm: "",
+		anyTime: false
+	}
+
+	// minutes are ordered as follows: ["12", "6", "1", "7", "2", "8", "3", "9", "4", "10", "5", "11"]
+	this.hourIndexMap = ["", 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 11, 0];
+	// minutes are ordered as follows: ["00", "30", "05", "35", "10", "40", "15", "45", "20", "50", "25", "55"]
+	this.minuteIndexMap = [0, 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 11];
+
+	this.templatePath =  dojo.uri.dojoUri("src/widget/templates/HtmlTimePicker.html");
+	this.templateCssPath = dojo.uri.dojoUri("src/widget/templates/HtmlTimePicker.css");
+
+	this.fillInTemplate = function(){
+		this.initData();
+		this.initUI();
+	}
+
+	this.initData = function() {
+		// FIXME: doesn't currently validate the time before trying to set it
+		// Determine the date/time from stored info, or by default don't 
+		//  have a set time
+		// FIXME: should normalize against whitespace on storedTime... for now 
+		// just a lame hack
+		if(this.storedTime.indexOf("T")!=-1 && this.storedTime.split("T")[1] && this.storedTime!=" " && this.storedTime.split("T")[1]!="any") {
+			this.time = dojo.widget.TimePicker.util.fromRfcDateTime(this.storedTime, this.useDefaultMinutes, this.selectedTime.anyTime);
+		} else if (this.useDefaultTime) {
+			this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", this.useDefaultMinutes, this.selectedTime.anyTime);
+		} else {
+			this.selectedTime.anyTime = true;
+			this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", 0, 1);
+		}
+	}
+
+	this.initUI = function() {
+		// set UI to match the currently selected time
+		if(!this.selectedTime.anyTime && this.time) {
+			var amPmHour = dojo.widget.TimePicker.util.toAmPmHour(this.time.getHours());
+			var hour = amPmHour[0];
+			var isAm = amPmHour[1];
+			var minute = this.time.getMinutes();
+			var minuteIndex = parseInt(minute/5);
+			this.onSetSelectedHour(this.hourIndexMap[hour]);
+			this.onSetSelectedMinute(this.minuteIndexMap[minuteIndex]);
+			this.onSetSelectedAmPm(isAm);
+		} else {
+			this.onSetSelectedAnyTime();
+		}
+	}
+
+	this.setDateTime = function(rfcDate) {
+		this.storedTime = rfcDate;
+	}
+	
+	this.onClearSelectedHour = function(evt) {
+		this.clearSelectedHour();
+	}
+
+	this.onClearSelectedMinute = function(evt) {
+		this.clearSelectedMinute();
+	}
+
+	this.onClearSelectedAmPm = function(evt) {
+		this.clearSelectedAmPm();
+	}
+
+	this.onClearSelectedAnyTime = function(evt) {
+		this.clearSelectedAnyTime();
+		if(this.selectedTime.anyTime) {
+			this.selectedTime.anyTime = false;
+			this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", this.useDefaultMinutes);
+			this.initUI();
+		}
+	}
+
+	this.clearSelectedHour = function() {
+		var hourNodes = this.hourContainerNode.getElementsByTagName("td");
+		for (var i=0; i<hourNodes.length; i++) {
+			dojo.html.setClass(hourNodes.item(i), "");
+		}
+	}
+
+	this.clearSelectedMinute = function() {
+		var minuteNodes = this.minuteContainerNode.getElementsByTagName("td");
+		for (var i=0; i<minuteNodes.length; i++) {
+			dojo.html.setClass(minuteNodes.item(i), "");
+		}
+	}
+
+	this.clearSelectedAmPm = function() {
+		var amPmNodes = this.amPmContainerNode.getElementsByTagName("td");
+		for (var i=0; i<amPmNodes.length; i++) {
+			dojo.html.setClass(amPmNodes.item(i), "");
+		}
+	}
+
+	this.clearSelectedAnyTime = function() {
+		dojo.html.setClass(this.anyTimeContainerNode, "anyTimeContainer");
+	}
+
+	this.onSetSelectedHour = function(evt) {
+		this.onClearSelectedAnyTime();
+		this.onClearSelectedHour();
+		this.setSelectedHour(evt);
+		this.onSetTime();
+	}
+
+	this.setSelectedHour = function(evt) {
+		if(evt && evt.target) {
+			dojo.html.setClass(evt.target, this.classNames.selectedTime);
+			this.selectedTime["hour"] = evt.target.innerHTML;
+		} else if (!isNaN(evt)) {
+			var hourNodes = this.hourContainerNode.getElementsByTagName("td");
+			if(hourNodes.item(evt)) {
+				dojo.html.setClass(hourNodes.item(evt), this.classNames.selectedTime);
+				this.selectedTime["hour"] = hourNodes.item(evt).innerHTML;
+			}
+		}
+		this.selectedTime.anyTime = false;
+	}
+
+	this.onSetSelectedMinute = function(evt) {
+		this.onClearSelectedAnyTime();
+		this.onClearSelectedMinute();
+		this.setSelectedMinute(evt);
+		this.selectedTime.anyTime = false;
+		this.onSetTime();
+	}
+
+	this.setSelectedMinute = function(evt) {
+		if(evt && evt.target) {
+			dojo.html.setClass(evt.target, this.classNames.selectedTime);
+			this.selectedTime["minute"] = evt.target.innerHTML;
+		} else if (!isNaN(evt)) {
+			var minuteNodes = this.minuteContainerNode.getElementsByTagName("td");
+			if(minuteNodes.item(evt)) {
+				dojo.html.setClass(minuteNodes.item(evt), this.classNames.selectedTime);
+				this.selectedTime["minute"] = minuteNodes.item(evt).innerHTML;
+			}
+		}
+	}
+
+	this.onSetSelectedAmPm = function(evt) {
+		this.onClearSelectedAnyTime();
+		this.onClearSelectedAmPm();
+		this.setSelectedAmPm(evt);
+		this.selectedTime.anyTime = false;
+		this.onSetTime();
+	}
+
+	this.setSelectedAmPm = function(evt) {
+		if(evt && evt.target) {
+			dojo.html.setClass(evt.target, this.classNames.selectedTime);
+			this.selectedTime["amPm"] = evt.target.innerHTML;
+		} else {
+			evt = evt ? 0 : 1;
+			var amPmNodes = this.amPmContainerNode.getElementsByTagName("td");
+			if(amPmNodes.item(evt)) {
+				dojo.html.setClass(amPmNodes.item(evt), this.classNames.selectedTime);
+				this.selectedTime["amPm"] = amPmNodes.item(evt).innerHTML;
+			}
+		}
+	}
+
+	this.onSetSelectedAnyTime = function(evt) {
+		this.onClearSelectedHour();
+		this.onClearSelectedMinute();
+		this.onClearSelectedAmPm();
+		this.setSelectedAnyTime();
+		this.onSetTime();
+	}
+
+	this.setSelectedAnyTime = function(evt) {
+		this.selectedTime.anyTime = true;
+		dojo.html.setClass(this.anyTimeContainerNode, this.classNames.selectedTime + " " + "anyTimeContainer");
+	}
+
+	this.onClick = function(evt) {
+		dojo.event.browser.stopEvent(evt)
+	}
+
+	this.onSetTime = function() {
+		if(this.selectedTime.anyTime) {
+			this.time = new Date();
+			var tempDateTime = dojo.widget.TimePicker.util.toRfcDateTime(this.time);
+			this.setDateTime(tempDateTime.split("T")[0]);
+		} else {
+			var hour = 12;
+			var minute = 0;
+			var isAm = false;
+			if(this.selectedTime["hour"]) {
+				hour = parseInt(this.selectedTime["hour"], 10);
+			}
+			if(this.selectedTime["minute"]) {
+				minute = parseInt(this.selectedTime["minute"], 10);
+			}
+			if(this.selectedTime["amPm"]) {
+				isAm = (this.selectedTime["amPm"].toLowerCase() == "am");
+			}
+			this.time = new Date();
+			this.time.setHours(dojo.widget.TimePicker.util.fromAmPmHour(hour, isAm));
+			this.time.setMinutes(minute);
+			this.setDateTime(dojo.widget.TimePicker.util.toRfcDateTime(this.time));
+		}
+	}
+
+}
+dojo.inherits(dojo.widget.html.TimePicker, dojo.widget.HtmlWidget);

Propchange: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TimePicker.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TitlePane.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TitlePane.js?rev=413306&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TitlePane.js (added)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/TitlePane.js Sat Jun 10 07:27:44 2006
@@ -0,0 +1,70 @@
+/*
+	Copyright (c) 2004-2006, 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.widget.html.TitlePane");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.lfx.*");
+
+dojo.widget.html.TitlePane = function(){
+	dojo.widget.HtmlWidget.call(this);
+	this.widgetType = "TitlePane";
+
+	this.labelNode="";
+	this.labelNodeClass="";
+	this.containerNodeClass="";
+	this.label="";
+
+	this.open=true;
+	this.templatePath = dojo.uri.dojoUri("src/widget/templates/TitlePane.html");
+}
+
+dojo.inherits(dojo.widget.html.TitlePane, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(dojo.widget.html.TitlePane, {
+	isContainer: true,
+	postCreate: function() {
+		if (this.label) {
+			this.labelNode.appendChild(document.createTextNode(this.label));
+		}
+
+		if (this.labelNodeClass) {
+			dojo.html.addClass(this.labelNode, this.labelNodeClass);
+		}	
+
+		if (this.containerNodeClass) {
+			dojo.html.addClass(this.containerNode, this.containerNodeClass);
+		}	
+
+		if (!this.open) {
+			dojo.lfx.wipeOut(this.containerNode,0).play();
+		}
+	},
+
+	onLabelClick: function() {
+		if (this.open) {
+			dojo.lfx.wipeOut(this.containerNode,250).play();
+			this.open=false;
+		}else {
+			dojo.lfx.wipeIn(this.containerNode,250).play();
+			this.open=true;
+		}
+	},
+
+	setContent: function(content) {
+		this.containerNode.innerHTML=content;
+	},
+
+	setLabel: function(label) {
+		this.labelNode.innerHTML=label;
+	}
+});
+
+dojo.widget.tags.addParseTreeHandler("dojo:TitlePane");

Added: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Tooltip.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Tooltip.js?rev=413306&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Tooltip.js (added)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Tooltip.js Sat Jun 10 07:27:44 2006
@@ -0,0 +1,183 @@
+/*
+	Copyright (c) 2004-2006, 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.widget.html.Tooltip");
+dojo.require("dojo.widget.html.ContentPane");
+dojo.require("dojo.widget.Tooltip");
+dojo.require("dojo.uri");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.event");
+dojo.require("dojo.style");
+dojo.require("dojo.html");
+
+dojo.widget.defineWidget(
+	"dojo.widget.html.Tooltip",
+	dojo.widget.html.ContentPane,
+	{
+		widgetType: "Tooltip",
+		isContainer: true,
+	
+		// Constructor arguments
+		caption: "",
+		showDelay: 500,
+		hideDelay: 100,
+		connectId: "",
+	
+		templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlTooltipTemplate.html"),
+		templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlTooltipTemplate.css"),
+	
+		connectNode: null,
+	
+		// Tooltip has the following possible states:
+		//   erased - nothing on screen
+		//   displaying - currently being faded in (partially displayed)
+		//   displayed - fully displayed
+		//   erasing - currently being faded out (partially erased)
+		state: "erased",
+	
+		fillInTemplate: function(args, frag){
+			if(this.caption != ""){
+				this.domNode.appendChild(document.createTextNode(this.caption));
+			}
+			this.connectNode = dojo.byId(this.connectId);		
+			dojo.widget.html.Tooltip.superclass.fillInTemplate.call(this, args, frag);
+		},
+		
+		postCreate: function(args, frag){
+			// The domnode was appended to my parent widget's domnode, but the positioning
+			// only works if the domnode is a child of document.body
+			document.body.appendChild(this.domNode);
+	
+			dojo.event.connect(this.connectNode, "onmouseover", this, "onMouseOver");
+			dojo.widget.html.Tooltip.superclass.postCreate.call(this, args, frag);
+		},
+		
+		onMouseOver: function(e) {
+			this.mouse = {x: e.pageX, y: e.pageY};
+	
+			if(!this.showTimer){
+				this.showTimer = setTimeout(dojo.lang.hitch(this, "show"), this.showDelay);
+				dojo.event.connect(document.documentElement, "onmousemove", this, "onMouseMove");
+			}
+		},
+	
+		onMouseMove: function(e) {
+			this.mouse = {x: e.pageX, y: e.pageY};
+	
+			if(dojo.html.overElement(this.connectNode, e) || dojo.html.overElement(this.domNode, e)) {
+				// If the tooltip has been scheduled to be erased, cancel that timer
+				// since we are hovering over element/tooltip again
+				if(this.hideTimer) {
+					clearTimeout(this.hideTimer);
+					delete this.hideTimer;
+				}
+			} else {
+				// mouse has been moved off the element/tooltip
+				// note: can't use onMouseOut to detect this because the "explode" effect causes
+				// spurious onMouseOut/onMouseOver events (due to interference from outline)
+				if(this.showTimer){
+					clearTimeout(this.showTimer);
+					delete this.showTimer;
+				}
+				if((this.state=="displaying"||this.state=="displayed") && !this.hideTimer){
+					this.hideTimer = setTimeout(dojo.lang.hitch(this, "hide"), this.hideDelay);
+				}
+			}
+		},
+	
+		show: function() {
+			if(this.state=="erasing"){
+				// we are in the process of erasing; when that is finished, display it.
+				this.displayScheduled=true;
+				return;
+			}
+			if ( this.state=="displaying" || this.state=="displayed" ) { return; }
+	
+			// prevent IE bleed through (iframe creation is deferred until first show()
+			// call because apparently it takes a long time)
+			if(!this.bgIframe){
+				this.bgIframe = new dojo.html.BackgroundIframe(this.domNode);
+			}
+	
+			this.position();
+	
+			// if rendering using explosion effect, need to set explosion source
+			this.explodeSrc = [this.mouse.x, this.mouse.y];
+	
+			this.state="displaying";
+	
+			dojo.widget.html.Tooltip.superclass.show.call(this);
+		},
+	
+		onShow: function() {
+			dojo.widget.html.Tooltip.superclass.onShow.call(this);
+			
+			this.state="displayed";
+			
+			// in the corner case where the user has moved his mouse away
+			// while the tip was fading in
+			if(this.eraseScheduled){
+				this.hide();
+				this.eraseScheduled=false;
+			}
+		},
+	
+		hide: function() {
+			if(this.state=="displaying"){
+				// in the process of fading in.  wait until that is finished and then fade out
+				this.eraseScheduled=true;
+				return;
+			}
+			if ( this.state=="displayed" ) {
+				this.state="erasing";
+				if ( this.showTimer ) {
+					clearTimeout(this.showTimer);
+					delete this.showTimer;
+				}
+				if ( this.hideTimer ) {
+					clearTimeout(this.hideTimer);
+					delete this.hideTimer;
+				}
+				dojo.event.disconnect(document.documentElement, "onmousemove", this, "onMouseMove");
+				dojo.widget.html.Tooltip.superclass.hide.call(this);
+			}
+		},
+	
+		onHide: function(){
+			this.state="erased";
+	
+			// in the corner case where the user has moved his mouse back
+			// while the tip was fading out
+			if(this.displayScheduled){
+				this.display();
+				this.displayScheduled=false;
+			}
+		},
+	
+		position: function(){
+			dojo.html.placeOnScreenPoint(this.domNode, this.mouse.x, this.mouse.y, [10,15], true);
+			this.bgIframe.onResized();
+		},
+	
+		onLoad: function(){
+			if(this.isShowing()){
+				// the tooltip has changed size due to downloaded contents, so reposition it
+				dojo.lang.setTimeout(this, this.position, 50);
+				dojo.widget.html.Tooltip.superclass.onLoad.apply(this, arguments);
+			}
+		},
+	
+		checkSize: function() {
+			// checkSize() is called when the user has resized the browser window,
+			// but that doesn't affect this widget (or this widget's children)
+			// so it can be safely ignored
+		}
+	}
+);

Propchange: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/Tooltip.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/YahooMap.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/YahooMap.js?rev=413306&r1=413305&r2=413306&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/YahooMap.js (original)
+++ tapestry/tapestry4/trunk/framework/src/js/dojo/src/widget/html/YahooMap.js Sat Jun 10 07:27:44 2006
@@ -8,173 +8,173 @@
 		http://dojotoolkit.org/community/licensing.shtml
 */
 
-dojo.provide("dojo.widget.html.YahooMap");
-dojo.require("dojo.event.*");
-dojo.require("dojo.html");
-dojo.require("dojo.math");
-dojo.require("dojo.widget.HtmlWidget");
-dojo.require("dojo.widget.YahooMap");
-
-(function(){
-	var yappid = djConfig["yAppId"]||djConfig["yahooAppId"]||"dojotoolkit";
-	if(!dojo.hostenv.post_load_){
-		if(yappid == "dojotoolkit"){
-			dojo.debug("please provide a unique Yahoo App ID in djConfig.yahooAppId when using the map widget");
-		}
-		var tag = "<scr"+"ipt src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid="+yappid+"'></scri"+"pt>";
-		if(!dj_global["YMap"]){
-			document.write(tag);
-		}
-	}else{
-		dojo.debug("cannot initialize map system after the page has been loaded! Please either manually include the script block provided by Yahoo in your page or require() the YahooMap widget before onload has fired");
-	}
-})();
-
-dojo.widget.html.YahooMap=function(){
-	dojo.widget.HtmlWidget.call(this);
-	dojo.widget.YahooMap.call(this);
-
-	this.map=null;
-	this.datasrc="";
-	this.data=[];
-	this.width=0;
-	this.height=0;
-	this.controls=["zoomlong","maptype","pan"];
-};
-dojo.inherits(dojo.widget.html.YahooMap, dojo.widget.HtmlWidget);
-
-dojo.lang.extend(dojo.widget.html.YahooMap, {
-	widgetType: "YahooMap",
-	templatePath:null,
-	templateCssPath:null,
-
-	findCenter:function(aPts){
-		var start=new YGeoPoint(37,-90);
-		if(aPts.length==0) return start;
-		var minLat,maxLat, minLon, maxLon, cLat, cLon;
-		minLat=maxLat=aPts[0].Lat;
-		minLon=maxLon=aPts[0].Lon;
-		for(var i=0; i<aPts.length; i++){
-			minLat=Math.min(minLat,aPts[i].Lat);
-			maxLat=Math.max(maxLat,aPts[i].Lat);
-			minLon=Math.min(minLon,aPts[i].Lon);
-			maxLon=Math.max(maxLon,aPts[i].Lon);
-		}
-		cLat=dojo.math.round((minLat+maxLat)/2,6);
-		cLon=dojo.math.round((minLon+maxLon)/2,6);
-		return new YGeoPoint(cLat,cLon);
-	},
-	setControls:function(){
-		var c=this.controls;
-		var t=dojo.widget.YahooMap.Controls;
-		for(var i=0; i<c.length; i++){
-			switch(c[i]){
-				case t.MapType:{
-					this.map.addTypeControl();
-					break;
-				}
-				case t.Pan:{
-					this.map.addPanControl();
-					break;
-				}
-				case t.ZoomLong:{
-					this.map.addZoomLong();
-					break;
-				}
-				case t.ZoomShort:{
-					this.map.addZoomShort();
-					break;
-				}
-			}
-		}
-	},
-	
-	parse:function(table){
-		this.data=[];
-
-		//	get the column indices
-		var h=table.getElementsByTagName("thead")[0];
-		if(!h){
-			return;
-		}
-
-		var a=[];
-		var cols=h.getElementsByTagName("td");
-		if(cols.length==0){
-			cols=h.getElementsByTagName("th");
-		}
-		for(var i=0; i<cols.length; i++){
-			var c=cols[i].innerHTML.toLowerCase();
-			if(c=="long") c="lng";
-			a.push(c);
-		}
-		
-		//	parse the data
-		var b=table.getElementsByTagName("tbody")[0];
-		if(!b){
-			return;
-		}
-		for(var i=0; i<b.childNodes.length; i++){
-			if(!(b.childNodes[i].nodeName&&b.childNodes[i].nodeName.toLowerCase()=="tr")){
-				continue;
-			}
-			var cells=b.childNodes[i].getElementsByTagName("td");
-			var o={};
-			for(var j=0; j<a.length; j++){
-				var col=a[j];
-				if(col=="lat"||col=="lng"){
-					o[col]=parseFloat(cells[j].innerHTML);					
-				}else{
-					o[col]=cells[j].innerHTML;
-				}
-			}
-			this.data.push(o);
-		}
-	},
-	render:function(){
-		var pts=[];
-		var d=this.data;
-		for(var i=0; i<d.length; i++){
-			var pt=new YGeoPoint(d[i].lat, d[i].lng);
-			pts.push(pt);
-			var icon=d[i].icon||null;
-			if(icon){
-				icon=new YImage(icon);
-			}
-			var m=new YMarker(pt,icon);
-			if(d[i].description){
-				m.addAutoExpand("<div>"+d[i].description+"</div>");
-			}
-			this.map.addOverlay(m);
-		}
-		var c=this.findCenter(pts);
-		var z=this.map.getZoomLevel(pts);
-		this.map.drawZoomAndCenter(c,z);
-	},
-	
-	initialize:function(args, frag){
-		if(!YMap || !YGeoPoint){
-			dojo.raise("dojo.widget.YahooMap: The Yahoo Map script must be included in order to use this widget.");
-		}
-		if(this.datasrc){
-			this.parse(dojo.byId(this.datasrc));
-		}
-		else if(this.domNode.getElementsByTagName("table")[0]){
-			this.parse(this.domNode.getElementsByTagName("table")[0]);
-		}
-	},
-	postCreate:function(){
-		//	clean the domNode before creating the map.
-		while(this.domNode.childNodes.length>0){
-			this.domNode.removeChild(this.domNode.childNodes[0]);
-		}
-
-		if(this.width>0&&this.height>0){
-			this.map=new YMap(this.domNode, YAHOO_MAP_REG, new YSize(this.width, this.height));
-		}else{
-			this.map=new YMap(this.domNode);
-		}
-		this.setControls();
-		this.render();
-	}
+dojo.provide("dojo.widget.html.YahooMap");
+dojo.require("dojo.event.*");
+dojo.require("dojo.html");
+dojo.require("dojo.math");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.YahooMap");
+
+(function(){
+	var yappid = djConfig["yAppId"]||djConfig["yahooAppId"]||"dojotoolkit";
+	if(!dojo.hostenv.post_load_){
+		if(yappid == "dojotoolkit"){
+			dojo.debug("please provide a unique Yahoo App ID in djConfig.yahooAppId when using the map widget");
+		}
+		var tag = "<scr"+"ipt src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid="+yappid+"'></scri"+"pt>";
+		if(!dj_global["YMap"]){
+			document.write(tag);
+		}
+	}else{
+		dojo.debug("cannot initialize map system after the page has been loaded! Please either manually include the script block provided by Yahoo in your page or require() the YahooMap widget before onload has fired");
+	}
+})();
+
+dojo.widget.html.YahooMap=function(){
+	dojo.widget.HtmlWidget.call(this);
+	dojo.widget.YahooMap.call(this);
+
+	this.map=null;
+	this.datasrc="";
+	this.data=[];
+	this.width=0;
+	this.height=0;
+	this.controls=["zoomlong","maptype","pan"];
+};
+dojo.inherits(dojo.widget.html.YahooMap, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(dojo.widget.html.YahooMap, {
+	widgetType: "YahooMap",
+	templatePath:null,
+	templateCssPath:null,
+
+	findCenter:function(aPts){
+		var start=new YGeoPoint(37,-90);
+		if(aPts.length==0) return start;
+		var minLat,maxLat, minLon, maxLon, cLat, cLon;
+		minLat=maxLat=aPts[0].Lat;
+		minLon=maxLon=aPts[0].Lon;
+		for(var i=0; i<aPts.length; i++){
+			minLat=Math.min(minLat,aPts[i].Lat);
+			maxLat=Math.max(maxLat,aPts[i].Lat);
+			minLon=Math.min(minLon,aPts[i].Lon);
+			maxLon=Math.max(maxLon,aPts[i].Lon);
+		}
+		cLat=dojo.math.round((minLat+maxLat)/2,6);
+		cLon=dojo.math.round((minLon+maxLon)/2,6);
+		return new YGeoPoint(cLat,cLon);
+	},
+	setControls:function(){
+		var c=this.controls;
+		var t=dojo.widget.YahooMap.Controls;
+		for(var i=0; i<c.length; i++){
+			switch(c[i]){
+				case t.MapType:{
+					this.map.addTypeControl();
+					break;
+				}
+				case t.Pan:{
+					this.map.addPanControl();
+					break;
+				}
+				case t.ZoomLong:{
+					this.map.addZoomLong();
+					break;
+				}
+				case t.ZoomShort:{
+					this.map.addZoomShort();
+					break;
+				}
+			}
+		}
+	},
+	
+	parse:function(table){
+		this.data=[];
+
+		//	get the column indices
+		var h=table.getElementsByTagName("thead")[0];
+		if(!h){
+			return;
+		}
+
+		var a=[];
+		var cols=h.getElementsByTagName("td");
+		if(cols.length==0){
+			cols=h.getElementsByTagName("th");
+		}
+		for(var i=0; i<cols.length; i++){
+			var c=cols[i].innerHTML.toLowerCase();
+			if(c=="long") c="lng";
+			a.push(c);
+		}
+		
+		//	parse the data
+		var b=table.getElementsByTagName("tbody")[0];
+		if(!b){
+			return;
+		}
+		for(var i=0; i<b.childNodes.length; i++){
+			if(!(b.childNodes[i].nodeName&&b.childNodes[i].nodeName.toLowerCase()=="tr")){
+				continue;
+			}
+			var cells=b.childNodes[i].getElementsByTagName("td");
+			var o={};
+			for(var j=0; j<a.length; j++){
+				var col=a[j];
+				if(col=="lat"||col=="lng"){
+					o[col]=parseFloat(cells[j].innerHTML);					
+				}else{
+					o[col]=cells[j].innerHTML;
+				}
+			}
+			this.data.push(o);
+		}
+	},
+	render:function(){
+		var pts=[];
+		var d=this.data;
+		for(var i=0; i<d.length; i++){
+			var pt=new YGeoPoint(d[i].lat, d[i].lng);
+			pts.push(pt);
+			var icon=d[i].icon||null;
+			if(icon){
+				icon=new YImage(icon);
+			}
+			var m=new YMarker(pt,icon);
+			if(d[i].description){
+				m.addAutoExpand("<div>"+d[i].description+"</div>");
+			}
+			this.map.addOverlay(m);
+		}
+		var c=this.findCenter(pts);
+		var z=this.map.getZoomLevel(pts);
+		this.map.drawZoomAndCenter(c,z);
+	},
+	
+	initialize:function(args, frag){
+		if(!YMap || !YGeoPoint){
+			dojo.raise("dojo.widget.YahooMap: The Yahoo Map script must be included in order to use this widget.");
+		}
+		if(this.datasrc){
+			this.parse(dojo.byId(this.datasrc));
+		}
+		else if(this.domNode.getElementsByTagName("table")[0]){
+			this.parse(this.domNode.getElementsByTagName("table")[0]);
+		}
+	},
+	postCreate:function(){
+		//	clean the domNode before creating the map.
+		while(this.domNode.childNodes.length>0){
+			this.domNode.removeChild(this.domNode.childNodes[0]);
+		}
+
+		if(this.width>0&&this.height>0){
+			this.map=new YMap(this.domNode, YAHOO_MAP_REG, new YSize(this.width, this.height));
+		}else{
+			this.map=new YMap(this.domNode);
+		}
+		this.setControls();
+		this.render();
+	}
 });