--- rat/client/Attic/code.html 2001/07/25 03:10:15 1.43 +++ rat/client/Attic/code.html 2003/02/25 14:42:02 1.64 @@ -3,6 +3,32 @@ @@ -90,19 +114,25 @@ var idxflag=-1; // 1 means currently ope // -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; @@ -207,7 +237,6 @@ function insertrow(j,ex1,ex2) { } // --------------------------------------------- Creates a new condition object - function newcondition(content,type) { var ko; stored=0; @@ -218,7 +247,6 @@ function newcondition(content,type) { } // ---------------------------------------------- Creates a new resource object - function newresource(rid,cid,text,url,ext,type) { stored=0; objcont[addobj(rid,'b&'+rid+'&'+cid+':0:0:0')]= @@ -227,7 +255,6 @@ function newresource(rid,cid,text,url,ex // -------------------------------- Insert a condition into a port of an object - function insertcond(obj1,portnr,cond) { var k; stored=0; @@ -244,7 +271,6 @@ function insertcond(obj1,portnr,cond) { // --------------------------------------------- Insert a column into the table // Inserts a new table column after table column j - function insertcol(j) { var kj; stored=0; @@ -257,7 +283,6 @@ function insertcol(j) { } // --------------------------------------------------------------- Find the row - function findrow(jid) { var j; for (j=0;j<=maxrow;j++) { if (row[j]==jid) { return j; } } @@ -265,7 +290,6 @@ function findrow(jid) { } // --------------------------------------------------------------- Find the col - function findcol(jid) { var j; for (j=0;j<=maxcol;j++) { if (col[j]==jid) { return j; } } @@ -280,7 +304,6 @@ function findcol(jid) { // // returns middle (col number of middle of obj1) // sets colmap (map of cols with object numbers) - function maprow (jid,obj1,ign) { var j; var k; var left; var right; var middle; middle=-1; @@ -326,7 +349,6 @@ function maprow (jid,obj1,ign) { // kid: colID, find point close to this // dkid: destination colID // returns colID - function comingthru (jid,kid,dkid) { var k; maprow(jid,-1,1); @@ -372,10 +394,7 @@ function comingthru (jid,kid,dkid) { // linkobj: object that the link goes to/comes from // sets inrow or outrow // return column - - function insertport (obj1,d,inout,linkobj) { - var k; var port; var revport; stored=0; data1=obj[obj1].split('&'); @@ -404,7 +423,6 @@ function insertport (obj1,d,inout,linkob if ((data3[k]==0) && (colmap[k]==obj1) && (port==-1)) { port=k; } } } - if (port==-1) { if (colmap[k]==0) { revport=findcol(k); @@ -451,7 +469,6 @@ function insertport (obj1,d,inout,linkob // ---------------------------- Make a new object and add it to the row content // returns object number of generated object - function addobj(kjid,objs) { stored=0; expense++; @@ -465,7 +482,6 @@ function addobj(kjid,objs) { // ---------------------------------------- Make horizontal connection for hrid // hoffs=-1: this line goes on top of hrid - function horizontal(hrid,hoffs,hfcol,htcol,hdest,hends) { hcrid=-1; if (hoffs==-1) { @@ -492,7 +508,6 @@ function horizontal(hrid,hoffs,hfcol,htc } } } - if (hcrid==-1) { insertrow(row[hrid]+hoffs,hfcol,htcol); addobj(maxrow,'h&'+maxrow+'&'+hfcol+':'+htcol+'&'+hdest+'&'+hends); @@ -502,7 +517,6 @@ function horizontal(hrid,hoffs,hfcol,htc } // --------------------------------------- Deletes all references to object obj - function delobj(obj1) { var k; stored=0; @@ -522,7 +536,6 @@ function delobj(obj1) { } // --------------------------------------------------------- Garbage collection - function cleanup () { message("Garbage Collection"); var j,kj,i; @@ -576,11 +589,9 @@ function cleanup () { rowtype[maxrow]=2; coltype[maxcol]=2; } - } // -------------------------------------------- Delete a condition from a block - function delcond(obj1,colid) { var k; stored=0; @@ -600,7 +611,6 @@ function delcond(obj1,colid) { } // ----------------------------------------- Creates a new condition in a block - function crecond(obj1,colid,condtext,condtype) { var k; data3=obj[obj1].split('&'); @@ -622,7 +632,6 @@ function crecond(obj1,colid,condtext,con // deletes the link linknr // h&rowID&incolID:outcolID&inObj:outObj&inupdown:outupdown // v&colID&inObj:outObj&updown - function dellink (linknr) { var k; var obj1; var obj2; stored=0; @@ -663,7 +672,6 @@ function dellink (linknr) { // ----------------------------------------------------------- Join two objects // Links obj1 with obj2, creates new objlink, marks all elements with number - function joinres (obj1,obj2,cond) { stored=0; var minexpense; @@ -698,7 +706,6 @@ function joinres (obj1,obj2,cond) { minexpense=expense; } - if (best==0) { finishload(); tryjoin(obj1,obj2,cond,1,1); @@ -711,10 +718,8 @@ function joinres (obj1,obj2,cond) { finishload(); tryjoin(obj1,obj2,cond,-1,1); } - } - function tryjoin(obj1,obj2,cond,d1,d2) { var k; var kr; var outcol; var incol; var d; var dest; @@ -813,7 +818,6 @@ function tryjoin(obj1,obj2,cond,d1,d2) { // ---------------------------------------------------------- Delete a resource // Deletes resource obj1 // Reconnects resources going thru this one if recon=1 - function delres (obj1,recon) { var infromobj=new Array(); var inwithcon=new Array(); @@ -937,7 +941,6 @@ function delres (obj1,recon) { } // -------------------------------------------------------------- Draw an entry - function drawcell (rtype,ctype,what,cm,obj1,ej,ek,ne) { var bgcolor; var url=''; @@ -967,28 +970,35 @@ function drawcell (rtype,ctype,what,cm,o urlparts=url.split('.'); mime=urlparts[urlparts.length-1]; if (typeof(mime)=="undefined") { mime=''; } + mime=mime.toLowerCase(); } parent.mapout.document.write (''); + +' src="'+raticons+'resource.gif">'); + 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=''; @@ -1000,23 +1010,30 @@ function drawcell (rtype,ctype,what,cm,o urlparts=url.split('.'); mime=urlparts[urlparts.length-1]; if (typeof(mime)=="undefined") { mime=''; } + mime=mime.toLowerCase(); } parent.mapout.document.write (''); + +' src="'+raticons+'start.gif">'); + 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:') { @@ -1029,27 +1046,35 @@ function drawcell (rtype,ctype,what,cm,o urlparts=url.split('.'); mime=urlparts[urlparts.length-1]; if (typeof(mime)=="undefined") { mime=''; } + mime=mime.toLowerCase(); } parent.mapout.document.write (''); + +' src="'+raticons+'finish.gif">'); + 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">'); } } } @@ -1070,14 +1095,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'; } @@ -1088,7 +1112,6 @@ function rescolor (ext,typ) { } // -------------------------------------------------------- Color of conditions - function condcolor(typ) { if (typ=='stop') { return '#EEAAAA'; } if (typ=='force') { return '#AAAAEE'; } @@ -1096,7 +1119,6 @@ function condcolor(typ) { } // ----------------------------------------------------------------- Draw a row - function drawrow (jid) { var j; var jk; var k; var ck; var rtype; var objd1=new Array(); @@ -1300,13 +1322,11 @@ if (rowtype[jid]!=0) { } // -------------------------------------------------------------- Print message - function message(txt) { parent.window.status=txt; } // ------------------------------------------------------------- Draw the table - function draw () { var k; var kr; @@ -1355,7 +1375,6 @@ function draw () { } // --------------------------------------------------------- Clears info window - function infoclear() { if (notclear!=1) { infcheck(); @@ -1403,14 +1422,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(); @@ -1418,7 +1435,6 @@ function infcheck() { } // --------------------------------------------------- Prints out resource info - function info(infostr) { var mime=''; var ext; @@ -1430,7 +1446,7 @@ function info(infostr) { inf.document.clear(); inf.document.writeln( ''+ - '
'); + '
'); data1=infostr.split('&'); if (data1[0]=='c') { inf.document.write('Condition ('); @@ -1511,7 +1527,6 @@ function info(infostr) { } // ------------------------------------------------ "Escapes" out special chars - function escape(instring) { var outstring=''; var thischar; @@ -1519,7 +1534,7 @@ function escape(instring) { for (k=0;k

Copy from Map

'+ + '
'+ + '
'); -// --------------------------------------------------------- Open search window + copydx.document.writeln(''); + copydx.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=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(mode) { if (!srch || srch.closed || srchmode!=mode) { - srchopen(); + srchopen(mode); } srch.focus(); } // -------------------------------------------------------- Do idx status check - function idxcheck(mode) { if (!idx || idx.closed || idxmode!=mode) { idxopen(mode); @@ -1674,8 +1727,15 @@ function idxcheck(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; @@ -1684,7 +1744,7 @@ function handler(infostr) { inf.document.clear(); inf.document.writeln( ''+ - '
'); + '
'); data1=infostr.split('&'); if (data1[0]=='c') { inf.document.writeln('Condition
'); @@ -1738,8 +1798,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) { @@ -1763,7 +1821,7 @@ function handler(infostr) { inf.document.write( '
'); ++escape(data2[0])+'">'); inf.document.write('' +'
Title:' +'
URL:' +'
External:'+ - '
'+ + '
'+ 'Empty Field
'); inf.document.writeln('
'+ '