document.addEvent("focus", focus);
window.addEvent("focus", focus);
}
+
+ qwebirc.util.__log = function(x) {
+ if(QWEBIRC_DEBUG) {
+ if(typeof console != "undefined")
+ console.log(x);
+ this.getActiveWindow().addLine(null, x);
+ }
+ }.bind(this);
},
newClient: function(client) {
client.id = String(this.clientId++);
client.hilightController = new qwebirc.ui.HilightController(client);
client.addEvent("signedOn", function() {
+ this.poller = new qwebirc.xdomain.Poller(this.oobMessage.bind(this));
this.fireEvent("signedOn", client);
}.bind(this));
this.windows.put(client.id, new QHash());
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("Connect", 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);
+ },
+ 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) {
this.windows.get(qwebirc.ui.CUSTOM_CLIENT).remove(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.put(windowName, d);
d.addEvent("close", function() {
this.tabCompleter.reset();
},
setModifiableStylesheet: function(name) {
- this.__styleSheet = new qwebirc.ui.style.ModifiableStylesheet(qwebirc.global.staticBaseURL + "css/" + name + qwebirc.FILE_SUFFIX + ".mcss");
+ this.__styleSheet = new qwebirc.ui.style.ModifiableStylesheet(qwebirc.global.staticBaseURL + "css/" + (QWEBIRC_DEBUG ? "debug/" : "") + name + qwebirc.FILE_SUFFIX + ".mcss");
this.setModifiableStylesheetValues({});
},
setModifiableStylesheetValues: function(values) {
}
});
-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("Connect", 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) {