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
4930df48
Commit
4930df48
authored
Aug 06, 2012
by
Mike Chen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:dementrock/mitx into ccp0101/moderation
parents
50616629
1ba76e1d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
66 additions
and
31 deletions
+66
-31
lms/static/coffee/src/customwmd.coffee
+0
-2
lms/static/coffee/src/discussion/content.coffee
+24
-3
lms/static/coffee/src/discussion/discussion.coffee
+2
-2
lms/static/sass/_discussion.scss
+0
-0
lms/templates/discussion/_forum.html
+2
-2
lms/templates/discussion/_inline.html
+1
-1
lms/templates/discussion/_sort.html
+1
-1
lms/templates/discussion/_thread.html
+23
-11
lms/templates/discussion/thread.html
+13
-9
No files found.
lms/static/coffee/src/customwmd.coffee
View file @
4930df48
...
@@ -105,7 +105,6 @@ $ ->
...
@@ -105,7 +105,6 @@ $ ->
replaceMath
:
(
text
)
->
replaceMath
:
(
text
)
->
text
=
text
.
replace
/@@(\d+)@@/g
,
(
$0
,
$1
)
=>
@
math
[
$1
]
text
=
text
.
replace
/@@(\d+)@@/g
,
(
$0
,
$1
)
=>
@
math
[
$1
]
@
math
=
null
@
math
=
null
console
.
log
text
text
text
@
replaceMathWrapper
:
(
_this
)
->
@
replaceMathWrapper
:
(
_this
)
->
...
@@ -163,7 +162,6 @@ $ ->
...
@@ -163,7 +162,6 @@ $ ->
$
(
'#file-upload'
).
unbind
(
'change'
).
change
(
startUploadHandler
)
$
(
'#file-upload'
).
unbind
(
'change'
).
change
(
startUploadHandler
)
imageUploadHandler
=
(
elem
,
input
)
->
imageUploadHandler
=
(
elem
,
input
)
->
console
.
log
"here"
ajaxFileUpload
(
imageUploadUrl
,
input
,
imageUploadHandler
)
ajaxFileUpload
(
imageUploadUrl
,
input
,
imageUploadHandler
)
editor
=
new
Markdown
.
Editor
(
editor
=
new
Markdown
.
Editor
(
...
...
lms/static/coffee/src/discussion/content.coffee
View file @
4930df48
...
@@ -330,15 +330,36 @@ initializeFollowThread = (thread) ->
...
@@ -330,15 +330,36 @@ initializeFollowThread = (thread) ->
handleDelete
(
this
)
handleDelete
(
this
)
initializeContent
:
(
content
)
->
initializeContent
:
(
content
)
->
unescapeHighlightTag
=
(
text
)
->
text
.
replace
(
/\<\;highlight\>\;/g
,
"<span class='search-highlight'>"
)
.
replace
(
/\<\;\/highlight\>\;/g
,
"</span>"
)
stripLatexHighlight
=
(
text
)
->
text
markdownWithHighlight
=
(
text
)
->
converter
=
Markdown
.
getMathCompatibleConverter
()
unescapeHighlightTag
stripLatexHighlight
converter
.
makeHtml
text
$content
=
$
(
content
)
$content
=
$
(
content
)
initializeVote
$content
initializeVote
$content
if
$content
.
hasClass
(
"thread"
)
if
$content
.
hasClass
(
"thread"
)
initializeFollowThread
$content
initializeFollowThread
$content
$local
=
Discussion
.
generateLocal
(
$content
.
children
(
".discussion-content"
))
$local
=
Discussion
.
generateLocal
(
$content
.
children
(
".discussion-content"
))
$contentTitle
=
$local
(
".thread-title"
)
if
$contentTitle
.
length
$contentTitle
.
html
unescapeHighlightTag
stripLatexHighlight
$contentTitle
.
html
()
$contentBody
=
$local
(
".content-body"
)
$contentBody
=
$local
(
".content-body"
)
raw_text
=
$contentBody
.
html
()
converter
=
Markdown
.
getMathCompatibleConverter
()
console
.
log
"raw html:"
$contentBody
.
html
(
converter
.
makeHtml
(
raw_text
))
console
.
log
$contentBody
.
html
()
$contentBody
.
html
markdownWithHighlight
$contentBody
.
html
()
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"
)
if
not
Discussion
.
getContentInfo
id
,
'editable'
if
not
Discussion
.
getContentInfo
id
,
'editable'
...
...
lms/static/coffee/src/discussion/discussion.coffee
View file @
4930df48
...
@@ -27,7 +27,7 @@ initializeFollowDiscussion = (discussion) ->
...
@@ -27,7 +27,7 @@ initializeFollowDiscussion = (discussion) ->
bindDiscussionEvents
:
(
discussion
)
->
bindDiscussionEvents
:
(
discussion
)
->
$discussion
=
$
(
discussion
)
$discussion
=
$
(
discussion
)
$discussionNonContent
=
$discussion
.
children
(
".discussion-
non-content
"
)
$discussionNonContent
=
$discussion
.
children
(
".discussion-
local
"
)
$local
=
Discussion
.
generateLocal
(
$discussionNonContent
)
$local
=
Discussion
.
generateLocal
(
$discussionNonContent
)
id
=
$discussion
.
attr
(
"_id"
)
id
=
$discussion
.
attr
(
"_id"
)
...
@@ -127,5 +127,5 @@ initializeFollowDiscussion = (discussion) ->
...
@@ -127,5 +127,5 @@ initializeFollowDiscussion = (discussion) ->
"click .discussion-sort-link"
:
->
"click .discussion-sort-link"
:
->
handleAjaxSort
(
this
)
handleAjaxSort
(
this
)
$discussion
.
children
(
".discussion-paginator"
).
find
(
".discussion-
inline-
page-link"
).
click
->
$discussion
.
children
(
".discussion-paginator"
).
find
(
".discussion-page-link"
).
click
->
handleAjaxPage
(
this
)
handleAjaxPage
(
this
)
lms/static/sass/_discussion.scss
View file @
4930df48
This diff is collapsed.
Click to expand it.
lms/templates/discussion/_forum.html
View file @
4930df48
<
%
namespace
name=
"renderer"
file=
"_thread.html"
/>
<
%
namespace
name=
"renderer"
file=
"_thread.html"
/>
<section
class=
"discussion inline-discussion"
_id=
"${discussion_id}"
>
<section
class=
"discussion inline-discussion"
_id=
"${discussion_id}"
>
<div
class=
"discussion-non-content"
>
<div
class=
"discussion-non-content
discussion-local
"
>
<div
class=
"discussion-title-wrapper"
>
<div
class=
"discussion-title-wrapper"
>
<a
class=
"discussion-title"
href=
"javascript:void(0)"
>
Discussion
</a>
<a
class=
"discussion-title"
href=
"javascript:void(0)"
>
Discussion
</a>
</div>
</div>
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
<label
for=
"discussion-search-within-board-${discussion_id}"
class=
"discussion-search-within-board"
>
Search within board
</label>
<label
for=
"discussion-search-within-board-${discussion_id}"
class=
"discussion-search-within-board"
>
Search within board
</label>
</div>
</div>
<div
class=
"discussion-new-post control-button"
href=
"javascript:void(0)"
>
New Post
</div>
<div
class=
"discussion-new-post control-button"
href=
"javascript:void(0)"
>
New Post
</div>
<
%
include
file=
"_sort.html"
/>
</div>
</div>
<
%
include
file=
"_sort.html"
/>
<div
class=
"threads"
>
<div
class=
"threads"
>
% for thread in threads:
% for thread in threads:
${renderer.render_thread(course_id, thread, show_comments=False)}
${renderer.render_thread(course_id, thread, show_comments=False)}
...
...
lms/templates/discussion/_inline.html
View file @
4930df48
<
%
namespace
name=
"renderer"
file=
"_thread.html"
/>
<
%
namespace
name=
"renderer"
file=
"_thread.html"
/>
<section
class=
"discussion inline-discussion"
_id=
"${discussion_id}"
>
<section
class=
"discussion inline-discussion"
_id=
"${discussion_id}"
>
<div
class=
"discussion-non-content"
>
<div
class=
"discussion-non-content
discussion-local
"
>
<div
class=
"search-wrapper-inline search-wrapper"
>
<div
class=
"search-wrapper-inline search-wrapper"
>
<
%
include
file=
"_search_bar.html"
/>
<
%
include
file=
"_search_bar.html"
/>
</div>
</div>
...
...
lms/templates/discussion/_sort.html
View file @
4930df48
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<a
class=
"discussion-sort-link ${cls}"
href=
"javascript:void(0)"
sort-url=
"${url_for_sort(key, order)}"
>
${title}
</a>
<a
class=
"discussion-sort-link ${cls}"
href=
"javascript:void(0)"
sort-url=
"${url_for_sort(key, order)}"
>
${title}
</a>
</
%
def>
</
%
def>
<div
class=
"discussion-sort"
>
<div
class=
"discussion-sort
discussion-local
"
>
Sort by:
Sort by:
${link_to_sort('date', 'date')}
${link_to_sort('date', 'date')}
|
|
...
...
lms/templates/discussion/_thread.html
View file @
4930df48
...
@@ -42,7 +42,11 @@
...
@@ -42,7 +42,11 @@
<div
class=
"discussion-right-wrapper clearfix"
>
<div
class=
"discussion-right-wrapper clearfix"
>
${render_title(content, type, **kwargs)}
${render_title(content, type, **kwargs)}
<div
class=
"discussion-content-view"
>
<div
class=
"discussion-content-view"
>
<div
class=
"content-body ${type}-body"
id=
"content-body-${content['id']}"
>
${content['body'] | h}
</div>
% if content.get('highlighted_body', None):
<div
class=
"content-body ${type}-body"
id=
"content-body-${content['id']}"
>
${content['highlighted_body'] | h}
</div>
% else:
<div
class=
"content-body ${type}-body"
id=
"content-body-${content['id']}"
>
${content['body'] | h}
</div>
% endif
<div
class=
"content-raw-body ${type}-raw-body"
style=
"display: none"
>
${content['body'] | h}
</div>
<div
class=
"content-raw-body ${type}-raw-body"
style=
"display: none"
>
${content['body'] | h}
</div>
${render_tags(content, type, **kwargs)}
${render_tags(content, type, **kwargs)}
${render_bottom_bar(content, type, **kwargs)}
${render_bottom_bar(content, type, **kwargs)}
...
@@ -54,7 +58,11 @@
...
@@ -54,7 +58,11 @@
<
%
def
name=
"render_title(content, type, **kwargs)"
>
<
%
def
name=
"render_title(content, type, **kwargs)"
>
% if type == "thread":
% if type == "thread":
<a
class=
"thread-title"
name=
"${content['id']}"
href=
"javascript:void(0)"
>
${content['title'] | h}
</a>
% if content.get('highlighted_title', None):
<a
class=
"thread-title"
name=
"${content['id']}"
href=
"javascript:void(0)"
>
${content['highlighted_title'] | h}
</a>
% else:
<a
class=
"thread-title"
name=
"${content['id']}"
href=
"javascript:void(0)"
>
${content['title'] | h}
</a>
% endif
% endif
% endif
</
%
def>
</
%
def>
...
@@ -102,15 +110,19 @@
...
@@ -102,15 +110,19 @@
</
%
def>
</
%
def>
<
%
def
name=
"render_info(content)"
>
<
%
def
name=
"render_info(content)"
>
${time_ago_in_words(parse(content['updated_at']))} ago by
<div
class=
"comment-time"
>
% if content['anonymous']:
${time_ago_in_words(parse(content['updated_at']))} ago by
anonymous
% if content['anonymous']:
% else:
anonymous
user No.${content['user_id']}
% else:
% endif
user No.${content['user_id']}
% if content.get('comments_count', -1) >= 0:
% endif
,
<a
href=
"javascript:void(0)"
class=
"discussion-show-comments"
>
Show ${content['comments_count']} comment(s)
</a>
</div>
% endif
<div
class=
"comment-count"
>
% if content.get('comments_count', -1) >= 0:
<a
href=
"javascript:void(0)"
class=
"discussion-show-comments"
>
Show ${content['comments_count']} comment(s)
</a>
% endif
</div>
</
%
def>
</
%
def>
<
%
def
name=
"render_link(cls, html)"
>
<
%
def
name=
"render_link(cls, html)"
>
...
...
lms/templates/discussion/thread.html
View file @
4930df48
...
@@ -79,15 +79,19 @@
...
@@ -79,15 +79,19 @@
</
%
def>
</
%
def>
<
%
def
name=
"render_info(content)"
>
<
%
def
name=
"render_info(content)"
>
${time_ago_in_words(parse(content['updated_at']))} ago by
<div
class=
"comment-time"
>
% if content['anonymous']:
${time_ago_in_words(parse(content['updated_at']))} ago by
anonymous
% if content['anonymous']:
% else:
anonymous
user No.${content['user_id']}
% else:
% endif
user No.${content['user_id']}
% if content.get('comments_count', -1) >= 0:
% endif
, ${content['comments_count']} comment(s)
</div>
% endif
<div
class=
"comment-count"
>
% if content.get('comments_count', -1) >= 0:
${content['comments_count']} comment(s)
% endif
</div>
</
%
def>
</
%
def>
<
%
def
name=
"render_link(cls, html)"
>
<
%
def
name=
"render_link(cls, 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