1(function($) { 2 var main_url = $('main.infinite-scroll-update-url').data('permalink'); 3 var main_desc = $('main.infinite-scroll-update-url').data('desc'); 4 var nextlink = $('main.infinite-scroll-update-url').data('next'); 5 $('document').ready(function() { 6 //set canonical 7 // $('link[rel="canonical"]').attr('href', main_url); 8 //set description 9 $('meta[name=description]').attr('content', main_desc); 10 //set next link 11 if (!$('link[rel="next"]').length) { 12 if(nextlink){ 13 $('<link rel="next">').insertAfter('link[rel="canonical"]'); 14 $('link[rel="next"]').attr('href', nextlink); 15 } 16 } else { 17 if(nextlink){ 18 $('link[rel="next"]').attr('href', nextlink); 19 } 20 } //end next link 21 }); //end document ready 22 23 // $(document).on('scroll', function(e) { 24 // $('main.infinite-scroll-update-url').each(function() { 25 // if ($(this).offset().top < window.pageYOffset && 26 // $(this).offset().top + 27 // $(this).height() > window.pageYOffset 28 // ) { 29 // var post_type = $(this).data('type'); 30 // var main_desc2 = $(this).data('desc'); 31 32 // if (window.location.href !== main_url) { 33 // var page = $(this).data('page'); 34 // // var postname = main_url; 35 // var next = parseInt(page) + 1; 36 // var prev = parseInt(page) - 1; 37 // var prevlink = $(this).data('prev'); 38 // var nextlink = $(this).data('next'); 39 // // var current = main_url + 'page/' + page + '/'; 40 41 // //history.pushState('infinite', postname, url); 42 // $('link[rel="canonical"]').attr('href', window.location.href); 43 // $('meta[property="og:url"]').attr('content', window.location.href); 44 // if(post_type == 'article'){ 45 // $('meta[name=description]').attr('content', main_desc2); 46 // } 47 48 49 // if (prevlink) { 50 // if (!$('link[rel="prev"]').length) { 51 // $('<link rel="prev">').insertAfter('link[rel="canonical"]'); 52 // } 53 // $('link[rel="prev"]').attr('href', prevlink); 54 // } else if ($('link[rel="prev"]').length) { 55 // $('link[rel="prev"]').remove(); 56 // } 57 58 // if (nextlink) { 59 // if (!$('link[rel="next"]').length) { 60 // $('<link rel="next">').insertAfter('link[rel="canonical"]'); 61 // } 62 // $('link[rel="next"]').attr('href', nextlink); 63 // } else if ($('link[rel="next"]').length) { 64 // $('link[rel="next"]').remove(); 65 // } 66 67 // } else { 68 // $('link[rel="canonical"]').attr('href', main_url); 69 // $('link[rel="prev"]').remove(); 70 // $('link[rel="next"]').attr('href', nextlink); 71 // if(post_type == 'article'){ 72 // $('meta[name=description]').attr('content', main_desc2); 73 // } 74 // } 75 // }else{ 76 77 // if($(window).scrollTop() + $(window).height() == $(document).height()) { 78 // $('link[rel="next"]').remove(); 79 // } 80 // } 81 // }); 82 // }); 83})($ || jQuery); 84
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.