Commits

Alexander Nordlund  committed 302a1e0

Cleaning up.

  • Participants
  • Parent commits 052751c

Comments (0)

Files changed (1)

File terminal.html

     //console.log(e.which);
     if (e.which == 13) { 
         //document.getElementById('terminal2').value +=document.getElementById('terminal').value+"\n";
-        enteredCommands.push(document.getElementById('terminal').value.split("\n").slice(-1)[0]);
+        enteredCommands.push(this.value.split("\n").slice(-1)[0]);
     } else if (e.which == 38 || e.which == 40) {
         //console.log(enteredCommands)
         e.preventDefault();
     } else if (e.which == 85) {
         console.log(enteredCommands);
     } else if (e.which == 73) {
-        console.log(document.getElementById('terminal').value.slice(-1)[0]);
+        console.log(this.value[this.value.length-1]);
         e.preventDefault();
         return false;
     } else {
 
 </script>
 </head>
-<body >
-		
+<body>
+
 <p>&nbsp;</p>
 <p>&nbsp;</p>
-	<div align="center">
-		<textarea id="terminal" rows="10" cols="80" wrap="soft"></textarea>
-                <br><textarea id="terminal2" rows="1"></textarea>
-	</div>
-
+    <div align="center">
+        <textarea id="terminal" rows="10" cols="80" wrap="soft"></textarea>
+    </div>
 </body>
 </html>