Skip to content

Commit

Permalink
MDL-46748 MathJax filter: Make misconfigured mathjax url less "fatal"…
Browse files Browse the repository at this point in the history
… for Atto.
  • Loading branch information
Damyon Wiese committed Aug 11, 2014
1 parent 14cb870 commit fa268b7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
_setLocale: function() {
if (!this._configured) {
var lang = this._lang;
MathJax.Hub.Queue(function () {
MathJax.Localization.setLocale(lang);
});
MathJax.Hub.Configured();
this._configured = true;
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(function () {
MathJax.Localization.setLocale(lang);
});
MathJax.Hub.Configured();
this._configured = true;
}
}
},

Expand All @@ -95,7 +97,9 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
Y.use('mathjax', function() {
self._setLocale();
Y.all('.filter_mathjaxloader_equation').each(function(node) {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
}
});
});
}
Expand All @@ -112,7 +116,9 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
self._setLocale();
event.nodes.each(function (node) {
node.all('.filter_mathjaxloader_equation').each(function(node) {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
}
});
});
});
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
_setLocale: function() {
if (!this._configured) {
var lang = this._lang;
MathJax.Hub.Queue(function () {
MathJax.Localization.setLocale(lang);
});
MathJax.Hub.Configured();
this._configured = true;
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(function () {
MathJax.Localization.setLocale(lang);
});
MathJax.Hub.Configured();
this._configured = true;
}
}
},

Expand All @@ -95,7 +97,9 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
Y.use('mathjax', function() {
self._setLocale();
Y.all('.filter_mathjaxloader_equation').each(function(node) {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
}
});
});
}
Expand All @@ -112,7 +116,9 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
self._setLocale();
event.nodes.each(function (node) {
node.all('.filter_mathjaxloader_equation').each(function(node) {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
}
});
});
});
Expand Down
20 changes: 13 additions & 7 deletions filter/mathjaxloader/yui/src/loader/js/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
_setLocale: function() {
if (!this._configured) {
var lang = this._lang;
MathJax.Hub.Queue(function () {
MathJax.Localization.setLocale(lang);
});
MathJax.Hub.Configured();
this._configured = true;
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(function () {
MathJax.Localization.setLocale(lang);
});
MathJax.Hub.Configured();
this._configured = true;
}
}
},

Expand All @@ -93,7 +95,9 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
Y.use('mathjax', function() {
self._setLocale();
Y.all('.filter_mathjaxloader_equation').each(function(node) {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
}
});
});
}
Expand All @@ -110,7 +114,9 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
self._setLocale();
event.nodes.each(function (node) {
node.all('.filter_mathjaxloader_equation').each(function(node) {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
}
});
});
});
Expand Down

0 comments on commit fa268b7

Please sign in to comment.