├── example ├── browserify │ ├── build.sh │ ├── index.js │ ├── index.html │ └── index.min.js └── basic.html ├── package.json ├── .gitignore ├── bower.json ├── README.md ├── LICENSE └── index.js /example/browserify/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | browserify index.js > index.min.js 3 | -------------------------------------------------------------------------------- /example/browserify/index.js: -------------------------------------------------------------------------------- 1 | var ec=require("../../index.js"); 2 | ec.euroCookie(); 3 | -------------------------------------------------------------------------------- /example/browserify/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/basic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eurocookie-js", 3 | "version": "2.2.0", 4 | "description": "eurocookie-js is a full, yet simple to use, library to request consent for cookies", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/AdrianArroyoCalle/eurocookie-js" 12 | }, 13 | "keywords": [ 14 | "cookies", 15 | "eu-law", 16 | "europe", 17 | "consent" 18 | ], 19 | "author": "Adrián Arroyo Calle", 20 | "license": "Apache-2", 21 | "bugs": { 22 | "url": "https://github.com/AdrianArroyoCalle/eurocookie-js/issues" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # Compiled binary addons (http://nodejs.org/api/addons.html) 20 | build/Release 21 | 22 | # Dependency directory 23 | # Commenting this out is preferred by some people, see 24 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 25 | node_modules 26 | 27 | # Users Environment Variables 28 | .lock-wscript 29 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eurocookie-js", 3 | "main": "index.js", 4 | "homepage": "https://github.com/AdrianArroyoCalle/eurocookie-js", 5 | "authors": [ 6 | {"name": "Adrián Arroyo Calle", "email": "adrian.arroyocalle@gmail.com", "homepage": "http://adrianarroyocalle.github.io"} 7 | ], 8 | "moduleType" : [ 9 | "node", 10 | "globals" 11 | ], 12 | "repository" : { 13 | "type": "git", 14 | "url": "git://github.com/AdrianArroyoCalle/eurocookie-js.git" 15 | }, 16 | "description": "eurocookie-js is a full, yet simple to use, library to request consent for cookies", 17 | "keywords": [ 18 | "europe", 19 | "cookie", 20 | "cookies", 21 | "consent", 22 | "law", 23 | "eu" 24 | ], 25 | "license": "Apache-2.0", 26 | "ignore": [ 27 | "**/.*", 28 | "node_modules", 29 | "bower_components", 30 | "test", 31 | "tests" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | eurocookie-js 2 | ============= 3 | 4 | [](https://gitter.im/AdrianArroyoCalle/eurocookie-js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 5 | 6 | eurocookie-js is a full, yet simple to use, library to request consent for cookies. It doesn't allow cookies until consent is granted. It also comes with the translated messages prepared to be shown to the users. 7 | 8 | # Features 9 | 10 | * Block cookies before consent accept 11 | * Multilanguage 12 | * No dependencies 13 | * Remembers consent 14 | 15 | # Using npm + browserify 16 | 17 | Install with _npm_ 18 | 19 | ``` 20 | npm install eurocookie-js --save 21 | ``` 22 | 23 | If you need to install the cookies import the module and call _euroCookie_ 24 | 25 | ```js 26 | var ec=require("eurocookie-js"); 27 | ec.euroCookie("http://link-to-privacy-policy.com"); 28 | ``` 29 | 30 | It will load all script tags with the class cookielike this 31 | ```html 32 | 36 | ``` 37 | 38 | Remember that you must set the script type to "text/plain" to prevent the execution 39 | 40 | 41 | # Using script tag 42 | 43 | __eurocookie-js__ can also be used with a simple script tag. Put it at the very end of the HTML file. 44 | 45 | ```html 46 | 49 | 50 | 53 |