diff --git a/website/assets/js/app.js b/website/assets/js/app.js index 32f20c6d4a46d..97623a3322a6f 100644 --- a/website/assets/js/app.js +++ b/website/assets/js/app.js @@ -3,7 +3,6 @@ {{ $siteGeneration := site.Params.site_generation }} import '@ryangjchandler/spruce'; import 'alpinejs'; -import './cookie-banner' const sayHello = () => { console.log('Welcome to the Vector website and documentation!'); diff --git a/website/assets/js/cookie-banner.js b/website/assets/js/cookie-banner.js deleted file mode 100644 index 10afcfd6df806..0000000000000 --- a/website/assets/js/cookie-banner.js +++ /dev/null @@ -1,41 +0,0 @@ -window.addEventListener('load', function () { - const { env } = document.documentElement.dataset; - - if (env !== 'development') { - // add trustarc script to head - const trustarc = document.createElement('script'); - trustarc.setAttribute('src','https://consent.trustarc.com/v2/notice/ufocto'); - document.head.appendChild(trustarc); - - // add divs - const divA = document.createElement("div"); - const divB = document.createElement("div"); - divA.id = "teconsent"; - divA.style = "cursor: pointer; color:#fff" - divB.id = "consent-banner"; - divB.style = "position:fixed; bottom:0px; right:0px; width:100%;"; - document.body.appendChild(divA); - document.body.appendChild(divB); - - // update Cookie link - this.setTimeout(function () { - const banner = document.getElementById('consent-banner'); - const prefsElement = document.getElementById('teconsent'); - const cookieLink = document.querySelector('footer a[href*="/cookies"]'); - prefsElement.className = cookieLink.className; - - if (banner) { - // listen for click and remove banner to avoid interfering with - document.addEventListener('click', function (event) { - const targetElement = event.target; - if (targetElement.matches('#truste-consent-required') || targetElement.matches('#truste-consent-button')) { - banner.remove(); - } - }); - } - - // replace Cookie link with Prefs div - return (cookieLink && document.getElementById('teconsent').innerHTML.length > 0) ? cookieLink.replaceWith(prefsElement) : false; - }, 200); - } -});