Commit 6791e818 by Brittany Cheng

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

parents 5c480753 8eda490d
$ -> $ ->
converter = Markdown.getSanitizingConverter()
editor = new Markdown.Editor(converter) if Markdown?
#converter.hooks.chain "preConversion", removeMath mathRenderer = new MathJaxDelayRenderer()
editor.run() 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 "postConversion", replaceMath
editor.hooks.chain "onPreviewRefresh", updateMathJax
editor.run()
...@@ -188,123 +188,115 @@ $discussion_input_width: 60%; ...@@ -188,123 +188,115 @@ $discussion_input_width: 60%;
} }
body
{
background-color: White;
font-family: sans-serif;
}
.wmd-panel .wmd-panel
{ {
margin-left: 25%; margin-left: 25%;
margin-right: 25%; margin-right: 25%;
width: 50%; width: 50%;
min-width: 500px; min-width: 500px;
} }
.wmd-button-bar .wmd-button-bar
{ {
width: 100%; width: 100%;
background-color: Silver; background-color: Silver;
} }
.wmd-input .wmd-input
{ {
height: 300px; height: 300px;
width: 100%; width: 100%;
background-color: Gainsboro; background-color: Gainsboro;
border: 1px solid DarkGray; border: 1px solid DarkGray;
font-style: normal;
} }
.wmd-preview .wmd-preview
{ {
background-color: #c0e0ff; background-color: #c0e0ff;
} }
.wmd-button-row .wmd-button-row
{ {
position: relative; position: relative;
margin-left: 5px; margin-left: 5px;
margin-right: 5px; margin-right: 5px;
margin-bottom: 5px; margin-bottom: 5px;
margin-top: 10px; margin-top: 10px;
padding: 0px; padding: 0px;
height: 20px; height: 20px;
} }
.wmd-spacer .wmd-spacer
{ {
width: 1px; width: 1px;
height: 20px; height: 20px;
margin-left: 14px; margin-left: 14px;
position: absolute; position: absolute;
background-color: Silver; background-color: Silver;
display: inline-block; display: inline-block;
list-style: none; list-style: none;
} }
.wmd-button { .wmd-button {
width: 20px; width: 20px;
height: 20px; height: 20px;
padding-left: 2px; padding-left: 2px;
padding-right: 3px; padding-right: 3px;
position: absolute; position: absolute;
display: inline-block; display: inline-block;
list-style: none; list-style: none;
cursor: pointer; cursor: pointer;
} }
.wmd-button > span { .wmd-button > span {
background-image: url('/static/images/wmd-buttons.png'); background-image: url('/static/images/wmd-buttons.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 0px 0px; background-position: 0px 0px;
width: 20px; width: 20px;
height: 20px; height: 20px;
display: inline-block; display: inline-block;
} }
.wmd-spacer1 .wmd-spacer1
{ {
left: 50px; left: 50px;
} }
.wmd-spacer2 .wmd-spacer2
{ {
left: 175px; left: 175px;
} }
.wmd-spacer3 .wmd-spacer3
{ {
left: 300px; left: 300px;
} }
.wmd-prompt-background .wmd-prompt-background
{ {
background-color: Black; background-color: Black;
} }
.wmd-prompt-dialog .wmd-prompt-dialog
{ {
border: 1px solid #999999; border: 1px solid #999999;
background-color: #F5F5F5; background-color: #F5F5F5;
} }
.wmd-prompt-dialog > div { .wmd-prompt-dialog > div {
font-size: 0.8em; font-size: 0.8em;
font-family: arial, helvetica, sans-serif; font-family: arial, helvetica, sans-serif;
} }
.wmd-prompt-dialog > form > input[type="text"] { .wmd-prompt-dialog > form > input[type="text"] {
border: 1px solid #999999; border: 1px solid #999999;
color: black; color: black;
} }
.wmd-prompt-dialog > form > input[type="button"]{ .wmd-prompt-dialog > form > input[type="button"]{
border: 1px solid #888888; border: 1px solid #888888;
font-family: trebuchet MS, helvetica, sans-serif; font-family: trebuchet MS, helvetica, sans-serif;
font-size: 0.8em; font-size: 0.8em;
font-weight: bold; font-weight: bold;
} }
...@@ -8,6 +8,25 @@ ...@@ -8,6 +8,25 @@
</%block> </%block>
<%block name="js_extra"> <%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.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.Sanitizer.js')}"></script>
<script type="text/javascript" src="${static.url('js/vendor/Markdown.Editor.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