function listingExtend(extend){var more=$('#listing-tabs .active .show-more');if(!more.hasClass('hidden')){more.addClass('hidden');var tab=$('#listing-tabs>.active').attr('id');var name=tab.substring(8,tab.length);if(name!='trending'){var count=$('#'+tab+' .row .text-center').children('.video-card').length;var last=$('#'+tab+' .row .text-center:last-child .video-card-id').text();var url=window.location.href;if(window.location.href.slice(-1)=='/')url=url+'extend/';else url=url+'/extend/';$.post(url,{'csrfmiddlewaretoken':Cookies.get('csrftoken'),'name':name,'offset':count,'last':last},function(result){if(result.success){$('#'+tab+' .row').append(result.html);spaAttachEvents();playlistAttachEvents();$('[data-toggle="tooltip"]').tooltip({container:'body',trigger:'hover'});if($('#'+tab+' .row .text-center').children('.video-card').length==count+extend)more.removeClass('hidden');}});}}}