pressly
Jul 05, 2026

“Dad… my back hurts so much I can’t sleep. Mom said I shouldn’t tell you.”352

“Dad… my back hurts so much I can’t sleep. Mom said I shouldn’t tell you.”634

Preview

“Dad… my back hurts so much I can’t sleep. Mom said I shouldn’t tell you.”

I had just gotten home from a work trip when my eight-year-old daughter whispered the secret her mother thought would stay hidden.

I had been home less than fifteen minutes.

My suitcase was still by the front door. My jacket was still on the couch. I had barely stepped inside when I knew something was wrong.

No small feet running toward me.
No laughter.
No hug.
Just silence.

Then I heard her voice from the bedroom.

Soft. Fragile. Almost a whisper.

“Dad… please don’t be mad,” she said. “Mom said if I told you, things would get worse. But my back hurts… and I can’t sleep.”

I froze in the hallway.

One hand still gripping my suitcase handle. My heart pounding so hard it felt like it was shaking the air out of my chest.

This wasn’t a tantrum.
This wasn’t a kid being dramatic.
This was fear.

I turned toward the bedroom and saw my daughter, Sophie, half-hidden behind the door, like she thought someone might pull her back at any second.

Her shoulders were tight. Her eyes fixed on the floor. She looked small in a way no child ever should.

“Sophie,” I said, keeping my voice as calm as I could. “Dad’s here. Come here, sweetheart.”

She didn’t move.

I set my suitcase down and walked toward her slowly, like one wrong step might make her disappear. When I knelt in front of her, she flinched—and a cold wave ran through me.

“Where does it hurt?” I asked.

Her small hands twisted the hem of her pajama shirt until her knuckles turned white.

“My back,” she whispered. “It hurts all the time. Mom said it was an accident. She said not to tell you. She said you’d get mad. She said bad things would happen.”

Something inside me broke.

I reached out without thinking—but the moment my hand touched her shoulder, she gasped and pulled away.

“Please… don’t,” she whispered. “It hurts.”

I pulled my hand back immediately.

Panic rose in my throat, but I forced myself to stay steady.

“Tell me what happened.”

She glanced toward the hallway, like she thought someone might be listening.

Then, after a long silence, she said the words no parent is ever ready to hear:

“Mom got mad. I spilled juice. She said I did it on purpose. She pushed me… and my back hit the door handle. I couldn’t breathe. I thought… I was going to disappear.”

For a second, I stopped breathing.

Not because I didn’t understand.

Because I understood perfectly.

Everything in the house suddenly felt different.

The walls.
The silence.
The air.

I had walked in expecting a normal night.

Instead, I found my daughter whispering through pain, afraid of her own mother, begging me not to make things worse just by knowing the truth.

And in that moment, I knew this was only the beginning.

Because when a child says something like that… nothing stays hidden for long.

I stayed on my knees.

I kept my voice soft.

“You did the right thing telling me,” I said.

She still wouldn’t look at me.

“How long has it hurt?”

“Since yesterday.”

“Did you tell your mom it still hurt?”

A small nod.

“What did she say?”

Sophie swallowed. “She said I was being dramatic.”

Those words hit harder than anything else.

“Can you show me your back?” I asked gently.

She hesitated… then slowly turned around and lifted her shirt.

And the world went white at the edges.

The bruise was worse than I imagined—deep purple, spreading across her lower back, with a dark center the exact shape of a door handle. Around it were faint yellow marks—older bruises. Healing ones.

Not one injury.

A pattern.

She quickly pulled her shirt back down, ashamed.

“Please don’t yell,” she whispered.

That almost broke me.

Because what she feared most wasn’t the pain.

It was my reaction.

“I’m not going to yell,” I said carefully. “And I’m not going to let anyone hurt you again.”

Her lips trembled. “Promise?”

“Yes.”

I took her to the doctor that night.

They confirmed the bruising. Asked careful questions. Called in a child protection team.

Sophie told the truth again—quiet, but clear.

That it wasn’t the first time.
That her mom got angry.
That she was told to stay quiet.

Reports were filed. Statements taken.

And for the first time, everything was out in the open.

When her mother, Marina, called later that night, her voice was sharp.

“Where are you?” she demanded. “I got home and you’re both gone.”

“At the doctor,” I said.

A pause. “Why?”

“Sophie told me what happened.”

Silence.

Then, quickly: “She’s exaggerating.”

“I saw the bruise.”

“You’re blowing this out of proportion.”

“No,” I said quietly. “I’m finally seeing it clearly.”

Another pause. Then softer, controlled: “Let’s talk in person.”

“We’re not meeting tonight,” I said. “And you’re not seeing her until it’s safe.”

Her tone snapped. “What did she say?”

That told me everything.

Not Is she okay?
Not I’m sorry.
Just: What did she say?

“She told the truth,” I said.

And I hung up.

The weeks that followed were messy and heavy.

Doctors. Social workers. Court hearings.

Sophie stayed with me.

Marina denied everything at first—then minimized it, then blamed stress, then blamed me for being away too much.

But the evidence didn’t change.

The fear in Sophie didn’t change.

And slowly, the truth settled into something solid.

One night, a few months later, Sophie stood in the doorway of her new room.

“Dad?” she said.

“Yeah, sweetheart?”

She hesitated. “Did I make everything bad?”

I walked over and knelt in front of her.

“No,” I said gently. “You told the truth. That’s not bad. That’s brave.”

Her voice was small. “But Mom is sad now.”

I chose my words carefully.

“Adults are responsible for their own actions,” I said. “You are never responsible for someone hurting you. And you’re not responsible for what happens when the truth comes out.”

She thought about that.

Then nodded.

“Okay.”

A year later, things aren’t perfect.

But they’re better.

Sophie sleeps through the night now.
She laughs without fear.
She spills things and doesn’t freeze.
She tells me when something hurts.

She doesn’t whisper anymore.

And that’s how I know we made the right choice.

Because this story isn’t about losing a marriage.

It’s about saving a child.

And if there’s one thing I learned, it’s this:

Children don’t whisper the truth because it’s small.

They whisper it because they’ve learned it’s dangerous.

The night my daughter said, “Mom told me not to tell you,” she was really asking one question:

If I tell you the truth… will you protect me, even if it changes everything?

I did.

And yes—

it changed everything.

But my daughter didn’t have to lose herself to survive anymore.

And that’s the only ending that matters.

**“My Eight-Year-Old Whispered That Her Mother Told Her to Hide the Pain—And What I Saw Next Broke Me Completely”**

I thought the worst part would be the words.

I was wrong.

It was the silence that followed them.

That strange, suffocating silence that fills a house when something inside it has quietly collapsed.

Preview

Sophie stood with her back half-turned toward me, her small hands trembling at the hem of her shirt.

She wasn’t trying to hide anymore.

She was just afraid of what would happen after she stopped hiding.

---

“Sweetheart,” I said softly, forcing my voice to stay steady, “I’m right here. You’re safe. I just need to see, okay?”

She nodded once.

Barely.

Then slowly, she lifted her shirt.

---

The moment I saw her back, something inside me went completely still.

Not rage.

Not panic.

Something colder.

Something worse.

Recognition.

---

There were marks across her skin.

Not accidental.

Not mild.

Clear, uneven bruising stretching across her small back—some older, fading yellow and green… others darker, newer, angry in color.

Not the result of a single moment.

The result of repeated ones.

---

My throat tightened so hard I couldn’t speak.

For a few seconds, I forgot how breathing worked.

The room tilted slightly, as if reality itself had shifted under my feet.

---

“Sophie…” I finally managed.

My voice came out quieter than I intended.

“Who did this?”

---

She hesitated.

That hesitation broke me more than the bruises.

Because children hesitate when the answer has consequences.

Not when it’s simple.

---

Her eyes filled first.

Then her voice.

“Mom,” she whispered.

One word.

That was all it took.

---

I had faced negotiations that collapsed millions in seconds.

I had survived boardrooms that felt like war zones.

But nothing—nothing—prepared me for hearing my child say that word like it was both truth and fear at the same time.

---

I sat back slowly, trying not to let my reaction spill into her world.

Because if I broke in front of her, she would think she had broken me.

And that would make everything worse.

---

Instead, I exhaled carefully.

“Okay,” I said softly. “Okay. I need you to tell me everything from the beginning.”

---

Sophie swallowed.

“I spilled juice yesterday,” she said.

“I didn’t mean to. The cup slipped.”

Her fingers twisted together.

“I said sorry right away.”

---

I nodded.

“Go on.”

---

“She got really angry,” Sophie continued.

“She said I never listen. She said I do things on purpose.”

Her voice dropped lower.

“She pushed me into the door.”

---

The word landed like a physical impact.

Pushed.

Not accident.

Not discipline.

Intent.

---

“I hit my back really hard,” she whispered.

“I couldn’t breathe. I thought I was going to disappear.”

---

My hands curled into fists without me realizing it.

Not because I wanted to break something.

Because I was trying not to break everything.

---

“Did she help you after?” I asked quietly.

Sophie hesitated again.

Then shook her head.

“No,” she said. “She said I was being dramatic.”

---

Dramatic.

That word echoed in my mind like a stain that refused to fade.

Because children do not invent pain like this.

They endure it until they can’t anymore.

---

I reached out slowly.

Not touching her.

Just letting my hand rest near hers so she knew I was there.

“Why didn’t you tell me sooner?” I asked gently.

---

Sophie’s lip trembled.

“Mom said… if I told you, you’d get angry.”

Her voice cracked.

“And then everything would get worse.”

---

That was the moment something inside me changed.

Not just emotionally.

Structurally.

Like the foundation of everything I believed about my home had just shifted.

---

I looked at her carefully.

“Has this happened before?”

---

A pause.

Then she nodded.

Barely visible.

---

“How many times?” I asked.

Her eyes dropped to the floor.

“I don’t know,” she whispered.

“Sometimes she just… gets mad.”

---

I closed my eyes for a second.

Not to escape the truth.

To keep it from exploding outward.

---

When I opened them again, I forced my voice to stay calm.

“Sophie, listen to me very carefully.”

She looked up.

---

“You did nothing wrong.”

A pause.

“Nothing. Do you understand me?”

---

Her shoulders trembled slightly.

But she nodded.

---

“And you are not in trouble for telling me.”

Another pause.

“You are brave for telling me.”

---

For the first time since I walked into that house, her eyes met mine.

Not fully confident.

But less afraid.

---

“Can I… sit down?” she asked softly.

“Of course,” I said immediately.

---

She sat on the edge of the bed, still holding her back slightly as if expecting it to hurt just from existing.

I stayed kneeling in front of her.

At her level.

Not towering.

Not overwhelming.

Just present.

---

My mind was racing, but my voice stayed slow.

“I need to look at this properly,” I said.

“I’m going to take care of you. Okay?”

---

She nodded again.

Smaller this time.

Tired.

---

I stood carefully and moved toward the hallway.

Every step felt disconnected from the last.

Like I was walking through a version of my own life I no longer recognized.

---

In the kitchen, everything looked normal.

Too normal.

A half-finished glass of water.

A towel hanging neatly.

A quiet that felt staged.

---

That’s when I noticed her.

My wife.

Standing near the counter.

Watching me.

---

She didn’t look surprised.

Which told me everything before she even spoke.

---

“You’re home early,” she said calmly.

Almost casually.

Like nothing had happened in the last ten minutes that could possibly matter.

---

I stared at her.

Not speaking yet.

Because I needed to be sure I wasn’t imagining the shape of reality breaking in front of me.

---

“Sophie told me,” I said finally.

My voice was low.

Controlled.

Dangerously controlled.

---

For the first time, her expression shifted slightly.

Not fear.

Not guilt.

Annoyance.

---

“She’s exaggerating,” she said.

“She always does that when she doesn’t get her way.”

---

Something inside me went very still again.

But this time it wasn’t shock.

It was decision forming.

---

“She has bruises,” I said quietly.

That stopped the room for half a second.

---

My wife sighed.

“As I said,” she replied, “she’s dramatic.”

Like we were discussing weather.

Not a child.

Not pain.

Not truth.

---

I took a step closer.

“Did you hit her?” I asked.

No emotion in my voice now.

Only clarity.

---

Her eyes narrowed slightly.

“I disciplined her,” she said.

“She needs boundaries.”

---

That word.

Boundaries.

Used like a shield for something else entirely.

---

I nodded slowly.

As if confirming something I already knew.

Then I said:

“Show me your hands.”

---

A pause.

Then she scoffed.

“You’re not seriously—”

“Show me,” I repeated.

---

She didn’t move immediately.

That delay told me more than any answer could have.

But eventually, she lifted her hands slightly.

Calm.

Unbothered.

Almost offended.

---

And in that moment, I understood something I didn’t want to understand.

This wasn’t an accident.

This wasn’t loss of control.

This was routine.

---

I turned away before my expression could betray me.

Not because I was avoiding her.

Because I couldn’t let her see what I was becoming.

---

Back in Sophie’s room, I knelt beside her again.

She looked up instantly.

“Dad?” she asked softly.

---

I smiled gently.

Not because I felt gentle.

Because she needed me to look safe.

---

“I’m here,” I said.

“And you are not staying here tonight.”

---

Her eyes widened slightly.

“Where am I going?”

---

I paused.

Then answered carefully.

“With me.”

---

A beat.

Then she asked the question I knew would come.

“What about Mom?”

---

I looked at her for a long moment.

And for the first time, I didn’t soften the truth.

“Mom is going to have to answer some questions,” I said.

“From people who make sure children are safe.”

---

Sophie didn’t fully understand.

But she understood enough.

And that was all I needed for now.

---

That night, after she fell asleep in my arms, I stood by the window for a long time.

Watching the world outside continue as if nothing had changed.

As if a line hadn’t just been crossed that could never be uncrossed.

---

And I finally understood something I had avoided my entire life:

Sometimes the moment you come home is not the end of your journey.

It is the moment you realize what you have been coming home *to* all along.

And what you can no longer allow to continue.

The night didn’t feel like night anymore.

It felt like a threshold.

A thin line between the life I had believed I was living… and the life I could no longer ignore.

---

Sophie slept in my arms for almost an hour before I finally laid her down in my bedroom.

Not hers.

Not the room she had been quietly shrinking inside for months.

Mine.

Where I could see her.

Where I could hear her breathe.

Where nothing could reach her without going through me first.

---

I stayed beside her after she fell asleep.

Watching the rise and fall of her small chest.

Counting each breath like it mattered more than anything else in the world.

Because it did.

---

At some point, I stopped being just her father in that room.

I became something else.

Someone who was no longer allowed to misunderstand what was happening.

---

Downstairs, I could hear movement.

Slow.

Controlled.

Familiar.

My wife was still awake.

---

For a long time, I didn’t move.

Because movement meant decision.

And decision meant consequence.

---

Then my phone vibrated.

Once.

Twice.

A message.

From her.

*“We need to talk about Sophie. You’re overreacting.”*

---

I stared at the screen for a long time.

Not because I was unsure.

But because I was finally clear.

---

I set the phone down without replying.

And stood up.

---

The hallway felt different now.

Not physically.

But perceptually.

Like I was walking through the same house, but seeing its structure for the first time.

---

The kitchen light was on.

She was there.

Waiting.

Not nervous.

Not apologetic.

Prepared.

---

“You’re making this bigger than it is,” she said before I even spoke.

Her voice was steady.

Rehearsed.

---

I stopped at the edge of the room.

Not too close.

Not too far.

Just enough distance to see her clearly.

---

“Where is she safe?” I asked.

My voice was calm.

That surprised her slightly.

---

“She is safe,” she replied immediately.

“She’s just sensitive.”

---

Something inside me tightened.

Not anger yet.

Clarity sharpening.

---

“She has bruises,” I said again.

“Real ones.”

---

My wife sighed.

“That’s what happens when children are careless.”

---

That sentence.

That was the moment everything ended.

Not loudly.

Not dramatically.

Quietly.

Like a door locking from the inside.

---

I nodded once.

Slowly.

And said:

“Show me the room where it happened.”

---

A pause.

Too long.

---

“No,” she said.

Immediately.

---

And that was all I needed.

Not confirmation.

Not explanation.

Just refusal.

---

I turned away without another word.

And walked back upstairs.

---

Sophie stirred slightly when I entered.

“Dad?” she whispered.

Half asleep.

Half aware.

---

“I’m here,” I said softly.

“I’m right here.”

---

I picked her up carefully.

She didn’t resist.

Didn’t question.

Just instinctively held onto me.

---

And for the first time since I walked into this house that evening…

I knew I wasn’t coming back downstairs alone.

---

We left through the side door.

Quietly.

No confrontation.

No argument.

No warning.

Just exit.

---

Outside, the air was colder than I expected.

Or maybe I had just stopped feeling warmth properly.

---

I placed her in the passenger seat.

Buckled her in myself.

Checked the straps twice.

Three times.

As if repetition could guarantee safety.

---

“Where are we going?” she asked softly.

Half awake.

---

“To somewhere safe,” I said.

And started the car.

---

It wasn’t until we were driving that my phone rang again.

Her name on the screen.

Again.

Again.

Again.

---

I didn’t answer.

---

Instead, I pulled over once we were far enough.

And called someone else.

---

A friend.

A contact I hadn’t used in years.

Someone who dealt with situations that didn’t resolve themselves through conversation.

---

“I need help,” I said when they picked up.

A pause.

Then:

“No questions,” I added.

---

They understood immediately.

Some relationships don’t need explanation.

Only urgency.

---

By the time I reached the temporary place they arranged, Sophie was asleep again.

This time more deeply.

Like her body finally believed it was allowed to rest.

---

I carried her inside.

And for the first time in months, I didn’t feel like I was reacting to something.

I felt like I was acting before it could continue.

---

Later that night, I sat alone in the dark living room.

My phone lit up again and again.

Messages.

Calls.

Voicemails.

---

I didn’t listen to them.

Not because I was avoiding truth.

But because I had finally stopped negotiating with it.

---

At some point, I realized something simple.

Something that made everything before this moment feel like denial I had been participating in without realizing it:

This wasn’t a misunderstanding.

It was a pattern.

And patterns don’t stop because you wish them to.

They stop when someone interrupts them.

---

The next morning, Sophie woke up slowly.

Confused at first.

Then she saw me.

And relaxed again.

That told me everything I needed to know.

Not about fear.

But about safety.

---

“Are we in trouble?” she asked softly.

I shook my head.

“No,” I said.

“You’re not in trouble for anything anymore.”

---

She nodded.

Then asked the question children always ask when their world shifts:

“Will things be like before?”

---

I thought about that carefully.

Then answered honestly:

“No.”

A pause.

“Not like before.”

Then softer:

“But better than before.”

---

She seemed to accept that.

Not fully.

But enough.

---

Outside, the world kept moving.

Unaware.

Unbothered.

As if nothing significant had changed.

But inside me, something irreversible had already settled.

---

Because once you see what a child has been carrying in silence…

You don’t get to unsee it.

And you don’t get to wait anymore.

You act.

Even if everything else breaks in the process.

Especially then.

Report this article

Select a reason for reporting:

Inaccurate information Copyright violation Spam / advertisement Offensive content Other '; footer.hidden = true; overlay.hidden = false; document.body.style.overflow = 'hidden'; } function hideSection() { if (section) section.hidden = true; } function openModal() { if (alreadyReported) { showSuccess(); return; } overlay.hidden = false; document.body.style.overflow = 'hidden'; } function closeModal() { overlay.hidden = true; document.body.style.overflow = ''; footer.hidden = false; overlay.querySelectorAll('input[name="report_reason"]').forEach(function(r) { r.checked = false; }); document.getElementById('reportMessage').value = ''; errorBox.hidden = true; submitBtn.disabled = false; submitBtn.textContent = 'Submit report'; imageItems = []; imgGrid.innerHTML = ''; updateAttachBtn(); } btn.addEventListener('click', openModal); closeBtn.addEventListener('click', closeModal); cancelBtn.addEventListener('click', closeModal); overlay.addEventListener('click', function(e) { if (e.target === overlay) closeModal(); }); document.addEventListener('keydown', function(e) { if (!overlay.hidden && e.key === 'Escape') closeModal(); }); // --- Error helper --- function showError(msg) { errorBox.textContent = msg; errorBox.hidden = false; } // --- Submit --- submitBtn.addEventListener('click', function() { var selected = overlay.querySelector('input[name="report_reason"]:checked'); if (!selected) { showError('Please select a reason.'); return; } errorBox.hidden = true; submitBtn.disabled = true; var itemsToUpload = imageItems.filter(function(it) { return !it.uploadedUrl; }); if (itemsToUpload.length === 0) { doSubmit(selected.value); return; } submitBtn.textContent = 'Uploading…'; var done = 0, failed = 0; itemsToUpload.forEach(function(entry) { entry.statusEl.textContent = '…'; entry.statusEl.className = 'report-img-item__status'; entry.statusEl.hidden = false; resizeImage(entry.file, MAX_LONG_PX, function(resized) { uploadFile(resized, currentSlug, function(err, url) { done++; if (err) { failed++; entry.statusEl.textContent = 'Failed'; entry.statusEl.className = 'report-img-item__status err'; } else { entry.uploadedUrl = url; entry.statusEl.textContent = '✓'; entry.statusEl.className = 'report-img-item__status done'; } if (done === itemsToUpload.length) { if (failed > 0) { showError('Could not upload ' + failed + ' image(s). Remove the failed ones (red) or submit without them.' ); submitBtn.disabled = false; submitBtn.textContent = 'Submit report'; } else { doSubmit(selected.value); } } }); }); }); }); function doSubmit(reason) { submitBtn.textContent = 'Sending…'; var uploadedUrls = imageItems .map(function(it) { return it.uploadedUrl; }) .filter(Boolean); var payload = { reason: reason, message: document.getElementById('reportMessage').value.trim(), post_slug: currentSlug, post_url: window.location.href }; if (uploadedUrls.length) payload.image_urls = uploadedUrls; fetch('/api/post-report', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Requested-With': 'XMLHttpRequest' }, body: JSON.stringify(payload) }) .then(function(r) { return r.json(); }) .then(function(data) { if (data && data.ok) { markReported(currentSlug); alreadyReported = true; bodyEl.innerHTML = '✓ Thank you for your report.'; footer.hidden = true; setTimeout(function() { closeModal(); footer.hidden = false; hideSection(); }, 2000); } else { showError((data && data.message) ? data.message : 'Something went wrong. Please try again.'); submitBtn.disabled = false; submitBtn.textContent = 'Submit report'; } }) .catch(function() { showError('Connection failed. Please try again.'); submitBtn.disabled = false; submitBtn.textContent = 'Submit report'; }); } })();

Comments 0

Posting as Guest '; } return; } var normalizedItems = items.slice().reverse(); var html = normalizedItems.map(function(comment) { var replies = Array.isArray(comment.replies) ? comment.replies : []; var repliesHtml = replies.map(function(reply) { return '' + '' + '' + '' + '' + escapeHtml(reply.author_name) + '' + escapeHtml(reply.time) + '' + '

' + escapeHtml(reply.content) + '

' + '' + '' + '' + ''; }).join(''); return '' + '' + '' + '' + '' + escapeHtml(comment.author_name) + '' + escapeHtml(comment.time) + '' + '

May you like

' + escapeHtml(comment.content) + '

' + '' + '' + '' + '' + (repliesHtml ? '' + repliesHtml + '' : '') + ''; }).join(''); if (mode === 'prepend') { listEl.insertAdjacentHTML('afterbegin', html); return; } listEl.insertAdjacentHTML('beforeend', html); } async function loadComments(page, mode) { var query = new URLSearchParams({ post_slug: postSlug, page: String(page), per_page: String(perPage), }); var response = await fetch('/api/post-comments?' + query.toString(), { method: 'GET', headers: { 'Accept': 'application/json' } }); var data = await response.json().catch(function() { return {}; }); if (!response.ok || data.ok === false) { throw new Error((data && data.message) || 'Cannot load comments.'); } var pagination = data.pagination || {}; currentPage = Number(pagination.current_page || 1); lastPage = Number(pagination.last_page || 1); totalCountEl.textContent = String((data.post && data.post.comment_count) || pagination.total || 0); loadMoreBtn.classList.toggle('comment-box__hidden', currentPage >= lastPage); renderComments(data.comments || [], mode); } async function postComment(content, parentId, feedbackTarget, submitTarget) { var authorName = ensureName(false); if (!authorName) { var forced = ensureName(true); if (!forced) { throw new Error('Please enter your name first.'); } authorName = forced; } var payload = { post_slug: postSlug, post_url: window.location.href, author_name: authorName, content: content, }; if (parentId > 0) { payload.parent_id = parentId; } if (submitTarget) submitTarget.disabled = true; if (feedbackTarget) { feedbackTarget.textContent = 'Submitting...'; feedbackTarget.style.color = ''; } try { var response = await fetch('/api/post-comments', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: JSON.stringify(payload) }); var data = await response.json().catch(function() { return {}; }); if (!response.ok || data.ok === false) { throw new Error((data && data.message) || 'Cannot submit comment.'); } await loadComments(1, 'replace'); return true; } finally { if (submitTarget) submitTarget.disabled = false; } } form.addEventListener('submit', async function(event) { event.preventDefault(); var content = String(contentEl.value || '').trim(); if (!content) { setFeedback('Please enter comment content.', true); return; } submitBtn.disabled = true; setFeedback('Submitting...'); try { await postComment(content, 0); contentEl.value = ''; setFeedback('Comment submitted.'); } catch (error) { setFeedback(error.message || 'Cannot submit comment.', true); } finally { submitBtn.disabled = false; } }); listEl.addEventListener('click', function(event) { var replyBtn = event.target.closest('.comment-item__reply-btn'); if (replyBtn) { var row = replyBtn.closest('.comment-item'); if (!row) return; var formEl = row.querySelector('.comment-item__reply-form'); if (!formEl) return; listEl.querySelectorAll('.comment-item__reply-form').forEach(function(f) { if (f !== formEl) f.classList.add('comment-box__hidden'); }); formEl.classList.remove('comment-box__hidden'); var input = formEl.querySelector('textarea'); if (input) input.focus(); return; } var cancelBtn = event.target.closest('.comment-item__reply-cancel'); if (cancelBtn) { var rf = cancelBtn.closest('.comment-item__reply-form'); if (!rf) return; rf.classList.add('comment-box__hidden'); var rInput = rf.querySelector('textarea'); var rFeedback = rf.querySelector('.comment-item__reply-feedback'); if (rInput) rInput.value = ''; if (rFeedback) rFeedback.textContent = ''; } }); listEl.addEventListener('submit', async function(event) { var replyForm = event.target.closest('.comment-item__reply-form'); if (!replyForm) return; event.preventDefault(); var row = replyForm.closest('.comment-item'); if (!row) return; var parentId = Number(row.getAttribute('data-comment-id') || 0); var input = replyForm.querySelector('textarea'); var submit = replyForm.querySelector('.comment-item__reply-submit'); var feedback = replyForm.querySelector('.comment-item__reply-feedback'); var replyText = String((input && input.value) || '').trim(); if (!replyText) { if (feedback) { feedback.textContent = 'Please enter reply content.'; feedback.style.color = '#dc2626'; } return; } try { await postComment(replyText, parentId, feedback, submit); // setFeedback('Reply submitted.'); } catch (error) { if (feedback) { feedback.textContent = error.message || 'Cannot submit reply.'; feedback.style.color = '#dc2626'; } } }); changeNameBtn.addEventListener('click', function() { ensureName(true); }); loadMoreBtn.addEventListener('click', async function() { if (currentPage >= lastPage) return; loadMoreBtn.disabled = true; try { await loadComments(currentPage + 1, 'prepend'); } catch (error) { setFeedback(error.message || 'Cannot load more comments.', true); } finally { loadMoreBtn.disabled = false; } }); ensureName(false); loadComments(1, 'replace').catch(function(error) { setFeedback(error.message || 'Cannot load comments.', true); }); })();

Other posts