aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gn2/wqflask/templates/gn_editor.html10
-rw-r--r--gn2/wqflask/templates/gn_editor_commit.html14
-rw-r--r--gn2/wqflask/views.py1
3 files changed, 15 insertions, 10 deletions
diff --git a/gn2/wqflask/templates/gn_editor.html b/gn2/wqflask/templates/gn_editor.html
index f2f57cec..112180e1 100644
--- a/gn2/wqflask/templates/gn_editor.html
+++ b/gn2/wqflask/templates/gn_editor.html
@@ -95,15 +95,13 @@
scrollPastEnd: 0, // number -> !maxLines: if positive, user can scroll pass the last line and go n * editorHeight more distance
fixedWidthGutter: false, // boolean: true if the gutter should be fixed width
theme: "ace/theme/dracula", // theme string from ace/theme or custom?
+ scrollSpeed: 2, // number: the scroll speed index
- // mouseHandler options
- scrollSpeed: 2, // number: the scroll speed index
dragDelay: 0, // number: the drag delay before drag starts. it's 150ms for mac by default
dragEnabled: true, // boolean: enable dragging
focusTimout: 0, // number: the focus delay before focus starts.
tooltipFollowsMouse: true, // boolean: true if the gutter tooltip should follow mouse
-
- // session options
+ // session options
firstLineNumber: 1, // number: the line number in first line
overwrite: false, // boolean
newLineMode: 'auto', // "auto" | "unix" | "windows"
@@ -111,10 +109,14 @@
useSoftTabs: true, // boolean: true if we want to use spaces than tabs
tabSize: 4, // number
wrap: true, // boolean | string | number: true/'free' means wrap instead of horizontal scroll, false/'off' means horizontal scroll instead of wrap, and number means number of column before wrap. -1 means wrap at print margin
+
indentedSoftWrap: true, // boolean
foldStyle: 'markbegin', // enum: 'manual'/'markbegin'/'markbeginend'.
mode: 'ace/mode/markdown'
+ }
+
+
document.querySelector("#output").addEventListener("updateEditor", function(event){
console.log(event.detail.payload)
console.log(event)
diff --git a/gn2/wqflask/templates/gn_editor_commit.html b/gn2/wqflask/templates/gn_editor_commit.html
index 5a158e1a..214ca169 100644
--- a/gn2/wqflask/templates/gn_editor_commit.html
+++ b/gn2/wqflask/templates/gn_editor_commit.html
@@ -1,5 +1,5 @@
<section classs="row commit-content" style="padding-top:25px">
- <div class="col-sm-10 col-sm-offset-1">
+ <form action="/editor/commit" method="POST" class="col-sm-10 col-sm-offset-1">
<div>
<div>
<h2> <i>Commit your Changes</i></h2>
@@ -8,12 +8,12 @@
<br>
<div>
<div class="row">
- <label class="col-sm-4" for="message-text"> <i>*Commit Message*</i></label>
+ <label class="col-sm-4" for="message"> <i>*Commit Message*</i></label>
</div>
<br>
<div class="row">
- <textarea class="col-sm-12">
+ <textarea class="col-sm-12" name="message" required>
</textarea>
</div>
@@ -24,12 +24,14 @@
<button class="btn btn-secondary col-sm-2 col-sm-offset-1">
Cancel
</button>
-
- <button class="btn btn-primary col-sm-2 col-sm-offset-1">
+ <button hx-post="/editor/commit"
+ hx-target="#output"
+ hx-swap= "innerHTML"
+ class="btn btn-primary col-sm-2 col-sm-offset-1">
Commit
</button>
</div>
<br>
- </div>
+ </form>
</section>
diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py
index 5d2bdfb2..ce8cabd0 100644
--- a/gn2/wqflask/views.py
+++ b/gn2/wqflask/views.py
@@ -324,6 +324,7 @@ def editor_settings():
def commit_editor():
if request.method == "GET":
return render_template("gn_editor_commit.html")
+ return render_template("gn_editor_results_page.html")
@app.route("/gnqna/hist/", methods=["GET"])