From 5311271ae590460b986e3e09edcdc665b73710ca Mon Sep 17 00:00:00 2001 From: polo Date: Fri, 24 Oct 2025 02:27:19 +0200 Subject: =?UTF-8?q?entit=C3=A9=20pour=20table=20interm=C3=A9diaire=20?= =?UTF-8?q?=C3=A0=203=20champs=20entre=20NodeData=20et=20Asset,=20table=20?= =?UTF-8?q?Asset=20repens=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/InputFile.js | 15 +++++++++++++-- public/js/InputText.js | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'public/js') diff --git a/public/js/InputFile.js b/public/js/InputFile.js index f5e450c..e676037 100644 --- a/public/js/InputFile.js +++ b/public/js/InputFile.js @@ -35,7 +35,18 @@ class InputFile{ .then(data => { if(data.success){ this.parent.querySelector('#' + this.name + '_img').src = data.location; - this.close(this.name); + + // cas particulier + if(this.name === 'head_favicon'){ + const link = document.querySelector('link[rel="icon"]'); + link.type = data.mime_type; + link.href = data.location; + } + else if(this.name === 'header_background'){ + document.querySelector('header').style.backgroundImage = "url('" + data.location + "')"; + } + + this.close(); } else{ console.error("Erreur: le serveur n'a pas enregistré l'image'."); @@ -46,6 +57,6 @@ class InputFile{ }); } cancel(){ - this.close(this.name); + this.close(); } } \ No newline at end of file diff --git a/public/js/InputText.js b/public/js/InputText.js index 33dcf8d..79f0398 100644 --- a/public/js/InputText.js +++ b/public/js/InputText.js @@ -31,7 +31,7 @@ class InputText{ .then(data => { if(data.success){ this.parent.querySelector('#' + this.name + '_span').innerHTML = new_text; - this.close(this.name); + this.close(); } else{ console.error("Erreur: le serveur n'a pas enregistré le nouveau texte."); @@ -43,6 +43,6 @@ class InputText{ } cancel(){ this.parent.querySelector('#' + this.name + '_input').value = this.parent.querySelector('#' + this.name + '_span').innerHTML; - this.close(this.name); + this.close(); } } \ No newline at end of file -- cgit v1.2.3