--- rat/client/Attic/code.html 2000/05/25 12:14:01 1.3 +++ rat/client/Attic/code.html 2000/06/08 16:19:50 1.4 @@ -8,7 +8,8 @@ Resource Assembly Tool 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, -5/2,5/3,5/4,5/5,5/6,5/8,5/9,5/13,5/18,5/20,5/22,5/24 +5/2,5/3,5/4,5/5,5/6,5/8,5/9,5/13,5/18,5/20,5/22,5/24,5/25, +6/7,6/8 Gerd Kortemeyer with Scott Harrison --> @@ -49,6 +50,7 @@ var graphdef='no'; var mainrun=0; var tablemode=0; var mostrecent=0; +var zscale=3; var disrows=0; var discols=0; @@ -535,7 +537,11 @@ function delcond(obj1,colid) { obj[obj1]=data3[0]+'&'+data3[1]; for (k=2;k'); if (what!='') { @@ -838,14 +845,17 @@ function drawcell (rtype,ctype,what,cm,o } if (what=='r:') { parent.mapout.document.write - (''); + (''); } else { if (what=='c:') { parent.mapout.document.write - (''); + (''); } else { parent.mapout.document.write - (''); + (''); } } if (obj1!='') { @@ -862,16 +872,37 @@ function drawcell (rtype,ctype,what,cm,o parent.mapout.document.write ('onMouseOver="parent.code.infoclear();">'); parent.mapout.document.write - (''); + ( + ''); } 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'; } + if (typ=='mandatory') { rc='FF'; } else { rc='BB'; } + if (typ=='optional') { gc='BB'; } else { gc='FF'; } + if ((typ=='start') || (typ=='end')) { rc='AA'; gc='AA'; bc='FF'; } + return '#'+rc+gc+bc; +} + +// -------------------------------------------------------- Color of conditions + +function condcolor(typ) { + if (typ=='stop') { return '#EEAAAA'; } + if (typ=='force') { return '#AAAAEE'; } + return '#EEEEAA'; +} + // ----------------------------------------------------------------- Draw a row function drawrow (jid) { -var j; var jk; var k; var rc; var gc; var bc; var ck; +var j; var jk; var k; var ck; var objd1=new Array(); var objd2=new Array(); var notempty=new Array(); @@ -890,10 +921,7 @@ if (rowtype[jid]!=0) { data3=obj[data2[jk]].split('&'); if (data3[0]=='b') { data1=objcont[data2[jk]].split(':'); - if (data1[2]=='true') { bc='55'; } else { bc='11'; } - if (data1[3]=='mandatory') { rc='BB'; } else { rc='55'; } - if (data1[3]=='optional') { gc='66'; } else { gc='AA'; } - ck='#'+rc+gc+bc; + ck=rescolor(data1[2],data1[3]); left=maxcol; leftin=maxcol; leftout=maxcol; @@ -917,9 +945,7 @@ if (rowtype[jid]!=0) { if (data1[3]!=0) { colmap3[thiscol]='c:'; condtype=(objcont[data1[3]].split(':'))[1]; - colmap6[thiscol]='#FFFFAA'; - if (condtype=='stop') { colmap6[thiscol]='#FFAAAA'; } - if (condtype=='force') { colmap6[thiscol]='#AAAAFF'; } + colmap6[thiscol]=condcolor(condtype); objd2[thiscol]='c&' +data1[0]+'&'+data2[jk]+'&'+data1[2]+'&'+data1[3]; } else { @@ -1011,7 +1037,10 @@ if (rowtype[jid]!=0) { } else { colmap[left]='rd'; colmap2[left]='utd'; colmap3[left]='utd'; } + notempty[left]=1; + notempty[right]=1; for (k=left+1;k'); @@ -1093,17 +1122,24 @@ function draw () { if (graphdef=='no') { graphopt(); cleanup(); } for (k=0;k<=maxrow;k++) { rrow[row[k]]=k; } for (k=0;k<=maxcol;k++) { rcol[col[k]]=k; } - parent.mapout.document.writeln( + parent.mapout.document.writeln( ''); - for (kr=0;kr<=maxrow;kr++) { - message("Generating Output Row "+kr); - drawrow(rrow[kr]); - } + for (kr=0;kr<=maxrow;kr++) { + message("Generating Output Row "+kr); + drawrow(rrow[kr]); + } } else { message("Generating Table Output"); + for (k=0;k<=maxrow;k++) { rrow[row[k]]=k; } + for (k=0;k<=maxcol;k++) { rcol[col[k]]=k; } + parent.mapout.document.writeln( '
'); - tabledraw(); + if (tablemode==1) { + tabledraw(); + } else { + simpletabledraw(); + } } parent.mapout.document.writeln('
'); @@ -1124,14 +1160,25 @@ function infoclear() { (''); if (linkmode!=0) { + if (tablemode==0) { inf.document.writeln( ''); + } else { + inf.document.writeln( +''); + } } else { + if (tablemode==0) { inf.document.writeln( -'' + '' ); + } } inf.document.writeln('
'+ 'Link Mode
Click on a resource to link it with
'+ (objcont[linkmode].split(':'))[0]+ '
click anywhere else to cancel.
Link Mode
Click on a resource number to link it with
'+ + (objcont[linkmode].split(':'))[0]+'
'+ +'' + +'Cancel
Click to Edit
Click to insert resources, columns and rows
Click to Edit
Click in a light gray area
' + +'to insert resources, columns and rows
'); inf.document.close(); @@ -1498,7 +1545,9 @@ function save() { '<&>maxcol<:>'+maxcol; parent.server.document.forms.storage.output.value+= '<&>maxrow<:>'+maxrow; - } else { + parent.server.document.forms.storage.output.value+= + '<&>zscale<:>'+zscale; +} else { parent.server.document.forms.storage.output.value='graphdef<:>no'; } parent.server.document.forms.storage.output.value+= @@ -1525,23 +1574,29 @@ function save() { function graphreset() { + var k; + + for (k=0;k'+k+''+k+'
'); data2=obj[i].split('&'); parent.mapout.document.write(''); parent.mapout.document.write( - ''); parent.mapout.document.write( - '' +''); + '
Title:
URL:
External:' +'Change to above values  ' +' Reset
'); + +'.reset()">Reset'); + + parent.mapout.document.writeln('
' ++'' ++'Delete Resource (cutting links)
' ++'' ++'Delete Resource (preserving links)
' + +''+ + 'Link resource
'); for (j=2;j1) { if (data3[1]==nr) { - parent.mapout.document.writeln(''); } } } for (j=2;j1) { if ((data3[1]!=nr) && (data3[1]!=0)) { + cck='#AAAAAA'; + if (data3[2]!=0) { + cck=condcolor((objcont[data3[2]].split(':'))[1]); + condid=data3[2]; + } else { + condid='-'; + } parent.mapout.document.writeln( - ''); } } } parent.mapout.document.writeln( - '
Next
'+data3); + cck='#AAAAAA'; + if (data3[2]!=0) { + cck=condcolor((objcont[data3[2]].split(':'))[1]); + condid=data3[2]; + } else { + condid='-'; + } + parent.mapout.document.writeln( + '
Next
'); + parent.mapout.document.writeln( + 'Edit'); parent.mapout.document.writeln('
To: '+robjs[data3[1]]+'
'); + '
To: '+robjs[data3[1]]+'
'); + parent.mapout.document.writeln( + 'Edit'); parent.mapout.document.writeln('
'); + insrestab(rrow[data2[1]],i,nr); + } } } +// ----------------------------------------------------- Insert Resource Output + +function insrestab(irow,be,af) { + parent.mapout.document.writeln(''+ + '
' + +'Insert resource'); + if (be!=-1) { + parent.mapout.document.writeln( + '' + +'Insert resource linked to from above
'); + } + if ((be!=-1) && (af!=-1)) { + parent.mapout.document.writeln( + '' + +'Insert resource linked to from above and linking to below
'); + } + if (af!=-1) { + parent.mapout.document.writeln( + '' + +'Insert resource linking to below
'); + } + parent.mapout.document.writeln('
'); +} +// ---------------------------------------- Draw simple table instead of graph + +function simpletabledraw() { + var objsorted=new Array(); + var robjs=new Array(); + var iobjs=new Array(); + var k; + var i; + var j; + var nr; + var ck; + var cck; + var condid; + var sortstr=sortobjs(); + if (sortstr!='') { + objsorted=sortstr.split('&'); + for (k=0;k'+k+''); + data2=obj[i].split('&'); + parent.mapout.document.write(''); + parent.mapout.document.write( + ''); + parent.mapout.document.write( + '' + +'
Title:'+data1[0]+'
URL:'+data1[1]+'
'); + for (j=2;j1) { + if (data3[1]==nr) { + cck='#AAAAAA'; + if (data3[2]!=0) { + cck=condcolor((objcont[data3[2]].split(':'))[1]); + condid=data3[2]; + } else { + condid='-'; + } + parent.mapout.document.writeln( + ''); + } + } + } + for (j=2;j1) { + if ((data3[1]!=nr) && (data3[1]!=0)) { + cck='#AAAAAA'; + if (data3[2]!=0) { + cck=condcolor((objcont[data3[2]].split(':'))[1]); + condid=data3[2]; + } else { + condid='-'; + } + parent.mapout.document.writeln( + ''); + } + } + } + parent.mapout.document.writeln('
Next
'); + parent.mapout.document.writeln('
To: '+robjs[data3[1]]+'
'); + parent.mapout.document.writeln('
'); + } + } else { + parent.mapout.document.writeln('No Resources'); + } +} + // ---------------------------------- Sort objects to straighten graph or table function sortobjs() { @@ -1805,7 +2027,11 @@ function condense() { // ---------------------------------------------------- Load from hidden fields function load() { + message("Loading"); + var k; + for (k=0;k Toggle Display Mode +Zoom Out +Zoom In Condense Straighten Revert