<commit_before>class ResultsTableViewRow
  constructor: (clip1, clip2) ->
    clip1 ?= {}
    clip2 ?= {}
    @clips = [clip1, clip2]
    @create_row()
    @create_clip_views()

  view: ->
    @row

  create_spinner: ->
    { style: Titanium.UI.iPhone.ActivityIndicatorStyle.WHITE }
    Titanium.UI.createActivityIndicator()

  create_row: ->
    @row = Ti.UI.createTableViewRow(
      allowSelection: false
      classname: 'result'
      height: 100
      width: 320
      top: 0
      left: 0
      selectionStyle: Titanium.UI.iPhone.TableViewCellSelectionStyle.NONE
    )

  create_clip_views: ->
    @cv1 = @create_clip_view(@clips[0], 0)
    @cv2 = @create_clip_view(@clips[1], 160)
    true

  create_clip_view: (clip, left) ->
    v = Ti.UI.createImageView(
      height: 100
      width: 160
      top: 0
      left: left
      image: clip.image_url
    )
    v._spinner = @create_spinner()
    v.add v._spinner
    @add_event_listener clip, v
    @row.add v

  add_event_listener: (clip, view) ->
    view.addEventListener 'click', ->
      view._spinner.show()
      view.opacity = 0.5
      api = new MovieClipsAPI()
      api.get_stream_url clip.id, (s) ->
        puts s
        if s.success
          Ti.App.fireEvent 'view_movie', url: s.url
        else
          alert "woops"
        setTimeout(->
          view._spinner.hide()
          view.opacity = 1
        , 2000)

<commit_msg>Everything there except for search button<commit_after>class ResultsTableViewRow
  constructor: (clip1, clip2) ->
    clip1 ?= {}
    clip2 ?= {}
    @clips = [clip1, clip2]
    @create_row()
    @create_clip_views()

  view: ->
    @row

  create_spinner: ->
    { style: Titanium.UI.iPhone.ActivityIndicatorStyle.DARK }
    Titanium.UI.createActivityIndicator()

  create_row: ->
    @row = Ti.UI.createTableViewRow(
      allowSelection: false
      classname: 'result'
      height: 100
      width: 320
      top: 0
      left: 0
      selectionStyle: Titanium.UI.iPhone.TableViewCellSelectionStyle.NONE
    )

  create_clip_views: ->
    @cv1 = @create_clip_view(@clips[0], 0)
    @cv2 = @create_clip_view(@clips[1], 160)
    true

  create_clip_view: (clip, left) ->
    v = Ti.UI.createImageView(
      height: 100
      width: 160
      top: 0
      left: left
      image: clip.image_url
    )
    v._spinner = @create_spinner()
    v.add v._spinner
    @add_event_listener clip, v
    @row.add v

  add_event_listener: (clip, view) ->
    view.addEventListener 'click', ->
      view._spinner.show()
      view.opacity = 0.5
      api = new MovieClipsAPI()
      api.get_stream_url clip.id, (s) ->
        puts s
        if s.success
          Ti.App.fireEvent 'view_movie', url: s.url
        else
          alert "woops"
        setTimeout((-> view._spinner.hide(); view.opacity = 1), 2000)


{'fraction_non_alphanumeric': 0.11997152011391954, 'fraction_numerical': 0.025631897472410112, 'mean_word_length': 2.2485549132947975, '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': '7234719', 'n_tokens_mistral': 1027, 'n_tokens_neox': 958, 'n_words': 199}