Last active
March 10, 2016 14:41
-
-
Save vyznev/58747ec3eb4a02bf19c2 to your computer and use it in GitHub Desktop.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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