User:Quadell/common.js/statistics.js

function addToToolbox { if (mw.config.get('wgCanonicalNamespace') != "Special") { var pTb = document.getElementById("p-tb"); if( !pTb ) return; var pStats = pTb.cloneNode(true); pStats.id="p-stats"; pStats.innerHTML = ' Statistics  '; 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; mw.util.addPortletLink("p-stats", "http://stats.grok.se/en/" + now.getFullYear + month + "/"+encodeURI(mw.config.get('wgPageName')), 'Traffic stats', '', "Traffic to this page " + (thisMonth?'this':'last') + " month"); mw.util.addPortletLink("p-stats", "http://wikidashboard.parc.com/wiki/"+encodeURI(mw.config.get('wgPageName')), 'Edit history stats', '', "Statistics about the edit history of this page"); mw.util.addPortletLink("p-stats", "http://toolserver.org/~mzmcbride/watcher/?db=enwiki_p&titles="+encodeURIComponent(mw.config.get('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); }