PageSourceSearch

https://powerledger.io/wp-content/plugins/tfposts/assets/js/tf-main.js?ver=7.1.2

js powerledger.io collected 2026-09-24 09:57:07 UTC 4,725 bytes, 131 lines download raw bytes

1;(function($) {
2
3    "use strict";
4
5    var blogPostsOwl = function() {
6    	if ( $().owlCarousel ) {
7            $('.tf-posts-wrap.has-carousel').each(function(){
8                var
9                $this = $(this),
10                item = $this.data("column"),
11                item2 = $this.data("column2"),
12                item3 = $this.data("column3"),
13                spacer = Number($this.data("spacer")),
14                prev_icon = $this.data("prev_icon"),
15                next_icon = $this.data("next_icon");
16
17                var loop = false;
18                if ($this.data("loop") == 'yes') {
19                	loop = true;
20                }
21
22                var arrow = false;
23                if ($this.data("arrow") == 'yes') {
24                	arrow = true;
25                } 
26
27                var auto = false;
28                if ($this.data("auto") == 'yes') {
29                	auto = true;
30                }                
31
32                $this.find('.owl-carousel').owlCarousel({
33                    loop: loop,
34                    margin: spacer,
35                    nav: true,
36                    pagination: false,
37                    autoplay: auto,
38                    autoplayTimeout: 5000,
39                    autoplayHoverPause: true,
40                    animateIn: 'fadeIn',
41              		animateOut: 'fadeOut',
42                    navText : ["<i class=\""+prev_icon+"\"></i>","<i class=\""+next_icon+"\"></i>"],
43                    responsive: {
44                        0:{
45                            items:item3
46                        },
47                        768:{
48                            items:item2
49                        },
50                        1000:{
51                            items:item
52                        }
53                    }
54                });
55
56            });
57        }
58    }
59
60    var blogLoadMore = function() {
61
62        var $container_wrap = $('.tf-posts-wrap'); 
63        var $container = $('.tf-posts-wrap').find('.tf-posts');  
64
65        $('.navigation.loadmore a').on('click', function(e) {
66            e.preventDefault(); 
67
68            $container.after('<div class="tfpost-loading"><span></span></div>');
69
70            $.ajax({
71                type: "GET",
72                url: $(this).attr('href'),
73                dataType: "html",
74                success: function( out ) {
75                    var result = $(out).find('.column');  
76                    var nextlink = $(out).find('.navigation.loadmore a').attr('href');
77
78                    result.css({ opacity: 0 , visibility: 'hidden' });
79                    if ($container.hasClass('masonry')) {
80                        $container.append(result).imagesLoaded(function () {
81                            result.css({ opacity: 1 , visibility: 'visible' });
82                            $container.isotope('appended', result);
83                        });
84                    }
85                    else {
86                    	$container.append(result).imagesLoaded(function () {
87                            result.css({ opacity: 1 , visibility: 'visible' });
88                            $container.isotope('appended', result);
89                        });	                        
90                    }
91
92                    if ( nextlink != undefined ) {
93                        $('.navigation.loadmore a').attr('href', nextlink);
94                        $container_wrap.find('.tfpost-loading').remove();
95                    } else {
96                        $container_wrap.find('.tfpost-loading').addClass('no-ajax').text('All posts loaded').delay(2000).queue(function() {$(this).remove();});
97                        $('.navigation.loadmore a').remove();
98                    }
99                }
100            });
101        });
102             
103    }
104
105    var blogMasonry = function() {
106        $('.tf-posts-wrap .tf-posts').each(function(){
107        	var $this = $(this);
108        	if ($this.hasClass('masonry')) {
109	        	var $grid = $this.isotope({
110					itemSelector: '.column',
111					percentPosition: true,
112					masonry: {
113					columnWidth: '.grid-sizer'
114					}
115				});
116				
117				$grid.imagesLoaded().progress( function() {
118					$grid.isotope('layout');
119				});
120			} 
121        });            
122    }  
123	
124
125    $(window).on('elementor/frontend/init', function() {
126        elementorFrontend.hooks.addAction( 'frontend/element_ready/tfposts.default', blogPostsOwl );
127        elementorFrontend.hooks.addAction( 'frontend/element_ready/tfposts.default', blogLoadMore );
128        elementorFrontend.hooks.addAction( 'frontend/element_ready/tfposts.default', blogMasonry );
129    });
130
131})(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.