<commit_before><template>
  <modal :show='show' @closed='closeModal'>
      <h1 slot='header'>Key Binds</h1>
      <ul slot="body">
        <li><kbd>j</kbd> — down</li>
        <li><kbd>k</kbd> — up</li>
        <li><kbd>l</kbd> — switch right list (wraps)</li>
        <li><kbd>h</kbd> — switch left list (wraps)</li>
        <li><kbd>a</kbd> — archive current item (or unarchive)</li>
        <li><kbd>#</kbd> — delete current item</li>
        <li><kbd>e</kbd> — edit current item</li>
        <li><kbd>/</kbd> — search</li>
        <li><kbd>?</kbd> — toggle help menu</li>
        <li><kbd>esc</kbd> — close current menu</li>
        <li><kbd>cmd/ctrl-c</kbd> or <kbd>y</kbd> — copy link to clipboard</li>
        <li><kbd>cmd/ctrl-v</kbd> — add link from clipboard</li>
      </ul>
  </modal>
</template>

<script>
  import modal from './modal.vue'

  export default {
    name: 'helpModal',
    props: {
      show: {
        type: Boolean,
        required: true,
      },
    },
    mounted () {
      this.$nextTick(function () {
        document.addEventListener('keydown', e => {
          const active_element = document.activeElement.tagName.toLowerCase()
          if (active_element === 'input') return

          const is_slash_key = e.keyCode === 191
          const is_question_mark = is_slash_key && e.shiftKey
          if (is_question_mark) {
            if (this.show) {
              this.closeModal()
            } else {
              this.showModal()
            }
          }
        })
      })
    },
    components: {
      modal,
    },
    methods: {
      closeModal () {
        this.$emit('closed')
      },
      showModal () {
        this.$emit('show')
      },
    },
  }
</script>

<style lang="scss">
kbd {
  background-color: #f7f7f7;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 0 0 2px #fff inset;
  color: #333;
  display: inline-block;
  font-family: sans-serif;
  font-size: 11px;
  line-height: 1.4;
  margin: 0 .1em;
  padding: .1em .6em;
  text-shadow: 0 1px 0 #fff;
}
</style>
<commit_msg>Minor tweak to helpModal cmd and ctrl<commit_after><template>
  <modal :show='show' @closed='closeModal'>
      <h1 slot='header'>Key Binds</h1>
      <ul slot="body">
        <li><kbd>j</kbd> — down</li>
        <li><kbd>k</kbd> — up</li>
        <li><kbd>l</kbd> — switch right list (wraps)</li>
        <li><kbd>h</kbd> — switch left list (wraps)</li>
        <li><kbd>a</kbd> — archive current item (or unarchive)</li>
        <li><kbd>#</kbd> — delete current item</li>
        <li><kbd>e</kbd> — edit current item</li>
        <li><kbd>/</kbd> — search</li>
        <li><kbd>?</kbd> — toggle help menu</li>
        <li><kbd>esc</kbd> — close current menu</li>
        <li><kbd>{{ super_key }}-c</kbd> or <kbd>y</kbd> — copy link to clipboard</li>
        <li><kbd>{{ super_key }}-v</kbd> — add link from clipboard</li>
      </ul>
  </modal>
</template>

<script>
  import modal from './modal.vue'

  export default {
    name: 'helpModal',
    props: {
      show: {
        type: Boolean,
        required: true,
      },
    },
    mounted () {
      this.$nextTick(function () {
        document.addEventListener('keydown', e => {
          const active_element = document.activeElement.tagName.toLowerCase()
          if (active_element === 'input') return

          const is_slash_key = e.keyCode === 191
          const is_question_mark = is_slash_key && e.shiftKey
          if (is_question_mark) {
            if (this.show) {
              this.closeModal()
            } else {
              this.showModal()
            }
          }
        })
      })
    },
    components: {
      modal,
    },
    methods: {
      closeModal () {
        this.$emit('closed')
      },
      showModal () {
        this.$emit('show')
      },
    },
    computed: {
      super_key () {
        const is_mac = navigator.platform.toUpperCase().indexOf('MAC') > -1
        return is_mac ? 'cmd' : 'ctrl'
      },
    },
  }
</script>

<style lang="scss">
kbd {
  background-color: #f7f7f7;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 0 0 2px #fff inset;
  color: #333;
  display: inline-block;
  font-family: sans-serif;
  font-size: 11px;
  line-height: 1.4;
  margin: 0 .1em;
  padding: .1em .6em;
  text-shadow: 0 1px 0 #fff;
}
</style>

{'fraction_non_alphanumeric': 0.17519415258108725, 'fraction_numerical': 0.016217450890817726, 'mean_word_length': 2.0325484764542936, 'pattern_counts': {'":': 0, '<': 127, '<?xml version=': 0, '>': 130, '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': '4376960', 'n_tokens_mistral': 1627, 'n_tokens_neox': 1574, 'n_words': 360}