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
9f59a9a8
Commit
9f59a9a8
authored
Aug 30, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get math working.
parent
7f0f7195
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
51 deletions
+13
-51
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
+7
-1
lms/static/coffee/src/discussion/views/thread_response_view.coffee
+6
-0
lms/templates/discussion/single_thread.html
+0
-50
No files found.
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
9f59a9a8
...
@@ -20,9 +20,15 @@ class @DiscussionThreadView extends Backbone.View
...
@@ -20,9 +20,15 @@ class @DiscussionThreadView extends Backbone.View
@
$
(
".vote-btn"
).
addClass
(
"is-cast"
)
@
$
(
".vote-btn"
).
addClass
(
"is-cast"
)
@
$
(
"span.timeago"
).
timeago
()
@
$
(
"span.timeago"
).
timeago
()
Markdown
.
makeWmdEditor
@
$
(
".reply-body"
),
""
,
DiscussionUtil
.
urlFor
(
"upload"
),
(
text
)
->
DiscussionUtil
.
postMathJaxProcessor
(
text
)
Markdown
.
makeWmdEditor
@
$
(
".reply-body"
),
""
,
DiscussionUtil
.
urlFor
(
"upload"
),
(
text
)
->
DiscussionUtil
.
postMathJaxProcessor
(
text
)
@
convertMath
()
@
renderResponses
()
@
renderResponses
()
@
@
convertMath
:
->
element
=
@
$
(
".post-body"
)
element
.
html
DiscussionUtil
.
postMathJaxProcessor
DiscussionUtil
.
markdownWithHighlight
element
.
html
()
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
.
attr
(
"id"
)]
renderResponses
:
->
renderResponses
:
->
$
.
ajax
@
model
.
id
,
success
:
(
data
,
textStatus
,
xhr
)
=>
$
.
ajax
@
model
.
id
,
success
:
(
data
,
textStatus
,
xhr
)
=>
comments
=
new
Comments
(
data
[
'content'
][
'children'
])
comments
=
new
Comments
(
data
[
'content'
][
'children'
])
...
@@ -84,7 +90,7 @@ class @DiscussionThreadView extends Backbone.View
...
@@ -84,7 +90,7 @@ class @DiscussionThreadView extends Backbone.View
submitComment
:
->
submitComment
:
->
url
=
@
model
.
urlFor
(
'reply'
)
url
=
@
model
.
urlFor
(
'reply'
)
body
=
DiscussionUtil
.
getWmdContent
@
$el
,
$
.
proxy
(
@
$
,
@
),
"reply-body"
body
=
@
$
(
"#wmd-input"
).
val
()
response
=
new
Comment
(
body
:
body
,
created_at
:
(
new
Date
()).
toISOString
(),
username
:
window
.
user
.
get
(
"username"
),
votes
:
{
up_count
:
0
})
response
=
new
Comment
(
body
:
body
,
created_at
:
(
new
Date
()).
toISOString
(),
username
:
window
.
user
.
get
(
"username"
),
votes
:
{
up_count
:
0
})
@
renderResponse
(
response
)
@
renderResponse
(
response
)
...
...
lms/static/coffee/src/discussion/views/thread_response_view.coffee
View file @
9f59a9a8
...
@@ -10,9 +10,15 @@ class @ThreadResponseView extends Backbone.View
...
@@ -10,9 +10,15 @@ class @ThreadResponseView extends Backbone.View
if
window
.
user
.
voted
(
@
model
)
if
window
.
user
.
voted
(
@
model
)
@
$
(
".vote-btn"
).
addClass
(
"is-cast"
)
@
$
(
".vote-btn"
).
addClass
(
"is-cast"
)
@
$
(
".posted-details"
).
timeago
()
@
$
(
".posted-details"
).
timeago
()
@
convertMath
()
@
renderComments
()
@
renderComments
()
@
@
convertMath
:
->
element
=
@
$
(
".response-body"
)
element
.
html
DiscussionUtil
.
postMathJaxProcessor
DiscussionUtil
.
markdownWithHighlight
element
.
html
()
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
.
attr
(
"id"
)]
renderComments
:
->
renderComments
:
->
@
model
.
get
(
"comments"
).
each
@
renderComment
@
model
.
get
(
"comments"
).
each
@
renderComment
...
...
lms/templates/discussion/single_thread.html
View file @
9f59a9a8
...
@@ -64,56 +64,6 @@
...
@@ -64,56 +64,6 @@
</div>
</div>
</nav>
</nav>
<article
class=
"new-post-article"
>
<div
class=
"inner-wrapper"
>
<form
class=
"new-post-form"
>
<div
class=
"left-column"
>
<label>
Create new post in:
</label>
<div
class=
"topic-drop"
>
<a
href=
"#"
class=
"topic-drop-btn"
>
Homework / Week 1
<span
class=
"drop-arrow"
>
▾
</span></a>
<ul
class=
"topic-drop-menu"
>
<li><a
href=
"#"
>
All
</a></li>
<li><a
href=
"#"
>
Following
</a></li>
<li><a
href=
"#"
>
General
</a></li>
<li>
<a
href=
"#"
>
Homework
</a>
<ul>
<li><a
href=
"#"
>
Week 1
</a></li>
<li>
<a
href=
"#"
>
Week 2
</a>
<ul>
<li><a
href=
"#"
>
Problem 1
</a></li>
<li><a
href=
"#"
>
Problem 2
</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div
class=
"options"
>
<input
type=
"checkbox"
name=
"follow"
id=
"new-post-follow"
checked
><label
for=
"new-post-follow"
>
follow this post
</label>
<br>
<input
type=
"checkbox"
name=
"follow"
id=
"new-post-anonymous"
checked
><label
for=
"new-post-anonymous"
>
post anonymously
</label>
</div>
</div>
<div
class=
"right-column"
>
<div
class=
"form-row"
>
<input
type=
"text"
class=
"new-post-title"
name=
"title"
placeholder=
"Title"
>
</div>
<div
class=
"form-row"
>
<textarea
class=
"new-post-body"
name=
"body"
placeholder=
"Enter your question or comment…"
></textarea>
<div
class=
"new-post-preview"
><span
class=
"new-post-preview-label"
>
Preview
</span></div>
</div>
<div
class=
"form-row"
>
<input
type=
"text"
class=
"new-post-tags"
name=
"tags"
placeholder=
"Tags"
>
</div>
<input
type=
"submit"
class=
"submit"
value=
"Add post"
>
<a
href=
"#"
class=
"new-post-cancel"
>
Cancel
</a>
</div>
</form>
</div>
</article>
<div
class=
"discussion container"
>
<div
class=
"discussion container"
>
<div
class=
"discussion-body"
>
<div
class=
"discussion-body"
>
<div
class=
"sidebar"
>
<div
class=
"sidebar"
>
...
...
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