]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/ui/uglyui.js
Rework old UI's to support custom/connect windows.
[irc/quakenet/qwebirc.git] / js / ui / uglyui.js
index de3e6a34971bf8983ebc4e666435cc0e5754590b..d2ebd51127a07b8d121007ee7b2e3045245c5df2 100644 (file)
@@ -41,7 +41,7 @@ var UglyUIWindow = new Class({
 
     parentObject.tabs.appendChild(this.tab);
     
-    if(type != WINDOW_STATUS) {
+    if(type != WINDOW_STATUS && type != WINDOW_CONNECT) {
       tabclose = new Element("span");
       tabclose.addClass("tabclose");
       tabclose.addEvent("click", function(e) {
@@ -85,6 +85,7 @@ var UglyUIWindow = new Class({
     this.outerContainer.removeClass("tab-invisible");
     this.tab.removeClass("tab-unselected");    
     this.tab.addClass("tab-selected");
+    this.parentObject.showInput(this.type != WINDOW_CONNECT && this.type != WINDOW_CUSTOM);
   },
   deselect: function() {
     this.parent();
@@ -125,7 +126,7 @@ var UglyUIWindow = new Class({
 });
 
 var UglyUI = new Class({
-  Extends: UI,
+  Extends: NewLoginUI,
   initialize: function(parentElement, theme) {
     this.parent(parentElement, UglyUIWindow, "uglyui");
     this.theme = theme;
@@ -143,6 +144,8 @@ var UglyUI = new Class({
     this.parentElement.appendChild(this.container);
   
     var form = new Element("form");
+    this.form = form;
+    
     var inputbox = new Element("input");
     inputbox.addClass("input");
   
@@ -156,11 +159,8 @@ var UglyUI = new Class({
     form.appendChild(inputbox);
     inputbox.focus();
   },
-  loginBox: function(callbackfn, intialNickname, initialChannels, autoConnect, autoNick) {
-    this.parent(function(options) {
-      this.postInitialize();
-      callbackfn(options);
-    }.bind(this), intialNickname, initialChannels, autoConnect, autoNick);
+  showInput: function(state) {
+    this.form.setStyle("display", state?"block":"none");
   }
 });