Configure shop app, admin sidebar, media routing, and Stripe dependencies
This commit is contained in:
commit
93d83a0d63
188 files changed
+9220
No files matched your search
@@ -0,0 +1,18 @@
|
||||
for (const box of document.querySelectorAll('[data-share]')) {
|
||||
const link = box.querySelector('input');
|
||||
const share = box.querySelector('[data-share-button]');
|
||||
const copy = box.querySelector('[data-copy-button]');
|
||||
const status = box.querySelector('[data-share-status]');
|
||||
if (navigator.share) {
|
||||
share.hidden = false;
|
||||
share.addEventListener('click', async () => {
|
||||
try {await navigator.share({title: document.title, url: link.value});}
|
||||
catch (error) {if (error.name !== 'AbortError') status.textContent = 'Use the link to share this review.';}
|
||||
});
|
||||
}
|
||||
copy.hidden = false;
|
||||
copy.addEventListener('click', async () => {
|
||||
try {await navigator.clipboard.writeText(link.value); status.textContent = 'Review link copied.';}
|
||||
catch {link.focus(); link.select(); status.textContent = 'Copy the selected link.';}
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user