Browse Source

Fix post deletion

pull/40/head
8chan 9 years ago
committed by czaks
parent
commit
6b04b3c671
  1. 2
      inc/functions.php
  2. 5
      js/fix-report-delete-submit.js

2
inc/functions.php

@ -1130,6 +1130,8 @@ function deleteFile($id, $remove_entirely_if_already=true, $file=null) {
$files = json_decode($post['files']);
$file_to_delete = $file !== false ? $files[(int)$file] : (object)array('file' => false);
if (!$files[0]) error(_('That post has no files.'));
if ($files[0]->file == 'deleted' && $post['num_files'] == 1 && !$post['thread'])
return; // Can't delete OP's image completely.

5
js/fix-report-delete-submit.js

@ -11,7 +11,7 @@
if (active_page == 'thread' || active_page == 'index') {
$(document).ready(function(){
if ($('.delete #password').length) {
if ($('#delete-fields #password').length) {
Menu.add_item("delete_post_menu", _("Delete post"));
Menu.add_item("delete_file_menu", _("Delete file"));
Menu.onclick(function(e, $buf) {
@ -53,9 +53,8 @@ Menu.onclick(function(e, $buf) {
});
$(document).on('new_post', function(){
$('div.delete').hide();
$('input.delete').hide();
});
$('div.delete').hide();
$('input.delete').hide();
$('#post-moderation-fields').hide();
})}

Loading…
Cancel
Save