Jump to content

User:Poxnar/vector.js

From Wikipedia, the free encyclopedia
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.
///   statistics for the page

function stats() {
    if (wgCanonicalNamespace == "Special")
        return; 
 
    var currentTime = new Date();
    var month = currentTime.getMonth() + 1;
    var year = currentTime.getFullYear();
 
    if (month < 10) 
        month = '0' + month;
 
    addPortletLink('p-cactions', 'http://stats.grok.se/en/'+ year + month + '/' + wgPageName, "stats", "ca-stats", "Show statistics for the page");
}
 
addOnloadHook(stats);