Ticket #29988: 29988.js.3.diff
File 29988.js.3.diff, 4.6 KB (added by , 10 years ago) |
---|
-
src/wp-content/themes/twentyfifteen/inc/customizer.php
17 17 function twentyfifteen_customize_register( $wp_customize ) { 18 18 $color_scheme = twentyfifteen_get_color_scheme(); 19 19 20 $wp_customize->get_setting( 'blogname' )->transport 21 $wp_customize->get_setting( 'blogdescription' )->transport 20 $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; 21 $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; 22 22 23 23 // Add color scheme setting and control. 24 24 $wp_customize->add_setting( 'color_scheme', array( … … 254 254 add_action( 'customize_controls_enqueue_scripts', 'twentyfifteen_customize_control_js' ); 255 255 256 256 /** 257 * Binds JS handlers to make Customizer preview reload changes asynchronously.257 * Binds JS handlers to make the Customizer preview reload changes asynchronously. 258 258 * 259 259 * @since Twenty Fifteen 1.0 260 260 */ … … 266 266 /** 267 267 * Output an Underscore template for generating CSS for the color scheme. 268 268 * 269 * The template generates the css dynamically for instant display in the Customizer preview, 270 * and to be saved in a `theme_mod` for display on the front-end. 271 * 269 272 * @since Twenty Fifteen 1.0 270 273 */ 271 274 function twentyfifteen_color_scheme_css_template() { … … 512 515 /* Sidebar Text Color */ 513 516 .site-title a:hover, 514 517 .site-title a:focus { 515 color: {{ data.s idebar_textcolor2}};518 color: {{ data.secondary_sidebar_textcolor }}; 516 519 } 517 520 518 521 /* Sidebar Border Color */ … … 592 595 .widget blockquote, 593 596 .widget .wp-caption-text, 594 597 .widget .gallery-caption { 595 color: {{ data.s idebar_textcolor2}};598 color: {{ data.secondary_sidebar_textcolor }}; 596 599 } 597 600 598 601 .widget button:hover, … … 605 608 .widget input[type="submit"]:focus, 606 609 .widget_calendar tbody a:hover, 607 610 .widget_calendar tbody a:focus { 608 background-color: {{ data.s idebar_textcolor2}};611 background-color: {{ data.secondary_sidebar_textcolor }}; 609 612 } 610 613 611 614 .widget blockquote { 612 border-color: {{ data.s idebar_textcolor2}};615 border-color: {{ data.secondary_sidebar_textcolor }}; 613 616 } 614 617 615 618 /* Sidebar Border Color */ -
src/wp-content/themes/twentyfifteen/js/color-scheme-control.js
1 1 /* global colorScheme */ 2 2 /** 3 3 * Add a listener to the Color Scheme control to update other color controls to new values/defaults. 4 * Also trigger an update of the Color Scheme CSS when a color is changed. 4 5 */ 5 6 6 7 ( function( api ) { … … 45 46 } 46 47 } ); 47 48 49 // Generate the CSS for the current Color Scheme. 48 50 function getCSS() { 49 51 var scheme = api( 'color_scheme' )(), 50 52 colors = _.object( colorSchemeKeys, colorScheme[ scheme ].colors ); … … 58 60 colors['secondary_textcolor'] = Color( colors.textcolor ).toCSS( 'rgba', 0.7 ); 59 61 colors['border_color'] = Color( colors.textcolor ).toCSS( 'rgba', 0.1 ); 60 62 colors['border_focus_color'] = Color( colors.textcolor ).toCSS( 'rgba', 0.3 ); 61 colors['s idebar_textcolor2'] = Color( colors.sidebar_textcolor ).toCSS( 'rgba', 0.7 );63 colors['secondary_sidebar_textcolor'] = Color( colors.sidebar_textcolor ).toCSS( 'rgba', 0.7 ); 62 64 colors['sidebar_border_color'] = Color( colors.sidebar_textcolor ).toCSS( 'rgba', 0.1 ); 63 65 colors['sidebar_border_focus_color'] = Color( colors.sidebar_textcolor ).toCSS( 'rgba', 0.3 ); 64 66 -
src/wp-content/themes/twentyfifteen/js/customize-preview.js
10 10 .find( '#twentyfifteen-color-scheme-css' ); 11 11 } 12 12 13 // Site title and description.13 // Site title. 14 14 wp.customize( 'blogname', function( value ) { 15 15 value.bind( function( to ) { 16 16 $( '.site-title a' ).text( to ); … … 17 17 } ); 18 18 } ); 19 19 20 // Site tagline. 20 21 wp.customize( 'blogdescription', function( value ) { 21 22 value.bind( function( to ) { 22 23 $( '.site-description' ).text( to ); 23 24 } ); 24 25 } ); 25 26 27 // Color Scheme CSS. 26 28 wp.customize( 'color_scheme_css', function( value ) { 27 29 value.bind( function( to ) { 28 30 $style.html( to );