Commit b4312cbf by cahrens

Starting the markdown editor.

parent e09a8e4a
......@@ -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,
......
<%include file="metadata-edit.html" />
<section class="problem-editor editor">
<div class="row">
<%
markdown = 'foo'
%>
%if markdown != '' or data == '':
<div class="editor-bar">
<ul class="format-buttons">
......
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
})
@markdown_editor = CodeMirror.fromTextArea($(".edit-box", @element)[0], {
lineWrapping: true
mode: null
onChange: @onMarkdownEditorUpdate
})
onMarkdownEditorUpdate: ->
console.log('update')
save: ->
data: @edit_box.getValue()
data: @xml_editor.getValue()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment