--- rat/client/Attic/code.html 2001/03/13 15:35:08 1.21 +++ rat/client/Attic/code.html 2001/05/28 19:22:45 1.31 @@ -11,6 +11,9 @@ Resource Assembly Tool 5/2,5/3,5/4,5/5,5/6,5/8,5/9,5/13,5/18,5/20,5/22,5/24,5/25, 6/7,6/8,6/9,6/10,6/12,6/15,7/4,7/26,7/28,7/31,8/5,8/19,8/24, 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 --> @@ -73,6 +76,9 @@ 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 function testfunction() { inf.document.forms.resinfo.elements.t.value="ABC"; @@ -1286,8 +1292,9 @@ function infoclear() { } inf.document.writeln(''); inf.document.close(); - srchclose(); - + if (srchflag==1) { + srchclose(); + } parent.top.focus(); parent.mapout.focus(); notclear=1; @@ -1472,7 +1479,8 @@ function srchclear() { // ------------------------------------------------------- Closes search window function srchclose() { - if (srch) { + if (srch && !srch.closed) { + srchflag=0; srch.close(); } } @@ -1481,6 +1489,7 @@ function srchclose() { function srchopen() { var options="scrollbars=1,resizable=1,menubar=0"; + srchflag=1; srch=open("/adm/searchcat?catalogmode=interactive","srchout",options); srch.focus(); } @@ -2303,7 +2312,6 @@ function condense() { function load() { message("Loading"); schedule('load'); - checkdef(); } function finishload() { @@ -2413,8 +2421,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); } } @@ -2443,7 +2451,8 @@ function schedule(action) { reqaction=action; tim=0; finishdone=0; - canceltim=setTimeout('tim=1;',20000) + canceltim=setTimeout('tim=1;',20000); + checkdef(); wait(); } @@ -2451,6 +2460,7 @@ function schedule(action) { function storechange() { var k; + parent.flag=0; parent.server.document.forms.storage.submit(); schedule('save'); } @@ -2505,8 +2515,8 @@ function leave() { if (!inf.closed) { inf.close(); } - if (!srch.closed) { - srch.close(); + if (srch && !srch.closed) { + srchclose(); } }