Skip to content

Commit

Permalink
release v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsitek committed Feb 4, 2022
1 parent 2b9ca6a commit 72b2ec1
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Size](https://img.shields.io/github/size/danielsitek/dgp-cookie-consent/dist/cookies.min.js)
[![Stable version](https://img.shields.io/github/v/release/danielsitek/dgp-cookie-consent)](https://github.com/danielsitek/dgp-cookie-consent/releases)
[![CDN](https://img.shields.io/badge/CDN-orange?style=flat&logo=jsdelivr&logoColor=white)](https://cdn.jsdelivr.net/gh/danielsitek/dgp-cookie-consent@1.3.0/dist/cookies.min.js)
[![CDN](https://img.shields.io/badge/CDN-orange?style=flat&logo=jsdelivr&logoColor=white)](https://cdn.jsdelivr.net/gh/danielsitek/dgp-cookie-consent@1.4.0/dist/cookies.min.js)
[![Maintainability](https://api.codeclimate.com/v1/badges/27b5b5b749d18039f303/maintainability)](https://codeclimate.com/github/danielsitek/dgp-cookie-consent/maintainability)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/65b56152a2a84981b10576ad7081411d)](https://www.codacy.com/gh/danielsitek/dgp-cookie-consent/dashboard)

Expand Down Expand Up @@ -53,7 +53,7 @@ Awesome one-of-a-kind Cookie Consent panel.
1. Download the latest release or use CDN.

```
https://cdn.jsdelivr.net/gh/danielsitek/dgp-cookie-consent@1.3.0/dist/cookies.min.js
https://cdn.jsdelivr.net/gh/danielsitek/dgp-cookie-consent@1.4.0/dist/cookies.min.js
```

1. Insert this code on the bottom of the page, or [inject it via GTM](#gtm-implementation).
Expand Down Expand Up @@ -556,7 +556,7 @@ window.addEventListener('consent-ready', () => {
(function cookiesInit() {
var scriptEl = document.createElement('script');
scriptEl.src = 'https://cdn.jsdelivr.net/gh/danielsitek/dgp-cookie-consent@1.3.0/dist/cookies.min.js';
scriptEl.src = 'https://cdn.jsdelivr.net/gh/danielsitek/dgp-cookie-consent@1.4.0/dist/cookies.min.js';
scriptEl.type = 'text/javascript';
scriptEl.id = 'cookie-consent';
Expand Down
2 changes: 1 addition & 1 deletion dist/cookies.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zoot/cookie-consent",
"version": "1.3.0",
"version": "1.4.0",
"description": "ZOOT cookie consent",
"main": "dist/cookies.js",
"files": [
Expand Down
111 changes: 107 additions & 4 deletions public/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

(function cookiesInit() {
var scriptEl = document.createElement('script');
scriptEl.src = 'https://cdn.jsdelivr.net/gh/danielsitek/dgp-cookie-consent@1.3.0/dist/cookies.min.js';
scriptEl.src = 'https://cdn.jsdelivr.net/gh/danielsitek/dgp-cookie-consent@1.4.0/dist/cookies.min.js';
scriptEl.type = 'text/javascript';
scriptEl.id = 'cookie-consent-main';

Expand Down Expand Up @@ -173,18 +173,18 @@
window.addEventListener('consent-show', function () {
dataLayer.push({
'event': 'cookie_consent_bar_show'
}};
});
});

window.addEventListener('consent-hide', function () {
dataLayer.push({
'event': 'cookie_consent_bar_hide'
}};
});
});

(function cookiesInit() {
var scriptEl = document.createElement('script');
scriptEl.src = 'https://cdn.jsdelivr.net/gh/danielsitek/dgp-cookie-consent@1.3.0/dist/cookies.min.js';
scriptEl.src = 'https://cdn.jsdelivr.net/gh/danielsitek/dgp-cookie-consent@1.4.0/dist/cookies.min.js';
scriptEl.type = 'text/javascript';
scriptEl.id = 'cookie-consent-main';

Expand All @@ -193,3 +193,106 @@

})();
</script>


<script type="text/javascript" id="cookie-consent-init">
var DENIED = 'denied';
var GRANTED = 'granted';

function dataLayerPush() {
dataLayer.push(arguments);
}

// Optional: add own translations
window.CookieConsentTranslations = {
locale: 'cs-CZ',
tabAgree: {
title: 'Souhlas',
body: '<p><strong>Tato webová stránka používá cookies</strong></p><p>K personalizaci obsahu a reklam, poskytování funkcí sociálních médií a analýze naší návštěvnosti využíváme soubory cookie. Informace o tom, jak náš web používáte, sdílíme se svými partnery pro sociální média, inzerci a analýzy. Partneři tyto údaje mohou zkombinovat s dalšími informacemi, které jste jim poskytli nebo které získali v důsledku toho, že používáte jejich služby.</p>',
},
tabAbout: {
title: 'O aplikaci',
body: '<p>Cookies jsou malé textové soubory, které mohou být používány webovými stránkami, aby učinily uživatelský zážitek více efektivní.</p><p>Zákon uvádí, že můžeme ukládat cookies na vašem zařízení, pokud jsou nezbytně nutné pro provoz této stránky. Pro všechny ostatní typy cookies potřebujeme vaše povolení.</p><p>Tato stránka používá různé typy cookies. Některé cookies jsou umístěny službami třetích stran, které se objevují na našich stránkách.</p><p>Kdykoliv můžete změnit nebo zrušit svůj souhlas prostřednictvím Vyjádření o souborech cookie na našich webových stránkách.</p>',
},
tabDetail: {
title: 'Detail',
necessary: {
title: 'Nutné',
perex: 'Nutné cookies pomáhají, aby byla webová stránka použitelná tak, že umožní základní funkce jako navigace stránky a přístup k zabezpečeným sekcím webové stránky. Webová stránka nemůže správně fungovat bez těchto cookies.',
},
preferences: {
title: 'Preferenční',
perex: 'Preferenční cookies umožňují, aby si webová stránka zapamatovala informace, které mění, jak se webová stránka chová nebo jak vypadá. Je to například preferovaný jazyk nebo region, kde se nacházíte.',
},
statistics: {
title: 'Statistické',
perex: 'Statistické cookies pomáhají majitelům webových stránek, aby porozuměli, jak návštěvníci používají webové stránky. Anonymně sbírají a sdělují informace.',
},
marketing: {
title: 'Marketingové',
perex: 'Marketingové cookies jsou používány pro sledování návštěvníků na webových stránkách. Záměrem je zobrazit reklamu, která je relevantní a zajímavá pro jednotlivého uživatele a tímto hodnotnější pro vydavatele a inzerenty třetích stran.',
},
},
buttonEdit: {
label: 'Upravit',
},
buttonAllowAll: {
label: 'Povolit vše',
},
buttonRejectAll: {
label: 'Odmítnout vše',
},
buttonConfirm: {
label: 'Uložit',
},
lastUpdated: 'Prohlášení o cookies bylo naposledy aktualizováno %date.',
};

// Optional: add own theme
// window.CookieConsentTheme = {};

// Send default consent with actual consent options.
window.addEventListener('consent-ready', function () {
dataLayerPush('consent', 'default', {
'ad_storage': window.CookieConsent.marketing ? GRANTED : DENIED,
'analytics_storage': window.CookieConsent.statistics ? GRANTED : DENIED,
'personalization_storage': window.CookieConsent.preferences ? GRANTED : DENIED,
'functionality_storage': GRANTED,
'security_storage': GRANTED,
});
});

// Send updated consent with actual consent options.
window.addEventListener('consent-updated', function () {
dataLayerPush('consent', 'update', {
'ad_storage': window.CookieConsent.marketing ? GRANTED : DENIED,
'analytics_storage': window.CookieConsent.statistics ? GRANTED : DENIED,
'personalization_storage': window.CookieConsent.preferences ? GRANTED : DENIED,
'functionality_storage': GRANTED,
'security_storage': GRANTED,
});
});

// Send event to dataLayer on consent window open
window.addEventListener('consent-show', function () {
dataLayer.push({
'event': 'cookie_consent_bar_show'
});
});

// Send event to dataLayer on consent window close.
window.addEventListener('consent-hide', function () {
dataLayer.push({
'event': 'cookie_consent_bar_hide'
});
});

(function cookiesInit() {
var scriptEl = document.createElement('script');
scriptEl.src = 'https://cdn.jsdelivr.net/gh/danielsitek/dgp-cookie-consent@1.4.0/dist/cookies.min.js';
scriptEl.type = 'text/javascript';
scriptEl.id = 'cookie-consent';

document.body.appendChild(scriptEl);
})();
</script>

0 comments on commit 72b2ec1

Please sign in to comment.