Check for whether MathJax is already loaded before using MathJax variable for AuthorConfig. Resolves issue #671.

This commit is contained in:
Davide P. Cervone 2013-11-18 20:01:54 -05:00
parent 62a267ed8c
commit 62cdfcfd34

View File

@ -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";
/**********************************************************/