version 1.321, 2004/06/04 14:03:57
|
version 1.327, 2004/07/08 14:35:12
|
Line 150 $Apache::lonxml::warnings_error_header='
|
Line 150 $Apache::lonxml::warnings_error_header='
|
|
|
sub xmlbegin { |
sub xmlbegin { |
my $output=''; |
my $output=''; |
|
@htmlareafields=(); |
if ($ENV{'browser.mathml'}) { |
if ($ENV{'browser.mathml'}) { |
$output='<?xml version="1.0"?>' |
$output='<?xml version="1.0"?>' |
.'<?xml-stylesheet type="text/css" href="/adm/MathML/mathml.css"?>' |
.'<?xml-stylesheet type="text/css" href="/adm/MathML/mathml.css"?>' |
Line 388 sub latex_special_symbols {
|
Line 389 sub latex_special_symbols {
|
} else { |
} else { |
$string=~s/\\/\\ensuremath{\\backslash}/g; |
$string=~s/\\/\\ensuremath{\\backslash}/g; |
$string=~s/([^\\]|^)\%/$1\\\%/g; |
$string=~s/([^\\]|^)\%/$1\\\%/g; |
|
$string=~s/\b_{2,}\b/ \\makebox\[1 cm\]\[b\]{\\hrulefill}/g; |
$string=~s/([^\\]|^)(\$|_)/$1\\$2/g; |
$string=~s/([^\\]|^)(\$|_)/$1\\$2/g; |
$string=~s/\$\$/\$\\\$/g; |
$string=~s/\$\$/\$\\\$/g; |
$string=~s/\#\#/\#\\\#/g; |
$string=~s/\#\#/\#\\\#/g; |
Line 604 sub setup_globals {
|
Line 606 sub setup_globals {
|
my ($request,$target)=@_; |
my ($request,$target)=@_; |
$Apache::lonxml::request=$request; |
$Apache::lonxml::request=$request; |
$Apache::lonxml::registered = 0; |
$Apache::lonxml::registered = 0; |
|
@Apache::lonxml::htmlareafields=(); |
$errorcount=0; |
$errorcount=0; |
$warningcount=0; |
$warningcount=0; |
$Apache::lonxml::default_homework_loaded=0; |
$Apache::lonxml::default_homework_loaded=0; |
Line 662 sub init_safespace {
|
Line 665 sub init_safespace {
|
$safehole->wrap(\&Apache::scripttag::xmlparse,$safeeval,'&xmlparse'); |
$safehole->wrap(\&Apache::scripttag::xmlparse,$safeeval,'&xmlparse'); |
$safehole->wrap(\&Apache::outputtags::multipart,$safeeval,'&multipart'); |
$safehole->wrap(\&Apache::outputtags::multipart,$safeeval,'&multipart'); |
$safehole->wrap(\&Apache::lonnet::EXT,$safeeval,'&EXT'); |
$safehole->wrap(\&Apache::lonnet::EXT,$safeeval,'&EXT'); |
|
$safehole->wrap(\&Apache::chemresponse::chem_standard_order,$safeeval, |
|
'&chem_standard_order'); |
|
|
$safehole->wrap(\&Math::Cephes::asin,$safeeval,'&asin'); |
$safehole->wrap(\&Math::Cephes::asin,$safeeval,'&asin'); |
$safehole->wrap(\&Math::Cephes::acos,$safeeval,'&acos'); |
$safehole->wrap(\&Math::Cephes::acos,$safeeval,'&acos'); |
$safehole->wrap(\&Math::Cephes::atan,$safeeval,'&atan'); |
$safehole->wrap(\&Math::Cephes::atan,$safeeval,'&atan'); |
Line 736 sub init_safespace {
|
Line 741 sub init_safespace {
|
$safehole->wrap(\&Math::Random::random_set_seed,$safeeval,'&random_set_seed'); |
$safehole->wrap(\&Math::Random::random_set_seed,$safeeval,'&random_set_seed'); |
$safehole->wrap(\&Apache::lonxml::error,$safeeval,'&LONCAPA_INTERNAL_ERROR'); |
$safehole->wrap(\&Apache::lonxml::error,$safeeval,'&LONCAPA_INTERNAL_ERROR'); |
$safehole->wrap(\&Apache::lonxml::debug,$safeeval,'&LONCAPA_INTERNAL_DEBUG'); |
$safehole->wrap(\&Apache::lonxml::debug,$safeeval,'&LONCAPA_INTERNAL_DEBUG'); |
|
$safehole->wrap(\&Apache::caparesponse::get_sigrange,$safeeval,'&LONCAPA_INTERNAL_get_sigrange'); |
|
|
#need to inspect this class of ops |
#need to inspect this class of ops |
# $safeeval->deny(":base_orig"); |
# $safeeval->deny(":base_orig"); |
Line 839 sub decreasedepth {
|
Line 845 sub decreasedepth {
|
|
|
sub get_all_text_unbalanced { |
sub get_all_text_unbalanced { |
#there is a copy of this in lonpublisher.pm |
#there is a copy of this in lonpublisher.pm |
my($tag,$pars)= @_; |
my($tag,$pars)= @_; |
my $token; |
my $token; |
my $result=''; |
my $result=''; |
$tag='<'.$tag.'>'; |
$tag='<'.$tag.'>'; |
while ($token = $$pars[-1]->get_token) { |
while ($token = $$pars[-1]->get_token) { |
if (($token->[0] eq 'T')||($token->[0] eq 'C')||($token->[0] eq 'D')) { |
if (($token->[0] eq 'T')||($token->[0] eq 'C')||($token->[0] eq 'D')) { |
$result.=$token->[1]; |
$result.=$token->[1]; |
} elsif ($token->[0] eq 'PI') { |
} elsif ($token->[0] eq 'PI') { |
$result.=$token->[2]; |
$result.=$token->[2]; |
} elsif ($token->[0] eq 'S') { |
} elsif ($token->[0] eq 'S') { |
$result.=$token->[4]; |
$result.=$token->[4]; |
} elsif ($token->[0] eq 'E') { |
} elsif ($token->[0] eq 'E') { |
$result.=$token->[2]; |
$result.=$token->[2]; |
} |
} |
if ($result =~ /(.*)\Q$tag\E(.*)/is) { |
if ($result =~ /\Q$tag\E/is) { |
&Apache::lonxml::debug('Got a winner with leftovers ::'.$2); |
($result,my $redo)=$result =~ /(.*)\Q$tag\E(.*)/is; |
&Apache::lonxml::debug('Result is :'.$1); |
#&Apache::lonxml::debug('Got a winner with leftovers ::'.$2); |
$result=$1; |
#&Apache::lonxml::debug('Result is :'.$1); |
my $redo=$tag.$2; |
$redo=$tag.$redo; |
&Apache::lonxml::newparser($pars,\$redo); |
&Apache::lonxml::newparser($pars,\$redo); |
last; |
last; |
} |
} |
} |
} |
return $result |
return $result |
} |
} |
|
|
sub increment_counter { |
sub increment_counter { |
Line 1128 sub inserteditinfo {
|
Line 1134 sub inserteditinfo {
|
$filecontents = &HTML::Entities::encode($filecontents,'<>&"'); |
$filecontents = &HTML::Entities::encode($filecontents,'<>&"'); |
# my $editheader='<a href="#editsection">Edit below</a><hr />'; |
# my $editheader='<a href="#editsection">Edit below</a><hr />'; |
my $xml_help = ''; |
my $xml_help = ''; |
my $activate=''; |
|
my $initialize=''; |
my $initialize=''; |
if ($filetype eq 'html') { |
if ($filetype eq 'html') { |
|
my $addbuttons=&Apache::lonhtmlcommon::htmlareaaddbuttons(); |
$initialize=&Apache::lonhtmlcommon::htmlareaheaders().(<<FULLPAGE); |
$initialize=&Apache::lonhtmlcommon::htmlareaheaders().(<<FULLPAGE); |
<script type="text/javascript"> |
<script type="text/javascript"> |
|
$addbuttons |
|
|
HTMLArea.loadPlugin("FullPage"); |
HTMLArea.loadPlugin("FullPage"); |
|
|
function initDocument() { |
function initDocument() { |
var editor=new HTMLArea("editor"); |
var editor=new HTMLArea("filecont",config); |
editor.registerPlugin(FullPage); |
editor.registerPlugin(FullPage); |
editor.generate(); |
editor.generate(); |
} |
} |
Line 1144 sub inserteditinfo {
|
Line 1152 sub inserteditinfo {
|
FULLPAGE |
FULLPAGE |
$result=~s/\<body([^\>]*)\>/\<body onload="initDocument()" $1\>/i; |
$result=~s/\<body([^\>]*)\>/\<body onload="initDocument()" $1\>/i; |
$xml_help=&Apache::loncommon::helpLatexCheatsheet(); |
$xml_help=&Apache::loncommon::helpLatexCheatsheet(); |
#FIXME: need to install FullPage plugin during install |
|
# $activate=&Apache::lonhtmlcommon::htmlareaactive(); |
|
} |
} |
my $cleanbut = ''; |
my $cleanbut = ''; |
if ($filetype eq 'html') { |
if ($filetype eq 'html') { |
Line 1174 $buttons<br />
|
Line 1180 $buttons<br />
|
<br /> |
<br /> |
</form> |
</form> |
$titledisplay |
$titledisplay |
$activate |
|
</body> |
</body> |
ENDFOOTER |
ENDFOOTER |
# $result=~s/(\<body[^\>]*\>)/$1$editheader/is; |
# $result=~s/(\<body[^\>]*\>)/$1$editheader/is; |
Line 1330 sub debug {
|
Line 1335 sub debug {
|
my $request=$Apache::lonxml::request; |
my $request=$Apache::lonxml::request; |
if (!$request) { $request=Apache->request; } |
if (!$request) { $request=Apache->request; } |
$request->print('<font size="-2"><pre>DEBUG:'.&HTML::Entities::encode($_[0],'<>&"')."</pre></font>\n"); |
$request->print('<font size="-2"><pre>DEBUG:'.&HTML::Entities::encode($_[0],'<>&"')."</pre></font>\n"); |
|
# &Apache::lonnet::logthis($_[0]); |
} |
} |
} |
} |
|
|