Make WordPress Core

Ticket #31233: 31233.20.diff

File 31233.20.diff, 4.5 KB (added by valendesigns, 10 years ago)
  • src/wp-admin/css/common.css

    diff --git src/wp-admin/css/common.css src/wp-admin/css/common.css
    index 6a1e9d7..3be632a 100644
    div.error p, 
    12881288        padding: 2px;
    12891289}
    12901290
     1291.notice.is-dismissible {
     1292        padding-right: 38px;
     1293        position: relative;
     1294}
     1295
     1296.notice-close {
     1297        height: 38px;
     1298        width: 38px;
     1299        position: absolute;
     1300        top: 0;
     1301        right: 0;
     1302        border: none;
     1303        margin: 0;
     1304        padding: 0.692em;
     1305        background: none;
     1306        color: #bbb;
     1307        cursor: pointer;
     1308}
     1309
     1310@-moz-document url-prefix() {
     1311        .notice-close {
     1312                top: 1px;
     1313                right: 1px;
     1314        }
     1315}
     1316
     1317.notice-close:hover {
     1318        color: #c00;
     1319}
     1320
     1321.notice-close:active,
     1322.notice-close:focus {
     1323        color: #c00;
     1324        outline: none;
     1325        -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
     1326        box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
     1327}
     1328
     1329.ie8 .notice-close:focus {
     1330        outline: 1px solid #5b9dd9;
     1331}
     1332
     1333.notice-close .dashicons-dismiss,
     1334.notice-close .dashicons-dismiss:before {
     1335        display: block;
     1336        position: relative;
     1337}
     1338
    12911339.notice-success,
    12921340div.updated {
    1293      border-color: #7ad03a;
     1341        border-color: #7ad03a;
    12941342}
    12951343
    12961344.notice-warning {
    1297     border-color: #ffba00;
     1345        border-color: #ffba00;
    12981346}
    12991347
    13001348.notice-error,
    13011349div.error {
    1302     border-color: #dd3d36;
     1350        border-color: #dd3d36;
    13031351}
    13041352
    13051353.notice-info {
    1306     border-color: #00a0d2;
     1354        border-color: #00a0d2;
    13071355}
    13081356
    13091357.wrap .notice,
    img { 
    31223170        }
    31233171
    31243172        /* Feedback Messages */
    3125         .wrap div.updated, .wrap div.error, .media-upload-form div.error {
     3173        .notice,
     3174        .wrap div.updated,
     3175        .wrap div.error,
     3176        .media-upload-form div.error {
    31263177                margin: 20px 0 10px 0;
    31273178                padding: 5px 10px;
    31283179                font-size: 14px;
    31293180                line-height: 175%;
    31303181        }
    31313182
     3183        .notice.is-dismissible {
     3184                padding-right: 46px;
     3185        }
     3186
     3187        .notice-close {
     3188                height: 46px;
     3189                width: 46px;
     3190                padding: 0.929em;
     3191        }
     3192
    31323193        .wrap .icon32 + h2 {
    31333194                margin-top: -2px;
    31343195        }
  • src/wp-admin/edit-form-advanced.php

    diff --git src/wp-admin/edit-form-advanced.php src/wp-admin/edit-form-advanced.php
    index 84cb32c..3a57e4c 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="update notice notice-success is-dismissible"><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 f879143..fb8e645 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        $( '.notice.is-dismissible' ).each( function() {
     378                var $this = $( this ),
     379                        $button = $( '<button type="button" class="notice-close"><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.fadeTo( 'fast' , 0, function() {
     390                                $(this).slideUp( 'fast', function() {
     391                                        $(this).remove();
     392                                });
     393                        });
     394                });
     395        });
     396
    376397        // Init screen meta
    377398        screenMeta.init();
    378399
  • src/wp-includes/script-loader.php

    diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
    index 90ef799..518b3c8 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 );