qw3rtty / grav-plugin-simple-cookie

The Simple Cookie Plugin is an extension for Grav. The plugin is based on the popular CookieConsent JS-library. For Advanced Opt-In/Opt-Out configurations you can use the 'Custom configuration' option.
MIT License
8 stars 2 forks source link

(request) Cookies prompt block and close page #7

Closed adeliktas closed 4 years ago

adeliktas commented 4 years ago

Hello, i would like to request this: prompt (possibly central like a message box) every time you visit the page and consentcookie isnt set to allow and if prompt gets declined force close the page

Example: if(cookieconsent_status.exists && cookieconsent_status == 'deny') if(prompt() == denied) closepage()

I have tried on my own to work on this, but i wasn't able to understand the plugin properly. (I also didnt code in javascript before) https://github.com/thomasschwarz96/grav-plugin-simple-cookie/blob/master/assets/cookieconsent.min.js The syntax of the plugin without a proper structure(newlines and tabs) made it hard to read and worse to modify(even though i tried to format it somehow readable adding newlines after each { } ;)

Thanks in advance

qw3rtty commented 4 years ago

Hello @adeliktas My plugin is a wrapper over the Open-Source Cookie Consent library of Osano. So you have to use one of the callbacks from the library. Here is the Link for the JavaScript API: https://www.osano.com/cookieconsent/documentation/javascript-api/

The syntax is desired because the file is minified ;). Here you can download the library and get the unminfied file: https://www.osano.com/cookieconsent/download/

I will not implement this feature. I think it is too hard to kick out the user if he not accepts the cookies.