diff --git a/README.md b/README.md index c59d5d9..01a6e25 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/SASAICAGENCY) - +[![](https://data.jsdelivr.com/v1/package/gh/AmauriC/tarteaucitron.js/badge)](https://www.jsdelivr.com/package/gh/AmauriC/tarteaucitron.js) +[![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) tarteaucitron.js ================ @@ -19,83 +19,6 @@ 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). -## Supported services -* Advertising network - * Amazon - * Clicmanager - * Criteo - * FERank (pub) - * Google Adsense - * Google Adsense Search (form) - * Google Adsense Search (result) - * Google Adwords (conversion) - * Google Adwords (remarketing) - * Pubdirecte - * Twenga - * vShop - -* APIs - * Google jsapi - * Google Maps - * Google Tag Manager - * Timeline JS - * Typekit (adobe) - -* Audience measurement - * Alexa - * Clicky - * Crazyegg - * FERank - * Get+ - * Google Analytics (ga.js) - * Google Analytics (universal) - * StatCounter - * VisualRevenue - * Xiti - -* Comment - * Disqus - * Facebook (commentaire) - -* Social network - * AddThis - * AddToAny (feed) - * AddToAny (share) - * eKomi - * Facebook - * Facebook (like box) - * Google+ - * Google+ (badge) - * Linkedin - * Pinterest - * Shareaholic - * ShareThis - * Twitter - * Twitter (cards) - * Twitter (timelines) - -* Support - * UserVoice - * Zopim - -* Video - * Calameo - * Dailymotion - * Prezi - * SlideShare - * Vimeo - * YouTube - - -## Visitors outside the EU -In PHP for example, you can bypass all the script by setting this var `tarteaucitron.user.bypass = true;` if the visitor is not in the EU. - -## Tested on -- IE 6+ -- FF 3+ -- Safari 4+ -- Chrome 14+ -- Opera 10+ # Installation guide [Visit opt-out.ferank.eu](https://opt-out.ferank.eu/) @@ -108,15 +31,27 @@ In PHP for example, you can bypass all the script by setting this var `tarteauci ``` diff --git a/css/tarteaucitron.css b/css/tarteaucitron.css index d0f24c8..7a9bf75 100644 --- a/css/tarteaucitron.css +++ b/css/tarteaucitron.css @@ -1,3 +1,75 @@ +.modal-open{ + overflow: hidden; + height: 100%; +} + +#contentWrapper {display:unset;} + +/*** +* Reset CSS +*/ +#tarteaucitronRoot div, #tarteaucitronRoot span, #tarteaucitronRoot applet, #tarteaucitronRoot object, #tarteaucitronRoot iframe, #tarteaucitronRoot h1, #tarteaucitronRoot h2, #tarteaucitronRoot h3, #tarteaucitronRoot h4, #tarteaucitronRoot h5, #tarteaucitronRoot h6, #tarteaucitronRoot p, #tarteaucitronRoot blockquote, #tarteaucitronRoot pre, #tarteaucitronRoot a, #tarteaucitronRoot abbr, #tarteaucitronRoot acronym, #tarteaucitronRoot address, #tarteaucitronRoot big, #tarteaucitronRoot cite, #tarteaucitronRoot code, #tarteaucitronRoot del, #tarteaucitronRoot dfn, #tarteaucitronRoot em, #tarteaucitronRoot img, #tarteaucitronRoot ins, #tarteaucitronRoot kbd, #tarteaucitronRoot q, #tarteaucitronRoot s, #tarteaucitronRoot samp, #tarteaucitronRoot small, #tarteaucitronRoot strike, #tarteaucitronRoot strong, #tarteaucitronRoot sub, #tarteaucitronRoot sup, #tarteaucitronRoot tt, #tarteaucitronRoot var, #tarteaucitronRoot b, #tarteaucitronRoot u, #tarteaucitronRoot i, #tarteaucitronRoot center, #tarteaucitronRoot dl, #tarteaucitronRoot dt, #tarteaucitronRoot dd, #tarteaucitronRoot ol, #tarteaucitronRoot ul, #tarteaucitronRoot li, #tarteaucitronRoot fieldset, #tarteaucitronRoot form, #tarteaucitronRoot label, #tarteaucitronRoot legend, #tarteaucitronRoot table, #tarteaucitronRoot caption, #tarteaucitronRoot tbody, #tarteaucitronRoot tfoot, #tarteaucitronRoot thead, #tarteaucitronRoot tr, #tarteaucitronRoot th, #tarteaucitronRoot td, #tarteaucitronRoot article, #tarteaucitronRoot aside, #tarteaucitronRoot canvas, #tarteaucitronRoot details, #tarteaucitronRoot embed, #tarteaucitronRoot figure, #tarteaucitronRoot figcaption, #tarteaucitronRoot footer, #tarteaucitronRoot header, #tarteaucitronRoot hgroup, #tarteaucitronRoot menu, #tarteaucitronRoot nav, #tarteaucitronRoot output, #tarteaucitronRoot ruby, #tarteaucitronRoot section, #tarteaucitronRoot summary, #tarteaucitronRoot time, #tarteaucitronRoot mark, #tarteaucitronRoot audio, #tarteaucitronRoot video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; + /*background: initial;*/ + text-align: initial; + text-shadow: initial; +} +/* HTML5 display-role reset for older browsers */ +#tarteaucitronRoot article, #tarteaucitronRoot aside, #tarteaucitronRoot details, #tarteaucitronRoot figcaption, #tarteaucitronRoot figure, #tarteaucitronRoot footer, #tarteaucitronRoot header, #tarteaucitronRoot hgroup, #tarteaucitronRoot menu, #tarteaucitronRoot nav, #tarteaucitronRoot section { + display: block; +} +#tarteaucitronRoot ol, #tarteaucitronRoot ul { + list-style: none; +} +#tarteaucitronRoot blockquote, #tarteaucitronRoot q { + quotes: none; +} +#tarteaucitronRoot blockquote:before, #tarteaucitronRoot blockquote:after, #tarteaucitronRoot q:before, #tarteaucitronRoot q:after { + content: ''; + content: none; +} +#tarteaucitronRoot table { + border-collapse: collapse; + border-spacing: 0; +} + +#tarteaucitronRoot a:focus, #tarteaucitronRoot button:focus { + /*outline: 2px solid #cb3333;*/ +} + +/*** + * Better scroll management + */ +div#tarteaucitronMainLineOffset { + margin-top: 0!important; +} + +div#tarteaucitronServices { + margin-top: 21px!important; +} + +#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; +} + +div#tarteaucitronServices { + box-shadow: 0 0 35px #575757; +} + /*** * Responsive layout for the control panel */ @@ -25,18 +97,30 @@ 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 .tarteaucitronH2 { + max-width: 80%; + } + + #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk { + text-align: center !important; + } + + #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk button { + margin-bottom: 5px; + } } @media screen and (min-width:768px) and (max-width:991px) { @@ -56,6 +140,16 @@ zoom: 1; } +#tarteaucitronRoot div#tarteaucitron { + left: 0; + right: 0; + margin: auto; +} + +#tarteaucitronRoot button#tarteaucitronBack { + background: #eee; +} + #tarteaucitron .clear { clear: both; } @@ -67,15 +161,34 @@ text-decoration: none; } +#tarteaucitronRoot button { + background: transparent; + border: 0; +} + +#tarteaucitronAlertBig strong, #tarteaucitronAlertSmall strong, #tarteaucitronAlertBig a, #tarteaucitronAlertSmall a { color: #fff; } -#tarteaucitron b { +#tarteaucitron strong { font-size: 22px; font-weight: 500; } +#tarteaucitron ul { + padding: 0; +} + +#tarteaucitron .tarteaucitronH1, #tarteaucitron .tarteaucitronH2, #tarteaucitron .tarteaucitronH3, #tarteaucitron .tarteaucitronH4, #tarteaucitron .tarteaucitronH5, #tarteaucitron .tarteaucitronH6 { + display: block; +} + +.cookie-list { + list-style: none; + padding: 0; + margin: 0; +} /*** * Root div added just before */ @@ -96,6 +209,23 @@ vertical-align: initial; } +#tarteaucitronRoot .tarteaucitronH1 { + font-size: 1.5em; + text-align: center; + color: #fff; + margin: 15px 0 28px; +} + +#tarteaucitronRoot .tarteaucitronH2 { + display: inline-block; + margin: 12px 0 0 10px; + color: #fff; +} + +#tarteaucitronCookiesNumberBis.tarteaucitronH2 { + margin-left: 0; +} + /*** * Control panel */ @@ -153,9 +283,13 @@ width: 80%; } -#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronHidden, +.tarteaucitronSelfLink, #tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronHidden, #tarteaucitron #tarteaucitronServices .tarteaucitronHidden { background: rgba(51, 51, 51, 0.07); +}a.tarteaucitronSelfLink { + text-align: center!important; + display: block; + padding: 7px!important; } #tarteaucitron #tarteaucitronServices .tarteaucitronHidden { @@ -163,11 +297,15 @@ position: relative; } -#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronTitle, -#tarteaucitron #tarteaucitronServices .tarteaucitronTitle, -#tarteaucitron #tarteaucitronInfo, +#tarteaucitronCookiesList .tarteaucitronH3.tarteaucitronTitle { + width: 100%; + box-sizing: border-box; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronTitle, +#tarteaucitron #tarteaucitronServices .tarteaucitronTitle button, +#tarteaucitron #tarteaucitronInfo, #tarteaucitron #tarteaucitronServices .tarteaucitronDetails { - background: #333; color: #fff; display: inline-block; font-size: 14px; @@ -176,6 +314,7 @@ padding: 5px 20px; text-align: left; width: auto; + background: #333; } #tarteaucitron #tarteaucitronServices .tarteaucitronMainLine .tarteaucitronName a, @@ -199,6 +338,7 @@ #tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronTitle { padding: 5px 10px; + margin: 0; } #tarteaucitron #tarteaucitronInfo, @@ -250,7 +390,7 @@ margin-top: 2px; } -#tarteaucitron #tarteaucitronServices .tarteaucitronMainLine .tarteaucitronName b { +#tarteaucitron #tarteaucitronServices .tarteaucitronMainLine .tarteaucitronName button { color: #fff; } @@ -289,6 +429,7 @@ text-align: center; text-decoration: none; width: auto; + border: 0; } #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName .tarteaucitronListCookies { @@ -296,6 +437,16 @@ font-size: 12px; } +#tarteaucitron .tarteaucitronH3 { + font-size: 18px; +} + +#tarteaucitron #tarteaucitronMainLineOffset .tarteaucitronName { + width: auto!important; + margin-left: 0!important; + font-size: 14px; +} + /*** * Big alert */ @@ -307,7 +458,7 @@ bottom: 0; } -#tarteaucitronAlertBig { +#tarteaucitronRoot #tarteaucitronAlertBig { background: #333; color: #fff; display: none; @@ -316,22 +467,29 @@ padding: 5px 5%; position: fixed; text-align: center; - width: 90%; box-sizing: content-box; z-index: 2147483645; + text-align: center; + padding: 10px; + margin: auto; + width: 100%; } #tarteaucitronAlertBig #tarteaucitronDisclaimerAlert, -#tarteaucitronAlertBig #tarteaucitronDisclaimerAlert b { +#tarteaucitronAlertBig #tarteaucitronDisclaimerAlert strong { font: 15px verdana; color: #fff; } -#tarteaucitronAlertBig #tarteaucitronDisclaimerAlert b { +#tarteaucitronAlertBig #tarteaucitronDisclaimerAlert strong { font-weight: 700; } -#tarteaucitronAlertBig #tarteaucitronCloseAlert, #tarteaucitronAlertBig #tarteaucitronPersonalize { +#tarteaucitronAlertBig #tarteaucitronPrivacyUrl { + cursor: pointer; +} + +#tarteaucitronAlertBig #tarteaucitronCloseAlert, #tarteaucitronAlertBig #tarteaucitronPersonalize, #tarteaucitron #tarteaucitronPrivacyUrl { background: #008300; color: #fff; cursor: pointer; @@ -342,7 +500,7 @@ margin-left: 7px; } -#tarteaucitronAlertBig #tarteaucitronCloseAlert { +#tarteaucitronAlertBig #tarteaucitronCloseAlert, #tarteaucitron #tarteaucitronPrivacyUrl { background: #fff; color: #333; font-size: 13px; @@ -352,7 +510,7 @@ } #tarteaucitronPercentage { - background: #0A0; + background: #0A0!important; box-shadow: 0 0 2px #fff, 0 1px 2px #555; height: 5px; left: 0; @@ -364,9 +522,13 @@ /*** * Small alert */ + +.tarteaucitronAlertSmallTop,.tarteaucitronAlertSmallBottom { + bottom: 0; +} + #tarteaucitronAlertSmall { background: #333; - bottom: 0; display: none; padding: 0; position: fixed; @@ -453,7 +615,7 @@ text-align: left; } -#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList b { +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList strong { color: #333; } @@ -464,7 +626,7 @@ text-align: left; } -#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesTitle b { +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesTitle strong { color: #fff; font-size: 16px; } @@ -489,7 +651,7 @@ width: 50%; } -#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronCookiesListMain .tarteaucitronCookiesListLeft a b { +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronCookiesListMain .tarteaucitronCookiesListLeft a strong { color: darkred; } @@ -523,7 +685,7 @@ vertical-align: middle; } -.tac_activate .tac_float b { +.tac_activate .tac_float strong { color: #fff; } @@ -542,4 +704,46 @@ ins.ferank-publicite, ins.adsbygoogle { div.amazon_product { height:240px; width:120px; -} \ No newline at end of file +} +.tarteaucitronIsAllowed .tarteaucitronDeny { + opacity: 0.4!important; +}.tarteaucitronIsDenied .tarteaucitronAllow { + opacity: 0.4!important; +}.tarteaucitronIsAllowed .tarteaucitronAllow { + opacity: 1!important; +}.tarteaucitronIsDenied .tarteaucitronDeny { + opacity: 1!important; +} +.tarteaucitronLine .tarteaucitronAllow, .tarteaucitronLine .tarteaucitronAllow { + opacity: 0.4; +} + +div#tarteaucitronInfo { + display: block!important; + position: initial!important; + text-align: center!important; + max-width: 80%!important; + padding: 15px 0!important; + margin: -10px auto 40px!important; + font-size: 1em!important; + border-bottom: 1px solid; + border-top: 1px solid; + border-color: #555; +} + +a.tarteaucitronSelfLink { + position: absolute; + left: 0; + right: 0; + padding-top: 13px!important; + display: block; + text-shadow: 0 0 14px white; + text-transform: uppercase; +}.tarteaucitronMainLine .tarteaucitronH2 { + font-size: 1.2em!important; + margin-top: 4px!important; +} + +span.tarteaucitronTitle.tarteaucitronH3 { + margin-top: 12px!important; +} diff --git a/lang/tarteaucitron.bg.js b/lang/tarteaucitron.bg.js new file mode 100644 index 0000000..8476923 --- /dev/null +++ b/lang/tarteaucitron.bg.js @@ -0,0 +1,75 @@ +/*global tarteaucitron */ +tarteaucitron.lang = { + "adblock": "Здравей! Този сайт позволяа включването на бисквитки по избор.", + "adblock_call": "Моля изключете вашият adblocker и изберете бисквитките които искате, или спрете всички.", + "reload": "Презареди", + + "alertBigScroll": "Ако продължавате да скролвате,", + "alertBigClick": "Ако продължавате да използвате този сайт,", + "alertBig": "вив се съгласявате с всички бисквитки от трети лица.", + + "alertBigPrivacy": "Този сайт използва бисквитки и Ви дава право да изберете записването на определени или всички.", + "alertSmall": "Управление на услуги", + "personalize": "Ще избирам", + "acceptAll": "ОК, приемам всички", + "close": "Затвори", + + "privacyUrl": "Политика за поверителност", + + "all": "Услуги които записват бисквитки на този сайт", + + "info": "Зашитава вашата сигурност", + "disclaimer": "Позволяването на тези бисквитки от трети лица, Вие приемате те да записват и използват услуги за проследяване нужни за правилното им функциониране.", + "allow": "Разшреши", + "deny": "Забрани", + "noCookie": "Тази услуга не записва бисквитки.", + "useCookie": "Тази услуга може да запише", + "useCookieCurrent": "Тази услуга е записала", + "useNoCookie": "Тази услуга не е записала бисквитки.", + "more": "Прочети повече", + "source": "Официален сайт", + "credit": "Управление на бисквитките от tarteaucitron.js", + + "toggleInfoBox": "Покажи/скрий информация за записването на бисквитки", + "title": "Управление на бисквитките", + "cookieDetail": "Информация за", + "ourSite": "в нашият сайт", + "newWindow": "(нов прозорец)", + "allowAll": "Разреши всички", + "denyAll": "Забрани всички", + + "fallback": "е изключен.", + + "ads": { + "title": "Рекламодатели", + "details": "Ad networks can generate revenue by selling advertising space on the site." + }, + "analytic": { + "title": "Аналитични", + "details": "The audience measurement services used to generate useful statistics attendance to improve the site." + }, + "social": { + "title": "Социални", + "details": "Social networks can improve the usability of the site and help to promote it via the shares." + }, + "video": { + "title": "Видео платформи", + "details": "Video sharing services help to add rich media on the site and increase its visibility." + }, + "comment": { + "title": "Коментари", + "details": "Comments managers facilitate the filing of comments and fight against spam." + }, + "support": { + "title": "Поддръжка", + "details": "Support services allow you to get in touch with the site team and help to improve it." + }, + "api": { + "title": "Функционални", + "details": "APIs are used to load scripts: geolocation, search engines, translations, ..." + }, + "other": { + "title": "Други", + "details": "Services to display web content." + } +}; diff --git a/lang/tarteaucitron.cs.js b/lang/tarteaucitron.cs.js index 057d71f..1120254 100644 --- a/lang/tarteaucitron.cs.js +++ b/lang/tarteaucitron.cs.js @@ -13,6 +13,8 @@ tarteaucitron.lang = { "personalize": "Přizpůsobit", "acceptAll": "OK, přijmout vše", "close": "Zavřít", + + "privacyUrl": "Zásady ochrany osobních údajů", "all": "Nastavení všech služeb", @@ -27,6 +29,14 @@ tarteaucitron.lang = { "more": "Dozvědět se více", "source": "Zobrazit oficiální stránku", "credit": "Správce cookies od tarteaucitron.js", + + "toggleInfoBox": "Show/hide informations about cookie storage", + "title": "Cookies management panel", + "cookieDetail": "Cookie detail for", + "ourSite": "on our site", + "newWindow": "(new window)", + "allowAll": "Allow all cookies", + "denyAll": "Deny all cookies", "fallback": "je vypnutý.", diff --git a/lang/tarteaucitron.de.js b/lang/tarteaucitron.de.js index 23cdc5f..c39a1bd 100644 --- a/lang/tarteaucitron.de.js +++ b/lang/tarteaucitron.de.js @@ -13,6 +13,8 @@ tarteaucitron.lang = { "personalize": "Personalisieren", "acceptAll": "OK, akzeptiere alles", "close": "Beenden", + + "privacyUrl": "Datenschutz-Bestimmungen", "all": "Präferenz für alle Dienste", @@ -27,6 +29,14 @@ tarteaucitron.lang = { "more": "Weiter lesen", "source": "Zur offiziellen Webseite", "credit": "Cookies manager von tarteaucitron.js", + + "toggleInfoBox": "Show/hide informations about cookie storage", + "title": "Cookies management panel", + "cookieDetail": "Cookie detail for", + "ourSite": "on our site", + "newWindow": "(new window)", + "allowAll": "Allow all cookies", + "denyAll": "Deny all cookies", "fallback": "ist deaktiviert.", diff --git a/lang/tarteaucitron.el.js b/lang/tarteaucitron.el.js new file mode 100644 index 0000000..30b2b41 --- /dev/null +++ b/lang/tarteaucitron.el.js @@ -0,0 +1,75 @@ +/*global tarteaucitron */ +tarteaucitron.lang = { + "adblock": "Γεια σας! Ο ιστότοπος αυτός σας επιτρέπει να επιλέξετε τις υπηρεσίες που παρέχονται από τρίτους που θα θέλατε να επιτρέψετε.", + "adblock_call": "Παρακαλώ απενεργοποιήστε τα προγράμματα απόρριψης διαφημίσεων για να ξεκινήσετε τις τροποποιήσεις σας.", + "reload": "Ανανέωση της σελίδας", + + "alertBigScroll": "Συνεχίζοντας την ανάγνωση (κύλιση) της σελίδας,", + "alertBigClick": "Αν συνεχίσετε την περιήγηση σας στον ιστότοπο,", + "alertBig": "επιτρέπετε όλες τις υπηρεσίες που παρέχονται από τρίτους", + + "alertBigPrivacy": "Ο ιστότοπος αυτός χρησιμοποιεί "μπισκότα" (cookies) και σας επιτρέπει να ελέγξετε τι θέλετε να ενεργοποιήσετε", + "alertSmall": "Διαχείριση υπηρεσιών", + "personalize": "Εξατομίκευση", + "acceptAll": "OK, αποδοχή όλων", + "close": "Κλείσιμο", + + "privacyUrl": "Πολιτική απορρήτου", + + "all": "Προτίμηση για όλες τις υπηρεσίες", + + "info": "Προστασία των προσωπικών σας δεδομένων", + "disclaimer": "Επιτρέποντας αυτές τις υπηρεσίες που παρέχονται από τρίτους, αποδέχεστε τα "μπισκότα" (cookies) τους καθώς και τη χρήση τεχνολογιών παρακολούθησης που είναι απαραίτητες για τη λειτουργία τους.", + "allow": "Επέτρεψε", + "deny": "Απόρριψε", + "noCookie": "Η υπηρεσία αυτή δε χρησιμοποιεί "μπισκότα" (cookies).", + "useCookie": "Η υπηρεσία αυτή μπορεί να αποθηκεύσει ", + "useCookieCurrent": "Η υπηρεσία αυτή έχει αποθηκεύσει ", + "useNoCookie": "Η υπηρεσία αυτή δεν έχει αποθηκεύσει κανένα "μπισκότο" (cookie).", + "more": "Διαβάστε περισσότερα", + "source": "Δείτε τον επίσημο ιστότοπο", + "credit": "Cookies manager by tarteaucitron.js", + + "toggleInfoBox": "Προβολή/Απόκρυψη πληροφοριών για την αποθήκευση "μπισκότων" (cookies)", + "title": "Πίνακας διαχείρισης "Μπισκότων" (Cookies)", + "cookieDetail": "Λεπτομέρειες "μπισκότων" (cookies) για", + "ourSite": "στον ιστότοπο μας", + "newWindow": "(νέο παράθυρο)", + "allowAll": "Επέτρεψε όλα τα "μπισκότα" (cookies)", + "denyAll": "Απόρριψε όλα τα "μπισκότα" (cookies)", + + "fallback": "είναι απενεργοποιημένο.", + + "ads": { + "title": "Διαφημιστικό Δίκτυο", + "details": "Τα διαφημιστικά δίκτυα μπορούν να αποφέρουν εισόδημα πουλώντας διαφημιστικό χώρο στη σελίδα." + }, + "analytic": { + "title": "Μετρήσεις κοινού", + "details": "Οι υπηρεσίες μέτρησης κοινού χρησιμοποιούνται για τον υπολογισμό χρήσιμων στατιστικών επισκεψιμότητας του ιστοτόπου για την βελτίωση του." + }, + "social": { + "title": "Κοινωνικά δίκτυα", + "details": "Τα κοινωνικά δίκτυα μπορούν να βελτιώσουν την χρηστικότητα του ιστοτόπου και να τον προωθήσουν μέσω κοινοποιήσεων." + }, + "video": { + "title": "Βίντεο", + "details": "Υπηρεσίες διαμοιρασμού βίντεο που βοηθούν να παρουσιαστεί πλούσιο περιεχόμενο στον ιστότοπο και να αυξήσουν την αναγνωρισιμότητα του." + }, + "comment": { + "title": "Σχόλια", + "details": "Οι διαχειριστές σχολίων βοηθούν την καταχώρηση σχολίων και προστατεύουν από κακόβουλες ενέργειες." + }, + "support": { + "title": "Υποστήριξη", + "details": "Οι υποστηρικτικές υπηρεσίες σας επιτρέπουν να επικονωνείτε με την ομάδα υποστήριξης του ιστοτόπου και να βοηθήσετε στην βελτίωση του." + }, + "api": { + "title": "APIs", + "details": "Τα API χρησιμοποιούνται για την φόρτωση προγραμμάτων: αναγνώρισης τοποθεσίας, μηχανών αναζήτησης, μεταφράσεων, ..." + }, + "other": { + "title": "Λοιπές υπηρεσίες", + "details": "Υπηρεσίες που παρουσιάζουν άλλο περιεχόμενο." + } +}; diff --git a/lang/tarteaucitron.en.js b/lang/tarteaucitron.en.js index 90c8ebb..0d4bc0b 100644 --- a/lang/tarteaucitron.en.js +++ b/lang/tarteaucitron.en.js @@ -13,6 +13,8 @@ tarteaucitron.lang = { "personalize": "Personalize", "acceptAll": "OK, accept all", "close": "Close", + + "privacyUrl": "Privacy policy", "all": "Preference for all services", @@ -27,6 +29,14 @@ tarteaucitron.lang = { "more": "Read more", "source": "View the official website", "credit": "Cookies manager by tarteaucitron.js", + + "toggleInfoBox": "Show/hide informations about cookie storage", + "title": "Cookies management panel", + "cookieDetail": "Cookie detail for", + "ourSite": "on our site", + "newWindow": "(new window)", + "allowAll": "Allow all cookies", + "denyAll": "Deny all cookies", "fallback": "is disabled.", diff --git a/lang/tarteaucitron.es.js b/lang/tarteaucitron.es.js index 512d805..402b0b5 100644 --- a/lang/tarteaucitron.es.js +++ b/lang/tarteaucitron.es.js @@ -1,32 +1,42 @@ /*global tarteaucitron */ tarteaucitron.lang = { - "adblock": "Hola! Este sitio web es transparente y le da la opción de activar los servicios de terceros.", - "adblock_call": "Por favor deshabilite su AdBlocker para empezar a personalizar los servicios.", + "adblock": "¡Hola! Este sitio web es transparente y te da la opción de activar los servicios de terceros.", + "adblock_call": "Por favor deshabilita tu AdBlocker para empezar a personalizar los servicios.", "reload": "Actualizar esta página", - "alertBigScroll": "Al continuar para desplazarse,", + "alertBigScroll": "Al continuar desplazándote,", "alertBigClick": "Si continuas navegando por este sitio web,", - "alertBig": "estar permitiendo servicios terceros", + "alertBig": "estás permitiendo servicios terceros", - "alertBigPrivacy": "Este sitio web usa cookies y te permite controlar lo que deseas activar", + "alertBigPrivacy": "Este sitio web usa cookies y te permite controlar las que deseas activar", "alertSmall": "Gestionar servicios", "personalize": "Personalizar", "acceptAll": "OK, aceptar todas", "close": "Cerrar", + + "privacyUrl": "Política de privacidad", "all": "Ajustes para todos los servicios", "info": "Protegiendo tu privacidad", - "disclaimer": "Aceptando estos servicios terceros, estas aceptando sus cookies y el uso de tecnologías de rastreo necesarias para su correcto funcionamiento.", + "disclaimer": "Aceptando estos servicios de terceros, estás aceptando sus cookies y el uso de tecnologías de rastreo necesarias para su correcto funcionamiento.", "allow": "Permitir", "deny": "Denegar", - "noCookie": "Este servicio no usa cookie.", + "noCookie": "Este servicio no usa cookies.", "useCookie": "Este servicio puede instalar", "useCookieCurrent": "Este servicio ha instalado", "useNoCookie": "Este servicio no ha instalado ninguna cookie.", "more": "Leer más", "source": "Ver sitio web oficial", "credit": "Gestor de cookies realizada por tarteaucitron.js", + + "toggleInfoBox": "Mostrar/ocultar información sobre almacenamiento de cookies", + "title": "Panel de gestión de cookies", + "cookieDetail": "Detalles de las cookies para", + "ourSite": "en nuestra web", + "newWindow": "(ventana nueva)", + "allowAll": "Permitir todas las cookies", + "denyAll": "Denegar todas las cookies", "fallback": "está deshabilitado.", @@ -35,8 +45,8 @@ tarteaucitron.lang = { "details": "Las redes publicitarias pueden generar ingresos mediante la venta de espacios publicitarios en el sitio." }, "analytic": { - "title": "Mediciión de audiencia", - "details": "Los servicios de medición de audiencia se usan para generar asistencia estadísticas útiles para mejorar el sitio." + "title": "Medición de audiencia", + "details": "Los servicios de medición de audiencia se usan para generar estadísticas útiles para mejorar el sitio." }, "social": { "title": "Redes sociales", diff --git a/lang/tarteaucitron.fr.js b/lang/tarteaucitron.fr.js index 6512403..882e312 100644 --- a/lang/tarteaucitron.fr.js +++ b/lang/tarteaucitron.fr.js @@ -14,6 +14,8 @@ tarteaucitron.lang = { "personalize": "Personnaliser", "close": "Fermer", + "privacyUrl": "Politique de confidentialité", + "all": "Préférence pour tous les services", "info": "Protection de votre vie privée", @@ -27,6 +29,14 @@ tarteaucitron.lang = { "more": "En savoir plus", "source": "Voir le site officiel", "credit": "Gestion des cookies par tarteaucitron.js", + + "toggleInfoBox": "Afficher/masquer les informations sur le stockage des cookies", + "title": "Panneau de gestion des cookies", + "cookieDetail": "Détail des cookies", + "ourSite": "sur notre site", + "newWindow": "(nouvelle fenêtre)", + "allowAll": "Autoriser tous les cookies", + "denyAll": "Interdire tous les cookies", "fallback": "est désactivé.", diff --git a/lang/tarteaucitron.it.js b/lang/tarteaucitron.it.js index 8b2faf1..e369860 100644 --- a/lang/tarteaucitron.it.js +++ b/lang/tarteaucitron.it.js @@ -13,6 +13,8 @@ tarteaucitron.lang = { "acceptAll": "Ok, accetta tutto", "personalize": "Personalizza", "close": "Chiudi", + + "privacyUrl": "Politica sulla riservatezza", "all": "Preferenze per tutti i servizi", @@ -27,6 +29,14 @@ tarteaucitron.lang = { "more": "Saperne di più", "source": "Vai al sito ufficiale", "credit": "Gestione dei cookies da tarteaucitron.js", + + "toggleInfoBox": "Show/hide informations about cookie storage", + "title": "Cookies management panel", + "cookieDetail": "Cookie detail for", + "ourSite": "on our site", + "newWindow": "(new window)", + "allowAll": "Allow all cookies", + "denyAll": "Deny all cookies", "fallback": "è disattivato", diff --git a/lang/tarteaucitron.nl.js b/lang/tarteaucitron.nl.js new file mode 100644 index 0000000..ad8e201 --- /dev/null +++ b/lang/tarteaucitron.nl.js @@ -0,0 +1,75 @@ +/*global tarteaucitron */ +tarteaucitron.lang = { + "adblock": "Hallo! Deze site is transparant en laat u de services van derden kiezen die u wilt toestaan.", + "adblock_call": "Schakel uw adblocker uit om te beginnen met aanpassen.", + "reload": "Ververs de pagina", + + "alertBigScroll": "Door te blijven scrollen,", + "alertBigClick": "Als je doorgaat met het surfen op deze website,", + "alertBig": "sta je alle diensten van derden toe", + + "alertBigPrivacy": "Deze site maakt gebruik van cookies en geeft u controle over wat u wilt activeren", + "alertSmall": "Beheer instellingen", + "personalize": "Personaliseer", + "acceptAll": "OK, accepteer alle", + "close": "Sluit", + + "privacyUrl": "Privacybeleid", + + "all": "Voorkeur voor alle diensten", + + "info": "Bescherming van uw privacy", + "disclaimer": "Door deze services van derden toe te staan, accepteert u hun cookies en het gebruik van trackingtechnologieën die nodig zijn voor hun goede werking.", + "allow": "Toestaan", + "deny": "Weigeren", + "noCookie": "Deze service gebruikt geen cookie", + "useCookie": "Deze service kan worden geïnstalleerd", + "useCookieCurrent": "Deze service is geïnstalleerd", + "useNoCookie": "Deze service heeft geen cookies geïnstalleerd.", + "more": "Lees meer", + "source": "Bekijk de officiële website", + "credit": "Cookie manager mogelijk gemaakt door tarteaucitron.js", + + "fallback": "is uitgeschakeld.", + + "toggleInfoBox": "Toon/verberg informatie over cookie opslag", + "title": "Cookies beheer paneel", + "cookieDetail": "Cookie detail voor", + "ourSite": "op onze site", + "newWindow": "(nieuw venster)", + "allowAll": "Sta alle cookies toe", + "denyAll": "Weiger alle cookies", + + "ads": { + "title": "Advertentienetwerk", + "details": "Advertentienetwerken kunnen inkomsten genereren door advertentieruimte op de site te verkopen." + }, + "analytic": { + "title": "Bezoekers meting", + "details": "De bezoekersdiensten voor het publiek worden gebruikt om nuttige statistieken te genereren om de site te verbeteren." + }, + "social": { + "title": "Sociale netwerken", + "details": "Sociale netwerken kunnen de bruikbaarheid van de site verbeteren en helpen deze via de shares te promoten." + }, + "video": { + "title": "Videos", + "details": "Video sharing-services helpen om rich media op de site toe te voegen en de zichtbaarheid ervan te vergroten." + }, + "comment": { + "title": "Comments", + "details": "Commentsmanagers faciliteren het indienen van opmerkingen en het bestrijden van spam." + }, + "support": { + "title": "Support", + "details": "Support diensten stellen u in staat contact op te nemen met het team van de site en helpen het te verbeteren." + }, + "api": { + "title": "APIs", + "details": "APIs worden gebruikt om scripts te laden: geolocatie, zoekmachines, vertalingen, ..." + }, + "other": { + "title": "Overig", + "details": "Diensten om webinhoud weer te geven." + } +}; diff --git a/lang/tarteaucitron.pl.js b/lang/tarteaucitron.pl.js index 6fe5b8e..3da7f46 100644 --- a/lang/tarteaucitron.pl.js +++ b/lang/tarteaucitron.pl.js @@ -13,6 +13,8 @@ tarteaucitron.lang = { "personalize": "Personalizacja", "acceptAll": "OK, akceptuję wszystko", "close": "zamknij", + + "privacyUrl": "Polityka prywatności", "all": "Preferencja dla wszystkich usług", @@ -27,6 +29,14 @@ tarteaucitron.lang = { "more": "Więcej informacji", "source": "Zobacz oficjalną stronę internetowa", "credit": "Cookies menadżer z tarteaucitron.js", + + "toggleInfoBox": "Show/hide informations about cookie storage", + "title": "Cookies management panel", + "cookieDetail": "Cookie detail for", + "ourSite": "on our site", + "newWindow": "(new window)", + "allowAll": "Allow all cookies", + "denyAll": "Deny all cookies", "fallback": "jest nieaktywna.", diff --git a/lang/tarteaucitron.pt.js b/lang/tarteaucitron.pt.js index 690fd20..6c564e3 100644 --- a/lang/tarteaucitron.pt.js +++ b/lang/tarteaucitron.pt.js @@ -13,6 +13,9 @@ tarteaucitron.lang = { "personalize": "Personalizar", "acceptAll": "OK, aceitar tudo", "close": "Fechar", + + "privacyUrl": "Política de Privacidade", + "all": "Definições dos serviços", "info": "Proteger sua privacidade", "disclaimer": "Ao aceitar os serviços terceiros, você aceita o uso de cookies em conjunto de tecnologias de rastreamento que lhe são necessárias para funcionar", @@ -25,6 +28,15 @@ tarteaucitron.lang = { "more": "Ler mais", "source": "Ver o site oficial", "credit": "Gerenciador de cookies por tarteaucitron.js", + + "toggleInfoBox": "Show/hide informations about cookie storage", + "title": "Cookies management panel", + "cookieDetail": "Cookie detail for", + "ourSite": "on our site", + "newWindow": "(new window)", + "allowAll": "Allow all cookies", + "denyAll": "Deny all cookies", + "fallback": "está desativado.", "ads": { "title": "Rede de anúncios", diff --git a/lang/tarteaucitron.ru.js b/lang/tarteaucitron.ru.js index d99370c..7be324d 100644 --- a/lang/tarteaucitron.ru.js +++ b/lang/tarteaucitron.ru.js @@ -13,6 +13,8 @@ tarteaucitron.lang = { "personalize": "Персонализировать", "acceptAll": "Ок, все активировать", "close": "Закрыть", + + "privacyUrl": "Политика конфиденциальности", "all": "Преференция всем сервисам", @@ -27,6 +29,14 @@ tarteaucitron.lang = { "more": "Подробнее", "source": "Посетите официальный сайт", "credit": "Кукис манаджер tarteaucitron.js", + + "toggleInfoBox": "Show/hide informations about cookie storage", + "title": "Cookies management panel", + "cookieDetail": "Cookie detail for", + "ourSite": "on our site", + "newWindow": "(new window)", + "allowAll": "Allow all cookies", + "denyAll": "Deny all cookies", "fallback": "Деактивирован.", diff --git a/package.json b/package.json new file mode 100644 index 0000000..5f32290 --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "tarteaucitronjs", + "version": "1.0.0", + "description": "Comply to the European cookie law", + "dependencies": {}, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/AmauriC/tarteaucitron.js.git" + }, + "keywords": [ + "cookie", + "law", + "rgpd", + "gdpr", + "cookie" + ], + "author": "AIC Agency SAS", + "license": "MIT", + "bugs": { + "url": "https://github.com/AmauriC/tarteaucitron.js/issues" + }, + "homepage": "https://github.com/AmauriC/tarteaucitron.js#readme" +} diff --git a/tarteaucitron.js b/tarteaucitron.js index 0f2afda..7bd60d0 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -3,14 +3,20 @@ // define correct path for files inclusion var scripts = document.getElementsByTagName('script'), path = scripts[scripts.length - 1].src.split('?')[0], - cdn = path.split('/').slice(0, -1).join('/') + '/', + tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN, + cdn = (tarteaucitronForceCDN === '') ? path.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN, alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch, tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage, + tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire, + tarteaucitronCustomText = (tarteaucitronCustomText === undefined) ? '' : tarteaucitronCustomText, + timeExipre = 31536000000, tarteaucitronProLoadServices, tarteaucitronNoAdBlocker = false; + + var tarteaucitron = { - "version": 323, + "version": 20181023, "cdn": cdn, "user": {}, "lang": {}, @@ -22,10 +28,14 @@ var tarteaucitron = { "parameters": {}, "isAjax": false, "reloadThePage": false, + "events": { + "init": function () {}, + "load": function () {}, + }, "init": function (params) { "use strict"; var origOpen; - + tarteaucitron.parameters = params; if (alreadyLaunch === 0) { alreadyLaunch = 1; @@ -45,13 +55,13 @@ var tarteaucitron = { if (document.getElementById('tarteaucitronAlertBig') !== null && !tarteaucitron.highPrivacy) { if (document.getElementById('tarteaucitronAlertBig').style.display === 'block') { heightPosition = document.getElementById('tarteaucitronAlertBig').offsetHeight + 'px'; - + if (scrollPos > (screen.height * 2)) { tarteaucitron.userInterface.respondAll(true); } else if (scrollPos > (screen.height / 2)) { - document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '' + tarteaucitron.lang.alertBigScroll + ' ' + tarteaucitron.lang.alertBig; + document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '' + tarteaucitron.lang.alertBigScroll + ' ' + tarteaucitron.lang.alertBig; } - + if (tarteaucitron.orientation === 'top') { document.getElementById('tarteaucitronPercentage').style.top = heightPosition; } else { @@ -61,6 +71,7 @@ var tarteaucitron = { } } }, false); + window.addEventListener("keydown", function (evt) { if (evt.keyCode === 27) { tarteaucitron.userInterface.closePanel(); @@ -77,7 +88,7 @@ var tarteaucitron = { tarteaucitron.userInterface.jsSizing('main'); } } - + if (document.getElementById('tarteaucitronCookiesListContainer') !== null) { if (document.getElementById('tarteaucitronCookiesListContainer').style.display === 'block') { tarteaucitron.userInterface.jsSizing('cookie'); @@ -100,11 +111,11 @@ var tarteaucitron = { if (document.getElementById('tarteaucitronAlertBig') !== null && !tarteaucitron.highPrivacy) { if (document.getElementById('tarteaucitronAlertBig').style.display === 'block') { heightPosition = document.getElementById('tarteaucitronAlertBig').offsetHeight + 'px'; - + if (scrollPos > (screen.height * 2)) { tarteaucitron.userInterface.respondAll(true); } else if (scrollPos > (screen.height / 2)) { - document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '' + tarteaucitron.lang.alertBigScroll + ' ' + tarteaucitron.lang.alertBig; + document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '' + tarteaucitron.lang.alertBigScroll + ' ' + tarteaucitron.lang.alertBig; } if (tarteaucitron.orientation === 'top') { document.getElementById('tarteaucitronPercentage').style.top = heightPosition; @@ -119,6 +130,21 @@ var tarteaucitron = { if (evt.keyCode === 27) { tarteaucitron.userInterface.closePanel(); } + + if ( evt.keyCode === 9 && focusableEls.indexOf(evt.target) >= 0) { + if ( evt.shiftKey ) /* shift + tab */ { + if (document.activeElement === firstFocusableEl) { + lastFocusableEl.focus(); + evt.preventDefault(); + } + } else /* tab */ { + if (document.activeElement === lastFocusableEl) { + firstFocusableEl.focus(); + evt.preventDefault(); + } + } + } + }); window.attachEvent("onhashchange", function () { if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') { @@ -131,7 +157,7 @@ var tarteaucitron = { tarteaucitron.userInterface.jsSizing('main'); } } - + if (document.getElementById('tarteaucitronCookiesListContainer') !== null) { if (document.getElementById('tarteaucitronCookiesListContainer').style.display === 'block') { tarteaucitron.userInterface.jsSizing('cookie'); @@ -139,11 +165,11 @@ var tarteaucitron = { } }); } - + if (typeof XMLHttpRequest !== 'undefined') { origOpen = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function () { - + if (window.addEventListener) { this.addEventListener("load", function () { if (typeof tarteaucitronProLoadServices === 'function') { @@ -161,13 +187,17 @@ var tarteaucitron = { setTimeout(tarteaucitronProLoadServices, 1000); } } - + try { origOpen.apply(this, arguments); } catch (err) {} }; } } + + if(tarteaucitron.events.init) { + tarteaucitron.events.init(); + } }, "load": function () { "use strict"; @@ -179,32 +209,50 @@ var tarteaucitron = { defaults = { "adblocker": false, "hashtag": '#tarteaucitron', + "cookieName": 'tarteaucitron', "highPrivacy": false, "orientation": "top", "removeCredit": false, "showAlertSmall": true, - "cookieslist": true + "cookieslist": true, + "handleBrowserDNTRequest": false, + "AcceptAllCta" : false, + "moreInfoLink": true, + "privacyUrl": "", + "useExternalCss": false }, params = tarteaucitron.parameters; - + // Step 0: get params if (params !== undefined) { - tarteaucitron.extend(defaults, params); + + for (var k in defaults) { + if(!tarteaucitron.parameters.hasOwnProperty(k)) { + tarteaucitron.parameters[k] = defaults[k]; + } + } } - + // global - tarteaucitron.orientation = defaults.orientation; - tarteaucitron.hashtag = defaults.hashtag; - tarteaucitron.highPrivacy = defaults.highPrivacy; + tarteaucitron.orientation = tarteaucitron.parameters.orientation; + tarteaucitron.hashtag = tarteaucitron.parameters.hashtag; + tarteaucitron.highPrivacy = tarteaucitron.parameters.highPrivacy; + tarteaucitron.handleBrowserDNTRequest = tarteaucitron.parameters.handleBrowserDNTRequest; + // Step 1: load css - linkElement.rel = 'stylesheet'; - linkElement.type = 'text/css'; - linkElement.href = cdn + 'css/tarteaucitron.css?v=' + tarteaucitron.version; - document.getElementsByTagName('head')[0].appendChild(linkElement); - + if ( !tarteaucitron.parameters.useExternalCss ) { + linkElement.rel = 'stylesheet'; + linkElement.type = 'text/css'; + linkElement.href = cdn + 'css/tarteaucitron.css?v=' + tarteaucitron.version; + document.getElementsByTagName('head')[0].appendChild(linkElement); + } // Step 2: load language and services tarteaucitron.addScript(pathToLang, '', function () { + + if(tarteaucitronCustomText !== ''){ + tarteaucitron.lang = tarteaucitron.AddOrUpdate(tarteaucitron.lang, tarteaucitronCustomText); + } tarteaucitron.addScript(pathToServices, '', function () { var body = document.body, @@ -214,7 +262,7 @@ var tarteaucitron = { orientation = 'Top', cat = ['ads', 'analytic', 'api', 'comment', 'social', 'support', 'video', 'other'], i; - + cat = cat.sort(function (a, b) { if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) { return 1; } if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) { return -1; } @@ -223,96 +271,122 @@ var tarteaucitron = { // Step 3: prepare the html html += '
'; - html += '
'; - html += '
'; - html += '
'; + html += ''; + html += ''; + html += ' '; html += '
'; html += '
'; + html += ' '+ tarteaucitron.lang.title + ''; + html += '
'; + html += ' ' + tarteaucitron.lang.disclaimer; + if (tarteaucitron.parameters.privacyUrl !== "") { + html += '

'; + html += ' '; + } + html += '
'; html += '
'; - html += ' ' + tarteaucitron.lang.all + ''; + html += ' ' + tarteaucitron.lang.all + ''; html += '
'; html += '
'; - html += '
'; - html += ' ✓ ' + tarteaucitron.lang.allow; - html += '
'; - html += '
'; - html += ' ✗ ' + tarteaucitron.lang.deny; - html += '
'; + html += ' '; + html += ' '; html += '
'; html += '
'; - html += '
'; - html += ' ' + tarteaucitron.lang.disclaimer; - if (defaults.removeCredit === false) { - html += '

'; - html += ' ' + tarteaucitron.lang.credit + ''; - } - html += '
'; - html += '
'; - html += '
'; + html += '
'; + html += '
    '; for (i = 0; i < cat.length; i += 1) { - html += '
    '; + html += '
  • '; html += '
    '; - html += ' ' + tarteaucitron.lang[cat[i]].title; + html += ' '; html += '
    '; html += '
    '; html += ' ' + tarteaucitron.lang[cat[i]].details; html += '
    '; - html += '
  • '; - html += '
    '; + html += '
      '; } + html += '
    '; html += '
    '; + if (tarteaucitron.parameters.removeCredit === false) { + html += ' 🍋 ' + tarteaucitron.lang.credit + ''; + } html += '
    '; html += '
    '; html += '
    '; - - if (defaults.orientation === 'bottom') { + + if (tarteaucitron.parameters.orientation === 'bottom') { orientation = 'Bottom'; } - - if (defaults.highPrivacy) { + + if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) { html += '
    '; html += ' '; html += ' ' + tarteaucitron.lang.alertBigPrivacy; html += ' '; - html += ' '; + html += ' '; + + if (tarteaucitron.parameters.privacyUrl !== "") { + html += ' '; + } + html += '
    '; } else { html += '
    '; html += ' '; - html += ' ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig; + + if (tarteaucitron.parameters.highPrivacy) { + html += ' ' + tarteaucitron.lang.alertBigPrivacy; + } else { + html += ' ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig; + } + html += ' '; - html += ' '; + html += ' '; + html += ' '; + + if (tarteaucitron.parameters.privacyUrl !== "") { + html += ' '; + } + html += '
    '; html += '
    '; } - - if (defaults.showAlertSmall === true) { - html += '
    '; - html += '
    '; + + if (tarteaucitron.parameters.showAlertSmall === true) { + html += '
    '; + html += '
    0
    '; + html += ' '; + if (tarteaucitron.parameters.cookieslist === true) { + html += ' '; html += '
    '; - html += '
    '; + html += '
    '; + html += ' '; html += '
    '; - html += ' 0 cookie'; + html += ' 0 cookie'; html += '
    '; html += '
    '; html += '
    '; @@ -321,23 +395,39 @@ var tarteaucitron = { } html += '
    '; } - + tarteaucitron.addScript(tarteaucitron.cdn + 'advertising.js?v=' + tarteaucitron.version, '', function () { - if (tarteaucitronNoAdBlocker === true || defaults.adblocker === false) { + if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) { + + // 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); + } + + // Append the wrapper to the body + document.body.appendChild(wrapper);*/ + div.id = 'tarteaucitronRoot'; body.appendChild(div, body); div.innerHTML = html; - + if (tarteaucitron.job !== undefined) { tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job); for (index = 0; index < tarteaucitron.job.length; index += 1) { tarteaucitron.addService(tarteaucitron.job[index]); } + } else { + tarteaucitron.job = [] } - + tarteaucitron.isAjax = true; + tarteaucitron.job.push = function (id) { - + // ie <9 hack if (typeof tarteaucitron.job.indexOf === 'undefined') { tarteaucitron.job.indexOf = function (obj, start) { @@ -349,36 +439,49 @@ var tarteaucitron = { return -1; }; } - + if (tarteaucitron.job.indexOf(id) === -1) { Array.prototype.push.call(this, id); } tarteaucitron.launch[id] = false; tarteaucitron.addService(id); }; - + if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') { tarteaucitron.userInterface.openPanel(); } - + tarteaucitron.cookie.number(); setInterval(tarteaucitron.cookie.number, 60000); } - }, defaults.adblocker); - - if (defaults.adblocker === true) { + }, tarteaucitron.parameters.adblocker); + + if (tarteaucitron.parameters.adblocker === true) { setTimeout(function () { if (tarteaucitronNoAdBlocker === false) { - html = '
    '; - html += ' '; + html = ''; html += '
    '; + + // create wrapper container + /*var wrapper = document.createElement('div'); + wrapper.id = "contentWrapper"; + + while (document.body.firstChild) + { + wrapper.appendChild(document.body.firstChild); + } + + // Append the wrapper to the body + document.body.appendChild(wrapper);*/ + div.id = 'tarteaucitronRoot'; body.appendChild(div, body); div.innerHTML = html; @@ -390,6 +493,10 @@ var tarteaucitron = { } }); }); + + if(tarteaucitron.events.load) { + tarteaucitron.events.load(); + } }, "addService": function (serviceId) { "use strict"; @@ -399,51 +506,57 @@ var tarteaucitron = { cookie = tarteaucitron.cookie.read(), hostname = document.location.hostname, hostRef = document.referrer.split('/')[2], - isNavigating = (hostRef === hostname) ? true : false, + isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl) ? true : false, isAutostart = (!service.needConsent) ? true : false, isWaiting = (cookie.indexOf(service.key + '=wait') >= 0) ? true : false, isDenied = (cookie.indexOf(service.key + '=false') >= 0) ? true : false, isAllowed = (cookie.indexOf(service.key + '=true') >= 0) ? true : false, - isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0) ? true : false; + isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0) ? true : false, + isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1") ? true : false; if (tarteaucitron.added[service.key] !== true) { tarteaucitron.added[service.key] = true; - - html += '
    '; + + html += '
  • '; html += '
    '; - html += ' ' + service.name + '
    '; + html += ' ' + service.name + ''; html += '
    '; - var link = 'https://opt-out.ferank.eu/service/' + service.key + '/'; - if (service.readmoreLink !== undefined && service.readmoreLink !== '') { - link = service.readmoreLink; + + if (tarteaucitron.parameters.moreInfoLink == true) { + + var link = 'https://opt-out.ferank.eu/service/' + service.key + '/'; + if (service.readmoreLink !== undefined && service.readmoreLink !== '') { + link = service.readmoreLink; + } + if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') { + link = tarteaucitron.parameters.readmoreLink; + } + html += ' '; + html += ' ' + tarteaucitron.lang.more; + html += ' '; + html += ' - '; + html += ' '; + html += ' ' + tarteaucitron.lang.source; + html += ' '; } - if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') { - link = tarteaucitron.parameters.readmoreLink; - } - html += ' '; - html += ' ' + tarteaucitron.lang.more; - html += ' '; - html += ' - '; - html += ' '; - html += ' ' + tarteaucitron.lang.source; - html += ' '; + html += '
    '; html += '
    '; - html += '
    '; + html += '
    '; - html += '
    '; + html += ' '; + html += '
    '; + html += ' '; html += '
    '; - html += '
  • '; - + html += ''; + tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block'); - + if (document.getElementById('tarteaucitronServices_' + service.type) !== null) { document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html; } - + tarteaucitron.userInterface.order(service.type); } @@ -452,7 +565,7 @@ var tarteaucitron = { isAllowed = true; tarteaucitron.cookie.create(service.key, true); } - + if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) { if (!isAllowed) { tarteaucitron.cookie.create(service.key, true); @@ -469,6 +582,13 @@ var tarteaucitron = { } tarteaucitron.state[service.key] = false; tarteaucitron.userInterface.color(service.key, false); + } else if (!isResponded && isDNTRequested && tarteaucitron.handleBrowserDNTRequest) { + tarteaucitron.cookie.create(service.key, 'false'); + if (typeof service.fallback === 'function') { + service.fallback(); + } + tarteaucitron.state[service.key] = false; + tarteaucitron.userInterface.color(service.key, false); } else if (!isResponded) { tarteaucitron.cookie.create(service.key, 'wait'); if (typeof service.fallback === 'function') { @@ -487,7 +607,7 @@ var tarteaucitron = { out = [], obj = {}, s = tarteaucitron.services; - + for (i = 0; i < len; i += 1) { if (!obj[arr[i]]) { obj[arr[i]] = {}; @@ -496,13 +616,13 @@ var tarteaucitron = { } } } - + out = out.sort(function (a, b) { if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; } if (s[a].type + s[a].key < s[b].type + s[b].key) { return -1; } return 0; }); - + return out; }, "userInterface": { @@ -518,7 +638,7 @@ var tarteaucitron = { service, key, index = 0; - + for (index = 0; index < tarteaucitron.job.length; index += 1) { service = s[tarteaucitron.job[index]]; key = service.key; @@ -539,16 +659,16 @@ var tarteaucitron = { "respond": function (el, status) { "use strict"; var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), ''); - + // return if same state if (tarteaucitron.state[key] === status) { return; } - + if (status === false && tarteaucitron.launch[key] === true) { tarteaucitron.reloadThePage = true; } - + // if not already launched... launch the service if (status === true) { if (tarteaucitron.launch[key] !== true) { @@ -579,10 +699,16 @@ var tarteaucitron = { tarteaucitron.userInterface.css(key + 'Line', 'borderLeft', '5px solid ' + greenDark); tarteaucitron.userInterface.css(key + 'Allowed', 'backgroundColor', greenDark); tarteaucitron.userInterface.css(key + 'Denied', 'backgroundColor', gray); + + document.getElementById(key + 'Line').classList.add('tarteaucitronIsAllowed'); + document.getElementById(key + 'Line').classList.remove('tarteaucitronIsDenied'); } else if (status === false) { tarteaucitron.userInterface.css(key + 'Line', 'borderLeft', '5px solid ' + redDark); tarteaucitron.userInterface.css(key + 'Allowed', 'backgroundColor', gray); tarteaucitron.userInterface.css(key + 'Denied', 'backgroundColor', redDark); + + document.getElementById(key + 'Line').classList.remove('tarteaucitronIsAllowed'); + document.getElementById(key + 'Line').classList.add('tarteaucitronIsDenied'); } // check if all services are allowed @@ -595,31 +721,33 @@ var tarteaucitron = { nbAllowed += 1; } } - + tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%'); tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%'); tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%'); - + if (nbDenied === 0 && nbPending === 0) { tarteaucitron.userInterface.css(c + 'AllAllowed', 'backgroundColor', greenDark); - tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', gray); + tarteaucitron.userInterface.css(c + 'AllDenied', 'opacity', '0.4'); + tarteaucitron.userInterface.css(c + 'AllAllowed', 'opacity', '1'); } else if (nbAllowed === 0 && nbPending === 0) { - tarteaucitron.userInterface.css(c + 'AllAllowed', 'backgroundColor', gray); + tarteaucitron.userInterface.css(c + 'AllAllowed', 'opacity', '0.4'); + tarteaucitron.userInterface.css(c + 'AllDenied', 'opacity', '1'); tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', redDark); } else { - tarteaucitron.userInterface.css(c + 'AllAllowed', 'backgroundColor', gray); - tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', gray); + tarteaucitron.userInterface.css(c + 'AllAllowed', 'opacity', '0.4'); + tarteaucitron.userInterface.css(c + 'AllDenied', 'opacity', '0.4'); } - + // close the alert if all service have been reviewed if (nbPending === 0) { tarteaucitron.userInterface.closeAlert(); } - + if (tarteaucitron.services[key].cookies.length > 0 && status === false) { tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies); } - + if (status === true) { if (document.getElementById('tacCL' + key) !== null) { document.getElementById('tacCL' + key).innerHTML = '...'; @@ -633,29 +761,81 @@ var tarteaucitron = { }, "openPanel": function () { "use strict"; + tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block'); tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); + + document.getElementById('tarteaucitronClosePanel').focus(); + //document.getElementById('contentWrapper').setAttribute("aria-hidden", "true"); + document.getElementsByTagName('body')[0].classList.add('modal-open'); + tarteaucitron.userInterface.focusTrap(); tarteaucitron.userInterface.jsSizing('main'); }, "closePanel": function () { "use strict"; - + if (document.location.hash === tarteaucitron.hashtag) { document.location.hash = ''; } tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); - + tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { elem.style.display = 'none'; }, true); - + if (tarteaucitron.reloadThePage === true) { window.location.reload(); } else { tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); } + if (document.getElementById('tarteaucitronCloseAlert') !== null) { + document.getElementById('tarteaucitronCloseAlert').focus(); + } + //document.getElementById('contentWrapper').setAttribute("aria-hidden", "false"); + document.getElementsByTagName('body')[0].classList.remove('modal-open'); + + }, + "focusTrap": function() { + "use strict"; + + var focusableEls, + firstFocusableEl, + lastFocusableEl, + filtered; + + focusableEls = document.getElementById('tarteaucitron').querySelectorAll('a[href], button'); + filtered = []; + + // get only visible items + for (var i = 0, max = focusableEls.length; i < max; i++) { + if (focusableEls[i].offsetHeight > 0) { + filtered.push(focusableEls[i]); + } + } + + 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) { + firstFocusableEl.focus(); + evt.preventDefault(); + } + } + } + }) }, "openAlert": function () { "use strict"; @@ -675,11 +855,11 @@ var tarteaucitron = { "toggleCookiesList": function () { "use strict"; var div = document.getElementById('tarteaucitronCookiesListContainer'); - + if (div === null) { return; } - + if (div.style.display !== 'block') { tarteaucitron.cookie.number(); div.style.display = 'block'; @@ -698,11 +878,11 @@ var tarteaucitron = { "toggle": function (id, closeClass) { "use strict"; var div = document.getElementById(id); - + if (div === null) { return; } - + if (closeClass !== undefined) { tarteaucitron.fallback([closeClass], function (elem) { if (elem.id !== id) { @@ -710,7 +890,7 @@ var tarteaucitron = { } }, true); } - + if (div.style.display !== 'block') { div.style.display = 'block'; } else { @@ -727,11 +907,13 @@ var tarteaucitron = { if (main === null) { return; } - + allDivs = main.childNodes; - - if (typeof Array.prototype.map === 'function') { + + if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') { Array.prototype.map.call(main.children, Object).sort(function (a, b) { + //var mainChildren = Array.from(main.children); + //mainChildren.sort(function (a, b) { if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; } if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; } return 0; @@ -759,18 +941,18 @@ var tarteaucitron = { paddingBox, alertSmallHeight, cookiesNumberHeight; - + if (type === 'box') { if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) { - + // reset tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px'); - + // calculate alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight; cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight; paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2; - + // apply tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px'); } @@ -784,79 +966,79 @@ var tarteaucitron = { // height of the services list container if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) { - + // reset - tarteaucitron.userInterface.css('tarteaucitronScrollbarParent', 'height', 'auto'); - + tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto'); + // calculate mainHeight = document.getElementById('tarteaucitron').offsetHeight; closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight; - headerHeight = document.getElementById('tarteaucitronMainLineOffset').offsetHeight; - + // apply - servicesHeight = (mainHeight - closeButtonHeight - headerHeight + 1); - tarteaucitron.userInterface.css('tarteaucitronScrollbarParent', 'height', servicesHeight + 'px'); + servicesHeight = (mainHeight - closeButtonHeight + 2); + tarteaucitron.userInterface.css('tarteaucitronServices', 'height', servicesHeight + 'px'); + tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto'); } - + // align the main allow/deny button depending on scrollbar width - if (document.getElementById('tarteaucitronScrollbarParent') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) { - + if (document.getElementById('tarteaucitronServices') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) { + // media query if (e[a + 'Width'] <= 479) { tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px'); } else if (e[a + 'Width'] <= 767) { scrollbarMarginRight = 12; } - - scrollbarWidthParent = document.getElementById('tarteaucitronScrollbarParent').offsetWidth; + + scrollbarWidthParent = document.getElementById('tarteaucitronServices').offsetWidth; scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth; tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px'); } - + // center the main panel if (document.getElementById('tarteaucitron') !== null) { - + // media query if (e[a + 'Width'] <= 767) { mainTop = 0; } else { mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21; } - + // correct if (mainTop < 0) { mainTop = 0; } - + if (document.getElementById('tarteaucitronMainLineOffset') !== null) { if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) { mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight; } } - + // apply tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px'); } } else if (type === 'cookie') { - + // put cookies list at bottom if (document.getElementById('tarteaucitronAlertSmall') !== null) { tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px'); } - + // height of cookies list if (document.getElementById('tarteaucitronCookiesListContainer') !== null) { - + // reset tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto'); - + // calculate cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight; cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight; cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight; - + // apply tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookiesListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px'); } @@ -867,12 +1049,18 @@ var tarteaucitron = { "owner": {}, "create": function (key, status) { "use strict"; + + if (tarteaucitronForceExpire !== '') { + // The number of day cann't be higher than 1 year + timeExipre = (tarteaucitronForceExpire > 365) ? 31536000000 : tarteaucitronForceExpire * 86400000; // Multiplication to tranform the number of days to milliseconds + } + var d = new Date(), time = d.getTime(), - expireTime = time + 31536000000, // 365 days + expireTime = time + timeExipre, // 365 days regex = new RegExp("!" + key + "=(wait|true|false)", "g"), cookie = tarteaucitron.cookie.read().replace(regex, ""), - value = 'tarteaucitron=' + cookie + '!' + key + '=' + status, + value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status, domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? 'domain=' + tarteaucitron.parameters.cookieDomain + ';' : ''; if (tarteaucitron.cookie.read().indexOf(key + '=' + status) === -1) { @@ -884,7 +1072,7 @@ var tarteaucitron = { }, "read": function () { "use strict"; - var nameEQ = "tarteaucitron=", + var nameEQ = tarteaucitron.parameters.cookieName + "=", ca = document.cookie.split(';'), i, c; @@ -903,7 +1091,7 @@ var tarteaucitron = { "purge": function (arr) { "use strict"; 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 + ';'; @@ -918,7 +1106,7 @@ var tarteaucitron = { html = '', i, status = document.cookie.indexOf(key + '=true'); - + if (status >= 0 && nb === 0) { html += tarteaucitron.lang.useNoCookie; } else if (status >= 0) { @@ -933,7 +1121,7 @@ var tarteaucitron = { } } } - + if (nbCurrent > 0) { html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' cookie'; if (nbCurrent > 1) { @@ -952,7 +1140,7 @@ var tarteaucitron = { } html += '.'; } - + if (document.getElementById('tacCL' + key) !== null) { document.getElementById('tacCL' + key).innerHTML = html; } @@ -983,7 +1171,7 @@ var tarteaucitron = { regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i, regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn, host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain; - + cookies = cookies.sort(function (a, b) { namea = a.split('=', 1).toString().replace(/ /g, ''); nameb = b.split('=', 1).toString().replace(/ /g, ''); @@ -993,52 +1181,53 @@ var tarteaucitron = { if (c + a < d + b) { return -1; } return 0; }); - + if (document.cookie !== '') { for (i = 0; i < nb; i += 1) { name = cookies[i].split('=', 1).toString().replace(/ /g, ''); if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) { savedname = tarteaucitron.cookie.owner[name].join(' // '); html += '
    '; - html += '
    '; + html += ' '; html += ' ' + tarteaucitron.cookie.owner[name].join(' // '); - html += '
    '; - html += '
    '; + html += '
    '; + html += '
    '; } else { html += '
    '; - html += '
    -
    '; + html += '
    -
    '; html += '
    '; html += '
    '; } - + html += '
    '; - + if (document.getElementById('tarteaucitronCookiesList') !== null) { document.getElementById('tarteaucitronCookiesList').innerHTML = html; } - + if (document.getElementById('tarteaucitronCookiesNumber') !== null) { document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb; } - + if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) { document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s; } - + for (i = 0; i < tarteaucitron.job.length; i += 1) { tarteaucitron.cookie.checkCount(tarteaucitron.job[i]); } @@ -1047,8 +1236,8 @@ var tarteaucitron = { "getLanguage": function () { "use strict"; if (!navigator) { return 'en'; } - - var availableLanguages = 'cs,en,fr,es,it,de,pt,pl,ru', + + var availableLanguages = 'cs,en,fr,es,it,de,nl,pt,pl,ru,el', defaultLanguage = 'en', lang = navigator.language || navigator.browserLanguage || navigator.systemLanguage || navigator.userLang || null, @@ -1059,7 +1248,7 @@ var tarteaucitron = { return tarteaucitronForceLanguage; } } - + if (availableLanguages.indexOf(userLanguage) === -1) { return defaultLanguage; } @@ -1068,11 +1257,11 @@ var tarteaucitron = { "getLocale": function () { "use strict"; if (!navigator) { return 'en_US'; } - + var lang = navigator.language || navigator.browserLanguage || navigator.systemLanguage || navigator.userLang || null, userLanguage = lang.substr(0, 2); - + if (userLanguage === 'fr') { return 'fr_FR'; } else if (userLanguage === 'en') { @@ -1085,6 +1274,10 @@ var tarteaucitron = { return 'it_IT'; } else if (userLanguage === 'pt') { return 'pt_PT'; + } else if (userLanguage === 'nl') { + return 'nl_NL'; + } else if (userLanguage === 'el') { + return 'el_EL'; } else { return 'en_US'; } @@ -1093,7 +1286,7 @@ var tarteaucitron = { "use strict"; var script, done = false; - + if (execute === false) { if (typeof callback === 'function') { callback(); @@ -1104,7 +1297,7 @@ var tarteaucitron = { script.id = (id !== undefined) ? id : ''; script.async = true; script.src = url; - + if (attrName !== undefined && attrVal !== undefined) { script.setAttribute(attrName, attrVal); } @@ -1118,7 +1311,7 @@ var tarteaucitron = { } }; } - + document.getElementsByTagName('head')[0].appendChild(script); } }, @@ -1136,12 +1329,12 @@ var tarteaucitron = { document.writeln = function (content) { tarteaucitron.makeAsync.buffer += content.concat("\n"); }; - + setTimeout(function () { document.write = savedWrite; document.writeln = savedWriteln; }, 20000); - + tarteaucitron.makeAsync.getAndParse(url, id); }, "getAndParse": function (url, id) { @@ -1169,7 +1362,7 @@ var tarteaucitron = { if (document.getElementById(id) === null) { return; } - + scripts = document.getElementById(id).getElementsByTagName('script'); for (i = 0; i < scripts.length; i += 1) { type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : ''; @@ -1214,17 +1407,22 @@ var tarteaucitron = { "engage": function (id) { "use strict"; var html = '', - r = Math.floor(Math.random() * 100000); - + r = Math.floor(Math.random() * 100000), + engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback; + + if (tarteaucitron.lang['engage-' + id] !== undefined) { + engage = tarteaucitron.lang['engage-' + id]; + } + html += '
    '; html += '
    '; - html += ' ' + tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback; - html += '
    '; + html += ' ' + engage; + html += '
    '; + html += ' '; html += '
    '; html += '
    '; - + return html; }, "extend": function (a, b) { @@ -1253,21 +1451,40 @@ var tarteaucitron = { var div = document.getElementById('tarteaucitronPremium'), timestamp = new Date().getTime(), url = '//opt-out.ferank.eu/premium.php?'; - + if (div === null) { return; } - + url += 'domain=' + tarteaucitron.domain + '&'; url += 'uuid=' + tarteaucitron.uuid + '&'; url += 'c=' + encodeURIComponent(tarteaucitron.proTemp) + '&'; url += '_' + timestamp; - + div.innerHTML = ''; - + tarteaucitron.proTemp = ''; } - + tarteaucitron.cookie.number(); + }, + "AddOrUpdate" : function(source, custom){ + /** + Utility function to Add or update the fields of obj1 with the ones in obj2 + */ + for(key in custom){ + if(custom[key] instanceof Object){ + source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]); + }else{ + source[key] = custom[key]; + } + } + return source; + }, + "getElemWidth": function(elem) { + return elem.getAttribute('width') || elem.clientWidth; + }, + "getElemHeight": function(elem) { + return elem.getAttribute('height') || elem.clientHeight; } }; diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index f5f4e27..9476850 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -15,7 +15,7 @@ tarteaucitron.services.iframe = { var width = x.getAttribute("width"), height = x.getAttribute("height"), url = x.getAttribute("data-url"); - + return ''; }); }, @@ -106,6 +106,199 @@ tarteaucitron.services.addtoanyshare = { } }; +// aduptech ads +tarteaucitron.services.aduptech_ads = { + "key": "aduptech_ads", + "type": "ads", + "name": "Ad Up Technology (ads)", + "uri": "https://www.adup-tech.com/datenschutz", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + + var IDENTIFIER = "aduptech_ads", + API_URL = "https://s.d.adup-tech.com/jsapi"; + + var elements = document.getElementsByClassName(IDENTIFIER); + if (!elements || elements.length === 0) { + return; + } + + tarteaucitron.fallback([IDENTIFIER], ""); + + tarteaucitron.addScript(API_URL, "", function() { + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + + if (!element.getAttribute("id")) { + element.setAttribute("id", IDENTIFIER + Math.random().toString(36).substr(2, 9)); + } + + window.uAd.embed(element.getAttribute("id"), { + placementKey: element.getAttribute("placementKey"), + responsive: Boolean(element.getAttribute("responsive")), + lazy: Boolean(element.getAttribute("lazy")), + adtest: Boolean(element.getAttribute("test")), + query: element.getAttribute("query") || "", + minCpc: element.getAttribute("minCpc") || "", + pageUrl: element.getAttribute("pageUrl") || "", + skip: element.getAttribute("skip") || "" + }); + } + }); + + }, + "fallback": function () { + "use strict"; + tarteaucitron.fallback(["aduptech_ads"], tarteaucitron.engage("aduptech_ads")); + } +}; + +// aduptech conversion +tarteaucitron.services.aduptech_conversion = { + "key": "aduptech_conversion", + "type": "ads", + "name": "Ad Up Technology (conversion)", + "uri": "https://www.adup-tech.com/datenschutz", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + + var IDENTIFIER = "aduptech_conversion", + CONVERSION_PIXEL_BASE_URL = "https://d.adup-tech.com/campaign/conversion"; + + var elements = document.getElementsByClassName(IDENTIFIER); + if (!elements || elements.length === 0) { + return; + } + + tarteaucitron.fallback([IDENTIFIER], ""); + + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + + if (!element.getAttribute("advertiserId") || !element.getAttribute("conversionCode")) { + continue; + } + + var url = CONVERSION_PIXEL_BASE_URL + + "/" + encodeURIComponent(element.getAttribute("advertiserId")) + + "?t=" + encodeURIComponent(element.getAttribute("conversionCode")); + + if (element.getAttribute("price")) { + url += "&price=" + encodeURIComponent(element.getAttribute("price")); + } + + if (element.getAttribute("quantity")) { + url += "&quantity=" + encodeURIComponent(element.getAttribute("quantity")); + } + + if (element.getAttribute("total")) { + url += "&total=" + encodeURIComponent(element.getAttribute("total")); + } + + if (element.getAttribute("orderId")) { + url += "&order_id=" + encodeURIComponent(element.getAttribute("orderId")); + } + + if (element.getAttribute("itemNumber")) { + url += "&item_number=" + encodeURIComponent(element.getAttribute("itemNumber")); + } + + if (element.getAttribute("description")) { + url += "&description=" + encodeURIComponent(element.getAttribute("description")); + } + + (new Image()).src = url; + } + } +}; + +// aduptech retargeting +tarteaucitron.services.aduptech_retargeting = { + "key": "aduptech_retargeting", + "type": "ads", + "name": "Ad Up Technology (retargeting)", + "uri": "https://www.adup-tech.com/datenschutz", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + + var IDENTIFIER = "aduptech_retargeting", + API_URL = "https://s.d.adup-tech.com/services/retargeting.js"; + + var elements = document.getElementsByClassName(IDENTIFIER); + if (!elements || elements.length === 0) { + return; + } + + tarteaucitron.fallback([IDENTIFIER], ""); + + window.AdUpRetargeting = function(api) { + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + + api.init(); + + api.setAccount(element.getAttribute("account")); + + if (element.getAttribute("email")) { + api.setEmail(element.getAttribute("email")); + } else if (element.getAttribute("hashedEmail")) { + api.setHashedEmail(element.getAttribute("hashedEmail")); + } + + if (element.getAttribute("product")) { + try { + api.setProduct(JSON.parse(element.getAttribute("product"))); + } catch (e) { + api.setProduct(element.getAttribute("product")); + } + } + + if (element.getAttribute("transaction")) { + try { + api.setTransaction(JSON.parse(element.getAttribute("transaction"))); + } catch (e) { + api.setTransaction(element.getAttribute("transaction")); + } + } + + if (element.getAttribute("demarkUser")) { + api.setDemarkUser(); + } else if (element.getAttribute("demarkProducts")) { + api.setDemarkProducts(); + } + + if (element.getAttribute("conversionCode")) { + api.setConversionCode(element.getAttribute("conversionCode")); + } + + if (element.getAttribute("device")) { + var setter = "set" + element.getAttribute("device").charAt(0).toUpperCase() + element.getAttribute("device").slice(1); + if (typeof api[setter] === 'function') { + api[setter](); + } + } + + if (element.getAttribute("track")) { + var tracker = "track" + element.getAttribute("track").charAt(0).toUpperCase() + element.getAttribute("track").slice(1); + if (typeof api[tracker] === "function") { + api[tracker](); + } else { + api.trackHomepage(); + } + } + }; + }; + + tarteaucitron.addScript(API_URL); + } +}; + // alexa tarteaucitron.services.alexa = { "key": "alexa", @@ -133,7 +326,7 @@ tarteaucitron.services.amazon = { "key": "amazon", "type": "ads", "name": "Amazon", - "uri": "https://www.amazon.fr/gp/help/customer/display.html?ie=UTF8&*Version*=1&*entries*=0&nodeId=201149360", + "uri": "https://www.amazon.com/gp/help/customer/display.html/ref=help_search_1-1?ie=UTF8&nodeId=201909010&qid=1544617177&sr=1-1", "needConsent": true, "cookies": [], "js": function () { @@ -143,7 +336,7 @@ tarteaucitron.services.amazon = { productId = x.getAttribute("productid"), url = '//ws-eu.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=' + tarteaucitron.getLanguage().toUpperCase() + '&source=ss&ref=ss_til&ad_type=product_link&tracking_id=' + amazonId + '&marketplace=amazon®ion=' + tarteaucitron.getLanguage().toUpperCase() + '&placement=' + productId + '&asins=' + productId + '&show_border=true&link_opens_in_new_window=true', iframe = ''; - + return iframe; }); }, @@ -169,7 +362,7 @@ tarteaucitron.services.calameo = { width = x.getAttribute("width"), height = x.getAttribute("height"), url = '//v.calameo.com/?bkcode=' + id; - + return ''; }); }, @@ -227,13 +420,13 @@ tarteaucitron.services.clicmanager = { uniqIds.push(uniqId); return '
    '; }); - + for (i = 0; i < uniqIds.length; i += 1) { uri = '//ads.clicmanager.fr/exe.php?'; uri += 'c=' + document.getElementById(uniqIds[i]).getAttribute('c') + '&'; uri += 's=' + document.getElementById(uniqIds[i]).getAttribute('s') + '&'; uri += 't=' + document.getElementById(uniqIds[i]).getAttribute('t'); - + tarteaucitron.makeAsync.init(uri, uniqIds[i]); } }, @@ -254,11 +447,11 @@ tarteaucitron.services.crazyegg = { "cookies": [], "js": function () { "use strict"; - + if (tarteaucitron.user.crazyeggId === undefined) { return; } - + tarteaucitron.addScript('//script.crazyegg.com/pages/scripts/' + tarteaucitron.user.crazyeggId.substr(0, 4) + '/' + tarteaucitron.user.crazyeggId.substr(4, 4) + '.js'); } }; @@ -283,7 +476,7 @@ tarteaucitron.services.criteo = { uniqIds.push(uniqId); return '
    '; }); - + for (i = 0; i < uniqIds.length; i += 1) { uri = '//cas.criteo.com/delivery/ajs.php?'; uri += 'zoneid=' + document.getElementById(uniqIds[i]).getAttribute('zoneid'); @@ -296,7 +489,7 @@ tarteaucitron.services.criteo = { uri += (document.context !== undefined) ? '&context=' + encodeURI(document.context) : ''; uri += ((document.MAX_ct0 !== undefined) && (document.MAX_ct0.substring(0, 4) === 'http')) ? '&ct0=' + encodeURI(document.MAX_ct0) : ''; uri += (document.mmm_fo !== undefined) ? '&mmm_fo=1' : ''; - + tarteaucitron.makeAsync.init(uri, uniqIds[i]); } }, @@ -325,7 +518,7 @@ tarteaucitron.services.dailymotion = { frame_height = 'height=', video_frame, params = 'info=' + x.getAttribute("showinfo") + '&autoPlay=' + x.getAttribute("autoplay"); - + if (video_id === undefined) { return ""; } @@ -376,7 +569,7 @@ tarteaucitron.services.datingaffiliation = { width = x.getAttribute("width"), height = x.getAttribute("height"), url = 'http://www.tools-affil2.com/rotaban/ban.php?' + comfrom; - + return ''; }); }, @@ -410,7 +603,7 @@ tarteaucitron.services.datingaffiliationpopup = { uniqIds.push(uniqId); return '
    '; }); - + for (i = 0; i < uniqIds.length; i += 1) { uri = 'http://www.promotools.biz/da/popunder/script.php?'; uri += 'comfrom=' + document.getElementById(uniqIds[i]).getAttribute('comfrom') + '&'; @@ -433,7 +626,7 @@ tarteaucitron.services.datingaffiliationpopup = { uri += 'snd=' + document.getElementById(uniqIds[i]).getAttribute('snd') + '&'; uri += 'aabd=' + document.getElementById(uniqIds[i]).getAttribute('aabd') + '&'; uri += 'aabs=' + document.getElementById(uniqIds[i]).getAttribute('aabs'); - + tarteaucitron.makeAsync.init(uri, uniqIds[i]); } }, @@ -463,7 +656,7 @@ tarteaucitron.services.disqus = { "fallback": function () { "use strict"; var id = 'disqus'; - + if (document.getElementById('disqus_thread')) { document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id); } @@ -518,7 +711,7 @@ tarteaucitron.services.facebook = { "cookies": [], "js": function () { "use strict"; - tarteaucitron.fallback(['fb-post', 'fb-follow', 'fb-activity', 'fb-send', 'fb-share-button', 'fb-like'], ''); + tarteaucitron.fallback(['fb-post', 'fb-follow', 'fb-activity', 'fb-send', 'fb-share-button', 'fb-like', 'fb-video'], ''); tarteaucitron.addScript('//connect.facebook.net/' + tarteaucitron.getLocale() + '/sdk.js#xfbml=1&version=v2.0', 'facebook-jssdk'); if (tarteaucitron.isAjax === true) { if (typeof FB !== "undefined") { @@ -529,7 +722,7 @@ tarteaucitron.services.facebook = { "fallback": function () { "use strict"; var id = 'facebook'; - tarteaucitron.fallback(['fb-post', 'fb-follow', 'fb-activity', 'fb-send', 'fb-share-button', 'fb-like'], tarteaucitron.engage(id)); + tarteaucitron.fallback(['fb-post', 'fb-follow', 'fb-activity', 'fb-send', 'fb-share-button', 'fb-like', 'fb-video'], tarteaucitron.engage(id)); } }; @@ -638,7 +831,7 @@ tarteaucitron.services.getplus = { if (tarteaucitron.user.getplusId === undefined) { return; } - + window.webleads_site_ids = window.webleads_site_ids || []; window.webleads_site_ids.push(tarteaucitron.user.getplusId); tarteaucitron.addScript('//stats.webleads-tracker.com/js'); @@ -688,7 +881,7 @@ tarteaucitron.services.adsense = { "key": "adsense", "type": "ads", "name": "Google Adsense", - "uri": "http://www.google.com/ads/preferences/", + "uri": "https://adssettings.google.com/", "needConsent": true, "cookies": [], "js": function () { @@ -707,7 +900,7 @@ tarteaucitron.services.googlepartners = { "key": "googlepartners", "type": "ads", "name": "Google Partners Badge", - "uri": "http://www.google.com/ads/preferences/", + "uri": "https://adssettings.google.com/", "needConsent": true, "cookies": [], "js": function () { @@ -726,7 +919,7 @@ tarteaucitron.services.adsensesearchform = { "key": "adsensesearchform", "type": "ads", "name": "Google Adsense Search (form)", - "uri": "http://www.google.com/ads/preferences/", + "uri": "https://adssettings.google.com/", "needConsent": true, "cookies": [], "js": function () { @@ -740,7 +933,7 @@ tarteaucitron.services.adsensesearchresult = { "key": "adsensesearchresult", "type": "ads", "name": "Google Adsense Search (result)", - "uri": "http://www.google.com/ads/preferences/", + "uri": "https://adssettings.google.com/", "needConsent": true, "cookies": [], "js": function () { @@ -753,7 +946,7 @@ tarteaucitron.services.adsensesearchresult = { "fallback": function () { "use strict"; var id = 'adsensesearchresult'; - + if (document.getElementById('gcse_searchresults')) { document.getElementById('gcse_searchresults').innerHTML = tarteaucitron.engage(id); } @@ -773,7 +966,7 @@ tarteaucitron.services.googleadwordsconversion = { if (tarteaucitron.user.adwordsconversionId === undefined) { return; } - + tarteaucitron.addScript('//www.googleadservices.com/pagead/conversion_async.js', '', function () { window.google_trackConversion({ google_conversion_id: tarteaucitron.user.adwordsconversionId, @@ -805,7 +998,7 @@ tarteaucitron.services.googleadwordsremarketing = { if (tarteaucitron.user.adwordsremarketingId === undefined) { return; } - + tarteaucitron.addScript('//www.googleadservices.com/pagead/conversion_async.js', '', function () { window.google_trackConversion({ google_conversion_id: tarteaucitron.user.adwordsremarketingId, @@ -827,8 +1020,17 @@ tarteaucitron.services.gajs = { "use strict"; window._gaq = window._gaq || []; window._gaq.push(['_setAccount', tarteaucitron.user.gajsUa]); - window._gaq.push(['_trackPageview']); - + + if (tarteaucitron.user.gajsAnonymizeIp) { + window._gaq.push (['_gat._anonymizeIp']); + } + + if (tarteaucitron.user.gajsPageView) { + window._gaq.push(['_trackPageview, ' + tarteaucitron.user.gajsPageView]); + } else { + window._gaq.push(['_trackPageview']); + } + tarteaucitron.addScript('//www.google-analytics.com/ga.js', '', function () { if (typeof tarteaucitron.user.gajsMore === 'function') { tarteaucitron.user.gajsMore(); @@ -853,10 +1055,25 @@ tarteaucitron.services.analytics = { window.ga.q.push(arguments); }; window.ga.l = new Date(); - tarteaucitron.addScript('https://www.google-analytics.com/analytics.js', '', function () { - ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 34128000}); - ga('send', 'pageview'); + var uaCreate = {'cookieExpires': 34128000}; + tarteaucitron.extend(uaCreate, tarteaucitron.user.analyticsUaCreate || {}); + ga('create', tarteaucitron.user.analyticsUa, uaCreate); + + if (tarteaucitron.user.analyticsAnonymizeIp) { + ga('set', 'anonymizeIp', true); + } + + if (typeof tarteaucitron.user.analyticsPrepare === 'function') { + tarteaucitron.user.analyticsPrepare(); + } + + if (tarteaucitron.user.analyticsPageView) { + ga('send', 'pageview', tarteaucitron.user.analyticsPageView); + } else { + ga('send', 'pageview'); + } + if (typeof tarteaucitron.user.analyticsMore === 'function') { tarteaucitron.user.analyticsMore(); } @@ -880,12 +1097,11 @@ tarteaucitron.services.gtag = { "js": function () { "use strict"; window.dataLayer = window.dataLayer || []; - tarteaucitron.addScript('https://www.googletagmanager.com/gtag/js?id=' + tarteaucitron.user.gtagUa, '', function () { - function gtag(){dataLayer.push(arguments);} + window.gtag = function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', tarteaucitron.user.gtagUa); - + if (typeof tarteaucitron.user.gtagMore === 'function') { tarteaucitron.user.gtagMore(); } @@ -898,7 +1114,7 @@ tarteaucitron.services.googlemaps = { "key": "googlemaps", "type": "api", "name": "Google Maps", - "uri": "http://www.google.com/ads/preferences/", + "uri": "https://adssettings.google.com/", "needConsent": true, "cookies": [], "js": function () { @@ -912,7 +1128,13 @@ tarteaucitron.services.googlemaps = { tarteaucitron.user.mapscallback = 'tac_googlemaps_callback'; } - tarteaucitron.addScript('//maps.googleapis.com/maps/api/js?v=3.exp&key=' + tarteaucitron.user.googlemapsKey + '&callback='+tarteaucitron.user.mapscallback); + // Add Google Maps libraries if any (https://developers.google.com/maps/documentation/javascript/libraries) + var googleMapsLibraries = ''; + if (tarteaucitron.user.googlemapsLibraries) { + googleMapsLibraries = '&libraries=' + tarteaucitron.user.googlemapsLibraries; + } + + tarteaucitron.addScript('//maps.googleapis.com/maps/api/js?v=3.exp&key=' + tarteaucitron.user.googlemapsKey + '&callback='+tarteaucitron.user.mapscallback + googleMapsLibraries); window.tac_googlemaps_callback = function () { tarteaucitron.fallback(['googlemaps-canvas'], function (x) { @@ -920,7 +1142,7 @@ tarteaucitron.services.googlemaps = { uniqIds.push(uniqId); return '
    '; }); - + for (i = 0; i < uniqIds.length; i += 1) { mapOptions = { zoom: parseInt(document.getElementById(uniqIds[i]).getAttribute('zoom'), 10), @@ -937,12 +1159,73 @@ tarteaucitron.services.googlemaps = { } }; +// googlemaps search +tarteaucitron.services.googlemapssearch = { + "key": "googlemapssearch", + "type": "api", + "name": "Google Maps Seard API", + "uri": "https://adssettings.google.com/", + "needConsent": true, + "cookies": ['nid'], + "js": function () { + "use strict"; + tarteaucitron.fallback(['googlemapssearch'], function (x) { + var width = x.getAttribute("width"), + height = x.getAttribute("height"), + // url = x.getAttribute("data-url"); + query = escape(x.getAttribute("data-search")), + key = x.getAttribute("data-api-key"); + + // return ''; + return ' ' + }); + }, + "fallback": function () { + "use strict"; + var id = 'googlemapssearch'; + tarteaucitron.fallback(['googlemapssearch'], function (elem) { + elem.style.width = elem.getAttribute('width') + 'px'; + elem.style.height = elem.getAttribute('height') + 'px'; + return tarteaucitron.engage(id); + }); + } +}; + +// googlemaps embed iframe +tarteaucitron.services.googlemapsembed = { + "key": "googlemapsembed", + "type": "api", + "name": "Google Maps Embed", + "uri": "https://adssettings.google.com/", + "needConsent": true, + "cookies": ['apisid', 'hsid', 'nid', 'sapisid', 'sid', 'sidcc', 'ssid', '1p_jar'], + "js": function () { + "use strict"; + tarteaucitron.fallback(['googlemapsembed'], function (x) { + var width = tarteaucitron.getElemWidth(x), + height = tarteaucitron.getElemHeight(x), + url = x.getAttribute("data-url"); + + return ''; + }); + }, + "fallback": function () { + "use strict"; + var id = 'googlemapsembed'; + tarteaucitron.fallback(['googlemapsembed'], function (elem) { + elem.style.width = tarteaucitron.getElemWidth(elem) + 'px'; + elem.style.height = tarteaucitron.getElemHeight(elem) + 'px'; + return tarteaucitron.engage(id); + }); + } +}; + // google tag manager tarteaucitron.services.googletagmanager = { "key": "googletagmanager", "type": "api", "name": "Google Tag Manager", - "uri": "http://www.google.com/ads/preferences/", + "uri": "https://adssettings.google.com/", "needConsent": true, "cookies": ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz', '__gads', '_drt_', 'FLC', 'exchange_uid', 'id', 'fc', 'rrs', 'rds', 'rv', 'uid', 'UIDR', 'UID', 'clid', 'ipinfo', 'acs'], "js": function () { @@ -959,12 +1242,26 @@ tarteaucitron.services.googletagmanager = { } }; +// hubspot +tarteaucitron.services.hubspot = { + "key": "hubspot", + "type": "analytic", + "name": "Hubspot", + "uri": "https://legal.hubspot.com/privacy-policy", + "needConsent": true, + "cookies": ['hubspotutk', 'fr', '__hstc', '__hssrc', '__hssc', '__cfduid'], + "js": function () { + "use strict"; + tarteaucitron.addScript('//js.hs-scripts.com/' + tarteaucitron.user.hubspotId + '.js', 'hs-script-loader'); + } +}; + // jsapi tarteaucitron.services.jsapi = { "key": "jsapi", "type": "api", "name": "Google jsapi", - "uri": "http://www.google.com/policies/privacy/", + "uri": "https://policies.google.com/privacy", "needConsent": true, "cookies": [], "js": function () { @@ -973,17 +1270,43 @@ tarteaucitron.services.jsapi = { } }; +// twitterwidgetsapi +tarteaucitron.services.twitterwidgetsapi = { + "key": "twitterwidgetsapi", + "type": "api", + "name": "Twitter Widgets API", + "uri": "https://support.twitter.com/articles/20170514", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + tarteaucitron.fallback(['tacTwitterAPI'], ''); + tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs'); + }, + "fallback": function () { + "use strict"; + var id = 'twitterwidgetsapi'; + tarteaucitron.fallback(['tacTwitterAPI'], tarteaucitron.engage(id)); + } +}; + // recaptcha tarteaucitron.services.recaptcha = { "key": "recaptcha", "type": "api", "name": "reCAPTCHA", - "uri": "http://www.google.com/policies/privacy/", + "uri": "https://policies.google.com/privacy", "needConsent": true, "cookies": ['nid'], "js": function () { "use strict"; + tarteaucitron.fallback(['g-recaptcha'], ''); tarteaucitron.addScript('https://www.google.com/recaptcha/api.js'); + }, + "fallback": function () { + "use strict"; + var id = 'recaptcha'; + tarteaucitron.fallback(['g-recaptcha'], tarteaucitron.engage(id)); } }; @@ -1025,12 +1348,12 @@ tarteaucitron.services.mautic = { if (tarteaucitron.user.mauticurl === undefined) { return; } - + window['MauticTrackingObject'] = 'mt'; window['mt'] = window['mt'] || function() { (window['mt'].q = window['mt'].q || []).push(arguments); }; - + tarteaucitron.addScript(tarteaucitron.user.mauticurl, '', function() { mt('send', 'pageview'); }); @@ -1050,7 +1373,7 @@ tarteaucitron.services.microsoftcampaignanalytics = { if (tarteaucitron.user.microsoftcampaignanalyticsUUID === undefined) { return; } - + tarteaucitron.addScript('//flex.atdmt.com/mstag/site/' + tarteaucitron.user.microsoftcampaignanalyticsUUID + '/mstag.js', 'mstag_tops', function () { window.mstag = {loadTag : function () {}, time : (new Date()).getTime()}; window.mstag.loadTag("analytics", {dedup: "1", domainId: tarteaucitron.user.microsoftcampaignanalyticsdomainId, type: "1", actionid: tarteaucitron.user.microsoftcampaignanalyticsactionId}); @@ -1097,14 +1420,14 @@ tarteaucitron.services.prelinker = { uniqIds.push(uniqId); return '
    '; }); - + for (i = 0; i < uniqIds.length; i += 1) { uri = 'http://promo.easy-dating.org/banner/index?'; uri += 'site_id=' + document.getElementById(uniqIds[i]).getAttribute('siteId') + '&'; uri += 'banner_id=' + document.getElementById(uniqIds[i]).getAttribute('bannerId') + '&'; uri += 'default_language=' + document.getElementById(uniqIds[i]).getAttribute('defaultLanguage') + '&'; uri += 'tr4ck=' + document.getElementById(uniqIds[i]).getAttribute('trackrt'); - + tarteaucitron.makeAsync.init(uri, uniqIds[i]); } }, @@ -1130,7 +1453,7 @@ tarteaucitron.services.prezi = { width = x.getAttribute("width"), height = x.getAttribute("height"), url = 'https://prezi.com/embed/' + id + '/?bgcolor=ffffff&lock_to_path=0&autoplay=0&autohide_ctrls=0'; - + return ''; }); }, @@ -1164,12 +1487,12 @@ tarteaucitron.services.pubdirecte = { uniqIds.push(uniqId); return '
    '; }); - + for (i = 0; i < uniqIds.length; i += 1) { uri = '//www.pubdirecte.com/script/banniere.php?'; uri += 'id=' + document.getElementById(uniqIds[i]).getAttribute('pid') + '&'; uri += 'ref=' + document.getElementById(uniqIds[i]).getAttribute('ref'); - + tarteaucitron.makeAsync.init(uri, uniqIds[i]); } }, @@ -1193,7 +1516,7 @@ tarteaucitron.services.purechat = { if (tarteaucitron.user.purechatId === undefined) { return; } - + tarteaucitron.addScript('//app.purechat.com/VisitorWidget/WidgetScript', '', function () { try { window.w = new PCWidget({ c: tarteaucitron.user.purechatId, f: true }); @@ -1215,7 +1538,7 @@ tarteaucitron.services.shareaholic = { if (tarteaucitron.user.shareaholicSiteId === undefined) { return; } - + tarteaucitron.fallback(['shareaholic-canvas'], ''); tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () { try { @@ -1249,7 +1572,7 @@ tarteaucitron.services.shareasale = { uniqIds.push(uniqId); return '
    '; }); - + for (i = 0; i < uniqIds.length; i += 1) { uri = 'https://shareasale.com/sale.cfm?'; uri += 'amount=' + document.getElementById(uniqIds[i]).getAttribute('amount') + '&'; @@ -1259,7 +1582,7 @@ tarteaucitron.services.shareasale = { uri += 'perlead=' + document.getElementById(uniqIds[i]).getAttribute('perlead') + '&'; uri += 'perhit=' + document.getElementById(uniqIds[i]).getAttribute('perhit') + '&'; uri += 'merchantID=' + document.getElementById(uniqIds[i]).getAttribute('merchantID'); - + document.getElementById(uniqIds[i]).innerHTML = ''; } }, @@ -1285,12 +1608,12 @@ tarteaucitron.services.sharethis = { } var switchTo5x = true, uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js'; - + tarteaucitron.fallback(['tacSharethis'], ''); tarteaucitron.addScript(uri, '', function () { stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false}); }); - + if (tarteaucitron.isAjax === true) { if (typeof stButtons !== "undefined") { stButtons.locateElements(); @@ -1319,7 +1642,7 @@ tarteaucitron.services.slideshare = { width = x.getAttribute("width"), height = x.getAttribute("height"), url = '//www.slideshare.net/slideshow/embed_code/' + id; - + return ''; }); }, @@ -1353,7 +1676,7 @@ tarteaucitron.services.statcounter = { uniqIds.push(uniqId); return '
    '; }); - + for (i = 0; i < uniqIds.length; i += 1) { tarteaucitron.makeAsync.init(uri, uniqIds[i]); } @@ -1402,12 +1725,29 @@ tarteaucitron.services.timelinejs = { } }; +// tagcommander +tarteaucitron.services.tagcommander = { + "key": "tagcommander", + "type": "api", + "name": "TagCommander", + "uri": "https://www.commandersact.com/en/privacy/", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + if (tarteaucitron.user.tagcommanderid === undefined) { + return; + } + tarteaucitron.addScript('https://cdn.tagcommander.com/' + tarteaucitron.user.tagcommanderid + '.js'); + } +}; + // typekit tarteaucitron.services.typekit = { "key": "typekit", "type": "api", "name": "Typekit (adobe)", - "uri": "http://www.adobe.com/fr/privacy.html", + "uri": "https://www.adobe.com/privacy.html", "needConsent": true, "cookies": [], "js": function () { @@ -1433,11 +1773,11 @@ tarteaucitron.services.twenga = { "cookies": [], "js": function () { "use strict"; - + if (tarteaucitron.user.twengaId === undefined || tarteaucitron.user.twengaLocale === undefined) { return; } - + tarteaucitron.addScript('//tracker.twenga.' + tarteaucitron.user.twengaLocale + '/st/tracker_' + tarteaucitron.user.twengaId + '.js'); } }; @@ -1490,7 +1830,7 @@ tarteaucitron.services.twitterembed = { html += '>
    '; return html; }); - + tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs', function () { for (i = 0; i < uniqIds.length; i += 1) { e = document.getElementById(uniqIds[i]); @@ -1562,7 +1902,7 @@ tarteaucitron.services.vimeo = { "key": "vimeo", "type": "video", "name": "Vimeo", - "uri": "http://vimeo.com/privacy", + "uri": "https://vimeo.com/privacy", "needConsent": true, "cookies": ['__utmt_player', '__utma', '__utmb', '__utmc', '__utmv', 'vuid', '__utmz', 'player'], "js": function () { @@ -1573,8 +1913,15 @@ tarteaucitron.services.vimeo = { frame_width = 'width=', video_height = x.getAttribute("height"), frame_height = 'height=', + video_title = x.getAttribute("title") || '', + video_byline = x.getAttribute("byline") || '', + video_portrait = x.getAttribute("portrait") || '', + video_loop = x.getAttribute("loop") || '', + video_autoplay = x.getAttribute("autoplay") || '', video_frame; - + + var video_qs = ''; + if (video_id === undefined) { return ""; } @@ -1584,11 +1931,52 @@ tarteaucitron.services.vimeo = { frame_width += '"" '; } if (video_height !== undefined) { - frame_height += '"' + video_height + '" '; + frame_height += '"' + video_height + '" '; } else { frame_height += '"" '; } - video_frame = ''; + + if (video_title.length > 0 || video_byline.length > 0 || video_portrait.length > 0) { + + video_qs = "?"; + + if (video_title.length > 0) { + video_qs += "title=" + video_title; + } + + if (video_byline.length > 0) { + if (video_qs.length > 1) { + video_qs += "&"; + } + video_qs += "byline=" + video_byline; + } + + if (video_portrait.length > 0) { + if (video_qs.length > 1) { + video_qs += "&"; + } + video_qs += "portrait=" + video_portrait; + } + + if (video_loop.length > 0) { + if (video_qs.length > 1) { + video_qs += "&"; + } + video_qs += "loop=" + video_loop; + } + + if (video_autoplay.length > 0) { + if (video_qs.length > 1) { + video_qs += "&"; + } + video_qs += "autoplay=" + video_autoplay; + } + + + } + + video_frame = ''; + return video_frame; }); }, @@ -1668,7 +2056,7 @@ tarteaucitron.services.xiti = { "key": "xiti", "type": "analytic", "name": "Xiti", - "uri": "http://www.atinternet.com/politique-du-respect-de-la-vie-privee/", + "uri": "https://www.atinternet.com/societe/rgpd-et-vie-privee/", "needConsent": true, "cookies": [], "js": function () { @@ -1695,22 +2083,47 @@ tarteaucitron.services.xiti = { Xt_s = screen; Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth; } - + div.innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">'; document.getElementsByTagName('body')[0].appendChild(div.firstChild); - + if (typeof tarteaucitron.user.xitiMore === 'function') { tarteaucitron.user.xitiMore(); } } }; +// AT Internet +tarteaucitron.services.atinternet = { + "key": "atinternet", + "type": "analytic", + "name": "AT Internet", + "uri": "https://www.atinternet.com/societe/rgpd-et-vie-privee/", + "needConsent": true, + "cookies": ['atidvisitor', 'atreman', 'atredir', 'atsession', 'atuserid'], + "js": function () { + "use strict"; + if (tarteaucitron.user.atLibUrl === undefined) { + return; + } + + tarteaucitron.addScript(tarteaucitron.user.atLibUrl, '', function() { + + var tag = new ATInternet.Tracker.Tag(); + + if (typeof tarteaucitron.user.atMore === 'function') { + tarteaucitron.user.atMore(); + } + }) + } +}; + // youtube tarteaucitron.services.youtube = { "key": "youtube", "type": "video", "name": "YouTube", - "uri": "https://www.google.fr/intl/fr/policies/privacy/", + "uri": "https://policies.google.com/privacy", "needConsent": true, "cookies": ['VISITOR_INFO1_LIVE', 'YSC', 'PREF', 'GEUP'], "js": function () { @@ -1723,7 +2136,7 @@ tarteaucitron.services.youtube = { frame_height = 'height=', video_frame, params = 'theme=' + x.getAttribute("theme") + '&rel=' + x.getAttribute("rel") + '&controls=' + x.getAttribute("controls") + '&showinfo=' + x.getAttribute("showinfo") + '&autoplay=' + x.getAttribute("autoplay"); - + if (video_id === undefined) { return ""; } @@ -1757,7 +2170,7 @@ tarteaucitron.services.youtubeplaylist = { "key": "youtubeplaylist", "type": "video", "name": "YouTube (playlist)", - "uri": "https://www.google.fr/intl/fr/policies/privacy/", + "uri": "https://policies.google.com/privacy", "needConsent": true, "cookies": ['VISITOR_INFO1_LIVE', 'YSC', 'PREF', 'GEUP'], "js": function () { @@ -1770,7 +2183,7 @@ tarteaucitron.services.youtubeplaylist = { frame_height = 'height=', video_frame, params = 'theme=' + x.getAttribute("theme") + '&rel=' + x.getAttribute("rel") + '&controls=' + x.getAttribute("controls") + '&showinfo=' + x.getAttribute("showinfo") + '&autoplay=' + x.getAttribute("autoplay"); - + if (playlist_id === undefined) { return ""; } @@ -1867,3 +2280,399 @@ tarteaucitron.services.facebookpixel = { } }; +//Issuu +tarteaucitron.services.issuu = { + "key": "issuu", + "type": "other", + "name": "Issuu", + "uri": "https://issuu.com/legal/privacy", + "needConsent": true, + "cookies": ['__qca', 'iutk', 'mc'], + "js": function () { + "use strict"; + tarteaucitron.fallback(['issuu_player'], function (x) { + var issuu_id = x.getAttribute("issuuID"), + issuu_width = x.getAttribute("width"), + frame_width = 'width=', + issuu_height = x.getAttribute("height"), + frame_height = 'height=', + issuu_frame; + + if (issuu_id === undefined) { + return ""; + } + if (issuu_width !== undefined) { + frame_width += '"' + issuu_width + '" '; + } else { + frame_width += '"" '; + } + if (issuu_height !== undefined) { + frame_height += '"' + issuu_height + '" '; + } else { + frame_height += '"" '; + } + issuu_frame = ''; + return issuu_frame; + }); + }, + "fallback": function () { + "use strict"; + var id = 'issuu'; + tarteaucitron.fallback(['issuu_player'], function (elem) { + elem.style.width = elem.getAttribute('width') + 'px'; + elem.style.height = elem.getAttribute('height') + 'px'; + return tarteaucitron.engage(id); + }); + } +}; + +// webmecanik +tarteaucitron.services.webmecanik = { + "key": "webmecanik", + "type": "analytic", + "name": "Webmecanik", + "uri": "https://webmecanik.com/tos", + "needConsent": true, + "cookies": ['mtc_id', 'mtc_sid'], + "js": function () { + "use strict"; + if (tarteaucitron.user.webmecanikurl === undefined) { + return; + } + window['WebmecanikTrackingObject'] = 'mt'; + window['mt'] = window['mt'] || function() { + (window['mt'].q = window['mt'].q || []).push(arguments); + }; + + tarteaucitron.addScript(tarteaucitron.user.webmecanikurl, '', function() { + mt('send', 'pageview'); + }); + } +}; + +// google analytics multiple +tarteaucitron.services.multiplegtag = { + "key": "multiplegtag", + "type": "analytic", + "name": "Google Analytics (gtag.js)", + "uri": "https://support.google.com/analytics/answer/6004245", + "needConsent": true, + "cookies": (function () { + + var cookies = ['_ga', '_gat', '_gid', '__utma', '__utmb', '__utmc', '__utmt', '__utmz']; + + if (tarteaucitron.user.multiplegtagUa !== undefined) { + tarteaucitron.user.multiplegtagUa.forEach(function(ua) { + cookies.push('_gat_gtag_' + ua.replace(/-/g, '_')); + }); + } + + return cookies; + })(), + "js": function () { + "use strict"; + window.dataLayer = window.dataLayer || []; + + tarteaucitron.user.multiplegtagUa.forEach(function(ua) { + + tarteaucitron.addScript('https://www.googletagmanager.com/gtag/js?id=' + ua, '', function () { + window.gtag = function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', ua); + }); + }); + } +}; + +// Koban +tarteaucitron.services.koban = { + "key": "koban", + "type": "analytic", + "name": "Koban", + "uri": "https://koban.cloud/tos", + "needConsent": true, + "cookies": ['kbntrk'], + "js": function () { + "use strict"; + if (tarteaucitron.user.kobanurl === undefined) { + return; + } + if (tarteaucitron.user.kobanapi === undefined) { + return; + } + window.KobanObject = 'kb'; + window.kb = window.kb || function() { + window.kb.q = window.kb.q || []; + window.kb.q.push(arguments); + }; + window.kb.l = new Date(); + kb('reg', tarteaucitron.user.kobanapi); + tarteaucitron.addScript(tarteaucitron.user.kobanurl, '', function() { + }); + } +}; + +// matomo + +/* + 1. Set the following variable before the initialization : + + tarteaucitron.user.matomoId = YOUR_SITE_ID_FROM_MATOMO; + tarteaucitron.user.matomoHost = "YOUR_MATOMO_URL"; //eg: https://stat.mydomain.com/ + + 2. Push the service : + + (tarteaucitron.job = tarteaucitron.job || []).push('matomo'); + + 3. HTML + You don't need to add any html code, if the service is autorized, the javascript is added. otherwise no. + */ +tarteaucitron.services.matomo = { + "key": "matomo", + "type": "analytic", + "name": "Matomo (formerly known as Piwik)", + "uri": "https://matomo.org/faq/general/faq_146/", + "needConsent": false, + "cookies": ['_pk_ref', '_pk_cvar', '_pk_id', '_pk_ses', '_pk_hsr', 'piwik_ignore', '_pk_uid'], + "js": function () { + "use strict"; + if (tarteaucitron.user.matomoId === undefined) { + return; + } + + window._paq = window._paq || []; + window._paq.push(["setSiteId", tarteaucitron.user.matomoId]); + window._paq.push(["setTrackerUrl", tarteaucitron.user.matomoHost + "piwik.php"]); + window._paq.push(["setDoNotTrack", 1]); + window._paq.push(["trackPageView"]); + window._paq.push(["setIgnoreClasses", ["no-tracking", "colorbox"]]); + window._paq.push(["enableLinkTracking"]); + window._paq.push([function() { + var self = this; + function getOriginalVisitorCookieTimeout() { + var now = new Date(), + nowTs = Math.round(now.getTime() / 1000), + visitorInfo = self.getVisitorInfo(); + var createTs = parseInt(visitorInfo[2]); + var cookieTimeout = 33696000; // 13 mois en secondes + var originalTimeout = createTs + cookieTimeout - nowTs; + return originalTimeout; + } + this.setVisitorCookieTimeout( getOriginalVisitorCookieTimeout() ); + }]); + + tarteaucitron.addScript(tarteaucitron.user.matomoHost + 'piwik.js', '', '', true, 'defer', true); + } +}; + +// Hotjar + /* + 1. Set the following variable before the initialization : + tarteaucitron.user.hotjarId = YOUR_WEBSITE_ID; + tarteaucitron.user.HotjarSv = XXXX; // Can be found in your website tracking code as "hjvs=XXXX" + 2. Push the service : + (tarteaucitron.job = tarteaucitron.job || []).push('hotjar'); + 3. HTML + You don't need to add any html code, if the service is autorized, the javascript is added. otherwise no. + */ +tarteaucitron.services.hotjar = { + "key": "hotjar", + "type": "analytic", + "name": "Hotjar", + "uri": "https://help.hotjar.com/hc/en-us/categories/115001323967-About-Hotjar", + "needConsent": true, + "cookies": ["hjClosedSurveyInvites", "_hjDonePolls", "_hjMinimizedPolls", "_hjDoneTestersWidgets", "_hjMinimizedTestersWidgets", "_hjDoneSurveys", "_hjIncludedInSample", "_hjShownFeedbackMessage"], + "js": function () { + "use strict"; + if (tarteaucitron.user.hotjarId === undefined || tarteaucitron.user.HotjarSv === undefined) { + return; + } + window.hj = window.hj || function() { + (window.hj.q = window.hj.q || []).push(arguments) + }; + window._hjSettings = { + hjid: tarteaucitron.user.hotjarId, + hjsv: tarteaucitron.user.HotjarSv + }; + var uri = 'https://static.hotjar.com/c/hotjar-'; + var extension = '.js?sv='; + tarteaucitron.addScript(uri + window._hjSettings.hjid + extension + window._hjSettings.hjsv); + } +}; + +// bing ads universal event tracking +tarteaucitron.services.bingads = { + 'key': 'bingads', + 'type': 'ads', + 'name': 'Bing Ads Universal Event Tracking', + 'uri': 'https://advertise.bingads.microsoft.com/en-us/resources/policies/personalized-ads', + 'needConsent': true, + 'cookies': ['_uetmsclkid'], + 'js': function () { + 'use strict'; + var u = tarteaucitron.user.bingadsTag || 'uetq'; + window[u] = window[u] || []; + + tarteaucitron.addScript('https://bat.bing.com/bat.js', '', function () { + var bingadsCreate = {ti: tarteaucitron.user.bingadsID}; + + if ('bingadsStoreCookies' in tarteaucitron.user) { + bingadsCreate['storeConvTrackCookies'] = tarteaucitron.user.bingadsStoreCookies; + } + + bingadsCreate.q = window[u]; + window[u] = new UET(bingadsCreate); + window[u].push('pageload'); + }); + } +}; + +//Matterport +/* +SERVICE INIT + (tarteaucitron.job = tarteaucitron.job || []).push('matterport'); + +HTML TAG +
    + +DELETE IFRAME + ' + */ +tarteaucitron.services.matterport = { + "key": "matterport", + "type": "other", + "name": "Matterport", + "uri": "https://matterport.com/es/legal/privacy-policy/", + "needConsent": true, + "cookies": ['__cfduid', 'ajs_anonymous_id', 'ajs_group_id', 'ajs_user_id'], + "js": function () { + "use strict"; + tarteaucitron.fallback(['matterport'], function (x) { + var matterport_id = x.getAttribute("matterportID"), + matterport_width = x.getAttribute("width"), + frame_width = 'width=', + matterport_height = x.getAttribute("height"), + frame_height = 'height=', + matterport_parameters = x.getAttribute("parameters"), + matterport_frame; + + if (matterport_id === undefined) { + return ""; + } + if (matterport_width !== undefined) { + frame_width += '"' + matterport_width + '" '; + } else { + frame_width += '"" '; + } + if (matterport_height !== undefined) { + frame_height += '"' + matterport_height + '" '; + } else { + frame_height += '"" '; + } + if (matterport_parameters === undefined) { + return ""; + } + + matterport_frame = ''; + return matterport_frame; + }); + }, + "fallback": function () { + "use strict"; + var id = 'matterport'; + tarteaucitron.fallback(['matterport'], function (elem) { + elem.style.width = elem.getAttribute('width') + 'px'; + elem.style.height = elem.getAttribute('height') + 'px'; + return tarteaucitron.engage(id); + }); + } +}; + +// Adform +tarteaucitron.services.adform = { + "key": "adform", + "type": "ads", + "name": "Adform", + "uri": "https://site.adform.com/privacy-center/overview/", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + + if (tarteaucitron.user.adformpm === undefined || tarteaucitron.user.adformpagename === undefined) { + return; + } + + window._adftrack = { + pm: tarteaucitron.user.adformpm, + divider: encodeURIComponent('|'), + pagename: encodeURIComponent(tarteaucitron.user.adformpagename) + }; + + tarteaucitron.addScript("https://track.adform.net/serving/scripts/trackpoint/async/"); + } +}; + +// Active Campaign +tarteaucitron.services.activecampaign = { + "key": "activecampaign", + "type": "ads", + "name": "Active Campaign", + "uri": "https://www.activecampaign.com/privacy-policy/", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + if (tarteaucitron.user.actid === undefined) { + return; + } + + window.trackcmp_email = ''; + + tarteaucitron.addScript('https://trackcmp.net/visit?actid='+tarteaucitron.user.actid+'&e='+encodeURIComponent(trackcmp_email)+'&r='+encodeURIComponent(document.referrer)+'&u='+encodeURIComponent(window.location.href)); + } +}; + +// tawk.to +tarteaucitron.services.tawkto = { + "key": "tawkto", + "type": "support", + "name": "Tawk.to chat", + "uri": "https://www.tawk.to/data-protection/", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + if (tarteaucitron.user.tawktoId === undefined) { + return; + } + + window.Tawk_API=window.Tawk_API||{}; + window.Tawk_LoadStart=new Date(); + + tarteaucitron.addScript('https://embed.tawk.to/' + tarteaucitron.user.tawktoId + '/default'); + } + +}; + +// getquanty +tarteaucitron.services.getquanty = { + "key": "getquanty", + "type": "analytic", + "name": "GetQuanty", + "uri": "https://www.getquanty.com/mentions-legales/", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + if (tarteaucitron.user.getguanty === undefined) { + return; + } + + window.webleads_site_ids = window.webleads_site_ids || []; + window.webleads_site_ids.push(tarteaucitron.user.getguanty); + + tarteaucitron.addScript('https://stats.webleads-tracker.com/js'); + tarteaucitron.addScript('https://get.smart-data-systems.com/track?site_id=' + tarteaucitron.user.getguanty); + } +};