Diff for /loncom/xml/londefdef.pm between versions 1.43 and 1.47

version 1.43, 2002/02/21 04:29:27 version 1.47, 2002/03/06 20:27:00
Line 1 Line 1
   
 # The LearningOnline Network with CAPA  # The LearningOnline Network with CAPA
 # Tags Default Definition Module   # Tags Default Definition Module 
 #  #
Line 49  use Apache::lonxml; Line 50  use Apache::lonxml;
   
 BEGIN {  BEGIN {
   
     &Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','table','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u','output','param','applet','img','embed','tr','td','allow','frameset','pre'));      &Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','table','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u','output','param','applet','img','embed','tr','td','allow','frameset','pre','insert'));
   
 }  }
   
Line 123  sub end_m { Line 124  sub end_m {
                                  \setlength{\marginparwidth}{90pt}                                   \setlength{\marginparwidth}{90pt}
                                  \setlength{\textfloatsep}{8pt plus 2.0pt minus 4.0pt}                                   \setlength{\textfloatsep}{8pt plus 2.0pt minus 4.0pt}
                                  \newcommand{\keephidden}[1]{}                                              \newcommand{\keephidden}[1]{}           
                                  \usepackage[dvips]{graphicx}';                                   \usepackage[dvips]{graphicx}
                                    \usepackage{epsfig}';
     }      }
    return $currentstring;     return $currentstring;
  }   }
Line 148  sub end_m { Line 150  sub end_m {
     my ($target,$token) = @_;      my ($target,$token) = @_;
             my $currentstring = '';              my $currentstring = '';
             if ($target eq 'web') {              if ($target eq 'web') {
               $currentstring = &Apache::lonxml::registerurl().                $currentstring = &Apache::lonxml::registerurl(undef,$target).
                                $token->[2];                                     $token->[2];    
             }               } 
    return $currentstring;     return $currentstring;
Line 330  sub end_m { Line 332  sub end_m {
             my $currentstring = '';              my $currentstring = '';
             if ($target eq 'web') {              if ($target eq 'web') {
       if (!$Apache::lonxml::registered) {        if (!$Apache::lonxml::registered) {
  $currentstring.='<head>'.&Apache::lonxml::registerurl().'</head>';   $currentstring.='<head>'.
       &Apache::lonxml::registerurl(undef,$target).'</head>';
       }        }
       my $onLoad='';        my $onLoad='';
       foreach my $key (keys(%{$token->[2]})) {        foreach my $key (keys(%{$token->[2]})) {
Line 1309  EDITBUTTON Line 1312  EDITBUTTON
     my ($target,$token) = @_;      my ($target,$token) = @_;
             my $currentstring = '';              my $currentstring = '';
             if ($target eq 'web') {              if ($target eq 'web') {
               $currentstring = $token->[4];                     $currentstring = $token->[4];
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
       $currentstring = '';        $currentstring = '';
     }       } 
Line 1319  EDITBUTTON Line 1322  EDITBUTTON
     my ($target,$token) = @_;      my ($target,$token) = @_;
             my $currentstring = '';              my $currentstring = '';
             if ($target eq 'web') {              if ($target eq 'web') {
               $currentstring = $token->[2];                     $currentstring = $token->[2];
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
               $currentstring = '';                  $currentstring = '';
     }       }
    return $currentstring;     return $currentstring;
  }   }
 #-- <img> tag  #-- <img> tag
         sub start_img {          sub start_img {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
             $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=                 $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
                                         $token->[2]->{'src'};                                          $token->[2]->{'src'};
             my $currentstring = '';              my $currentstring = '';
   
     if ($target eq 'web') {      if ($target eq 'web') {
               $currentstring = $token->[4];                     $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
Line 1365  EDITBUTTON Line 1369  EDITBUTTON
     my ($target,$token) = @_;      my ($target,$token) = @_;
             my $currentstring = '';              my $currentstring = '';
             if ($target eq 'web') {              if ($target eq 'web') {
               $currentstring = $token->[2];                  $currentstring = $token->[2];
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
               $currentstring = '';                  $currentstring = '';
     }       }
    return $currentstring;     return $currentstring;
  }   }
 #-- <applet> tag  #-- <applet> tag
Line 1377  EDITBUTTON Line 1381  EDITBUTTON
     my ($target,$token) = @_;      my ($target,$token) = @_;
               $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=                   $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=   
                                         $token->[2]->{'code'};                                          $token->[2]->{'code'};
               $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=                   $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
                                         $token->[2]->{'archive'};                                          $token->[2]->{'archive'};
             my $currentstring = '';              my $currentstring = '';
             if ($target eq 'web') {              if ($target eq 'web') {
               $currentstring = $token->[4];                     $currentstring = $token->[4];
     } elsif ($target eq 'tex') {  
               $currentstring = " \\begin{figure} ";    
     }   
    return $currentstring;  
  }  
         sub end_applet {  
     my ($target,$token) = @_;  
             my $currentstring = '';  
             if ($target eq 'web') {  
               $currentstring = $token->[2];       
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
               $currentstring = " \\end{figure}";                  $currentstring = " \\begin{figure} ";
     }       } 
    return $currentstring;     return $currentstring;
  }   }
   sub end_applet {
       my ($target,$token) = @_;
       my $currentstring = '';
       if ($target eq 'web') {
    $currentstring = $token->[2];
       } elsif ($target eq 'tex') {
    $currentstring = " \\end{figure}";
       } 
       return $currentstring;
   }
   
 #-- <embed> tag  #-- <embed> tag
   
         sub start_embed {  sub start_embed {    
     my ($target,$token) = @_;      my ($target,$token) = @_;
             $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=         $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
                                         $token->[2]->{'src'};   $token->[2]->{'src'};
            my $currentstring = '';      my $currentstring = '';
             if ($target eq 'web') {      if ($target eq 'web') {
               $currentstring = $token->[4];        $currentstring = $token->[4];
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
               $currentstring = " \\begin{figure} ";     $currentstring = " \\begin{figure} ";  
     }       } 
    return $currentstring;      return $currentstring;
  }  }
         sub end_embed {          sub end_embed {
     my ($target,$token) = @_;      my ($target,$token) = @_;
             my $currentstring = '';              my $currentstring = '';
Line 1471  EDITBUTTON Line 1475  EDITBUTTON
   my $currentstring = '';    my $currentstring = '';
   if ($target eq 'web') {     if ($target eq 'web') { 
     if (!$Apache::lonxml::registered) {      if (!$Apache::lonxml::registered) {
       $currentstring.='<head>'.&Apache::lonxml::registerurl().'</head>';        $currentstring.='<head>'.
     &Apache::lonxml::registerurl(undef,$target).'</head>';
     }      }
     $currentstring .= $token->[4];      $currentstring .= $token->[4];
   }    }
Line 1506  EDITBUTTON Line 1511  EDITBUTTON
     }      }
            return $currentstring;             return $currentstring;
  }   }
   #-- <insert>
    sub start_insert {
       my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
               my $currentstring = '';
               if ($target eq 'web') {
    my $display = &Apache::lonxml::get_param('display',$parstack,$safeeval);
          $currentstring .= '<b>'.$display.'</b>';;
       }
              return $currentstring;
    }
           sub end_insert {
       my ($target,$token) = @_;
               my $currentstring = '';
               if ($target eq 'web') {
          $currentstring .= '';
       }
              return $currentstring;
    }
 1;  1;
 __END__  __END__

Removed from v.1.43  
changed lines
  Added in v.1.47


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