[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm /xml londefdef.pm lonxml.pm

raeburn raeburn at source.lon-capa.org
Mon Dec 22 15:50:27 EST 2025


raeburn		Mon Dec 22 20:50:27 2025 EDT

  Modified files:              
    /loncom/xml	londefdef.pm lonxml.pm 
    /loncom/interface	loncommon.pm 
  Log:
  - WCAG 2 compliance
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.475 loncom/xml/londefdef.pm:1.476
--- loncom/xml/londefdef.pm:1.475	Sun Apr 14 17:12:28 2024
+++ loncom/xml/londefdef.pm	Mon Dec 22 20:50:26 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module
 #
-# $Id: londefdef.pm,v 1.475 2024/04/14 17:12:28 raeburn Exp $
+# $Id: londefdef.pm,v 1.476 2025/12/22 20:50:26 raeburn Exp $
 #
 #
 # Copyright Michigan State University Board of Trustees
@@ -629,6 +629,9 @@
 	    &Apache::loncommon::start_page($Apache::londefdef::title,
 					   $Apache::londefdef::head
 					      .$extra_head,$args);
+        if ($target eq 'web') {
+            $currentstring .= '<div class="LC_landmark" role="main" id="LC_main_content">';
+        }
         my $header = '';
         if ($env{'request.state'} ne 'published' &&
             $env{'request.state'} ne 'construct') {
@@ -741,7 +744,7 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# Close off unclosed <p>
     if ($target eq 'web' || $target eq 'webgrade') {
-	$currentstring .= &Apache::loncommon::end_page({'discussion' => 1});
+	$currentstring .= '</div>'.&Apache::loncommon::end_page({'discussion' => 1});
     } elsif ($target eq 'tex') {
 	$currentstring .= '\strut\newline\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\newline\noindent \end{document}';
     }
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.577 loncom/xml/lonxml.pm:1.578
--- loncom/xml/lonxml.pm:1.577	Wed Feb 19 23:39:38 2025
+++ loncom/xml/lonxml.pm	Mon Dec 22 20:50:26 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module
 #
-# $Id: lonxml.pm,v 1.577 2025/02/19 23:39:38 raeburn Exp $
+# $Id: lonxml.pm,v 1.578 2025/12/22 20:50:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1525,7 +1525,7 @@
            '</span>';
     }
     $output .=
-     ' <span class="LC_nobreak">'.
+     ' <span class="LC_nobreak"><label>'.
        &mt('Math Rendering:').' '.
        &Apache::loncommon::select_form(
            $env{'form.texengine'},
@@ -1535,7 +1535,7 @@
                 'tth'     => 'tth (TeX to HTML)',
                 'MathJax' => 'MathJax',
                 'mimetex' => 'mimetex (Convert to Images)')}).
-     '</span>';
+     '</label></span>';
     return $output;
 }
 
@@ -1893,7 +1893,7 @@
 	my ($start_page,$end_page,$errormsg);
 	$start_page=&Apache::loncommon::start_page('File Error');
 	if ($target eq 'web') {
-	    $start_page .= '<div class="LC_landmark" style="clear:both" role="menu">'.
+	    $start_page .= '<div class="LC_landmark" style="clear:both" role="main" id="LC_main_content">'.
 	                   '<h1 class="LC_visually_hidden">'.
 	                   &mt('File not found').'</h1>';
 	    $end_page = '</div>';
@@ -1997,8 +1997,10 @@
                                'bgcolor'      => '#FFFFFF');
                 $result =
                     &Apache::loncommon::start_page(undef,undef,\%options)
+                   .'<div class="LC_landmark" role="main" id="LC_main_content">'
                    .$controls
                    .$result
+                   .'</div>'
                    .&Apache::loncommon::end_page();
             }
         }
@@ -2079,8 +2081,10 @@
 							    \%options);
             $result = $start_page
                      .$header
+                     .'<div class="LC_landmark" role="main" id="LC_main_content">'
                      .&Apache::lonxml::message_location()
                      .$edit_info
+                     .'</div>'
                      .&Apache::loncommon::end_page();
         }
     }
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1490 loncom/interface/loncommon.pm:1.1491
--- loncom/interface/loncommon.pm:1.1490	Fri Dec 19 21:55:48 2025
+++ loncom/interface/loncommon.pm	Mon Dec 22 20:50:27 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1490 2025/12/19 21:55:48 raeburn Exp $
+# $Id: loncommon.pm,v 1.1491 2025/12/22 20:50:27 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2970,21 +2970,22 @@
         $secondid = 'includetypes';
         $thirdid = 'includetypestext';
     }
+    my $labeltext = &mt("Text to look for if filter set to 'containing phrase'");
     my $onchange = "javascript:toggleHistoryOptions(this,'containingphrase','$context',
                                                     '$secondid','$thirdid')";
     return '<span class="LC_nobreak"><label>'.&mt('Records: [_1]',
 			       &Apache::lonmeta::selectbox('show',$env{'form.show'},'','',undef,
 							   (&mt('all'),10,20,50,100,1000,10000))).
 	   '</label></span> <span class="LC_nobreak">'.
-           &mt('Filter: [_1]',
+           '<label for="displayfilter">'.&mt('Filter').'</label>: '.
 	   &select_form($env{'form.displayfilter'},
 			'displayfilter',
 			{'currentfolder' => 'Current folder/page',
 			 'containing' => 'Containing phrase',
-			 'none' => 'None'},$onchange)).' '.
+			 'none' => 'None'},$onchange,'','displayfilter').' '.
 			 '<input type="'.$phraseinput.'" name="containingphrase" id="containingphrase" size="30" value="'.
                          &HTML::Entities::encode($env{'form.containingphrase'}).
-                         '" />'.$additional;
+                         '" aria-label="'.$labeltext.'" />'.$additional;
 }
 
 sub display_filter_js {
@@ -11219,6 +11220,7 @@
     my $page =
 	&Apache::loncommon::start_page($title,'',\%displayargs)."\n".
         '<div class="LC_landmark" style="clear:both" role="main" id="LC_main_content">'.
+        '<h1 class="LC_visually_hidden">'.&mt($title).'</h1>'.
 	'<p class="LC_error">'.$msg.'</p>'.
         '</div>'.
 	&Apache::loncommon::end_page();
@@ -16366,7 +16368,7 @@
     }
     #
     &Apache::lonnet::appenv(\%ValuesHash);
-    return '<img src="/cgi-bin/graph.png?'.$identifier.'" border="1" />';
+    return '<img src="/cgi-bin/graph.png?'.$identifier.'" border="1" alt="'.$Title.'" />';
 }
 
 ############################################################




More information about the LON-CAPA-cvs mailing list