<commit_before>define [
  'i18n!discussions'
  'jquery'
  'compiled/fn/preventDefault'
  'Backbone'
  'jqueryui/tooltip'
], (I18n, $, preventDefault, {View}) ->

  class ToggleableSubscriptionIconView extends View
    tagName:  'a'

    attributes:
      'href': '#'

    messages:
      subscribe:    I18n.t('subscribe', 'Subscribe to this topic')
      subscribed:   I18n.t('subscribed', 'Subscribed')
      unsubscribe:  I18n.t('unsubscribe', 'Unsubscribe from this topic')
      unsubscribed: I18n.t('unsubscribed', 'Unsubscribed')
      initial_post_required: I18n.t('initial_post_required_to_subscribe', 'You must post a reply before subscribing')
      not_in_group_set: I18n.t('cant_subscribe_not_in_group_set', 'You must be in an associated group to subscribe')
      not_in_group: I18n.t('cant_subscribe_not_in_group', 'You must be in this group to subscribe')

    tooltipOptions:
      items: '*'
      position: my: 'center bottom', at: 'center top-10', collision: 'none'
      tooltipClass: 'center bottom vertical'

    events: { 'click', 'hover', 'focus', 'blur' }

    initialize: ->
      @model.on('change:subscribed', @render)
      @model.on('change:user_can_see_posts', @render)
      @model.on('change:subscription_hold', @render)
      super

    hover: ({type}) ->
      @hovering = type in [ 'mouseenter', 'focus' ]<commit_msg>allow space or enter to operate subscribe button<commit_after>define [
  'i18n!discussions'
  'jquery'
  'compiled/fn/preventDefault'
  'Backbone'
  'jqueryui/tooltip'
], (I18n, $, preventDefault, {View}) ->

  class ToggleableSubscriptionIconView extends View
    tagName:  'a'

    attributes:
      'href': '#'

    messages:
      subscribe:    I18n.t('subscribe', 'Subscribe to this topic')
      subscribed:   I18n.t('subscribed', 'Subscribed')
      unsubscribe:  I18n.t('unsubscribe', 'Unsubscribe from this topic')
      unsubscribed: I18n.t('unsubscribed', 'Unsubscribed')
      initial_post_required: I18n.t('initial_post_required_to_subscribe', 'You must post a reply before subscribing')
      not_in_group_set: I18n.t('cant_subscribe_not_in_group_set', 'You must be in an associated group to subscribe')
      not_in_group: I18n.t('cant_subscribe_not_in_group', 'You must be in this group to subscribe')

    tooltipOptions:
      items: '*'
      position: my: 'center bottom', at: 'center top-10', collision: 'none'
      tooltipClass: 'center bottom vertical'

    events: { 'click', 'keyclick' : 'click', 'hover', 'focus', 'blur' }

    initialize: ->
      @model.on('change:subscribed', @render)
      @model.on('change:user_can_see_posts', @render)
      @model.on('change:subscription_hold', @render)
      super

    hover: ({type}) ->
      @hovering = type in [ 'mouseenter', 'focus' ]
{'fraction_non_alphanumeric': 0.13608396670285922, 'fraction_numerical': 0.014477017734346724, 'mean_word_length': 3.8406304728546408, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3400884', 'n_tokens_mistral': 941, 'n_tokens_neox': 891, 'n_words': 211}