Make WordPress Core

Ticket #31233: 31233.right.diff

File 31233.right.diff, 2.2 KB (added by helen, 10 years ago)
  • src/wp-admin/css/common.css

     
    12581258.notice,
    12591259div.updated,
    12601260div.error {
     1261        position: relative;
    12611262        background: #fff;
    12621263        border-left: 4px solid #fff;
    12631264        -webkit-box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
     
    12921293    border-color: #00a0d2;
    12931294}
    12941295
     1296.notice .hide,
     1297div.updated .hide,
     1298div.error .hide {
     1299        display: block;
     1300        position: absolute;
     1301        top: 10px;
     1302        right: 15px;
     1303}
     1304
    12951305.wrap .notice,
    12961306.wrap div.updated,
    12971307.wrap div.error,
  • src/wp-admin/js/common.js

     
    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 dismissable
     377        $( 'div.updated, div.error, div.notice' ).each(function(){
     378                var $this = $(this),
     379                        text = commonL10n.hide || '',
     380                        $hide = $('<a href="#" class="hide"></a>');
     381
     382                // Ensure plain text
     383                $hide.text( text );
     384
     385                $this.append( $hide );
     386
     387                $hide.on('click', function(e){
     388                        e.preventDefault();
     389                        $this.remove();
     390                });
     391        });
     392
    376393        // Init screen meta
    377394        screenMeta.init();
    378395
  • src/wp-includes/script-loader.php

     
    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                'hide' => __( 'Hide' ),
    8384        ) );
    8485
    8586        $scripts->add( 'wp-a11y', "/wp-includes/js/wp-a11y$suffix.js", array( 'jquery' ), false, 1 );