PageSourceSearch

https://www.luxentu.de/plugins/dzm_resources/frontend/js/dzmCopyClipboard.js?v=7.14.0&t=1789600836

js luxentu.de collected 2026-10-08 11:01:26 UTC 896 bytes, 34 lines download raw bytes

1class UrlCopyToClipboard {
2    constructor() {
3        this.copyBtnSelector = '[data-url-copy-btn]';
4    }
5
6    init() {
7
8        const copyBtn = document.querySelector(this.copyBtnSelector);
9
10        if (copyBtn) {
11            copyBtn.addEventListener('click', () => {
12                this.copyUrl(copyBtn);
13            });
14        }
15    }
16
17    copyUrl(copyBtn) {
18        const url = window.location.href;
19
20        navigator.clipboard.writeText(url).then(() => {
21            // Ändern der Button-Farbe nach erfolgreichem Kopieren
22            copyBtn.style.color = '#20c997';
23        }).catch(err => {
24            console.error('Error copying text: ', err);
25            // Optional: Fehlerbehandlung, z.B. Rot färben bei einem Fehler
26            copyBtn.style.color = 'red';
27        });
28    }
29}
30
31document.addEventListener('DOMContentLoaded', () => {
32    (new UrlCopyToClipboard()).init();
33});
34

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.