]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/ui/genericlogin.js
New favicon courtesy of meeb.
[irc/quakenet/qwebirc.git] / js / ui / genericlogin.js
index 3ff9af8d2d73c0a1ada31042346f85e4b96433eb..1cf4756c229887dd11ba8489561d1679be36ad80 100644 (file)
@@ -24,22 +24,20 @@ qwebirc.ui.ConfirmBox = function(parentElement, callback, initialNickname, initi
   var nick = new Element("b");
   nick.set("text", initialNickname);
   
-  var c = initialChannels.split(",");
-  var ctext;
+  var c = initialChannels.split(" ")[0].split(",");
   
-  if(c.length > 1) { 
-    var last = c.pop();
-    ctext = c.join(", ") + " and " + last;
-  } else {
-    ctext = c.join(", ");
+  text.appendChild(document.createTextNode("To connect to IRC and join channel" + ((c.length>1)?"s":"") + " "));
+
+  for(var i=0;i<c.length;i++) {
+    if((c.length > 1) && (i == c.length - 1)) {
+      text.appendChild(document.createTextNode(" and "));
+    } else if(i > 0) {
+      text.appendChild(document.createTextNode(", "));
+    }
+    text.appendChild(new Element("b").set("text", c[i]));
+    
   }
   
-  var channels = new Element("b");
-  channels.set("text", ctext);
-  
-  text.appendChild(document.createTextNode("To connect to IRC and join channels "));
-  text.appendChild(channels);
-  
   if(!autoNick) {
     text.appendChild(document.createTextNode(" as "));
     text.appendChild(nick);
@@ -58,6 +56,7 @@ qwebirc.ui.ConfirmBox = function(parentElement, callback, initialNickname, initi
   
   var yes = new Element("input", {"type": "submit", "value": "Connect"});
   form.appendChild(yes);
+  yes.focus();
   
   form.addEvent("submit", function(e) {
     new Event(e).stop();