<commit_before>import * as yo from 'yo-yo'

export class SitePermsNavbarBtn {
  constructor() {
    this.isDropdownOpen = false
    this.protocolDescription = false
  }

  render() {
    if (!this.protocolDescription)
      return

    // render the dropdown if open
    var dropdownEl = ''
    if (this.isDropdownOpen) {
      dropdownEl = yo`<div class="toolbar-dropdown toolbar-site-perms-dropdown">
        <div class="perms">
          <div><strong>Site Permissions</strong></div>
          <div><span class="icon icon-mic"></span> Access your camera & microphone <a href="#" data-value="media">Blocked</a></div>
          <div><span class="icon icon-location"></span> Access your location <a href="#" data-value="geolocation">Blocked</a></div>
          <div><span class="icon icon-comment"></span> Create desktop notifications <a href="#" data-value="notifications">Blocked</a></div>
          <div><span class="icon icon-block"></span> Hide the mouse pointer <a href="#" data-value="pointerLock">Blocked</a></div>
          <div><span class="icon icon-resize-full"></span> Go full-screen <a href="#" data-value="fullscreen">Blocked</a></div>
        </div>
      </div>`
    }

    // render btn
    return yo`<div class="toolbar-site-perms">
      <button class="green" onclick=${this.onClickUpdates.bind(this)}>
        <span class="icon icon-network"></span> <small>${this.protocolDescription.label}</small>
      </button>
      ${dropdownEl}
    </div>`
  }

  updateActives() {
    Array.from(document.querySelectorAll('.toolbar-site-perms')).forEach(el => yo.update(el, this.render()))
  }

  onClickUpdates(e) {
    this.isDropdownOpen = !this.isDropdownOpen
    this.updateActives()
  }
}<commit_msg>disable mockup siteperms dropdown, till its functional<commit_after>import * as yo from 'yo-yo'

export class SitePermsNavbarBtn {
  constructor() {
    this.isDropdownOpen = false
    this.protocolDescription = false
  }

  render() {
    if (!this.protocolDescription)
      return

    // render the dropdown if open
    var dropdownEl = ''
    if (this.isDropdownOpen) {
      dropdownEl = yo`<div class="toolbar-dropdown toolbar-site-perms-dropdown">
        <div class="perms">
          <div><strong>Site Permissions</strong></div>
          <div><span class="icon icon-mic"></span> Access your camera & microphone <a href="#" data-value="media">Blocked</a></div>
          <div><span class="icon icon-location"></span> Access your location <a href="#" data-value="geolocation">Blocked</a></div>
          <div><span class="icon icon-comment"></span> Create desktop notifications <a href="#" data-value="notifications">Blocked</a></div>
          <div><span class="icon icon-block"></span> Hide the mouse pointer <a href="#" data-value="pointerLock">Blocked</a></div>
          <div><span class="icon icon-resize-full"></span> Go full-screen <a href="#" data-value="fullscreen">Blocked</a></div>
        </div>
      </div>`
    }

    // render btn
    return yo`<div class="toolbar-site-perms">
      <button class="green">
        <span class="icon icon-network"></span> <small>${this.protocolDescription.label}</small>
      </button>
      ${dropdownEl}
    </div>`
  }

  updateActives() {
    Array.from(document.querySelectorAll('.toolbar-site-perms')).forEach(el => yo.update(el, this.render()))
  }

  onClickUpdates(e) {
    this.isDropdownOpen = !this.isDropdownOpen
    this.updateActives()
  }
}
{'fraction_non_alphanumeric': 0.17040489367899797, 'fraction_numerical': 0.0, 'mean_word_length': 3.4138817480719794, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 97, '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': '962691', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1037, 'n_words': 215}