Add a link to share on Mamot

parent ea1da51a
Pipeline #1676 passed with stage
in 44 seconds
...@@ -123,6 +123,13 @@ function ShareMessage(req) { ...@@ -123,6 +123,13 @@ function ShareMessage(req) {
+ encodeURIComponent(this.getTitle() + ' ' + this.getContent()) + encodeURIComponent(this.getTitle() + ' ' + this.getContent())
+ '&url=' + encodeURIComponent(this.getUrl()); + '&url=' + encodeURIComponent(this.getUrl());
} }
this.getMastodonLink = function() {
return 'https://mamot.fr/share?text='
+ encodeURIComponent(this.getTitle()
+ ' ' + this.getContent()
+ ' ' + this.getUrl());
}
} }
app.get('/generate.png', function (req, res) { app.get('/generate.png', function (req, res) {
...@@ -132,6 +139,9 @@ app.get('/generate.png', function (req, res) { ...@@ -132,6 +139,9 @@ app.get('/generate.png', function (req, res) {
if (req.query.target === 'diaspora') { if (req.query.target === 'diaspora') {
return res.redirect(message.getDiasporaLink()) return res.redirect(message.getDiasporaLink())
} }
else if (req.query.target === 'mastodon') {
return res.redirect(message.getMastodonLink())
}
else if (req.query.target === 'facebook') { else if (req.query.target === 'facebook') {
return res.redirect(message.getFacebookLink()); return res.redirect(message.getFacebookLink());
} }
......
...@@ -123,6 +123,9 @@ html(lang=locale) ...@@ -123,6 +123,9 @@ html(lang=locale)
span.fa.fa-refresh span.fa.fa-refresh
button(type="submit" name="target" value="randomize" formaction="" formtarget="_self").randomize.white-button button(type="submit" name="target" value="randomize" formaction="" formtarget="_self").randomize.white-button
span.fa.fa-random span.fa.fa-random
button(type="submit" name="target" value="mastodon").white-button
span.text
=_('Mamot') + ' '
button(type="submit" name="target" value="diaspora").white-button button(type="submit" name="target" value="diaspora").white-button
span.text span.text
=_('Diaspora*') + ' ' =_('Diaspora*') + ' '
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment