You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by he...@apache.org on 2006/11/13 23:55:14 UTC

svn commit: r474551 [35/49] - in /struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo: ./ src/ src/alg/ src/animation/ src/cal/ src/charting/ src/charting/svg/ src/charting/vml/ src/collections/ src/crypto/ src/data/ src/data/cs...

Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/Form.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/Form.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/Form.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/Form.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,257 @@
+/*
+	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.Form");
+
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.HtmlWidget");
+
+dojo.widget.defineWidget("dojo.widget.Form", dojo.widget.HtmlWidget,
+	{
+		isContainer: true,
+   		templateString: "<form dojoAttachPoint='containerNode' dojoAttachEvent='onSubmit:onSubmit'></form>",
+		formElements: [],
+
+		postCreate: function(args,frag){
+			for (var key in args) {
+				if (key == "dojotype") continue;
+				var attr= document.createAttribute(key);
+      				attr.nodeValue=args[key];
+      				this.containerNode.setAttributeNode(attr);
+    			}
+  		},
+		_createFormElements: function() {
+   			if(dojo.render.html.safari) {
+				// bug in safari (not registering form-elements)
+				var elems = ["INPUT", "SELECT", "TEXTAREA"];
+				for (var k=0; k < elems.length; k++) {
+					var list = this.containerNode.getElementsByTagName(elems[k]);
+					for (var j=0,len2=list.length; j<len2; j++) {
+						this.formElements.push(list[j]);
+					}
+				}
+				// fixed in safari nightly
+			} else {
+				this.formElements=this.containerNode.elements;
+			}
+		},
+		onSubmit: function(e) {
+    			e.preventDefault();
+  		},
+
+		submit: function() {
+			this.containerNode.submit();
+		},
+
+		_getFormElement: function(name) {
+			for(var i=0, len=this.formElements.length; i<len; i++) {
+				var element = this.formElements[i];
+				if (element.name == name) {
+					return element;
+				} // if
+			} // for
+			return null;
+		},
+
+		_getObject: function(obj, searchString) {
+			var namePath = [];
+			namePath=searchString.split(".");
+			var myObj=obj;
+			var name=namePath[namePath.length-1];
+
+			for(var j=0, len=namePath.length;j<len;++j) {
+				var p=namePath[j];
+				if (typeof(myObj[p]) == "undefined") {
+					myObj[p]={};
+				}
+				myObj=myObj[p];
+			}
+			return myObj;
+		},
+		_setToContainers: function (obj, widget) {
+			for(var i=0, len=widget.children.length; i<len; ++i) {
+				if (widget.children[i].widgetType == "Repeater") {
+					var rIndex=widget.children[i].pattern;
+					var rIndexPos=rIndex.indexOf("%{index}");
+					rIndex=rIndex.substr(0,rIndexPos-1);
+					var myObj = this._getObject(obj, rIndex);
+					if (typeof(myObj) == "object" && typeof(myObj.length) == "undefined") {
+						myObj=[];
+					}
+					var rowCount = widget.children[i].getRowCount();
+					if (myObj.length > rowCount) {
+						for (var j=rowCount, len2=myObj.length; j<len2; j++) {
+							widget.children[i].addRow();
+						}
+					} else if (myObj.length < rowCount) {
+						for (var j=rowCount, len2=myObj.length; j>len2; j--) {
+							widget.children[i].deleteRow(0);
+						}
+					}
+					for (var j=0, len2=myObj.length;j<len2; ++j) {
+						for (var key in myObj[j]) {
+							var prefix = dojo.string.substituteParams(widget.children[i].index, {"index": "" + j});
+							this._getFormElement(prefix+"."+key).value=myObj[j][key];
+						}
+					}
+				}
+
+				if (widget.children[i].isContainer) {
+					this._setToContainers (obj, widget.children[i]);
+					continue;
+				}
+
+				switch(widget.children[i].widgetType) {
+					case "Checkbox":
+						continue;
+						break;
+					case "DropdownDatePicker":
+						if(widget.children[i].valueNode.value == "") {
+							widget.children[i].inputNode.value="";
+							widget.children[i].datePicker.storedDate="";
+						} else {
+							widget.children[i].datePicker.setDate(widget.children[i].valueNode.value);
+							//widget.children[i].datePicker.date=dojo.widget.DatePicker.util.fromRfcDate(widget.children[i].valueNode.value);
+							widget.children[i].onSetDate();
+						}
+						break;
+					case "Select":
+						//widget.children[i].setValue(myObj[name]);
+						continue;
+						break;
+					case "ComboBox":
+						//widget.children[i].setSelectedValue(myObj[name]);
+						continue;
+						break;
+					default:
+						break;
+				}
+			}
+		},
+		setValues: function(obj) {
+			this._createFormElements();
+			for(var i=0, len=this.formElements.length; i<len; i++) {
+				var element = this.formElements[i];
+				if (element.name == '') {continue};
+				var namePath = new Array();
+				namePath=element.name.split(".");
+				var myObj=obj;
+				var name=namePath[namePath.length-1];
+				for(var j=1,len2=namePath.length;j<len2;++j) {
+					var p=namePath[j - 1];
+					if(typeof(myObj[p]) == "undefined") {
+						myObj=undefined;
+						break;
+						//myObj[p]={}
+					};
+					myObj=myObj[p];
+				}
+
+				if (typeof(myObj) == "undefined") {
+					continue;
+				}
+
+				var type=element.type;
+				if (type == "hidden" || type == "text" || type == "textarea" || type == "password") {
+					type = "text";
+				}
+				switch(type) {
+					case "checkbox":
+						this.formElements[i].checked=false;
+						if (typeof(myObj[name]) == 'undefined') continue;
+						for (var j=0,len2=myObj[name].length; j<len2; ++j) {
+							if(element.value == myObj[name][j]) {
+								element.checked=true;
+							}
+						}
+						break;
+					case "radio":
+						this.formElements[i].checked=false;
+						if (typeof(myObj[name]) == 'undefined') {continue};
+						if (myObj[name] == this.formElements[i].value) {
+							this.formElements[i].checked=true;
+						}
+						break;
+					case "select-one":
+						this.formElements[i].selectedIndex="0";
+						for (var j=0,len2=element.options.length; j<len2; ++j) {
+							if (element.options[j].value == myObj[name]) {
+								element.options[j].selected=true;
+							} else {
+								//element.options[j].selected=false;
+							}
+						}
+						break;
+					case "text":
+						var value="";
+						if (typeof(myObj[name]) == 'string') {
+							value = myObj[name];
+						}
+						this.formElements[i].value=value;
+						break;
+					default:
+						//dojo.debug("Not supported type ("+type+")");
+						break;
+				}
+      			}
+			this._setToContainers(obj,this);
+		},
+		getValues: function() {
+			this._createFormElements();
+			var obj = { };
+
+			for(var i=0,len=this.formElements.length; i<len; i++) {
+				// FIXME: would be better to give it an attachPoint:
+				var elm = this.formElements[i];
+				var namePath = [];
+				if (elm.name == '') { continue;}
+				namePath=elm.name.split(".");
+				var myObj=obj;
+				var name=namePath[namePath.length-1];
+				for(var j=1,len2=namePath.length;j<len2;++j) {
+					var nameIndex = null;
+					var p=namePath[j - 1];
+					var nameA=p.split("[");
+					if (nameA.length > 1) {
+						if(typeof(myObj[nameA[0]]) == "undefined") {
+							myObj[nameA[0]]=[ ];
+						} // if
+						nameIndex=parseInt(nameA[1]);
+						if(typeof(myObj[nameA[0]][nameIndex]) == "undefined") {
+							myObj[nameA[0]][nameIndex]={};
+						}
+					} else if(typeof(myObj[nameA[0]]) == "undefined") {
+						myObj[nameA[0]]={}
+					} // if
+
+					if (nameA.length == 1) {
+						myObj=myObj[nameA[0]];
+					} else {
+						myObj=myObj[nameA[0]][nameIndex];
+					} // if
+				} // for
+
+				if ((elm.type != "checkbox" && elm.type != "radio") || (elm.type=="radio" && elm.checked)) {
+					if(name == name.split("[")[0]) {
+						myObj[name]=elm.value;
+					} else {
+						// can not set value when there is no name
+					}
+				} else if (elm.type == "checkbox" && elm.checked) {
+					if(typeof(myObj[name]) == 'undefined') {
+						myObj[name]=[ ];
+					}
+					myObj[name].push(elm.value);
+				} // if
+				name=undefined;
+			} // for
+		return obj;
+	}
+});

Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/Form.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/GoogleMap.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/GoogleMap.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/GoogleMap.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/GoogleMap.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,229 @@
+/*
+	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.GoogleMap");
+dojo.require("dojo.event.*");
+dojo.require("dojo.math");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.uri.Uri");
+dojo.require("dojo.widget.HtmlWidget");
+
+(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_){
+		if(!gkey || gkey==""){
+			dojo.raise("dojo.widget.GoogleMap: The Google Map widget requires a proper API key in order to be used.");
+		}
+		var tag = "<scr"+"ipt src='http://maps.google.com/maps?file=api&amp;v=2&amp;key="+gkey+"'></scri"+"pt>";
+		if(!dj_global["GMap2"]){
+			document.write(tag);
+		}
+	}else{
+		dojo.debug("Cannot initialize Google 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.defineWidget(
+	"dojo.widget.GoogleMap",
+	dojo.widget.HtmlWidget,
+	function(){
+		//	summary
+		//	initializer/constructor for the simple GoogleMap widget.
+		this.map=null;
+		this.geocoder=null;
+		this.data=[];
+		this.datasrc="";
+		this.controls=["largemap","scale","maptype"];
+	},
+{
+	templatePath:null,
+	templateCssPath:null,
+	isContainer: false,
+
+	_defaultPoint:{lat:39.10662, lng: -94.578209},
+
+	setControls:function(){
+		//	summary
+		//	Set any controls on the map in question.
+		var methodmap={
+			largemap:GLargeMapControl,
+			smallmap:GSmallMapControl,
+			smallzoom:GSmallZoomControl,
+			scale:GScaleControl,
+			maptype:GMapTypeControl,
+			overview:GOverviewMapControl
+		};
+		for(var i=0; i<this.controls.length; i++){
+			this.map.addControl(new (methodmap[this.controls[i].toLowerCase()])());
+		}
+	},
+	
+	findCenter:function(/* GLatLngBounds */bounds){
+		//	summary
+		//	Returns the center point given the Bounds object.
+		if(this.data.length==1){
+			return (new GLatLng(this.data[0].lat, this.data[0].lng));	//	GLatLng
+		}
+		var clat=(bounds.getNorthEast().lat()+bounds.getSouthWest().lat())/2;
+		var clng=(bounds.getNorthEast().lng()+bounds.getSouthWest().lng())/2;
+		return (new GLatLng(clat,clng));	//	GLatLng
+	},
+
+	createPinpoint:function(/* GLatLng */pt, /* string? */overlay){
+		//	summary
+		//	Creates a marker at the given point, with an optional overlay HTML string.
+		var m=new GMarker(pt);
+		if(overlay){
+			GEvent.addListener(m,"click",function(){
+				m.openInfoWindowHtml("<div>"+overlay+"</div>");
+			});
+		}
+		return m;	//	GMarker
+	},
+	plot:function(/* object */obj){
+		//	summary
+		//	Plots a point at given lat/lng coordinate
+		var p=new GLatLng(obj.lat,obj.lng);
+		var d=obj.description||null;
+		var m=this.createPinpoint(p,d);
+		this.map.addOverlay(m);
+	},
+	plotAddress:function(/* string */address){
+		//	summary
+		//	Calls the Google Geocoder to get a lat/lng coordinate at string address
+		var self=this;
+		this.geocoder.getLocations(address, function(response){
+			if(!response || response.Status.code != 200){
+				alert("The address \"" + address + "\" was not found.");
+				return;
+			}
+			var obj={
+				lat:response.Placemark[0].Point.coordinates[1],
+				lng:response.Placemark[0].Point.coordinates[0],
+				description:response.Placemark[0].address
+			};
+			self.data.push(obj);
+			self.render();
+		});
+	},
+
+	parse:function(/* HTMLTable */table){
+		//	summary
+		//	Parses the passed table for data to plot on this map.
+		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(){
+		//	summary
+		//	Plots all acutal points in the current data array.
+		if(this.data.length==0){
+			this.map.setCenter(new GLatLng(this._defaultPoint.lat, this._defaultPoint.lng), 4);
+			return;
+		}
+
+		//	remove all overlays
+		this.map.clearOverlays();
+
+		var bounds=new GLatLngBounds();
+		var d=this.data;
+		for(var i=0; i<d.length; i++){
+			bounds.extend(new GLatLng(d[i].lat,d[i].lng));
+		}
+		var zoom=Math.min((this.map.getBoundsZoomLevel(bounds)-1),14);
+		this.map.setCenter(this.findCenter(bounds), zoom);
+
+		for(var i=0; i<this.data.length; i++){
+			this.plot(this.data[i]);
+		}
+	},
+
+	initialize:function(/* object */args, /* object */frag){
+		//	summary
+		//	initializes the 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(){
+		//	summary
+		//	Sets up and renders the widget.
+
+		//	clean the domNode before creating the map.
+		while(this.domNode.childNodes.length>0){
+			this.domNode.removeChild(this.domNode.childNodes[0]);
+		}
+		if(this.domNode.style.position!="absolute"){
+			this.domNode.style.position="relative";
+		}
+		this.map=new GMap2(this.domNode);
+		try{
+			this.geocoder=new GClientGeocoder();
+		}catch(ex){}
+		this.render();
+		this.setControls();
+	}
+});

Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/GoogleMap.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/HtmlWidget.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/HtmlWidget.js?view=diff&rev=474551&r1=474550&r2=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/HtmlWidget.js (original)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/HtmlWidget.js Mon Nov 13 14:54:45 2006
@@ -1,5 +1,5 @@
 /*
-	Copyright (c) 2004-2005, The Dojo Foundation
+	Copyright (c) 2004-2006, The Dojo Foundation
 	All Rights Reserved.
 
 	Licensed under the Academic Free License version 2.1 or above OR the
@@ -10,27 +10,20 @@
 
 dojo.provide("dojo.widget.HtmlWidget");
 dojo.require("dojo.widget.DomWidget");
-dojo.require("dojo.html");
-dojo.require("dojo.string");
+dojo.require("dojo.html.util");
+dojo.require("dojo.html.display");
+dojo.require("dojo.html.layout");
+dojo.require("dojo.lang.extras");
+dojo.require("dojo.lang.func");
+dojo.require("dojo.lfx.toggle");
 
-dojo.widget.HtmlWidget = function(args){
-	// mixin inheritance
-	dojo.widget.DomWidget.call(this);
-}
-
-dojo.inherits(dojo.widget.HtmlWidget, dojo.widget.DomWidget);
-
-dojo.lang.extend(dojo.widget.HtmlWidget, {
+dojo.declare("dojo.widget.HtmlWidget", dojo.widget.DomWidget, {								 
 	widgetType: "HtmlWidget",
 
 	templateCssPath: null,
 	templatePath: null,
-	allowResizeX: true,
-	allowResizeY: true,
-
-	resizeGhost: null,
-	initialResizeCoords: null,
 
+	lang: "",
 	// for displaying/hiding widget
 	toggle: "plain",
 	toggleDuration: 150,
@@ -41,15 +34,16 @@
 	},
 
 	postMixInProperties: function(args, frag){
-		// now that we know the setting for toggle, define show()&hide()
-		dojo.lang.mixin(this,
-			dojo.widget.HtmlWidget.Toggle[dojo.string.capitalize(this.toggle)] ||
-			dojo.widget.HtmlWidget.Toggle.Plain);
+		if(this.lang === ""){this.lang = null;}
+		// now that we know the setting for toggle, get toggle object
+		// (default to plain toggler if user specified toggler not present)
+		this.toggleObj =
+			dojo.lfx.toggle[this.toggle.toLowerCase()] || dojo.lfx.toggle.plain;
 	},
 
 	getContainerHeight: function(){
 		// NOTE: container height must be returned as the INNER height
-		dj_unimplemented("dojo.widget.HtmlWidget.getContainerHeight");
+		dojo.unimplemented("dojo.widget.HtmlWidget.getContainerHeight");
 	},
 
 	getContainerWidth: function(){
@@ -60,167 +54,117 @@
 		var ch = this.getContainerHeight();
 	},
 
-	startResize: function(coords){
-		// get the left and top offset of our dom node
-		coords.offsetLeft = dojo.html.totalOffsetLeft(this.domNode);
-		coords.offsetTop = dojo.html.totalOffsetTop(this.domNode);
-		coords.innerWidth = dojo.html.getInnerWidth(this.domNode);
-		coords.innerHeight = dojo.html.getInnerHeight(this.domNode);
-		if(!this.resizeGhost){
-			this.resizeGhost = document.createElement("div");
-			var rg = this.resizeGhost;
-			rg.style.position = "absolute";
-			rg.style.backgroundColor = "white";
-			rg.style.border = "1px solid black";
-			dojo.html.setOpacity(rg, 0.3);
-			dojo.html.body().appendChild(rg);
-		}
-		with(this.resizeGhost.style){
-			left = coords.offsetLeft + "px";
-			top = coords.offsetTop + "px";
-		}
-		this.initialResizeCoords = coords;
-		this.resizeGhost.style.display = "";
-		this.updateResize(coords, true);
-	},
-
-	updateResize: function(coords, override){
-		var dx = coords.x-this.initialResizeCoords.x;
-		var dy = coords.y-this.initialResizeCoords.y;
-		with(this.resizeGhost.style){
-			if((this.allowResizeX)||(override)){
-				width = this.initialResizeCoords.innerWidth + dx + "px";
-			}
-			if((this.allowResizeY)||(override)){
-				height = this.initialResizeCoords.innerHeight + dy + "px";
-			}
-		}
-	},
-
-	endResize: function(coords){
-		// FIXME: need to actually change the size of the widget!
-		var dx = coords.x-this.initialResizeCoords.x;
-		var dy = coords.y-this.initialResizeCoords.y;
-		with(this.domNode.style){
-			if(this.allowResizeX){
-				width = this.initialResizeCoords.innerWidth + dx + "px";
-			}
-			if(this.allowResizeY){
-				height = this.initialResizeCoords.innerHeight + dy + "px";
-			}
-		}
-		this.resizeGhost.style.display = "none";
-	},
-
-	resizeSoon: function(){
-		if ( this.isVisible() ) {
-			dojo.lang.setTimeout(this, this.onResized, 0);
-		}
-	},
-
 	createNodesFromText: function(txt, wrap){
 		return dojo.html.createNodesFromText(txt, wrap);
 	},
 
-	_old_buildFromTemplate: dojo.widget.DomWidget.prototype.buildFromTemplate,
-
-	buildFromTemplate: function(args, frag){
-		if(dojo.widget.DomWidget.templates[this.widgetType]){
-			var ot = dojo.widget.DomWidget.templates[this.widgetType];
-			dojo.widget.DomWidget.templates[this.widgetType] = {};
-		}
-		if(args["templatecsspath"]){
-			args["templateCssPath"] = args["templatecsspath"];
-		}
-		if(args["templatepath"]){
-			args["templatePath"] = args["templatepath"];
-		}
-		dojo.widget.buildFromTemplate(this, args["templatePath"], args["templateCssPath"]);
-		this._old_buildFromTemplate(args, frag);
-		dojo.widget.DomWidget.templates[this.widgetType] = ot;
-	},
-
 	destroyRendering: function(finalize){
 		try{
-			var tempNode = this.domNode.parentNode.removeChild(this.domNode);
-			if(!finalize){
-				dojo.event.browser.clean(tempNode);
+			if(!finalize && this.domNode){
+				dojo.event.browser.clean(this.domNode);
 			}
-			delete tempNode;
+			this.domNode.parentNode.removeChild(this.domNode);
+			delete this.domNode;
 		}catch(e){ /* squelch! */ }
 	},
 
+	/////////////////////////////////////////////////////////
 	// Displaying/hiding the widget
-
-	isVisible: function(){
-		return dojo.html.isVisible(this.domNode);
+	/////////////////////////////////////////////////////////
+	isShowing: function(){
+		return dojo.html.isShowing(this.domNode);
 	},
-	doToggle: function(){
-		this.isVisible() ? this.hide() : this.show();
+
+	toggleShowing: function(){
+		// dojo.html.toggleShowing(this.domNode);
+		if(this.isHidden){
+			this.show();
+		}else{
+			this.hide();
+		}
 	},
+
 	show: function(){
 		this.animationInProgress=true;
-		this.showMe();
+		this.isHidden = false;
+		this.toggleObj.show(this.domNode, this.toggleDuration, null,
+			dojo.lang.hitch(this, this.onShow), this.explodeSrc);
 	},
+
+	// called after the show() animation has completed
 	onShow: function(){
 		this.animationInProgress=false;
+		this.checkSize();
 	},
+
 	hide: function(){
-		this.animationInProgress=true;
-		this.hideMe();
+		this.animationInProgress = true;
+		this.isHidden = true;
+		this.toggleObj.hide(this.domNode, this.toggleDuration, null,
+			dojo.lang.hitch(this, this.onHide), this.explodeSrc);
 	},
+
+	// called after the hide() animation has completed
 	onHide: function(){
 		this.animationInProgress=false;
-	}
-});
-
-
-/**** 
-	Strategies for displaying/hiding widget
-*****/
-
-dojo.widget.HtmlWidget.Toggle={}
-
-dojo.widget.HtmlWidget.Toggle.Plain = {
-	showMe: function(){
-		dojo.html.show(this.domNode);
-		if(dojo.lang.isFunction(this.onShow)){ this.onShow(); }
 	},
 
-	hideMe: function(){
-		dojo.html.hide(this.domNode);
-		if(dojo.lang.isFunction(this.onHide)){ this.onHide(); }
-	}
-}
-
-dojo.widget.HtmlWidget.Toggle.Fade = {
-	showMe: function(){
-		dojo.fx.html.fadeShow(this.domNode, this.toggleDuration, dojo.lang.hitch(this, this.onShow));
-	},
-
-	hideMe: function(){
-		dojo.fx.html.fadeHide(this.domNode, this.toggleDuration, dojo.lang.hitch(this, this.onHide));
-	}
-}
-
-dojo.widget.HtmlWidget.Toggle.Wipe = {
-	showMe: function(){
-		dojo.fx.html.wipeIn(this.domNode, this.toggleDuration, dojo.lang.hitch(this, this.onShow));
+	//////////////////////////////////////////////////////////////////////////////
+	// Sizing related methods
+	//  If the parent changes size then for each child it should call either
+	//   - resizeTo(): size the child explicitly
+	//   - or checkSize(): notify the child the the parent has changed size
+	//////////////////////////////////////////////////////////////////////////////
+
+	// Test if my size has changed.
+	// If width & height are specified then that's my new size; otherwise,
+	// query outerWidth/outerHeight of my domNode
+	_isResized: function(w, h){
+		// If I'm not being displayed then disregard (show() must
+		// check if the size has changed)
+		if(!this.isShowing()){ return false; }
+
+		// If my parent has been resized and I have style="height: 100%"
+		// or something similar then my size has changed too.
+		var wh = dojo.html.getMarginBox(this.domNode);
+		var width=w||wh.width;
+		var height=h||wh.height;
+		if(this.width == width && this.height == height){ return false; }
+
+		this.width=width;
+		this.height=height;
+		return true;
+	},
+
+	// Called when my parent has changed size, but my parent won't call resizeTo().
+	// This is useful if my size is height:100% or something similar.
+	// Also called whenever I am shown, because the first time I am shown I may need
+	// to do size calculations.
+	checkSize: function(){
+		if(!this._isResized()){ return; }
+		this.onResized();
+	},
+
+	// Explicitly set this widget's size (in pixels).
+	resizeTo: function(w, h){
+		dojo.html.setMarginBox(this.domNode, { width: w, height: h });
+		
+		// can't do sizing if widget is hidden because referencing node.offsetWidth/node.offsetHeight returns 0.
+		// do sizing on show() instead.
+		if(this.isShowing()){
+			this.onResized();
+		}
 	},
 
-	hideMe: function(){
-		dojo.fx.html.wipeOut(this.domNode, this.toggleDuration, dojo.lang.hitch(this, this.onHide));
-	}
-}
-
-dojo.widget.HtmlWidget.Toggle.Explode = {
-	showMe: function(){
-		dojo.fx.html.explode(this.explodeSrc, this.domNode, this.toggleDuration,
-			dojo.lang.hitch(this, this.onShow));
+	resizeSoon: function(){
+		if(this.isShowing()){
+			dojo.lang.setTimeout(this, this.onResized, 0);
+		}
 	},
 
-	hideMe: function(){
-		dojo.fx.html.implode(this.domNode, this.explodeSrc, this.toggleDuration,
-			dojo.lang.hitch(this, this.onHide));
+	// Called when my size has changed.
+	// Must notify children if their size has (possibly) changed
+	onResized: function(){
+		dojo.lang.forEach(this.children, function(child){ if(child.checkSize){child.checkSize();} });
 	}
-}
+});

Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/InlineEditBox.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/InlineEditBox.js?view=diff&rev=474551&r1=474550&r2=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/InlineEditBox.js (original)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/InlineEditBox.js Mon Nov 13 14:54:45 2006
@@ -1,5 +1,5 @@
 /*
-	Copyright (c) 2004-2005, The Dojo Foundation
+	Copyright (c) 2004-2006, The Dojo Foundation
 	All Rights Reserved.
 
 	Licensed under the Academic Free License version 2.1 or above OR the
@@ -9,30 +9,25 @@
 */
 
 dojo.provide("dojo.widget.InlineEditBox");
-dojo.provide("dojo.widget.html.InlineEditBox");
 
 dojo.require("dojo.widget.*");
-dojo.require("dojo.fx.*");
-dojo.require("dojo.graphics.color");
+dojo.require("dojo.event.*");
+dojo.require("dojo.lfx.*");
+dojo.require("dojo.gfx.color");
 dojo.require("dojo.string");
-dojo.require("dojo.style");
-dojo.require("dojo.html");
+dojo.require("dojo.html.*");
+dojo.require("dojo.html.layout");
 
-dojo.widget.tags.addParseTreeHandler("dojo:inlineeditbox");
-
-dojo.widget.html.InlineEditBox = function(){
-	dojo.widget.HtmlWidget.call(this);
-	// mutable objects need to be in constructor to give each instance its own copy
-	this.history = [];
-	this.storage = document.createElement("span");
-}
-
-dojo.inherits(dojo.widget.html.InlineEditBox, dojo.widget.HtmlWidget);
-
-dojo.lang.extend(dojo.widget.html.InlineEditBox, {
-	templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlInlineEditBox.html"),
-	templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlInlineEditBox.css"),
-	widgetType: "InlineEditBox",
+dojo.widget.defineWidget(
+	"dojo.widget.InlineEditBox",
+	dojo.widget.HtmlWidget,
+	function(){
+		// mutable objects need to be in constructor to give each instance its own copy
+		this.history = [];
+	},
+{
+	templatePath: dojo.uri.dojoUri("src/widget/templates/InlineEditBox.html"),
+	templateCssPath: dojo.uri.dojoUri("src/widget/templates/InlineEditBox.css"),
 
 	form: null,
 	editBox: null,
@@ -42,7 +37,8 @@
 	submitButton: null,
 	cancelButton: null,
 	mode: "text",
-
+	name: "",
+	
 	minWidth: 100, //px. minimum width of edit box
 	minHeight: 200, //px. minimum width of edit box, if it's a TA
 
@@ -50,89 +46,86 @@
 	textValue: "",
 	defaultText: "",
 	doFade: false,
-
-	onSave: function(newValue, oldValue){},
+	
+	onSave: function(newValue, oldValue, name){},
 	onUndo: function(value){},
 
-	// overwrite buildRendering so we don't clobber our list
-	buildRendering: function(args, frag){
-		this.nodeRef = frag["dojo:"+this.widgetType.toLowerCase()]["nodeRef"];
-		var node = this.nodeRef;
-		if(node.normalize){ node.normalize(); }
-
-		dojo.widget.buildAndAttachTemplate(this);
-
-		this.editable = document.createElement("span");
-		// this.editable.appendChild(node.firstChild);
-		while(node.firstChild){
-			this.editable.appendChild(node.firstChild);
-		}
-		// this.textValue = this.editable.firstChild.nodeValue;
+	postCreate: function(args, frag){
+		// put original node back in the document, and attach handlers
+		// which hide it and display the editor
+		this.editable = this.getFragNodeRef(frag);
+		dojo.html.insertAfter(this.editable, this.form);
+		dojo.event.connect(this.editable, "onmouseover", this, "onMouseOver");
+		dojo.event.connect(this.editable, "onmouseout", this, "onMouseOut");
+		dojo.event.connect(this.editable, "onclick", this, "beginEdit");
+
 		this.textValue = dojo.string.trim(this.editable.innerHTML);
 		if(dojo.string.trim(this.textValue).length == 0){
 			this.editable.innerHTML = this.defaultText;
-		}
-		/*
-		if(node.hasChildNodes()) {
-			node.insertBefore(this.editable, node.firstChild);
-		} else {
-		}
-		*/
-		node.appendChild(this.editable);
-
-		// delay to try and show up before stylesheet
-		var _this = this;
-		setTimeout(function(){
-			_this.editable.appendChild(_this.edit);
-		}, 30);
-
-		dojo.event.connect(this.editable, "onmouseover", this, "mouseover");
-		dojo.event.connect(this.editable, "onmouseout", this, "mouseout");
-		dojo.event.connect(this.editable, "onclick", this, "beginEdit");
-
-		this.fillInTemplate(args, frag);
+		}		
 	},
-
-	mouseover: function(e){
+	
+	onMouseOver: function(){
 		if(!this.editing){
-			dojo.html.addClass(this.editable, "editableRegion");
-			if(this.mode == "textarea"){
-				dojo.html.addClass(this.editable, "editableTextareaRegion");
+			if (!this.isEnabled){
+				dojo.html.addClass(this.editable, "editableRegionDisabled");
+			} else {
+				dojo.html.addClass(this.editable, "editableRegion");
+				if(this.mode == "textarea"){
+					dojo.html.addClass(this.editable, "editableTextareaRegion");
+				}
 			}
 		}
+		
+		this.mouseover();
 	},
-
-	mouseout: function(e){
-		// if((e)&&(e.target != this.domNode)){ return; }
+	
+	mouseover: function(e){
+		// TODO: How do we deprecate a function without going into overkill with debug statements?
+		// dojo.deprecated("onMouseOver should be used instead of mouseover to listen for mouse events");
+	},
+	
+	onMouseOut: function(){
 		if(!this.editing){
 			dojo.html.removeClass(this.editable, "editableRegion");
 			dojo.html.removeClass(this.editable, "editableTextareaRegion");
+			dojo.html.removeClass(this.editable, "editableRegionDisabled");
 		}
+		
+		this.mouseout();
+	},
+	
+	mouseout: function(e){
+		// dojo.deprecated("onMouseOut should be used instead of mouseout to listen for mouse events");
 	},
 
+	// When user clicks the text, then start editing.
+	// Hide the text and display the form instead.
 	beginEdit: function(e){
-		if(this.editing){ return; }
-		this.mouseout();
+		if(this.editing || !this.isEnabled){ return; }
+		this.onMouseOut();
 		this.editing = true;
 
+		// setup the form's <input> or <textarea> field, as specified by mode
 		var ee = this[this.mode.toLowerCase()];
-
-		ee.style.display = "";
 		ee.value = dojo.string.trim(this.textValue);
-		ee.style.fontSize = dojo.style.getStyle(this.editable, "font-size");
-		ee.style.fontWeight = dojo.style.getStyle(this.editable, "font-weight");
-		ee.style.fontStyle = dojo.style.getStyle(this.editable, "font-style");
-		//this.text.style.fontFamily = dojo.dom.getStyle(this.editable, "font-family");
-
-		ee.style.width = Math.max(dojo.html.getInnerWidth(this.editable), this.minWidth) + "px";
-		// ee.style.width = "100%";
-
+		ee.style.fontSize = dojo.html.getStyle(this.editable, "font-size");
+		ee.style.fontWeight = dojo.html.getStyle(this.editable, "font-weight");
+		ee.style.fontStyle = dojo.html.getStyle(this.editable, "font-style");
+		var bb = dojo.html.getBorderBox(this.editable);
+		ee.style.width = Math.max(bb.width, this.minWidth) + "px";
 		if(this.mode.toLowerCase()=="textarea"){
 			ee.style.display = "block";
-			ee.style.height = Math.max(dojo.html.getInnerHeight(this.editable), this.minHeight) + "px";
+			ee.style.height = Math.max(bb.height, this.minHeight) + "px";
+		} else {
+			ee.style.display = "";
 		}
+
+		// show the edit form and hide the read only version of the text
+		this.form.style.display = "";
 		this.editable.style.display = "none";
-		this.nodeRef.appendChild(this.form);
+
+		ee.focus();
 		ee.select();
 		this.submitButton.disabled = true;
 	},
@@ -145,9 +138,11 @@
 			(dojo.string.trim(ee.value) != "")){
 			this.doFade = true;
 			this.history.push(this.textValue);
-			this.onSave(ee.value, this.textValue);
+			this.onSave(ee.value, this.textValue, this.name);
 			this.textValue = ee.value;
-			this.editable.innerHTML = this.textValue;
+			this.editable.innerHTML = "";
+			var textNode = document.createTextNode( this.textValue );
+			this.editable.appendChild( textNode );
 		}else{
 			this.doFade = false;
 		}
@@ -157,7 +152,7 @@
 	cancelEdit: function(e){
 		if(!this.editing){ return false; }
 		this.editing = false;
-		this.nodeRef.removeChild(this.form);
+		this.form.style.display="none";
 		this.editable.style.display = "";
 		return true;
 	},
@@ -165,13 +160,14 @@
 	finishEdit: function(e){
 		if(!this.cancelEdit(e)){ return; }
 		if(this.doFade) {
-			dojo.fx.highlight(this.editable, dojo.graphics.color.hex2rgb("#ffc"), 700, 300);
+			dojo.lfx.highlight(this.editable, dojo.gfx.color.hex2rgb("#ffc"), 700).play(300);
 		}
 		this.doFade = false;
 	},
-
+	
 	setText: function(txt){
 		// sets the text without informing the server
+		txt = "" + txt;
 		var tt = dojo.string.trim(txt);
 		this.textValue = tt
 		this.editable.innerHTML = tt;
@@ -179,10 +175,12 @@
 
 	undo: function(){
 		if(this.history.length > 0){
+			var curValue = this.textValue;
 			var value = this.history.pop();
 			this.editable.innerHTML = value;
 			this.textValue = value;
 			this.onUndo(value);
+			this.onSave(value, curValue, this.name);
 		}
 	},
 
@@ -192,5 +190,23 @@
 			(dojo.string.trim(ee.value) != "")){
 			this.submitButton.disabled = false;
 		}
+	},
+	
+	disable: function(){
+		this.submitButton.disabled = true;
+		this.cancelButton.disabled = true;
+		var ee = this[this.mode.toLowerCase()];
+		ee.disabled = true;
+		
+		dojo.widget.Widget.prototype.disable.call(this);
+	},
+	
+	enable: function(){
+		this.checkForValueChange();
+		this.cancelButton.disabled = false;
+		var ee = this[this.mode.toLowerCase()];
+		ee.disabled = false;
+		
+		dojo.widget.Widget.prototype.enable.call(this);
 	}
 });

Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/IntegerTextbox.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/IntegerTextbox.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/IntegerTextbox.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/IntegerTextbox.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,66 @@
+/*
+	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.IntegerTextbox");
+
+dojo.require("dojo.widget.ValidationTextbox");
+dojo.require("dojo.validate.common");
+
+/*
+  ****** IntegerTextbox ******
+
+  A subclass of ValidationTextbox.
+  Over-rides isValid/isInRange to test for integer input.
+  Has 4 new properties that can be specified as attributes in the markup.
+
+  @attr signed     The leading plus-or-minus sign. Can be true or false, default is either.
+  @attr separator  The character used as the thousands separator.  Default is no separator.
+  @attr min  Minimum signed value.  Default is -Infinity
+  @attr max  Maximum signed value.  Default is +Infinity
+*/
+dojo.widget.defineWidget(
+	"dojo.widget.IntegerTextbox",
+	dojo.widget.ValidationTextbox,
+	{
+		mixInProperties: function(localProperties, frag){
+			// First initialize properties in super-class.
+			dojo.widget.IntegerTextbox.superclass.mixInProperties.apply(this, arguments);
+	
+			// Get properties from markup attributes, and assign to flags object.
+			if((localProperties.signed == "true")||
+				(localProperties.signed == "always")){
+				this.flags.signed = true;
+			}else if((localProperties.signed == "false")||
+					(localProperties.signed == "never")){
+				this.flags.signed = false;
+				this.flags.min = 0;
+			}else{
+				this.flags.signed = [ true, false ]; // optional
+			}
+			if(localProperties.separator){ 
+				this.flags.separator = localProperties.separator;
+			}
+			if(localProperties.min){ 
+				this.flags.min = parseInt(localProperties.min);
+			}
+			if(localProperties.max){ 
+				this.flags.max = parseInt(localProperties.max);
+			}
+		},
+
+		// Over-ride for integer validation
+		isValid: function(){
+			return dojo.validate.isInteger(this.textbox.value, this.flags);
+		},
+		isInRange: function(){
+			return dojo.validate.isInRange(this.textbox.value, this.flags);
+		}
+	}
+);

Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/IntegerTextbox.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/InternetTextbox.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/InternetTextbox.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/InternetTextbox.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/InternetTextbox.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,168 @@
+/*
+	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.InternetTextbox");
+
+dojo.require("dojo.widget.ValidationTextbox");
+dojo.require("dojo.validate.web");
+
+dojo.widget.defineWidget(
+	"dojo.widget.IpAddressTextbox",
+	dojo.widget.ValidationTextbox,
+	{
+		// summary:  A Textbox which tests for a valid IP address
+		// description:  Can specify formats for ipv4 or ipv6 as attributes in the markup.
+		//
+		// allowDottedDecimal  true or false, default is true.
+		// allowDottedHex      true or false, default is true.
+		// allowDottedOctal    true or false, default is true.
+		// allowDecimal        true or false, default is true.
+		// allowHex            true or false, default is true.
+		// allowIPv6           true or false, default is true.
+		// allowHybrid         true or false, default is true.
+
+		mixInProperties: function(/*Object*/localProperties){
+			// summary: see dojo.widget.Widget
+
+			// First initialize properties in super-class.
+			dojo.widget.IpAddressTextbox.superclass.mixInProperties.apply(this, arguments);
+
+			// Get properties from markup attributes, and assign to flags object.
+			if(localProperties.allowdotteddecimal){ 
+				this.flags.allowDottedDecimal = (localProperties.allowdotteddecimal == "true");
+			}
+			if(localProperties.allowdottedhex){ 
+				this.flags.allowDottedHex = (localProperties.allowdottedhex == "true");
+			}
+			if(localProperties.allowdottedoctal){ 
+				this.flags.allowDottedOctal = (localProperties.allowdottedoctal == "true");
+			}
+			if(localProperties.allowdecimal){ 
+				this.flags.allowDecimal = (localProperties.allowdecimal == "true");
+			}
+			if(localProperties.allowhex){ 
+				this.flags.allowHex = (localProperties.allowhex == "true");
+			}
+			if(localProperties.allowipv6){ 
+				this.flags.allowIPv6 = (localProperties.allowipv6 == "true");
+			}
+			if(localProperties.allowhybrid){ 
+				this.flags.allowHybrid = (localProperties.allowhybrid == "true");
+			}
+		},
+
+		isValid: function(){ 
+			// summary: see dojo.widget.ValidationTextbox
+			return dojo.validate.isIpAddress(this.textbox.value, this.flags);
+		}
+	}
+);
+
+dojo.widget.defineWidget(
+	"dojo.widget.UrlTextbox",
+	dojo.widget.IpAddressTextbox,
+	{
+		// summary:  A Textbox which tests for a valid URL
+		// scheme        Can be true or false.  If omitted the scheme is optional.
+		// allowIP       Allow an IP address for hostname.  Default is true.
+		// allowLocal    Allow the host to be "localhost".  Default is false.
+		// allowCC       Allow 2 letter country code domains.  Default is true.
+		// allowGeneric  Allow generic domains.  Can be true or false, default is true.
+
+		mixInProperties: function(/*Object*/localProperties){
+			// summary: see dojo.widget.Widget
+
+			// First initialize properties in super-class.
+			dojo.widget.UrlTextbox.superclass.mixInProperties.apply(this, arguments);
+
+			// Get properties from markup attributes, and assign to flags object.
+			if ( localProperties.scheme ) { 
+				this.flags.scheme = ( localProperties.scheme == "true" );
+			}
+			if ( localProperties.allowip ) { 
+				this.flags.allowIP = ( localProperties.allowip == "true" );
+			}
+			if ( localProperties.allowlocal ) { 
+				this.flags.allowLocal = ( localProperties.allowlocal == "true" );
+			}
+			if ( localProperties.allowcc ) { 
+				this.flags.allowCC = ( localProperties.allowcc == "true" );
+			}
+			if ( localProperties.allowgeneric ) { 
+				this.flags.allowGeneric = ( localProperties.allowgeneric == "true" );
+			}
+		},
+
+		isValid: function(){ 
+			// summary: see dojo.widget.ValidationTextbox
+			return dojo.validate.isUrl(this.textbox.value, this.flags);
+		}
+	}
+);
+
+//FIXME: DOC: need more consistent explanation on whether attributes are inherited from the parent.  Some make sense, some don't?
+
+dojo.widget.defineWidget(
+	"dojo.widget.EmailTextbox",
+	dojo.widget.UrlTextbox,
+	{
+		// summary:  A Textbox which tests for a valid email address
+		// description:
+		//  Can use all markup attributes/properties of UrlTextbox except scheme.
+		//
+		// allowCruft: Allow address like <ma...@yahoo.com>.  Default is false.
+
+		mixInProperties: function(/*Object*/localProperties){
+			// summary: see dojo.widget.Widget
+
+			// First initialize properties in super-class.
+			dojo.widget.EmailTextbox.superclass.mixInProperties.apply(this, arguments);
+	
+			// Get properties from markup attributes, and assign to flags object.
+			if(localProperties.allowcruft){ 
+				this.flags.allowCruft = (localProperties.allowcruft == "true");
+			}
+		},
+
+		isValid: function(){
+			// summary: see dojo.widget.ValidationTextbox
+			return dojo.validate.isEmailAddress(this.textbox.value, this.flags);
+		}
+	}
+);
+
+//TODO: perhaps combine with EmailTextbox?
+dojo.widget.defineWidget(
+	"dojo.widget.EmailListTextbox",
+	dojo.widget.EmailTextbox,
+	{
+		// summary:  A Textbox which tests for a list of valid email addresses
+		//
+		// listSeparator:  The character used to separate email addresses.  
+		//    Default is ";", ",", "\n" or " "
+
+		mixInProperties: function(/*Object*/localProperties){
+			// summary: see dojo.widget.Widget
+
+			// First initialize properties in super-class.
+			dojo.widget.EmailListTextbox.superclass.mixInProperties.apply(this, arguments);
+	
+			// Get properties from markup attributes, and assign to flags object.
+			if(localProperties.listseparator){ 
+				this.flags.listSeparator = localProperties.listseparator;
+			}
+		},
+
+		isValid: function(){
+			// summary: see dojo.widget.ValidationTextbox
+			return dojo.validate.isEmailAddressList(this.textbox.value, this.flags);
+		}
+	}
+);

Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/InternetTextbox.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/LayoutContainer.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/LayoutContainer.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/LayoutContainer.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/LayoutContainer.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,97 @@
+/*
+	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.LayoutContainer");
+
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.html.layout");
+
+// summary
+//	Provides Delphi-style panel layout semantics.
+//
+// details
+//	A LayoutContainer is a box with a specified size (like style="width: 500px; height: 500px;"),
+//	that contains children widgets marked with "layoutAlign" of "left", "right", "bottom", "top", and "client".
+//	It takes it's children marked as left/top/bottom/right, and lays them out along the edges of the box,
+//	and then it takes the child marked "client" and puts it into the remaining space in the middle.
+//
+//  Left/right positioning is similar to CSS's "float: left" and "float: right",
+//	and top/bottom positioning would be similar to "float: top" and "float: bottom", if there were such
+//	CSS.
+//
+//	Note that there can only be one client element, but there can be multiple left, right, top,
+//	or bottom elements.
+//
+// usage
+//	<style>
+//		html, body{ height: 100%; width: 100%; }
+//	</style>
+//	<div dojoType="LayoutContainer" style="width: 100%; height: 100%">
+//		<div dojoType="ContentPane" layoutAlign="top">header text</div>
+//		<div dojoType="ContentPane" layoutAlign="left" style="width: 200px;">table of contents</div>
+//		<div dojoType="ContentPane" layoutAlign="client">client area</div>
+//	</div>
+dojo.widget.defineWidget(
+	"dojo.widget.LayoutContainer",
+	dojo.widget.HtmlWidget,
+{
+	isContainer: true,
+
+	// String
+	//	- If the value is "top-bottom", then LayoutContainer will first position the "top" and "bottom" aligned elements,
+	//	to and then put the left and right aligned elements in the remaining space, between the top and the bottom elements.
+	//	It aligns the client element at the very end, in the remaining space.
+	//
+	//	- If the value is "left-right", then it first positions the "left" and "right" elements, and then puts the
+	//	"top" and "bottom" elements in the remaining space, between the left and the right elements.
+	//	It aligns the client element at the very end, in the remaining space.
+	//
+	//	- If the value is "none", then it will lay out each child in the natural order the children occur in.
+	//	Basically each child is laid out into the "remaining space", where "remaining space" is initially
+	//	the content area of this widget, but is reduced to a smaller rectangle each time a child is added.
+	//	
+	layoutChildPriority: 'top-bottom',
+
+	postCreate: function(){
+		dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);
+	},
+
+	addChild: function(child, overrideContainerNode, pos, ref, insertIndex){
+		dojo.widget.LayoutContainer.superclass.addChild.call(this, child, overrideContainerNode, pos, ref, insertIndex);
+		dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);
+	},
+
+	removeChild: function(pane){
+		dojo.widget.LayoutContainer.superclass.removeChild.call(this,pane);
+		dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);
+	},
+
+	onResized: function(){
+		dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);
+	},
+
+	show: function(){
+		// If this node was created while display=="none" then it
+		// hasn't been laid out yet.  Do that now.
+		this.domNode.style.display="";
+		this.checkSize();
+		this.domNode.style.display="none";
+		this.domNode.style.visibility="";
+
+		dojo.widget.LayoutContainer.superclass.show.call(this);
+	}
+});
+
+// This argument can be specified for the children of a LayoutContainer.
+// Since any widget can be specified as a LayoutContainer child, mix it
+// into the base widget class.  (This is a hack, but it's effective.)
+dojo.lang.extend(dojo.widget.Widget, {
+	layoutAlign: 'none'
+});

Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/LayoutContainer.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/LinkPane.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/LinkPane.js?view=diff&rev=474551&r1=474550&r2=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/LinkPane.js (original)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/LinkPane.js Mon Nov 13 14:54:45 2006
@@ -1,5 +1,5 @@
 /*
-	Copyright (c) 2004-2005, The Dojo Foundation
+	Copyright (c) 2004-2006, The Dojo Foundation
 	All Rights Reserved.
 
 	Licensed under the Academic Free License version 2.1 or above OR the
@@ -11,7 +11,32 @@
 dojo.provide("dojo.widget.LinkPane");
 
 dojo.require("dojo.widget.*");
-dojo.requireAfterIf("html", "dojo.widget.html.LinkPane");
-dojo.widget.tags.addParseTreeHandler("dojo:LinkPane");
+dojo.require("dojo.widget.ContentPane");
+dojo.require("dojo.html.style");
 
-// NOTE: there's no stub file for this widget
+// summary
+//	LinkPane is just a ContentPane that loads data remotely (via the href attribute),
+//	and has markup similar to an anchor.  The anchor's body (the words between <a> and </a>)
+//	become the label of the widget (used for TabContainer, AccordionContainer, etc.)
+// usage
+//	<a href="foo.html">my label</a>
+dojo.widget.defineWidget(
+	"dojo.widget.LinkPane",
+	dojo.widget.ContentPane,
+{
+	// 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);
+	}
+});

Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/Manager.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/Manager.js?view=diff&rev=474551&r1=474550&r2=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/Manager.js (original)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/Manager.js Mon Nov 13 14:54:45 2006
@@ -1,5 +1,5 @@
 /*
-	Copyright (c) 2004-2005, The Dojo Foundation
+	Copyright (c) 2004-2006, The Dojo Foundation
 	All Rights Reserved.
 
 	Licensed under the Academic Free License version 2.1 or above OR the
@@ -9,7 +9,8 @@
 */
 
 dojo.provide("dojo.widget.Manager");
-dojo.require("dojo.lang");
+dojo.require("dojo.lang.array");
+dojo.require("dojo.lang.func");
 dojo.require("dojo.event.*");
 
 // Manager class
@@ -24,13 +25,21 @@
 	var renderPrefixCache = [];
 
 	this.getUniqueId = function (widgetType) {
-		return widgetType + "_" + (widgetTypeCtr[widgetType] != undefined ?
+		var widgetId;
+		do{
+			widgetId = widgetType + "_" + (widgetTypeCtr[widgetType] != undefined ?
 			++widgetTypeCtr[widgetType] : widgetTypeCtr[widgetType] = 0);
+		}while(this.getWidgetById(widgetId));
+		return widgetId;
 	}
 
 	this.add = function(widget){
-		dojo.profile.start("dojo.widget.manager.add");
+		//dojo.profile.start("dojo.widget.manager.add");
 		this.widgets.push(widget);
+		// Opera9 uses ID (caps)
+		if(!widget.extraArgs["id"]){
+			widget.extraArgs["id"] = widget.extraArgs["ID"];
+		}
 		// FIXME: the rest of this method is very slow!
 		if(widget.widgetId == ""){
 			if(widget["id"]){
@@ -47,7 +56,7 @@
 		this.widgetIds[widget.widgetId] = widget;
 		// Widget.destroy already calls removeById(), so we don't need to
 		// connect() it here
-		dojo.profile.end("dojo.widget.manager.add");
+		//dojo.profile.end("dojo.widget.manager.add");
 	}
 
 	this.destroyAll = function(){
@@ -63,13 +72,21 @@
 	// FIXME: we should never allow removal of the root widget until all others
 	// are removed!
 	this.remove = function(widgetIndex){
-		var tw = this.widgets[widgetIndex].widgetId;
-		delete this.widgetIds[tw];
-		this.widgets.splice(widgetIndex, 1);
+		if(dojo.lang.isNumber(widgetIndex)){
+			var tw = this.widgets[widgetIndex].widgetId;
+			delete this.widgetIds[tw];
+			this.widgets.splice(widgetIndex, 1);
+		}else{
+			this.removeById(widgetIndex);
+		}
 	}
 	
 	// FIXME: suboptimal performance
 	this.removeById = function(id) {
+		if(!dojo.lang.isString(id)){
+			id = id["widgetId"];
+			if(!id){ dojo.debug("invalid widget or id passed to removeById"); return; }
+		}
 		for (var i=0; i<this.widgets.length; i++){
 			if(this.widgets[i].widgetId == id){
 				this.remove(i);
@@ -79,49 +96,64 @@
 	}
 
 	this.getWidgetById = function(id){
-		return this.widgetIds[id];
+		if(dojo.lang.isString(id)){
+			return this.widgetIds[id];
+		}
+		return id;
 	}
 
 	this.getWidgetsByType = function(type){
 		var lt = type.toLowerCase();
+		var getType = (type.indexOf(":") < 0 ? 
+			function(x) { return x.widgetType.toLowerCase(); } :
+			function(x) { return x.getNamespacedType(); }
+		);
 		var ret = [];
 		dojo.lang.forEach(this.widgets, function(x){
-			if(x.widgetType.toLowerCase() == lt){
-				ret.push(x);
-			}
+			if(getType(x) == lt){ret.push(x);}
 		});
 		return ret;
 	}
 
-	this.getWidgetsOfType = function (id) {
-		dj_deprecated("getWidgetsOfType is depecrecated, use getWidgetsByType");
-		return dojo.widget.manager.getWidgetsByType(id);
-	}
-
-	this.getWidgetsByFilter = function(unaryFunc){
+	this.getWidgetsByFilter = function(unaryFunc, onlyOne){
 		var ret = [];
-		dojo.lang.forEach(this.widgets, function(x){
+		dojo.lang.every(this.widgets, function(x){
 			if(unaryFunc(x)){
 				ret.push(x);
+				if(onlyOne){return false;}
 			}
+			return true;
 		});
-		return ret;
+		return (onlyOne ? ret[0] : ret);
 	}
 
 	this.getAllWidgets = function() {
 		return this.widgets.concat();
 	}
 
+	//	added, trt 2006-01-20
+	this.getWidgetByNode = function(/* DOMNode */ node){
+		var w=this.getAllWidgets();
+		node = dojo.byId(node);
+		for(var i=0; i<w.length; i++){
+			if(w[i].domNode==node){
+				return w[i];
+			}
+		}
+		return null;
+	}
+
 	// shortcuts, baby
 	this.byId = this.getWidgetById;
 	this.byType = this.getWidgetsByType;
 	this.byFilter = this.getWidgetsByFilter;
+	this.byNode = this.getWidgetByNode;
 
 	// map of previousally discovered implementation names to constructors
 	var knownWidgetImplementations = {};
 
 	// support manually registered widget packages
-	var widgetPackages = ["dojo.widget", "dojo.webui.widgets"];
+	var widgetPackages = ["dojo.widget"];
 	for (var i=0; i<widgetPackages.length; i++) {
 		// convenience for checking if a package exists (reverse lookup)
 		widgetPackages[widgetPackages[i]] = true;
@@ -138,142 +170,194 @@
 		return dojo.lang.map(widgetPackages, function(elt) { return(elt!==true ? elt : undefined); });
 	}
 	
-	this.getImplementation = function(widgetName, ctorObject, mixins){
+	this.getImplementation = function(widgetName, ctorObject, mixins, ns){
 		// try and find a name for the widget
-		var impl = this.getImplementationName(widgetName);
+		var impl = this.getImplementationName(widgetName, ns);
 		if(impl){ 
 			// var tic = new Date();
-			var ret = new impl(ctorObject);
+			var ret = ctorObject ? new impl(ctorObject) : new impl();
 			// dojo.debug(new Date() - tic);
 			return ret;
 		}
 	}
 
-	this.getImplementationName = function(widgetName){
+	function buildPrefixCache() {
+		for(var renderer in dojo.render){
+			if(dojo.render[renderer]["capable"] === true){
+				var prefixes = dojo.render[renderer].prefixes;
+				for(var i=0; i<prefixes.length; i++){
+					renderPrefixCache.push(prefixes[i].toLowerCase());
+				}
+			}
+		}
+		// make sure we don't HAVE to prefix widget implementation names
+		// with anything to get them to render
+		//renderPrefixCache.push("");
+		// empty prefix is included automatically
+	}
+	
+	var findImplementationInModule = function(lowerCaseWidgetName, module){
+		if(!module){return null;}
+		for(var i=0, l=renderPrefixCache.length, widgetModule; i<=l; i++){
+			widgetModule = (i<l ? module[renderPrefixCache[i]] : module);
+			if(!widgetModule){continue;}
+			for(var name in widgetModule){
+				if(name.toLowerCase() == lowerCaseWidgetName){
+					return widgetModule[name];
+				}
+			}
+		}
+		return null;
+	}
+
+	var findImplementation = function(lowerCaseWidgetName, moduleName){
+		// locate registered widget module
+		var module = dojo.evalObjPath(moduleName, false);
+		// locate a widget implementation in the registered module for our current rendering environment
+		return (module ? findImplementationInModule(lowerCaseWidgetName, module) : null);
+	}
+
+	this.getImplementationName = function(widgetName, ns){
 		/*
-		 * This is the overly-simplistic implemention of getImplementation (har
-		 * har). In the future, we are going to want something that allows more
-		 * freedom of expression WRT to specifying different specializations of
-		 * a widget.
-		 *
-		 * Additionally, this implementation treats widget names as case
-		 * insensitive, which does not necessarialy mesh with the markup which
-		 * can construct a widget.
+		 * Locate an implementation (constructor) for 'widgetName' in namespace 'ns' 
+		 * widgetNames are case INSENSITIVE
+		 * 
+		 * 1. Return value from implementation cache, if available, for quick turnaround.
+		 * 2. Locate a namespace registration for 'ns'
+		 * 3. If no namespace found, register the conventional one (ns.widget)
+		 * 4. Allow the namespace resolver (if any) to load a module for this widget.
+		 * 5. Permute the widget name and capable rendering prefixes to locate, cache, and return 
+		 *    an appropriate widget implementation.
+		 * 6. If no implementation is found, attempt to load the namespace manifest,
+		 *    and then look again for an implementation to cache and return.
+		 * 7. Use the deprecated widgetPackages registration system to attempt to locate the widget
+		 * 8. Fail
 		 */
-
 		var lowerCaseWidgetName = widgetName.toLowerCase();
 
-		var impl = knownWidgetImplementations[lowerCaseWidgetName];
+		// default to dojo namespace
+		ns=ns||"dojo";
+		// use cache if available
+		var imps = knownWidgetImplementations[ns] || (knownWidgetImplementations[ns]={});
+		//if(!knownWidgetImplementations[ns]){knownWidgetImplementations[ns]={};}
+		var impl = imps[lowerCaseWidgetName];
 		if(impl){
 			return impl;
 		}
-
-		// first store a list of the render prefixes we are capable of rendering
+		
+		// (one time) store a list of the render prefixes we are capable of rendering
 		if(!renderPrefixCache.length){
-			for(var renderer in dojo.render){
-				if(dojo.render[renderer]["capable"] === true){
-					var prefixes = dojo.render[renderer].prefixes;
-					for(var i = 0; i < prefixes.length; i++){
-						renderPrefixCache.push(prefixes[i].toLowerCase());
-					}
-				}
-			}
-			// make sure we don't HAVE to prefix widget implementation names
-			// with anything to get them to render
-			renderPrefixCache.push("");
-		}
-
-		// look for a rendering-context specific version of our widget name
-		for(var i = 0; i < widgetPackages.length; i++){
-			var widgetPackage = dojo.evalObjPath(widgetPackages[i]);
-			if(!widgetPackage) { continue; }
-
-			for (var j = 0; j < renderPrefixCache.length; j++) {
-				if (!widgetPackage[renderPrefixCache[j]]) { continue; }
-				for (var widgetClass in widgetPackage[renderPrefixCache[j]]) {
-					if (widgetClass.toLowerCase() != lowerCaseWidgetName) { continue; }
-					knownWidgetImplementations[lowerCaseWidgetName] =
-						widgetPackage[renderPrefixCache[j]][widgetClass];
-					return knownWidgetImplementations[lowerCaseWidgetName];
-				}
-			}
+			buildPrefixCache();
+		}
+
+		// lookup namespace
+		var nsObj = dojo.ns.get(ns);
+		if(!nsObj){
+			// default to <ns>.widget by convention
+			dojo.ns.register(ns, ns + '.widget');
+			nsObj = dojo.ns.get(ns);
+		}
+		
+		// allow the namespace to resolve the widget module
+		if(nsObj){nsObj.resolve(widgetName);}
 
-			for (var j = 0; j < renderPrefixCache.length; j++) {
-				for (var widgetClass in widgetPackage) {
-					if (widgetClass.toLowerCase() !=
-						(renderPrefixCache[j] + lowerCaseWidgetName)) { continue; }
+		// locate a widget implementation in the registered module for our current rendering environment
+		impl = findImplementation(lowerCaseWidgetName, nsObj.module);
+		if(impl){return(imps[lowerCaseWidgetName] = impl)};
+
+		// try to load a manifest to resolve this implemenation
+		nsObj = dojo.ns.require(ns);
+		if((nsObj)&&(nsObj.resolver)){
+			nsObj.resolve(widgetName);
+			impl = findImplementation(lowerCaseWidgetName, nsObj.module);
+			if(impl){return(imps[lowerCaseWidgetName] = impl)};
+		}
 	
-					knownWidgetImplementations[lowerCaseWidgetName] =
-						widgetPackage[widgetClass];
-					return knownWidgetImplementations[lowerCaseWidgetName];
-				}
-			}
+		// this is an error condition under new rules
+		dojo.deprecated('dojo.widget.Manager.getImplementationName', 
+			'Could not locate widget implementation for "' + widgetName + '" in "' + nsObj.module + '" registered to namespace "' + nsObj.name + '". '										
+			+ "Developers must specify correct namespaces for all non-Dojo widgets", "0.5");
+
+		// backward compat: if the user has not specified any namespace and their widget is not in dojo.widget.*
+		// search registered widget packages [sic]
+		// note: registerWidgetPackage itself is now deprecated 
+		for(var i=0; i<widgetPackages.length; i++){
+			impl = findImplementation(lowerCaseWidgetName, widgetPackages[i]);
+			if(impl){return(imps[lowerCaseWidgetName] = impl)};
 		}
 		
-		throw new Error('Could not locate "' + widgetName + '" class');
+		throw new Error('Could not locate widget implementation for "' + widgetName + '" in "' + nsObj.module + '" registered to namespace "' + nsObj.name + '"');
 	}
 
-	// FIXME: does it even belong in this name space?
+	// FIXME: does it even belong in this module?
 	// NOTE: this method is implemented by DomWidget.js since not all
 	// hostenv's would have an implementation.
 	/*this.getWidgetFromPrimitive = function(baseRenderType){
-		dj_unimplemented("dojo.widget.manager.getWidgetFromPrimitive");
+		dojo.unimplemented("dojo.widget.manager.getWidgetFromPrimitive");
 	}
 
 	this.getWidgetFromEvent = function(nativeEvt){
-		dj_unimplemented("dojo.widget.manager.getWidgetFromEvent");
+		dojo.unimplemented("dojo.widget.manager.getWidgetFromEvent");
 	}*/
 
 	// Catch window resize events and notify top level widgets
 	this.resizing=false;
-	this.onResized = function() {
+	this.onWindowResized = function(){
 		if(this.resizing){
 			return;	// duplicate event
 		}
-		try {
+		try{
 			this.resizing=true;
-			for(var id in this.topWidgets) {
+			for(var id in this.topWidgets){
 				var child = this.topWidgets[id];
-				//dojo.debug("root resizing child " + child.widgetId);
-				if ( child.onResized ) {
-					child.onResized();
+				if(child.checkSize ){
+					child.checkSize();
 				}
 			}
-		} finally {
+		}catch(e){
+		}finally{
 			this.resizing=false;
 		}
 	}
 	if(typeof window != "undefined") {
-		dojo.addOnLoad(this, 'onResized');							// initial sizing
-		dojo.event.connect(window, 'onresize', this, 'onResized');	// window resize
+		dojo.addOnLoad(this, 'onWindowResized');							// initial sizing
+		dojo.event.connect(window, 'onresize', this, 'onWindowResized');	// window resize
 	}
 
 	// FIXME: what else?
-}
+};
 
-// copy the methods from the default manager (this) to the widget namespace
-dojo.widget.getUniqueId = function () { return dojo.widget.manager.getUniqueId.apply(dojo.widget.manager, arguments); }
-dojo.widget.addWidget = function () { return dojo.widget.manager.add.apply(dojo.widget.manager, arguments); }
-dojo.widget.destroyAllWidgets = function () { return dojo.widget.manager.destroyAll.apply(dojo.widget.manager, arguments); }
-dojo.widget.removeWidget = function () { return dojo.widget.manager.remove.apply(dojo.widget.manager, arguments); }
-dojo.widget.removeWidgetById = function () { return dojo.widget.manager.removeById.apply(dojo.widget.manager, arguments); }
-dojo.widget.getWidgetById = function () { return dojo.widget.manager.getWidgetById.apply(dojo.widget.manager, arguments); }
-dojo.widget.getWidgetsByType = function () { return dojo.widget.manager.getWidgetsByType.apply(dojo.widget.manager, arguments); }
-dojo.widget.getWidgetsByFilter = function () { return dojo.widget.manager.getWidgetsByFilter.apply(dojo.widget.manager, arguments); }
-dojo.widget.byId = function () { return dojo.widget.manager.getWidgetById.apply(dojo.widget.manager, arguments); }
-dojo.widget.byType = function () { return dojo.widget.manager.getWidgetsByType.apply(dojo.widget.manager, arguments); }
-dojo.widget.byFilter = function () { return dojo.widget.manager.getWidgetsByFilter.apply(dojo.widget.manager, arguments); }
-dojo.widget.all = function (n) {
-	var widgets = dojo.widget.manager.getAllWidgets.apply(dojo.widget.manager, arguments);
-	if(arguments.length > 0) {
-		return widgets[n];
-	}
-	return widgets;
-}
-dojo.widget.registerWidgetPackage = function () { return dojo.widget.manager.registerWidgetPackage.apply(dojo.widget.manager, arguments); }
-dojo.widget.getWidgetImplementation = function () { return dojo.widget.manager.getImplementation.apply(dojo.widget.manager, arguments); }
-dojo.widget.getWidgetImplementationName = function () { return dojo.widget.manager.getImplementationName.apply(dojo.widget.manager, arguments); }
-
-dojo.widget.widgets = dojo.widget.manager.widgets;
-dojo.widget.widgetIds = dojo.widget.manager.widgetIds;
-dojo.widget.root = dojo.widget.manager.root;
+(function(){
+	var dw = dojo.widget;
+	var dwm = dw.manager;
+	var h = dojo.lang.curry(dojo.lang, "hitch", dwm);
+	var g = function(oldName, newName){
+		dw[(newName||oldName)] = h(oldName);
+	}
+	// copy the methods from the default manager (this) to the widget namespace
+	g("add", "addWidget");
+	g("destroyAll", "destroyAllWidgets");
+	g("remove", "removeWidget");
+	g("removeById", "removeWidgetById");
+	g("getWidgetById");
+	g("getWidgetById", "byId");
+	g("getWidgetsByType");
+	g("getWidgetsByFilter");
+	g("getWidgetsByType", "byType");
+	g("getWidgetsByFilter", "byFilter");
+	g("getWidgetByNode", "byNode");
+	dw.all = function(n){
+		var widgets = dwm.getAllWidgets.apply(dwm, arguments);
+		if(arguments.length > 0) {
+			return widgets[n];
+		}
+		return widgets;
+	}
+	g("registerWidgetPackage");
+	g("getImplementation", "getWidgetImplementation");
+	g("getImplementationName", "getWidgetImplementationName");
+
+	dw.widgets = dwm.widgets;
+	dw.widgetIds = dwm.widgetIds;
+	dw.root = dwm.root;
+})();