Web · Wiki · Activities · Blog · Lists · Chat · Meeting · Bugs · Git · Translate · Archive · People · Donate

Commit 1b8b44a743725dc0978cb60f089ce7743f3db2f1

Predefined list of channels and languages not only on login screen
  
196196 cmd_BEEP: [false, undefined, undefined, function(args) {
197197 this.parentObject.ui.beep();
198198 }],
199 cmd_AUTOJOIN: [false, undefined, undefined, function(args) {
200 var channel = this.parentObject.options.autojoin;
201 var lang = this.parentObject.options.language;
199 cmd_LINGVOJOIN: [false, 2, 0, function(args) {
200 var channel = args[0];
201 var lang = args[1];
202202
203 if (lang) {
203 if (lang != "default") {
204204 if (!this.send("PRIVMSG " + qwebirc.global.lingva_bot + " : lingvo join --silent " + channel + " " + lang))
205205 return;
206206 channel += "-" + lang;
207207 }
208208
209209 return ["JOIN", channel];
210 }],
211 cmd_AUTOJOIN: [false, undefined, undefined, function(args) {
212 var channel = this.parentObject.options.autojoin;
213 var lang = this.parentObject.options.language;
214 return ["LINGVOJOIN", channel + " " + lang];
210215 }],
211216 cmd_CLEAR: [false, undefined, undefined, function(args) {
212217 var w = this.getActiveWindow().lines;
  
2424 staticBaseURL: "/"
2525 },
2626 initialize: function(element, ui, options) {
27 qwebirc.global = {dynamicBaseURL: options.dynamicBaseURL, staticBaseURL: options.staticBaseURL, channels: options.channels, languages: options.languages, lingva_bot: options.lingva_bot}; /* HACK */
27 qwebirc.global = {dynamicBaseURL: options.dynamicBaseURL, staticBaseURL: options.staticBaseURL, channels: options.channels, languages: options.languages, lingva_bot: options.lingva_bot, irc: null}; /* HACK */
2828
2929 this.setOptions(options);
3030
3131 window.addEvent("domready", function() {
3232 var callback = function(options) {
3333 var IRC = new qwebirc.irc.IRCClient(options, ui_);
34
35 qwebirc.global.irc = IRC;
36
37 this.navi_channel.selectedIndex = options["channel_index"];
38 this.navi_language.selectedIndex = options["language_index"];
39 this.navi_bar.setStyle("display", "block");
40 this.navi_join.setStyle("display", "block");
41
3442 IRC.connect();
3543 window.onbeforeunload = qwebirc_ui_onbeforeunload;
3644 window.addEvent("unload", function() {
  
5454
5555 /* HACK, in Chrome this should work immediately but doesn't */
5656 this.__createDropdownHint.delay(100, this);
57
58 this.__createNaviBar();
5759 },
60
61 __createNaviBar: function() {
62 var navi_item_props = {
63 "class": "dropdownmenu",
64 "styles": {
65 "height": "1.6em",
66 "margin-right": "4px",
67 "position": "static",
68 },
69 };
70
71 self.navi_channel = new Element("select", navi_item_props);
72 for (var i = 0, channel; channel = qwebirc.global.channels[i]; i++)
73 self.navi_channel.grab(new Element("option", {id: channel[1], text: channel[1]}));
74
75 self.navi_language = new Element("select", navi_item_props);
76 self.navi_language.grab(new Element("option", {id: "default", text: "Default"}));
77 for (var i = 0, lang; lang = qwebirc.global.languages[i]; i++)
78 self.navi_language.grab(new Element("option", {id: lang[0], text: lang[1]}));
79
80 var join_button = new Element("button", navi_item_props);
81 join_button.set("text", "Join");
82
83 var navi_div_props = {
84 "styles": {
85 "display": "none",
86 "float": "right",
87 "margin-top": "2px",
88 },
89 };
90
91 self.navi_join = new Element("div", navi_div_props);
92 self.navi_join.appendChild(join_button);
93 this.tabs.appendChild(self.navi_join);
94
95 self.navi_bar = new Element("div", navi_div_props);
96 self.navi_bar.appendChild(self.navi_channel);
97 self.navi_bar.appendChild(self.navi_language);
98 this.tabs.appendChild(self.navi_bar);
99
100 join_button.addEvent("click", function() {
101 var channel = self.navi_channel[self.navi_channel.selectedIndex].value;
102 var lang = self.navi_language[self.navi_language.selectedIndex].id;
103 qwebirc.global.irc.exec("/LINGVOJOIN " + channel + " " + lang);
104 })
105 },
106
58107 __createDropdownMenu: function() {
59108 var dropdownMenu = new Element("span");
60109 dropdownMenu.addClass("dropdownmenu");
  
170170 var row = createRow("Channel:", chan_list);
171171
172172 var lang_list = new Element("select");
173 lang_list.grab(new Element("option", {id: "", text: "Default"}));
173 lang_list.grab(new Element("option", {id: "default", text: "Default"}));
174174 for (var i = 0, lang; lang = qwebirc.global.languages[i]; i++)
175175 lang_list.grab(new Element("option", {id: lang[0], text: lang[1]}));
176176 createRow("Language:", lang_list);
217217 return;
218218 }
219219
220 var data = {"nickname": nickname, "autojoin": chans, "language": language};
220 var data = {"nickname": nickname, "autojoin": chans, "language": language, "channel_index": chan_list.selectedIndex, "language_index": lang_list.selectedIndex };
221221 if(qwebirc.auth.enabled()) {
222222 if(qwebirc.auth.passAuth() && authCheckBox.checked) {
223223 if(!usernameBox.value || !passwordBox.value) {