From 310a3f4a63e58d760ae252ecb770f8df1ea87777 Mon Sep 17 00:00:00 2001 From: DanInSpace Date: Sat, 20 Mar 2021 19:21:27 +0500 Subject: [PATCH] review changes --- assets/assets.qtpl.go | 2 +- assets/toolbar.js | 2 +- main.go | 2 +- views/mutators.qtpl | 4 ++-- views/mutators.qtpl.go | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/assets.qtpl.go b/assets/assets.qtpl.go index c66e041..6ff02ce 100644 --- a/assets/assets.qtpl.go +++ b/assets/assets.qtpl.go @@ -420,7 +420,7 @@ func StreamToolbarJS(qw422016 *qt422016.Writer) { qw422016.N().S(` `) //line assets/assets.qtpl:14 - qw422016.N().S(`const editTextarea = document.getElementById('edit-textarea') + qw422016.N().S(`const editTextarea = document.getElementsByClassName('edit-form__textarea')[0] function insertTextAtCursor(text, el = editTextarea) { const [start, end] = [el.selectionStart, el.selectionEnd]; diff --git a/assets/toolbar.js b/assets/toolbar.js index 4d25d18..a528e73 100644 --- a/assets/toolbar.js +++ b/assets/toolbar.js @@ -1,4 +1,4 @@ -const editTextarea = document.getElementById('edit-textarea') +const editTextarea = document.getElementsByClassName('edit-form__textarea')[0] function insertTextAtCursor(text, el = editTextarea) { const [start, end] = [el.selectionStart, el.selectionEnd]; diff --git a/main.go b/main.go index f0b26b4..e5b8953 100644 --- a/main.go +++ b/main.go @@ -119,7 +119,7 @@ func handlerStyle(w http.ResponseWriter, rq *http.Request) { func handlerToolbar(w http.ResponseWriter, rq *http.Request) { log.Println(rq.URL) - w.Header().Set("Content-Type", "text/js;charset=utf-8") + w.Header().Set("Content-Type", "text/javascript;charset=utf-8") w.Write([]byte(assets.ToolbarJS())) } diff --git a/views/mutators.qtpl b/views/mutators.qtpl index c9d5394..dfcc049 100644 --- a/views/mutators.qtpl +++ b/views/mutators.qtpl @@ -7,12 +7,12 @@

Edit {%s util.BeautifulName(hyphaName) %}

{%s= warning %} -
+
- +
diff --git a/views/mutators.qtpl.go b/views/mutators.qtpl.go index 6ea154a..6f577a6 100644 --- a/views/mutators.qtpl.go +++ b/views/mutators.qtpl.go @@ -44,7 +44,7 @@ func StreamEditHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, text qw422016.N().S(warning) //line views/mutators.qtpl:9 qw422016.N().S(` -
+
-