mirror of
https://github.com/SuperBFG7/ympd
synced 2025-11-07 09:03:00 +00:00
add settings modal dialog
This commit is contained in:
@@ -311,6 +311,10 @@ function webSocketConnect() {
|
||||
type: "info",
|
||||
}).show();
|
||||
|
||||
break;
|
||||
case "mpdhost":
|
||||
$('#mpdhost').val(obj.data.host);
|
||||
$('#mpdport').val(obj.data.port);
|
||||
break;
|
||||
case "error":
|
||||
$('.top-right').notify({
|
||||
@@ -452,6 +456,23 @@ function getVersion()
|
||||
});
|
||||
}
|
||||
|
||||
function getHost() {
|
||||
socket.send('MPD_API_GET_MPDHOST');
|
||||
|
||||
function onEnter(event) {
|
||||
if ( event.which == 13 )
|
||||
setHost();
|
||||
$('#settings').modal('hide');
|
||||
}
|
||||
|
||||
$('#mpdhost').keypress(onEnter);
|
||||
$('#mpdport').keypress(onEnter);
|
||||
}
|
||||
|
||||
function setHost() {
|
||||
socket.send('MPD_API_SET_MPDHOST,'+$('#mpdport').val()+','+$('#mpdhost').val());
|
||||
}
|
||||
|
||||
function notificationsSupported() {
|
||||
return "webkitNotifications" in window;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user