add opt-in and status change listener

This commit is contained in:
Silver Kuusik 2018-07-08 20:50:42 +02:00 committed by GitHub
parent 702cfab6bc
commit b03e7374a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -1,5 +1,12 @@
var cookiesEnabled = false;
window.addEventListener("load", function() {
window.cookieconsent.initialise({
"type": "opt-in",
"position": "bottom-right",
content: {
message: 'Please allow cookies to enable all features of this website.'
},
"palette": {
"popup": {
"background": "#242943ff"
@ -7,6 +14,15 @@ window.addEventListener("load", function() {
"button": {
"background": "#ffd500ff"
}
},
onStatusChange: function(status, chosenBefore) {
// Allow cookies
if (status == 'allow') {
cookiesEnabled = true;
// Disable cookies
} else {
cookiesEnabled = false
}
}
})
});