<!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>[30893] trunk/src/wp-content/themes/twentyfifteen: Twenty Fifteen: Don't save unfiltered CSS in a setting.</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" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/30893">30893</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/30893","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>ocean90</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2014-12-16 12:26:49 +0000 (Tue, 16 Dec 2014)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Twenty Fifteen: Don't save unfiltered CSS in a setting.
Introduce `twentyfifteen_get_color_scheme_css( $colors )` which will be used for Underscore/Backbone and the PHP side. Let `twentyfifteen_color_scheme_css()` handle the color calculation on PHP side.
see <a href="https://core.trac.wordpress.org/ticket/30409">#30409</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpcontentthemestwentyfifteeninccustomizerphp">trunk/src/wp-content/themes/twentyfifteen/inc/customizer.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfifteenjscolorschemecontroljs">trunk/src/wp-content/themes/twentyfifteen/js/color-scheme-control.js</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfifteenjscustomizepreviewjs">trunk/src/wp-content/themes/twentyfifteen/js/customize-preview.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpcontentthemestwentyfifteeninccustomizerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyfifteen/inc/customizer.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyfifteen/inc/customizer.php 2014-12-16 12:14:27 UTC (rev 30892)
+++ trunk/src/wp-content/themes/twentyfifteen/inc/customizer.php 2014-12-16 12:26:49 UTC (rev 30893)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,11 +27,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'transport' => 'postMessage',
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $wp_customize->add_setting( 'color_scheme_css', array(
- 'default' => '',
- 'transport' => 'postMessage',
- ) );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->add_control( 'color_scheme', array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'label' => esc_html__( 'Base Color Scheme', 'twentyfifteen' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'section' => 'colors',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,13 +226,34 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function twentyfifteen_color_scheme_css() {
</span><span class="cx" style="display: block; padding: 0 10px"> $color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $color_scheme_css = get_theme_mod( 'color_scheme_css', '' );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Don't do anything if the default color scheme is selected.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'default' === $color_scheme_option || empty( $color_scheme_css ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'default' === $color_scheme_option ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $color_scheme = twentyfifteen_get_color_scheme();
+
+ // Convert main and sidebar text hex color to rgba.
+ $color_textcolor_rgb = twentyfifteen_hex2rgb( $color_scheme[3] );
+ $color_sidebar_textcolor_rgb = twentyfifteen_hex2rgb( $color_scheme[4] );
+ $colors = array(
+ 'background_color' => $color_scheme[0],
+ 'header_background_color' => $color_scheme[1],
+ 'box_background_color' => $color_scheme[2],
+ 'textcolor' => $color_scheme[3],
+ 'secondary_textcolor' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.7)', $color_textcolor_rgb ),
+ 'border_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.1)', $color_textcolor_rgb ),
+ 'border_focus_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.3)', $color_textcolor_rgb ),
+ 'sidebar_textcolor' => $color_scheme[4],
+ 'sidebar_border_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.1)', $color_sidebar_textcolor_rgb ),
+ 'sidebar_border_focus_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.3)', $color_sidebar_textcolor_rgb ),
+ 'secondary_sidebar_textcolor' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.7)', $color_sidebar_textcolor_rgb ),
+ 'meta_box_background_color' => $color_scheme[5],
+ );
+
+ $color_scheme_css = twentyfifteen_get_color_scheme_css( $colors );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_add_inline_style( 'twentyfifteen-style', $color_scheme_css );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'wp_enqueue_scripts', 'twentyfifteen_color_scheme_css' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -250,7 +266,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Twenty Fifteen 1.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function twentyfifteen_customize_control_js() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20141216', true );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_localize_script( 'color-scheme-control', 'colorScheme', twentyfifteen_get_color_schemes() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'customize_controls_enqueue_scripts', 'twentyfifteen_customize_control_js' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -261,32 +277,46 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Twenty Fifteen 1.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function twentyfifteen_customize_preview_js() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_enqueue_script( 'twentyfifteen-customize-preview', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '20141029', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_enqueue_script( 'twentyfifteen-customize-preview', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '20141216', true );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'customize_preview_init', 'twentyfifteen_customize_preview_js' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Output an Underscore template for generating CSS for the color scheme.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Returns CSS for the color schemes.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The template generates the css dynamically for instant display in the Customizer
- * preview, and to be saved in a `theme_mod` for display on the front-end.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since Twenty Fifteen 1.0
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since Twenty Fifteen 1.0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $colors Color scheme colors.
+ * @return string Color scheme CSS.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function twentyfifteen_color_scheme_css_template() {
- ?>
- <script type="text/html" id="tmpl-twentyfifteen-color-scheme">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function twentyfifteen_get_color_scheme_css( $colors ) {
+ $colors = wp_parse_args( $colors, array(
+ 'background_color' => '',
+ 'header_background_color' => '',
+ 'box_background_color' => '',
+ 'textcolor' => '',
+ 'secondary_textcolor' => '',
+ 'border_color' => '',
+ 'border_focus_color' => '',
+ 'sidebar_textcolor' => '',
+ 'sidebar_border_color' => '',
+ 'sidebar_border_focus_color' => '',
+ 'secondary_sidebar_textcolor' => '',
+ 'meta_box_background_color' => '',
+ ) );
+
+ $css = <<<CSS
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Color Scheme */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Background Color */
</span><span class="cx" style="display: block; padding: 0 10px"> body {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: {{ data.background_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: {$colors['background_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Sidebar Background Color */
</span><span class="cx" style="display: block; padding: 0 10px"> body:before,
</span><span class="cx" style="display: block; padding: 0 10px"> .site-header {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: {{ data.header_background_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: {$colors['header_background_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Box Background Color */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -298,7 +328,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .page-header,
</span><span class="cx" style="display: block; padding: 0 10px"> .page-content,
</span><span class="cx" style="display: block; padding: 0 10px"> .comments-area {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: {{ data.box_background_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: {$colors['box_background_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Box Background Color */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -315,7 +345,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .page-links a:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .page-links a:focus,
</span><span class="cx" style="display: block; padding: 0 10px"> .sticky-post {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: {{ data.box_background_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: {$colors['box_background_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Main Text Color */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -328,7 +358,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .widget_calendar tbody a,
</span><span class="cx" style="display: block; padding: 0 10px"> .page-links a,
</span><span class="cx" style="display: block; padding: 0 10px"> .sticky-post {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: {{ data.textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: {$colors['textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Main Text Color */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -352,7 +382,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .comment-list .reply a:focus,
</span><span class="cx" style="display: block; padding: 0 10px"> .site-info a:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .site-info a:focus {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: {{ data.textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: {$colors['textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Main Text Color */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -369,7 +399,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .pingback .edit-link a:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .comment-list .reply a:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .site-info a:hover {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-color: {{ data.textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-color: {$colors['textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Secondary Text Color */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -389,8 +419,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .widget_calendar tbody a:focus,
</span><span class="cx" style="display: block; padding: 0 10px"> .page-links a:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .page-links a:focus {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: {{ data.textcolor }}; /* Fallback for IE7 and IE8 */
- background-color: {{ data.secondary_textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
+ background-color: {$colors['secondary_textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Secondary Text Color */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -429,24 +459,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .wp-caption-text,
</span><span class="cx" style="display: block; padding: 0 10px"> .gallery-caption,
</span><span class="cx" style="display: block; padding: 0 10px"> .comment-list .reply a {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: {{ data.textcolor }}; /* Fallback for IE7 and IE8 */
- color: {{ data.secondary_textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
+ color: {$colors['secondary_textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Secondary Text Color */
</span><span class="cx" style="display: block; padding: 0 10px"> blockquote,
</span><span class="cx" style="display: block; padding: 0 10px"> .logged-in-as a:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .comment-author a:hover {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-color: {{ data.textcolor }}; /* Fallback for IE7 and IE8 */
- border-color: {{ data.secondary_textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
+ border-color: {$colors['secondary_textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Border Color */
</span><span class="cx" style="display: block; padding: 0 10px"> hr,
</span><span class="cx" style="display: block; padding: 0 10px"> .dropdown-toggle:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .dropdown-toggle:focus {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: {{ data.textcolor }}; /* Fallback for IE7 and IE8 */
- background-color: {{ data.border_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
+ background-color: {$colors['border_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Border Color */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -481,67 +511,67 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .comment-list .trackback,
</span><span class="cx" style="display: block; padding: 0 10px"> .comment-list .reply a,
</span><span class="cx" style="display: block; padding: 0 10px"> .no-comments {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-color: {{ data.textcolor }}; /* Fallback for IE7 and IE8 */
- border-color: {{ data.border_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
+ border-color: {$colors['border_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Border Focus Color */
</span><span class="cx" style="display: block; padding: 0 10px"> a:focus,
</span><span class="cx" style="display: block; padding: 0 10px"> button:focus,
</span><span class="cx" style="display: block; padding: 0 10px"> input:focus {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- outline-color: {{ data.textcolor }}; /* Fallback for IE7 and IE8 */
- outline-color: {{ data.border_focus_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ outline-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
+ outline-color: {$colors['border_focus_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> input:focus,
</span><span class="cx" style="display: block; padding: 0 10px"> textarea:focus {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-color: {{ data.textcolor }}; /* Fallback for IE7 and IE8 */
- border-color: {{ data.border_focus_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
+ border-color: {$colors['border_focus_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Sidebar Link Color */
</span><span class="cx" style="display: block; padding: 0 10px"> .secondary-toggle:before {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: {{ data.sidebar_textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: {$colors['sidebar_textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .site-title a,
</span><span class="cx" style="display: block; padding: 0 10px"> .site-description {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: {{ data.sidebar_textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: {$colors['sidebar_textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Sidebar Text Color */
</span><span class="cx" style="display: block; padding: 0 10px"> .site-title a:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .site-title a:focus {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: {{ data.secondary_sidebar_textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: {$colors['secondary_sidebar_textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Sidebar Border Color */
</span><span class="cx" style="display: block; padding: 0 10px"> .secondary-toggle {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-color: {{ data.sidebar_textcolor }}; /* Fallback for IE7 and IE8 */
- border-color: {{ data.sidebar_border_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-color: {$colors['sidebar_textcolor']}; /* Fallback for IE7 and IE8 */
+ border-color: {$colors['sidebar_border_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Sidebar Border Focus Color */
</span><span class="cx" style="display: block; padding: 0 10px"> .secondary-toggle:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .secondary-toggle:focus {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-color: {{ data.sidebar_textcolor }}; /* Fallback for IE7 and IE8 */
- border-color: {{ data.sidebar_border_focus_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-color: {$colors['sidebar_textcolor']}; /* Fallback for IE7 and IE8 */
+ border-color: {$colors['sidebar_border_focus_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .site-title a {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- outline-color: {{ data.sidebar_textcolor }}; /* Fallback for IE7 and IE8 */
- outline-color: {{ data.sidebar_border_focus_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ outline-color: {$colors['sidebar_textcolor']}; /* Fallback for IE7 and IE8 */
+ outline-color: {$colors['sidebar_border_focus_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Meta Background Color */
</span><span class="cx" style="display: block; padding: 0 10px"> .entry-footer {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: {{ data.meta_box_background_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: {$colors['meta_box_background_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> @media screen and (min-width: 38.75em) {
</span><span class="cx" style="display: block; padding: 0 10px"> /* Main Text Color */
</span><span class="cx" style="display: block; padding: 0 10px"> .page-header {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-color: {{ data.textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-color: {$colors['textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -560,7 +590,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .widget_calendar tbody a,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget_calendar tbody a:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget_calendar tbody a:focus {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: {{ data.header_background_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: {$colors['header_background_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Sidebar Link Color */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -569,7 +599,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .widget-title,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget blockquote cite,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget blockquote small {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: {{ data.sidebar_textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: {$colors['sidebar_textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .widget button,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -577,11 +607,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .widget input[type="reset"],
</span><span class="cx" style="display: block; padding: 0 10px"> .widget input[type="submit"],
</span><span class="cx" style="display: block; padding: 0 10px"> .widget_calendar tbody a {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: {{ data.sidebar_textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: {$colors['sidebar_textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .textwidget a {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-color: {{ data.sidebar_textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-color: {$colors['sidebar_textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Sidebar Text Color */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -592,7 +622,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .widget blockquote,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget .wp-caption-text,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget .gallery-caption {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: {{ data.secondary_sidebar_textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: {$colors['secondary_sidebar_textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .widget button:hover,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -605,11 +635,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .widget input[type="submit"]:focus,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget_calendar tbody a:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget_calendar tbody a:focus {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: {{ data.secondary_sidebar_textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: {$colors['secondary_sidebar_textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .widget blockquote {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-color: {{ data.secondary_sidebar_textcolor }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-color: {$colors['secondary_sidebar_textcolor']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Sidebar Border Color */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -626,25 +656,56 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .widget_nav_menu .sub-menu,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget_pages .children,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget abbr[title] {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-color: {{ data.sidebar_border_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-color: {$colors['sidebar_border_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .dropdown-toggle:hover,
</span><span class="cx" style="display: block; padding: 0 10px"> .dropdown-toggle:focus,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget hr {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: {{ data.sidebar_border_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: {$colors['sidebar_border_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .widget input:focus,
</span><span class="cx" style="display: block; padding: 0 10px"> .widget textarea:focus {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-color: {{ data.sidebar_border_focus_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-color: {$colors['sidebar_border_focus_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .sidebar a:focus,
</span><span class="cx" style="display: block; padding: 0 10px"> .dropdown-toggle:focus {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- outline-color: {{ data.sidebar_border_focus_color }};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ outline-color: {$colors['sidebar_border_focus_color']};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+CSS;
+
+ return $css;
+}
+
+/**
+ * Output an Underscore template for generating CSS for the color scheme.
+ *
+ * The template generates the css dynamically for instant display in the Customizer
+ * preview.
+ *
+ * @since Twenty Fifteen 1.0
+ */
+function twentyfifteen_color_scheme_css_template() {
+ $colors = array(
+ 'background_color' => '{{ data.background_color }}',
+ 'header_background_color' => '{{ data.header_background_color }}',
+ 'box_background_color' => '{{ data.box_background_color }}',
+ 'textcolor' => '{{ data.textcolor }}',
+ 'secondary_textcolor' => '{{ data.secondary_textcolor }}',
+ 'border_color' => '{{ data.border_color }}',
+ 'border_focus_color' => '{{ data.border_focus_color }}',
+ 'sidebar_textcolor' => '{{ data.sidebar_textcolor }}',
+ 'sidebar_border_color' => '{{ data.sidebar_border_color }}',
+ 'sidebar_border_focus_color' => '{{ data.sidebar_border_focus_color }}',
+ 'secondary_sidebar_textcolor' => '{{ data.secondary_sidebar_textcolor }}',
+ 'meta_box_background_color' => '{{ data.meta_box_background_color }}',
+ );
+ ?>
+ <script type="text/html" id="tmpl-twentyfifteen-color-scheme">
+ <?php echo twentyfifteen_get_color_scheme_css( $colors ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </script>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfifteenjscolorschemecontroljs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyfifteen/js/color-scheme-control.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyfifteen/js/color-scheme-control.js 2014-12-16 12:14:27 UTC (rev 30892)
+++ trunk/src/wp-content/themes/twentyfifteen/js/color-scheme-control.js 2014-12-16 12:26:49 UTC (rev 30893)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,8 +47,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Generate the CSS for the current Color Scheme.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function getCSS() {
- var scheme = api( 'color_scheme' )(),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function updateCSS() {
+ var scheme = api( 'color_scheme' )(), css,
</ins><span class="cx" style="display: block; padding: 0 10px"> colors = _.object( colorSchemeKeys, colorScheme[ scheme ].colors );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Merge in color scheme overrides.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,15 +64,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> colors.sidebar_border_color = Color( colors.sidebar_textcolor ).toCSS( 'rgba', 0.1 );
</span><span class="cx" style="display: block; padding: 0 10px"> colors.sidebar_border_focus_color = Color( colors.sidebar_textcolor ).toCSS( 'rgba', 0.3 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return cssTemplate( colors );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ css = cssTemplate( colors );
+
+ api.previewer.send( 'update-color-scheme-css', css );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the CSS whenever a color setting is changed.
</span><span class="cx" style="display: block; padding: 0 10px"> _.each( colorSettings, function( setting ) {
</span><span class="cx" style="display: block; padding: 0 10px"> api( setting, function( setting ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setting.bind( _.throttle( function() {
- api( 'color_scheme_css' ).set( getCSS() );
- }, 250 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ setting.bind( updateCSS );
</ins><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px"> } )( wp.customize );
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfifteenjscustomizepreviewjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyfifteen/js/customize-preview.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyfifteen/js/customize-preview.js 2014-12-16 12:14:27 UTC (rev 30892)
+++ trunk/src/wp-content/themes/twentyfifteen/js/customize-preview.js 2014-12-16 12:26:49 UTC (rev 30893)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3,7 +3,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> ( function( $ ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var $style = $( '#twentyfifteen-color-scheme-css' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var $style = $( '#twentyfifteen-color-scheme-css' ),
+ api = wp.customize;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $style.length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $style = $( 'head' ).append( '<style type="text/css" id="twentyfifteen-color-scheme-css" />' )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,23 +12,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Site title.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp.customize( 'blogname', function( value ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ api( 'blogname', function( value ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> value.bind( function( to ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $( '.site-title a' ).text( to );
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Site tagline.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp.customize( 'blogdescription', function( value ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ api( 'blogdescription', function( value ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> value.bind( function( to ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $( '.site-description' ).text( to );
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Color Scheme CSS.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp.customize( 'color_scheme_css', function( value ) {
- value.bind( function( to ) {
- $style.html( to );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ api.bind( 'preview-ready', function() {
+ api.preview.bind( 'update-color-scheme-css', function( css ) {
+ $style.html( css );
</ins><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>