--- rat/client/Attic/code.html 2001/01/17 19:48:33 1.13 +++ rat/client/Attic/code.html 2001/06/29 21:57:46 1.39 @@ -10,7 +10,12 @@ Resource Assembly Tool 2/2,2/3,2/10,2/12,2/13,2/14,2/15,2/17,2/18,2/19,2/20,2/21,2/22, 5/2,5/3,5/4,5/5,5/6,5/8,5/9,5/13,5/18,5/20,5/22,5/24,5/25, 6/7,6/8,6/9,6/10,6/12,6/15,7/4,7/26,7/28,7/31,8/5,8/19,8/24, -01/17/01 Gerd Kortemeyer with Scott Harrison +01/17/01,03/03,03/05 Gerd Kortemeyer with Scott Harrison +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 --> @@ -30,6 +35,7 @@ var colmap5=new Array(); var colmap6=new Array(); var obj=new Array(); var objcont=new Array(); +var objparms=new Array(); var objlinks=new Array(); var rowcont=new Array(); var rowtype=new Array(); @@ -71,6 +77,28 @@ var data4=new Array(1024); var data5=new Array(1024); var inf; +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"; +} // ------------------------------------------------ Insert a row into the table @@ -911,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 @@ -1280,7 +1336,16 @@ function infoclear() { } inf.document.writeln(''); inf.document.close(); - parent.focus(); + if (srchflag==1) { + srchclose(); + } + if (idxflag==1) { + idxclose(); + } + if (parmflag==1) { + parmclose(); + } + parent.top.focus(); parent.mapout.focus(); notclear=1; lastinfo=''; @@ -1305,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(); @@ -1335,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'); @@ -1373,7 +1450,7 @@ function info(infostr) { } inf.document.writeln(''); inf.document.close(); - parent.focus(); + parent.top.focus(); parent.mapout.focus(); notclear=0; lastinfo=infostr; @@ -1452,6 +1529,98 @@ function insertcondlink(cid,lnr) { joinres(nobj,tobj,0); } + + + +// ------------------------------------------------------ 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() { + if (srch && !srch.closed) { + srchflag=0; + srch.close(); + } +} + +// ------------------------------------------------------- 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(mode) { + var options="scrollbars=1,resizable=1,menubar=0"; + srchmode=mode; + srchflag=1; + srch=open("/adm/searchcat?catalogmode=interactive","srchout",options); + srch.focus(); +} + +// -------------------------------------------- Interface function to searching + +function search() { + alert("Searching not yet implemented"); +} + +// ------------------------------------------------------- Do srch status check + +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) { @@ -1499,7 +1668,7 @@ function handler(infostr) { } inf.document.writeln( 'opener.infoclear();opener.editmode=0;opener.draw(' - +');">Change to above values  ' + +');">Save Changes  ' +' Reset
' +''); @@ -1539,16 +1708,19 @@ function handler(infostr) { } } inf.document.write( - '
Title:' + ''); - 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:' + inf.document.write('
URL:' +'
External:
' + inf.document.write('>' + +'Browse ' + +'Search
' +' Optional
' - +'
' - +'Change to above values  ' + +'Save Changes  ' +' Reset' +'
'); if ((data2[3]!='start') && (data2[3]!='finish')) { @@ -1593,6 +1761,11 @@ function handler(infostr) { +'opener.linkmode='+data1[1]+';' +'opener.infoclear();">Link Resource'); } + inf.document.writeln( + '
Set Parameters'); + } } else { linkmode=0; @@ -1613,7 +1786,7 @@ function handler(infostr) { } inf.document.writeln( '
Done'); + +'opener.infoclear();">Cancel'); inf.document.writeln('
'); inf.document.close(); inf.focus(); @@ -1683,7 +1856,7 @@ function empty(rid,k) { inf.document.writeln( '
Done'); + +'opener.infoclear();">Cancel'); inf.document.writeln(''); inf.document.close(); inf.focus(); @@ -1724,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(''); } @@ -1842,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( ''); + 'Link resource'); } + parent.mapout.document.writeln( + '
Set Parameters'); + + parent.mapout.document.writeln(''); parent.mapout.document.writeln('
Start
Title:
URL:
External:
Optional
' - +'
' - +'Change to above values  ' + +'Save Changes  ' +' Reset
'); if ((data1[3]!='start') && (data1[3]!='finish')) { @@ -1894,8 +2086,13 @@ function tabledraw() { parent.mapout.document.writeln( ''+ - 'Link resource
'); for (j=2;j' +'Insert resource linked to from above
'); @@ -1972,7 +2170,9 @@ function insrestab(irow,be,af,typ) { '' +'Insert resource linked to from above and linking to below
'); @@ -1982,6 +2182,7 @@ function insrestab(irow,be,af,typ) { '' +'Insert resource linking to below
'); @@ -2018,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(''); } @@ -2241,7 +2453,6 @@ function condense() { function load() { message("Loading"); schedule('load'); - checkdef(); } function finishload() { @@ -2268,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]; } @@ -2283,6 +2501,17 @@ function finishload() { } } +// -------------------------------------------------------------- Parameter set + +function setparms(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 function undo() { @@ -2345,8 +2574,8 @@ function wheelswitch() { // --------------------------------------------- Checks if server frame defined function checkdef() { - if (parent.server.document.forms.storage.output.value!=undefined) { - srvloaded(); + if (parent.flag==1) { + srvloaded(); } if ((finishdone==0) && (tim==0)) { setTimeout('checkdef()',100); } } @@ -2375,14 +2604,26 @@ function schedule(action) { reqaction=action; tim=0; finishdone=0; - canceltim=setTimeout('tim=1;',20000) + canceltim=setTimeout('tim=1;',20000); + checkdef(); wait(); } +// ----------------------------------------------------- launch indexer browser + +function groupsearch() { + alert('not yet implemented'); +} + +function groupimport() { + idxcheck('groupimport'); +} + // -------------------------------------------------------------- Store changes function storechange() { var k; + parent.flag=0; parent.server.document.forms.storage.submit(); schedule('save'); } @@ -2431,12 +2672,18 @@ function main() { } -// ------------------------------------------------------------- Save on leave? +// ---------------------------------------------------------- Close the window? function leave() { if (!inf.closed) { inf.close(); } + if (srch && !srch.closed) { + srchclose(); + } + if (idx && !idx.closed) { + srchclose(); + } } @@ -2451,11 +2698,8 @@ function leave() { RevertUndoRedo -Store +Group Search +Group Import +Save Map - - - - -
Start