<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[26776] trunk/src: Core updates for the new color schemes.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/26776">26776</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2013-12-07 07:45:57 +0000 (Sat, 07 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>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 <a href="http://core.trac.wordpress.org/ticket/26468">#26468</a>, <a href="http://core.trac.wordpress.org/ticket/26387">#26387</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminaboutphp">trunk/src/wp-admin/about.php</a></li>
<li><a href="#trunksrcwpadmincsswpadmincss">trunk/src/wp-admin/css/wp-admin.css</a></li>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpadminincludesmiscphp">trunk/src/wp-admin/includes/misc.php</a></li>
<li><a href="#trunksrcwpadminjsuserprofilejs">trunk/src/wp-admin/js/user-profile.js</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunksrcwpadminjsaboutjs">trunk/src/wp-admin/js/about.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminaboutphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/about.php (26775 => 26776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/about.php     2013-12-07 07:45:40 UTC (rev 26775)
+++ trunk/src/wp-admin/about.php        2013-12-07 07:45:57 UTC (rev 26776)
</span><span class="lines">@@ -79,18 +79,17 @@
</span><span class="cx">  <div class="feature-section col one-col">
</span><span class="cx">          <div>
</span><span class="cx">                  <h3><?php echo ( 'Pick a color' ); ?></h3>
</span><del>-                       <p><?php echo ( 'We&#8217;ve included four color schemes so that you can pick your favorite. Choose from any of the schemes below to change it in an instant.' ); ?></p>
</del><ins>+                        <p><?php echo ( 'We&#8217;ve included eight color schemes so you can pick your favorite. Choose from any of them below to change it in an instant.' ); ?></p>
</ins><span class="cx">                   <?php $user_id = get_current_user_id(); ?>
</span><span class="cx">                  <?php if ( count($_wp_admin_css_colors) > 1 && has_action('admin_color_scheme_picker') ) :?>
</span><span class="cx">                          <?php
</span><del>-                               wp_nonce_field('update-user_' . $user_id);
</del><span class="cx">                           /** This action is documented in wp-admin/user-edit.php */
</span><span class="cx">                          do_action( 'admin_color_scheme_picker' );
</span><span class="cx">                          ?>
</span><span class="cx">                  <?php else : ?>
</span><span class="cx">                          <img src="<?php echo admin_url( 'images/about-color-schemes.png' ); ?>" />
</span><span class="cx">                  <?php endif; ?>
</span><del>-                       <p><?php printf( ( 'To change your color scheme later, just <a href="%1$s">visit your profile settings</a>.' ), get_edit_profile_url( $user_id ) ); ?></p>
</del><ins>+                        <p><?php printf( ( 'To change your color scheme later, just <a href="%1$s">visit your profile</a>.' ), get_edit_profile_url( $user_id ) ); ?></p>
</ins><span class="cx">           </div>
</span><span class="cx">  </div>
</span><span class="cx"> </div>
</span></span></pre></div>
<a id="trunksrcwpadmincsswpadmincss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/css/wp-admin.css (26775 => 26776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/css/wp-admin.css      2013-12-07 07:45:40 UTC (rev 26775)
+++ trunk/src/wp-admin/css/wp-admin.css 2013-12-07 07:45:57 UTC (rev 26776)
</span><span class="lines">@@ -7638,10 +7638,11 @@
</span><span class="cx"> 
</span><span class="cx"> .color-option {
</span><span class="cx">  display: inline-block;
</span><del>-       width: 32%;
</del><ins>+        width: 24%;
</ins><span class="cx">   padding: 5px 15px 15px;
</span><span class="cx">  -moz-box-sizing: border-box;
</span><span class="cx">  box-sizing: border-box;
</span><ins>+       margin-bottom: 3px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .color-option:hover,
</span><span class="lines">@@ -8029,7 +8030,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .about-wrap .about-colors .color-option {
</span><del>-       width: 24%;
</del><span class="cx">   padding-top: 10px;
</span><span class="cx"> }
</span><span class="cx"> .about-wrap .about-colors .color-option label {
</span></span></pre></div>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/ajax-actions.php (26775 => 26776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/ajax-actions.php     2013-12-07 07:45:40 UTC (rev 26775)
+++ trunk/src/wp-admin/includes/ajax-actions.php        2013-12-07 07:45:57 UTC (rev 26776)
</span><span class="lines">@@ -2250,8 +2250,9 @@
</span><span class="cx">  global $_wp_admin_css_colors;
</span><span class="cx"> 
</span><span class="cx">  $user_id = get_current_user_id();
</span><del>-       check_ajax_referer( 'update-user_' . $user_id, 'nonce' );
</del><span class="cx"> 
</span><ins>+       check_ajax_referer( 'save-color-scheme_' . $user_id, 'nonce' );
+
</ins><span class="cx">   $color_scheme = sanitize_key( $_POST['color_scheme'] );
</span><span class="cx"> 
</span><span class="cx">  if ( ! isset( $_wp_admin_css_colors[ $color_scheme ] ) ) {
</span></span></pre></div>
<a id="trunksrcwpadminincludesmiscphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/misc.php (26775 => 26776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/misc.php     2013-12-07 07:45:40 UTC (rev 26775)
+++ trunk/src/wp-admin/includes/misc.php        2013-12-07 07:45:57 UTC (rev 26776)
</span><span class="lines">@@ -567,8 +567,8 @@
</span><span class="cx">  ksort( $_wp_admin_css_colors );
</span><span class="cx"> 
</span><span class="cx">  if ( isset( $_wp_admin_css_colors['fresh'] ) ) {
</span><del>-               // Set 'fresh' (the default option) to be the first array element
-               $_wp_admin_css_colors = array_merge( array( 'fresh' => '' ), $_wp_admin_css_colors );
</del><ins>+                // Set Default ('fresh') and Light should go first.
+               $_wp_admin_css_colors = array_merge( array( 'fresh' => '', 'light' => '' ), $_wp_admin_css_colors );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx">  $current_color = get_user_option( 'admin_color', $user_id );
</span><span class="lines">@@ -581,7 +581,7 @@
</span><span class="cx">  <fieldset id="color-picker" class="scheme-list">
</span><span class="cx">          <legend class="screen-reader-text"><span><?php _e( 'Admin Color Scheme' ); ?></span></legend>
</span><span class="cx">          <?php
</span><del>-
</del><ins>+                wp_nonce_field( 'save-color-scheme_' . $user_id, 'color-nonce', false );
</ins><span class="cx">           foreach ( $_wp_admin_css_colors as $color => $color_info ) :
</span><span class="cx"> 
</span><span class="cx">                  ?>
</span><span class="lines">@@ -596,7 +596,7 @@
</span><span class="cx"> 
</span><span class="cx">                                  foreach ( $color_info->colors as $html_color ) {
</span><span class="cx">                                          ?>
</span><del>-                                               <td style="background-color: <?php echo esc_attr( $html_color ); ?>" title="<?php echo esc_attr( $color ); ?>">&nbsp;</td>
</del><ins>+                                                <td style="background-color: <?php echo esc_attr( $html_color ); ?>">&nbsp;</td>
</ins><span class="cx">                                           <?php
</span><span class="cx">                                  }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunksrcwpadminjsaboutjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-admin/js/about.js (26775 => 26776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/about.js   2013-12-07 07:45:40 UTC (rev 26775)
+++ trunk/src/wp-admin/js/about.js      2013-12-07 07:45:57 UTC (rev 26776)
</span><span class="lines">@@ -1,51 +0,0 @@
</span><del>-/* global ajaxurl */
-(function($){
-
-       $(document).ready( function() {
-               var $colorpicker, $stylesheet;
-       
-               $('.color-palette').click( function() {
-                       $(this).siblings('input[name="admin_color"]').prop('checked', true);
-               });
-       
-               $colorpicker = $( '#color-picker' );
-               $stylesheet = $( '#colors-css' );
-       
-               $colorpicker.on( 'click.colorpicker', '.color-option', function() {
-                       var colors, css_url,
-                               $this = $(this);
-       
-                       if ( $this.hasClass( 'selected' ) ) {
-                               return;
-                       }
-       
-                       $this.siblings( '.selected' ).removeClass( 'selected' );
-                       $this.addClass( 'selected' ).find( 'input[type="radio"]' ).prop( 'checked', true );
-       
-                       // Set color scheme
-                       // Load the colors stylesheet
-                       css_url = $this.children( '.css_url' ).val();
-                       $stylesheet.attr( 'href', css_url );
-
-                       // repaint icons
-                       if ( typeof wp !== 'undefined' && wp.svgPainter ) {
-                               try {
-                                       colors = $.parseJSON( $this.children( '.icon_colors' ).val() );
-                               } catch ( error ) {}
-
-                               if ( colors ) {
-                                       wp.svgPainter.setColors( colors );
-                                       wp.svgPainter.paint();
-                               }
-                       }
-                       
-                       // update user option
-                       $.post( ajaxurl, {
-                               action:       'save-user-color-scheme',
-                               color_scheme: $this.children( 'input[name="admin_color"]' ).val(),
-                               nonce:        $('#_wpnonce').val()
-                       });
-               });
-       });
-
-})(jQuery);
</del></span></pre></div>
<a id="trunksrcwpadminjsuserprofilejs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/user-profile.js (26775 => 26776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/user-profile.js    2013-12-07 07:45:40 UTC (rev 26775)
+++ trunk/src/wp-admin/js/user-profile.js       2013-12-07 07:45:57 UTC (rev 26776)
</span><span class="lines">@@ -114,7 +114,7 @@
</span><span class="cx">                          $.post( ajaxurl, {
</span><span class="cx">                                  action:       'save-user-color-scheme',
</span><span class="cx">                                  color_scheme: $this.children( 'input[name="admin_color"]' ).val(),
</span><del>-                                       nonce:        $('#_wpnonce').val()
</del><ins>+                                        nonce:        $('#color-nonce').val()
</ins><span class="cx">                           });
</span><span class="cx">                  }
</span><span class="cx">          });
</span></span></pre></div>
<a id="trunksrcwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/script-loader.php (26775 => 26776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/script-loader.php  2013-12-07 07:45:40 UTC (rev 26775)
+++ trunk/src/wp-includes/script-loader.php     2013-12-07 07:45:57 UTC (rev 26776)
</span><span class="lines">@@ -331,7 +331,7 @@
</span><span class="cx"> 
</span><span class="cx">  $scripts->add( 'user-suggest', "/wp-admin/js/user-suggest$suffix.js", array( 'jquery-ui-autocomplete' ), false, 1 );
</span><span class="cx"> 
</span><del>-       $scripts->add( 'about', "/wp-admin/js/about$suffix.js", array( 'jquery', 'password-strength-meter' ), false, 1 );
</del><ins>+        $scripts->add( 'about', false, array( 'user-profile' ), false );
</ins><span class="cx"> 
</span><span class="cx">  $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 );
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>