Fix editing of html modules that broke with changes to EditingDescriptor

This commit is contained in:
Calen Pennington
2012-09-25 15:46:57 -04:00
parent d0cfd16bfa
commit 7998b4fea6
3 changed files with 12 additions and 2 deletions

View File

@@ -1,5 +1,4 @@
from pkg_resources import resource_string
from lxml import etree
from xmodule.mako_module import MakoModuleDescriptor
import logging

View File

@@ -6,7 +6,8 @@ import sys
from lxml import etree
from path import path
from .x_module import XModule, Template
from .x_module import XModule
from pkg_resources import resource_string
from .xml_module import XmlDescriptor, name_to_pathname
from .editing_module import EditingDescriptor
from .stringify import stringify_children
@@ -34,6 +35,9 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
module_class = HtmlModule
filename_extension = "xml"
js = {'coffee': [resource_string(__name__, 'js/src/html/edit.coffee')]}
js_module_name = "HTMLEditingDescriptor"
# VS[compat] TODO (cpennington): Delete this method once all fall 2012 course
# are being edited in the cms
@classmethod

View File

@@ -0,0 +1,7 @@
class @HTMLEditingDescriptor
constructor: (@element) ->
@edit_box = CodeMirror.fromTextArea($(".edit-box", @element)[0], {
mode: "text/html"
})
save: -> @edit_box.getValue()