File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ var config = {
2+ config : {
3+ mixins : {
4+ 'mage/validation' : {
5+ 'Aligent_Pci4Compatibility/js/system/config/validator-mixin' : true
6+ } ,
7+ }
8+ }
9+ } ;
Original file line number Diff line number Diff line change 1+ define ( [
2+ 'jquery'
3+ ] , function ( $ ) {
4+ 'use strict' ;
5+
6+ return function ( target ) {
7+ $ . validator . addMethod (
8+ 'validate-admin-password' ,
9+ function ( v ) {
10+ var pass ;
11+
12+ if ( v == null ) {
13+ return false ;
14+ }
15+ // strip leading and trailing spaces
16+ pass = v . trim ( ) ;
17+ // password is not being changed
18+ if ( pass . length === 0 ) {
19+ return true ;
20+ }
21+
22+ if ( ! / [ a - z ] / i. test ( v ) || ! / [ 0 - 9 ] / . test ( v ) ) {
23+ return false ;
24+ }
25+
26+ return pass . length >= 12 ;
27+ } ,
28+ $ . mage . __ ( 'Please enter 12 or more characters, using both numeric and alphabetic.' )
29+ ) ;
30+
31+ return target ;
32+ } ;
33+ } ) ;
You can’t perform that action at this time.
0 commit comments