PageSourceSearch

https://www.imcnet.org/cookiepopup.js

js imcnet.org collected 2026-10-02 16:42:17 UTC 4,027 bytes, 97 lines download raw bytes

1(function ( $ ) {
2    "use strict";
3
4    const cookiePopupHtml = '<div id="cookie-popup-container">' +
5        '<div class="cookie-popup" style="display: none;">' +
6            '<div class="cookie-popup-inner">' +
7                '<div class="cookie-popup-left">' +
8                    '<div class="cookie-popup-headline">This website uses cookies</div>' +
9                    '<div class="cookie-popup-sub-headline">By using this site, you agree to our use of cookies.</div>' +
10                '</div>' +
11
12                '<div class="cookie-popup-right">' +
13                    '<a href="#" class="cookie-popup-accept-cookies">Accept</a>' +
14                    '<a href="#" class="cookie-popup-learn-more">Learn More</a>' +
15                '</div>' +
16            '</div>' +
17            '<div class="cookie-popup-lower" style="display: none;">' +
18                'Cookies are small files stored on your computer, which websites use to improve your browsing experience. They may be used to save your progress or user preferences.' +
19            '</div>' +
20        '</div>' +
21    '</div>';
22
23    var onAccept;
24
25    $.extend({
26        acceptCookies : function(options) {
27            var cookiesAccepted = getCookie("cookiesAccepted");
28
29            if (!cookiesAccepted) {
30                var cookiePopup = $(cookiePopupHtml);
31                var position = "bottom";
32
33                if(options != undefined) {
34                    position = options.position != undefined ? options.position : "bottom";
35
36                    if(options.title != undefined)
37                        cookiePopup.find('.cookie-popup-headline').text(options.title);
38                    if(options.text != undefined)
39                        cookiePopup.find('.cookie-popup-sub-headline').text(options.text);
40                    if(options.acceptButtonText != undefined)
41                        cookiePopup.find(".cookie-popup-accept-cookies").text(options.acceptButtonText);
42                    if(options.learnMoreButtonText != undefined)
43                        cookiePopup.find(".cookie-popup-learn-more").text(options.learnMoreButtonText);
44                    if(options.learnMoreInfoText != undefined)
45                        cookiePopup.find(".cookie-popup-lower").text(options.learnMoreInfoText);
46                    if(options.theme != undefined)
47                        cookiePopup.addClass("theme-" + options.theme);
48                    if(options.onAccept != undefined)
49                        onAccept = options.onAccept;
50
51                    if(options.learnMore != undefined) {
52                        if(options.learnMore == false)
53                            cookiePopup.find(".cookie-popup-learn-more").remove();
54                    }
55
56                }
57                
58                cookiePopup.find('.cookie-popup').addClass("position-" + position);
59                $('body').append(cookiePopup);
60                $('.cookie-popup').slideToggle();
61            }    
62        }
63    });
64
65    $(document).on('click', '.cookie-popup-accept-cookies', function(e) {
66        e.preventDefault();
67        saveCookie();
68        $('.cookie-popup').slideToggle();        
69        if (typeof onAccept === "function")
70            onAccept();
71    }).on('click', '.cookie-popup-learn-more', function(e) {
72        e.preventDefault();
73        $('.cookie-popup-lower').slideToggle();
74    });
75
76    function getCookie(cname) {
77        var name = cname + "=";
78        var decodedCookie = decodeURIComponent(document.cookie);
79        var ca = decodedCookie.split(';');
80        for (var i = 0; i < ca.length; i++) {
81            var c = ca[i];
82            while (c.charAt(0) == ' ') {
83                c = c.substring(1);
84            }
85            if (c.indexOf(name) == 0) {
86                return c.substring(name.length, c.length);
87            }
88        }
89        return "";
90    }
91
92    function saveCookie() {        
93        var expires = "expires=01/01/2099"
94        document.cookie = "cookiesAccepted=true; " + expires + "; path=/";
95    }
96 
97}( jQuery ));

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.