1/* global penciBlock */ 2/* global penciBlocksArray */ 3jQuery(document).ready(function ($) { 4 var nav = []; 5 $('.penci-biggrid-wrapper').each(function () { 6 var t = $(this), 7 elID = t.attr('id'), 8 c = 'li.all .pc-ajaxfil-link', 9 datamax = t.find('.penci-biggrid-inner.default .penci-biggrid-data').data('maxp'); 10 11 if (t.find(c).length) { 12 t.find(c).attr('data-maxp', datamax); 13 } 14 15 if (parseInt(datamax) <= 1) { 16 $(this).find('.pcflx-nav .pcaj-nav-link').addClass('disable'); 17 } 18 19 if (t.find('.penci-ajax-more').length) { 20 nav[elID] = t.find('.penci-ajax-more').prop('outerHTML'); 21 } 22 }); 23 24 jQuery('body').on('click', '.penci-biggrid-wrapper .pc-ajaxfil-link', function (event) { 25 event.preventDefault(); 26 if (!$(this).hasClass('loading-posts')) { 27 var $this = $(this), 28 parentID = $(this).closest('.penci-biggrid-wrapper').attr('id'), 29 $navthis = $this, 30 divid = $this.data('id'), 31 divc = 'penci-biggrid-tab-' + divid, 32 parent = $this.closest('.pcnav-lgroup'), 33 settings = parent.data('settings'), 34 layout = parent.data('layout'), 35 query_type = parent.data('query_type'), 36 arppp = parent.data('number'), 37 cat = $this.data('cat'), 38 tag = $this.data('tag'), 39 author = $this.data('author'), 40 wrap_content = $this.closest('.penci-biggrid-wrapper').find('.penci-biggrid'), 41 mainc = wrap_content.find('.penci-biggrid-data').attr('class'), 42 pagednum = parseInt($this.attr('data-paged')), 43 curpaged = pagednum, 44 navlink = false, 45 prev = false, 46 o = 0; 47 48 if ($this.hasClass('pcaj-nav-link')) { 49 navlink = true; 50 } 51 52 if (navlink && $this.hasClass('prev')) { 53 prev = true; 54 } 55 56 if (navlink) { 57 $this = parent.find('.current-item'); 58 divid = $this.data('id'); 59 divc = 'penci-biggrid-tab-' + divid; 60 cat = $this.data('cat'); 61 tag = $this.data('tag'); 62 curpaged = parseInt($this.attr('data-paged')); 63 64 if (prev) { 65 pagednum = curpaged - 1; 66 } else { 67 pagednum = curpaged + 1; 68 } 69 } 70 71 $this.addClass('loading-posts'); 72 wrap_content.addClass('loading-posts pcftaj-ld'); 73 parent.find('.pc-ajaxfil-link').removeClass('current-item'); 74 $this.addClass('current-item'); 75 76 if (divid === 'default' && !navlink) { 77 wrap_content.find('.penci-biggrid-inner').hide(); 78 wrap_content.find('.penci-biggrid-inner.default').show(); 79 wrap_content.removeClass('loading-posts pcftaj-ld'); 80 $this.removeClass('loading-posts'); 81 $navthis.removeClass('loading-posts'); 82 83 var maxp = $(this).attr('data-maxp'); 84 85 wrap_content.find('.penci-biggrid-inner.default .penci-bgitem').each(function () { 86 o++; 87 $(this).addClass('penci-ajrs-animate').attr('style', 'animation-delay:' + o / 10 + 's') 88 }); 89 90 if (pagednum <= 1) { 91 parent.find('.pc-ajaxfil-link.prev').addClass('disable'); 92 } else { 93 parent.find('.pc-ajaxfil-link.prev').removeClass('disable'); 94 } 95 96 if ($('.' + divc).find('.pc-nomorepost').length || parseInt(maxp) <= 1) { 97 parent.find('.pc-ajaxfil-link.next').addClass('disable'); 98 } else { 99 parent.find('.pc-ajaxfil-link.next').removeClass('disable'); 100 } 101 102 } else if (wrap_content.find('.' + divc).length && !navlink) { 103 wrap_content.find('.penci-biggrid-inner').hide(); 104 wrap_content.find('.' + divc).show(); 105 wrap_content.removeClass('loading-posts pcftaj-ld'); 106 $this.removeClass('loading-posts'); 107 $navthis.removeClass('loading-posts'); 108 wrap_content.find('.' + divc + ' .penci-bgitem').each(function () { 109 o++; 110 $(this).addClass('penci-ajrs-animate').attr('style', 'animation-delay:' + o / 10 + 's') 111 }); 112 113 if (pagednum <= 1) { 114 parent.find('.pc-ajaxfil-link.prev').addClass('disable'); 115 } else { 116 parent.find('.pc-ajaxfil-link.prev').removeClass('disable'); 117 } 118 119 if ($('.' + divc).find('.pc-nomorepost').length) { 120 parent.find('.pc-ajaxfil-link.next').addClass('disable'); 121 } else { 122 parent.find('.pc-ajaxfil-link.next').removeClass('disable'); 123 } 124 125 } else { 126 127 var data = { 128 action: 'penci_bgmore_post_ajax', 129 settings: settings, 130 layout: layout, 131 pagednum: pagednum, 132 query_type: query_type, 133 cat: cat, 134 tag: tag, 135 author: author, 136 qtype: 'ajaxtab', 137 arppp: arppp, 138 nonce: pcfilterbg_ajax.nonce, 139 }; 140 141 $.ajax({ 142 type: "POST", 143 dataType: "html", 144 url: ajax_var_more.url, 145 data: data, 146 success: function (data) { 147 if (data) { 148 var data_paded = curpaged; 149 150 if (navlink) { 151 wrap_content.find('.' + divc).remove(); 152 data_paded = curpaged + 1; 153 } 154 155 if (prev) { 156 data_paded = curpaged - 1; 157 } 158 159 wrap_content.append('<div class="penci-biggrid-inner ' + divc + '"><div class="' + mainc + '"></div></div>'); 160 161 if (data_paded <= 1) { 162 parent.find('.pc-ajaxfil-link.prev').addClass('disable'); 163 } else { 164 parent.find('.pc-ajaxfil-link.prev').removeClass('disable'); 165 } 166 167 if (nav[parentID] !== undefined) { 168 wrap_content.find('.' + divc).append($(nav[parentID])); 169 wrap_content.find('.' + divc + ' .penci-ajax-more .penci-ajax-more-button') 170 .removeAttr('data-cat') 171 .removeAttr('data-tag') 172 .removeAttr('data-author'); 173 if (cat) { 174 wrap_content.find('.' + divc + ' .penci-ajax-more .penci-ajax-more-button').attr('data-cat', cat); 175 } 176 if (tag) { 177 wrap_content.find('.' + divc + ' .penci-ajax-more .penci-ajax-more-button').attr('data-tag', tag); 178 } 179 if (author) { 180 wrap_content.find('.' + divc + ' .penci-ajax-more .penci-ajax-more-button').attr('data-author', author); 181 } 182 wrap_content.find('.' + divc + ' .penci-ajax-more .penci-ajax-more-button').attr('data-pagednum', data_paded + 1); 183 wrap_content.find('.' + divc + ' .penci-ajax-more .penci-ajax-more-button').attr('data-paged', data_paded + 1); 184 } 185 186 $this.attr('data-paged', data_paded); 187 188 if (layout === 'style-2') { 189 190 wrap_content.find('.' + divc + ' .penci-biggrid-data').append(data).imagesLoaded(function () { 191 wrap_content.find('.' + divc + ' .penci-biggrid-data').isotope({ 192 itemSelector: '.item-masonry', 193 transitionDuration: '.55s', 194 layoutMode: 'masonry' 195 }); 196 }); 197 198 if ($().easyPieChart) { 199 $('.penci-piechart').each(function () { 200 var $this = $(this); 201 $this.one('inview', function (event, isInView, visiblePartX, visiblePartY) { 202 var chart_args = { 203 barColor: $this.data('color'), 204 trackColor: $this.data('trackcolor'), 205 scaleColor: false, 206 lineWidth: $this.data('thickness'), 207 size: $this.data('size'), 208 animate: 1000 209 }; 210 $this.easyPieChart(chart_args); 211 }); // bind inview 212 }); // each 213 } 214 } else { 215 wrap_content.find('.' + divc + ' .penci-biggrid-data').append(data); 216 217 if ($().easyPieChart) { 218 $('.penci-piechart').each(function () { 219 var $this = $(this); 220 $this.one('inview', function (event, isInView, visiblePartX, visiblePartY) { 221 var chart_args = { 222 barColor: $this.data('color'), 223 trackColor: $this.data('trackcolor'), 224 scaleColor: false, 225 lineWidth: $this.data('thickness'), 226 size: $this.data('size'), 227 animate: 1000 228 }; 229 $this.easyPieChart(chart_args); 230 }); // bind inview 231 }); // each 232 } 233 } 234 235 if ($('.' + divc).find('.pc-nomorepost').length) { 236 parent.find('.pc-ajaxfil-link.next').addClass('disable'); 237 } else { 238 parent.find('.pc-ajaxfil-link.next').removeClass('disable'); 239 } 240 241 wrap_content.find('.penci-biggrid-inner').hide(); 242 wrap_content.find('.' + divc).show(); 243 wrap_content.removeClass('loading-posts pcftaj-ld'); 244 $this.removeClass('loading-posts'); 245 $navthis.removeClass('loading-posts'); 246 247 var o = 0; 248 wrap_content.find('.' + divc + ' .penci-bgitem').each(function () { 249 o++; 250 $(this).addClass('penci-ajrs-animate').attr('style', 'animation-delay:' + o / 10 + 's') 251 }); 252 $(document).trigger('bgajax_loaded'); 253 $(document).trigger('penci_bf_check'); 254 } else { 255 if (navlink) { 256 parent.find('.pc-ajaxfil-link.next').addClass('disable'); 257 } else { 258 wrap_content.find('.penci-biggrid-inner').hide(); 259 wrap_content.find('.' + divc).append('<div class="pcajx-nopost"><span>No post found !</span></div>'); 260 wrap_content.find('.' + divc).show(); 261 } 262 wrap_content.removeClass('loading-posts pcftaj-ld'); 263 $this.removeClass('loading-posts'); 264 $navthis.removeClass('loading-posts'); 265 } 266 }, 267 error: function (jqXHR, textStatus, errorThrown) { 268 console.log(jqXHR + " :: " + textStatus + " :: " + errorThrown); 269 }, 270 completed: function () { 271 wrap_content.removeClass('loading-posts pcftaj-ld'); 272 $this.removeClass('loading-posts'); 273 $navthis.removeClass('loading-posts'); 274 } 275 }); 276 } 277 } 278 }); 279});
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.