Give the possibility to change cookie's name
This commit is contained in:
parent
249a00dd7e
commit
933ea94c31
|
|
@ -118,6 +118,7 @@ In PHP for example, you can bypass all the script by setting this var `tarteauci
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
tarteaucitron.init({
|
tarteaucitron.init({
|
||||||
"hashtag": "#tarteaucitron", /* Ouverture automatique du panel avec le hashtag */
|
"hashtag": "#tarteaucitron", /* Ouverture automatique du panel avec le hashtag */
|
||||||
|
"cookieName": "tartaucitron", /* Nom du cookie */
|
||||||
"highPrivacy": false, /* désactiver le consentement implicite (en naviguant) ? */
|
"highPrivacy": false, /* désactiver le consentement implicite (en naviguant) ? */
|
||||||
"orientation": "top", /* le bandeau doit être en haut (top) ou en bas (bottom) ? */
|
"orientation": "top", /* le bandeau doit être en haut (top) ou en bas (bottom) ? */
|
||||||
"adblocker": false, /* Afficher un message si un adblocker est détecté */
|
"adblocker": false, /* Afficher un message si un adblocker est détecté */
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,7 @@ var tarteaucitron = {
|
||||||
defaults = {
|
defaults = {
|
||||||
"adblocker": false,
|
"adblocker": false,
|
||||||
"hashtag": '#tarteaucitron',
|
"hashtag": '#tarteaucitron',
|
||||||
|
"cookieName": 'tarteaucitron',
|
||||||
"highPrivacy": false,
|
"highPrivacy": false,
|
||||||
"orientation": "top",
|
"orientation": "top",
|
||||||
"removeCredit": false,
|
"removeCredit": false,
|
||||||
|
|
@ -886,7 +887,7 @@ var tarteaucitron = {
|
||||||
expireTime = time + timeExipre, // 365 days
|
expireTime = time + timeExipre, // 365 days
|
||||||
regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
|
regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
|
||||||
cookie = tarteaucitron.cookie.read().replace(regex, ""),
|
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 + ';' : '';
|
domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? 'domain=' + tarteaucitron.parameters.cookieDomain + ';' : '';
|
||||||
|
|
||||||
if (tarteaucitron.cookie.read().indexOf(key + '=' + status) === -1) {
|
if (tarteaucitron.cookie.read().indexOf(key + '=' + status) === -1) {
|
||||||
|
|
@ -898,7 +899,7 @@ var tarteaucitron = {
|
||||||
},
|
},
|
||||||
"read": function () {
|
"read": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
var nameEQ = "tarteaucitron=",
|
var nameEQ = tarteaucitron.parameters.cookieName + "=",
|
||||||
ca = document.cookie.split(';'),
|
ca = document.cookie.split(';'),
|
||||||
i,
|
i,
|
||||||
c;
|
c;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue