Início
Romances
Bastidores
Sobre
Caso Proibido
Capítulo 4 - O Encontro
▶ Assistir
ℹ Detalhes
Palavras desaparecem. Corpos falam. O que começa como uma faísca se transforma em uma noite de pura entrega.
◀ Anterior
Ir para o capítulo ▼
Próximo ▶
Deixe um comentário
Enviar
// ...existing code... if (oldForm) oldForm.remove(); const form = document.createElement('form'); form.id = 'editForm'; form.innerHTML = `
Seu nome:
Novo texto:
${oldText}
Salvar edição
`; form.onsubmit = async function(e) { e.preventDefault(); const name = document.getElementById('editName').value; const text = document.getElementById('editText').value; await fetch(`https://s2b-comments.claudia-enrik.workers.dev/comments/general/${commentId}`, { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name, text }) }); form.remove(); fetchComments(); }; document.getElementById('comments').appendChild(form); } function showDeleteForm(commentId, oldName) { const oldForm = document.getElementById('deleteForm'); if (oldForm) oldForm.remove(); const form = document.createElement('form'); form.id = 'deleteForm'; form.innerHTML = `
Seu nome:
Confirmar apagar
`; form.onsubmit = async function(e) { e.preventDefault(); const name = document.getElementById('deleteName').value; await fetch(`https://s2b-comments.claudia-enrik.workers.dev/comments/general/${commentId}`, { method: 'DELETE', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name }) }); form.remove(); fetchComments(); }; document.getElementById('comments').appendChild(form); } function showReplyForm(parentId) { const oldForm = document.getElementById('replyForm'); if (oldForm) oldForm.remove(); const form = document.createElement('form'); form.id = 'replyForm'; form.innerHTML = `
Nome:
Resposta:
Enviar resposta
`; form.onsubmit = async function(e) { e.preventDefault(); const name = document.getElementById('replyName').value; const text = document.getElementById('replyText').value; await fetch('https://s2b-comments.claudia-enrik.workers.dev/comments/general', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name, text, parentId }) }); form.remove(); fetchComments(); }; document.getElementById('comments').appendChild(form); } document.getElementById('commentForm').onsubmit = async function(e) { // ...existing code...