--- rat/client/Attic/code.html 2001/06/27 19:19:06 1.38 +++ rat/client/Attic/code.html 2002/05/15 18:48:53 1.55 @@ -3,6 +3,32 @@ @@ -95,13 +124,13 @@ var parmflag=-1; // 1 means currently op // -1 means never yet opened/defined var iconpath='/adm/lonIcons/'; +var raticons='/adm/rat/'; 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; @@ -120,7 +149,7 @@ function insertrow(j,ex1,ex2) { objects=objects1+':'+objects2; data1=objects.split(':'); for (kj=0;kj'); - if ((what!='') && (what!=undefined)) { - if ((obj1!='') && (obj1!=undefined)) { + if ((what!='') && (typeof(what)!="undefined")) { + if ((obj1!='') && (typeof(obj1)!="undefined")) { objref="'"+obj1+"'"; parent.mapout.document.write (''); - if (mime!='') { + +' src="'+raticons+'resource.gif">'); + 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!='') && (obj1!=undefined)) { + if ((obj1!='') && (typeof(obj1)!="undefined")) { parent.mapout.document.write('
'); } } else { @@ -1010,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'; } @@ -1028,7 +1088,6 @@ function rescolor (ext,typ) { } // -------------------------------------------------------- Color of conditions - function condcolor(typ) { if (typ=='stop') { return '#EEAAAA'; } if (typ=='force') { return '#AAAAEE'; } @@ -1036,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(); @@ -1051,7 +1109,7 @@ if (rowtype[jid]!=0) { } parent.mapout.document.writeln(''); - if ((rowcont[jid]!='') && (rowcont[jid]!=undefined)) { + if ((rowcont[jid]!='') && (typeof(rowcont[jid])!="undefined")) { data2=rowcont[jid].split(':'); for (jk=0;jkmiddle) { for (k=middle+1;kleftin;k--) { - if ((colmap4[k]!='') && (colmap4[k]!=undefined)) { + if ((colmap4[k]!='') && (typeof(colmap4[k])!="undefined")) { colmap[k]='lrt'; } else { colmap[k]='lr'; @@ -1138,7 +1196,7 @@ if (rowtype[jid]!=0) { if (rightoutmiddle) { - if ((colmap3[middle]!='') && (colmap3[middle]!=undefined)) { + if ((colmap3[middle]!='') && (typeof(colmap3[middle])!="undefined")) { colmap2[middle]='rtdl'; } else { colmap2[middle]='rtl'; @@ -1147,7 +1205,7 @@ if (rowtype[jid]!=0) { } if (leftoutleftout;k--) { - if ((colmap3[k]!='') && (colmap3[k]!=undefined)) { + if ((colmap3[k]!='') && (typeof(colmap3[k])!="undefined")) { colmap2[k]='rld'; } else { colmap2[k]='rl'; @@ -1157,7 +1215,7 @@ if (rowtype[jid]!=0) { } if (rightout>middle) { for (k=middle+1;k'+ - '
'); + '
'); data1=infostr.split('&'); if (data1[0]=='c') { inf.document.write('Condition ('); @@ -1394,13 +1447,15 @@ function info(infostr) { if (data1[0]=='r') { data2=objcont[data1[1]].split(':'); url=data2[1]; + ext=data2[2]; urlparts=url.split('.'); mime=urlparts[urlparts.length-1]; - if (mime==undefined) { mime=''; } + 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 '); } @@ -1448,7 +1503,6 @@ function info(infostr) { } // ------------------------------------------------ "Escapes" out special chars - function escape(instring) { var outstring=''; var thischar; @@ -1456,7 +1510,7 @@ function escape(instring) { for (k=0;k'+ - '
'); + '
'); data1=infostr.split('&'); if (data1[0]=='c') { inf.document.writeln('Condition
'); @@ -1658,7 +1695,7 @@ function handler(infostr) { } inf.document.writeln( 'opener.infoclear();opener.editmode=0;opener.draw(' - +');">Change to above values  ' + +');">Save Changes  ' +' Reset
' +''); @@ -1675,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) { @@ -1732,7 +1767,7 @@ function handler(infostr) { +'+self.document.forms.resinfo.elements.e.checked+'+"':'" +'+self.document.forms.resinfo.elements.h.value+'+"':res'" +';opener.infoclear();opener.editmode=0;opener.draw();">' - +'Change to above values  ' + +'Save Changes  ' +' Reset' +'
'); if ((data2[3]!='start') && (data2[3]!='finish')) { @@ -1776,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; @@ -1796,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]!='') && - (objcont[mostrecent]!=undefined)) { + (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') { @@ -1912,7 +1945,6 @@ function save() { } // ----------------------------------------------- Reset all layout information - function graphreset() { var k; @@ -1935,7 +1967,7 @@ function graphreset() { objcont[0]=''; objlinks[0]=''; - if (((objcont[1]==undefined)&&(objcont[2]==undefined)) || + if (((typeof(objcont[1])=="undefined")&&(typeof(objcont[2])=="undefined")) || ((objcont[1]=='')&&(objcont[2]==''))) { objcont[1]='Start::false:start:res' objcont[2]='Finish::false:finish:res'; @@ -1945,7 +1977,6 @@ function graphreset() { } // --------------------- Compare two resources with each other for "straighten" - function rescompare(a,b) { data1=a.split(':'); data2=b.split(':'); @@ -1954,7 +1985,7 @@ function rescompare(a,b) { for (k=1;k
'); url=data1[1]; + ext=data1[2]; urlparts=url.split('.'); mime=urlparts[urlparts.length-1]; - if (mime==undefined) { mime=''; } - if (mime!='') { + if (typeof(mime)=="undefined") { mime=''; } + if ((mime!='') && (ext!='true')) { parent.mapout.document.write - ('

'+ + '

'); } parent.mapout.document.write( @@ -2058,7 +2092,7 @@ function tabledraw() { +'+parent.mapout.document.forms.r'+i+'.elements.e.checked+'+"':'" +'+parent.mapout.document.forms.r'+i+'.elements.h.value+'+"':res'" +';parent.code.draw();">' - +'Change to above values  ' + +'Save Changes  ' +' Reset

'); if ((data1[3]!='start') && (data1[3]!='finish')) { @@ -2135,7 +2169,6 @@ function tabledraw() { } // ----------------------------------------------------- Insert Resource Output - function insrestab(irow,be,af,typ) { parent.mapout.document.writeln('
'+ '
'); url=data1[1]; + ext=data1[2]; urlparts=url.split('.'); mime=urlparts[urlparts.length-1]; - if (mime==undefined) { mime=''; } - if (mime!='') { + if (typeof(mime)=="undefined") { mime=''; } + if ((mime!='') && (ext!='true')) { parent.mapout.document.write - ('

'+ + '

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

'); @@ -2276,7 +2316,6 @@ function simpletabledraw() { } // ---------------------------------- Sort objects to straighten graph or table - function sortobjs() { message("Sorting Resources: "+funny); var k; @@ -2298,7 +2337,7 @@ function sortobjs() { for (k=1;k