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