--- loncom/interface/lonpreferences.pm 2012/02/17 03:32:34 1.186.2.8.2.2 +++ loncom/interface/lonpreferences.pm 2011/12/06 16:17:07 1.195 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.186.2.8.2.2 2012/02/17 03:32:34 raeburn Exp $ +# $Id: lonpreferences.pm,v 1.195 2011/12/06 16:17:07 dseaton Exp $ # # Copyright Michigan State University Board of Trustees # @@ -227,6 +227,7 @@ sub texenginechanger { 'tth' => 'tth (TeX to HTML)', #'ttm' => 'TeX to MathML', 'jsMath' => 'jsMath', + 'MathJax' => 'MathJax', 'mimetex' => 'mimetex (Convert to Images)', 'raw' => 'Raw (Screen Reader)' ); @@ -236,12 +237,14 @@ sub texenginechanger { $texengine, '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', 'change' => 'Save', 'exmpl' => 'Examples', + 'mathjax' => 'MathJax:', 'jsmath' => 'jsMath:', 'tth' => 'tth (TeX to HTML):', 'mimetex' => 'mimetex (Convert to Images):', @@ -276,6 +279,14 @@ $lt{'preftxt'}: $selectionbox
$lt{'exmpl'} +

$lt{'mathjax'}

+ + +

+

+MathJax provides rendered equations whose source code can be extracted in TeX and MathML formats by right clicking the equation. +

+

$lt{'jsmath'}

$jsMath_start @@ -283,6 +294,7 @@ $jsMath_start if (jsMath.nofonts == 1) { document.writeln($jsMathWarning); } +

@@ -620,7 +632,7 @@ sub iconchanger { my ($inlinetools,$toolsorder) = &icon_previews(); if ((ref($inlinetools) eq 'HASH') && (ref($toolsorder) eq 'ARRAY')) { foreach my $tool (@{$toolsorder}) { - my ($command,$row,$col,$img,$top,$bot,$act,$desc) = + my ($command,$row,$col,$img,$top,$bot,$act,$desc) = split(/\&/,$inlinetools->{$tool}); $iconic_preview .= '
  • '.$desc.''.$top.(' ' x 2).'
  • '; $iconsonly_preview .= '
  • '.$desc.' 
  • '; @@ -633,7 +645,7 @@ sub iconchanger { $iconic_preview = ''; + ''; $r->print(< @@ -663,17 +675,16 @@ sub verify_and_change_icons { } sub icon_options { - my %lt = &Apache::lonlocal::texthash( - iconic => 'Use icons and text', - iconsonly => 'Use icons only', - ); - return %lt; + return &Apache::lonlocal::texthash( + iconic => 'Use icons and text', + iconsonly => 'Use icons only', + ); } sub icon_previews { my %icon_text = ( annotate => 'Notes', - bookmark => 'Bookmark', + wishlist => 'Wishlist', catalog => 'Info', evaluate => 'Evaluate', feedback => 'Communicate', @@ -681,13 +692,13 @@ sub icon_previews { ); my %inlinetools = ( printout => "s&8&3&prt.png&$icon_text{'printout'}&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document", - bookmark => "s&9&1&sbkm.png&$icon_text{'bookmark'}&bookmark[_2]&set_bookmark()&Set a bookmark for this resource", + wishlist => "s&9&1&wishlist-link.png&$icon_text{'wishlist'}&wishlistlink[_2]&set_wishlistlink()&Set a link for this resource to wishlist", evaluate => "s&8&1&eval.png&$icon_text{'evaluate'}&this[_1]&gopost('/adm/evaluate',currentURL,1)&Provide my evaluation of this resource", feedback => "s&8&2&fdbk.png&$icon_text{'feedback'}&discuss[_1]&gopost('/adm/feedback',currentURL,1)&Provide feedback messages or contribute to the course discussion about this resource", annotate => "s&9&3&anot.png&$icon_text{'annotate'}&tations[_1]&annotate()&Make notes and annotations about this resource", catalog => "s&6&3&catalog.png&$icon_text{'catalog'}&info[_1]&catalog_info()&Show Metadata", ); - my @toolsorder = qw(annotate bookmark evaluate feedback printout catalog); + my @toolsorder = qw(annotate wishlist evaluate feedback printout catalog); return (\%inlinetools,\@toolsorder); } @@ -1326,7 +1337,7 @@ sub passwordchanger { if (&Apache::lonnet::domain($domain) eq '') { $domain = $r->dir_config('lonDefDomain'); } - } else { + } else { $r->print(&mt('Page requested in unexpected context').'
    '); return; } @@ -1360,7 +1371,7 @@ sub passwordchanger { my $jsh=Apache::File->new($include."/londes.js"); $r->print(<$jsh>); } - $r->print(&jscript_send($caller,$domain)); + $r->print(&jscript_send($caller)); $r->print(< @@ -1405,19 +1416,8 @@ sub jscript_send { $output .= qq| this.document.pserver.elements.uname.value = this.document.client.elements.uname.value; -|; - if ($domain eq 'relate') { - $output .= qq| - this.document.pserver.elements.udom.value = - this.document.client.elements.udom.value; -|; - } else { - $output .= qq| this.document.pserver.elements.udom.value = this.document.client.elements.udom.options[this.document.client.elements.udom.selectedIndex].value; -|; - } - $output .= qq| this.document.pserver.elements.email.value = this.document.client.elements.email.value; |; @@ -1450,18 +1450,13 @@ sub client_form { .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title( '') - .'' - .''; - if ($defdom eq 'relate') { - $output .= '' - .&Apache::lonhtmlcommon::row_closure(); - } else { - $output .= &Apache::lonhtmlcommon::row_closure() - .&Apache::lonhtmlcommon::row_title( - '') - .&Apache::loncommon::select_dom_form($defdom,'udom') - .&Apache::lonhtmlcommon::row_closure(); - } + .'' + .'' + .&Apache::lonhtmlcommon::row_closure() + .&Apache::lonhtmlcommon::row_title( + '') + .&Apache::loncommon::select_dom_form($defdom,'udom') + .&Apache::lonhtmlcommon::row_closure(); } else { $output .= &Apache::lonhtmlcommon::row_title( '') @@ -2113,26 +2108,6 @@ push(@{ $menu[0]->{items} }, { linktitle => 'Change your password.', }); } - if ($env{'environment.remote'} eq 'off') { -push(@{ $menu[1]->{items} }, { - linktext => 'Launch Remote Control', - url => '/adm/remote?url=/adm/preferences&action=launch', - permission => 'F', - #help => '', - icon => 'remotecontrol.png', - linktitle => 'Launch the remote control for LON-CAPA.', - }); - }else{ -push(@{ $menu[1]->{items} }, { - linktext => 'Collapse Remote Control', - url => '/adm/remote?url=/adm/preferences&action=collapse', - permission => 'F', - #help => '', - icon => 'remotecontrol.png', - linktitle => 'Collapse the remote control for LON-CAPA.', - }); - } - if (&can_toggle_namelocking()) { push(@{ $menu[0]->{items} }, {