soup icon indicating copy to clipboard operation
soup copied to clipboard

mse90713 fix (bounty message in close dialog) broke at some point

Open gparyani opened this issue 5 years ago • 2 comments

The mse90713 fix (which adds a warning to the close dialog on questions with active bounties indicating that they cannot be voted for closure) broke at some point, possibly due to SE design changes. (I can't pinpoint when exactly, since I've not run into a case where I've attempted to close a bountied question in a while.)

gparyani avatar Feb 11 '20 06:02 gparyani

Can be fixed with:

fixes.mse90713 = {
	title:	"Show “this question has an active bounty and cannot be closed” earlier, when it applies",
	url:	"https://meta.stackexchange.com/q/90713",
	// XXX: the bounty detection won't work in review; hopefully bountied questions should rarely appear there
	path:	/^\/questions\/\d+\b/,
	script:	function () {
		if ( ! $('.js-post-notice').length || ! $('.js-post-notice').find('b').text().match(/bounty/) ) return; // no bounty notice => nothing to do

		var notice = '<div class="soup-mse90713-notice">This question has an open bounty and cannot be closed.</div>';

		// disable any radio buttons that don't open a submenu
		// TODO: super-disable the submit button instead? (see mso358862 fix below)
		SOUP.hookAjax( /^\/flags\/questions\/\d+\/close\/popup\b/, function () {
			$('#popup-close-question h2.popup-title-container').after( notice );
			$('#popup-close-question input[type=radio]:not([data-subpane-name][data-subpane-name!=""])').disable();
		} );
		// also prevent the dupe finder from enabling the submit button
		SOUP.hookAjax( /^\/posts\/popup\/close\/search-originals\/\d+\b/, function () {
			$('.popup-submit').disable();
		} );
	},
	// the colors are based on the .message.message-error style in all.css on SO
	css:	".soup-mse90713-notice { color: #F9ECED; background-color: #C04848; text-align: center; padding: 11px; margin-bottom: 4px }"
};

Looks like it broke with the new SE post notices.

double-beep avatar Feb 21 '20 07:02 double-beep

@double-beep Your change won't work now, unfortunately, as changes were made to the close UI in April.

gparyani avatar May 08 '20 06:05 gparyani