diff options
author | polo <ordipolo@gmx.fr> | 2025-09-05 11:27:37 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2025-09-05 11:27:37 +0200 |
commit | 46b455a0d3e96099e78975f53a25365a2ca9dcb4 (patch) | |
tree | 54f4616a103410d2bc77827b738f592806dbff67 /public/js/modif_page.js | |
parent | f477314613beb26b0ce4c61ec0b1900df1de1cb1 (diff) | |
download | cms-46b455a0d3e96099e78975f53a25365a2ca9dcb4.zip |
classe Editor et encapsulation, placement article premier ou dernier, variable window.Config.page, séparation openEditor et initEditor
Diffstat (limited to 'public/js/modif_page.js')
-rw-r--r-- | public/js/modif_page.js | 9 |
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 |
4 | function makePageNamePath(){ | 4 | function 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 | ||
133 | function switchBlocsPositions(bloc_id, direction, current_page) { | 130 | function 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) }) |