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 9494 script . onload = moduleLoadedCallback ;
9595 script . src = scriptUrl + ( scriptUrl . slice ( - 7 ) === '.dev.js' ? cacheSuffix : '' ) ;
9696 script . onerror = function ( ) {
97- $ . formUtils . warn ( 'Unable to load form validation module ' + scriptUrl ) ;
97+ $ . formUtils . warn ( 'Unable to load form validation module ' + scriptUrl , true ) ;
9898 moduleLoadedCallback ( ) ;
9999 } ;
100100 script . onreadystatechange = function ( ) {
Original file line number Diff line number Diff line change 7575 /**
7676 * Warn user via the console if available
7777 */
78- warn : function ( msg ) {
78+ warn : function ( msg , fallbackOnAlert ) {
7979 if ( 'console' in window ) {
8080 if ( typeof window . console . warn === 'function' ) {
8181 window . console . warn ( msg ) ;
8282 } else if ( typeof window . console . log === 'function' ) {
8383 window . console . log ( msg ) ;
8484 }
85- } else {
85+ } else if ( fallbackOnAlert ) {
86+ // This is for some old IE version...
8687 alert ( msg ) ;
8788 }
8889 } ,
Original file line number Diff line number Diff line change 7979 $ . formUtils . addValidator ( {
8080 name : 'mime' ,
8181 validatorFunction : function ( str , $input , conf , language ) {
82-
8382 if ( SUPPORTS_FILE_READER ) {
8483 var valid = true ,
8584 files = $input . get ( 0 ) . files || [ ] ,
8685 mime = '' ,
8786 allowedTypes = _getTypes ( $input ) ;
87+ console . log ( files [ 0 ] ) ;
8888
8989 if ( files . length ) {
9090 $ . each ( files , function ( i , file ) {
151151 validatorFunction : function ( val , $input , conf , language ) {
152152 var maxSize = $input . valAttr ( 'max-size' ) ;
153153 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 ) ;
155155 return true ;
156156 } else if ( ! SUPPORTS_FILE_READER ) {
157157 return true ; // no fallback available
Original file line number Diff line number Diff line change 4747 $passwordInput = $form . find ( '[name="' + passwordInputName + '"]' ) ;
4848 if ( ! $passwordInput . length ) {
4949 $ . formUtils . warn ( 'Password confirmation validator: could not find an input ' +
50- 'with name "' + passwordInputName + '"' ) ;
50+ 'with name "' + passwordInputName + '"' , true ) ;
5151 return false ;
5252 }
5353
105105 return false ;
106106 }
107107 } else {
108- $ . formUtils . warn ( 'Use of unknown credit card "' + cardName + '"' ) ;
108+ $ . formUtils . warn ( 'Use of unknown credit card "' + cardName + '"' , true ) ;
109109 }
110110 } ) ;
111111
558558
559559 $forms . each ( function ( ) {
560560 var $form = $ ( this ) ,
561- config = $form . context . validationConfig || false ;
561+ config = $form . get ( 0 ) . validationConfig || $form . context . validationConfig || false ;
562562
563563 if ( config ) {
564564 $ ( '[data-validation~="recaptcha"]' , $form ) . each ( function ( ) {
You can’t perform that action at this time.
0 commit comments