Diff for /loncom/xml/londefdef.pm between versions 1.456.2.6.2.4 and 1.463

version 1.456.2.6.2.4, 2024/02/28 18:15:50 version 1.463, 2017/01/27 18:27:05
Line 98  sub start_m { Line 98  sub start_m {
             # On top of that, MathJax will render math without $, but              # On top of that, MathJax will render math without $, but
             # it will fail with tth. This is worth a warning.              # it will fail with tth. This is worth a warning.
             # (even though some people might just use latex for printing)              # (even though some people might just use latex for printing)
             &Apache::lonxml::warning(&mt('Missing $ in [_1].','<m>'));              &Apache::lonxml::warning(&mt("Missing \$ in <m>."));
         } elsif (($env{'browser.type'} eq 'safari') && ($env{'form.editxmltext'}) &&  
                  (($env{'form.problemmode'} eq 'view') || ($env{'form.problemmode'} eq 'discard'))) {  
             my $delimiter;  
             if ($inside =~ /\$$/) {  
                 $delimiter = '$';  
             } elsif ($inside =~ /\\([)\]])$/) {  
                 $delimiter = $1;  
             }  
             if ($delimiter) {  
                 &Apache::lonxml::warning(&mt('Insert a space between [_1] and [_2].',  
                                              $delimiter,'</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') {
Line 367  sub start_title { Line 355  sub start_title {
  $Apache::londefdef::title =    $Apache::londefdef::title = 
     &Apache::lonxml::get_all_text('/title',$parser,$style);      &Apache::lonxml::get_all_text('/title',$parser,$style);
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring .= '\keephidden{Title of the document:  ';    $currentstring .= '\keephidden{Title of the document:  ' 
     }      }
     if ($target eq 'meta') {      if ($target eq 'meta') {
  $currentstring='<title>';   $currentstring='<title>';
Line 612  sub start_body { Line 600  sub start_body {
             if ($env{'request.use_absolute'}) {              if ($env{'request.use_absolute'}) {
                 $args->{'use_absolute'} = $env{'request.use_absolute'};                  $args->{'use_absolute'} = $env{'request.use_absolute'};
             }              }
             if ($env{'form.only_body'}) {  
                 $args->{'only_body'} = 1;  
             }  
         }          }
  $currentstring =    $currentstring = 
     &Apache::loncommon::start_page($Apache::londefdef::title,      &Apache::loncommon::start_page($Apache::londefdef::title,
Line 649  sub start_body { Line 634  sub start_body {
   
 sub edit_controls {  sub edit_controls {
     my ($nochgview) = @_;      my ($nochgview) = @_;
     my $result = &Apache::lonxml::seteditor_javascript().'      my $result .= '
 <form method="post" action="">  <form method="post" action="">
 <div class="LC_edit_problem_header">'."\n";  <div class="LC_edit_problem_header">';
     unless ($nochgview) {      unless ($nochgview) {
         $result .= '          $result .= '
 <div class="LC_edit_problem_header_row1">'.  <div class="LC_edit_problem_header_row1">'.
Line 660  sub edit_controls { Line 645  sub edit_controls {
 </div>';  </div>';
     }      }
     $result .= '      $result .= '
 <div>  <div><input type="submit" name="editmode" accesskey="e" value="'.&mt('Edit').'" />';
 <input type="hidden" name="editmode" value="" />  
 <input type="button" name="editordefault" accesskey="e" value="'.&mt('Edit').  
 '" onclick="seteditmode(this.form,'."'edit'".');" />'."\n";  
     if ($env{'browser.type'} ne 'explorer' || $env{'browser.version'} > 9) {      if ($env{'browser.type'} ne 'explorer' || $env{'browser.version'} > 9) {
         my $uri = $env{'request.uri'};          my $uri = $env{'request.uri'};
         if ($uri =~ /\.(xml|html|htm|xhtml|xhtm)$/) {          my $daxeurl = '/daxepage'.$uri;
             my %editors = &Apache::loncommon::permitted_editors();          $result .= '<input type="button" value="'.&mt('Edit with Daxe').'" '.
             if ($editors{'daxe'}) {                    'onclick="window.open(\''.$daxeurl.'\',\'_blank\');" />';
                 my $daxeurl = '/daxepage'.$uri;  
                 $result .= '<input type="button" name="editordaxe" value="'.&mt('Edit with Daxe').  
                            '" onclick="seteditmode(this.form,'."'daxe'".');" />'."\n";  
             }  
         }  
     }      }
     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'});
Line 2895  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 2918  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 3284  sub end_externallink { Line 3263  sub end_externallink {
     return $currentstring;      return $currentstring;
 }  }
   
 #-- <blankspace height="">  #-- <blankspace heigth="">
 sub start_blankspace {  sub start_blankspace {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p(); # closes off any unclosed <p>      my $currentstring = &end_p(); # closes off any unclosed <p>
     if ($target eq 'tex') {      if ($target eq 'tex') {
  my $howmuch = &Apache::lonxml::get_param('height',$parstack,$safeeval,undef,1);   my $howmuch = &Apache::lonxml::get_param('heigth',$parstack,$safeeval,undef,1);
  $currentstring .= '\vskip '.$howmuch.' ';   $currentstring .= '\vskip '.$howmuch.' ';
     }      }
     return $currentstring;      return $currentstring;
Line 4295  sub resize_image { Line 4274  sub resize_image {
     $height_param=$TeXwidth/$old_width_param*$height_param;      $height_param=$TeXwidth/$old_width_param*$height_param;
  }   }
     } elsif ($TeXheight) {      } elsif ($TeXheight) {
    $height_param = $TeXheight;
  if ($height_param) {   if ($height_param) {
     $width_param  = $TeXheight/$height_param*$width_param;      $width_param  = $TeXheight/$height_param*$width_param;
  }   }
  $height_param = $TeXheight;  
     } elsif ($width) {      } elsif ($width) {
  my $old_width_param=$width_param;   my $old_width_param=$width_param;
  $width_param = $width*$scaling;   $width_param = $width*$scaling;

Removed from v.1.456.2.6.2.4  
changed lines
  Added in v.1.463


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