[LON-CAPA-cvs] cvs: loncom /auth lonlogin.pm /interface loncommon.pm

raeburn raeburn at source.lon-capa.org
Tue May 3 18:33:52 EDT 2016


raeburn		Tue May  3 22:33:52 2016 EDT

  Modified files:              
    /loncom/auth	lonlogin.pm 
    /loncom/interface	loncommon.pm 
  Log:
  - Improve display of log-in page for mobile devices with small viewports.
  
  
Index: loncom/auth/lonlogin.pm
diff -u loncom/auth/lonlogin.pm:1.167 loncom/auth/lonlogin.pm:1.168
--- loncom/auth/lonlogin.pm:1.167	Tue May  3 22:27:14 2016
+++ loncom/auth/lonlogin.pm	Tue May  3 22:33:49 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Login Screen
 #
-# $Id: lonlogin.pm,v 1.167 2016/05/03 22:27:14 raeburn Exp $
+# $Id: lonlogin.pm,v 1.168 2016/05/03 22:33:49 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -523,7 +523,7 @@
         $r->print(<<HEADER);
 <!-- The LON-CAPA Header -->
 <div style="background:$pgbg;margin:0;width:100%;">
-  <img src="$img" border="0" alt="The Learning Online Network with CAPA" />
+  <img src="$img" border="0" alt="The Learning Online Network with CAPA" class="LC_maxwidth" />
 </div>
 HEADER
     }
@@ -547,7 +547,7 @@
 <div>
 ENDTOP
     if ($showmainlogo) {
-        $r->print(' <img src="'.$logo.'" alt="" />'."\n");
+        $r->print(' <img src="'.$logo.'" alt="" class="LC_maxwidth" />'."\n");
     }
 $r->print(<<ENDTOP);
 $announcements
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1241 loncom/interface/loncommon.pm:1.1242
--- loncom/interface/loncommon.pm:1.1241	Sat Apr  9 18:43:32 2016
+++ loncom/interface/loncommon.pm	Tue May  3 22:33:52 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1241 2016/04/09 18:43:32 raeburn Exp $
+# $Id: loncommon.pm,v 1.1242 2016/05/03 22:33:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5588,7 +5588,7 @@
     if (($crstype eq 'Placement') && (!$env{'request.role.adv'})) {
         undef($role);
     } else {
-        $role = '<span class="LC_nobreak">('.$role.')</span>' if $role;
+        $role = '<span class="LC_nobreak">('.$role.')</span>' if ($role && !$env{'browser.mobile'});
     }
 
         if ($env{'request.state'} eq 'construct') { $forcereg=1; }
@@ -5892,6 +5892,11 @@
   vertical-align: middle;
 }
 
+.LC_maxwidth {
+  max-width: 100%;
+  height: auto;
+}
+
 .LC_icon {
   border: none;
   vertical-align: middle;
@@ -7962,7 +7967,13 @@
     $result .= '>' 
         .$inhibitprint
 	.$head_extra;
-    if ($env{'browser.mobile'}) {
+    my $clientmobile;
+    if (($env{'user.name'} eq '') && ($env{'user.domain'} eq '')) {
+        (undef,undef,undef,undef,undef,undef,$clientmobile) = &decode_user_agent();
+    } else {
+        $clientmobile = $env{'browser.mobile'};
+    }
+    if ($clientmobile) {
         $result .= '
 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
 <meta name="apple-mobile-web-app-capable" content="yes" />';




More information about the LON-CAPA-cvs mailing list