var commentModule=function(n,t){function i(n){t("#MessageDialog").dialog().html(n)}function r(n,i,r){t('<div id="confirmDialog"><\/div>').appendTo("body").html("<p>"+r+"<\/p>").dialog({title:"Warning",resizable:!1,height:200,modal:!0,buttons:[{text:"Yes","class":"btn px-1 py-1",click:function(){var r=[];t(".jsRecipients").each(function(){r.push(t(this).val())});t(this).dialog("close");t.post("/EditComment"+i,{commentId:n,recipients:r}).done(function(){window.location.href=window.location.href})}},{text:"No","class":"btn px-1 py-1",click:function(){t(this).dialog("close")}}]})}var u="editorDialog",f="#editorDialog";return{deleteComment:function(n){r(n,"/DeleteComment","Really delete the comment?")},deleteCommentContent:function(n){r(n,"/DeleteCommentContent","Really delete the content of your comment?")},editComment:function(n){var r=t("<div />").attr("id",u),f={commentId:n};t.ajax({type:"POST",url:"/EditComment/GetEditor",data:JSON.stringify(f),contentType:"application/json; charset=utf-8",async:!0,success:function(n){r.dialog({width:600,title:"Edit your comment"}).html(n)},error:function(){i("Failed to load dialog.")}})},submitCommentChange:function(n,r){var u=t("#"+n).val(),f;u.length<1||(f={body:u,commentId:r},t.ajax({type:"POST",url:"/EditComment/UpdateComment",data:JSON.stringify(f),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){n?window.location.href=window.location.href:i("Failed to load dialog."+n)},error:function(n){i("Failed to load dialog: "+n.status+" "+n.statusText)}}))},closeEditDialog:function(){t(f).dialog("destroy")}}}(window.EPiWeb=window.EPiWeb||{},jQuery)