From e2e3a61aa12cd4376fa77431a6ddf03de0fd5b14 Mon Sep 17 00:00:00 2001
From: Alexander_Kabui
Date: Thu, 8 Aug 2024 17:30:46 +0300
Subject: Code refactoring.
---
gn2/wqflask/templates/gn_editor.html | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
(limited to 'gn2/wqflask/templates/gn_editor.html')
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 @@
- 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.
@@ -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);
+
});
-
{% endblock %}
--
cgit v1.2.3