Make WordPress Core

Ticket #47018: 47018.diff

File 47018.diff, 3.2 KB (added by afercia, 4 years ago)
  • src/js/_enqueues/admin/tags.js

     
    101101        $('#submit').on( 'click', function(){
    102102                var form = $(this).parents('form');
    103103
    104                 if ( ! validateForm( form ) )
    105                         return false;
     104                validateForm( form );
    106105
    107106                if ( addingTerm ) {
    108107                        // If we're adding a term, noop the button to avoid duplicate requests.
  • src/js/_enqueues/lib/ajax-response.js

     
    5050                                parsed.responses.push( response );
    5151                        } );
    5252                        if ( err.length ) {
    53                                 re.html( '<div class="error">' + err + '</div>' );
     53                                re.html( '<div class="notice notice-error">' + err + '</div>' );
    5454                                wp.a11y.speak( err );
    5555                        } else if ( successmsg.length ) {
    56                                 re.html( '<div class="updated notice is-dismissible"><p>' + successmsg + '</p></div>');
     56                                re.html( '<div class="notice notice-success is-dismissible"><p>' + successmsg + '</p></div>');
    5757                                jQuery(document).trigger( 'wp-updates-notice-added' );
    5858                                wp.a11y.speak( successmsg );
    5959                        }
    6060                        return parsed;
    6161                }
    62                 if ( isNaN(x) ) { return !re.html('<div class="error"><p>' + x + '</p></div>'); }
    63                 x = parseInt(x,10);
    64                 if ( -1 === x ) { return !re.html('<div class="error"><p>' + wpAjax.noPerm + '</p></div>'); }
    65                 else if ( 0 === x ) { return !re.html('<div class="error"><p>' + wpAjax.broken  + '</p></div>'); }
     62                if ( isNaN( x ) ) {
     63                        wp.a11y.speak( x );
     64                        return ! re.html( '<div class="notice notice-error"><p>' + x + '</p></div>' );
     65                }
     66                x = parseInt( x, 10 );
     67                if ( -1 === x ) {
     68                        wp.a11y.speak( wpAjax.noPerm );
     69                        return ! re.html( '<div class="notice notice-error"><p>' + wpAjax.noPerm + '</p></div>' );
     70                }
     71                else if ( 0 === x ) {
     72                        wp.a11y.speak( wpAjax.broken );
     73                        return ! re.html( '<div class="notice notice-error"><p>' + wpAjax.broken  + '</p></div>' );
     74                }
    6675                return true;
    6776        },
    6877        invalidateForm: function ( selector ) {
  • src/wp-admin/css/forms.css

     
    245245.form-invalid.form-required select,
    246246.form-invalid.form-required select:focus {
    247247        border-color: #d63638 !important;
    248         box-shadow: 0 0 2px rgba(214, 54, 56, 0.8);
     248        box-shadow: 0 0 0 1px #d63638;
    249249}
    250250
    251251.form-table .form-required.form-invalid td:after {
  • src/wp-includes/script-loader.php

     
    694694
    695695        $scripts->add( 'clipboard', "/wp-includes/js/clipboard$suffix.js", array(), false, 1 );
    696696
    697         $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array( 'jquery' ), false, 1 );
     697        $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 );
    698698        did_action( 'init' ) && $scripts->localize(
    699699                'wp-ajax-response',
    700700                'wpAjax',