2014-10-14 21:48:19 +02:00
|
|
|
/* global colorScheme */
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 21:28:18 +02:00
|
|
|
/**
|
2014-10-15 19:21:19 +02:00
|
|
|
* Customizer enhancements for a better user experience.
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 21:28:18 +02:00
|
|
|
*
|
|
|
|
* Adds listener to Color Scheme control to update other color controls with new values/defaults
|
|
|
|
*/
|
|
|
|
|
2014-10-14 21:48:19 +02:00
|
|
|
( function( wp ) {
|
2014-10-17 22:52:19 +02:00
|
|
|
wp.customize.controlConstructor.select = wp.customize.Control.extend( {
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 21:28:18 +02:00
|
|
|
ready: function() {
|
2014-10-17 22:52:19 +02:00
|
|
|
if ( 'color_scheme' === this.id ) {
|
|
|
|
var parentSection = this.container.closest( '.control-section' ),
|
|
|
|
headerTextColor = parentSection.find( '#customize-control-header_textcolor .color-picker-hex' ),
|
|
|
|
backgroundColor = parentSection.find( '#customize-control-background_color .color-picker-hex' ),
|
|
|
|
sidebarColor = parentSection.find( '#customize-control-header_background_color .color-picker-hex' ),
|
|
|
|
sidebarTextColor = parentSection.find( '#customize-control-sidebar_textcolor .color-picker-hex' );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 21:28:18 +02:00
|
|
|
|
2014-10-17 22:52:19 +02:00
|
|
|
this.setting.bind( 'change', function( value ) {
|
|
|
|
// if Header Text is not hidden, update value
|
|
|
|
if ( 'blank' !== wp.customize( 'header_textcolor' ).get() ) {
|
|
|
|
wp.customize( 'header_textcolor' ).set( colorScheme[value].colors[4] );
|
|
|
|
headerTextColor.val( colorScheme[value].colors[4] )
|
|
|
|
.data( 'data-default-color', colorScheme[value].colors[4] )
|
|
|
|
.wpColorPicker( 'color', colorScheme[value].colors[4] )
|
|
|
|
.wpColorPicker( 'defaultColor', colorScheme[value].colors[4] );
|
|
|
|
}
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 21:28:18 +02:00
|
|
|
|
2014-10-17 22:52:19 +02:00
|
|
|
// update Background Color
|
|
|
|
wp.customize( 'background_color' ).set( colorScheme[value].colors[0] );
|
|
|
|
backgroundColor.val( colorScheme[value].colors[0] )
|
|
|
|
.data( 'data-default-color', colorScheme[value].colors[0] )
|
|
|
|
.wpColorPicker( 'color', colorScheme[value].colors[0] )
|
|
|
|
.wpColorPicker( 'defaultColor', colorScheme[value].colors[0] );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 21:28:18 +02:00
|
|
|
|
2014-10-17 22:52:19 +02:00
|
|
|
// update Header/Sidebar Background Color
|
|
|
|
wp.customize( 'header_background_color' ).set( colorScheme[value].colors[1] );
|
|
|
|
sidebarColor.val( colorScheme[value].colors[1] )
|
|
|
|
.data( 'data-default-color', colorScheme[value].colors[1] )
|
|
|
|
.wpColorPicker( 'color', colorScheme[value].colors[1] )
|
|
|
|
.wpColorPicker( 'defaultColor', colorScheme[value].colors[1] );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 21:28:18 +02:00
|
|
|
|
2014-10-17 22:52:19 +02:00
|
|
|
// update Sidebar Text Color
|
|
|
|
wp.customize( 'sidebar_textcolor' ).set( colorScheme[value].colors[4] );
|
|
|
|
sidebarTextColor.val( colorScheme[value].colors[4] )
|
|
|
|
.data( 'data-default-color', colorScheme[value].colors[4] )
|
|
|
|
.wpColorPicker( 'color', colorScheme[value].colors[4] )
|
|
|
|
.wpColorPicker( 'defaultColor', colorScheme[value].colors[4] );
|
|
|
|
} );
|
|
|
|
}
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 21:28:18 +02:00
|
|
|
}
|
|
|
|
} );
|
2014-10-14 21:48:19 +02:00
|
|
|
} )( this.wp );
|