Files
edx-platform/lms/static/coffee/src/mathjax_accessible.coffee
Dave St.Germain 44109d16ab 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.
2014-02-07 11:12:41 -05:00

22 lines
702 B
CoffeeScript

$ ->
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")
if MathJax? and $("#mathplayer-browser-message").length > 0
$("#mathplayer-browser-message").attr("aria-hidden", "false")
else
$("#mathjax-accessibility-message").attr("aria-hidden", "true")