<commit_before>class NCopyUrlView extends JView

  constructor: ->
    super

    {path}      = @getData()
    hostname    = FSHelper.getVMNameFromPath path
    @publicPath = FSHelper.isPublicPath path

    @inputUrlLabel  = new KDLabelView
      cssClass      : 'public-url-label'
      title         : 'Public URL'
      click         : => @focusAndSelectAll()

    @inputUrl       = new KDInputView
      label         : @inputUrlLabel
      cssClass      : 'public-url-input'

    KD.getSingleton('vmController').fetchVMDomains hostname, (err, domains)=>
      if domains?.length > 0 and not err
        @publicPath = domains.first
        @inputUrl.setValue (FSHelper.plainPath path).replace \
          ////home/(.*)/Web/(.*)///, "http://#{@publicPath}/$2"

  focusAndSelectAll:->
    @inputUrl.setFocus()
    @inputUrl.selectAll()
<commit_msg>Take care shared vms for groups<commit_after>class NCopyUrlView extends JView

  constructor: ->
    super

    {path}      = @getData()
    hostname    = FSHelper.getVMNameFromPath path
    @publicPath = FSHelper.isPublicPath path

    @inputUrlLabel  = new KDLabelView
      cssClass      : 'public-url-label'
      title         : 'Public URL'
      click         : => @focusAndSelectAll()

    @inputUrl       = new KDInputView
      label         : @inputUrlLabel
      cssClass      : 'public-url-input'

    KD.getSingleton('vmController').fetchVMDomains hostname, (err, domains)=>
      if domains?.length > 0 and not err

        path  = FSHelper.plainPath path
        match = path.match ///home/(\w+)/Web/(.*)///
        return  unless match
        [rest..., user, pathrest] = match

        if /^shared-/.test hostname
          subdomain = unless user is KD.nick() then "" else "#{user}."
        else
          subdomain = ''

        @publicPath = "#{subdomain}#{domains.first}/#{pathrest}"
        @inputUrl.setValue "http://#{@publicPath}"

  focusAndSelectAll:->
    @inputUrl.setFocus()
    @inputUrl.selectAll()

{'fraction_non_alphanumeric': 0.12657589510842157, 'fraction_numerical': 0.0015128593040847202, 'mean_word_length': 2.2155591572123177, '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': '2892828', 'n_tokens_mistral': 620, 'n_tokens_neox': 609, 'n_words': 130}