Commit 533f4876 by cahrens

Rename, add css file.

parent 8dd02c7e
<%include file="metadata-edit.html" /> <%include file="metadata-edit.html" />
<section class="problem-editor editor"> <section class="problem-editor editor">
<div class="row"> <div class="row">
<%
markdown = 'foo'
%>
%if markdown != '' or data == '': %if markdown != '' or data == '':
<div class="editor-bar"> <div class="editor-bar">
<ul class="format-buttons"> <ul class="format-buttons">
...@@ -24,7 +21,7 @@ ...@@ -24,7 +21,7 @@
<li><a href="#" class="cheatsheet-toggle" data-tooltip="Toggle Cheatsheet">?</a></li> <li><a href="#" class="cheatsheet-toggle" data-tooltip="Toggle Cheatsheet">?</a></li>
</ul> </ul>
</div> </div>
<textarea class="edit-box">${markdown}</textarea> <textarea class="markdown-box">${markdown}</textarea>
%endif %endif
<textarea class="xml-box" rows="8" cols="40">${data | h}</textarea> <textarea class="xml-box" rows="8" cols="40">${data | h}</textarea>
</div> </div>
......
...@@ -651,8 +651,9 @@ class CapaDescriptor(RawDescriptor): ...@@ -651,8 +651,9 @@ class CapaDescriptor(RawDescriptor):
has_score = True has_score = True
template_dir_name = 'problem' template_dir_name = 'problem'
mako_template = "widgets/problem-edit.html" 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" js_module_name = "MarkdownEditingDescriptor"
css = {'scss': [resource_string(__name__, 'css/problem/edit.scss')]}
# Capa modules have some additional metadata: # Capa modules have some additional metadata:
# TODO (vshnayder): do problems have any other metadata? Do they # TODO (vshnayder): do problems have any other metadata? Do they
......
...@@ -6,11 +6,12 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor ...@@ -6,11 +6,12 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
lineWrapping: true lineWrapping: true
}) })
@markdown_editor = CodeMirror.fromTextArea($(".edit-box", @element)[0], { if $(".markdown-box", @element).length != 0
lineWrapping: true @markdown_editor = CodeMirror.fromTextArea($(".markdown-box", @element)[0], {
mode: null lineWrapping: true
onChange: @onMarkdownEditorUpdate mode: null
}) onChange: @onMarkdownEditorUpdate
})
onMarkdownEditorUpdate: -> onMarkdownEditorUpdate: ->
console.log('update') console.log('update')
......
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