1jQuery(function($) { 2 3 Socialite.process(); //processing each instance before we take any action. Makes sure pinterest loads individually and not all together. 4 5 if ( $("body").hasClass("wpsocialite-scroll") ) { //If set to 'scroll' 6 var articles = $('.social-buttons'), socialised = { }, win = $(window), updateArticles, onUpdate, updateTimeout; 7 8 updateArticles = function() 9 { 10 // viewport bounds 11 var wT = win.scrollTop(), 12 wL = win.scrollLeft(), 13 wR = wL + win.width(), 14 wB = wT + win.height(); 15 // check which articles are visible and socialise! 16 for (var i = 0; i < articles.length; i++) { 17 if (socialised[i]) { 18 continue; 19 } 20 // article bounds 21 var art = $(articles[i]), 22 aT = art.offset().top, 23 aL = art.offset().left, 24 aR = aL + art.width(), 25 aB = aT + art.height(); 26 // vertial point inside viewport 27 if ((aT >= wT && aT <= wB) || (aB >= wT && aB <= wB)) { 28 // horizontal point inside viewport 29 if ((aL >= wL && aL <= wR) || (aR >= wL && aR <= wR)) { 30 socialised[i] = true; 31 Socialite.load(articles[i]); 32 } 33 } 34 } 35 }; 36 37 onUpdate = function() 38 { 39 if (updateTimeout) { 40 clearTimeout(updateTimeout); 41 } 42 updateTimeout = setTimeout(updateArticles, 100); 43 }; 44 45 win.on('resize', onUpdate).on('scroll', onUpdate); 46 47 setTimeout(updateArticles, 100); 48 49 } else { //If not set to 'scroll', default to hover 50 51 $('.social-buttons').parent().one('mouseenter', function(){ 52 Socialite.load($(this)[0]); 53 }); 54 55 } 56 57});//theend
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.