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

svn commit: r498423 [21/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/ap...

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/HslColorPicker.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/HslColorPicker.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/HslColorPicker.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/HslColorPicker.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,10 @@
+
+dojo.provide("dojo.widget.HslColorPicker");dojo.require("dojo.widget.*");dojo.require("dojo.widget.HtmlWidget");dojo.require("dojo.math");dojo.require("dojo.svg");dojo.require("dojo.gfx.color");dojo.require("dojo.gfx.color.hsl");dojo.require("dojo.experimental");dojo.experimental("dojo.widget.svg.HslColorPicker");dojo.widget.defineWidget(
+"dojo.widget.svg.HslColorPicker",dojo.widget.HtmlWidget,function(){dojo.debug("warning: the HslColorPicker is not a finished widget, and is not yet ready for general use");this.filterObject = {};},{hue: "0",saturation: "0",light: "0",storedColor: "#0054aa",templatePath: dojo.uri.moduleUri("dojo", "widget/templates/HslColorPicker.svg"),fillInTemplate: function() {this.height = "131px";this.svgDoc = this.hueNode.ownerDocument;this.leftGradientColorNode = this.hueNode.ownerDocument.getElementById("leftGradientColor");this.rightGradientColorNode = this.hueNode.ownerDocument.getElementById("rightGradientColor");this.hueNode.setAttributeNS(dojo.dom.xmlns.xlink, "href", dojo.uri.moduleUri("dojo", "widget/templates/images/hue.png"));var hsl = dojo.gfx.color.hex2hsl(this.storedColor);this.hue = hsl[0];this.saturation = hsl[1];this.light = hsl[2];this.setSaturationStopColors();},setSaturationStopColors: function() {this.leftGradientStopColor = dojo.gfx.color.rgb2hex(this.hsl2rgb(this.
 hue, 0, 50));this.rightGradientStopColor = dojo.gfx.color.rgb2hex(this.hsl2rgb(this.hue, 100, 50));this.leftGradientColorNode.setAttributeNS(null,'stop-color',this.leftGradientStopColor);this.rightGradientColorNode.setAttributeNS(null,'stop-color',this.rightGradientStopColor);},setHue: function(hue) {this.hue = hue;},setHueSlider: function() {this.hueSliderNode.setAttribute("y", parseInt((this.hue/360) * parseInt(this.height) - 2) + "px" );},setSaturationLight: function(saturation, light) {this.saturation = saturation;this.light = light;},setSaturationLightSlider: function() {},onHueClick: function(evt) {var yPosition = parseInt(evt.clientY) - parseInt(evt.target.getAttribute("y"));this.setHue( 360 - parseInt(yPosition*(360/parseInt(this.height))) );this.setSaturationStopColors();this.setStoredColor(dojo.gfx.color.hsl2hex(this.hue, this.saturation, this.light));},onHueDrag: function(evt) {},onSaturationLightClick: function(evt) {var xPosition = parseInt(evt.clientX) - parseI
 nt(evt.target.getAttribute("y"));var yPosition = parseInt(evt.clientY) - parseInt(evt.target.getAttribute("y"));var saturation = parseInt(parseInt(xPosition)*(101/106));var light = parseInt(parseInt(yPosition)*(101/106));this.setSaturationLight(saturation, light);this.setStoredColor(dojo.gfx.color.hsl2hex(this.hue, this.saturation, this.light));},onSaturationLightDrag: function(evt) {},getStoredColor: function() {return this.storedColor;},setStoredColor: function(rgbHexColor) {this.storedColor = rgbHexColor;dojo.event.topic.publish("/" + this.widgetId + "/setStoredColor", this.filterObject);},hsl2rgb: function(hue, saturation, light)
+{function rgb(q1,q2,hue) {if (hue>360) hue=hue-360;if (hue<0) hue=hue+360;if (hue<60) return (q1+(q2-q1)*hue/60);else if (hue<180) return(q2);else if (hue<240) return(q1+(q2-q1)*(240-hue)/60);else return(q1);}
+this.rgb = rgb
+if (saturation==0) {return [Math.round(light*255/100), Math.round(light*255/100), Math.round(light*255/100)];} else {light = light/100;saturation = saturation/100;if ((light)<0.5) {var temp2 = (light)*(1.0+saturation)
+} else {var temp2 = (light+saturation-(light*saturation))
+}
+var temp1 = 2.0*light - temp2;var rgbcolor = [];rgbcolor[0] = Math.round(rgb(temp1,temp2,parseInt(hue)+120)*255);rgbcolor[1] = Math.round(rgb(temp1,temp2,hue)*255);rgbcolor[2] = Math.round(rgb(temp1,temp2,parseInt(hue)-120)*255);return rgbcolor;}}
+});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/HtmlWidget.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/HtmlWidget.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/HtmlWidget.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/HtmlWidget.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,10 @@
+
+dojo.provide("dojo.widget.HtmlWidget");dojo.require("dojo.widget.DomWidget");dojo.require("dojo.html.util");dojo.require("dojo.html.display");dojo.require("dojo.html.layout");dojo.require("dojo.lang.extras");dojo.require("dojo.lang.func");dojo.require("dojo.lfx.toggler");dojo.declare("dojo.widget.HtmlWidget", dojo.widget.DomWidget, {templateCssPath: null,templatePath: null,lang: "",toggle: "plain",toggleDuration: 150,initialize: function(args, frag){},postMixInProperties: function(args, frag){if(this.lang === ""){this.lang = null;}
+this.toggleObj = new (dojo.lfx.toggler[this.toggle.toLowerCase()] || dojo.lfx.toggler.plain);},createNodesFromText: function(txt, wrap){return dojo.html.createNodesFromText(txt, wrap);},destroyRendering: function(finalize){try{if(this.bgIframe){this.bgIframe.remove();delete this.bgIframe;}
+if(!finalize && this.domNode){dojo.event.browser.clean(this.domNode);}
+dojo.widget.HtmlWidget.superclass.destroyRendering.call(this);}catch(e){  }},isShowing: function(){return dojo.html.isShowing(this.domNode);},toggleShowing: function(){if(this.isShowing()){this.hide();}else{this.show();}},show: function(){if(this.isShowing()){ return; }
+this.animationInProgress=true;this.toggleObj.show(this.domNode, this.toggleDuration, null,dojo.lang.hitch(this, this.onShow), this.explodeSrc);},onShow: function(){this.animationInProgress=false;this.checkSize();},hide: function(){if(!this.isShowing()){ return; }
+this.animationInProgress = true;this.toggleObj.hide(this.domNode, this.toggleDuration, null,dojo.lang.hitch(this, this.onHide), this.explodeSrc);},onHide: function(){this.animationInProgress=false;},_isResized: function(w, h){if(!this.isShowing()){ return false; }
+var wh = dojo.html.getMarginBox(this.domNode);var width=w||wh.width;var height=h||wh.height;if(this.width == width && this.height == height){ return false; }
+this.width=width;this.height=height;return true;},checkSize: function(){if(!this._isResized()){ return; }
+this.onResized();},resizeTo: function(w, h){dojo.html.setMarginBox(this.domNode, { width: w, height: h });if(this.isShowing()){this.onResized();}},resizeSoon: function(){if(this.isShowing()){dojo.lang.setTimeout(this, this.onResized, 0);}},onResized: function(){dojo.lang.forEach(this.children, function(child){ if(child.checkSize){child.checkSize();}});}});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/InlineEditBox.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/InlineEditBox.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/InlineEditBox.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/InlineEditBox.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,14 @@
+
+dojo.provide("dojo.widget.InlineEditBox");dojo.require("dojo.widget.*");dojo.require("dojo.event.*");dojo.require("dojo.lfx.*");dojo.require("dojo.gfx.color");dojo.require("dojo.string");dojo.require("dojo.html.*");dojo.require("dojo.html.layout");dojo.widget.defineWidget(
+"dojo.widget.InlineEditBox",dojo.widget.HtmlWidget,function(){this.history = [];},{templatePath: dojo.uri.moduleUri("dojo", "widget/templates/InlineEditBox.html"),templateCssPath: dojo.uri.moduleUri("dojo", "widget/templates/InlineEditBox.css"),mode: "text",name: "",minWidth: 100,minHeight: 200,editing: false,value: "",textValue: "",defaultText: "",postMixInProperties: function(){if(this.textValue){dojo.deprecated("InlineEditBox: Use value parameter instead of textValue; will be removed in 0.5");this.value=this.textValue;}
+if(this.defaultText){dojo.deprecated("InlineEditBox: Use value parameter instead of defaultText; will be removed in 0.5");this.value=this.defaultText;}},onSave: function(newValue, oldValue, name){},onUndo: function(value){},postCreate: function(args, frag){this.editable = this.getFragNodeRef(frag);dojo.html.insertAfter(this.editable, this.form);dojo.event.connect(this.editable, "onmouseover", this, "onMouseOver");dojo.event.connect(this.editable, "onmouseout", this, "onMouseOut");dojo.event.connect(this.editable, "onclick", this, "_beginEdit");if(this.value){this.editable.innerHTML = this.value;return;} else {this.value = dojo.string.trim(this.editable.innerHTML);this.editable.innerHTML = this.value;}},onMouseOver: function(){if(!this.editing){if (this.disabled){dojo.html.addClass(this.editable, "editableRegionDisabled");} else {dojo.html.addClass(this.editable, "editableRegion");if(this.mode == "textarea"){dojo.html.addClass(this.editable, "editableTextareaRegion");}}
+}},onMouseOut: function(){if(!this.editing){dojo.html.removeClass(this.editable, "editableRegion");dojo.html.removeClass(this.editable, "editableTextareaRegion");dojo.html.removeClass(this.editable, "editableRegionDisabled");}},_beginEdit: function(e){if(this.editing || this.disabled){ return; }
+this.onMouseOut();this.editing = true;var ee = this[this.mode.toLowerCase()];ee.value = dojo.string.trim(this.value);ee.style.fontSize = dojo.html.getStyle(this.editable, "font-size");ee.style.fontWeight = dojo.html.getStyle(this.editable, "font-weight");ee.style.fontStyle = dojo.html.getStyle(this.editable, "font-style");var bb = dojo.html.getBorderBox(this.editable);ee.style.width = Math.max(bb.width, this.minWidth) + "px";if(this.mode.toLowerCase()=="textarea"){ee.style.display = "block";ee.style.height = Math.max(bb.height, this.minHeight) + "px";} else {ee.style.display = "";}
+this.form.style.display = "";this.editable.style.display = "none";ee.focus();ee.select();this.submitButton.disabled = true;},saveEdit: function(e){e.preventDefault();e.stopPropagation();var ee = this[this.mode.toLowerCase()];if((this.value != ee.value)&&
+(dojo.string.trim(ee.value) != "")){this.doFade = true;this.history.push(this.value);this.onSave(ee.value, this.value, this.name);this.value = ee.value;this.editable.innerHTML = "";var textNode = document.createTextNode( this.value );this.editable.appendChild( textNode );}else{this.doFade = false;}
+this._finishEdit(e);},cancelEdit: function(e){if(!this.editing){ return false; }
+this.editing = false;this.form.style.display="none";this.editable.style.display = "";return true;},_finishEdit: function(e){if(!this.cancelEdit(e)){ return; }
+if(this.doFade) {dojo.lfx.highlight(this.editable, dojo.gfx.color.hex2rgb("#ffc"), 700).play(300);}
+this.doFade = false;},setText: function(txt){dojo.deprecated("setText() is deprecated, call setValue() instead, will be removed in 0.5");this.setValue(txt);},setValue: function( txt){txt = "" + txt;var tt = dojo.string.trim(txt);this.value = tt
+this.editable.innerHTML = tt;},undo: function(){if(this.history.length > 0){var curValue = this.value;var value = this.history.pop();this.editable.innerHTML = value;this.value = value;this.onUndo(value);this.onSave(value, curValue, this.name);}},checkForValueChange: function(){var ee = this[this.mode.toLowerCase()];if((this.value != ee.value)&&
+(dojo.string.trim(ee.value) != "")){this.submitButton.disabled = false;}},disable: function(){this.submitButton.disabled = true;this.cancelButton.disabled = true;var ee = this[this.mode.toLowerCase()];ee.disabled = true;dojo.widget.InlineEditBox.superclass.disable.apply(this, arguments);},enable: function(){this.checkForValueChange();this.cancelButton.disabled = false;var ee = this[this.mode.toLowerCase()];ee.disabled = false;dojo.widget.InlineEditBox.superclass.enable.apply(this, arguments);}});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/IntegerTextbox.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/IntegerTextbox.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/IntegerTextbox.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/IntegerTextbox.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,9 @@
+
+dojo.provide("dojo.widget.IntegerTextbox");dojo.require("dojo.widget.ValidationTextbox");dojo.require("dojo.validate.common");dojo.widget.defineWidget(
+"dojo.widget.IntegerTextbox",dojo.widget.ValidationTextbox,{mixInProperties: function(localProperties, frag){dojo.widget.IntegerTextbox.superclass.mixInProperties.apply(this, arguments);if((localProperties.signed == "true")||
+(localProperties.signed == "always")){this.flags.signed = true;}else if((localProperties.signed == "false")||
+(localProperties.signed == "never")){this.flags.signed = false;this.flags.min = 0;}else{this.flags.signed = [ true, false ];}
+if(localProperties.separator){this.flags.separator = localProperties.separator;}
+if(localProperties.min){this.flags.min = parseInt(localProperties.min);}
+if(localProperties.max){this.flags.max = parseInt(localProperties.max);}},isValid: function(){return dojo.validate.isInteger(this.textbox.value, this.flags);},isInRange: function(){return dojo.validate.isInRange(this.textbox.value, this.flags);}}
+);
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/InternetTextbox.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/InternetTextbox.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/InternetTextbox.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/InternetTextbox.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,20 @@
+
+dojo.provide("dojo.widget.InternetTextbox");dojo.require("dojo.widget.ValidationTextbox");dojo.require("dojo.validate.web");dojo.widget.defineWidget(
+"dojo.widget.IpAddressTextbox",dojo.widget.ValidationTextbox,{mixInProperties: function(localProperties){dojo.widget.IpAddressTextbox.superclass.mixInProperties.apply(this, arguments);if(localProperties.allowdotteddecimal){this.flags.allowDottedDecimal = (localProperties.allowdotteddecimal == "true");}
+if(localProperties.allowdottedhex){this.flags.allowDottedHex = (localProperties.allowdottedhex == "true");}
+if(localProperties.allowdottedoctal){this.flags.allowDottedOctal = (localProperties.allowdottedoctal == "true");}
+if(localProperties.allowdecimal){this.flags.allowDecimal = (localProperties.allowdecimal == "true");}
+if(localProperties.allowhex){this.flags.allowHex = (localProperties.allowhex == "true");}
+if(localProperties.allowipv6){this.flags.allowIPv6 = (localProperties.allowipv6 == "true");}
+if(localProperties.allowhybrid){this.flags.allowHybrid = (localProperties.allowhybrid == "true");}},isValid: function(){return dojo.validate.isIpAddress(this.textbox.value, this.flags);}}
+);dojo.widget.defineWidget(
+"dojo.widget.UrlTextbox",dojo.widget.IpAddressTextbox,{mixInProperties: function(localProperties){dojo.widget.UrlTextbox.superclass.mixInProperties.apply(this, arguments);if ( localProperties.scheme ) {this.flags.scheme = ( localProperties.scheme == "true" );}
+if ( localProperties.allowip ) {this.flags.allowIP = ( localProperties.allowip == "true" );}
+if ( localProperties.allowlocal ) {this.flags.allowLocal = ( localProperties.allowlocal == "true" );}
+if ( localProperties.allowcc ) {this.flags.allowCC = ( localProperties.allowcc == "true" );}
+if ( localProperties.allowgeneric ) {this.flags.allowGeneric = ( localProperties.allowgeneric == "true" );}},isValid: function(){return dojo.validate.isUrl(this.textbox.value, this.flags);}}
+);dojo.widget.defineWidget(
+"dojo.widget.EmailTextbox",dojo.widget.UrlTextbox,{mixInProperties: function(localProperties){dojo.widget.EmailTextbox.superclass.mixInProperties.apply(this, arguments);if(localProperties.allowcruft){this.flags.allowCruft = (localProperties.allowcruft == "true");}},isValid: function(){return dojo.validate.isEmailAddress(this.textbox.value, this.flags);}}
+);dojo.widget.defineWidget(
+"dojo.widget.EmailListTextbox",dojo.widget.EmailTextbox,{mixInProperties: function(localProperties){dojo.widget.EmailListTextbox.superclass.mixInProperties.apply(this, arguments);if(localProperties.listseparator){this.flags.listSeparator = localProperties.listseparator;}},isValid: function(){return dojo.validate.isEmailAddressList(this.textbox.value, this.flags);}}
+);
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/LayoutContainer.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/LayoutContainer.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/LayoutContainer.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/LayoutContainer.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,4 @@
+
+dojo.provide("dojo.widget.LayoutContainer");dojo.require("dojo.widget.*");dojo.require("dojo.widget.html.layout");dojo.widget.defineWidget(
+"dojo.widget.LayoutContainer",dojo.widget.HtmlWidget,{isContainer: true,layoutChildPriority: 'top-bottom',postCreate: function(){dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);},addChild: function(child, overrideContainerNode, pos, ref, insertIndex){dojo.widget.LayoutContainer.superclass.addChild.call(this, child, overrideContainerNode, pos, ref, insertIndex);dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);},removeChild: function(pane){dojo.widget.LayoutContainer.superclass.removeChild.call(this,pane);dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);},onResized: function(){dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);},show: function(){this.domNode.style.display="";this.checkSize();this.domNode.style.display="none";this.domNode.style.visibility="";dojo.widget.LayoutContainer.superclass.show.call(this);}});dojo.lang.extend(dojo.widget.Widget, {layoutA
 lign: 'none'
+});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/LinkPane.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/LinkPane.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/LinkPane.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/LinkPane.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,3 @@
+
+dojo.provide("dojo.widget.LinkPane");dojo.require("dojo.widget.*");dojo.require("dojo.widget.ContentPane");dojo.require("dojo.html.style");dojo.widget.defineWidget(
+"dojo.widget.LinkPane",dojo.widget.ContentPane,{templateString: '<div class="dojoLinkPane"></div>',fillInTemplate: function(args, frag){var source = this.getFragNodeRef(frag);this.label += source.innerHTML;var source = this.getFragNodeRef(frag);dojo.html.copyStyle(this.domNode, source);}});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Manager.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Manager.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Manager.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Manager.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,49 @@
+
+dojo.provide("dojo.widget.Manager");dojo.require("dojo.lang.array");dojo.require("dojo.lang.func");dojo.require("dojo.event.*");dojo.widget.manager = new function(){this.widgets = [];this.widgetIds = [];this.topWidgets = {};var widgetTypeCtr = {};var renderPrefixCache = [];this.getUniqueId = function (widgetType) {var widgetId;do{widgetId = widgetType + "_" + (widgetTypeCtr[widgetType] != undefined ?
+++widgetTypeCtr[widgetType] : widgetTypeCtr[widgetType] = 0);}while(this.getWidgetById(widgetId));return widgetId;}
+this.add = function(widget){this.widgets.push(widget);if(!widget.extraArgs["id"]){widget.extraArgs["id"] = widget.extraArgs["ID"];}
+if(widget.widgetId == ""){if(widget["id"]){widget.widgetId = widget["id"];}else if(widget.extraArgs["id"]){widget.widgetId = widget.extraArgs["id"];}else{widget.widgetId = this.getUniqueId(widget.ns+'_'+widget.widgetType);}}
+if(this.widgetIds[widget.widgetId]){dojo.debug("widget ID collision on ID: "+widget.widgetId);}
+this.widgetIds[widget.widgetId] = widget;}
+this.destroyAll = function(){for(var x=this.widgets.length-1; x>=0; x--){try{this.widgets[x].destroy(true);delete this.widgets[x];}catch(e){ }}
+}
+this.remove = function(widgetIndex){if(dojo.lang.isNumber(widgetIndex)){var tw = this.widgets[widgetIndex].widgetId;delete this.widgetIds[tw];this.widgets.splice(widgetIndex, 1);}else{this.removeById(widgetIndex);}}
+this.removeById = function(id) {if(!dojo.lang.isString(id)){id = id["widgetId"];if(!id){ dojo.debug("invalid widget or id passed to removeById"); return; }}
+for (var i=0; i<this.widgets.length; i++){if(this.widgets[i].widgetId == id){this.remove(i);break;}}
+}
+this.getWidgetById = function(id){if(dojo.lang.isString(id)){return this.widgetIds[id];}
+return id;}
+this.getWidgetsByType = function(type){var lt = type.toLowerCase();var getType = (type.indexOf(":") < 0 ?
+function(x) { return x.widgetType.toLowerCase(); } :
+function(x) { return x.getNamespacedType(); }
+);var ret = [];dojo.lang.forEach(this.widgets, function(x){if(getType(x) == lt){ret.push(x);}});return ret;}
+this.getWidgetsByFilter = function(unaryFunc, onlyOne){var ret = [];dojo.lang.every(this.widgets, function(x){if(unaryFunc(x)){ret.push(x);if(onlyOne){return false;}}
+return true;});return (onlyOne ? ret[0] : ret);}
+this.getAllWidgets = function() {return this.widgets.concat();}
+this.getWidgetByNode = function( node){var w=this.getAllWidgets();node = dojo.byId(node);for(var i=0; i<w.length; i++){if(w[i].domNode==node){return w[i];}}
+return null;}
+this.byId = this.getWidgetById;this.byType = this.getWidgetsByType;this.byFilter = this.getWidgetsByFilter;this.byNode = this.getWidgetByNode;var knownWidgetImplementations = {};var widgetPackages = ["dojo.widget"];for (var i=0; i<widgetPackages.length; i++) {widgetPackages[widgetPackages[i]] = true;}
+this.registerWidgetPackage = function(pname) {if(!widgetPackages[pname]){widgetPackages[pname] = true;widgetPackages.push(pname);}}
+this.getWidgetPackageList = function() {return dojo.lang.map(widgetPackages, function(elt) { return(elt!==true ? elt : undefined); });}
+this.getImplementation = function(widgetName, ctorObject, mixins, ns){var impl = this.getImplementationName(widgetName, ns);if(impl){var ret = ctorObject ? new impl(ctorObject) : new impl();return ret;}}
+function buildPrefixCache() {for(var renderer in dojo.render){if(dojo.render[renderer]["capable"] === true){var prefixes = dojo.render[renderer].prefixes;for(var i=0; i<prefixes.length; i++){renderPrefixCache.push(prefixes[i].toLowerCase());}}
+}}
+var findImplementationInModule = function(lowerCaseWidgetName, module){if(!module){return null;}
+for(var i=0, l=renderPrefixCache.length, widgetModule; i<=l; i++){widgetModule = (i<l ? module[renderPrefixCache[i]] : module);if(!widgetModule){continue;}
+for(var name in widgetModule){if(name.toLowerCase() == lowerCaseWidgetName){return widgetModule[name];}}
+}
+return null;}
+var findImplementation = function(lowerCaseWidgetName, moduleName){var module = dojo.getObject(moduleName, false);return (module ? findImplementationInModule(lowerCaseWidgetName, module) : null);}
+this.getImplementationName = function(widgetName, ns){var lowerCaseWidgetName = widgetName.toLowerCase();ns=ns||"dojo";var imps = knownWidgetImplementations[ns] || (knownWidgetImplementations[ns]={});var impl = imps[lowerCaseWidgetName];if(impl){return impl;}
+if(!renderPrefixCache.length){buildPrefixCache();}
+var nsObj = dojo.ns.get(ns);if(!nsObj){dojo.ns.register(ns, ns + '.widget');nsObj = dojo.ns.get(ns);}
+if(nsObj){nsObj.resolve(widgetName);}
+impl = findImplementation(lowerCaseWidgetName, nsObj.module);if(impl){return(imps[lowerCaseWidgetName] = impl)};nsObj = dojo.ns.require(ns);if((nsObj)&&(nsObj.resolver)){nsObj.resolve(widgetName);impl = findImplementation(lowerCaseWidgetName, nsObj.module);if(impl){return(imps[lowerCaseWidgetName] = impl)};}
+throw new Error('Could not locate widget implementation for "' + widgetName + '" in "' + nsObj.module + '" registered to namespace "' + nsObj.name + '"');}
+this.resizing=false;this.onWindowResized = function(){if(this.resizing){return;}
+try{this.resizing=true;for(var id in this.topWidgets){var child = this.topWidgets[id];if(child.checkSize ){child.checkSize();}}
+}catch(e){}finally{this.resizing=false;}}
+if(typeof window != "undefined") {dojo.addOnLoad(this, 'onWindowResized');dojo.event.connect(window, 'onresize', this, 'onWindowResized');}};(function(){var dw = dojo.widget;var dwm = dw.manager;var h = dojo.lang.curry(dojo.lang, "hitch", dwm);var g = function(oldName, newName){dw[(newName||oldName)] = h(oldName);}
+g("add", "addWidget");g("destroyAll", "destroyAllWidgets");g("remove", "removeWidget");g("removeById", "removeWidgetById");g("getWidgetById");g("getWidgetById", "byId");g("getWidgetsByType");g("getWidgetsByFilter");g("getWidgetsByType", "byType");g("getWidgetsByFilter", "byFilter");g("getWidgetByNode", "byNode");dw.all = function(n){var widgets = dwm.getAllWidgets.apply(dwm, arguments);if(arguments.length > 0) {return widgets[n];}
+return widgets;}
+g("registerWidgetPackage");g("getImplementation", "getWidgetImplementation");g("getImplementationName", "getWidgetImplementationName");dw.widgets = dwm.widgets;dw.widgetIds = dwm.widgetIds;dw.root = dwm.root;})();
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Menu2.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Menu2.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Menu2.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Menu2.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,88 @@
+
+dojo.provide("dojo.widget.Menu2");dojo.require("dojo.widget.PopupContainer");dojo.declare(
+"dojo.widget.MenuBase",null,function(){this.targetNodeIds = [];this.eventNames =  {open: ""
+};},{isContainer: true,snarfChildDomOutput: true,eventNaming: "default",templateString: '<table class="dojoPopupMenu2" border=0 cellspacing=0 cellpadding=0 style="display: none;"><tbody dojoAttachPoint="containerNode"></tbody></table>',templateCssPath: dojo.uri.moduleUri("dojo", "widget/templates/Menu2.css"),templateCssString: "",submenuDelay: 500,submenuOverlap: 5,contextMenuForWindow: false,initialize: function(args, frag) {if (this.eventNaming == "default") {for (var eventName in this.eventNames) {this.eventNames[eventName] = this.widgetId+"/"+eventName;}}
+},postCreate: function(){if (this.contextMenuForWindow){var doc = dojo.body();this.bindDomNode(doc);} else if ( this.targetNodeIds.length > 0 ){dojo.lang.forEach(this.targetNodeIds, this.bindDomNode, this);}
+this._subscribeSubitemsOnOpen();},_subscribeSubitemsOnOpen: function() {var subItems = this.getChildrenOfType(dojo.widget.MenuItem2);for(var i=0; i<subItems.length; i++) {dojo.event.topic.subscribe(this.eventNames.open, subItems[i], "menuOpen")
+}},getTopOpenEvent: function() {var menu = this;while (menu.parentPopup){ menu = menu.parentPopup; }
+return menu.openEvent;},bindDomNode: function( node){node = dojo.byId(node);var win = dojo.html.getElementWindow(node);if(dojo.html.isTag(node,'iframe') == 'iframe'){win = dojo.html.iframeContentWindow(node);node = dojo.withGlobal(win, dojo.body);}
+dojo.widget.Menu2.OperaAndKonqFixer.fixNode(node);dojo.event.kwConnect({srcObj:     node,srcFunc:    "oncontextmenu",targetObj:  this,targetFunc: "onOpen",once:       true
+});if(dojo.render.html.moz && win.document.designMode.toLowerCase() == 'on'){dojo.event.browser.addListener(node, "contextmenu", dojo.lang.hitch(this, "onOpen"));}
+dojo.widget.PopupManager.registerWin(win);},unBindDomNode: function( nodeName){var node = dojo.byId(nodeName);dojo.event.kwDisconnect({srcObj:     node,srcFunc:    "oncontextmenu",targetObj:  this,targetFunc: "onOpen",once:       true
+});dojo.widget.Menu2.OperaAndKonqFixer.cleanNode(node);},_moveToNext: function( evt){this._highlightOption(1);return true;},_moveToPrevious: function( evt){this._highlightOption(-1);return true;},_moveToParentMenu: function( evt){if(this._highlighted_option && this.parentPopup){if(evt._menu2UpKeyProcessed){return true;}else{this._highlighted_option.onUnhover();this.closeSubpopup();evt._menu2UpKeyProcessed = true;}}
+return false;},_moveToChildMenu: function( evt){if(this._highlighted_option && this._highlighted_option.submenuId){this._highlighted_option._onClick(true);return true;}
+return false;},_selectCurrentItem: function( evt){if(this._highlighted_option){this._highlighted_option._onClick();return true;}
+return false;},processKey: function( evt){if(evt.ctrlKey || evt.altKey || !evt.key){ return false; }
+var rval = false;switch(evt.key){case evt.KEY_DOWN_ARROW:
+rval = this._moveToNext(evt);break;case evt.KEY_UP_ARROW:
+rval = this._moveToPrevious(evt);break;case evt.KEY_RIGHT_ARROW:
+rval = this._moveToChildMenu(evt);break;case evt.KEY_LEFT_ARROW:
+rval = this._moveToParentMenu(evt);break;case " ":
+case evt.KEY_ENTER:
+if(rval = this._selectCurrentItem(evt)){break;}
+case evt.KEY_ESCAPE:
+dojo.widget.PopupManager.currentMenu.close();rval = true;break;}
+return rval;},_findValidItem: function(dir, curItem){if(curItem){curItem = dir>0 ? curItem.getNextSibling() : curItem.getPreviousSibling();}
+for(var i=0; i < this.children.length; ++i){if(!curItem){curItem = dir>0 ? this.children[0] : this.children[this.children.length-1];}
+if(curItem.onHover && curItem.isShowing()){return curItem;}
+curItem = dir>0 ? curItem.getNextSibling() : curItem.getPreviousSibling();}},_highlightOption: function(dir){var item;if((!this._highlighted_option)){item = this._findValidItem(dir);}else{item = this._findValidItem(dir, this._highlighted_option);}
+if(item){if(this._highlighted_option) {this._highlighted_option.onUnhover();}
+item.onHover();dojo.html.scrollIntoView(item.domNode);try {var node = dojo.html.getElementsByClass("dojoMenuItem2Label", item.domNode)[0];node.focus();} catch(e) { }}
+},onItemClick: function( item) {},close: function( force){if(this.animationInProgress){dojo.widget.PopupMenu2.superclass.close.apply(this, arguments);return;}
+if(this._highlighted_option){this._highlighted_option.onUnhover();}
+dojo.widget.PopupMenu2.superclass.close.apply(this, arguments);},closeSubpopup: function(force){if (this.currentSubpopup == null){ return; }
+this.currentSubpopup.close(force);this.currentSubpopup = null;this.currentSubmenuTrigger.is_open = false;this.currentSubmenuTrigger._closedSubmenu(force);this.currentSubmenuTrigger = null;},_openSubmenu: function(submenu, from_item){var fromPos = dojo.html.getAbsolutePosition(from_item.domNode, true);var our_w = dojo.html.getMarginBox(this.domNode).width;var x = fromPos.x + our_w - this.submenuOverlap;var y = fromPos.y;submenu.open(x, y, this, from_item.domNode);this.currentSubmenuTrigger = from_item;this.currentSubmenuTrigger.is_open = true;},onOpen: function( e){this.openEvent = e;if(e["target"]){this.openedForWindow = dojo.html.getElementWindow(e.target);}else{this.openedForWindow = null;}
+var x = e.pageX, y = e.pageY;var win = dojo.html.getElementWindow(e.target);var iframe = win._frameElement || win.frameElement;if(iframe){var cood = dojo.html.abs(iframe, true);x += cood.x - dojo.withGlobal(win, dojo.html.getScroll).left;y += cood.y - dojo.withGlobal(win, dojo.html.getScroll).top;}
+this.open(x, y, null, [x, y]);e.preventDefault();e.stopPropagation();}});dojo.widget.defineWidget(
+"dojo.widget.PopupMenu2",[dojo.widget.HtmlWidget, dojo.widget.MenuBase, dojo.widget.PopupContainerBase],{}
+);dojo.widget.defineWidget(
+"dojo.widget.MenuItem2",dojo.widget.HtmlWidget,function(){this.eventNames = {engage: ""
+};},{templateString:
+'<tr class="dojoMenuItem2" dojoAttachEvent="onMouseOver: onHover; onMouseOut: onUnhover; onClick: _onClick; onKey:onKey;">'
++'<td><div class="${this.iconClass}" style="${this.iconStyle}"></div></td>'
++'<td tabIndex="-1" class="dojoMenuItem2Label">${this.caption}</td>'
++'<td class="dojoMenuItem2Accel">${this.accelKey}</td>'
++'<td><div class="dojoMenuItem2Submenu" style="display:${this.arrowDisplay};"></div></td>'
++'</tr>',is_hovering: false,hover_timer: null,is_open: false,topPosition: 0,caption: 'Untitled',accelKey: '',iconSrc: '',disabledClass: 'dojoMenuItem2Disabled',iconClass: 'dojoMenuItem2Icon',submenuId: '',eventNaming: "default",highlightClass: 'dojoMenuItem2Hover',postMixInProperties: function(){this.iconStyle="";if (this.iconSrc){if ((this.iconSrc.toLowerCase().substring(this.iconSrc.length-4) == ".png") && (dojo.render.html.ie55 || dojo.render.html.ie60)){this.iconStyle="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.iconSrc+"', sizingMethod='image')";}else{this.iconStyle="background-image: url("+this.iconSrc+")";}}
+this.arrowDisplay = this.submenuId ? 'block' : 'none';dojo.widget.MenuItem2.superclass.postMixInProperties.apply(this, arguments);},fillInTemplate: function(){dojo.html.disableSelection(this.domNode);if (this.disabled){this.setDisabled(true);}
+if (this.eventNaming == "default") {for (var eventName in this.eventNames) {this.eventNames[eventName] = this.widgetId+"/"+eventName;}}
+},onHover: function(){this.onUnhover();if (this.is_hovering){ return; }
+if (this.is_open){ return; }
+if(this.parent._highlighted_option){this.parent._highlighted_option.onUnhover();}
+this.parent.closeSubpopup();this.parent._highlighted_option = this;dojo.widget.PopupManager.setFocusedMenu(this.parent);this._highlightItem();if (this.is_hovering){ this._stopSubmenuTimer(); }
+this.is_hovering = true;this._startSubmenuTimer();},onUnhover: function(){if(!this.is_open){ this._unhighlightItem(); }
+this.is_hovering = false;this.parent._highlighted_option = null;if(this.parent.parentPopup){dojo.widget.PopupManager.setFocusedMenu(this.parent.parentPopup);}
+this._stopSubmenuTimer();},_onClick: function(focus){var displayingSubMenu = false;if (this.disabled){ return false; }
+if (this.submenuId){if (!this.is_open){this._stopSubmenuTimer();this._openSubmenu();}
+displayingSubMenu = true;}else{this.onUnhover();this.parent.closeAll(true);}
+this.onClick();dojo.event.topic.publish(this.eventNames.engage, this);if(displayingSubMenu && focus){dojo.widget.getWidgetById(this.submenuId)._highlightOption(1);}
+return;},onClick: function() {this.parent.onItemClick(this);},_highlightItem: function(){dojo.html.addClass(this.domNode, this.highlightClass);},_unhighlightItem: function(){dojo.html.removeClass(this.domNode, this.highlightClass);},_startSubmenuTimer: function(){this._stopSubmenuTimer();if (this.disabled){ return; }
+var self = this;var closure = function(){ return function(){ self._openSubmenu(); }}();this.hover_timer = dojo.lang.setTimeout(closure, this.parent.submenuDelay);},_stopSubmenuTimer: function(){if (this.hover_timer){dojo.lang.clearTimeout(this.hover_timer);this.hover_timer = null;}},_openSubmenu: function(){if (this.disabled){ return; }
+this.parent.closeSubpopup();var submenu = dojo.widget.getWidgetById(this.submenuId);if (submenu){this.parent._openSubmenu(submenu, this);}},_closedSubmenu: function(){this.onUnhover();},setDisabled: function( value){this.disabled = value;if (this.disabled){dojo.html.addClass(this.domNode, this.disabledClass);}else{dojo.html.removeClass(this.domNode, this.disabledClass);}},enable: function(){this.setDisabled(false);},disable: function(){this.setDisabled(true);},menuOpen: function(message) {}});dojo.widget.defineWidget(
+"dojo.widget.MenuSeparator2",dojo.widget.HtmlWidget,{templateString: '<tr class="dojoMenuSeparator2"><td colspan=4>'
++'<div class="dojoMenuSeparator2Top"></div>'
++'<div class="dojoMenuSeparator2Bottom"></div>'
++'</td></tr>',postCreate: function(){dojo.html.disableSelection(this.domNode);}});dojo.widget.defineWidget(
+"dojo.widget.MenuBar2",[dojo.widget.HtmlWidget, dojo.widget.MenuBase],{menuOverlap: 2,templateString: '<div class="dojoMenuBar2" tabIndex="0"><table class="dojoMenuBar2Client"><tr dojoAttachPoint="containerNode"></tr></table></div>',close: function(force){if(this._highlighted_option){this._highlighted_option.onUnhover();}
+this.closeSubpopup(force);},processKey: function( evt){if(evt.ctrlKey || evt.altKey){ return false; }
+if (!dojo.html.hasClass(evt.target,"dojoMenuBar2")) { return false; }
+var rval = false;switch(evt.key){case evt.KEY_DOWN_ARROW:
+rval = this._moveToChildMenu(evt);break;case evt.KEY_UP_ARROW:
+rval = this._moveToParentMenu(evt);break;case evt.KEY_RIGHT_ARROW:
+rval = this._moveToNext(evt);break;case evt.KEY_LEFT_ARROW:
+rval = this._moveToPrevious(evt);break;default:
+rval = dojo.widget.MenuBar2.superclass.processKey.apply(this, arguments);break;}
+return rval;},postCreate: function(){dojo.widget.MenuBar2.superclass.postCreate.apply(this, arguments);dojo.widget.PopupManager.opened(this);this.isShowingNow = true;},_openSubmenu: function(submenu, from_item){var fromPos = dojo.html.getAbsolutePosition(from_item.domNode, true);var ourPos = dojo.html.getAbsolutePosition(this.domNode, true);var our_h = dojo.html.getBorderBox(this.domNode).height;var x = fromPos.x;var y = ourPos.y + our_h - this.menuOverlap;submenu.open(x, y, this, from_item.domNode);this.currentSubmenuTrigger = from_item;this.currentSubmenuTrigger.is_open = true;}});dojo.widget.defineWidget(
+"dojo.widget.MenuBarItem2",dojo.widget.MenuItem2,{templateString:
+'<td class="dojoMenuBarItem2" dojoAttachEvent="onMouseOver: onHover; onMouseOut: onUnhover; onClick: _onClick;">'
++'<span>${this.caption}</span>'
++'</td>',highlightClass: 'dojoMenuBarItem2Hover',setDisabled: function(value){this.disabled = value;if (this.disabled){dojo.html.addClass(this.domNode, 'dojoMenuBarItem2Disabled');}else{dojo.html.removeClass(this.domNode, 'dojoMenuBarItem2Disabled');}}
+});dojo.widget.Menu2.OperaAndKonqFixer = new function(){var implement = true;var delfunc = false;if (!dojo.lang.isFunction(dojo.doc().oncontextmenu)){dojo.doc().oncontextmenu = function(){implement = false;delfunc = true;}}
+if (dojo.doc().createEvent){try {var e = dojo.doc().createEvent("MouseEvents");e.initMouseEvent("contextmenu", 1, 1, dojo.global(), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, null);dojo.doc().dispatchEvent(e);} catch (e) {}} else {implement = false;}
+if (delfunc){delete dojo.doc().oncontextmenu;}
+this.fixNode = function(node){if (implement){if (!dojo.lang.isFunction(node.oncontextmenu)){node.oncontextmenu = function(e){}}
+if (dojo.render.html.opera){node._menufixer_opera = function(e){if (e.ctrlKey){this.oncontextmenu(e);}};dojo.event.connect(node, "onclick", node, "_menufixer_opera");} else {node._menufixer_konq = function(e){if (e.button==2 ){e.preventDefault();this.oncontextmenu(e);}};dojo.event.connect(node, "onmousedown", node, "_menufixer_konq");}}
+}
+this.cleanNode = function(node){if (implement){if (node._menufixer_opera){dojo.event.disconnect(node, "onclick", node, "_menufixer_opera");delete node._menufixer_opera;} else if(node._menufixer_konq){dojo.event.disconnect(node, "onmousedown", node, "_menufixer_konq");delete node._menufixer_konq;}
+if (node.oncontextmenu){delete node.oncontextmenu;}}
+}};
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/MonthlyCalendar.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/MonthlyCalendar.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/MonthlyCalendar.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/MonthlyCalendar.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,19 @@
+
+dojo.provide("dojo.widget.MonthlyCalendar");dojo.require("dojo.date.common");dojo.require("dojo.date.format");dojo.require("dojo.widget.*");dojo.require("dojo.widget.DatePicker");dojo.require("dojo.event.*");dojo.require("dojo.html.*");dojo.require("dojo.experimental");dojo.experimental("dojo.widget.MonthlyCalendar");dojo.widget.defineWidget(
+"dojo.widget.MonthlyCalendar",dojo.widget.DatePicker,{dayWidth: 'wide',templatePath: dojo.uri.moduleUri("dojo", "widget/templates/MonthlyCalendar.html"),templateCssPath: dojo.uri.moduleUri("dojo", "widget/templates/MonthlyCalendar.css"),initializer: function(){this.iCalendars = [];},addCalendar: function( cal) {dojo.debug("Adding Calendar");this.iCalendars.push(cal);dojo.debug("Starting init");this.initUI();dojo.debug("done init");},createDayContents: function(node,mydate) {dojo.html.removeChildren(node);node.appendChild(document.createTextNode(mydate.getDate()));for(var x=0; x<this.iCalendars.length; x++) {var evts = this.iCalendars[x].getEvents(mydate);if ((dojo.lang.isArray(evts)) && (evts.length>0)) {for(var y=0;y<evts.length;y++) {var el = document.createElement("div");dojo.html.addClass(el, "dojoMonthlyCalendarEvent");el.appendChild(document.createTextNode(evts[y].summary.value));el.width = dojo.html.getContentBox(node).width;node.appendChild(el);}}
+}},initUI: function() {var dayLabels = dojo.date.getNames('days', this.dayWidth, 'standAlone', this.lang);var dayLabelNodes = this.dayLabelsRow.getElementsByTagName("td");for(var i=0; i<7; i++) {dayLabelNodes.item(i).innerHTML = dayLabels[i];}
+this.selectedIsUsed = false;this.currentIsUsed = false;var currentClassName = "";var previousDate = new Date();var calendarNodes = this.calendarDatesContainerNode.getElementsByTagName("td");var currentCalendarNode;previousDate.setHours(8);var nextDate = new Date(this.firstSaturday.year, this.firstSaturday.month, this.firstSaturday.date, 8);var lastDay = new Date(this.firstSaturday.year, this.firstSaturday.month, this.firstSaturday.date + 42, 8);if (this.iCalendars.length > 0) {for (var x=0; x<this.iCalendars.length;x++) {this.iCalendars[x].preComputeRecurringEvents(lastDay);}}
+if(this.firstSaturday.date < 7) {var dayInWeek = 6;for (var i=this.firstSaturday.date; i>0; i--) {currentCalendarNode = calendarNodes.item(dayInWeek);this.createDayContents(currentCalendarNode, nextDate);dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "current"));dayInWeek--;previousDate = nextDate;nextDate = this.incrementDate(nextDate, false);}
+for(var i=dayInWeek; i>-1; i--) {currentCalendarNode = calendarNodes.item(i);this.createDayContents(currentCalendarNode, nextDate);dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "previous"));previousDate = nextDate;nextDate = this.incrementDate(nextDate, false);}} else {nextDate.setDate(1);for(var i=0; i<7; i++) {currentCalendarNode = calendarNodes.item(i);this.createDayContents(currentCalendarNode, nextDate);dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "current"));previousDate = nextDate;nextDate = this.incrementDate(nextDate, true);}}
+previousDate.setDate(this.firstSaturday.date);previousDate.setMonth(this.firstSaturday.month);previousDate.setFullYear(this.firstSaturday.year);nextDate = this.incrementDate(previousDate, true);var count = 7;currentCalendarNode = calendarNodes.item(count);while((nextDate.getMonth() == previousDate.getMonth()) && (count<42)) {this.createDayContents(currentCalendarNode, nextDate);dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "current"));currentCalendarNode = calendarNodes.item(++count);previousDate = nextDate;nextDate = this.incrementDate(nextDate, true);}
+while(count < 42) {this.createDayContents(currentCalendarNode, nextDate);dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "next"));currentCalendarNode = calendarNodes.item(++count);previousDate = nextDate;nextDate = this.incrementDate(nextDate, true);}
+this.setMonthLabel(this.firstSaturday.month);this.setYearLabels(this.firstSaturday.year);}}
+);dojo.widget.MonthlyCalendar.util= new function() {this.toRfcDate = function(jsDate) {if(!jsDate) {jsDate = this.today;}
+var year = jsDate.getFullYear();var month = jsDate.getMonth() + 1;if (month < 10) {month = "0" + month.toString();}
+var date = jsDate.getDate();if (date < 10) {date = "0" + date.toString();}
+return year + "-" + month + "-" + date + "T00:00:00+00:00";}
+this.fromRfcDate = function(rfcDate) {var tempDate = rfcDate.split("-");if(tempDate.length < 3) {return new Date();}
+return new Date(parseInt(tempDate[0]), (parseInt(tempDate[1], 10) - 1), parseInt(tempDate[2].substr(0,2), 10));}
+this.initFirstSaturday = function(month, year) {if(!month) {month = this.date.getMonth();}
+if(!year) {year = this.date.getFullYear();}
+var firstOfMonth = new Date(year, month, 1);return {year: year, month: month, date: 7 - firstOfMonth.getDay()};}}

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/PageContainer.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/PageContainer.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/PageContainer.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/PageContainer.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,24 @@
+
+dojo.provide("dojo.widget.PageContainer");dojo.require("dojo.lang.func");dojo.require("dojo.widget.*");dojo.require("dojo.event.*");dojo.require("dojo.html.selection");dojo.widget.defineWidget("dojo.widget.PageContainer", dojo.widget.HtmlWidget, {isContainer: true,doLayout: true,templateString: "<div dojoAttachPoint='containerNode'></div>",selectedChild: "",fillInTemplate: function(args, frag) {var source = this.getFragNodeRef(frag);dojo.html.copyStyle(this.domNode, source);for(var child=dojo.html.firstElement(this.containerNode); child; child=dojo.html.nextElement(child)){child.style.display="none";}
+dojo.widget.PageContainer.superclass.fillInTemplate.apply(this, arguments);},postCreate: function(args, frag) {if(this.children.length){dojo.lang.forEach(this.children, this._setupChild, this);var initialChild;if(this.selectedChild){this.selectChild(this.selectedChild);}else{for(var i=0; i<this.children.length; i++){if(this.children[i].selected){this.selectChild(this.children[i]);break;}}
+if(!this.selectedChildWidget){this.selectChild(this.children[0]);}}
+}},addChild: function(child){dojo.widget.PageContainer.superclass.addChild.apply(this, arguments);this._setupChild(child);this.onResized();if(!this.selectedChildWidget){this.selectChild(child);}},_setupChild: function( page){page.hide();page.domNode.style.position="relative";dojo.event.topic.publish(this.widgetId+"-addChild", page);},removeChild: function( page){dojo.widget.PageContainer.superclass.removeChild.apply(this, arguments);if(this._beingDestroyed){ return; }
+dojo.event.topic.publish(this.widgetId+"-removeChild", page);this.onResized();if (this.selectedChildWidget === page) {this.selectedChildWidget = undefined;if (this.children.length > 0) {this.selectChild(this.children[0], true);}}
+},selectChild: function( page,  callingWidget){page = dojo.widget.byId(page);this.correspondingPageButton = callingWidget;if(this.selectedChildWidget){this._hideChild(this.selectedChildWidget);}
+this.selectedChildWidget = page;this.selectedChild = page.widgetId;this._showChild(page);page.isFirstChild = (page == this.children[0]);page.isLastChild = (page == this.children[this.children.length-1]);dojo.event.topic.publish(this.widgetId+"-selectChild", page);},forward: function(){var index = dojo.lang.find(this.children, this.selectedChildWidget);this.selectChild(this.children[index+1]);},back: function(){var index = dojo.lang.find(this.children, this.selectedChildWidget);this.selectChild(this.children[index-1]);},onResized: function(){if(this.doLayout && this.selectedChildWidget){with(this.selectedChildWidget.domNode.style){top = dojo.html.getPixelValue(this.containerNode, "padding-top", true);left = dojo.html.getPixelValue(this.containerNode, "padding-left", true);}
+var content = dojo.html.getContentBox(this.containerNode);this.selectedChildWidget.resizeTo(content.width, content.height);}},_showChild: function( page) {if(this.doLayout){var content = dojo.html.getContentBox(this.containerNode);page.resizeTo(content.width, content.height);}
+page.selected=true;page.show();},_hideChild: function( page) {page.selected=false;page.hide();},closeChild: function( page) {var remove = page.onClose(this, page);if(remove) {this.removeChild(page);page.destroy();}},destroy: function(){this._beingDestroyed = true;dojo.event.topic.destroy(this.widgetId+"-addChild");dojo.event.topic.destroy(this.widgetId+"-removeChild");dojo.event.topic.destroy(this.widgetId+"-selectChild");dojo.widget.PageContainer.superclass.destroy.apply(this, arguments);}});dojo.widget.defineWidget(
+"dojo.widget.PageController",dojo.widget.HtmlWidget,{templateString: "<span wairole='tablist' dojoAttachEvent='onKey'></span>",isContainer: true,containerId: "",buttonWidget: "PageButton","class": "dojoPageController",fillInTemplate: function() {dojo.html.addClass(this.domNode, this["class"]);dojo.widget.wai.setAttr(this.domNode, "waiRole", "role", "tablist");},postCreate: function(){this.pane2button = {};var container = dojo.widget.byId(this.containerId);if(container){dojo.lang.forEach(container.children, this.onAddChild, this);}
+dojo.event.topic.subscribe(this.containerId+"-addChild", this, "onAddChild");dojo.event.topic.subscribe(this.containerId+"-removeChild", this, "onRemoveChild");dojo.event.topic.subscribe(this.containerId+"-selectChild", this, "onSelectChild");},destroy: function(){dojo.event.topic.unsubscribe(this.containerId+"-addChild", this, "onAddChild");dojo.event.topic.unsubscribe(this.containerId+"-removeChild", this, "onRemoveChild");dojo.event.topic.unsubscribe(this.containerId+"-selectChild", this, "onSelectChild");dojo.widget.PageController.superclass.destroy.apply(this, arguments);},onAddChild: function( page){var button = dojo.widget.createWidget(this.buttonWidget,{label: page.label,closeButton: page.closable
+});this.addChild(button);this.domNode.appendChild(button.domNode);this.pane2button[page]=button;page.controlButton = button;var _this = this;dojo.event.connect(button, "onClick", function(){ _this.onButtonClick(page); });dojo.event.connect(button, "onCloseButtonClick", function(){ _this.onCloseButtonClick(page); });},onRemoveChild: function( page){if(this._currentChild == page){ this._currentChild = null; }
+var button = this.pane2button[page];if(button){button.destroy();}
+this.pane2button[page] = null;},onSelectChild: function( page){if(this._currentChild){var oldButton=this.pane2button[this._currentChild];oldButton.clearSelected();}
+var newButton=this.pane2button[page];newButton.setSelected();this._currentChild=page;},onButtonClick: function( page){var container = dojo.widget.byId(this.containerId);container.selectChild(page, false, this);},onCloseButtonClick: function( page){var container = dojo.widget.byId(this.containerId);container.closeChild(page);},onKey: function( evt){if( (evt.keyCode == evt.KEY_RIGHT_ARROW)||
+(evt.keyCode == evt.KEY_LEFT_ARROW) ){var current = 0;var next = null;var current = dojo.lang.find(this.children, this.pane2button[this._currentChild]);if(evt.keyCode == evt.KEY_RIGHT_ARROW){next = this.children[ (current+1) % this.children.length ];}else{next = this.children[ (current+ (this.children.length-1)) % this.children.length ];}
+dojo.event.browser.stopEvent(evt);next.onClick();}}
+}
+);dojo.widget.defineWidget("dojo.widget.PageButton", dojo.widget.HtmlWidget,{templateString: "<span class='item'>" +
+"<span dojoAttachEvent='onClick' dojoAttachPoint='titleNode' class='selectButton'>${this.label}</span>" +
+"<span dojoAttachEvent='onClick:onCloseButtonClick' class='closeButton'>[X]</span>" +
+"</span>",label: "foo",closeButton: false,onClick: function(){this.focus();},onCloseButtonMouseOver: function(){dojo.html.addClass(this.closeButtonNode, "closeHover");},onCloseButtonMouseOut: function(){dojo.html.removeClass(this.closeButtonNode, "closeHover");},onCloseButtonClick: function( evt){},setSelected: function(){dojo.html.addClass(this.domNode, "current");this.titleNode.setAttribute("tabIndex","0");},clearSelected: function(){dojo.html.removeClass(this.domNode, "current");this.titleNode.setAttribute("tabIndex","-1");},focus: function(){if(this.titleNode.focus){this.titleNode.focus();}}
+});dojo.lang.extend(dojo.widget.Widget, {label: "",selected: false,closable: false,onClose: function(){return true;}});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Parse.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Parse.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Parse.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Parse.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,46 @@
+
+dojo.provide("dojo.widget.Parse");dojo.require("dojo.widget.Manager");dojo.require("dojo.dom");dojo.widget.Parse = function(fragment){this.propertySetsList = [];this.fragment = fragment;this.createComponents = function(frag, parentComp){var comps = [];var built = false;try{if(frag && frag.tagName && (frag != frag.nodeRef)){var djTags = dojo.widget.tags;var tna = String(frag.tagName).split(";");for(var x=0; x<tna.length; x++){var ltn = tna[x].replace(/^\s+|\s+$/g, "").toLowerCase();frag.tagName = ltn;var ret;if(djTags[ltn]){built = true;ret = djTags[ltn](frag, this, parentComp, frag.index);comps.push(ret);}else{if(ltn.indexOf(":") == -1){ltn = "dojo:"+ltn;}
+ret = dojo.widget.buildWidgetFromParseTree(ltn, frag, this, parentComp, frag.index);if(ret){built = true;comps.push(ret);}}
+}}
+}catch(e){dojo.debug("dojo.widget.Parse: error:", e);}
+if(!built){comps = comps.concat(this.createSubComponents(frag, parentComp));}
+return comps;}
+this.createSubComponents = function(fragment, parentComp){var frag, comps = [];for(var item in fragment){frag = fragment[item];if(frag && typeof frag == "object"
+&&(frag!=fragment.nodeRef)
+&&(frag!=fragment.tagName)
+&&(item.indexOf('$')==-1)){comps = comps.concat(this.createComponents(frag, parentComp));}}
+return comps;}
+this.parsePropertySets = function(fragment){return [];}
+this.parseProperties = function(fragment){var properties = {};for(var item in fragment){if((fragment[item] == fragment.tagName)||(fragment[item] == fragment.nodeRef)){}else{var frag = fragment[item];if(frag.tagName && dojo.widget.tags[frag.tagName.toLowerCase()]){}else if(frag[0] && frag[0].value!="" && frag[0].value!=null){try{if(item.toLowerCase() == "dataprovider"){var _this = this;this.getDataProvider(_this, frag[0].value);properties.dataProvider = this.dataProvider;}
+properties[item] = frag[0].value;var nestedProperties = this.parseProperties(frag);for(var property in nestedProperties){properties[property] = nestedProperties[property];}}catch(e){ dojo.debug(e); }}
+switch(item.toLowerCase()){case "checked":
+case "disabled":
+if (typeof properties[item] != "boolean"){properties[item] = true;}
+break;}}
+}
+return properties;}
+this.getDataProvider = function(objRef, dataUrl){dojo.io.bind({url: dataUrl,load: function(type, evaldObj){if(type=="load"){objRef.dataProvider = evaldObj;}},mimetype: "text/javascript",sync: true
+});}
+this.getPropertySetById = function(propertySetId){for(var x = 0; x < this.propertySetsList.length; x++){if(propertySetId == this.propertySetsList[x]["id"][0].value){return this.propertySetsList[x];}}
+return "";}
+this.getPropertySetsByType = function(componentType){var propertySets = [];for(var x=0; x < this.propertySetsList.length; x++){var cpl = this.propertySetsList[x];var cpcc = cpl.componentClass || cpl.componentType || null;var propertySetId = this.propertySetsList[x]["id"][0].value;if(cpcc && (propertySetId == cpcc[0].value)){propertySets.push(cpl);}}
+return propertySets;}
+this.getPropertySets = function(fragment){var ppl = "dojo:propertyproviderlist";var propertySets = [];var tagname = fragment.tagName;if(fragment[ppl]){var propertyProviderIds = fragment[ppl].value.split(" ");for(var propertySetId in propertyProviderIds){if((propertySetId.indexOf("..")==-1)&&(propertySetId.indexOf("://")==-1)){var propertySet = this.getPropertySetById(propertySetId);if(propertySet != ""){propertySets.push(propertySet);}}else{}}
+}
+return this.getPropertySetsByType(tagname).concat(propertySets);}
+this.createComponentFromScript = function(nodeRef, componentName, properties, ns){properties.fastMixIn = true;var ltn = (ns || "dojo") + ":" + componentName.toLowerCase();if(dojo.widget.tags[ltn]){return [dojo.widget.tags[ltn](properties, this, null, null, properties)];}
+return [dojo.widget.buildWidgetFromParseTree(ltn, properties, this, null, null, properties)];}}
+dojo.widget._parser_collection = {"dojo": new dojo.widget.Parse() };dojo.widget.getParser = function(name){if(!name){ name = "dojo"; }
+if(!this._parser_collection[name]){this._parser_collection[name] = new dojo.widget.Parse();}
+return this._parser_collection[name];}
+dojo.widget.createWidget = function(name, props, refNode, position){var isNode = false;var isNameStr = (typeof name == "string");if(isNameStr){var pos = name.indexOf(":");var ns = (pos > -1) ? name.substring(0,pos) : "dojo";if(pos > -1){ name = name.substring(pos+1); }
+var lowerCaseName = name.toLowerCase();var namespacedName = ns + ":" + lowerCaseName;isNode = (dojo.byId(name) && !dojo.widget.tags[namespacedName]);}
+if((arguments.length == 1) && (isNode || !isNameStr)){var xp = new dojo.xml.Parse();var tn = isNode ? dojo.byId(name) : name;return dojo.widget.getParser().createComponents(xp.parseElement(tn, null, true))[0];}
+function fromScript(placeKeeperNode, name, props, ns){props[namespacedName] = {dojotype: [{value: lowerCaseName}],nodeRef: placeKeeperNode,fastMixIn: true
+};props.ns = ns;return dojo.widget.getParser().createComponentFromScript(placeKeeperNode, name, props, ns);}
+props = props||{};var notRef = false;var tn = null;var h = dojo.render.html.capable;if(h){tn = document.createElement("span");}
+if(!refNode){notRef = true;refNode = tn;if(h){dojo.body().appendChild(refNode);}}else if(position){dojo.dom.insertAtPosition(tn, refNode, position);}else{tn = refNode;}
+var widgetArray = fromScript(tn, name.toLowerCase(), props, ns);if((!widgetArray)||(!widgetArray[0])||
+(typeof widgetArray[0].widgetType == "undefined") ){throw new Error("createWidget: Creation of \"" + name + "\" widget failed.");}
+try{if(notRef && widgetArray[0].domNode.parentNode){widgetArray[0].domNode.parentNode.removeChild(widgetArray[0].domNode);}}catch(e){dojo.debug(e);}
+return widgetArray[0];}

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/PopupContainer.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/PopupContainer.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/PopupContainer.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/PopupContainer.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,45 @@
+
+dojo.provide("dojo.widget.PopupContainer");dojo.require("dojo.html.style");dojo.require("dojo.html.layout");dojo.require("dojo.html.selection");dojo.require("dojo.html.iframe");dojo.require("dojo.event.*");dojo.require("dojo.widget.*");dojo.require("dojo.widget.HtmlWidget");dojo.declare(
+"dojo.widget.PopupContainerBase",null,function(){this.queueOnAnimationFinish = [];},{isShowingNow: false,currentSubpopup: null,beginZIndex: 1000,parentPopup: null,parent: null,popupIndex: 0,aroundBox: dojo.html.boxSizing.BORDER_BOX,openedForWindow: null,processKey: function(evt){return false;},applyPopupBasicStyle: function(){with(this.domNode.style){display = 'none';position = 'absolute';}},aboutToShow: function() {},open: function(x, y, parent, explodeSrc, orient, padding){if (this.isShowingNow){ return; }
+if(this.animationInProgress){this.queueOnAnimationFinish.push(this.open, arguments);return;}
+this.aboutToShow();var around = false, node, aroundOrient;if(typeof x == 'object'){node = x;aroundOrient = explodeSrc;explodeSrc = parent;parent = y;around = true;}
+this.parent = parent;dojo.body().appendChild(this.domNode);explodeSrc = explodeSrc || parent["domNode"] || [];var parentPopup = null;this.isTopLevel = true;while(parent){if(parent !== this && (parent.setOpenedSubpopup != undefined && parent.applyPopupBasicStyle != undefined)){parentPopup = parent;this.isTopLevel = false;parentPopup.setOpenedSubpopup(this);break;}
+parent = parent.parent;}
+this.parentPopup = parentPopup;this.popupIndex = parentPopup ? parentPopup.popupIndex + 1 : 1;if(this.isTopLevel){var button = dojo.html.isNode(explodeSrc) ? explodeSrc : null;dojo.widget.PopupManager.opened(this, button);}
+if(this.isTopLevel && !dojo.withGlobal(this.openedForWindow||dojo.global(), dojo.html.selection.isCollapsed)){this._bookmark = dojo.withGlobal(this.openedForWindow||dojo.global(), dojo.html.selection.getBookmark);}else{this._bookmark = null;}
+if(explodeSrc instanceof Array){explodeSrc = {left: explodeSrc[0], top: explodeSrc[1], width: 0, height: 0};}
+with(this.domNode.style){display="";zIndex = this.beginZIndex + this.popupIndex;}
+if(around){this.move(node, padding, aroundOrient);}else{this.move(x, y, padding, orient);}
+this.domNode.style.display="none";this.explodeSrc = explodeSrc;this.show();this.isShowingNow = true;},move: function(x, y, padding, orient){var around = (typeof x == "object");if(around){var aroundOrient=padding;var node=x;padding=y;if(!aroundOrient){aroundOrient = {'BL': 'TL', 'TL': 'BL'};}
+dojo.html.placeOnScreenAroundElement(this.domNode, node, padding, this.aroundBox, aroundOrient);}else{if(!orient){ orient = 'TL,TR,BL,BR';}
+dojo.html.placeOnScreen(this.domNode, x, y, padding, true, orient);}},close: function(force){if(force){this.domNode.style.display="none";}
+if(this.animationInProgress){this.queueOnAnimationFinish.push(this.close, []);return;}
+this.closeSubpopup(force);this.hide();if(this.bgIframe){this.bgIframe.hide();this.bgIframe.size({left: 0, top: 0, width: 0, height: 0});}
+if(this.isTopLevel){dojo.widget.PopupManager.closed(this);}
+this.isShowingNow = false;if(this.parent){setTimeout(
+dojo.lang.hitch(this,function(){try{if(this.parent['focus']){this.parent.focus();}else{this.parent.domNode.focus();}}catch(e){dojo.debug("No idea how to focus to parent", e);}}
+),10
+);}
+if(this._bookmark && dojo.withGlobal(this.openedForWindow||dojo.global(), dojo.html.selection.isCollapsed)){if(this.openedForWindow){this.openedForWindow.focus()
+}
+try{dojo.withGlobal(this.openedForWindow||dojo.global(), "moveToBookmark", dojo.html.selection, [this._bookmark]);}catch(e){}}
+this._bookmark = null;},closeAll: function(force){if (this.parentPopup){this.parentPopup.closeAll(force);}else{this.close(force);}},setOpenedSubpopup: function(popup) {this.currentSubpopup = popup;},closeSubpopup: function(force) {if(this.currentSubpopup == null){ return; }
+this.currentSubpopup.close(force);this.currentSubpopup = null;},onShow: function() {dojo.widget.PopupContainer.superclass.onShow.apply(this, arguments);this.openedSize={w: this.domNode.style.width, h: this.domNode.style.height};if(dojo.render.html.ie){if(!this.bgIframe){this.bgIframe = new dojo.html.BackgroundIframe();this.bgIframe.setZIndex(this.domNode);}
+this.bgIframe.size(this.domNode);this.bgIframe.show();}
+this.processQueue();},processQueue: function() {if (!this.queueOnAnimationFinish.length) return;var func = this.queueOnAnimationFinish.shift();var args = this.queueOnAnimationFinish.shift();func.apply(this, args);},onHide: function() {dojo.widget.HtmlWidget.prototype.onHide.call(this);if(this.openedSize){with(this.domNode.style){width=this.openedSize.w;height=this.openedSize.h;}}
+this.processQueue();}});dojo.widget.defineWidget(
+"dojo.widget.PopupContainer",[dojo.widget.HtmlWidget, dojo.widget.PopupContainerBase], {fillInTemplate: function(){this.applyPopupBasicStyle();dojo.widget.PopupContainer.superclass.fillInTemplate.apply(this, arguments);}});dojo.widget.PopupManager = new function(){this.currentMenu = null;this.currentButton = null;this.currentFocusMenu = null;this.focusNode = null;this.registeredWindows = [];this.registerWin = function(win){if(!win.__PopupManagerRegistered)
+{dojo.event.connect(win.document, 'onmousedown', this, 'onClick');dojo.event.connect(win, "onscroll", this, "onClick");dojo.event.connect(win.document, "onkey", this, 'onKey');win.__PopupManagerRegistered = true;this.registeredWindows.push(win);}};this.registerAllWindows = function(targetWindow){if(!targetWindow) {targetWindow = dojo.html.getDocumentWindow(window.top && window.top.document || window.document);}
+this.registerWin(targetWindow);for (var i = 0; i < targetWindow.frames.length; i++){try{var win = dojo.html.getDocumentWindow(targetWindow.frames[i].document);if(win){this.registerAllWindows(win);}}catch(e){  }}
+};this.unRegisterWin = function(win){if(win.__PopupManagerRegistered)
+{dojo.event.disconnect(win.document, 'onmousedown', this, 'onClick');dojo.event.disconnect(win, "onscroll", this, "onClick");dojo.event.disconnect(win.document, "onkey", this, 'onKey');win.__PopupManagerRegistered = false;}};this.unRegisterAllWindows = function(){for(var i=0;i<this.registeredWindows.length;++i){this.unRegisterWin(this.registeredWindows[i]);}
+this.registeredWindows = [];};dojo.addOnLoad(this, "registerAllWindows");dojo.addOnUnload(this, "unRegisterAllWindows");this.closed = function(menu){if (this.currentMenu == menu){this.currentMenu = null;this.currentButton = null;this.currentFocusMenu = null;}};this.opened = function(menu, button){if (menu == this.currentMenu){ return; }
+if (this.currentMenu){this.currentMenu.close();}
+this.currentMenu = menu;this.currentFocusMenu = menu;this.currentButton = button;};this.setFocusedMenu = function(menu){this.currentFocusMenu = menu;};this.onKey = function(e){if (!e.key) { return; }
+if(!this.currentMenu || !this.currentMenu.isShowingNow){ return; }
+var m = this.currentFocusMenu;while (m){if(m.processKey(e)){e.preventDefault();e.stopPropagation();break;}
+m = m.parentPopup;}},this.onClick = function(e){if (!this.currentMenu){ return; }
+var scrolloffset = dojo.html.getScroll().offset;var m = this.currentMenu;while (m){if(dojo.html.overElement(m.domNode, e) || dojo.html.isDescendantOf(e.target, m.domNode)){return;}
+m = m.currentSubpopup;}
+if (this.currentButton && dojo.html.overElement(this.currentButton, e)){return;}
+this.currentMenu.close();};}

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ProgressBar.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ProgressBar.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ProgressBar.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ProgressBar.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,21 @@
+
+dojo.provide("dojo.widget.ProgressBar");dojo.require("dojo.widget.*");dojo.require("dojo.event.*");dojo.require("dojo.dom");dojo.require("dojo.html.style");dojo.require("dojo.string.*");dojo.require("dojo.lfx.*");dojo.widget.defineWidget(
+"dojo.widget.ProgressBar",dojo.widget.HtmlWidget,{progressValue: 0,maxProgressValue: 100,width: 300,height: 30,frontPercentClass: "frontPercent",backPercentClass: "backPercent",frontBarClass: "frontBar",backBarClass: "backBar",hasText: false,isVertical: false,showOnlyIntegers: false,dataSource: "",pollInterval: 3000,duration: 1000,templatePath: dojo.uri.moduleUri("dojo", "widget/templates/ProgressBar.html"),templateCssPath: dojo.uri.moduleUri("dojo", "widget/templates/ProgressBar.css"),containerNode: null,internalProgress: null,_pixelUnitRatio: 0.0,_pixelPercentRatio: 0.0,_unitPercentRatio: 0.0,_unitPixelRatio: 0.0,_floatDimension: 0.0,_intDimension: 0,_progressPercentValue: "0%",_floatMaxProgressValue: 0.0,_dimension: "width",_pixelValue: 0,_oInterval: null,_animation: null,_animationStopped: true,_progressValueBak: false,_hasTextBak: false,fillInTemplate: function(args, frag){this.internalProgress.className = this.frontBarClass;this.containerNode.className = this.backBarCl
 ass;if (this.isVertical){this.internalProgress.style.bottom="0px";this.internalProgress.style.left="0px";this._dimension = "height";} else {this.internalProgress.style.top="0px";this.internalProgress.style.left="0px";this._dimension = "width";}
+this.frontPercentLabel.className = this.frontPercentClass;this.backPercentLabel.className = this.backPercentClass;this.progressValue = "" + this.progressValue;this.domNode.style.height = this.height + "px";this.domNode.style.width = this.width + "px";this._intDimension = parseInt("0" + eval("this." + this._dimension));this._floatDimension = parseFloat("0" + eval("this."+this._dimension));this._pixelPercentRatio = this._floatDimension/100;this.setMaxProgressValue(this.maxProgressValue, true);this.setProgressValue(dojo.string.trim(this.progressValue), true);dojo.debug("float dimension: " + this._floatDimension);dojo.debug("this._unitPixelRatio: " + this._unitPixelRatio);this.showText(this.hasText);},showText: function(visible){if (visible){this.backPercentLabel.style.display="block";this.frontPercentLabel.style.display="block";} else {this.backPercentLabel.style.display="none";this.frontPercentLabel.style.display="none";}
+this.hasText = visible;},postCreate: function(args, frag){this.render();},_backupValues: function(){this._progressValueBak = this.progressValue;this._hasTextBak = this.hasText;},_restoreValues: function(){this.setProgressValue(this._progressValueBak);this.showText(this._hasTextBak);},_setupAnimation: function(){var _self = this;dojo.debug("internalProgress width: " + this.internalProgress.style.width);this._animation = dojo.lfx.html.slideTo(this.internalProgress,{top: 0, left: parseInt(this.width)-parseInt(this.internalProgress.style.width)}, parseInt(this.duration), null,function(){var _backAnim = dojo.lfx.html.slideTo(_self.internalProgress,{ top: 0, left: 0 }, parseInt(_self.duration));dojo.event.connect(_backAnim, "onEnd", function(){if (!_self._animationStopped){_self._animation.play();}});if (!_self._animationStopped){_backAnim.play();}
+_backAnim = null;}
+);},getMaxProgressValue: function(){return this.maxProgressValue;},setMaxProgressValue: function(maxValue, noRender){if (!this._animationStopped){return;}
+this.maxProgressValue = maxValue;this._floatMaxProgressValue = parseFloat("0" + this.maxProgressValue);this._pixelUnitRatio = this._floatDimension/this.maxProgressValue;this._unitPercentRatio = this._floatMaxProgressValue/100;this._unitPixelRatio = this._floatMaxProgressValue/this._floatDimension;this.setProgressValue(this.progressValue, true);if (!noRender){this.render();}},setProgressValue: function(value, noRender){if (!this._animationStopped){return;}
+this._progressPercentValue = "0%";var _value=dojo.string.trim("" + value);var _floatValue = parseFloat("0" + _value);var _intValue = parseInt("0" + _value);var _pixelValue = 0;if (dojo.string.endsWith(_value, "%", false)){this._progressPercentValue = Math.min(_floatValue.toFixed(1), 100) + "%";_value = Math.min((_floatValue)*this._unitPercentRatio, this.maxProgressValue);_pixelValue = Math.min((_floatValue)*this._pixelPercentRatio, eval("this."+this._dimension));} else {this.progressValue = Math.min(_floatValue, this.maxProgressValue);this._progressPercentValue = Math.min((_floatValue/this._unitPercentRatio).toFixed(1), 100) + "%";_pixelValue = Math.min(_floatValue/this._unitPixelRatio, eval("this."+this._dimension));}
+this.progressValue = dojo.string.trim(_value);this._pixelValue = _pixelValue;if (!noRender){this.render();}},getProgressValue: function(){return this.progressValue;},getProgressPercentValue: function(){return this._progressPercentValue;},setDataSource: function(dataSource){this.dataSource = dataSource;},setPollInterval: function(pollInterval){this.pollInterval = pollInterval;},start: function(){var _showFunction = dojo.lang.hitch(this, this._showRemoteProgress);this._oInterval = setInterval(_showFunction, this.pollInterval);},startAnimation: function(){if (this._animationStopped) {this._backupValues();this.setProgressValue("10%");this._animationStopped = false;this._setupAnimation();this.showText(false);this.internalProgress.style.height="105%";this._animation.play();}},stopAnimation: function(){if (this._animation) {this._animationStopped = true;this._animation.stop();this.internalProgress.style.height="100%";this.internalProgress.style.left = "0px";this._restoreValues();th
 is._setLabelPosition();}},_showRemoteProgress: function(){var _self = this;if ( (this.getMaxProgressValue() == this.getProgressValue()) &&
+this._oInterval){clearInterval(this._oInterval);this._oInterval = null;this.setProgressValue("100%");return;}
+var bArgs = {url: _self.dataSource,method: "POST",mimetype: "text/json",error: function(type, errorObj){dojo.debug("[ProgressBar] showRemoteProgress error");},load: function(type, data, evt){_self.setProgressValue(
+(_self._oInterval ? data["progress"] : "100%")
+);}};dojo.io.bind(bArgs);},render: function(){this._setPercentLabel(dojo.string.trim(this._progressPercentValue));this._setPixelValue(this._pixelValue);this._setLabelPosition();},_setLabelPosition: function(){var _widthFront =
+dojo.html.getContentBox(this.frontPercentLabel).width;var _heightFront =
+dojo.html.getContentBox(this.frontPercentLabel).height;var _widthBack =
+dojo.html.getContentBox(this.backPercentLabel).width;var _heightBack =
+dojo.html.getContentBox(this.backPercentLabel).height;var _leftFront = (parseInt(this.width) - _widthFront)/2 + "px";var _bottomFront = (parseInt(this.height) - parseInt(_heightFront))/2 + "px";var _leftBack = (parseInt(this.width) - _widthBack)/2 + "px";var _bottomBack = (parseInt(this.height) - parseInt(_heightBack))/2 + "px";this.frontPercentLabel.style.left = _leftFront;this.backPercentLabel.style.left = _leftBack;this.frontPercentLabel.style.bottom = _bottomFront;this.backPercentLabel.style.bottom = _bottomBack;},_setPercentLabel: function(percentValue){dojo.dom.removeChildren(this.frontPercentLabel);dojo.dom.removeChildren(this.backPercentLabel);var _percentValue = this.showOnlyIntegers == false ?
+percentValue : parseInt(percentValue) + "%";this.frontPercentLabel.
+appendChild(document.createTextNode(_percentValue));this.backPercentLabel.
+appendChild(document.createTextNode(_percentValue));},_setPixelValue: function(value){eval("this.internalProgress.style." + this._dimension + " = " + value + " + 'px'");this.onChange();},onChange: function(){}});
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RadioGroup.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RadioGroup.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RadioGroup.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RadioGroup.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,17 @@
+
+dojo.provide("dojo.widget.RadioGroup");dojo.require("dojo.lang.common");dojo.require("dojo.event.browser");dojo.require("dojo.html.selection");dojo.require("dojo.widget.*");dojo.require("dojo.widget.HtmlWidget");dojo.widget.defineWidget(
+"dojo.widget.RadioGroup",dojo.widget.HtmlWidget,function(){this.selectedItem=null;this.items=[];this.selected=[];this.groupCssClass="radioGroup";this.selectedCssClass="selected";this.itemContentCssClass="itemContent";},{isContainer:false,templatePath: null,templateCssPath: null,postCreate:function(){this._parseStructure();dojo.html.addClass(this.domNode, this.groupCssClass);this._setupChildren();dojo.event.browser.addListener(this.domNode, "onclick", dojo.lang.hitch(this, "onSelect"));if (this.selectedItem){this._selectItem(this.selectedItem);}},_parseStructure: function() {if(this.domNode.tagName.toLowerCase() != "ul"
+&& this.domNode.tagName.toLowerCase() != "ol") {dojo.raise("RadioGroup: Expected ul or ol content.");return;}
+this.items=[];var nl=this.domNode.getElementsByTagName("li");for (var i=0; i<nl.length; i++){if(nl[i].parentNode==this.domNode){this.items.push(nl[i]);}}
+},add:function( node){if(node.parentNode!=this.domNode){this.domNode.appendChild(node);}
+this.items.push(node);this._setup(node);},remove:function( node){var idx=-1;for(var i=0; i<this.items.length; i++){if(this.items[i]==node){idx=i;break;}}
+if(idx<0) {return;}
+this.items.splice(idx,1);node.parentNode.removeChild(node);},clear:function(){for(var i=0; i<this.items.length; i++){this.domNode.removeChild(this.items[i]);}
+this.items=[];},clearSelections:function(){for(var i=0; i<this.items.length; i++){dojo.html.removeClass(this.items[i], this.selectedCssClass);}
+this.selectedItem=null;},_setup:function(node){var span = document.createElement("span");dojo.html.disableSelection(span);dojo.html.addClass(span, this.itemContentCssClass);dojo.dom.moveChildren(node, span);node.appendChild(span);if (this.selected.length > 0) {var uid = dojo.html.getAttribute(node, "id");if (uid && uid == this.selected){this.selectedItem = node;}}
+dojo.event.browser.addListener(node, "onclick", dojo.lang.hitch(this, "onItemSelect"));if (dojo.html.hasAttribute(node, "onitemselect")) {var tn = dojo.lang.nameAnonFunc(new Function(dojo.html.getAttribute(node, "onitemselect")),this);dojo.event.browser.addListener(node, "onclick", dojo.lang.hitch(this, tn));}},_setupChildren:function(){for (var i=0; i<this.items.length; i++){this._setup(this.items[i]);}},_selectItem:function(node, event, nofire){if(this.selectedItem){dojo.html.removeClass(this.selectedItem, this.selectedCssClass);}
+this.selectedItem = node;dojo.html.addClass(this.selectedItem, this.selectedCssClass);if (!dj_undef("currentTarget", event)){return;}
+if(!nofire){if(dojo.render.html.ie){this.selectedItem.fireEvent("onclick");}else{var e = document.createEvent("MouseEvents");e.initEvent("click", true, false);this.selectedItem.dispatchEvent(e);}}
+},getValue:function() {return this.selectedItem;},onSelect:function(e) {},onItemSelect:function(e) {if (!dj_undef("currentTarget", e)){this._selectItem(e.currentTarget, e);}}
+}
+);
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RealNumberTextbox.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RealNumberTextbox.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RealNumberTextbox.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RealNumberTextbox.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,9 @@
+
+dojo.provide("dojo.widget.RealNumberTextbox");dojo.require("dojo.widget.IntegerTextbox");dojo.require("dojo.validate.common");dojo.widget.defineWidget(
+"dojo.widget.RealNumberTextbox",dojo.widget.IntegerTextbox,{mixInProperties: function(localProperties, frag){dojo.widget.RealNumberTextbox.superclass.mixInProperties.apply(this, arguments);if (localProperties.places){this.flags.places = Number(localProperties.places);}
+if((localProperties.exponent == "true")||
+(localProperties.exponent == "always")){this.flags.exponent = true;}else if((localProperties.exponent == "false")||(localProperties.exponent == "never")){this.flags.exponent = false;}else{this.flags.exponent = [ true, false ];}
+if((localProperties.esigned == "true")||(localProperties.esigned == "always")){this.flags.eSigned = true;}else if((localProperties.esigned == "false")||(localProperties.esigned == "never")){this.flags.eSigned = false;}else{this.flags.eSigned = [ true, false ];}
+if(localProperties.min){this.flags.min = parseFloat(localProperties.min);}
+if(localProperties.max){this.flags.max = parseFloat(localProperties.max);}},isValid: function(){return dojo.validate.isRealNumber(this.textbox.value, this.flags);},isInRange: function(){return dojo.validate.isInRange(this.textbox.value, this.flags);}}
+);
\ No newline at end of file

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

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RegexpTextbox.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RegexpTextbox.js?view=auto&rev=498423
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RegexpTextbox.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RegexpTextbox.js Sun Jan 21 10:25:59 2007
@@ -0,0 +1,5 @@
+
+dojo.provide("dojo.widget.RegexpTextbox");dojo.require("dojo.widget.ValidationTextbox");dojo.widget.defineWidget(
+"dojo.widget.RegexpTextbox",dojo.widget.ValidationTextbox,{mixInProperties: function(localProperties, frag){dojo.widget.RegexpTextbox.superclass.mixInProperties.apply(this, arguments);if(localProperties.regexp){this.flags.regexp = localProperties.regexp;}
+if(localProperties.flags){this.flags.flags = localProperties.flags;}},isValid: function(){var regexp = new RegExp(this.flags.regexp, this.flags.flags);return regexp.test(this.textbox.value);}}
+);
\ No newline at end of file

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