mirror of
https://github.com/SuperBFG7/ympd
synced 2024-11-10 16:19:54 +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-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<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">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form>
|
<form class="needs-validation" id="saveQueueFrm" novalidate>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="form-group col-md-9">
|
<div class="form-group col-md-9">
|
||||||
<label class="control-label" for="playlistname">Playlist Name</label>
|
<label class="control-label" for="saveQueueName">Playlist Name</label>
|
||||||
<input type="text" class="form-control" id="playlistname"/>
|
<input type="text" class="form-control" id="saveQueueName"/>
|
||||||
|
<div class="invalid-feedback">Invalid filename</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -1550,11 +1550,19 @@ function addStream() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function saveQueue() {
|
function saveQueue() {
|
||||||
var plName = document.getElementById('playlistname');
|
var plName = document.getElementById('saveQueueName');
|
||||||
if (plName.value != '')
|
var valid = plName.value.replace(/\w/g,'');
|
||||||
|
if (plName.value != '' && valid == '') {
|
||||||
sendAPI({"cmd":"MPD_API_SAVE_QUEUE", "data": {"plist": plName.value}});
|
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) {
|
function showNotification(notificationTitle,notificationText,notificationHtml,notificationType) {
|
||||||
|
Loading…
Reference in New Issue
Block a user