mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-21 15:59:20 +03:00
repl_www: Improved UI for multiline input
This commit is contained in:
parent
485cbb4bd1
commit
79b65347fa
@ -64,9 +64,7 @@ section.source {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
section.source textarea {
|
||||
height: 32px;
|
||||
padding: 8px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
@ -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");
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user