![]() ![]() | ![]() |
version 1.131, 2003/05/07 16:59:01 | version 1.135, 2003/05/22 16:00:53 |
---|---|
Line 54 use Apache::lonmeta(); | Line 54 use Apache::lonmeta(); |
BEGIN { | BEGIN { |
&Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','accessrule','address','allow','applet','area','b','base','basefont','bgo','bgsound','big','blink','blockquote','blankspace','body','br','button','caption','center','cite','code','col','colgroup','dd','del','dfn','dir','div','dl','dt','em','embed','externallink','fieldset','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','insert','isindex','kbd','keygen','label','layer','legend','li','link','m','map','marquee','menu','meta','multicol','nobr','noembed','noframes','nolayer','noscript','object','ol','optgroup','option','output','p','param','pre','q','s','samp','select','server','small','spacer','span','strike','strong','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','tthoption','u','ul','var','wbr')); | &Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','accessrule','address','allow','applet','area','b','base','basefont','bgo','bgsound','big','blink','blockquote','blankspace','body','br','button','caption','center','cite','code','col','colgroup','dd','del','dfn','dir','div','dl','dt','em','embed','externallink','fieldset','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','insert','isindex','kbd','keygen','label','layer','legend','li','link','m','map','marquee','menu','meta','multicol','nobr','noembed','noframes','nolayer','noscript','object','ol','optgroup','option','output','p','param','pre','q','s','samp','select','server','small','spacer','span','strike','strong','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','tthoption','u','ul','var','wbr','hideweboutput')); |
} | } |
Line 354 sub start_meta { | Line 354 sub start_meta { |
} else { | } else { |
$currentstring = $token->[4]; | $currentstring = $token->[4]; |
} | } |
} | } elsif ($target eq 'meta') { |
if ($target eq 'meta') { | |
unless (&Apache::lonxml::get_param | unless (&Apache::lonxml::get_param |
('http-equiv',$parstack,$safeeval,undef,1)) { | ('http-equiv',$parstack,$safeeval,undef,1)) { |
my $name=$token->[2]->{'name'}; | my $name=$token->[2]->{'name'}; |
Line 366 sub start_meta { | Line 365 sub start_meta { |
$currentstring='<'.$name.'>'. | $currentstring='<'.$name.'>'. |
&Apache::lonxml::get_param | &Apache::lonxml::get_param |
('content',$parstack,$safeeval,undef,1). | ('content',$parstack,$safeeval,undef,1). |
'</'.$name.'>'; | '</'.$name.'>'; |
} | } |
} | } |
} elsif ($target eq 'tex') { | |
&Apache::lonxml::startredirection(); | |
} | } |
return $currentstring; | return $currentstring; |
} | } |
Line 382 sub end_meta { | Line 383 sub end_meta { |
if ($args ne '') { | if ($args ne '') { |
$currentstring = $token->[4]; | $currentstring = $token->[4]; |
} | } |
} | } elsif ($target eq 'tex') { |
$currentstring=&Apache::lonxml::endredirection(); | |
$currentstring=''; | |
} | |
return $currentstring; | return $currentstring; |
} | } |
Line 1894 sub end_td { | Line 1898 sub end_td { |
} else { | } else { |
if ($data=~m/width\s*=\s*(\d+\.?\d*\s*(mm|cm|in|pc|pt)*)/) { | if ($data=~m/width\s*=\s*(\d+\.?\d*\s*(mm|cm|in|pc|pt)*)/) { |
my $current_length=&recalc($1); | my $current_length=&recalc($1); |
$current_length=~/(\d+)/; | $current_length=~/(\d+\.?\d*)/; |
$Apache::londefdef::table[-1]{'TeXlength'} .= $1.','; | $Apache::londefdef::table[-1]{'TeXlength'} .= $1.','; |
$Apache::londefdef::table[-1]{'length'} .= '0,'; | $Apache::londefdef::table[-1]{'length'} .= '0,'; |
} else { | } else { |
Line 2224 sub start_frameset { | Line 2228 sub start_frameset { |
$currentstring.='<head>'. | $currentstring.='<head>'. |
&Apache::lonmenu::registerurl(undef,$target).'</head>'; | &Apache::lonmenu::registerurl(undef,$target).'</head>'; |
} | } |
$currentstring .= $token->[4]; | my $onLoad=''; |
foreach my $key (keys(%{$token->[2]})) { | |
if ($key =~ /^onload$/i) { | |
$onLoad.=$token->[2]->{$key}.';'; | |
delete($token->[2]->{$key}); | |
} | |
} | |
$token->[2]->{'onload'}=&Apache::lonmenu::loadevents().';'.$onLoad; | |
my $onUnload=''; | |
foreach my $key (keys(%{$token->[2]})) { | |
if ($key =~ /^onunload$/i) { | |
$onUnload.=$token->[2]->{$key}.';'; | |
delete($token->[2]->{$key}); | |
} | |
} | |
$token->[2]->{'onunload'}=&Apache::lonmenu::unloadevents(). | |
';'.$onUnload; | |
$currentstring .= '<'.$token->[1]; | |
foreach (keys %{$token->[2]}) { | |
$currentstring.=' '.$_.'="'.$token->[2]->{$_}.'"'; | |
} | |
$currentstring.='>'; | |
} | } |
return $currentstring; | return $currentstring; |
} | } |
Line 3102 sub end_wbr { | Line 3128 sub end_wbr { |
return $currentstring; | return $currentstring; |
} | } |
#-- <hideweboutput> tag | |
sub start_hideweboutput { | |
my ($target,$token) = @_; | |
if ($target eq 'web') { | |
&Apache::lonxml::startredirection(); | |
} | |
return ''; | |
} | |
sub end_hideweboutput { | |
my ($target,$token) = @_; | |
my $currentstring = ''; | |
if ($target eq 'web') { | |
$currentstring = &Apache::lonxml::endredirection(); | |
} | |
return ''; | |
} | |
sub image_replication { | sub image_replication { |
my $src = shift; | my $src = shift; |
if (not -e $src) { | if (not -e $src) { |
Line 3123 sub image_replication { | Line 3169 sub image_replication { |
sub recalc { | sub recalc { |
my $argument = shift; | my $argument = shift; |
if (not $argument=~/(mm|cm|in|pc|pt)/) {return $argument.' mm';} | if (not $argument=~/(mm|cm|in|pc|pt)/) {return $argument.' mm';} |
$argument=~/\s*(\d+)\s*(mm|cm|in|pc|pt)/; | $argument=~/\s*(\d+\.?\d*)\s*(mm|cm|in|pc|pt)/; |
my $value=$1; | my $value=$1; |
my $units=$2; | my $units=$2; |
if ($units eq 'cm') { | if ($units eq 'cm') { |