Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This script tweaks the Stack Exchange Low Quality Posts review queue interface so as not to consume delete votes from reviewers who can cast them (i.e. those who have 20k+ rep, on graduated sites). See http://meta.stackoverflow.com/questions/316010/stop-using-delete-votes-in-the-lqprq for a related feature request and rationale.
// ==UserScript==
// @name Stack Exchange LQP delete vote saver
// @namespace https://github.com/vyznev/
// @description Tweaks the Stack Exchange Low Quality Posts review queue not to consume delete votes from 20k+ users
// @author Ilmari Karonen
// @version 0.2
// @license Public Domain (CC-Zero)
// @homepageURL http://meta.stackoverflow.com/a/316092
// @match *://*.stackexchange.com/review/low-quality-posts*
// @match *://*.stackoverflow.com/review/low-quality-posts*
// @match *://*.superuser.com/review/low-quality-posts*
// @match *://*.serverfault.com/review/low-quality-posts*
// @match *://*.stackapps.com/review/low-quality-posts*
// @match *://*.mathoverflow.net/review/low-quality-posts*
// @match *://*.askubuntu.com/review/low-quality-posts*
// @grant none
// ==/UserScript==
var inject = function ($) {
$( document ).ajaxComplete( function( event, xhr, settings ) {
var m = /^\/posts\/popup\/delete\/(\d+)/.exec( settings.url );
if ( !m ) return;
var form = $('form#delete-question-form[action="/posts/' + m[1] + '/vote/10"]');
form.attr( 'action', '/posts/' + m[1] + '/recommend-delete' );
// show that it's doing something:
form.find( 'input.popup-submit' ).val( function (i, txt) { return txt + ' :)' } );
} );
};
var script = document.createElement( 'script' );
script.textContent = '(' + inject + ')(jQuery);';
document.body.appendChild( script );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.