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
6791e818
Commit
6791e818
authored
Jul 26, 2012
by
Brittany Cheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:dementrock/mitx into discussion
parents
5c480753
8eda490d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
67 deletions
+94
-67
lms/static/coffee/src/customwmd.coffee
+20
-4
lms/static/sass/_discussion.scss
+55
-63
lms/templates/discussion/index.html
+19
-0
No files found.
lms/static/coffee/src/customwmd.coffee
View file @
6791e818
$
->
$
->
converter
=
Markdown
.
getSanitizingConverter
()
editor
=
new
Markdown
.
Editor
(
converter
)
if
Markdown
?
#converter.hooks.chain "preConversion", removeMath
mathRenderer
=
new
MathJaxDelayRenderer
()
editor
.
run
()
removeMath
=
(
text
)
->
text
replaceMath
=
(
text
)
->
text
updateMathJax
=
->
console
.
log
"updating"
#mathRenderer.render
# element: $("#wmd-preview")
MathJax
.
Hub
.
Queue
([
"Typeset"
,
MathJax
.
Hub
,
"wmd-preview"
])
converter
=
Markdown
.
getSanitizingConverter
()
editor
=
new
Markdown
.
Editor
(
converter
)
converter
.
hooks
.
chain
"preConversion"
,
removeMath
converter
.
hooks
.
chain
"postConversion"
,
replaceMath
editor
.
hooks
.
chain
"onPreviewRefresh"
,
updateMathJax
editor
.
run
()
lms/static/sass/_discussion.scss
View file @
6791e818
...
@@ -188,123 +188,115 @@ $discussion_input_width: 60%;
...
@@ -188,123 +188,115 @@ $discussion_input_width: 60%;
}
}
body
{
background-color
:
White
;
font-family
:
sans-serif
;
}
.wmd-panel
.wmd-panel
{
{
margin-left
:
25%
;
margin-left
:
25%
;
margin-right
:
25%
;
margin-right
:
25%
;
width
:
50%
;
width
:
50%
;
min-width
:
500px
;
min-width
:
500px
;
}
}
.wmd-button-bar
.wmd-button-bar
{
{
width
:
100%
;
width
:
100%
;
background-color
:
Silver
;
background-color
:
Silver
;
}
}
.wmd-input
.wmd-input
{
{
height
:
300px
;
height
:
300px
;
width
:
100%
;
width
:
100%
;
background-color
:
Gainsboro
;
background-color
:
Gainsboro
;
border
:
1px
solid
DarkGray
;
border
:
1px
solid
DarkGray
;
font-style
:
normal
;
}
}
.wmd-preview
.wmd-preview
{
{
background-color
:
#c0e0ff
;
background-color
:
#c0e0ff
;
}
}
.wmd-button-row
.wmd-button-row
{
{
position
:
relative
;
position
:
relative
;
margin-left
:
5px
;
margin-left
:
5px
;
margin-right
:
5px
;
margin-right
:
5px
;
margin-bottom
:
5px
;
margin-bottom
:
5px
;
margin-top
:
10px
;
margin-top
:
10px
;
padding
:
0px
;
padding
:
0px
;
height
:
20px
;
height
:
20px
;
}
}
.wmd-spacer
.wmd-spacer
{
{
width
:
1px
;
width
:
1px
;
height
:
20px
;
height
:
20px
;
margin-left
:
14px
;
margin-left
:
14px
;
position
:
absolute
;
position
:
absolute
;
background-color
:
Silver
;
background-color
:
Silver
;
display
:
inline-block
;
display
:
inline-block
;
list-style
:
none
;
list-style
:
none
;
}
}
.wmd-button
{
.wmd-button
{
width
:
20px
;
width
:
20px
;
height
:
20px
;
height
:
20px
;
padding-left
:
2px
;
padding-left
:
2px
;
padding-right
:
3px
;
padding-right
:
3px
;
position
:
absolute
;
position
:
absolute
;
display
:
inline-block
;
display
:
inline-block
;
list-style
:
none
;
list-style
:
none
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.wmd-button
>
span
{
.wmd-button
>
span
{
background-image
:
url('/static/images/wmd-buttons.png')
;
background-image
:
url('/static/images/wmd-buttons.png')
;
background-repeat
:
no-repeat
;
background-repeat
:
no-repeat
;
background-position
:
0px
0px
;
background-position
:
0px
0px
;
width
:
20px
;
width
:
20px
;
height
:
20px
;
height
:
20px
;
display
:
inline-block
;
display
:
inline-block
;
}
}
.wmd-spacer1
.wmd-spacer1
{
{
left
:
50px
;
left
:
50px
;
}
}
.wmd-spacer2
.wmd-spacer2
{
{
left
:
175px
;
left
:
175px
;
}
}
.wmd-spacer3
.wmd-spacer3
{
{
left
:
300px
;
left
:
300px
;
}
}
.wmd-prompt-background
.wmd-prompt-background
{
{
background-color
:
Black
;
background-color
:
Black
;
}
}
.wmd-prompt-dialog
.wmd-prompt-dialog
{
{
border
:
1px
solid
#999999
;
border
:
1px
solid
#999999
;
background-color
:
#F5F5F5
;
background-color
:
#F5F5F5
;
}
}
.wmd-prompt-dialog
>
div
{
.wmd-prompt-dialog
>
div
{
font-size
:
0
.8em
;
font-size
:
0
.8em
;
font-family
:
arial
,
helvetica
,
sans-serif
;
font-family
:
arial
,
helvetica
,
sans-serif
;
}
}
.wmd-prompt-dialog
>
form
>
input
[
type
=
"text"
]
{
.wmd-prompt-dialog
>
form
>
input
[
type
=
"text"
]
{
border
:
1px
solid
#999999
;
border
:
1px
solid
#999999
;
color
:
black
;
color
:
black
;
}
}
.wmd-prompt-dialog
>
form
>
input
[
type
=
"button"
]
{
.wmd-prompt-dialog
>
form
>
input
[
type
=
"button"
]
{
border
:
1px
solid
#888888
;
border
:
1px
solid
#888888
;
font-family
:
trebuchet
MS
,
helvetica
,
sans-serif
;
font-family
:
trebuchet
MS
,
helvetica
,
sans-serif
;
font-size
:
0
.8em
;
font-size
:
0
.8em
;
font-weight
:
bold
;
font-weight
:
bold
;
}
}
lms/templates/discussion/index.html
View file @
6791e818
...
@@ -8,6 +8,25 @@
...
@@ -8,6 +8,25 @@
</
%
block>
</
%
block>
<
%
block
name=
"js_extra"
>
<
%
block
name=
"js_extra"
>
<!-- The configuration below is different from the main mathjax config because dollar signs make it easier
to integrate with Markdown. -->
<script
type=
"text/x-mathjax-config"
>
MathJax
.
Hub
.
Config
({
tex2jax
:
{
inlineMath
:
[
[
"$"
,
"$"
],
],
displayMath
:
[
[
"$$"
,
"$$"
],
]
}
});
</script>
<!-- This must appear after all mathjax-config blocks, so it is after the imports from the other templates.
It can't be run through static.url because MathJax uses crazy url introspection to do lazy loading of
MathJax extension libraries -->
<script
type=
"text/javascript"
src=
"/static/js/vendor/mathjax-MathJax-c9db6ac/MathJax.js?config=TeX-MML-AM_HTMLorMML-full"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/Markdown.Converter.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/Markdown.Converter.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/Markdown.Sanitizer.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/Markdown.Sanitizer.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/Markdown.Editor.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/Markdown.Editor.js')}"
></script>
...
...
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