[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 25 Jul 2003 19:56:37 -0000


matthew		Fri Jul 25 15:56:37 2003 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  Fix Bug 1382 - progress window scrolls when viewed on Mac/IE.
  Do not output the last item time if the user is burdened
  with both a Mac and IE.  Worth considering for 1.0, I guess.
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.27 loncom/interface/lonhtmlcommon.pm:1.28
--- loncom/interface/lonhtmlcommon.pm:1.27	Fri Jul 11 12:07:20 2003
+++ loncom/interface/lonhtmlcommon.pm	Fri Jul 25 15:56:37 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.27 2003/07/11 16:07:20 matthew Exp $
+# $Id: lonhtmlcommon.pm,v 1.28 2003/07/25 19:56:37 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -734,7 +734,7 @@
 	      "<body bgcolor=\"#88DDFF\">".
               "<h4>$heading</h4>".
               "<form name=popremain>".
-              "<input type=text size=55 name=remaining value=Starting></form>".
+              '<input type="text" size="55" name="remaining" value="Starting"></form>'.
               "</body></html>\');".
     "popwin.document.close();".
     "</script>");
@@ -792,6 +792,16 @@
         $lasttime = '('.$lasttime.' second for '.$extraInfo.')';
     } else {
         $lasttime = '('.$lasttime.' seconds for '.$extraInfo.')';
+    }
+    #
+    my $user_browser = $ENV{'browser.type'} if (exists($ENV{'browser.type'}));
+    my $user_os      = $ENV{'browser.os'}   if (exists($ENV{'browser.os'}));
+    if (! defined($user_browser) || ! defined($user_os)) {
+        (undef,$user_browser,undef,undef,undef,$user_os) = 
+                           &Apache::loncommon::decode_user_agent();
+    }
+    if ($user_browser eq 'explorer' && $user_os =~ 'mac') {
+        $lasttime = '';
     }
     $r->print('<script>popwin.document.popremain.remaining.value="'.
 	      $$prog_state{'done'}.'/'.$$prog_state{'max'}.