Commit 4b842e7a by Edward Loveall

Adds ARIA labels to page elements

This includes calculator open/close button, navigation, profile, and
book's table of content.
parent 4fe22be5
// Generated by CoffeeScript 1.3.2-pre // Generated by CoffeeScript 1.3.3
(function() { (function() {
window.Calculator = (function() { window.Calculator = (function() {
...@@ -20,6 +20,11 @@ ...@@ -20,6 +20,11 @@
Calculator.prototype.toggle = function() { Calculator.prototype.toggle = function() {
$('li.calc-main').toggleClass('open'); $('li.calc-main').toggleClass('open');
$('#calculator_wrapper #calculator_input').focus(); $('#calculator_wrapper #calculator_input').focus();
if ($('.calc.closed').length) {
$('.calc').attr('aria-label', 'Open Calculator');
} else {
$('.calc').attr('aria-label', 'Close Calculator');
}
return $('.calc').toggleClass('closed'); return $('.calc').toggleClass('closed');
}; };
......
...@@ -10,6 +10,11 @@ class window.Calculator ...@@ -10,6 +10,11 @@ class window.Calculator
toggle: -> toggle: ->
$('li.calc-main').toggleClass 'open' $('li.calc-main').toggleClass 'open'
$('#calculator_wrapper #calculator_input').focus() $('#calculator_wrapper #calculator_input').focus()
if $('.calc.closed').length
$('.calc').attr 'aria-label', 'Open Calculator'
else
$('.calc').attr 'aria-label', 'Close Calculator'
$('.calc').toggleClass 'closed' $('.calc').toggleClass 'closed'
helpToggle: -> helpToggle: ->
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<section class="main-content"> <section class="main-content">
<div class="course-wrapper"> <div class="course-wrapper">
<section class="course-index"> <section aria-label="Course Navigation" class="course-index">
<header id="open_close_accordion"> <header id="open_close_accordion">
<h2>Courseware Index</h2> <h2>Courseware Index</h2>
<a href="#">close</a> <a href="#">close</a>
......
...@@ -27,14 +27,14 @@ $(document).ready(function(){ ...@@ -27,14 +27,14 @@ $(document).ready(function(){
<section class="updates"> <section class="updates">
<%include file="updates.html" /> <%include file="updates.html" />
</section> </section>
<section class="handouts"> <section aria-label="Handout Navigation" class="handouts">
<%include file="handouts.html" /> <%include file="handouts.html" />
</section> </section>
% else: % else:
<section class="updates"> <section class="updates">
<%include file="guest_updates.html" /> <%include file="guest_updates.html" />
</section> </section>
<section class="handouts"> <section aria-label="Handout Navigation" class="handouts">
<%include file="guest_handouts.html" /> <%include file="guest_handouts.html" />
</section> </section>
% endif % endif
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<p> Copyright &copy; 2012. MIT. <a href="/t/copyright.html">Some rights reserved.</a> <p> Copyright &copy; 2012. MIT. <a href="/t/copyright.html">Some rights reserved.</a>
</p> </p>
<nav> <nav>
<ul class="social"> <ul aria-label="Social Links" class="social">
<li class="linkedin"> <li class="linkedin">
<a href="http://www.linkedin.com/groups/Friends-Alumni-MITx-4316538">Linked In</a> <a href="http://www.linkedin.com/groups/Friends-Alumni-MITx-4316538">Linked In</a>
</li> </li>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<ul> <ul>
<li><a href="#feedback_div" rel="leanModal">Feedback</a></li> <li><a href="#feedback_div" rel="leanModal">Feedback</a></li>
<li class="calc-main"> <li class="calc-main">
<a href="#" class="calc">Calculator</a> <a aria-label="Open Calculator" href="#" class="calc">Calculator</a>
<div id="calculator_wrapper"> <div id="calculator_wrapper">
<form id="calculator"> <form id="calculator">
......
...@@ -97,7 +97,7 @@ function postJSON(url, data, callback) { ...@@ -97,7 +97,7 @@ function postJSON(url, data, callback) {
<li><a href="/t/mitx_help.html">Help</a></li> <li><a href="/t/mitx_help.html">Help</a></li>
</ul> </ul>
<ul class="social"> <ul aria-label="Social Links" class="social">
<li class="linkedin"> <li class="linkedin">
<a href="http://www.linkedin.com/groups/Friends-Alumni-MITx-4316538">Linked In</a> <a href="http://www.linkedin.com/groups/Friends-Alumni-MITx-4316538">Linked In</a>
</li> </li>
......
<%page args="active_page" /> <%page args="active_page" />
<div class="header-wrapper"> <div class="header-wrapper">
<header> <header aria-label="Global Navigation">
<hgroup> <hgroup>
<h1><em> <h1><em>
% if settings.ENABLE_MULTICOURSE: % if settings.ENABLE_MULTICOURSE:
......
...@@ -179,7 +179,7 @@ $(function() { ...@@ -179,7 +179,7 @@ $(function() {
</section> </section>
<section class="user-info"> <section aria-label="Profile Navigation" class="user-info">
<header> <header>
<h1>Student Profile</h1> <h1>Student Profile</h1>
...@@ -189,7 +189,7 @@ $(function() { ...@@ -189,7 +189,7 @@ $(function() {
<li> <li>
Name: <strong>${name}</strong> Name: <strong>${name}</strong>
%if True: %if True:
<a href="#apply_name_change" rel="leanModal" class="name-edit">Edit</a> <a href="#apply_name_change" rel="leanModal" class="name-edit" aria-label="Edit Name">Edit</a>
%else: %else:
(Name change pending) (Name change pending)
%endif %endif
...@@ -200,18 +200,18 @@ $(function() { ...@@ -200,18 +200,18 @@ $(function() {
</li> </li>
<li> <li>
E-mail: <strong>${email}</strong> <a href="#change_email" rel="leanModal" class="edit-email">Edit</a> E-mail: <strong>${email}</strong> <a href="#change_email" rel="leanModal" class="edit-email" aria-label="Edit Email">Edit</a>
</li> </li>
<li> <li>
Location: <div id="location_sub">${location}</div><div id="description"></div> <a href="#" id="change_location">Edit</a> Location: <div id="location_sub">${location}</div><div id="description"></div> <a href="#" id="change_location" aria-label="Edit Location">Edit</a>
</li> </li>
<li> <li>
Language: <div id="language_sub">${language}</div> <a href="#" id="change_language">Edit</a> Language: <div id="language_sub">${language}</div> <a href="#" id="change_language" aria-label="Edit Language">Edit</a>
</li> </li>
<li> <li>
Password reset Password reset
<input id="id_email" type="hidden" name="email" maxlength="75" value="${email}" /> <input id="id_email" type="hidden" name="email" maxlength="75" value="${email}" />
<input type="submit" id="pwd_reset_button" value="Reset" /> <input type="submit" id="pwd_reset_button" value="Reset" aria-label="Reset Password" />
<p>We'll e-mail a password reset link to ${email}.</p> <p>We'll e-mail a password reset link to ${email}.</p>
</li> </li>
</ul> </ul>
......
<nav class="sequence-nav"> <nav aria-label="Section Navigation" class="sequence-nav">
<ol> <ol>
% for t in range(1,1+len(items)): % for t in range(1,1+len(items)):
<li><a href="#" class="seq_inactive" id="tt_${ t }"></a></li> <li><a href="#" class="seq_inactive" id="tt_${ t }"></a></li>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<div id="seq_content"></div> <div id="seq_content"></div>
<nav class="sequence-bottom"> <nav class="sequence-bottom">
<ul> <ul aria-label="Section Navigation">
<li class="${ id }prev prev"><a href="#">Previous</a></li> <li class="${ id }prev prev"><a href="#">Previous</a></li>
<li class="${ id }next next"><a href="#">Next</a></li> <li class="${ id }next next"><a href="#">Next</a></li>
</ul> </ul>
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<section class="main-content"> <section class="main-content">
<div class="wiki-wrapper"> <div class="wiki-wrapper">
<%block name="wiki_panel"> <%block name="wiki_panel">
<div id="wiki_panel"> <div aria-label="Wiki Navigation" id="wiki_panel">
<h2>Course Wiki</h2> <h2>Course Wiki</h2>
<% <%
if (wiki_article is not UNDEFINED): if (wiki_article is not UNDEFINED):
......
...@@ -59,7 +59,7 @@ $("#open_close_accordion a").click(function(){ ...@@ -59,7 +59,7 @@ $("#open_close_accordion a").click(function(){
<section class="main-content"> <section class="main-content">
<div class="book-wrapper"> <div class="book-wrapper">
<section class="book-sidebar"> <section aria-label="Textbook Navigation" class="book-sidebar">
<header id="open_close_accordion"> <header id="open_close_accordion">
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<a href="#">close</a> <a href="#">close</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment