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
d2051793
Commit
d2051793
authored
Sep 04, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clear response pane after posting
parent
a242a7f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
6 deletions
+20
-6
lms/static/coffee/src/discussion/views/discussion_content_view.coffee
+12
-0
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
+5
-3
lms/static/sass/_discussion.scss
+3
-3
No files found.
lms/static/coffee/src/discussion/views/discussion_content_view.coffee
View file @
d2051793
...
...
@@ -71,6 +71,18 @@ class @DiscussionContentView extends Backbone.View
@
$local
=
@
$el
@
$delegateElement
=
@
$local
makeWmdEditor
:
(
cls_identifier
)
=>
DiscussionUtil
.
makeWmdEditor
@
$el
,
$
.
proxy
(
@
$
,
@
),
cls_identifier
getWmdEditor
:
(
cls_identifier
)
=>
DiscussionUtil
.
getWmdEditor
@
$el
,
$
.
proxy
(
@
$
,
@
),
cls_identifier
getWmdContent
:
(
cls_identifier
)
=>
DiscussionUtil
.
getWmdContent
@
$el
,
$
.
proxy
(
@
$
,
@
),
cls_identifier
setWmdContent
:
(
cls_identifier
,
text
)
=>
DiscussionUtil
.
setWmdContent
@
$el
,
$
.
proxy
(
@
$
,
@
),
cls_identifier
,
text
initialize
:
->
@
initLocal
()
@
model
.
bind
(
'change'
,
@
renderPartialAttrs
,
@
)
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
d2051793
...
...
@@ -26,7 +26,7 @@ class @DiscussionThreadView extends DiscussionContentView
@
renderVoted
()
@
renderAttrs
()
@
$
(
"span.timeago"
).
timeago
()
Markdown
.
makeWmdEditor
@
$
(
".reply-body"
),
""
,
DiscussionUtil
.
urlFor
(
"upload"
),
(
text
)
->
DiscussionUtil
.
postMathJaxProcessor
(
text
)
@
makeWmdEditor
"reply-body"
@
convertMath
()
@
renderResponses
()
@
highlight
@
$
(
".post-body"
)
...
...
@@ -50,7 +50,7 @@ class @DiscussionThreadView extends DiscussionContentView
convertMath
:
->
element
=
@
$
(
".post-body"
)
element
.
html
DiscussionUtil
.
postMathJaxProcessor
(
element
.
html
())
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
.
attr
(
"id"
)
]
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
[
0
]
]
renderResponses
:
->
DiscussionUtil
.
safeAjax
...
...
@@ -119,7 +119,9 @@ class @DiscussionThreadView extends DiscussionContentView
submitComment
:
(
event
)
->
event
.
preventDefault
()
url
=
@
model
.
urlFor
(
'reply'
)
body
=
@
$
(
"#wmd-input"
).
val
()
body
=
@
getWmdContent
(
"reply-body"
)
return
if
not
body
.
trim
().
length
@
setWmdContent
(
"reply-body"
,
""
)
response
=
new
Comment
(
body
:
body
,
created_at
:
(
new
Date
()).
toISOString
(),
username
:
window
.
user
.
get
(
"username"
),
votes
:
{
up_count
:
0
},
endorsed
:
false
,
user_id
:
window
.
user
.
get
(
"id"
))
response
.
set
(
'thread'
,
@
model
.
get
(
'thread'
))
@
renderResponse
(
response
)
...
...
lms/static/sass/_discussion.scss
View file @
d2051793
...
...
@@ -1426,15 +1426,15 @@ body.discussion {
}
}
#
wmd-button-bar
{
.
wmd-button-bar
{
border
:
none
;
}
#
wmd-input
{
.
wmd-input
{
@include
discussion-wmd-input
;
}
#
wmd-preview
{
.
wmd-preview
{
@include
discussion-wmd-preview
;
}
...
...
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