« MediaWiki:Gadget-OngletGoogle.js » : différence entre les versions

Contenu supprimé Contenu ajouté
Seb35 (discussion | contributions)
Seb35 (discussion | contributions)
m retour -> Korrigan, +cat
Ligne 1 :
//<source lang="javascript" line>
/*
* Onglet Google
Ligne 6 ⟶ 5 :
*
* Auteur : Dake, Hégésippe
* Dernière révision : 322 novembre 20062007
//</source> * [[Catégorie:MediaWiki:Fonction Monobook en JavaScript]]
*/
 
function OngletGoogle() {
var a = document.getElementById("p-cactions");
if (a && wgNamespaceNumber >= 0) {
if (a)
b = a.getElementsByTagName("ul");
{
if if(b.length > 0) {
var pageName = document.title.replace(" - Wikipédia", "");
b[0].innerHTML = b[0].innerHTML
b = a.getElementsByTagName("ul");
+ '<li id="ca-nstab-user"><img src="http://www.google.com/intl/en/logos/Logo_60wht.gif" height="20px">'
 
+ '<a href="http://www.google.fr/search?num=20&hl=en&safe=off&q=site%3Afr.wikipedia.org+' + pageName wgPageName + '&btnG=Search">'
if(b.length > 0)
+ {'(fr)</a>'
+ '<a href="http://www.google.fr/search?num=20&hl=en&safe=off&q=' + pageNamewgPageName + '&btnG=Search">'
b[0].innerHTML = b[0].innerHTML
if+ '(aweb)</a>'
+ '<li id="ca-nstab-user"><img src="http://www.google.com/intl/en/logos/Logo_60wht.gif" height="20px">'
{+ '</li>';
+ '<a href="http://www.google.fr/search?num=20&hl=en&safe=off&q=site%3Afr.wikipedia.org+' + pageName + '&btnG=Search">'
}
+ '(fr)</a>'
}
+ '<a href="http://www.google.fr/search?num=20&hl=en&safe=off&q=' + pageName + '&btnG=Search">'
+ '(web)</a>'
+ '</li>';
}
}
}
addOnloadHook(OngletGoogle);
//</source>[[Catégorie:MediaWiki:Fonction Monobook en JavaScript]]