diff options
| author | 2022-03-16 23:23:15 +0100 | |
|---|---|---|
| committer | 2022-03-16 23:23:15 +0100 | |
| commit | a89fce27cbc3f3cdfe0cbc10f1ba63a85efa8ebb (patch) | |
| tree | bcc583f0a7698fa505094236b5b42b4264dbf9f9 /app/views/helpers/index | |
| parent | 9748ac48e40947b80808933213b043dc797670b6 (diff) | |
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>
Diffstat (limited to 'app/views/helpers/index')
| -rw-r--r-- | app/views/helpers/index/normal/entry_bottom.phtml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/views/helpers/index/normal/entry_bottom.phtml b/app/views/helpers/index/normal/entry_bottom.phtml index 9be6b99f7..220fc5f62 100644 --- a/app/views/helpers/index/normal/entry_bottom.phtml +++ b/app/views/helpers/index/normal/entry_bottom.phtml @@ -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() ?>"/> |
