version 1.2, 2000/05/04 21:05:28
|
version 1.10, 2000/08/02 15:27:10
|
Line 8 Resource Assembly Tool
|
Line 8 Resource Assembly Tool
|
9/1,9/2,9/4,9/5,9/6, |
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, |
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, |
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 |
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,6/9,6/10,6/12,6/15,7/4,7/26,7/28,7/31 |
|
Gerd Kortemeyer with Scott Harrison |
--> |
--> |
|
|
|
|
Line 19 var row=new Array();
|
Line 21 var row=new Array();
|
var maxrow=-1; |
var maxrow=-1; |
var col=new Array(); |
var col=new Array(); |
var maxcol=-1; |
var maxcol=-1; |
|
|
var colmap=new Array(); |
var colmap=new Array(); |
var colmap2=new Array(); |
var colmap2=new Array(); |
var colmap3=new Array(); |
var colmap3=new Array(); |
Line 44 var notclear=0;
|
Line 47 var notclear=0;
|
var linkmode=0; |
var linkmode=0; |
var lastinfo=''; |
var lastinfo=''; |
var graphdef='no'; |
var graphdef='no'; |
|
var mode=''; |
var mainrun=0; |
var mainrun=0; |
var tablemode=0; |
var tablemode=0; |
|
var mostrecent=0; |
|
var zscale=3; |
|
|
|
var disrows=0; |
|
var discols=0; |
|
|
|
var finishdone=0; |
|
var tim=0; |
|
var funny='|'; |
|
var reqaction=''; |
|
var canceltim; |
|
|
|
var expense=0; |
|
|
var data1=new Array(1024); |
var data1=new Array(1024); |
var data2=new Array(1024); |
var data2=new Array(1024); |
Line 53 var data3=new Array(1024);
|
Line 70 var data3=new Array(1024);
|
var data4=new Array(1024); |
var data4=new Array(1024); |
var data5=new Array(1024); |
var data5=new Array(1024); |
|
|
|
var inf; |
|
|
// ------------------------------------------------ Insert a row into the table |
// ------------------------------------------------ Insert a row into the table |
|
|
function insertrow(j,ex1,ex2) { |
function insertrow(j,ex1,ex2) { |
var kj; |
var kj; |
stored=0; |
stored=0; |
|
expense++; expense++; |
objects1=''; |
objects1=''; |
objects2=''; |
objects2=''; |
for (kj=0;kj<=maxrow;kj++) { |
for (kj=0;kj<=maxrow;kj++) { |
Line 171 function newcondition(content,type) {
|
Line 190 function newcondition(content,type) {
|
|
|
// ---------------------------------------------- Creates a new resource object |
// ---------------------------------------------- Creates a new resource object |
|
|
function newresource(rid,cid,text,url) { |
function newresource(rid,cid,text,url,ext,type) { |
stored=0; |
stored=0; |
objcont[addobj(rid,'b&'+rid+'&'+cid+':0:0:0')]=text+':'+url+':res'; |
objcont[addobj(rid,'b&'+rid+'&'+cid+':0:0:0')]= |
|
text+':'+url+':'+ext+':'+type+':res'; |
} |
} |
|
|
|
|
Line 203 function insertcol(j) {
|
Line 223 function insertcol(j) {
|
if ( col[kj]>j ) { col[kj]++; } |
if ( col[kj]>j ) { col[kj]++; } |
} |
} |
maxcol++; |
maxcol++; |
|
expense++; expense++; |
col[maxcol]=j+1; |
col[maxcol]=j+1; |
} |
} |
|
|
Line 405 function insertport (obj1,d,inout,linkob
|
Line 426 function insertport (obj1,d,inout,linkob
|
|
|
function addobj(kjid,objs) { |
function addobj(kjid,objs) { |
stored=0; |
stored=0; |
|
expense++; |
if (rowcont[kjid]!='') { rowcont[kjid]+=':'; } |
if (rowcont[kjid]!='') { rowcont[kjid]+=':'; } |
rowcont[kjid]+=obj.length; |
rowcont[kjid]+=obj.length; |
obj[obj.length]=objs; |
obj[obj.length]=objs; |
Line 469 function delobj(obj1) {
|
Line 491 function delobj(obj1) {
|
// --------------------------------------------------------- Garbage collection |
// --------------------------------------------------------- Garbage collection |
|
|
function cleanup () { |
function cleanup () { |
|
message("Garbage Collection"); |
var j,kj,i; |
var j,kj,i; |
insertrow(maxrow); |
disrows=0; |
insertcol(maxcol); |
discols=0; |
addobj(maxrow,'e&'+maxcol); |
var emptyspots=0; |
|
|
for (kj=0;kj<=maxcol;kj++) { data1[kj]=0; } |
for (kj=0;kj<=maxcol;kj++) { data1[kj]=0; } |
for (kj=0;kj<=maxrow;kj++) { |
for (kj=0;kj<=maxrow;kj++) { |
rowtype[kj]=0; |
rowtype[kj]=0; |
Line 495 function cleanup () {
|
Line 519 function cleanup () {
|
} |
} |
if (obj[colmap[j]].substring(0,2)=='b&') { |
if (obj[colmap[j]].substring(0,2)=='b&') { |
data1[j]=2; |
data1[j]=2; |
|
if (colmap[maxcol]==0) { emptyspots++; } |
rowtype[kj]=2; |
rowtype[kj]=2; |
} |
} |
} |
} |
Line 502 function cleanup () {
|
Line 527 function cleanup () {
|
} |
} |
} |
} |
for (j=0;j<=maxcol;j++) { |
for (j=0;j<=maxcol;j++) { |
coltype[j]=data1[col[j]]; |
coltype[j]=data1[col[j]]; |
|
if (coltype[j]!=0) { discols+=1; } |
|
} |
|
for (j=0;j<=maxrow;j++) { |
|
if (rowtype[j]==2) { disrows+=3; } |
|
if (rowtype[j]==1) { disrows+=1; } |
|
} |
|
if (emptyspots==0) { |
|
insertrow(maxrow); |
|
insertcol(maxcol); |
|
addobj(maxrow,'e&'+maxcol); |
|
discols++; |
|
disrows++; |
|
rowtype[maxrow]=2; |
|
coltype[maxcol]=2; |
} |
} |
|
|
} |
} |
|
|
// -------------------------------------------- Delete a condition from a block |
// -------------------------------------------- Delete a condition from a block |
Line 515 function delcond(obj1,colid) {
|
Line 555 function delcond(obj1,colid) {
|
obj[obj1]=data3[0]+'&'+data3[1]; |
obj[obj1]=data3[0]+'&'+data3[1]; |
for (k=2;k<data3.length;k++) { |
for (k=2;k<data3.length;k++) { |
data4=data3[k].split(':'); |
data4=data3[k].split(':'); |
if (data4[0]==colid) { data4[3]=0; } |
if (data4[0]==colid) { |
|
data4[3]=0; |
|
objlinks[data4[2]]=(objlinks[data4[2]].split(':'))[0]+':'+ |
|
(objlinks[data4[2]].split(':'))[1]+':0'; |
|
} |
if ((data4[1]!=0) || (data4[2]!=0) || (data3.length==3)) { |
if ((data4[1]!=0) || (data4[2]!=0) || (data3.length==3)) { |
obj[obj1]+='&'+data4[0]+':'+data4[1]+':'+data4[2]+':'+data4[3]; |
obj[obj1]+='&'+data4[0]+':'+data4[1]+':'+data4[2]+':'+data4[3]; |
} |
} |
} |
} |
} |
} |
|
|
// ----------------------------------------- Creates a new condition in a block |
// ----------------------------------------- Creates a new condition in a block |
|
|
function crecond(obj1,colid,condtext,condtype) { |
function crecond(obj1,colid,condtext,condtype) { |
Line 588 function dellink (linknr) {
|
Line 632 function dellink (linknr) {
|
// Links obj1 with obj2, creates new objlink, marks all elements with number |
// Links obj1 with obj2, creates new objlink, marks all elements with number |
|
|
function joinres (obj1,obj2,cond) { |
function joinres (obj1,obj2,cond) { |
var k; var kr; var outcol; var incol; var d; |
|
stored=0; |
stored=0; |
|
var minexpense; |
|
var best; |
|
|
|
expense=0; |
|
tryjoin(obj1,obj2,cond,1,1); |
|
minexpense=expense; |
|
best=0; |
|
finishload(); |
|
|
|
expense=0; |
|
tryjoin(obj1,obj2,cond,1,-1); |
|
if (expense<minexpense) { |
|
best=1; |
|
minexpense=expense; |
|
} |
|
finishload(); |
|
|
|
expense=0; |
|
tryjoin(obj1,obj2,cond,-1,1); |
|
if (expense<minexpense) { |
|
best=2; |
|
minexpense=expense; |
|
} |
|
finishload(); |
|
|
|
expense=0; |
|
tryjoin(obj1,obj2,cond,-1,-1); |
|
if (expense<minexpense) { |
|
best=3; |
|
minexpense=expense; |
|
} |
|
|
|
|
|
if (best==0) { |
|
finishload(); |
|
tryjoin(obj1,obj2,cond,1,1); |
|
} |
|
if (best==1) { |
|
finishload(); |
|
tryjoin(obj1,obj2,cond,1,-1); |
|
} |
|
if (best==2) { |
|
finishload(); |
|
tryjoin(obj1,obj2,cond,-1,1); |
|
} |
|
} |
|
|
|
|
|
function tryjoin(obj1,obj2,cond,d1,d2) { |
|
var k; var kr; var outcol; var incol; var d; |
|
|
dest=objlinks.length; |
dest=objlinks.length; |
objlinks[dest]=obj1+':'+obj2+':'+cond; |
objlinks[dest]=obj1+':'+obj2+':'+cond; |
data3=obj[obj1].split('&'); |
|
sum=0; |
outcol=insertport(obj1,d1,2,dest); |
for (k=2;k<data3.length;k++) { sum+=col[data3[k].split(':')[0]]; } |
|
outmiddle=sum/(data3.length-2); |
|
data3=obj[obj2].split('&'); |
|
sum=0; |
|
for (k=2;k<data3.length;k++) { sum+=col[data3[k].split(':')[0]]; } |
|
inmiddle=sum/(data3.length-2); |
|
d=inmiddle-outmiddle; |
|
outcol=insertport(obj1,d,2,dest); |
|
insertcond(obj1,outcol,cond); |
insertcond(obj1,outcol,cond); |
incol=insertport(obj2,-d,1,dest); |
incol=insertport(obj2,d2,1,dest); |
if (row[inrow]==(row[outrow]+1)) { |
if (row[inrow]==(row[outrow]+1)) { |
insertrow(row[outrow],-1,-1); |
insertrow(row[outrow],-1,-1); |
} |
} |
Line 731 function delres (obj1,recon) {
|
Line 817 function delres (obj1,recon) {
|
for (k=0;k<inwithlink.length;k++) { dellink(inwithlink[k]); } |
for (k=0;k<inwithlink.length;k++) { dellink(inwithlink[k]); } |
for (k=0;k<outwithlink.length;k++) { dellink(outwithlink[k]); } |
for (k=0;k<outwithlink.length;k++) { dellink(outwithlink[k]); } |
delobj(obj1); |
delobj(obj1); |
|
objcont[obj1]=''; |
if (recon==1) { |
if (recon==1) { |
|
message("Reconnecting"); |
for (k=0;k<inwithlink.length;k++) { |
for (k=0;k<inwithlink.length;k++) { |
if (infromobj[k]!=obj1) { |
if (infromobj[k]!=obj1) { |
found=0; |
found=0; |
Line 806 function delres (obj1,recon) {
|
Line 893 function delres (obj1,recon) {
|
|
|
function drawcell (rtype,ctype,what,cm,obj1,ej,ek,ne) { |
function drawcell (rtype,ctype,what,cm,obj1,ej,ek,ne) { |
var bgcolor; |
var bgcolor; |
|
if ((what=='') && (ne==0)) { cm="#DDDDDD"; } |
if (ctype!=0) { |
if (ctype!=0) { |
parent.mapout.document.write('<td bgcolor='+cm+' width='+cw[ctype]+'>'); |
parent.mapout.document.write('<td bgcolor='+cm+' width='+cw[ctype]+'>'); |
if (what!='') { |
if (what!='') { |
Line 817 function drawcell (rtype,ctype,what,cm,o
|
Line 905 function drawcell (rtype,ctype,what,cm,o
|
} |
} |
if (what=='r:') { |
if (what=='r:') { |
parent.mapout.document.write |
parent.mapout.document.write |
('<img border=0 src="resource.gif">'); |
('<img border=0 width='+cw[ctype]+' height='+rh[rtype] |
|
+' src="resource.gif">'); |
} else { |
} else { |
if (what=='c:') { |
if (what=='c:') { |
parent.mapout.document.write |
parent.mapout.document.write |
('<img border=0 src="condition.gif">'); |
('<img border=0 width='+cw[ctype]+' height='+rh[rtype] |
|
+' src="condition.gif">'); |
} else { |
} else { |
parent.mapout.document.write |
if (what=='rs:') { |
('<img border=0 src="'+rtype+'.'+ctype+'.'+what+'.gif">'); |
parent.mapout.document.write |
|
('<img border=0 width='+cw[ctype]+' height='+rh[rtype] |
|
+' src="start.gif">'); |
|
} else { |
|
if (what=='rf:') { |
|
parent.mapout.document.write |
|
('<img border=0 width='+cw[ctype]+' height='+rh[rtype] |
|
+' src="finish.gif">'); |
|
} else { |
|
parent.mapout.document.write |
|
('<img border=0 width='+cw[ctype]+' height='+rh[rtype] |
|
+' src="'+rtype+'.'+ctype+'.'+what+'.gif">'); |
|
} |
|
} |
} |
} |
} |
} |
if (obj1!='') { |
if (obj1!='') { |
Line 841 function drawcell (rtype,ctype,what,cm,o
|
Line 944 function drawcell (rtype,ctype,what,cm,o
|
parent.mapout.document.write |
parent.mapout.document.write |
('onMouseOver="parent.code.infoclear();">'); |
('onMouseOver="parent.code.infoclear();">'); |
parent.mapout.document.write |
parent.mapout.document.write |
('<img border=0 src="'+rtype+'.'+ctype+'.empty.gif"></a>'); |
( |
|
'<img border=0 width='+cw[ctype]+' height='+rh[rtype] |
|
+' src="'+rtype+'.'+ctype+'.empty.gif"></a>'); |
} |
} |
parent.mapout.document.write('</td>'); |
parent.mapout.document.write('</td>'); |
} |
} |
} |
} |
|
|
|
// --------------------------------------------------------- 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=='finish')) { 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 |
// ----------------------------------------------------------------- Draw a row |
|
|
function drawrow (jid) { |
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 rtype; |
var objd1=new Array(); |
var objd1=new Array(); |
var objd2=new Array(); |
var objd2=new Array(); |
var notempty=new Array(); |
var notempty=new Array(); |
Line 858 var condtype;
|
Line 982 var condtype;
|
if (rowtype[jid]!=0) { |
if (rowtype[jid]!=0) { |
for (j=0;j<=maxcol;j++) { |
for (j=0;j<=maxcol;j++) { |
colmap[j]=''; colmap2[j]=''; colmap3[j]=''; colmap4[j]=''; |
colmap[j]=''; colmap2[j]=''; colmap3[j]=''; colmap4[j]=''; |
colmap5[j]='#FFFFFF'; colmap6[j]='#FFFFFF'; |
colmap5[j]='#CCCCCC'; colmap6[j]='#CCCCCC'; |
objd1[j]=''; objd2[j]=''; notempty[j]=0; |
objd1[j]=''; objd2[j]=''; notempty[j]=0; |
} |
} |
|
|
parent.mapout.document.writeln('<tr height='+rh[rowtype[jid]]+'>'); |
parent.mapout.document.writeln('<tr height='+rh[rowtype[jid]]+'>'); |
if (rowcont[jid]!='') { |
if (rowcont[jid]!='') { |
data2=rowcont[jid].split(':'); |
data2=rowcont[jid].split(':'); |
for (jk=0;jk<data2.length;jk++) { |
for (jk=0;jk<data2.length;jk++) { |
data3=obj[data2[jk]].split('&'); |
data3=obj[data2[jk]].split('&'); |
if (data3[0]=='b') { |
if (data3[0]=='b') { |
rc=(data2[jk]+'F').substr(0,2); |
data1=objcont[data2[jk]].split(':'); |
gc=('9'+data2[jk]).substr(0,2); |
rtype=data1[3]; |
bc=(data2[jk]+data2[jk]).substr(0,2); |
ck=rescolor(data1[2],data1[3]); |
ck='#'+rc+gc+bc; |
|
left=maxcol; |
left=maxcol; |
leftin=maxcol; |
leftin=maxcol; |
leftout=maxcol; |
leftout=maxcol; |
Line 894 if (rowtype[jid]!=0) {
|
Line 1018 if (rowtype[jid]!=0) {
|
if (data1[3]!=0) { |
if (data1[3]!=0) { |
colmap3[thiscol]='c:'; |
colmap3[thiscol]='c:'; |
condtype=(objcont[data1[3]].split(':'))[1]; |
condtype=(objcont[data1[3]].split(':'))[1]; |
colmap6[thiscol]='#FFFFAA'; |
colmap6[thiscol]=condcolor(condtype); |
if (condtype=='stop') { colmap6[thiscol]='#FFAAAA'; } |
|
if (condtype=='force') { colmap6[thiscol]='#AAAAFF'; } |
|
objd2[thiscol]='c&' |
objd2[thiscol]='c&' |
+data1[0]+'&'+data2[jk]+'&'+data1[2]+'&'+data1[3]; |
+data1[0]+'&'+data2[jk]+'&'+data1[2]+'&'+data1[3]; |
} else { |
} else { |
Line 909 if (rowtype[jid]!=0) {
|
Line 1031 if (rowtype[jid]!=0) {
|
} |
} |
for (k=left;k<=right;k++) { notempty[k]=1; colmap5[k]=ck; } |
for (k=left;k<=right;k++) { notempty[k]=1; colmap5[k]=ck; } |
middle=Math.round((left+right)/2); |
middle=Math.round((left+right)/2); |
colmap[middle]='r:'; |
if (rtype=='start') { |
|
colmap[middle]='rs:'; |
|
} else { |
|
if (rtype=='finish') { |
|
colmap[middle]='rf:'; |
|
} else { |
|
colmap[middle]='r:'; |
|
} |
|
} |
objd1[middle]+='r&'+data2[jk]; |
objd1[middle]+='r&'+data2[jk]; |
|
|
if (rightin>middle) { |
if (rightin>middle) { |
Line 988 if (rowtype[jid]!=0) {
|
Line 1118 if (rowtype[jid]!=0) {
|
} else { |
} else { |
colmap[left]='rd'; colmap2[left]='utd'; colmap3[left]='utd'; |
colmap[left]='rd'; colmap2[left]='utd'; colmap3[left]='utd'; |
} |
} |
|
notempty[left]=1; |
|
notempty[right]=1; |
for (k=left+1;k<right;k++) { |
for (k=left+1;k<right;k++) { |
|
notempty[k]=1; |
if (colmap[k]=='') { |
if (colmap[k]=='') { |
colmap[k]=thisarrow; |
colmap[k]=thisarrow; |
objd1[k]=data2[jk]; |
objd1[k]=data2[jk]; |
Line 1009 if (rowtype[jid]!=0) {
|
Line 1142 if (rowtype[jid]!=0) {
|
left=col[data3[1]]; |
left=col[data3[1]]; |
if (colmap[left]=='') { |
if (colmap[left]=='') { |
if (data3[3]==1) { colmap[left]='dt'; } else { colmap[left]='td'; } |
if (data3[3]==1) { colmap[left]='dt'; } else { colmap[left]='td'; } |
objd1[left]=data2[jk]; |
objd1[left]=data2[jk]+'&'+jid; |
objd2[left]=objd1[left]; |
objd2[left]=objd1[left]; |
} else { |
} else { |
colmap[left]='tdrl'; |
colmap[left]='tdrl'; |
Line 1024 if (rowtype[jid]!=0) {
|
Line 1157 if (rowtype[jid]!=0) {
|
notempty[k]); |
notempty[k]); |
} |
} |
if (rowtype[jid]==2) { |
if (rowtype[jid]==2) { |
parent.mapout.document.writeln('</tr><tr>'); |
parent.mapout.document.writeln('</tr>'); |
|
parent.mapout.document.writeln('<tr height='+rh[1]+'>'); |
for (k=0;k<=maxcol;k++) { |
for (k=0;k<=maxcol;k++) { |
drawcell(1,coltype[rcol[k]],colmap2[k],colmap5[k],objd2[k],jid,k,1); |
drawcell(1,coltype[rcol[k]],colmap2[k],colmap5[k],objd2[k],jid,k, |
|
notempty[k]); |
} |
} |
parent.mapout.document.writeln('</tr><tr>'); |
parent.mapout.document.writeln('</tr>'); |
|
parent.mapout.document.writeln('<tr height='+rh[1]+'>'); |
for (k=0;k<=maxcol;k++) { |
for (k=0;k<=maxcol;k++) { |
drawcell(1,coltype[rcol[k]],colmap3[k],colmap6[k],objd2[k],jid,k,1); |
drawcell(1,coltype[rcol[k]],colmap3[k],colmap6[k],objd2[k],jid,k, |
|
notempty[k]); |
} |
} |
} |
} |
} |
} |
Line 1038 if (rowtype[jid]!=0) {
|
Line 1175 if (rowtype[jid]!=0) {
|
} |
} |
} |
} |
|
|
|
// -------------------------------------------------------------- Print message |
|
|
|
function message(txt) { |
|
parent.window.status=txt; |
|
} |
|
|
// ------------------------------------------------------------- Draw the table |
// ------------------------------------------------------------- Draw the table |
|
|
function draw () { |
function draw () { |
Line 1046 function draw () {
|
Line 1189 function draw () {
|
cleanup(); |
cleanup(); |
save(); |
save(); |
|
|
for (k=0;k<=maxrow;k++) { rrow[row[k]]=k; } |
|
for (k=0;k<=maxcol;k++) { rcol[col[k]]=k; } |
|
rh[0]=0; |
rh[0]=0; |
rh[1]=30; |
rh[1]=zscale*10; |
rh[2]=60; |
rh[2]=zscale*20; |
cw[0]=0; |
cw[0]=0; |
cw[1]=30; |
cw[1]=zscale*10; |
cw[2]=60; |
cw[2]=zscale*20; |
|
|
parent.mapout.document.open('text/html','replace'); |
parent.mapout.document.open('text/html','replace'); |
parent.mapout.document.writeln('<html><body bgcolor="#FFFFFF">'); |
parent.mapout.document.writeln('<html><body bgcolor="#FFFFFF">'); |
parent.mapout.document.writeln( |
|
'<table cellpadding=0 cellspacing=0 border=0>'); |
|
|
|
if (tablemode==0) { |
if (tablemode==0) { |
for (kr=0;kr<=maxrow;kr++) { drawrow(rrow[kr]); } |
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( |
|
'<table cellpadding=0 cellspacing=0 border=0 rows=' |
|
+disrows+' cols='+discols+'>'); |
|
for (kr=0;kr<=maxrow;kr++) { |
|
message("Generating Output Row "+kr); |
|
drawrow(rrow[kr]); |
|
} |
} else { |
} else { |
tabledraw(); |
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( '<table>'); |
|
if (tablemode==1) { |
|
tabledraw(); |
|
} else { |
|
simpletabledraw(); |
|
} |
} |
} |
|
|
parent.mapout.document.writeln('</table>'); |
parent.mapout.document.writeln('</table>'); |
Line 1076 function draw () {
|
Line 1234 function draw () {
|
|
|
function infoclear() { |
function infoclear() { |
if (notclear!=1) { |
if (notclear!=1) { |
var options="scrollbars=1,resizable=1,menubar=0,width=400,height=300"; |
infcheck(); |
var inf=open("","infout",options); |
|
inf.document.clear(); |
inf.document.clear(); |
inf.document.writeln |
inf.document.writeln |
('<html><body bgcolor="#FFFFFF"><table><tr><td>'+ |
('<html><body bgcolor="#FFFFFF"><table><tr><td>'+ |
'<img src="/adm/lonIcons/lonlogos.gif"></td>'); |
'<img src="/adm/lonIcons/lonlogos.gif"></td>'); |
if (linkmode!=0) { |
if (linkmode!=0) { |
|
if (tablemode==0) { |
inf.document.writeln( |
inf.document.writeln( |
'<td><b>Link Mode</b><hr>Click on a resource to link it with<br><b>'+ |
'<td><b>Link Mode</b><hr>Click on a resource to link it with<br><b>'+ |
(objcont[linkmode].split(':'))[0]+ |
(objcont[linkmode].split(':'))[0]+ |
'</b><br>click anywhere else to cancel.</td>'); |
'</b><br>click anywhere else to cancel.</td>'); |
|
} else { |
|
inf.document.writeln( |
|
'<td><b>Link Mode</b><hr>Click on a resource number to link it with<br><b>'+ |
|
(objcont[linkmode].split(':'))[0]+'</b><br>'+ |
|
'<a href="javascript:opener.linkmode=0;opener.notclear=0;opener.infoclear();">' |
|
+'Cancel</a></td>'); |
|
} |
|
} else { |
|
if (tablemode==0) { |
|
inf.document.writeln( |
|
'<td><b>Click to Edit</b><hr>Click in a light gray area<br>' |
|
+'to insert resources, columns and rows</td>' |
|
); |
|
} |
} |
} |
inf.document.writeln('</tr></table></body></html>'); |
inf.document.writeln('</tr></table></body></html>'); |
inf.document.close(); |
inf.document.close(); |
Line 1097 function infoclear() {
|
Line 1269 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(); |
|
} |
|
} |
|
|
// --------------------------------------------------- Prints out resource info |
// --------------------------------------------------- Prints out resource info |
|
|
function info(infostr) { |
function info(infostr) { |
if ((editmode!=1) && (infostr!=lastinfo)) { |
if ((editmode!=1) && (infostr!=lastinfo)) { |
notclear=1; |
notclear=1; |
var options="scrollbars=1,resizable=1,menubar=0,width=400,height=300"; |
infcheck(); |
var inf=open("","infout",options); |
|
inf.document.clear(); |
inf.document.clear(); |
inf.document.writeln( |
inf.document.writeln( |
'<html><body bgcolor="#FFFFFF">'+ |
'<html><body bgcolor="#FFFFFF">'+ |
Line 1130 function info(infostr) {
|
Line 1316 function info(infostr) {
|
'</b><br>to <b>'+objcont[data3[1]].split(':')[0]+'</b>'); |
'</b><br>to <b>'+objcont[data3[1]].split(':')[0]+'</b>'); |
} else { |
} else { |
if (data1[0]=='r') { |
if (data1[0]=='r') { |
inf.document.writeln('<b>Resource</b><hr>'); |
|
data2=objcont[data1[1]].split(':'); |
data2=objcont[data1[1]].split(':'); |
inf.document.writeln('<b>'+data2[0]+'</b><br>'); |
inf.document.write('<b>'); |
|
if (data2[2]=='true') { inf.document.write('External '); } |
|
if (data2[3]=='start') { |
|
inf.document.writeln('<b>Start</b>'); |
|
} else { |
|
if (data2[3]=='finish') { |
|
inf.document.writeln('<b>Finish</b>'); |
|
} else { |
|
inf.document.writeln('<b>Resource</b>'); |
|
} |
|
} |
|
if (data2[3]=='mandatory') { |
|
inf.document.write(' (Mandatory)'); |
|
} |
|
if (data2[3]=='optional') { |
|
inf.document.write(' (Optional)'); |
|
} |
|
inf.document.writeln('</b><hr><b>'+data2[0]+'</b><br>'); |
inf.document.writeln((data2[1].split('/')).join(' / ')); |
inf.document.writeln((data2[1].split('/')).join(' / ')); |
} else { |
} else { |
inf.document.writeln('<b>Link</b><hr>'); |
inf.document.writeln('<b>Link</b><hr>'); |
Line 1180 function escape(instring) {
|
Line 1382 function escape(instring) {
|
// -------------------------------------------------- Insert resource into link |
// -------------------------------------------------- Insert resource into link |
|
|
function insertreslink(infostr) { |
function insertreslink(infostr) { |
alert(infostr); |
var lnr; |
|
var fobj; |
|
var tobj; |
|
var nobj; |
|
var cobj; |
|
var cid; |
|
var rid; |
|
data1=infostr.split('&'); |
|
data2=obj[data1[0]].split('&'); |
|
lnr=data2[data2.length-2]; |
|
data3=objlinks[lnr].split(':'); |
|
fobj=data3[0]; |
|
tobj=data3[1]; |
|
cobj=data3[2]; |
|
if (data2[0]=='v') { |
|
rid=data1[1]; |
|
cid=data2[1]; |
|
} else { |
|
rid=data2[1]; |
|
cid=(data2[2].split(':'))[0]; |
|
} |
|
dellink(lnr); |
|
newresource(rid,cid,'','','false','normal'); |
|
nobj=obj.length-1; |
|
joinres(fobj,nobj,cobj); |
|
joinres(nobj,tobj,0); |
|
} |
|
|
|
// -------------------------------------------- Insert resource after condition |
|
|
|
function insertcondlink(cid,lnr) { |
|
var fobj; |
|
var tobj; |
|
var nobj; |
|
var cobj; |
|
data3=objlinks[lnr].split(':'); |
|
fobj=data3[0]; |
|
tobj=data3[1]; |
|
cobj=data3[2]; |
|
rid=(obj[fobj].split('&'))[1]; |
|
insertrow(row[rid]); |
|
dellink(lnr); |
|
newresource(maxrow,cid,'','','false','normal'); |
|
nobj=obj.length-1; |
|
joinres(fobj,nobj,cobj); |
|
joinres(nobj,tobj,0); |
} |
} |
|
|
// ---------------------------------------------------- Handles "click to edit" |
// ---------------------------------------------------- Handles "click to edit" |
Line 1189 function handler(infostr) {
|
Line 1436 function handler(infostr) {
|
var k; |
var k; |
editmode=1; |
editmode=1; |
notclear=1; |
notclear=1; |
var options="scrollbars=1,resizable=1,menubar=0,width=400,height=300"; |
infcheck(); |
var inf=open("","infout",options); |
|
inf.document.clear(); |
inf.document.clear(); |
inf.document.writeln( |
inf.document.writeln( |
'<html><body bgcolor="#FFFFFF">'+ |
'<html><body bgcolor="#FFFFFF">'+ |
Line 1205 function handler(infostr) {
|
Line 1451 function handler(infostr) {
|
data2=objcont[data1[4]].split(':'); |
data2=objcont[data1[4]].split(':'); |
} |
} |
inf.document.writeln( |
inf.document.writeln( |
'<form name=condinfo><textarea name=c cols=40 rows=4>' |
'<form name=condinfo><textarea name=c cols=30 rows=3>' |
+data2[0]+'</textarea><br><input type=radio name=s value=normal '+ |
+data2[0]+'</textarea><br><input type=radio name=s value=normal '+ |
'onClick="self.document.forms.condinfo.elements.h.value='+"'normal'"+'"'); |
'onClick="self.document.forms.condinfo.elements.h.value='+"'normal'"+'"'); |
if (data2[1]=='normal') { inf.document.write(' checked'); } |
if (data2[1]=='normal') { inf.document.write(' checked'); } |
Line 1231 function handler(infostr) {
|
Line 1477 function handler(infostr) {
|
} |
} |
inf.document.writeln( |
inf.document.writeln( |
'opener.infoclear();opener.editmode=0;opener.draw(' |
'opener.infoclear();opener.editmode=0;opener.draw(' |
+');">Change to above values</a> ' |
+');"><b>Change to above values</b></a> ' |
+' <a href="javascript:self.document.forms.condinfo.reset()">Reset</a>' |
+' <a href="javascript:self.document.forms.condinfo.reset()">Reset</a><br>' |
+'<input type=hidden name=h value='+data2[1] |
+'<input type=hidden name=h value='+data2[1]+'>'); |
+'></form>'); |
|
|
|
inf.document.writeln( |
inf.document.writeln( |
'<a href="javascript:opener.notclear=0;opener.infoclear();' |
'<a href="javascript:opener.notclear=0;opener.infoclear();' |
+'opener.delcond('+data1[2]+','+data1[1]+');opener.editmode=0;opener.draw(' |
+'opener.delcond('+data1[2]+','+data1[1]+');opener.editmode=0;opener.draw(' |
+');">Delete Condition</a>'); |
+');">Delete Condition</a><br>'); |
} else { |
inf.document.writeln( |
|
'<a href="javascript:opener.notclear=0;opener.infoclear();' |
|
+'opener.dellink('+data1[3]+');opener.editmode=0;opener.draw(' |
|
+');">Delete Link</a>'); |
|
|
|
inf.document.writeln('<br><a href="javascript:'+ |
|
'opener.insertcondlink('+data1[1]+','+data1[3]+');'+ |
|
'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
|
+');">Insert Resource Into Link</a>'); |
|
|
|
|
|
} else { |
if (data1[0]=='r') { |
if (data1[0]=='r') { |
if (linkmode!=0) { |
if (linkmode!=0) { |
joinres(linkmode,data1[1],0); |
joinres(linkmode,data1[1],0); |
Line 1250 function handler(infostr) {
|
Line 1506 function handler(infostr) {
|
inf.document.writeln('<b>Linked Resources</b>'); |
inf.document.writeln('<b>Linked Resources</b>'); |
draw(); |
draw(); |
} else { |
} else { |
inf.document.writeln('<b>Resource</b>'); |
|
data2=objcont[data1[1]].split(':'); |
data2=objcont[data1[1]].split(':'); |
|
if (data2[3]=='start') { |
|
inf.document.writeln('<b>Start</b>'); |
|
} else { |
|
if (data2[3]=='finish') { |
|
inf.document.writeln('<b>Finish</b>'); |
|
} else { |
|
inf.document.writeln('<b>Resource</b>'); |
|
} |
|
} |
inf.document.write( |
inf.document.write( |
'<form name=resinfo><table><tr><td>Title:</td><td>' |
'<form name=resinfo><table><tr><td>Title:</td><td>' |
+'<input type=text name=t size=40 value="' |
+'<input type=text name=t size=30 value="' |
+data2[0]+'"></td></tr><tr><td>URL:</td><td>' |
+data2[0]+'"><input type=hidden name=h value='+data2[3]+'></td></tr>'); |
+'<input type=text name=u size=40 value="'+data2[1]+'"></td></tr>' |
if ((data2[3]!='start') && (data2[3]!='finish')) { |
|
inf.document.write('<tr><td>URL:</td><td>' |
|
+'<input type=text name=u size=30 value="'+data2[1]+'"></td></tr>' |
+'<tr><td>External:</td><td><input type=checkbox name=e'); |
+'<tr><td>External:</td><td><input type=checkbox name=e'); |
if (data2[2]=='true') { inf.document.write(' checked'); } |
if (data2[2]=='true') { inf.document.write(' checked'); } |
inf.document.writeln('></td></tr>' |
inf.document.write('></td></tr>' |
+'<tr><td colspan=2><a href="javascript:opener.editmode=0;' |
+'<tr><td colspan=2>' |
|
+'<input type=radio name=y value=normal '+ |
|
'onClick="self.document.forms.resinfo.elements.h.value='+"'normal'"+'"'); |
|
if (data2[3]=='normal') { inf.document.write(' checked'); } |
|
inf.document.write( |
|
'> Regular <input type=radio name=y value=mandatory '+ |
|
'onClick="self.document.forms.resinfo.elements.h.value='+"'mandatory'"+'"'); |
|
if (data2[3]=='mandatory') { inf.document.write(' checked'); } |
|
inf.document.write( |
|
'> Mandatory <input type=radio name=y value=optional '+ |
|
'onClick="self.document.forms.resinfo.elements.h.value='+"'optional'"+'"'); |
|
if (data2[3]=='optional') { inf.document.write(' checked'); } |
|
inf.document.write('> Optional</td></tr>'); |
|
} else { |
|
inf.document.write( |
|
'<tr><td><input type=hidden name=e value=false>' |
|
+'<input type=hidden name=u value=""></td></tr>'); |
|
} |
|
inf.document.writeln( |
|
'<tr><td colspan=2><a href="javascript:opener.editmode=0;' |
+'opener.notclear=0;opener.objcont['+data1[1] |
+'opener.notclear=0;opener.objcont['+data1[1] |
+']=opener.escape(self.document.forms.resinfo.elements.t.value)+'+"':'" |
+']=opener.escape(self.document.forms.resinfo.elements.t.value)+'+"':'" |
+'+opener.escape(self.document.forms.resinfo.elements.u.value)+'+"':'" |
+'+opener.escape(self.document.forms.resinfo.elements.u.value)+'+"':'" |
+'+self.document.forms.resinfo.elements.e.checked+'+"':res'" |
+'+self.document.forms.resinfo.elements.e.checked+'+"':'" |
+';opener.infoclear();">' |
+'+self.document.forms.resinfo.elements.h.value+'+"':res'" |
+'Change to above values</a> ' |
+';opener.infoclear();opener.editmode=0;opener.draw();">' |
|
+'<b>Change to above values</b></a> ' |
+' <a href="javascript:self.document.forms.resinfo.reset()">Reset</a>' |
+' <a href="javascript:self.document.forms.resinfo.reset()">Reset</a>' |
+'</td></tr></table></form>'); |
+'</td></tr></table>'); |
|
if ((data2[3]!='start') && (data2[3]!='finish')) { |
inf.document.writeln( |
inf.document.writeln( |
'<a href="javascript:opener.notclear=0;opener.infoclear();' |
'<a href="javascript:opener.notclear=0;opener.infoclear();' |
+'opener.delres('+data1[1]+',0);opener.editmode=0;opener.draw(' |
+'opener.delres('+data1[1]+',0);opener.editmode=0;opener.draw(' |
Line 1277 function handler(infostr) {
|
Line 1564 function handler(infostr) {
|
'<br><a href="javascript:opener.notclear=0;opener.infoclear();' |
'<br><a href="javascript:opener.notclear=0;opener.infoclear();' |
+'opener.delres('+data1[1]+',1);opener.editmode=0;opener.draw(' |
+'opener.delres('+data1[1]+',1);opener.editmode=0;opener.draw(' |
+');">Delete Resource (preserving links)</a>'); |
+');">Delete Resource (preserving links)</a>'); |
|
} |
|
if (data2[3]!='finish') { |
inf.document.writeln( |
inf.document.writeln( |
'<br><a href="javascript:opener.editmode=0;opener.notclear=0;' |
'<br><a href="javascript:opener.editmode=0;opener.notclear=0;' |
+'opener.linkmode='+data1[1]+';' |
+'opener.linkmode='+data1[1]+';' |
+'opener.infoclear();">Link Resource</a>'); |
+'opener.infoclear();">Link Resource</a>'); |
|
} |
} |
} |
} else { |
} else { |
linkmode=0; |
linkmode=0; |
inf.document.writeln('<b>Link</b><hr>'); |
inf.document.writeln('<b>Link</b><hr><form>'); |
data2=obj[data1[0]].split('&'); |
data2=obj[data1[0]].split('&'); |
k=data2[data2.length-2]; |
k=data2[data2.length-2]; |
data3=objlinks[k].split(':'); |
data3=objlinks[k].split(':'); |
Line 1294 function handler(infostr) {
|
Line 1584 function handler(infostr) {
|
k+');opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
k+');opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
+');">Delete Link</a>'); |
+');">Delete Link</a>'); |
inf.document.writeln('<br><a href="javascript:'+ |
inf.document.writeln('<br><a href="javascript:'+ |
'opener.insertreslink('+infostr+');'+ |
"opener.insertreslink('"+infostr+"');"+ |
'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
+');">Insert Resource Into Link</a>'); |
+');">Insert Resource Into Link</a>'); |
} |
} |
Line 1302 function handler(infostr) {
|
Line 1592 function handler(infostr) {
|
inf.document.writeln( |
inf.document.writeln( |
'<br><a href="javascript:opener.editmode=0;opener.notclear=0;' |
'<br><a href="javascript:opener.editmode=0;opener.notclear=0;' |
+'opener.infoclear();">Done</a>'); |
+'opener.infoclear();">Done</a>'); |
inf.document.writeln('</td></tr></table></body></html>'); |
inf.document.writeln('</form></td></tr></table></body></html>'); |
inf.document.close(); |
inf.document.close(); |
inf.focus(); |
inf.focus(); |
} |
} |
Line 1317 function empty(rid,k) {
|
Line 1607 function empty(rid,k) {
|
editmode=1; |
editmode=1; |
notclear=1; |
notclear=1; |
linkmode=0; |
linkmode=0; |
var options="scrollbars=1,resizable=1,menubar=0,width=400,height=300"; |
infcheck(); |
var inf=open("","infout",options); |
|
inf.document.clear(); |
inf.document.clear(); |
inf.document.writeln( |
inf.document.writeln( |
'<html><body bgcolor="#FFFFFF">'+ |
'<html><body bgcolor="#FFFFFF">'+ |
Line 1326 function empty(rid,k) {
|
Line 1615 function empty(rid,k) {
|
'<b>Empty Field</b><hr>'); |
'<b>Empty Field</b><hr>'); |
|
|
inf.document.writeln('<br><a href="javascript:opener.newresource('+ |
inf.document.writeln('<br><a href="javascript:opener.newresource('+ |
rid+','+cid+",'','');"+ |
rid+','+cid+",'','','false','normal');"+ |
|
'opener.mostrecent=opener.obj.length-1;'+ |
|
'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
|
+');">Insert resource</a>'); |
|
|
|
if ((mostrecent!=0) && (objcont[mostrecent]!='')) { |
|
|
|
inf.document.writeln('<br><a href="javascript:opener.newresource('+ |
|
rid+','+cid+",'','','false','normal');"+ |
|
'opener.mostrecent=opener.obj.length-1;'+ |
|
'opener.joinres('+mostrecent+',opener.obj.length-1,0);'+ |
'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
+');">Insert Resource</a>'); |
+');">Insert resource linked to from most recent one</a>'); |
|
|
|
inf.document.writeln('<br><a href="javascript:opener.newresource('+ |
|
rid+','+cid+",'','','false','normal');"+ |
|
'opener.mostrecent=opener.obj.length-1;'+ |
|
'opener.joinres(opener.obj.length-1,'+mostrecent+',0);'+ |
|
'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
|
+');">Insert resource linking to most recent one</a>'); |
|
} |
|
|
|
|
inf.document.writeln('<hr>Insert column:'); |
inf.document.writeln('<hr>Insert column:'); |
inf.document.writeln('<a href="javascript:opener.insertcol('+ |
inf.document.writeln('<a href="javascript:opener.insertcol('+ |
lcol+');opener.addobj('+rid+",'e&'+opener.maxcol);" |
lcol+');opener.addobj('+rid+",'e&'+opener.maxcol);" |
Line 1360 function empty(rid,k) {
|
Line 1669 function empty(rid,k) {
|
// ---------------------------------------------------- Save into hidden fields |
// ---------------------------------------------------- Save into hidden fields |
|
|
function save() { |
function save() { |
var k; |
var k; |
|
if (graphdef=='yes') { |
parent.server.document.forms.storage.output.value='graphdef<:>yes'; |
parent.server.document.forms.storage.output.value='graphdef<:>yes'; |
for (k=0;k<obj.length;k++) { |
for (k=1;k<obj.length;k++) { |
parent.server.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
'<&>obj<:>'+k+'<:>'+obj[k]; |
'<&>obj<:>'+k+'<:>'+obj[k]; |
} |
} |
Line 1384 function save() {
|
Line 1694 function save() {
|
'<&>maxcol<:>'+maxcol; |
'<&>maxcol<:>'+maxcol; |
parent.server.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
'<&>maxrow<:>'+maxrow; |
'<&>maxrow<:>'+maxrow; |
|
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+= |
|
'<&>tablemode<:>'+tablemode; |
|
|
for (k=0;k<objcont.length;k++) { |
for (k=0;k<objcont.length;k++) { |
if (objcont[k]) { |
if (objcont[k]) { |
parent.server.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
Line 1406 function save() {
|
Line 1723 function save() {
|
|
|
function graphreset() { |
function graphreset() { |
|
|
|
var k; |
|
|
|
for (k=0;k<obj.length;k++) { obj[k]=''; } |
obj.length=0; |
obj.length=0; |
obj[0]=''; |
obj[0]=''; |
obj[1]='e&1'; |
|
|
|
rowcont.length=0; |
rowcont.length=0; |
rowcont[0]=''; |
rowcont[0]=''; |
rowcont[1]='1'; |
|
row.length=0; |
row.length=0; |
row[0]=0; |
row[0]=0; |
row[1]=1; |
maxrow=0; |
maxrow=1; |
|
|
|
col.length=0; |
col.length=0; |
colmap.length=0; |
colmap.length=0; |
maxcol=-1; |
maxcol=-1; |
insertcol(-1); |
insertcol(-1); |
insertcol(0); |
|
|
objcont[0]=''; |
|
if (((objcont[1]==undefined)&&(objcont[2]==undefined)) || |
|
((objcont[1]=='')&&(objcont[2]==''))) { |
|
objcont[1]='Start::false:start:res' |
|
objcont[2]='Finish::false:finish:res'; |
|
objlinks[0]=''; |
|
objlinks[1]='1:2:0'; |
|
} |
|
|
graphdef='no'; |
graphdef='no'; |
|
|
Line 1442 function rescompare(a,b) {
|
Line 1768 function rescompare(a,b) {
|
if (data2[k]==data1[0]) { rvalue++; } |
if (data2[k]==data1[0]) { rvalue++; } |
} |
} |
if (rvalue==0) { rvalue=data2.length-data1.length; } |
if (rvalue==0) { rvalue=data2.length-data1.length; } |
|
|
return rvalue; |
return rvalue; |
} |
} |
|
|
// -------------------------------------------- Draw the table instead of graph |
// -------------------------------------------- Draw the table instead of graph |
|
|
function tabledraw() { |
function tabledraw() { |
var k; |
var objsorted=new Array(); |
var ij; |
var robjs=new Array(); |
var kj; |
var iobjs=new Array(); |
var objsort=new Array(); |
var k; |
var objsorted=new Array(); |
var i; |
for (k=1;k<objcont.length;k++) { |
var j; |
if (objcont[k]) { |
var nr; |
data1=objcont[k].split(':'); |
var ck; |
if (data1[data1.length-1]=='res') { |
var cck; |
objsort[objsort.length]=''+k; |
var condid; |
} |
var sortstr=sortobjs(); |
} |
insrestab(1,-1,-1,''); |
} |
if (sortstr!='') { |
for (k=1;k<objlinks.length;k++) { |
objsorted=sortstr.split('&'); |
data1=objlinks[k].split(':'); |
for (k=0;k<objsorted.length;k++) { |
kj=-1; |
i=(objsorted[k].split(':'))[0]; |
for (j=0;j<objsort.length;j++) { |
iobjs[k]=i; |
if ((objsort[j].split(':'))[0]==data1[0]) { |
robjs[i]=k; |
kj=j; |
} |
} |
for (k=0;k<iobjs.length;k++) { |
} |
i=iobjs[k]; |
objsort[kj]+=':'+data1[1]; |
if (k<objsorted.length-1) { |
|
nr=iobjs[k+1]; |
|
} else { |
|
nr=-1; |
|
} |
|
data1=objcont[i].split(':'); |
|
ck=rescolor(data1[2],data1[3]); |
|
parent.mapout.document.write('<tr><td bgcolor="'+ck |
|
+'"><b><a href="javascript:if (parent.code.linkmode!=0) { ' |
|
+'parent.code.joinres(parent.code.linkmode,'+i+',0);' |
|
+'parent.code.linkmode=0;parent.code.editmode=0;' |
|
+'parent.code.notclear=0;parent.code.infoclear();' |
|
+'parent.code.draw(); }">'+k+'</a></b></td><td bgcolor="'+ck |
|
+'"><form name=r'+i+' method=post>'); |
|
data2=obj[i].split('&'); |
|
parent.mapout.document.write('<table bgcolor="#CCCCCC">'); |
|
if (data1[3]=='start') { |
|
parent.mapout.document.writeln('<tr><td><b>Start</b></td></tr>'); |
|
} |
|
if (data1[3]=='finish') { |
|
parent.mapout.document.writeln('<tr><td><b>Finish</b></td></tr>'); |
|
} |
|
parent.mapout.document.write( |
|
'<tr><td>Title:</td><td><input type=text name=t size=50 value="' |
|
+data1[0]+'"><input type=hidden name=h value='+data1[3] |
|
+'></td></tr>'); |
|
if ((data1[3]!='start') && (data1[3]!='finish')) { |
|
parent.mapout.document.write( |
|
'<tr><td>URL:</td><td><input type=text name=u size=50 value="' |
|
+data1[1]+'"></td></tr>' |
|
+'<tr><td>External:</td><td><input type=checkbox name=e'); |
|
if (data1[2]=='true') { parent.mapout.document.write(' checked'); } |
|
parent.mapout.document.write('></td></tr>' |
|
+'<tr><td colspan=2><input type=radio name=y value=normal '+ |
|
'onClick="parent.mapout.document.forms.r'+i+'.elements.h.value='+ |
|
"'normal'"+'"'); |
|
if (data1[3]=='normal') { parent.mapout.document.write(' checked'); } |
|
parent.mapout.document.write( |
|
'> Regular <input type=radio name=y value=mandatory '+ |
|
'onClick="parent.mapout.document.forms.r'+i+'.elements.h.value='+ |
|
"'mandatory'"+'"'); |
|
if (data1[3]=='mandatory') { parent.mapout.document.write(' checked'); } |
|
parent.mapout.document.write( |
|
'> Mandatory <input type=radio name=y value=optional '+ |
|
'onClick="parent.mapout.document.forms.r'+i+'.elements.h.value='+ |
|
"'optional'"+'"'); |
|
if (data1[3]=='optional') { parent.mapout.document.write(' checked'); } |
|
parent.mapout.document.write('> Optional</td></tr>'); |
|
} else { |
|
parent.mapout.document.write( |
|
'<tr><td><input type=hidden name=u value="">' |
|
+'<input type=hidden name=e value=false></td></tr>'); |
|
} |
|
parent.mapout.document.write( |
|
'<tr><td colspan=2><a href="javascript:parent.code.objcont['+i |
|
+']=parent.code.escape(parent.mapout.document.forms.r'+i |
|
+'.elements.t.value)+'+"':'" |
|
+'+parent.code.escape(parent.mapout.document.forms.r'+i |
|
+'.elements.u.value)+'+"':'" |
|
+'+parent.mapout.document.forms.r'+i+'.elements.e.checked+'+"':'" |
|
+'+parent.mapout.document.forms.r'+i+'.elements.h.value+'+"':res'" |
|
+';parent.code.draw();">' |
|
+'<b>Change to above values</b></a> ' |
|
+' <a href="javascript:parent.mapout.document.forms.r'+i |
|
+'.reset()">Reset</a></td></tr><tr><td colspan=2>'); |
|
if ((data1[3]!='start') && (data1[3]!='finish')) { |
|
parent.mapout.document.writeln( |
|
'<A href="javascript:parent.code.notclear=0;parent.code.infoclear();' |
|
+'parent.code.delres('+i+',0);parent.code.editmode=0;parent.code.draw();">' |
|
+'Delete Resource (cutting links)</A><br>' |
|
+'<A href="javascript:parent.code.notclear=0;parent.code.infoclear();' |
|
+'parent.code.delres('+i+',1);parent.code.editmode=0;parent.code.draw();">' |
|
+'Delete Resource (preserving links)</A><br>'); |
|
} |
|
if (data1[3]!='finish') { |
|
parent.mapout.document.writeln( |
|
'<a href="javascript:parent.code.linkmode='+i+ |
|
';parent.code.notclear=0;parent.code.infoclear();">'+ |
|
'Link resource</a></td></tr>'); |
|
} |
|
parent.mapout.document.writeln('<tr><td colspan=2><table><tr>'); |
|
for (j=2;j<data2.length;j++) { |
|
data4=data2[j].split(':'); |
|
data3=objlinks[data4[2]].split(':'); |
|
if (data3.length>1) { |
|
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( |
|
'<td bgcolor='+cck+'>Next<br>'); |
|
parent.mapout.document.writeln( |
|
'<a href="javascript:parent.code.handler('+ |
|
"'c&"+data4[0]+'&'+i+'&'+data4[2]+'&'+condid+"');" |
|
+'">Edit</a>'); |
|
parent.mapout.document.writeln('</td>'); |
|
} |
|
} |
|
} |
|
for (j=2;j<data2.length;j++) { |
|
data4=data2[j].split(':'); |
|
data3=objlinks[data4[2]].split(':'); |
|
if (data3.length>1) { |
|
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( |
|
'<td bgcolor='+cck+'>To: '+robjs[data3[1]]+'<br>'); |
|
parent.mapout.document.writeln( |
|
'<a href="javascript:parent.code.handler('+ |
|
"'c&"+data4[0]+'&'+i+'&'+data4[2]+'&'+condid+"');" |
|
+'">Edit</a>'); |
|
parent.mapout.document.writeln('</td>'); |
|
} |
|
} |
|
} |
|
parent.mapout.document.writeln( |
|
'</tr></table></td></tr></table></form>'); |
|
insrestab(rrow[data2[1]],i,nr,data1[3]); |
|
|
} |
} |
objsorted=objsort.sort(rescompare); |
} |
for (ij=0;ij<objsorted.length;ij++) { |
} |
|
|
|
// ----------------------------------------------------- Insert Resource Output |
|
|
|
function insrestab(irow,be,af,typ) { |
|
parent.mapout.document.writeln('<tr><td colspan=2>'+ |
|
'<table><tr><td><a href="javascript:parent.code.insertrow(' |
|
+irow+');parent.code.newresource(parent.code.maxrow,'+rcol[1] |
|
+",'','','false','normal');parent.code.mostrecent=parent.code.obj.length-1;" |
|
+'parent.code.draw();">' |
|
+'Insert resource</a></td><td>'); |
|
if ((be!=-1) && (typ!='finish')) { |
|
parent.mapout.document.writeln( |
|
'<a href="javascript:parent.code.insertrow(' |
|
+irow+');parent.code.newresource(parent.code.maxrow,'+rcol[0] |
|
+",'','','false','normal');parent.code.mostrecent=parent.code.obj.length-1;" |
|
+'parent.code.joinres('+be+',parent.code.mostrecent,0);' |
|
+'parent.code.draw();">' |
|
+'Insert resource linked to from above</a><br>'); |
|
} |
|
if ((be!=-1) && (af!=-1) && (typ!='finish')) { |
|
parent.mapout.document.writeln( |
|
'<a href="javascript:parent.code.insertrow(' |
|
+irow+');parent.code.newresource(parent.code.maxrow,'+rcol[0] |
|
+",'','','false','normal');parent.code.mostrecent=parent.code.obj.length-1;" |
|
+'parent.code.joinres('+be+',parent.code.mostrecent,0);' |
|
+'parent.code.joinres(parent.code.mostrecent,'+af+',0);' |
|
+'parent.code.draw();">' |
|
+'Insert resource linked to from above and linking to below</a><br>'); |
|
} |
|
if (af!=-1) { |
|
parent.mapout.document.writeln( |
|
'<a href="javascript:parent.code.insertrow(' |
|
+irow+');parent.code.newresource(parent.code.maxrow,'+rcol[0] |
|
+",'','','false','normal');parent.code.mostrecent=parent.code.obj.length-1;" |
|
+'parent.code.joinres(parent.code.mostrecent,'+af+',0);' |
|
+'parent.code.draw();">' |
|
+'Insert resource linking to below</a><br>'); |
|
} |
|
parent.mapout.document.writeln('</td></tr></table></tr>'); |
|
} |
|
// ---------------------------------------- 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<objsorted.length;k++) { |
|
i=(objsorted[k].split(':'))[0]; |
|
iobjs[k]=i; |
|
robjs[i]=k; |
|
} |
|
for (k=0;k<iobjs.length;k++) { |
|
i=iobjs[k]; |
|
if (k<objsorted.length-1) { |
|
nr=iobjs[k+1]; |
|
} else { |
|
nr=-1; |
|
} |
|
data1=objcont[i].split(':'); |
|
ck=rescolor(data1[2],data1[3]); |
|
parent.mapout.document.write('<tr><td bgcolor="'+ck |
|
+'"><b>'+k+'</b></td><td bgcolor="'+ck |
|
+'">'); |
|
data2=obj[i].split('&'); |
|
parent.mapout.document.write('<table>'); |
|
if (data1[3]=='start') { |
|
parent.mapout.document.writeln('<tr><td><b>Start</b></td></tr>'); |
|
} |
|
if (data1[3]=='finish') { |
|
parent.mapout.document.writeln('<tr><td><b>Finish</b></td></tr>'); |
|
} |
|
parent.mapout.document.write( |
|
'<tr><td>Title:</td><td>'+data1[0]+'</td></tr>'); |
|
parent.mapout.document.write( |
|
'<tr><td>URL:</td><td>'+data1[1]+'</td></tr>' |
|
+'<tr><td colspan=2><table><tr>'); |
|
for (j=2;j<data2.length;j++) { |
|
data4=data2[j].split(':'); |
|
data3=objlinks[data4[2]].split(':'); |
|
if (data3.length>1) { |
|
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( |
|
'<td bgcolor='+cck+'>Next<br>'); |
|
parent.mapout.document.writeln('</td>'); |
|
} |
|
} |
|
} |
|
for (j=2;j<data2.length;j++) { |
|
data4=data2[j].split(':'); |
|
data3=objlinks[data4[2]].split(':'); |
|
if (data3.length>1) { |
|
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( |
|
'<td bgcolor='+cck+'>To: '+robjs[data3[1]]+'<br>'); |
|
parent.mapout.document.writeln('</td>'); |
|
} |
|
} |
|
} |
|
parent.mapout.document.writeln('</tr></table></td></tr></table></tr>'); |
} |
} |
alert("Table mode not yet implemented"); |
} else { |
|
parent.mapout.document.writeln('<tr><td>No Resources</td></tr>'); |
|
} |
} |
} |
|
|
// ------------------------------------------- Sort objects to straighten graph |
// ---------------------------------- Sort objects to straighten graph or table |
|
|
function graphopt() { |
function sortobjs() { |
|
message("Sorting Resources: "+funny); |
var k; |
var k; |
var ij; |
var ij; |
|
var dol; |
|
var dtl; |
var kj; |
var kj; |
|
var sortthis=0; |
var objsort=new Array(); |
var objsort=new Array(); |
var objsorted=new Array(); |
|
condense(); |
|
graphreset(); |
|
for (k=1;k<objcont.length;k++) { |
for (k=1;k<objcont.length;k++) { |
if (objcont[k]) { |
if (objcont[k]) { |
data1=objcont[k].split(':'); |
data1=objcont[k].split(':'); |
Line 1497 function graphopt() {
|
Line 2075 function graphopt() {
|
} |
} |
} |
} |
} |
} |
|
if (objsort.length==0) { return ''; } |
for (k=1;k<objlinks.length;k++) { |
for (k=1;k<objlinks.length;k++) { |
|
wheelswitch(); |
|
message("Sorting Resources: "+funny); |
|
if (objlinks[k]!='') { |
|
sortthis=1; |
data1=objlinks[k].split(':'); |
data1=objlinks[k].split(':'); |
kj=-1; |
kj=-1; |
for (j=0;j<objsort.length;j++) { |
for (j=0;j<objsort.length;j++) { |
Line 1505 function graphopt() {
|
Line 2088 function graphopt() {
|
kj=j; |
kj=j; |
} |
} |
} |
} |
objsort[kj]+=':'+data1[1]; |
if (kj!=-1) { objsort[kj]+=':'+data1[1]; } |
|
} |
} |
} |
objsorted=objsort.sort(rescompare); |
if (sortthis!=0) { |
|
for (k=0;k<objsort.length;k++) { |
|
wheelswitch(); |
|
message("Sorting Resources: "+funny); |
|
for (j=0;j<objsort.length;j++) { |
|
if (k!=j) { |
|
data1=objsort[k].split(':'); |
|
data2=objsort[j].split(':'); |
|
dol=data1.length; |
|
dtl=data2.length; |
|
if (dol+dtl<200) { |
|
for (kj=1;kj<dol;kj++) { |
|
if (data1[kj]==data2[0]) { |
|
for (ij=1;ij<dtl;ij++) { |
|
data1[data1.length]=data2[ij]; |
|
} |
|
} |
|
} |
|
for (kj=1;kj<dtl;kj++) { |
|
if (data2[kj]==data1[0]) { |
|
for (ij=1;ij<dol;ij++) { |
|
data2[data2.length]=data1[ij]; |
|
} |
|
} |
|
} |
|
objsort[k]=data1.join(':'); |
|
objsort[j]=data2.join(':'); |
|
} |
|
} |
|
} |
|
} |
|
message("Sorting Resources: finishing up."); |
|
return objsort.sort(rescompare).join('&'); |
|
} else { |
|
return objsort.join('&'); |
|
} |
|
} |
|
|
|
// ----------------------------------------------------------- Straighten graph |
|
|
|
function graphopt() { |
|
var k; |
|
var kj; |
|
var ij; |
|
|
|
var objsorted=new Array(); |
|
condense(); |
|
graphreset(); |
|
objsorted=(sortobjs()).split('&'); |
|
if (objsorted.length==0) { return; } |
|
message("Creating Optimized Graph"); |
var thisnewobj=''+(objsorted[0].split(':'))[0]; |
var thisnewobj=''+(objsorted[0].split(':'))[0]; |
rowcont[1]=thisnewobj; |
rowcont[1]=thisnewobj; |
var thiscolmax=1; |
var thiscolmax=1; |
Line 1520 function graphopt() {
|
Line 2154 function graphopt() {
|
thiscolmax++; |
thiscolmax++; |
} else { |
} else { |
rowcont[rowcont.length]=thisnewobj; |
rowcont[rowcont.length]=thisnewobj; |
if (thiscolmax>allcolmax) { allcolmax=thiscolmax; } |
|
thiscolmax=1; |
thiscolmax=1; |
} |
} |
kj=rowcont.length-1; |
kj=rowcont.length-1; |
obj[thisnewobj]='b&'+kj+'&'+thiscolmax+':0:0:0'; |
obj[thisnewobj]='b&'+kj+'&'+thiscolmax+':0:0:0'; |
|
if (thiscolmax>allcolmax) { allcolmax=thiscolmax; } |
} |
} |
for (k=0;k<obj.length;k++) { |
for (k=0;k<obj.length;k++) { |
if (!obj[k]) { obj[k]=''; } |
if (!obj[k]) { obj[k]=''; } |
Line 1550 function graphopt() {
|
Line 2184 function graphopt() {
|
} |
} |
} |
} |
} |
} |
|
graphdef='yes'; |
} |
} |
|
|
// ----------------------------------------------------------- Remove e-objects |
// ----------------------------------------------------------- Remove e-objects |
|
|
function condense() { |
function condense() { |
|
message("Condensing"); |
var j; |
var j; |
for (j=0;j<=maxrow;j++) { |
for (j=0;j<=maxrow;j++) { |
if (rowcont[j]!='') { |
if (rowcont[j]!='') { |
Line 1573 function condense() {
|
Line 2209 function condense() {
|
// ---------------------------------------------------- Load from hidden fields |
// ---------------------------------------------------- Load from hidden fields |
|
|
function load() { |
function load() { |
|
message("Loading"); |
|
schedule('load'); |
|
checkdef(); |
|
} |
|
|
|
function finishload() { |
|
var k; |
|
for (k=0;k<objcont.length;k++) { objcont[k]=''; } |
objcont.length=0; |
objcont.length=0; |
|
for (k=0;k<objlinks.length;k++) { objlinks[k]=''; } |
objlinks.length=0; |
objlinks.length=0; |
objlinks[0]=''; |
objlinks[0]=''; |
objcont[0]=''; |
objcont[0]=''; |
Line 1582 function load() {
|
Line 2227 function load() {
|
lastinfo=''; |
lastinfo=''; |
graphreset(); |
graphreset(); |
var inputstr=parent.server.document.forms.storage.output.value; |
var inputstr=parent.server.document.forms.storage.output.value; |
|
if (inputstr!='') { |
data1=inputstr.split('<&>'); |
data1=inputstr.split('<&>'); |
var k; |
var k; |
for (k=0;k<data1.length;k++) { |
for (k=0;k<data1.length;k++) { |
Line 1595 function load() {
|
Line 2241 function load() {
|
if (data2[0]=='rowcont') { rowcont[data2[1]]=data2[2]; } |
if (data2[0]=='rowcont') { rowcont[data2[1]]=data2[2]; } |
if (data2[0]=='row') { row[data2[1]]=1*data2[2]; } |
if (data2[0]=='row') { row[data2[1]]=1*data2[2]; } |
if (data2[0]=='col') { col[data2[1]]=1*data2[2]; } |
if (data2[0]=='col') { col[data2[1]]=1*data2[2]; } |
|
if (data2[0]=='mode') { mode=data2[1]; } |
|
if (data2[0]=='tablemode') { tablemode=1*data2[1]; } |
|
if (data2[0]=='zscale') { zscale=1*data2[1]; } |
} |
} |
|
} |
|
if (graphdef=='yes') { |
|
for (k=1;k<=maxrow;k++) { |
|
if (rowcont[k]==undefined) { rowcont[k]=''; } |
|
} |
|
} |
} |
} |
|
|
// -------------------------------------------------------------- Undo function |
// -------------------------------------------------------------- Undo function |
Line 1605 function undo() {
|
Line 2260 function undo() {
|
undopointer--; |
undopointer--; |
parent.server.document.forms.storage.output.value |
parent.server.document.forms.storage.output.value |
=undostack[undopointer]; |
=undostack[undopointer]; |
load(); |
finishload(); |
undopointer--; |
undopointer--; |
draw(); |
draw(); |
stored=0; |
stored=0; |
Line 1621 function redo() {
|
Line 2276 function redo() {
|
undopointer++; |
undopointer++; |
parent.server.document.forms.storage.output.value |
parent.server.document.forms.storage.output.value |
=undostack[undopointer]; |
=undostack[undopointer]; |
load(); |
finishload(); |
undopointer--; |
undopointer--; |
draw(); |
draw(); |
stored=0; |
stored=0; |
Line 1639 function revert() {
|
Line 2294 function revert() {
|
} |
} |
} |
} |
|
|
|
// ---------------------------------------------------------------- Wheelswitch |
|
|
|
function wheelswitch() { |
|
if (funny=='|') { |
|
funny='/'; |
|
} else { |
|
if (funny=='/') { |
|
funny='-'; |
|
} else { |
|
if (funny=='-') { |
|
funny='\\'; |
|
} else { |
|
if (funny=='\\') { funny='|'; } |
|
} |
|
} |
|
} |
|
} |
|
|
|
// --------------------------------------------- Checks if server frame defined |
|
|
|
function checkdef() { |
|
if (parent.server.document.forms.storage.output.value!=undefined) { |
|
srvloaded(); |
|
} |
|
if ((finishdone==0) && (tim==0)) { setTimeout('checkdef()',100); } |
|
} |
|
|
|
// ---------------------------------------------------------- The wait function |
|
|
|
function wait() { |
|
if ((finishdone==1) || (tim==1)) { |
|
if (tim==0) { |
|
clearTimeout(canceltim); |
|
if (reqaction=='save') { finishsave(); } |
|
if (reqaction=='load') { finishload(); draw(); } |
|
} else { |
|
alert("Server Communication Timed Out."); |
|
} |
|
} else { |
|
wheelswitch(); |
|
message('Waiting for server reply: '+funny); |
|
setTimeout('wait();',100); |
|
} |
|
} |
|
|
|
// ---------------------------------------------------------- Schedule function |
|
|
|
function schedule(action) { |
|
reqaction=action; |
|
tim=0; |
|
finishdone=0; |
|
canceltim=setTimeout('tim=1;',20000) |
|
wait(); |
|
} |
|
|
// -------------------------------------------------------------- Store changes |
// -------------------------------------------------------------- Store changes |
|
|
function storechange() { |
function storechange() { |
|
var k; |
parent.server.document.forms.storage.submit(); |
parent.server.document.forms.storage.submit(); |
|
schedule('save'); |
|
} |
|
|
|
function finishsave() { |
|
finishload(); |
|
draw(); |
stored=1; |
stored=1; |
alert("Stored changes"); |
} |
|
|
|
// --------------------------------------- Gets called when submission finished |
|
|
|
function srvloaded() { |
|
finishdone=1; |
|
message("Server replied."); |
} |
} |
|
|
// ---------------------------------------------------------------- Toggle Mode |
// ---------------------------------------------------------------- Toggle Mode |
|
|
function togglemode() { |
function togglemode() { |
if (tablemode==0) { tablemode=1; } else { tablemode=0; } |
if (tablemode==0) { |
|
tablemode=1; |
|
} else { |
|
if (tablemode==1) { |
|
tablemode=2; |
|
} else { |
|
tablemode=0; |
|
} |
|
} |
|
notclear=0; |
|
infoclear(); |
draw(); |
draw(); |
} |
} |
|
|
Line 1659 function togglemode() {
|
Line 2392 function togglemode() {
|
function main() { |
function main() { |
|
|
if (mainrun==0) { |
if (mainrun==0) { |
|
infopen(); |
|
infoclear(); |
load(); |
load(); |
draw(); |
|
stored=1; |
stored=1; |
mainrun=1; |
mainrun=1; |
} |
} |
Line 1670 function main() {
|
Line 2404 function main() {
|
// ------------------------------------------------------------- Save on leave? |
// ------------------------------------------------------------- Save on leave? |
|
|
function leave() { |
function leave() { |
|
if (!inf.closed) { |
|
inf.close(); |
|
} |
if (stored==0) { |
if (stored==0) { |
if (confirm('Store changes?')) { |
if (confirm('Store changes?')) { |
storechange(); |
storechange(); |
Line 1682 function leave() {
|
Line 2419 function leave() {
|
|
|
<body bgcolor="#FFFFFF" onLoad="main();" onUnload="leave();"> |
<body bgcolor="#FFFFFF" onLoad="main();" onUnload="leave();"> |
<a href="javascript:togglemode();">Toggle Display Mode</a> |
<a href="javascript:togglemode();">Toggle Display Mode</a> |
|
<a href="javascript:if (zscale>1) { zscale--; draw();}">Zoom Out</a> |
|
<a href="javascript:if (zscale<3) { zscale++; draw();}">Zoom In</a> |
<a href="javascript:condense();draw();">Condense</a> |
<a href="javascript:condense();draw();">Condense</a> |
<a href="javascript:graphopt();draw();">Straighten</a> |
<a href="javascript:graphopt();draw();">Straighten</a> |
<a href="javascript:revert();">Revert</a> |
<a href="javascript:revert();">Revert</a> |