Merge pull request #12 from iBug/patch-1

Various fixes
This commit is contained in:
Glorfindel83 2019-01-15 19:21:38 +01:00 committed by GitHub
commit 1c04b50773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 18 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 0.2 // @version 0.3
// @match *://meta.stackexchange.com/questions/* // @match *://meta.stackexchange.com/questions/*
// @match *://meta.stackoverflow.com/questions/* // @match *://meta.stackoverflow.com/questions/*
// @exclude *://meta.stackexchange.com/questions/ask // @exclude *://meta.stackexchange.com/questions/ask
@ -13,7 +13,7 @@
// @grant none // @grant none
// ==/UserScript== // ==/UserScript==
(function () { (function ($) {
"use strict"; "use strict";
let question = $('#question'); let question = $('#question');
@ -23,10 +23,8 @@
// happens with Community Wiki posts // happens with Community Wiki posts
return; return;
let reputation = owner.find('span.reputation-score')[0].innerText; let reputation = owner.find('span.reputation-score')[0].innerText;
if (document.location.host == 'meta.stackexchange.com') { if (reputation === "1") {
// Simple check: reputation = 1 // Do nothing: 1 rep qualifies for a lost soul
if (reputation != "1")
return;
} else { } else {
// Other meta sites require some reputation to post a question, so we need other rules: // Other meta sites require some reputation to post a question, so we need other rules:
let isNewContributor = owner.find('span.js-new-contributor-label').length > 0; let isNewContributor = owner.find('span.js-new-contributor-label').length > 0;
@ -146,6 +144,6 @@
}); });
} }
// TODO: reload page after all calls are finished window.setTimeout(() => window.location.reload(false), 800);
}); });
})(); })(window.jQuery);