1$(document).ready(function() { 2 setupShareThis(); 3}); 4 5function setupShareThis(){ 6 var shareContainer = $('#share-this-popup'); 7 var shareLink = $('#share-link'); 8 var shareLoader = $('#share-loader'); 9 var activeClass = 'share-this-popup--show'; 10 11 shareContainer.data('loaded', '0'); 12 13 shareLink.on('click',function(e){ 14 e.preventDefault(); 15 e.stopPropagation(); 16 17 //If we don't have any Share This content on the page already, fetch it via AJAX 18 if (shareContainer.data('loaded') == '0') { 19 //indicate that it's loading... 20 shareLoader.show(); 21 shareLink.hide(); 22 23 //mark Share This as loaded so we won't load it via AJAX again unless page is refreshed 24 shareContainer.data('loaded', '1'); 25 26 //If user overrode defaults in the HTML markup, use the override values here 27 var sUrl = shareContainer.data('url') || ''; 28 var sTweetFilter = shareContainer.data('tweet-filter') || 'GLOBAL'; 29 30 //fetch the Share This content via AJAX 31 shareContainer.load(shareContainer.data('script'), { 'url': sUrl, 'tweet_filter': sTweetFilter }, function() { 32 shareContainer.addClass(activeClass); 33 //remove the loading indicator 34 shareLoader.hide(); 35 shareLink.show(); 36 }); 37 } 38 else { 39 //We've already fetched Share This content for this page, so just show it 40 shareContainer.toggleClass(activeClass); 41 } 42 }); 43 44 $('body').click(function() { 45 //if the "SHARE" tooltip is visible, then close it 46 if (shareContainer.hasClass(activeClass)) { 47 shareContainer.toggleClass(activeClass); 48 } 49 }); 50}
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.