function replyTo(imageId, commentId, userId) { // 1. Get the main comment form container (ID added in theme.php) var postBox = $("#comment_add_for_" + imageId); // 2. Get the comment being replied to var targetComment = $("#c" + commentId); // 3. Move the comment form after the target comment (or its replies container) // This ensures the reply form appears immediately beneath the parent comment. postBox.insertAfter(targetComment); // 4. Set the parent_comment_id hidden field for PHP submission $("#parent_comment_id_" + imageId).val(commentId); // 5. Pre-fill the text area with the reply link var box = $("#comment_on_" + imageId); var text = "[url=site://post/view/" + imageId + "#c" + commentId + "]@" + userId + "[/url]: "; box.focus(); // Set the reply text. If the box already has content, append it on a new line. if (box.val().trim() === "" || box.val().slice(-1) === '\n') { box.val(box.val() + text); } else { box.val(box.val() + "\n" + text); } // 6. Highlight the comment being replied to targetComment.highlight(); } SoyBooru - plant
AllMy FavoritesPopular PostsPopular by DayPopular by MonthPopular by YearRandom Post