diff --git src/wp-admin/css/common.css src/wp-admin/css/common.css
index 6a1e9d7..c51c225 100644
|
|
div.error p, |
1288 | 1288 | padding: 2px; |
1289 | 1289 | } |
1290 | 1290 | |
| 1291 | .notice-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 | position: relative; |
| 1335 | top: 0; |
| 1336 | left: 0; |
| 1337 | vertical-align: text-bottom; |
| 1338 | } |
| 1339 | |
| 1340 | .notice-close .dashicons-dismiss:before { |
| 1341 | vertical-align: top; |
| 1342 | } |
| 1343 | |
| 1344 | .ie8 .notice-close .dashicons-dismiss:before { |
| 1345 | display: block; |
| 1346 | } |
| 1347 | |
1291 | 1348 | .notice-success, |
1292 | 1349 | div.updated { |
1293 | | border-color: #7ad03a; |
| 1350 | border-color: #7ad03a; |
1294 | 1351 | } |
1295 | 1352 | |
1296 | 1353 | .notice-warning { |
1297 | | border-color: #ffba00; |
| 1354 | border-color: #ffba00; |
1298 | 1355 | } |
1299 | 1356 | |
1300 | 1357 | .notice-error, |
1301 | 1358 | div.error { |
1302 | | border-color: #dd3d36; |
| 1359 | border-color: #dd3d36; |
1303 | 1360 | } |
1304 | 1361 | |
1305 | 1362 | .notice-info { |
1306 | | border-color: #00a0d2; |
| 1363 | border-color: #00a0d2; |
1307 | 1364 | } |
1308 | 1365 | |
1309 | 1366 | .wrap .notice, |
… |
… |
img { |
3122 | 3179 | } |
3123 | 3180 | |
3124 | 3181 | /* Feedback Messages */ |
3125 | | .wrap div.updated, .wrap div.error, .media-upload-form div.error { |
| 3182 | .notice, .wrap div.updated, .wrap div.error, .media-upload-form div.error { |
3126 | 3183 | margin: 20px 0 10px 0; |
3127 | 3184 | padding: 5px 10px; |
3128 | 3185 | font-size: 14px; |
3129 | 3186 | line-height: 175%; |
3130 | 3187 | } |
3131 | 3188 | |
| 3189 | .notice-dismissible { |
| 3190 | padding-right: 46px; |
| 3191 | } |
| 3192 | |
| 3193 | .notice-close { |
| 3194 | height: 46px; |
| 3195 | width: 46px; |
| 3196 | padding: 0.929em; |
| 3197 | } |
| 3198 | |
| 3199 | noindex:-o-prefocus, .notice-close .dashicons-dismiss { |
| 3200 | vertical-align: bottom; |
| 3201 | } |
| 3202 | |
3132 | 3203 | .wrap .icon32 + h2 { |
3133 | 3204 | margin-top: -2px; |
3134 | 3205 | } |
diff --git src/wp-admin/edit-form-advanced.php src/wp-admin/edit-form-advanced.php
index 84cb32c..87cb06b 100644
|
|
if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create |
410 | 410 | <div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice ?></p></div> |
411 | 411 | <?php endif; ?> |
412 | 412 | <?php if ( $message ) : ?> |
413 | | <div id="message" class="updated"><p><?php echo $message; ?></p></div> |
| 413 | <div id="message" class="notice notice-success notice-dismissible"> |
| 414 | <p><?php echo $message; ?></p> |
| 415 | <button type="button" class="notice-close hide-if-no-js"> |
| 416 | <span class="dashicons dashicons-dismiss"> |
| 417 | <span class="screen-reader-text"></span> |
| 418 | </span> |
| 419 | </button> |
| 420 | </div> |
414 | 421 | <?php endif; ?> |
415 | 422 | <div id="lost-connection-notice" class="error hidden"> |
416 | 423 | <p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you’re reconnected.' ); ?> |
diff --git src/wp-admin/js/common.js src/wp-admin/js/common.js
index f879143..c7ef78d 100644
|
|
$(document).ready( function() { |
373 | 373 | $firstHeading.nextAll( 'div.updated, div.error, div.notice' ).addClass( 'below-h2' ); |
374 | 374 | $( 'div.updated, div.error, div.notice' ).not( '.below-h2, .inline' ).insertAfter( $firstHeading ); |
375 | 375 | |
| 376 | // Make notices dismissible |
| 377 | $( '.notice-dismissible' ).each( function() { |
| 378 | var $this = $( this ), |
| 379 | $button = $( '.notice-close', $this ), |
| 380 | btnText = commonL10n.dismiss || '', |
| 381 | append = false; |
| 382 | |
| 383 | // Create the button markup if it has not been added |
| 384 | if ( $button.length === 0 ) { |
| 385 | append = true; |
| 386 | $button = $( '<button type="button" class="notice-close hide-if-no-js"><span class="dashicons dashicons-dismiss"><span class="screen-reader-text"></span></span></button>' ); |
| 387 | } |
| 388 | |
| 389 | // Ensure plain text |
| 390 | $button.find( '.screen-reader-text' ).text( btnText ); |
| 391 | |
| 392 | // Only append if we need to |
| 393 | if ( append ) { |
| 394 | $this.append( $button ); |
| 395 | } |
| 396 | |
| 397 | $button.on( 'click.wp-dismiss-notice', function( event ) { |
| 398 | event.preventDefault(); |
| 399 | $this.fadeTo( 'fast' , 0, function() { |
| 400 | $(this).slideUp( 'fast' ); |
| 401 | }); |
| 402 | }); |
| 403 | }); |
| 404 | |
376 | 405 | // Init screen meta |
377 | 406 | screenMeta.init(); |
378 | 407 | |
diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
index 90ef799..518b3c8 100644
|
|
function wp_default_scripts( &$scripts ) { |
79 | 79 | |
80 | 80 | $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1 ); |
81 | 81 | 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.' ), |
83 | 84 | ) ); |
84 | 85 | |
85 | 86 | $scripts->add( 'wp-a11y', "/wp-includes/js/wp-a11y$suffix.js", array( 'jquery' ), false, 1 ); |