|
@@ -768,6 +768,46 @@
|
|
|
>
|
|
|
</template>
|
|
|
</floating-box>
|
|
|
+ <floating-box
|
|
|
+ id="keyboardShortcutsHelper"
|
|
|
+ ref="keyboardShortcutsHelper"
|
|
|
+ >
|
|
|
+ <template #body>
|
|
|
+ <div>
|
|
|
+ <div v-if="isOwnerOrAdmin()">
|
|
|
+ <span class="biggest"><b>Admin/owner</b></span>
|
|
|
+ <span><b>Ctrl + Space</b> - Pause/resume station</span>
|
|
|
+ <span><b>Ctrl + Numpad right</b> - Skip station</span>
|
|
|
+ </div>
|
|
|
+ <hr v-if="isOwnerOrAdmin()" />
|
|
|
+ <div>
|
|
|
+ <span class="biggest"><b>Volume</b></span>
|
|
|
+ <span
|
|
|
+ ><b>Ctrl + Numpad up/down</b> - Volume up/down
|
|
|
+ 10%</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ ><b>Ctrl + Shift + Numpad up/down</b> - Volume
|
|
|
+ up/down 10%</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <hr />
|
|
|
+ <div>
|
|
|
+ <span class="biggest"><b>Misc</b></span>
|
|
|
+ <span><b>Ctrl + D</b> - Toggles debug box</span>
|
|
|
+ <span><b>Ctrl + Shift + D</b> - Resets debug box</span>
|
|
|
+ <span
|
|
|
+ ><b>Ctrl + /</b> - Toggles keyboard shortcuts
|
|
|
+ box</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ ><b>Ctrl + Shift + /</b> - Resets keyboard shortcuts
|
|
|
+ box</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </floating-box>
|
|
|
|
|
|
<Z404 v-if="!exists"></Z404>
|
|
|
</div>
|
|
@@ -886,8 +926,12 @@ export default {
|
|
|
typeof this.currentSong.disliked === "boolean"
|
|
|
);
|
|
|
},
|
|
|
+ aModalIsOpen() {
|
|
|
+ return Object.keys(this.currentlyActive).length > 0;
|
|
|
+ },
|
|
|
...mapState("modalVisibility", {
|
|
|
- modals: state => state.modals
|
|
|
+ modals: state => state.modals,
|
|
|
+ currentlyActive: state => state.currentlyActive
|
|
|
}),
|
|
|
...mapState("modals/editSong", {
|
|
|
video: state => state.video
|
|
@@ -1597,6 +1641,7 @@ export default {
|
|
|
calculateTimeElapsed() {
|
|
|
if (
|
|
|
this.playerReady &&
|
|
|
+ !this.noSong &&
|
|
|
this.currentSong &&
|
|
|
this.player.getPlayerState() === -1
|
|
|
) {
|
|
@@ -1907,6 +1952,12 @@ export default {
|
|
|
resetPlayerDebugBox() {
|
|
|
this.$refs.playerDebugBox.resetBox();
|
|
|
},
|
|
|
+ toggleKeyboardShortcutsHelper() {
|
|
|
+ this.$refs.keyboardShortcutsHelper.toggleBox();
|
|
|
+ },
|
|
|
+ resetKeyboardShortcutsHelper() {
|
|
|
+ this.$refs.keyboardShortcutsHelper.resetBox();
|
|
|
+ },
|
|
|
join() {
|
|
|
this.socket.dispatch(
|
|
|
"stations.join",
|
|
@@ -2012,11 +2063,12 @@ export default {
|
|
|
keyboardShortcuts.registerShortcut(
|
|
|
"station.pauseResume",
|
|
|
{
|
|
|
- keyCode: 32,
|
|
|
+ keyCode: 32, // Spacebar
|
|
|
shift: false,
|
|
|
ctrl: true,
|
|
|
preventDefault: true,
|
|
|
handler: () => {
|
|
|
+ if (this.aModalIsOpen) return;
|
|
|
if (this.stationPaused)
|
|
|
this.resumeStation();
|
|
|
else this.pauseStation();
|
|
@@ -2027,11 +2079,12 @@ export default {
|
|
|
keyboardShortcuts.registerShortcut(
|
|
|
"station.skipStation",
|
|
|
{
|
|
|
- keyCode: 39,
|
|
|
+ keyCode: 39, // Right arrow key
|
|
|
shift: false,
|
|
|
ctrl: true,
|
|
|
preventDefault: true,
|
|
|
handler: () => {
|
|
|
+ if (this.aModalIsOpen) return;
|
|
|
this.skipStation();
|
|
|
}
|
|
|
}
|
|
@@ -2041,11 +2094,12 @@ export default {
|
|
|
keyboardShortcuts.registerShortcut(
|
|
|
"station.lowerVolumeLarge",
|
|
|
{
|
|
|
- keyCode: 40,
|
|
|
+ keyCode: 40, // Down arrow key
|
|
|
shift: false,
|
|
|
ctrl: true,
|
|
|
preventDefault: true,
|
|
|
handler: () => {
|
|
|
+ if (this.aModalIsOpen) return;
|
|
|
this.volumeSliderValue -= 1000;
|
|
|
this.changeVolume();
|
|
|
}
|
|
@@ -2055,11 +2109,12 @@ export default {
|
|
|
keyboardShortcuts.registerShortcut(
|
|
|
"station.lowerVolumeSmall",
|
|
|
{
|
|
|
- keyCode: 40,
|
|
|
+ keyCode: 40, // Down arrow key
|
|
|
shift: true,
|
|
|
ctrl: true,
|
|
|
preventDefault: true,
|
|
|
handler: () => {
|
|
|
+ if (this.aModalIsOpen) return;
|
|
|
this.volumeSliderValue -= 100;
|
|
|
this.changeVolume();
|
|
|
}
|
|
@@ -2069,11 +2124,12 @@ export default {
|
|
|
keyboardShortcuts.registerShortcut(
|
|
|
"station.increaseVolumeLarge",
|
|
|
{
|
|
|
- keyCode: 38,
|
|
|
+ keyCode: 38, // Up arrow key
|
|
|
shift: false,
|
|
|
ctrl: true,
|
|
|
preventDefault: true,
|
|
|
handler: () => {
|
|
|
+ if (this.aModalIsOpen) return;
|
|
|
this.volumeSliderValue += 1000;
|
|
|
this.changeVolume();
|
|
|
}
|
|
@@ -2083,11 +2139,12 @@ export default {
|
|
|
keyboardShortcuts.registerShortcut(
|
|
|
"station.increaseVolumeSmall",
|
|
|
{
|
|
|
- keyCode: 38,
|
|
|
+ keyCode: 38, // Up arrow key
|
|
|
shift: true,
|
|
|
ctrl: true,
|
|
|
preventDefault: true,
|
|
|
handler: () => {
|
|
|
+ if (this.aModalIsOpen) return;
|
|
|
this.volumeSliderValue += 100;
|
|
|
this.changeVolume();
|
|
|
}
|
|
@@ -2097,16 +2154,44 @@ export default {
|
|
|
keyboardShortcuts.registerShortcut(
|
|
|
"station.toggleDebug",
|
|
|
{
|
|
|
- keyCode: 68,
|
|
|
+ keyCode: 68, // D key
|
|
|
shift: false,
|
|
|
ctrl: true,
|
|
|
preventDefault: true,
|
|
|
handler: () => {
|
|
|
+ if (this.aModalIsOpen) return;
|
|
|
this.togglePlayerDebugBox();
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
|
|
|
+ keyboardShortcuts.registerShortcut(
|
|
|
+ "station.toggleKeyboardShortcutsHelper",
|
|
|
+ {
|
|
|
+ keyCode: 191, // '/' key
|
|
|
+ ctrl: true,
|
|
|
+ preventDefault: true,
|
|
|
+ handler: () => {
|
|
|
+ if (this.aModalIsOpen) return;
|
|
|
+ this.toggleKeyboardShortcutsHelper();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ keyboardShortcuts.registerShortcut(
|
|
|
+ "station.resetKeyboardShortcutsHelper",
|
|
|
+ {
|
|
|
+ keyCode: 191, // '/' key
|
|
|
+ ctrl: true,
|
|
|
+ shift: true,
|
|
|
+ preventDefault: true,
|
|
|
+ handler: () => {
|
|
|
+ if (this.aModalIsOpen) return;
|
|
|
+ this.resetKeyboardShortcutsHelper();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
// UNIX client time before ping
|
|
|
const beforePing = Date.now();
|
|
|
this.socket.dispatch("apis.ping", res => {
|