summaryrefslogtreecommitdiff
path: root/public/js/main.js
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2025-05-08 22:58:04 +0200
committerpolo <ordipolo@gmx.fr>2025-05-08 22:58:04 +0200
commit0f497d215de8e16739263e2718bd39640a6cc4d8 (patch)
treed241a0f95e34ee6e20d0221a9e8cae0e46379c10 /public/js/main.js
parent28698982ff6dc67a331788c2637bce8689121769 (diff)
downloadcms-0f497d215de8e16739263e2718bd39640a6cc4d8.zip
modif page, renommage et suppression, du responsive design, modif dans Director, notif toast
Diffstat (limited to 'public/js/main.js')
-rw-r--r--public/js/main.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/public/js/main.js b/public/js/main.js
index e278325..802bbbe 100644
--- a/public/js/main.js
+++ b/public/js/main.js
@@ -202,4 +202,33 @@ function findParent(element, tag_name){
202 element = element.parentElement; 202 element = element.parentElement;
203 } 203 }
204 return null; 204 return null;
205}
206
207
208/* -- mode Modification d'une page -- */
209function renamePageBloc(bloc_id){
210 const input = document.getElementById("bloc_rename_" + bloc_id);
211 const title = document.getElementById(bloc_id).querySelector("h3");
212
213 fetch('index.php?bloc_edit=rename_page_bloc', {
214 method: 'POST',
215 headers: {
216 'Content-Type': 'application/json'
217 },
218 body: JSON.stringify({bloc_title: input.value, bloc_id: bloc_id})
219 })
220 .then(response => response.json())
221 .then(data => {
222 if(data.success){
223 title.innerHTML = data.title;
224 console.log(data.title);
225 toastNotify('Le bloc a été renommé: ' + data.title);
226 }
227 else{
228 console.error('Erreur au renommage du titre.');
229 }
230 })
231 .catch(error => {
232 console.error('Erreur:', error);
233 });
205} \ No newline at end of file 234} \ No newline at end of file