Got it working, now it's pretty
authorArt Cancro <ajc@citadel.org>
Tue, 23 Nov 2021 21:24:50 +0000 (16:24 -0500)
committerArt Cancro <ajc@citadel.org>
Tue, 23 Nov 2021 21:24:50 +0000 (16:24 -0500)
webcit-ng/http.c
webcit-ng/static/js/view_forum.js

index 36ca13052062447644d51b12ff56f7150bf685d6..51d50ce503479933751ca1e2e21bf48cc388f741 100644 (file)
@@ -177,7 +177,7 @@ void perform_one_http_transaction(struct client_handle *ch) {
                syslog(LOG_DEBUG, "Client disconnected");
        }
        else {
-               syslog(LOG_DEBUG, "< %s %s", h.method, h.uri);
+               syslog(LOG_DEBUG, "\033[33m\033[1m< %s %s\033[0m", h.method, h.uri);
 
                // If there is a request body, read it now.
                char *ccl = header_val(&h, "Content-Length");
index 823c983f3f9f3e8aa0270847a900f11778ce1240..3711a2aed10f3bad9dc7bff11ae2e754a3967f96 100644 (file)
@@ -253,16 +253,10 @@ function open_reply_box(prefix, msgnum, is_quoted) {
        document.getElementById(new_div_name).innerHTML = replybox;
        document.getElementById(new_div_name).scrollIntoView({behavior: "smooth", block: "end", inline: "nearest"});
 
-       // This puts the focus and cursor in the edit box.
+       // These actions must happen *after* the initial render loop completes.
        setTimeout(function() {
                var tag = document.getElementById("ctdl-editor-body");
-              
-               // Set cursor on focus
-               tag.focus();
-
-               // cursor
-               var sel = window.getSelection();
-               sel.collapse(tag.firstChild, 0);
-
+               tag.focus();                                            // sets the focus
+               window.getSelection().collapse(tag.firstChild, 0);      // positions the cursor
        }, 0);
 }