qwebirc.ui.QUI = new Class({
- Extends: qwebirc.ui.NewLoginUI,
+ Extends: qwebirc.ui.RootUI,
initialize: function(parentElement, theme, options) {
this.parent(parentElement, qwebirc.ui.QUI.Window, "qui", options);
this.theme = theme;
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();
},
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");