<commit_before>class IDE.ChatParticipantView extends JView

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

    options.cssClass = 'participant-view'

    super options, data

    {@isInSession} = options

    @createElements()


  createElements: ->

    { isOnline, @isWatching } = @getOptions()
    { account, channel }      = @getData()
    { nickname }              = account.profile

    if isOnline then @setClass 'online' else @setClass 'offline'

    @avatar    = new AvatarView
      origin   : nickname
      size     : width: 32, height: 32

    @name = new KDCustomHTMLView
      cssClass : 'name'
      partial  : nickname

    @kickButton = new KDCustomHTMLView cssClass: 'hidden'

    unless @isInSession
      @kickButton  = new KDButtonView
        title    : 'KICK'
        cssClass : 'kick-button'
        callback : @bound 'kickParticipant'

    @watchButton = new KDButtonView
      iconOnly : 'yes'
      cssClass : 'watch-button'
      callback : =>
        methodName  = if @isWatching then 'unwatchParticipant' else 'watchParticipant'
        @isWatching = not @isWatching

        @watchButton.toggleClass 'watching'<commit_msg>ChatParticipantView: Better property naming to avoid confusion.<commit_after>class IDE.ChatParticipantView extends JView

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

    options.cssClass = 'participant-view'

    super options, data

    @createElements()


  createElements: ->

    { isOnline, @isWatching, @isInSession } = @getOptions()
    { account, channel } = @getData()
    { nickname }         = account.profile

    @amIHost = not @isInSession

    if isOnline then @setClass 'online' else @setClass 'offline'

    @avatar    = new AvatarView
      origin   : nickname
      size     : width: 32, height: 32

    @name = new KDCustomHTMLView
      cssClass : 'name'
      partial  : nickname

    @kickButton = new KDCustomHTMLView cssClass: 'hidden'

    if @amIHost
      @kickButton  = new KDButtonView
        title    : 'KICK'
        cssClass : 'kick-button'
        callback : @bound 'kickParticipant'

    @watchButton = new KDButtonView
      iconOnly : 'yes'
      cssClass : 'watch-button'
      callback : =>
        methodName  = if @isWatching then 'unwatchParticipant' else 'watchParticipant'
        @isWatching = not @isWatching

        @watchButton.toggleClass 'watching'
{'fraction_non_alphanumeric': 0.09603072983354674, 'fraction_numerical': 0.0034144259496372174, 'mean_word_length': 2.5840978593272173, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5706218', 'n_tokens_mistral': 748, 'n_tokens_neox': 676, 'n_words': 179}