--- rat/client/Attic/code.html 2000/07/28 21:36:13 1.8 +++ rat/client/Attic/code.html 2001/07/04 18:19:53 1.40 @@ -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 -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,07/04 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(); @@ -62,6 +68,8 @@ var funny='|'; var reqaction=''; var canceltim; +var expense=0; + var data1=new Array(1024); var data2=new Array(1024); var data3=new Array(1024); @@ -69,12 +77,35 @@ 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 function insertrow(j,ex1,ex2) { var kj; stored=0; + expense++; expense++; objects1=''; objects2=''; for (kj=0;kj<=maxrow;kj++) { @@ -89,7 +120,7 @@ function insertrow(j,ex1,ex2) { objects=objects1+':'+objects2; data1=objects.split(':'); for (kj=0;kjj ) { col[kj]++; } } maxcol++; + expense++; expense++; col[maxcol]=j+1; } @@ -252,7 +284,7 @@ function maprow (jid,obj1,ign) { var j; var k; var left; var right; var middle; middle=-1; for (j=0;j<=maxcol;j++) { colmap[j]=0; } - if (rowcont[jid]!='') { + if ((rowcont[jid]!='') && (rowcont[jid]!=undefined)) { data2=rowcont[jid].split(':'); for (j=0;j'); - 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]; + ext=urlparts[2]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (mime==undefined) { mime=''; } + } parent.mapout.document.write - (''); + if ((mime!='') && (ext!='true')) { + parent.mapout.document.write + ('
'+ + ''); + } else { + parent.mapout.document.write + ('
'); + } + parent.mapout.document.write + ('
'); } else { if (what=='c:') { parent.mapout.document.write @@ -867,14 +990,61 @@ function drawcell (rtype,ctype,what,cm,o +' src="condition.gif">'); } else { if (what=='rs:') { + mime=''; + objnum=(obj1.split('&'))[1]; + if (objcont[objnum]!=undefined) { + urlparts=objcont[objnum].split(':'); + url=urlparts[1]; + ext=urlparts[2]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (mime==undefined) { mime=''; } + } parent.mapout.document.write - (''); + if ((mime!='') && (ext!='true')) { + parent.mapout.document.write + ('
'+ + ''); + } else { + parent.mapout.document.write + ('
'); + } + parent.mapout.document.write + ('
'); + } else { if (what=='rf:') { + mime=''; + objnum=(obj1.split('&'))[1]; + if (objcont[objnum]!=undefined) { + urlparts=objcont[objnum].split(':'); + url=urlparts[1]; + ext=urlparts[2]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (mime==undefined) { mime=''; } + } parent.mapout.document.write - (''); + if ((mime!='') && (ext!='true')) { + parent.mapout.document.write + ('
'+ + ''); + } else { + parent.mapout.document.write + ('
'); + } + parent.mapout.document.write + ('
'); } else { parent.mapout.document.write (''); } } else { @@ -940,7 +1110,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'; @@ -1027,7 +1197,7 @@ if (rowtype[jid]!=0) { if (rightoutmiddle) { - if (colmap3[middle]!='') { + if ((colmap3[middle]!='') && (colmap3[middle]!=undefined)) { colmap2[middle]='rtdl'; } else { colmap2[middle]='rtl'; @@ -1036,7 +1206,7 @@ if (rowtype[jid]!=0) { } if (leftoutleftout;k--) { - if (colmap3[k]!='') { + if ((colmap3[k]!='') && (colmap3[k]!=undefined)) { colmap2[k]='rld'; } else { colmap2[k]='rl'; @@ -1046,7 +1216,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=''; @@ -1240,6 +1419,10 @@ function infcheck() { // --------------------------------------------------- Prints out resource info function info(infostr) { + var mime=''; + var ext; + var urlparts=new Array; + var url=''; if ((editmode!=1) && (infostr!=lastinfo)) { notclear=1; infcheck(); @@ -1270,7 +1453,18 @@ function info(infostr) { } else { if (data1[0]=='r') { data2=objcont[data1[1]].split(':'); - inf.document.write(''); + url=data2[1]; + ext=data2[2]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (mime==undefined) { mime=''; } + if (ext=='true') { 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'); @@ -1308,7 +1502,7 @@ function info(infostr) { } inf.document.writeln(''); inf.document.close(); - parent.focus(); + parent.top.focus(); parent.mapout.focus(); notclear=0; lastinfo=infostr; @@ -1359,7 +1553,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); } @@ -1379,10 +1575,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) { @@ -1430,7 +1720,7 @@ function handler(infostr) { } inf.document.writeln( 'opener.infoclear();opener.editmode=0;opener.draw(' - +');">Change to above values  ' + +');">Save Changes  ' +' Reset
' +''); @@ -1470,16 +1760,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')) { @@ -1524,6 +1813,11 @@ function handler(infostr) { +'opener.linkmode='+data1[1]+';' +'opener.infoclear();">Link Resource'); } + inf.document.writeln( + '
Set Parameters'); + } } else { linkmode=0; @@ -1544,7 +1838,7 @@ function handler(infostr) { } inf.document.writeln( '
Done'); + +'opener.infoclear();">Cancel'); inf.document.writeln('
'); inf.document.close(); inf.focus(); @@ -1573,7 +1867,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(); @@ -1654,7 +1949,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(''); } @@ -1771,14 +2089,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')) { @@ -1823,8 +2138,13 @@ function tabledraw() { parent.mapout.document.writeln( ''+ - 'Link resource
'); for (j=2;j' +'Insert resource linked to from above
'); @@ -1901,7 +2222,9 @@ function insrestab(irow,be,af,typ) { '' +'Insert resource linked to from above and linking to below
'); @@ -1911,6 +2234,7 @@ function insrestab(irow,be,af,typ) { '' +'Insert resource linking to below
'); @@ -1931,7 +2255,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(''); } @@ -2029,7 +2364,7 @@ function sortobjs() { for (k=1;k'); var k; for (k=0;kRevert Undo Redo -Store +Group Search +Group Import +Save Map - - - - -
Start