Fix colors of button #213

This commit is contained in:
Amauri CHAMPEAUX 2018-09-14 09:30:29 +02:00 committed by David
parent 73b5f7de42
commit 42a4205756
1 changed files with 21 additions and 17 deletions

View File

@ -16,7 +16,7 @@ var scripts = document.getElementsByTagName('script'),
var tarteaucitron = { var tarteaucitron = {
"version": 20180911002, "version": 20180914,
"cdn": cdn, "cdn": cdn,
"user": {}, "user": {},
"lang": {}, "lang": {},
@ -333,7 +333,13 @@ var tarteaucitron = {
} else { } else {
html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">'; html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
html += ' <span id="tarteaucitronDisclaimerAlert">'; html += ' <span id="tarteaucitronDisclaimerAlert">';
html += ' ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig;
if (tarteaucitron.parameters.highPrivacy) {
html += ' ' + tarteaucitron.lang.alertBigPrivacy;
} else {
html += ' ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig;
}
html += ' </span>'; html += ' </span>';
html += ' <button id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.respondAll(true);">'; html += ' <button id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.respondAll(true);">';
html += ' &#10003; ' + tarteaucitron.lang.acceptAll; html += ' &#10003; ' + tarteaucitron.lang.acceptAll;
@ -385,7 +391,7 @@ var tarteaucitron = {
// create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened // create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened
var wrapper = document.createElement('div'); var wrapper = document.createElement('div');
wrapper.id = "contentWrapper"; wrapper.id = "contentWrapper";
while (document.body.firstChild) while (document.body.firstChild)
{ {
wrapper.appendChild(document.body.firstChild); wrapper.appendChild(document.body.firstChild);
@ -456,7 +462,7 @@ var tarteaucitron = {
// create wrapper container // create wrapper container
var wrapper = document.createElement('div'); var wrapper = document.createElement('div');
wrapper.id = "contentWrapper"; wrapper.id = "contentWrapper";
while (document.body.firstChild) while (document.body.firstChild)
{ {
wrapper.appendChild(document.body.firstChild); wrapper.appendChild(document.body.firstChild);
@ -703,8 +709,8 @@ var tarteaucitron = {
tarteaucitron.userInterface.css(c + 'AllDenied', 'opacity', '1'); tarteaucitron.userInterface.css(c + 'AllDenied', 'opacity', '1');
tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', redDark); tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', redDark);
} else { } else {
tarteaucitron.userInterface.css(c + 'AllAllowed', 'opacity', '1'); tarteaucitron.userInterface.css(c + 'AllAllowed', 'opacity', '0.4');
tarteaucitron.userInterface.css(c + 'AllDenied', 'opacity', '1'); tarteaucitron.userInterface.css(c + 'AllDenied', 'opacity', '0.4');
} }
// close the alert if all service have been reviewed // close the alert if all service have been reviewed
@ -763,7 +769,7 @@ var tarteaucitron = {
} }
document.getElementById('contentWrapper').setAttribute("aria-hidden", "false"); document.getElementById('contentWrapper').setAttribute("aria-hidden", "false");
document.getElementsByTagName('body')[0].classList.remove('modal-open'); document.getElementsByTagName('body')[0].classList.remove('modal-open');
}, },
"focusTrap": function() { "focusTrap": function() {
"use strict"; "use strict";
@ -781,23 +787,23 @@ var tarteaucitron = {
if (focusableEls[i].offsetHeight > 0) { if (focusableEls[i].offsetHeight > 0) {
filtered.push(focusableEls[i]); filtered.push(focusableEls[i]);
} }
} }
firstFocusableEl = filtered[0]; firstFocusableEl = filtered[0];
lastFocusableEl = filtered[filtered.length - 1]; lastFocusableEl = filtered[filtered.length - 1];
//loop focus inside tarteaucitron //loop focus inside tarteaucitron
document.getElementById('tarteaucitron').addEventListener("keydown", function (evt) { document.getElementById('tarteaucitron').addEventListener("keydown", function (evt) {
if ( evt.key === 'Tab' || evt.keyCode === 9 ) { if ( evt.key === 'Tab' || evt.keyCode === 9 ) {
if ( evt.shiftKey ) /* shift + tab */ { if ( evt.shiftKey ) /* shift + tab */ {
if (document.activeElement === firstFocusableEl) { if (document.activeElement === firstFocusableEl) {
lastFocusableEl.focus(); lastFocusableEl.focus();
evt.preventDefault(); evt.preventDefault();
} }
} else /* tab */ { } else /* tab */ {
if (document.activeElement === lastFocusableEl) { if (document.activeElement === lastFocusableEl) {
firstFocusableEl.focus(); firstFocusableEl.focus();
evt.preventDefault(); evt.preventDefault();
} }
@ -879,11 +885,9 @@ var tarteaucitron = {
allDivs = main.childNodes; allDivs = main.childNodes;
if (typeof Array.prototype.map === 'function') { if (typeof Array.prototype.map === 'function') {
Array.prototype.map.call(main.children, Object).sort(function (a, b) {
Array.prototype.map.call(main.children, Object).sort(function (a, b) { //var mainChildren = Array.from(main.children);
//var mainChildren = Array.from(main.children); //mainChildren.sort(function (a, b) {
//mainChildren.sort(function (a, b) {
if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; } if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; }
if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; } if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; }
return 0; return 0;