From 02ceb0e0bd3c63f35a164c00ea5b4e5d360688ae Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 11 Aug 2023 22:28:31 +0200 Subject: [PATCH] =?UTF-8?q?Animations=20des=20options=20de=20commentaires?= =?UTF-8?q?=20et=20de=20cat=C3=A9gories?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/view/profilAdd/profilAdd.js.php | 58 ++++++++++++++++++- .../user/view/profilEdit/profilEdit.js.php | 57 +++++++++++++++++- module/blog/profil/view/add.inc.php | 8 +-- module/blog/profil/view/edit.inc.php | 8 +-- module/download/profil/view/add.inc.php | 18 +++--- module/download/profil/view/edit.inc.php | 14 ++--- module/form/profil/view/add.inc.php | 2 +- module/form/profil/view/edit.inc.php | 2 +- module/gallery/profil/view/add.inc.php | 2 +- module/gallery/profil/view/edit.inc.php | 2 +- module/news/profil/view/add.inc.php | 2 +- module/news/profil/view/edit.inc.php | 2 +- module/redirection/profil/view/add.inc.php | 2 +- module/redirection/profil/view/edit.inc.php | 2 +- module/search/profil/view/add.inc.php | 2 +- module/search/profil/view/edit.inc.php | 2 +- module/slider/profil/view/add.inc.php | 2 +- module/slider/profil/view/edit.inc.php | 2 +- 18 files changed, 147 insertions(+), 40 deletions(-) diff --git a/core/module/user/view/profilAdd/profilAdd.js.php b/core/module/user/view/profilAdd/profilAdd.js.php index 87809556..69783306 100644 --- a/core/module/user/view/profilAdd/profilAdd.js.php +++ b/core/module/user/view/profilAdd/profilAdd.js.php @@ -14,6 +14,30 @@ $(document).ready(function () { + // Désactive les éléments liés au blog + if (!$("#profilAddBlogComment").prop("checked")) { + $(".blogAddCommentOptions").prop("disabled", true); + $(".blogAddCommentOptions").slideUp(); + } else { + $(".blogAddCommentOptions").slideDown(); + } + + // Désactive les éléments liés au blog + if (!$("#profilAddDownloadComment").prop("checked")) { + $(".downloadAddCommentOptions").prop("disabled", true); + $(".downloadAddCommentOptions").slideUp(); + } else { + $(".downloadAddCommentOptions").slideDown(); + } + + // Désactive les éléments liés au blog + if (!$("#profilAddDownloadCategories").prop("checked")) { + $(".downloadAddCategoryOptions").prop("disabled", true); + $(".downloadAddCategoryOptions").slideUp(); + } else { + $(".downloadAddCategoryOptions").slideDown(); + } + // À chaque inversion de l'état du checkbox avec l'id "profilAddFileManager", désactive ou active tous les éléments de la classe "filemanager" en fonction de l'état $("#profilAddFileManager").change(function () { @@ -34,12 +58,42 @@ $(document).ready(function () { } }); + // Gérer l'évènement sur les commentaires du blog + $("#profilAddBlogComment").change(function () { + if (!$(this).is(':checked')) { + $(".blogAddCommentOptions").slideUp(); + } else { + $('.blogAddCommentOptions input[type="checkbox"]').prop('checked', false); + $(".blogAddCommentOptions").slideDown(); + } + }); + + // Gérer l'évènement sur les commentaires du blog + $("#profilAddDownloadComment").change(function () { + if (!$(this).is(':checked')) { + $(".downloadAddCommentOptions").slideUp(); + } else { + $('.downloadAddCommentOptions input[type="checkbox"]').prop('checked', false); + $(".downloadAddCommentOptions").slideDown(); + } + }); + + // Gérer l'évènement sur les commentaires du blog + $("#profilAddDownloadCategories").change(function () { + if (!$(this).is(':checked')) { + $(".downloadAddCategoryOptions").slideUp(); + } else { + $('.downloadAddCategoryOptions input[type="checkbox"]').prop('checked', false); + $(".downloadAddCategoryOptions").slideDown(); + } + }); + // Gérer l'évènement affichage des $("#profilAddPageModule").change(function () { if (!$(this).is(':checked')) { $(".containerModule").slideUp(); // Décocher les checkboxes dans la classe .containerModule - $('.containerModule input[type="checkbox"]').removeAttr('checked'); + $('.containerModule input[type="checkbox"]').prop('checked', false); } else { $(".containerModule").slideDown(); } @@ -55,7 +109,7 @@ $(document).ready(function () { $('#profilAddPageModule, #profilAddPagecssEditor, #profilAddPagejsEditor').prop('checked', false).prop('disabled', true); // Désactiver les modules et tout décocher $(".containerModule").slideUp(); - $('.containerModule input[type="checkbox"]').removeAttr('checked'); + $('.containerModule input[type="checkbox"]').prop('checked', false); } }); diff --git a/core/module/user/view/profilEdit/profilEdit.js.php b/core/module/user/view/profilEdit/profilEdit.js.php index aa9e3334..ea3d01e6 100644 --- a/core/module/user/view/profilEdit/profilEdit.js.php +++ b/core/module/user/view/profilEdit/profilEdit.js.php @@ -17,6 +17,29 @@ $(document).ready(function () { if (!$("#profilEditFileManager").prop("checked")) { $(".filemanager").prop("disabled", true); } + + // Désactive les éléments liés au blog + if (!$("#profilEditBlogComment").prop("checked")) { + $(".blogEditCommentOptions").prop("disabled", true); + $(".blogEditCommentOptions").slideUp(); + } else { + $(".blogEditCommentOptions").slideDown(); + } + // Désactive les éléments liés à download + if (!$("#profilEditDownloadComment").prop("checked")) { + $(".downloadEditCommentOptions").prop("disabled", true); + $(".downloadEditCommentOptions").slideUp(); + } else { + $(".downloadEditCommentOptions").slideDown(); + } + // Désactive les éléments liés à download + if (!$("#profilEditDownloadCategories").prop("checked")) { + $(".downloadEditCategoryOptions").prop("disabled", true); + $(".downloadEditCategoryOptions").slideUp(); + } else { + $(".downloadEditCategoryOptions").slideDown(); + } + // Vérifier l'état initial de la checkbox #profilEditPageEdit if ($('#profilEditPageEdit').is(':checked')) { // Activer les autres checkboxes @@ -40,12 +63,42 @@ $(document).ready(function () { } }); + // Gérer l'évènement sur les commentaires du blog + $("#profilEditBlogComment").change(function () { + if (!$(this).is(':checked')) { + $(".blogEditCommentOptions").slideUp(); + } else { + $('.blogEditCommentOptions input[type="checkbox"]').prop('checked', false); + $(".blogEditCommentOptions").slideDown(); + } + }); + + // Gérer l'évènement sur les commentaires du download + $("#profilEditDownloadComment").change(function () { + if (!$(this).is(':checked')) { + $(".downloadEditCommentOptions").slideUp(); + } else { + $('.downloadEditCommentOptions input[type="checkbox"]').prop('checked', false); + $(".downloadEditCommentOptions").slideDown(); + } + }); + + // Gérer l'évènement sur les commentaires du download + $("#profilEditDownloadCategories").change(function () { + if (!$(this).is(':checked')) { + $(".downloadEditCategoryOptions").slideUp(); + } else { + $('.downloadEditCategoryOptions input[type="checkbox"]').prop('checked', false); + $(".downloadEditCategoryOptions").slideDown(); + } + }); + // Gérer l'évènement affichage des $("#profilEditPageModule").change(function () { if (!$(this).is(':checked')) { $(".containerModule").slideUp(); // Décocher les checkboxes dans la classe .containerModule - $('.containerModule input[type="checkbox"]').removeAttr('checked'); + $('.containerModule input[type="checkbox"]').prop('checked', false); } else { $(".containerModule").slideDown(); } @@ -61,7 +114,7 @@ $(document).ready(function () { $('#profilEditPageModule, #profilEditPagecssEditor, #profilEditPagejsEditor').prop('checked', false).prop('disabled', true); // Désactiver les modules et tout décocher $(".containerModule").slideUp(); - $('.containerModule input[type="checkbox"]').removeAttr('checked'); + $('.containerModule input[type="checkbox"]').prop('checked', false); } }); diff --git a/module/blog/profil/view/add.inc.php b/module/blog/profil/view/add.inc.php index 622d64dd..0f0bed9b 100644 --- a/module/blog/profil/view/add.inc.php +++ b/module/blog/profil/view/add.inc.php @@ -2,7 +2,7 @@

- +

@@ -22,13 +22,13 @@
-
+
-
+
-
+
diff --git a/module/blog/profil/view/edit.inc.php b/module/blog/profil/view/edit.inc.php index 01e5ba13..690877db 100644 --- a/module/blog/profil/view/edit.inc.php +++ b/module/blog/profil/view/edit.inc.php @@ -2,7 +2,7 @@

- +

@@ -32,17 +32,17 @@ 'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'blog', 'comment']) ]); ?>
-
+
$this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'blog', 'commentApprove']) ]); ?>
-
+
$this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'blog', 'commentDelete']) ]); ?>
-
+
$this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'blog', 'commentDeleteAll']) ]); ?> diff --git a/module/download/profil/view/add.inc.php b/module/download/profil/view/add.inc.php index c6633d63..984f480d 100644 --- a/module/download/profil/view/add.inc.php +++ b/module/download/profil/view/add.inc.php @@ -2,7 +2,7 @@

- +

@@ -21,15 +21,15 @@
- +
-
- +
+
-
+
-
+
@@ -37,13 +37,13 @@
-
+
-
+
-
+
diff --git a/module/download/profil/view/edit.inc.php b/module/download/profil/view/edit.inc.php index 0296bd8b..c209d8fa 100644 --- a/module/download/profil/view/edit.inc.php +++ b/module/download/profil/view/edit.inc.php @@ -2,7 +2,7 @@

- +

@@ -32,18 +32,18 @@ 'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'comment']) ]); ?>
-
+
$this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'commentApprove']) ]); ?>
-
+
$this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'commentDelete']) ]); ?>
-
+
$this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'commentDeleteAll']) ]); ?> @@ -55,17 +55,17 @@ 'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'categoryManage']) ]); ?>
-
+
$this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'categoryEdit']) ]); ?>
-
+
$this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'categoryDelete']) ]); ?>
-
+
$this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'deleteAllStats']) ]); ?> diff --git a/module/form/profil/view/add.inc.php b/module/form/profil/view/add.inc.php index 0332af46..1253c422 100644 --- a/module/form/profil/view/add.inc.php +++ b/module/form/profil/view/add.inc.php @@ -2,7 +2,7 @@

- +

diff --git a/module/form/profil/view/edit.inc.php b/module/form/profil/view/edit.inc.php index db768172..4d91962e 100644 --- a/module/form/profil/view/edit.inc.php +++ b/module/form/profil/view/edit.inc.php @@ -2,7 +2,7 @@

- +

diff --git a/module/gallery/profil/view/add.inc.php b/module/gallery/profil/view/add.inc.php index e5ddc220..4588b877 100644 --- a/module/gallery/profil/view/add.inc.php +++ b/module/gallery/profil/view/add.inc.php @@ -2,7 +2,7 @@

- +

diff --git a/module/gallery/profil/view/edit.inc.php b/module/gallery/profil/view/edit.inc.php index 590ded8f..35c1c938 100644 --- a/module/gallery/profil/view/edit.inc.php +++ b/module/gallery/profil/view/edit.inc.php @@ -2,7 +2,7 @@

- +

diff --git a/module/news/profil/view/add.inc.php b/module/news/profil/view/add.inc.php index ec1bd564..9e5ba68f 100644 --- a/module/news/profil/view/add.inc.php +++ b/module/news/profil/view/add.inc.php @@ -2,7 +2,7 @@

- +

diff --git a/module/news/profil/view/edit.inc.php b/module/news/profil/view/edit.inc.php index 6e13cb28..449a5b15 100644 --- a/module/news/profil/view/edit.inc.php +++ b/module/news/profil/view/edit.inc.php @@ -2,7 +2,7 @@

- + ·

diff --git a/module/redirection/profil/view/add.inc.php b/module/redirection/profil/view/add.inc.php index d9577364..c00166a8 100644 --- a/module/redirection/profil/view/add.inc.php +++ b/module/redirection/profil/view/add.inc.php @@ -2,7 +2,7 @@

- +

diff --git a/module/redirection/profil/view/edit.inc.php b/module/redirection/profil/view/edit.inc.php index c619eb7b..0dadc25e 100644 --- a/module/redirection/profil/view/edit.inc.php +++ b/module/redirection/profil/view/edit.inc.php @@ -2,7 +2,7 @@

- +

diff --git a/module/search/profil/view/add.inc.php b/module/search/profil/view/add.inc.php index b2623286..bbd5f464 100644 --- a/module/search/profil/view/add.inc.php +++ b/module/search/profil/view/add.inc.php @@ -2,7 +2,7 @@

- +

diff --git a/module/search/profil/view/edit.inc.php b/module/search/profil/view/edit.inc.php index f65c0745..79476221 100644 --- a/module/search/profil/view/edit.inc.php +++ b/module/search/profil/view/edit.inc.php @@ -2,7 +2,7 @@

- +

diff --git a/module/slider/profil/view/add.inc.php b/module/slider/profil/view/add.inc.php index 58e82b65..91b28080 100644 --- a/module/slider/profil/view/add.inc.php +++ b/module/slider/profil/view/add.inc.php @@ -2,7 +2,7 @@

- +

diff --git a/module/slider/profil/view/edit.inc.php b/module/slider/profil/view/edit.inc.php index 7e40561a..aafddbd9 100644 --- a/module/slider/profil/view/edit.inc.php +++ b/module/slider/profil/view/edit.inc.php @@ -2,7 +2,7 @@

- +