Repository: spark Updated Branches: refs/heads/branch-1.0 c43835305 -> 05f84e28f
[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 <r...@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 <r...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/05f84e28 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/05f84e28 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/05f84e28 Branch: refs/heads/branch-1.0 Commit: 05f84e28f58c4bfdb6625d095aa04d6da3ef2c51 Parents: c438353 Author: Reynold Xin <r...@apache.org> Authored: Mon Jun 23 23:18:47 2014 -0700 Committer: Reynold Xin <r...@apache.org> Committed: Mon Jun 23 23:18:54 2014 -0700 ---------------------------------------------------------------------- docs/_layouts/global.html | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/05f84e28/docs/_layouts/global.html ---------------------------------------------------------------------- diff --git a/docs/_layouts/global.html b/docs/_layouts/global.html index 4ba20e5..b30ab1e 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>