Commit 9a5aa252 by Brittany Cheng

Merge branch 'master' of github.com:dementrock/mitx into discussion

parents 08fd19c3 b04a6456
$ ->
if Markdown?
mathRenderer = new MathJaxDelayRenderer()
removeMath = (text) -> text
replaceMath = (text) -> text
updateMathJax = ->
console.log "updating"
#mathRenderer.render
# element: $("#wmd-preview")
MathJax.Hub.Queue(["Typeset", MathJax.Hub, "wmd-preview"])
converter = Markdown.getSanitizingConverter()
editor = new Markdown.Editor(converter)
#converter.hooks.chain "preConversion", removeMath
converter.hooks.chain "preConversion", removeMath
converter.hooks.chain "postConversion", replaceMath
editor.hooks.chain "onPreviewRefresh", updateMathJax
editor.run()
......@@ -188,12 +188,6 @@ $discussion_input_width: 60%;
}
body
{
background-color: White;
font-family: sans-serif;
}
.wmd-panel
{
margin-left: 25%;
......@@ -214,6 +208,7 @@ body
width: 100%;
background-color: Gainsboro;
border: 1px solid DarkGray;
font-style: normal;
}
.wmd-preview
......@@ -277,9 +272,6 @@ body
left: 300px;
}
.wmd-prompt-background
{
background-color: Black;
......
......@@ -8,6 +8,25 @@
</%block>
<%block name="js_extra">
<!-- The configuration below is different from the main mathjax config because dollar signs make it easier
to integrate with Markdown. -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [
["$","$"],
],
displayMath: [
["$$","$$"],
]
}
});
</script>
<!-- This must appear after all mathjax-config blocks, so it is after the imports from the other templates.
It can't be run through static.url because MathJax uses crazy url introspection to do lazy loading of
MathJax extension libraries -->
<script type="text/javascript" src="/static/js/vendor/mathjax-MathJax-c9db6ac/MathJax.js?config=TeX-MML-AM_HTMLorMML-full"></script>
<script type="text/javascript" src="${static.url('js/vendor/Markdown.Converter.js')}"></script>
<script type="text/javascript" src="${static.url('js/vendor/Markdown.Sanitizer.js')}"></script>
<script type="text/javascript" src="${static.url('js/vendor/Markdown.Editor.js')}"></script>
......
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