Diff for /loncom/xml/scripttag.pm between versions 1.94 and 1.100

version 1.94, 2003/06/08 00:51:56 version 1.100, 2003/08/11 20:07:20
Line 45  BEGIN { Line 45  BEGIN {
      'window','display','storetc','physnet',       'window','display','storetc','physnet',
      'standalone','comment',       'standalone','comment',
      'LONCAPA_INTERNAL_TURN_STYLE_ON',       'LONCAPA_INTERNAL_TURN_STYLE_ON',
        'LONCAPA_INTERNAL_TURN_STYLE_OFF',
      'LONCAPA_INTERNAL_LONHTTPD_PORT'));       'LONCAPA_INTERNAL_LONHTTPD_PORT'));
 }  }
   
Line 63  sub end_LONCAPA_INTERNAL_TURN_STYLE_ON { Line 64  sub end_LONCAPA_INTERNAL_TURN_STYLE_ON {
     return ('','no');      return ('','no');
 }  }
   
   sub start_LONCAPA_INTERNAL_TURN_STYLE_OFF {
       my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
       $Apache::lonxml::usestyle=0;
       my $end=&Apache::lonxml::get_param('end',$parstack,$safeeval);
       if (!$end) {
    $Apache::lonxml::style_values=$$parstack[-1];
    $Apache::lonxml::style_end_values=$$parstack[-1];
       } else {
    $Apache::lonxml::style_values=$Apache::lonxml::style_end_values;
    $Apache::lonxml::style_end_values='';
       }
       return ('','no');
   }
   
   sub end_LONCAPA_INTERNAL_TURN_STYLE_OFF {
       return ('','no');
   }
   
 sub start_LONCAPA_INTERNAL_LONHTTPD_PORT {  sub start_LONCAPA_INTERNAL_LONHTTPD_PORT {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     if ($target eq 'web') {      if ($target eq 'web') {
Line 99  sub start_script { Line 118  sub start_script {
     ($ENV{'form.answer_output_mode'} ne 'tex') &&      ($ENV{'form.answer_output_mode'} ne 'tex') &&
     ($Apache::lonhomework::viewgrades == 'F')) {      ($Apache::lonhomework::viewgrades == 'F')) {
     $Apache::lonxml::evaluate--;      $Apache::lonxml::evaluate--;
     $result.="<a href=\"javascript:newWindow=open(\'\',\'new_W\',\'width=500,height=200,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'&lt;html&gt;&lt;head&gt;&lt;title&gt;newwindow&lt;/title&gt;&lt;/head&gt;&lt;body bgcolor=&quot;#FFFFFF&quot;&gt;&lt;pre&gt;";      $result.="<script type=\"text/javascript\"> function LONCAPA_scriptvars_$Apache::lonxml::curdepth() {newWindow=open('','new_W','width=500,height=200,scrollbars=1');newWindow.document.open('text/html','replace');newWindow.document.writeln('<html><head><title>Script Vars</title></head><body bgcolor=\"#FFFFFF\"><pre>";
     my $listing= &HTML::Entities::encode(&Apache::run::dump($target,$safeeval));      my $listing=&Apache::run::dump($target,$safeeval);
       $listing=~s/\'/\\\'/g;
       $listing=~s/\n/\\n/g;
       $listing=~s/\r/\\r/g;
     $result.=$listing;      $result.=$listing;
     $result.= "&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;\');newWindow.document.close();void(0);\">Script Vars</a><br />";      $result.= "</pre></body></html>');newWindow.document.close();}</script><a href=\"javascript:LONCAPA_scriptvars_$Apache::lonxml::curdepth();void(0);\">Script Vars</a><br />";
  }   }
     } elsif ($target eq "edit" ) {      } elsif ($target eq "edit" ) {
       #&Apache::run::run($bodytext,$safeeval);        #&Apache::run::run($bodytext,$safeeval);
Line 282  sub end_window { Line 303  sub end_window {
   my $result;    my $result;
   if ($target eq 'web') {    if ($target eq 'web') {
     my $output=&Apache::lonxml::endredirection;      my $output=&Apache::lonxml::endredirection;
       $output =~ s/[\n\r]/ /g;
   #    $output = &HTML::Entities::encode($output,'<>&"\'');
       $output =~ s/\'/\\\'/g;
     my $linktext= &Apache::lonxml::get_param('linktext',$parstack,$safeeval);      my $linktext= &Apache::lonxml::get_param('linktext',$parstack,$safeeval);
     if (!$linktext) { $linktext='<sup>*</sup>'; }      if (!$linktext) { $linktext='<sup>*</sup>'; }
     my $width= &Apache::lonxml::get_param('width',$parstack,$safeeval);      my $width= &Apache::lonxml::get_param('width',$parstack,$safeeval);
     if (!$width) { $width='500'; }      if (!$width) { $width='500'; }
     my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval);      my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval);
     if (!$height) { $height='200'; }      if (!$height) { $height='200'; }
     $output =~ s/[\n\r]/ /g;      $result = "<script type=\"text/javascript\"> function LONCAPA_newwindow_$Apache::lonxml::curdepth() {newWindow=open('','new_W','width=$width,height=$height,scrollbars=1');newWindow.document.open('text/html','replace');newWindow.document.writeln('<html><head><title>newwindow</title></head><body bgcolor=\"#FFFFFF\"> $output </body></html>');newWindow.document.close();}</script><a href=\"javascript:LONCAPA_newwindow_$Apache::lonxml::curdepth();void(0);\">$linktext</a>";
     $output =~ s/\'/\\\&\#39\;/g;  
     $output =~ s/\"/\&quot\;/g;  
     $result = "<a href=\"javascript:newWindow=open(\'\',\'new_W\',\'width=$width,height=$height,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'<html><head><title>newwindow</title></head><body bgcolor=&quot;#FFFFFF&quot;> $output </body></html>\');newWindow.document.close();void(0);\">$linktext</a>";  
   } elsif ($target eq 'tex') {    } elsif ($target eq 'tex') {
       $result = '}';        $result = '}';
   } else {    } else {

Removed from v.1.94  
changed lines
  Added in v.1.100


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