I've added a client-side implementation of this feature into the Stack Overflow Unofficial Patch v1.10.
In case you're curious, here's the JavaScript code that does it:
if ( ! $('body.tools-page.flag-page').length ) return;
if ( SOUP.userRep < ( SOUP.isBeta ? 4000 : 20000 ) ) return;
var html = '<input title="vote to delete this answer" class="delete-post" value="delete answer" type="button">';
SOUP.hookAjax( /^\/posts\/\d+\/vote\/[023]\b/, function ( event, xhr, settings ) {
var score = $.parseJSON( xhr.responseText ).NewScore;
var pid = Number( settings.url.replace( /^\/posts\/(\d+)\/.*/, '$1' ) );
// if it's not an answer, do nothing
if ( ! $('#flagged-' + pid + ' #answer-' + pid).length ) return;
// find *all* the delete buttons/links; there may be several!
var button = $('[id="delete-post-' + pid + '"]');
if ( score >= 0 ) button.hide();
else if ( button.length ) button.show();
else $(html).attr('id', 'delete-post-' + pid).insertAfter('#flagged-' + pid + ' .flag-post-button').before(' ');
} );
The SOUP.hookAjax()
function is a small piece of utility code that monitors the jQuery AJAX requests used to submit post up/downvotes. If an answer is upvoted (or un-downvoted) to a positive score from the review view, the event handler above hides the delete button; if it's downvoted to a score of zero or less, it re-shows it, or, if necessary, injects its own "fake" (but fully functional!) delete button.
(For an official fix, it would probably be easier to just include the delete buttons in the HTML for all answers, but hide it by default for those with a positive score. I can't do that in a user script, so I have to hardcode the button HTML into the script.)
share
,Ctrl+C
,Alt+D
,Ctrl+V
,enter
>F5
(not that I'd mind your proposal, if there's time to spare for implementing it...)