portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smi...@apache.org
Subject svn commit: r595411 [4/7] - in /portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed: ./ desktop/ widget/
Date Thu, 15 Nov 2007 20:06:56 GMT
Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/desktop/debug.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/desktop/debug.js?rev=595411&r1=595410&r2=595411&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/desktop/debug.js (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/desktop/debug.js Thu Nov 15 12:06:54 2007
@@ -41,221 +41,232 @@
 _2.ui.createPortletWindow(_8,null,_2);
 _8.retrieveContent(null,null);
 var _9=_2.page.getPWin(_7);
-_4.event.connect("after",_4.hostenv,"println",_9,"contentChanged");
+_9.dbContentAdded=function(_a){
+this.contentChanged(_a);
+var _b=document.getElementById("_dbclrspan");
+if(_b){
+_b.style.visibility="visible";
+}
+};
+_4.event.connect("after",_4.hostenv,"println",_9,"dbContentAdded");
 _4.event.connect(_9,"actionBtnSync",_2,"debugWindowSave");
 _4.event.connect(_9,"endSizing",_2,"debugWindowSave");
 _4.event.connect(_9,"endDragging",_2,"debugWindowSave");
 }
 };
-jetspeed.debugWindowReadCookie=function(_a){
-var _b={};
-if(_a){
-_b={width:"400",height:"400",left:"320",top:"0",windowState:jetspeed.id.ACT_MINIMIZE};
-}
-var _c=dojo.io.cookie.getCookie(jetspeed.id.DEBUG_WINDOW_TAG);
-if(_c!=null&&_c.length>0){
-var _d=_c.split("|");
-if(_d&&_d.length>=4){
-_b.width=_d[0];
-_b.height=_d[1];
-_b.top=_d[2];
-_b.left=_d[3];
-if(_d.length>4&&_d[4]!=null&&_d[4].length>0){
-_b.windowState=_d[4];
+jetspeed.debugWindowReadCookie=function(_c){
+var _d={};
+if(_c){
+_d={width:"400",height:"400",left:"320",top:"0",windowState:jetspeed.id.ACT_MINIMIZE};
+}
+var _e=dojo.io.cookie.getCookie(jetspeed.id.DEBUG_WINDOW_TAG);
+if(_e!=null&&_e.length>0){
+var _f=_e.split("|");
+if(_f&&_f.length>=4){
+_d.width=_f[0];
+_d.height=_f[1];
+_d.top=_f[2];
+_d.left=_f[3];
+if(_f.length>4&&_f[4]!=null&&_f[4].length>0){
+_d.windowState=_f[4];
 }
 }
 }
-return _b;
+return _d;
 };
 jetspeed.debugWindowRestore=function(){
-var _e=jetspeed.debugWindow();
-if(!_e){
+var _10=jetspeed.debugWindow();
+if(!_10){
 return;
 }
-_e.restoreWindow();
+_10.restoreWindow();
 };
 jetspeed.debugWindow=function(){
-var _f=jetspeed.id.PW_ID_PREFIX+jetspeed.id.DEBUG_WINDOW_TAG;
-return jetspeed.page.getPWin(_f);
+var _11=jetspeed.id.PW_ID_PREFIX+jetspeed.id.DEBUG_WINDOW_TAG;
+return jetspeed.page.getPWin(_11);
 };
 jetspeed.debugWindowId=function(){
 return jetspeed.id.PW_ID_PREFIX+jetspeed.id.DEBUG_WINDOW_TAG;
 };
 jetspeed.debugWindowSave=function(){
-var _10=jetspeed.debugWindow();
-if(!_10){
+var _12=jetspeed.debugWindow();
+if(!_12){
 return null;
 }
-if(!_10.posStatic){
-var _11=_10.getCurWinStateForPersist(false);
-var _12=_11.width,_13=_11.height,_14=_11.top,_15=_11.left;
-var _16=_10.windowState;
-if(!_16){
-_16=jetspeed.id.ACT_RESTORE;
-}
-var _17=_12+"|"+_13+"|"+_14+"|"+_15+"|"+_16;
-dojo.io.cookie.setCookie(jetspeed.id.DEBUG_WINDOW_TAG,_17,30,"/");
-var _18=dojo.io.cookie.getCookie(jetspeed.id.DEBUG_WINDOW_TAG);
+if(!_12.posStatic){
+var _13=_12.getCurWinStateForPersist(false);
+var _14=_13.width,_15=_13.height,_16=_13.top,_17=_13.left;
+var _18=_12.windowState;
+if(!_18){
+_18=jetspeed.id.ACT_RESTORE;
+}
+var _19=_14+"|"+_15+"|"+_16+"|"+_17+"|"+_18;
+dojo.io.cookie.setCookie(jetspeed.id.DEBUG_WINDOW_TAG,_19,30,"/");
+var _1a=dojo.io.cookie.getCookie(jetspeed.id.DEBUG_WINDOW_TAG);
 }
 };
-jetspeed.debugDumpForm=function(_19){
-if(!_19){
+jetspeed.debugDumpForm=function(_1b){
+if(!_1b){
 return null;
 }
-var _1a=_19.toString();
-if(_19.name){
-_1a+=" name="+_19.name;
-}
-if(_19.id){
-_1a+=" id="+_19.id;
-}
-var _1b=dojo.io.encodeForm(_19);
-_1a+=" data="+_1b;
-return _1a;
+var _1c=_1b.toString();
+if(_1b.name){
+_1c+=" name="+_1b.name;
+}
+if(_1b.id){
+_1c+=" id="+_1b.id;
+}
+var _1d=dojo.io.encodeForm(_1b);
+_1c+=" data="+_1d;
+return _1c;
 };
 jetspeed.om.DojoDebugContentRetriever=function(){
 this.initialized=false;
 };
-jetspeed.om.DojoDebugContentRetriever.prototype={getContent:function(_1c,_1d,_1e,_1f){
-if(!_1c){
-_1c={};
+jetspeed.om.DojoDebugContentRetriever.prototype={getContent:function(_1e,_1f,_20,_21){
+if(!_1e){
+_1e={};
 }
 if(!this.initialized){
-var _20=jetspeed;
-var _21="";
-var _22=_20.debug.debugContainerId;
-var _23=_20.debugWindow();
-if(_20.altDebugWindowContent){
-_21=_20.altDebugWindowContent();
+var _22=jetspeed;
+var _23="";
+var _24=_22.debug.debugContainerId;
+var _25=_22.debugWindow();
+if(_22.altDebugWindowContent){
+_23=_22.altDebugWindowContent();
 }else{
-_21+="<div id=\""+_22+"\"></div>";
+_23+="<div id=\""+_24+"\"></div>";
 }
-if(_1d){
-_1d.notifySuccess(_21,_1c.url,_1e);
+if(_1f){
+_1f.notifySuccess(_23,_1e.url,_20);
 }else{
-if(_23){
-_23.setPortletContent(_21,_1c.url);
+if(_25){
+_25.setPortletContent(_23,_1e.url);
 }
 }
 this.initialized=true;
-if(_23){
-var _24="javascript: void(jetspeed.debugWindowClear())";
-var _25="";
+if(_25){
+var _26="javascript: void(jetspeed.debugWindowClear())";
+var _27="";
 for(var i=0;i<20;i++){
-_25+="&nbsp;";
+_27+="&nbsp;";
 }
-var _27=_23.title+_25+"<a href=\""+_24+"\"><span style=\"font-size: xx-small; font-weight: normal\">Clear</span></a>";
-_23.tbTextNode.innerHTML=_27;
+var _29=_25.title+_27+"<a href=\""+_26+"\"><span id=\"_dbclrspan\" style=\"visibility: hidden; font-size: xx-small; font-weight: normal; color: blue\">Clear</span></a>";
+_25.tbTextNode.innerHTML=_29;
 }
 }
 }};
 jetspeed.debugWindowClear=function(){
-var _28=jetspeed;
-var _29=_28.debug.debugContainerId;
-var _2a=_28.debugWindow();
-document.getElementById(_29).innerHTML="";
-if(_2a&&_2a.drag){
-_2a.drag.onMouseUp(null,true);
+var _2a=jetspeed;
+var _2b=_2a.debug.debugContainerId;
+var _2c=_2a.debugWindow();
+document.getElementById(_2b).innerHTML="";
+if(_2c&&_2c.drag){
+_2c.drag.onMouseUp(null,true);
+}
+var clr=document.getElementById("_dbclrspan");
+if(clr){
+clr.style.visibility="hidden";
 }
 };
 jetspeed.debugDumpColWidths=function(){
 for(var i=0;i<jetspeed.page.columns.length;i++){
-var _2c=jetspeed.page.columns[i];
-dojo.debug("jetspeed.page.columns["+i+"] outer-width: "+dojo.html.getMarginBox(_2c.domNode).width);
+var _2f=jetspeed.page.columns[i];
+dojo.debug("jetspeed.page.columns["+i+"] outer-width: "+dojo.html.getMarginBox(_2f.domNode).width);
 }
 };
 jetspeed.debugDumpWindowsPerCol=function(){
 for(var i=0;i<jetspeed.page.columns.length;i++){
-var _2e=jetspeed.page.columns[i];
-var _2f=jetspeed.ui.getPWinAndColChildren(_2e.domNode,null);
-var _30=jetspeed.ui.getPWinsFromNodes(_2f.matchingNodes);
-var _31={dumpMsg:""};
-if(_30!=null){
-dojo.lang.forEach(_30,function(_32){
-_31.dumpMsg=_31.dumpMsg+(_31.dumpMsg.length>0?", ":"")+_32.portlet.entityId;
+var _31=jetspeed.page.columns[i];
+var _32=jetspeed.ui.getPWinAndColChildren(_31.domNode,null);
+var _33=jetspeed.ui.getPWinsFromNodes(_32.matchingNodes);
+var _34={dumpMsg:""};
+if(_33!=null){
+dojo.lang.forEach(_33,function(_35){
+_34.dumpMsg=_34.dumpMsg+(_34.dumpMsg.length>0?", ":"")+_35.portlet.entityId;
 });
 }
-_31.dumpMsg="column "+i+": "+_31.dumpMsg;
-dojo.debug(_31.dumpMsg);
+_34.dumpMsg="column "+i+": "+_34.dumpMsg;
+dojo.debug(_34.dumpMsg);
 }
 };
 jetspeed.debugDumpWindows=function(){
-var _33=jetspeed.page.getPWins();
-var _34="";
-for(var i=0;i<_33.length;i++){
+var _36=jetspeed.page.getPWins();
+var _37="";
+for(var i=0;i<_36.length;i++){
 if(i>0){
-_34+=", ";
+_37+=", ";
 }
-_34+=_33[i].widgetId;
+_37+=_36[i].widgetId;
 }
-dojo.debug("PortletWindows: "+_34);
+dojo.debug("PortletWindows: "+_37);
 };
 jetspeed.debugLayoutInfo=function(){
-var _36=jetspeed.page;
-var _37="";
+var _39=jetspeed.page;
+var _3a="";
 var i=0;
-for(var _39 in _36.layouts){
+for(var _3c in _39.layouts){
 if(i>0){
-_37+="\r\n";
+_3a+="\r\n";
 }
-_37+="layout["+_39+"]: "+jetspeed.printobj(_36.layouts[_39],true,true,true);
+_3a+="layout["+_3c+"]: "+jetspeed.printobj(_39.layouts[_3c],true,true,true);
 i++;
 }
-return _37;
+return _3a;
 };
-jetspeed.debugColumns=function(_3a,_3b){
-var _3c=jetspeed;
-var _3d=_3c.page;
-var _3e=(!_3b);
-var _3f=_3d.columns,col;
-if(!_3f){
+jetspeed.debugColumns=function(_3d,_3e){
+var _3f=jetspeed;
+var _40=_3f.page;
+var _41=(!_3e);
+var _42=_40.columns,col;
+if(!_42){
 return null;
 }
-var _41=dojo.byId(_3c.id.COLUMNS);
-var _42="";
-var _43=!_3a;
-return _3c._debugColumnTree(_3e,_41,_42,"\r\n",_3c.debugindentT,_43,_3c,_3d);
-};
-jetspeed._debugColumnTree=function(_44,_45,_46,_47,_48,_49,_4a,_4b){
-var _4c=_4a.ui.getPWinAndColChildren(_45,null,false,true,true,_49);
-var _4d=_4c.matchingNodes;
-if(!_4d||_4d.length==0){
-return _46;
-}
-var _4e,col,_50,_51,_52=(_47+_48);
-for(var i=0;i<_4d.length;i++){
-_4e=_4d[i];
-col=_4b.getColFromColNode(_4e);
-_50=null;
+var _44=dojo.byId(_3f.id.COLUMNS);
+var _45="";
+var _46=!_3d;
+return _3f._debugColumnTree(_41,_44,_45,"\r\n",_3f.debugindentT,_46,_3f,_40);
+};
+jetspeed._debugColumnTree=function(_47,_48,_49,_4a,_4b,_4c,_4d,_4e){
+var _4f=_4d.ui.getPWinAndColChildren(_48,null,false,true,true,_4c);
+var _50=_4f.matchingNodes;
+if(!_50||_50.length==0){
+return _49;
+}
+var _51,col,_53,_54,_55=(_4a+_4b);
+for(var i=0;i<_50.length;i++){
+_51=_50[i];
+col=_4e.getColFromColNode(_51);
+_53=null;
 if(!col){
-_50=_4b.getPWinFromNode(_4e);
+_53=_4e.getPWinFromNode(_51);
 }
-_46+=_47;
+_49+=_4a;
 if(col){
-_46+=_4a.debugColumn(col,_44);
-_46=_4a._debugColumnTree(_44,_4e,_46,_52,_48,_49,_4a,_4b);
+_49+=_4d.debugColumn(col,_47);
+_49=_4d._debugColumnTree(_47,_51,_49,_55,_4b,_4c,_4d,_4e);
 }else{
-if(_50){
-_51=_50.title;
-_46+=_50.widgetId+((_51&&_51.length>0)?(" - "+_51):"");
+if(_53){
+_54=_53.title;
+_49+=_53.widgetId+((_54&&_54.length>0)?(" - "+_54):"");
 }else{
-_46+=_4a.debugNode(_4e);
+_49+=_4d.debugNode(_51);
 }
 }
 }
-return _46;
+return _49;
 };
-jetspeed.debugColumn=function(col,_55){
+jetspeed.debugColumn=function(col,_58){
 if(!col){
 return null;
 }
-var _56=col.domNode;
+var _59=col.domNode;
 var out="column["+dojo.string.padLeft(String(col.pageColumnIndex),2," ")+"]";
-out+=" layoutHeader="+(col.layoutHeader?"T":"F")+" id="+(_56!=null?_56.id:"null")+" layoutCol="+col.layoutColumnIndex+" layoutId="+col.layoutId+" size="+col.size;
-if(_56!=null&&!_55){
-var _58=dojo.html.getAbsolutePosition(_56,true);
-var _59=dojo.html.getMarginBox(_56);
-out+=" dims={"+"l="+(_58.x)+" t="+(_58.y)+" r="+(_58.x+_59.width)+" b="+(_58.y+_59.height)+" wOff="+_56.offsetWidth+" hOff="+_56.offsetHeight+" wCl="+_56.clientWidth+" hCl="+_56.clientHeight+"}";
+out+=" layoutHeader="+(col.layoutHeader?"T":"F")+" id="+(_59!=null?_59.id:"null")+" layoutCol="+col.layoutColumnIndex+" layoutId="+col.layoutId+" size="+col.size+(col.layoutDepth!=null?(" depth="+col.layoutDepth):"")+(col.layoutMaxChildDepth>0?(" childDepth="+col.layoutMaxChildDepth):"")+(col.layoutActionsDisabled?" noLayout=true":"");
+if(_59!=null&&!_58){
+var _5b=dojo.html.getAbsolutePosition(_59,true);
+var _5c=dojo.html.getMarginBox(_59);
+out+=" dims={"+"l="+(_5b.x)+" t="+(_5b.y)+" r="+(_5b.x+_5c.width)+" b="+(_5b.y+_5c.height)+" wOff="+_59.offsetWidth+" hOff="+_59.offsetHeight+" wCl="+_59.clientWidth+" hCl="+_59.clientHeight+"}";
 }
 return out;
 };
@@ -266,173 +277,173 @@
 return jetspeed.debugWinStateAll(false);
 };
 jetspeed.debugPortletActions=function(){
-var _5a=jetspeed.page.getPortletArray();
-var _5b="";
-for(var i=0;i<_5a.length;i++){
-var _5d=_5a[i];
+var _5d=jetspeed.page.getPortletArray();
+var _5e="";
+for(var i=0;i<_5d.length;i++){
+var _60=_5d[i];
 if(i>0){
-_5b+="\r\n";
+_5e+="\r\n";
 }
-_5b+="portlet ["+_5d.name+"] actions: {";
-for(var _5e in _5d.actions){
-_5b+=_5e+"={"+jetspeed.printobj(_5d.actions[_5e],true)+"} ";
+_5e+="portlet ["+_60.name+"] actions: {";
+for(var _61 in _60.actions){
+_5e+=_61+"={"+jetspeed.printobj(_60.actions[_61],true)+"} ";
 }
-_5b+="}";
+_5e+="}";
 }
-return _5b;
+return _5e;
 };
-jetspeed.debugWinStateAll=function(_5f){
-var _60=jetspeed.page.getPortletArray();
-var _61="";
-for(var i=0;i<_60.length;i++){
-var _63=_60[i];
+jetspeed.debugWinStateAll=function(_62){
+var _63=jetspeed.page.getPortletArray();
+var _64="";
+for(var i=0;i<_63.length;i++){
+var _66=_63[i];
 if(i>0){
-_61+="\r\n";
+_64+="\r\n";
 }
-var _64=null;
+var _67=null;
 try{
-if(_5f){
-_64=_63.getSavedWinState();
+if(_62){
+_67=_66.getSavedWinState();
 }else{
-_64=_63.getCurWinState();
+_67=_66.getCurWinState();
 }
 }
 catch(e){
 }
-_61+="["+_63.name+"] "+((_64==null)?"null":jetspeed.printobj(_64,true));
+_64+="["+_66.name+"] "+((_67==null)?"null":jetspeed.printobj(_67,true));
 }
-return _61;
+return _64;
 };
-jetspeed.debugPWinPos=function(_65){
-var _66=jetspeed;
-var _67=dojo;
-var _68=_66.UAie;
-var djH=_67.html;
-var _6a=_65.domNode;
-var _6b=_65.containerNode;
-var _6c=_65.tbNode;
-var _6d=_65.rbNode;
-var _6e=djH.getAbsolutePosition(_6a,true);
-var _6f=djH.getAbsolutePosition(_6b,true);
-var _70=djH.getAbsolutePosition(_6c,true);
+jetspeed.debugPWinPos=function(_68){
+var _69=jetspeed;
+var _6a=dojo;
+var _6b=_69.UAie;
+var djH=_6a.html;
+var _6d=_68.domNode;
+var _6e=_68.containerNode;
+var _6f=_68.tbNode;
+var _70=_68.rbNode;
 var _71=djH.getAbsolutePosition(_6d,true);
-var _72=_67.gcs(_6a),_73=_67.gcs(_6b),_74=_67.gcs(_6c),_75=_67.gcs(_6d);
-var _76=null;
-if(_66.UAie6){
-_76=djH.getAbsolutePosition(_65.bgIframe.iframe,true);
-}
-var _77=null;
-var _78=null;
+var _72=djH.getAbsolutePosition(_6e,true);
+var _73=djH.getAbsolutePosition(_6f,true);
+var _74=djH.getAbsolutePosition(_70,true);
+var _75=_6a.gcs(_6d),_76=_6a.gcs(_6e),_77=_6a.gcs(_6f),_78=_6a.gcs(_70);
 var _79=null;
-if(_65.iframesInfo!=null&&_65.iframesInfo.iframeCover!=null){
-_77=_65.iframesInfo.iframeCover;
-_78=djH.getAbsolutePosition(_77,true);
-_79=_67.gcs(_77);
-}
-var _7a=_65._getLayoutInfo();
-var ind=_66.debugindent;
-var _7c=_66.debugindentH;
-_67.hostenv.println("wnd-dims ["+_65.widgetId+"  "+_65.title+"]"+"  z="+_6a.style.zIndex+" hfit="+_65.heightToFit);
-_67.hostenv.println(ind+"d.abs {x="+_6e.x+" y="+_6e.y+"}"+(_68?("  hasLayout="+_6a.currentStyle.hasLayout):""));
-_67.hostenv.println(ind+"c.abs {x="+_6f.x+" y="+_6f.y+"}"+(_68?("  hasLayout="+_6b.currentStyle.hasLayout):""));
-_67.hostenv.println(ind+"t.abs {x="+_70.x+" y="+_70.y+"}"+(_68?("  hasLayout="+_6c.currentStyle.hasLayout):""));
-_67.hostenv.println(ind+"r.abs {x="+_71.x+" y="+_71.y+"}"+(_68?("  hasLayout="+_6d.currentStyle.hasLayout):""));
-if(_76!=null){
-_67.hostenv.println(ind+"ibg.abs {x="+_76.x+" y="+_76.y+"}"+_7c+" z="+_65.bgIframe.iframe.currentStyle.zIndex+(_68?(" hasLayout="+_65.bgIframe.iframe.currentStyle.hasLayout):""));
-}
-if(_78!=null){
-_67.hostenv.println(ind+"icv.abs {x="+_78.x+" y="+_78.y+"}"+_7c+" z="+_79.zIndex+(_68?(" hasLayout="+_77.currentStyle.hasLayout):""));
-}
-_67.hostenv.println(ind+"d.mb "+_66.debugDims(_67.getMarginBox(_6a,_72,_66))+_7c+" d.offset {w="+_6a.offsetWidth+" h="+_6a.offsetHeight+"}");
-_67.hostenv.println(ind+"d.cb "+_66.debugDims(_67.getContentBox(_6a,_72,_66))+_7c+" d.client {w="+_6a.clientWidth+" h="+_6a.clientHeight+"}");
-_67.hostenv.println(ind+"d.style {"+_66._debugPWinStyle(_6a,_72,"width",true)+_66._debugPWinStyle(_6a,_72,"height")+_7c+_66._debugPWinStyle(_6a,_72,"left")+_66._debugPWinStyle(_6a,_72,"top")+_7c+" pos="+_72.position.substring(0,1)+" ofx="+_72.overflowX.substring(0,1)+" ofy="+_72.overflowY.substring(0,1)+"}");
-_67.hostenv.println(ind+"c.mb "+_66.debugDims(_67.getMarginBox(_6b,_73,_66))+_7c+" c.offset {w="+_6b.offsetWidth+" h="+_6b.offsetHeight+"}");
-_67.hostenv.println(ind+"c.cb "+_66.debugDims(_67.getContentBox(_6b,_73,_66))+_7c+" c.client {w="+_6b.clientWidth+" h="+_6b.clientHeight+"}");
-_67.hostenv.println(ind+"c.style {"+_66._debugPWinStyle(_6b,_73,"width",true)+_66._debugPWinStyle(_6b,_73,"height")+_7c+_66._debugPWinStyle(_6b,_73,"left")+_66._debugPWinStyle(_6b,_73,"top")+_7c+" ofx="+_73.overflowX.substring(0,1)+" ofy="+_73.overflowY.substring(0,1)+" d="+_73.display.substring(0,1)+"}");
-_67.hostenv.println(ind+"t.mb "+_66.debugDims(_67.getMarginBox(_6c,_74,_66))+_7c+" t.offset {w="+_6c.offsetWidth+" h="+_6c.offsetHeight+"}");
-_67.hostenv.println(ind+"t.cb "+_66.debugDims(_67.getContentBox(_6c,_74,_66))+_7c+" t.client {w="+_6c.clientWidth+" h="+_6c.clientHeight+"}");
-_67.hostenv.println(ind+"t.style {"+_66._debugPWinStyle(_6c,_74,"width",true)+_66._debugPWinStyle(_6c,_74,"height")+_7c+_66._debugPWinStyle(_6c,_74,"left")+_66._debugPWinStyle(_6c,_74,"top")+"}");
-_67.hostenv.println(ind+"r.mb "+_66.debugDims(_67.getMarginBox(_6d,_75,_66))+_7c+" r.offset {w="+_6d.offsetWidth+" h="+_6d.offsetHeight+"}");
-_67.hostenv.println(ind+"r.cb "+_66.debugDims(_67.getContentBox(_6d,_75,_66))+_7c+" r.client {w="+_6d.clientWidth+" h="+_6d.clientHeight+"}");
-_67.hostenv.println(ind+"r.style {"+_66._debugPWinStyle(_6d,_75,"width",true)+_66._debugPWinStyle(_6d,_75,"height")+_7c+_66._debugPWinStyle(_6d,_75,"left")+_66._debugPWinStyle(_6d,_75,"top")+"}");
-if(_76!=null){
-var _7d=_65.bgIframe.iframe;
-var _7e=_67.gcs(_7d);
-_67.hostenv.println(ind+"ibg.mb "+_66.debugDims(_67.getMarginBox(_7d,_7e,_66)));
-_67.hostenv.println(ind+"ibg.cb "+_66.debugDims(_67.getContentBox(_7d,_7e,_66)));
-_67.hostenv.println(ind+"ibg.style {"+_66._debugPWinStyle(_7d,_7e,"width",true)+_66._debugPWinStyle(_7d,_7e,"height")+_7c+_66._debugPWinStyle(_7d,_7e,"left")+_66._debugPWinStyle(_7d,_7e,"top")+_7c+" pos="+_7e.position.substring(0,1)+" ofx="+_7e.overflowX.substring(0,1)+" ofy="+_7e.overflowY.substring(0,1)+" d="+_7e.display.substring(0,1)+"}");
-}
-if(_77){
-_67.hostenv.println(ind+"icv.mb "+_66.debugDims(_67.getMarginBox(_77,_79,_66)));
-_67.hostenv.println(ind+"icv.cb "+_66.debugDims(_67.getContentBox(_77,_79,_66)));
-_67.hostenv.println(ind+"icv.style {"+_66._debugPWinStyle(_77,_79,"width",true)+_66._debugPWinStyle(_77,_79,"height")+_7c+_66._debugPWinStyle(_77,_79,"left")+_66._debugPWinStyle(_77,_79,"top")+_7c+" pos="+_79.position.substring(0,1)+" ofx="+_79.overflowX.substring(0,1)+" ofy="+_79.overflowY.substring(0,1)+" d="+_79.display.substring(0,1)+"}");
-}
-var leN=_7a.dNode;
-_67.hostenv.println(ind+"dLE {"+"-w="+leN.lessW+" -h="+leN.lessH+" mw="+leN.mE.w+" mh="+leN.mE.h+" bw="+leN.bE.w+" bh="+leN.bE.h+" pw="+leN.pE.w+" ph="+leN.pE.h+"}");
-leN=_7a.cNode;
-_67.hostenv.println(ind+"cLE {"+"-w="+leN.lessW+" -h="+leN.lessH+" mw="+leN.mE.w+" mh="+leN.mE.h+" bw="+leN.bE.w+" bh="+leN.bE.h+" pw="+leN.pE.w+" ph="+leN.pE.h+"}");
-leN=_7a.tbNode;
-_67.hostenv.println(ind+"tLE {"+"-w="+leN.lessW+" -h="+leN.lessH+" mw="+leN.mE.w+" mh="+leN.mE.h+" bw="+leN.bE.w+" bh="+leN.bE.h+" pw="+leN.pE.w+" ph="+leN.pE.h+"}");
-leN=_7a.rbNode;
-_67.hostenv.println(ind+"rLE {"+"-w="+leN.lessW+" -h="+leN.lessH+" mw="+leN.mE.w+" mh="+leN.mE.h+" bw="+leN.bE.w+" bh="+leN.bE.h+" pw="+leN.pE.w+" ph="+leN.pE.h+"}");
-_67.hostenv.println(ind+"cNode_mBh_LessBars="+_7a.cNode_mBh_LessBars);
-_67.hostenv.println(ind+"dimsTiled "+_66.debugDims(_65.dimsTiled));
-_67.hostenv.println(ind+"dimsUntiled "+_66.debugDims(_65.dimsUntiled));
-if(_65.dimsTiledTemp!=null){
-_67.hostenv.println(ind+"dimsTiledTemp "+_66.debugDims(_65.dimsTiledTemp));
-}
-if(_65.dimsUntiledTemp!=null){
-_67.hostenv.println(ind+"dimsUntiledTemp="+_66.debugDims(_65.dimsUntiledTemp));
-}
-_67.hostenv.println(ind+"--------------------");
-},jetspeed.debugDims=function(box,_81){
-return ("{w="+(box.w==undefined?(box.width==undefined?"null":box.width):box.w)+" h="+(box.h==undefined?(box.height==undefined?"null":box.height):box.h)+(box.l!=undefined?(" l="+box.l):(box.left==undefined?"":(" l="+box.left)))+(box.t!=undefined?(" t="+box.t):(box.top==undefined?"":(" t="+box.top)))+(box.right!=undefined?(" r="+box.right):"")+(box.bottom!=undefined?(" b="+box.bottom):"")+(!_81?"}":""));
-};
-jetspeed._debugPWinStyle=function(_82,_83,_84,_85){
-var _86=_82.style[_84];
-var _87=_83[_84];
-if(_86=="auto"){
-_86="a";
-}
-if(_87=="auto"){
-_87="a";
-}
-var _88=null;
-if(_86==_87){
-_88=("\""+_87+"\"");
+if(_69.UAie6){
+_79=djH.getAbsolutePosition(_68.bgIframe.iframe,true);
+}
+var _7a=null;
+var _7b=null;
+var _7c=null;
+if(_68.iframesInfo!=null&&_68.iframesInfo.iframeCover!=null){
+_7a=_68.iframesInfo.iframeCover;
+_7b=djH.getAbsolutePosition(_7a,true);
+_7c=_6a.gcs(_7a);
+}
+var _7d=_68._getLayoutInfo();
+var ind=_69.debugindent;
+var _7f=_69.debugindentH;
+_6a.hostenv.println("wnd-dims ["+_68.widgetId+"  "+_68.title+"]"+"  z="+_6d.style.zIndex+" hfit="+_68.heightToFit);
+_6a.hostenv.println(ind+"d.abs {x="+_71.x+" y="+_71.y+"}"+(_6b?("  hasLayout="+_6d.currentStyle.hasLayout):""));
+_6a.hostenv.println(ind+"c.abs {x="+_72.x+" y="+_72.y+"}"+(_6b?("  hasLayout="+_6e.currentStyle.hasLayout):""));
+_6a.hostenv.println(ind+"t.abs {x="+_73.x+" y="+_73.y+"}"+(_6b?("  hasLayout="+_6f.currentStyle.hasLayout):""));
+_6a.hostenv.println(ind+"r.abs {x="+_74.x+" y="+_74.y+"}"+(_6b?("  hasLayout="+_70.currentStyle.hasLayout):""));
+if(_79!=null){
+_6a.hostenv.println(ind+"ibg.abs {x="+_79.x+" y="+_79.y+"}"+_7f+" z="+_68.bgIframe.iframe.currentStyle.zIndex+(_6b?(" hasLayout="+_68.bgIframe.iframe.currentStyle.hasLayout):""));
+}
+if(_7b!=null){
+_6a.hostenv.println(ind+"icv.abs {x="+_7b.x+" y="+_7b.y+"}"+_7f+" z="+_7c.zIndex+(_6b?(" hasLayout="+_7a.currentStyle.hasLayout):""));
+}
+_6a.hostenv.println(ind+"d.mb "+_69.debugDims(_6a.getMarginBox(_6d,_75,_69))+_7f+" d.offset {w="+_6d.offsetWidth+" h="+_6d.offsetHeight+"}");
+_6a.hostenv.println(ind+"d.cb "+_69.debugDims(_6a.getContentBox(_6d,_75,_69))+_7f+" d.client {w="+_6d.clientWidth+" h="+_6d.clientHeight+"}");
+_6a.hostenv.println(ind+"d.style {"+_69._debugPWinStyle(_6d,_75,"width",true)+_69._debugPWinStyle(_6d,_75,"height")+_7f+_69._debugPWinStyle(_6d,_75,"left")+_69._debugPWinStyle(_6d,_75,"top")+_7f+" pos="+_75.position.substring(0,1)+" ofx="+_75.overflowX.substring(0,1)+" ofy="+_75.overflowY.substring(0,1)+"}");
+_6a.hostenv.println(ind+"c.mb "+_69.debugDims(_6a.getMarginBox(_6e,_76,_69))+_7f+" c.offset {w="+_6e.offsetWidth+" h="+_6e.offsetHeight+"}");
+_6a.hostenv.println(ind+"c.cb "+_69.debugDims(_6a.getContentBox(_6e,_76,_69))+_7f+" c.client {w="+_6e.clientWidth+" h="+_6e.clientHeight+"}");
+_6a.hostenv.println(ind+"c.style {"+_69._debugPWinStyle(_6e,_76,"width",true)+_69._debugPWinStyle(_6e,_76,"height")+_7f+_69._debugPWinStyle(_6e,_76,"left")+_69._debugPWinStyle(_6e,_76,"top")+_7f+" ofx="+_76.overflowX.substring(0,1)+" ofy="+_76.overflowY.substring(0,1)+" d="+_76.display.substring(0,1)+"}");
+_6a.hostenv.println(ind+"t.mb "+_69.debugDims(_6a.getMarginBox(_6f,_77,_69))+_7f+" t.offset {w="+_6f.offsetWidth+" h="+_6f.offsetHeight+"}");
+_6a.hostenv.println(ind+"t.cb "+_69.debugDims(_6a.getContentBox(_6f,_77,_69))+_7f+" t.client {w="+_6f.clientWidth+" h="+_6f.clientHeight+"}");
+_6a.hostenv.println(ind+"t.style {"+_69._debugPWinStyle(_6f,_77,"width",true)+_69._debugPWinStyle(_6f,_77,"height")+_7f+_69._debugPWinStyle(_6f,_77,"left")+_69._debugPWinStyle(_6f,_77,"top")+"}");
+_6a.hostenv.println(ind+"r.mb "+_69.debugDims(_6a.getMarginBox(_70,_78,_69))+_7f+" r.offset {w="+_70.offsetWidth+" h="+_70.offsetHeight+"}");
+_6a.hostenv.println(ind+"r.cb "+_69.debugDims(_6a.getContentBox(_70,_78,_69))+_7f+" r.client {w="+_70.clientWidth+" h="+_70.clientHeight+"}");
+_6a.hostenv.println(ind+"r.style {"+_69._debugPWinStyle(_70,_78,"width",true)+_69._debugPWinStyle(_70,_78,"height")+_7f+_69._debugPWinStyle(_70,_78,"left")+_69._debugPWinStyle(_70,_78,"top")+"}");
+if(_79!=null){
+var _80=_68.bgIframe.iframe;
+var _81=_6a.gcs(_80);
+_6a.hostenv.println(ind+"ibg.mb "+_69.debugDims(_6a.getMarginBox(_80,_81,_69)));
+_6a.hostenv.println(ind+"ibg.cb "+_69.debugDims(_6a.getContentBox(_80,_81,_69)));
+_6a.hostenv.println(ind+"ibg.style {"+_69._debugPWinStyle(_80,_81,"width",true)+_69._debugPWinStyle(_80,_81,"height")+_7f+_69._debugPWinStyle(_80,_81,"left")+_69._debugPWinStyle(_80,_81,"top")+_7f+" pos="+_81.position.substring(0,1)+" ofx="+_81.overflowX.substring(0,1)+" ofy="+_81.overflowY.substring(0,1)+" d="+_81.display.substring(0,1)+"}");
+}
+if(_7a){
+_6a.hostenv.println(ind+"icv.mb "+_69.debugDims(_6a.getMarginBox(_7a,_7c,_69)));
+_6a.hostenv.println(ind+"icv.cb "+_69.debugDims(_6a.getContentBox(_7a,_7c,_69)));
+_6a.hostenv.println(ind+"icv.style {"+_69._debugPWinStyle(_7a,_7c,"width",true)+_69._debugPWinStyle(_7a,_7c,"height")+_7f+_69._debugPWinStyle(_7a,_7c,"left")+_69._debugPWinStyle(_7a,_7c,"top")+_7f+" pos="+_7c.position.substring(0,1)+" ofx="+_7c.overflowX.substring(0,1)+" ofy="+_7c.overflowY.substring(0,1)+" d="+_7c.display.substring(0,1)+"}");
+}
+var leN=_7d.dNode;
+_6a.hostenv.println(ind+"dLE {"+"-w="+leN.lessW+" -h="+leN.lessH+" mw="+leN.mE.w+" mh="+leN.mE.h+" bw="+leN.bE.w+" bh="+leN.bE.h+" pw="+leN.pE.w+" ph="+leN.pE.h+"}");
+leN=_7d.cNode;
+_6a.hostenv.println(ind+"cLE {"+"-w="+leN.lessW+" -h="+leN.lessH+" mw="+leN.mE.w+" mh="+leN.mE.h+" bw="+leN.bE.w+" bh="+leN.bE.h+" pw="+leN.pE.w+" ph="+leN.pE.h+"}");
+leN=_7d.tbNode;
+_6a.hostenv.println(ind+"tLE {"+"-w="+leN.lessW+" -h="+leN.lessH+" mw="+leN.mE.w+" mh="+leN.mE.h+" bw="+leN.bE.w+" bh="+leN.bE.h+" pw="+leN.pE.w+" ph="+leN.pE.h+"}");
+leN=_7d.rbNode;
+_6a.hostenv.println(ind+"rLE {"+"-w="+leN.lessW+" -h="+leN.lessH+" mw="+leN.mE.w+" mh="+leN.mE.h+" bw="+leN.bE.w+" bh="+leN.bE.h+" pw="+leN.pE.w+" ph="+leN.pE.h+"}");
+_6a.hostenv.println(ind+"cNode_mBh_LessBars="+_7d.cNode_mBh_LessBars);
+_6a.hostenv.println(ind+"dimsTiled "+_69.debugDims(_68.dimsTiled));
+_6a.hostenv.println(ind+"dimsUntiled "+_69.debugDims(_68.dimsUntiled));
+if(_68.dimsTiledTemp!=null){
+_6a.hostenv.println(ind+"dimsTiledTemp "+_69.debugDims(_68.dimsTiledTemp));
+}
+if(_68.dimsUntiledTemp!=null){
+_6a.hostenv.println(ind+"dimsUntiledTemp="+_69.debugDims(_68.dimsUntiledTemp));
+}
+_6a.hostenv.println(ind+"--------------------");
+},jetspeed.debugDims=function(box,_84){
+return ("{w="+(box.w==undefined?(box.width==undefined?"null":box.width):box.w)+" h="+(box.h==undefined?(box.height==undefined?"null":box.height):box.h)+(box.l!=undefined?(" l="+box.l):(box.left==undefined?"":(" l="+box.left)))+(box.t!=undefined?(" t="+box.t):(box.top==undefined?"":(" t="+box.top)))+(box.right!=undefined?(" r="+box.right):"")+(box.bottom!=undefined?(" b="+box.bottom):"")+(!_84?"}":""));
+};
+jetspeed._debugPWinStyle=function(_85,_86,_87,_88){
+var _89=_85.style[_87];
+var _8a=_86[_87];
+if(_89=="auto"){
+_89="a";
+}
+if(_8a=="auto"){
+_8a="a";
+}
+var _8b=null;
+if(_89==_8a){
+_8b=("\""+_8a+"\"");
 }else{
-_88=("\""+_86+"\"/"+_87);
+_8b=("\""+_89+"\"/"+_8a);
 }
-return ((_85?"":" ")+_84.substring(0,1)+"="+_88);
+return ((_88?"":" ")+_87.substring(0,1)+"="+_8b);
 };
 if(jetspeed.debug.profile){
-dojo.profile.clearItem=function(_89){
-return (this._profiles[_89]={iters:0,total:0});
+dojo.profile.clearItem=function(_8c){
+return (this._profiles[_8c]={iters:0,total:0});
 };
-dojo.profile.debugItem=function(_8a,_8b){
-var _8c=this._profiles[_8a];
-if(_8c==null){
+dojo.profile.debugItem=function(_8d,_8e){
+var _8f=this._profiles[_8d];
+if(_8f==null){
 return null;
 }
-if(_8c.iters==0){
-return [_8a," not profiled."].join("");
+if(_8f.iters==0){
+return [_8d," not profiled."].join("");
 }
-var _8d=[_8a," took ",_8c.total," msec for ",_8c.iters," iteration"];
-if(_8c.iters>1){
-_8d.push("s (",(Math.round(_8c.total/_8c.iters*100)/100)," msec each)");
+var _90=[_8d," took ",_8f.total," msec for ",_8f.iters," iteration"];
+if(_8f.iters>1){
+_90.push("s (",(Math.round(_8f.total/_8f.iters*100)/100)," msec each)");
 }
-dojo.debug(_8d.join(""));
-if(_8b){
-this.clearItem(_8a);
+dojo.debug(_90.join(""));
+if(_8e){
+this.clearItem(_8d);
 }
 };
-dojo.profile.debugAllItems=function(_8e){
+dojo.profile.debugAllItems=function(_91){
 for(var x=0;x<this._pns.length;x++){
-this.debugItem(this._pns[x],_8e);
+this.debugItem(this._pns[x],_91);
 }
 };
 }
-window.getPWin=function(_90){
-return jetspeed.page.getPWin(_90);
+window.getPWin=function(_93){
+return jetspeed.page.getPWin(_93);
 };
 

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/desktop/debug.src.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/desktop/debug.src.js?rev=595411&r1=595410&r2=595411&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/desktop/debug.src.js (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/desktop/debug.src.js Thu Nov 15 12:06:54 2007
@@ -62,7 +62,7 @@
 //jetspeed.debugContentDumpIds = [ "getmenus", "getmenu-.*" ];    // dump getmenus response and all getmenu responses
 //jetspeed.debugContentDumpIds = [ "page-.*" ];                   // dump page psml response
 //jetspeed.debugContentDumpIds = [ "js-cp-selector.2" ];          // dump portlet selector content
-//jetspeed.debugContentDumpIds = [ "moveabs-layout", "moveabs", "move", "addportlet" ];   // dump move and addportlet responses
+//jetspeed.debugContentDumpIds = [ "moveabs-layout", "moveabs", "move", "addportlet", "getuserinfo" ];   // dump move and addportlet responses
 //jetspeed.debugContentDumpIds = [ "js-cp-selector.*" ];          // dump portlet selector
 
 
@@ -104,7 +104,17 @@
         pwP.retrieveContent( null, null );
         var dbWW = jsObj.page.getPWin( dbWId );
 
-        djObj.event.connect( "after", djObj.hostenv, "println", dbWW, "contentChanged" );
+        dbWW.dbContentAdded = function( evt )
+        {
+            this.contentChanged( evt );
+            var clr = document.getElementById("_dbclrspan");
+            if ( clr )
+            {
+                clr.style.visibility = "visible";
+            }
+        };
+
+        djObj.event.connect( "after", djObj.hostenv, "println", dbWW, "dbContentAdded" );
     
         djObj.event.connect( dbWW, "actionBtnSync", jsObj, "debugWindowSave" );
         djObj.event.connect( dbWW, "endSizing", jsObj, "debugWindowSave" );
@@ -209,7 +219,7 @@
                 var indent = "";
                 for ( var i = 0 ; i < 20 ; i++ )
                     indent += "&nbsp;";
-                var titleWithClearAnchor = dbWindow.title + indent + '<a href="' + clearJS + '"><span style="font-size: xx-small; font-weight: normal">Clear</span></a>';
+                var titleWithClearAnchor = dbWindow.title + indent + '<a href="' + clearJS + '"><span id="_dbclrspan" style="visibility: hidden; font-size: xx-small; font-weight: normal; color: blue">Clear</span></a>';
                 dbWindow.tbTextNode.innerHTML = titleWithClearAnchor;
             }
         }
@@ -224,6 +234,11 @@
     document.getElementById(dbNodeId).innerHTML='';
     if ( dbWindow && dbWindow.drag )
         dbWindow.drag.onMouseUp( null, true );
+    var clr = document.getElementById("_dbclrspan");
+    if ( clr )
+    {
+        clr.style.visibility = "hidden";
+    }
 };
 
 // debug info functions
@@ -329,8 +344,8 @@
     if ( ! col ) return null;
     var dNodeCol = col.domNode;
     var out = "column[" + dojo.string.padLeft( String(col.pageColumnIndex), 2, " " ) + "]";
-    out += " layoutHeader=" + ( col.layoutHeader ? "T" : "F" ) + " id=" + ( dNodeCol != null ? dNodeCol.id : "null" ) + " layoutCol=" + col.layoutColumnIndex + " layoutId=" + col.layoutId + " size=" + col.size;
-    if ( dNodeCol != null && ! suppressDims )
+    out += " layoutHeader=" + ( col.layoutHeader ? "T" : "F" ) + " id=" + ( dNodeCol != null ? dNodeCol.id : "null" ) + " layoutCol=" + col.layoutColumnIndex + " layoutId=" + col.layoutId + " size=" + col.size + ( col.layoutDepth != null ? ( " depth=" + col.layoutDepth ) : "" ) + ( col.layoutMaxChildDepth > 0 ? ( " childDepth=" + col.layoutMaxChildDepth ) : "" ) + ( col.layoutActionsDisabled ? " noLayout=true" : "" );
+    if ( dNodeCol != null && ! suppressDims ) // layoutActionsDisabled
     {
         //var colCompStyle = dojo.gcs( dNodeCol );
         var colAbsPos = dojo.html.getAbsolutePosition( dNodeCol, true );

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/selector.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/selector.js?rev=595411&r1=595410&r2=595411&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/selector.js (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/selector.js Thu Nov 15 12:06:54 2007
@@ -41,27 +41,19 @@
 this.portletDef=_e;
 };
 jetspeed.selector.PortletAddAjaxApiCallbackCL.prototype={notifySuccess:function(_f,_10,_11){
-jetspeed.url.checkAjaxApiResponse(_10,_f,true,"add-portlet");
-},parseAddPortletResponse:function(_12){
-var _13=null;
-var _14=_12.getElementsByTagName("js");
-if(!_14||_14.length>1){
-dojo.raise("unexpected zero or multiple <js> elements in portlet selector xml");
+var _12=jetspeed;
+var _13=_12.url.checkAjaxApiResponse(_10,_f,["refresh"],true,"add-portlet");
+if(_13=="refresh"&&_12.page!=null){
+var _14=_12.page.getPageUrl();
+if(_14!=null){
+if(!_12.prefs.ajaxPageNavigation){
+_12.pageNavigate(_14,null,true);
+}else{
+_12.updatePage(_14,false,true);
 }
-var _15=_14[0].childNodes;
-for(var i=0;i<_15.length;i++){
-var _17=_15[i];
-if(_17.nodeType!=1){
-continue;
 }
-var _18=_17.nodeName;
-if(_18=="entity"){
-_13=((_17&&_17.firstChild)?_17.firstChild.nodeValue:null);
-break;
 }
-}
-return _13;
-},notifyFailure:function(_19,_1a,_1b,_1c){
-dojo.raise("PortletAddAjaxApiCallbackCL error ["+_1c.toString()+"] url: "+_1b+" type: "+_19+jetspeed.formatError(_1a));
+},notifyFailure:function(_15,_16,_17,_18){
+dojo.raise("PortletAddAjaxApiCallbackCL error ["+_18.toString()+"] url: "+_17+" type: "+_15+jetspeed.formatError(_16));
 }};
 

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/selector.src.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/selector.src.js?rev=595411&r1=595410&r2=595411&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/selector.src.js (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/selector.src.js Thu Nov 15 12:06:54 2007
@@ -92,29 +92,23 @@
 {
     notifySuccess: function( /* XMLDocument */ data, /* String */ requestUrl, domainModelObject )
     {
-        jetspeed.url.checkAjaxApiResponse( requestUrl, data, true, "add-portlet" );
-    },
-    parseAddPortletResponse: function( /* XMLNode */ node )
-    {
-        var entityId = null;
-        var jsElements = node.getElementsByTagName( "js" );
-        if ( ! jsElements || jsElements.length > 1 )
-            dojo.raise( "unexpected zero or multiple <js> elements in portlet selector xml" );
-        var children = jsElements[0].childNodes;
-        
-        for ( var i = 0 ; i < children.length ; i++ )
+        var jsObj = jetspeed;
+        var successIndicator = jsObj.url.checkAjaxApiResponse( requestUrl, data, [ "refresh" ], true, "add-portlet" );
+        if ( successIndicator == "refresh" && jsObj.page != null )
         {
-            var child = children[i];
-            if ( child.nodeType != 1 ) // 1 == ELEMENT_NODE
-                continue;
-            var childLName = child.nodeName;
-            if ( childLName == "entity" )
+            var navUrl = jsObj.page.getPageUrl();
+            if ( navUrl != null )
             {
-                entityId = ( ( child && child.firstChild ) ? child.firstChild.nodeValue : null );
-                break;
+                if ( ! jsObj.prefs.ajaxPageNavigation )
+                {
+                    jsObj.pageNavigate( navUrl, null, true );
+                }
+                else
+                {
+                    jsObj.updatePage( navUrl, false, true );
+                }
             }
         }
-        return entityId;
     },
     notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, domainModelObject )
     {

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.css
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.css?rev=595411&r1=595410&r2=595411&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.css (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.css Thu Nov 15 12:06:54 2007
@@ -15,8 +15,9 @@
 limitations under the License.
 */
 
-.layoutEditPane { position: relative; width: 100% }  
+.layoutEditPane { position: relative; width: 100%; visibility: hidden; }  
 /*   ^^^ width: 100% is need to avoid IE auto-containing bug: http://www.satzansatz.de/cssd/rpfloat.html */
+/*   ^^^ do not change visibility - makes the pane appear before it is positioned correctly */
 
 .layoutEditPane label,
 .layoutEditPane input,
@@ -32,6 +33,8 @@
 
 .layoutEditPane .detail .layoutNameContainer{ width: 270px; float:left; vertical-align: middle; margin-right: 20px; margin-bottom: 10px }
 .layoutEditPane .detail .layoutName { font-size: xx-small; width: 100% }
+
+.layoutEditPane .detail .buttonGroup { margin-left: 12px; margin-right: 0px; margin-top: 15px }
 
 .layoutEditPane .detail .buttonContainerLeft { float: left; clear: both }
 .layoutEditPane .detail .buttonContainerLeft .dojoButton { float: left; margin-right: 5px }

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.html?rev=595411&r1=595410&r2=595411&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.html (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.html Thu Nov 15 12:06:54 2007
@@ -27,9 +27,14 @@
                 <fieldset class="pageEditorPaneContainer pageEditorDetailContainer" dojoAttachPoint="pageEditLNContainer">
                     <div class="layoutNameContainer">
                         <select class="layoutName" name="layoutNameSelect" dojoAttachPoint="layoutNameSelect" dojoType="Select" autocomplete="false"></select>
-                    </div>
-                    <div class="buttonContainerLeft">
-                        <button dojoType="Button" dojoAttachPoint="changeLayoutButton" dojoAttachEvent="onClick:changeLayout"><img height="16" src="${this.layoutImagesRoot}button_ok.png">&nbsp;${this.labels.changelayout}</button>
+                        <div class="buttonGroup">
+                            <div class="buttonContainerLeft">
+                                <button dojoType="Button" dojoAttachPoint="changeLayoutButton" dojoAttachEvent="onClick:changeLayout"><img height="16" src="${this.layoutImagesRoot}button_ok.png">&nbsp;${this.labels.changelayout}</button>
+                            </div>
+                            <div class="buttonContainerRight">
+                                <button dojoType="Button" dojoAttachPoint="addLayoutButton" dojoAttachEvent="onClick:addLayout"><img height="16" src="${this.layoutImagesRoot}layout_new.png">&nbsp;${this.labels.addlayout}</button>
+                            </div>
+                        </div>
                     </div>
                 </fieldset>
                 <div style="float: right; width: 18px">&nbsp;</div>  <!-- allowing room for layout-move image -->
@@ -37,11 +42,11 @@
                     <table cellpadding="0" cellspacing="6" border="0">
                     <!-- height on images is currently needed to size the button properly, especially when button is inside a table -->
                     <tr>
-                    <td><button dojoType="Button" dojoAttachEvent="onClick:addPortlet"><img height="16" src="${this.layoutImagesRoot}portlet_add.png">&nbsp;${this.labels.addportlet}</button></td>
-                    <td><button dojoType="Button" dojoAttachEvent="onClick:openColumnSizeEditor"><img height="16" src="${this.layoutImagesRoot}column_resize.png">&nbsp;${this.labels.columnsizes}</button></td>
+                    <td><button dojoType="Button" dojoAttachEvent="onClick:addPortlet" dojoAttachPoint="addPortletButton"><img height="16" src="${this.layoutImagesRoot}portlet_add.png">&nbsp;${this.labels.addportlet}</button></td>
+                    <td><button dojoType="Button" dojoAttachEvent="onClick:openColumnSizeEditor" dojoAttachPoint="columnSizeButton"><img height="16" src="${this.layoutImagesRoot}column_resize.png">&nbsp;${this.labels.columnsizes}</button></td>
                     </tr>
                     <tr>
-                    <td><button dojoType="Button" dojoAttachEvent="onClick:addLayout"><img height="16" src="${this.layoutImagesRoot}layout_new.png">&nbsp;${this.labels.addlayout}</button></td>
+                    <td></td>
                     <td><button dojoType="Button" dojoAttachPoint="deleteLayoutButton" dojoAttachEvent="onClick:deleteLayout"><img height="16" src="${this.layoutImagesRoot}layout_delete.png">&nbsp;${this.labels.deletelayout}</button><button dojoType="Button" dojoAttachPoint="editMoveModeButton" dojoAttachEvent="onClick:editMoveModeStart"><img height="16" src="${this.layoutImagesRoot}edit_mode_layout_move.png">&nbsp;${this.labels.movemode}</button><button dojoType="Button" dojoAttachPoint="editMoveModeExitButton" dojoAttachEvent="onClick:editMoveModeExit"><img height="16" src="${this.layoutImagesRoot}edit_mode_normal.png">&nbsp;${this.labels.movemode_exit}</button></td>
                     </tr>
                     </table>

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.js?rev=595411&r1=595410&r2=595411&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.js (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.js Thu Nov 15 12:06:54 2007
@@ -11,7 +11,7 @@
 dojo.require("dojo.html.display");
 jetspeed.widget.LayoutEditPane=function(){
 };
-dojo.widget.defineWidget("jetspeed.widget.LayoutEditPane",dojo.widget.HtmlWidget,{layoutId:null,layoutDefinitions:null,layoutColumn:null,layoutInfo:null,parentLayoutInfo:null,pageEditContainer:null,pageEditLNContainer:null,layoutNameSelect:null,buttonGroupRight:null,deleteLayoutButton:null,editMoveModeButton:null,editMoveModeExitButton:null,layoutMoveContainer:null,isContainer:true,widgetsInTemplate:true,isLayoutPane:true,drag:null,posStatic:true,moveModeLayoutRelative:"movemode_layout",moveModes:["movemode_layout","movemode_portlet"],postMixInProperties:function(_1,_2,_3){
+dojo.widget.defineWidget("jetspeed.widget.LayoutEditPane",dojo.widget.HtmlWidget,{layoutId:null,layoutDefinitions:null,layoutColumn:null,layoutInfo:null,parentLayoutInfo:null,pageEditContainer:null,pageEditLNContainer:null,layoutNameSelect:null,buttonGroupRight:null,deleteLayoutButton:null,editMoveModeButton:null,editMoveModeExitButton:null,layoutMoveContainer:null,isContainer:true,widgetsInTemplate:true,isLayoutPane:true,depth:null,drag:null,posStatic:true,moveModeLayoutRelative:"movemode_layout",moveModes:["movemode_layout","movemode_portlet"],postMixInProperties:function(_1,_2,_3){
 jetspeed.widget.LayoutEditPane.superclass.postMixInProperties.apply(this,arguments);
 this.templateCssPath=new dojo.uri.Uri(jetspeed.url.basePortalDesktopUrl()+"/javascript/jetspeed/widget/LayoutEditPane.css");
 this.templatePath=new dojo.uri.Uri(jetspeed.url.basePortalDesktopUrl()+"/javascript/jetspeed/widget/LayoutEditPane.html");
@@ -23,54 +23,97 @@
 _6=jetspeed.page.layouts[this.layoutId];
 }
 return _6;
-},postCreate:function(_7,_8,_9){
-var _a=dojo;
-var _b=_a.html;
-var _c=jetspeed.widget.PageEditor.prototype;
+},destroy:function(){
+var _7=jetspeed;
+if(this.layoutColumn){
+_7.ui.evtDisconnect("after",this.layoutColumn,"layoutDepthChanged",this,"syncLayoutDepth");
+}
+_7.widget.LayoutEditPane.superclass.destroy.call(this);
+},postCreate:function(_8,_9,_a){
+var _b=jetspeed;
+var _c=dojo;
+var _d=_c.html;
+var _e=_b.widget.PageEditor.prototype;
 if(this.pageEditContainer!=null){
-_b.addClass(this.pageEditContainer,_c.styleBaseAdd);
+_d.addClass(this.pageEditContainer,_e.styleBaseAdd);
 }
 if(this.pageEditLNContainer!=null){
-_b.addClass(this.pageEditLNContainer,_c.styleDetailAdd);
+_d.addClass(this.pageEditLNContainer,_e.styleDetailAdd);
 }
 if(this.layoutNameSelect!=null){
-var _d=this.getCurrentLayout();
-var _e=null;
-if(_d!=null){
-_e=_d.name;
+var _f=this.getCurrentLayout();
+var _10=null;
+if(_f!=null){
+_10=_f.name;
 }
-var _f=[];
+var _11=[];
 if(this.layoutDefinitions){
 for(var i=0;i<this.layoutDefinitions.length;i++){
-var _11=this.layoutDefinitions[i];
-if(_11&&_11.length==2){
-_f.push([_11[0],_11[1]]);
-if(_e==_11[1]){
-this.layoutNameSelect.setAllValues(_11[0],_11[1]);
+var _13=this.layoutDefinitions[i];
+if(_13&&_13.length==2){
+_11.push([_13[0],_13[1]]);
+if(_10==_13[1]){
+this.layoutNameSelect.setAllValues(_13[0],_13[1]);
+}
 }
 }
 }
+this.layoutNameSelect.dataProvider.setData(_11);
+}
+var _f=this.getCurrentLayout();
+var _14=(_f==null||_f.layoutActionsDisabled);
+var _15=false;
+if(_14){
+_15=_e.canL_NA_ED(_b,_e);
+if(_15){
+_14=false;
+}else{
+this["_n"+"a"]=true;
 }
-this.layoutNameSelect.dataProvider.setData(_f);
 }
-this.syncButtons();
-this.layoutMoveContainer=_a.widget.createWidget("jetspeed:LayoutEditPaneMoveHandle",{layoutImagesRoot:this.layoutImagesRoot});
+this.syncButtons(this.startInEditModeMove);
+delete this.startInEditModeMove;
+this.layoutMoveContainer=_c.widget.createWidget("jetspeed:LayoutEditPaneMoveHandle",{layoutImagesRoot:this.layoutImagesRoot});
 this.addChild(this.layoutMoveContainer);
 this.domNode.appendChild(this.layoutMoveContainer.domNode);
+var _16=(!_14&&_e.checkPerm(_e.PM_P_AD,_b,_e));
+if(!_16&&this.addPortletButton){
+this.addPortletButton.domNode.style.display="none";
+}
+var _17=_e.checkPerm(_e.PM_L_CS,_b,_e);
+if(_17&&_14){
+_17=_e.checkPerm(_e.PM_L_NA_CS,_b,_e);
+}
+if(!_17&&this.columnSizeButton){
+this.columnSizeButton.domNode.style.display="none";
+}
+this.syncLayoutDepth(_e,_b);
+if(this.layoutColumn){
+_b.ui.evtConnect("after",this.layoutColumn,"layoutDepthChanged",this,"syncLayoutDepth",_c.event);
+}
 },changeLayout:function(){
-var _12=new jetspeed.widget.UpdateFragmentContentManager(this.layoutId,this.layoutNameSelect.getValue(),null,this.pageEditorWidget);
-_12.getContent();
+var _18=new jetspeed.widget.UpdateFragmentContentManager(this.layoutId,this.layoutNameSelect.getValue(),null,this.pageEditorWidget);
+_18.getContent();
 },openColumnSizeEditor:function(){
 this.pageEditorWidget.openColumnSizesEditor(this.layoutId);
 },addPortlet:function(){
-var _13=jetspeed.page.getPagePathAndQuery();
-_13=jetspeed.url.addQueryParameter(_13,jetspeed.id.PG_ED_PARAM,"true",true);
-jetspeed.page.addPortletInitiate(this.layoutId,_13.toString());
+var _19=jetspeed;
+var _1a=_19.page.getPagePathAndQuery();
+_1a=_19.url.addQueryParameter(_1a,_19.id.PG_ED_PARAM,"true",true);
+_19.page.addPortletInitiate(this.layoutId,_1a.toString());
 },addLayout:function(){
-var _14=this.getCurrentLayout();
-if(_14!=null){
-var _15=new jetspeed.widget.AddLayoutContentManager(this.layoutId,_14.name,this.pageEditorWidget);
-_15.getContent();
+var _1b=this.getCurrentLayout();
+if(_1b!=null){
+var lns=this.layoutNameSelect;
+var _1d=null;
+if(lns){
+_1d=lns.getValue();
+}
+if(_1d==null){
+_1d=_1b.name;
+}
+var _1e=new jetspeed.widget.AddLayoutContentManager(this.layoutId,_1d,this.pageEditorWidget);
+_1e.getContent();
 }else{
 alert("Cannot add layout (error: null parent layout).");
 }
@@ -93,130 +136,222 @@
 this.editMoveModeExitButton.domNode.style.display="block";
 }
 },_enableMoveMode:function(){
-if(this.layoutMoveContainer&&this.drag){
-this.layoutMoveContainer.domNode.style.display="block";
+var lmc=this.layoutMoveContainer;
+if(!lmc){
+return;
+}
+mmOk=(this.drag!=null);
+if(mmOk){
+mmOk=(!this._na);
+if(!mmOk){
+var _20=jetspeed;
+var _21=_20.widget.PageEditor.prototype;
+var _22=_21.checkPerm(_21.PM_L_NA_TLMV,_20,_21);
+var _23=(this.layoutColumn?this.layoutColumn.domNode:null);
+if(_22&&_23){
+var _24=_20.page.getColFromColNode(_23.parentNode);
+if(_24&&_24.layoutActionsDisabled==false){
+mmOk=true;
+}
 }
+}
+}
+lmc.domNode.style.display=(mmOk?"block":"none");
 },_disableMoveMode:function(){
-if(this.layoutMoveContainer&&this.drag){
-this.layoutMoveContainer.domNode.style.display="none";
+var lmc=this.layoutMoveContainer;
+if(!lmc){
+return;
 }
+lmc.domNode.style.display="none";
 },initializeDrag:function(){
-var _16=this.layoutColumn;
-if(_16!=null&&_16.domNode!=null){
-this.dragStartStaticWidth=_16.domNode.style.width;
+var _26=this.layoutColumn;
+if(_26!=null&&_26.domNode!=null){
+this.dragStartStaticWidth=_26.domNode.style.width;
 this.drag=new dojo.dnd.Moveable(this,{handle:this.layoutMoveContainer.domNode});
 }
-},startDragging:function(e,_18,_19,_1a){
-var _1b=this.layoutColumn;
-if(_1b!=null){
-var _1c=_1b.domNode;
-if(_1c){
+},startDragging:function(e,_28,_29,_2a){
+var _2b=this.layoutColumn;
+if(_2b!=null){
+var _2c=_2b.domNode;
+if(_2c){
 if(this.buttonGroupRight){
 this.buttonGroupRight.style.display="none";
 }
-var _1d=true;
-_18.beforeDragColRowInfo=_1a.page.getPortletCurColRow(_1c);
-_18.node=_1c;
-_18.mover=new _19.dnd.Mover(this,_1c,_1b,_18,e,_1d,_19,_1a);
-}
-}
-},dragChangeToAbsolute:function(_1e,_1f,_20,_21,_22){
-var _23=_21.getMarginBox(_1f,null,_22);
-var _24=400-_20.w;
-if(_24<0){
-_20.l=_20.l+(_24*-1);
-_20.w=400;
-_21.setMarginBox(_1f,_20.l,null,_20.w,null,null,_22);
-}
-if(_22.UAie){
-var _25=this.pageEditorWidget.bgIframe.iframe;
-this.domNode.appendChild(_25);
-_25.style.display="block";
-_21.setMarginBox(_25,null,null,null,_20.h,null,_22);
-}
-},endDragging:function(_26){
-var _27=jetspeed;
-var _28=dojo;
-var _29=this.layoutColumn;
-if(this.drag==null||_29==null||_29.domNode==null){
+var _2d=true;
+var _2e=_2a.widget.PageEditor.prototype;
+var _2f=_2e.canL_NA_ED(_2a,_2e);
+var _30=_2e.getLDepthPerm(_2a);
+var _31=_2b.getLayoutMaxChildDepth();
+var _32=_2b.getLayoutDepth();
+var _33=_30;
+if(_31>_32){
+_33=Math.max((_30-(_31-_32)),_32);
+}
+_28.beforeDragColRowInfo=_2a.page.getPortletCurColRow(_2c);
+_28.node=_2c;
+var _34={col:_2b,maxdepth:_33};
+_28.mover=new _29.dnd.Mover(this,_2c,_34,_2f,_28,e,_2d,_29,_2a);
+}
+}
+},dragChangeToAbsolute:function(_35,_36,_37,_38,_39){
+var _3a=_38.getMarginBox(_36,null,_39);
+var _3b=400-_37.w;
+if(_3b<0){
+_37.l=_37.l+(_3b*-1);
+_37.w=400;
+_38.setMarginBox(_36,_37.l,null,_37.w,null,null,_39);
+}
+if(_39.UAie){
+var _3c=this.pageEditorWidget.bgIframe.iframe;
+this.domNode.appendChild(_3c);
+_3c.style.display="block";
+_38.setMarginBox(_3c,null,null,null,_37.h,null,_39);
+}
+},endDragging:function(_3d){
+var _3e=jetspeed;
+var _3f=dojo;
+var _40=this.layoutColumn;
+if(this.drag==null||_40==null||_40.domNode==null){
 return;
 }
-var _2a=_29.domNode;
-_2a.style.position="static";
-_2a.style.width=this.dragStartStaticWidth;
-_2a.style.left="auto";
-_2a.style.top="auto";
+var _41=_40.domNode;
+_41.style.position="static";
+_41.style.width=this.dragStartStaticWidth;
+_41.style.left="auto";
+_41.style.top="auto";
 if(this.buttonGroupRight){
 this.buttonGroupRight.style.display="block";
 }
-if(_27.UAie){
+if(_3e.UAie){
 this.pageEditorWidget.bgIframe.iframe.style.display="none";
-if(_27.UAie6){
-_27.page.onBrowserWindowResize();
+if(_3e.UAie6){
+_3e.page.onBrowserWindowResize();
 }
 }
-var _2b=this.drag.beforeDragColRowInfo;
-var _2c=_27.page.getPortletCurColRow(_2a);
-if(_2b!=null&&_2c!=null){
-var ind=_27.debugindent;
-if(_2c!=null&&(_2c.row!=_2b.row||_2c.column!=_2b.column||_2c.layout!=_2b.layout)){
-var _2e=new _27.widget.MoveLayoutContentManager(this.layoutId,_2c.layout,_2c.column,_2c.row,this.pageEditorWidget);
-_2e.getContent();
+var _42=this.drag.beforeDragColRowInfo;
+var _43=_3e.page.getPortletCurColRow(_41);
+if(_42!=null&&_43!=null){
+var ind=_3e.debugindent;
+if(_43!=null&&(_43.row!=_42.row||_43.column!=_42.column||_43.layout!=_42.layout)){
+var _45=new _3e.widget.MoveLayoutContentManager(this.layoutId,_43.layout,_43.column,_43.row,this.pageEditorWidget);
+_45.getContent();
 }
 }
+_3e.ui.updateChildColInfo();
 },getLayoutColumn:function(){
 return this.layoutColumn;
 },getPageColumnIndex:function(){
 if(this.layoutColumn){
-var _2f=jetspeed.page.getColWithNode(this.layoutColumn.domNode);
-if(_2f!=null){
-return _2f.getPageColumnIndex();
+var _46=jetspeed.page.getColWithNode(this.layoutColumn.domNode);
+if(_46!=null){
+return _46.getPageColumnIndex();
 }
 }
 return null;
 },_getLayoutInfoMoveable:function(){
 return this.layoutInfo;
-},_getWindowMarginBox:function(_30,_31){
+},_getWindowMarginBox:function(_47,_48){
 if(this.layoutColumn){
-var _32=this.parentLayoutInfo;
-if(_31.UAope&&_32==null){
-var _33=_31.page.layoutInfo;
-var _34=_31.page.getColIndexForNode(this.layoutColumn.domNode);
-if(_34!=null){
-var _35=_31.page.columns[_34];
-if(_35.layoutHeader){
-_32=_33.columnLayoutHeader;
+var _49=this.parentLayoutInfo;
+if(_48.UAope&&_49==null){
+var _4a=_48.page.layoutInfo;
+var _4b=_48.page.getColIndexForNode(this.layoutColumn.domNode);
+if(_4b!=null){
+var _4c=_48.page.columns[_4b];
+if(_4c.layoutHeader){
+_49=_4a.columnLayoutHeader;
 }else{
-_32=_33.column;
+_49=_4a.column;
 }
 }else{
-_32=_33.columns;
+_49=_4a.columns;
 }
-this.parentLayoutInfo=_32;
+this.parentLayoutInfo=_49;
 }
-return _31.ui.getMarginBox(this.layoutColumn.domNode,_30,_32,_31);
+return _48.ui.getMarginBox(this.layoutColumn.domNode,_47,_49,_48);
 }
 return null;
-},editModeRedisplay:function(){
+},editModeRedisplay:function(_4d){
 this.show();
-this.syncButtons();
-},syncButtons:function(){
+this.syncButtons(_4d);
+},syncButtons:function(_4e){
+var _4f=this._na;
+var mmB=this.editMoveModeButton;
+var _51=this.editMoveModeExitButton;
+var dLB=this.deleteLayoutButton;
+this._delEnabled=false;
 if(this.isRootLayout){
-if(this.deleteLayoutButton!=null){
-this.deleteLayoutButton.domNode.style.display="none";
+var _53="none",_54="none";
+if(!_4f){
+_53=_4e?"none":"block";
+_54=_4e?"block":"none";
 }
-if(this.editMoveModeButton!=null){
-this.editMoveModeButton.domNode.style.display="block";
+if(mmB){
+mmB.domNode.style.display=_53;
 }
-if(this.editMoveModeExitButton!=null){
-this.editMoveModeExitButton.domNode.style.display="none";
+if(_51){
+_51.domNode.style.display=_54;
+}
+if(dLB){
+dLB.domNode.style.display="none";
 }
 }else{
-if(this.editMoveModeButton!=null){
-this.editMoveModeButton.domNode.style.display="none";
+if(mmB){
+mmB.domNode.style.display="none";
+}
+if(_51){
+_51.domNode.style.display="none";
+}
+if(dLB){
+if(_4f){
+var _55=jetspeed;
+var _56=null;
+var _57=this.getLayoutColumn();
+if(_57){
+_56=_57.domNode;
+}else{
+if(this.isRootLayout){
+_56=dojo.byId(_55.id.COLUMNS);
+}
+}
+if(_56){
+if(_55.page.columnsEmptyCheck(_56)){
+_4f=false;
+}
+}
+}
+this._delEnabled=(!_4f);
+dLB.domNode.style.display=(_4f?"none":"block");
+}
+}
+},syncLayoutDepth:function(_58,_59){
+if(!_59){
+_59=jetspeed;
+}
+if(!_58){
+_58=_59.widget.PageEditor.prototype;
+}
+var _5a=this._na;
+var _5b=((!_5a||this._delEnabled)&&_58.checkPerm(_58.PM_L_N,_59,_58));
+if(this.changeLayoutButton){
+this.changeLayoutButton.domNode.style.display=(_5b?"block":"none");
+}
+if(this.layoutColumn){
+this.depth=this.layoutColumn.getLayoutDepth();
+}
+var _5c=_58.getLDepthPerm(_59);
+var _5d=(this.depth==null||this.depth>=_5c);
+var _5e=(!_5d&&!_5a);
+if(this.addLayoutButton){
+this.addLayoutButton.domNode.style.display=(_5e?"block":"none");
+}
+if(this.layoutNameSelect){
+if(!_5e&&!_5b){
+this.layoutNameSelect.disable();
+}else{
+if(this.layoutNameSelect.disabled){
+this.layoutNameSelect.enable();
 }
-if(this.editMoveModeExitButton!=null){
-this.editMoveModeExitButton.domNode.style.display="none";
 }
 }
 },onBrowserWindowResize:function(){

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.src.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.src.js?rev=595411&r1=595410&r2=595411&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.src.js (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/LayoutEditPane.src.js Thu Nov 15 12:06:54 2007
@@ -61,6 +61,7 @@
 		isContainer: true,
         widgetsInTemplate: true,
         isLayoutPane: true,
+        depth: null,
 
         // drag variables
         drag: null,
@@ -96,16 +97,27 @@
             return currentLayout;
         },
 
+        destroy: function()
+        {
+            var jsObj = jetspeed;
+            if ( this.layoutColumn )
+            {
+                jsObj.ui.evtDisconnect( "after", this.layoutColumn, "layoutDepthChanged", this, "syncLayoutDepth" );
+            }
+            jsObj.widget.LayoutEditPane.superclass.destroy.call( this );
+        },
+
         postCreate: function( args, fragment, parent )
         {
+            var jsObj = jetspeed;
             var djObj = dojo;
             var djH = djObj.html;
 
-            var pageEditorProto = jetspeed.widget.PageEditor.prototype;
+            var peProto = jsObj.widget.PageEditor.prototype;
             if ( this.pageEditContainer != null )
-                djH.addClass( this.pageEditContainer, pageEditorProto.styleBaseAdd );
+                djH.addClass( this.pageEditContainer, peProto.styleBaseAdd );
             if ( this.pageEditLNContainer != null )
-                djH.addClass( this.pageEditLNContainer, pageEditorProto.styleDetailAdd );
+                djH.addClass( this.pageEditLNContainer, peProto.styleDetailAdd );
 
             if ( this.layoutNameSelect != null )
             {
@@ -133,7 +145,19 @@
                 }
                 this.layoutNameSelect.dataProvider.setData( layoutNameData );
             }
-            this.syncButtons();
+
+            var currentLayout = this.getCurrentLayout();
+            var isNA = ( currentLayout == null || currentLayout.layoutActionsDisabled );
+            var cL_NA_ED = false;
+            if ( isNA )
+            {
+                cL_NA_ED = peProto.canL_NA_ED(jsObj,peProto);
+                if ( cL_NA_ED ) isNA = false;
+                else this["_n"+"a"] = true;
+            }
+
+            this.syncButtons( this.startInEditModeMove );
+            delete this.startInEditModeMove;
             
             this.layoutMoveContainer = djObj.widget.createWidget( "jetspeed:LayoutEditPaneMoveHandle",
 				{
@@ -141,6 +165,28 @@
 				});
 			this.addChild( this.layoutMoveContainer );
 			this.domNode.appendChild( this.layoutMoveContainer.domNode );
+
+            var addPortletPerm = ( ! isNA && peProto.checkPerm(peProto.PM_P_AD,jsObj,peProto) );
+            if ( ! addPortletPerm && this.addPortletButton )
+            {
+                this.addPortletButton.domNode.style.display = "none";
+            }
+            var colSizePerm = peProto.checkPerm(peProto.PM_L_CS,jsObj,peProto);
+            if ( colSizePerm && isNA )
+            {
+                colSizePerm = peProto.checkPerm(peProto.PM_L_NA_CS,jsObj,peProto);
+            }
+            if ( ! colSizePerm && this.columnSizeButton )
+            {
+                this.columnSizeButton.domNode.style.display = "none";
+            }
+
+            this.syncLayoutDepth( peProto, jsObj );
+
+            if ( this.layoutColumn )
+            {
+                jsObj.ui.evtConnect( "after", this.layoutColumn, "layoutDepthChanged", this, "syncLayoutDepth", djObj.event );
+            }
         },
 
         // methods
@@ -156,16 +202,23 @@
         },
         addPortlet: function()
         {
-            var jspage = jetspeed.page.getPagePathAndQuery();
-            jspage = jetspeed.url.addQueryParameter( jspage, jetspeed.id.PG_ED_PARAM, "true", true );
-            jetspeed.page.addPortletInitiate( this.layoutId, jspage.toString() );
+            var jsObj = jetspeed;
+            var jspage = jsObj.page.getPagePathAndQuery();
+            jspage = jsObj.url.addQueryParameter( jspage, jsObj.id.PG_ED_PARAM, "true", true );
+            jsObj.page.addPortletInitiate( this.layoutId, jspage.toString() );
         },
         addLayout: function()
         {
             var currentLayout = this.getCurrentLayout();
             if ( currentLayout != null )
             {
-                var addLayoutContentManager = new jetspeed.widget.AddLayoutContentManager( this.layoutId, currentLayout.name, this.pageEditorWidget );
+                var lns = this.layoutNameSelect;
+                var layoutName = null;
+                if ( lns )
+                    layoutName = lns.getValue();
+                if ( layoutName == null )
+                    layoutName = currentLayout.name;
+                var addLayoutContentManager = new jetspeed.widget.AddLayoutContentManager( this.layoutId, layoutName, this.pageEditorWidget );
                 addLayoutContentManager.getContent();
             }
             else
@@ -196,17 +249,33 @@
 
         _enableMoveMode: function()
         {
-            if ( this.layoutMoveContainer && this.drag )
+            var lmc = this.layoutMoveContainer;
+            if ( ! lmc ) return;
+            mmOk = (this.drag != null);
+            if ( mmOk )
             {
-                this.layoutMoveContainer.domNode.style.display = "block";
+                mmOk = ( ! this._na );
+                if ( ! mmOk )
+                {
+                    var jsObj = jetspeed;
+                    var peProto = jsObj.widget.PageEditor.prototype;
+                    var mvNATL = peProto.checkPerm(peProto.PM_L_NA_TLMV,jsObj,peProto);
+                    var layoutColumnDomNode = ( this.layoutColumn ? this.layoutColumn.domNode : null  );
+                    if ( mvNATL && layoutColumnDomNode )
+                    {
+                        var parentCol = jsObj.page.getColFromColNode( layoutColumnDomNode.parentNode );
+                        if ( parentCol && parentCol.layoutActionsDisabled == false )
+                            mmOk = true;
+                    }
+                }
             }
+            lmc.domNode.style.display = ( mmOk ? "block" : "none" );
         },
         _disableMoveMode: function()
         {
-            if ( this.layoutMoveContainer && this.drag )
-            {
-                this.layoutMoveContainer.domNode.style.display = "none";
-            }
+            var lmc = this.layoutMoveContainer;
+            if ( ! lmc ) return;
+            lmc.domNode.style.display = "none";
         },
 
         initializeDrag: function()
@@ -230,9 +299,21 @@
                     if ( this.buttonGroupRight )
                         this.buttonGroupRight.style.display = "none";
                     var notifyOnAbsolute = true;
+
+                    var peProto = jsObj.widget.PageEditor.prototype;
+                    var cL_NA_ED = peProto.canL_NA_ED(jsObj,peProto);
+
+                    var layoutDepthMax = peProto.getLDepthPerm( jsObj );
+                    var childDepth = dragLayoutColumn.getLayoutMaxChildDepth();
+                    var layoutDepth = dragLayoutColumn.getLayoutDepth();
+                    var maxDragDepth = layoutDepthMax;
+                    if ( childDepth > layoutDepth )
+                        maxDragDepth = Math.max( (layoutDepthMax - (childDepth - layoutDepth)), layoutDepth );
+                    
                     moveableObj.beforeDragColRowInfo = jsObj.page.getPortletCurColRow( dragNode );
                     moveableObj.node = dragNode;
-		            moveableObj.mover = new djObj.dnd.Mover( this, dragNode, dragLayoutColumn, moveableObj, e, notifyOnAbsolute, djObj, jsObj );
+                    var dragLayoutColInfo = { col: dragLayoutColumn, maxdepth: maxDragDepth };
+		            moveableObj.mover = new djObj.dnd.Mover( this, dragNode, dragLayoutColInfo, cL_NA_ED, moveableObj, e, notifyOnAbsolute, djObj, jsObj );
                 }
             }
         },
@@ -298,6 +379,7 @@
                     moveLayoutContentManager.getContent();
                 }
             }
+            jsObj.ui.updateChildColInfo();
         },
 
         getLayoutColumn: function()
@@ -346,28 +428,87 @@
             return null;
         },
 
-        editModeRedisplay: function()
+        editModeRedisplay: function( moveModeIsEnabled )
         {
             this.show();
-            this.syncButtons();
+            this.syncButtons( moveModeIsEnabled );
         },
-        syncButtons: function()
+        syncButtons: function( moveModeIsEnabled )
         {
+            var isNA = this._na;
+            var mmB = this.editMoveModeButton;
+            var mmEB = this.editMoveModeExitButton;
+            var dLB = this.deleteLayoutButton;
+            this._delEnabled = false;
             if ( this.isRootLayout )
             {
-                if ( this.deleteLayoutButton != null )
-                    this.deleteLayoutButton.domNode.style.display = "none";
-                if ( this.editMoveModeButton != null )
-                    this.editMoveModeButton.domNode.style.display = "block";
-                if ( this.editMoveModeExitButton != null )
-                    this.editMoveModeExitButton.domNode.style.display = "none";
+                var mmStartBtn = "none", mmExitBtn = "none";
+                if ( ! isNA )
+                {
+                    mmStartBtn = moveModeIsEnabled ? "none" : "block";
+                    mmExitBtn = moveModeIsEnabled ? "block" : "none";
+                }
+                if ( mmB )
+                    mmB.domNode.style.display = mmStartBtn;
+                if ( mmEB )
+                    mmEB.domNode.style.display = mmExitBtn;
+                if ( dLB )
+                    dLB.domNode.style.display = "none";
             }
             else
             {
-                if ( this.editMoveModeButton != null )
-                    this.editMoveModeButton.domNode.style.display = "none";
-                if ( this.editMoveModeExitButton != null )
-                    this.editMoveModeExitButton.domNode.style.display = "none";
+                if ( mmB )
+                    mmB.domNode.style.display = "none";
+                if ( mmEB )
+                    mmEB.domNode.style.display = "none";
+                if ( dLB )
+                {
+                    if ( isNA )
+                    {
+                        var jsObj = jetspeed;
+                        var layoutColNode = null;
+                        var layoutCol = this.getLayoutColumn();
+                        if ( layoutCol )
+                            layoutColNode = layoutCol.domNode;
+                        else if ( this.isRootLayout )
+                            layoutColNode = dojo.byId( jsObj.id.COLUMNS );
+                        if ( layoutColNode )
+                        {
+                            if ( jsObj.page.columnsEmptyCheck( layoutColNode ) )
+                                isNA = false;   // allow delete if layout is empty
+                        }
+                    }
+                    this._delEnabled = ( ! isNA );
+                    dLB.domNode.style.display = ( isNA ? "none" : "block" );
+                }
+            }
+        },
+        syncLayoutDepth: function( peProto, jsObj )
+        {
+            if ( ! jsObj ) jsObj = jetspeed;
+            if ( ! peProto ) peProto = jsObj.widget.PageEditor.prototype;
+
+            var isNA = this._na;
+            var chgLayoutPerm = ( ( ! isNA || this._delEnabled ) && peProto.checkPerm( peProto.PM_L_N, jsObj, peProto ) );
+            if ( this.changeLayoutButton )
+                this.changeLayoutButton.domNode.style.display = ( chgLayoutPerm ? "block" : "none" );
+
+            if ( this.layoutColumn )
+                this.depth = this.layoutColumn.getLayoutDepth();
+            
+            var layoutDepthMax = peProto.getLDepthPerm( jsObj );
+            var atMaxDepth = ( this.depth == null || this.depth >= layoutDepthMax );
+            var addLayoutPerm = ( ! atMaxDepth && ! isNA );
+            
+            if ( this.addLayoutButton )
+                this.addLayoutButton.domNode.style.display = ( addLayoutPerm ? "block" : "none" );
+
+            if ( this.layoutNameSelect )
+            {
+                if ( ! addLayoutPerm && ! chgLayoutPerm )
+                    this.layoutNameSelect.disable();
+                else if ( this.layoutNameSelect.disabled )
+                    this.layoutNameSelect.enable();
             }
         },
 

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.css
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.css?rev=595411&r1=595410&r2=595411&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.css (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.css Thu Nov 15 12:06:54 2007
@@ -22,6 +22,7 @@
   color: blue;
   overflow: hidden;
   clip: auto;
+  visibility: hidden;  /* do not change visibility - makes the pane appear before it is positioned correctly */
 }
 
 .pageEditPane .container { }

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.html?rev=595411&r1=595410&r2=595411&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.html (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.html Thu Nov 15 12:06:54 2007
@@ -41,10 +41,10 @@
                    <table cellpadding="0" cellspacing="6" border="0">
                    <!-- height on images is currently needed to size the button properly, especially when button is inside a table -->
                    <tr align="right">
-                   <td><button dojoType="Button" dojoAttachEvent="onClick:createPage"><img height="16" src="${this.layoutImagesRoot}page_new.png">&nbsp;${this.labels.newpage}</button></td>
+                   <td><button dojoType="Button" dojoAttachEvent="onClick:createPage" dojoAttachPoint="createPageButton"><img height="16" src="${this.layoutImagesRoot}page_new.png">&nbsp;${this.labels.newpage}</button></td>
                    </tr>
                    <tr align="right">
-                   <td><button dojoType="Button" dojoAttachEvent="onClick:deletePage"><img height="16" src="${this.layoutImagesRoot}page_delete.png">&nbsp;${this.labels.deletepage}</button></td>
+                   <td><button dojoType="Button" dojoAttachEvent="onClick:deletePage" dojoAttachPoint="deletePageButton"><img height="16" src="${this.layoutImagesRoot}page_delete.png">&nbsp;${this.labels.deletepage}</button></td>
                    </tr>
                    </table>
                </div>

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.js?rev=595411&r1=595410&r2=595411&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.js (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.js Thu Nov 15 12:06:54 2007
@@ -56,6 +56,13 @@
 _f.addClass(this.pageEditPDContainer,_10.styleDetailAdd);
 }
 if(this.layoutDecoratorSelect!=null){
+if(!_10.checkPerm(_10.PM_PG_L_D,_e)){
+if(this.pageEditLDContainer){
+this.pageEditLDContainer.style.display="none";
+}else{
+this.layoutDecoratorSelect.domNode.style.display="none";
+}
+}else{
 var _11=_e.page.layoutDecorator;
 var _12=[];
 if(this.layoutDecoratorDefinitions){
@@ -71,7 +78,15 @@
 }
 this.layoutDecoratorSelect.dataProvider.setData(_12);
 }
+}
 if(this.portletDecoratorSelect!=null){
+if(!_10.checkPerm(_10.PM_PG_P_D,_e)){
+if(this.pageEditPDContainer){
+this.pageEditPDContainer.style.display="none";
+}else{
+this.portletDecoratorSelect.domNode.style.display="none";
+}
+}else{
 var _15=_e.page.portletDecorator;
 var _16=[];
 if(this.portletDecoratorDefinitions){
@@ -87,38 +102,43 @@
 }
 this.portletDecoratorSelect.dataProvider.setData(_16);
 }
+}
+var _18=_10.checkPerm(_10.PM_PG_AD,_e);
+if(!_18){
+this.createPageButton.domNode.style.display="none";
+}
 },deletePage:function(){
 this.pageEditorWidget._openDialog(this.deletePageDialog);
 },deletePageConfirmed:function(){
-var _18=new jetspeed.widget.RemovePageContentManager(this.pageEditorWidget);
-_18.getContent();
+var _19=new jetspeed.widget.RemovePageContentManager(this.pageEditorWidget);
+_19.getContent();
 },createPage:function(){
 this.pageEditorWidget._openDialog(this.createPageDialog);
-},createPageConfirmed:function(_19,_1a,_1b){
-if(_19!=null&&_19.length>0){
-var _1c=jetspeed.page.getPageDirectory(true)+_19;
-var _1d=jetspeed.page.getPageDirectory()+_19;
-var _1e=new jetspeed.widget.AddPageContentManager(_1c,_1d,_19,null,_1a,_1b,this.pageEditorWidget);
-_1e.getContent();
+},createPageConfirmed:function(_1a,_1b,_1c){
+if(_1a!=null&&_1a.length>0){
+var _1d=jetspeed.page.getPageDirectory(true)+_1a;
+var _1e=jetspeed.page.getPageDirectory()+_1a;
+var _1f=new jetspeed.widget.AddPageContentManager(_1d,_1e,_1a,null,_1b,_1c,this.pageEditorWidget);
+_1f.getContent();
 }
 },changeLayoutDecorator:function(){
-var _1f=new jetspeed.widget.UpdatePageInfoContentManager(this.layoutDecoratorSelect.getValue(),null,this.pageEditorWidget);
-_1f.getContent();
-},changePortletDecorator:function(){
-var _20=new jetspeed.widget.UpdatePageInfoContentManager(null,this.portletDecoratorSelect.getValue(),this.pageEditorWidget);
+var _20=new jetspeed.widget.UpdatePageInfoContentManager(this.layoutDecoratorSelect.getValue(),null,this.pageEditorWidget);
 _20.getContent();
+},changePortletDecorator:function(){
+var _21=new jetspeed.widget.UpdatePageInfoContentManager(null,this.portletDecoratorSelect.getValue(),this.pageEditorWidget);
+_21.getContent();
 },editModeRedisplay:function(){
 this.show();
 },onBrowserWindowResize:function(){
-var _21=this.deletePageDialog;
-var _22=this.createPageDialog;
-if(_21&&_21.isShowing()){
-_21.domNode.style.display="none";
-_21.domNode.style.display="block";
-}
+var _22=this.deletePageDialog;
+var _23=this.createPageDialog;
 if(_22&&_22.isShowing()){
 _22.domNode.style.display="none";
 _22.domNode.style.display="block";
+}
+if(_23&&_23.isShowing()){
+_23.domNode.style.display="none";
+_23.domNode.style.display="block";
 }
 }});
 

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.src.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.src.js?rev=595411&r1=595410&r2=595411&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.src.js (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/widget/PageEditPane.src.js Thu Nov 15 12:06:54 2007
@@ -75,7 +75,7 @@
         {
             var self = this;
             this.deletePageDialog = dojo.widget.createWidget( "dialog", { widgetsInTemplate: true, deletePageConfirmed: function() { this.hide(); self.deletePageConfirmed(); } }, this.deletePageDialog );
-			this.deletePageDialog.setCloseControl( this.deletePageDialog.deletePageCancel.domNode );
+			    this.deletePageDialog.setCloseControl( this.deletePageDialog.deletePageCancel.domNode );
 
             var createPageParams = {};
             createPageParams.widgetsInTemplate = true;
@@ -88,7 +88,7 @@
                 self.createPageConfirmed( pageName, pageTitle, pageShortTitle );
             };
             this.createPageDialog = dojo.widget.createWidget( "dialog", createPageParams, this.createPageDialog );
-			this.createPageDialog.setCloseControl( this.createPageDialog.createPageCancel.domNode );
+			    this.createPageDialog.setCloseControl( this.createPageDialog.createPageCancel.domNode );
             
             jetspeed.widget.PageEditPane.superclass.fillInTemplate.call( this );
 		},
@@ -105,6 +105,7 @@
         {
             var jsObj = jetspeed;
             var djH = dojo.html;
+
             jsObj.widget.PageEditPane.superclass.postCreate.apply( this, arguments );
             
             var pageEditorProto = jsObj.widget.PageEditor.prototype;
@@ -116,49 +117,74 @@
                 djH.addClass( this.pageEditPDContainer, pageEditorProto.styleDetailAdd );
 
             if ( this.layoutDecoratorSelect != null )
-            {    
-                var currentLayoutDecorator = jsObj.page.layoutDecorator;
-    
-                var layoutDecoratorData = [];
-                if ( this.layoutDecoratorDefinitions )
+            {
+                if ( ! pageEditorProto.checkPerm( pageEditorProto.PM_PG_L_D, jsObj ) )
                 {
-                    for ( var i = 0 ; i < this.layoutDecoratorDefinitions.length ; i++ )
+                    if ( this.pageEditLDContainer )
+                        this.pageEditLDContainer.style.display = "none";
+                    else
+                        this.layoutDecoratorSelect.domNode.style.display = "none";
+                }
+                else
+                {
+                    var currentLayoutDecorator = jsObj.page.layoutDecorator;
+                    var layoutDecoratorData = [];
+                    if ( this.layoutDecoratorDefinitions )
                     {
-                        var layoutDecoratorDef = this.layoutDecoratorDefinitions[i];
-                        if ( layoutDecoratorDef && layoutDecoratorDef.length == 2 )
+                        for ( var i = 0 ; i < this.layoutDecoratorDefinitions.length ; i++ )
                         {
-                            layoutDecoratorData.push( [layoutDecoratorDef[0], layoutDecoratorDef[1]] );
-                            if ( currentLayoutDecorator == layoutDecoratorDef[1] )
+                            var layoutDecoratorDef = this.layoutDecoratorDefinitions[i];
+                            if ( layoutDecoratorDef && layoutDecoratorDef.length == 2 )
                             {
-                                this.layoutDecoratorSelect.setAllValues( layoutDecoratorDef[0], layoutDecoratorDef[1] );
-                            }
-    					}
-    				}
+                                layoutDecoratorData.push( [layoutDecoratorDef[0], layoutDecoratorDef[1]] );
+                                if ( currentLayoutDecorator == layoutDecoratorDef[1] )
+                                {
+                                    this.layoutDecoratorSelect.setAllValues( layoutDecoratorDef[0], layoutDecoratorDef[1] );
+                                }
+        					}
+        				}
+                    }
+                    this.layoutDecoratorSelect.dataProvider.setData( layoutDecoratorData );
                 }
-                this.layoutDecoratorSelect.dataProvider.setData( layoutDecoratorData );
             }
 
             if ( this.portletDecoratorSelect != null )
-            {    
-                var currentPortletDecorator = jsObj.page.portletDecorator;
-    
-                var portletDecoratorData = [];
-                if ( this.portletDecoratorDefinitions )
+            {
+                if ( ! pageEditorProto.checkPerm( pageEditorProto.PM_PG_P_D, jsObj ) )
                 {
-                    for ( var i = 0 ; i < this.portletDecoratorDefinitions.length ; i++ )
+                    if ( this.pageEditPDContainer )
+                        this.pageEditPDContainer.style.display = "none";
+                    else
+                        this.portletDecoratorSelect.domNode.style.display = "none";
+                }
+                else
+                {
+                    var currentPortletDecorator = jsObj.page.portletDecorator;
+                    var portletDecoratorData = [];
+                    if ( this.portletDecoratorDefinitions )
                     {
-                        var portletDecoratorDef = this.portletDecoratorDefinitions[i];
-                        if ( portletDecoratorDef && portletDecoratorDef.length == 2 )
+                        for ( var i = 0 ; i < this.portletDecoratorDefinitions.length ; i++ )
                         {
-                            portletDecoratorData.push( [portletDecoratorDef[0], portletDecoratorDef[1]] );
-                            if ( currentPortletDecorator == portletDecoratorDef[1] )
+                            var portletDecoratorDef = this.portletDecoratorDefinitions[i];
+                            if ( portletDecoratorDef && portletDecoratorDef.length == 2 )
                             {
-                                this.portletDecoratorSelect.setAllValues( portletDecoratorDef[0], portletDecoratorDef[1] );
-                            }
-    					}
-    				}
+                                portletDecoratorData.push( [portletDecoratorDef[0], portletDecoratorDef[1]] );
+                                if ( currentPortletDecorator == portletDecoratorDef[1] )
+                                {
+                                    this.portletDecoratorSelect.setAllValues( portletDecoratorDef[0], portletDecoratorDef[1] );
+                                }
+        					}
+        				}
+                    }
+                    this.portletDecoratorSelect.dataProvider.setData( portletDecoratorData );
                 }
-                this.portletDecoratorSelect.dataProvider.setData( portletDecoratorData );
+            }
+
+            var addPgPerm = pageEditorProto.checkPerm( pageEditorProto.PM_PG_AD, jsObj );
+            if ( ! addPgPerm )
+            {
+                this.createPageButton.domNode.style.display = "none";
+                //this.deletePageButton.domNode.style.display = "none";
             }
         },
 



---------------------------------------------------------------------
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