show input in console
This commit is contained in:
parent
fbc53fe448
commit
8dc9bfbf7a
@ -35,6 +35,8 @@ export class ConsoleInput {
|
|||||||
const code = this.inputElem.value;
|
const code = this.inputElem.value;
|
||||||
this.inputElem.value = "";
|
this.inputElem.value = "";
|
||||||
|
|
||||||
|
this.console.addInput(code);
|
||||||
|
|
||||||
this.history.push(code);
|
this.history.push(code);
|
||||||
this.historyIndex = this.history.length;
|
this.historyIndex = this.history.length;
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@ export class PlaygroundConsole {
|
|||||||
const argString = typeof arg === "function" ? `function ${arg.name}()` : `${arg}`;
|
const argString = typeof arg === "function" ? `function ${arg.name}()` : `${arg}`;
|
||||||
|
|
||||||
const value = document.createElement("span");
|
const value = document.createElement("span");
|
||||||
value.className = entryType;
|
|
||||||
value.textContent = argString;
|
value.textContent = argString;
|
||||||
value.dataset.type = this.#getTypeName(arg);
|
value.dataset.type = this.#getTypeName(arg);
|
||||||
parent.appendChild(value);
|
parent.appendChild(value);
|
||||||
@ -103,6 +102,10 @@ export class PlaygroundConsole {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addInput() {
|
||||||
|
this.#addEntry("input", "", this.elem, ...arguments);
|
||||||
|
}
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
this.#addEntry("log", "", this.elem, ...arguments);
|
this.#addEntry("log", "", this.elem, ...arguments);
|
||||||
}
|
}
|
||||||
|
@ -150,6 +150,15 @@ div#buttons button {
|
|||||||
background-color: #413d07;
|
background-color: #413d07;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#console .input:before {
|
||||||
|
content: "> ";
|
||||||
|
}
|
||||||
|
|
||||||
|
#console .input {
|
||||||
|
color: #bdbdbd;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
#console .info,
|
#console .info,
|
||||||
#console .debug,
|
#console .debug,
|
||||||
#console .prototype,
|
#console .prototype,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user