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
4dae36cd
Commit
4dae36cd
authored
Aug 22, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only execude code when backbone is defined
parent
45431ae7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
lms/static/coffee/src/discussion/content.coffee
+8
-7
lms/static/coffee/src/discussion/discussion.coffee
+3
-2
lms/static/coffee/src/discussion/discussion_module.coffee
+2
-1
lms/static/coffee/src/discussion/main.coffee
+1
-0
No files found.
lms/static/coffee/src/discussion/content.coffee
View file @
4dae36cd
class
@
Content
extends
Backbone
.
Model
if
Backbone
?
class
@
Content
extends
Backbone
.
Model
template
:
->
DiscussionUtil
.
getTemplate
(
'_content'
)
template
:
->
DiscussionUtil
.
getTemplate
(
'_content'
)
...
@@ -49,7 +50,7 @@ class @Content extends Backbone.Model
...
@@ -49,7 +50,7 @@ class @Content extends Backbone.Model
@
resetComments
(
@
get
(
'children'
))
@
resetComments
(
@
get
(
'children'
))
class
@
ContentView
extends
Backbone
.
View
class
@
ContentView
extends
Backbone
.
View
$
:
(
selector
)
->
$
:
(
selector
)
->
@
$local
.
find
(
selector
)
@
$local
.
find
(
selector
)
...
@@ -352,7 +353,7 @@ class @ContentView extends Backbone.View
...
@@ -352,7 +353,7 @@ class @ContentView extends Backbone.View
@
initBody
()
@
initBody
()
@
initCommentViews
()
@
initCommentViews
()
class
@
Thread
extends
@
Content
class
@
Thread
extends
@
Content
urlMappers
:
urlMappers
:
'retrieve'
:
->
DiscussionUtil
.
urlFor
(
'retrieve_single_thread'
,
@
discussion
.
id
,
@
id
)
'retrieve'
:
->
DiscussionUtil
.
urlFor
(
'retrieve_single_thread'
,
@
discussion
.
id
,
@
id
)
'reply'
:
->
DiscussionUtil
.
urlFor
(
'create_comment'
,
@
id
)
'reply'
:
->
DiscussionUtil
.
urlFor
(
'create_comment'
,
@
id
)
...
@@ -373,9 +374,9 @@ class @Thread extends @Content
...
@@ -373,9 +374,9 @@ class @Thread extends @Content
discussion_id
=
@
get
(
'commentable_id'
)
discussion_id
=
@
get
(
'commentable_id'
)
return
Discussion
.
urlFor
(
"permanent_link_thread"
,
discussion_id
,
@
id
)
return
Discussion
.
urlFor
(
"permanent_link_thread"
,
discussion_id
,
@
id
)
class
@
ThreadView
extends
@
ContentView
class
@
ThreadView
extends
@
ContentView
class
@
Comment
extends
@
Content
class
@
Comment
extends
@
Content
urlMappers
:
urlMappers
:
'reply'
:
->
DiscussionUtil
.
urlFor
(
'create_sub_comment'
,
@
id
)
'reply'
:
->
DiscussionUtil
.
urlFor
(
'create_sub_comment'
,
@
id
)
'unvote'
:
->
DiscussionUtil
.
urlFor
(
"undo_vote_for_
#{
@
get
(
'type'
)
}
"
,
@
id
)
'unvote'
:
->
DiscussionUtil
.
urlFor
(
"undo_vote_for_
#{
@
get
(
'type'
)
}
"
,
@
id
)
...
@@ -396,9 +397,9 @@ class @Comment extends @Content
...
@@ -396,9 +397,9 @@ class @Comment extends @Content
count
+=
comment
.
getCommentsCount
()
+
1
count
+=
comment
.
getCommentsCount
()
+
1
count
count
class
@
CommentView
extends
@
ContentView
class
@
CommentView
extends
@
ContentView
class
@
Comments
extends
Backbone
.
Collection
class
@
Comments
extends
Backbone
.
Collection
model
:
Comment
model
:
Comment
...
...
lms/static/coffee/src/discussion/discussion.coffee
View file @
4dae36cd
class
@
Discussion
extends
Backbone
.
Collection
if
Backbone
?
class
@
Discussion
extends
Backbone
.
Collection
model
:
Thread
model
:
Thread
initialize
:
->
initialize
:
->
...
@@ -15,7 +16,7 @@ class @Discussion extends Backbone.Collection
...
@@ -15,7 +16,7 @@ class @Discussion extends Backbone.Collection
@
add
model
@
add
model
model
model
class
@
DiscussionView
extends
Backbone
.
View
class
@
DiscussionView
extends
Backbone
.
View
$
:
(
selector
)
->
$
:
(
selector
)
->
@
$local
.
find
(
selector
)
@
$local
.
find
(
selector
)
...
...
lms/static/coffee/src/discussion/discussion_module.coffee
View file @
4dae36cd
class
@
DiscussionModuleView
extends
Backbone
.
View
if
Backbone
?
class
@
DiscussionModuleView
extends
Backbone
.
View
events
:
events
:
"click .discussion-show"
:
"toggleDiscussion"
"click .discussion-show"
:
"toggleDiscussion"
toggleDiscussion
:
(
event
)
->
toggleDiscussion
:
(
event
)
->
...
...
lms/static/coffee/src/discussion/main.coffee
View file @
4dae36cd
...
@@ -12,4 +12,5 @@ $ ->
...
@@ -12,4 +12,5 @@ $ ->
discussion
.
reset
(
discussionData
,
{
silent
:
false
})
discussion
.
reset
(
discussionData
,
{
silent
:
false
})
view
=
new
DiscussionView
(
el
:
elem
,
model
:
discussion
)
view
=
new
DiscussionView
(
el
:
elem
,
model
:
discussion
)
if
window
.
$
$annotated_content_info
?
DiscussionUtil
.
bulkUpdateContentInfo
(
window
.
$
$annotated_content_info
)
DiscussionUtil
.
bulkUpdateContentInfo
(
window
.
$
$annotated_content_info
)
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