chat buffer limitation

This commit is contained in:
Rodolphe Breard 2012-12-18 18:55:34 +01:00
parent 009ae6647c
commit 4ec46f463b

View file

@ -125,8 +125,16 @@ Tab.prototype.setActive = function() {
this.el_lst.classList.add("tab-active");
}
Tab.prototype.flushText = function() {
var str = this.chat_log.innerHTML, sep = "<br>", t = str.split(sep);
if (t.length > 1000) {
this.chat_log.innerHTML = str.substring(str.indexOf(sep) + sep.length);
}
};
Tab.prototype.appendText = function(text) {
// TODO: flush text
this.flushText();
this.chat_log.innerHTML += text;
this.chat_log.scrollTop = 42000;
};