mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-19 19:11:05 +01:00
feat: add mastodon share, closes #14069
This commit is contained in:
@@ -63,6 +63,12 @@ define('share', ['hooks'], function (hooks) {
|
|||||||
return openShare(linkedin_url, postUrl, 626, 436);
|
return openShare(linkedin_url, postUrl, 626, 436);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
addHandler('[component="share/mastodon"]', function () {
|
||||||
|
const postUrl = getPostUrl($(this));
|
||||||
|
const mastodon_url = `https://share.joinmastodon.org/#text=${encodeURIComponent(postUrl)}`;
|
||||||
|
return openShare(mastodon_url, postUrl, 626, 760);
|
||||||
|
});
|
||||||
|
|
||||||
hooks.fire('action:share.addHandlers', { openShare: openShare });
|
hooks.fire('action:share.addHandlers', { openShare: openShare });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,11 @@ social.getPostSharing = async function () {
|
|||||||
name: 'LinkedIn',
|
name: 'LinkedIn',
|
||||||
class: 'fa-brands fa-linkedin',
|
class: 'fa-brands fa-linkedin',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'mastodon',
|
||||||
|
name: 'Mastodon',
|
||||||
|
class: 'fa-brands fa-mastodon',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
networks = await plugins.hooks.fire('filter:social.posts', networks);
|
networks = await plugins.hooks.fire('filter:social.posts', networks);
|
||||||
networks.forEach((network) => {
|
networks.forEach((network) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user