1(function ($) { 2$.fn.ednDynamicArticleLoader = function (settings) { 3 return this.each(function(i, el) { 4 var startingArticle = settings.startingArticle, 5 $articlesContainer = $(el), 6 $triggerWrapper = $(settings.triggerWrapperSelector), 7 $returnHtml = $('> .trigger > .actionTextContainer > span', $triggerWrapper), 8 $window = $(window), 9 $document = $(document), 10 11 requestInProgress = false, 12 allArticlesLoaded = false, 13 isotopeLayout = $.fn.isotope && $articlesContainer.parent().hasClass('edn_isotopeLayout'), 14 15 getMoreArticles = function () { 16 if (requestInProgress || allArticlesLoaded) 17 return false; 18 19 requestInProgress = true; 20 21 $.ajax({ 22 data: $.extend({}, settings.params, {startingArticle: startingArticle}), 23 dataType: 'json', 24 success: function (response) { 25 var $newHtml, 26 isotopeItems = []; 27 28 $newHtml = $(response.content).appendTo($articlesContainer); 29 30 if (isotopeLayout) { 31 $newHtml.each(function () { 32 if ($(this).hasClass('edn_articleWrapper')) 33 isotopeItems.push(this); 34 }); 35 36 $articlesContainer.isotope('insert', isotopeItems); 37 } 38 39 startingArticle = startingArticle + settings.numberOfPostsperPage; 40 41 if (response.itemsRemaining < 1) 42 allArticlesLoaded = true; 43 44 if (response.itemsRemaining < 1) 45 $triggerWrapper.addClass('hide'); 46 47 $returnHtml.html(response.newActionText); 48 49 if (settings.addThis && window.st) { 50 window.st.initialize() 51 } 52 53 if (settings.initCaptcha && window.edsgg_recaptchaCallback) { 54 window.edsgg_recaptchaCallback(); 55 } 56 57 $('.edNews__secondaryArticleList_' + settings.moduleId) 58 .append(response.secondaryListContent) 59 .map(function () { 60 $(this).parents('.edNews__secondaryArticleList').eq(0).data('plugin_eds_tinyscrollbar').update('relative'); 61 }); 62 }, 63 complete: function () { 64 var $imgs, 65 imageLoadedKey = 'imageLoaded'; 66 67 requestInProgress = false; 68 69 $triggerWrapper.removeClass('loading'); 70 $('.rateit').rateit(); 71 72 if (isotopeLayout) { 73 $imgs = $('img', $articlesContainer); 74 75 if ($imgs.length != 0) 76 $imgs.imagesLoaded() 77 .progress(function (instance, image) { 78 var $img = $(image.img); 79 80 if ($img.data(imageLoadedKey)) 81 return; 82 83 $img.data(imageLoadedKey, true); 84 85 $articlesContainer.isotope('layout'); 86 }); 87 88 $articlesContainer.isotope('layout'); 89 } 90 91 $articlesContainer.trigger('contentLoaded'); 92 if (typeof eds__edn__linksviewcount != 'undefined') { 93 eds__edn__linksviewcount(settings.moduleId); 94 } 95 }, 96 url: settings.sourceUrl 97 }); 98 99 return true; 100 }; 101 102 $('> .trigger', $triggerWrapper).on('click', function () { 103 if (getMoreArticles()) 104 $triggerWrapper.addClass('loading'); 105 106 return false; 107 }); 108 109 if (settings.triggerOnScroll) { 110 $window.scroll(function () { 111 var pixelsToBottom = $document.height() - $window.scrollTop() - $window.height(); 112 113 if (pixelsToBottom < 1000 && getMoreArticles()) 114 $triggerWrapper.addClass('loading'); 115 }); 116 } 117 }); 118}; 119})(eds3_5_jq);
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.