1(function($){ 2 3 // get portfolio using ajax 4 function gdlr_portfolio_ajax(port_holder, ajax_info, category, paged){ 5 6 var args = new Object(); 7 args['num-fetch'] = ajax_info.attr('data-num-fetch'); 8 args['num-excerpt'] = ajax_info.attr('data-num-excerpt'); 9 args['order'] = ajax_info.attr('data-order'); 10 args['orderby'] = ajax_info.attr('data-orderby'); 11 args['thumbnail-size'] = ajax_info.attr('data-thumbnail-size'); 12 args['portfolio-style'] = ajax_info.attr('data-port-style'); 13 args['portfolio-size'] = ajax_info.attr('data-port-size'); 14 args['portfolio-layout'] = ajax_info.attr('data-port-layout'); 15 args['category'] = (category)? category: ajax_info.attr('data-category'); 16 args['paged'] = (paged)? paged: 1; 17 18 // hide the un-used elements 19 var animate_complete = false; 20 port_holder.slideUp(500, function(){ 21 animate_complete = true; 22 }); 23 port_holder.siblings('.gdlr-pagination').slideUp(500, function(){ 24 $(this).remove(); 25 }); 26 27 var now_loading = $('<div class="gdlr-now-loading"></div>'); 28 now_loading.insertBefore(port_holder); 29 now_loading.slideDown(); 30 31 // call ajax to get portfolio item 32 $.ajax({ 33 type: 'POST', 34 url: ajax_info.attr('data-ajax'), 35 data: {'action': 'gdlr_get_portfolio_ajax', 'args': args}, 36 error: function(a, b, c){ console.log(a, b, c); }, 37 success: function(data){ 38 now_loading.css('background-image','none').slideUp(function(){ $(this).remove(); }); 39 40 var port_item = $(data).hide(); 41 if( animate_complete ){ 42 gdlr_bind_portfolio_item(port_holder, port_item); 43 }else{ 44 setTimeout(function() { 45 gdlr_bind_portfolio_item(port_holder, port_item); 46 }, 500); 47 } 48 } 49 }); 50 51 } 52 53 function gdlr_bind_portfolio_item(port_holder, port_item){ 54 if( port_holder ){ 55 port_holder.replaceWith(port_item); 56 } 57 port_item.slideDown(); 58 59 // bind events 60 port_item.each(function(){ 61 if( $(this).hasClass('gdlr-pagination') ){ 62 $(this).children().gdlr_bind_portfolio_pagination(); 63 } 64 }); 65 port_item.gdlr_fluid_video(); 66 port_item.find('.gdlr-portfolio-item').gdlr_portfolio_hover(); 67 port_item.find('.flexslider').gdlr_flexslider(); 68 port_item.find('.gdlr-isotope').gdlr_isotope(); 69 port_item.find('[data-rel="fancybox"]').gdlr_fancybox(); 70 71 if( port_item.closest('.gdlr-portfolio-link-lightbox').length > 0 ){ 72 port_item.find('a[data-lightbox]').click(function(){ 73 $(this).gdlr_portfolio_lightbox(); return false; 74 }); 75 } 76 port_item.find('img').load(function(){ $(window).trigger('resize'); }); 77 } 78 79 $.fn.gdlr_bind_portfolio_pagination = function(){ 80 $(this).click(function(){ 81 if($(this).hasClass('current')) return; 82 var port_holder = $(this).parent('.gdlr-pagination').siblings('.portfolio-item-holder'); 83 var ajax_info = $(this).parent('.gdlr-pagination').siblings('.gdlr-ajax-info'); 84 85 var category = $(this).parent('.gdlr-pagination').siblings('.portfolio-item-filter'); 86 if( category ){ 87 category = category.children('.active').attr('data-category'); 88 } 89 90 gdlr_portfolio_ajax(port_holder, ajax_info, category, $(this).attr('data-paged')); 91 return false; 92 }); 93 } 94 95 $.fn.gdlr_portfolio_hover = function(){ 96 $(this).each(function(){ 97 var port_item = $(this); 98 99 $(this).find('.portfolio-thumbnail').hover(function(){ 100 $(this).children('img').transition({ scale: 1.1, duration: 200 }); 101 $(this).find('.portfolio-overlay-wrapper').animate({opacity: 1}, 200); 102 }, function(){ 103 $(this).children('img').transition({ scale: 1, duration: 200 }); 104 $(this).find('.portfolio-overlay-wrapper').animate({opacity: 0}, 200); 105 }); 106 }); 107 } 108 109 $(document).ready(function(){ 110 111 // script for portfolio item 112 $('.gdlr-portfolio-item').gdlr_portfolio_hover(); 113 114 // script for calling ajax portfolio when selecting category 115 $('.portfolio-item-filter a').click(function(){ 116 if($(this).hasClass('active')) return false; 117 $(this).addClass('active').siblings().removeClass('active'); 118 119 var port_holder = $(this).parent('.portfolio-item-filter').siblings('.portfolio-item-holder'); 120 var ajax_info = $(this).parent('.portfolio-item-filter').siblings('.gdlr-ajax-info'); 121 122 gdlr_portfolio_ajax(port_holder, ajax_info, $(this).attr('data-category')); 123 return false; 124 }); 125 126 // script for calling ajax portfolio when using pagination 127 $('.gdlr-pagination.gdlr-ajax .page-numbers').gdlr_bind_portfolio_pagination(); 128 }); 129 130})(jQuery);
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.