]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/ui/baseuiwindow.js
Inheritance tidying + tidying!
[irc/quakenet/qwebirc.git] / js / ui / baseuiwindow.js
index bde4c4f5b4ab00bcbf7d6c7456d744981d8efc7d..84d337e366c5a4460773093a87e272ca768ec018 100644 (file)
@@ -19,10 +19,9 @@ qwebirc.ui.Window = new Class({
     this.scrollpos = null;
     this.lastNickHash = {};
     this.lastSelected = null;
+    this.subWindow = null;
     this.closed = false;
   },
-  updateNickList: function(nicks) {
-  },
   updateTopic: function(topic, element)  {
     qwebirc.ui.Colourise("[" + topic + "]", element, this.client.exec, this.parentObject.urlDispatcher.bind(this.parentObject), this);
   },
@@ -37,16 +36,26 @@ qwebirc.ui.Window = new Class({
     this.parentObject.__closed(this);
     this.fireEvent("close", this);
   },
+  subEvent: function(event) {
+    if($defined(this.subWindow))
+      this.subWindow.fireEvent(event);
+  },
+  setSubWindow: function(window) {
+    this.subWindow = window;
+  },
   select: function() {
     this.active = true;
     this.parentObject.__setActiveWindow(this);
     if(this.hilighted)
       this.setHilighted(qwebirc.ui.HILIGHT_NONE);
-      
+
+    this.subEvent("select");      
     this.resetScrollPos();
     this.lastSelected = new Date();
   },
   deselect: function() {
+    this.subEvent("deselect");
+    
     this.setScrollPos();
     if($defined(this.scrolltimer)) {
       $clear(this.scrolltimer);
@@ -104,10 +113,10 @@ qwebirc.ui.Window = new Class({
     this.scrollAdd(element);
   },
   errorMessage: function(message) {
-    this.addLine("", message, "#FF6347");
+    this.addLine("", message, "warncolour");
   },
   infoMessage: function(message) {
-    this.addLine("", message, "#87CEFA");
+    this.addLine("", message, "infocolour");
   },
   setHilighted: function(state) {
     if(state == qwebirc.ui.HILIGHT_NONE || state >= this.hilighted)
@@ -137,6 +146,9 @@ qwebirc.ui.Window = new Class({
     return scrollparent;
   },
   scrollToBottom: function() {
+    if(this.type == qwebirc.ui.WINDOW_CUSTOM || this.type == qwebirc.ui.WINDOW_CONNECT)
+      return;
+
     var parent = this.lines;
     var scrollparent = this.getScrollParent();
       
@@ -191,5 +203,5 @@ qwebirc.ui.Window = new Class({
   historyExec: function(line) {
     this.commandhistory.addLine(line);
     this.client.exec(line);
-  }
+  }  
 });