Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to initialise https://cookieconsent.insites.com with "Disabling cookies" code
window.App ||= {}
App.init = ->
window.cookieconsent.initialise
"palette":
"popup":
"background": "#252e39"
,
"button":
"background": "#14a7d0"
,
"theme": "classic",
"type": "opt-out",
onInitialise: (status) ->
type = this.options.type
consented = this.hasConsented()
if type == 'opt-out' && !consented
# disable cookies
App.disableCookies()
,
onStatusChange: (status, chosenBefore) ->
type = this.options.type
consented = this.hasConsented()
if consented
# ensable cookies
App.enableCookies()
if !consented
# disable cookies
App.disableCookies()
,
onRevokeChoice: () ->
# disable cookies
App.disableCookies()
,
"content":
"dismiss": "Accept cookies",
"message": "This website uses cookies to ensure you get the best experience on our website.",
"link": " Cookies Policy",
"href": "/cookies-policy"
$(document).on "turbolinks:load", ->
App.init()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment