--- rat/client/Attic/code.html 2000/08/02 15:27:10 1.10 +++ rat/client/Attic/code.html 2002/05/15 13:45:47 1.54 @@ -3,14 +3,48 @@ @@ -30,6 +64,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,9 +106,31 @@ 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/'; +var raticons='/adm/rat/'; -// ------------------------------------------------ Insert a row into the table +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; @@ -92,7 +149,7 @@ function insertrow(j,ex1,ex2) { objects=objects1+':'+objects2; data1=objects.split(':'); for (kj=0;kj'); - if (what!='') { - if (obj1!='') { - obj1="'"+obj1+"'"; + if ((what!='') && (typeof(what)!="undefined")) { + if ((obj1!='') && (typeof(obj1)!="undefined")) { + objref="'"+obj1+"'"; parent.mapout.document.write - (''); + (''); } if (what=='r:') { + mime=''; + objnum=(obj1.split('&'))[1]; + if (typeof(objcont[objnum])!="undefined") { + urlparts=objcont[objnum].split(':'); + url=urlparts[1]; + ext=urlparts[2]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (typeof(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 (''); + +' src="'+raticons+'condition.gif">'); } else { if (what=='rs:') { + mime=''; + objnum=(obj1.split('&'))[1]; + if (typeof(objcont[objnum])!="undefined") { + urlparts=objcont[objnum].split(':'); + url=urlparts[1]; + ext=urlparts[2]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (typeof(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 (typeof(objcont[objnum])!="undefined") { + urlparts=objcont[objnum].split(':'); + url=urlparts[1]; + ext=urlparts[2]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (typeof(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 (''); + +' src="'+raticons+rtype+'.'+ctype+'.'+what+'.gif">'); } } } } - if (obj1!='') { + if ((obj1!='') && (typeof(obj1)!="undefined")) { parent.mapout.document.write('
'); } } else { @@ -946,14 +1071,13 @@ function drawcell (rtype,ctype,what,cm,o parent.mapout.document.write ( ''); + +' src="'+raticons+rtype+'.'+ctype+'.empty.gif">'); } parent.mapout.document.write(''); } } // --------------------------------------------------------- Color of resources - function rescolor (ext,typ) { var rc; var gc; var bc; if (ext=='true') { bc='55'; } else { bc='99'; } @@ -964,7 +1088,6 @@ function rescolor (ext,typ) { } // -------------------------------------------------------- Color of conditions - function condcolor(typ) { if (typ=='stop') { return '#EEAAAA'; } if (typ=='force') { return '#AAAAEE'; } @@ -972,7 +1095,6 @@ function condcolor(typ) { } // ----------------------------------------------------------------- Draw a row - function drawrow (jid) { var j; var jk; var k; var ck; var rtype; var objd1=new Array(); @@ -987,7 +1109,7 @@ if (rowtype[jid]!=0) { } parent.mapout.document.writeln(''); - if (rowcont[jid]!='') { + if ((rowcont[jid]!='') && (typeof(rowcont[jid])!="undefined")) { data2=rowcont[jid].split(':'); for (jk=0;jkmiddle) { for (k=middle+1;kleftin;k--) { - if (colmap4[k]!='') { + if ((colmap4[k]!='') && (typeof(colmap4[k])!="undefined")) { colmap[k]='lrt'; } else { colmap[k]='lr'; @@ -1074,7 +1196,7 @@ if (rowtype[jid]!=0) { if (rightoutmiddle) { - if (colmap3[middle]!='') { + if ((colmap3[middle]!='') && (typeof(colmap3[middle])!="undefined")) { colmap2[middle]='rtdl'; } else { colmap2[middle]='rtl'; @@ -1083,7 +1205,7 @@ if (rowtype[jid]!=0) { } if (leftoutleftout;k--) { - if (colmap3[k]!='') { + if ((colmap3[k]!='') && (typeof(colmap3[k])!="undefined")) { colmap2[k]='rld'; } else { colmap2[k]='rl'; @@ -1093,7 +1215,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=''; @@ -1270,14 +1398,12 @@ function infoclear() { } // ------------------------------------------------------------ Open inf window - function infopen() { var options="scrollbars=1,resizable=1,menubar=0,width=400,height=300"; inf=open("","infout",options); } // -------------------------------------------------------- Do inf status check - function infcheck() { if (inf.closed) { infopen(); @@ -1285,15 +1411,18 @@ 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(); inf.document.clear(); inf.document.writeln( ''+ - '
'); + '
'); data1=infostr.split('&'); if (data1[0]=='c') { inf.document.write('Condition ('); @@ -1317,7 +1446,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 (typeof(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'); @@ -1355,7 +1495,7 @@ function info(infostr) { } inf.document.writeln('
'); inf.document.close(); - parent.focus(); + parent.top.focus(); parent.mapout.focus(); notclear=0; lastinfo=infostr; @@ -1363,7 +1503,6 @@ function info(infostr) { } // ------------------------------------------------ "Escapes" out special chars - function escape(instring) { var outstring=''; var thischar; @@ -1371,7 +1510,7 @@ function escape(instring) { for (k=0;k'+ - '
'); + '
'); data1=infostr.split('&'); if (data1[0]=='c') { inf.document.writeln('Condition
'); @@ -1477,7 +1695,7 @@ function handler(infostr) { } inf.document.writeln( 'opener.infoclear();opener.editmode=0;opener.draw(' - +');">Change to above values  ' + +');">Save Changes  ' +' Reset
' +''); @@ -1494,8 +1712,6 @@ function handler(infostr) { 'opener.insertcondlink('+data1[1]+','+data1[3]+');'+ 'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' +');">Insert Resource Into Link'); - - } else { if (data1[0]=='r') { if (linkmode!=0) { @@ -1517,16 +1733,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 +1786,11 @@ function handler(infostr) { +'opener.linkmode='+data1[1]+';' +'opener.infoclear();">Link Resource'); } + inf.document.writeln( + '
Set Parameters'); + } } else { linkmode=0; @@ -1591,14 +1811,13 @@ function handler(infostr) { } inf.document.writeln( '
Done'); + +'opener.infoclear();">Cancel'); inf.document.writeln('
'); inf.document.close(); inf.focus(); } // ----------------------------------------------------- Clicks on empty fields - function empty(rid,k) { var cid=findcol(k); var lcol=k-1; @@ -1611,7 +1830,7 @@ function empty(rid,k) { inf.document.clear(); inf.document.writeln( ''+ - '
'+ + '
'+ 'Empty Field
'); inf.document.writeln('
Insert resource'); - if ((mostrecent!=0) && (objcont[mostrecent]!='')) { + if ((mostrecent!=0) && (objcont[mostrecent]!='') && + (typeof(objcont[mostrecent])!="undefined")) { inf.document.writeln('
Done'); + +'opener.infoclear();">Cancel'); inf.document.writeln('
'); inf.document.close(); inf.focus(); } // ---------------------------------------------------- Save into hidden fields - function save() { var k; if (graphdef=='yes') { @@ -1701,7 +1920,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]; + ext=data1[2]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (typeof(mime)=="undefined") { mime=''; } + if ((mime!='') && (ext!='true')) { + 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 +2059,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 +2108,13 @@ function tabledraw() { parent.mapout.document.writeln( ''+ - 'Link resource
'); for (j=2;j'); } -// ---------------------------------------- Draw simple table instead of graph +// ---------------------------------------- Draw simple table instead of graph function simpletabledraw() { var objsorted=new Array(); var robjs=new Array(); @@ -1979,9 +2222,13 @@ function simpletabledraw() { var nr; var ck; var cck; + var mime; + var ext; + var url; + var urlparts=new Array; var condid; var sortstr=sortobjs(); - if (sortstr!='') { + if ((sortstr!='') && (typeof(sortstr)!="undefined")) { objsorted=sortstr.split('&'); for (k=0;k
'+ '
' +'Insert resource linked to from above
'); @@ -1951,7 +2191,9 @@ function insrestab(irow,be,af,typ) { '' +'Insert resource linked to from above and linking to below
'); @@ -1961,14 +2203,15 @@ function insrestab(irow,be,af,typ) { '' +'Insert resource linking to below
'); } parent.mapout.document.writeln('
'+k+''); + parent.mapout.document.write('
'); + url=data1[1]; + ext=data1[2]; + urlparts=url.split('.'); + mime=urlparts[urlparts.length-1]; + if (typeof(mime)=="undefined") { mime=''; } + if ((mime!='') && (ext!='true')) { + 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(''); } @@ -2057,7 +2316,6 @@ function simpletabledraw() { } // ---------------------------------- Sort objects to straighten graph or table - function sortobjs() { message("Sorting Resources: "+funny); var k; @@ -2079,7 +2337,7 @@ function sortobjs() { for (k=1;k
Start
+ + + + + + + + + + + + + +
Toggle display Zoom out Zoom in Condense Straighten Revert Undo Redo Group search Group import Save map Save map and layout 
+
+ - - - - -