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

www lon-capa-cvs@mail.lon-capa.org
Thu, 13 Feb 2003 20:35:39 -0000


www		Thu Feb 13 15:35:39 2003 EDT

  Modified files:              
    /loncom/html/res/adm/pages	menu.html 
    /loncom/interface	lonmenu.pm 
  Log:
  Slightly ridiculous over use of window.status, but apparently the only way
  to nail down where "Unspecified Errors" happen in Internet Explorer.
  
  
Index: loncom/html/res/adm/pages/menu.html
diff -u loncom/html/res/adm/pages/menu.html:1.85 loncom/html/res/adm/pages/menu.html:1.86
--- loncom/html/res/adm/pages/menu.html:1.85	Fri Jan 31 16:46:36 2003
+++ loncom/html/res/adm/pages/menu.html	Thu Feb 13 15:35:39 2003
@@ -4,7 +4,7 @@
 Remote Control
 
 //
-// $Id: menu.html,v 1.85 2003/01/31 21:46:36 www Exp $
+// $Id: menu.html,v 1.86 2003/02/13 20:35:39 www Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -166,8 +166,8 @@
 }
 
 function activate () {
-   setTimeout('opener.menuloaded=1;',3000);
-   setTimeout('active=1;',2000);
+   setTimeout('opener.menuloaded=1;',1000);
+   setTimeout('active=1;',500);
    advanceclock();
 }
 
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.34 loncom/interface/lonmenu.pm:1.35
--- loncom/interface/lonmenu.pm:1.34	Thu Feb 13 13:11:26 2003
+++ loncom/interface/lonmenu.pm	Thu Feb 13 15:35:39 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.34 2003/02/13 18:11:26 www Exp $
+# $Id: lonmenu.pm,v 1.35 2003/02/13 20:35:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -52,24 +52,43 @@
     return(<<ENDREMOTESTARTUP);
 <script>
 
+function wheelswitch() {
+   if (window.status=='|') { 
+      window.status='/'; 
+   } else {
+      if (window.status=='/') {
+         window.status='-';
+      } else {
+         if (window.status=='-') { 
+            window.status='\\\\'; 
+         } else {
+            if (window.status=='\\\\') { window.status='|'; }
+         }
+      }
+   } 
+}
+
 // ---------------------------------------------------------- The wait function
 var canceltim;
 function wait() {
    if ((menuloaded==1) || (tim==1)) {
+      window.status='Done.';
       if (tim==0) {
          clearTimeout(canceltim);
          $configmenu
          window.location='$lowerurl';  
       } else {
-         alert("Remote Control Timed Out.");
+         alert("Remote Control timed out. It is possible that it was blocked by pop-up window filters.");
       }
    } else {
-      setTimeout('wait();',100);
+      wheelswitch();
+      setTimeout('wait();',200);
    }
 }
 
 function main() {
-   canceltim=setTimeout('tim=1;',80000);
+   canceltim=setTimeout('tim=1;',60000);
+   window.status='-';
    wait();
 }
 
@@ -120,6 +139,7 @@
 ENDRESIZE
     }
     $returnval.=(<<ENDOPEN);
+window.status='Opening LON-CAPA Remote Control';
 var menu=window.open("/res/adm/pages/menu.html","$menuname",
 "height=350,width=150,scrollbars=no,menubar=no,top=5,left=5,screenX=5,screenY=5");
 ENDOPEN
@@ -145,7 +165,7 @@
 sub clear {
     my ($row,$col)=@_;
     unless ($ENV{'browser.interface'} eq 'textual') {
-       return qq(swmenu.clearbut($row,$col););
+       return "\n".qq(window.status+='.';swmenu.clearbut($row,$col););
    } else { return ''; }
 }
 
@@ -157,7 +177,7 @@
     $act=~s/\$udom/$udom/g;
     unless ($ENV{'browser.interface'} eq 'textual') {
        return "\n".
- qq(swmenu.switchbutton($row,$col,"$img","$top","$bot","$act","$desc"););
+ qq(window.status+='.';swmenu.switchbutton($row,$col,"$img","$top","$bot","$act","$desc"););
    } else {
        my $text=$top.' '.$bot;
        $text=~s/\- //;
@@ -193,7 +213,9 @@
     my $textualoverride=shift;
     my $output='';
     unless ($ENV{'browser.interface'} eq 'textual') {
-       $output.="var swmenu=".&openmenu();
+       $output.=
+ "window.status='Opening Remote Control';var swmenu=".&openmenu().
+"\nwindow.status='Configuring Remote Control ';";
     } else {
        unless ($textualoverride) { return ''; }
     }
@@ -264,7 +286,7 @@
         }
     }
     unless ($ENV{'browser.interface'} eq 'textual') {
-       $output.="swmenu.syncclock(1000*".time.");";
+       $output.="\nwindow.status='Synchronizing Time';swmenu.syncclock(1000*".time.");\nwindow.status='Remote Control Configured.';";
     }
     return $output;
 }
@@ -272,13 +294,19 @@
 # ======================================================================= Close
 
 sub close {
+    if ($ENV{'browser.interface'} eq 'textual') { return ''; }
     my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
     return(<<ENDCLOSE);
 <script>
+window.status='Accessing Remote Control';
 menu=window.open("/adm/rat/empty.html","$menuname",
                  "height=350,width=150,scrollbars=no,menubar=no");
+window.status='Disabling Remote Control';
+menu.active=0;
 menu.autologout=0;
+window.status='Closing Remote Control';
 menu.close();
+window.status='Done.';
 </script>
 ENDCLOSE
 }