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");
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);
}