--- loncom/xml/scripttag.pm 2001/01/04 19:15:02 1.29 +++ loncom/xml/scripttag.pm 2001/01/10 14:12:03 1.30 @@ -10,6 +10,7 @@ use Apache::lonnet; sub BEGIN { &Apache::lonxml::register('Apache::scripttag',('script','scriptlib', 'parserlib','import', + 'window','meta')); 'footnote','display')); } @@ -24,7 +25,6 @@ sub start_script { my $bodytext=&Apache::lonxml::get_all_text("/script",$$parser[$#$parser]); if ( $target eq "modified" ) { - } elsif ( $target eq "web" || $target eq "grade" ) { &Apache::run::run($bodytext,$safeeval); } elsif ($target eq "edit" ) { @@ -127,25 +127,37 @@ sub start_parserlib { sub end_parserlib { } -sub start_footnote { +sub start_window { my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; my $result = ''; - $Apache::lonxml::redirection = 0; + if ($target eq 'web') { + $Apache::lonxml::redirection = 0; + } elsif ($target eq 'tex') { + $result = '\footnote{'; + } return $result; } -sub end_footnote { +sub end_window { my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; - $Apache::lonxml::outputstack =~ s/\"/\"\;/g; - my $result = "newwindow $Apache::lonxml::outputstack \');newWindow.document.close();void(0);\">*"; + my $result; + if ($target eq 'web') { + $Apache::lonxml::outputstack =~ s/\"/\"\;/g; + $result = "newwindow $Apache::lonxml::outputstack \');newWindow.document.close();void(0);\">*"; $Apache::lonxml::outputstack = ""; $Apache::lonxml::redirection = 1; + } elsif ($target eq 'tex') { + $result = '}'; + } else { + $result = ''; + } return $result; } sub start_import { my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; - my $bodytext=$$parser[$#$parser]->get_text("/import"); + my $bodytext=&Apache::lonxml::get_all_text("/import",$$parser[$#$parser]); +# my $bodytext=$$parser[$#$parser]->get_text("/import"); my $result =""; $bodytext=Apache::run::evaluate($bodytext,$safeeval,$$parstack[$#$parstack]); @@ -157,7 +169,8 @@ sub start_import { } my $dir=$location; - $dir=~s:/[^/]*$::; + $dir=~s:/[^/]*$::; +# &Apache::lonxml::debug("directory $dir $location file $file \nEND\n"); &Apache::lonxml::newparser($parser,\$file,$dir); if ($target eq "edit" ) { @@ -170,6 +183,27 @@ sub start_import { sub end_import { } +sub start_meta { + my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; + my $result = ''; + if ($target ne 'meta') { + $result = &Apache::lonxml::get_all_text("/meta",$$parser[$#$parser]); + $result = ''; + return $result; + } else { + return $result; + } +} + +sub end_meta { +} + + + + + + + sub editfield { my ($tag,$data)=@_;