Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cookiesalert

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cookiesalert

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
3
Created
Source

Cookies alert

Gem Version

Easily add a Cookie consent banner, upon the user’s first visit to the site, to alert the users about the cookies and get consent for setting them.

Installation

Add this line to your application's Gemfile:

gem 'cookiesalert'

And then execute:

$ bundle

Usage

Add in "application.js":

//= require cookiesalert/cookie
//= require cookiesalert/cookies_alert

Run Javascript check when load/ready:

$( document ).ready(function() {
    cookies.check();
});

Javascript optional parameters to select "#text_div" and add listener in "#button_confirm" to accept cookies:

cookies.check({
  div : '#div',
  btn : '#button',
  expires : 7 //Days
});

Optional template

Add optional styles in "application.css":

*= require cookiesalert/cookies_alert

Import optional view layout:

<%= render "cookies/alert", advice: "Cookies Text", link: "Link Advice", button: "Button" %>

Render optional parameters:

<%= render "cookies/alert", advice: "Cookies Text", link: link_to('Link Advice', root_path, target: '_blank'), button: image_tag('cross_cookies.svg') %>

Used Javascript Linter

ESLint file config ".eslintrc.js":

module.exports = {
    "env": {
        "browser": true,
        "commonjs": true
    },
    "extends": "eslint:recommended",
    "rules": {
        "indent": [
            "error",
            2
        ],
        "linebreak-style": [
            "error",
            "unix"
        ],
        "quotes": [
            "error",
            "single"
        ],
        "semi": [
            "error",
            "always"
        ],
	"no-undef" : 0
    }
};

Dependences included:

Contributing

Bug reports and pull requests are welcome on GitHub. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

cookiesalert is Copyright © 2018 CodiTramuntana SL. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About CodiTramuntana

CodiTramuntana's Logo

Maintained by CodiTramuntana.

The names and logos for CodiTramuntana are trademarks of CodiTramuntana SL.

We love open source software!

FAQs

Package last updated on 25 Feb 2019

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