File tree Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 94
94
script . onload = moduleLoadedCallback ;
95
95
script . src = scriptUrl + ( scriptUrl . slice ( - 7 ) === '.dev.js' ? cacheSuffix : '' ) ;
96
96
script . onerror = function ( ) {
97
- $ . formUtils . warn ( 'Unable to load form validation module ' + scriptUrl ) ;
97
+ $ . formUtils . warn ( 'Unable to load form validation module ' + scriptUrl , true ) ;
98
98
moduleLoadedCallback ( ) ;
99
99
} ;
100
100
script . onreadystatechange = function ( ) {
Original file line number Diff line number Diff line change 75
75
/**
76
76
* Warn user via the console if available
77
77
*/
78
- warn : function ( msg ) {
78
+ warn : function ( msg , fallbackOnAlert ) {
79
79
if ( 'console' in window ) {
80
80
if ( typeof window . console . warn === 'function' ) {
81
81
window . console . warn ( msg ) ;
82
82
} else if ( typeof window . console . log === 'function' ) {
83
83
window . console . log ( msg ) ;
84
84
}
85
- } else {
85
+ } else if ( fallbackOnAlert ) {
86
+ // This is for some old IE version...
86
87
alert ( msg ) ;
87
88
}
88
89
} ,
Original file line number Diff line number Diff line change 79
79
$ . formUtils . addValidator ( {
80
80
name : 'mime' ,
81
81
validatorFunction : function ( str , $input , conf , language ) {
82
-
83
82
if ( SUPPORTS_FILE_READER ) {
84
83
var valid = true ,
85
84
files = $input . get ( 0 ) . files || [ ] ,
86
85
mime = '' ,
87
86
allowedTypes = _getTypes ( $input ) ;
87
+ console . log ( files [ 0 ] ) ;
88
88
89
89
if ( files . length ) {
90
90
$ . each ( files , function ( i , file ) {
151
151
validatorFunction : function ( val , $input , conf , language ) {
152
152
var maxSize = $input . valAttr ( 'max-size' ) ;
153
153
if ( ! maxSize ) {
154
- $ . formUtils . warn ( 'Input "' + $input . attr ( 'name' ) + '" is missing data-validation-max-size attribute' ) ;
154
+ $ . formUtils . warn ( 'Input "' + $input . attr ( 'name' ) + '" is missing data-validation-max-size attribute' , true ) ;
155
155
return true ;
156
156
} else if ( ! SUPPORTS_FILE_READER ) {
157
157
return true ; // no fallback available
Original file line number Diff line number Diff line change 47
47
$passwordInput = $form . find ( '[name="' + passwordInputName + '"]' ) ;
48
48
if ( ! $passwordInput . length ) {
49
49
$ . formUtils . warn ( 'Password confirmation validator: could not find an input ' +
50
- 'with name "' + passwordInputName + '"' ) ;
50
+ 'with name "' + passwordInputName + '"' , true ) ;
51
51
return false ;
52
52
}
53
53
105
105
return false ;
106
106
}
107
107
} else {
108
- $ . formUtils . warn ( 'Use of unknown credit card "' + cardName + '"' ) ;
108
+ $ . formUtils . warn ( 'Use of unknown credit card "' + cardName + '"' , true ) ;
109
109
}
110
110
} ) ;
111
111
558
558
559
559
$forms . each ( function ( ) {
560
560
var $form = $ ( this ) ,
561
- config = $form . context . validationConfig || false ;
561
+ config = $form . get ( 0 ) . validationConfig || $form . context . validationConfig || false ;
562
562
563
563
if ( config ) {
564
564
$ ( '[data-validation~="recaptcha"]' , $form ) . each ( function ( ) {
You can’t perform that action at this time.
0 commit comments