PageSourceSearch

https://rotherhouse.org.uk/wp-content/themes/SurgeryWeb-NHS/js/cookies.js

js rotherhouse.org.uk collected 2026-09-25 08:39:14 UTC 1,165 bytes, 43 lines download raw bytes

1"use strict";
2
3const cookiesObject = document.cookie
4  .split(";")
5  .map((cookie) => cookie.split("="))
6  .reduce(
7    (accumulator, [key, value]) => ({
8      ...accumulator,
9      [key.trim()]: decodeURIComponent(value),
10    }),
11    {}
12  );
13
14
15function addCookie(name, value, days) {
16  const date = new Date();
17  date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
18  let expires = "expires=" + date.toUTCString();
19  document.cookie = `${name}=${value}; ${expires}; path=/;`;
20}
21
22if (cookiesObject.useCookies == "true") {
23  document.getElementById("cookieBanner").setAttribute("style", "display:none");
24} else if (cookiesObject.useCookies == "false") {
25  document.getElementById("cookieBanner").setAttribute("style", "display:none");
26}else{
27	  document.getElementById("cookieBanner").setAttribute("style", "display:block");
28
29}
30
31jQuery(document).ready(function ($) {
32
33  $("#acceptCookies").on("click", function () {
34    $("#cookieBanner").slideUp();
35    addCookie("useCookies", "true", 365);
36	  initGoogleAnalytics();
37  });
38
39  $("#declineCookies").on("click", function () {
40    $("#cookieBanner").slideUp();
41    addCookie("useCookies", "false", 30);
42  });
43});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.