Merge pull request #9 from BrockA/patch-1
More SEO title, Don't run on unnecessary sites.
This commit is contained in:
commit
ca2a2b63b8
1 changed files with 13 additions and 6 deletions
|
@ -1,11 +1,11 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name NSFW
|
// @name Stack Exchange, Show NSFW post's text
|
||||||
// @namespace https://github.com/Glorfindel83/
|
// @namespace https://github.com/Glorfindel83/
|
||||||
// @description Shows (potentially NSFW) content for deleted posts whose content is deleted because of being spam or rude/abusive.
|
// @description Shows (potentially NSFW) content for deleted posts whose content is deleted because of being spam or rude/abusive.
|
||||||
// @author Glorfindel
|
// @author Glorfindel
|
||||||
// @updateURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/nsfw/nsfw.user.js
|
// @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
|
// @downloadURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/nsfw/nsfw.user.js
|
||||||
// @version 0.2
|
// @version 0.3
|
||||||
// @match *://*.stackexchange.com/*
|
// @match *://*.stackexchange.com/*
|
||||||
// @match *://*.stackoverflow.com/*
|
// @match *://*.stackoverflow.com/*
|
||||||
// @match *://*.superuser.com/*
|
// @match *://*.superuser.com/*
|
||||||
|
@ -13,6 +13,13 @@
|
||||||
// @match *://*.askubuntu.com/*
|
// @match *://*.askubuntu.com/*
|
||||||
// @match *://*.stackapps.com/*
|
// @match *://*.stackapps.com/*
|
||||||
// @match *://*.mathoverflow.net/*
|
// @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
|
// @grant none
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
|
@ -21,7 +28,7 @@
|
||||||
|
|
||||||
$('span.hidden-deleted-question, span.hidden-deleted-answer').each(function() {
|
$('span.hidden-deleted-question, span.hidden-deleted-answer').each(function() {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
// Load revision history
|
// Load revision history
|
||||||
let revisionHistory = $(this).find('a').attr('href');
|
let revisionHistory = $(this).find('a').attr('href');
|
||||||
$.get(revisionHistory, function(historyData) {
|
$.get(revisionHistory, function(historyData) {
|
||||||
|
@ -34,10 +41,10 @@
|
||||||
let title = $(data).find('a.question-hyperlink')[0].innerHTML;
|
let title = $(data).find('a.question-hyperlink')[0].innerHTML;
|
||||||
document.getElementById('question-header').getElementsByTagName('h1')[0].innerHTML = title;
|
document.getElementById('question-header').getElementsByTagName('h1')[0].innerHTML = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace post content
|
// Replace post content
|
||||||
self.innerHTML = $(data).find('div.post-text')[0].innerHTML;
|
self.innerHTML = $(data).find('div.post-text')[0].innerHTML;
|
||||||
|
|
||||||
// Add link to revision history
|
// Add link to revision history
|
||||||
let postMenu = $(self.parentElement.parentElement).find('div.post-menu')[0];
|
let postMenu = $(self.parentElement.parentElement).find('div.post-menu')[0];
|
||||||
$(postMenu).append($('<span class="lsep">|</span>'));
|
$(postMenu).append($('<span class="lsep">|</span>'));
|
||||||
|
@ -46,4 +53,4 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue