equal
deleted
inserted
replaced
48 if ( -1 == x ) { return !re.html('<div class="error"><p>' + wpAjax.noPerm + '</p></div>'); } |
48 if ( -1 == x ) { return !re.html('<div class="error"><p>' + wpAjax.noPerm + '</p></div>'); } |
49 else if ( 0 === x ) { return !re.html('<div class="error"><p>' + wpAjax.broken + '</p></div>'); } |
49 else if ( 0 === x ) { return !re.html('<div class="error"><p>' + wpAjax.broken + '</p></div>'); } |
50 return true; |
50 return true; |
51 }, |
51 }, |
52 invalidateForm: function ( selector ) { |
52 invalidateForm: function ( selector ) { |
53 return jQuery( selector ).addClass( 'form-invalid' ).change( function() { jQuery(this).removeClass( 'form-invalid' ); } ); |
53 return jQuery( selector ).addClass( 'form-invalid' ).find('input:visible').change( function() { jQuery(this).closest('.form-invalid').removeClass( 'form-invalid' ); } ); |
54 }, |
54 }, |
55 validateForm: function( selector ) { |
55 validateForm: function( selector ) { |
56 selector = jQuery( selector ); |
56 selector = jQuery( selector ); |
57 return !wpAjax.invalidateForm( selector.find('.form-required').filter( function() { return jQuery('input:visible', this).val() == ''; } ) ).size(); |
57 return !wpAjax.invalidateForm( selector.find('.form-required').filter( function() { return jQuery('input:visible', this).val() == ''; } ) ).size(); |
58 } |
58 } |