PageSourceSearch

https://www.ducsdegascogne.com/modules/lgcookieslaw/views/js/front.js

js ducsdegascogne.com collected 2026-09-24 23:46:04 UTC 4,317 bytes, 156 lines download raw bytes

1/**
2 *  Please read the terms of the CLUF license attached to this module(cf "licences" folder)
3 *
4 * @author    Línea Gráfica E.C.E. S.L.
5 * @copyright Lineagrafica.es - Línea Gráfica E.C.E. S.L. all rights reserved.
6 * @license   https://www.lineagrafica.es/licenses/license_en.pdf
7 *            https://www.lineagrafica.es/licenses/license_es.pdf
8 *            https://www.lineagrafica.es/licenses/license_fr.pdf
9 */
10
11function closeWhenRefuse(){
12    closeBanners();
13
14    setCookie("lgcookieslaw_refuse", 1, lgcookieslaw_session_time);
15
16    if (typeof $.fancybox.open !== 'function') {
17        $('#lgcookieslaw-modal').hide();
18    }
19
20    window.location.href = window.location.href;
21}
22
23function closeinfo(accept, all)
24{
25    closeBanners();
26    if (typeof accept != 'undefined' && accept == true) {
27        if (typeof all != 'undefined' && all == true) {
28            var level = 1;
29        } else {
30            var level = document.getElementById("lgcookieslaw-cutomization-enabled").checked == true ? 1 : 2;
31        }        
32        setCookie(lgcookieslaw_cookie_name, level, lgcookieslaw_session_time);
33    }
34
35    if (typeof $.fancybox.open !== 'function') {
36        $('#lgcookieslaw-modal').hide();
37    }
38
39    $.fancybox.close();
40    if (lgcookieslaw_reload == true) {
41        window.location.href = window.location.href;
42    }
43}
44
45function showBanner()
46{
47    var banners = document.getElementsByClassName("lgcookieslaw_banner");
48    if (banners) {
49        for (var i = 0; i < banners.length; i++) {
50            banners[i].style.display = 'table';
51        }
52    }
53    if (lgcookieslaw_block) {
54        $(".lgcookieslaw_overlay").css("display", "block");
55    }
56}
57
58function closeBanners() {
59    var banners = document.getElementsByClassName("lgcookieslaw_banner");
60    if (banners) {
61        for (var i = 0; i < banners.length; i++) {
62            banners[i].style.display = 'none';
63        }
64    }
65    if (lgcookieslaw_block) {
66        $(".lgcookieslaw_overlay").css("display", "none");
67    }
68}
69
70function checkLgCookie()
71{
72    var regex = new RegExp("^(.*;)?\\s*"+lgcookieslaw_cookie_name+"\\s*=\\s*[^;]+(.*)?$");
73    return document.cookie.match(regex);
74}
75
76function setCookie(cname, cvalue, exdays) {
77    var d = new Date();
78    d.setTime(d.getTime() + (exdays * 1000));
79    var expires = "expires=" + d.toUTCString();
80    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
81}
82
83/*
84var lgbtnclick = function(){
85    var buttons = document.getElementsByClassName("lgcookieslaw_btn_accept");
86    if (buttons != null) {
87        for (var i = 0; i < buttons.length; i++) {
88            buttons[i].addEventListener("click", function () {
89                closeinfo(true);
90                location.reload(true);
91            });
92        }
93    }
94};
95*/
96
97function customizeCookies() {
98    closeBanners();
99    $(".lgcookieslaw_overlay").css("display", "none");
100
101    if (typeof $.fancybox.open === 'function') { 
102        $.fancybox.open($("#lgcookieslaw-modal"), {
103            autoSize : false,
104            width:700,
105            height:'auto',
106            padding: 0,
107            modal: true,
108        });
109    } else {
110        $('#lgcookieslaw-modal').show();
111
112        $('<a href="#lgcookieslaw-modal" />').fancybox({
113            autoSize : false,
114            width:700,
115            height:'auto',
116            padding: 0,
117            modal: true,
118        }).click();
119    }
120}
121
122function checkRefuse(){
123    var regex = new RegExp("^(.*;)?\\s*lgcookieslaw_refuse\\s*=\\s*[^;]+(.*)?$");
124    return document.cookie.match(regex);
125}
126
127window.addEventListener('load',function() {
128
129    if( checkLgCookie() || checkRefuse() ) {
130        closeBanners();
131    } else {
132        showBanner();
133        //lgbtnclick();
134    }
135
136    $('#lgcookieslaw-close').click(function() {
137        if (typeof $.fancybox.open !== 'function') {
138            $('#lgcookieslaw-modal').hide();
139        }
140
141        $.fancybox.close();
142        showBanner();
143    });
144
145    $('.lgcookieslaw_slider').click(function(){
146        if ($(this).parent().find('input[type=checkbox]').is(':disabled')) {
147            return false;
148        }
149
150        if ($(this).hasClass('lgcookieslaw_slider_checked')) {
151            $(this).removeClass('lgcookieslaw_slider_checked');
152        } else {
153            $(this).addClass('lgcookieslaw_slider_checked');
154        }
155    });
156});

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.