<commit_before>'use strict'

let Message = require('./message')

class BottomPanel extends HTMLElement{
  prepare(){
    // priority because of https://github.com/AtomLinter/Linter/issues/668
    this.panel = atom.workspace.addBottomPanel({item: this, visible: true, priority: 500})
    return this
  }
  destroy(){
    this.panel.destroy()
  }
  set panelVisibility(value){
    if(value) this.panel.show()
    else this.panel.hide()
  }
  set visibility(value){
    if(value){
      this.removeAttribute('hidden')
    } else {
      this.setAttribute('hidden', true)
    }
  }
  updateMessages(messages, isProject){
    this.clear()
    if(!messages.length){
      return this.visibility = false
    }
    this.visibility = true
    messages.forEach(function(message){
      this.appendChild(Message.fromMessage(message, {addPath: isProject, cloneNode: true}))
    }.bind(this))<commit_msg>:bug: Add BottomPanel::get visibility<commit_after>'use strict'

let Message = require('./message')

class BottomPanel extends HTMLElement{
  prepare(){
    // priority because of https://github.com/AtomLinter/Linter/issues/668
    this.panel = atom.workspace.addBottomPanel({item: this, visible: true, priority: 500})
    return this
  }
  destroy(){
    this.panel.destroy()
  }
  set panelVisibility(value){
    if(value) this.panel.show()
    else this.panel.hide()
  }
  get visibility(){
    return this._visibility
  }
  set visibility(value){
    this._visibility = value
    if(value){
      this.removeAttribute('hidden')
    } else {
      this.setAttribute('hidden', true)
    }
  }
  updateMessages(messages, isProject){
    this.clear()
    if(!messages.length){
      return this.visibility = false
    }
    this.visibility = true
    messages.forEach(function(message){
      this.appendChild(Message.fromMessage(message, {addPath: isProject, cloneNode: true}))
    }.bind(this))
{'fraction_non_alphanumeric': 0.13513513513513514, 'fraction_numerical': 0.006359300476947536, 'mean_word_length': 3.431924882629108, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6686583', 'n_tokens_mistral': 580, 'n_tokens_neox': 562, 'n_words': 116}