diff --git a/res/main.html b/res/main.html index 53af99f..087d51a 100644 --- a/res/main.html +++ b/res/main.html @@ -1,12 +1,75 @@ - + PYVsms - - + +
- + + diff --git a/src/browser/internal.py b/src/browser/internal.py index 68303c5..426d2e8 100644 --- a/src/browser/internal.py +++ b/src/browser/internal.py @@ -11,6 +11,9 @@ class Proxy: else: return self.proxied[attr] + def __setattr__(self, attr, value): + self.proxied[attr] = value + _document = Proxy(document) _window = Proxy(window) diff --git a/src/main.py b/src/main.py index 05a17f3..533e7d9 100644 --- a/src/main.py +++ b/src/main.py @@ -1,74 +1,30 @@ -from browser import document +from browser import window from model import Model from view import View from update import update -import modals +from export import export_to_xml model = Model() -def main(xml_str): - model.import_xml(xml_str) - update.set_view(View(document.getElementById("app"))) +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() -main(""" - - A - - adolescenca - - - samostalnik - - - - - - - - - - - obdobje - - - - preizkus - explainme! - - podrocjebiologija - - - - fsd - - - preskus - - - sdfsd - - podrocjeozboltologija - - - - fsd - - - - - The test was interesting. - - Preizkus je bil zanimiv. - - - - - - - """) +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