--- rat/client/Attic/code.html 2000/02/22 21:14:59 1.1 +++ rat/client/Attic/code.html 2000/05/04 21:05:28 1.2 @@ -6,10 +6,9 @@ Resource Assembly Tool 7/23,7/24,7/26, 8/11,8/14,8/18,8/19,8/20,8/21,8/22,8/25,8/26,8/28,8/30,8/31, 9/1,9/2,9/4,9/5,9/6, -1/7,1/8,1/10,1/14,1/15,1/16,1/21,1/22, -1/29,1/30,1/31, -2/2,2/3,2/10,2/12,2/13,2/14,2/15,2/17,2/18, -2/19,2/20,2/21,2/22 Gerd Kortemeyer with Scott Harrison +1/7,1/8,1/10,1/14,1/15,1/16,1/21,1/22,1/29,1/30,1/31, +2/2,2/3,2/10,2/12,2/13,2/14,2/15,2/17,2/18,2/19,2/20,2/21,2/22, +5/2,5/3,5/4 Gerd Kortemeyer with Scott Harrison --> @@ -37,12 +36,16 @@ var rrow=new Array(); var cw=new Array(); var rh=new Array(); +var undostack=new Array(); +var undopointer=0; +var stored=0; var editmode=0; var notclear=0; var linkmode=0; var lastinfo=''; var graphdef='no'; var mainrun=0; +var tablemode=0; var data1=new Array(1024); var data2=new Array(1024); @@ -55,6 +58,7 @@ var data5=new Array(1024); function insertrow(j,ex1,ex2) { var kj; + stored=0; objects1=''; objects2=''; for (kj=0;kj<=maxrow;kj++) { @@ -158,6 +162,7 @@ function insertrow(j,ex1,ex2) { function newcondition(content,type) { var ko; + stored=0; ko=obj.length; obj[ko]='c'; objcont[ko]=content+':'+type+':cond'; @@ -167,6 +172,7 @@ function newcondition(content,type) { // ---------------------------------------------- Creates a new resource object function newresource(rid,cid,text,url) { + stored=0; objcont[addobj(rid,'b&'+rid+'&'+cid+':0:0:0')]=text+':'+url+':res'; } @@ -175,6 +181,7 @@ function newresource(rid,cid,text,url) { function insertcond(obj1,portnr,cond) { var k; + stored=0; data1=obj[obj1].split('&'); for (k=2;kj ) { col[kj]++; } } @@ -320,6 +328,7 @@ function insertport (obj1,d,inout,linkob var k; var port; var revport; + stored=0; data1=obj[obj1].split('&'); middle=maprow(data1[1],obj1,0); if (inout==1) { @@ -395,6 +404,7 @@ function insertport (obj1,d,inout,linkob // returns object number of generated object function addobj(kjid,objs) { + stored=0; if (rowcont[kjid]!='') { rowcont[kjid]+=':'; } rowcont[kjid]+=obj.length; obj[obj.length]=objs; @@ -443,6 +453,7 @@ function horizontal(hrid,hoffs,hfcol,htc function delobj(obj1) { var k; + stored=0; for (k=0;k'); @@ -833,7 +849,7 @@ function drawcell (rtype,ctype,what,cm,o // ----------------------------------------------------------------- Draw a row -function drawrow (jid,mode2) { +function drawrow (jid) { var j; var jk; var k; var rc; var gc; var bc; var ck; var objd1=new Array(); var objd2=new Array(); @@ -1004,19 +1020,17 @@ if (rowtype[jid]!=0) { } rtype=rowtype[jid]; for (k=0;k<=maxcol;k++) { - drawcell(rtype,coltype[rcol[k]],colmap[k],colmap5[k],objd1[k],mode2,jid,k, + drawcell(rtype,coltype[rcol[k]],colmap[k],colmap5[k],objd1[k],jid,k, notempty[k]); } if (rowtype[jid]==2) { parent.mapout.document.writeln(''); for (k=0;k<=maxcol;k++) { - drawcell(1,coltype[rcol[k]],colmap2[k],colmap5[k],objd2[k],mode2,jid,k, - 1); + drawcell(1,coltype[rcol[k]],colmap2[k],colmap5[k],objd2[k],jid,k,1); } parent.mapout.document.writeln(''); for (k=0;k<=maxcol;k++) { - drawcell(1,coltype[rcol[k]],colmap3[k],colmap6[k],objd2[k],mode2,jid,k, - 1); + drawcell(1,coltype[rcol[k]],colmap3[k],colmap6[k],objd2[k],jid,k,1); } } } @@ -1026,32 +1040,12 @@ if (rowtype[jid]!=0) { // ------------------------------------------------------------- Draw the table -function draw (mode,mode2) { +function draw () { var k; var kr; - cleanup(); + save(); - - if (mode=='debug') { - var options="scrollbars=1,resizable=1,menubar=0,width=500,height=300"; - deb=open("","debout",options); - deb.document.clear(); - deb.document.writeln(''); - -for (k=0;k'); } - deb.document.writeln('
Cols: '+col+'
Rows: '+row+'
'); - deb.document.writeln(objcont+'
'+objlinks+'
'); - for (kr=0;kr<=maxrow;kr++) { - kid=findrow(kr); - maprow(kid,-1,0); - deb.document.writeln(kid+' : '+colmap+' '+rowcont[kid]+"
"); - } - deb.document.writeln('
Rowtype: '+rowtype+'
Coltype: '+coltype); - deb.document.writeln('
maxcol: '+maxcol+'
maxrow: '+maxrow); - deb.document.writeln(''); - deb.document.close(); - } for (k=0;k<=maxrow;k++) { rrow[row[k]]=k; } for (k=0;k<=maxcol;k++) { rcol[col[k]]=k; } rh[0]=0; @@ -1065,7 +1059,11 @@ for (k=0;k'); - for (kr=0;kr<=maxrow;kr++) { drawrow(rrow[kr],mode2); } + if (tablemode==0) { + for (kr=0;kr<=maxrow;kr++) { drawrow(rrow[kr]); } + } else { + tabledraw(); + } parent.mapout.document.writeln(''); parent.mapout.document.writeln(''); @@ -1179,6 +1177,12 @@ function escape(instring) { return outstring; } +// -------------------------------------------------- Insert resource into link + +function insertreslink(infostr) { + alert(infostr); +} + // ---------------------------------------------------- Handles "click to edit" function handler(infostr) { @@ -1227,7 +1231,7 @@ function handler(infostr) { } inf.document.writeln( 'opener.infoclear();opener.editmode=0;opener.draw(' - +"'debug','edit'"+');">Change to above values  ' + +');">Change to above values  ' +' Reset' +''); @@ -1235,7 +1239,7 @@ function handler(infostr) { inf.document.writeln( 'Delete Condition'); + +');">Delete Condition'); } else { if (data1[0]=='r') { if (linkmode!=0) { @@ -1244,7 +1248,7 @@ function handler(infostr) { notclear=0; linkmode=0; inf.document.writeln('Linked Resources'); - draw('debug','edit'); + draw(); } else { inf.document.writeln('Resource'); data2=objcont[data1[1]].split(':'); @@ -1268,11 +1272,11 @@ function handler(infostr) { inf.document.writeln( 'Delete Resource (cutting links)'); + +');">Delete Resource (cutting links)'); inf.document.writeln( '
Delete Resource (preserving links)'); + +');">Delete Resource (preserving links)'); inf.document.writeln( '
Delete Link'); + +');">Delete Link'); + inf.document.writeln('
Insert Resource Into Link'); } } inf.document.writeln( @@ -1320,25 +1328,25 @@ function empty(rid,k) { inf.document.writeln('
Insert Resource'); + +');">Insert Resource'); inf.document.writeln('
Insert column:'); inf.document.writeln('left'); + +');">left'); inf.document.writeln('right '); + +');">right '); inf.document.writeln('
Insert row:'); inf.document.writeln('below'); + +');">below'); inf.document.writeln('above '); + +');">above '); inf.document.writeln( @@ -1353,42 +1361,45 @@ function empty(rid,k) { function save() { var k; - self.document.forms.storage.output.value='graphdef<:>yes'; + parent.server.document.forms.storage.output.value='graphdef<:>yes'; for (k=0;k'+obj[k]; } for (k=0;k'+row[k]; } for (k=0;k'+col[k]; } for (k=0;k'+rowcont[k]; } } - self.document.forms.storage.output.value+= + parent.server.document.forms.storage.output.value+= '<&>maxcol<:>'+maxcol; - self.document.forms.storage.output.value+= + parent.server.document.forms.storage.output.value+= '<&>maxrow<:>'+maxrow; for (k=0;k'+objcont[k]; } } for (k=0;k'+objlinks[k]; } } + undopointer++; + undostack[undopointer]= + parent.server.document.forms.storage.output.value; } // ----------------------------------------------- Reset all layout information @@ -1435,6 +1446,39 @@ function rescompare(a,b) { return rvalue; } +// -------------------------------------------- Draw the table instead of graph + +function tabledraw() { + var k; + var ij; + var kj; + var objsort=new Array(); + var objsorted=new Array(); + for (k=1;k'); var k; for (k=0;k1) { + undopointer--; + parent.server.document.forms.storage.output.value + =undostack[undopointer]; + load(); + undopointer--; + draw(); + stored=0; + } else { + alert("Cannot undo: reached beginning of edit session"); + } +} + +// -------------------------------------------------------------- Redo function + +function redo() { + if (undopointer - -Condense -Straighten -
- -
+ +Toggle Display Mode +Condense +Straighten +Revert +Undo +Redo +Store - \ No newline at end of file + + + + + +