@onsvisual/svelte-components 0.1.102 → 0.1.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,7 +49,7 @@
49
49
  let baseurl = "//www.ons.gov.uk";
50
50
 
51
51
  function hasCookiesPreferencesSet() {
52
- return -1 < document.cookie.indexOf("cookies_preferences_set=true");
52
+ return -1 < document.cookie.indexOf("ons_cookie_preferences_set=true");
53
53
  }
54
54
 
55
55
  // extractValue extracts the value from a undecodeable json cookie string
@@ -100,13 +100,13 @@
100
100
  let oneYearInSeconds = 60 * 60 * 24 * 365;
101
101
  let cookiesDomain = window.location.hostname;
102
102
  let cookiesPreference = !0;
103
- let encodedCookiesPolicy = `%7B%22essential%22%3Atrue%2C%22usage%22%3A${
104
- option == "all" ? "true" : "false"
105
- }%7D`;
103
+ let acceptAllCookiesPolicy = `{'essential':true,'settings':true,'usage':true,'campaigns':true}`;
104
+ let rejectAllCookiesPolicy = `{'essential':true,'settings':false,'usage':false,'campaigns':false}`;
105
+ let cookiesPolicy = option == "all" ? acceptAllCookiesPolicy : rejectAllCookiesPolicy;
106
106
  let cookiesPath = "/";
107
107
 
108
- document.cookie = `cookies_preferences_set=${cookiesPreference};max-age=${oneYearInSeconds};domain=${cookiesDomain};path=${cookiesPath};`;
109
- document.cookie = `cookies_policy=${encodedCookiesPolicy};max-age=${oneYearInSeconds};domain=${cookiesDomain};path=${cookiesPath};`;
108
+ document.cookie = `ons_cookie_message_displayed=${cookiesPreference};max-age=${oneYearInSeconds};domain=${cookiesDomain};path=${cookiesPath};`;
109
+ document.cookie = `ons_cookies_policy=${cookiesPolicy};max-age=${oneYearInSeconds};domain=${cookiesDomain};path=${cookiesPath};`;
110
110
 
111
111
  message = `You have ${option == "all" ? "accepted" : "rejected"} all additional cookies.`;
112
112
  if (option == "all") usageCookies = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onsvisual/svelte-components",
3
- "version": "0.1.102",
3
+ "version": "0.1.103",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://onsvisual.github.io/svelte-components",