<commit_before>(($) ->
  $.flashAlert = (message, type, timeout = 6000) ->
    $dismissLink = $('<a href="#" title="Hide this message" data-dismiss="alert" class="dismiss-flash"></a>').html('Dismiss')
    $alert = $('<div>').addClass("alert fade in #{type}").append(message).append($dismissLink)
    if $('.flash-messages .alert').size() > 2
      clearTimeout $('.flash-messages .alert:last').remove().data('timeout')
    $('.flash-messages').prepend($alert)
    $alert.data 'timeout', setTimeout(->
      $alert.alert('close')
    , timeout)
    true
) jQuery

$ ->
  if $('.flash-messages .alert').size() > 0
    $('.flash-messages .alert').addClass('in')
    setTimeout("$('.flash-messages .alert').alert('close');", 6000)<commit_msg>add the ability to customise dismiss button for flash alert<commit_after>(($) ->  
  $.flashAlert = (message, type, timeout = 6000, dismissLink) ->
    dismissLink ?= $.flashAlert.defaults.dismissLink
    $alert = $('<div>').addClass("alert fade in #{type}").append(message).append(dismissLink)
    if $('.flash-messages .alert').size() > 2
      clearTimeout $('.flash-messages .alert:last').remove().data('timeout')
    $('.flash-messages').prepend($alert)
    $alert.data 'timeout', setTimeout(->
      $alert.alert('close')
    , timeout)
    true
  $.flashAlert.defaults = {
    dismissLink: '<a href="#" title="Hide this message" data-dismiss="alert" class="dismiss-flash">Dismiss</a>'
  }
) jQuery

$ ->
  if $('.flash-messages .alert').size() > 0
    $('.flash-messages .alert').addClass('in')
    setTimeout("$('.flash-messages .alert').alert('close');", 6000)
{'fraction_non_alphanumeric': 0.22464219041692596, 'fraction_numerical': 0.012445550715619166, 'mean_word_length': 4.009345794392523, 'pattern_counts': {'":': 0, '<': 9, '<?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': '7479074', 'n_tokens_mistral': 514, 'n_tokens_neox': 486, 'n_words': 98}