WordPress.org

Make WordPress Core

Ticket #31233: 31233.4.diff

File 31233.4.diff, 3.3 KB (added by valendesigns, 5 years ago)
  • src/wp-admin/css/common.css

    diff --git src/wp-admin/css/common.css src/wp-admin/css/common.css
    index 6a1e9d7..10a5d0f 100644
    div.error { 
    12801280        padding: 1px 12px;
    12811281}
    12821282
     1283.wrap div.dismiss {
     1284        padding-right: 38px;
     1285        position: relative;
     1286}
     1287
     1288.wrap div.dismiss button.close {
     1289        background: none;
     1290        border: none;
     1291        color: #bbb;
     1292        padding: 0.692em;
     1293        position: absolute;
     1294        right: 0;
     1295        top: 0;
     1296}
     1297
     1298.wrap div.dismiss button.close:hover {
     1299        color: #c00;
     1300        cursor: pointer;
     1301}
     1302
    12831303.notice p,
    12841304div.updated p,
    12851305div.error p,
    img { 
    31293149                line-height: 175%;
    31303150        }
    31313151
     3152        .wrap div.dismiss {
     3153                padding-right: 46px;
     3154        }
     3155
     3156        .wrap div.dismiss button.close {
     3157                padding: 0.929em;
     3158        }
     3159
    31323160        .wrap .icon32 + h2 {
    31333161                margin-top: -2px;
    31343162        }
  • src/wp-admin/edit-form-advanced.php

    diff --git src/wp-admin/edit-form-advanced.php src/wp-admin/edit-form-advanced.php
    index 92f56b7..bc072e4 100644
    if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create 
    410410<div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice ?></p></div>
    411411<?php endif; ?>
    412412<?php if ( $message ) : ?>
    413 <div id="message" class="updated"><p><?php echo $message; ?></p></div>
     413<div id="message" class="updated dismiss"><p><?php echo $message; ?></p></div>
    414414<?php endif; ?>
    415415<div id="lost-connection-notice" class="error hidden">
    416416        <p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you&#8217;re reconnected.' ); ?>
  • src/wp-admin/js/common.js

    diff --git src/wp-admin/js/common.js src/wp-admin/js/common.js
    index dda9247..5817d13 100644
    $(document).ready( function() { 
    373373        $firstHeading.nextAll( 'div.updated, div.error, div.notice' ).addClass( 'below-h2' );
    374374        $( 'div.updated, div.error, div.notice' ).not( '.below-h2, .inline' ).insertAfter( $firstHeading );
    375375
     376        // Make notices dismissible
     377        $( 'div.dismiss' ).each(function(){
     378                var $this = $(this),
     379                        $button = $( '<button class="close hide-if-no-js"><span class="dashicons dashicons-dismiss"><span class="screen-reader-text"></span></span></button>' ),
     380                        btnText = commonL10n.dismiss || '';
     381
     382                // Ensure plain text
     383                $button.find('.screen-reader-text').text( btnText );
     384
     385                $this.append( $button );
     386
     387                $button.on( 'click.wp-dismiss-notice', function( event ) {
     388                        event.preventDefault();
     389                        $this.fadeOut(200);
     390                });
     391        });
     392
    376393        // Init screen meta
    377394        screenMeta.init();
    378395
  • src/wp-includes/script-loader.php

    diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
    index 8120e3d..22bdeef 100644
    function wp_default_scripts( &$scripts ) { 
    7979
    8080        $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1 );
    8181        did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array(
    82                 'warnDelete' => __("You are about to permanently delete the selected items.\n  'Cancel' to stop, 'OK' to delete.")
     82                'warnDelete' => __( "You are about to permanently delete the selected items.\n  'Cancel' to stop, 'OK' to delete." ),
     83                'dismiss'    => __( 'Dismiss this notice.' )
    8384        ) );
    8485
    8586        $scripts->add( 'wp-a11y', "/wp-includes/js/wp-a11y$suffix.js", array( 'jquery' ), false, 1 );