From 4e9cf27394da2481a8ac81a2965873a3a16b136f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 11 Mar 2013 23:08:40 +0100 Subject: [PATCH] [ticket/9657] Remove softdelete reason field when permanent delete is selected PHPBB3-9657 --- phpBB/assets/javascript/core.js | 12 ++++++++++++ phpBB/language/en/posting.php | 4 ++-- phpBB/styles/prosilver/template/ajax.js | 8 ++++++++ .../prosilver/template/confirm_delete_body.html | 8 ++++---- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 40da09377e..7a4aceee0b 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -317,6 +317,18 @@ phpbb.ajaxify = function(options) { }); } }, false); + + // Add the click function to the code we just laoded. + // Should be removed and replace with a call to .on() + // when jQuery is updated to 1.7.x or higher + // $(document).on('click', '#delete_permanent', function () {}); + $('#delete_permanent').click(function () { + if ($(this).attr('checked')) { + $('#delete_reason').hide(); + } else { + $('#delete_reason').show(); + } + }); } } diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 1ed312f68c..c1d8c71783 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -83,8 +83,8 @@ $lang = array_merge($lang, array( 'DELETE_POST_PERMANENTLY' => 'Permanently delete this post so it can not be recovered', 'DELETE_POSTS_CONFIRM' => 'Are you sure you want to delete these posts?', 'DELETE_POSTS_PERMANENTLY_CONFIRM' => 'Are you sure you want to permanently delete these posts?', - 'DELETE_REASON' => 'Delete reason', - 'DELETE_REASON_EXPLAIN' => 'The reason is only used when the post is not deleted permanently.', + 'DELETE_REASON' => 'Soft delete reason', + 'DELETE_REASON_EXPLAIN' => 'The reason is only shown to moderators when post is soft deleted.', 'DELETE_POST_WARN' => 'Deleted this post', 'DELETE_TOPIC_CONFIRM' => 'Are you sure you want to delete this topic?', 'DELETE_TOPIC_PERMANENTLY' => 'Permanently delete this topic so it can not be recovered', diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 357e9a6fa3..5661a51bc9 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -230,6 +230,14 @@ $('#quick-mod-select').change(function () { $('#quickmodform').submit(); }); +$('#delete_permanent').click(function () { + if ($(this).attr('checked')) { + $('#delete_reason').hide(); + } else { + $('#delete_reason').show(); + } +}); + /** * Toggle the member search panel in memberlist.php. * diff --git a/phpBB/styles/prosilver/template/confirm_delete_body.html b/phpBB/styles/prosilver/template/confirm_delete_body.html index 9f36d2d824..964c859634 100644 --- a/phpBB/styles/prosilver/template/confirm_delete_body.html +++ b/phpBB/styles/prosilver/template/confirm_delete_body.html @@ -11,9 +11,9 @@ -