version 1.3, 2000/05/25 12:14:01
|
version 1.59, 2002/06/24 14:02:54
|
Line 3
|
Line 3
|
<!-- |
<!-- |
The LearningOnline Network |
The LearningOnline Network |
Resource Assembly Tool |
Resource Assembly Tool |
|
// |
|
// $Id$ |
|
// |
|
// Copyright Michigan State University Board of Trustees |
|
// |
|
// This file is part of the LearningOnline Network with CAPA (LON-CAPA). |
|
// |
|
// LON-CAPA is free software; you can redistribute it and/or modify |
|
// it under the terms of the GNU General Public License as published by |
|
// the Free Software Foundation; either version 2 of the License, or |
|
// (at your option) any later version. |
|
// |
|
// LON-CAPA is distributed in the hope that it will be useful, |
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
// GNU General Public License for more details. |
|
// |
|
// You should have received a copy of the GNU General Public License |
|
// along with LON-CAPA; if not, write to the Free Software |
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
// |
|
// /home/httpd/html/adm/gpl.txt |
|
// |
|
// http://www.lon-capa.org/ |
|
// |
|
YEAR 2000 |
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/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,5/5,5/6,5/8,5/9,5/13,5/18,5/20,5/22,5/24 |
5/2,5/3,5/4,5/5,5/6,5/8,5/9,5/13,5/18,5/20,5/22,5/24,5/25, |
Gerd Kortemeyer with Scott Harrison |
6/7,6/8,6/9,6/10,6/12,6/15,7/4,7/26,7/28,7/31,8/5,8/19,8/24, |
|
YEAR 2001 |
|
01/17/01,03/03,03/05 Gerd Kortemeyer with Scott Harrison |
|
March/April 01 Scott Harrison |
|
04/20 Gerd Kortemeyer |
|
04/30 Scott Harrison |
|
05/31 Scott Harrison |
|
06/11,06/25,06/27,06/28,06/29,07/04 Gerd Kortemeyer |
|
07/24,8/6,8/7,10/16 Scott Harrison |
|
03/01/02 Matthew Hall |
--> |
--> |
|
|
|
|
Line 20 var row=new Array();
|
Line 55 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 29 var colmap5=new Array();
|
Line 64 var colmap5=new Array();
|
var colmap6=new Array(); |
var colmap6=new Array(); |
var obj=new Array(); |
var obj=new Array(); |
var objcont=new Array(); |
var objcont=new Array(); |
|
var objparms=new Array(); |
var objlinks=new Array(); |
var objlinks=new Array(); |
var rowcont=new Array(); |
var rowcont=new Array(); |
var rowtype=new Array(); |
var rowtype=new Array(); |
Line 46 var notclear=0;
|
Line 82 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 mostrecent=0; |
|
var zscale=3; |
|
|
var disrows=0; |
var disrows=0; |
var discols=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); |
var data3=new Array(1024); |
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; |
|
var srch; |
|
var srchflag=-1; // 1 means currently open |
|
// 0 means closed (but has been open) |
|
// -1 means never yet opened/defined |
|
var srchmode=''; |
|
|
|
var idx; |
|
var idxflag=-1; // 1 means currently open |
|
// 0 means closed (but has been open) |
|
// -1 means never yet opened/defined |
|
var idxmode=''; |
|
|
|
var copydx; |
|
var copydxflag=-1; // 1 means currently open |
|
// 0 means closed (but has been open) |
|
// -1 means never yet opened/defined |
|
var copydxmode=''; |
|
|
|
var parm; |
|
var parmflag=-1; // 1 means currently open |
|
// 0 means closed (but has been open) |
|
// -1 means never yet opened/defined |
|
|
|
var iconpath='/adm/lonIcons/'; |
|
var raticons='/adm/rat/'; |
|
|
// ------------------------------------------------ Insert a row into the table |
function testfunction() { |
|
inf.document.forms.resinfo.elements.t.value="ABC"; |
|
} |
|
|
|
// ------------------------------------------------ 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 79 function insertrow(j,ex1,ex2) {
|
Line 155 function insertrow(j,ex1,ex2) {
|
objects=objects1+':'+objects2; |
objects=objects1+':'+objects2; |
data1=objects.split(':'); |
data1=objects.split(':'); |
for (kj=0;kj<data1.length;kj++) { |
for (kj=0;kj<data1.length;kj++) { |
if (data1[kj]!='') { |
if ((data1[kj]!='') && (typeof(data1[kj])!="undefined")) { |
thisisobj=obj[data1[kj]]; |
thisisobj=obj[data1[kj]]; |
thisobjtype=thisisobj.split('&')[0]; |
thisobjtype=thisisobj.split('&')[0]; |
if (thisobjtype=='v') { |
if (thisobjtype=='v') { |
Line 120 function insertrow(j,ex1,ex2) {
|
Line 196 function insertrow(j,ex1,ex2) {
|
} |
} |
} |
} |
} |
} |
if (newobj!='') { |
if ((newobj!='') && (typeof(newobj)!="undefined")) { |
thisobjcol=newobj.split('&')[1]; |
thisobjcol=newobj.split('&')[1]; |
if (colcover.indexOf(':'+thisobjcol+':',0)==-1) { |
if (colcover.indexOf(':'+thisobjcol+':',0)==-1) { |
colcover+=thisobjcol+':'; |
colcover+=thisobjcol+':'; |
Line 146 function insertrow(j,ex1,ex2) {
|
Line 222 function insertrow(j,ex1,ex2) {
|
} |
} |
} |
} |
} |
} |
if (newobj!='') { |
if ((newobj!='') && (typeof(newobj)!="undefined")) { |
thisobjcol=newobj.split('&')[1]; |
thisobjcol=newobj.split('&')[1]; |
if (colcover.indexOf(':'+thisobjcol+':',0)==-1) { |
if (colcover.indexOf(':'+thisobjcol+':',0)==-1) { |
colcover+=thisobjcol+':'; |
colcover+=thisobjcol+':'; |
Line 165 function insertrow(j,ex1,ex2) {
|
Line 241 function insertrow(j,ex1,ex2) {
|
} |
} |
|
|
// --------------------------------------------- Creates a new condition object |
// --------------------------------------------- Creates a new condition object |
|
|
function newcondition(content,type) { |
function newcondition(content,type) { |
var ko; |
var ko; |
stored=0; |
stored=0; |
Line 176 function newcondition(content,type) {
|
Line 251 function newcondition(content,type) {
|
} |
} |
|
|
// ---------------------------------------------- Creates a new resource object |
// ---------------------------------------------- Creates a new resource object |
|
|
function newresource(rid,cid,text,url,ext,type) { |
function newresource(rid,cid,text,url,ext,type) { |
stored=0; |
stored=0; |
objcont[addobj(rid,'b&'+rid+'&'+cid+':0:0:0')]= |
objcont[addobj(rid,'b&'+rid+'&'+cid+':0:0:0')]= |
Line 185 function newresource(rid,cid,text,url,ex
|
Line 259 function newresource(rid,cid,text,url,ex
|
|
|
|
|
// -------------------------------- Insert a condition into a port of an object |
// -------------------------------- Insert a condition into a port of an object |
|
|
function insertcond(obj1,portnr,cond) { |
function insertcond(obj1,portnr,cond) { |
var k; |
var k; |
stored=0; |
stored=0; |
Line 202 function insertcond(obj1,portnr,cond) {
|
Line 275 function insertcond(obj1,portnr,cond) {
|
|
|
// --------------------------------------------- Insert a column into the table |
// --------------------------------------------- Insert a column into the table |
// Inserts a new table column after table column j |
// Inserts a new table column after table column j |
|
|
function insertcol(j) { |
function insertcol(j) { |
var kj; |
var kj; |
stored=0; |
stored=0; |
Line 210 function insertcol(j) {
|
Line 282 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; |
} |
} |
|
|
// --------------------------------------------------------------- Find the row |
// --------------------------------------------------------------- Find the row |
|
|
function findrow(jid) { |
function findrow(jid) { |
var j; |
var j; |
for (j=0;j<=maxrow;j++) { if (row[j]==jid) { return j; } } |
for (j=0;j<=maxrow;j++) { if (row[j]==jid) { return j; } } |
Line 222 function findrow(jid) {
|
Line 294 function findrow(jid) {
|
} |
} |
|
|
// --------------------------------------------------------------- Find the col |
// --------------------------------------------------------------- Find the col |
|
|
function findcol(jid) { |
function findcol(jid) { |
var j; |
var j; |
for (j=0;j<=maxcol;j++) { if (col[j]==jid) { return j; } } |
for (j=0;j<=maxcol;j++) { if (col[j]==jid) { return j; } } |
Line 237 function findcol(jid) {
|
Line 308 function findcol(jid) {
|
// |
// |
// returns middle (col number of middle of obj1) |
// returns middle (col number of middle of obj1) |
// sets colmap (map of cols with object numbers) |
// sets colmap (map of cols with object numbers) |
|
|
function maprow (jid,obj1,ign) { |
function maprow (jid,obj1,ign) { |
var j; var k; var left; var right; var middle; |
var j; var k; var left; var right; var middle; |
middle=-1; |
middle=-1; |
for (j=0;j<=maxcol;j++) { colmap[j]=0; } |
for (j=0;j<=maxcol;j++) { colmap[j]=0; } |
if (rowcont[jid]!='') { |
if ((rowcont[jid]!='') && (typeof(rowcont[jid])!="undefined")) { |
data2=rowcont[jid].split(':'); |
data2=rowcont[jid].split(':'); |
for (j=0;j<data2.length;j++) { |
for (j=0;j<data2.length;j++) { |
data3=obj[data2[j]].split('&'); |
data3=obj[data2[j]].split('&'); |
Line 283 function maprow (jid,obj1,ign) {
|
Line 353 function maprow (jid,obj1,ign) {
|
// kid: colID, find point close to this |
// kid: colID, find point close to this |
// dkid: destination colID |
// dkid: destination colID |
// returns colID |
// returns colID |
|
|
function comingthru (jid,kid,dkid) { |
function comingthru (jid,kid,dkid) { |
var k; |
var k; |
maprow(jid,-1,1); |
maprow(jid,-1,1); |
Line 329 function comingthru (jid,kid,dkid) {
|
Line 398 function comingthru (jid,kid,dkid) {
|
// linkobj: object that the link goes to/comes from |
// linkobj: object that the link goes to/comes from |
// sets inrow or outrow |
// sets inrow or outrow |
// return column |
// return column |
|
|
|
|
function insertport (obj1,d,inout,linkobj) { |
function insertport (obj1,d,inout,linkobj) { |
|
|
|
|
var k; var port; var revport; |
var k; var port; var revport; |
stored=0; |
stored=0; |
data1=obj[obj1].split('&'); |
data1=obj[obj1].split('&'); |
Line 362 function insertport (obj1,d,inout,linkob
|
Line 427 function insertport (obj1,d,inout,linkob
|
if ((data3[k]==0) && (colmap[k]==obj1) && (port==-1)) { port=k; } |
if ((data3[k]==0) && (colmap[k]==obj1) && (port==-1)) { port=k; } |
} |
} |
} |
} |
|
|
if (port==-1) { |
if (port==-1) { |
if (colmap[k]==0) { |
if (colmap[k]==0) { |
revport=findcol(k); |
revport=findcol(k); |
Line 409 function insertport (obj1,d,inout,linkob
|
Line 473 function insertport (obj1,d,inout,linkob
|
|
|
// ---------------------------- Make a new object and add it to the row content |
// ---------------------------- Make a new object and add it to the row content |
// returns object number of generated object |
// returns object number of generated object |
|
|
function addobj(kjid,objs) { |
function addobj(kjid,objs) { |
stored=0; |
stored=0; |
if (rowcont[kjid]!='') { rowcont[kjid]+=':'; } |
expense++; |
|
if ((rowcont[kjid]!='') && (typeof(rowcont[kjid])!="undefined")) { |
|
rowcont[kjid]+=':'; |
|
} |
rowcont[kjid]+=obj.length; |
rowcont[kjid]+=obj.length; |
obj[obj.length]=objs; |
obj[obj.length]=objs; |
return obj.length-1; |
return obj.length-1; |
Line 420 function addobj(kjid,objs) {
|
Line 486 function addobj(kjid,objs) {
|
|
|
// ---------------------------------------- Make horizontal connection for hrid |
// ---------------------------------------- Make horizontal connection for hrid |
// hoffs=-1: this line goes on top of hrid |
// hoffs=-1: this line goes on top of hrid |
|
|
function horizontal(hrid,hoffs,hfcol,htcol,hdest,hends) { |
function horizontal(hrid,hoffs,hfcol,htcol,hdest,hends) { |
hcrid=-1; |
hcrid=-1; |
if (hoffs==-1) { |
if (hoffs==-1) { |
Line 447 function horizontal(hrid,hoffs,hfcol,htc
|
Line 512 function horizontal(hrid,hoffs,hfcol,htc
|
} |
} |
} |
} |
} |
} |
|
|
if (hcrid==-1) { |
if (hcrid==-1) { |
insertrow(row[hrid]+hoffs,hfcol,htcol); |
insertrow(row[hrid]+hoffs,hfcol,htcol); |
addobj(maxrow,'h&'+maxrow+'&'+hfcol+':'+htcol+'&'+hdest+'&'+hends); |
addobj(maxrow,'h&'+maxrow+'&'+hfcol+':'+htcol+'&'+hdest+'&'+hends); |
Line 457 function horizontal(hrid,hoffs,hfcol,htc
|
Line 521 function horizontal(hrid,hoffs,hfcol,htc
|
} |
} |
|
|
// --------------------------------------- Deletes all references to object obj |
// --------------------------------------- Deletes all references to object obj |
|
|
function delobj(obj1) { |
function delobj(obj1) { |
var k; |
var k; |
stored=0; |
stored=0; |
Line 466 function delobj(obj1) {
|
Line 529 function delobj(obj1) {
|
rowcont[k]=''; |
rowcont[k]=''; |
for (k2=0;k2<data4.length;k2++) { |
for (k2=0;k2<data4.length;k2++) { |
if (data4[k2]!=obj1) { |
if (data4[k2]!=obj1) { |
if (rowcont[k]!='') { rowcont[k]+=':'; } |
if ((rowcont[k]!='') && (typeof(rowcont[k])!="undefined")) { |
|
rowcont[k]+=':'; |
|
} |
rowcont[k]+=data4[k2]; |
rowcont[k]+=data4[k2]; |
} |
} |
} |
} |
} |
} |
|
obj[obj1]=''; |
} |
} |
|
|
// --------------------------------------------------------- Garbage collection |
// --------------------------------------------------------- Garbage collection |
|
|
function cleanup () { |
function cleanup () { |
message("Garbage Collection"); |
message("Garbage Collection"); |
var j,kj,i; |
var j,kj,i; |
disrows=0; |
disrows=0; |
discols=0; |
discols=0; |
|
var emptyspots=0; |
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; |
if (rowcont[kj]!='') { |
if ((rowcont[kj]!='') && (typeof(rowcont[kj])!="undefined")) { |
data2=rowcont[kj].split(':'); |
data2=rowcont[kj].split(':'); |
for (j=0;j<data2.length;j++) { |
for (j=0;j<data2.length;j++) { |
if (obj[data2[j]].substring(0,2)=='e&') { |
if (obj[data2[j]].substring(0,2)=='e&') { |
Line 510 function cleanup () {
|
Line 569 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 524 function cleanup () {
|
Line 584 function cleanup () {
|
if (rowtype[j]==2) { disrows+=3; } |
if (rowtype[j]==2) { disrows+=3; } |
if (rowtype[j]==1) { disrows+=1; } |
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 |
|
|
function delcond(obj1,colid) { |
function delcond(obj1,colid) { |
var k; |
var k; |
stored=0; |
stored=0; |
Line 535 function delcond(obj1,colid) {
|
Line 603 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]; |
} |
} |
Line 543 function delcond(obj1,colid) {
|
Line 615 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) { |
var k; |
var k; |
data3=obj[obj1].split('&'); |
data3=obj[obj1].split('&'); |
Line 565 function crecond(obj1,colid,condtext,con
|
Line 636 function crecond(obj1,colid,condtext,con
|
// deletes the link linknr |
// deletes the link linknr |
// h&rowID&incolID:outcolID&inObj:outObj&inupdown:outupdown |
// h&rowID&incolID:outcolID&inObj:outObj&inupdown:outupdown |
// v&colID&inObj:outObj&updown |
// v&colID&inObj:outObj&updown |
|
|
function dellink (linknr) { |
function dellink (linknr) { |
var k; var obj1; var obj2; |
var k; var obj1; var obj2; |
stored=0; |
stored=0; |
if (objlinks[linknr]!='') { |
if ((objlinks[linknr]!='') && (typeof(objlinks[linknr])!="undefined")) { |
data3=objlinks[linknr].split(':'); |
data3=objlinks[linknr].split(':'); |
obj1=data3[0]; |
obj1=data3[0]; |
obj2=data3[1]; |
obj2=data3[1]; |
Line 592 function dellink (linknr) {
|
Line 662 function dellink (linknr) {
|
} |
} |
} |
} |
for (k=0;k<obj.length;k++) { |
for (k=0;k<obj.length;k++) { |
if (obj[k]!='') { |
if ((obj[k]!='') && (typeof(obj[k])!="undefined")) { |
data3=obj[k].split('&'); |
data3=obj[k].split('&'); |
if (((data3[0]=='v') || (data3[0]=='h')) && |
if (((data3[0]=='v') || (data3[0]=='h')) && |
(data3[data3.length-2]==linknr)) { |
(data3[data3.length-2]==linknr)) { |
Line 606 function dellink (linknr) {
|
Line 676 function dellink (linknr) {
|
|
|
// ----------------------------------------------------------- Join two objects |
// ----------------------------------------------------------- Join two objects |
// 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; var dest; |
|
|
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 713 function joinres (obj1,obj2,cond) {
|
Line 822 function joinres (obj1,obj2,cond) {
|
// ---------------------------------------------------------- Delete a resource |
// ---------------------------------------------------------- Delete a resource |
// Deletes resource obj1 |
// Deletes resource obj1 |
// Reconnects resources going thru this one if recon=1 |
// Reconnects resources going thru this one if recon=1 |
|
|
function delres (obj1,recon) { |
function delres (obj1,recon) { |
var infromobj=new Array(); |
var infromobj=new Array(); |
var inwithcon=new Array(); |
var inwithcon=new Array(); |
Line 760 function delres (obj1,recon) {
|
Line 868 function delres (obj1,recon) {
|
for (k2=0;k2<inobjs.length;k2++) { |
for (k2=0;k2<inobjs.length;k2++) { |
if (inobjs[k2]==infromobj[k]) { |
if (inobjs[k2]==infromobj[k]) { |
if (inwithcon[k]!=0) { |
if (inwithcon[k]!=0) { |
if (inobjscond[k2]!='') { inobjscond[k2]+='||'; } |
if ((inobjscond[k2]!='') && |
|
(typeof(inobjscond[k2])!="undefined")) { |
|
inobjscond[k2]+='||'; |
|
} |
inobjscond[k2]+= |
inobjscond[k2]+= |
'('+(objcont[inwithcon[k]].split(':'))[0]+')'; |
'('+(objcont[inwithcon[k]].split(':'))[0]+')'; |
} |
} |
Line 786 function delres (obj1,recon) {
|
Line 897 function delres (obj1,recon) {
|
for (k2=0;k2<outobjs.length;k2++) { |
for (k2=0;k2<outobjs.length;k2++) { |
if (outobjs[k2]==outtoobj[k]) { |
if (outobjs[k2]==outtoobj[k]) { |
if (outwithcon[k]!=0) { |
if (outwithcon[k]!=0) { |
if (outobjscond[k2]!='') { outobjscond[k2]+='||'; } |
if ((outobjscond[k2]!='') && |
|
(typeof(outobjscond[k2])!="undefined")) { |
|
outobjscond[k2]+='||'; |
|
} |
outobjscond[k2]+= |
outobjscond[k2]+= |
'('+(objcont[outwithcon[k]].split(':'))[0]+')'; |
'('+(objcont[outwithcon[k]].split(':'))[0]+')'; |
} |
} |
Line 808 function delres (obj1,recon) {
|
Line 922 function delres (obj1,recon) {
|
|
|
for (k=0;k<inobjs.length;k++) { |
for (k=0;k<inobjs.length;k++) { |
cond=''; |
cond=''; |
if (inobjscond[k]!='') { cond='('+inobjscond[k]+')'; } |
if ((inobjscond[k]!='') && (typeof(inobjscond[k])!="undefined")) { |
|
cond='('+inobjscond[k]+')'; |
|
} |
for (k2=0;k2<outobjs.length;k2++) { |
for (k2=0;k2<outobjs.length;k2++) { |
thiscond=cond; |
thiscond=cond; |
if (outobjscond[k2]!='') { |
if ((outobjscond[k2]!='') && (typeof(outobjscond[k2])!="undefined")) { |
if (thiscond!='') { thiscond+='&&'; } |
if ((thiscond!='') && (typeof(thiscond)!="undefined")) { |
|
thiscond+='&&'; |
|
} |
thiscond+='('+outobjscond[k2]+')'; |
thiscond+='('+outobjscond[k2]+')'; |
} |
} |
condnr=0; |
condnr=0; |
if (thiscond!='') { condnr=newcondition(thiscond,'normal'); } |
if ((thiscond!='') && (typeof(thiscond)!="undefined")) { |
|
condnr=newcondition(thiscond,'normal'); |
|
} |
|
save(); |
joinres(inobjs[k],outobjs[k2],condnr); |
joinres(inobjs[k],outobjs[k2],condnr); |
} |
} |
} |
} |
Line 824 function delres (obj1,recon) {
|
Line 945 function delres (obj1,recon) {
|
} |
} |
|
|
// -------------------------------------------------------------- Draw an entry |
// -------------------------------------------------------------- Draw an entry |
|
|
function drawcell (rtype,ctype,what,cm,obj1,ej,ek,ne) { |
function drawcell (rtype,ctype,what,cm,obj1,ej,ek,ne) { |
var bgcolor; |
var bgcolor; |
|
var url=''; |
|
var urlparts=new Array; |
|
var mime; |
|
var ext; |
|
var objref; |
|
var objnum; |
|
|
|
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!='') && (typeof(what)!="undefined")) { |
if (obj1!='') { |
if ((obj1!='') && (typeof(obj1)!="undefined")) { |
obj1="'"+obj1+"'"; |
objref="'"+obj1+"'"; |
parent.mapout.document.write |
parent.mapout.document.write |
('<a href="javascript:parent.code.handler('+obj1 |
('<a href="javascript:parent.code.handler('+objref |
+');" onMouseOver="parent.code.info('+obj1+');">'); |
+');" onMouseOver="parent.code.info('+objref+');">'); |
} |
} |
if (what=='r:') { |
if (what=='r:') { |
|
mime=''; |
|
objnum=(obj1.split('&'))[1]; |
|
if (typeof(objcont[objnum])!="undefined") { |
|
urlparts=objcont[objnum].split(':'); |
|
url=urlparts[1]; |
|
ext=urlparts[2]; |
|
urlparts=url.split('.'); |
|
mime=urlparts[urlparts.length-1]; |
|
if (typeof(mime)=="undefined") { mime=''; } |
|
} |
parent.mapout.document.write |
parent.mapout.document.write |
('<img border=0 src="resource.gif">'); |
('<img border=0 width='+cw[ctype]+' height='+rh[1] |
|
+' src="'+raticons+'resource.gif">'); |
|
if ((mime!='') && (ext!='true')) { |
|
parent.mapout.document.write |
|
('<br><img border=0 src="'+raticons+'left.gif"></a><a target="preview" href="'+ |
|
url+'.meta"><img border=0 src="'+iconpath+ |
|
'meta.gif"><a target="preview" href="'+url+ |
|
'"><img border=0 src="'+iconpath+mime+'.gif">'+ |
|
'<img border=0 src="'+raticons+'right.gif">'); |
|
} else { |
|
parent.mapout.document.write |
|
('<br><img border=0 src="'+raticons+'middle.gif">'); |
|
} |
|
parent.mapout.document.write |
|
('<br><img border=0 src="'+raticons+'bottom.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="'+raticons+'condition.gif">'); |
|
} else { |
|
if (what=='rs:') { |
|
mime=''; |
|
objnum=(obj1.split('&'))[1]; |
|
if (typeof(objcont[objnum])!="undefined") { |
|
urlparts=objcont[objnum].split(':'); |
|
url=urlparts[1]; |
|
ext=urlparts[2]; |
|
urlparts=url.split('.'); |
|
mime=urlparts[urlparts.length-1]; |
|
if (typeof(mime)=="undefined") { mime=''; } |
|
} |
|
parent.mapout.document.write |
|
('<img border=0 width='+cw[ctype]+' height='+rh[1] |
|
+' src="'+raticons+'start.gif">'); |
|
if ((mime!='') && (ext!='true')) { |
|
parent.mapout.document.write |
|
('<br><img border=0 src="'+raticons+'left.gif"></a><a target="preview" href="'+ |
|
url+'.meta"><img border=0 src="'+iconpath+ |
|
'meta.gif"><a target="preview" href="'+url+ |
|
'"><img border=0 src="'+iconpath+mime+'.gif">'+ |
|
'<img border=0 src="'+raticons+'right.gif">'); |
} else { |
} else { |
parent.mapout.document.write |
parent.mapout.document.write |
('<img border=0 src="'+rtype+'.'+ctype+'.'+what+'.gif">'); |
('<br><img border=0 src="'+raticons+'middle.gif">'); |
|
} |
|
parent.mapout.document.write |
|
('<br><img border=0 src="'+raticons+'bottom.gif">'); |
|
|
|
} else { |
|
if (what=='rf:') { |
|
mime=''; |
|
objnum=(obj1.split('&'))[1]; |
|
if (typeof(objcont[objnum])!="undefined") { |
|
urlparts=objcont[objnum].split(':'); |
|
url=urlparts[1]; |
|
ext=urlparts[2]; |
|
urlparts=url.split('.'); |
|
mime=urlparts[urlparts.length-1]; |
|
if (typeof(mime)=="undefined") { mime=''; } |
|
} |
|
parent.mapout.document.write |
|
('<img border=0 width='+cw[ctype]+' height='+rh[1] |
|
+' src="'+raticons+'finish.gif">'); |
|
if ((mime!='') && (ext!='true')) { |
|
parent.mapout.document.write |
|
('<br><img border=0 src="'+raticons+'left.gif"></a><a target="preview" href="'+ |
|
url+'.meta"><img border=0 src="'+iconpath+ |
|
'meta.gif"><a target="preview" href="'+url+ |
|
'"><img border=0 src="'+iconpath+mime+'.gif">'+ |
|
'<img border=0 src="'+raticons+'right.gif">'); |
|
} else { |
|
parent.mapout.document.write |
|
('<br><img border=0 src="'+raticons+'middle.gif">'); |
|
} |
|
parent.mapout.document.write |
|
('<br><img border=0 src="'+raticons+'bottom.gif">'); |
|
} else { |
|
parent.mapout.document.write |
|
('<img border=0 width='+cw[ctype]+' height='+rh[rtype] |
|
+' src="'+raticons+rtype+'.'+ctype+'.'+what+'.gif">'); |
|
} |
|
} |
} |
} |
} |
} |
if (obj1!='') { |
if ((obj1!='') && (typeof(obj1)!="undefined")) { |
parent.mapout.document.write('</a>'); |
parent.mapout.document.write('</a>'); |
} |
} |
} else { |
} else { |
Line 862 function drawcell (rtype,ctype,what,cm,o
|
Line 1075 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="'+raticons+rtype+'.'+ctype+'.empty.gif"></a>'); |
} |
} |
parent.mapout.document.write('</td>'); |
parent.mapout.document.write('</td>'); |
} |
} |
} |
} |
|
|
// ----------------------------------------------------------------- Draw a row |
// --------------------------------------------------------- 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 |
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 884 if (rowtype[jid]!=0) {
|
Line 1115 if (rowtype[jid]!=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]!='') && (typeof(rowcont[jid])!="undefined")) { |
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') { |
data1=objcont[data2[jk]].split(':'); |
data1=objcont[data2[jk]].split(':'); |
if (data1[2]=='true') { bc='55'; } else { bc='11'; } |
rtype=data1[3]; |
if (data1[3]=='mandatory') { rc='BB'; } else { rc='55'; } |
ck=rescolor(data1[2],data1[3]); |
if (data1[3]=='optional') { gc='66'; } else { gc='AA'; } |
|
ck='#'+rc+gc+bc; |
|
left=maxcol; |
left=maxcol; |
leftin=maxcol; |
leftin=maxcol; |
leftout=maxcol; |
leftout=maxcol; |
Line 917 if (rowtype[jid]!=0) {
|
Line 1146 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 932 if (rowtype[jid]!=0) {
|
Line 1159 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) { |
for (k=middle+1;k<rightin;k++) { |
for (k=middle+1;k<rightin;k++) { |
if (colmap4[k]!='') { |
if ((colmap4[k]!='') && (typeof(colmap4[k])!="undefined")) { |
colmap[k]='rlt'; |
colmap[k]='rlt'; |
} else { |
} else { |
colmap[k]='rl'; |
colmap[k]='rl'; |
Line 947 if (rowtype[jid]!=0) {
|
Line 1182 if (rowtype[jid]!=0) {
|
} |
} |
if (leftin<middle) { |
if (leftin<middle) { |
for (k=middle-1;k>leftin;k--) { |
for (k=middle-1;k>leftin;k--) { |
if (colmap4[k]!='') { |
if ((colmap4[k]!='') && (typeof(colmap4[k])!="undefined")) { |
colmap[k]='lrt'; |
colmap[k]='lrt'; |
} else { |
} else { |
colmap[k]='lr'; |
colmap[k]='lr'; |
Line 967 if (rowtype[jid]!=0) {
|
Line 1202 if (rowtype[jid]!=0) {
|
if (rightout<middle) { colmap2[middle]='tl'; } |
if (rightout<middle) { colmap2[middle]='tl'; } |
if (rightout==middle) { colmap2[middle]='tdl'; } |
if (rightout==middle) { colmap2[middle]='tdl'; } |
if (rightout>middle) { |
if (rightout>middle) { |
if (colmap3[middle]!='') { |
if ((colmap3[middle]!='') && (typeof(colmap3[middle])!="undefined")) { |
colmap2[middle]='rtdl'; |
colmap2[middle]='rtdl'; |
} else { |
} else { |
colmap2[middle]='rtl'; |
colmap2[middle]='rtl'; |
Line 976 if (rowtype[jid]!=0) {
|
Line 1211 if (rowtype[jid]!=0) {
|
} |
} |
if (leftout<middle) { |
if (leftout<middle) { |
for (k=middle-1;k>leftout;k--) { |
for (k=middle-1;k>leftout;k--) { |
if (colmap3[k]!='') { |
if ((colmap3[k]!='') && (typeof(colmap3[k])!="undefined")) { |
colmap2[k]='rld'; |
colmap2[k]='rld'; |
} else { |
} else { |
colmap2[k]='rl'; |
colmap2[k]='rl'; |
Line 986 if (rowtype[jid]!=0) {
|
Line 1221 if (rowtype[jid]!=0) {
|
} |
} |
if (rightout>middle) { |
if (rightout>middle) { |
for (k=middle+1;k<rightout;k++) { |
for (k=middle+1;k<rightout;k++) { |
if (colmap3[k]!='') { |
if ((colmap3[k]!='') && (typeof(colmap3[k])!="undefined")) { |
colmap2[k]='lrd'; |
colmap2[k]='lrd'; |
} else { |
} else { |
colmap2[k]='lr'; |
colmap2[k]='lr'; |
Line 1011 if (rowtype[jid]!=0) {
|
Line 1246 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 1048 if (rowtype[jid]!=0) {
|
Line 1286 if (rowtype[jid]!=0) {
|
} |
} |
if (rowtype[jid]==2) { |
if (rowtype[jid]==2) { |
parent.mapout.document.writeln('</tr>'); |
parent.mapout.document.writeln('</tr>'); |
parent.mapout.document.writeln('<tr height=30>'); |
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, |
drawcell(1,coltype[rcol[k]],colmap2[k],colmap5[k],objd2[k],jid,k, |
notempty[k]); |
notempty[k]); |
} |
} |
parent.mapout.document.writeln('</tr>'); |
parent.mapout.document.writeln('</tr>'); |
parent.mapout.document.writeln('<tr height=30>'); |
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, |
drawcell(1,coltype[rcol[k]],colmap3[k],colmap6[k],objd2[k],jid,k, |
notempty[k]); |
notempty[k]); |
Line 1066 if (rowtype[jid]!=0) {
|
Line 1304 if (rowtype[jid]!=0) {
|
} |
} |
|
|
// -------------------------------------------------------------- Print message |
// -------------------------------------------------------------- Print message |
|
|
function message(txt) { |
function message(txt) { |
parent.window.status=txt; |
parent.window.status=txt; |
} |
} |
|
|
// ------------------------------------------------------------- Draw the table |
// ------------------------------------------------------------- Draw the table |
|
|
function draw () { |
function draw () { |
var k; var kr; |
var k; var kr; |
|
|
Line 1080 function draw () {
|
Line 1316 function draw () {
|
save(); |
save(); |
|
|
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.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">'); |
|
|
Line 1093 function draw () {
|
Line 1329 function draw () {
|
if (graphdef=='no') { graphopt(); cleanup(); } |
if (graphdef=='no') { graphopt(); cleanup(); } |
for (k=0;k<=maxrow;k++) { rrow[row[k]]=k; } |
for (k=0;k<=maxrow;k++) { rrow[row[k]]=k; } |
for (k=0;k<=maxcol;k++) { rcol[col[k]]=k; } |
for (k=0;k<=maxcol;k++) { rcol[col[k]]=k; } |
parent.mapout.document.writeln( |
parent.mapout.document.writeln( |
'<table cellpadding=0 cellspacing=0 border=0 rows=' |
'<table cellpadding=0 cellspacing=0 border=0 rows=' |
+disrows+' cols='+discols+'>'); |
+disrows+' cols='+discols+'>'); |
for (kr=0;kr<=maxrow;kr++) { |
for (kr=0;kr<=maxrow;kr++) { |
message("Generating Output Row "+kr); |
message("Generating Output Row "+kr); |
drawrow(rrow[kr]); |
drawrow(rrow[kr]); |
} |
} |
} else { |
} else { |
message("Generating Table Output"); |
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>'); |
parent.mapout.document.writeln( '<table>'); |
tabledraw(); |
if (tablemode==1) { |
|
tabledraw(); |
|
} else { |
|
simpletabledraw(); |
|
} |
} |
} |
|
|
parent.mapout.document.writeln('</table>'); |
parent.mapout.document.writeln('</table>'); |
Line 1114 function draw () {
|
Line 1357 function draw () {
|
} |
} |
|
|
// --------------------------------------------------------- Clears info window |
// --------------------------------------------------------- Clears info window |
|
|
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 { |
} else { |
|
if (tablemode==0) { |
inf.document.writeln( |
inf.document.writeln( |
'<td><b>Click to Edit</b><hr>Click to insert resources, columns and rows</td>' |
'<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(); |
parent.focus(); |
if (srchflag==1) { |
|
srchclose(); |
|
} |
|
if (idxflag==1) { |
|
idxclose(); |
|
} |
|
if (parmflag==1) { |
|
parmclose(); |
|
} |
|
parent.top.focus(); |
parent.mapout.focus(); |
parent.mapout.focus(); |
notclear=1; |
notclear=1; |
lastinfo=''; |
lastinfo=''; |
} |
} |
} |
} |
|
|
// --------------------------------------------------- Prints out resource info |
// ------------------------------------------------------------ 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 |
function info(infostr) { |
function info(infostr) { |
|
var mime=''; |
|
var ext; |
|
var urlparts=new Array; |
|
var url=''; |
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">'+ |
'<table><tr><td width=32><img src="info.gif"></td><td bgcolor="#AAFFAA">'); |
'<table><tr><td width=32><img src="'+raticons+'info.gif"></td><td bgcolor="#AAFFAA">'); |
data1=infostr.split('&'); |
data1=infostr.split('&'); |
if (data1[0]=='c') { |
if (data1[0]=='c') { |
inf.document.write('<b>Condition ('); |
inf.document.write('<b>Condition ('); |
Line 1176 function info(infostr) {
|
Line 1452 function info(infostr) {
|
} else { |
} else { |
if (data1[0]=='r') { |
if (data1[0]=='r') { |
data2=objcont[data1[1]].split(':'); |
data2=objcont[data1[1]].split(':'); |
inf.document.write('<b>'); |
url=data2[1]; |
|
ext=data2[2]; |
|
urlparts=url.split('.'); |
|
mime=urlparts[urlparts.length-1]; |
|
if (typeof(mime)=="undefined") { mime=''; } |
|
if (ext=='true') { mime=''; } |
|
if (mime!='') { |
|
inf.document.write |
|
('<br><a target="preview" align="right" href="'+url+ |
|
'"><img border=0 src="'+iconpath+mime+'.gif"></a> '); |
|
} |
|
inf.document.write('<b>'); |
if (data2[2]=='true') { inf.document.write('External '); } |
if (data2[2]=='true') { inf.document.write('External '); } |
inf.document.write('Resource'); |
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') { |
if (data2[3]=='mandatory') { |
inf.document.write(' (Mandatory)'); |
inf.document.write(' (Mandatory)'); |
} |
} |
Line 1206 function info(infostr) {
|
Line 1501 function info(infostr) {
|
} |
} |
inf.document.writeln('</td></tr></table></body></html>'); |
inf.document.writeln('</td></tr></table></body></html>'); |
inf.document.close(); |
inf.document.close(); |
parent.focus(); |
parent.top.focus(); |
parent.mapout.focus(); |
parent.mapout.focus(); |
notclear=0; |
notclear=0; |
lastinfo=infostr; |
lastinfo=infostr; |
Line 1214 function info(infostr) {
|
Line 1509 function info(infostr) {
|
} |
} |
|
|
// ------------------------------------------------ "Escapes" out special chars |
// ------------------------------------------------ "Escapes" out special chars |
|
|
function escape(instring) { |
function escape(instring) { |
var outstring=''; |
var outstring=''; |
var thischar; |
var thischar; |
Line 1222 function escape(instring) {
|
Line 1516 function escape(instring) {
|
for (k=0;k<instring.length;k++) { |
for (k=0;k<instring.length;k++) { |
thischar=instring.charAt(k); |
thischar=instring.charAt(k); |
if (thischar==':') { thischar=':'; } |
if (thischar==':') { thischar=':'; } |
if (thischar=='"') { thischar='"'; } |
if (thischar=='"') { thischar='"'; }// " |
if (thischar=="'") { thischar='''; } |
if (thischar=="'") { thischar='''; } |
if (thischar==',') { thischar=','; } |
if (thischar==',') { thischar=','; } |
outstring+=thischar; |
outstring+=thischar; |
Line 1231 function escape(instring) {
|
Line 1525 function escape(instring) {
|
} |
} |
|
|
// -------------------------------------------------- Insert resource into link |
// -------------------------------------------------- Insert resource into link |
|
|
function insertreslink(infostr) { |
function insertreslink(infostr) { |
var lnr; |
var lnr; |
var fobj; |
var fobj; |
var tobj; |
var tobj; |
var nobj; |
var nobj; |
var cobj; |
var cobj; |
|
var cid; |
|
var rid; |
data1=infostr.split('&'); |
data1=infostr.split('&'); |
data2=obj[data1[0]].split('&'); |
data2=obj[data1[0]].split('&'); |
lnr=data2[data2.length-2]; |
lnr=data2[data2.length-2]; |
Line 1255 function insertreslink(infostr) {
|
Line 1550 function insertreslink(infostr) {
|
dellink(lnr); |
dellink(lnr); |
newresource(rid,cid,'','','false','normal'); |
newresource(rid,cid,'','','false','normal'); |
nobj=obj.length-1; |
nobj=obj.length-1; |
|
save(); |
joinres(fobj,nobj,cobj); |
joinres(fobj,nobj,cobj); |
|
save(); |
joinres(nobj,tobj,0); |
joinres(nobj,tobj,0); |
} |
} |
|
|
// ---------------------------------------------------- Handles "click to edit" |
// -------------------------------------------- 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; |
|
save(); |
|
joinres(fobj,nobj,cobj); |
|
save(); |
|
joinres(nobj,tobj,0); |
|
} |
|
|
|
// ------------------------------------------------------ Clears indexer window |
|
function idxclear() { |
|
idx.document.clear(); |
|
} |
|
|
|
// --------------------------------------------------------- Clears copy window |
|
function copydxclear() { |
|
copydx.document.clear(); |
|
} |
|
// ------------------------------------------------------- Clears search window |
|
function srchclear() { |
|
srch.document.clear(); |
|
} |
|
|
|
// --------------------------------------------------------- Clears parm window |
|
function parmclear() { |
|
parm.document.clear(); |
|
} |
|
|
|
// ------------------------------------------------------ Closes indexer window |
|
function idxclose() { |
|
if (idx && !idx.closed) { |
|
idxflag=0; |
|
idx.close(); |
|
} |
|
} |
|
|
|
// --------------------------------------------------------- Closes copy window |
|
function copydxclose() { |
|
if (copydx && !copydx.closed) { |
|
copydxflag=0; |
|
copydx.close(); |
|
} |
|
} |
|
|
|
// ------------------------------------------------------- Closes search window |
|
function srchclose() { |
|
if (srch && !srch.closed) { |
|
srchflag=0; |
|
srch.close(); |
|
} |
|
} |
|
|
|
// ------------------------------------------------------- Closes search window |
|
function parmclose() { |
|
if (parm && !parm.closed) { |
|
parmflag=0; |
|
parm.close(); |
|
} |
|
} |
|
|
|
// -------------------------------------------------------- Open indexer window |
|
function idxopen(mode) { |
|
var options="scrollbars=1,resizable=1,menubar=0"; |
|
idxmode=mode; |
|
idxflag=1; |
|
idx=open("/res/?launch=1&mode=rat&catalogmode="+mode,"idxout",options); |
|
idx.focus(); |
|
} |
|
// ------------------------------------------------- Open browser to select map |
|
var editbrowser; |
|
function openbrowser(formname,elementname,only,omit) { |
|
var url = '/res/?'; |
|
if (editbrowser == null) { |
|
url += 'launch=1&'; |
|
} |
|
url += 'catalogmode=interactive&'; |
|
url += 'mode=edit&'; |
|
url += 'form=' + formname + '&'; |
|
if (only != null) { |
|
url += 'only=' + only + '&'; |
|
} |
|
if (omit != null) { |
|
url += 'omit=' + omit + '&'; |
|
} |
|
url += 'element=' + elementname + ''; |
|
var title = 'Browser'; |
|
var options = 'scrollbars=1,resizable=1,menubar=0'; |
|
options += ',width=700,height=600'; |
|
editbrowser = copydx.open(url,title,options,'1'); |
|
editbrowser.focus(); |
|
} |
|
// ----------------------------------------------------------- Open copy window |
|
function copydxopen(mode) { |
|
var options="scrollbars=1,resizable=1,menubar=0"; |
|
copydxmode=mode; |
|
copydxflag=1; |
|
copydx=open("",'copydxout',options); |
|
copydx.document.clear(''); |
|
copydx.document.writeln( |
|
'<html><body bgcolor="#FFFFFF"><h1>Group Copy from Map</h1>'+ |
|
'<form name="mapload"><input type=text size=40 name=importmap>'+ |
|
'<input type=button onClick="javascript:opener.openbrowser'+ |
|
"('mapload','importmap','sequence,page','')"+ |
|
'" value="Browse"><input type=button value="Load Map" '+ |
|
'onClick="window.location=document.mapload.importmap.value+'+ |
|
"'?launch=1&forceselect=1'"+'"></form>'); |
|
|
|
copydx.document.writeln('</body></html>'); |
|
copydx.focus(); |
|
} |
|
|
|
// --------------------------------------------------------- Open search window |
|
function srchopen(mode) { |
|
var options="scrollbars=1,resizable=1,menubar=0"; |
|
srchmode=mode; |
|
srchflag=1; |
|
srch=open("/adm/searchcat?launch=1&mode=rat&catalogmode="+mode,"srchout",options); |
|
srch.focus(); |
|
} |
|
|
|
// -------------------------------------------- Interface function to searching |
|
function search() { |
|
alert("Searching not yet implemented"); |
|
} |
|
|
|
// ------------------------------------------------------- Do srch status check |
|
function srchcheck(mode) { |
|
if (!srch || srch.closed || srchmode!=mode) { |
|
srchopen(mode); |
|
} |
|
srch.focus(); |
|
} |
|
|
|
// -------------------------------------------------------- Do idx status check |
|
function idxcheck(mode) { |
|
if (!idx || idx.closed || idxmode!=mode) { |
|
idxopen(mode); |
|
} |
|
idx.focus(); |
|
} |
|
|
|
// -------------------------------------------------------- Do idx status check |
|
function copydxcheck(mode) { |
|
if (!copydx || copydx.closed || copydxmode!=mode) { |
|
copydxopen(mode); |
|
} |
|
copydx.focus(); |
|
} |
|
|
|
// ---------------------------------------------------- Handles "click to edit" |
function handler(infostr) { |
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">'+ |
'<table><tr><td width=32><img src="edit.gif"></td><td bgcolor="#AAFFAA">'); |
'<table><tr><td width=32><img src="'+raticons+'edit.gif"></td><td bgcolor="#AAFFAA">'); |
data1=infostr.split('&'); |
data1=infostr.split('&'); |
if (data1[0]=='c') { |
if (data1[0]=='c') { |
inf.document.writeln('<b>Condition</b><hr>'); |
inf.document.writeln('<b>Condition</b><hr>'); |
Line 1307 function handler(infostr) {
|
Line 1763 function handler(infostr) {
|
} |
} |
inf.document.writeln( |
inf.document.writeln( |
'opener.infoclear();opener.editmode=0;opener.draw(' |
'opener.infoclear();opener.editmode=0;opener.draw(' |
+');"><b>Change to above values</b></a> ' |
+');"><b>Save Changes</b></a> ' |
+' <a href="javascript:self.document.forms.condinfo.reset()">Reset</a><br>' |
+' <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]+'>'); |
|
|
Line 1319 function handler(infostr) {
|
Line 1775 function handler(infostr) {
|
'<a href="javascript:opener.notclear=0;opener.infoclear();' |
'<a href="javascript:opener.notclear=0;opener.infoclear();' |
+'opener.dellink('+data1[3]+');opener.editmode=0;opener.draw(' |
+'opener.dellink('+data1[3]+');opener.editmode=0;opener.draw(' |
+');">Delete Link</a>'); |
+');">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 { |
} else { |
if (data1[0]=='r') { |
if (data1[0]=='r') { |
if (linkmode!=0) { |
if (linkmode!=0) { |
Line 1329 function handler(infostr) {
|
Line 1790 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 colspan=2>' |
+'<input type=text name=t size=30 value="' |
+'<input type=text name=t size=30 value="' |
+data2[0]+'"></td></tr><tr><td>URL:</td><td>' |
+escape(data2[0])+'"><input type=hidden name=h value='+data2[3]+'></td></tr>'); |
|
inf.document.write('<tr><td>URL:</td><td colspan=2>' |
+'<input type=text name=u size=30 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.write('></td></tr>' |
inf.document.write('></td><td align=right>' |
+'<tr><td colspan=2><input type=hidden name=h value='+data2[3] |
+'<a href="javascript:opener.idxcheck(\'interactive\')">Browse</a> ' |
+'><input type=radio name=y value=normal '+ |
+'<a href="javascript:opener' |
|
+'.srchcheck(\'interactive\')">Search</a></td></tr>'); |
|
if ((data2[3]!='start') && (data2[3]!='finish')) { |
|
inf.document.write('<tr><td colspan=3>' |
|
+'<input type=radio name=y value=normal '+ |
'onClick="self.document.forms.resinfo.elements.h.value='+"'normal'"+'"'); |
'onClick="self.document.forms.resinfo.elements.h.value='+"'normal'"+'"'); |
if (data2[3]=='normal') { inf.document.write(' checked'); } |
if (data2[3]=='normal') { inf.document.write(' checked'); } |
inf.document.write( |
inf.document.write( |
Line 1351 function handler(infostr) {
|
Line 1825 function handler(infostr) {
|
'> Mandatory <input type=radio name=y value=optional '+ |
'> Mandatory <input type=radio name=y value=optional '+ |
'onClick="self.document.forms.resinfo.elements.h.value='+"'optional'"+'"'); |
'onClick="self.document.forms.resinfo.elements.h.value='+"'optional'"+'"'); |
if (data2[3]=='optional') { inf.document.write(' checked'); } |
if (data2[3]=='optional') { inf.document.write(' checked'); } |
inf.document.write('> Optional</td></tr>' |
inf.document.write('> Optional</td></tr>'); |
+'<tr><td colspan=2><a href="javascript:opener.editmode=0;' |
} |
|
inf.document.writeln( |
|
'<tr><td colspan=3><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+'+"':'" |
+'+self.document.forms.resinfo.elements.e.checked+'+"':'" |
+'+self.document.forms.resinfo.elements.h.value+'+"':res'" |
+'+self.document.forms.resinfo.elements.h.value+'+"':res'" |
+';opener.infoclear();opener.editmode=0;opener.draw();">' |
+';opener.infoclear();opener.editmode=0;opener.draw();">' |
+'<b>Change to above values</b></a> ' |
+'<b>Save Changes</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>'); |
+'</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 1370 function handler(infostr) {
|
Line 1847 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>'); |
|
} |
|
inf.document.writeln( |
|
'<br><a href="javascript:' |
|
+'opener.setparms('+data1[1]+');' |
|
+'opener.infoclear();">Set Parameters</a>'); |
|
|
} |
} |
} else { |
} else { |
linkmode=0; |
linkmode=0; |
Line 1394 function handler(infostr) {
|
Line 1879 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();">Cancel</a>'); |
inf.document.writeln('</form></td></tr></table></body></html>'); |
inf.document.writeln('</form></td></tr></table></body></html>'); |
inf.document.close(); |
inf.document.close(); |
inf.focus(); |
inf.focus(); |
} |
} |
|
|
// ----------------------------------------------------- Clicks on empty fields |
// ----------------------------------------------------- Clicks on empty fields |
|
|
function empty(rid,k) { |
function empty(rid,k) { |
var cid=findcol(k); |
var cid=findcol(k); |
var lcol=k-1; |
var lcol=k-1; |
Line 1410 function empty(rid,k) {
|
Line 1894 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">'+ |
'<table><tr><td width=32><img src="edit.gif"></td><td bgcolor="#AAFFAA">'+ |
'<table><tr><td width=32><img src="'+raticons+'edit.gif"></td><td bgcolor="#AAFFAA">'+ |
'<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('+ |
Line 1424 function empty(rid,k) {
|
Line 1907 function empty(rid,k) {
|
'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</a>'); |
|
|
if ((mostrecent!=0) && (objcont[mostrecent]!='')) { |
if ((mostrecent!=0) && (objcont[mostrecent]!='') && |
|
(typeof(objcont[mostrecent])!="undefined")) { |
|
|
inf.document.writeln('<br><a href="javascript:opener.newresource('+ |
inf.document.writeln('<br><a href="javascript:opener.newresource('+ |
rid+','+cid+",'','','false','normal');"+ |
rid+','+cid+",'','','false','normal');"+ |
Line 1464 function empty(rid,k) {
|
Line 1948 function empty(rid,k) {
|
|
|
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();">Cancel</a>'); |
inf.document.writeln('</td></tr></table></body></html>'); |
inf.document.writeln('</td></tr></table></body></html>'); |
inf.document.close(); |
inf.document.close(); |
inf.focus(); |
inf.focus(); |
} |
} |
|
|
// ---------------------------------------------------- Save into hidden fields |
// ---------------------------------------------------- Save into hidden fields |
|
|
function save() { |
function save() { |
var k; |
var k; |
if (graphdef=='yes') { |
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 1498 function save() {
|
Line 1981 function save() {
|
'<&>maxcol<:>'+maxcol; |
'<&>maxcol<:>'+maxcol; |
parent.server.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
'<&>maxrow<:>'+maxrow; |
'<&>maxrow<:>'+maxrow; |
} else { |
parent.server.document.forms.storage.output.value+= |
|
'<&>zscale<:>'+zscale; |
|
} else { |
parent.server.document.forms.storage.output.value='graphdef<:>no'; |
parent.server.document.forms.storage.output.value='graphdef<:>no'; |
} |
} |
parent.server.document.forms.storage.output.value+= |
parent.server.document.forms.storage.output.value+= |
'<&>tablemode<:>'+tablemode; |
'<&>tablemode<:>'+tablemode; |
|
|
|
for (k=0;k<objparms.length;k++) { |
|
if (objparms[k]) { |
|
parent.server.document.forms.storage.output.value+= |
|
'<&>objparms<:>'+k+'<:>'+objparms[k]; |
|
} |
|
} |
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 1522 function save() {
|
Line 2013 function save() {
|
} |
} |
|
|
// ----------------------------------------------- Reset all layout information |
// ----------------------------------------------- Reset all layout information |
|
|
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]=''; |
|
objlinks[0]=''; |
|
|
graphdef='no'; |
graphdef='no'; |
|
|
} |
} |
|
|
// --------------------- Compare two resources with each other for "straighten" |
// --------------------- Compare two resources with each other for "straighten" |
|
|
function rescompare(a,b) { |
function rescompare(a,b) { |
data1=a.split(':'); |
data1=a.split(':'); |
data2=b.split(':'); |
data2=b.split(':'); |
Line 1557 function rescompare(a,b) {
|
Line 2049 function rescompare(a,b) {
|
for (k=1;k<data1.length;k++) { |
for (k=1;k<data1.length;k++) { |
if (data1[k]==data2[0]) { rvalue--; } |
if (data1[k]==data2[0]) { rvalue--; } |
} |
} |
for (k=1;k<data3.length;k++) { |
for (k=1;k<data2.length;k++) { |
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; } |
Line 1565 function rescompare(a,b) {
|
Line 2057 function rescompare(a,b) {
|
} |
} |
|
|
// -------------------------------------------- Draw the table instead of graph |
// -------------------------------------------- Draw the table instead of graph |
|
|
function tabledraw() { |
function tabledraw() { |
var objsorted=new Array(); |
var objsorted=new Array(); |
var robjs=new Array(); |
var robjs=new Array(); |
|
var iobjs=new Array(); |
var k; |
var k; |
var i; |
var i; |
var j; |
var j; |
var nr; |
var nr; |
var bc; var rc; var gc; var ck; |
var ck; |
|
var cck; |
|
var condid; |
|
var url=''; |
|
var mime=''; |
|
var ext=''; |
|
var urlparts=new Array; |
var sortstr=sortobjs(); |
var sortstr=sortobjs(); |
if (sortstr!='') { |
insrestab(1,-1,-1,''); |
|
if ((sortstr!='') && (typeof(sortstr)!="undefined")) { |
objsorted=sortstr.split('&'); |
objsorted=sortstr.split('&'); |
for (k=0;k<objsorted.length;k++) { |
for (k=0;k<objsorted.length;k++) { |
robjs[objsorted[k]]=k; |
i=(objsorted[k].split(':'))[0]; |
|
iobjs[k]=i; |
|
robjs[i]=k; |
} |
} |
for (k=0;k<objsorted.length;k++) { |
for (k=0;k<iobjs.length;k++) { |
i=(objsorted[k].split(':'))[0]; |
i=iobjs[k]; |
if (k<objsorted.length-1) { |
if (k<objsorted.length-1) { |
nr=(objsorted[k+1].split(':'))[0]; |
nr=iobjs[k+1]; |
} else { |
} else { |
nr=-1; |
nr=-1; |
} |
} |
data1=objcont[i].split(':'); |
data1=objcont[i].split(':'); |
if (data1[2]=='true') { bc='55'; } else { bc='11'; } |
ck=rescolor(data1[2],data1[3]); |
if (data1[3]=='mandatory') { rc='BB'; } else { rc='55'; } |
parent.mapout.document.write('<tr><td bgcolor="'+ck+'">'); |
if (data1[3]=='optional') { gc='66'; } else { gc='AA'; } |
url=data1[1]; |
ck='#'+rc+gc+bc; |
ext=data1[2]; |
parent.mapout.document.write('<tr><td bgcolor="'+ck |
urlparts=url.split('.'); |
+'"><b>'+k+'</td><td bgcolor="'+ck |
mime=urlparts[urlparts.length-1]; |
|
if (typeof(mime)=="undefined") { mime=''; } |
|
if ((mime!='') && (ext!='true')) { |
|
parent.mapout.document.write |
|
('<a target="preview" align="right" href="'+url+'.meta'+ |
|
'"><img src="'+iconpath+'meta.gif"></a><p>'+ |
|
'<a target="preview" align="right"href="'+url+ |
|
'"><img src="'+iconpath+mime+'.gif"></a><p>'); |
|
} |
|
parent.mapout.document.write( |
|
'<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>'); |
+'"><form name=r'+i+' method=post>'); |
data2=obj[i].split('&'); |
data2=obj[i].split('&'); |
parent.mapout.document.write('<table bgcolor="#CCCCCC">'); |
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( |
parent.mapout.document.write( |
'<tr><td>Title:</td><td><input type=text name=t size=30 value="' |
'<tr><td>Title:</td><td><input type=text name=t size=50 value="' |
+data1[0]+'"></td></tr>'); |
+data1[0]+'"><input type=hidden name=h value='+data1[3] |
|
+'></td></tr>'); |
parent.mapout.document.write( |
parent.mapout.document.write( |
'<tr><td>URL:</td><td><input type=text name=u size=30 value="' |
'<tr><td>URL:</td><td><input type=text name=u size=50 value="' |
+data1[1]+'"></td></tr>' |
+data1[1]+'"></td></tr>' |
+'<tr><td>External:</td><td><input type=checkbox name=e'); |
+'<tr><td>External:</td><td><input type=checkbox name=e'); |
if (data1[2]=='true') { parent.mapout.document.write(' checked'); } |
if (data1[2]=='true') { parent.mapout.document.write(' checked'); } |
parent.mapout.document.write('></td></tr>' |
parent.mapout.document.write('></td></tr>'); |
+'<tr><td colspan=2><input type=hidden name=h value='+data1[3] |
if ((data1[3]!='start') && (data1[3]!='finish')) { |
+'><input type=radio name=y value=normal '+ |
parent.mapout.document.write( |
|
'<tr><td colspan=2><input type=radio name=y value=normal '+ |
'onClick="parent.mapout.document.forms.r'+i+'.elements.h.value='+ |
'onClick="parent.mapout.document.forms.r'+i+'.elements.h.value='+ |
"'normal'"+'"'); |
"'normal'"+'"'); |
if (data1[3]=='normal') { parent.mapout.document.write(' checked'); } |
if (data1[3]=='normal') { parent.mapout.document.write(' checked'); } |
Line 1621 function tabledraw() {
|
Line 2145 function tabledraw() {
|
'onClick="parent.mapout.document.forms.r'+i+'.elements.h.value='+ |
'onClick="parent.mapout.document.forms.r'+i+'.elements.h.value='+ |
"'optional'"+'"'); |
"'optional'"+'"'); |
if (data1[3]=='optional') { parent.mapout.document.write(' checked'); } |
if (data1[3]=='optional') { parent.mapout.document.write(' checked'); } |
parent.mapout.document.write('> Optional</td></tr>' |
parent.mapout.document.write('> Optional</td></tr>'); |
+'<tr><td colspan=2><a href="javascript:parent.code.objcont['+i |
} |
|
parent.mapout.document.write( |
|
'<tr><td colspan=2><a href="javascript:parent.code.objcont['+i |
+']=parent.code.escape(parent.mapout.document.forms.r'+i |
+']=parent.code.escape(parent.mapout.document.forms.r'+i |
+'.elements.t.value)+'+"':'" |
+'.elements.t.value)+'+"':'" |
+'+parent.code.escape(parent.mapout.document.forms.r'+i |
+'+parent.code.escape(parent.mapout.document.forms.r'+i |
Line 1630 function tabledraw() {
|
Line 2156 function tabledraw() {
|
+'+parent.mapout.document.forms.r'+i+'.elements.e.checked+'+"':'" |
+'+parent.mapout.document.forms.r'+i+'.elements.e.checked+'+"':'" |
+'+parent.mapout.document.forms.r'+i+'.elements.h.value+'+"':res'" |
+'+parent.mapout.document.forms.r'+i+'.elements.h.value+'+"':res'" |
+';parent.code.draw();">' |
+';parent.code.draw();">' |
+'<b>Change to above values</b></a> ' |
+'<b>Save Changes</b></a> ' |
+' <a href="javascript:parent.mapout.document.forms.r'+i |
+' <a href="javascript:parent.mapout.document.forms.r'+i |
+'.reset()">Reset</a><br><table><tr>'); |
+'.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>'); |
|
} |
|
parent.mapout.document.writeln( |
|
'<br><a href="javascript:' |
|
+'parent.code.setparms('+i+');">Set Parameters</a>'); |
|
|
|
parent.mapout.document.writeln('</td></tr>'); |
|
parent.mapout.document.writeln('<tr><td colspan=2><table><tr>'); |
for (j=2;j<data2.length;j++) { |
for (j=2;j<data2.length;j++) { |
data3=objlinks[(data2[j].split(':'))[2]].split(':'); |
data4=data2[j].split(':'); |
|
data3=objlinks[data4[2]].split(':'); |
if (data3.length>1) { |
if (data3.length>1) { |
if (data3[1]==nr) { |
if (data3[1]==nr) { |
parent.mapout.document.writeln('<td>Next<br>'+data3); |
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>'); |
parent.mapout.document.writeln('</td>'); |
} |
} |
} |
} |
} |
} |
for (j=2;j<data2.length;j++) { |
for (j=2;j<data2.length;j++) { |
data3=objlinks[(data2[j].split(':'))[2]].split(':'); |
data4=data2[j].split(':'); |
|
data3=objlinks[data4[2]].split(':'); |
if (data3.length>1) { |
if (data3.length>1) { |
if ((data3[1]!=nr) && (data3[1]!=0)) { |
if ((data3[1]!=nr) && (data3[1]!=0)) { |
|
cck='#AAAAAA'; |
|
if (data3[2]!=0) { |
|
cck=condcolor((objcont[data3[2]].split(':'))[1]); |
|
condid=data3[2]; |
|
} else { |
|
condid='-'; |
|
} |
parent.mapout.document.writeln( |
parent.mapout.document.writeln( |
'<td>To: '+robjs[data3[1]]+'<br>'); |
'<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('</td>'); |
} |
} |
} |
} |
} |
} |
parent.mapout.document.writeln( |
parent.mapout.document.writeln( |
'</tr></table></td></tr></table></form></td></tr>'); |
'</tr></table></td></tr></table></form>'); |
|
insrestab(rrow[data2[1]],i,nr,data1[3]); |
|
|
} |
} |
} |
} |
} |
} |
|
|
// ---------------------------------- Sort objects to straighten graph or table |
// ----------------------------------------------------- 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.save();" |
|
+'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.save();" |
|
+'parent.code.joinres('+be+',parent.code.mostrecent,0);' |
|
+"parent.code.save();" |
|
+'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.save();" |
|
+'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 mime; |
|
var ext; |
|
var url; |
|
var urlparts=new Array; |
|
var condid; |
|
var sortstr=sortobjs(); |
|
if ((sortstr!='') && (typeof(sortstr)!="undefined")) { |
|
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+'">'); |
|
url=data1[1]; |
|
ext=data1[2]; |
|
urlparts=url.split('.'); |
|
mime=urlparts[urlparts.length-1]; |
|
if (typeof(mime)=="undefined") { mime=''; } |
|
if ((mime!='') && (ext!='true')) { |
|
parent.mapout.document.write |
|
('<a target="preview" align="right" href="'+url+'.meta'+ |
|
'"><img src="'+iconpath+'meta.gif"></a><p>'+ |
|
'<a target="preview" align="right"href="'+url+ |
|
'"><img src="'+iconpath+mime+'.gif"></a><p>'); |
|
} |
|
parent.mapout.document.write('<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>'); |
|
} |
|
} else { |
|
parent.mapout.document.writeln('<tr><td>No Resources</td></tr>'); |
|
} |
|
} |
|
|
|
// ---------------------------------- Sort objects to straighten graph or table |
function sortobjs() { |
function sortobjs() { |
message("Sorting Resources"); |
message("Sorting Resources: "+funny); |
var k; |
var k; |
var ij; |
var ij; |
var dol; |
var dol; |
Line 1679 function sortobjs() {
|
Line 2399 function sortobjs() {
|
} |
} |
if (objsort.length==0) { return ''; } |
if (objsort.length==0) { return ''; } |
for (k=1;k<objlinks.length;k++) { |
for (k=1;k<objlinks.length;k++) { |
if (objlinks[k]!='') { |
wheelswitch(); |
|
message("Sorting Resources: "+funny); |
|
if ((typeof(objlinks[k])!="undefined") && (objlinks[k]!='')) { |
sortthis=1; |
sortthis=1; |
data1=objlinks[k].split(':'); |
data1=objlinks[k].split(':'); |
kj=-1; |
kj=-1; |
Line 1688 function sortobjs() {
|
Line 2410 function sortobjs() {
|
kj=j; |
kj=j; |
} |
} |
} |
} |
objsort[kj]+=':'+data1[1]; |
if (kj!=-1) { objsort[kj]+=':'+data1[1]; } |
} |
} |
} |
} |
if (sortthis!=0) { |
if (sortthis!=0) { |
for (k=0;k<objsort.length;k++) { |
for (k=0;k<objsort.length;k++) { |
|
wheelswitch(); |
|
message("Sorting Resources: "+funny); |
for (j=0;j<objsort.length;j++) { |
for (j=0;j<objsort.length;j++) { |
if (k!=j) { |
if (k!=j) { |
data1=objsort[k].split(':'); |
data1=objsort[k].split(':'); |
data2=objsort[j].split(':'); |
data2=objsort[j].split(':'); |
dol=data1.length; |
dol=data1.length; |
dtl=data2.length; |
dtl=data2.length; |
for (kj=1;kj<dol;kj++) { |
if (dol+dtl<200) { |
|
for (kj=1;kj<dol;kj++) { |
if (data1[kj]==data2[0]) { |
if (data1[kj]==data2[0]) { |
for (ij=1;ij<dtl;ij++) { |
for (ij=1;ij<dtl;ij++) { |
data1[data1.length]=data2[ij]; |
data1[data1.length]=data2[ij]; |
} |
} |
} |
} |
} |
} |
for (kj=1;kj<dtl;kj++) { |
for (kj=1;kj<dtl;kj++) { |
if (data2[kj]==data1[0]) { |
if (data2[kj]==data1[0]) { |
for (ij=1;ij<dol;ij++) { |
for (ij=1;ij<dol;ij++) { |
data2[data2.length]=data1[ij]; |
data2[data2.length]=data1[ij]; |
} |
} |
} |
} |
|
} |
|
objsort[k]=data1.join(':'); |
|
objsort[j]=data2.join(':'); |
} |
} |
objsort[k]=data1.join(':'); |
|
objsort[j]=data2.join(':'); |
|
} |
} |
} |
} |
} |
} |
|
message("Sorting Resources: finishing up."); |
return objsort.sort(rescompare).join('&'); |
return objsort.sort(rescompare).join('&'); |
} else { |
} else { |
return objsort.join('&'); |
return objsort.join('&'); |
Line 1725 function sortobjs() {
|
Line 2452 function sortobjs() {
|
} |
} |
|
|
// ----------------------------------------------------------- Straighten graph |
// ----------------------------------------------------------- Straighten graph |
|
|
function graphopt() { |
function graphopt() { |
var k; |
var k; |
var kj; |
var kj; |
var ij; |
var ij; |
|
|
var objsorted=new Array(); |
var objsorted=new Array(); |
condense(); |
condense(); |
graphreset(); |
graphreset(); |
Line 1749 function graphopt() {
|
Line 2474 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 1763 function graphopt() {
|
Line 2488 function graphopt() {
|
row[k]=k; |
row[k]=k; |
} |
} |
maxrow=rowcont.length-1; |
maxrow=rowcont.length-1; |
|
|
var oldlinks=new Array(); |
var oldlinks=new Array(); |
for (k=0;k<objlinks.length;k++) { oldlinks[k]=objlinks[k]; } |
for (k=0;k<objlinks.length;k++) { |
|
oldlinks[k]=objlinks[k]; |
|
objlinks[k]=''; |
|
} |
objlinks.length=0; |
objlinks.length=0; |
objlinks[0]=''; |
objlinks[0]=''; |
|
graphdef='yes'; |
|
save(); |
|
|
for (k=0;k<objsorted.length;k++) { |
for (k=0;k<objsorted.length;k++) { |
kj=(objsorted[k].split(':'))[0]; |
wheelswitch(); |
|
message("Connecting Resources: "+funny); |
|
kj=(objsorted[k].split(':'))[0]; |
for (ij=1;ij<oldlinks.length;ij++) { |
for (ij=1;ij<oldlinks.length;ij++) { |
if (oldlinks[ij]) { |
if (oldlinks[ij]) { |
data1=oldlinks[ij].split(':'); |
data1=oldlinks[ij].split(':'); |
if (data1[0]==kj) { |
if (data1[0]==kj) { |
joinres(data1[0],data1[1],data1[2]); |
joinres(data1[0],data1[1],data1[2]); |
|
save(); |
} |
} |
} |
} |
} |
} |
} |
} |
graphdef='yes'; |
|
} |
} |
|
|
// ----------------------------------------------------------- Remove e-objects |
// ----------------------------------------------------------- Remove e-objects |
|
|
function condense() { |
function condense() { |
message("Condensing"); |
message("Condensing"); |
var j; |
var j; |
for (j=0;j<=maxrow;j++) { |
for (j=0;j<=maxrow;j++) { |
if (rowcont[j]!='') { |
if ((rowcont[j]!='') && (typeof(rowcont[j])!="undefined")) { |
data1=rowcont[j].split(':'); |
data1=rowcont[j].split(':'); |
rowcont[j]=''; |
rowcont[j]=''; |
for (k=0;k<data1.length;k++) { |
for (k=0;k<data1.length;k++) { |
if (obj[data1[k]].substring(0,2)!='e&') { |
if (obj[data1[k]].substring(0,2)!='e&') { |
if (rowcont[j]!='') { rowcont[j]+=':'; } |
if ((rowcont[j]!='') && (typeof(rowcont[j])!="undefined")) { |
|
rowcont[j]+=':'; |
|
} |
rowcont[j]+=data1[k]; |
rowcont[j]+=data1[k]; |
} |
} |
} |
} |
} |
} |
} |
} |
lastempty=-2; |
|
} |
} |
|
|
// ---------------------------------------------------- Load from hidden fields |
// ---------------------------------------------------- Load from hidden fields |
|
|
function load() { |
function load() { |
|
message("Loading"); |
|
schedule('load'); |
|
} |
|
|
|
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 1814 function load() {
|
Line 2553 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!='') { |
if ((inputstr!='') && (typeof(inputstr)!="undefined")) { |
data1=inputstr.split('<&>'); |
data1=inputstr.split('<&>'); |
var k; |
var k; |
for (k=0;k<data1.length;k++) { |
for (k=0;k<data1.length;k++) { |
data2=data1[k].split('<:>'); |
data2=data1[k].split(':').join(':').split('<:>'); |
if (data2[0]=='graphdef') { graphdef=data2[1]; } |
if (data2[0]=='graphdef') { graphdef=data2[1]; } |
if (data2[0]=='maxcol') { maxcol=1*data2[1]; } |
if (data2[0]=='maxcol') { maxcol=1*data2[1]; } |
if (data2[0]=='maxrow') { maxrow=1*data2[1]; } |
if (data2[0]=='maxrow') { maxrow=1*data2[1]; } |
if (data2[0]=='obj') { obj[data2[1]]=data2[2]; } |
if (data2[0]=='obj') { obj[data2[1]]=data2[2]; } |
if (data2[0]=='objcont') { objcont[data2[1]]=data2[2]; } |
if (data2[0]=='objcont') { objcont[data2[1]]=data2[2]; } |
if (data2[0]=='objlinks') { objlinks[data2[1]]=data2[2]; } |
if (data2[0]=='objlinks') { objlinks[data2[1]]=data2[2]; } |
|
if (data2[0]=='objparms') { |
|
if (typeof(objparms[data2[1]])=="undefined") { |
|
objparms[data2[1]]=data2[2]; |
|
} else { |
|
objparms[data2[1]]+=':'+data2[2]; |
|
} |
|
} |
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]=='tablemode') { tablemode=1*data2[1]; } |
|
if (data2[0]=='zscale') { zscale=1*data2[1]; } |
|
} |
|
} |
|
if (graphdef=='yes') { |
|
for (k=1;k<=maxrow;k++) { |
|
if (typeof(rowcont[k])=="undefined") { rowcont[k]=''; } |
|
} |
|
} else { |
|
var hasstart=0; |
|
var hasfinish=0; |
|
for (k=0;k<objcont.length;k++) { |
|
if (typeof(objcont[k])!="undefined") { |
|
var objfunctype=(objcont[k].split(':'))[3]; |
|
if (objfunctype=='start') { hasstart=1; } |
|
if (objfunctype=='finish') { hasfinish=1; } |
|
} |
|
} |
|
if (!hasstart) { |
|
if ((typeof(objcont[1])=="undefined") || (objcont[1]=='')) { |
|
objcont[1]='Start::false:start:res'; |
|
} |
|
} |
|
if (!hasfinish) { |
|
if ((typeof(objcont[2])=="undefined") || (objcont[2]=='')) { |
|
objcont[2]='Finish::false:finish:res'; |
|
} |
} |
} |
} |
} |
} |
} |
|
|
// -------------------------------------------------------------- Undo function |
// -------------------------------------------------------------- Parameter set |
|
function setparms(resid) { |
|
var options="scrollbars=1,resizable=1,menubar=0"; |
|
parmflag=1; |
|
data1=objcont[resid].split(':'); |
|
parm=open("/adm/ratparms?url="+data1[1]+"&parms="+objparms[resid]+ |
|
"&resid="+resid,"parmout",options); |
|
parm.focus(); |
|
} |
|
|
|
// -------------------------------------------------------------- Undo function |
function undo() { |
function undo() { |
if (undopointer>1) { |
if (undopointer>1) { |
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 1850 function undo() {
|
Line 2632 function undo() {
|
} |
} |
|
|
// -------------------------------------------------------------- Redo function |
// -------------------------------------------------------------- Redo function |
|
|
function redo() { |
function redo() { |
if (undopointer<undostack.length-1) { |
if (undopointer<undostack.length-1) { |
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 1866 function redo() {
|
Line 2647 function redo() {
|
} |
} |
|
|
// ------------------------------------------------------------ Revert function |
// ------------------------------------------------------------ Revert function |
|
|
function revert() { |
function revert() { |
if (confirm("Revert to beginning of edit session?")) { |
if (confirm("Revert to beginning of edit session?")) { |
undopointer=2; |
undopointer=2; |
Line 1874 function revert() {
|
Line 2654 function revert() {
|
} |
} |
} |
} |
|
|
// -------------------------------------------------------------- Store changes |
// ---------------------------------------------------------------- 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.flag==1) { |
|
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); |
|
checkdef(); |
|
wait(); |
|
} |
|
|
|
// ----------------------------------------------------- launch indexer browser |
|
function groupsearch() { |
|
srchcheck('groupsearch'); |
|
} |
|
|
|
function groupimport() { |
|
idxcheck('groupimport'); |
|
} |
|
|
|
function groupcopy() { |
|
copydxcheck('groupsec'); |
|
} |
|
|
|
// -------------------------------------------------------------- Store changes |
function storechange() { |
function storechange() { |
|
var k; |
|
parent.flag=0; |
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"); |
|
} |
} |
|
|
// ---------------------------------------------------------------- Toggle Mode |
// --------------------------------------- Gets called when submission finished |
|
function srvloaded() { |
|
finishdone=1; |
|
message("Server replied."); |
|
} |
|
|
|
// ---------------------------------------------------------------- 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(); |
} |
} |
|
|
// -------------------------------------------------------- Main program onLoad |
// -------------------------------------------------------- Main program onLoad |
|
|
function main() { |
function main() { |
|
|
if (mainrun==0) { |
if (mainrun==0) { |
|
infopen(); |
|
infoclear(); |
load(); |
load(); |
draw(); |
|
stored=1; |
stored=1; |
mainrun=1; |
mainrun=1; |
} |
} |
|
|
} |
} |
|
|
// ------------------------------------------------------------- Save on leave? |
// ---------------------------------------------------------- Close the window? |
|
|
function leave() { |
function leave() { |
if (stored==0) { |
if (!inf.closed) { |
if (confirm('Store changes?')) { |
inf.close(); |
storechange(); |
} |
} |
if (srch && !srch.closed) { |
|
srchclose(); |
|
} |
|
if (idx && !idx.closed) { |
|
idxclose(); |
|
} |
|
if (copydx && !copydx.closed) { |
|
copydxclose(); |
} |
} |
} |
} |
|
|
</script> |
</script> |
</head> |
</head> |
|
|
<body bgcolor="#FFFFFF" onLoad="main();" onUnload="leave();"> |
<body bgcolor="#FFFFFF" onUnload="leave();"> |
<a href="javascript:togglemode();">Toggle Display Mode</a> |
<table border=0><tr><td bgcolor="#aaaaaa"> |
<a href="javascript:condense();draw();">Condense</a> |
<table border=0><tr> |
<a href="javascript:graphopt();draw();">Straighten</a> |
<td bgcolor="#ffffcc"><a href="javascript:togglemode();"><b>T</b>oggle display</a> </td> |
<a href="javascript:revert();">Revert</a> |
<td bgcolor="#ffffcc"><a href="javascript:if (zscale>1) { zscale--; draw();}"><b>Z</b>oom out</a> </td> |
<a href="javascript:undo();">Undo</a> |
<td bgcolor="#ffffcc"><a href="javascript:if (zscale<3) { zscale++; draw();}"><b>Z</b>oom in</a> </td> |
<a href="javascript:redo();">Redo</a> |
<td bgcolor="#ffffcc"><a href="javascript:condense();draw();"><b>C</b>ondense</a> </td> |
<a href="javascript:storechange();">Store</a> |
<td bgcolor="#ffffcc"><a href="javascript:graphopt();draw();"><b>S</b>traighten</a> </td> |
|
<td bgcolor="#ffffcc"><a href="javascript:revert();"><b>R</b>evert</a> </td> |
|
<td bgcolor="#ffffcc"><a href="javascript:undo();"><b>U</b>ndo</a> </td> |
|
<td bgcolor="#ffffcc"><a href="javascript:redo();"><b>R</b>edo</a> </td> |
|
<td bgcolor="#ffffcc"><a href="javascript:groupsearch();"><b>G</b>roup search</a> </td> |
|
<td bgcolor="#ffffcc"><a href="javascript:groupimport();"><b>G</b>roup import</a> </td> |
|
<td bgcolor="#ffffcc"><a href="javascript:groupcopy();"><b>G</b>roup copy</a> </td> |
|
<td bgcolor="#ffffcc"><a href="javascript:graphdef='no';save();storechange();"><b>S</b>ave map</a> </td> |
|
<td bgcolor="#ccffcc"><a href="javascript:storechange();"><b>S</b>ave map and layout</a> </td> |
|
</tr></table> |
|
</td></tr></table> |
|
<script> |
|
main(); |
|
</script> |
</body> |
</body> |
</html> |
</html> |
|
|
|
|
|
|
|
|
|
|