{"id":18720447,"url":"https://github.com/dennisinteractive/implied-consent","last_synced_at":"2025-04-10T04:51:01.980Z","repository":{"id":57272958,"uuid":"8796975","full_name":"dennisinteractive/implied-consent","owner":"dennisinteractive","description":"An implied consent notice to comply with the UK's implementation of the EU cookie laws (Note: this is not guaranteed to protect you!)","archived":false,"fork":false,"pushed_at":"2017-04-12T11:22:58.000Z","size":110,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":56,"default_branch":"master","last_synced_at":"2025-03-21T00:37:22.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dennisinteractive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-15T10:41:10.000Z","updated_at":"2021-11-05T15:41:37.000Z","dependencies_parsed_at":"2022-09-15T10:53:06.898Z","dependency_job_id":null,"html_url":"https://github.com/dennisinteractive/implied-consent","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennisinteractive%2Fimplied-consent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennisinteractive%2Fimplied-consent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennisinteractive%2Fimplied-consent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennisinteractive%2Fimplied-consent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dennisinteractive","download_url":"https://codeload.github.com/dennisinteractive/implied-consent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161259,"owners_count":21057552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T13:31:07.249Z","updated_at":"2025-04-10T04:51:01.947Z","avatar_url":"https://github.com/dennisinteractive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# implied-consent.js\n\nAn implied consent notice to comply with the UK's implementation of the EU\ncookie laws (Note: this is not guaranteed to protect you!)\n\n## Features\n\n* __Responsive__: it should work with a responsively designed site to adapt to mobile devices, or\non a fixed-width site it'll stay fixed width\n* __Asynchronous__: from version 1.0.0 onwards the loading and execution of the script is not blocking\nas it is loaded and initialised in an asynchronous fashion.\n* __Lightweight__: The script is self-contained and has no external\ndependencies. It weighs only 5.38 kB when minified and gzipped.\n* __Browser support__: This has been tested on IE9+ and all recent modern browsers.\n\n## v1.2.0 Changes\nIn this version, functionality has been added that removes the cookie notice once the viewer has navigated to a different page.\n\n## Installation / Usage\n\nUpload the minified JS file from the `dist/` folder to your CDN or web host of\nchoice, then add the following to the head section of your site.\n\nDo not include the script directly from GitHub (http://raw.github.com/...). The\nfile is being served as text/plain and as such being blocked in Internet\nExplorer on Windows 7 for instance (because of the wrong MIME type). Bottom\nline: GitHub is not a CDN.\n\nAdd the following code to the head of your page:\n\n```js\n\u003cscript\u003e\n  var impliedConsent = impliedConsent || {}; impliedConsent.q = impliedConsent.q || [];\n  impliedConsent.q.push(['init']);\n\n  (function(w, d) {\n    var s = d.createElement('script'), el = d.getElementsByTagName('script')[0]; s.async = true;\n    s.src = '//example.com/implied-consent.min.js'; el.parentNode.insertBefore(s, el);\n  })(this, this.document);\n\u003c/script\u003e\n```\n\nIf only modern browsers are planned to be supported, load it via an asynchronous script tag:\n\n```js\n\u003cscript\u003e\n  var impliedConsent = impliedConsent || {}; impliedConsent.q = impliedConsent.q || [];\n  impliedConsent.q.push(['init']);\n\u003c/script\u003e\n\n\u003cscript async src=\"//example.com/implied-consent.min.js\"\u003e\u003c/script\u003e\n```\n\nIt is possible to define custom configuration options in the `impliedConsent.q.push()` call:\n\n```js\nimpliedConsent.q.push([\"init\", {\n  noticeText: 'We use cookies as set out in our \u003ca href=\"http://www.example.com/cookie-policy\"\u003ecookie policy\u003c/a\u003e. By using this website, you agree we may place these cookies on your device.',\n  confirmText: \"Close\",\n  cookieExpiresIn: 3650\n}]);\n```\n\nSee configuration options below.\n\n## Configuration options\n\n### options\n\nType: `Object`\n\nAn object of options can be passed as a second argument. The default values are\nas follows.\n\n### options.noticeText\n\nType: `String` Default value: `We use cookies as set out in our privacy policy. By using this website, you agree we may place these cookies on your device.`\n\nText content to display as the notice. Please note that the string defined here will be inserted using `Element.innerHTML()` so it may contain HTML tags.\n\n### options.confirmText\n\nType: `String` Default value: `Close`\n\nText value of the close button.\n\n### options.validateByClick\n\nType: `Boolean` Default value: `true`\n\nIf set to `true` extra event listeners are launched on `a`, `button` and\n`input[type=\"submit\"]` tags. The callback for these listeners sets the cookie as\nif the Close button was clicked. `a` tags only trigger this if their href\nattributes start with `#`, `/` or the current host name of the site.\n\n### options.cookieExpiresIn\n\nType: `Integer` Default value: `365`\n\nCookie expiry value in days.\n\n### options.backgroundColor\n\nType: `String` Default value: `#222`\n\nCSS background-color value of the notice container element.\n\n### options.textColor\n\nType: `String` Default value: `#eee`\n\nCSS color value for any container text.\n\n### options.textColor\n\nType: `String` Default value: `#eee`\n\nCSS color value for any container text.\n\n### options.linkColor\n\nType: `String` Default value: `#acf`\n\nCSS color value for link text in container.\n\n### options.buttonBackgroundColor\n\nType: `String` Default value: `#222`\n\nCSS background-color value of the notice button.\n\n### options.buttonColor\n\nType: `String` Default value: `#fff`\n\nCSS color value of the button.\n\n### options.fontSize\n\nType: `String` Default value: `12px`\n\nCSS font-size value for text in the container.\n\n### options.fontFamily\n\nType: `String` Default value: `sans-serif`\n\nCSS font-family value for text in the container.\n\n## Building from source\n\nDevelopment is based on `npm` and `grunt` so make sure you have these\ninstalled globally. Then install project dependencies:\n\n`npm install`\n\nThen run the build via\n\n`grunt`\n\nThe build output files are located in the `dist/` folder.\n\n## Authors\n\n* Attila Beregszaszi\n* Will Howlett\n* Paul Lomax\n\n## License\n\n### Copyright 2015 Dennis Publishing\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdennisinteractive%2Fimplied-consent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdennisinteractive%2Fimplied-consent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdennisinteractive%2Fimplied-consent/lists"}