]>
Commit | Line | Data |
---|---|---|
d65fe45f CP |
1 | var QWebIRCInterface = new Class({ |
2 | Implements: [Options], | |
3 | options: { | |
4 | initialNickname: "qwebirc" + Math.ceil(Math.random() * 100000), | |
5 | initialChannels: "", | |
6 | searchURL: false, | |
7 | theme: undefined | |
8 | }, | |
9 | initialize: function(element, ui, options) { | |
10 | this.setOptions(options); | |
11 | ||
12 | window.addEvent("domready", function() { | |
13 | var ui_ = new ui($(element), new Theme(this.options.theme)); | |
14 | ||
15 | if(this.options.searchURL) { | |
16 | /* TODO: look at URI and detect nickname/channels... */ | |
17 | } | |
18 | ||
19 | var details = ui_.loginBox(function(options) { | |
20 | var IRC = new IRCClient(options, ui_); | |
21 | IRC.connect(); | |
22 | window.addEvent("beforeunload", function() { | |
23 | IRC.quit("Page closed"); | |
24 | }); | |
25 | }, this.options.initialNickname, this.options.initialChannels); | |
26 | }.bind(this)); | |
27 | } | |
28 | }); |