diff --git a/tarteaucitron.js b/tarteaucitron.js
index 35bbc95..69b8c96 100644
--- a/tarteaucitron.js
+++ b/tarteaucitron.js
@@ -311,7 +311,7 @@ var tarteaucitron = {
// Step 3: prepare the html
html += '
';
html += '';
- html += '
';
+ html += '
';
html += ' ';
@@ -374,7 +374,7 @@ var tarteaucitron = {
html += '
';
html += ' ' + tarteaucitron.lang[cat[i]].details;
html += '
';
- html += '
';
+ html += '
';
}
html += '
' + tarteaucitron.lang.noServices + '
';
html += ' ';
@@ -622,15 +622,15 @@ var tarteaucitron = {
var html = '';
html += '
';
html += '
';
- html += ' '+tarteaucitron.lang[cat].title+'';
+ html += ' '+tarteaucitron.lang[cat].title+'';
html += ' '+tarteaucitron.lang[cat].details+'';
html += ' ';
html += '
';
html += '
';
- html += '
';
@@ -643,8 +643,10 @@ var tarteaucitron = {
tarteaucitron.userInterface.toggle('tarteaucitronServices_' + cat);
if (document.getElementById('tarteaucitronServices_' + cat).style.display == 'block') {
tarteaucitron.userInterface.addClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded');
+ document.getElementById('tarteaucitronServices_'+cat).setAttribute('aria-expanded', 'true');
} else {
tarteaucitron.userInterface.removeClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded');
+ document.getElementById('tarteaucitronServices_'+cat).setAttribute('aria-expanded', 'false');
}
});
tarteaucitron.addClickEventToId("tarteaucitron-accept-group-" + cat, function () {
@@ -778,17 +780,17 @@ var tarteaucitron = {
html += ' ' + tarteaucitron.lang.more;
html += ' ';
html += ' - ';
- html += ' ';
+ html += ' ';
html += ' ' + tarteaucitron.lang.source;
html += ' ';
}
html += '
';
html += '
';
- html += ' ';
+ html += ' ';
html += ' ' + tarteaucitron.lang.allow;
html += ' ';
- html += ' ';
+ html += ' ';
html += ' ' + tarteaucitron.lang.deny;
html += ' ';
html += '
';
@@ -1031,9 +1033,13 @@ var tarteaucitron = {
if (status === true) {
tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsAllowed');
tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsDenied');
+ document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'true');
+ document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false');
} else if (status === false) {
tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsAllowed');
tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsDenied');
+ document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false');
+ document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'true');
}
// check if all services are allowed
@@ -1065,18 +1071,29 @@ var tarteaucitron = {
tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed');
tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
+
+ document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false');
+ document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'true');
+
} else if (nbAllowed === 0 && nbPending === 0) {
tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected');
tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied');
+
+ document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'true');
+ document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false');
+
} else {
tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
+
+ document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false');
+ document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false');
}
// close the alert if all service have been reviewed
@@ -1120,14 +1137,29 @@ var tarteaucitron = {
if (total === groupallowed) {
tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
+
+ if (document.getElementById('tarteaucitron-reject-group-'+cat)) {
+ document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false');
+ document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'true');
+ }
}
if (total === groupdenied) {
tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
+
+ if (document.getElementById('tarteaucitron-reject-group-'+cat)) {
+ document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'true');
+ document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false');
+ }
}
if (total !== groupdenied && total !== groupallowed) {
tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
+
+ if (document.getElementById('tarteaucitron-reject-group-'+cat)) {
+ document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false');
+ document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false');
+ }
}
groupdenied = 0;
groupallowed = 0;