PageSourceSearch

https://podcast.jplus7.fr/assets/clipboard-copy-element-define-lgq8pHU4.js

js jplus7.fr collected 2026-10-05 18:18:38 UTC 2,374 bytes, 2 lines download raw bytes

1function l(e){const t=document.createElement("pre");return t.style.width="1px",t.style.height="1px",t.style.position="fixed",t.style.top="5px",t.textContent=e,t}function a(e){if("clipboard"in navigator)return navigator.clipboard.writeText(e.textContent||"");const t=getSelection();if(t==null)return Promise.reject(new Error);t.removeAllRanges();const n=document.createRange();return n.selectNodeContents(e),t.addRange(n),document.execCommand("copy"),t.removeAllRanges(),Promise.resolve()}function o(e){if("clipboard"in navigator)return navigator.clipboard.writeText(e);const t=document.body;if(!t)return Promise.reject(new Error);const n=l(e);return t.appendChild(n),a(n),t.removeChild(n),Promise.resolve()}async function u(e){const t=e.getAttribute("for"),n=e.getAttribute("value");function i(){e.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(e.getAttribute("aria-disabled")!=="true"){if(n)await o(n),i();else if(t){const r="getRootNode"in Element.prototype?e.getRootNode():e.ownerDocument;if(!(r instanceof Document||"ShadowRoot"in window&&r instanceof ShadowRoot))return;const s=r.getElementById(t);s&&(await f(s),i())}}}function f(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?o(e.value):e instanceof HTMLAnchorElement&&e.hasAttribute("href")?o(e.href):a(e)}function p(e){const t=e.currentTarget;t instanceof HTMLElement&&u(t)}function d(e){if(e.key===" "||e.key==="Enter"){const t=e.currentTarget;t instanceof HTMLElement&&(e.preventDefault(),u(t))}}function m(e){e.currentTarget.addEventListener("keydown",d)}function b(e){e.currentTarget.removeEventListener("keydown",d)}class h extends HTMLElement{static define(t="clipboard-copy",n=customElements){return n.define(t,this),this}constructor(){super(),this.addEventListener("click",p),this.addEventListener("focus",m),this.addEventListener("blur",b)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}const c=typeof globalThis<"u"?globalThis:window;try{c.ClipboardCopyElement=h.define()}catch(e){if(!(c.DOMException&&e instanceof DOMException&&e.name==="NotSupportedError")&&!(e instanceof ReferenceError))throw e}
2//# sourceMappingURL=clipboard-copy-element-define-lgq8pHU4.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.