From 44109d16ab541a481559c6bc99e3e23763ae6f43 Mon Sep 17 00:00:00 2001 From: "Dave St.Germain" Date: Thu, 6 Feb 2014 11:13:04 -0500 Subject: [PATCH] For a11y, modal dialogs and script templates should be hidden from screen readers. Also, the mathjax message should be wrapped to prevent non-IE browsers from complaining about a feature that is IE-only. --- .../courseware/tests/test_masquerade.py | 2 +- .../coffee/src/mathjax_accessible.coffee | 33 ++++++++++--------- .../discussion/_underscore_templates.html | 18 +++++----- lms/templates/mathjax_accessible.html | 6 ++-- lms/templates/navigation.html | 12 +++++-- lms/templates/staff_problem_info.html | 12 +++---- 6 files changed, 45 insertions(+), 38 deletions(-) diff --git a/lms/djangoapps/courseware/tests/test_masquerade.py b/lms/djangoapps/courseware/tests/test_masquerade.py index 5f357e4562..4caa73da41 100644 --- a/lms/djangoapps/courseware/tests/test_masquerade.py +++ b/lms/djangoapps/courseware/tests/test_masquerade.py @@ -63,7 +63,7 @@ class TestStaffMasqueradeAsStudent(ModuleStoreTestCase, LoginEnrollmentTestCase) def test_staff_debug_for_staff(self): resp = self.get_cw_section() - sdebug = '
Staff Debug Info
' + sdebug = '' self.assertTrue(sdebug in resp.content) diff --git a/lms/static/coffee/src/mathjax_accessible.coffee b/lms/static/coffee/src/mathjax_accessible.coffee index a97c7fa5b2..b1bd0ca568 100644 --- a/lms/static/coffee/src/mathjax_accessible.coffee +++ b/lms/static/coffee/src/mathjax_accessible.coffee @@ -1,20 +1,21 @@ $ -> - isMPInstalled = (boolean) -> - # check if MathPlayer is installed - # (from http://www.dessci.com/en/products/mathplayer/check.htm) - try - oMP = new ActiveXObject("MathPlayer.Factory.1") - true - catch e - false + if window.navigator.appName is "Microsoft Internet Explorer" + isMPInstalled = (boolean) -> + # check if MathPlayer is installed + # (from http://www.dessci.com/en/products/mathplayer/check.htm) + try + oMP = new ActiveXObject("MathPlayer.Factory.1") + true + catch e + false - # detect if there is mathjax on the page - # if not, set 'aria-hidden' to 'true' - if MathJax? and not isMPInstalled() - $("#mathjax-accessibility-message").attr("aria-hidden", "false") + # detect if there is mathjax on the page + # if not, set 'aria-hidden' to 'true' + if MathJax? and not isMPInstalled() + $("#mathjax-accessibility-message").attr("aria-hidden", "false") - if MathJax? and $("#mathplayer-browser-message").length > 0 - $("#mathplayer-browser-message").attr("aria-hidden", "false") + if MathJax? and $("#mathplayer-browser-message").length > 0 + $("#mathplayer-browser-message").attr("aria-hidden", "false") - else - $("#mathjax-accessibility-message").attr("aria-hidden", "true") + else + $("#mathjax-accessibility-message").attr("aria-hidden", "true") diff --git a/lms/templates/discussion/_underscore_templates.html b/lms/templates/discussion/_underscore_templates.html index 2344d006ad..1505ebafed 100644 --- a/lms/templates/discussion/_underscore_templates.html +++ b/lms/templates/discussion/_underscore_templates.html @@ -2,7 +2,7 @@ <%! from django.template.defaultfilters import escapejs %> <%! from django_comment_client.permissions import has_permission %> - - - - - - - - -