summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorcherguimalih <ilyes.chergui-malih@etu.unistra.fr>2021-03-23 17:04:26 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-04-08 23:17:31 +0200
commitb9fec49b66b895fb04dc35ad8bb19260f309a5b7 (patch)
treefadf15bb701239395733b94079f2794547c1f300 /js
parent31c4e2830ade156def01186da564b532ca96b5e9 (diff)
✨ShareController : Add intro in links
Signed-off-by: cherguimalih <ilyes.chergui-malih@etu.unistra.fr>
Diffstat (limited to 'js')
-rw-r--r--js/controller/ShareController.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/js/controller/ShareController.js b/js/controller/ShareController.js
index 8df57c5d0..21f30608f 100644
--- a/js/controller/ShareController.js
+++ b/js/controller/ShareController.js
@@ -173,15 +173,15 @@ app.controller('ShareController', function (ShareResource, Loading) {
return media.some(m => this.isSocialAppEnabled(m));
};
- this.getFacebookUrl = function(url){
- return 'https://www.facebook.com/sharer/sharer.php?u='+url;
+ this.getFacebookUrl = function(url, intro){
+ return 'https://www.facebook.com/sharer/sharer.php?u='+url + '&quote=' + intro.substring(0,100)+'...';
};
- this.getTwitterUrl = function(url){
- return 'https://twitter.com/intent/tweet?url='+url;
- };
+ this.getTwitterUrl = function(url, intro){
+ return 'https://twitter.com/intent/tweet?url='+url+'&text=' +'\n'+ intro.substring(0,100)+'...';
+ };
- this.getEmailUrl = function(url, object, body){
- return encodeURI('mailto:?subject=' + object + '&body=' + body + ' ' + url);
+ this.getEmailUrl = function(url, object, body, intro){
+ return encodeURI('mailto:?subject=' + object + '&body='+intro+'...\n'+ body + '\n' + url);
};
});