function lock_thread(lock) { $.ajax({ url: "/forums/lock/<%= "#{@thread.id}/" %>" + lock, dataType: "script", type: "post" }); } function delete_post(thread_id, post_id, action, extra) { $.ajax({ url: "/forums/post/" + post_id + "/" + action + "?" + extra, dataType: "script", type: "delete" }); } function done_delete(id, visible) { if (visible==0) { $('#delete_' + id).hide(); $('#undelete_' + id).show(); if (!$('#body_'+id).hasClass('hidden_thread_title')) { $('#body_'+id).addClass('hidden_thread_title'); } } else { $('#delete_' + id).show(); $('#undelete_' + id).hide(); if ($('#body_'+id).hasClass('hidden_thread_title')) { $('#body_'+id).removeClass('hidden_thread_title'); } } $('#mod_comment_'+id).hide(); $('#mod_button_'+id).show(); } var editing_id = null; function edit_post(thread_id, post_id) { if (editing_id!=null) { $('#popup_form').remove(); } body = $('#body_'+post_id); body.append('
'); div = $('#popup_form'); div.append('Post: '); markdown_editor('#topic_post_body_mod'); div.append('Comment: '); div.append('