diff --git a/resources/views/videos/shorts.blade.php b/resources/views/videos/shorts.blade.php index aed74a2..8600319 100644 --- a/resources/views/videos/shorts.blade.php +++ b/resources/views/videos/shorts.blade.php @@ -658,6 +658,37 @@ @endauth }; + // ── Comments pane ────────────────────────────────────── + window.shortOpenComments = function(videoKey) { + const pane = document.getElementById('shortsCommentsPane'); + const backdrop = document.getElementById('shortsCommentsBackdrop'); + const body = document.getElementById('shortsCommentsBody'); + if (!pane || !body) return; + body.innerHTML = '
Loading…
'; + pane.classList.add('visible'); + pane.setAttribute('aria-hidden', 'false'); + backdrop?.classList.add('visible'); + fetch('/videos/' + videoKey, { + headers: { 'X-Requested-With': 'XMLHttpRequest' }, + credentials: 'same-origin' + }) + .then(r => r.text()) + .then(html => { + const doc = new DOMParser().parseFromString(html, 'text/html'); + const section = doc.getElementById('ytcSection'); + if (section) { body.innerHTML = ''; body.appendChild(section); } + else { body.innerHTML = '
Comments unavailable.
'; } + }) + .catch(() => { body.innerHTML = '
Could not load comments.
'; }); + }; + window.shortCloseComments = function() { + const pane = document.getElementById('shortsCommentsPane'); + const backdrop = document.getElementById('shortsCommentsBackdrop'); + pane?.classList.remove('visible'); + pane?.setAttribute('aria-hidden', 'true'); + backdrop?.classList.remove('visible'); + }; + // ── Share ────────────────────────────────────────────────── window.shortShare = function(videoKey, title) { const url = window.location.origin + '/videos/' + videoKey;