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
3e16e4cf
Commit
3e16e4cf
authored
Jan 03, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/cas/speed-editor' of github.com:MITx/mitx into feature/cas/speed-editor
parents
ac5b48e8
533f4876
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
8 deletions
+84
-8
cms/static/js/speed-editor.js
+2
-1
cms/templates/widgets/problem-edit.html
+1
-1
common/lib/xmodule/xmodule/capa_module.py
+2
-1
common/lib/xmodule/xmodule/css/problem/edit.scss
+64
-0
common/lib/xmodule/xmodule/js/src/problem/edit.coffee
+15
-5
No files found.
cms/static/js/speed-editor.js
View file @
3e16e4cf
...
...
@@ -21,7 +21,8 @@ function initProblemEditors($editor, $prev) {
$currentEditor
=
$editor
;
simpleEditor
=
CodeMirror
.
fromTextArea
(
$editor
.
find
(
'.edit-box'
)[
0
],
{
lineWrapping
:
true
,
extraKeys
:
{
// TODO: I left out the extra keys for now.
extraKeys
:
{
'Ctrl-N'
:
newUnit
,
'Ctrl-H'
:
makeHeader
,
'Ctrl-V'
:
makeVideo
,
...
...
cms/templates/widgets/problem-edit.html
View file @
3e16e4cf
...
...
@@ -21,7 +21,7 @@
<li><a
href=
"#"
class=
"cheatsheet-toggle"
data-tooltip=
"Toggle Cheatsheet"
>
?
</a></li>
</ul>
</div>
<textarea
class=
"
edit
-box"
>
${markdown}
</textarea>
<textarea
class=
"
markdown
-box"
>
${markdown}
</textarea>
%endif
<textarea
class=
"xml-box"
rows=
"8"
cols=
"40"
>
${data | h}
</textarea>
</div>
...
...
common/lib/xmodule/xmodule/capa_module.py
View file @
3e16e4cf
...
...
@@ -651,8 +651,9 @@ class CapaDescriptor(RawDescriptor):
has_score
=
True
template_dir_name
=
'problem'
mako_template
=
"widgets/problem-edit.html"
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/problem/
markdown
.coffee'
)]}
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/problem/
edit
.coffee'
)]}
js_module_name
=
"MarkdownEditingDescriptor"
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/problem/edit.scss'
)]}
# Capa modules have some additional metadata:
# TODO (vshnayder): do problems have any other metadata? Do they
...
...
common/lib/xmodule/xmodule/css/problem/edit.scss
0 → 100644
View file @
3e16e4cf
.editor-bar
{
position
:
relative
;
@include
linear-gradient
(
top
,
#d4dee8
,
#c9d5e2
);
padding
:
5px
;
border
:
1px
solid
#3c3c3c
;
border-radius
:
3px
3px
0
0
;
border-bottom-color
:
#a5aaaf
;
@include
clearfix
;
a
{
display
:
block
;
float
:
left
;
padding
:
3px
10px
7px
;
margin-left
:
7px
;
border-radius
:
2px
;
&
:hover
{
background
:
rgba
(
255
,
255
,
255
,
.5
);
}
}
.editor-tabs
{
position
:
absolute
;
top
:
10px
;
right
:
10px
;
li
{
float
:
left
;
}
.tab
{
height
:
24px
;
padding
:
7px
20px
3px
;
border
:
1px
solid
#a5aaaf
;
border-radius
:
3px
3px
0
0
;
@include
linear-gradient
(
top
,
rgba
(
0
,
0
,
0
,
0
)
87%
,
rgba
(
0
,
0
,
0
,
.06
));
background-color
:
#e5ecf3
;
font-size
:
13px
;
color
:
#3c3c3c
;
box-shadow
:
1px
-1px
1px
rgba
(
0
,
0
,
0
,
.05
);
&
.current
{
background
:
#fff
;
border-bottom-color
:
#fff
;
}
}
.cheatsheet-toggle
{
width
:
21px
;
height
:
21px
;
padding
:
0
;
margin
:
3px
5px
0
16px
;
border-radius
:
22px
;
border
:
1px
solid
#a5aaaf
;
background
:
#e5ecf3
;
font-size
:
13px
;
font-weight
:
700
;
color
:
#565d64
;
text-align
:
center
;
}
}
}
common/lib/xmodule/xmodule/js/src/problem/
markdown
.coffee
→
common/lib/xmodule/xmodule/js/src/problem/
edit
.coffee
View file @
3e16e4cf
class
@
MarkdownEditingDescriptor
extends
XModule
.
Descriptor
constructor
:
(
@
element
)
->
@
edit_box
=
CodeMirror
.
fromTextArea
(
$
(
".xml-box"
,
@
element
)[
0
],
{
mode
:
"xml"
lineNumbers
:
true
lineWrapping
:
true
@
xml_editor
=
CodeMirror
.
fromTextArea
(
$
(
".xml-box"
,
@
element
)[
0
],
{
mode
:
"xml"
lineNumbers
:
true
lineWrapping
:
true
})
if
$
(
".markdown-box"
,
@
element
).
length
!=
0
@
markdown_editor
=
CodeMirror
.
fromTextArea
(
$
(
".markdown-box"
,
@
element
)[
0
],
{
lineWrapping
:
true
mode
:
null
onChange
:
@
onMarkdownEditorUpdate
})
onMarkdownEditorUpdate
:
->
console
.
log
(
'update'
)
save
:
->
data
:
@
edit_box
.
getValue
()
data
:
@
xml_editor
.
getValue
()
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