MediaWiki:Monobook.css

De Lgmaths.

Note : après avoir enregistré vos préférences, 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 (Maj-Cmd-R sur Apple Mac) ; Internet Explorer / Opera : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5.

/* Fenêtres arrondies (pour les navigateurs moz/firefox/gecko) */
 
.pBody {
   padding: 0.3em 0.3em;
   -moz-border-radius-topright: 0.5em;
}
 
.portlet h5 {
   -moz-border-radius-topright: 0.5em;
}
 
#p-cactions ul li, #p-cactions ul li a {  
  -moz-border-radius-topright: 0.5em;
  -moz-border-radius-topleft: 0.5em;
}
// Modification de l'onglet Google de Dake par GôTô
function getArticleName()
{
	var strOut = document.title
	// case search
	if (strOut == "Rechercher - Wikipédia")
		return document.getElementById("lsearchbox").value
	// case article being modified
	strOut = strOut.replace("modification de ", "").replace(" - Modifier", "")
 
	strOut = strOut.replace(" - Prévisualiser", "")	
	strOut = strOut.replace(" - Wikipédia", "")
	return strOut
}
 
var whichWiki = "en"
function setWiki()
{
	var newWiki = document.getElementById("elmtWhichWiki").value
	// trim
	newWiki = newWiki.replace(/ /g, "")
	if (/com(mon)?/.test(newWiki))
		newWiki = "commons"
	else if (/méta/.test(newWiki))
		newWiki = "meta"
	// no need to change
	if (newWiki == whichWiki)
		return
	var elmt = document.getElementById("whichW")
	// it was a wikipedia and now it's a wikimedia (commons or meta)
	if (/commons|meta/.test(newWiki) && !(/commons|meta/.test(whichWiki)))
	{
		elmt.href = elmt.href.replace(".wikipedia.org", ".wikimedia.org")
		elmt.title = elmt.title.replace(".wikipedia.org", ".wikimedia.org")
	}
	// it was a wikimedia (commons or meta) and now it's a wikipedia
	else if (/commons|meta/.test(whichWiki) && !(/commons|meta/.test(newWiki)))
	{
		elmt.href = elmt.href.replace(".wikimedia.org", ".wikipedia.org")
		elmt.title = elmt.title.replace(".wikimedia.org", ".wikipedia.org")
	}
	// in any case
	elmt.href = elmt.href.replace("http://" + whichWiki, "http://" + newWiki)
	elmt.title = elmt.title.replace("sur " + whichWiki, "sur " + newWiki)
	whichWiki = newWiki
}
 
function searchLinks()
{
	var site = (/commons|meta/.test(whichWiki) ? 'wikimedia' : 'wikipedia')
	var a = document.getElementById("p-cactions")
	if (a)
	{
		var pageName = getArticleName()
		var ulElmt = a.getElementsByTagName("ul")
 
		if(ulElmt.length > 0)
		{
			ulElmt[0].innerHTML += '<li><a id="whichW" onmousedown="setWiki()" onkeydown="setWiki()" href="http://' + whichWiki + '.' + site + '.org/wiki/Special:Search?search=' + pageName + '" title="Rechercher ' + pageName + '">'
			+ 'Recherche wp</a>'
			+ '<input type=text id="elmtWhichWiki" style="color : #002bb8; font: normal 8pt Arial; text-align: top; border: 0px; background: none; width: 50px" maxlength="7" value="' + whichWiki + '">'
			+ '<span style="color: #002bb8; font-weight: bold; padding-left: 0.5em; background: none">G:</span>'
			+ '<a href="http://www.google.fr/search?num=20&hl=en&safe=off&q=site%3Afr.wikipedia.org+' + pageName + '&btnG=Search" title="Rechercher sur Google dans fr.wikipédia.org">'
			+ 'wp-fr</a>'
			+ '<a href="http://www.google.fr/search?num=20&hl=en&safe=off&q=site%3Awikipedia.org+' + pageName + '&btnG=Search" title="Rechercher sur Google dans wikipédia.org">'
			+ 'wp</a>'
			+ '<a href="http://www.google.fr/search?num=20&hl=fr&safe=off&q=' + pageName + '&btnG=Search&meta=lr%3Dlang_fr" title="Rechercher sur Google dans tout le web en français">'
			+ 'web-fr</a>'
			+ '<a href="http://www.google.fr/search?num=20&hl=en&safe=off&q=' + pageName + '&btnG=Search" title="Rechercher sur Google dans tout le web">'
			+ 'web</a>'
			+ '</li>'
		}
	}
} 
addOnloadHook(searchLinks)
Outils personnels