<!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>[22030] trunk: New color picker, props mattwiebe.</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/22030">22030</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-09-27 01:57:38 +0000 (Thu, 27 Sep 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>New color picker, props mattwiebe. see <a href="http://core.trac.wordpress.org/ticket/21206">#21206</a>.
Replaces Farbtastic. May change further in response to user testing.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincustombackgroundphp">trunk/wp-admin/custom-background.php</a></li>
<li><a href="#trunkwpadmincustomheaderphp">trunk/wp-admin/custom-header.php</a></li>
<li><a href="#trunkwpadminjscustombackgroundjs">trunk/wp-admin/js/custom-background.js</a></li>
<li><a href="#trunkwpadminjscustomizecontrolsjs">trunk/wp-admin/js/customize-controls.js</a></li>
<li><a href="#trunkwpincludesclasswpcustomizecontrolphp">trunk/wp-includes/class-wp-customize-control.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpadmincsscolorpickercss">trunk/wp-admin/css/color-picker.css</a></li>
<li><a href="#trunkwpadmincsscolorpickermincss">trunk/wp-admin/css/color-picker.min.css</a></li>
<li><a href="#trunkwpadminjscolorpickerjs">trunk/wp-admin/js/color-picker.js</a></li>
<li><a href="#trunkwpadminjscolorpickerminjs">trunk/wp-admin/js/color-picker.min.js</a></li>
<li><a href="#trunkwpadminjsirisminjs">trunk/wp-admin/js/iris.min.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsscolorpickercss"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/css/color-picker.css (0 => 22030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/color-picker.css         (rev 0)
+++ trunk/wp-admin/css/color-picker.css        2012-09-27 01:57:38 UTC (rev 22030)
</span><span class="lines">@@ -0,0 +1,105 @@
</span><ins>+.wp-color-picker {
+        width: 80px;
+}
+.wp-picker-container .hidden {
+        display: none;
+}
+.wp-color-result {
+        background-color: #f9f9f9;
+        border: 1px solid #c4c4c4;
+        -moz-border-radius: 4px;
+        -webkit-border-radius: 4px;
+        border-radius: 4px;
+        box-shadow: inset 1px 1px 0 rgba(0,0,0,.05);
+        -moz-box-shadow: inset 1px 1px 0 rgba(0,0,0,.05);
+        -ms-box-shadow: inset 1px 1px 0 rgba(0,0,0,.05);
+        -o-box-shadow: inset 1px 1px 0 rgba(0,0,0,.05);
+        -webkit-box-shadow: inset 1px 1px 0 rgba(0,0,0,.05);
+        cursor: pointer;
+        display: inline-block;
+        height: 21px;
+        margin: 0 6px 1px 0px;
+        position: relative;
+        top: 1px;
+        user-select: none;
+        -moz-user-select: none;
+        -ms-user-select: none;
+        -webkit-user-select: none;
+        vertical-align: bottom;
+        display: inline-block;
+        padding-left: 30px;
+}
+.wp-color-result::after {
+        background-color: #f9f9f9;
+        background-image: -moz-linear-gradient(top, #fff 0%, #eee 100%);
+        background-image: -webkit-linear-gradient(top, #fff 0%, #eee 100%);
+        background-image: -ms-linear-gradient(top, #fff 0%, #eee 100%);
+        background-image: -o-linear-gradient(top, #fff 0%, #eee 100%);
+        background-image: linear-gradient(top, #fff 0%, #eee 100%);
+        -moz-border-radius-bottomright: 3px;
+        -moz-border-radius-topright: 3px;
+        -webkit-border-radius: 0 3px 3px 0;
+        border-radius: 0 3px 3px 0;
+        border-bottom-right-radius: 3px;
+        border-left: 1px solid #c4c4c4;
+        content: attr( title );
+        color: #555;
+        display: block;
+        font-size: 11px;
+        line-height: 21px;
+        padding: 0 6px;
+        position: relative;
+        right: 0px;
+        text-align: center;
+        top: 0px;
+}
+.wp-color-result:hover {
+        border-color: #aaa;
+        box-shadow: 0 1px 1px rgba(0,0,0,0.1);
+        -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.1);
+        -ms-box-shadow: 0 1px 1px rgba(0,0,0,0.1);
+        -o-box-shadow: 0 1px 1px rgba(0,0,0,0.1);
+        -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.1);
+}
+.wp-color-result:hover:after {
+        color: #222;
+        border-color: #aaa;
+        border-left: 1px solid #999;
+}
+.wp-color-result.wp-picker-open {
+        top: 0;
+        /*width: 5px;*/
+}
+.wp-color-result.wp-picker-open:after {
+        content: attr( data-current );
+}
+.wp-picker-container, .wp-picker-container:active {
+        display: inline-block;
+        outline: 0;
+}
+.wp-color-result:focus {
+        border-color: #888;
+        -moz-box-shadow: 0 1px 2px rgba(0,0,0,0.2);
+        -ms-box-shadow: 0 1px 2px rgba(0,0,0,0.2);
+        -o-box-shadow: 0 1px 2px rgba(0,0,0,0.2);
+        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.2);
+        box-shadow: 0 1px 2px rgba(0,0,0,0.2);
+}
+.wp-color-result:focus:after {
+        border-color: #888;
+}
+.wp-picker-container .button {
+        margin-left: 6px;
+}
+.wp-picker-container .iris-square-slider .ui-slider-handle:focus {
+        background-color: #555
+}
+.wp-picker-container .iris-picker {
+        border-color: #dfdfdf;
+        margin-top: 6px;
+}
+input[type="text"].iris-error {
+        background-color: #ffebe8;
+        border-color: #c00;
+        color: #000;
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadmincustombackgroundphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/custom-background.php (22029 => 22030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/custom-background.php        2012-09-27 01:11:04 UTC (rev 22029)
+++ trunk/wp-admin/custom-background.php        2012-09-27 01:57:38 UTC (rev 22030)
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx">                 add_thickbox();
</span><span class="cx">                 wp_enqueue_script('media-upload');
</span><span class="cx">                 wp_enqueue_script('custom-background');
</span><del>-                wp_enqueue_style('farbtastic');
</del><ins>+                wp_enqueue_style('wp-color-picker');
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /**
</span><span class="lines">@@ -327,11 +327,12 @@
</span><span class="cx"> <tr valign="top">
</span><span class="cx"> <th scope="row"><?php _e( 'Background Color' ); ?></th>
</span><span class="cx"> <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Color' ); ?></span></legend>
</span><del>-<?php $show_clear = get_theme_mod('background_color') ? '' : ' style="display:none"'; ?>
-<input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr(get_background_color()) ?>" />
-<a class="hide-if-no-js" href="#" id="pickcolor"><?php _e('Select a Color'); ?></a> <span<?php echo $show_clear; ?> class="hide-if-no-js" id="clearcolor"> (<a href="#"><?php current_theme_supports( 'custom-background', 'default-color' ) ? _e( 'Default' ) : _e( 'Clear' ); ?></a>)</span>
-<input type="hidden" id="defaultcolor" value="<?php if ( current_theme_supports( 'custom-background', 'default-color' ) ) echo '#' . esc_attr( get_theme_support( 'custom-background', 'default-color' ) ); ?>" />
-<div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
</del><ins>+<?php
+$default_color = '';
+if ( current_theme_supports( 'custom-background', 'default-color' ) )
+        $default_color = ' data-default-color="#' . esc_attr( get_theme_support( 'custom-background', 'default-color' ) ) . '"';
+?>
+<input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr( get_background_color() ); ?>"<?php echo $default_color ?> />
</ins><span class="cx"> </fieldset></td>
</span><span class="cx"> </tr>
</span><span class="cx"> </tbody>
</span></span></pre></div>
<a id="trunkwpadmincustomheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/custom-header.php (22029 => 22030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/custom-header.php        2012-09-27 01:11:04 UTC (rev 22029)
+++ trunk/wp-admin/custom-header.php        2012-09-27 01:57:38 UTC (rev 22030)
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx">                         wp_enqueue_script( 'media-upload' );
</span><span class="cx">                         wp_enqueue_script( 'custom-header' );
</span><span class="cx">                         if ( current_theme_supports( 'custom-header', 'header-text' ) )
</span><del>-                                wp_enqueue_script('farbtastic');
</del><ins>+                                wp_enqueue_script( 'wp-color-picker' );
</ins><span class="cx">                 } elseif ( 2 == $step ) {
</span><span class="cx">                         wp_enqueue_script('imgareaselect');
</span><span class="cx">                 }
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx">                 $step = $this->step();
</span><span class="cx">
</span><span class="cx">                 if ( ( 1 == $step || 3 == $step ) && current_theme_supports( 'custom-header', 'header-text' ) )
</span><del>-                        wp_enqueue_style('farbtastic');
</del><ins>+                        wp_enqueue_style( 'wp-color-picker' );
</ins><span class="cx">                 elseif ( 2 == $step )
</span><span class="cx">                         wp_enqueue_style('imgareaselect');
</span><span class="cx">         }
</span><span class="lines">@@ -332,7 +332,6 @@
</span><span class="cx">         function js_1() { ?>
</span><span class="cx"> <script type="text/javascript">
</span><span class="cx"> /* <![CDATA[ */
</span><del>-var farbtastic;
</del><span class="cx"> (function($){
</span><span class="cx">         var default_color = '#<?php echo get_theme_support( 'custom-header', 'default-text-color' ); ?>',
</span><span class="cx">                 header_text_fields;
</span><span class="lines">@@ -341,7 +340,6 @@
</span><span class="cx">                 $('#name').css('color', color);
</span><span class="cx">                 $('#desc').css('color', color);
</span><span class="cx">                 $('#text-color').val(color);
</span><del>-                farbtastic.setColor(color);
</del><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function toggle_text() {
</span><span class="lines">@@ -360,45 +358,20 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         $(document).ready(function() {
</span><ins>+                var text_color = $('#text-color');
</ins><span class="cx">                 header_text_fields = $('.displaying-header-text');
</span><del>-                $('#pickcolor').click(function(e) {
-                        e.preventDefault();
-                        $('#color-picker').show();
</del><ins>+                text_color.wpColorPicker({
+                        change: function( event, ui ) {
+                                pickColor( text_color.wpColorPicker('color') );
+                        },
+                        clear: function() {
+                                pickColor( '' );
+                        }
</ins><span class="cx">                 });
</span><del>-
</del><span class="cx">                 $('#display-header-text').click( toggle_text );
</span><del>-
-                $('#defaultcolor').click(function() {
-                        pickColor(default_color);
-                        $('#text-color').val(default_color);
-                });
-
-                $('#text-color').keyup(function() {
-                        var _hex = $('#text-color').val();
-                        var hex = _hex;
-                        if ( hex[0] != '#' )
-                                hex = '#' + hex;
-                        hex = hex.replace(/[^#a-fA-F0-9]+/, '');
-                        if ( hex != _hex )
-                                $('#text-color').val(hex);
-                        if ( hex.length == 4 || hex.length == 7 )
-                                pickColor( hex );
-                });
-
-                $(document).mousedown(function(){
-                        $('#color-picker').each( function() {
-                                var display = $(this).css('display');
-                                if (display == 'block')
-                                        $(this).fadeOut(2);
-                        });
-                });
-
-                farbtastic = $.farbtastic('#color-picker', function(color) { pickColor(color); });
-                <?php if ( display_header_text() ) { ?>
-                pickColor('#<?php echo get_header_textcolor(); ?>');
-                <?php } else { ?>
</del><ins>+                <?php if ( ! display_header_text() ) : ?>
</ins><span class="cx">                 toggle_text();
</span><del>-                <?php } ?>
</del><ins>+                <?php endif; ?>
</ins><span class="cx">         });
</span><span class="cx"> })(jQuery);
</span><span class="cx"> /* ]]> */
</span><span class="lines">@@ -647,14 +620,14 @@
</span><span class="cx"> <th scope="row"><?php _e( 'Text Color' ); ?></th>
</span><span class="cx"> <td>
</span><span class="cx">         <p>
</span><del>-<?php if ( display_header_text() ) : ?>
-                <input type="text" name="text-color" id="text-color" value="#<?php echo esc_attr( get_header_textcolor() ); ?>" />
-<?php else : ?>
-                <input type="text" name="text-color" id="text-color" value="#<?php echo esc_attr( get_theme_support( 'custom-header', 'default-text-color' ) ); ?>" />
-<?php endif; ?>
-                <a href="#" class="hide-if-no-js" id="pickcolor"><?php _e( 'Select a Color' ); ?></a>
</del><ins>+<?php
+$header_textcolor = display_header_text() ? get_header_textcolor() : get_theme_support( 'custom-header', 'default-text-color' );
+$default_color = '';
+if ( current_theme_supports( 'custom-header', 'default-text-color' ) )
+        $default_color = ' data-default-color="#' . esc_attr( get_theme_support( 'custom-header', 'default-text-color' ) ) . '"';
+?>
+                <input type="text" name="text-color" id="text-color" value="#<?php echo esc_attr( $header_textcolor ); ?>"<?php echo $default_color; ?> />
</ins><span class="cx">         </p>
</span><del>-        <div id="color-picker" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
</del><span class="cx"> </td>
</span><span class="cx"> </tr>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminjscolorpickerjs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/color-picker.js (0 => 22030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/color-picker.js         (rev 0)
+++ trunk/wp-admin/js/color-picker.js        2012-09-27 01:57:38 UTC (rev 22030)
</span><span class="lines">@@ -0,0 +1,119 @@
</span><ins>+( function( $, undef ){
+
+        // html stuff
+        var _before = '<a tabindex="0" class="wp-color-result" />';
+        var _after = '<div class="wp-picker-holder" />';
+        var _wrap = '<div class="wp-picker-container" />';
+        var _button = '<input type="button" class="button button-tiny hidden" />';
+
+        // jQuery UI Widget constructor
+        var ColorPicker = {
+                options: {
+                        defaultColor: false,
+                        change: false,
+                        clear: false,
+                        hide: true
+                },
+                _create: function() {
+                        // bail early for IE < 8
+                        if ( $.browser.msie && parseInt( $.browser.version, 10 ) < 8 )
+                                return;
+                        var self = this;
+                        var el = self.element;
+                        $.extend( self.options, el.data() );
+
+                        self.initialValue = el.val();
+
+                        // Set up HTML structure, hide things
+                        el.addClass( 'wp-color-picker' ).hide().wrap( _wrap );
+                        self.wrap = el.parent();
+                        self.toggler = $( _before ).insertBefore( el ).css( { backgroundColor: self.initialValue } ).attr( "title", wpColorPickerL10n.pick ).attr( "data-current", wpColorPickerL10n.current );
+                        self.pickerContainer = $( _after ).insertAfter( el );
+                        self.button = $( _button );
+
+                        if ( self.options.defaultColor )
+                                self.button.addClass( 'wp-picker-default' ).val( wpColorPickerL10n.defaultString );
+                        else
+                                self.button.addClass( 'wp-picker-clear' ).val( wpColorPickerL10n.clear );
+
+                        self.button.insertAfter( el );
+
+                        el.iris( {
+                                target: self.pickerContainer,
+                                hide: true,
+                                change: function( event, ui ) {
+                                        self.toggler.css( { backgroundColor: ui.color.toString() } );
+                                        // check for a custom cb
+                                        if ( $.isFunction( self.options.change ) )
+                                                self.options.change.call( this, event, ui );
+                                }
+                        } );
+                        el.val( self.initialValue );
+                        self._addListeners();
+                        if ( ! self.options.hide )
+                                self.toggler.click();
+                },
+                _addListeners: function() {
+                        var self = this;
+
+                        self.toggler.click( function( event ){
+                                event.stopPropagation();
+                                self.element.toggle().iris( 'toggle' );
+                                self.button.toggleClass('hidden');
+                                self.toggler.toggleClass( 'wp-picker-open' );
+
+                                // close picker when you click outside it
+                                if ( self.toggler.hasClass( 'wp-picker-open' ) )
+                                        $( "body" ).on( 'click', { wrap: self.wrap, toggler: self.toggler }, self._bodyListener );
+                                else
+                                        $( "body" ).off( 'click', self._bodyListener );
+                        });
+
+                        self.element.change(function( event ) {
+                                var me = $(this),
+                                        val = me.val();
+                                // Empty = clear
+                                if ( val === '' || val === '#' ) {
+                                        self.toggler.css('backgroundColor', '');
+                                        // fire clear callback if we have one
+                                        if ( $.isFunction( self.options.clear ) )
+                                                self.options.clear.call( this, event );
+                                }
+                        });
+
+                        // open a keyboard-focused closed picker with space or enter
+                        $( document ).keydown( function( e ) {
+                                if ( self.toggler.is( ':focus' ) && ( e.keyCode === 13 || e.keyCode === 32 ) ) {
+                                        e.preventDefault();
+                                        self.toggler.trigger('click').next().focus();
+                                }
+                        });
+
+                        self.button.click( function( event ) {
+                                var me = $(this);
+                                if ( me.hasClass( 'wp-picker-clear' ) ) {
+                                        self.element.val( '' );
+                                        self.toggler.css('backgroundColor', '');
+                                        if ( $.isFunction( self.options.clear ) )
+                                                self.options.clear.call( this, event );
+                                } else if ( me.hasClass( 'wp-picker-default' ) ) {
+                                        self.element.val( self.options.defaultColor ).change();
+                                }
+                        });
+                },
+                _bodyListener: function( event ) {
+                        if ( ! event.data.wrap.find( event.target ).length )
+                                        event.data.toggler.click();
+                },
+                // $("#input").wpColorPicker('color') returns the current color
+                // $("#input").wpColorPicker('color', '#bada55') to set
+                color: function( newColor ) {
+                        if ( newColor === undef )
+                                return this.element.iris( "option", "color" );
+
+                        this.element.iris( "option", "color", newColor );
+                }
+        }
+
+        $.widget( 'wp.wpColorPicker', ColorPicker );
+}( jQuery ) );
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjscustombackgroundjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/custom-background.js (22029 => 22030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-background.js        2012-09-27 01:11:04 UTC (rev 22029)
+++ trunk/wp-admin/js/custom-background.js        2012-09-27 01:57:38 UTC (rev 22030)
</span><span class="lines">@@ -1,66 +1,24 @@
</span><del>-var farbtastic, pickColor;
-
</del><span class="cx"> (function($) {
</span><span class="cx">
</span><del>-        var defaultColor = '';
-
-        pickColor = function(color) {
-                farbtastic.setColor(color);
-                $('#background-color').val(color);
-                $('#custom-background-image').css('background-color', color);
-                // If we have a default color, and they match, then we need to hide the 'Default' link.
-                // Otherwise, we hide the 'Clear' link when it is empty.
-                if ( ( defaultColor && color === defaultColor ) || ( ! defaultColor && ( '' === color || '#' === color ) ) )
-                        $('#clearcolor').hide();
-                else
-                        $('#clearcolor').show();
-        }
-
</del><span class="cx">         $(document).ready(function() {
</span><ins>+                var bgImage = $("#custom-background-image");
</ins><span class="cx">
</span><del>-                defaultColor = $('#defaultcolor').val();
-
-                $('#pickcolor').click(function() {
-                        $('#colorPickerDiv').show();
-                        return false;
</del><ins>+                $('#background-color').wpColorPicker({
+                        change: function( event, ui ) {
+                                bgImage.css('background-color', ui.color.toString());
+                        },
+                        clear: function() {
+                                bgImage.css('background-color', '');
+                        }
</ins><span class="cx">                 });
</span><span class="cx">
</span><del>-                $('#clearcolor a').click( function(e) {
-                        pickColor( defaultColor );
-                        e.preventDefault();
-                });
-
-                $('#background-color').keyup(function() {
-                        var _hex = $('#background-color').val(), hex = _hex;
-                        if ( hex.charAt(0) != '#' )
-                                hex = '#' + hex;
-                        hex = hex.replace(/[^#a-fA-F0-9]+/, '');
-                        if ( hex != _hex )
-                                $('#background-color').val(hex);
-                        if ( hex.length == 4 || hex.length == 7 )
-                                pickColor( hex );
-                });
-
</del><span class="cx">                 $('input[name="background-position-x"]').change(function() {
</span><del>-                        $('#custom-background-image').css('background-position', $(this).val() + ' top');
</del><ins>+                        bgImage.css('background-position', $(this).val() + ' top');
</ins><span class="cx">                 });
</span><span class="cx">
</span><span class="cx">                 $('input[name="background-repeat"]').change(function() {
</span><del>-                        $('#custom-background-image').css('background-repeat', $(this).val());
</del><ins>+                        bgImage.css('background-repeat', $(this).val());
</ins><span class="cx">                 });
</span><del>-
-                farbtastic = $.farbtastic('#colorPickerDiv', function(color) {
-                        pickColor(color);
-                });
-                pickColor($('#background-color').val());
-
-                $(document).mousedown(function(){
-                        $('#colorPickerDiv').each(function(){
-                                var display = $(this).css('display');
-                                if ( display == 'block' )
-                                        $(this).fadeOut(2);
-                        });
-                });
</del><span class="cx">         });
</span><span class="cx">
</span><span class="cx"> })(jQuery);
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjscustomizecontrolsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/customize-controls.js (22029 => 22030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/customize-controls.js        2012-09-27 01:11:04 UTC (rev 22029)
+++ trunk/wp-admin/js/customize-controls.js        2012-09-27 01:57:38 UTC (rev 22030)
</span><span class="lines">@@ -109,27 +109,16 @@
</span><span class="cx">         api.ColorControl = api.Control.extend({
</span><span class="cx">                 ready: function() {
</span><span class="cx">                         var control = this,
</span><del>-                                rhex, spot, input, text, update;
</del><ins>+                                picker = this.container.find('.color-picker-hex');
</ins><span class="cx">
</span><del>-                        rhex = /^#([A-Fa-f0-9]{3}){0,2}$/;
-                        spot = this.container.find('.dropdown-content');
-                        input = new api.Element( this.container.find('.color-picker-hex') );
-                        update = function( color ) {
-                                spot.css( 'background', color );
-                                control.farbtastic.setColor( color );
-                        };
-
-                        this.farbtastic = $.farbtastic( this.container.find('.farbtastic-placeholder'), control.setting.set );
-
-                        // Only pass through values that are valid hexes/empty.
-                        input.sync( this.setting ).validate = function( to ) {
-                                return rhex.test( to ) ? to : null;
-                        };
-
-                        this.setting.bind( update );
-                        update( this.setting() );
-
-                        this.dropdownInit();
</del><ins>+                        picker.val( control.setting() ).wpColorPicker({
+                                change: function( event, options ) {
+                                        control.setting.set( picker.wpColorPicker('color') );
+                                 },
+                                 clear: function() {
+                                         control.setting.set( false );
+                                 }
+                        });
</ins><span class="cx">                 }
</span><span class="cx">         });
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminjsirisminjs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/iris.min.js (0 => 22030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/iris.min.js         (rev 0)
+++ trunk/wp-admin/js/iris.min.js        2012-09-27 01:57:38 UTC (rev 22030)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+/*! Iris - v0.9.5 - 2012-09-19
+* https://github.com/Automattic/Iris
+* Copyright (c) 2012 Matt Wiebe; Licensed GPL */
+(function(a,b){function h(){if(d)e="filter";else{var b=a('<div id="iris-gradtest" />'),c="linear-gradient(top,#fff,#000)";a.each(f,function(a,d){b.css("backgroundImage",d+c);if(b.css("backgroundImage").match("gradient"))return e=a,!1}),a.browser.webkit&&e===!1&&(b.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),b.css("backgroundImage").match("gradient")&&(e="webkit")),b.remove()}}function i(b,c){return b=b==="top"?"top":"left",c=a.isArray(c)?c:Array.prototype.slice.call(arguments,1),e==="webkit"?k(b,c):f[e]+"linear-gradient("+b+", "+c.join(", ")+")"}function j(b,c){b=b==="top"?"top":"left",c=a.isArray(c)?c:Array.prototype.slice.call(arguments,1);var d=b==="top"?0:1,e=a(this),f=c.length-1,g
=parseInt(a.browser.version,10)>=8?"-ms-filter":"filter";g="filter";var h=d===1?"left":"top",i=d===1?"right":"bottom",j=d===1?"height":"width",k='<div class="iris-ie-gradient-shim" style="position:absolute;'+j+":100%;"+h+":%start%;"+i+":%end%;"+g+':%filter%;" data-color:"%color%"></div>',m="";e.css("position")==="static"&&e.css({position:"relative"}),c=l(c),a.each(c,function(a,b){if(a===f)return!1;var e=c[a+1];if(b.stop===e.stop)return;var g=100-parseFloat(e.stop)+"%";b.octoHex=(new Color(b.color)).toIEOctoHex(),e.octoHex=(new Color(e.color)).toIEOctoHex();var h="progid:DXImageTransform.Microsoft.Gradient(GradientType="+d+", StartColorStr='"+b.octoHex+"', EndColorStr='"+e.octoHex+"')";m+=k.replace("%start%"
,b.stop).replace("%end%",g).replace("%filter%",h)}),e.find(".iris-ie-gradient-shim").remove(),a(m).prependTo(e)}function k(b,c){var d=[];return b=b==="top"?"0% 0%,0% 100%,":"0% 100%,100% 100%,",c=l(c),a.each(c,function(a,b){d.push("color-stop("+parseFloat(b.stop)/100+", "+b.color+")")}),"-webkit-gradient(linear,"+b+d.join(",")+")"}function l(b){var c=[],d=[],e=[],f=b.length-1;return a.each(b,function(a,b){var e=b,f=!1,g=b.match(/1?[0-9]{1,2}%$/);g&&(e=b.replace(/\s?1?[0-9]{1,2}%$/,""),f=g.shift()),c.push(e),d.push(f)}),d[0]===!1&&(d[0]="0%"),d[f]===!1&&(d[f]="100%"),d=m(d),a.each(d,function(a){e[a]={color:c[a],stop:d[a]}}),e}function m(b){var c=0,d=b.length-1,e=0,f=!1,g,h,i,j;if(b.length<=2||a.inArray(!1,b)<0)return b;while(e<b.length-1)!f&&b[e]===!1?(c=e-1,f=!0):f&&b[e]!==!1&
;&(d=e,e=b.length),e++;h=d-c,j=parseInt(b[c].replace("%"),10),g=(parseFloat(b[d].replace("%"))-j)/h,e=c+1,i=1;while(e<d)b[e]=j+i*g+"%",i++,e++;return m(b)}var c='<div class="iris-picker"><div class="iris-picker-inner"><div class="iris-square"><a class="iris-square-value" href="#"><span class="iris-square-handle ui-slider-handle"></span></a><div class="iris-square-slider iris-square-horiz"></div><div class="iris-square-slider iris-square-vert"></div></div><div class="iris-slider iris-hue"><div class="iris-slider-offset"></div></div></div></div>',d=!!(a.browser.msie&&parseInt(a.browser.version,10)<10),e=!1,f=["-moz-","-webkit-","-o-","-ms-"],g='.iris-picker{display:block;position:relati
ve}.iris-error{background-color:#ffafaf}.iris-border{border-radius:3px;border:1px solid #aaa;width:200px;background-color:#fff}.iris-picker-inner{position:absolute;top:0;right:0;left:0;bottom:0}.iris-border .iris-picker-inner{top:10px;right:10px;left:10px;bottom:10px}.iris-picker .iris-square,.iris-picker .iris-slider,.iris-picker .grad-box{border-radius:3px;-webkit-box-shadow:inset 0 0 5px rgba(0,0,0,0.4);-moz-box-shadow:inset 0 0 5px rgba(0,0,0,0.4);box-shadow:inset 0 0 5px rgba(0,0,0,0.4);height:100%;width:12.5%;float:left;margin-right:5%}.iris-picker .iris-square{width:76%;margin-right:10%}.iris-picker .grad-box{width:auto;margin:0}.iris-picker .iris-square .sat,.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .grad-box{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;border-radius:0}.iris-picker .iris-square .sat{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.iris-ie-lt9 .iris-square,.iris-ie-lt9 .iris-slider,.iris-ie-lt9 .grad
-box{outline:1px solid #aaa}.iris-ie-lt9 .iris-square .ui-slider-handle{outline:1px solid #aaa;background-color:#fff;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"}.iris-ie-lt9 .iris-square .iris-square-handle{background:none;border:3px solid #fff;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"}.iris-picker .iris-hue{margin-right:0}.iris-picker .iris-tooltip{position:absolute;z-index:10;font:10px/1 sans-serif;color:#222;background:#fff;border:1px solid #666;padding:3px 6px;border-radius:3px;opacity:.94;white-space:nowrap;top:-36px;left:-12px}.iris-picker .iris-tooltip:before,.iris-picker .iris-tooltip:after{content:" ";width:0;height:0;border-style:solid;border-width:6px 6px 0 6px;border-color:#666 transparent transparent transparent;position:absolute;bottom:-6px;left:6px}.iris-picker .iris-tooltip:after{bottom:-5px;border-top-color:#fff}.iris-picker .iris-hue .ui-slider-handle{position:absolute;width:100%;heig
ht:12px;background:none;border-radius:0;box-shadow:none;opacity:1;z-index:5}.iris-hue .ui-slider-handle:before,.iris-hue .ui-slider-handle:after{content:" ";width:0;height:0;border-style:solid;border-width:6px 7px 6px 0;border-color:transparent #555 transparent transparent;position:absolute;right:-4px}.iris-hue .ui-slider-handle:after{border-width:6px 0 6px 7px;border-color:transparent transparent transparent #555;right:auto;left:-4px}.iris-picker .iris-slider-offset{width:100%;height:100%;position:relative;bottom:-6px}.iris-square .iris-square-horiz{position:absolute;top:-7px;left:-7px;height:1px;width:100%}.iris-square .iris-square-vert{position:absolute;right:6px;top:7px;width:1px;height:100%}.iris-square .iris-square-slider a{opacity:.3;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";-moz-transition:opacity 300ms;-webkit-transition:opacity 300ms;transition:opacity 300ms}.iris-square .iris-square-slider .ui-slider-handle.active{opacity
:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"}.iris-dragging .iris-square-slider .ui-slider-handle.active{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"}.iris-picker .ui-slider-handle{background:#f5f5f5;-webkit-border-radius:10px;-moz-border-radius:50%;border-radius:50%;box-shadow:inset #fff 0 1px 1px,inset 0 -1px 1px rgba( 0,0,0,0.4 ),0px 1px 4px 0 rgba( 0,0,0,0.2 ),0 0 2px rgba( 0,0,0,0.3 );display:block;opacity:0.7;position:absolute;z-index:5;height:20px;width:20px;cursor:default;cursor:ns-resize;z-index:5}.iris-square-horiz .ui-slider-handle{cursor:ew-resize}.iris-square-slider .ui-slider-handle{width:14px;height:14px;opacity:1;background-color:#eee}.iris-picker .iris-square-handle{background:transparent;border:5px solid #aaa;border-color:rgba(128,128,128,.5);box-shadow:none;width:12px;height:12px;position:absolute;left:-10px;top:-10px;cursor:move;opacity:1;z-index:10}.iris-picker .ui-state-focus .iris
-square-handle{opacity:.8}.iris-picker .iris-square-handle:hover{border-color:#999}.iris-picker .iris-square-handle:hover::after{border-color:#fff}.iris-picker .iris-square-handle::after{position:absolute;bottom:-4px;right:-4px;left:-4px;top:-4px;border:3px solid #f9f9f9;border-color:rgba(255,255,255,.8);border-radius:50%;content:" "}.iris-picker .iris-square-value{width:8px;height:8px;position:absolute}.iris-ie-lt9 .iris-square-value,.iris-mozilla .iris-square-value{width:1px;height:1px}';if(d&&parseInt(a.browser.version,10)<=7)return a.fn.iris=a.noop;a.fn.gradient=function(b){var c=arguments;return this.each(function(){d?j.apply(this,c):a(this).css("backgroundImage",i.apply(this,c))})},a.fn.LSSquare=function(c){return c=c|0,this.each(function(){var d=a(this),e=d.data("hue")!==b;e||(d.append('<div class="sat grad-box" /><div class="lum grad-box" />'),d.css("position","relative"),d.c
hildren(".grad-box").css({position:"absolute",top:0,left:0,bottom:0,right:0}));var f=d.find(".lum"),g=d.find(".sat");e||f.gradient("top","#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"),g.gradient("left","hsl("+c+",0%,50%)","hsl("+c+",100%,50%)"),d.data("hue",c)})},a.fn.raninbowGradient=function(b,c){b=b||"top";var d=a.extend({},{s:100,l:50},c),e="hsl(%h%,"+d.s+"%,"+d.l+"%)",f=0,g=[];while(f<=360)g.push(e.replace("%h%",f)),f+=30;return this.each(function(){a(this).gradient(b,g)})};var n={options:{color:!1,hide:!0,border:!0,target:!1,width:200,tooltip:!1},_inited:!1,_create:function(){var b=this.element,d=this.options.color||b.val();e===!1&&h(),b.is("input")?(this.options.target?this.picker=a(c).appendTo(this.options.target):this.picker=a
(c).insertAfter(b),this._addInputListeners(b)):(b.append(c),this.picker=b.find(".iris-picker"));if(a.browser.mozilla)this.picker.addClass("iris-mozilla");else if(a.browser.msie){var f=parseInt(a.browser.version,10);f===9?this.picker.addClass("iris-ie-9"):f<=8&&this.picker.addClass("iris-ie-lt9")}this.color=new Color(d),this.initError=this.color.error,this.options.color=this.color.toString(),this.controls={},this.controls.square=this.picker.find(".iris-square");var g=this.hue=this.color.h();this.options.hide&&this.picker.hide(),this.options.border&&this.picker.addClass("iris-border"),this.controls.square.LSSquare(g),this.picker.find(".iris-hue").raninbowGradient(),this.initError&&this.color.s(50).l(50),this._initControls(),this.active="external",this._dimensions(),this._change(),this.options.tooltip&&this._addTooltip()},_dimensions:function(a){var b=this.
picker.find(".iris-picker-inner"),c=this.controls,d=c.square,e=this.picker.find(".iris-hue"),f="77.5%",g="12%",h=20,i=this.options.border?this.options.width-h:this.options.width,j;a&&(d.css("width",""),e.css("width",""),this.picker.removeAttr("style")),f=i*(parseFloat(f)/100),g=i*(parseFloat(g)/100),j=this.options.border?f+h:f,d.width(f).height(f),e.height(f).width(g),this.picker.css({width:this.options.width,height:j})},_addInputListeners:function(a){var b=this;a.on("change",function(c){var d=new Color(a.val()),e=a.val().replace(/^#/,"");a.removeClass("iris-error"),d.error?e!==""&&a.addClass("iris-error"):b._setOption("color",d.toString())})},_initControls:function(){var b=this,c=b.controls.square,d=b.color.h();b.controls.h=b.picker.find(".iris-hue .iris-slider-offset").slider({orientation:"verti
cal",max:359,min:0,value:359-d,slide:function(a,c){b.active="h",c.value=359-c.value,b.color.h(c.value),b._change.apply(b,arguments)}}),b.controls.squareDrag=b.picker.find(".iris-square-value").draggable({containment:"parent",zIndex:1e3,cursor:"move",drag:function(a,c){b._squareDrag(a,c)},start:function(){c.addClass("iris-dragging"),a(this).addClass("ui-state-focus")},stop:function(){c.removeClass("iris-dragging"),a(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(c){c.preventDefault();var d="ui-state-focus";c.type==="mousedown"?(b.picker.find("."+d).removeClass(d).blur(),a(this).addClass(d)):a(this).removeClass("ui-state-focus")}),c.mousedown(function(c){if(c.which!==1)return;if(!a(c.target).is("div"))return;var d=b.controls.square.offset(),e={top:c.pageY-d.top,left:c.pageX-d.left};c.preventDefault(),b._squareD
rag(c,{position:e}),c.target=b.controls.squareDrag.get(0),b.controls.squareDrag.css(e).trigger(c)}),b.controls.s=c.find(".iris-square-horiz").slider({slide:function(a,c){b.color.s(c.value),b.active="s",b._change.apply(b,arguments)}}),b.controls.l=c.find(".iris-square-vert").slider({orientation:"vertical",slide:function(a,c){b.color.l(c.value),b.active="l",b._change.apply(b,arguments)}}),b.controls.square.mousemove(function(c){var d=a(this),e=d.offset(),f=c.pageX-e.left,g=c.pageY-e.top,h=d.find(".iris-square-horiz .ui-slider-handle"),i=d.find(".iris-square-vert .ui-slider-handle");f>b.controls.square.width()-20?i.addClass("active"):i.removeClass("active"),g<20?h.addClass("active"):h.removeClass("active")}),b.controls.square.mouseleave(function(){a(this).find(".iris-square-slider .ui-slider-handle").removeClass("active")})},_squareDrag:functio
n(a,b){var c=this,d=c._squareDimensions(),e=Math.round((d.h-b.position.top)/d.h*100),f=100-Math.round((d.w-b.position.left)/d.w*100);c.color.s(f).l(e),c.active="square",c._change.apply(c,arguments)},_setOption:function(a,b){var c=this.options[a];if(a==="color"){b=""+b;var d=b.replace(/^#/,""),e=new Color(b);e.error||(this.color=e,this.options.color=this.color.toString(),this.active="external",this._change(),this.options[a]=this.color.toString())}},_squareDimensions:function(a){var c=this.controls.square,d,e;return a!==b&&c.data("dimensions")?c.data("dimensions"):(e=this.controls.squareDrag,d={w:c.width(),h:c.height()},c.data("dimensions",d),d)},_change:function(b,c){var d=this,e=d.controls,f=d.color.toHsl(),g=d.color.toString(),h=["s","l","square"];d.active==="external"||d.active==="h"?(e.square.LSSquare(f.h),d.active==="h"?h=[]:
h.push("h"),this.hue=f.h):f.h!==this.hue&&(f.h=this.hue,d.color.h(this.hue)),g=d.color.toString(),a.each(h,function(a,b){if(b!==d.active)switch(b){case"h":e.h.slider("value",359-f.h);break;case"s":d.active!=="l"&&e.s.slider("value",f.s);break;case"l":d.active!=="s"&&e.l.slider("value",f.l);break;case"square":var c=d._squareDimensions(),g={left:f.s/100*c.w,top:c.h-f.l/100*c.h};d.active==="s"?delete g.top:d.active==="l"&&delete g.left,d.controls.squareDrag.css(g)}}),this.options.color=this.color.toString(),this._inited?this._trigger("change",{type:this.active},{color:this.color}):this.initError&&(this.color.error=!0,this.options.color=this.color.toString()),this.element.is(":input")&&!d.color.error&&this.element.val(g).removeClass("iris-error"),this._inited=!0,this.active=!1
},_addTooltip:function(){var b=this;a("<span class='iris-tooltip' />").text(b.options.tooltip).appendTo(b.controls.squareDrag),b.controls.square.on("mousedown.iris",b,function(a){a.which===1&&b.controls.square.off("mousedown.iris").find(".iris-tooltip").remove()})},show:function(){this.picker.show()},hide:function(){this.picker.hide()},toggle:function(){this.picker.toggle()}};a.widget("a8c.iris",n),a('<style id="iris-css">'+g+"</style>").appendTo("head")})(jQuery),function(a,b){var c=function(a,b){return this instanceof c?this._init(a,b):new c(a,b)};c.prototype={_color:0,_alpha:1,error:!1,__hsl:{h:0,s:0,l:0},_init:function(a){var c="noop";switch(typeof a){case"object":return this._alpha=a.a||1,c=a.r!==b?"fromRgb":a.l!==b?"fromHsl":c,this[c](a);case"string":return this.fromCSS(a);case"number":return this.fromInt(
parseInt(a,10))}return this},noop:function(){return this},fromCSS:function(a){var b,c;return this.error=!1,a.match(/^(rgb|hsl)a?/)?(c=a.replace(/(\s|%)/g,"").replace(/^(rgb|hsl)a?\(/,"").replace(/\);?$/,"").split(","),c.length===4&&(this._alpha=parseFloat(c.pop())),a.match(/^rgb/)?this.fromRgb({r:parseInt(c[0],10),g:parseInt(c[1],10),b:parseInt(c[2],10)}):this.fromHsl({h:parseInt(c[0],10),s:parseInt(c[1],10),l:parseInt(c[2],10)})):this.fromHex(a)},fromRgb:function(a,c){return typeof a!="object"||a.r===b||a.g===b||a.b===b?(this.error=!0,this):(this.error=!1,this.fromInt(parseInt((a.r<<16)+(a.g<<8)+a.b,10),c))},fromHex:function(a){return a=a.replace(/^#/,"").replace(/^0x/,""),a.length===3&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),this.error=!/^[0-9A-F]{6}$/i.test(a),this.fromInt(parseInt(a,16))},fromHsl:function(a){if(typeof a!="object"||a.h===b||a.s===b||a.l===b)return this.er
ror=!0,this;var c,d,e,f,g,h,i,j;return this.__hsl=a,h=a.h/360,i=a.s/100,j=a.l/100,i===0?c=d=e=j:(f=j<.5?j*(1+i):j+i-j*i,g=2*j-f,c=this.hue2rgb(g,f,h+1/3),d=this.hue2rgb(g,f,h),e=this.hue2rgb(g,f,h-1/3)),this.fromRgb({r:c*255,g:d*255,b:e*255},!0)},fromInt:function(a,c){return this._color=parseInt(a,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),c===b&&(this.__hsl.h=this.__hsl.s=0),this},hue2rgb:function(a,b,c){return c<0&&(c+=1),c>1&&(c-=1),c<1/6?a+(b-a)*6*c:c<.5?b:c<2/3?a+(b-a)*(2/3-c)*6:a},toString:function(){var a=parseInt(this._color,10).toString(16);if(this.error)return"";if(a.length<6)for(var b=6-a.length-1;b>=0;b--)a="0"+a;return"#"+a},toCSS:function(a,b){a=a||"hex",b=parseFloat(b||this._alpha);switch(a){case"rgb":case"rgba":var c=this.toRgb();return b<1?"rgba( "+
c.r+", "+c.g+", "+c.b+", "+b+" )":"rgb( "+c.r+", "+c.g+", "+c.b+" )";case"hsl":case"hsla":var d=this.toHsl();return b<1?"hsla( "+d.h+", "+d.s+", "+d.l+", "+b+" )":"hsl( "+d.h+", "+d.s+", "+d.l+" )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var a=this.toRgb(),b=a.r/255,c=a.g/255,d=a.b/255,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h,i=(e+f)/2;if(e===f)g=h=0;else{var j=e-f;h=i>.5?j/(2-e-f):j/(e+f);switch(e){case b:g=(c-d)/j+(c<d?6:0);break;case c:g=(d-b)/j+2;break;case d:g=(b-c)/j+4}g/=6}return g=Math.round(g*360),g===0&&this.__hsl.h!==g&&(g=this.__hsl.h),h=Math.round(h*100),h===0&&this.__hsl.s&&(h=this.__hsl.s),{h:g,s:h,l:Math.round(i*10
0)}},toInt:function(){return this._color},toIEOctoHex:function(){var a=this.toString(),b=parseInt(255*this._alpha,10).toString(16);return b.length===1&&(b="0"+b),"#"+b+a.replace(/^#/,"")},toLuminosity:function(){var a=this.toRgb();return.2126*Math.pow(a.r/255,2.2)+.7152*Math.pow(a.g/255,2.2)+.0722*Math.pow(a.b/255,2.2)},getDistanceLuminosityFrom:function(a){if(a instanceof c){var b=this.toLuminosity(),d=a.toLuminosity();return b>d?(b+.05)/(d+.05):(d+.05)/(b+.05)}throw"getDistanceLuminosityFrom requires a Color object"},getMaxContrastColor:function(){var a=this.toLuminosity(),b=a>=.5?"000000":"ffffff";return new c(b)},getGrayscaleContrastingColor:function(a){if(!a)return this.getMaxContrastColor();var b=a<5?5:a,c=this.getMaxContrastColor();a=c.getDistanceLuminosityFrom(this);if(a<=b)return c;var d=0===c.toInt()?1:-1;while(a>b)c=c.incrementLightness(d),a=c.getDistanceLuminosityFrom(this);return
c},getReadableContrastingColor:function(a,d){if(!a instanceof c)return this;var e=d===b?5:d,f=a.getDistanceLuminosityFrom(this),g=a.getMaxContrastColor(),h=g.getDistanceLuminosityFrom(a);if(h<=e)return g;if(f>=e)return this;var i=0===g.toInt()?-1:1;while(f<e){this.incrementLightness(i),f=this.getDistanceLuminosityFrom(a);if(this._color===0||this._color===16777215)break}return this},h:function(a){return this._hsl("h",a)},s:function(a){return this._hsl("s",a)},l:function(a){return this._hsl("l",a)},_hsl:function(a,c){var d=this.toHsl();return c===b?d[a]:(a==="h"?d[a]=c%360:d[a]=c<0?0:c>100?100:c,this.fromHsl(d))},darken:function(a){return a=a||5,this.incrementLightness(-a)},lighten:function(a){return a=a||5,this.incrementLightness(a)},incrementLightness:function(a){return this.l(this.l()+a)},saturate:function(a){return a=a||15,this.incrementSaturation(a)},desaturate:function(a){return a=a||15,this.incrementSaturation(-a)},
incrementSaturation:function(a){return this.s(this.s()+a)},toGrayscale:function(){return this.h(0)},getComplement:function(){return this.incrementHue(180)},getSplitComplement:function(a){a=a||1;var b=180+a*30;return this.incrementHue(b)},getAnalog:function(a){a=a||1;var b=a*30;return this.incrementHue(b)},getTetrad:function(a){a=a||1;var b=a*60;return this.incrementHue(b)},getTriad:function(a){a=a||1;var b=a*120;return this.incrementHue(b)},incrementHue:function(a){return this.h(this.h()+a)}},a.Color=c}(typeof exports=="object"&&exports||this);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesclasswpcustomizecontrolphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/class-wp-customize-control.php (22029 => 22030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-customize-control.php        2012-09-27 01:11:04 UTC (rev 22029)
+++ trunk/wp-includes/class-wp-customize-control.php        2012-09-27 01:57:38 UTC (rev 22030)
</span><span class="lines">@@ -351,8 +351,8 @@
</span><span class="cx">          * @since 3.4.0
</span><span class="cx">          */
</span><span class="cx">         public function enqueue() {
</span><del>-                wp_enqueue_script( 'farbtastic' );
-                wp_enqueue_style( 'farbtastic' );
</del><ins>+                wp_enqueue_script( 'wp-color-picker' );
+                wp_enqueue_style( 'wp-color-picker' );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /**
</span><span class="lines">@@ -372,19 +372,20 @@
</span><span class="cx">          * @since 3.4.0
</span><span class="cx">          */
</span><span class="cx">         public function render_content() {
</span><ins>+                $this_default = $this->setting->default;
+                $default_attr = '';
+                if ( $this_default ) {
+                        if ( false === strpos( $this_default, '#' ) )
+                                $this_default = '#' . $this_default;
+                        $default_attr = ' data-default-color="' . esc_attr( $this_default ) . '"';
+                }
+                // The input's value gets set by JS. Don't fill it.
</ins><span class="cx">                 ?>
</span><span class="cx">                 <label>
</span><span class="cx">                         <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
</span><span class="cx">                         <div class="customize-control-content">
</span><del>-                                <div class="dropdown">
-                                        <div class="dropdown-content">
-                                                <div class="dropdown-status"></div>
-                                        </div>
-                                        <div class="dropdown-arrow"></div>
-                                </div>
-                                <input class="color-picker-hex" type="text" maxlength="7" placeholder="<?php esc_attr_e('Hex Value'); ?>" />
</del><ins>+                                <input class="color-picker-hex" type="text" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value' ); ?>"<?php echo $default_attr ?> />
</ins><span class="cx">                         </div>
</span><del>-                        <div class="farbtastic-placeholder"></div>
</del><span class="cx">                 </label>
</span><span class="cx">                 <?php
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (22029 => 22030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2012-09-27 01:11:04 UTC (rev 22029)
+++ trunk/wp-includes/script-loader.php        2012-09-27 01:57:38 UTC (rev 22030)
</span><span class="lines">@@ -422,6 +422,15 @@
</span><span class="cx">
</span><span class="cx">                 $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' );
</span><span class="cx">
</span><ins>+                $scripts->add( 'iris', '/wp-admin/js/iris.min.js', array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
+                $scripts->add( 'wp-color-picker', "/wp-admin/js/color-picker$suffix.js", array( 'iris' ), false, 1 );
+                did_action( 'init' ) && $scripts->localize( 'wp-color-picker', 'wpColorPickerL10n', array(
+                        'clear' => __( 'Clear' ),
+                        'defaultString' => __( 'Default' ),
+                        'pick' => __( 'Select Color' ),
+                        'current' => __( 'Current Color' ),
+                ) );
+
</ins><span class="cx">                 $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), false, 1 );
</span><span class="cx">
</span><span class="cx">                 $scripts->add( 'list-revisions', "/wp-includes/js/wp-list-revisions$suffix.js" );
</span><span class="lines">@@ -449,7 +458,7 @@
</span><span class="cx">                         'saveAlert' => __('The changes you made will be lost if you navigate away from this page.')
</span><span class="cx">                 ) );
</span><span class="cx">
</span><del>-                $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array('farbtastic'), false, 1 );
</del><ins>+                $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array( 'wp-color-picker' ), false, 1 );
</ins><span class="cx">                 $scripts->add( 'media-gallery', "/wp-admin/js/media-gallery$suffix.js", array('jquery'), false, 1 );
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -502,6 +511,7 @@
</span><span class="cx">         $styles->add( 'install', "/wp-admin/css/install$suffix.css" );
</span><span class="cx">         $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css' );
</span><span class="cx">         $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u1' );
</span><ins>+        $styles->add( 'wp-color-picker', "/wp-admin/css/color-picker$suffix.css" );
</ins><span class="cx">         $styles->add( 'jcrop', "/wp-includes/js/jcrop/jquery.Jcrop.min.css", array(), '0.9.10' );
</span><span class="cx">         $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8' );
</span><span class="cx">         $styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css" );
</span></span></pre>
</div>
</div>
</body>
</html>