mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-24 12:08:33 -04:00
Add clipboard sharing (#3330)
When the discussion #3327 started, I thought that the clipboard share is a good idea. It never occurred to me because I do not use a smartphone. It might need some polishing but it seems pretty usable as-is. See #3327
This commit is contained in:
1 parent
0567e38947
commit
46c8f6e77b
22 files changed
+34
-3
No files matched your search
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Known based sites', // TODO - Translation
|
||||
'blogotext' => 'Blogotext', // TODO - Translation
|
||||
'clipboard' => 'Clipboard', // TODO - Translation
|
||||
'diaspora' => 'Diaspora*', // TODO - Translation
|
||||
'email' => 'Email', // TODO - Translation
|
||||
'facebook' => 'Facebook', // TODO - Translation
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Known-Seite (https://withknown.com)',
|
||||
'blogotext' => 'Blogotext',
|
||||
'clipboard' => 'Zwischenablage',
|
||||
'diaspora' => 'Diaspora*',
|
||||
'email' => 'E-Mail',
|
||||
'facebook' => 'Facebook',
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Known based sites',
|
||||
'blogotext' => 'Blogotext',
|
||||
'clipboard' => 'Clipboard',
|
||||
'diaspora' => 'Diaspora*',
|
||||
'email' => 'Email',
|
||||
'facebook' => 'Facebook',
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Known based sites',
|
||||
'blogotext' => 'Blogotext',
|
||||
'clipboard' => 'Clipboard',
|
||||
'diaspora' => 'Diaspora*',
|
||||
'email' => 'Email',
|
||||
'facebook' => 'Facebook',
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Known based sites', // TODO - Translation
|
||||
'blogotext' => 'Blogotext', // TODO - Translation
|
||||
'clipboard' => 'Clipboard', // TODO - Translation
|
||||
'diaspora' => 'Diaspora*', // TODO - Translation
|
||||
'email' => 'Email', // TODO - Translation
|
||||
'facebook' => 'Facebook', // TODO - Translation
|
||||
|
||||
+2
-1
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Sites basés sur Known',
|
||||
'blogotext' => 'Blogotext',
|
||||
'clipboard' => 'Presse-papier',
|
||||
'diaspora' => 'Diaspora*',
|
||||
'email' => 'Courriel',
|
||||
'facebook' => 'Facebook',
|
||||
@@ -195,7 +196,7 @@ return array(
|
||||
'mastodon' => 'Mastodon',
|
||||
'movim' => 'Movim',
|
||||
'pinboard' => 'Pinboard', // TODO - Translation
|
||||
'pocket' => 'Pocket', // TODO - Translation
|
||||
'pocket' => 'Pocket',
|
||||
'print' => 'Imprimer',
|
||||
'shaarli' => 'Shaarli',
|
||||
'twitter' => 'Twitter',
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Known based sites', // TODO - Translation
|
||||
'blogotext' => 'Blogotext', // TODO - Translation
|
||||
'clipboard' => 'Clipboard', // TODO - Translation
|
||||
'diaspora' => 'Diaspora*', // TODO - Translation
|
||||
'email' => 'דואר אלקטרוני',
|
||||
'facebook' => 'Facebook', // TODO - Translation
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Siti basati su Known',
|
||||
'blogotext' => 'Blogotext', // TODO - Translation
|
||||
'clipboard' => 'Clipboard', // TODO - Translation
|
||||
'diaspora' => 'Diaspora*', // TODO - Translation
|
||||
'email' => 'Email', // TODO - Translation
|
||||
'facebook' => 'Facebook', // TODO - Translation
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Known based sites',
|
||||
'blogotext' => 'Blogotext',
|
||||
'clipboard' => 'Clipboard', // TODO - Translation
|
||||
'diaspora' => 'Diaspora*',
|
||||
'email' => '메일',
|
||||
'facebook' => 'Facebook',
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Known-gebaseerde sites',
|
||||
'blogotext' => 'Blogotext',
|
||||
'clipboard' => 'Klembord',
|
||||
'diaspora' => 'Diaspora*',
|
||||
'email' => 'Email',
|
||||
'facebook' => 'Facebook',
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Sites basats sus Known',
|
||||
'blogotext' => 'Blogotext',
|
||||
'clipboard' => 'Clipboard', // TODO - Translation
|
||||
'diaspora' => 'Diaspora*',
|
||||
'email' => 'Corrièl',
|
||||
'facebook' => 'Facebook',
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Strony bazujące na usłudze Known',
|
||||
'blogotext' => 'Blogotext',
|
||||
'clipboard' => 'Clipboard', // TODO - Translation
|
||||
'diaspora' => 'Diaspora*',
|
||||
'email' => 'E-mail',
|
||||
'facebook' => 'Facebook',
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Known based sites', // TODO - Translation
|
||||
'blogotext' => 'Blogotext',
|
||||
'clipboard' => 'Clipboard', // TODO - Translation
|
||||
'diaspora' => 'Diaspora*',
|
||||
'email' => 'Email', // TODO - Translation
|
||||
'facebook' => 'Facebook',
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Known based sites', // TODO - Translation
|
||||
'blogotext' => 'Blogotext', // TODO - Translation
|
||||
'clipboard' => 'Clipboard', // TODO - Translation
|
||||
'diaspora' => 'Diaspora*', // TODO - Translation
|
||||
'email' => 'Email', // TODO - Translation
|
||||
'facebook' => 'Facebook', // TODO - Translation
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Stránky založené na Known',
|
||||
'blogotext' => 'Blogotext',
|
||||
'clipboard' => 'Clipboard', // TODO - Translation
|
||||
'diaspora' => 'Diaspora*',
|
||||
'email' => 'E-mail',
|
||||
'facebook' => 'Facebook',
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => 'Known based sites', // TODO - Translation
|
||||
'blogotext' => 'Blogotext', // TODO - Translation
|
||||
'clipboard' => 'Clipboard', // TODO - Translation
|
||||
'diaspora' => 'Diaspora*', // TODO - Translation
|
||||
'email' => 'Email', // TODO - Translation
|
||||
'facebook' => 'Facebook', // TODO - Translation
|
||||
|
||||
@@ -185,6 +185,7 @@ return array(
|
||||
'share' => array(
|
||||
'Known' => '基于 Known 的站点',
|
||||
'blogotext' => 'Blogotext',
|
||||
'clipboard' => 'Clipboard', // TODO - Translation
|
||||
'diaspora' => 'Diaspora*',
|
||||
'email' => '邮箱',
|
||||
'facebook' => '脸书',
|
||||
|
||||
@@ -140,4 +140,10 @@ return array(
|
||||
'form' => 'advanced',
|
||||
'method' => 'GET',
|
||||
),
|
||||
'clipboard' => array(
|
||||
'url' => '~LINK~',
|
||||
'transform' => array(),
|
||||
'form' => 'simple',
|
||||
'method' => 'GET',
|
||||
),
|
||||
);
|
||||
@@ -93,7 +93,7 @@
|
||||
$share->update($share_options);
|
||||
?><li class="item share">
|
||||
<?php if ('GET' === $share->method()) {?>
|
||||
<a target="_blank" rel="noreferrer" href="<?= $share->url() ?>"><?= $share->name() ?></a>
|
||||
<a target="_blank" rel="noreferrer" href="<?= $share->url() ?>" data-type="<?= $share->type() ?>"><?= $share->name() ?></a>
|
||||
<?php } else {?>
|
||||
<a href="POST"><?= $share->name() ?></a>
|
||||
<form method="POST" action="<?= $share->url() ?>" disabled="disabled">
|
||||
|
||||
@@ -538,6 +538,7 @@ return array(
|
||||
'gen.period.years',
|
||||
'gen.share.Known',
|
||||
'gen.share.blogotext',
|
||||
'gen.share.clipboard',
|
||||
'gen.share.diaspora',
|
||||
'gen.share.email',
|
||||
'gen.share.facebook',
|
||||
|
||||
@@ -50,6 +50,7 @@ return array(
|
||||
'gen.share.linkedin',
|
||||
'gen.share.mastodon',
|
||||
'gen.share.movim',
|
||||
'gen.share.pocket',
|
||||
'gen.share.shaarli',
|
||||
'gen.share.twitter',
|
||||
'gen.share.wallabag',
|
||||
|
||||
+7
-1
@@ -946,7 +946,7 @@ function init_stream(stream) {
|
||||
return true;
|
||||
}
|
||||
|
||||
el = ev.target.closest('.item.share > a[href="#"]');
|
||||
el = ev.target.closest('.item.share > a[data-type="print"]');
|
||||
if (el) { //Print
|
||||
const tmp_window = window.open();
|
||||
for (var i = 0; i < document.styleSheets.length; i++) {
|
||||
@@ -960,6 +960,12 @@ function init_stream(stream) {
|
||||
return false;
|
||||
}
|
||||
|
||||
el = ev.target.closest('.item.share > a[data-type="clipboard"]');
|
||||
if (el && navigator.clipboard) { //Clipboard
|
||||
navigator.clipboard.writeText(el.href);
|
||||
return false;
|
||||
}
|
||||
|
||||
el = ev.target.closest('.item.share > a[href="POST"]');
|
||||
if (el) { //Share by POST
|
||||
const f = el.parentElement.querySelector('form');
|
||||
|
||||
Reference in new issue
Block a user