aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorReynold Xin <rxin@apache.org>2014-06-23 23:18:47 -0700
committerReynold Xin <rxin@apache.org>2014-06-23 23:18:47 -0700
commit420c1c3e1beea03453e0eb9dc06f226c80496d68 (patch)
treefe6748341f4a3ebd031214a958d00d1b930afb0a /docs
parent56eb8af187b19f09810baafb314b21e07cf0a79c (diff)
downloadspark-420c1c3e1beea03453e0eb9dc06f226c80496d68.tar.gz
spark-420c1c3e1beea03453e0eb9dc06f226c80496d68.tar.bz2
spark-420c1c3e1beea03453e0eb9dc06f226c80496d68.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.
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/_layouts/global.html36
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>