From b46d60a685aadfd12451450b8165b24785ff87ea Mon Sep 17 00:00:00 2001 From: arussac Date: Wed, 12 Feb 2025 07:55:47 +0100 Subject: [PATCH] =?UTF-8?q?mix=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/projet_detail.html | 13 +++++-------- index.html | 2 +- js/projet_detail.js | 25 +++++++++++++------------ 3 files changed, 19 insertions(+), 21 deletions(-) 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