portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smi...@apache.org
Subject svn commit: r583999 [1/5] - in /portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed: ./ desktop/ widget/
Date Fri, 12 Oct 2007 00:36:48 GMT
Author: smilek
Date: Thu Oct 11 17:36:47 2007
New Revision: 583999

URL: http://svn.apache.org/viewvc?rev=583999&view=rev
Log:
continuation of desktop overhaul

Modified:
    portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.js
    portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.src.js
    portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/debug.js
    portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/debug.src.js
    portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/desktop/core.js
    portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/desktop/core.src.js
    portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/desktop/debug.js
    portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/desktop/debug.src.js
    portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/selector.js
    portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/selector.src.js
    portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PortletWindow.js

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.js?rev=583999&r1=583998&r2=583999&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.js (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.js Thu
Oct 11 17:36:47 2007
@@ -17,59 +17,76 @@
 return major+"."+minor+"."+patch+flag+" ("+revision+")";
 }
 }};
+jetspeed.initcommon=function(){
+var _1=jetspeed;
 if(!window.dojo){
-var jsObj=jetspeed;
-jsObj.no_dojo_load_notifying=false;
-jsObj.no_dojo_post_load=false;
-jsObj.pageLoadedListeners=[];
+var _1=jetspeed;
+_1.no_dojo_load_notifying=false;
+_1.no_dojo_post_load=false;
+_1.pageLoadedListeners=[];
 window.onload=function(){
 if(!window.dojo){
-var _1=jetspeed;
-_1.no_dojo_load_notifying=true;
-_1.no_dojo_post_load=true;
-var _2=_1.pageLoadedListeners;
-for(var x=0;x<_2.length;x++){
-_2[x]();
+var _2=jetspeed;
+_2.no_dojo_load_notifying=true;
+_2.no_dojo_post_load=true;
+var _3=_2.pageLoadedListeners;
+for(var x=0;x<_3.length;x++){
+_3[x]();
 }
-_1.pageLoadedListeners=[];
+_2.pageLoadedListeners=[];
 }
 };
 }else{
-var jsObj=jetspeed;
-var djRH=dojo.render.html;
-if(djRH.mozilla){
-jsObj.UAmoz=true;
-}else{
-if(djRH.ie){
-jsObj.UAie=true;
-if(djRH.ie60||djRH.ie50||djRH.ie55){
-jsObj.UAie6=true;
+var _5=dojo.render.html;
+if(_5.ie){
+_1.UAie=true;
+if(_5.ie60||_5.ie50||_5.ie55){
+_1.UAie6=true;
 }
+_1.stopEvent=function(_6){
+_6=_6||window.event;
+_6.cancelBubble=true;
+_6.returnValue=false;
+};
+_1._stopEvent=function(_7){
+jetspeed.stopEvent(_7);
+};
+}else{
+if(_5.mozilla){
+_1.UAmoz=true;
 }else{
-if(djRH.safari){
-jsObj.UAsaf=true;
+if(_5.safari){
+_1.UAsaf=true;
 }else{
-if(djRH.opera){
-jsObj.UAope=true;
+if(_5.opera){
+_1.UAope=true;
 }
 }
 }
+_1.stopEvent=function(_8){
+_8.preventDefault();
+_8.stopPropagation();
+};
+_1._stopEvent=function(_9){
+jetspeed.stopEvent(_9);
+};
 }
 }
-jetspeed.addOnLoad=function(_4,_5){
+};
+jetspeed.addOnLoad=function(_a,_b){
 if(window.dojo){
 if(arguments.length==1){
-dojo.addOnLoad(_4);
+dojo.addOnLoad(_a);
 }else{
-dojo.addOnLoad(_4,_5);
+dojo.addOnLoad(_a,_b);
 }
 }else{
 if(arguments.length==1){
-jetspeed.pageLoadedListeners.push(_4);
+jetspeed.pageLoadedListeners.push(_a);
 }else{
 if(arguments.length>1){
 jetspeed.pageLoadedListeners.push(function(){
-_4[_5]();
+_a[_b]();
 });
 }
 }
@@ -86,58 +103,92 @@
 }
 };
 jetspeed.getBody=function(){
-var _6=jetspeed;
-if(_6.docBody==null){
-_6.docBody=document.body||document.getElementsByTagName("body")[0];
+var _c=jetspeed;
+if(_c.docBody==null){
+_c.docBody=document.body||document.getElementsByTagName("body")[0];
 }
-return _6.docBody;
+return _c.docBody;
+};
+jetspeed.formatError=function(ex){
+if(ex==null){
+return "";
+}
+var _e=" error:";
+if(ex.message!=null){
+_e+=" "+ex.message;
+}
+var _f=ex.number||ex.lineNumber||ex.lineNo;
+if(_f==null||_f=="0"||_f.length==0){
+_f=null;
+}
+var _10=ex.fileName;
+if(_10!=null){
+var _11=_10.lastIndexOf("/");
+if(_11!=-1&&_11<(_10.length-1)){
+_10=_10.substring(_11+1);
+}
+}
+if(_10==null||_10.length==0){
+_10=null;
+}
+var _12=ex.type;
+if(_12==null||_12.length==0||_12=="unknown"){
+_12=null;
+}
+if(_f!=null||_10!=null||_12!=null){
+_e+=" ("+(_10!=null?(" "+_10):"");
+_e+=(_f!=null?(" line "+_f):"");
+_e+=(_12!=null?(" type "+_12):"");
+_e+=" )";
+}
+return _e;
 };
 jetspeed.url.LOADING_INDICATOR_ID="js-showloading";
 jetspeed.url.path={SERVER:null,JETSPEED:null,AJAX_API:null,DESKTOP:null,PORTAL:null,PORTLET:null,ACTION:null,RENDER:null,initialized:false};
-jetspeed.url.pathInitialize=function(_7){
-var _8=jetspeed.url;
-var _9=_8.path;
-if(!_7&&_9.initialized){
+jetspeed.url.pathInitialize=function(_13){
+var jsU=jetspeed.url;
+var _15=jsU.path;
+if(!_13&&_15.initialized){
 return;
 }
-var _a=document.getElementsByTagName("base");
-var _b=null;
-if(_a&&_a.length==1){
-_b=_a[0].href;
-}else{
-_b=window.location.href;
-}
-var _c=_8.parse(_b);
-var _d=_c.path;
-var _e=-1;
-for(var _f=1;_e<=_f;_f++){
-_e=_d.indexOf("/",_f);
-if(_e==-1){
+var _16=document.getElementsByTagName("base");
+var _17=null;
+if(_16&&_16.length==1){
+_17=_16[0].href;
+}else{
+_17=window.location.href;
+}
+var _18=jsU.parse(_17);
+var _19=_18.path;
+var _1a=-1;
+for(var _1b=1;_1a<=_1b;_1b++){
+_1a=_19.indexOf("/",_1b);
+if(_1a==-1){
 break;
 }
 }
-var _10="";
-if(_c.scheme!=null){
-_10+=_c.scheme+":";
-}
-if(_c.authority!=null){
-_10+="//"+_c.authority;
-}
-var _11=null;
-if(_e==-1){
-_11=_d;
-}else{
-_11=_d.substring(0,_e);
-}
-_9.JETSPEED=_11;
-_9.SERVER=_10;
-_9.AJAX_API=_9.JETSPEED+"/ajaxapi";
-_9.DESKTOP=_9.JETSPEED+"/desktop";
-_9.PORTAL=_9.JETSPEED+"/portal";
-_9.PORTLET=_9.JETSPEED+"/portlet";
-_9.ACTION=_9.JETSPEED+"/action";
-_9.RENDER=_9.JETSPEED+"/render";
-_9.initialized=true;
+var _1c="";
+if(_18.scheme!=null){
+_1c+=_18.scheme+":";
+}
+if(_18.authority!=null){
+_1c+="//"+_18.authority;
+}
+var _1d=null;
+if(_1a==-1){
+_1d=_19;
+}else{
+_1d=_19.substring(0,_1a);
+}
+_15.JETSPEED=_1d;
+_15.SERVER=_1c;
+_15.AJAX_API=_15.JETSPEED+"/ajaxapi";
+_15.DESKTOP=_15.JETSPEED+"/desktop";
+_15.PORTAL=_15.JETSPEED+"/portal";
+_15.PORTLET=_15.JETSPEED+"/portlet";
+_15.ACTION=_15.JETSPEED+"/action";
+_15.RENDER=_15.JETSPEED+"/render";
+_15.initialized=true;
 };
 jetspeed.url.parse=function(url){
 if(url==null){
@@ -151,9 +202,9 @@
 jetspeed.url.JSUri=function(url){
 if(url!=null){
 if(!url.path){
-var _14="^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";
-var r=url.toString().match(new RegExp(_14));
-var _16={};
+var _20="^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";
+var r=url.toString().match(new RegExp(_20));
+var _22={};
 this.scheme=r[2]||(r[1]?"":null);
 this.authority=r[4]||(r[3]?"":null);
 this.path=r[5];
@@ -180,8 +231,8 @@
 jetspeed.url.scheme={HTTP_PREFIX:"http://",HTTP_PREFIX_LEN:"http://".length,HTTPS_PREFIX:"https://",HTTPS_PREFIX_LEN:"https://".length};
 jetspeed.url.isPortal=function(){
 if(window.djConfig&&window.djConfig.jetspeed){
-var _18=window.djConfig.jetspeed.servletPath;
-if(_18!=null&&_18.toLowerCase().indexOf("/desktop")==0){
+var _24=window.djConfig.jetspeed.servletPath;
+if(_24!=null&&_24.toLowerCase().indexOf("/desktop")==0){
 return false;
 }
 }
@@ -209,268 +260,268 @@
 }
 return jetspeed.url.basePortalUrl()+jetspeed.url.path.JETSPEED;
 };
-jetspeed.url.addPath=function(url,_1a){
-if(_1a==null||_1a.length==0){
+jetspeed.url.addPath=function(url,_26){
+if(_26==null||_26.length==0){
 return url;
 }
-var _1b=new jetspeed.url.JSUri(url);
-var _1c=_1b.path;
-if(_1c!=null&&_1c.length>0){
-if(_1b.path.charCodeAt(_1c.length-1)==47){
-if(_1a.charCodeAt(0)==47){
-if(_1a.length>1){
-_1b.path+=_1a.substring(1);
+var _27=new jetspeed.url.JSUri(url);
+var _28=_27.path;
+if(_28!=null&&_28.length>0){
+if(_27.path.charCodeAt(_28.length-1)==47){
+if(_26.charCodeAt(0)==47){
+if(_26.length>1){
+_27.path+=_26.substring(1);
 }
 }else{
-_1b.path+=_1a;
+_27.path+=_26;
 }
 }else{
-if(_1a.charCodeAt(0)==47){
-_1b.path+=_1a;
+if(_26.charCodeAt(0)==47){
+_27.path+=_26;
 }else{
-if(_1a.length>1){
-_1b.path+="/"+_1a;
+if(_26.length>1){
+_27.path+="/"+_26;
 }
 }
 }
 }
-var _1d=jetspeed.url.parse(_1b);
-return _1d.toString();
+var _29=jetspeed.url.parse(_27);
+return _29.toString();
 };
 jetspeed.url.urlStartsWithHttp=function(url){
 if(url){
 var len=url.length;
-var _20=jetspeed.url.scheme.HTTPS_PREFIX_LEN;
-if(len>_20){
-var _21=jetspeed.url.scheme.HTTP_PREFIX_LEN;
-if(url.substring(0,_21)==jetspeed.url.scheme.HTTP_PREFIX){
+var _2c=jetspeed.url.scheme.HTTPS_PREFIX_LEN;
+if(len>_2c){
+var _2d=jetspeed.url.scheme.HTTP_PREFIX_LEN;
+if(url.substring(0,_2d)==jetspeed.url.scheme.HTTP_PREFIX){
 return true;
 }
-if(url.substring(0,_20)==jetspeed.url.scheme.HTTPS_PREFIX){
+if(url.substring(0,_2c)==jetspeed.url.scheme.HTTPS_PREFIX){
 return true;
 }
 }
 }
 return false;
 };
-jetspeed.url.addQueryParameter=function(_22,_23,_24,_25){
-if(_22==null){
-return _22;
+jetspeed.url.addQueryParameter=function(_2e,_2f,_30,_31){
+if(_2e==null){
+return _2e;
 }
-if(!_22.path){
-_22=jetspeed.url.parse(_22);
+if(!_2e.path){
+_2e=jetspeed.url.parse(_2e);
 }
-if(_22==null){
+if(_2e==null){
 return null;
 }
-if(_23==null){
-return _22;
+if(_2f==null){
+return _2e;
 }
-_22.jsQParamN=null;
-if(_25){
-_22=jetspeed.url.removeQueryParameter(_22,_23,false);
-}
-var _26=_22.query;
-if(_26==null){
-_26="";
-}
-var _27=_26.length;
-if(_27>0){
-_26+="&";
-}
-_26+=_23+"="+(_24!=null?_24:"");
-_22.query=_26;
-var _28=new jetspeed.url.JSUri(_22);
-_22=jetspeed.url.parse(_28);
-return _22;
-};
-jetspeed.url.removeAllQueryParameters=function(_29){
-return jetspeed.url.removeQueryParameter(_29,null,true);
-};
-jetspeed.url.removeQueryParameter=function(_2a,_2b,_2c){
-if(_2a==null){
-return _2a;
+_2e.jsQParamN=null;
+if(_31){
+_2e=jetspeed.url.removeQueryParameter(_2e,_2f,false);
+}
+var _32=_2e.query;
+if(_32==null){
+_32="";
+}
+var _33=_32.length;
+if(_33>0){
+_32+="&";
+}
+_32+=_2f+"="+(_30!=null?_30:"");
+_2e.query=_32;
+var _34=new jetspeed.url.JSUri(_2e);
+_2e=jetspeed.url.parse(_34);
+return _2e;
+};
+jetspeed.url.removeAllQueryParameters=function(_35){
+return jetspeed.url.removeQueryParameter(_35,null,true);
+};
+jetspeed.url.removeQueryParameter=function(_36,_37,_38){
+if(_36==null){
+return _36;
 }
-if(!_2a.path){
-_2a=jetspeed.url.parse(_2a);
+if(!_36.path){
+_36=jetspeed.url.parse(_36);
 }
-if(_2a==null){
+if(_36==null){
 return null;
 }
-_2a.jsQParamN=null;
-var _2d=_2a.query;
-var _2e=((_2d!=null)?_2d.length:0);
-if(_2e>0){
-if(_2c){
-_2d=null;
-}else{
-if(_2b==null){
-return _2a;
-}else{
-var _2f=_2b;
-var _30=_2d.indexOf(_2f);
-if(_30==0){
-_2d=jetspeed.url._removeQP(_2d,_2e,_2f,_30);
+_36.jsQParamN=null;
+var _39=_36.query;
+var _3a=((_39!=null)?_39.length:0);
+if(_3a>0){
+if(_38){
+_39=null;
+}else{
+if(_37==null){
+return _36;
+}else{
+var _3b=_37;
+var _3c=_39.indexOf(_3b);
+if(_3c==0){
+_39=jetspeed.url._removeQP(_39,_3a,_3b,_3c);
 }
-_2f="&"+_2b;
+_3b="&"+_37;
 while(true){
-_2e=((_2d!=null)?_2d.length:0);
-_30=_2d.indexOf(_2f,0);
-if(_30==-1){
+_3a=((_39!=null)?_39.length:0);
+_3c=_39.indexOf(_3b,0);
+if(_3c==-1){
 break;
 }
-var _31=jetspeed.url._removeQP(_2d,_2e,_2f,_30);
-if(_31==_2d){
+var _3d=jetspeed.url._removeQP(_39,_3a,_3b,_3c);
+if(_3d==_39){
 break;
 }
-_2d=_31;
+_39=_3d;
 }
-if(_2d.length>0){
-if(_2d.charCodeAt(0)==38){
-_2d=((_2d.length>1)?_2d.substring(1):"");
+if(_39.length>0){
+if(_39.charCodeAt(0)==38){
+_39=((_39.length>1)?_39.substring(1):"");
 }
-if(_2d.length>0&&_2d.charCodeAt(0)==63){
-_2d=((_2d.length>1)?_2d.substring(1):"");
+if(_39.length>0&&_39.charCodeAt(0)==63){
+_39=((_39.length>1)?_39.substring(1):"");
 }
 }
 }
 }
-_2a.query=_2d;
-var _32=new jetspeed.url.JSUri(_2a);
-_2a=jetspeed.url.parse(_32);
+_36.query=_39;
+var _3e=new jetspeed.url.JSUri(_36);
+_36=jetspeed.url.parse(_3e);
 }
-return _2a;
+return _36;
 };
-jetspeed.url._removeQP=function(_33,_34,_35,_36){
-if(_36==-1){
-return _33;
+jetspeed.url._removeQP=function(_3f,_40,_41,_42){
+if(_42==-1){
+return _3f;
 }
-if(_34>(_36+_35.length)){
-var _37=_33.charCodeAt(_36+_35.length);
-if(_37==61){
-var _38=_33.indexOf("&",_36+_35.length+1);
-if(_38!=-1){
-if(_36>0){
-_33=_33.substring(0,_36)+_33.substring(_38);
+if(_40>(_42+_41.length)){
+var _43=_3f.charCodeAt(_42+_41.length);
+if(_43==61){
+var _44=_3f.indexOf("&",_42+_41.length+1);
+if(_44!=-1){
+if(_42>0){
+_3f=_3f.substring(0,_42)+_3f.substring(_44);
 }else{
-_33=((_38<(_34-1))?_33.substring(_38):"");
+_3f=((_44<(_40-1))?_3f.substring(_44):"");
 }
 }else{
-if(_36>0){
-_33=_33.substring(0,_36);
+if(_42>0){
+_3f=_3f.substring(0,_42);
 }else{
-_33="";
+_3f="";
 }
 }
 }else{
-if(_37==38){
-if(_36>0){
-_33=_33.substring(0,_36)+_33.substring(_36+_35.length);
+if(_43==38){
+if(_42>0){
+_3f=_3f.substring(0,_42)+_3f.substring(_42+_41.length);
 }else{
-_33=_33.substring(_36+_35.length);
+_3f=_3f.substring(_42+_41.length);
 }
 }
 }
 }else{
-if(_34==(_36+_35.length)){
-_33="";
+if(_40==(_42+_41.length)){
+_3f="";
 }
 }
-return _33;
+return _3f;
 };
-jetspeed.url.getQueryParameter=function(_39,_3a){
-if(_39==null){
+jetspeed.url.getQueryParameter=function(_45,_46){
+if(_45==null){
 return null;
 }
-if(!_39.authority||!_39.scheme){
-_39=jetspeed.url.parse(_39);
+if(!_45.authority||!_45.scheme){
+_45=jetspeed.url.parse(_45);
 }
-if(_39==null){
+if(_45==null){
 return null;
 }
-if(_39.jsQParamN==null&&_39.query){
-var _3b=new Array();
-var _3c=_39.query.split("&");
-for(var i=0;i<_3c.length;i++){
-if(_3c[i]==null){
-_3c[i]="";
-}
-var _3e=_3c[i].indexOf("=");
-if(_3e>0&&_3e<(_3c[i].length-1)){
-_3b[i]=unescape(_3c[i].substring(_3e+1));
-_3c[i]=unescape(_3c[i].substring(0,_3e));
-}else{
-_3b[i]="";
-}
-}
-_39.jsQParamN=_3c;
-_39.jsQParamV=_3b;
-}
-if(_39.jsQParamN!=null){
-for(var i=0;i<_39.jsQParamN.length;i++){
-if(_39.jsQParamN[i]==_3a){
-return _39.jsQParamV[i];
+if(_45.jsQParamN==null&&_45.query){
+var _47=new Array();
+var _48=_45.query.split("&");
+for(var i=0;i<_48.length;i++){
+if(_48[i]==null){
+_48[i]="";
+}
+var _4a=_48[i].indexOf("=");
+if(_4a>0&&_4a<(_48[i].length-1)){
+_47[i]=unescape(_48[i].substring(_4a+1));
+_48[i]=unescape(_48[i].substring(0,_4a));
+}else{
+_47[i]="";
+}
+}
+_45.jsQParamN=_48;
+_45.jsQParamV=_47;
+}
+if(_45.jsQParamN!=null){
+for(var i=0;i<_45.jsQParamN.length;i++){
+if(_45.jsQParamN[i]==_46){
+return _45.jsQParamV[i];
 }
 }
 }
 return null;
 };
 jetspeed.om.Id=function(){
-var _3f="";
+var _4b="";
 for(var i=0;i<arguments.length;i++){
 if(dojo.lang.isString(arguments[i])){
-if(_3f.length>0){
-_3f+="-";
+if(_4b.length>0){
+_4b+="-";
 }
-_3f+=arguments[i];
+_4b+=arguments[i];
 }else{
 if(dojo.lang.isObject(arguments[i])){
-for(var _41 in arguments[i]){
-this[_41]=arguments[i][_41];
+for(var _4d in arguments[i]){
+this[_4d]=arguments[i][_4d];
 }
 }
 }
 }
-this.id=_3f;
+this.id=_4b;
 };
 jetspeed.om.Id.prototype={getId:function(){
 return this.id;
 }};
 if(window.dojo){
-jetspeed.url.BindArgs=function(_42){
-dojo.lang.mixin(this,_42);
+jetspeed.url.BindArgs=function(_4e){
+dojo.lang.mixin(this,_4e);
 if(!this.mimetype){
 this.mimetype="text/html";
 }
 };
 dojo.lang.extend(jetspeed.url.BindArgs,{createIORequest:function(){
-var _43=new dojo.io.Request(this.url,this.mimetype);
-_43.fromKwArgs(this);
-return _43;
-},load:function(_44,_45,_46){
+var _4f=new dojo.io.Request(this.url,this.mimetype);
+_4f.fromKwArgs(this);
+return _4f;
+},load:function(_50,_51,_52){
 try{
-var _47=null;
+var _53=null;
 if(this.debugContentDumpIds){
-_47=((this.domainModelObject&&dojo.lang.isFunction(this.domainModelObject.getId))?this.domainModelObject.getId():((this.domainModelObject&&this.domainModelObject.id)?String(this.domainModelObject.id):""));
-for(var _48=0;_48<this.debugContentDumpIds.length;_48++){
-if(_47.match(new RegExp(this.debugContentDumpIds[_48]))){
-if(dojo.lang.isString(_45)){
-dojo.debug("retrieveContent ["+(_47?_47:this.url)+"] content: "+_45);
-}else{
-var _49=dojo.dom.innerXML(_45);
-if(!_49){
-_49=(_45!=null?"!= null (IE no XMLSerializer)":"null");
+_53=((this.domainModelObject&&dojo.lang.isFunction(this.domainModelObject.getId))?this.domainModelObject.getId():((this.domainModelObject&&this.domainModelObject.id)?String(this.domainModelObject.id):""));
+for(var _54=0;_54<this.debugContentDumpIds.length;_54++){
+if(_53.match(new RegExp(this.debugContentDumpIds[_54]))){
+if(dojo.lang.isString(_51)){
+dojo.debug("retrieveContent ["+(_53?_53:this.url)+"] content: "+_51);
+}else{
+var _55=dojo.dom.innerXML(_51);
+if(!_55){
+_55=(_51!=null?"!= null (IE no XMLSerializer)":"null");
 }
-dojo.debug("retrieveContent ["+(_47?_47:this.url)+"] xml-content: "+_49);
+dojo.debug("retrieveContent ["+(_53?_53:this.url)+"] xml-content: "+_55);
 }
 }
 }
 }
 if(this.contentListener&&dojo.lang.isFunction(this.contentListener.notifySuccess)){
-this.contentListener.notifySuccess(_45,this.url,this.domainModelObject,_46);
+this.contentListener.notifySuccess(_51,this.url,this.domainModelObject,_52);
 }else{
-_47=((this.domainModelObject&&dojo.lang.isFunction(this.domainModelObject.getId))?this.domainModelObject.getId():"");
-dojo.debug("retrieveContent ["+(_47?_47:this.url)+"] no valid contentListener");
+_53=((this.domainModelObject&&dojo.lang.isFunction(this.domainModelObject.getId))?this.domainModelObject.getId():"");
+dojo.debug("retrieveContent ["+(_53?_53:this.url)+"] no valid contentListener");
 }
 if(this.hideLoadingIndicator){
 jetspeed.url.loadingIndicatorHide();
@@ -480,12 +531,12 @@
 if(this.hideLoadingIndicator){
 jetspeed.url.loadingIndicatorHide();
 }
-throw e;
+dojo.raise("dojo.io.bind "+jetspeed.formatError(e));
 }
-},error:function(_4a,_4b){
+},error:function(_56,_57){
 try{
 if(this.contentListener&&dojo.lang.isFunction(this.contentListener.notifyFailure)){
-this.contentListener.notifyFailure(_4a,_4b,this.url,this.domainModelObject);
+this.contentListener.notifyFailure(_56,_57,this.url,this.domainModelObject);
 }
 if(this.hideLoadingIndicator){
 jetspeed.url.loadingIndicatorHide();
@@ -498,84 +549,63 @@
 throw e;
 }
 }});
-jetspeed.url.retrieveContent=function(_4c,_4d,_4e,_4f){
-if(!_4c){
-_4c={};
-}
-_4c.contentListener=_4d;
-_4c.domainModelObject=_4e;
-_4c.debugContentDumpIds=_4f;
-var _50=new jetspeed.url.BindArgs(_4c);
-if(_4c.showLoadingIndicator||(_4d&&!_4d.suppressLoadingIndicator&&_4c.showLoadingIndicator!=false)){
+jetspeed.url.retrieveContent=function(_58,_59,_5a,_5b){
+if(!_58){
+_58={};
+}
+_58.contentListener=_59;
+_58.domainModelObject=_5a;
+_58.debugContentDumpIds=_5b;
+var _5c=new jetspeed.url.BindArgs(_58);
+if(_58.showLoadingIndicator||(_59&&!_59.suppressLoadingIndicator&&_58.showLoadingIndicator!=false)){
 if(jetspeed.url.loadingIndicatorShow()){
-_50.hideLoadingIndicator=true;
+_5c.hideLoadingIndicator=true;
 }
 }
-dojo.io.bind(_50.createIORequest());
+dojo.io.bind(_5c.createIORequest());
 };
-jetspeed.url.checkAjaxApiResponse=function(_51,_52,_53,_54,_55){
-var _56=false;
-var _57=_52.getElementsByTagName("status");
-if(_57!=null){
-var _58=_57[0].firstChild.nodeValue;
-if(_58=="success"){
-_56=true;
-}
-}
-if((!_56&&_53)||_55){
-var _59=dojo.dom.innerXML(_52);
-if(!_59){
-_59=(_52!=null?"!= null (IE no XMLSerializer)":"null");
+jetspeed.url.checkAjaxApiResponse=function(_5d,_5e,_5f,_60,_61){
+var _62=false;
+var _63=_5e.getElementsByTagName("status");
+if(_63!=null){
+var _64=_63[0].firstChild.nodeValue;
+if(_64=="success"){
+_62=true;
 }
-if(_54==null){
-_54="ajax-api";
-}
-if(_56){
-dojo.debug(_54+" success  url="+_51+"  xml-content="+_59);
-}else{
-dojo.raise(_54+" failure  url="+_51+"  xml-content="+_59);
-}
-}
-return _56;
-};
-jetspeed.url.formatBindError=function(_5a){
-if(_5a==null){
-return "";
 }
-var msg=" error:";
-if(_5a.message!=null){
-msg+=" "+_5a.message;
+if((!_62&&_5f)||_61){
+var _65=dojo.dom.innerXML(_5e);
+if(!_65){
+_65=(_5e!=null?"!= null (IE no XMLSerializer)":"null");
 }
-if(_5a.number!=null&&_5a.number!="0"){
-msg+=" ("+_5a.number;
-if(_5a.type!=null&&_5a.type!="unknown"){
-msg+="/"+_5a.type;
+if(_60==null){
+_60="ajax-api";
 }
-msg+=")";
+if(_62){
+dojo.debug(_60+" success  url="+_5d+"  xml-content="+_65);
 }else{
-if(_5a.type!=null&&_5a.type!="unknown"){
-msg+=" ("+_5a.type+")";
+dojo.raise(_60+" failure  url="+_5d+"  xml-content="+_65);
 }
 }
-return msg;
+return _62;
 };
-jetspeed.url.loadingIndicatorShow=function(_5c){
-if(typeof _5c=="undefined"){
-_5c="loadpage";
+jetspeed.url.loadingIndicatorShow=function(_66){
+if(typeof _66=="undefined"){
+_66="loadpage";
 }
-var _5d=document.getElementById(jetspeed.url.LOADING_INDICATOR_ID);
-if(_5d!=null&&_5d.style){
-var _5e=null;
+var _67=document.getElementById(jetspeed.url.LOADING_INDICATOR_ID);
+if(_67!=null&&_67.style){
+var _68=null;
 if(jetspeed.prefs!=null&&jetspeed.prefs.desktopActionLabels!=null){
-_5e=jetspeed.prefs.desktopActionLabels[_5c];
+_68=jetspeed.prefs.desktopActionLabels[_66];
 }
-if(_5e!=null&&_5e.length>0&&_5d.style["display"]=="none"){
-_5d.style["display"]="";
-if(_5c!=null){
-if(_5e!=null&&_5e.length>0){
-var _5f=document.getElementById(jetspeed.url.LOADING_INDICATOR_ID+"-content");
-if(_5f!=null){
-_5f.innerHTML=_5e;
+if(_68!=null&&_68.length>0&&_67.style["display"]=="none"){
+_67.style["display"]="";
+if(_66!=null){
+if(_68!=null&&_68.length>0){
+var _69=document.getElementById(jetspeed.url.LOADING_INDICATOR_ID+"-content");
+if(_69!=null){
+_69.innerHTML=_68;
 }
 }
 }
@@ -585,10 +615,11 @@
 return false;
 };
 jetspeed.url.loadingIndicatorHide=function(){
-var _60=document.getElementById(jetspeed.url.LOADING_INDICATOR_ID);
-if(_60!=null&&_60.style){
-_60.style["display"]="none";
+var _6a=document.getElementById(jetspeed.url.LOADING_INDICATOR_ID);
+if(_6a!=null&&_6a.style){
+_6a.style["display"]="none";
 }
 };
 }
+jetspeed.initcommon();
 

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.src.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.src.js?rev=583999&r1=583998&r2=583999&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.src.js
(original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.src.js
Thu Oct 11 17:36:47 2007
@@ -52,45 +52,72 @@
     }
 };
 
-if ( ! window.dojo )
+jetspeed.initcommon = function()
 {
     var jsObj = jetspeed;
-    jsObj.no_dojo_load_notifying = false;
-    jsObj.no_dojo_post_load = false;
-    jsObj.pageLoadedListeners = [];
-
-    window.onload = function()
-    {
-        if ( ! window.dojo )
-        {
-            var _jsObj = jetspeed;
-            _jsObj.no_dojo_load_notifying = true;
-            _jsObj.no_dojo_post_load = true;
-            var pll = _jsObj.pageLoadedListeners;
-	        for( var x=0; x < pll.length; x++ )
-            {
-		        pll[x]();
-	        }
-            _jsObj.pageLoadedListeners = [];
+    if ( ! window.dojo )
+    {
+        var jsObj = jetspeed;
+        jsObj.no_dojo_load_notifying = false;
+        jsObj.no_dojo_post_load = false;
+        jsObj.pageLoadedListeners = [];
+    
+        window.onload = function()
+        {
+            if ( ! window.dojo )
+            {
+                var _jsObj = jetspeed;
+                _jsObj.no_dojo_load_notifying = true;
+                _jsObj.no_dojo_post_load = true;
+                var pll = _jsObj.pageLoadedListeners;
+    	        for( var x=0; x < pll.length; x++ )
+                {
+    		        pll[x]();
+    	        }
+                _jsObj.pageLoadedListeners = [];
+            }
+        };
+    }
+    else
+    {
+        var djRH = dojo.render.html;
+        if ( djRH.ie )
+        {
+            jsObj.UAie = true;
+            if ( djRH.ie60 || djRH.ie50 || djRH.ie55 )
+                jsObj.UAie6 = true;
+    
+            jsObj.stopEvent = function(/*Event*/evt)
+            {   // do no use in event connect
+                evt = evt || window.event;
+                evt.cancelBubble = true;
+                evt.returnValue = false;
+    	    };
+    	    jsObj._stopEvent = function(/*Event*/evt)
+            {   // use in event connect
+                jetspeed.stopEvent( evt );
+        	};
         }
-    };
-}
-else
-{
-    var jsObj = jetspeed;
-    var djRH = dojo.render.html;
-    if ( djRH.mozilla )
-        jsObj.UAmoz = true;
-    else if ( djRH.ie )
-    {
-        jsObj.UAie = true;
-        if ( djRH.ie60 || djRH.ie50 || djRH.ie55 )
-            jsObj.UAie6 = true;
-    }
-    else if ( djRH.safari )
-        jsObj.UAsaf = true ;
-    else if ( djRH.opera )
-        jsObj.UAope = true ;
+        else
+        {
+            if ( djRH.mozilla )
+                jsObj.UAmoz = true;
+            else if ( djRH.safari )
+                jsObj.UAsaf = true ;
+            else if ( djRH.opera )
+                jsObj.UAope = true ;
+    
+            jsObj.stopEvent = function(/*Event*/evt)
+            {   // do no use in event connect
+                evt.preventDefault();
+                evt.stopPropagation();
+        	};
+            jsObj._stopEvent = function(/*Event*/evt)
+            {   // use in event connect
+                jetspeed.stopEvent( evt );
+        	};
+        }
+    }
 }
 
 
@@ -146,6 +173,39 @@
     return jsObj.docBody;
 };
 
+jetspeed.formatError = function( ex )
+{
+    if ( ex == null ) return "";
+    var msg = " error:";
+    if ( ex.message != null )
+        msg += " " + ex.message;
+    var lineNo = ex.number||ex.lineNumber||ex.lineNo;
+    if ( lineNo == null || lineNo == "0" || lineNo.length == 0 )
+        lineNo = null;
+    var fileNm = ex.fileName;
+    if ( fileNm != null )
+    {
+        var lastDirSep = fileNm.lastIndexOf( "/" );
+        if ( lastDirSep != -1 && lastDirSep < (fileNm.length -1) )
+            fileNm = fileNm.substring( lastDirSep + 1 );
+    }
+    if ( fileNm == null || fileNm.length == 0 )
+        fileNm = null;
+    var errType = ex.type;
+    if ( errType == null || errType.length == 0 || errType == "unknown" )
+        errType = null;
+
+    if ( lineNo != null || fileNm != null || errType != null )
+    {
+        msg += " (" + ( fileNm != null ? ( " " + fileNm ) : "" );
+        msg += ( lineNo != null ? (" line " + lineNo) : "" );
+        msg += ( errType != null ? (" type " + errType) : "" );
+        msg += " )";
+    }
+    return msg;
+};
+
+
 // jetspeed.url
 
 jetspeed.url.LOADING_INDICATOR_ID = "js-showloading";
@@ -614,10 +674,10 @@
             {
                 if ( this.hideLoadingIndicator )
                     jetspeed.url.loadingIndicatorHide();
-                throw e;
+                dojo.raise( "dojo.io.bind " + jetspeed.formatError( e ) );
             }
         },
-    
+
         error: function( type, error )
         {
             //dojo.debug( "r e t r i e v e C o n t e n t . e r r o r" ) ;
@@ -687,25 +747,6 @@
         return success;
     };
     
-    jetspeed.url.formatBindError = function( /* Object */ bindError )
-    {
-        if ( bindError == null ) return "";
-        var msg = " error:";
-        if ( bindError.message != null )
-            msg += " " + bindError.message;
-        if ( bindError.number != null && bindError.number != "0" )
-        {
-            msg += " (" + bindError.number;
-            if ( bindError.type != null && bindError.type != "unknown" )
-                msg += "/" + bindError.type;
-            msg += ")";
-        }
-        else if ( bindError.type != null && bindError.type != "unknown" )
-        {
-            msg += " (" + bindError.type + ")";
-        }
-        return msg;
-    };
     jetspeed.url.loadingIndicatorShow = function( actionName )
     {
         if ( typeof actionName == "undefined" )
@@ -744,3 +785,5 @@
             loading.style[ "display" ] = "none";
     };
 }
+
+jetspeed.initcommon();

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/debug.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/debug.js?rev=583999&r1=583998&r2=583999&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/debug.js (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/debug.js Thu
Oct 11 17:36:47 2007
@@ -69,99 +69,136 @@
 }
 }
 };
-jetspeed.debugNodeTree=function(_13,_14){
-if(!_13){
+jetspeed.objectKeys=function(obj){
+var _14=new Array();
+if(obj!=null){
+for(var key in obj){
+_14.push(key);
+}
+}
+return _14;
+};
+jetspeed.debugNodes=function(_16){
+if(!_16||_16.length==null){
+return null;
+}
+var _17=jetspeed;
+var _18=dojo;
+var out="",_1a;
+var _1b=_16.length;
+var _1c=(_1b>=100?3:(_1b>=10?2:1));
+for(var i=0;i<_1b;i++){
+_1a=_16[i];
+out+="\r\n";
+out+="["+_18.string.padLeft(String(i),_1c,"0")+"] ";
+if(!_1a){
+out+="null";
+}else{
+out+=_17.debugNode(_1a);
+}
+}
+return out;
+};
+jetspeed.debugNode=function(_1e){
+if(!_1e){
+return null;
+}
+return _1e.nodeName+" "+_1e.id+" "+_1e.className;
+};
+jetspeed.debugNodeTree=function(_1f,_20){
+if(!_1f){
 return;
 }
-if(_14){
-if(_14.length>0){
-jetspeed.println(_14);
+if(_20){
+if(_20.length>0){
+jetspeed.println(_20);
 }
 }else{
 jetspeed.println("node: ");
 }
-if(_13.nodeType!=1&&_13.nodeType!=3){
-if(_13.length&&_13.length>0&&(_13[0].nodeType==1||_13[0].nodeType==3)){
-for(var i=0;i<_13.length;i++){
-jetspeed.debugNodeTree(_13[i]," ["+i+"]");
+if(_1f.nodeType!=1&&_1f.nodeType!=3){
+if(_1f.length&&_1f.length>0&&(_1f[0].nodeType==1||_1f[0].nodeType==3)){
+for(var i=0;i<_1f.length;i++){
+jetspeed.debugNodeTree(_1f[i]," ["+i+"]");
 }
 }else{
-jetspeed.println(" node is not a node! "+_13.length);
+jetspeed.println(" node is not a node! "+_1f.length);
 }
 return;
 }
-if(_13.innerXML){
-jetspeed.println(_13.innerXML);
+if(_1f.innerXML){
+jetspeed.println(_1f.innerXML);
 }else{
-if(_13.xml){
-jetspeed.println(_13.xml);
+if(_1f.xml){
+jetspeed.println(_1f.xml);
 }else{
 if(typeof XMLSerializer!="undefined"){
-jetspeed.println((new XMLSerializer()).serializeToString(_13));
+jetspeed.println((new XMLSerializer()).serializeToString(_1f));
 }else{
 jetspeed.println(" node != null (IE no XMLSerializer)");
 }
 }
 }
 };
-jetspeed.debugShallow=function(obj,_17){
-if(_17){
-jetspeed.println(_17);
+jetspeed.debugShallow=function(obj,_23){
+if(_23){
+jetspeed.println(_23);
 }else{
 jetspeed.println("Object: "+obj);
 }
-var _18=[];
-for(var _19 in obj){
+var _24=[];
+for(var _25 in obj){
 try{
-_18.push(_19+": "+obj[_19]);
+_24.push(_25+": "+obj[_25]);
 }
 catch(E){
-_18.push(_19+": ERROR - "+E.message);
+_24.push(_25+": ERROR - "+E.message);
 }
 }
-_18.sort();
-for(var i=0;i<_18.length;i++){
-jetspeed.println(_18[i]);
+_24.sort();
+for(var i=0;i<_24.length;i++){
+jetspeed.println(_24[i]);
 }
 };
-jetspeed.getDebugElement=function(_1b){
-var _1c=null;
-var _1d=null;
+jetspeed.getDebugElement=function(_27){
+var _28=null;
+var _29=null;
 try{
-var _1e=jetspeed.debug.debugContainerId;
-_1d=document.getElementById(_1e);
-if(!_1d){
-_1e="debug_container";
-_1d=document.getElementById(_1e);
-if(!_1d){
-_1c=jetspeed.docBody;
-if(_1c==null){
-_1c=jetspeed.getBody();
-}
-_1d=document.createElement("div");
-_1d.setAttribute("id","debug_container");
-_1c.appendChild(_1d);
+var _2a=jetspeed.debug.debugContainerId;
+_29=document.getElementById(_2a);
+if(!_29){
+_2a="debug_container";
+_29=document.getElementById(_2a);
+if(!_29){
+_28=jetspeed.docBody;
+if(_28==null){
+_28=jetspeed.getBody();
+}
+_29=document.createElement("div");
+_29.setAttribute("id","debug_container");
+_28.appendChild(_29);
 }
 }
-if(_1d&&_1b){
-_1d.innerHTML="";
+if(_29&&_27){
+_29.innerHTML="";
 }
 }
 catch(e){
 try{
-if(_1d==null){
-_1d=jetspeed.getBody();
+if(_29==null){
+_29=jetspeed.getBody();
 }
 }
 catch(e2){
 }
 }
-return _1d;
+return _29;
 };
 if(window.djConfig!=null&&window.djConfig.isDebug){
 var ch=String.fromCharCode(160);
 jetspeed.debugindentch=ch;
 jetspeed.debugindentH=ch+ch;
+jetspeed.debugindentT=ch+ch+ch;
 jetspeed.debugindent=ch+ch+ch+ch;
 jetspeed.debugindent2=jetspeed.debugindent+jetspeed.debugindent;
 jetspeed.debugindent3=jetspeed.debugindent+jetspeed.debugindent+jetspeed.debugindent;

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/debug.src.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/debug.src.js?rev=583999&r1=583998&r2=583999&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/debug.src.js
(original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/debug.src.js
Thu Oct 11 17:36:47 2007
@@ -107,6 +107,44 @@
     }
 };
 
+jetspeed.objectKeys = function( obj )
+{
+    var keys = new Array();
+    if ( obj != null )
+    {
+        for( var key in obj )
+            keys.push( key );
+    }
+    return keys;
+};
+
+jetspeed.debugNodes = function( nodes )
+{
+    if ( ! nodes || nodes.length == null ) return null;
+    var jsObj = jetspeed;
+    var djObj = dojo;
+    var out = "", node;
+    var nodesLen = nodes.length;
+    var leftPad = ( nodesLen >= 100 ? 3 : ( nodesLen >= 10 ? 2 : 1 ) );
+    for ( var i = 0 ; i < nodesLen ; i++ )
+    {
+        node = nodes[i];
+        out += "\r\n";
+        out += "[" + djObj.string.padLeft( String(i), leftPad, "0" ) + "] ";
+        if ( ! node )
+            out += "null";
+        else
+            out += jsObj.debugNode( node );
+    }
+    return out;
+}
+
+jetspeed.debugNode = function( node )
+{
+    if ( ! node ) return null;
+    return node.nodeName + " " + node.id + " " + node.className;
+}
+
 jetspeed.debugNodeTree = function( node, string )
 {
     if ( ! node ) return ;
@@ -208,6 +246,7 @@
     var ch = String.fromCharCode(0x00a0);
     jetspeed.debugindentch = ch;
     jetspeed.debugindentH = ch + ch;
+    jetspeed.debugindentT = ch + ch + ch;
     jetspeed.debugindent = ch + ch + ch + ch;
     jetspeed.debugindent2 = jetspeed.debugindent + jetspeed.debugindent;
     jetspeed.debugindent3 = jetspeed.debugindent + jetspeed.debugindent + jetspeed.debugindent;



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message