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
07fb0f64
Commit
07fb0f64
authored
Sep 10, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add backbone checks.
parent
bcbc4da7
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
25 additions
and
19 deletions
+25
-19
lms/static/coffee/src/discussion/discussion_router.coffee
+2
-1
lms/static/coffee/src/discussion/main.coffee
+3
-2
lms/static/coffee/src/discussion/models/discussion_user.coffee
+2
-1
lms/static/coffee/src/discussion/user_profile.coffee
+2
-1
lms/static/coffee/src/discussion/views/discussion_content_view.coffee
+2
-1
lms/static/coffee/src/discussion/views/discussion_thread_inline_view.coffee
+2
-3
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
+2
-5
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
+2
-1
lms/static/coffee/src/discussion/views/new_post_inline_vew.coffee
+2
-1
lms/static/coffee/src/discussion/views/new_post_view.coffee
+2
-1
lms/static/coffee/src/discussion/views/response_comment_view.coffee
+2
-1
lms/static/coffee/src/discussion/views/thread_response_view.coffee
+2
-1
No files found.
lms/static/coffee/src/discussion/discussion_router.coffee
View file @
07fb0f64
class
@
DiscussionRouter
extends
Backbone
.
Router
if
Backbone
?
class
@
DiscussionRouter
extends
Backbone
.
Router
routes
:
routes
:
""
:
"allThreads"
""
:
"allThreads"
":forum_name/threads/:thread_id"
:
"showThread"
":forum_name/threads/:thread_id"
:
"showThread"
...
...
lms/static/coffee/src/discussion/main.coffee
View file @
07fb0f64
DiscussionApp
=
$
->
if
Backbone
?
DiscussionApp
=
start
:
(
elem
)
->
start
:
(
elem
)
->
# TODO: Perhaps eliminate usage of global variables when possible
# TODO: Perhaps eliminate usage of global variables when possible
element
=
$
(
elem
)
element
=
$
(
elem
)
...
@@ -12,6 +14,5 @@ DiscussionApp =
...
@@ -12,6 +14,5 @@ DiscussionApp =
new
DiscussionRouter
({
discussion
:
discussion
})
new
DiscussionRouter
({
discussion
:
discussion
})
Backbone
.
history
.
start
({
pushState
:
true
,
root
:
"/courses/
#{
$$course_id
}
/discussion/forum/"
})
Backbone
.
history
.
start
({
pushState
:
true
,
root
:
"/courses/
#{
$$course_id
}
/discussion/forum/"
})
$
->
$
(
"section.discussion"
).
each
(
index
,
elem
)
->
$
(
"section.discussion"
).
each
(
index
,
elem
)
->
DiscussionApp
.
start
(
elem
)
DiscussionApp
.
start
(
elem
)
lms/static/coffee/src/discussion/models/discussion_user.coffee
View file @
07fb0f64
class
@
DiscussionUser
extends
Backbone
.
Model
if
Backbone
?
class
@
DiscussionUser
extends
Backbone
.
Model
following
:
(
thread
)
->
following
:
(
thread
)
->
_
.
include
(
@
get
(
'subscribed_thread_ids'
),
thread
.
id
)
_
.
include
(
@
get
(
'subscribed_thread_ids'
),
thread
.
id
)
...
...
lms/static/coffee/src/discussion/user_profile.coffee
View file @
07fb0f64
class
@
DiscussionUserProfileView
extends
Backbone
.
View
if
Backbone
?
class
@
DiscussionUserProfileView
extends
Backbone
.
View
toggleModeratorStatus
:
(
event
)
->
toggleModeratorStatus
:
(
event
)
->
confirmValue
=
confirm
(
"Are you sure?"
)
confirmValue
=
confirm
(
"Are you sure?"
)
if
not
confirmValue
then
return
if
not
confirmValue
then
return
...
...
lms/static/coffee/src/discussion/views/discussion_content_view.coffee
View file @
07fb0f64
class
@
DiscussionContentView
extends
Backbone
.
View
if
Backbone
?
class
@
DiscussionContentView
extends
Backbone
.
View
attrRenderer
:
attrRenderer
:
endorsed
:
(
endorsed
)
->
endorsed
:
(
endorsed
)
->
...
...
lms/static/coffee/src/discussion/views/discussion_thread_inline_view.coffee
View file @
07fb0f64
class
@
DiscussionThreadInlineView
extends
DiscussionContentView
if
DiscussionContentView
?
class
@
DiscussionThreadInlineView
extends
DiscussionContentView
expanded
=
false
expanded
=
false
events
:
events
:
"click .discussion-vote"
:
"toggleVote"
"click .discussion-vote"
:
"toggleVote"
...
@@ -193,7 +194,6 @@ class @DiscussionThreadInlineView extends DiscussionContentView
...
@@ -193,7 +194,6 @@ class @DiscussionThreadInlineView extends DiscussionContentView
expandPost
:
(
event
)
->
expandPost
:
(
event
)
->
@
expanded
=
true
@
expanded
=
true
@
$el
.
addClass
(
'expanded'
)
@
$el
.
find
(
'.post-body'
).
html
(
@
model
.
get
(
'body'
))
@
$el
.
find
(
'.post-body'
).
html
(
@
model
.
get
(
'body'
))
@
convertMath
()
@
convertMath
()
@
$el
.
find
(
'.expand-post'
).
css
(
'display'
,
'none'
)
@
$el
.
find
(
'.expand-post'
).
css
(
'display'
,
'none'
)
...
@@ -205,7 +205,6 @@ class @DiscussionThreadInlineView extends DiscussionContentView
...
@@ -205,7 +205,6 @@ class @DiscussionThreadInlineView extends DiscussionContentView
collapsePost
:
(
event
)
->
collapsePost
:
(
event
)
->
@
expanded
=
false
@
expanded
=
false
@
$el
.
removeClass
(
'expanded'
)
@
$el
.
find
(
'.post-body'
).
html
(
@
model
.
get
(
'abbreviatedBody'
))
@
$el
.
find
(
'.post-body'
).
html
(
@
model
.
get
(
'abbreviatedBody'
))
@
convertMath
()
@
convertMath
()
@
$el
.
find
(
'.collapse-post'
).
css
(
'display'
,
'none'
)
@
$el
.
find
(
'.collapse-post'
).
css
(
'display'
,
'none'
)
...
...
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
View file @
07fb0f64
class
@
DiscussionThreadListView
extends
Backbone
.
View
if
Backbone
?
class
@
DiscussionThreadListView
extends
Backbone
.
View
template
:
_
.
template
(
$
(
"#thread-list-template"
).
html
())
template
:
_
.
template
(
$
(
"#thread-list-template"
).
html
())
events
:
events
:
"click .search"
:
"showSearch"
"click .search"
:
"showSearch"
...
@@ -263,7 +264,3 @@ class @DiscussionThreadListView extends Backbone.View
...
@@ -263,7 +264,3 @@ class @DiscussionThreadListView extends Backbone.View
scrollTarget
=
Math
.
min
(
scrollTop
-
itemFromTop
,
scrollTop
)
scrollTarget
=
Math
.
min
(
scrollTop
-
itemFromTop
,
scrollTop
)
scrollTarget
=
Math
.
max
(
scrollTop
-
itemFromTop
-
$
(
".browse-topic-drop-menu"
).
height
()
+
$
(
items
[
index
]).
height
(),
scrollTarget
)
scrollTarget
=
Math
.
max
(
scrollTop
-
itemFromTop
-
$
(
".browse-topic-drop-menu"
).
height
()
+
$
(
items
[
index
]).
height
(),
scrollTarget
)
$
(
".browse-topic-drop-menu"
).
scrollTop
(
scrollTarget
)
$
(
".browse-topic-drop-menu"
).
scrollTop
(
scrollTarget
)
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
07fb0f64
class
@
DiscussionThreadView
extends
DiscussionContentView
if
DiscussionContentView
?
class
@
DiscussionThreadView
extends
DiscussionContentView
events
:
events
:
"click .discussion-vote"
:
"toggleVote"
"click .discussion-vote"
:
"toggleVote"
...
...
lms/static/coffee/src/discussion/views/new_post_inline_vew.coffee
View file @
07fb0f64
class
@
NewPostInlineView
extends
Backbone
.
View
if
Backbone
?
class
@
NewPostInlineView
extends
Backbone
.
View
initialize
:
()
->
initialize
:
()
->
...
...
lms/static/coffee/src/discussion/views/new_post_view.coffee
View file @
07fb0f64
class
@
NewPostView
extends
Backbone
.
View
if
Backbone
?
class
@
NewPostView
extends
Backbone
.
View
initialize
:
()
->
initialize
:
()
->
@
dropdownButton
=
@
$
(
".topic_dropdown_button"
)
@
dropdownButton
=
@
$
(
".topic_dropdown_button"
)
...
...
lms/static/coffee/src/discussion/views/response_comment_view.coffee
View file @
07fb0f64
class
@
ResponseCommentView
extends
DiscussionContentView
if
DiscussionContentView
?
class
@
ResponseCommentView
extends
DiscussionContentView
tagName
:
"li"
tagName
:
"li"
template
:
_
.
template
(
$
(
"#response-comment-template"
).
html
())
template
:
_
.
template
(
$
(
"#response-comment-template"
).
html
())
initLocal
:
->
initLocal
:
->
...
...
lms/static/coffee/src/discussion/views/thread_response_view.coffee
View file @
07fb0f64
class
@
ThreadResponseView
extends
DiscussionContentView
if
DiscussionContentView
?
class
@
ThreadResponseView
extends
DiscussionContentView
tagName
:
"li"
tagName
:
"li"
template
:
_
.
template
(
$
(
"#thread-response-template"
).
html
())
template
:
_
.
template
(
$
(
"#thread-response-template"
).
html
())
...
...
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