aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/gn_editor.html
diff options
context:
space:
mode:
authorAlexander_Kabui2024-08-08 17:30:46 +0300
committerBonfaceKilz2024-08-29 18:58:56 +0300
commite2e3a61aa12cd4376fa77431a6ddf03de0fd5b14 (patch)
treea2ecc4a750f21bb02357dd7865aa241d1381a291 /gn2/wqflask/templates/gn_editor.html
parent4fc52e002a230017f8a08f0fb771bf59f4d2a257 (diff)
downloadgenenetwork2-e2e3a61aa12cd4376fa77431a6ddf03de0fd5b14.tar.gz
Code refactoring.
Diffstat (limited to 'gn2/wqflask/templates/gn_editor.html')
-rw-r--r--gn2/wqflask/templates/gn_editor.html13
1 files changed, 6 insertions, 7 deletions
diff --git a/gn2/wqflask/templates/gn_editor.html b/gn2/wqflask/templates/gn_editor.html
index 112180e1..dca6d161 100644
--- a/gn2/wqflask/templates/gn_editor.html
+++ b/gn2/wqflask/templates/gn_editor.html
@@ -30,12 +30,10 @@
<div>
<div class="row">
<section class="col-sm-6" id="editor" style="height:100vh">
-
</section>
<section class="col-sm-6">
<div class="row">
<section class="col-sm-10 col-sm-offset-1" id="output" style="height:100vh;overflow-y:scroll" id="swap">
- Tristique nulla aliquet enim tortor, at auctor urna nunc id cursus metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices sagittis orci, a scelerisque! Laoreet suspendisse interdum consectetur libero.
</section>
</div>
@@ -118,8 +116,6 @@
document.querySelector("#output").addEventListener("updateEditor", function(event){
- console.log(event.detail.payload)
- console.log(event)
editor.setOptions({
...editor_configurations,
...event.detail.payload
@@ -147,17 +143,20 @@
previewContent = document.querySelector("#output");
var markdownContent = editor.getValue();
var htmlContent = new_marked.parse(markdownContent)
+ console.log(htmlContent)
previewContent.innerHTML = htmlContent;
}
- editor.getSession().on("change", function(e){
+ editor.getSession().on("change", function(e){
updatePreview()
})
-
+ //do the fetch here
+ var data = {{ content|tojson }}
+ editor.setValue(data, -1);
+
});
-
</script>
{% endblock %}