/* Note: comment replies are called "comments" because part of this code was taken from another project of mine. */ function SetupReplies(post, comment) { SetupAddEditComment(post, comment, false); SetupShowMoreComments(post, comment); post.find('.comment-reply-row').each(function () { SetupRepliesControls($(this), comment); }); post.find('.comment-reply-row').hover(function () { $(this).find('span').attr('data-hover', 'true'); }, function () { $(this).find('span').attr('data-hover', 'false'); }); } function SetupAddEditComment(post, comment, edit) { /* Variables that will be set by Initialize() */ var Form = null; var Body = null; var AddButton = null; var TextCounter = null; var AjaxLoader = null; var FormContainer = null; var DialogTableRowContainer = null; /* Constants */ var MIN_LENGTH = 15; var MAX_LENGTH = 600; /* State keeping booleans */ var Initialized = false; var Active = false; var Flashing = false; var Submitting = false; /* Shortcuts */ var CommentsTable = post.find('.comment-replies > table'); var AddCommentLink = post.find('.add-reply'); var CommentsCount = comment.replies.length; if(edit) Open(); else AddCommentLink.click(function () { Open(); }); function Initialize() { if (Initialized) return; Initialized = true; var row = $('