1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-11-22 21:07:18 +00:00

Minor formatting

This commit is contained in:
eb041592 2018-02-04 01:11:41 +01:00
parent 2e9d477ee6
commit 037e7db1da
2 changed files with 18 additions and 18 deletions

View File

@ -152,7 +152,7 @@
</ul> </ul>
</div><!-- /.col-md-10 --> </div><!-- /.col-md-10 -->
<div class="col-md-2 col-xs-12" > <div class="col-md-2 col-xs-12">
<div class="btn-toolbar"> <div class="btn-toolbar">
<div class="btn-group-vertical btn-block btn-group-lg" data-toggle="buttons"> <div class="btn-group-vertical btn-block btn-group-lg" data-toggle="buttons">
<button id="btnrandom" type="button" class="btn btn-default"> <button id="btnrandom" type="button" class="btn btn-default">

View File

@ -227,7 +227,7 @@ function webSocketConnect() {
var obj = JSON.parse(msg.data); var obj = JSON.parse(msg.data);
switch (obj.type) { switch (obj.type) {
case "queue": case 'queue':
if(current_app !== 'queue') if(current_app !== 'queue')
break; break;
@ -304,9 +304,9 @@ function webSocketConnect() {
stop: function(event,ui) {renumber_table('#salamisandwich',ui.item)} stop: function(event,ui) {renumber_table('#salamisandwich',ui.item)}
}).disableSelection(); }).disableSelection();
break; break;
case "search": case 'search':
$('#wait').modal('hide'); $('#wait').modal('hide');
case "browse": case 'browse':
if(current_app !== 'browse' && current_app !== 'search') if(current_app !== 'browse' && current_app !== 'search')
break; break;
@ -319,7 +319,7 @@ function webSocketConnect() {
} }
for (var item in obj.data) { for (var item in obj.data) {
switch(obj.data[item].type) { switch(obj.data[item].type) {
case "directory": case 'directory':
var clazz = 'dir'; var clazz = 'dir';
if (filter !== undefined) { if (filter !== undefined) {
var first = obj.data[item].dir[0]; var first = obj.data[item].dir[0];
@ -338,7 +338,7 @@ function webSocketConnect() {
"<td></td><td></td></tr>" "<td></td><td></td></tr>"
); );
break; break;
case "playlist": case 'playlist':
var clazz = 'plist'; var clazz = 'plist';
if (filter !== "||") { if (filter !== "||") {
clazz += ' hide'; clazz += ' hide';
@ -350,7 +350,7 @@ function webSocketConnect() {
"<td></td><td></td></tr>" "<td></td><td></td></tr>"
); );
break; break;
case "song": case 'song':
var minutes = Math.floor(obj.data[item].duration / 60); var minutes = Math.floor(obj.data[item].duration / 60);
var seconds = obj.data[item].duration - minutes * 60; var seconds = obj.data[item].duration - minutes * 60;
@ -362,7 +362,7 @@ function webSocketConnect() {
"</td><td></td></tr>" "</td><td></td></tr>"
); );
break; break;
case "wrap": case 'wrap':
if(current_app == 'browse') { if(current_app == 'browse') {
$('#next').removeClass('hide'); $('#next').removeClass('hide');
} else { } else {
@ -440,7 +440,7 @@ function webSocketConnect() {
}); });
break; break;
case "state": case 'state':
updatePlayIcon(obj.data.state); updatePlayIcon(obj.data.state);
updateVolumeIcon(obj.data.volume); updateVolumeIcon(obj.data.volume);
@ -494,7 +494,7 @@ function webSocketConnect() {
last_state = obj; last_state = obj;
break; break;
case "outputnames": case 'outputnames':
$('#btn-outputs-block button').remove(); $('#btn-outputs-block button').remove();
if (obj.data.length > 1) { if (obj.data.length > 1) {
$.each(obj.data, function(id, name){ $.each(obj.data, function(id, name){
@ -502,12 +502,12 @@ function webSocketConnect() {
btn.appendTo($('#btn-outputs-block')); btn.appendTo($('#btn-outputs-block'));
}); });
} else { } else {
$('#btn-outputs-block').removeClass('btn-group-vertical'); $('#btn-outputs-block').addClass('hide');
} }
/* remove cache, since the buttons have been recreated */ /* remove cache, since the buttons have been recreated */
last_outputs = ''; last_outputs = '';
break; break;
case "outputs": case 'outputs':
if(JSON.stringify(obj) === JSON.stringify(last_outputs)) if(JSON.stringify(obj) === JSON.stringify(last_outputs))
break; break;
$.each(obj.data, function(id, enabled){ $.each(obj.data, function(id, enabled){
@ -518,7 +518,7 @@ function webSocketConnect() {
}); });
last_outputs = obj; last_outputs = obj;
break; break;
case "disconnected": case 'disconnected':
if($('.top-right').has('div').length == 0) if($('.top-right').has('div').length == 0)
$('.top-right').notify({ $('.top-right').notify({
message:{text:"ympd lost connection to MPD "}, message:{text:"ympd lost connection to MPD "},
@ -526,11 +526,11 @@ function webSocketConnect() {
fadeOut: { enabled: true, delay: 1000 }, fadeOut: { enabled: true, delay: 1000 },
}).show(); }).show();
break; break;
case "update_queue": case 'update_queue':
if(current_app === 'queue') if(current_app === 'queue')
socket.send('MPD_API_GET_QUEUE,'+pagination); socket.send('MPD_API_GET_QUEUE,'+pagination);
break; break;
case "song_change": case 'song_change':
$('#album').text(""); $('#album').text("");
$('#artist').text(""); $('#artist').text("");
@ -558,13 +558,13 @@ function webSocketConnect() {
}).show(); }).show();
break; break;
case "mpdhost": case 'mpdhost':
$('#mpdhost').val(obj.data.host); $('#mpdhost').val(obj.data.host);
$('#mpdport').val(obj.data.port); $('#mpdport').val(obj.data.port);
if(obj.data.passwort_set) if(obj.data.passwort_set)
$('#mpd_password_set').removeClass('hide'); $('#mpd_password_set').removeClass('hide');
break; break;
case "dirbleapitoken": case 'dirbleapitoken':
dirble_api_token = obj.data; dirble_api_token = obj.data;
if(dirble_stations) { if(dirble_stations) {
@ -573,7 +573,7 @@ function webSocketConnect() {
dirble_load_categories(); dirble_load_categories();
} }
break; break;
case "error": case 'error':
$('.top-right').notify({ $('.top-right').notify({
message:{text: obj.data}, message:{text: obj.data},
type: "danger", type: "danger",