aboutsummaryrefslogtreecommitdiff
path: root/public/js/modif_page.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/modif_page.js')
-rw-r--r--public/js/modif_page.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/public/js/modif_page.js b/public/js/modif_page.js
index 615f34a..dd7271e 100644
--- a/public/js/modif_page.js
+++ b/public/js/modif_page.js
@@ -2,10 +2,7 @@
2 2
3// même fonction que dans new_page.js 3// même fonction que dans new_page.js
4function makePageNamePath(){ 4function makePageNamePath(){
5 const page_name = document.getElementById("page_name"); 5 document.getElementById("page_name_path").value = document.getElementById("page_name").value
6 const page_name_path = document.getElementById("page_name_path");
7
8 page_name_path.value = page_name.value
9 .normalize("NFD") // décompose lettres + accents: é devient "e + accent aigu" 6 .normalize("NFD") // décompose lettres + accents: é devient "e + accent aigu"
10 .replace(/[\u0300-\u036f]/g, "") // supprime les accents 7 .replace(/[\u0300-\u036f]/g, "") // supprime les accents
11 .replace(/[^a-zA-Z0-9]+/g, " ") // supprime tout ce qu'il n'est pas alphanuméric 8 .replace(/[^a-zA-Z0-9]+/g, " ") // supprime tout ce qu'il n'est pas alphanuméric
@@ -130,7 +127,7 @@ function renamePageBloc(bloc_id){
130 }); 127 });
131} 128}
132 129
133function switchBlocsPositions(bloc_id, direction, current_page) { 130function switchBlocsPositions(bloc_id, direction) {
134 const current_bloc = document.getElementById(bloc_id); 131 const current_bloc = document.getElementById(bloc_id);
135 const current_bloc_edit_zone = document.getElementById("bloc_edit_" + bloc_id); 132 const current_bloc_edit_zone = document.getElementById("bloc_edit_" + bloc_id);
136 var other_bloc; 133 var other_bloc;
@@ -149,7 +146,7 @@ function switchBlocsPositions(bloc_id, direction, current_page) {
149 } 146 }
150 const other_bloc_edit_zone = document.getElementById("bloc_edit_" + other_bloc.id); 147 const other_bloc_edit_zone = document.getElementById("bloc_edit_" + other_bloc.id);
151 148
152 fetch('index.php?page=' + current_page + '&bloc_edit=switch_blocs_positions', { 149 fetch('index.php?page=' + window.Config.page + '&bloc_edit=switch_blocs_positions', {
153 method: 'POST', 150 method: 'POST',
154 headers: { 'Content-Type': 'application/json' }, 151 headers: { 'Content-Type': 'application/json' },
155 body: JSON.stringify({ id1: bloc_id, id2: parseInt(other_bloc.id) }) 152 body: JSON.stringify({ id1: bloc_id, id2: parseInt(other_bloc.id) })