lexonomy_custom_editor/src/main.py

31 lines
536 B
Python

from browser import window
from model import Model
from view import View
from update import update
from export import export_to_xml
model = Model()
def plugin_init(div, _entry, editable):
view = View(div)
update.set_model(model)
update.set_view(view)
def plugin_render(_div, entry):
model.import_xml(entry.content)
update.update_model()
def plugin_save(_div):
return export_to_xml(model)
# export!
window.plugin_init = plugin_init
window.plugin_render = plugin_render
window.plugin_save = plugin_save