User:Smith609/toolbox.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | Documentation for this user script can be added at User:Smith609/toolbox. |
<!-- if you are using the "expand citations" gadget, then you'll want to install toolbox2.js instead or the links will be duplicated -->
importScript("User:Smith609/citations.js");
function addToToolbox() {
if (wgCanonicalNamespace != "Special") {
var pTb = document.getElementById("p-tb");
if( !pTb ) return;
var pStats = pTb.cloneNode(true);
pStats.id="p-stats";
pStats.innerHTML = "<h5>Statistics</h5><div class=pBody><ul></ul></div>";
pTb.parentNode.insertBefore(pStats, pTb.nextSibling);
/* var now = new Date();
var month = now.getMonth();
var year = now.getFullYear();
var thisMonth = (now.getDay() > 6);
if (thisMonth) month++;
if (month == 0) {
month = 12;
year--;
} else month = ((month <10)?'0':'') + month; */
addPortletLink("p-stats", "http://stats.grok.se/en/latest30/" + encodeURI(wgPageName), 'Traffic stats', '', "Traffic to this page in the last month");
addPortletLink("p-stats", "https://wikidashboard.appspot.com/enwiki/wiki/"+encodeURI(wgPageName), 'Edit history stats', '', "Statistics about the edit history of this page");
addPortletLink("p-stats", "http://toolserver.org/~mzmcbride/watcher/?db=enwiki_p&titles="+encodeURIComponent(wgPageName), 'Page watchers', "Number of people with this page on their watchlist");
}
}
if( skin == "myskin" || skin == "simple" || skin == "monobook" || skin == "modern" || skin == "chick" || skin == "vector") {
addOnloadHook(addToToolbox);
}