this.createInput();
this.reflow();
-
+ this.reflow.delay(100); /* Konqueror fix */
+
/* HACK, in Chrome this should work immediately but doesn't */
this.__createDropdownHint.delay(100, this);
},
var inputbox = new Element("input");
form.appendChild(inputbox);
this.inputbox = inputbox;
+ this.inputbox.maxLength = 512;
form.addEvent("submit", function(e) {
new Event(e).stop();
this.topic.addClass("topic");
this.topic.addClass("tab-invisible");
this.topic.set("html", " ");
+ this.topic.addEvent("click", this.editTopic.bind(this));
this.parentObject.qjsui.applyClasses("topic", this.topic);
this.prevNick = null;
this.reflow();
}
},
+ editTopic: function() {
+ if(!this.client.nickOnChanHasPrefix(this.client.nickname, this.name, "@")) {
+/* var cmodes = this.client.getChannelModes(channel);
+ if(cmodes.indexOf("t")) {*/
+ alert("Sorry, you need to be opped to change the topic!");
+ return;
+ /*}*/
+ }
+ var newTopic = prompt("Change topic of " + this.name + " to:", this.topic.topicText);
+ if(newTopic === null)
+ return;
+
+ this.client.exec("/TOPIC " + newTopic);
+ },
reflow: function() {
this.parentObject.reflow();
},
parent.appendChild(e);
e.addClass("menu");
+ var nickArray = [nick];
qwebirc.ui.MENU_ITEMS.forEach(function(x) {
+ if(!x.predicate || x.predicate !== true && !x.predicate.apply(this, nickArray))
+ return;
+
var e2 = new Element("a");
e.appendChild(e2);
-
+
e2.href = "#";
- e2.set("text", "- " + x[0]);
-
+ e2.set("text", "- " + x.text);
+
e2.addEvent("focus", function() { this.blur() }.bind(e2));
- e2.addEvent("click", function(ev) { new Event(ev.stop()); this.menuClick(x[1]); }.bind(this));
+ e2.addEvent("click", function(ev) { new Event(ev.stop()); this.menuClick(x.fn); }.bind(this));
}.bind(this));
return e;
},
this.prevNick = e;
e.addClass("selected");
this.moveMenuClass();
- e.menu = this.createMenu(x.realNick, e);
+ e.menu = this.createMenu(e.realNick, e);
new Event(x).stop();
}.bind(this));
t.removeChild(t.firstChild);
if(topic) {
+ t.topicText = topic;
this.parent(topic, t);
} else {
+ t.topicText = topic;
var e = new Element("div");
e.set("text", "(no topic set)");
e.addClass("emptytopic");