[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm /interface loncommon.pm
raeburn
raeburn at source.lon-capa.org
Mon May 28 16:31:17 EDT 2012
raeburn Mon May 28 20:31:17 2012 EDT
Modified files:
/loncom/homework structuretags.pm
/loncom/interface loncommon.pm
Log:
- xhtml.
- new arg in loncommon::endbody() will omit </body> and </html>
- need to be added later (after any additional tags written).
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.506 loncom/homework/structuretags.pm:1.507
--- loncom/homework/structuretags.pm:1.506 Mon May 28 13:09:22 2012
+++ loncom/homework/structuretags.pm Mon May 28 20:31:11 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.506 2012/05/28 13:09:22 raeburn Exp $
+# $Id: structuretags.pm,v 1.507 2012/05/28 20:31:11 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1497,7 +1497,13 @@
$result.="</form>";
}
if ($target eq 'web') {
- $result.= &Apache::loncommon::end_page({'discussion' => 1});
+ #
+ # Closing </body></html> not added by end_page().
+ # Added separately at end of this routine, after added
+ # <script></script> so document will be valid xhtml.
+ #
+ $result.= &Apache::loncommon::end_page({'discussion' => 1,
+ 'notbody' => 1});
} elsif ($target eq 'tex') {
my $endminipage = '';
if (not $env{'form.problem_split'}=~/yes/) {
@@ -1555,6 +1561,11 @@
#
if ($target eq 'web') {
$result .= &Apache::lonhtmlcommon::set_compute_end_time();
+ #
+ # Closing tags delayed so any <script></script> tags
+ # not in head can appear inside body, for valid xhtml.
+ #
+ $result .= "</body>\n</html>";
}
return $result;
}
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1079 loncom/interface/loncommon.pm:1.1080
--- loncom/interface/loncommon.pm:1.1079 Thu May 24 22:56:30 2012
+++ loncom/interface/loncommon.pm Mon May 28 20:31:17 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1079 2012/05/24 22:56:30 raeburn Exp $
+# $Id: loncommon.pm,v 1.1080 2012/05/28 20:31:17 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -5163,7 +5163,10 @@
sub endbodytag {
my ($args) = @_;
- my $endbodytag='</body>';
+ my $endbodytag;
+ unless ((ref($args) eq 'HASH') && ($args->{'notbody'})) {
+ $endbodytag='</body>';
+ }
$endbodytag=&Apache::lontexconvert::jsMath_process()."\n".$endbodytag;
if ( exists( $env{'internal.head.redirect'} ) ) {
if (!(ref($args) eq 'HASH' && $args->{'noredirectlink'})) {
@@ -7357,7 +7360,9 @@
} else {
$result .= &endbodytag($args);
}
- $result .= "\n</html>";
+ unless ($args->{'notbody'}) {
+ $result .= "\n</html>";
+ }
if ($args->{'js_ready'}) {
$result = &js_ready($result);
More information about the LON-CAPA-cvs
mailing list