Mercurial Hosting > freedit
diff src/thread.html.luan @ 25:66fd3784e60e
back to textarea for bbcode
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 19 Jul 2022 22:24:24 -0600 |
parents | 33731231093a |
children | 0837820b97fb |
line wrap: on
line diff
--- a/src/thread.html.luan Tue Jul 19 22:07:02 2022 -0600 +++ b/src/thread.html.luan Tue Jul 19 22:24:24 2022 -0600 @@ -56,7 +56,12 @@ [message] { white-space: pre-wrap; } - </style> + textarea { + width: 100%; + xmax-width: 450px; + height: 100px; + } + </style> <script> function getPostDiv(node) { do { @@ -73,7 +78,7 @@ function saveEdit(a) { let postDiv = getPostDiv(a); let post = postDiv.getAttribute('post'); - let text = postDiv.querySelector('[contentEditable]').innerHTML; + let text = postDiv.querySelector('textarea').value; let postData = 'post=' + post + '&text=' + encodeURIComponent(text); ajax("save_edit.js",postData); } @@ -134,7 +139,7 @@ <span hidden delete>Delete? <a href="javascript:" onclick="deleteYes(parentNode)">yes</a> / <a href="javascript:" onclick="deleteNo(parentNode)">no</a></span> <span hidden undelete><%deletePost()%></span> <div hidden edit> - <div contentEditable></div> + <textarea></textarea> <p> <button onclick="saveEdit(this)">save</button> <button onclick="cancelEdit(this)">cancel</button>