MediaWiki
Gadget-pagecount.js
From Dogcraft Wiki
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.
$( function () {
var pagecount,
pages,
output,
api = new mw.Api();
pagecount = $('<div id="pagecount"><a href="/wiki/Special:AllPages?namespace=0&hideredirects=1"><span></span><span>pages</span></a></div>');
$('#wikiActions').before(pagecount);
api.get({action:"query",meta:"siteinfo",siprop:"statistics",formatversion:"2"}).done( function ( data ) {
pages = data.query.statistics.articles;
var temp = $("#pagecount a span:nth-child(1)");
temp[0].innerText = pages;
});
});
This page was last modified on 3 June 2022, at 22:44. (15 months ago)