Diff for /loncom/interface/lonpreferences.pm between versions 1.219 and 1.220

version 1.219, 2016/02/17 19:15:48 version 1.220, 2016/02/20 00:12:39
Line 160  sub texenginechanger { Line 160  sub texenginechanger {
     my $domain     = $env{'user.domain'};      my $domain     = $env{'user.domain'};
     my %userenv = &Apache::lonnet::get('environment',['texengine']);      my %userenv = &Apache::lonnet::get('environment',['texengine']);
     my $texengine=$userenv{'texengine'};      my $texengine=$userenv{'texengine'};
       if (lc($texengine) eq 'jsmath') {
           $texengine = 'MathJax';
       }
   
     my %mathchoices=('' => 'Default',      my %mathchoices=('' => 'Default',
      'tth' => 'tth (TeX to HTML)',       'tth' => 'tth (TeX to HTML)',
      #'ttm' => 'TeX to MathML',       #'ttm' => 'TeX to MathML',
      'jsMath' => 'jsMath',  
      'MathJax' => 'MathJax',       'MathJax' => 'MathJax',
      'mimetex' => 'mimetex (Convert to Images)',       'mimetex' => 'mimetex (Convert to Images)',
                      'raw' => 'Raw (Screen Reader)'                       'raw' => 'Raw (Screen Reader)'
Line 176  sub texenginechanger { Line 178  sub texenginechanger {
                'texengine',                 'texengine',
                \%mathchoices);                 \%mathchoices);
     my $MathJax_start=&Apache::lontexconvert::MathJax_header();      my $MathJax_start=&Apache::lontexconvert::MathJax_header();
     my $jsMath_start=&Apache::lontexconvert::jsMath_header();  
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
       'headline' => 'Change how math is displayed',        'headline' => 'Change how math is displayed',
       'preftxt'  => 'Preferred method to display math',        'preftxt'  => 'Preferred method to display math',
Line 184  sub texenginechanger { Line 185  sub texenginechanger {
       'exmpl'    => 'Examples',        'exmpl'    => 'Examples',
       'mathjax'  => 'MathJax:',        'mathjax'  => 'MathJax:',
       'mathjaxinfo' => 'MathJax provides rendered equations whose source code can be extracted in TeX and MathML formats by right clicking the equation.',        '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):',        'tth'      => 'tth (TeX to HTML):',
       'mimetex'  => 'mimetex (Convert to Images):',        '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);      $r->print(<<ENDLSCREEN);
 <h2>$lt{'headline'}</h2>  <h2>$lt{'headline'}</h2>
 <form name="prefs" action="/adm/preferences" method="post">  <form name="prefs" action="/adm/preferences" method="post">
Line 226  $lt{'exmpl'} Line 211  $lt{'exmpl'}
 $lt{'mathjaxinfo'}  $lt{'mathjaxinfo'}
 </p>  </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>  <h3>$lt{'mimetex'}</h3>
 <p>  <p>
 <iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=mimetex" width="400" height="150"></iframe>  <iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=mimetex" width="400" height="150"></iframe>
Line 248  if (jsMath.nofonts == 1) { Line 221  if (jsMath.nofonts == 1) {
 <iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="150"></iframe>  <iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="150"></iframe>
 </p>  </p>
 ENDLSCREEN  ENDLSCREEN
     if ($env{'environment.texengine'} ne 'jsMath') {  
  $r->print('<script type="text/javascript" language="JavaScript">jsMath.Process()</script>');  
     }  
 }  }
   
   
Line 261  sub verify_and_change_texengine { Line 231  sub verify_and_change_texengine {
 # Screenname  # Screenname
     my $newtexengine  = $env{'form.texengine'};      my $newtexengine  = $env{'form.texengine'};
     $newtexengine=~s/[^\-\w]//g;      $newtexengine=~s/[^\-\w]//g;
       if (lc($newtexengine) eq 'jsmath') {
           $newtexengine = 'MathJax';
       }
     if ($newtexengine eq 'ttm') {      if ($newtexengine eq 'ttm') {
  &Apache::lonnet::appenv({'browser.mathml' => 1});   &Apache::lonnet::appenv({'browser.mathml' => 1});
     } else {      } else {

Removed from v.1.219  
changed lines
  Added in v.1.220


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>