Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gparyani opened this issue Feb 11, 2020 · 2 comments
Open

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

gparyani opened this issue Feb 11, 2020 · 2 comments

Comments

@gparyani
Copy link

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.)

@double-beep
Copy link

double-beep commented Feb 21, 2020

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.

gparyani added a commit to gparyani/soup that referenced this issue Feb 21, 2020
@gparyani
Copy link
Author

gparyani commented May 8, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants