]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Limit number of lines per window to 1000.
authorChris Porter <redacted>
Sat, 19 Feb 2011 04:27:47 +0000 (04:27 +0000)
committerChris Porter <redacted>
Sat, 19 Feb 2011 04:27:47 +0000 (04:27 +0000)
js/ui/baseuiwindow.js

index 8c2f73c5d392944184d952220858f16b1e8109be..080d93ce0f548acf535192f7d1b3befd3cd3a795 100644 (file)
@@ -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);