diff --git a/build/cookieconsent.js b/build/cookieconsent.js index 433cff5..64da519 100644 --- a/build/cookieconsent.js +++ b/build/cookieconsent.js @@ -1333,7 +1333,16 @@ var Interface = /*#__PURE__*/function () { }, { key: "buildBar", value: function buildBar() { - return el('div#cconsent-bar.ccb--hidden', el("div.ccb__wrapper", el('div.ccb__left', el('div.cc-text', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'barMainText'))), el('div.ccb__right', el('div.ccb__button', el('button.ccb__edit', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'barLinkSetting')), window.CookieConsent.config.showRejectAllButton && el('button.consent-decline', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'barBtnRejectAll')), el('button.consent-give', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'barBtnAcceptAll'))))), { + return el('div#cconsent-bar.ccb--hidden', el("div.ccb__wrapper", el('div.ccb__left', el('div.cc-text', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'barMainText'))), el('div.ccb__right', el('div.ccb__button', el('button.ccb__edit', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'barLinkSetting'), { + 'aria-hidden': 'true', + tabindex: '-1' + }), window.CookieConsent.config.showRejectAllButton && el('button.consent-decline', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'barBtnRejectAll'), { + 'aria-hidden': 'true', + tabindex: '-1' + }), el('button.consent-give', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'barBtnAcceptAll'), { + 'aria-hidden': 'true', + tabindex: '-1' + })))), { role: 'region', 'aria-label': Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'cookieBarLabel'), 'aria-hidden': 'true', @@ -1494,9 +1503,20 @@ var Interface = /*#__PURE__*/function () { // Show the bar after a while if (!window.CookieConsent.config.cookieExists) { setTimeout(function () { + var _ref, _ref2; + + var buttonSettings = bar.querySelector('.ccb__edit'); + var buttonConsentGive = bar.querySelector('.consent-give'); + var buttonConsentDecline = bar.querySelector('.consent-decline'); bar.classList.remove('ccb--hidden'); bar.setAttribute('aria-hidden', 'false'); bar.setAttribute('tabindex', '0'); + buttonSettings.setAttribute('tabindex', '0'); + buttonSettings.setAttribute('aria-hidden', 'false'); + buttonConsentGive.setAttribute('tabindex', '0'); + buttonConsentGive.setAttribute('aria-hidden', 'false'); + (_ref = buttonConsentDecline && buttonConsentDecline.length > 0) !== null && _ref !== void 0 ? _ref : buttonConsentDecline.setAttribute('tabindex', '0'); + (_ref2 = buttonConsentDecline && buttonConsentDecline.length > 0) !== null && _ref2 !== void 0 ? _ref2 : buttonConsentDecline.setAttribute('aria-hidden', 'false'); }, window.CookieConsent.config.barTimeout); } }); @@ -1522,7 +1542,7 @@ var Interface = /*#__PURE__*/function () { var _loop = function _loop() { var button = _step2.value; button.addEventListener('click', function () { - var _ref3, _ref4; + var _ref5, _ref6; var buttonSettings = document.querySelector('.ccb__edit'); var buttonConsentDecline = document.querySelector('.consent-decline'); // We set config to full consent @@ -1553,8 +1573,8 @@ var Interface = /*#__PURE__*/function () { button.setAttribute('aria-hidden', 'true'); buttonSettings.setAttribute('tabindex', '-1'); buttonSettings.setAttribute('aria-hidden', 'true'); - (_ref3 = buttonConsentDecline.length > 0) !== null && _ref3 !== void 0 ? _ref3 : buttonConsentDecline.setAttribute('tabindex', '-1'); - (_ref4 = buttonConsentDecline.length > 0) !== null && _ref4 !== void 0 ? _ref4 : buttonConsentDecline.setAttribute('aria-hidden', 'true'); + (_ref5 = buttonConsentDecline && buttonConsentDecline.length > 0) !== null && _ref5 !== void 0 ? _ref5 : buttonConsentDecline.setAttribute('tabindex', '-1'); + (_ref6 = buttonConsentDecline && buttonConsentDecline.length > 0) !== null && _ref6 !== void 0 ? _ref6 : buttonConsentDecline.setAttribute('aria-hidden', 'true'); focusTarget.focus(); modalOpen = false; @@ -1726,12 +1746,12 @@ var Interface = /*#__PURE__*/function () { window.CookieConsent.config.categories[switchElement.dataset.category].wanted = switchElement.checked; }); var buttonSettings = document.querySelector('.ccb__edit'); - var buttonConsentDecline = document.querySelector('.consent-decline'); var buttonConsentGive = document.querySelector('.consent-give'); + var buttonConsentDecline = document.querySelector('.consent-decline'); _this.buildCookie(function (cookie) { _this.setCookie(cookie, function () { - var _ref, _ref2; + var _ref3, _ref4; _this.elements['modal'].classList.remove('ccm--visible'); @@ -1747,10 +1767,10 @@ var Interface = /*#__PURE__*/function () { buttonSettings.setAttribute('tabindex', '-1'); buttonSettings.setAttribute('aria-hidden', 'true'); - (_ref = buttonConsentDecline.length > 0) !== null && _ref !== void 0 ? _ref : buttonConsentDecline.setAttribute('tabindex', '-1'); - (_ref2 = buttonConsentDecline.length > 0) !== null && _ref2 !== void 0 ? _ref2 : buttonConsentDecline.setAttribute('aria-hidden', 'true'); buttonConsentGive.setAttribute('tabindex', '-1'); buttonConsentGive.setAttribute('aria-hidden', 'true'); + (_ref3 = buttonConsentDecline && buttonConsentDecline.length > 0) !== null && _ref3 !== void 0 ? _ref3 : buttonConsentDecline.setAttribute('tabindex', '-1'); + (_ref4 = buttonConsentDecline && buttonConsentDecline.length > 0) !== null && _ref4 !== void 0 ? _ref4 : buttonConsentDecline.setAttribute('aria-hidden', 'true'); focusTarget.focus(); modalOpen = false; }); diff --git a/build/cookieconsent.min.js b/build/cookieconsent.min.js index 510acc4..2c8e31d 100644 --- a/build/cookieconsent.min.js +++ b/build/cookieconsent.min.js @@ -1 +1 @@ -(()=>{"use strict";function e(e,t){for(var n=0;n>16)+t;i>255?i=255:i<0&&(i=0);var r=(o>>8&255)+t;r>255?r=255:r<0&&(r=0);var c=(255&o)+t;return c>255?c=255:c<0&&(c=0),(n?"#":"")+(c|r<<8|i<<16).toString(16)}},{key:"removeCookie",value:function(){document.cookie="cconsent=; expires=Thu, 01 Jan 1980 00:00:00 UTC; path=/;"}},{key:"listGlobalServices",value:function(e){var t=[];if(void 0===window.CookieConsent)return t;if(void 0===e)for(var n in window.CookieConsent.config.services)t.push(n);else for(var o in window.CookieConsent.config.services)window.CookieConsent.config.services[o].category===e&&t.push(o);return t}},{key:"dispatchEvent",value:function(e,t){"function"==typeof Event?t=new Event(t):(t=document.createEvent("Event")).initEvent(t,!0,!0),e.dispatchEvent(t)}}],(o=null)&&e(n.prototype,o),i&&e(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();function n(e,t){for(var n=0;n=0&&!1===window.CookieConsent.config.categories[window.CookieConsent.config.services[t].category].wanted)return void window.CookieConsent.buffer.appendChild.push({this:this,category:window.CookieConsent.config.services[t].category,arguments});return Node.prototype.appendChild.apply(this,arguments)}}},{key:"overrideInsertBefore",value:function(){Element.prototype.insertBefore=function(e){if("SCRIPT"===arguments[0].tagName)for(var t in window.CookieConsent.config.services)if("dynamic-script"===window.CookieConsent.config.services[t].type&&arguments[0].outerHTML.indexOf(window.CookieConsent.config.services[t].search)>=0&&!1===window.CookieConsent.config.categories[window.CookieConsent.config.services[t].category].wanted)return void window.CookieConsent.buffer.insertBefore.push({this:this,category:window.CookieConsent.config.services[t].category,arguments});return Node.prototype.insertBefore.apply(this,arguments)}}}],n&&r(t.prototype,n),o&&r(t,o),Object.defineProperty(t,"prototype",{writable:!1}),s}(o);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function f(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,c=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){a=!0,r=e},f:function(){try{c||null==n.return||n.return()}finally{if(a)throw r}}}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;e.indexOf(t)<0&&n()}}}],n&&C(t.prototype,n),o&&C(t,o),Object.defineProperty(t,"prototype",{writable:!1}),r}(o);function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function L(e,t){for(var n=0;n0;)n[o]=arguments[o+1];var i=typeof e;if("string"===i)t=ae(e).cloneNode(!1);else if(oe(e))t=e.cloneNode(!1);else{if("function"!==i)throw new Error("At least one argument required");var r=e;t=new(Function.prototype.bind.apply(r,[null].concat(n)))}return ee(ne(t),n,!0),t}var ce=re;function ae(e){return ie[e]||(ie[e]=F(e))}function se(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];for(var o=ne(e),i=le(e,t,o.firstChild);i;){var r=i.nextSibling;I(e,i),i=r}}function le(e,t,n){for(var o=n,i=new Array(t.length),r=0;r0;)t[n]=arguments[n+1];var o=ae(e);return re.bind.apply(re,[this,o].concat(t))};var ue=function(e,t,n){this.View=e,this.initData=n,this.oldLookup={},this.lookup={},this.oldViews=[],this.views=[],null!=t&&(this.key="function"==typeof t?t:function(e){return function(t){return t[e]}}(t))};ue.prototype.update=function(e,t){for(var n=this,o=n.View,i=n.key,r=n.initData,c=null!=i,a=this.lookup,s={},l=new Array(e.length),u=this.views,d=0;d0;)n[o]=arguments[o+1];var i=typeof e;if("string"===i)t=ge(e).cloneNode(!1);else if(oe(e))t=e.cloneNode(!1);else{if("function"!==i)throw new Error("At least one argument required");var r=e;t=new(Function.prototype.bind.apply(r,[null].concat(n)))}return ee(ne(t),n,!0),t}function ge(e){return be[e]||(be[e]=F(e,me))}function he(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,c=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){a=!0,r=e},f:function(){try{c||null==n.return||n.return()}finally{if(a)throw r}}}}function ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n