this.input = this.qjsui.bottom;
this.reflow = this.qjsui.reflow.bind(this.qjsui);
-
- this.tabs.addEvent("mousewheel", function(x) {
- if(this.sideTabs)
- return;
+ var scrollHandler = function(x) {
var event = new Event(x);
+ var up, down;
+ if(this.sideTabs) {
+ var p = this.qjsui.left;
+
+ /* don't scroll if we're scrollable */
+ if(p.getScrollSize().y > p.clientHeight)
+ return;
+
+ up = event.wheel < 0;
+ down = event.wheel > 0;
+ } else {
+ up = event.wheel > 0;
+ down = event.wheel < 0;
+ }
- /* up */
- if(event.wheel > 0) {
+ if(up) {
this.nextWindow();
- } else if(event.wheel < 0) {
- /* down */
+ } else if(down) {
this.prevWindow();
}
event.stop();
- }.bind(this));
-
+ }.bind(this);
+ this.qjsui.left.addEvent("mousewheel", scrollHandler);
+ this.qjsui.top.addEvent("mousewheel", scrollHandler);
+
this.createInput();
this.reflow();
this.reflow.delay(100); /* Konqueror fix */
new Event(e).stop();
sendInput();
});
-
- inputbox.addEvent("focus", this.resetTabComplete.bind(this));
- inputbox.addEvent("mousedown", this.resetTabComplete.bind(this));
-
+
+ var reset = this.resetTabComplete.bind(this);
+ inputbox.addEvent("focus", reset);
+ inputbox.addEvent("mousedown", reset);
+ inputbox.addEvent("keypress", reset);
+
inputbox.addEvent("keydown", function(e) {
var resultfn;
var cvalue = inputbox.value;
-
- if(e.key == "up") {
+
+ if(e.alt || e.control || e.meta)
+ return;
+
+ if(e.key == "up" && !e.shift) {
resultfn = this.commandhistory.upLine;
- } else if(e.key == "down") {
+ } else if(e.key == "down" && !e.shift) {
resultfn = this.commandhistory.downLine;
- } else if(e.key == "tab" && !e.altKey && !e.ctrlKey && !e.shiftKey) {
+ } else if(e.key == "tab") {
+ this.tabComplete(inputbox, e.shift);
+
new Event(e).stop();
- this.tabComplete(inputbox);
+ e.preventDefault();
return;
} else {
- /* ideally alt and other keys wouldn't break this */
- this.resetTabComplete();
return;
}
var result = resultfn.bind(this.commandhistory)();
new Event(e).stop();
+ e.preventDefault();
+
if(!result)
result = "";
this.lastcvalue = result;
var docsize = this.sizer.getSize();
var mheight = (docsize.y - topsize.y - bottomsize.y - topicsize.y);
- var mwidth = (docsize.x - rightsize.x);
+ var mwidth = (docsize.x - rightsize.x - leftsize.x);
left.setStyle("top", topsize.y);
topic.setStyle("top", topsize.y);
topic.setStyle("left", leftsize.x);
+ topic.setStyle("width", docsize.x - leftsize.x);
middle.setStyle("top", (topsize.y + topicsize.y));
middle.setStyle("left", leftsize.x);
initialize: function(parentObject, client, type, name, identifier) {
this.parent(parentObject, client, type, name, identifier);
- this.tab = new Element("a", {"href": "#"});
+ this.tab = new Element("a");
this.tab.addClass("tab");
this.tab.addEvent("focus", function() { this.blur() }.bind(this.tab));;
this.scrollpos = this.getScrollParent().getScroll();
}.bind(this));
- if(type == qwebirc.ui.WINDOW_CHANNEL) {
+ if(type == qwebirc.ui.WINDOW_CHANNEL || type == qwebirc.ui.WINDOW_QUERY) {
this.topic = new Element("div");
this.parentObject.qjsui.applyClasses("topic", this.topic);
this.topic.addClass("topic");
this.topic.set("html", " ");
this.topic.addEvent("dblclick", this.editTopic.bind(this));
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", this.removePrevMenu.bind(this));
this.parentObject.qjsui.applyClasses("right", this.nicklist);
+
+ this.updateTopic("");
}
- if(type == qwebirc.ui.WINDOW_CHANNEL)
- this.updateTopic("");
-
this.nicksColoured = this.parentObject.uiOptions.NICK_COLOURS;
this.reflow();
},
rename: function(name) {
- this.tab.replaceChild(document.createTextNode(name), this.tab.firstChild);
+ var newNode = document.createTextNode(name);
+ if(this.parentObject.sideTabs) {
+ this.tab.replaceChild(newNode, this.tab.childNodes[1]);
+ } else {
+ this.tab.replaceChild(newNode, this.tab.firstChild);
+ }
+
+ if(this.type == qwebirc.ui.WINDOW_QUERY)
+ this.updateTopic("");
},
editTopic: function() {
+ if(this.type != qwebirc.ui.WINDOW_CHANNEL)
+ return;
+
if(!this.client.nickOnChanHasPrefix(this.client.nickname, this.name, "@")) {
/* var cmodes = this.client.getChannelModes(channel);
if(cmodes.indexOf("t")) {*/
var e2 = new Element("a");
e.appendChild(e2);
- e2.href = "#";
e2.set("text", "- " + x.text);
e2.addEvent("focus", function() { this.blur() }.bind(e2));
var e = new Element("a");
qwebirc.ui.insertAt(position, this.nicklist, e);
-
- e.href = "#";
var span = new Element("span");
if(this.parentObject.uiOptions.NICK_COLOURS) {
var colour = realNick.toHSBColour(this.client);
while(t.firstChild)
t.removeChild(t.firstChild);
- if(topic) {
- t.topicText = topic;
- this.parent(topic, t);
+ var suffix;
+ if(this.type == qwebirc.ui.WINDOW_CHANNEL) {
+ suffix = ": ";
} else {
+ suffix = "";
+ }
+ qwebirc.ui.Colourise(this.name + suffix, t, null, null, this);
+
+ if(this.type == qwebirc.ui.WINDOW_CHANNEL) {
t.topicText = topic;
- var e = new Element("div");
- e.set("text", "(no topic set)");
- e.addClass("emptytopic");
- t.appendChild(e);
+ if (topic) {
+ this.parent(topic, t);
+ } else {
+ t.appendChild(document.createTextNode("(no topic set)"));
+ }
}
+
this.reflow();
},
select: function() {