1
0
mirror of https://github.com/SuperBFG7/ympd synced 2025-10-26 03:17:40 +00:00

Feat: validation feedback for queue save

This commit is contained in:
jcorporation
2018-07-22 20:16:31 +01:00
parent 020c266788
commit 24eb8d8ef7
2 changed files with 17 additions and 8 deletions

View File

@@ -1550,11 +1550,19 @@ function addStream() {
}
function saveQueue() {
var plName = document.getElementById('playlistname');
if (plName.value != '')
var plName = document.getElementById('saveQueueName');
var valid = plName.value.replace(/\w/g,'');
if (plName.value != '' && valid == '') {
sendAPI({"cmd":"MPD_API_SAVE_QUEUE", "data": {"plist": plName.value}});
plName.value = '';
modalSavequeue.hide();
modalSavequeue.hide();
plName.value = '';
document.getElementById('saveQueueFrm').classList.remove('was-validated');
document.getElementById('saveQueueName').classList.remove('is-invalid');
}
else {
document.getElementById('saveQueueName').classList.add('is-invalid');
document.getElementById('saveQueueFrm').classList.add('was-validated');
}
}
function showNotification(notificationTitle,notificationText,notificationHtml,notificationType) {