mirror of
https://github.com/SuperBFG7/ympd
synced 2025-10-25 10:58:00 +00:00
Feat: add config options for stickerusage and mixramp settings
This commit is contained in:
@@ -84,15 +84,17 @@
|
||||
<h4 id="currentArtist" data-href="{'cmd': 'artistClick', 'options': []}"></h4>
|
||||
<small>Album</small>
|
||||
<h4 id="currentAlbum"></h4>
|
||||
<small>Vote</small><br/>
|
||||
<div class="btn-group">
|
||||
<button id="btnVoteDown" data-href="{'cmd': 'voteSong', 'options': ['0']}" class="btn btn-sm btn-light material-icons">thumb_down</button>
|
||||
<button id="btnVoteUp" data-href="{'cmd': 'voteSong', 'options': ['2']}" class="btn btn-sm btn-light material-icons">thumb_up</button>
|
||||
<div class="stickers">
|
||||
<small>Vote</small><br/>
|
||||
<div class="btn-group">
|
||||
<button id="btnVoteDown" data-href="{'cmd': 'voteSong', 'options': ['0']}" class="btn btn-sm btn-light material-icons">thumb_down</button>
|
||||
<button id="btnVoteUp" data-href="{'cmd': 'voteSong', 'options': ['2']}" class="btn btn-sm btn-light material-icons">thumb_up</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer card-footer-playback">
|
||||
<div class="d-flex">
|
||||
<div class="d-flex align-items-center">
|
||||
<button data-href="{'cmd':'clickPlay','options':[]}" class="mr-1 ml-1 btn btn-light material-icons btnPlay progressBarPlay">pause</button>
|
||||
<input type="range" min="0" max="100" step="1" class="mr-1 ml-1 form-control-range flex-grow-1" id="progressBar">
|
||||
<div class="btn ml-1 mr-1" id="counter"> </div>
|
||||
@@ -673,7 +675,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row mixramp">
|
||||
<div class="form-group input-group col-md-6 border-secondary">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-secondary text-light border-secondary">Mixramp DB</div>
|
||||
@@ -798,11 +800,11 @@
|
||||
<tr data-name="genre"><th>Genre</th><td></td></tr>
|
||||
<tr data-name="date"><th>Date</th><td></td></tr>
|
||||
<tr data-name="uri"><th>Uri</th><td></td></tr>
|
||||
<tr><th colspan="2">Statistics</th></tr>
|
||||
<tr data-name="playCount"><th>Play count</th><td></td></tr>
|
||||
<tr data-name="skipCount"><th>Skip count</th><td></td></tr>
|
||||
<tr data-name="lastPlayed"><th>Last played</th><td></td></tr>
|
||||
<tr data-name="like"><th>Like</th><td></td></tr>
|
||||
<tr class="stickers"><th colspan="2">Statistics</th></tr>
|
||||
<tr class="stickers" data-name="playCount"><th>Play count</th><td></td></tr>
|
||||
<tr class="stickers" data-name="skipCount"><th>Skip count</th><td></td></tr>
|
||||
<tr class="stickers" data-name="lastPlayed"><th>Last played</th><td></td></tr>
|
||||
<tr class="stickers" data-name="like"><th>Like</th><td></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -500,6 +500,10 @@ function appInit() {
|
||||
|
||||
window.addEventListener('hashchange', appRoute, false);
|
||||
|
||||
window.addEventListener('focus', function() {
|
||||
sendAPI({"cmd":"MPD_API_GET_STATE"}, parseState);
|
||||
}, false);
|
||||
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.target.tagName == 'INPUT')
|
||||
return;
|
||||
@@ -799,6 +803,19 @@ function parseSettings(obj) {
|
||||
|
||||
toggleBtn('btnnotifyPage', obj.data.notificationPage);
|
||||
|
||||
var stickerEls = document.getElementsByClassName('stickers');
|
||||
var stickerEls_len = stickerEls.length;
|
||||
var displayStickers = obj.data.stickers == true ? '' : 'none';
|
||||
for (var i = 0; i < stickerEls_len; i++) {
|
||||
stickerEls[i].style.display = displayStickers;
|
||||
}
|
||||
|
||||
if (obj.data.mixramp == true) {
|
||||
document.getElementsByClassName('mixramp')[0].style.display = '';
|
||||
} else {
|
||||
document.getElementsByClassName('mixramp')[0].style.display = 'none';
|
||||
}
|
||||
|
||||
settings=obj.data;
|
||||
settings.mpdstream = 'http://';
|
||||
if (settings.mpdhost == '127.0.0.1' || settings.mpdhost == 'localhost')
|
||||
@@ -1372,11 +1389,15 @@ function replaceQueue(type, uri, name) {
|
||||
}
|
||||
|
||||
function songClick() {
|
||||
songDetails(domCache.currentTrack.getAttribute('data-uri'));
|
||||
var uri = domCache.currentTrack.getAttribute('data-uri')
|
||||
if (uri != '')
|
||||
songDetails(uri);
|
||||
}
|
||||
|
||||
function artistClick() {
|
||||
appGoto('Browse', 'Database', 'Album', '0/-/' + document.getElementById('currentArtist').innerText);
|
||||
var albumartist = document.getElementById('currentArtist').getAttribute('data-albumartist');
|
||||
if (albumartist != '')
|
||||
appGoto('Browse', 'Database', 'Album', '0/-/' + albumartist);
|
||||
}
|
||||
|
||||
function songDetails(uri) {
|
||||
@@ -1919,6 +1940,7 @@ function songChange(obj) {
|
||||
htmlNotification += obj.data.artist;
|
||||
pageTitle += obj.data.artist + ' - ';
|
||||
document.getElementById('currentArtist').innerText = obj.data.artist;
|
||||
document.getElementById('currentArtist').setAttribute('data-albumartist', obj.data.albumartist);
|
||||
} else {
|
||||
document.getElementById('currentArtist').innerText = '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user