sumorobot-web/assets/js/cookie.js

35 lines
972 B
JavaScript
Raw Normal View History

2018-07-08 18:50:42 +00:00
var cookiesEnabled = false;
2018-01-28 09:36:50 +00:00
window.addEventListener("load", function() {
window.cookieconsent.initialise({
2018-07-08 18:50:42 +00:00
"type": "opt-in",
"position": "bottom-right",
content: {
message: 'Please allow cookies to enable all features of this website.'
},
2018-01-28 09:36:50 +00:00
"palette": {
"popup": {
"background": "#242943ff"
},
"button": {
"background": "#ffd500ff"
}
2018-07-08 18:50:42 +00:00
},
onInitialise: function (status) {
// When cookies are allowed
if (status == 'allow') {
cookiesEnabled = true;
}
},
2018-07-08 18:50:42 +00:00
onStatusChange: function(status, chosenBefore) {
// When cookies are allowed
2018-07-08 18:50:42 +00:00
if (status == 'allow') {
cookiesEnabled = true;
// When cookies are disabled
2018-07-08 18:50:42 +00:00
} else {
cookiesEnabled = false
}
2018-01-28 09:36:50 +00:00
}
})
});