fix for spacing and replaced <br> with newlines

This commit is contained in:
Joshua Seigler 2014-12-24 14:35:30 -05:00
parent 3278f18d3f
commit cf2c398a12
3 changed files with 8 additions and 4 deletions

View file

@ -87,7 +87,7 @@ html, body {
font-size: 0.8em; font-size: 0.8em;
background-color: black; background-color: black;
} }
#commandLine { #commandLine, #history {
white-space: pre-wrap; white-space: pre-wrap;
} }
#command { #command {

View file

@ -13,7 +13,11 @@
<form><label id="compy"> <form><label id="compy">
<div id="screen"> <div id="screen">
<div id="scrollback"> <div id="scrollback">
<div id="history">i love u<br>-fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf<br><br></div> <div id="history">
i love u
-fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf
</div>
<input id="command" name="command" type="text" value="" /> <input id="command" name="command" type="text" value="" />
<div id="commandLine"><span id="ps1">a&gt;</span><span id="typing"></span></div> <div id="commandLine"><span id="ps1">a&gt;</span><span id="typing"></span></div>
</div> </div>

View file

@ -42,14 +42,14 @@
}; };
var showResponse = function (response) { var showResponse = function (response) {
commandHistory.innerHTML += response + '<br>'; commandHistory.innerHTML += response + '\n';
setInputEnabled(true); setInputEnabled(true);
}; };
var handleForm = function () { var handleForm = function () {
var val = this.command.value; var val = this.command.value;
setInputEnabled(false); setInputEnabled(false);
commandHistory.innerHTML += 'a&gt;' + escapeHTML(val) + '<br>'; commandHistory.innerHTML += 'a&gt;' + escapeHTML(val) + '\n';
setTimeout(function() { showResponse('Command not found.'); }, 500); setTimeout(function() { showResponse('Command not found.'); }, 500);
return false; return false;
}; };