Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
generateur-slogans
Commits
3f77c283
Verified
Commit
3f77c283
authored
Nov 20, 2017
by
Thibaut Broggi
Browse files
Add a link to share on Mamot
parent
ea1da51a
Pipeline
#1676
passed with stage
in 44 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
srv.js
View file @
3f77c283
...
...
@@ -123,6 +123,13 @@ function ShareMessage(req) {
+
encodeURIComponent
(
this
.
getTitle
()
+
'
'
+
this
.
getContent
())
+
'
&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
)
{
...
...
@@ -132,6 +139,9 @@ app.get('/generate.png', function (req, res) {
if
(
req
.
query
.
target
===
'
diaspora
'
)
{
return
res
.
redirect
(
message
.
getDiasporaLink
())
}
else
if
(
req
.
query
.
target
===
'
mastodon
'
)
{
return
res
.
redirect
(
message
.
getMastodonLink
())
}
else
if
(
req
.
query
.
target
===
'
facebook
'
)
{
return
res
.
redirect
(
message
.
getFacebookLink
());
}
...
...
views/index.pug
View file @
3f77c283
...
...
@@ -123,6 +123,9 @@ html(lang=locale)
span.fa.fa-refresh
button(type="submit" name="target" value="randomize" formaction="" formtarget="_self").randomize.white-button
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
span.text
=_('Diaspora*') + ' '
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment