mirror of https://github.com/FreshRSS/FreshRSS.git
New sharing service: Web sharing API (#4271)
* new optional option: HTMLtag * Update main.js * add: web sharing API * Update gen.php * Update gen.php * Update gen.php * fix spaces * Update shares.php * fixed JavaScript * Update template.rtl.css * Typo * improved: if (!navigator.share) * Update main.js * comma-dangle only for arrays and objects * Update app/i18n/fr/gen.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * i18n: System sharing Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
This commit is contained in:
parent
9748ac48e4
commit
a89fce27cb
|
@ -8,7 +8,10 @@
|
|||
],
|
||||
"rules": {
|
||||
"camelcase": "off",
|
||||
"comma-dangle": ["warn", "always-multiline"],
|
||||
"comma-dangle": ["warn", {
|
||||
"arrays": "always-multiline",
|
||||
"objects": "always-multiline"
|
||||
}],
|
||||
"eqeqeq": "off",
|
||||
"indent": ["warn", "tab", { "SwitchCase": 1 }],
|
||||
"linebreak-style": ["error", "unix"],
|
||||
|
|
|
@ -20,13 +20,14 @@ class FreshRSS_Share {
|
|||
return;
|
||||
}
|
||||
|
||||
$HTMLtag = isset($share_options['HTMLtag']) ? $share_options['HTMLtag'] : 'link';
|
||||
$isDeprecated = isset($share_options['deprecated']) ? $share_options['deprecated'] : false;
|
||||
$help_url = isset($share_options['help']) ? $share_options['help'] : '';
|
||||
$field = isset($share_options['field']) ? $share_options['field'] : null;
|
||||
self::$list_sharing[$type] = new FreshRSS_Share(
|
||||
$type, $share_options['url'], $share_options['transform'],
|
||||
$share_options['form'], $help_url, $share_options['method'],
|
||||
$field, $isDeprecated
|
||||
$field, $HTMLtag, $isDeprecated
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -87,6 +88,7 @@ class FreshRSS_Share {
|
|||
private $isDeprecated = false;
|
||||
private $method = 'GET';
|
||||
private $field;
|
||||
private $HTMLtag = 'link';
|
||||
|
||||
/**
|
||||
* Create a FreshRSS_Share object.
|
||||
|
@ -99,11 +101,12 @@ class FreshRSS_Share {
|
|||
* @param string $help_url is an optional url to give help on this option.
|
||||
* @param string $method defines the sharing method (GET or POST)
|
||||
*/
|
||||
private function __construct($type, $url_transform, $transform, $form_type, $help_url, $method, $field, $isDeprecated = false) {
|
||||
private function __construct($type, $url_transform, $transform, $form_type, $help_url, $method, $field, $HTMLtag, $isDeprecated = false) {
|
||||
$this->type = $type;
|
||||
$this->name = _t('gen.share.' . $type);
|
||||
$this->url_transform = $url_transform;
|
||||
$this->help_url = $help_url;
|
||||
$this->HTMLtag = $HTMLtag;
|
||||
$this->isDeprecated = $isDeprecated;
|
||||
|
||||
if (!is_array($transform)) {
|
||||
|
@ -181,6 +184,13 @@ class FreshRSS_Share {
|
|||
return $this->help_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the type of HTML tag of the share option.
|
||||
*/
|
||||
public function HTMLtag() {
|
||||
return $this->HTMLtag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current name of the share option.
|
||||
*/
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Tisknout',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'Wallabag v1',
|
||||
'wallabagv2' => 'Wallabag v2',
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Upozornění!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Drucken',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'Teilen (Systemstandard)',
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Achtung!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Print', // IGNORE
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Warning!', // IGNORE
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon',
|
||||
'movim' => 'Movim',
|
||||
'pinboard' => 'Pinboard',
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest',
|
||||
'pocket' => 'Pocket',
|
||||
'print' => 'Print',
|
||||
'raindrop' => 'Raindrop.io',
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit',
|
||||
'shaarli' => 'Shaarli',
|
||||
'twitter' => 'Twitter',
|
||||
'wallabag' => 'wallabag v1',
|
||||
'wallabagv2' => 'wallabag v2',
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing',
|
||||
'whatsapp' => 'Whatsapp',
|
||||
'xing' => 'Xing',
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Warning!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Imprimir',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => '¡Aviso!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Imprimer',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'Partage standard',
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Attention !',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'הדפסה',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'זהירות!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Stampa',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Attenzione!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => '印刷',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => '警告!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => '인쇄',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => '경고!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Print', // IGNORE
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Attentie!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Imprimir',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Atencion !',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Wydruk',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Uwaga!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Imprimir',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Atenção!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Распечатать',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Предупреждение!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Print', // IGNORE
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Upozornenie!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => 'Print', // IGNORE
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => 'Twitter', // IGNORE
|
||||
'wallabag' => 'wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => 'Tehlike!',
|
||||
|
|
|
@ -198,17 +198,18 @@ return array(
|
|||
'mastodon' => 'Mastodon', // IGNORE
|
||||
'movim' => 'Movim', // IGNORE
|
||||
'pinboard' => 'Pinboard', // IGNORE
|
||||
'pinterest' => 'Pinterest', // TODO
|
||||
'pinterest' => 'Pinterest', // IGNORE
|
||||
'pocket' => 'Pocket', // IGNORE
|
||||
'print' => '打印',
|
||||
'raindrop' => 'Raindrop.io', // IGNORE
|
||||
'reddit' => 'Reddit', // TODO
|
||||
'reddit' => 'Reddit', // IGNORE
|
||||
'shaarli' => 'Shaarli', // IGNORE
|
||||
'twitter' => '推特', // IGNORE
|
||||
'wallabag' => 'Wallabag v1', // IGNORE
|
||||
'wallabagv2' => 'Wallabag v2', // IGNORE
|
||||
'whatsapp' => 'Whatsapp', // TODO
|
||||
'xing' => 'Xing', // TODO
|
||||
'web-sharing-api' => 'System sharing', // TODO
|
||||
'whatsapp' => 'Whatsapp', // IGNORE
|
||||
'xing' => 'Xing', // IGNORE
|
||||
),
|
||||
'short' => array(
|
||||
'attention' => '警告!',
|
||||
|
|
|
@ -35,6 +35,7 @@ return array(
|
|||
'method' => 'GET',
|
||||
),
|
||||
'clipboard' => array(
|
||||
'HTMLtag' => 'button',
|
||||
'url' => '~LINK~',
|
||||
'transform' => array(),
|
||||
'form' => 'simple',
|
||||
|
@ -127,6 +128,7 @@ return array(
|
|||
'method' => 'GET',
|
||||
),
|
||||
'print' => array(
|
||||
'HTMLtag' => 'button',
|
||||
'url' => '#',
|
||||
'transform' => array(),
|
||||
'form' => 'simple',
|
||||
|
@ -172,6 +174,13 @@ return array(
|
|||
'form' => 'advanced',
|
||||
'method' => 'GET',
|
||||
),
|
||||
'web-sharing-api' => array(
|
||||
'HTMLtag' => 'button',
|
||||
'url' => '~LINK~',
|
||||
'transform' => array(),
|
||||
'form' => 'simple',
|
||||
'method' => 'GET',
|
||||
),
|
||||
'whatsapp' => array(
|
||||
'url' => 'https://wa.me/?text=~TITLE~ | ~LINK~',
|
||||
'transform' => array('rawurlencode'),
|
||||
|
|
|
@ -96,9 +96,14 @@
|
|||
$share_options['title'] = $title;
|
||||
$share->update($share_options);
|
||||
?><li class="item share<?= $cssClass ?>">
|
||||
<?php if ('GET' === $share->method()) {?>
|
||||
<?php if ('GET' === $share->method()) {
|
||||
if ($share->HTMLtag() !== 'button') {?>
|
||||
<a target="_blank" rel="noreferrer" href="<?= $share->url() ?>" data-type="<?= $share->type() ?>"><?= $share->name() ?></a>
|
||||
<?php } else {?>
|
||||
<?php } else { ?>
|
||||
<button type="button" class="as-link" data-url="<?= $share->url() ?>" data-type="<?= $share->type() ?>" data-title="<?= htmlspecialchars($title) ?>"><?= $share->name() ?></button>
|
||||
<?php
|
||||
}
|
||||
} else {?>
|
||||
<a href="POST"><?= $share->name() ?></a>
|
||||
<form method="POST" action="<?= $share->url() ?>" disabled="disabled">
|
||||
<input type="hidden" value="<?= $link ?>" name="<?= $share->field() ?>"/>
|
||||
|
|
|
@ -1018,7 +1018,7 @@ function init_stream(stream) {
|
|||
return true;
|
||||
}
|
||||
|
||||
el = ev.target.closest('.item.share > a[data-type="print"]');
|
||||
el = ev.target.closest('.item.share > button[data-type="print"]');
|
||||
if (el) { // Print
|
||||
const tmp_window = window.open();
|
||||
for (let i = 0; i < document.styleSheets.length; i++) {
|
||||
|
@ -1032,9 +1032,19 @@ function init_stream(stream) {
|
|||
return false;
|
||||
}
|
||||
|
||||
el = ev.target.closest('.item.share > a[data-type="clipboard"]');
|
||||
el = ev.target.closest('.item.share > button[data-type="clipboard"]');
|
||||
if (el && navigator.clipboard) { // Clipboard
|
||||
navigator.clipboard.writeText(el.href);
|
||||
navigator.clipboard.writeText(el.dataset.url);
|
||||
return false;
|
||||
}
|
||||
|
||||
el = ev.target.closest('.item.share > button[data-type="web-sharing-api"]');
|
||||
if (el && navigator.share) { // https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share
|
||||
const shareData = {
|
||||
url: el.dataset.url,
|
||||
title: decodeURI(el.dataset.title),
|
||||
};
|
||||
navigator.share(shareData);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1068,6 +1078,15 @@ function init_stream(stream) {
|
|||
}
|
||||
};
|
||||
|
||||
if (!navigator.share) {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share
|
||||
// do not show the menu entry if browser does not support navigator.share
|
||||
document.styleSheets[0].insertRule(
|
||||
'button.as-link[data-type="web-sharing-api"] {display: none !important;}',
|
||||
document.styleSheets[0].cssRules.length
|
||||
);
|
||||
}
|
||||
|
||||
stream.onmouseup = function (ev) { // Mouseup enables us to catch middle click, and control+click in IE/Edge
|
||||
if (ev.altKey || ev.metaKey || ev.shiftKey) {
|
||||
return;
|
||||
|
|
|
@ -1077,7 +1077,6 @@ a.website:hover .favicon {
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
.flux .item.share > a,
|
||||
.item.query > a {
|
||||
display: list-item;
|
||||
list-style-position: inside;
|
||||
|
|
|
@ -1077,7 +1077,6 @@ a.website:hover .favicon {
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
.flux .item.share > a,
|
||||
.item.query > a {
|
||||
display: list-item;
|
||||
list-style-position: inside;
|
||||
|
|
Loading…
Reference in New Issue