Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a3fc550a
Commit
a3fc550a
authored
Sep 02, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make markdown & latex work for response / comments (not perfect)
parent
a8b20cca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
lms/static/coffee/src/discussion/views/response_comment_view.coffee
+7
-0
lms/static/coffee/src/discussion/views/thread_response_view.coffee
+1
-1
lms/templates/discussion/_underscore_templates.html
+1
-1
No files found.
lms/static/coffee/src/discussion/views/response_comment_view.coffee
View file @
a3fc550a
...
...
@@ -4,4 +4,11 @@ class @ResponseCommentView extends Backbone.View
render
:
->
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
@
$
(
".timeago"
).
timeago
()
@
convertMath
()
@
convertMath
:
->
body
=
@
$
(
".response-body"
)
body
.
html
DiscussionUtil
.
postMathJaxProcessor
DiscussionUtil
.
markdownWithHighlight
body
.
html
()
body
.
children
(
"p"
).
each
(
index
,
elem
)
->
$
(
elem
).
replaceWith
(
$
(
elem
).
html
())
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
body
[
0
]]
lms/static/coffee/src/discussion/views/thread_response_view.coffee
View file @
a3fc550a
...
...
@@ -17,7 +17,7 @@ class @ThreadResponseView extends Backbone.View
convertMath
:
->
element
=
@
$
(
".response-body"
)
element
.
html
DiscussionUtil
.
postMathJaxProcessor
DiscussionUtil
.
markdownWithHighlight
element
.
html
()
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
.
attr
(
"id"
)
]
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
[
0
]
]
renderComments
:
->
@
model
.
get
(
"comments"
).
each
@
renderComment
...
...
lms/templates/discussion/_underscore_templates.html
View file @
a3fc550a
...
...
@@ -72,7 +72,7 @@
</script>
<script
type=
"text/template"
id=
"response-comment-template"
>
<
p
>
$
{
'<%- body %>'
}
<
span
class
=
"posted-details"
>
–
posted
<
span
class
=
"timeago"
title
=
"${'<%- created_at %>'}"
>
sometime
<
/span> by <a href="${'<%- user_url %>'}">${'<%- username %>'}</
a
><
/span></
p
>
<
p
>
<
span
class
=
"response-body"
>
$
{
'<%- body %>'
}
<
/span>
<span class="posted-details">–posted <span class="timeago" title="${'<%- created_at %>'}">sometime</
span
>
by
<
a
href
=
"${'<%- user_url %>'}"
>
$
{
'<%- username %>'
}
<
/a></
span
><
/p
>
</script>
<script
type=
"text/template"
id=
"thread-list-item-template"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment