eagler-teavm-fork/samples/async/src/main/webapp/teavm/stdout.js

13 lines
441 B
JavaScript
Raw Normal View History

2015-03-08 04:13:25 -07:00
function $rt_putStdout(ch) {
if (ch == 0xA) {
var lineElem = document.createElement("div");
var stdoutElem = document.getElementById("stdout");
lineElem.appendChild(document.createTextNode($rt_stdoutBuffer));
stdoutElem.appendChild(lineElem);
$rt_stdoutBuffer = "";
stdoutElem.scrollTop = stdoutElem.scrollHeight;
} else {
$rt_stdoutBuffer += String.fromCharCode(ch);
}
}