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
b122464a
Commit
b122464a
authored
Aug 09, 2012
by
Mike Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate permanent link for thread/comment on client side
parent
117855ea
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletions
+13
-1
lms/static/coffee/src/discussion/content.coffee
+9
-0
lms/static/coffee/src/discussion/utils.coffee
+3
-1
lms/templates/discussion/_thread.html
+1
-0
No files found.
lms/static/coffee/src/discussion/content.coffee
View file @
b122464a
...
@@ -367,6 +367,15 @@ initializeFollowThread = (thread) ->
...
@@ -367,6 +367,15 @@ initializeFollowThread = (thread) ->
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
$contentBody
.
attr
(
"id"
)]
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
$contentBody
.
attr
(
"id"
)]
id
=
$content
.
attr
(
"_id"
)
id
=
$content
.
attr
(
"_id"
)
discussion_id
=
$content
.
parents
(
".discussion"
).
attr
(
"_id"
)
if
$content
.
hasClass
(
"thread"
)
permalink
=
Discussion
.
urlFor
(
"permanent_link_thread"
,
discussion_id
,
id
)
else
thread_id
=
$content
.
parents
(
".thread"
).
attr
(
"_id"
)
permalink
=
Discussion
.
urlFor
(
"permanent_link_comment"
,
discussion_id
,
thread_id
,
id
)
$local
(
".discussion-permanent-link"
).
attr
"href"
,
permalink
if
not
Discussion
.
getContentInfo
id
,
'editable'
if
not
Discussion
.
getContentInfo
id
,
'editable'
$local
(
".discussion-edit"
).
remove
()
$local
(
".discussion-edit"
).
remove
()
if
not
Discussion
.
getContentInfo
id
,
'can_reply'
if
not
Discussion
.
getContentInfo
id
,
'can_reply'
...
...
lms/static/coffee/src/discussion/utils.coffee
View file @
b122464a
...
@@ -16,7 +16,7 @@ wmdEditors = {}
...
@@ -16,7 +16,7 @@ wmdEditors = {}
.
addClass
(
cls
).
html
(
txt
)
.
addClass
(
cls
).
html
(
txt
)
.
click
->
handler
(
this
)
.
click
->
handler
(
this
)
urlFor
:
(
name
,
param
,
param1
)
->
urlFor
:
(
name
,
param
,
param1
,
param2
)
->
{
{
follow_discussion
:
"/courses/
#{
$$course_id
}
/discussion/
#{
param
}
/follow"
follow_discussion
:
"/courses/
#{
$$course_id
}
/discussion/
#{
param
}
/follow"
unfollow_discussion
:
"/courses/
#{
$$course_id
}
/discussion/
#{
param
}
/unfollow"
unfollow_discussion
:
"/courses/
#{
$$course_id
}
/discussion/
#{
param
}
/unfollow"
...
@@ -43,6 +43,8 @@ wmdEditors = {}
...
@@ -43,6 +43,8 @@ wmdEditors = {}
tags_autocomplete
:
"/courses/
#{
$$course_id
}
/discussion/threads/tags/autocomplete"
tags_autocomplete
:
"/courses/
#{
$$course_id
}
/discussion/threads/tags/autocomplete"
retrieve_discussion
:
"/courses/
#{
$$course_id
}
/discussion/forum/
#{
param
}
/inline"
retrieve_discussion
:
"/courses/
#{
$$course_id
}
/discussion/forum/
#{
param
}
/inline"
retrieve_single_thread
:
"/courses/
#{
$$course_id
}
/discussion/forum/
#{
param
}
/threads/
#{
param1
}
"
retrieve_single_thread
:
"/courses/
#{
$$course_id
}
/discussion/forum/
#{
param
}
/threads/
#{
param1
}
"
permanent_link_thread
:
"/courses/
#{
$$course_id
}
/discussion/forum/
#{
param
}
/threads/
#{
param1
}
"
permanent_link_comment
:
"/courses/
#{
$$course_id
}
/discussion/forum/
#{
param
}
/threads/
#{
param1
}
#
#{
param2
}
"
}[
name
]
}[
name
]
safeAjax
:
(
params
)
->
safeAjax
:
(
params
)
->
...
...
lms/templates/discussion/_thread.html
View file @
b122464a
...
@@ -88,6 +88,7 @@
...
@@ -88,6 +88,7 @@
${render_info(content)}
${render_info(content)}
${render_link("discussion-link discussion-reply discussion-reply-" + type, "Reply")}
${render_link("discussion-link discussion-reply discussion-reply-" + type, "Reply")}
${render_link("discussion-link discussion-edit", "Edit")}
${render_link("discussion-link discussion-edit", "Edit")}
${render_link("discussion-link discussion-permanent-link", "Permanent Link")}
<span
class=
"discussion-endorse-control"
>
<span
class=
"discussion-endorse-control"
>
% if content.get('endorsed', False):
% if content.get('endorsed', False):
...
...
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