mirror of
https://github.com/SuperBFG7/ympd
synced 2024-11-05 14:26:16 +00:00
Feat: validation feedback for queue save
This commit is contained in:
parent
020c266788
commit
24eb8d8ef7
@ -717,17 +717,18 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="savequeueLabel"><span class="material-icons title-icon">save</span> Save Queue</h5>
|
||||
<h5 class="modal-title"><span class="material-icons title-icon">save</span> Save Queue</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<form class="needs-validation" id="saveQueueFrm" novalidate>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-9">
|
||||
<label class="control-label" for="playlistname">Playlist Name</label>
|
||||
<input type="text" class="form-control" id="playlistname"/>
|
||||
<label class="control-label" for="saveQueueName">Playlist Name</label>
|
||||
<input type="text" class="form-control" id="saveQueueName"/>
|
||||
<div class="invalid-feedback">Invalid filename</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user