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

@getdesigned-vienna/cookie-consent

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@getdesigned-vienna/cookie-consent - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

38

getdesigned-cookie-consent.js

@@ -42,10 +42,13 @@ function GdCookieConsent(debug = false) {

if (!status) {
$optInEls.off('click.askExplicitPermission').on('click.askExplicitPermission', function () {
var msg = that.getCookieMsg(id);
if (confirm(msg)) {
that.$gdcc.find('#' + id).prop("checked", 1);
that.saveUserSettings(that);
that.updateContent();
}
});
var msg = that.getCookieMsg(id);
if (msg) {
$optInEls.addClass('gdcc-has-msg');
$optInEls.off('click.askExplicitPermission').on('click.askExplicitPermission', function () {
if (confirm(msg)) {
that.$gdcc.find('#' + id).prop("checked", 1);
that.saveUserSettings(that);
that.updateContent();
}
});
}
}

@@ -61,6 +64,11 @@

$label = this.$gdcc.find('label[for=' + id + ']');
return (this.getAttribute($label, 'data-gdcc-msg')
var msg = (this.getAttribute($label, 'data-gdcc-msg')
?? this.getAttribute($input, 'data-gdcc-msg')
?? this.getAttribute(this.$gdcc, 'data-gdcc-msg'))
.replace('@cookie@', $label.html());
?? false;
if (msg) {
return msg.replace('@cookie@', $label.html());
} else {
return false;
}
}

@@ -275,7 +283,7 @@

}
if (this.getAttribute(this.$gdcc, 'data-gdcc-msg') === typeof undefined) {
this.error('GdCookieConsent Wrapper does not have attribute "data-gdcc-msg". This is used to i18n the hint to enable a certain cookie. Please add.');
this.error('Sample: <div id="gd-cookie-consent" data-gdcc-msg="You need to activate the cookie category @cookie@. Continue?">' + ' (@cookie@ will be replaced with the label of the cookie).');
this.error('Note: More specific messages can configured on the input / label itself with the same attribute');
return false;
if (!this.getAttribute(this.$gdcc, 'data-gdcc-msg')) {
this.warn('GdCookieConsent Wrapper does not have attribute "data-gdcc-msg". This is used to i18n the hint to enable a certain cookie.');
this.warn('Sample: <div id="gdcc-wrapper" data-gdcc-msg="You need to activate the cookie category @cookie@. Continue?">' + ' (@cookie@ will be replaced with the label of the cookie).');
this.warn('Note: More specific messages can configured on the input / label itself with the same attribute');
this.warn('If the attribute is neither available on the wrapper, nor on input / label, onclick enabling on optout elements is disabled.');
}

@@ -282,0 +290,0 @@

{
"name": "@getdesigned-vienna/cookie-consent",
"version": "1.1.2",
"version": "1.1.3",
"description": "Cookie Consent completely configured via HTML",

@@ -5,0 +5,0 @@ "main": "getdesigned-cookie-consent.js",

@@ -91,4 +91,5 @@ Getdesigned Cookie Consent (GDCC)

## Missing cookie permissions / i18n
* When the user clicks on an optout element (e.g. a note that YouTube is currently disabled), a confirmation appears asking the user, if she/he wants to proceed and enable the corresponding cookie category.
* The message shown is taken from an attribute data-gdcc-msg, which MUST be set on the GDCC wrapper:
* When the user clicks on an optout element (e.g. a note that YouTube is currently disabled), it is possible to ask the user, if she/he wants to proceed and enable the corresponding cookie category.
* In order for this to work, a message shown to the user needs to be configured (optional).
* The message shown is taken from an attribute data-gdcc-msg, which can be set on the GDCC wrapper or an input/label:

@@ -102,2 +103,3 @@ <div id="gdcc-wrapper" data-gdcc-msg='You must accept cookies in the category "@cookie@" to show this content. Proceed?'>

<label for="image" data-gdcc-msg='Enable cookie category "@cookie@"?'>Images</label>
* It is possible to set the message on the wrapper only, on an input/label only or both.

@@ -104,0 +106,0 @@ ## Keep your cookies clean

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