MediaWiki:JSScripts/GoogleSearch
Aparéncia
//
/*
* GoogleSearch
*
* Boton de recèrca dins Google
*
* Autor : Pabix
* Darrièra revision : 10 de novembre de 2006
*/
//////////////////////ZÒNA PERSONALISABLA//////////////////////
/* servidor Google preferit */ var googlesearchPrefix = "com";
/////////////////FIN DE LA ZÒNA PERSONALISABLA/////////////////
function GoogleSearch(){
var sb = document.getElementById("searchBody");
if (sb) {
var input = document.createElement("input");
with(input) {
setAttribute("type", "hidden");
setAttribute("name", "q");
}
var button = document.createElement("button");
button.innerHTML="Google";
button.setAttribute("class", "searchButton");
var form = document.createElement("form");
with(form) {
setAttribute("action", "http://www.google." + googlesearchPrefix + "/search");
setAttribute("method", "GET");
setAttribute("onsubmit", 'this.q.value=document.getElementById("searchInput").value + " site:fr.wikipedia.org";return true;');
appendChild(input);
appendChild(button);
}
sb.appendChild(form);
}
}
addLoadEvent(GoogleSearch);
//