]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
. in nick now adds a random number.
authorChris Porter <redacted>
Mon, 2 Feb 2009 22:19:53 +0000 (22:19 +0000)
committerChris Porter <redacted>
Mon, 2 Feb 2009 22:19:53 +0000 (22:19 +0000)
js/qwebircinterface.js
js/ui/panes/embed.js

index 100ad19fd75b73ecac4f7c60dd9f5aad3138001e..9c9e088099fa3dab43b8dd372d3fa7bca0a37546 100644 (file)
@@ -54,8 +54,8 @@ qwebirc.ui.Interface = new Class({
         }
         
         if($defined(nick))
-          inick = nick;
-        
+          inick = this.randSub(nick);
+          
         if(args["randomnick"] && args["randomnick"] == 1)
           inick = this.options.initialNickname;
           
@@ -88,5 +88,17 @@ qwebirc.ui.Interface = new Class({
       
       var details = ui_.loginBox(callback, inick, ichans, autoConnect, usingAutoNick);
     }.bind(this));
+  },
+  randSub: function(nick) {
+    var getDigit = function() { return Math.floor(Math.random() * 10); }
+    
+    return nick.split("").map(function(v) {
+      if(v == ".") {
+        return getDigit();
+      } else {
+        return v;
+      }
+    }).join("");
+    
   }
 });
index 8e7a8c3f70564d89d80fde4aaf737a6ac04bf3b8..9d4867d0e834017eddb18d79e0e43f26e63b4175 100644 (file)
@@ -1,3 +1,4 @@
+/* NEEDS converting to plain HTML! */
 qwebirc.ui.EmbedWizardStep = new Class({
   Implements: [Options, Events],
   options: {
@@ -150,7 +151,7 @@ qwebirc.ui.EmbedWizard = new Class({
     this.nicknameBox.addClass("text");
     this.nickname = this.newStep({
       "title": "Set nickname",
-      "first": "Enter the nickname you would like the client to use by default:",
+      "first": "Enter the nickname you would like the client to use by default (use a . for a random number):",
       "premove": function() {
         if(this.nicknameBox.value == "") {
           alert("You must supply a nickname.");