PageSourceSearch

https://www.squashql.io/assets/js/cookie.js

js squashql.io collected 2026-09-25 22:45:41 UTC 2,169 bytes, 64 lines download raw bytes

1// let accept = document.querySelector('#accept');
2// let reject = document.querySelector('#reject');
3// let container = document.querySelector('#cookie-container');
4
5// // Check if user has given consent before.
6// if (getCookie('cookie-consent') === null) {
7//   // Display the cookie banner.
8//   container.style.display = "flex";
9// } else if (getCookie('cookie-consent') === "accepted") {
10//   // The user already agreed to cookies.
11//   initAnalytics();
12// } else {
13//   // The user already rejected cookies.
14// }
15
16// accept.addEventListener('click', function() {
17//   setCookie('cookie-consent', 'accepted', 365);   // Add cookie as accepted.
18//   initAnalytics();                                // Start using your analytics.
19//   container.style.display = "none";               // Close the banner.
20// });
21// reject.addEventListener('click', function() {
22//   deleteAllCookie();                              // Delete all cookies.
23//   setCookie('cookie-consent', 'rejected', 365);   // Add cookie as rejected.
24//   container.style.display = "none";               // Close the banner.
25// });
26
27// /**
28//  * 
29//  * @param {string} name 
30//  * @returns {string|null} 
31//  */
32// function getCookie(name) {
33//   const cookies = document.cookie.split('; ');
34//   const value = cookies
35//     .find(c => c.startsWith(name))
36//     ?.split('=')[1]
37//   if (value === undefined) {
38//     return null
39//   }
40//   return decodeURIComponent(value);
41// }
42
43// /**
44//  * 
45//  * @param {string} name 
46//  * @param {string} value 
47//  * @param {number} days 
48//  */
49// function setCookie(name, value, days) {
50//   const date = new Date();
51//   date.setDate(date.getDate() + days);
52//   document.cookie = `${name}=${encodeURIComponent(value)}; expires=${date.toUTCString()};`;
53// }
54
55// function deleteAllCookie() {
56//   document.cookie.split(";").forEach(function(c) { document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); });
57// }
58
59// function initAnalytics() {
60//   // TODO: setup your own analytics.
61//   // EXAMPLE:
62//   // gtag('js', new Date());
63//   // gtag('config', 'G-XXXXXXXX', { 'send_page_view': false });
64// }

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.