Tweak serial page to work better in Chrome
This commit is contained in:
parent
8093f8e555
commit
031c124a81
|
@ -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;"> </span>
|
||||
<span style="height: 1px;"></span>
|
||||
</div>
|
||||
<div id="controls" style="flex: none; display: flex;">
|
||||
<fieldset style="display: inline-block; padding: 0;">
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue