diff options
| author | polo <ordipolo@gmx.fr> | 2025-10-22 15:28:02 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-10-22 15:28:02 +0200 |
| commit | c9aff025aa7e01badaad8467af6165b400cdaac4 (patch) | |
| tree | c6e56a3f13db401c9f75bf9f8e4169f50aaf25b9 /public | |
| parent | 426a1a69cb73007538336debc31b34c4348e1ba1 (diff) | |
| download | cms-c9aff025aa7e01badaad8467af6165b400cdaac4.tar.gz cms-c9aff025aa7e01badaad8467af6165b400cdaac4.tar.bz2 cms-c9aff025aa7e01badaad8467af6165b400cdaac4.zip | |
possibilité d'éditer le texte dans header et footer, class JS InputText, Model::findWhateverNode
Diffstat (limited to 'public')
| -rw-r--r-- | public/assets/close-nb.svg | 1 | ||||
| -rw-r--r-- | public/assets/close.svg | 37 | ||||
| -rw-r--r-- | public/css/body.css | 4 | ||||
| -rw-r--r-- | public/css/calendar.css | 1 | ||||
| -rw-r--r-- | public/css/foot.css | 14 | ||||
| -rw-r--r-- | public/css/head.css | 12 | ||||
| -rw-r--r-- | public/js/InputText.js | 47 |
7 files changed, 103 insertions, 13 deletions
diff --git a/public/assets/close-nb.svg b/public/assets/close-nb.svg new file mode 100644 index 0000000..c5a6b6b --- /dev/null +++ b/public/assets/close-nb.svg | |||
| @@ -0,0 +1 @@ | |||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"></path></svg> \ No newline at end of file | |||
diff --git a/public/assets/close.svg b/public/assets/close.svg new file mode 100644 index 0000000..4dfee8c --- /dev/null +++ b/public/assets/close.svg | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | <svg | ||
| 3 | viewBox="0 0 24 24" | ||
| 4 | fill="currentColor" | ||
| 5 | version="1.1" | ||
| 6 | id="svg1" | ||
| 7 | sodipodi:docname="close.svg" | ||
| 8 | inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)" | ||
| 9 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
| 10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
| 11 | xmlns="http://www.w3.org/2000/svg" | ||
| 12 | xmlns:svg="http://www.w3.org/2000/svg"> | ||
| 13 | <defs | ||
| 14 | id="defs1" /> | ||
| 15 | <sodipodi:namedview | ||
| 16 | id="namedview1" | ||
| 17 | pagecolor="#ffffff" | ||
| 18 | bordercolor="#000000" | ||
| 19 | borderopacity="0.25" | ||
| 20 | inkscape:showpageshadow="2" | ||
| 21 | inkscape:pageopacity="0.0" | ||
| 22 | inkscape:pagecheckerboard="0" | ||
| 23 | inkscape:deskcolor="#d1d1d1" | ||
| 24 | inkscape:zoom="16.333333" | ||
| 25 | inkscape:cx="13.071429" | ||
| 26 | inkscape:cy="14.785714" | ||
| 27 | inkscape:window-width="1916" | ||
| 28 | inkscape:window-height="1032" | ||
| 29 | inkscape:window-x="0" | ||
| 30 | inkscape:window-y="0" | ||
| 31 | inkscape:window-maximized="1" | ||
| 32 | inkscape:current-layer="svg1" /> | ||
| 33 | <path | ||
| 34 | style="fill:#dd3333;stroke:#dd3333;stroke-width:0.2314" | ||
| 35 | d="m 6.3513525,17.616704 -0.6567632,-0.658806 2.4486238,-2.44805 c 1.346743,-1.346427 2.4486239,-2.475604 2.4486239,-2.509281 0,-0.03368 -1.1022132,-1.163696 -2.4493624,-2.5111538 L 5.6931123,7.0394909 6.3673453,6.3673486 7.0415783,5.6952062 9.5207892,8.1738503 12,10.652494 l 2.479211,-2.4786437 2.47921,-2.4786441 0.674234,0.6721424 0.674233,0.6721423 -2.449362,2.4499223 C 14.510376,10.836871 13.408163,11.966635 13.408163,12 c 0,0.03337 1.102213,1.163129 2.449363,2.510587 l 2.449362,2.449922 -0.674233,0.672142 -0.674234,0.672143 L 14.479211,15.82615 12,13.347506 9.5354343,15.811508 c -1.3555112,1.355201 -2.4786851,2.464002 -2.4959421,2.464002 -0.017257,0 -0.3269198,-0.296462 -0.6881397,-0.658806 z" | ||
| 36 | id="path2" /> | ||
| 37 | </svg> | ||
diff --git a/public/css/body.css b/public/css/body.css index 95f30d4..8ad3a52 100644 --- a/public/css/body.css +++ b/public/css/body.css | |||
| @@ -188,7 +188,7 @@ button .action_icon:hover | |||
| 188 | { | 188 | { |
| 189 | margin-right: 2px; | 189 | margin-right: 2px; |
| 190 | } | 190 | } |
| 191 | section button, section input[type=submit] | 191 | button, section input[type=submit] |
| 192 | { | 192 | { |
| 193 | color: #ff1d04; | 193 | color: #ff1d04; |
| 194 | font-size: medium; | 194 | font-size: medium; |
| @@ -196,7 +196,7 @@ section button, section input[type=submit] | |||
| 196 | background-color: white; | 196 | background-color: white; |
| 197 | border: lightgrey 2px outset; /* rend identiques les boutons firefox et chromium */ | 197 | border: lightgrey 2px outset; /* rend identiques les boutons firefox et chromium */ |
| 198 | } | 198 | } |
| 199 | section button:hover, section input[type=submit]:hover | 199 | button:hover, section input[type=submit]:hover |
| 200 | { | 200 | { |
| 201 | background-color: yellow; | 201 | background-color: yellow; |
| 202 | border-radius: 4px; | 202 | border-radius: 4px; |
diff --git a/public/css/calendar.css b/public/css/calendar.css index 2ff5640..d011f03 100644 --- a/public/css/calendar.css +++ b/public/css/calendar.css | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | #calendar_zone{ | 10 | #calendar_zone{ |
| 11 | display: flex; | 11 | display: flex; |
| 12 | gap: 5px; | 12 | gap: 5px; |
| 13 | /*padding: 15px;*/ | ||
| 14 | max-width: 1170px; | 13 | max-width: 1170px; |
| 15 | } | 14 | } |
| 16 | #calendar{ | 15 | #calendar{ |
diff --git a/public/css/foot.css b/public/css/foot.css index ad86305..8d0a94d 100644 --- a/public/css/foot.css +++ b/public/css/foot.css | |||
| @@ -11,11 +11,15 @@ footer | |||
| 11 | } | 11 | } |
| 12 | footer > div | 12 | footer > div |
| 13 | { | 13 | { |
| 14 | margin: auto; | ||
| 15 | max-width: 1200px; | 14 | max-width: 1200px; |
| 16 | display: flex; | 15 | display: flex; |
| 17 | justify-content: space-around; | 16 | justify-content: space-around; |
| 18 | } | 17 | } |
| 18 | |||
| 19 | .contact | ||
| 20 | { | ||
| 21 | margin: 16px 0; /* alignement avec la <p> autour du logo */ | ||
| 22 | } | ||
| 19 | .contact a | 23 | .contact a |
| 20 | { | 24 | { |
| 21 | color: unset; | 25 | color: unset; |
| @@ -69,11 +73,6 @@ footer > div | |||
| 69 | margin: 0 3px; | 73 | margin: 0 3px; |
| 70 | }*/ | 74 | }*/ |
| 71 | 75 | ||
| 72 | .contact | ||
| 73 | { | ||
| 74 | padding: 0 15px; | ||
| 75 | } | ||
| 76 | |||
| 77 | .footer_logo img | 76 | .footer_logo img |
| 78 | { | 77 | { |
| 79 | max-width: 288px; | 78 | max-width: 288px; |
| @@ -115,8 +114,7 @@ footer > div | |||
| 115 | } | 114 | } |
| 116 | .logged_out | 115 | .logged_out |
| 117 | { | 116 | { |
| 118 | /*display: none;*/ | 117 | justify-content: start; /* écrase le space-around dans footer > div */ |
| 119 | justify-content: start; | ||
| 120 | } | 118 | } |
| 121 | .logged_out a | 119 | .logged_out a |
| 122 | { | 120 | { |
diff --git a/public/css/head.css b/public/css/head.css index be938bb..b173077 100644 --- a/public/css/head.css +++ b/public/css/head.css | |||
| @@ -24,6 +24,8 @@ header | |||
| 24 | grid-template-columns: 1fr 1fr 1fr; | 24 | grid-template-columns: 1fr 1fr 1fr; |
| 25 | align-items: end; | 25 | align-items: end; |
| 26 | } | 26 | } |
| 27 | /*.header_left_col | ||
| 28 | {}*/ | ||
| 27 | @media screen and (max-width: 1000px){ | 29 | @media screen and (max-width: 1000px){ |
| 28 | .header-content{ | 30 | .header-content{ |
| 29 | padding: 18px 0; | 31 | padding: 18px 0; |
| @@ -36,7 +38,7 @@ header | |||
| 36 | display: block; | 38 | display: block; |
| 37 | padding: 18px; | 39 | padding: 18px; |
| 38 | } | 40 | } |
| 39 | .head_logo | 41 | #header_logo |
| 40 | { | 42 | { |
| 41 | display: none; | 43 | display: none; |
| 42 | } | 44 | } |
| @@ -74,12 +76,18 @@ header a | |||
| 74 | color: unset; /* ne plus hériter */ | 76 | color: unset; /* ne plus hériter */ |
| 75 | text-decoration: none; | 77 | text-decoration: none; |
| 76 | } | 78 | } |
| 79 | #edit_favicon_zone | ||
| 80 | { | ||
| 81 | margin-bottom: 10px; | ||
| 82 | } | ||
| 83 | /*.header_right_col | ||
| 84 | {}*/ | ||
| 77 | .social | 85 | .social |
| 78 | { | 86 | { |
| 79 | /*align-self: end;*/ | 87 | /*align-self: end;*/ |
| 80 | /*padding: 4px;*/ | 88 | /*padding: 4px;*/ |
| 81 | } | 89 | } |
| 82 | .social img | 90 | .social a img |
| 83 | { | 91 | { |
| 84 | width: 25px; | 92 | width: 25px; |
| 85 | background-color: #ffffffb3; | 93 | background-color: #ffffffb3; |
diff --git a/public/js/InputText.js b/public/js/InputText.js new file mode 100644 index 0000000..ba7e8e4 --- /dev/null +++ b/public/js/InputText.js | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | // s'en servir dans menu et chemin | ||
| 2 | class InputText{ | ||
| 3 | constructor(name){ | ||
| 4 | this.name = name; | ||
| 5 | this.parent = document.getElementById(name); | ||
| 6 | } | ||
| 7 | openTextInput(){ | ||
| 8 | this.parent.querySelector('#' + this.name + '_span').classList.add('hidden'); | ||
| 9 | this.parent.querySelector('#' + this.name + '_input').classList.remove('hidden'); | ||
| 10 | this.parent.querySelector('#' + this.name + '_open').classList.add('hidden'); | ||
| 11 | this.parent.querySelector('#' + this.name + '_submit').classList.remove('hidden'); | ||
| 12 | this.parent.querySelector('#' + this.name + '_cancel').classList.remove('hidden'); | ||
| 13 | } | ||
| 14 | closeTextInput(){ | ||
| 15 | this.parent.querySelector('#' + this.name + '_span').classList.remove('hidden'); | ||
| 16 | this.parent.querySelector('#' + this.name + '_input').classList.add('hidden'); | ||
| 17 | this.parent.querySelector('#' + this.name + '_open').classList.remove('hidden'); | ||
| 18 | this.parent.querySelector('#' + this.name + '_submit').classList.add('hidden'); | ||
| 19 | this.parent.querySelector('#' + this.name + '_cancel').classList.add('hidden'); | ||
| 20 | } | ||
| 21 | submitTextInput(){ | ||
| 22 | const new_text = this.parent.querySelector('#' + this.name + '_input').value; | ||
| 23 | |||
| 24 | fetch('index.php?entire_site_edit=' + this.name, { | ||
| 25 | method: 'POST', | ||
| 26 | headers: { 'Content-Type': 'application/json' }, | ||
| 27 | body: JSON.stringify({new_text: new_text}) | ||
| 28 | }) | ||
| 29 | .then(response => response.json()) | ||
| 30 | .then(data => { | ||
| 31 | if(data.success){ | ||
| 32 | this.parent.querySelector('#' + this.name + '_span').innerHTML = new_text; | ||
| 33 | this.closeTextInput(this.name); | ||
| 34 | } | ||
| 35 | else{ | ||
| 36 | console.error("Erreur: le serveur n'a pas enregistré le nouveau texte."); | ||
| 37 | } | ||
| 38 | }) | ||
| 39 | .catch(error => { | ||
| 40 | console.error('Erreur:', error); | ||
| 41 | }); | ||
| 42 | } | ||
| 43 | cancelTextInput(){ | ||
| 44 | this.parent.querySelector('#' + this.name + '_input').value = this.parent.querySelector('#' + this.name + '_span').innerHTML; | ||
| 45 | this.closeTextInput(this.name); | ||
| 46 | } | ||
| 47 | } \ No newline at end of file | ||
