1var articles = $('.articoli-mh'), socialised = { }, win = $(window), updateArticles, onUpdate, updateTimeout; 2 3updateArticles = function() 4{ 5 // viewport bounds 6 var wT = win.scrollTop(), 7 wL = win.scrollLeft(), 8 wR = wL + win.width(), 9 wB = wT + win.height(); 10 // check which articles are visible and socialise! 11 for (var i = 0; i < articles.length; i++) { 12 if (socialised[i]) { 13 continue; 14 } 15 // article bounds 16 var art = $(articles[i]), 17 aT = art.offset().top, 18 aL = art.offset().left, 19 aR = aL + art.width(), 20 aB = aT + art.height(); 21 // vertial point inside viewport 22 if ((aT >= wT && aT <= wB) || (aB >= wT && aB <= wB)) { 23 // horizontal point inside viewport 24 if ((aL >= wL && aL <= wR) || (aR >= wL && aR <= wR)) { 25 socialised[i] = true; 26 Socialite.load(articles[i]); 27 } 28 } 29 } 30}; 31 32onUpdate = function() 33{ 34 if (updateTimeout) { 35 clearTimeout(updateTimeout); 36 } 37 updateTimeout = setTimeout(updateArticles, 100); 38}; 39 40win.on('resize', onUpdate).on('scroll', onUpdate); 41 42setTimeout(updateArticles, 100); 43
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.