[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm lonmsgdisplay.pm

raeburn raeburn at source.lon-capa.org
Mon Mar 3 16:42:46 EST 2025


raeburn		Mon Mar  3 21:42:46 2025 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm lonmsgdisplay.pm 
  Log:
  - WCAG 2 compliance.
  
  
-------------- next part --------------
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.358.2.17.2.1 loncom/interface/lonhtmlcommon.pm:1.358.2.17.2.2
--- loncom/interface/lonhtmlcommon.pm:1.358.2.17.2.1	Thu Jan 16 19:44:52 2020
+++ loncom/interface/lonhtmlcommon.pm	Wed Sep  2 00:48:18 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.358.2.17.2.1 2020/01/16 19:44:52 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.358.2.17.2.2 2020/09/02 00:48:18 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2539,9 +2539,9 @@
 
 
 sub resource_info_box {
-   my ($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp)=@_;
+   my ($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp,$divforres)=@_;
    my $return='';
-   if ($stuvcurrent ne '') {
+   if (($stuvcurrent ne '') || ($divforres)) {
        $return = '<div class="LC_left_float">';
    }
    if ($symb) {
@@ -2570,7 +2570,7 @@
     } else {
        $return='<p><span class="LC_error">'.&mt('No context provided.').'</span></p>';
     }
-    if ($stuvcurrent ne '') {
+    if (($stuvcurrent ne '') || ($divforres)) {
         $return .= '</div>';
     }
     return $return;
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.202 loncom/interface/lonmsgdisplay.pm:1.203
--- loncom/interface/lonmsgdisplay.pm:1.202	Wed Jan 29 09:11:10 2025
+++ loncom/interface/lonmsgdisplay.pm	Mon Mar  3 21:42:46 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.202 2025/01/29 09:11:10 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.203 2025/03/03 21:42:46 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -299,15 +299,15 @@
     } else {
         $status = $statushash{$msgstatus};
     }
-    my $output = '<b>'.&mt('Page:').'</b> ';
+    my $output;
     if ($maxdis == 1) {
         # No buttons if only one page is displayed
-        $output .= '1/1';
+        $output = '<b>'.&mt('Page:').'</b> 1/1'; 
     } else {
-        $output .=
+        $output = '<b><label for="startdis">'.&mt('Page:').'</label></b> '.
            '<input type="submit" name="firstview" value="|<" />'.
            '<input type="submit" name="prevview" value="<" />'.
-           ' <input type="text" size="5" name="startdis" value="'.$start.'" onchange="this.form.submit()" /> / '.$maxdis.' '.
+           ' <input type="text" size="5" name="startdis" id="startdis" value="'.$start.'" onchange="this.form.submit()" /> / '.$maxdis.' '.
            '<input type="submit" name="nextview" value=">" />'.
            '<input type="submit" name="lastview" value=">|" />';
     }
@@ -804,7 +804,7 @@
     $groupheader .= &Apache::lonhtmlcommon::breadcrumbs(
                                     &mt('Group messages - [_1]',$description),
                                                         undef,undef,undef,undef,1);
-    return $groupheader;
+    return $groupheader.'<div class="LC_landmark" role="main">';
 }
 
 sub groupmail_sent {
@@ -1360,13 +1360,13 @@
         }
         $r->print(&Apache::loncommon::start_page('Messages'));
         $r->print(&Apache::lonhtmlcommon::breadcrumbs('Send and display messages'));
-        $r->print('<p class="LC_warning">'.
+        $r->print('<div class="LC_landmark" role="main"><p class="LC_warning">'.
                  &mt('Sending of LON-CAPA messages is blocked for your current IP address: [_1].',$clientip).'</p>'.
                  '<ul><li>'.
                  &mt('Note: communication is being blocked for certain IP address(es).').
                  '</li><li>'.
                  &mt('This restriction was set by an administrator in the [_1] LON-CAPA domain.',$showdom).
-                 '</li></ul>');
+                 '</li></ul></div>');
         return;
     }
     my $suffix=&Apache::lonmsg::foldersuffix($folder);
@@ -1441,14 +1441,15 @@
                                        'uas' => 'Upload and Send',
                                        'atta' => 'Attachment',
                                        'to'   => 'To:',
+                                       'msgb' => 'Message body',
                                       );
     my %attachmax = (
                      text => &mt('(1 MB max size)'),
                      num  => 1048576,
                     );
     if (!$forwarding && !$multiforward) {
-        $attachrow = '<tr><td colspan="3"><b>'.$lt{'atta'}.'</b> '.$attachmax{'text'}
-            .': <input type="file" name="attachment" class="LC_flUpload" multiple />'
+        $attachrow = '<tr><td colspan="3"><label><b>'.$lt{'atta'}.'</b> '.$attachmax{'text'}
+            .': <input type="file" name="attachment" class="LC_flUpload" multiple /></label>'
             .'<input type="hidden" id="LC_free_space" value="'.$attachmax{'num'}.'" />'
             .'</td></tr>';
     }
@@ -1754,11 +1755,12 @@
             $r->print(&reply_to_row(\%lt));
         }
         $r->print(&msg_subject_row($dissub,\%lt,$subj_size));
+        my $labeltext = &HTML::Entities::encode($lt{'msgb'}); 
         $r->print(<<"ENDCOMP");
 $attachrow
 </table><br />
 $latexHelp<br />
-<textarea name="message" id="message" cols="80" rows="15" wrap="hard" $textareaclass>$dismsg
+<textarea name="message" id="message" cols="80" rows="15" wrap="hard" $textareaclass aria-label="$labeltext">$dismsg
 </textarea>
 <br />
 $sendmode
@@ -1782,11 +1784,11 @@
 <input type="hidden" name="send" value="on" />
 <h3>$lt{'gen'}</h3>
 <p>
-Subject: <input type="text" size="50" name="subject" />
+<label>$lt{'sb'}: <input type="text" size="50" name="subject" /></label>
 </p>
-<p>$lt{'gmt'}:<br />
+<p><label>$lt{'gmt'}:<br />
 <textarea name="message" id="message" cols="60" rows="10" wrap="hard" $textareaclass>$dismsg
-</textarea></p>
+</textarea></label></p>
 <p>
 $lt{'tff'}:
 ENDBLOCK
@@ -1838,7 +1840,7 @@
       &Apache::loncommon::selectstudent_link('compemail','recuname',
                                              'recdomain');
     my $output = <<"ENDREC";
-<tr><td colspan="3"><span class="LC_nobreak"><b>$lt{'to'}</b> $lt{'us'}: <input type="text" size="12" name="recuname" value="$env{'form.recname'}" /> $lt{'do'}: $domform  $selectlink</span></td></tr>
+<tr><td colspan="3"><span class="LC_nobreak"><b>$lt{'to'}</b> <label>$lt{'us'}: <input type="text" size="12" name="recuname" value="$env{'form.recname'}" /></label> <label>$lt{'do'}: $domform</label>  $selectlink</span></td></tr>
 ENDREC
     return $output;
 }
@@ -1860,9 +1862,9 @@
     my $exmpl = &mt('username:domain,username:domain,...'); 
     my $output = <<"ENDADD";
 <tr><td colspan="3"><fieldset id="LC_additionalrecips"><legend>$lt->{'ad'} <tt>($exmpl)</tt></legend><table>
-<tr><td> </td><td>$lt->{'to'}</td><td><input type="text" size="50" name="additionalrec_to" /></td></tr>
-<tr><td> </td><td>$cc</td><td><input type="text" size="50" name="additionalrec_cc" /></td></tr> 
-<tr><td> </td><td>$bcc</td><td><input type="text" size="50" name="additionalrec_bcc" /></td></tr></table></fieldset></td></tr>
+<tr><td> </td><td><label for="additionalrec_to">$lt->{'to'}</label></td><td><input type="text" size="50" name="additionalrec_to" id="additionalrec_to" /></td></tr>
+<tr><td> </td><td><label for="additionalrec_cc">$cc</label></td><td><input type="text" size="50" name="additionalrec_cc" id="additionalrec_cc" /></td></tr> 
+<tr><td> </td><td><label for="additionalrec_bcc">$bcc</label></td><td><input type="text" size="50" name="additionalrec_bcc" id="additionalrec_bcc" /></td></tr></table></fieldset></td></tr>
 ENDADD
     return $output;
 }
@@ -1892,8 +1894,8 @@
 
 sub msg_subject_row {
     my ($dissub,$lt,$subj_size,$extra) = @_;
-    my $output = '<tr><td colspan="3"><b>'.$lt->{'sb'}.'</b>: <input type="text" size="'.
-                 $subj_size.'" name="subject" value="'.$dissub.'" />'.$extra.
+    my $output = '<tr><td colspan="3"><label><b>'.$lt->{'sb'}.'</b>: <input type="text" size="'.
+                 $subj_size.'" name="subject" value="'.$dissub.'" /></label>'.$extra.
                  '</td></tr>';
     return $output;
 }
@@ -2756,7 +2758,8 @@
     $r->print(&Apache::loncommon::start_page('Messages',
  					$extra));
     $r->print(&Apache::lonhtmlcommon::breadcrumbs
-     		(($title?$title:'Send and display messages')));
+     		(($title?$title:'Send and display messages')).
+              '<div class="LC_landmark" role="main">');
 }
 
 # ---------------------------------------------------------------- Print header
@@ -3622,7 +3625,7 @@
 	&Apache::loncommunicate::menu($r);
 	&disall($r,($folder?$folder:$dismode),$msgstatus);
     }
-    $r->print(&Apache::loncommon::end_page());
+    $r->print('</div>'.&Apache::loncommon::end_page());
     return OK;
 }
 # ================================================= Main program, reset counter


More information about the LON-CAPA-cvs mailing list