From 4fe43eb84e4ff58955a8b8b031cfd34a3efc9a7b Mon Sep 17 00:00:00 2001 From: Adrien ERAUD Date: Thu, 27 Sep 2018 16:13:59 +0200 Subject: [PATCH] Remove h* use for SEO --- css/tarteaucitron.css | 28 ++++++++++++++++------------ tarteaucitron.js | 34 +++++++++++++++++----------------- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/css/tarteaucitron.css b/css/tarteaucitron.css index 854c637..f952ea9 100644 --- a/css/tarteaucitron.css +++ b/css/tarteaucitron.css @@ -56,11 +56,11 @@ div#tarteaucitronServices { #tarteaucitronServices::-webkit-scrollbar { width: 5px; } - + #tarteaucitronServices::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 0 rgba(0,0,0,0); } - + #tarteaucitronServices::-webkit-scrollbar-thumb { background-color: #ddd; outline: 0px solid slategrey; @@ -97,20 +97,20 @@ div#tarteaucitronServices { top: 0 !important; width: 100% !important; } - + #tarteaucitron .tarteaucitronBorder { border: 0 !important; } - + #tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList { border: 0 !important; } - + #tarteaucitron #tarteaucitronServices .tarteaucitronTitle { text-align: left !important; } - .tarteaucitronName h2 { + .tarteaucitronName .tarteaucitronH2 { max-width: 80%; } @@ -180,6 +180,10 @@ div#tarteaucitronServices { padding: 0; } +#tarteaucitron .tarteaucitronH1, #tarteaucitron .tarteaucitronH2, #tarteaucitron .tarteaucitronH3, #tarteaucitron .tarteaucitronH4, #tarteaucitron .tarteaucitronH5, #tarteaucitron .tarteaucitronH6 { + display: block; +} + .cookie-list { list-style: none; padding: 0; @@ -205,20 +209,20 @@ div#tarteaucitronServices { vertical-align: initial; } -#tarteaucitronRoot h1 { +#tarteaucitronRoot .tarteaucitronH1 { font-size: 1.5em; text-align: center; color: #fff; margin: 15px 0 28px; } -#tarteaucitronRoot h2 { +#tarteaucitronRoot .tarteaucitronH2 { display: inline-block; margin: 12px 0 0 10px; color: #fff; } -h2#tarteaucitronCookiesNumberBis { +#tarteaucitronCookiesNumberBis.tarteaucitronH2 { margin-left: 0; } @@ -293,7 +297,7 @@ h2#tarteaucitronCookiesNumberBis { position: relative; } -#tarteaucitronCookiesList h3.tarteaucitronTitle { +#tarteaucitronCookiesList .tarteaucitronH3.tarteaucitronTitle { width: 100%; box-sizing: border-box; } @@ -432,7 +436,7 @@ h2#tarteaucitronCookiesNumberBis { font-size: 12px; } -#tarteaucitron h3 { +#tarteaucitron .tarteaucitronH3 { font-size: 18px; } @@ -738,7 +742,7 @@ a.tarteaucitronSelfLink { display: block; text-shadow: 0 0 14px white; text-transform: uppercase; -}.tarteaucitronMainLine h2 { +}.tarteaucitronMainLine .tarteaucitronH2 { font-size: 1.2em!important; margin-top: 4px!important; } diff --git a/tarteaucitron.js b/tarteaucitron.js index 9c00d3e..597b855 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -275,7 +275,7 @@ var tarteaucitron = { html += ' '; html += '
'; html += '
'; - html += '

'+ tarteaucitron.lang.title + '

'; + html += ' '+ tarteaucitron.lang.title + ''; html += '
'; html += ' ' + tarteaucitron.lang.disclaimer; if (tarteaucitron.parameters.privacyUrl !== "") { @@ -286,7 +286,7 @@ var tarteaucitron = { } html += '
'; html += '
'; - html += '

' + tarteaucitron.lang.all + '

'; + html += ' ' + tarteaucitron.lang.all + ''; html += '
'; html += '
'; html += ' '; html += '
'; - html += '

0 cookie

'; + html += ' 0 cookie'; html += '
'; html += '
'; html += '
'; @@ -399,7 +399,7 @@ var tarteaucitron = { // 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'); wrapper.id = "contentWrapper"; - + while (document.body.firstChild) { wrapper.appendChild(document.body.firstChild); @@ -470,7 +470,7 @@ var tarteaucitron = { // create wrapper container /*var wrapper = document.createElement('div'); wrapper.id = "contentWrapper"; - + while (document.body.firstChild) { wrapper.appendChild(document.body.firstChild); @@ -516,7 +516,7 @@ var tarteaucitron = { html += '
  • '; html += '
    '; - html += '

    ' + service.name + '

    '; + html += ' ' + service.name + ''; html += '
    '; if (tarteaucitron.parameters.moreInfoLink == true) { html += ' '; @@ -782,7 +782,7 @@ var tarteaucitron = { } //document.getElementById('contentWrapper').setAttribute("aria-hidden", "false"); document.getElementsByTagName('body')[0].classList.remove('modal-open'); - + }, "focusTrap": function() { "use strict"; @@ -800,23 +800,23 @@ var tarteaucitron = { if (focusableEls[i].offsetHeight > 0) { filtered.push(focusableEls[i]); } - } + } - firstFocusableEl = filtered[0]; + firstFocusableEl = filtered[0]; lastFocusableEl = filtered[filtered.length - 1]; //loop focus inside tarteaucitron document.getElementById('tarteaucitron').addEventListener("keydown", function (evt) { - + if ( evt.key === 'Tab' || evt.keyCode === 9 ) { - + if ( evt.shiftKey ) /* shift + tab */ { if (document.activeElement === firstFocusableEl) { lastFocusableEl.focus(); evt.preventDefault(); } } else /* tab */ { - if (document.activeElement === lastFocusableEl) { + if (document.activeElement === lastFocusableEl) { firstFocusableEl.focus(); evt.preventDefault(); } @@ -1175,16 +1175,16 @@ var tarteaucitron = { if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) { savedname = tarteaucitron.cookie.owner[name].join(' // '); html += '
    '; - html += '

    '; + html += ' '; html += ' ' + tarteaucitron.cookie.owner[name].join(' // '); - html += '

    '; + html += ' '; html += '