Gebruiker:Wikiklaas/nuwegscript.js
Opmerking: nadat u de wijzigingen hebt gepubliceerd is het wellicht nodig uw browsercache te legen.
- Firefox / Safari: houd Shift ingedrukt terwijl u op Vernieuwen klikt of druk op Ctrl-F5 of Ctrl-R (⌘-Shift-R op een Mac)
- Google Chrome: druk op Ctrl-Shift-R (⌘-Shift-R op een Mac)
- Internet Explorer / Edge: houd Ctrl ingedrukt terwijl u op Vernieuwen klikt of druk op Ctrl-F5
- Opera: druk op Ctrl-F5.
/**
* Shows the number of speedy deletion requests in the personal menu bar
* based on the number of pages in [[:Categorie:Wikipedia:Nuweg]].
* The script is based on the work of Sumurai8 at:
* https://nl.wikipedia.org/w/index.php?title=Gebruiker:Sumurai8/coachscript.js&oldid=23618958
* With additions by Basvb and improvements by/from the suggestions of Jurgen and Steinsplitter.
* Adapted for the monobook skin once again by Wikiklaas.
*/
$.post(
{
url:'/w/api.php',
data: {
action: 'purge',
titles: 'Gebruiker:Wikiklaas/Nuweg',
format: 'json'
}
}
).done( function ( data ) {
console.log(data);
} );
function nuwegscript() {
$.get(
mw.config.get( 'wgScript' ), {
title: 'Gebruiker:Wikiklaas/Nuweg',
action: 'render'
},
function( data ) {
if( mw.config.get('skin') == 'monobook' ) {
// $('<li id="nuweg"></li>').html(data).insertBefore($('#p-personal ul:first-of-type>li:first')); // voor mij uitgedokterd door Mbch331
// Hierbij moet in monobook.css nog de regel #nuweg .mw-parser-output {display: inline-block;} worden ingevoegd.
$('<li></li>').html(data).insertBefore($('#p-personal ul:first-of-type>li:first')).attr('id', 'pt-nuweg');
$('#pt-nuweg>div').css('display', 'inline-block');
}
else if( mw.config.get('skin') == 'vector' ) {
$('<li></li>').html(data).insertBefore($('#p-personal ul:first-of-type>li:first'));
}
else {
console.error( "Het script Gebruiker:Wikiklaas/nuwegcript.js is uitgeschakeld voor deze skin." );
}
}
);
}
jQuery( document ).ready( function( $ ) {
window.setTimeout("nuwegscript()", 200);
} );