PageSourceSearch

https://podsolnukh.org/js/main.js

js podsolnukh.org collected 2026-10-06 04:39:21 UTC 8,199 bytes, 244 lines download raw bytes

1$(document).ready(function() {
2
3
4
5    //FORM SEND
6    $('.form-contacts').submit(function(e) {
7        e.preventDefault();
8        var name = $(".form-contacts input[name='name']").val();
9        var email = $(".form-contacts input[name='email']").val();
10        var message = $(".form-contacts textarea").val();
11
12        function isValidEmail(emailAddress) {
13          var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
14          return pattern.test(emailAddress);
15        };
16
17        var dataString = 'name=' + name + '&email=' + email + '&message=' + message;
18
19        //send
20        if ( isValidEmail(email) && (name.length > 1 ) )  {
21            $.ajax({
22                type: "POST",
23                url: "/send.php",
24                data: dataString,
25                success: function() {
26                    $('.form-contacts .message').fadeIn(500).html('Сообщение отправлено.').delay(1000).fadeOut(500);
27                    $('.form-contacts input[type="text"]').val('');
28                    $('.form-contacts textarea').val('');
29                },
30                error: function(){
31                  $('.form-contacts .message').fadeIn(1000).html('Произошла ошибка.').delay(1000).fadeOut(500);
32                }
33            });
34        } else {
35          $('.form-contacts .message').fadeOut(0).fadeIn(500).html('Вы не заполнили обязательные (*) поля').delay(1000).fadeOut(500);
36        }
37        return false;
38    });
39
40
41
42    //COOKIE NOBOT
43    (function setCookie(n, v, o) {
44        o = o || {};
45        o.path = '/';
46        var e = o.e;
47        if (typeof e == "number" && e) {var d = new Date();d.setTime(d.getTime() + e * 1000);e = o.e = d;}
48        if (e && e.toUTCString) {o.e = e.toUTCString();}
49        v = encodeURIComponent(v);
50        var u = n + "=" + v;
51        for (var p in o) {
52            u += "; " + p;var s = o[p];
53            if (s !== true) {u += "=" + s;}
54        }
55        document.cookie = u;
56    })('nobot', '1');
57
58
59    // Показывать кнопку Помочь в мобильной версии
60    function phoneBtnClassToggle(){
61        // var phoneBtn = document.getElementById("phone_show_hide");
62        // phoneBtn.classList
63
64        if (window.location.pathname == "/" || window.location.pathname == "/programms/") {
65            // phoneBtn.classList.add("phone-for-main");
66            document.getElementById("phone_show_hide").classList.toggle("phone-for-main");
67            // console.log(.phone_show_hide);
68        };
69    };
70    phoneBtnClassToggle();
71
72
73    // Spoiler
74    $("a[data-action='spoiler']").on('click', function(e){
75        e.preventDefault();
76        var spoilerId = $(e.target).attr('href');
77        var $spoiler = $(spoilerId);
78        var spoilerText = $(e.target).text();
79        var textToggle = $(e.target).attr('data-text-toggle');
80
81        if ($spoiler.css('display') == 'block') {
82            $spoiler.fadeOut();
83        } else {
84            $spoiler.fadeIn();
85        }
86
87        $(e.target).text(textToggle);
88        $(e.target).attr('data-text-toggle', spoilerText)
89    })
90
91
92	// Phone - Show
93	$(".phone-show").on("click", function() {
94	  $(".phone-list").toggle();
95	});
96
97    $(".btn-dropdown").on("click", function() {
98        $(this).next('.drop-down-list').toggle();
99    });
100
101
102	$(function(){
103    	$('.phone-show').click(function(){
104    		$('.phone-show').toggleClass('btn-active');
105    	});
106    });
107
108    // Carusel main
109    $(".slider-banner").slick({
110    	autoplay: true,
111    	pauseOnHover: true
112    });
113
114    // Carusel photo
115    $(".tochka-slider").slick({
116        autoplay: true,
117        slidesToShow: 3,
118        pauseOnHover: true,
119        responsive: [
120            {
121                breakpoint: 768,
122                settings: {
123                    arrows: false,
124                    slidesToShow: 1,
125                    slidesToScroll: 1,
126                }
127            },
128        ],
129    });
130
131    // Accardion
132    $('span.accordion-header').click(function () {
133        $(this).toggleClass('active');
134    });
135
136    function windowSize(){
137        if($(window).width()<='992'){
138            var accordion = function(){
139                var data = $('.accordion').attr('data-accordion')
140
141                $('.accordion-header').on('click', function(){
142                    $(this).next('.accordion-body').not(':animated').slideToggle()
143                })
144            }
145
146            accordion();
147        }else{
148            return false;
149        }
150    }
151    $(window).load(windowSize);
152    $(window).resize(windowSize);
153    $(window).on('load resize',windowSize);
154
155    // Nav Show
156    $(function(){
157        $('.nav-show').click(function(){
158            $('.block-nav').addClass('visible');
159            $('body').css('overflow','hidden');
160        });
161
162    });
163
164    $(function(){
165        $('.close-nav').click(function(){
166            $('.block-nav').removeClass('visible');
167            $('body').css('overflow','auto');
168        });
169    });
170
171    $(function (){
172        if($('.report__container')){
173            let reports = document.querySelectorAll('.report__item');
174
175            if (reports.length > 6) {
176                reports.forEach((report, i) => {
177                    if (i > 5) report.classList.add('d-none')
178                })
179                makeButtonIstcho();
180            }
181
182            function makeButtonIstcho() {
183                let myButton = document.createElement('button');
184                let buttonContainer = document.createElement('div');
185                let reportContainer = document.querySelector('.report__container');
186                myButton.textContent = 'ЕЩЁ';
187                myButton.classList.add('btn_istcho');
188                myButton.addEventListener('click', () => {
189                    for (let report of reports) {
190                        report.classList.remove('d-none');
191                    }
192                    myButton.classList.add('d-none');
193                })
194                buttonContainer.classList.add('button-container');
195                buttonContainer.append(myButton);
196                reportContainer.append(buttonContainer);
197            }
198
199        }
200    })
201
202
203    $("a[href^='#']").click(function(e){
204        e.preventDefault();
205
206        let elementId = $(this).attr('href');
207
208        if ( !$(elementId).length ) return;
209        
210        let elementPosition = $(elementId).offset().top;
211
212        $('body, html').animate({
213            scrollTop: elementPosition
214        }, 1000);
215    })
216
217	$('.year-title-wrap').click(function() {
218		$('.month-title-wrap').removeClass('open')
219		$('.news-month-wrap').slideUp();
220
221		if (!$(this).hasClass('open')) {
222			$('.year-title-wrap').removeClass('open')
223			$(this).addClass('open')
224			$('.year-months-wrap').slideUp()
225			$('.year-months-wrap-' + $(this).attr('data-year-wrap-id')).slideDown()
226
227		} else {
228			$(this).removeClass('open')
229			$('.year-months-wrap-' + $(this).attr('data-year-wrap-id')).slideUp()
230		}
231	});
232
233	$('.month-title-wrap').click(function() {
234		if (!$(this).hasClass('open')) {
235			$('.month-title-wrap').removeClass('open')
236			$(this).addClass('open')
237			$('.news-month-wrap').slideUp();
238			$('#' + $(this).attr('data-month-wrap-id')).slideDown();
239		} else {
240			$(this).removeClass('open')
241			$('#' + $(this).attr('data-month-wrap-id')).slideUp();
242		}
243	});
244});

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.