1/* global penciBlock */ 2/* global penciBlocksArray */ 3jQuery(document).ready(function ($) { 4 var offset; 5 jQuery('body').on('click', '.penci-ajax-more-click .penci-ajax-more-button', function (event) { 6 event.preventDefault(); 7 if (!$(this).hasClass('loading-posts')) { 8 var $this = $(this), 9 layout = $this.data('layout'), 10 ppp = $this.data('number'), 11 mes = $this.data('mes'), 12 offset = $(this).attr('data-offset'), 13 exclude = $this.data('exclude'), 14 from = $this.data('from'), 15 comeFrom = $this.data('come_from'), 16 mixed = $this.data('mixed'), 17 query = $this.data('query'), 18 infeedads = $this.data('infeedads'), 19 number = $this.data('number'), 20 query_type = $this.data('query_type'), 21 archivetype = $this.data('archivetype'), 22 archivevalue = $this.data('archivevalue'), 23 archiveorder = $this.data('order'), 24 tag = $this.data('tag'), 25 cat = $this.data('cat'), 26 author = $this.data('author'), 27 template = $this.data('template'); 28 29 $this.addClass('loading-posts'); 30 31 var OBjBlockData = penciGetOBjBlockData($this.attr('data-blockuid')), 32 dataFilter = OBjBlockData.atts_json ? JSON.parse(OBjBlockData.atts_json) : OBjBlockData.atts_json; 33 34 var data = { 35 action: 'penci_more_post_ajax', 36 query: query, 37 offset: offset, 38 mixed: mixed, 39 layout: layout, 40 exclude: exclude, 41 from: from, 42 comefrom: comeFrom, 43 datafilter: dataFilter, 44 template: template, 45 ppp: ppp, 46 tag: tag, 47 author: author, 48 cat: cat, 49 number: number, 50 infeedads: infeedads, 51 query_type: query_type, 52 archivetype: archivetype, 53 archivevalue: archivevalue, 54 order: archiveorder, 55 //nonce: penci_ajax_more_posts.nonce, 56 }; 57 58 59 $.ajax({ 60 type: "POST", 61 dataType: "html", 62 url: ajax_var_more.url, 63 data: data, 64 success: function (data) { 65 if (data) { 66 var data_offset = parseInt(offset) + ppp, 67 $wrap_content = $this.parent().parent().find('.penci-wrapper-data'); 68 69 $this.attr('data-offset', data_offset); 70 if (layout === 'masonry' || layout === 'masonry-2') { 71 var $data = $(data); 72 $wrap_content.append($data).isotope('appended', $data).imagesLoaded(function () { 73 $wrap_content.isotope('layout'); 74 }); 75 76 $(".container").fitVids(); 77 78 if ($().easyPieChart) { 79 $('.penci-piechart').each(function () { 80 var $this = $(this); 81 $this.one('inview', function (event, isInView, visiblePartX, visiblePartY) { 82 var chart_args = { 83 barColor: $this.data('color'), 84 trackColor: $this.data('trackcolor'), 85 scaleColor: false, 86 lineWidth: $this.data('thickness'), 87 size: $this.data('size'), 88 animate: 1000 89 }; 90 $this.easyPieChart(chart_args); 91 }); // bind inview 92 }); // each 93 } 94 95 //lazySizes.init(); 96 97 } else { 98 var $data = $(data); 99 $wrap_content.append($data); 100 101 //lazySizes.init(); 102 103 $(".container").fitVids(); 104 105 if ($().easyPieChart) { 106 $('.penci-piechart').each(function () { 107 var $this = $(this); 108 $this.one('inview', function (event, isInView, visiblePartX, visiblePartY) { 109 var chart_args = { 110 barColor: $this.data('color'), 111 trackColor: $this.data('trackcolor'), 112 scaleColor: false, 113 lineWidth: $this.data('thickness'), 114 size: $this.data('size'), 115 animate: 1000 116 }; 117 $this.easyPieChart(chart_args); 118 }); // bind inview 119 }); // each 120 } 121 122 var $justified_gallery = $('.penci-post-gallery-container.justified'); 123 var $masonry_gallery = $('.penci-post-gallery-container.masonry'); 124 if ($().justifiedGallery && $justified_gallery.length) { 125 $('.penci-post-gallery-container.justified').each(function () { 126 var $this = $(this); 127 $this.justifiedGallery({ 128 rowHeight: $this.data('height'), 129 lastRow: 'nojustify', 130 margins: $this.data('margin'), 131 randomize: false 132 }); 133 }); // each .penci-post-gallery-container 134 } 135 136 if ($().isotope && $masonry_gallery.length) { 137 138 $('.penci-post-gallery-container.masonry .item-gallery-masonry').each(function () { 139 var $this = $(this); 140 if ($this.attr('title')) { 141 var $title = $this.attr('title'); 142 $this.children().append('<div class="caption">' + $title + '</div>'); 143 } 144 }); 145 } 146 147 if ($masonry_gallery.length) { 148 $masonry_gallery.each(function () { 149 var $this = $(this); 150 $this.imagesLoaded(function () { 151 // initialize isotope 152 $this.isotope({ 153 itemSelector: '.item-gallery-masonry', 154 transitionDuration: '.55s', 155 layoutMode: 'masonry' 156 }); 157 158 $this.addClass('loaded'); 159 160 $('.penci-post-gallery-container.masonry .item-gallery-masonry').each(function () { 161 var $this = $(this); 162 $this.one('inview', function (event, isInView, visiblePartX, visiblePartY) { 163 $this.addClass('animated'); 164 }); // inview 165 }); // each 166 }); 167 }); 168 } 169 170 if ($().theiaStickySidebar) { 171 var top_margin = 90; 172 if ($('body').hasClass('admin-bar')) { 173 top_margin = 122; 174 } 175 $('#main.penci-main-sticky-sidebar, #sidebar.penci-sticky-sidebar').theiaStickySidebar({ 176 // settings 177 additionalMarginTop: top_margin 178 }); 179 } // if sticky 180 } 181 182 $this.removeClass('loading-posts'); 183 $('body').trigger( 'penci_swiper_sliders' ); 184 $(document).trigger('penci_bf_check'); 185 186 } else { 187 $this.find(".ajax-more-text").text(mes); 188 $this.find("i").remove(); 189 $this.removeClass('loading-posts'); 190 setTimeout(function () { 191 $this.parent().remove(); 192 }, 1200); 193 } 194 }, 195 error: function (jqXHR, textStatus, errorThrown) { 196 console.log(jqXHR + " :: " + textStatus + " :: " + errorThrown); 197 } 198 199 }); 200 } 201 }); 202 203 function penciGetOBjBlockData($blockID) { 204 var $obj = new penciBlock(); 205 206 jQuery.each(penciBlocksArray, function (index, block) { 207 208 if (block.blockID === $blockID) { 209 $obj = penciBlocksArray[index]; 210 } 211 }); 212 213 return $obj; 214 }; 215});
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.