diff --git a/common/lib/xmodule/xmodule/editing_module.py b/common/lib/xmodule/xmodule/editing_module.py index c52483ace4..5799689b0e 100644 --- a/common/lib/xmodule/xmodule/editing_module.py +++ b/common/lib/xmodule/xmodule/editing_module.py @@ -1,5 +1,4 @@ from pkg_resources import resource_string -from lxml import etree from xmodule.mako_module import MakoModuleDescriptor import logging diff --git a/common/lib/xmodule/xmodule/html_module.py b/common/lib/xmodule/xmodule/html_module.py index 798febfc1d..f5672ca1b8 100644 --- a/common/lib/xmodule/xmodule/html_module.py +++ b/common/lib/xmodule/xmodule/html_module.py @@ -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 diff --git a/common/lib/xmodule/xmodule/js/src/html/edit.coffee b/common/lib/xmodule/xmodule/js/src/html/edit.coffee new file mode 100644 index 0000000000..b2ed0aebf8 --- /dev/null +++ b/common/lib/xmodule/xmodule/js/src/html/edit.coffee @@ -0,0 +1,7 @@ +class @HTMLEditingDescriptor + constructor: (@element) -> + @edit_box = CodeMirror.fromTextArea($(".edit-box", @element)[0], { + mode: "text/html" + }) + + save: -> @edit_box.getValue() diff --git a/common/lib/xmodule/xmodule/seq_module.py b/common/lib/xmodule/xmodule/seq_module.py index 51a24010fc..d5c26d889e 100644 --- a/common/lib/xmodule/xmodule/seq_module.py +++ b/common/lib/xmodule/xmodule/seq_module.py @@ -9,7 +9,6 @@ from xmodule.x_module import XModule from xmodule.progress import Progress from xmodule.exceptions import NotFoundError from pkg_resources import resource_string -from .editing_module import EditingDescriptor log = logging.getLogger("mitx.common.lib.seq_module")