User:Leag/navbox.js
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Firefox/Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.
//<pre> <nowiki> // Personalisation de la boite de navigation ainsi que de la boite utilisateur (haut de page) function OptimizedNavig() { // nav box var a = document.getElementById("p-navigation"); if (a) { b = a.getElementsByTagName("ul"); if(b.length > 0) { var startUrl = '/w/index.php?title=' var endUrl = '&action=purge' // liste des URLs var urls = new Array() urls[0] = 'User:Leag' urls[1] = 'User:Leag/index' var labels = new Array() labels[0] = 'Leag' labels[1] = 'Index' for (var i=0;i<urls.length;i+=2) { tableHTML = '<table valign="top" cellspacing="0" cellpadding="0">' tableHTML += '<tr>' tableHTML += '<li><td><a href="' + startUrl + urls[i] + endUrl + '">' + labels[i] + ' | </a></td>' tableHTML += '<td><a href="' + startUrl + urls[i+1] + endUrl + '">' + labels[i+1] + '</a></td></li>' tableHTML += '</tr>' tableHTML += '</table>' b[0].innerHTML = b[0].innerHTML + tableHTML } } } } addOnloadHook(OptimizedNavig); function TodayDate() { var m = new Array("janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre") var today = new Date() var day = today.getDate() var year = today.getYear() if (year < 2000) year += 1900 return (day + " " + m[today.getMonth()] + " " + year) } //</nowiki></pre>