more bashing
This commit is contained in:
@@ -828,19 +828,22 @@ function bash_data(data) {
|
||||
if (data.type=='done') {
|
||||
$("#screen").append('<span class="'+data.type+'">\nDONE</span>');
|
||||
} else {
|
||||
var done = false;
|
||||
var buff = "";
|
||||
console.log("ASCII: ", ascii(data.text));
|
||||
if (data.text.length==1) {
|
||||
switch (data.text.charCodeAt(0)) {
|
||||
for (var i=0; i<data.text.length; ++i) {
|
||||
switch (data.text.charCodeAt(i)) {
|
||||
case 7:
|
||||
$('#screen').text(function (_,txt) {
|
||||
case 8:
|
||||
if (buff.length) $("#screen").append(ansifilter(htmlenc(buff)));
|
||||
buff = "";
|
||||
$('#screen').html(function (_,txt) {
|
||||
return txt.slice(0, -1);
|
||||
});
|
||||
done = true;
|
||||
break;
|
||||
default: buff += data.text[i];
|
||||
}
|
||||
}
|
||||
if (!done) $("#screen").append(ansifilter(htmlenc(data.text)));
|
||||
if (buff.length) $("#screen").append(ansifilter(htmlenc(buff)));
|
||||
}
|
||||
$("#screen").animate({
|
||||
scrollTop: $("#screen").prop('scrollHeight')
|
||||
|
Reference in New Issue
Block a user