<!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>[26137] trunk: Merge the color schemes component from MP6.</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/26137">26137</a></dd>
<dt>Author</dt> <dd>helen</dd>
<dt>Date</dt> <dd>2013-11-13 19:37:10 +0000 (Wed, 13 Nov 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge the color schemes component from MP6. Introduces Light, Blue, and Midnight.
Color scheme selection on your own profile page gives you a preview and autosaves the selection.
Also introduces the usage of a preprocessor for core files, namely Sass. For 3.8, we will not expand its implementation past the color schemes. This does require Ruby as well as Sass 3.3.0+ due to the usage of the sourcemap option.
Note that only the default color scheme is available when running out of src. Use build to test the rest as well as the color picker.
props ryelle, melchoyce, tillkruess, drw158, littlethingsstudio, helen. see <a href="http://core.trac.wordpress.org/ticket/25858">#25858</a>, <a href="http://core.trac.wordpress.org/ticket/22862">#22862</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkGruntfilejs">trunk/Gruntfile.js</a></li>
<li><a href="#trunkpackagejson">trunk/package.json</a></li>
<li><a href="#trunksrcwpadminadminajaxphp">trunk/src/wp-admin/admin-ajax.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="#trunksrcwpincludesgeneraltemplatephp">trunk/src/wp-includes/general-template.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkGruntfilejs"></a>
<div class="modfile"><h4>Modified: trunk/Gruntfile.js (26136 => 26137)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Gruntfile.js 2013-11-13 19:23:16 UTC (rev 26136)
+++ trunk/Gruntfile.js 2013-11-13 19:37:10 UTC (rev 26137)
</span><span class="lines">@@ -76,6 +76,22 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> },
</span><ins>+ sass: {
+ colors: {
+ options: {
+ style: 'expanded',
+ sourcemap: true,
+ noCache: true
+ },
+ files : [{
+ expand: true,
+ cwd: SOURCE_DIR,
+ dest: BUILD_DIR,
+ ext: '.css',
+ src: ['wp-admin/css/color-schemes/*/colors.scss']
+ }]
+ }
+ },
</ins><span class="cx"> cssmin: {
</span><span class="cx"> core: {
</span><span class="cx"> expand: true,
</span><span class="lines">@@ -98,6 +114,15 @@
</span><span class="cx"> 'wp-admin/css/*-rtl.css',
</span><span class="cx"> 'wp-includes/css/*-rtl.css'
</span><span class="cx"> ]
</span><ins>+ },
+ colors: {
+ expand: true,
+ cwd: BUILD_DIR,
+ dest: BUILD_DIR,
+ ext: '.min.css',
+ src: [
+ 'wp-admin/css/color-schemes/**/*.css'
+ ]
</ins><span class="cx"> }
</span><span class="cx"> },
</span><span class="cx"> cssjanus: {
</span><span class="lines">@@ -316,6 +341,10 @@
</span><span class="cx"> test: {
</span><span class="cx"> files: ['tests/qunit/**'],
</span><span class="cx"> tasks: ['qunit']
</span><ins>+ },
+ colors: {
+ files: [SOURCE_DIR + 'wp-admin/css/color-schemes/**'],
+ tasks: ['sass:colors']
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> });
</span><span class="lines">@@ -328,8 +357,10 @@
</span><span class="cx"> // RTL task.
</span><span class="cx"> grunt.registerTask('rtl', ['cssjanus:core']);
</span><span class="cx">
</span><ins>+ grunt.registerTask('colors', ['sass:colors', 'cssmin:colors']);
+
</ins><span class="cx"> // Build task.
</span><del>- grunt.registerTask('build', ['clean:all', 'copy:all', 'rtl', 'cssmin:core', 'cssmin:rtl',
</del><ins>+ grunt.registerTask('build', ['clean:all', 'copy:all', 'rtl', 'colors', 'cssmin:core', 'cssmin:rtl',
</ins><span class="cx"> 'uglify:core', 'uglify:tinymce', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce']);
</span><span class="cx">
</span><span class="cx"> // Testing tasks.
</span></span></pre></div>
<a id="trunkpackagejson"></a>
<div class="modfile"><h4>Modified: trunk/package.json (26136 => 26137)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/package.json 2013-11-13 19:23:16 UTC (rev 26136)
+++ trunk/package.json 2013-11-13 19:37:10 UTC (rev 26137)
</span><span class="lines">@@ -13,6 +13,7 @@
</span><span class="cx"> "grunt-contrib-clean": "~0.5.0",
</span><span class="cx"> "grunt-contrib-copy": "~0.4.1",
</span><span class="cx"> "grunt-contrib-cssmin": "~0.6.1",
</span><ins>+ "grunt-contrib-sass": "~0.5.0",
</ins><span class="cx"> "grunt-contrib-qunit": "~0.2.2",
</span><span class="cx"> "grunt-contrib-uglify": "~0.2.2",
</span><span class="cx"> "grunt-contrib-watch": "~0.5.1",
</span></span></pre></div>
<a id="trunksrcwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/admin-ajax.php (26136 => 26137)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/admin-ajax.php 2013-11-13 19:23:16 UTC (rev 26136)
+++ trunk/src/wp-admin/admin-ajax.php 2013-11-13 19:37:10 UTC (rev 26137)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx"> 'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment',
</span><span class="cx"> 'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor',
</span><span class="cx"> 'send-attachment-to-editor', 'save-attachment-order', 'heartbeat', 'get-revision-diffs',
</span><ins>+ 'save-user-color-scheme',
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> // Register core Ajax calls.
</span></span></pre></div>
<a id="trunksrcwpadmincsswpadmincss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/css/wp-admin.css (26136 => 26137)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/css/wp-admin.css 2013-11-13 19:23:16 UTC (rev 26136)
+++ trunk/src/wp-admin/css/wp-admin.css 2013-11-13 19:37:10 UTC (rev 26137)
</span><span class="lines">@@ -5636,12 +5636,6 @@
</span><span class="cx"> width: auto;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.form-table div.color-option {
- display: block;
- clear: both;
- margin-top: 12px;
-}
-
</del><span class="cx"> .form-table input.tog {
</span><span class="cx"> margin-top: 2px;
</span><span class="cx"> margin-right: 2px;
</span><span class="lines">@@ -5653,21 +5647,6 @@
</span><span class="cx"> margin-bottom: 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.form-table table.color-palette {
- vertical-align: bottom;
- float: left;
- margin: -12px 3px 11px;
-}
-
-.form-table .color-palette td {
- border-width: 1px 1px 0;
- border-style: solid solid none;
- height: 10px;
- line-height: 20px;
- width: 10px;
-}
-
-
</del><span class="cx"> .form-table td fieldset label {
</span><span class="cx"> margin: 0.25em 0 0.5em !important;
</span><span class="cx"> display: inline-block;
</span><span class="lines">@@ -6330,6 +6309,120 @@
</span><span class="cx"> width: 25em;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.picker-dropdown {
+ background: #fcfcfc;
+ border: 1px solid #dedede;
+ margin-right: 12%;
+ max-width: 270px;
+ position: relative;
+ width: auto;
+}
+
+.picker-dropdown.dropdown-current {
+ padding: 20px;
+ margin-bottom: 15px;
+ cursor: pointer;
+}
+
+.picker-dropdown.dropdown-container {
+ display: none;
+ position: absolute;
+ width: 340px;
+ border-top: none;
+ -webkit-box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
+ z-index: 1;
+}
+
+.picker-expanded .picker-dropdown.dropdown-container {
+ display: block;
+}
+
+.picker-dropdown.dropdown-container:before,
+.picker-dropdown.dropdown-container:after {
+ content: "\0020";
+ display: block;
+ position: absolute;
+ top: -10px;
+ left: 150px;
+ z-index: 2;
+ width: 0;
+ height: 0;
+ overflow: hidden;
+ border: solid 11px transparent;
+ border-top: 0;
+ border-bottom-color: #fefefe;
+}
+
+.picker-dropdown.dropdown-container:before {
+ top: -11px;
+ z-index: 1;
+ border-bottom-color: #dedede;
+}
+
+.picker-dropdown-arrow {
+ position: absolute;
+ top: -1px;
+ right: -42px;
+ display: block;
+ width: 40px;
+ height: 100%;
+ background: white;
+ text-align: center;
+ border: 1px solid #dedede;
+ border-left-width: 0;
+ cursor: pointer;
+}
+
+.picker-dropdown-arrow:before {
+ font: 20px/91px dashicons;
+ content: '\f140';
+}
+
+.picker-expanded .picker-dropdown-arrow:before {
+ content: '\f142';
+}
+
+.color-option {
+ display: block;
+ padding: 20px;
+ border-top: 1px solid #dedede;
+}
+
+.color-option:hover,
+.color-option.selected {
+ background: #f2f8fa;
+}
+
+.color-palette {
+ width: 100%;
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+.color-palette td {
+ height: 20px;
+ padding: 0;
+ border: none;
+}
+
+.color-option {
+ cursor: pointer;
+}
+
+.no-js .dropdown-current {
+ display: none;
+}
+
+.no-js .dropdown-container {
+ display: block;
+ position: static;
+}
+
+.no-js .dropdown-container:before,
+.no-js .dropdown-container:after {
+ display: none;
+}
+
</ins><span class="cx"> /*------------------------------------------------------------------------------
</span><span class="cx"> 19.0 - Tools
</span><span class="cx"> ------------------------------------------------------------------------------*/
</span></span></pre></div>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/ajax-actions.php (26136 => 26137)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/ajax-actions.php 2013-11-13 19:23:16 UTC (rev 26136)
+++ trunk/src/wp-admin/includes/ajax-actions.php 2013-11-13 19:37:10 UTC (rev 26137)
</span><span class="lines">@@ -2244,3 +2244,27 @@
</span><span class="cx"> }
</span><span class="cx"> wp_send_json_success( $return );
</span><span class="cx"> }
</span><ins>+
+/**
+ * Auto-save the selected color scheme for a user's own profile.
+ *
+ * @since 3.8.0
+ */
+function wp_ajax_save_user_color_scheme() {
+ global $_wp_admin_css_colors;
+
+ $user_id = intval( $_POST['user_id'] );
+ $color_scheme = sanitize_key( $_POST['color_scheme'] );
+
+ if ( get_current_user_id() !== $user_id )
+ wp_send_json_error();
+
+ if ( ! get_user_by( 'id', $user_id ) )
+ wp_send_json_error();
+
+ if ( ! isset( $_wp_admin_css_colors[ $color_scheme ] ) )
+ wp_send_json_error();
+
+ update_user_option( $user_id, 'admin_color', $color_scheme, true );
+ wp_send_json_success();
+}
</ins></span></pre></div>
<a id="trunksrcwpadminincludesmiscphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/misc.php (26136 => 26137)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/misc.php 2013-11-13 19:23:16 UTC (rev 26136)
+++ trunk/src/wp-admin/includes/misc.php 2013-11-13 19:37:10 UTC (rev 26137)
</span><span class="lines">@@ -562,29 +562,70 @@
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> */
</span><span class="cx"> function admin_color_scheme_picker() {
</span><del>- global $_wp_admin_css_colors, $user_id; ?>
-<fieldset><legend class="screen-reader-text"><span><?php _e('Admin Color Scheme')?></span></legend>
-<?php
-$current_color = get_user_option('admin_color', $user_id);
-if ( empty($current_color) )
- $current_color = 'fresh';
-foreach ( $_wp_admin_css_colors as $color => $color_info ): ?>
-<div class="color-option"><input name="admin_color" id="admin_color_<?php echo esc_attr( $color ); ?>" type="radio" value="<?php echo esc_attr( $color ); ?>" class="tog" <?php checked($color, $current_color); ?> />
- <table class="color-palette">
- <tr>
- <?php foreach ( $color_info->colors as $html_color ): ?>
- <td style="background-color: <?php echo esc_attr( $html_color ); ?>" title="<?php echo esc_attr( $color ); ?>"> </td>
- <?php endforeach; ?>
- </tr>
- </table>
</del><ins>+ global $_wp_admin_css_colors, $user_id;
+ ksort($_wp_admin_css_colors);
</ins><span class="cx">
</span><del>- <label for="admin_color_<?php echo esc_attr( $color ); ?>"><?php echo esc_html( $color_info->name ); ?></label>
-</div>
- <?php endforeach; ?>
-</fieldset>
</del><ins>+ $current_color = get_user_option( 'admin_color', $user_id );
+
+ if ( empty( $current_color ) || ! isset( $_wp_admin_css_colors[ $current_color ] ) )
+ $current_color = 'fresh';
+
+ $color_info = $_wp_admin_css_colors[ $current_color ];
+?>
+
+ <fieldset id="color-picker">
+ <legend class="screen-reader-text"><span><?php _e( 'Admin Color Scheme' ); ?></span></legend>
+
+ <div class="picker-dropdown dropdown-current">
+ <div class="picker-dropdown-arrow"></div>
+ <label for="admin_color_<?php echo esc_attr( $current_color ); ?>"><?php echo esc_html( $color_info->name ); ?></label>
+ <table class="color-palette">
+ <tr>
+ <?php foreach ( $color_info->colors as $html_color ): ?>
+ <td style="background-color: <?php echo esc_attr( $html_color ); ?>" title="<?php echo esc_attr( $current_color ); ?>"> </td>
+ <?php endforeach; ?>
+ </tr>
+ </table>
+ </div>
+
+ <div class="picker-dropdown dropdown-container">
+
+ <?php foreach ( $_wp_admin_css_colors as $color => $color_info ) : ?>
+
+ <div class="color-option <?php echo ( $color == $current_color ) ? 'selected' : ''; ?>">
+ <input name="admin_color" id="admin_color_<?php echo esc_attr( $color ); ?>" type="radio" value="<?php echo esc_attr( $color ); ?>" class="tog" <?php checked( $color, $current_color ); ?> />
+ <input type="hidden" class="css_url" value="<?php echo esc_url( $color_info->url ); ?>" />
+ <input type="hidden" class="icon_colors" value="<?php echo esc_attr( json_encode( array( 'icons' => $color_info->icon_colors ) ) ); ?>" />
+ <label for="admin_color_<?php echo esc_attr( $color ); ?>"><?php echo esc_html( $color_info->name ); ?></label>
+ <table class="color-palette">
+ <tr>
+ <?php foreach ( $color_info->colors as $html_color ): ?>
+ <td style="background-color: <?php echo esc_attr( $html_color ); ?>" title="<?php echo esc_attr( $color ); ?>"> </td>
+ <?php endforeach; ?>
+ </tr>
+ </table>
+ </div>
+
+ <?php endforeach; ?>
+
+ </div>
+
+ </fieldset>
+
</ins><span class="cx"> <?php
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function set_color_scheme_json() {
+ global $_wp_admin_css_colors;
+
+ $color_scheme = get_user_option( 'admin_color' );
+
+ if ( isset( $_wp_admin_css_colors[ $color_scheme ]->icon_colors ) ) {
+ echo '<script type="text/javascript">var mp6_color_scheme = ' . json_encode( array( 'icons' => $_wp_admin_css_colors[ $color_scheme ]->icon_colors ) ) . ";</script>\n";
+ }
+}
+add_action( 'admin_head', 'set_color_scheme_json' );
+
</ins><span class="cx"> function _ipad_meta() {
</span><span class="cx"> if ( wp_is_mobile() ) {
</span><span class="cx"> ?>
</span></span></pre></div>
<a id="trunksrcwpadminjsuserprofilejs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/user-profile.js (26136 => 26137)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/user-profile.js 2013-11-13 19:23:16 UTC (rev 26136)
+++ trunk/src/wp-admin/js/user-profile.js 2013-11-13 19:37:10 UTC (rev 26137)
</span><span class="lines">@@ -73,6 +73,50 @@
</span><span class="cx"> });
</span><span class="cx"> });
</span><span class="cx"> }
</span><ins>+
+ var $colorpicker = $( '#color-picker' ),
+ $stylesheet = $( '#colors-css' ),
+ user_id = $( 'input#user_id' ).val(),
+ current_user_id = $( 'input[name="checkuser_id"]' ).val();
+
+ // dropdown toggle
+ $colorpicker.on( 'click', '.dropdown-current', function() {
+ $colorpicker.toggleClass( 'picker-expanded' );
+ });
+
+ $colorpicker.on( 'click', '.color-option', function() {
+
+ var color_scheme = $( this ).children( 'input[name="admin_color"]' ).val();
+
+ // update selected
+ $( this ).siblings( '.selected' ).removeClass( 'selected' )
+ $( this ).addClass( 'selected' );
+ $( this ).find( 'input' ).prop( 'checked', true );
+
+ // update current
+ $colorpicker.find( '.dropdown-current label' ).html( $( this ).children( 'label' ).html() );
+ $colorpicker.find( '.dropdown-current table' ).html( $( this ).children( 'table' ).html() );
+ $colorpicker.toggleClass( 'picker-expanded' );
+
+ // preview/save color scheme
+ if ( user_id == current_user_id ) {
+
+ // repaint icons
+ $stylesheet.attr( 'href', $( this ).children( '.css_url' ).val() );
+ svgPainter.setColors( $.parseJSON( $( this ).children( '.icon_colors' ).val() ) );
+ svgPainter.paint();
+
+ // update user option
+ $.post( ajaxurl, {
+ action: 'save-user-color-scheme',
+ color_scheme: color_scheme,
+ user_id: user_id
+ });
+
+ }
+
+ });
+
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> })(jQuery);
</span></span></pre></div>
<a id="trunksrcwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/general-template.php (26136 => 26137)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/general-template.php 2013-11-13 19:23:16 UTC (rev 26136)
+++ trunk/src/wp-includes/general-template.php 2013-11-13 19:37:10 UTC (rev 26137)
</span><span class="lines">@@ -2085,14 +2085,20 @@
</span><span class="cx"> * @param string $name The name of the theme.
</span><span class="cx"> * @param string $url The url of the css file containing the colour scheme.
</span><span class="cx"> * @param array $colors Optional An array of CSS color definitions which are used to give the user a feel for the theme.
</span><ins>+ * @param array $icons Optional An array of CSS color definitions used to color any SVG icons
</ins><span class="cx"> */
</span><del>-function wp_admin_css_color($key, $name, $url, $colors = array()) {
</del><ins>+function wp_admin_css_color( $key, $name, $url, $colors = array(), $icons = array() ) {
</ins><span class="cx"> global $_wp_admin_css_colors;
</span><span class="cx">
</span><span class="cx"> if ( !isset($_wp_admin_css_colors) )
</span><span class="cx"> $_wp_admin_css_colors = array();
</span><span class="cx">
</span><del>- $_wp_admin_css_colors[$key] = (object) array('name' => $name, 'url' => $url, 'colors' => $colors);
</del><ins>+ $_wp_admin_css_colors[$key] = (object) array(
+ 'name' => $name,
+ 'url' => $url,
+ 'colors' => $colors,
+ 'icon_colors' => $icons,
+ );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -2101,8 +2107,33 @@
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> */
</span><span class="cx"> function register_admin_color_schemes() {
</span><del>- wp_admin_css_color( 'fresh', _x( 'Default', 'admin color scheme' ), admin_url( 'css/colors-fresh.min.css' ),
- array( '#222', '#333', '#0074a2', '#2ea2cc' ) );
</del><ins>+ $suffix = SCRIPT_DEBUG ? '' : '.min';
+
+ wp_admin_css_color( 'fresh', _x( 'Default', 'admin color scheme' ),
+ admin_url( "css/colors-fresh$suffix.css" ),
+ array( '#222', '#333', '#0074a2', '#2ea2cc' )
+ );
+
+ // Other color schemes are not available when running out of src
+ if ( ! strpos( $GLOBALS['wp_version'], '-src' ) ) {
+ wp_admin_css_color( 'light', _x( 'Light', 'admin color scheme' ),
+ admin_url( "css/color-schemes/light/colors$suffix.css" ),
+ array( '#e5e5e5', '#999', '#d64e07', '#04a4cc' ),
+ array( 'base' => '#999', 'focus' => '#ccc', 'current' => '#ccc' )
+ );
+
+ wp_admin_css_color( 'blue', _x( 'Blue', 'admin color scheme' ),
+ admin_url( "css/color-schemes/blue/colors$suffix.css" ),
+ array( '#096484', '#4796b3', '#52accc', '#74B6CE' ),
+ array( 'base' => '#e5f8ff', 'focus' => '#fff', 'current' => '#fff' )
+ );
+
+ wp_admin_css_color( 'midnight', _x( 'Midnight', 'admin color scheme' ),
+ admin_url( "css/color-schemes/midnight/colors$suffix.css" ),
+ array( '#25282b', '#363b3f', '#69a8bb', '#e14d43' ),
+ array( 'base' => '#f1f2f3', 'focus' => '#fff', 'current' => '#fff' )
+ );
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre>
</div>
</div>
</body>
</html>