Jump to content

User:Smith609/toolbox.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Smith609 (talk | contribs) at 07:15, 26 February 2011 (Farm out citation bot to citations.js). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
include("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 thisMonth = (now.getDay() > 6);
   if (thisMonth) month++;
   if (month == 0) var month = 12;
   else var month =  ((month <10)?'0':'') + month;
   addPortletLink("p-stats", "http://stats.grok.se/en/" + now.getFullYear() + month + "/"+encodeURI(wgPageName), 'Traffic stats', '', "Traffic to this page " + (thisMonth?'this':'last') + " month");
   addPortletLink("p-stats", "http://wikidashboard.parc.com/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);
}