<commit_before>CustomLinkView = require './customlinkview'

module.exports = class TopNavigation extends KDCustomHTMLView

  menu = [
    { title : 'Koding University', href : 'http://learn.koding.com', name : 'about'}
    { title : 'Features',          href : '/Features',               name : 'features'}
    { title : 'SIGN IN',           href : '/Login',                  name : 'login'}
  ]
  if KD.userAccount.type isnt 'registered'
    menu.push
      title : 'SIGN IN'
      href  : '/WFGH/Login'
      name  : 'login'

  constructor: (options = {}, data) ->

    options.tagName or= 'nav'

    super options, data

    @menu = {}

    {mainView} = KD.singletons
    mainView.on 'MainTabPaneShown', @bound 'setActiveItem'


  viewAppended: ->

    @createItem options  for options in menu


  createItem: (options) ->

    options.cssClass = options.name.toLowerCase()

    @addSubView @menu[options.name] = new CustomLinkView options


  setActiveItem: (pane) ->

    @unsetActiveItems()

    {name} = pane

    @menu[name]?.setClass 'active'


  unsetActiveItems: ->

    item.unsetClass 'active'  for own name, item of @menu

<commit_msg>Nav: removed top right links<commit_after>CustomLinkView = require './customlinkview'

module.exports = class TopNavigation extends KDCustomHTMLView

  menu = []

  if KD.userAccount.type isnt 'registered'
    menu.push
      title : 'SIGN IN'
      href  : '/WFGH/Login'
      name  : 'login'

  constructor: (options = {}, data) ->

    options.tagName or= 'nav'

    super options, data

    @menu = {}

    {mainView} = KD.singletons
    mainView.on 'MainTabPaneShown', @bound 'setActiveItem'


  viewAppended: ->

    @createItem options  for options in menu


  createItem: (options) ->

    options.cssClass = options.name.toLowerCase()

    @addSubView @menu[options.name] = new CustomLinkView options


  setActiveItem: (pane) ->

    @unsetActiveItems()

    {name} = pane

    @menu[name]?.setClass 'active'


  unsetActiveItems: ->

    item.unsetClass 'active'  for own name, item of @menu


{'fraction_non_alphanumeric': 0.1251826595226498, 'fraction_numerical': 0.0, 'mean_word_length': 2.7142857142857144, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '5450377', 'n_tokens_mistral': 683, 'n_tokens_neox': 634, 'n_words': 162}