var WINDOW_STATUS = 1;
var WINDOW_QUERY = 2;
var WINDOW_CHANNEL = 3;
+var WINDOW_CUSTOM = 4;
+var WINDOW_CONNECT = 5;
+var CUSTOM_CLIENT = "custom";
var BaseUI = new Class({
Implements: [Events, Options],
this.setOptions(options);
this.windows = {};
+ this.windows[CUSTOM_CLIENT] = {};
this.windowArray = [];
this.windowClass = windowClass;
this.parentElement = parentElement;
this.windowArray = [];
} else {
var index = this.windowArray.indexOf(window);
- if(index == 0) {
+ if(index == -1) {
+ return;
+ } else if(index == 0) {
this.selectWindow(this.windowArray[1]);
} else {
this.selectWindow(this.windowArray[index - 1]);
this.selectWindow(this.windowArray[number]);
}
}.bind(this));
+ },
+ newCustomWindow: function(name, select, type) {
+ if(!type)
+ type = WINDOW_CUSTOM;
+
+ var w = this.newWindow(CUSTOM_CLIENT, type, name);
+ w.addEvent("close", function(w) {
+ delete this.windows[name];
+ }.bind(this));
+
+ if(select)
+ this.selectWindow(w);
+
+ return w;
+ },
+ embeddedWindow: function() {
+ if(this.embedded) {
+ this.selectWindow(this.embedded)
+ return;
+ }
+
+ this.embedded = this.newCustomWindow("Embedded wizard", true);
+ this.embedded.addEvent("close", function() {
+ this.embedded = null;
+ }.bind(this));
+
+ var ew = new WebmasterGuide({parent: this.embedded.lines});
+ ew.addEvent("close", function() {
+ this.embedded.close();
+ }.bind(this));
+ },
+ urlDispatcher: function(name) {
+ if(name == "embedded")
+ return this.embeddedWindow.bind(this);
+
+ return null;
+ }
+});
+
+var NewLoginUI = new Class({
+ Extends: UI,
+ loginBox: function(callbackfn, initialNickname, initialChannels, autoConnect, autoNick) {
+ this.postInitialize();
+ var w = this.newCustomWindow("Connect", true, WINDOW_CONNECT);
+ var callback = function(args) {
+ w.close();
+ callbackfn(args);
+ };
+
+ GenericLoginBox(w.lines, callback, initialNickname, initialChannels, autoConnect, autoNick);
}
});