PageSourceSearch

https://ledrentcompany.ru/js/common.js

js ledrentcompany.ru collected 2026-10-07 01:07:42 UTC 9,123 bytes, 280 lines download raw bytes

1(function($) {
2    $.fn.toSVG = function(options) {
3        var params = $.extend({
4            svgClass: "replaced-svg",
5            onComplete: function() {},
6        }, options)
7        this.each(function() {
8            var $img = jQuery(this);
9            var imgID = $img.attr('id');
10            var imgClass = $img.attr('class');
11            var imgURL = $img.attr('src');
12            if (!(/\.(svg)$/i.test(imgURL))) {
13                console.warn("image src='" + imgURL + "' is not a SVG, item remained tag <img/> ");
14                return;
15            }
16            $.get(imgURL, function(data) {
17                var $svg = jQuery(data).find('svg');
18                if (typeof imgID !== 'undefined') {
19                    $svg = $svg.attr('id', imgID);
20                }
21                if (typeof imgClass !== 'undefined') {
22                    $svg = $svg.attr('class', imgClass + params.svgClass);
23                }
24                $svg = $svg.removeAttr('xmlns:a');
25                if (!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) {
26                    $svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width'))
27                }
28                $img.replaceWith($svg);
29                typeof params.onComplete == "function" ? params.onComplete.call(this, $svg) : '';
30            })
31        });
32    }
33})(jQuery);
34function sendReachGoal(form)
35{
36  if (!!form &&
37      form.length == 1 &&
38      !!form.attr("rel_yrg"))
39  {
40    if (typeof(window.yaCounter46517163) != "undefined")
41    {
42      window.yaCounter46517163.reachGoal(form.attr("rel_yrg"));
43    }
44  }
45}
46$(document).ready(function() {
47    var clickHandler = ('ontouchstart' in document.documentElement ? "touchstart" : "click");
48    $("a").bind(clickHandler, function(e) {});
49
50    $('img.svg').toSVG({
51        svgClass: "SVG",
52        onComplete: function(data) {}
53    });
54
55    $('.tabs_nav a').on('click', function(event) {
56        event.preventDefault();
57
58        $('.tab_active').removeClass('tab_active');
59        $(this).parent().addClass('tab_active');
60        $('.tabs_stage div').removeClass("active");
61        $($(this).attr('href')).addClass('active');
62    });
63    $('.tabs_nav a:first').trigger('click'); // Default
64
65    $(".various").fancybox({
66        wrapCSS: 'owrap'
67    });
68    $(".fancybox").fancybox();
69    $(".video_slide").fancybox({
70        wrapCSS: "media_wrap",
71        helpers: {
72            media: {},
73            overlay: {
74                locked: false
75            }
76        },
77
78    });
79
80    $('.video_slider').slick({
81        slidesToShow: 1,
82        slidesToScroll: 1,
83        fade: true,
84        autoplay: true,
85        autoplaySpeed: 4000,
86    })
87    $('.project_slider').slick({
88        slidesToShow: 1,
89        slidesToScroll: 1,
90        swipe: false,
91        draggable: false,
92        autoplay: true,
93        autoplaySpeed: 2000
94    });
95
96    $(".form_control").focus(function() {
97        $(this).parent('.form_group').addClass('focus');
98        $(this).parent('.form_group').addClass('label_top');
99
100    }).blur(function() {
101        if ($(this).val() == "") {
102            $(this).parent('.form_group').removeClass('label_top');
103            // $(this).parent('.form_group').find('span').removeClass('w_span').css('width', "");
104        }
105
106        $(this).parent('.form_group').removeClass('focus');
107
108    });
109    $('.close_modal').click(function() {
110        $.fancybox.close();
111    });
112
113
114
115    var slickRangeDisable = false;
116    $(".inner_slider").each(function() {
117        $(this).on("init", function(even, slick) {
118            var selfSlider = $(this);
119            var cl = slick.slideCount;
120          //  console.log(cl);
121            $(this).closest(".wrap_inner_slider").find(".slider_range").slider({
122                range: "max",
123                min: 1,
124                max: cl,
125                value: 1,
126                // animate: "slow",
127                slide: function(event, ui) {
128                    if (slickRangeDisable) {
129                        return false;
130                    }
131                    selfSlider.slick("slickGoTo", ui.value - 1);
132                }
133            });
134        });
135
136        $(this).slick({
137            slidesToShow: 4,
138            slidesToScroll: 1,
139            arrows: false,
140            responsive: [{
141                breakpoint: 900,
142                settings: {
143                    slidesToShow: 3
144                }
145            }, {
146                breakpoint: 691,
147                settings: {
148                    slidesToShow: 2
149                }
150            }, {
151                breakpoint: 490,
152                settings: {
153                    slidesToShow: 1
154                }
155            }]
156
157        });
158
159        $(this).on("afterChange", function() {
160            slickRangeDisable = false;
161        });
162
163        $(this).on("beforeChange", function(event, slick, currentSlide, nextSlide) {
164            // console.log(nextSlide)
165            $(this).closest(".wrap_inner_slider").find(".slider_range").slider("value", nextSlide + 1);
166            slickRangeDisable = true;
167        });
168    });
169    $('.slider_range').draggable();
170    $('.clockpicker').clockpicker({
171        placement: 'top',
172        donetext: 'Готово',
173        'default': 'now'
174    });
175    $('.time_btn').click(function() {
176        $('.wrap_hidden_input').slideDown(300);
177    });
178    $('.time_now').click(function() {
179        $('.clockpicker').val('');
180    });
181    $(window).scroll(function() {
182        if ($(window).scrollTop() >= 20) {
183            $('header').addClass('affix');
184        } else {
185            $('header').removeClass('affix');
186        }
187    });
188    $(' .scroll_section[href*="#"]:not([href="#"])').click(function() {
189        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
190            var target = $(this.hash);
191            var h = $('header').outerHeight();
192            target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
193            if (target.length) {
194                $('html, body').animate({
195                    scrollTop: target.offset().top - h
196                }, 1000);
197                return false;
198            }
199        }
200    });
201    $('input[type="tel"]').mask("+7(985) 970-69-83");
202
203    $("form").each(function() {
204        var it = $(this);
205        var this_form = this.id;
206        it.validate({
207            rules: {
208                phone: {
209                    required: true
210                }
211            },
212            messages: {},
213            errorPlacement: function(error, element) {},
214            submitHandler: function(form) {
215                if (it.hasClass('promo_form')) {
216                    // console.log("true");
217                    var thisForm = document.getElementById(this_form); //$(it); //form
218                    var formData = new FormData(thisForm);
219                    $.ajax({
220                        type: "POST",
221                        url: 'mail.php',
222                        processData: false,
223                        contentType: false,
224                        data: formData,
225                    }).done(function() {
226                        $.fancybox.close();
227                        $.fancybox.open([{
228                            href: '#promo_thanks',
229                        }]);
230                        setTimeout(function() {
231                            $.fancybox.close();
232                        }, 3000);
233                        it.trigger("reset");
234                        sendReachGoal(jQuery(thisForm));
235                    });
236                    return false;
237                } else {
238                    var thisForm = document.getElementById(this_form); //$(it); //form
239                    var formData = new FormData(thisForm);
240                    $.ajax({
241                        type: "POST",
242                        url: 'mail_2.php',
243                        processData: false,
244                        contentType: false,
245                        data: formData,
246                    }).done(function() {
247                        $.fancybox.close();
248                        $.fancybox.open([{
249                            href: '#thanks',
250                        }]);
251                        setTimeout(function() {
252                            $.fancybox.close();
253                        }, 3000);
254                        it.trigger("reset");
255                        $('.pers_check').find('label').removeClass('errror');
256                        sendReachGoal(jQuery(thisForm));
257                    });
258                    return false;
259                }
260            },
261            success: function() {},
262            highlight: function(element, errorClass) {
263                $(element).addClass('error');
264            },
265            unhighlight: function(element, errorClass, validClass) {
266                $(element).removeClass('error');
267            }
268        })
269    });
270
271
272
273    $(document).mousemove(function(e) {
274        $('.element1').parallax(-25, e);
275        $('.element2').parallax(30, e);
276        $('.element3').parallax(10, e);
277        $('.element4').parallax(20, e);
278
279    });
280});

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.