--- loncom/xml/londefdef.pm 2003/04/18 15:14:18 1.130 +++ loncom/xml/londefdef.pm 2003/05/12 20:13:36 1.133 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.130 2003/04/18 15:14:18 sakharuk Exp $ +# $Id: londefdef.pm,v 1.133 2003/05/12 20:13:36 www Exp $ # # # Copyright Michigan State University Board of Trustees @@ -1697,7 +1697,7 @@ sub end_dd { sub start_table { my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; my $textwidth; - if ($#Apache::londefdef::table==0) { + if (not defined @Apache::londefdef::table) { $textwidth=&recalc($ENV{'form.textwidth'}); $textwidth=~/(\d+)/; $textwidth=$1; @@ -1742,7 +1742,7 @@ sub start_table { $Apache::londefdef::table[-1]{'vvinc'} = ''; } $Apache::londefdef::table[-1]{'output'} = ' \noindent \begin{tabular} '; - $currentstring = '\keephidden{NEW TABLE ENTRY}'; + $currentstring = '\keephidden{NEW TABLE ENTRY '.$textwidth.'}'; } return $currentstring; } @@ -1894,7 +1894,7 @@ sub end_td { } else { if ($data=~m/width\s*=\s*(\d+\.?\d*\s*(mm|cm|in|pc|pt)*)/) { my $current_length=&recalc($1); - $current_length=~/(\d+)/; + $current_length=~/(\d+\.?\d*)/; $Apache::londefdef::table[-1]{'TeXlength'} .= $1.','; $Apache::londefdef::table[-1]{'length'} .= '0,'; } else { @@ -2224,7 +2224,29 @@ sub start_frameset { $currentstring.=''. &Apache::lonmenu::registerurl(undef,$target).''; } - $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; } @@ -3123,7 +3145,7 @@ sub image_replication { sub recalc { my $argument = shift; 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 $units=$2; if ($units eq 'cm') {