Jesus FAQs
Häufig gestellte Fragen
Klicke einfach auf die Frage, um eine genauere Antwort zu bekommen.
document.addEventListener('DOMContentLoaded', () => {
const func_copyText = (btn) => {
if (!btn) return;
const successfulText = 'Die Jesus-FAQs wurden erfolgreich in die Zwischenablage kopiert!';
if (btn.dataset.hasOwnProperty('copy')) {
const copyTargetSelector = btn.dataset['copy'];
const copyTarget = document.body.querySelector(copyTargetSelector);
if (copyTarget) {
const copyText = `
${copyTarget.innerHTML}
`;
if (navigator) {
navigator.permissions.query({ name: 'clipboard-write' }).then(async (res) => {
if (res.state === 'granted' || res.state === 'prompt') {
navigator.clipboard.writeText(copyText).then(() => {
alert(successfulText);
});
}
});
} else {
const sel = document.createElement('textarea');
sel.value = copyText;
document.body.appendChild(sel);
sel.focus();
sel.select();
sel.setSelectionRange(0, 99999); // For mobile devices
try {
document.execCommand('copy');
} finally {
document.body.removeChild(sel);
alert(successfulText);
}
}
}
}
};
const copyBtn = document.querySelector('.copy-content-button');
copyBtn.addEventListener('click', (e) => func_copyText(copyBtn));
});