<commit_before>class RainDrop
  
  constructor: (@frame,args) ->
    @dropId = @frame.attr('id')
    @expandTrigger = @frame.find('nav a.drop-expand')
    
    @extrasWrapper = @frame.find('.drop-extras')
    
    @expanded = false
    @extrasLoaded = false
    
    @bind()
    
  bind: =>
    $(document).bind 'expand.drop', (event,target,above,below) =>
      if target == @frame[0] and @expanded == false
        @expandTrigger.find('i').removeClass('icon-chevron-down').addClass('icon-chevron-up')
        @frame.addClass('expanded')
        @frame.prev().addClass('above-expanded')
        @frame.next().addClass('below-expanded')
        @expanded = true
        @loadExtras()
      else if @expanded
        @expanded = false
      
    @expandTrigger.bind 'click', =>
      $('li.drop').removeClass('expanded').removeClass('above-expanded').removeClass('below-expanded')
      $('li.drop > nav > a > i.icon-chevron-up').removeClass('icon-chevron-up').addClass('icon-chevron-down')
      $.event.trigger 'expand.drop', @frame      
      false
  
  loadExtras: =>
    if @extrasLoaded == false
      $.ajax
        url: "/drops/#{@dropId}/extras"
        complete: (response) =>
          if response.status == 200 and @extrasLoaded == false
            @extrasWrapper.html(response.responseText)
            @initReflections()
            @initVotes()<commit_msg>Made you able to expand drops just by clicking it's frame.<commit_after>class RainDrop
  
  constructor: (@frame,args) ->
    @dropId = @frame.attr('id')
    @expandTrigger = @frame.find('nav a.drop-expand')
    
    @extrasWrapper = @frame.find('.drop-extras')
    
    @expanded = false
    @extrasLoaded = false
    
    @bind()
    
  bind: =>
    $(document).bind 'expand.drop', (event,target,above,below) =>
      if target == @frame[0] and @expanded == false
        @expandTrigger.find('i').removeClass('icon-chevron-down').addClass('icon-chevron-up')
        @frame.addClass('expanded')
        @frame.prev().addClass('above-expanded')
        @frame.next().addClass('below-expanded')
        @expanded = true
        @loadExtras()
      else if @expanded
        @expanded = false
      
    @expandTrigger.bind 'click', =>
      @expandDrop()
      false
    @frame.bind 'click', (e) =>
      unless $(e.target).is('a,img')
        @expandDrop()
        false
  
  expandDrop: =>
    $('li.drop').removeClass('expanded').removeClass('above-expanded').removeClass('below-expanded')
    $('li.drop > nav > a > i.icon-chevron-up').removeClass('icon-chevron-up').addClass('icon-chevron-down')
    $.event.trigger 'expand.drop', @frame
  
  loadExtras: =>
    if @extrasLoaded == false
      $.ajax
        url: "/drops/#{@dropId}/extras"
        complete: (response) =>
          if response.status == 200 and @extrasLoaded == false
            @extrasWrapper.html(response.responseText)
            @initReflections()
            @initVotes()
{'fraction_non_alphanumeric': 0.16700889801505817, 'fraction_numerical': 0.0027378507871321013, 'mean_word_length': 2.6131025957972804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '5786', 'n_tokens_mistral': 931, 'n_tokens_neox': 910, 'n_words': 152}