tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkuhn...@apache.org
Subject svn commit: r503984 [23/29] - in /tapestry/tapestry4/trunk: ./ tapestry-examples/TimeTracker/src/context/WEB-INF/ tapestry-framework/ tapestry-framework/src/java/org/apache/tapestry/asset/ tapestry-framework/src/java/org/apache/tapestry/dojo/ tapestry-...
Date Tue, 06 Feb 2007 05:01:49 GMT
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SplitContainer.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SplitContainer.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SplitContainer.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SplitContainer.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,36 @@
+
+dojo.provide("dojo.widget.SplitContainer");dojo.require("dojo.widget.*");dojo.require("dojo.widget.ContentPane");dojo.require("dojo.widget.HtmlWidget");dojo.require("dojo.html.style");dojo.require("dojo.html.layout");dojo.require("dojo.html.selection");dojo.require("dojo.io.cookie");dojo.widget.defineWidget(
+"dojo.widget.SplitContainer",dojo.widget.HtmlWidget,function(){this.sizers = [];},{isContainer: true,templateCssPath: dojo.uri.moduleUri("dojo.widget", "templates/SplitContainer.css"),activeSizing: false,sizerWidth: 15,orientation: 'horizontal',persist: true,postMixInProperties: function(){dojo.widget.SplitContainer.superclass.postMixInProperties.apply(this, arguments);this.isHorizontal = (this.orientation == 'horizontal');},fillInTemplate: function(){dojo.widget.SplitContainer.superclass.fillInTemplate.apply(this, arguments);dojo.html.addClass(this.domNode, "dojoSplitContainer");if (dojo.render.html.moz) {this.domNode.style.overflow = '-moz-scrollbars-none';}
+var content = dojo.html.getContentBox(this.domNode);this.paneWidth = content.width;this.paneHeight = content.height;},onResized: function(e){var content = dojo.html.getContentBox(this.domNode);this.paneWidth = content.width;this.paneHeight = content.height;this._layoutPanels();},postCreate: function(args, fragment, parentComp){dojo.widget.SplitContainer.superclass.postCreate.apply(this, arguments);for(var i=0; i<this.children.length; i++){with(this.children[i].domNode.style){position = "absolute";}
+dojo.html.addClass(this.children[i].domNode,"dojoSplitPane");if(i == this.children.length-1){break;}
+this._addSizer();}
+if (typeof this.sizerWidth == "object") {try {this.sizerWidth = parseInt(this.sizerWidth.toString());} catch(e) { this.sizerWidth = 15; }}
+this.virtualSizer = document.createElement('div');this.virtualSizer.style.position = 'absolute';this.virtualSizer.style.display = 'none';this.virtualSizer.style.zIndex = 10;this.virtualSizer.className = this.isHorizontal ? 'dojoSplitContainerVirtualSizerH' : 'dojoSplitContainerVirtualSizerV';this.domNode.appendChild(this.virtualSizer);dojo.html.disableSelection(this.virtualSizer);if(this.persist){this._restoreState();}
+this.resizeSoon();},_injectChild: function(child) {with(child.domNode.style){position = "absolute";}
+dojo.html.addClass(child.domNode,"dojoSplitPane");},_addSizer: function() {var i = this.sizers.length;this.sizers[i] = document.createElement('div');this.sizers[i].style.position = 'absolute';this.sizers[i].className = this.isHorizontal ? 'dojoSplitContainerSizerH' : 'dojoSplitContainerSizerV';var self = this;var handler = (function(){ var sizer_i = i; return function(e){ self.beginSizing(e, sizer_i); }})();dojo.event.connect(this.sizers[i], "onmousedown", handler);this.domNode.appendChild(this.sizers[i]);dojo.html.disableSelection(this.sizers[i]);},removeChild: function(widget){if (this.sizers.length > 0) {for(var x=0; x<this.children.length; x++){if(this.children[x] === widget){var i = this.sizers.length - 1;this.domNode.removeChild(this.sizers[i]);this.sizers.length = i;break;}}
+}
+dojo.widget.SplitContainer.superclass.removeChild.call(this, widget, arguments);this.onResized();},addChild: function(widget){dojo.widget.SplitContainer.superclass.addChild.apply(this, arguments);this._injectChild(widget);if (this.children.length > 1) {this._addSizer();}
+this._layoutPanels();},_layoutPanels: function(){if (this.children.length == 0){ return; }
+var space = this.isHorizontal ? this.paneWidth : this.paneHeight;if (this.children.length > 1){space -= this.sizerWidth * (this.children.length - 1);}
+var out_of = 0;for(var i=0; i<this.children.length; i++){out_of += this.children[i].sizeShare;}
+var pix_per_unit = space / out_of;var total_size = 0;for(var i=0; i<this.children.length-1; i++){var size = Math.round(pix_per_unit * this.children[i].sizeShare);this.children[i].sizeActual = size;total_size += size;}
+this.children[this.children.length-1].sizeActual = space - total_size;this._checkSizes();var pos = 0;var size = this.children[0].sizeActual;this._movePanel(this.children[0], pos, size);this.children[0].position = pos;pos += size;for(var i=1; i<this.children.length; i++){this._moveSlider(this.sizers[i-1], pos, this.sizerWidth);this.sizers[i-1].position = pos;pos += this.sizerWidth;size = this.children[i].sizeActual;this._movePanel(this.children[i], pos, size);this.children[i].position = pos;pos += size;}},_movePanel: function( panel, pos, size){if (this.isHorizontal){panel.domNode.style.left = pos + 'px';panel.domNode.style.top = 0;panel.resizeTo(size, this.paneHeight);}else{panel.domNode.style.left = 0;panel.domNode.style.top = pos + 'px';panel.resizeTo(this.paneWidth, size);}},_moveSlider: function( slider, pos, size){if (this.isHorizontal){slider.style.left = pos + 'px';slider.style.top = 0;dojo.html.setMarginBox(slider, { width: size, height: this.paneHeight });}else{slid
 er.style.left = 0;slider.style.top = pos + 'px';dojo.html.setMarginBox(slider, { width: this.paneWidth, height: size });}},_growPane: function(growth, pane){if (growth > 0){if (pane.sizeActual > pane.sizeMin){if ((pane.sizeActual - pane.sizeMin) > growth){pane.sizeActual = pane.sizeActual - growth;growth = 0;}else{growth -= pane.sizeActual - pane.sizeMin;pane.sizeActual = pane.sizeMin;}}
+}
+return growth;},_checkSizes: function(){var total_min_size = 0;var total_size = 0;for(var i=0; i<this.children.length; i++){total_size += this.children[i].sizeActual;total_min_size += this.children[i].sizeMin;}
+if (total_min_size <= total_size){var growth = 0;for(var i=0; i<this.children.length; i++){if (this.children[i].sizeActual < this.children[i].sizeMin){growth += this.children[i].sizeMin - this.children[i].sizeActual;this.children[i].sizeActual = this.children[i].sizeMin;}}
+if (growth > 0){if (this.isDraggingLeft){for(var i=this.children.length-1; i>=0; i--){growth = this._growPane(growth, this.children[i]);}}else{for(var i=0; i<this.children.length; i++){growth = this._growPane(growth, this.children[i]);}}
+}}else{for(var i=0; i<this.children.length; i++){this.children[i].sizeActual = Math.round(total_size * (this.children[i].sizeMin / total_min_size));}}
+},beginSizing: function(e, i){this.paneBefore = this.children[i];this.paneAfter = this.children[i+1];this.isSizing = true;this.sizingSplitter = this.sizers[i];this.originPos = dojo.html.getAbsolutePosition(this.children[0].domNode, true, dojo.html.boxSizing.MARGIN_BOX);if (this.isHorizontal){var client = (e.layerX ? e.layerX : e.offsetX);var screen = e.pageX;this.originPos = this.originPos.x;}else{var client = (e.layerY ? e.layerY : e.offsetY);var screen = e.pageY;this.originPos = this.originPos.y;}
+this.startPoint = this.lastPoint = screen;this.screenToClientOffset = screen - client;this.dragOffset = this.lastPoint - this.paneBefore.sizeActual - this.originPos - this.paneBefore.position;if (!this.activeSizing){this._showSizingLine();}
+dojo.event.connect(document.documentElement, "onmousemove", this, "changeSizing");dojo.event.connect(document.documentElement, "onmouseup", this, "endSizing");dojo.event.browser.stopEvent(e);},changeSizing: function(e){this.lastPoint = this.isHorizontal ? e.pageX : e.pageY;if (this.activeSizing){this.movePoint();this._updateSize();}else{this.movePoint();this._moveSizingLine();}
+dojo.event.browser.stopEvent(e);},endSizing: function(e){if (!this.activeSizing){this._hideSizingLine();}
+this._updateSize();this.isSizing = false;dojo.event.disconnect(document.documentElement, "onmousemove", this, "changeSizing");dojo.event.disconnect(document.documentElement, "onmouseup", this, "endSizing");if(this.persist){this._saveState(this);}},movePoint: function(){var p = this.lastPoint - this.screenToClientOffset;var a = p - this.dragOffset;a = this.legaliseSplitPoint(a);p = a + this.dragOffset;this.lastPoint = p + this.screenToClientOffset;},legaliseSplitPoint: function(a){a += this.sizingSplitter.position;this.isDraggingLeft = (a > 0) ? true : false;if (!this.activeSizing){if (a < this.paneBefore.position + this.paneBefore.sizeMin){a = this.paneBefore.position + this.paneBefore.sizeMin;}
+if (a > this.paneAfter.position + (this.paneAfter.sizeActual - (this.sizerWidth + this.paneAfter.sizeMin))){a = this.paneAfter.position + (this.paneAfter.sizeActual - (this.sizerWidth + this.paneAfter.sizeMin));}}
+a -= this.sizingSplitter.position;this._checkSizes();return a;},_updateSize: function(){var pos = this.lastPoint - this.dragOffset - this.originPos;var start_region = this.paneBefore.position;var end_region   = this.paneAfter.position + this.paneAfter.sizeActual;this.paneBefore.sizeActual = pos - start_region;this.paneAfter.position    = pos + this.sizerWidth;this.paneAfter.sizeActual  = end_region - this.paneAfter.position;for(var i=0; i<this.children.length; i++){this.children[i].sizeShare = this.children[i].sizeActual;}
+this._layoutPanels();},_showSizingLine: function(){this._moveSizingLine();if (this.isHorizontal){dojo.html.setMarginBox(this.virtualSizer, { width: this.sizerWidth, height: this.paneHeight });}else{dojo.html.setMarginBox(this.virtualSizer, { width: this.paneWidth, height: this.sizerWidth });}
+this.virtualSizer.style.display = 'block';},_hideSizingLine: function(){this.virtualSizer.style.display = 'none';},_moveSizingLine: function(){var pos = this.lastPoint - this.startPoint + this.sizingSplitter.position;if (this.isHorizontal){this.virtualSizer.style.left = pos + 'px';}else{var pos = (this.lastPoint - this.startPoint) + this.sizingSplitter.position;this.virtualSizer.style.top = pos + 'px';}},_getCookieName: function(i) {return this.widgetId + "_" + i;},_restoreState: function () {for(var i=0; i<this.children.length; i++) {var cookieName = this._getCookieName(i);var cookieValue = dojo.io.cookie.getCookie(cookieName);if (cookieValue != null) {var pos = parseInt(cookieValue);if (typeof pos == "number") {this.children[i].sizeShare=pos;}}
+}},_saveState: function (){for(var i=0; i<this.children.length; i++) {var cookieName = this._getCookieName(i);dojo.io.cookie.setCookie(cookieName, this.children[i].sizeShare, null, null, null, null);}}
+});dojo.lang.extend(dojo.widget.Widget, {sizeMin: 10,sizeShare: 10
+});dojo.widget.defineWidget(
+"dojo.widget.SplitContainerPanel",dojo.widget.ContentPane,{}
+);
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SvgButton.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SvgButton.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SvgButton.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SvgButton.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,24 @@
+
+dojo.provide("dojo.widget.SvgButton");dojo.require("dojo.experimental");dojo.experimental("dojo.widget.SvgButton");dojo.widget.SvgButton = function(){dojo.widget.DomButton.call(this);dojo.widget.SvgWidget.call(this);this.onFoo = function(){ alert("bar"); }
+this.label = "huzzah!";this.setLabel = function(x, y, textSize, label, shape){var coords = dojo.widget.SvgButton.prototype.coordinates(x, y, textSize, label, shape);var textString = "";switch(shape) {case "ellipse":
+textString = "<text x='"+ coords[6] + "' y='"+ coords[7] + "'>"+ label + "</text>";break;case "rectangle":
+textString = "";break;case "circle":
+textString = "";break;}
+return textString;}
+this.fillInTemplate = function(x, y, textSize, label, shape){this.textSize = textSize || 12;this.label = label;var textWidth = this.label.length*this.textSize ;}}
+dojo.inherits(dojo.widget.SvgButton, dojo.widget.DomButton);dojo.widget.SvgButton.prototype.shapeString = function(x, y, textSize, label, shape) {switch(shape) {case "ellipse":
+var coords = dojo.widget.SvgButton.prototype.coordinates(x, y, textSize, label, shape)
+return "<ellipse cx='"+ coords[4]+"' cy='"+ coords[5]+"' rx='"+ coords[2]+"' ry='"+ coords[3]+"'/>";break;case "rect":
+return "";break;case "circle":
+return "";break;}}
+dojo.widget.SvgButton.prototype.coordinates = function(x, y, textSize, label, shape) {switch(shape) {case "ellipse":
+var buttonWidth = label.length*textSize;var buttonHeight = textSize*2.5
+var rx = buttonWidth/2;var ry = buttonHeight/2;var cx = rx + x;var cy = ry + y;var textX = cx - rx*textSize/25;var textY = cy*1.1;return [buttonWidth, buttonHeight, rx, ry, cx, cy, textX, textY];break;case "rectangle":
+return "";break;case "circle":
+return "";break;}}
+dojo.widget.SvgButton.prototype.labelString = function(x, y, textSize, label, shape){var textString = "";var coords = dojo.widget.SvgButton.prototype.coordinates(x, y, textSize, label, shape);switch(shape) {case "ellipse":
+textString = "<text x='"+ coords[6] + "' y='"+ coords[7] + "'>"+ label + "</text>";break;case "rectangle":
+textString = "";break;case "circle":
+textString = "";break;}
+return textString;}
+dojo.widget.SvgButton.prototype.templateString = function(x, y, textSize, label, shape) {return "<g class='dojoButton' dojoAttachEvent='onClick; onMouseMove: onFoo;' dojoAttachPoint='labelNode'>"+ dojo.widgets.SVGButton.prototype.shapeString(x, y, textSize, label, shape) + dojo.widget.SVGButton.prototype.labelString(x, y, textSize, label, shape) + "</g>";}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SvgWidget.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SvgWidget.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SvgWidget.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SvgWidget.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,12 @@
+
+dojo.require("dojo.widget.DomWidget");dojo.provide("dojo.widget.SvgWidget");dojo.provide("dojo.widget.SVGWidget");dojo.require("dojo.dom");dojo.require("dojo.experimental");dojo.experimental("dojo.widget.SvgWidget");dojo.widget.declare(
+"dojo.widget.SvgWidget",dojo.widget.DomWidget,{createNodesFromText: function(txt, wrap){return dojo.svg.createNodesFromText(txt, wrap);}});dojo.widget.SVGWidget = dojo.widget.SvgWidget;try{(function(){var tf = function(){var rw = new function(){dojo.widget.SvgWidget.call(this);this.buildRendering = function(){ return; }
+this.destroyRendering = function(){ return; }
+this.postInitialize = function(){ return; }
+this.widgetType = "SVGRootWidget";this.domNode = document.documentElement;}
+var wm = dojo.widget.manager;wm.root = rw;wm.add(rw);wm.getWidgetFromNode = function(node){var filter = function(x){if(x.domNode == node){return true;}}
+var widgets = [];while((node)&&(widgets.length < 1)){widgets = this.getWidgetsByFilter(filter);node = node.parentNode;}
+if(widgets.length > 0){return widgets[0];}else{return null;}}
+wm.getWidgetFromEvent = function(domEvt){return this.getWidgetFromNode(domEvt.target);}
+wm.getWidgetFromPrimitive = wm.getWidgetFromNode;}
+dojo.event.connect(dojo.hostenv, "loaded", tf);})();}catch(e){ alert(e); }

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SwtWidget.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SwtWidget.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SwtWidget.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/SwtWidget.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,3 @@
+
+dojo.provide("dojo.widget.SwtWidget");dojo.require("dojo.experimental");dojo.experimental("dojo.widget.SwtWidget");dojo.require("dojo.event.*");dojo.require("dojo.widget.Widget");dojo.require("dojo.uri.*");dojo.require("dojo.lang.func");dojo.require("dojo.lang.extras");try{importPackage(Packages.org.eclipse.swt.widgets);dojo.declare("dojo.widget.SwtWidget", dojo.widget.Widget,function() {if((arguments.length>0)&&(typeof arguments[0] == "object")){this.create(arguments[0]);}},{display: null,shell: null,show: function(){ },hide: function(){ },addChild: function(){ },registerChild: function(){ },addWidgetAsDirectChild: function(){ },removeChild: function(){ },destroyRendering: function(){ },postInitialize: function(){ }});dojo.widget.SwtWidget.prototype.display = new Display();dojo.widget.SwtWidget.prototype.shell = new Shell(dojo.widget.SwtWidget.prototype.display);dojo.widget.manager.startShell = function(){var sh = dojo.widget.SwtWidget.prototype.shell;var d = dojo.widget.Sw
 tWidget.prototype.display;sh.open();while(!sh.isDisposed()){dojo.widget.manager.doNext();if(!d.readAndDispatch()){d.sleep();}}
+d.dispose();};}catch(e){dojo.debug("dojo.widget.SwtWidget not loaded. SWT classes not available");}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TabContainer.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TabContainer.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TabContainer.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TabContainer.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,26 @@
+
+dojo.provide("dojo.widget.TabContainer");dojo.require("dojo.lang.func");dojo.require("dojo.widget.*");dojo.require("dojo.widget.PageContainer");dojo.require("dojo.event.*");dojo.require("dojo.html.selection");dojo.require("dojo.widget.html.layout");dojo.widget.defineWidget("dojo.widget.TabContainer", dojo.widget.PageContainer, {labelPosition: "top",closeButton: "none",templateString: null,templatePath: dojo.uri.moduleUri("dojo.widget", "templates/TabContainer.html"),templateCssPath: dojo.uri.moduleUri("dojo.widget", "templates/TabContainer.css"),fillInTemplate: function() {this.tablist = dojo.widget.createWidget("TabController",{id: this.widgetId + "_tablist",labelPosition: this.labelPosition,doLayout: this.doLayout,containerId: this.widgetId
+}, this.tablistNode);dojo.widget.TabContainer.superclass.fillInTemplate.apply(this, arguments);},postCreate: function(args, frag) {dojo.widget.TabContainer.superclass.postCreate.apply(this, arguments);this.onResized();},_setupChild: function(tab){if(this.closeButton=="tab" || this.closeButton=="pane"){tab.closable=true;}
+dojo.html.addClass(tab.domNode, "dojoTabPane");dojo.widget.TabContainer.superclass._setupChild.apply(this, arguments);},onResized: function(){if(!this.doLayout){ return; }
+var labelAlign=this.labelPosition.replace(/-h/,"");var children = [
+{domNode: this.tablist.domNode, layoutAlign: labelAlign},{domNode: this.containerNode, layoutAlign: "client"}
+];dojo.widget.html.layout(this.domNode, children);if(this.selectedChildWidget){var containerSize = dojo.html.getContentBox(this.containerNode);this.selectedChildWidget.resizeTo(containerSize.width, containerSize.height);}},onKey: function(e){if(e.keyCode == e.KEY_UP_ARROW && e.ctrlKey){var button = this.correspondingTabButton || this.selectedTabWidget.tabButton;button.focus();dojo.event.browser.stopEvent(e);}else if(e.keyCode == e.KEY_DELETE && e.altKey){if (this.selectedChildWidget.closable){this.closeChild(this.selectedChildWidget);dojo.event.browser.stopEvent(e);}}
+},destroy: function(){this.tablist.destroy();dojo.widget.TabContainer.superclass.destroy.apply(this, arguments);}});dojo.widget.defineWidget(
+"dojo.widget.TabController",dojo.widget.PageController,{templateString: "<div wairole='tablist' dojoAttachEvent='onKey'></div>",labelPosition: "top",doLayout: true,"class": "",buttonWidget: "TabButton",postMixInProperties: function() {if(!this["class"]){this["class"] = "dojoTabLabels-" + this.labelPosition + (this.doLayout ? "" : " dojoTabNoLayout");}
+dojo.widget.TabController.superclass.postMixInProperties.apply(this, arguments);}}
+);dojo.widget.defineWidget("dojo.widget.TabButton", dojo.widget.PageButton,{templateString: "<div class='dojoTab' dojoAttachEvent='onClick'>"
++"<div dojoAttachPoint='innerDiv'>"
++"<span dojoAttachPoint='titleNode' tabIndex='-1' waiRole='tab'>${this.label}</span>"
++"<span dojoAttachPoint='closeButtonNode' class='close closeImage' style='${this.closeButtonStyle}'"
++"    dojoAttachEvent='onMouseOver:onCloseButtonMouseOver; onMouseOut:onCloseButtonMouseOut; onClick:onCloseButtonClick'></span>"
++"</div>"
++"</div>",postMixInProperties: function(){this.closeButtonStyle = this.closeButton ? "" : "display: none";dojo.widget.TabButton.superclass.postMixInProperties.apply(this, arguments);},fillInTemplate: function(){dojo.html.disableSelection(this.titleNode);dojo.widget.TabButton.superclass.fillInTemplate.apply(this, arguments);},onCloseButtonClick: function( evt){evt.stopPropagation();dojo.widget.TabButton.superclass.onCloseButtonClick.apply(this, arguments);}});dojo.widget.defineWidget(
+"dojo.widget.a11y.TabButton",dojo.widget.TabButton,{imgPath: dojo.uri.moduleUri("dojo.widget", "templates/images/tab_close.gif"),templateString: "<div class='dojoTab' dojoAttachEvent='onClick;onKey'>"
++"<div dojoAttachPoint='innerDiv'>"
++"<span dojoAttachPoint='titleNode' tabIndex='-1' waiRole='tab'>${this.label}</span>"
++"<img class='close' src='${this.imgPath}' alt='[x]' style='${this.closeButtonStyle}'"
++"    dojoAttachEvent='onClick:onCloseButtonClick'>"
++"</div>"
++"</div>"
+}
+);
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TaskBar.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TaskBar.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TaskBar.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TaskBar.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,8 @@
+
+dojo.provide("dojo.widget.TaskBar");dojo.require("dojo.widget.*");dojo.require("dojo.widget.FloatingPane");dojo.require("dojo.widget.HtmlWidget");dojo.require("dojo.event.*");dojo.require("dojo.html.selection");dojo.widget.defineWidget(
+"dojo.widget.TaskBarItem",dojo.widget.HtmlWidget,{iconSrc: '',caption: 'Untitled',templatePath: dojo.uri.moduleUri("dojo.widget", "templates/TaskBarItemTemplate.html"),templateCssPath: dojo.uri.moduleUri("dojo.widget", "templates/TaskBar.css"),fillInTemplate: function() {if (this.iconSrc) {var img = document.createElement("img");img.src = this.iconSrc;this.domNode.appendChild(img);}
+this.domNode.appendChild(document.createTextNode(this.caption));dojo.html.disableSelection(this.domNode);},postCreate: function() {this.window=dojo.widget.getWidgetById(this.windowId);this.window.explodeSrc = this.domNode;dojo.event.connect(this.window, "destroy", this, "destroy")
+},onClick: function() {this.window.toggleDisplay();}});dojo.widget.defineWidget(
+"dojo.widget.TaskBar",dojo.widget.FloatingPane,function(){this._addChildStack = [];},{resizable: false,titleBarDisplay: false,addChild: function( child) {if(!this.containerNode){this._addChildStack.push(child);}else if(this._addChildStack.length > 0){var oarr = this._addChildStack;this._addChildStack = [];dojo.lang.forEach(oarr, this.addChild, this);}
+var tbi = dojo.widget.createWidget("TaskBarItem",{windowId: child.widgetId,caption: child.title,iconSrc: child.iconSrc
+});dojo.widget.TaskBar.superclass.addChild.call(this,tbi);}});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Textbox.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Textbox.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Textbox.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Textbox.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,9 @@
+
+dojo.provide("dojo.widget.Textbox");dojo.require("dojo.widget.*");dojo.require("dojo.widget.HtmlWidget");dojo.require("dojo.widget.Manager");dojo.require("dojo.widget.Parse");dojo.require("dojo.xml.Parse");dojo.require("dojo.lang.array");dojo.require("dojo.lang.common");dojo.require("dojo.string.extras");dojo.require("dojo.i18n.common");dojo.requireLocalization("dojo.widget", "validate", null, "zh-cn,de,ja,fr,it,ROOT");dojo.widget.defineWidget(
+"dojo.widget.Textbox",dojo.widget.HtmlWidget,{className: "",name: "",value: "",type: "",trim: false,uppercase: false,lowercase: false,ucFirst: false,digit: false,htmlfloat: "none",templatePath: dojo.uri.moduleUri("dojo.widget", "templates/Textbox.html"),textbox: null,fillInTemplate: function() {this.textbox.value = this.value;this.filter();},filter: function() {if (this.trim) {this.textbox.value = this.textbox.value.replace(/(^\s*|\s*$)/g, "");}
+if (this.uppercase) {this.textbox.value = this.textbox.value.toUpperCase();}
+if (this.lowercase) {this.textbox.value = this.textbox.value.toLowerCase();}
+if (this.ucFirst) {this.textbox.value = dojo.string.capitalize(this.textbox.value);}
+if (this.digit) {this.textbox.value = this.textbox.value.replace(/\D/g, "");}},onfocus: function() {},onblur: function() { this.filter(); },mixInProperties: function(localProperties, frag) {dojo.widget.Textbox.superclass.mixInProperties.apply(this, arguments);if ( localProperties["class"] ) {this.className = localProperties["class"];}}
+}
+);
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TimePicker.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TimePicker.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TimePicker.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TimePicker.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,25 @@
+
+dojo.provide("dojo.widget.TimePicker");dojo.require("dojo.widget.*");dojo.require("dojo.widget.HtmlWidget");dojo.require("dojo.event.*");dojo.require("dojo.date.serialize");dojo.require("dojo.date.format");dojo.require("dojo.dom");dojo.require("dojo.html.style");dojo.requireLocalization("dojo.i18n.cldr", "gregorian", null, "zh-cn,zh-hk,de,ko,zh-tw,zh,ja,fi,pt-br,fr,es,ROOT,hu,en,it,sv,nl,pt");dojo.requireLocalization("dojo.widget", "TimePicker", null, "it,ROOT");dojo.widget.defineWidget(
+"dojo.widget.TimePicker",dojo.widget.HtmlWidget,function(){this.time = "";this.useDefaultTime = false;this.useDefaultMinutes = false;this.roundUpMinutes = true;this.storedTime = "";this.currentTime = {};this.classNames = {selectedTime: "selectedItem"
+};this.any = "any";this.selectedTime = {hour: "",minute: "",amPm: "",anyTime: false
+};this.hourIndexMap = ["", 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 11, 0];this.minuteIndexMap = [0, 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 11];},{isContainer: false,templatePath: dojo.uri.moduleUri("dojo.widget", "templates/TimePicker.html"),templateCssPath: dojo.uri.moduleUri("dojo.widget", "templates/TimePicker.css"),postMixInProperties: function(localProperties, frag) {dojo.widget.TimePicker.superclass.postMixInProperties.apply(this, arguments);this.calendar = dojo.i18n.getLocalization("dojo.i18n.cldr", "gregorian", this.lang);this.widgetStrings = dojo.i18n.getLocalization("dojo.widget", "TimePicker", this.lang);},fillInTemplate: function(args, frag){var source = this.getFragNodeRef(frag);dojo.html.copyStyle(this.domNode, source);if(args.value){if(args.value instanceof Date){this.storedTime = dojo.date.toRfc3339(args.value);}else{this.storedTime = args.value;}}
+this.initData();this.initUI();},initData: function() {if(this.storedTime.indexOf("T")!=-1 && this.storedTime.split("T")[1] && this.storedTime!=" " && this.storedTime.split("T")[1]!="any"){this.time = dojo.widget.TimePicker.util.fromRfcDateTime(this.storedTime, this.useDefaultMinutes, this.selectedTime.anyTime, !this.roundUpMinutes);}else if(this.useDefaultTime){this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", this.useDefaultMinutes, this.selectedTime.anyTime, !this.roundUpMinutes);}else{this.selectedTime.anyTime = true;this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", 0, 1, !this.roundUpMinutes);}},initUI: function() {if(!this.selectedTime.anyTime && this.time) {var amPmHour = dojo.widget.TimePicker.util.toAmPmHour(this.time.getHours());var hour = amPmHour[0];var isAm = amPmHour[1];var minute = this.time.getMinutes();var minuteIndex = Math.floor(minute / 5);this.onClearSelectedHour();this.setSelectedHour(this.hourIndexMap[hour]);this.onClearSelectedMinut
 e();this.setSelectedMinute(this.minuteIndexMap[minuteIndex]);if(!this.roundUpMinutes){this.selectedTime["minute"] = minute < 10 ? "0" + minute.toString() : minute.toString();}
+this.onSetSelectedAmPm(isAm);} else {this.onSetSelectedAnyTime();}},setTime: function(date) {if(date) {this.selectedTime.anyTime = false;this.setDateTime(dojo.date.toRfc3339(date));} else {this.selectedTime.anyTime = true;}
+this.initData();this.initUI();},setDateTime: function(rfcDate) {this.storedTime = rfcDate;},onClearSelectedHour: function(evt) {this.clearSelectedHour();},onClearSelectedMinute: function(evt) {this.clearSelectedMinute();},onClearSelectedAmPm: function(evt) {this.clearSelectedAmPm();},onClearSelectedAnyTime: function(evt) {this.clearSelectedAnyTime();if(this.selectedTime.anyTime) {this.selectedTime.anyTime = false;this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", this.useDefaultMinutes, 0, !this.roundUpMinutes);this.initUI();}},clearSelectedHour: function() {var hourNodes = this.hourContainerNode.getElementsByTagName("td");for (var i=0; i<hourNodes.length; i++) {dojo.html.setClass(hourNodes.item(i), "");}},clearSelectedMinute: function() {var minuteNodes = this.minuteContainerNode.getElementsByTagName("td");for (var i=0; i<minuteNodes.length; i++) {dojo.html.setClass(minuteNodes.item(i), "");}},clearSelectedAmPm: function() {var amPmNodes = this.amPmContainerNode.ge
 tElementsByTagName("td");for (var i=0; i<amPmNodes.length; i++) {dojo.html.setClass(amPmNodes.item(i), "");}},clearSelectedAnyTime: function() {dojo.html.setClass(this.anyTimeContainerNode, "anyTimeContainer");},onSetSelectedHour: function(evt) {this.onClearSelectedAnyTime();this.onClearSelectedHour();this.setSelectedHour(evt);this.onSetTime();},setSelectedHour: function(evt) {if(evt && evt.target) {if(evt.target.nodeType == dojo.dom.ELEMENT_NODE) {var eventTarget = evt.target;} else {var eventTarget = evt.target.parentNode;}
+dojo.event.browser.stopEvent(evt);dojo.html.setClass(eventTarget, this.classNames.selectedTime);this.selectedTime["hour"] = eventTarget.innerHTML;} else if (!isNaN(evt)) {var hourNodes = this.hourContainerNode.getElementsByTagName("td");if(hourNodes.item(evt)) {dojo.html.setClass(hourNodes.item(evt), this.classNames.selectedTime);this.selectedTime["hour"] = hourNodes.item(evt).innerHTML;}}
+this.selectedTime.anyTime = false;},onSetSelectedMinute: function(evt) {this.onClearSelectedAnyTime();this.onClearSelectedMinute();this.setSelectedMinute(evt);this.selectedTime.anyTime = false;this.onSetTime();},setSelectedMinute: function(evt) {if(evt && evt.target) {if(evt.target.nodeType == dojo.dom.ELEMENT_NODE) {var eventTarget = evt.target;} else {var eventTarget = evt.target.parentNode;}
+dojo.event.browser.stopEvent(evt);dojo.html.setClass(eventTarget, this.classNames.selectedTime);this.selectedTime["minute"] = eventTarget.innerHTML;} else if (!isNaN(evt)) {var minuteNodes = this.minuteContainerNode.getElementsByTagName("td");if(minuteNodes.item(evt)) {dojo.html.setClass(minuteNodes.item(evt), this.classNames.selectedTime);this.selectedTime["minute"] = minuteNodes.item(evt).innerHTML;}}
+},onSetSelectedAmPm: function(evt) {this.onClearSelectedAnyTime();this.onClearSelectedAmPm();this.setSelectedAmPm(evt);this.selectedTime.anyTime = false;this.onSetTime();},setSelectedAmPm: function(evt) {var eventTarget = evt.target;if(evt && eventTarget) {if(eventTarget.nodeType != dojo.dom.ELEMENT_NODE) {eventTarget = eventTarget.parentNode;}
+dojo.event.browser.stopEvent(evt);this.selectedTime.amPm = eventTarget.id;dojo.html.setClass(eventTarget, this.classNames.selectedTime);} else {evt = evt ? 0 : 1;var amPmNodes = this.amPmContainerNode.getElementsByTagName("td");if(amPmNodes.item(evt)) {this.selectedTime.amPm = amPmNodes.item(evt).id;dojo.html.setClass(amPmNodes.item(evt), this.classNames.selectedTime);}}
+},onSetSelectedAnyTime: function(evt) {this.onClearSelectedHour();this.onClearSelectedMinute();this.onClearSelectedAmPm();this.setSelectedAnyTime();this.onSetTime();},setSelectedAnyTime: function(evt) {this.selectedTime.anyTime = true;dojo.html.setClass(this.anyTimeContainerNode, this.classNames.selectedTime + " " + "anyTimeContainer");},onClick: function(evt) {dojo.event.browser.stopEvent(evt);},onSetTime: function() {if(this.selectedTime.anyTime) {this.time = new Date();var tempDateTime = dojo.widget.TimePicker.util.toRfcDateTime(this.time);this.setDateTime(tempDateTime.split("T")[0]);} else {var hour = 12;var minute = 0;var isAm = false;if(this.selectedTime["hour"]) {hour = parseInt(this.selectedTime["hour"], 10);}
+if(this.selectedTime["minute"]) {minute = parseInt(this.selectedTime["minute"], 10);}
+if(this.selectedTime["amPm"]) {isAm = (this.selectedTime["amPm"].toLowerCase() == "am");}
+this.time = new Date();this.time.setHours(dojo.widget.TimePicker.util.fromAmPmHour(hour, isAm));this.time.setMinutes(minute);this.setDateTime(dojo.widget.TimePicker.util.toRfcDateTime(this.time));}
+this.onValueChanged(this.time);},onValueChanged: function(date) {}});dojo.widget.TimePicker.util = new function() {this.toRfcDateTime = function(jsDate) {if(!jsDate) {jsDate = new Date();}
+jsDate.setSeconds(0);return dojo.date.strftime(jsDate, "%Y-%m-%dT%H:%M:00%z");}
+this.fromRfcDateTime = function(rfcDate, useDefaultMinutes, isAnyTime, dontRoundUpMinutes) {var tempDate = new Date();if(!rfcDate || rfcDate.indexOf("T")==-1) {if(useDefaultMinutes) {if(dontRoundUpMinutes){tempDate.setMinutes(tempDate.getMinutes());}else{tempDate.setMinutes(Math.floor(tempDate.getMinutes()/5)*5);}} else {tempDate.setMinutes(0);}} else {var tempTime = rfcDate.split("T")[1].split(":");var tempDate = new Date();tempDate.setHours(tempTime[0]);tempDate.setMinutes(tempTime[1]);}
+return tempDate;}
+this.toAmPmHour = function(hour) {var amPmHour = hour;var isAm = true;if (amPmHour == 0) {amPmHour = 12;} else if (amPmHour>12) {amPmHour = amPmHour - 12;isAm = false;} else if (amPmHour == 12) {isAm = false;}
+return [amPmHour, isAm];}
+this.fromAmPmHour = function(amPmHour, isAm) {var hour = parseInt(amPmHour, 10);if(isAm && hour == 12) {hour = 0;} else if (!isAm && hour<12) {hour = hour + 12;}
+return hour;}}

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TitlePane.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TitlePane.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TitlePane.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TitlePane.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,7 @@
+
+dojo.provide("dojo.widget.TitlePane");dojo.require("dojo.widget.*");dojo.require("dojo.widget.ContentPane");dojo.require("dojo.html.style");dojo.require("dojo.lfx.*");dojo.widget.defineWidget(
+"dojo.widget.TitlePane",dojo.widget.ContentPane,{labelNodeClass: "",containerNodeClass: "",label: "",open: true,templatePath: dojo.uri.moduleUri("dojo.widget", "templates/TitlePane.html"),postCreate: function() {if (this.label) {this.labelNode.appendChild(document.createTextNode(this.label));}
+if (this.labelNodeClass) {dojo.html.addClass(this.labelNode, this.labelNodeClass);}
+if (this.containerNodeClass) {dojo.html.addClass(this.containerNode, this.containerNodeClass);}
+if (!this.open) {dojo.html.hide(this.containerNode);}
+dojo.widget.TitlePane.superclass.postCreate.apply(this, arguments);},onLabelClick: function() {if (this.open) {dojo.lfx.wipeOut(this.containerNode, 250).play();this.open=false;} else {dojo.lfx.wipeIn(this.containerNode, 250).play();this.open=true;}},setLabel: function( label) {this.labelNode.innerHTML=label;}});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toaster.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toaster.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toaster.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toaster.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,31 @@
+
+dojo.provide("dojo.widget.Toaster");dojo.require("dojo.widget.*");dojo.require("dojo.lfx.*");dojo.require("dojo.html.iframe");dojo.widget.defineWidget(
+"dojo.widget.Toaster",dojo.widget.HtmlWidget,{templateString: '<div dojoAttachPoint="clipNode"><div dojoAttachPoint="containerNode" dojoAttachEvent="onClick:onSelect"><div dojoAttachPoint="contentNode"></div></div></div>',templateCssPath: dojo.uri.moduleUri("dojo.widget", "templates/Toaster.css"),messageTopic: "",messageTypes: {MESSAGE: "MESSAGE",WARNING: "WARNING",ERROR: "ERROR",FATAL: "FATAL"
+},defaultType: "MESSAGE",clipCssClass: "dojoToasterClip",containerCssClass: "dojoToasterContainer",contentCssClass: "dojoToasterContent",messageCssClass: "dojoToasterMessage",warningCssClass: "dojoToasterWarning",errorCssClass: "dojoToasterError",fatalCssClass: "dojoToasterFatal",positionDirection: "br-up",positionDirectionTypes: ["br-up", "br-left", "bl-up", "bl-right", "tr-down", "tr-left", "tl-down", "tl-right"],initializer: function(){this.duration = 2000;this.showDelay = '';this.separator = "<hr>";},postCreate: function(){if(this.showDelay!=''){dojo.deprecated("dojo.widget.Toaster", "use 'duration' instead of 'showDelay'", "0.6");this.duration = this.showDelay;}
+this.hide();dojo.html.setClass(this.clipNode, this.clipCssClass);dojo.html.addClass(this.containerNode, this.containerCssClass);dojo.html.setClass(this.contentNode, this.contentCssClass);if(this.messageTopic){dojo.event.topic.subscribe(this.messageTopic, this, "_handleMessage");}
+if(!this.positionDirection || !dojo.lang.inArray(this.positionDirectionTypes, this.positionDirection)){this.positionDirection = this.positionDirectionTypes.BRU;}},_handleMessage: function(msg){if(dojo.lang.isString(msg)){this.setContent(msg);}else{this.setContent(msg["message"], msg["type"], msg["duration"]);}},setContent: function(msg, messageType, duration){var duration = duration||this.duration;if(this.slideAnim && this.slideAnim.status() == "playing"){dojo.lang.setTimeout(50, dojo.lang.hitch(this, function(){this.setContent(msg, messageType);}));return;}else if(this.slideAnim){this.slideAnim.stop();if(this.fadeAnim && this.fadeAnim.status() == "playing"){dojo.lang.setTimeout(50, dojo.lang.hitch(this, function(){this.setContent(msg, messageType);}));return;}}
+if(!msg){dojo.debug(this.widgetId + ".setContent() incoming content was null, ignoring.");return;}
+if(!this.positionDirection || !dojo.lang.inArray(this.positionDirectionTypes, this.positionDirection)){dojo.raise(this.widgetId + ".positionDirection is an invalid value: " + this.positionDirection);}
+dojo.html.removeClass(this.containerNode, this.messageCssClass);dojo.html.removeClass(this.containerNode, this.warningCssClass);dojo.html.removeClass(this.containerNode, this.errorCssClass);dojo.html.removeClass(this.containerNode, this.fatalCssClass);dojo.html.clearOpacity(this.containerNode);if(msg instanceof String || typeof msg == "string"){var tmpMsg = msg;}else if(dojo.html.isNode(msg)){var tmpMsg = dojo.html.getContentAsString(msg);}else{dojo.raise("Toaster.setContent(): msg is of unknown type:" + msg);}
+var curMsg = this.contentNode.innerHTML
+if(tmpMsg&&this.isVisible){this.contentNode.innerHTML = curMsg + "<br>" + this.separator + "<br>" + tmpMsg;}else{this.contentNode.innerHTML = tmpMsg
+}
+switch(messageType){case this.messageTypes.WARNING:
+dojo.html.addClass(this.containerNode, this.warningCssClass);break;case this.messageTypes.ERROR:
+dojo.html.addClass(this.containerNode, this.errorCssClass);break
+case this.messageTypes.FATAL:
+dojo.html.addClass(this.containerNode, this.fatalCssClass);break;case this.messageTypes.MESSAGE:
+default:
+dojo.html.addClass(this.containerNode, this.messageCssClass);break;}
+this.show();var nodeSize = dojo.html.getMarginBox(this.containerNode);if(this.isVisible){this._placeClip();}else{if(this.positionDirection.indexOf("-up") >= 0){this.containerNode.style.left=0+"px";this.containerNode.style.top=nodeSize.height + 10 + "px";}else if(this.positionDirection.indexOf("-left") >= 0){this.containerNode.style.left=nodeSize.width + 10 +"px";this.containerNode.style.top=0+"px";}else if(this.positionDirection.indexOf("-right") >= 0){this.containerNode.style.left = 0 - nodeSize.width - 10 + "px";this.containerNode.style.top = 0+"px";}else if(this.positionDirection.indexOf("-down") >= 0){this.containerNode.style.left = 0+"px";this.containerNode.style.top = 0 - nodeSize.height - 10 + "px";}else{dojo.raise(this.widgetId + ".positionDirection is an invalid value: " + this.positionDirection);}
+this.slideAnim = dojo.lfx.html.slideTo(
+this.containerNode,{ top: 0, left: 0 },450,null,dojo.lang.hitch(this, function(nodes, anim){this.fadeAnim = dojo.lfx.html.fadeOut(
+this.containerNode,1000,null,dojo.lang.hitch(this, function(evt){this.isVisible = false;this.hide();}));if(duration>0){dojo.lang.setTimeout(dojo.lang.hitch(this, function(evt){if(this.bgIframe){this.bgIframe.hide();}
+this.fadeAnim.play();}), duration);}else{dojo.event.connect(
+this,'onSelect',dojo.lang.hitch(this, function(evt){this.fadeAnim.play();}));}
+this.isVisible = true;})).play();}},_placeClip: function(){var scroll = dojo.html.getScroll();var view = dojo.html.getViewport();var nodeSize = dojo.html.getMarginBox(this.containerNode);this.clipNode.style.height = nodeSize.height+"px";this.clipNode.style.width = nodeSize.width+"px";if(this.positionDirection.match(/^t/)){this.clipNode.style.top = scroll.top+"px";}else if(this.positionDirection.match(/^b/)){this.clipNode.style.top = (view.height - nodeSize.height - 2 + scroll.top)+"px";}
+if(this.positionDirection.match(/^[tb]r-/)){this.clipNode.style.left = (view.width - nodeSize.width - 1 - scroll.left)+"px";}else if(this.positionDirection.match(/^[tb]l-/)){this.clipNode.style.left = 0 + "px";}
+this.clipNode.style.clip = "rect(0px, " + nodeSize.width + "px, " + nodeSize.height + "px, 0px)";if(dojo.render.html.ie){if(!this.bgIframe){this.bgIframe = new dojo.html.BackgroundIframe(this.clipNode);this.bgIframe.setZIndex(this.clipNode);}
+this.bgIframe.onResized();this.bgIframe.show();}},onSelect: function(e) {},show: function(){dojo.widget.Toaster.superclass.show.call(this);this._placeClip();if(!this._scrollConnected){this._scrollConnected = true;dojo.event.connect(window, "onscroll", this, "_placeClip");}},hide: function(){dojo.widget.Toaster.superclass.hide.call(this);if(this._scrollConnected){this._scrollConnected = false;dojo.event.disconnect(window, "onscroll", this, "_placeClip");}
+dojo.html.setOpacity(this.containerNode, 1.0);}}
+);
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toggler.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toggler.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toggler.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toggler.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,4 @@
+
+dojo.provide("dojo.widget.Toggler");dojo.require("dojo.widget.*");dojo.require("dojo.event.*");dojo.widget.defineWidget(
+"dojo.widget.Toggler",dojo.widget.HtmlWidget,{targetId: '',fillInTemplate: function() {dojo.event.connect(this.domNode, "onclick", this, "onClick");},onClick: function() {var pane = dojo.widget.byId(this.targetId);if(!pane){ return; }
+pane.explodeSrc = this.domNode;pane.toggleShowing();}});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toolbar.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toolbar.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toolbar.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toolbar.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,115 @@
+
+dojo.provide("dojo.widget.Toolbar");dojo.require("dojo.widget.*");dojo.require("dojo.html.style");dojo.require("dojo.widget.PopupContainer");dojo.require("dojo.widget.ColorPalette");dojo.widget.defineWidget(
+"dojo.widget.ToolbarContainer",dojo.widget.HtmlWidget,{isContainer: true,templateString: '<div class="toolbarContainer" dojoAttachPoint="containerNode"></div>',templateCssPath: dojo.uri.moduleUri("dojo.widget", "templates/Toolbar.css"),getItem: function(name) {if(name instanceof dojo.widget.ToolbarItem) { return name; }
+for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.Toolbar) {var item = child.getItem(name);if(item) { return item; }}
+}
+return null;},getItems: function() {var items = [];for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.Toolbar) {items = items.concat(child.getItems());}}
+return items;},enable: function() {for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.Toolbar) {child.enable.apply(child, arguments);}}
+},disable: function() {for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.Toolbar) {child.disable.apply(child, arguments);}}
+},select: function(name) {for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.Toolbar) {child.select(arguments);}}
+},deselect: function(name) {for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.Toolbar) {child.deselect(arguments);}}
+},getItemsState: function() {var values = {};for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.Toolbar) {dojo.lang.mixin(values, child.getItemsState());}}
+return values;},getItemsActiveState: function() {var values = {};for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.Toolbar) {dojo.lang.mixin(values, child.getItemsActiveState());}}
+return values;},getItemsSelectedState: function() {var values = {};for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.Toolbar) {dojo.lang.mixin(values, child.getItemsSelectedState());}}
+return values;}});dojo.widget.defineWidget(
+"dojo.widget.Toolbar",dojo.widget.HtmlWidget,{isContainer: true,templateString: '<div class="toolbar" dojoAttachPoint="containerNode" unselectable="on" dojoOnMouseover="_onmouseover" dojoOnMouseout="_onmouseout" dojoOnClick="_onclick" dojoOnMousedown="_onmousedown" dojoOnMouseup="_onmouseup"></div>',_getItem: function(node) {var start = new Date();var widget = null;while(node && node != this.domNode) {if(dojo.html.hasClass(node, "toolbarItem")) {var widgets = dojo.widget.manager.getWidgetsByFilter(function(w) { return w.domNode == node; });if(widgets.length == 1) {widget = widgets[0];break;} else if(widgets.length > 1) {dojo.raise("Toolbar._getItem: More than one widget matches the node");}}
+node = node.parentNode;}
+return widget;},_onmouseover: function(e) {var widget = this._getItem(e.target);if(widget && widget._onmouseover) { widget._onmouseover(e); }},_onmouseout: function(e) {var widget = this._getItem(e.target);if(widget && widget._onmouseout) { widget._onmouseout(e); }},_onclick: function(e) {var widget = this._getItem(e.target);if(widget && widget._onclick){widget._onclick(e);}},_onmousedown: function(e) {var widget = this._getItem(e.target);if(widget && widget._onmousedown) { widget._onmousedown(e); }},_onmouseup: function(e) {var widget = this._getItem(e.target);if(widget && widget._onmouseup) { widget._onmouseup(e); }},addChild: function(item, pos, props) {var widget = dojo.widget.ToolbarItem.make(item, null, props);var ret = dojo.widget.Toolbar.superclass.addChild.call(this, widget, null, pos, null);return ret;},push: function() {for(var i = 0; i < arguments.length; i++) {this.addChild(arguments[i]);}},getItem: function(name) {if(name instanceof dojo.widget.ToolbarItem) { r
 eturn name; }
+for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.ToolbarItem
+&& child._name == name) { return child; }}
+return null;},getItems: function() {var items = [];for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.ToolbarItem) {items.push(child);}}
+return items;},getItemsState: function() {var values = {};for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.ToolbarItem) {values[child._name] = {selected: child._selected,enabled: !child.disabled
+};}}
+return values;},getItemsActiveState: function() {var values = this.getItemsState();for(var item in values) {values[item] = values[item].enabled;}
+return values;},getItemsSelectedState: function() {var values = this.getItemsState();for(var item in values) {values[item] = values[item].selected;}
+return values;},enable: function() {var items = arguments.length ? arguments : this.children;for(var i = 0; i < items.length; i++) {var child = this.getItem(items[i]);if(child instanceof dojo.widget.ToolbarItem) {child.enable(false, true);}}
+},disable: function() {var items = arguments.length ? arguments : this.children;for(var i = 0; i < items.length; i++) {var child = this.getItem(items[i]);if(child instanceof dojo.widget.ToolbarItem) {child.disable();}}
+},select: function() {for(var i = 0; i < arguments.length; i++) {var name = arguments[i];var item = this.getItem(name);if(item) { item.select(); }}
+},deselect: function() {for(var i = 0; i < arguments.length; i++) {var name = arguments[i];var item = this.getItem(name);if(item) { item.disable(); }}
+},setValue: function() {for(var i = 0; i < arguments.length; i += 2) {var name = arguments[i], value = arguments[i+1];var item = this.getItem(name);if(item) {if(item instanceof dojo.widget.ToolbarItem) {item.setValue(value);}}
+}}
+});dojo.widget.defineWidget(
+"dojo.widget.ToolbarItem",dojo.widget.HtmlWidget,{templateString: '<span unselectable="on" class="toolbarItem"></span>',_name: null,getName: function() { return this._name; },setName: function(value) { return (this._name = value); },getValue: function() { return this.getName(); },setValue: function(value) { return this.setName(value); },_selected: false,isSelected: function() { return this._selected; },setSelected: function(is, force, preventEvent) {if(!this._toggleItem && !force) { return; }
+is = Boolean(is);if(force || !this.disabled && this._selected != is) {this._selected = is;this.update();if(!preventEvent) {this._fireEvent(is ? "onSelect" : "onDeselect");this._fireEvent("onChangeSelect");}}
+},select: function(force, preventEvent) {return this.setSelected(true, force, preventEvent);},deselect: function(force, preventEvent) {return this.setSelected(false, force, preventEvent);},_toggleItem: false,isToggleItem: function() { return this._toggleItem; },setToggleItem: function(value) { this._toggleItem = Boolean(value); },toggleSelected: function(force) {return this.setSelected(!this._selected, force);},isEnabled: function() { return !this.disabled; },setEnabled: function(is, force, preventEvent) {is = Boolean(is);if(force || this.disabled == is) {this.disabled = !is;this.update();if(!preventEvent) {this._fireEvent(this.disabled ? "onDisable" : "onEnable");this._fireEvent("onChangeEnabled");}}
+return !this.disabled;},enable: function(force, preventEvent) {return this.setEnabled(true, force, preventEvent);},disable: function(force, preventEvent) {return this.setEnabled(false, force, preventEvent);},toggleEnabled: function(force, preventEvent) {return this.setEnabled(this.disabled, force, preventEvent);},_icon: null,getIcon: function() { return this._icon; },setIcon: function(value) {var icon = dojo.widget.Icon.make(value);if(this._icon) {this._icon.setIcon(icon);} else {this._icon = icon;}
+var iconNode = this._icon.getNode();if(iconNode.parentNode != this.domNode) {if(this.domNode.hasChildNodes()) {this.domNode.insertBefore(iconNode, this.domNode.firstChild);} else {this.domNode.appendChild(iconNode);}}
+return this._icon;},_label: "",getLabel: function() { return this._label; },setLabel: function(value) {var ret = (this._label = value);if(!this.labelNode) {this.labelNode = document.createElement("span");this.domNode.appendChild(this.labelNode);}
+this.labelNode.innerHTML = "";this.labelNode.appendChild(document.createTextNode(this._label));this.update();return ret;},update: function() {if(this.disabled) {this._selected = false;dojo.html.addClass(this.domNode, "disabled");dojo.html.removeClass(this.domNode, "down");dojo.html.removeClass(this.domNode, "hover");} else {dojo.html.removeClass(this.domNode, "disabled");if(this._selected) {dojo.html.addClass(this.domNode, "selected");} else {dojo.html.removeClass(this.domNode, "selected");}}
+this._updateIcon();},_updateIcon: function() {if(this._icon) {if(this.disabled) {this._icon.disable();} else {if(this._cssHover) {this._icon.hover();} else if(this._selected) {this._icon.select();} else {this._icon.enable();}}
+}},_fireEvent: function(evt) {if(typeof this[evt] == "function") {var args = [this];for(var i = 1; i < arguments.length; i++) {args.push(arguments[i]);}
+this[evt].apply(this, args);}},_onmouseover: function(e) {if(this.disabled) { return; }
+dojo.html.addClass(this.domNode, "hover");this._fireEvent("onMouseOver");},_onmouseout: function(e) {dojo.html.removeClass(this.domNode, "hover");dojo.html.removeClass(this.domNode, "down");if(!this._selected) {dojo.html.removeClass(this.domNode, "selected");}
+this._fireEvent("onMouseOut");},_onclick: function(e) {if(!this.disabled && !this._toggleItem) {this._fireEvent("onClick");}},_onmousedown: function(e) {if(e.preventDefault) { e.preventDefault(); }
+if(this.disabled) { return; }
+dojo.html.addClass(this.domNode, "down");if(this._toggleItem) {if(this.parent.preventDeselect && this._selected) {return;}
+this.toggleSelected();}
+this._fireEvent("onMouseDown");},_onmouseup: function(e) {dojo.html.removeClass(this.domNode, "down");this._fireEvent("onMouseUp");},onClick: function() { },onMouseOver: function() { },onMouseOut: function() { },onMouseDown: function() { },onMouseUp: function() { },fillInTemplate: function(args, frag) {if(args.name) { this._name = args.name; }
+if(args.selected) { this.select(); }
+if(args.disabled) { this.disable(); }
+if(args.label) { this.setLabel(args.label); }
+if(args.icon) { this.setIcon(args.icon); }
+if(args.toggleitem||args.toggleItem) { this.setToggleItem(true); }}
+});dojo.widget.ToolbarItem.make = function(wh, whIsType, props) {var item = null;if(wh instanceof Array) {item = dojo.widget.createWidget("ToolbarButtonGroup", props);item.setName(wh[0]);for(var i = 1; i < wh.length; i++) {item.addChild(wh[i]);}} else if(wh instanceof dojo.widget.ToolbarItem) {item = wh;} else if(wh instanceof dojo.uri.Uri) {item = dojo.widget.createWidget("ToolbarButton",dojo.lang.mixin(props||{}, {icon: new dojo.widget.Icon(wh.toString())}));} else if(whIsType) {item = dojo.widget.createWidget(wh, props);} else if(typeof wh == "string" || wh instanceof String) {switch(wh.charAt(0)) {case "|":
+case "-":
+case "/":
+item = dojo.widget.createWidget("ToolbarSeparator", props);break;case " ":
+if(wh.length == 1) {item = dojo.widget.createWidget("ToolbarSpace", props);} else {item = dojo.widget.createWidget("ToolbarFlexibleSpace", props);}
+break;default:
+if(/\.(gif|jpg|jpeg|png)$/i.test(wh)) {item = dojo.widget.createWidget("ToolbarButton",dojo.lang.mixin(props||{}, {icon: new dojo.widget.Icon(wh.toString())}));} else {item = dojo.widget.createWidget("ToolbarButton",dojo.lang.mixin(props||{}, {label: wh.toString()}));}}
+} else if(wh && wh.tagName && /^img$/i.test(wh.tagName)) {item = dojo.widget.createWidget("ToolbarButton",dojo.lang.mixin(props||{}, {icon: wh}));} else {item = dojo.widget.createWidget("ToolbarButton",dojo.lang.mixin(props||{}, {label: wh.toString()}));}
+return item;}
+dojo.widget.defineWidget(
+"dojo.widget.ToolbarButtonGroup",dojo.widget.ToolbarItem,{isContainer: true,templateString: '<span unselectable="on" class="toolbarButtonGroup" dojoAttachPoint="containerNode"></span>',defaultButton: "",postCreate: function() {for (var i = 0; i < this.children.length; i++) {this._injectChild(this.children[i]);}},addChild: function(item, pos, props) {var widget = dojo.widget.ToolbarItem.make(item, null, dojo.lang.mixin(props||{}, {toggleItem:true}));var ret = dojo.widget.ToolbarButtonGroup.superclass.addChild.call(this, widget, null, pos, null);this._injectChild(widget);return ret;},_injectChild: function(widget) {dojo.event.connect(widget, "onSelect", this, "onChildSelected");dojo.event.connect(widget, "onDeselect", this, "onChildDeSelected");if(widget._name == this.defaultButton
+|| (typeof this.defaultButton == "number"
+&& this.children.length-1 == this.defaultButton)) {widget.select(false, true);}},getItem: function(name) {if(name instanceof dojo.widget.ToolbarItem) { return name; }
+for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.ToolbarItem
+&& child._name == name) { return child; }}
+return null;},getItems: function() {var items = [];for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.ToolbarItem) {items.push(child);}}
+return items;},onChildSelected: function(e) {this.select(e._name);},onChildDeSelected: function(e) {this._fireEvent("onChangeSelect", this._value);},enable: function(force, preventEvent) {for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.ToolbarItem) {child.enable(force, preventEvent);if(child._name == this._value) {child.select(force, preventEvent);}}
+}},disable: function(force, preventEvent) {for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.ToolbarItem) {child.disable(force, preventEvent);}}
+},_value: "",getValue: function() { return this._value; },select: function(name, force, preventEvent) {for(var i = 0; i < this.children.length; i++) {var child = this.children[i];if(child instanceof dojo.widget.ToolbarItem) {if(child._name == name) {child.select(force, preventEvent);this._value = name;} else {child.deselect(true, true);}}
+}
+if(!preventEvent) {this._fireEvent("onSelect", this._value);this._fireEvent("onChangeSelect", this._value);}},setValue: this.select,preventDeselect: false
+});dojo.widget.defineWidget(
+"dojo.widget.ToolbarButton",dojo.widget.ToolbarItem,{fillInTemplate: function(args, frag) {dojo.widget.ToolbarButton.superclass.fillInTemplate.call(this, args, frag);dojo.html.addClass(this.domNode, "toolbarButton");if(this._icon) {this.setIcon(this._icon);}
+if(this._label) {this.setLabel(this._label);}
+if(!this._name) {if(this._label) {this.setName(this._label);} else if(this._icon) {var src = this._icon.getSrc("enabled").match(/[\/^]([^\.\/]+)\.(gif|jpg|jpeg|png)$/i);if(src) { this.setName(src[1]); }} else {this._name = this._widgetId;}}
+}});dojo.widget.defineWidget(
+"dojo.widget.ToolbarDialog",dojo.widget.ToolbarButton,{containerToggle: "plain",containerToggleDuration: 150,attachTemplateNodes: function(){dojo.widget.ToolbarDialog.superclass.attachTemplateNodes.apply(this, arguments);this.popup = dojo.widget.createWidget("PopupContainer", {toggle: this.containerToggle, toggleDuration: this.containerToggleDuration});this.containerNode = this.popup.domNode;},fillInTemplate: function (args, frag) {dojo.widget.ToolbarDialog.superclass.fillInTemplate.call(this, args, frag);dojo.event.connect(this, "onSelect", this, "showDialog");dojo.event.connect(this, "onDeselect", this, "hideDialog");},showDialog: function (e) {this.popup.open(this.domNode, this, this.domNode);dojo.lang.setTimeout(dojo.event.connect, 1, document, "onmousedown", this, "deselect");},hideDialog: function (e) {this.popup.close();dojo.event.disconnect(document, "onmousedown", this, "deselect");}});dojo.widget.defineWidget(
+"dojo.widget.ToolbarMenu",dojo.widget.ToolbarDialog,{}
+);dojo.widget.ToolbarMenuItem = function() {}
+dojo.widget.defineWidget(
+"dojo.widget.ToolbarSeparator",dojo.widget.ToolbarItem,{templateString: '<span unselectable="on" class="toolbarItem toolbarSeparator"></span>',defaultIconPath: new dojo.uri.moduleUri("dojo.widget", "templates/buttons/sep.gif"),fillInTemplate: function(args, frag, skip) {dojo.widget.ToolbarSeparator.superclass.fillInTemplate.call(this, args, frag);this._name = this.widgetId;if(!skip) {if(!this._icon) {this.setIcon(this.defaultIconPath);}
+this.domNode.appendChild(this._icon.getNode());}},_onmouseover: null,_onmouseout: null,_onclick: null,_onmousedown: null,_onmouseup: null
+});dojo.widget.defineWidget(
+"dojo.widget.ToolbarSpace",dojo.widget.ToolbarSeparator,{fillInTemplate: function(args, frag, skip) {dojo.widget.ToolbarSpace.superclass.fillInTemplate.call(this, args, frag, true);if(!skip) {dojo.html.addClass(this.domNode, "toolbarSpace");}}
+});dojo.widget.defineWidget(
+"dojo.widget.ToolbarSelect",dojo.widget.ToolbarItem,{templateString: '<span class="toolbarItem toolbarSelect" unselectable="on"><select dojoAttachPoint="selectBox" dojoOnChange="changed"></select></span>',fillInTemplate: function(args, frag) {dojo.widget.ToolbarSelect.superclass.fillInTemplate.call(this, args, frag, true);var keys = args.values;var i = 0;for(var val in keys) {var opt = document.createElement("option");opt.setAttribute("value", keys[val]);opt.innerHTML = val;this.selectBox.appendChild(opt);}},changed: function(e) {this._fireEvent("onSetValue", this.selectBox.value);},setEnabled: function(is, force, preventEvent) {var ret = dojo.widget.ToolbarSelect.superclass.setEnabled.call(this, is, force, preventEvent);this.selectBox.disabled = this.disabled;return ret;},_onmouseover: null,_onmouseout: null,_onclick: null,_onmousedown: null,_onmouseup: null
+});dojo.widget.Icon = function(enabled, disabled, hovered, selected){if(!arguments.length){throw new Error("Icon must have at least an enabled state");}
+var states = ["enabled", "disabled", "hovered", "selected"];var currentState = "enabled";var domNode = document.createElement("img");this.getState = function(){ return currentState; }
+this.setState = function(value){if(dojo.lang.inArray(states, value)){if(this[value]){currentState = value;var img = this[currentState];if ((dojo.render.html.ie55 || dojo.render.html.ie60) && img.src && img.src.match(/[.]png$/i) ) {domNode.width = img.width||img.offsetWidth;domNode.height = img.height||img.offsetHeight;domNode.setAttribute("src", dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif").uri);domNode.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img.src+"',sizingMethod='image')";} else {domNode.setAttribute("src", img.src);}}
+}else{throw new Error("Invalid state set on Icon (state: " + value + ")");}}
+this.setSrc = function(state, value){if(/^img$/i.test(value.tagName)){this[state] = value;}else if(typeof value == "string" || value instanceof String
+|| value instanceof dojo.uri.Uri){this[state] = new Image();this[state].src = value.toString();}
+return this[state];}
+this.setIcon = function(icon){for(var i = 0; i < states.length; i++){if(icon[states[i]]){this.setSrc(states[i], icon[states[i]]);}}
+this.update();}
+this.enable = function(){ this.setState("enabled"); }
+this.disable = function(){ this.setState("disabled"); }
+this.hover = function(){ this.setState("hovered"); }
+this.select = function(){ this.setState("selected"); }
+this.getSize = function(){return {width: domNode.width||domNode.offsetWidth,height: domNode.height||domNode.offsetHeight
+};}
+this.setSize = function(w, h){domNode.width = w;domNode.height = h;return { width: w, height: h };}
+this.getNode = function(){return domNode;}
+this.getSrc = function(state){if(state){ return this[state].src; }
+return domNode.src||"";}
+this.update = function(){this.setState(currentState);}
+for(var i = 0; i < states.length; i++){var arg = arguments[i];var state = states[i];this[state] = null;if(!arg){ continue; }
+this.setSrc(state, arg);}
+this.enable();}
+dojo.widget.Icon.make = function(a,b,c,d){for(var i = 0; i < arguments.length; i++){if(arguments[i] instanceof dojo.widget.Icon){return arguments[i];}}
+return new dojo.widget.Icon(a,b,c,d);}
+dojo.widget.defineWidget(
+"dojo.widget.ToolbarColorDialog",dojo.widget.ToolbarDialog,{palette: "7x10",fillInTemplate: function (args, frag) {dojo.widget.ToolbarColorDialog.superclass.fillInTemplate.call(this, args, frag);this.dialog = dojo.widget.createWidget("ColorPalette", {palette: this.palette}, this.containerNode, "child");dojo.event.connect(this.dialog, "onColorSelect", this, "_setValue");},_setValue: function(color) {this._value = color;this._fireEvent("onSetValue", color);}});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Tooltip.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Tooltip.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Tooltip.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Tooltip.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,15 @@
+
+dojo.provide("dojo.widget.Tooltip");dojo.require("dojo.widget.ContentPane");dojo.require("dojo.widget.PopupContainer");dojo.require("dojo.uri.Uri");dojo.require("dojo.widget.*");dojo.require("dojo.event.*");dojo.require("dojo.html.style");dojo.require("dojo.html.util");dojo.widget.defineWidget(
+"dojo.widget.Tooltip",[dojo.widget.ContentPane, dojo.widget.PopupContainerBase],{caption: "",showDelay: 500,hideDelay: 100,connectId: "",templateCssPath: dojo.uri.moduleUri("dojo.widget", "templates/TooltipTemplate.css"),postCreate: function(args, frag){this._connectNode = dojo.byId(this.connectId);dojo.event.connect(this._connectNode, "onmouseover", this, "_onMouseOver");this.applyPopupBasicStyle();dojo.widget.Tooltip.superclass.postCreate.call(this, args, frag);},_prepareForShow: function() {if(this.isLoaded){return;}
+if(this.caption != ""){this.domNode.appendChild(document.createTextNode(this.caption));}
+dojo.html.addClass(this.domNode, "dojoTooltip");this.addOnLoad(this, "_loadedContent");dojo.widget.Tooltip.superclass._prepareForShow.apply(this, arguments);},_onMouseOver: function(e){this._mouse = {x: e.pageX, y: e.pageY};if(!this._tracking){dojo.event.connect(document.documentElement, "onmousemove", this, "_onMouseMove");this._tracking=true;}
+this._onHover(e);},_onMouseMove: function(e) {this._mouse = {x: e.pageX, y: e.pageY};if(dojo.html.overElement(this._connectNode, e) || dojo.html.overElement(this.domNode, e)){this._onHover(e);} else {this._onUnHover(e);}},_onHover: function(e) {if(this._hover){ return; }
+this._hover=true;if(this._hideTimer) {clearTimeout(this._hideTimer);delete this._hideTimer;}
+if(!this.isShowingNow && !this._showTimer){this._showTimer = setTimeout(dojo.lang.hitch(this, "open"), this.showDelay);}},_onUnHover: function(e){if(!this._hover){ return; }
+this._hover=false;if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}
+if(this.isShowingNow && !this._hideTimer){this._hideTimer = setTimeout(dojo.lang.hitch(this, "close"), this.hideDelay);}
+if(!this.isShowingNow){dojo.event.disconnect(document.documentElement, "onmousemove", this, "_onMouseMove");this._tracking=false;}},open: function() {if (this.isShowingNow) { return; }
+dojo.widget.PopupContainerBase.prototype.open.call(this, this._mouse.x, this._mouse.y, null, [this._mouse.x, this._mouse.y], "TL,TR,BL,BR", [10,15]);},close: function() {if (this.isShowingNow) {if ( this._showTimer ) {clearTimeout(this._showTimer);delete this._showTimer;}
+if ( this._hideTimer ) {clearTimeout(this._hideTimer);delete this._hideTimer;}
+dojo.event.disconnect(document.documentElement, "onmousemove", this, "_onMouseMove");this._tracking=false;dojo.widget.PopupContainerBase.prototype.close.call(this);}},_position: function(){this.move(this._mouse.x, this._mouse.y, [10,15], "TL,TR,BL,BR");},_loadedContent: function(){if(this.isShowingNow){this._position();}},checkSize: function(){},uninitialize: function(){this.close();dojo.event.disconnect(this._connectNode, "onmouseover", this, "_onMouseOver");}}
+);
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Tree.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Tree.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Tree.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Tree.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,39 @@
+
+dojo.provide("dojo.widget.Tree");dojo.require("dojo.widget.*");dojo.require("dojo.event.*");dojo.require("dojo.io.*");dojo.require("dojo.widget.HtmlWidget");dojo.require("dojo.widget.TreeNode");dojo.require("dojo.html.common");dojo.require("dojo.html.selection");dojo.widget.defineWidget("dojo.widget.Tree", dojo.widget.HtmlWidget, function() {this.eventNames = {};this.tree = this;this.DNDAcceptTypes = [];this.actionsDisabled = [];},{widgetType: "Tree",eventNamesDefault: {createDOMNode: "createDOMNode",treeCreate: "treeCreate",treeDestroy: "treeDestroy",treeClick: "treeClick",iconClick: "iconClick",titleClick: "titleClick",moveFrom: "moveFrom",moveTo: "moveTo",addChild: "addChild",removeNode: "removeNode",expand: "expand",collapse: "collapse"
+},isContainer: true,DNDMode: "off",lockLevel: 0,strictFolders: true,DNDModes: {BETWEEN: 1,ONTO: 2
+},DNDAcceptTypes: "",templateCssPath: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/Tree.css"),templateString: '<div class="dojoTree"></div>',isExpanded: true,isTree: true,objectId: "",controller: "",selector: "",menu: "",expandLevel: "",blankIconSrc: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_blank.gif"),gridIconSrcT: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_t.gif"),gridIconSrcL: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_l.gif"),gridIconSrcV: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_v.gif"),gridIconSrcP: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_p.gif"),gridIconSrcC: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_c.gif"),gridIconSrcX: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_x.gif"),gridIconSrcY: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_y.gif
 "),gridIconSrcZ: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_z.gif"),expandIconSrcPlus: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_expand_plus.gif"),expandIconSrcMinus: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_expand_minus.gif"),expandIconSrcLoading: dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_loading.gif"),iconWidth: 18,iconHeight: 18,showGrid: true,showRootGrid: true,actionIsDisabled: function(action) {var _this = this;return dojo.lang.inArray(_this.actionsDisabled, action)
+},actions: {ADDCHILD: "ADDCHILD"
+},getInfo: function() {var info = {widgetId: this.widgetId,objectId: this.objectId
+}
+return info;},initializeController: function() {if (this.controller != "off") {if (this.controller) {this.controller = dojo.widget.byId(this.controller);}
+else {dojo.require("dojo.widget.TreeBasicController");this.controller = dojo.widget.createWidget("TreeBasicController",{ DNDController: (this.DNDMode ? "create" : ""), dieWithTree: true }
+);}
+this.controller.listenTree(this);} else {this.controller = null;}},initializeSelector: function() {if (this.selector != "off") {if (this.selector) {this.selector = dojo.widget.byId(this.selector);}
+else {dojo.require("dojo.widget.TreeSelector");this.selector = dojo.widget.createWidget("TreeSelector", {dieWithTree: true});}
+this.selector.listenTree(this);} else {this.selector = null;}},initialize: function(args, frag){var _this = this;for(name in this.eventNamesDefault) {if (dojo.lang.isUndefined(this.eventNames[name])) {this.eventNames[name] = this.widgetId+"/"+this.eventNamesDefault[name];}}
+for(var i=0; i<this.actionsDisabled.length; i++) {this.actionsDisabled[i] = this.actionsDisabled[i].toUpperCase();}
+if (this.DNDMode == "off") {this.DNDMode = 0;} else if (this.DNDMode == "between") {this.DNDMode = this.DNDModes.ONTO | this.DNDModes.BETWEEN;} else if (this.DNDMode == "onto") {this.DNDMode = this.DNDModes.ONTO;}
+this.expandLevel = parseInt(this.expandLevel);this.initializeSelector();this.initializeController();if (this.menu) {this.menu = dojo.widget.byId(this.menu);this.menu.listenTree(this);}
+this.containerNode = this.domNode;},postCreate: function() {this.createDOMNode();},createDOMNode: function() {dojo.html.disableSelection(this.domNode);for(var i=0; i<this.children.length; i++){this.children[i].parent = this;var node = this.children[i].createDOMNode(this, 0);this.domNode.appendChild(node);}
+if (!this.showRootGrid){for(var i=0; i<this.children.length; i++){this.children[i].expand();}}
+dojo.event.topic.publish(this.eventNames.treeCreate, { source: this } );},destroy: function() {dojo.event.topic.publish(this.tree.eventNames.treeDestroy, { source: this } );return dojo.widget.HtmlWidget.prototype.destroy.apply(this, arguments);},addChild: function(child, index) {var message = {child: child,index: index,parent: this,domNodeInitialized: child.domNodeInitialized
+}
+this.doAddChild.apply(this, arguments);dojo.event.topic.publish(this.tree.eventNames.addChild, message);},doAddChild: function(child, index){if (dojo.lang.isUndefined(index)) {index = this.children.length;}
+if (!child.isTreeNode){dojo.raise("You can only add TreeNode widgets to a "+this.widgetType+" widget!");return;}
+if (this.isTreeNode){if (!this.isFolder) {this.setFolder();}}
+var _this = this;dojo.lang.forEach(child.getDescendants(), function(elem) { elem.tree = _this.tree; });child.parent = this;if (this.isTreeNode) {this.state = this.loadStates.LOADED;}
+if (index < this.children.length) {dojo.html.insertBefore(child.domNode, this.children[index].domNode);} else {this.containerNode.appendChild(child.domNode);if (this.isExpanded && this.isTreeNode) {this.showChildren();}}
+this.children.splice(index, 0, child);if (child.domNodeInitialized) {var d = this.isTreeNode ? this.depth : -1;child.adjustDepth( d - child.depth + 1 );child.updateIconTree();} else {child.depth = this.isTreeNode ? this.depth+1 : 0;child.createDOMNode(child.tree, child.depth);}
+var prevSibling = child.getPreviousSibling();if (child.isLastChild() && prevSibling) {prevSibling.updateExpandGridColumn();}},makeBlankImg: function() {var img = document.createElement('img');img.style.width = this.iconWidth + 'px';img.style.height = this.iconHeight + 'px';img.src = this.blankIconSrc;img.style.verticalAlign = 'middle';return img;},updateIconTree: function(){if (!this.isTree) {this.updateIcons();}
+for(var i=0; i<this.children.length; i++){this.children[i].updateIconTree();}},toString: function() {return "["+this.widgetType+" ID:"+this.widgetId+"]"
+},move: function(child, newParent, index) {var oldParent = child.parent;var oldTree = child.tree;this.doMove.apply(this, arguments);var newParent = child.parent;var newTree = child.tree;var message = {oldParent: oldParent, oldTree: oldTree,newParent: newParent, newTree: newTree,child: child
+};dojo.event.topic.publish(oldTree.eventNames.moveFrom, message);dojo.event.topic.publish(newTree.eventNames.moveTo, message);},doMove: function(child, newParent, index) {child.parent.doRemoveNode(child);newParent.doAddChild(child, index);},removeNode: function(child) {if (!child.parent) return;var oldTree = child.tree;var oldParent = child.parent;var removedChild = this.doRemoveNode.apply(this, arguments);dojo.event.topic.publish(this.tree.eventNames.removeNode,{ child: removedChild, tree: oldTree, parent: oldParent }
+);return removedChild;},doRemoveNode: function(child) {if (!child.parent) return;var parent = child.parent;var children = parent.children;var index = child.getParentIndex();if (index < 0) {dojo.raise("Couldn't find node "+child+" for removal");}
+children.splice(index,1);dojo.html.removeNode(child.domNode);if (parent.children.length == 0 && !parent.isTree) {parent.containerNode.style.display = "none";}
+if (index == children.length && index>0) {children[index-1].updateExpandGridColumn();}
+if (parent instanceof dojo.widget.Tree && index == 0 && children.length>0) {children[0].updateExpandGrid();}
+child.parent = child.tree = null;return child;},markLoading: function() {},unMarkLoading: function() {},lock: function() {!this.lockLevel && this.markLoading();this.lockLevel++;},unlock: function() {if (!this.lockLevel) {dojo.raise("unlock: not locked");}
+this.lockLevel--;!this.lockLevel && this.unMarkLoading();},isLocked: function() {var node = this;while (true) {if (node.lockLevel) {return true;}
+if (node instanceof dojo.widget.Tree) {break;}
+node = node.parent;}
+return false;},flushLock: function() {this.lockLevel = 0;this.unMarkLoading();}});
\ No newline at end of file

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeBasicController.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeBasicController.js?view=auto&rev=503984
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeBasicController.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeBasicController.js Mon Feb  5 21:01:25 2007
@@ -0,0 +1,17 @@
+
+dojo.provide("dojo.widget.TreeBasicController");dojo.require("dojo.event.*");dojo.require("dojo.json")
+dojo.require("dojo.io.*");dojo.widget.defineWidget("dojo.widget.TreeBasicController", dojo.widget.HtmlWidget, {widgetType: "TreeBasicController",DNDController: "",dieWithTree: false,initialize: function(args, frag){if (this.DNDController == "create") {dojo.require("dojo.dnd.TreeDragAndDrop");this.DNDController = new dojo.dnd.TreeDNDController(this);}},listenTree: function(tree) {dojo.event.topic.subscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");dojo.event.topic.subscribe(tree.eventNames.treeClick, this, "onTreeClick");dojo.event.topic.subscribe(tree.eventNames.treeCreate, this, "onTreeCreate");dojo.event.topic.subscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");if (this.DNDController) {this.DNDController.listenTree(tree);}},unlistenTree: function(tree) {dojo.event.topic.unsubscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");dojo.event.topic.unsubscribe(tree.eventNames.treeClick, this, "onTreeClick");dojo.event.topic.unsubscribe(tree.eve
 ntNames.treeCreate, this, "onTreeCreate");dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");},onTreeDestroy: function(message) {var tree = message.source;this.unlistenTree(tree);if (this.dieWithTree) {this.destroy();}},onCreateDOMNode: function(message) {var node = message.source;if (node.expandLevel > 0) {this.expandToLevel(node, node.expandLevel);}},onTreeCreate: function(message) {var tree = message.source;var _this = this;if (tree.expandLevel) {dojo.lang.forEach(tree.children,function(child) {_this.expandToLevel(child, tree.expandLevel-1)
+}
+);}},expandToLevel: function(node, level) {if (level == 0) return;var children = node.children;var _this = this;var handler = function(node, expandLevel) {this.node = node;this.expandLevel = expandLevel;this.process = function() {for(var i=0; i<this.node.children.length; i++) {var child = node.children[i];_this.expandToLevel(child, this.expandLevel);}};}
+var h = new handler(node, level-1);this.expand(node, false, h, h.process);},onTreeClick: function(message){var node = message.source;if(node.isLocked()) {return false;}
+if (node.isExpanded){this.collapse(node);} else {this.expand(node);}},expand: function(node, sync, callObj, callFunc) {node.expand();if (callFunc) callFunc.apply(callObj, [node]);},collapse: function(node) {node.collapse();},canMove: function(child, newParent){if (child.actionIsDisabled(child.actions.MOVE)) {return false;}
+if (child.parent !== newParent && newParent.actionIsDisabled(newParent.actions.ADDCHILD)) {return false;}
+var node = newParent;while(node.isTreeNode) {if (node === child) {return false;}
+node = node.parent;}
+return true;},move: function(child, newParent, index) {if (!this.canMove(child, newParent)) {return false;}
+var result = this.doMove(child, newParent, index);if (!result) return result;if (newParent.isTreeNode) {this.expand(newParent);}
+return result;},doMove: function(child, newParent, index) {child.tree.move(child, newParent, index);return true;},canRemoveNode: function(child) {if (child.actionIsDisabled(child.actions.REMOVE)) {return false;}
+return true;},removeNode: function(node, callObj, callFunc) {if (!this.canRemoveNode(node)) {return false;}
+return this.doRemoveNode(node, callObj, callFunc);},doRemoveNode: function(node, callObj, callFunc) {node.tree.removeNode(node);if (callFunc) {callFunc.apply(dojo.lang.isUndefined(callObj) ? this : callObj, [node]);}},canCreateChild: function(parent, index, data) {if (parent.actionIsDisabled(parent.actions.ADDCHILD)) return false;return true;},createChild: function(parent, index, data, callObj, callFunc) {if (!this.canCreateChild(parent, index, data)) {return false;}
+return this.doCreateChild.apply(this, arguments);},doCreateChild: function(parent, index, data, callObj, callFunc) {var widgetType = data.widgetType ? data.widgetType : "TreeNode";var newChild = dojo.widget.createWidget(widgetType, data);parent.addChild(newChild, index);this.expand(parent);if (callFunc) {callFunc.apply(callObj, [newChild]);}
+return newChild;}});
\ No newline at end of file



Mime
View raw message