mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 07:37:44 +02:00
Admin notices: Add more variety and make more generically usable.
There is now a base class of `notice`, with additional classes of `notice-success`, `notice-warning`, `notice-error`, and a new blue `notice-info`. Also corrects some misleading notice colors, such as plugin tested up to warnings and login messages. props avryl, melchoyce. fixes #27418. Built from https://develop.svn.wordpress.org/trunk@30505 git-svn-id: http://core.svn.wordpress.org/trunk@30494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c83f96ec61
commit
97b412af37
@ -550,40 +550,6 @@ code {
|
|||||||
margin: 10px 2px 0 20px;
|
margin: 10px 2px 0 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.updated,
|
|
||||||
div.error {
|
|
||||||
padding: 0 0.6em;
|
|
||||||
margin: 5px 15px 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.updated p,
|
|
||||||
div.error p {
|
|
||||||
margin: 0.5em 0;
|
|
||||||
padding: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrap div.updated,
|
|
||||||
.wrap div.error,
|
|
||||||
.media-upload-form div.error {
|
|
||||||
margin: 5px 0 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.updated {
|
|
||||||
border-right: 4px solid #7ad03a;
|
|
||||||
padding: 1px 12px;
|
|
||||||
background-color: #fff;
|
|
||||||
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
|
||||||
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
div.error {
|
|
||||||
border-right: 4px solid #dd3d36;
|
|
||||||
background: #fff;
|
|
||||||
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
|
||||||
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
|
||||||
padding: 1px 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.attention {
|
.attention {
|
||||||
color: #2ea2cc;
|
color: #2ea2cc;
|
||||||
}
|
}
|
||||||
@ -1247,11 +1213,54 @@ th.action-links {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
4.0 - Notifications
|
4.0 - Notifications
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
.notice,
|
||||||
|
div.updated,
|
||||||
|
div.error {
|
||||||
|
background: #fff;
|
||||||
|
border-right: 4px solid #fff;
|
||||||
|
-webkit-box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
|
||||||
|
box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
|
||||||
|
margin: 5px 15px 2px;
|
||||||
|
padding: 1px 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice p,
|
||||||
|
div.updated p,
|
||||||
|
div.error p {
|
||||||
|
margin: 0.5em 0;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice-success,
|
||||||
|
div.updated {
|
||||||
|
border-color: #7ad03a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice-warning {
|
||||||
|
border-color: #ffba00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice-error,
|
||||||
|
div.error {
|
||||||
|
border-color: #dd3d36;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice-info {
|
||||||
|
border-color: #2ea2cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrap .notice,
|
||||||
|
.wrap div.updated,
|
||||||
|
.wrap div.error,
|
||||||
|
.media-upload-form .notice,
|
||||||
|
.media-upload-form div.error {
|
||||||
|
margin: 5px 0 15px;
|
||||||
|
}
|
||||||
|
|
||||||
#update-nag,
|
#update-nag,
|
||||||
.update-nag {
|
.update-nag {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -550,40 +550,6 @@ code {
|
|||||||
margin: 10px 20px 0 2px;
|
margin: 10px 20px 0 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.updated,
|
|
||||||
div.error {
|
|
||||||
padding: 0 0.6em;
|
|
||||||
margin: 5px 15px 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.updated p,
|
|
||||||
div.error p {
|
|
||||||
margin: 0.5em 0;
|
|
||||||
padding: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrap div.updated,
|
|
||||||
.wrap div.error,
|
|
||||||
.media-upload-form div.error {
|
|
||||||
margin: 5px 0 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.updated {
|
|
||||||
border-left: 4px solid #7ad03a;
|
|
||||||
padding: 1px 12px;
|
|
||||||
background-color: #fff;
|
|
||||||
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
|
||||||
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
div.error {
|
|
||||||
border-left: 4px solid #dd3d36;
|
|
||||||
background: #fff;
|
|
||||||
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
|
||||||
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
|
||||||
padding: 1px 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.attention {
|
.attention {
|
||||||
color: #2ea2cc;
|
color: #2ea2cc;
|
||||||
}
|
}
|
||||||
@ -1247,11 +1213,54 @@ th.action-links {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
4.0 - Notifications
|
4.0 - Notifications
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
.notice,
|
||||||
|
div.updated,
|
||||||
|
div.error {
|
||||||
|
background: #fff;
|
||||||
|
border-left: 4px solid #fff;
|
||||||
|
-webkit-box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
|
||||||
|
box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
|
||||||
|
margin: 5px 15px 2px;
|
||||||
|
padding: 1px 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice p,
|
||||||
|
div.updated p,
|
||||||
|
div.error p {
|
||||||
|
margin: 0.5em 0;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice-success,
|
||||||
|
div.updated {
|
||||||
|
border-color: #7ad03a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice-warning {
|
||||||
|
border-color: #ffba00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice-error,
|
||||||
|
div.error {
|
||||||
|
border-color: #dd3d36;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice-info {
|
||||||
|
border-color: #2ea2cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrap .notice,
|
||||||
|
.wrap div.updated,
|
||||||
|
.wrap div.error,
|
||||||
|
.media-upload-form .notice,
|
||||||
|
.media-upload-form div.error {
|
||||||
|
margin: 5px 0 15px;
|
||||||
|
}
|
||||||
|
|
||||||
#update-nag,
|
#update-nag,
|
||||||
.update-nag {
|
.update-nag {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -54,7 +54,7 @@ p {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.login .message {
|
.login .message {
|
||||||
border-right: 4px solid #7ad03a;
|
border-right: 4px solid #2ea2cc;
|
||||||
padding: 1px 12px;
|
padding: 1px 12px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
||||||
|
2
wp-admin/css/login-rtl.min.css
vendored
2
wp-admin/css/login-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@ -54,7 +54,7 @@ p {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.login .message {
|
.login .message {
|
||||||
border-left: 4px solid #7ad03a;
|
border-left: 4px solid #2ea2cc;
|
||||||
padding: 1px 12px;
|
padding: 1px 12px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
||||||
|
2
wp-admin/css/login.min.css
vendored
2
wp-admin/css/login.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/wp-admin-rtl.min.css
vendored
2
wp-admin/css/wp-admin-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/wp-admin.min.css
vendored
2
wp-admin/css/wp-admin.min.css
vendored
File diff suppressed because one or more lines are too long
@ -388,7 +388,7 @@ if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create
|
|||||||
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
|
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
|
||||||
?></h2>
|
?></h2>
|
||||||
<?php if ( $notice ) : ?>
|
<?php if ( $notice ) : ?>
|
||||||
<div id="notice" class="error"><p id="has-newer-autosave"><?php echo $notice ?></p></div>
|
<div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice ?></p></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( $message ) : ?>
|
<?php if ( $message ) : ?>
|
||||||
<div id="message" class="updated"><p><?php echo $message; ?></p></div>
|
<div id="message" class="updated"><p><?php echo $message; ?></p></div>
|
||||||
|
@ -504,9 +504,9 @@ function install_plugin_information() {
|
|||||||
<div id="section-holder" class="wrap">
|
<div id="section-holder" class="wrap">
|
||||||
<?php
|
<?php
|
||||||
if ( ! empty( $api->tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) ) {
|
if ( ! empty( $api->tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) ) {
|
||||||
echo '<div class="error"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
|
echo '<div class="notice notice-warning"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
|
||||||
} else if ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) ) {
|
} else if ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) ) {
|
||||||
echo '<div class="error"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>';
|
echo '<div class="notice notice-warning"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ( (array) $api->sections as $section_name => $content ) {
|
foreach ( (array) $api->sections as $section_name => $content ) {
|
||||||
|
@ -2084,7 +2084,7 @@ function convert_to_screen( $hook_name ) {
|
|||||||
*/
|
*/
|
||||||
function _local_storage_notice() {
|
function _local_storage_notice() {
|
||||||
?>
|
?>
|
||||||
<div id="local-storage-notice" class="hidden">
|
<div id="local-storage-notice" class="hidden notice">
|
||||||
<p class="local-restore">
|
<p class="local-restore">
|
||||||
<?php _e('The backup of this post in your browser is different from the version below.'); ?>
|
<?php _e('The backup of this post in your browser is different from the version below.'); ?>
|
||||||
<a class="restore-backup" href="#"><?php _e('Restore the backup.'); ?></a>
|
<a class="restore-backup" href="#"><?php _e('Restore the backup.'); ?></a>
|
||||||
|
@ -345,7 +345,7 @@ window.autosave = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$notice = $( '#local-storage-notice' );
|
$notice = $( '#local-storage-notice' );
|
||||||
$('.wrap h2').first().after( $notice.addClass( 'updated' ).show() );
|
$('.wrap h2').first().after( $notice.addClass( 'notice-warning' ).show() );
|
||||||
|
|
||||||
$notice.on( 'click.autosave-local', function( event ) {
|
$notice.on( 'click.autosave-local', function( event ) {
|
||||||
var $target = $( event.target );
|
var $target = $( event.target );
|
||||||
@ -354,10 +354,12 @@ window.autosave = function() {
|
|||||||
restorePost( restorePostData );
|
restorePost( restorePostData );
|
||||||
$target.parent().hide();
|
$target.parent().hide();
|
||||||
$(this).find( 'p.undo-restore' ).show();
|
$(this).find( 'p.undo-restore' ).show();
|
||||||
|
$notice.removeClass( 'notice-warning' ).addClass( 'notice-success' );
|
||||||
} else if ( $target.hasClass( 'undo-restore-backup' ) ) {
|
} else if ( $target.hasClass( 'undo-restore-backup' ) ) {
|
||||||
restorePost( undoPostData );
|
restorePost( undoPostData );
|
||||||
$target.parent().hide();
|
$target.parent().hide();
|
||||||
$(this).find( 'p.local-restore' ).show();
|
$(this).find( 'p.local-restore' ).show();
|
||||||
|
$notice.removeClass( 'notice-success' ).addClass( 'notice-warning' );
|
||||||
}
|
}
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
2
wp-includes/js/autosave.min.js
vendored
2
wp-includes/js/autosave.min.js
vendored
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.1-beta2-30504';
|
$wp_version = '4.1-beta2-30505';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user