diff --git a/html/projet_detail.html b/html/projet_detail.html index 82b3308..7377786 100644 --- a/html/projet_detail.html +++ b/html/projet_detail.html @@ -33,16 +33,16 @@

- +
- +

@@ -114,9 +114,6 @@ See all images - @@ -130,7 +127,7 @@
diff --git a/index.html b/index.html index 1794906..d9145ce 100644 --- a/index.html +++ b/index.html @@ -31,7 +31,7 @@ diff --git a/js/projet_detail.js b/js/projet_detail.js index 4e06a2d..f7160e6 100644 --- a/js/projet_detail.js +++ b/js/projet_detail.js @@ -110,17 +110,18 @@ document.addEventListener("DOMContentLoaded", async () => { const nameVideo = document.getElementById('name').value; const videoDuration = durationInput.value; - if (videoDuration > 0) { - if (checkVideoPath(data, nameVideo)) { - alert('Nouvelle vidéo enregistrée :\nNom : ' + nameVideo + - '\nRésolution : ' + document.getElementById('resolution').value + - '\nDurée : ' + videoDuration + ' secondes'); - } else { - alert('Le nom : "' + nameVideo + '" est déjà pris ! \n' + - 'veuillez en trouver un autre'); - } - } else { + if (videoDuration <= 0) { alert('La durée de la vidéo doit être supérieur à 0'); + return 0; + } + if (checkVideoPath(data, nameVideo) && nameVideo.length>0) { + alert('Nouvelle vidéo enregistrée :\nNom : ' + nameVideo + + '\nRésolution : ' + document.getElementById('resolution').value + + '\nDurée : ' + videoDuration + ' secondes'); + } else { + alert('Le nom : " ' + nameVideo + ' " est déjà pris ou vide ! \n' + + 'veuillez en trouver un autre'); + return 0; } } @@ -256,5 +257,5 @@ async function generateViewMetric(projectId) { }, }, }, - }); -} + }) +} \ No newline at end of file