'Saviour' of Lost Souls v1.1

This commit is contained in:
Glorfindel 2019-10-09 12:18:06 +02:00
parent ab5ef30ae4
commit 0cdfc500ff
1 changed files with 5 additions and 3 deletions

View File

@ -5,7 +5,7 @@
// @author Glorfindel // @author Glorfindel
// @updateURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/saviour-of-lost-souls/saviour-of-lost-souls.user.js // @updateURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/saviour-of-lost-souls/saviour-of-lost-souls.user.js
// @downloadURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/saviour-of-lost-souls/saviour-of-lost-souls.user.js // @downloadURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/saviour-of-lost-souls/saviour-of-lost-souls.user.js
// @version 1.0 // @version 1.1
// @match *://meta.stackexchange.com/questions/* // @match *://meta.stackexchange.com/questions/*
// @match *://meta.stackoverflow.com/questions/* // @match *://meta.stackoverflow.com/questions/*
// @match *://softwarerecs.stackexchange.com/questions/* // @match *://softwarerecs.stackexchange.com/questions/*
@ -243,7 +243,7 @@ function main(question) {
}); });
} }
if (shouldFlag) { if (shouldFlag || shouldVoteToClose) {
// Flag/vote to close (which one doesn't matter for the API call) // Flag/vote to close (which one doesn't matter for the API call)
$.post({ $.post({
url: "https://" + document.location.host + "/flags/questions/" + postID + "/close/add", url: "https://" + document.location.host + "/flags/questions/" + postID + "/close/add",
@ -258,7 +258,9 @@ function main(question) {
console.log("Error: " + textStatus + " " + errorThrown); console.log("Error: " + textStatus + " " + errorThrown);
} }
}); });
} else if (shouldVoteToDelete) { }
if (shouldVoteToDelete) {
// Delete vote // Delete vote
// NICETOHAVE: maybe also if myReputation >= 10000 and question age >= 48 hours // NICETOHAVE: maybe also if myReputation >= 10000 and question age >= 48 hours
$.post({ $.post({