File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 5555 validate : function ( val , $el , conf ) {
5656 var validationRules = $el . attr ( conf . validationRuleAttribute ) ;
5757 var requiredStrength = $ . formUtils . getAttributeInteger ( validationRules , 'strength' ) ;
58- if ( requiredStrength > 2 )
59- requiredStrength = 2 ;
58+ if ( requiredStrength > 3 )
59+ requiredStrength = 3 ;
6060
6161 return $ . formUtils . validators . validate_strength . calculatePasswordStrength ( val ) >= requiredStrength ;
6262 } ,
155155 else if ( score < 68 ) {
156156 return 1 ;
157157 }
158- else {
158+ else if ( score < 90 ) {
159159 return 2 ;
160160 }
161+ else {
162+ return 3 ;
163+ }
161164 } ,
162165
163166 strengthDisplay : function ( $el , options ) {
164167 var config = {
165168 fontSize : '12pt' ,
166169 padding : '4px' ,
170+ bad : 'Very bad' ,
167171 weak : 'Weak' ,
168172 good : 'Good' ,
169173 strong : 'Strong'
198202 var text = config . weak ;
199203
200204 if ( strength == 1 ) {
205+ css . background = 'pink' ;
206+ css . borderColor = 'red' ;
207+ css . color = 'darkred' ;
208+ text = config . bad ;
209+ }
210+ else if ( strength == 2 ) {
201211 css . background = 'lightyellow' ;
202212 css . borderColor = 'yellow' ;
203213 css . color = 'goldenrod' ;
204214 text = config . good ;
205215 }
206- else if ( strength == 2 ) {
216+ else if ( strength == 3 ) {
207217 css . background = 'lightgreen' ;
208218 css . borderColor = 'darkgreen' ;
209219 css . color = 'darkgreen' ;
You can’t perform that action at this time.
0 commit comments