Jump to content

User:Leag/navbox.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>

// 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 = '<li>'
                  + '<a href="' + startUrl + urls[i] + endUrl + '">' + labels[i] + '</a>'
                  + '&nbsp;•&nbsp;'
                  + '<a href="' + startUrl + urls[i+1] + endUrl + '">' + labels[i+1] + '</a>'
                  + '</li>'
        b[0].innerHTML = b[0].innerHTML + tableHTML
      }

    }
  }
}

$(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>