3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js">(function(){
\r
9 var lasts = ['Jones', 'Smith', 'Lee', 'Wilson', 'Black', 'Williams', 'Lewis', 'Johnson', 'Foot', 'Little', 'Vee', 'Train', 'Hot', 'Mutt'];
\r
10 var firsts = ['Fred', 'Julie', 'Bill', 'Ted', 'Jack', 'John', 'Mark', 'Mike', 'Chris', 'Bob', 'Travis', 'Kelly', 'Sara'];
\r
11 var lastLen = lasts.length, firstLen = firsts.length;
\r
13 Ext.ux.getRandomInt = function(min, max){
\r
14 return Math.floor(Math.random() * (max - min + 1)) + min;
\r
17 Ext.ux.generateName = function(){
\r
18 var name = firsts[Ext.ux.getRandomInt(0, firstLen-1)] + ' ' + lasts[Ext.ux.getRandomInt(0, lastLen-1)];
\r
19 if(Ext.ux.generateName.usedNames[name]){
\r
20 return Ext.ux.generateName();
\r
22 Ext.ux.generateName.usedNames[name] = true;
\r
25 Ext.ux.generateName.usedNames = {};
\r