<commit_before>
# Shared utilities and document ready that initializes different fancy login objects


# When dealing with page reloads after ajax login or logout the easiest way to notify a user about
# the state change is by passing client side parameters in the URL such as #?=logged-in...
# So when login happens we reload page, but add first #?n=logged-in that fires the notificatin and then deletes the hash
# Logout is not an async funciton so if we set the link to mi.kelisto.es/salir#?n=logged-out we will see the notification ;)
class @Notification

  getText: ()->
    # If has begins with #? that means we have a variable passed
    if window.location.hash.slice(0,2) == "#?"
      if window.location.hash.indexOf("n=logged-out") != -1
        text = "Acabas de salir de Kelisto"
      else if window.location.hash.indexOf("n=reset-pass") != -1
        text = "Email enviado, consulta la bandeja de entrada de tu correo"
      return text
    return false

  show: (text)->
    $notification = $('<div/>', {
      class: 'js-top-notification'<commit_msg>new option<commit_after>
# Shared utilities and document ready that initializes different fancy login objects


# When dealing with page reloads after ajax login or logout the easiest way to notify a user about
# the state change is by passing client side parameters in the URL such as #?=logged-in...
# So when login happens we reload page, but add first #?n=logged-in that fires the notificatin and then deletes the hash
# Logout is not an async funciton so if we set the link to mi.kelisto.es/salir#?n=logged-out we will see the notification ;)
class @Notification

  getText: ()->
    # If has begins with #? that means we have a variable passed
    if window.location.hash.slice(0,2) == "#?"
      if window.location.hash.indexOf("n=logged-out") != -1
        text = "Acabas de salir de Kelisto"
      else if window.location.hash.indexOf("n=reset-pass") != -1
        text = "Email enviado, consulta la bandeja de entrada de tu correo"
      else if window.location.hash.indexOf("n=confirm-email")
        text = "¡Gracias por unirte a Kelisto! Activa la cuenta desde tu correo y comienza a participar en nuestra gran comunidad de ahorradores."
      return text
    return false

  show: (text)->
    $notification = $('<div/>', {
      class: 'js-top-notification'
{'fraction_non_alphanumeric': 0.09366980325064157, 'fraction_numerical': 0.003421727972626176, 'mean_word_length': 3.421550094517958, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1879932', 'n_tokens_mistral': 692, 'n_tokens_neox': 674, 'n_words': 293}