diff --git a/admin-flag-notifier/admin-flag-notifier.user.js b/admin-flag-notifier/admin-flag-notifier.user.js index f5127a1..9902939 100644 --- a/admin-flag-notifier/admin-flag-notifier.user.js +++ b/admin-flag-notifier/admin-flag-notifier.user.js @@ -8,11 +8,12 @@ // @version 0.2 // @match *://*.stackexchange.com/admin/dashboard* // @match *://*.stackoverflow.com/admin/dashboard* -// @match *://*.superuser.com/admin/dashboard* -// @match *://*.serverfault.com/admin/dashboard* -// @match *://*.askubuntu.com/admin/dashboard* -// @match *://*.stackapps.com/admin/dashboard* -// @match *://*.mathoverflow.net/admin/dashboard* +// @match *://stackoverflow.com/admin/dashboard* +// @match *://superuser.com/admin/dashboard* +// @match *://serverfault.com/admin/dashboard* +// @match *://askubuntu.com/admin/dashboard* +// @match *://stackapps.com/admin/dashboard* +// @match *://mathoverflow.net/admin/dashboard* // @grant none // ==/UserScript== diff --git a/destroy-spammer/destroy-spammer.user.js b/destroy-spammer/destroy-spammer.user.js index 4620273..ca776fd 100644 --- a/destroy-spammer/destroy-spammer.user.js +++ b/destroy-spammer/destroy-spammer.user.js @@ -3,14 +3,15 @@ // @namespace https://github.com/Glorfindel83/ // @description Adds a 'Destroy spammer' link for moderator on user profiles with only deleted posts. // @author Glorfindel -// @version 0.4.4 +// @version 0.4.5 // @match *://*.stackexchange.com/users/* // @match *://*.stackoverflow.com/users/* -// @match *://*.superuser.com/users/* -// @match *://*.serverfault.com/users/* -// @match *://*.askubuntu.com/users/* -// @match *://*.stackapps.com/users/* -// @match *://*.mathoverflow.net/users/* +// @match *://stackoverflow.com/users/* +// @match *://superuser.com/users/* +// @match *://serverfault.com/users/* +// @match *://askubuntu.com/users/* +// @match *://stackapps.com/users/* +// @match *://mathoverflow.net/users/* // @grant none // ==/UserScript== (function () { diff --git a/show-flag-responses/show-flag-responses.user.js b/show-flag-responses/show-flag-responses.user.js new file mode 100644 index 0000000..0924429 --- /dev/null +++ b/show-flag-responses/show-flag-responses.user.js @@ -0,0 +1,62 @@ +// ==UserScript== +// @name Moderator History - Show Flag Responses +// @namespace https://github.com/Glorfindel83/ +// @description Loads flag responses (decline reasons and custom messages) into the Moderator History page. +// @author Glorfindel +// @updateURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/show-flag-responses/show-flag-responses.user.js +// @downloadURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/show-flag-responses/show-flag-responses.user.js +// @version 0.1 +// @match *://*.stackexchange.com/admin/history/* +// @match *://*.stackoverflow.com/admin/history/* +// @match *://stackoverflow.com/admin/history/* +// @match *://superuser.com/admin/history/* +// @match *://serverfault.com/admin/history/* +// @match *://askubuntu.com/admin/history/* +// @match *://stackapps.com/admin/history/* +// @match *://mathoverflow.net/admin/history/* +// @grant none +// ==/UserScript== + +(function () { + "use strict"; + + $("ul#mod-user-history > li").each(function() { + let post = $(this); + + // Find time of handling (important to separate multiple flags on a single post) + let time = post.find("span.relativetime").attr("title"); + + // Find post ID + let link = post.find("a"); + if (link.length == 0) + // e.g. tag merges + return; + let href = link.attr("href"); + let matches = (link.hasClass("question-hyperlink") + ? /\/questions\/(\d+)\//g : /#(\d+)/g).exec(href); + let postID = parseInt(matches[1]); + + // Load Post Flag History page + $.get("https://apple.stackexchange.com/admin/posts/" + postID + "/show-flags", function(data) { + // Search for rows corresponding to the time of handling + let deletionDate = $(data).find("span[title='" + time + "']"); + if (deletionDate.length == 0) + return; + + // Find last cell in the row, it contains the feedback (if any) + let cells = deletionDate[0].parentElement.parentElement.children; + let lastCell = cells[cells.length - 1]; + let feedback = lastCell.getAttribute("title"); + if (feedback == null || feedback.length == 0) + return; + + // Add feedback to each "Flag processed" entry + post.find("li").each(function() { + if (!this.innerText.startsWith("Flag processed")) + return; + let index = this.innerText.indexOf(") -"); + this.innerText = this.innerText.substring(0, index) + ", " + feedback + this.innerText.substring(index); + }) + }); + }); +})();