]>
jfr.im git - irc/quakenet/qwebirc.git/blob - js/ui/uibase.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(windowClass
) {
40 this.windowArray
= [];
41 this.windowClass
= windowClass
;
43 newClient: function(client
) {
44 this.windows
[client
] = {}
45 var w
= this.newWindow(client
, WINDOW_STATUS
, "Status");
50 newWindow: function(client
, type
, name
) {
51 var identifier
= name
;
52 if(type
== WINDOW_STATUS
)
55 var w
= this.windows
[client
][identifier
] = new this.windowClass(this, client
, type
, name
, identifier
);
56 this.windowArray
.push(w
);
60 getActiveWindow: function() {
63 __setActiveWindow: function(window
) {
66 selectWindow: function(window
) {
68 this.active
.deselect();
69 window
.select(); /* calls setActiveWindow */
71 __closed: function(window
) {
73 this.active
= undefined;
74 if(this.windowArray
.length
== 1) {
75 this.windowArray
= [];
77 var index
= this.windowArray
.indexOf(window
);
79 this.selectWindow(this.windowArray
[1]);
81 this.selectWindow(this.windowArray
[index
- 1]);
84 this.windowArray
= this.windowArray
.erase(window
);
88 delete this.windows
[window
.client
][window
.identifier
];