From b22074751d4a723f5bc1428ef8b06288e3df8cda Mon Sep 17 00:00:00 2001 From: Matthew Walsh Date: Sun, 31 Aug 2014 21:25:55 -0400 Subject: [PATCH] Cleanup, v1.0 --- Gruntfile.coffee | 5 +- dist/asciibots.js | 230 ++++++++++++++++------------------ dist/asciibots.min.js | 2 +- dist/jquery/asciibots.js | 235 +++++++++++++++++------------------ dist/jquery/asciibots.min.js | 2 +- package.json | 2 +- src/idhelper.js | 41 +++--- src/jquery-intro.js | 14 +-- src/shared.js | 34 +++-- src/vanilla-intro.js | 3 +- src/vanilla-outro.js | 8 +- www/dl/asciibots.zip | Bin 3711 -> 3747 bytes www/dl/jquery/asciibots.zip | Bin 3784 -> 3827 bytes www/js/asciibots.js | 230 ++++++++++++++++------------------ www/js/jquery/asciibots.js | 235 +++++++++++++++++------------------ 15 files changed, 496 insertions(+), 545 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 1234ff8..d711587 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -8,8 +8,7 @@ module.exports = -> /*! <%= package.name %> - v<%= package.version %> - <%= grunt.template.today('yyyy-mm-dd') %> \ ** https://<%= package.homepage %> \ ** Copyright (c) <%= grunt.template.today('yyyy') %> <%= package.author %>; Licensed under <%= package.license %> license. */\ - \ - + """ convert: @@ -41,7 +40,7 @@ module.exports = -> options: js: indentChar: " " - indentSize: 2 + indentSize: 4 jshint: dist: ['dist/asciibots.js', 'dist/jquery/asciibots.js'] diff --git a/dist/asciibots.js b/dist/asciibots.js index 4a46bf8..987bfd8 100644 --- a/dist/asciibots.js +++ b/dist/asciibots.js @@ -1,124 +1,114 @@ -/*! asciibots.js - v0.9 - 2014-08-21 +/*! asciibots.js - v1.0 - 2014-08-31 ** https://walsh9.github.io/asciibots ** Copyright (c) 2014 Matthew Walsh; Licensed under MIT license. */ - var Asciibots = (function() { - - robots = { - "templates": { - "0": " ___T_ \n | o o | \n |__-__| \n /| []|\\ \n ()/|___|\\() \n |_|_| \n /_|_\\ ", - "1": " \\.===./ \n | b d | \n \\_=_/ \n o==|ooo|==o \n |___| \n .'._.'. \n |_| |_| ", - "2": " o___o \n //0-0\\\\ \n |\\_-_/| \n /|(\\)|\\ \n d |___| b \n . \\_/ . \n . .:::.. . ", - "3": " T___ \n |[o]| \n \\_-_/ \n 7--|=0=|--< \n |___| \n // \\\\ \n _\\\\ //_ ", - "4": " )_( \n |ooo| \n |_#_| \n .-._/___\\_.-. \n ; \\___/ ; \n ( ) \n __) (__ ", - "5": " |---| \n |6=6| \n |_o_| \n}-. /\\--o/\\ .-{\n \" |___| \" \n .\". \n |_| ", - "6": " .---. \n } - - { \n \\_0_/ \n .=[::+]=. \n ]=' [___] '=[ \n /| |\\ \n [_] [_] ", - "7": " Y__ \n _/o o\\_ \n \\_o_/ \n )=o=|L88|=o=( \n )=o=|___|=o=( \n . /___\\ . \n. ..:::::::. .", - "8": " .===. \n //d d\\\\ \n \\\\_u_// \n ,=|x|=. \n 'c/_\\ 'c \n /| |\\ \n (0) (0) ", - "9": " _._._ \n -)o o(- \n \\_=_/ \n()ooo|\\=/|ooo()\n |___| \n |_| \n (ooo) ", - "a": " .=._,=. \n ' (q q) ` \n _)-(_ \n.'c .\"|_|\". n`.\n'--' /_\\ `--'\n _// \\\\_ \n /_o| |o_\\ ", - "b": " .-. \n ._(u u)_. \n (_-_) \n .=(+++)=. \no=\" (___) \"=o\n (_|_) \n (o|o) ", - "c": " ,_,_, \n \\9 9/ \n /_-_\\ \n ,\"|+ |\". \n _\\|+__|/_ \n / | \n _\\ |_ ", - "d": " .===./` \n /.n n.\\ \n \"\\_=_/\" \n (m9\\:::/\\ \n /___\\6 \n [] [] \n /:] [:\\ ", - "e": " __i \n [p q] \n ]-[ \n >===]__o[===< \n [o__] \n ]| |[ \n [_| |_] ", - "f": " _ _,_,_ _ \n \\( q p )/ \n \\_\"_/ \n .==|>o<|==:=L\n '=c|___| \n /7 [| \n \\/7 [|_ " - }, - "spareParts": { - "eyes": { - "0": "o o", - "1": "p q", - "2": "q p", - "3": "d b", - "4": "b d", - "5": "ooo", - "6": "[o]", - "7": "9 9", - "8": "6=6", - "9": "u u", - "a": "n n", - "b": "q q", - "c": "d d", - "d": "- -", - "e": "0 0", - "f": "O O" - }, - "mouths": { - "0": "-", - "1": "=", - "2": "o", - "3": "O", - "4": "0", - "5": "#", - "6": "u", - "7": "v", - "8": "n", - "9": "r", - "a": "`", - "b": "^", - "c": "A", - "d": "@", - "e": "e", - "f": "E" - } - } - }; - - var idHelper = { - - isValid: function(id, minlength, maxlength, radix) { - var range = ""; - if (radix < 2 || radix > 36) { - throw "RangeError: radix must be an integer at least 2 and no greater than 36"; - } else if (radix <= 10) { - range = "0-" + String(radix - 1); - } else { - range = "0-9a-" + (radix - 1).toString(radix); - } - var re = new RegExp("^[" + range + "]{" + minlength + "," + maxlength + "}$"); - return (id && re.test(id.toLowerCase())); - }, - - random: function(length, radix) { - var id = ""; - for (var i = length; i > 0; i--) { - id = id + Math.floor(Math.random() * radix).toString(radix); - } - return id; - } - - }; - - function oneBot(id) { - var botIdDigits = idHelper.isValid(id, 3, 5, 16) ? id.split("") : idHelper.random(5, 16).split(""), - botString = botSplit(robots.templates[botIdDigits[botIdDigits.length - 3]])[0] + - botSplit(robots.templates[botIdDigits[botIdDigits.length - 2]])[1] + - botSplit(robots.templates[botIdDigits[botIdDigits.length - 1]])[2]; - if (botIdDigits.length >= 4) { - botString = replaceParts(botIdDigits[botIdDigits.length - 4], botString, robots.spareParts.eyes, 6, 1); - } - if (botIdDigits.length >= 5) { - botString = replaceParts(botIdDigits[botIdDigits.length - 5], botString, robots.spareParts.mouths, 7, 2); - } - return botString; - } - - function replaceParts(id, botString, parts, x, y) { - lines = botString.split("\n"); - newPart = parts[id]; - lines[y] = lines[y].slice(0, x) + newPart + lines[y].slice(x + newPart.length); - return lines.join("\n"); - } - - function botSplit(botString) { - var splitBot = []; - splitBot[0] = botString.split("\n").slice(0, 3).join("\n") + "\n"; - splitBot[1] = botString.split("\n").slice(3, 5).join("\n") + "\n"; - splitBot[2] = botString.split("\n").slice(5, 7).join("\n"); - return splitBot; - } - - return { - bot: oneBot - }; - + robots = { + "templates": { + "0": " ___T_ \n | o o | \n |__-__| \n /| []|\\ \n ()/|___|\\() \n |_|_| \n /_|_\\ ", + "1": " \\.===./ \n | b d | \n \\_=_/ \n o==|ooo|==o \n |___| \n .'._.'. \n |_| |_| ", + "2": " o___o \n //0-0\\\\ \n |\\_-_/| \n /|(\\)|\\ \n d |___| b \n . \\_/ . \n . .:::.. . ", + "3": " T___ \n |[o]| \n \\_-_/ \n 7--|=0=|--< \n |___| \n // \\\\ \n _\\\\ //_ ", + "4": " )_( \n |ooo| \n |_#_| \n .-._/___\\_.-. \n ; \\___/ ; \n ( ) \n __) (__ ", + "5": " |---| \n |6=6| \n |_o_| \n}-. /\\--o/\\ .-{\n \" |___| \" \n .\". \n |_| ", + "6": " .---. \n } - - { \n \\_0_/ \n .=[::+]=. \n ]=' [___] '=[ \n /| |\\ \n [_] [_] ", + "7": " Y__ \n _/o o\\_ \n \\_o_/ \n )=o=|L88|=o=( \n )=o=|___|=o=( \n . /___\\ . \n. ..:::::::. .", + "8": " .===. \n //d d\\\\ \n \\\\_u_// \n ,=|x|=. \n 'c/_\\ 'c \n /| |\\ \n (0) (0) ", + "9": " _._._ \n -)o o(- \n \\_=_/ \n()ooo|\\=/|ooo()\n |___| \n |_| \n (ooo) ", + "a": " .=._,=. \n ' (q q) ` \n _)-(_ \n.'c .\"|_|\". n`.\n'--' /_\\ `--'\n _// \\\\_ \n /_o| |o_\\ ", + "b": " .-. \n ._(u u)_. \n (_-_) \n .=(+++)=. \no=\" (___) \"=o\n (_|_) \n (o|o) ", + "c": " ,_,_, \n \\9 9/ \n /_-_\\ \n ,\"|+ |\". \n _\\|+__|/_ \n / | \n _\\ |_ ", + "d": " .===./` \n /.n n.\\ \n \"\\_=_/\" \n (m9\\:::/\\ \n /___\\6 \n [] [] \n /:] [:\\ ", + "e": " __i \n [p q] \n ]-[ \n >===]__o[===< \n [o__] \n ]| |[ \n [_| |_] ", + "f": " _ _,_,_ _ \n \\( q p )/ \n \\_\"_/ \n .==|>o<|==:=L\n '=c|___| \n /7 [| \n \\/7 [|_ " + }, + "spareParts": { + "eyes": { + "0": "o o", + "1": "p q", + "2": "q p", + "3": "d b", + "4": "b d", + "5": "ooo", + "6": "[o]", + "7": "9 9", + "8": "6=6", + "9": "u u", + "a": "n n", + "b": "q q", + "c": "d d", + "d": "- -", + "e": "0 0", + "f": "O O" + }, + "mouths": { + "0": "-", + "1": "=", + "2": "o", + "3": "O", + "4": "0", + "5": "#", + "6": "u", + "7": "v", + "8": "n", + "9": "r", + "a": "`", + "b": "^", + "c": "A", + "d": "@", + "e": "e", + "f": "E" + } + } + }; + var idHelper = { + isValid: function(id, minlength, maxlength, radix) { + var range = "", + idPattern; + if (radix < 2 || radix > 36) { + throw new RangeError("radix must be an integer at least 2 and no greater than 36"); + } else if (radix <= 10) { + range = "0-" + String(radix - 1); + } else { + range = "0-9a-" + (radix - 1).toString(radix); + } + idPattern = new RegExp("^[" + range + "]{" + minlength + "," + maxlength + "}$"); + return (id && idPattern.test(id.toLowerCase())); + }, + random: function(length, radix) { + var id = ""; + for (var i = length; i > 0; i--) { + id = id + Math.floor(Math.random() * radix).toString(radix); + } + return id; + } + }; + var oneBot = function(id) { + var botIdDigits = idHelper.isValid(id, 3, 5, 16) ? id.split("") : idHelper.random(5, 16).split(""), + botString = botSplit(robots.templates[botIdDigits[botIdDigits.length - 3]])[0] + + botSplit(robots.templates[botIdDigits[botIdDigits.length - 2]])[1] + + botSplit(robots.templates[botIdDigits[botIdDigits.length - 1]])[2]; + if (botIdDigits.length >= 4) { + botString = replaceParts(botIdDigits[botIdDigits.length - 4], botString, robots.spareParts.eyes, 6, 1); + } + if (botIdDigits.length >= 5) { + botString = replaceParts(botIdDigits[botIdDigits.length - 5], botString, robots.spareParts.mouths, 7, 2); + } + return botString; + }; + var replaceParts = function(id, botString, parts, x, y) { + var lines = botString.split("\n"), + newPart = parts[id]; + lines[y] = lines[y].slice(0, x) + newPart + lines[y].slice(x + newPart.length); + return lines.join("\n"); + }; + var botSplit = function(botString) { + var splitBot = []; + splitBot[0] = botString.split("\n").slice(0, 3).join("\n") + "\n"; + splitBot[1] = botString.split("\n").slice(3, 5).join("\n") + "\n"; + splitBot[2] = botString.split("\n").slice(5, 7).join("\n"); + return splitBot; + }; + return { + bot: oneBot + }; })(); diff --git a/dist/asciibots.min.js b/dist/asciibots.min.js index 1534ce1..cb13d7a 100644 --- a/dist/asciibots.min.js +++ b/dist/asciibots.min.js @@ -1 +1 @@ -var Asciibots=function(){function a(a){var e=d.isValid(a,3,5,16)?a.split(""):d.random(5,16).split(""),f=c(robots.templates[e[e.length-3]])[0]+c(robots.templates[e[e.length-2]])[1]+c(robots.templates[e[e.length-1]])[2];return e.length>=4&&(f=b(e[e.length-4],f,robots.spareParts.eyes,6,1)),e.length>=5&&(f=b(e[e.length-5],f,robots.spareParts.mouths,7,2)),f}function b(a,b,c,d,e){return lines=b.split("\n"),newPart=c[a],lines[e]=lines[e].slice(0,d)+newPart+lines[e].slice(d+newPart.length),lines.join("\n")}function c(a){var b=[];return b[0]=a.split("\n").slice(0,3).join("\n")+"\n",b[1]=a.split("\n").slice(3,5).join("\n")+"\n",b[2]=a.split("\n").slice(5,7).join("\n"),b}robots={templates:{0:" ___T_ \n | o o | \n |__-__| \n /| []|\\ \n ()/|___|\\() \n |_|_| \n /_|_\\ ",1:" \\.===./ \n | b d | \n \\_=_/ \n o==|ooo|==o \n |___| \n .'._.'. \n |_| |_| ",2:" o___o \n //0-0\\\\ \n |\\_-_/| \n /|(\\)|\\ \n d |___| b \n . \\_/ . \n . .:::.. . ",3:" T___ \n |[o]| \n \\_-_/ \n 7--|=0=|--< \n |___| \n // \\\\ \n _\\\\ //_ ",4:" )_( \n |ooo| \n |_#_| \n .-._/___\\_.-. \n ; \\___/ ; \n ( ) \n __) (__ ",5:' |---| \n |6=6| \n |_o_| \n}-. /\\--o/\\ .-{\n " |___| " \n .". \n |_| ',6:" .---. \n } - - { \n \\_0_/ \n .=[::+]=. \n ]=' [___] '=[ \n /| |\\ \n [_] [_] ",7:" Y__ \n _/o o\\_ \n \\_o_/ \n )=o=|L88|=o=( \n )=o=|___|=o=( \n . /___\\ . \n. ..:::::::. .",8:" .===. \n //d d\\\\ \n \\\\_u_// \n ,=|x|=. \n 'c/_\\ 'c \n /| |\\ \n (0) (0) ",9:" _._._ \n -)o o(- \n \\_=_/ \n()ooo|\\=/|ooo()\n |___| \n |_| \n (ooo) ",a:" .=._,=. \n ' (q q) ` \n _)-(_ \n.'c .\"|_|\". n`.\n'--' /_\\ `--'\n _// \\\\_ \n /_o| |o_\\ ",b:' .-. \n ._(u u)_. \n (_-_) \n .=(+++)=. \no=" (___) "=o\n (_|_) \n (o|o) ',c:' ,_,_, \n \\9 9/ \n /_-_\\ \n ,"|+ |". \n _\\|+__|/_ \n / | \n _\\ |_ ',d:' .===./` \n /.n n.\\ \n "\\_=_/" \n (m9\\:::/\\ \n /___\\6 \n [] [] \n /:] [:\\ ',e:" __i \n [p q] \n ]-[ \n >===]__o[===< \n [o__] \n ]| |[ \n [_| |_] ",f:" _ _,_,_ _ \n \\( q p )/ \n \\_\"_/ \n .==|>o<|==:=L\n '=c|___| \n /7 [| \n \\/7 [|_ "},spareParts:{eyes:{0:"o o",1:"p q",2:"q p",3:"d b",4:"b d",5:"ooo",6:"[o]",7:"9 9",8:"6=6",9:"u u",a:"n n",b:"q q",c:"d d",d:"- -",e:"0 0",f:"O O"},mouths:{0:"-",1:"=",2:"o",3:"O",4:"0",5:"#",6:"u",7:"v",8:"n",9:"r",a:"`",b:"^",c:"A",d:"@",e:"e",f:"E"}}};var d={isValid:function(a,b,c,d){var e="";if(2>d||d>36)throw"RangeError: radix must be an integer at least 2 and no greater than 36";e=10>=d?"0-"+String(d-1):"0-9a-"+(d-1).toString(d);var f=new RegExp("^["+e+"]{"+b+","+c+"}$");return a&&f.test(a.toLowerCase())},random:function(a,b){for(var c="",d=a;d>0;d--)c+=Math.floor(Math.random()*b).toString(b);return c}};return{bot:a}}(); \ No newline at end of file +var Asciibots=function(){robots={templates:{0:" ___T_ \n | o o | \n |__-__| \n /| []|\\ \n ()/|___|\\() \n |_|_| \n /_|_\\ ",1:" \\.===./ \n | b d | \n \\_=_/ \n o==|ooo|==o \n |___| \n .'._.'. \n |_| |_| ",2:" o___o \n //0-0\\\\ \n |\\_-_/| \n /|(\\)|\\ \n d |___| b \n . \\_/ . \n . .:::.. . ",3:" T___ \n |[o]| \n \\_-_/ \n 7--|=0=|--< \n |___| \n // \\\\ \n _\\\\ //_ ",4:" )_( \n |ooo| \n |_#_| \n .-._/___\\_.-. \n ; \\___/ ; \n ( ) \n __) (__ ",5:' |---| \n |6=6| \n |_o_| \n}-. /\\--o/\\ .-{\n " |___| " \n .". \n |_| ',6:" .---. \n } - - { \n \\_0_/ \n .=[::+]=. \n ]=' [___] '=[ \n /| |\\ \n [_] [_] ",7:" Y__ \n _/o o\\_ \n \\_o_/ \n )=o=|L88|=o=( \n )=o=|___|=o=( \n . /___\\ . \n. ..:::::::. .",8:" .===. \n //d d\\\\ \n \\\\_u_// \n ,=|x|=. \n 'c/_\\ 'c \n /| |\\ \n (0) (0) ",9:" _._._ \n -)o o(- \n \\_=_/ \n()ooo|\\=/|ooo()\n |___| \n |_| \n (ooo) ",a:" .=._,=. \n ' (q q) ` \n _)-(_ \n.'c .\"|_|\". n`.\n'--' /_\\ `--'\n _// \\\\_ \n /_o| |o_\\ ",b:' .-. \n ._(u u)_. \n (_-_) \n .=(+++)=. \no=" (___) "=o\n (_|_) \n (o|o) ',c:' ,_,_, \n \\9 9/ \n /_-_\\ \n ,"|+ |". \n _\\|+__|/_ \n / | \n _\\ |_ ',d:' .===./` \n /.n n.\\ \n "\\_=_/" \n (m9\\:::/\\ \n /___\\6 \n [] [] \n /:] [:\\ ',e:" __i \n [p q] \n ]-[ \n >===]__o[===< \n [o__] \n ]| |[ \n [_| |_] ",f:" _ _,_,_ _ \n \\( q p )/ \n \\_\"_/ \n .==|>o<|==:=L\n '=c|___| \n /7 [| \n \\/7 [|_ "},spareParts:{eyes:{0:"o o",1:"p q",2:"q p",3:"d b",4:"b d",5:"ooo",6:"[o]",7:"9 9",8:"6=6",9:"u u",a:"n n",b:"q q",c:"d d",d:"- -",e:"0 0",f:"O O"},mouths:{0:"-",1:"=",2:"o",3:"O",4:"0",5:"#",6:"u",7:"v",8:"n",9:"r",a:"`",b:"^",c:"A",d:"@",e:"e",f:"E"}}};var a={isValid:function(a,b,c,d){var e,f="";if(2>d||d>36)throw new RangeError("radix must be an integer at least 2 and no greater than 36");return f=10>=d?"0-"+String(d-1):"0-9a-"+(d-1).toString(d),e=new RegExp("^["+f+"]{"+b+","+c+"}$"),a&&e.test(a.toLowerCase())},random:function(a,b){for(var c="",d=a;d>0;d--)c+=Math.floor(Math.random()*b).toString(b);return c}},b=function(b){var e=a.isValid(b,3,5,16)?b.split(""):a.random(5,16).split(""),f=d(robots.templates[e[e.length-3]])[0]+d(robots.templates[e[e.length-2]])[1]+d(robots.templates[e[e.length-1]])[2];return e.length>=4&&(f=c(e[e.length-4],f,robots.spareParts.eyes,6,1)),e.length>=5&&(f=c(e[e.length-5],f,robots.spareParts.mouths,7,2)),f},c=function(a,b,c,d,e){var f=b.split("\n"),g=c[a];return f[e]=f[e].slice(0,d)+g+f[e].slice(d+g.length),f.join("\n")},d=function(a){var b=[];return b[0]=a.split("\n").slice(0,3).join("\n")+"\n",b[1]=a.split("\n").slice(3,5).join("\n")+"\n",b[2]=a.split("\n").slice(5,7).join("\n"),b};return{bot:b}}(); \ No newline at end of file diff --git a/dist/jquery/asciibots.js b/dist/jquery/asciibots.js index 4ced694..a0469c2 100644 --- a/dist/jquery/asciibots.js +++ b/dist/jquery/asciibots.js @@ -1,126 +1,117 @@ -/*! asciibots.js - v0.9 - 2014-08-21 +/*! asciibots.js - v1.0 - 2014-08-31 ** https://walsh9.github.io/asciibots ** Copyright (c) 2014 Matthew Walsh; Licensed under MIT license. */ - (function($) { - - $.fn.asciibot = function(botId) { - return this.each(function() { - $(this).text(oneBot(botId)); - return this; - }); - }; - - robots = { - "templates": { - "0": " ___T_ \n | o o | \n |__-__| \n /| []|\\ \n ()/|___|\\() \n |_|_| \n /_|_\\ ", - "1": " \\.===./ \n | b d | \n \\_=_/ \n o==|ooo|==o \n |___| \n .'._.'. \n |_| |_| ", - "2": " o___o \n //0-0\\\\ \n |\\_-_/| \n /|(\\)|\\ \n d |___| b \n . \\_/ . \n . .:::.. . ", - "3": " T___ \n |[o]| \n \\_-_/ \n 7--|=0=|--< \n |___| \n // \\\\ \n _\\\\ //_ ", - "4": " )_( \n |ooo| \n |_#_| \n .-._/___\\_.-. \n ; \\___/ ; \n ( ) \n __) (__ ", - "5": " |---| \n |6=6| \n |_o_| \n}-. /\\--o/\\ .-{\n \" |___| \" \n .\". \n |_| ", - "6": " .---. \n } - - { \n \\_0_/ \n .=[::+]=. \n ]=' [___] '=[ \n /| |\\ \n [_] [_] ", - "7": " Y__ \n _/o o\\_ \n \\_o_/ \n )=o=|L88|=o=( \n )=o=|___|=o=( \n . /___\\ . \n. ..:::::::. .", - "8": " .===. \n //d d\\\\ \n \\\\_u_// \n ,=|x|=. \n 'c/_\\ 'c \n /| |\\ \n (0) (0) ", - "9": " _._._ \n -)o o(- \n \\_=_/ \n()ooo|\\=/|ooo()\n |___| \n |_| \n (ooo) ", - "a": " .=._,=. \n ' (q q) ` \n _)-(_ \n.'c .\"|_|\". n`.\n'--' /_\\ `--'\n _// \\\\_ \n /_o| |o_\\ ", - "b": " .-. \n ._(u u)_. \n (_-_) \n .=(+++)=. \no=\" (___) \"=o\n (_|_) \n (o|o) ", - "c": " ,_,_, \n \\9 9/ \n /_-_\\ \n ,\"|+ |\". \n _\\|+__|/_ \n / | \n _\\ |_ ", - "d": " .===./` \n /.n n.\\ \n \"\\_=_/\" \n (m9\\:::/\\ \n /___\\6 \n [] [] \n /:] [:\\ ", - "e": " __i \n [p q] \n ]-[ \n >===]__o[===< \n [o__] \n ]| |[ \n [_| |_] ", - "f": " _ _,_,_ _ \n \\( q p )/ \n \\_\"_/ \n .==|>o<|==:=L\n '=c|___| \n /7 [| \n \\/7 [|_ " - }, - "spareParts": { - "eyes": { - "0": "o o", - "1": "p q", - "2": "q p", - "3": "d b", - "4": "b d", - "5": "ooo", - "6": "[o]", - "7": "9 9", - "8": "6=6", - "9": "u u", - "a": "n n", - "b": "q q", - "c": "d d", - "d": "- -", - "e": "0 0", - "f": "O O" - }, - "mouths": { - "0": "-", - "1": "=", - "2": "o", - "3": "O", - "4": "0", - "5": "#", - "6": "u", - "7": "v", - "8": "n", - "9": "r", - "a": "`", - "b": "^", - "c": "A", - "d": "@", - "e": "e", - "f": "E" - } - } - }; - - var idHelper = { - - isValid: function(id, minlength, maxlength, radix) { - var range = ""; - if (radix < 2 || radix > 36) { - throw "RangeError: radix must be an integer at least 2 and no greater than 36"; - } else if (radix <= 10) { - range = "0-" + String(radix - 1); - } else { - range = "0-9a-" + (radix - 1).toString(radix); - } - var re = new RegExp("^[" + range + "]{" + minlength + "," + maxlength + "}$"); - return (id && re.test(id.toLowerCase())); - }, - - random: function(length, radix) { - var id = ""; - for (var i = length; i > 0; i--) { - id = id + Math.floor(Math.random() * radix).toString(radix); - } - return id; - } - - }; - - function oneBot(id) { - var botIdDigits = idHelper.isValid(id, 3, 5, 16) ? id.split("") : idHelper.random(5, 16).split(""), - botString = botSplit(robots.templates[botIdDigits[botIdDigits.length - 3]])[0] + - botSplit(robots.templates[botIdDigits[botIdDigits.length - 2]])[1] + - botSplit(robots.templates[botIdDigits[botIdDigits.length - 1]])[2]; - if (botIdDigits.length >= 4) { - botString = replaceParts(botIdDigits[botIdDigits.length - 4], botString, robots.spareParts.eyes, 6, 1); - } - if (botIdDigits.length >= 5) { - botString = replaceParts(botIdDigits[botIdDigits.length - 5], botString, robots.spareParts.mouths, 7, 2); - } - return botString; - } - - function replaceParts(id, botString, parts, x, y) { - lines = botString.split("\n"); - newPart = parts[id]; - lines[y] = lines[y].slice(0, x) + newPart + lines[y].slice(x + newPart.length); - return lines.join("\n"); - } - - function botSplit(botString) { - var splitBot = []; - splitBot[0] = botString.split("\n").slice(0, 3).join("\n") + "\n"; - splitBot[1] = botString.split("\n").slice(3, 5).join("\n") + "\n"; - splitBot[2] = botString.split("\n").slice(5, 7).join("\n"); - return splitBot; - } + $.fn.asciibot = function(botId) { + return this.each(function() { + $(this).text(oneBot(botId)); + return this; + }); + }; + robots = { + "templates": { + "0": " ___T_ \n | o o | \n |__-__| \n /| []|\\ \n ()/|___|\\() \n |_|_| \n /_|_\\ ", + "1": " \\.===./ \n | b d | \n \\_=_/ \n o==|ooo|==o \n |___| \n .'._.'. \n |_| |_| ", + "2": " o___o \n //0-0\\\\ \n |\\_-_/| \n /|(\\)|\\ \n d |___| b \n . \\_/ . \n . .:::.. . ", + "3": " T___ \n |[o]| \n \\_-_/ \n 7--|=0=|--< \n |___| \n // \\\\ \n _\\\\ //_ ", + "4": " )_( \n |ooo| \n |_#_| \n .-._/___\\_.-. \n ; \\___/ ; \n ( ) \n __) (__ ", + "5": " |---| \n |6=6| \n |_o_| \n}-. /\\--o/\\ .-{\n \" |___| \" \n .\". \n |_| ", + "6": " .---. \n } - - { \n \\_0_/ \n .=[::+]=. \n ]=' [___] '=[ \n /| |\\ \n [_] [_] ", + "7": " Y__ \n _/o o\\_ \n \\_o_/ \n )=o=|L88|=o=( \n )=o=|___|=o=( \n . /___\\ . \n. ..:::::::. .", + "8": " .===. \n //d d\\\\ \n \\\\_u_// \n ,=|x|=. \n 'c/_\\ 'c \n /| |\\ \n (0) (0) ", + "9": " _._._ \n -)o o(- \n \\_=_/ \n()ooo|\\=/|ooo()\n |___| \n |_| \n (ooo) ", + "a": " .=._,=. \n ' (q q) ` \n _)-(_ \n.'c .\"|_|\". n`.\n'--' /_\\ `--'\n _// \\\\_ \n /_o| |o_\\ ", + "b": " .-. \n ._(u u)_. \n (_-_) \n .=(+++)=. \no=\" (___) \"=o\n (_|_) \n (o|o) ", + "c": " ,_,_, \n \\9 9/ \n /_-_\\ \n ,\"|+ |\". \n _\\|+__|/_ \n / | \n _\\ |_ ", + "d": " .===./` \n /.n n.\\ \n \"\\_=_/\" \n (m9\\:::/\\ \n /___\\6 \n [] [] \n /:] [:\\ ", + "e": " __i \n [p q] \n ]-[ \n >===]__o[===< \n [o__] \n ]| |[ \n [_| |_] ", + "f": " _ _,_,_ _ \n \\( q p )/ \n \\_\"_/ \n .==|>o<|==:=L\n '=c|___| \n /7 [| \n \\/7 [|_ " + }, + "spareParts": { + "eyes": { + "0": "o o", + "1": "p q", + "2": "q p", + "3": "d b", + "4": "b d", + "5": "ooo", + "6": "[o]", + "7": "9 9", + "8": "6=6", + "9": "u u", + "a": "n n", + "b": "q q", + "c": "d d", + "d": "- -", + "e": "0 0", + "f": "O O" + }, + "mouths": { + "0": "-", + "1": "=", + "2": "o", + "3": "O", + "4": "0", + "5": "#", + "6": "u", + "7": "v", + "8": "n", + "9": "r", + "a": "`", + "b": "^", + "c": "A", + "d": "@", + "e": "e", + "f": "E" + } + } + }; + var idHelper = { + isValid: function(id, minlength, maxlength, radix) { + var range = "", + idPattern; + if (radix < 2 || radix > 36) { + throw new RangeError("radix must be an integer at least 2 and no greater than 36"); + } else if (radix <= 10) { + range = "0-" + String(radix - 1); + } else { + range = "0-9a-" + (radix - 1).toString(radix); + } + idPattern = new RegExp("^[" + range + "]{" + minlength + "," + maxlength + "}$"); + return (id && idPattern.test(id.toLowerCase())); + }, + random: function(length, radix) { + var id = ""; + for (var i = length; i > 0; i--) { + id = id + Math.floor(Math.random() * radix).toString(radix); + } + return id; + } + }; + var oneBot = function(id) { + var botIdDigits = idHelper.isValid(id, 3, 5, 16) ? id.split("") : idHelper.random(5, 16).split(""), + botString = botSplit(robots.templates[botIdDigits[botIdDigits.length - 3]])[0] + + botSplit(robots.templates[botIdDigits[botIdDigits.length - 2]])[1] + + botSplit(robots.templates[botIdDigits[botIdDigits.length - 1]])[2]; + if (botIdDigits.length >= 4) { + botString = replaceParts(botIdDigits[botIdDigits.length - 4], botString, robots.spareParts.eyes, 6, 1); + } + if (botIdDigits.length >= 5) { + botString = replaceParts(botIdDigits[botIdDigits.length - 5], botString, robots.spareParts.mouths, 7, 2); + } + return botString; + }; + var replaceParts = function(id, botString, parts, x, y) { + var lines = botString.split("\n"), + newPart = parts[id]; + lines[y] = lines[y].slice(0, x) + newPart + lines[y].slice(x + newPart.length); + return lines.join("\n"); + }; + var botSplit = function(botString) { + var splitBot = []; + splitBot[0] = botString.split("\n").slice(0, 3).join("\n") + "\n"; + splitBot[1] = botString.split("\n").slice(3, 5).join("\n") + "\n"; + splitBot[2] = botString.split("\n").slice(5, 7).join("\n"); + return splitBot; + }; }(jQuery)); diff --git a/dist/jquery/asciibots.min.js b/dist/jquery/asciibots.min.js index 657c2cf..b3749b2 100644 --- a/dist/jquery/asciibots.min.js +++ b/dist/jquery/asciibots.min.js @@ -1 +1 @@ -!function(a){function b(a){var b=e.isValid(a,3,5,16)?a.split(""):e.random(5,16).split(""),f=d(robots.templates[b[b.length-3]])[0]+d(robots.templates[b[b.length-2]])[1]+d(robots.templates[b[b.length-1]])[2];return b.length>=4&&(f=c(b[b.length-4],f,robots.spareParts.eyes,6,1)),b.length>=5&&(f=c(b[b.length-5],f,robots.spareParts.mouths,7,2)),f}function c(a,b,c,d,e){return lines=b.split("\n"),newPart=c[a],lines[e]=lines[e].slice(0,d)+newPart+lines[e].slice(d+newPart.length),lines.join("\n")}function d(a){var b=[];return b[0]=a.split("\n").slice(0,3).join("\n")+"\n",b[1]=a.split("\n").slice(3,5).join("\n")+"\n",b[2]=a.split("\n").slice(5,7).join("\n"),b}a.fn.asciibot=function(c){return this.each(function(){return a(this).text(b(c)),this})},robots={templates:{0:" ___T_ \n | o o | \n |__-__| \n /| []|\\ \n ()/|___|\\() \n |_|_| \n /_|_\\ ",1:" \\.===./ \n | b d | \n \\_=_/ \n o==|ooo|==o \n |___| \n .'._.'. \n |_| |_| ",2:" o___o \n //0-0\\\\ \n |\\_-_/| \n /|(\\)|\\ \n d |___| b \n . \\_/ . \n . .:::.. . ",3:" T___ \n |[o]| \n \\_-_/ \n 7--|=0=|--< \n |___| \n // \\\\ \n _\\\\ //_ ",4:" )_( \n |ooo| \n |_#_| \n .-._/___\\_.-. \n ; \\___/ ; \n ( ) \n __) (__ ",5:' |---| \n |6=6| \n |_o_| \n}-. /\\--o/\\ .-{\n " |___| " \n .". \n |_| ',6:" .---. \n } - - { \n \\_0_/ \n .=[::+]=. \n ]=' [___] '=[ \n /| |\\ \n [_] [_] ",7:" Y__ \n _/o o\\_ \n \\_o_/ \n )=o=|L88|=o=( \n )=o=|___|=o=( \n . /___\\ . \n. ..:::::::. .",8:" .===. \n //d d\\\\ \n \\\\_u_// \n ,=|x|=. \n 'c/_\\ 'c \n /| |\\ \n (0) (0) ",9:" _._._ \n -)o o(- \n \\_=_/ \n()ooo|\\=/|ooo()\n |___| \n |_| \n (ooo) ",a:" .=._,=. \n ' (q q) ` \n _)-(_ \n.'c .\"|_|\". n`.\n'--' /_\\ `--'\n _// \\\\_ \n /_o| |o_\\ ",b:' .-. \n ._(u u)_. \n (_-_) \n .=(+++)=. \no=" (___) "=o\n (_|_) \n (o|o) ',c:' ,_,_, \n \\9 9/ \n /_-_\\ \n ,"|+ |". \n _\\|+__|/_ \n / | \n _\\ |_ ',d:' .===./` \n /.n n.\\ \n "\\_=_/" \n (m9\\:::/\\ \n /___\\6 \n [] [] \n /:] [:\\ ',e:" __i \n [p q] \n ]-[ \n >===]__o[===< \n [o__] \n ]| |[ \n [_| |_] ",f:" _ _,_,_ _ \n \\( q p )/ \n \\_\"_/ \n .==|>o<|==:=L\n '=c|___| \n /7 [| \n \\/7 [|_ "},spareParts:{eyes:{0:"o o",1:"p q",2:"q p",3:"d b",4:"b d",5:"ooo",6:"[o]",7:"9 9",8:"6=6",9:"u u",a:"n n",b:"q q",c:"d d",d:"- -",e:"0 0",f:"O O"},mouths:{0:"-",1:"=",2:"o",3:"O",4:"0",5:"#",6:"u",7:"v",8:"n",9:"r",a:"`",b:"^",c:"A",d:"@",e:"e",f:"E"}}};var e={isValid:function(a,b,c,d){var e="";if(2>d||d>36)throw"RangeError: radix must be an integer at least 2 and no greater than 36";e=10>=d?"0-"+String(d-1):"0-9a-"+(d-1).toString(d);var f=new RegExp("^["+e+"]{"+b+","+c+"}$");return a&&f.test(a.toLowerCase())},random:function(a,b){for(var c="",d=a;d>0;d--)c+=Math.floor(Math.random()*b).toString(b);return c}}}(jQuery); \ No newline at end of file +!function(a){a.fn.asciibot=function(b){return this.each(function(){return a(this).text(c(b)),this})},robots={templates:{0:" ___T_ \n | o o | \n |__-__| \n /| []|\\ \n ()/|___|\\() \n |_|_| \n /_|_\\ ",1:" \\.===./ \n | b d | \n \\_=_/ \n o==|ooo|==o \n |___| \n .'._.'. \n |_| |_| ",2:" o___o \n //0-0\\\\ \n |\\_-_/| \n /|(\\)|\\ \n d |___| b \n . \\_/ . \n . .:::.. . ",3:" T___ \n |[o]| \n \\_-_/ \n 7--|=0=|--< \n |___| \n // \\\\ \n _\\\\ //_ ",4:" )_( \n |ooo| \n |_#_| \n .-._/___\\_.-. \n ; \\___/ ; \n ( ) \n __) (__ ",5:' |---| \n |6=6| \n |_o_| \n}-. /\\--o/\\ .-{\n " |___| " \n .". \n |_| ',6:" .---. \n } - - { \n \\_0_/ \n .=[::+]=. \n ]=' [___] '=[ \n /| |\\ \n [_] [_] ",7:" Y__ \n _/o o\\_ \n \\_o_/ \n )=o=|L88|=o=( \n )=o=|___|=o=( \n . /___\\ . \n. ..:::::::. .",8:" .===. \n //d d\\\\ \n \\\\_u_// \n ,=|x|=. \n 'c/_\\ 'c \n /| |\\ \n (0) (0) ",9:" _._._ \n -)o o(- \n \\_=_/ \n()ooo|\\=/|ooo()\n |___| \n |_| \n (ooo) ",a:" .=._,=. \n ' (q q) ` \n _)-(_ \n.'c .\"|_|\". n`.\n'--' /_\\ `--'\n _// \\\\_ \n /_o| |o_\\ ",b:' .-. \n ._(u u)_. \n (_-_) \n .=(+++)=. \no=" (___) "=o\n (_|_) \n (o|o) ',c:' ,_,_, \n \\9 9/ \n /_-_\\ \n ,"|+ |". \n _\\|+__|/_ \n / | \n _\\ |_ ',d:' .===./` \n /.n n.\\ \n "\\_=_/" \n (m9\\:::/\\ \n /___\\6 \n [] [] \n /:] [:\\ ',e:" __i \n [p q] \n ]-[ \n >===]__o[===< \n [o__] \n ]| |[ \n [_| |_] ",f:" _ _,_,_ _ \n \\( q p )/ \n \\_\"_/ \n .==|>o<|==:=L\n '=c|___| \n /7 [| \n \\/7 [|_ "},spareParts:{eyes:{0:"o o",1:"p q",2:"q p",3:"d b",4:"b d",5:"ooo",6:"[o]",7:"9 9",8:"6=6",9:"u u",a:"n n",b:"q q",c:"d d",d:"- -",e:"0 0",f:"O O"},mouths:{0:"-",1:"=",2:"o",3:"O",4:"0",5:"#",6:"u",7:"v",8:"n",9:"r",a:"`",b:"^",c:"A",d:"@",e:"e",f:"E"}}};var b={isValid:function(a,b,c,d){var e,f="";if(2>d||d>36)throw new RangeError("radix must be an integer at least 2 and no greater than 36");return f=10>=d?"0-"+String(d-1):"0-9a-"+(d-1).toString(d),e=new RegExp("^["+f+"]{"+b+","+c+"}$"),a&&e.test(a.toLowerCase())},random:function(a,b){for(var c="",d=a;d>0;d--)c+=Math.floor(Math.random()*b).toString(b);return c}},c=function(a){var c=b.isValid(a,3,5,16)?a.split(""):b.random(5,16).split(""),f=e(robots.templates[c[c.length-3]])[0]+e(robots.templates[c[c.length-2]])[1]+e(robots.templates[c[c.length-1]])[2];return c.length>=4&&(f=d(c[c.length-4],f,robots.spareParts.eyes,6,1)),c.length>=5&&(f=d(c[c.length-5],f,robots.spareParts.mouths,7,2)),f},d=function(a,b,c,d,e){var f=b.split("\n"),g=c[a];return f[e]=f[e].slice(0,d)+g+f[e].slice(d+g.length),f.join("\n")},e=function(a){var b=[];return b[0]=a.split("\n").slice(0,3).join("\n")+"\n",b[1]=a.split("\n").slice(3,5).join("\n")+"\n",b[2]=a.split("\n").slice(5,7).join("\n"),b}}(jQuery); \ No newline at end of file diff --git a/package.json b/package.json index 0cd256c..50fd78d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "asciibots.js", - "version": "0.9", + "version": "1.0", "description": "ASCII Robots", "main": "dist/asciibots.js", "scripts": { diff --git a/src/idhelper.js b/src/idhelper.js index 41a0fc5..6dae655 100644 --- a/src/idhelper.js +++ b/src/idhelper.js @@ -1,25 +1,22 @@ - var idHelper = { - - isValid: function (id, minlength, maxlength, radix) { - var range = ""; - if (radix < 2 || radix > 36) { - throw "RangeError: radix must be an integer at least 2 and no greater than 36"; - } else if (radix <= 10) { - range = "0-" + String(radix - 1); - } else { - range = "0-9a-" + (radix - 1).toString(radix); + isValid: function(id, minlength, maxlength, radix) { + var range = "", + idPattern; + if (radix < 2 || radix > 36) { + throw new RangeError("radix must be an integer at least 2 and no greater than 36"); + } else if (radix <= 10) { + range = "0-" + String(radix - 1); + } else { + range = "0-9a-" + (radix - 1).toString(radix); + } + idPattern = new RegExp("^[" + range + "]{" + minlength + "," + maxlength + "}$"); + return (id && idPattern.test(id.toLowerCase())); + }, + random: function(length, radix) { + var id = ""; + for (var i = length; i > 0; i--) { + id = id + Math.floor(Math.random() * radix).toString(radix); + } + return id; } - var re = new RegExp("^[" + range + "]{" + minlength + "," + maxlength + "}$"); - return ( id && re.test(id.toLowerCase()) ); - }, - - random: function (length, radix) { - var id = ""; - for (var i = length; i > 0; i--) { - id = id + Math.floor(Math.random() * radix).toString(radix); - } - return id; - } - }; \ No newline at end of file diff --git a/src/jquery-intro.js b/src/jquery-intro.js index d3a3b6a..fd07e73 100644 --- a/src/jquery-intro.js +++ b/src/jquery-intro.js @@ -1,9 +1,7 @@ (function ($) { - - $.fn.asciibot = function( botId ) { - return this.each( function() { - $( this ).text( oneBot(botId) ); - return this; - }); - }; - \ No newline at end of file + $.fn.asciibot = function(botId) { + return this.each(function () { + $(this).text(oneBot(botId)); + return this; + }); + }; \ No newline at end of file diff --git a/src/shared.js b/src/shared.js index 15eb859..5a1d701 100644 --- a/src/shared.js +++ b/src/shared.js @@ -1,28 +1,26 @@ - function oneBot(id) { - var botIdDigits = idHelper.isValid(id,3,5,16) ? id.split("") : idHelper.random (5,16).split(""), - botString = botSplit(robots.templates[botIdDigits[botIdDigits.length - 3]])[0] + - botSplit(robots.templates[botIdDigits[botIdDigits.length - 2]])[1] + - botSplit(robots.templates[botIdDigits[botIdDigits.length - 1]])[2]; - if (botIdDigits.length >= 4) { +var oneBot = function(id) { + var botIdDigits = idHelper.isValid(id, 3, 5, 16) ? id.split("") : idHelper.random(5, 16).split(""), + botString = botSplit(robots.templates[botIdDigits[botIdDigits.length - 3]])[0] + + botSplit(robots.templates[botIdDigits[botIdDigits.length - 2]])[1] + + botSplit(robots.templates[botIdDigits[botIdDigits.length - 1]])[2]; + if (botIdDigits.length >= 4) { botString = replaceParts(botIdDigits[botIdDigits.length - 4], botString, robots.spareParts.eyes, 6, 1); - } - if (botIdDigits.length >= 5) { + } + if (botIdDigits.length >= 5) { botString = replaceParts(botIdDigits[botIdDigits.length - 5], botString, robots.spareParts.mouths, 7, 2); - } + } return botString; - } - - function replaceParts(id, botString, parts, x, y) { - lines = botString.split("\n"); - newPart = parts[id]; +}; +var replaceParts = function(id, botString, parts, x, y) { + var lines = botString.split("\n"), + newPart = parts[id]; lines[y] = lines[y].slice(0, x) + newPart + lines[y].slice(x + newPart.length); return lines.join("\n"); - } - - function botSplit(botString) { +}; +var botSplit = function(botString) { var splitBot = []; splitBot[0] = botString.split("\n").slice(0, 3).join("\n") + "\n"; splitBot[1] = botString.split("\n").slice(3, 5).join("\n") + "\n"; splitBot[2] = botString.split("\n").slice(5, 7).join("\n"); return splitBot; - } \ No newline at end of file +}; \ No newline at end of file diff --git a/src/vanilla-intro.js b/src/vanilla-intro.js index 8ec9ebb..96440d7 100644 --- a/src/vanilla-intro.js +++ b/src/vanilla-intro.js @@ -1,2 +1 @@ -var Asciibots = (function () { - \ No newline at end of file +var Asciibots = (function () { \ No newline at end of file diff --git a/src/vanilla-outro.js b/src/vanilla-outro.js index e2860ce..5410b98 100644 --- a/src/vanilla-outro.js +++ b/src/vanilla-outro.js @@ -1,6 +1,4 @@ - - return { - bot: oneBot - }; - + return { + bot: oneBot + }; })(); \ No newline at end of file diff --git a/www/dl/asciibots.zip b/www/dl/asciibots.zip index 5d80a873e04607f66ec141d3800018fcb1a154de..afc6eac419a2e9ec3a29d5e5843b342e41a6b0e3 100644 GIT binary patch delta 3653 zcmV-L4!ZIG9HSi#P)h>@6aWYS2mlMKACV0oe_?OiMiTv=UopoXD$){{lAYMG9H!Uy z0<=Ji6m4*af>dc)q%8(AsZdnn!1RCb+gUETqBl(sR~Z&pGrO~I=FQBK437Rm%iSu^ zugZES-tEYz4>K{v<#;-K>QA5hCo_6NM@K~Ky58>QLGW?8*{#pTOwU4R^RjR~x_?6WRHcLqmHH_~PMzIuH_JNPIdenIswqT{98r=aZxbHHg}gLW z;;)gzR*)oqk{E)Zp=i;>v7X|3K?5t0e*jIph?)d{a)uTJ5U4feOc*k2@#V}km^c<; z7>b}@*3cEDCK`(4Busb)TQ0+}Da*16!?N3o(Xe&pff$Jd|AtjSYvB#C9BV98!YA0o zM_CDisXvYJ=|ylEu|YigNsSxF9^{<}=w)!=hc+an5AZ+&V$*`ed_EVrAQ*$#f1Gr9 z-olKus?AUnm5YNAD>U7dGv9B*Y1sJwi+&AbF^mKO(6qcLKfw}y2LW$3g!8n6Ltf(Y zR+?a@q1zmTCi$vQ0pW`zz~;b+pSHI<3%V}Va*~OQH01WXcR^|GDx%LfT#$1`H#;qG-n+a`t2}l zk^tq6?GM3}Js2-6!{+t#=MAo|+?xe5ZL~n9siKl|I4+R5GJ)j>Dlr7}f4l?3)h%~! zeF}n@;y41~S)OPqEvkjj;$4m3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x~fA`r}^d^xqsRU4gs@;7wuQ}2(a-jug2_fI+E;$Nkp*?+Qssrof;?OrRKLCMGB_T9G!Mn6Z? zD?FO)sh4?FP;ceY!%vj=hw=2}WQ{j~UBgmndS87l>R;1c!8kt%_v&!uJ>Ej9nwjvd z6h-hJ> z2MAat+MbT_1pom53;+O7O928D02BZS00;n`R24;qn&9$?2LJ%U6O%6vEFYaz6-8Lu no{sSa0093C000mG0000000000AONI+!jpOqBL?ve00000Xn^=L diff --git a/www/dl/jquery/asciibots.zip b/www/dl/jquery/asciibots.zip index 6c019d7ee26a600ca1223632c8673938129a31fc..c0474fd65ef31c2bf6ec7d4802d65d01511b13b0 100644 GIT binary patch delta 3735 zcmV;I4ruYn9rGOxP)h>@6aWYS2mlMKACV0pe{b7H68@fFF=c~_w8W)sCw44{X|KHi zS0F`tcflPBQl({ywiw8yLs5y1(Et6OndQrh-ZTZSG%T%Vc4wY>-CYI;-_T;a%(Ba( z+N$?k^6BHDn&RtddiczrzVMF^=?NVi5Us1~b~_7#Pm9fVeWtFnYQ4KuSrK&W^}L^o zf7|;qyIxo1EqQdzJAe}PQn|g+LIDVR4LOrN^PIyL zOdP8)3{}uCtLc(fCK`(4Bur$6NG`&#E{dWK!=h6qXbjzIq!RoaQUR@jH^g$(e`28m zHbEvH?S~+k`qLOsPlCzt4gAqhs@*vDK<`LE&(47ztsuoVzyby&q7|vxY^LyqpbdO; z+~Ii#F)XzeLv>Wl_gt*ebW=`!zYeEi?fWnLHG;(u5(Gfg#6{bQDB*Vyh_WG^XB`~! z5?55U0hTay$}y;uZ~GKbzDfcpe+NbkdCfVd;8!BSJa472Ok@%BBps8)BUc+f#PYnu z0u%i`Pt+&j$vz<|IxG*+AH=cm7x*OQe-=%#(*z2GRykr6JCZj&rA_Nckvi$%D8SLH zv<(mFWquFdc4|x^V%)=2y@XVY>VbppCX;$wADgvMXfAI`mbJ}5{ z-}bX62~gfpzYnJ9!FXX2)^A?CsPXNxZXs~mv;`i$KxI*M`o;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CCTJaWD$G?9&?_ zf`(+MA+ttcKt1OpHJ(u>QY7VBZq&$g+-J{oUx>>ww@CMiT$VD~WUCcQNA+=J*$}k%PnNf@_L)Uz-iw9ocFE&Dy3v_U~5TA@-aGz zBCWLLu$n5R+N!ErrK&--MIT|wiPZRvw8E6m94gK_$1B(j9k`sIK``~F5v~IXF2Q&B zdtho=6mfsh2NJ9`&cp6rku)~LVq<_+Es31Z=Mp~zzMpsaA0TG5^kSq9tN18n4t-#` z^!-*%RqOk&4>A^eq$CJ{-o@GZg{b2_2rL*CFFSa`HM6Sw1lh0-V0dWti$e;fFLeMg z*n~$Tvj7X;v`x;U*J5;{3e1`Xgag*`NCq&k*4Gkor+NajZxp+;o z!1nPZ>lKmjoM%%c9Uoj&Ty^*wO*tMkK8N$nKR}tlA6lJp)8+ z<@BjwV0RTrMdGlfl3I+Mm=N|z9yz&zo=$(S=05AKlkiPO6pAAhRCyz#a^m|aUFZ1? zo}HA5l#SV7PoOJQLggkMHj1v`QME4g4o+&eC0niyt;1&+G^4(eig}*LyPB&MsvKQp zIH;-yk#;Nsj;ifEpNOnO78y;52ybmA9<5-N4*bfJeYqUs=T_MEp>pnaoHi{#W7#Vgl&V>*K z*!Hcyw8)y6u;aT&#@Kk-_7#fK#cIjUuJg9dug_<^xvQ%$^nFs^7H{ghs^_Fm^3@Z$-)===]__o[===< \n [o__] \n ]| |[ \n [_| |_] ", - "f": " _ _,_,_ _ \n \\( q p )/ \n \\_\"_/ \n .==|>o<|==:=L\n '=c|___| \n /7 [| \n \\/7 [|_ " - }, - "spareParts": { - "eyes": { - "0": "o o", - "1": "p q", - "2": "q p", - "3": "d b", - "4": "b d", - "5": "ooo", - "6": "[o]", - "7": "9 9", - "8": "6=6", - "9": "u u", - "a": "n n", - "b": "q q", - "c": "d d", - "d": "- -", - "e": "0 0", - "f": "O O" - }, - "mouths": { - "0": "-", - "1": "=", - "2": "o", - "3": "O", - "4": "0", - "5": "#", - "6": "u", - "7": "v", - "8": "n", - "9": "r", - "a": "`", - "b": "^", - "c": "A", - "d": "@", - "e": "e", - "f": "E" - } - } - }; - - var idHelper = { - - isValid: function(id, minlength, maxlength, radix) { - var range = ""; - if (radix < 2 || radix > 36) { - throw "RangeError: radix must be an integer at least 2 and no greater than 36"; - } else if (radix <= 10) { - range = "0-" + String(radix - 1); - } else { - range = "0-9a-" + (radix - 1).toString(radix); - } - var re = new RegExp("^[" + range + "]{" + minlength + "," + maxlength + "}$"); - return (id && re.test(id.toLowerCase())); - }, - - random: function(length, radix) { - var id = ""; - for (var i = length; i > 0; i--) { - id = id + Math.floor(Math.random() * radix).toString(radix); - } - return id; - } - - }; - - function oneBot(id) { - var botIdDigits = idHelper.isValid(id, 3, 5, 16) ? id.split("") : idHelper.random(5, 16).split(""), - botString = botSplit(robots.templates[botIdDigits[botIdDigits.length - 3]])[0] + - botSplit(robots.templates[botIdDigits[botIdDigits.length - 2]])[1] + - botSplit(robots.templates[botIdDigits[botIdDigits.length - 1]])[2]; - if (botIdDigits.length >= 4) { - botString = replaceParts(botIdDigits[botIdDigits.length - 4], botString, robots.spareParts.eyes, 6, 1); - } - if (botIdDigits.length >= 5) { - botString = replaceParts(botIdDigits[botIdDigits.length - 5], botString, robots.spareParts.mouths, 7, 2); - } - return botString; - } - - function replaceParts(id, botString, parts, x, y) { - lines = botString.split("\n"); - newPart = parts[id]; - lines[y] = lines[y].slice(0, x) + newPart + lines[y].slice(x + newPart.length); - return lines.join("\n"); - } - - function botSplit(botString) { - var splitBot = []; - splitBot[0] = botString.split("\n").slice(0, 3).join("\n") + "\n"; - splitBot[1] = botString.split("\n").slice(3, 5).join("\n") + "\n"; - splitBot[2] = botString.split("\n").slice(5, 7).join("\n"); - return splitBot; - } - - return { - bot: oneBot - }; - + robots = { + "templates": { + "0": " ___T_ \n | o o | \n |__-__| \n /| []|\\ \n ()/|___|\\() \n |_|_| \n /_|_\\ ", + "1": " \\.===./ \n | b d | \n \\_=_/ \n o==|ooo|==o \n |___| \n .'._.'. \n |_| |_| ", + "2": " o___o \n //0-0\\\\ \n |\\_-_/| \n /|(\\)|\\ \n d |___| b \n . \\_/ . \n . .:::.. . ", + "3": " T___ \n |[o]| \n \\_-_/ \n 7--|=0=|--< \n |___| \n // \\\\ \n _\\\\ //_ ", + "4": " )_( \n |ooo| \n |_#_| \n .-._/___\\_.-. \n ; \\___/ ; \n ( ) \n __) (__ ", + "5": " |---| \n |6=6| \n |_o_| \n}-. /\\--o/\\ .-{\n \" |___| \" \n .\". \n |_| ", + "6": " .---. \n } - - { \n \\_0_/ \n .=[::+]=. \n ]=' [___] '=[ \n /| |\\ \n [_] [_] ", + "7": " Y__ \n _/o o\\_ \n \\_o_/ \n )=o=|L88|=o=( \n )=o=|___|=o=( \n . /___\\ . \n. ..:::::::. .", + "8": " .===. \n //d d\\\\ \n \\\\_u_// \n ,=|x|=. \n 'c/_\\ 'c \n /| |\\ \n (0) (0) ", + "9": " _._._ \n -)o o(- \n \\_=_/ \n()ooo|\\=/|ooo()\n |___| \n |_| \n (ooo) ", + "a": " .=._,=. \n ' (q q) ` \n _)-(_ \n.'c .\"|_|\". n`.\n'--' /_\\ `--'\n _// \\\\_ \n /_o| |o_\\ ", + "b": " .-. \n ._(u u)_. \n (_-_) \n .=(+++)=. \no=\" (___) \"=o\n (_|_) \n (o|o) ", + "c": " ,_,_, \n \\9 9/ \n /_-_\\ \n ,\"|+ |\". \n _\\|+__|/_ \n / | \n _\\ |_ ", + "d": " .===./` \n /.n n.\\ \n \"\\_=_/\" \n (m9\\:::/\\ \n /___\\6 \n [] [] \n /:] [:\\ ", + "e": " __i \n [p q] \n ]-[ \n >===]__o[===< \n [o__] \n ]| |[ \n [_| |_] ", + "f": " _ _,_,_ _ \n \\( q p )/ \n \\_\"_/ \n .==|>o<|==:=L\n '=c|___| \n /7 [| \n \\/7 [|_ " + }, + "spareParts": { + "eyes": { + "0": "o o", + "1": "p q", + "2": "q p", + "3": "d b", + "4": "b d", + "5": "ooo", + "6": "[o]", + "7": "9 9", + "8": "6=6", + "9": "u u", + "a": "n n", + "b": "q q", + "c": "d d", + "d": "- -", + "e": "0 0", + "f": "O O" + }, + "mouths": { + "0": "-", + "1": "=", + "2": "o", + "3": "O", + "4": "0", + "5": "#", + "6": "u", + "7": "v", + "8": "n", + "9": "r", + "a": "`", + "b": "^", + "c": "A", + "d": "@", + "e": "e", + "f": "E" + } + } + }; + var idHelper = { + isValid: function(id, minlength, maxlength, radix) { + var range = "", + idPattern; + if (radix < 2 || radix > 36) { + throw new RangeError("radix must be an integer at least 2 and no greater than 36"); + } else if (radix <= 10) { + range = "0-" + String(radix - 1); + } else { + range = "0-9a-" + (radix - 1).toString(radix); + } + idPattern = new RegExp("^[" + range + "]{" + minlength + "," + maxlength + "}$"); + return (id && idPattern.test(id.toLowerCase())); + }, + random: function(length, radix) { + var id = ""; + for (var i = length; i > 0; i--) { + id = id + Math.floor(Math.random() * radix).toString(radix); + } + return id; + } + }; + var oneBot = function(id) { + var botIdDigits = idHelper.isValid(id, 3, 5, 16) ? id.split("") : idHelper.random(5, 16).split(""), + botString = botSplit(robots.templates[botIdDigits[botIdDigits.length - 3]])[0] + + botSplit(robots.templates[botIdDigits[botIdDigits.length - 2]])[1] + + botSplit(robots.templates[botIdDigits[botIdDigits.length - 1]])[2]; + if (botIdDigits.length >= 4) { + botString = replaceParts(botIdDigits[botIdDigits.length - 4], botString, robots.spareParts.eyes, 6, 1); + } + if (botIdDigits.length >= 5) { + botString = replaceParts(botIdDigits[botIdDigits.length - 5], botString, robots.spareParts.mouths, 7, 2); + } + return botString; + }; + var replaceParts = function(id, botString, parts, x, y) { + var lines = botString.split("\n"), + newPart = parts[id]; + lines[y] = lines[y].slice(0, x) + newPart + lines[y].slice(x + newPart.length); + return lines.join("\n"); + }; + var botSplit = function(botString) { + var splitBot = []; + splitBot[0] = botString.split("\n").slice(0, 3).join("\n") + "\n"; + splitBot[1] = botString.split("\n").slice(3, 5).join("\n") + "\n"; + splitBot[2] = botString.split("\n").slice(5, 7).join("\n"); + return splitBot; + }; + return { + bot: oneBot + }; })(); diff --git a/www/js/jquery/asciibots.js b/www/js/jquery/asciibots.js index 4ced694..a0469c2 100644 --- a/www/js/jquery/asciibots.js +++ b/www/js/jquery/asciibots.js @@ -1,126 +1,117 @@ -/*! asciibots.js - v0.9 - 2014-08-21 +/*! asciibots.js - v1.0 - 2014-08-31 ** https://walsh9.github.io/asciibots ** Copyright (c) 2014 Matthew Walsh; Licensed under MIT license. */ - (function($) { - - $.fn.asciibot = function(botId) { - return this.each(function() { - $(this).text(oneBot(botId)); - return this; - }); - }; - - robots = { - "templates": { - "0": " ___T_ \n | o o | \n |__-__| \n /| []|\\ \n ()/|___|\\() \n |_|_| \n /_|_\\ ", - "1": " \\.===./ \n | b d | \n \\_=_/ \n o==|ooo|==o \n |___| \n .'._.'. \n |_| |_| ", - "2": " o___o \n //0-0\\\\ \n |\\_-_/| \n /|(\\)|\\ \n d |___| b \n . \\_/ . \n . .:::.. . ", - "3": " T___ \n |[o]| \n \\_-_/ \n 7--|=0=|--< \n |___| \n // \\\\ \n _\\\\ //_ ", - "4": " )_( \n |ooo| \n |_#_| \n .-._/___\\_.-. \n ; \\___/ ; \n ( ) \n __) (__ ", - "5": " |---| \n |6=6| \n |_o_| \n}-. /\\--o/\\ .-{\n \" |___| \" \n .\". \n |_| ", - "6": " .---. \n } - - { \n \\_0_/ \n .=[::+]=. \n ]=' [___] '=[ \n /| |\\ \n [_] [_] ", - "7": " Y__ \n _/o o\\_ \n \\_o_/ \n )=o=|L88|=o=( \n )=o=|___|=o=( \n . /___\\ . \n. ..:::::::. .", - "8": " .===. \n //d d\\\\ \n \\\\_u_// \n ,=|x|=. \n 'c/_\\ 'c \n /| |\\ \n (0) (0) ", - "9": " _._._ \n -)o o(- \n \\_=_/ \n()ooo|\\=/|ooo()\n |___| \n |_| \n (ooo) ", - "a": " .=._,=. \n ' (q q) ` \n _)-(_ \n.'c .\"|_|\". n`.\n'--' /_\\ `--'\n _// \\\\_ \n /_o| |o_\\ ", - "b": " .-. \n ._(u u)_. \n (_-_) \n .=(+++)=. \no=\" (___) \"=o\n (_|_) \n (o|o) ", - "c": " ,_,_, \n \\9 9/ \n /_-_\\ \n ,\"|+ |\". \n _\\|+__|/_ \n / | \n _\\ |_ ", - "d": " .===./` \n /.n n.\\ \n \"\\_=_/\" \n (m9\\:::/\\ \n /___\\6 \n [] [] \n /:] [:\\ ", - "e": " __i \n [p q] \n ]-[ \n >===]__o[===< \n [o__] \n ]| |[ \n [_| |_] ", - "f": " _ _,_,_ _ \n \\( q p )/ \n \\_\"_/ \n .==|>o<|==:=L\n '=c|___| \n /7 [| \n \\/7 [|_ " - }, - "spareParts": { - "eyes": { - "0": "o o", - "1": "p q", - "2": "q p", - "3": "d b", - "4": "b d", - "5": "ooo", - "6": "[o]", - "7": "9 9", - "8": "6=6", - "9": "u u", - "a": "n n", - "b": "q q", - "c": "d d", - "d": "- -", - "e": "0 0", - "f": "O O" - }, - "mouths": { - "0": "-", - "1": "=", - "2": "o", - "3": "O", - "4": "0", - "5": "#", - "6": "u", - "7": "v", - "8": "n", - "9": "r", - "a": "`", - "b": "^", - "c": "A", - "d": "@", - "e": "e", - "f": "E" - } - } - }; - - var idHelper = { - - isValid: function(id, minlength, maxlength, radix) { - var range = ""; - if (radix < 2 || radix > 36) { - throw "RangeError: radix must be an integer at least 2 and no greater than 36"; - } else if (radix <= 10) { - range = "0-" + String(radix - 1); - } else { - range = "0-9a-" + (radix - 1).toString(radix); - } - var re = new RegExp("^[" + range + "]{" + minlength + "," + maxlength + "}$"); - return (id && re.test(id.toLowerCase())); - }, - - random: function(length, radix) { - var id = ""; - for (var i = length; i > 0; i--) { - id = id + Math.floor(Math.random() * radix).toString(radix); - } - return id; - } - - }; - - function oneBot(id) { - var botIdDigits = idHelper.isValid(id, 3, 5, 16) ? id.split("") : idHelper.random(5, 16).split(""), - botString = botSplit(robots.templates[botIdDigits[botIdDigits.length - 3]])[0] + - botSplit(robots.templates[botIdDigits[botIdDigits.length - 2]])[1] + - botSplit(robots.templates[botIdDigits[botIdDigits.length - 1]])[2]; - if (botIdDigits.length >= 4) { - botString = replaceParts(botIdDigits[botIdDigits.length - 4], botString, robots.spareParts.eyes, 6, 1); - } - if (botIdDigits.length >= 5) { - botString = replaceParts(botIdDigits[botIdDigits.length - 5], botString, robots.spareParts.mouths, 7, 2); - } - return botString; - } - - function replaceParts(id, botString, parts, x, y) { - lines = botString.split("\n"); - newPart = parts[id]; - lines[y] = lines[y].slice(0, x) + newPart + lines[y].slice(x + newPart.length); - return lines.join("\n"); - } - - function botSplit(botString) { - var splitBot = []; - splitBot[0] = botString.split("\n").slice(0, 3).join("\n") + "\n"; - splitBot[1] = botString.split("\n").slice(3, 5).join("\n") + "\n"; - splitBot[2] = botString.split("\n").slice(5, 7).join("\n"); - return splitBot; - } + $.fn.asciibot = function(botId) { + return this.each(function() { + $(this).text(oneBot(botId)); + return this; + }); + }; + robots = { + "templates": { + "0": " ___T_ \n | o o | \n |__-__| \n /| []|\\ \n ()/|___|\\() \n |_|_| \n /_|_\\ ", + "1": " \\.===./ \n | b d | \n \\_=_/ \n o==|ooo|==o \n |___| \n .'._.'. \n |_| |_| ", + "2": " o___o \n //0-0\\\\ \n |\\_-_/| \n /|(\\)|\\ \n d |___| b \n . \\_/ . \n . .:::.. . ", + "3": " T___ \n |[o]| \n \\_-_/ \n 7--|=0=|--< \n |___| \n // \\\\ \n _\\\\ //_ ", + "4": " )_( \n |ooo| \n |_#_| \n .-._/___\\_.-. \n ; \\___/ ; \n ( ) \n __) (__ ", + "5": " |---| \n |6=6| \n |_o_| \n}-. /\\--o/\\ .-{\n \" |___| \" \n .\". \n |_| ", + "6": " .---. \n } - - { \n \\_0_/ \n .=[::+]=. \n ]=' [___] '=[ \n /| |\\ \n [_] [_] ", + "7": " Y__ \n _/o o\\_ \n \\_o_/ \n )=o=|L88|=o=( \n )=o=|___|=o=( \n . /___\\ . \n. ..:::::::. .", + "8": " .===. \n //d d\\\\ \n \\\\_u_// \n ,=|x|=. \n 'c/_\\ 'c \n /| |\\ \n (0) (0) ", + "9": " _._._ \n -)o o(- \n \\_=_/ \n()ooo|\\=/|ooo()\n |___| \n |_| \n (ooo) ", + "a": " .=._,=. \n ' (q q) ` \n _)-(_ \n.'c .\"|_|\". n`.\n'--' /_\\ `--'\n _// \\\\_ \n /_o| |o_\\ ", + "b": " .-. \n ._(u u)_. \n (_-_) \n .=(+++)=. \no=\" (___) \"=o\n (_|_) \n (o|o) ", + "c": " ,_,_, \n \\9 9/ \n /_-_\\ \n ,\"|+ |\". \n _\\|+__|/_ \n / | \n _\\ |_ ", + "d": " .===./` \n /.n n.\\ \n \"\\_=_/\" \n (m9\\:::/\\ \n /___\\6 \n [] [] \n /:] [:\\ ", + "e": " __i \n [p q] \n ]-[ \n >===]__o[===< \n [o__] \n ]| |[ \n [_| |_] ", + "f": " _ _,_,_ _ \n \\( q p )/ \n \\_\"_/ \n .==|>o<|==:=L\n '=c|___| \n /7 [| \n \\/7 [|_ " + }, + "spareParts": { + "eyes": { + "0": "o o", + "1": "p q", + "2": "q p", + "3": "d b", + "4": "b d", + "5": "ooo", + "6": "[o]", + "7": "9 9", + "8": "6=6", + "9": "u u", + "a": "n n", + "b": "q q", + "c": "d d", + "d": "- -", + "e": "0 0", + "f": "O O" + }, + "mouths": { + "0": "-", + "1": "=", + "2": "o", + "3": "O", + "4": "0", + "5": "#", + "6": "u", + "7": "v", + "8": "n", + "9": "r", + "a": "`", + "b": "^", + "c": "A", + "d": "@", + "e": "e", + "f": "E" + } + } + }; + var idHelper = { + isValid: function(id, minlength, maxlength, radix) { + var range = "", + idPattern; + if (radix < 2 || radix > 36) { + throw new RangeError("radix must be an integer at least 2 and no greater than 36"); + } else if (radix <= 10) { + range = "0-" + String(radix - 1); + } else { + range = "0-9a-" + (radix - 1).toString(radix); + } + idPattern = new RegExp("^[" + range + "]{" + minlength + "," + maxlength + "}$"); + return (id && idPattern.test(id.toLowerCase())); + }, + random: function(length, radix) { + var id = ""; + for (var i = length; i > 0; i--) { + id = id + Math.floor(Math.random() * radix).toString(radix); + } + return id; + } + }; + var oneBot = function(id) { + var botIdDigits = idHelper.isValid(id, 3, 5, 16) ? id.split("") : idHelper.random(5, 16).split(""), + botString = botSplit(robots.templates[botIdDigits[botIdDigits.length - 3]])[0] + + botSplit(robots.templates[botIdDigits[botIdDigits.length - 2]])[1] + + botSplit(robots.templates[botIdDigits[botIdDigits.length - 1]])[2]; + if (botIdDigits.length >= 4) { + botString = replaceParts(botIdDigits[botIdDigits.length - 4], botString, robots.spareParts.eyes, 6, 1); + } + if (botIdDigits.length >= 5) { + botString = replaceParts(botIdDigits[botIdDigits.length - 5], botString, robots.spareParts.mouths, 7, 2); + } + return botString; + }; + var replaceParts = function(id, botString, parts, x, y) { + var lines = botString.split("\n"), + newPart = parts[id]; + lines[y] = lines[y].slice(0, x) + newPart + lines[y].slice(x + newPart.length); + return lines.join("\n"); + }; + var botSplit = function(botString) { + var splitBot = []; + splitBot[0] = botString.split("\n").slice(0, 3).join("\n") + "\n"; + splitBot[1] = botString.split("\n").slice(3, 5).join("\n") + "\n"; + splitBot[2] = botString.split("\n").slice(5, 7).join("\n"); + return splitBot; + }; }(jQuery));