/* * Social Links - Twitter and Facebook buttons * */ // delay widgets loading untill page load is complete jQuery(window).load(function() { jQuery('div.fb-like').each(function () { var href = jQuery(this).attr('data-href'); var result = new RegExp(window.location.protocol + "//([^/]+)/.*").exec(href); jQuery(this).attr('data-href', href.replace(result[1], WMG.basePath)); var iframe = jQuery(this).find('iframe'); if ( iframe && iframe.attr('src') ){ iframe.attr('src', iframe.attr('src').replace(result[1], WMG.basePath)); } }); }); /* Pager : Replace Next/Previous text and smooth scrolling to the top of the list */ Drupal.behaviors.mettfunction = { attach: function() { jQuery('a.twitter-share-button').each( function() { var startersiteDefaultURL = 'blinkemphaticrock.drupalgardens.com'; var href = jQuery(this).attr('data-url'); var result = href.replace(startersiteDefaultURL, WMG.basePath); result = result.replace('wmgd2c_ss1', WMG.TwitterButton.artistHandle); jQuery(this).attr('data-url',result); //add the via attribute if present in configuration if ( WMG.TwitterButton.via ){ jQuery(this).attr('data-via', WMG.TwitterButton.via); } }); htmlreplace('next ›', 'NEXT'); htmlreplace('‹ previous', 'PREV'); _includeJS("//platform.twitter.com/widgets.js"); _includeJS("//connect.facebook.net/en_US/all.js#xfbml=1"); } };