authors
7 months ago
contact-info
7 months ago
eu-cookie-law
7 months ago
facebook-likebox
11 years ago
flickr
7 months ago
gallery
7 months ago
goodreads
7 months ago
google-translate
1 year ago
image-widget
7 months ago
instagram
4 months ago
internet-defense-league
1 year ago
milestone
4 months ago
my-community
7 months ago
social-icons
4 months ago
social-media-icons
7 months ago
top-posts
7 months ago
wordpress-post-widget
2 weeks ago
authors.php
7 months ago
blog-stats.php
7 months ago
class-jetpack-eu-cookie-law-widget.php
1 month ago
class-jetpack-instagram-widget.php
6 months ago
contact-info.php
1 month ago
customizer-controls.css
7 months ago
customizer-utils.js
1 year ago
facebook-likebox.php
1 month ago
flickr.php
7 months ago
gallery.php
1 month ago
goodreads.php
1 month ago
google-translate.php
1 month ago
gravatar-profile.css
7 months ago
gravatar-profile.php
1 month ago
image-widget.php
7 months ago
internet-defense-league.php
7 months ago
mailchimp.php
7 months ago
milestone.php
7 months ago
my-community.php
1 month ago
rsslinks-widget.php
2 weeks ago
simple-payments.php
7 months ago
social-icons.php
1 month ago
social-media-icons.php
7 months ago
top-posts.php
1 month ago
twitter-timeline-admin.js
1 year ago
twitter-timeline.php
2 weeks ago
upcoming-events.php
7 months ago
wordpress-post-widget.php
7 months ago
twitter-timeline-admin.js
66 lines
| 1 | jQuery( function ( $ ) { |
| 2 | function twitterWidgetTypeChanged( widgetTypeSelector ) { |
| 3 | var selectedType = $( widgetTypeSelector ).val(); |
| 4 | $( widgetTypeSelector ) |
| 5 | .closest( '.jetpack-twitter-timeline-widget-type-container' ) |
| 6 | .next( '.jetpack-twitter-timeline-widget-id-container' ) |
| 7 | .find( 'label' ) |
| 8 | .css( 'display', function () { |
| 9 | var labelType = $( this ).data( 'widget-type' ); |
| 10 | if ( selectedType === labelType ) { |
| 11 | return ''; |
| 12 | } |
| 13 | return 'none'; |
| 14 | } ); |
| 15 | } |
| 16 | |
| 17 | function twitterWidgetTweetDisplayChanged( event ) { |
| 18 | var $tweetDisplaySelector = $( event.target ); |
| 19 | var selectedTweetDisplay = $tweetDisplaySelector.val(); |
| 20 | var $form = $tweetDisplaySelector.closest( 'form' ); |
| 21 | var $heightContainer = $form.find( '.jetpack-twitter-timeline-widget-height-container' ); |
| 22 | var $tweetLimitContainer = $form.find( |
| 23 | '.jetpack-twitter-timeline-widget-tweet-limit-container' |
| 24 | ); |
| 25 | var $scrollbarInput = $form.find( 'input[id*=chrome-noscrollbar]' ); |
| 26 | switch ( selectedTweetDisplay ) { |
| 27 | case 'fixed': |
| 28 | $heightContainer.hide(); |
| 29 | $tweetLimitContainer.show(); |
| 30 | $scrollbarInput.prop( 'disabled', true ); |
| 31 | break; |
| 32 | case 'dynamic': |
| 33 | $tweetLimitContainer.hide(); |
| 34 | $heightContainer.show(); |
| 35 | $scrollbarInput.prop( 'disabled', false ); |
| 36 | break; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | // We could either be in wp-admin/widgets.php or the Customizer. |
| 41 | var $container = $( '#customize-controls' ); |
| 42 | if ( ! $container.length ) { |
| 43 | $container = $( '#wpbody' ); |
| 44 | } |
| 45 | |
| 46 | // Observe widget settings for 'change' events of the 'type' property for |
| 47 | // current and future Twitter timeline widgets. |
| 48 | $container.on( 'change', '.jetpack-twitter-timeline-widget-type', function () { |
| 49 | twitterWidgetTypeChanged( this ); |
| 50 | } ); |
| 51 | |
| 52 | // Set the labels for currently existing widgets (including the "template" |
| 53 | // version that is copied when a new widget is added). |
| 54 | $container.find( '.jetpack-twitter-timeline-widget-type' ).each( function () { |
| 55 | twitterWidgetTypeChanged( this ); |
| 56 | } ); |
| 57 | |
| 58 | // Observe widget settings for 'change' events of the 'tweet-display' property for |
| 59 | // current and future Twitter timeline widgets. |
| 60 | $container.on( |
| 61 | 'change', |
| 62 | '.jetpack-twitter-timeline-widget-tweet-display-radio', |
| 63 | twitterWidgetTweetDisplayChanged |
| 64 | ); |
| 65 | } ); |
| 66 |