From 8cb7c2b3b675f6606a8ede9212b4cfcda854971c Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Wed, 14 Dec 2011 08:49:16 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86jquery=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=BC=BA=E5=BA=A6=E9=AA=8C=E8=AF=81=E6=8F=92=E4=BB=B6?= =?UTF-8?q?passwordStrength?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/static/css/jquery.passwordStrength.css | 33 ++++++++++ htdocs/static/img/progressImg1.png | Bin 0 -> 390 bytes htdocs/static/js/jquery.passwordStrength.js | 62 ++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 htdocs/static/css/jquery.passwordStrength.css create mode 100644 htdocs/static/img/progressImg1.png create mode 100644 htdocs/static/js/jquery.passwordStrength.js diff --git a/htdocs/static/css/jquery.passwordStrength.css b/htdocs/static/css/jquery.passwordStrength.css new file mode 100644 index 00000000..80cd5845 --- /dev/null +++ b/htdocs/static/css/jquery.passwordStrength.css @@ -0,0 +1,33 @@ +.is0 { + BACKGROUND: url(../img/progressImg1.png) no-repeat 0px 0px; WIDTH: 138px; HEIGHT: 7px +} +.is10 { + BACKGROUND-POSITION: 0px -7px +} +.is20 { + BACKGROUND-POSITION: 0px -14px +} +.is30 { + BACKGROUND-POSITION: 0px -21px +} +.is40 { + BACKGROUND-POSITION: 0px -28px +} +.is50 { + BACKGROUND-POSITION: 0px -35px +} +.is60 { + BACKGROUND-POSITION: 0px -42px +} +.is70 { + BACKGROUND-POSITION: 0px -49px +} +.is80 { + BACKGROUND-POSITION: 0px -56px +} +.is90 { + BACKGROUND-POSITION: 0px -63px +} +.is100 { + BACKGROUND-POSITION: 0px -70px +} diff --git a/htdocs/static/img/progressImg1.png b/htdocs/static/img/progressImg1.png new file mode 100644 index 0000000000000000000000000000000000000000..a9093647cb45e1c8c2a50cad6f2878956f2f06b1 GIT binary patch literal 390 zcmeAS@N?(olHy`uVBq!ia0vp^T|n&1!3-q*w(vv&DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_d9MV0|RA+GiH_5c6>fA;LzqeqW6J>t24|Ni7l3{Rgvtv$l{ zi6DpifiI{ z`?=!IYr2cd=Z5TArxh1Hb(h`!O<^mu*YDeZe9A;kyZ>Di6%5o3%}+hpp2{`j;2i$X zev%wX5SF7PN7OqJgJw(nXJJ6*B_Ojh>x_D;LdLz|13b_EC)sH;I~LDoN;8;#q$ZH9 z>D7E7^LN6#DUA!HmN!VASvMp9ltX|lNUfE@ebHdI5){ + D=5 + } + var F=H.replace(/[0-9]/g,""); + var G=(H.length-F.length); + if(G>3){G=3} + var A=H.replace(/\W/g,""); + var C=(H.length-A.length); + if(C>3){C=3} + var B=H.replace(/[A-Z]/g,""); + var I=(H.length-B.length); + if(I>3){I=3} + var E=((D*10)-20)+(G*10)+(C*15)+(I*10); + if(E<0){E=0} + if(E>100){E=100} + return E + } + +}; + +$.fn.passwordStrength.defaults = { + classes : Array('is10','is20','is30','is40','is50','is60','is70','is80','is90','is100'), + targetDiv : '#passwordStrengthDiv', + cache : {} +} +$.passwordStrength = {}; +$.passwordStrength.getRandomPassword = function(size){ + var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + var size = size || 8; + var i = 1; + var ret = "" + while ( i <= size ) { + $max = chars.length-1; + $num = Math.floor(Math.random()*$max); + $temp = chars.substr($num, 1); + ret += $temp; + i++; + } + return ret; +} \ No newline at end of file