/usr/share/wordpress/wp-content/themes/twentytwelve/js/theme-customizer.js is in wordpress-theme-twentytwelve 3.8.2+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | /**
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
* Things like site title, description, and background color changes.
*/
( function( $ ) {
// Site title and description.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '.site-title a' ).text( to );
} );
} );
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '.site-description' ).text( to );
} );
} );
// Header text color
wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) {
if ( 'blank' === to ) {
$( '.site-title, .site-title a, .site-description' ).css( {
'clip': 'rect(1px, 1px, 1px, 1px)',
'position': 'absolute'
} );
} else {
$( '.site-title, .site-title a, .site-description' ).css( {
'clip': 'auto',
'color': to,
'position': 'relative'
} );
}
} );
} );
// Hook into background color/image change and adjust body class value as needed.
wp.customize( 'background_color', function( value ) {
value.bind( function( to ) {
var body = $( 'body' );
if ( ( '#ffffff' == to || '#fff' == to ) && 'none' == body.css( 'background-image' ) )
body.addClass( 'custom-background-white' );
else if ( '' == to && 'none' == body.css( 'background-image' ) )
body.addClass( 'custom-background-empty' );
else
body.removeClass( 'custom-background-empty custom-background-white' );
} );
} );
wp.customize( 'background_image', function( value ) {
value.bind( function( to ) {
var body = $( 'body' );
if ( '' != to )
body.removeClass( 'custom-background-empty custom-background-white' );
else if ( 'rgb(255, 255, 255)' == body.css( 'background-color' ) )
body.addClass( 'custom-background-white' );
else if ( 'rgb(230, 230, 230)' == body.css( 'background-color' ) && '' == _wpCustomizeSettings.values.background_color )
body.addClass( 'custom-background-empty' );
} );
} );
} )( jQuery );
|