From 792082e2e0fcca32fffc7693a210ae2fa64d4c06 Mon Sep 17 00:00:00 2001 From: Marco Nassabain Date: Sun, 14 Mar 2021 22:20:35 +0100 Subject: =?UTF-8?q?=E2=9C=A8=20Social=20share:=20show=20if=20socialsharing?= =?UTF-8?q?=20app=20active?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Nassabain --- js/controller/ShareController.js | 11 +++++++++++ templates/part.content.php | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/js/controller/ShareController.js b/js/controller/ShareController.js index a60ea7ed3..8d7235d89 100644 --- a/js/controller/ShareController.js +++ b/js/controller/ShareController.js @@ -146,6 +146,17 @@ app.controller('ShareController', function (ShareResource, Loading) { return user.status === status; }; + /** + * Checks if the social sharing app for the given media is active + * + * @param media + * @returns boolean + */ + this.isSocialAppEnabled = function(media) { + let app = 'socialsharing_' + media; + return app in OC.appswebroots; + }; + this.getFacebookUrl = function(url){ return 'https://www.facebook.com/sharer/sharer.php?u='+url; }; diff --git a/templates/part.content.php b/templates/part.content.php index 8bcd33d14..e02713bee 100644 --- a/templates/part.content.php +++ b/templates/part.content.php @@ -139,17 +139,17 @@

t('Share on social media')) ?>

-
+
-
+
-
+
-- cgit v1.2.3