feat(sharing): Load widgets from service

This commit is contained in:
Sabe Jones
2015-10-22 14:37:29 -04:00
parent 281411f423
commit e2cfd1bd54
5 changed files with 43 additions and 20 deletions

View File

@@ -1,8 +1,10 @@
"use strict";
angular.module('habitrpg').controller("FooterCtrl",
['$scope', '$rootScope', 'User', '$http', 'Notification', 'ApiUrl',
function($scope, $rootScope, User, $http, Notification, ApiUrl) {
['$scope', '$rootScope', 'User', '$http', 'Notification', 'ApiUrl', 'Social',
function($scope, $rootScope, User, $http, Notification, ApiUrl, Social) {
$scope.loadWidgets = Social.loadWidgets;
if(env.isStaticPage){
$scope.languages = env.avalaibleLanguages;
@@ -31,20 +33,8 @@ function($scope, $rootScope, User, $http, Notification, ApiUrl) {
// Stripe
$.getScript('//checkout.stripe.com/v2/checkout.js');
// 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'));
// Tumblr
$.getScript('https://assets.tumblr.com/share-button.js');
// Social sharing buttons
loadWidgets();
/* Google Content Experiments
if (window.env.NODE_ENV === 'production') {