nettoyage de doucmentation
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
|
||||
<form id="ajouterArticleForm">
|
||||
|
||||
<!-- Conteneur messages DOM -->
|
||||
|
||||
<div id="messages" class="mb-3"></div>
|
||||
|
||||
<!-- Catégorie -->
|
||||
|
||||
@@ -9,9 +9,7 @@ const publishedField = document.getElementById("articlePublished");
|
||||
// Simulation BDD
|
||||
const titresExistants = ["décoration noel", "coupe de chien"];
|
||||
|
||||
/* =========================
|
||||
DOM : messages
|
||||
========================= */
|
||||
|
||||
function showMessage(type, text) {
|
||||
messages.innerHTML = "";
|
||||
|
||||
@@ -22,17 +20,13 @@ function showMessage(type, text) {
|
||||
messages.appendChild(div);
|
||||
}
|
||||
|
||||
/* =========================
|
||||
Validation image
|
||||
========================= */
|
||||
|
||||
function imageValide(file) {
|
||||
if (!file) return true;
|
||||
return ["image/jpeg", "image/png"].includes(file.type);
|
||||
}
|
||||
|
||||
/* =========================
|
||||
Submit formulaire
|
||||
========================= */
|
||||
|
||||
form.addEventListener("submit", function (e) {
|
||||
e.preventDefault();
|
||||
messages.innerHTML = "";
|
||||
@@ -101,7 +95,7 @@ form.addEventListener("submit", function (e) {
|
||||
// Redirection
|
||||
setTimeout(() => {
|
||||
window.location.href = "../html/accueil_blog.html";
|
||||
}, 1000);
|
||||
}, 1500);
|
||||
});
|
||||
|
||||
/* =========================
|
||||
|
||||
@@ -48,5 +48,5 @@ form.addEventListener("submit", function (e) {
|
||||
// Redirection
|
||||
setTimeout(() => {
|
||||
window.location.href = "../html/accueil_blog.html";
|
||||
}, 1000);
|
||||
}, 1500);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user