Tweak serial page to work better in Chrome

This commit is contained in:
Scott Shawcroft 2022-07-12 14:12:39 -07:00
parent 8093f8e555
commit 031c124a81
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
2 changed files with 6 additions and 6 deletions

View File

@ -1,15 +1,15 @@
<!DOCTYPE html>
<html style="height: 100%;">
<meta name="viewport" content="width=device-width, initial-scale=1">
<head>
<title>Simple client</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="/serial.js" defer=true></script>
</head>
<body style="flex-direction: column; display: flex; height: 100%; width: 100%; margin: 0; font-size: 1rem;">
<div style="flex: auto; display: flex; overflow: scroll; flex-direction: column;">
<div style="flex: auto; display: flex; overflow: auto; flex-direction: column;">
<pre id="log" style="margin:0; margin-top: auto;"></pre>
<span style="height: 1px;">&nbsp</span>
<span style="height: 1px;"></span>
</div>
<div id="controls" style="flex: none; display: flex;">
<fieldset style="display: inline-block; padding: 0;">

View File

@ -57,7 +57,7 @@ ws.onerror = function(e) {
set_enabled(false);
};
input.onbeforeinput = function(e) {
input.addEventListener("beforeinput", function(e) {
if (e.inputType == "insertLineBreak") {
ws.send("\r");
input.value = "";
@ -68,7 +68,7 @@ input.onbeforeinput = function(e) {
} else if (e.inputType == "deleteContentBackward") {
ws.send("\b");
}
}
});
let ctrl_c = document.querySelector("#c");
ctrl_c.onclick = function() {