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 55
55
validate : function ( val , $el , conf ) {
56
56
var validationRules = $el . attr ( conf . validationRuleAttribute ) ;
57
57
var requiredStrength = $ . formUtils . getAttributeInteger ( validationRules , 'strength' ) ;
58
- if ( requiredStrength > 2 )
59
- requiredStrength = 2 ;
58
+ if ( requiredStrength > 3 )
59
+ requiredStrength = 3 ;
60
60
61
61
return $ . formUtils . validators . validate_strength . calculatePasswordStrength ( val ) >= requiredStrength ;
62
62
} ,
155
155
else if ( score < 68 ) {
156
156
return 1 ;
157
157
}
158
- else {
158
+ else if ( score < 90 ) {
159
159
return 2 ;
160
160
}
161
+ else {
162
+ return 3 ;
163
+ }
161
164
} ,
162
165
163
166
strengthDisplay : function ( $el , options ) {
164
167
var config = {
165
168
fontSize : '12pt' ,
166
169
padding : '4px' ,
170
+ bad : 'Very bad' ,
167
171
weak : 'Weak' ,
168
172
good : 'Good' ,
169
173
strong : 'Strong'
198
202
var text = config . weak ;
199
203
200
204
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 ) {
201
211
css . background = 'lightyellow' ;
202
212
css . borderColor = 'yellow' ;
203
213
css . color = 'goldenrod' ;
204
214
text = config . good ;
205
215
}
206
- else if ( strength == 2 ) {
216
+ else if ( strength == 3 ) {
207
217
css . background = 'lightgreen' ;
208
218
css . borderColor = 'darkgreen' ;
209
219
css . color = 'darkgreen' ;
You can’t perform that action at this time.
0 commit comments