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 36ca130..51d50ce 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 823c983..3711a2a 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);
 }