PageSourceSearch

https://www.newsx.com/wp-content/themes/soledad/js/ajax-filter-fcat.js?ver=8.6.5

js newsx.com collected 2026-09-24 08:52:05 UTC 11,532 bytes, 264 lines download raw bytes

1jQuery(document).ready(function ($) {
2    $('.penci-featured-cat-sc').each(function () {
3        if ($(this).find('.pcflx-nav').length > 0) {
4            var maxnum = $(this).find('.pcflx li.all a').attr('data-maxp');
5            if (parseInt(maxnum) <= 1) {
6                $(this).find('.pcflx-nav .pcaj-nav-link').addClass('disable');
7            }
8        }
9    });
10    jQuery('body').on('click', '.penci-featured-cat-sc .pc-ajaxfil-link', function (event) {
11        event.preventDefault();
12        if (!$(this).hasClass('loading-posts')) {
13            var $this = $(this),
14                $navthis = $this,
15                wrapId = $this.data('id'),
16                parentclass = $(this).closest('.pcnav-lgroup'),
17                wrapper = $(this).closest('.penci-featured-cat-sc').find('.home-featured-cat-wrapper'),
18                tag = $this.data('tag'),
19                cat = $this.data('cat'),
20                author = $this.data('author'),
21                navlink = false,
22                prev,
23                pagednum = parseInt($this.attr('data-paged')),
24                curpaged = pagednum,
25                dataFilter,
26                $wrap_content_id = wrapper.find('.pwf-id-' + wrapId),
27                OBjBlockData = penciGetOBjBlockData(parentclass.data('blockid'));
28
29            if (OBjBlockData.atts_json) {
30                var sanitizedJsonString = OBjBlockData.atts_json.replace(/[\u0000-\u001F]/g, '');
31                
32                try {
33                    dataFilter = JSON.parse(sanitizedJsonString);
34                } catch (e) {
35                    console.error("Error parsing JSON:", e);
36                }
37            } else {
38                dataFilter = OBjBlockData.atts_json;
39            }
40
41            $this.addClass('loading-posts');
42
43            wrapper.addClass('loading-posts pcftaj-ld');
44
45            if ($this.hasClass('pcaj-nav-link')) {
46                navlink = true;
47            }
48
49            if (navlink && $this.hasClass('prev')) {
50                prev = true;
51            }
52
53            if (navlink) {
54                $this = parentclass.find('.current-item');
55                wrapId = $this.data('id');
56                cat = $this.data('cat');
57                tag = $this.data('tag');
58
59                curpaged = parseInt($this.attr('data-paged'));
60
61
62                if (prev) {
63                    pagednum = curpaged - 1;
64                } else {
65                    pagednum = curpaged + 1;
66                }
67            }
68
69            if (!navlink) {
70                parentclass.find('.pc-ajaxfil-link').removeClass('current-item');
71                $this.addClass('current-item');
72            }
73
74            if ($wrap_content_id.length && !navlink) {
75                wrapper.find('.home-featured-cat-content').hide();
76                wrapper.find('.pwf-id-' + wrapId).show();
77                wrapper.removeClass('loading-posts pcftaj-ld');
78                $this.removeClass('loading-posts');
79                $navthis.removeClass('loading-posts');
80
81                if (curpaged <= 1) {
82                    parentclass.find('.pc-ajaxfil-link.prev').addClass('disable');
83                } else {
84                    parentclass.find('.pc-ajaxfil-link.prev').removeClass('disable');
85                }
86
87                var maxp = undefined;
88                if (wrapId == 'default') {
89                    maxp = parentclass.find('li.all .pc-ajaxfil-link').attr('data-maxp');
90                }
91
92                if ($wrap_content_id.hasClass('pc-nomorepost') || parseInt(maxp) <= 1) {
93                    parentclass.find('.pc-ajaxfil-link.next').addClass('disable');
94                } else {
95                    parentclass.find('.pc-ajaxfil-link.next').removeClass('disable');
96                }
97
98                var o = 0;
99                $wrap_content_id.find('.hentry').each(function () {
100                    o++;
101                    $(this).addClass('penci-ajrs-animate').attr('style', 'animation-delay:' + o / 10 + 's')
102                });
103
104            } else {
105
106                var data = {
107                    action: 'penci_more_featured_post_ajax',
108                    datafilter: dataFilter,
109                    id: wrapId,
110                    tag: tag,
111                    cat: cat,
112                    author: author,
113                    pagednum: pagednum,
114                    nonce: pcfcat_ajax.nonce,
115                };
116
117                $.ajax({
118                    type: "POST",
119                    dataType: "html",
120                    url: ajax_var_more.url,
121                    data: data,
122                    success: function (data) {
123                        if (data) {
124
125                            var data_paded = curpaged;
126
127                            if (navlink) {
128                                wrapper.find('.pwf-id-' + wrapId).remove();
129                                data_paded = curpaged + 1;
130                            }
131
132                            if (prev) {
133                                data_paded = curpaged - 1;
134                            }
135
136                            if (data_paded <= 1) {
137                                parentclass.find('.pc-ajaxfil-link.prev').addClass('disable');
138                            } else {
139                                parentclass.find('.pc-ajaxfil-link.prev').removeClass('disable');
140                            }
141
142                            wrapper.append(data);
143
144                            if ($('.pwf-id-' + wrapId).hasClass('pc-nomorepost')) {
145                                parentclass.find('.pc-ajaxfil-link.next').addClass('disable');
146                            } else {
147                                parentclass.find('.pc-ajaxfil-link.next').removeClass('disable');
148                            }
149
150                            $this.attr('data-paged', data_paded);
151
152
153                            $(".home-featured-cat-wrapper").fitVids();
154
155                            $('body').trigger( 'penci_swiper_sliders' );
156
157                            if ($().easyPieChart) {
158                                $('.penci-piechart').each(function () {
159                                    var $this = $(this);
160                                    $this.one('inview', function (event, isInView, visiblePartX, visiblePartY) {
161                                        var chart_args = {
162                                            barColor: $this.data('color'),
163                                            trackColor: $this.data('trackcolor'),
164                                            scaleColor: false,
165                                            lineWidth: $this.data('thickness'),
166                                            size: $this.data('size'),
167                                            animate: 1000
168                                        };
169                                        $this.easyPieChart(chart_args);
170                                    }); // bind inview
171                                }); // each
172                            }
173
174                            var $justified_gallery = $('.penci-post-gallery-container.justified');
175                            var $masonry_gallery = $('.penci-post-gallery-container.masonry');
176                            if ($().justifiedGallery && $justified_gallery.length) {
177                                $('.penci-post-gallery-container.justified').each(function () {
178                                    var $this = $(this);
179                                    $this.justifiedGallery({
180                                        rowHeight: $this.data('height'),
181                                        lastRow: 'nojustify',
182                                        margins: $this.data('margin'),
183                                        randomize: false
184                                    });
185                                }); // each .penci-post-gallery-container
186                            }
187
188                            if ($().isotope && $masonry_gallery.length) {
189
190                                $('.penci-post-gallery-container.masonry .item-gallery-masonry').each(function () {
191                                    var $this = $(this);
192                                    if ($this.attr('title')) {
193                                        var $title = $this.attr('title');
194                                        $this.children().append('<div class="caption">' + $title + '</div>');
195                                    }
196                                });
197                            }
198
199                            if ($masonry_gallery.length) {
200                                $masonry_gallery.each(function () {
201                                    var $this = $(this);
202                                    $this.imagesLoaded(function () {
203                                        // initialize isotope
204                                        $this.isotope({
205                                            itemSelector: '.item-gallery-masonry',
206                                            transitionDuration: '.55s',
207                                            layoutMode: 'masonry'
208                                        });
209
210                                        $this.addClass('loaded');
211
212                                        $('.penci-post-gallery-container.masonry .item-gallery-masonry').each(function () {
213                                            var $this = $(this);
214                                            $this.one('inview', function (event, isInView, visiblePartX, visiblePartY) {
215                                                $this.addClass('animated');
216                                            }); // inview
217                                        }); // each
218                                    });
219                                });
220                            }
221
222                            if ($().theiaStickySidebar) {
223                                var top_margin = 90;
224                                if ($('body').hasClass('admin-bar')) {
225                                    top_margin = 122;
226                                }
227                                $('#main.penci-main-sticky-sidebar, #sidebar.penci-sticky-sidebar').theiaStickySidebar({
228                                    // settings
229                                    additionalMarginTop: top_margin
230                                });
231                            } // if sticky
232
233                            wrapper.find('.home-featured-cat-content').hide();
234                            wrapper.find('.pwf-id-' + wrapId).show();
235                            wrapper.removeClass('loading-posts pcftaj-ld');
236                            $this.removeClass('loading-posts');
237                            $navthis.removeClass('loading-posts');
238                            $(document).trigger('penci_bf_check');
239
240                            var o = 0;
241                            wrapper.find('.pwf-id-' + wrapId + ' .hentry').each(function () {
242                                o++;
243                                $(this).addClass('penci-ajrs-animate').attr('style', 'animation-delay:' + o / 10 + 's')
244                            });
245                        }
246                    }
247                });
248            }
249        }
250    });
251
252    function penciGetOBjBlockData($blockID) {
253        var $obj = new penciBlock();
254
255        jQuery.each(penciBlocksArray, function (index, block) {
256
257            if (block.blockID === $blockID) {
258                $obj = penciBlocksArray[index];
259            }
260        });
261
262        return $obj;
263    }
264});

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.