parent
be573d38a5
commit
88824ee273
@ -1,74 +1,30 @@
|
|||||||
from browser import document
|
from browser import window
|
||||||
from model import Model
|
from model import Model
|
||||||
from view import View
|
from view import View
|
||||||
from update import update
|
from update import update
|
||||||
import modals
|
from export import export_to_xml
|
||||||
|
|
||||||
|
|
||||||
model = Model()
|
model = Model()
|
||||||
|
|
||||||
|
|
||||||
def main(xml_str):
|
def plugin_init(div, _entry, editable):
|
||||||
model.import_xml(xml_str)
|
view = View(div)
|
||||||
update.set_view(View(document.getElementById("app")))
|
|
||||||
update.set_model(model)
|
update.set_model(model)
|
||||||
|
update.set_view(view)
|
||||||
|
|
||||||
|
|
||||||
|
def plugin_render(_div, entry):
|
||||||
|
model.import_xml(entry.content)
|
||||||
update.update_model()
|
update.update_model()
|
||||||
|
|
||||||
|
|
||||||
main("""<entry>
|
def plugin_save(_div):
|
||||||
<head>
|
return export_to_xml(model)
|
||||||
<status>A</status>
|
|
||||||
<headword>
|
|
||||||
<lemma>adolescenca</lemma>
|
# export!
|
||||||
</headword>
|
window.plugin_init = plugin_init
|
||||||
<grammar>
|
window.plugin_render = plugin_render
|
||||||
<category>samostalnik</category>
|
window.plugin_save = plugin_save
|
||||||
</grammar>
|
|
||||||
<comment></comment>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<senseList>
|
|
||||||
<sense>
|
|
||||||
<labelList>
|
|
||||||
<label>tehnika</label>
|
|
||||||
</labelList>
|
|
||||||
<definitionList>
|
|
||||||
<definition type="indicator">obdobje</definition>
|
|
||||||
</definitionList>
|
|
||||||
<translationContainerList>
|
|
||||||
<translationContainer cluster="1">
|
|
||||||
<translation>preizkus</translation>
|
|
||||||
<explanation>explainme!</explanation>
|
|
||||||
<tagsContainer>
|
|
||||||
<tag><type>podrocje</type><value>biologija</value></tag>
|
|
||||||
</tagsContainer>
|
|
||||||
</translationContainer>
|
|
||||||
<translationContainer cluster="1">
|
|
||||||
<translation>fsd</translation>
|
|
||||||
</translationContainer>
|
|
||||||
<translationContainer cluster="2">
|
|
||||||
<translation>preskus</translation>
|
|
||||||
</translationContainer>
|
|
||||||
<translationContainer cluster="2">
|
|
||||||
<translation>sdfsd</translation>
|
|
||||||
<tagsContainer>
|
|
||||||
<tag><type>podrocje</type><value>ozboltologija</value></tag>
|
|
||||||
</tagsContainer>
|
|
||||||
</translationContainer>
|
|
||||||
<translationContainer cluster="3">
|
|
||||||
<translation>fsd</translation>
|
|
||||||
</translationContainer>
|
|
||||||
</translationContainerList>
|
|
||||||
<exampleContainerList>
|
|
||||||
<exampleContainer>
|
|
||||||
<example>The test was interesting.</example>
|
|
||||||
<translationContainer>
|
|
||||||
<translation>Preizkus je bil zanimiv.</translation>
|
|
||||||
</translationContainer>
|
|
||||||
</exampleContainer>
|
|
||||||
</exampleContainerList>
|
|
||||||
</sense>
|
|
||||||
</senseList>
|
|
||||||
</body>
|
|
||||||
</entry>""")
|
|
||||||
|
|
||||||
|
Loading…
Reference in new issue