<commit_before>class window.TagsController
  constructor: (containerSelector, mode='edit')->
    @$container = $(containerSelector)
    
    switch mode
      when 'edit'
        @tagViewClass = EditingTagView
        @tagInputClass = TagInput
        @tagViewListClass = EditingTagViewList
        @$container.find('.tagAdd').click => $.publish 'tags:create', [@tagInput.value()]
      when 'show'
        @tagViewClass = ShowingTagView
        @tagInputClass = ShowingTagInput
        @tagViewListClass = TagViewList
        #@$container.find('.tagAdd').click => $.publish 'tags:create', [@tagInput.value()]

    @tagInput = new @tagInputClass(@$container.find('#newTag'))
    @tagViews = new @tagViewListClass(@tagViewClass)

    $.subscribe 'tags:create', (tagName)=> 
      # Check for empty tag
      if tagName isnt "" and tagName isnt "who/where/what"
        @createTag(tagName)
    
    
  createTag: (tagName)->
    tag = new Tag(tagName)
    tagView = new @tagViewClass(tag)
    tagView.create()<commit_msg>fixing max tag count to 16<commit_after>class window.TagsController
  constructor: (containerSelector, mode='edit')->
    @$container = $(containerSelector)
    
    switch mode
      when 'edit'
        @tagViewClass = EditingTagView
        @tagInputClass = TagInput
        @tagViewListClass = EditingTagViewList
        @$container.find('.tagAdd').click => $.publish 'tags:create', [@tagInput.value()]
      when 'show'
        @tagViewClass = ShowingTagView
        @tagInputClass = ShowingTagInput
        @tagViewListClass = TagViewList
        #@$container.find('.tagAdd').click => $.publish 'tags:create', [@tagInput.value()]

    @tagInput = new @tagInputClass(@$container.find('#newTag'))
    @tagViews = new @tagViewListClass(@tagViewClass)

    $.subscribe 'tags:create', (tagName)=> 
      # Check for empty tag & less than 3 char tag & default tag
      # Don't let them post unless they meet all the criteria
      if tagName isnt "" and tagName isnt "who/where/what" and tagName.length > 2
        
        # Check for max tags
        if @tagViews.tagViews.length < 17
          @createTag(tagName)
    
    
  createTag: (tagName)->
    tag = new Tag(tagName)
    tagView = new @tagViewClass(tag)
    tagView.create()
{'fraction_non_alphanumeric': 0.12549889135254988, 'fraction_numerical': 0.0026607538802660754, 'mean_word_length': 2.992920353982301, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 14, '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': '3909147', 'n_tokens_mistral': 680, 'n_tokens_neox': 666, 'n_words': 157}