/***************************************************************************** * ITSWindowLibrary.js * ***************************************************************************** * Release 4.0 (Lotus Domino 5/6) * * Created by Dwight Egerton * * Last modified 23 January 2003 by Dwight Egerton * * * * Description: * * Code for portal windows for all Web applications * * * ***************************************************************************** * IT Software Series * * (c)Copyright 2003, Xybanetx Consulting * ***************************************************************************** ***************************************************************************** * Window Object/Style/Item properties * *****************************************************************************/ function winITEM(cIdx,x,y,w,h,helpURL,target){ x+=oWin.minX; y+=oWin.minY; if(!w) w=oWin.defwidth; if(!h) h=oWin.defheight; if(w>oWin.maxX-oWin.minX) w=oWin.maxX-oWin.minX; else if(woWin.maxY-oWin.minY) h=oWin.maxY-oWin.minY; else if(hoWin.maxX-w) x=oWin.maxX-w; if(y>oWin.maxY-h) y=oWin.maxY-h; oWin[cIdx]=new libraryOBJ('p'+oWin.name+cIdx); oWin[cIdx].oWindow=new libraryOBJ('w'+oWin.name+cIdx,'p'+oWin.name+cIdx); oWin[cIdx].oHead=new libraryOBJ('h'+oWin.name+cIdx,'p'+oWin.name+cIdx); oWin[cIdx].oButtons=new libraryOBJ('b'+oWin.name+cIdx,'p'+oWin.name+cIdx); oWin[cIdx].oText=new libraryOBJ('t'+oWin.name+cIdx,'p'+oWin.name+cIdx); oWin[cIdx].close=winCLOSE; oWin[cIdx].open=winOPEN; oWin[cIdx].resize=winRESIZE; oWin[cIdx].refresh=winREFRESH; oWin[cIdx].help=winHELP; oWin[cIdx].maximize=winMAXIMIZE; oWin[cIdx].addZ=winADDZ; oWin[cIdx].helpURL=helpURL; oWin[cIdx].state="reg"; oWin[cIdx].target=target; if(cIdx>=oWin.wIdx){ oWin[cIdx].oWindow.moveIt(oWin.borderw,oWin.headh); oWin[cIdx].lastx=x; oWin[cIdx].lasty=y; oWin[cIdx].origw=w; oWin[cIdx].origh=h; oWin[cIdx].moveIt(x,y); oWin[cIdx].resize(w,h); oWin.wIdx=cIdx+1; } } function winOBJ(name){ this.name=name; this.wIdx=0; this.dragobj=-1; this.resizeobj=-1; this.zIndex=100; this.headh=17; this.bottomh=2 this.borderw=2; this.buttonw=42; this.defwidth=200; this.defheight=200; this.between=5; this.keepinside=1; this.minX=2; this.minY=30; this.minW=150; this.minH=150; this.maxX=page.x2; this.maxY=page.y2; this.addWIN=addWIN; this.endWIN=endWIN; return this } /***************************************************************************** * Window Events and Functions * *****************************************************************************/ function winCLOSE(){ this.hideIt(); this.oWindow.hideIt(); } function winOPEN(){ this.showIt(); this.oWindow.showIt(); } function winREFRESH(){ tag=this.oText.evnt; obj=this.oText.obj; if(tag.tagName=='IFRAME'){ if(bc.ie5){ t=obj.substring(0,obj.indexOf('Object')); eval(t+ '.location.href=' +t+ '.location.href'); } else tag.contentWindow.location.href=tag.contentWindow.location.href; } } function winHELP(){ if(typeof(this.helpURL)!='undefined') oWin.helpWIN=openWIN(oWin.helpWIN,this.helpURL,1,1,550,450); else debugMSG('Help location has not been provided for this item.') } function winMAXIMIZE(){ if(this.state!="max"){ this.lastx=this.x; this.lasty=this.y; this.origw=this.w||this.origw; this.origh=this.h||this.origh; mw=oWin.maxX-oWin.minX; mh=oWin.maxY-oWin.minY; this.moveIt(oWin.minX,oWin.minY); this.resize(mw,mh); this.state="max"; this.addZ(); img=bc.doc.getElementById('mb'+this.obj.substring(1,this.obj.indexOf('Object'))); img.src='/mgb/portalit.nsf/winminimize.gif' } else{ this.resize(this.origw,this.origh); this.moveIt(this.lastx,this.lasty); this.state="reg"; this.addZ(); img=bc.doc.getElementById('mb'+this.obj.substring(1,this.obj.indexOf('Object'))); img.src='/mgb/portalit.nsf/winmaximize.gif' } return false } function winRESIZE(w,h){ if(woWin.maxX-this.x) w=oWin.maxX-this.x; if(hoWin.maxY-this.y) h=oWin.maxY-this.y; this.clipTo(0,w,h,0,1); this.oWindow.clipTo(0,w-(oWin.borderw*2),h-oWin.bottomh-oWin.headh,0,1); this.oHead.clipTo(0,w,oWin.headh,0,1); this.oButtons.moveIt(w-oWin.buttonw,2); this.oText.clipTo(0,w-(oWin.borderw*2),h-oWin.bottomh-oWin.headh,0,1); } function winADDZ(){ oWin.zIndex++; this.css.zIndex=oWin.zIndex; } /***************************************************************************** * Window functions * *****************************************************************************/ function addWIN(heading,linkURL,img,buttons,helpURL,target,x,y,w,h){ txt=''; if(wIdx!=0) txt=portal.evnt.innerHTML; txt+='
'; if(img=='') txt+=''; else txt+=''; txt+=heading+ '
' +setBUTTONS(buttons,wIdx)+ '
'; if(linkURL) txt+='
'; else txt+=''; portal.writeIt(txt); if(linkURL) for(j=0;j<=wIdx;j++) winITEM(j,x,y,w,h,helpURL,target); wIdx++ } function endWIN(x,y,w,h){ txt=portal.evnt.innerHTML; txt+=''; portal.writeIt(txt); for(j=0;j'; if(b==010||b==011||b==110||b==111) txt+=''; if(b==001||b==011||b==101||b==111) txt+=''; return txt } function openPORTLETS(p){ closePORTLETS(); // alert(p.length)//to delete wIdx=0; oWin.wIdx=wIdx; wCnt=p.length; for(x=0;x