--- loncom/interface/lonpreferences.pm 2016/01/27 01:43:01 1.196.4.17 +++ loncom/interface/lonpreferences.pm 2016/08/10 23:50:07 1.196.4.19 @@ -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.19 2016/08/10 23:50:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -160,11 +160,13 @@ sub texenginechanger { 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 @@ sub texenginechanger { '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 @@ sub texenginechanger { '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='

' - .'

' - .&mt("It looks like you don't have the TeX math fonts installed.") - .'
' - .'
' - .&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.' - ,'' - ,'') - .'
' - .'

'; - $r->print(<$lt{'headline'}
@@ -226,18 +211,6 @@ $lt{'exmpl'} $lt{'mathjaxinfo'}

-

$lt{'jsmath'}

-

-$jsMath_start - - -

-

$lt{'mimetex'}

@@ -248,9 +221,6 @@ if (jsMath.nofonts == 1) {

ENDLSCREEN - if ($env{'environment.texengine'} ne 'jsMath') { - $r->print(''); - } } @@ -261,6 +231,9 @@ sub verify_and_change_texengine { # 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 { @@ -1375,21 +1348,18 @@ sub jscript_send { uextkey=this.document.client.elements.ukey_cpass.value; lextkey=this.document.client.elements.lkey_cpass.value; initkeys(); - - this.document.pserver.elements.currentpass.value - =crypted(this.document.client.elements.currentpass.value); - + this.document.pserver.elements.currentpass.value = + getCrypted(this.document.client.elements.currentpass.value); uextkey=this.document.client.elements.ukey_npass1.value; lextkey=this.document.client.elements.lkey_npass1.value; initkeys(); this.document.pserver.elements.newpass_1.value - =crypted(this.document.client.elements.newpass_1.value); - + =getCrypted(this.document.client.elements.newpass_1.value); uextkey=this.document.client.elements.ukey_npass2.value; lextkey=this.document.client.elements.lkey_npass2.value; initkeys(); this.document.pserver.elements.newpass_2.value - =crypted(this.document.client.elements.newpass_2.value); + =getCrypted(this.document.client.elements.newpass_2.value); |; if ($caller eq 'reset_by_email') { $output .= qq| @@ -1404,6 +1374,7 @@ sub jscript_send { $ output .= qq| this.document.pserver.submit(); } + |; } @@ -1429,7 +1400,7 @@ sub client_form { .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title( '') - .'' + .'' .'' .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title( @@ -1439,16 +1410,16 @@ sub client_form { } else { $output .= &Apache::lonhtmlcommon::row_title( '') - .'' + .'' .&Apache::lonhtmlcommon::row_closure(); } $output .= &Apache::lonhtmlcommon::row_title( '') - .'' + .'' .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title( '') - .'' + .'' .&Apache::lonhtmlcommon::row_closure(1) .&Apache::lonhtmlcommon::end_pick_box(); $output .= '

' @@ -2204,7 +2175,7 @@ sub handler { }elsif($env{'form.action'} eq 'changepass'){ &passwordchanger($r); }elsif($env{'form.action'} eq 'verify_and_change_pass'){ - &verify_and_change_password($r); + &verify_and_change_password($r,'preferences'); }elsif($env{'form.action'} eq 'changescreenname'){ &screennamechanger($r); }elsif($env{'form.action'} eq 'verify_and_change_screenname'){