Add upstream

This commit is contained in:
root
2019-10-24 00:12:05 +02:00
parent 85d41e4216
commit ac980f592c
3504 changed files with 1049983 additions and 29971 deletions

View File

@@ -0,0 +1,35 @@
jQuery( function( $ ) {
function twitterWidgetTypeChanged( widgetTypeSelector ) {
var selectedType = $( widgetTypeSelector ).val();
$( widgetTypeSelector )
.closest( '.jetpack-twitter-timeline-widget-type-container' )
.next( '.jetpack-twitter-timeline-widget-id-container' )
.find( 'label' )
.css( 'display', function() {
var labelType = $( this ).data( 'widget-type' );
if ( selectedType === labelType ) {
return '';
} else {
return 'none';
}
} );
}
// We could either be in wp-admin/widgets.php or the Customizer.
var $container = $( '#customize-controls' );
if ( ! $container.length ) {
$container = $( '#wpbody' );
}
// Observe widget settings for 'change' events of the 'type' property for
// current and future Twitter timeline widgets.
$container.on( 'change', '.jetpack-twitter-timeline-widget-type', function() {
twitterWidgetTypeChanged( this );
} );
// Set the labels for currently existing widgets (including the "template"
// version that is copied when a new widget is added).
$container.find( '.jetpack-twitter-timeline-widget-type' ).each( function() {
twitterWidgetTypeChanged( this );
} );
} );