[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonpreferences.pm

raeburn raeburn at source.lon-capa.org
Fri Aug 5 16:47:31 EDT 2016


raeburn		Fri Aug  5 20:47:31 2016 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonpreferences.pm 
  Log:
  - For 2.11
    - Backport 1.220 (part)
  
  
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.196.4.17 loncom/interface/lonpreferences.pm:1.196.4.18
--- loncom/interface/lonpreferences.pm:1.196.4.17	Wed Jan 27 01:43:01 2016
+++ loncom/interface/lonpreferences.pm	Fri Aug  5 20:47:30 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.196.4.17 2016/01/27 01:43:01 raeburn Exp $
+# $Id: lonpreferences.pm,v 1.196.4.18 2016/08/05 20:47:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -160,11 +160,13 @@
     my $domain     = $env{'user.domain'};
     my %userenv = &Apache::lonnet::get('environment',['texengine']);
     my $texengine=$userenv{'texengine'};
+    if (lc($texengine) eq 'jsmath') {
+        $texengine = 'MathJax';
+    }
 
     my %mathchoices=('' => 'Default',
 		     'tth' => 'tth (TeX to HTML)',
 		     #'ttm' => 'TeX to MathML',
-		     'jsMath' => 'jsMath',
                      'MathJax' => 'MathJax',
 		     'mimetex' => 'mimetex (Convert to Images)',
                      'raw' => 'Raw (Screen Reader)'
@@ -176,7 +178,6 @@
                'texengine',
                \%mathchoices);
     my $MathJax_start=&Apache::lontexconvert::MathJax_header();
-    my $jsMath_start=&Apache::lontexconvert::jsMath_header();
     my %lt=&Apache::lonlocal::texthash(
       'headline' => 'Change how math is displayed',
       'preftxt'  => 'Preferred method to display math',
@@ -184,26 +185,10 @@
       'exmpl'    => 'Examples',
       'mathjax'  => 'MathJax:',
       'mathjaxinfo' =>  'MathJax provides rendered equations whose source code can be extracted in TeX and MathML formats by right clicking the equation.',
-      'jsmath'   => 'jsMath:',
       'tth'      => 'tth (TeX to HTML):',
       'mimetex'  => 'mimetex (Convert to Images):',
     );
 
-    my $jsMathWarning='<p>'
-                     .'<div class="LC_warning">'
-                     .&mt("It looks like you don't have the TeX math fonts installed.")
-                     .'</div>'
-                     .'<div>'
-                     .&mt('The jsMath example on this page may not look right without them. '
-                         .'The [_1]jsMath Home Page[_2] has information on how to download the '
-                         .'needed fonts. In the meantime, jsMath will do the best it can '
-                         .'with the fonts you have, but it may not be pretty and some equations '
-                         .'may not be rendered correctly.'
-                         ,'<a href="http://www.math.union.edu/locate/jsMath/" target="_blank">'
-                         ,'</a>')
-                     .'</div>'
-                     .'</p>';
-
     $r->print(<<ENDLSCREEN);
 <h2>$lt{'headline'}</h2>
 <form name="prefs" action="/adm/preferences" method="post">
@@ -226,18 +211,6 @@
 $lt{'mathjaxinfo'}
 </p>
 
-<h3>$lt{'jsmath'}</h3> 
-<p>
-$jsMath_start
-<script type="text/javascript" language="JavaScript">
-if (jsMath.nofonts == 1) {
-    document.writeln($jsMathWarning);
-}
-
-</script>
-<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=jsMath" width="400" height="150"></iframe>
-</p>
-
 <h3>$lt{'mimetex'}</h3>
 <p>
 <iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=mimetex" width="400" height="150"></iframe>
@@ -248,9 +221,6 @@
 <iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="150"></iframe>
 </p>
 ENDLSCREEN
-    if ($env{'environment.texengine'} ne 'jsMath') {
-	$r->print('<script type="text/javascript" language="JavaScript">jsMath.Process()</script>');
-    }
 }
 
 
@@ -261,6 +231,9 @@
 # Screenname
     my $newtexengine  = $env{'form.texengine'};
     $newtexengine=~s/[^\-\w]//g;
+    if (lc($newtexengine) eq 'jsmath') {
+        $newtexengine = 'MathJax';
+    }
     if ($newtexengine eq 'ttm') {
 	&Apache::lonnet::appenv({'browser.mathml' => 1});
     } else {




More information about the LON-CAPA-cvs mailing list