tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkuhn...@apache.org
Subject svn commit: r498423 [9/30] - in /tapestry/tapestry4/trunk: .settings/ eclipse/ tapestry-examples/TimeTracker/src/context/WEB-INF/ tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/dao/ tapestry-examples/TimeTracker/src/java/org/apa...
Date Sun, 21 Jan 2007 18:26:26 GMT
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/debug/deep.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/debug/deep.html?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/debug/deep.html (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/debug/deep.html Sun Jan 21 10:25:59 2007
@@ -0,0 +1,362 @@
+<html>
+<head>
+<title>Deep Debugger</title>
+<script>
+
+var tableRows = {};
+var tableCels = {};
+var tableObjs = {};
+var tablesBuilt = {};
+var tableShows = {};
+var tableHides = {};
+
+// IE: nodes w/id need to be redeclared or getElementById is b0rked
+var frame = null;
+
+window.onload = function(){
+	// if IE loads this page too quickly (instantly) then 
+	// window.debugVar might not have been set
+	window.setTimeout(startMeUp, 100);
+}
+
+function startMeUp(){
+	frame = document.getElementById('frame');
+	// GET string 
+	var index = location.search.split("=").pop();
+	var debugObj = window.opener.dojo.debugDeep;
+	var debugVar = debugObj.debugVars[index] || window.debugVar;
+	buildTable('root', frame, debugVar);
+}
+
+function buildTable(path, parent, obj){
+	var keys = [];
+	var vals = [];
+	for(var prop in obj){
+		keys.push(prop);
+		try {
+			vals[prop] = obj[prop];
+		} catch(E) {
+			vals[prop] = 'ERROR: ' + E.message;
+		}
+	}
+	keys.sort(keySorter);
+
+	if (!keys.length){
+
+		var div = document.createElement('div');
+		div.appendChild(document.createTextNode('Object has no properties.'));
+
+		parent.appendChild(div);
+		return;
+	}
+
+
+	var t = document.createElement('table');
+	t.border = "1";
+
+	var tb = document.createElement('tbody');
+	t.appendChild(tb);
+
+
+	for(var i = 0; i < keys.length; i++) {
+		buildTableRow(path+'-'+keys[i], tb, keys[i], vals[keys[i]]);
+	}
+
+	if (path == 'root'){
+		//t.style.width = '90%';
+	}
+	t.style.width = '100%';
+
+	parent.appendChild(t);
+
+	tablesBuilt[path] = true;
+}
+
+function buildTableRow(path, tb, name, value) {
+
+	var simpleType = typeof(value);
+	var createSubrow = (simpleType == 'object');
+	var complexType = simpleType;
+
+	if (simpleType == 'object'){
+		var cls = getConstructorClass(value);
+		if (cls){
+			if (cls == 'Object'){
+			}else if (cls == 'Array'){
+				complexType = 'array';
+			}else{
+				complexType += ' ('+cls+')';
+			}
+		}
+	}
+
+/*var tr1 = document.createElement('tr');
+	var td1 = document.createElement('td');
+	var td2 = document.createElement('td');
+	var td3 = document.createElement('td');
+	var td4 = document.createElement('td');*/
+
+	var row = tb.rows.length;
+	var tr1 = tb.insertRow(row++);
+	var td1 = tr1.insertCell(0);
+	var td2 = tr1.insertCell(1);
+	var td3 = tr1.insertCell(2);
+	var td4 = tr1.insertCell(3);
+	
+	tr1.style.verticalAlign = 'top';
+	td1.style.verticalAlign = 'middle';
+
+	td1.className = 'propPlus';
+	td2.className = 'propName';
+	td3.className = 'propType';
+	td4.className = 'propVal';
+
+	//tr1.appendChild(td1);
+	//tr1.appendChild(td2);
+	//tr1.appendChild(td3);
+	//tr1.appendChild(td4);
+
+	if (createSubrow){
+		var img1 = document.createElement('img');
+		img1.width = 9;
+		img1.height = 9;
+		img1.src = 'arrow_show.gif';
+		var a1 = document.createElement('a');
+		a1.appendChild(img1);
+		a1.href = '#';
+		a1.onclick = function(){ showTableRow(path); return false; };
+
+		var img2 = document.createElement('img');
+		img2.width = 9;
+		img2.height = 9;
+		img2.src = 'arrow_hide.gif';
+		var a2 = document.createElement('a');
+		a2.appendChild(img2);
+		a2.href = '#';
+		a2.onclick = function(){ hideTableRow(path); return false; };
+		a2.style.display = 'none';
+
+		tableShows[path] = a1;
+		tableHides[path] = a2;
+
+		td1.appendChild(a1);
+		td1.appendChild(a2);
+	}else{
+		var img = document.createElement('img');
+		img.width = 9;
+		img.height = 9;
+		img.src = 'spacer.gif';
+
+		td1.appendChild(img);
+	}
+
+	td2.appendChild(document.createTextNode(name));
+	td3.appendChild(document.createTextNode(complexType));
+	td4.appendChild(buildPreBlock(value));
+
+	//tb.appendChild(tr1);
+
+	if (createSubrow){
+		var tr2 = tb.insertRow(row++);
+		var td5 = tr2.insertCell(0);
+		var td6 = tr2.insertCell(1);
+		
+		//var tr2 = document.createElement('tr');
+		//var td5 = document.createElement('td');
+		//var td6 = document.createElement('td');
+
+		td5.innerHTML = '&nbsp;';
+		//td6.innerHTML = '&nbsp;';
+
+		td6.colSpan = '3';
+
+		tr2.appendChild(td5);
+		tr2.appendChild(td6);
+
+		tr2.style.display = 'none';
+
+		tb.appendChild(tr2);
+
+		tableRows[path] = tr2;
+		tableCels[path] = td6;
+		tableObjs[path] = value;
+	}
+}
+
+function showTableRow(path){
+
+	var tr = tableRows[path];
+	var td = tableCels[path];
+	var a1 = tableShows[path];
+	var a2 = tableHides[path];
+
+	if (!tablesBuilt[path]){
+
+		//alert('building table for '+path);
+		buildTable(path, td, tableObjs[path]);
+	}
+
+	tr.style.display = 'table-row';
+
+	a1.style.display = 'none';
+	a2.style.display = 'inline';
+}
+
+function hideTableRow(path){
+
+	var tr = tableRows[path];
+	var a1 = tableShows[path];
+	var a2 = tableHides[path];
+
+	tr.style.display = 'none';
+
+	a1.style.display = 'inline';
+	a2.style.display = 'none';
+}
+
+function buildPreBlock(value){
+
+	//
+	// how many lines ?
+	//
+
+	var s = ''+value;
+	s = s.replace("\r\n", "\n");
+	s = s.replace("\r", "");
+	var lines = s.split("\n");
+
+
+	if (lines.length < 2){
+
+		if (lines[0].length < 60){
+
+			var pre = document.createElement('pre');
+			pre.appendChild(document.createTextNode(s));
+			return pre;
+		}
+	}
+
+
+	//
+	// multiple lines :(
+	//
+
+	var preview = lines[0].substr(0, 60) + ' ...';
+
+	var pre1 = document.createElement('pre');
+	pre1.appendChild(document.createTextNode(preview));
+	pre1.className = 'clicky';
+
+	var pre2 = document.createElement('pre');
+	pre2.appendChild(document.createTextNode(s));
+	pre2.style.display = 'none';
+	pre2.className = 'clicky';
+
+	pre1.onclick = function(){
+		pre1.style.display = 'none';
+		pre2.style.display = 'block';
+	}
+
+	pre2.onclick = function(){
+		pre1.style.display = 'block';
+		pre2.style.display = 'none';
+	}
+
+	var pre = document.createElement('div');
+
+	pre.appendChild(pre1);
+	pre.appendChild(pre2);
+
+	return pre;
+}
+
+function getConstructorClass(obj){
+
+	if (!obj.constructor || !obj.constructor.toString) return;
+
+	var m = obj.constructor.toString().match(/function\s*(\w+)/);
+
+	if (m && m.length == 2) return m[1];
+
+	return null;
+}
+
+function keySorter(a, b){
+
+	if (a == parseInt(a) && b == parseInt(b)){
+
+		return (parseInt(a) > parseInt(b)) ? 1 : ((parseInt(a) < parseInt(b)) ? -1 : 0);
+	}
+
+	// sort by lowercase string
+
+	var a2 = String(a).toLowerCase();
+	var b2 = String(b).toLowerCase();
+
+	return (a2 > b2) ? 1 : ((a2 < b2) ? -1 : 0);
+}
+
+</script>
+<style>
+
+body {
+	font-family: arial, helvetica, sans-serif;
+}
+
+table {
+	border-width: 0px;
+	border-spacing: 1px;
+	border-collapse: separate;
+}
+
+td {
+	border-width: 0px;
+	padding: 2px;
+}
+
+img {
+	border: 0;
+}
+
+pre {
+	margin: 0;
+	padding: 0;
+	white-space: -moz-pre-wrap;  /* Mozilla, supported since 1999 */
+	white-space: -pre-wrap;      /* Opera 4 - 6 */
+	white-space: -o-pre-wrap;    /* Opera 7 */
+	white-space: pre-wrap;       /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */
+	word-wrap: break-word;       /* IE 5.5+ */
+}
+
+pre.clicky {
+	cursor: hand;
+	cursor: pointer;
+}
+
+td.propPlus {
+	width: 9px;
+	background-color: #ddd;
+}
+
+td.propName {
+	background-color: #ddd;
+}
+
+td.propType {
+	background-color: #ddd;
+}
+
+td.propVal {
+	background-color: #ddd;
+}
+
+</style>
+</head>
+<body>
+
+<h2>Javascript Object Browser</h2>
+
+<div id="frame"></div>
+
+</body>
+</html>
\ No newline at end of file

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

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

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/debug/spacer.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/DragAndDrop.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/DragAndDrop.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/DragAndDrop.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/DragAndDrop.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,7 @@
+
+dojo.require("dojo.lang.common");dojo.require("dojo.lang.func");dojo.require("dojo.lang.declare");dojo.provide("dojo.dnd.DragAndDrop");dojo.declare("dojo.dnd.DragSource", null, {type: "",onDragEnd: function(evt){},onDragStart: function(evt){},onSelected: function(evt){},unregister: function(){dojo.dnd.dragManager.unregisterDragSource(this);},reregister: function(){dojo.dnd.dragManager.registerDragSource(this);}});dojo.declare("dojo.dnd.DragObject", null, {type: "",register: function(){var dm = dojo.dnd.dragManager;if(dm["registerDragObject"]){dm.registerDragObject(this);}},onDragStart: function(evt){},onDragMove: function(evt){},onDragOver: function(evt){},onDragOut: function(evt){},onDragEnd: function(evt){},onDragLeave: dojo.lang.forward("onDragOut"),onDragEnter: dojo.lang.forward("onDragOver"),ondragout: dojo.lang.forward("onDragOut"),ondragover: dojo.lang.forward("onDragOver")
+});dojo.declare("dojo.dnd.DropTarget", null,function(){this.acceptedTypes = [];},{acceptsType: function(type){if(!dojo.lang.inArray(this.acceptedTypes, "*")){if(!dojo.lang.inArray(this.acceptedTypes, type)) { return false; }}
+return true;},accepts: function(dragObjects){if(!dojo.lang.inArray(this.acceptedTypes, "*")){for (var i = 0; i < dragObjects.length; i++) {if (!dojo.lang.inArray(this.acceptedTypes,dragObjects[i].type)) { return false; }}
+}
+return true;},unregister: function(){dojo.dnd.dragManager.unregisterDropTarget(this);},onDragOver: function(evt){},onDragOut: function(evt){},onDragMove: function(evt){},onDropStart: function(evt){},onDrop: function(evt){},onDropEnd: function(){}});dojo.dnd.DragEvent = function(){this.dragSource = null;this.dragObject = null;this.target = null;this.eventStatus = "success";}
+dojo.declare("dojo.dnd.DragManager", null, {selectedSources: [],dragObjects: [],dragSources: [],registerDragSource: function( source){},dropTargets: [],registerDropTarget: function( target){},lastDragTarget: null,currentDragTarget: null,onKeyDown: function(){},onMouseOut: function(){},onMouseMove: function(){},onMouseUp: function(){}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/DragAndDrop.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragAndDrop.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragAndDrop.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragAndDrop.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragAndDrop.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,57 @@
+
+dojo.provide("dojo.dnd.HtmlDragAndDrop");dojo.require("dojo.dnd.HtmlDragManager");dojo.require("dojo.dnd.DragAndDrop");dojo.require("dojo.html.*");dojo.require("dojo.html.display");dojo.require("dojo.html.util");dojo.require("dojo.html.selection");dojo.require("dojo.html.iframe");dojo.require("dojo.lang.extras");dojo.require("dojo.lfx.*");dojo.require("dojo.event.*");dojo.declare("dojo.dnd.HtmlDragSource", dojo.dnd.DragSource,function(node, type){node = dojo.byId(node);this.dragObjects = [];this.constrainToContainer = false;if(node){this.domNode = node;this.dragObject = node;this.type = (type)||(this.domNode.nodeName.toLowerCase());dojo.dnd.DragSource.prototype.reregister.call(this);}},{dragClass: "",onDragStart: function(){var dragObj = new dojo.dnd.HtmlDragObject(this.dragObject, this.type);if(this.dragClass){dragObj.dragClass = this.dragClass;}
+if(this.constrainToContainer){dragObj.constrainTo(this.constrainingContainer || this.domNode.parentNode);}
+return dragObj;},setDragHandle: function(node){node = dojo.byId(node);dojo.dnd.dragManager.unregisterDragSource(this);this.domNode = node;dojo.dnd.dragManager.registerDragSource(this);},setDragTarget: function(node){this.dragObject = node;},constrainTo: function(container){this.constrainToContainer = true;if(container){this.constrainingContainer = container;}},onSelected: function(){for(var i=0; i<this.dragObjects.length; i++){dojo.dnd.dragManager.selectedSources.push(new dojo.dnd.HtmlDragSource(this.dragObjects[i]));}},addDragObjects: function( el){for(var i=0; i<arguments.length; i++){this.dragObjects.push(dojo.byId(arguments[i]));}}
+}
+);dojo.declare("dojo.dnd.HtmlDragObject",dojo.dnd.DragObject,function(node, type){this.domNode = dojo.byId(node);this.type = type;this.constrainToContainer = false;this.dragSource = null;dojo.dnd.DragObject.prototype.register.call(this);},{dragClass: "",opacity: 0.5,createIframe: true,disableX: false,disableY: false,createDragNode: function() {var node = this.domNode.cloneNode(true);if(this.dragClass) { dojo.html.addClass(node, this.dragClass); }
+if(this.opacity < 1) { dojo.html.setOpacity(node, this.opacity); }
+var ltn = node.tagName.toLowerCase();var isTr = (ltn == "tr");if((isTr)||(ltn == "tbody")){var doc = this.domNode.ownerDocument;var table = doc.createElement("table");if(isTr){var tbody = doc.createElement("tbody");table.appendChild(tbody);tbody.appendChild(node);}else{table.appendChild(node);}
+var tmpSrcTr = ((isTr) ? this.domNode : this.domNode.firstChild);var tmpDstTr = ((isTr) ? node : node.firstChild);var domTds = tmpSrcTr.childNodes;var cloneTds = tmpDstTr.childNodes;for(var i = 0; i < domTds.length; i++){if((cloneTds[i])&&(cloneTds[i].style)){cloneTds[i].style.width = dojo.html.getContentBox(domTds[i]).width + "px";}}
+node = table;}
+if((dojo.render.html.ie55||dojo.render.html.ie60) && this.createIframe){with(node.style) {top="0px";left="0px";}
+var outer = document.createElement("div");outer.appendChild(node);this.bgIframe = new dojo.html.BackgroundIframe(outer);outer.appendChild(this.bgIframe.iframe);node = outer;}
+node.style.zIndex = 999;return node;},onDragStart: function(e){dojo.html.clearSelection();this.scrollOffset = dojo.html.getScroll().offset;this.dragStartPosition = dojo.html.getAbsolutePosition(this.domNode, true);this.dragOffset = {y: this.dragStartPosition.y - e.pageY,x: this.dragStartPosition.x - e.pageX};this.dragClone = this.createDragNode();this.containingBlockPosition = this.domNode.offsetParent ?
+dojo.html.getAbsolutePosition(this.domNode.offsetParent, true) : {x:0, y:0};if(this.constrainToContainer){this.constraints = this.getConstraints();}
+with(this.dragClone.style){position = "absolute";top = this.dragOffset.y + e.pageY + "px";left = this.dragOffset.x + e.pageX + "px";}
+dojo.body().appendChild(this.dragClone);dojo.event.topic.publish('dragStart', { source: this } );},getConstraints: function(){if(this.constrainingContainer.nodeName.toLowerCase() == 'body'){var viewport = dojo.html.getViewport();var width = viewport.width;var height = viewport.height;var scroll = dojo.html.getScroll().offset;var x = scroll.x;var y = scroll.y;}else{var content = dojo.html.getContentBox(this.constrainingContainer);width = content.width;height = content.height;x =
+this.containingBlockPosition.x +
+dojo.html.getPixelValue(this.constrainingContainer, "padding-left", true) +
+dojo.html.getBorderExtent(this.constrainingContainer, "left");y =
+this.containingBlockPosition.y +
+dojo.html.getPixelValue(this.constrainingContainer, "padding-top", true) +
+dojo.html.getBorderExtent(this.constrainingContainer, "top");}
+var mb = dojo.html.getMarginBox(this.domNode);return {minX: x,minY: y,maxX: x + width - mb.width,maxY: y + height - mb.height
+}},updateDragOffset: function(){var scroll = dojo.html.getScroll().offset;if(scroll.y != this.scrollOffset.y){var diff = scroll.y - this.scrollOffset.y;this.dragOffset.y += diff;this.scrollOffset.y = scroll.y;}
+if(scroll.x != this.scrollOffset.x){var diff = scroll.x - this.scrollOffset.x;this.dragOffset.x += diff;this.scrollOffset.x = scroll.x;}},onDragMove: function(e){this.updateDragOffset();var x = this.dragOffset.x + e.pageX;var y = this.dragOffset.y + e.pageY;if (this.constrainToContainer) {if (x < this.constraints.minX) { x = this.constraints.minX; }
+if (y < this.constraints.minY) { y = this.constraints.minY; }
+if (x > this.constraints.maxX) { x = this.constraints.maxX; }
+if (y > this.constraints.maxY) { y = this.constraints.maxY; }}
+this.setAbsolutePosition(x, y);dojo.event.topic.publish('dragMove', { source: this } );},setAbsolutePosition: function(x, y){if(!this.disableY) { this.dragClone.style.top = y + "px"; }
+if(!this.disableX) { this.dragClone.style.left = x + "px"; }},onDragEnd: function(e){switch(e.dragStatus){case "dropSuccess":
+dojo.html.removeNode(this.dragClone);this.dragClone = null;break;case "dropFailure":
+var startCoords = dojo.html.getAbsolutePosition(this.dragClone, true);var endCoords = { left: this.dragStartPosition.x + 1,top: this.dragStartPosition.y + 1};var anim = dojo.lfx.slideTo(this.dragClone, endCoords, 300);var dragObject = this;dojo.event.connect(anim, "onEnd", function(e){dojo.html.removeNode(dragObject.dragClone);dragObject.dragClone = null;});anim.play();break;}
+dojo.event.topic.publish('dragEnd', { source: this } );},constrainTo: function(container){this.constrainToContainer=true;if(container){this.constrainingContainer = container;}else{this.constrainingContainer = this.domNode.parentNode;}}
+}
+);dojo.declare("dojo.dnd.HtmlDropTarget",dojo.dnd.DropTarget,function(node, types){if(arguments.length == 0){ return; }
+this.domNode = dojo.byId(node);dojo.dnd.DropTarget.call(this);if(types && dojo.lang.isString(types)) {types = [types];}
+this.acceptedTypes = types || [];dojo.dnd.dragManager.registerDropTarget(this);},{vertical: false,onDragOver: function(e){if(!this.accepts(e.dragObjects)){ return false; }
+this.childBoxes = [];for(var i = 0, child; i < this.domNode.childNodes.length; i++){child = this.domNode.childNodes[i];if(child.nodeType != dojo.html.ELEMENT_NODE){ continue; }
+var pos = dojo.html.getAbsolutePosition(child, true);var inner = dojo.html.getBorderBox(child);this.childBoxes.push({top: pos.y, bottom: pos.y+inner.height,left: pos.x, right: pos.x+inner.width, height: inner.height,width: inner.width, node: child});}
+return true;},_getNodeUnderMouse: function(e){for(var i = 0, child; i < this.childBoxes.length; i++){with(this.childBoxes[i]){if (e.pageX >= left && e.pageX <= right &&
+e.pageY >= top && e.pageY <= bottom){ return i; }}
+}
+return -1;},createDropIndicator: function(){this.dropIndicator = document.createElement("div");with(this.dropIndicator.style){position = "absolute";zIndex = 999;if(this.vertical){borderLeftWidth = "1px";borderLeftColor = "black";borderLeftStyle = "solid";height = dojo.html.getBorderBox(this.domNode).height + "px";top = dojo.html.getAbsolutePosition(this.domNode, true).y + "px";}else{borderTopWidth = "1px";borderTopColor = "black";borderTopStyle = "solid";width = dojo.html.getBorderBox(this.domNode).width + "px";left = dojo.html.getAbsolutePosition(this.domNode, true).x + "px";}}
+},onDragMove: function(e, dragObjects){var i = this._getNodeUnderMouse(e);if(!this.dropIndicator){this.createDropIndicator();}
+var gravity = this.vertical ? dojo.html.gravity.WEST : dojo.html.gravity.NORTH;var hide = false;if(i < 0){if(this.childBoxes.length){var before = (dojo.html.gravity(this.childBoxes[0].node, e) & gravity);if(before){ hide = true; }}else{var before = true;}}else{var child = this.childBoxes[i];var before = (dojo.html.gravity(child.node, e) & gravity);if(child.node === dragObjects[0].dragSource.domNode){hide = true;}else{var currentPosChild = before ?
+(i>0?this.childBoxes[i-1]:child) :
+(i<this.childBoxes.length-1?this.childBoxes[i+1]:child);if(currentPosChild.node === dragObjects[0].dragSource.domNode){hide = true;}}
+}
+if(hide){this.dropIndicator.style.display="none";return;}else{this.dropIndicator.style.display="";}
+this.placeIndicator(e, dragObjects, i, before);if(!dojo.html.hasParent(this.dropIndicator)) {dojo.body().appendChild(this.dropIndicator);}},placeIndicator: function(e, dragObjects, boxIndex, before) {var targetProperty = this.vertical ? "left" : "top";var child;if(boxIndex < 0){if(this.childBoxes.length){child = before ? this.childBoxes[0]
+: this.childBoxes[this.childBoxes.length - 1];}else{this.dropIndicator.style[targetProperty] = dojo.html.getAbsolutePosition(this.domNode, true)[this.vertical?"x":"y"] + "px";}}else{child = this.childBoxes[boxIndex];}
+if(child){this.dropIndicator.style[targetProperty] = (before ? child[targetProperty] : child[this.vertical?"right":"bottom"]) + "px";if(this.vertical){this.dropIndicator.style.height = child.height + "px";this.dropIndicator.style.top = child.top + "px";}else{this.dropIndicator.style.width = child.width + "px";this.dropIndicator.style.left = child.left + "px";}}
+},onDragOut: function(e) {if(this.dropIndicator) {dojo.html.removeNode(this.dropIndicator);delete this.dropIndicator;}},onDrop: function(e){this.onDragOut(e);var i = this._getNodeUnderMouse(e);var gravity = this.vertical ? dojo.html.gravity.WEST : dojo.html.gravity.NORTH;if(i < 0){if(this.childBoxes.length){if(dojo.html.gravity(this.childBoxes[0].node, e) & gravity){return this.insert(e, this.childBoxes[0].node, "before");}else{return this.insert(e, this.childBoxes[this.childBoxes.length-1].node, "after");}}
+return this.insert(e, this.domNode, "append");}
+var child = this.childBoxes[i];if(dojo.html.gravity(child.node, e) & gravity){return this.insert(e, child.node, "before");}else{return this.insert(e, child.node, "after");}},insert: function(e, refNode, position){var node = e.dragObject.domNode;if(position == "before"){return dojo.html.insertBefore(node, refNode);}else if(position == "after"){return dojo.html.insertAfter(node, refNode);}else if(position == "append"){refNode.appendChild(node);return true;}
+return false;}}
+);
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragAndDrop.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragCopy.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragCopy.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragCopy.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragCopy.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,8 @@
+
+dojo.provide("dojo.dnd.HtmlDragCopy");dojo.require("dojo.dnd.*");dojo.declare("dojo.dnd.HtmlDragCopySource", dojo.dnd.HtmlDragSource,function(node, type, copyOnce){this.copyOnce = copyOnce;this.makeCopy = true;},{onDragStart: function(){var dragObj = new dojo.dnd.HtmlDragCopyObject(this.dragObject, this.type, this);if(this.dragClass) { dragObj.dragClass = this.dragClass; }
+if (this.constrainToContainer) {dragObj.constrainTo(this.constrainingContainer || this.domNode.parentNode);}
+return dragObj;},onSelected: function() {for (var i=0; i<this.dragObjects.length; i++) {dojo.dnd.dragManager.selectedSources.push(new dojo.dnd.HtmlDragCopySource(this.dragObjects[i]));}}
+});dojo.declare("dojo.dnd.HtmlDragCopyObject", dojo.dnd.HtmlDragObject,function(dragObject, type, source){this.copySource = source;},{onDragStart: function(e) {dojo.dnd.HtmlDragCopyObject.superclass.onDragStart.apply(this, arguments);if(this.copySource.makeCopy) {this.sourceNode = this.domNode;this.domNode    = this.domNode.cloneNode(true);}},onDragEnd: function(e){switch(e.dragStatus){case "dropFailure":
+var startCoords = dojo.html.getAbsolutePosition(this.dragClone, true);var endCoords = { left: this.dragStartPosition.x + 1,top: this.dragStartPosition.y + 1};var anim = dojo.lfx.slideTo(this.dragClone, endCoords, 500, dojo.lfx.easeOut);var dragObject = this;dojo.event.connect(anim, "onEnd", function (e) {dojo.lang.setTimeout(function() {dojo.html.removeNode(dragObject.dragClone);dragObject.dragClone = null;if(dragObject.copySource.makeCopy) {dojo.html.removeNode(dragObject.domNode);dragObject.domNode = dragObject.sourceNode;dragObject.sourceNode = null;}},200);});anim.play();dojo.event.topic.publish('dragEnd', { source: this } );return;}
+dojo.dnd.HtmlDragCopyObject.superclass.onDragEnd.apply(this, arguments);this.copySource.dragObject = this.domNode;if(this.copySource.copyOnce){this.copySource.makeCopy = false;}
+new dojo.dnd.HtmlDragCopySource(this.sourceNode, this.type, this.copySource.copyOnce);this.sourceNode = null;}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragCopy.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragManager.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragManager.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragManager.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragManager.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,47 @@
+
+dojo.provide("dojo.dnd.HtmlDragManager");dojo.require("dojo.dnd.DragAndDrop");dojo.require("dojo.event.*");dojo.require("dojo.lang.array");dojo.require("dojo.html.common");dojo.require("dojo.html.layout");dojo.declare("dojo.dnd.HtmlDragManager", dojo.dnd.DragManager, {disabled: false,nestedTargets: false,mouseDownTimer: null,dsCounter: 0,dsPrefix: "dojoDragSource",dropTargetDimensions: [],currentDropTarget: null,previousDropTarget: null,_dragTriggered: false,selectedSources: [],dragObjects: [],dragSources: [],currentX: null,currentY: null,lastX: null,lastY: null,mouseDownX: null,mouseDownY: null,threshold: 7,dropAcceptable: false,cancelEvent: function(e){ e.stopPropagation(); e.preventDefault();},registerDragSource: function(ds){if(ds["domNode"]){var dp = this.dsPrefix;var dpIdx = dp+"Idx_"+(this.dsCounter++);ds.dragSourceId = dpIdx;this.dragSources[dpIdx] = ds;ds.domNode.setAttribute(dp, dpIdx);if(dojo.render.html.ie){dojo.event.browser.addListener(ds.domNode, "ondragstart"
 , this.cancelEvent);}}
+},unregisterDragSource: function(ds){if (ds["domNode"]){var dp = this.dsPrefix;var dpIdx = ds.dragSourceId;delete ds.dragSourceId;delete this.dragSources[dpIdx];ds.domNode.setAttribute(dp, null);if(dojo.render.html.ie){dojo.event.browser.removeListener(ds.domNode, "ondragstart", this.cancelEvent);}}
+},registerDropTarget: function(dt){this.dropTargets.push(dt);},unregisterDropTarget: function(dt){var index = dojo.lang.find(this.dropTargets, dt, true);if (index>=0) {this.dropTargets.splice(index, 1);}},getDragSource: function(e){var tn = e.target;if(tn === dojo.body()){ return; }
+var ta = dojo.html.getAttribute(tn, this.dsPrefix);while((!ta)&&(tn)){tn = tn.parentNode;if((!tn)||(tn === dojo.body())){ return; }
+ta = dojo.html.getAttribute(tn, this.dsPrefix);}
+return this.dragSources[ta];},onKeyDown: function(e){},onMouseDown: function(e){if(this.disabled) { return; }
+if(dojo.render.html.ie) {if(e.button != 1) { return; }} else if(e.which != 1) {return;}
+var target = e.target.nodeType == dojo.html.TEXT_NODE ?
+e.target.parentNode : e.target;if(dojo.html.isTag(target, "button", "textarea", "input", "select", "option")) {return;}
+var ds = this.getDragSource(e);if(!ds){ return; }
+if(!dojo.lang.inArray(this.selectedSources, ds)){this.selectedSources.push(ds);ds.onSelected();}
+this.mouseDownX = e.pageX;this.mouseDownY = e.pageY;e.preventDefault();dojo.event.connect(document, "onmousemove", this, "onMouseMove");},onMouseUp: function(e, cancel){if(this.selectedSources.length==0){return;}
+this.mouseDownX = null;this.mouseDownY = null;this._dragTriggered = false;e.dragSource = this.dragSource;if((!e.shiftKey)&&(!e.ctrlKey)){if(this.currentDropTarget) {this.currentDropTarget.onDropStart();}
+dojo.lang.forEach(this.dragObjects, function(tempDragObj){var ret = null;if(!tempDragObj){ return; }
+if(this.currentDropTarget) {e.dragObject = tempDragObj;var ce = this.currentDropTarget.domNode.childNodes;if(ce.length > 0){e.dropTarget = ce[0];while(e.dropTarget == tempDragObj.domNode){e.dropTarget = e.dropTarget.nextSibling;}}else{e.dropTarget = this.currentDropTarget.domNode;}
+if(this.dropAcceptable){ret = this.currentDropTarget.onDrop(e);}else{this.currentDropTarget.onDragOut(e);}}
+e.dragStatus = this.dropAcceptable && ret ? "dropSuccess" : "dropFailure";dojo.lang.delayThese([
+function() {try{tempDragObj.dragSource.onDragEnd(e)
+} catch(err) {var ecopy = {};for (var i in e) {if (i=="type") {ecopy.type = "mouseup";continue;}
+ecopy[i] = e[i];}
+tempDragObj.dragSource.onDragEnd(ecopy);}}
+, function() {tempDragObj.onDragEnd(e)}]);}, this);this.selectedSources = [];this.dragObjects = [];this.dragSource = null;if(this.currentDropTarget) {this.currentDropTarget.onDropEnd();}} else {}
+dojo.event.disconnect(document, "onmousemove", this, "onMouseMove");this.currentDropTarget = null;},onScroll: function(){for(var i = 0; i < this.dragObjects.length; i++) {if(this.dragObjects[i].updateDragOffset) {this.dragObjects[i].updateDragOffset();}}
+if (this.dragObjects.length) {this.cacheTargetLocations();}},_dragStartDistance: function(x, y){if((!this.mouseDownX)||(!this.mouseDownX)){return;}
+var dx = Math.abs(x-this.mouseDownX);var dx2 = dx*dx;var dy = Math.abs(y-this.mouseDownY);var dy2 = dy*dy;return parseInt(Math.sqrt(dx2+dy2), 10);},cacheTargetLocations: function(){dojo.profile.start("cacheTargetLocations");this.dropTargetDimensions = [];dojo.lang.forEach(this.dropTargets, function(tempTarget){var tn = tempTarget.domNode;if(!tn || !tempTarget.accepts([this.dragSource])){ return; }
+var abs = dojo.html.getAbsolutePosition(tn, true);var bb = dojo.html.getBorderBox(tn);this.dropTargetDimensions.push([
+[abs.x, abs.y],[ abs.x+bb.width, abs.y+bb.height ],tempTarget
+]);}, this);dojo.profile.end("cacheTargetLocations");},onMouseMove: function(e){if((dojo.render.html.ie)&&(e.button != 1)){this.currentDropTarget = null;this.onMouseUp(e, true);return;}
+if((this.selectedSources.length)&&
+(!this.dragObjects.length) ){var dx;var dy;if(!this._dragTriggered){this._dragTriggered = (this._dragStartDistance(e.pageX, e.pageY) > this.threshold);if(!this._dragTriggered){ return; }
+dx = e.pageX - this.mouseDownX;dy = e.pageY - this.mouseDownY;}
+this.dragSource = this.selectedSources[0];dojo.lang.forEach(this.selectedSources, function(tempSource){if(!tempSource){ return; }
+var tdo = tempSource.onDragStart(e);if(tdo){tdo.onDragStart(e);tdo.dragOffset.y += dy;tdo.dragOffset.x += dx;tdo.dragSource = tempSource;this.dragObjects.push(tdo);}}, this);this.previousDropTarget = null;this.cacheTargetLocations();}
+dojo.lang.forEach(this.dragObjects, function(dragObj){if(dragObj){ dragObj.onDragMove(e); }});if(this.currentDropTarget){var c = dojo.html.toCoordinateObject(this.currentDropTarget.domNode, true);var dtp = [
+[c.x,c.y], [c.x+c.width, c.y+c.height]
+];}
+if((!this.nestedTargets)&&(dtp)&&(this.isInsideBox(e, dtp))){if(this.dropAcceptable){this.currentDropTarget.onDragMove(e, this.dragObjects);}}else{var bestBox = this.findBestTarget(e);if(bestBox.target === null){if(this.currentDropTarget){this.currentDropTarget.onDragOut(e);this.previousDropTarget = this.currentDropTarget;this.currentDropTarget = null;}
+this.dropAcceptable = false;return;}
+if(this.currentDropTarget !== bestBox.target){if(this.currentDropTarget){this.previousDropTarget = this.currentDropTarget;this.currentDropTarget.onDragOut(e);}
+this.currentDropTarget = bestBox.target;e.dragObjects = this.dragObjects;this.dropAcceptable = this.currentDropTarget.onDragOver(e);}else{if(this.dropAcceptable){this.currentDropTarget.onDragMove(e, this.dragObjects);}}
+}},findBestTarget: function(e) {var _this = this;var bestBox = new Object();bestBox.target = null;bestBox.points = null;dojo.lang.every(this.dropTargetDimensions, function(tmpDA) {if(!_this.isInsideBox(e, tmpDA)){return true;}
+bestBox.target = tmpDA[2];bestBox.points = tmpDA;return Boolean(_this.nestedTargets);});return bestBox;},isInsideBox: function(e, coords){if((e.pageX > coords[0][0])&&
+(e.pageX < coords[1][0])&&
+(e.pageY > coords[0][1])&&
+(e.pageY < coords[1][1]) ){return true;}
+return false;},onMouseOver: function(e){},onMouseOut: function(e){}});dojo.dnd.dragManager = new dojo.dnd.HtmlDragManager();(function(){var d = document;var dm = dojo.dnd.dragManager;dojo.event.connect(d, "onkeydown", dm, "onKeyDown");dojo.event.connect(d, "onmouseover", dm, "onMouseOver");dojo.event.connect(d, "onmouseout", dm, "onMouseOut");dojo.event.connect(d, "onmousedown", dm, "onMouseDown");dojo.event.connect(d, "onmouseup", dm, "onMouseUp");dojo.event.connect(window, "onscroll", dm, "onScroll");})();
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragManager.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragMove.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragMove.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragMove.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragMove.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,8 @@
+
+dojo.provide("dojo.dnd.HtmlDragMove");dojo.require("dojo.dnd.*");dojo.declare("dojo.dnd.HtmlDragMoveSource", dojo.dnd.HtmlDragSource, {onDragStart: function(){var dragObj =  new dojo.dnd.HtmlDragMoveObject(this.dragObject, this.type);if (this.constrainToContainer) {dragObj.constrainTo(this.constrainingContainer);}
+return dragObj;},onSelected: function() {for (var i=0; i<this.dragObjects.length; i++) {dojo.dnd.dragManager.selectedSources.push(new dojo.dnd.HtmlDragMoveSource(this.dragObjects[i]));}}
+});dojo.declare("dojo.dnd.HtmlDragMoveObject", dojo.dnd.HtmlDragObject, {onDragStart: function(e){dojo.html.clearSelection();this.dragClone = this.domNode;if(dojo.html.getComputedStyle(this.domNode, 'position') != 'absolute'){this.domNode.style.position = "relative";}
+var left = parseInt(dojo.html.getComputedStyle(this.domNode, 'left'));var top = parseInt(dojo.html.getComputedStyle(this.domNode, 'top'));this.dragStartPosition = {x: isNaN(left) ? 0 : left,y: isNaN(top) ? 0 : top
+};this.scrollOffset = dojo.html.getScroll().offset;this.dragOffset = {y: this.dragStartPosition.y - e.pageY,x: this.dragStartPosition.x - e.pageX};this.containingBlockPosition = {x:0, y:0};if (this.constrainToContainer) {this.constraints = this.getConstraints();}
+dojo.event.connect(this.domNode, "onclick", this, "_squelchOnClick");},onDragEnd: function(e){},setAbsolutePosition: function(x, y){if(!this.disableY) { this.domNode.style.top = y + "px"; }
+if(!this.disableX) { this.domNode.style.left = x + "px"; }},_squelchOnClick: function(e){dojo.event.browser.stopEvent(e);dojo.event.disconnect(this.domNode, "onclick", this, "_squelchOnClick");}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/HtmlDragMove.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/Sortable.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/Sortable.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/Sortable.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/Sortable.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,4 @@
+
+dojo.provide("dojo.dnd.Sortable");dojo.require("dojo.dnd.*");dojo.dnd.Sortable = function () {}
+dojo.lang.extend(dojo.dnd.Sortable, {ondragstart: function (e) {var dragObject = e.target;while (dragObject.parentNode && dragObject.parentNode != this) {dragObject = dragObject.parentNode;}
+return dragObject;}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/Sortable.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/TreeDragAndDrop.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/TreeDragAndDrop.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/TreeDragAndDrop.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/TreeDragAndDrop.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,39 @@
+
+dojo.provide("dojo.dnd.TreeDragAndDrop");dojo.require("dojo.dnd.HtmlDragAndDrop");dojo.require("dojo.lang.func");dojo.require("dojo.lang.array");dojo.require("dojo.lang.extras");dojo.require("dojo.html.layout");dojo.dnd.TreeDragSource = function(node, syncController, type, treeNode){this.controller = syncController;this.treeNode = treeNode;dojo.dnd.HtmlDragSource.call(this, node, type);}
+dojo.inherits(dojo.dnd.TreeDragSource, dojo.dnd.HtmlDragSource);dojo.lang.extend(dojo.dnd.TreeDragSource, {onDragStart: function(){var dragObject = dojo.dnd.HtmlDragSource.prototype.onDragStart.call(this);dragObject.treeNode = this.treeNode;dragObject.onDragStart = dojo.lang.hitch(dragObject, function(e) {this.savedSelectedNode = this.treeNode.tree.selector.selectedNode;if (this.savedSelectedNode) {this.savedSelectedNode.unMarkSelected();}
+var result = dojo.dnd.HtmlDragObject.prototype.onDragStart.apply(this, arguments);var cloneGrid = this.dragClone.getElementsByTagName('img');for(var i=0; i<cloneGrid.length; i++) {cloneGrid.item(i).style.backgroundImage='url()';}
+return result;});dragObject.onDragEnd = function(e) {if (this.savedSelectedNode) {this.savedSelectedNode.markSelected();}
+return dojo.dnd.HtmlDragObject.prototype.onDragEnd.apply(this, arguments);}
+return dragObject;},onDragEnd: function(e){var res = dojo.dnd.HtmlDragSource.prototype.onDragEnd.call(this, e);return res;}});dojo.dnd.TreeDropTarget = function(domNode, controller, type, treeNode){this.treeNode = treeNode;this.controller = controller;dojo.dnd.HtmlDropTarget.apply(this, [domNode, type]);}
+dojo.inherits(dojo.dnd.TreeDropTarget, dojo.dnd.HtmlDropTarget);dojo.lang.extend(dojo.dnd.TreeDropTarget, {autoExpandDelay: 1500,autoExpandTimer: null,position: null,indicatorStyle: "2px black solid",showIndicator: function(position) {if (this.position == position) {return;}
+this.hideIndicator();this.position = position;if (position == "before") {this.treeNode.labelNode.style.borderTop = this.indicatorStyle;} else if (position == "after") {this.treeNode.labelNode.style.borderBottom = this.indicatorStyle;} else if (position == "onto") {this.treeNode.markSelected();}},hideIndicator: function() {this.treeNode.labelNode.style.borderBottom="";this.treeNode.labelNode.style.borderTop="";this.treeNode.unMarkSelected();this.position = null;},onDragOver: function(e){var accepts = dojo.dnd.HtmlDropTarget.prototype.onDragOver.apply(this, arguments);if (accepts && this.treeNode.isFolder && !this.treeNode.isExpanded) {this.setAutoExpandTimer();}
+return accepts;},accepts: function(dragObjects) {var accepts = dojo.dnd.HtmlDropTarget.prototype.accepts.apply(this, arguments);if (!accepts) return false;var sourceTreeNode = dragObjects[0].treeNode;if (dojo.lang.isUndefined(sourceTreeNode) || !sourceTreeNode || !sourceTreeNode.isTreeNode) {dojo.raise("Source is not TreeNode or not found");}
+if (sourceTreeNode === this.treeNode) return false;return true;},setAutoExpandTimer: function() {var _this = this;var autoExpand = function () {if (dojo.dnd.dragManager.currentDropTarget === _this) {_this.controller.expand(_this.treeNode);}}
+this.autoExpandTimer = dojo.lang.setTimeout(autoExpand, _this.autoExpandDelay);},getDNDMode: function() {return this.treeNode.tree.DNDMode;},getAcceptPosition: function(e, sourceTreeNode) {var DNDMode = this.getDNDMode();if (DNDMode & dojo.widget.Tree.prototype.DNDModes.ONTO &&
+!(
+!this.treeNode.actionIsDisabled(dojo.widget.TreeNode.prototype.actions.ADDCHILD)
+&& sourceTreeNode.parent !== this.treeNode
+&& this.controller.canMove(sourceTreeNode, this.treeNode)
+)
+) {DNDMode &= ~dojo.widget.Tree.prototype.DNDModes.ONTO;}
+var position = this.getPosition(e, DNDMode);if (position=="onto" ||
+(!this.isAdjacentNode(sourceTreeNode, position)
+&& this.controller.canMove(sourceTreeNode, this.treeNode.parent)
+)
+) {return position;} else {return false;}},onDragOut: function(e) {this.clearAutoExpandTimer();this.hideIndicator();},clearAutoExpandTimer: function() {if (this.autoExpandTimer) {clearTimeout(this.autoExpandTimer);this.autoExpandTimer = null;}},onDragMove: function(e, dragObjects){var sourceTreeNode = dragObjects[0].treeNode;var position = this.getAcceptPosition(e, sourceTreeNode);if (position) {this.showIndicator(position);}},isAdjacentNode: function(sourceNode, position) {if (sourceNode === this.treeNode) return true;if (sourceNode.getNextSibling() === this.treeNode && position=="before") return true;if (sourceNode.getPreviousSibling() === this.treeNode && position=="after") return true;return false;},getPosition: function(e, DNDMode) {var node = dojo.byId(this.treeNode.labelNode);var mousey = e.pageY || e.clientY + dojo.body().scrollTop;var nodey = dojo.html.getAbsolutePosition(node).y;var height = dojo.html.getBorderBox(node).height;var relY = mousey - nodey;var p = relY
  / height;var position = "";if (DNDMode & dojo.widget.Tree.prototype.DNDModes.ONTO
+&& DNDMode & dojo.widget.Tree.prototype.DNDModes.BETWEEN) {if (p<=0.3) {position = "before";} else if (p<=0.7) {position = "onto";} else {position = "after";}} else if (DNDMode & dojo.widget.Tree.prototype.DNDModes.BETWEEN) {if (p<=0.5) {position = "before";} else {position = "after";}}
+else if (DNDMode & dojo.widget.Tree.prototype.DNDModes.ONTO) {position = "onto";}
+return position;},getTargetParentIndex: function(sourceTreeNode, position) {var index = position == "before" ? this.treeNode.getParentIndex() : this.treeNode.getParentIndex()+1;if (this.treeNode.parent === sourceTreeNode.parent
+&& this.treeNode.getParentIndex() > sourceTreeNode.getParentIndex()) {index--;}
+return index;},onDrop: function(e){var position = this.position;this.onDragOut(e);var sourceTreeNode = e.dragObject.treeNode;if (!dojo.lang.isObject(sourceTreeNode)) {dojo.raise("TreeNode not found in dragObject")
+}
+if (position == "onto") {return this.controller.move(sourceTreeNode, this.treeNode, 0);} else {var index = this.getTargetParentIndex(sourceTreeNode, position);return this.controller.move(sourceTreeNode, this.treeNode.parent, index);}}
+});dojo.dnd.TreeDNDController = function(treeController) {this.treeController = treeController;this.dragSources = {};this.dropTargets = {};}
+dojo.lang.extend(dojo.dnd.TreeDNDController, {listenTree: function(tree) {dojo.event.topic.subscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");dojo.event.topic.subscribe(tree.eventNames.moveFrom, this, "onMoveFrom");dojo.event.topic.subscribe(tree.eventNames.moveTo, this, "onMoveTo");dojo.event.topic.subscribe(tree.eventNames.addChild, this, "onAddChild");dojo.event.topic.subscribe(tree.eventNames.removeNode, this, "onRemoveNode");dojo.event.topic.subscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");},unlistenTree: function(tree) {dojo.event.topic.unsubscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");dojo.event.topic.unsubscribe(tree.eventNames.moveFrom, this, "onMoveFrom");dojo.event.topic.unsubscribe(tree.eventNames.moveTo, this, "onMoveTo");dojo.event.topic.unsubscribe(tree.eventNames.addChild, this, "onAddChild");dojo.event.topic.unsubscribe(tree.eventNames.removeNode, this, "onRemoveNode");dojo.event.topic.unsubscribe(tree.eventNames
 .treeDestroy, this, "onTreeDestroy");},onTreeDestroy: function(message) {this.unlistenTree(message.source);},onCreateDOMNode: function(message) {this.registerDNDNode(message.source);},onAddChild: function(message) {this.registerDNDNode(message.child);},onMoveFrom: function(message) {var _this = this;dojo.lang.forEach(
+message.child.getDescendants(),function(node) { _this.unregisterDNDNode(node); }
+);},onMoveTo: function(message) {var _this = this;dojo.lang.forEach(
+message.child.getDescendants(),function(node) { _this.registerDNDNode(node); }
+);},registerDNDNode: function(node) {if (!node.tree.DNDMode) return;var source = null;var target = null;if (!node.actionIsDisabled(node.actions.MOVE)) {var source = new dojo.dnd.TreeDragSource(node.labelNode, this, node.tree.widgetId, node);this.dragSources[node.widgetId] = source;}
+var target = new dojo.dnd.TreeDropTarget(node.labelNode, this.treeController, node.tree.DNDAcceptTypes, node);this.dropTargets[node.widgetId] = target;},unregisterDNDNode: function(node) {if (this.dragSources[node.widgetId]) {dojo.dnd.dragManager.unregisterDragSource(this.dragSources[node.widgetId]);delete this.dragSources[node.widgetId];}
+if (this.dropTargets[node.widgetId]) {dojo.dnd.dragManager.unregisterDropTarget(this.dropTargets[node.widgetId]);delete this.dropTargets[node.widgetId];}}
+});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/TreeDragAndDrop.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/TreeDragAndDropV3.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/TreeDragAndDropV3.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/TreeDragAndDropV3.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/TreeDragAndDropV3.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,28 @@
+
+dojo.provide("dojo.dnd.TreeDragAndDropV3");dojo.require("dojo.dnd.HtmlDragAndDrop");dojo.require("dojo.lang.func");dojo.require("dojo.lang.array");dojo.require("dojo.lang.extras");dojo.require("dojo.Deferred");dojo.require("dojo.html.layout");dojo.dnd.TreeDragSourceV3 = function(node, syncController, type, treeNode){this.controller = syncController;this.treeNode = treeNode;dojo.dnd.HtmlDragSource.call(this, node, type);}
+dojo.inherits(dojo.dnd.TreeDragSourceV3, dojo.dnd.HtmlDragSource);dojo.dnd.TreeDropTargetV3 = function(domNode, controller, type, treeNode){this.treeNode = treeNode;this.controller = controller;dojo.dnd.HtmlDropTarget.call(this, domNode, type);}
+dojo.inherits(dojo.dnd.TreeDropTargetV3, dojo.dnd.HtmlDropTarget);dojo.lang.extend(dojo.dnd.TreeDropTargetV3, {autoExpandDelay: 1500,autoExpandTimer: null,position: null,indicatorStyle: "2px black groove",showIndicator: function(position) {if (this.position == position) {return;}
+this.hideIndicator();this.position = position;var node = this.treeNode;node.contentNode.style.width = dojo.html.getBorderBox(node.labelNode).width + "px";if (position == "onto") {node.contentNode.style.border = this.indicatorStyle;} else {if (position == "before") {node.contentNode.style.borderTop = this.indicatorStyle;} else if (position == "after") {node.contentNode.style.borderBottom = this.indicatorStyle;}}
+},hideIndicator: function() {this.treeNode.contentNode.style.borderBottom = "";this.treeNode.contentNode.style.borderTop = "";this.treeNode.contentNode.style.border = "";this.treeNode.contentNode.style.width=""
+this.position = null;},onDragOver: function(e){var accepts = dojo.dnd.HtmlDropTarget.prototype.onDragOver.apply(this, arguments);if (accepts && this.treeNode.isFolder && !this.treeNode.isExpanded) {this.setAutoExpandTimer();}
+if (accepts) {this.cacheNodeCoords();}
+return accepts;},accepts: function(dragObjects) {var accepts = dojo.dnd.HtmlDropTarget.prototype.accepts.apply(this, arguments);if (!accepts) return false;for(var i=0; i<dragObjects.length; i++) {var sourceTreeNode = dragObjects[i].treeNode;if (sourceTreeNode === this.treeNode) return false;}
+return true;},setAutoExpandTimer: function() {var _this = this;var autoExpand = function () {if (dojo.dnd.dragManager.currentDropTarget === _this) {_this.controller.expand(_this.treeNode);dojo.dnd.dragManager.cacheTargetLocations();}}
+this.autoExpandTimer = dojo.lang.setTimeout(autoExpand, _this.autoExpandDelay);},getAcceptPosition: function(e, dragObjects) {var DndMode = this.treeNode.tree.DndMode;if (DndMode & dojo.widget.TreeV3.prototype.DndModes.ONTO &&
+this.treeNode.actionIsDisabledNow(this.treeNode.actions.ADDCHILD)
+) {DndMode &= ~dojo.widget.TreeV3.prototype.DndModes.ONTO;}
+var position = this.getPosition(e, DndMode);if (position=="onto") {return position;}
+for(var i=0; i<dragObjects.length; i++) {var source = dragObjects[i].dragSource;if (source.treeNode && this.isAdjacentNode(source.treeNode, position)) {continue;}
+if (!this.controller.canMove(source.treeNode ? source.treeNode : source, this.treeNode.parent)) {return false;}}
+return position;},onDropEnd: function(e) {this.clearAutoExpandTimer();this.hideIndicator();},onDragOut: function(e) {this.clearAutoExpandTimer();this.hideIndicator();},clearAutoExpandTimer: function() {if (this.autoExpandTimer) {clearTimeout(this.autoExpandTimer);this.autoExpandTimer = null;}},onDragMove: function(e, dragObjects){var position = this.getAcceptPosition(e, dragObjects);if (position) {this.showIndicator(position);}},isAdjacentNode: function(sourceNode, position) {if (sourceNode === this.treeNode) return true;if (sourceNode.getNextSibling() === this.treeNode && position=="before") return true;if (sourceNode.getPreviousSibling() === this.treeNode && position=="after") return true;return false;},cacheNodeCoords: function() {var node = this.treeNode.contentNode;this.cachedNodeY = dojo.html.getAbsolutePosition(node).y;this.cachedNodeHeight = dojo.html.getBorderBox(node).height;},getPosition: function(e, DndMode) {var mousey = e.pageY || e.clientY + dojo.body().scroll
 Top;var relY = mousey - this.cachedNodeY;var p = relY / this.cachedNodeHeight;var position = "";if (DndMode & dojo.widget.TreeV3.prototype.DndModes.ONTO
+&& DndMode & dojo.widget.TreeV3.prototype.DndModes.BETWEEN) {if (p<=0.33) {position = "before";} else if (p<=0.66 || this.treeNode.isExpanded && this.treeNode.children.length && !this.treeNode.isLastChild()) {position = "onto";} else {position = "after";}} else if (DndMode & dojo.widget.TreeV3.prototype.DndModes.BETWEEN) {if (p<=0.5 || this.treeNode.isExpanded && this.treeNode.children.length && !this.treeNode.isLastChild()) {position = "before";} else {position = "after";}}
+else if (DndMode & dojo.widget.TreeV3.prototype.DndModes.ONTO) {position = "onto";}
+return position;},getTargetParentIndex: function(source, position) {var index = position == "before" ? this.treeNode.getParentIndex() : this.treeNode.getParentIndex()+1;if (source.treeNode
+&& this.treeNode.parent === source.treeNode.parent
+&& this.treeNode.getParentIndex() > source.treeNode.getParentIndex()) {index--;}
+return index;},onDrop: function(e) {var position = this.position;var source = e.dragObject.dragSource;var targetParent, targetIndex;if (position == "onto") {targetParent = this.treeNode;targetIndex = 0;} else {targetIndex = this.getTargetParentIndex(source, position);targetParent = this.treeNode.parent;}
+var r = this.getDropHandler(e, source, targetParent, targetIndex)();return r;},getDropHandler: function(e, source, targetParent, targetIndex) {var handler;var _this = this;handler = function () {var result;if (source.treeNode) {result = _this.controller.move(source.treeNode, targetParent, targetIndex, true);} else {if (dojo.lang.isFunction(source.onDrop)) {source.onDrop(targetParent, targetIndex);}
+var treeNode = source.getTreeNode();if (treeNode) {result = _this.controller.createChild(targetParent, targetIndex, treeNode, true);} else {result = true;}}
+if (result instanceof dojo.Deferred) {var isSuccess = result.fired == 0;if (!isSuccess) {_this.handleDropError(source, targetParent, targetIndex, result);}
+return isSuccess;} else {return result;}}
+return handler;},handleDropError: function(source, parent, index, result) {dojo.debug("TreeDropTargetV3.handleDropError: DND error occured");dojo.debugShallow(result);}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/TreeDragAndDropV3.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/__package__.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/__package__.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/__package__.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,3 @@
+
+dojo.kwCompoundRequire({common: ["dojo.dnd.DragAndDrop"],browser: ["dojo.dnd.HtmlDragAndDrop"],dashboard: ["dojo.dnd.HtmlDragAndDrop"]
+});dojo.provide("dojo.dnd.*");
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dnd/__package__.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dom.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dom.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dom.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/dom.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,92 @@
+
+dojo.provide("dojo.dom");dojo.dom.ELEMENT_NODE                  = 1;dojo.dom.ATTRIBUTE_NODE                = 2;dojo.dom.TEXT_NODE                     = 3;dojo.dom.CDATA_SECTION_NODE            = 4;dojo.dom.ENTITY_REFERENCE_NODE         = 5;dojo.dom.ENTITY_NODE                   = 6;dojo.dom.PROCESSING_INSTRUCTION_NODE   = 7;dojo.dom.COMMENT_NODE                  = 8;dojo.dom.DOCUMENT_NODE                 = 9;dojo.dom.DOCUMENT_TYPE_NODE            = 10;dojo.dom.DOCUMENT_FRAGMENT_NODE        = 11;dojo.dom.NOTATION_NODE                 = 12;dojo.dom.dojoml = "http://www.dojotoolkit.org/2004/dojoml";dojo.dom.xmlns = {svg : "http://www.w3.org/2000/svg",smil : "http://www.w3.org/2001/SMIL20/",mml : "http://www.w3.org/1998/Math/MathML",cml : "http://www.xml-cml.org",xlink : "http://www.w3.org/1999/xlink",xhtml : "http://www.w3.org/1999/xhtml",xul : "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",xbl : "http://www.mozilla.org/xbl",fo : "http://www.w3.org/1999/XSL/For
 mat",xsl : "http://www.w3.org/1999/XSL/Transform",xslt : "http://www.w3.org/1999/XSL/Transform",xi : "http://www.w3.org/2001/XInclude",xforms : "http://www.w3.org/2002/01/xforms",saxon : "http://icl.com/saxon",xalan : "http://xml.apache.org/xslt",xsd : "http://www.w3.org/2001/XMLSchema",dt: "http://www.w3.org/2001/XMLSchema-datatypes",xsi : "http://www.w3.org/2001/XMLSchema-instance",rdf : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs : "http://www.w3.org/2000/01/rdf-schema#",dc : "http://purl.org/dc/elements/1.1/",dcq: "http://purl.org/dc/qualifiers/1.0","soap-env" : "http://schemas.xmlsoap.org/soap/envelope/",wsdl : "http://schemas.xmlsoap.org/wsdl/",AdobeExtensions : "http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+};dojo.dom.isNode = function(wh){if(typeof Element == "function") {try {return wh instanceof Element;} catch(e) {}} else {return wh && !isNaN(wh.nodeType);}}
+dojo.dom.getUniqueId = function(){var _document = dojo.doc();do {var id = "dj_unique_" + (++arguments.callee._idIncrement);}while(_document.getElementById(id));return id;}
+dojo.dom.getUniqueId._idIncrement = 0;dojo.dom.firstElement = dojo.dom.getFirstChildElement = function(parentNode, tagName){var node = parentNode.firstChild;while(node && node.nodeType != dojo.dom.ELEMENT_NODE){node = node.nextSibling;}
+if(tagName && node && node.tagName && node.tagName.toLowerCase() != tagName.toLowerCase()) {node = dojo.dom.nextElement(node, tagName);}
+return node;}
+dojo.dom.lastElement = dojo.dom.getLastChildElement = function(parentNode, tagName){var node = parentNode.lastChild;while(node && node.nodeType != dojo.dom.ELEMENT_NODE) {node = node.previousSibling;}
+if(tagName && node && node.tagName && node.tagName.toLowerCase() != tagName.toLowerCase()) {node = dojo.dom.prevElement(node, tagName);}
+return node;}
+dojo.dom.nextElement = dojo.dom.getNextSiblingElement = function(node, tagName){if(!node) { return null; }
+do {node = node.nextSibling;} while(node && node.nodeType != dojo.dom.ELEMENT_NODE);if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {return dojo.dom.nextElement(node, tagName);}
+return node;}
+dojo.dom.prevElement = dojo.dom.getPreviousSiblingElement = function(node, tagName){if(!node) { return null; }
+if(tagName) { tagName = tagName.toLowerCase(); }
+do {node = node.previousSibling;} while(node && node.nodeType != dojo.dom.ELEMENT_NODE);if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {return dojo.dom.prevElement(node, tagName);}
+return node;}
+dojo.dom.moveChildren = function(srcNode, destNode, trim){var count = 0;if(trim) {while(srcNode.hasChildNodes() &&
+srcNode.firstChild.nodeType == dojo.dom.TEXT_NODE) {srcNode.removeChild(srcNode.firstChild);}
+while(srcNode.hasChildNodes() &&
+srcNode.lastChild.nodeType == dojo.dom.TEXT_NODE) {srcNode.removeChild(srcNode.lastChild);}}
+while(srcNode.hasChildNodes()){destNode.appendChild(srcNode.firstChild);count++;}
+return count;}
+dojo.dom.copyChildren = function(srcNode, destNode, trim){var clonedNode = srcNode.cloneNode(true);return this.moveChildren(clonedNode, destNode, trim);}
+dojo.dom.replaceChildren = function(node, newChild){var nodes = [];if(dojo.render.html.ie){for(var i=0;i<node.childNodes.length;i++){nodes.push(node.childNodes[i]);}}
+dojo.dom.removeChildren(node);node.appendChild(newChild);for(var i=0;i<nodes.length;i++){dojo.dom.destroyNode(nodes[i]);}}
+dojo.dom.removeChildren = function(node){var count = node.childNodes.length;while(node.hasChildNodes()){ dojo.dom.removeNode(node.firstChild); }
+return count;}
+dojo.dom.replaceNode = function(node, newNode){return node.parentNode.replaceChild(newNode, node);}
+dojo.dom.destroyNode = function(node){if(node.parentNode){node = dojo.dom.removeNode(node);}
+if(node.nodeType != 3){if(dojo.exists("dojo.event.browser.clean")){dojo.event.browser.clean(node);}
+if(dojo.render.html.ie){node.outerHTML='';}}
+}
+dojo.dom.removeNode = function(node){if(node && node.parentNode){return node.parentNode.removeChild(node);}}
+dojo.dom.getAncestors = function(node, filterFunction, returnFirstHit){var ancestors = [];var isFunction = (filterFunction && (filterFunction instanceof Function || typeof filterFunction == "function"));while(node){if(!isFunction || filterFunction(node)){ancestors.push(node);}
+if(returnFirstHit && ancestors.length > 0){return ancestors[0];}
+node = node.parentNode;}
+if(returnFirstHit){ return null; }
+return ancestors;}
+dojo.dom.getAncestorsByTag = function(node, tag, returnFirstHit){tag = tag.toLowerCase();return dojo.dom.getAncestors(node, function(el){return ((el.tagName)&&(el.tagName.toLowerCase() == tag));}, returnFirstHit);}
+dojo.dom.getFirstAncestorByTag = function(node, tag){return dojo.dom.getAncestorsByTag(node, tag, true);}
+dojo.dom.isDescendantOf = function(node, ancestor, guaranteeDescendant){if(guaranteeDescendant && node) { node = node.parentNode; }
+while(node) {if(node == ancestor){return true;}
+node = node.parentNode;}
+return false;}
+dojo.dom.innerXML = function(node){if(node.innerXML){return node.innerXML;}else if (node.xml){return node.xml;}else if(typeof XMLSerializer != "undefined"){return (new XMLSerializer()).serializeToString(node);}}
+dojo.dom.createDocument = function(){var doc = null;var _document = dojo.doc();if(!dj_undef("ActiveXObject")){var prefixes = [ "MSXML2", "Microsoft", "MSXML", "MSXML3" ];for(var i = 0; i<prefixes.length; i++){try{doc = new ActiveXObject(prefixes[i]+".XMLDOM");}catch(e){  };if(doc){ break; }}
+}else if((_document.implementation)&&
+(_document.implementation.createDocument)){doc = _document.implementation.createDocument("", "", null);}
+return doc;}
+dojo.dom.createDocumentFromText = function(str, mimetype){if(!mimetype){ mimetype = "text/xml"; }
+if(!dj_undef("DOMParser")){var parser = new DOMParser();return parser.parseFromString(str, mimetype);}else if(!dj_undef("ActiveXObject")){var domDoc = dojo.dom.createDocument();if(domDoc){domDoc.async = false;domDoc.loadXML(str);return domDoc;}else{dojo.debug("toXml didn't work?");}}else{var _document = dojo.doc();if(_document.createElement){var tmp = _document.createElement("xml");tmp.innerHTML = str;if(_document.implementation && _document.implementation.createDocument){var xmlDoc = _document.implementation.createDocument("foo", "", null);for(var i = 0; i < tmp.childNodes.length; i++) {xmlDoc.importNode(tmp.childNodes.item(i), true);}
+return xmlDoc;}
+return ((tmp.document)&&
+(tmp.document.firstChild ?  tmp.document.firstChild : tmp));}}
+return null;}
+dojo.dom.prependChild = function(node, parent){if(parent.firstChild) {parent.insertBefore(node, parent.firstChild);} else {parent.appendChild(node);}
+return true;}
+dojo.dom.insertBefore = function(node, ref, force){if((force != true)&&
+(node === ref || node.nextSibling === ref)){ return false; }
+var parent = ref.parentNode;parent.insertBefore(node, ref);return true;}
+dojo.dom.insertAfter = function(node, ref, force){var pn = ref.parentNode;if(ref == pn.lastChild){if((force != true)&&(node === ref)){return false;}
+pn.appendChild(node);}else{return this.insertBefore(node, ref.nextSibling, force);}
+return true;}
+dojo.dom.insertAtPosition = function(node, ref, position){if((!node)||(!ref)||(!position)){return false;}
+switch(position.toLowerCase()){case "before":
+return dojo.dom.insertBefore(node, ref);case "after":
+return dojo.dom.insertAfter(node, ref);case "first":
+if(ref.firstChild){return dojo.dom.insertBefore(node, ref.firstChild);}else{ref.appendChild(node);return true;}
+break;default:
+ref.appendChild(node);return true;}}
+dojo.dom.insertAtIndex = function(node, containingNode, insertionIndex){var siblingNodes = containingNode.childNodes;if (!siblingNodes.length || siblingNodes.length == insertionIndex){containingNode.appendChild(node);return true;}
+if(insertionIndex == 0){return dojo.dom.prependChild(node, containingNode);}
+return dojo.dom.insertAfter(node, siblingNodes[insertionIndex-1]);}
+dojo.dom.textContent = function(node, text){if (arguments.length>1) {var _document = dojo.doc();dojo.dom.replaceChildren(node, _document.createTextNode(text));return text;} else {if(node.textContent != undefined){return node.textContent;}
+var _result = "";if (node == null) { return _result; }
+for (var i = 0; i < node.childNodes.length; i++) {switch (node.childNodes[i].nodeType) {case 1:
+case 5:
+_result += dojo.dom.textContent(node.childNodes[i]);break;case 3:
+case 2:
+case 4:
+_result += node.childNodes[i].nodeValue;break;default:
+break;}}
+return _result;}}
+dojo.dom.hasParent = function(node){return Boolean(node && node.parentNode && dojo.dom.isNode(node.parentNode));}
+dojo.dom.isTag = function(node ){if(node && node.tagName) {for(var i=1; i<arguments.length; i++){if(node.tagName==String(arguments[i])){return String(arguments[i]);}}
+}
+return "";}
+dojo.dom.setAttributeNS = function(elem, namespaceURI,attrName, attrValue){if(elem == null || ((elem == undefined)&&(typeof elem == "undefined"))){dojo.raise("No element given to dojo.dom.setAttributeNS");}
+if(!((elem.setAttributeNS == undefined)&&(typeof elem.setAttributeNS == "undefined"))){elem.setAttributeNS(namespaceURI, attrName, attrValue);}else{var ownerDoc = elem.ownerDocument;var attribute = ownerDoc.createNode(
+2,attrName,namespaceURI
+);attribute.nodeValue = attrValue;elem.setAttributeNode(attribute);}}

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/__package__.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/__package__.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/__package__.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,3 @@
+
+dojo.kwCompoundRequire({common: ["dojo.event.common", "dojo.event.topic"],browser: ["dojo.event.browser"],dashboard: ["dojo.event.browser"]
+});dojo.provide("dojo.event.*");
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/__package__.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/browser.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/browser.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/browser.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/browser.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,148 @@
+
+dojo.provide("dojo.event.browser");dojo.require("dojo.event.common");dojo._ie_clobber = new function(){this.clobberNodes = [];function nukeProp(node, prop){try{ node[prop] = null; }catch(e){  }
+try{ delete node[prop]; }catch(e){  }
+try{ node.removeAttribute(prop);}catch(e){  }}
+this.clobber = function(nodeRef){var na;var tna;if(nodeRef){tna = nodeRef.all || nodeRef.getElementsByTagName("*");na = [nodeRef];for(var x=0; x<tna.length; x++){if(tna[x]["__doClobber__"]){na.push(tna[x]);}}
+}else{try{ window.onload = null; }catch(e){}
+na = (this.clobberNodes.length) ? this.clobberNodes : document.all;}
+tna = null;var basis = {};for(var i = na.length-1; i>=0; i=i-1){var el = na[i];try{if(el && el["__clobberAttrs__"]){for(var j=0; j<el.__clobberAttrs__.length; j++){nukeProp(el, el.__clobberAttrs__[j]);}
+nukeProp(el, "__clobberAttrs__");nukeProp(el, "__doClobber__");}}catch(e){ };}
+na = null;}}
+if(dojo.render.html.ie){dojo.addOnUnload(function(){dojo._ie_clobber.clobber();try{if((dojo["widget"])&&(dojo.widget["manager"])){dojo.widget.manager.destroyAll();}}catch(e){}
+if(dojo.widget){for(var name in dojo.widget._templateCache){if(dojo.widget._templateCache[name].node){dojo.dom.destroyNode(dojo.widget._templateCache[name].node);dojo.widget._templateCache[name].node = null;delete dojo.widget._templateCache[name].node;}}
+}
+try{ window.onload = null; }catch(e){}
+try{ window.onunload = null; }catch(e){}
+dojo._ie_clobber.clobberNodes = [];});}
+dojo.event.browser = new function(){var clobberIdx = 0;this.normalizedEventName = function(eventName){switch(eventName){case "CheckboxStateChange":
+case "DOMAttrModified":
+case "DOMMenuItemActive":
+case "DOMMenuItemInactive":
+case "DOMMouseScroll":
+case "DOMNodeInserted":
+case "DOMNodeRemoved":
+case "RadioStateChange":
+return eventName;break;default:
+var lcn = eventName.toLowerCase();return (lcn.indexOf("on") == 0) ? lcn.substr(2) : lcn;break;}}
+this.clean = function(node){if(dojo.render.html.ie){dojo._ie_clobber.clobber(node);}}
+this.addClobberNode = function(node){if(!dojo.render.html.ie){ return; }
+if(!node["__doClobber__"]){node.__doClobber__ = true;dojo._ie_clobber.clobberNodes.push(node);node.__clobberAttrs__ = [];}}
+this.addClobberNodeAttrs = function(node, props){if(!dojo.render.html.ie){ return; }
+this.addClobberNode(node);for(var x=0; x<props.length; x++){node.__clobberAttrs__.push(props[x]);}}
+this.removeListener = function( node,evtName,fp,capture){if(!capture){ var capture = false; }
+evtName = dojo.event.browser.normalizedEventName(evtName);if(evtName == "key"){if(dojo.render.html.ie){this.removeListener(node, "onkeydown", fp, capture);}
+evtName = "keypress";}
+if(node.removeEventListener){node.removeEventListener(evtName, fp, capture);}}
+this.addListener = function(node, evtName, fp, capture, dontFix){if(!node){ return; }
+if(!capture){ var capture = false; }
+evtName = dojo.event.browser.normalizedEventName(evtName);if(evtName == "key"){if(dojo.render.html.ie){this.addListener(node, "onkeydown", fp, capture, dontFix);}
+evtName = "onkeypress";}
+if(!dontFix){var newfp = function(evt){if(!evt){ evt = window.event; }
+var ret = fp(dojo.event.browser.fixEvent(evt, this));if(capture){dojo.event.browser.stopEvent(evt);}
+return ret;}}else{newfp = fp;}
+if(node.addEventListener){node.addEventListener(evtName, newfp, capture);return newfp;}else{evtName = "on"+evtName;if(typeof node[evtName] == "function" ){var oldEvt = node[evtName];node[evtName] = function(e){oldEvt(e);return newfp(e);}}else{node[evtName]=newfp;}
+if(dojo.render.html.ie){this.addClobberNodeAttrs(node, [evtName]);}
+return newfp;}}
+this.isEvent = function(obj){return (typeof obj != "undefined")&&(obj)&&(typeof Event != "undefined")&&(obj.eventPhase);}
+this.currentEvent = null;this.callListener = function(listener, curTarget){if(typeof listener != 'function'){dojo.raise("listener not a function: " + listener);}
+dojo.event.browser.currentEvent.currentTarget = curTarget;return listener.call(curTarget, dojo.event.browser.currentEvent);}
+this._stopPropagation = function(){dojo.event.browser.currentEvent.cancelBubble = true;}
+this._preventDefault = function(){dojo.event.browser.currentEvent.returnValue = false;}
+this.keys = {KEY_BACKSPACE: 8,KEY_TAB: 9,KEY_CLEAR: 12,KEY_ENTER: 13,KEY_SHIFT: 16,KEY_CTRL: 17,KEY_ALT: 18,KEY_PAUSE: 19,KEY_CAPS_LOCK: 20,KEY_ESCAPE: 27,KEY_SPACE: 32,KEY_PAGE_UP: 33,KEY_PAGE_DOWN: 34,KEY_END: 35,KEY_HOME: 36,KEY_LEFT_ARROW: 37,KEY_UP_ARROW: 38,KEY_RIGHT_ARROW: 39,KEY_DOWN_ARROW: 40,KEY_INSERT: 45,KEY_DELETE: 46,KEY_HELP: 47,KEY_LEFT_WINDOW: 91,KEY_RIGHT_WINDOW: 92,KEY_SELECT: 93,KEY_NUMPAD_0: 96,KEY_NUMPAD_1: 97,KEY_NUMPAD_2: 98,KEY_NUMPAD_3: 99,KEY_NUMPAD_4: 100,KEY_NUMPAD_5: 101,KEY_NUMPAD_6: 102,KEY_NUMPAD_7: 103,KEY_NUMPAD_8: 104,KEY_NUMPAD_9: 105,KEY_NUMPAD_MULTIPLY: 106,KEY_NUMPAD_PLUS: 107,KEY_NUMPAD_ENTER: 108,KEY_NUMPAD_MINUS: 109,KEY_NUMPAD_PERIOD: 110,KEY_NUMPAD_DIVIDE: 111,KEY_F1: 112,KEY_F2: 113,KEY_F3: 114,KEY_F4: 115,KEY_F5: 116,KEY_F6: 117,KEY_F7: 118,KEY_F8: 119,KEY_F9: 120,KEY_F10: 121,KEY_F11: 122,KEY_F12: 123,KEY_F13: 124,KEY_F14: 125,KEY_F15: 126,KEY_NUM_LOCK: 144,KEY_SCROLL_LOCK: 145
+};this.revKeys = [];for(var key in this.keys){this.revKeys[this.keys[key]] = key;}
+this.fixEvent = function(evt, sender){if(!evt){if(window["event"]){evt = window.event;}}
+if((evt["type"])&&(evt["type"].indexOf("key") == 0)){evt.keys = this.revKeys;for(var key in this.keys){evt[key] = this.keys[key];}
+if(evt["type"] == "keydown" && dojo.render.html.ie){switch(evt.keyCode){case evt.KEY_SHIFT:
+case evt.KEY_CTRL:
+case evt.KEY_ALT:
+case evt.KEY_CAPS_LOCK:
+case evt.KEY_LEFT_WINDOW:
+case evt.KEY_RIGHT_WINDOW:
+case evt.KEY_SELECT:
+case evt.KEY_NUM_LOCK:
+case evt.KEY_SCROLL_LOCK:
+case evt.KEY_NUMPAD_0:
+case evt.KEY_NUMPAD_1:
+case evt.KEY_NUMPAD_2:
+case evt.KEY_NUMPAD_3:
+case evt.KEY_NUMPAD_4:
+case evt.KEY_NUMPAD_5:
+case evt.KEY_NUMPAD_6:
+case evt.KEY_NUMPAD_7:
+case evt.KEY_NUMPAD_8:
+case evt.KEY_NUMPAD_9:
+case evt.KEY_NUMPAD_PERIOD:
+break;case evt.KEY_NUMPAD_MULTIPLY:
+case evt.KEY_NUMPAD_PLUS:
+case evt.KEY_NUMPAD_ENTER:
+case evt.KEY_NUMPAD_MINUS:
+case evt.KEY_NUMPAD_DIVIDE:
+break;case evt.KEY_PAUSE:
+case evt.KEY_TAB:
+case evt.KEY_BACKSPACE:
+case evt.KEY_ENTER:
+case evt.KEY_ESCAPE:
+case evt.KEY_PAGE_UP:
+case evt.KEY_PAGE_DOWN:
+case evt.KEY_END:
+case evt.KEY_HOME:
+case evt.KEY_LEFT_ARROW:
+case evt.KEY_UP_ARROW:
+case evt.KEY_RIGHT_ARROW:
+case evt.KEY_DOWN_ARROW:
+case evt.KEY_INSERT:
+case evt.KEY_DELETE:
+case evt.KEY_F1:
+case evt.KEY_F2:
+case evt.KEY_F3:
+case evt.KEY_F4:
+case evt.KEY_F5:
+case evt.KEY_F6:
+case evt.KEY_F7:
+case evt.KEY_F8:
+case evt.KEY_F9:
+case evt.KEY_F10:
+case evt.KEY_F11:
+case evt.KEY_F12:
+case evt.KEY_F12:
+case evt.KEY_F13:
+case evt.KEY_F14:
+case evt.KEY_F15:
+case evt.KEY_CLEAR:
+case evt.KEY_HELP:
+evt.key = evt.keyCode;break;default:
+if(evt.ctrlKey || evt.altKey){var unifiedCharCode = evt.keyCode;if(unifiedCharCode >= 65 && unifiedCharCode <= 90 && evt.shiftKey == false){unifiedCharCode += 32;}
+if(unifiedCharCode >= 1 && unifiedCharCode <= 26 && evt.ctrlKey){unifiedCharCode += 96;}
+evt.key = String.fromCharCode(unifiedCharCode);}}
+} else if(evt["type"] == "keypress"){if(dojo.render.html.opera){if(evt.which == 0){evt.key = evt.keyCode;}else if(evt.which > 0){switch(evt.which){case evt.KEY_SHIFT:
+case evt.KEY_CTRL:
+case evt.KEY_ALT:
+case evt.KEY_CAPS_LOCK:
+case evt.KEY_NUM_LOCK:
+case evt.KEY_SCROLL_LOCK:
+break;case evt.KEY_PAUSE:
+case evt.KEY_TAB:
+case evt.KEY_BACKSPACE:
+case evt.KEY_ENTER:
+case evt.KEY_ESCAPE:
+evt.key = evt.which;break;default:
+var unifiedCharCode = evt.which;if((evt.ctrlKey || evt.altKey || evt.metaKey) && (evt.which >= 65 && evt.which <= 90 && evt.shiftKey == false)){unifiedCharCode += 32;}
+evt.key = String.fromCharCode(unifiedCharCode);}}
+}else if(dojo.render.html.ie){if(!evt.ctrlKey && !evt.altKey && evt.keyCode >= evt.KEY_SPACE){evt.key = String.fromCharCode(evt.keyCode);}}else if(dojo.render.html.safari){switch(evt.keyCode){case 25: evt.key = evt.KEY_TAB; evt.shift = true;break;case 63232: evt.key = evt.KEY_UP_ARROW; break;case 63233: evt.key = evt.KEY_DOWN_ARROW; break;case 63234: evt.key = evt.KEY_LEFT_ARROW; break;case 63235: evt.key = evt.KEY_RIGHT_ARROW; break;case 63236: evt.key = evt.KEY_F1; break;case 63237: evt.key = evt.KEY_F2; break;case 63238: evt.key = evt.KEY_F3; break;case 63239: evt.key = evt.KEY_F4; break;case 63240: evt.key = evt.KEY_F5; break;case 63241: evt.key = evt.KEY_F6; break;case 63242: evt.key = evt.KEY_F7; break;case 63243: evt.key = evt.KEY_F8; break;case 63244: evt.key = evt.KEY_F9; break;case 63245: evt.key = evt.KEY_F10; break;case 63246: evt.key = evt.KEY_F11; break;case 63247: evt.key = evt.KEY_F12; break;case 63250: evt.key = evt.KEY_PAUSE; break;case 63272: evt.key = evt
 .KEY_DELETE; break;case 63273: evt.key = evt.KEY_HOME; break;case 63275: evt.key = evt.KEY_END; break;case 63276: evt.key = evt.KEY_PAGE_UP; break;case 63277: evt.key = evt.KEY_PAGE_DOWN; break;case 63302: evt.key = evt.KEY_INSERT; break;case 63248://prtscr
+case 63249://scrolllock
+case 63289://numlock
+break;default:
+evt.key = evt.charCode >= evt.KEY_SPACE ? String.fromCharCode(evt.charCode) : evt.keyCode;}}else{evt.key = evt.charCode > 0 ? String.fromCharCode(evt.charCode) : evt.keyCode;}}
+}
+if(dojo.render.html.ie){if(!evt.target){ evt.target = evt.srcElement; }
+if(!evt.currentTarget){ evt.currentTarget = (sender ? sender : evt.srcElement); }
+if(!evt.layerX){ evt.layerX = evt.offsetX; }
+if(!evt.layerY){ evt.layerY = evt.offsetY; }
+var doc = (evt.srcElement && evt.srcElement.ownerDocument) ? evt.srcElement.ownerDocument : document;var docBody = ((dojo.render.html.ie55)||(doc["compatMode"] == "BackCompat")) ? doc.body : doc.documentElement;if(!evt.pageX){ evt.pageX = evt.clientX + (docBody.scrollLeft || 0) }
+if(!evt.pageY){ evt.pageY = evt.clientY + (docBody.scrollTop || 0) }
+if(evt.type == "mouseover"){ evt.relatedTarget = evt.fromElement; }
+if(evt.type == "mouseout"){ evt.relatedTarget = evt.toElement; }
+this.currentEvent = evt;evt.callListener = this.callListener;evt.stopPropagation = this._stopPropagation;evt.preventDefault = this._preventDefault;}
+return evt;}
+this.stopEvent = function(evt){if(window.event){evt.cancelBubble = true;evt.returnValue = false;}else{evt.preventDefault();evt.stopPropagation();}}
+}

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/browser.js
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message