]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/ui/baseui.js
Whoops.
[irc/quakenet/qwebirc.git] / js / ui / baseui.js
index f90b9b6de2ec8709abefce023453d12d6260ce5c..838c21fd86d013a8bdf10562a06d7e4cd089fcfe 100644 (file)
@@ -66,7 +66,9 @@ var BaseUI = new Class({
         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]);
@@ -190,3 +192,17 @@ var UI = new Class({
     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);
+  }
+});