Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var social_labels = [
- 'Facebook',
- 'Google+',
- 'Facebook and Google+'];
- function activate_icon(icon) {
- update_social(icon);
- //var icon = $('.cta_'+icon).addClass('active');
- };
- var f = g = false;
- function update_social(icon) {
- var label = $('#yournetworks');
- if (icon == 'facebook') f = true;
- if (icon == 'gplus') g = true;
- if (f) label.text(social_labels[0]);
- if (g) label.text(social_labels[1]);
- if (f && g) label.text(social_labels[2]);
- };
- jQuery(function() {
- setTimeout(function() {
- // google plus
- var gurl = 'https://plus.google.com/up/?continue=https://www.google.com/intl/en/images/logos/accounts_logo.png&type=st&gpsrc=ogpy0';
- var gimg = $('<img src="' + gurl + '" />').hide().appendTo('body').load(function() {
- activate_icon('gplus');
- });
- // facebook
- var appId = '167052160169789'; // this needs to be set up!
- window.fbAsyncInit = function() {
- FB.init({
- appId: appId,
- status: true,
- cookie: true,
- xfbml: true
- });
- FB.getLoginStatus(function(response) {
- if (response.status != "unknown") activate_icon('facebook');
- });
- };
- // Load the SDK Asynchronously
- (function(d) {
- var js, id = 'facebook-jssdk';
- if (d.getElementById(id)) {
- return;
- }
- js = d.createElement('script');
- js.id = id;
- js.async = true;
- js.src = "//connect.facebook.net/en_US/all.js";
- d.getElementsByTagName('head')[0].appendChild(js);
- }(document));
- }, 5000);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement