<commit_before>Factlink.Views ||= {}

class Factlink.Views.Notification
  className: 'fl-message'
  tagName: 'div'
  appendTo: '#fl'

  default_options:
    in_screen_time: 2000
    fade_time: 'slow'

  constructor: (options) ->
    @options = _.extend {}, @default_options, options

  render: ->
    @$el = $("<#{@tagName}/>")
              .addClass(@className)
              .hide()
              .text(@options.message)

    $(@appendTo).append(@$el)

    @$el.fadeIn @options.fade_time, =>
      setTimeout(@remove, @options.in_screen_time)

  remove: =>
    @$el.fadeOut(@options.fade_time, => @$el.remove())<commit_msg>Moved element creation to constructor<commit_after>Factlink.Views ||= {}

class Factlink.Views.Notification
  className: 'fl-message'
  tagName: 'div'
  appendTo: '#fl'

  default_options:
    in_screen_time: 2000
    fade_time: 'slow'

  constructor: (options) ->
    @options = _.extend {}, @default_options, options

    @$el = $("<#{@tagName}/>")
          .addClass(@className)
          .hide()
          .text(@options.message)

  render: ->
    $(@appendTo).append(@$el)

    @$el.fadeIn @options.fade_time, =>
      setTimeout(@remove, @options.in_screen_time)

  remove: =>
    @$el.fadeOut(@options.fade_time, => @$el.remove())
{'fraction_non_alphanumeric': 0.17563291139240506, 'fraction_numerical': 0.006329113924050633, 'mean_word_length': 3.067524115755627, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '950726', 'n_tokens_mistral': 450, 'n_tokens_neox': 421, 'n_words': 71}