From 4db1bda273110fce7bb957249699a3a688da6e80 Mon Sep 17 00:00:00 2001 From: Brock <659011+BrockA@users.noreply.github.com> Date: Sat, 27 Oct 2018 10:11:41 -0700 Subject: [PATCH 1/2] More SEO title, Don't run on unnecessary sites. --- nsfw/nsfw.user.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/nsfw/nsfw.user.js b/nsfw/nsfw.user.js index 99b5c5b..841b060 100644 --- a/nsfw/nsfw.user.js +++ b/nsfw/nsfw.user.js @@ -1,5 +1,5 @@ // ==UserScript== -// @name NSFW +// @name Stack Exchange, Show NSFW post's text // @namespace https://github.com/Glorfindel83/ // @description Shows (potentially NSFW) content for deleted posts whose content is deleted because of being spam or rude/abusive. // @author Glorfindel @@ -13,6 +13,13 @@ // @match *://*.askubuntu.com/* // @match *://*.stackapps.com/* // @match *://*.mathoverflow.net/* +// @exclude *://api.stackexchange.com/* +// @exclude *://blog.*.com/* +// @exclude *://chat.*.com/* +// @exclude *://data.stackexchange.com/* +// @exclude *://elections.stackexchange.com/* +// @exclude *://openid.stackexchange.com/* +// @exclude *://stackexchange.com/* // @grant none // ==/UserScript== @@ -21,7 +28,7 @@ $('span.hidden-deleted-question, span.hidden-deleted-answer').each(function() { let self = this; - + // Load revision history let revisionHistory = $(this).find('a').attr('href'); $.get(revisionHistory, function(historyData) { @@ -34,10 +41,10 @@ let title = $(data).find('a.question-hyperlink')[0].innerHTML; document.getElementById('question-header').getElementsByTagName('h1')[0].innerHTML = title; } - + // Replace post content self.innerHTML = $(data).find('div.post-text')[0].innerHTML; - + // Add link to revision history let postMenu = $(self.parentElement.parentElement).find('div.post-menu')[0]; $(postMenu).append($('|')); @@ -46,4 +53,4 @@ }); }); }); -})(); \ No newline at end of file +})(); From c76f5eefc9865c56058e8869f8813fdad5f4b2c9 Mon Sep 17 00:00:00 2001 From: Brock <659011+BrockA@users.noreply.github.com> Date: Sat, 27 Oct 2018 10:12:54 -0700 Subject: [PATCH 2/2] Update nsfw.user.js --- nsfw/nsfw.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nsfw/nsfw.user.js b/nsfw/nsfw.user.js index 841b060..5bbda94 100644 --- a/nsfw/nsfw.user.js +++ b/nsfw/nsfw.user.js @@ -5,7 +5,7 @@ // @author Glorfindel // @updateURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/nsfw/nsfw.user.js // @downloadURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/nsfw/nsfw.user.js -// @version 0.2 +// @version 0.3 // @match *://*.stackexchange.com/* // @match *://*.stackoverflow.com/* // @match *://*.superuser.com/*