From e41692153cb964684ea2e3ab779a892bc37171fe Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 7 Dec 2013 07:45:57 +0000 Subject: [PATCH] Core updates for the new color schemes. * Update about page, there's now 8. * Display them four wide, not three, and ensure adequate spacing. * Use a dedicated nonce. * Push Light to the front in addition to Default. * Use user-profile.js on about.php. A few extra things are initialized but they are harmless. see #26468, #26387. git-svn-id: https://develop.svn.wordpress.org/trunk@26776 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/about.php | 5 +-- src/wp-admin/css/wp-admin.css | 4 +- src/wp-admin/includes/ajax-actions.php | 3 +- src/wp-admin/includes/misc.php | 8 ++-- src/wp-admin/js/about.js | 51 -------------------------- src/wp-admin/js/user-profile.js | 2 +- src/wp-includes/script-loader.php | 2 +- 7 files changed, 12 insertions(+), 63 deletions(-) delete mode 100644 src/wp-admin/js/about.js diff --git a/src/wp-admin/about.php b/src/wp-admin/about.php index 500b0552ad..54c0f54cda 100644 --- a/src/wp-admin/about.php +++ b/src/wp-admin/about.php @@ -79,18 +79,17 @@ include( ABSPATH . 'wp-admin/admin-header.php' );

-

+

1 && has_action('admin_color_scheme_picker') ) :?> -

visit your profile settings.' ), get_edit_profile_url( $user_id ) ); ?>

+

visit your profile.' ), get_edit_profile_url( $user_id ) ); ?>

diff --git a/src/wp-admin/css/wp-admin.css b/src/wp-admin/css/wp-admin.css index a8de1a53b1..c4f0c354aa 100644 --- a/src/wp-admin/css/wp-admin.css +++ b/src/wp-admin/css/wp-admin.css @@ -7638,10 +7638,11 @@ div#custom-background-image img { .color-option { display: inline-block; - width: 32%; + width: 24%; padding: 5px 15px 15px; -moz-box-sizing: border-box; box-sizing: border-box; + margin-bottom: 3px; } .color-option:hover, @@ -8029,7 +8030,6 @@ body.press-this { } .about-wrap .about-colors .color-option { - width: 24%; padding-top: 10px; } .about-wrap .about-colors .color-option label { diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 6985bcfdf4..885c21002a 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -2250,7 +2250,8 @@ function wp_ajax_save_user_color_scheme() { global $_wp_admin_css_colors; $user_id = get_current_user_id(); - check_ajax_referer( 'update-user_' . $user_id, 'nonce' ); + + check_ajax_referer( 'save-color-scheme_' . $user_id, 'nonce' ); $color_scheme = sanitize_key( $_POST['color_scheme'] ); diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php index 0daf72e201..d82b4fccd1 100644 --- a/src/wp-admin/includes/misc.php +++ b/src/wp-admin/includes/misc.php @@ -567,8 +567,8 @@ function admin_color_scheme_picker() { ksort( $_wp_admin_css_colors ); if ( isset( $_wp_admin_css_colors['fresh'] ) ) { - // Set 'fresh' (the default option) to be the first array element - $_wp_admin_css_colors = array_merge( array( 'fresh' => '' ), $_wp_admin_css_colors ); + // Set Default ('fresh') and Light should go first. + $_wp_admin_css_colors = array_merge( array( 'fresh' => '', 'light' => '' ), $_wp_admin_css_colors ); } $current_color = get_user_option( 'admin_color', $user_id ); @@ -581,7 +581,7 @@ function admin_color_scheme_picker() {
$color_info ) : ?> @@ -596,7 +596,7 @@ function admin_color_scheme_picker() { foreach ( $color_info->colors as $html_color ) { ?> -   +   add( 'user-suggest', "/wp-admin/js/user-suggest$suffix.js", array( 'jquery-ui-autocomplete' ), false, 1 ); - $scripts->add( 'about', "/wp-admin/js/about$suffix.js", array( 'jquery', 'password-strength-meter' ), false, 1 ); + $scripts->add( 'about', false, array( 'user-profile' ), false ); $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 );