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/05/27 00:48:09 UTC
svn commit: r541946 [23/41] - in /tapestry/tapestry4/trunk:
tapestry-examples/TimeTracker/
tapestry-examples/TimeTracker/src/context/WEB-INF/
tapestry-examples/Workbench/ tapestry-framework/
tapestry-framework/src/java/org/apache/tapestry/ tapestry-fra...
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cometd.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cometd.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cometd.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cometd.js Sat May 26 15:47:41 2007
@@ -0,0 +1,517 @@
+dojo.require("dojo.io.common");
+dojo.provide("dojo.io.cometd");
+dojo.require("dojo.AdapterRegistry");
+dojo.require("dojo.json");
+dojo.require("dojo.io.BrowserIO");
+dojo.require("dojo.io.IframeIO");
+dojo.require("dojo.io.ScriptSrcIO");
+dojo.require("dojo.io.cookie");
+dojo.require("dojo.event.*");
+dojo.require("dojo.lang.common");
+dojo.require("dojo.lang.func");
+cometd=new function(){
+this.initialized=false;
+this.connected=false;
+this.connectionTypes=new dojo.AdapterRegistry(true);
+this.version=0.1;
+this.minimumVersion=0.1;
+this.clientId=null;
+this._isXD=false;
+this.handshakeReturn=null;
+this.currentTransport=null;
+this.url=null;
+this.lastMessage=null;
+this.globalTopicChannels={};
+this.backlog=[];
+this.tunnelInit=function(_1,_2){
+};
+this.tunnelCollapse=function(){
+dojo.debug("tunnel collapsed!");
+};
+this.init=function(_3,_4,_5){
+_3=_3||{};
+_3.version=this.version;
+_3.minimumVersion=this.minimumVersion;
+_3.channel="/meta/handshake";
+this.url=_4||djConfig["cometdRoot"];
+if(!this.url){
+dojo.debug("no cometd root specified in djConfig and no root passed");
+return;
+}
+var _6={url:this.url,method:"POST",mimetype:"text/json",load:dojo.lang.hitch(this,"finishInit"),content:{"message":dojo.json.serialize([_3])}};
+var _7="^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";
+var r=(""+window.location).match(new RegExp(_7));
+if(r[4]){
+var _9=r[4].split(":");
+var _a=_9[0];
+var _b=_9[1]||"80";
+r=this.url.match(new RegExp(_7));
+if(r[4]){
+_9=r[4].split(":");
+var _c=_9[0];
+var _d=_9[1]||"80";
+if((_c!=_a)||(_d!=_b)){
+dojo.debug(_a,_c);
+dojo.debug(_b,_d);
+this._isXD=true;
+_6.transport="ScriptSrcTransport";
+_6.jsonParamName="jsonp";
+_6.method="GET";
+}
+}
+}
+if(_5){
+dojo.lang.mixin(_6,_5);
+}
+return dojo.io.bind(_6);
+};
+this.finishInit=function(_e,_f,evt,_11){
+_f=_f[0];
+this.handshakeReturn=_f;
+if(_f["authSuccessful"]==false){
+dojo.debug("cometd authentication failed");
+return;
+}
+if(_f.version<this.minimumVersion){
+dojo.debug("cometd protocol version mismatch. We wanted",this.minimumVersion,"but got",_f.version);
+return;
+}
+this.currentTransport=this.connectionTypes.match(_f.supportedConnectionTypes,_f.version,this._isXD);
+this.currentTransport.version=_f.version;
+this.clientId=_f.clientId;
+this.tunnelInit=dojo.lang.hitch(this.currentTransport,"tunnelInit");
+this.tunnelCollapse=dojo.lang.hitch(this.currentTransport,"tunnelCollapse");
+this.initialized=true;
+this.currentTransport.startup(_f);
+while(this.backlog.length!=0){
+var cur=this.backlog.shift();
+var fn=cur.shift();
+this[fn].apply(this,cur);
+}
+};
+this._getRandStr=function(){
+return Math.random().toString().substring(2,10);
+};
+this.deliver=function(_14){
+dojo.lang.forEach(_14,this._deliver,this);
+};
+this._deliver=function(_15){
+if(!_15["channel"]){
+dojo.debug("cometd error: no channel for message!");
+return;
+}
+if(!this.currentTransport){
+this.backlog.push(["deliver",_15]);
+return;
+}
+this.lastMessage=_15;
+if((_15.channel.length>5)&&(_15.channel.substr(0,5)=="/meta")){
+switch(_15.channel){
+case "/meta/subscribe":
+if(!_15.successful){
+dojo.debug("cometd subscription error for channel",_15.channel,":",_15.error);
+return;
+}
+this.subscribed(_15.subscription,_15);
+break;
+case "/meta/unsubscribe":
+if(!_15.successful){
+dojo.debug("cometd unsubscription error for channel",_15.channel,":",_15.error);
+return;
+}
+this.unsubscribed(_15.subscription,_15);
+break;
+}
+}
+this.currentTransport.deliver(_15);
+if(_15.data){
+var _16=(this.globalTopicChannels[_15.channel])?_15.channel:"/cometd"+_15.channel;
+dojo.event.topic.publish(_16,_15);
+}
+};
+this.disconnect=function(){
+if(!this.currentTransport){
+dojo.debug("no current transport to disconnect from");
+return;
+}
+this.currentTransport.disconnect();
+};
+this.publish=function(_17,_18,_19){
+if(!this.currentTransport){
+this.backlog.push(["publish",_17,_18,_19]);
+return;
+}
+var _1a={data:_18,channel:_17};
+if(_19){
+dojo.lang.mixin(_1a,_19);
+}
+return this.currentTransport.sendMessage(_1a);
+};
+this.subscribe=function(_1b,_1c,_1d,_1e){
+if(!this.currentTransport){
+this.backlog.push(["subscribe",_1b,_1c,_1d,_1e]);
+return;
+}
+if(_1d){
+var _1f=(_1c)?_1b:"/cometd"+_1b;
+if(_1c){
+this.globalTopicChannels[_1b]=true;
+}
+dojo.event.topic.subscribe(_1f,_1d,_1e);
+}
+return this.currentTransport.sendMessage({channel:"/meta/subscribe",subscription:_1b});
+};
+this.subscribed=function(_20,_21){
+dojo.debug(_20);
+dojo.debugShallow(_21);
+};
+this.unsubscribe=function(_22,_23,_24,_25){
+if(!this.currentTransport){
+this.backlog.push(["unsubscribe",_22,_23,_24,_25]);
+return;
+}
+if(_24){
+var _26=(_23)?_22:"/cometd"+_22;
+dojo.event.topic.unsubscribe(_26,_24,_25);
+}
+return this.currentTransport.sendMessage({channel:"/meta/unsubscribe",subscription:_22});
+};
+this.unsubscribed=function(_27,_28){
+dojo.debug(_27);
+dojo.debugShallow(_28);
+};
+};
+cometd.iframeTransport=new function(){
+this.connected=false;
+this.connectionId=null;
+this.rcvNode=null;
+this.rcvNodeName="";
+this.phonyForm=null;
+this.authToken=null;
+this.lastTimestamp=null;
+this.lastId=null;
+this.backlog=[];
+this.check=function(_29,_2a,_2b){
+return ((!_2b)&&(!dojo.render.html.safari)&&(dojo.lang.inArray(_29,"iframe")));
+};
+this.tunnelInit=function(){
+this.postToIframe({message:dojo.json.serialize([{channel:"/meta/connect",clientId:cometd.clientId,connectionType:"iframe"}])});
+};
+this.tunnelCollapse=function(){
+if(this.connected){
+this.connected=false;
+this.postToIframe({message:dojo.json.serialize([{channel:"/meta/reconnect",clientId:cometd.clientId,connectionId:this.connectionId,timestamp:this.lastTimestamp,id:this.lastId}])});
+}
+};
+this.deliver=function(_2c){
+if(_2c["timestamp"]){
+this.lastTimestamp=_2c.timestamp;
+}
+if(_2c["id"]){
+this.lastId=_2c.id;
+}
+if((_2c.channel.length>5)&&(_2c.channel.substr(0,5)=="/meta")){
+switch(_2c.channel){
+case "/meta/connect":
+if(!_2c.successful){
+dojo.debug("cometd connection error:",_2c.error);
+return;
+}
+this.connectionId=_2c.connectionId;
+this.connected=true;
+this.processBacklog();
+break;
+case "/meta/reconnect":
+if(!_2c.successful){
+dojo.debug("cometd reconnection error:",_2c.error);
+return;
+}
+this.connected=true;
+break;
+case "/meta/subscribe":
+if(!_2c.successful){
+dojo.debug("cometd subscription error for channel",_2c.channel,":",_2c.error);
+return;
+}
+dojo.debug(_2c.channel);
+break;
+}
+}
+};
+this.widenDomain=function(_2d){
+var cd=_2d||document.domain;
+if(cd.indexOf(".")==-1){
+return;
+}
+var dps=cd.split(".");
+if(dps.length<=2){
+return;
+}
+dps=dps.slice(dps.length-2);
+document.domain=dps.join(".");
+return document.domain;
+};
+this.postToIframe=function(_30,url){
+if(!this.phonyForm){
+if(dojo.render.html.ie){
+this.phonyForm=document.createElement("<form enctype='application/x-www-form-urlencoded' method='POST' style='display: none;'>");
+dojo.body().appendChild(this.phonyForm);
+}else{
+this.phonyForm=document.createElement("form");
+this.phonyForm.style.display="none";
+dojo.body().appendChild(this.phonyForm);
+this.phonyForm.enctype="application/x-www-form-urlencoded";
+this.phonyForm.method="POST";
+}
+}
+this.phonyForm.action=url||cometd.url;
+this.phonyForm.target=this.rcvNodeName;
+this.phonyForm.setAttribute("target",this.rcvNodeName);
+while(this.phonyForm.firstChild){
+this.phonyForm.removeChild(this.phonyForm.firstChild);
+}
+for(var x in _30){
+var tn;
+if(dojo.render.html.ie){
+tn=document.createElement("<input type='hidden' name='"+x+"' value='"+_30[x]+"'>");
+this.phonyForm.appendChild(tn);
+}else{
+tn=document.createElement("input");
+this.phonyForm.appendChild(tn);
+tn.type="hidden";
+tn.name=x;
+tn.value=_30[x];
+}
+}
+this.phonyForm.submit();
+};
+this.processBacklog=function(){
+while(this.backlog.length>0){
+this.sendMessage(this.backlog.shift(),true);
+}
+};
+this.sendMessage=function(_34,_35){
+if((_35)||(this.connected)){
+_34.connectionId=this.connectionId;
+_34.clientId=cometd.clientId;
+var _36={url:cometd.url||djConfig["cometdRoot"],method:"POST",mimetype:"text/json",content:{message:dojo.json.serialize([_34])}};
+return dojo.io.bind(_36);
+}else{
+this.backlog.push(_34);
+}
+};
+this.startup=function(_37){
+dojo.debug("startup!");
+dojo.debug(dojo.json.serialize(_37));
+if(this.connected){
+return;
+}
+this.rcvNodeName="cometdRcv_"+cometd._getRandStr();
+var _38=cometd.url+"/?tunnelInit=iframe";
+if(false&&dojo.render.html.ie){
+this.rcvNode=new ActiveXObject("htmlfile");
+this.rcvNode.open();
+this.rcvNode.write("<html>");
+this.rcvNode.write("<script>document.domain = '"+document.domain+"'");
+this.rcvNode.write("</html>");
+this.rcvNode.close();
+var _39=this.rcvNode.createElement("div");
+this.rcvNode.appendChild(_39);
+this.rcvNode.parentWindow.dojo=dojo;
+_39.innerHTML="<iframe src='"+_38+"'></iframe>";
+}else{
+this.rcvNode=dojo.io.createIFrame(this.rcvNodeName,"",_38);
+}
+};
+};
+cometd.mimeReplaceTransport=new function(){
+this.connected=false;
+this.connectionId=null;
+this.xhr=null;
+this.authToken=null;
+this.lastTimestamp=null;
+this.lastId=null;
+this.backlog=[];
+this.check=function(_3a,_3b,_3c){
+return ((!_3c)&&(dojo.render.html.mozilla)&&(dojo.lang.inArray(_3a,"mime-message-block")));
+};
+this.tunnelInit=function(){
+if(this.connected){
+return;
+}
+this.openTunnelWith({message:dojo.json.serialize([{channel:"/meta/connect",clientId:cometd.clientId,connectionType:"mime-message-block"}])});
+this.connected=true;
+};
+this.tunnelCollapse=function(){
+if(this.connected){
+this.connected=false;
+this.openTunnelWith({message:dojo.json.serialize([{channel:"/meta/reconnect",clientId:cometd.clientId,connectionId:this.connectionId,timestamp:this.lastTimestamp,id:this.lastId}])});
+}
+};
+this.deliver=cometd.iframeTransport.deliver;
+this.handleOnLoad=function(_3d){
+cometd.deliver(dojo.json.evalJson(this.xhr.responseText));
+};
+this.openTunnelWith=function(_3e,url){
+this.xhr=dojo.hostenv.getXmlhttpObject();
+this.xhr.multipart=true;
+if(dojo.render.html.mozilla){
+this.xhr.addEventListener("load",dojo.lang.hitch(this,"handleOnLoad"),false);
+}else{
+if(dojo.render.html.safari){
+dojo.debug("Webkit is broken with multipart responses over XHR = (");
+this.xhr.onreadystatechange=dojo.lang.hitch(this,"handleOnLoad");
+}else{
+this.xhr.onload=dojo.lang.hitch(this,"handleOnLoad");
+}
+}
+this.xhr.open("POST",(url||cometd.url),true);
+this.xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
+dojo.debug(dojo.json.serialize(_3e));
+this.xhr.send(dojo.io.argsFromMap(_3e,"utf8"));
+};
+this.processBacklog=function(){
+while(this.backlog.length>0){
+this.sendMessage(this.backlog.shift(),true);
+}
+};
+this.sendMessage=function(_40,_41){
+if((_41)||(this.connected)){
+_40.connectionId=this.connectionId;
+_40.clientId=cometd.clientId;
+var _42={url:cometd.url||djConfig["cometdRoot"],method:"POST",mimetype:"text/json",content:{message:dojo.json.serialize([_40])}};
+return dojo.io.bind(_42);
+}else{
+this.backlog.push(_40);
+}
+};
+this.startup=function(_43){
+dojo.debugShallow(_43);
+if(this.connected){
+return;
+}
+this.tunnelInit();
+};
+};
+cometd.longPollTransport=new function(){
+this.connected=false;
+this.connectionId=null;
+this.authToken=null;
+this.lastTimestamp=null;
+this.lastId=null;
+this.backlog=[];
+this.check=function(_44,_45,_46){
+return ((!_46)&&(dojo.lang.inArray(_44,"long-polling")));
+};
+this.tunnelInit=function(){
+if(this.connected){
+return;
+}
+this.openTunnelWith({message:dojo.json.serialize([{channel:"/meta/connect",clientId:cometd.clientId,connectionType:"long-polling"}])});
+this.connected=true;
+};
+this.tunnelCollapse=function(){
+if(!this.connected){
+this.connected=false;
+dojo.debug("clientId:",cometd.clientId);
+this.openTunnelWith({message:dojo.json.serialize([{channel:"/meta/reconnect",connectionType:"long-polling",clientId:cometd.clientId,connectionId:this.connectionId,timestamp:this.lastTimestamp,id:this.lastId}])});
+}
+};
+this.deliver=cometd.iframeTransport.deliver;
+this.openTunnelWith=function(_47,url){
+dojo.io.bind({url:(url||cometd.url),method:"post",content:_47,mimetype:"text/json",load:dojo.lang.hitch(this,function(_49,_4a,evt,_4c){
+cometd.deliver(_4a);
+this.connected=false;
+this.tunnelCollapse();
+}),error:function(){
+dojo.debug("tunnel opening failed");
+}});
+this.connected=true;
+};
+this.processBacklog=function(){
+while(this.backlog.length>0){
+this.sendMessage(this.backlog.shift(),true);
+}
+};
+this.sendMessage=function(_4d,_4e){
+if((_4e)||(this.connected)){
+_4d.connectionId=this.connectionId;
+_4d.clientId=cometd.clientId;
+var _4f={url:cometd.url||djConfig["cometdRoot"],method:"post",mimetype:"text/json",content:{message:dojo.json.serialize([_4d])},load:dojo.lang.hitch(this,function(_50,_51,evt,_53){
+cometd.deliver(_51);
+})};
+return dojo.io.bind(_4f);
+}else{
+this.backlog.push(_4d);
+}
+};
+this.startup=function(_54){
+if(this.connected){
+return;
+}
+this.tunnelInit();
+};
+};
+cometd.callbackPollTransport=new function(){
+this.connected=false;
+this.connectionId=null;
+this.authToken=null;
+this.lastTimestamp=null;
+this.lastId=null;
+this.backlog=[];
+this.check=function(_55,_56,_57){
+return dojo.lang.inArray(_55,"callback-polling");
+};
+this.tunnelInit=function(){
+if(this.connected){
+return;
+}
+this.openTunnelWith({message:dojo.json.serialize([{channel:"/meta/connect",clientId:cometd.clientId,connectionType:"callback-polling"}])});
+this.connected=true;
+};
+this.tunnelCollapse=function(){
+if(!this.connected){
+this.connected=false;
+this.openTunnelWith({message:dojo.json.serialize([{channel:"/meta/reconnect",connectionType:"long-polling",clientId:cometd.clientId,connectionId:this.connectionId,timestamp:this.lastTimestamp,id:this.lastId}])});
+}
+};
+this.deliver=cometd.iframeTransport.deliver;
+this.openTunnelWith=function(_58,url){
+var req=dojo.io.bind({url:(url||cometd.url),content:_58,mimetype:"text/json",transport:"ScriptSrcTransport",jsonParamName:"jsonp",load:dojo.lang.hitch(this,function(_5b,_5c,evt,_5e){
+cometd.deliver(_5c);
+this.connected=false;
+this.tunnelCollapse();
+}),error:function(){
+dojo.debug("tunnel opening failed");
+}});
+this.connected=true;
+};
+this.processBacklog=function(){
+while(this.backlog.length>0){
+this.sendMessage(this.backlog.shift(),true);
+}
+};
+this.sendMessage=function(_5f,_60){
+if((_60)||(this.connected)){
+_5f.connectionId=this.connectionId;
+_5f.clientId=cometd.clientId;
+var _61={url:cometd.url||djConfig["cometdRoot"],mimetype:"text/json",transport:"ScriptSrcTransport",jsonParamName:"jsonp",content:{message:dojo.json.serialize([_5f])},load:dojo.lang.hitch(this,function(_62,_63,evt,_65){
+cometd.deliver(_63);
+})};
+return dojo.io.bind(_61);
+}else{
+this.backlog.push(_5f);
+}
+};
+this.startup=function(_66){
+if(this.connected){
+return;
+}
+this.tunnelInit();
+};
+};
+cometd.connectionTypes.register("mime-message-block",cometd.mimeReplaceTransport.check,cometd.mimeReplaceTransport);
+cometd.connectionTypes.register("long-polling",cometd.longPollTransport.check,cometd.longPollTransport);
+cometd.connectionTypes.register("callback-polling",cometd.callbackPollTransport.check,cometd.callbackPollTransport);
+cometd.connectionTypes.register("iframe",cometd.iframeTransport.check,cometd.iframeTransport);
+dojo.io.cometd=cometd;
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cometd.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cometd.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cometd.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/common.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/common.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/common.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/common.js Sat May 26 15:47:41 2007
@@ -0,0 +1,219 @@
+dojo.provide("dojo.io.common");
+dojo.require("dojo.string");
+dojo.require("dojo.lang.extras");
+dojo.io.transports=[];
+dojo.io.hdlrFuncNames=["load","error","timeout"];
+dojo.io.Request=function(_1,_2,_3,_4){
+if((arguments.length==1)&&(arguments[0].constructor==Object)){
+this.fromKwArgs(arguments[0]);
+}else{
+this.url=_1;
+if(_2){
+this.mimetype=_2;
+}
+if(_3){
+this.transport=_3;
+}
+if(arguments.length>=4){
+this.changeUrl=_4;
+}
+}
+};
+dojo.lang.extend(dojo.io.Request,{url:"",mimetype:"text/plain",method:"GET",content:undefined,transport:undefined,changeUrl:undefined,formNode:undefined,sync:false,bindSuccess:false,useCache:false,preventCache:false,jsonFilter:function(_5){
+if((this.mimetype=="text/json-comment-filtered")||(this.mimetype=="application/json-comment-filtered")){
+var _6=_5.indexOf("/*");
+var _7=_5.lastIndexOf("*/");
+if((_6==-1)||(_7==-1)){
+dojo.debug("your JSON wasn't comment filtered!");
+return "";
+}
+return _5.substring(_6+2,_7);
+}
+dojo.debug("please consider using a mimetype of text/json-comment-filtered to avoid potential security issues with JSON endpoints");
+return _5;
+},load:function(_8,_9,_a,_b){
+},error:function(_c,_d,_e,_f){
+},timeout:function(_10,_11,_12,_13){
+},handle:function(_14,_15,_16,_17){
+},timeoutSeconds:0,abort:function(){
+},fromKwArgs:function(_18){
+if(_18["url"]){
+_18.url=_18.url.toString();
+}
+if(_18["formNode"]){
+_18.formNode=dojo.byId(_18.formNode);
+}
+if(!_18["method"]&&_18["formNode"]&&_18["formNode"].method){
+_18.method=_18["formNode"].method;
+}
+if(!_18["handle"]&&_18["handler"]){
+_18.handle=_18.handler;
+}
+if(!_18["load"]&&_18["loaded"]){
+_18.load=_18.loaded;
+}
+if(!_18["changeUrl"]&&_18["changeURL"]){
+_18.changeUrl=_18.changeURL;
+}
+_18.encoding=dojo.lang.firstValued(_18["encoding"],djConfig["bindEncoding"],"");
+_18.sendTransport=dojo.lang.firstValued(_18["sendTransport"],djConfig["ioSendTransport"],false);
+var _19=dojo.lang.isFunction;
+for(var x=0;x<dojo.io.hdlrFuncNames.length;x++){
+var fn=dojo.io.hdlrFuncNames[x];
+if(_18[fn]&&_19(_18[fn])){
+continue;
+}
+if(_18["handle"]&&_19(_18["handle"])){
+_18[fn]=_18.handle;
+}
+}
+dojo.lang.mixin(this,_18);
+}});
+dojo.io.Error=function(msg,_1d,num){
+this.message=msg;
+this.type=_1d||"unknown";
+this.number=num||0;
+};
+dojo.io.transports.addTransport=function(_1f){
+this.push(_1f);
+this[_1f]=dojo.io[_1f];
+};
+dojo.io.bind=function(_20){
+if(!(_20 instanceof dojo.io.Request)){
+try{
+_20=new dojo.io.Request(_20);
+}
+catch(e){
+dojo.debug(e);
+}
+}
+var _21="";
+if(_20["transport"]){
+_21=_20["transport"];
+if(!this[_21]){
+dojo.io.sendBindError(_20,"No dojo.io.bind() transport with name '"+_20["transport"]+"'.");
+return _20;
+}
+if(!this[_21].canHandle(_20)){
+dojo.io.sendBindError(_20,"dojo.io.bind() transport with name '"+_20["transport"]+"' cannot handle this type of request.");
+return _20;
+}
+}else{
+for(var x=0;x<dojo.io.transports.length;x++){
+var tmp=dojo.io.transports[x];
+if((this[tmp])&&(this[tmp].canHandle(_20))){
+_21=tmp;
+break;
+}
+}
+if(_21==""){
+dojo.io.sendBindError(_20,"None of the loaded transports for dojo.io.bind()"+" can handle the request.");
+return _20;
+}
+}
+this[_21].bind(_20);
+_20.bindSuccess=true;
+return _20;
+};
+dojo.io.sendBindError=function(_24,_25){
+if((typeof _24.error=="function"||typeof _24.handle=="function")&&(typeof setTimeout=="function"||typeof setTimeout=="object")){
+var _26=new dojo.io.Error(_25);
+setTimeout(function(){
+_24[(typeof _24.error=="function")?"error":"handle"]("error",_26,null,_24);
+},50);
+}else{
+dojo.raise(_25);
+}
+};
+dojo.io.queueBind=function(_27){
+if(!(_27 instanceof dojo.io.Request)){
+try{
+_27=new dojo.io.Request(_27);
+}
+catch(e){
+dojo.debug(e);
+}
+}
+var _28=_27.load;
+_27.load=function(){
+dojo.io._queueBindInFlight=false;
+var ret=_28.apply(this,arguments);
+dojo.io._dispatchNextQueueBind();
+return ret;
+};
+var _2a=_27.error;
+_27.error=function(){
+dojo.io._queueBindInFlight=false;
+var ret=_2a.apply(this,arguments);
+dojo.io._dispatchNextQueueBind();
+return ret;
+};
+dojo.io._bindQueue.push(_27);
+dojo.io._dispatchNextQueueBind();
+return _27;
+};
+dojo.io._dispatchNextQueueBind=function(){
+if(!dojo.io._queueBindInFlight){
+dojo.io._queueBindInFlight=true;
+if(dojo.io._bindQueue.length>0){
+dojo.io.bind(dojo.io._bindQueue.shift());
+}else{
+dojo.io._queueBindInFlight=false;
+}
+}
+};
+dojo.io._bindQueue=[];
+dojo.io._queueBindInFlight=false;
+dojo.io.argsFromMap=function(map,_2d,_2e){
+var enc=/utf/i.test(_2d||"")?encodeURIComponent:dojo.string.encodeAscii;
+var _30=[];
+var _31=new Object();
+for(var _32 in map){
+var _33=function(elt){
+var val=enc(_32)+"="+enc(elt);
+_30[(_2e==_32)?"push":"unshift"](val);
+};
+if(!_31[_32]){
+var _36=map[_32];
+if(dojo.lang.isArray(_36)){
+dojo.lang.forEach(_36,_33);
+}else{
+_33(_36);
+}
+}
+}
+return _30.join("&");
+};
+dojo.io.setIFrameSrc=function(_37,src,_39){
+try{
+var r=dojo.render.html;
+if(!_39){
+if(r.safari){
+_37.location=src;
+}else{
+frames[_37.name].location=src;
+}
+}else{
+var _3b;
+if(r.ie){
+_3b=_37.contentWindow.document;
+}else{
+if(r.safari){
+_3b=_37.document;
+}else{
+_3b=_37.contentWindow;
+}
+}
+if(!_3b){
+_37.location=src;
+return;
+}else{
+_3b.location.replace(src);
+}
+}
+}
+catch(e){
+dojo.debug(e);
+dojo.debug("setIFrameSrc: "+e);
+}
+};
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/common.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/common.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/common.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cookie.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cookie.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cookie.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cookie.js Sat May 26 15:47:41 2007
@@ -0,0 +1,91 @@
+dojo.provide("dojo.io.cookie");
+dojo.io.cookie.setCookie=function(_1,_2,_3,_4,_5,_6){
+var _7=-1;
+if((typeof _3=="number")&&(_3>=0)){
+var d=new Date();
+d.setTime(d.getTime()+(_3*24*60*60*1000));
+_7=d.toGMTString();
+}
+_2=escape(_2);
+document.cookie=_1+"="+_2+";"+(_7!=-1?" expires="+_7+";":"")+(_4?"path="+_4:"")+(_5?"; domain="+_5:"")+(_6?"; secure":"");
+};
+dojo.io.cookie.set=dojo.io.cookie.setCookie;
+dojo.io.cookie.getCookie=function(_9){
+var _a=document.cookie.lastIndexOf(_9+"=");
+if(_a==-1){
+return null;
+}
+var _b=document.cookie.substring(_a+_9.length+1);
+var _c=_b.indexOf(";");
+if(_c==-1){
+_c=_b.length;
+}
+_b=_b.substring(0,_c);
+_b=unescape(_b);
+return _b;
+};
+dojo.io.cookie.get=dojo.io.cookie.getCookie;
+dojo.io.cookie.deleteCookie=function(_d){
+dojo.io.cookie.setCookie(_d,"-",0);
+};
+dojo.io.cookie.setObjectCookie=function(_e,_f,_10,_11,_12,_13,_14){
+if(arguments.length==5){
+_14=_12;
+_12=null;
+_13=null;
+}
+var _15=[],_16,_17="";
+if(!_14){
+_16=dojo.io.cookie.getObjectCookie(_e);
+}
+if(_10>=0){
+if(!_16){
+_16={};
+}
+for(var _18 in _f){
+if(_f[_18]==null){
+delete _16[_18];
+}else{
+if((typeof _f[_18]=="string")||(typeof _f[_18]=="number")){
+_16[_18]=_f[_18];
+}
+}
+}
+_18=null;
+for(var _18 in _16){
+_15.push(escape(_18)+"="+escape(_16[_18]));
+}
+_17=_15.join("&");
+}
+dojo.io.cookie.setCookie(_e,_17,_10,_11,_12,_13);
+};
+dojo.io.cookie.getObjectCookie=function(_19){
+var _1a=null,_1b=dojo.io.cookie.getCookie(_19);
+if(_1b){
+_1a={};
+var _1c=_1b.split("&");
+for(var i=0;i<_1c.length;i++){
+var _1e=_1c[i].split("=");
+var _1f=_1e[1];
+if(isNaN(_1f)){
+_1f=unescape(_1e[1]);
+}
+_1a[unescape(_1e[0])]=_1f;
+}
+}
+return _1a;
+};
+dojo.io.cookie.isSupported=function(){
+if(typeof navigator.cookieEnabled!="boolean"){
+dojo.io.cookie.setCookie("__TestingYourBrowserForCookieSupport__","CookiesAllowed",90,null);
+var _20=dojo.io.cookie.getCookie("__TestingYourBrowserForCookieSupport__");
+navigator.cookieEnabled=(_20=="CookiesAllowed");
+if(navigator.cookieEnabled){
+this.deleteCookie("__TestingYourBrowserForCookieSupport__");
+}
+}
+return navigator.cookieEnabled;
+};
+if(!dojo.io.cookies){
+dojo.io.cookies=dojo.io.cookie;
+}
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cookie.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cookie.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/cookie.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_client.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_client.html?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_client.html (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_client.html Sat May 26 15:47:41 2007
@@ -0,0 +1,267 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
+ <!-- Security protection: uncomment the script tag to enable. -->
+ <!-- script type="text/javascript" -->
+ // <!--
+ /*
+ This file is really focused on just sending one message to the server, and
+ receiving one response. The code does not expect to be re-used for multiple messages.
+ This might be reworked later if performance indicates a need for it.
+
+ xip fragment identifier/hash values have the form:
+ #id:cmd:realEncodedMessage
+
+ id: some ID that should be unique among messages. No inherent meaning,
+ just something to make sure the hash value is unique so the message
+ receiver knows a new message is available.
+
+ cmd: command to the receiver. Valid values are:
+ - init: message used to init the frame. Sent as the first URL when loading
+ the page. Contains some config parameters.
+ - loaded: the remote frame is loaded. Only sent from server to client.
+ - ok: the message that this page sent was received OK. The next message may
+ now be sent.
+ - start: the start message of a block of messages (a complete message may
+ need to be segmented into many messages to get around the limitiations
+ of the size of an URL that a browser accepts.
+ - part: indicates this is a part of a message.
+ - end: the end message of a block of messages. The message can now be acted upon.
+ If the message is small enough that it doesn't need to be segmented, then
+ just one hash value message can be sent with "end" as the command.
+
+ To reassemble a segmented message, the realEncodedMessage parts just have to be concatenated
+ together.
+ */
+
+ //MSIE has the lowest limit for URLs with fragment identifiers,
+ //at around 4K. Choosing a slightly smaller number for good measure.
+ xipUrlLimit = 4000;
+ xipIdCounter = 1;
+
+ function xipInit(){
+ xipStateId = "";
+ xipIsSending = false;
+ xipServerUrl = null;
+ xipStateId = null;
+ xipRequestData = null;
+ xipCurrentHash = "";
+ xipResponseMessage = "";
+ xipRequestParts = [];
+ xipPartIndex = 0;
+ xipServerWindow = null;
+ xipUseFrameRecursion = false;
+ }
+ xipInit();
+
+ function send(encodedData){
+ if(xipUseFrameRecursion == "true"){
+ var clientEndPoint = window.open(xipStateId + "_clientEndPoint");
+ clientEndPoint.send(encodedData);
+ }else{
+ if(!xipIsSending){
+ xipIsSending = true;
+
+ xipRequestData = encodedData || "";
+
+ //Get a handle to the server iframe.
+ xipServerWindow = frames[xipStateId + "_frame"];
+ if (!xipServerWindow){
+ xipServerWindow = document.getElementById(xipStateId + "_frame").contentWindow;
+ }
+
+ sendRequestStart();
+ }
+ }
+ }
+
+ //Modify the server URL if it is a local path and
+ //This is done for local/same domain testing.
+ function fixServerUrl(ifpServerUrl){
+ if(ifpServerUrl.indexOf("..") == 0){
+ var parts = ifpServerUrl.split("/");
+ ifpServerUrl = parts[parts.length - 1];
+ }
+ return ifpServerUrl;
+ }
+
+
+ function pollHash(){
+ //Can't use location.hash because at least Firefox does a decodeURIComponent on it.
+ var urlParts = window.location.href.split("#");
+ if(urlParts.length == 2){
+ var newHash = urlParts[1];
+ if(newHash != xipCurrentHash){
+ try{
+ messageReceived(newHash);
+ }catch(e){
+ //Make sure to not keep processing the error hash value.
+ xipCurrentHash = newHash;
+ throw e;
+ }
+ xipCurrentHash = newHash;
+ }
+ }
+ }
+
+ function messageReceived(encodedData){
+ var msg = unpackMessage(encodedData);
+
+ switch(msg.command){
+ case "loaded":
+ xipMasterFrame.dojo.io.XhrIframeProxy.clientFrameLoaded(xipStateId);
+ break;
+ case "ok":
+ sendRequestPart();
+ break;
+ case "start":
+ xipResponseMessage = "";
+ xipResponseMessage += msg.message;
+ setServerUrl("ok");
+ break;
+ case "part":
+ xipResponseMessage += msg.message;
+ setServerUrl("ok");
+ break;
+ case "end":
+ setServerUrl("ok");
+ xipResponseMessage += msg.message;
+ xipMasterFrame.dojo.io.XhrIframeProxy.receive(xipStateId, xipResponseMessage);
+ break;
+ }
+ }
+
+ function sendRequestStart(){
+ //Break the message into parts, if necessary.
+ xipRequestParts = [];
+ var reqData = xipRequestData;
+ var urlLength = xipServerUrl.length;
+ var partLength = xipUrlLimit - urlLength;
+ var reqIndex = 0;
+
+ while((reqData.length - reqIndex) + urlLength > xipUrlLimit){
+ var part = reqData.substring(reqIndex, reqIndex + partLength);
+ //Safari will do some extra hex escaping unless we keep the original hex
+ //escaping complete.
+ var percentIndex = part.lastIndexOf("%");
+ if(percentIndex == part.length - 1 || percentIndex == part.length - 2){
+ part = part.substring(0, percentIndex);
+ }
+ xipRequestParts.push(part);
+ reqIndex += part.length;
+ }
+ xipRequestParts.push(reqData.substring(reqIndex, reqData.length));
+
+ xipPartIndex = 0;
+ sendRequestPart();
+
+ }
+
+ function sendRequestPart(){
+ if(xipPartIndex < xipRequestParts.length){
+ //Get the message part.
+ var partData = xipRequestParts[xipPartIndex];
+
+ //Get the command.
+ var cmd = "part";
+ if(xipPartIndex + 1 == xipRequestParts.length){
+ cmd = "end";
+ }else if (xipPartIndex == 0){
+ cmd = "start";
+ }
+
+ setServerUrl(cmd, partData);
+ xipPartIndex++;
+ }
+ }
+
+ function setServerUrl(cmd, message){
+ var serverUrl = makeServerUrl(cmd, message);
+
+ //Safari won't let us replace across domains.
+ if(navigator.userAgent.indexOf("Safari") == -1){
+ xipServerWindow.location.replace(serverUrl);
+ }else{
+ xipServerWindow.location = serverUrl;
+ }
+ }
+
+ function makeServerUrl(cmd, message){
+ var serverUrl = xipServerUrl + "#" + (xipIdCounter++) + ":" + cmd;
+ if(message){
+ serverUrl += ":" + message;
+ }
+ return serverUrl;
+ }
+
+ function unpackMessage(encodedMessage){
+ var parts = encodedMessage.split(":");
+ var command = parts[1];
+ encodedMessage = parts[2] || "";
+
+ var config = null;
+ if(command == "init"){
+ var configParts = encodedMessage.split("&");
+ config = {};
+ for(var i = 0; i < configParts.length; i++){
+ var nameValue = configParts[i].split("=");
+ config[decodeURIComponent(nameValue[0])] = decodeURIComponent(nameValue[1]);
+ }
+ }
+ return {command: command, message: encodedMessage, config: config};
+ }
+
+ function onClientLoad(){
+ //Decode the init params
+ var config = unpackMessage(window.location.href.split("#")[1]).config;
+
+ xipStateId = config.id;
+
+ //Remove the query param for the IE7 recursive case.
+ xipServerUrl = fixServerUrl(config.server).replace(/(\?|\&)dojo\.fr\=1/, "");
+
+ //Make sure we don't have a javascript: url, just for good measure.
+ if(xipServerUrl.split(":")[0].match(/javascript/i)){
+ throw "Invalid server URL";
+ }
+
+ xipUseFrameRecursion = config["fr"];
+
+ if(xipUseFrameRecursion == "endpoint"){
+ xipMasterFrame = parent.parent;
+ }else{
+ xipMasterFrame = parent;
+ }
+
+ //Start counter to inspect hash value.
+ setInterval(pollHash, 10);
+
+ var clientUrl = window.location.href.split("#")[0];
+ var iframeNode = document.getElementsByTagName("iframe")[0];
+ iframeNode.id = xipStateId + "_frame";
+ iframeNode.src = makeServerUrl("init", 'id=' + xipStateId + '&client='
+ + encodeURIComponent(clientUrl) + '&fr=' + xipUseFrameRecursion);
+ }
+
+ if(typeof(window.addEventListener) == "undefined"){
+ window.attachEvent("onload", onClientLoad);
+ }else{
+ window.addEventListener('load', onClientLoad, false);
+ }
+
+ // -->
+ </script>
+</head>
+<body>
+ <h4>The Dojo Toolkit -- xip_client.html</h4>
+
+ <p>This file is used for Dojo's XMLHttpRequest Iframe Proxy. This is the "client" file used
+ internally by dojo.io.XhrIframeProxy.</p>
+
+ <iframe src="javascript:false"></iframe>
+</body>
+</html>
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_client.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_client.html
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_client.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_server.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_server.html?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_server.html (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_server.html Sat May 26 15:47:41 2007
@@ -0,0 +1,386 @@
+<!--
+ /*
+ 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
+ */
+ Pieces taken from Dojo source to make this file stand-alone
+-->
+<html>
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
+ <script type="text/javascript" src="isAllowed.js"></script>
+ <!--
+ BY DEFAULT THIS FILE DOES NOT WORK SO THAT YOU DON'T ACCIDENTALLY EXPOSE
+ ALL OF YOUR XHR-ENABLED SERVICES ON YOUR SITE.
+
+ In order for this file to work, you need to uncomment the script element,
+ and you should define a function with the following signature:
+
+ function isAllowedRequest(request){
+ return false;
+ }
+
+ Return true out of the function if you want to allow the cross-domain request.
+
+ DON'T DEFINE THIS FUNCTION IN THIS FILE! Define it in a separate file called isAllowed.js
+ and include it in this page with a script tag that has a src attribute pointing to the file.
+ See the very first script tag in this file for an example. You do not have to place the
+ script file in the same directory as this file, just update the path above if you move it
+ somewhere else.
+
+ Customize the isAllowedRequest function to restrict what types of requests are allowed
+ for this server. The request object has the following properties:
+ - requestHeaders: an object with the request headers that are to be added to
+ the XHR request.
+ - method: the HTTP method (GET, POST, etc...)
+ - uri: The URI for the request.
+ - data: The URL-encoded data for the request. For a GET request, this would
+ be the querystring parameters. For a POST request, it wll be the
+ body data.
+
+ See xip_client.html for more info on the xip fragment identifier protocol.
+ -->
+
+ <!-- Security protection: uncomment the script tag to enable. -->
+ <!-- script type="text/javascript" -->
+ // <!--
+ //Core XHR handling taken from Dojo IO code.
+ dojo = {};
+ dojo.hostenv = {};
+ // These are in order of decreasing likelihood; this will change in time.
+ dojo.hostenv._XMLHTTP_PROGIDS = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
+
+ dojo.hostenv.getXmlhttpObject = function(){
+ var http = null;
+ var last_e = null;
+ try{ http = new XMLHttpRequest(); }catch(e){}
+ if(!http){
+ for(var i=0; i<3; ++i){
+ var progid = dojo.hostenv._XMLHTTP_PROGIDS[i];
+ try{
+ http = new ActiveXObject(progid);
+ }catch(e){
+ last_e = e;
+ }
+
+ if(http){
+ dojo.hostenv._XMLHTTP_PROGIDS = [progid]; // so faster next time
+ break;
+ }
+ }
+
+ /*if(http && !http.toString) {
+ http.toString = function() { "[object XMLHttpRequest]"; }
+ }*/
+ }
+
+ if(!http){
+ throw "xip_server.html: XMLHTTP not available: " + last_e;
+ }
+
+ return http;
+ }
+
+ dojo.setHeaders = function(http, headers){
+ if(headers) {
+ for(var header in headers) {
+ var headerValue = headers[header];
+ http.setRequestHeader(header, headerValue);
+ }
+ }
+ }
+
+ //MSIE has the lowest limit for URLs with fragment identifiers,
+ //at around 4K. Choosing a slightly smaller number for good measure.
+ xipUrlLimit = 4000;
+ xipIdCounter = 1;
+
+ function xipServerInit(){
+ xipStateId = "";
+ xipCurrentHash = "";
+ xipRequestMessage = "";
+ xipResponseParts = [];
+ xipPartIndex = 0;
+ }
+
+ function pollHash(){
+ //Can't use location.hash because at least Firefox does a decodeURIComponent on it.
+ var urlParts = window.location.href.split("#");
+ if(urlParts.length == 2){
+ var newHash = urlParts[1];
+ if(newHash != xipCurrentHash){
+ try{
+ messageReceived(newHash);
+ }catch(e){
+ //Make sure to not keep processing the error hash value.
+ xipCurrentHash = newHash;
+ throw e;
+ }
+ xipCurrentHash = newHash;
+ }
+ }
+ }
+
+ function messageReceived(encodedData){
+ var msg = unpackMessage(encodedData);
+
+ switch(msg.command){
+ case "ok":
+ sendResponsePart();
+ break;
+ case "start":
+ xipRequestMessage = "";
+ xipRequestMessage += msg.message;
+ setClientUrl("ok");
+ break;
+ case "part":
+ xipRequestMessage += msg.message;
+ setClientUrl("ok");
+ break;
+ case "end":
+ setClientUrl("ok");
+ xipRequestMessage += msg.message;
+ sendXhr();
+ break;
+ }
+ }
+
+ function sendResponse(encodedData){
+ //Break the message into parts, if necessary.
+ xipResponseParts = [];
+ var resData = encodedData;
+ var urlLength = xipClientUrl.length;
+ var partLength = xipUrlLimit - urlLength;
+ var resIndex = 0;
+
+ while((resData.length - resIndex) + urlLength > xipUrlLimit){
+ var part = resData.substring(resIndex, resIndex + partLength);
+ //Safari will do some extra hex escaping unless we keep the original hex
+ //escaping complete.
+ var percentIndex = part.lastIndexOf("%");
+ if(percentIndex == part.length - 1 || percentIndex == part.length - 2){
+ part = part.substring(0, percentIndex);
+ }
+ xipResponseParts.push(part);
+ resIndex += part.length;
+ }
+ xipResponseParts.push(resData.substring(resIndex, resData.length));
+
+ xipPartIndex = 0;
+ sendResponsePart();
+ }
+
+ function sendResponsePart(){
+ if(xipPartIndex < xipResponseParts.length){
+ //Get the message part.
+ var partData = xipResponseParts[xipPartIndex];
+
+ //Get the command.
+ var cmd = "part";
+ if(xipPartIndex + 1 == xipResponseParts.length){
+ cmd = "end";
+ }else if (xipPartIndex == 0){
+ cmd = "start";
+ }
+
+ setClientUrl(cmd, partData);
+ xipPartIndex++;
+ }else{
+ xipServerInit();
+ }
+ }
+
+ function setClientUrl(cmd, message){
+ var clientUrl = makeClientUrl(cmd, message);
+ //Safari won't let us replace across domains.
+ if(navigator.userAgent.indexOf("Safari") == -1){
+ parent.location.replace(clientUrl);
+ }else{
+ parent.location = clientUrl;
+ }
+ }
+
+ function makeClientUrl(cmd, message){
+ var clientUrl = xipClientUrl + "#" + (xipIdCounter++) + ":" + cmd;
+ if(message){
+ clientUrl += ":" + message;
+ }
+ return clientUrl
+ }
+
+ function xhrDone(xhr){
+ /* Need to pull off and return the following data:
+ - responseHeaders
+ - status
+ - statusText
+ - responseText
+ */
+ var response = {};
+
+ if(typeof(xhr.getAllResponseHeaders) != "undefined"){
+ var allHeaders = xhr.getAllResponseHeaders();
+ if(allHeaders){
+ response.responseHeaders = allHeaders;
+ }
+ }
+
+ if(xhr.status == 0 || xhr.status){
+ response.status = xhr.status;
+ }
+
+ if(xhr.statusText){
+ response.statusText = xhr.statusText;
+ }
+
+ if(xhr.responseText){
+ response.responseText = xhr.responseText;
+ }
+
+ //Build a string of the response object.
+ var result = "";
+ var isFirst = true;
+ for (var param in response){
+ if(isFirst){
+ isFirst = false;
+ }else{
+ result += "&";
+ }
+ result += param + "=" + encodeURIComponent(response[param]);
+ }
+ sendResponse(result);
+ }
+
+ function sendXhr(){
+ var request = {};
+ var nvPairs = xipRequestMessage.split("&");
+ var i = 0;
+ var nameValue = null;
+ for(i = 0; i < nvPairs.length; i++){
+ if(nvPairs[i]){
+ var nameValue = nvPairs[i].split("=");
+ request[decodeURIComponent(nameValue[0])] = decodeURIComponent(nameValue[1]);
+ }
+ }
+
+ //Split up the request headers, if any.
+ var headers = {};
+ if(request.requestHeaders){
+ nvPairs = request.requestHeaders.split("\r\n");
+ for(i = 0; i < nvPairs.length; i++){
+ if(nvPairs[i]){
+ nameValue = nvPairs[i].split(": ");
+ headers[decodeURIComponent(nameValue[0])] = decodeURIComponent(nameValue[1]);
+ }
+ }
+
+ request.requestHeaders = headers;
+ }
+
+ if(isAllowedRequest(request)){
+
+ //The request is allowed, so set up the XHR object.
+ var xhr = dojo.hostenv.getXmlhttpObject();
+
+ //Start timer to look for readyState.
+ var xhrIntervalId = setInterval(function(){
+
+ if(xhr.readyState == 4){
+ clearInterval(xhrIntervalId);
+ xhrDone(xhr);
+ }
+ }, 10);
+
+ //Actually start up the XHR request.
+ xhr.open(request.method, request.uri, true);
+ dojo.setHeaders(xhr, request.requestHeaders);
+
+ var content = "";
+ if(request.data){
+ content = request.data;
+ }
+
+ try{
+ xhr.send(content);
+ }catch(e){
+ if(typeof xhr.abort == "function"){
+ xhr.abort();
+ xhrDone({status: 404, statusText: "xip_server.html error: " + e});
+ }
+ }
+ }
+ }
+
+ function unpackMessage(encodedMessage){
+ var parts = encodedMessage.split(":");
+ var command = parts[1];
+ encodedMessage = parts[2] || "";
+
+ var config = null;
+ if(command == "init"){
+ var configParts = encodedMessage.split("&");
+ config = {};
+ for(var i = 0; i < configParts.length; i++){
+ var nameValue = configParts[i].split("=");
+ config[decodeURIComponent(nameValue[0])] = decodeURIComponent(nameValue[1]);
+ }
+ }
+ return {command: command, message: encodedMessage, config: config};
+ }
+
+ function onServerLoad(){
+ xipServerInit();
+
+ //Decode the init params
+ var config = unpackMessage(window.location.href.split("#")[1]).config;
+
+ xipStateId = config.id;
+ xipClientUrl = config.client;
+
+ //Make sure we don't have a javascript: url, just for good measure.
+ if(xipClientUrl.split(":")[0].match(/javascript/i)){
+ throw "Invalid client URL";
+ }
+ if(!xipStateId.match(/^XhrIframeProxy[0-9]+$/)){
+ throw "Invalid state ID";
+ }
+
+ xipUseFrameRecursion = config["fr"];
+
+ setInterval(pollHash, 10);
+
+ if(xipUseFrameRecursion == "true"){
+ var serverUrl = window.location.href.split("#")[0];
+ document.getElementById("iframeHolder").innerHTML = '<iframe name="'
+ + xipStateId + '_clientEndPoint'
+ + '" src="javascript:false">'
+ + '</iframe>';
+ var iframeNode = document.getElementsByTagName("iframe")[0];
+ iframeNode.src = makeClientUrl("init", 'id=' + xipStateId + '&server='
+ + encodeURIComponent(serverUrl) + '&fr=endpoint');
+ }else{
+ setClientUrl("loaded");
+ }
+ }
+
+ if(typeof(window.addEventListener) == "undefined"){
+ window.attachEvent("onload", onServerLoad);
+ }else{
+ window.addEventListener('load', onServerLoad, false);
+ }
+ // -->
+ </script>
+</head>
+<body>
+ <h4>The Dojo Toolkit -- xip_server.html</h4>
+
+ <p>This file is used for Dojo's XMLHttpRequest Iframe Proxy. This is the the file
+ that should go on the server that will actually be doing the XHR request.</p>
+ <div id="iframeHolder"></div>
+</body>
+</html>
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_server.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_server.html
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/io/xip_server.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/json.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/json.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/json.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/json.js Sat May 26 15:47:41 2007
@@ -0,0 +1,85 @@
+dojo.provide("dojo.json");
+dojo.require("dojo.lang.func");
+dojo.require("dojo.string.extras");
+dojo.require("dojo.AdapterRegistry");
+dojo.json={jsonRegistry:new dojo.AdapterRegistry(),register:function(_1,_2,_3,_4){
+dojo.json.jsonRegistry.register(_1,_2,_3,_4);
+},evalJson:function(_5){
+try{
+return eval("("+_5+")");
+}
+catch(e){
+dojo.debug(e);
+return _5;
+}
+},serialize:function(o){
+var _7=typeof (o);
+if(_7=="undefined"){
+return "undefined";
+}else{
+if((_7=="number")||(_7=="boolean")){
+return o+"";
+}else{
+if(o===null){
+return "null";
+}
+}
+}
+if(_7=="string"){
+return dojo.string.escapeString(o);
+}
+var me=arguments.callee;
+var _9;
+if(typeof (o.__json__)=="function"){
+_9=o.__json__();
+if(o!==_9){
+return me(_9);
+}
+}
+if(typeof (o.json)=="function"){
+_9=o.json();
+if(o!==_9){
+return me(_9);
+}
+}
+if(_7!="function"&&typeof (o.length)=="number"){
+var _a=[];
+for(var i=0;i<o.length;i++){
+var _c=me(o[i]);
+if(typeof (_c)!="string"){
+_c="undefined";
+}
+_a.push(_c);
+}
+return "["+_a.join(",")+"]";
+}
+try{
+window.o=o;
+_9=dojo.json.jsonRegistry.match(o);
+return me(_9);
+}
+catch(e){
+}
+if(_7=="function"){
+return null;
+}
+_a=[];
+for(var k in o){
+var _e;
+if(typeof (k)=="number"){
+_e="\""+k+"\"";
+}else{
+if(typeof (k)=="string"){
+_e=dojo.string.escapeString(k);
+}else{
+continue;
+}
+}
+_c=me(o[k]);
+if(typeof (_c)!="string"){
+continue;
+}
+_a.push(_e+":"+_c);
+}
+return "{"+_a.join(",")+"}";
+}};
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/json.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/json.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/json.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang.js Sat May 26 15:47:41 2007
@@ -0,0 +1,3 @@
+dojo.provide("dojo.lang");
+dojo.require("dojo.lang.common");
+dojo.deprecated("dojo.lang","replaced by dojo.lang.common","0.5");
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/__package__.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/__package__.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/__package__.js Sat May 26 15:47:41 2007
@@ -0,0 +1,2 @@
+dojo.kwCompoundRequire({common:["dojo.lang.common","dojo.lang.assert","dojo.lang.array","dojo.lang.type","dojo.lang.func","dojo.lang.extras","dojo.lang.repr","dojo.lang.declare"]});
+dojo.provide("dojo.lang.*");
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/__package__.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/__package__.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/__package__.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/array.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/array.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/array.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/array.js Sat May 26 15:47:41 2007
@@ -0,0 +1,163 @@
+dojo.provide("dojo.lang.array");
+dojo.require("dojo.lang.common");
+dojo.lang.mixin(dojo.lang,{has:function(_1,_2){
+try{
+return typeof _1[_2]!="undefined";
+}
+catch(e){
+return false;
+}
+},isEmpty:function(_3){
+if(dojo.lang.isObject(_3)){
+var _4={};
+var _5=0;
+for(var x in _3){
+if(_3[x]&&(!_4[x])){
+_5++;
+break;
+}
+}
+return _5==0;
+}else{
+if(dojo.lang.isArrayLike(_3)||dojo.lang.isString(_3)){
+return _3.length==0;
+}
+}
+},map:function(_7,_8,_9){
+var _a=dojo.lang.isString(_7);
+if(_a){
+_7=_7.split("");
+}
+if(dojo.lang.isFunction(_8)&&(!_9)){
+_9=_8;
+_8=dj_global;
+}else{
+if(dojo.lang.isFunction(_8)&&_9){
+var _b=_8;
+_8=_9;
+_9=_b;
+}
+}
+if(Array.map){
+var _c=Array.map(_7,_9,_8);
+}else{
+var _c=[];
+for(var i=0;i<_7.length;++i){
+_c.push(_9.call(_8,_7[i]));
+}
+}
+if(_a){
+return _c.join("");
+}else{
+return _c;
+}
+},reduce:function(_e,_f,obj,_11){
+var _12=_f;
+if(arguments.length==2){
+_11=_f;
+_12=_e[0];
+_e=_e.slice(1);
+}else{
+if(arguments.length==3){
+if(dojo.lang.isFunction(obj)){
+_11=obj;
+obj=null;
+}
+}else{
+if(dojo.lang.isFunction(obj)){
+var tmp=_11;
+_11=obj;
+obj=tmp;
+}
+}
+}
+var ob=obj||dj_global;
+dojo.lang.map(_e,function(val){
+_12=_11.call(ob,_12,val);
+});
+return _12;
+},forEach:function(_16,_17,_18){
+if(dojo.lang.isString(_16)){
+_16=_16.split("");
+}
+if(Array.forEach){
+Array.forEach(_16,_17,_18);
+}else{
+if(!_18){
+_18=dj_global;
+}
+for(var i=0,l=_16.length;i<l;i++){
+_17.call(_18,_16[i],i,_16);
+}
+}
+},_everyOrSome:function(_1b,arr,_1d,_1e){
+if(dojo.lang.isString(arr)){
+arr=arr.split("");
+}
+if(Array.every){
+return Array[_1b?"every":"some"](arr,_1d,_1e);
+}else{
+if(!_1e){
+_1e=dj_global;
+}
+for(var i=0,l=arr.length;i<l;i++){
+var _21=_1d.call(_1e,arr[i],i,arr);
+if(_1b&&!_21){
+return false;
+}else{
+if((!_1b)&&(_21)){
+return true;
+}
+}
+}
+return Boolean(_1b);
+}
+},every:function(arr,_23,_24){
+return this._everyOrSome(true,arr,_23,_24);
+},some:function(arr,_26,_27){
+return this._everyOrSome(false,arr,_26,_27);
+},filter:function(arr,_29,_2a){
+var _2b=dojo.lang.isString(arr);
+if(_2b){
+arr=arr.split("");
+}
+var _2c;
+if(Array.filter){
+_2c=Array.filter(arr,_29,_2a);
+}else{
+if(!_2a){
+if(arguments.length>=3){
+dojo.raise("thisObject doesn't exist!");
+}
+_2a=dj_global;
+}
+_2c=[];
+for(var i=0;i<arr.length;i++){
+if(_29.call(_2a,arr[i],i,arr)){
+_2c.push(arr[i]);
+}
+}
+}
+if(_2b){
+return _2c.join("");
+}else{
+return _2c;
+}
+},unnest:function(){
+var out=[];
+for(var i=0;i<arguments.length;i++){
+if(dojo.lang.isArrayLike(arguments[i])){
+var add=dojo.lang.unnest.apply(this,arguments[i]);
+out=out.concat(add);
+}else{
+out.push(arguments[i]);
+}
+}
+return out;
+},toArray:function(_31,_32){
+var _33=[];
+for(var i=_32||0;i<_31.length;i++){
+_33.push(_31[i]);
+}
+return _33;
+}});
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/array.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/array.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/array.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/assert.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/assert.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/assert.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/assert.js Sat May 26 15:47:41 2007
@@ -0,0 +1,46 @@
+dojo.provide("dojo.lang.assert");
+dojo.require("dojo.lang.common");
+dojo.require("dojo.lang.array");
+dojo.require("dojo.lang.type");
+dojo.lang.assert=function(_1,_2){
+if(!_1){
+var _3="An assert statement failed.\n"+"The method dojo.lang.assert() was called with a 'false' value.\n";
+if(_2){
+_3+="Here's the assert message:\n"+_2+"\n";
+}
+throw new Error(_3);
+}
+};
+dojo.lang.assertType=function(_4,_5,_6){
+if(dojo.lang.isString(_6)){
+dojo.deprecated("dojo.lang.assertType(value, type, \"message\")","use dojo.lang.assertType(value, type) instead","0.5");
+}
+if(!dojo.lang.isOfType(_4,_5,_6)){
+if(!dojo.lang.assertType._errorMessage){
+dojo.lang.assertType._errorMessage="Type mismatch: dojo.lang.assertType() failed.";
+}
+dojo.lang.assert(false,dojo.lang.assertType._errorMessage);
+}
+};
+dojo.lang.assertValidKeywords=function(_7,_8,_9){
+var _a;
+if(!_9){
+if(!dojo.lang.assertValidKeywords._errorMessage){
+dojo.lang.assertValidKeywords._errorMessage="In dojo.lang.assertValidKeywords(), found invalid keyword:";
+}
+_9=dojo.lang.assertValidKeywords._errorMessage;
+}
+if(dojo.lang.isArray(_8)){
+for(_a in _7){
+if(!dojo.lang.inArray(_8,_a)){
+dojo.lang.assert(false,_9+" "+_a);
+}
+}
+}else{
+for(_a in _7){
+if(!(_a in _8)){
+dojo.lang.assert(false,_9+" "+_a);
+}
+}
+}
+};
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/assert.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/assert.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/assert.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/common.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/common.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/common.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/common.js Sat May 26 15:47:41 2007
@@ -0,0 +1,143 @@
+dojo.provide("dojo.lang.common");
+dojo.lang.inherits=function(_1,_2){
+if(!dojo.lang.isFunction(_2)){
+dojo.raise("dojo.inherits: superclass argument ["+_2+"] must be a function (subclass: ["+_1+"']");
+}
+_1.prototype=new _2();
+_1.prototype.constructor=_1;
+_1.superclass=_2.prototype;
+_1["super"]=_2.prototype;
+};
+dojo.lang._mixin=function(_3,_4){
+var _5={};
+for(var x in _4){
+if((typeof _5[x]=="undefined")||(_5[x]!=_4[x])){
+_3[x]=_4[x];
+}
+}
+if(dojo.render.html.ie&&(typeof (_4["toString"])=="function")&&(_4["toString"]!=_3["toString"])&&(_4["toString"]!=_5["toString"])){
+_3.toString=_4.toString;
+}
+return _3;
+};
+dojo.lang.mixin=function(_7,_8){
+for(var i=1,l=arguments.length;i<l;i++){
+dojo.lang._mixin(_7,arguments[i]);
+}
+return _7;
+};
+dojo.lang.extend=function(_b,_c){
+for(var i=1,l=arguments.length;i<l;i++){
+dojo.lang._mixin(_b.prototype,arguments[i]);
+}
+return _b;
+};
+dojo.inherits=dojo.lang.inherits;
+dojo.mixin=dojo.lang.mixin;
+dojo.extend=dojo.lang.extend;
+dojo.lang.find=function(_f,_10,_11,_12){
+if(!dojo.lang.isArrayLike(_f)&&dojo.lang.isArrayLike(_10)){
+dojo.deprecated("dojo.lang.find(value, array)","use dojo.lang.find(array, value) instead","0.5");
+var _13=_f;
+_f=_10;
+_10=_13;
+}
+var _14=dojo.lang.isString(_f);
+if(_14){
+_f=_f.split("");
+}
+if(_12){
+var _15=-1;
+var i=_f.length-1;
+var end=-1;
+}else{
+var _15=1;
+var i=0;
+var end=_f.length;
+}
+if(_11){
+while(i!=end){
+if(_f[i]===_10){
+return i;
+}
+i+=_15;
+}
+}else{
+while(i!=end){
+if(_f[i]==_10){
+return i;
+}
+i+=_15;
+}
+}
+return -1;
+};
+dojo.lang.indexOf=dojo.lang.find;
+dojo.lang.findLast=function(_18,_19,_1a){
+return dojo.lang.find(_18,_19,_1a,true);
+};
+dojo.lang.lastIndexOf=dojo.lang.findLast;
+dojo.lang.inArray=function(_1b,_1c){
+return dojo.lang.find(_1b,_1c)>-1;
+};
+dojo.lang.isObject=function(it){
+if(typeof it=="undefined"){
+return false;
+}
+return (typeof it=="object"||it===null||dojo.lang.isArray(it)||dojo.lang.isFunction(it));
+};
+dojo.lang.isArray=function(it){
+return (it&&it instanceof Array||typeof it=="array");
+};
+dojo.lang.isArrayLike=function(it){
+if((!it)||(dojo.lang.isUndefined(it))){
+return false;
+}
+if(dojo.lang.isString(it)){
+return false;
+}
+if(dojo.lang.isFunction(it)){
+return false;
+}
+if(dojo.lang.isArray(it)){
+return true;
+}
+if((it.tagName)&&(it.tagName.toLowerCase()=="form")){
+return false;
+}
+if(dojo.lang.isNumber(it.length)&&isFinite(it.length)){
+return true;
+}
+return false;
+};
+dojo.lang.isFunction=function(it){
+return (it instanceof Function||typeof it=="function");
+};
+(function(){
+if((dojo.render.html.capable)&&(dojo.render.html["safari"])){
+dojo.lang.isFunction=function(it){
+if((typeof (it)=="function")&&(it=="[object NodeList]")){
+return false;
+}
+return (it instanceof Function||typeof it=="function");
+};
+}
+})();
+dojo.lang.isString=function(it){
+return (typeof it=="string"||it instanceof String);
+};
+dojo.lang.isAlien=function(it){
+if(!it){
+return false;
+}
+return !dojo.lang.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));
+};
+dojo.lang.isBoolean=function(it){
+return (it instanceof Boolean||typeof it=="boolean");
+};
+dojo.lang.isNumber=function(it){
+return (it instanceof Number||typeof it=="number");
+};
+dojo.lang.isUndefined=function(it){
+return ((typeof (it)=="undefined")&&(it==undefined));
+};
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/common.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/common.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/common.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/declare.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/declare.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/declare.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/declare.js Sat May 26 15:47:41 2007
@@ -0,0 +1,96 @@
+dojo.provide("dojo.lang.declare");
+dojo.require("dojo.lang.common");
+dojo.require("dojo.lang.extras");
+dojo.lang.declare=function(_1,_2,_3,_4){
+if((dojo.lang.isFunction(_4))||((!_4)&&(!dojo.lang.isFunction(_3)))){
+var _5=_4;
+_4=_3;
+_3=_5;
+}
+var _6=[];
+if(dojo.lang.isArray(_2)){
+_6=_2;
+_2=_6.shift();
+}
+if(!_3){
+_3=dojo.evalObjPath(_1,false);
+if((_3)&&(!dojo.lang.isFunction(_3))){
+_3=null;
+}
+}
+var _7=dojo.lang.declare._makeConstructor();
+var _8=(_2?_2.prototype:null);
+if(_8){
+_8.prototyping=true;
+_7.prototype=new _2();
+_8.prototyping=false;
+}
+_7.superclass=_8;
+_7.mixins=_6;
+for(var i=0,l=_6.length;i<l;i++){
+dojo.lang.extend(_7,_6[i].prototype);
+}
+_7.prototype.initializer=null;
+_7.prototype.declaredClass=_1;
+if(dojo.lang.isArray(_4)){
+dojo.lang.extend.apply(dojo.lang,[_7].concat(_4));
+}else{
+dojo.lang.extend(_7,(_4)||{});
+}
+dojo.lang.extend(_7,dojo.lang.declare._common);
+_7.prototype.constructor=_7;
+_7.prototype.initializer=(_7.prototype.initializer)||(_3)||(function(){
+});
+var _b=dojo.parseObjPath(_1,null,true);
+_b.obj[_b.prop]=_7;
+return _7;
+};
+dojo.lang.declare._makeConstructor=function(){
+return function(){
+var _c=this._getPropContext();
+var s=_c.constructor.superclass;
+if((s)&&(s.constructor)){
+if(s.constructor==arguments.callee){
+this._inherited("constructor",arguments);
+}else{
+this._contextMethod(s,"constructor",arguments);
+}
+}
+var ms=(_c.constructor.mixins)||([]);
+for(var i=0,m;(m=ms[i]);i++){
+(((m.prototype)&&(m.prototype.initializer))||(m)).apply(this,arguments);
+}
+if((!this.prototyping)&&(_c.initializer)){
+_c.initializer.apply(this,arguments);
+}
+};
+};
+dojo.lang.declare._common={_getPropContext:function(){
+return (this.___proto||this);
+},_contextMethod:function(_11,_12,_13){
+var _14,_15=this.___proto;
+this.___proto=_11;
+try{
+_14=_11[_12].apply(this,(_13||[]));
+}
+catch(e){
+throw e;
+}
+finally{
+this.___proto=_15;
+}
+return _14;
+},_inherited:function(_16,_17){
+var p=this._getPropContext();
+do{
+if((!p.constructor)||(!p.constructor.superclass)){
+return;
+}
+p=p.constructor.superclass;
+}while(!(_16 in p));
+return (dojo.lang.isFunction(p[_16])?this._contextMethod(p,_16,_17):p[_16]);
+},inherited:function(_19,_1a){
+dojo.deprecated("'inherited' method is dangerous, do not up-call! 'inherited' is slated for removal in 0.5; name your super class (or use superclass property) instead.","0.5");
+this._inherited(_19,_1a);
+}};
+dojo.declare=dojo.lang.declare;
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/declare.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/declare.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/declare.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/extras.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/extras.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/extras.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/extras.js Sat May 26 15:47:41 2007
@@ -0,0 +1,83 @@
+dojo.provide("dojo.lang.extras");
+dojo.require("dojo.lang.common");
+dojo.lang.setTimeout=function(_1,_2){
+var _3=window,_4=2;
+if(!dojo.lang.isFunction(_1)){
+_3=_1;
+_1=_2;
+_2=arguments[2];
+_4++;
+}
+if(dojo.lang.isString(_1)){
+_1=_3[_1];
+}
+var _5=[];
+for(var i=_4;i<arguments.length;i++){
+_5.push(arguments[i]);
+}
+return dojo.global().setTimeout(function(){
+_1.apply(_3,_5);
+},_2);
+};
+dojo.lang.clearTimeout=function(_7){
+dojo.global().clearTimeout(_7);
+};
+dojo.lang.getNameInObj=function(ns,_9){
+if(!ns){
+ns=dj_global;
+}
+for(var x in ns){
+if(ns[x]===_9){
+return new String(x);
+}
+}
+return null;
+};
+dojo.lang.shallowCopy=function(_b,_c){
+var i,_e;
+if(_b===null){
+return null;
+}
+if(dojo.lang.isObject(_b)){
+_e=new _b.constructor();
+for(i in _b){
+if(dojo.lang.isUndefined(_e[i])){
+_e[i]=_c?dojo.lang.shallowCopy(_b[i],_c):_b[i];
+}
+}
+}else{
+if(dojo.lang.isArray(_b)){
+_e=[];
+for(i=0;i<_b.length;i++){
+_e[i]=_c?dojo.lang.shallowCopy(_b[i],_c):_b[i];
+}
+}else{
+_e=_b;
+}
+}
+return _e;
+};
+dojo.lang.firstValued=function(){
+for(var i=0;i<arguments.length;i++){
+if(typeof arguments[i]!="undefined"){
+return arguments[i];
+}
+}
+return undefined;
+};
+dojo.lang.getObjPathValue=function(_10,_11,_12){
+with(dojo.parseObjPath(_10,_11,_12)){
+return dojo.evalProp(prop,obj,_12);
+}
+};
+dojo.lang.setObjPathValue=function(_13,_14,_15,_16){
+dojo.deprecated("dojo.lang.setObjPathValue","use dojo.parseObjPath and the '=' operator","0.6");
+if(arguments.length<4){
+_16=true;
+}
+with(dojo.parseObjPath(_13,_15,_16)){
+if(obj&&(_16||(prop in obj))){
+obj[prop]=_14;
+}
+}
+};
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/extras.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/extras.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/extras.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/func.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/func.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/func.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/func.js Sat May 26 15:47:41 2007
@@ -0,0 +1,122 @@
+dojo.provide("dojo.lang.func");
+dojo.require("dojo.lang.common");
+dojo.lang.hitch=function(_1,_2){
+var _3=[];
+for(var x=2;x<arguments.length;x++){
+_3.push(arguments[x]);
+}
+var _5=(dojo.lang.isString(_2)?_1[_2]:_2)||function(){
+};
+return function(){
+var ta=_3.concat([]);
+for(var x=0;x<arguments.length;x++){
+ta.push(arguments[x]);
+}
+return _5.apply(_1,ta);
+};
+};
+dojo.lang.anonCtr=0;
+dojo.lang.anon={};
+dojo.lang.nameAnonFunc=function(_8,_9,_a){
+var _b=(_9||dojo.lang.anon);
+if((_a)||((dj_global["djConfig"])&&(djConfig["slowAnonFuncLookups"]==true))){
+for(var x in _b){
+try{
+if(_b[x]===_8){
+return x;
+}
+}
+catch(e){
+}
+}
+}
+var _d="__"+dojo.lang.anonCtr++;
+while(typeof _b[_d]!="undefined"){
+_d="__"+dojo.lang.anonCtr++;
+}
+_b[_d]=_8;
+return _d;
+};
+dojo.lang.forward=function(_e){
+return function(){
+return this[_e].apply(this,arguments);
+};
+};
+dojo.lang.curry=function(_f,_10){
+var _11=[];
+_f=_f||dj_global;
+if(dojo.lang.isString(_10)){
+_10=_f[_10];
+}
+for(var x=2;x<arguments.length;x++){
+_11.push(arguments[x]);
+}
+var _13=(_10["__preJoinArity"]||_10.length)-_11.length;
+function gather(_14,_15,_16){
+var _17=_16;
+var _18=_15.slice(0);
+for(var x=0;x<_14.length;x++){
+_18.push(_14[x]);
+}
+_16=_16-_14.length;
+if(_16<=0){
+var res=_10.apply(_f,_18);
+_16=_17;
+return res;
+}else{
+return function(){
+return gather(arguments,_18,_16);
+};
+}
+}
+return gather([],_11,_13);
+};
+dojo.lang.curryArguments=function(_1b,_1c,_1d,_1e){
+var _1f=[];
+var x=_1e||0;
+for(x=_1e;x<_1d.length;x++){
+_1f.push(_1d[x]);
+}
+return dojo.lang.curry.apply(dojo.lang,[_1b,_1c].concat(_1f));
+};
+dojo.lang.tryThese=function(){
+for(var x=0;x<arguments.length;x++){
+try{
+if(typeof arguments[x]=="function"){
+var ret=(arguments[x]());
+if(ret){
+return ret;
+}
+}
+}
+catch(e){
+dojo.debug(e);
+}
+}
+};
+dojo.lang.delayThese=function(_23,cb,_25,_26){
+if(!_23.length){
+if(typeof _26=="function"){
+_26();
+}
+return;
+}
+if((typeof _25=="undefined")&&(typeof cb=="number")){
+_25=cb;
+cb=function(){
+};
+}else{
+if(!cb){
+cb=function(){
+};
+if(!_25){
+_25=0;
+}
+}
+}
+setTimeout(function(){
+(_23.shift())();
+cb();
+dojo.lang.delayThese(_23,cb,_25,_26);
+},_25);
+};
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/func.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/func.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/func.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/repr.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/repr.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/repr.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/repr.js Sat May 26 15:47:41 2007
@@ -0,0 +1,55 @@
+dojo.provide("dojo.lang.repr");
+dojo.require("dojo.lang.common");
+dojo.require("dojo.AdapterRegistry");
+dojo.require("dojo.string.extras");
+dojo.lang.reprRegistry=new dojo.AdapterRegistry();
+dojo.lang.registerRepr=function(_1,_2,_3,_4){
+dojo.lang.reprRegistry.register(_1,_2,_3,_4);
+};
+dojo.lang.repr=function(_5){
+if(typeof (_5)=="undefined"){
+return "undefined";
+}else{
+if(_5===null){
+return "null";
+}
+}
+try{
+if(typeof (_5["__repr__"])=="function"){
+return _5["__repr__"]();
+}else{
+if((typeof (_5["repr"])=="function")&&(_5.repr!=arguments.callee)){
+return _5["repr"]();
+}
+}
+return dojo.lang.reprRegistry.match(_5);
+}
+catch(e){
+if(typeof (_5.NAME)=="string"&&(_5.toString==Function.prototype.toString||_5.toString==Object.prototype.toString)){
+return _5.NAME;
+}
+}
+if(typeof (_5)=="function"){
+_5=(_5+"").replace(/^\s+/,"");
+var _6=_5.indexOf("{");
+if(_6!=-1){
+_5=_5.substr(0,_6)+"{...}";
+}
+}
+return _5+"";
+};
+dojo.lang.reprArrayLike=function(_7){
+try{
+var na=dojo.lang.map(_7,dojo.lang.repr);
+return "["+na.join(", ")+"]";
+}
+catch(e){
+}
+};
+(function(){
+var m=dojo.lang;
+m.registerRepr("arrayLike",m.isArrayLike,m.reprArrayLike);
+m.registerRepr("string",m.isString,m.reprString);
+m.registerRepr("numbers",m.isNumber,m.reprNumber);
+m.registerRepr("boolean",m.isBoolean,m.reprNumber);
+})();
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/repr.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/repr.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/repr.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Streamer.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Streamer.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Streamer.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Streamer.js Sat May 26 15:47:41 2007
@@ -0,0 +1,54 @@
+dojo.provide("dojo.lang.timing.Streamer");
+dojo.require("dojo.lang.timing.Timer");
+dojo.lang.timing.Streamer=function(_1,_2,_3,_4,_5){
+var _6=this;
+var _7=[];
+this.interval=_3||1000;
+this.minimumSize=_4||10;
+this.inputFunction=_1||function(q){
+};
+this.outputFunction=_2||function(_9){
+};
+var _a=new dojo.lang.timing.Timer(this.interval);
+var _b=function(){
+_6.onTick(_6);
+if(_7.length<_6.minimumSize){
+_6.inputFunction(_7);
+}
+var _c=_7.shift();
+while(typeof (_c)=="undefined"&&_7.length>0){
+_c=_7.shift();
+}
+if(typeof (_c)=="undefined"){
+_6.stop();
+return;
+}
+_6.outputFunction(_c);
+};
+this.setInterval=function(ms){
+this.interval=ms;
+_a.setInterval(ms);
+};
+this.onTick=function(_e){
+};
+this.start=function(){
+if(typeof (this.inputFunction)=="function"&&typeof (this.outputFunction)=="function"){
+_a.start();
+return;
+}
+dojo.raise("You cannot start a Streamer without an input and an output function.");
+};
+this.onStart=function(){
+};
+this.stop=function(){
+_a.stop();
+};
+this.onStop=function(){
+};
+_a.onTick=this.tick;
+_a.onStart=this.onStart;
+_a.onStop=this.onStop;
+if(_5){
+_7.concat(_5);
+}
+};
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Streamer.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Streamer.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Streamer.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Timer.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Timer.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Timer.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Timer.js Sat May 26 15:47:41 2007
@@ -0,0 +1,31 @@
+dojo.provide("dojo.lang.timing.Timer");
+dojo.require("dojo.lang.func");
+dojo.lang.timing.Timer=function(_1){
+this.timer=null;
+this.isRunning=false;
+this.interval=_1;
+this.onStart=null;
+this.onStop=null;
+};
+dojo.extend(dojo.lang.timing.Timer,{onTick:function(){
+},setInterval:function(_2){
+if(this.isRunning){
+dj_global.clearInterval(this.timer);
+}
+this.interval=_2;
+if(this.isRunning){
+this.timer=dj_global.setInterval(dojo.lang.hitch(this,"onTick"),this.interval);
+}
+},start:function(){
+if(typeof this.onStart=="function"){
+this.onStart();
+}
+this.isRunning=true;
+this.timer=dj_global.setInterval(dojo.lang.hitch(this,"onTick"),this.interval);
+},stop:function(){
+if(typeof this.onStop=="function"){
+this.onStop();
+}
+this.isRunning=false;
+dj_global.clearInterval(this.timer);
+}});
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Timer.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Timer.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/Timer.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/__package__.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/__package__.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/__package__.js Sat May 26 15:47:41 2007
@@ -0,0 +1 @@
+dojo.provide("dojo.lang.timing.*");
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/__package__.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/__package__.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/timing/__package__.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/type.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/type.js?view=auto&rev=541946
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/type.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/type.js Sat May 26 15:47:41 2007
@@ -0,0 +1,132 @@
+dojo.provide("dojo.lang.type");
+dojo.require("dojo.lang.common");
+dojo.lang.whatAmI=function(_1){
+dojo.deprecated("dojo.lang.whatAmI","use dojo.lang.getType instead","0.5");
+return dojo.lang.getType(_1);
+};
+dojo.lang.whatAmI.custom={};
+dojo.lang.getType=function(_2){
+try{
+if(dojo.lang.isArray(_2)){
+return "array";
+}
+if(dojo.lang.isFunction(_2)){
+return "function";
+}
+if(dojo.lang.isString(_2)){
+return "string";
+}
+if(dojo.lang.isNumber(_2)){
+return "number";
+}
+if(dojo.lang.isBoolean(_2)){
+return "boolean";
+}
+if(dojo.lang.isAlien(_2)){
+return "alien";
+}
+if(dojo.lang.isUndefined(_2)){
+return "undefined";
+}
+for(var _3 in dojo.lang.whatAmI.custom){
+if(dojo.lang.whatAmI.custom[_3](_2)){
+return _3;
+}
+}
+if(dojo.lang.isObject(_2)){
+return "object";
+}
+}
+catch(e){
+}
+return "unknown";
+};
+dojo.lang.isNumeric=function(_4){
+return (!isNaN(_4)&&isFinite(_4)&&(_4!=null)&&!dojo.lang.isBoolean(_4)&&!dojo.lang.isArray(_4)&&!/^\s*$/.test(_4));
+};
+dojo.lang.isBuiltIn=function(_5){
+return (dojo.lang.isArray(_5)||dojo.lang.isFunction(_5)||dojo.lang.isString(_5)||dojo.lang.isNumber(_5)||dojo.lang.isBoolean(_5)||(_5==null)||(_5 instanceof Error)||(typeof _5=="error"));
+};
+dojo.lang.isPureObject=function(_6){
+return ((_6!=null)&&dojo.lang.isObject(_6)&&_6.constructor==Object);
+};
+dojo.lang.isOfType=function(_7,_8,_9){
+var _a=false;
+if(_9){
+_a=_9["optional"];
+}
+if(_a&&((_7===null)||dojo.lang.isUndefined(_7))){
+return true;
+}
+if(dojo.lang.isArray(_8)){
+var _b=_8;
+for(var i in _b){
+var _d=_b[i];
+if(dojo.lang.isOfType(_7,_d)){
+return true;
+}
+}
+return false;
+}else{
+if(dojo.lang.isString(_8)){
+_8=_8.toLowerCase();
+}
+switch(_8){
+case Array:
+case "array":
+return dojo.lang.isArray(_7);
+case Function:
+case "function":
+return dojo.lang.isFunction(_7);
+case String:
+case "string":
+return dojo.lang.isString(_7);
+case Number:
+case "number":
+return dojo.lang.isNumber(_7);
+case "numeric":
+return dojo.lang.isNumeric(_7);
+case Boolean:
+case "boolean":
+return dojo.lang.isBoolean(_7);
+case Object:
+case "object":
+return dojo.lang.isObject(_7);
+case "pureobject":
+return dojo.lang.isPureObject(_7);
+case "builtin":
+return dojo.lang.isBuiltIn(_7);
+case "alien":
+return dojo.lang.isAlien(_7);
+case "undefined":
+return dojo.lang.isUndefined(_7);
+case null:
+case "null":
+return (_7===null);
+case "optional":
+dojo.deprecated("dojo.lang.isOfType(value, [type, \"optional\"])","use dojo.lang.isOfType(value, type, {optional: true} ) instead","0.5");
+return ((_7===null)||dojo.lang.isUndefined(_7));
+default:
+if(dojo.lang.isFunction(_8)){
+return (_7 instanceof _8);
+}else{
+dojo.raise("dojo.lang.isOfType() was passed an invalid type");
+}
+}
+}
+dojo.raise("If we get here, it means a bug was introduced above.");
+};
+dojo.lang.getObject=function(_e){
+var _f=_e.split("."),i=0,obj=dj_global;
+do{
+obj=obj[_f[i++]];
+}while(i<_f.length&&obj);
+return (obj!=dj_global)?obj:null;
+};
+dojo.lang.doesObjectExist=function(str){
+var _13=str.split("."),i=0,obj=dj_global;
+do{
+obj=obj[_13[i++]];
+}while(i<_13.length&&obj);
+return (obj&&obj!=dj_global);
+};
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/type.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/type.js
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo-0.4.3/src/lang/type.js
------------------------------------------------------------------------------
svn:mime-type = text/plain