this.parent();
this.outerContainer.removeClass("tab-invisible");
- this.tab.removeClass("tab-unselected");
- this.tab.removeClass("tab-highlighted");
+ this.tab.removeClass("tab-unselected");
this.tab.addClass("tab-selected");
},
deselect: function() {
this.parentObject.tabs.removeChild(this.tab);
},
addLine: function(type, line, colour) {
- this.parent(type, line, colour);
-
var e = new Element("div");
if(colour) {
- e.addStyle("background", colour);
+ e.setStyles({"background": colour});
} else if(this.lastcolour) {
e.addClass("linestyle1");
} else {
e.addClass("linestyle2");
}
-
- if(type)
- line = this.parentObject.theme.message(type, line);
-
- Colourise(IRCTimestamp(new Date()) + " " + line, e);
-
this.lastcolour = !this.lastcolour;
- var prev = this.lines.getScroll();
- var prevbottom = this.lines.getScrollSize().y;
- var prevsize = this.lines.getSize();
- this.lines.appendChild(e);
+ this.parent(type, line, colour, e);
+ },
+ setHilighted: function(state) {
+ this.parent(state);
- if(prev.y + prevsize.y == prevbottom)
- this.lines.scrollTo(prev.x, this.lines.getScrollSize().y);
-
- if(!this.active)
+ if(state) {
this.tab.addClass("tab-highlighted");
+ } else {
+ this.tab.removeClass("tab-highlighted");
+ }
}
});
Extends: UI,
initialize: function(parentElement, theme) {
this.parent(parentElement, UglyUIWindow, "uglyui");
-
this.theme = theme;
-
+ this.parentElement = parentElement;
+ },
+ postInitialize: function() {
this.tabs = new Element("div");
this.tabs.addClass("tabbar");
- parentElement.appendChild(this.tabs);
+ this.parentElement.appendChild(this.tabs);
this.container = new Element("div");
this.container.addClass("container");
- parentElement.appendChild(this.container);
+ this.parentElement.appendChild(this.container);
var form = new Element("form");
var inputbox = new Element("input");
this.getActiveWindow().client.exec(inputbox.value);
inputbox.value = "";
}.bind(this));
- parentElement.appendChild(form);
+ this.parentElement.appendChild(form);
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);
}
-});
\ No newline at end of file
+});
+