Utilisateur:VieuxSale/monobook.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 TodayDate() {
m = new Array("janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre");
today = new Date();
day = today.getDate();
year = today.getYear();
if (year < 2000)
year = year + 1900;
return (day + " " + m[today.getMonth()] + " " + year);
}
function getWeekNr()
{
var today = new Date();
Year = takeYear(today);
Month = today.getMonth();
Day = today.getDate();
now = Date.UTC(Year,Month,Day+1,0,0,0);
var Firstday = new Date();
Firstday.setYear(Year);
Firstday.setMonth(0);
Firstday.setDate(1);
then = Date.UTC(Year,0,1,0,0,0);
var Compensation = Firstday.getDay();
if (Compensation > 3) Compensation -= 4;
else Compensation += 3;
NumberOfWeek = Math.round((((now-then)/86400000)+Compensation)/7);
return NumberOfWeek;
}
function takeYear(theDate)
{
x = theDate.getYear();
var y = x % 100;
y += (y < 38) ? 2000 : 1900;
return y;
}
function Semaine_courante() {
today = new Date();
year = today.getYear();
if (year < 2000)
year = year + 1900;
return ("semaine " + getWeekNr() + " " + year );
}
function Menu() {
var tDate = TodayDate();
var tSemaine = Semaine_courante();
var a = document.getElementById("p-navigation");
if (a) {
b = a.getElementsByTagName("ul");
if (b.length > 0) {
b[0].innerHTML = b[0].innerHTML
+ '<li><span title="Page courante du Bistro">'
+ '<a href="https://fr.m.vvikipidea.org/wiki/Wikipédia:Le Bistro/'+ tDate +'">Bistro</a></span></li>'
+ '<li><span title="Page courante de l’Oracle">'
+ '<a href="https://fr.m.vvikipidea.org/wiki/Wikipédia:Oracle/'+ tSemaine +'">Oracle</a></span></li>'
+ '<li><span title="Pages à supprimer">'
+ '<a href="https://fr.m.vvikipidea.org/wiki/Wikipédia:Pages à supprimer">PàS</a></span></li>'
}
}
}
// D'après Anakin
function startGoogleSearch()
{
var textsearch = document.getElementById('searchInput').value;
var link = "http://www.google.com/search?q=site%3Afr.wikipedia.org+";
link = link + textsearch;
window.location = link;
}
function googleSearch()
{
var pSearchElement = document.getElementById('searchform');
var newElement = document.createElement("input");
newElement.setAttribute("type", "button");
newElement.setAttribute("name", "googlesearch");
newElement.setAttribute("class", "searchButton");
newElement.setAttribute("value", "Google wiki-fr");
newElement.setAttribute("onClick", "startGoogleSearch()");
pSearchElement.appendChild(newElement);
}
$(Menu);
$(googleSearch);