Commit fa3bfd77 by kimth

Set up mathjax_preprocessor

parent 36b44253
...@@ -6,6 +6,7 @@ class @Problem ...@@ -6,6 +6,7 @@ class @Problem
@element_id = @el.attr('id') @element_id = @el.attr('id')
@url = @el.data('url') @url = @el.data('url')
@render() @render()
@mathjax_preprocessor = false
$: (selector) -> $: (selector) ->
$(selector, @el) $(selector, @el)
...@@ -300,8 +301,8 @@ class @Problem ...@@ -300,8 +301,8 @@ class @Problem
if jax = MathJax.Hub.getAllJax(target)[0] if jax = MathJax.Hub.getAllJax(target)[0]
eqn = $(element).val() eqn = $(element).val()
if window.mathjax_preprocessor if @mathjax_preprocessor
eqn = window.mathjax_preprocessor(eqn) eqn = @mathjax_preprocessor(eqn)
MathJax.Hub.Queue ['Text', jax, eqn], MathJax.Hub.Queue ['Text', jax, eqn],
[@updateMathML, jax, element] [@updateMathML, jax, element]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment