Novicell Cookie Info
Cookie information dialog used to show a short text about, the use of cookies for the website, due to european laws.
Usage
Written in pure Vanilla JS, it has no dependencies. It ships with a sample LESS file, for easy implementation with the novicell-frontend setup. Use the styles for inspiration and then make your own styles.
Install with npm
npm install novicell-cookie-info --save
Setup
First make some HTML using the these id's, for the JS to work:
Markup
Cookies? × We're using cookies on this website, is that OK with you? Fine with me :) Me no likie :(
Then include the js file in your js bundle or in your HTML:
JS bundle
scripts: vendorPath + "novicell-cookie-info/js/novicell.cookieinfo.js" ...
HTML
Then call the init
-method from your master.js
-file:
document;
Withdraw consent
If you need to withdraw the cookie consent, you can call the declineCookieInfo
like this:
Withdraw your consent of cookies, on this webpage
Extension
When extending the script, make sure to make a singleton for the novicell
and the novicell.cookieInfo
objects before adding your own methods.
'use strict'; var novicell = novicell || {};novicellcookieInfo = novicellcookieInfo || {};novicellcookieInfoextentions = novicellcookieInfoextentions || this { console; };;
Next you need to include your js-files in your js bundle or in your HTML, and then call the init
-method from your master.js
.
Make sure to load you:
JS bundle
scripts: vendorPath + "novicell-cookie-info/js/novicell.cookieinfo.js" projectPath + "/components/novicell.cookieinfo.extentions.js" ...
HTML
Then call the test
-method from your master.js
:
document;