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 Travis-CI automated tests #1

Merged
merged 4 commits into from
May 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# https://travis-ci.org/nfreear/cookie-notice
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs/

language: node_js

node_js: 8

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)'

# End.
75 changes: 50 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# CookieNotice

**CookieNoticeJS** is a very simple and small *(→ 2 kB gzip)* vanilla JS script with multi language support for GDPR/DSGVO‎ transparency and
[![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]

# CookieNotice

**CookieNoticeJS** is a very simple 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.

<img src="https://i.imgur.com/koDf1h0.png" alt="FetchBot" align="center"/>
Expand Down Expand Up @@ -38,10 +45,10 @@ npm install cookie-notice
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.
Check my website for a [DEMO](http://codeb.it/). Depending on the visitor browser language one of the preloaded translations 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 successfully tested on IE9+, Chrome, Firefox and Safari.

## Customize CookieNoticeJS

Expand All @@ -51,49 +58,49 @@ For the most of you including the script should be enough but **CookieNoticeJS**
<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)

// 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,
'expiresIn': 30,

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

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

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

// Notice text color
'noticeTextColor': '#fff'
// the lernMoreLink color (default='#009fdd')
'noticeTextColor': '#fff'

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

});
</script>
```
Expand All @@ -102,4 +109,22 @@ For the most of you including the script should be enough but **CookieNoticeJS**
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)

### 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/nfreear/cookie-notice.svg?branch=ndf/travis-ci
[travis]: https://travis-ci.org/nfreear/cookie-notice "Build status – Travis-CI"
[npm]: https://npmjs.com/package/cookie-notice "CookieNotice – on NPM"
[npm-icon]: https://img.shields.io/npm/v/cookie-notice.svg
[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"
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "cookie-notice",
"version": "1.1.9",
"description": "Show a widely configurable notice for European cookie law",
"main": "index.js",
"main": "gruntfile.js",
"browser": "dist/cookie-notice.js",
"scripts": {
"test": "./node_modules/.bin/grunt test"
},
Expand All @@ -17,12 +18,17 @@
"license": "MIT",
"devDependencies": {
"grunt": "^1.0.2",
"grunt-cli": "^1.2.0",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-qunit": "^2.0.0",
"grunt-contrib-uglify": "^3.3.0",
"grunt-strip-code": "^1.0.6",
"phantomjs-prebuilt": "^2.1.16"
},
"peerDependencies": {
"jquery": "^3.3.1",
"qunit": "^2.6.1"
},
"repository": {
"type": "git",
"url": "https://github.com/AOEpeople/cookie-notice-js"
Expand Down
8 changes: 4 additions & 4 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
<meta charset="utf-8">
<title>QUnit Example</title>

<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.18.0.css">
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.6.1.css">

</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="http://code.jquery.com/qunit/qunit-1.18.0.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://code.jquery.com/qunit/qunit-2.6.1.js"></script>
<script src="tests.js"></script>

<script src="../src/cookie.notice.js"></script>

</body>
</html>
</html>