diff --git a/lms/static/coffee/src/mathjax_accessible.coffee b/lms/static/coffee/src/mathjax_accessible.coffee new file mode 100644 index 0000000000..f0114a2f66 --- /dev/null +++ b/lms/static/coffee/src/mathjax_accessible.coffee @@ -0,0 +1,16 @@ +$ -> + 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") + else + $("#mathjax-accessibility-message").attr("aria-hidden", "true") diff --git a/lms/templates/main.html b/lms/templates/main.html index 60d238f36d..60658111c8 100644 --- a/lms/templates/main.html +++ b/lms/templates/main.html @@ -76,6 +76,7 @@
+ <%include file="mathjax_accessible.html" /> % if theme_enabled(): <%include file="theme-header.html" /> diff --git a/lms/templates/mathjax_accessible.html b/lms/templates/mathjax_accessible.html new file mode 100644 index 0000000000..b3c6283e62 --- /dev/null +++ b/lms/templates/mathjax_accessible.html @@ -0,0 +1,22 @@ +<%! from django.utils.translation import ugettext as _ %> + + + + + +