commit 62cdfcfd349038219f928c1bf166871be4cc8963 parent 62a267ed8ca93502bcde05ed4d05e3bbaaa052c2 Author: Davide P. Cervone <dpvc@union.edu> Date: Mon, 18 Nov 2013 20:01:54 -0500 Check for whether MathJax is already loaded before using MathJax variable for AuthorConfig. Resolves issue #671. Diffstat:
| M | unpacked/MathJax.js | | | 22 | ++++++++++++++++------ |
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git 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 = {}} - -// MathJax.isPacked = true; // This line is uncommented by the packer. +// +// Check if browser can support MathJax (no one fails this nowadays) +// if (document.getElementById && document.childNodes && document.createElement) { - -if (!MathJax.Hub) { // skip if already loaded +// +// 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. + MathJax.version = "2.3"; -MathJax.fileversion = "2.3"; +MathJax.fileversion = "2.3.1"; /**********************************************************/