Gebruiker:MakiBoy/Gadget-TestGadget.js: verschil tussen versies
Naar navigatie springen
Naar zoeken springen
Regel 29: | Regel 29: | ||
} | } | ||
$.when($.ready, mw.loader.using(['mediawiki.util'])).done(function () { | $.when($.ready, mw.loader.using(['mediawiki.util'])).done(function () { | ||
− | if (mw.util.getParamValue('x') !== "N") { | + | if (mw.config.get('wgUserEditCount') < 50) { |
− | + | if (mw.util.getParamValue('x') !== "N") { | |
+ | process(); | ||
+ | } | ||
} | } | ||
}); | }); |
Versie van 13 jan 2023 17:52
function process() {
if (mw.config.get('wgArticleId') === 1) {
var x = document.getElementById("newpagessection").innerHTML;
x = x.replaceAll('\" title=', '?x=hp\" title=');
document.getElementById("newpagessection").innerHTML = x;
}
if (mw.config.get('wgArticleId') >= 0 && mw.config.get('wgNamespaceNumber') === 0) {
var object = {
title: mw.config.get('wgPageName'),
fromMainPage: false
};
if (mw.util.getParamValue('x') === "h") {
object.fromMainPage = true;
}
fetch("https://wikikids.martvanweeghel.nl/pages",
{
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
method: "POST",
body: JSON.stringify(object)
})
.then(function (res) {})
.catch(function (res) {});
}
}
$.when($.ready, mw.loader.using(['mediawiki.util'])).done(function () {
if (mw.config.get('wgUserEditCount') < 50) {
if (mw.util.getParamValue('x') !== "N") {
process();
}
}
});