--- rat/client/Attic/code.html 2001/10/16 17:00:09 1.46 +++ rat/client/Attic/code.html 2002/03/06 20:30:07 1.50 @@ -3,6 +3,31 @@ @@ -104,7 +130,6 @@ function testfunction() { } // ------------------------------------------------ Insert a row into the table - function insertrow(j,ex1,ex2) { var kj; stored=0; @@ -209,7 +234,6 @@ function insertrow(j,ex1,ex2) { } // --------------------------------------------- Creates a new condition object - function newcondition(content,type) { var ko; stored=0; @@ -220,7 +244,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')]= @@ -229,7 +252,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; @@ -246,7 +268,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; @@ -259,7 +280,6 @@ function insertcol(j) { } // --------------------------------------------------------------- Find the row - function findrow(jid) { var j; for (j=0;j<=maxrow;j++) { if (row[j]==jid) { return j; } } @@ -267,7 +287,6 @@ function findrow(jid) { } // --------------------------------------------------------------- Find the col - function findcol(jid) { var j; for (j=0;j<=maxcol;j++) { if (col[j]==jid) { return j; } } @@ -282,7 +301,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; @@ -328,7 +346,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); @@ -374,10 +391,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('&'); @@ -406,7 +420,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); @@ -453,7 +466,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++; @@ -467,7 +479,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) { @@ -494,7 +505,6 @@ function horizontal(hrid,hoffs,hfcol,htc } } } - if (hcrid==-1) { insertrow(row[hrid]+hoffs,hfcol,htcol); addobj(maxrow,'h&'+maxrow+'&'+hfcol+':'+htcol+'&'+hdest+'&'+hends); @@ -504,7 +514,6 @@ function horizontal(hrid,hoffs,hfcol,htc } // --------------------------------------- Deletes all references to object obj - function delobj(obj1) { var k; stored=0; @@ -524,7 +533,6 @@ function delobj(obj1) { } // --------------------------------------------------------- Garbage collection - function cleanup () { message("Garbage Collection"); var j,kj,i; @@ -578,11 +586,9 @@ function cleanup () { rowtype[maxrow]=2; coltype[maxcol]=2; } - } // -------------------------------------------- Delete a condition from a block - function delcond(obj1,colid) { var k; stored=0; @@ -602,7 +608,6 @@ function delcond(obj1,colid) { } // ----------------------------------------- Creates a new condition in a block - function crecond(obj1,colid,condtext,condtype) { var k; data3=obj[obj1].split('&'); @@ -624,7 +629,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; @@ -665,7 +669,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; @@ -700,7 +703,6 @@ function joinres (obj1,obj2,cond) { minexpense=expense; } - if (best==0) { finishload(); tryjoin(obj1,obj2,cond,1,1); @@ -713,10 +715,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; @@ -815,7 +815,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(); @@ -939,7 +938,6 @@ function delres (obj1,recon) { } // -------------------------------------------------------------- Draw an entry - function drawcell (rtype,ctype,what,cm,obj1,ej,ek,ne) { var bgcolor; var url=''; @@ -1079,7 +1077,6 @@ function drawcell (rtype,ctype,what,cm,o } // --------------------------------------------------------- Color of resources - function rescolor (ext,typ) { var rc; var gc; var bc; if (ext=='true') { bc='55'; } else { bc='99'; } @@ -1090,7 +1087,6 @@ function rescolor (ext,typ) { } // -------------------------------------------------------- Color of conditions - function condcolor(typ) { if (typ=='stop') { return '#EEAAAA'; } if (typ=='force') { return '#AAAAEE'; } @@ -1098,7 +1094,6 @@ function condcolor(typ) { } // ----------------------------------------------------------------- Draw a row - function drawrow (jid) { var j; var jk; var k; var ck; var rtype; var objd1=new Array(); @@ -1302,13 +1297,11 @@ if (rowtype[jid]!=0) { } // -------------------------------------------------------------- Print message - function message(txt) { parent.window.status=txt; } // ------------------------------------------------------------- Draw the table - function draw () { var k; var kr; @@ -1357,7 +1350,6 @@ function draw () { } // --------------------------------------------------------- Clears info window - function infoclear() { if (notclear!=1) { infcheck(); @@ -1405,14 +1397,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(); @@ -1420,7 +1410,6 @@ function infcheck() { } // --------------------------------------------------- Prints out resource info - function info(infostr) { var mime=''; var ext; @@ -1513,7 +1502,6 @@ function info(infostr) { } // ------------------------------------------------ "Escapes" out special chars - function escape(instring) { var outstring=''; var thischar; @@ -1528,9 +1516,9 @@ function escape(instring) { } return outstring; } +// There must be a way to get rid of the odd number of "s // -------------------------------------------------- Insert resource into link - function insertreslink(infostr) { var lnr; var fobj; @@ -1563,7 +1551,6 @@ function insertreslink(infostr) { } // -------------------------------------------- Insert resource after condition - function insertcondlink(cid,lnr) { var fobj; var tobj; @@ -1584,29 +1571,22 @@ function insertcondlink(cid,lnr) { 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; @@ -1615,7 +1595,6 @@ function idxclose() { } // ------------------------------------------------------- Closes search window - function srchclose() { if (srch && !srch.closed) { srchflag=0; @@ -1624,7 +1603,6 @@ function srchclose() { } // ------------------------------------------------------- Closes search window - function parmclose() { if (parm && !parm.closed) { parmflag=0; @@ -1633,33 +1611,29 @@ function parmclose() { } // -------------------------------------------------------- Open indexer window - function idxopen(mode) { var options="scrollbars=1,resizable=1,menubar=0"; idxmode=mode; idxflag=1; - idx=open("/res/?launch=1&catalogmode="+mode,"idxout",options); + idx=open("/res/?launch=1&mode=rat&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?launch=1&catalogmode="+mode,"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(mode); @@ -1668,7 +1642,6 @@ function srchcheck(mode) { } // -------------------------------------------------------- Do idx status check - function idxcheck(mode) { if (!idx || idx.closed || idxmode!=mode) { idxopen(mode); @@ -1677,7 +1650,6 @@ function idxcheck(mode) { } // ---------------------------------------------------- Handles "click to edit" - function handler(infostr) { var k; editmode=1; @@ -1740,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) { @@ -1848,7 +1818,6 @@ function handler(infostr) { } // ----------------------------------------------------- Clicks on empty fields - function empty(rid,k) { var cid=findcol(k); var lcol=k-1; @@ -1918,7 +1887,6 @@ function empty(rid,k) { } // ---------------------------------------------------- Save into hidden fields - function save() { var k; if (graphdef=='yes') { @@ -1977,7 +1945,6 @@ function save() { } // ----------------------------------------------- Reset all layout information - function graphreset() { var k; @@ -2010,7 +1977,6 @@ function graphreset() { } // --------------------- Compare two resources with each other for "straighten" - function rescompare(a,b) { data1=a.split(':'); data2=b.split(':'); @@ -2027,7 +1993,6 @@ function rescompare(a,b) { } // -------------------------------------------- Draw the table instead of graph - function tabledraw() { var objsorted=new Array(); var robjs=new Array(); @@ -2204,7 +2169,6 @@ function tabledraw() { } // ----------------------------------------------------- Insert Resource Output - function insrestab(irow,be,af,typ) { parent.mapout.document.writeln('
1) {
undopointer--;
@@ -2591,7 +2548,6 @@ function undo() {
}
// -------------------------------------------------------------- Redo function
-
function redo() {
if (undopointer |