<commit_before>_ = require 'underscore'
Backbone = require 'backbone'
SearchBarView = require '../../search_bar/client/view.coffee'
AuthModalView = require '../../auth_modal/view.coffee'
AuthRouter = require './auth_router.coffee'
mediator = require '../../../lib/mediator.coffee'
Notifications = require "../../../collections/notifications.coffee"
SmallFeedView = require '../../feed/client/small_feed_view.coffee'
NewChannelView = require '../../new_channel/client/new_channel_view.coffee'
sd = require('sharify').data
Backbone.$ = $

module.exports = class HeaderView extends Backbone.View

  events:
    'tap #layout-header__search__input'   : 'setActive'
    'blur #layout-header__search__input'  : 'unsetActive'
    'tap .header--icon'                   : 'setActive'
    'tap .btn-login'                      : 'login'
    'tap .btn-signup'                     : 'signup'
    'touchstart .dropdown--menu__trigger'      : 'toggleDropdown'

  initialize: (options) ->

    @searchBarView = new SearchBarView
      el: @$('.layout-header__search')
      $input: @$('#layout-header__search__input')
      $results: @$('.layout-header__search__results')

    mediator.on 'open:auth', @openAuth, @
    mediator.on 'body:click', @closeDropdown, @
    mediator.on 'search:loaded', @closeDropdown, @
    mediator.on 'notifications:synced', @maybeSetNotifications, @
    mediator.on 'notifications:cleared', @unsetNotifications, @

    if $('.path__inner')[0] and !$('body').hasClass('is-mobile')
      new Waypoint.Sticky
        element: $('.path__inner')
        offset: 3

    if !sd.CURRENT_USER
      new AuthRouter pushState: false
    else
      @notifications = new Notifications()
      mediator.shared.notifications = @notifications
      @notifications.fetch()<commit_msg>accidentally left a script test<commit_after>_ = require 'underscore'
Backbone = require 'backbone'
SearchBarView = require '../../search_bar/client/view.coffee'
AuthModalView = require '../../auth_modal/view.coffee'
AuthRouter = require './auth_router.coffee'
mediator = require '../../../lib/mediator.coffee'
Notifications = require "../../../collections/notifications.coffee"
SmallFeedView = require '../../feed/client/small_feed_view.coffee'
NewChannelView = require '../../new_channel/client/new_channel_view.coffee'
sd = require('sharify').data
Backbone.$ = $

module.exports = class HeaderView extends Backbone.View

  events:
    'tap #layout-header__search__input'   : 'setActive'
    'blur #layout-header__search__input'  : 'unsetActive'
    'tap .header--icon'                   : 'setActive'
    'tap .btn-login'                      : 'login'
    'tap .btn-signup'                     : 'signup'
    'tap .dropdown--menu__trigger'        : 'toggleDropdown'

  initialize: (options) ->

    @searchBarView = new SearchBarView
      el: @$('.layout-header__search')
      $input: @$('#layout-header__search__input')
      $results: @$('.layout-header__search__results')

    mediator.on 'open:auth', @openAuth, @
    mediator.on 'body:click', @closeDropdown, @
    mediator.on 'search:loaded', @closeDropdown, @
    mediator.on 'notifications:synced', @maybeSetNotifications, @
    mediator.on 'notifications:cleared', @unsetNotifications, @

    if $('.path__inner')[0] and !$('body').hasClass('is-mobile')
      new Waypoint.Sticky
        element: $('.path__inner')
        offset: 3

    if !sd.CURRENT_USER
      new AuthRouter pushState: false
    else
      @notifications = new Notifications()
      mediator.shared.notifications = @notifications
      @notifications.fetch()
{'fraction_non_alphanumeric': 0.14993006993006994, 'fraction_numerical': 0.0011188811188811189, 'mean_word_length': 3.1436848203939745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6702099', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1082, 'n_words': 209}