check that jsMath and jsMath.Autoload exist

This commit is contained in:
ccd0 2014-05-24 01:15:21 -07:00
parent 6b838f7992
commit 6a1706f5b6

View File

@ -18,10 +18,11 @@ Fourchan =
# https://github.com/MayhemYDG/4chan-x/issues/645#issuecomment-13704562
$.globalEval '''
window.addEventListener('jsmath', function(e) {
if (!jsMath) return;
if (jsMath.loaded) {
// process one post
jsMath.ProcessBeforeShowing(e.detail);
} else if (jsMath.Autoload.checked) {
} else if (jsMath.Autoload && jsMath.Autoload.checked) {
// load jsMath and process whole document
jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]);
jsMath.Autoload.LoadJsMath();