From a303bbeb19f283cbb4f843f7a07bd19a207faaaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dylan=20Delac=C3=B4te?= Date: Wed, 12 Jul 2023 11:26:20 +0200 Subject: [PATCH 1/4] =?UTF-8?q?[FEATURE]=20Possibilit=C3=A9=20d'afficher?= =?UTF-8?q?=20les=20d=C3=A9tails=20des=20services=20sans=20cliquer=20sur?= =?UTF-8?q?=20le=20bouton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tarteaucitron.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 2c3b0c1..7d348d6 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -209,6 +209,7 @@ var tarteaucitron = { "bodyPosition": "bottom", "removeCredit": false, "showAlertSmall": false, + "showDetailsOnClick": true, "showIcon": true, "iconPosition": "BottomRight", "cookieslist": false, @@ -383,9 +384,14 @@ var tarteaucitron = { for (i = 0; i < cat.length; i += 1) { html += '
  • '; html += '
    '; - html += ' '; + if(tarteaucitron.parameters.showDetailsOnClick) + { + html += ' '; + }else{ + html += ' ' + tarteaucitron.lang[cat[i]].title + ''; + } html += '
    '; - html += '
    '; + html += '
    '; html += ' ' + tarteaucitron.lang[cat[i]].details; html += '
    '; html += '
    • '; @@ -752,6 +758,7 @@ var tarteaucitron = { for (i = 0; i < toggleBtns.length; i++) { toggleBtns[i].dataset.index = i; tarteaucitron.addClickEventToElement(toggleBtns[i], function () { + if(!tarteaucitron.parameters.showDetailsOnClick) return false; tarteaucitron.userInterface.toggle('tarteaucitronDetails' + cat[this.dataset.index], 'tarteaucitronInfoBox'); if (document.getElementById('tarteaucitronDetails' + cat[this.dataset.index]).style.display === 'block') { this.setAttribute('aria-expanded', 'true'); From e356fc7f7e8c13d3ba8942c118985955e791008d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dylan=20Delac=C3=B4te?= Date: Mon, 31 Jul 2023 15:55:58 +0200 Subject: [PATCH 2/4] [BUGFIX] Les cookies obligatoires sont toujours en bouton avec la configuration showDetailsOnClick --- tarteaucitron.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 7d348d6..6cf300d 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -359,7 +359,11 @@ var tarteaucitron = { if (tarteaucitron.parameters.mandatory == true) { html += '
    • '; html += '
      '; - html += ' '; + if(tarteaucitron.parameters.showDetailsOnClick){ + html += ' '; + }else{ + html += ' ' + tarteaucitron.lang.mandatoryTitle + ''; + } html += '
      '; html += '
        '; html += '
      • '; From 82848712a4d0d943a166e3f52fdeaf5f9290e520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dylan=20Delac=C3=B4te?= Date: Mon, 31 Jul 2023 16:34:06 +0200 Subject: [PATCH 3/4] [BUGFIX] Ajout de la class 'asCatToggleBtn' sur le titre des cookies obligatoires. --- tarteaucitron.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 6cf300d..9fa6c0b 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -362,7 +362,7 @@ var tarteaucitron = { if(tarteaucitron.parameters.showDetailsOnClick){ html += ' '; }else{ - html += ' ' + tarteaucitron.lang.mandatoryTitle + ''; + html += ' ' + tarteaucitron.lang.mandatoryTitle + ''; } html += ''; html += '
          '; From 0c55ee2c0e896505f861e574fcc47000a028f85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dylan=20Delac=C3=B4te?= Date: Mon, 31 Jul 2023 16:34:44 +0200 Subject: [PATCH 4/4] =?UTF-8?q?[TASK]=20Modification=20du=20style=20css=20?= =?UTF-8?q?en=20mode=20showDetailsOnClick=20=C3=A0=20false?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/tarteaucitron.css | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/css/tarteaucitron.css b/css/tarteaucitron.css index baf52c2..e7fb85d 100644 --- a/css/tarteaucitron.css +++ b/css/tarteaucitron.css @@ -421,7 +421,8 @@ div#tarteaucitronServices { #tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronTitle, #tarteaucitron #tarteaucitronServices .tarteaucitronTitle button, #tarteaucitron #tarteaucitronInfo, -#tarteaucitron #tarteaucitronServices .tarteaucitronDetails { +#tarteaucitron #tarteaucitronServices .tarteaucitronDetails, +#tarteaucitronRoot .asCatToggleBtn { color: #fff; display: inline-block; font-size: 14px; @@ -458,7 +459,7 @@ div#tarteaucitronServices { } #tarteaucitron #tarteaucitronInfo, -#tarteaucitron #tarteaucitronServices .tarteaucitronDetails { +#tarteaucitron #tarteaucitronServices .tarteaucitronDetails:not(.tarteaucitronDetailsInline) { color: #fff; display: none; font-size: 12px; @@ -470,6 +471,15 @@ div#tarteaucitronServices { z-index: 2147483647; } +#tarteaucitron #tarteaucitronServices .tarteaucitronTitle + [id^="tarteaucitronDetails"] { + width: 100%; + font-weight:500; + margin:0; + padding:1.5rem; + background:rgba(51, 51, 51, 0.2); + color:#333; +} + #tarteaucitron #tarteaucitronInfo a { color: #fff; text-decoration: underline;