[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonhelpmenu.pm
raeburn
raeburn at source.lon-capa.org
Wed Feb 19 22:05:34 EST 2025
raeburn Thu Feb 20 03:05:34 2025 EDT
Modified files:
/loncom/interface loncommon.pm lonhelpmenu.pm
Log:
- WCAG 2 compliance.
-------------- next part --------------
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1458 loncom/interface/loncommon.pm:1.1459
--- loncom/interface/loncommon.pm:1.1458 Thu Feb 20 01:09:33 2025
+++ loncom/interface/loncommon.pm Thu Feb 20 03:05:34 2025
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1458 2025/02/20 01:09:33 raeburn Exp $
+# $Id: loncommon.pm,v 1.1459 2025/02/20 03:05:34 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1460,7 +1460,7 @@
<a href="$link" title="$title" $linkattr>$text</a>
END
} else {
- return ' '.$text.' ';
+ return ' <h1 class="LC_helpmenu">'.$text.'</h1> ';
}
}
@@ -1472,6 +1472,10 @@
my $helptopic=&general_help();
my $details_link = $httphost.'/adm/help/'.$helptopic.'.hlp';
my $nothing=&Apache::lonhtmlcommon::javascript_nothing();
+ my $bannertitle = &mt('Help Menu');
+ &js_escape(\$bannertitle);
+ my $bodytitle = &mt('Documentation');
+ &js_escape(\$bodytitle);
my $start_page =
&Apache::loncommon::start_page('Help Menu', undef,
{'frameset' => 1,
@@ -1483,7 +1487,6 @@
my $end_page =
&Apache::loncommon::end_page({'frameset' => 1,
'js_ready' => 1,});
-
my $template .= <<"ENDTEMPLATE";
<script type="text/javascript">
// <![CDATA[
@@ -1508,8 +1511,8 @@
return;
}
function writeHelp(caller) {
- caller.document.writeln('$start_page\\n<frame name="bannerframe" src="'+banner_link+'" marginwidth="0" marginheight="0" frameborder="0">\\n');
- caller.document.writeln('<frame name="bodyframe" src="$details_link" marginwidth="0" marginheight="0" frameborder="0">\\n$end_page');
+ caller.document.writeln('$start_page\\n<frame name="bannerframe" title="$bannertitle" src="'+banner_link+'" marginwidth="0" marginheight="0" frameborder="0">\\n');
+ caller.document.writeln('<frame name="bodyframe" title="$bodytitle" src="$details_link" marginwidth="0" marginheight="0" frameborder="0">\\n$end_page');
caller.document.close();
caller.focus();
}
@@ -7087,11 +7090,13 @@
#don't show menus for public users
if (!$public){
unless ($args->{'no_inline_menu'}) {
- $bodytag .= Apache::lonmenu::secondary_menu($httphost,$ltiscope,$ltimenu,
+ $bodytag .= '<div class="LC_landmark" role="navigation" aria-label="Secondary Links">'.
+ Apache::lonmenu::secondary_menu($httphost,$ltiscope,$ltimenu,
$args->{'no_primary_menu'},
$menucoll,$menuref,
$args->{'links_disabled'},
- $args->{'links_target'});
+ $args->{'links_target'}).
+ '</div>';
}
$bodytag .= Apache::lonmenu::serverform();
if ($need_endlcint) {
@@ -7106,7 +7111,7 @@
$args->{'group'},$args->{'hide_buttons'},
$hostname,$ltiscope,$ltiuri,$showncrumbsref);
} else {
- $bodytag .=
+ $bodytag .=
&Apache::lonmenu::prepare_functions($env{'request.noversionuri'},
$forcereg,$args->{'group'},
$args->{'bread_crumbs'},
@@ -7115,7 +7120,7 @@
} else {
# this is to separate menu from content when there's no secondary
# menu. Especially needed for publicly accessible resources.
- $bodytag .= '<hr style="clear:both" />';
+ $bodytag .= '<hr style="clear:both" role="complementary" />';
if ($need_endlcint) {
$bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
}
@@ -7999,14 +8004,14 @@
border-color: $pgbg;
}
-table#LC_helpmenu {
- border: none;
- height: 55px;
- border-spacing: 0;
-}
-
-table#LC_helpmenu fieldset legend {
- font-size: larger;
+h1.LC_helpmenu {
+ display: inline;
+ font-size: 100%;
+ font-weight: normal;
+ line-height: 1em;
+ margin: 0;
+ padding: 0;
+ border: 0;
}
.LC_helpdesk_headbox {
@@ -9907,7 +9912,7 @@
.'xmlns="http://www.w3.org/1999/xhtml">';
} elsif ($is_frameset) {
$output='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'."\n".
- '<html>'."\n";
+ '<html lang="en">'."\n";
} else {
$output='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n".
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
@@ -10820,8 +10825,10 @@
}
my $page =
- &Apache::loncommon::start_page($title,'',\%displayargs).
+ &Apache::loncommon::start_page($title,'',\%displayargs)."\n".
+ '<div class="LC_landmark" style="clear:both" role="main">'.
'<p class="LC_error">'.$msg.'</p>'.
+ '</div>'.
&Apache::loncommon::end_page();
if (ref($r)) {
$r->print($page);
Index: loncom/interface/lonhelpmenu.pm
diff -u loncom/interface/lonhelpmenu.pm:1.49 loncom/interface/lonhelpmenu.pm:1.50
--- loncom/interface/lonhelpmenu.pm:1.49 Mon May 30 12:31:06 2022
+++ loncom/interface/lonhelpmenu.pm Thu Feb 20 03:05:34 2025
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# generate frame-based help system
#
-# $Id: lonhelpmenu.pm,v 1.49 2022/05/30 12:31:06 raeburn Exp $
+# $Id: lonhelpmenu.pm,v 1.50 2025/02/20 03:05:34 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -155,13 +155,14 @@
{'only_body' => 1,}));
}
my $menu = &helpmenu_items($dom,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail,$stayOnPage);
+ $r->print('<div class="LC_landmark" role="main">'."\n");
if ($menu) {
$r->print("<ul id=\"LC_secondary_menu\">$menu</ul>");
}
if ($stayOnPage && $env{'user.adv'}) {
$r->print('<br />');
}
- $r->print(&Apache::loncommon::end_page());
+ $r->print('</div>'.&Apache::loncommon::end_page());
}
sub helpmenu_items {
@@ -180,6 +181,17 @@
lastloc => 'Go back',
close => 'Close',
);
+ my %alt = &Apache::lonlocal::texthash(
+ general => 'Intro help icon',
+ component => 'Topic icon',
+ faq => 'FAQ icon',
+ helpdesk => 'Helpdesk form icon',
+ bugs => 'Bug reporting icon',
+ manuals_web => 'HTML manuals icon',
+ manuals_pdf => 'PDF manuals icon',
+ lastloc => 'Return icon',
+ close => 'Close help icon',
+ );
my ($target,$bugs_target);
if ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) ||
(($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) {
@@ -193,58 +205,58 @@
general => {
href => '/adm/help/'.$general_help.'.hlp',
img => $location.'/help/help.png',
- alt => $lt{'general'},
+ alt => $alt{'general'},
text => $lt{'general'},
},
component => {
href => $component_url,
img => $location.'/help/help.png',
- alt => $lt{'component'},
+ alt => $alt{'component'},
text => $topic,
},
faq => {
href => $faqbaseurl.'fom/cache/'.$faq.'.html',
img => $location.'/lonMisc/smallFAQ.gif',
- alt => $lt{'faq'},
+ alt => $alt{'faq'},
text => $lt{'faq'},
},
helpdesk => {
href => '#',
onclick => 'gohelpdesk()',
img => $location.'/lonIcons/helpdesk.gif',
- alt => $lt{'helpdesk'},
+ alt => $alt{'helpdesk'},
text => $lt{'helpdesk'},
},
bugs => {
href => $bugurl,
img => $location.'/lonMisc/smallBug.gif',
- alt => $lt{'bugs'},
+ alt => $alt{'bugs'},
text => $lt{'bugs'},
target => $bugs_target,
},
manuals_web => {
href => '',
img => $location.'/lonIcons/html.gif',
- alt => $lt{'manuals_web'},
+ alt => $alt{'manuals_web'},
text => $lt{'manuals_web'},
},
manuals_pdf => {
href => '',
img => $location.'/lonIcons/pdf.gif',
- alt => $lt{'manuals_pdf'},
+ alt => $alt{'manuals_pdf'},
text => $lt{'manuals_pdf'},
},
lastloc => {
href => &HTML::Entities::encode($origurl,'"&<>'),
img => '/res/adm/pages/tolastloc.png',
- alt => $lt{'lastloc'},
+ alt => $alt{'lastloc'},
text => $lt{'lastloc'},
target => $target,
},
close => {
href => 'javascript:window.close()',
img => $location.'/lonIcons/close.gif',
- alt => $lt{'close'},
+ alt => $alt{'close'},
text => $lt{'close'},
target => $target,
},
@@ -349,7 +361,7 @@
my $menu = '<li class="LC_hoverable">'.$img.
'<a href="'.$link.'"'.$disptarget.'>'.
'<span class="LC_nobreak">'.$title.
- '<span class="LC_fontsize_small" style="font-weight:normal;">'.
+ '<span class="LC_fontsize_medium" style="font-weight:normal;">'.
' ▼</span></span></a>'.
'<ul>';
my $count = 0;
More information about the LON-CAPA-cvs
mailing list