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
2900c169
Commit
2900c169
authored
Sep 11, 2012
by
Carlos Andrés Rocha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load inline comments templates at render time and not during page load
parent
f4ba65c5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
11 deletions
+10
-11
lms/static/coffee/src/discussion/views/discussion_thread_edit_view.coffee
+1
-2
lms/static/coffee/src/discussion/views/discussion_thread_inline_view.coffee
+3
-3
lms/static/coffee/src/discussion/views/discussion_thread_show_view.coffee
+1
-2
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
+1
-2
lms/static/coffee/src/discussion/views/response_comment_view.coffee
+3
-1
lms/static/coffee/src/discussion/views/thread_response_view.coffee
+1
-1
No files found.
lms/static/coffee/src/discussion/views/discussion_thread_edit_view.coffee
View file @
2900c169
...
...
@@ -4,8 +4,6 @@ class @DiscussionThreadEditView extends Backbone.View
"click .post-update"
:
"update"
"click .post-cancel"
:
"cancel_edit"
template
:
_
.
template
(
$
(
"#thread-edit-template"
).
html
())
$
:
(
selector
)
->
@
$el
.
find
(
selector
)
...
...
@@ -13,6 +11,7 @@ class @DiscussionThreadEditView extends Backbone.View
super
()
render
:
->
@
template
=
_
.
template
(
$
(
"#thread-edit-template"
).
html
())
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
@
delegateEvents
()
DiscussionUtil
.
makeWmdEditor
@
$el
,
$
.
proxy
(
@
$
,
@
),
"edit-post-body"
...
...
lms/static/coffee/src/discussion/views/discussion_thread_inline_view.coffee
View file @
2900c169
...
...
@@ -11,8 +11,6 @@ if Backbone?
"click .expand-post"
:
"expandPost"
"click .collapse-post"
:
"collapsePost"
template
:
->
DiscussionUtil
.
getTemplate
(
"_inline_thread"
)
initLocal
:
->
@
$local
=
@
$el
.
children
(
".discussion-article"
).
children
(
".local"
)
@
$delegateElement
=
@
$local
...
...
@@ -22,12 +20,14 @@ if Backbone?
@
model
.
on
"change"
,
@
updateModelDetails
render
:
->
@
template
=
DiscussionUtil
.
getTemplate
(
"_inline_thread"
)
if
not
@
model
.
has
(
'abbreviatedBody'
)
@
abbreviateBody
()
params
=
$
.
extend
(
@
model
.
toJSON
(),{
expanded
:
@
expanded
})
if
not
@
model
.
get
(
'anonymous'
)
params
=
$
.
extend
(
params
,
user
:
{
username
:
@
model
.
username
,
user_url
:
@
model
.
user_url
})
@
$el
.
html
(
Mustache
.
render
(
@
template
()
,
params
))
@
$el
.
html
(
Mustache
.
render
(
@
template
,
params
))
@
initLocal
()
@
delegateEvents
()
@
renderDogear
()
...
...
lms/static/coffee/src/discussion/views/discussion_thread_show_view.coffee
View file @
2900c169
...
...
@@ -7,8 +7,6 @@ class @DiscussionThreadShowView extends DiscussionContentView
"click .action-delete"
:
"delete"
"click .action-openclose"
:
"toggleClosed"
template
:
_
.
template
(
$
(
"#thread-show-template"
).
html
())
$
:
(
selector
)
->
@
$el
.
find
(
selector
)
...
...
@@ -17,6 +15,7 @@ class @DiscussionThreadShowView extends DiscussionContentView
@
model
.
on
"change"
,
@
updateModelDetails
render
:
->
@
template
=
_
.
template
(
$
(
"#thread-show-template"
).
html
())
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
@
delegateEvents
()
@
renderDogear
()
...
...
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
2900c169
...
...
@@ -4,8 +4,6 @@ if Backbone?
events
:
"click .discussion-submit-post"
:
"submitComment"
template
:
_
.
template
(
$
(
"#thread-template"
).
html
())
$
:
(
selector
)
->
@
$el
.
find
(
selector
)
...
...
@@ -14,6 +12,7 @@ if Backbone?
@
createShowView
()
render
:
->
@
template
=
_
.
template
(
$
(
"#thread-template"
).
html
())
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
@
delegateEvents
()
...
...
lms/static/coffee/src/discussion/views/response_comment_view.coffee
View file @
2900c169
if
Backbone
?
class
@
ResponseCommentView
extends
DiscussionContentView
tagName
:
"li"
template
:
_
.
template
(
$
(
"#response-comment-template"
).
html
())
initLocal
:
->
# TODO .response-local is the parent of the comments so @$local is null, not sure what was intended here...
@
$local
=
@
$el
.
find
(
".response-local"
)
@
$delegateElement
=
@
$local
render
:
->
@
template
=
_
.
template
(
$
(
"#response-comment-template"
).
html
())
params
=
@
model
.
toJSON
()
params
[
'deep'
]
=
@
options
.
deep
if
@
options
.
deep
...
...
@@ -20,6 +21,7 @@ if Backbone?
@
$el
.
find
(
".timeago"
).
timeago
()
@
convertMath
()
@
convertMath
:
->
body
=
@
$el
.
find
(
".response-body"
)
body
.
html
DiscussionUtil
.
postMathJaxProcessor
DiscussionUtil
.
markdownWithHighlight
body
.
html
()
...
...
lms/static/coffee/src/discussion/views/thread_response_view.coffee
View file @
2900c169
...
...
@@ -4,7 +4,6 @@ if Backbone?
console
.
log
(
'test 2'
)
class
@
ThreadResponseView
extends
DiscussionContentView
tagName
:
"li"
template
:
_
.
template
(
$
(
"#thread-response-template"
).
html
())
events
:
"click .vote-btn"
:
"toggleVote"
...
...
@@ -13,6 +12,7 @@ if Backbone?
"click .action-delete"
:
"delete"
render
:
->
@
template
=
_
.
template
(
$
(
"#thread-response-template"
).
html
())
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
@
initLocal
()
@
delegateEvents
()
...
...
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