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