From d32f6f23cc3b13df56e9e05e8cd916a97b8edb67 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Wed, 21 Oct 2015 15:59:17 -0400 Subject: [PATCH] feat(sharing): Improved front page FB share --- website/public/js/controllers/footerCtrl.js | 9 +++++++++ website/views/shared/footer.jade | 3 ++- website/views/static/front.jade | 12 +++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/website/public/js/controllers/footerCtrl.js b/website/public/js/controllers/footerCtrl.js index 008524db51..18590e4f32 100644 --- a/website/public/js/controllers/footerCtrl.js +++ b/website/public/js/controllers/footerCtrl.js @@ -34,6 +34,15 @@ function($scope, $rootScope, User, $http, Notification, ApiUrl) { // Twitter $.getScript('https://platform.twitter.com/widgets.js'); + // Facebook + (function(d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (d.getElementById(id)) return; + js = d.createElement(s); js.id = id; + js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5"; + fjs.parentNode.insertBefore(js, fjs); + }(document, 'script', 'facebook-jssdk')); + /* Google Content Experiments if (window.env.NODE_ENV === 'production') { $.getScript('//www.google-analytics.com/cx/api.js?experiment=boVO4eEyRfysNE5D53nCMQ', function(){ diff --git a/website/views/shared/footer.jade b/website/views/shared/footer.jade index 55df4cbec5..7f1aacdf79 100644 --- a/website/views/shared/footer.jade +++ b/website/views/shared/footer.jade @@ -1,4 +1,5 @@ footer.footer(ng-controller='FooterCtrl') + div(id='fb-root') .container .row .col-sm-3 @@ -63,7 +64,7 @@ footer.footer(ng-controller='FooterCtrl') table tr td - a.addthis_button_facebook_like(fb:like:layout='button_count') + .fb-like(data-href='https://habitica.com/', data-layout='button', data-action='like', data-show-faces='true', data-share='true') tr td a.twitter-share-button(href='https://twitter.com/intent/tweet?text=Improve+yourself+in+the+land+of+Habitica!&via=habitica&url=https://habitica.com/&count=none')=env.t('tweet') diff --git a/website/views/static/front.jade b/website/views/static/front.jade index a05d16f0e8..3c6aabf7ca 100644 --- a/website/views/static/front.jade +++ b/website/views/static/front.jade @@ -12,11 +12,13 @@ html(ng-app='habitrpg', ng-controller='RootCtrl') meta(name='author', content='') meta(name='geo.placename', content='') meta(name='viewport', content='width=device-width, maximum-scale=1') - meta(property='og:title', content='') - meta(property='og:description', content='') - meta(property='og:url', content='') - meta(property='og:image', content='') - meta(property='og:site_name', content='') + meta(property='og:url', content='https://habitica.com/') + meta(property='og:type', content='website') + meta(property='og:title', content='Habitica: Your Life the Role Playing Game') + meta(property='og:description', content='Habitica is a free habit building and productivity app that treats your real life like a game. With in-game rewards and punishments to motivate you and a strong social network to inspire you, Habitica can help you achieve your goals to become healthy, hard-working, and happy.') + meta(property='og:site_name', content='Habitica') + meta(property='og:image', content='https://s3.amazonaws.com/habitica-assets/assets/gryphon_logo.png') + meta(property='fb:app_id', content='128307497299777') meta(name='twitter:card' content='summary') meta(name='twitter:site' content='@habitica') meta(name='twitter:title' content='Habitica: Your Life the Role Playing Game')