From 4b842e7ac85ed508db46379f14d9591301485654 Mon Sep 17 00:00:00 2001 From: Edward Loveall Date: Thu, 17 May 2012 16:31:34 -0400 Subject: [PATCH 1/3] Adds ARIA labels to page elements This includes calculator open/close button, navigation, profile, and book's table of content. --- static/js/application.js | 7 ++++++- templates/coffee/src/calculator.coffee | 5 +++++ templates/courseware.html | 2 +- templates/info.html | 4 ++-- templates/main.html | 4 ++-- templates/marketing.html | 2 +- templates/navigation.html | 2 +- templates/profile.html | 12 ++++++------ templates/seq_module.html | 4 ++-- templates/simplewiki_base.html | 2 +- templates/staticbook.html | 2 +- 11 files changed, 28 insertions(+), 18 deletions(-) diff --git a/static/js/application.js b/static/js/application.js index 876a926ff3..7da71476c8 100644 --- a/static/js/application.js +++ b/static/js/application.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.3.2-pre +// Generated by CoffeeScript 1.3.3 (function() { window.Calculator = (function() { @@ -20,6 +20,11 @@ Calculator.prototype.toggle = function() { $('li.calc-main').toggleClass('open'); $('#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'); }; diff --git a/templates/coffee/src/calculator.coffee b/templates/coffee/src/calculator.coffee index 7d62f5a794..003cf5b1f4 100644 --- a/templates/coffee/src/calculator.coffee +++ b/templates/coffee/src/calculator.coffee @@ -10,6 +10,11 @@ class window.Calculator toggle: -> $('li.calc-main').toggleClass 'open' $('#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' helpToggle: -> diff --git a/templates/courseware.html b/templates/courseware.html index 050172626a..404871e49c 100644 --- a/templates/courseware.html +++ b/templates/courseware.html @@ -20,7 +20,7 @@
-
+

Courseware Index

close diff --git a/templates/info.html b/templates/info.html index 8c914f9f60..67ce69ec85 100644 --- a/templates/info.html +++ b/templates/info.html @@ -27,14 +27,14 @@ $(document).ready(function(){
<%include file="updates.html" />
-
+
<%include file="handouts.html" />
% else:
<%include file="guest_updates.html" />
-
+
<%include file="guest_handouts.html" />
% endif diff --git a/templates/main.html b/templates/main.html index 014248bcd6..c916b80f27 100644 --- a/templates/main.html +++ b/templates/main.html @@ -40,7 +40,7 @@

Copyright © 2012. MIT. Some rights reserved.

-