]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Add last position indicator (fixes issue 16).
authorChris Porter <redacted>
Mon, 22 Jun 2009 00:15:25 +0000 (01:15 +0100)
committerChris Porter <redacted>
Mon, 22 Jun 2009 00:15:25 +0000 (01:15 +0100)
css/qui.css
js/ui/baseuiwindow.js
js/ui/panes/options.js

index 6fd9086cfefbec4603304e295272da8c0111774c..6c3068315719222dd9b4f77e23598144f13e5c96 100644 (file)
@@ -259,3 +259,10 @@ div#noscript {
   white-space: nowrap;
   font-size: 0.7em;
 }
+
+.qwebirc-qui hr.lastpos {
+  border: none;
+  border-top: 1px solid #C8D2DC;
+  margin-left: 3em;
+  margin-right: 3em;
+}
index e9a448bae5107f6369d60f0331320ee568855597..90e8b0f244db900a5ac5924da4379d18eac3e678 100644 (file)
@@ -3,6 +3,8 @@ qwebirc.ui.HILIGHT_ACTIVITY = 1;
 qwebirc.ui.HILIGHT_SPEECH = 2;
 qwebirc.ui.HILIGHT_US = 3;
 
+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({
   Implements: [Events],
   initialize: function(parentObject, client, type, name, identifier) {
@@ -21,6 +23,12 @@ qwebirc.ui.Window = new Class({
     this.lastSelected = null;
     this.subWindow = null;
     this.closed = false;
+    
+    if(this.type & qwebirc.ui.WINDOW_LASTLINE) {
+      this.lastPositionLine = new Element("hr");
+      this.lastPositionLine.addClass("lastpos");
+      this.lastPositionLineInserted = false;
+    }
   },
   updateTopic: function(topic, element)  {
     qwebirc.ui.Colourise("[" + topic + "]", element, this.client.exec, this.parentObject.urlDispatcher.bind(this.parentObject), this);
@@ -44,6 +52,11 @@ qwebirc.ui.Window = new Class({
     this.subWindow = window;
   },
   select: function() {
+    if(this.lastPositionLineInserted && !this.parentObject.uiOptions.LASTPOS_LINE) {
+      this.lines.removeChild(this.lastPositionLine);
+      this.lastPositionLineInserted = false;
+    }
+  
     this.active = true;
     this.parentObject.__setActiveWindow(this);
     if(this.hilighted)
@@ -62,6 +75,16 @@ qwebirc.ui.Window = new Class({
       this.scrolltimer = null;
     }
 
+    if(this.type & qwebirc.ui.WINDOW_LASTLINE) {
+      if(this.lastPositionLineInserted)
+        this.lines.removeChild(this.lastPositionLine);
+      
+      if(this.parentObject.uiOptions.LASTPOS_LINE)
+        this.lines.appendChild(this.lastPositionLine);
+     
+      this.lastPositionLineInserted = this.parentObject.uiOptions.LASTPOS_LINE;
+    }
+    
     this.active = false;
   },
   resetScrollPos: function() {
index 65043132777bab442dce54bb3f577634835d4c16..e06e99108bc06bb374bb2e2e5ae5f306ce98efb7 100644 (file)
@@ -30,7 +30,8 @@ qwebirc.config.DEFAULT_OPTIONS = [
   [4, "DEDICATED_NOTICE_WINDOW", "Send notices to dedicated message window", false],
   [3, "NICK_OV_STATUS", "Show status (@/+) before nicknames in nicklist", true],
   [5, "ACCEPT_SERVICE_INVITES", "Automatically join channels when invited by Q", true],
-  [6, "USE_HIDDENHOST", "Hide your hostmask when authed to Q (+x)", true]
+  [6, "USE_HIDDENHOST", "Hide your hostmask when authed to Q (+x)", true],
+  [8, "LASTPOS_LINE", "Show a last position indicator for each window.", true]
 ];
 
 qwebirc.config.DefaultOptions = null;