chat buffer limitation
This commit is contained in:
parent
009ae6647c
commit
4ec46f463b
1 changed files with 9 additions and 1 deletions
|
@ -125,8 +125,16 @@ Tab.prototype.setActive = function() {
|
||||||
this.el_lst.classList.add("tab-active");
|
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) {
|
Tab.prototype.appendText = function(text) {
|
||||||
// TODO: flush text
|
this.flushText();
|
||||||
this.chat_log.innerHTML += text;
|
this.chat_log.innerHTML += text;
|
||||||
this.chat_log.scrollTop = 42000;
|
this.chat_log.scrollTop = 42000;
|
||||||
};
|
};
|
||||||
|
|
Reference in a new issue