|
@@ -762,6 +762,46 @@
|
|
>
|
|
>
|
|
</template>
|
|
</template>
|
|
</floating-box>
|
|
</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>
|
|
<Z404 v-if="!exists"></Z404>
|
|
</div>
|
|
</div>
|
|
@@ -882,8 +922,12 @@ export default {
|
|
typeof this.currentSong.disliked === "boolean"
|
|
typeof this.currentSong.disliked === "boolean"
|
|
);
|
|
);
|
|
},
|
|
},
|
|
|
|
+ aModalIsOpen() {
|
|
|
|
+ return Object.keys(this.currentlyActive).length > 0;
|
|
|
|
+ },
|
|
...mapState("modalVisibility", {
|
|
...mapState("modalVisibility", {
|
|
- modals: state => state.modals
|
|
|
|
|
|
+ modals: state => state.modals,
|
|
|
|
+ currentlyActive: state => state.currentlyActive
|
|
}),
|
|
}),
|
|
...mapState("modals/editSong", {
|
|
...mapState("modals/editSong", {
|
|
video: state => state.video
|
|
video: state => state.video
|
|
@@ -1000,6 +1044,12 @@ export default {
|
|
);
|
|
);
|
|
|
|
|
|
this.socket.on("event:station.nextSong", res => {
|
|
this.socket.on("event:station.nextSong", res => {
|
|
|
|
+ const previousSong = this.currentSong.youtubeId
|
|
|
|
+ ? this.currentSong
|
|
|
|
+ : null;
|
|
|
|
+
|
|
|
|
+ this.updatePreviousSong(previousSong);
|
|
|
|
+
|
|
const { currentSong, startedAt, paused, timePaused } = res.data;
|
|
const { currentSong, startedAt, paused, timePaused } = res.data;
|
|
|
|
|
|
this.setCurrentSong({
|
|
this.setCurrentSong({
|
|
@@ -1904,6 +1954,12 @@ export default {
|
|
resetPlayerDebugBox() {
|
|
resetPlayerDebugBox() {
|
|
this.$refs.playerDebugBox.resetBox();
|
|
this.$refs.playerDebugBox.resetBox();
|
|
},
|
|
},
|
|
|
|
+ toggleKeyboardShortcutsHelper() {
|
|
|
|
+ this.$refs.keyboardShortcutsHelper.toggleBox();
|
|
|
|
+ },
|
|
|
|
+ resetKeyboardShortcutsHelper() {
|
|
|
|
+ this.$refs.keyboardShortcutsHelper.resetBox();
|
|
|
|
+ },
|
|
join() {
|
|
join() {
|
|
this.socket.dispatch(
|
|
this.socket.dispatch(
|
|
"stations.join",
|
|
"stations.join",
|
|
@@ -2009,11 +2065,12 @@ export default {
|
|
keyboardShortcuts.registerShortcut(
|
|
keyboardShortcuts.registerShortcut(
|
|
"station.pauseResume",
|
|
"station.pauseResume",
|
|
{
|
|
{
|
|
- keyCode: 32,
|
|
|
|
|
|
+ keyCode: 32, // Spacebar
|
|
shift: false,
|
|
shift: false,
|
|
ctrl: true,
|
|
ctrl: true,
|
|
preventDefault: true,
|
|
preventDefault: true,
|
|
handler: () => {
|
|
handler: () => {
|
|
|
|
+ if (this.aModalIsOpen) return;
|
|
if (this.stationPaused)
|
|
if (this.stationPaused)
|
|
this.resumeStation();
|
|
this.resumeStation();
|
|
else this.pauseStation();
|
|
else this.pauseStation();
|
|
@@ -2024,11 +2081,12 @@ export default {
|
|
keyboardShortcuts.registerShortcut(
|
|
keyboardShortcuts.registerShortcut(
|
|
"station.skipStation",
|
|
"station.skipStation",
|
|
{
|
|
{
|
|
- keyCode: 39,
|
|
|
|
|
|
+ keyCode: 39, // Right arrow key
|
|
shift: false,
|
|
shift: false,
|
|
ctrl: true,
|
|
ctrl: true,
|
|
preventDefault: true,
|
|
preventDefault: true,
|
|
handler: () => {
|
|
handler: () => {
|
|
|
|
+ if (this.aModalIsOpen) return;
|
|
this.skipStation();
|
|
this.skipStation();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2038,11 +2096,12 @@ export default {
|
|
keyboardShortcuts.registerShortcut(
|
|
keyboardShortcuts.registerShortcut(
|
|
"station.lowerVolumeLarge",
|
|
"station.lowerVolumeLarge",
|
|
{
|
|
{
|
|
- keyCode: 40,
|
|
|
|
|
|
+ keyCode: 40, // Down arrow key
|
|
shift: false,
|
|
shift: false,
|
|
ctrl: true,
|
|
ctrl: true,
|
|
preventDefault: true,
|
|
preventDefault: true,
|
|
handler: () => {
|
|
handler: () => {
|
|
|
|
+ if (this.aModalIsOpen) return;
|
|
this.volumeSliderValue -= 1000;
|
|
this.volumeSliderValue -= 1000;
|
|
this.changeVolume();
|
|
this.changeVolume();
|
|
}
|
|
}
|
|
@@ -2052,11 +2111,12 @@ export default {
|
|
keyboardShortcuts.registerShortcut(
|
|
keyboardShortcuts.registerShortcut(
|
|
"station.lowerVolumeSmall",
|
|
"station.lowerVolumeSmall",
|
|
{
|
|
{
|
|
- keyCode: 40,
|
|
|
|
|
|
+ keyCode: 40, // Down arrow key
|
|
shift: true,
|
|
shift: true,
|
|
ctrl: true,
|
|
ctrl: true,
|
|
preventDefault: true,
|
|
preventDefault: true,
|
|
handler: () => {
|
|
handler: () => {
|
|
|
|
+ if (this.aModalIsOpen) return;
|
|
this.volumeSliderValue -= 100;
|
|
this.volumeSliderValue -= 100;
|
|
this.changeVolume();
|
|
this.changeVolume();
|
|
}
|
|
}
|
|
@@ -2066,11 +2126,12 @@ export default {
|
|
keyboardShortcuts.registerShortcut(
|
|
keyboardShortcuts.registerShortcut(
|
|
"station.increaseVolumeLarge",
|
|
"station.increaseVolumeLarge",
|
|
{
|
|
{
|
|
- keyCode: 38,
|
|
|
|
|
|
+ keyCode: 38, // Up arrow key
|
|
shift: false,
|
|
shift: false,
|
|
ctrl: true,
|
|
ctrl: true,
|
|
preventDefault: true,
|
|
preventDefault: true,
|
|
handler: () => {
|
|
handler: () => {
|
|
|
|
+ if (this.aModalIsOpen) return;
|
|
this.volumeSliderValue += 1000;
|
|
this.volumeSliderValue += 1000;
|
|
this.changeVolume();
|
|
this.changeVolume();
|
|
}
|
|
}
|
|
@@ -2080,11 +2141,12 @@ export default {
|
|
keyboardShortcuts.registerShortcut(
|
|
keyboardShortcuts.registerShortcut(
|
|
"station.increaseVolumeSmall",
|
|
"station.increaseVolumeSmall",
|
|
{
|
|
{
|
|
- keyCode: 38,
|
|
|
|
|
|
+ keyCode: 38, // Up arrow key
|
|
shift: true,
|
|
shift: true,
|
|
ctrl: true,
|
|
ctrl: true,
|
|
preventDefault: true,
|
|
preventDefault: true,
|
|
handler: () => {
|
|
handler: () => {
|
|
|
|
+ if (this.aModalIsOpen) return;
|
|
this.volumeSliderValue += 100;
|
|
this.volumeSliderValue += 100;
|
|
this.changeVolume();
|
|
this.changeVolume();
|
|
}
|
|
}
|
|
@@ -2094,16 +2156,44 @@ export default {
|
|
keyboardShortcuts.registerShortcut(
|
|
keyboardShortcuts.registerShortcut(
|
|
"station.toggleDebug",
|
|
"station.toggleDebug",
|
|
{
|
|
{
|
|
- keyCode: 68,
|
|
|
|
|
|
+ keyCode: 68, // D key
|
|
shift: false,
|
|
shift: false,
|
|
ctrl: true,
|
|
ctrl: true,
|
|
preventDefault: true,
|
|
preventDefault: true,
|
|
handler: () => {
|
|
handler: () => {
|
|
|
|
+ if (this.aModalIsOpen) return;
|
|
this.togglePlayerDebugBox();
|
|
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
|
|
// UNIX client time before ping
|
|
const beforePing = Date.now();
|
|
const beforePing = Date.now();
|
|
this.socket.dispatch("apis.ping", res => {
|
|
this.socket.dispatch("apis.ping", res => {
|
|
@@ -2210,6 +2300,7 @@ export default {
|
|
"updateUserCount",
|
|
"updateUserCount",
|
|
"updateUsers",
|
|
"updateUsers",
|
|
"updateCurrentSong",
|
|
"updateCurrentSong",
|
|
|
|
+ "updatePreviousSong",
|
|
"updateNextSong",
|
|
"updateNextSong",
|
|
"updateSongsList",
|
|
"updateSongsList",
|
|
"repositionSongInList",
|
|
"repositionSongInList",
|