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);
},
parent.appendChild(e);
e.addClass("menu");
+ var nickArray = [nick];
qwebirc.ui.MENU_ITEMS.forEach(function(x) {
- var text = x[0], fn = x[1], visible_fn = x[2];
-
- if(visible_fn == qwebirc.ui.menuitems.fns.always || visible_fn.apply(this)) {
- var e2 = new Element("a");
- e.appendChild(e2);
+ 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", "- " + text);
+ e2.href = "#";
+ e2.set("text", "- " + x.text);
- e2.addEvent("focus", function() { this.blur() }.bind(e2));
- e2.addEvent("click", function(ev) { new Event(ev.stop()); this.menuClick(fn); }.bind(this));
- }
+ e2.addEvent("focus", function() { this.blur() }.bind(e2));
+ 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));