PageSourceSearch

https://www.dangleads.com/wp-content/plugins/agni-plus/modules/blo…/assets/js/blogcarousel.js?ver=1.0.2

js dangleads.com collected 2026-10-08 02:35:02 UTC 11,986 bytes, 288 lines download raw bytes

1( function( $ ) {
2
3	var dtBlogPosts = function($scope, $) {
4
5		var swiperPost = [];
6		var swiperPostOptions = [];
7		var swiperIterator = 1;
8
9		$scope.find('.wdt-posts-list-wrapper.swiper-container').each(function() {
10
11			var $swiperItem = jQuery(this);
12			var swiperUniqueId = 'swiperuniqueid-'+swiperIterator;
13
14			swiperPostOptions[swiperUniqueId] = [];
15			$swiperItem.attr('id', swiperUniqueId);
16
17			// Get swiper options
18			var effect = $swiperItem.attr('data-carouseleffect');
19
20			var slidesperview = parseInt($swiperItem.attr('data-carouselslidesperview'), 10);
21
22			var loopmode = ($swiperItem.attr('data-carouselloopmode') == 'true') ? true : false;
23			var mousewheelcontrol = ($swiperItem.attr('data-carouselmousewheelcontrol') == 'true') ? true : false;
24
25			var pagination_class = '';
26			var pagination_type = '';
27
28			var carouselbulletpagination = ($swiperItem.attr('data-carouselbulletpagination') == 'true') ? true : false;
29			if(carouselbulletpagination) {
30				var pagination_class = $swiperItem.find('.wdt-products-bullet-pagination');
31				var pagination_type = 'bullets';
32			}
33
34			var carouselthumbnailposition = ($swiperItem.attr('data-carouselthumbnailposition') != '') ? $swiperItem.attr('data-carouselthumbnailposition') : false;
35			if(carouselthumbnailposition) {
36				swiperPostOptions[swiperUniqueId]['carouselthumbnailposition'] = 'vertical';
37			} else {
38				swiperPostOptions[swiperUniqueId]['carouselthumbnailposition'] = 'horizontal';
39			}
40
41			var scrollbar_class = '';
42			var	scrollbar_hide = true;
43			var carouselscrollbar = ($swiperItem.attr('data-carouselscrollbar') == 'true') ? true : false;
44			if(carouselscrollbar) {
45				scrollbar_class = $swiperItem.find('.wdt-products-scrollbar');
46				scrollbar_hide = false;
47			}
48
49			if($swiperItem.parents('section').hasClass('page-with-sidebar')) {
50
51				if(slidesperview == 1) {
52					var breakpoint_slides_1 = breakpoint_slides_2 = breakpoint_slides_3 = breakpoint_slides_4 = breakpoint_slides_5 = 1;
53				} else if(slidesperview == 2) {
54					var breakpoint_slides_1 = 2; var breakpoint_slides_2 = 2; var breakpoint_slides_3 = 2; var breakpoint_slides_4 = 1; var breakpoint_slides_5 = 1;
55				} else if(slidesperview >= 3) {
56					var breakpoint_slides_1 = 3; var breakpoint_slides_2 = 2; var breakpoint_slides_3 = 2; var breakpoint_slides_4 = 1; var breakpoint_slides_5 = 1;
57				}
58
59			} else {
60
61				if(slidesperview == 1) {
62					var breakpoint_slides_1 = breakpoint_slides_2 = breakpoint_slides_3 = breakpoint_slides_4 = breakpoint_slides_5 = 1;
63				} else if(slidesperview == 2) {
64					var breakpoint_slides_1 = 2; var breakpoint_slides_2 = 2; var breakpoint_slides_3 = 2; var breakpoint_slides_4 = 2; var breakpoint_slides_5 = 1;
65				} else if(slidesperview == 3) {
66					var breakpoint_slides_1 = 3; var breakpoint_slides_2 = 3; var breakpoint_slides_3 = 3; var breakpoint_slides_4 = 2; var breakpoint_slides_5 = 1;
67				} else if(slidesperview >= 4) {
68					var breakpoint_slides_1 = 4; var breakpoint_slides_2 = 4; var breakpoint_slides_3 = 3; var breakpoint_slides_4 = 2; var breakpoint_slides_5 = 1;
69				}
70
71			}
72
73			// Generate swiper
74			swiperPost[swiperUniqueId] = new Swiper($swiperItem, {
75				init: true,
76				initialSlide: 0,
77				simulateTouch: true,
78				roundLengths: true,
79				keyboardControl: true,
80				paginationClickable: true,
81				autoHeight: true,
82				grabCursor: true,
83
84				slidesPerView: slidesperview,
85				loop:loopmode,
86				mousewheel: mousewheelcontrol,
87				direction: 'horizontal',
88
89				updateOnWindowResize: true,
90
91				pagination: {
92					el: pagination_class,
93					type: pagination_type,
94					clickable: true
95				},
96
97				scrollbar: {
98					el: scrollbar_class,
99					hide: scrollbar_hide,
100					draggable: true,
101				},
102
103				effect: effect,
104
105				breakpoints: {
106					1681: {
107						slidesPerView: breakpoint_slides_1,
108					},
109					1441: {
110						slidesPerView: breakpoint_slides_2,
111					},
112					1281: {
113						slidesPerView: breakpoint_slides_3,
114					},
115					1025: {
116						slidesPerView: breakpoint_slides_3,
117					},
118					768: {
119						slidesPerView: breakpoint_slides_4,
120					},
121					319: {
122						slidesPerView: breakpoint_slides_5,
123					},
124				},
125
126			});
127
128			// Arrow pagination
129			var arrowpagination = ($swiperItem.attr('data-carouselarrowpagination') == 'true') ? true : false;
130
131			if(arrowpagination) {
132
133				$swiperItem.find('.wdt-products-arrow-pagination .wdt-products-arrow-prev').on('click', function(e) {
134					var swiperUniqueId = $swiperItem.attr('id');
135					swiperPost[swiperUniqueId].slidePrev();
136					if(swiperPostOptions[swiperUniqueId]['autoplay_enable']) {
137						swiperPost[swiperUniqueId].autoplay.start();
138					}
139					e.preventDefault();
140				});
141
142				$swiperItem.find('.wdt-products-arrow-pagination .wdt-products-arrow-next').on('click', function(e) {
143					var swiperUniqueId = $swiperItem.attr('id');
144					swiperPost[swiperUniqueId].slideNext();
145					if(swiperPostOptions[swiperUniqueId]['autoplay_enable']) {
146						swiperPost[swiperUniqueId].autoplay.start();
147					}
148					e.preventDefault();
149				});
150
151			}
152
153			swiperIterator++;
154		});
155
156		$scope.find('.wdt-posts-list-wrapper').each(function() {
157
158            var $page = 1;
159            var $T = $(this);
160            var $data = "", $content = $T.find('.tpl-blog-holder');
161
162            // When load more button click...
163            $('.wdt-posts-list-wrapper').on( "click", ".loadmore-elementor-btn.more-items", function() {
164
165              var $this = $(this);
166              var $count = $this.attr('data-count'), $cats = $this.attr('data-cats'), $style = $this.attr('data-style'),
167              $layout = $this.attr('data-layout'), $column = $this.attr('data-column'), $list_type = $this.attr('data-listtype'),
168              $hover = $this.attr('data-hover'), $overlay = $this.attr('data-overlay'), $align = $this.attr('data-align'),
169              $mpages = $this.attr('data-maxpage'), $pos = $this.attr('data-pos'), $eheight = $this.attr('data-eheight'),
170              $meta = $this.attr('data-meta'), $blogpostloadmore_nonce = $this.attr('data-blogpostloadmore-nonce'),
171              $settings = $this.attr('data-settings');
172
173              if( $meta != '' ) {
174                  $meta = JSON.parse( $meta );
175              }
176
177              $content.addClass('loading');
178
179              if( $this.hasClass('more-items') ) {
180                $page++;
181              }
182
183              $.ajax({
184                 type : "post",
185                 dataType : "html",
186                 url : agni_urls.ajaxurl,
187                 data : { action: "blog_elementor_sc_load_more_post", count: $count, cats: $cats, pos: $pos, style: $style, layout: $layout, column: $column, pageNumber: $page, listtype: $list_type, hover: $hover, overlay: $overlay, align: $align, meta: $meta, blogpostloadmore_nonce: $blogpostloadmore_nonce, settings: $settings },
188                 cache: true,
189                 success: function (data) {
190                    var $res = data.split('#####$$$$$');
191                    if ( $res.length > 0 ) {
192
193                        $content.append($res[0]);
194                        $T.find('.loadmore-elementor-btn').attr('data-pos', $res[1]);
195
196                        var newbx = $content.find('ul.entry-gallery-post-slider');
197                        if( newbx !== null ) {
198                            newbx.bxSlider({mode: 'fade', auto:false, video:true, pager:'', autoHover:true, adaptiveHeight:false, responsive: true});
199                        }
200
201                        if( $eheight == null || $eheight == false ) {
202                            $content.css({overflow:'hidden'}).isotope( 'reloadItems' ).isotope();
203                            $(window).trigger( 'resize' );
204                        }
205
206                        if( parseInt( $page ) >= parseInt( $mpages ) ) {
207                            $T.find('.loadmore-elementor-btn').removeClass('more-items').html('All Posts Loaded');
208                        } else {
209                            $T.find('.loadmore-elementor-btn').addClass('more-items');
210                        }
211                    }
212                    $content.removeClass('loading');
213                 },
214                 error: function (jqXHR, textStatus, errorThrown) {
215                    $content.html('No More Posts Found');
216                 }
217              });
218              return false;
219            });
220
221            // WHen window scroll...
222            $(window).scroll(function(){
223                var $c = $T.find('.infinite-elementor-btn.more-items');
224
225                var ST = $(window).scrollTop();
226                var DH = $(document).height();
227                var WH = $(window).height();
228
229                if( ( parseInt(ST) == parseInt(DH) - parseInt(WH) ) && $c.length > 0 ){
230
231                    var $count = $c.attr('data-count'), $cats = $c.attr('data-cats'), $style = $c.attr('data-style'), $layout = $c.attr('data-layout'),
232                    $column = $c.attr('data-column'), $list_type = $c.attr('data-listtype'), $hover = $c.attr('data-hover'),
233                    $overlay = $c.attr('data-overlay'), $align = $c.attr('data-align'), $mpages = $c.attr('data-maxpage'),
234                    $pos = $c.attr('data-pos'), $eheight = $c.attr('data-eheight'), $meta = $c.attr('data-meta'),
235                    $blogpostloadmore_nonce = $c.attr('data-blogpostloadmore-nonce'), $settings = $c.attr('data-settings');
236
237                    if( $meta != '' ) {
238                        $meta = JSON.parse( $meta );
239                    }
240
241                    $content.addClass('loading');
242
243                    $page++;
244
245                    $.ajax({
246                       type : "post",
247                       dataType : "html",
248                       url : agni_urls.ajaxurl,
249                       data : { action: "blog_elementor_sc_load_more_post", count: $count, cats: $cats, pos: $pos, style: $style, layout: $layout, column: $column, pageNumber: $page, listtype: $list_type, hover: $hover, overlay: $overlay, align: $align, meta: $meta, blogpostloadmore_nonce: $blogpostloadmore_nonce, settings: $settings },
250                       cache: true,
251                       success: function (data) {
252                          var $res = data.split('#####$$$$$');
253                          if ( $res.length > 0 ) {
254
255                              $content.append($res[0]);
256                              $T.find('.infinite-elementor-btn').attr('data-pos', $res[1]);
257
258                              var newbx = $content.find('ul.entry-gallery-post-slider');
259                              if( newbx !== null ) {
260                                  newbx.bxSlider({mode: 'fade', auto:false, video:true, pager:'', autoHover:true, adaptiveHeight:false, responsive: true});
261                              }
262
263                              if( $eheight == null || $eheight == false ) {
264                                  $content.css({overflow:'hidden'}).isotope( 'reloadItems' ).isotope();
265                                  $(window).trigger( 'resize' );
266                              }
267
268                              if( parseInt( $page ) >= parseInt( $mpages ) ) {
269                                  $c.removeClass('more-items');
270                              }
271                          }
272                          $content.removeClass('loading');
273                       },
274                       error: function (jqXHR, textStatus, errorThrown) {
275                          $content.html('No More Posts Found');
276                       }
277                    });
278                    return false;
279                }
280            });
281		});
282	};
283
284    $(window).on('elementor/frontend/init', function(){
285		elementorFrontend.hooks.addAction('frontend/element_ready/wdt-blog-posts.default', dtBlogPosts);
286    });
287
288} )( jQuery );

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.