1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-11-21 12:44:49 +00:00

Merge branch 'filter'

This commit is contained in:
SuperBFG7 2018-06-03 12:06:07 +02:00
commit 6340dcde72

View File

@ -72,7 +72,7 @@ var app = $.sammy(function() {
pagination = parseInt(this.params['splat'][0]);
current_app = 'browse';
$('#breadcrump').removeClass('hide').empty().append("<li><a uri=\"\" onclick=\"set_filter('')\">root</a></li>");
$('#filter').removeClass('hide');
add_filter();
$('#salamisandwich').removeClass('hide').find("tr:gt(0)").remove();
$('#dirble_panel').addClass('hide');
socket.send('MPD_API_GET_BROWSE,'+pagination+','+(browsepath ? browsepath : "/"));
@ -200,8 +200,6 @@ $(document).ready(function(){
if ($.cookie("notification") === "true")
$('#btnnotify').addClass("active")
add_filter();
document.getElementById('player').addEventListener('stalled', function() {
if ( !document.getElementById('player').paused ) {
this.pause();
@ -403,7 +401,7 @@ function webSocketConnect() {
case 'directory':
var clazz = 'dir';
if (filter !== "") {
var first = obj.data[item].dir[0];
var first = basename(obj.data[item].dir)[0];
if (filter === "num" && isNaN(first)) {
clazz += ' hide';
} else if (filter >= "A" && filter <= "Z" && first.toUpperCase() !== filter) {
@ -1264,6 +1262,7 @@ function set_filter (c) {
}
function add_filter () {
$('#filter').empty();
$('#filter').append('&nbsp;<a onclick="set_filter(\'\')" href="#/browse/'+pagination+'/'+browsepath+'">All</a>');
$('#filter').append('&nbsp;<a id="fnum" onclick="set_filter(\'num\')" href="#/browse/'+pagination+'/'+browsepath+'">#</a>');
@ -1273,4 +1272,6 @@ function add_filter () {
}
$('#filter').append('&nbsp;<a id="fplist" onclick="set_filter(\'plist\')" href="#/browse/'+pagination+'/'+browsepath+'" class="glyphicon glyphicon-list"></a>');
$('#f' + filter).addClass('active');
$('#filter').removeClass('hide');
}