ENH - add DarkChat media attachments

This commit is contained in:
Leon.Schmidt
2026-08-06 22:50:38 +02:00
parent db29a3dd07
commit 509fdc7dbc
19 changed files with 499 additions and 101 deletions
+23
View File
@@ -0,0 +1,23 @@
export function copyText(value: string): boolean {
const activeElement =
document.activeElement instanceof HTMLElement
? document.activeElement
: undefined
const textarea = document.createElement('textarea')
textarea.value = value
textarea.readOnly = true
textarea.style.position = 'fixed'
textarea.style.left = '-9999px'
textarea.style.opacity = '0'
document.body.appendChild(textarea)
textarea.select()
textarea.setSelectionRange(0, value.length)
try {
return document.execCommand('copy')
} finally {
textarea.remove()
activeElement?.focus({ preventScroll: true })
}
}