Utilisateur:ILJR/vector.js
Note : après avoir enregistré la page, vous devrez forcer le rechargement complet du cache de votre navigateur pour voir les changements.
Mozilla / Firefox / Konqueror / Safari : maintenez la touche Majuscule (Shift) en cliquant sur le bouton Actualiser (Reload) ou pressez Maj-Ctrl-R (Cmd-R sur Apple Mac) ;
Firefox (sur GNU/Linux) / Chrome / Internet Explorer / Opera : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5.function addArticleTrafficStatistics()
{
var histo = document.getElementById("ca-history");
if(histo)
{
var a = document.createElement("a");
var spanTag = document.createElement("span");
var stats = document.createElement("li");
var today = new Date();
var annee = today.getYear() + 1900;
var mois = new String(today.getMonth() + 1);
if(mois.length < 2)
{
mois = "0" + mois;
}
stats.setAttribute("id", "ca-stats");
stats.setAttribute("class", "collapsible");
a.setAttribute("href", "http://stats.grok.se/fr/" + annee + mois + "/" + mw.config.get('wgPageName'));
spanTag.innerHTML = "Fréquentation";
a.appendChild(spanTag);
stats.appendChild(a);
histo.parentNode.insertBefore(stats, histo.nextSibling);
}
}
$(addArticleTrafficStatistics);