Diff for /loncom/xml/londefdef.pm between versions 1.456.2.1 and 1.462

version 1.456.2.1, 2016/08/10 00:29:06 version 1.462, 2016/08/13 19:39:40
Line 92  sub start_m { Line 92  sub start_m {
     my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);      my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
     if ($target eq 'web' || $target eq 'analyze') {      if ($target eq 'web' || $target eq 'analyze') {
  &Apache::lonxml::debug("M is starting with:$inside:");   &Apache::lonxml::debug("M is starting with:$inside:");
           if (!($inside =~ /^\s*\$.*\$\s*$/ || $inside =~ /^\s*\\[([].*\\[)\]]\s*$/)) {
               # Non-math LaTeX will not be rendered correctly with MathJax
               # and it should be avoided anyway.
               # On top of that, MathJax will render math without $, but
               # it will fail with tth. This is worth a warning.
               # (even though some people might just use latex for printing)
               &Apache::lonxml::warning(&mt("Missing \$ in <m>."));
           }
  my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval);   my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval);
  if ($eval eq 'on') {   if ($eval eq 'on') {
     $inside=&Apache::run::evaluate($inside,$safeeval,$$parstack[-1]);      $inside=&Apache::run::evaluate($inside,$safeeval,$$parstack[-1]);
Line 638  sub edit_controls { Line 646  sub edit_controls {
     }      }
     $result .= '      $result .= '
 <div><input type="submit" name="editmode" accesskey="e" value="'.&mt('Edit').'" />';  <div><input type="submit" name="editmode" accesskey="e" value="'.&mt('Edit').'" />';
       if ($env{'browser.type'} ne 'explorer' || $env{'browser.version'} > 9) {
           my $uri = $env{'request.uri'};
           my $daxeurl = '/daxepage'.$uri;
           $result .= '<input type="button" value="'.&mt('Edit with Daxe').'" '.
                     'onclick="window.open(\''.$daxeurl.'\',\'_blank\');" />';
       }
     if (($env{'request.course.id'}) && ($env{'form.forceedit'})) {      if (($env{'request.course.id'}) && ($env{'form.forceedit'})) {
         my $url=&Apache::lonnet::hreflocation('',$env{'request.filename'});          my $url=&Apache::lonnet::hreflocation('',$env{'request.filename'});
         if ($url =~ /\.html?$/i) {          if ($url =~ /\.html?$/i) {
Line 2858  sub start_img { Line 2872  sub start_img {
         my $only = join(',',&Apache::loncommon::filecategorytypes('Pictures'));          my $only = join(',',&Apache::loncommon::filecategorytypes('Pictures'));
  $currentstring .=&Apache::edit::tag_start($target,$token);   $currentstring .=&Apache::edit::tag_start($target,$token);
  $currentstring .=&Apache::edit::text_arg('Image Url:','src',$token,70).   $currentstring .=&Apache::edit::text_arg('Image Url:','src',$token,70).
     &Apache::edit::browse('src',undef,'alt',$only).' '.                           &Apache::edit::browse_or_search('src',undef,'alt',$only,undef,1).
     &Apache::edit::search('src',undef,'alt').'<br />';                           '<br />';
  $currentstring .=&Apache::edit::text_arg('Description:','alt',$token,70).'<br />';   $currentstring .=&Apache::edit::text_arg('Description:','alt',$token,70).'<br />';
  $currentstring .=&Apache::edit::text_arg('width (pixel):','width',$token,5);   $currentstring .=&Apache::edit::text_arg('width (pixel):','width',$token,5);
  $currentstring .=&Apache::edit::text_arg('height (pixel):','height',$token,5).'<br />';   $currentstring .=&Apache::edit::text_arg('height (pixel):','height',$token,5).'<br />';
Line 2881  sub start_img { Line 2895  sub start_img {
  my $src=    &Apache::lonxml::get_param('src',$parstack,$safeeval);   my $src=    &Apache::lonxml::get_param('src',$parstack,$safeeval);
  my $width=  &Apache::lonxml::get_param('width',$parstack,$safeeval);   my $width=  &Apache::lonxml::get_param('width',$parstack,$safeeval);
  my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval);   my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval);
           my $element = &Apache::edit::get_element('src'); 
           my $text;
         if ($token->[2]{'src'}=~/\$/) {          if ($token->[2]{'src'}=~/\$/) {
            $currentstring.=&mt('Variable image source');             $text = &mt('Variable image source');
         } elsif ($token->[2]{'src'}=~/\S/) {          } elsif ($token->[2]{'src'}=~/\S/) {
    $currentstring .= '<img src="'.$src.'" alt="'.$alt.'" ';     $currentstring .= '<img src="'.$src.'" alt="'.$alt.'" ';
    if ($width) { $currentstring.=' width="'.$width.'" '; }     if ($width) { $currentstring.=' width="'.$width.'" '; }
    if ($height) { $currentstring.=' height="'.$height.'" '; }     if ($height) { $currentstring.=' height="'.$height.'" '; }
    $currentstring .= ' />';     $currentstring .= ' id="previewimg_'.$element.'" />';
         } else {          } else {
            $currentstring.=&mt("No image source specified");             $text = &mt("No image source specified");
         }          }
           $currentstring .= ' <span id="showimg_'.$element.'">'.$text.'</span>';
     } elsif ($target eq 'modified') {      } elsif ($target eq 'modified') {
  my ($osrc,$owidth,$oheight)=   my ($osrc,$owidth,$oheight)=
     ($token->[2]{'src'},$token->[2]{'width'},$token->[2]{'height'});      ($token->[2]{'src'},$token->[2]{'width'},$token->[2]{'height'});
Line 4552  sub latex_header { Line 4568  sub latex_header {
  ($mode eq 'batchmode')) {$currentstring .='\batchmode';}    ($mode eq 'batchmode')) {$currentstring .='\batchmode';} 
     $currentstring .= '\newcommand{\keephidden}[1]{}'.      $currentstring .= '\newcommand{\keephidden}[1]{}'.
  '\renewcommand{\deg}{$^{\circ}$}'.   '\renewcommand{\deg}{$^{\circ}$}'.
  '\usepackage{multirow}'.   '\usepackage{multirow}'."\n".
  '\usepackage{longtable}'.   '\usepackage{longtable}'."\n".
  '\usepackage{textcomp}'.   '\usepackage{textcomp}'."\n".
  '\usepackage{makeidx}'.   '\usepackage{makeidx}'."\n".
  '\usepackage[dvips]{graphicx}'.   '\usepackage[dvips]{graphicx}'."\n".
  '\usepackage{wrapfig}'.   '\usepackage{wrapfig}'."\n".
  '\usepackage{picins}'.   '\usepackage{picins}'."\n".
  '\usepackage[T1]{fontenc}'."\n".   '\usepackage[T1]{fontenc}'."\n".
  '\usepackage{lmodern}'."\n".   '\usepackage{lmodern}'."\n".
  '\usepackage[postscript]{ucs}'."\n".   '\usepackage[postscript]{ucs}'."\n".
  '\usepackage[utf8x]{inputenc}'."\n".   '\usepackage[utf8x]{inputenc}'."\n".
  '\usepackage{pifont}' ."\n".   '\usepackage{pifont}'."\n".
  '\usepackage{latexsym}'."\n".   '\usepackage{latexsym}'."\n".
  '\usepackage{epsfig}'.   '\usepackage{epsfig}'."\n".
  "\\usepackage{xtab}\n".   '\usepackage{xtab}'."\n".
  "\\usepackage{tabularx}\n".   '\usepackage{tabularx}'."\n".
  "\\usepackage{booktabs}\n".   '\usepackage{booktabs}'."\n".
  "\\usepackage{array}\n".   '\usepackage{array}'."\n".
  "\\usepackage{colortbl}\n".   '\usepackage{colortbl}'."\n".
  "\\usepackage{xcolor}\n".   '\usepackage{xcolor}'."\n".
  '\usepackage{calc}'.   '\usepackage{calc}'."\n".
  '\usepackage{amsmath}'.   '\usepackage{amsmath}'."\n".
  '\usepackage{soul}'.   '\usepackage{soul}'."\n".
  '\usepackage{amssymb}'.   '\usepackage{amssymb}'."\n".
  '\usepackage{amsfonts}'.   '\usepackage{amsfonts}'."\n".
  '\usepackage{amsthm}'.   '\usepackage{amsthm}'."\n".
  '\usepackage{amscd}'   '\usepackage{amscd}'."\n".
         .'\usepackage{picins}\usepackage{calc}'."\n". # From lonprintout.pm   '\usepackage{actuarialangle}'."\n";
  '\usepackage[T1]{fontenc}'."\n".  
  '\usepackage{lmodern}'."\n".  
  '\usepackage[postscript]{ucs}'."\n".  
  '\usepackage[utf8x]{inputenc}'."\n".  
  '\usepackage{pifont}'  . "\n";  
   
     if($env{'form.pdfFormFields'} eq 'yes') {      if($env{'form.pdfFormFields'} eq 'yes') {
  $currentstring .= '\usepackage{hyperref}'.   $currentstring .= '\usepackage{hyperref}'.
     '\usepackage{eforms}'.      '\usepackage{eforms}'.

Removed from v.1.456.2.1  
changed lines
  Added in v.1.462


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