Created
April 6, 2018 13:32
-
-
Save KeithP/44b7ac4555f18f6a767788243071fb35 to your computer and use it in GitHub Desktop.
How to initialise https://cookieconsent.insites.com with "Disabling cookies" code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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