<commit_before>class TeamworkTabView extends CollaborativePane

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

    super options, data

    @createElements()
    @keysRef  = @workspaceRef.child "keys"
    @indexRef = @workspaceRef.child "index"

    @tabView.on "PaneDidShow", (pane) =>
      @indexRef.set pane.getOptions().indexKey

    @indexRef.on "value", (snapshot) =>
      key = snapshot.val()
      return unless key

      for pane in @tabView.panes
        if pane.getOptions().indexKey is key
          @tabView.showPaneByIndex @tabView.getPaneIndex pane


  createElements: ->
    @tabHandleHolder = new ApplicationTabHandleHolder delegate: this
    @tabView         = new ApplicationTabView
      delegate                  : this
      lastTabHandleMargin       : 200
      tabHandleContainer        : @tabHandleHolder
      closeAppWhenAllTabsClosed : no<commit_msg>Teamwork: implemented keysRef child_added for TeamworkTabView.<commit_after>class TeamworkTabView extends CollaborativePane

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

    super options, data

    @createElements()
    @keysRef  = @workspaceRef.child "keys"
    @indexRef = @workspaceRef.child "index"

    @tabView.on "PaneDidShow", (pane) =>
      @indexRef.set pane.getOptions().indexKey

    @indexRef.on "value", (snapshot) =>
      key = snapshot.val()
      return unless key

      for pane in @tabView.panes
        if pane.getOptions().indexKey is key
          @tabView.showPaneByIndex @tabView.getPaneIndex pane

    @keysRef.on "child_added", (snapshot) =>
      data    = snapshot.val()
      key     = data.indexKey
      {panes} = @tabView
      isExist = yes for pane in panes when pane.getOptions().indexKey is key

      @createTabFromFirebaseData data  unless isExist


  createElements: ->
    @tabHandleHolder = new ApplicationTabHandleHolder delegate: this
    @tabView         = new ApplicationTabView
      delegate                  : this
      lastTabHandleMargin       : 200
      tabHandleContainer        : @tabHandleHolder
      closeAppWhenAllTabsClosed : no
{'fraction_non_alphanumeric': 0.08976225133430374, 'fraction_numerical': 0.002911208151382824, 'mean_word_length': 2.70863309352518, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '5757703', 'n_tokens_mistral': 613, 'n_tokens_neox': 577, 'n_words': 143}