Commit 7cd09145 by Rocky Duan

minor changes

parent d507ac6c
...@@ -77,8 +77,8 @@ def get_threads(request, course_id, discussion_id): ...@@ -77,8 +77,8 @@ def get_threads(request, course_id, discussion_id):
query_params = { query_params = {
'page': request.GET.get('page', 1), 'page': request.GET.get('page', 1),
'per_page': THREADS_PER_PAGE, #TODO maybe change this later 'per_page': THREADS_PER_PAGE, #TODO maybe change this later
'sort_key': request.GET.get('sort_key', ''), 'sort_key': request.GET.get('sort_key', 'date'),
'sort_order': request.GET.get('sort_order', ''), 'sort_order': request.GET.get('sort_order', 'desc'),
'text': request.GET.get('text', ''), 'text': request.GET.get('text', ''),
'tags': request.GET.get('tags', ''), 'tags': request.GET.get('tags', ''),
} }
......
...@@ -102,6 +102,7 @@ $ -> ...@@ -102,6 +102,7 @@ $ ->
replaceMath: (text) -> replaceMath: (text) ->
text = text.replace /@@(\d+)@@/g, ($0, $1) => @math[$1] text = text.replace /@@(\d+)@@/g, ($0, $1) => @math[$1]
@math = null @math = null
console.log text
text text
@replaceMathWrapper: (_this) -> @replaceMathWrapper: (_this) ->
...@@ -112,8 +113,8 @@ $ -> ...@@ -112,8 +113,8 @@ $ ->
Markdown.getMathCompatibleConverter = -> Markdown.getMathCompatibleConverter = ->
converter = Markdown.getSanitizingConverter() converter = Markdown.getSanitizingConverter()
processor = new MathJaxProcessor() processor = new MathJaxProcessor()
converter.hooks.chain "preConversion", MathJaxProcessor.removeMathWrapper(processor)#processor.removeMath converter.hooks.chain "preConversion", MathJaxProcessor.removeMathWrapper(processor)
converter.hooks.chain "postConversion", MathJaxProcessor.replaceMathWrapper(processor)#.replaceMath converter.hooks.chain "postConversion", MathJaxProcessor.replaceMathWrapper(processor)
converter converter
Markdown.makeWmdEditor = (elem, appended_id, imageUploadUrl) -> Markdown.makeWmdEditor = (elem, appended_id, imageUploadUrl) ->
......
...@@ -87,8 +87,6 @@ initializeFollowThread = (thread) -> ...@@ -87,8 +87,6 @@ initializeFollowThread = (thread) ->
$discussionContent.attr("status", "normal") $discussionContent.attr("status", "normal")
) )
handleUnvote = (elem) ->
handleVote = (elem, value) -> handleVote = (elem, value) ->
contentType = if $content.hasClass("thread") then "thread" else "comment" contentType = if $content.hasClass("thread") then "thread" else "comment"
url = Discussion.urlFor("#{value}vote_#{contentType}", id) url = Discussion.urlFor("#{value}vote_#{contentType}", id)
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
MathJax.Hub.Config({ MathJax.Hub.Config({
tex2jax: { tex2jax: {
inlineMath: [ inlineMath: [
["$","$"], ["\\(","\\)"],
], ],
displayMath: [ displayMath: [
["$$","$$"], ["\\[","\\]"],
] ]
} }
}); });
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
## This must appear after all mathjax-config blocks, so it is after the imports from the other templates. ## 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 ## 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/js/vendor/mathjax-MathJax-c9db6ac/MathJax.js?config=TeX-MML-AM_HTMLorMML-full"></script>
<!---<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"> </script>-->
<script type="text/javascript" src="${static.url('js/split.js')}"></script> <script type="text/javascript" src="${static.url('js/split.js')}"></script>
<script type="text/javascript" src="${static.url('js/jquery.ajaxfileupload.js')}"></script> <script type="text/javascript" src="${static.url('js/jquery.ajaxfileupload.js')}"></script>
<script type="text/javascript" src="${static.url('js/Markdown.Converter.js')}"></script> <script type="text/javascript" src="${static.url('js/Markdown.Converter.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