mirror of
https://github.com/SuperBFG7/ympd
synced 2025-11-01 06:13:04 +00:00
Select tags for queue search
Queue toolbar improvements
This commit is contained in:
@@ -98,18 +98,23 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="btn-toolbar" id="queue-buttons" role="toolbar">
|
||||
<div id="trashmode" class="btn-group mr-2" data-toggle="radio">
|
||||
<button id="btntrashmodeup" type="button" class="btn btn-secondary" title="Delete upward">
|
||||
<span class="material-icons">vertical_align_top</span>
|
||||
<span class="material-icons">delete</span>
|
||||
</button>
|
||||
<button id="btntrashmodesingle" type="button" class="btn btn-success" title="Delete single">
|
||||
<span class="material-icons">delete</span>
|
||||
</button>
|
||||
<button id="btntrashmodedown" type="button" class="btn btn-secondary" title="Delete downward">
|
||||
<span class="material-icons">delete</span>
|
||||
<span class="material-icons">vertical_align_bottom</span>
|
||||
</button>
|
||||
<div id="trashmode" class="btn-group mr-2">
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown"><span class="material-icons">delete</span></button>
|
||||
<div class="dropdown-menu bg-dark px-2" id="trashmodebtns">
|
||||
<h6 class="dropdown-header text-light">Trashmode</h6>
|
||||
<button id="btntrashmodeup" type="button" class="btn btn-secondary btn-block">
|
||||
<span class="material-icons" style="float:left;">vertical_align_top</span>
|
||||
<span style="margin-left:1rem;">Delete upward</span>
|
||||
</button>
|
||||
<button id="btntrashmodesingle" type="button" class="btn btn-success btn-block">
|
||||
<span class="material-icons" style="float:left;">delete</span>
|
||||
<span style="margin-left:1rem;">Delete single</span>
|
||||
</button>
|
||||
<button id="btntrashmodedown" type="button" class="btn btn-secondary btn-block">
|
||||
<span class="material-icons" style="float:left;">vertical_align_bottom</span>
|
||||
<span style="margin-left:1rem;">Delete downward</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="queue-actions" class="btn-group mr-2">
|
||||
<button type="button" class="btn btn-secondary" onclick="socket.send('MPD_API_SEND_SHUFFLE');" title="Shuffle queue">
|
||||
@@ -122,8 +127,20 @@
|
||||
<span class="material-icons">save</span>
|
||||
</button>
|
||||
</div>
|
||||
<form id="searchqueue" role="search" class="btn btn-secondary">
|
||||
<input type="text" class="form-control" placeholder="Search"/>
|
||||
<form id="searchqueue" role="search">
|
||||
<div class="input-group mr-2">
|
||||
<input type="text" class="form-control" placeholder="Search Queue" id="searchqueuestr"/>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown"><span class="material-icons">search</span></button>
|
||||
<div class="dropdown-menu bg-dark dropdown-menu-right px-2" id="searchqueuetag">
|
||||
<h6 class="dropdown-header text-light">Search in Tag</h6>
|
||||
<button type="button" class="btn btn-success btn-block">Any Tag</button>
|
||||
<button type="button" class="btn btn-secondary btn-block">Title</button>
|
||||
<button type="button" class="btn btn-secondary btn-block">Artist</button>
|
||||
<button type="button" class="btn btn-secondary btn-block">Album</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -372,7 +389,7 @@
|
||||
|
||||
<script src="js/jquery-3.3.1.min.js"></script>
|
||||
<script src="js/js.cookie.js"></script>
|
||||
<script src="js/bootstrap.min.js"></script>
|
||||
<script src="js/bootstrap.bundle.min.js"></script>
|
||||
<script src="js/bootstrap-slider.min.js"></script>
|
||||
<script src="js/bootstrap-notify.min.js"></script>
|
||||
<script src="js/sammy.js"></script>
|
||||
|
||||
2529
htdocs/js/bootstrap.js → htdocs/js/bootstrap.bundle.js
vendored
2529
htdocs/js/bootstrap.js → htdocs/js/bootstrap.bundle.js
vendored
File diff suppressed because it is too large
Load Diff
1
htdocs/js/bootstrap.bundle.js.map
Normal file
1
htdocs/js/bootstrap.bundle.js.map
Normal file
File diff suppressed because one or more lines are too long
7
htdocs/js/bootstrap.bundle.min.js
vendored
Normal file
7
htdocs/js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
htdocs/js/bootstrap.bundle.min.js.map
Normal file
1
htdocs/js/bootstrap.bundle.min.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7
htdocs/js/bootstrap.min.js
vendored
7
htdocs/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -206,19 +206,21 @@ function webSocketConnect() {
|
||||
case 'queue':
|
||||
if(current_app !== 'queue')
|
||||
break;
|
||||
|
||||
if (obj.totalTime > 0) {
|
||||
$('#panel-heading-queue').empty();
|
||||
|
||||
if (obj.totalSongs > 0) {
|
||||
$('#panel-heading-queue').text(obj.totalSongs+' Songs');
|
||||
}
|
||||
if (typeof(obj.totalTime) != undefined && obj.totalTime > 0 ) {
|
||||
var days = Math.floor(obj.totalTime / 86400);
|
||||
var hours = Math.floor(obj.totalTime / 3600) - days * 24;
|
||||
var minutes = Math.floor(obj.totalTime / 60) - hours * 60 - days * 1440;
|
||||
var seconds = obj.totalTime - days * 86400 - hours * 3600 - minutes * 60;
|
||||
|
||||
$('#panel-heading-queue').text(obj.totalSongs+' Songs – ' +
|
||||
|
||||
$('#panel-heading-queue').append(' – ' +
|
||||
(days > 0 ? days + '\u2009d ' : '') +
|
||||
(hours > 0 ? hours + '\u2009h ' + (minutes < 10 ? '0' : '') : '') +
|
||||
minutes + '\u2009m ' + (seconds < 10 ? '0' : '') + seconds + '\u2009s');
|
||||
} else {
|
||||
$('#panel-heading-queue').empty();
|
||||
}
|
||||
|
||||
$('#queueList > tbody').empty();
|
||||
@@ -694,8 +696,8 @@ function toggleoutput(button, id) {
|
||||
socket.send("MPD_API_TOGGLE_OUTPUT,"+id+"," + ($(button).hasClass('btn-success') ? 0 : 1));
|
||||
}
|
||||
|
||||
$('#trashmode').children("button").on('click', function(e) {
|
||||
$('#trashmode').children("button").removeClass("btn-success").addClass('btn-secondary');
|
||||
$('#trashmodebtns > button').on('click', function(e) {
|
||||
$('#trashmodebtns').children("button").removeClass("btn-success").addClass('btn-secondary');
|
||||
$(this).removeClass("btn-secondary").addClass("btn-success");
|
||||
});
|
||||
|
||||
@@ -738,15 +740,30 @@ $('#search').submit(function () {
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#searchqueue > input').keyup(function (event) {
|
||||
var searchstr=$('#searchqueue > input').val();
|
||||
$('#searchqueuestr').keyup(function (event) {
|
||||
doQueueSearch();
|
||||
});
|
||||
|
||||
$('#searchqueuetag > button').on('click',function (e) {
|
||||
$('#searchqueuetag > button').removeClass('btn-success').addClass('btn-secondary');
|
||||
$(this).removeClass('btn-secondary').addClass('btn-success');
|
||||
doQueueSearch();
|
||||
});
|
||||
|
||||
function doQueueSearch() {
|
||||
var searchstr=$('#searchqueuestr').val();
|
||||
var mpdtag='Any Tag';
|
||||
$('#searchqueuetag > button').each(function() {
|
||||
if ($(this).hasClass('btn-success')) { mpdtag=$(this).text(); }
|
||||
});
|
||||
|
||||
if (searchstr.length >= 3) {
|
||||
socket.send('MPD_API_SEARCH_QUEUE,' + searchstr);
|
||||
socket.send('MPD_API_SEARCH_QUEUE,' + mpdtag + ',' + searchstr);
|
||||
}
|
||||
if (searchstr.length == 0) {
|
||||
socket.send('MPD_API_GET_QUEUE,0');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#searchqueue').submit(function () {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user