From 1da543a70209577a6c68c6bfa5ea0d4448831fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien?= Date: Sun, 14 Mar 2021 21:25:48 +0100 Subject: Add function getFacebookUrl and getTwitterUrl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien --- js/controller/ShareController.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'js/controller') diff --git a/js/controller/ShareController.js b/js/controller/ShareController.js index 0bb920eda..94d60daf6 100644 --- a/js/controller/ShareController.js +++ b/js/controller/ShareController.js @@ -102,20 +102,11 @@ app.controller('ShareController', function (ShareResource, Loading) { }); }; - this.isLoading = function(userId) { - return Loading.isLoading(userId); + this.getFacebookUrl = function(url){ + return 'https://www.facebook.com/sharer/sharer.php?u='+url; }; - this.isStatus = function(itemId, userId, status) { - let item = this.usersSharedArticles.find(i => i.id === itemId); - if (!item) { - return false; - } - let user = item.users.find(u => u.id === userId); - if (!user) { - return false; - } - return user.status === status; + this.getTwitterUrl = function(url){ + return 'https://twitter.com/intent/tweet?url='+url; }; - }); -- cgit v1.2.3