Add nicklist manipulation (stage 1).
sound\r
padding\r
prettify wizard\r
-double click -> query\r
tab completion\r
options for notices and stuff\r
+noscript\r
+@+ in nick shown in text\r
+hilight in query bug fix
\ No newline at end of file
nickchanentry.prefixes = prefixes.join("");
},
+ stripPrefix: function(nick) {
+ var l = nick.charAt(0);
+ if(!l)
+ return nick;
+
+ if(this.prefixes.indexOf(l) != -1)
+ return nick.substring(1);
+
+ return nick;
+ },
removePrefix: function(nickchanentry, prefix) {
nickchanentry.prefixes = nickchanentry.prefixes.replaceAll(prefix, "");
},
}
return text.replace(arguments.callee.sRE, '\\$1');
+}
+
+qwebirc.ui.insertAt = function(position, parent, element) {
+ if(!parent.childNodes || (position >= parent.childNodes.length)) {
+ parent.appendChild(element);
+ } else {
+ parent.insertBefore(element, parent.childNodes[position]);
+ }
}
\ No newline at end of file
this.scrolltimer = null;
this.commandhistory = this.parentObject.commandhistory;
this.scrolleddown = true;
+ this.lastNickHash = {};
//new CommandHistory();
},
updateNickList: function(nicks) {
this.scrolltimer = null;
}
},
+ updateNickList: function(nicks) {
+ var nickHash = {};
+ var added = [];
+ var lnh = this.lastNickHash;
+
+ for(var i=0;i<nicks.length;i++) {
+ var n = nicks[i];
+ var l = lnh[n];
+ if(!l) {
+ l = this.nickListAdd(n, i);
+ if(!l)
+ l = 1;
+ }
+ nickHash[n] = l;
+ }
+
+ for(var k in lnh)
+ if(!nickHash[k])
+ this.nickListRemove(k, lnh[k]);
+
+ this.lastNickHash = nickHash;
+ },
+ nickListAdd: function(position, nick) {
+ },
+ nickListRemove: function(nick, stored) {
+ },
historyExec: function(line) {
this.commandhistory.addLine(line);
this.client.exec(line);
this.tab = new Element("a", {"href": "#"});
this.tab.addClass("tab");
+ this.tab.addEvent("focus", this.tab.blur);
parentObject.tabs.appendChild(this.tab);
this.tab.appendText(name);
this.close();
}.bind(this));
-
+
this.tab.appendChild(tabclose);
}
this.topic.set("html", " ");
this.parentObject.qjsui.applyClasses("topic", this.topic);
+ this.prevNick = null;
this.nicklist = new Element("div");
this.nicklist.addClass("nicklist");
this.nicklist.addClass("tab-invisible");
+ this.nicklist.addEvent("click", function(x) {
+ if(this.prevNick) {
+ this.prevNick.removeClass("selected");
+ this.prevNick = null;
+ }
+ }.bind(this));
this.parentObject.qjsui.applyClasses("nicklist", this.nicklist);
}
if(this.scrolleddown)
this.scrollToBottom();
},
- updateNickList: function(nicks) {
- this.parent(nicks);
+ nickListAdd: function(nick, position) {
+ var e = new Element("a");
+ qwebirc.ui.insertAt(position, this.nicklist, e);
- var n = this.nicklist;
- while(n.firstChild)
- n.removeChild(n.firstChild);
-
- nicks.each(function(nick) {
- var e = new Element("div");
- n.appendChild(e);
- e.appendChild(document.createTextNode(nick));
- });
+ e.href = "#";
+ e.appendChild(document.createTextNode(nick));
+
+ e.realNick = this.client.stripPrefix(nick);
+
+ e.addEvent("click", function(x) {
+ if(this.prevNick)
+ this.prevNick.removeClass("selected");
+ this.prevNick = e;
+ e.addClass("selected");
+ new Event(x).stop();
+ }.bind(this));
+ e.addEvent("dblclick", function(x) {
+ new Event(x).stop();
+ this.client.exec("/QUERY " + e.realNick);
+ }.bind(this));
+
+ e.addEvent("focus", e.blur);
+
+ return e;
+ },
+ nickListRemove: function(nick, stored) {
+ this.nicklist.removeChild(stored);
},
updateTopic: function(topic) {
var t = this.topic;
background: #f2f0ff;
}
-.qwebirc-qui .nicklist {
- border-left: 1px solid #c8d2dc;
- position: absolute;
- top: 0px;
- right: 0px;
- width: 125px;
- overflow: auto;
- background: #f2f0ff;
- color: black;
- font-family: Verdana, sans-serif;
- font-size: 0.7em;
-}
-
.qwebirc-qui .tabbar {
border-bottom: 1px solid #c3cee0;
background: #e2ecf9;
}
.qwebirc-qui .topic .emptytopic {
- color: grey;
+ color: gray;
}
.qwebirc-qui .topic {
- color: grey;
+ color: gray;
font-family: Verdana, sans-serif;
padding-left: 5px;
font-size: 0.7em;
.qwebirc-qui a.tab-hilight-us {
color: red;
}
+
+.qwebirc-qui .nicklist {
+ border-left: 1px solid #c8d2dc;
+ position: absolute;
+ top: 0px;
+ right: 0px;
+ width: 125px;
+ overflow: auto;
+ background: #f2f0ff;
+ color: black;
+ font-family: Verdana, sans-serif;
+ font-size: 0.7em;
+}
+
+.qwebirc-qui .nicklist a {
+ display: block;
+ color: black;
+ text-decoration: none;
+ cursor: default;
+ border-top: 1px solid #f2f0ff;
+ border-bottom: 1px solid #f2f0ff;
+ padding-left: 1px;
+}
+
+.qwebirc-qui .nicklist a.selected {
+ display: block;
+ color: black;
+ background: white;
+ text-decoration: none;
+ border-top: #c8d2dc 1px solid;
+ border-bottom: #c8d2dc 1px solid;
+ cursor: default;
+}
\ No newline at end of file