From 05c5e7ad0114ec4bd18192e3bbc24bc9bd0bf090 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 14 Jun 2016 18:20:58 -0400 Subject: [PATCH] Allow MathJax root to be configured. Resolves issue #1403. --- unpacked/MathJax.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index c5f4563737..b09c58d684 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -2503,6 +2503,11 @@ MathJax.Hub.Startup = { Config: function () { 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, // set the locale and the default menu value for the locale // @@ -2552,15 +2557,15 @@ MathJax.Hub.Startup = { // ConfigBlocks: function () { 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++) { var type = String(scripts[i].type).replace(/ /g,""); if (type.match(/^text\/x-mathjax-config(;.*)?$/) && !type.match(/;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}); }, //