1
0
mirror of https://github.com/SuperBFG7/ympd synced 2025-12-18 03:48:14 +00:00

Merge branch 'send-message' of https://github.com/SuperBFG7/ympd into SuperBFG7-send-message

This commit is contained in:
Andrew Karpow
2018-01-22 04:50:22 +01:00
4 changed files with 38 additions and 0 deletions

View File

@@ -517,6 +517,8 @@ function webSocketConnect() {
$('#album').text("");
$('#artist').text("");
$('#btnlove').removeClass("active");
$('#currenttrack').text(" " + obj.data.title);
var notification = "<strong><h4>" + obj.data.title + "</h4></strong>";
@@ -679,6 +681,14 @@ function basename(path) {
return path.split('/').reverse()[0];
}
function clickLove() {
socket.send("MPD_API_SEND_MESSAGE,mpdas," + ($('#btnlove').hasClass('active') ? "unlove" : "love"));
if ( $('#btnlove').hasClass('active') )
$('#btnlove').removeClass("active");
else
$('#btnlove').addClass("active");
}
$('#btnrandom').on('click', function (e) {
socket.send("MPD_API_TOGGLE_RANDOM," + ($(this).hasClass('active') ? 0 : 1));