소스 검색

Remove h* use for SEO

Adrien ERAUD 6 년 전
부모
커밋
4fe43eb84e
2개의 변경된 파일33개의 추가작업 그리고 29개의 파일을 삭제
  1. 16 12
      css/tarteaucitron.css
  2. 17 17
      tarteaucitron.js

+ 16 - 12
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;
 }

+ 17 - 17
tarteaucitron.js

@@ -275,7 +275,7 @@ var tarteaucitron = {
                 html += '   </button>';
                 html += '   <div id="tarteaucitronServices">';
                 html += '      <div class="tarteaucitronLine tarteaucitronMainLine" id="tarteaucitronMainLineOffset">';
-                html += '         <h1 id="dialogTitle">'+ tarteaucitron.lang.title + '</h1>';
+                html += '         <span id="dialogTitle" class="tarteaucitronH1">'+ tarteaucitron.lang.title + '</span>';
                 html += '         <div id="tarteaucitronInfo" class="tarteaucitronInfoBox">';
                 html += '         ' + tarteaucitron.lang.disclaimer;
                 if (tarteaucitron.parameters.privacyUrl !== "") {
@@ -286,7 +286,7 @@ var tarteaucitron = {
                 }
                 html += '         </div>';
                 html += '         <div class="tarteaucitronName">';
-                html += '            <h2>' + tarteaucitron.lang.all + '</h2>';
+                html += '            <span class="tarteaucitronH2">' + tarteaucitron.lang.all + '</span>';
                 html += '         </div>';
                 html += '         <div class="tarteaucitronAsk" id="tarteaucitronScrollbarAdjust">';
                 html += '            <button id="tarteaucitronAllAllowed" class="tarteaucitronAllow" onclick="tarteaucitron.userInterface.respondAll(true);">';
@@ -347,7 +347,7 @@ var tarteaucitron = {
                     } else {
                         html += '       ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig;
                     }
-                    
+
                     html += '   </span>';
                     html += '   <button id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.respondAll(true);">';
                     html += '       &#10003; ' + tarteaucitron.lang.acceptAll;
@@ -383,7 +383,7 @@ var tarteaucitron = {
                         html += '           ' + tarteaucitron.lang.close;
                         html += '       </button>';
                         html += '       <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">';
-                        html += '            <h2 id="tarteaucitronCookiesNumberBis">0 cookie</h2>';
+                        html += '            <span id="tarteaucitronCookiesNumberBis" class="tarteaucitronH2">0 cookie</span>';
                         html += '       </div>';
                         html += '       <div id="tarteaucitronCookiesList"></div>';
                         html += '    </div>';
@@ -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 += '<li id="' + service.key + 'Line" class="tarteaucitronLine">';
             html += '   <div class="tarteaucitronName">';
-            html += '       <h3>' + service.name + '</h3>';
+            html += '       <span class="tarteaucitronH3">' + service.name + '</span>';
             html += '       <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span><br/>';
             if (tarteaucitron.parameters.moreInfoLink == true) {
                 html += '       <a href="https://opt-out.ferank.eu/service/' + service.key + '/" target="_blank" rel="noopener" title="'+ tarteaucitron.lang.cookieDetail + ' ' + service.name + ' ' + tarteaucitron.lang.ourSite + ' ' + tarteaucitron.lang.newWindow +'">';
@@ -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 += '<div class="tarteaucitronHidden">';
-                        html += '     <h3 class="tarteaucitronTitle">';
+                        html += '     <span class="tarteaucitronTitle tarteaucitronH3">';
                         html += '        ' + tarteaucitron.cookie.owner[name].join(' // ');
-                        html += '    </h3>';
+                        html += '    </span>';
                         html += '</div><ul class="cookie-list">';
                     } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) {
                         savedname = host;
                         html += '<div class="tarteaucitronHidden">';
-                        html += '     <h3 class="tarteaucitronTitle">';
+                        html += '     <span class="tarteaucitronTitle tarteaucitronH3">';
                         html += '        ' + host;
-                        html += '    </h3>';
+                        html += '    </span>';
                         html += '</div><ul class="cookie-list">';
                     }
                     html += '<li class="tarteaucitronCookiesListMain">';