// Préparer les toasts - côté JS Spruce.store("toasts", { counter: 0, list: [], createToast(message, type = "info"){ const index = this.list.length let totalVisible = this.list.filter((toast) => { return toast.visible }).length + 1 this.list.push({ id: this.counter++, message, type, visible: true, }) setTimeout(() => { this.destroyToast(index) }, 4000 * totalVisible) }, destroyToast(index){ this.list[index].visible = false }, }) // Quand la page a fini de charger window.onload = async function(){ // Obtenir le nom de la page var path = window.location.pathname.replace(/\//g,"").replace(/#/g,"") if(path === "") var path = "index" // Ajouter le focus sur un input en fonction de la page if(path === "index") document.getElementById("webhookUrl").focus(); // Obtenir le body : utile en peu plus tard var body = document.getElementById("body"); // Préparer les toasts - côté visuelle/HTML var toast_html = `