[LON-CAPA-cvs] cvs: loncom /auth lonauth.pm /interface lonmenu.pm lonremote.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 28 Oct 2004 16:25:23 -0000


albertel		Thu Oct 28 12:25:23 2004 EDT

  Modified files:              
    /loncom/auth	lonauth.pm 
    /loncom/interface	lonremote.pm lonmenu.pm 
  Log:
  - let user know what we are doing when we are loading the remote, also provide a link to disable the remote control, should addres BUG#3572 and related
  
  
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.62 loncom/auth/lonauth.pm:1.63
--- loncom/auth/lonauth.pm:1.62	Tue Mar 16 15:42:50 2004
+++ loncom/auth/lonauth.pm	Thu Oct 28 12:25:19 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonauth.pm,v 1.62 2004/03/16 20:42:50 albertel Exp $
+# $Id: lonauth.pm,v 1.63 2004/10/28 16:25:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -181,6 +181,7 @@
 # -------------------------------------------------------- Menu script and info
     my $windowinfo=&Apache::lonmenu::open($clientos);
     my $startupremote=&Apache::lonmenu::startupremote($lowerurl);
+    my $remoteinfo=&Apache::lonmenu::load_remote_msg($lowerurl);
     my $setflags=&Apache::lonmenu::setflags();
     my $maincall=&Apache::lonmenu::maincall();
     my $bodytag=&Apache::loncommon::bodytag('Successful Login');
@@ -210,6 +211,7 @@
 <h1>$lt{'wel'}</h1>
 $lt{'mes'}.<p>
 <a href="/adm/$lt{'log'}">$lt{'pro'}?</a></p>
+$remoteinfo
 $maincall
 </body>
 </html>
Index: loncom/interface/lonremote.pm
diff -u loncom/interface/lonremote.pm:1.13 loncom/interface/lonremote.pm:1.14
--- loncom/interface/lonremote.pm:1.13	Thu Jul 15 15:59:46 2004
+++ loncom/interface/lonremote.pm	Thu Oct 28 12:25:21 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonremote.pm,v 1.13 2004/07/15 19:59:46 albertel Exp $
+# $Id: lonremote.pm,v 1.14 2004/10/28 16:25:21 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -43,6 +43,7 @@
 # -------------------------------------------------------- Menu script and info
     my $windowinfo=&Apache::lonmenu::open($ENV{'browser.os'});
     my $startupremote=&Apache::lonmenu::startupremote($lowerurl);
+    my $remoteinfo=&Apache::lonmenu::load_remote_msg($lowerurl);
     my $setflags=&Apache::lonmenu::setflags();
     my $maincall=&Apache::lonmenu::maincall();
     my $bodytag=&Apache::loncommon::bodytag('Launch Remote Control');
@@ -56,8 +57,9 @@
 $bodytag
 $setflags
 $windowinfo
-$maincall
 $message
+$remoteinfo
+$maincall
 </body>
 </html>
 ENDLAUNCH
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.117 loncom/interface/lonmenu.pm:1.118
--- loncom/interface/lonmenu.pm:1.117	Sat Sep 18 12:55:33 2004
+++ loncom/interface/lonmenu.pm	Thu Oct 28 12:25:21 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.117 2004/09/18 16:55:33 albertel Exp $
+# $Id: lonmenu.pm,v 1.118 2004/10/28 16:25:21 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -532,11 +532,18 @@
 #
     my $configmenu=&rawconfig();
     my $esclowerurl=&Apache::lonnet::escape($lowerurl);
-
+    my $message=&mt('"Waiting for remote to load "+[_1]','waited');
     return(<<ENDREMOTESTARTUP);
 <script>
-
+var timestart;
 function wheelswitch() {
+    if (typeof(document.wheel) != 'undefined') {
+	if (typeof(document.wheel.spin) != 'undefined') {
+	    var date=new Date();
+	    var waited=Math.round(30-((date.getTime()-timestart)/1000));
+	    document.wheel.spin.value=$message;
+	}
+    }
    if (window.status=='|') { 
       window.status='/'; 
    } else {
@@ -573,6 +580,8 @@
 function main() {
    canceltim=setTimeout('tim=1;',30000);
    window.status='-';
+   var date=new Date();
+   timestart=date.getTime();
    wait();
 }
 
@@ -598,6 +607,25 @@
 </script>
 ENDMAINCALL
 }
+
+sub load_remote_msg {
+    my ($lowerurl)=@_;
+
+    if (($ENV{'browser.interface'} eq 'textual') ||
+        ($ENV{'environment.remote'} eq 'off')) { return ''; }
+
+    my $esclowerurl=&Apache::lonnet::escape($lowerurl);
+    my $link=&mt('<a href="[_1]">Continue</a> on in inline remote mode',
+		    "/adm/remote?action=collapse?url=$esclowerurl");
+    return(<<ENDREMOTEFORM);
+<p>
+<form name="wheel">
+<input name="spin" type="text" size="40"/>
+</form>
+</p>
+<p>$link</p>
+ENDREMOTEFORM
+}
 # ================================================================= Reopen menu
 
 sub reopenmenu {