[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm /xml lonxml.pm
raeburn
raeburn at source.lon-capa.org
Wed May 13 19:14:13 EDT 2026
raeburn Wed May 13 23:14:13 2026 EDT
Modified files:
/loncom/xml lonxml.pm
/loncom/interface loncommon.pm
Log:
- WCAG 2 compliance
- Include labels for form elements.
- Replace use of <table> for layout with <div>.
- Contrast ratio of at least 4.5:1 for normal text.
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.582 loncom/xml/lonxml.pm:1.583
--- loncom/xml/lonxml.pm:1.582 Thu Mar 26 01:45:23 2026
+++ loncom/xml/lonxml.pm Wed May 13 23:14:12 2026
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.582 2026/03/26 01:45:23 raeburn Exp $
+# $Id: lonxml.pm,v 1.583 2026/05/13 23:14:12 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1518,12 +1518,12 @@
my $output;
unless ($env{'form.forceedit'}) {
$output .=
- '<span class="LC_nobreak">'.
- &mt('Language:').' '.
+ '<span class="LC_nobreak"><label for="languages">'.
+ &mt('Language:').'</label> '.
&Apache::loncommon::select_form(
$env{'form.languages'},
'languages',
- {&Apache::lonlocal::texthash(%langchoices)}).
+ {&Apache::lonlocal::texthash(%langchoices)},'','','languages').
'</span>';
}
$output .=
@@ -1660,12 +1660,12 @@
<form $form_events method="post" name="xmledit" action="$action">
<input type="hidden" name="problemmode" value="edit" />
<div class="LC_edit_problem_editxml_header">
- <table class="LC_edit_problem_header_title"><tr><td>
- $filename
- </td><td align="right">
- $xml_help
- </td></tr>
- </table>
+ <div class="LC_grid LC_edit_problem_header_filename" role="grid">
+ <div class="LC_grid_row" role="row">
+ <div class="LC_grid_cell LC_floatright" role="gridcell" style="margin: 4px 0 0 0; padding: 0;">$xml_help</div>
+ <div class="LC_grid_cell LC_floatleft" role="gridcell">$filename</div>
+ </div></div>
+ <br clear="all" style="line-height: 0;" />
<div style="float:right">
<input type="button" name="savethisfile" accesskey="s" value="$lt{'st'}" $onclick{'saveedit'} />
<input type="button" name="viewmode" accesskey="v" value="$lt{'vi'}" $onclick{'saveview'} />
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1523 loncom/interface/loncommon.pm:1.1524
--- loncom/interface/loncommon.pm:1.1523 Tue May 5 19:03:21 2026
+++ loncom/interface/loncommon.pm Wed May 13 23:14:12 2026
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1523 2026/05/05 19:03:21 raeburn Exp $
+# $Id: loncommon.pm,v 1.1524 2026/05/13 23:14:12 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1347,7 +1347,7 @@
}
$template = '<a'.$target.' href="'.$link.'" title="'.$title.'" class="LC_nounderline">';
if ($text ne "") {
- $template = '<span class="LC_help_open_topic">'.$template.
+ $template = '<div class="LC_help_open_topic" style="display: inline-block">'.$template.
'<span class="LC_underline">'.$text.'</span> ';
}
@@ -1361,7 +1361,7 @@
.' title="'.$title.'" style="vertical-align:middle;"'.$imgid
.' /></a>';
if ($text ne "") {
- $template.='</span>';
+ $template.='</div>';
}
return $template;
@@ -1371,26 +1371,19 @@
# appears in at least four places
sub helpLatexCheatsheet {
my ($topic,$text,$not_author,$stayOnPage) = @_;
- my $out;
- my $addOther = '';
+ my $out = '';
if ($topic) {
- $addOther = '<span>'.&help_open_topic($topic,&mt($text),$stayOnPage, undef, 600).'</span> ';
+ $out .= &help_open_topic($topic,&mt($text),$stayOnPage, undef, 600).' ';
}
- $out = '<span>' # Start cheatsheet
- .$addOther
- .'<span>'
- .&help_open_topic('Greek_Symbols',&mt('Greek Symbols'),$stayOnPage,undef,600)
- .'</span> <span>'
- .&help_open_topic('Other_Symbols',&mt('Other Symbols'),$stayOnPage,undef,600)
- .'</span>';
+ $out .= &help_open_topic('Greek_Symbols',&mt('Greek Symbols'),$stayOnPage,undef,600)
+ .' '
+ .&help_open_topic('Other_Symbols',&mt('Other Symbols'),$stayOnPage,undef,600);
unless ($not_author) {
- $out .= '<span>'
+ $out .= ' '
.&help_open_topic('Authoring_Output_Tags',&mt('Output Tags'),$stayOnPage,undef,600)
- .'</span> <span>'
- .&help_open_topic('Authoring_Multilingual_Problems',&mt('Languages'),$stayOnPage,undef,600)
- .'</span>';
+ .' '
+ .&help_open_topic('Authoring_Multilingual_Problems',&mt('Languages'),$stayOnPage,undef,600);
}
- $out .= '</span>'; # End cheatsheet
return $out;
}
@@ -8962,9 +8955,11 @@
margin: 0 0 5px 0;
}
-table.LC_edit_problem_header_title {
+div.LC_edit_problem_header_filename {
width: 100%;
background: $tabbg;
+ margin: 0;
+ padding: 0;
}
div.LC_edit_actionbar {
@@ -9077,7 +9072,6 @@
}
.LC_help_open_topic {
- color: #FFFFFF;
background-color: #EEEEFF;
margin: 1px;
padding: 4px;
More information about the LON-CAPA-cvs
mailing list