Skip to content

Commit

Permalink
♿️ Tarteaucitron: makes the shortcut's buttons more explicit.
Browse files Browse the repository at this point in the history
    Add an aria-describedby to link these buttons to the label to make the 7.1 criterion of the RGAA 4.1 pass

    7.1 : The HTML generated by the script should be compatible with accessibility technology.

    Here, the buttons were not sufficiently explicit, making potentially someone wonder what would be accepted, refused or personalized
  • Loading branch information
etienneCharignon committed Dec 19, 2024
1 parent 70ffcaf commit de04102
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions public/pro/tarteaucitron/tarteaucitron.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,23 +604,23 @@ var tarteaucitron = {

html += ' </span>';
//html += ' <span class="tarteaucitronAlertBigBtnWrapper">';
html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronAllow" id="tarteaucitronPersonalize2">';
html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronAllow" id="tarteaucitronPersonalize2" aria-describedby="tarteaucitronDisclaimerAlert">';
html += ' <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.acceptAll;
html += ' </button>';


if (tarteaucitron.parameters.DenyAllCta) {
if (tarteaucitron.reloadThePage) {
html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2" aria-label="' + tarteaucitron.lang.denyAll + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.denyAll + ' (' + tarteaucitron.lang.reload + ')">';
html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2" aria-describedby="tarteaucitronDisclaimerAlert" aria-label="' + tarteaucitron.lang.denyAll + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.denyAll + ' (' + tarteaucitron.lang.reload + ')">';
} else {
html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2">';
html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2" aria-describedby="tarteaucitronDisclaimerAlert">';
}
html += ' <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.denyAll;
html += ' </button>';
//html += ' <br/><br/>';
}

html += ' <button type="button" id="tarteaucitronCloseAlert" aria-label="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '">';
html += ' <button type="button" id="tarteaucitronCloseAlert" aria-describedby="tarteaucitronDisclaimerAlert" aria-label="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '">';
html += ' ' + tarteaucitron.lang.personalize;
html += ' </button>';

Expand Down

0 comments on commit de04102

Please sign in to comment.