Commit 395d4874 by Calen Pennington Committed by Tom Giannattasio

Fix editing of html modules that broke with changes to EditingDescriptor

parent 51d16793
from pkg_resources import resource_string from pkg_resources import resource_string
from lxml import etree
from xmodule.mako_module import MakoModuleDescriptor from xmodule.mako_module import MakoModuleDescriptor
import logging import logging
......
...@@ -6,7 +6,8 @@ import sys ...@@ -6,7 +6,8 @@ import sys
from lxml import etree from lxml import etree
from path import path 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 .xml_module import XmlDescriptor, name_to_pathname
from .editing_module import EditingDescriptor from .editing_module import EditingDescriptor
from .stringify import stringify_children from .stringify import stringify_children
...@@ -35,6 +36,9 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor): ...@@ -35,6 +36,9 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
filename_extension = "xml" filename_extension = "xml"
template_dir_name = "html" template_dir_name = "html"
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 # VS[compat] TODO (cpennington): Delete this method once all fall 2012 course
# are being edited in the cms # are being edited in the cms
@classmethod @classmethod
......
class @HTMLEditingDescriptor
constructor: (@element) ->
@edit_box = CodeMirror.fromTextArea($(".edit-box", @element)[0], {
mode: "text/html"
})
save: -> @edit_box.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