By default, this project contains the scripts and styles to display the a cookie policy notification on a web page.
You can use it to display a custom cookies message of your choosing on your own web page.
This project can be installed from an NPM package.
You can configure the cookie policy with the following options.
You can edit to cookie policy message by passing the setup function an options object with a content value. For example:
var options = {
content: 'We use cookies to improve your experience.',
};
You can make the cookie policy self-destruct in time by passing a duration value as an option. Duration is measured in milliseconds.
var options = {
duration: 3000,
};
Note: It is recommended you add a link to your cookie policy in the footer of your website when using this option.
var options = {
content:
'We use cookies to improve your experience. By your continued use of this site you accept such use.<br /> This notice will disappear by itself.',
duration: 3000,
};
cpNs.cookiePolicy.setup(options);
If you would like to help improve this project, here is a list of commands to help you get started.
Install the requisite dependencies;
npm install
To build the JS and CSS into the build folder, run:
npm run build
You can view the build files in action by opening the index.html
in the root
of this project.
When developing this project you can run the following command to listen to
changes in the src/js/*js
and src/sass/*scss
folders and build them into the
/build
folder.
npm run watch
Before submitting your pull request, run the linters, which checks both the JS and Sass for errors.
npm run test
Code licensed LGPLv3 by Canonical Ltd.
With ♥ from Canonical