repl_www: Improved UI for multiline input

This commit is contained in:
Brian Carroll 2022-03-03 23:13:56 +00:00
parent 485cbb4bd1
commit 79b65347fa
3 changed files with 31 additions and 27 deletions

View File

@ -64,9 +64,7 @@ section.source {
display: flex;
flex-direction: column;
}
section.source textarea {
height: 32px;
padding: 8px;
margin-bottom: 16px;
}

View File

@ -82,7 +82,9 @@ function onInputKeyup(event) {
break;
case ENTER:
if (!event.shiftKey) {
onInputChange({ target: repl.elemSourceInput });
}
break;
default:
@ -168,8 +170,8 @@ function createHistoryEntry(inputText) {
const historyIndex = repl.inputHistory.length;
repl.inputHistory.push(inputText);
const inputElem = document.createElement("div");
inputElem.textContent = "> " + inputText;
const inputElem = document.createElement("pre");
inputElem.textContent = inputText;
inputElem.classList.add("input");
const historyItem = document.createElement("div");

View File

@ -1,7 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<title>Roc REPL</title>
<link rel="stylesheet" href="/repl.css" />
@ -20,10 +19,15 @@
</section>
<section class="source">
<textarea autofocus id="source-input" class="code" placeholder="Type some Roc code and press Enter"></textarea>
<textarea
rows="5"
autofocus
id="source-input"
class="code"
placeholder="Type some Roc code and press Enter"
></textarea>
</section>
</div>
<script type="module" src="/repl.js"></script>
</body>
</html>