From 62cdfcfd349038219f928c1bf166871be4cc8963 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 18 Nov 2013 20:01:54 -0500 Subject: [PATCH] Check for whether MathJax is already loaded before using MathJax variable for AuthorConfig. Resolves issue #671. --- unpacked/MathJax.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index 409a3e843..e101e0a78 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -27,16 +27,26 @@ * limitations under the License. */ -if (window.MathJax) {window.MathJax = {AuthorConfig: window.MathJax}} else {window.MathJax = {}} + +// +// Check if browser can support MathJax (no one fails this nowadays) +// +if (document.getElementById && document.childNodes && document.createElement) { +// +// Skip if MathJax is already loaded +// +if (!(window.MathJax && MathJax.Hub)) { + +// +// Get author configuration from MathJax variable, if any +// +if (window.MathJax) {window.MathJax = {AuthorConfig: window.MathJax}} + else {window.MathJax = {}} // MathJax.isPacked = true; // This line is uncommented by the packer. -if (document.getElementById && document.childNodes && document.createElement) { - -if (!MathJax.Hub) { // skip if already loaded - MathJax.version = "2.3"; -MathJax.fileversion = "2.3"; +MathJax.fileversion = "2.3.1"; /**********************************************************/