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
f59ea804
Commit
f59ea804
authored
Sep 02, 2012
by
Rocky Duan
Committed by
Matthew Mongeau
Sep 10, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make markdown & latex work for response / comments (not perfect)
parent
4726c990
Show 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 @
f59ea804
...
@@ -4,4 +4,11 @@ class @ResponseCommentView extends Backbone.View
...
@@ -4,4 +4,11 @@ class @ResponseCommentView extends Backbone.View
render
:
->
render
:
->
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
@
$
(
".timeago"
).
timeago
()
@
$
(
".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 @
f59ea804
...
@@ -17,7 +17,7 @@ class @ThreadResponseView extends Backbone.View
...
@@ -17,7 +17,7 @@ class @ThreadResponseView extends Backbone.View
convertMath
:
->
convertMath
:
->
element
=
@
$
(
".response-body"
)
element
=
@
$
(
".response-body"
)
element
.
html
DiscussionUtil
.
postMathJaxProcessor
DiscussionUtil
.
markdownWithHighlight
element
.
html
()
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
:
->
renderComments
:
->
@
model
.
get
(
"comments"
).
each
@
renderComment
@
model
.
get
(
"comments"
).
each
@
renderComment
...
...
lms/templates/discussion/_underscore_templates.html
View file @
f59ea804
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
</script>
</script>
<script
type=
"text/template"
id=
"response-comment-template"
>
<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>
<script
type=
"text/template"
id=
"thread-list-item-template"
>
<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