Commit 34362b88 by Adam Palay

add accessibility message if mathjax is detected

use ie conditional html tags to detect for compatible ie versions
parent 75b7514c
$ ->
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")
......@@ -76,6 +76,7 @@
</head>
<body class="<%block name='bodyclass'/>">
<%include file="mathjax_accessible.html" />
% if theme_enabled():
<%include file="theme-header.html" />
......
<%! from django.utils.translation import ugettext as _ %>
<div class="sr message-accessibility message" id="mathjax-accessibility-message" aria-hidden="false">
<p class="copy">${
_("This page features MathJax technology to render mathematical "
"formulae. To make math accessibile, we suggest using the MathPlayer "
"plugin. Please visit the {link_start}MathPlayer Download "
"Page{link_end} to download the plugin for your browser.").format(
link_start = u'<a href="//www.dessci.com/en/products/mathplayer/'
'download.htm">',
link_end = u'</a>')
}</p>
</div>
<!--[if (lt IE6)|(gt IE 9)|!(IE)]><!-->
<div class="sr message-accessibility message" id="mathplayer-browser-message" aria-hidden="false">
<p class="copy">
${_("Your browser does not support the MathPlayer plugin. To use "
"MathPlayer, please use Internet Explorer 6 through 9.")}
</p>
</div>
<!--[endif]-->
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