PageSourceSearch

https://www.ctemedetemjinak.cz/user/templates/static-assets/js/modules/eighteen-plus.js?build=477

js ctemedetemjinak.cz collected 2026-10-08 21:17:50 UTC 2,590 bytes, 81 lines download raw bytes

1
2class EighteenPlus {
3
4    constructor() {
5        this.cookieName = 'modules-eighteen-plus';
6        this.init();
7    }
8
9    setStorage(key, value) {
10        if (typeof (Storage) !== "undefined") {
11            localStorage.setItem(key, JSON.stringify(value));
12        } else {
13            console.log("LocalStorage není podporováno.");
14        }
15    }
16
17    getStorage(key) {
18        if (typeof (Storage) !== "undefined") {
19            var item = localStorage.getItem(key);
20            if (item) {
21                return JSON.parse(item);
22            }
23        } else {
24            console.log("LocalStorage není podporováno.");
25        }
26        return null;
27    }
28
29    setAproved() {
30        this.setStorage(this.cookieName, 'yes');
31        $('#modules-eighteen-plus-wrapper').animate({
32            bottom: '-50%'
33        }, 'slow', function () {
34            $(this).remove();
35        });
36        $('.modules-eighteen-plus-overlay').remove();
37        /*$('.modules-eighteen-plus').each(function () {
38         $(this).removeClass('.modules-eighteen-plus');
39         });*/
40    }
41
42    showModal() {
43        var url = nody.functions.append_url('/action/modules/eighteen-plus/');
44        $.get(url, function (data) {
45            var $modal = $(data);
46            $('body').append($modal);
47            $('#modules-eighteen-plus-wrapper').animate({
48                bottom: '0'
49            }, 'slow');
50            $('.eighteen-plus-confirm').click(function (e) {
51                e.preventDefault();
52                nody.modules.EighteenPlus.setAproved();
53            });
54        });
55    }
56
57    init() {
58        var a = $('.modules-eighteen-plus');
59        if (a.length) {
60            // Máme modul aktivní, jelikož došlo k nastavení této třídy
61            // Zkontrolujeme cookies, jestli už náhodou nepotvrdil
62            if (this.getStorage(this.cookieName) === null) {
63                // Cookies zatim nepotvrdil, tak přidáme vrstvy
64                var somethingOnPage = false;
65                a.each(function () {
66                    $(this).addClass('active');
67                    // Vytvoření overlay vrstvy
68                    var overlay = $('<div class="modules-eighteen-plus-overlay"></div>');
69                    $(this).append(overlay);
70                    somethingOnPage = true;
71                });
72                if (somethingOnPage === true) {
73                    this.showModal();
74                }
75            }
76        }
77    }
78
79}
80
81nody.modules.EighteenPlus = new EighteenPlus();

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.