Skip to content
Snippets Groups Projects
ShortcutsModal.vue 3.1 KiB
Newer Older
  • Learn to ignore specific revisions
  • <template>
      <modal @update:show="$emit('update:show', $event)" :show="show">
        <header class="header">
    
    jovuit's avatar
    jovuit committed
          <translate translate-context="*/*/*/Noun">Keyboard shortcuts</translate>
    
            class="ui compact collapsing basic table"
    
            v-for="section in sections"
            :key="section.title">
          <caption>{{ section.title }}</caption>
          <tbody>
            <tr v-for="shortcut in section.shortcuts" :key="shortcut.summary">
              <td>{{ shortcut.summary }}</td>
              <td><span class="ui label">{{ shortcut.key }}</span></td>
            </tr>
          </tbody>
          </table>
        </section>
        <footer class="actions">
    
          <div class="ui cancel button"><translate translate-context="Popup/Keyboard shortcuts/Button.Label/Verb">Close</translate></div>
    
        </footer>
      </modal>
    </template>
    
    <script>
    import Modal from '@/components/semantic/Modal'
    
    export default {
      props: ['show'],
      components: {
        Modal,
      },
      computed: {
        sections () {
          return [
            {
    
    jovuit's avatar
    jovuit committed
              title: this.$pgettext('Popup/Keyboard shortcuts/Title', 'General shortcuts'),
    
    jovuit's avatar
    jovuit committed
                  summary: this.$pgettext('Popup/Keyboard shortcuts/Table.Label/Verb', 'Show available keyboard shortcuts')
    
                }
              ]
            },
            // space.prevent.exact="togglePlay"
            // ctrl.left.prevent.exact="previous"
            // ctrl.right.prevent.exact="next"
            // ctrl.down.prevent.exact="$store.commit('player/incrementVolume', -0.1)"
            // ctrl.up.prevent.exact="$store.commit('player/incrementVolume', 0.1)"
            // l.prevent.exact="$store.commit('player/toggleLooping')"
            // s.prevent.exact="shuffle"
    
            {
    
    jovuit's avatar
    jovuit committed
              title: this.$pgettext('Popup/Keyboard shortcuts/Title', 'Audio player shortcuts'),
    
    jovuit's avatar
    jovuit committed
                  summary: this.$pgettext('Popup/Keyboard shortcuts/Table.Label/Verb', 'Pause/play the current track')
    
    jovuit's avatar
    jovuit committed
                  summary: this.$pgettext('Popup/Keyboard shortcuts/Table.Label/Verb', 'Play previous track')
    
    jovuit's avatar
    jovuit committed
                  summary: this.$pgettext('Popup/Keyboard shortcuts/Table.Label/Verb', 'Play next track')
    
    jovuit's avatar
    jovuit committed
                  summary: this.$pgettext('Popup/Keyboard shortcuts/Table.Label/Verb', 'Increase volume')
    
    jovuit's avatar
    jovuit committed
                  summary: this.$pgettext('Popup/Keyboard shortcuts/Table.Label/Verb', 'Decrease volume')
    
    jovuit's avatar
    jovuit committed
                  summary: this.$pgettext('Popup/Keyboard shortcuts/Table.Label/Verb', 'Toggle queue looping')
    
    jovuit's avatar
    jovuit committed
                  summary: this.$pgettext('Popup/Keyboard shortcuts/Table.Label/Verb', 'Shuffle queue')
    
                },
              ]
            }
          ]
        }
      }
    }
    </script>
    
    <!-- Add "scoped" attribute to limit CSS to this component only -->
    <style scoped>
    </style>