NDOJ/resources/pagedown_math.js

17 lines
509 B
JavaScript
Raw Normal View History

2020-01-21 06:35:58 +00:00
function mathjax_pagedown($) {
if ('MathJax' in window) {
$.each(window.editors, function (id, editor) {
var preview = $('div.wmd-preview#' + id + '_wmd_preview')[0];
editor.hooks.chain('onPreviewRefresh', function () {
2022-11-14 03:42:27 +00:00
MathJax.typeset(preview);
2020-01-21 06:35:58 +00:00
});
2022-11-14 03:42:27 +00:00
MathJax.typeset(preview);
2020-01-21 06:35:58 +00:00
});
}
}
window.mathjax_pagedown = mathjax_pagedown;
$(window).load(function () {
(mathjax_pagedown)('$' in window ? $ : django.jQuery);
});