From: Chris Porter Date: Mon, 22 Jun 2009 00:15:25 +0000 (+0100) Subject: Add last position indicator (fixes issue 16). X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/commitdiff_plain/5c0b5a6e71671b2b24a4d595a512a0fa137caca5 Add last position indicator (fixes issue 16). --- diff --git a/css/qui.css b/css/qui.css index 6fd9086..6c30683 100644 --- a/css/qui.css +++ b/css/qui.css @@ -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; +} diff --git a/js/ui/baseuiwindow.js b/js/ui/baseuiwindow.js index e9a448b..90e8b0f 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.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() { diff --git a/js/ui/panes/options.js b/js/ui/panes/options.js index 6504313..e06e991 100644 --- a/js/ui/panes/options.js +++ b/js/ui/panes/options.js @@ -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;