Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to modify the secure attribute #15

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
556e5d6
[Add] Apply a paddingTop on body when cookie-notice hat 'top'-position
BernhardBehrendt Apr 24, 2018
84ab37c
[Add] Apply a paddingTop on body when cookie-notice hat 'top'-position
BernhardBehrendt Apr 24, 2018
44af58b
[Add] Screenshot of customized cookie-notifier
BernhardBehrendt Apr 24, 2018
1281303
Content changes
BernhardBehrendt Apr 24, 2018
6c1666b
Added test attributes data-test-(action|section) for QA purposes
BernhardBehrendt Apr 25, 2018
dad852b
Add test attribute for checking dismiss progress
BernhardBehrendt Apr 25, 2018
1646c73
Remove test cookie
BernhardBehrendt May 25, 2018
f887d65
Build dist version
BernhardBehrendt May 25, 2018
f69e20a
Add travis YAML configuration, to run the default grunt task
nfreear May 26, 2018
a1c8223
Update test dependecies ~ jQuery from 2.x → 3.x; QUnit from 1.x → 2.x;
nfreear May 28, 2018
f46e5a3
Fix the file-size badge in the README; other README edits [ci skip]
nfreear May 28, 2018
b352625
Merge branch 'master' into ndf/travis-ci
BernhardBehrendt May 29, 2018
ca5598e
Merge pull request #1 from nfreear/ndf/travis-ci
BernhardBehrendt May 29, 2018
fa4075b
travis-ci and auto npm publish
BernhardBehrendt May 29, 2018
181b95a
Follow-up to pull #1 - move jQuery to `devDependencies` for clarity
nfreear May 29, 2018
3bec4ea
Merge pull request #2 from nfreear/ndf/travis-2
BernhardBehrendt May 29, 2018
9c17763
travis-ci and auto npm publish
BernhardBehrendt May 29, 2018
9422b8a
Bug #4, add support for `data-cookie-notice` attribute
nfreear May 30, 2018
8fdb318
Bug #4, document the `data-cookie-notice` attribute in the README
nfreear May 30, 2018
723f28e
Merge pull request #5 from nfreear/ndf/data-attribute
BernhardBehrendt May 30, 2018
66968fe
Update to version 1.1.11 and contributor update
BernhardBehrendt May 30, 2018
bdfd8d8
Bug #4, Fix `browser` & `respository` fields in package JSON [ci skip]
nfreear Jun 2, 2018
4fb90c7
Bug #4, edit the language of the English translation [ci skip]
nfreear Jun 2, 2018
f02c0d2
Bug #4, add accessibility testing "grunt-rsids-pa11y" WCAG 2.0 AAA
nfreear Jun 3, 2018
59269f6
Bug #4, Accessibility fixes - colour contrast, button role
nfreear Jun 3, 2018
9979c4f
Bug #4, Accessibility fix - CSS font-size in 'rem', not 'px'
nfreear Jun 3, 2018
f473d70
Bug #4, Change accessibility `standard` from `WCAG2AAA` to WCAG2AA
nfreear Jun 3, 2018
85aa659
Add CHANGELOG; update README
nfreear Jun 3, 2018
6d002e9
Edits to CHANGELOG [ci skip]
nfreear Jun 4, 2018
c75f30f
Merge pull request #6 from nfreear/nfreear/accessibility-etc
BernhardBehrendt Jun 4, 2018
1109195
dependency upgrade, test fixures, release build
BernhardBehrendt Dec 6, 2018
bc781d9
Update cookie.notice.js
schroedermatthias Dec 4, 2018
718e476
dependency upgrade, test fixures, release build
BernhardBehrendt Dec 6, 2018
5feda16
Update initial font size
BernhardBehrendt Dec 12, 2018
b4faf53
README typo
BernhardBehrendt Dec 12, 2018
0013d15
Accessibility (a11y) improvements - fixed all WCAG2AA errors and warn…
BernhardBehrendt Dec 15, 2018
f528629
Font size improvements (absolute values rather than relatives)
BernhardBehrendt Jan 3, 2019
487c475
#11 Add Portuguese translations
Jan 2, 2020
1bdcaf1
#10 Custom font family support
Jan 2, 2020
5f13015
Fix package-lock.json (out of sync)
Jan 2, 2020
4aae92f
Apply positioning from config
Jan 3, 2020
8fb91e6
Remove logging message from production code
Jan 14, 2020
ec79cd4
Added fontSize customization
andreacomplus Jul 9, 2020
3f6ed45
Updated README with new fontSize configuration
vjandrea Jul 9, 2020
1a8a69a
create new npm version including "fontSize" Feature
BernhardBehrendt Jul 23, 2020
c2cfb6b
create new npm version including "fontSize" Feature
Jul 23, 2020
005902a
updated contributors list
Jul 23, 2020
db078a4
minor dependency upgrades
BernhardBehrendt Sep 11, 2020
b56ee0a
1.3.4 config update, new languages, changed demo page (#13), example …
BernhardBehrendt Nov 24, 2020
fa22732
1.3.4 changelog content update
BernhardBehrendt Nov 24, 2020
137c74e
1.3.5 build in travis on node 12
BernhardBehrendt Nov 24, 2020
c1d43a2
updated description
BernhardBehrendt Nov 24, 2020
3eddbf1
dep upgrades and more documentation
Nov 11, 2021
a44d5a4
readme, keywords, example page update
Dec 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# https://travis-ci.org/nfreear/cookie-notice
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs/

language: node_js

node_js: "12"

git:
depth: 8

cache:
directories:
- node_modules # NPM packages.

# install: npm install

script: npm test

after_script:
- ls -al dist/
- pgrep -lf '(live-server|phantom)'

deploy:
provider: npm
email: bernhard.bezdek@googlemail.com
api_key: $NPM_TOKEN
on:
branch: master

# End.
104 changes: 104 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@

# CookieNotice changelog

← [README][]

Version History

## Version 1.3.4
* _Date: 24 November 2020_
* Changed default font size handling
* New demo page
* new languages (pl, es, nl)
* configuration examples (images)


## Version 1.1.19
* _Date: 09 July 2020_
* Added fontSize customization, with fallback to 12px if unset

## Version 1.1.18
* _Date: 01 January 2019_;
* Step back to px based font sizes due to negative side effects

## Version 1.1.17
* _Date: 15 December 2018_;
* Accessibility (a11y) improvements - fixed all WCAG2AA errors and warnings

## Version 1.1.16
* _Date: 12 December 2018_;
* Initial font size too small

## Version 1.1.14/15
* _Date: 6 December 2018_;
* Typo in German translation -> contrib. by @chroedermatthias (Matthias Schröder)
* Dependency upgrade
* Fixed unit tests

## Version 1.1.12

* _Date: approx. 4-6 June 2018_;
* Add accessibility testing via [grunt-rsids-pa11y][] and [pa11y][], WCAG 2.0 AA, pull #6;
* Accessibility fixes — colour contrast, button role, link target, link underline;
* Accessibility fixes — express CSS font-size in `em` or `rem`, not `px`;
* Add configuration option — `linkTarget` (default: '');
* Edit the language used in the English translation;
* Fix `browser` and `repository` fields in `package.json`;
* Add `files` and `bugs` fields to `package.json`;
* Add `engines` and `contributors` fields to `package.json`;
* Add `live-server` to `peerDependencies` in `package.json`;
* Remove Nick's email address from `README` & `bower.json` (!)

## Version 1.1.11

* _Date: 30 May 2018_;
* Add support for `data-cookie-notice` attribute on `<script>`, pull #5, issue [#4][];
* Document `data-` attribute in README;
* Document _unpkg_ CDN in README;

## Version 1.1.10

* _Date: 29 May 2018_;
* Move jQuery to `devDependencies` for clarity, pull #2;
* Point `tests/index.html` to local copies of jQuery and QUnit (was CDN);

## Version 1.1.9

* _Date: 25 May 2018_;
* Add Travis-CI testing to the project, pull #1;
* Update test dependencies —
jQuery from 2.x → 3.x; QUnit from 1.x → 2.x;
* Add SVG badges for Travis-CI, NPMJS.com, etc. to `README.md`;

## Version 1.1.8

* _Date: 25 May 2018_;

## Version 1.1.7

* _Date: 25 April 2018_;

...

## Version 1.1.0

* _Date: 24 April 2018_;
* First release on [npm][];

## Version 1.0.0

* _Date: 20 May 2015_;
* Release by: [@micc83][];
* (Not on [npm][])

---

← [README][]

[readme]: https://github.com/AOEpeople/cookie-notice#readme
[npm]: https://www.npmjs.com/package/cookie-notice
[@micc83]: https://github.com/micc83/cookie-notice-js "Alessandro Benoit"
[#4]: https://github.com/AOEpeople/cookie-notice/issues/4
[a11y-fail]: https://travis-ci.org/nfreear/cookie-notice/jobs/387344672#L1217-L1235
[grunt-rsids-pa11y]: https://www.npmjs.com/package/grunt-rsids-pa11y
[pa11y]: http://pa11y.org/
239 changes: 186 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,207 @@
# CookieNoticeJS
[![Build status — Travis-CI][travis-icon]][travis]
[![cookie-notice on Npmjs][npm-icon]][npm]
[![License][license-icon]][mit]
[![Total downloads ~ Npmjs][downl-icon]][npm]
[![Size of Javascript][size-icon]][build]

**CookieNoticeJS** is a very simple and small *(→ 2 kB gzip)* vanilla JS script that provides an easy way to show that damn cookie notice on your website.
Simply add the following tag to your website footer:
# CookieNotice

**CookieNoticeJS** is a very simple, extendable and small *(→ 2 kB gzip)* vanilla JS script with multi language support
for [GDPR][]/[DSGVO][]‎ transparency and notification purposes that provides an easy way to show a cookie notice on your
website.

**Cookie notice at the bottom of the page**
<img src="https://i.imgur.com/xodbOdi.png" alt="cookie notice working example" align="center"/>

**Cookie notice at the top of the page**
<img src="https://i.imgur.com/XOfijh6.png" alt="cookie notice working example" align="center"/>

**Available via [npm][]**

```shell
npm install cookie-notice
npm test
```

**To use in your project There are plenty ways for integration:**

**When installed via npm, include in any project by using path below:**

```html
<script src="js/cookie.notice.min.js"></script>

<script src="node-modules/cookie-notice/dist/cookie.notice.min.js"></script>
```

**For usage with Angular2+ add line below in "scripts" section in angular-cli.json:**

```json
{
"scripts": [
"../node_modules/cookie-notice/dist/cookie.notice.js",
"../optional/path/to/custom/cookie-notice-config.js"
]
}
```

**When cloned directly from gitHub use path below:**

```html

<script src="cookie-notice/dist/cookie.notice.min.js"></script>
```

And you will get a dismissable banner on the bottom of your pages showing a default cookie audit like the following:
## Behavior

You will get a dismissable banner on the bottom of your pages showing a default cookie audit like the following:

> We use cookies to make sure you can have the best experience on our website. If you continue to use this site we assume that you will be happy with it.

Check my website for a [DEMO](http://codeb.it/). Depending on the visitor browser language one of the preloaded translation will be shown. At the moment **CookieNoticeJS** supports *EN, IT, DE and FR*. If you want to contribute with an extra language do not hesitate to open an issue or a PR.

**CookieNoticeJS** has been succesfully tested on IE9+, Chrome, Firefox and Safari.
You can check out an example integration
at [Deutsche Telekom](https://breitband.telekom-dienste.de/kundencenter-breitband).

Depending on the visitor browser language one of the preloaded translations will be shown. At the moment **
CookieNoticeJS** supports following languages out of the box:

- IT (Italiano)
- EN (English) `default`
- FR (Français)
- PT (Português)
- ES (Español)
- NL (Nederlands)
- DE (Deutsch)
- PL (Polski)

> You can also add any other language code

If you want to contribute with an extra language or find translation issues do not hesitate to open an issue or a PR.

**CookieNoticeJS** has been successfully tested on IE9+, Chrome, Firefox and Safari.

## Customize CookieNoticeJS

For the most of you including the script should be enough but **CookieNoticeJS** comes with many customization options. Let's see an example:
For the most of you including the script should be enough but **CookieNoticeJS** comes with many customization options.
Let's see an example:

```html

<script src="js/cookie.notice.min.js"></script>
<script>
new cookieNoticeJS({

// Localizations of the notice message
'messageLocales': {
'it': 'Custom localized message'
},

// Localizations of the dismiss button text
'buttonLocales': {
'it': 'Chiudi'
},

// Position for the cookie-notifier (default=bottom)
'cookieNoticePosition':'top'

// Shows the "learn more button (default=false)
'learnMoreLinkEnabled':false

// The href of the learn more link must be applied if (learnMoreLinkEnabled=true)
'learnMoreLinkHref':'/learn/more/index.html'

// Text for optional learn more button
'learnMoreLinkText':{
'en':'learn more'
},

// The message will be shown again in X days
'expiresIn': 30,

// Dismiss button background color
'buttonBgColor': '#d35400',

// Dismiss button text color
'buttonTextColor': '#fff',

// Notice background color
'noticeBgColor': '#000',

// Notice text color
'noticeTextColor': '#fff'

// the lernMoreLink color (default='#009fdd')
'linkColor':'#f00'


// Localizations of the notice message
'messageLocales': {
'it': 'Custom localized message'
},

// Localizations of the dismiss button text
'buttonLocales': {
'it': 'Chiudi'
},

// Position for the cookie-notifier (default=bottom)
'cookieNoticePosition': 'top',

// Shows the "learn more button (default=false)
'learnMoreLinkEnabled': false,

// The href of the learn more link must be applied if (learnMoreLinkEnabled=true)
'learnMoreLinkHref': '/learn/more/index.html',

// Text for optional learn more button
'learnMoreLinkText': {
'en': 'learn more'
},

// The message will be shown again in X days
'expiresIn': 30,

// Specify a custom font family and size in pixels
'fontFamily': 'inherit',
'fontSize': '12px',

// Dismiss button background color
'buttonBgColor': '#d35400',

// Dismiss button text color
'buttonTextColor': '#fff',

// Notice background color
'noticeBgColor': '#000',

// Notice text color
'noticeTextColor': '#fff',

// the learnMoreLink color (default='#009fdd')
'linkColor': '#f00',

// The target of the learn more link (default='', or '_blank')
'linkTarget': '',

// Print debug output to the console (default=false)
'debug': false
});
</script>
```

## Configuration via `data-` attribute

Configuration options can be put in a `data-cookie-notice` HTML attribute in JSON format. Note, you can include the
Javascript from the [unpkg][] CDN ([browse][]). For example:

```html

<script
data-cookie-notice='{ "learnMoreLinkEnabled": true, "learnMoreLinkHref": "/privacy.html" }'
src="https://unpkg.com/cookie-notice@^1/dist/cookie.notice.min.js"
></script>
```

#### Author

Alessandro Benoit

#### Contributors
[Bernhard Behrendt](mailto:bernhard.behrendt@aoe.com) [@AOEpeople](https://github.com/AOEpeople)

- [Bernhard Behrendt](mailto:bernhard.behrendt@aoe.com) [@AOEpeople](https://github.com/AOEpeople),
- [Nick Freear](https://github.com/nfreear) [IET at the OU](https://github.com/IET-OU)
- [Matthias Schröder](https://github.com/schroedermatthias)
- [Andrea Bergamasco](https://github.com/vjandrea)

### License

License: [MIT][]


[MIT]: https://github.com/micc83/cookie-notice-js/blob/master/LICENSE
"License: MIT | Copyright © 2018 Alessandro Benoit (micc83)."

[MIT-0]: https://mit-license.org/#2018

[travis-icon]: https://travis-ci.org/AOEpeople/cookie-notice.svg?branch=master

[travis]: https://travis-ci.org/AOEpeople/cookie-notice "Build status – Travis-CI"

[npm]: https://npmjs.com/package/cookie-notice "CookieNotice – on NPM"

[npm-icon]: https://badge.fury.io/js/cookie-notice.svg

[npm-i0]: https://img.shields.io/npm/v/cookie-notice.svg "(Timeout errors)"

[license-icon]: https://img.shields.io/npm/l/cookie-notice.svg

[downl-icon]: https://img.shields.io/npm/dt/cookie-notice.svg "Count of total downloads – NPM"

[build]: https://github.com/AOEpeople/cookie-notice/tree/master/dist

[size-icon]: https://img.shields.io/github/size/AOEpeople/cookie-notice/dist/cookie.notice.min.js.svg
"Size of built Javascript, kilo-bytes (kB) – on GitHub"

[unpkg]: https://unpkg.com/ "unpkg is a fast, global content delivery network (CDN) for everything on npm."

[browse]: https://unpkg.com/cookie-notice@^1/ "Browse cookie-notice on unpkg"

[DSGVO]: https://de.wikipedia.org/wiki/Datenschutz-Grundverordnung "Datenschutz-Grundverordnung (DSGVO)"

[GDPR]: https://en.wikipedia.org/wiki/General_Data_Protection_Regulation "General Data Protection Regulation (GDPR)"

[End]: //.
Loading