PageSourceSearch

https://ursus.ro/js/ageGate.js?v=1.079

js ursus.ro collected 2026-10-02 12:54:58 UTC 3,559 bytes, 113 lines download raw bytes

1jQuery(document).ready(function () {
2
3    if ($(window).width() > 725){
4        $('#ageGate').css('height', window.innerHeight);
5        $(window).resize(function() {
6            $('#ageGate').css('height', window.innerHeight);
7        });
8    };
9
10
11    var scene = document.getElementById('scene');
12    var parallaxInstance = new Parallax(scene);
13
14    $('.dob input').click(function(){
15    	let placeholder = $(this).attr('placeholder');
16    	$(this).removeAttr('placeholder').attr('data-placeholder',placeholder);
17    })
18
19    $('.dob input').blur(function(){
20    	let placeholder = $(this).attr('data-placeholder');
21    	$(this).attr('placeholder',placeholder);
22    })
23
24    function passAgeGate(){
25        let age = 60*60;// 1h
26        if($('#remember_me').is(':checked')){
27            age = 30*24*60*60; //30d
28        }
29        $('.redirecting').removeClass('hide');
30        setTimeout(function(){
31            setCookie({
32                name: 'ageGate',
33                value: 1,
34                age: age
35            });
36            /*var ageGateRedirect = decodeURIComponent(getCookie('ageGateRedirect'));
37            removeCookie('ageGateRedirect');
38            */
39            const queryString = window.location.search;
40            const urlParams = new URLSearchParams(queryString);            
41            const redirect = urlParams.get('redirect');
42            if(redirect){
43                window.location.replace(redirect+getOtherParams(queryString));
44            } /*else {
45                window.location.replace(main.base_url);
46            }*/
47        },3000);
48    }
49
50    function getOtherParams(input){
51        let pieces = input.split('&');
52        let result = pieces.length > 1 ? '?' : '';
53        let more = false;
54        for (let i = 0; i < pieces.length; i++) {
55            if (pieces[i].indexOf('redirect=') === -1) {
56                if (!more)
57                    result += pieces[i];
58                else
59                    result += '&' + pieces[i];
60                more = true;
61            }
62        }
63        return result;
64    }
65
66    function failAgeGate(){
67        $('.redirecting-under-18').removeClass('hide');
68        setTimeout(function(){
69            window.location.replace('https://www.alcoolulnutefacemare.ro');
70        },5000);
71    }
72
73    $('#year').keyup(function(){
74        let ageYear = $('#year').val();
75        let currentYear = new Date().getFullYear();
76        let limitYear = currentYear - 18;        
77        if($.trim($(this).val()).length != 4 || ageYear < 1900 || ageYear > currentYear)
78            return;
79        if(limitYear > ageYear){
80            passAgeGate();
81        } else if (limitYear == ageYear){
82            $('#month').removeClass('hide').focus();
83        } else{
84            failAgeGate();
85        }
86    });
87
88    $('#month').keyup(function(){
89        let ageMonth = $(this).val();
90        if($.trim(ageMonth).length != 2 || ageMonth < 1 || ageMonth > 12)
91            return;            
92        let currentMonth = new Date().getMonth() + 1;
93        if(currentMonth > ageMonth){
94            passAgeGate();
95        } else if(currentMonth == ageMonth){
96            $('#day').removeClass('hide').focus();
97        } else{
98            failAgeGate();
99        }
100    });
101
102    $('#day').keyup(function(){
103        let ageDay = $(this).val();
104        if($.trim(ageDay).length != 2 || ageDay < 1 || ageDay > 31)
105            return;
106        let currentDay = new Date().getDate();
107        if(currentDay >= ageDay){
108            passAgeGate();
109        } else {
110            failAgeGate();
111        }
112    });
113});

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.