diff options
author | Aurélien <dav.aurelien@gmail.com> | 2021-03-14 21:25:48 +0100 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2021-04-08 23:17:31 +0200 |
commit | 1da543a70209577a6c68c6bfa5ea0d4448831fc0 (patch) | |
tree | 3eb73137756c6a2903e8864c8a8fe3d73bccd123 | |
parent | 3d9027a914fd132ef2344a0bf07fd35e07aff283 (diff) |
Add function getFacebookUrl and getTwitterUrl
Signed-off-by: Aurélien <dav.aurelien@gmail.com>
-rw-r--r-- | js/controller/ShareController.js | 17 | ||||
-rw-r--r-- | templates/part.content.php | 4 |
2 files changed, 6 insertions, 15 deletions
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; }; - }); diff --git a/templates/part.content.php b/templates/part.content.php index 71e070d50..8bcd33d14 100644 --- a/templates/part.content.php +++ b/templates/part.content.php @@ -142,12 +142,12 @@ <div class="col-4"> <a target="_blank" class="icon-dropdown icon-facebook pr-5" - ng-href="https://www.facebook.com/sharer/sharer.php?u={{ ::item.url }}"></a> + ng-href="{{Share.getFacebookUrl(item.url)}}"></a> </div> <div class="col-4"> <a target="_blank" class="icon-dropdown icon-twitter pr-5" - ng-href="https://twitter.com/intent/tweet?url={{ ::item.url }}"></a> + ng-href="{{Share.getTwitterUrl(item.url)}}"></a> </div> <div class="col-4"> <a class="icon-dropdown icon-mail pr-5" |