PageSourceSearch

https://immigrant.today/js3/script.js

js immigrant.today collected 2026-10-02 11:35:12 UTC 7,023 bytes, 195 lines download raw bytes

1jQuery(document).ready(function(){
2	
3  //$("head").prepend("<link rel='stylesheet' type='text/css' href='css3/fonts.css' />");
4
5	  $('body').on('click', '.menu__btn', function(){
6        if ($('body').hasClass('accountActive')){
7          $('body').removeClass('accountActive');
8        }else{
9          $('body').toggleClass('menuActive');
10        }
11    });
12    
13    $('body').on('click', '.dropdown-item',  function(e){
14        if (!$(this).parents('body').hasClass('accountActive')){
15          $(this).parents('.dropdown').find('.dropdown-toggle .caption').html($(this).html());
16          $(this).parents('.dropdown').find('.dropdown-item').removeClass('active');
17          $(this).addClass('active');
18        }else{			
19			if (!$(this).parents('.dropdown').hasClass('dropdownCallDefaults'))
20				e.preventDefault();			
21        }
22    })
23    
24    $('.sidebar__right .sticky').each(function(){
25      $(this).stick_in_parent({
26        'offset_top':0
27      });
28    });
29 
30    var owlFlags = [];
31    $('.owl-carousel.category__items').each(function(){
32        var delay = $('.owl-carousel.category__items').index($(this))*2000;
33        var el = $(this),
34            i = $('.owl-carousel.category__items').index($(this)),
35            owl = [];
36
37            owlFlags[i] = false;		
38		// items count
39		let itemsCount = $(this).attr("data-items-count") || 4;				
40		itemsCount = Math.min(itemsCount, 4);				
41		
42		let responsive = {};
43		if (itemsCount == 4)
44		{
45			responsive[991] = {items:4, slideBy: 4};		
46			responsive[767] = {items:3, slideBy: 3};		
47			responsive[375] = {items:2, slideBy: 2};		
48			responsive[220] = {items:1, slideBy: 1};
49		}			
50		else if (itemsCount == 3)
51		{
52			responsive[991] = {items:3, slideBy: 3};		
53			responsive[767] = {items:2, slideBy: 2};		
54			responsive[375] = {items:1, slideBy: 1};		
55			responsive[220] = {items:1, slideBy: 1};
56		}
57		else if (itemsCount == 2)
58		{
59			responsive[991] = {items:2, slideBy: 2};		
60			responsive[767] = {items:2, slideBy: 2};		
61			responsive[375] = {items:1, slideBy: 1};		
62			responsive[220] = {items:1, slideBy: 1};
63		}
64		else if (itemsCount == 1)
65		{
66			responsive[991] = {items:1, slideBy: 1};		
67			responsive[767] = {items:1, slideBy: 1};		
68			responsive[375] = {items:1, slideBy: 1};		
69			responsive[220] = {items:1, slideBy: 1};
70		}
71        owl[i] = $(this).owlCarousel({
72            loop: ( $('.owl-carousel .items').length > itemsCount),
73			rewind: true,
74            nav:false,
75            dots:true,
76            items: itemsCount,
77            slideBy: itemsCount,
78            smartSpeed:800,
79            autoplay:true,
80            autoplayTimeout:7000,
81            onDragged: function(){
82                owl[i].trigger('stop.owl.autoplay');
83            },
84            autoplayHoverPause:true,
85            responsive:responsive,
86            onInitialized:function(event){
87            },
88            onTranslated:function(event){
89            }
90        });
91
92        $(this).mouseout(function(e) {
93            if (owlFlags[i] == false){
94                owl[i].trigger('play.owl.autoplay');
95                owlFlags[i] = true;
96            }
97        });
98        owl[i].trigger('stop.owl.autoplay');
99       
100    });
101
102    $('body').on('click', '.note__window_close', function(){
103        $(this).parents('.note__window').hide();
104    });
105
106    
107    $('.raty').each(function(){
108        var score = $(this).attr('data-score')
109        //readonly = $(this).attr('data-readonly')
110        $(this).append("<span class='score'>("+ score +")</span>");
111        $(this).raty({
112            numberMax: 100,
113            score:score,
114            starHalf    : '/img3/raty_half.svg',
115            starOff     : '/img3/raty_off.svg',
116            starOn      : '/img3/raty_on.svg'
117        })    
118    });
119
120    $('[data-fancybox]').each(function(){
121      $(this).fancybox();
122    });
123
124    $('body').on('click', '.header__search_btn', function(){
125      $(this).parents('.header__search_wrap').toggleClass('header__search--active');
126      if ($('.header__search_wrap').hasClass('header__search--active')){
127        $('.header__search_input').focus();
128      }
129    });
130    //при нажатии на кнопку с id="save"
131    $('.form .submit').click(function() {
132        //переменная formValid
133        var formValid = true;
134        //перебрать все элементы управления input
135        $(this).parents('.form').find('.form-element').each(function() {
136            //найти предков, которые имеют класс .form-group, для установления success/error
137            var formGroup = $(this).parents('.form-group');
138            //для валидации данных используем HTML5 функцию checkValidity
139            if (this.checkValidity()) {
140                //добавить к formGroup класс .has-success, удалить has-error
141                formGroup.addClass('has-success').removeClass('has-error');
142                //добавить к glyphicon класс glyphicon-ok, удалить glyphicon-remove
143            } else {
144                //добавить к formGroup класс .has-error, удалить .has-success
145                formGroup.addClass('has-error').removeClass('has-success');
146                //отметить форму как невалидную
147                formValid = false;
148            }
149        });
150        if (formValid) {
151            //скрыть модальное окно
152        }
153    });
154
155    $('body').on('click', '.btn__account', function(){
156      $('body').toggleClass('accountActive');
157    });
158
159    $('.hide-block').hide();
160    
161    $('.hide-link').click(function(){
162        var wrapper = $(this).parents('.hide-wrapper');
163        if (wrapper.hasClass('hideActive')){
164            $(this).text($(this).attr('data-show'));
165            wrapper.find('.hide-block').slideUp(300);
166            wrapper.removeClass('hideActive');
167        }else{
168            $(this).text($(this).attr('data-hide'));
169            wrapper.find('.hide-block').slideDown(300);
170            wrapper.addClass('hideActive');
171        }
172    })
173
174    $('.main__menu_li').hover(function(){
175        if (!$(this).parents('body').hasClass('menuActive')){
176            $(this).addClass('show');
177            $(this).find('.dropdown-menu').addClass('show');
178        }
179    }, function(){
180        if (!$(this).parents('body').hasClass('menuActive')){
181            $(this).removeClass('show');
182            $(this).find('.dropdown-menu').removeClass('show');
183        }
184    });
185
186    $('body').on('click', '.btn--comment_add', function(){
187      var commentForm = $(this).parents('.coment__form'); 
188      if (!commentForm.hasClass('coment__form--show')){
189        commentForm.addClass('coment__form--show');
190        commentForm.find('.comment__form_bottom').slideDown(300);
191      }
192    });
193
194})
195

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.