--- rat/client/Attic/code.html 2001/03/12 15:35:55 1.17 +++ rat/client/Attic/code.html 2001/11/29 19:15:37 1.48 @@ -3,6 +3,32 @@ @@ -73,6 +106,27 @@ 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 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/'; + +function testfunction() { + inf.document.forms.resinfo.elements.t.value="ABC"; +} // ------------------------------------------------ Insert a row into the table @@ -94,7 +148,7 @@ function insertrow(j,ex1,ex2) { objects=objects1+':'+objects2; data1=objects.split(':'); for (kj=0;kj'); - if ((what!='') && (what!=undefined)) { - if ((obj1!='') && (obj1!=undefined)) { - obj1="'"+obj1+"'"; + if ((what!='') && (typeof(what)!="undefined")) { + if ((obj1!='') && (typeof(obj1)!="undefined")) { + objref="'"+obj1+"'"; parent.mapout.document.write - (''); + (''); } 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 - (''); + if ((mime!='') && (ext!='true')) { + parent.mapout.document.write + ('
'+ + ''); + } else { + parent.mapout.document.write + ('
'); + } + parent.mapout.document.write + ('
'); } else { if (what=='c:') { parent.mapout.document.write @@ -934,14 +1018,61 @@ function drawcell (rtype,ctype,what,cm,o +' src="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 - (''); + if ((mime!='') && (ext!='true')) { + parent.mapout.document.write + ('
'+ + ''); + } else { + parent.mapout.document.write + ('
'); + } + parent.mapout.document.write + ('
'); + } 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 - (''); + if ((mime!='') && (ext!='true')) { + parent.mapout.document.write + ('
'+ + ''); + } else { + parent.mapout.document.write + ('
'); + } + parent.mapout.document.write + ('
'); } else { parent.mapout.document.write (''); } } else { @@ -1007,7 +1138,7 @@ if (rowtype[jid]!=0) { } parent.mapout.document.writeln(''); - if ((rowcont[jid]!='') && (rowcont[jid]!=undefined)) { + if ((rowcont[jid]!='') && (typeof(rowcont[jid])!="undefined")) { data2=rowcont[jid].split(':'); for (jk=0;jkmiddle) { for (k=middle+1;kleftin;k--) { - if ((colmap4[k]!='') && (colmap4[k]!=undefined)) { + if ((colmap4[k]!='') && (typeof(colmap4[k])!="undefined")) { colmap[k]='lrt'; } else { colmap[k]='lr'; @@ -1094,7 +1225,7 @@ if (rowtype[jid]!=0) { if (rightoutmiddle) { - if ((colmap3[middle]!='') && (colmap3[middle]!=undefined)) { + if ((colmap3[middle]!='') && (typeof(colmap3[middle])!="undefined")) { colmap2[middle]='rtdl'; } else { colmap2[middle]='rtl'; @@ -1103,7 +1234,7 @@ if (rowtype[jid]!=0) { } if (leftoutleftout;k--) { - if ((colmap3[k]!='') && (colmap3[k]!=undefined)) { + if ((colmap3[k]!='') && (typeof(colmap3[k])!="undefined")) { colmap2[k]='rld'; } else { colmap2[k]='rl'; @@ -1113,7 +1244,7 @@ if (rowtype[jid]!=0) { } if (rightout>middle) { for (k=middle+1;k'); inf.document.close(); + if (srchflag==1) { + srchclose(); + } + if (idxflag==1) { + idxclose(); + } + if (parmflag==1) { + parmclose(); + } parent.top.focus(); parent.mapout.focus(); notclear=1; @@ -1307,6 +1447,10 @@ function infcheck() { // --------------------------------------------------- Prints out resource info function info(infostr) { + var mime=''; + var ext; + var urlparts=new Array; + var url=''; if ((editmode!=1) && (infostr!=lastinfo)) { notclear=1; infcheck(); @@ -1337,7 +1481,18 @@ function info(infostr) { } else { if (data1[0]=='r') { data2=objcont[data1[1]].split(':'); - inf.document.write(''); + 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 + ('
  '); + } + inf.document.write(''); if (data2[2]=='true') { inf.document.write('External '); } if (data2[3]=='start') { inf.document.writeln('Start'); @@ -1457,59 +1612,69 @@ function insertcondlink(cid,lnr) { +// ------------------------------------------------------ Clears indexer window + +function idxclear() { + idx.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 search window function srchclose() { - srch.close(); + 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&catalogmode="+mode,"idxout",options); + idx.focus(); } // --------------------------------------------------------- Open search window -function srchopen() { +function srchopen(mode) { var options="scrollbars=1,resizable=1,menubar=0"; - srch=open("","srchout",options); - srchclear(); - srch.document.writeln( - '
'+ - ''+ - ''+ - ''+ - '
Resource Library Search
'+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - '
title
author
subject
notes
abstract
mime
language
creationdate
lastrevisiondate
owner
copyright
'+ - ''+ - '
'); + srchmode=mode; + srchflag=1; + srch=open("/adm/searchcat?launch=1&catalogmode="+mode,"srchout",options); + srch.focus(); } // -------------------------------------------- Interface function to searching @@ -1520,10 +1685,20 @@ function search() { // ------------------------------------------------------- Do srch status check -function srchcheck() { - if (srch.closed) { - srchopen(); +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(); } // ---------------------------------------------------- Handles "click to edit" @@ -1573,7 +1748,7 @@ function handler(infostr) { } inf.document.writeln( 'opener.infoclear();opener.editmode=0;opener.draw(' - +');">Change to above values  ' + +');">Save Changes  ' +' Reset
' +''); @@ -1616,13 +1791,16 @@ function handler(infostr) { '
'); - if ((data2[3]!='start') && (data2[3]!='finish')) { inf.document.write('' +'' - +''); + if ((data2[3]!='start') && (data2[3]!='finish')) { + inf.document.write(''); - } else { - inf.document.write( - ''); - } + } inf.document.writeln( '
Title:' +'
URL:' +'
External:Search
' + inf.document.write('>' + +'Browse ' + +'Search
' +' Optional
' - +'
' - +'Change to above values  ' + +'Save Changes  ' +' Reset' +'
'); if ((data2[3]!='start') && (data2[3]!='finish')) { @@ -1692,7 +1866,7 @@ function handler(infostr) { } inf.document.writeln( '
Done'); + +'opener.infoclear();">Cancel'); inf.document.writeln('
'); inf.document.close(); inf.focus(); @@ -1722,7 +1896,7 @@ function empty(rid,k) { +');">Insert resource'); if ((mostrecent!=0) && (objcont[mostrecent]!='') && - (objcont[mostrecent]!=undefined)) { + (typeof(objcont[mostrecent])!="undefined")) { inf.document.writeln('
Done'); + +'opener.infoclear();">Cancel'); inf.document.writeln(''); inf.document.close(); inf.focus(); @@ -1803,7 +1977,13 @@ function save() { } parent.server.document.forms.storage.output.value+= '<&>tablemode<:>'+tablemode; - + + for (k=0;kobjparms<:>'+k+'<:>'+objparms[k]; + } + } for (k=0;k'); + 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 + ('

'+ + '

'); + } + parent.mapout.document.write( + '

'); data2=obj[i].split('&'); parent.mapout.document.write(''); + if (data1[3]=='start') { parent.mapout.document.writeln(''); } @@ -1921,14 +2119,15 @@ function tabledraw() { ''); - if ((data1[3]!='start') && (data1[3]!='finish')) { parent.mapout.document.write( '' +'' - +''); + if ((data1[3]!='start') && (data1[3]!='finish')) { + parent.mapout.document.write( + ''); - } else { - parent.mapout.document.write( - ''); - } + } parent.mapout.document.write( '
Start
Title:
URL:
External:
Optional
' - +'
' - +'Change to above values  ' + +'Save Changes  ' +' Reset
'); if ((data1[3]!='start') && (data1[3]!='finish')) { @@ -2088,9 +2283,13 @@ function simpletabledraw() { var nr; var ck; var cck; + var mime; + var ext; + var url; + var urlparts=new Array; var condid; var sortstr=sortobjs(); - if ((sortstr!='') && (sortstr!=undefined)) { + if ((sortstr!='') && (typeof(sortstr)!="undefined")) { objsorted=sortstr.split('&'); for (k=0;k'+k+''); + parent.mapout.document.write('
'); + 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 + ('

'+ + '

'); + } + parent.mapout.document.write(''+k+'

'); data2=obj[i].split('&'); parent.mapout.document.write(''); + if (data1[3]=='start') { parent.mapout.document.writeln(''); } @@ -2188,7 +2399,7 @@ function sortobjs() { for (k=1;k'); var k; for (k=0;k'); + data2=data1[k].split(':').join(':').split('<:>'); if (data2[0]=='graphdef') { graphdef=data2[1]; } if (data2[0]=='maxcol') { maxcol=1*data2[1]; } if (data2[0]=='maxrow') { maxrow=1*data2[1]; } if (data2[0]=='obj') { obj[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]=='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]=='row') { row[data2[1]]=1*data2[2]; } if (data2[0]=='col') { col[data2[1]]=1*data2[2]; } @@ -2366,7 +2583,7 @@ function finishload() { } if (graphdef=='yes') { for (k=1;k<=maxrow;k++) { - if (rowcont[k]==undefined) { rowcont[k]=''; } + if (typeof(rowcont[k])=="undefined") { rowcont[k]=''; } } } } @@ -2374,7 +2591,12 @@ function finishload() { // -------------------------------------------------------------- Parameter set function setparms(resid) { - alert('Called setparms for '+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 @@ -2439,8 +2661,8 @@ function wheelswitch() { // --------------------------------------------- Checks if server frame defined function checkdef() { - if (parent.server.document.forms.storage.output.value!=undefined) { - srvloaded(); + if (parent.flag==1) { + srvloaded(); } if ((finishdone==0) && (tim==0)) { setTimeout('checkdef()',100); } } @@ -2469,14 +2691,26 @@ function schedule(action) { reqaction=action; tim=0; finishdone=0; - canceltim=setTimeout('tim=1;',20000) + canceltim=setTimeout('tim=1;',20000); + checkdef(); wait(); } +// ----------------------------------------------------- launch indexer browser + +function groupsearch() { + srchcheck('groupsearch'); +} + +function groupimport() { + idxcheck('groupimport'); +} + // -------------------------------------------------------------- Store changes function storechange() { var k; + parent.flag=0; parent.server.document.forms.storage.submit(); schedule('save'); } @@ -2531,28 +2765,35 @@ function leave() { if (!inf.closed) { inf.close(); } - if (!srch.closed) { - srch.close(); + if (srch && !srch.closed) { + srchclose(); + } + if (idx && !idx.closed) { + srchclose(); } } - -Toggle Display Mode -Zoom Out -Zoom In -Condense -Straighten -Revert -Undo -Redo -Store + +
Start
+ + + + + + + + + + + + +
Toggle display Zoom out Zoom in Condense Straighten Revert Undo Redo Group search Group import Save map 
+
+ - - - - -