version 1.1, 2000/02/22 21:14:59
|
version 1.3, 2000/05/25 12:14:01
|
Line 6 Resource Assembly Tool
|
Line 6 Resource Assembly Tool
|
7/23,7/24,7/26, |
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, |
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, |
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/7,1/8,1/10,1/14,1/15,1/16,1/21,1/22,1/29,1/30,1/31, |
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, |
5/2,5/3,5/4,5/5,5/6,5/8,5/9,5/13,5/18,5/20,5/22,5/24 |
2/19,2/20,2/21,2/22 Gerd Kortemeyer with Scott Harrison |
Gerd Kortemeyer with Scott Harrison |
--> |
--> |
|
|
|
|
Line 20 var row=new Array();
|
Line 20 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 lastempty=-2; |
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 37 var rrow=new Array();
|
Line 38 var rrow=new Array();
|
var cw=new Array(); |
var cw=new Array(); |
var rh=new Array(); |
var rh=new Array(); |
|
|
|
var undostack=new Array(); |
|
var undopointer=0; |
|
var stored=0; |
var editmode=0; |
var editmode=0; |
var notclear=0; |
var notclear=0; |
var linkmode=0; |
var linkmode=0; |
var lastinfo=''; |
var lastinfo=''; |
var graphdef='no'; |
var graphdef='no'; |
var mainrun=0; |
var mainrun=0; |
|
var tablemode=0; |
|
var mostrecent=0; |
|
|
|
var disrows=0; |
|
var discols=0; |
|
|
var data1=new Array(1024); |
var data1=new Array(1024); |
var data2=new Array(1024); |
var data2=new Array(1024); |
Line 55 var data5=new Array(1024);
|
Line 64 var data5=new Array(1024);
|
|
|
function insertrow(j,ex1,ex2) { |
function insertrow(j,ex1,ex2) { |
var kj; |
var kj; |
|
stored=0; |
objects1=''; |
objects1=''; |
objects2=''; |
objects2=''; |
for (kj=0;kj<=maxrow;kj++) { |
for (kj=0;kj<=maxrow;kj++) { |
Line 158 function insertrow(j,ex1,ex2) {
|
Line 168 function insertrow(j,ex1,ex2) {
|
|
|
function newcondition(content,type) { |
function newcondition(content,type) { |
var ko; |
var ko; |
|
stored=0; |
ko=obj.length; |
ko=obj.length; |
obj[ko]='c'; |
obj[ko]='c'; |
objcont[ko]=content+':'+type+':cond'; |
objcont[ko]=content+':'+type+':cond'; |
Line 166 function newcondition(content,type) {
|
Line 177 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) { |
objcont[addobj(rid,'b&'+rid+'&'+cid+':0:0:0')]=text+':'+url+':res'; |
stored=0; |
|
objcont[addobj(rid,'b&'+rid+'&'+cid+':0:0:0')]= |
|
text+':'+url+':'+ext+':'+type+':res'; |
} |
} |
|
|
|
|
Line 175 function newresource(rid,cid,text,url) {
|
Line 188 function newresource(rid,cid,text,url) {
|
|
|
function insertcond(obj1,portnr,cond) { |
function insertcond(obj1,portnr,cond) { |
var k; |
var k; |
|
stored=0; |
data1=obj[obj1].split('&'); |
data1=obj[obj1].split('&'); |
for (k=2;k<data1.length;k++) { |
for (k=2;k<data1.length;k++) { |
data2=data1[k].split(':'); |
data2=data1[k].split(':'); |
Line 191 function insertcond(obj1,portnr,cond) {
|
Line 205 function insertcond(obj1,portnr,cond) {
|
|
|
function insertcol(j) { |
function insertcol(j) { |
var kj; |
var kj; |
|
stored=0; |
for (kj=0;kj<=maxcol;kj++) { |
for (kj=0;kj<=maxcol;kj++) { |
if ( col[kj]>j ) { col[kj]++; } |
if ( col[kj]>j ) { col[kj]++; } |
} |
} |
Line 320 function insertport (obj1,d,inout,linkob
|
Line 335 function insertport (obj1,d,inout,linkob
|
|
|
|
|
var k; var port; var revport; |
var k; var port; var revport; |
|
stored=0; |
data1=obj[obj1].split('&'); |
data1=obj[obj1].split('&'); |
middle=maprow(data1[1],obj1,0); |
middle=maprow(data1[1],obj1,0); |
if (inout==1) { |
if (inout==1) { |
Line 395 function insertport (obj1,d,inout,linkob
|
Line 411 function insertport (obj1,d,inout,linkob
|
// returns object number of generated object |
// returns object number of generated object |
|
|
function addobj(kjid,objs) { |
function addobj(kjid,objs) { |
|
stored=0; |
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 443 function horizontal(hrid,hoffs,hfcol,htc
|
Line 460 function horizontal(hrid,hoffs,hfcol,htc
|
|
|
function delobj(obj1) { |
function delobj(obj1) { |
var k; |
var k; |
|
stored=0; |
for (k=0;k<rowcont.length;k++) { |
for (k=0;k<rowcont.length;k++) { |
data4=rowcont[k].split(':'); |
data4=rowcont[k].split(':'); |
rowcont[k]=''; |
rowcont[k]=''; |
Line 458 function delobj(obj1) {
|
Line 476 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); |
|
|
if (lastempty!=obj.length) { |
|
insertrow(maxrow); |
|
insertcol(maxcol); |
|
addobj(maxrow,'e&'+maxcol); |
|
lastempty=obj.length; |
|
} |
|
|
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 491 function cleanup () {
|
Line 517 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; } |
} |
} |
} |
} |
|
|
Line 499 function cleanup () {
|
Line 530 function cleanup () {
|
|
|
function delcond(obj1,colid) { |
function delcond(obj1,colid) { |
var k; |
var k; |
|
stored=0; |
data3=obj[obj1].split('&'); |
data3=obj[obj1].split('&'); |
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++) { |
Line 509 function delcond(obj1,colid) {
|
Line 541 function delcond(obj1,colid) {
|
} |
} |
} |
} |
} |
} |
|
|
// ----------------------------------------- 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 536 function crecond(obj1,colid,condtext,con
|
Line 568 function crecond(obj1,colid,condtext,con
|
|
|
function dellink (linknr) { |
function dellink (linknr) { |
var k; var obj1; var obj2; |
var k; var obj1; var obj2; |
|
stored=0; |
if (objlinks[linknr]!='') { |
if (objlinks[linknr]!='') { |
data3=objlinks[linknr].split(':'); |
data3=objlinks[linknr].split(':'); |
obj1=data3[0]; |
obj1=data3[0]; |
Line 576 function dellink (linknr) {
|
Line 609 function dellink (linknr) {
|
|
|
function joinres (obj1,obj2,cond) { |
function joinres (obj1,obj2,cond) { |
var k; var kr; var outcol; var incol; var d; |
var k; var kr; var outcol; var incol; var d; |
|
stored=0; |
dest=objlinks.length; |
dest=objlinks.length; |
objlinks[dest]=obj1+':'+obj2+':'+cond; |
objlinks[dest]=obj1+':'+obj2+':'+cond; |
data3=obj[obj1].split('&'); |
data3=obj[obj1].split('&'); |
Line 694 function delres (obj1,recon) {
|
Line 728 function delres (obj1,recon) {
|
|
|
var k; var k1; var k2; var found; |
var k; var k1; var k2; var found; |
|
|
|
stored=0; |
|
|
data1=obj[obj1].split('&'); |
data1=obj[obj1].split('&'); |
for (k=2;k<data1.length;k++) { |
for (k=2;k<data1.length;k++) { |
data2=data1[k].split(':'); |
data2=data1[k].split(':'); |
Line 715 function delres (obj1,recon) {
|
Line 751 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 788 function delres (obj1,recon) {
|
Line 825 function delres (obj1,recon) {
|
|
|
// -------------------------------------------------------------- Draw an entry |
// -------------------------------------------------------------- Draw an entry |
|
|
function drawcell (rtype,ctype,what,cm,obj1,mode2,ej,ek,ne) { |
function drawcell (rtype,ctype,what,cm,obj1,ej,ek,ne) { |
var bgcolor; |
var bgcolor; |
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]+'>'); |
Line 833 function drawcell (rtype,ctype,what,cm,o
|
Line 870 function drawcell (rtype,ctype,what,cm,o
|
|
|
// ----------------------------------------------------------------- Draw a row |
// ----------------------------------------------------------------- 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 j; var jk; var k; var rc; var gc; var bc; var ck; |
var objd1=new Array(); |
var objd1=new Array(); |
var objd2=new Array(); |
var objd2=new Array(); |
Line 842 var condtype;
|
Line 879 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); |
if (data1[2]=='true') { bc='55'; } else { bc='11'; } |
bc=(data2[jk]+data2[jk]).substr(0,2); |
if (data1[3]=='mandatory') { rc='BB'; } else { rc='55'; } |
|
if (data1[3]=='optional') { gc='66'; } else { gc='AA'; } |
ck='#'+rc+gc+bc; |
ck='#'+rc+gc+bc; |
left=maxcol; |
left=maxcol; |
leftin=maxcol; |
leftin=maxcol; |
Line 993 if (rowtype[jid]!=0) {
|
Line 1032 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 1004 if (rowtype[jid]!=0) {
|
Line 1043 if (rowtype[jid]!=0) {
|
} |
} |
rtype=rowtype[jid]; |
rtype=rowtype[jid]; |
for (k=0;k<=maxcol;k++) { |
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]); |
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=30>'); |
for (k=0;k<=maxcol;k++) { |
for (k=0;k<=maxcol;k++) { |
drawcell(1,coltype[rcol[k]],colmap2[k],colmap5[k],objd2[k],mode2,jid,k, |
drawcell(1,coltype[rcol[k]],colmap2[k],colmap5[k],objd2[k],jid,k, |
1); |
notempty[k]); |
} |
} |
parent.mapout.document.writeln('</tr><tr>'); |
parent.mapout.document.writeln('</tr>'); |
|
parent.mapout.document.writeln('<tr height=30>'); |
for (k=0;k<=maxcol;k++) { |
for (k=0;k<=maxcol;k++) { |
drawcell(1,coltype[rcol[k]],colmap3[k],colmap6[k],objd2[k],mode2,jid,k, |
drawcell(1,coltype[rcol[k]],colmap3[k],colmap6[k],objd2[k],jid,k, |
1); |
notempty[k]); |
} |
} |
} |
} |
} |
} |
Line 1024 if (rowtype[jid]!=0) {
|
Line 1065 if (rowtype[jid]!=0) {
|
} |
} |
} |
} |
|
|
|
// -------------------------------------------------------------- Print message |
|
|
|
function message(txt) { |
|
parent.window.status=txt; |
|
} |
|
|
// ------------------------------------------------------------- Draw the table |
// ------------------------------------------------------------- Draw the table |
|
|
function draw (mode,mode2) { |
function draw () { |
var k; var kr; |
var k; var kr; |
|
|
|
|
cleanup(); |
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('<html><body bgcolor="#FFFFFF">'); |
|
|
|
for (k=0;k<obj.length;k++) { deb.document.writeln(k+' - '+obj[k]+'<br>'); } |
|
deb.document.writeln('<hr>Cols: '+col+'<hr>Rows: '+row+'<hr>'); |
|
deb.document.writeln(objcont+'<hr>'+objlinks+'<hr>'); |
|
for (kr=0;kr<=maxrow;kr++) { |
|
kid=findrow(kr); |
|
maprow(kid,-1,0); |
|
deb.document.writeln(kid+' : '+colmap+' '+rowcont[kid]+"<br>"); |
|
} |
|
deb.document.writeln('<hr>Rowtype: '+rowtype+'<hr>Coltype: '+coltype); |
|
deb.document.writeln('<hr>maxcol: '+maxcol+'<hr>maxrow: '+maxrow); |
|
deb.document.writeln('</body></html>'); |
|
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; |
rh[0]=0; |
rh[1]=30; |
rh[1]=30; |
rh[2]=60; |
rh[2]=60; |
cw[0]=0; |
cw[0]=0; |
cw[1]=30; |
cw[1]=30; |
cw[2]=60; |
cw[2]=60; |
|
parent.mapout.document.clear(); |
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 (graphdef=='no') { graphopt(); cleanup(); } |
for (kr=0;kr<=maxrow;kr++) { drawrow(rrow[kr],mode2); } |
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 { |
|
message("Generating Table Output"); |
|
parent.mapout.document.writeln( '<table>'); |
|
tabledraw(); |
|
} |
|
|
parent.mapout.document.writeln('</table>'); |
parent.mapout.document.writeln('</table>'); |
parent.mapout.document.writeln('</body></html>'); |
parent.mapout.document.writeln('</body></html>'); |
Line 1089 function infoclear() {
|
Line 1128 function infoclear() {
|
'<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>Click to Edit</b><hr>Click 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 1132 function info(infostr) {
|
Line 1175 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 '); } |
|
inf.document.write('Resource'); |
|
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 1179 function escape(instring) {
|
Line 1230 function escape(instring) {
|
return outstring; |
return outstring; |
} |
} |
|
|
|
// -------------------------------------------------- Insert resource into link |
|
|
|
function insertreslink(infostr) { |
|
var lnr; |
|
var fobj; |
|
var tobj; |
|
var nobj; |
|
var cobj; |
|
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); |
|
} |
|
|
// ---------------------------------------------------- Handles "click to edit" |
// ---------------------------------------------------- Handles "click to edit" |
|
|
function handler(infostr) { |
function handler(infostr) { |
Line 1201 function handler(infostr) {
|
Line 1281 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 1227 function handler(infostr) {
|
Line 1307 function handler(infostr) {
|
} |
} |
inf.document.writeln( |
inf.document.writeln( |
'opener.infoclear();opener.editmode=0;opener.draw(' |
'opener.infoclear();opener.editmode=0;opener.draw(' |
+"'debug','edit'"+');">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(' |
+"'debug','edit'"+');">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>'); |
|
} 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 1244 function handler(infostr) {
|
Line 1327 function handler(infostr) {
|
notclear=0; |
notclear=0; |
linkmode=0; |
linkmode=0; |
inf.document.writeln('<b>Linked Resources</b>'); |
inf.document.writeln('<b>Linked Resources</b>'); |
draw('debug','edit'); |
draw(); |
} else { |
} else { |
inf.document.writeln('<b>Resource</b>'); |
inf.document.writeln('<b>Resource</b>'); |
data2=objcont[data1[1]].split(':'); |
data2=objcont[data1[1]].split(':'); |
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]+'"></td></tr><tr><td>URL:</td><td>' |
+'<input type=text name=u size=40 value="'+data2[1]+'"></td></tr>' |
+'<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><input type=hidden name=h value='+data2[3] |
|
+'><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>' |
+'<tr><td colspan=2><a href="javascript:opener.editmode=0;' |
+'<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>'); |
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(' |
+"'debug','edit'"+');">Delete Resource (cutting links)</a>'); |
+');">Delete Resource (cutting links)</a>'); |
inf.document.writeln( |
inf.document.writeln( |
'<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(' |
+"'debug','edit'"+');">Delete Resource (preserving links)</a>'); |
+');">Delete Resource (preserving links)</a>'); |
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]+';' |
Line 1280 function handler(infostr) {
|
Line 1377 function handler(infostr) {
|
} |
} |
} 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 1288 function handler(infostr) {
|
Line 1385 function handler(infostr) {
|
'</b><br>to <b>'+objcont[data3[1]].split(':')[0]+'</b>'); |
'</b><br>to <b>'+objcont[data3[1]].split(':')[0]+'</b>'); |
inf.document.writeln('<br><a href="javascript:opener.dellink('+ |
inf.document.writeln('<br><a href="javascript:opener.dellink('+ |
k+');opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
k+');opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
+"'debug','edit'"+');">Delete Link</a>'); |
+');">Delete Link</a>'); |
|
inf.document.writeln('<br><a href="javascript:'+ |
|
"opener.insertreslink('"+infostr+"');"+ |
|
'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
|
+');">Insert Resource Into Link</a>'); |
} |
} |
} |
} |
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 1318 function empty(rid,k) {
|
Line 1419 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(' |
+"'debug','edit'"+');">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);" |
+'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
+'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
+"'debug','edit'"+');">left</a>'); |
+');">left</a>'); |
inf.document.writeln('<a href="javascript:opener.insertcol('+ |
inf.document.writeln('<a href="javascript:opener.insertcol('+ |
k+');opener.addobj('+rid+",'e&'+opener.maxcol);" |
k+');opener.addobj('+rid+",'e&'+opener.maxcol);" |
+'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
+'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
+"'debug','edit'"+');">right</a> '); |
+');">right</a> '); |
inf.document.writeln('<br>Insert row:'); |
inf.document.writeln('<br>Insert row:'); |
inf.document.writeln('<a href="javascript:opener.insertrow('+ |
inf.document.writeln('<a href="javascript:opener.insertrow('+ |
trow+');opener.addobj(opener.maxrow'+",'e&"+cid+"');" |
trow+');opener.addobj(opener.maxrow'+",'e&"+cid+"');" |
+'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
+'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
+"'debug','edit'"+');">below</a>'); |
+');">below</a>'); |
inf.document.writeln('<a href="javascript:opener.insertrow('+ |
inf.document.writeln('<a href="javascript:opener.insertrow('+ |
lrow+');opener.addobj(opener.maxrow'+",'e&"+cid+"');" |
lrow+');opener.addobj(opener.maxrow'+",'e&"+cid+"');" |
+'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
+'opener.editmode=0;opener.notclear=0;opener.infoclear();opener.draw(' |
+"'debug','edit'"+');">above</a> '); |
+');">above</a> '); |
|
|
|
|
inf.document.writeln( |
inf.document.writeln( |
Line 1352 function empty(rid,k) {
|
Line 1473 function empty(rid,k) {
|
// ---------------------------------------------------- Save into hidden fields |
// ---------------------------------------------------- Save into hidden fields |
|
|
function save() { |
function save() { |
var k; |
var k; |
self.document.forms.storage.output.value='graphdef<:>yes'; |
if (graphdef=='yes') { |
|
parent.server.document.forms.storage.output.value='graphdef<:>yes'; |
for (k=0;k<obj.length;k++) { |
for (k=0;k<obj.length;k++) { |
self.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
'<&>obj<:>'+k+'<:>'+obj[k]; |
'<&>obj<:>'+k+'<:>'+obj[k]; |
} |
} |
for (k=0;k<row.length;k++) { |
for (k=0;k<row.length;k++) { |
self.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
'<&>row<:>'+k+'<:>'+row[k]; |
'<&>row<:>'+k+'<:>'+row[k]; |
} |
} |
for (k=0;k<col.length;k++) { |
for (k=0;k<col.length;k++) { |
self.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
'<&>col<:>'+k+'<:>'+col[k]; |
'<&>col<:>'+k+'<:>'+col[k]; |
} |
} |
for (k=0;k<rowcont.length;k++) { |
for (k=0;k<rowcont.length;k++) { |
if (rowcont[k]) { |
if (rowcont[k]) { |
self.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
'<&>rowcont<:>'+k+'<:>'+rowcont[k]; |
'<&>rowcont<:>'+k+'<:>'+rowcont[k]; |
} |
} |
} |
} |
self.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
'<&>maxcol<:>'+maxcol; |
'<&>maxcol<:>'+maxcol; |
self.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
'<&>maxrow<:>'+maxrow; |
'<&>maxrow<:>'+maxrow; |
|
} 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]) { |
self.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
'<&>objcont<:>'+k+'<:>'+objcont[k]; |
'<&>objcont<:>'+k+'<:>'+objcont[k]; |
} |
} |
} |
} |
for (k=0;k<objlinks.length;k++) { |
for (k=0;k<objlinks.length;k++) { |
if (objlinks[k]) { |
if (objlinks[k]) { |
self.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
'<&>objlinks<:>'+k+'<:>'+objlinks[k]; |
'<&>objlinks<:>'+k+'<:>'+objlinks[k]; |
} |
} |
} |
} |
|
undopointer++; |
|
undostack[undopointer]= |
|
parent.server.document.forms.storage.output.value; |
} |
} |
|
|
// ----------------------------------------------- Reset all layout information |
// ----------------------------------------------- Reset all layout information |
Line 1431 function rescompare(a,b) {
|
Line 1561 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; |
} |
} |
|
|
// ------------------------------------------- Sort objects to straighten graph |
// -------------------------------------------- Draw the table instead of graph |
|
|
function graphopt() { |
function tabledraw() { |
|
var objsorted=new Array(); |
|
var robjs=new Array(); |
|
var k; |
|
var i; |
|
var j; |
|
var nr; |
|
var bc; var rc; var gc; var ck; |
|
var sortstr=sortobjs(); |
|
if (sortstr!='') { |
|
objsorted=sortstr.split('&'); |
|
for (k=0;k<objsorted.length;k++) { |
|
robjs[objsorted[k]]=k; |
|
} |
|
for (k=0;k<objsorted.length;k++) { |
|
i=(objsorted[k].split(':'))[0]; |
|
if (k<objsorted.length-1) { |
|
nr=(objsorted[k+1].split(':'))[0]; |
|
} else { |
|
nr=-1; |
|
} |
|
data1=objcont[i].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; |
|
parent.mapout.document.write('<tr><td bgcolor="'+ck |
|
+'"><b>'+k+'</td><td bgcolor="'+ck |
|
+'"><form name=r'+i+' method=post>'); |
|
data2=obj[i].split('&'); |
|
parent.mapout.document.write('<table bgcolor="#CCCCCC">'); |
|
parent.mapout.document.write( |
|
'<tr><td>Title:</td><td><input type=text name=t size=30 value="' |
|
+data1[0]+'"></td></tr>'); |
|
parent.mapout.document.write( |
|
'<tr><td>URL:</td><td><input type=text name=u size=30 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=hidden name=h value='+data1[3] |
|
+'><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>' |
|
+'<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><br><table><tr>'); |
|
for (j=2;j<data2.length;j++) { |
|
data3=objlinks[(data2[j].split(':'))[2]].split(':'); |
|
if (data3.length>1) { |
|
if (data3[1]==nr) { |
|
parent.mapout.document.writeln('<td>Next<br>'+data3); |
|
parent.mapout.document.writeln('</td>'); |
|
} |
|
} |
|
} |
|
for (j=2;j<data2.length;j++) { |
|
data3=objlinks[(data2[j].split(':'))[2]].split(':'); |
|
if (data3.length>1) { |
|
if ((data3[1]!=nr) && (data3[1]!=0)) { |
|
parent.mapout.document.writeln( |
|
'<td>To: '+robjs[data3[1]]+'<br>'); |
|
parent.mapout.document.writeln('</td>'); |
|
} |
|
} |
|
} |
|
parent.mapout.document.writeln( |
|
'</tr></table></td></tr></table></form></td></tr>'); |
|
} |
|
} |
|
} |
|
|
|
// ---------------------------------- Sort objects to straighten graph or table |
|
|
|
function sortobjs() { |
|
message("Sorting Resources"); |
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 1453 function graphopt() {
|
Line 1677 function graphopt() {
|
} |
} |
} |
} |
} |
} |
|
if (objsort.length==0) { return ''; } |
for (k=1;k<objlinks.length;k++) { |
for (k=1;k<objlinks.length;k++) { |
|
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 1462 function graphopt() {
|
Line 1689 function graphopt() {
|
} |
} |
} |
} |
objsort[kj]+=':'+data1[1]; |
objsort[kj]+=':'+data1[1]; |
|
} |
} |
} |
objsorted=objsort.sort(rescompare); |
if (sortthis!=0) { |
|
for (k=0;k<objsort.length;k++) { |
|
for (j=0;j<objsort.length;j++) { |
|
if (k!=j) { |
|
data1=objsort[k].split(':'); |
|
data2=objsort[j].split(':'); |
|
dol=data1.length; |
|
dtl=data2.length; |
|
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(':'); |
|
} |
|
} |
|
} |
|
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 1506 function graphopt() {
|
Line 1779 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 1524 function condense() {
|
Line 1799 function condense() {
|
} |
} |
} |
} |
} |
} |
|
lastempty=-2; |
} |
} |
|
|
// ---------------------------------------------------- Load from hidden fields |
// ---------------------------------------------------- Load from hidden fields |
Line 1537 function load() {
|
Line 1813 function load() {
|
notclear=0; |
notclear=0; |
lastinfo=''; |
lastinfo=''; |
graphreset(); |
graphreset(); |
var inputstr=self.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 1551 function load() {
|
Line 1828 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]=='tablemode') { tablemode=1*data2[1]; } |
} |
} |
|
} |
|
} |
|
|
|
// -------------------------------------------------------------- Undo function |
|
|
|
function undo() { |
|
if (undopointer>1) { |
|
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<undostack.length-1) { |
|
undopointer++; |
|
parent.server.document.forms.storage.output.value |
|
=undostack[undopointer]; |
|
load(); |
|
undopointer--; |
|
draw(); |
|
stored=0; |
|
} else { |
|
alert("Cannot redo: reached end of edit session"); |
|
} |
|
} |
|
|
|
// ------------------------------------------------------------ Revert function |
|
|
|
function revert() { |
|
if (confirm("Revert to beginning of edit session?")) { |
|
undopointer=2; |
|
undo(); |
|
} |
|
} |
|
|
|
// -------------------------------------------------------------- Store changes |
|
|
|
function storechange() { |
|
parent.server.document.forms.storage.submit(); |
|
stored=1; |
|
alert("Stored changes"); |
|
} |
|
|
|
// ---------------------------------------------------------------- Toggle Mode |
|
|
|
function togglemode() { |
|
if (tablemode==0) { tablemode=1; } else { tablemode=0; } |
|
draw(); |
} |
} |
|
|
// -------------------------------------------------------- Main program onLoad |
// -------------------------------------------------------- Main program onLoad |
Line 1560 function main() {
|
Line 1895 function main() {
|
|
|
if (mainrun==0) { |
if (mainrun==0) { |
load(); |
load(); |
draw('debug','edit'); |
draw(); |
|
stored=1; |
mainrun=1; |
mainrun=1; |
} |
} |
|
|
} |
} |
|
|
|
// ------------------------------------------------------------- Save on leave? |
|
|
|
function leave() { |
|
if (stored==0) { |
|
if (confirm('Store changes?')) { |
|
storechange(); |
|
} |
|
} |
|
} |
|
|
</script> |
</script> |
</head> |
</head> |
|
|
<body bgcolor="#FFFFFF" onLoad="main();"> |
<body bgcolor="#FFFFFF" onLoad="main();" onUnload="leave();"> |
<a href="javascript:condense();draw('debug','edit');">Condense</a> |
<a href="javascript:togglemode();">Toggle Display Mode</a> |
<a href="javascript:graphopt();draw('debug','edit');">Straighten</a> |
<a href="javascript:condense();draw();">Condense</a> |
<form name=storage method=post> |
<a href="javascript:graphopt();draw();">Straighten</a> |
<input type=hidden name=output> |
<a href="javascript:revert();">Revert</a> |
</form> |
<a href="javascript:undo();">Undo</a> |
|
<a href="javascript:redo();">Redo</a> |
|
<a href="javascript:storechange();">Store</a> |
</body> |
</body> |
</html> |
|
|
|
|
</html> |
|
|
|
|
|
|
|
|
|
|