]>
jfr.im git - irc/quakenet/qwebirc.git/blob - js/ui/baseui.js
5 var UIWindow
= new Class({
7 initialize: function(parentObject
, client
, type
, name
, identifier
) {
8 this.parentObject
= parentObject
;
13 this.identifier
= identifier
;
15 updateNickList: function(nicks
) {
17 updateTopic: function(topic
) {
20 this.parentObject
.__closed(this);
21 this.fireEvent("close", this);
25 this.parentObject
.__setActiveWindow(this);
27 deselect: function() {
30 addLine: function(type
, line
, colour
) {
32 errorMessage: function(message
) {
33 this.addLine("", message
, "red");
38 initialize: function(parentElement
, windowClass
, uiName
) {
40 this.windowArray
= [];
41 this.windowClass
= windowClass
;
42 this.parentElement
= parentElement
;
43 this.parentElement
.addClass("qwebirc");
44 this.parentElement
.addClass("qwebirc-" + uiName
);
46 newClient: function(client
) {
47 this.windows
[client
] = {}
48 var w
= this.newWindow(client
, WINDOW_STATUS
, "Status");
53 newWindow: function(client
, type
, name
) {
54 var identifier
= name
;
55 if(type
== WINDOW_STATUS
)
58 var w
= this.windows
[client
][identifier
] = new this.windowClass(this, client
, type
, name
, identifier
);
59 this.windowArray
.push(w
);
63 getActiveWindow: function() {
66 __setActiveWindow: function(window
) {
69 selectWindow: function(window
) {
71 this.active
.deselect();
72 window
.select(); /* calls setActiveWindow */
74 __closed: function(window
) {
76 this.active
= undefined;
77 if(this.windowArray
.length
== 1) {
78 this.windowArray
= [];
80 var index
= this.windowArray
.indexOf(window
);
82 this.selectWindow(this.windowArray
[1]);
84 this.selectWindow(this.windowArray
[index
- 1]);
87 this.windowArray
= this.windowArray
.erase(window
);
91 delete this.windows
[window
.client
][window
.identifier
];