diff options
author | Reynold Xin <rxin@apache.org> | 2014-06-23 23:18:47 -0700 |
---|---|---|
committer | Reynold Xin <rxin@apache.org> | 2014-06-23 23:18:54 -0700 |
commit | 05f84e28f58c4bfdb6625d095aa04d6da3ef2c51 (patch) | |
tree | 7702fa35db7f44c877305ff6e340608ca7a866e7 /docs | |
parent | c43835305bcc5498a8543688547b92f431498c25 (diff) | |
download | spark-05f84e28f58c4bfdb6625d095aa04d6da3ef2c51.tar.gz spark-05f84e28f58c4bfdb6625d095aa04d6da3ef2c51.tar.bz2 spark-05f84e28f58c4bfdb6625d095aa04d6da3ef2c51.zip |
[SPARK-2252] Fix MathJax for HTTPs.
Found out about this from the Hacker News link to GraphX which was using HTTPs.
@mengxr
Author: Reynold Xin <rxin@apache.org>
Closes #1189 from rxin/mllib-doc and squashes the following commits:
5328be0 [Reynold Xin] [SPARK-2252] Fix MathJax for HTTPs.
(cherry picked from commit 420c1c3e1beea03453e0eb9dc06f226c80496d68)
Signed-off-by: Reynold Xin <rxin@apache.org>
Diffstat (limited to 'docs')
-rwxr-xr-x | docs/_layouts/global.html | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/docs/_layouts/global.html b/docs/_layouts/global.html index 4ba20e590f..b30ab1e521 100755 --- a/docs/_layouts/global.html +++ b/docs/_layouts/global.html @@ -136,21 +136,31 @@ <!-- MathJax Section --> <script type="text/x-mathjax-config"> - MathJax.Hub.Config({ + MathJax.Hub.Config({ TeX: { equationNumbers: { autoNumber: "AMS" } } - }); - </script> - <script type="text/javascript" - src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> + }); + </script> <script> - MathJax.Hub.Config({ - tex2jax: { - inlineMath: [ ["$", "$"], ["\\\\(","\\\\)"] ], - displayMath: [ ["$$","$$"], ["\\[", "\\]"] ], - processEscapes: true, - skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'] - } - }); + // Note that we load MathJax this way to work with local file (file://), HTTP and HTTPS. + // We could use "//cdn.mathjax...", but that won't support "file://". + (function(d, script) { + script = d.createElement('script'); + script.type = 'text/javascript'; + script.async = true; + script.onload = function(){ + MathJax.Hub.Config({ + tex2jax: { + inlineMath: [ ["$", "$"], ["\\\\(","\\\\)"] ], + displayMath: [ ["$$","$$"], ["\\[", "\\]"] ], + processEscapes: true, + skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'] + } + }); + }; + script.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + + 'cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'; + d.getElementsByTagName('head')[0].appendChild(script); + }(document)); </script> </body> </html> |