User:Samuele2002/List.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
//Per raccogliere in una pagina tutti i link a sottopagine di Special:BalnkPage
mw.loader.using(['mediawiki.api', 'mediawiki.Title'], function () {
"use strict";
var config = mw.config.get(['wgNamespaceNumber', 'wgTitle', 'wgUserGroups', 'skin']);
function list() {
var bodyContent = (config.skin == "cologneblue" ? "article" : "bodyContent");
document.getElementsByTagName("h1")[0].textContent = "Lista pagine speciali";
document.title = "Lista pagine speciali";
document.getElementById(bodyContent).innerHTML = +
'<form id="wpList" name="wpList">' +
$ListLink; +
$MassblockLink; +
$MassprotectLink; +
//mw.html.element( 'a', { href: mw.util.getUrl( 'Special:BlankPage/Massdelete' ), title: 'Go to Massdelete' }, 'Click here to enter the Massdelete!'); +
//mw.html.element( 'a', { href: mw.util.getUrl( 'Special:BlankPage/FindAndReplace' ), title: 'Go to FindAndReplace' }, 'Click here to enter the FindAndReplace!'); +
// mw.html.element( 'a', { href: mw.util.getUrl( 'Special:BlankPage/List' ), title: 'Go to Sandbox' }, 'Click here to enter the sandbox!');
'</form>';
}
var ListLink = mw.html.element( 'a', { href: mw.util.getUrl( 'Special:BlankPage/List' ), title: 'Go to List' }, 'Click here to enter the List!');
var MassblockLink =mw.html.element( 'a', { href: mw.util.getUrl( 'Special:BlankPage/Massblock' ), title: 'Massblock' }, 'Click here to enter the Massblock!');
var MassprotectLink = mw.html.element( 'a', { href: mw.util.getUrl( 'Special:BlankPage/Massprotect' ), title: 'Massprotect' }, 'Click here to enter the Massprotect!');
if ( mw.config.get('wgCanonicalSpecialPageName') === 'Blankpage' && mw.config.get('wgTitle').split('/', 2)[1] === 'List' ) {
list();
}
});
// On every page
$.when(mw.loader.using('mediawiki.util'), $.ready).then(function () {
mw.util.addPortletLink(
'p-tb',
mw.util.getUrl('Special:BlankPage/List'),
'List'
);
});