--- rat/client/Attic/code.html 2001/05/28 22:23:00 1.32 +++ rat/client/Attic/code.html 2003/01/23 20:23:07 1.62 @@ -3,6 +3,32 @@ @@ -79,17 +110,33 @@ 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 copydx; +var copydxflag=-1; // 1 means currently open + // 0 means closed (but has been open) + // -1 means never yet opened/defined +var copydxmode=''; + +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/'; 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; @@ -108,7 +155,7 @@ function insertrow(j,ex1,ex2) { objects=objects1+':'+objects2; data1=objects.split(':'); for (kj=0;kj'); - if ((what!='') && (what!=undefined)) { - if ((obj1!='') && (obj1!=undefined)) { - 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=''; } + mime=mime.toLowerCase(); + } parent.mapout.document.write - (''); + (''); + if (zscale==3) { + if ((mime!='') && (ext!='true')) { + parent.mapout.document.write + ('
'+ + ''); + } else { + parent.mapout.document.write + ('
'); + } + parent.mapout.document.write + ('
'); + } else { + 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=''; } + mime=mime.toLowerCase(); + } parent.mapout.document.write - (''); + (''); + if (zscale==3) { + if ((mime!='') && (ext!='true')) { + parent.mapout.document.write + ('
'+ + ''); + } else { + parent.mapout.document.write + ('
'); + } + parent.mapout.document.write + ('
'); + } else { + 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=''; } + mime=mime.toLowerCase(); + } parent.mapout.document.write - (''); + (''); + if (zscale==3) { + if ((mime!='') && (ext!='true')) { + parent.mapout.document.write + ('
'+ + ''); + } else { + parent.mapout.document.write + ('
'); + } + parent.mapout.document.write + ('
'); + } else { + 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 { @@ -980,14 +1099,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'; } @@ -998,7 +1116,6 @@ function rescolor (ext,typ) { } // -------------------------------------------------------- Color of conditions - function condcolor(typ) { if (typ=='stop') { return '#EEAAAA'; } if (typ=='force') { return '#AAAAEE'; } @@ -1006,7 +1123,6 @@ function condcolor(typ) { } // ----------------------------------------------------------------- Draw a row - function drawrow (jid) { var j; var jk; var k; var ck; var rtype; var objd1=new Array(); @@ -1021,7 +1137,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'; @@ -1108,7 +1224,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'; @@ -1117,7 +1233,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'; @@ -1127,7 +1243,7 @@ if (rowtype[jid]!=0) { } if (rightout>middle) { for (k=middle+1;k'+ - '
'); + '
'); data1=infostr.split('&'); if (data1[0]=='c') { inf.document.write('Condition ('); @@ -1357,7 +1474,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'); @@ -1403,7 +1531,6 @@ function info(infostr) { } // ------------------------------------------------ "Escapes" out special chars - function escape(instring) { var outstring=''; var thischar; @@ -1411,7 +1538,7 @@ function escape(instring) { for (k=0;k

Copy from Map

'+ + '
'+ + '
'); + + copydx.document.writeln(''); + copydx.focus(); +} // --------------------------------------------------------- Open search window - -function srchopen() { +function srchopen(mode) { var options="scrollbars=1,resizable=1,menubar=0"; + srchmode=mode; srchflag=1; - srch=open("/adm/searchcat?catalogmode=interactive","srchout",options); + srch=open("/adm/searchcat?launch=1&mode=rat&catalogmode="+mode,"srchout",options); srch.focus(); } // -------------------------------------------- Interface function to searching - function search() { alert("Searching not yet implemented"); } // ------------------------------------------------------- Do srch status check - -function srchcheck() { - if (!srch || srch.closed) { - srchopen(); +function srchcheck(mode) { + if (!srch || srch.closed || srchmode!=mode) { + srchopen(mode); } srch.focus(); } // -------------------------------------------------------- Do idx status check - -function idxcheck() { - if (!idx || idx.closed) { - idxopen(); +function idxcheck(mode) { + if (!idx || idx.closed || idxmode!=mode) { + idxopen(mode); } idx.focus(); } -// ---------------------------------------------------- Handles "click to edit" +// -------------------------------------------------------- Do idx status check +function copydxcheck(mode) { + if (!copydx || copydx.closed || copydxmode!=mode) { + copydxopen(mode); + } + copydx.focus(); +} +// ---------------------------------------------------- Handles "click to edit" function handler(infostr) { var k; editmode=1; @@ -1559,7 +1748,7 @@ function handler(infostr) { inf.document.clear(); inf.document.writeln( ''+ - '
'); + '
'); data1=infostr.split('&'); if (data1[0]=='c') { inf.document.writeln('Condition
'); @@ -1596,7 +1785,7 @@ function handler(infostr) { } inf.document.writeln( 'opener.infoclear();opener.editmode=0;opener.draw(' - +');">Change to above values  ' + +');">Save Changes  ' +' Reset
' +''); @@ -1613,8 +1802,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) { @@ -1638,17 +1825,17 @@ function handler(infostr) { inf.document.write( '
'); - if ((data2[3]!='start') && (data2[3]!='finish')) { ++escape(data2[0])+'">'); inf.document.write('' +'' - +''); + if ((data2[3]!='start') && (data2[3]!='finish')) { + inf.document.write(''); - } else { - inf.document.write( - ''); - } + } inf.document.writeln( '
Title:' +'
URL:' +'
External:' - +'Browse ' + +'Browse ' +'Search
' + +'.srchcheck(\'interactive\')">Search
' +' Optional
' - +'
' - +'Change to above values  ' + +'Save Changes  ' +' Reset' +'
'); if ((data2[3]!='start') && (data2[3]!='finish')) { @@ -1718,14 +1901,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; @@ -1738,7 +1920,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') { @@ -1829,7 +2010,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(''); } @@ -1947,14 +2145,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( '
Start
Title:
URL:
External:
Optional
' - +'
' - +'Change to above values  ' + +'Save Changes  ' +' Reset
'); if ((data1[3]!='start') && (data1[3]!='finish')) { @@ -2060,7 +2255,6 @@ function tabledraw() { } // ----------------------------------------------------- Insert Resource Output - function insrestab(irow,be,af,typ) { 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(''); } @@ -2192,7 +2402,6 @@ function simpletabledraw() { } // ---------------------------------- Sort objects to straighten graph or table - function sortobjs() { message("Sorting Resources: "+funny); var k; @@ -2214,7 +2423,7 @@ function sortobjs() { for (k=1;k
Start
+ + + + + + + + + + + + + + +
Toggle displayZoom outZoom inCondenseStraightenRevertUndoRedoSearchImportCopySave mapSave map and layout
+
+ - - - - -