1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-01-07 02:10:26 +00:00

review changes

This commit is contained in:
DanInSpace 2021-03-20 19:21:27 +05:00 committed by wikimind
parent 9071a72de3
commit 310a3f4a63
5 changed files with 7 additions and 7 deletions

View File

@ -420,7 +420,7 @@ func StreamToolbarJS(qw422016 *qt422016.Writer) {
qw422016.N().S(` qw422016.N().S(`
`) `)
//line assets/assets.qtpl:14 //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) { function insertTextAtCursor(text, el = editTextarea) {
const [start, end] = [el.selectionStart, el.selectionEnd]; const [start, end] = [el.selectionStart, el.selectionEnd];

View File

@ -1,4 +1,4 @@
const editTextarea = document.getElementById('edit-textarea') const editTextarea = document.getElementsByClassName('edit-form__textarea')[0]
function insertTextAtCursor(text, el = editTextarea) { function insertTextAtCursor(text, el = editTextarea) {
const [start, end] = [el.selectionStart, el.selectionEnd]; const [start, end] = [el.selectionStart, el.selectionEnd];

View File

@ -119,7 +119,7 @@ func handlerStyle(w http.ResponseWriter, rq *http.Request) {
func handlerToolbar(w http.ResponseWriter, rq *http.Request) { func handlerToolbar(w http.ResponseWriter, rq *http.Request) {
log.Println(rq.URL) 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())) w.Write([]byte(assets.ToolbarJS()))
} }

View File

@ -7,12 +7,12 @@
<main class="main-width edit edit_no-preview"> <main class="main-width edit edit_no-preview">
<h1 class="edit__title">Edit {%s util.BeautifulName(hyphaName) %}</h1> <h1 class="edit__title">Edit {%s util.BeautifulName(hyphaName) %}</h1>
{%s= warning %} {%s= warning %}
<div class="toolbar"> <div class="edit__toolbar">
<button onclick="insertDate()">Insert Date</button> <button onclick="insertDate()">Insert Date</button>
</div> </div>
<form method="post" class="edit-form" <form method="post" class="edit-form"
action="/upload-text/{%s hyphaName %}"> action="/upload-text/{%s hyphaName %}">
<textarea id="edit-textarea" name="text">{%s textAreaFill %}</textarea> <textarea name="text" class="edit-form__textarea">{%s textAreaFill %}</textarea>
<br/> <br/>
<input type="submit" name="action" value="Save" class="edit-form__save"/> <input type="submit" name="action" value="Save" class="edit-form__save"/>
<input type="submit" name="action" value="Preview" class="edit-form__preview"> <input type="submit" name="action" value="Preview" class="edit-form__preview">

View File

@ -44,7 +44,7 @@ func StreamEditHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, text
qw422016.N().S(warning) qw422016.N().S(warning)
//line views/mutators.qtpl:9 //line views/mutators.qtpl:9
qw422016.N().S(` qw422016.N().S(`
<div class="toolbar"> <div class="edit__toolbar">
<button onclick="insertDate()">Insert Date</button> <button onclick="insertDate()">Insert Date</button>
</div> </div>
<form method="post" class="edit-form" <form method="post" class="edit-form"
@ -53,7 +53,7 @@ func StreamEditHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, text
qw422016.E().S(hyphaName) qw422016.E().S(hyphaName)
//line views/mutators.qtpl:14 //line views/mutators.qtpl:14
qw422016.N().S(`"> qw422016.N().S(`">
<textarea id="edit-textarea" name="text">`) <textarea name="text" class="edit-form__textarea">`)
//line views/mutators.qtpl:15 //line views/mutators.qtpl:15
qw422016.E().S(textAreaFill) qw422016.E().S(textAreaFill)
//line views/mutators.qtpl:15 //line views/mutators.qtpl:15