[LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf /homework functionplotresponse.pm /interface loncommon.pm lonhtmlcommon.pm

raeburn raeburn at source.lon-capa.org
Mon Jul 22 07:46:30 EDT 2013


raeburn		Mon Jul 22 11:46:30 2013 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonhtmlcommon.pm 
    /loncom/homework	functionplotresponse.pm 
    /loncom	loncapa_apache.conf 
  Log:
  - Correctly detect browser version for IE, in cases where Chrome Frame 
    plug-in is in use.
  - More comprehensive checking for HTML5 support for Geogebra , based on 
    decoding of user agent at log-in.
    - HTML5 used for:
      Chrome: version 14 or later
      Safari: version 536 or later (version 8536 for mobile safari).
      Firefox: version required dependent on os.
      IE: version 10 or later
  - Error message displayed when Java is disabled is different if user's 
    device is Ipad, Ipod or Iphone.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1140 loncom/interface/loncommon.pm:1.1141
--- loncom/interface/loncommon.pm:1.1140	Mon Jul 15 17:42:11 2013
+++ loncom/interface/loncommon.pm	Mon Jul 22 11:46:23 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1140 2013/07/15 17:42:11 raeburn Exp $
+# $Id: loncommon.pm,v 1.1141 2013/07/22 11:46:23 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2351,6 +2351,8 @@
 
 =item * $clientmobile
 
+=item * $clientinfo
+
 =back
 
 =back 
@@ -2381,6 +2383,7 @@
 	}
     }
     my $clientos='unknown';
+    my $clientinfo;
     if (($httpbrowser=~/linux/i) ||
         ($httpbrowser=~/unix/i) ||
         ($httpbrowser=~/ux/i) ||
@@ -2395,8 +2398,13 @@
     if ($httpbrowser=~/(Android|iPod|iPad|iPhone|webOS|Blackberry|Windows Phone|Opera m(?:ob|in)|Fennec)/i) {
         $clientmobile=lc($1);
     }
+    if ($httpbrowser=~ m{Firefox/(\d+\.\d+)}) {
+        $clientinfo = 'firefox-'.$1;
+    } elsif ($httpbrowser=~ m{chromeframe/(\d+\.\d+)\.}) {
+        $clientinfo = 'chromeframe-'.$1;
+    }
     return ($httpbrowser,$clientbrowser,$clientversion,$clientmathml,
-            $clientunicode,$clientos,$clientmobile);
+            $clientunicode,$clientos,$clientmobile,$clientinfo);
 }
 
 ###############################################################
@@ -14285,7 +14293,7 @@
 # ------------------------------------ Check browser type and MathML capability
 
     my ($httpbrowser,$clientbrowser,$clientversion,$clientmathml,
-        $clientunicode,$clientos,$clientmobile) = &decode_user_agent($r);
+        $clientunicode,$clientos,$clientmobile,$clientinfo) = &decode_user_agent($r);
 
 # ------------------------------------------------------------- Get environment
 
@@ -14317,6 +14325,7 @@
 	     "browser.unicode"    => $clientunicode,
 	     "browser.os"         => $clientos,
              "browser.mobile"     => $clientmobile,
+             "browser.info"       => $clientinfo,
 	     "server.domain"      => $Apache::lonnet::perlvar{'lonDefDomain'},
 	     "request.course.fn"  => '',
 	     "request.course.uri" => '',
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.351 loncom/interface/lonhtmlcommon.pm:1.352
--- loncom/interface/lonhtmlcommon.pm:1.351	Mon Jul 15 14:32:45 2013
+++ loncom/interface/lonhtmlcommon.pm	Mon Jul 22 11:46:23 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.351 2013/07/15 14:32:45 bisitz Exp $
+# $Id: lonhtmlcommon.pm,v 1.352 2013/07/22 11:46:23 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -64,9 +64,15 @@
 use LONCAPA qw(:DEFAULT :match);
 
 sub java_not_enabled {
-   return "\n".'<span class="LC_error">'.
-          &mt('The required Java applet could not be started. Please make sure to have Java installed and active in your browser.').
-          "</span>\n";
+    if (($env{'browser.mobile'}) && ($env{'browser.mobile'} =~ /^ipad|ipod|iphone$/i)) {
+        return "\n".'<span class="LC_error">'.
+               &mt('The required Java applet could not be started, because Java is not supported by your mobile device.').
+               "</span>\n";
+    } else {
+        return "\n".'<span class="LC_error">'.
+               &mt('The required Java applet could not be started. Please make sure to have Java installed and active in your browser.').
+               "</span>\n";
+    }
 }
 
 sub coursepreflink {
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.102 loncom/homework/functionplotresponse.pm:1.103
--- loncom/homework/functionplotresponse.pm:1.102	Fri Jul 12 21:19:17 2013
+++ loncom/homework/functionplotresponse.pm	Mon Jul 22 11:46:26 2013
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # Functionplot responses
 #
-# $Id: functionplotresponse.pm,v 1.102 2013/07/12 21:19:17 raeburn Exp $
+# $Id: functionplotresponse.pm,v 1.103 2013/07/22 11:46:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -49,9 +49,34 @@
 # Return a true value if HTML5 should be used.
 
 sub useHTML5 {
-    if  ($env{'browser.type'} eq 'chrome') { return 1; }
-    if (($env{'browser.type'} eq 'safari') &&
-        ($env{'browser.os'} eq 'mac')) { return 1; }
+    if ($env{'browser.type'} eq 'chrome') {
+        if ($env{'browser.version'} >= 14) {
+            return 1;
+        }
+    } elsif ($env{'browser.type'} eq 'safari') {
+        if ($env{'browser.os'} eq 'mac') {
+            my ($prefix,$version) = ($env{'browser.version'} =~ /^(\d*)(\d{3})\./); 
+            if ((!$env{'browser.mobile'}) || 
+                (($env{'browser.mobile'}) && length($prefix))) {
+                if ($version >= 536) {
+                    return 1;
+                }
+            }
+        }
+    } elsif ($env{'browser.type'} eq 'mozilla') {
+        if ($env{'browser.info'} =~ /^firefox\-(\d+)/) {
+            my $firefox = $1;
+            if ((($env{'browser.os'} eq 'mac') && ($firefox >= 20)) ||
+                (($env{'browser.os'} eq 'unix') && ($firefox >= 17)) ||
+                (($env{'browser.os'} eq 'win') && ($firefox >= 14))) {
+                return 1;
+            }
+        }
+    } elsif ($env{'browser.type'} eq 'explorer') { 
+        if (($env{'browser.os'} eq 'win') && ($env{'browser.version'} >= 10)) {
+            return 1;
+        }
+    }
     return 0;
 }
 
Index: loncom/loncapa_apache.conf
diff -u loncom/loncapa_apache.conf:1.224 loncom/loncapa_apache.conf:1.225
--- loncom/loncapa_apache.conf:1.224	Wed Feb 13 16:36:13 2013
+++ loncom/loncapa_apache.conf	Mon Jul 22 11:46:30 2013
@@ -2,7 +2,7 @@
 ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file
 ##
 
-# $Id: loncapa_apache.conf,v 1.224 2013/02/13 16:36:13 raeburn Exp $
+# $Id: loncapa_apache.conf,v 1.225 2013/07/22 11:46:30 raeburn Exp $
 
 #
 # LON-CAPA Section (extensions to httpd.conf daemon configuration)
@@ -1571,7 +1571,7 @@
 # - a number that describes the minimum version that has mathml support
 # - a number that describes the minimum number version that has unicode support
 
-PerlSetVar       lonBrowsDet  explorer:msie:netscape:msie\s(\d+\.\d+)\;:9999:5&mozilla:mozilla\/[5-9]:msie:mozilla\/(\d+\.\d+)\s:9999:1&netscape:netscape:msie:netscape\/(\d+\.\d+):9999:7&netscape:netscape\/[7-9]:shouldnotmatch:netscape\/(\d+\.\d+):9999:7&amaya:amaya:mozilla:V(\d+\.\d+)\s:1:1&safari:safari:msie:safari\/([\d\.]+):9999:84&chrome:chrome:shouldnotmatch:chrome\/(\d+\.\d+):9999:1
+PerlSetVar       lonBrowsDet  explorer:msie:netscape:msie\s(\d+\.\d+)\;:9999:5&mozilla:mozilla\/[5-9]:msie:mozilla\/(\d+\.\d+)\s:9999:1&netscape:netscape:msie:netscape\/(\d+\.\d+):9999:7&netscape:netscape\/[7-9]:shouldnotmatch:netscape\/(\d+\.\d+):9999:7&amaya:amaya:mozilla:V(\d+\.\d+)\s:1:1&safari:safari:msie:safari\/([\d\.]+):9999:84&chrome:chrome:chromeframe:\s+chrome\/(\d+\.\d+):9999:1
 
 PerlSetVar       lonTextBrowsers windows\s+ce:lynx
 PerlSetVar       lonScansDir  /home/httpd/scantron




More information about the LON-CAPA-cvs mailing list