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
4f326a8c
Commit
4f326a8c
authored
Feb 11, 2015
by
Waqas Khalid
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6832 from edx/waqas/tnl1149-discussion-mathjax-solution
Discussion forum should be independent of mathjax
parents
20c9a8af
11159ba7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
14 deletions
+16
-14
common/static/coffee/src/discussion/views/discussion_thread_profile_view.coffee
+2
-1
common/static/coffee/src/discussion/views/discussion_thread_show_view.coffee
+2
-1
common/static/coffee/src/discussion/views/response_comment_show_view.coffee
+2
-1
common/static/coffee/src/discussion/views/thread_response_show_view.coffee
+2
-1
common/templates/mathjax_include.html
+2
-0
lms/static/coffee/src/customwmd.coffee
+5
-9
lms/static/coffee/src/mathjax_delay_renderer.coffee
+1
-1
No files found.
common/static/coffee/src/discussion/views/discussion_thread_profile_view.coffee
View file @
4f326a8c
...
...
@@ -10,7 +10,8 @@ if Backbone?
@
$el
.
html
(
Mustache
.
render
(
@
template
,
params
))
@
$
(
"span.timeago"
).
timeago
()
element
=
@
$
(
".post-body"
)
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
[
0
]]
if
MathJax
?
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
[
0
]]
@
convertMath
:
->
...
...
common/static/coffee/src/discussion/views/discussion_thread_show_view.coffee
View file @
4f326a8c
...
...
@@ -32,7 +32,8 @@ if Backbone?
convertMath
:
->
element
=
@
$
(
".post-body"
)
element
.
html
DiscussionUtil
.
postMathJaxProcessor
DiscussionUtil
.
markdownWithHighlight
element
.
text
()
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
[
0
]]
if
MathJax
?
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
[
0
]]
edit
:
(
event
)
->
@
trigger
"thread:edit"
,
event
...
...
common/static/coffee/src/discussion/views/response_comment_show_view.coffee
View file @
4f326a8c
...
...
@@ -33,7 +33,8 @@ if Backbone?
convertMath
:
->
body
=
@
$el
.
find
(
".response-body"
)
body
.
html
DiscussionUtil
.
postMathJaxProcessor
DiscussionUtil
.
markdownWithHighlight
body
.
text
()
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
body
[
0
]]
if
MathJax
?
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
body
[
0
]]
_delete
:
(
event
)
=>
@
trigger
"comment:_delete"
,
event
...
...
common/static/coffee/src/discussion/views/thread_response_show_view.coffee
View file @
4f326a8c
...
...
@@ -27,7 +27,8 @@ if Backbone?
convertMath
:
->
element
=
@
$
(
".response-body"
)
element
.
html
DiscussionUtil
.
postMathJaxProcessor
DiscussionUtil
.
markdownWithHighlight
element
.
text
()
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
[
0
]]
if
MathJax
?
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
[
0
]]
edit
:
(
event
)
->
@
trigger
"response:edit"
,
event
...
...
common/templates/mathjax_include.html
View file @
4f326a8c
...
...
@@ -12,6 +12,7 @@
tex2jax
:
{
inlineMath
:
[
[
'$'
,
'$'
],
[
"
\\
("
,
"
\\
)"
]],
displayMath
:
[
[
'$$'
,
'$$'
],
[
"
\\
["
,
"
\\
]"
]]}
});
HUB
=
MathJax
.
Hub
</script>
%else:
<script
type=
"text/x-mathjax-config"
>
...
...
@@ -27,6 +28,7 @@
]
}
});
HUB
=
MathJax
.
Hub
</script>
%endif
...
...
lms/static/coffee/src/customwmd.coffee
View file @
4f326a8c
...
...
@@ -2,11 +2,6 @@
$
->
if
not
MathJax
?
return
HUB
=
MathJax
.
Hub
class
MathJaxProcessor
MATHSPLIT
=
///
(
...
...
@@ -116,10 +111,11 @@ $ ->
Markdown
.
getMathCompatibleConverter
=
(
postProcessor
)
->
postProcessor
||=
((
text
)
->
text
)
converter
=
Markdown
.
getSanitizingConverter
()
processor
=
new
MathJaxProcessor
()
converter
.
hooks
.
chain
"preConversion"
,
MathJaxProcessor
.
removeMathWrapper
(
processor
)
converter
.
hooks
.
chain
"postConversion"
,
(
text
)
->
postProcessor
(
MathJaxProcessor
.
replaceMathWrapper
(
processor
)(
text
))
if
MathJax
?
processor
=
new
MathJaxProcessor
()
converter
.
hooks
.
chain
"preConversion"
,
MathJaxProcessor
.
removeMathWrapper
(
processor
)
converter
.
hooks
.
chain
"postConversion"
,
(
text
)
->
postProcessor
(
MathJaxProcessor
.
replaceMathWrapper
(
processor
)(
text
))
converter
Markdown
.
makeWmdEditor
=
(
elem
,
appended_id
,
imageUploadUrl
,
postProcessor
)
->
...
...
lms/static/coffee/src/mathjax_delay_renderer.coffee
View file @
4f326a8c
...
...
@@ -57,7 +57,7 @@ class @MathJaxDelayRenderer
@
$buffer
.
html
(
text
)
curTime
=
getTime
()
@
elapsedTime
=
curTime
-
prevTime
if
MathJax
if
MathJax
?
prevTime
=
getTime
()
@
mathjaxRunning
=
true
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
@
$buffer
.
attr
(
"id"
)],
=>
...
...
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