Skip to content

Commit

Permalink
feat: update to tarteaucitron 1.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Cruiser13 committed Jul 25, 2023
1 parent eae2430 commit 2c819e0
Show file tree
Hide file tree
Showing 17 changed files with 2,121 additions and 318 deletions.
@@ -1,28 +1,27 @@

[![](https://data.jsdelivr.com/v1/package/npm/tarteaucitronjs/badge)](https://www.jsdelivr.com/package/npm/tarteaucitronjs)
[![npm](https://img.shields.io/npm/v/tarteaucitronjs.svg)](https://www.npmjs.com/package/tarteaucitronjs) [![GitHub contributors](https://img.shields.io/github/contributors/AmauriC/tarteaucitron.js.svg)](https://github.com/AmauriC/tarteaucitron.js/graphs/contributors) [![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/AmauriC)
[![npm](https://img.shields.io/npm/v/tarteaucitronjs.svg)](https://www.npmjs.com/package/tarteaucitronjs) [![GitHub contributors](https://img.shields.io/github/contributors/AmauriC/tarteaucitron.js.svg)](https://github.com/AmauriC/tarteaucitron.js/graphs/contributors) [![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/AmauriC) [![Rate this package](https://badges.openbase.com/js/rating/tarteaucitronjs.svg?token=jS4mC7aXh9xcs1pAcB0roiEUU+mrW0GjxVICITIltSw=)](https://openbase.com/js/tarteaucitronjs?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge)


![alt text](https://tarteaucitron.io/tarteaucitron.png "tarteaucitron.io")

👋 Hey, I'm Amauri, a french dev that build a GDPR friendly cookie manager.

tarteaucitron.js
================
Comply to the european cookie law is simple with the french *tarte au citron*.
tarteaucitron was initially a simple script for my personal blog (in 2013), a few months later, the Github repository is opened and tarteaucitron is now reliable and recognized.

# What is this script?
The european cookie law regulates the management of cookies and you should ask your visitors their consent before exposing them to third party services.

Clearly this script will:
- Disable all services by default,
- Display a banner on the first page view and a small one on other pages,
- Display a panel to allow or deny each services one by one,
- Activate services on the second page view if not denied,
- Store the consent in a cookie for 365 days.

Bonus:
- Load service when user click on Allow (without reload of the page),
- Incorporate a fallback system (display a link instead of social button and a static banner instead of advertising).


# Installation guide
[Visit tarteaucitron.io](https://tarteaucitron.io/)


# How to use

Expand All @@ -32,13 +31,15 @@ Bonus:
<script>
tarteaucitron.init({
"privacyUrl": "", /* Privacy policy url */
"bodyPosition": "bottom", /* or top to bring it as first element for accessibility */
"hashtag": "#tarteaucitron", /* Open the panel with this hashtag */
"cookieName": "tarteaucitron", /* Cookie name */
"orientation": "middle", /* Banner position (top - bottom - middle - popup) */
"groupServices": false, /* Group services by category */
"serviceDefaultState": "wait", /* Default state (true - wait - false) */
"showAlertSmall": false, /* Show the small banner on bottom right */
"cookieslist": false, /* Show the cookie list */
Expand All @@ -58,17 +59,24 @@ tarteaucitron.init({
"removeCredit": false, /* Remove credit link */
"moreInfoLink": true, /* Show more info link */
"useExternalCss": false, /* If false, the tarteaucitron.css file will be loaded */
"useExternalJs": false, /* If false, the tarteaucitron.services.js file will be loaded */
//"cookieDomain": ".my-multisite-domaine.fr", /* Shared cookie for subdomain website */
"readmoreLink": "", /* Change the default readmore link pointing to tarteaucitron.io */
"mandatory": true /* Show a message about mandatory cookies */
"mandatory": true, /* Show a message about mandatory cookies */
"mandatoryCta": true /* Show the disabled accept button when mandatory on */
});
</script>
```

# Create custom service
# Add a service
[Visit tarteaucitron.io](https://tarteaucitron.io/en/install/)

# Customization

## Create custom service
```js
tarteaucitron.services.mycustomservice = {
"key": "mycustomservice",
Expand All @@ -88,7 +96,56 @@ tarteaucitron.services.mycustomservice = {
};
```

## Thanks to the sponsors 😊
## Events

The following events are available:
* (document) `{SERVICE_KEY}_added` for each enabled service
* (document) `{SERVICE_KEY}_loaded` for each enabled service
* (document) `{SERVICE_KEY}_allowed` for each service when allowed
* (document) `{SERVICE_KEY}_disallowed ` for each service when disallowed

* (window) `tac.root_available`: the root element with panel has been created, services will be loaded
* (window) `tac.open_alert`
* (window) `tac.close_alert`
* (window) `tac.open_panel`
* (window) `tac.close_panel`

## Customize text

To change a translation, use `tarteaucitronCustomText` variable. It will be merge with the translation shipping with TAC. This variable must be defined before the initialization. For example:
```js
tarteaucitronCustomText = {
'support': {
'title': 'Support client',
},
'close': 'Enregistrer et fermer',
};
tarteaucitron.init(...);
```

There is a special case for engagement text. By the default, the engagement text is _{SERVICE_NAME} is disabled._, however you can change it per service. For example:
```js
tarteaucitronCustomText = {
'engage-twitter': 'Follow us on Twitter!'
};
```

# Thanks to the sponsors 😊

| ![Amaury Cleuziou](https://avatars.githubusercontent.com/u/26336203?v=4&s=60) | ![Peak Crypto](https://tarteaucitron.io/img/logo_peakcrypto.png) | |
|---|---|---|
| [Amaury Cleuziou](https://github.com/MoryCorp) - first sponsor 🎉 | [Peak Crypto](https://www.peakcrypto.com/) | |
| | | |


# 600M on the pro version

Every month, hundreds of millions of cookies 🍪 are placed after the user's consent or simply refused.

[![jsdelivr](https://tarteaucitron.io/jsdelivr.png)](https://www.jsdelivr.com/package/gh/AmauriC/tarteaucitron.js)

# Used by all type of website

Tarteaucitron has been around for years and is now used by thousands of companies, government sites, web agencies, ... 🦾

| Be the first sponsor! |
|:---:|
[![Builtwith](https://tarteaucitron.io/builtwith.png)](https://trends.builtwith.com/widgets/tarteaucitron.js)
@@ -0,0 +1,14 @@
# Security Policy

## Supported Versions


| Version | Supported |
| ------- | ------------------ |
| 1.x | :white_check_mark: |


## Reporting a Vulnerability

Please report any security vulnerabilities to amauri@tarteaucitron.io
I'll get back to you within 24 hours and fix the issue asap.
@@ -1,3 +1,21 @@
div#tarteaucitronMainLineOffset,.tarteaucitronBorder {border:0!important;}

#tarteaucitron [aria-pressed="true"] {
font-weight:700;
}

.tac_visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap; /* added line */
border: 0;
}

div#tarteaucitronAlertBig:focus {outline: 0;}

.tarteaucitron-modal-open{
Expand Down Expand Up @@ -44,7 +62,7 @@ span.tarteaucitronH3 {
html body #tarteaucitronRoot #tarteaucitron ul#tarteaucitronServices_mandatory .tarteaucitronDeny {
display: none!important;
}

html body #tarteaucitronRoot #tarteaucitron .tarteaucitronBorder button,
html body #tarteaucitronRoot #tarteaucitron .tarteaucitronAsk,
html body #tarteaucitronRoot #tarteaucitron .tarteaucitronName {
Expand Down Expand Up @@ -168,8 +186,8 @@ div#tarteaucitronServices {
}

#tarteaucitronServices::-webkit-scrollbar-thumb {
background-color: #ddd;
outline: 0px solid slategrey;
background-color: #ddd;
outline: 0px solid slategrey;
}

div#tarteaucitronServices {
Expand Down Expand Up @@ -224,9 +242,9 @@ div#tarteaucitronServices {
text-align: center !important;
}

#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk button {
margin-bottom: 5px;
}
#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk button {
margin-bottom: 5px;
}
}

@media screen and (min-width:768px) and (max-width:991px) {
Expand Down Expand Up @@ -283,7 +301,7 @@ div#tarteaucitronServices {
}

#tarteaucitron .tarteaucitronH1, #tarteaucitron .tarteaucitronH2, #tarteaucitron .tarteaucitronH3, #tarteaucitron .tarteaucitronH4, #tarteaucitron .tarteaucitronH5, #tarteaucitron .tarteaucitronH6 {
display: block;
display: block;
}

.cookie-list {
Expand All @@ -305,7 +323,7 @@ div#tarteaucitronServices {
#tarteaucitronRoot * {
box-sizing: initial;
color: #333;
font-family: sans-serif !important;
/*font-family: sans-serif !important;*/
font-size: 14px;
line-height: normal;
vertical-align: initial;
Expand Down Expand Up @@ -526,7 +544,7 @@ div#tarteaucitronServices {
#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk .tarteaucitronAllow,
#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk .tarteaucitronDeny,
.tac_activate .tarteaucitronAllow {
background: gray;
background: #555;
border-radius: 4px;
color: #fff;
cursor: pointer;
Expand All @@ -548,13 +566,18 @@ div#tarteaucitronServices {
opacity: 1;
}

#tarteaucitron #tarteaucitronServices .tarteaucitronLine.tarteaucitronIsAllowed .tarteaucitronAllow {
#tarteaucitron #tarteaucitronServices .tarteaucitronLine.tarteaucitronIsAllowed .tarteaucitronAllow,
#tarteaucitron #tarteaucitronServices #tarteaucitronServices_mandatory .tarteaucitronLine button.tarteaucitronAllow {
background-color: #1B870B;
}
#tarteaucitron #tarteaucitronServices .tarteaucitronLine.tarteaucitronIsDenied .tarteaucitronDeny {
background-color: #9C1A1A;
}

#tarteaucitron #tarteaucitronServices #tarteaucitronServices_mandatory .tarteaucitronLine button.tarteaucitronAllow{
opacity: 0.4;
}

#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName .tarteaucitronListCookies {
color: #333;
font-size: 12px;
Expand Down Expand Up @@ -923,15 +946,16 @@ div.amazon_product {
height:240px;
width:120px;
}

.tarteaucitronIsAllowed .tarteaucitronDeny {
opacity: 0.4!important;
}.tarteaucitronIsDenied .tarteaucitronAllow {
opacity: 0.4!important;
}.tarteaucitronIsAllowed .tarteaucitronAllow {
opacity: 1!important;
}.tarteaucitronIsDenied .tarteaucitronDeny {
opacity: 1!important;
}
opacity: 0.4!important;
}.tarteaucitronIsAllowed .tarteaucitronAllow {
opacity: 1!important;
}.tarteaucitronIsDenied .tarteaucitronDeny {
opacity: 1!important;
}
.tarteaucitronLine .tarteaucitronAllow, .tarteaucitronLine .tarteaucitronDeny {
opacity: 0.4;
}
Expand Down Expand Up @@ -991,4 +1015,4 @@ span.tarteaucitronTitle.tarteaucitronH3 {

.tarteaucitron-display-none {
display: none;
}
}
@@ -0,0 +1,86 @@
/*global tarteaucitron */
tarteaucitron.lang = {

"middleBarHead": "☝ 🍪",
"adblock": "مرحبا! يلعب هذا الموقع الكتروني على الشفافية ويمنحك اختيار خدمات الطرف الثالث للتفعيل.",
"adblock_call": "يرجى إلغاء تنشيط adblocker لبدء التخصيص.",
"reload": "أعد تحميل الصفحة",

"alertBigScroll": "من خلال الاستمرار في العرض",
"alertBigClick": "من خلال إستمرارك بالتصفُّح على هذا الموقع",
"alertBig": "أنت توافق استخدام خدمات الطرف الثالث التي يمكنها تثبيت ملفات تعريف الارتباط",

"alertBigPrivacy": "يستخدم هذا الموقع ملفات تعريف الارتباط ويمنحك التحكم في تلك التي تريد تنشيطها",
"alertSmall": "إدارة الخدمات",
"acceptAll": "تقبل كل شيء",
"personalize": "تخصيص",
"close": "اغلاق",

"privacyUrl": "سياسة الخصوصية",

"all": "التفضيلات لجميع الخدمات",

"info": "حماية خصوصيتك",
"disclaimer": "من خلال تفويض هذه خدمات الطرف الثالث ، فإنك تقبل إيداع وقراءة ملفات تعريف الارتباط واستخدام تقنيات المراقبة اللازمة لعملها بشكل صحيح",
"allow": "سماح",
"deny": "منع",
"noCookie": "لا تقوم هذه الخدمة بإيداع أي ملفات تعريف ارتباط",
"useCookie": "يمكن لهذه الخدمة الإيداع",
"useCookieCurrent": "قدَّمت هذه الخدمة",
"useNoCookie": "لم تودع هذه الخدمة أي ملفات تعريف ارتباط.",
"more": "اقرأ المزيد",
"source": "شاهد الموقع الرسمي",
"credit": "إدارة ملفات تعريف الارتباط من قبل tarteaucitron.js",
"noServices": "لا يستخدم هذا الموقع أي ملفات تعريف ارتباط تتطلب موافقتك.",

"toggleInfoBox": "إظهار/إخفاء معلومات حول تخزين ملفات تعريف الارتباط",
"title": "لوحة إدارة ملفات تعريف الارتباط",
"cookieDetail": "تفاصيل ملفات تعريف الارتباط",
"ourSite": "على موقعنا على الانترنت",
"modalWindow": "(نافذة شكلية)",
"newWindow": "(نافذة جديدة)",
"allowAll": "قبول كل شيء",
"denyAll": "رفض كل شيء",

"icon": "ملفات تعريف الارتباط",

"fallback": "معطل.",
"allowed": "مسموح",
"disallowed": "ممنوع",

"ads": {
"title": "وكالات الإعلان",
"details": "تجعل وكالات الإعلان من الممكن تحقيق إيرادات من خلال تسويق المساحة الإعلانية على الموقع"
},
"analytic": {
"title": "قياس الجمهور",
"details": "تسمح خدمات قياس الجمهور بانشاء إحصاءآت حول حركة المرور المفيذة لتحسين الموقع"
},
"social": {
"title": "الشبكات الاجتماعية",
"details": "تعمل الشبكات الاجتماعية على تحسين سهولة استخدام الموقع وتساعد في الترويج له من خلال المشاركة."
},
"video": {
"title": "الفيديوهات",
"details": "تعمل خدمات مشاركة الفيديو على إثراء الموقع بمحتوى الوسائط المتعددة وزيادة ظهوره."
},
"comment": {
"title": "تعليقات",
"details": "يقوم مديري التعليق بتسهيل إيداع تعليقاتك ومحاربة البريد المزعج."
},
"support": {
"title": "الدعم",
"details": "تسمح لك خدمات الدعم بالتواصل مع فريق الموقع ومساعدة تحسينه."
},
"api": {
"title": "واجهات برمجة التطبيقات",
"details": "تسمح لك واجهات برمجة التطبيقات بتحميل البرامج النصية: تحديد الموقع الجغرافي ، ومحركات البحث ، والترجمات ، ..."
},
"other": {
"title": "آخر",
"details": "خدمات لعرض محتوى الويب"
},

"mandatoryTitle": "ملفات تعريف الارتباط الإلزامية",
"mandatoryText": "يستخدم هذا الموقع ملفات تعريف الارتباط الضرورية لعمله بشكل صحيح. لا يمكن تعطيلها"
};

0 comments on commit 2c819e0

Please sign in to comment.