<commit_before>class @Components.SocialFeeds extends @Components.Base
  @autoInit: ->
    $('.component-social-feeds').each (i, el) => new @($(el))

  constructor: (@el) ->
    super

    @items  = []
    $('article.social-feed', @el).each (i, el) =>
      @items.push new Components.SocialFeed($(el), @)

    @slider = $('[data-slick-carousel]', @el).not('[data-slick-carousel="false"]')
    @initSlider()

  initSlider: =>
    defaultOptions =
      slide:          'article'
      slidesToShow:   4
      slidesToScroll: 4
      dots:           true
      arrows:         true
      responsive:     [
        {
          breakpoint: 1200
          settings:
            slidesToShow:   3
            slidesToScroll: 3
        }
        {
          breakpoint: 767
          settings:
            slidesToShow:   1
            slidesToScroll: 1
        }
      ]

    customOptions = @slider.data('gallery-options') || {}

    @slider.slick Object.merge(defaultOptions, customOptions)

    @slider.on 'beforeChange', (ev, slick, currentSlide, nextSlide) =>
      if @items[currentSlide].embedded_player.length
        @items[currentSlide].stopVideo()

  onResponsiveSizeChange: ->
    @items.map 'checkPlugins'
    @slider.slick('slickGoTo', 0)


class @Components.SocialFeed
  constructor: (@el, @socialFeeds) ->
    @options         = @el.data('options')
    @embedded_player = $('.embedded-video-player-wrapper iframe', @el)

  stopVideo: ->
    src = @embedded_player.attr('src')
    @embedded_player.attr('src', '').attr('src', src)
<commit_msg>SocialFeeds - Set centerPadding as default gallery style<commit_after>class @Components.SocialFeeds extends @Components.Base
  @autoInit: ->
    $('.component-social-feeds').each (i, el) => new @($(el))

  constructor: (@el) ->
    super

    @items  = []
    $('article.social-feed', @el).each (i, el) =>
      @items.push new Components.SocialFeed($(el), @)

    @slider = $('[data-slick-carousel]', @el).not('[data-slick-carousel="false"]')
    @initSlider()

  initSlider: =>
    defaultOptions =
      slide:          'article'
      dots:           true
      centerMode:     true
      centerPadding:  '32%'
      slidesToShow:   1
      slidesToScroll: 1
      arrows:         false
      focusOnSelect:  true
      responsive: [
        {
          breakpoint: 1600
          settings: {centerPadding:  '28%'}
        }
        {
          breakpoint: 1100
          settings: {centerPadding:  '23%'}
        }
        {
          breakpoint: 600
          settings: {centerPadding: '10%'}
        }
      ]

    customOptions = @slider.data('gallery-options') || {}

    @slider.slick Object.merge(defaultOptions, customOptions)

    @slider.on 'beforeChange', (ev, slick, currentSlide, nextSlide) =>
      if @items[currentSlide].embedded_player.length
        @items[currentSlide].stopVideo()

  onResponsiveSizeChange: ->
    @items.map 'checkPlugins'
    @slider.slick('slickGoTo', 0)


class @Components.SocialFeed
  constructor: (@el, @socialFeeds) ->
    @options         = @el.data('options')
    @embedded_player = $('.embedded-video-player-wrapper iframe', @el)

  stopVideo: ->
    src = @embedded_player.attr('src')
    @embedded_player.attr('src', '').attr('src', src)

{'fraction_non_alphanumeric': 0.1501233045622688, 'fraction_numerical': 0.011097410604192354, 'mean_word_length': 2.373180873180873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5662207', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1013, 'n_words': 189}