PageSourceSearch

https://www.linktour-auto.com/frontend/js/cookies.js?v=3

js linktour-auto.com collected 2026-10-02 03:40:22 UTC 2,088 bytes, 60 lines download raw bytes

1// 页面加载后检查是否已有用户选择
2window.onload = function () {
3    if (!localStorage.getItem("cookieConsent")) {
4        document.getElementById("cookie-consent-banner").style.display = "block";
5    }
6};
7
8// 用户点击“接受所有”按钮
9function acceptAllCookies() {
10    console.log("用户接受所有 Cookies");
11    localStorage.setItem("cookieConsent", "all");
12    // document.cookie = "v=1; path=/; max-age=31536000";  // 示例分析类 cookie
13    // document.cookie = "ads=1; path=/; max-age=31536000";        // 示例广告 cookie
14    document.getElementById("cookie-consent-banner").style.display = "none";
15}
16
17// 用户点击“仅使用必要 Cookies”
18function rejectCookies() {
19    console.log("用户拒绝非必要 Cookies");
20    localStorage.setItem("cookieConsent", "necessary");
21    // 不设置额外 cookie,只保留必要的(如登录 session)
22    document.getElementById("cookie-consent-banner").style.display = "none";
23}
24
25
26
27// 20260421------
28// 处理关闭按钮点击
29document.addEventListener('click', function(event) {
30    if (event.target.classList.contains('close') || 
31        (event.target.closest && event.target.closest('.close'))) {
32        const fixedSetcookie = document.querySelector('.fixed-setcookie');
33        if (fixedSetcookie) {
34            fixedSetcookie.style.display = 'none';
35        }
36    }
37});
38
39// 处理show元素点击
40document.addEventListener('click', function(event) {
41    const showElement = event.target.closest('.fixed-setcookie .item .show');
42    
43    if (showElement && !event.target.classList.contains('icon')) {
44        const item = showElement.closest('.item');
45        const hideElement = item.querySelector('.hide');
46        
47        if (hideElement) {
48            item.classList.toggle('active');
49        }
50    }
51});
52
53// 处理check图标点击
54document.addEventListener('click', function(event) {
55    if (event.target.classList.contains('icon') && 
56        event.target.classList.contains('check')) {
57        event.stopPropagation();
58        event.target.classList.toggle('active');
59    }
60});

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.