From eab1e02e4c6e1d55b13b0d5fd8b7c2a2a7d2c57b Mon Sep 17 00:00:00 2001 From: Nicolas Rosset Date: Thu, 29 Apr 2021 18:28:09 +0200 Subject: [PATCH 01/14] Missing some var declarations --- tarteaucitron.js | 22 ++++++++++++---------- tarteaucitron.services.js | 2 ++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 698397a..879fc21 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -293,7 +293,7 @@ var tarteaucitron = { } document.getElementsByTagName('head')[0].appendChild(customThemePopup); } - + var body = document.body, div = document.createElement('div'), html = '', @@ -660,7 +660,7 @@ var tarteaucitron = { // add a little timeout to be sure everything is accessible setTimeout(function () { - + // Setup events tarteaucitron.addClickEventToId("tarteaucitronCloseCross", function () { tarteaucitron.userInterface.closeAlert(); @@ -710,7 +710,8 @@ var tarteaucitron = { tarteaucitron.addClickEventToId("tarteaucitronCTAButton", function () { location.reload(); }); - var toggleBtns = document.getElementsByClassName("catToggleBtn"), i; + var i, + toggleBtns = document.getElementsByClassName("catToggleBtn"), i; for (i = 0; i < toggleBtns.length; i++) { toggleBtns[i].dataset.index = i; tarteaucitron.addClickEventToElement(toggleBtns[i], function () { @@ -735,7 +736,7 @@ var tarteaucitron = { tarteaucitron.events.load(); } }, 500); - + }); }); }, @@ -908,12 +909,12 @@ var tarteaucitron = { } else { document.getElementById(id).style[property] = value; - + if (property == "display" && value == "block" && (id == "tarteaucitron" || id == "tarteaucitronAlertBig")) { document.getElementById(id).style["opacity"] = "0"; setTimeout(function() {document.getElementById(id).style["opacity"] = "1";}, 1); } - + if (property == "display" && value == "block" && id == "tarteaucitronBack") { document.getElementById(id).style["opacity"] = "0"; setTimeout(function() {document.getElementById(id).style["opacity"] = "0.7";}, 1); @@ -1110,10 +1111,10 @@ var tarteaucitron = { groupallowed = 0; for (var ii = 0; ii < doc.children.length; ii++) { if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsDenied") { - groupdenied++; + groupdenied++; } if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsAllowed") { - groupallowed++; + groupallowed++; } } if (total === groupallowed) { @@ -1128,8 +1129,8 @@ var tarteaucitron = { tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied'); tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed'); } - groupdenied = 0; - groupallowed = 0; + groupdenied = 0; + groupallowed = 0; }); }, @@ -1931,6 +1932,7 @@ var tarteaucitron = { /** Utility function to Add or update the fields of obj1 with the ones in obj2 */ + var key; for(key in custom){ if(custom[key] instanceof Object){ source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]); diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 6174d79..c76dd56 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -1807,6 +1807,7 @@ tarteaucitron.services.googlemaps = { return '
'; }); + var i; for (i = 0; i < uniqIds.length; i += 1) { mapOptions = { zoom: parseInt(document.getElementById(uniqIds[i]).getAttribute('zoom'), 10), @@ -2782,6 +2783,7 @@ tarteaucitron.services.twitterembed = { }); tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs', function () { + var i; for (i = 0; i < uniqIds.length; i += 1) { e = document.getElementById(uniqIds[i]); twttr.widgets.createTweet( From d9e46aa37c411f480821d25340deda864a2ce5c2 Mon Sep 17 00:00:00 2001 From: Cedric Puchalver Date: Sat, 1 May 2021 03:50:32 +0200 Subject: [PATCH 02/14] Add Bandcamp service --- tarteaucitron.services.js | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index fb2b50d..11dea6b 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -4107,3 +4107,58 @@ tarteaucitron.services.ausha = { }); } }; + +// bandcamp +tarteaucitron.services.bandcamp = { + key: "bandcamp", + type: "video", + name: "Bandcamp", + uri: "https://bandcamp.com", + readmoreLink: "https://bandcamp.com/privacy", + needConsent: true, + cookies: ['client_id', 'BACKENDID', '_comm_playlist'], + js: function () { + "use strict"; + tarteaucitron.fallback(['bandcamp_player'], function (x) { + var frame_title = tarteaucitron.fixSelfXSS(x.getAttribute("title") || 'Bandcamp iframe'), + album_id = x.getAttribute("albumID"), + bandcamp_width = x.getAttribute("width"), + frame_width = 'width=', + bandcamp_height = x.getAttribute("height"), + frame_height = 'height=', + attrs = ["size", "bgcol", "linkcol", "artwork", "minimal", "tracklist", "package", "transparent"], + params = attrs.filter(function (a) { + return x.getAttribute(a) !== null; + }).map(function (a) { + if (a && a.length > 0) return a + "=" + x.getAttribute(a); + }).join("/"); + + if (album_id === null) { + return ""; + } + + if (bandcamp_width !== null || bandcamp_width !== "") { + frame_width += '"' + bandcamp_width + '" '; + } else { + frame_width += '"" '; + } + if (bandcamp_height !== null || bandcamp_height !== "") { + frame_height += '"' + bandcamp_height + '" '; + } else { + frame_height += '"" '; + } + + var src = 'https://bandcamp.com/EmbeddedPlayer/album=' + album_id + '/' + params; + + return ''; + }); + }, + fallback: function () { + "use strict"; + tarteaucitron.fallback(['bandcamp_player'], function (elem) { + elem.style.width = elem.getAttribute('width'); + elem.style.height = elem.getAttribute('height'); + return tarteaucitron.engage('bandcamp'); + }); + } +} From ed931c45e2fff5e3718c73fc27d9fd52c5d9eb21 Mon Sep 17 00:00:00 2001 From: Nicolas Rosset Date: Wed, 12 May 2021 10:42:54 +0200 Subject: [PATCH 03/14] Fix typo --- tarteaucitron.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 879fc21..cf82a1e 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -710,8 +710,7 @@ var tarteaucitron = { tarteaucitron.addClickEventToId("tarteaucitronCTAButton", function () { location.reload(); }); - var i, - toggleBtns = document.getElementsByClassName("catToggleBtn"), i; + var toggleBtns = document.getElementsByClassName("catToggleBtn"), i; for (i = 0; i < toggleBtns.length; i++) { toggleBtns[i].dataset.index = i; tarteaucitron.addClickEventToElement(toggleBtns[i], function () { From 64dd5b91c48f132afd1b8564a0fa13bda4bcb501 Mon Sep 17 00:00:00 2001 From: Boulaffas Amine Date: Mon, 17 May 2021 08:39:24 +0100 Subject: [PATCH 04/14] Youtube (Js API) URI redirect to Error 404 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error 404 (Introuvable)!!1 L'URL demandée est introuvable sur ce serveur. --- tarteaucitron.services.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 3519dde..98cc3db 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -4061,7 +4061,7 @@ tarteaucitron.services.youtubeapi = { "key": "youtubeapi", "type": "video", "name": "Youtube (Js API)", - "uri": "https://policies.google.com/privacy/", + "uri": "https://policies.google.com/privacy", "needConsent": true, "cookies": [], "js": function () { From d3b6f63e5bc27215fa75f9e434a7a8dfb7cbfd26 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Thu, 20 May 2021 18:59:08 +0200 Subject: [PATCH 05/14] Check if cookie exist before purge --- tarteaucitron.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 31367cb..f3821de 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -1534,9 +1534,13 @@ var tarteaucitron = { var i; for (i = 0; i < arr.length; i += 1) { - document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;'; - document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';'; - document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';'; + + var rgxpCookie = new RegExp("^(.*;)?\\s*" + arr[i] + "\\s*=\\s*[^;]+(.*)?$"); + if (document.cookie.match(rgxpCookie)) { + document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;'; + document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';'; + document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';'; + } } }, "checkCount": function (key) { From 3fb12315ec990b7ccdde78da611202554861dc84 Mon Sep 17 00:00:00 2001 From: Nicolas Rosset Date: Tue, 1 Jun 2021 18:53:04 +0200 Subject: [PATCH 06/14] Declare var in for --- tarteaucitron.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 5c68c24..908b194 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -1940,8 +1940,7 @@ var tarteaucitron = { /** Utility function to Add or update the fields of obj1 with the ones in obj2 */ - var key; - for(key in custom){ + for(var key in custom){ if(custom[key] instanceof Object){ source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]); }else{ From 08e9da45a5f57744cc6ed0a0228b065f42687f36 Mon Sep 17 00:00:00 2001 From: BuyukCem Date: Wed, 2 Jun 2021 17:31:09 +0200 Subject: [PATCH 07/14] add Lt Trad --- lang/tarteaucitron.lt.js | 84 ++++++++++++++++++++++++++++++++++++++++ tarteaucitron.js | 2 +- 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 lang/tarteaucitron.lt.js diff --git a/lang/tarteaucitron.lt.js b/lang/tarteaucitron.lt.js new file mode 100644 index 0000000..52044c9 --- /dev/null +++ b/lang/tarteaucitron.lt.js @@ -0,0 +1,84 @@ +/*global tarteaucitron */ +tarteaucitron.lang = { + "middleBarHead": "☝ 🍪", + "adblock": "Sveiki! Ši svetainė veikia skaidriai ir leidžia pasirinkti trečiosios šalies paslaugas, kurias norite leisti.", + "adblock_call": "Norėdami pradėti taikyti, išjunkite ,Adblocker", + "reload": "Atnaujinkite puslapį", + + "alertBigScroll": "Tęsiant slankiojimą", + "alertBigClick": "Jei ir toliau naršote šioje svetainėje,", + "alertBig": "leidžiate naudotis visomis trečiųjų šalių paslaugomis", + + "alertBigPrivacy": "Ši svetainė naudoja slapukus ir suteikia jums galimybę valdyti, ką norite suaktyvinti", + "alertSmall": "Tvarkykite paslaugas", + "personalize": "Suasmeninkite", + "acceptAll": "Gerai, priimu visus", + "close": "Uždaryti", + + "privacyUrl": "Privatumo politika", + + "all": "Pirmenybė visoms paslaugoms", + + "info": "Jūsų privatumo apsauga", + "disclaimer": "Leisdami šias trečiųjų šalių paslaugas, jūs sutinkate su jų slapukais ir sekimo technologijų naudojimu, reikalingu jų tinkamam veikimui.", + "allow": "Leisti", + "deny": "Atsisakyti", + "noCookie": "Ši paslauga nenaudoja slapukų.", + "useCookie": "Ši paslauga gali būti įdiegta", + "useCookieCurrent": "Ši paslauga įdiegta", + "useNoCookie": "Ši paslauga neįdiegė jokių slapukų.", + "more": "Skaityti daugiau", + "source": "Peržiūrėkite oficialią svetainę", + "credit": "Slapukų tvarkyklė, kurią pateikė tarteaucitron.js", + "noServices": "Šioje svetainėje nenaudojami jokie slapukai, kuriems reikalingas jūsų sutikimas.", + + "toggleInfoBox": "Rodyti / slėpti informaciją apie slapukų saugojimą", + "title": "Slapukų valdymo skydelis", + "cookieDetail": "Išsami slapuko informacija", + "ourSite": "mūsų svetainėje", + "newWindow": "(naujas langas)", + "allowAll": "Leisti visus slapukus", + "denyAll": "Atsisakyti visų slapukų", + + "icon": "Cookies", + + "fallback": "yra išjungtas.", + "allowed": "leidžiama", + "disallowed": "neleidžiama", + + "ads": { + "title": "Reklamos tinklas", + "details": "Reklamos tinklai gali gauti pajamų, parduodami reklamos vietą svetainėje." + }, + "analytic": { + "title": "Auditorijos matavimas", + "details": "Naudotos auditorijos vertinimo paslaugos generuoti naudingą statistinį lankomumą svetainės veiklos patobulinimui." + }, + "social": { + "title": "Socialiniai tinklai", + "details": "Socialiniai tinklai gali pagerinti svetainės naudojimą ir padėti ją reklamuoti per akcijas." + }, + "video": { + "title": "Vaizdo įrašai", + "details": "Vaizdo įrašų bendrinimo paslaugos padeda pritraukti gausesnę media į svetainę ir padidinti jos matomumą." + }, + "comment": { + "title": "Komentarai", + "details": "Komentarų valdytojai palengvina komentarų sisteminimą ir kovoja su šlamštu." + }, + "support": { + "title": "Pagalba", + "details": "Pagalbos paslaugos leidžia jums susisiekti su svetainės komanda ir padėti ją tobulinti." + }, + "api": { + "title": "APIs (Aplikacijų programavimo sąsajos)", + "details": "API naudojamos tekstams įkelti: geografinė padėtis, paieškos sistemos, vertimai, ..." + }, + "other": { + "title": "Kita", + "details": "Paslaugos, rodančios svetainės turinį." + }, + + "mandatoryTitle": "Privalomi slapukai", + "mandatoryText": "Ši svetainė naudoja slapukus, reikalingus tinkamam jos veikimui, kurių negalima išjungti." +}; diff --git a/tarteaucitron.js b/tarteaucitron.js index 908b194..35bbc95 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -1694,7 +1694,7 @@ var tarteaucitron = { "getLanguage": function () { "use strict"; - var availableLanguages = 'bg,ca,cn,cs,da,de,el,en,es,fi,fr,hu,it,ja,lv,nl,no,oc,pl,pt,ro,ru,se,sk,sv,tr,vi,zh', + var availableLanguages = 'bg,ca,cn,cs,da,de,el,en,es,fi,fr,hu,it,ja,lt,lv,nl,no,oc,pl,pt,ro,ru,se,sk,sv,tr,vi,zh', defaultLanguage = 'en'; if (tarteaucitronForceLanguage !== '') { From cb88ecc15844e4b4d59818ff47628b27471d4cf0 Mon Sep 17 00:00:00 2001 From: Matthieu Lefort Date: Wed, 16 Jun 2021 10:03:20 +0200 Subject: [PATCH 08/14] Add "main" property to package.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajout du param "main" dans le package.json pour éviter une erreur "package not found" (https://docs.npmjs.com/cli/v7/configuring-npm/package-json#main) --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 2ddae8f..1cd2bf6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "tarteaucitronjs", "version": "1.9.1", + "main": "tarteaucitron.js", "description": "Comply to the European cookie law", "dependencies": {}, "devDependencies": {}, From fba87808b7e5adc869932d49c6eb4c5fc18909d5 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Wed, 16 Jun 2021 19:02:37 +0200 Subject: [PATCH 09/14] Accessibility improvement --- tarteaucitron.js | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 35bbc95..69b8c96 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -311,7 +311,7 @@ var tarteaucitron = { // Step 3: prepare the html html += '
'; html += ''; - html += '