|
/** |
|
* This script runs the Insites Cookie Consent script |
|
* https://cookieconsent.insites.com/ |
|
* |
|
* third-party cookies are contained within a <template> tag, which is inert. |
|
* when users opt in, the contents of the template are activated. |
|
* |
|
* There is no realistic way to unset cookies set after opt-in. |
|
* The user will have to purge cookies manually. |
|
* |
|
* MIT licensed by Joost Baaij, Space Babies: www.spacebabies.nl |
|
*/ |
|
var cookieConsent = (function() { |
|
var handlers = { |
|
initialise: function(status) { |
|
var type = this.options.type |
|
if (type === 'opt-in' && status === 'allow') { |
|
activateTemplate('#cookieConsent') |
|
} |
|
}, |
|
|
|
statusChange: function(status, chosenBefore) { |
|
var type = this.options.type |
|
if (type == 'opt-in' && status === 'allow') { |
|
activateTemplate('#cookieConsent') |
|
} |
|
} |
|
} |
|
|
|
var options = { |
|
"palette": { |
|
"popup": { |
|
"background": "#715ea1" |
|
}, |
|
"button": { |
|
"background": "#ae9ae0" |
|
} |
|
}, |
|
"theme": "edgeless", |
|
"type": "opt-in", |
|
"content": { |
|
"message": "Wij gebruiken cookies om u een zo compleet mogelijke service aan te kunnen bieden. Door hiermee akkoord te gaan weet u zeker dat de website optimaal werkt.", |
|
"dismiss": "Ik wil geen cookies", |
|
"allow": "Sta cookies toe", |
|
"deny": "Afwijzen", |
|
"link": "Meer informatie", |
|
"href": "http://www.blitts.nl/36/support/cookie-beleid.html" |
|
}, |
|
onInitialise: handlers.initialise, |
|
onStatusChange: handlers.statusChange |
|
} |
|
|
|
// does the browser support <template>? (all but legacy IE) |
|
function supportsTemplate() { |
|
return 'content' in document.createElement('template') |
|
} |
|
|
|
function activateTemplate(selector) { |
|
if (supportsTemplate) { |
|
var content = document.querySelector(selector).content |
|
var clone = document.importNode(content, true) |
|
document.body.appendChild(clone) |
|
} |
|
} |
|
|
|
function initialise() { |
|
window.addEventListener("load", function() { |
|
window.cookieconsent.initialise(options) |
|
}) |
|
} |
|
|
|
return { |
|
activateTemplate: initialise |
|
} |
|
})() |
|
|
|
cookieConsent.activateTemplate() |