mirror of
https://github.com/fergalmoran/dss.web.git
synced 2026-02-16 04:55:11 +00:00
Fixed up share links
This commit is contained in:
@@ -48,10 +48,15 @@ angular.module('dssWebApp')
|
||||
{size: 'md'});
|
||||
};
|
||||
$scope.shareFacebook = function () {
|
||||
helpers.social.postToFacebook($scope.mix);
|
||||
helpers.social.postToFacebook(
|
||||
$scope.mix.title,
|
||||
$scope.mix.mix_image,
|
||||
$scope.mix.description,
|
||||
$state.href('root.user.mix', {user: $scope.mix.user.slug, mix: $scope.mix.slug})
|
||||
);
|
||||
};
|
||||
$scope.shareTwitter = function () {
|
||||
helpers.social.postToTwitter($scope.mix);
|
||||
helpers.social.postToTwitter($state.href('root.user.mix', {user: $scope.mix.user.slug, mix: $scope.mix.slug}));
|
||||
};
|
||||
$scope.toggleFollow = function () {
|
||||
if ($scope.currentUser) {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
var helpers = helpers || {};
|
||||
function _getLink(url){
|
||||
return window.location.protocol + "//" + (window.location.host + '/' + url).replace(/([^:]\/)\/+/g, '$1');
|
||||
}
|
||||
|
||||
if (FB) {
|
||||
FB.init({
|
||||
appId: '154504534677009',
|
||||
@@ -9,17 +13,17 @@ if (FB) {
|
||||
});
|
||||
}
|
||||
helpers.social = {
|
||||
postToFacebook: function (mix) {
|
||||
postToFacebook: function (title, image, description, url) {
|
||||
FB.getLoginStatus(function (oResponse) {
|
||||
if (oResponse.status === "connected") {
|
||||
return FB.ui({
|
||||
method: "feed",
|
||||
name: "Check out this mix on Deep South Sounds",
|
||||
display: "iframe",
|
||||
link: "http://" + window.location.host + "/mixes/" + mix.slug,
|
||||
picture: mix.mix_image,
|
||||
caption: mix.title,
|
||||
description: mix.description
|
||||
link: _getLink(url),
|
||||
picture: _getLink(image),
|
||||
caption: title,
|
||||
description: description
|
||||
}, function (response) {
|
||||
if (response && response.post_id) {
|
||||
return utils.showAlert("Success", "Post shared to facebook");
|
||||
|
||||
@@ -110,10 +110,11 @@ angular.module('dssWebApp')
|
||||
var _processResult = function (result) {
|
||||
$scope.mix = result;
|
||||
$timeout(function () {
|
||||
var url = $state.href('root.user.mix', {user: $scope.mix.user.slug, mix: $scope.mix.slug});
|
||||
$scope.waveformFooter = "Waveform processing is taking longer than expected.<br />" +
|
||||
"Your mix should be available <a ui-sref='root.user.mix({user: currentUser.slug, mix: mix.slug})'>Here</a>";
|
||||
"Your mix should be available <a href='" + url + "'>Here</a>";
|
||||
$scope.$apply();
|
||||
}, 120000);
|
||||
}, 1200);
|
||||
|
||||
var imageFile = document.getElementById('mix-image-fileinput').files[0];
|
||||
if (imageFile) {
|
||||
|
||||
@@ -123,8 +123,8 @@
|
||||
<script src="bower_components/js-data-angular/dist/js-data-angular.js"></script>
|
||||
<script src="bower_components/ui-select/dist/select.js"></script>
|
||||
<script src="bower_components/ngInfiniteScroll/build/ng-infinite-scroll.js"></script>
|
||||
<script src="bower_components/clipboard/dist/clipboard.js"></script>
|
||||
<script src="bower_components/ngclipboard/dist/ngclipboard.js"></script>
|
||||
<script src="bower_components/zeroclipboard/dist/ZeroClipboard.js"></script>
|
||||
<script src="bower_components/ng-clip/src/ngClip.js"></script>
|
||||
<!-- endbower -->
|
||||
<script src="socket.io-client/socket.io.js"></script>
|
||||
<!-- endbuild -->
|
||||
|
||||
Reference in New Issue
Block a user