« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/ui.js b/ui.js
index f92d259..273f43d 100644
--- a/ui.js
+++ b/ui.js
@@ -120,7 +120,7 @@ class AppElement extends FocusElement {
     grouplikeListing.on('select (enter)', item => handleSelectFromMain(item))
     grouplikeListing.on('select (space)', item => this.handleSpacePressed(
       () => handleSelectFromMain(item)))
-    grouplikeListing.on('queue', item => this.queueGrouplikeItem(item))
+    grouplikeListing.on('queue (at end)', item => this.queueGrouplikeItem(item))
     grouplikeListing.on('queue (shuffled)', item => this.shuffleQueueGrouplikeItem(item))
     grouplikeListing.on('queue (play next)', item => this.queueGrouplikeItem(item, true, this.playingTrack))
     grouplikeListing.on('menu', (item, opts) => this.menu.show(opts))
@@ -771,7 +771,7 @@ class GrouplikeListingElement extends FocusElement {
     if (this.grouplike.items.length) {
       for (const item of this.grouplike.items) {
         const itemElement = new GrouplikeItemElement(item, this.recordStore)
-        for (const evtName of ['download', 'remove (backspace)', 'remove (x)', 'mark', 'select (space)', 'select (enter)', 'queue', 'queue (shuffled)', 'queue (play next)', 'menu']) {
+        for (const evtName of ['download', 'remove (backspace)', 'remove (x)', 'mark', 'select (space)', 'select (enter)', 'queue (at end)', 'queue (shuffled)', 'queue (play next)', 'menu']) {
           itemElement.on(evtName, (...data) => this.emit(evtName, item, ...data))
         }
         form.addInput(itemElement)
@@ -937,15 +937,13 @@ class GrouplikeItemElement extends Button {
   keyPressed(keyBuf) {
     if (telc.isCaselessLetter(keyBuf, 'd')) {
       this.emit('download')
-    } else if (telc.isCaselessLetter(keyBuf, 'q')) {
-      if (keyBuf[0] === 'q'.charCodeAt(0)) {
-        this.emit('queue')
+    } else if (telc.isCharacter(keyBuf, 'q')) {
+        this.emit('queue (at end)')
+    } else if (telc.isCharacter(keyBuf, 'Q')) {
+      if (isGroup(this.item)) {
+        this.emit('queue (shuffled)')
       } else {
-        if (isGroup(this.item)) {
-          this.emit('queue (shuffled)')
-        } else {
-          this.emit('queue (play next)')
-        }
+        this.emit('queue (play next)')
       }
     } else if (telc.isSpace(keyBuf)) {
       this.emit('select (space)')