We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06a65fa commit e23ac76Copy full SHA for e23ac76
1 file changed
js/script.js
@@ -3,14 +3,28 @@ window.onload = function () {
3
document.getElementById("shellinput").value = "";
4
}
5
6
-function run(command) {
7
-
+const commands = [
+ {
8
+ name: "clear",
9
+ description: "Clears the console",
10
+ run: function () {
11
+ document.getElementById("shellinput").value = "";
12
+ console.log("Cleared the console")
13
+ }
14
15
+]
16
+
17
+function run(commandInput) {
18
+ for (const command of commands) {
19
+ if(command.name == commandInput.value){
20
+ return command.run()
21
22
23
24
25
function detectEnter(event,input) {
26
let keyCode = event.keyCode ? event.keyCode : e.which;
27
if(keyCode == 13) {
28
run(input)
- document.getElementById("shellinput").value = "";
29
30
0 commit comments