roojs-bootstrap.js
authorleon <leon@roojs.com>
Wed, 19 Jul 2023 04:57:32 +0000 (12:57 +0800)
committerleon <leon@roojs.com>
Wed, 19 Jul 2023 04:57:32 +0000 (12:57 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index e44ef82..5aa8144 100644 (file)
@@ -12970,6 +12970,7 @@ Roo.extend(Roo.bootstrap.form.Input, Roo.bootstrap.Component,  {
      * @return {Boolean} True if the value is valid, else false
      */
     validate : function(){
+        Roo.log('VALIDATE');
         //if(this.disabled || this.validateValue(this.processValue(this.getRawValue()))){
         if(this.disabled || this.validateValue(this.getRawValue())){
             this.markValid();
@@ -26063,7 +26064,28 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, {
         return this.IsLongEnough(pwd, 6) || !this.IsLongEnough(pwd, 0);
     }
           
-});/**
+});
+
+Roo.bootstrap.form.SecurePass.error = {
+    PwdEmpty: "Please type a password, and then retype it to confirm.",
+    PwdShort: "Your password must be at least 6 characters long. Please type a different password.",
+    PwdLong: "Your password can't contain more than 16 characters. Please type a different password.",
+    PwdBadChar: "The password contains characters that aren't allowed. Please type a different password.",
+    IDInPwd: "Your password can't include the part of your ID. Please type a different password.",
+    FNInPwd: "Your password can't contain your first name. Please type a different password.",
+    LNInPwd: "Your password can't contain your last name. Please type a different password.",
+    TooWeak: "Your password is Too Weak."
+};
+
+Roo.bootstrap.form.SecurePass.meterLabel = "Password strength:";
+Roo.bootstrap.form.SecurePass.pwdStrengths = ["Too Weak", "Weak", "Medium", "Strong"];
+Roo.bootstrap.form.SecurePass.meterClass = [
+    "roo-password-meter-tooweak", 
+    "roo-password-meter-weak", 
+    "roo-password-meter-medium", 
+    "roo-password-meter-strong", 
+    "roo-password-meter-grey"
+];/**
  * @class Roo.bootstrap.form.Password
  * @extends Roo.bootstrap.form.Input
  * Bootstrap Password class
index 5b68f24..c10915e 100644 (file)
@@ -549,8 +549,8 @@ this.inputEl().relayEvent('paste',this);this.indicator=this.indicatorEl();if(thi
 this.inputEl().on('keyup',this.filterValidation,this);}else if(this.validationEvent!==false){this.inputEl().on(this.validationEvent,this.validate,this,{buffer:this.validationDelay});}if(this.selectOnFocus){this.on("focus",this.preFocus,this);}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Roo.form.VTypes[this.vtype+'Mask']))){this.inputEl().on("keypress",this.filterKeys,this);
 }else{this.inputEl().relayEvent('keypress',this);}if(this.inputEl().is('input[type=password]')&&Roo.isSafari){this.inputEl().on('keydown',this.SafariOnKeyDown,this);}if(typeof(this.before)=='object'){this.before.render(this.el.select('.roo-input-before',true).first());
 }if(typeof(this.after)=='object'){this.after.render(this.el.select('.roo-input-after',true).first());}this.inputEl().on('change',this.onChange,this);if(this.hasFeedback&&this.inputType!='hidden'){var A=this.el.select('.form-control-feedback',true).first();
-if(A){A.hide();}}},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);}},validate:function(){if(this.disabled||this.validateValue(this.getRawValue())){this.markValid();return true;}this.markInvalid();return false;
-},validateValue:function(A){if(this.getVisibilityEl().hasClass('hidden')){return true;}if(A.length<1){if(this.allowBlank){return true;}return false;}if(A.length<this.minLength){return false;}if(A.length>this.maxLength){return false;}if(this.vtype){var vt=Roo.form.VTypes;
+if(A){A.hide();}}},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);}},validate:function(){Roo.log('VALIDATE');if(this.disabled||this.validateValue(this.getRawValue())){this.markValid();return true;}this.markInvalid();
+return false;},validateValue:function(A){if(this.getVisibilityEl().hasClass('hidden')){return true;}if(A.length<1){if(this.allowBlank){return true;}return false;}if(A.length<this.minLength){return false;}if(A.length>this.maxLength){return false;}if(this.vtype){var vt=Roo.form.VTypes;
 if(!vt[this.vtype](A,this)){return false;}}if(typeof this.validator=="function"){var B=this.validator(A);if(typeof(B)=='string'){this.invalidText=B;}if(B!==true){return false;}}if(this.regex&&!this.regex.test(A)){return false;}return true;},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);
 }},focus:function(A){if(this.rendered){this.inputEl().focus();if(A===true){this.inputEl().dom.select();}}return this;},onFocus:function(){if(!Roo.isOpera&&this.focusClass){}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);
 }},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);
@@ -1114,7 +1114,9 @@ pt.innerHTML=this.meterLabel+'&nbsp;'+this.pwdStrengths[B];this.errorMsg='';retu
 }break;case this.kDigit:if(A>='0'&&A<='9'){return true;}break;case this.kPunctuation:if('!@#$%^&*()_+-=\'";:[{]}|.>,</?`~'.indexOf(A)>=0){return true;}break;default:return false;}},IsLongEnough:function(A,B){return !(A==null||isNaN(B)||A.length<B);},SpansEnoughCharacterSets:function(A,nb){if(!this.IsLongEnough(A,nb)){return false;
 }var B=new Array(new this.CharacterSetChecks(this.kCapitalLetter),new this.CharacterSetChecks(this.kSmallLetter),new this.CharacterSetChecks(this.kDigit),new this.CharacterSetChecks(this.kPunctuation));for(var C=0;C<A.length;++C){for(var D=0;D<B.length;++D){if(!B[D].fResult&&this.isctype(A.charAt(C),B[D].type)){B[D].fResult=true;
 break;}}}var E=0;for(var D=0;D<B.length;++D){if(B[D].fResult){++E;}}if(E<nb){return false;}return true;},ClientSideStrongPassword:function(A){return this.IsLongEnough(A,8)&&this.SpansEnoughCharacterSets(A,3);},ClientSideMediumPassword:function(A){return this.IsLongEnough(A,7)&&this.SpansEnoughCharacterSets(A,2);
-},ClientSideWeakPassword:function(A){return this.IsLongEnough(A,6)||!this.IsLongEnough(A,0);}});
+},ClientSideWeakPassword:function(A){return this.IsLongEnough(A,6)||!this.IsLongEnough(A,0);}});Roo.bootstrap.form.SecurePass.error={PwdEmpty:"Please type a password, and then retype it to confirm.",PwdShort:"Your password must be at least 6 characters long. Please type a different password.",PwdLong:"Your password can't contain more than 16 characters. Please type a different password.",PwdBadChar:"The password contains characters that aren't allowed. Please type a different password.",IDInPwd:"Your password can't include the part of your ID. Please type a different password.",FNInPwd:"Your password can't contain your first name. Please type a different password.",LNInPwd:"Your password can't contain your last name. Please type a different password.",TooWeak:"Your password is Too Weak."}
+;Roo.bootstrap.form.SecurePass.meterLabel="Password strength:";Roo.bootstrap.form.SecurePass.pwdStrengths=["Too Weak","Weak","Medium","Strong"];Roo.bootstrap.form.SecurePass.meterClass=["roo-password-meter-tooweak","roo-password-meter-weak","roo-password-meter-medium","roo-password-meter-strong","roo-password-meter-grey"];
+
 // Roo/bootstrap/form/Password.js
 Roo.bootstrap.form.Password=function(A){Roo.bootstrap.form.Password.superclass.constructor.call(this,A);this.inputType='password';};Roo.extend(Roo.bootstrap.form.Password,Roo.bootstrap.form.Input,{onRender:function(ct,A){Roo.bootstrap.form.SecurePass.superclass.onRender.call(this,ct,A);
 this.el.addClass('form-password');this.wrap=this.inputEl().wrap({cls:'password-wrap'});this.toggle=this.wrap.createChild({tag:'Button',cls:'password-toggle'});this.toggleEl().addClass('password-hidden');this.toggleEl().on('click',this.onToggleClick,this);