cookie default options
This commit is contained in:
parent
6e5f66c42d
commit
ccc1150bfb
1 changed files with 49 additions and 5 deletions
|
|
@ -15,13 +15,57 @@ const cc = new CC({
|
||||||
theme: "edgeless",
|
theme: "edgeless",
|
||||||
type: "opt-in",
|
type: "opt-in",
|
||||||
content: {
|
content: {
|
||||||
message: "This website uses cookies for Google Analytics, for pure statistics purposes."
|
message: "This website uses cookies for Google Analytics, for pure statistics purposes.",
|
||||||
|
dismiss: 'Got it!',
|
||||||
|
allow: 'Allow cookies',
|
||||||
|
deny: 'Decline',
|
||||||
|
link: 'Learn more',
|
||||||
|
href: 'https://www.cookiesandyou.com',
|
||||||
|
close: '❌',
|
||||||
|
policy: 'Cookie Policy',
|
||||||
|
target: '_blank',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// cc.on("initialized", (...args) => console.log(args));
|
||||||
|
cc.on("initialized", (...args) => {
|
||||||
|
console.log(args);
|
||||||
|
|
||||||
|
let type = this.options.type;
|
||||||
|
let didConsent = this.hasConsented();
|
||||||
|
if (type == 'opt-in' && didConsent) {
|
||||||
|
// enable cookies
|
||||||
|
}
|
||||||
|
if (type == 'opt-out' && !didConsent) {
|
||||||
|
// disable cookies
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
cc.on("revokeChoice", () => {
|
||||||
|
console.log("Popup Reset");
|
||||||
|
|
||||||
|
var type = this.options.type;
|
||||||
|
if (type == 'opt-in') {
|
||||||
|
// disable cookies
|
||||||
|
}
|
||||||
|
if (type == 'opt-out') {
|
||||||
|
// enable cookies
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
cc.on("statusChanged", (...args) => {
|
||||||
|
console.log(args);
|
||||||
|
|
||||||
|
let type = this.options.type;
|
||||||
|
let didConsent = this.hasConsented();
|
||||||
|
if (type == 'opt-in' && didConsent) {
|
||||||
|
// enable cookies
|
||||||
|
}
|
||||||
|
if (type == 'opt-out' && !didConsent) {
|
||||||
|
// disable cookies
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
cc.on("initialized", (...args) => console.log(args));
|
|
||||||
cc.on("error", console.error);
|
cc.on("error", console.error);
|
||||||
cc.on("popupOpened", () => console.log("Popup Open"));
|
cc.on("popupOpened", () => console.log("Popup Open"));
|
||||||
cc.on("popupClosed", () => console.log("Popup Closed"));
|
cc.on("popupClosed", () => console.log("Popup Closed"));
|
||||||
cc.on("revokeChoice", () => console.log("Popup Reset"));
|
|
||||||
cc.on("statusChanged", (...args) => console.log(args));
|
|
||||||
Loading…
Reference in a new issue