Ticket #55537: 55537.diff
File 55537.diff, 2.3 KB (added by , 3 years ago) |
---|
-
src/js/_enqueues/lib/ajax-response.js
50 50 parsed.responses.push( response ); 51 51 } ); 52 52 if ( err.length ) { 53 re.html( '<div class=" error">' + err + '</div>' );53 re.html( '<div class="notice notice-error">' + err + '</div>' ); 54 54 wp.a11y.speak( err ); 55 55 } else if ( successmsg.length ) { 56 re.html( '<div class=" updated noticeis-dismissible"><p>' + successmsg + '</p></div>');56 re.html( '<div class="notice notice-success is-dismissible"><p>' + successmsg + '</p></div>'); 57 57 jQuery(document).trigger( 'wp-updates-notice-added' ); 58 58 wp.a11y.speak( successmsg ); 59 59 } 60 60 return parsed; 61 61 } 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 } 66 75 return true; 67 76 }, 68 77 invalidateForm: function ( selector ) { -
src/wp-includes/script-loader.php
694 694 695 695 $scripts->add( 'clipboard', "/wp-includes/js/clipboard$suffix.js", array(), false, 1 ); 696 696 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 ); 698 698 did_action( 'init' ) && $scripts->localize( 699 699 'wp-ajax-response', 700 700 'wpAjax',