tricked into getting themselves glined
*/
loginBox: function(callback, initialNickname, initialChannels, autoConnect, autoNick) {
- qwebirc.ui.GenericLoginBox(this.parentElement, callback, initialNickname, initialChannels, autoConnect, autoNick, this.options.networkName);
+ this.postInitialize();
+
+ this.addCustomWindow("Connection details", qwebirc.ui.ConnectPane, "connectpane", {
+ initialNickname: initialNickname, initialChannels: initialChannels, autoConnect: autoConnect, networkName: this.options.networkName, callback: callback, autoNick: autoNick
+ }, qwebirc.ui.WINDOW_CONNECT);
},
focusChange: function(newValue) {
var window_ = this.getActiveWindow();
if($defined(window_))
window_.focusChange(newValue);
+ },
+ signedOn: function() {
+ this.poller = new qwebirc.xdomain.Poller(this.oobMessage.bind(this));
+ },
+ oobMessage: function(message) {
+ var c = message.splitMax(" ", 2);
+ if(c.length != 2)
+ return;
+
+ var command = c[0];
+ if(command != "CMD")
+ return;
+
+ var d = c[1].splitMax(" ", 2);
+ if(d.length != 2)
+ return;
+
+ var command = d[0];
+ var args = d[1];
+ if(command == "SAY") {
+ var w = this.getActiveIRCWindow();
+ if($defined(w) && (w.type == qwebirc.ui.WINDOW_CHANNEL || w.type == qwebirc.ui.WINDOW_QUERY)) {
+ w.client.exec("/SAY " + args);
+ return;
+ }
+ }
}
});
newCustomWindow: function(name, select, type) {
if(!type)
type = qwebirc.ui.WINDOW_CUSTOM;
-
+
var w = this.newWindow(qwebirc.ui.CUSTOM_CLIENT, type, name);
w.addEvent("close", function(w) {
delete this.windows[qwebirc.ui.CUSTOM_CLIENT][w.identifier];
return w;
},
- addCustomWindow: function(windowName, class_, cssClass, options) {
+ addCustomWindow: function(windowName, class_, cssClass, options, type) {
if(!$defined(options))
options = {};
return;
}
- var d = this.newCustomWindow(windowName, true);
+ var d = this.newCustomWindow(windowName, true, type);
this.customWindows[windowName] = d;
d.addEvent("close", function() {
}
});
-qwebirc.ui.NewLoginUI = new Class({
- Extends: qwebirc.ui.NotificationUI,
- loginBox: function(callbackfn, initialNickname, initialChannels, autoConnect, autoNick) {
- this.postInitialize();
-
- /* I'd prefer something shorter and snappier! */
- var w = this.newCustomWindow("Connection details", true, qwebirc.ui.WINDOW_CONNECT);
- var callback = function(args) {
- w.close();
- callbackfn(args);
- };
-
- qwebirc.ui.GenericLoginBox(w.lines, callback, initialNickname, initialChannels, autoConnect, autoNick, this.options.networkName);
- }
-});
-
qwebirc.ui.QuakeNetUI = new Class({
- Extends: qwebirc.ui.NewLoginUI,
+ Extends: qwebirc.ui.NotificationUI,
urlDispatcher: function(name, window) {
if(name == "qwhois") {
return ["span", function(auth) {