Ticket #31233: 31233.2.diff
File 31233.2.diff, 3.5 KB (added by , 10 years ago) |
---|
-
src/wp-admin/css/common.css
diff --git src/wp-admin/css/common.css src/wp-admin/css/common.css index 054ef23..d153f8d 100644
div.error { 1263 1263 -webkit-box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 ); 1264 1264 box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 ); 1265 1265 margin: 5px 15px 2px; 1266 overflow: hidden; 1266 1267 padding: 1px 12px; 1267 1268 } 1268 1269 … … div.error p, 1276 1277 1277 1278 .notice-success, 1278 1279 div.updated { 1279 1280 border-color: #7ad03a; 1280 1281 } 1281 1282 1282 1283 .notice-warning { 1283 1284 border-color: #ffba00; 1284 1285 } 1285 1286 1286 1287 .notice-error, 1287 1288 div.error { 1288 1289 border-color: #dd3d36; 1289 1290 } 1290 1291 1291 1292 .notice-info { 1292 border-color: #00a0d2; 1293 border-color: #00a0d2; 1294 } 1295 1296 .notice .dismiss, 1297 div.updated .dismiss, 1298 div.error .dismiss { 1299 cursor: pointer; 1300 float: right; 1301 margin: 0.5em 0; 1302 padding: 2px; 1293 1303 } 1294 1304 1295 1305 .wrap .notice, -
src/wp-admin/js/common.js
diff --git src/wp-admin/js/common.js src/wp-admin/js/common.js index dda9247..83175e9 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 // Hide and make notices dismissible with cookie support. 377 $( 'div.updated, div.error, div.notice' ).each(function(){ 378 var $this = $(this), 379 $anchor = $( '<a href="#" class="dismiss"></a>' ), 380 hide = commonL10n.hide || '', 381 dismiss = commonL10n.dismiss || '', 382 id = 0; 383 384 // Bail, we're not allowed to hide this notice. 385 if ( $this.data( 'hide' ) === false ) { 386 return; 387 } 388 389 // This notice is dismissible, so use cookies to hide it for a period of time. 390 if ( $this.data( 'dismiss' ) === true ) { 391 392 // Create the notice ID by converting the text to a 32bit integer. 393 if ( $this.text().length !== 0 ) { 394 var i, len, chr; 395 for ( i = 0, len = $this.text().length; i < len; i++ ) { 396 chr = $this.text().charCodeAt(i); 397 id = ( ( id << 5 ) - id ) + chr; 398 id |= 0; 399 } 400 } 401 402 // Cookie check, remove element & bail if set. 403 if ( id !== 0 && wpCookies.get( 'wp-dismiss-notice-' + id ) === 'dismissed' ) { 404 $this.remove(); 405 return; 406 } 407 } 408 409 // Ensure plain text 410 $anchor.text( id !== 0 ? dismiss : hide ); 411 412 $this.prepend( $anchor ); 413 414 $anchor.on( 'click.wp-dismiss-notice', function( event ) { 415 event.preventDefault(); 416 $this.remove(); 417 418 // Set a session cookie, or use the expires data. 419 if ( id !== 0 ) { 420 wpCookies.set( 'wp-dismiss-notice-' + id, 'dismissed', $this.data( 'expires' ) || '' ); 421 } 422 }); 423 }); 424 376 425 // Init screen meta 377 426 screenMeta.init(); 378 427 -
src/wp-includes/script-loader.php
diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php index c1bd357..bebdd59 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 'hide' => __( 'Hide' ), 84 'dismiss' => __( 'Dismiss' ) 83 85 ) ); 84 86 85 87 $scripts->add( 'wp-a11y', "/wp-includes/js/wp-a11y$suffix.js", array( 'jquery' ), false, 1 );