<commit_before>class NFinderItem extends JTreeItemView

  JView.mixin @prototype

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

    options.tagName or= "li"
    options.type    or= "finderitem"

    super options, data

    @isLoading        = no
    @beingDeleted     = no
    @beingEdited      = no
    @beingProgress    = no

    childConstructor = switch data.type
      when "vm"         then NVMItemView
      when "folder"     then NFolderItemView
      when "section"    then NSectionItemView
      when "mount"      then NMountItemView
      when "brokenLink" then NBrokenLinkItemView
      else NFileItemView

    @childView = new childConstructor delegate: this, data
    @childView.$().css "margin-left", (data.depth) * 14

    if data.name? and data.name.length > 20 - data.depth
      @childView.setAttribute "title", FSHelper.plainPath data.name

    @on "ItemBeingDeleted", =>
      data.removeLocalFileInfo()

    @on "viewAppended", =>
      fileInfo = data.getLocalFileInfo()
      if fileInfo.lastUploadedChunk
        {lastUploadedChunk, totalChunks} = fileInfo
        data.removeLocalFileInfo() if lastUploadedChunk is totalChunks
        @showProgressView 100 * lastUploadedChunk / totalChunks

  mouseDown:-> yes

  resetView:(view)->

    if @deleteView
      @deleteView.destroy()
      delete @deleteView

    if @renameView
      @renameView.destroy()
      delete @renameView<commit_msg>Make choosing child constructor for finder item as a separate method to override.<commit_after>class NFinderItem extends JTreeItemView

  JView.mixin @prototype

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

    options.tagName or= "li"
    options.type    or= "finderitem"

    super options, data

    @isLoading        = no
    @beingDeleted     = no
    @beingEdited      = no
    @beingProgress    = no

    childConstructor = @getChildConstructor data.type

    @childView = new childConstructor delegate: this, data
    @childView.$().css "margin-left", (data.depth) * 14

    if data.name? and data.name.length > 20 - data.depth
      @childView.setAttribute "title", FSHelper.plainPath data.name

    @on "ItemBeingDeleted", =>
      data.removeLocalFileInfo()

    @on "viewAppended", =>
      fileInfo = data.getLocalFileInfo()
      if fileInfo.lastUploadedChunk
        {lastUploadedChunk, totalChunks} = fileInfo
        data.removeLocalFileInfo() if lastUploadedChunk is totalChunks
        @showProgressView 100 * lastUploadedChunk / totalChunks

  getChildConstructor: (type) ->
    switch type
      when "vm"         then NVMItemView
      when "folder"     then NFolderItemView
      when "section"    then NSectionItemView
      when "mount"      then NMountItemView
      when "brokenLink" then NBrokenLinkItemView
      else NFileItemView

  mouseDown:-> yes

  resetView:(view)->

    if @deleteView
      @deleteView.destroy()
      delete @deleteView

    if @renameView
      @renameView.destroy()
      delete @renameView
{'fraction_non_alphanumeric': 0.08717774762550883, 'fraction_numerical': 0.0047489823609226595, 'mean_word_length': 2.775928297055058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, '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': '3132440', 'n_tokens_mistral': 884, 'n_tokens_neox': 845, 'n_words': 223}