Diffdown is a real-time collaborative Markdown editor/previewer built on the AT Protocol diffdown.com

fix: expose collaboration functions on window for inline onclick handlers

+6 -6
+6 -6
templates/document_edit.html
··· 435 435 436 436 // ── Invite ──────────────────────────────────────────────────────────────── 437 437 438 - async function generateInvite() { 438 + window.generateInvite = async function generateInvite() { 439 439 const modal = document.getElementById('invite-modal'); 440 440 const body = document.getElementById('invite-modal-body'); 441 441 if (!modal) return; ··· 464 464 } 465 465 } 466 466 467 - function copyInviteLink() { 467 + window.copyInviteLink = function copyInviteLink() { 468 468 const input = document.getElementById('invite-link-input'); 469 469 if (!input) return; 470 470 navigator.clipboard.writeText(input.value).then(() => { ··· 473 473 }); 474 474 } 475 475 476 - function closeInviteModal() { 476 + window.closeInviteModal = function closeInviteModal() { 477 477 const modal = document.getElementById('invite-modal'); 478 478 if (modal) modal.style.display = 'none'; 479 479 } ··· 586 586 const commentForm = document.getElementById('comment-form'); 587 587 const commentTextEl = document.getElementById('comment-text'); 588 588 589 - function openCommentForm() { 589 + window.openCommentForm = function openCommentForm() { 590 590 if (!commentBtn || !commentForm) return; 591 591 const rect = commentBtn.getBoundingClientRect(); 592 592 commentForm.style.top = rect.bottom + window.scrollY + 4 + 'px'; ··· 596 596 commentTextEl.focus(); 597 597 } 598 598 599 - function closeCommentForm() { 599 + window.closeCommentForm = function closeCommentForm() { 600 600 if (commentForm) commentForm.style.display = 'none'; 601 601 if (commentBtn) commentBtn.style.display = 'none'; 602 602 activeCommentParagraphId = null; 603 603 } 604 604 605 - async function submitComment() { 605 + window.submitComment = async function submitComment() { 606 606 if (!activeCommentParagraphId) return; 607 607 const text = commentTextEl.value.trim(); 608 608 if (!text) return;