0.2.5 • Published 2 years ago

cookiebannerjs v0.2.5

Weekly downloads
-
License
AGPL-3.0
Repository
github
Last release
2 years ago

Cookiebannerjs

This is a pure javascript cookie banner opt-in plugin.

INSTALL

You can get Cookiebannerjs either by downloading or cloning this repository or trought NPM.

npm install cookiebannerjs

USAGE

Include the css into your page:

Include the script into your page:

Then initialize the plugin:

No parameter is mandatory.

OPTIONS

Available options:

PropertyDescriptionTypeDEFAULT
policyTextText to be shown as short policyString""
policyUrlAbsolute URL to the complete policyString""
policyUrlTextText of the link to the complete policyString""
popupTitleText to be shown as cookie’s preference popup titleString""
popupDescriptionText to be shown as cookie’s preference popup descriptionString""
allowTextText for the "allow all cookie" buttonString"Allow cookie"
customizeTextText for the "customize settings" buttonString"Customize settings"
denyTextText for the "deny cookie" buttonString"Deny cookie"
acceptSelectedText for the "accept selected only cookie" buttonString"Accept selected only cookie"
acceptAllText for the "accept all cookie" buttonString"Accept all cookie"
categoriesObject containing cookie categories to be shown in cookie’s preference popupObjectnecessary: {title : 'Technical cookie', description: 'These cookies are essential for the correct functioning of the website and to provide the service offered and requested by a user. User consent is not needed to use these type of cookies.', consent: true, blocked: true}
cookieNameName of the cookie where Cookiebannerjs will save the user conentString"cookie_allowed"
bannerClassCSS class for the banner containerString"intP_cookie-banner"
bannerHiddenClassCSS class for the banner container that is applied when user select an optionString"intP_cookie-banner__close"
policyTextClassCSS class for tag containing short policy textString"intP_cookie-banner_policy-text"
buttonsContainerClassCSS class for banner buttons containerString"intP_cookie-banner_buttons"
allowButtonClassCSS class for "allow cookie" buttonString"intP_cookie-banner_allow"
customizeButtonClassCSS class for "customize settings" buttonString"intP_cookie-banner_customize"
denyButtonClassCSS class for "deny cookie" buttonString"intP_cookie-banner_deny"
closingAnimationDurationTime in millisecond for the banner's closing animation duration. This value must be the same of transition .intP_cookie-banner__close property (or the relative custom class setted trought bannerHiddenClass option) in CSS fileInt500
popupClassCSS class for cookie’s preference popupString"intP_cookie-popup"
descriptionPopupClassCSS class for cookie’s preference popup descriptionString"intP_cookie-popup_description"
titleDescriptionPopupClassCSS class for cookie’s preference popup titleString"intP_cookie-popup_description_title"
cookieListPopupClassCSS class for cookie’s preference popup cookie categories list containerString"intP_cookie-popup_list"
cookieCatPopupClassCSS class for cookie’s preference popup cookie category containerString"intP_cookie-popup_list_coockie-cat"
cookieCatHeaderPopupClassCSS class for cookie’s preference popup cookie category headerString"intP_cookie-popup_list_coockie-cat_header"
cookieTitleCatHeaderPopupClassCSS class for cookie’s preference popup cookie category titleString"intP_cookie-popup_list_coockie-cat_header_title"
cookieDetailsCatHeaderPopupClassCSS class for cookie’s preference popup cookie category details buttonString"intP_cookie-popup_list_coockie-cat_header_details"
cookieConsentCatHeaderPopupClassCSS class for cookie’s preference popup cookie category consent buttonString"intP_cookie-popup_list_coockie-cat_header_consent"
cookieContentCatPopupClassCSS class for cookie’s preference popup cookie category description containerString"intP_cookie-popup_list_coockie-cat_content"
cookieButtonsPopupClassCSS class for cookie’s preference popup buttons containerString"intP_cookie-popup_buttons"
cookieAcceptSelectedButtonPopupClassCSS class for cookie’s preference popup "accept selected only cookie" buttonString"intP_cookie-popup_buttons_accept-selected"
cookieAcceptAllButtonPopupClassCSS class for cookie’s preference popup "accept all cookie" buttonString"intP_cookie-popup_buttons_accept-all"

EVENTS

Available events:

EventDescriptionParams
onInitializedCalled after Cookiebannerjs plugin has been initializednone
onStatusChangedCalled when user consent is changedconsents: user consent for each cookie category

API

BROWSER SUPPORT

Working on all modern browser.

AUTHORS

Interpromotion info@interpromotion.com | interpromotion.com

LICENSE

AGPL-3.0

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago