MediaWiki
Gadget-pagecount.js
From Dogcraft Wiki
No edit summary Tag: Reverted |
No edit summary Tag: Manual revert |
||
Line 24: | Line 24: | ||
actions.parentNode.insertBefore(pagecount, actions); | actions.parentNode.insertBefore(pagecount, actions); | ||
}); | }); | ||
}); | }); |
Revision as of 21:27, 1 February 2023
$( function () {
var pagecount = document.createElement('div'),
link = document.createElement('a'),
pages = document.createElement('span'),
text = document.createElement('span'),
actions = document.getElementById('wikiActions'),
api = new mw.Api(),
num = api.get( {
action:"query",
meta:"siteinfo",
siprop:"statistics",
formatversion:"2"
} );
pagecount.id = 'pagecount';
link.href = "/wiki/Special:AllPages?namespace=0&hideredirects=1";
text.textContent = 'pages';
$.when( num ).then( function ( data ) {
pages.textContent = data.query.statistics.articles;
link.append(pages, text);
pagecount.append(link);
actions.parentNode.insertBefore(pagecount, actions);
});
});
This page was last modified on 1 February 2023, at 21:27. (14 months ago)