commit be96d3dbfa0a59149b30e6f06a710a82f763c2ba
parent 86a908bda83afa31aae841b8e79b30404bcd3d2b
Author: Frédéric Wang <fred.wang@free.fr>
Date: Wed, 4 Sep 2013 21:23:21 +0200
Allow authors to use the MathJax variable to pass config as well as an AuthorInit function. Fix issue #556
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js
@@ -29,7 +29,7 @@
if (document.getElementById && document.childNodes && document.createElement) {
-if (!window.MathJax) {window.MathJax= {}}
+if (window.MathJax) {window.MathJax = {AuthorConfig: window.MathJax}} else {window.MathJax = {}}
if (!MathJax.Hub) { // skip if already loaded
MathJax.version = "2.2";
@@ -2334,6 +2334,10 @@ MathJax.Hub.Startup = {
}
}
//
+ // Perform author configuration from in-line MathJax = {...}
+ //
+ this.queue.Push(["Config",MathJax.Hub,MathJax.AuthorConfig]);
+ //
// Run the deprecated configuration script, if any (ignoring return value)
// Wait for the startup delay signal
// Run the mathjax-config blocks
@@ -2357,7 +2361,7 @@ MathJax.Hub.Startup = {
return delay;
},
//
- // Run the scipts of type=text/x-mathajx-config
+ // Run the scripts of type=text/x-mathjax-config
//
ConfigBlocks: function () {
var scripts = document.getElementsByTagName("script");
@@ -3021,6 +3025,7 @@ MathJax.Hub.Startup = {
});
HUB.Browser.Select(MathJax.Message.browsers);
+ if (BASE.AuthorConfig && typeof BASE.AuthorConfig.AuthorInit === "function") {BASE.AuthorConfig.AuthorInit()}
HUB.queue = BASE.Callback.Queue();
HUB.queue.Push(
["Post",STARTUP.signal,"Begin"],