Mercurial Hosting > freedit
comparison src/edit.js.luan @ 25:66fd3784e60e
back to textarea for bbcode
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 19 Jul 2022 22:24:24 -0600 |
parents | da006d1c1eba |
children | 4fdc4ec0050b |
comparison
equal
deleted
inserted
replaced
24:fccbe5554fcc | 25:66fd3784e60e |
---|---|
15 Io.stdout = Http.response.text_writer() | 15 Io.stdout = Http.response.text_writer() |
16 %> | 16 %> |
17 let postDiv = document.querySelector('[post="<%=post.id%>"]'); | 17 let postDiv = document.querySelector('[post="<%=post.id%>"]'); |
18 postDiv.querySelector('[output]').style.display = 'none'; | 18 postDiv.querySelector('[output]').style.display = 'none'; |
19 postDiv.querySelector('[edit]').innerHTML = document.querySelector('[hidden][edit]').innerHTML; | 19 postDiv.querySelector('[edit]').innerHTML = document.querySelector('[hidden][edit]').innerHTML; |
20 let contentEditable = postDiv.querySelector('[contentEditable]'); | 20 let textarea = postDiv.querySelector('textarea'); |
21 contentEditable.innerHTML = <%= json_string(html_encode(post.content)) %>; | 21 textarea.innerHTML = <%= json_string(html_encode(post.content)) %>; |
22 contentEditable.focus(); | 22 textarea.focus(); |
23 <% | 23 <% |
24 end | 24 end |