import { $ } from 'mdui/jq' customElements.define('chat-file', class extends HTMLElement { constructor() { super() } connectedCallback() { const e = new DOMParser().parseFromString(` `, 'text/html').body.firstChild as HTMLElement $(e).find('span').text($(this).attr("name")) const href = $(this).attr('href') $(e).attr('href', href) $(e).attr('target', '_blank') $(e).attr('download', href) e.style.textDecoration = 'none' e.style.color = 'inherit' // deno-lint-ignore no-window e.onclick = (e) => { e.stopPropagation() } this.appendChild(e) } })