Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Porter <slug@qwebirc.org>2011-02-19 04:27:47 (GMT)
committer Chris Porter <slug@qwebirc.org>2011-02-19 04:27:47 (GMT)
commit683650ccc08c1eda539f92a8eefc20dc26620e88 (patch)
tree9a990d823600b62c5c5a94486d381b67af36a7bf
parentd8d3cf34b62a7419103bcf004457a613042aeb63 (diff)
Limit number of lines per window to 1000.
-rw-r--r--js/ui/baseuiwindow.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/js/ui/baseuiwindow.js b/js/ui/baseuiwindow.js
index 8c2f73c..080d93c 100644
--- a/js/ui/baseuiwindow.js
+++ b/js/ui/baseuiwindow.js
@@ -3,6 +3,8 @@ qwebirc.ui.HILIGHT_ACTIVITY = 1;
qwebirc.ui.HILIGHT_SPEECH = 2;
qwebirc.ui.HILIGHT_US = 3;
+qwebirc.ui.MAXIMUM_LINES_PER_WINDOW = 1000;
+
qwebirc.ui.WINDOW_LASTLINE = qwebirc.ui.WINDOW_QUERY | qwebirc.ui.WINDOW_MESSAGES | qwebirc.ui.WINDOW_CHANNEL | qwebirc.ui.WINDOW_STATUS;
qwebirc.ui.Window = new Class({
@@ -182,6 +184,8 @@ qwebirc.ui.Window = new Class({
if($defined(element)) {
var sd = this.scrolledDown();
parent.appendChild(element);
+ if(parent.childNodes.length > qwebirc.ui.MAXIMUM_LINES_PER_WINDOW)
+ parent.removeChild(parent.firstChild);
if(sd) {
if(this.scrolltimer)
$clear(this.scrolltimer);