Add a couple of missing script files.
authorCameron McCormack <cam@mcc.id.au>
Wed, 01 Aug 2012 20:42:54 +1000
changeset 230 dca57a05d7f1
parent 229 6c6da98a3b0c
child 231 d6e84ee574e6
Add a couple of missing script files.
master/style/link-fixup.js
master/style/load-mathjax.js
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/master/style/link-fixup.js	Wed Aug 01 20:42:54 2012 +1000
@@ -0,0 +1,9 @@
+var local = location.protocol == "file:";
+if (local) {
+  for (n = document.head.firstChild; n; n = n.nextSibling) {
+    if (n.nodeName.toLowerCase() == "link" &&
+        n.getAttribute("href").indexOf("//") == 0) {
+      n.href = "https:" + n.getAttribute("href");
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/master/style/load-mathjax.js	Wed Aug 01 20:42:54 2012 +1000
@@ -0,0 +1,4 @@
+// If there were an "MML_SVG" config we should use that, to avoid the overhead of looking for TeX-style math.
+var n = document.createElement("script");
+n.src = (local ? "https:" : location.protocol) + "//d3eoax9i5htok0.cloudfront.net/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_SVG";
+document.head.appendChild(n);