--- rat/client/Attic/code.html 2000/08/02 15:27:10 1.10 +++ rat/client/Attic/code.html 2001/06/29 21:57:46 1.39 @@ -9,8 +9,13 @@ Resource Assembly Tool 1/7,1/8,1/10,1/14,1/15,1/16,1/21,1/22,1/29,1/30,1/31, 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 -Gerd Kortemeyer with Scott Harrison +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,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 @@ -92,7 +120,7 @@ function insertrow(j,ex1,ex2) { objects=objects1+':'+objects2; data1=objects.split(':'); for (kj=0;kj'); - if (what!='') { - if (obj1!='') { - obj1="'"+obj1+"'"; + if ((what!='') && (what!=undefined)) { + if ((obj1!='') && (obj1!=undefined)) { + 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 @@ -930,7 +1004,7 @@ function drawcell (rtype,ctype,what,cm,o } } } - if (obj1!='') { + if ((obj1!='') && (obj1!=undefined)) { parent.mapout.document.write('
'); } } else { @@ -987,7 +1061,7 @@ if (rowtype[jid]!=0) { } parent.mapout.document.writeln(''); - if (rowcont[jid]!='') { + if ((rowcont[jid]!='') && (rowcont[jid]!=undefined)) { data2=rowcont[jid].split(':'); for (jk=0;jkmiddle) { for (k=middle+1;kleftin;k--) { - if (colmap4[k]!='') { + if ((colmap4[k]!='') && (colmap4[k]!=undefined)) { colmap[k]='lrt'; } else { colmap[k]='lr'; @@ -1074,7 +1148,7 @@ if (rowtype[jid]!=0) { if (rightoutmiddle) { - if (colmap3[middle]!='') { + if ((colmap3[middle]!='') && (colmap3[middle]!=undefined)) { colmap2[middle]='rtdl'; } else { colmap2[middle]='rtl'; @@ -1083,7 +1157,7 @@ if (rowtype[jid]!=0) { } if (leftoutleftout;k--) { - if (colmap3[k]!='') { + if ((colmap3[k]!='') && (colmap3[k]!=undefined)) { colmap2[k]='rld'; } else { colmap2[k]='rl'; @@ -1093,7 +1167,7 @@ if (rowtype[jid]!=0) { } if (rightout>middle) { for (k=middle+1;k'); 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=''; @@ -1287,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(); @@ -1317,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'); @@ -1355,7 +1450,7 @@ function info(infostr) { } inf.document.writeln(''); inf.document.close(); - parent.focus(); + parent.top.focus(); parent.mapout.focus(); notclear=0; lastinfo=infostr; @@ -1406,7 +1501,9 @@ function insertreslink(infostr) { dellink(lnr); newresource(rid,cid,'','','false','normal'); nobj=obj.length-1; + save(); joinres(fobj,nobj,cobj); + save(); joinres(nobj,tobj,0); } @@ -1426,10 +1523,104 @@ function insertcondlink(cid,lnr) { dellink(lnr); newresource(maxrow,cid,'','','false','normal'); nobj=obj.length-1; + save(); joinres(fobj,nobj,cobj); + save(); 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) { @@ -1477,7 +1668,7 @@ function handler(infostr) { } inf.document.writeln( 'opener.infoclear();opener.editmode=0;opener.draw(' - +');">Change to above values  ' + +');">Save Changes  ' +' Reset
' +''); @@ -1517,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')) { @@ -1571,6 +1761,11 @@ function handler(infostr) { +'opener.linkmode='+data1[1]+';' +'opener.infoclear();">Link Resource'); } + inf.document.writeln( + '
Set Parameters'); + } } else { linkmode=0; @@ -1591,7 +1786,7 @@ function handler(infostr) { } inf.document.writeln( '
Done'); + +'opener.infoclear();">Cancel'); inf.document.writeln('
'); inf.document.close(); inf.focus(); @@ -1620,7 +1815,8 @@ function empty(rid,k) { 'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' +');">Insert resource'); - if ((mostrecent!=0) && (objcont[mostrecent]!='')) { + if ((mostrecent!=0) && (objcont[mostrecent]!='') && + (objcont[mostrecent]!=undefined)) { inf.document.writeln('
Done'); + +'opener.infoclear();">Cancel'); inf.document.writeln(''); inf.document.close(); inf.focus(); @@ -1701,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(''); } @@ -1821,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')) { @@ -1873,8 +2086,13 @@ function tabledraw() { parent.mapout.document.writeln( ''+ - 'Link resource
'); for (j=2;j' +'Insert resource linked to from above
'); @@ -1951,7 +2170,9 @@ function insrestab(irow,be,af,typ) { '' +'Insert resource linked to from above and linking to below
'); @@ -1961,6 +2182,7 @@ function insrestab(irow,be,af,typ) { '' +'Insert resource linking to below
'); @@ -1981,7 +2203,7 @@ function simpletabledraw() { var cck; var condid; var sortstr=sortobjs(); - if (sortstr!='') { + if ((sortstr!='') && (sortstr!=undefined)) { objsorted=sortstr.split('&'); for (k=0;k
'+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(''); } @@ -2079,7 +2312,7 @@ function sortobjs() { for (k=1;k'); var k; for (k=0;kRevert Undo Redo -Store +Group Search +Group Import +Save Map - - - - -
Start