aboutsummaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2025-10-24 02:27:19 +0200
committerpolo <ordipolo@gmx.fr>2025-10-24 02:27:19 +0200
commit5311271ae590460b986e3e09edcdc665b73710ca (patch)
treef31f6b9602d1607e838a7a4bfe320db9c8d44bb4 /public/js
parentf9a9bf1ae4fac9317fd71f0bcb207544b000e6f1 (diff)
downloadcms-5311271ae590460b986e3e09edcdc665b73710ca.zip
entité pour table intermédiaire à 3 champs entre NodeData et Asset, table Asset repensée
Diffstat (limited to 'public/js')
-rw-r--r--public/js/InputFile.js15
-rw-r--r--public/js/InputText.js4
2 files changed, 15 insertions, 4 deletions
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{
35 .then(data => { 35 .then(data => {
36 if(data.success){ 36 if(data.success){
37 this.parent.querySelector('#' + this.name + '_img').src = data.location; 37 this.parent.querySelector('#' + this.name + '_img').src = data.location;
38 this.close(this.name); 38
39 // cas particulier
40 if(this.name === 'head_favicon'){
41 const link = document.querySelector('link[rel="icon"]');
42 link.type = data.mime_type;
43 link.href = data.location;
44 }
45 else if(this.name === 'header_background'){
46 document.querySelector('header').style.backgroundImage = "url('" + data.location + "')";
47 }
48
49 this.close();
39 } 50 }
40 else{ 51 else{
41 console.error("Erreur: le serveur n'a pas enregistré l'image'."); 52 console.error("Erreur: le serveur n'a pas enregistré l'image'.");
@@ -46,6 +57,6 @@ class InputFile{
46 }); 57 });
47 } 58 }
48 cancel(){ 59 cancel(){
49 this.close(this.name); 60 this.close();
50 } 61 }
51} \ No newline at end of file 62} \ 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{
31 .then(data => { 31 .then(data => {
32 if(data.success){ 32 if(data.success){
33 this.parent.querySelector('#' + this.name + '_span').innerHTML = new_text; 33 this.parent.querySelector('#' + this.name + '_span').innerHTML = new_text;
34 this.close(this.name); 34 this.close();
35 } 35 }
36 else{ 36 else{
37 console.error("Erreur: le serveur n'a pas enregistré le nouveau texte."); 37 console.error("Erreur: le serveur n'a pas enregistré le nouveau texte.");
@@ -43,6 +43,6 @@ class InputText{
43 } 43 }
44 cancel(){ 44 cancel(){
45 this.parent.querySelector('#' + this.name + '_input').value = this.parent.querySelector('#' + this.name + '_span').innerHTML; 45 this.parent.querySelector('#' + this.name + '_input').value = this.parent.querySelector('#' + this.name + '_span').innerHTML;
46 this.close(this.name); 46 this.close();
47 } 47 }
48} \ No newline at end of file 48} \ No newline at end of file