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
76f2ef6f
Commit
76f2ef6f
authored
Jan 08, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Empty template now recognized as allowing markdown editing
Save saves markdown and updates the xml
parent
735aa134
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
cms/static/coffee/src/views/module_edit.coffee
+1
-1
cms/templates/widgets/problem-edit.html
+1
-1
common/lib/xmodule/xmodule/js/src/problem/edit.coffee
+9
-1
No files found.
cms/static/coffee/src/views/module_edit.coffee
View file @
76f2ef6f
...
...
@@ -55,7 +55,7 @@ class CMS.Views.ModuleEdit extends Backbone.View
clickSaveButton
:
(
event
)
=>
event
.
preventDefault
()
data
=
@
module
.
save
()
data
.
metadata
=
@
metadata
(
)
data
.
metadata
=
_
.
extend
(
data
.
metadata
,
@
metadata
()
)
$modalCover
.
hide
()
@
model
.
save
(
data
).
done
(
=>
# # showToastMessage("Your changes have been saved.", null, 3)
...
...
cms/templates/widgets/problem-edit.html
View file @
76f2ef6f
<
%
include
file=
"metadata-edit.html"
/>
<section
class=
"problem-editor editor"
>
<div
class=
"row"
>
%if markdown != '' or data == '':
%if markdown != '' or data == '
<problem>
\n
</problem>
\n
':
<div
class=
"editor-bar"
>
<ul
class=
"format-buttons"
>
<li><a
href=
"#"
class=
"multiple-choice-button"
data-tooltip=
"Multiple Choice"
><span
...
...
common/lib/xmodule/xmodule/js/src/problem/edit.coffee
View file @
76f2ef6f
...
...
@@ -61,7 +61,15 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
save
:
->
$body
.
off
(
'click'
,
'.editor-tabs .tab'
,
@
changeEditor
)
$body
.
off
(
'click'
,
'.editor-bar a'
,
@
onToolbarButton
);
data
:
@
xml_editor
.
getValue
()
# TODO when logic is in place to remove the markdown if xml is edited, ensure this doesn't overwrite that
if
@
current_editor
==
@
markdown_editor
{
data
:
MarkdownEditingDescriptor
.
markdownToXml
(
@
markdown_editor
.
getValue
())
metadata
:
markdown
:
@
markdown_editor
.
getValue
()
}
else
data
:
@
xml_editor
.
getValue
()
@
insertMultipleChoice
:
(
selectedText
)
->
return
MarkdownEditingDescriptor
.
insertGenericChoice
(
selectedText
,
'('
,
')'
,
MarkdownEditingDescriptor
.
multipleChoiceTemplate
)
...
...
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