Gebruiker:Rots61/Gadget-Opschonen2.js: verschil tussen versies
Naar navigatie springen
Naar zoeken springen
(Nieuwe pagina aangemaakt met '→jshint sub:true maxerr:100000: // Gadget gemaakt door User:Rots61, maar dan nu beter. // Documentatie op WikiKids:Opschonen var text; var api = new mw...') |
|||
Regel 7: | Regel 7: | ||
var Nummer; | var Nummer; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
function fromPageaddPageOpschonen() { | function fromPageaddPageOpschonen() { | ||
− | + | artikel = mw.config.get('wgTitle'); | |
− | + | user = mw.config.get('wgUserName'); | |
− | + | checkopmerking = prompt("Mogelijke opmerking over het artikel: "); | |
− | + | if (checkopmerking === null) return; | |
− | + | response = callSite({checked: artikel, user: user, opmerking: checkopmerking}); | |
− | + | mw.notify(response); | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } | ||
Regel 414: | Regel 72: | ||
action: "query", | action: "query", | ||
prop: "linkshere", | prop: "linkshere", | ||
− | titles: | + | titles: mw.config.get('wgPageName'), |
lhnamespace: "100", | lhnamespace: "100", | ||
lhlimit: "50", | lhlimit: "50", | ||
Regel 433: | Regel 91: | ||
action: "query", | action: "query", | ||
prop: "revisions", | prop: "revisions", | ||
− | titles: | + | titles: mw.config.get('wgPageName'), |
rvlimit: "1", | rvlimit: "1", | ||
rvprop: "content|size", | rvprop: "content|size", | ||
Regel 450: | Regel 108: | ||
prop: "categories", | prop: "categories", | ||
clcategories: "Categorie:Wikikids:Doorverwijspagina", | clcategories: "Categorie:Wikikids:Doorverwijspagina", | ||
− | titles: | + | titles: mw.config.get('wgPageName'), |
}).then(function (data) { | }).then(function (data) { | ||
temp = data.query.pages; | temp = data.query.pages; | ||
Regel 464: | Regel 122: | ||
action: "query", | action: "query", | ||
prop: "categories", | prop: "categories", | ||
− | titles: | + | titles: mw.config.get('wgPageName'), |
clshow: "!hidden", | clshow: "!hidden", | ||
}).then(function (data) { | }).then(function (data) { | ||
Regel 478: | Regel 136: | ||
action: "query", | action: "query", | ||
prop: "revisions", | prop: "revisions", | ||
− | titles: | + | titles: mw.config.get('wgPageName'), |
rvlimit: "1", | rvlimit: "1", | ||
rvprop: "user", | rvprop: "user", | ||
Regel 499: | Regel 157: | ||
prop: "categories", | prop: "categories", | ||
clcategories: "Category:Woordenschat", | clcategories: "Category:Woordenschat", | ||
− | titles: | + | titles: mw.config.get('wgPageName'), |
}).then(function (data) { | }).then(function (data) { | ||
temp = data.query.pages; | temp = data.query.pages; | ||
Regel 515: | Regel 173: | ||
prop: "categories", | prop: "categories", | ||
clcategories: "Category:WikiKids:Beginnetje", | clcategories: "Category:WikiKids:Beginnetje", | ||
− | titles: | + | titles: mw.config.get('wgPageName'), |
}).then(function (data) { | }).then(function (data) { | ||
temp = data.query.pages; | temp = data.query.pages; | ||
Regel 529: | Regel 187: | ||
action: "query", | action: "query", | ||
prop: "links", | prop: "links", | ||
− | titles: | + | titles: mw.config.get('wgPageName'), |
pllimit: "5000", | pllimit: "5000", | ||
}).then(function (data) { | }).then(function (data) { | ||
Regel 547: | Regel 205: | ||
action: "query", | action: "query", | ||
prop: "linkshere", | prop: "linkshere", | ||
− | titles: | + | titles: mw.config.get('wgPageName'), |
lhnamespace: "0", | lhnamespace: "0", | ||
lhlimit: "50", | lhlimit: "50", | ||
Regel 564: | Regel 222: | ||
document.getElementById("gadget-hint-gecontroleerd").style.display = ""; | document.getElementById("gadget-hint-gecontroleerd").style.display = ""; | ||
} else { | } else { | ||
− | + | title = mw.config.get('wgTitle'); | |
− | + | callSite({check: mw.config.get('wgTitle')}).done(function (resp) { | |
− | + | if (resp[title].checked) { | |
− | |||
− | |||
document.getElementById("gadget-hint-gecontroleerd").style.display = ""; | document.getElementById("gadget-hint-gecontroleerd").style.display = ""; | ||
} | } | ||
}); | }); | ||
} | } | ||
+ | } | ||
+ | |||
+ | function callSite(obj) { | ||
+ | obj.check; // return {Appel: {checked: true}} | ||
+ | obj.stats = true; // return stats; | ||
+ | obj.checked; // Zorgt ervoor dat die afgevinkt wordt | ||
+ | obj.user; // | ||
+ | obj.opmerking // | ||
} | } | ||
Regel 580: | Regel 244: | ||
generator: "links", | generator: "links", | ||
prop: "categories", | prop: "categories", | ||
− | titles: | + | titles: mw.config.get('wgPageName'), |
gpllimit: "5000", | gpllimit: "5000", | ||
cllimit: "5000", | cllimit: "5000", | ||
Regel 599: | Regel 263: | ||
action: "query", | action: "query", | ||
prop: "extlinks|categories", | prop: "extlinks|categories", | ||
− | titles: | + | titles: mw.config.get('wgPageName'), |
ellimit: "5000", | ellimit: "5000", | ||
}).then(function (data) { | }).then(function (data) { | ||
Regel 626: | Regel 290: | ||
} | } | ||
}); | }); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } | ||
Regel 699: | Regel 350: | ||
}; | }; | ||
if (mw.util.getParamValue('action') === 'stats') { | if (mw.util.getParamValue('action') === 'stats') { | ||
− | + | callSite({'stats':true}).done(function (text) { | |
statsOpschonen(text); | statsOpschonen(text); | ||
}); | }); | ||
} else { | } else { | ||
− | |||
showUser = mw.util.getParamValue('user'); | showUser = mw.util.getParamValue('user'); | ||
showStartwith = mw.util.getParamValue('startwith'); | showStartwith = mw.util.getParamValue('startwith'); | ||
var tussenvoegsel; | var tussenvoegsel; | ||
document.getElementById('bodyContent').innerHTML = "Laden... krijg je niets te zien? Maak hier dan een melding van bij mij met deze url:" + document.URL; | document.getElementById('bodyContent').innerHTML = "Laden... krijg je niets te zien? Maak hier dan een melding van bij mij met deze url:" + document.URL; | ||
− | |||
− | |||
var temp; | var temp; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
var paginalink; | var paginalink; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } | ||
} | } | ||
Regel 754: | Regel 367: | ||
document.getElementById("footer-places").innerHTML += '<li id="footer-places-gadget-opschonen">Hints zijn gemaakt door <a href="/User:Rots61" title="Gebruiker:Rots61">Rots61</a></li>'; | document.getElementById("footer-places").innerHTML += '<li id="footer-places-gadget-opschonen">Hints zijn gemaakt door <a href="/User:Rots61" title="Gebruiker:Rots61">Rots61</a></li>'; | ||
//varvar | //varvar | ||
− | |||
var articleId = mw.config.get('wgArticleId'); | var articleId = mw.config.get('wgArticleId'); | ||
var beg = false; | var beg = false; | ||
Regel 760: | Regel 372: | ||
var link = 0; | var link = 0; | ||
var temp; | var temp; | ||
− | |||
var articlesize; | var articlesize; | ||
var linksopartikel; | var linksopartikel; |
Huidige versie van 29 jul 2025 om 01:11
/* jshint sub:true maxerr:100000 */
// Gadget gemaakt door [[User:Rots61]], maar dan nu beter.
// Documentatie op [[WikiKids:Opschonen]]
var text;
var api = new mw.Api();
var alreadydone;
var Nummer;
function fromPageaddPageOpschonen() {
artikel = mw.config.get('wgTitle');
user = mw.config.get('wgUserName');
checkopmerking = prompt("Mogelijke opmerking over het artikel: ");
if (checkopmerking === null) return;
response = callSite({checked: artikel, user: user, opmerking: checkopmerking});
mw.notify(response);
}
function startHintsOpschonen() {
paginalink = 'https://wikikids.nl/Wikikids:Wikiproject/Opschonen#';
document.getElementById('mw-content-text').innerHTML = '<div id="gadget-ophalen">Hints ophalen</div>'
+ '<div id="gadget-hint-standaard">Er kunnen taal of spellingsfouten in het artikel staan. De opmaak kan te wensen overlaten. Ook kan de informatie niet kloppen. </div>'
+ '<div id="gadget-hint-http" style="color:red; display:none;">Er is een link die begint met http. (<a href="' + paginalink + 'HTTP_links">Wat moet ik doen?</a>)</div>'
+ '<div id="gadget-hint-vreemdelink" style="color:red; display:none;">Er klopt iets niet met een link. (<a href="' + paginalink + 'Link_klopt_niet">Wat moet ik doen?</a>)</div>'
+ '<div id="gadget-hint-dp" style="color:red; display:none;">Er staat een link naar een doorverwijspagina op dit artikel. (<a href="' + paginalink + 'Doorverwijspagina">Wat moet ik doen?</a>)</div>'
+ '<span id="gadget-hint-geenlinks" style="color:red; display:none;">Er verwijzen geen andere artikels naar dit artikel. <span id="gadget-hint-welportaal" style="color:green; display:none;">(Wel een portaal) </span>(<a href="' + paginalink + 'Geen_links">Wat moet ik doen?</a>)</span>'
+ '<div id="gadget-hint-grootbeg" style="color:red; display:none;">Dit artikel is wel groot voor een beginnetje. (<a href="' + paginalink + 'Groot_beginnetje">Wat moet ik doen?</a>)</div>'
+ '<div id="gadget-hint-geencat" style="color:red; font-weight:bold; display:none;">Er staat geen categorie op dit artikel. (<a href="' + paginalink + 'Geen_categorie">Wat moet ik doen?</a>)</div>'
+ '<div id="gadget-hint-weiniglinks" style="color:red; display:none;">Er staan te weinig links op dit artikel. (<a href="' + paginalink + 'Te_weinig_links_op_pagina">Wat moet ik doen?</a>)</div>'
+ '<div id="gadget-hint-woordenschat" style="display:none;">Ter informatie: Woordenschatartikel</div>'
+ '<div id="gadget-hint-extlink" style="display:none;">Er staan externe links op deze pagina. (<a href="' + paginalink + 'Externe_links">Wat moet ik doen?</a>)</div>'
+ '<div id="gadget-hint-haslinks-dp" style="display:none;">Er wordt gelinkt naar deze doorverwijspagina. (<a href="' + paginalink + 'Artikel_al_gecontroleerd">Wat moet ik doen?</a>)</div>'
+ '<div id="gadget-hint-hanssain" style="color:green; font-weight:bold; display:none;">Artikel is geschreven door Hanssain. (<a href="' + paginalink + 'Artikel_gemaakt_door_gebruiker">Wat moet ik doen?</a>)</div>'
+ '<div id="gadget-hint-mike1023" style="color:green; font-weight:bold; display:none;">Artikel is geschreven door Mike1023. (<a href="' + paginalink + 'Artikel_gemaakt_door_gebruiker">Wat moet ik doen?</a>)</div>'
+ '<div id="gadget-hint-gecontroleerd" style="color:green; font-weight:bold; display:none;">Artikel is al gecontroleerd. (<a href="' + paginalink + 'Artikel_al_gecontroleerd">Wat moet ik doen?</a>)</div>'
+ '<hr id="gadget-ophalenlijn>'
+ document.getElementById('mw-content-text').innerHTML;
getFirstAuteur();
getTextLengthOpschonen();
getBegOpschonen();
checkIfDPOpschonen();
getLinksOut();
checkIfChecked();
getWoordenschat();
getExterneLinks();
setTimeout(removeLoadingOpschonen, 1500);
}
function removeLoadingOpschonen() {
if (!woordenschat) {
if (isDP) {
if (linksopartikel !== 0) {
console.log(linksopartikel);
document.getElementById('gadget-hint-haslinks-dp').style.display = "";
}
} else {
getLinksIn();
getCategoriesOpschonen();
if (articlesize > 2000) {
if (beg) {
document.getElementById('gadget-hint-grootbeg').style.display = "";
}
if (linksopartikel < 5) {
document.getElementById('gadget-hint-weiniglinks').style.display = "";
}
} else if (linksopartikel < 2) {
document.getElementById('gadget-hint-weiniglinks').style.display = "";
}
}
}
api.get({
action: "query",
prop: "linkshere",
titles: mw.config.get('wgPageName'),
lhnamespace: "100",
lhlimit: "50",
lhshow: "!redirect",
}).then(function (data) {
temp = data.query.pages[articleId];
if (typeof temp.linkshere === 'undefined') {
} else {
document.getElementById('gadget-hint-welportaal').style.display = "";
document.getElementById('gadget-hint-geenlinks').style.color = "";
}
});
document.getElementById("gadget-ophalen").innerHTML = "";
}
function getTextLengthOpschonen() {
return api.get({
action: "query",
prop: "revisions",
titles: mw.config.get('wgPageName'),
rvlimit: "1",
rvprop: "content|size",
rvslots: "main",
}).then(function (data) {
temp = data.query.pages;
temp = temp[articleId].revisions["0"].size;
articlesize = temp;
return temp;
});
}
function checkIfDPOpschonen(){
return api.get({
action: "query",
prop: "categories",
clcategories: "Categorie:Wikikids:Doorverwijspagina",
titles: mw.config.get('wgPageName'),
}).then(function (data) {
temp = data.query.pages;
temp = temp[articleId];
if (typeof temp.categories !== 'undefined') {
isDP = true;
}
});
}
function getCategoriesOpschonen() {
return api.get({
action: "query",
prop: "categories",
titles: mw.config.get('wgPageName'),
clshow: "!hidden",
}).then(function (data) {
temp = data.query.pages[articleId].categories;
if (!temp) {
document.getElementById("gadget-hint-geencat").style.display = "";
}
});
}
function getFirstAuteur() {
return api.get({
action: "query",
prop: "revisions",
titles: mw.config.get('wgPageName'),
rvlimit: "1",
rvprop: "user",
rvdir: "newer",
rvslots: "main",
}).then(function (data) {
temp = data.query.pages[articleId].revisions[0].user;
if (temp === "Hanssain") {
document.getElementById("gadget-hint-hanssain").style.display = "";
}
if (temp === "Mike1023") {
document.getElementById("gadget-hint-mike1023").style.display = "";
}
});
}
function getWoordenschat() {
return api.get({
action: "query",
prop: "categories",
clcategories: "Category:Woordenschat",
titles: mw.config.get('wgPageName'),
}).then(function (data) {
temp = data.query.pages;
temp = temp[articleId];
if (typeof temp.categories !== 'undefined') {
woordenschat = true;
document.getElementById('gadget-hint-woordenschat').style.display = "";
}
});
}
function getBegOpschonen() {
return api.get({
action: "query",
prop: "categories",
clcategories: "Category:WikiKids:Beginnetje",
titles: mw.config.get('wgPageName'),
}).then(function (data) {
temp = data.query.pages;
temp = temp[articleId];
if (typeof temp.categories !== 'undefined') {
beg = true;
}
});
}
function getLinksOut() {
return api.get({
action: "query",
prop: "links",
titles: mw.config.get('wgPageName'),
pllimit: "5000",
}).then(function (data) {
temp = data.query.pages;
temp = temp[articleId];
if (typeof temp.links !== 'undefined') {
linksopartikel = temp.links.length;
getDP();
} else {
linksopartikel = 0;
}
});
}
function getLinksIn() {
api.get({
action: "query",
prop: "linkshere",
titles: mw.config.get('wgPageName'),
lhnamespace: "0",
lhlimit: "50",
lhshow: "!redirect",
}).then(function (data) {
temp = data.query.pages[articleId];
if (typeof temp.linkshere === 'undefined') {
document.getElementById("gadget-hint-geenlinks").style.display = "";
}
});
}
function checkIfChecked() {
let valuechecked = mw.util.getParamValue('opschonengecontroleerd');
if (valuechecked === "Done") {
document.getElementById("gadget-hint-gecontroleerd").style.display = "";
} else {
title = mw.config.get('wgTitle');
callSite({check: mw.config.get('wgTitle')}).done(function (resp) {
if (resp[title].checked) {
document.getElementById("gadget-hint-gecontroleerd").style.display = "";
}
});
}
}
function callSite(obj) {
obj.check; // return {Appel: {checked: true}}
obj.stats = true; // return stats;
obj.checked; // Zorgt ervoor dat die afgevinkt wordt
obj.user; //
obj.opmerking //
}
function getDP() {
api.get({
action: "query",
generator: "links",
prop: "categories",
titles: mw.config.get('wgPageName'),
gpllimit: "5000",
cllimit: "5000",
clcategories: "Categorie:Wikikids:Doorverwijspagina",
}).then(function (data) {
temp = data.query.pages;
for (const property in temp) {
if (temp[property].categories) {
console.log(temp[property].title);
document.getElementById("gadget-hint-dp").style.display = "";
}
}
});
}
function getExterneLinks() {
api.get({
action: "query",
prop: "extlinks|categories",
titles: mw.config.get('wgPageName'),
ellimit: "5000",
}).then(function (data) {
temp = data.query.pages;
temp = temp[articleId].extlinks;
if (typeof temp === 'undefined') {
} else {
var tempgetal = 0;
var aantallinks = 0;
while (typeof temp[tempgetal] !== 'undefined') {
if (temp[tempgetal]["*"].startsWith("http:")) {
document.getElementById("gadget-hint-http").style.display = "";
} else if (temp[tempgetal]["*"].startsWith("https:")) {
aantallinks +=1;
} else {
document.getElementById("gadget-hint-vreemdelink").style.display = "";
}
tempgetal += 1;
}
if (beg === true) {
aantallinks -=6;
}
if (aantallinks > 0) {
document.getElementById("gadget-hint-extlink").style.display = "";
}
}
});
}
function statsOpschonen(text){
var xaantal = {"totaal": 300};
var opschonenuser = [];
for (const x of text) {
if (x.D === "D") {
xaantal.totaal += 1;
if (x.U) {
opschonenuser.push(x.U);
if (xaantal[x.U]) {
xaantal[x.U] += 1;
} else {
xaantal[x.U] = 1;
}
}
}
}
var aantalwikikidsartikelen = 5000;
api.get({
action: "query",
meta: 'siteinfo',
siprop: 'statistics'
}).then(function (ret) {
aantalwikikidsartikelen = ret.query.statistics.articles;
console.log('X', ret, aantalwikikidsartikelen);
opschonenuser = removeDuplicates(opschonenuser);
document.getElementsByTagName("h1")[0].textContent = "Speciaal:Opschonen";
document.title = "Opschonen - WikiKids";
var tobody = `<br> Er zijn totaal ${xaantal.totaal} artikelen gecontroleerd. Dat is ${Math.round((xaantal.totaal/aantalwikikidsartikelen) * 100 * 1000) / 1000}% van WikiKids. Hieronder staan alle gebruikers die minimaal een artikel hebben gecontroleerd. <ul>`;
tobody += `<div style="background-color:#eeeeee; width:400px;height:18px;float:left;margin-right:5px;border:1px solid #bbb;"><div style="background-color:#119000;width:${(xaantal.totaal/aantalwikikidsartikelen) * 100 * 4}px;height:18px;"><div style="font-weight:bold;width:400px;text-align:center;height:18px;line-height:18px;color:black;"><abbr title="7 %"></abbr>${Math.round((xaantal.totaal/aantalwikikidsartikelen) * 100 * 1000) / 1000} / 100%</div></div></div><br>`;
console.log(aantalwikikidsartikelen);
for (const x of opschonenuser) {
tobody += '<li>' + x + ' (aantal: ' + xaantal[x] + ')</li>';
}
tobody += '</ul>';
document.getElementById('bodyContent').innerHTML = terugnaaropschonen + tobody;
});
}
function removeDuplicates(arr) {
let unique = arr.reduce(function (acc, curr) {
if (!acc.includes(curr))
acc.push(curr);
return acc;
}, []);
return unique;
}
if (mw.config.get('wgNamespaceNumber') === -1 && mw.config.get('wgTitle') === "Opschonen") {
var terugnaaropschonen = '<div id="contentSub"><span class="subpages">< <a href="/Speciaal:Opschonen" title="Speciaal:Opschonen">Speciaal:Opschonen</a></span></div>';
document.getElementById("footer-places").innerHTML += '<li id="footer-places-gadget-opschonen">Script gemaakt door <a href="/User:Rots61" title="Gebruiker:Rots61">Rots61</a></li>';
var isOpgeslagenOpschonen = false;
window.onbeforeunload = function() {
if (!isOpgeslagenOpschonen) {
return 'Weet je zeker dat je deze pagina wilt verlaten?';
}
return undefined;
};
if (mw.util.getParamValue('action') === 'stats') {
callSite({'stats':true}).done(function (text) {
statsOpschonen(text);
});
} else {
showUser = mw.util.getParamValue('user');
showStartwith = mw.util.getParamValue('startwith');
var tussenvoegsel;
document.getElementById('bodyContent').innerHTML = "Laden... krijg je niets te zien? Maak hier dan een melding van bij mij met deze url:" + document.URL;
var temp;
var paginalink;
}
}
var showHints = mw.util.getParamValue('projectopschonen');
if (showHints) {
document.getElementById("footer-places").innerHTML += '<li id="footer-places-gadget-opschonen">Hints zijn gemaakt door <a href="/User:Rots61" title="Gebruiker:Rots61">Rots61</a></li>';
//varvar
var articleId = mw.config.get('wgArticleId');
var beg = false;
var isDP = false;
var link = 0;
var temp;
var articlesize;
var linksopartikel;
var woordenschat = false;
startHintsOpschonen();
}
if ((mw.config.get('wgNamespaceNumber') === 0) && (mw.config.get('wgArticleId') > 1)) {
document.getElementById("mw-panel").innerHTML += `<nav id="p-op" style="background-color: #1D9CB9" class="vector-menu vector-menu-portal portal"
aria-labelledby="p-op-label" role="navigation">
<h3 id="p-op-label">
<span>Opschonen</span>
</h3>
<div class="body vector-menu-content" style="border-bottom: 1px solid #1D9CB9">
<ul class="vector-menu-content-list">
<li>
<a href="https://wikikids.nl/Speciaal:Opschonen">Speciaal:Opschonen</a>
</li>
<li>
<a href="https://wikikids.nl/${mw.config.get('wgPageName')}?projectopschonen=x">Opschoon hints</a>
</li>
<li>
<button onclick="fromPageaddPageOpschonen()">Gecontroleerd</button>
</li>
</ul>
</div>
</nav>`;
}