From a8821f6b57f029caf4112f118abd4da5494fd60e Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Fri, 21 Nov 2014 16:40:29 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@30505 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/common.css | 79 +++++++++++++----------- src/wp-admin/css/login.css | 2 +- src/wp-admin/edit-form-advanced.php | 2 +- src/wp-admin/includes/plugin-install.php | 4 +- src/wp-admin/includes/template.php | 2 +- src/wp-includes/js/autosave.js | 4 +- 6 files changed, 52 insertions(+), 41 deletions(-) diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css index 3c60f84d27..68c6c8739f 100644 --- a/src/wp-admin/css/common.css +++ b/src/wp-admin/css/common.css @@ -550,40 +550,6 @@ code { 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 { color: #2ea2cc; } @@ -1247,11 +1213,54 @@ th.action-links { } - /*------------------------------------------------------------------------------ 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 { display: inline-block; diff --git a/src/wp-admin/css/login.css b/src/wp-admin/css/login.css index 02ee1d87e9..f6747f1889 100644 --- a/src/wp-admin/css/login.css +++ b/src/wp-admin/css/login.css @@ -54,7 +54,7 @@ p { } .login .message { - border-left: 4px solid #7ad03a; + border-left: 4px solid #2ea2cc; padding: 1px 12px; background-color: #fff; -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1); diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php index 0bbb525dd1..6b33ca1417 100644 --- a/src/wp-admin/edit-form-advanced.php +++ b/src/wp-admin/edit-form-advanced.php @@ -388,7 +388,7 @@ if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create echo ' ' . esc_html( $post_type_object->labels->add_new ) . ''; ?> -

+

diff --git a/src/wp-admin/includes/plugin-install.php b/src/wp-admin/includes/plugin-install.php index 4f1285a73d..574529c54f 100644 --- a/src/wp-admin/includes/plugin-install.php +++ b/src/wp-admin/includes/plugin-install.php @@ -504,9 +504,9 @@ function install_plugin_information() {
tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) ) { - echo '

' . __('Warning: This plugin has not been tested with your current version of WordPress.') . '

'; + echo '

' . __('Warning: This plugin has not been tested with your current version of WordPress.') . '

'; } else if ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) ) { - echo '

' . __('Warning: This plugin has not been marked as compatible with your version of WordPress.') . '

'; + echo '

' . __('Warning: This plugin has not been marked as compatible with your version of WordPress.') . '

'; } foreach ( (array) $api->sections as $section_name => $content ) { diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index edeb937425..990834d0cb 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -2084,7 +2084,7 @@ function convert_to_screen( $hook_name ) { */ function _local_storage_notice() { ?> -