Jump to content

User:Leag/editcount.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.
//<pre><nowiki>
/* Lien Editcount */
var tabAction = "p-cactions";
function addECButton()
       {
        if ( window.location.href.indexOf('Contributions') < 0) return;
        var c = document.getElementById('contentSub');
        var a = c.getElementsByTagName('a');
        name = a[0].innerHTML;
        var l = document.getElementById(tabAction);
        t = l.innerHTML;
        ind = t.toLowerCase().indexOf("</ul>");
        before = t.substring(0,ind);
        after = t.substring(ind); 
        pitem = "<li><a href='http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user="+escape(name)+"&dbname=enwiki_p'>"+
                "<div id='EditCount' style='display:inline;'>" + 
                "Editcount"  + 
                "</div></a></li>";
        l.innerHTML = before + pitem + after ;           
      }
$(addECButton);
//</nowiki></pre>