New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

novicell-cookie-info

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

novicell-cookie-info

Cookie information dialog used to show a short text about, the use of cookies for the website, due to european laws.

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

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

<button class="cookie-info-open" id="js-cookie-info-open">
    Cookies?
</button>
<section class="cookie-info" id="js-cookie-info">
    <div class="cookie-info__text">
        <p>We're using cookies on this website, is that OK with you?</p>
        <button class="cookie-info__close button" id="js-cookie-info-close">Fine with me :)</button>
    </div>
</section>

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

    <script src="/node_modules/novicell-cookie-info/js/novicell.cookieinfo.js"></script>

Then call the init-method from your master.js-file:


document.addEventListener("DOMContentLoaded", function() {
    novicell.cookieInfo.init();
    ...
});

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 || {};
novicell.cookieInfo = novicell.cookieInfo || {};
novicell.cookieInfo.extentions = novicell.cookieInfo.extentions || new function () {
    this.test = function() {
        console.log('test');
    };
}();

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

    <script src="/node_modules/novicell-cookie-info/js/novicell.cookieinfo.js"></script>
    <script src="/scripts/components/novicell.cookieinfo.extentions.js"></script>

Then call the test-method from your master.js:


document.addEventListener("DOMContentLoaded", function() {
    novicell.cookieInfo.init();
    novicell.cookieInfo.extentions.test();
    ...
});

Keywords

FAQs

Package last updated on 20 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc