<!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>[20598] trunk/wp-includes: Theme Customizer: Add statuses to the color and image controls.</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, #logmsg > ol { margin-left: 0; 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/20598">20598</a></dd>
<dt>Author</dt> <dd>koopersmith</dd>
<dt>Date</dt> <dd>2012-04-25 21:03:29 +0000 (Wed, 25 Apr 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Theme Customizer: Add statuses to the color and image controls. see <a href="http://core.trac.wordpress.org/ticket/19910">#19910</a>.

Move the color control from the switch statement to WP_Customize_Color_Control.
Markup improvements.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesclasswpcustomizecontrolphp">trunk/wp-includes/class-wp-customize-control.php</a></li>
<li><a href="#trunkwpincludesclasswpcustomizephp">trunk/wp-includes/class-wp-customize.php</a></li>
<li><a href="#trunkwpincludescsscustomizecontrolsdevcss">trunk/wp-includes/css/customize-controls.dev.css</a></li>
<li><a href="#trunkwpincludesjscustomizecontrolsdevjs">trunk/wp-includes/js/customize-controls.dev.js</a></li>
<li><a href="#trunkwpincludesjscustomizepreviewdevjs">trunk/wp-includes/js/customize-preview.dev.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesclasswpcustomizecontrolphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/class-wp-customize-control.php (20597 => 20598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-customize-control.php        2012-04-25 20:56:26 UTC (rev 20597)
+++ trunk/wp-includes/class-wp-customize-control.php        2012-04-25 21:03:29 UTC (rev 20598)
</span><span class="lines">@@ -64,14 +64,7 @@
</span><span class="cx">          *
</span><span class="cx">          * @since 3.4.0
</span><span class="cx">          */
</span><del>-        public function enqueue() {
-                switch( $this-&gt;type ) {
-                        case 'color':
-                                wp_enqueue_script( 'farbtastic' );
-                                wp_enqueue_style( 'farbtastic' );
-                                break;
-                }
-        }
</del><ins>+        public function enqueue() {}
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="lines">@@ -176,27 +169,11 @@
</span><span class="cx">                                 &lt;/label&gt;
</span><span class="cx">                                 &lt;?php
</span><span class="cx">                                 break;
</span><del>-                        case 'color':
-                                ?&gt;
-                                &lt;label&gt;
-                                        &lt;span class=&quot;customize-control-title&quot;&gt;&lt;?php echo esc_html( $this-&gt;label ); ?&gt;&lt;/span&gt;
-                                        &lt;div class=&quot;dropdown color-picker-toggle&quot;&gt;
-                                                &lt;div class=&quot;dropdown-content color-picker-spot&quot;&gt;&lt;/div&gt;
-                                                &lt;div class=&quot;dropdown-arrow&quot;&gt;&lt;/div&gt;
-                                        &lt;/div&gt;
-                                        &lt;div class=&quot;color-picker-control color-picker-hex&quot;&gt;
-                                                &lt;span&gt;#&lt;/span&gt;
-                                                &lt;input type=&quot;text&quot; &lt;?php $this-&gt;link(); ?&gt; /&gt;
-                                        &lt;/div&gt;
-                                        &lt;div class=&quot;color-picker-control farbtastic-placeholder&quot;&gt;&lt;/div&gt;
-                                &lt;/label&gt;
-                                &lt;?php
-                                break;
</del><span class="cx">                         case 'checkbox':
</span><span class="cx">                                 ?&gt;
</span><span class="cx">                                 &lt;label&gt;
</span><span class="cx">                                         &lt;span class=&quot;customize-control-title&quot;&gt;&lt;?php echo esc_html( $this-&gt;label ); ?&gt;&lt;/span&gt;
</span><del>-                                        &lt;input type=&quot;checkbox&quot; value=&quot;&lt;?php echo esc_attr( $this-&gt;value() ); ?&gt;&quot; &lt;?php $this-&gt;link(); checked( $this-&gt;value() ); ?&gt; class=&quot;customize-control-content&quot; /&gt;
</del><ins>+                                        &lt;input type=&quot;checkbox&quot; value=&quot;&lt;?php echo esc_attr( $this-&gt;value() ); ?&gt;&quot; &lt;?php $this-&gt;link(); checked( $this-&gt;value() ); ?&gt; /&gt;
</ins><span class="cx">                                 &lt;/label&gt;
</span><span class="cx">                                 &lt;?php
</span><span class="cx">                                 break;
</span><span class="lines">@@ -225,7 +202,7 @@
</span><span class="cx">                                 ?&gt;
</span><span class="cx">                                 &lt;label&gt;
</span><span class="cx">                                         &lt;span class=&quot;customize-control-title&quot;&gt;&lt;?php echo esc_html( $this-&gt;label ); ?&gt;&lt;/span&gt;
</span><del>-                                        &lt;select &lt;?php $this-&gt;link(); ?&gt; class=&quot;customize-control-content&quot;&gt;
</del><ins>+                                        &lt;select &lt;?php $this-&gt;link(); ?&gt;&gt;
</ins><span class="cx">                                                 &lt;?php
</span><span class="cx">                                                 foreach ( $this-&gt;choices as $value =&gt; $label )
</span><span class="cx">                                                         echo '&lt;option value=&quot;' . esc_attr( $value ) . '&quot;' . selected( $this-&gt;value(), $value, false ) . '&gt;' . $label . '&lt;/option&gt;';
</span><span class="lines">@@ -258,6 +235,47 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+class WP_Customize_Color_Control extends WP_Customize_Control {
+        public $type = 'color';
+        public $statuses;
+
+        public function __construct( $manager, $id, $args = array() ) {
+                $this-&gt;statuses = array( '' =&gt; __('Default') );
+                parent::__construct( $manager, $id, $args );
+        }
+
+        public function enqueue() {
+                wp_enqueue_script( 'farbtastic' );
+                wp_enqueue_style( 'farbtastic' );
+        }
+
+        public function to_json() {
+                parent::to_json();
+                $this-&gt;json['statuses'] = $this-&gt;statuses;
+        }
+
+        public function render_content() {
+                ?&gt;
+                &lt;label&gt;
+                        &lt;span class=&quot;customize-control-title&quot;&gt;&lt;?php echo esc_html( $this-&gt;label ); ?&gt;&lt;/span&gt;
+                        &lt;div class=&quot;customize-control-content&quot;&gt;
+                                &lt;div class=&quot;dropdown&quot;&gt;
+                                        &lt;div class=&quot;dropdown-content&quot;&gt;
+                                                &lt;div class=&quot;dropdown-status&quot;&gt;&lt;/div&gt;
+                                        &lt;/div&gt;
+                                        &lt;div class=&quot;dropdown-arrow&quot;&gt;&lt;/div&gt;
+                                &lt;/div&gt;
+                                &lt;div class=&quot;color-picker-hex&quot;&gt;
+                                        &lt;span&gt;#&lt;/span&gt;
+                                        &lt;input type=&quot;text&quot; &lt;?php $this-&gt;link(); ?&gt; /&gt;
+                                &lt;/div&gt;
+                        &lt;/div&gt;
+                        &lt;div class=&quot;farbtastic-placeholder&quot;&gt;&lt;/div&gt;
+                &lt;/label&gt;
+                &lt;?php
+        }
+}
+
</ins><span class="cx"> class WP_Customize_Upload_Control extends WP_Customize_Control {
</span><span class="cx">         public $type    = 'upload';
</span><span class="cx">         public $removed = '';
</span><span class="lines">@@ -292,16 +310,24 @@
</span><span class="cx"> class WP_Customize_Image_Control extends WP_Customize_Upload_Control {
</span><span class="cx">         public $type = 'image';
</span><span class="cx">         public $get_url;
</span><ins>+        public $statuses;
</ins><span class="cx"> 
</span><span class="cx">         protected $tabs = array();
</span><span class="cx"> 
</span><span class="cx">         public function __construct( $manager, $id, $args ) {
</span><ins>+                $this-&gt;statuses = array( '' =&gt; __('No Image') );
+
</ins><span class="cx">                 parent::__construct( $manager, $id, $args );
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;add_tab( 'upload-new', __('Upload New'), array( $this, 'tab_upload_new' ) );
</span><span class="cx">                 $this-&gt;add_tab( 'uploaded',   __('Uploaded'),   array( $this, 'tab_uploaded' ) );
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        public function to_json() {
+                parent::to_json();
+                $this-&gt;json['statuses'] = $this-&gt;statuses;
+        }
+
</ins><span class="cx">         public function render_content() {
</span><span class="cx">                 $src = $this-&gt;value();
</span><span class="cx">                 if ( isset( $this-&gt;get_url ) )
</span><span class="lines">@@ -311,16 +337,18 @@
</span><span class="cx">                 &lt;label class=&quot;customize-image-picker&quot;&gt;
</span><span class="cx">                         &lt;span class=&quot;customize-control-title&quot;&gt;&lt;?php echo esc_html( $this-&gt;label ); ?&gt;&lt;/span&gt;
</span><span class="cx"> 
</span><del>-
-                        &lt;div class=&quot;dropdown preview-thumbnail&quot;&gt;
-                                &lt;div class=&quot;dropdown-content&quot;&gt;
-                                        &lt;?php if ( empty( $src ) ): ?&gt;
-                                                &lt;img style=&quot;display:none;&quot; /&gt;
-                                        &lt;?php else: ?&gt;
-                                                &lt;img src=&quot;&lt;?php echo esc_url( $src ); ?&gt;&quot; /&gt;
-                                        &lt;?php endif; ?&gt;
</del><ins>+                        &lt;div class=&quot;customize-control-content&quot;&gt;
+                                &lt;div class=&quot;dropdown preview-thumbnail&quot;&gt;
+                                        &lt;div class=&quot;dropdown-content&quot;&gt;
+                                                &lt;?php if ( empty( $src ) ): ?&gt;
+                                                        &lt;img style=&quot;display:none;&quot; /&gt;
+                                                &lt;?php else: ?&gt;
+                                                        &lt;img src=&quot;&lt;?php echo esc_url( $src ); ?&gt;&quot; /&gt;
+                                                &lt;?php endif; ?&gt;
+                                                &lt;div class=&quot;dropdown-status&quot;&gt;&lt;/div&gt;
+                                        &lt;/div&gt;
+                                        &lt;div class=&quot;dropdown-arrow&quot;&gt;&lt;/div&gt;
</ins><span class="cx">                                 &lt;/div&gt;
</span><del>-                                &lt;div class=&quot;dropdown-arrow&quot;&gt;&lt;/div&gt;
</del><span class="cx">                         &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx">                         &lt;div class=&quot;library&quot;&gt;
</span><span class="lines">@@ -374,11 +402,17 @@
</span><span class="cx"> class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
</span><span class="cx">         public function __construct( $manager ) {
</span><span class="cx">                 parent::__construct( $manager, 'header_image', array(
</span><del>-                        'label'   =&gt; __( 'Header Image' ),
-                        'section' =&gt; 'header',
-                        'context' =&gt; 'custom-header',
-                        'removed' =&gt; 'remove-header',
-                        'get_url' =&gt; 'get_header_image',
</del><ins>+                        'label'    =&gt; __( 'Header Image' ),
+                        'section'  =&gt; 'header',
+                        'context'  =&gt; 'custom-header',
+                        'removed'  =&gt; 'remove-header',
+                        'get_url'  =&gt; 'get_header_image',
+                        'statuses' =&gt; array(
+                                ''                      =&gt; __('Default'),
+                                'remove-header'         =&gt; __('No Image'),
+                                'random-default-image'  =&gt; __('Random Default Image'),
+                                'random-uploaded-image' =&gt; __('Random Uploaded Image'),
+                        )
</ins><span class="cx">                 ) );
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;add_tab( 'default',  __('Default'),  array( $this, 'tab_default_headers' ) );
</span></span></pre></div>
<a id="trunkwpincludesclasswpcustomizephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/class-wp-customize.php (20597 => 20598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-customize.php        2012-04-25 20:56:26 UTC (rev 20597)
+++ trunk/wp-includes/class-wp-customize.php        2012-04-25 21:03:29 UTC (rev 20598)
</span><span class="lines">@@ -539,7 +539,6 @@
</span><span class="cx">                 $this-&gt;add_setting( 'header_textcolor', array(
</span><span class="cx">                         // @todo: replace with a new accept() setting method
</span><span class="cx">                         // 'sanitize_callback' =&gt; 'sanitize_hexcolor',
</span><del>-                        'control'        =&gt; 'color',
</del><span class="cx">                         'theme_supports' =&gt; array( 'custom-header', 'header-text' ),
</span><span class="cx">                         'default'        =&gt; get_theme_support( 'custom-header', 'default-text-color' ),
</span><span class="cx">                 ) );
</span><span class="lines">@@ -551,11 +550,10 @@
</span><span class="cx">                         'type'     =&gt; 'checkbox',
</span><span class="cx">                 ) );
</span><span class="cx"> 
</span><del>-                $this-&gt;add_control( 'header_textcolor', array(
</del><ins>+                $this-&gt;add_control( new WP_Customize_Color_Control( $this, 'header_textcolor', array(
</ins><span class="cx">                         'label'   =&gt; __( 'Text Color' ),
</span><span class="cx">                         'section' =&gt; 'header',
</span><del>-                        'type'    =&gt; 'color',
-                ) );
</del><ins>+                ) ) );
</ins><span class="cx"> 
</span><span class="cx">                 // Input type: checkbox
</span><span class="cx">                 // With custom value
</span><span class="lines">@@ -583,21 +581,19 @@
</span><span class="cx">                         'transport'         =&gt; 'postMessage',
</span><span class="cx">                 ) );
</span><span class="cx"> 
</span><del>-                $this-&gt;add_control( 'background_color', array(
</del><ins>+                $this-&gt;add_control( new WP_Customize_Color_Control( $this, 'background_color', array(
</ins><span class="cx">                         'label'   =&gt; __( 'Background Color' ),
</span><span class="cx">                         'section' =&gt; 'background',
</span><del>-                        'type'    =&gt; 'color',
-                ) );
</del><ins>+                ) ) );
</ins><span class="cx"> 
</span><span class="cx">                 $this-&gt;add_setting( 'background_image', array(
</span><span class="cx">                         'default'        =&gt; get_theme_support( 'custom-background', 'default-image' ),
</span><span class="cx">                         'theme_supports' =&gt; 'custom-background',
</span><span class="cx">                 ) );
</span><span class="cx"> 
</span><del>-                $this-&gt;add_control( new WP_Customize_Upload_Control( $this, 'background_image', array(
</del><ins>+                $this-&gt;add_control( new WP_Customize_Image_Control( $this, 'background_image', array(
</ins><span class="cx">                         'label'          =&gt; __( 'Background Image' ),
</span><span class="cx">                         'section'        =&gt; 'background',
</span><del>-                        'type'           =&gt; 'upload',
</del><span class="cx">                         'context'        =&gt; 'custom-background',
</span><span class="cx">                 ) ) );
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludescsscustomizecontrolsdevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/css/customize-controls.dev.css (20597 => 20598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/css/customize-controls.dev.css        2012-04-25 20:56:26 UTC (rev 20597)
+++ trunk/wp-includes/css/customize-controls.dev.css        2012-04-25 21:03:29 UTC (rev 20598)
</span><span class="lines">@@ -141,6 +141,10 @@
</span><span class="cx">         margin-right: 10px;
</span><span class="cx">         line-height: 28px;
</span><span class="cx"> }
</span><ins>+.customize-control-content {
+        float: right;
+        width: 140px;
+}
</ins><span class="cx"> 
</span><span class="cx"> .customize-control-text input,
</span><span class="cx"> .customize-control-select select,
</span><span class="lines">@@ -217,14 +221,18 @@
</span><span class="cx">         overflow: hidden;
</span><span class="cx">         float: left;
</span><span class="cx">         min-width: 30px;
</span><del>-        height: 24px;
-        line-height: 24px;
</del><ins>+        height: 16px;
+        line-height: 16px;
</ins><span class="cx">         margin-right: 16px;
</span><del>-        padding: 0 5px;
</del><ins>+        padding: 4px 5px;
</ins><span class="cx">         background-color: #eee;
</span><span class="cx">         border: 1px solid #ccc;
</span><span class="cx">         -webkit-border-radius: 3px 0 0 3px;
</span><span class="cx">         border-radius: 3px 0 0 3px;
</span><ins>+
+        -webkit-user-select: none;
+        -moz-user-select: none;
+        user-select: none;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .customize-control .dropdown-arrow {
</span><span class="lines">@@ -269,29 +277,41 @@
</span><span class="cx">         border-color: #aaa transparent;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.customize-control .dropdown-status {
+        display: none;
+        max-width: 112px;
+        color: #999;
+}
+
</ins><span class="cx"> /*
</span><span class="cx">  * Color Picker
</span><span class="cx">  */
</span><del>-.customize-control .color-picker-control {
</del><ins>+.customize-control-color .color-picker-hex,
+.customize-control-color .farbtastic-placeholder {
</ins><span class="cx">         display: none;
</span><span class="cx"> }
</span><del>-.customize-control.open .color-picker-control {
</del><ins>+.customize-control-color.open .color-picker-hex,
+.customize-control-color.open .farbtastic-placeholder {
</ins><span class="cx">         display: block;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.customize-control .dropdown .color-picker-spot {
</del><ins>+.customize-control-color .dropdown {
+        margin-right: 5px;
+        margin-bottom: 5px;
+}
+
+.customize-control-color .dropdown .dropdown-content {
</ins><span class="cx">         background-color: #fff;
</span><span class="cx">         border: 1px solid rgba( 0, 0, 0, 0.15 );
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.customize-section .dropdown:hover .color-picker-spot {
</del><ins>+.customize-control-color .dropdown:hover .dropdown-content {
</ins><span class="cx">         border-color: rgba( 0, 0, 0, 0.25 );
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .customize-section .color-picker-hex {
</span><span class="cx">         float: left;
</span><span class="cx">         width: 70px;
</span><del>-        margin-left: 5px;
</del><span class="cx">         font-family: monospace;
</span><span class="cx">         background-color: #fff;
</span><span class="cx">         color: #777;
</span><span class="lines">@@ -322,13 +342,13 @@
</span><span class="cx">         border-radius: 0 3px 3px 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.customize-section .color-picker-control.farbtastic-placeholder {
</del><ins>+.customize-control-color .farbtastic-placeholder {
</ins><span class="cx">         width: 235px;
</span><span class="cx">         margin: 5px 0 10px 25px;
</span><span class="cx">         float: left;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.customize-section .color-picker-control .farbtastic {
</del><ins>+.customize-control-color .farbtastic {
</ins><span class="cx">         margin: 0 auto;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -339,6 +359,7 @@
</span><span class="cx"> .customize-control-image .library,
</span><span class="cx"> .customize-control-image .actions {
</span><span class="cx">         display: none;
</span><ins>+        float: left;
</ins><span class="cx"> }
</span><span class="cx"> .customize-control-image.open .library,
</span><span class="cx"> .customize-control-image.open .actions {
</span><span class="lines">@@ -352,6 +373,10 @@
</span><span class="cx">         padding: 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.customize-section .customize-control-image .dropdown-status {
+        padding: 4px 5px;
+}
+
</ins><span class="cx"> .customize-section .customize-control-image .preview-thumbnail img {
</span><span class="cx">         display: block;
</span><span class="cx">         max-width: 122px;
</span><span class="lines">@@ -397,7 +422,7 @@
</span><span class="cx"> 
</span><span class="cx"> .customize-section .customize-control-image .library-content {
</span><span class="cx">         display: none;
</span><del>-        width: 260px;
</del><ins>+        width: 100%;
</ins><span class="cx">         float: left;
</span><span class="cx">         padding: 10px 0;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpincludesjscustomizecontrolsdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/customize-controls.dev.js (20597 => 20598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/customize-controls.dev.js        2012-04-25 20:56:26 UTC (rev 20597)
+++ trunk/wp-includes/js/customize-controls.dev.js        2012-04-25 21:03:29 UTC (rev 20598)
</span><span class="lines">@@ -90,14 +90,30 @@
</span><span class="cx">                                         element.set( setting() );
</span><span class="cx">                                 });
</span><span class="cx">                         });
</span><ins>+                },
</ins><span class="cx"> 
</span><ins>+                ready: function() {},
+
+                dropdownInit: function() {
+                        var control  = this,
+                                statuses = this.container.find('.dropdown-status'),
+                                params   = this.params,
+                                update   = function( to ) {
+                                        if ( typeof        to === 'string' &amp;&amp; params.statuses &amp;&amp; params.statuses[ to ] )
+                                                statuses.html( params.statuses[ to ] ).show();
+                                        else
+                                                statuses.hide();
+                                };
+
</ins><span class="cx">                         // Support the .dropdown class to open/close complex elements
</span><span class="cx">                         this.container.on( 'click', '.dropdown', function( event ) {
</span><span class="cx">                                 event.preventDefault();
</span><span class="cx">                                 control.container.toggleClass('open');
</span><span class="cx">                         });
</span><del>-                },
-                ready: function() {}
</del><ins>+
+                        this.setting.bind( update );
+                        update( this.setting() );
+                }
</ins><span class="cx">         });
</span><span class="cx"> 
</span><span class="cx">         api.ColorControl = api.Control.extend({
</span><span class="lines">@@ -105,9 +121,9 @@
</span><span class="cx">                         var control = this,
</span><span class="cx">                                 spot, text, update;
</span><span class="cx"> 
</span><del>-                        spot   = this.container.find('.color-picker-spot');
</del><ins>+                        spot   = this.container.find('.dropdown-content');
</ins><span class="cx">                         update = function( color ) {
</span><del>-                                color = '#' + color;
</del><ins>+                                color = color ? '#' + color : '';
</ins><span class="cx">                                 spot.css( 'background', color );
</span><span class="cx">                                 control.farbtastic.setColor( color );
</span><span class="cx">                         };
</span><span class="lines">@@ -118,6 +134,8 @@
</span><span class="cx"> 
</span><span class="cx">                         this.setting.bind( update );
</span><span class="cx">                         update( this.setting() );
</span><ins>+
+                        this.dropdownInit();
</ins><span class="cx">                 }
</span><span class="cx">         });
</span><span class="cx"> 
</span><span class="lines">@@ -218,6 +236,8 @@
</span><span class="cx">                                 if ( ! this.tabs.uploaded.panel.find('.thumbnail').length )
</span><span class="cx">                                         this.tabs.uploaded.both.addClass('hidden');
</span><span class="cx">                         }
</span><ins>+
+                        this.dropdownInit();
</ins><span class="cx">                 },
</span><span class="cx">                 success: function( attachment ) {
</span><span class="cx">                         api.UploadControl.prototype.success.call( this, attachment );
</span></span></pre></div>
<a id="trunkwpincludesjscustomizepreviewdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/customize-preview.dev.js (20597 => 20598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/customize-preview.dev.js        2012-04-25 20:56:26 UTC (rev 20597)
+++ trunk/wp-includes/js/customize-preview.dev.js        2012-04-25 21:03:29 UTC (rev 20598)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">                 // Auto update background color by default
</span><span class="cx">                 api( 'background_color', function( value ) {
</span><span class="cx">                         value.bind( function( to ) {
</span><del>-                                body.css( 'background-color', '#' + to );
</del><ins>+                                body.css( 'background-color', to ? '#' + to : '' );
</ins><span class="cx">                         });
</span><span class="cx">                 });
</span><span class="cx">         });
</span></span></pre>
</div>
</div>

</body>
</html>