Allow MathJax root to be configured. Resolves issue #1403.
This commit is contained in:
parent
97b9fbcfab
commit
05c5e7ad01
|
@ -2503,6 +2503,11 @@ MathJax.Hub.Startup = {
|
||||||
Config: function () {
|
Config: function () {
|
||||||
this.queue.Push(["Post",this.signal,"Begin Config"]);
|
this.queue.Push(["Post",this.signal,"Begin Config"]);
|
||||||
//
|
//
|
||||||
|
// Make sure root is set before loading any files
|
||||||
|
//
|
||||||
|
if (MathJax.AuthorConfig && MathJax.AuthorConfig.root)
|
||||||
|
MathJax.Ajax.config.root = MathJax.AuthorConfig.root;
|
||||||
|
//
|
||||||
// If a locale is given as a parameter,
|
// If a locale is given as a parameter,
|
||||||
// set the locale and the default menu value for the locale
|
// set the locale and the default menu value for the locale
|
||||||
//
|
//
|
||||||
|
@ -2552,15 +2557,15 @@ MathJax.Hub.Startup = {
|
||||||
//
|
//
|
||||||
ConfigBlocks: function () {
|
ConfigBlocks: function () {
|
||||||
var scripts = document.getElementsByTagName("script");
|
var scripts = document.getElementsByTagName("script");
|
||||||
var last = null, queue = MathJax.Callback.Queue();
|
var queue = MathJax.Callback.Queue();
|
||||||
for (var i = 0, m = scripts.length; i < m; i++) {
|
for (var i = 0, m = scripts.length; i < m; i++) {
|
||||||
var type = String(scripts[i].type).replace(/ /g,"");
|
var type = String(scripts[i].type).replace(/ /g,"");
|
||||||
if (type.match(/^text\/x-mathjax-config(;.*)?$/) && !type.match(/;executed=true/)) {
|
if (type.match(/^text\/x-mathjax-config(;.*)?$/) && !type.match(/;executed=true/)) {
|
||||||
scripts[i].type += ";executed=true";
|
scripts[i].type += ";executed=true";
|
||||||
last = queue.Push(scripts[i].innerHTML+";\n1;");
|
queue.Push(scripts[i].innerHTML+";\n1;");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return last;
|
return queue.Push(function () {MathJax.Ajax.config.root = MathJax.Hub.config.root});
|
||||||
},
|
},
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue
Block a user