make submission header buttons native

This commit is contained in:
Alex Turchyn authored and Pete Matsyburka committed 2026-09-23 10:59:54 +03:00
1 parent 359f695eb5
commit 9abdb68bc5
5 files changed
+79 -55

No files matched your search

+3 -1
View File
@@ -6,7 +6,9 @@ export default class extends HTMLElement {
const text = this.dataset.text || this.innerText.trim()
if (navigator.clipboard) {
navigator.clipboard.writeText(text)
navigator.clipboard.writeText(text).then(() => {
window.webkit?.messageHandlers?.flash?.postMessage({ style: 'notice', message: this.dataset.copied })
})
} else {
if (e.target.tagName !== 'INPUT') {
alert(`Clipboard not available. Make sure you're using https://\nCopy text: ${text}`)
@@ -21,6 +21,10 @@ export default targetable(class extends HTMLElement {
downloadFiles () {
if (!this.dataset.src) return
const download = window.webkit?.messageHandlers?.download
if (download) return download.postMessage({ src: this.dataset.src })
this.toggleState()
fetch(this.dataset.src).then(async (response) => {
+1 -1
View File
@@ -6,7 +6,7 @@ export default class extends HTMLElement {
if (!bridge) return
const target = this.querySelector('a, button, [role="button"]')
const target = this.querySelector('a, button, [role="button"]') || this.firstElementChild
if (!target) return