]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/ui/frontends/qui.js
Make our nick in our own messages bold.
[irc/quakenet/qwebirc.git] / js / ui / frontends / qui.js
index 4efc974ccd7e4e9ae9b405f18f07ab7c114b5988..8863808c41acb59f40976ff8123be0e52ab288be 100644 (file)
@@ -1,5 +1,5 @@
 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;
@@ -49,7 +49,8 @@ qwebirc.ui.QUI = new Class({
     
     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);
   },
@@ -146,6 +147,7 @@ qwebirc.ui.QUI = new Class({
     var inputbox = new Element("input");
     form.appendChild(inputbox);
     this.inputbox = inputbox;
+    this.inputbox.maxLength = 512;
     
     form.addEvent("submit", function(e) {
       new Event(e).stop();
@@ -384,6 +386,7 @@ qwebirc.ui.QUI.Window = new Class({
       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;
@@ -400,6 +403,20 @@ qwebirc.ui.QUI.Window = new Class({
       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();
   },
@@ -504,8 +521,10 @@ qwebirc.ui.QUI.Window = new Class({
       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");