Browse files

MDL-30918 Chat: Added hidden section headers and aria attributes

  • Loading branch information...
1 parent c8ac480 commit 02a011eabcaf740395485611d9ee0e739a1c7b46 Rajesh Taneja committed Sep 20, 2012
Showing with 14 additions and 3 deletions.
  1. +6 −3 mod/chat/gui_ajax/index.php
  2. +7 −0 mod/chat/gui_ajax/module.js
  3. +1 −0 mod/chat/lang/en/chat.php
@@ -72,13 +72,16 @@
echo $OUTPUT->header();
-echo $OUTPUT->box('<ul id="users-list"></ul>', '', 'chat-userlist');
+echo $OUTPUT->box(html_writer::tag('h2', get_string('participants'), array('class' => 'accesshide')) .
+ '<ul id="users-list"></ul>', '', 'chat-userlist');
echo $OUTPUT->box('', '', 'chat-options');
-echo $OUTPUT->box('<ul id="messages-list"></ul>', '', 'chat-messages');
+echo $OUTPUT->box(html_writer::tag('h2', get_string('messages', 'chat'), array('class' => 'accesshide')) .
+ '<ul id="messages-list"></ul>', '', 'chat-messages');
$table = new html_table();
$table->data = array(
array(' &raquo; <label class="accesshide" for="input-message">' . get_string('entermessage', 'chat') . ' </label><input type="text" disabled="true" id="input-message" value="Loading..." size="50" /> <input type="button" id="button-send" value="'.get_string('send', 'chat').'" /> <a id="choosetheme" href="###">'.get_string('themes').' &raquo; </a>')
-echo $OUTPUT->box(html_writer::table($table), '', 'chat-input-area');
+echo $OUTPUT->box(html_writer::tag('h2', get_string('composemessage', 'chat'), array('class' => 'accesshide')) .
+ html_writer::table($table), '', 'chat-input-area');
echo $OUTPUT->box('', '', 'chat-notify');
echo $OUTPUT->footer();
@@ -60,6 +60,13 @@ M.mod_chat_ajax.init = function(Y, cfg) {
this.sendbutton ='#button-send');
this.messagebox ='#chat-messages');
+ // Set aria attributes to messagebox and chat-userlist
+ this.messagebox.set('role', 'log');
+ this.messagebox.set('aria-live', 'polite');
+ var userlist ='#chat-userlist');
+ userlist.set('aria-live', 'polite');
+ userlist.set('aria-relevant', 'all');
// Attach the default events for this module
this.sendbutton.on('click', this.send, this);
this.messagebox.on('mouseenter', function() {
@@ -28,6 +28,7 @@
$string['autoscroll'] = 'Auto scroll';
$string['beep'] = 'beep';
$string['cantlogin'] = 'Could not log in to chat room!!';
+$string['composemessage'] = 'Compose a message';
$string['configmethod'] = 'The ajax chat method provide an ajax based chat interface, it contacts server regularly for update. The normal chat method involves the clients regularly contacting the server for updates. It requires no configuration and works everywhere, but it can create a large load on the server with many chatters. Using a server daemon requires shell access to Unix, but it results in a fast scalable chat environment.';
$string['confignormalupdatemode'] = 'Chatroom updates are normally served efficiently using the <em>Keep-Alive</em> feature of HTTP 1.1, but this is still quite heavy on the server. A more advanced method is to use the <em>Stream</em> strategy to feed updates to the users. Using <em>Stream</em> scales much better (similar to the chatd method) but may not be supported by your server.';
$string['configoldping'] = 'What is the maximum time that may pass before we detect that a user has disconnected (in seconds)? This is just an upper limit, as usually disconnects are detected very quickly. Lower values will be more demanding on your server. If you are using the normal method, <strong>never</strong> set this lower than 2 * chat_refresh_room.';

0 comments on commit 02a011e

Please sign in to comment.