You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2006/10/07 20:22:39 UTC
svn commit: r453979 [1/8] - in
/tapestry/tapestry4/trunk/tapestry-framework/src/js: dojo/ dojo/src/
dojo/src/collections/ dojo/src/data/ dojo/src/data/csv/ dojo/src/date/
dojo/src/debug/ dojo/src/event/ dojo/src/gfx/ dojo/src/html/ dojo/src/i18n/
dojo/...
Author: jkuhnert
Date: Sat Oct 7 11:22:33 2006
New Revision: 453979
URL: http://svn.apache.org/viewvc?view=rev&rev=453979
Log:
Updated dojo to fix TAPESTRY-1107
Added:
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/gfx/path.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/gfx/shape.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/logging/ConsoleLogger.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/__package__.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/Axis.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/Chart.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/Plot.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/PlotArea.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/Plotters.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/README.txt (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/Series.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/__package__.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/svg/
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/svg/PlotArea.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/svg/Plotters.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/vml/
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/vml/PlotArea.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/charting/engine/vml/Plotters.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate/CurrencyTextbox.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate/DateTextbox.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate/IntegerTextbox.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate/InternetTextbox.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate/RealNumberTextbox.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate/RegexpTextbox.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate/Textbox.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate/UsTextbox.js (with props)
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate/ValidationTextbox.js (with props)
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/build.txt
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/dojo.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/dojo.js.uncompressed.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/a11y.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/collections/Store.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/Read.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/Result.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/csv/Result.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date/common.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date/format.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date/serialize.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date/supplemental.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/debug/console.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/common.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/event/topic.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/gfx/common.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/gfx/svg.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/gfx/vml.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/hostenv_adobesvg.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/hostenv_browser.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/hostenv_rhino.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/hostenv_svg.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/html/metrics.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/html/util.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/i18n/common.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/io/BrowserIO.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/io/IframeIO.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/io/cometd.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/io/common.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/json.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/lfx/html.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/lfx/rounded.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/lfx/shadow.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/logging/Logger.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/namespaces/dojo.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/profile.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/regexp.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/svg.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/validate/check.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/validate/datetime.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/AccordionContainer.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/AnimatedPng.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Button.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Checkbox.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Clock.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ColorPalette.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ComboBox.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ContentPane.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DatePicker.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Dialog.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DomWidget.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownContainer.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownDatePicker.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/DropdownTimePicker.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/ContextMenu.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/SimpleSignalCommands.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Plugin/TableOperation.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Editor2Toolbar.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/FisheyeList.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/FloatingPane.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/FormContainer.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/InlineEditBox.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/LayoutContainer.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/LinkPane.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Menu2.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/PageContainer.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Parse.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/PopupContainer.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ProgressBar.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/RichText.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Select.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ShowSlide.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Slider.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Spinner.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TabContainer.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TaskBar.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Toolbar.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Tree.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeBasicController.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeContextMenu.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeLoadingController.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeNode.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeRPCController.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeSelector.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Widget.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/svg/Chart.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/templates/AccordionPane.css
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/templates/Checkbox.css
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/templates/Checkbox.html
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/templates/CheckboxA11y.html
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/templates/ComboBox.css
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/templates/ComboBox.html
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/templates/EditorToolbar.css
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/templates/ProgressBar.html
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/templates/check.gif
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/vml/Chart.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/XslTransform.js
tapestry/tapestry4/trunk/tapestry-framework/src/js/lib/ant-dojotest.jar
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/build.txt
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/build.txt?view=diff&rev=453979&r1=453978&r2=453979
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/build.txt (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/build.txt Sat Oct 7 11:22:33 2006
@@ -12,6 +12,7 @@
../src/lang/extras.js,
../src/lang/func.js,
../src/event/common.js,
-../src/event/browser.js
+../src/event/browser.js,
+../src/dom.js
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/dojo.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/dojo.js?view=diff&rev=453979&r1=453978&r2=453979
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/dojo.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/dojo.js Sat Oct 7 11:22:33 2006
@@ -1482,7 +1482,7 @@
};
dojo.provide("dojo.event.common");
dojo.event=new function(){
-this.canTimeout=dojo.lang.isFunction(dj_global["setTimeout"])||dojo.lang.isAlien(dj_global["setTimeout"]);
+this._canTimeout=dojo.lang.isFunction(dj_global["setTimeout"])||dojo.lang.isAlien(dj_global["setTimeout"]);
function interpolateArgs(args,_17c){
var dl=dojo.lang;
var ao={srcObj:dj_global,srcFunc:null,adviceObj:dj_global,adviceFunc:null,aroundObj:null,aroundFunc:null,adviceType:(args.length>2)?args[0]:"after",precedence:"last",once:false,delay:null,rate:0,adviceMsg:false};
@@ -1706,7 +1706,10 @@
var _194=dojo.lang.nameAnonFunc(_191.adviceFunc,_191.adviceObj,true);
_191.adviceFunc=_194;
}
-return dojo.event[fn]((_191["type"]||_191["adviceType"]||"after"),_191["srcObj"]||dj_global,_191["srcFunc"],_191["adviceObj"]||_191["targetObj"]||dj_global,_191["adviceFunc"]||_191["targetFunc"],_191["aroundObj"],_191["aroundFunc"],_191["once"],_191["delay"],_191["rate"],_191["adviceMsg"]||false);
+_191.srcObj=_191["srcObj"]||dj_global;
+_191.adviceObj=_191["adviceObj"]||_191["targetObj"]||dj_global;
+_191.adviceFunc=_191["adviceFunc"]||_191["targetFunc"];
+return dojo.event[fn](_191);
};
this.kwConnect=function(_195){
return this._kwConnectImpl(_195,false);
@@ -1759,9 +1762,6 @@
this.methodname=_1a1;
this.methodfunc=this.object[_1a1];
this.squelch=false;
-this.before=[];
-this.after=[];
-this.around=[];
};
dojo.event.MethodJoinPoint.getForMethod=function(obj,_1a3){
if(!obj){
@@ -1869,7 +1869,7 @@
var cur=new Date();
var _1bd=false;
if((marr["last"])&&((cur-marr.last)<=rate)){
-if(dojo.event.canTimeout){
+if(dojo.event._canTimeout){
if(marr["delayTimer"]){
clearTimeout(marr.delayTimer);
}
@@ -1917,12 +1917,12 @@
return _1b0.apply(this,arguments);
}
};
-if(this.before.length>0){
+if((this["before"])&&(this.before.length>0)){
dojo.lang.forEach(this.before.concat(new Array()),_1c0);
}
var _1c1;
try{
-if(this.around.length>0){
+if((this["around"])&&(this.around.length>0)){
var mi=new dojo.event.MethodInvocation(this,obj,args);
_1c1=mi.proceed();
}else{
@@ -1936,20 +1936,23 @@
dojo.raise(e);
}
}
-if(this.after.length>0){
+if((this["after"])&&(this.after.length>0)){
dojo.lang.forEach(this.after.concat(new Array()),_1c0);
}
return (this.methodfunc)?_1c1:null;
},getArr:function(kind){
-var arr=this.after;
+var type="after";
if((typeof kind=="string")&&(kind.indexOf("before")!=-1)){
-arr=this.before;
+type="before";
}else{
if(kind=="around"){
-arr=this.around;
+type="around";
+}
}
+if(!this[type]){
+this[type]=[];
}
-return arr;
+return this[type];
},kwAddAdvice:function(args){
this.addAdvice(args["adviceObj"],args["adviceFunc"],args["aroundObj"],args["aroundFunc"],args["adviceType"],args["precedence"],args["once"],args["delay"],args["rate"],args["adviceMsg"]);
},addAdvice:function(_1c6,_1c7,_1c8,_1c9,_1ca,_1cb,once,_1cd,rate,_1cf){
@@ -2385,5 +2388,356 @@
ev.stopPropagation();
}
};
+};
+dojo.provide("dojo.dom");
+dojo.dom.ELEMENT_NODE=1;
+dojo.dom.ATTRIBUTE_NODE=2;
+dojo.dom.TEXT_NODE=3;
+dojo.dom.CDATA_SECTION_NODE=4;
+dojo.dom.ENTITY_REFERENCE_NODE=5;
+dojo.dom.ENTITY_NODE=6;
+dojo.dom.PROCESSING_INSTRUCTION_NODE=7;
+dojo.dom.COMMENT_NODE=8;
+dojo.dom.DOCUMENT_NODE=9;
+dojo.dom.DOCUMENT_TYPE_NODE=10;
+dojo.dom.DOCUMENT_FRAGMENT_NODE=11;
+dojo.dom.NOTATION_NODE=12;
+dojo.dom.dojoml="http://www.dojotoolkit.org/2004/dojoml";
+dojo.dom.xmlns={svg:"http://www.w3.org/2000/svg",smil:"http://www.w3.org/2001/SMIL20/",mml:"http://www.w3.org/1998/Math/MathML",cml:"http://www.xml-cml.org",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml",xul:"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",xbl:"http://www.mozilla.org/xbl",fo:"http://www.w3.org/1999/XSL/Format",xsl:"http://www.w3.org/1999/XSL/Transform",xslt:"http://www.w3.org/1999/XSL/Transform",xi:"http://www.w3.org/2001/XInclude",xforms:"http://www.w3.org/2002/01/xforms",saxon:"http://icl.com/saxon",xalan:"http://xml.apache.org/xslt",xsd:"http://www.w3.org/2001/XMLSchema",dt:"http://www.w3.org/2001/XMLSchema-datatypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/",dcq:"http://purl.org/dc/qualifiers/1.0","soap-env":"http://schemas.xmlsoap.org/soap/envelope/",wsdl:"http://schemas.xmls
oap.org/wsdl/",AdobeExtensions:"http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"};
+dojo.dom.isNode=function(wh){
+if(typeof Element=="function"){
+try{
+return wh instanceof Element;
+}
+catch(E){
+}
+}else{
+return wh&&!isNaN(wh.nodeType);
+}
+};
+dojo.dom.getUniqueId=function(){
+var _20a=dojo.doc();
+do{
+var id="dj_unique_"+(++arguments.callee._idIncrement);
+}while(_20a.getElementById(id));
+return id;
+};
+dojo.dom.getUniqueId._idIncrement=0;
+dojo.dom.firstElement=dojo.dom.getFirstChildElement=function(_20c,_20d){
+var node=_20c.firstChild;
+while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE){
+node=node.nextSibling;
+}
+if(_20d&&node&&node.tagName&&node.tagName.toLowerCase()!=_20d.toLowerCase()){
+node=dojo.dom.nextElement(node,_20d);
+}
+return node;
+};
+dojo.dom.lastElement=dojo.dom.getLastChildElement=function(_20f,_210){
+var node=_20f.lastChild;
+while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE){
+node=node.previousSibling;
+}
+if(_210&&node&&node.tagName&&node.tagName.toLowerCase()!=_210.toLowerCase()){
+node=dojo.dom.prevElement(node,_210);
+}
+return node;
+};
+dojo.dom.nextElement=dojo.dom.getNextSiblingElement=function(node,_213){
+if(!node){
+return null;
+}
+do{
+node=node.nextSibling;
+}while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE);
+if(node&&_213&&_213.toLowerCase()!=node.tagName.toLowerCase()){
+return dojo.dom.nextElement(node,_213);
+}
+return node;
+};
+dojo.dom.prevElement=dojo.dom.getPreviousSiblingElement=function(node,_215){
+if(!node){
+return null;
+}
+if(_215){
+_215=_215.toLowerCase();
+}
+do{
+node=node.previousSibling;
+}while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE);
+if(node&&_215&&_215.toLowerCase()!=node.tagName.toLowerCase()){
+return dojo.dom.prevElement(node,_215);
+}
+return node;
+};
+dojo.dom.moveChildren=function(_216,_217,trim){
+var _219=0;
+if(trim){
+while(_216.hasChildNodes()&&_216.firstChild.nodeType==dojo.dom.TEXT_NODE){
+_216.removeChild(_216.firstChild);
+}
+while(_216.hasChildNodes()&&_216.lastChild.nodeType==dojo.dom.TEXT_NODE){
+_216.removeChild(_216.lastChild);
+}
+}
+while(_216.hasChildNodes()){
+_217.appendChild(_216.firstChild);
+_219++;
+}
+return _219;
+};
+dojo.dom.copyChildren=function(_21a,_21b,trim){
+var _21d=_21a.cloneNode(true);
+return this.moveChildren(_21d,_21b,trim);
+};
+dojo.dom.removeChildren=function(node){
+var _21f=node.childNodes.length;
+while(node.hasChildNodes()){
+node.removeChild(node.firstChild);
+}
+return _21f;
+};
+dojo.dom.replaceChildren=function(node,_221){
+dojo.dom.removeChildren(node);
+node.appendChild(_221);
+};
+dojo.dom.removeNode=function(node){
+if(node&&node.parentNode){
+return node.parentNode.removeChild(node);
+}
+};
+dojo.dom.getAncestors=function(node,_224,_225){
+var _226=[];
+var _227=(_224&&(_224 instanceof Function||typeof _224=="function"));
+while(node){
+if(!_227||_224(node)){
+_226.push(node);
+}
+if(_225&&_226.length>0){
+return _226[0];
+}
+node=node.parentNode;
+}
+if(_225){
+return null;
+}
+return _226;
+};
+dojo.dom.getAncestorsByTag=function(node,tag,_22a){
+tag=tag.toLowerCase();
+return dojo.dom.getAncestors(node,function(el){
+return ((el.tagName)&&(el.tagName.toLowerCase()==tag));
+},_22a);
+};
+dojo.dom.getFirstAncestorByTag=function(node,tag){
+return dojo.dom.getAncestorsByTag(node,tag,true);
+};
+dojo.dom.isDescendantOf=function(node,_22f,_230){
+if(_230&&node){
+node=node.parentNode;
+}
+while(node){
+if(node==_22f){
+return true;
+}
+node=node.parentNode;
+}
+return false;
+};
+dojo.dom.innerXML=function(node){
+if(node.innerXML){
+return node.innerXML;
+}else{
+if(node.xml){
+return node.xml;
+}else{
+if(typeof XMLSerializer!="undefined"){
+return (new XMLSerializer()).serializeToString(node);
+}
+}
+}
+};
+dojo.dom.createDocument=function(){
+var doc=null;
+var _233=dojo.doc();
+if(!dj_undef("ActiveXObject")){
+var _234=["MSXML2","Microsoft","MSXML","MSXML3"];
+for(var i=0;i<_234.length;i++){
+try{
+doc=new ActiveXObject(_234[i]+".XMLDOM");
+}
+catch(e){
+}
+if(doc){
+break;
+}
+}
+}else{
+if((_233.implementation)&&(_233.implementation.createDocument)){
+doc=_233.implementation.createDocument("","",null);
+}
+}
+return doc;
+};
+dojo.dom.createDocumentFromText=function(str,_237){
+if(!_237){
+_237="text/xml";
+}
+if(!dj_undef("DOMParser")){
+var _238=new DOMParser();
+return _238.parseFromString(str,_237);
+}else{
+if(!dj_undef("ActiveXObject")){
+var _239=dojo.dom.createDocument();
+if(_239){
+_239.async=false;
+_239.loadXML(str);
+return _239;
+}else{
+dojo.debug("toXml didn't work?");
+}
+}else{
+var _23a=dojo.doc();
+if(_23a.createElement){
+var tmp=_23a.createElement("xml");
+tmp.innerHTML=str;
+if(_23a.implementation&&_23a.implementation.createDocument){
+var _23c=_23a.implementation.createDocument("foo","",null);
+for(var i=0;i<tmp.childNodes.length;i++){
+_23c.importNode(tmp.childNodes.item(i),true);
+}
+return _23c;
+}
+return ((tmp.document)&&(tmp.document.firstChild?tmp.document.firstChild:tmp));
+}
+}
+}
+return null;
+};
+dojo.dom.prependChild=function(node,_23f){
+if(_23f.firstChild){
+_23f.insertBefore(node,_23f.firstChild);
+}else{
+_23f.appendChild(node);
+}
+return true;
+};
+dojo.dom.insertBefore=function(node,ref,_242){
+if(_242!=true&&(node===ref||node.nextSibling===ref)){
+return false;
+}
+var _243=ref.parentNode;
+_243.insertBefore(node,ref);
+return true;
+};
+dojo.dom.insertAfter=function(node,ref,_246){
+var pn=ref.parentNode;
+if(ref==pn.lastChild){
+if((_246!=true)&&(node===ref)){
+return false;
+}
+pn.appendChild(node);
+}else{
+return this.insertBefore(node,ref.nextSibling,_246);
+}
+return true;
+};
+dojo.dom.insertAtPosition=function(node,ref,_24a){
+if((!node)||(!ref)||(!_24a)){
+return false;
+}
+switch(_24a.toLowerCase()){
+case "before":
+return dojo.dom.insertBefore(node,ref);
+case "after":
+return dojo.dom.insertAfter(node,ref);
+case "first":
+if(ref.firstChild){
+return dojo.dom.insertBefore(node,ref.firstChild);
+}else{
+ref.appendChild(node);
+return true;
+}
+break;
+default:
+ref.appendChild(node);
+return true;
+}
+};
+dojo.dom.insertAtIndex=function(node,_24c,_24d){
+var _24e=_24c.childNodes;
+if(!_24e.length){
+_24c.appendChild(node);
+return true;
+}
+var _24f=null;
+for(var i=0;i<_24e.length;i++){
+var _251=_24e.item(i)["getAttribute"]?parseInt(_24e.item(i).getAttribute("dojoinsertionindex")):-1;
+if(_251<_24d){
+_24f=_24e.item(i);
+}
+}
+if(_24f){
+return dojo.dom.insertAfter(node,_24f);
+}else{
+return dojo.dom.insertBefore(node,_24e.item(0));
+}
+};
+dojo.dom.textContent=function(node,text){
+if(arguments.length>1){
+var _254=dojo.doc();
+dojo.dom.replaceChildren(node,_254.createTextNode(text));
+return text;
+}else{
+if(node.textContent!=undefined){
+return node.textContent;
+}
+var _255="";
+if(node==null){
+return _255;
+}
+for(var i=0;i<node.childNodes.length;i++){
+switch(node.childNodes[i].nodeType){
+case 1:
+case 5:
+_255+=dojo.dom.textContent(node.childNodes[i]);
+break;
+case 3:
+case 2:
+case 4:
+_255+=node.childNodes[i].nodeValue;
+break;
+default:
+break;
+}
+}
+return _255;
+}
+};
+dojo.dom.hasParent=function(node){
+return node&&node.parentNode&&dojo.dom.isNode(node.parentNode);
+};
+dojo.dom.isTag=function(node){
+if(node&&node.tagName){
+for(var i=1;i<arguments.length;i++){
+if(node.tagName==String(arguments[i])){
+return String(arguments[i]);
+}
+}
+}
+return "";
+};
+dojo.dom.setAttributeNS=function(elem,_25b,_25c,_25d){
+if(elem==null||((elem==undefined)&&(typeof elem=="undefined"))){
+dojo.raise("No element given to dojo.dom.setAttributeNS");
+}
+if(!((elem.setAttributeNS==undefined)&&(typeof elem.setAttributeNS=="undefined"))){
+elem.setAttributeNS(_25b,_25c,_25d);
+}else{
+var _25e=elem.ownerDocument;
+var _25f=_25e.createNode(2,_25c,_25b);
+_25f.nodeValue=_25d;
+elem.setAttributeNode(_25f);
+}
};
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/dojo.js.uncompressed.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/dojo.js.uncompressed.js?view=diff&rev=453979&r1=453978&r2=453979
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/dojo.js.uncompressed.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/dojo.js.uncompressed.js Sat Oct 7 11:22:33 2006
@@ -1365,7 +1365,7 @@
if(dojo.evalObjPath("dojo.widget.Parse")){
// we must do this on a delay to avoid:
// http://www.shaftek.org/blog/archives/000212.html
- // IE is such a tremendous peice of shit.
+ // (IE bug)
var parser = new dojo.xml.Parse();
if(sids.length > 0){
for(var x=0; x<sids.length; x++){
@@ -2223,7 +2223,7 @@
// TODO: more resiliency for 4+ arguments to connect()
dojo.event = new function(){
- this.canTimeout = dojo.lang.isFunction(dj_global["setTimeout"])||dojo.lang.isAlien(dj_global["setTimeout"]);
+ this._canTimeout = dojo.lang.isFunction(dj_global["setTimeout"])||dojo.lang.isAlien(dj_global["setTimeout"]);
// FIXME: where should we put this method (not here!)?
function interpolateArgs(args, searchForNames){
@@ -2374,10 +2374,104 @@
return ao;
}
- this.connect = function(){
+ this.connect = function(/*...*/){
// summary:
- // dojo.event.connect is the glue that holds most Dojo-based
- // applications together.
+ // dojo.event.connect is the glue that holds most Dojo-based
+ // applications together. Most combinations of arguments are
+ // supported, with the connect() method attempting to disambiguate
+ // the implied types of positional parameters. The following will
+ // all work:
+ // dojo.event.connect("globalFunctionName1", "globalFunctionName2");
+ // dojo.event.connect(functionReference1, functionReference2);
+ // dojo.event.connect("globalFunctionName1", functionReference2);
+ // dojo.event.connect(functionReference1, "globalFunctionName2");
+ // dojo.event.connect(scope1, "functionName1", "globalFunctionName2");
+ // dojo.event.connect("globalFunctionName1", scope2, "functionName2");
+ // dojo.event.connect(scope1, "functionName1", scope2, "functionName2");
+ // dojo.event.connect("after", scope1, "functionName1", scope2, "functionName2");
+ // dojo.event.connect("before", scope1, "functionName1", scope2, "functionName2");
+ // dojo.event.connect("around", scope1, "functionName1",
+ // scope2, "functionName2",
+ // aroundFunctionReference);
+ // dojo.event.connect("around", scope1, "functionName1",
+ // scope2, "functionName2",
+ // scope3, "aroundFunctionName");
+ // dojo.event.connect("before-around", scope1, "functionName1",
+ // scope2, "functionName2",
+ // aroundFunctionReference);
+ // dojo.event.connect("after-around", scope1, "functionName1",
+ // scope2, "functionName2",
+ // aroundFunctionReference);
+ // dojo.event.connect("after-around", scope1, "functionName1",
+ // scope2, "functionName2",
+ // scope3, "aroundFunctionName");
+ // dojo.event.connect("around", scope1, "functionName1",
+ // scope2, "functionName2",
+ // scope3, "aroundFunctionName", true, 30);
+ // dojo.event.connect("around", scope1, "functionName1",
+ // scope2, "functionName2",
+ // scope3, "aroundFunctionName", null, null, 10);
+ // adviceType:
+ // Optional. String. One of "before", "after", "around",
+ // "before-around", or "after-around". FIXME
+ // srcObj:
+ // the scope in which to locate/execute the named srcFunc. Along
+ // with srcFunc, this creates a way to dereference the function to
+ // call. So if the function in question is "foo.bar", the
+ // srcObj/srcFunc pair would be foo and "bar", where "bar" is a
+ // string and foo is an object reference.
+ // srcFunc:
+ // the name of the function to connect to. When it is executed,
+ // the listener being registered with this call will be called.
+ // The adviceType defines the call order between the source and
+ // the target functions.
+ // adviceObj:
+ // the scope in which to locate/execute the named adviceFunc.
+ // adviceFunc:
+ // the name of the function being conected to srcObj.srcFunc
+ // aroundObj:
+ // the scope in which to locate/execute the named aroundFunc.
+ // aroundFunc:
+ // the name of, or a reference to, the function that will be used
+ // to mediate the advice call. Around advice requires a special
+ // unary function that will be passed a "MethodInvocation" object.
+ // These objects have several important properties, namely:
+ // - args
+ // a mutable array of arguments to be passed into the
+ // wrapped function
+ // - proceed
+ // a function that "continues" the invocation. The result
+ // of this function is the return of the wrapped function.
+ // You can then manipulate this return before passing it
+ // back out (or take further action based on it).
+ // once:
+ // boolean that determines whether or not this connect() will
+ // create a new connection if an identical connect() has already
+ // been made. Defaults to "false".
+ // delay:
+ // an optional delay (in ms), as an integer, for dispatch of a
+ // listener after the source has been fired.
+ // rate:
+ // an optional rate throttling parameter (integer, in ms). When
+ // specified, this particular connection will not fire more than
+ // once in the interval specified by the rate
+ // adviceMsg:
+ // boolean. Should the listener have all the parameters passed in
+ // as a single argument?
+
+ /*
+ ao.adviceType = args[0];
+ ao.srcObj = args[1];
+ ao.srcFunc = args[2];
+ ao.adviceObj = args[3]
+ ao.adviceFunc = args[4];
+ ao.aroundObj = args[5];
+ ao.aroundFunc = args[6];
+ ao.once = args[7];
+ ao.delay = args[8];
+ ao.rate = args[9];
+ ao.adviceMsg = args[10];
+ */
if(arguments.length == 1){
var ao = arguments[0];
}else{
@@ -2391,6 +2485,7 @@
ao.srcFunc = "onkeypress";
}
+
if(dojo.lang.isArray(ao.srcObj) && ao.srcObj!=""){
var tmpAO = {};
for(var x in ao){
@@ -2418,11 +2513,21 @@
mjp.kwAddAdvice(ao);
- return mjp; // advanced users might want to fsck w/ the join point
- // manually
+ // advanced users might want to fsck w/ the join point manually
+ return mjp; // a MethodJoinPoint object
}
- this.log = function(a1, a2){
+ this.log = function(/*object or funcName*/ a1, /*funcName*/ a2){
+ // summary:
+ // a function that will wrap and log all calls to the specified
+ // a1.a2() function. If only a1 is passed, it'll be used as a
+ // function or function name on the global context. Logging will
+ // be sent to dojo.debug
+ // a1:
+ // if a2 is passed, this should be an object. If not, it can be a
+ // function or function name.
+ // a2:
+ // a function name
var kwArgs;
if((arguments.length == 1)&&(typeof a1 == "object")){
kwArgs = a1;
@@ -2443,21 +2548,30 @@
}
this.connectBefore = function(){
+ // summary:
+ // takes the same parameters as dojo.event.connect(), except that
+ // the advice type will always be "before"
var args = ["before"];
for(var i = 0; i < arguments.length; i++){ args.push(arguments[i]); }
- return this.connect.apply(this, args);
+ return this.connect.apply(this, args); // a MethodJoinPoint object
}
this.connectAround = function(){
+ // summary:
+ // takes the same parameters as dojo.event.connect(), except that
+ // the advice type will always be "around"
var args = ["around"];
for(var i = 0; i < arguments.length; i++){ args.push(arguments[i]); }
- return this.connect.apply(this, args);
+ return this.connect.apply(this, args); // a MethodJoinPoint object
}
this.connectOnce = function(){
+ // summary:
+ // takes the same parameters as dojo.event.connect(), except that
+ // the "once" flag will always be set to "true"
var ao = interpolateArgs(arguments, true);
ao.once = true;
- return this.connect(ao);
+ return this.connect(ao); // a MethodJoinPoint object
}
this._kwConnectImpl = function(kwArgs, disconnect){
@@ -2472,25 +2586,46 @@
var tmpName = dojo.lang.nameAnonFunc(kwArgs.adviceFunc, kwArgs.adviceObj, true);
kwArgs.adviceFunc = tmpName;
}
- return dojo.event[fn]( (kwArgs["type"]||kwArgs["adviceType"]||"after"),
- kwArgs["srcObj"]||dj_global,
- kwArgs["srcFunc"],
- kwArgs["adviceObj"]||kwArgs["targetObj"]||dj_global,
- kwArgs["adviceFunc"]||kwArgs["targetFunc"],
- kwArgs["aroundObj"],
- kwArgs["aroundFunc"],
- kwArgs["once"],
- kwArgs["delay"],
- kwArgs["rate"],
- kwArgs["adviceMsg"]||false );
+ kwArgs.srcObj = kwArgs["srcObj"]||dj_global;
+ kwArgs.adviceObj = kwArgs["adviceObj"]||kwArgs["targetObj"]||dj_global;
+ kwArgs.adviceFunc = kwArgs["adviceFunc"]||kwArgs["targetFunc"];
+ // pass kwargs to avoid unrolling/repacking
+ return dojo.event[fn](kwArgs);
}
- this.kwConnect = function(kwArgs){
- return this._kwConnectImpl(kwArgs, false);
+ this.kwConnect = function(/*Object*/ kwArgs){
+ // summary:
+ // A version of dojo.event.connect() that takes a map of named
+ // parameters instead of the positional parameters that
+ // dojo.event.connect() uses. For many advanced connection types,
+ // this can be a much more readable (and potentially faster)
+ // alternative.
+ // kwArgs:
+ // An object that can have the following properties:
+ // - adviceType
+ // - srcObj
+ // - srcFunc
+ // - adviceObj
+ // - adviceFunc
+ // - aroundObj
+ // - aroundFunc
+ // - once
+ // - delay
+ // - rate
+ // - adviceMsg
+ // As with connect, only srcFunc and adviceFunc are generally
+ // required
+
+ return this._kwConnectImpl(kwArgs, false); // a MethodJoinPoint object
}
this.disconnect = function(){
+ // summary:
+ // Takes the same parameters as dojo.event.connect() but destroys
+ // an existing connection instead of building a new one. For
+ // multiple identical connections, multiple disconnect() calls
+ // will unroll one each time it's called.
if(arguments.length == 1){
var ao = arguments[0];
}else{
@@ -2505,20 +2640,36 @@
ao.srcFunc = "onkeypress";
}
var mjp = dojo.event.MethodJoinPoint.getForMethod(ao.srcObj, ao.srcFunc);
- return mjp.removeAdvice(ao.adviceObj, ao.adviceFunc, ao.adviceType, ao.once);
+ return mjp.removeAdvice(ao.adviceObj, ao.adviceFunc, ao.adviceType, ao.once); // a MethodJoinPoint object
}
this.kwDisconnect = function(kwArgs){
+ // summary:
+ // Takes the same parameters as dojo.event.kwConnect() but
+ // destroys an existing connection instead of building a new one.
return this._kwConnectImpl(kwArgs, true);
}
}
// exactly one of these is created whenever a method with a joint point is run,
// if there is at least one 'around' advice.
-dojo.event.MethodInvocation = function(join_point, obj, args){
+dojo.event.MethodInvocation = function(/*dojo.event.MethodJoinPoint*/join_point, /*Object*/obj, /*Array*/args){
+ // summary:
+ // a class the models the call into a function. This is used under the
+ // covers for all method invocations on both ends of a
+ // connect()-wrapped function dispatch. This allows us to "pickle"
+ // calls, such as in the case of around advice.
+ // join_point:
+ // a dojo.event.MethodJoinPoint object that represents a connection
+ // obj:
+ // the scope the call will execute in
+ // args:
+ // an array of parameters that will get passed to the callee
this.jp_ = join_point;
this.object = obj;
this.args = [];
+ // make sure we don't lock into a mutable object which can change under us.
+ // It's ok if the individual items change, though.
for(var x=0; x<args.length; x++){
this.args[x] = args[x];
}
@@ -2527,6 +2678,9 @@
}
dojo.event.MethodInvocation.prototype.proceed = function(){
+ // summary:
+ // proceed with the method call that's represented by this invocation
+ // object
this.around_index++;
if(this.around_index >= this.jp_.around.length){
return this.jp_.object[this.jp_.methodname].apply(this.jp_.object, this.args);
@@ -2540,32 +2694,39 @@
}
-dojo.event.MethodJoinPoint = function(obj, methname){
+dojo.event.MethodJoinPoint = function(/*Object*/obj, /*String*/funcName){
this.object = obj||dj_global;
- this.methodname = methname;
- this.methodfunc = this.object[methname];
+ this.methodname = funcName;
+ this.methodfunc = this.object[funcName];
this.squelch = false;
- this.before = [];
- this.after = [];
- this.around = [];
+ // this.before = [];
+ // this.after = [];
+ // this.around = [];
}
-dojo.event.MethodJoinPoint.getForMethod = function(obj, methname){
- // if(!(methname in obj)){
+dojo.event.MethodJoinPoint.getForMethod = function(/*Object*/obj, /*String*/funcName){
+ // summary:
+ // "static" class function for returning a MethodJoinPoint from a
+ // scoped function. If one doesn't exist, one is created.
+ // obj:
+ // the scope to search for the function in
+ // funcName:
+ // the name of the function to return a MethodJoinPoint for
if(!obj){ obj = dj_global; }
- if(!obj[methname]){
+ if(!obj[funcName]){
// supply a do-nothing method implementation
- obj[methname] = function(){};
- if(!obj[methname]){
+ obj[funcName] = function(){};
+ if(!obj[funcName]){
// e.g. cannot add to inbuilt objects in IE6
- dojo.raise("Cannot set do-nothing method on that object "+methname);
+ dojo.raise("Cannot set do-nothing method on that object "+funcName);
}
- }else if((!dojo.lang.isFunction(obj[methname]))&&(!dojo.lang.isAlien(obj[methname]))){
- return null; // FIXME: should we throw an exception here instead?
- }
- // we hide our joinpoint instance in obj[methname + '$joinpoint']
- var jpname = methname + "$joinpoint";
- var jpfuncname = methname + "$joinpoint$method";
+ }else if((!dojo.lang.isFunction(obj[funcName]))&&(!dojo.lang.isAlien(obj[funcName]))){
+ // FIXME: should we throw an exception here instead?
+ return null;
+ }
+ // we hide our joinpoint instance in obj[funcName + '$joinpoint']
+ var jpname = funcName + "$joinpoint";
+ var jpfuncname = funcName + "$joinpoint$method";
var joinpoint = obj[jpname];
if(!joinpoint){
var isNode = false;
@@ -2574,14 +2735,14 @@
(obj["nodeType"])||
(obj["addEventListener"]) ){
isNode = true;
- dojo.event.browser.addClobberNodeAttrs(obj, [jpname, jpfuncname, methname]);
+ dojo.event.browser.addClobberNodeAttrs(obj, [jpname, jpfuncname, funcName]);
}
}
- var origArity = obj[methname].length;
- obj[jpfuncname] = obj[methname];
- // joinpoint = obj[jpname] = new dojo.event.MethodJoinPoint(obj, methname);
+ var origArity = obj[funcName].length;
+ obj[jpfuncname] = obj[funcName];
+ // joinpoint = obj[jpname] = new dojo.event.MethodJoinPoint(obj, funcName);
joinpoint = obj[jpname] = new dojo.event.MethodJoinPoint(obj, jpfuncname);
- obj[methname] = function(){
+ obj[funcName] = function(){
var args = [];
if((isNode)&&(!arguments.length)){
@@ -2615,13 +2776,16 @@
// return joinpoint.run.apply(joinpoint, arguments);
return joinpoint.run.apply(joinpoint, args);
}
- obj[methname].__preJoinArity = origArity;
+ obj[funcName].__preJoinArity = origArity;
}
- return joinpoint;
+ return joinpoint; // dojo.event.MethodJoinPoint
}
dojo.lang.extend(dojo.event.MethodJoinPoint, {
unintercept: function(){
+ // summary:
+ // destroy the connection to all listeners that may have been
+ // registered on this joinpoint
this.object[this.methodname] = this.methodfunc;
this.before = [];
this.after = [];
@@ -2631,6 +2795,10 @@
disconnect: dojo.lang.forward("unintercept"),
run: function(){
+ // summary:
+ // execute the connection represented by this join point. The
+ // arguments passed to run() will be passed to the function and
+ // its listeners.
var obj = this.object||dj_global;
var args = arguments;
@@ -2676,7 +2844,7 @@
var cur = new Date();
var timerSet = false;
if((marr["last"])&&((cur-marr.last)<=rate)){
- if(dojo.event.canTimeout){
+ if(dojo.event._canTimeout){
if(marr["delayTimer"]){
clearTimeout(marr.delayTimer);
}
@@ -2734,14 +2902,14 @@
}
}
- if(this.before.length>0){
+ if((this["before"])&&(this.before.length>0)){
// pass a cloned array, if this event disconnects this event forEach on this.before wont work
dojo.lang.forEach(this.before.concat(new Array()), unRollSquelch);
}
var result;
try{
- if(this.around.length>0){
+ if((this["around"])&&(this.around.length>0)){
var mi = new dojo.event.MethodInvocation(this, obj, args);
result = mi.proceed();
}else if(this.methodfunc){
@@ -2749,7 +2917,7 @@
}
}catch(e){ if(!this.squelch){ dojo.raise(e); } }
- if(this.after.length>0){
+ if((this["after"])&&(this.after.length>0)){
// see comment on this.before above
dojo.lang.forEach(this.after.concat(new Array()), unRollSquelch);
}
@@ -2757,18 +2925,23 @@
return (this.methodfunc) ? result : null;
},
- getArr: function(kind){
- var arr = this.after;
+ getArr: function(/*String*/kind){
+ // summary: return a list of listeners of the past "kind"
+ // kind:
+ // can be one of: "before", "after", "around", "before-around", or
+ // "after-around"
+ var type = "after";
// FIXME: we should be able to do this through props or Array.in()
if((typeof kind == "string")&&(kind.indexOf("before")!=-1)){
- arr = this.before;
+ type = "before";
}else if(kind=="around"){
- arr = this.around;
+ type = "around";
}
- return arr;
+ if(!this[type]){ this[type] = []; }
+ return this[type]; // Array
},
- kwAddAdvice: function(args){
+ kwAddAdvice: function(/*Object*/args){
this.addAdvice( args["adviceObj"], args["adviceFunc"],
args["aroundObj"], args["aroundFunc"],
args["adviceType"], args["precedence"],
@@ -3248,6 +3421,519 @@
ev.preventDefault();
ev.stopPropagation();
}
+ }
+}
+
+dojo.provide("dojo.dom");
+
+dojo.dom.ELEMENT_NODE = 1;
+dojo.dom.ATTRIBUTE_NODE = 2;
+dojo.dom.TEXT_NODE = 3;
+dojo.dom.CDATA_SECTION_NODE = 4;
+dojo.dom.ENTITY_REFERENCE_NODE = 5;
+dojo.dom.ENTITY_NODE = 6;
+dojo.dom.PROCESSING_INSTRUCTION_NODE = 7;
+dojo.dom.COMMENT_NODE = 8;
+dojo.dom.DOCUMENT_NODE = 9;
+dojo.dom.DOCUMENT_TYPE_NODE = 10;
+dojo.dom.DOCUMENT_FRAGMENT_NODE = 11;
+dojo.dom.NOTATION_NODE = 12;
+
+dojo.dom.dojoml = "http://www.dojotoolkit.org/2004/dojoml";
+
+/**
+ * comprehensive list of XML namespaces
+**/
+dojo.dom.xmlns = {
+ // summary
+ // aliases for various common XML namespaces
+ svg : "http://www.w3.org/2000/svg",
+ smil : "http://www.w3.org/2001/SMIL20/",
+ mml : "http://www.w3.org/1998/Math/MathML",
+ cml : "http://www.xml-cml.org",
+ xlink : "http://www.w3.org/1999/xlink",
+ xhtml : "http://www.w3.org/1999/xhtml",
+ xul : "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
+ xbl : "http://www.mozilla.org/xbl",
+ fo : "http://www.w3.org/1999/XSL/Format",
+ xsl : "http://www.w3.org/1999/XSL/Transform",
+ xslt : "http://www.w3.org/1999/XSL/Transform",
+ xi : "http://www.w3.org/2001/XInclude",
+ xforms : "http://www.w3.org/2002/01/xforms",
+ saxon : "http://icl.com/saxon",
+ xalan : "http://xml.apache.org/xslt",
+ xsd : "http://www.w3.org/2001/XMLSchema",
+ dt: "http://www.w3.org/2001/XMLSchema-datatypes",
+ xsi : "http://www.w3.org/2001/XMLSchema-instance",
+ rdf : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+ rdfs : "http://www.w3.org/2000/01/rdf-schema#",
+ dc : "http://purl.org/dc/elements/1.1/",
+ dcq: "http://purl.org/dc/qualifiers/1.0",
+ "soap-env" : "http://schemas.xmlsoap.org/soap/envelope/",
+ wsdl : "http://schemas.xmlsoap.org/wsdl/",
+ AdobeExtensions : "http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+};
+
+dojo.dom.isNode = function(/* object */wh){
+ // summary
+ // checks to see if wh is actually a node.
+ if(typeof Element == "function") {
+ try {
+ return wh instanceof Element; // boolean
+ } catch(E) {}
+ } else {
+ // best-guess
+ return wh && !isNaN(wh.nodeType); // boolean
+ }
+}
+
+dojo.dom.getUniqueId = function(){
+ // summary
+ // returns a unique string for use with any DOM element
+ var _document = dojo.doc();
+ do {
+ var id = "dj_unique_" + (++arguments.callee._idIncrement);
+ }while(_document.getElementById(id));
+ return id; // string
+}
+dojo.dom.getUniqueId._idIncrement = 0;
+
+dojo.dom.firstElement = dojo.dom.getFirstChildElement = function(/* Element */parentNode, /* string? */tagName){
+ // summary
+ // returns the first child element matching tagName
+ var node = parentNode.firstChild;
+ while(node && node.nodeType != dojo.dom.ELEMENT_NODE){
+ node = node.nextSibling;
+ }
+ if(tagName && node && node.tagName && node.tagName.toLowerCase() != tagName.toLowerCase()) {
+ node = dojo.dom.nextElement(node, tagName);
+ }
+ return node; // Element
+}
+
+dojo.dom.lastElement = dojo.dom.getLastChildElement = function(/* Element */parentNode, /* string? */tagName){
+ // summary
+ // returns the last child element matching tagName
+ var node = parentNode.lastChild;
+ while(node && node.nodeType != dojo.dom.ELEMENT_NODE) {
+ node = node.previousSibling;
+ }
+ if(tagName && node && node.tagName && node.tagName.toLowerCase() != tagName.toLowerCase()) {
+ node = dojo.dom.prevElement(node, tagName);
+ }
+ return node; // Element
+}
+
+dojo.dom.nextElement = dojo.dom.getNextSiblingElement = function(/* Node */node, /* string? */tagName){
+ // summary
+ // returns the next sibling element matching tagName
+ if(!node) { return null; }
+ do {
+ node = node.nextSibling;
+ } while(node && node.nodeType != dojo.dom.ELEMENT_NODE);
+
+ if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {
+ return dojo.dom.nextElement(node, tagName);
+ }
+ return node; // Element
+}
+
+dojo.dom.prevElement = dojo.dom.getPreviousSiblingElement = function(/* Node */node, /* string? */tagName){
+ // summary
+ // returns the previous sibling element matching tagName
+ if(!node) { return null; }
+ if(tagName) { tagName = tagName.toLowerCase(); }
+ do {
+ node = node.previousSibling;
+ } while(node && node.nodeType != dojo.dom.ELEMENT_NODE);
+
+ if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {
+ return dojo.dom.prevElement(node, tagName);
+ }
+ return node; // Element
+}
+
+// TODO: hmph
+/*this.forEachChildTag = function(node, unaryFunc) {
+ var child = this.getFirstChildTag(node);
+ while(child) {
+ if(unaryFunc(child) == "break") { break; }
+ child = this.getNextSiblingTag(child);
+ }
+}*/
+
+dojo.dom.moveChildren = function(/* Element */srcNode, /* Element */destNode, /* boolean? */trim){
+ // summary
+ // Moves children from srcNode to destNode and returns the count of children moved;
+ // will trim off text nodes if trim == true
+ var count = 0;
+ if(trim) {
+ while(srcNode.hasChildNodes() &&
+ srcNode.firstChild.nodeType == dojo.dom.TEXT_NODE) {
+ srcNode.removeChild(srcNode.firstChild);
+ }
+ while(srcNode.hasChildNodes() &&
+ srcNode.lastChild.nodeType == dojo.dom.TEXT_NODE) {
+ srcNode.removeChild(srcNode.lastChild);
+ }
+ }
+ while(srcNode.hasChildNodes()){
+ destNode.appendChild(srcNode.firstChild);
+ count++;
+ }
+ return count; // number
+}
+
+dojo.dom.copyChildren = function(/* Element */srcNode, /* Element */destNode, /* boolean? */trim){
+ // summary
+ // Copies children from srcNde to destNode and returns the count of children copied;
+ // will trim off text nodes if trim == true
+ var clonedNode = srcNode.cloneNode(true);
+ return this.moveChildren(clonedNode, destNode, trim); // number
+}
+
+dojo.dom.removeChildren = function(/* Element */node){
+ // summary
+ // removes all children from node and returns the count of children removed.
+ var count = node.childNodes.length;
+ while(node.hasChildNodes()){ node.removeChild(node.firstChild); }
+ return count; // number
+}
+
+dojo.dom.replaceChildren = function(/* Element */node, /* Node */newChild){
+ // summary
+ // Removes all children of node and appends newChild
+ // FIXME: what if newChild is an array-like object?
+ dojo.dom.removeChildren(node);
+ node.appendChild(newChild);
+}
+
+dojo.dom.removeNode = function(/* Node */node){
+ // summary
+ // if node has a parent, removes node from parent and returns a reference to the removed child.
+ if(node && node.parentNode){
+ // return a ref to the removed child
+ return node.parentNode.removeChild(node); // Node
+ }
+}
+
+dojo.dom.getAncestors = function(/* Node */node, /* function? */filterFunction, /* boolean? */returnFirstHit) {
+ // summary
+ // returns all ancestors matching optional filterFunction; will return only the first if returnFirstHit
+ var ancestors = [];
+ var isFunction = (filterFunction && (filterFunction instanceof Function || typeof filterFunction == "function"));
+ while(node) {
+ if (!isFunction || filterFunction(node)) {
+ ancestors.push(node);
+ }
+ if (returnFirstHit && ancestors.length > 0) {
+ return ancestors[0]; // Node
+ }
+
+ node = node.parentNode;
+ }
+ if (returnFirstHit) { return null; }
+ return ancestors; // array
+}
+
+dojo.dom.getAncestorsByTag = function(/* Node */node, /* string */tag, /* boolean? */returnFirstHit) {
+ // summary
+ // returns all ancestors matching tag (as tagName), will only return first one if returnFirstHit
+ tag = tag.toLowerCase();
+ return dojo.dom.getAncestors(node, function(el){
+ return ((el.tagName)&&(el.tagName.toLowerCase() == tag));
+ }, returnFirstHit); // Node || array
+}
+
+dojo.dom.getFirstAncestorByTag = function(/* Node */node, /* string */tag) {
+ // summary
+ // Returns first ancestor of node with tag tagName
+ return dojo.dom.getAncestorsByTag(node, tag, true); // Node
+}
+
+dojo.dom.isDescendantOf = function(/* Node */node, /* Node */ancestor, /* boolean? */guaranteeDescendant){
+ // summary
+ // Returns boolean if node is a descendant of ancestor
+ // guaranteeDescendant allows us to be a "true" isDescendantOf function
+ if(guaranteeDescendant && node) { node = node.parentNode; }
+ while(node) {
+ if(node == ancestor){
+ return true; // boolean
+ }
+ node = node.parentNode;
+ }
+ return false; // boolean
+}
+
+dojo.dom.innerXML = function(/* Node */node){
+ // summary
+ // Implementation of MS's innerXML function.
+ if(node.innerXML){
+ return node.innerXML; // string
+ }else if (node.xml){
+ return node.xml; // string
+ }else if(typeof XMLSerializer != "undefined"){
+ return (new XMLSerializer()).serializeToString(node); // string
+ }
+}
+
+dojo.dom.createDocument = function(){
+ // summary
+ // cross-browser implementation of creating an XML document object.
+ var doc = null;
+ var _document = dojo.doc();
+
+ if(!dj_undef("ActiveXObject")){
+ var prefixes = [ "MSXML2", "Microsoft", "MSXML", "MSXML3" ];
+ for(var i = 0; i<prefixes.length; i++){
+ try{
+ doc = new ActiveXObject(prefixes[i]+".XMLDOM");
+ }catch(e){ /* squelch */ };
+
+ if(doc){ break; }
+ }
+ }else if((_document.implementation)&&
+ (_document.implementation.createDocument)){
+ doc = _document.implementation.createDocument("", "", null);
+ }
+
+ return doc; // DOMDocument
+}
+
+dojo.dom.createDocumentFromText = function(/* string */str, /* string? */mimetype){
+ // summary
+ // attempts to create a Document object based on optional mime-type, using str as the contents of the document
+ if(!mimetype){ mimetype = "text/xml"; }
+ if(!dj_undef("DOMParser")){
+ var parser = new DOMParser();
+ return parser.parseFromString(str, mimetype); // DOMDocument
+ }else if(!dj_undef("ActiveXObject")){
+ var domDoc = dojo.dom.createDocument();
+ if(domDoc){
+ domDoc.async = false;
+ domDoc.loadXML(str);
+ return domDoc; // DOMDocument
+ }else{
+ dojo.debug("toXml didn't work?");
+ }
+ /*
+ }else if((dojo.render.html.capable)&&(dojo.render.html.safari)){
+ // FIXME: this doesn't appear to work!
+ // from: http://web-graphics.com/mtarchive/001606.php
+ // var xml = '<?xml version="1.0"?>'+str;
+ var mtype = "text/xml";
+ var xml = '<?xml version="1.0"?>'+str;
+ var url = "data:"+mtype+";charset=utf-8,"+encodeURIComponent(xml);
+ var req = new XMLHttpRequest();
+ req.open("GET", url, false);
+ req.overrideMimeType(mtype);
+ req.send(null);
+ return req.responseXML;
+ */
+ }else{
+ var _document = dojo.doc();
+ if(_document.createElement){
+ // FIXME: this may change all tags to uppercase!
+ var tmp = _document.createElement("xml");
+ tmp.innerHTML = str;
+ if(_document.implementation && _document.implementation.createDocument) {
+ var xmlDoc = _document.implementation.createDocument("foo", "", null);
+ for(var i = 0; i < tmp.childNodes.length; i++) {
+ xmlDoc.importNode(tmp.childNodes.item(i), true);
+ }
+ return xmlDoc; // DOMDocument
+ }
+ // FIXME: probably not a good idea to have to return an HTML fragment
+ // FIXME: the tmp.doc.firstChild is as tested from IE, so it may not
+ // work that way across the board
+ return ((tmp.document)&&
+ (tmp.document.firstChild ? tmp.document.firstChild : tmp)); // DOMDocument
+ }
+ }
+ return null;
+}
+
+dojo.dom.prependChild = function(/* Element */node, /* Element */parent) {
+ // summary
+ // prepends node to parent's children nodes
+ if(parent.firstChild) {
+ parent.insertBefore(node, parent.firstChild);
+ } else {
+ parent.appendChild(node);
+ }
+ return true; // boolean
+}
+
+dojo.dom.insertBefore = function(/* Node */node, /* Node */ref, /* boolean? */force){
+ // summary
+ // Try to insert node before ref
+ if (force != true &&
+ (node === ref || node.nextSibling === ref)){ return false; }
+ var parent = ref.parentNode;
+ parent.insertBefore(node, ref);
+ return true; // boolean
+}
+
+dojo.dom.insertAfter = function(/* Node */node, /* Node */ref, /* boolean? */force){
+ // summary
+ // Try to insert node after ref
+ var pn = ref.parentNode;
+ if(ref == pn.lastChild){
+ if((force != true)&&(node === ref)){
+ return false; // boolean
+ }
+ pn.appendChild(node);
+ }else{
+ return this.insertBefore(node, ref.nextSibling, force); // boolean
+ }
+ return true; // boolean
+}
+
+dojo.dom.insertAtPosition = function(/* Node */node, /* Node */ref, /* string */position){
+ // summary
+ // attempt to insert node in relation to ref based on position
+ if((!node)||(!ref)||(!position)){
+ return false; // boolean
+ }
+ switch(position.toLowerCase()){
+ case "before":
+ return dojo.dom.insertBefore(node, ref); // boolean
+ case "after":
+ return dojo.dom.insertAfter(node, ref); // boolean
+ case "first":
+ if(ref.firstChild){
+ return dojo.dom.insertBefore(node, ref.firstChild); // boolean
+ }else{
+ ref.appendChild(node);
+ return true; // boolean
+ }
+ break;
+ default: // aka: last
+ ref.appendChild(node);
+ return true; // boolean
+ }
+}
+
+dojo.dom.insertAtIndex = function(/* Node */node, /* Element */containingNode, /* number */insertionIndex){
+ // summary
+ // insert node into child nodes nodelist of containingNode at insertionIndex.
+ var siblingNodes = containingNode.childNodes;
+
+ // if there aren't any kids yet, just add it to the beginning
+
+ if (!siblingNodes.length){
+ containingNode.appendChild(node);
+ return true; // boolean
+ }
+
+ // otherwise we need to walk the childNodes
+ // and find our spot
+
+ var after = null;
+
+ for(var i=0; i<siblingNodes.length; i++){
+
+ var sibling_index = siblingNodes.item(i)["getAttribute"] ? parseInt(siblingNodes.item(i).getAttribute("dojoinsertionindex")) : -1;
+
+ if (sibling_index < insertionIndex){
+ after = siblingNodes.item(i);
+ }
+ }
+
+ if (after){
+ // add it after the node in {after}
+
+ return dojo.dom.insertAfter(node, after); // boolean
+ }else{
+ // add it to the start
+
+ return dojo.dom.insertBefore(node, siblingNodes.item(0)); // boolean
+ }
+}
+
+dojo.dom.textContent = function(/* Node */node, /* string */text){
+ // summary
+ // implementation of the DOM Level 3 attribute; scan node for text
+ if (arguments.length>1) {
+ var _document = dojo.doc();
+ dojo.dom.replaceChildren(node, _document.createTextNode(text));
+ return text; // string
+ } else {
+ if(node.textContent != undefined){ //FF 1.5
+ return node.textContent; // string
+ }
+ var _result = "";
+ if (node == null) { return _result; }
+ for (var i = 0; i < node.childNodes.length; i++) {
+ switch (node.childNodes[i].nodeType) {
+ case 1: // ELEMENT_NODE
+ case 5: // ENTITY_REFERENCE_NODE
+ _result += dojo.dom.textContent(node.childNodes[i]);
+ break;
+ case 3: // TEXT_NODE
+ case 2: // ATTRIBUTE_NODE
+ case 4: // CDATA_SECTION_NODE
+ _result += node.childNodes[i].nodeValue;
+ break;
+ default:
+ break;
+ }
+ }
+ return _result; // string
+ }
+}
+
+dojo.dom.hasParent = function (/* Node */node) {
+ // summary
+ // returns whether or not node is a child of another node.
+ return node && node.parentNode && dojo.dom.isNode(node.parentNode); // boolean
+}
+
+/**
+ * Examples:
+ *
+ * myFooNode = <foo />
+ * isTag(myFooNode, "foo"); // returns "foo"
+ * isTag(myFooNode, "bar"); // returns ""
+ * isTag(myFooNode, "FOO"); // returns ""
+ * isTag(myFooNode, "hey", "foo", "bar"); // returns "foo"
+**/
+dojo.dom.isTag = function(/* Node */node /* ... */) {
+ // summary
+ // determines if node has any of the provided tag names and returns the tag name that matches, empty string otherwise.
+ if(node && node.tagName) {
+ for(var i=1; i<arguments.length; i++){
+ if(node.tagName==String(arguments[i])){
+ return String(arguments[i]); // string
+ }
+ }
+ }
+ return ""; // string
+}
+
+dojo.dom.setAttributeNS = function(/* Element */elem, /* string */namespaceURI, /* string */attrName, /* string */attrValue){
+ // summary
+ // implementation of DOM2 setAttributeNS that works cross browser.
+ if(elem == null || ((elem == undefined)&&(typeof elem == "undefined"))){
+ dojo.raise("No element given to dojo.dom.setAttributeNS");
+ }
+
+ if(!((elem.setAttributeNS == undefined)&&(typeof elem.setAttributeNS == "undefined"))){ // w3c
+ elem.setAttributeNS(namespaceURI, attrName, attrValue);
+ }else{ // IE
+ // get a root XML document
+ var ownerDoc = elem.ownerDocument;
+ var attribute = ownerDoc.createNode(
+ 2, // node type
+ attrName,
+ namespaceURI
+ );
+
+ // set value
+ attribute.nodeValue = attrValue;
+
+ // attach to element
+ elem.setAttributeNode(attribute);
}
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/a11y.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/a11y.js?view=diff&rev=453979&r1=453978&r2=453979
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/a11y.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/a11y.js Sat Oct 7 11:22:33 2006
@@ -14,15 +14,23 @@
dojo.require("dojo.html.common");
dojo.a11y = {
+ // String
+ // path to the test image for determining if images are displayed or not
imgPath:dojo.uri.dojoUri("src/widget/templates/images"),
- doAccessibleCheck: true, //perform a11y check or not
- accessible: null, // true = generate accessible widgets
+
+ // Boolean
+ // if true will perform check for need to create accessible widgets
+ doAccessibleCheck: true,
+
+ // Boolean
+ // uninitialized when null (accessible check has not been performed)
+ // if true generate accessible widgets
+ accessible: null,
checkAccessible: function(){
- /*
- * summary: perform check for accessibility if accessibility checking is turned
- * on and the accessibility test has not been performed yet
- */
+ // summary:
+ // perform check for accessibility if accessibility checking is turned
+ // on and the accessibility test has not been performed yet
if(this.accessible === null){
this.accessible = false; //default
if(this.doAccessibleCheck == true){
@@ -33,12 +41,10 @@
},
testAccessible: function(){
- /*
- * summary: Always perform the accessibility check to determine if high
- * contrast mode is on or display of images are turned off. Currently only checks
- * in IE and Mozilla.
- */
- // always test
+ // summary:
+ // Always perform the accessibility check to determine if high
+ // contrast mode is on or display of images are turned off. Currently only checks
+ // in IE and Mozilla.
this.accessible = false; //default
if (dojo.render.html.ie || dojo.render.html.mozilla){
var div = document.createElement("div");
@@ -77,21 +83,18 @@
},
setCheckAccessible: function(/* Boolean */ bTest){
- /*
- * summary: Set whether or not to check for accessibility mode. Default value
- * of module is true - perform check for accessibility modes.
- * bTest: Boolean - true to check; false to turn off checking
- */
+ // summary:
+ // Set whether or not to check for accessibility mode. Default value
+ // of module is true - perform check for accessibility modes.
+ // bTest: Boolean - true to check; false to turn off checking
this.doAccessibleCheck = bTest;
},
setAccessibleMode: function(){
- /*
- * summary: perform the accessibility check and sets the correct mode to load
- * a11y widgets. Only runs if test for accessiiblity has not been performed yet.
- * Call testAccessible() to force the test.
- * returnValue:boolean - true if accessibility mode is set
- */
+ // summary:
+ // perform the accessibility check and sets the correct mode to load
+ // a11y widgets. Only runs if test for accessiiblity has not been performed yet.
+ // Call testAccessible() to force the test.
if (this.accessible === null){
if (this.checkAccessible()){
dojo.render.html.prefixes.unshift("a11y");
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/collections/Store.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/collections/Store.js?view=diff&rev=453979&r1=453978&r2=453979
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/collections/Store.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/collections/Store.js Sat Oct 7 11:22:33 2006
@@ -270,4 +270,4 @@
onAddDataRange:function(arr){ },
onRemoveData:function(obj){ },
onUpdateField:function(obj, field, val){ }
-});
+});
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/Read.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/Read.js?view=diff&rev=453979&r1=453978&r2=453979
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/Read.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/Read.js Sat Oct 7 11:22:33 2006
@@ -187,7 +187,7 @@
getByIdentity:
function(/* string */ id) {
/* summary:
- * Given an the id of an item, this method returns the item that has that id.
+ * Given the id of an item, this method returns the item that has that id.
* Conforming implementations should return null if there is no item with
* the given id.
* issue:
@@ -200,7 +200,7 @@
* Should we move this method out of dojo.data.Read, and put it somewhere
* else, like maybe dojo.data.Identity?
* examples:
- * var alaska = store.byIdentity("AK");
+ * var alaska = store.getByIdentity("AK");
* assert("AK" == store.getIdentity(store.getByIdentity("AK")));
*/
dojo.unimplemented('dojo.data.Read.getByIdentity');
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/Result.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/Result.js?view=diff&rev=453979&r1=453978&r2=453979
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/Result.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/Result.js Sat Oct 7 11:22:33 2006
@@ -21,14 +21,34 @@
dojo.declare("dojo.data.Result", null, {
forEach:
- function(/* function or object */ functionOrKeywordObject) {
+ function(/* function */ callbackFunction, /* object? */ callbackObject, /* object? */ optionalKeywordArgs) {
/* summary:
* Loops through the result list, calling a callback function
* for each item in the result list.
* description:
- * The forEach() method will pass two arguments to the callback
- * function: an item, and the result list object itself.
- * Returns true if the entire result list has been looped through.
+ * The forEach() method will call the callback function once for
+ * each item in the result list. If a callbackObject is provided
+ * the callbackFunction will be called in the context of the
+ * callbackObject (the callbackObject will be used as the 'this'
+ * for each invocation of the callbackFunction). If callbackObject
+ * is not provided, or is null, the global object associated with
+ * callback is used instead. The forEach() method will pass
+ * 3 arguments to the callbackFunction: an item, the index of
+ * item in the context of this forEach() loop, and the result object
+ * itself. The signature of this forEach() method was modeled on
+ * the forEach() method of Mozilla's Array object in JavaScript 1.6:
+ * http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:forEach
+ * In addition to the callbackFunction and callbackObject parameters,
+ * the forEach() method may accept a third parameter, which should be
+ * an object with keyword parameters. Different implementations may
+ * make use of different keyword paramters. Conforming
+ * implementations ignore keyword parameters that they don't
+ * recognize.
+ * The forEach() method will returns true if the entire result list
+ * has been looped through, or false if the result list has not yet
+ * been looped through.
+ * The forEach() method will ignore any return value returned by
+ * the callbackFunction.
* After the forEach() operation has finished (or been cancelled)
* result.forEach() can be called again on the same result object.
* functionOrKeywordObject:
@@ -80,39 +100,60 @@
cancel:
function() {
/* summary:
- * If a forEach() loop is in progress, calling cancel() stops
- * the loop.
+ * Calling cancel() stops any and all processing associated with this
+ * result object.
+ * description:
+ * If a forEach() loop is in progress, calling cancel() will stop
+ * the loop. If a store.find() is in progress, and that find()
+ * involves an XMLHttpRequest, calling cancel() will abort the
+ * XMLHttpRequest. If callbacks have been set using setOnFindCompleted()
+ * or setOnError(), calling cancel() will cause those callbacks to
+ * not be called under any circumstances.
*/
dojo.unimplemented('dojo.data.Result.cancel');
},
- addCallback:
- function(/* function */ callbackFunction) {
+ setOnFindCompleted:
+ function(/* function */ callbackFunction, /* object? */ callbackObject) {
/* summary:
* Allows you to register a callbackFunction that will
* be called when all the results are available.
- * Patterned after dojo.Deferred.addCallback()
+ * description:
+ * If a callbackObject is provided the callbackFunction will be
+ * called in the context of the callbackObject (the callbackObject
+ * will be used as the 'this' for each invocation of the
+ * callbackFunction). If callbackObject is not provided, or is
+ * null, the global object associated with callback is used instead.
+ * The setOnFindCompleted() method will ignore any return value
+ * returned by the callbackFunction.
* issues:
- * I (Brian) am not clear on exactly how this shoul work:
- * what parameters it takes, what the return value should
- * be, whether the callback gets called before or after the
- * forEach() loop, whether you can chain callbacks (as with
- * a real Deferred. I'm worried that doing everything that
- * dojo.Deferred does is too much to ask of basic data-store
- * implementations like a simple CSV store. Maybe someone
- * else can suggest simple answers to how addCallback should
- * work.
+ * We have not yet decided what parameters the setOnFindCompleted()
+ * will pass to the callbackFunction...
+ * (A) The setOnFindCompleted() method will pass one parameter to the
+ * callbackFunction: the result object itself.
+ * (B) The setOnFindCompleted() method will pass two parameters to the
+ * callbackFunction: an iterator object, and the result object itself.
*/
- dojo.unimplemented('dojo.data.Result.addCallback');
+ dojo.unimplemented('dojo.data.Result.setOnFindCompleted');
},
- addErrback:
- function(/* function */ errorCallbackFunction) {
+ setOnError:
+ function(/* function */ errorCallbackFunction, /* object? */ callbackObject) {
/* summary:
* Allows you to register a errorCallbackFunction that
* will be called if there is any sort of error.
- * issues:
- * See the notes under addCallback(), above.
+ * description:
+ * If a callbackObject is provided the errorCallbackFunction will
+ * be called in the context of the callbackObject (the callbackObject
+ * will be used as the 'this' for each invocation of the
+ * errorCallbackFunction). If callbackObject is not provided, or is
+ * null, the global object associated with callback is used instead.
+ * The setOnError() method will pass two parameters to the
+ * errorCallbackFunction: an Error object, and the result object
+ * itself:
+ * errorCallbackFunction(errorObject, resultObject);
+ * The setOnError() method will ignore any return value returned
+ * by the errorCallbackFunction.
*/
- dojo.unimplemented('dojo.data.Result.addErrback');
+ dojo.unimplemented('dojo.data.Result.setOnError');
},
getStore:
function() {
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/csv/Result.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/csv/Result.js?view=diff&rev=453979&r1=453978&r2=453979
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/csv/Result.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/data/csv/Result.js Sat Oct 7 11:22:33 2006
@@ -25,29 +25,16 @@
this._inProgress = false;
},
forEach:
- function(/* function or object */ functionOrKeywordObject) {
+ function(/* function */ callbackFunction, /* object? */ callbackObject, /* object? */ optionalKeywordArgs) {
// Summary: See dojo.data.Result.forEach()
- dojo.lang.assertType(functionOrKeywordObject, [Function, "pureobject"]);
- var callbackFunction = null;
- var callbackObject = null;
- var callbackFunctionName = null;
- if (dojo.lang.isFunction(functionOrKeywordObject)) {
- callbackFunction = functionOrKeywordObject;
- } else {
- var keywordObject = functionOrKeywordObject;
- dojo.lang.assertType(keywordObject, "pureobject");
- var callbackObject = keywordObject["object"];
- var callbackFunctionName = keywordObject["callback"];
- }
+ dojo.lang.assertType(callbackFunction, Function);
+ dojo.lang.assertType(callbackObject, Object, {optional:true});
+ dojo.lang.assertType(optionalKeywordArgs, "pureobject", {optional:true});
this._inProgress = true;
for (var i in this._arrayOfItems) {
var item = this._arrayOfItems[i];
if (!this._cancel) {
- if (callbackFunction) {
- callbackFunction(item, this);
- } else {
- callbackObject[callbackFunctionName](item, this);
- }
+ callbackFunction.call(callbackObject, item, i, this);
}
}
this._inProgress = false;
@@ -72,15 +59,15 @@
this._cancel = true;
}
},
- addCallback:
- function(/* function */ callbackFunction) {
- // Summary: See dojo.data.Result.addCallback()
- dojo.unimplemented('dojo.data.csv.Result.addCallback');
+ setOnFindCompleted:
+ function(/* function */ callbackFunction, /* object? */ callbackObject) {
+ // Summary: See dojo.data.Result.setOnFindCompleted()
+ dojo.unimplemented('dojo.data.csv.Result.setOnFindCompleted');
},
- addErrback:
- function(/* function */ errorCallbackFunction) {
- // Summary: See dojo.data.Result.addErrback()
- dojo.unimplemented('dojo.data.csv.Result.addErrback');
+ setOnError:
+ function(/* function */ errorCallbackFunction, /* object? */ callbackObject) {
+ // Summary: See dojo.data.Result.setOnError()
+ dojo.unimplemented('dojo.data.csv.Result.setOnError');
},
getStore:
function() {
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date.js?view=auto&rev=453979
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date.js Sat Oct 7 11:22:33 2006
@@ -0,0 +1,13 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.date");
+
+dojo.deprecated("dojo.date", "use one of the modules in dojo.date.* instead", "0.5");
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date.js
------------------------------------------------------------------------------
svn:eol-style = native
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date/common.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date/common.js?view=diff&rev=453979&r1=453978&r2=453979
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date/common.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/date/common.js Sat Oct 7 11:22:33 2006
@@ -14,13 +14,13 @@
/* Supplementary Date Functions
*******************************/
-dojo.date.setDayOfYear = function(/*Date*/dateObject, /*Number*/dayOfYear) {
+dojo.date.setDayOfYear = function(/*Date*/dateObject, /*Number*/dayOfYear){
dateObject.setMonth(0);
dateObject.setDate(dayOfYear);
return dateObject; // Date
}
-dojo.date.getDayOfYear = function(/*Date*/dateObject) {
+dojo.date.getDayOfYear = function(/*Date*/dateObject){
var fullYear = dateObject.getFullYear();
var lastDayOfPrevYear = new Date(fullYear-1, 11, 31);
return Math.floor((dateObject.getTime() -
@@ -28,13 +28,13 @@
}
-dojo.date.setWeekOfYear = function (dateObject, week, firstDay) {
- if (arguments.length == 1) { firstDay = 0; } // Sunday
+dojo.date.setWeekOfYear = function(/*Date*/dateObject, /*Number*/week, /*Number*/firstDay){
+ if(arguments.length == 1){ firstDay = 0; } // Sunday
dojo.unimplemented("dojo.date.setWeekOfYear");
}
-dojo.date.getWeekOfYear = function (dateObject, firstDay) {
- if (arguments.length == 1) { firstDay = 0; } // Sunday
+dojo.date.getWeekOfYear = function(/*Date*/dateObject, /*Number*/firstDay){
+ if(arguments.length == 1){ firstDay = 0; } // Sunday
// work out the first day of the year corresponding to the week
var firstDayOfYear = new Date(dateObject.getFullYear(), 0, 1);
@@ -47,14 +47,14 @@
}
-
-
-dojo.date.setIsoWeekOfYear = function (dateObject, week, firstDay) {
+dojo.date.setIsoWeekOfYear = function(/*Date*/dateObject, /*Number*/week, /*Number*/firstDay){
+ // summary: unimplemented
if (arguments.length == 1) { firstDay = 1; } // Monday
dojo.unimplemented("dojo.date.setIsoWeekOfYear");
}
-dojo.date.getIsoWeekOfYear = function (dateObject, firstDay) {
+dojo.date.getIsoWeekOfYear = function(/*Date*/dateObject, /*Number*/firstDay) {
+ // summary: unimplemented
if (arguments.length == 1) { firstDay = 1; } // Monday
dojo.unimplemented("dojo.date.getIsoWeekOfYear");
}
@@ -92,10 +92,11 @@
*/
dojo.date.getDaysInMonth = function(/*Date*/dateObject){
+ // summary: returns the number of days in the month used by dateObject
var month = dateObject.getMonth();
var days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
- if (month == 1 && dojo.date.isLeapYear(dateObject)) { return 29; }
- else { return days[month]; }
+ if (month == 1 && dojo.date.isLeapYear(dateObject)) { return 29; } // Number
+ else { return days[month]; } // Number
}
dojo.date.isLeapYear = function(/*Date*/dateObject){
@@ -109,7 +110,7 @@
// multiple of 400. For example, 1900 was not a leap year, but 2000 is one.
var year = dateObject.getFullYear();
- return (year%400 == 0) ? true : (year%100 == 0) ? false : (year%4 == 0) ? true : false;
+ return (year%400 == 0) ? true : (year%100 == 0) ? false : (year%4 == 0) ? true : false; // Boolean
}
// FIXME: This is not localized
@@ -166,10 +167,10 @@
dojo.date.getOrdinal = function (dateObject) {
var date = dateObject.getDate();
- if (date%100 != 11 && date%10 == 1) { return "st"; }
- else if (date%100 != 12 && date%10 == 2) { return "nd"; }
- else if (date%100 != 13 && date%10 == 3) { return "rd"; }
- else { return "th"; }
+ if (date%100 != 11 && date%10 == 1) { return "st"; } // String
+ else if (date%100 != 12 && date%10 == 2) { return "nd"; } // String
+ else if (date%100 != 13 && date%10 == 3) { return "rd"; } // String
+ else { return "th"; } // String
}