<commit_before>class ActivityActionsView extends KDView

  constructor:->
    super

    activity = @getData()

    @commentLink  = new ActivityActionLink
      partial : "Comment"

    @commentCount = new ActivityCommentCount
      tooltip     :
        title     : "Show all"
      click       : (event)=>
        # event.preventDefault()
        @getDelegate().emit "CommentCountClicked", @
    , activity

    @shareLink    = new ActivityActionLink
      partial     : "Share"
      tooltip     :
        title     : "Coming Soon"
      click:(event)=>
        event.preventDefault()

    @likeView     = new LikeView {checkIfLikedBefore: no}, activity
    @loader       = new KDLoaderView size : width : 14

    unless KD.isLoggedIn()
      @commentLink.setTooltip title: "Login required"
      @likeView.likeLink.setTooltip title: "Login required"
      KD.getSingleton("mainController").on "accountChanged.to.loggedIn", =>
        delete @likeView.likeLink.tooltip
        delete @commentLink.tooltip

    @attachListeners()

  viewAppended:->

    @setClass "activity-actions"
    @setTemplate @pistachio()
    @template.update()
    @attachListeners()
    @loader.hide()

  pistachio:->

    """
    {{> @loader}}
    {{> @commentLink}}{{> @commentCount}} ·
    <span class='optional'>
    {{> @shareLink}} ·
    </span>
    {{> @likeView}}<commit_msg>share development<commit_after>class ActivityActionsView extends KDView

  constructor:->
    super

    activity = @getData()

    @commentLink  = new ActivityActionLink
      partial : "Comment"

    @commentCount = new ActivityCommentCount
      tooltip     :
        title     : "Show all"
      click       : (event)=>
        # event.preventDefault()
        @getDelegate().emit "CommentCountClicked", @
    , activity

    @shareLink    = new ActivityActionLink
      partial     : "Share"
      # tooltip     :
      #   title     : "Coming Soon"
      click:(event)=>
        shareUrl    = "http://kd.io/Activity/#{@getData().slug}"
        contextMenu = new JContextMenu
          menuWidth   : @getWidth()
          delegate    : @
          x           : @getX()
          y           : @getY() + 15
          arrow       :
            placement : "top"
            margin    : 75
          lazyLoad    : yes
        , customView  : new KDView partial: shareUrl

        KD.singletons.mainView.mainTabView.activePane.subViews[0].$().scroll =>
          contextMenu.setY @getY() + 15

        return
        shareModal = new KDModalViewWithForms
          title   : "You can share this link"
          content : """<a href="#{shareUrl}" id="share-dialog-link" target="share-dialog-link" class="hidden"></a>"""
          overlay : true
          tabs          :
            forms       :
              share     :
                fields  :
                  share :
                    type: "text"
                    defaultValue: shareUrl
                buttons :
                  "Share on Twitter":
                    callback: =>
                      shareText = "#{@getData().body} - #{shareUrl}"
                      window.open(
                        "https://twitter.com/intent/tweet?text=#{encodeURIComponent shareText}&via=koding&source=koding",
                        "twitter-share-dialog",
                        "width=500,height=350,left=#{Math.floor (screen.width/2) - (500/2)},top=#{Math.floor (screen.height/2) - (350/2)}"
                      )
                  "Open in new Tab":
                    callback: =>
                      shareModal.$("#share-dialog-link")[0].click()

        shareModal.modalTabs.forms.share.inputs.share.$().select()


    @likeView     = new LikeView {checkIfLikedBefore: no}, activity
    @loader       = new KDLoaderView size : width : 14

    unless KD.isLoggedIn()
      @commentLink.setTooltip title: "Login required"
      @likeView.likeLink.setTooltip title: "Login required"
      KD.getSingleton("mainController").on "accountChanged.to.loggedIn", =>
        delete @likeView.likeLink.tooltip
        delete @commentLink.tooltip

    @attachListeners()

  viewAppended:->

    @setClass "activity-actions"
    @setTemplate @pistachio()
    @template.update()
    @attachListeners()
    @loader.hide()

  pistachio:->

    """
    {{> @loader}}
    {{> @commentLink}}{{> @commentCount}} ·
    <span class='optional'>
    {{> @shareLink}} ·
    </span>
    {{> @likeView}}
{'fraction_non_alphanumeric': 0.12548131370328425, 'fraction_numerical': 0.0063420158550396375, 'mean_word_length': 1.875, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 34, 'https://': 1, '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': '7394038', 'n_tokens_mistral': 1291, 'n_tokens_neox': 1230, 'n_words': 249}