From: Alan Knowles Date: Wed, 30 Dec 2020 06:34:59 +0000 (+0800) Subject: roojs-bootstrap.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=b12e051302bb400eb4d011be5db380ccc0e5e956 roojs-bootstrap.js roojs-bootstrap-debug.js Roo/bootstrap/SecurePass.js --- diff --git a/Roo/bootstrap/SecurePass.js b/Roo/bootstrap/SecurePass.js index c770a79b95..d2ed3908d2 100644 --- a/Roo/bootstrap/SecurePass.js +++ b/Roo/bootstrap/SecurePass.js @@ -208,7 +208,7 @@ Roo.extend(Roo.bootstrap.SecurePass, Roo.bootstrap.Input, { if(this.insecure){ return true; } - + if (!value.match(/[\x21-\x7e]*/)) { this.markInvalid(this.errors.PwdBadChar); this.errorMsg = this.errors.PwdBadChar; diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 6f0d9bfa12..15d5fc5347 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -23505,7 +23505,7 @@ Roo.extend(Roo.bootstrap.SecurePass, Roo.bootstrap.Input, { return true; } - if (value.match(/[\x21-\x7e]*/)) { + if (!value.match(/[\x21-\x7e]*/)) { this.markInvalid(this.errors.PwdBadChar); this.errorMsg = this.errors.PwdBadChar; return false; diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 1abb2a68d4..9b1626fee7 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -991,8 +991,8 @@ if(A==this._lastPwd){return;}var B;if(this.ClientSideStrongPassword(A)){B=3;}els pm.addClass(this.meterClass[B]);var pt=this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom;pt.innerHTML=this.meterLabel+' '+this.pwdStrengths[B];this._lastPwd=A;},reset:function(){Roo.bootstrap.SecurePass.superclass.reset.call(this); this._lastPwd='';var pm=this.trigger.child('div/div');pm.removeClass(this.meterClass);pm.addClass('roo-password-meter-grey');var pt=this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom;pt.innerHTML='';this.inputEl().dom.type='password'; },validateValue:function(A){if(!Roo.bootstrap.SecurePass.superclass.validateValue.call(this,A)){return false;}if(A.length==0){if(this.allowBlank){this.clearInvalid();return true;}this.markInvalid(this.errors.PwdEmpty);this.errorMsg=this.errors.PwdEmpty;return false; -}if(this.insecure){return true;}if(A.match(/[\x21-\x7e]*/)){this.markInvalid(this.errors.PwdBadChar);this.errorMsg=this.errors.PwdBadChar;return false;}if(A.length<6){this.markInvalid(this.errors.PwdShort);this.errorMsg=this.errors.PwdShort;return false;} -if(A.length>16){this.markInvalid(this.errors.PwdLong);this.errorMsg=this.errors.PwdLong;return false;}var B;if(this.ClientSideStrongPassword(A)){B=3;}else if(this.ClientSideMediumPassword(A)){B=2;}else if(this.ClientSideWeakPassword(A)){B=1;}else{B=0;}if(B<2){this.errorMsg=this.errors.TooWeak; +}if(this.insecure){return true;}if(!A.match(/[\x21-\x7e]*/)){this.markInvalid(this.errors.PwdBadChar);this.errorMsg=this.errors.PwdBadChar;return false;}if(A.length<6){this.markInvalid(this.errors.PwdShort);this.errorMsg=this.errors.PwdShort;return false; +}if(A.length>16){this.markInvalid(this.errors.PwdLong);this.errorMsg=this.errors.PwdLong;return false;}var B;if(this.ClientSideStrongPassword(A)){B=3;}else if(this.ClientSideMediumPassword(A)){B=2;}else if(this.ClientSideWeakPassword(A)){B=1;}else{B=0;}if(B<2){this.errorMsg=this.errors.TooWeak; }console.log('strength2: '+B);var pm=this.trigger.child('div/div');pm.removeClass(this.meterClass);pm.addClass(this.meterClass[B]);var pt=this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom;pt.innerHTML=this.meterLabel+' '+this.pwdStrengths[B]; this.errorMsg='';return true;},CharacterSetChecks:function(A){this.type=A;this.fResult=false;},isctype:function(A,B){switch(B){case this.kCapitalLetter:if(A>='A'&&A<='Z'){return true;}break;case this.kSmallLetter:if(A>='a'&&A<='z'){return true;}break;case this.kDigit:if(A>='0'&&A<='9'){return true; }break;case this.kPunctuation:if('!@#$%^&*()_+-=\'";:[{]}|.>,=0){return true;}break;default:return false;}},IsLongEnough:function(A,B){return !(A==null||isNaN(B)||A.length