From: Alan Date: Mon, 31 Jul 2023 07:51:40 +0000 (+0800) Subject: fix #7737 - translatble strings - mostly on secure password X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=09bb7277616beaf154ca84887611bc9879293382 fix #7737 - translatble strings - mostly on secure password --- diff --git a/Roo/bootstrap/form/Input.js b/Roo/bootstrap/form/Input.js index bb88ec9030..9cdfb5962d 100644 --- a/Roo/bootstrap/form/Input.js +++ b/Roo/bootstrap/form/Input.js @@ -1056,7 +1056,7 @@ Roo.extend(Roo.bootstrap.form.Input, Roo.bootstrap.Component, { this.el.select('.form-control-feedback', true).first().addClass([this.invalidFeedbackClass]); - feedback.update(this.invalidText); + feedback.update(typeof(msg) == 'undefined' ? this.invalidText : msg); if(!this.allowBlank && !this.getRawValue().length){ feedback.update(this.blankText); diff --git a/Roo/bootstrap/form/SecurePass.js b/Roo/bootstrap/form/SecurePass.js index b75bc8dbb5..b8a8dee4c6 100644 --- a/Roo/bootstrap/form/SecurePass.js +++ b/Roo/bootstrap/form/SecurePass.js @@ -9,6 +9,7 @@ * @class Roo.bootstrap.form.SecurePass * @extends Roo.bootstrap.form.Input * Bootstrap SecurePass class + * @cfg {Number} minimumStrength invalid if the strength of the password input is less than the minimum strength (from 0 to 3) (default 2) * * * @constructor @@ -17,63 +18,15 @@ */ Roo.bootstrap.form.SecurePass = function (config) { - // these go here, so the translation tool can replace them.. - this.errors = { - 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." - }, - this.meterLabel = "Password strength:"; - this.pwdStrengths = ["Too Weak", "Weak", "Medium", "Strong"]; - this.meterClass = [ - "roo-password-meter-tooweak", - "roo-password-meter-weak", - "roo-password-meter-medium", - "roo-password-meter-strong", - "roo-password-meter-grey" - ]; - - this.errors = {}; Roo.bootstrap.form.SecurePass.superclass.constructor.call(this, config); } Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { - /** - * @cfg {String/Object} errors A Error spec, or true for a default spec (defaults to - * { - * 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." - * }) - */ + minimumStrength : 2, // private - - meterWidth: 300, - errorMsg :'', - errors: false, - imageRoot: '/', - /** - * @cfg {String/Object} Label for the strength meter (defaults to - * 'Password strength:') - */ - // private - meterLabel: '', - /** - * @cfg {String/Object} pwdStrengths A pwdStrengths spec, or true for a default spec (defaults to - * ['Weak', 'Medium', 'Strong']) - */ - // private - pwdStrengths: false, + meterWidth: 300, + imageRoot: '/', // private strength: 0, // private @@ -161,13 +114,13 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { //var pm = this.trigger.child('div/div/div').dom; var pm = this.trigger.child('div/div'); - pm.removeClass(this.meterClass); - pm.addClass(this.meterClass[strength]); + pm.removeClass(Roo.bootstrap.form.SecurePass.meterClass); + pm.addClass(Roo.bootstrap.form.SecurePass.meterClass[strength]); var pt = this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom; - pt.innerHTML = this.meterLabel + ' ' + this.pwdStrengths[strength]; + pt.innerHTML = Roo.bootstrap.form.SecurePass.meterLabel + ' ' + Roo.bootstrap.form.SecurePass.pwdStrengths[strength]; this._lastPwd = pwd; }, @@ -178,7 +131,7 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { this._lastPwd = ''; var pm = this.trigger.child('div/div'); - pm.removeClass(this.meterClass); + pm.removeClass(Roo.bootstrap.form.SecurePass.meterClass); pm.addClass('roo-password-meter-grey'); @@ -199,8 +152,7 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { return true; } - this.markInvalid(this.errors.PwdEmpty); - this.errorMsg = this.errors.PwdEmpty; + this.invalidText = Roo.bootstrap.form.SecurePass.errors.PwdEmpty; return false; } @@ -209,18 +161,15 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { } if (!value.match(/[\x21-\x7e]+/)) { - this.markInvalid(this.errors.PwdBadChar); - this.errorMsg = this.errors.PwdBadChar; + this.invalidText = Roo.bootstrap.form.SecurePass.errors.PwdBadChar; return false; } if (value.length < 6) { - this.markInvalid(this.errors.PwdShort); - this.errorMsg = this.errors.PwdShort; + this.invalidText = Roo.bootstrap.form.SecurePass.errors.PwdShort; return false; } if (value.length > 16) { - this.markInvalid(this.errors.PwdLong); - this.errorMsg = this.errors.PwdLong; + this.invalidText = Roo.bootstrap.form.SecurePass.errors.PwdLong; return false; } var strength; @@ -235,10 +184,9 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { } - if (strength < 2) { - //this.markInvalid(this.errors.TooWeak); - this.errorMsg = this.errors.TooWeak; - //return false; + if (strength < this.minimumStrength) { + this.invalidText = Roo.bootstrap.form.SecurePass.errors.TooWeak; + return false; } @@ -247,14 +195,13 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { //var pm = this.trigger.child('div/div/div').dom; var pm = this.trigger.child('div/div'); - pm.removeClass(this.meterClass); - pm.addClass(this.meterClass[strength]); + pm.removeClass(Roo.bootstrap.form.SecurePass.meterClass); + pm.addClass(Roo.bootstrap.form.SecurePass.meterClass[strength]); var pt = this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom; - pt.innerHTML = this.meterLabel + ' ' + this.pwdStrengths[strength]; - - this.errorMsg = ''; + pt.innerHTML = Roo.bootstrap.form.SecurePass.meterLabel + ' ' + Roo.bootstrap.form.SecurePass.pwdStrengths[strength]; + return true; }, // private @@ -351,4 +298,25 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { return this.IsLongEnough(pwd, 6) || !this.IsLongEnough(pwd, 0); } -}); \ No newline at end of file +}); + +Roo.bootstrap.form.SecurePass.errors = { + 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" +]; \ No newline at end of file diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index e44ef82e5a..3880c68514 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -13337,7 +13337,7 @@ Roo.extend(Roo.bootstrap.form.Input, Roo.bootstrap.Component, { this.el.select('.form-control-feedback', true).first().addClass([this.invalidFeedbackClass]); - feedback.update(this.invalidText); + feedback.update(typeof(msg) == 'undefined' ? this.invalidText : msg); if(!this.allowBlank && !this.getRawValue().length){ feedback.update(this.blankText); @@ -25721,6 +25721,7 @@ Roo.extend(Roo.bootstrap.form.Radio, Roo.bootstrap.Component, { * @class Roo.bootstrap.form.SecurePass * @extends Roo.bootstrap.form.Input * Bootstrap SecurePass class + * @cfg {Number} minimumStrength invalid if the strength of the password input is less than the minimum strength (from 0 to 3) (default 2) * * * @constructor @@ -25729,63 +25730,15 @@ Roo.extend(Roo.bootstrap.form.Radio, Roo.bootstrap.Component, { */ Roo.bootstrap.form.SecurePass = function (config) { - // these go here, so the translation tool can replace them.. - this.errors = { - 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." - }, - this.meterLabel = "Password strength:"; - this.pwdStrengths = ["Too Weak", "Weak", "Medium", "Strong"]; - this.meterClass = [ - "roo-password-meter-tooweak", - "roo-password-meter-weak", - "roo-password-meter-medium", - "roo-password-meter-strong", - "roo-password-meter-grey" - ]; - - this.errors = {}; Roo.bootstrap.form.SecurePass.superclass.constructor.call(this, config); } Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { - /** - * @cfg {String/Object} errors A Error spec, or true for a default spec (defaults to - * { - * 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." - * }) - */ + minimumStrength : 2, // private - - meterWidth: 300, - errorMsg :'', - errors: false, - imageRoot: '/', - /** - * @cfg {String/Object} Label for the strength meter (defaults to - * 'Password strength:') - */ - // private - meterLabel: '', - /** - * @cfg {String/Object} pwdStrengths A pwdStrengths spec, or true for a default spec (defaults to - * ['Weak', 'Medium', 'Strong']) - */ - // private - pwdStrengths: false, + meterWidth: 300, + imageRoot: '/', // private strength: 0, // private @@ -25873,13 +25826,13 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { //var pm = this.trigger.child('div/div/div').dom; var pm = this.trigger.child('div/div'); - pm.removeClass(this.meterClass); - pm.addClass(this.meterClass[strength]); + pm.removeClass(Roo.bootstrap.form.SecurePass.meterClass); + pm.addClass(Roo.bootstrap.form.SecurePass.meterClass[strength]); var pt = this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom; - pt.innerHTML = this.meterLabel + ' ' + this.pwdStrengths[strength]; + pt.innerHTML = Roo.bootstrap.form.SecurePass.meterLabel + ' ' + Roo.bootstrap.form.SecurePass.pwdStrengths[strength]; this._lastPwd = pwd; }, @@ -25890,7 +25843,7 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { this._lastPwd = ''; var pm = this.trigger.child('div/div'); - pm.removeClass(this.meterClass); + pm.removeClass(Roo.bootstrap.form.SecurePass.meterClass); pm.addClass('roo-password-meter-grey'); @@ -25911,8 +25864,7 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { return true; } - this.markInvalid(this.errors.PwdEmpty); - this.errorMsg = this.errors.PwdEmpty; + this.invalidText = Roo.bootstrap.form.SecurePass.errors.PwdEmpty; return false; } @@ -25921,18 +25873,15 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { } if (!value.match(/[\x21-\x7e]+/)) { - this.markInvalid(this.errors.PwdBadChar); - this.errorMsg = this.errors.PwdBadChar; + this.invalidText = Roo.bootstrap.form.SecurePass.errors.PwdBadChar; return false; } if (value.length < 6) { - this.markInvalid(this.errors.PwdShort); - this.errorMsg = this.errors.PwdShort; + this.invalidText = Roo.bootstrap.form.SecurePass.errors.PwdShort; return false; } if (value.length > 16) { - this.markInvalid(this.errors.PwdLong); - this.errorMsg = this.errors.PwdLong; + this.invalidText = Roo.bootstrap.form.SecurePass.errors.PwdLong; return false; } var strength; @@ -25947,10 +25896,9 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { } - if (strength < 2) { - //this.markInvalid(this.errors.TooWeak); - this.errorMsg = this.errors.TooWeak; - //return false; + if (strength < this.minimumStrength) { + this.invalidText = Roo.bootstrap.form.SecurePass.errors.TooWeak; + return false; } @@ -25959,14 +25907,13 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { //var pm = this.trigger.child('div/div/div').dom; var pm = this.trigger.child('div/div'); - pm.removeClass(this.meterClass); - pm.addClass(this.meterClass[strength]); + pm.removeClass(Roo.bootstrap.form.SecurePass.meterClass); + pm.addClass(Roo.bootstrap.form.SecurePass.meterClass[strength]); var pt = this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom; - pt.innerHTML = this.meterLabel + ' ' + this.pwdStrengths[strength]; - - this.errorMsg = ''; + pt.innerHTML = Roo.bootstrap.form.SecurePass.meterLabel + ' ' + Roo.bootstrap.form.SecurePass.pwdStrengths[strength]; + return true; }, // private @@ -26063,7 +26010,28 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, { return this.IsLongEnough(pwd, 6) || !this.IsLongEnough(pwd, 0); } -});/** +}); + +Roo.bootstrap.form.SecurePass.errors = { + 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 diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 5b68f24cca..a71032375e 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -568,8 +568,8 @@ this.inputEl().removeClass(['is-valid','is-invalid']);var A=this.el.select('.for this.el.select('.form-control-feedback',true).first().addClass([this.validFeedbackClass]);}}this.fireEvent('valid',this);},markInvalid:function(A){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);this.inputEl().removeClass(['is-valid','is-invalid']); var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);B.update('');B.hide();}if(this.disabled){return;}if(this.allowBlank&&!this.getRawValue().length){return; }if(this.indicator){this.indicator.removeClass(this.indicatorpos=='right'?'hidden':'invisible');this.indicator.addClass('visible');}if(Roo.bootstrap.version==3){this.el.addClass(this.invalidClass);}else{this.inputEl().addClass('is-invalid');}if(this.hasFeedback&&this.inputType!='hidden'){var B=this.el.select('.form-control-feedback',true).first(); -if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);this.el.select('.form-control-feedback',true).first().addClass([this.invalidFeedbackClass]);B.update(this.invalidText);if(!this.allowBlank&&!this.getRawValue().length){B.update(this.blankText); -}if(B.dom.innerHTML){B.show();}}}this.fireEvent('invalid',this,A);},SafariOnKeyDown:function(A){if(this.inputEl().dom.type!='password'){return;}var B=false;if(this.inputEl().dom.selectionEnd>0){B=(this.inputEl().dom.selectionEnd-this.inputEl().dom.selectionStart-this.getValue().length==0)?true:false; +if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);this.el.select('.form-control-feedback',true).first().addClass([this.invalidFeedbackClass]);B.update(typeof(A)=='undefined'?this.invalidText:A); +if(!this.allowBlank&&!this.getRawValue().length){B.update(this.blankText);}if(B.dom.innerHTML){B.show();}}}this.fireEvent('invalid',this,A);},SafariOnKeyDown:function(A){if(this.inputEl().dom.type!='password'){return;}var B=false;if(this.inputEl().dom.selectionEnd>0){B=(this.inputEl().dom.selectionEnd-this.inputEl().dom.selectionStart-this.getValue().length==0)?true:false; }if(((A.getKey()==8||A.getKey()==46)&&this.getValue().length==1)){A.preventDefault();this.setValue('');return;}if(B&&A.getCharCode()>31&&!A.ctrlKey){A.preventDefault();var cc=String.fromCharCode(A.getCharCode());this.setValue(A.shiftKey?cc:cc.toLowerCase()); }},adjustWidth:function(A,w){A=A.toLowerCase();if(typeof w=='number'&&Roo.isStrict&&!Roo.isSafari){if(Roo.isIE&&(A=='input'||A=='textarea')){if(A=='input'){return w+2;}if(A=='textarea'){return w-2;}}else if(Roo.isOpera){if(A=='input'){return w+2;}if(A=='textarea'){return w-2; }}}return w;},setFieldLabel:function(v){if(!this.rendered){return;}if(this.indicatorEl()){var ar=this.el.select('label > span',true);if(ar.elements.length){this.el.select('label > span',true).first().dom.innerHTML=(v===null||v===undefined?'':v);this.fieldLabel=v; @@ -1097,24 +1097,24 @@ Roo.bootstrap.form.Radio=function(A){Roo.bootstrap.form.Radio.superclass.constru ]};return A;},initEvents:function(){this.parent().register(this);this.el.on('click',this.onClick,this);},onClick:function(e){if(this.parent().fireEvent('click',this.parent(),this,e)!==false){this.setChecked(true);}},setChecked:function(A,B){this.parent().setValue(this.value,B); },setBoxLabel:function(v){this.boxLabel=v;if(this.rendered){this.el.select('label.box-label',true).first().dom.innerHTML=(v===null||v===undefined?'':v);}}}); // Roo/bootstrap/form/SecurePass.js -Roo.bootstrap.form.SecurePass=function(A){this.errors={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."} -,this.meterLabel="Password strength:";this.pwdStrengths=["Too Weak","Weak","Medium","Strong"];this.meterClass=["roo-password-meter-tooweak","roo-password-meter-weak","roo-password-meter-medium","roo-password-meter-strong","roo-password-meter-grey"];this.errors={} -;Roo.bootstrap.form.SecurePass.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.SecurePass,Roo.bootstrap.form.Input,{meterWidth:300,errorMsg:'',errors:false,imageRoot:'/',meterLabel:'',pwdStrengths:false,strength:0,_lastPwd:null,kCapitalLetter:0,kSmallLetter:1,kDigit:2,kPunctuation:3,insecure:false,initEvents:function(){Roo.bootstrap.form.SecurePass.superclass.initEvents.call(this); +Roo.bootstrap.form.SecurePass=function(A){Roo.bootstrap.form.SecurePass.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.SecurePass,Roo.bootstrap.form.Input,{minimumStrength:2,meterWidth:300,imageRoot:'/',strength:0,_lastPwd:null,kCapitalLetter:0,kSmallLetter:1,kDigit:2,kPunctuation:3,insecure:false,initEvents:function(){Roo.bootstrap.form.SecurePass.superclass.initEvents.call(this); if(this.el.is('input[type=password]')&&Roo.isSafari){this.el.on('keydown',this.SafariOnKeyDown,this);}this.el.on('keyup',this.checkStrength,this,{buffer:50});},onRender:function(ct,A){Roo.bootstrap.form.SecurePass.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:'x-form-field-wrap'} );this.trigger=this.wrap.createChild({tag:'div',cls:'StrengthMeter '+this.triggerClass});this.trigger.createChild({cn:[{tag:'div',cls:'roo-password-meter-grey col-xs-12',style:{}},{cls:'roo-password-meter-text'}]});if(this.hideTrigger){this.trigger.setDisplayed(false); }this.setSize(this.width||'',this.height||'');},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();this.trigger.remove();}if(this.wrap){this.wrap.remove();}Roo.bootstrap.form.TriggerField.superclass.onDestroy.call(this);},checkStrength:function(){var A=this.inputEl().getValue(); -if(A==this._lastPwd){return;}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;}Roo.log('strength1: '+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._lastPwd=A;},reset:function(){Roo.bootstrap.form.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.form.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;}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*[class=roo-password-meter-text]').dom;pt.innerHTML=Roo.bootstrap.form.SecurePass.meterLabel+' '+Roo.bootstrap.form.SecurePass.pwdStrengths[B];this._lastPwd=A; +},reset:function(){Roo.bootstrap.form.SecurePass.superclass.reset.call(this);this._lastPwd='';var pm=this.trigger.child('div/div');pm.removeClass(Roo.bootstrap.form.SecurePass.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.form.SecurePass.superclass.validateValue.call(this,A)){return false;}if(A.length==0){if(this.allowBlank){this.clearInvalid();return true;}this.invalidText=Roo.bootstrap.form.SecurePass.errors.PwdEmpty; +return false;}if(this.insecure){return true;}if(!A.match(/[\x21-\x7e]+/)){this.invalidText=Roo.bootstrap.form.SecurePass.errors.PwdBadChar;return false;}if(A.length<6){this.invalidText=Roo.bootstrap.form.SecurePass.errors.PwdShort;return false;}if(A.length>16){this.invalidText=Roo.bootstrap.form.SecurePass.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*[class=roo-password-meter-text]').dom; +pt.innerHTML=Roo.bootstrap.form.SecurePass.meterLabel+' '+Roo.bootstrap.form.SecurePass.pwdStrengths[B];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