PageSourceSearch

https://www.khetanes.si/scripts/cookie.law.js

js khetanes.si collected 2026-10-06 15:22:56 UTC 6,126 bytes, 117 lines download raw bytes

1//Na strani se mora nahajati link z ID-jem oblike 'cookielaw-TEXT', kjer je TEXT dogovorjen s programerjem, ker potem mora programer na strani sprogramirat:
2//if (Request.Cookies["cookielaw"] == null || Request.Cookies["cookielaw"]["ga"] != "0") //pokaze Google Analytics, drugace ne...
3//<a href="javascript:void(0);" id="cookielaw-ga">Izklopi</a>
4
5
6jQuery.extend({
7	CookieLaw: function(lang, infoUrl) {
8        cookie = function(name, value, options) {
9            if (typeof value != 'undefined') { // name and value given, set cookie
10                options = options || {};
11                if (value === null) {
12                    value = '';
13                    options.expires = -1;
14                }
15                var expires = '';
16                if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
17                    var date;
18                    if (typeof options.expires == 'number') {
19                        date = new Date();
20                        date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
21                    } else {
22                        date = options.expires;
23                    }
24                    expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
25                }
26                // CAUTION: Needed to parenthesize options.path and options.domain
27                // in the following expressions, otherwise they evaluate to undefined
28                // in the packed version for some reason...
29                var path = options.path ? '; path=' + (options.path) : '';
30                var domain = options.domain ? '; domain=' + (options.domain) : '';
31                var secure = options.secure ? '; secure' : '';
32                document.cookie = [name, '=', value, expires, path, domain, secure].join('');
33            } else { // only name given, get cookie
34                var cookieValue = null;
35                if (document.cookie && document.cookie != '') {
36                    var cookies = document.cookie.split(';');
37                    for (var i = 0; i < cookies.length; i++) {
38                        var cookie = jQuery.trim(cookies[i]);
39                        // Does this cookie string begin with the name we want?
40                        if (cookie.substring(0, name.length + 1) == (name + '=')) {
41                            cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
42                            break;
43                        }
44                    }
45                }
46                return cookieValue;
47            }
48        };
49
50        var msg = '<div id="cookie-law-wrapper" style="display:none;"><div id="cookie-law-width">';            
51        var linkText1 = "Enable";
52        var linkText0 = "Disable";
53
54        switch(lang.toLowerCase())
55        {
56            case 'sl-si':
57                msg += '<div id="cookie-law-message">Spletna stran uporablja piškotke za izboljšanje uporabniške izkušnje. Z nadaljevanjem obiska na spletni strani ali klikom na \"ZAPRI OBVESTILO\" se strinjate z uporabo piškotkov. V primeru nestrinjanja kliknite na povezavo "<a href="' + infoUrl + '">Politika piškotkov</a>
57"in izberite povezavo "Izklopi".</div>';
58                msg += '<div id="cookie-law-button"><button id="cookie-law-accept">ZAPRI OBVESTILO</button></div>';
59                linkText1 = "Vklopi";
60                linkText0 = "Izklopi";
61            break;
62            case 'en-us':
63                msg += '<div id="cookie-law-message">This website uses cookies to improve the user experience. By continuing to use this site or clicking on the “Close” button, you agree to our cookie use. If you do not agree with cookie tracking please select the "<a href="' + infoUrl + '">Cookie policy</a>" link and then select the “Disable” link.</div>';
64                msg += '<div id="cookie-law-button"><button id="cookie-law-accept">CLOSE</button></div>';
65                linkText1 = "On";
66                linkText0 = "Off";
67            break;
68            default:
69                msg += '<div id="cookie-law-message">Spletna stan za namen izboljšave delovanja uporablja piškotke. Z uporabo strani soglašate z uporabo piškotkov. Več o <a href="' + infoUrl + '">politiki piškotkov</a></div>';
70                msg += '<div id="cookie-law-button"><button id="cookie-law-accept">ZAPRI OBVESTILO</button></div>';
71            break;
72        }
73
74        msg += '</div><div style="clear:both;height:0;">&nbsp;</div></div>';
75        
76        if(cookie("cookie_choice") == null)
77        {
78            $("body").prepend(msg);
79
80            $("#cookie-law-accept").click(function() {
81                if(cookie("cookie_choice") == null)
82                    cookie("cookie_choice", "acc=1", { expires: 365, path: "/" });
83
84                if($("a[id^='cookielaw-']").length > 0)
85                    document.location = document.location;
86                else
87                    $("#cookie-law-wrapper").slideUp();
88            });
89
90            $("#cookie-law-wrapper").slideDown();
91        }
92
93        $("a[id^='cookielaw-']").each(function () {
94            var me = $(this);
95            var c = cookie("cookie_choice");
96            var e = me.attr("id").split('-')[1] + "=0";
97            if(c != null) {
98               if(c.search(e) != -1)
99                   me.html(linkText1).click(function() {
100                       cookie("cookie_choice", c.replace("&" + e, ""), { expires: 365, path: "/" }); 
101                       document.location = document.location;
102                   });
103               else
104                   me.html(linkText0).click(function() {
105                       cookie("cookie_choice", c + "&" + e, { expires: 365, path: "/" });
106                       document.location = document.location;
107                   });
108            }
109            else {
110               me.html(linkText0).click(function() {
111                   cookie("cookie_choice", "acc=1&" + e, { expires: 365, path: "/" });
112                   document.location = document.location;
113               });
114            }
115        });
116    }
117});

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.