1"use strict"; 2var gl; 3jQuery(document).ready(function($) { 4 5 if( $("#brick-wrap").length == 0 ){ 6 return; 7 } 8 9 var $container = $("#brick-wrap"); 10 var loading = false; 11 // Masonry 12 $container.imagesLoaded( function() { 13 // This is masonry fix for webkit browsers, so boxes wouldn't reflow 14 // again after page loads. We just disable transition duration, and enable 15 // it again after 1s. 16 $('#brick-wrap .brick, #brick-wrap').css('transition-duration', '0s'); 17 $container.masonry({ 18 // options 19 columnWidth: 5, 20 itemSelector: '.brick', 21 isAnimated: !Modernizr.csstransitions, 22 animationOptions: { 23 duration: 750, 24 easing: 'linear', 25 queue: false 26 } 27 }); 28 setTimeout(function(e){ 29 $('#brick-wrap .brick, #brick-wrap').css('transition-duration', ''); 30 }, 1000); 31 }); 32 33 if( (Pukka.grid_layout.infinite_scroll == "on" && Pukka.grid_layout.current_page == "home") 34 || (Pukka.grid_layout.inner_grid.use_inner_grid == 'on' && Pukka.grid_layout.current_page != "home") ) 35 { 36 $(window).bind('mousewheel wheel', function(e){ 37 $(window).scroll(); 38 }); 39 //IE compatibility 40 var mousewheelevt=(/Firefox/i.test(navigator.userAgent))? "DOMMouseScroll" : "mousewheel" //FF doesn't recognize mousewheel as of FF3.x 41 if(document.attachEvent){ //if IE (and Opera depending on user setting) 42 document.attachEvent("on"+mousewheelevt, function(){ $(window).scroll(); }); 43 } 44 45 /* 46 * had to change this because scroll was not firing if scrollbar was not visible 47 */ 48 $(window).scroll(function(){ 49 if ($(window).scrollTop() >= $(document).height() - $(window).height() - 200){ 50 if ( !Pukka.grid_layout.infinite_more || loading){ 51 return false; 52 }else{ 53 loading = true; 54 loadPosts(Pukka.grid_layout.infinite_page); 55 } 56 Pukka.grid_layout.infinite_page++; 57 } 58 }); 59 } 60 61 62 function loadPosts(pageNumber){ 63 showLoader(); 64 $.ajax({ 65 url: Pukka.ajaxurl, 66 type:'GET', 67 dataType: "json", 68 data: "action=pukka_infinite_scroll&page_no="+ pageNumber +"&grid_params="+ $.param(Pukka.grid_layout), 69 success: function(response){ 70 Pukka.grid_layout.infinite_more = response.load_more; 71 72 //masonry 73 var div = document.createElement('div'); 74 $(div).html(response.content); 75 var bricks = $(div).find('.brick'); 76 $container.append( bricks ).masonry( 'appended', bricks ); 77 78 hideLoader(); 79 loading = false; 80 81 // layout Masonry again after all images have loaded 82 $container.imagesLoaded( function() { 83 $container.masonry(); 84 }); 85 86 $('#wrapper').trigger('content-loaded'); 87 }, 88 complete: hideLoader 89 }); 90 91 return false; 92 } 93 94 function showLoader(){ 95 var loader = '<div class="brick-loader-wrap"><div class="brick-loader-bg"><div class="brick-loader"></div></div></div>'; 96 $('#brick-wrap').append(loader); 97 } 98 99 function hideLoader(){ 100 $('.brick-loader-wrap').fadeOut(300, function(e){ 101 $('.brick-loader-wrap').remove(); 102 }); 103 } 104});
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.