2015-12-13 04:42:28 +00:00
|
|
|
<template>
|
2016-06-25 16:05:24 +00:00
|
|
|
<section id="queueWrapper">
|
|
|
|
<h1 class="heading">
|
|
|
|
<span title="That's a freaking lot of U's and E's">Current Queue
|
2016-11-17 08:37:12 +00:00
|
|
|
<controls-toggler :showing-controls="showingControls" @toggleControls="toggleControls"/>
|
2016-06-25 16:05:24 +00:00
|
|
|
|
|
|
|
<span class="meta" v-show="meta.songCount">
|
|
|
|
{{ meta.songCount | pluralize('song') }}
|
|
|
|
•
|
|
|
|
{{ meta.totalLength }}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
|
2016-11-17 07:07:12 +00:00
|
|
|
<song-list-controls
|
2016-11-17 08:37:12 +00:00
|
|
|
v-show="state.songs.length && (!isPhone || showingControls)"
|
2016-11-17 07:07:12 +00:00
|
|
|
@shuffleAll="shuffleAll"
|
|
|
|
@shuffleSelected="shuffleSelected"
|
|
|
|
@clearQueue="clearQueue"
|
|
|
|
:config="songListControlConfig"
|
|
|
|
:selectedSongs="selectedSongs"
|
|
|
|
/>
|
2016-06-25 16:05:24 +00:00
|
|
|
</h1>
|
|
|
|
|
2016-10-31 04:28:12 +00:00
|
|
|
<song-list v-show="state.songs.length" :items="state.songs" :sortable="false" type="queue"/>
|
2016-06-25 16:05:24 +00:00
|
|
|
|
|
|
|
<div v-show="!state.songs.length" class="none">
|
|
|
|
<p>Empty spaces. Abandoned places.</p>
|
|
|
|
|
|
|
|
<p v-if="showShufflingAllOption">How about
|
|
|
|
<a class="start" @click.prevent="shuffleAll">shuffling all songs</a>?
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</section>
|
2015-12-13 04:42:28 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2016-11-26 03:25:35 +00:00
|
|
|
import { pluralize } from '../../../utils'
|
|
|
|
import { queueStore, songStore } from '../../../stores'
|
|
|
|
import { playback } from '../../../services'
|
|
|
|
import hasSongList from '../../../mixins/has-song-list'
|
2016-06-25 16:05:24 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'main-wrapper--main-content--queue',
|
|
|
|
mixins: [hasSongList],
|
|
|
|
filters: { pluralize },
|
|
|
|
|
2016-11-26 03:25:35 +00:00
|
|
|
data () {
|
2016-06-25 16:05:24 +00:00
|
|
|
return {
|
|
|
|
state: queueStore.state,
|
2016-11-17 07:07:12 +00:00
|
|
|
songListControlConfig: {
|
2016-11-26 03:25:35 +00:00
|
|
|
clearQueue: true
|
2016-11-17 07:07:12 +00:00
|
|
|
}
|
2016-11-26 03:25:35 +00:00
|
|
|
}
|
2016-06-25 16:05:24 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
/**
|
2016-09-23 10:03:33 +00:00
|
|
|
* Determine if we should display a "Shuffle All" link.
|
2016-06-25 16:05:24 +00:00
|
|
|
*/
|
2016-11-26 03:25:35 +00:00
|
|
|
showShufflingAllOption () {
|
|
|
|
return songStore.all.length
|
|
|
|
}
|
2016-06-25 16:05:24 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
/**
|
|
|
|
* Shuffle all songs we have.
|
2016-11-17 07:07:12 +00:00
|
|
|
* Overriding the mixin.
|
2016-06-25 16:05:24 +00:00
|
|
|
*/
|
2016-11-26 03:25:35 +00:00
|
|
|
shuffleAll () {
|
|
|
|
playback.queueAndPlay(this.state.songs.length ? this.state.songs : songStore.all, true)
|
2016-06-25 16:05:24 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear the queue.
|
|
|
|
*/
|
2016-11-26 03:25:35 +00:00
|
|
|
clearQueue () {
|
|
|
|
queueStore.clear()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-12-13 04:42:28 +00:00
|
|
|
</script>
|
|
|
|
|
2017-02-14 06:53:02 +00:00
|
|
|
<style lang="scss">
|
2016-06-25 16:05:24 +00:00
|
|
|
@import "../../../../sass/partials/_vars.scss";
|
|
|
|
@import "../../../../sass/partials/_mixins.scss";
|
2015-12-13 04:42:28 +00:00
|
|
|
|
2016-06-25 16:05:24 +00:00
|
|
|
#queueWrapper {
|
|
|
|
.none {
|
|
|
|
color: $color2ndText;
|
|
|
|
padding: 16px 24px;
|
2015-12-13 04:42:28 +00:00
|
|
|
|
2016-06-25 16:05:24 +00:00
|
|
|
a {
|
|
|
|
color: $colorHighlight;
|
|
|
|
}
|
|
|
|
}
|
2015-12-13 04:42:28 +00:00
|
|
|
|
2016-06-25 16:05:24 +00:00
|
|
|
button.play-shuffle {
|
|
|
|
i {
|
|
|
|
margin-right: 0 !important;
|
2015-12-13 04:42:28 +00:00
|
|
|
}
|
2016-06-25 16:05:24 +00:00
|
|
|
}
|
|
|
|
}
|
2015-12-13 04:42:28 +00:00
|
|
|
</style>
|