--- rat/client/Attic/code.html 2001/05/28 19:22:45 1.31 +++ rat/client/Attic/code.html 2001/06/29 21:57:46 1.39 @@ -14,6 +14,8 @@ Resource Assembly Tool March/April 01 Scott Harrison 04/20 Gerd Kortemeyer 04/30 Scott Harrison +05/31 Scott Harrison +06/11,06/25,06/27,06/28,06/29 Gerd Kortemeyer --> @@ -79,6 +81,20 @@ var srch; var srchflag=-1; // 1 means currently open // 0 means closed (but has been open) // -1 means never yet opened/defined +var srchmode=''; + +var idx; +var idxflag=-1; // 1 means currently open + // 0 means closed (but has been open) + // -1 means never yet opened/defined +var idxmode=''; + +var parm; +var parmflag=-1; // 1 means currently open + // 0 means closed (but has been open) + // -1 means never yet opened/defined + +var iconpath='/adm/lonIcons/'; function testfunction() { inf.document.forms.resinfo.elements.t.value="ABC"; @@ -923,20 +939,48 @@ function delres (obj1,recon) { function drawcell (rtype,ctype,what,cm,obj1,ej,ek,ne) { var bgcolor; + var url=''; + var urlparts=new Array; + var mimetype; + var objref; + var objnum; + if ((what=='') && (ne==0)) { cm="#DDDDDD"; } if (ctype!=0) { parent.mapout.document.write(''); if ((what!='') && (what!=undefined)) { if ((obj1!='') && (obj1!=undefined)) { - obj1="'"+obj1+"'"; + objref="'"+obj1+"'"; parent.mapout.document.write - (''); + (''); } if (what=='r:') { + mime=''; + objnum=(obj1.split('&'))[1]; + if (objcont[objnum]!=undefined) { + urlparts=objcont[objnum].split(':'); + url=urlparts[1]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (mime==undefined) { mime=''; } + } parent.mapout.document.write - (''); + if (mime!='') { + parent.mapout.document.write + ('
'+ + ''); + } else { + parent.mapout.document.write + ('
'); + } + parent.mapout.document.write + ('
'); } else { if (what=='c:') { parent.mapout.document.write @@ -1295,6 +1339,12 @@ function infoclear() { if (srchflag==1) { srchclose(); } + if (idxflag==1) { + idxclose(); + } + if (parmflag==1) { + parmclose(); + } parent.top.focus(); parent.mapout.focus(); notclear=1; @@ -1320,6 +1370,9 @@ function infcheck() { // --------------------------------------------------- Prints out resource info function info(infostr) { + var mime=''; + var urlparts=new Array; + var url=''; if ((editmode!=1) && (infostr!=lastinfo)) { notclear=1; infcheck(); @@ -1350,7 +1403,16 @@ function info(infostr) { } else { if (data1[0]=='r') { data2=objcont[data1[1]].split(':'); - inf.document.write(''); + url=data2[1]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (mime==undefined) { mime=''; } + if (mime!='') { + inf.document.write + ('
  '); + } + inf.document.write(''); if (data2[2]=='true') { inf.document.write('External '); } if (data2[3]=='start') { inf.document.writeln('Start'); @@ -1470,12 +1532,33 @@ function insertcondlink(cid,lnr) { +// ------------------------------------------------------ Clears indexer window + +function idxclear() { + idx.document.clear(); +} + // ------------------------------------------------------- Clears search window function srchclear() { srch.document.clear(); } +// --------------------------------------------------------- Clears parm window + +function parmclear() { + parm.document.clear(); +} + +// ------------------------------------------------------ Closes indexer window + +function idxclose() { + if (idx && !idx.closed) { + idxflag=0; + idx.close(); + } +} + // ------------------------------------------------------- Closes search window function srchclose() { @@ -1485,10 +1568,30 @@ function srchclose() { } } +// ------------------------------------------------------- Closes search window + +function parmclose() { + if (parm && !parm.closed) { + parmflag=0; + parm.close(); + } +} + +// -------------------------------------------------------- Open indexer window + +function idxopen(mode) { + var options="scrollbars=1,resizable=1,menubar=0"; + idxmode=mode; + idxflag=1; + idx=open("/res?catalogmode="+mode,"idxout",options); + idx.focus(); +} + // --------------------------------------------------------- Open search window -function srchopen() { +function srchopen(mode) { var options="scrollbars=1,resizable=1,menubar=0"; + srchmode=mode; srchflag=1; srch=open("/adm/searchcat?catalogmode=interactive","srchout",options); srch.focus(); @@ -1502,13 +1605,22 @@ function search() { // ------------------------------------------------------- Do srch status check -function srchcheck() { - if (!srch || srch.closed) { +function srchcheck(mode) { + if (!srch || srch.closed || srchmode!=mode) { srchopen(); } srch.focus(); } +// -------------------------------------------------------- Do idx status check + +function idxcheck(mode) { + if (!idx || idx.closed || idxmode!=mode) { + idxopen(mode); + } + idx.focus(); +} + // ---------------------------------------------------- Handles "click to edit" function handler(infostr) { @@ -1556,7 +1668,7 @@ function handler(infostr) { } inf.document.writeln( 'opener.infoclear();opener.editmode=0;opener.draw(' - +');">Change to above values  ' + +');">Save Changes  ' +' Reset
' +''); @@ -1599,13 +1711,16 @@ function handler(infostr) { '
'); - if ((data2[3]!='start') && (data2[3]!='finish')) { inf.document.write('' +'' - +''); + if ((data2[3]!='start') && (data2[3]!='finish')) { + inf.document.write(''); - } else { - inf.document.write( - ''); - } + } inf.document.writeln( '
Title:' +'
URL:' +'
External:Search
' + inf.document.write('>' + +'Browse ' + +'Search
' +' Optional
' - +'
' - +'Change to above values  ' + +'Save Changes  ' +' Reset' +'
'); if ((data2[3]!='start') && (data2[3]!='finish')) { @@ -1675,7 +1786,7 @@ function handler(infostr) { } inf.document.writeln( '
Done'); + +'opener.infoclear();">Cancel'); inf.document.writeln('
'); inf.document.close(); inf.focus(); @@ -1745,7 +1856,7 @@ function empty(rid,k) { inf.document.writeln( '
Done'); + +'opener.infoclear();">Cancel'); inf.document.writeln(''); inf.document.close(); inf.focus(); @@ -1786,7 +1897,13 @@ function save() { } parent.server.document.forms.storage.output.value+= '<&>tablemode<:>'+tablemode; - + + for (k=0;kobjparms<:>'+k+'<:>'+objparms[k]; + } + } for (k=0;k'); + url=data1[1]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (mime==undefined) { mime=''; } + if (mime!='') { + parent.mapout.document.write + ('

'+ + '

'); + } + parent.mapout.document.write( + '

'); data2=obj[i].split('&'); parent.mapout.document.write(''); + if (data1[3]=='start') { parent.mapout.document.writeln(''); } @@ -1904,14 +2037,15 @@ function tabledraw() { ''); - if ((data1[3]!='start') && (data1[3]!='finish')) { parent.mapout.document.write( '' +'' - +''); + if ((data1[3]!='start') && (data1[3]!='finish')) { + parent.mapout.document.write( + ''); - } else { - parent.mapout.document.write( - ''); - } + } parent.mapout.document.write( '
Start
Title:
URL:
External:
Optional
' - +'
' - +'Change to above values  ' + +'Save Changes  ' +' Reset
'); if ((data1[3]!='start') && (data1[3]!='finish')) { @@ -2089,11 +2219,22 @@ function simpletabledraw() { } data1=objcont[i].split(':'); ck=rescolor(data1[2],data1[3]); - parent.mapout.document.write('
'+k+''); + parent.mapout.document.write('
'); + url=data1[1]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (mime==undefined) { mime=''; } + if (mime!='') { + parent.mapout.document.write + ('

'+ + '

'); + } + parent.mapout.document.write(''+k+'

'); data2=obj[i].split('&'); parent.mapout.document.write(''); + if (data1[3]=='start') { parent.mapout.document.writeln(''); } @@ -2338,6 +2479,13 @@ function finishload() { if (data2[0]=='obj') { obj[data2[1]]=data2[2]; } if (data2[0]=='objcont') { objcont[data2[1]]=data2[2]; } if (data2[0]=='objlinks') { objlinks[data2[1]]=data2[2]; } + if (data2[0]=='objparms') { + if (objparms[data2[1]]==undefined) { + objparms[data2[1]]=data2[2]; + } else { + objparms[data2[1]]+=':'+data2[2]; + } + } if (data2[0]=='rowcont') { rowcont[data2[1]]=data2[2]; } if (data2[0]=='row') { row[data2[1]]=1*data2[2]; } if (data2[0]=='col') { col[data2[1]]=1*data2[2]; } @@ -2356,7 +2504,12 @@ function finishload() { // -------------------------------------------------------------- Parameter set function setparms(resid) { - alert('Called setparms for '+resid); + var options="scrollbars=1,resizable=1,menubar=0"; + parmflag=1; + data1=objcont[resid].split(':'); + parm=open("/adm/ratparms?url="+data1[1]+"&parms="+objparms[resid]+ + "&resid="+resid,"parmout",options); + parm.focus(); } // -------------------------------------------------------------- Undo function @@ -2456,6 +2609,16 @@ function schedule(action) { wait(); } +// ----------------------------------------------------- launch indexer browser + +function groupsearch() { + alert('not yet implemented'); +} + +function groupimport() { + idxcheck('groupimport'); +} + // -------------------------------------------------------------- Store changes function storechange() { @@ -2518,6 +2681,9 @@ function leave() { if (srch && !srch.closed) { srchclose(); } + if (idx && !idx.closed) { + srchclose(); + } } @@ -2532,11 +2698,8 @@ function leave() { RevertUndoRedo -Store +Group Search +Group Import +Save Map - - - - -
Start