[LON-CAPA-cvs] cvs: loncom /html/res/adm/pages menu.html

www lon-capa-cvs@mail.lon-capa.org
Wed, 13 Nov 2002 16:55:29 -0000


www		Wed Nov 13 11:55:29 2002 EDT

  Modified files:              
    /loncom/html/res/adm/pages	menu.html 
  Log:
  Extended Remote automatically closes when content outdated.
  
  
Index: loncom/html/res/adm/pages/menu.html
diff -u loncom/html/res/adm/pages/menu.html:1.76 loncom/html/res/adm/pages/menu.html:1.77
--- loncom/html/res/adm/pages/menu.html:1.76	Tue Nov 12 15:11:10 2002
+++ loncom/html/res/adm/pages/menu.html	Wed Nov 13 11:55:29 2002
@@ -4,7 +4,7 @@
 Remote Control
 
 //
-// $Id: menu.html,v 1.76 2002/11/12 20:11:10 www Exp $
+// $Id: menu.html,v 1.77 2002/11/13 16:55:29 www Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -58,6 +58,9 @@
 
 var clockdelta=0;
 
+var w_extdisp_flag=-1;
+var extdisp;
+
 // not used (yet)
 // var w_Annotator;
 // var w_bmquery;
@@ -136,6 +139,7 @@
    }
    clientwindow.name='loncapaclient';
    clientwindow.menuwindow=self;
+   extenddispclose();
 }
 
 function logout () {
@@ -351,13 +355,24 @@
    bmquery.document.close();
 }
 
+function extenddispclose() {
+   if (w_extdisp_flag>0) {
+      if (extdisp!=null && !extdisp.closed) {
+         extdisp.close();
+      }
+      w_extdisp_flag=-1;
+   }
+}
+
 function extenddisp() {
    go('');
+   w_extdisp_flag=1;
    extdisp=window.open("http://"+clienthost+"/adm/rat/empty.html",
                "ExtDisp", "width=400,height=450");
    extdisp.document.clear();
    extdisp.document.writeln(
-  '<html><body bgcolor="#666666" text="#DDDDDD" link="#666666">'+
+  '<html><body bgcolor="#666666" text="#DDDDDD" link="#666666" '+
+         'onUnload="opener.w_extdisp_flag=-1;">'+
   '<h2>LON-CAPA Extended Display Remote Control</h2>'+
   '<script>var currentURL="'+currentURL+'";self.focus();</script>'+
   '<table border="2"><tr><th>Select Functionality from Below</th>'+
@@ -367,7 +382,7 @@
           if (ds[i]!='') {
              extdisp.document.writeln(
                 '<tr><td><a href="javascript:opener.'+
-                  hr[i]+';self.close();"><img border="0" src="'+
+                  hr[i]+';"><img border="0" src="'+
                   this.document['b'+i].src+'" /></a><br />'+
   '<table hspace="0" border="0" cellspacing="1" cellpadding="0"><tr>');
              for (var j=0;j<=7;j++) {