PageSourceSearch

https://instax.pl/wp-content/themes/instaxeu/js/ajax.js?ver=20240626

js instax.pl collected 2026-10-02 12:42:50 UTC 5,022 bytes, 202 lines download raw bytes

1jQuery(document).ready(function(){
2	
3	// accessories modal
4    $(".button-qv").on("click", function (e) {
5		
6		e.preventDefault();
7		
8		$('.accessory-retailer-modal.active').removeClass('active');
9		
10		var accsy = $(this).data('id'),
11			modal = $('#qv-modal');
12		
13        $.ajax({
14            type: "POST",
15            dataType: "json",
16            url: the_ajax_script.ajaxurl,
17            data: {
18				postid: accsy,
19				action: 'instaxeu_accessories_modal'
20			},
21			'success': function(data) {
22				if(data.html){
23					$(modal).find('.qv-modal-content-inner').html(data.html);
24					$('.gallery-images').on('setPosition', function(slick){
25						qvPosition();
26					});
27					$('.single-gallery, .variation-gallery').each(function(){
28						
29						var gallery = $(this).find('.gallery-images'),
30							thumbs = $(this).find('.gallery-thumbs');
31						
32						$(gallery).slick({
33							slidesToShow: 1,
34							slidesToScroll: 1,
35							arrows: false,
36							dots: false,
37							asNavFor: thumbs
38						});
39						
40						$(thumbs).slick({
41							slidesToShow: 3,
42							slidesToScroll: 1,
43							arrows: false,
44							dots: false,
45							centerMode: true,
46							centerPadding: '0',
47							asNavFor: gallery,
48							focusOnSelect: true
49						});
50						
51					});
52					qvPosition();
53					$(modal).find('.qv-modal-content').addClass('active');
54				};
55			},
56			'beforeSend': function() {
57				$(modal).addClass('active');
58			},
59			'error': function(data) {
60				$(modal).removeClass('active');
61			}
62        });
63        return false;
64	
65    });
66	
67	// inspo modal
68	$(document).on('click', '.modal-trigger', function(e) {
69		
70		e.preventDefault();
71		
72		var post_id = $(this).data('post-id'),
73			post_type = $(this).data('post-type'),
74			modal = $('#inspo-modal');
75		
76		if( post_type == 'image' ){
77			$.ajax({
78				type: "POST",
79				dataType: "json",
80				url: the_ajax_script.ajaxurl,
81				data: {
82					postid: post_id,
83					action: 'instaxeu_inspo_modal'
84				},
85				'success': function(data) {
86					if(data.html){
87						$(modal).attr('data-post-type', '');
88						$(modal).attr('data-post-type', ""+post_type);
89						$(modal).find('.inspo-modal-content-inner').html(data.html);
90						$("#inspo-modal .inspo-post-image-image img").one("load", function() {
91							$(modal).find('.inspo-modal-content').addClass('active');
92							$(modal).find('.lds-spinner').addClass('inactive');
93							modalPosition();
94						}).each(function() {
95							if(this.complete) {
96								$(this).trigger('load');
97							}
98						});
99					};
100				},
101				'beforeSend': function() {
102					$(modal).addClass('active');
103				},
104				'error': function(data) {
105					$(modal).removeClass('active');
106				}
107			});
108		}
109		
110		if( post_type == 'idea' ){
111			$.ajax({
112				type: "POST",
113				dataType: "json",
114				url: the_ajax_script.ajaxurl,
115				data: {
116					postid: post_id,
117					action: 'instaxeu_inspo_modal'
118				},
119				'success': function(data) {
120					if(data.html){
121						$(modal).attr('data-post-type', '');
122						$(modal).attr('data-post-type', ""+post_type);
123						$(modal).find('.inspo-modal-content-inner').html(data.html);
124						$('.gallery-images').on('setPosition', function(slick){
125							modalPosition();
126						});
127						$('.single-gallery').each(function(){
128							
129							var gallery = $(this).find('.gallery-images');
130							
131							$(gallery).slick({
132								slidesToShow: 1,
133								slidesToScroll: 1,
134								arrows: true,
135								dots: true,
136							});
137							
138						});
139						$(modal).find('.inspo-modal-content').addClass('active');
140						$(modal).find('.lds-spinner').addClass('inactive');
141						modalPosition();
142					};
143				},
144				'beforeSend': function() {
145					$(modal).addClass('active');
146				},
147				'error': function(data) {
148					$(modal).removeClass('active');
149				}
150			});
151		}
152		
153        return false;
154	
155    });
156	
157	// inspo load more
158    $("#inspo-load-more").on("click", function (e) {
159		
160		e.preventDefault();
161		
162		var offset = parseInt( $(this).attr('data-offset') );
163		var count = parseInt( $(this).attr('data-count') );
164		
165		$.ajax({
166			type: "POST",
167			dataType: "json",
168			url: the_ajax_script.ajaxurl,
169			data: {
170				offset: offset,
171				count: count,
172				action: 'instaxeu_inspo_more'
173			},
174			'success': function(data) {
175				if(data.html){
176					var $content = $( data.html );
177					$('.grid').append( $content ).masonry( 'appended', $content );
178					checkFilters();
179					$('.grid-item').addClass('visible');
180					$('#inspo-load-more').attr('data-offset', offset+count);
181					$('.more-posts').show();
182					setTimeout(function() {
183						videoLR();
184						$grid.masonry();
185					}, 500);
186				};
187				$('.load-more-spinner').hide();
188			},
189			'beforeSend': function() {
190				$('.more-posts').hide();
191				$('.load-more-spinner').show();
192			},
193			'error': function(data) {
194				$('.load-more-spinner').hide();
195			}
196		});
197		
198        return false;
199	
200    });
201	
202});

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.